diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 397a106a4574b..b398bfcb87c68 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -15,7 +15,7 @@ For more detailed information on contribution please read our [beginners guide]( ## Contribution requirements -1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.3/coding-standards/bk-coding-standards.html). +1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.4/coding-standards/bk-coding-standards.html). 2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests. 3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/2.3-develop/.github/PULL_REQUEST_TEMPLATE.md) for more information. 4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug. @@ -33,7 +33,7 @@ This will allow you to collaborate with the Magento 2 development team, fork the 1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution. 2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing. 3. Create and test your work. -4. Fork the Magento 2 repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#pull_request). +4. Fork the Magento 2 repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#pull_request). 5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed. ## Code of Conduct diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e4633e187480f..a0b3d46286692 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -34,7 +34,7 @@ Important: Provide a set of clear steps to reproduce this bug. We can not provid 2. --- -Please provide [Severity](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes. +Please provide [Severity](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes. - [ ] Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._ - [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._ diff --git a/.github/ISSUE_TEMPLATE/developer-experience-issue.md b/.github/ISSUE_TEMPLATE/developer-experience-issue.md index db5fca78965d6..332e069f7006e 100644 --- a/.github/ISSUE_TEMPLATE/developer-experience-issue.md +++ b/.github/ISSUE_TEMPLATE/developer-experience-issue.md @@ -20,7 +20,7 @@ Fields marked with (*) are required. Please don't remove the template. --- -Please provide [Severity](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes. +Please provide [Severity](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes. - [ ] Severity: **S0** _- Affects critical data or functionality and leaves users with no workaround._ - [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._ diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2856223c5ed1b..fd2f7f1badc28 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -43,4 +43,5 @@ - [ ] Pull request has a meaningful description of its purpose - [ ] All commits are accompanied by meaningful commit messages - [ ] All new or changed code is covered with unit/integration tests (if applicable) + - [ ] README.md files for modified modules are updated and included in the pull request if any [README.md predefined sections](https://github.com/magento/devdocs/wiki/Magento-module-README.md) require an update - [ ] All automated tests passed successfully (all builds are green) diff --git a/README.md b/README.md index 7b959edb4ef7b..1930e4f823c80 100644 --- a/README.md +++ b/README.md @@ -15,21 +15,24 @@

-## Welcome +# Welcome + Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results. ## Magento System Requirements -[Magento System Requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements.html). + +[Magento System Requirements](https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html). ## Install Magento -* [Installation Guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html). +* [Installation Guide](https://devdocs.magento.com/guides/v2.4/install-gde/bk-install-guide.html). ## Learn More About GraphQL in Magento 2 -* [GraphQL Developer Guide](https://devdocs.magento.com/guides/v2.3/graphql/index.html) +* [GraphQL Developer Guide](https://devdocs.magento.com/guides/v2.4/graphql/index.html) + +## Contributing to the Magento 2 Code Base -

Contributing to the Magento 2 Code Base

Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions. To learn about how to contribute, click [here][1]. @@ -38,27 +41,27 @@ To learn about issues, click [here][2]. To open an issue, click [here][3]. To suggest documentation improvements, click [here][4]. -[1]: https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html -[2]: https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#report +[1]: https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html +[2]: https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#report [3]: https://github.com/magento/magento2/issues [4]: https://devdocs.magento.com -

Community Maintainers

+### Community Maintainers + The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks to these Community Maintainers for their valuable contributions. - - - +[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png)](https://magento.com/magento-contributors#maintainers) + +### Top Contributors -

Top Contributors

Magento is thankful for any contribution that can improve our codebase, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform. - - - + +[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png)](https://magento.com/magento-contributors) ### Labels Applied by the Magento Team + We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more. -Please review the [Code Contributions guide](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels) for detailed information on labels used in Magento 2 repositories. +Please review the [Code Contributions guide](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#labels) for detailed information on labels used in Magento 2 repositories. ## Reporting Security Issues @@ -71,18 +74,17 @@ Stay up-to-date on the latest security news and patches for Magento by signing u Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license. [Open Software License (OSL 3.0)](https://opensource.org/licenses/osl-3.0.php). -Please see [LICENSE.txt](https://github.com/magento/magento2/blob/2.3-develop/LICENSE.txt) for the full text of the OSL 3.0 license or contact license@magentocommerce.com for a copy. +Please see [LICENSE.txt](https://github.com/magento/magento2/blob/2.4-develop/LICENSE.txt) for the full text of the OSL 3.0 license or contact license@magentocommerce.com for a copy. Subject to Licensee's payment of fees and compliance with the terms and conditions of the MEE License, the MEE License supersedes the OSL 3.0 license for each source file. -Please see LICENSE_EE.txt for the full text of the MEE License or visit https://magento.com/legal/terms/enterprise. +Please see LICENSE_EE.txt for the full text of the MEE License or visit . ## Community Engineering Slack To connect with Magento and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com). If you are interested in joining Slack, or a specific channel, send us a request at [engcom@adobe.com](mailto:engcom@adobe.com) or [self signup](https://opensource.magento.com/slack). - We have channels for each project. These channels are recommended for new members: -- [general](https://magentocommeng.slack.com/messages/C4YS78WE6): Open chat for introductions and Magento 2 questions -- [github](https://magentocommeng.slack.com/messages/C7KB93M32): Support for GitHub issues, pull requests, and processes -- [public-backlog](https://magentocommeng.slack.com/messages/CCV3J3RV5): Discussions of the Magento 2 backlog +* [general](https://magentocommeng.slack.com/messages/C4YS78WE6): Open chat for introductions and Magento 2 questions +* [github](https://magentocommeng.slack.com/messages/C7KB93M32): Support for GitHub issues, pull requests, and processes +* [public-backlog](https://magentocommeng.slack.com/messages/CCV3J3RV5): Discussions of the Magento 2 backlog diff --git a/app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml b/app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml index f16a66aa090e3..b0e613ffabce0 100644 --- a/app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml +++ b/app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml @@ -11,6 +11,12 @@ assets.adobedtm.com + *.adobe.com + + + + + *.adobe.com @@ -19,6 +25,7 @@ amcglobal.sc.omtrdc.net dpm.demdex.net cm.everesttech.net + *.adobe.com @@ -27,9 +34,15 @@ amcglobal.sc.omtrdc.net + + + *.adobe.com + + fast.amc.demdex.net + *.adobe.com diff --git a/app/code/Magento/AdminAnalytics/view/adminhtml/ui_component/admin_usage_notification.xml b/app/code/Magento/AdminAnalytics/view/adminhtml/ui_component/admin_usage_notification.xml index fcd1c4ebbbcdf..be832ea35392b 100644 --- a/app/code/Magento/AdminAnalytics/view/adminhtml/ui_component/admin_usage_notification.xml +++ b/app/code/Magento/AdminAnalytics/view/adminhtml/ui_component/admin_usage_notification.xml @@ -85,7 +85,7 @@ Help us improve Magento Admin by allowing us to collect usage data.

All usage data that we collect for this purpose cannot be used to individually identify you and is used only to improve the Magento Admin and related products and services.

-

You can learn more and opt out at any time by following the instructions in merchant documentation.

+

You can learn more and opt out at any time by following the instructions in merchant documentation.

]]>
diff --git a/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php b/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php index f7374a961bc84..e2aad39b77adf 100644 --- a/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php +++ b/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php @@ -101,6 +101,8 @@ protected function _getConfigUrl() */ public function getIdentity() { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction return md5('BASE_URL' . $this->_getConfigUrl()); } diff --git a/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php b/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php index c4884ee840ba3..7ec613d367a16 100644 --- a/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php +++ b/app/code/Magento/AdminNotification/Model/System/Message/CacheOutdated.php @@ -62,6 +62,8 @@ protected function _getCacheTypesForRefresh() */ public function getIdentity() { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction return md5('cache' . implode(':', $this->_getCacheTypesForRefresh())); } diff --git a/app/code/Magento/AdminNotification/README.md b/app/code/Magento/AdminNotification/README.md index c22fef1bca97d..2967aa9ac60b4 100644 --- a/app/code/Magento/AdminNotification/README.md +++ b/app/code/Magento/AdminNotification/README.md @@ -5,24 +5,25 @@ The Magento_AdminNotification module provides the ability to alert administrator ## Installation details The Magento_AdminNotification module creates the following tables in the database: + - `adminnotification_inbox` - `admin_system_messages` Before disabling or uninstalling this module, note that the Magento_Indexer module depends on this module. -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_AdminNotification module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_AdminNotification module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdminNotification module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdminNotification module. ### Events This module observes the following events: - - `controller_action_predispatch` event in `Magento\AdminNotification\Observer\PredispatchAdminActionControllerObserver` file. +- `controller_action_predispatch` event in `Magento\AdminNotification\Observer\PredispatchAdminActionControllerObserver` file. ### Layouts @@ -31,10 +32,10 @@ This module introduces the following layouts and layout handles in the `view/adm - `adminhtml_notification_index` - `adminhtml_notification_block` -For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ### UI components You can extend admin notifications using the `view/adminhtml/ui_component/notification_area.xml` configuration file. -For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html). +For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/CurrencyResolver.php b/app/code/Magento/AdvancedPricingImportExport/Model/CurrencyResolver.php new file mode 100644 index 0000000000000..9f930d124fa88 --- /dev/null +++ b/app/code/Magento/AdvancedPricingImportExport/Model/CurrencyResolver.php @@ -0,0 +1,82 @@ +storeManager = $storeManager; + $this->directoryData = $directoryData; + } + + /** + * Get base currency for all websites + * + * @return array associative array with website code as the key and base currency as the value + */ + public function getWebsitesBaseCurrency(): array + { + if ($this->websitesBaseCurrency === null) { + $this->websitesBaseCurrency = []; + foreach ($this->storeManager->getWebsites() as $website) { + $this->websitesBaseCurrency[$website->getCode()] = $website->getBaseCurrencyCode(); + } + } + + return $this->websitesBaseCurrency; + } + + /** + * Get default scope base currency + * + * @return string + */ + public function getDefaultBaseCurrency(): string + { + if ($this->defaultBaseCurrency === null) { + $this->defaultBaseCurrency = $this->directoryData->getBaseCurrencyCode(); + } + + return $this->defaultBaseCurrency; + } +} diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php index 254dbcca852ee..30b2535853e35 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php +++ b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php @@ -5,8 +5,10 @@ */ namespace Magento\AdvancedPricingImportExport\Model\Import; +use Magento\AdvancedPricingImportExport\Model\CurrencyResolver; use Magento\CatalogImportExport\Model\Import\Product as ImportProduct; use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface; +use Magento\Framework\App\ObjectManager; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; /** @@ -15,6 +17,7 @@ * @SuppressWarnings(PHPMD.ExcessiveParameterList) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.TooManyFields) + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity { @@ -42,6 +45,8 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract private const VALIDATOR_TEAR_PRICE = 'validator_tier_price'; private const VALIDATOR_TIER_PRICE = 'validator_tier_price'; + private const ERROR_DUPLICATE_TIER_PRICE = 'duplicateTierPrice'; + /** * Validation failure message template definitions. * @@ -57,8 +62,10 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract ValidatorInterface::ERROR_INVALID_TIER_PRICE_TYPE => 'Value for \'tier_price_value_type\' ' . 'attribute contains incorrect value, acceptable values are Fixed, Discount', ValidatorInterface::ERROR_TIER_DATA_INCOMPLETE => 'Tier Price data is incomplete', - ValidatorInterface::ERROR_INVALID_ATTRIBUTE_DECIMAL => - 'Value for \'%s\' attribute contains incorrect value, acceptable values are in decimal format', + ValidatorInterface::ERROR_INVALID_ATTRIBUTE_DECIMAL => 'Value for \'%s\' attribute contains incorrect value,' . + ' acceptable values are in decimal format', + self::ERROR_DUPLICATE_TIER_PRICE => 'We found a duplicate website, tier price, customer group' . + ' and quantity.' ]; /** @@ -155,6 +162,26 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract */ private $productEntityLinkField; + /** + * @var array + */ + private $websiteScopeTierPrice = []; + + /** + * @var array + */ + private $globalScopeTierPrice = []; + + /** + * @var array + */ + private $allProductIds = []; + + /** + * @var CurrencyResolver + */ + private $currencyResolver; + /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @param \Magento\Framework\Json\Helper\Data $jsonHelper @@ -172,8 +199,9 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract * @param AdvancedPricing\Validator $validator * @param AdvancedPricing\Validator\Website $websiteValidator * @param AdvancedPricing\Validator\TierPrice $tierPriceValidator - * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @param CurrencyResolver|null $currencyResolver * @throws \Exception + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( \Magento\Framework\Json\Helper\Data $jsonHelper, @@ -190,7 +218,8 @@ public function __construct( ImportProduct $importProduct, AdvancedPricing\Validator $validator, AdvancedPricing\Validator\Website $websiteValidator, - AdvancedPricing\Validator\TierPrice $tierPriceValidator + AdvancedPricing\Validator\TierPrice $tierPriceValidator, + ?CurrencyResolver $currencyResolver = null ) { $this->dateTime = $dateTime; $this->jsonHelper = $jsonHelper; @@ -209,6 +238,7 @@ public function __construct( $this->_validators[self::VALIDATOR_WEBSITE] = $websiteValidator; $this->_validators[self::VALIDATOR_TIER_PRICE] = $tierPriceValidator; $this->errorAggregator = $errorAggregator; + $this->currencyResolver = $currencyResolver ?? ObjectManager::getInstance()->get(CurrencyResolver::class); foreach (array_merge($this->errorMessageTemplates, $this->_messageTemplates) as $errorCode => $message) { $this->getErrorAggregator()->addErrorMessageTemplate($errorCode, $message); @@ -270,6 +300,11 @@ public function validateRow(array $rowData, $rowNum) if (false === $sku) { $this->addRowError(ValidatorInterface::ERROR_ROW_IS_ORPHAN, $rowNum); } + + if (!$this->getErrorAggregator()->isRowInvalid($rowNum)) { + $this->validateRowForDuplicate($rowData, $rowNum); + } + return !$this->getErrorAggregator()->isRowInvalid($rowNum); } @@ -634,4 +669,160 @@ private function getProductEntityLinkField() } return $this->productEntityLinkField; } + + /** + * @inheritdoc + */ + protected function _saveValidatedBunches() + { + if (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND === $this->getBehavior() + && !$this->_catalogData->isPriceGlobal() + ) { + $source = $this->_getSource(); + $source->rewind(); + while ($source->valid()) { + try { + $rowData = $source->current(); + } catch (\InvalidArgumentException $exception) { + $source->next(); + continue; + } + $this->validateRow($rowData, $source->key()); + $source->next(); + } + $this->validateRowsForDuplicate(self::TABLE_TIER_PRICE); + } + return parent::_saveValidatedBunches(); + } + + /** + * Validate all row data with existing prices in the database for duplicate + * + * A row is considered a duplicate if the pair (product_id, all_groups, customer_group_id, qty) exists for + * both global and website scopes. And the base currency is the same for both global and website scopes. + * + * @param string $table + */ + private function validateRowsForDuplicate(string $table): void + { + if (!empty($this->allProductIds)) { + $priceDataCollection = $this->getPrices(array_keys($this->allProductIds), $table); + $defaultBaseCurrency = $this->currencyResolver->getDefaultBaseCurrency(); + $websiteCodeBaseCurrencyMap = $this->currencyResolver->getWebsitesBaseCurrency(); + $websiteIdCodeMap = array_flip($this->_storeResolver->getWebsiteCodeToId()); + foreach ($priceDataCollection as $priceData) { + $isDefaultScope = (int) $priceData['website_id'] === 0; + $baseCurrency = $isDefaultScope + ? $defaultBaseCurrency + : $websiteCodeBaseCurrencyMap[$websiteIdCodeMap[$priceData['website_id']] ?? null] ?? null; + $rowNums = []; + $key = $this->getUniqueKey($priceData, $baseCurrency); + if ($isDefaultScope) { + if (isset($this->websiteScopeTierPrice[$key])) { + $rowNums = $this->websiteScopeTierPrice[$key]; + } + } else { + if (isset($this->globalScopeTierPrice[$key])) { + $rowNums = $this->globalScopeTierPrice[$key]; + } + } + foreach ($rowNums as $rowNum) { + $this->addRowError(self::ERROR_DUPLICATE_TIER_PRICE, $rowNum); + } + } + } + } + + /** + * Validate row data for duplicate + * + * A row is considered a duplicate if the pair (product_id, all_groups, customer_group_id, qty) exists for + * both global and website scopes. And the base currency is the same for both global and website scopes. + * + * @param array $rowData + * @param int $rowNum + */ + private function validateRowForDuplicate(array $rowData, int $rowNum) + { + $productId = $this->retrieveOldSkus()[$rowData[self::COL_SKU]] ?? null; + if ($productId && !$this->_catalogData->isPriceGlobal()) { + $productEntityLinkField = $this->getProductEntityLinkField(); + $priceData = [ + $productEntityLinkField => $productId, + 'website_id' => (int) $this->getWebSiteId($rowData[self::COL_TIER_PRICE_WEBSITE]), + 'all_groups' => $rowData[self::COL_TIER_PRICE_CUSTOMER_GROUP] == self::VALUE_ALL_GROUPS ? 1 : 0, + 'customer_group_id' => $this->getCustomerGroupId($rowData[self::COL_TIER_PRICE_CUSTOMER_GROUP]), + 'qty' => $rowData[self::COL_TIER_PRICE_QTY], + ]; + $defaultBaseCurrency = $this->currencyResolver->getDefaultBaseCurrency(); + $websiteCodeBaseCurrencyMap = $this->currencyResolver->getWebsitesBaseCurrency(); + $websiteIdCodeMap = array_flip($this->_storeResolver->getWebsiteCodeToId()); + $baseCurrency = $priceData['website_id'] === 0 + ? $defaultBaseCurrency + : $websiteCodeBaseCurrencyMap[$websiteIdCodeMap[$priceData['website_id']] ?? null] ?? null; + + $this->allProductIds[$productId][] = $rowNum; + $key = $this->getUniqueKey($priceData, $baseCurrency); + if ($priceData['website_id'] === 0) { + $this->globalScopeTierPrice[$key][] = $rowNum; + if (isset($this->websiteScopeTierPrice[$key])) { + $this->addRowError(self::ERROR_DUPLICATE_TIER_PRICE, $rowNum); + } + } else { + $this->websiteScopeTierPrice[$key][] = $rowNum; + if (isset($this->globalScopeTierPrice[$key])) { + $this->addRowError(self::ERROR_DUPLICATE_TIER_PRICE, $rowNum); + } + } + } + } + + /** + * Get the unique key of provided price + * + * @param array $priceData + * @param string $baseCurrency + * @return string + */ + private function getUniqueKey(array $priceData, string $baseCurrency): string + { + $productEntityLinkField = $this->getProductEntityLinkField(); + return sprintf( + '%s-%s-%s-%s-%.4f', + $baseCurrency, + $priceData[$productEntityLinkField], + $priceData['all_groups'], + $priceData['customer_group_id'], + $priceData['qty'] + ); + } + + /** + * Get existing prices in the database + * + * @param int[] $productIds + * @param string $table + * @return array + */ + private function getPrices(array $productIds, string $table) + { + $productEntityLinkField = $this->getProductEntityLinkField(); + return $this->_connection->fetchAll( + $this->_connection->select() + ->from( + $this->_resourceFactory->create()->getTable($table), + [ + $productEntityLinkField, + 'all_groups', + 'customer_group_id', + 'qty', + 'website_id' + ] + ) + ->where( + $productEntityLinkField . ' IN (?)', + $productIds + ) + ); + } } diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/Website.php b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/Website.php index 93c63dcbcab28..5b749ccee837b 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/Website.php +++ b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/Website.php @@ -8,10 +8,12 @@ namespace Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator; +use Magento\AdvancedPricingImportExport\Model\CurrencyResolver; use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing; use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface; use Magento\CatalogImportExport\Model\Import\Product\StoreResolver; use Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractImportValidator; +use Magento\Framework\App\ObjectManager; use Magento\Store\Model\Website as WebsiteModel; class Website extends AbstractImportValidator implements RowValidatorInterface @@ -26,16 +28,24 @@ class Website extends AbstractImportValidator implements RowValidatorInterface */ protected $websiteModel; + /** + * @var CurrencyResolver + */ + private $currencyResolver; + /** * @param StoreResolver $storeResolver * @param WebsiteModel $websiteModel + * @param CurrencyResolver|null $currencyResolver */ public function __construct( StoreResolver $storeResolver, - WebsiteModel $websiteModel + WebsiteModel $websiteModel, + ?CurrencyResolver $currencyResolver = null ) { $this->storeResolver = $storeResolver; $this->websiteModel = $websiteModel; + $this->currencyResolver = $currencyResolver ?? ObjectManager::getInstance()->get(CurrencyResolver::class); } /** @@ -85,6 +95,6 @@ public function isValid($value) public function getAllWebsitesValue() { return AdvancedPricing::VALUE_ALL_WEBSITES . - ' [' . $this->websiteModel->getBaseCurrency()->getCurrencyCode() . ']'; + ' [' . $this->currencyResolver->getDefaultBaseCurrency() . ']'; } } diff --git a/app/code/Magento/AdvancedPricingImportExport/README.md b/app/code/Magento/AdvancedPricingImportExport/README.md index 8f33781932f9e..b389eabb341ad 100644 --- a/app/code/Magento/AdvancedPricingImportExport/README.md +++ b/app/code/Magento/AdvancedPricingImportExport/README.md @@ -4,6 +4,6 @@ The Magento_AdvancedPricingImportExport module handles the import and export of ## Extensibility -Extension developers can interact with the Magento_AdvancedPricingImportExport module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_AdvancedPricingImportExport module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdvancedPricingImportExport module. \ No newline at end of file +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdvancedPricingImportExport module. diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/CurrencyResolverTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/CurrencyResolverTest.php new file mode 100644 index 0000000000000..eebe783c517db --- /dev/null +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/CurrencyResolverTest.php @@ -0,0 +1,88 @@ +storeManager = $this->createMock(StoreManagerInterface::class); + $this->directoryData = $this->createMock(DirectoryData::class); + $this->model = new CurrencyResolver( + $this->storeManager, + $this->directoryData, + ); + } + + /** + * Test that the result of getWebsitesBaseCurrency() should be cached + */ + public function testShouldCacheResultOfGetWebsitesBaseCurrency(): void + { + $expected = [ + 'base' => 'EUR', + 'england' => 'GBP', + ]; + $websites = []; + foreach ($expected as $websiteCode => $currencyCode) { + $websites[] = $this->createConfiguredMock( + Website::class, + [ + 'getCode' => $websiteCode, + 'getBaseCurrencyCode' => $currencyCode + ] + ); + } + $this->storeManager->expects($this->once()) + ->method('getWebsites') + ->willReturn($websites); + $this->assertEquals($expected, $this->model->getWebsitesBaseCurrency()); + $this->assertEquals($expected, $this->model->getWebsitesBaseCurrency()); + } + + /** + * Test that the result of getDefaultBaseCurrency() should be cached + */ + public function testShouldCacheResultOfGetDefaultBaseCurrency(): void + { + $expected = 'USD'; + $this->directoryData->expects($this->once()) + ->method('getBaseCurrencyCode') + ->willReturn($expected); + $this->assertEquals($expected, $this->model->getDefaultBaseCurrency()); + $this->assertEquals($expected, $this->model->getDefaultBaseCurrency()); + } +} diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php index 1a0b2b35ce0f7..f870f80f657b0 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php @@ -7,10 +7,10 @@ namespace Magento\AdvancedPricingImportExport\Test\Unit\Model\Import\AdvancedPricing\Validator; +use Magento\AdvancedPricingImportExport\Model\CurrencyResolver; use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing as AdvancedPricing; use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator\Website as WebsiteValidator; use Magento\CatalogImportExport\Model\Import\Product\StoreResolver; -use Magento\Directory\Model\Currency; use Magento\Store\Model\Website; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -32,6 +32,11 @@ class WebsiteTest extends TestCase */ protected $website; + /** + * @var CurrencyResolver|MockObject + */ + private $currencyResolver; + protected function setUp(): void { $this->webSiteModel = $this->getMockBuilder(Website::class) @@ -43,11 +48,16 @@ protected function setUp(): void ['getWebsiteCodeToId'] ); + $this->currencyResolver = $this->createPartialMock( + CurrencyResolver::class, + ['getDefaultBaseCurrency'] + ); + $this->website = $this->getMockBuilder( WebsiteValidator::class ) ->setMethods(['getAllWebsitesValue', '_clearMessages', '_addMessages']) - ->setConstructorArgs([$this->storeResolver, $this->webSiteModel]) + ->setConstructorArgs([$this->storeResolver, $this->webSiteModel, $this->currencyResolver]) ->getMock(); } @@ -104,17 +114,15 @@ public function testIsValidReturnAddMessagesCall() public function testGetAllWebsitesValue() { $currencyCode = 'currencyCodeValue'; - $currency = $this->createPartialMock(Currency::class, ['getCurrencyCode']); - $currency->expects($this->once())->method('getCurrencyCode')->willReturn($currencyCode); - $this->webSiteModel->expects($this->once())->method('getBaseCurrency')->willReturn($currency); + $this->currencyResolver->expects($this->once())->method('getDefaultBaseCurrency')->willReturn($currencyCode); $expectedResult = AdvancedPricing::VALUE_ALL_WEBSITES . ' [' . $currencyCode . ']'; $websiteString = $this->getMockBuilder( WebsiteValidator::class ) ->setMethods(['_clearMessages', '_addMessages']) - ->setConstructorArgs([$this->storeResolver, $this->webSiteModel]) + ->setConstructorArgs([$this->storeResolver, $this->webSiteModel, $this->currencyResolver]) ->getMock(); $result = $websiteString->getAllWebsitesValue(); diff --git a/app/code/Magento/AdvancedPricingImportExport/composer.json b/app/code/Magento/AdvancedPricingImportExport/composer.json index ea6a39fba2c3d..0f9106ec435d4 100644 --- a/app/code/Magento/AdvancedPricingImportExport/composer.json +++ b/app/code/Magento/AdvancedPricingImportExport/composer.json @@ -13,7 +13,8 @@ "magento/module-customer": "*", "magento/module-eav": "*", "magento/module-import-export": "*", - "magento/module-store": "*" + "magento/module-store": "*", + "magento/module-directory": "*" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/AdvancedSearch/README.md b/app/code/Magento/AdvancedSearch/README.md index 999721fca1c8f..accbca83b57e4 100644 --- a/app/code/Magento/AdvancedSearch/README.md +++ b/app/code/Magento/AdvancedSearch/README.md @@ -1,27 +1,29 @@ # Magento_AdvancedSearch module + The Magento_AdvancedSearch module introduces advanced search functionality and provides interfaces that allow third-party search engines to implement this functionality. ## Installation details Before disabling or uninstalling this module, note that the following modules depends on this module: + - Magento_Elasticsearch - Magento_Elasticsearch6 -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_AdvancedSearch module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_AdvancedSearch module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdvancedSearch module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdvancedSearch module. ### Events This module observes the following event: - - `catalogsearch_query_save_after` in the `Magento\AdvancedSearch\Model\Recommendations\SaveSearchQueryRelationsObserver` file. +- `catalogsearch_query_save_after` in the `Magento\AdvancedSearch\Model\Recommendations\SaveSearchQueryRelationsObserver` file. -For information about an event in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events). +For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). ### Layouts @@ -35,4 +37,4 @@ The module interacts with the following layout handles in the `view/frontend/lay - `catalogsearch_result_index` -For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). \ No newline at end of file +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). diff --git a/app/code/Magento/Amqp/README.md b/app/code/Magento/Amqp/README.md index 3613421aacbdc..6a47a072390a8 100644 --- a/app/code/Magento/Amqp/README.md +++ b/app/code/Magento/Amqp/README.md @@ -4,6 +4,6 @@ Magento_Amqp module provides functionality to publish/consume messages with the ## Extensibility -Extension developers can interact with the Magento_Amqp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_Amqp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Amqp module. \ No newline at end of file +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Amqp module. diff --git a/app/code/Magento/AmqpStore/README.md b/app/code/Magento/AmqpStore/README.md index 88459a495401f..202c1982620e8 100644 --- a/app/code/Magento/AmqpStore/README.md +++ b/app/code/Magento/AmqpStore/README.md @@ -4,6 +4,6 @@ The Magento_AmqpStore module provides the ability to specify a store before publ ## Extensibility -Extension developers can interact with the Magento_AmqpStore module using plugins. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_AmqpStore module using plugins. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AmqpStore module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AmqpStore module. diff --git a/app/code/Magento/Analytics/README.md b/app/code/Magento/Analytics/README.md index 7ec30c6dd484b..454ae72d1fd40 100644 --- a/app/code/Magento/Analytics/README.md +++ b/app/code/Magento/Analytics/README.md @@ -1,6 +1,6 @@ # Magento_Analytics module -The Magento_Analytics module integrates your Magento instance with the [Magento Business Intelligence (MBI)](https://magento.com/products/business-intelligence) to use [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html) functionality. +The Magento_Analytics module integrates your Magento instance with the [Magento Business Intelligence (MBI)](https://magento.com/products/business-intelligence) to use [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html) functionality. The module implements the following functionality: @@ -9,13 +9,14 @@ The module implements the following functionality: - Collecting the Magento instance data as reports for MBI - Introducing API that provides the collected data - Extending Magento configuration with the module parameters: - - Subscription status (enabled/disabled) - - Industry (a business area in which the instance website works) - - Time of data collection (time of the day when the module collects data) + - Subscription status (enabled/disabled) + - Industry (a business area in which the instance website works) + - Time of data collection (time of the day when the module collects data) ## Installation details Before disabling or uninstalling this module, note that the following modules depends on this module: + - Magento_CatalogAnalytics - Magento_CustomerAnalytics - Magento_QuoteAnalytics @@ -25,8 +26,8 @@ Before disabling or uninstalling this module, note that the following modules de ## Structure -Beyond the [usual module file structure](https://devdocs.magento.com/guides/v2.3/architecture/archi_perspectives/components/modules/mod_intro.html) the module contains a directory `ReportXml`. -[Report XML](https://devdocs.magento.com/guides/v2.3/advanced-reporting/report-xml.html) is a markup language used to build reports for Advanced Reporting. +Beyond the [usual module file structure](https://devdocs.magento.com/guides/v2.4/architecture/archi_perspectives/components/modules/mod_intro.html) the module contains a directory `ReportXml`. +[Report XML](https://devdocs.magento.com/guides/v2.4/advanced-reporting/report-xml.html) is a markup language used to build reports for Advanced Reporting. The language declares SQL queries using XML declaration. ## Subscription Process @@ -38,12 +39,13 @@ The subscription to the MBI service is enabled during the installation process o Configuration settings for the Analytics module can be modified in the Admin Panel on the Stores > Configuration page under the General > Advanced Reporting tab. The following options can be adjusted: + - Advanced Reporting Service (Enabled/Disabled) - - Alters the status of the Advanced Reporting subscription + - Alters the status of the Advanced Reporting subscription - Time of day to send data (Hour/Minute/Second in the store's time zone) - - Defines when the data collection process for the Advanced Reporting service occurs + - Defines when the data collection process for the Advanced Reporting service occurs - Industry - - Defines the industry of the store in order to create a personalized Advanced Reporting experience + - Defines the industry of the store in order to create a personalized Advanced Reporting experience ## Extensibility diff --git a/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingButtonTest.xml b/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingButtonTest.xml index 9c99041be0df6..512ccaef6be90 100644 --- a/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingButtonTest.xml +++ b/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingButtonTest.xml @@ -9,14 +9,12 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - - - <description value="Test log in to AdvancedReporting and tests AdvancedReportingButtonTest"/> - <testCaseId value="MC-14800"/> - <skip> - <issueId value="MC-14800" /> - </skip> + <features value="Analytics"/> + <stories value="Advanced Reporting"/> + <title value="Assert the Advanced Reporting page is opened by dashboard link"/> + <description value="Check the ability to navigate to the Advanced Reporting page through the Advanced Reporting button on the dashboard"/> <severity value="CRITICAL"/> + <testCaseId value="MC-28376"/> <group value="analytics"/> <group value="mtf_migrated"/> </annotations> diff --git a/app/code/Magento/AsynchronousOperations/Model/ResourceModel/System/Message/Collection/Synchronized/Plugin.php b/app/code/Magento/AsynchronousOperations/Model/ResourceModel/System/Message/Collection/Synchronized/Plugin.php index 8457a641ed9a9..bd357e101328a 100644 --- a/app/code/Magento/AsynchronousOperations/Model/ResourceModel/System/Message/Collection/Synchronized/Plugin.php +++ b/app/code/Magento/AsynchronousOperations/Model/ResourceModel/System/Message/Collection/Synchronized/Plugin.php @@ -108,6 +108,8 @@ public function afterToArray( 'data' => [ 'text' => __('Task "%1": ', $bulk->getDescription()) . $text, 'severity' => \Magento\Framework\Notification\MessageInterface::SEVERITY_MAJOR, + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction 'identity' => md5('bulk' . $bulkUuid), 'uuid' => $bulkUuid, 'status' => $bulkStatus, diff --git a/app/code/Magento/AsynchronousOperations/README.md b/app/code/Magento/AsynchronousOperations/README.md index 896fddedab5fa..cc826d66211c6 100644 --- a/app/code/Magento/AsynchronousOperations/README.md +++ b/app/code/Magento/AsynchronousOperations/README.md @@ -12,15 +12,15 @@ The Magento_AsynchronousOperations module creates the following tables in the da Before disabling or uninstalling this module, note that the following modules depends on this module: -- Magento_WebapiAsync +- Magento_WebapiAsync -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_AsynchronousOperations module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_AsynchronousOperations module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AsynchronousOperations module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AsynchronousOperations module. ### Layouts @@ -30,7 +30,7 @@ This module introduces the following layouts and layout handles in the `view/adm - `bulk_bulk_details_modal` - `bulk_index_index` -For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ### UI components @@ -45,4 +45,4 @@ You can extend Magento_AsynchronousOperations module using the following configu - `retriable_operation_listing` - `retriable_operation_modal_listing` -For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html). +For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). diff --git a/app/code/Magento/AsynchronousOperations/etc/db_schema.xml b/app/code/Magento/AsynchronousOperations/etc/db_schema.xml index ab482d2e2c761..0eb0af914ab2a 100644 --- a/app/code/Magento/AsynchronousOperations/etc/db_schema.xml +++ b/app/code/Magento/AsynchronousOperations/etc/db_schema.xml @@ -30,6 +30,9 @@ <index referenceId="MAGENTO_BULK_USER_ID_ADMIN_USER_USER_ID" indexType="btree"> <column name="user_id"/> </index> + <index referenceId="MAGENTO_BULK_START_TIME" indexType="btree"> + <column name="start_time"/> + </index> </table> <table name="magento_operation" resource="default" engine="innodb" comment="Operation entity"> <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" diff --git a/app/code/Magento/AsynchronousOperations/etc/db_schema_whitelist.json b/app/code/Magento/AsynchronousOperations/etc/db_schema_whitelist.json index 6cbb3c664a50f..d76b0b6935664 100644 --- a/app/code/Magento/AsynchronousOperations/etc/db_schema_whitelist.json +++ b/app/code/Magento/AsynchronousOperations/etc/db_schema_whitelist.json @@ -11,7 +11,8 @@ }, "index": { "MAGENTO_BULK_USER_ID_ADMIN_USER_USER_ID": true, - "MAGENTO_BULK_USER_ID": true + "MAGENTO_BULK_USER_ID": true, + "MAGENTO_BULK_START_TIME": true }, "constraint": { "PRIMARY": true, diff --git a/app/code/Magento/Authorization/Model/Role.php b/app/code/Magento/Authorization/Model/Role.php index 96cf956afd1bc..74b84f1a7d311 100644 --- a/app/code/Magento/Authorization/Model/Role.php +++ b/app/code/Magento/Authorization/Model/Role.php @@ -5,28 +5,32 @@ */ namespace Magento\Authorization\Model; +use Magento\Authorization\Model\ResourceModel\Role\Collection; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Model\AbstractModel; + /** * Admin Role Model * * @api * @method int getParentId() - * @method \Magento\Authorization\Model\Role setParentId(int $value) + * @method Role setParentId(int $value) * @method int getTreeLevel() - * @method \Magento\Authorization\Model\Role setTreeLevel(int $value) + * @method Role setTreeLevel(int $value) * @method int getSortOrder() - * @method \Magento\Authorization\Model\Role setSortOrder(int $value) + * @method Role setSortOrder(int $value) * @method string getRoleType() - * @method \Magento\Authorization\Model\Role setRoleType(string $value) + * @method Role setRoleType(string $value) * @method int getUserId() - * @method \Magento\Authorization\Model\Role setUserId(int $value) + * @method Role setUserId(int $value) * @method string getUserType() - * @method \Magento\Authorization\Model\Role setUserType(string $value) + * @method Role setUserType(string $value) * @method string getRoleName() - * @method \Magento\Authorization\Model\Role setRoleName(string $value) + * @method Role setRoleName(string $value) * @api * @since 100.0.2 */ -class Role extends \Magento\Framework\Model\AbstractModel +class Role extends AbstractModel { /** * @var string @@ -38,23 +42,6 @@ class Role extends \Magento\Framework\Model\AbstractModel */ protected $_cacheTag = 'user_assigned_role'; - /** - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Authorization\Model\ResourceModel\Role $resource - * @param \Magento\Authorization\Model\ResourceModel\Role\Collection $resourceCollection - * @param array $data - */ - public function __construct( //phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Authorization\Model\ResourceModel\Role $resource, - \Magento\Authorization\Model\ResourceModel\Role\Collection $resourceCollection, - array $data = [] - ) { - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - /** * @inheritDoc */ @@ -70,31 +57,30 @@ public function __sleep() public function __wakeup() { parent::__wakeup(); - $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); - $this->_resource = $objectManager->get(\Magento\Authorization\Model\ResourceModel\Role::class); - $this->_resourceCollection = $objectManager->get( - \Magento\Authorization\Model\ResourceModel\Role\Collection::class - ); + $objectManager = ObjectManager::getInstance(); + $this->_resource = $objectManager->get(ResourceModel\Role::class); + $this->_resourceCollection = $objectManager->get(Collection::class); } /** - * Class constructor - * - * @return void + * @inheritdoc */ protected function _construct() { - $this->_init(\Magento\Authorization\Model\ResourceModel\Role::class); + $this->_init(ResourceModel\Role::class); } /** - * Update object into database + * Obsolete method of update * * @return $this + * @deprecated Method was never implemented and used. */ public function update() { - $this->getResource()->update($this); + // phpcs:disable Magento2.Functions.DiscouragedFunction + trigger_error('Method was never implemented and used.', E_USER_DEPRECATED); + return $this; } diff --git a/app/code/Magento/Authorization/README.md b/app/code/Magento/Authorization/README.md index 4b8afb4fef0d3..f5fa0fccfea3a 100644 --- a/app/code/Magento/Authorization/README.md +++ b/app/code/Magento/Authorization/README.md @@ -11,10 +11,10 @@ The Magento_AdminNotification module creates the following tables in the databas Before disabling or uninstalling this module, note that the Magento_GraphQl module depends on this module. -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_Authorization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_Authorization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Authorization module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Authorization module. diff --git a/app/code/Magento/AwsS3/Driver/AwsS3.php b/app/code/Magento/AwsS3/Driver/AwsS3.php index 6b3da8c848fb7..a42b0c926399f 100644 --- a/app/code/Magento/AwsS3/Driver/AwsS3.php +++ b/app/code/Magento/AwsS3/Driver/AwsS3.php @@ -8,12 +8,15 @@ namespace Magento\AwsS3\Driver; use Generator; -use Exception; -use League\Flysystem\AdapterInterface; use League\Flysystem\Config; +use League\Flysystem\FilesystemAdapter; +use League\Flysystem\UnableToRetrieveMetadata; +use League\Flysystem\Visibility; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Filesystem\DriverInterface; use Magento\Framework\Phrase; +use Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterface; use Psr\Log\LoggerInterface; use Magento\RemoteStorage\Driver\DriverException; use Magento\RemoteStorage\Driver\RemoteDriverInterface; @@ -30,10 +33,10 @@ class AwsS3 implements RemoteDriverInterface private const TEST_FLAG = 'storage.flag'; - private const CONFIG = ['ACL' => 'private']; + private const CONFIG = ['ACL' => 'private', 'visibility' => Visibility::PRIVATE]; /** - * @var AdapterInterface + * @var FilesystemAdapter */ private $adapter; @@ -53,18 +56,27 @@ class AwsS3 implements RemoteDriverInterface private $objectUrl; /** - * @param AdapterInterface $adapter + * @var MetadataProviderInterface + */ + private $metadataProvider; + + /** + * @param FilesystemAdapter $adapter * @param LoggerInterface $logger * @param string $objectUrl + * @param MetadataProviderInterface|null $metadataProvider */ public function __construct( - AdapterInterface $adapter, + FilesystemAdapter $adapter, LoggerInterface $logger, - string $objectUrl + string $objectUrl, + MetadataProviderInterface $metadataProvider = null ) { $this->adapter = $adapter; $this->logger = $logger; $this->objectUrl = $objectUrl; + $this->metadataProvider = $metadataProvider ?? + ObjectManager::getInstance()->get(MetadataProviderInterface::class); } /** @@ -89,7 +101,7 @@ public function test(): void { try { $this->adapter->write(self::TEST_FLAG, '', new Config(self::CONFIG)); - } catch (Exception $exception) { + } catch (\Exception $exception) { throw new DriverException(__($exception->getMessage()), $exception); } } @@ -107,7 +119,12 @@ public function fileGetContents($path, $flag = null, $context = null): string //phpcs:enable } - return $this->adapter->read($path)['contents'] ?? ''; + try { + return $this->adapter->read($path); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return ''; + } } /** @@ -125,7 +142,12 @@ public function isExists($path): bool return true; } - return $this->adapter->has($path); + try { + return $this->adapter->fileExists($path); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } } /** @@ -166,10 +188,13 @@ private function createDirectoryRecursively(string $path): bool } if (!$this->isDirectory($path)) { - return (bool)$this->adapter->createDir( - $this->fixPath($path), - new Config(self::CONFIG) - ); + + try { + $this->adapter->createDirectory($this->fixPath($path), new Config(self::CONFIG)); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } } return true; @@ -180,10 +205,17 @@ private function createDirectoryRecursively(string $path): bool */ public function copy($source, $destination, DriverInterface $targetDriver = null): bool { - return $this->adapter->copy( - $this->normalizeRelativePath($source, true), - $this->normalizeRelativePath($destination, true) - ); + try { + $this->adapter->copy( + $this->normalizeRelativePath($source, true), + $this->normalizeRelativePath($destination, true), + new Config(self::CONFIG) + ); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } + return true; } /** @@ -191,9 +223,15 @@ public function copy($source, $destination, DriverInterface $targetDriver = null */ public function deleteFile($path): bool { - return $this->adapter->delete( - $this->normalizeRelativePath($path, true) - ); + try { + $this->adapter->delete( + $this->normalizeRelativePath($path, true) + ); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } + return true; } /** @@ -201,9 +239,15 @@ public function deleteFile($path): bool */ public function deleteDirectory($path): bool { - return $this->adapter->deleteDir( - $this->normalizeRelativePath($path, true) - ); + try { + $this->adapter->deleteDirectory( + $this->normalizeRelativePath($path, true) + ); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } + return true; } /** @@ -221,7 +265,13 @@ public function filePutContents($path, $content, $mode = null): int ]; } - return $this->adapter->write($path, $content, new Config($config))['size']; + try { + $this->adapter->write($path, $content, new Config($config)); + return $this->adapter->fileSize($path)->fileSize(); + } catch (\League\Flysystem\FilesystemException | UnableToRetrieveMetadata $e) { + $this->logger->error($e->getMessage()); + return 0; + } } /** @@ -350,6 +400,25 @@ public function isReadable($path): bool return $this->isExists($path); } + /** + * Check is specified path a file. + * + * @param string $path + * @return bool + */ + private function isTypeFile($path) + { + try { + $metadata = $this->metadataProvider->getMetadata($this->normalizeRelativePath($path, true)); + if ($metadata && isset($metadata['type'])) { + return $metadata['type'] === self::TYPE_FILE; + } + } catch (UnableToRetrieveMetadata $e) { + return false; + } + return false; + } + /** * @inheritDoc */ @@ -358,14 +427,7 @@ public function isFile($path): bool if (!$path || $path === '/') { return false; } - - $path = $this->normalizeRelativePath($path, true); - - if ($this->adapter->has($path) && ($meta = $this->adapter->getMetadata($path))) { - return ($meta['type'] ?? null) === self::TYPE_FILE; - } - - return false; + return $this->isTypeFile($path); } /** @@ -377,21 +439,47 @@ public function isDirectory($path): bool return true; } - $path = $this->normalizeRelativePath($path, true); - if (!$path) { return true; } + return $this->isTypeDirectory($path); + } - if ($this->adapter->has($path)) { - $meta = $this->adapter->getMetadata($path); - - return !($meta && $meta['type'] === self::TYPE_FILE); + /** + * Check is given path a directory in metadata. + * + * @param string $path + * @return bool + */ + private function isTypeDirectory($path) + { + try { + $meta = $this->metadataProvider->getMetadata($this->normalizeRelativePath($path, true)); + } catch (UnableToRetrieveMetadata $e) { + return false; + } + if (isset($meta['type']) && $meta['type'] === self::TYPE_DIR) { + return true; } - return false; } + /** + * Check if directory exists by path. + * + * @param string $path + * @return bool + */ + private function directoryExists(string $path): bool + { + try { + return $this->adapter->fileExists($path); + } catch (\Throwable $e) { + // catch closed iterator + return false; + } + } + /** * @inheritDoc */ @@ -434,10 +522,17 @@ public function getRealPath($path) */ public function rename($oldPath, $newPath, DriverInterface $targetDriver = null): bool { - return $this->adapter->rename( - $this->normalizeRelativePath($oldPath, true), - $this->normalizeRelativePath($newPath, true) - ); + try { + $this->adapter->move( + $this->normalizeRelativePath($oldPath, true), + $this->normalizeRelativePath($newPath, true), + new Config(self::CONFIG) + ); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } + return true; } /** @@ -445,14 +540,7 @@ public function rename($oldPath, $newPath, DriverInterface $targetDriver = null) */ public function stat($path): array { - $path = $this->normalizeRelativePath($path, true); - $metaInfo = $this->adapter->getMetadata($path); - - if (!$metaInfo) { - throw new FileSystemException(__('Cannot gather stats! %1', [$this->getWarningMessage()])); - } - - return [ + $result = [ 'dev' => 0, 'ino' => 0, 'mode' => 0, @@ -464,11 +552,30 @@ public function stat($path): array 'ctime' => 0, 'blksize' => 0, 'blocks' => 0, - 'size' => $metaInfo['size'] ?? 0, - 'type' => $metaInfo['type'] ?? '', - 'mtime' => $metaInfo['timestamp'] ?? 0, + 'size' => 0, + 'type' => '', + 'mtime' => 0, 'disposition' => null ]; + $path = $this->normalizeRelativePath($path, true); + try { + $metaInfo = $this->metadataProvider->getMetadata($path); + } catch (UnableToRetrieveMetadata $exception) { + if ($this->directoryExists($path)) { + $result['type'] = self::TYPE_DIR; + } + return $result; + } + + if (!$metaInfo) { + throw new FileSystemException(__('Cannot gather stats! %1', [$this->getWarningMessage()])); + } + if ($metaInfo['type'] === 'file') { + $result['size'] = $metaInfo['size']; + $result['type'] = $metaInfo['type']; + $result['mtime'] = $metaInfo['timestamp']; + } + return $result; } /** @@ -476,31 +583,7 @@ public function stat($path): array */ public function getMetadata(string $path): array { - $path = $this->normalizeRelativePath($path, true); - $metaInfo = $this->adapter->getMetadata($path); - - if (!$metaInfo) { - throw new FileSystemException(__('Cannot gather meta info! %1', [$this->getWarningMessage()])); - } - - $mimeType = $this->adapter->getMimetype($path)['mimetype']; - $size = $this->adapter->getSize($path)['size']; - $timestamp = $this->adapter->getTimestamp($path)['timestamp']; - - return [ - 'path' => $metaInfo['path'], - 'dirname' => $metaInfo['dirname'], - 'basename' => $metaInfo['basename'], - 'extension' => $metaInfo['extension'], - 'filename' => $metaInfo['filename'], - 'timestamp' => $timestamp, - 'size' => $size, - 'mimetype' => $mimeType, - 'extra' => [ - 'image-width' => $metaInfo['metadata']['image-width'] ?? 0, - 'image-height' => $metaInfo['metadata']['image-height'] ?? 0 - ] - ]; + return $this->metadataProvider->getMetadata($this->normalizeRelativePath($path)); } /** @@ -571,11 +654,17 @@ public function touch($path, $modificationTime = null): bool { $path = $this->normalizeRelativePath($path, true); - $content = $this->adapter->has($path) ? - $this->adapter->read($path)['contents'] - : ''; + try { + $content = $this->adapter->fileExists($path) ? + $this->adapter->read($path) + : ''; + $this->adapter->write($path, $content, new Config([])); + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); + return false; + } - return (bool)$this->adapter->write($path, $content, new Config([])); + return true; } /** @@ -785,11 +874,15 @@ public function fileOpen($path, $mode) if (!isset($this->streams[$path])) { $this->streams[$path] = tmpfile(); - if ($this->adapter->has($path)) { - //phpcs:ignore Magento2.Functions.DiscouragedFunction - fwrite($this->streams[$path], $this->adapter->read($path)['contents']); - //phpcs:ignore Magento2.Functions.DiscouragedFunction - rewind($this->streams[$path]); + try { + if ($this->adapter->fileExists($path)) { + //phpcs:ignore Magento2.Functions.DiscouragedFunction + fwrite($this->streams[$path], $this->adapter->read($path)); + //phpcs:ignore Magento2.Functions.DiscouragedFunction + rewind($this->streams[$path]); + } + } catch (\League\Flysystem\FilesystemException $e) { + $this->logger->error($e->getMessage()); } } @@ -832,17 +925,13 @@ private function getWarningMessage(): ?string private function readPath(string $path, $isRecursive = false): array { $relativePath = $this->normalizeRelativePath($path); - $contentsList = $this->adapter->listContents( - $this->fixPath($relativePath), - $isRecursive - ); - $itemsList = []; - foreach ($contentsList as $item) { - if (isset($item['path']) - && $item['path'] !== $relativePath - && (!$relativePath || strpos($item['path'], $relativePath) === 0)) { - $itemsList[] = $this->getAbsolutePath($item['dirname'], $item['path']); + foreach ($this->adapter->listContents($this->fixPath($relativePath), $isRecursive) as $item) { + $path = $item->path(); + if (!empty($path) + && $path !== $relativePath + && (!$relativePath || strpos($path, $relativePath) === 0)) { + $itemsList[] = $this->getAbsolutePath(dirname($path), $path); } } diff --git a/app/code/Magento/AwsS3/Driver/AwsS3Factory.php b/app/code/Magento/AwsS3/Driver/AwsS3Factory.php index a4d3676bffa07..917bb6ce045e5 100644 --- a/app/code/Magento/AwsS3/Driver/AwsS3Factory.php +++ b/app/code/Magento/AwsS3/Driver/AwsS3Factory.php @@ -8,11 +8,12 @@ namespace Magento\AwsS3\Driver; use Aws\S3\S3Client; -use League\Flysystem\AwsS3v3\AwsS3Adapter; -use League\Flysystem\Cached\CachedAdapter; +use League\Flysystem\AwsS3V3\AwsS3V3Adapter; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\ObjectManagerInterface; -use Magento\RemoteStorage\Driver\Cache\CacheFactory; +use Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterfaceFactory; +use Magento\RemoteStorage\Driver\Adapter\CachedAdapterInterfaceFactory; +use Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterfaceFactory; use Magento\RemoteStorage\Driver\DriverException; use Magento\RemoteStorage\Driver\DriverFactoryInterface; use Magento\RemoteStorage\Driver\RemoteDriverInterface; @@ -29,25 +30,52 @@ class AwsS3Factory implements DriverFactoryInterface private $objectManager; /** - * @var CacheFactory + * @var Config */ - private $cacheFactory; + private $config; /** - * @var Config + * @var MetadataProviderInterfaceFactory */ - private $config; + private $metadataProviderFactory; + + /** + * @var CacheInterfaceFactory + */ + private $cacheInterfaceFactory; + + /** + * @var CachedAdapterInterfaceFactory + */ + private $cachedAdapterInterfaceFactory; + + /** + * @var string|null + */ + private $cachePrefix; /** * @param ObjectManagerInterface $objectManager - * @param CacheFactory $cacheFactory * @param Config $config + * @param MetadataProviderInterfaceFactory $metadataProviderFactory + * @param CacheInterfaceFactory $cacheInterfaceFactory + * @param CachedAdapterInterfaceFactory $cachedAdapterInterfaceFactory + * @param string|null $cachePrefix */ - public function __construct(ObjectManagerInterface $objectManager, CacheFactory $cacheFactory, Config $config) - { + public function __construct( + ObjectManagerInterface $objectManager, + Config $config, + MetadataProviderInterfaceFactory $metadataProviderFactory, + CacheInterfaceFactory $cacheInterfaceFactory, + CachedAdapterInterfaceFactory $cachedAdapterInterfaceFactory, + string $cachePrefix = null + ) { $this->objectManager = $objectManager; - $this->cacheFactory = $cacheFactory; $this->config = $config; + $this->metadataProviderFactory = $metadataProviderFactory; + $this->cacheInterfaceFactory = $cacheInterfaceFactory; + $this->cachedAdapterInterfaceFactory = $cachedAdapterInterfaceFactory; + $this->cachePrefix = $cachePrefix; } /** @@ -58,9 +86,7 @@ public function create(): RemoteDriverInterface try { return $this->createConfigured( $this->config->getConfig(), - $this->config->getPrefix(), - $this->config->getCacheAdapter(), - $this->config->getCacheConfig() + $this->config->getPrefix() ); } catch (LocalizedException $exception) { throw new DriverException(__($exception->getMessage()), $exception); @@ -73,8 +99,8 @@ public function create(): RemoteDriverInterface public function createConfigured( array $config, string $prefix, - string $cacheAdapter, - array $cacheConfig + string $cacheAdapter = '', + array $cacheConfig = [] ): RemoteDriverInterface { $config['version'] = 'latest'; @@ -91,16 +117,31 @@ public function createConfigured( } $client = new S3Client($config); - $adapter = new AwsS3Adapter($client, $config['bucket'], $prefix); - + $adapter = new AwsS3V3Adapter($client, $config['bucket'], $prefix); + $cache = $this->cacheInterfaceFactory->create( + // Custom cache prefix required to distinguish cache records for different sources. + // phpcs:ignore Magento2.Security.InsecureFunction + $this->cachePrefix ? ['prefix' => $this->cachePrefix] : ['prefix' => md5($config['bucket'] . $prefix)] + ); + $metadataProvider = $this->metadataProviderFactory->create( + [ + 'adapter' => $adapter, + 'cache' => $cache + ] + ); + $objectUrl = rtrim($client->getObjectUrl($config['bucket'], './'), '/') . trim($prefix, '\\/') . '/'; return $this->objectManager->create( AwsS3::class, [ - 'adapter' => $this->objectManager->create(CachedAdapter::class, [ - 'adapter' => $adapter, - 'cache' => $this->cacheFactory->create($cacheAdapter, $cacheConfig) - ]), - 'objectUrl' => $client->getObjectUrl($adapter->getBucket(), $adapter->applyPathPrefix('.')) + 'adapter' => $this->cachedAdapterInterfaceFactory->create( + [ + 'adapter' => $adapter, + 'cache' => $cache, + 'metadataProvider' => $metadataProvider + ] + ), + 'objectUrl' => $objectUrl, + 'metadataProvider' => $metadataProvider, ] ); } diff --git a/app/code/Magento/AwsS3/Model/HttpLoggerHandler.php b/app/code/Magento/AwsS3/Model/HttpLoggerHandler.php deleted file mode 100644 index 9971a81f155d4..0000000000000 --- a/app/code/Magento/AwsS3/Model/HttpLoggerHandler.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\AwsS3\Model; - -use Aws\Handler\GuzzleV6\GuzzleHandler; -use GuzzleHttp\Client; -use GuzzleHttp\HandlerStack; -use GuzzleHttp\MessageFormatter; -use GuzzleHttp\Middleware; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Exception\FileSystemException; -use Magento\Framework\Filesystem; -use Monolog\Handler\StreamHandler; -use Monolog\Logger; - -final class HttpLoggerHandler -{ - /** - * @var Filesystem\Directory\WriteInterface - */ - private $directory; - - /** - * @var string - */ - private $file; - - /** - * @param Filesystem $filesystem - * @param string $file - * @throws FileSystemException - */ - public function __construct( - Filesystem $filesystem, - $file = 'debug/s3.log' - ) { - $this->directory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); - $this->file = $file; - } - - public function __invoke() - { - $this->directory->create(pathinfo($this->file, PATHINFO_DIRNAME)); - $localStream = $this->directory->getDriver()->fileOpen($this->directory->getAbsolutePath($this->file), 'a'); - $streamHandler = new StreamHandler($localStream, Logger::DEBUG, true, null, true); - $logger = new \Monolog\Logger('S3', [$streamHandler]); - $stack = HandlerStack::create(); - $stack->push( - Middleware::log( - $logger, - new MessageFormatter('{code}:{method}:{target} {error}') - ) - ); - return new GuzzleHandler(new Client(['handler' => $stack])); - } -} diff --git a/app/code/Magento/AwsS3/Test/Mftf/Helper/DummyMetadataCache.php b/app/code/Magento/AwsS3/Test/Mftf/Helper/DummyMetadataCache.php new file mode 100644 index 0000000000000..54f44ab2f1244 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Helper/DummyMetadataCache.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\AwsS3\Test\Mftf\Helper; + +/** + * Cache mock for metadata provider. + */ +class DummyMetadataCache implements \Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterface +{ + /** + * @inheirtDoc + */ + public function exists(string $path): ?bool + { + return null; + } + + /** + * @inheirtDoc + */ + public function getMetadata(string $path): ?array + { + return null; + } + + /** + * @inheirtDoc + */ + public function flushCache(): void + { + } + + /** + * @inheirtDoc + */ + public function purgeQueue(): void + { + } + + /** + * @inheirtDoc + */ + public function moveFile(string $path, string $newpath): void + { + } + + /** + * @inheirtDoc + */ + public function copyFile(string $path, string $newpath): void + { + } + + /** + * @inheirtDoc + */ + public function deleteFile(string $path): void + { + } + + /** + * @inheirtDoc + */ + public function deleteDir(string $dirname): void + { + } + + /** + * @inheirtDoc + */ + public function updateMetadata(string $path, array $objectMetadata, bool $persist = false): void + { + } + + /** + * @inheirtDoc + */ + public function storeFileNotExists(string $path): void + { + } +} diff --git a/app/code/Magento/AwsS3/Test/Mftf/Helper/MockTestLogger.php b/app/code/Magento/AwsS3/Test/Mftf/Helper/MockTestLogger.php new file mode 100644 index 0000000000000..45b7d53fee0d9 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Helper/MockTestLogger.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\AwsS3\Test\Mftf\Helper; + +use Psr\Log\LoggerInterface; + +/** + * Mocked logger for using the AwsS3 driver in testing + * + * Ignores most log messages but throws errors on error/critical/emergency logs so tests will fail + */ +class MockTestLogger implements LoggerInterface { + + public function emergency($message, array $context = array()) + { + throw new \Exception($message); + } + + public function alert($message, array $context = array()) + { + // noop + } + + public function critical($message, array $context = array()) + { + throw new \Exception($message); + } + + public function error($message, array $context = array()) + { + throw new \Exception($message); + } + + public function warning($message, array $context = array()) + { + // noop + } + + public function notice($message, array $context = array()) + { + // noop + } + + public function info($message, array $context = array()) + { + // noop + } + + public function debug($message, array $context = array()) + { + // noop + } + + public function log($level, $message, array $context = array()) + { + // noop + } +} diff --git a/app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php b/app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php new file mode 100644 index 0000000000000..3f78b1051e2dc --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php @@ -0,0 +1,316 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\AwsS3\Test\Mftf\Helper; + +use Aws\S3\S3Client; +use Codeception\Lib\ModuleContainer; +use League\Flysystem\AwsS3V3\AwsS3V3Adapter; +use League\Flysystem\PathPrefixer; +use Magento\AwsS3\Driver\AwsS3; +use Magento\FunctionalTestingFramework\Helper\Helper; +use Magento\Framework\Filesystem\DriverInterface; +use Magento\RemoteStorage\Driver\Adapter\MetadataProvider; + +/** + * Class for MFTF helpers for doing file assertions using S3. + */ +class S3FileAssertions extends Helper +{ + /** + * @var DriverInterface $driver + */ + private $driver; + + /** + * Call the parent constructor then create the AwsS3 driver from environment variables + * + * @param ModuleContainer $moduleContainer + * @param array|null $config + * @return void + */ + public function __construct(ModuleContainer $moduleContainer, ?array $config = null) + { + parent::__construct($moduleContainer, $config); + + $region = getenv('REMOTE_STORAGE_AWSS3_REGION'); + $prefix = getenv('REMOTE_STORAGE_AWSS3_PREFIX'); + $bucket = getenv('REMOTE_STORAGE_AWSS3_BUCKET'); + $accessKey = getenv('REMOTE_STORAGE_AWSS3_ACCESS_KEY'); + $secretKey = getenv('REMOTE_STORAGE_AWSS3_SECRET_KEY'); + + $config = [ + 'version' => 'latest', + 'credentials' => [ + 'key' => $accessKey, + 'secret' => $secretKey + ], + 'bucket' => $bucket, + 'region' => $region + ]; + + if (empty($config['credentials']['key']) || empty($config['credentials']['secret'])) { + unset($config['credentials']); + } + + $client = new S3Client($config); + $adapter = new AwsS3V3Adapter($client, $config['bucket'], $prefix); + $prefixer = new PathPrefixer($prefix); + $objectUrl = $client->getObjectUrl($config['bucket'], ltrim($prefixer->prefixPath('.'), '/')); + $metadataProvider = new MetadataProvider($adapter, new DummyMetadataCache()); + $s3Driver = new AwsS3($adapter, new MockTestLogger(), $objectUrl, $metadataProvider); + + $this->driver = $s3Driver; + } + + /** + * Create a file in the S3 bucket + * + * @param string $filePath + * @param string $text + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function createTextFile($filePath, $text): void + { + $this->driver->filePutContents($filePath, $text); + } + + /** + * Delete a file from the S3 bucket if it exists + * + * @param string $filePath + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function deleteFileIfExists($filePath): void + { + if ($this->driver->isExists($filePath)) { + $this->driver->deleteFile($filePath); + } + } + + /** + * Copy source into destination + * + * @param string $source + * @param string $destination + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function copy($source, $destination): void + { + $this->driver->copy($source, $destination); + } + + /** + * Create directory in the S3 bucket + * + * @param string $path + * @param int $permissions + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function createDirectory($path, $permissions = 0777): void + { + $this->driver->createDirectory($path, $permissions); + } + + /** + * Recursive delete directory in the S3 bucket + * + * @param string $path + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function deleteDirectory($path): void + { + if ($this->driver->isExists($path)) { + $this->driver->deleteDirectory($path); + } + } + + /** + * Assert a file exists on the remote storage system + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileExists($filePath, $message = ''): void + { + $this->assertTrue($this->driver->isExists($filePath), "Failed asserting $filePath exists. " . $message); + } + + /** + * Asserts that a file with the given glob pattern exists in the given path on the remote storage system + * + * @param string $path + * @param string $pattern + * @param string $message + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileExists($path, $pattern, $message = ''): void + { + $files = $this->driver->search($pattern, $path); + $this->assertNotEmpty($files, "Failed asserting file matching glob pattern \"$pattern\" at location \"$path\" is not empty. " . $message); + } + + /** + * Asserts that a file or directory exists on the remote storage system + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertPathExists($path, $message = ''): void + { + $this->assertTrue($this->driver->isExists($path), "Failed asserting $path exists. " . $message); + } + + /** + * Asserts that a file or directory does not exist on the remote storage system + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertPathDoesNotExist($path, $message = ''): void + { + $this->assertFalse($this->driver->isExists($path), "Failed asserting $path does not exist. " . $message); + } + + /** + * Assert a file does not exist on the remote storage system + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileDoesNotExist($filePath, $message = ''): void + { + $this->assertFalse($this->driver->isExists($filePath), $message); + } + + /** + * Assert a file on the remote storage system has no contents + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileEmpty($filePath, $message = ''): void + { + $this->assertEmpty($this->driver->fileGetContents($filePath), "Failed asserting $filePath is empty. " . $message); + } + + /** + * Assert a file on the remote storage system is not empty + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileNotEmpty($filePath, $message = ''): void + { + $this->assertNotEmpty($this->driver->fileGetContents($filePath), "Failed asserting $filePath is not empty. " . $message); + } + + /** + * Assert a file on the remote storage system contains a given string + * + * @param string $filePath + * @param string $text + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileContainsString($filePath, $text, $message = ''): void + { + $this->assertStringContainsString($text, $this->driver->fileGetContents($filePath), "Failed asserting $filePath contains $text. " . $message); + } + + /** + * Asserts that a file with the given glob pattern at the given path on the remote storage system contains a given string + * + * @param string $path + * @param string $pattern + * @param string $text + * @param int $fileIndex + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ''): void + { + $files = $this->driver->search($pattern, $path); + $this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), "Failed asserting file of index \"$fileIndex\" matching glob pattern \"$pattern\" at location \"$path\" contains $text. " . $message); + } + + /** + * Assert a file on the remote storage system does not contain a given string + * + * @param string $filePath + * @param string $text + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileDoesNotContainString($filePath, $text, $message = ''): void + { + $this->assertStringNotContainsString($text, $this->driver->fileGetContents($filePath), "Failed asserting $filePath does not contain $text. " . $message); + } + + /** + * Asserts that a directory on the remote storage system is empty + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertDirectoryEmpty($path, $message = ''): void + { + $this->assertEmpty($this->driver->readDirectory($path), "Failed asserting $path is empty. " . $message); + } + + /** + * Asserts that a directory on the remote storage system is not empty + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertDirectoryNotEmpty($path, $message = ''): void + { + $this->assertNotEmpty($this->driver->readDirectory($path), "Failed asserting $path is not empty. " . $message); + } +} diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportBundleProductTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportBundleProductTest.xml new file mode 100644 index 0000000000000..c3d727a323c2f --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportBundleProductTest.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportBundleProductTest" extends="AdminExportBundleProductTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Bundle Products"/> + <description value="Verifies that a user can export Bundle and Simple child products for Bundled products + with a dynamic price, a fixed price, and a custom attribute. Verifies that the exported file and the + downloadable copy of the exported file contain the expected products. Note that MFTF cannot simply download + a file and have access to it due to the test not having access to the server that is running the test + browser. Therefore, this test verifies that the Download button can be successfully clicked, grabs the + request URL from the Download button, executes the request on the magento machine via a curl request, and + verifies the contents of the downloaded file. Uses S3 for the file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="firstSimpleProductForDynamic"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on File System: Dynamic Bundle Product --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForDynamicBundledProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForDynamicBundledProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createDynamicBundleProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProductOption1"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$firstSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProductOption2"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$secondSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicPriceBundleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">0.000000,,,,$$createDynamicBundleProduct.sku$$</argument> + </helper> + + <!-- Validate Export File on File System: Fixed Bundle Product --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForFixedBundledProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForFixed.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForFixedBundledProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForFixed.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductOption1"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$firstSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductOption2"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$secondSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedPriceBundleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProduct.price$$0000,,,,$$createFixedBundleProduct.sku$$</argument> + </helper> + + <!-- Validate Export File on File System: Fixed Bundle Product with Attribute --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForFixedBundledProductWithAttribute"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForFixedBundledProductWithAttribute"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttribute"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProductWithAttribute.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttributeOption1"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$firstSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttributeOption2"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$secondSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedPriceBundleProductWithAttribute"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProductWithAttribute.price$$0000,,,,$$createFixedBundleProductWithAttribute.sku$$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithFileLinksTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithFileLinksTest.xml new file mode 100644 index 0000000000000..0004ecf0f69ae --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithFileLinksTest.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportDownloadableProductWithFileLinksTest" extends="AdminExportDownloadableProductWithFileLinksTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Downloadable Products with File Links"/> + <description value="Verifies that a user can export a Downloadable product with downloadable and sample file + links. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the downloadable product row should be in the + export), the correct downloadable link with files, and the correct downloadable sample links with files. + Note that MFTF cannot simply download a file and have access to it due to the test not having access to the + server that is running the test browser. Therefore, this test verifies that the Download button can be + successfully clicked, grabs the request URL from the Download button, executes the request on the magento + machine via a curl request, and verifies the contents of the downloaded file. Uses S3 for the file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="createCategory"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableLink"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_file=/a/d/$addDownloadableLink.link[sample_file_content][name]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,is_shareable=$addDownloadableLink.link[is_shareable]$,link_type=$addDownloadableLink.link[link_type]$,link_file=/m/a/$addDownloadableLink.link[link_file_content][name]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableSampleLink"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableSamples.sample[title]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_file=/t/e/$addDownloadableSamples.sample[sample_file_content][name]$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithURLLinksTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithURLLinksTest.xml new file mode 100644 index 0000000000000..d34136dd1a1d4 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithURLLinksTest.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportDownloadableProductWithURLLinksTest" extends="AdminExportDownloadableProductWithURLLinksTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Downloadable Products with URL Links"/> + <description value="Verifies that a user can export a Downloadable product with downloadable and sample Url + links. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the configurable product row should be in the + export), the correct downloadable link with Urls, and the correct downloadable sample links with Urls. + Note that MFTF cannot simply download a file and have access to it due to the test not having access to the + server that is running the test browser. Therefore, this test verifies that the Download button can be + successfully clicked, grabs the request URL from the Download button, executes the request on the magento + machine via a curl request, and verifies the contents of the downloaded file. Uses S3 for the file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="addDownloadableDomain"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableLink"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_url=$addDownloadableLink.link[sample_url]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,link_type=$addDownloadableLink.link[link_type]$,link_url=$addDownloadableLink.link[link_url]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableSampleLink"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableSamples.sample[title]$,sort_order=$addDownloadableSamples.sample[sort_order]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_url=$addDownloadableSamples.sample[sample_url]$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportGroupedProductWithSpecialPriceTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportGroupedProductWithSpecialPriceTest.xml new file mode 100644 index 0000000000000..b292162367e2a --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportGroupedProductWithSpecialPriceTest.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportGroupedProductWithSpecialPriceTest" extends="AdminExportGroupedProductWithSpecialPriceTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Grouped Products with Special Price"/> + <description value="Verifies that a user can export a Grouped product with a special price and Simple child + products. Verifies that exported file and the downloadable copy of the exported file contain the expected + products. Note that MFTF cannot simply download a file and have access to it due to the test not having + access to the server that is running the test browser. Therefore, this test verifies that the Download + button can be successfully clicked, grabs the request URL from the Download button, executes the request on + the magento machine via a curl request, and verifies the contents of the downloaded file. Uses S3 for the + file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="createFirstSimpleProduct"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on S3: Grouped Product with Special Price --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFirstSimpleProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createSecondSimpleProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsGroupedProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createGroupedProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildGroupedProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createFirstSimpleProduct.sku$$=$$createFirstSimpleProduct.quantity$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildGroupedProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createSecondSimpleProduct.sku$$=$$createSecondSimpleProduct.quantity$$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml new file mode 100644 index 0000000000000..1def3bbcc68ee --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportSimpleAndConfigurableProductsWithCustomOptionsTest" extends="AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Simple and Configurable Products with Custom Options"/> + <description value="Verifies that a user can export a Configurable product with child simple products with + custom options. Verifies that the exported file and the downloadable copy of the exported file contain the + expected product (a filter is applied when exporting such that ONLY the configurable product row should be + in the export). Note that MFTF cannot simply download a file and have access to it due to the test not + having access to the server that is running the test browser. Therefore, this test verifies that the + Download button can be successfully clicked, grabs the request URL from the Download button, executes the + request on the magento machine via a curl request, and verifies the contents of the downloaded file. Uses + S3 for the file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="createCategory"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on S3: Product with Custom Options --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildSimpleProductOption"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildSimpleProductOption"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainFirstSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainSecondSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigSecondChildProduct.name$$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml new file mode 100644 index 0000000000000..0f9a28350dd93 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportSimpleProductAndConfigurableProductsWithAssignedImagesTest" extends="AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Products"/> + <title value="S3 - Export Simple product and Configurable products with assigned images"/> + <description value="Verifies that a user can export a Configurable product with child simple products with + images. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the configurable product row should be in the + export) and the attached image. Note that MFTF cannot simply download a file and have access to it due to + the test not having access to the server that is running the test browser. Therefore, this test verifies + that the Download button can be successfully clicked, grabs the request URL from the Download button, + executes the request on the magento machine via a curl request, and verifies the contents of the downloaded + file. Uses S3 for the file system."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="createCategory"/> + </before> + + <after> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">import_export/export</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/> + </after> + + <!-- Validate Export File on S3: Configurable Product --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildSimpleProductOption"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildSimpleProductOption"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProductImage"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$createConfigProductImage.entry[content][name]$,"$createConfigProductImage.entry[label]$"</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainFirstSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainSecondSimpleProduct"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigSecondChildProduct.name$$</argument> + </helper> + + <!-- Delete Export File --> + <helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">import_export/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportTaxRatesTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportTaxRatesTest.xml new file mode 100644 index 0000000000000..456f10960bdcc --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportTaxRatesTest.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ExportTaxRatesTest" extends="AdminExportTaxRatesTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Export Tax"/> + <title value="S3 - Export Tax Rates"/> + <description value="Exports tax rates from the System > Data Transfer > Import/Export Tax Rates page, from + the Tax Rule page, from the Tax Rates grid page as a .csv, and from the Tax Rates grid page as an .xml. + Validates contents in downloaded file for each export area. Note that MFTF cannot simply click export and + have access to the file that is downloaded in the browser due to the test not having access to the server + that is running the test browser. Therefore, this test verifies that the Export button can be successfully + clicked, grabs the request URL from the Export button's form, executes the request on the magento machine + via a curl request, and verifies the contents of the exported file. Uses S3 for the file system."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38621"/> + <group value="importExport"/> + <group value="tax"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Enable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="revertInitialTaxRateCA"/> + </before> + + <after> + <!-- Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportBundleProductTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportBundleProductTest.xml new file mode 100644 index 0000000000000..98dc78eb57940 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportBundleProductTest.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ImportBundleProductTest" extends="AdminImportBundleProductTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Import Products"/> + <title value="S3 - Import Bundle Product"/> + <description value="Imports a .csv file containing a bundle product. Verifies that product is imported + successfully and can be purchased."/> + <severity value="MAJOR"/> + <group value="importExport"/> + <group value="Bundle"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Locally Copy Import Files to Unique Media Import Directory --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer"> + <argument name="path">pub/media/import/{{ImportProduct_Bundle.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Bundle.fileName}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProduct_Bundle.fileName}}</argument> + </helper> + <remove keyForRemoval="createDirectoryForImportImages"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Bundle.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple1_Bundle.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Bundle.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple2_Bundle.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyProduct3BaseImage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/> + + <!-- Copy to Import Directory in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage"> + <argument name="path">var/import/images/{{ImportProduct_Bundle.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct1BaseImageInS3" after="createDirectoryForImportFilesInS3"> + <argument name="source">media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple1_Bundle.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple1_Bundle.baseImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct2BaseImageInS3" after="copyProduct1BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple2_Bundle.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple2_Bundle.smallImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct3BaseImageInS3" after="copyProduct2BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete S3 Data --> + <remove keyForRemoval="deleteProductImageDirectory"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"> + <argument name="path">media/import/{{ImportProduct_Bundle.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3"> + <argument name="path">var/import/images/{{ImportProduct_Bundle.name}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage & Delete Local Data --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"> + <argument name="path">pub/media/import/{{ImportProduct_Bundle.name}}</argument> + </helper> + </after> + + <!-- Import Bundle Product --> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Bundle.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Bundle.name}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithFileLinksTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithFileLinksTest.xml new file mode 100644 index 0000000000000..68c341095a0eb --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithFileLinksTest.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ImportDownloadableProductsWithFileLinksTest" extends="AdminImportDownloadableProductsWithFileLinksTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Import Products"/> + <title value="S3 - Import Downloadable Products with File Links"/> + <description value="Imports a .csv file containing a downloadable product with file links. Verifies that + products are imported successfully."/> + <severity value="MAJOR"/> + <group value="importExport"/> + <group value="Downloadable"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Locally Copy Import Files to Unique Media Import Directory --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.fileName}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.fileName}}</argument> + </helper> + <remove keyForRemoval="createDirectoryForImportImages"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyThumbnailImage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/> + + <!-- Copy to Import Directory in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyBaseImageInS3" after="createDirectoryForImportFilesInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copySmallImageInS3" after="copyBaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyThumbnailImageInS3" after="copySmallImageInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete S3 Data --> + <remove keyForRemoval="deleteProductImageDirectory"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"> + <argument name="path">media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage & Delete Local Data --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + </after> + + <!-- Import Downloadable Product --> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Downloadable_FileLinks.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Downloadable_FileLinks.name}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithUrlLinksTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithUrlLinksTest.xml new file mode 100644 index 0000000000000..ccfdd6ffe51e0 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportDownloadableProductsWithUrlLinksTest.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ImportDownloadableProductsWithUrlLinksTest" extends="AdminImportDownloadableProductsWithUrlLinksTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Import Products"/> + <title value="S3 - Import Downloadable Products with Url Links"/> + <description value="Imports a .csv file containing a downloadable product with url links. Verifies that + products are imported successfully."/> + <severity value="MAJOR"/> + <group value="importExport"/> + <group value="Downloadable"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Locally Copy Import Files to Unique Media Import Directory --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.fileName}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.fileName}}</argument> + </helper> + <remove keyForRemoval="createDirectoryForImportImages"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyThumbnailImage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/> + + <!-- Copy to Import Directory in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyBaseImageInS3" after="createDirectoryForImportFilesInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copySmallImageInS3" after="copyBaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyThumbnailImageInS3" after="copySmallImageInS3"> + <argument name="source">media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete S3 Data --> + <remove keyForRemoval="deleteProductImageDirectory"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"> + <argument name="path">media/import/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage & Delete Local Data --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + </after> + + <!-- Import Downloadable Product --> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Downloadable_UrlLinks.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Downloadable_UrlLinks.name}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportGroupedProductTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportGroupedProductTest.xml new file mode 100644 index 0000000000000..17fa5d50e4d8e --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportGroupedProductTest.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ImportGroupedProductTest" extends="AdminImportGroupedProductTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Import Products"/> + <title value="S3 - Import Grouped Product"/> + <description value="Imports a .csv file containing a grouped product. Verifies that product is imported + successfully and can be purchased."/> + <severity value="MAJOR"/> + <group value="importExport"/> + <group value="GroupedProduct"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Locally Copy Import Files to Unique Media Import Directory --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer"> + <argument name="path">pub/media/import/{{ImportProduct_Grouped.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Grouped.fileName}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Grouped.name}}/{{ImportProduct_Grouped.fileName}}</argument> + </helper> + <remove keyForRemoval="createDirectoryForImportImages"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Grouped.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple1_Grouped.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Grouped.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple2_Grouped.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyProduct3BaseImage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/> + + <!-- Copy to Import Directory in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage"> + <argument name="path">var/import/images/{{ImportProduct_Grouped.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct1BaseImageInS3" after="createDirectoryForImportFilesInS3"> + <argument name="source">media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple1_Grouped.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple1_Grouped.baseImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct2BaseImageInS3" after="copyProduct1BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple2_Grouped.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple2_Grouped.smallImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct3BaseImageInS3" after="copyProduct2BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Grouped.name}}/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete S3 Data --> + <remove keyForRemoval="deleteProductImageDirectory"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"> + <argument name="path">media/import/{{ImportProduct_Grouped.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3"> + <argument name="path">var/import/images/{{ImportProduct_Grouped.name}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage & Delete Local Data --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"> + <argument name="path">pub/media/import/{{ImportProduct_Grouped.name}}</argument> + </helper> + </after> + + <!-- Import Grouped Product --> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Grouped.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Grouped.name}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml new file mode 100644 index 0000000000000..3fa9f8bcc5684 --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3ImportSimpleAndConfigurableProductsWithAssignedImagesTest" extends="AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Import Products"/> + <title value="S3 - Import Configurable Product With Simple Child Products With Images"/> + <description value="Imports a .csv file containing a configurable product with 3 child simple products that + have images. Verifies that products are imported successfully and that the images are attached to the + products as expected."/> + <severity value="MAJOR"/> + <group value="importExport"/> + <group value="ConfigurableProduct"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Locally Copy Import Files to Unique Media Import Directory --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer"> + <argument name="path">pub/media/import/{{ImportProduct_Configurable.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Configurable.fileName}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProduct_Configurable.fileName}}</argument> + </helper> + <remove keyForRemoval="createDirectoryForImportImages"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Configurable.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Configurable.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyProduct3BaseImage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/> + + <!-- Copy to Import Directory in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage"> + <argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct1BaseImageInS3" after="createDirectoryForImportFilesInS3"> + <argument name="source">media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct2BaseImageInS3" after="copyProduct1BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.smallImage}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct3BaseImageInS3" after="copyProduct2BaseImageInS3"> + <argument name="source">media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete S3 Data --> + <remove keyForRemoval="deleteProductImageDirectory"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"> + <argument name="path">media/import/{{ImportProduct_Configurable.name}}</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3"> + <argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage & Delete Local Data --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"> + <argument name="path">pub/media/import/{{ImportProduct_Configurable.name}}</argument> + </helper> + </after> + + <!-- Import Configurable Product --> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Configurable.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Configurable.name}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportTaxRatesTest.xml similarity index 58% rename from app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml rename to app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportTaxRatesTest.xml index fe8c6c6f7f9ef..718fe6516179c 100644 --- a/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportTaxRatesTest.xml @@ -8,30 +8,29 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AwsS3AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest" extends="AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest"> + <test name="AdminAwsS3ImportTaxRatesTest" extends="AdminImportTaxRatesTest"> <annotations> <features value="AwsS3"/> - <stories value="Import Products"/> - <title value="S3 - Import Configurable Product With Simple Child Products With Images"/> - <description value="Imports a .csv file containing a configurable product with 3 child simple products that - have images. Verifies that products are imported successfully and that the images are attached to the - products as expected."/> + <stories value="Import Tax"/> + <title value="S3 - Import and Update Tax Rates"/> + <description value="Imports tax rates from the System > Data Transfer > Import/Export Tax Rates page and + from the Tax Rule page, to create new tax rates and update existing tax rates. Verifies results on the Tax + Rates grid page. Uses S3 for the file system."/> <severity value="MAJOR"/> + <testCaseId value="MC-38621"/> <group value="importExport"/> + <group value="tax"/> <group value="remote_storage_aws_s3"/> - <skip> - <issueId value="MC-39280"/> - </skip> </annotations> <before> <!-- Enable AWS S3 Remote Storage --> - <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="revertInitialTaxRateCA"/> </before> <after> <!-- Disable AWS S3 Remote Storage --> - <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/> </after> </test> </tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3SyncMediaFilesTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3SyncMediaFilesTest.xml new file mode 100644 index 0000000000000..2dbba8f81180c --- /dev/null +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3SyncMediaFilesTest.xml @@ -0,0 +1,234 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAwsS3SyncMediaFilesTest"> + <annotations> + <features value="AwsS3"/> + <stories value="Sync Files"/> + <title value="S3 - Verify Media Files Are Synced"/> + <description value="Verifies that media files are synced from local file system to AWS S3 by creating a + product with images while using the local file system, switching and syncing to S3, deleting the local + file system images, and verifying that the product images still render."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38938"/> + <group value="remote_storage_aws_s3"/> + </annotations> + + <before> + <!-- Create Category, Product, & Product Images --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="ApiProductAttributeMediaGalleryEntryBluePng" stepKey="createProductImage1"> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="ApiProductAttributeMediaGalleryEntryRedPng" stepKey="createProductImage2"> + <requiredEntity createDataKey="createProduct"/> + </createData> + </before> + + <after> + <!-- Delete Data & Disable AWS S3 Remote Storage --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Note: Due to MFTF bug, must wrap entity reference in curly braces for entity to resolve --> + <executeJS function="return '{$createProductImage1.entry[content][name]$}'.charAt(1)" stepKey="firstCharacterImage1FileName"/> + <executeJS function="return '{$createProductImage1.entry[content][name]$}'.charAt(2)" stepKey="secondCharacterImage1FileName"/> + <executeJS function="return '{$createProductImage2.entry[content][name]$}'.charAt(1)" stepKey="firstCharacterImage2FileName"/> + <executeJS function="return '{$createProductImage2.entry[content][name]$}'.charAt(2)" stepKey="secondCharacterImage2FileName"/> + + <!-- Verify Images Are in Local File System --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertLocalImage1Exists"> + <argument name="filePath">pub/media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertLocalImage2Exists"> + <argument name="filePath">pub/media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + + <!-- Local - Verify Images on Product Storefront Page --> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="seeFirstImage1"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="firstImageSrc1"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertFirstImageContent1"> + <argument name="url">{$firstImageSrc1}</argument> + <argument name="expectedString">{{RedPngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$firstImageSrc1}" did not render image: {{RedPngImageContent.baseImage_md5}}</argument> + </helper> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama($createProductImage1.entry[content][name]$)}}" stepKey="clickSecondImage"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="seeSecondImage1"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="secondImageSrc1"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertSecondImageContent1"> + <argument name="url">{$secondImageSrc1}</argument> + <argument name="expectedString">{{BluePngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$secondImageSrc1}" did not render image: {{BluePngImageContent.baseImage_md5}}</argument> + </helper> + + <!-- Enable AWS S3 Remote Storage & Sync --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/> + <magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage"/> + + <!-- Verify Images Are in AWS S3 --> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertS3Image1Exists"> + <argument name="filePath">media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertS3Image2Exists"> + <argument name="filePath">media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertDirectoryNotEmpty" stepKey="assertS3CacheDirectoryNotEmpty"> + <argument name="path">media/catalog/product/cache/</argument> + </helper> + + <!-- S3 - Clear Caches & Verify Images on Product Storefront Page --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminGoToCacheManagementPageActionGroup" stepKey="goToCacheManagementPage"/> + <actionGroup ref="AdminClickFlushCatalogImagesCacheActionGroup" stepKey="clearCatalogImageCache"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertDirectoryEmpty" stepKey="assertS3CacheDirectoryEmpty"> + <argument name="path">media/catalog/product/cache/</argument> + </helper> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCache"> + <argument name="tags" value=""/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront2"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="seeFirstImage2"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="firstImageSrc2"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertFirstImageContent2"> + <argument name="url">{$firstImageSrc2}</argument> + <argument name="expectedString">{{RedPngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$firstImageSrc2}" did not render image: {{RedPngImageContent.baseImage_md5}}</argument> + </helper> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama($createProductImage1.entry[content][name]$)}}" stepKey="clickSecondImage2"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="seeSecondImage2"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="secondImageSrc2"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertSecondImageContent2"> + <argument name="url">{$secondImageSrc2}</argument> + <argument name="expectedString">{{BluePngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$secondImageSrc2}" did not render image: {{BluePngImageContent.baseImage_md5}}</argument> + </helper> + + <!-- Delete Images on Local File System --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteFileIfExists" stepKey="deleteLocalImage1"> + <argument name="filePath">pub/media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage1IsDeleted"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteFileIfExists" stepKey="deleteLocalImage2"> + <argument name="filePath">pub/media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage2IsDeleted"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteLocalCacheDirectory"> + <argument name="path">pub/media/catalog/product/cache/</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalCacheDirectoryDeleted"> + <argument name="path">pub/media/catalog/product/cache/</argument> + </helper> + + <!-- S3 - Clean Cache & Verify Images on Product Storefront Page --> + <actionGroup ref="AdminGoToCacheManagementPageActionGroup" stepKey="goToCacheManagementPage2"/> + <actionGroup ref="AdminClickFlushCatalogImagesCacheActionGroup" stepKey="clearCatalogImageCache2"/> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertDirectoryEmpty" stepKey="assertS3CacheDirectoryEmpty2"> + <argument name="path">media/catalog/product/cache/</argument> + </helper> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCache2"> + <argument name="tags" value=""/> + </actionGroup> + + <!-- Assert Local File System Images & Cached Images Are Still Non-Existent --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage1IsDeleted2"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage2IsDeleted2"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalCacheDirectoryDeleted2"> + <argument name="path">pub/media/catalog/product/cache/</argument> + </helper> + + <!-- Open Product on Storefront, Assert S3 Images Exist & Get Cached, Assert Local File System Images & Cache Are Still Non-Existent --> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront3"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertS3Image1Exists2"> + <argument name="filePath">media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertFileExists" stepKey="assertS3Image2Exists2"> + <argument name="filePath">media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="assertDirectoryNotEmpty" stepKey="assertS3CacheDirectoryNotEmpty2"> + <argument name="path">media/catalog/product/cache/</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage1IsDeleted3"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage1FileName}/{$secondCharacterImage1FileName}/$createProductImage1.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalImage2IsDeleted3"> + <argument name="path">pub/media/catalog/product/{$firstCharacterImage2FileName}/{$secondCharacterImage2FileName}/$createProductImage2.entry[content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalCacheDirectoryGone"> + <argument name="path">pub/media/catalog/product/cache/</argument> + </helper> + + <!-- Verify Product Images Render Correctly When Images Initially Only Exist in S3 --> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="seeFirstImage3"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="firstImageSrc3"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertFirstImageContent3"> + <argument name="url">{$firstImageSrc3}</argument> + <argument name="expectedString">{{RedPngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$firstImageSrc3}" did not render image: {{RedPngImageContent.baseImage_md5}}</argument> + </helper> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama($createProductImage1.entry[content][name]$)}}" stepKey="clickSecondImage3"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="seeSecondImage3"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="secondImageSrc3"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertSecondImageContent3"> + <argument name="url">{$secondImageSrc3}</argument> + <argument name="expectedString">{{BluePngImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$secondImageSrc3}" did not render image: {{BluePngImageContent.baseImage_md5}}</argument> + </helper> + + <!-- Disable AWS S3 Remote Storage, Clean Cache & Verify Images Do Not Appear on Product Storefront Page --> + <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/> + <actionGroup ref="AdminGoToCacheManagementPageActionGroup" stepKey="goToCacheManagementPage3"/> + <actionGroup ref="AdminClickFlushCatalogImagesCacheActionGroup" stepKey="clearCatalogImageCache3"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertPathDoesNotExist" stepKey="assertLocalCacheDirectoryEmpty2"> + <argument name="path">pub/media/catalog/product/cache/</argument> + </helper> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCache3"> + <argument name="tags" value=""/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront4"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="seeFirstImage4"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage2.entry[content][name]$)}}" stepKey="firstImageSrc4"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertFirstImageContent4"> + <argument name="url">{$firstImageSrc4}</argument> + <argument name="expectedString">{{MagentoPlaceHolderImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$firstImageSrc4}" did not render image: {{MagentoPlaceHolderImageContent.baseImage_md5}}</argument> + </helper> + <click selector="{{StorefrontProductMediaSection.productImageInFotorama($createProductImage1.entry[content][name]$)}}" stepKey="clickSecondImage4"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="seeSecondImage4"/> + <grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.productImageActive($createProductImage1.entry[content][name]$)}}" stepKey="secondImageSrc4"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertSecondImageContent4"> + <argument name="url">{$secondImageSrc4}</argument> + <argument name="expectedString">{{MagentoPlaceHolderImageContent.baseImage_md5}}</argument> + <argument name="message">Url: "{$secondImageSrc4}" did not render image: {{MagentoPlaceHolderImageContent.baseImage_md5}}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminCreateDownloadableProductWithLinkTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminCreateDownloadableProductWithLinkTest.xml index dd0fe36f44dde..85edd593d839f 100644 --- a/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminCreateDownloadableProductWithLinkTest.xml +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminCreateDownloadableProductWithLinkTest.xml @@ -20,9 +20,6 @@ <testCaseId value="MC-38039"/> <group value="Downloadable"/> <group value="remote_storage_aws_s3"/> - <skip> - <issueId value="MQE-2288" /> - </skip> </annotations> <before> <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/> @@ -89,7 +86,7 @@ <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> <!-- Assert product in storefront category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckProductPriceInCategoryActionGroup" stepKey="StorefrontCheckCategorySimpleProduct"> <argument name="product" value="DownloadableProduct"/> @@ -157,21 +154,25 @@ <see selector="{{CheckoutCartProductSection.ProductPriceByName(DownloadableProduct.name)}}" userInput="$52.99" stepKey="assertProductPriceInCart"/> <!-- Perform checkout --> - <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> - <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <comment userInput="BIC workaround" stepKey="clickProceedToCheckout"/> + <comment userInput="BIC workaround" stepKey="waitForPaymentSectionLoaded"/> + <comment userInput="BIC workaround" stepKey="clickPlaceOrderButton"/> + <comment userInput="BIC workaround" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> - <!-- Open created order --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> - <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchOrder"> - <argument name="keyword" value="$grabOrderNumber"/> - </actionGroup> - <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> - <!-- Open Create invoice --> - <actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createCreditMemo"/> + <comment userInput="BIC workaround" stepKey="onOrdersPage"/> + <comment userInput="BIC workaround" stepKey="searchOrder"/> + <comment userInput="BIC workaround" stepKey="clickOrderRow"/> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="goToOrderInAdmin"> + <argument name="orderId" value="{$grabOrderNumber}"/> + </actionGroup> + <comment userInput="BIC workaround" stepKey="createCreditMemo"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> <!-- Check downloadable product link on frontend --> <actionGroup ref="StorefrontAssertDownloadableProductIsPresentInCustomerAccount" stepKey="seeStorefrontMyAccountDownloadableProductsLink"> diff --git a/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontPrintOrderGuestTest.xml b/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontPrintOrderGuestTest.xml index c8d2947632b59..71a66036012fd 100644 --- a/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontPrintOrderGuestTest.xml +++ b/app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3StorefrontPrintOrderGuestTest.xml @@ -16,9 +16,6 @@ <severity value="BLOCKER"/> <testCaseId value="MC-38689"/> <group value="remote_storage_aws_s3"/> - <skip> - <issueId value="MQE-2288" /> - </skip> </annotations> <before> <magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/> diff --git a/app/code/Magento/AwsS3/Test/Unit/Driver/AwsS3Test.php b/app/code/Magento/AwsS3/Test/Unit/Driver/AwsS3Test.php index a7bcf8c47fced..9c3863105e923 100644 --- a/app/code/Magento/AwsS3/Test/Unit/Driver/AwsS3Test.php +++ b/app/code/Magento/AwsS3/Test/Unit/Driver/AwsS3Test.php @@ -7,10 +7,11 @@ namespace Magento\AwsS3\Test\Unit\Driver; -use League\Flysystem\AdapterInterface; -use League\Flysystem\AwsS3v3\AwsS3Adapter; +use League\Flysystem\FilesystemAdapter; +use League\Flysystem\UnableToRetrieveMetadata; use Magento\AwsS3\Driver\AwsS3; use Magento\Framework\Exception\FileSystemException; +use Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -28,19 +29,25 @@ class AwsS3Test extends TestCase private $driver; /** - * @var AwsS3Adapter|MockObject + * @var FilesystemAdapter|MockObject */ private $adapterMock; + /** + * @var MetadataProviderInterface|MockObject + */ + private $metadataProviderMock; + /** * @inheritDoc */ protected function setUp(): void { - $this->adapterMock = $this->getMockForAbstractClass(AdapterInterface::class); + $this->adapterMock = $this->getMockForAbstractClass(FilesystemAdapter::class); + $this->metadataProviderMock = $this->getMockForAbstractClass(MetadataProviderInterface::class); $loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); - $this->driver = new AwsS3($this->adapterMock, $loggerMock, self::URL); + $this->driver = new AwsS3($this->adapterMock, $loggerMock, self::URL, $this->metadataProviderMock); } /** @@ -202,24 +209,33 @@ public function getRelativePathDataProvider(): array * @param bool $has * @param array $metadata * @param bool $expected + * @param iterable $listContents + * @param \Exception|null $metadataException * @throws FileSystemException - * * @dataProvider isDirectoryDataProvider */ public function testIsDirectory( string $path, string $normalizedPath, - bool $has, array $metadata, - bool $expected + bool $expected, + iterable $listContents, + \Throwable $listContentsException = null ): void { - $this->adapterMock->method('has') - ->with($normalizedPath) - ->willReturn($has); - $this->adapterMock->method('getMetadata') - ->with($normalizedPath) - ->willReturn($metadata); - + if (!empty($metadata)) { + $this->metadataProviderMock->method('getMetadata') + ->with($normalizedPath) + ->willReturn($metadata); + } + if ($listContentsException) { + $this->adapterMock->method('listContents') + ->with($normalizedPath) + ->willThrowException($listContentsException); + } else { + $this->adapterMock->method('listContents') + ->with($normalizedPath) + ->willReturn($listContents); + } self::assertSame($expected, $this->driver->isDirectory($path)); } @@ -229,53 +245,49 @@ public function testIsDirectory( public function isDirectoryDataProvider(): array { return [ - [ + 'empty metadata' => [ 'some_directory/', 'some_directory', - false, [], - false + false, + new \ArrayIterator([]), + new \Exception('Closed iterator'), ], [ 'some_directory', 'some_directory', - true, [ 'type' => AwsS3::TYPE_DIR ], - true + true, + new \ArrayIterator(['some_directory']), ], [ self::URL . 'some_directory', 'some_directory', - true, [ 'type' => AwsS3::TYPE_DIR ], - true - ], - [ - self::URL . 'some_directory', - 'some_directory', true, - [ - 'type' => AwsS3::TYPE_FILE - ], - false + new \ArrayIterator(['some_directory']), ], [ '', '', + [ + 'type' => AwsS3::TYPE_DIR + ], true, - [], - true + new \ArrayIterator(['']), ], [ '/', '', + [ + 'type' => AwsS3::TYPE_DIR + ], true, - [], - true + new \ArrayIterator(['']), ], ]; } @@ -297,13 +309,12 @@ public function testIsFile( array $metadata, bool $expected ): void { - $this->adapterMock->method('has') + $this->adapterMock->method('fileExists') ->with($normalizedPath) ->willReturn($has); - $this->adapterMock->method('getMetadata') + $this->metadataProviderMock->method('getMetadata') ->with($normalizedPath) ->willReturn($metadata); - self::assertSame($expected, $this->driver->isFile($path)); } @@ -408,21 +419,18 @@ public function testSearchDirectory(): void $expression = '/*'; $path = 'path'; $subPaths = [ - ['path' => 'path/1', 'dirname' => self::URL], - ['path' => 'path/2', 'dirname' => self::URL] + new \League\Flysystem\DirectoryAttributes('path/1/'), + new \League\Flysystem\DirectoryAttributes('path/2/') ]; - $expectedResult = [self::URL . 'path/1', self::URL . 'path/2']; - $this->adapterMock->expects(self::atLeastOnce())->method('has') - ->willReturnMap([ - [$path, true] - ]); - $this->adapterMock->expects(self::atLeastOnce())->method('getMetadata') + $expectedResult = [self::URL . 'path/1/', self::URL . 'path/2/']; + $this->metadataProviderMock->expects(self::any())->method('getMetadata') ->willReturnMap([ - [$path, ['type' => AwsS3::TYPE_DIR]] + ['path', ['type' => AwsS3::TYPE_DIR]], + ['path/1', ['type' => AwsS3::TYPE_FILE]], + ['path/2', ['type' => AwsS3::TYPE_FILE]], ]); $this->adapterMock->expects(self::atLeastOnce())->method('listContents') - ->with($path, false) - ->willReturn($subPaths); + ->willReturn(new \ArrayIterator($subPaths)); self::assertEquals($expectedResult, $this->driver->search($expression, $path)); } @@ -435,20 +443,17 @@ public function testSearchFiles(): void $expression = '/*'; $path = 'path'; $subPaths = [ - ['path' => 'path/1.jpg', 'dirname' => self::URL], - ['path' => 'path/2.png', 'dirname' => self::URL] + new \League\Flysystem\DirectoryAttributes('path/1.jpg'), + new \League\Flysystem\DirectoryAttributes('path/2.png') ]; $expectedResult = [self::URL . 'path/1.jpg', self::URL . 'path/2.png']; - - $this->adapterMock->expects(self::atLeastOnce())->method('has') + $this->metadataProviderMock->expects(self::atLeastOnce())->method('getMetadata') ->willReturnMap([ - [$path, true], + ['path', ['type' => AwsS3::TYPE_DIR]], + ['path/1.jpg', ['type' => AwsS3::TYPE_FILE]], + ['path/2.png', ['type' => AwsS3::TYPE_FILE]], ]); - $this->adapterMock->expects(self::atLeastOnce())->method('getMetadata') - ->willReturnMap([ - [$path, ['type' => AwsS3::TYPE_DIR]], - ]); - $this->adapterMock->expects(self::atLeastOnce())->method('listContents')->with($path, false) + $this->adapterMock->expects(self::atLeastOnce())->method('listContents') ->willReturn($subPaths); self::assertEquals($expectedResult, $this->driver->search($expression, $path)); @@ -459,21 +464,22 @@ public function testSearchFiles(): void */ public function testCreateDirectory(): void { - $this->adapterMock->expects(self::exactly(2)) - ->method('has') - ->willReturnMap([ - ['test', true], - ['test/test2', false] - ]); - $this->adapterMock->expects(self::once()) + $this->metadataProviderMock->expects($this->any()) ->method('getMetadata') - ->willReturnMap([ - ['test', ['type' => AwsS3::TYPE_DIR]] - ]); - $this->adapterMock->expects(self::once()) - ->method('createDir') + ->willReturnCallback(function ($param) { + if ($param == 'test') { + return ['type' => AwsS3::TYPE_DIR]; + } else { + throw new UnableToRetrieveMetadata(''); + } + }); + $this->adapterMock->expects($this->any()) + ->method('listContents') ->with('test/test2') - ->willReturn(true); + ->willReturn(new \EmptyIterator()); + $this->adapterMock->expects(self::once()) + ->method('createDirectory') + ->with('test/test2'); self::assertTrue($this->driver->createDirectory(self::URL . 'test/test2/')); } diff --git a/app/code/Magento/AwsS3/composer.json b/app/code/Magento/AwsS3/composer.json index 77ed75862d192..2bf91663f5881 100644 --- a/app/code/Magento/AwsS3/composer.json +++ b/app/code/Magento/AwsS3/composer.json @@ -6,11 +6,10 @@ }, "require": { "php": "~7.3.0||~7.4.0", - "magento/framework": "^100.0.2", + "magento/framework": "*", "magento/module-remote-storage": "*", - "league/flysystem": "^1.0", - "league/flysystem-aws-s3-v3": "^1.0", - "league/flysystem-cached-adapter": "^1.0" + "league/flysystem": "^2.0", + "league/flysystem-aws-s3-v3": "^2.0" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/AwsS3/etc/di.xml b/app/code/Magento/AwsS3/etc/di.xml index 94df51fcd6856..04f68d2890580 100644 --- a/app/code/Magento/AwsS3/etc/di.xml +++ b/app/code/Magento/AwsS3/etc/di.xml @@ -13,4 +13,9 @@ </argument> </arguments> </type> + <type name="Magento\RemoteStorage\Driver\Adapter\MetadataProvider"> + <arguments> + <argument name="adapter" xsi:type="object">League\Flysystem\AwsS3V3\AwsS3V3Adapter</argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php index 519db00d6439d..8227966e43f63 100644 --- a/app/code/Magento/Backend/App/Action/Plugin/Authentication.php +++ b/app/code/Magento/Backend/App/Action/Plugin/Authentication.php @@ -225,8 +225,10 @@ protected function _redirectIfNeededAfterLogin(\Magento\Framework\App\RequestInt // Checks, whether secret key is required for admin access or request uri is explicitly set if ($this->_url->useSecretKey()) { - $requestParts = explode('/', trim($request->getRequestUri(), '/'), 2); - $requestUri = $this->_url->getUrl(array_pop($requestParts)); + $requestParts = explode('/', trim($request->getRequestUri(), '/'), 3); + $baseUrlPath = trim(parse_url($this->backendUrl->getBaseUrl(), PHP_URL_PATH), '/'); + $routeIndex = empty($baseUrlPath) ? 0 : 1; + $requestUri = $this->_url->getUrl($requestParts[$routeIndex]); } elseif ($request) { $requestUri = $request->getRequestUri(); } diff --git a/app/code/Magento/Backend/Block/Dashboard/Bar.php b/app/code/Magento/Backend/Block/Dashboard/Bar.php index 57f13c740f78e..65c0aa961edf6 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Bar.php +++ b/app/code/Magento/Backend/Block/Dashboard/Bar.php @@ -5,6 +5,7 @@ */ namespace Magento\Backend\Block\Dashboard; +use Magento\Directory\Model\Currency; use Magento\Store\Model\Store; /** @@ -20,10 +21,15 @@ class Bar extends \Magento\Backend\Block\Dashboard\AbstractDashboard protected $_totals = []; /** - * @var \Magento\Directory\Model\Currency|null + * @var Currency|null */ protected $_currentCurrencyCode = null; + /** + * @var Currency + */ + private $_currency; + /** * Get totals * @@ -67,7 +73,7 @@ public function format($price) /** * Setting currency model * - * @param \Magento\Directory\Model\Currency $currency + * @param Currency $currency * @return void */ public function setCurrency($currency) @@ -78,7 +84,7 @@ public function setCurrency($currency) /** * Retrieve currency model if not set then return currency model for current store * - * @return \Magento\Directory\Model\Currency + * @return Currency * @SuppressWarnings(PHPMD.RequestAwareBlockMethod) */ public function getCurrency() diff --git a/app/code/Magento/Backend/Block/Store/Switcher.php b/app/code/Magento/Backend/Block/Store/Switcher.php index 2b9f70844df86..2ae929f9b7398 100644 --- a/app/code/Magento/Backend/Block/Store/Switcher.php +++ b/app/code/Magento/Backend/Block/Store/Switcher.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Backend\Block\Store; @@ -17,7 +18,7 @@ class Switcher extends \Magento\Backend\Block\Template /** * URL for store switcher hint */ - const HINT_URL = 'https://docs.magento.com/m2/ce/user_guide/configuration/scope.html'; + const HINT_URL = 'https://docs.magento.com/user-guide/configuration/scope.html'; /** * Name of website variable @@ -114,7 +115,8 @@ protected function _construct() { parent::_construct(); - $this->setUseConfirm(true); + $this->setUseConfirm($this->hasData('use_confirm') ? (bool)$this->getData('use_confirm') : true); + $this->setUseAjax(true); $this->setShowManageStoresLink(0); @@ -449,14 +451,17 @@ public function hasScopeSelected() */ public function getCurrentSelectionName() { - if (!($name = $this->getCurrentStoreName())) { - if (!($name = $this->getCurrentStoreGroupName())) { - if (!($name = $this->getCurrentWebsiteName())) { - $name = $this->getDefaultSelectionName(); - } - } + if ($this->getCurrentStoreName() !== '') { + return $this->getCurrentStoreName(); + } + if ($this->getCurrentStoreGroupName() !== '') { + return $this->getCurrentStoreGroupName(); + } + + if ($this->getCurrentWebsiteName() !== '') { + return $this->getCurrentWebsiteName(); } - return $name; + return $this->getDefaultSelectionName(); } /** @@ -473,6 +478,8 @@ public function getCurrentWebsiteName() return $website->getName(); } } + + return ''; } /** @@ -489,6 +496,8 @@ public function getCurrentStoreGroupName() return $group->getName(); } } + + return ''; } /** @@ -505,6 +514,8 @@ public function getCurrentStoreName() return $store->getName(); } } + + return ''; } /** @@ -586,13 +597,11 @@ public function getHintHtml() $html = ''; $url = $this->getHintUrl(); if ($url) { - $html = '<div class="admin__field-tooltip tooltip">' . '<a' . ' href="' . $this->escapeUrl( - $url - ) . '"' . ' onclick="this.target=\'_blank\'"' . ' title="' . __( - 'What is this?' - ) . '"' . ' class="admin__field-tooltip-action action-help"><span>' . __( - 'What is this?' - ) . '</span></a>' . ' </div>'; + $html = '<div class="admin__field-tooltip tooltip"><a href="%s" onclick="this.target=\'_blank\'" title="%s" + class="admin__field-tooltip-action action-help"><span>%s</span></a></span></div>'; + $title = $this->escapeHtmlAttr(__('What is this?')); + $span= $this->escapeHtml(__('What is this?')); + $html = sprintf($html, $this->escapeUrl($url), $title, $span); } return $html; } diff --git a/app/code/Magento/Backend/Block/Widget.php b/app/code/Magento/Backend/Block/Widget.php index d2f9ac485b7c8..05a7444998c8b 100644 --- a/app/code/Magento/Backend/Block/Widget.php +++ b/app/code/Magento/Backend/Block/Widget.php @@ -15,6 +15,8 @@ class Widget extends \Magento\Backend\Block\Template { /** + * Get ID + * * @return string */ public function getId() @@ -37,6 +39,8 @@ public function getSuffixId($suffix) } /** + * Get HTML ID + * * @return string */ public function getHtmlId() @@ -59,6 +63,8 @@ public function getCurrentUrl($params = []) } /** + * Prepare Breadcrumbs + * * @param string $label * @param string|null $title * @param string|null $link @@ -84,7 +90,13 @@ public function getButtonHtml($label, $onclick, $class = '', $buttonId = null, $ return $this->getLayout()->createBlock( \Magento\Backend\Block\Widget\Button::class )->setData( - ['label' => $label, 'onclick' => $onclick, 'class' => $class, 'type' => 'button', 'id' => $buttonId] + [ + 'label' => $label, + 'onclick' => $onclick, + 'class' => $class, + 'type' => 'button', + 'id' => $buttonId + ] )->setDataAttribute( $dataAttr )->toHtml(); diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php index 16be2cf1343eb..410265c632216 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php @@ -1,13 +1,17 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Backend\Controller\Adminhtml\Auth; +use Magento\Backend\App\Area\FrontNameResolver; +use Magento\Backend\App\BackendAppList; +use Magento\Backend\Model\UrlFactory; use Magento\Framework\App\Action\HttpGetActionInterface as HttpGet; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPost; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\App\Request\Http; /** * @api @@ -20,18 +24,50 @@ class Login extends \Magento\Backend\Controller\Adminhtml\Auth implements HttpGe */ protected $resultPageFactory; + /** + * @var FrontNameResolver + */ + private $frontNameResolver; + + /** + * @var BackendAppList + */ + private $backendAppList; + + /** + * @var UrlFactory + */ + private $backendUrlFactory; + + /** + * @var Http + */ + private $http; + /** * Constructor * * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory + * @param FrontNameResolver|null $frontNameResolver + * @param BackendAppList|null $backendAppList + * @param UrlFactory|null $backendUrlFactory + * @param Http|null $http */ public function __construct( \Magento\Backend\App\Action\Context $context, - \Magento\Framework\View\Result\PageFactory $resultPageFactory + \Magento\Framework\View\Result\PageFactory $resultPageFactory, + FrontNameResolver $frontNameResolver = null, + BackendAppList $backendAppList = null, + UrlFactory $backendUrlFactory = null, + Http $http = null ) { $this->resultPageFactory = $resultPageFactory; parent::__construct($context); + $this->frontNameResolver = $frontNameResolver ?? ObjectManager::getInstance()->get(FrontNameResolver::class); + $this->backendAppList = $backendAppList ?? ObjectManager::getInstance()->get(BackendAppList::class); + $this->backendUrlFactory = $backendUrlFactory ?? ObjectManager::getInstance()->get(UrlFactory::class); + $this->http = $http ?? ObjectManager::getInstance()->get(Http::class); } /** @@ -49,7 +85,8 @@ public function execute() } $requestUrl = $this->getRequest()->getUri(); - if (!$requestUrl->isValid()) { + + if (!$requestUrl->isValid() || !$this->isValidBackendUri()) { return $this->getRedirect($this->getUrl('*')); } @@ -69,4 +106,26 @@ private function getRedirect($path) $resultRedirect->setPath($path); return $resultRedirect; } + + /** + * Verify if correct backend uri requested. + * + * @return bool + */ + private function isValidBackendUri(): bool + { + $requestUri = $this->getRequest()->getRequestUri(); + $backendApp = $this->backendAppList->getCurrentApp(); + $baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH); + if (!$backendApp) { + $backendFrontName = $this->frontNameResolver->getFrontName(); + } else { + //In case of application authenticating through the admin login, the script name should be removed + //from the path, because application has own script. + $baseUrl = $this->http->getUrlNoScript($baseUrl); + $backendFrontName = $backendApp->getCookiePath(); + } + + return strpos($requestUri, $baseUrl . $backendFrontName) === 0; + } } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php index c709859adb190..167cefa7123ae 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php @@ -6,8 +6,11 @@ namespace Magento\Backend\Controller\Adminhtml\Dashboard; +use Magento\Backend\App\Action\Context; use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\Stdlib\DateTime\Filter\Date; use Magento\Reports\Controller\Adminhtml\Report\Statistics; +use Psr\Log\LoggerInterface; /** * Refresh Dashboard statistics action. @@ -15,16 +18,21 @@ class RefreshStatistics extends Statistics implements HttpPostActionInterface { /** - * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter + * @var LoggerInterface + */ + private $logger; + + /** + * @param Context $context + * @param Date $dateFilter * @param array $reportTypes - * @param \Psr\Log\LoggerInterface $logger + * @param LoggerInterface $logger */ public function __construct( - \Magento\Backend\App\Action\Context $context, - \Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter, + Context $context, + Date $dateFilter, array $reportTypes, - \Psr\Log\LoggerInterface $logger + LoggerInterface $logger ) { parent::__construct($context, $dateFilter, $reportTypes); $this->logger = $logger; diff --git a/app/code/Magento/Backend/Model/Auth/Session.php b/app/code/Magento/Backend/Model/Auth/Session.php index 8f959d873243a..b52796d75659b 100644 --- a/app/code/Magento/Backend/Model/Auth/Session.php +++ b/app/code/Magento/Backend/Model/Auth/Session.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Backend\Model\Auth; use Magento\Framework\App\ObjectManager; @@ -210,7 +212,8 @@ public function prolong() ->setPath($this->sessionConfig->getCookiePath()) ->setDomain($this->sessionConfig->getCookieDomain()) ->setSecure($this->sessionConfig->getCookieSecure()) - ->setHttpOnly($this->sessionConfig->getCookieHttpOnly()); + ->setHttpOnly($this->sessionConfig->getCookieHttpOnly()) + ->setSameSite($this->sessionConfig->getCookieSameSite()); $this->cookieManager->setPublicCookie($this->getName(), $cookieValue, $cookieMetadata); } } diff --git a/app/code/Magento/Backend/Model/Menu/Config.php b/app/code/Magento/Backend/Model/Menu/Config.php index b268da43f6f7b..1e6d2bbc21895 100644 --- a/app/code/Magento/Backend/Model/Menu/Config.php +++ b/app/code/Magento/Backend/Model/Menu/Config.php @@ -63,6 +63,11 @@ class Config */ protected $_appState; + /** + * @var Builder + */ + private $_menuBuilder; + /** * @param \Magento\Backend\Model\Menu\Builder $menuBuilder * @param \Magento\Backend\Model\Menu\AbstractDirector $menuDirector diff --git a/app/code/Magento/Backend/Model/Session/AdminConfig.php b/app/code/Magento/Backend/Model/Session/AdminConfig.php index 2662d7a2d7eeb..ee5a59f86c001 100644 --- a/app/code/Magento/Backend/Model/Session/AdminConfig.php +++ b/app/code/Magento/Backend/Model/Session/AdminConfig.php @@ -85,6 +85,7 @@ public function __construct( $this->setCookiePath($adminPath); $this->setName($sessionName); $this->setCookieSecure($this->_httpRequest->isSecure()); + $this->setCookieSameSite('Lax'); } /** @@ -96,6 +97,7 @@ private function extractAdminPath() { $backendApp = $this->backendAppList->getCurrentApp(); $cookiePath = null; + //phpcs:ignore $baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH); if (!$backendApp) { $cookiePath = $baseUrl . $this->_frontNameResolver->getFrontName(); diff --git a/app/code/Magento/Backend/Model/Validator/UrlKey/CompositeUrlKey.php b/app/code/Magento/Backend/Model/Validator/UrlKey/CompositeUrlKey.php new file mode 100644 index 0000000000000..d144bff9ef9f0 --- /dev/null +++ b/app/code/Magento/Backend/Model/Validator/UrlKey/CompositeUrlKey.php @@ -0,0 +1,41 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Model\Validator\UrlKey; + +/** + * Class Composite validates if urlKey doesn't matches frontName or restricted words(endpoint names) + */ +class CompositeUrlKey implements UrlKeyValidatorInterface +{ + /** + * @var UrlKeyValidatorInterface[] + */ + private $validators; + + /** + * @param array $validators + */ + public function __construct( + array $validators = [] + ) { + $this->validators = $validators; + } + + /** + * @inheritDoc + */ + public function validate(string $urlKey): array + { + $errors = []; + foreach ($this->validators as $validator) { + $errors[] = $validator->validate($urlKey); + } + + return array_merge([], ...$errors); + } +} diff --git a/app/code/Magento/Backend/Model/Validator/UrlKey/FrontName.php b/app/code/Magento/Backend/Model/Validator/UrlKey/FrontName.php new file mode 100644 index 0000000000000..c2c9a4d0be81e --- /dev/null +++ b/app/code/Magento/Backend/Model/Validator/UrlKey/FrontName.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Model\Validator\UrlKey; + +use Magento\Backend\App\Area\FrontNameResolver; + +/** + * Class FrontName validates if urlKey doesn't matches frontName + */ +class FrontName implements UrlKeyValidatorInterface +{ + /** + * @var FrontNameResolver + */ + private $frontNameResolver; + + /** + * @param FrontNameResolver $frontNameResolver + */ + public function __construct( + FrontNameResolver $frontNameResolver + ) { + $this->frontNameResolver = $frontNameResolver; + } + + /** + * @inheritDoc + */ + public function validate(string $urlKey): array + { + $errors = []; + $frontName = $this->frontNameResolver->getFrontName(); + if ($urlKey == $frontName) { + $errors[] = __( + 'URL key "%1" matches a reserved endpoint name (%2). Use another URL key.', + $urlKey, + $frontName + ); + } + + return $errors; + } +} diff --git a/app/code/Magento/Backend/Model/Validator/UrlKey/RestrictedWords.php b/app/code/Magento/Backend/Model/Validator/UrlKey/RestrictedWords.php new file mode 100644 index 0000000000000..7fd72d5e35ad2 --- /dev/null +++ b/app/code/Magento/Backend/Model/Validator/UrlKey/RestrictedWords.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Model\Validator\UrlKey; + +use Magento\Framework\Validator\UrlKey; + +/** + * Class RestrictedWords validates if urlKey doesn't matches restricted words(endpoint names) + */ +class RestrictedWords implements UrlKeyValidatorInterface +{ + /** + * @var UrlKey + */ + private $urlKey; + + /** + * @param UrlKey $urlKey + */ + public function __construct( + UrlKey $urlKey + ) { + $this->urlKey = $urlKey; + } + + /** + * @inheritDoc + */ + public function validate(string $urlKey): array + { + $errors = []; + if (!$this->urlKey->isValid($urlKey)) { + $errors[] = __( + 'URL key "%1" matches a reserved endpoint name (%2). Use another URL key.', + $urlKey, + implode(', ', $this->urlKey->getRestrictedValues()) + ); + } + + return $errors; + } +} diff --git a/app/code/Magento/Backend/Model/Validator/UrlKey/UrlKeyValidatorInterface.php b/app/code/Magento/Backend/Model/Validator/UrlKey/UrlKeyValidatorInterface.php new file mode 100644 index 0000000000000..058162e722a09 --- /dev/null +++ b/app/code/Magento/Backend/Model/Validator/UrlKey/UrlKeyValidatorInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Model\Validator\UrlKey; + +/** + * Interface UrlKeyValidatorInterface is responsive for validating urlKeys + */ +interface UrlKeyValidatorInterface +{ + /** + * Validates urlKey + * + * @param string $urlKey + * @return array + */ + public function validate(string $urlKey): array; +} diff --git a/app/code/Magento/Backend/README.md b/app/code/Magento/Backend/README.md index f70dc9f676236..10d5b7baec9a9 100644 --- a/app/code/Magento/Backend/README.md +++ b/app/code/Magento/Backend/README.md @@ -21,48 +21,48 @@ Before disabling or uninstalling this module, note that the following modules de - Magento_User - Magento_Webapi -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Structure -Beyond the [usual module file structure](https://devdocs.magento.com/guides/v2.3/architecture/archi_perspectives/components/modules/mod_intro.html) the module contains a directory `Service/V1`. +Beyond the [usual module file structure](https://devdocs.magento.com/guides/v2.4/architecture/archi_perspectives/components/modules/mod_intro.html) the module contains a directory `Service/V1`. `Service/V1` - contains logic to provide a list of modules installed in Magento. -For information about typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/module-file-structure.html#module-file-structure). +For information about typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). ## Extensibility -Extension developers can interact with the Magento_Backend module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_Backend module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Backend module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Backend module. ### Events The module dispatches the following events: - - `adminhtml_block_html_before` event in the `\Magento\Backend\Block\Template::_toHtml()` method. Parameters: - - `block` is the backend block template (this) (`\Magento\Backend\Block\Template` class). - - `adminhtml_store_edit_form_prepare_form` event in the `\Magento\Backend\Block\System\Store\Edit\AbstractForm::_prepareForm()` method. Parameters: - - `block` is the AbstractForm block (this) (`\Magento\Backend\Block\System\Store\Edit\AbstractForm` class). - - `backend_block_widget_grid_prepare_grid_before` event in the `\Magento\Backend\Block\Widget\Grid::_prepareGrid()` method. Parameters: - - `grid` is the widget grid block (this) (`\Magento\Backend\Block\Widget\Grid` class) - - `collection` is the grid collection (`\Magento\Framework\Data\Collection` class). - - `adminhtml_cache_flush_system` event in the `\Magento\Backend\Console\Command\CacheCleanCommand::performAction()` method. - - `adminhtml_cache_flush_all` event in the `\Magento\Backend\Console\Command\CacheFlushCommand::performAction()` method. - - `clean_catalog_images_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanImages::execute()` method. - - `clean_media_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanMedia::execute()` method. - - `clean_static_files_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles::execute()` method. - - `adminhtml_cache_flush_all` event in the `\Magento\Backend\Controller\Adminhtml\Cache\FlushAll::execute()` method. - - `adminhtml_cache_flush_system` event in the `\Magento\Backend\Controller\Adminhtml\Cache\FlushSystem::execute()` method. - - `theme_save_after` event in the `\Magento\Backend\Controller\Adminhtml\System\Design\Save::execute()` method. - - `backend_auth_user_login_success` event in the `\Magento\Backend\Model\Auth::login()` method. Parameters: - - `user` is the credential storage object (`null | \Magento\Backend\Model\Auth\Credential\StorageInterface`) - - `backend_auth_user_login_failed` event in the `\Magento\Backend\Model\Auth::login()` method. Parameters: - - `user_name` is username extracted from the credential storage object (`null | \Magento\Backend\Model\Auth\Credential\StorageInterface`) - - `exception` any exception generated (`\Magento\Framework\Exception\LocalizedException | \Magento\Framework\Exception\Plugin\AuthenticationException`) - -For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events). +- `adminhtml_block_html_before` event in the `\Magento\Backend\Block\Template::_toHtml()` method. Parameters: + - `block` is the backend block template (this) (`\Magento\Backend\Block\Template` class). +- `adminhtml_store_edit_form_prepare_form` event in the `\Magento\Backend\Block\System\Store\Edit\AbstractForm::_prepareForm()` method. Parameters: + - `block` is the AbstractForm block (this) (`\Magento\Backend\Block\System\Store\Edit\AbstractForm` class). +- `backend_block_widget_grid_prepare_grid_before` event in the `\Magento\Backend\Block\Widget\Grid::_prepareGrid()` method. Parameters: + - `grid` is the widget grid block (this) (`\Magento\Backend\Block\Widget\Grid` class) + - `collection` is the grid collection (`\Magento\Framework\Data\Collection` class). +- `adminhtml_cache_flush_system` event in the `\Magento\Backend\Console\Command\CacheCleanCommand::performAction()` method. +- `adminhtml_cache_flush_all` event in the `\Magento\Backend\Console\Command\CacheFlushCommand::performAction()` method. +- `clean_catalog_images_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanImages::execute()` method. +- `clean_media_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanMedia::execute()` method. +- `clean_static_files_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles::execute()` method. +- `adminhtml_cache_flush_all` event in the `\Magento\Backend\Controller\Adminhtml\Cache\FlushAll::execute()` method. +- `adminhtml_cache_flush_system` event in the `\Magento\Backend\Controller\Adminhtml\Cache\FlushSystem::execute()` method. +- `theme_save_after` event in the `\Magento\Backend\Controller\Adminhtml\System\Design\Save::execute()` method. +- `backend_auth_user_login_success` event in the `\Magento\Backend\Model\Auth::login()` method. Parameters: + - `user` is the credential storage object (`null | \Magento\Backend\Model\Auth\Credential\StorageInterface`) +- `backend_auth_user_login_failed` event in the `\Magento\Backend\Model\Auth::login()` method. Parameters: + - `user_name` is username extracted from the credential storage object (`null | \Magento\Backend\Model\Auth\Credential\StorageInterface`) + - `exception` any exception generated (`\Magento\Framework\Exception\LocalizedException | \Magento\Framework\Exception\Plugin\AuthenticationException`) + +For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). ### Layouts @@ -94,8 +94,7 @@ This module introduces the following layouts and layout handles in the `view/adm - `overlay_popup` - `popup` - -For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ### UI components @@ -104,8 +103,8 @@ You can extend Magento_Backend module using the following configuration files: - `view/adminhtml/ui_component/design_config_form.xml` - `view/adminhtml/ui_component/design_config_listing.xml` -For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html). +For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickFlushCatalogImagesCacheActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickFlushCatalogImagesCacheActionGroup.xml new file mode 100644 index 0000000000000..ba36e4f0a84ca --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickFlushCatalogImagesCacheActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickFlushCatalogImagesCacheActionGroup"> + <annotations> + <description>Clicks the 'Flush Catalog Images Cache' button on the Admin Cache Management page</description> + </annotations> + <waitForElementVisible selector="{{AdminCacheManagementSection.flushCatalogImagesCacheButton}}" stepKey="waitForFlushCatalogImagesCacheButton"/> + <click selector="{{AdminCacheManagementSection.flushCatalogImagesCacheButton}}" stepKey="clickFlushCatalogImagesCacheButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForText userInput="The image cache was cleaned." selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterLegacyGridActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterLegacyGridActionGroup.xml index 3b1ed2c6a7670..92c8eeb644ce6 100644 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterLegacyGridActionGroup.xml +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterLegacyGridActionGroup.xml @@ -11,8 +11,10 @@ <actionGroup name="AdminFilterLegacyGridActionGroup"> <arguments> <argument name="value" type="string"/> + <argument name="field" type="string" defaultValue="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('name')}}"/> <argument name="button" type="string" defaultValue="{{AdminLegacyDataGridFilterSection.apply}}"/> </arguments> + <waitForElementVisible selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="waitForResetFilters" /> <click selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="resetFilters" /> <waitForPageLoad stepKey="waitForFilterReset" /> <fillField selector="{{field}}" userInput="{{value}}" stepKey="fillFieldInFilter"/> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminGoToCacheManagementPageActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminGoToCacheManagementPageActionGroup.xml new file mode 100644 index 0000000000000..5d3d9a32df683 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminGoToCacheManagementPageActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminGoToCacheManagementPageActionGroup"> + <annotations> + <description>Goes to the Admin Cache Management page</description> + </annotations> + <amOnPage url="{{AdminCacheManagementPage.url}}" stepKey="goToCacheManagementPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminDashboardDisplayedWithNoErrorsActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminDashboardDisplayedWithNoErrorsActionGroup.xml new file mode 100644 index 0000000000000..3afe1cbde1c49 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminDashboardDisplayedWithNoErrorsActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminDashboardDisplayedWithNoErrorsActionGroup"> + <annotations> + <description>Checks if Dashboard is displayed properly</description> + </annotations> + + <seeElement selector="{{AdminDashboardSection.dashboardDiagramOrderContentTab}}" stepKey="seeOrderContentTab"/> + <seeElement selector="{{AdminDashboardSection.dashboardDiagramContent}}" stepKey="seeDiagramContent"/> + <click selector="{{AdminDashboardSection.dashboardDiagramAmounts}}" stepKey="clickDashboardAmount"/> + <waitForLoadingMaskToDisappear stepKey="waitForDashboardAmountLoading"/> + <seeElement selector="{{AdminDashboardSection.dashboardDiagramAmountsContentTab}}" stepKey="seeDiagramAmountContent"/> + <seeElement selector="{{AdminDashboardSection.dashboardDiagramTotals}}" stepKey="seeAmountTotals"/> + <dontSeeJsError stepKey="dontSeeJsError"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/Data/AdminWebConfigData.xml b/app/code/Magento/Backend/Test/Mftf/Data/AdminWebConfigData.xml new file mode 100644 index 0000000000000..dba631f46e701 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Data/AdminWebConfigData.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="AdminEnableUrlRewritesConfigData"> + <data key="path">web/seo/use_rewrites</data> + <data key="value">1</data> + </entity> + <entity name="AdminDisableUrlRewritesConfigData"> + <data key="path">web/seo/use_rewrites</data> + <data key="value">0</data> + </entity> +</entities> diff --git a/app/code/Magento/Backend/Test/Mftf/Data/GeneralLocalConfigsData.xml b/app/code/Magento/Backend/Test/Mftf/Data/GeneralLocalConfigsData.xml index 0477befccc06e..f772a77ddd365 100644 --- a/app/code/Magento/Backend/Test/Mftf/Data/GeneralLocalConfigsData.xml +++ b/app/code/Magento/Backend/Test/Mftf/Data/GeneralLocalConfigsData.xml @@ -8,6 +8,12 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="GeneralLocaleCodeConfigsForUkraine"> + <data key="path">general/locale/code</data> + <data key="scope">websites</data> + <data key="scope_code">base</data> + <data key="value">uk_UA</data> + </entity> <entity name="GeneralLocalCodeConfigsForChina"> <data key="path">general/locale/code</data> <data key="scope">websites</data> diff --git a/app/code/Magento/Backend/Test/Mftf/Data/SystemUploadConfigurationConfigData.xml b/app/code/Magento/Backend/Test/Mftf/Data/SystemUploadConfigurationConfigData.xml new file mode 100644 index 0000000000000..17688b9f69ff3 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Data/SystemUploadConfigurationConfigData.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="SystemUploadConfigurationMaxWidth"> + <data key="path">system/upload_configuration/max_width</data> + <data key="value">1920</data> + </entity> + <entity name="SystemUploadConfigurationMaxHeight"> + <data key="path">system/upload_configuration/max_height</data> + <data key="value">1200</data> + </entity> +</entities> diff --git a/app/code/Magento/Backend/Test/Mftf/Helper/CurlHelpers.php b/app/code/Magento/Backend/Test/Mftf/Helper/CurlHelpers.php new file mode 100644 index 0000000000000..9705ec8083455 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Helper/CurlHelpers.php @@ -0,0 +1,124 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Test\Mftf\Helper; + +use Magento\FunctionalTestingFramework\Helper\Helper; + +/** + * Class for MFTF helpers for curl requests. + */ +class CurlHelpers extends Helper +{ + /** + * Asserts that a curl request's response contains an expected string + * + * @param string $url + * @param string $expectedString + * @param string $postBody + * @param string $cookieName + * @param string $message + * @return void + * + */ + public function assertCurlResponseContainsString($url, $expectedString, $postBody = null, $cookieName = 'admin', $message = ''): void + { + $cookie = $this->getCookie($cookieName); + $curlResponse = $this->getCurlResponse($url, $cookie, $postBody); + $this->assertStringContainsString($expectedString, $curlResponse, $message); + } + + /** + * Asserts that an MD5 encoded image retrieved via a curl request equals the expected string + * + * @param string $url + * @param string $expectedString + * @param string $postBody + * @param string $cookieName + * @param string $message + * @return void + * + */ + public function assertImageContentIsEqual($url, $expectedString, $postBody = null, $cookieName = null, $message = ''): void + { + $cookie = $this->getCookie($cookieName); + $imageContent = $this->getCurlResponse($url, $cookie, $postBody); + // Must make request twice until bug is resolved: B2B-1789 + $imageContent = $this->getCurlResponse($url, $cookie, $postBody); + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction + $imageContentMD5 = md5($imageContent); + $this->assertStringContainsString($expectedString, $imageContentMD5, $message); + } + + /** + * Assert a that a curl request's response does not contain an expected string + * + * @param string $url + * @param string $expectedString + * @param string $postBody + * @param string $cookieName + * @return void + * + */ + public function assertCurlResponseDoesNotContainString($url, $expectedString, $postBody = null, $cookieName = 'admin'): void + { + $cookie = $this->getCookie($cookieName); + $curlResponse = $this->getCurlResponse($url, $cookie, $postBody); + $this->assertStringNotContainsString($expectedString, $curlResponse); + } + + /** + * Sends a curl request with the provided URL & cookie. Returns the response + * + * @param string $url + * @param string $cookie + * @param string $postBody + * @return string + * + */ + private function getCurlResponse($url, $cookie = null, $postBody = null): string + { + // Start Session + $session = curl_init($url); + + // Set Options + if ($postBody) { + $data = json_decode($postBody, true); + curl_setopt($session, CURLOPT_POST, true); + curl_setopt($session, CURLOPT_POSTFIELDS, $data); + } + curl_setopt($session, CURLOPT_COOKIE, $cookie); + curl_setopt($session, CURLOPT_RETURNTRANSFER, true); + + // Execute + $response = curl_exec($session); + curl_close($session); + + return $response; + } + + /** + * Gets the value of the specified cookie and returns the key value pair of the cookie + * + * @param string $cookieName + * @return string + * + */ + private function getCookie($cookieName = 'admin'): string + { + try { + $webDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); + $cookieValue = $webDriver->grabCookie($cookieName); + + return $cookieName . '=' . $cookieValue; + } catch (\Exception $exception) { + $this->fail($exception->getMessage()); + return ''; + } + } +} diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminCacheManagementSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminCacheManagementSection.xml new file mode 100644 index 0000000000000..0e5256f5f6266 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminCacheManagementSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminCacheManagementSection"> + <element name="flushCatalogImagesCacheButton" type="button" selector="#flushCatalogImages"/> + </section> +</sections> diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml index f9d3c49d509e9..9451886b11202 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml @@ -22,6 +22,7 @@ <element name="marketing" type="button" selector="#menu-magento-backend-marketing"/> <element name="system" type="button" selector="#menu-magento-backend-system"/> <element name="findPartners" type="button" selector="#menu-magento-marketplace-partners"/> + <element name="contentMenuClose" type="button" selector="#menu-magento-backend-content a.action-close" timeout="30"/> <!-- Navigate menu selectors --> <element name="menuItem" type="button" selector="li[data-ui-id='menu-{{dataUiId}}']" parameterized="true" timeout="30"/> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckDashboardWithChartsTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckDashboardWithChartsTest.xml new file mode 100644 index 0000000000000..d25801652b6cf --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckDashboardWithChartsTest.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckDashboardWithChartsTest"> + <annotations> + <features value="Backend"/> + <stories value="Google Charts on Magento dashboard"/> + <title value="Admin should see Google chart on Magento dashboard"/> + <description value="Google chart on Magento dashboard page is displaying properly"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-98934"/> + <useCaseId value="MAGETWO-98584"/> + <group value="backend"/> + </annotations> + <before> + <magentoCLI command="config:set admin/dashboard/enable_charts 1" stepKey="setEnableCharts"/> + <createData entity="SimpleProduct2" stepKey="createProduct"> + <field key="price">150</field> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"> + <field key="firstname">John1</field> + <field key="lastname">Doe1</field> + </createData> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <magentoCLI command="config:set admin/dashboard/enable_charts 0" stepKey="setDisableChartsAsDefault"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <grabTextFrom selector="{{AdminDashboardSection.dashboardTotals('Quantity')}}" stepKey="grabQuantityBefore"/> + + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <createData entity="Shipment" stepKey="shipOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + + <reloadPage stepKey="refreshPage"/> + <actionGroup ref="AssertAdminDashboardDisplayedWithNoErrorsActionGroup" stepKey="assertAdminDashboardNotBroken"/> + <grabTextFrom selector="{{AdminDashboardSection.dashboardTotals('Quantity')}}" stepKey="grabQuantityAfter"/> + <assertGreaterThan stepKey="checkQuantityWasChanged"> + <actualResult type="const">$grabQuantityAfter</actualResult> + <expectedResult type="const">$grabQuantityBefore</expectedResult> + </assertGreaterThan> + </test> +</tests> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml index 44577771fe4f8..bfb3d0b23b064 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml @@ -8,16 +8,19 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminDashboardWithChartsTest"> + <test name="AdminDashboardWithChartsTest" deprecated="Use AdminCheckDashboardWithChartsTest instead"> <annotations> <features value="Backend"/> <stories value="Google Charts on Magento dashboard"/> - <title value="Admin should see Google chart on Magento dashboard"/> + <title value="DEPRECATED. Admin should see Google chart on Magento dashboard"/> <description value="Google chart on Magento dashboard page is displaying properly"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-98934"/> <useCaseId value="MAGETWO-98584"/> <group value="backend"/> + <skip> + <issueId value="DEPRECATED">Use AdminCheckDashboardWithChartsTest instead</issueId> + </skip> </annotations> <before> <magentoCLI command="config:set admin/dashboard/enable_charts 1" stepKey="setEnableCharts"/> @@ -69,8 +72,8 @@ <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> <!-- Place Order --> <comment userInput="Place order" stepKey="placeOrder"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessTitle"/> <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order number is: " stepKey="seeOrderNumber"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Search for Order in the order grid --> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml index c5b4e8c34bfec..80a21996e2c0b 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml @@ -21,15 +21,11 @@ </annotations> <before> <magentoCLI command="config:set {{ChangedCookieDomainForMainWebsiteConfigData.path}} --scope={{ChangedCookieDomainForMainWebsiteConfigData.scope}} --scope-code={{ChangedCookieDomainForMainWebsiteConfigData.scope_code}} {{ChangedCookieDomainForMainWebsiteConfigData.value}}" stepKey="changeDomainForMainWebsiteBeforeTestRun"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBeforeTestRun"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> </before> <after> <magentoCLI command="config:set {{EmptyCookieDomainForMainWebsiteConfigData.path}} --scope={{EmptyCookieDomainForMainWebsiteConfigData.scope}} --scope-code={{EmptyCookieDomainForMainWebsiteConfigData.scope_code}} {{EmptyCookieDomainForMainWebsiteConfigData.value}}" stepKey="changeDomainForMainWebsiteAfterTestComplete"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterTestComplete"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterTestComplete"/> </after> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="seeDashboardPage"/> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginSuccessfulWithRewritesDisabledTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginSuccessfulWithRewritesDisabledTest.xml new file mode 100644 index 0000000000000..bd3d39122a365 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginSuccessfulWithRewritesDisabledTest.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminLoginSuccessfulWithRewritesDisabledTest"> + <annotations> + <features value="Backend"/> + <stories value="Login on the Admin Login page"/> + <title + value="Admin should be able to log into the Magento Admin backend successfully if url rewrites are disabled"/> + <description + value="Admin should be able to log into the Magento Admin backend successfully if url rewrites are disabled"/> + <severity value="CRITICAL"/> + <group value="example"/> + <group value="login"/> + </annotations> + + <before> + <magentoCLI command="config:set {{AdminDisableUrlRewritesConfigData.path}} {{AdminDisableUrlRewritesConfigData.value}}" stepKey="disableUrlRewrites"/> + </before> + <after> + <magentoCLI command="config:set {{AdminEnableUrlRewritesConfigData.path}} {{AdminEnableUrlRewritesConfigData.value}}" stepKey="enableUrlRewrites"/> + </after> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="assertLoggedIn"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </test> +</tests> diff --git a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Auth/LoginTest.php b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Auth/LoginTest.php new file mode 100644 index 0000000000000..8bde3187fe698 --- /dev/null +++ b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Auth/LoginTest.php @@ -0,0 +1,198 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Test\Unit\Controller\Adminhtml\Auth; + +use Laminas\Uri\Http; +use Magento\Backend\App\Action\Context; +use Magento\Backend\App\Area\FrontNameResolver; +use Magento\Backend\App\BackendAppList; +use Magento\Backend\Controller\Adminhtml\Auth\Login; +use Magento\Backend\Helper\Data; +use Magento\Backend\Model\Auth; +use Magento\Backend\Model\Url; +use Magento\Backend\Model\UrlFactory; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Framework\App\Cache\StateInterface as CacheState; +use Magento\Framework\App\Cache\TypeListInterface as CacheTypeList; +use Magento\Framework\App\RequestInterface as Request; +use Magento\Framework\App\State; +use Magento\Framework\Controller\Result\RedirectFactory; +use Magento\Framework\Message\ManagerInterface as MessageManager; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Framework\View\Result\PageFactory; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for \Magento\Backend\Controller\Adminhtml\Auth\Login. + */ +class LoginTest extends TestCase +{ + /** + * @var Login + */ + private $controller; + + /** + * @var Redirect|MockObject + */ + private $redirectMock; + + /** + * @var Request|MockObject + */ + private $requestMock; + + /** + * @var Auth|MockObject + */ + private $authMock; + + /** + * @var Http|MockObject + */ + private $uriMock; + + /** + * @var PageFactory|MockObject + */ + private $resultPageFactoryMock; + + /** + * @var BackendAppList|MockObject + */ + private $backendAppListMock; + + /** + * @var UrlFactory|MockObject + */ + private $backendUrlFactoryMock; + + /** + * @var Url|MockObject + */ + private $backendUrlMock; + + /** + * @var FrontNameResolver|MockObject + */ + private $frontNameResolverMock; + + /** + * @var RedirectFactory|MockObject + */ + private $resultRedirectFactoryMock; + + /** + * @var Data|MockObject + */ + private $helperMock; + + protected function setUp(): void + { + $objectManagerHelper = new ObjectManagerHelper($this); + + $this->helperMock = $this->createMock(Data::class); + $this->requestMock = $this->getMockBuilder(Request::class) + ->setMethods(['getUri', 'getRequestUri']) + ->getMockForAbstractClass(); + $this->redirectMock = $this->getMockBuilder(Redirect::class) + ->disableOriginalConstructor() + ->disableOriginalClone() + ->getMock(); + $this->resultRedirectFactoryMock = $this->createMock(RedirectFactory::class); + $this->resultPageFactoryMock = $this->createMock(PageFactory::class); + $this->authMock = $this->createMock(Auth::class); + $this->backendAppListMock = $this->createMock(BackendAppList::class); + $this->backendUrlMock = $this->createMock(Url::class); + $this->backendUrlFactoryMock = $this->createMock(UrlFactory::class); + $this->frontNameResolverMock = $this->createMock(FrontNameResolver::class); + $this->uriMock = $this->createMock(Http::class); + + $this->resultRedirectFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->redirectMock); + $this->backendUrlFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->backendUrlMock); + $this->requestMock->expects($this->any()) + ->method('getUri') + ->willReturn($this->uriMock); + + $contextMock = $this->getMockBuilder(Context::class) + ->disableOriginalConstructor() + ->disableOriginalClone() + ->getMock(); + + $contextMock->expects($this->once()) + ->method('getResultFactory') + ->willReturn($this->resultRedirectFactoryMock); + $contextMock->expects($this->once()) + ->method('getRequest') + ->willReturn($this->requestMock); + $contextMock->expects($this->once()) + ->method('getHelper') + ->willReturn($this->helperMock); + $contextMock->expects($this->once()) + ->method('getResultRedirectFactory') + ->willReturn($this->resultRedirectFactoryMock); + $contextMock->expects($this->once()) + ->method('getAuth') + ->willReturn($this->authMock); + + $this->controller = $objectManagerHelper->getObject( + Login::class, + [ + 'context' => $contextMock, + 'resultPageFactory' => $this->resultPageFactoryMock, + 'backendAppList' => $this->backendAppListMock, + 'backendUrlFactory' => $this->backendUrlFactoryMock, + 'frontNameResolver' => $this->frontNameResolverMock, + ] + ); + } + + /** + * Test for isValidBackendUri method. + * + * @param string $requestUri + * @param string $baseUrl + * @param string $backendFrontName + * @param bool $redirect + * + * @dataProvider isValidBackendUriDataProvider + */ + public function testIsValidBackendUri(string $requestUri, string $baseUrl, string $backendFrontName, bool $redirect) + { + $this->uriMock->expects($this->once())->method('isValid')->willReturn(true); + $this->authMock->expects($this->once())->method('isLoggedIn')->willReturn(false); + $this->requestMock->expects($this->once())->method('getRequestUri')->willReturn($requestUri); + $this->backendUrlMock->expects($this->once())->method('getBaseUrl')->willReturn($baseUrl); + $this->frontNameResolverMock->expects($this->once())->method('getFrontName')->willReturn($backendFrontName); + + $this->resultPageFactoryMock->expects($this->exactly($redirect ? 0 : 1))->method('create'); + $this->resultRedirectFactoryMock->expects($this->exactly($redirect ? 1 : 0))->method('create'); + + $this->controller->execute(); + } + + /** + * Data provider for testIsValidBackendUri. + * + * @return array[] + */ + public function isValidBackendUriDataProvider() + { + return [ + 'Rewrites on, valid url' => ['/index.php/admin', 'http://magento2.local/', 'admin', true], + 'Rewrites on, invalid url' => ['/admin', 'http://magento2.local/', 'admin', false], + 'Rewrites off, valid url' => ['/index.php/admin', 'http://magento2.local/index.php/', 'admin', false], + 'Rewrites off, invalid url' => ['/admin', 'http://magento2.local/index.php/', 'admin', true], + ]; + } +} diff --git a/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php b/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php index de02e11b645ed..0b97f847099a5 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php @@ -84,7 +84,13 @@ protected function setUp(): void ->getMock(); $this->sessionConfig = $this->createPartialMock( \Magento\Framework\Session\Config::class, - ['getCookiePath', 'getCookieDomain', 'getCookieSecure', 'getCookieHttpOnly'] + [ + 'getCookiePath', + 'getCookieDomain', + 'getCookieSecure', + 'getCookieHttpOnly', + 'getCookieSameSite' + ] ); $this->aclBuilder = $this->getMockBuilder(Builder::class) ->disableOriginalConstructor() @@ -193,6 +199,9 @@ public function testProlong() $cookieMetadata->expects($this->once()) ->method('setHttpOnly') ->with($httpOnly)->willReturnSelf(); + $cookieMetadata->expects($this->once()) + ->method('setSameSite') + ->willReturnSelf(); $this->cookieMetadataFactory->expects($this->once()) ->method('createPublicCookieMetadata') @@ -218,6 +227,9 @@ public function testProlong() $this->sessionConfig->expects($this->once()) ->method('getCookieHttpOnly') ->willReturn($httpOnly); + $this->sessionConfig->expects($this->once()) + ->method('getCookieSameSite') + ->willReturn('Lax'); $this->session->prolong(); @@ -247,7 +259,9 @@ public function testIsAllowed($isUserDefined, $isAclDefined, $isAllowed, $expect $this->storage->expects($this->once())->method('getUser')->willReturn($userMock); } if ($isAclDefined && $isUserDefined) { + // phpstan:ignore $userMock->expects($this->any())->method('getAclRole')->willReturn($userAclRole); + // phpstan:ignore $aclMock->expects($this->once())->method('isAllowed')->with($userAclRole)->willReturn($isAllowed); } diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index 1297bd9603a1f..0fd778f2e156b 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -188,4 +188,12 @@ <argument name="anchorRenderer" xsi:type="object">Magento\Backend\Block\AnchorRenderer</argument> </arguments> </type> + <type name="Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey"> + <arguments> + <argument name="validators" xsi:type="array"> + <item name="frontNameValidator" xsi:type="object">Magento\Backend\Model\Validator\UrlKey\FrontName</item> + <item name="restrictedWordsValidator" xsi:type="object">Magento\Backend\Model\Validator\UrlKey\RestrictedWords</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Backend/i18n/en_US.csv b/app/code/Magento/Backend/i18n/en_US.csv index d5870de8b7132..b72db96d6a590 100644 --- a/app/code/Magento/Backend/i18n/en_US.csv +++ b/app/code/Magento/Backend/i18n/en_US.csv @@ -466,3 +466,4 @@ Pagination,Pagination "Theme Name","Theme Name" "Use URL parameter to enable template path hints for Storefront","Use URL parameter to enable template path hints for Storefront" "Add the following parameter to the URL to show template hints ?templatehints=[parameter_value]","Add the following parameter to the URL to show template hints ?templatehints=[parameter_value]" +"URL key "%1" matches a reserved endpoint name (%2). Use another URL key.","URL key "%1" matches a reserved endpoint name (%2). Use another URL key." diff --git a/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml b/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml index 83482b1720cf5..bfc1e6a522b7a 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Backend\Block\Media\Uploader */ ?> diff --git a/app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml b/app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml index c6fcaff9cd877..d2bdacda47ebe 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml @@ -8,222 +8,132 @@ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> <?php if ($websites = $block->getWebsites()): ?> -<div class="store-switcher store-view"> - <span class="store-switcher-label"><?= $block->escapeHtml(__('Scope:')) ?></span> - <div class="actions dropdown closable"> - <input type="hidden" name="store_switcher" id="store_switcher" - data-role="store-view-id" data-param="<?= $block->escapeHtmlAttr($block->getStoreVarName()) ?>" - value="<?= $block->escapeHtml($block->getStoreId()) ?>" - <?= /* @noEscape */ $block->getUiId() ?> /> - <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( - 'onchange', - 'switchScope(this);', - '#store_switcher' - ) ?> - <input type="hidden" name="store_group_switcher" id="store_group_switcher" - data-role="store-group-id" data-param="<?= $block->escapeHtmlAttr($block->getStoreGroupVarName()) ?>" - value="<?= $block->escapeHtml($block->getStoreGroupId()) ?>" - <?= /* @noEscape */ $block->getUiId() ?> /> - <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( - 'onchange', - 'switchScope(this);', - '#store_group_switcher' - ) ?> - <input type="hidden" name="website_switcher" id="website_switcher" - data-role="website-id" data-param="<?= $block->escapeHtmlAttr($block->getWebsiteVarName()) ?>" - value="<?= $block->escapeHtml($block->getWebsiteId()) ?>" - <?= /* @noEscape */ $block->getUiId() ?> /> - <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( - 'onchange', - 'switchScope(this);', - '#website_switcher' - ) ?> - <button - type="button" - class="admin__action-dropdown" - data-mage-init='{"dropdown":{}}' - data-toggle="dropdown" - aria-haspopup="true" - id="store-change-button"> - <?= $block->escapeHtml($block->getCurrentSelectionName()) ?> - </button> - <ul class="dropdown-menu" data-role="stores-list"> - <?php if ($block->hasDefaultOption()): ?> - <li class="store-switcher-all <?php - if (!($block->getDefaultSelectionName() != $block->getCurrentSelectionName())): ?>disabled<?php endif; - ?> <?php if (!$block->hasScopeSelected()): ?>current<?php endif; ?>"> - <?php if ($block->getDefaultSelectionName() != $block->getCurrentSelectionName()): ?> - <a data-role="store-view-id" data-value="" href="#"> - <?= $block->escapeHtml($block->getDefaultSelectionName()) ?> - </a> - <?php else: ?> - <span><?= $block->escapeHtml($block->getDefaultSelectionName()) ?></span> - <?php endif; ?> - </li> - <?php endif; ?> - <?php foreach ($websites as $website): ?> - <?php $showWebsite = false; ?> - <?php foreach ($website->getGroups() as $group): ?> - <?php $showGroup = false; ?> - <?php foreach ($block->getStores($group) as $store): ?> - <?php if ($showWebsite == false): ?> - <?php $showWebsite = true; ?> - <li class="store-switcher-website <?php if (!($block->isWebsiteSwitchEnabled() && - ! $block->isWebsiteSelected($website))): ?>disabled<?php endif; ?> <?php -if ($block->isWebsiteSelected($website)): ?>current<?php endif; ?>"> - <?php if ($block->isWebsiteSwitchEnabled() && ! $block->isWebsiteSelected($website)): ?> - <a data-role="website-id" data-value="<?= $block->escapeHtmlAttr($website->getId()); - ?>" href="#"> - <?= $block->escapeHtml($website->getName()) ?> - </a> - <?php else: ?> - <span><?= $block->escapeHtml($website->getName()) ?></span> - <?php endif; ?> - </li> + <div class="store-switcher store-view"> + <span class="store-switcher-label"><?= $block->escapeHtml(__('Scope:')) ?></span> + <div class="actions dropdown closable"> + <input type="hidden" name="store_switcher" id="store_switcher" + data-role="store-view-id" data-param="<?= $block->escapeHtmlAttr($block->getStoreVarName()) ?>" + value="<?= $block->escapeHtml($block->getStoreId()) ?>" + <?= /* @noEscape */ $block->getUiId() ?> /> + <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( + 'onchange', + 'switchScope(this);', + '#store_switcher' + ) ?> + <input type="hidden" name="store_group_switcher" id="store_group_switcher" + data-role="store-group-id" data-param="<?= $block->escapeHtmlAttr($block->getStoreGroupVarName()) ?>" + value="<?= $block->escapeHtml($block->getStoreGroupId()) ?>" + <?= /* @noEscape */ $block->getUiId() ?> /> + <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( + 'onchange', + 'switchScope(this);', + '#store_group_switcher' + ) ?> + <input type="hidden" name="website_switcher" id="website_switcher" + data-role="website-id" data-param="<?= $block->escapeHtmlAttr($block->getWebsiteVarName()) ?>" + value="<?= $block->escapeHtml($block->getWebsiteId()) ?>" + <?= /* @noEscape */ $block->getUiId() ?> /> + <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( + 'onchange', + 'switchScope(this);', + '#website_switcher' + ) ?> + <button + type="button" + class="admin__action-dropdown" + data-mage-init='{"dropdown":{}}' + data-toggle="dropdown" + aria-haspopup="true" + id="store-change-button"> + <?= $block->escapeHtml($block->getCurrentSelectionName()) ?> + </button> + <ul class="dropdown-menu" data-role="stores-list"> + <?php if ($block->hasDefaultOption()): ?> + <li class="store-switcher-all <?php + if (!($block->getDefaultSelectionName() != $block->getCurrentSelectionName())): ?>disabled<?php endif; + ?> <?php if (!$block->hasScopeSelected()): ?>current<?php endif; ?>"> + <?php if ($block->getDefaultSelectionName() != $block->getCurrentSelectionName()): ?> + <a data-role="store-view-id" data-value="" href="#"> + <?= $block->escapeHtml($block->getDefaultSelectionName()) ?> + </a> + <?php else: ?> + <span><?= $block->escapeHtml($block->getDefaultSelectionName()) ?></span> <?php endif; ?> - <?php if ($showGroup == false): ?> - <?php $showGroup = true; ?> - <li class="store-switcher-store <?php if (!($block->isStoreGroupSwitchEnabled() && - ! $block->isStoreGroupSelected($group))): ?>disabled<?php endif; ?> <?php -if ($block->isStoreGroupSelected($group)): ?>current<?php endif; ?>"> - <?php if ($block->isStoreGroupSwitchEnabled() && - ! $block->isStoreGroupSelected($group)): ?> - <a data-role="store-group-id" - data-value="<?= $block->escapeHtmlAttr($group->getId()) ?>" href="#"> - <?= $block->escapeHtml($group->getName()) ?> + </li> + <?php endif; ?> + <?php foreach ($websites as $website): ?> + <?php $showWebsite = false; ?> + <?php foreach ($website->getGroups() as $group): ?> + <?php $showGroup = false; ?> + <?php foreach ($block->getStores($group) as $store): ?> + <?php if ($showWebsite == false): ?> + <?php $showWebsite = true; ?> + <li class="store-switcher-website <?php if (!($block->isWebsiteSwitchEnabled() && + ! $block->isWebsiteSelected($website))): ?>disabled<?php endif; ?> <?php + if ($block->isWebsiteSelected($website)): ?>current<?php endif; ?>"> + <?php if ($block->isWebsiteSwitchEnabled() && ! $block->isWebsiteSelected($website)): ?> + <a data-role="website-id" data-value="<?= $block->escapeHtmlAttr($website->getId()); + ?>" href="#"> + <?= $block->escapeHtml($website->getName()) ?> + </a> + <?php else: ?> + <span><?= $block->escapeHtml($website->getName()) ?></span> + <?php endif; ?> + </li> + <?php endif; ?> + <?php if ($showGroup == false): ?> + <?php $showGroup = true; ?> + <li class="store-switcher-store <?php if (!($block->isStoreGroupSwitchEnabled() && + ! $block->isStoreGroupSelected($group))): ?>disabled<?php endif; ?> <?php + if ($block->isStoreGroupSelected($group)): ?>current<?php endif; ?>"> + <?php if ($block->isStoreGroupSwitchEnabled() && + ! $block->isStoreGroupSelected($group)): ?> + <a data-role="store-group-id" + data-value="<?= $block->escapeHtmlAttr($group->getId()) ?>" href="#"> + <?= $block->escapeHtml($group->getName()) ?> + </a> + <?php else: ?> + <span><?= $block->escapeHtml($group->getName()) ?></span> + <?php endif; ?> + </li> + <?php endif; ?> + <li class="store-switcher-store-view <?php if (!($block->isStoreSwitchEnabled() && + !$block->isStoreSelected($store))): ?>disabled<?php endif; ?> <?php + if ($block->isStoreSelected($store)):?>current<?php endif; ?>"> + <?php if ($block->isStoreSwitchEnabled() && ! $block->isStoreSelected($store)): ?> + <a data-role="store-view-id" + data-value="<?= $block->escapeHtmlAttr($store->getId()) ?>" href="#"> + <?= $block->escapeHtml($store->getName()) ?> </a> <?php else: ?> - <span><?= $block->escapeHtml($group->getName()) ?></span> + <span><?= $block->escapeHtml($store->getName()) ?></span> <?php endif; ?> </li> - <?php endif; ?> - <li class="store-switcher-store-view <?php if (!($block->isStoreSwitchEnabled() && - !$block->isStoreSelected($store))): ?>disabled<?php endif; ?> <?php -if ($block->isStoreSelected($store)):?>current<?php endif; ?>"> - <?php if ($block->isStoreSwitchEnabled() && ! $block->isStoreSelected($store)): ?> - <a data-role="store-view-id" - data-value="<?= $block->escapeHtmlAttr($store->getId()) ?>" href="#"> - <?= $block->escapeHtml($store->getName()) ?> - </a> - <?php else: ?> - <span><?= $block->escapeHtml($store->getName()) ?></span> - <?php endif; ?> - </li> + <?php endforeach; ?> <?php endforeach; ?> <?php endforeach; ?> - <?php endforeach; ?> - <?php if ($block->getShowManageStoresLink() && - $block->getAuthorization()->isAllowed('Magento_Backend::store')): ?> - <li class="dropdown-toolbar"> - <a href="<?= /* @noEscape */ $block->getUrl('*/system_store'); - ?>"><?= $block->escapeHtml(__('Stores Configuration')) ?></a> - </li> - <?php endif; ?> - </ul> + <?php if ($block->getShowManageStoresLink() && + $block->getAuthorization()->isAllowed('Magento_Backend::store')): ?> + <li class="dropdown-toolbar"> + <a href="<?= /* @noEscape */ $block->getUrl('*/system_store'); + ?>"><?= $block->escapeHtml(__('Stores Configuration')) ?></a> + </li> + <?php endif; ?> + </ul> + </div> + <?= $block->getHintHtml() ?> </div> - <?= $block->getHintHtml() ?> -</div> - - <?php - $useConfirm = (int)$block->getUseConfirm(); - $scriptString = <<<script -require([ - 'jquery', - 'Magento_Ui/js/modal/confirm' -], function(jQuery, confirm){ - - (function($) { - var storesList = $('[data-role=stores-list]'); - storesList.on('click', '[data-value]', function(event) { - var val = $(event.target).data('value'); - var role = $(event.target).data('role'); - var switcher = $('[data-role='+role+']'); - - event.preventDefault(); - - if (!switcher.val() || val != switcher.val()) { - switcher.val(val).trigger('change'); // Set the value & trigger event - } - }); - })(jQuery); - - var scopeSwitcherHandler; - function switchScope(obj) { - var switcher = jQuery(obj); - var scopeId = switcher.val(); - var scopeParams = ''; - if (scopeId) { - scopeParams = switcher.data('param') + '/' + scopeId + '/'; - } - - if (obj.switchParams) { - scopeParams += obj.switchParams; - } - - if ((typeof scopeSwitcherHandler) != 'undefined') { - var switcherParams = { - scopeId: scopeId, - scopeParams: scopeParams, - useConfirm: {$useConfirm} - }; - scopeSwitcherHandler(switcherParams); - } else { -script; - if ($block->getUseConfirm()) { - $scriptString .= ' - confirm({ - content: "' . $block->escapeJs(__( - 'Please confirm scope switching. All data that hasn\'t been saved will be lost.' - )) . '", - actions: { - confirm: function() { - reload(); - }, - cancel: function() { - obj.value = \'' . $block->escapeJs($block->getStoreId()) . '\'; - } + <script type="text/x-magento-init"> + { + "*": { + "Magento_Backend/js/store-switcher": { + "useConfirm": <?= /* @noEscape */ (int)$block->getUseConfirm(); ?>, + "isUsingIframe": <?= /* @noEscape */ (int)$block->isUsingIframe(); ?>, + "switchUrl": "<?= $block->escapeUrl($block->getSwitchUrl()); ?>", + "storeId": <?= /* @noEscape */ (int)$block->getStoreId(); ?> } - }); -'; - } else { - $scriptString .= 'reload();'; - } - $scriptString .= ' - } - - function reload() { - '; - if (!$block->isUsingIframe()) { - $scriptString .= ' - var url = \'' . $block->escapeJs($block->getSwitchUrl()) . '\' + scopeParams; - setLocation(url); -'; - } else { - $scriptString .= <<<script - jQuery('#preview_selected_store').val(scopeId); - jQuery('#preview_form').submit(); - - jQuery('.store-switcher .dropdown-menu li a').each(function() { - var $this = jQuery(this); - - if ($this.data('role') === 'store-view-id' && $this.data('value') == scopeId) { - jQuery('#store-change-button').html($this.text()); - } - }); - - jQuery('#store-change-button').click(); -script; - } - $scriptString .= <<<script + } } - } - - window.scopeSwitcherHandler = scopeSwitcherHandler; - window.switchScope = switchScope; - -}); -script; - ?> - <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?> + </script> <?php endif; ?> diff --git a/app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml b/app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml index 6e94770c6e408..01a8d54db308a 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml @@ -4,7 +4,15 @@ * See COPYING.txt for license details. */ -/** @var $block \Magento\Backend\Block\GlobalSearch */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound + +use Magento\Backend\Block\GlobalSearch; +use Magento\Framework\Json\Helper\Data; + +/** @var $block GlobalSearch */ +/** @var Data $helper */ +$helper = $this->helper(Data::class); + ?> <div class="search-global" data-mage-init='{"globalSearch": {}}'> <form action="#" id="form-search"> @@ -15,9 +23,7 @@ class="search-global-input" id="search-global" name="query" - <?php //phpcs:disable ?> - data-mage-init='<?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($block->getWidgetInitOptions()) ?>'> - <?php //phpcs:enable ?> + data-mage-init='<?= /* @noEscape */ $helper->jsonEncode($block->getWidgetInitOptions()) ?>'> <button type="submit" class="search-global-action" diff --git a/app/code/Magento/Backend/view/adminhtml/web/js/store-switcher.js b/app/code/Magento/Backend/view/adminhtml/web/js/store-switcher.js new file mode 100644 index 0000000000000..2f48000c0d1af --- /dev/null +++ b/app/code/Magento/Backend/view/adminhtml/web/js/store-switcher.js @@ -0,0 +1,127 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery' +], function ($) { + 'use strict'; + + /** + * @param {Object} storeSwitchConfig + */ + return function (storeSwitchConfig) { + var scopeSwitcherHandler; + + (function () { + var storesList = $('[data-role=stores-list]'); + + storesList.on('click', '[data-value]', function (event) { + var val = $(event.target).data('value'), + role = $(event.target).data('role'), + switcher = $('[data-role=' + role + ']'); + + event.preventDefault(); + + if (!switcher.val() || val !== switcher.val()) { + + /* Set the value & trigger event */ + switcher.val(val).trigger('change'); + } + }); + })($); + + /** + * Switch store scope + * + * @param {Object} obj + * @return void + */ + function switchScope(obj) { + var switcher = $(obj), + scopeId = switcher.val(), + scopeParams = '', + switcherParams = {}; + + if (scopeId) { + scopeParams = switcher.data('param') + '/' + scopeId + '/'; + } + + if (obj.switchParams) { + scopeParams += obj.switchParams; + } + + /** + * Reload function for switcher + */ + function reload() { + var url; + + if (!storeSwitchConfig.isUsingIframe) { + + if (storeSwitchConfig.switchUrl && storeSwitchConfig.switchUrl.length > 0) { + url = storeSwitchConfig.switchUrl + scopeParams; + + /* eslint-disable no-undef */ + setLocation(url); + } + + } else { + $('#preview_selected_store').val(scopeId); + $('#preview_form').submit(); + + $('.store-switcher .dropdown-menu li a').each(function () { + var $this = $(this); + + if ($this.data('role') === 'store-view-id' && $this.data('value') === scopeId) { + $('#store-change-button').html($this.text()); + } + }); + + $('#store-change-button').click(); + } + } + + if (typeof scopeSwitcherHandler !== 'undefined') { + switcherParams = { + scopeId: scopeId, + scopeParams: scopeParams, + useConfirm: storeSwitchConfig.useConfirm + }; + + scopeSwitcherHandler(switcherParams); + } else if (storeSwitchConfig.useConfirm) { + require([ + 'Magento_Ui/js/modal/confirm', + 'mage/translate' + ], function (confirm, $t) { + confirm({ + content: $t('Please confirm scope switching. All data that hasn\'t been saved will be lost.'), + actions: { + + /** + * Confirm action + */ + confirm: function () { + reload(); + }, + + /** + * Cancel action + */ + cancel: function () { + obj.value = storeSwitchConfig.storeId ? storeSwitchConfig.storeId : ''; + } + } + }); + }); + } else { + reload(); + } + } + + window.scopeSwitcherHandler = scopeSwitcherHandler; + window.switchScope = switchScope; + }; +}); diff --git a/app/code/Magento/Backup/Model/Fs/Collection.php b/app/code/Magento/Backup/Model/Fs/Collection.php index 41a497495f687..263bcdf17400c 100644 --- a/app/code/Magento/Backup/Model/Fs/Collection.php +++ b/app/code/Magento/Backup/Model/Fs/Collection.php @@ -40,6 +40,10 @@ class Collection extends \Magento\Framework\Data\Collection\Filesystem */ protected $_backup = null; + /** + * @var \Magento\Framework\Filesystem + */ + private $_filesystem; /** * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory * @param \Magento\Backup\Helper\Data $backupData diff --git a/app/code/Magento/Backup/README.md b/app/code/Magento/Backup/README.md index e1167bc4f2429..4d5f0941dd459 100644 --- a/app/code/Magento/Backup/README.md +++ b/app/code/Magento/Backup/README.md @@ -4,25 +4,25 @@ The Magento_Backup module allows administrators to perform backups and rollbacks The Magento_Backup module does not affect the storefront. -For more information about this module, see [Magento Backups](https://docs.magento.com/m2/ce/user_guide/system/backups.html) +For more information about this module, see [Magento Backups](https://docs.magento.com/user-guide/system/backups.html) ## Extensibility -Extension developers can interact with the Magento_Backup module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_Backup module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Backup module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Backup module. ### Layouts -This module introduces the following layouts and layout handles in the `view/adminhtml/layout` directory: +This module introduces the following layouts and layout handles in the `view/adminhtml/layout` directory: `backup_index_block` `backup_index_disabled` `backup_index_grid` `backup_index_index` -For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). +For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/Backup/Test/Mftf/Data/BackupConfigData.xml b/app/code/Magento/Backup/Test/Mftf/Data/BackupConfigData.xml new file mode 100644 index 0000000000000..45f8f3a6ddab8 --- /dev/null +++ b/app/code/Magento/Backup/Test/Mftf/Data/BackupConfigData.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="EnableBackupFunctionality"> + <data key="path">system/backup/functionality_enabled</data> + <data key="value">1</data> + </entity> + <entity name="DisableBackupFunctionality"> + <!-- Magento default value --> + <data key="path">system/backup/functionality_enabled</data> + <data key="value">0</data> + </entity> +</entities> \ No newline at end of file diff --git a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml index 6db3aa7cbded9..7319069c94589 100644 --- a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml +++ b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml @@ -17,10 +17,13 @@ <severity value="CRITICAL"/> <testCaseId value="MAGETWO-94176"/> <group value="backup"/> - <skip> - <issueId value="MC-5807"/> - </skip> </annotations> + <before> + <magentoCLI command="config:set {{EnableBackupFunctionality.path}} {{EnableBackupFunctionality.value}}" stepKey="setEnableBackup"/> + </before> + <after> + <magentoCLI command="config:set {{DisableBackupFunctionality.path}} {{DisableBackupFunctionality.value}}" stepKey="setDisableBackup"/> + </after> <!--Login to admin area--> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php index 635811e3d0f81..8f89910558c97 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php @@ -218,7 +218,7 @@ public function getOptionHtml(Option $option) { $optionBlock = $this->getChildBlock($option->getType()); if (!$optionBlock) { - return __('There is no defined renderer for "%1" option type.', $option->getType()); + return __('There is no defined renderer for "%1" option type.', $this->escapeHtml($option->getType())); } return $optionBlock->setOption($option)->toHtml(); } @@ -407,15 +407,18 @@ private function processOptions(string $optionId, array $options, DataObject $pr { $preConfiguredQtys = $preConfiguredValues->getData("bundle_option_qty/${optionId}") ?? []; $selections = $options[$optionId]['selections']; - array_walk($selections, function (&$selection, $selectionId) use ($preConfiguredQtys) { - if (is_array($preConfiguredQtys) && isset($preConfiguredQtys[$selectionId])) { - $selection['qty'] = $preConfiguredQtys[$selectionId]; - } else { - if ((int)$preConfiguredQtys > 0) { - $selection['qty'] = $preConfiguredQtys; + array_walk( + $selections, + function (&$selection, $selectionId) use ($preConfiguredQtys) { + if (is_array($preConfiguredQtys) && isset($preConfiguredQtys[$selectionId])) { + $selection['qty'] = $preConfiguredQtys[$selectionId]; + } else { + if ((int)$preConfiguredQtys > 0) { + $selection['qty'] = $preConfiguredQtys; + } } } - }); + ); $options[$optionId]['selections'] = $selections; return $options; diff --git a/app/code/Magento/Bundle/Model/LinkManagement.php b/app/code/Magento/Bundle/Model/LinkManagement.php index 43a6532a16b2d..9bc056a3e9a87 100644 --- a/app/code/Magento/Bundle/Model/LinkManagement.php +++ b/app/code/Magento/Bundle/Model/LinkManagement.php @@ -19,9 +19,9 @@ use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Product; use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Exception\CouldNotSaveException; use Magento\Framework\Exception\InputException; -use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Store\Model\StoreManagerInterface; @@ -173,12 +173,11 @@ public function saveChild( ) ); } - $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField(); - $selectionModel = $this->mapProductLinkToSelectionModel( + $selectionModel = $this->mapProductLinkToBundleSelectionModel( $selectionModel, $linkedProduct, - $linkProductModel->getId(), - $product->getData($linkField) + $product, + (int)$linkProductModel->getId() ); try { @@ -202,6 +201,7 @@ public function saveChild( * * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) + * @deprecated use mapProductLinkToBundleSelectionModel */ protected function mapProductLinkToSelectionModel( Selection $selectionModel, @@ -239,6 +239,55 @@ protected function mapProductLinkToSelectionModel( return $selectionModel; } + /** + * Fill selection model with product link data. + * + * @param Selection $selectionModel + * @param LinkInterface $productLink + * @param ProductInterface $parentProduct + * @param int $linkedProductId + * @param string $linkField + * @return Selection + * @throws NoSuchEntityException + */ + private function mapProductLinkToBundleSelectionModel( + Selection $selectionModel, + LinkInterface $productLink, + ProductInterface $parentProduct, + int $linkedProductId + ): Selection { + $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField(); + $selectionModel->setProductId($linkedProductId); + $selectionModel->setParentProductId($parentProduct->getData($linkField)); + if ($productLink->getSelectionId() !== null) { + $selectionModel->setSelectionId($productLink->getSelectionId()); + } + if ($productLink->getOptionId() !== null) { + $selectionModel->setOptionId($productLink->getOptionId()); + } + if ($productLink->getPosition() !== null) { + $selectionModel->setPosition($productLink->getPosition()); + } + if ($productLink->getQty() !== null) { + $selectionModel->setSelectionQty($productLink->getQty()); + } + if ($productLink->getPriceType() !== null) { + $selectionModel->setSelectionPriceType($productLink->getPriceType()); + } + if ($productLink->getPrice() !== null) { + $selectionModel->setSelectionPriceValue($productLink->getPrice()); + } + if ($productLink->getCanChangeQuantity() !== null) { + $selectionModel->setSelectionCanChangeQty($productLink->getCanChangeQuantity()); + } + if ($productLink->getIsDefault() !== null) { + $selectionModel->setIsDefault($productLink->getIsDefault()); + } + $selectionModel->setWebsiteId((int)$this->storeManager->getStore($parentProduct->getStoreId())->getWebsiteId()); + + return $selectionModel; + } + /** * @inheritDoc * @@ -302,12 +351,13 @@ public function addChild( } $selectionModel = $this->bundleSelection->create(); - $selectionModel = $this->mapProductLinkToSelectionModel( + $selectionModel = $this->mapProductLinkToBundleSelectionModel( $selectionModel, $linkedProduct, - $linkProductModel->getEntityId(), - $product->getData($linkField) + $product, + (int)$linkProductModel->getEntityId() ); + $selectionModel->setOptionId($optionId); try { @@ -317,7 +367,7 @@ public function addChild( throw new CouldNotSaveException(__('Could not save child: "%1"', $e->getMessage()), $e); } - return $selectionModel->getId(); + return (int)$selectionModel->getId(); } /** diff --git a/app/code/Magento/Bundle/Model/Option/SaveAction.php b/app/code/Magento/Bundle/Model/Option/SaveAction.php index 00c5b05d532f5..42349f2f2cc2e 100644 --- a/app/code/Magento/Bundle/Model/Option/SaveAction.php +++ b/app/code/Magento/Bundle/Model/Option/SaveAction.php @@ -7,13 +7,17 @@ namespace Magento\Bundle\Model\Option; +use Magento\Bundle\Api\Data\LinkInterface; use Magento\Bundle\Api\Data\OptionInterface; use Magento\Bundle\Model\ResourceModel\Option; use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Exception\CouldNotSaveException; use Magento\Bundle\Model\Product\Type; use Magento\Bundle\Api\ProductLinkManagementInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Store\Model\StoreManagerInterface; /** * Encapsulates logic for saving a bundle option, including coalescing the parent product's data. @@ -45,12 +49,14 @@ class SaveAction * @param MetadataPool $metadataPool * @param Type $type * @param ProductLinkManagementInterface $linkManagement + * @param StoreManagerInterface|null $storeManager */ public function __construct( Option $optionResource, MetadataPool $metadataPool, Type $type, - ProductLinkManagementInterface $linkManagement + ProductLinkManagementInterface $linkManagement, + ?StoreManagerInterface $storeManager = null ) { $this->optionResource = $optionResource; $this->metadataPool = $metadataPool; @@ -69,7 +75,7 @@ public function __construct( */ public function save(ProductInterface $bundleProduct, OptionInterface $option) { - $metadata = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class); + $metadata = $this->metadataPool->getMetadata(ProductInterface::class); $option->setStoreId($bundleProduct->getStoreId()); $parentId = $bundleProduct->getData($metadata->getLinkField()); @@ -108,7 +114,7 @@ public function save(ProductInterface $bundleProduct, OptionInterface $option) throw new CouldNotSaveException(__("The option couldn't be saved."), $e); } - /** @var \Magento\Bundle\Api\Data\LinkInterface $linkedProduct */ + /** @var LinkInterface $linkedProduct */ foreach ($linksToAdd as $linkedProduct) { $this->linkManagement->addChild($bundleProduct, $option->getOptionId(), $linkedProduct); } @@ -121,8 +127,8 @@ public function save(ProductInterface $bundleProduct, OptionInterface $option) /** * Update option selections * - * @param \Magento\Catalog\Api\Data\ProductInterface $product - * @param \Magento\Bundle\Api\Data\OptionInterface $option + * @param ProductInterface $product + * @param OptionInterface $option * @return void */ private function updateOptionSelection(ProductInterface $product, OptionInterface $option) @@ -141,7 +147,7 @@ private function updateOptionSelection(ProductInterface $product, OptionInterfac $linksToUpdate[] = $productLink; } } - /** @var \Magento\Bundle\Api\Data\LinkInterface[] $linksToDelete */ + /** @var LinkInterface[] $linksToDelete */ $linksToDelete = $this->compareLinks($existingLinks, $linksToUpdate); } foreach ($linksToUpdate as $linkedProduct) { @@ -162,8 +168,8 @@ private function updateOptionSelection(ProductInterface $product, OptionInterfac /** * Compute the difference between given arrays. * - * @param \Magento\Bundle\Api\Data\LinkInterface[] $firstArray - * @param \Magento\Bundle\Api\Data\LinkInterface[] $secondArray + * @param LinkInterface[] $firstArray + * @param LinkInterface[] $secondArray * * @return array */ diff --git a/app/code/Magento/Bundle/Model/Product/BundleOptionDataProvider.php b/app/code/Magento/Bundle/Model/Product/BundleOptionDataProvider.php index f56c4228e49e5..4ac3b54b7011c 100644 --- a/app/code/Magento/Bundle/Model/Product/BundleOptionDataProvider.php +++ b/app/code/Magento/Bundle/Model/Product/BundleOptionDataProvider.php @@ -11,6 +11,7 @@ use Magento\Bundle\Model\Option; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface; +use Magento\Framework\GraphQl\Query\Uid; use Magento\Framework\Pricing\Helper\Data; use Magento\Framework\Serialize\SerializerInterface; @@ -19,6 +20,11 @@ */ class BundleOptionDataProvider { + /** + * Option type name + */ + private const OPTION_TYPE = 'bundle'; + /** * @var Data */ @@ -34,19 +40,27 @@ class BundleOptionDataProvider */ private $configuration; + /** + * @var Uid + */ + private $uidEncoder; + /** * @param Data $pricingHelper * @param SerializerInterface $serializer * @param Configuration $configuration + * @param Uid $uidEncoder */ public function __construct( Data $pricingHelper, SerializerInterface $serializer, - Configuration $configuration + Configuration $configuration, + Uid $uidEncoder ) { $this->pricingHelper = $pricingHelper; $this->serializer = $serializer; $this->configuration = $configuration; + $this->uidEncoder = $uidEncoder; } /** @@ -100,8 +114,15 @@ private function buildBundleOptions(array $bundleOptions, ItemInterface $item): continue; } + $optionDetails = [ + self::OPTION_TYPE, + $bundleOption->getOptionId() + ]; + $uidString = implode('/', $optionDetails); + $options[] = [ 'id' => $bundleOption->getId(), + 'uid' => $this->uidEncoder->encode($uidString), 'label' => $bundleOption->getTitle(), 'type' => $bundleOption->getType(), 'values' => $this->buildBundleOptionValues($bundleOption->getSelections(), $item), @@ -130,10 +151,19 @@ private function buildBundleOptionValues(array $selections, ItemInterface $item) continue; } + $optionValueDetails = [ + self::OPTION_TYPE, + $selection->getOptionId(), + $selection->getSelectionId(), + (int) $selection->getSelectionQty() + ]; + $uidString = implode('/', $optionValueDetails); + $selectionPrice = $this->configuration->getSelectionFinalPrice($item, $selection); $values[] = [ - 'label' => $selection->getName(), 'id' => $selection->getSelectionId(), + 'uid' => $this->uidEncoder->encode($uidString), + 'label' => $selection->getName(), 'quantity' => $qty, 'price' => $this->pricingHelper->currency($selectionPrice, false, false), ]; diff --git a/app/code/Magento/Bundle/Model/Product/CheckOptionLinkIfExist.php b/app/code/Magento/Bundle/Model/Product/CheckOptionLinkIfExist.php new file mode 100644 index 0000000000000..be49cd209faae --- /dev/null +++ b/app/code/Magento/Bundle/Model/Product/CheckOptionLinkIfExist.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model\Product; + +use Magento\Bundle\Api\Data\OptionInterface; +use Magento\Bundle\Api\ProductOptionRepositoryInterface as OptionRepository; +use Magento\Bundle\Model\Link; +use Magento\Framework\Exception\InputException; +use Magento\Framework\Exception\NoSuchEntityException; + +/** + * Check bundle product option link if exist + */ +class CheckOptionLinkIfExist +{ + /** + * @var OptionRepository + */ + private $optionRepository; + + /** + * @param OptionRepository $optionRepository + */ + public function __construct(OptionRepository $optionRepository) + { + $this->optionRepository = $optionRepository; + } + + /** + * Check if link is already exist in bundle product option + * + * @param string $sku + * @param OptionInterface $optionToDelete + * @param Link $link + * @return bool + * @throws InputException + * @throws NoSuchEntityException + */ + public function execute(string $sku, OptionInterface $optionToDelete, Link $link): bool + { + $isLinkExist = true; + $availableOptions = $this->getAvailableOptionsAfterDelete($sku, $optionToDelete); + $optionLinkIds = $this->getLinkIds($availableOptions); + if (in_array($link->getEntityId(), $optionLinkIds)) { + $isLinkExist = false; + } + return $isLinkExist; + } + + /** + * Retrieve bundle product options after delete option + * + * @param string $sku + * @param OptionInterface $optionToDelete + * @return array + * @throws InputException + * @throws NoSuchEntityException + */ + private function getAvailableOptionsAfterDelete(string $sku, OptionInterface $optionToDelete): array + { + $bundleProductOptions = $this->optionRepository->getList($sku); + $options = []; + foreach ($bundleProductOptions as $bundleOption) { + if ($bundleOption->getOptionId() == $optionToDelete->getOptionId()) { + continue; + } + $options[] = $bundleOption; + } + return $options; + } + + /** + * Retrieve bundle product link options + * + * @param array $options + * @return array + */ + private function getLinkIds(array $options): array + { + $ids = []; + foreach ($options as $option) { + $links = $option->getProductLinks(); + if (!empty($links)) { + foreach ($links as $link) { + $ids[] = $link->getEntityId(); + } + } + } + return $ids; + } +} diff --git a/app/code/Magento/Bundle/Model/Product/LinksList.php b/app/code/Magento/Bundle/Model/Product/LinksList.php index c35d475e04d84..eba9886a895b7 100644 --- a/app/code/Magento/Bundle/Model/Product/LinksList.php +++ b/app/code/Magento/Bundle/Model/Product/LinksList.php @@ -4,12 +4,22 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Bundle\Model\Product; +use Magento\Bundle\Api\Data\LinkInterface; +use Magento\Bundle\Api\Data\LinkInterfaceFactory; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Framework\Api\DataObjectHelper; + +/** + * Retrieve bundle product links service. + */ class LinksList { /** - * @var \Magento\Bundle\Api\Data\LinkInterfaceFactory + * @var LinkInterfaceFactory */ protected $linkFactory; @@ -19,19 +29,19 @@ class LinksList protected $type; /** - * @var \Magento\Framework\Api\DataObjectHelper + * @var DataObjectHelper */ protected $dataObjectHelper; /** - * @param \Magento\Bundle\Api\Data\LinkInterfaceFactory $linkFactory + * @param LinkInterfaceFactory $linkFactory * @param Type $type - * @param \Magento\Framework\Api\DataObjectHelper $dataObjectHelper + * @param DataObjectHelper $dataObjectHelper */ public function __construct( - \Magento\Bundle\Api\Data\LinkInterfaceFactory $linkFactory, - \Magento\Bundle\Model\Product\Type $type, - \Magento\Framework\Api\DataObjectHelper $dataObjectHelper + LinkInterfaceFactory $linkFactory, + Type $type, + DataObjectHelper $dataObjectHelper ) { $this->linkFactory = $linkFactory; $this->type = $type; @@ -39,32 +49,32 @@ public function __construct( } /** - * Bundle Product Items Data + * Get Bundle Product Items Data. * - * @param \Magento\Catalog\Api\Data\ProductInterface $product + * @param ProductInterface $product * @param int $optionId - * @return \Magento\Bundle\Api\Data\LinkInterface[] + * @return LinkInterface[] */ - public function getItems(\Magento\Catalog\Api\Data\ProductInterface $product, $optionId) + public function getItems(ProductInterface $product, $optionId) { $selectionCollection = $this->type->getSelectionsCollection([$optionId], $product); $productLinks = []; /** @var \Magento\Catalog\Model\Product $selection */ foreach ($selectionCollection as $selection) { - $bundledProductPrice = $selection->getSelectionPriceValue(); - if ($bundledProductPrice <= 0) { - $bundledProductPrice = $selection->getPrice(); - } - $selectionPriceType = $product->getPriceType() ? $selection->getSelectionPriceType() : null; - $selectionPrice = $bundledProductPrice ? $bundledProductPrice : null; + $priceType = $product->getPriceType(); + $selectionPriceType = $priceType ? $selection->getSelectionPriceType() : null; + $selectionPriceValue = $selection->getSelectionPriceValue() < 0 + ? $selection->getPrice() + : $selection->getSelectionPriceValue(); + $selectionPrice = $priceType ? $selectionPriceValue : $selection->getPrice(); - /** @var \Magento\Bundle\Api\Data\LinkInterface $productLink */ + /** @var LinkInterface $productLink */ $productLink = $this->linkFactory->create(); $this->dataObjectHelper->populateWithArray( $productLink, $selection->getData(), - \Magento\Bundle\Api\Data\LinkInterface::class + LinkInterface::class ); $productLink->setIsDefault($selection->getIsDefault()) ->setId($selection->getSelectionId()) diff --git a/app/code/Magento/Bundle/Model/Product/SaveHandler.php b/app/code/Magento/Bundle/Model/Product/SaveHandler.php index 8c2727a71aac1..e536b8961ebb9 100644 --- a/app/code/Magento/Bundle/Model/Product/SaveHandler.php +++ b/app/code/Magento/Bundle/Model/Product/SaveHandler.php @@ -8,12 +8,16 @@ namespace Magento\Bundle\Model\Product; use Magento\Bundle\Api\Data\OptionInterface; +use Magento\Bundle\Api\ProductLinkManagementInterface; +use Magento\Bundle\Api\ProductOptionRepositoryInterface as OptionRepository; use Magento\Bundle\Model\Option\SaveAction; +use Magento\Bundle\Model\ProductRelationsProcessorComposite; use Magento\Catalog\Api\Data\ProductInterface; -use Magento\Bundle\Api\ProductOptionRepositoryInterface as OptionRepository; -use Magento\Bundle\Api\ProductLinkManagementInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\EntityManager\Operation\ExtensionInterface; +use Magento\Framework\Exception\InputException; +use Magento\Framework\Exception\NoSuchEntityException; /** * Bundle product save handler @@ -40,22 +44,40 @@ class SaveHandler implements ExtensionInterface */ private $metadataPool; + /** + * @var CheckOptionLinkIfExist + */ + private $checkOptionLinkIfExist; + + /** + * @var ProductRelationsProcessorComposite + */ + private $productRelationsProcessorComposite; + /** * @param OptionRepository $optionRepository * @param ProductLinkManagementInterface $productLinkManagement * @param SaveAction $optionSave * @param MetadataPool $metadataPool + * @param CheckOptionLinkIfExist|null $checkOptionLinkIfExist + * @param ProductRelationsProcessorComposite|null $productRelationsProcessorComposite */ public function __construct( OptionRepository $optionRepository, ProductLinkManagementInterface $productLinkManagement, SaveAction $optionSave, - MetadataPool $metadataPool + MetadataPool $metadataPool, + ?CheckOptionLinkIfExist $checkOptionLinkIfExist = null, + ?ProductRelationsProcessorComposite $productRelationsProcessorComposite = null ) { $this->optionRepository = $optionRepository; $this->productLinkManagement = $productLinkManagement; $this->optionSave = $optionSave; $this->metadataPool = $metadataPool; + $this->checkOptionLinkIfExist = $checkOptionLinkIfExist + ?? ObjectManager::getInstance()->get(CheckOptionLinkIfExist::class); + $this->productRelationsProcessorComposite = $productRelationsProcessorComposite + ?? ObjectManager::getInstance()->get(ProductRelationsProcessorComposite::class); } /** @@ -95,6 +117,12 @@ public function execute($entity, $arguments = []) $entity->setCopyFromView(false); } + $this->productRelationsProcessorComposite->process( + $entity, + $existingBundleProductOptions, + $bundleProductOptions + ); + return $entity; } @@ -105,13 +133,18 @@ public function execute($entity, $arguments = []) * @param OptionInterface $option * * @return void + * @throws InputException + * @throws NoSuchEntityException */ protected function removeOptionLinks($entitySku, $option) { $links = $option->getProductLinks(); if (!empty($links)) { foreach ($links as $link) { - $this->productLinkManagement->removeChild($entitySku, $option->getId(), $link->getSku()); + $linkCanBeDeleted = $this->checkOptionLinkIfExist->execute($entitySku, $option, $link); + if ($linkCanBeDeleted) { + $this->productLinkManagement->removeChild($entitySku, $option->getId(), $link->getSku()); + } } } } diff --git a/app/code/Magento/Bundle/Model/Product/SingleChoiceProvider.php b/app/code/Magento/Bundle/Model/Product/SingleChoiceProvider.php new file mode 100644 index 0000000000000..3141252dafef9 --- /dev/null +++ b/app/code/Magento/Bundle/Model/Product/SingleChoiceProvider.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model\Product; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Type as BundleType; + +/** + * Service to check is bundle product has single choice (no customization possible) + */ +class SingleChoiceProvider +{ + /** + * Single choice availability + * + * @param Product $product + * @return bool + */ + public function isSingleChoiceAvailable(Product $product) : bool + { + $result = false; + if ($product->getTypeId() === BundleType::TYPE_BUNDLE) { + $typeInstance = $product->getTypeInstance(); + $typeInstance->setStoreFilter($product->getStoreId(), $product); + + if ($typeInstance->hasRequiredOptions($product)) { + $options = $typeInstance->getOptions($product); + $isNoCustomizations = true; + foreach ($options as $option) { + $optionId = $option->getId(); + $required = $option->getRequired(); + if ($isNoCustomizations && (int) $required === 1) { + $selectionsCollection = $typeInstance->getSelectionsCollection( + [$optionId], + $product + ); + $selections = $selectionsCollection->exportToArray(); + if (count($selections) > 1) { + foreach ($selections as $selection) { + if ($isNoCustomizations) { + $isNoCustomizations = (int)$selection['is_default'] === 1 + && (int)$selection['selection_can_change_qty'] === 0; + } else { + break; + } + } + } + } else { + $isNoCustomizations = false; + break; + } + } + + $result = $isNoCustomizations; + } + } + return $result; + } +} diff --git a/app/code/Magento/Bundle/Model/ProductRelationsProcessorComposite.php b/app/code/Magento/Bundle/Model/ProductRelationsProcessorComposite.php new file mode 100644 index 0000000000000..b1035b0fb0d4a --- /dev/null +++ b/app/code/Magento/Bundle/Model/ProductRelationsProcessorComposite.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model; + +use Magento\Catalog\Api\Data\ProductInterface; + +/** + * Composite processor to handle bundle product relations. + */ +class ProductRelationsProcessorComposite implements ProductRelationsProcessorInterface +{ + /** + * @var ProductRelationsProcessorInterface[] + */ + private $processors; + + /** + * @param ProductRelationsProcessorInterface[] $processors + */ + public function __construct(array $processors = []) + { + foreach ($processors as $processor) { + if (!$processor instanceof ProductRelationsProcessorInterface) { + throw new \InvalidArgumentException( + __('Product relations processor must implement %1.', ProductRelationsProcessorInterface::class) + ); + } + } + + $this->processors = $processors; + } + + /** + * @inheritDoc + */ + public function process( + ProductInterface $product, + array $existingProductOptions, + array $expectedProductOptions + ): void { + foreach ($this->processors as $processor) { + $processor->process($product, $existingProductOptions, $expectedProductOptions); + } + } +} diff --git a/app/code/Magento/Bundle/Model/ProductRelationsProcessorInterface.php b/app/code/Magento/Bundle/Model/ProductRelationsProcessorInterface.php new file mode 100644 index 0000000000000..68bb6531652e4 --- /dev/null +++ b/app/code/Magento/Bundle/Model/ProductRelationsProcessorInterface.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model; + +/** + * Processor to handle bundle product relations. + */ +interface ProductRelationsProcessorInterface +{ + /** + * Process bundle product relations. + * + * @param \Magento\Catalog\Api\Data\ProductInterface $product + * @param array $existingProductOptions + * @param array $expectedProductOptions + * @return void + */ + public function process( + \Magento\Catalog\Api\Data\ProductInterface $product, + array $existingProductOptions, + array $expectedProductOptions + ): void; +} diff --git a/app/code/Magento/Bundle/Model/Quote/Item/Option.php b/app/code/Magento/Bundle/Model/Quote/Item/Option.php new file mode 100644 index 0000000000000..2d8ad3b0d57a4 --- /dev/null +++ b/app/code/Magento/Bundle/Model/Quote/Item/Option.php @@ -0,0 +1,109 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model\Quote\Item; + +use Magento\Bundle\Model\Product\Price; +use Magento\Bundle\Model\Product\Type; +use Magento\Catalog\Model\Product; +use Magento\Framework\Serialize\Serializer\Json; + +/** + * Bundle product options model + */ +class Option +{ + /** + * @var Json + */ + private $serializer; + + /** + * @param Json $serializer + */ + public function __construct( + Json $serializer + ) { + $this->serializer = $serializer; + } + + /** + * Get selection options for provided bundle product + * + * @param Product $product + * @return array + */ + public function getSelectionOptions(Product $product): array + { + $options = []; + $bundleOptionIds = $this->getOptionValueAsArray($product, 'bundle_option_ids'); + if ($bundleOptionIds) { + /** @var Type $typeInstance */ + $typeInstance = $product->getTypeInstance(); + $optionsCollection = $typeInstance->getOptionsByIds($bundleOptionIds, $product); + $selectionIds = $this->getOptionValueAsArray($product, 'bundle_selection_ids'); + + if ($selectionIds) { + $selectionsCollection = $typeInstance->getSelectionsByIds($selectionIds, $product); + $optionsCollection->appendSelections($selectionsCollection, true); + + foreach ($selectionsCollection as $selection) { + $selectionId = $selection->getSelectionId(); + $options[$selectionId][] = $this->getBundleSelectionAttributes($product, $selection); + } + } + } + + return $options; + } + + /** + * Get selection attributes for provided selection + * + * @param Product $product + * @param Product $selection + * @return array + */ + private function getBundleSelectionAttributes(Product $product, Product $selection): array + { + $selectionId = $selection->getSelectionId(); + /** @var \Magento\Bundle\Model\Option $bundleOption */ + $bundleOption = $selection->getOption(); + /** @var Price $priceModel */ + $priceModel = $product->getPriceModel(); + $price = $priceModel->getSelectionFinalTotalPrice($product, $selection, 0, 1); + $customOption = $product->getCustomOption('selection_qty_' . $selectionId); + $qty = (float)($customOption ? $customOption->getValue() : 0); + + return [ + 'code' => 'bundle_selection_attributes', + 'value'=> $this->serializer->serialize( + [ + 'price' => $price, + 'qty' => $qty, + 'option_label' => $bundleOption->getTitle(), + 'option_id' => $bundleOption->getId(), + ] + ) + ]; + } + + /** + * Get unserialized value of custom option + * + * @param Product $product + * @param string $code + * @return array + */ + private function getOptionValueAsArray(Product $product, string $code): array + { + $option = $product->getCustomOption($code); + return $option && $option->getValue() + ? $this->serializer->unserialize($option->getValue()) + : []; + } +} diff --git a/app/code/Magento/Bundle/Model/Quote/Item/Option/BundleSelectionAttributesComparator.php b/app/code/Magento/Bundle/Model/Quote/Item/Option/BundleSelectionAttributesComparator.php new file mode 100644 index 0000000000000..8e4a2c1f367e4 --- /dev/null +++ b/app/code/Magento/Bundle/Model/Quote/Item/Option/BundleSelectionAttributesComparator.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model\Quote\Item\Option; + +use Magento\Framework\DataObject; +use Magento\Framework\Serialize\Serializer\Json; +use Magento\Quote\Model\Quote\Item\Option\ComparatorInterface; + +/** + * Bundle quote item option comparator + */ +class BundleSelectionAttributesComparator implements ComparatorInterface +{ + /** + * @var Json + */ + private $serializer; + + /** + * @param Json $serializer + */ + public function __construct( + Json $serializer + ) { + $this->serializer = $serializer; + } + + /** + * @inheritdoc + */ + public function compare(DataObject $option1, DataObject $option2): bool + { + $value1 = $option1->getValue() ? $this->serializer->unserialize($option1->getValue()) : []; + $value2 = $option2->getValue() ? $this->serializer->unserialize($option2->getValue()) : []; + $option1Id = isset($value1['option_id']) ? (int) $value1['option_id'] : null; + $option2Id = isset($value2['option_id']) ? (int) $value2['option_id'] : null; + + return $option1Id === $option2Id; + } +} diff --git a/app/code/Magento/Bundle/Model/QuoteRecollectProcessor.php b/app/code/Magento/Bundle/Model/QuoteRecollectProcessor.php new file mode 100644 index 0000000000000..c3b69003b2258 --- /dev/null +++ b/app/code/Magento/Bundle/Model/QuoteRecollectProcessor.php @@ -0,0 +1,149 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Framework\Reflection\TypeCaster; +use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; + +/** + * Recollect quota after handle product relations. + */ +class QuoteRecollectProcessor implements ProductRelationsProcessorInterface +{ + /** + * @var TypeCaster + */ + private $typeCaster; + + /** + * @var QuoteResource + */ + private $quoteResource; + + /** + * @var array + */ + private $comparisonFieldsTypeMapper; + + /** + * @param TypeCaster $typeCaster + * @param QuoteResource $quoteResource + * @param array $comparisonFieldsTypeMapper + */ + public function __construct( + TypeCaster $typeCaster, + QuoteResource $quoteResource, + array $comparisonFieldsTypeMapper = [] + ) { + $this->typeCaster = $typeCaster; + $this->quoteResource = $quoteResource; + $this->comparisonFieldsTypeMapper = $comparisonFieldsTypeMapper; + } + + /** + * Mark quotes to recollect if product options or links are changed. + * + * @param ProductInterface $product + * @param array $existingProductOptions + * @param array $expectedProductOptions + * @return void + */ + public function process( + ProductInterface $product, + array $existingProductOptions, + array $expectedProductOptions + ): void { + if (empty($existingProductOptions)) { + return; + } + + if ($this->isProductOptionsChanged($existingProductOptions, $expectedProductOptions) + || $this->isProductLinksChanged($existingProductOptions, $expectedProductOptions) + ) { + $this->quoteResource->markQuotesRecollect($product->getId()); + } + } + + /** + * Check product options change. + * + * @param array $existingProductOptions + * @param array $expectedProductOptions + * @return bool + */ + private function isProductOptionsChanged( + array $existingProductOptions, + array $expectedProductOptions + ): bool { + if (count($existingProductOptions) !== count($expectedProductOptions)) { + return true; + } + + $productOptionsDiff = array_udiff( + $expectedProductOptions, + $existingProductOptions, + function ($expectedProductOption, $existingProductOption) { + if ($expectedProductOption->getOptionId() === $existingProductOption->getOptionId()) { + return $expectedProductOption->getRequired() - $existingProductOption->getRequired(); + } + + return $expectedProductOption->getOptionId() - $existingProductOption->getOptionId(); + } + ); + + return (bool)count($productOptionsDiff); + } + + /** + * Check product links change. + * + * @param array $existingProductOptions + * @param array $expectedProductOptions + * @return bool + */ + private function isProductLinksChanged( + array $existingProductOptions, + array $expectedProductOptions + ): bool { + $existingProductLinks = $this->flattenProductLinksData($existingProductOptions); + $expectedProductLinks = $this->flattenProductLinksData($expectedProductOptions); + + return $existingProductLinks != $expectedProductLinks; + } + + /** + * Simplify product links data. + * + * @param array $productOptions + * @return array + */ + private function flattenProductLinksData(array $productOptions): array + { + return array_reduce($productOptions, function ($result, $productOption) { + $optionId = $productOption->getOptionId(); + $productLinks = []; + foreach ($productOption->getProductLinks() as $productLink) { + $productLinkData = $productLink->getData(); + $productLinkFilteredData = []; + foreach ($this->comparisonFieldsTypeMapper as $fieldName => $fieldType) { + if (isset($productLinkData[$fieldName])) { + $productLinkFilteredData[$fieldName] = $this->typeCaster->castValueToType( + $productLinkData[$fieldName], + $fieldType + ); + } + } + $productLinks[$productLink->getId()] = $productLinkFilteredData; + } + $result[$optionId] = $productLinks; + + return $result; + }); + } +} diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/BundleOptionStockDataSelectBuilder.php b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/BundleOptionStockDataSelectBuilder.php index 702a25ff73fb7..c322a4b26241d 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/BundleOptionStockDataSelectBuilder.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/BundleOptionStockDataSelectBuilder.php @@ -17,6 +17,16 @@ */ class BundleOptionStockDataSelectBuilder { + /** + * @var \Magento\Framework\App\ResourceConnection + */ + private $resourceConnection; + + /** + * @var \Magento\Framework\EntityManager\MetadataPool + */ + private $metadataPool; + /** * @param \Magento\Framework\App\ResourceConnection $resourceConnection * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php index 55bef4980098b..569758c107174 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php @@ -91,6 +91,21 @@ class Price implements DimensionalIndexerInterface */ private $moduleManager; + /** + * @var string + */ + private $tmpBundlePriceTable; + + /** + * @var string + */ + private $tmpBundleSelectionTable; + + /** + * @var string + */ + private $tmpBundleOptionTable; + /** * @param IndexTableStructureFactory $indexTableStructureFactory * @param TableMaintainer $tableMaintainer @@ -184,7 +199,16 @@ public function executeByDimensions(array $dimensions, \Traversable $entityIds) */ private function getBundlePriceTable() { - return $this->getTable('catalog_product_index_price_bundle_tmp'); + if ($this->tmpBundlePriceTable === null) { + $this->tmpBundlePriceTable = $this->getTable('catalog_product_index_price_bundle_temp'); + $this->getConnection()->createTemporaryTableLike( + $this->tmpBundlePriceTable, + $this->getTable('catalog_product_index_price_bundle_tmp'), + true + ); + } + + return $this->tmpBundlePriceTable; } /** @@ -194,7 +218,16 @@ private function getBundlePriceTable() */ private function getBundleSelectionTable() { - return $this->getTable('catalog_product_index_price_bundle_sel_tmp'); + if ($this->tmpBundleSelectionTable === null) { + $this->tmpBundleSelectionTable = $this->getTable('catalog_product_index_price_bundle_sel_temp'); + $this->getConnection()->createTemporaryTableLike( + $this->tmpBundleSelectionTable, + $this->getTable('catalog_product_index_price_bundle_sel_tmp'), + true + ); + } + + return $this->tmpBundleSelectionTable; } /** @@ -204,7 +237,16 @@ private function getBundleSelectionTable() */ private function getBundleOptionTable() { - return $this->getTable('catalog_product_index_price_bundle_opt_tmp'); + if ($this->tmpBundleOptionTable === null) { + $this->tmpBundleOptionTable = $this->getTable('catalog_product_index_price_bundle_opt_temp'); + $this->getConnection()->createTemporaryTableLike( + $this->tmpBundleOptionTable, + $this->getTable('catalog_product_index_price_bundle_opt_tmp'), + true + ); + } + + return $this->tmpBundleOptionTable; } /** @@ -273,6 +315,10 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity ['cwd' => $this->getTable('catalog_product_index_website')], 'pw.website_id = cwd.website_id', [] + )->joinLeft( + ['cgw' => $this->getTable('customer_group_excluded_website')], + 'cg.customer_group_id = cgw.customer_group_id AND pw.website_id = cgw.website_id', + [] ); $select->joinLeft( ['tp' => $this->getTable('catalog_product_index_tier_price')], @@ -365,6 +411,9 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity $select->where('e.entity_id IN(?)', $entityIds); } + // exclude websites that are limited for customer group + $select->where('cgw.website_id IS NULL'); + /** * Add additional external limitation */ @@ -456,6 +505,42 @@ private function getBaseBundleSelectionPriceSelect(): Select return $select; } + /** + * Get base select for bundle selection price update + * + * @return Select + * @throws \Exception + */ + private function getBaseBundleSelectionPriceUpdateSelect(): Select + { + $metadata = $this->metadataPool->getMetadata(ProductInterface::class); + $linkField = $metadata->getLinkField(); + $bundleSelectionTable = $this->getBundleSelectionTable(); + + $select = $this->getConnection()->select() + ->join( + ['i' => $this->getBundlePriceTable()], + "i.entity_id = $bundleSelectionTable.entity_id + AND i.customer_group_id = $bundleSelectionTable.customer_group_id + AND i.website_id = $bundleSelectionTable.website_id", + [] + )->join( + ['parent_product' => $this->getTable('catalog_product_entity')], + 'parent_product.entity_id = i.entity_id', + [] + )->join( + ['bo' => $this->getTable('catalog_product_bundle_option')], + "bo.parent_id = parent_product.$linkField AND bo.option_id = $bundleSelectionTable.option_id", + ['option_id'] + )->join( + ['bs' => $this->getTable('catalog_product_bundle_selection')], + "bs.option_id = bo.option_id AND bs.selection_id = $bundleSelectionTable.selection_id", + ['selection_id'] + ); + + return $select; + } + /** * Apply selections price for fixed bundles * @@ -499,7 +584,7 @@ private function applyFixedBundleSelectionPrice() ] ); - $select = $this->getBaseBundleSelectionPriceSelect(); + $select = $this->getBaseBundleSelectionPriceUpdateSelect(); $select->joinInner( ['bsp' => $this->getTable('catalog_product_bundle_selection_price')], 'bs.selection_id = bsp.selection_id AND bsp.website_id = i.website_id', @@ -678,6 +763,11 @@ private function prepareTierPriceIndex($dimensions, $entityIds) ['pw' => $this->getTable('store_website')], 'tp.website_id = 0 OR tp.website_id = pw.website_id', ['website_id'] + )->joinLeft( + // customer group website limitations + ['cgw' => $this->getTable('customer_group_excluded_website')], + 'cg.customer_group_id = cgw.customer_group_id AND pw.website_id = cgw.website_id', + [] )->where( 'pw.website_id != 0' )->where( @@ -692,6 +782,10 @@ private function prepareTierPriceIndex($dimensions, $entityIds) if (!empty($entityIds)) { $select->where('e.entity_id IN(?)', $entityIds); } + + // exclude websites that are limited for customer group + $select->where('cgw.website_id IS NULL'); + foreach ($dimensions as $dimension) { if (!isset($this->dimensionToFieldMapper[$dimension->getName()])) { throw new \LogicException( diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/StockStatusSelectBuilder.php b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/StockStatusSelectBuilder.php index a4685fc3630a4..d41f6bc0a8cef 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/StockStatusSelectBuilder.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/StockStatusSelectBuilder.php @@ -18,6 +18,20 @@ */ class StockStatusSelectBuilder { + /** + * @var \Magento\Framework\App\ResourceConnection + */ + private $resourceConnection; + + /** + * @var \Magento\Framework\EntityManager\MetadataPool + */ + private $metadataPool; + + /** + * @var \Magento\Eav\Model\Config + */ + private $eavConfig; /** * @param \Magento\Framework\App\ResourceConnection $resourceConnection diff --git a/app/code/Magento/Bundle/Model/Selection.php b/app/code/Magento/Bundle/Model/Selection.php index f8e3d05fd9809..3137f723e57c0 100644 --- a/app/code/Magento/Bundle/Model/Selection.php +++ b/app/code/Magento/Bundle/Model/Selection.php @@ -20,6 +20,8 @@ * @method \Magento\Bundle\Model\Selection setPosition(int $value) * @method int getIsDefault() * @method \Magento\Bundle\Model\Selection setIsDefault(int $value) + * @method int getWebsiteId() + * @method \Magento\Bundle\Model\Selection setWebsiteId(int $value) * @method int getSelectionPriceType() * @method \Magento\Bundle\Model\Selection setSelectionPriceType(int $value) * @method float getSelectionPriceValue() @@ -74,11 +76,28 @@ protected function _construct() /** * Processing object before save data * + * @return void + */ + public function beforeSave() + { + if (!$this->_catalogData->isPriceGlobal() && $this->getWebsiteId()) { + $this->setData('tmp_selection_price_value', $this->getSelectionPriceValue()); + $this->setSelectionPriceValue($this->getOrigData('selection_price_value')); + } + parent::beforeSave(); + } + + /** + * Processing object after save data + * * @return $this */ public function afterSave() { if (!$this->_catalogData->isPriceGlobal() && $this->getWebsiteId()) { + if (null !== $this->getData('tmp_selection_price_value')) { + $this->setSelectionPriceValue($this->getData('tmp_selection_price_value')); + } $this->getResource()->saveSelectionPrice($this); if (!$this->getDefaultPriceScope()) { @@ -86,6 +105,6 @@ public function afterSave() $this->unsSelectionPriceType(); } } - parent::afterSave(); + return parent::afterSave(); } } diff --git a/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterAddChildBySkuPlugin.php b/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterAddChildBySkuPlugin.php new file mode 100644 index 0000000000000..24dc8ce49b23c --- /dev/null +++ b/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterAddChildBySkuPlugin.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Bundle\Plugin\Api\ProductLinkManagement; + +use Magento\Bundle\Api\ProductLinkManagementInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Indexer\Product\Full; + +/** + * Reindex bundle product after child has been added. + */ +class ReindexAfterAddChildBySkuPlugin +{ + /** + * @var Full + */ + private $indexer; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @param Full $indexer + * @param ProductRepositoryInterface $productRepository + */ + public function __construct(Full $indexer, ProductRepositoryInterface $productRepository) + { + $this->indexer = $indexer; + $this->productRepository = $productRepository; + } + + /** + * Reindex bundle product after child has been added. + * + * @param ProductLinkManagementInterface $subject + * @param int $result + * @param string $sku + * @return int + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterAddChildByProductSku( + ProductLinkManagementInterface $subject, + int $result, + string $sku + ): int { + $bundleProduct = $this->productRepository->get($sku, true); + $this->indexer->executeRow($bundleProduct->getId()); + + return $result; + } +} diff --git a/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterRemoveChildPlugin.php b/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterRemoveChildPlugin.php new file mode 100644 index 0000000000000..c92ee5b494778 --- /dev/null +++ b/app/code/Magento/Bundle/Plugin/Api/ProductLinkManagement/ReindexAfterRemoveChildPlugin.php @@ -0,0 +1,59 @@ +<?php + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Plugin\Api\ProductLinkManagement; + +use Magento\Bundle\Api\ProductLinkManagementInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Indexer\Product\Full; + +/** + * Reindex bundle product after child has been removed. + */ +class ReindexAfterRemoveChildPlugin +{ + /** + * @var Full + */ + private $indexer; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @param Full $indexer + * @param ProductRepositoryInterface $productRepository + */ + public function __construct(Full $indexer, ProductRepositoryInterface $productRepository) + { + $this->indexer = $indexer; + $this->productRepository = $productRepository; + } + + /** + * Reindex bundle product after child has been removed. + * + * @param ProductLinkManagementInterface $subject + * @param bool $result + * @param string $sku + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterRemoveChild( + ProductLinkManagementInterface $subject, + bool $result, + string $sku + ): bool { + $bundleProduct = $this->productRepository->get($sku, true); + $this->indexer->executeRow($bundleProduct->getId()); + + return $result; + } +} diff --git a/app/code/Magento/Bundle/Plugin/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Bundle/Plugin/Catalog/Model/Product/Type/AbstractType.php new file mode 100644 index 0000000000000..64061dc963218 --- /dev/null +++ b/app/code/Magento/Bundle/Plugin/Catalog/Model/Product/Type/AbstractType.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Plugin\Catalog\Model\Product\Type; + +use Magento\Catalog\Model\Product\Type\AbstractType as Subject; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Type; +use Magento\Bundle\Model\Product\SingleChoiceProvider; + +/** + * Plugin to add possibility to add bundle product with single option from list + */ +class AbstractType +{ + /** + * @var SingleChoiceProvider + */ + private $singleChoiceProvider; + + /** + * @param SingleChoiceProvider $singleChoiceProvider + */ + public function __construct( + SingleChoiceProvider $singleChoiceProvider + ) { + $this->singleChoiceProvider = $singleChoiceProvider; + } + + /** + * Add possibility to add to cart from the list in case of one required option + * + * @param Subject $subject + * @param bool $result + * @param Product $product + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterIsPossibleBuyFromList(Subject $subject, $result, $product) + { + if ($product->getTypeId() === Type::TYPE_BUNDLE) { + $isSingleChoice = $this->singleChoiceProvider->isSingleChoiceAvailable($product); + if ($isSingleChoice === true) { + $result = $isSingleChoice; + } + } + return $result; + } +} diff --git a/app/code/Magento/Bundle/Plugin/Catalog/ViewModel/Product/AddBundleOptionsData.php b/app/code/Magento/Bundle/Plugin/Catalog/ViewModel/Product/AddBundleOptionsData.php new file mode 100644 index 0000000000000..46125546d4682 --- /dev/null +++ b/app/code/Magento/Bundle/Plugin/Catalog/ViewModel/Product/AddBundleOptionsData.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Plugin\Catalog\ViewModel\Product; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\ViewModel\Product\OptionsData as Subject; +use Magento\Catalog\Model\Product\Type; +use Magento\Bundle\Model\Product\SingleChoiceProvider; + +/** + * Plugin to add bundle options data + */ +class AddBundleOptionsData +{ + /** + * @var SingleChoiceProvider + */ + private $singleChoiceProvider; + + /** + * @param SingleChoiceProvider $singleChoiceProvider + */ + public function __construct( + SingleChoiceProvider $singleChoiceProvider + ) { + $this->singleChoiceProvider = $singleChoiceProvider; + } + + public function afterGetOptionsData(Subject $subject, array $result, Product $product) : array + { + if ($product->getTypeId() === Type::TYPE_BUNDLE) { + if ($this->singleChoiceProvider->isSingleChoiceAvailable($product) === true) { + $typeInstance = $product->getTypeInstance(); + $typeInstance->setStoreFilter($product->getStoreId(), $product); + $options = $typeInstance->getOptions($product); + foreach ($options as $option) { + $optionId = $option->getId(); + $selectionsCollection = $typeInstance->getSelectionsCollection( + [$optionId], + $product + ); + $selections = $selectionsCollection->exportToArray(); + $countSelections = count($selections); + foreach ($selections as $selection) { + $name = 'bundle_option[' . $optionId . ']'; + if ($countSelections > 1) { + $name .= '[]'; + } + $result[] = [ + 'name' => $name, + 'value' => $selection['selection_id'] + ]; + } + } + } + } + return $result; + } +} diff --git a/app/code/Magento/Bundle/Plugin/Quote/UpdateBundleQuoteItemOptions.php b/app/code/Magento/Bundle/Plugin/Quote/UpdateBundleQuoteItemOptions.php new file mode 100644 index 0000000000000..8ee06d2a41b52 --- /dev/null +++ b/app/code/Magento/Bundle/Plugin/Quote/UpdateBundleQuoteItemOptions.php @@ -0,0 +1,61 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Plugin\Quote; + +use Magento\Bundle\Model\Product\Type; +use Magento\Bundle\Model\Quote\Item\Option; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Item; +use Magento\Quote\Model\QuoteManagement; + +/** + * Update bundle selection custom options + */ +class UpdateBundleQuoteItemOptions +{ + /** + * @var Option + */ + private $option; + + /** + * @param Option $option + */ + public function __construct( + Option $option + ) { + $this->option = $option; + } + + /** + * Update bundle selection custom options before order is placed + * + * @param QuoteManagement $subject + * @param Quote $quote + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function beforeSubmit( + QuoteManagement $subject, + Quote $quote, + array $orderData = [] + ): void { + foreach ($quote->getAllVisibleItems() as $quoteItem) { + if ($quoteItem->getProductType() === Type::TYPE_CODE) { + $options = $this->option->getSelectionOptions($quoteItem->getProduct()); + foreach ($quoteItem->getChildren() as $childItem) { + /** @var Item $childItem */ + $customOption = $childItem->getOptionByCode('selection_id'); + $selectionId = $customOption ? $customOption->getValue() : null; + if ($selectionId && isset($options[$selectionId])) { + $childItem->setOptions($options[$selectionId]); + } + } + } + } + } +} diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminAssertBundleProductGeneralInfoOnEditPageActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminAssertBundleProductGeneralInfoOnEditPageActionGroup.xml new file mode 100644 index 0000000000000..d0a3fcb497c31 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminAssertBundleProductGeneralInfoOnEditPageActionGroup.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertBundleProductGeneralInfoOnEditPageActionGroup" extends="AdminAssertProductInfoOnEditPageActionGroup"> + <annotations> + <description>Verifies the general data on the Edit product details page in admin for a bundle product.</description> + </annotations> + <arguments> + <argument name="dynamicSku" defaultValue="true" type="string"/> + <argument name="dynamicPrice" defaultValue="true" type="string"/> + <argument name="dynamicWeight" defaultValue="true" type="string"/> + </arguments> + <executeJS function="return document.querySelector("{{AdminProductFormSection.attributeSet}}").innerText" stepKey="seeProductAttributeSet"/> + <assertEquals stepKey="assertProductAttributeSet" after="seeProductAttributeSet"> + <actualResult type="variable">seeProductAttributeSet</actualResult> + <expectedResult type="string">{{productAttributeSet}}</expectedResult> + </assertEquals> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.dynamicSkuInput}}").checked.toString()" stepKey="dynamicSkuCheckedValue" after="seeProductSku"/> + <assertEquals stepKey="assertDynamicSku" after="dynamicSkuCheckedValue"> + <actualResult type="variable">dynamicSkuCheckedValue</actualResult> + <expectedResult type="string">{{dynamicSku}}</expectedResult> + </assertEquals> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.dynamicPriceInput}}").checked.toString()" stepKey="dynamicPriceCheckedValue" after="seeProductPrice"/> + <assertEquals stepKey="assertDynamicPrice" after="dynamicPriceCheckedValue"> + <actualResult type="variable">dynamicPriceCheckedValue</actualResult> + <expectedResult type="string">{{dynamicPrice}}</expectedResult> + </assertEquals> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.dynamicWeightInput}}").checked.toString()" stepKey="dynamicWeightCheckedValue" after="seeProductWeight"/> + <assertEquals stepKey="assertDynamicWeight" after="dynamicWeightCheckedValue"> + <actualResult type="variable">dynamicWeightCheckedValue</actualResult> + <expectedResult type="string">{{dynamicWeight}}</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyBundleProductOptionActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyBundleProductOptionActionGroup.xml new file mode 100644 index 0000000000000..9562fd3df7496 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyBundleProductOptionActionGroup.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminVerifyBundleProductOptionActionGroup"> + <annotations> + <description>Verify bundle option data for the specified option index on the Edit Product page in admin for + a Bundle product.</description> + </annotations> + <arguments> + <argument name="optionTitle" defaultValue="{{DropDownBundleOption.title}}" type="string"/> + <argument name="inputType" defaultValue="{{DropDownBundleOption.type}}" type="string"/> + <argument name="required" defaultValue="{{DropDownBundleOption.required}}" type="string"/> + <argument name="numberOfProducts" defaultValue="1" type="string"/> + <argument name="index" defaultValue="1" type="string"/> + </arguments> + <executeJS function="return ({{index}}-1).toString()" stepKey="indexMinusOne"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle({$indexMinusOne})}}" stepKey="waitForOptionTitle"/> + <seeInField userInput="{{optionTitle}}" selector="{{AdminProductFormBundleSection.bundleOptionXTitle({$indexMinusOne})}}" stepKey="seeOptionTitle"/> + <seeOptionIsSelected userInput="{{inputType}}" selector="{{AdminProductFormBundleSection.bundleOptionXInputType({$indexMinusOne})}}" stepKey="seeOptionType"/> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.bundleOptionXRequired({$indexMinusOne})}}").checked.toString()" stepKey="optionRequiredValue"/> + <assertEquals stepKey="assertOptionRequiredValue"> + <actualResult type="variable">optionRequiredValue</actualResult> + <expectedResult type="string">{{required}}</expectedResult> + </assertEquals> + <seeNumberOfElements userInput="{{numberOfProducts}}" selector="{{AdminProductFormBundleSection.bundleOptionXAllProductRows(index)}}" stepKey="seeNumberOfProductsInOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyProductInBundleProductOptionActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyProductInBundleProductOptionActionGroup.xml new file mode 100644 index 0000000000000..385f07d692bcb --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminVerifyProductInBundleProductOptionActionGroup.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminVerifyProductInBundleProductOptionActionGroup"> + <annotations> + <description>Verify product data for the specified product row in a bundle option in the Bundle Items + section on the Edit Product page in admin for a Bundle product.</description> + </annotations> + <arguments> + <argument name="isDefault" defaultValue="true" type="string"/> + <argument name="name" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="sku" defaultValue="{{_defaultProduct.sku}}" type="string"/> + <argument name="defaultQuantity" defaultValue="1" type="string"/> + <argument name="userDefined" defaultValue="false" type="string"/> + <argument name="optionIndex" defaultValue="1" type="string"/> + <argument name="productIndex" defaultValue="1" type="string"/> + </arguments> + <executeJS function="return ({{optionIndex}}-1).toString()" stepKey="optionIndexMinusOne"/> + <executeJS function="return ({{productIndex}}-1).toString()" stepKey="productIndexMinusOne"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXProductYIsDefault({$optionIndexMinusOne}, {$productIndexMinusOne})}}" stepKey="waitForIsDefault"/> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.bundleOptionXProductYIsDefault({$optionIndexMinusOne}, {$productIndexMinusOne})}}").checked.toString()" stepKey="isDefaultValue"/> + <assertEquals stepKey="assertIsDefaultValue"> + <actualResult type="variable">isDefaultValue</actualResult> + <expectedResult type="string">{{isDefault}}</expectedResult> + </assertEquals> + <see userInput="{{name}}" selector="{{AdminProductFormBundleSection.bundleOptionXProductYName(optionIndex, productIndex)}}" stepKey="seeName"/> + <see userInput="{{sku}}" selector="{{AdminProductFormBundleSection.bundleOptionXProductYSku(optionIndex, productIndex)}}" stepKey="seeSku"/> + <seeInField userInput="{{defaultQuantity}}" selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity({$optionIndexMinusOne}, {$productIndexMinusOne})}}" stepKey="seeDefaultQuantity"/> + <executeJS function="return document.querySelector("{{AdminProductFormBundleSection.bundleOptionXProductYUserDefined({$optionIndexMinusOne}, {$productIndexMinusOne})}}").checked.toString()" stepKey="userDefinedValue"/> + <assertEquals stepKey="assertUserDefinedValueValue"> + <actualResult type="variable">userDefinedValue</actualResult> + <expectedResult type="string">{{userDefined}}</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductWithSingleChoiceToCartActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductWithSingleChoiceToCartActionGroup.xml new file mode 100644 index 0000000000000..4767a5abe3520 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductWithSingleChoiceToCartActionGroup.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAddCategoryBundleProductWithSingleChoiceToCartActionGroup"> + <annotations> + <description>Adds a Bundled Product with the single choice to the Cart from the Category page.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="quantity" defaultValue="1" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> + + <!--Open minicart and change Qty--> + <scrollToTopOfPage stepKey="scrollToTheTopOfThePage"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.showCart}}" stepKey="waitForElementToBeVisible"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/> + <waitForPageLoad stepKey="waitForPageToLoad2"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.quantity}}" stepKey="waitForElementQty"/> + <pressKey selector="{{StorefrontMinicartSection.itemQuantity(product.name)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::BACKSPACE]" stepKey="deleteFiled"/> + <fillField selector="{{StorefrontMinicartSection.itemQuantity(product.name)}}" userInput="{{quantity}}" stepKey="changeQty"/> + <conditionalClick selector="{{StorefrontMinicartSection.itemQuantityUpdate(product.name)}}" dependentSelector="{{StorefrontMinicartSection.itemQuantityUpdate(product.name)}}" visible="true" stepKey="updateQty"/> + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> + <waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> + + <!-- Close minicart --> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCartToClose"/> + <waitForPageLoad stepKey="waitForPageToLoad3"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontVerifyBundleProductOptionOnOrderActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontVerifyBundleProductOptionOnOrderActionGroup.xml new file mode 100644 index 0000000000000..1867fdcb2484a --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontVerifyBundleProductOptionOnOrderActionGroup.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontVerifyBundleProductOptionOnOrderActionGroup"> + <annotations> + <description>Verify bundle option data for the specified option index on a placed order on the storefront.</description> + </annotations> + <arguments> + <argument name="optionTitle" defaultValue="{{DropDownBundleOption.title}}" type="string"/> + <argument name="optionProductName" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="optionProductSku" defaultValue="{{_defaultProduct.sku}}" type="string"/> + <argument name="optionProductQuantityDescription" defaultValue="Ordered 1" type="string"/> + <argument name="productIndex" defaultValue="1" type="string"/> + <argument name="optionIndex" defaultValue="1" type="string"/> + </arguments> + <waitForText userInput="{{optionTitle}}" selector="{{StorefrontCustomerOrderViewSection.productOptionLabel(productIndex, optionIndex)}}" stepKey="seeOptionTitle"/> + <see userInput="{{optionProductName}}" selector="{{StorefrontCustomerOrderViewSection.productOptionProductName(productIndex, optionIndex)}}" stepKey="seeOptionProductName"/> + <see userInput="{{optionProductSku}}" selector="{{StorefrontCustomerOrderViewSection.productOptionProductSku(productIndex, optionIndex)}}" stepKey="seeOptionProductSku"/> + <see userInput="{{optionProductQuantityDescription}}" selector="{{StorefrontCustomerOrderViewSection.productOptionProductQuantity(productIndex, optionIndex)}}" stepKey="seeOptionProductQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/Data/BundleLinkData.xml b/app/code/Magento/Bundle/Test/Mftf/Data/BundleLinkData.xml index 60d11345731c1..75ab4393e0475 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Data/BundleLinkData.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Data/BundleLinkData.xml @@ -17,4 +17,13 @@ <data key="price_type">1</data> <data key="can_change_quantity">1</data> </entity> + <entity name="ApiBundleLinkFixed" type="bundle_link"> + <var key="option_id" entityKey="return" entityType="bundle_option"/> + <var key="sku" entityKey="sku" entityType="product"/> + <data key="qty">1</data> + <data key="is_default">1</data> + <data key="price">30</data> + <data key="price_type">0</data> + <data key="can_change_quantity">1</data> + </entity> </entities> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/AdminOrderItemsOrderedSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/AdminOrderItemsOrderedSection.xml new file mode 100644 index 0000000000000..fc82816cabb90 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Section/AdminOrderItemsOrderedSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminOrderItemsOrderedSection"> + <element name="orderItemOptionLabel" type="text" selector=".edit-order-table tr:nth-of-type({{row}}) .col-product .option-label" parameterized="true"/> + <element name="orderItemOptionValue" type="text" selector=".edit-order-table tr:nth-of-type({{row}}) .col-product .option-value" parameterized="true"/> + <element name="orderItemOptionPrice" type="text" selector=".edit-order-table tr:nth-of-type({{row}}) .col-product .option-value .price" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml index 6ad83ba1105f4..213131c5ed652 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml @@ -16,10 +16,16 @@ <element name="firstInputType" type="select" selector="[name='bundle_options[bundle_options][0][type]']"/> <element name="firstRequired" type="checkbox" selector="[name='bundle_options[bundle_options][0][required]']"/> <element name="firstProductQuantity" type="input" selector="[name='bundle_options[bundle_options][0][bundle_selections][0][selection_qty]']"/> + <element name="allBundleOptions" type="text" selector="[data-index=bundle_options]>tbody>tr"/> <element name="bundleOptionXTitle" type="input" selector="[name='bundle_options[bundle_options][{{x}}][title]']" parameterized="true"/> <element name="bundleOptionXInputType" type="select" selector="[name='bundle_options[bundle_options][{{x}}][type]']" parameterized="true"/> <element name="bundleOptionXRequired" type="checkbox" selector="[name='bundle_options[bundle_options][{{x}}][required]']" parameterized="true"/> + <element name="bundleOptionXAllProductRows" type="text" parameterized="true" selector="[data-index=bundle_options]>tbody>tr:nth-of-type({{optionIndex}}) table[data-index=bundle_selections]>tbody>tr"/> + <element name="bundleOptionXProductYIsDefault" type="input" parameterized="true" selector="[name='bundle_options[bundle_options][{{optionIndex}}][bundle_selections][{{productIndex}}][is_default]']"/> + <element name="bundleOptionXProductYName" type="text" parameterized="true" selector="[data-index=bundle_options]>tbody>tr:nth-of-type({{optionIndex}}) table[data-index=bundle_selections]>tbody>tr:nth-of-type({{productIndex}}) div[data-index=name]"/> + <element name="bundleOptionXProductYSku" type="text" parameterized="true" selector="[data-index=bundle_options]>tbody>tr:nth-of-type({{optionIndex}}) table[data-index=bundle_selections]>tbody>tr:nth-of-type({{productIndex}}) div[data-index=sku]"/> <element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/> + <element name="bundleOptionXProductYUserDefined" type="checkbox" parameterized="true" selector="[name='bundle_options[bundle_options][{{optionIndex}}][bundle_selections][{{productIndex}}][selection_can_change_qty]']"/> <element name="bundleOptionXProductYPrice" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_price_value]']" parameterized="true"/> <element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/> <element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/> @@ -73,6 +79,7 @@ <element name="firstProductOption" type="checkbox" selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']"/> <element name="dynamicSkuToggle" type="checkbox" selector="div[data-index='sku_type'] .admin__actions-switch-label" timeout="30"/> <element name="dynamicPriceToggle" type="checkbox" selector="//div[@data-index='price_type']//div[@data-role='switcher']"/> + <element name="dynamicPriceInput" type="input" selector="[name='product[price_type]']"/> <element name="taxClassDropDown" type="select" selector="//select[@name='product[tax_class_id]']" timeout="30"/> <element name="taxableGoodsOption" type="text" selector="//select[@name='product[tax_class_id]']//option[@data-title='Taxable Goods']"/> <element name="stockStatusField" type="select" selector="//select[@name='product[quantity_and_stock_status][is_in_stock]']"/> @@ -90,8 +97,10 @@ <element name="selectCountryOfManufacture" type="text" selector="//select[@name='product[country_of_manufacture]']//option[@data-title='{{country}}']" parameterized="true"/> <element name="dynamicSkuToggleOn" type="checkbox" selector="//div[@data-index='sku_type']//div[@data-role='switcher']//input[@value='0']"/> <element name="dynamicSkuToggleOff" type="checkbox" selector="//div[@data-index='sku_type']//div[@data-role='switcher']//input[@value='1']"/> + <element name="dynamicSkuInput" type="input" selector="[name='product[sku_type]']"/> <element name="dynamicWeightToggleOn" type="checkbox" selector="//div[@data-index='weight_type']//div[@data-role='switcher']//input[@value='0']"/> <element name="dynamicWeightToggleOff" type="checkbox" selector="//div[@data-index='weight_type']//div[@data-role='switcher']//input[@value='1']"/> + <element name="dynamicWeightInput" type="input" selector="[name='product[weight_type]']"/> <element name="categoryFieldName" type="text" selector="//fieldset[@data-index='container_category_ids']//label//span" timeout="30"/> <element name="categoryDone" type="button" selector=".admin__action-multiselect-actions-wrap [type='button'] span" timeout="30"/> <element name="dynamicPriceToggleOff" type="checkbox" selector="//div[@data-index='price_type']//div[@data-role='switcher']//input[@value='1']"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml index 1dea8958c3552..863375632ebab 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml @@ -11,6 +11,7 @@ <section name="StorefrontBundledSection"> <element name="productCheckbox" type="select" selector="//*[@id='customizeTitle']/following-sibling::div[{{arg1}}]//div[{{arg2}}][@class='field choice']/input" parameterized="true"/> <element name="bundleProductsPrice" type="text" selector="//*[@class='bundle-info']//*[contains(@id,'product-price')]/span"/> + <element name="bundleSummary" type="text" selector="#bundle-summary"/> <element name="nthBundledOption" type="input" selector=".option:nth-of-type({{numOption}}) .choice:nth-of-type({{numOptionSelect}}) input" parameterized="true"/> <element name="addToCart" type="button" selector="#bundle-slide" timeout="30"/> <element name="addToCartConfigured" type="button" selector="#product-addtocart-button" timeout="30"/> @@ -21,6 +22,14 @@ <element name="customizableBundleItemOption" type="text" selector="//div[@class='field choice'][1]//input[@type='checkbox']"/> <element name="customizableBundleItemOption2" type="text" selector="//div[@class='field choice'][2]//input[@type='checkbox']"/> <element name="nthOptionDiv" type="block" selector="#product-options-wrapper div.field.option:nth-of-type({{var}})" parameterized="true"/> + <element name="allBundleOptions" type="block" selector="#product-options-wrapper div.field.option"/> + <element name="allBundleOptionProducts" type="block" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice"/> + <element name="bundleOptionRequired" type="block" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}).required"/> + <element name="bundleOptionInput" type="input" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice:nth-of-type({{productIndex}}) input"/> + <element name="bundleOptionProductName" type="text" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice:nth-of-type({{productIndex}}) .product-name"/> + <element name="bundleOptionProductPrice" type="text" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice:nth-of-type({{productIndex}}) .price-notice"/> + <element name="bundleOptionQuantity" type="input" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .qty input"/> + <element name="bundleOptionQuantityDisabled" type="input" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .qty input[disabled]"/> <element name="nthItemOptionsTitle" type="text" selector="dl.item-options dt:nth-of-type({{var}})" parameterized="true"/> <element name="nthItemOptionsValue" type="text" selector="dl.item-options dd:nth-of-type({{var}})" parameterized="true"/> <element name="bundleProductName" type="text" selector="//*[@id='maincontent']//span[@itemprop='name']"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderSection.xml new file mode 100644 index 0000000000000..92534f2cb3689 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderSection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCustomerOrderSection"> + <element name="orderItemOptionLabel" type="text" selector=".table-order-items tr:nth-of-type({{row}}) td.label" parameterized="true"/> + <element name="orderItemOptionValue" type="text" selector=".table-order-items tr:nth-of-type({{row}}) td.value" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml new file mode 100644 index 0000000000000..634a7db53694d --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCustomerOrderViewSection"> + <element name="allProductOptionLabels" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{productIndex}}) .options-label"/> + <element name="productOptionLabel" type="text" parameterized="true" selector="//table[@id='my-orders-table']//tbody[{{productIndex}}]//tr[@class='options-label'][{{optionIndex}}]"/> + <element name="allProductOptionProducts" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{productIndex}}) .item-options-container"/> + <element name="productOptionProductName" type="text" parameterized="true" selector="//table[@id='my-orders-table']//tbody[{{productIndex}}]//tr[contains(@class,'item-options-container')][{{optionIndex}}]//td[@data-th='Product Name']"/> + <element name="productOptionProductSku" type="text" parameterized="true" selector="//table[@id='my-orders-table']//tbody[{{productIndex}}]//tr[contains(@class,'item-options-container')][{{optionIndex}}]//td[@data-th='SKU']"/> + <element name="productOptionProductQuantity" type="text" parameterized="true" selector="//table[@id='my-orders-table']//tbody[{{productIndex}}]//tr[contains(@class,'item-options-container')][{{optionIndex}}]//td[@data-th='Quantity']"/> + </section> +</sections> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml index 0fa4a8ed93732..538cf391ea352 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml @@ -70,7 +70,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml index 788dc4a848fd3..68134c843dae7 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml @@ -35,6 +35,6 @@ </actionGroup> <!--Checking content storefront--> - <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml index 26d7dddbcc378..6491bc52ea825 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml @@ -79,7 +79,7 @@ <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{BundleProduct.name}}"/> + <argument name="productUrl" value="{{BundleProduct.urlKey}}"/> </actionGroup> <!-- Assert product Design settings "layout 3 columns" --> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml index 7973860e4d5c5..1f2b8435b45f6 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml @@ -37,7 +37,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!-- Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createDynamicBundleProduct.name$$)}}" stepKey="amOnBundleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createDynamicBundleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnBundleProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -47,7 +47,7 @@ <dontSee userInput="$$createDynamicBundleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createDynamicBundleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml index edde81f338437..b0c1ff7480df6 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml @@ -34,7 +34,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!-- Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.name$$)}}" stepKey="amOnBundleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnBundleProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -44,7 +44,7 @@ <dontSee userInput="$$createFixedBundleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createFixedBundleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml index ac0c3e7b5b791..b132a7829866b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml @@ -68,13 +68,13 @@ <!--See related product in admin--> <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo"/> <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee"/> - <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.sku$$" stepKey="seeRelatedProduct"/> + <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.name$$" stepKey="seeRelatedProduct"/> <magentoCLI command="cron:run --group=index" stepKey="runCronIndexer"/> <!--See related product in storefront--> - <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> - <see userInput="$$simpleProduct1.sku$$" stepKey="seeRelatedProductInStorefront"/> + <see userInput="$$simpleProduct1.name$$" stepKey="seeRelatedProductInStorefront"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByDescriptionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByDescriptionTest.xml index 95b4e06678af2..1d851fdc888d5 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByDescriptionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByDescriptionTest.xml @@ -15,8 +15,8 @@ <title value="Guest customer should be able to advance search Bundle product with product description"/> <description value="Guest customer should be able to advance search Bundle product with product description"/> <severity value="MAJOR"/> - <testCaseId value="MC-242"/> - <group value="Bundle"/> + <testCaseId value="MC-25427"/> + <group value="bundle"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -43,9 +43,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByPriceTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByPriceTest.xml index f45c9ceba635f..a37ee49ee1951 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByPriceTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByPriceTest.xml @@ -15,8 +15,8 @@ <title value="Guest customer should be able to advance search Bundle product with product price"/> <description value="Guest customer should be able to advance search Bundle product with product price"/> <severity value="MAJOR"/> - <testCaseId value="MC-251"/> - <group value="Bundle"/> + <testCaseId value="MC-25435"/> + <group value="bundle"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -52,9 +52,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByShortDescriptionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByShortDescriptionTest.xml index 05e14174d14a5..f534b52aa2c34 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByShortDescriptionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByShortDescriptionTest.xml @@ -15,8 +15,8 @@ <title value="Guest customer should be able to advance search Bundle product with product short description"/> <description value="Guest customer should be able to advance search Bundle product with product short description"/> <severity value="MAJOR"/> - <testCaseId value="MC-250"/> - <group value="Bundle"/> + <testCaseId value="MC-25434"/> + <group value="bundle"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -43,9 +43,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml index e6af89181e558..465a171b9f96f 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml @@ -15,8 +15,8 @@ <title value="Guest customer should be able to advance search Bundle product with product name"/> <description value="Guest customer should be able to advance search Bundle product with product name"/> <severity value="MAJOR"/> - <testCaseId value="MC-139"/> - <group value="Bundle"/> + <testCaseId value="MC-25342"/> + <group value="bundle"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -43,9 +43,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index 0474de1144f4e..b472eb57b7a8e 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -134,9 +134,7 @@ <!--Clear Cache - reindex - resets products according to enabled/disabled view--> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Confirm bundle products have been enabled--> <amOnPage url="{{BundleProduct.urlKey2}}.html" stepKey="GoToProductPageEnabled"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdvanceCatalogSearchBundleBySkuWithHyphenTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdvanceCatalogSearchBundleBySkuWithHyphenTest.xml index 30c784b19a0bf..d95099f4a34a0 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdvanceCatalogSearchBundleBySkuWithHyphenTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdvanceCatalogSearchBundleBySkuWithHyphenTest.xml @@ -15,16 +15,13 @@ <title value="Guest customer should be able to advance search Bundle product with product sku that contains hyphen"/> <description value="Guest customer should be able to advance search Bundle product with product sku that contains hyphen"/> <severity value="MAJOR"/> - <testCaseId value="MC-20359"/> + <testCaseId value="MC-28812"/> <group value="Bundle"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> - <createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/> - <createData entity="ApiProductWithDescription" stepKey="simple2" before="product"/> + <createData entity="ApiProductWithDescription" before="simple2" stepKey="simple1"/> + <createData entity="ApiProductWithDescription" before="product" stepKey="simple2"/> <createData entity="ApiBundleProduct" stepKey="product"/> <createData entity="DropDownBundleOption" stepKey="bundleOption"> <requiredEntity createDataKey="product"/> @@ -42,8 +39,8 @@ <magentoCron stepKey="runCronReindex" groups="index"/> </before> <after> - <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> - <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> + <deleteData createDataKey="simple1" before="deleteSimple2" stepKey="deleteSimple1"/> + <deleteData createDataKey="simple2" before="delete" stepKey="deleteSimple2"/> </after> </test> -</tests> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest.xml index 0e2ae9bf5cc5f..6742d276c8fed 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest.xml @@ -58,7 +58,7 @@ <!--Open Product Page--> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{BundleProduct.name}}"/> + <argument name="productUrl" value="{{BundleProduct.urlKey}}"/> </actionGroup> <!-- Add bundle to cart --> @@ -88,7 +88,7 @@ <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <!-- Assert item options display --> - <see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $firstSimpleProduct.sku$" stepKey="seeFirstProductInList"/> - <see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $secondSimpleProduct.sku$" stepKey="seeSecondProductInList"/> + <see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $firstSimpleProduct.name$" stepKey="seeFirstProductInList"/> + <see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $secondSimpleProduct.name$" stepKey="seeSecondProductInList"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml index 4e408a863b5ee..63f94401a3c14 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml @@ -62,16 +62,16 @@ <!--"Drop-down" type option--> <!-- Check Tier Prices for product 1 --> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct1CreateBundleProduct.sku$$ +$$$simpleProduct1CreateBundleProduct.price$$.00" stepKey="selectDropDownOptionProduct1"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct1CreateBundleProduct.sku$$ +$$$simpleProduct1CreateBundleProduct.price$$.00" stepKey="checkDropDownOptionProduct1"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct1CreateBundleProduct.name$$ +$$$simpleProduct1CreateBundleProduct.price$$.00" stepKey="selectDropDownOptionProduct1"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct1CreateBundleProduct.name$$ +$$$simpleProduct1CreateBundleProduct.price$$.00" stepKey="checkDropDownOptionProduct1"/> <grabTextFrom selector="{{StorefrontBundledSection.dropDownOptionTierPrices('Drop-down Option')}}" stepKey="DropDownTierPriceTextProduct1"/> <assertStringContainsString stepKey="assertDropDownTierPriceTextProduct1"> <expectedResult type="string">Buy 5 for $5.00 each and save 50%</expectedResult> <actualResult type="variable">DropDownTierPriceTextProduct1</actualResult> </assertStringContainsString> <!-- Check Tier Prices for product 2 --> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="selectDropDownOptionProduct2"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="checkDropDownOptionProduct2"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.name$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="selectDropDownOptionProduct2"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.name$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="checkDropDownOptionProduct2"/> <grabTextFrom selector="{{StorefrontBundledSection.dropDownOptionTierPrices('Drop-down Option')}}" stepKey="dropDownTierPriceTextProduct2"/> <assertStringContainsString stepKey="assertDropDownTierPriceTextProduct2"> <expectedResult type="string">Buy 7 for $15.00 each and save 25%</expectedResult> @@ -80,13 +80,13 @@ <!--"Radio Buttons" type option--> <!-- Check Tier Prices for product 1 --> - <grabTextFrom selector="{{StorefrontBundledSection.radioButtonOptionLabel('Radio Buttons Option', '$$simpleProduct1CreateBundleProduct.sku$$')}}" stepKey="radioButtonsOptionTierPriceTextProduct1"/> + <grabTextFrom selector="{{StorefrontBundledSection.radioButtonOptionLabel('Radio Buttons Option', '$$simpleProduct1CreateBundleProduct.name$$')}}" stepKey="radioButtonsOptionTierPriceTextProduct1"/> <assertStringContainsString stepKey="assertRadioButtonsOptionTierPriceTextProduct1"> <expectedResult type="string">Buy 5 for $5.00 each and save 50%</expectedResult> <actualResult type="variable">radioButtonsOptionTierPriceTextProduct1</actualResult> </assertStringContainsString> <!-- Check Tier Prices for product 2 --> - <grabTextFrom selector="{{StorefrontBundledSection.radioButtonOptionLabel('Radio Buttons Option', '$$simpleProduct2CreateBundleProduct.sku$$')}}" stepKey="radioButtonsOptionTierPriceTextProduct2"/> + <grabTextFrom selector="{{StorefrontBundledSection.radioButtonOptionLabel('Radio Buttons Option', '$$simpleProduct2CreateBundleProduct.name$$')}}" stepKey="radioButtonsOptionTierPriceTextProduct2"/> <assertStringContainsString stepKey="assertRadioButtonsOptionTierPriceTextProduct2"> <expectedResult type="string">Buy 7 for $15.00 each and save 25%</expectedResult> <actualResult type="variable">radioButtonsOptionTierPriceTextProduct2</actualResult> @@ -94,13 +94,13 @@ <!--"Checkbox" type option--> <!-- Check Tier Prices for product 1 --> - <grabTextFrom selector="{{StorefrontBundledSection.checkboxOptionLabel('Checkbox Option', '$$simpleProduct1CreateBundleProduct.sku$$')}}" stepKey="checkBoxOptionTierPriceTextProduct1"/> + <grabTextFrom selector="{{StorefrontBundledSection.checkboxOptionLabel('Checkbox Option', '$$simpleProduct1CreateBundleProduct.name$$')}}" stepKey="checkBoxOptionTierPriceTextProduct1"/> <assertStringContainsString stepKey="assertCheckBoxOptionTierPriceTextProduct1"> <expectedResult type="string">Buy 5 for $5.00 each and save 50%</expectedResult> <actualResult type="variable">checkBoxOptionTierPriceTextProduct1</actualResult> </assertStringContainsString> <!-- Check Tier Prices for product 2 --> - <grabTextFrom selector="{{StorefrontBundledSection.checkboxOptionLabel('Checkbox Option', '$$simpleProduct2CreateBundleProduct.sku$$')}}" stepKey="checkBoxOptionTierPriceTextProduct2"/> + <grabTextFrom selector="{{StorefrontBundledSection.checkboxOptionLabel('Checkbox Option', '$$simpleProduct2CreateBundleProduct.name$$')}}" stepKey="checkBoxOptionTierPriceTextProduct2"/> <assertStringContainsString stepKey="assertCheckBoxOptionTierPriceTextProduct2"> <expectedResult type="string">Buy 7 for $15.00 each and save 25%</expectedResult> <actualResult type="variable">checkBoxOptionTierPriceTextProduct2</actualResult> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductTwoWebsiteDifferentPriceOptionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductTwoWebsiteDifferentPriceOptionTest.xml new file mode 100644 index 0000000000000..5fdce3fb555c8 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductTwoWebsiteDifferentPriceOptionTest.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCheckBundleProductTwoWebsiteDifferentPriceOptionTest"> + <annotations> + <title value="Verify bundle item price different websites."/> + <stories value="Github issue: #12584 Bundle Item price cannot differ per website"/> + <description value="Verify bundle item price different websites. Change bundle item price on second website."/> + <features value="Bundle"/> + <severity value="MAJOR"/> + <group value="bundle"/> + </annotations> + <before> + <magentoCLI command="config:set {{WebsiteCatalogPriceScopeConfigData.path}} {{WebsiteCatalogPriceScopeConfigData.value}}" stepKey="setPriceScopeWebsite"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="logInAsAdmin"/> + + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> + <argument name="websiteCode" value="{{customWebsite.code}}"/> + </actionGroup> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStoreGroup"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="store" value="{{customStoreGroup.name}}"/> + <argument name="rootCategory" value="Default Category"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> + <argument name="StoreGroup" value="customStoreGroup"/> + <argument name="customStore" value="customStore"/> + </actionGroup> + + <createData entity="SimpleProduct2" stepKey="simpleProduct"/> + <createData entity="ApiFixedBundleProduct" stepKey="createBundleProduct" /> + <createData entity="CheckboxOption" stepKey="createBundleOption"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLinkFixed" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption"/> + <requiredEntity createDataKey="simpleProduct"/> + </createData> + </before> + <after> + <magentoCLI command="config:set {{GlobalCatalogPriceScopeConfigData.path}} {{GlobalCatalogPriceScopeConfigData.value}}" stepKey="setPriceScopeGlobal"/> + + <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> + + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> + <argument name="websiteName" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </after> + + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="openEditBundleProduct"> + <argument name="product" value="$$createBundleProduct$$"/> + </actionGroup> + + <actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="selectProductInWebsites"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchNewStoreView"> + <argument name="storeViewName" value="{{customStore.name}}"/> + </actionGroup> + + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYPrice('0', '0')}}" userInput="100" stepKey="fillBundleOption1Price"/> + + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveNewPrice"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$$createBundleProduct.custom_attributes[url_key]$$"/> + </actionGroup> + + <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/> + + <grabTextFrom selector="{{StorefrontBundledSection.bundleProductsPrice}}" stepKey="grabPriceText"/> + <assertEquals stepKey="assertPriceText"> + <expectedResult type="string">$31.23</expectedResult> + <actualResult type="variable">$grabPriceText</actualResult> + </assertEquals> + + </test> +</tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml index f7bce778cc0d8..268f58c6cb611 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml @@ -41,7 +41,7 @@ </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="cataloginventory_stock catalog_product_price"/> + <argument name="indices" value=""/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml index 97d466964fbd7..b9dd67a42b7ff 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml @@ -101,13 +101,13 @@ <!--Select options - set quantities--> <!--"Drop-down" type option--> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct1.sku$$ +$$$simpleProduct1.price$$.00" stepKey="selectOption0Product0"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct1.sku$$ +$$$simpleProduct1.price$$.00" stepKey="checkOption0Product0"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct1.name$$ +$$$simpleProduct1.price$$.00" stepKey="selectOption0Product0"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct1.name$$ +$$$simpleProduct1.price$$.00" stepKey="checkOption0Product0"/> <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="3" stepKey="fillQuantity00"/> <seeInField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="03" stepKey="checkQuantity00"/> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct2.sku$$ +$$$simpleProduct2.price$$.00" stepKey="selectOption0Product1"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct2.sku$$ +$$$simpleProduct2.price$$.00" stepKey="checkOption0Product1"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct2.name$$ +$$$simpleProduct2.price$$.00" stepKey="selectOption0Product1"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Option One')}}" userInput="$$simpleProduct2.name$$ +$$$simpleProduct2.price$$.00" stepKey="checkOption0Product1"/> <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="3" stepKey="fillQuantity01"/> <seeInField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity('Option One')}}" userInput="03" stepKey="checkQuantity01"/> @@ -132,10 +132,10 @@ <!--"Multi Select" type option--> <!--This option does not support user defined quantities--> - <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct1.sku$$ +$$$simpleProduct1.price$$.00" stepKey="selectOption3Product0"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct1.sku$$ +$$$simpleProduct1.price$$.00" stepKey="checkOption3Product0"/> + <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct1.name$$ +$$$simpleProduct1.price$$.00" stepKey="selectOption3Product0"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct1.name$$ +$$$simpleProduct1.price$$.00" stepKey="checkOption3Product0"/> - <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct2.sku$$ +$$$simpleProduct2.price$$.00" stepKey="selectOption3Product1"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct2.sku$$ +$$$simpleProduct2.price$$.00" stepKey="checkOption3Product1"/> + <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct2.name$$ +$$$simpleProduct2.price$$.00" stepKey="selectOption3Product1"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.multiselectOptionFourProducts('Option Four')}}" userInput="$$simpleProduct2.name$$ +$$$simpleProduct2.price$$.00" stepKey="checkOption3Product1"/> </test> </tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml index e204dd01e6367..f30cdc21513da 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml @@ -106,8 +106,8 @@ <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="onPageShoppingCart2"/> <!-- Assert that the options are both there and the proce no longer matches --> - <see stepKey="assertBothOptions" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct1.sku$$"/> - <see stepKey="assertBothOptions2" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct2.sku$$"/> + <see stepKey="assertBothOptions" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct1.name$$"/> + <see stepKey="assertBothOptions2" selector="{{CheckoutCartProductSection.nthItemOption('2')}}" userInput="$$simpleProduct2.name$$"/> <waitForElementVisible stepKey="waitForInfoDropdown2" selector="{{CheckoutCartSummarySection.total}}"/> <waitForPageLoad stepKey="waitForCartPageLoad4"/> <grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabTotalAfter"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml index e08982a266ee5..2b74e6fc99390 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml @@ -26,10 +26,14 @@ <magentoCron stepKey="runCronIndex" groups="index"/> </before> <after> - <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProduct"> + <argument name="sku" value="{{BundleProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> <!--Go to bundle product creation page--> <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" /> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontPlaceOrderBundleProductFixedPriceWithUpdatedPriceTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontPlaceOrderBundleProductFixedPriceWithUpdatedPriceTest.xml new file mode 100644 index 0000000000000..2351a6b1b2d5f --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontPlaceOrderBundleProductFixedPriceWithUpdatedPriceTest.xml @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontPlaceOrderBundleProductFixedPriceWithUpdatedPriceTest"> + <annotations> + <features value="Bundle"/> + <stories value="Placing order with bundle product"/> + <title value="Order details with bundle product fixed price should show the correct price for bundle items"/> + <description value="Order details with bundle product fixed price should show the correct price for bundle items"/> + <severity value="MAJOR"/> + <useCaseId value="MC-40603"/> + <testCaseId value="MC-40744"/> + <group value="bundle"/> + <group value="catalog"/> + </annotations> + + <before> + <createData entity="CustomerEntityOne" stepKey="createCustomer"/> + <createData entity="SimpleProduct2" stepKey="createFirstProduct"/> + <createData entity="SimpleProduct2" stepKey="createSecondProduct"/> + <createData entity="ApiFixedBundleProduct" stepKey="createFixedBundleProduct"> + <field key="price">11.00</field> + </createData> + <createData entity="RadioButtonsOption" stepKey="createFirstBundleOption"> + <field key="position">1</field> + <requiredEntity createDataKey="createFixedBundleProduct"/> + </createData> + <createData entity="RadioButtonsOption" stepKey="createSecondBundleOption"> + <field key="position">2</field> + <requiredEntity createDataKey="createFixedBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="firstLinkOptionToFixedProduct"> + <requiredEntity createDataKey="createFixedBundleProduct"/> + <requiredEntity createDataKey="createFirstBundleOption"/> + <requiredEntity createDataKey="createFirstProduct"/> + <field key="price_type">0</field> + <field key="price">7.00</field> + </createData> + <createData entity="ApiBundleLink" stepKey="secondLinkOptionToFixedProduct"> + <requiredEntity createDataKey="createFixedBundleProduct"/> + <requiredEntity createDataKey="createSecondBundleOption"/> + <requiredEntity createDataKey="createSecondProduct"/> + <field key="price_type">0</field> + <field key="price">5.00</field> + </createData> + <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> + <argument name="productId" value="$createFixedBundleProduct.id$"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> + </before> + <after> + <deleteData createDataKey="createFirstProduct" stepKey="deleteSimpleProductForBundleItem"/> + <deleteData createDataKey="createSecondProduct" stepKey="deleteVirtualProductForBundleItem"/> + <deleteData createDataKey="createFixedBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilters"/> + <waitForPageLoad stepKey="waitForClearProductsGridFilters"/> + </after> + <!--Login customer on storefront--> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer"> + <argument name="Customer" value="$$createCustomer$$" /> + </actionGroup> + <!--Open Product Page--> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openBundleProductPage"> + <argument name="product" value="$createFixedBundleProduct$"/> + </actionGroup> + <!--Add bundle to cart--> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickAddToCart"/> + <actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart"> + <argument name="quantity" value="1"/> + </actionGroup> + <!--Open bundle product in admin--> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> + <argument name="productId" value="$createFixedBundleProduct.id$"/> + </actionGroup> + <!--Change price of the first option--> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYPrice('0', '0')}}" userInput="9" stepKey="fillBundleOption1Price"/> + <!--Save the bundle product--> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> + <!--Open Product Page--> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openBundleProductPage2"> + <argument name="product" value="$createFixedBundleProduct$"/> + </actionGroup> + <!--Add bundle to cart--> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickAddToCart2"/> + <actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart2"> + <argument name="quantity" value="1"/> + </actionGroup> + <!--Verify bundle product details--> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCart"/> + <see selector="{{StorefrontBundledSection.nthItemOptionsTitle('1')}}" userInput="$$createFirstBundleOption.title$$" stepKey="seeOptionLabelInShoppingCart"/> + <see selector="{{StorefrontBundledSection.nthItemOptionsValue('1')}}" userInput="1 x $$createFirstProduct.name$$ $9.00" stepKey="seeOptionValueInShoppingCart"/> + <see selector="{{StorefrontBundledSection.nthItemOptionsTitle('2')}}" userInput="$$createSecondBundleOption.title$$" stepKey="seeOption2LabelInShoppingCart"/> + <see selector="{{StorefrontBundledSection.nthItemOptionsValue('2')}}" userInput="1 x $$createSecondProduct.name$$ $5.00" stepKey="seeOption2ValueInShoppingCart"/> + <!--Verify total--> + <grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabShoppingCartTotal"/> + <assertEquals stepKey="verifyGrandTotalOnShoppingCartPage"> + <actualResult type="variable">grabShoppingCartTotal</actualResult> + <expectedResult type="string">$60.00</expectedResult> + </assertEquals> + + <!--Navigate to checkout--> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/> + <!--Click next button to open payment section--> + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/> + <!--Click place order--> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + <!--Navigate to order details page in custom account--> + <amOnPage url="{{StorefrontCustomerOrderViewPage.url({$grabOrderNumber})}}" stepKey="amOnOrderPage"/> + <!--Verify bundle order items details--> + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionLabel('2')}}" userInput="$$createFirstBundleOption.title$$" stepKey="seeOptionLabelInCustomerOrderItems"/> + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionValue('3')}}" userInput="1 x $$createFirstProduct.name$$ $9.00" stepKey="seeOptionValueInCustomerOrderItems"/> + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionLabel('4')}}" userInput="$$createSecondBundleOption.title$$" stepKey="seeOption2LabelInCustomerOrderItems"/> + <see selector="{{StorefrontCustomerOrderSection.orderItemOptionValue('5')}}" userInput="1 x $$createSecondProduct.name$$ $5.00" stepKey="seeOption2ValueInCustomerOrderItems"/> + <!--Navigate to order details page on admin--> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById"> + <argument name="orderId" value="{$grabOrderNumber}"/> + </actionGroup> + <!--Verify bundle order items details--> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionLabel('2')}}" userInput="$$createFirstBundleOption.title$$" stepKey="seeOptionLabelInAdminOrderItems"/> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionValue('3')}}" userInput="1 x $$createFirstProduct.name$$" stepKey="seeOptionValueInAdminOrderItems"/> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionPrice('3')}}" userInput="$9.00" stepKey="seeOptionPriceInAdminOrderItems"/> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionLabel('4')}}" userInput="$$createSecondBundleOption.title$$" stepKey="seeOption2LabelInAdminOrderItems"/> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionValue('5')}}" userInput="1 x $$createSecondProduct.name$$" stepKey="seeOption2ValueInAdminOrderItems"/> + <see selector="{{AdminOrderItemsOrderedSection.orderItemOptionPrice('5')}}" userInput="$5.00" stepKey="seeOption2PriceInAdminOrderItems"/> + <!--Verify total--> + <grabTextFrom selector="{{AdminOrderTotalSection.grandTotal}}" stepKey="grabAdminOrderTotal"/> + <assertEquals stepKey="verifyGrandTotalOnAdminOrderPage"> + <actualResult type="variable">grabAdminOrderTotal</actualResult> + <expectedResult type="string">$60.00</expectedResult> + </assertEquals> + </test> +</tests> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml index 927cebdf7e508..73e1e41140d8f 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml @@ -210,7 +210,7 @@ </after> <!-- Go to storefront category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see userInput="From $7.33" selector="{{StorefrontCategoryProductSection.priceFromByProductId($$createBundleProduct.id$$)}}" stepKey="seePriceFromInCategoryBundle1"/> diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php index 9f3d4a908f062..89d8526658f0a 100644 --- a/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/BundleTest.php @@ -21,6 +21,7 @@ use Magento\Catalog\Pricing\Price\RegularPrice; use Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor; use Magento\Framework\DataObject; +use Magento\Framework\Escaper; use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Json\Encoder; use Magento\Framework\Pricing\Amount\AmountInterface; @@ -66,6 +67,11 @@ class BundleTest extends TestCase */ private $bundleBlock; + /** + * @var Escaper|MockObject + */ + private $escaperMock; + protected function setUp(): void { $objectHelper = new ObjectManager($this); @@ -103,6 +109,9 @@ protected function setUp(): void $this->catalogProduct = $this->getMockBuilder(Product::class) ->disableOriginalConstructor() ->getMock(); + $this->escaperMock = $this->getMockBuilder(Escaper::class) + ->disableOriginalConstructor() + ->getMock(); /** @var BundleBlock $bundleBlock */ $this->bundleBlock = $objectHelper->getObject( \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle::class, @@ -111,7 +120,8 @@ protected function setUp(): void 'eventManager' => $this->eventManager, 'jsonEncoder' => $this->jsonEncoder, 'productPrice' => $this->bundleProductPriceFactory, - 'catalogProduct' => $this->catalogProduct + 'catalogProduct' => $this->catalogProduct, + 'escaper' => $this->escaperMock, ] ); @@ -133,16 +143,16 @@ public function testGetOptionHtmlNoRenderer() ->disableOriginalConstructor() ->getMock(); $option->expects($this->any())->method('getType')->willReturn('checkbox'); - + $this->escaperMock->expects($this->once())->method('escapeHtml')->willReturn('checkbox'); + $expected='There is no defined renderer for "checkbox" option type.'; $layout = $this->getMockBuilder(Layout::class) ->setMethods(['getChildName', 'getBlock']) ->disableOriginalConstructor() ->getMock(); $layout->expects($this->any())->method('getChildName')->willReturn(false); $this->bundleBlock->setLayout($layout); - $this->assertEquals( - 'There is no defined renderer for "checkbox" option type.', + $expected, $this->bundleBlock->getOptionHtml($option) ); } diff --git a/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php b/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php index 06d0aed85e496..091dec8e1dc82 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php @@ -31,6 +31,7 @@ use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Api\Data\WebsiteInterface; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use PHPUnit\Framework\MockObject\MockObject; @@ -139,6 +140,11 @@ class LinkManagementTest extends TestCase */ private $linkField = 'product_id'; + /** + * @var WebsiteInterface|MockObject + */ + private $websiteMock; + /** * @inheritDoc */ @@ -203,6 +209,9 @@ protected function setUp(): void $this->dataObjectHelperMock = $this->getMockBuilder(DataObjectHelper::class) ->disableOriginalConstructor() ->getMock(); + + $this->websiteMock = $this->getMockForAbstractClass( WebsiteInterface::class); + $this->model = $helper->getObject( LinkManagement::class, [ @@ -540,7 +549,7 @@ public function testAddChildCouldNotSave() $productLink->method('getOptionId')->willReturn(1); $productLink->method('getSelectionId')->willReturn(1); - $this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField); + $this->metadataMock->expects($this->exactly(2))->method('getLinkField')->willReturn($this->linkField); $productMock = $this->createMock(Product::class); $productMock->expects($this->once()) ->method('getTypeId') @@ -617,7 +626,7 @@ public function testAddChild() $productLink->method('getOptionId')->willReturn(1); $productLink->method('getSelectionId')->willReturn(1); - $this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField); + $this->metadataMock->expects($this->exactly(2))->method('getLinkField')->willReturn($this->linkField); $productMock = $this->createMock(Product::class); $productMock->expects($this->once())->method('getTypeId')->willReturn(Type::TYPE_BUNDLE); $productMock @@ -740,7 +749,7 @@ public function testSaveChild() 'setSelectionPriceType', 'setSelectionPriceValue', 'setSelectionCanChangeQty', - 'setIsDefault' + 'setIsDefault', ] ) ->onlyMethods(['save', 'getId', 'load']) @@ -778,14 +787,19 @@ public function testSaveChildFailedToSave() $productLink->method('getSku')->willReturn('linked_product_sku'); $productLink->method('getId')->willReturn($id); $productLink->method('getSelectionId')->willReturn(1); - $bundleProductSku = 'bundleProductSku'; + $bundleProductSku = 'bundleProductSku'; + $this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField); $productMock = $this->createMock(Product::class); $productMock->expects($this->once()) ->method('getTypeId') ->willReturn(Type::TYPE_BUNDLE); $productMock->method('getId') ->willReturn($parentProductId); + $productMock + ->method('getData') + ->with($this->linkField) + ->willReturn($parentProductId); $linkedProductMock = $this->createMock(Product::class); $linkedProductMock->method('getId')->willReturn($linkProductId); diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php index 27531682b1de2..39b58b75ea46b 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php @@ -95,7 +95,7 @@ public function testLinksList() $this->selectionMock->expects($this->once()) ->method('getSelectionPriceType') ->willReturn('selection_price_type'); - $this->selectionMock->expects($this->once())->method('getSelectionPriceValue')->willReturn(12); + $this->selectionMock->expects($this->exactly(2))->method('getSelectionPriceValue')->willReturn(12); $this->selectionMock->expects($this->once())->method('getData')->willReturn(['some data']); $this->selectionMock->expects($this->once())->method('getSelectionId')->willReturn($selectionId); $this->selectionMock->expects($this->once())->method('getIsDefault')->willReturn(true); diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/Option/BundleSelectionAttributesComparatorTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/Option/BundleSelectionAttributesComparatorTest.php new file mode 100644 index 0000000000000..6502f8b6f57e9 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/Option/BundleSelectionAttributesComparatorTest.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Test\Unit\Model\Quote\Item\Option; + +use Magento\Bundle\Model\Quote\Item\Option\BundleSelectionAttributesComparator; +use Magento\Framework\DataObject; +use Magento\Framework\Serialize\Serializer\Json; +use PHPUnit\Framework\TestCase; + +/** + * Test bundle quote item option comparator + */ +class BundleSelectionAttributesComparatorTest extends TestCase +{ + /** + * @var BundleSelectionAttributesComparator + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->model = new BundleSelectionAttributesComparator( + new Json() + ); + } + + /** + * @param array $option1 + * @param array $option2 + * @param bool $expected + * @dataProvider compareDataProvider + */ + public function testCompare(array $option1, array $option2, bool $expected): void + { + $this->assertEquals($expected, $this->model->compare(new DataObject($option1), new DataObject($option2))); + } + + /** + * @return array + */ + public function compareDataProvider(): array + { + return [ + [ + ['code' => 'test', 'value' => '{"option_id":1,"option_label":"Option 1"}'], + ['code' => 'test', 'value' => '{"option_id":1,"option_label":"Option One"}'], + true + ], + [ + ['code' => 'test', 'value' => '{"option_id":1,"option_label":"Option 1"}'], + ['code' => 'test', 'value' => '{"option_id":2,"option_label":"Option 1"}'], + false + ], + [ + ['code' => 'test', 'value' => '{"option_id":1,"option_label":"Option 1"}'], + ['code' => 'test', 'value' => '{"option_label":"Option 1"}'], + false + ], + ]; + } +} diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/OptionTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/OptionTest.php new file mode 100644 index 0000000000000..1790d31e29c8c --- /dev/null +++ b/app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/OptionTest.php @@ -0,0 +1,210 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Test\Unit\Model\Quote\Item; + +use Magento\Bundle\Model\Option as BundleOption; +use Magento\Bundle\Model\Product\Price; +use Magento\Bundle\Model\Product\Type; +use Magento\Bundle\Model\Quote\Item\Option; +use Magento\Bundle\Model\ResourceModel\Option\Collection as OptionsCollection; +use Magento\Bundle\Model\ResourceModel\Selection\Collection as SelectionsCollection; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface; +use Magento\Framework\Serialize\Serializer\Json; +use PHPUnit\Framework\TestCase; + +/** + * Test bundle product options model + */ +class OptionTest extends TestCase +{ + /** + * @var Option + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->model = new Option( + new Json() + ); + } + + /** + * @param array $customOptions + * @param array $expected + * @dataProvider getSelectionOptionsDataProvider + */ + public function testGetSelectionOptions(array $customOptions, array $expected): void + { + $bundleProduct = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->onlyMethods(['getTypeInstance', 'getPriceModel']) + ->getMock(); + + $typeInstance = $this->createMock(Type::class); + $typeInstance->method('getOptionsByIds') + ->willReturnCallback([$this, 'getOptionsCollectionMock']); + $typeInstance->method('getSelectionsByIds') + ->willReturnCallback([$this, 'getSelectionsCollectionMock']); + + $priceModel = $this->createMock(Price::class); + $priceModel->method('getSelectionFinalTotalPrice') + ->willReturnCallback( + function ($product, $selection) { + return $selection->getSelectionId() * 10 + $product->getId(); + } + ); + + $bundleProduct->method('getTypeInstance') + ->willReturn($typeInstance); + $bundleProduct->method('getPriceModel') + ->willReturn($priceModel); + + $bundleProduct->setCustomOptions($this->getCustomOptions($customOptions)); + $this->assertEquals($expected, $this->model->getSelectionOptions($bundleProduct)); + } + + /** + * @return array + */ + public function getSelectionOptionsDataProvider(): array + { + return [ + [ + [], + [] + ], + [ + [ + 'bundle_option_ids' => '[1,2]', + ], + [] + ], + [ + [ + 'bundle_selection_ids' => '[11,21]', + ], + [] + ], + [ + [ + 'bundle_option_ids' => '[1,2]', + 'bundle_selection_ids' => '[11,21]', + 'selection_qty_11' => '2', + 'selection_qty_21' => '3', + ], + [ + 11 => [ + [ + 'code' => 'bundle_selection_attributes', + 'value' => '{"price":110,"qty":2,"option_label":"Option 1","option_id":1}' + ] + ], + 21 => [ + [ + 'code' => 'bundle_selection_attributes', + 'value' => '{"price":210,"qty":3,"option_label":"Option 2","option_id":2}' + ] + ] + ] + ] + ]; + } + + /** + * @param array $configuration + * @return OptionInterface[] + */ + private function getCustomOptions(array $configuration): array + { + $customOptions = []; + foreach ($configuration as $code => $value) { + $customOptions[$code] = $this->createConfiguredMock( + OptionInterface::class, + [ + 'getValue' => $value + ] + ); + } + + return $customOptions; + } + + /** + * @param array $ids + * @return OptionsCollection + * @throws \ReflectionException + */ + public function getOptionsCollectionMock(array $ids): OptionsCollection + { + $optionsCollection = $this->getMockBuilder(OptionsCollection::class) + ->disableOriginalConstructor() + ->onlyMethods(['load']) + ->getMock(); + + $options = []; + foreach ($ids as $id) { + $option = $this->getMockBuilder(BundleOption::class) + ->disableOriginalConstructor() + ->onlyMethods(['getId', 'getTitle']) + ->getMock(); + + $option->method('getId') + ->willReturn($id); + + $option->method('getTitle') + ->willReturn('Option ' . $id); + + $options[$id] = $option; + } + $reflectionProperty = new \ReflectionProperty($optionsCollection, '_items'); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue($optionsCollection, $options); + + return $optionsCollection; + } + + /** + * @param array $ids + * @return SelectionsCollection + * @throws \ReflectionException + */ + public function getSelectionsCollectionMock(array $ids): SelectionsCollection + { + $selectionsCollection = $this->getMockBuilder(SelectionsCollection::class) + ->disableOriginalConstructor() + ->onlyMethods(['load']) + ->getMock(); + + $selections = []; + foreach ($ids as $id) { + $selection = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->addMethods(['getSelectionId', 'getOptionId']) + ->getMock(); + + $selection->method('getSelectionId') + ->willReturn($id); + + $selection->method('getOptionId') + ->willReturn(intdiv($id, 10)); + + $selections[$id] = $selection; + } + $reflectionProperty = new \ReflectionProperty($selectionsCollection, '_items'); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue($selectionsCollection, $selections); + + return $selectionsCollection; + } +} diff --git a/app/code/Magento/Bundle/Test/Unit/Model/ResourceModel/Indexer/PriceTest.php b/app/code/Magento/Bundle/Test/Unit/Model/ResourceModel/Indexer/PriceTest.php new file mode 100644 index 0000000000000..4cdb3913f96eb --- /dev/null +++ b/app/code/Magento/Bundle/Test/Unit/Model/ResourceModel/Indexer/PriceTest.php @@ -0,0 +1,162 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Test\Unit\Model\ResourceModel\Indexer; + +use Magento\Bundle\Model\ResourceModel\Indexer\Price; +use Magento\Catalog\Model\Indexer\Product\Price\TableMaintainer; +use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\BasePriceModifier; +use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructureFactory; +use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\Query\JoinAttributeProcessor; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\Module\Manager; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Class to test Bundle products Price indexer resource model + */ +class PriceTest extends TestCase +{ + /** + * @var string + */ + private $connectionName = 'test_connection'; + + /** + * @var ResourceConnection|MockObject + */ + private $resourceMock; + + /** + * @var AdapterInterface|MockObject + */ + private $connectionMock; + + /** + * @var Price + */ + private $priceModel; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->connectionMock = $this->createMock(AdapterInterface::class); + $this->resourceMock = $this->createMock(ResourceConnection::class); + $this->resourceMock->method('getConnection') + ->with($this->connectionName) + ->willReturn($this->connectionMock); + $this->resourceMock->method('getTableName')->willReturnArgument(0); + + /** @var IndexTableStructureFactory|MockObject $indexTableStructureFactory */ + $indexTableStructureFactory = $this->createMock(IndexTableStructureFactory::class); + /** @var TableMaintainer|MockObject $tableMaintainer */ + $tableMaintainer = $this->createMock(TableMaintainer::class); + /** @var MetadataPool|MockObject $metadataPool */ + $metadataPool = $this->createMock(MetadataPool::class); + /** @var BasePriceModifier|MockObject $basePriceModifier */ + $basePriceModifier = $this->createMock(BasePriceModifier::class); + /** @var JoinAttributeProcessor|MockObject $joinAttributeProcessor */ + $joinAttributeProcessor = $this->createMock(JoinAttributeProcessor::class); + /** @var ManagerInterface|MockObject $eventManager */ + $eventManager = $this->createMock(ManagerInterface::class); + /** @var Manager|MockObject $moduleManager */ + $moduleManager = $this->createMock(Manager::class); + $fullReindexAction = false; + + $this->priceModel = new Price( + $indexTableStructureFactory, + $tableMaintainer, + $metadataPool, + $this->resourceMock, + $basePriceModifier, + $joinAttributeProcessor, + $eventManager, + $moduleManager, + $fullReindexAction, + $this->connectionName + ); + } + + /** + * Tests create Bundle Price temporary table + */ + public function testGetBundlePriceTable(): void + { + $expectedTmpTableName = 'catalog_product_index_price_bundle_temp'; + $expectedTableName = 'catalog_product_index_price_bundle_tmp'; + + $this->connectionMock->expects($this->once()) + ->method('createTemporaryTableLike') + ->with($expectedTmpTableName, $expectedTableName, true); + + $this->assertEquals( + $expectedTmpTableName, + $this->invokeMethodViaReflection('getBundlePriceTable') + ); + } + + /** + * Tests create Bundle Selection Prices Index temporary table + */ + public function testGetBundleSelectionTable(): void + { + $expectedTmpTableName = 'catalog_product_index_price_bundle_sel_temp'; + $expectedTableName = 'catalog_product_index_price_bundle_sel_tmp'; + + $this->connectionMock->expects($this->once()) + ->method('createTemporaryTableLike') + ->with($expectedTmpTableName, $expectedTableName, true); + + $this->assertEquals( + $expectedTmpTableName, + $this->invokeMethodViaReflection('getBundleSelectionTable') + ); + } + + /** + * Tests create Bundle Option Prices Index temporary table + */ + public function testGetBundleOptionTable(): void + { + $expectedTmpTableName = 'catalog_product_index_price_bundle_opt_temp'; + $expectedTableName = 'catalog_product_index_price_bundle_opt_tmp'; + + $this->connectionMock->expects($this->once()) + ->method('createTemporaryTableLike') + ->with($expectedTmpTableName, $expectedTableName, true); + + $this->assertEquals( + $expectedTmpTableName, + $this->invokeMethodViaReflection('getBundleOptionTable') + ); + } + + /** + * Invoke private method via reflection + * + * @param string $methodName + * @return string + */ + private function invokeMethodViaReflection(string $methodName): string + { + $method = new \ReflectionMethod( + Price::class, + $methodName + ); + $method->setAccessible(true); + + return (string)$method->invoke($this->priceModel); + } +} diff --git a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php index 51563d319dfc8..e12b6fb36aaca 100644 --- a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePanelTest.php @@ -23,6 +23,11 @@ */ class BundlePanelTest extends TestCase { + /** + * @var ObjectManager + */ + private $objectManager; + /** * @var UrlInterface|MockObject */ diff --git a/app/code/Magento/Bundle/etc/di.xml b/app/code/Magento/Bundle/etc/di.xml index 1bb79b4b56d32..17b6d228e88ec 100644 --- a/app/code/Magento/Bundle/etc/di.xml +++ b/app/code/Magento/Bundle/etc/di.xml @@ -241,4 +241,34 @@ </argument> </arguments> </type> + <type name="Magento\Quote\Model\Quote\Item\Option\Comparator"> + <arguments> + <argument name="customComparators" xsi:type="array"> + <item name="bundle_selection_attributes" xsi:type="object">Magento\Bundle\Model\Quote\Item\Option\BundleSelectionAttributesComparator</item> + </argument> + </arguments> + </type> + <type name="Magento\Quote\Model\QuoteManagement"> + <plugin name="update_bundle_quote_item_options" + type="Magento\Bundle\Plugin\Quote\UpdateBundleQuoteItemOptions" + sortOrder="10"/> + </type> + <type name="Magento\Bundle\Model\ProductRelationsProcessorComposite"> + <arguments> + <argument name="processors" xsi:type="array"> + <item name="quote_recollect" xsi:type="object">Magento\Bundle\Model\QuoteRecollectProcessor</item> + </argument> + </arguments> + </type> + <type name="Magento\Bundle\Model\QuoteRecollectProcessor"> + <arguments> + <argument name="comparisonFieldsTypeMapper" xsi:type="array"> + <item name="sku" xsi:type="string">string</item> + <item name="price" xsi:type="string">float</item> + <item name="price_type" xsi:type="string">string</item> + <item name="qty" xsi:type="string">float</item> + <item name="selection_can_change_quantity" xsi:type="string">string</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Bundle/etc/events.xml b/app/code/Magento/Bundle/etc/events.xml index 6c855db2d323b..b2d43a808860d 100644 --- a/app/code/Magento/Bundle/etc/events.xml +++ b/app/code/Magento/Bundle/etc/events.xml @@ -18,4 +18,7 @@ <event name="magento_bundle_model_selection_save_after"> <observer name="legacy_model_save" instance="Magento\Framework\EntityManager\Observer\AfterEntitySave" /> </event> + <event name="magento_bundle_model_selection_save_before"> + <observer name="legacy_model_save" instance="Magento\Framework\EntityManager\Observer\BeforeEntitySave" /> + </event> </config> diff --git a/app/code/Magento/Bundle/etc/frontend/di.xml b/app/code/Magento/Bundle/etc/frontend/di.xml index a6b2b055ffd92..54f5ff0a1f48d 100644 --- a/app/code/Magento/Bundle/etc/frontend/di.xml +++ b/app/code/Magento/Bundle/etc/frontend/di.xml @@ -16,4 +16,10 @@ <type name="Magento\Catalog\Model\Product"> <plugin name="add_bundle_child_identities" type="Magento\Bundle\Model\Plugin\Frontend\ProductIdentitiesExtender" sortOrder="100"/> </type> + <type name="Magento\Catalog\Model\Product\Type\AbstractType"> + <plugin name="add_to_cart_single_option" type="Magento\Bundle\Plugin\Catalog\Model\Product\Type\AbstractType" /> + </type> + <type name="Magento\Catalog\ViewModel\Product\OptionsData"> + <plugin name="add_bundle_options_data" type="Magento\Bundle\Plugin\Catalog\ViewModel\Product\AddBundleOptionsData" /> + </type> </config> diff --git a/app/code/Magento/Bundle/etc/webapi_rest/di.xml b/app/code/Magento/Bundle/etc/webapi_rest/di.xml index 54f6d3b4b0f42..28a236d1fb359 100644 --- a/app/code/Magento/Bundle/etc/webapi_rest/di.xml +++ b/app/code/Magento/Bundle/etc/webapi_rest/di.xml @@ -13,4 +13,8 @@ </argument> </arguments> </type> + <type name="Magento\Bundle\Api\ProductLinkManagementInterface"> + <plugin name="reindex_after_add_child_by_sku" type="Magento\Bundle\Plugin\Api\ProductLinkManagement\ReindexAfterAddChildBySkuPlugin"/> + <plugin name="reindex_after_remove_child" type="Magento\Bundle\Plugin\Api\ProductLinkManagement\ReindexAfterRemoveChildPlugin"/> + </type> </config> diff --git a/app/code/Magento/Bundle/etc/webapi_soap/di.xml b/app/code/Magento/Bundle/etc/webapi_soap/di.xml index 54f6d3b4b0f42..28a236d1fb359 100644 --- a/app/code/Magento/Bundle/etc/webapi_soap/di.xml +++ b/app/code/Magento/Bundle/etc/webapi_soap/di.xml @@ -13,4 +13,8 @@ </argument> </arguments> </type> + <type name="Magento\Bundle\Api\ProductLinkManagementInterface"> + <plugin name="reindex_after_add_child_by_sku" type="Magento\Bundle\Plugin\Api\ProductLinkManagement\ReindexAfterAddChildBySkuPlugin"/> + <plugin name="reindex_after_remove_child" type="Magento\Bundle\Plugin\Api\ProductLinkManagement\ReindexAfterRemoveChildPlugin"/> + </type> </config> diff --git a/app/code/Magento/Bundle/i18n/en_US.csv b/app/code/Magento/Bundle/i18n/en_US.csv index 99ef117fffadb..cf02ca338ad12 100644 --- a/app/code/Magento/Bundle/i18n/en_US.csv +++ b/app/code/Magento/Bundle/i18n/en_US.csv @@ -108,3 +108,4 @@ Type,Type "Cannot create shipment as bundle product ""%1"" has shipment type ""%2"". %3 should be shipped instead.","Cannot create shipment as bundle product ""%1"" has shipment type ""%2"". %3 should be shipped instead." "Bundle product itself","Bundle product itself" "Bundle product options","Bundle product options" +"Product relations processor must implement %1.","Product relations processor must implement %1." diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml index d6637401cff9f..edb6f60634032 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option/selection.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option/selection.phtml index 4ada5496ab5a7..17993545a9730 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option/selection.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option/selection.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Selection */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> diff --git a/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml b/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml index 9bf179e622f17..aaf8fc22d534d 100644 --- a/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml +++ b/app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/summary.phtml @@ -3,10 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -?> -<?php - $_product = $block->getProduct(); +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound +$_product = $block->getProduct(); ?> <?php if ($_product->isSaleable() && $block->hasOptions()) : ?> <div id="bundleSummary" diff --git a/app/code/Magento/BundleGraphQl/etc/graphql/di.xml b/app/code/Magento/BundleGraphQl/etc/graphql/di.xml index 7fe0b2a53677c..caca08d3d4a9b 100644 --- a/app/code/Magento/BundleGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/BundleGraphQl/etc/graphql/di.xml @@ -107,4 +107,11 @@ </argument> </arguments> </type> + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="bundle_product_type_resolver" xsi:type="object">Magento\BundleGraphQl\Model\BundleProductTypeResolver</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/BundleGraphQl/etc/schema.graphqls b/app/code/Magento/BundleGraphQl/etc/schema.graphqls index 8a60eb671b0b6..8c8149133b98b 100644 --- a/app/code/Magento/BundleGraphQl/etc/schema.graphqls +++ b/app/code/Magento/BundleGraphQl/etc/schema.graphqls @@ -72,7 +72,7 @@ type BundleItemOption @doc(description: "BundleItemOption defines characteristic uid: ID! @doc(description: "The unique ID for a `BundleItemOption` object.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\BundleItemOptionUid") } -type BundleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "BundleProduct defines basic features of a bundle product and contains multiple BundleItems.") { +type BundleProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "Defines basic features of a bundle product and contains multiple BundleItems") { price_view: PriceViewEnum @doc(description: "One of PRICE_RANGE or AS_LOW_AS.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\PriceView") dynamic_price: Boolean @doc(description: "Indicates whether the bundle product has a dynamic price.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicPrice") dynamic_sku: Boolean @doc(description: "Indicates whether the bundle product has a dynamic SK.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Product\\Fields\\DynamicSku") diff --git a/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php b/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php index 04384ca71cfbe..9497522e74f15 100644 --- a/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php +++ b/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php @@ -573,8 +573,12 @@ protected function insertOptions() $optionIds = $this->connection->fetchAssoc( $this->connection->select()->from( - $this->_resource->getTableName('catalog_product_bundle_option'), + ['bo' => $this->_resource->getTableName('catalog_product_bundle_option')], ['option_id', 'position', 'parent_id'] + )->joinLeft( + ['bov' => $this->_resource->getTableName('catalog_product_bundle_option_value')], + 'bo.option_id = bov.option_id', + ['title'] )->where( 'parent_id IN (?)', $productIds @@ -600,8 +604,10 @@ protected function populateInsertOptionValues(array $optionIds): array foreach ($this->_cachedOptions as $entityId => $options) { foreach ($options as $key => $option) { foreach ($optionIds as $optionId => $assoc) { - if ($assoc['position'] == $this->_cachedOptions[$entityId][$key]['index'] - && $assoc['parent_id'] == $entityId) { + if ($assoc['position'] == $this->_cachedOptions[$entityId][$key]['index'] && + $assoc['parent_id'] == $entityId && + (empty($assoc['title']) || $assoc['title'] == $this->_cachedOptions[$entityId][$key]['name']) + ) { $option['parent_id'] = $entityId; $optionValues[] = $this->populateOptionValueTemplate($option, $optionId); $this->_cachedOptions[$entityId][$key]['option_id'] = $optionId; diff --git a/app/code/Magento/BundleImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/BundleImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 0000000000000..af7fb0af4685d --- /dev/null +++ b/app/code/Magento/BundleImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Categories --> + <entity name="ImportCategory_Bundle" type="category"> + <data key="name">import-category-bundle</data> + <data key="name_lwr">import-category-bundle</data> + <data key="is_active">true</data> + <data key="include_in_menu">true</data> + <data key="urlKey">import-category-bundle</data> + </entity> + + <!-- Products --> + <entity name="ImportProductSimple1_Bundle" type="product"> + <data key="name">import-product-simple1-bundle</data> + <data key="sku">import-product-simple1-bundle</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">10.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">101</data> + <data key="weight">1</data> + <data key="urlKey">import-product-simple1-bundle</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">magento-logo.png</data> + <data key="smallImageName">magento-logo</data> + <data key="thumbnailImage">magento-logo.png</data> + <data key="thumbnailImageName">magento-logo</data> + <data key="bundleIsDefault">false</data> + <data key="bundleDefaultQuantity">2</data> + <data key="bundleUserDefined">true</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple2_Bundle" type="product"> + <data key="name">import-product-simple2-bundle</data> + <data key="sku">import-product-simple2-bundle</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">20.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">102</data> + <data key="weight">2</data> + <data key="urlKey">import-product-simple2-bundle</data> + <data key="baseImage">m-logo.gif</data> + <data key="baseImageName">m-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">m-logo.gif</data> + <data key="thumbnailImageName">m-logo</data> + <data key="bundleIsDefault">true</data> + <data key="bundleDefaultQuantity">4</data> + <data key="bundleUserDefined">false</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple3_Bundle" type="product"> + <data key="name">import-product-simple3-bundle</data> + <data key="sku">import-product-simple3-bundle</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">30.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">103</data> + <data key="weight">3</data> + <data key="urlKey">import-product-simple3-bundle</data> + <data key="baseImage">adobe-base.jpg</data> + <data key="baseImageName">adobe-base</data> + <data key="smallImage">adobe-base.jpg</data> + <data key="smallImageName">adobe-base</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <data key="bundleIsDefault">false</data> + <data key="bundleDefaultQuantity">3</data> + <data key="bundleUserDefined">false</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProduct_Bundle" type="product"> + <data key="fileName">import_bundle_product.csv</data> + <data key="importSummary">Created: 4, Updated: 0, Deleted: 0</data> + <data key="name">import-product-bundle</data> + <data key="sku">import-product-bundle</data> + <data key="type_id">bundle</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price"/> + <data key="dynamicSkuCheckedValue">true</data> + <data key="dynamicPriceCheckedValue">true</data> + <data key="dynamicWeightCheckedValue">true</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="quantity">0</data> + <data key="weight"/> + <data key="urlKey">import-product-bundle</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <data key="totalBundleOptions">2</data> + <data key="bundleOptionShipmentType">Together</data> + <data key="bundleOption1Title">Bundle Option A</data> + <data key="bundleOption1InputType">radio</data> + <data key="bundleOption1Required">true</data> + <data key="bundleOption1NumberOfProducts">2</data> + <data key="bundleOption2Title">Bundle Option B</data> + <data key="bundleOption2InputType">checkbox</data> + <data key="bundleOption2Required">false</data> + <data key="bundleOption2NumberOfProducts">1</data> + </entity> +</entities> diff --git a/app/code/Magento/BundleImportExport/Test/Mftf/Test/AdminImportBundleProductTest.xml b/app/code/Magento/BundleImportExport/Test/Mftf/Test/AdminImportBundleProductTest.xml new file mode 100644 index 0000000000000..6e28ebb4e673a --- /dev/null +++ b/app/code/Magento/BundleImportExport/Test/Mftf/Test/AdminImportBundleProductTest.xml @@ -0,0 +1,351 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportBundleProductTest"> + <annotations> + <features value="BundleImportExport"/> + <stories value="Import Products"/> + <title value="Import Bundle Product"/> + <description value="Imports a .csv file containing a bundle product. Verifies that product is imported + successfully and can be purchased."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38432"/> + <group value="importExport"/> + <group value="Bundle"/> + </annotations> + + <before> + <!-- Create Product, Upload Images & Create Customer --> + <createData entity="ImportCategory_Bundle" stepKey="createImportCategory"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Copy Images to Import Directory for Product Images --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages"> + <argument name="path">var/import/images/{{ImportProduct_Bundle.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Bundle.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple1_Bundle.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Bundle.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple2_Bundle.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument> + </helper> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Delete Data --> + <deleteData createDataKey="createImportCategory" stepKey="deleteImportCategory"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteProductImageDirectory"> + <argument name="path">var/import/images/{{ImportProduct_Bundle.name}}</argument> + </helper> + <deleteData url="/V1/products/{{ImportProductSimple1_Bundle.urlKey}}" stepKey="deleteImportedSimpleProduct1"/> + <deleteData url="/V1/products/{{ImportProductSimple2_Bundle.urlKey}}" stepKey="deleteImportedSimpleProduct2"/> + <deleteData url="/V1/products/{{ImportProductSimple3_Bundle.urlKey}}" stepKey="deleteImportedSimpleProduct3"/> + <deleteData url="/V1/products/{{ImportProduct_Bundle.urlKey}}" stepKey="deleteImportedBundleProduct"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="navigateToAndResetProductGridToDefaultView"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Bundle Product & Assert No Errors --> + <actionGroup ref="AdminNavigateToImportPageActionGroup" stepKey="navigateToImportPage"/> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Bundle.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Bundle.name}}"/> + </actionGroup> + <actionGroup ref="AdminClickCheckDataImportActionGroup" stepKey="clickCheckData"/> + <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{ImportCommonMessages.validFile}}" stepKey="seeCheckDataResultMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage"/> + <actionGroup ref="AdminClickImportActionGroup" stepKey="clickImport"/> + <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{ImportProduct_Bundle.importSummary}}" stepKey="seeNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.messageByType('success')}}" userInput="{{ImportCommonMessages.success}}" stepKey="seeImportMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage2"/> + + <!-- Reindex --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + + <!-- Admin: Verify Data on Import History Page --> + <actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/> + <actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending"> + <argument name="columnLabel" value="history_id"/> + </actionGroup> + <see userInput="{{ImportProduct_Bundle.fileName}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/> + <see userInput="{{ImportProduct_Bundle.importSummary}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/> + + <!-- Admin: Verify Simple Product 1 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct1EditPage"> + <argument name="product" value="ImportProductSimple1_Bundle"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct1OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple1_Bundle.status}}"/> + <argument name="productAttributeSet" value="{{ImportProductSimple1_Bundle.attributeSetText}}"/> + <argument name="productName" value="{{ImportProductSimple1_Bundle.name}}"/> + <argument name="productSku" value="{{ImportProductSimple1_Bundle.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple1_Bundle.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple1_Bundle.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple1_Bundle.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Bundle.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct1ImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Bundle.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Bundle.baseImageName, 'image')}}" stepKey="seeBaseImageRoleSimple1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct1SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Bundle.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Bundle.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleSimple1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct1ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Bundle.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Bundle.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleSimple1"/> + + <!-- Admin: Verify Simple Product 2 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct2EditPage"> + <argument name="product" value="ImportProductSimple2_Bundle"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct2OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple2_Bundle.status}}"/> + <argument name="productAttributeSet" value="{{ImportProductSimple2_Bundle.attributeSetText}}"/> + <argument name="productName" value="{{ImportProductSimple2_Bundle.name}}"/> + <argument name="productSku" value="{{ImportProductSimple2_Bundle.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple2_Bundle.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple2_Bundle.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple2_Bundle.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Bundle.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct2ImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Bundle.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Bundle.baseImageName, 'image')}}" stepKey="seeBaseImageRoleSimple2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct2SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Bundle.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Bundle.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleSimple2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct2ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Bundle.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Bundle.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleSimple2"/> + + <!-- Admin: Verify Simple Product 3 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct3EditPage"> + <argument name="product" value="ImportProductSimple3_Bundle"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct3OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple3_Bundle.status}}"/> + <argument name="productAttributeSet" value="{{ImportProductSimple3_Bundle.attributeSetText}}"/> + <argument name="productName" value="{{ImportProductSimple3_Bundle.name}}"/> + <argument name="productSku" value="{{ImportProductSimple3_Bundle.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple3_Bundle.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple3_Bundle.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple3_Bundle.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Bundle.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct3ImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Bundle.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Bundle.baseImageName, 'image')}}" stepKey="seeBaseImageRoleSimple3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct3SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Bundle.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Bundle.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleSimple3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertSimpleProduct3ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Bundle.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Bundle.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleSimple3"/> + + <!-- Admin: Verify Bundle Product Common Data on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToBundleProductEditPage"> + <argument name="product" value="ImportProduct_Bundle"/> + </actionGroup> + <actionGroup ref="AdminAssertBundleProductGeneralInfoOnEditPageActionGroup" stepKey="assertBundleProductOnEditPage"> + <argument name="productStatus" value="{{ImportProduct_Bundle.status}}"/> + <argument name="productAttributeSet" value="{{ImportProduct_Bundle.attributeSetText}}"/> + <argument name="productName" value="{{ImportProduct_Bundle.name}}"/> + <argument name="productSku" value="{{ImportProduct_Bundle.sku}}"/> + <argument name="dynamicSku" value="{{ImportProduct_Bundle.dynamicSkuCheckedValue}}"/> + <argument name="productPrice" value="{{ImportProduct_Bundle.price}}"/> + <argument name="dynamicPrice" value="{{ImportProduct_Bundle.dynamicPriceCheckedValue}}"/> + <argument name="productQuantity" value="{{ImportProduct_Bundle.quantity}}"/> + <argument name="productWeight" value="{{ImportProduct_Bundle.weight}}"/> + <argument name="dynamicWeight" value="{{ImportProduct_Bundle.dynamicWeightCheckedValue}}"/> + <argument name="categoryName" value="{{ImportCategory_Bundle.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertBundleProductBaseImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Bundle.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Bundle.baseImageName, 'image')}}" stepKey="seeBaseImageRoleBundle"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertBundleProductSmallImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Bundle.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Bundle.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleBundle"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertBundleProductThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Bundle.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Bundle.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleBundle"/> + + <!-- Admin: Verify Bundle Product Information on Edit Product Page --> + <seeOptionIsSelected userInput="{{ImportProduct_Bundle.bundleOptionShipmentType}}" selector="{{AdminProductFormBundleSection.shipmentType}}" stepKey="seeShipBundleItemsTogether"/> + <seeNumberOfElements userInput="{{ImportProduct_Bundle.totalBundleOptions}}" selector="{{AdminProductFormBundleSection.allBundleOptions}}" stepKey="see2BundleOptionsAdmin"/> + <actionGroup ref="AdminVerifyBundleProductOptionActionGroup" stepKey="verifyBundleProductOption1"> + <argument name="optionTitle" value="{{ImportProduct_Bundle.bundleOption1Title}}"/> + <argument name="inputType" value="{{ImportProduct_Bundle.bundleOption1InputType}}"/> + <argument name="required" value="{{ImportProduct_Bundle.bundleOption1Required}}"/> + <argument name="numberOfProducts" value="{{ImportProduct_Bundle.bundleOption1NumberOfProducts}}"/> + <argument name="index" value="1"/> + </actionGroup> + <actionGroup ref="AdminVerifyProductInBundleProductOptionActionGroup" stepKey="verifyBundleProductOption1Product1"> + <argument name="isDefault" value="{{ImportProductSimple1_Bundle.bundleIsDefault}}"/> + <argument name="name" value="{{ImportProductSimple1_Bundle.name}}"/> + <argument name="sku" value="{{ImportProductSimple1_Bundle.sku}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple1_Bundle.bundleDefaultQuantity}}"/> + <argument name="userDefined" value="{{ImportProductSimple1_Bundle.bundleUserDefined}}"/> + <argument name="optionIndex" value="1"/> + <argument name="productIndex" value="1"/> + </actionGroup> + <actionGroup ref="AdminVerifyProductInBundleProductOptionActionGroup" stepKey="verifyBundleProductOption1Product2"> + <argument name="isDefault" value="{{ImportProductSimple2_Bundle.bundleIsDefault}}"/> + <argument name="name" value="{{ImportProductSimple2_Bundle.name}}"/> + <argument name="sku" value="{{ImportProductSimple2_Bundle.sku}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple2_Bundle.bundleDefaultQuantity}}"/> + <argument name="userDefined" value="{{ImportProductSimple2_Bundle.bundleUserDefined}}"/> + <argument name="optionIndex" value="1"/> + <argument name="productIndex" value="2"/> + </actionGroup> + <actionGroup ref="AdminVerifyBundleProductOptionActionGroup" stepKey="verifyBundleProductOption2"> + <argument name="optionTitle" value="{{ImportProduct_Bundle.bundleOption2Title}}"/> + <argument name="inputType" value="{{ImportProduct_Bundle.bundleOption2InputType}}"/> + <argument name="required" value="{{ImportProduct_Bundle.bundleOption2Required}}"/> + <argument name="numberOfProducts" value="{{ImportProduct_Bundle.bundleOption2NumberOfProducts}}"/> + <argument name="index" value="2"/> + </actionGroup> + <actionGroup ref="AdminVerifyProductInBundleProductOptionActionGroup" stepKey="verifyBundleProductOption2Product1"> + <argument name="isDefault" value="{{ImportProductSimple3_Bundle.bundleIsDefault}}"/> + <argument name="name" value="{{ImportProductSimple3_Bundle.name}}"/> + <argument name="sku" value="{{ImportProductSimple3_Bundle.sku}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple3_Bundle.bundleDefaultQuantity}}"/> + <argument name="userDefined" value="{{ImportProductSimple3_Bundle.bundleUserDefined}}"/> + <argument name="optionIndex" value="2"/> + <argument name="productIndex" value="1"/> + </actionGroup> + + <!-- Storefront: Verify Bundle Product In Category --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="{{ImportCategory_Bundle.name}}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productName}}" userInput="4" stepKey="see4Products"/> + <see userInput="{{ImportProductSimple1_Bundle.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct1"/> + <see userInput="{{ImportProductSimple2_Bundle.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct2"/> + <see userInput="{{ImportProductSimple3_Bundle.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct3"/> + <see userInput="{{ImportProduct_Bundle.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeBundleProduct"/> + + <!-- Storefront: Verify Bundle Product Info & Images --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> + <argument name="productUrl" value="{{ImportProduct_Bundle.urlKey}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Bundle.name}}" stepKey="seeProductName"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Bundle.sku}}" stepKey="seeSku"/> + <see userInput="From $20.00 To $170.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seePrice"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple1_Bundle.baseImageName)}}" stepKey="seeProduct1BaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple2_Bundle.baseImageName)}}" stepKey="seeProduct2BaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple3_Bundle.baseImageName)}}" stepKey="seeProduct3BaseImage"/> + + <!-- Storefront: Verify Default Customization Summary --> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeAndAddToCartButton"/> + <see userInput="$80.00" selector="{{StorefrontBundledSection.bundleProductsPrice}}" stepKey="seeCustomizationPrice"/> + <see userInput="{{ImportProduct_Bundle.bundleOption1Title}}: {{ImportProductSimple2_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple2_Bundle.name}}" selector="{{StorefrontBundledSection.bundleSummary}}" stepKey="seeCustomizationSummary"/> + + <!-- Storefront: Verify Default Bundle Option 1 --> + <seeNumberOfElements userInput="2" selector="{{StorefrontBundledSection.allBundleOptions}}" stepKey="see2TotalBundleOptions"/> + <see userInput="{{ImportProduct_Bundle.bundleOption1Title}}" selector="{{StorefrontBundledSection.nthOptionDiv('1')}}" stepKey="seeOption1Title"/> + <seeElement selector="{{StorefrontBundledSection.bundleOptionRequired('1')}}" stepKey="seeOption1Required"/> + <seeNumberOfElements userInput="2" selector="{{StorefrontBundledSection.allBundleOptionProducts('1')}}" stepKey="see2TotalProductsInBundleOption1"/> + <dontSeeCheckboxIsChecked selector="{{StorefrontBundledSection.bundleOptionInput('1', '1')}}" stepKey="dontSeeOption1Product1Checked"/> + <see userInput="{{ImportProductSimple1_Bundle.name}}" selector="{{StorefrontBundledSection.bundleOptionProductName('1', '1')}}" stepKey="seeOption1Product1Name"/> + <see userInput="+ ${{ImportProductSimple1_Bundle.price}}" selector="{{StorefrontBundledSection.bundleOptionProductPrice('1', '1')}}" stepKey="seeOption1Product1Price"/> + <seeCheckboxIsChecked selector="{{StorefrontBundledSection.bundleOptionInput('1', '2')}}" stepKey="seeOption1Product2Checked"/> + <see userInput="{{ImportProductSimple2_Bundle.name}}" selector="{{StorefrontBundledSection.bundleOptionProductName('1', '2')}}" stepKey="seeOption1Product2Name"/> + <see userInput="+ ${{ImportProductSimple2_Bundle.price}}" selector="{{StorefrontBundledSection.bundleOptionProductPrice('1', '2')}}" stepKey="seeOption1Product2Price"/> + <seeInField userInput="{{ImportProductSimple2_Bundle.bundleDefaultQuantity}}" selector="{{StorefrontBundledSection.bundleOptionQuantity('1')}}" stepKey="seeOption1DefaultQuantity"/> + <seeElement selector="{{StorefrontBundledSection.bundleOptionQuantityDisabled('1')}}" stepKey="seeOption1QuantityDisabled"/> + + <!-- Storefront: Verify Default Bundle Option 2 --> + <see userInput="{{ImportProduct_Bundle.bundleOption2Title}}" selector="{{StorefrontBundledSection.nthOptionDiv('2')}}" stepKey="seeOption2Title"/> + <dontSeeElement selector="{{StorefrontBundledSection.bundleOptionRequired('2')}}" stepKey="seeOption2NotRequired"/> + <seeNumberOfElements userInput="2" selector="{{StorefrontBundledSection.allBundleOptionProducts('1')}}" stepKey="see1TotalProductsInBundleOption2"/> + <dontSeeCheckboxIsChecked selector="{{StorefrontBundledSection.bundleOptionInput('2', '1')}}" stepKey="dontSeeOption2Product1Checked"/> + <see userInput="{{ImportProductSimple3_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple3_Bundle.name}}" selector="{{StorefrontBundledSection.bundleOptionProductName('2', '1')}}" stepKey="seeOption2Product1Name"/> + <see userInput="+ ${{ImportProductSimple3_Bundle.price}}" selector="{{StorefrontBundledSection.bundleOptionProductPrice('2', '1')}}" stepKey="seeOption2Product1Price"/> + <dontSeeElement selector="{{StorefrontBundledSection.bundleOptionQuantity('2')}}" stepKey="dontSeeOption2QuantityInput"/> + + <!-- Storefront: Select Product 1 in Option 1 & Select Option 2 --> + <checkOption selector="{{StorefrontBundledSection.bundleOptionInput('1', '1')}}" stepKey="checkProduct1InOption1"/> + <seeInField userInput="{{ImportProductSimple1_Bundle.bundleDefaultQuantity}}" selector="{{StorefrontBundledSection.bundleOptionQuantity('1')}}" stepKey="seeOption1UpdatedQuantity"/> + <dontSeeElement selector="{{StorefrontBundledSection.bundleOptionQuantityDisabled('1')}}" stepKey="seeOption1QuantityEnabled"/> + <checkOption selector="{{StorefrontBundledSection.bundleOptionInput('2', '1')}}" stepKey="checkOption2"/> + + <!-- Storefront: Verify Updated Customization Summary --> + <see userInput="$110.00" selector="{{StorefrontBundledSection.bundleProductsPrice}}" stepKey="seeCustomizationPrice2"/> + <see userInput="{{ImportProduct_Bundle.bundleOption1Title}}: {{ImportProductSimple1_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple1_Bundle.name}}" selector="{{StorefrontBundledSection.bundleSummary}}" stepKey="seeUpdatedCustomizationSummary"/> + <see userInput="{{ImportProduct_Bundle.bundleOption2Title}}: {{ImportProductSimple3_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple3_Bundle.name}}" selector="{{StorefrontBundledSection.bundleSummary}}" stepKey="seeUpdatedCustomizationSummary2"/> + + <!-- Purchase Bundle Product --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Confirm Purchased Bundle Product --> + <actionGroup ref="StorefrontOpenOrderFromSuccessPageActionGroup" stepKey="openOrderFromSuccessPage"> + <argument name="orderNumber" value="{$grabOrderNumber}"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyCustomerOrderProductRowDataActionGroup" stepKey="verifyProductRow1InOrder"> + <argument name="name" value="{{ImportProduct_Bundle.name}}"/> + <argument name="sku" value="{{ImportProduct_Bundle.sku}}-import-product-simple1- bundle-{{ImportProductSimple3_Bundle.sku}}"/> + <argument name="price" value="$110.00"/> + <argument name="quantity" value="1"/> + <argument name="subtotal" value="$110.00"/> + <argument name="index" value="1"/> + </actionGroup> + <seeNumberOfElements userInput="2" selector="{{StorefrontCustomerOrderViewSection.allProductOptionLabels('1')}}" stepKey="see2ProductOptions"/> + <seeNumberOfElements userInput="2" selector="{{StorefrontCustomerOrderViewSection.allProductOptionProducts('1')}}" stepKey="see2ProductOptionProducts"/> + <actionGroup ref="StorefrontVerifyBundleProductOptionOnOrderActionGroup" stepKey="verifyOrderedOption1"> + <argument name="optionTitle" value="{{ImportProduct_Bundle.bundleOption1Title}}"/> + <argument name="optionProductName" value="{{ImportProductSimple1_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple1_Bundle.name}} ${{ImportProductSimple1_Bundle.price}}"/> + <argument name="optionProductSku" value="{{ImportProductSimple1_Bundle.sku}}"/> + <argument name="optionProductQuantityDescription" value="Ordered {{ImportProductSimple1_Bundle.bundleDefaultQuantity}}"/> + <argument name="productIndex" value="1"/> + <argument name="optionIndex" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyBundleProductOptionOnOrderActionGroup" stepKey="verifyOrderedOption2"> + <argument name="optionTitle" value="{{ImportProduct_Bundle.bundleOption2Title}}"/> + <argument name="optionProductName" value="{{ImportProductSimple3_Bundle.bundleDefaultQuantity}} x {{ImportProductSimple3_Bundle.name}} ${{ImportProductSimple3_Bundle.price}}"/> + <argument name="optionProductSku" value="{{ImportProductSimple3_Bundle.sku}}"/> + <argument name="optionProductQuantityDescription" value="Ordered {{ImportProductSimple3_Bundle.bundleDefaultQuantity}}"/> + <argument name="productIndex" value="1"/> + <argument name="optionIndex" value="2"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml index 6ddce634ec957..68ae4826050a9 100644 --- a/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml +++ b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml @@ -38,9 +38,7 @@ <argument name="importFile" value="catalog_product_import_bundle.csv"/> <argument name="importNoticeMessage" value="Created: 2, Updated: 0, Deleted: 0"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterCreate"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterCreate"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindexAfterCreate"> <argument name="indices" value="catalog_product_price"/> </actionGroup> @@ -60,9 +58,7 @@ <argument name="importFile" value="catalog_product_import_bundle.csv"/> <argument name="importNoticeMessage" value="Created: 0, Updated: 2, Deleted: 0"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterUpdate"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterUpdate"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindexAfterUpdate"/> <!-- Check Bundle product is still visible on the storefront--> diff --git a/app/code/Magento/BundleImportExport/Test/Unit/Model/Import/Product/Type/BundleTest.php b/app/code/Magento/BundleImportExport/Test/Unit/Model/Import/Product/Type/BundleTest.php index fffa4a858f4f8..2d426eb6ca65b 100644 --- a/app/code/Magento/BundleImportExport/Test/Unit/Model/Import/Product/Type/BundleTest.php +++ b/app/code/Magento/BundleImportExport/Test/Unit/Model/Import/Product/Type/BundleTest.php @@ -289,6 +289,7 @@ public function testSaveData($skus, $bunch, $allowImport) 'type' => 'bundle', 'value_id' => '6', 'title' => 'Bundle6', + 'name' => 'Bundle6', 'selections' => [ [ 'name' => 'Bundlen6', diff --git a/app/code/Magento/Captcha/Api/CaptchaConfigPostProcessorInterface.php b/app/code/Magento/Captcha/Api/CaptchaConfigPostProcessorInterface.php new file mode 100644 index 0000000000000..f4d88d424bef1 --- /dev/null +++ b/app/code/Magento/Captcha/Api/CaptchaConfigPostProcessorInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Captcha\Api; + +/** + * Interface contains methods for post processing and modifies client-side CAPTCHA config + */ +interface CaptchaConfigPostProcessorInterface +{ + /** + * Filters the data object by a filter list + * + * @param array $config + * @return array + */ + public function process(array $config): array; +} diff --git a/app/code/Magento/Captcha/Cron/DeleteExpiredImages.php b/app/code/Magento/Captcha/Cron/DeleteExpiredImages.php index cb5f1c4547507..ffe46aa82dd6c 100644 --- a/app/code/Magento/Captcha/Cron/DeleteExpiredImages.php +++ b/app/code/Magento/Captcha/Cron/DeleteExpiredImages.php @@ -6,6 +6,7 @@ namespace Magento\Captcha\Cron; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem\DriverPool; /** * Captcha cron actions @@ -48,7 +49,7 @@ public function __construct( ) { $this->_helper = $helper; $this->_adminHelper = $adminHelper; - $this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); + $this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA, DriverPool::FILE); $this->_storeManager = $storeManager; } diff --git a/app/code/Magento/Captcha/Model/Filter/CaptchaConfigPostProcessorComposite.php b/app/code/Magento/Captcha/Model/Filter/CaptchaConfigPostProcessorComposite.php new file mode 100644 index 0000000000000..182ef8916be59 --- /dev/null +++ b/app/code/Magento/Captcha/Model/Filter/CaptchaConfigPostProcessorComposite.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Captcha\Model\Filter; + +use Magento\Captcha\Api\CaptchaConfigPostProcessorInterface; + +/** + * Composite class for post processing captcha configuration + */ +class CaptchaConfigPostProcessorComposite implements CaptchaConfigPostProcessorInterface +{ + /** + * @var CaptchaConfigPostProcessorInterface[] $processors + */ + private $processors = []; + + /** + * @param CaptchaConfigPostProcessorInterface[] $processors + */ + public function __construct( + $processors = [] + ) { + $this->processors = $processors; + } + + /** + * Loops through all leafs of the composite and calls process method + * + * @param array $config + * @return array + */ + public function process(array $config): array + { + $result = []; + foreach ($this->processors as $processor) { + $result = array_merge_recursive($result, $processor->process($config)); + } + return $result; + } +} diff --git a/app/code/Magento/Captcha/Model/Filter/QuoteDataConfigFilter.php b/app/code/Magento/Captcha/Model/Filter/QuoteDataConfigFilter.php new file mode 100644 index 0000000000000..b90497e9993ed --- /dev/null +++ b/app/code/Magento/Captcha/Model/Filter/QuoteDataConfigFilter.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Captcha\Model\Filter; + +use Magento\Captcha\Api\CaptchaConfigPostProcessorInterface; + +/** + * Class QuoteDataConfigFilter used for filtering config quote data based on filter list + */ +class QuoteDataConfigFilter implements CaptchaConfigPostProcessorInterface +{ + /** + * @var array $filterList + */ + private $filterList; + + /** + * @param array $filterList + */ + public function __construct( + array $filterList = [] + ) { + $this->filterList = $filterList; + } + + /** + * Filters the quote config with values from a filter list + * + * @param array $config + * @return array + */ + public function process(array $config): array + { + foreach ($this->filterList as $filterKey) { + /** @var string $filterKey */ + if (isset($config['quoteData']) && array_key_exists($filterKey, $config['quoteData'])) { + unset($config['quoteData'][$filterKey]); + } + } + return $config; + } +} diff --git a/app/code/Magento/Captcha/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPlugin.php b/app/code/Magento/Captcha/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPlugin.php new file mode 100644 index 0000000000000..660d5acc7586c --- /dev/null +++ b/app/code/Magento/Captcha/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPlugin.php @@ -0,0 +1,65 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Captcha\Plugin; + +use Magento\Captcha\Helper\Data as HelperCaptcha; +use Magento\Captcha\Model\ResourceModel\LogFactory; +use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Api\OrderManagementInterface; + +/** + * Reset attempts for frontend checkout + */ +class ResetPaymentAttemptsAfterOrderIsPlacedPlugin +{ + /** + * Form ID + */ + private const FORM_ID = 'payment_processing_request'; + + /** + * @var HelperCaptcha + */ + private $helper; + + /** + * @var LogFactory + */ + private $resLogFactory; + + /** + * ResetPaymentAttemptsAfterOrderIsPlacedPlugin constructor + * + * @param HelperCaptcha $helper + * @param LogFactory $resLogFactory + */ + public function __construct( + HelperCaptcha $helper, + LogFactory $resLogFactory + ) { + $this->helper = $helper; + $this->resLogFactory = $resLogFactory; + } + + /** + * Reset attempts for frontend checkout + * + * @param OrderManagementInterface $subject + * @param OrderInterface $result + * @param OrderInterface $order + * @return OrderInterface + */ + public function afterPlace( + OrderManagementInterface $subject, + OrderInterface $result, + OrderInterface $order + ): OrderInterface { + $captchaModel = $this->helper->getCaptcha(self::FORM_ID); + $captchaModel->setShowCaptchaInSession(false); + $this->resLogFactory->create()->deleteUserAttempts($order->getCustomerEmail()); + return $result; + } +} diff --git a/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontCheckoutPaymentsWithCaptchaActionGroup.xml b/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontCheckoutPaymentsWithCaptchaActionGroup.xml new file mode 100644 index 0000000000000..f4ad1deaca448 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/ActionGroup/StorefrontCheckoutPaymentsWithCaptchaActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCheckoutPaymentsWithCaptchaActionGroup"> + <arguments> + <argument name="captcha" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCaptchaOnOnepageCheckoutPyamentSection.captchaField}}" userInput="{{captcha}}" stepKey="fillCaptchaField" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Captcha/Test/Mftf/Data/CaptchaConfigData.xml b/app/code/Magento/Captcha/Test/Mftf/Data/CaptchaConfigData.xml index 90f48c320f2ac..995334f2880c0 100644 --- a/app/code/Magento/Captcha/Test/Mftf/Data/CaptchaConfigData.xml +++ b/app/code/Magento/Captcha/Test/Mftf/Data/CaptchaConfigData.xml @@ -46,6 +46,12 @@ <data key="label">Change password</data> <data key="value">user_edit</data> </entity> + <entity name="StorefrontCaptchaOnOnepageCheckoutConfigData"> + <data key="path">customer/captcha/forms</data> + <data key="scope_id">0</data> + <data key="label">Checkout/Placing Order</data> + <data key="value">payment_processing_request</data> + </entity> <entity name="StorefrontCaptchaOnCustomerForgotPasswordConfigData"> <!-- Magento default value --> <data key="path">customer/captcha/forms</data> diff --git a/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCaptchaOnOnepageCheckoutPyamentSection.xml b/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCaptchaOnOnepageCheckoutPyamentSection.xml new file mode 100644 index 0000000000000..5d70666f698a7 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCaptchaOnOnepageCheckoutPyamentSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCaptchaOnOnepageCheckoutPyamentSection"> + <element name="captchaField" type="input" selector="#captcha_payment_processing_request"/> + <element name="captchaImg" type="block" selector=".captcha-img"/> + <element name="captchaReload" type="block" selector=".captcha-reload"/> + </section> +</sections> diff --git a/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCheckoutPaymentMethodsSection.xml b/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCheckoutPaymentMethodsSection.xml new file mode 100644 index 0000000000000..bc13516c00a9b --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCheckoutPaymentMethodsSection.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCheckoutPaymentMethodsSection"> + <element name="purchaseOrder" type="radio" selector="#purchaseorder" timeout="30"/> + <element name="purchaseOrderNumber" type="input" selector="#po_number" timeout="30"/> + <element name="bankTransfer" type="radio" selector="#banktransfer" timeout="30"/> + <element name="cashOnDelivery" type="radio" selector="#cashondelivery" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaWithDisabledGuestCheckoutTest.xml b/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaWithDisabledGuestCheckoutTest.xml index 66183cb31aebc..b44f252fda853 100644 --- a/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaWithDisabledGuestCheckoutTest.xml +++ b/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaWithDisabledGuestCheckoutTest.xml @@ -32,7 +32,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct1"/> </after> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.sku$$)}}" stepKey="openProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> <waitForText userInput="You added $$createSimpleProduct.name$$ to your shopping cart." stepKey="waitForText"/> diff --git a/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaOnOnepageCheckoutPyamentTest.xml b/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaOnOnepageCheckoutPyamentTest.xml new file mode 100644 index 0000000000000..a9b8331716e8e --- /dev/null +++ b/app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaOnOnepageCheckoutPyamentTest.xml @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCaptchaOnOnepageCheckoutPyamentTest"> + <annotations> + <features value="Captcha"/> + <stories value="Place order on checkout page + Captcha"/> + <title value="Captcha on checkout page test"/> + <description value="Test creation of order on storefront checkout page with captcha."/> + <severity value="AVERAGE"/> + <testCaseId value="MC-41461"/> + <useCaseId value="MC-41281"/> + <group value="captcha"/> + </annotations> + <before> + <!-- Create Simple Product --> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> + <field key="price">20</field> + </createData> + + <!-- Create customer --> + <createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/> + + <!-- Enable payment method --> + <magentoCLI command="config:set {{BankTransferEnableConfigData.path}} {{BankTransferEnableConfigData.value}}" stepKey="enableBankTransfer"/> + + <!-- Enable captcha for Checkout/Placing Order --> + <magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}}" stepKey="enableOnOpageCheckoutCaptcha" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAlwaysConfigData.path}} {{StorefrontCustomerCaptchaModeAlwaysConfigData.value}}" stepKey="alwaysEnableCaptcha" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaLength3ConfigData.path}} {{StorefrontCustomerCaptchaLength3ConfigData.value}}" stepKey="setCaptchaLength" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaSymbols1ConfigData.path}} {{StorefrontCustomerCaptchaSymbols1ConfigData.value}}" stepKey="setCaptchaSymbols" /> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </before> + <after> + <!-- Disabled payment method --> + <magentoCLI command="config:set {{BankTransferDisabledConfigData.path}} {{BankTransferDisabledConfigData.value}}" stepKey="disabledBankTransfer"/> + + <!-- Set default configuration for captcha --> + <magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}},{{StorefrontCaptchaOnCustomerForgotPasswordConfigData.value}}" stepKey="enableCaptchaOnDefaultForms" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAfterFailConfigData.path}} {{StorefrontCustomerCaptchaModeAfterFailConfigData.value}}" stepKey="defaultCaptchaMode" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultLengthConfigData.path}} {{StorefrontCustomerCaptchaDefaultLengthConfigData.value}}" stepKey="setDefaultCaptchaLength" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.path}} {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.value}}" stepKey="setDefaultCaptchaSymbols" /> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + + <!-- Customer logout --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + + <!-- Delete created products --> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + + <!-- Delete customer --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + </after> + + <!-- Reindex and flush cache --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> + <argument name="tags" value=""/> + </actionGroup> + + <!-- Add Simple Product to cart --> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> + <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartSimpleProductFromStorefrontProductPage"> + <argument name="productName" value="$$createSimpleProduct.name$$"/> + </actionGroup> + + <!-- Go to shopping cart --> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> + <argument name="address" value="US_Address_CA"/> + </actionGroup> + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/> + + <!-- Login as customer on checkout page --> + <actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="customerLogin"> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- Fill customer new shipping address --> + <actionGroup ref="CustomerCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress"> + <argument name="address" value="US_Address_TX"/> + </actionGroup> + + <!-- Click next button to open payment section --> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + + <!-- Select payment method --> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <click selector="{{StorefrontCheckoutPaymentMethodsSection.bankTransfer}}" stepKey="selectBankTransferMethod"/> + + <!-- Enter captcha value --> + <fillField userInput="{{PreconfiguredCaptcha.value}}" selector="{{StorefrontCaptchaOnOnepageCheckoutPyamentSection.captchaField}}" stepKey="fillCaptchaField" /> + + <!-- Place Order --> + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="customerPlaceOrder"> + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> + </actionGroup> + + <!-- Assert order grand total --> + <amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="navigateToCustomerDashboardPage"/> + <waitForPageLoad stepKey="waitForCustomerDashboardPageLoad"/> + <see selector="{{StorefrontCustomerRecentOrdersSection.orderTotal}}" userInput="$25.00" stepKey="checkOrderTotalInStorefront"/> + </test> +</tests> diff --git a/app/code/Magento/Captcha/Test/Unit/Model/Filter/CaptchaConfigPostProcessorCompositeTest.php b/app/code/Magento/Captcha/Test/Unit/Model/Filter/CaptchaConfigPostProcessorCompositeTest.php new file mode 100644 index 0000000000000..8928857ddfbba --- /dev/null +++ b/app/code/Magento/Captcha/Test/Unit/Model/Filter/CaptchaConfigPostProcessorCompositeTest.php @@ -0,0 +1,87 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Captcha\Test\Unit\Model\Filter; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; +use Magento\Captcha\Api\CaptchaConfigPostProcessorInterface; +use Magento\Captcha\Model\Filter\CaptchaConfigPostProcessorComposite; +use PHPUnit\Framework\MockObject\MockObject; + +/** + * Test for Class \Magento\Captcha\Model\Filter\CaptchaConfigPostProcessorComposite + */ +class CaptchaConfigPostProcessorCompositeTest extends TestCase +{ + /** + * @var CaptchaConfigPostProcessorComposite + */ + private $model; + + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * @var MockObject + */ + private $processorMock1; + + /** + * @var MockObject + */ + private $processorMock2; + + /** + * Initialize Class Dependencies + */ + protected function setUp(): void + { + $this->objectManager = new ObjectManager($this); + + $this->processorMock1 = $this->getMockBuilder(CaptchaConfigPostProcessorInterface::class) + ->disableOriginalConstructor() + ->setMethods(['process']) + ->getMock(); + $this->processorMock2 = $this->getMockBuilder(CaptchaConfigPostProcessorInterface::class) + ->disableOriginalConstructor() + ->setMethods(['process']) + ->getMock(); + + $processors = [$this->processorMock1, $this->processorMock2]; + + $this->model = $this->objectManager->getObject( + CaptchaConfigPostProcessorComposite::class, + [ + 'processors' => $processors, + ] + ); + } + + /** + * Test for Composite + * + * @return void + */ + public function testProcess(): void + { + $config = ['test1','test2', 'test3']; + + $this->processorMock1->expects($this->atLeastOnce()) + ->method('process') + ->with($config) + ->willReturn(['test1', 'test2']); + $this->processorMock2->expects($this->atLeastOnce()) + ->method('process') + ->with($config) + ->willReturn(['test3']); + + $this->assertEquals(['test1','test2', 'test3'], $this->model->process($config)); + } +} diff --git a/app/code/Magento/Captcha/Test/Unit/Model/Filter/QuoteDataConfigFilterTest.php b/app/code/Magento/Captcha/Test/Unit/Model/Filter/QuoteDataConfigFilterTest.php new file mode 100644 index 0000000000000..855a52ab5b831 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Unit/Model/Filter/QuoteDataConfigFilterTest.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Captcha\Test\Unit\Model\Filter; + +use Magento\Captcha\Model\Filter\QuoteDataConfigFilter; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; + +/** + * Test for Class \Magento\Captcha\Model\Filter\QuoteDataConfigFilter + */ +class QuoteDataConfigFilterTest extends TestCase +{ + + /** + * @var QuoteDataConfigFilter + */ + private $model; + + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * Initialize Class Dependencies + */ + protected function setUp(): void + { + $this->objectManager = new ObjectManager($this); + + $this->model = $this->objectManager->getObject( + QuoteDataConfigFilter::class, + [ + 'filterList' => ['test1', 'test2'], + ] + ); + } + + /** + * Test Process method + * + * @return void + */ + public function testProcess(): void + { + $config = [ + 'quoteData' => + [ + 'test1' => 1, + 'test2' => 2, + 'test3' => 3 + ] + ]; + + $expected = [ + 'quoteData' => + [ + 'test3' => 3 + ] + ]; + + $this->assertEquals($expected, $this->model->process($config)); + } +} diff --git a/app/code/Magento/Captcha/Test/Unit/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPluginTest.php b/app/code/Magento/Captcha/Test/Unit/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPluginTest.php new file mode 100644 index 0000000000000..b36063f6ab05b --- /dev/null +++ b/app/code/Magento/Captcha/Test/Unit/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPluginTest.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Captcha\Test\Unit\Plugin; + +use Magento\Captcha\Model\ResourceModel\Log; +use Magento\Captcha\Model\ResourceModel\LogFactory; +use Magento\Captcha\Plugin\ResetPaymentAttemptsAfterOrderIsPlacedPlugin; +use Magento\Captcha\Helper\Data as HelperCaptcha; +use Magento\Captcha\Model\DefaultModel; +use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Api\OrderManagementInterface; +use PHPUnit\Framework\TestCase; + +/** + * Unit test for ResetPaymentAttemptsAfterOrderIsPlacedPluginTest + */ +class ResetPaymentAttemptsAfterOrderIsPlacedPluginTest extends TestCase +{ + /** + * Test that the method resets attempts for frontend checkout + */ + public function testExecuteExpectsDeleteUserAttemptsCalled() + { + $orderManagementInterfaceMock = $this->getMockForAbstractClass(OrderManagementInterface::class); + $resultOrderMock = $this->createMock(OrderInterface::class); + $orderMock = $this->createMock(OrderInterface::class); + $orderMock->expects($this->once())->method('getCustomerEmail')->willReturn('email@example.com'); + $captchaModelMock = $this->createMock(DefaultModel::class); + $captchaModelMock->expects($this->once())->method('setShowCaptchaInSession')->with(false)->willReturnSelf(); + $helperCaptchaMock = $this->createMock(HelperCaptcha::class); + $helperCaptchaMock->expects($this->once())->method('getCaptcha')->willReturn($captchaModelMock); + $logMock = $this->createMock(Log::class); + $logMock->expects($this->once())->method('deleteUserAttempts')->willReturnSelf(); + $resLogFactoryMock = $this->createMock(LogFactory::class); + $resLogFactoryMock->expects($this->once())->method('create')->willReturn($logMock); + $observer = new ResetPaymentAttemptsAfterOrderIsPlacedPlugin($helperCaptchaMock, $resLogFactoryMock); + $observer->afterPlace($orderManagementInterfaceMock, $resultOrderMock, $orderMock); + } +} diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 3c3aa58c3fe2f..5bab62d515460 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -10,11 +10,12 @@ "magento/module-backend": "*", "magento/module-checkout": "*", "magento/module-customer": "*", + "magento/module-sales": "*", "magento/module-store": "*", "magento/module-authorization": "*", - "laminas/laminas-captcha": "^2.7.1", + "laminas/laminas-captcha": "^2.10", "laminas/laminas-db": "^2.8.2", - "laminas/laminas-session": "^2.7.3" + "laminas/laminas-session": "^2.10" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/Captcha/etc/di.xml b/app/code/Magento/Captcha/etc/di.xml index 83c4e8aa1e2c1..5162f13f0a140 100644 --- a/app/code/Magento/Captcha/etc/di.xml +++ b/app/code/Magento/Captcha/etc/di.xml @@ -6,6 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <preference for="Magento\Captcha\Api\CaptchaConfigPostProcessorInterface" type="Magento\Captcha\Model\Filter\CaptchaConfigPostProcessorComposite"/> <type name="Magento\Captcha\Model\DefaultModel"> <arguments> <argument name="session" xsi:type="object">Magento\Customer\Model\Session</argument> @@ -39,4 +40,19 @@ <type name="Magento\Checkout\Block\Cart\Sidebar"> <plugin name="login_captcha" type="Magento\Captcha\Model\Cart\ConfigPlugin" sortOrder="50" /> </type> + <type name="Magento\Captcha\Model\Filter\CaptchaConfigPostProcessorComposite"> + <arguments> + <argument name="processors" xsi:type="array"> + <item name="processor" xsi:type="object">Magento\Captcha\Model\Filter\QuoteDataConfigFilter</item> + </argument> + </arguments> + </type> + <type name="Magento\Captcha\Model\Filter\QuoteDataConfigFilter"> + <arguments> + <argument name="filterList" xsi:type="array"> + <item name="remote_ip" xsi:type="string">remote_ip</item> + <item name="x_forwarded_for" xsi:type="string">x_forwarded_for</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Captcha/etc/frontend/di.xml b/app/code/Magento/Captcha/etc/frontend/di.xml index 490f1eab85196..6ecbb156b44f1 100644 --- a/app/code/Magento/Captcha/etc/frontend/di.xml +++ b/app/code/Magento/Captcha/etc/frontend/di.xml @@ -34,4 +34,7 @@ </argument> </arguments> </type> + <type name="Magento\Sales\Api\OrderManagementInterface"> + <plugin name="reset_payment_attempts_after_order_is_placed_plugin" type="Magento\Captcha\Plugin\ResetPaymentAttemptsAfterOrderIsPlacedPlugin"/> + </type> </config> diff --git a/app/code/Magento/Captcha/etc/frontend/sections.xml b/app/code/Magento/Captcha/etc/frontend/sections.xml index 7f2070e10c8a9..665d989e2294e 100644 --- a/app/code/Magento/Captcha/etc/frontend/sections.xml +++ b/app/code/Magento/Captcha/etc/frontend/sections.xml @@ -10,4 +10,10 @@ <action name="customer/ajax/login"> <section name="captcha"/> </action> + <action name="rest/*/V1/carts/*/payment-information"> + <section name="captcha"/> + </action> + <action name="rest/*/V1/guest-carts/*/payment-information"> + <section name="captcha"/> + </action> </config> diff --git a/app/code/Magento/Captcha/etc/module.xml b/app/code/Magento/Captcha/etc/module.xml index 36a44a6543066..7a7ffc7f460fb 100644 --- a/app/code/Magento/Captcha/etc/module.xml +++ b/app/code/Magento/Captcha/etc/module.xml @@ -10,6 +10,7 @@ <sequence> <module name="Magento_Customer"/> <module name="Magento_Checkout"/> + <module name="Magento_Sales"/> </sequence> </module> </config> diff --git a/app/code/Magento/Captcha/etc/webapi_rest/di.xml b/app/code/Magento/Captcha/etc/webapi_rest/di.xml new file mode 100644 index 0000000000000..7c5efea56a402 --- /dev/null +++ b/app/code/Magento/Captcha/etc/webapi_rest/di.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <type name="Magento\Sales\Api\OrderManagementInterface"> + <plugin name="reset_payment_attempts_after_order_is_placed_plugin" type="Magento\Captcha\Plugin\ResetPaymentAttemptsAfterOrderIsPlacedPlugin"/> + </type> +</config> diff --git a/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml b/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml index e73174d3768df..6336061335d0e 100644 --- a/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml +++ b/app/code/Magento/Captcha/view/adminhtml/templates/default.phtml @@ -9,8 +9,10 @@ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ $captcha = $block->getCaptchaModel(); +/** @var bool $validationEnabled */ +$validationEnabled = $block->hasData('frontend_validation') ? $block->getData('frontend_validation') : true; ?> -<div class="admin__field _required"> +<div class="admin__field<?php if ($validationEnabled): ?> _required<?php endif; ?>"> <label for="captcha" class="admin__field-label"> <span><?= $block->escapeHtml(__('Please enter the letters and numbers from the image')) ?></span> </label> @@ -21,7 +23,7 @@ $captcha = $block->getCaptchaModel(); type="text" name="<?= $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?= $block->escapeHtml($block->getFormId()) ?>]" - data-validate="{required:true}"/> + <?php if ($validationEnabled): ?>data-validate="{required:true}"<?php endif; ?>/> <?php if ($captcha->isCaseSensitive()):?> <div class="admin__field-note"> <span><?= $block->escapeHtml(__('<strong>Attention</strong>: Captcha is case sensitive.'), ['strong']) diff --git a/app/code/Magento/Captcha/view/frontend/templates/default.phtml b/app/code/Magento/Captcha/view/frontend/templates/default.phtml index ead8c590eee94..0d436cc62b790 100644 --- a/app/code/Magento/Captcha/view/frontend/templates/default.phtml +++ b/app/code/Magento/Captcha/view/frontend/templates/default.phtml @@ -8,27 +8,46 @@ /** @var \Magento\Captcha\Model\DefaultModel $captcha */ $captcha = $block->getCaptchaModel(); +/** @var bool $validationEnabled */ +$validationEnabled = $block->hasData('frontend_validation') ? $block->getData('frontend_validation') : true; +$inputName = $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE); +$loaderUrl = $block->escapeUrl($block->getViewFileUrl('images/loader-2.gif')); +$note = $block->escapeHtml(__('<strong>Attention</strong>: Captcha is case sensitive.'), ['strong']); ?> -<div class="field captcha required" role="<?= $block->escapeHtmlAttr($block->getFormId()) ?>"> - <label for="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?= $block->escapeHtml(__('Please type the letters and numbers below')) ?></span></label> +<div class="field captcha<?php if ($validationEnabled): ?> required<?php endif; ?>" + role="<?= $block->escapeHtmlAttr($block->getFormId()) ?>"> + <label for="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"> + <span><?= $block->escapeHtml(__('Please type the letters and numbers below')) ?></span> + </label> <div class="control captcha"> - <input name="<?= $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?= $block->escapeHtmlAttr($block->getFormId()) ?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" autocomplete="off"/> + <input + name="<?= /* @noEscape */ $inputName ?>[<?= $block->escapeHtmlAttr($block->getFormId()) ?>]" + type="text" + class="input-text<?php if ($validationEnabled): ?> required-entry<?php endif; ?>" + <?php if ($validationEnabled): ?>data-validate="{required:true}"<?php endif; ?> + id="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" + autocomplete="off"/> <div class="nested"> <div class="field captcha no-label" data-captcha="<?= $block->escapeHtmlAttr($block->getFormId()) ?>" id="captcha-container-<?= $block->escapeHtmlAttr($block->getFormId()) ?>" data-mage-init='{"captcha":{"url": "<?= $block->escapeUrl($block->getRefreshUrl()) ?>", - "imageLoader": "<?= $block->escapeUrl($block->getViewFileUrl('images/loader-2.gif')) ?>", + "imageLoader": "<?= /* @noEscape */ $loaderUrl ?>", "type": "<?= $block->escapeHtmlAttr($block->getFormId()) ?>"}}'> <div class="control captcha-image"> - <img alt="<?= $block->escapeHtmlAttr(__('Please type the letters and numbers below')) ?>" class="captcha-img" height="<?= /* @noEscape */ (float) $block->getImgHeight() ?>" src="<?= $block->escapeUrl($captcha->getImgSrc()) ?>"/> - <button type="button" class="action reload captcha-reload" title="<?= $block->escapeHtmlAttr(__('Reload captcha')) ?>"><span><?= $block->escapeHtml(__('Reload captcha')) ?></span></button> + <img alt="<?= $block->escapeHtmlAttr(__('Please type the letters and numbers below')) ?>" + class="captcha-img" + height="<?= /* @noEscape */ (float) $block->getImgHeight() ?>" + src="<?= $block->escapeUrl($captcha->getImgSrc()) ?>"/> + <button type="button" + class="action reload captcha-reload" + title="<?= $block->escapeHtmlAttr(__('Reload captcha')) ?>"> + <span><?= $block->escapeHtml(__('Reload captcha')) ?></span> + </button> </div> </div> - <?php if ($captcha->isCaseSensitive()) :?> - <div class="captcha-note note"> - <?= $block->escapeHtml(__('<strong>Attention</strong>: Captcha is case sensitive.'), ['strong']) ?> - </div> + <?php if ($captcha->isCaseSensitive()):?> + <div class="captcha-note note"><?= /* @noEscape */ $note ?></div> <?php endif; ?> </div> </div> diff --git a/app/code/Magento/Captcha/view/frontend/web/js/action/refresh.js b/app/code/Magento/Captcha/view/frontend/web/js/action/refresh.js index c82278269adee..030a990ce2a8f 100644 --- a/app/code/Magento/Captcha/view/frontend/web/js/action/refresh.js +++ b/app/code/Magento/Captcha/view/frontend/web/js/action/refresh.js @@ -4,18 +4,21 @@ */ define([ - 'mage/storage' -], function (storage) { + 'jquery', 'mage/url' +], function ($, urlBuilder) { 'use strict'; return function (refreshUrl, formId, imageSource) { - return storage.post( - refreshUrl, - JSON.stringify({ + return $.ajax({ + url: urlBuilder.build(refreshUrl), + type: 'POST', + async: false, + data: JSON.stringify({ 'formId': formId }), - false - ).done( + global: false, + contentType: 'application/json' + }).done( function (response) { if (response.imgSrc) { imageSource(response.imgSrc); diff --git a/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js b/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js index d79c42a711565..55f3782e78f73 100644 --- a/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js +++ b/app/code/Magento/Captcha/view/frontend/web/js/view/checkout/defaultCaptcha.js @@ -21,6 +21,7 @@ define([ }, dataScope: 'global', currentCaptcha: null, + subscribedFormIds: [], /** * @return {*} @@ -56,7 +57,7 @@ define([ */ checkCustomerData: function (formId, captchaData, captcha) { if (!_.isEmpty(captchaData) && - !_.isEmpty(captchaData)[formId] && + !_.isEmpty(captchaData[formId]) && captchaData[formId].timestamp > captcha.timestamp ) { if (!captcha.isRequired() && captchaData[formId].isRequired) { @@ -74,9 +75,12 @@ define([ * @param {Object} captcha */ subscribeCustomerData: function (formId, captcha) { - customerData.get('captcha').subscribe(function (captchaData) { - this.checkCustomerData(formId, captchaData, captcha); - }.bind(this)); + if (this.subscribedFormIds.includes(formId) === false) { + this.subscribedFormIds.push(formId); + customerData.get('captcha').subscribe(function (captchaData) { + this.checkCustomerData(formId, captchaData, captcha); + }.bind(this)); + } }, /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php index 89239a2e3e608..35f30ed8d3d6b 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php @@ -61,7 +61,7 @@ public function __construct( \Magento\Framework\Data\FormFactory $formFactory, Yesno $yesNo, Data $eavData, - array $disableScopeChangeList = ['sku'], + array $disableScopeChangeList = [], array $data = [] ) { $this->_yesNo = $yesNo; diff --git a/app/code/Magento/Catalog/Block/Navigation.php b/app/code/Magento/Catalog/Block/Navigation.php index 1d4ad5a03619e..be42f9df49656 100644 --- a/app/code/Magento/Catalog/Block/Navigation.php +++ b/app/code/Magento/Catalog/Block/Navigation.php @@ -152,6 +152,8 @@ public function getCacheKeyInfo() $shortCacheId = array_values($shortCacheId); $shortCacheId = implode('|', $shortCacheId); + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $shortCacheId = md5($shortCacheId); $cacheId['category_path'] = $this->getCurrentCategoryKey(); diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php index b181a5392905b..89e81989ab885 100644 --- a/app/code/Magento/Catalog/Block/Product/ListProduct.php +++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php @@ -461,7 +461,7 @@ private function initializeProductCollection() // if the product is associated with any category if ($categories->count()) { // show products from this category - $this->setCategoryId(current($categories->getIterator())->getId()); + $this->setCategoryId($categories->getIterator()->current()->getId()); } } diff --git a/app/code/Magento/Catalog/Block/Product/View/Options.php b/app/code/Magento/Catalog/Block/Product/View/Options.php index c457b20cd0904..26c6bab809927 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options.php @@ -60,6 +60,11 @@ class Options extends \Magento\Framework\View\Element\Template */ protected $_catalogData; + /** + * @var \Magento\Framework\Stdlib\ArrayUtils + */ + private $arrayUtils; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\Pricing\Helper\Data $pricingHelper @@ -93,7 +98,7 @@ public function __construct( * Retrieve product object * * @return Product - * @throws \LogicExceptions + * @throws \LogicException */ public function getProduct() { diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php index af921959f8e27..0f8c978de649c 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php @@ -168,7 +168,10 @@ public function getTimeHtml() $dayPartHtml = $this->_getHtmlSelect( 'day_part' )->setOptions( - ['am' => __('AM'), 'pm' => __('PM')] + [ + 'am' => $this->escapeHtml(__('AM')), + 'pm' => $this->escapeHtml(__('PM')) + ] )->getHtml(); } $hoursHtml = $this->_getSelectFromToHtml('hour', $hourStart, $hourEnd); diff --git a/app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php b/app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php index c5c08a0552f42..93732b1b52f0c 100644 --- a/app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php +++ b/app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php @@ -153,6 +153,7 @@ public function getCurrentProductData() $this->productRenderCollectorComposite ->collect($product, $productRender); $data = $this->hydrator->extract($productRender); + $data['is_available'] = $product->isAvailable(); $currentProductData = [ 'items' => [ diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php index d5fed1782bc62..7a6b71db9dde3 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php @@ -126,6 +126,8 @@ protected function generateCode($label) ); $validatorAttrCode = new \Zend_Validate_Regex(['pattern' => '/^[a-z][a-z_0-9]{0,29}[a-z0-9]$/']); if (!$validatorAttrCode->isValid($code)) { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $code = 'attr_' . ($code ?: substr(md5(time()), 0, 8)); } return $code; diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php index 4ca9d4b0d0606..440716e456910 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php @@ -185,6 +185,9 @@ public function execute() } $attributeId = $this->getRequest()->getParam('attribute_id'); + if (!empty($data['attribute_id']) && $data['attribute_id'] != $attributeId) { + $attributeId = $data['attribute_id']; + } /** @var ProductAttributeInterface $model */ $model = $this->attributeFactory->create(); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php index 1d6939acacfd0..81ab67bdf26dc 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php @@ -102,6 +102,6 @@ private function isAttributeShouldNotBeUpdated(Product $product, array $useDefau { $considerUseDefaultsAttribute = !isset($useDefaults[$attribute]) || $useDefaults[$attribute] === '1'; - return ($value === '' && $considerUseDefaultsAttribute && !$product->getData($attribute)); + return ($value === '' && $considerUseDefaultsAttribute && ($product->getData($attribute) === null)); } } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php index c779c01cd7d71..0edd439230600 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php @@ -9,9 +9,12 @@ namespace Magento\Catalog\Controller\Adminhtml\Product; use Magento\Backend\App\Action\Context; +use Magento\Backend\Model\View\Result\Redirect; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Controller\Adminhtml\Product; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Exception\LocalizedException; use Magento\Ui\Component\MassAction\Filter; @@ -20,7 +23,7 @@ /** * Class \Magento\Catalog\Controller\Adminhtml\Product\MassDelete */ -class MassDelete extends \Magento\Catalog\Controller\Adminhtml\Product implements HttpPostActionInterface +class MassDelete extends Product implements HttpPostActionInterface { /** * Massactions filter @@ -49,8 +52,8 @@ class MassDelete extends \Magento\Catalog\Controller\Adminhtml\Product implement * @param Builder $productBuilder * @param Filter $filter * @param CollectionFactory $collectionFactory - * @param ProductRepositoryInterface $productRepository - * @param LoggerInterface $logger + * @param ProductRepositoryInterface|null $productRepository + * @param LoggerInterface|null $logger */ public function __construct( Context $context, @@ -63,20 +66,23 @@ public function __construct( $this->filter = $filter; $this->collectionFactory = $collectionFactory; $this->productRepository = $productRepository ?: - \Magento\Framework\App\ObjectManager::getInstance()->create(ProductRepositoryInterface::class); + ObjectManager::getInstance()->create(ProductRepositoryInterface::class); $this->logger = $logger ?: - \Magento\Framework\App\ObjectManager::getInstance()->create(LoggerInterface::class); + ObjectManager::getInstance()->create(LoggerInterface::class); parent::__construct($context, $productBuilder); } /** * Mass Delete Action * - * @return \Magento\Backend\Model\View\Result\Redirect + * @return Redirect + * @throws LocalizedException */ public function execute() { $collection = $this->filter->getCollection($this->collectionFactory->create()); + $collection->addMediaGalleryData(); + $productDeleted = 0; $productDeletedError = 0; /** @var \Magento\Catalog\Model\Product $product */ diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Validate.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Validate.php index 77c9cfcd40f05..035b50f3ada50 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Validate.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Validate.php @@ -12,6 +12,9 @@ use Magento\Catalog\Controller\Adminhtml\Product; use Magento\Framework\App\ObjectManager; use Magento\Store\Model\StoreManagerInterface; +use Magento\UrlRewrite\Model\Exception\UrlAlreadyExistsException; +use Magento\CatalogUrlRewrite\Model\Product\Validator as ProductUrlRewriteValidator; +use Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator; /** * Product validate @@ -57,6 +60,16 @@ class Validate extends Product implements HttpPostActionInterface, HttpGetAction */ private $storeManager; + /** + * @var ProductUrlPathGenerator + */ + private $productUrlPathGenerator; + + /** + * @var ProductUrlRewriteValidator + */ + private $productUrlRewriteValidator; + /** * @param Action\Context $context * @param Builder $productBuilder @@ -65,6 +78,8 @@ class Validate extends Product implements HttpPostActionInterface, HttpGetAction * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory * @param \Magento\Framework\View\LayoutFactory $layoutFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param ProductUrlRewriteValidator $productUrlRewriteValidator + * @param ProductUrlPathGenerator $productUrlPathGenerator */ public function __construct( \Magento\Backend\App\Action\Context $context, @@ -73,7 +88,9 @@ public function __construct( \Magento\Catalog\Model\Product\Validator $productValidator, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory, \Magento\Framework\View\LayoutFactory $layoutFactory, - \Magento\Catalog\Model\ProductFactory $productFactory + \Magento\Catalog\Model\ProductFactory $productFactory, + ProductUrlRewriteValidator $productUrlRewriteValidator, + ProductUrlPathGenerator $productUrlPathGenerator ) { $this->_dateFilter = $dateFilter; $this->productValidator = $productValidator; @@ -81,6 +98,8 @@ public function __construct( $this->resultJsonFactory = $resultJsonFactory; $this->layoutFactory = $layoutFactory; $this->productFactory = $productFactory; + $this->productUrlRewriteValidator = $productUrlRewriteValidator; + $this->productUrlPathGenerator = $productUrlPathGenerator; } /** @@ -130,11 +149,22 @@ public function execute() $resource->getAttribute('news_from_date')->setMaxValue($product->getNewsToDate()); $resource->getAttribute('custom_design_from')->setMaxValue($product->getCustomDesignTo()); + if (!$product->getUrlKey()) { + $urlKey = $this->productUrlPathGenerator->getUrlKey($product); + $product->setUrlKey($urlKey); + } + $this->productUrlRewriteValidator->validateUrlKeyConflicts($product); $this->productValidator->validate($product, $this->getRequest(), $response); } catch (\Magento\Eav\Model\Entity\Attribute\Exception $e) { $response->setError(true); $response->setAttribute($e->getAttributeCode()); $response->setMessages([$e->getMessage()]); + } catch (UrlAlreadyExistsException $e) { + $this->messageManager->addExceptionMessage($e); + $layout = $this->layoutFactory->create(); + $layout->initMessages(); + $response->setError(true); + $response->setHtmlMessage($layout->getMessagesBlock()->getGroupedHtml()); } catch (\Magento\Framework\Exception\LocalizedException $e) { $response->setError(true); $response->setMessages([$e->getMessage()]); diff --git a/app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/ConditionProcessor/ConditionBuilder/EavAttributeCondition.php b/app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/ConditionProcessor/ConditionBuilder/EavAttributeCondition.php index e296c8d3b8978..438618d89b43f 100644 --- a/app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/ConditionProcessor/ConditionBuilder/EavAttributeCondition.php +++ b/app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/ConditionProcessor/ConditionBuilder/EavAttributeCondition.php @@ -64,11 +64,11 @@ public function build(Filter $filter): string ->select() ->from( [Collection::MAIN_TABLE_ALIAS => $entityResourceModel->getEntityTable()], - Collection::MAIN_TABLE_ALIAS . '.' . $entityResourceModel->getEntityIdField() + Collection::MAIN_TABLE_ALIAS . '.' . $attribute->getEntityIdField() )->joinLeft( [$tableAlias => $attribute->getBackendTable()], $tableAlias . '.' . $attribute->getEntityIdField() . '=' . Collection::MAIN_TABLE_ALIAS . - '.' . $entityResourceModel->getEntityIdField() . ' AND ' . $tableAlias . '.' . + '.' . $attribute->getEntityIdField() . ' AND ' . $tableAlias . '.' . $attribute->getIdFieldName() . '=' . $attribute->getAttributeId(), '' )->where($tableAlias . '.value is null'); diff --git a/app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php b/app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php index cf194615b1f3b..e58383f7d9bef 100644 --- a/app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php +++ b/app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php @@ -45,6 +45,11 @@ class ScopeOverriddenValue */ private $resourceConnection; + /** + * @var FilterBuilder + */ + private $filterBuilder; + /** * ScopeOverriddenValue constructor. * @param AttributeRepository $attributeRepository diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index 538a721d356d7..981a3d81f0e7d 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1159,7 +1159,10 @@ public function reindex() */ public function afterDeleteCommit() { - $this->reindex(); + if ($this->getIsActive() || $this->getDeletedChildrenIds()) { + $this->reindex(); + } + return parent::afterDeleteCommit(); } diff --git a/app/code/Magento/Catalog/Model/Category/AttributeRepository.php b/app/code/Magento/Catalog/Model/Category/AttributeRepository.php index bde5e08d90994..3243bf718e663 100644 --- a/app/code/Magento/Catalog/Model/Category/AttributeRepository.php +++ b/app/code/Magento/Catalog/Model/Category/AttributeRepository.php @@ -24,6 +24,11 @@ class AttributeRepository implements CategoryAttributeRepositoryInterface */ protected $eavAttributeRepository; + /** + * @var \Magento\Eav\Model\Config + */ + private $eavConfig; + /** * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder * @param \Magento\Framework\Api\FilterBuilder $filterBuilder diff --git a/app/code/Magento/Catalog/Model/Category/FileInfo.php b/app/code/Magento/Catalog/Model/Category/FileInfo.php index f5aec60b2fcc0..adaf9304d8b3c 100644 --- a/app/code/Magento/Catalog/Model/Category/FileInfo.php +++ b/app/code/Magento/Catalog/Model/Category/FileInfo.php @@ -5,12 +5,15 @@ */ namespace Magento\Catalog\Model\Category; +use Magento\Catalog\Model\Category\Media\PathResolverFactory; +use Magento\Catalog\Model\Category\Media\PathResolverInterface; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\File\Mime; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Framework\Filesystem\Directory\ReadInterface; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Filesystem\ExtendedDriverInterface; use Magento\Store\Model\StoreManagerInterface; /** @@ -121,11 +124,15 @@ private function getPubDirectory() */ public function getMimeType($fileName) { - $filePath = $this->getFilePath($fileName); - $absoluteFilePath = $this->getMediaDirectory()->getAbsolutePath($filePath); - - $result = $this->mime->getMimeType($absoluteFilePath); - return $result; + if ($this->getMediaDirectory()->getDriver() instanceof ExtendedDriverInterface) { + return $this->mediaDirectory->getDriver()->getMetadata($fileName)['mimetype']; + } else { + return $this->mime->getMimeType( + $this->getMediaDirectory()->getAbsolutePath( + $this->getFilePath($fileName) + ) + ); + } } /** diff --git a/app/code/Magento/Catalog/Model/Config.php b/app/code/Magento/Catalog/Model/Config.php index c4ff12bbf0f94..3ced479057e0f 100644 --- a/app/code/Magento/Catalog/Model/Config.php +++ b/app/code/Magento/Catalog/Model/Config.php @@ -44,6 +44,11 @@ class Config extends \Magento\Eav\Model\Config */ protected $_productTypesById; + /** + * @var array + */ + private $_productTypesByName; + /** * Array of attributes codes needed for product load * @@ -175,16 +180,6 @@ public function __construct( ); } - /** - * Initialize resource model - * - * @return void - */ - protected function _construct() - { - $this->_init(\Magento\Catalog\Model\ResourceModel\Config::class); - } - /** * Set store id * diff --git a/app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php b/app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php index 0ae128b34d348..aecb3da8fd3d5 100644 --- a/app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php +++ b/app/code/Magento/Catalog/Model/Config/CatalogMediaConfig.php @@ -16,8 +16,8 @@ class CatalogMediaConfig { private const XML_PATH_CATALOG_MEDIA_URL_FORMAT = 'web/url/catalog_media_url_format'; - const IMAGE_OPTIMIZATION_PARAMETERS = 'image_optimization_parameters'; - const HASH = 'hash'; + public const IMAGE_OPTIMIZATION_PARAMETERS = 'image_optimization_parameters'; + public const HASH = 'hash'; /** * @var ScopeConfigInterface @@ -41,10 +41,16 @@ public function __construct(ScopeConfigInterface $scopeConfig) */ public function getMediaUrlFormat($scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null): string { - return $this->scopeConfig->getValue( - CatalogMediaConfig::XML_PATH_CATALOG_MEDIA_URL_FORMAT, + $value = $this->scopeConfig->getValue( + self::XML_PATH_CATALOG_MEDIA_URL_FORMAT, $scopeType, $scopeCode ); + + if ($value === null) { + return self::HASH; + } + + return (string)$value; } } diff --git a/app/code/Magento/Catalog/Model/CustomOptions/CustomOption.php b/app/code/Magento/Catalog/Model/CustomOptions/CustomOption.php index df9961518f479..655602cd8e7be 100644 --- a/app/code/Magento/Catalog/Model/CustomOptions/CustomOption.php +++ b/app/code/Magento/Catalog/Model/CustomOptions/CustomOption.php @@ -17,6 +17,11 @@ class CustomOption extends AbstractExtensibleModel implements CustomOptionInterface { + /** + * @var FileProcessor + */ + private $fileProcessor; + /** * @param Context $context * @param Registry $registry diff --git a/app/code/Magento/Catalog/Model/Design.php b/app/code/Magento/Catalog/Model/Design.php index fed18a5a60913..c22de4f6da488 100644 --- a/app/code/Magento/Catalog/Model/Design.php +++ b/app/code/Magento/Catalog/Model/Design.php @@ -3,12 +3,20 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Catalog\Model; use Magento\Catalog\Model\Category\Attribute\LayoutUpdateManager as CategoryLayoutManager; use Magento\Catalog\Model\Product\Attribute\LayoutUpdateManager as ProductLayoutManager; use Magento\Framework\App\ObjectManager; -use \Magento\Framework\TranslateInterface; +use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Framework\DataObject; +use Magento\Framework\Model\Context; +use Magento\Framework\Model\ResourceModel\AbstractResource; +use Magento\Framework\Registry; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Framework\TranslateInterface; +use Magento\Framework\View\DesignInterface; /** * Catalog Custom Category design Model @@ -28,12 +36,12 @@ class Design extends \Magento\Framework\Model\AbstractModel /** * Design package instance * - * @var \Magento\Framework\View\DesignInterface + * @var DesignInterface */ protected $_design = null; /** - * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface + * @var TimezoneInterface */ protected $_localeDate; @@ -53,12 +61,12 @@ class Design extends \Magento\Framework\Model\AbstractModel private $productLayoutUpdates; /** - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Framework\View\DesignInterface $design - * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource - * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection + * @param Context $context + * @param Registry $registry + * @param TimezoneInterface $localeDate + * @param DesignInterface $design + * @param AbstractResource|null $resource + * @param AbstractDb|null $resourceCollection * @param array $data * @param TranslateInterface|null $translator * @param CategoryLayoutManager|null $categoryLayoutManager @@ -66,12 +74,12 @@ class Design extends \Magento\Framework\Model\AbstractModel * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Framework\View\DesignInterface $design, - \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, - \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, + Context $context, + Registry $registry, + TimezoneInterface $localeDate, + DesignInterface $design, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, array $data = [], TranslateInterface $translator = null, ?CategoryLayoutManager $categoryLayoutManager = null, @@ -104,7 +112,7 @@ public function applyCustomDesign($design) * Get custom layout settings * * @param Category|Product $object - * @return \Magento\Framework\DataObject + * @return DataObject */ public function getDesignSettings($object) { @@ -134,14 +142,17 @@ public function getDesignSettings($object) * Extract custom layout settings from category or product object * * @param Category|Product $object - * @return \Magento\Framework\DataObject + * @return DataObject */ protected function _extractSettings($object) { - $settings = new \Magento\Framework\DataObject(); + $settings = new DataObject(); if (!$object) { return $settings; } + $settings->setPageLayout($object->getPageLayout()); + $settings->setLayoutUpdates((array)$object->getCustomLayoutUpdate()); + $date = $object->getCustomDesignDate(); if (array_key_exists( 'from', @@ -155,28 +166,28 @@ protected function _extractSettings($object) $date['to'] ) ) { - $settings->setCustomDesign( - $object->getCustomDesign() - )->setPageLayout( - $object->getPageLayout() - )->setLayoutUpdates( - (array)$object->getCustomLayoutUpdate() - ); + if ($object->getCustomDesign()) { + $settings->setCustomDesign($object->getCustomDesign()); + } + if ($object->getCustomLayout()) { + $settings->setPageLayout($object->getCustomLayout()); + } if ($object instanceof Category) { $this->categoryLayoutUpdates->extractCustomSettings($object, $settings); } elseif ($object instanceof Product) { $this->productLayoutUpdates->extractCustomSettings($object, $settings); } } + return $settings; } /** * Merge custom design settings * - * @param \Magento\Framework\DataObject $categorySettings - * @param \Magento\Framework\DataObject $productSettings - * @return \Magento\Framework\DataObject + * @param DataObject $categorySettings + * @param DataObject $productSettings + * @return DataObject */ protected function _mergeSettings($categorySettings, $productSettings) { @@ -190,6 +201,21 @@ protected function _mergeSettings($categorySettings, $productSettings) $update = array_merge($categorySettings->getLayoutUpdates(), $productSettings->getLayoutUpdates()); $categorySettings->setLayoutUpdates($update); } + if ($categorySettings->getPageLayoutHandles()) { + $handles = []; + foreach ($categorySettings->getPageLayoutHandles() as $key => $value) { + $handles[$key] = [ + 'handle' => 'catalog_category_view', + 'value' => $value, + ]; + } + $categorySettings->setPageLayoutHandles($handles); + } + if ($productSettings->getPageLayoutHandles()) { + $handle = array_merge($categorySettings->getPageLayoutHandles(), $productSettings->getPageLayoutHandles()); + $categorySettings->setPageLayoutHandles($handle); + } + return $categorySettings; } } diff --git a/app/code/Magento/Catalog/Model/ImageUploader.php b/app/code/Magento/Catalog/Model/ImageUploader.php index 6aff6488164f9..0b987f05d162c 100644 --- a/app/code/Magento/Catalog/Model/ImageUploader.php +++ b/app/code/Magento/Catalog/Model/ImageUploader.php @@ -3,12 +3,12 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Catalog\Model; use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\File\Uploader; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\File\Name; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\WriteInterface; @@ -211,7 +211,7 @@ public function moveFileFromTmp($imageName, $returnRelativePath = false) $baseTmpImagePath = $this->getFilePath($baseTmpPath, $imageName); try { - $this->coreFileStorageDatabase->copyFile( + $this->coreFileStorageDatabase->renameFile( $baseTmpImagePath, $baseImagePath ); diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Manual.php b/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Manual.php index bfa4613127830..ee452b08c43ee 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Manual.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Manual.php @@ -18,6 +18,41 @@ class Manual implements AlgorithmInterface { const XML_PATH_RANGE_MAX_INTERVALS = 'catalog/layered_navigation/price_range_max_intervals'; + /** + * @var Algorithm + */ + private $algorithm; + + /** + * @var \Magento\Catalog\Model\Layer + */ + private $layer; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var Render + */ + private $render; + + /** + * @var Registry + */ + private $coreRegistry; + + /** + * @var Range + */ + private $range; + + /** + * @var Price + */ + private $resource; + /** * @param Algorithm $algorithm * @param Resolver $layerResolver diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index 82d252acd9909..355d5bd36e7d2 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -828,9 +828,6 @@ public function getStoreIds() if (!$this->hasStoreIds()) { $storeIds = []; if ($websiteIds = $this->getWebsiteIds()) { - if (!$this->isObjectNew() && $this->_storeManager->isSingleStoreMode()) { - $websiteIds = array_keys($websiteIds); - } foreach ($websiteIds as $websiteId) { $websiteStores = $this->_storeManager->getWebsite($websiteId)->getStoreIds(); $storeIds[] = $websiteStores; @@ -877,15 +874,17 @@ public function getAttributes($groupId = null, $skipSuper = false) */ public function beforeSave() { - $this->setTypeHasOptions(false); - $this->setTypeHasRequiredOptions(false); - $this->setHasOptions(false); - $this->setRequiredOptions(false); + if ($this->getData('has_options') === null) { + $this->setHasOptions(false); + } + if ($this->getData('required_options') === null) { + $this->setRequiredOptions(false); + } $this->getTypeInstance()->beforeSave($this); - $hasOptions = false; - $hasRequiredOptions = false; + $hasOptions = $this->getData('has_options') === "1"; + $hasRequiredOptions = $this->getData('required_options') === "1"; /** * $this->_canAffectOptions - set by type instance only diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/SaveHandler.php index 9cb2ac0145898..32a417a935e81 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/SaveHandler.php @@ -86,9 +86,11 @@ public function execute($entity, $arguments = []) $identifierField = $this->metadataPoll->getMetadata(ProductInterface::class)->getLinkField(); $priceRows = array_filter($priceRows); $productId = (int) $entity->getData($identifierField); + $pricesStored = $this->getPricesStored($priceRows); + $pricesMerged = $this->mergePrices($priceRows, $pricesStored); // prepare and save data - foreach ($priceRows as $data) { + foreach ($pricesMerged as $data) { $isPriceWebsiteGlobal = (int)$data['website_id'] === 0; if ($isGlobal === $isPriceWebsiteGlobal || !empty($data['price_qty']) @@ -109,4 +111,51 @@ public function execute($entity, $arguments = []) return $entity; } + + /** + * Merge prices + * + * @param array $prices + * @param array $pricesStored + * @return array + */ + private function mergePrices(array $prices, array $pricesStored): array + { + if (!$pricesStored) { + return $prices; + } + $pricesId = []; + $pricesStoredId = []; + foreach ($prices as $price) { + if (isset($price['price_id'])) { + $pricesId[$price['price_id']] = $price; + } + } + foreach ($pricesStored as $price) { + if (isset($price['price_id'])) { + $pricesStoredId[$price['price_id']] = $price; + } + } + $pricesAdd = array_diff_key($pricesStoredId, $pricesId); + foreach ($pricesAdd as $price) { + $prices[] = $price; + } + return $prices; + } + + /** + * Get stored prices + * + * @param array $prices + * @return array + */ + private function getPricesStored(array $prices): array + { + $pricesStored = []; + $price = reset($prices); + if (isset($price['product_id']) && $price['product_id']) { + $pricesStored = $this->tierPriceResource->loadPriceData($price['product_id']); + } + return $pricesStored; + } } diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php b/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php index 4d148f078ae48..a562b3203490c 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Repository.php @@ -126,6 +126,7 @@ public function save(\Magento\Catalog\Api\Data\ProductAttributeInterface $attrib $attribute->setAttributeId($existingModel->getAttributeId()); $attribute->setIsUserDefined($existingModel->getIsUserDefined()); $attribute->setFrontendInput($existingModel->getFrontendInput()); + $attribute->setBackendModel($existingModel->getBackendModel()); $this->updateDefaultFrontendLabel($attribute, $existingModel); } else { diff --git a/app/code/Magento/Catalog/Model/Product/Authorization.php b/app/code/Magento/Catalog/Model/Product/Authorization.php index 4022eb34e65e3..3394b65f9eeb5 100644 --- a/app/code/Magento/Catalog/Model/Product/Authorization.php +++ b/app/code/Magento/Catalog/Model/Product/Authorization.php @@ -129,7 +129,7 @@ private function hasProductChanged(ProductModel $product, ?array $oldProduct = n //No new value continue; } - if (!in_array($newValue, $oldValues, true)) { + if ($newValue !== null && !in_array($newValue, $oldValues, true)) { return true; } } diff --git a/app/code/Magento/Catalog/Model/Product/Configuration/Item/ItemResolverComposite.php b/app/code/Magento/Catalog/Model/Product/Configuration/Item/ItemResolverComposite.php index 68d0877c6cd66..d8cfb2eff264a 100644 --- a/app/code/Magento/Catalog/Model/Product/Configuration/Item/ItemResolverComposite.php +++ b/app/code/Magento/Catalog/Model/Product/Configuration/Item/ItemResolverComposite.php @@ -16,7 +16,7 @@ class ItemResolverComposite implements ItemResolverInterface { /** @var string[] */ - private $itemResolvers = []; + private $itemResolvers; /** @var ItemResolverInterface[] */ private $itemResolversInstances = []; diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php b/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php index 6a1392d776d31..edee9aef508de 100644 --- a/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php @@ -88,9 +88,6 @@ protected function processDeletedImages($product, array &$images) foreach ($images as $image) { if (!empty($image['removed'])) { if (!empty($image['value_id'])) { - if (preg_match('/\.\.(\\\|\/)/', $image['file'])) { - continue; - } $recordsToDelete[] = $image['value_id']; if (!in_array($image['file'], $imagesToNotDelete)) { $imagesToDelete[] = $image['file']; @@ -116,7 +113,8 @@ protected function processDeletedImages($product, array &$images) private function canDeleteImage(string $file): bool { $catalogPath = $this->mediaConfig->getBaseMediaPath(); - return $this->mediaDirectory->isFile($catalogPath . $file) + $filePath = $this->mediaDirectory->getRelativePath($catalogPath . $file); + return $this->mediaDirectory->isFile($filePath) && $this->resourceModel->countImageUses($file) <= 1; } diff --git a/app/code/Magento/Catalog/Model/Product/Option/Repository.php b/app/code/Magento/Catalog/Model/Product/Option/Repository.php index bb4e247de32db..bb0f0c4792235 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Repository.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Repository.php @@ -158,6 +158,7 @@ public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $opt $option->setData('product_id', $product->getData($metadata->getLinkField())); $option->setData('store_id', $product->getStoreId()); + $backedOptions = $option->getValues(); if ($option->getOptionId()) { $options = $product->getOptions(); if (!$options) { @@ -174,6 +175,9 @@ public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $opt } $originalValues = $persistedOption->getValues(); $newValues = $option->getData('values'); + if (!$newValues) { + $newValues = $this->getOptionValues($option); + } if ($newValues) { if (isset($originalValues)) { $newValues = $this->markRemovedValues($newValues, $originalValues); @@ -182,6 +186,8 @@ public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $opt } } $option->save(); + // Required for API response data consistency + $option->setValues($backedOptions); return $option; } @@ -249,4 +255,28 @@ private function getHydratorPool() } return $this->hydratorPool; } + + /** + * Get Option values from property + * + * Gets Option values stored in property, modifies for needed format and clears the property + * + * @param \Magento\Catalog\Api\Data\ProductCustomOptionInterface $option + * @return array|null + */ + private function getOptionValues(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $option): ?array + { + if ($option->getValues() === null) { + return null; + } + + $optionValues = []; + + foreach ($option->getValues() as $optionValue) { + $optionValues[] = $optionValue->getData(); + } + $option->setValues(null); + + return $optionValues; + } } diff --git a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php index 9cb6cda4d0a09..121ff2a5db9b2 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php @@ -7,26 +7,47 @@ namespace Magento\Catalog\Model\Product\Option; +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductCustomOptionRepositoryInterface as OptionRepository; +use Magento\Catalog\Model\Product\Option; +use Magento\Framework\App\ObjectManager; use Magento\Framework\EntityManager\Operation\ExtensionInterface; +use Magento\Catalog\Model\ResourceModel\Product\Relation; +use Magento\Framework\Exception\CouldNotSaveException; /** - * Class SaveHandler + * SaveHandler for product option + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class SaveHandler implements ExtensionInterface { + /** + * @var string[] + */ + private $compositeProductTypes = ['grouped', 'configurable', 'bundle']; + /** * @var OptionRepository */ protected $optionRepository; + /** + * @var Relation + */ + private $relation; + /** * @param OptionRepository $optionRepository + * @param Relation|null $relation */ public function __construct( - OptionRepository $optionRepository + OptionRepository $optionRepository, + ?Relation $relation = null ) { $this->optionRepository = $optionRepository; + $this->relation = $relation ?: ObjectManager::getInstance()->get(Relation::class); } /** @@ -34,7 +55,7 @@ public function __construct( * * @param object $entity * @param array $arguments - * @return \Magento\Catalog\Api\Data\ProductInterface|object + * @return ProductInterface|object * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function execute($entity, $arguments = []) @@ -47,20 +68,19 @@ public function execute($entity, $arguments = []) $optionIds = []; if ($options) { - $optionIds = array_map(function ($option) { - /** @var \Magento\Catalog\Model\Product\Option $option */ + $optionIds = array_map(function (Option $option) { return $option->getOptionId(); }, $options); } - /** @var \Magento\Catalog\Api\Data\ProductInterface $entity */ + /** @var ProductInterface $entity */ foreach ($this->optionRepository->getProductOptions($entity) as $option) { if (!in_array($option->getOptionId(), $optionIds)) { $this->optionRepository->delete($option); } } if ($options) { - $this->processOptionsSaving($options, (bool)$entity->dataHasChangedFor('sku'), (string)$entity->getSku()); + $this->processOptionsSaving($options, (bool)$entity->dataHasChangedFor('sku'), $entity); } return $entity; @@ -71,15 +91,43 @@ public function execute($entity, $arguments = []) * * @param array $options * @param bool $hasChangedSku - * @param string $newSku + * @param ProductInterface $product + * @return void + * @throws CouldNotSaveException */ - private function processOptionsSaving(array $options, bool $hasChangedSku, string $newSku) + private function processOptionsSaving(array $options, bool $hasChangedSku, ProductInterface $product): void { + $isProductHasRelations = $this->isProductHasRelations($product); + /** @var ProductCustomOptionInterface $option */ foreach ($options as $option) { + if (!$isProductHasRelations && $option->getIsRequire()) { + $message = 'Required custom options cannot be added to a simple product' + . ' that is a part of a composite product.'; + throw new CouldNotSaveException(__($message)); + } + if ($hasChangedSku && $option->hasData('product_sku')) { - $option->setProductSku($newSku); + $option->setProductSku($product->getSku()); } $this->optionRepository->save($option); } } + + /** + * Check if product doesn't belong to composite product + * + * @param ProductInterface $product + * @return bool + */ + private function isProductHasRelations(ProductInterface $product): bool + { + $result = true; + if (!in_array($product->getId(), $this->compositeProductTypes) + && $this->relation->getRelationsByChildren([$product->getId()]) + ) { + $result = false; + } + + return $result; + } } diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php b/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php index 934ff48045097..f227e14e6af45 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFile.php @@ -213,7 +213,7 @@ public function validate($processingParams, $option) } } - $fileHash = md5($tmpDirectory->readFile($tmpDirectory->getRelativePath($fileInfo['tmp_name']))); + $fileHash = hash('sha256', $tmpDirectory->readFile($tmpDirectory->getRelativePath($fileInfo['tmp_name']))); $userValue = [ 'type' => $fileInfo['type'], diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php b/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php index 100ad37273cff..43bbe6f673385 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php @@ -125,7 +125,7 @@ public function validate($optionValue, $option) */ protected function buildSecretKey($fileRelativePath) { - return substr(md5($this->rootDirectory->readFile($fileRelativePath)), 0, 20); + return substr(hash('sha256', $this->rootDirectory->readFile($fileRelativePath)), 0, 20); } /** diff --git a/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php b/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php index 83a2d1340794c..a0f6fcf315c7f 100644 --- a/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php +++ b/app/code/Magento/Catalog/Model/Product/Price/SpecialPriceStorage.php @@ -6,12 +6,22 @@ namespace Magento\Catalog\Model\Product\Price; +use Magento\Catalog\Api\Data\SpecialPriceInterface; +use Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory; +use Magento\Catalog\Api\SpecialPriceStorageInterface; +use Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor; +use Magento\Catalog\Model\Product\Price\Validation\Result; +use Magento\Catalog\Model\ProductIdLocatorInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Catalog\Helper\Data; +use Magento\Store\Api\StoreRepositoryInterface; /** * Special price storage presents efficient price API and is used to retrieve, update or delete special prices. + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class SpecialPriceStorage implements \Magento\Catalog\Api\SpecialPriceStorageInterface +class SpecialPriceStorage implements SpecialPriceStorageInterface { /** * @var \Magento\Catalog\Api\SpecialPriceInterface @@ -19,52 +29,59 @@ class SpecialPriceStorage implements \Magento\Catalog\Api\SpecialPriceStorageInt private $specialPriceResource; /** - * @var \Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory + * @var SpecialPriceInterfaceFactory */ private $specialPriceFactory; /** - * @var \Magento\Catalog\Model\ProductIdLocatorInterface + * @var ProductIdLocatorInterface */ private $productIdLocator; /** - * @var \Magento\Store\Api\StoreRepositoryInterface + * @var StoreRepositoryInterface */ private $storeRepository; /** - * @var \Magento\Catalog\Model\Product\Price\Validation\Result + * @var Result */ private $validationResult; /** - * @var \Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor + * @var InvalidSkuProcessor */ private $invalidSkuProcessor; /** * @var array */ - private $allowedProductTypes = []; + private $allowedProductTypes; + + /** + * @var Data + */ + private $catalogData; /** * @param \Magento\Catalog\Api\SpecialPriceInterface $specialPriceResource - * @param \Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory $specialPriceFactory - * @param \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator - * @param \Magento\Store\Api\StoreRepositoryInterface $storeRepository - * @param \Magento\Catalog\Model\Product\Price\Validation\Result $validationResult - * @param \Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor $invalidSkuProcessor - * @param array $allowedProductTypes [optional] + * @param SpecialPriceInterfaceFactory $specialPriceFactory + * @param ProductIdLocatorInterface $productIdLocator + * @param StoreRepositoryInterface $storeRepository + * @param Result $validationResult + * @param InvalidSkuProcessor $invalidSkuProcessor + * @param array $allowedProductTypes + * @param Data|null $catalogData */ public function __construct( \Magento\Catalog\Api\SpecialPriceInterface $specialPriceResource, - \Magento\Catalog\Api\Data\SpecialPriceInterfaceFactory $specialPriceFactory, - \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator, - \Magento\Store\Api\StoreRepositoryInterface $storeRepository, - \Magento\Catalog\Model\Product\Price\Validation\Result $validationResult, - \Magento\Catalog\Model\Product\Price\Validation\InvalidSkuProcessor $invalidSkuProcessor, - array $allowedProductTypes = [] + SpecialPriceInterfaceFactory $specialPriceFactory, + ProductIdLocatorInterface $productIdLocator, + StoreRepositoryInterface $storeRepository, + Result $validationResult, + InvalidSkuProcessor $invalidSkuProcessor, + array $allowedProductTypes = [], + ?Data $catalogData = null ) { $this->specialPriceResource = $specialPriceResource; $this->specialPriceFactory = $specialPriceFactory; @@ -73,10 +90,11 @@ public function __construct( $this->validationResult = $validationResult; $this->invalidSkuProcessor = $invalidSkuProcessor; $this->allowedProductTypes = $allowedProductTypes; + $this->catalogData = $catalogData ?: ObjectManager::getInstance()->get(Data::class); } /** - * {@inheritdoc} + * @inheritdoc */ public function get(array $skus) { @@ -85,7 +103,7 @@ public function get(array $skus) $prices = []; foreach ($rawPrices as $rawPrice) { - /** @var \Magento\Catalog\Api\Data\SpecialPriceInterface $price */ + /** @var SpecialPriceInterface $price */ $price = $this->specialPriceFactory->create(); $sku = isset($rawPrice['sku']) ? $rawPrice['sku'] @@ -102,7 +120,7 @@ public function get(array $skus) } /** - * {@inheritdoc} + * @inheritdoc */ public function update(array $prices) { @@ -113,7 +131,7 @@ public function update(array $prices) } /** - * {@inheritdoc} + * @inheritdoc */ public function delete(array $prices) { @@ -140,52 +158,14 @@ private function retrieveValidPrices(array $prices) foreach ($prices as $key => $price) { if (!$price->getSku() || in_array($price->getSku(), $failedSkus)) { - $this->validationResult->addFailedItem( - $key, - __( - 'The product that was requested doesn\'t exist. Verify the product and try again. ' - . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.', - [ - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ), - [ - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ); + $errorMessage = 'The product that was requested doesn\'t exist. Verify the product and try again. ' + . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.'; + $this->addFailedItemPrice($price, $key, $errorMessage, []); } + $this->checkStore($price, $key); $this->checkPrice($price, $key); $this->checkDate($price, $price->getPriceFrom(), 'Price From', $key); $this->checkDate($price, $price->getPriceTo(), 'Price To', $key); - try { - $this->storeRepository->getById($price->getStoreId()); - } catch (NoSuchEntityException $e) { - $this->validationResult->addFailedItem( - $key, - __( - 'Requested store is not found. ' - . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.', - [ - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ), - [ - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ); - } } foreach ($this->validationResult->getFailedRowIds() as $id) { @@ -195,77 +175,95 @@ private function retrieveValidPrices(array $prices) return $prices; } + /** + * Check that store exists and is global when price scope is global and otherwise add error to aggregator. + * + * @param SpecialPriceInterface $price + * @param int $key + * @return void + */ + private function checkStore(SpecialPriceInterface $price, int $key): void + { + if ($this->catalogData->isPriceGlobal() && $price->getStoreId() !== 0) { + $errorMessage = 'Could not change non global Price when price scope is global. ' + . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.'; + $this->addFailedItemPrice($price, $key, $errorMessage, []); + } + + try { + $this->storeRepository->getById($price->getStoreId()); + } catch (NoSuchEntityException $e) { + $errorMessage = 'Requested store is not found. ' + . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.'; + $this->addFailedItemPrice($price, $key, $errorMessage, []); + } + } + /** * Check that date value is correct and add error to aggregator if it contains incorrect data. * - * @param \Magento\Catalog\Api\Data\SpecialPriceInterface $price + * @param SpecialPriceInterface $price * @param string $value * @param string $label * @param int $key * @return void */ - private function checkDate(\Magento\Catalog\Api\Data\SpecialPriceInterface $price, $value, $label, $key) + private function checkDate(SpecialPriceInterface $price, $value, $label, $key) { if ($value && !$this->isCorrectDateValue($value)) { - $this->validationResult->addFailedItem( - $key, - __( - 'Invalid attribute %label = %priceTo. ' - . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.', - [ - 'label' => $label, - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ), - [ - 'label' => $label, - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ); + $errorMessage = 'Invalid attribute %label = %priceTo. ' + . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.'; + $this->addFailedItemPrice($price, $key, $errorMessage, ['label' => $label]); } } /** - * Check that provided price value is not empty and not lower then zero and add error to aggregator if price + * Check price. + * + * Verify that provided price value is not empty and not lower then zero and add error to aggregator if price * contains not valid data. * - * @param \Magento\Catalog\Api\Data\SpecialPriceInterface $price + * @param SpecialPriceInterface $price * @param int $key * @return void */ - private function checkPrice(\Magento\Catalog\Api\Data\SpecialPriceInterface $price, $key) + private function checkPrice(SpecialPriceInterface $price, int $key): void { if (null === $price->getPrice() || $price->getPrice() < 0) { - $this->validationResult->addFailedItem( - $key, - __( - 'Invalid attribute Price = %price. ' - . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.', - [ - 'price' => $price->getPrice(), - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ), - [ - 'price' => $price->getPrice(), - 'SKU' => $price->getSku(), - 'storeId' => $price->getStoreId(), - 'priceFrom' => $price->getPriceFrom(), - 'priceTo' => $price->getPriceTo() - ] - ); + $errorMessage = 'Invalid attribute Price = %price. ' + . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo.'; + $this->addFailedItemPrice($price, $key, $errorMessage, ['price' => $price->getPrice()]); } } + /** + * Adds failed item price to validation result + * + * @param SpecialPriceInterface $price + * @param int $key + * @param string $message + * @param array $firstParam + * @return void + */ + private function addFailedItemPrice( + SpecialPriceInterface $price, + int $key, + string $message, + array $firstParam + ): void { + $additionalInfo = []; + if ($firstParam) { + $additionalInfo = array_merge($additionalInfo, $firstParam); + } + + $additionalInfo['SKU'] = $price->getSku(); + $additionalInfo['storeId'] = $price->getStoreId(); + $additionalInfo['priceFrom'] = $price->getPriceFrom(); + $additionalInfo['priceTo'] = $price->getPriceTo(); + + $this->validationResult->addFailedItem($key, __($message, $additionalInfo), $additionalInfo); + } + /** * Retrieve SKU by product ID. * diff --git a/app/code/Magento/Catalog/Model/Product/Price/TierPriceFactory.php b/app/code/Magento/Catalog/Model/Product/Price/TierPriceFactory.php index a2e151c1c9624..61f64e7c46958 100644 --- a/app/code/Magento/Catalog/Model/Product/Price/TierPriceFactory.php +++ b/app/code/Magento/Catalog/Model/Product/Price/TierPriceFactory.php @@ -56,6 +56,16 @@ class TierPriceFactory */ private $customerGroupsByCode = []; + /** + * @var \Magento\Framework\Api\SearchCriteriaBuilder + */ + private $searchCriteriaBuilder; + + /** + * @var \Magento\Framework\Api\FilterBuilder + */ + private $filterBuilder; + /** * TierPriceBuilder constructor. * diff --git a/app/code/Magento/Catalog/Model/Product/Price/Validation/InvalidSkuProcessor.php b/app/code/Magento/Catalog/Model/Product/Price/Validation/InvalidSkuProcessor.php index 744fa76ff69b6..b124da7b18d6a 100644 --- a/app/code/Magento/Catalog/Model/Product/Price/Validation/InvalidSkuProcessor.php +++ b/app/code/Magento/Catalog/Model/Product/Price/Validation/InvalidSkuProcessor.php @@ -11,6 +11,16 @@ */ class InvalidSkuProcessor { + /** + * @var \Magento\Catalog\Model\ProductIdLocatorInterface + */ + private $productIdLocator; + + /** + * @var \Magento\Catalog\Api\ProductRepositoryInterface + */ + private $productRepository; + /** * @param \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository diff --git a/app/code/Magento/Catalog/Model/Product/Type.php b/app/code/Magento/Catalog/Model/Product/Type.php index d7dc74e0d0cc3..c2603d475e7d9 100644 --- a/app/code/Magento/Catalog/Model/Product/Type.php +++ b/app/code/Magento/Catalog/Model/Product/Type.php @@ -127,6 +127,8 @@ public function factory($product) $typeModel = $this->_productTypePool->get($typeModelName); $typeModel->setConfig($types[$typeId]); + $typeModel->setTypeId($typeId); + return $typeModel; } diff --git a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php index 19f6461d44b6a..6c08c493e803e 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php +++ b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php @@ -504,21 +504,17 @@ public function processFileQueue() /** @var $uploader \Zend_File_Transfer_Adapter_Http */ $uploader = $queueOptions['uploader'] ?? null; $isUploaded = false; - if ($uploader && $uploader->isValid()) { + if ($uploader && $uploader->isValid($src)) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction $path = pathinfo($dst, PATHINFO_DIRNAME); $uploader = $this->uploaderFactory->create(['fileId' => $src]); $uploader->setFilesDispersion(false); $uploader->setAllowRenameFiles(true); + // phpcs:ignore Magento2.Functions.DiscouragedFunction $isUploaded = $uploader->save($path, pathinfo($dst, PATHINFO_FILENAME)); } if (empty($src) || empty($dst) || !$isUploaded) { - /** - * @todo: show invalid option - */ - if (isset($queueOptions['option'])) { - $queueOptions['option']->setIsValid(false); - } throw new \Magento\Framework\Exception\LocalizedException( __('The file upload failed. Try to upload again.') ); @@ -756,6 +752,9 @@ protected function _removeNotApplicableAttributes($product) */ public function beforeSave($product) { + if (!$product->getTypeId()) { + $product->setTypeId($this->_typeId); + } $this->_removeNotApplicableAttributes($product); $product->canAffectOptions(true); return $this; diff --git a/app/code/Magento/Catalog/Model/Product/Type/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Price.php index 206f3dba0ee60..8956d1d4c95a9 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Price.php @@ -298,7 +298,7 @@ public function getTierPrice($qty, $product) $custGroup = $this->_getCustomerGroupId($product); if ($qty) { - $prevQty = 1; + $prevQty = 0; $prevPrice = $product->getPrice(); $prevGroup = $allGroupsId; diff --git a/app/code/Magento/Catalog/Model/ProductIdLocator.php b/app/code/Magento/Catalog/Model/ProductIdLocator.php index 2d382164f2649..00a4a9751907d 100644 --- a/app/code/Magento/Catalog/Model/ProductIdLocator.php +++ b/app/code/Magento/Catalog/Model/ProductIdLocator.php @@ -124,7 +124,7 @@ public function retrieveProductIdsBySkus(array $skus) private function truncateToLimit() { if (count($this->idsBySku) > $this->idsLimit) { - $this->idsBySku = array_slice($this->idsBySku, round($this->idsLimit / -2)); + $this->idsBySku = array_slice($this->idsBySku, $this->idsLimit * -1, null, true); } } } diff --git a/app/code/Magento/Catalog/Model/ProductRepository.php b/app/code/Magento/Catalog/Model/ProductRepository.php index 5e1de230239b9..fdee74c9559c7 100644 --- a/app/code/Magento/Catalog/Model/ProductRepository.php +++ b/app/code/Magento/Catalog/Model/ProductRepository.php @@ -9,6 +9,7 @@ use Magento\Catalog\Api\CategoryLinkManagementInterface; use Magento\Catalog\Api\Data\ProductExtension; use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Attribute\ScopeOverriddenValue; use Magento\Catalog\Model\Product\Gallery\MimeTypeExtensionMap; use Magento\Catalog\Model\ProductRepository\MediaGalleryProcessor; use Magento\Catalog\Model\ResourceModel\Product\Collection; @@ -181,6 +182,11 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa */ private $linkManagement; + /** + * @var ScopeOverriddenValue + */ + private $scopeOverriddenValue; + /** * ProductRepository constructor. * @param ProductFactory $productFactory @@ -208,6 +214,7 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa * @param int $cacheLimit [optional] * @param ReadExtensions $readExtensions * @param CategoryLinkManagementInterface $linkManagement + * @param ScopeOverriddenValue|null $scopeOverriddenValue * @SuppressWarnings(PHPMD.ExcessiveParameterList) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -236,7 +243,8 @@ public function __construct( \Magento\Framework\Serialize\Serializer\Json $serializer = null, $cacheLimit = 1000, ReadExtensions $readExtensions = null, - CategoryLinkManagementInterface $linkManagement = null + CategoryLinkManagementInterface $linkManagement = null, + ?ScopeOverriddenValue $scopeOverriddenValue = null ) { $this->productFactory = $productFactory; $this->collectionFactory = $collectionFactory; @@ -263,6 +271,8 @@ public function __construct( ->get(ReadExtensions::class); $this->linkManagement = $linkManagement ?: \Magento\Framework\App\ObjectManager::getInstance() ->get(CategoryLinkManagementInterface::class); + $this->scopeOverriddenValue = $scopeOverriddenValue ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(ScopeOverriddenValue::class); } /** @@ -599,6 +609,12 @@ public function save(ProductInterface $product, $saveOptions = false) && !$attribute->isStatic() && !array_key_exists($attributeCode, $productDataToChange) && $value !== null + && !$this->scopeOverriddenValue->containsValue( + ProductInterface::class, + $product, + $attributeCode, + $product->getStoreId() + ) ) { $product->setData($attributeCode); $hasDataChanged = true; @@ -914,7 +930,8 @@ private function joinPositionField( foreach ($searchCriteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { if ($filter->getField() === 'category_id') { - $categoryIds[] = explode(',', $filter->getValue()); + $filterValue = $filter->getValue(); + $categoryIds[] = is_array($filterValue) ? $filterValue : explode(',', $filterValue); } } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category.php b/app/code/Magento/Catalog/Model/ResourceModel/Category.php index ed2df0f10ac3b..18f38f7d2bc24 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Category.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Category.php @@ -232,7 +232,10 @@ protected function _beforeDelete(\Magento\Framework\DataObject $object) */ protected function _afterDelete(DataObject $object) { - $this->indexerProcessor->markIndexerAsInvalid(); + if ($object->getIsActive() || $object->getDeletedChildrenIds()) { + $this->indexerProcessor->markIndexerAsInvalid(); + } + return parent::_afterDelete($object); } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/MediaImageDeleteProcessor.php b/app/code/Magento/Catalog/Model/ResourceModel/MediaImageDeleteProcessor.php new file mode 100644 index 0000000000000..f49ddef01ca74 --- /dev/null +++ b/app/code/Magento/Catalog/Model/ResourceModel/MediaImageDeleteProcessor.php @@ -0,0 +1,146 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\ResourceModel; + +use Exception; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Product\Gallery\Processor; +use Magento\Catalog\Model\Product\Media\ConfigInterface as MediaConfig; +use Magento\Catalog\Model\ResourceModel\Product\Gallery; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\DataObject; +use Magento\Framework\Exception\FileSystemException; +use Magento\Framework\Filesystem; +use Psr\Log\LoggerInterface; + +/** + * Process media gallery and delete media image after product delete + */ +class MediaImageDeleteProcessor +{ + /** + * @var MediaConfig + */ + private $imageConfig; + + /** + * @var Filesystem + */ + private $mediaDirectory; + + /** + * @var Processor + */ + private $imageProcessor; + + /** + * @var Gallery + */ + private $productGallery; + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * Product constructor. + * + * @param MediaConfig $imageConfig + * @param Filesystem $filesystem + * @param Processor $imageProcessor + * @param Gallery $productGallery + * @param LoggerInterface $logger + * @throws FileSystemException + */ + public function __construct( + MediaConfig $imageConfig, + Filesystem $filesystem, + Processor $imageProcessor, + Gallery $productGallery, + LoggerInterface $logger + ) { + $this->imageConfig = $imageConfig; + $this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); + $this->imageProcessor = $imageProcessor; + $this->productGallery = $productGallery; + $this->logger = $logger; + } + + /** + * Process $product data and remove image from gallery after product delete + * + * @param DataObject $product + * @return void + */ + public function execute(DataObject $product): void + { + try { + $productImages = $product->getMediaGalleryImages(); + foreach ($productImages as $image) { + $imageFile = $image->getFile(); + if ($imageFile) { + $this->deleteProductImage($image, $product, $imageFile); + } + } + } catch (Exception $e) { + $this->logger->critical($e); + } + } + + /** + * Check if image exists and is not used by any other products + * + * @param string $file + * @return bool + */ + private function canDeleteImage(string $file): bool + { + return $this->productGallery->countImageUses($file) <= 1; + } + + /** + * Delete the physical image if it's existed and not used by other products + * + * @param string $imageFile + * @param string $filePath + * @throws FileSystemException + */ + private function deletePhysicalImage(string $imageFile, string $filePath): void + { + if ($this->canDeleteImage($imageFile)) { + $this->mediaDirectory->delete($filePath); + } + } + + /** + * Remove product image + * + * @param DataObject $image + * @param ProductInterface $product + * @param string $imageFile + */ + private function deleteProductImage( + DataObject $image, + ProductInterface $product, + string $imageFile + ): void { + $catalogPath = $this->imageConfig->getBaseMediaPath(); + $filePath = $catalogPath . $imageFile; + + if ($this->mediaDirectory->isFile($filePath)) { + try { + $this->productGallery->deleteGallery($image->getValueId()); + $this->imageProcessor->removeImage($product, $imageFile); + $this->deletePhysicalImage($imageFile, $filePath); + } catch (Exception $e) { + $this->logger->critical($e); + } + } + } +} diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product.php b/app/code/Magento/Catalog/Model/ResourceModel/Product.php index b174e4beb6353..b3c50015d9dbf 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product.php @@ -100,6 +100,11 @@ class Product extends AbstractResource */ private $eavAttributeManagement; + /** + * @var MediaImageDeleteProcessor + */ + private $mediaImageDeleteProcessor; + /** * @param \Magento\Eav\Model\Entity\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -114,6 +119,7 @@ class Product extends AbstractResource * @param TableMaintainer|null $tableMaintainer * @param UniqueValidationInterface|null $uniqueValidator * @param AttributeManagementInterface|null $eavAttributeManagement + * @param MediaImageDeleteProcessor|null $mediaImageDeleteProcessor * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -129,7 +135,8 @@ public function __construct( $data = [], TableMaintainer $tableMaintainer = null, UniqueValidationInterface $uniqueValidator = null, - AttributeManagementInterface $eavAttributeManagement = null + AttributeManagementInterface $eavAttributeManagement = null, + ?MediaImageDeleteProcessor $mediaImageDeleteProcessor = null ) { $this->_categoryCollectionFactory = $categoryCollectionFactory; $this->_catalogCategory = $catalogCategory; @@ -148,6 +155,8 @@ public function __construct( $this->tableMaintainer = $tableMaintainer ?: ObjectManager::getInstance()->get(TableMaintainer::class); $this->eavAttributeManagement = $eavAttributeManagement ?? ObjectManager::getInstance()->get(AttributeManagementInterface::class); + $this->mediaImageDeleteProcessor = $mediaImageDeleteProcessor + ?? ObjectManager::getInstance()->get(MediaImageDeleteProcessor::class); } /** @@ -819,4 +828,16 @@ protected function getAttributeRow($entity, $object, $attribute) $data['store_id'] = $object->getStoreId(); return $data; } + + /** + * After delete entity process + * + * @param DataObject $object + * @return $this + */ + protected function _afterDelete(DataObject $object) + { + $this->mediaImageDeleteProcessor->execute($object); + return parent::_afterDelete($object); + } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Attribute/Backend/Tierprice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Attribute/Backend/Tierprice.php index e3edc4a0dc48e..b310f6e68774f 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Attribute/Backend/Tierprice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Attribute/Backend/Tierprice.php @@ -35,6 +35,7 @@ protected function _loadPriceDataColumns($columns) $columns = parent::_loadPriceDataColumns($columns); $columns['price_qty'] = 'qty'; $columns['percentage_value'] = 'percentage_value'; + $columns['product_id'] = $this->getProductIdFieldName(); return $columns; } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculator.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculator.php index 85ee8360b7127..664ed9ead16db 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculator.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculator.php @@ -43,10 +43,10 @@ class BatchSizeCalculator private const DEPLOYMENT_CONFIG_INDEXER_BATCHES = 'indexer/batch_size/'; /** - * BatchSizeCalculator constructor. * @param array $batchRowsCount * @param array $estimators * @param array $batchSizeAdjusters + * @param DeploymentConfig|null $deploymentConfig */ public function __construct( array $batchRowsCount, diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/CompositeProductRelationsCalculator.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/CompositeProductRelationsCalculator.php index d03c0c51703a9..730fba32c0998 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/CompositeProductRelationsCalculator.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/CompositeProductRelationsCalculator.php @@ -11,6 +11,11 @@ */ class CompositeProductRelationsCalculator { + /** + * @var DefaultPrice + */ + private $indexerResource; + /** * @param DefaultPrice $indexerResource */ diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php index 77407ed699fbd..be1d1637b8532 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php @@ -128,6 +128,11 @@ public function getQuery(array $dimensions, string $productType, array $entityId ['cwd' => $this->getTable('catalog_product_index_website')], 'pw.website_id = cwd.website_id', [] + )->joinLeft( + // customer group website limitations + ['cgw' => $this->getTable('customer_group_excluded_website')], + 'cg.customer_group_id = cgw.customer_group_id AND pw.website_id = cgw.website_id', + [] )->joinLeft( // we need this only for BCC in case someone expects table `tp` to be present in query ['tp' => $this->getTable('catalog_product_index_tier_price')], @@ -227,6 +232,9 @@ public function getQuery(array $dimensions, string $productType, array $entityId $select->where('e.entity_id IN(?)', $entityIds); } + // exclude websites that are limited for customer group + $select->where('cgw.website_id IS NULL'); + /** * throw event for backward compatibility */ diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php index 7eb19193f8bdd..448b3769c7157 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Price/SpecialPrice.php @@ -6,10 +6,18 @@ namespace Magento\Catalog\Model\ResourceModel\Product\Price; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\SpecialPriceInterface; +use Magento\Catalog\Model\ProductIdLocatorInterface; +use Magento\Catalog\Model\ResourceModel\Attribute; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\Exception\CouldNotDeleteException; +use Magento\Framework\App\ObjectManager; + /** * Special price resource. */ -class SpecialPrice implements \Magento\Catalog\Api\SpecialPriceInterface +class SpecialPrice implements SpecialPriceInterface { /** * Price storage table. @@ -26,24 +34,24 @@ class SpecialPrice implements \Magento\Catalog\Api\SpecialPriceInterface private $datetimeTable = 'catalog_product_entity_datetime'; /** - * @var \Magento\Catalog\Model\ResourceModel\Attribute + * @var Attribute */ private $attributeResource; /** - * @var \Magento\Catalog\Api\ProductAttributeRepositoryInterface + * @var ProductAttributeRepositoryInterface */ private $attributeRepository; /** - * @var \Magento\Catalog\Model\ProductIdLocatorInterface + * @var ProductIdLocatorInterface */ private $productIdLocator; /** * Metadata pool. * - * @var \Magento\Framework\EntityManager\MetadataPool + * @var MetadataPool */ private $metadataPool; @@ -76,16 +84,16 @@ class SpecialPrice implements \Magento\Catalog\Api\SpecialPriceInterface private $itemsPerOperation = 500; /** - * @param \Magento\Catalog\Model\ResourceModel\Attribute $attributeResource - * @param \Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository - * @param \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator - * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool + * @param Attribute $attributeResource + * @param ProductAttributeRepositoryInterface $attributeRepository + * @param ProductIdLocatorInterface $productIdLocator + * @param MetadataPool $metadataPool */ public function __construct( - \Magento\Catalog\Model\ResourceModel\Attribute $attributeResource, - \Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository, - \Magento\Catalog\Model\ProductIdLocatorInterface $productIdLocator, - \Magento\Framework\EntityManager\MetadataPool $metadataPool + Attribute $attributeResource, + ProductAttributeRepositoryInterface $attributeRepository, + ProductIdLocatorInterface $productIdLocator, + MetadataPool $metadataPool ) { $this->attributeResource = $attributeResource; $this->attributeRepository = $attributeRepository; @@ -94,7 +102,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function get(array $skus) { @@ -132,7 +140,7 @@ public function get(array $skus) } /** - * {@inheritdoc} + * @inheritdoc */ public function update(array $prices) { @@ -187,49 +195,63 @@ public function update(array $prices) } /** - * {@inheritdoc} + * @inheritdoc */ public function delete(array $prices) { - $skus = array_unique( - array_map(function ($price) { - return $price->getSku(); - }, $prices) - ); - $ids = $this->retrieveAffectedIds($skus); $connection = $this->attributeResource->getConnection(); - $connection->beginTransaction(); - try { - foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) { - $this->attributeResource->getConnection()->delete( - $this->attributeResource->getTable($this->priceTable), - [ - 'attribute_id = ?' => $this->getPriceAttributeId(), - $this->getEntityLinkField() . ' IN (?)' => $idsBunch - ] - ); - } - foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) { - $this->attributeResource->getConnection()->delete( - $this->attributeResource->getTable($this->datetimeTable), - [ - 'attribute_id IN (?)' => [$this->getPriceFromAttributeId(), $this->getPriceToAttributeId()], - $this->getEntityLinkField() . ' IN (?)' => $idsBunch - ] - ); + + foreach ($this->getStoreSkus($prices) as $storeId => $skus) { + + $ids = $this->retrieveAffectedIds(array_unique($skus)); + $connection->beginTransaction(); + try { + foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) { + $connection->delete( + $this->attributeResource->getTable($this->priceTable), + [ + 'attribute_id = ?' => $this->getPriceAttributeId(), + 'store_id = ?' => $storeId, + $this->getEntityLinkField() . ' IN (?)' => $idsBunch + ] + ); + } + foreach (array_chunk($ids, $this->itemsPerOperation) as $idsBunch) { + $connection->delete( + $this->attributeResource->getTable($this->datetimeTable), + [ + 'attribute_id IN (?)' => [$this->getPriceFromAttributeId(), $this->getPriceToAttributeId()], + 'store_id = ?' => $storeId, + $this->getEntityLinkField() . ' IN (?)' => $idsBunch + ] + ); + } + $connection->commit(); + } catch (\Exception $e) { + $connection->rollBack(); + throw new CouldNotDeleteException(__('Could not delete Prices'), $e); } - $connection->commit(); - } catch (\Exception $e) { - $connection->rollBack(); - throw new \Magento\Framework\Exception\CouldNotDeleteException( - __('Could not delete Prices'), - $e - ); } return true; } + /** + * Returns associative arrays of store_id as key and array of skus as value. + * + * @param \Magento\Catalog\Api\Data\SpecialPriceInterface[] $priceItems + * @return array + */ + private function getStoreSkus(array $priceItems): array + { + $storeSkus = []; + foreach ($priceItems as $priceItem) { + $storeSkus[$priceItem->getStoreId()][] = $priceItem->getSku(); + } + + return $storeSkus; + } + /** * Get link field. * @@ -312,9 +334,9 @@ private function retrieveAffectedIds(array $skus) $affectedIds = []; foreach ($this->productIdLocator->retrieveProductIdsBySkus($skus) as $productIds) { - $affectedIds = array_merge($affectedIds, array_keys($productIds)); + $affectedIds[] = array_keys($productIds); } - return array_unique($affectedIds); + return array_unique(array_merge([], ...$affectedIds)); } } diff --git a/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php b/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php index 92302dd9ccf47..371d9e6c091f0 100644 --- a/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php +++ b/app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php @@ -59,7 +59,7 @@ public function processFileContent(ImageContentInterface $imageContent) $filePath = $this->saveFile($imageContent); $fileAbsolutePath = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath($filePath); - $fileHash = md5($this->filesystem->getDirectoryRead(DirectoryList::MEDIA)->readFile($filePath)); + $fileHash = hash('sha256', $this->filesystem->getDirectoryRead(DirectoryList::MEDIA)->readFile($filePath)); $imageSize = getimagesize($fileAbsolutePath); $result = [ 'type' => $imageContent->getType(), diff --git a/app/code/Magento/Catalog/Observer/Compare/BindCustomerLoginObserver.php b/app/code/Magento/Catalog/Observer/Compare/BindCustomerLoginObserver.php index 27e1b44704156..0f165d96494af 100644 --- a/app/code/Magento/Catalog/Observer/Compare/BindCustomerLoginObserver.php +++ b/app/code/Magento/Catalog/Observer/Compare/BindCustomerLoginObserver.php @@ -14,6 +14,11 @@ */ class BindCustomerLoginObserver implements ObserverInterface { + /** + * @var Item + */ + private $item; + /** * @param Item $item */ diff --git a/app/code/Magento/Catalog/Observer/Compare/BindCustomerLogoutObserver.php b/app/code/Magento/Catalog/Observer/Compare/BindCustomerLogoutObserver.php index 11b8d3f854f65..ece2a48da62ad 100644 --- a/app/code/Magento/Catalog/Observer/Compare/BindCustomerLogoutObserver.php +++ b/app/code/Magento/Catalog/Observer/Compare/BindCustomerLogoutObserver.php @@ -14,6 +14,11 @@ */ class BindCustomerLogoutObserver implements ObserverInterface { + /** + * @var Item + */ + private $item; + /** * @param Item $item */ diff --git a/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterDeleteByIdProductLinksPlugin.php b/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterDeleteByIdProductLinksPlugin.php new file mode 100644 index 0000000000000..91e8629ec212a --- /dev/null +++ b/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterDeleteByIdProductLinksPlugin.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Api\ProductLinkRepositoryInterface; +use Magento\Catalog\Model\Indexer\Product\Full as FullProductIndexer; + +/** + * Product reindexing after delete by id links plugin. + */ +class ReindexAfterDeleteByIdProductLinksPlugin +{ + /** + * @var FullProductIndexer + */ + private $fullProductIndexer; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @param FullProductIndexer $fullProductIndexer + * @param ProductRepositoryInterface $productRepository + */ + public function __construct(FullProductIndexer $fullProductIndexer, ProductRepositoryInterface $productRepository) + { + $this->fullProductIndexer = $fullProductIndexer; + $this->productRepository = $productRepository; + } + + /** + * Complex reindex after product links has been deleted. + * + * @param ProductLinkRepositoryInterface $subject + * @param bool $result + * @param string $sku + * @param string $type + * @param string $linkedProductSku + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterDeleteById(ProductLinkRepositoryInterface $subject, bool $result, $sku): bool + { + $product = $this->productRepository->get($sku); + $this->fullProductIndexer->executeRow($product->getId()); + + return $result; + } +} diff --git a/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterSaveProductLinksPlugin.php b/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterSaveProductLinksPlugin.php new file mode 100644 index 0000000000000..480399035a7a3 --- /dev/null +++ b/app/code/Magento/Catalog/Plugin/Api/ProductLinkRepositoryInterface/ReindexAfterSaveProductLinksPlugin.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Api\ProductLinkRepositoryInterface; +use Magento\Catalog\Api\Data\ProductLinkInterface; +use Magento\Catalog\Model\Indexer\Product\Full as FullProductIndexer; + +/** + * Product reindexing after save links plugin. + */ +class ReindexAfterSaveProductLinksPlugin +{ + /** + * @var FullProductIndexer + */ + private $fullProductIndexer; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @param FullProductIndexer $fullProductIndexer + * @param ProductRepositoryInterface $productRepository + */ + public function __construct(FullProductIndexer $fullProductIndexer, ProductRepositoryInterface $productRepository) + { + $this->fullProductIndexer = $fullProductIndexer; + $this->productRepository = $productRepository; + } + + /** + * Complex reindex after product links has been saved. + * + * @param ProductLinkRepositoryInterface $subject + * @param bool $result + * @param ProductLinkInterface $entity + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterSave(ProductLinkRepositoryInterface $subject, bool $result, ProductLinkInterface $entity): bool + { + $product = $this->productRepository->get($entity->getSku()); + $this->fullProductIndexer->executeRow($product->getId()); + + return $result; + } +} diff --git a/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/MaxHeapTableSizeProcessorOnFullReindex.php b/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/MaxHeapTableSizeProcessorOnFullReindex.php index e655a66e9b91b..cb4df8f162b40 100644 --- a/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/MaxHeapTableSizeProcessorOnFullReindex.php +++ b/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/MaxHeapTableSizeProcessorOnFullReindex.php @@ -15,6 +15,11 @@ */ class MaxHeapTableSizeProcessorOnFullReindex { + /** + * @var LoggerInterface + */ + private $logger; + /** * @var MaxHeapTableSizeProcessor */ diff --git a/app/code/Magento/Catalog/Plugin/RemoveImagesFromGalleryAfterRemovingProduct.php b/app/code/Magento/Catalog/Plugin/RemoveImagesFromGalleryAfterRemovingProduct.php new file mode 100644 index 0000000000000..ef3abddf91e69 --- /dev/null +++ b/app/code/Magento/Catalog/Plugin/RemoveImagesFromGalleryAfterRemovingProduct.php @@ -0,0 +1,66 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Catalog\Plugin; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Gallery\ReadHandler; +use Magento\Catalog\Model\ResourceModel\Product\Gallery; + +/** + * Responsible for deleting images from media gallery after deleting product + */ +class RemoveImagesFromGalleryAfterRemovingProduct +{ + /** + * @var Gallery + */ + private $galleryResource; + + /** + * @var ReadHandler + */ + private $mediaGalleryReadHandler; + + /** + * @param Gallery $galleryResource + * @param ReadHandler $mediaGalleryReadHandler + */ + public function __construct(Gallery $galleryResource, ReadHandler $mediaGalleryReadHandler) + { + $this->galleryResource = $galleryResource; + $this->mediaGalleryReadHandler = $mediaGalleryReadHandler; + } + + /** + * Delete media gallery after deleting product + * + * @param ProductRepositoryInterface $subject + * @param callable $proceed + * @param ProductInterface $product + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundDelete( + ProductRepositoryInterface $subject, + callable $proceed, + ProductInterface $product + ): bool { + $mediaGalleryAttributeId = $this->mediaGalleryReadHandler->getAttribute()->getAttributeId(); + $mediaGallery = $this->galleryResource->loadProductGalleryByAttributeId($product, $mediaGalleryAttributeId); + + $result = $proceed($product); + + if ($mediaGallery) { + $this->galleryResource->deleteGallery(array_column($mediaGallery, 'value_id')); + } + + return $result; + } +} diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductImageOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductImageOnProductPageActionGroup.xml new file mode 100644 index 0000000000000..3dca650c2dcf8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductImageOnProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertProductImageOnProductPageActionGroup"> + <annotations> + <description>Validates that the provided product image is present and correct.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="{{MagentoLogo.filename}}" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminProductImagesSection.imageFile(image)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml new file mode 100644 index 0000000000000..9e0d13c1bc910 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertProductInfoOnEditPageActionGroup"> + <annotations> + <description>Verifies the general data on the Edit product details page in admin for a product.</description> + </annotations> + <arguments> + <argument name="productStatus" defaultValue="{{_defaultProduct.status}}" type="string"/> + <argument name="productAttributeSet" defaultValue="Default" type="string"/> + <argument name="productName" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="productSku" defaultValue="{{_defaultProduct.sku}}" type="string"/> + <argument name="productPrice" defaultValue="{{_defaultProduct.price}}" type="string"/> + <argument name="productQuantity" defaultValue="{{_defaultProduct.quantity}}" type="string"/> + <argument name="productStockStatus" defaultValue="In Stock" type="string"/> + <argument name="productWeight" defaultValue="{{_defaultProduct.weight}}" type="string"/> + <argument name="productVisibility" defaultValue="Catalog, Search" type="string"/> + <argument name="categoryName" defaultValue="{{_defaultCategory.name}}" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminProductFormSection.productStatus}}" stepKey="waitForProductStatus"/> + <seeElement selector="{{AdminProductFormSection.productStatusValue(productStatus)}}" stepKey="seeProductStatus"/> + <seeOptionIsSelected selector="{{AdminProductFormSection.attributeSet}}" userInput="{{productAttributeSet}}" stepKey="seeProductAttributeSet"/> + <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="seeProductName"/> + <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{productSku}}" stepKey="seeProductSku"/> + <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{productPrice}}" stepKey="seeProductPrice"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{productQuantity}}" stepKey="seeProductQuantity"/> + <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{productStockStatus}}" stepKey="seeProductStockStatus"/> + <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{productWeight}}" stepKey="seeProductWeight"/> + <seeOptionIsSelected selector="{{AdminProductFormSection.visibility}}" userInput="{{productVisibility}}" stepKey="seeProductVisibility"/> + <seeElement selector="{{AdminProductFormSection.categories(categoryName)}}" stepKey="seeProductCategories"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeSeoUrlKeyToDefaultValueWithoutRedirectActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeSeoUrlKeyToDefaultValueWithoutRedirectActionGroup.xml new file mode 100644 index 0000000000000..a8539859c6d7d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeSeoUrlKeyToDefaultValueWithoutRedirectActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminChangeSeoUrlKeyToDefaultValueWithoutRedirectActionGroup"> + <annotations> + <description>Requires navigation to category creation/edit page. Selects 'Use Default Value' checkbox for the 'URL Key' with 'Create Permanent Redirect for old URL' unchecked.</description> + </annotations> + + <conditionalClick selector="{{AdminCategorySEOSection.SectionHeader}}" dependentSelector="{{AdminCategorySEOSection.UrlKeyInput}}" visible="false" stepKey="clickOnSEOTab"/> + <waitForElementVisible selector="{{AdminCategorySEOSection.UrlKeyInput}}" stepKey="waitForSEOTabOpened"/> + <clearField selector="{{AdminCategorySEOSection.UrlKeyInput}}" stepKey="clearUrlKeyField"/> + <uncheckOption selector="{{AdminCategorySEOSection.UrlKeyRedirectCheckbox}}" stepKey="uncheckRedirectCheckbox"/> + <checkOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="checkUseDefaultValueCheckbox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml index 60438e23e084c..2fb18ddfc9eb6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml @@ -17,5 +17,7 @@ <click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/> <waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/> + <!-- Wait for close button appeared. That means animation finished and modal window is fully visible --> + <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="waitForCloseButtonAppeared"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml index fe5b0ae1a64ce..703b37079aee3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml @@ -21,7 +21,7 @@ <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="clearExistingFilters"/> <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{codeFilter}}" stepKey="fillAttributeCodeFilterField"/> <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="applyGridFilter"/> - <helper class="\Magento\Catalog\Test\Mftf\Helper\CatalogHelper" method="deleteAllProductAttributesOneByOne" stepKey="deleteAllProductAttributesOneByOne"> + <helper class="Magento\Catalog\Test\Mftf\Helper\CatalogHelper" method="deleteAllProductAttributesOneByOne" stepKey="deleteAllProductAttributesOneByOne"> <argument name="notEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow2}}</argument> <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminExpandProductDesignSectionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminExpandProductDesignSectionActionGroup.xml new file mode 100644 index 0000000000000..f3d742f28cab0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminExpandProductDesignSectionActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminExpandProductDesignSectionActionGroup"> + <annotations> + <description>Expand the Design section on the Product Details page in Admin.</description> + </annotations> + + <click selector="{{ProductDesignSection.DesignTab}}" stepKey="clickDesignTab"/> + <waitForPageLoad stepKey="waitForTabOpen"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductNameOnProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductNameOnProductFormActionGroup.xml new file mode 100644 index 0000000000000..e2adc09376086 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductNameOnProductFormActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillProductNameOnProductFormActionGroup"> + <annotations> + <description>Fills in Name field on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="fillProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductQtyOnProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductQtyOnProductFormActionGroup.xml new file mode 100644 index 0000000000000..225638f066a2c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductQtyOnProductFormActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillProductQtyOnProductFormActionGroup"> + <annotations> + <description>Fills in Quantity field on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="productQty" type="string"/> + </arguments> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{productQty}}" stepKey="fillProductQty"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductSkuOnProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductSkuOnProductFormActionGroup.xml new file mode 100644 index 0000000000000..f7b4baaeef8e8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductSkuOnProductFormActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillProductSkuOnProductFormActionGroup"> + <annotations> + <description>Fills in Sku field on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{productSku}}" stepKey="fillProductSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetVisibleInAdvancedSearchActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetVisibleInAdvancedSearchActionGroup.xml new file mode 100644 index 0000000000000..bd7c59ffc385e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetVisibleInAdvancedSearchActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminProductAttributeSetVisibleInAdvancedSearchActionGroup"> + <annotations> + <description>Set 'Visible in Advanced Search' value for product attribute</description> + </annotations> + <arguments> + <argument name="isVisibleInAdvancedSearch" type="string" defaultValue="Yes"/> + </arguments> + + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" stepKey="waitForVisibleInAdvancedSearchElementVisible"/> + <selectOption selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" userInput="{{isVisibleInAdvancedSearch}}" stepKey="setVisibleInAdvancedSearchValue"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSaveCategoryFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSaveCategoryFormActionGroup.xml index 5521cc2a7d0b2..30a9dd4276eb0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSaveCategoryFormActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSaveCategoryFormActionGroup.xml @@ -17,6 +17,7 @@ <scrollToTopOfPage stepKey="scrollToTopOfTheCategoryPage"/> <click selector="{{AdminMainActionsSection.save}}" stepKey="saveCategory"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppears"/> + <dontSee selector="{{AdminCategoryMessagesSection.saveCategoryWarningMessage}}" stepKey="dontSeeWarningMessage"/> <see userInput="You saved the category." selector="{{AdminMessagesSection.success}}" stepKey="assertSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml new file mode 100644 index 0000000000000..64acee0b077c5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup" extends="AdminProductFormAdvancedPricingAddTierPriceActionGroup"> + <annotations> + <description>Check tier price on Advanced Pricing dialog on the Admin Product creation/edit page.</description> + </annotations> + <remove keyForRemoval="selectWebsite"/> + <remove keyForRemoval="selectCustomerGroup"/> + <remove keyForRemoval="fillQuantity"/> + <remove keyForRemoval="selectPriceType"/> + <remove keyForRemoval="fillPriceAmount"/> + <remove keyForRemoval="waitCustomerGroupFilterAppears"/> + <remove keyForRemoval="selectCustomerGroupValue"/> + <executeJS function="return window.getComputedStyle(document.querySelector("{$priceAmountSelector}")).getPropertyValue('min-width')" after="waitPriceAmountFieldAppers" stepKey="priceMinWidth"/> + <assertEquals after="priceMinWidth" stepKey="assertWebsiteAmounts"> + <actualResult type="string">$priceMinWidth</actualResult> + <expectedResult type="string">60px</expectedResult> + </assertEquals> + <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceDeleteButton}}" after="assertWebsiteAmounts" stepKey="clickCustomerGroupPriceDeleteButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml index 6ea154d2b01d3..c2a2dd5c13de8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertProductImageAdminProductPageActionGroup"> + <actionGroup name="AssertProductImageAdminProductPageActionGroup" deprecated="Use AdminAssertProductImageOnProductPageActionGroup instead"> <annotations> <description>Validates that the provided Product Image is present and correct.</description> </annotations> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontAttributeOptionQuantityInLayeredNavigationActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontAttributeOptionQuantityInLayeredNavigationActionGroup.xml new file mode 100644 index 0000000000000..f1ffc1475e878 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontAttributeOptionQuantityInLayeredNavigationActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontAttributeOptionQuantityInLayeredNavigationActionGroup" extends="AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup"> + <annotations> + <description>Asserts visible attribute option quantity</description> + </annotations> + <arguments> + <argument name="attributeOptionQuantity" type="string" defaultValue="1"/> + </arguments> + <see selector="{{StorefrontCategorySidebarSection.visibleOptionQty(attributeOptionPosition)}}" userInput="{{attributeOptionQuantity}}" after="assertAttributeOptionInLayeredNavigation" stepKey="assertOptionQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductDropDownOptionValueActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductDropDownOptionValueActionGroup.xml new file mode 100644 index 0000000000000..a633c3bc06c56 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductDropDownOptionValueActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductDropDownOptionValueActionGroup"> + <annotations> + <description>Validates that the provided Product Option is selected under the provided Drop-down Attribute.</description> + </annotations> + <arguments> + <argument name="attributeLabel" type="string" defaultValue="{{ProductAttributeFrontendLabel.label}}"/> + <argument name="optionLabel" type="string" defaultValue="{{productAttributeOption1.label}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeLabel)}}" stepKey="waitForAttributeVisible" /> + <seeOptionIsSelected selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeLabel)}}" userInput="{{optionLabel}}" stepKey="assertAttributeOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByCustomDateRangeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByCustomDateRangeActionGroup.xml new file mode 100644 index 0000000000000..30b15abb234d5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByCustomDateRangeActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="FilterProductGridByCustomDateRangeActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Date Filter.</description> + </annotations> + <arguments> + <argument name="code" type="string"/> + <argument name="date" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.inputByCodeRangeFrom(code)}}" userInput="{{date}}" stepKey="fillProductDatetimeFromFilter"/> + <fillField selector="{{AdminProductGridFilterSection.inputByCodeRangeTo(code)}}" userInput="{{date}}" stepKey="fillProductDatetimeToFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml index f2524d6e68bfc..670eb04b55bd8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml @@ -17,6 +17,7 @@ <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/> + <dontSee selector="{{AdminProductMessagesSection.saveProductWarningMessage}}" stepKey="dontSeeWarningMessage"/> <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertRelatedProductOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertRelatedProductOnProductPageActionGroup.xml new file mode 100644 index 0000000000000..2d31eae0aedd9 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertRelatedProductOnProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertRelatedProductOnProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Name is present on Product details page.</description> + </annotations> + <arguments> + <argument name="productName" type="string" defaultValue="{{_defaultProduct.name}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontProductRelatedProductsSection.relatedProductsListSectionText}}" stepKey="waitForRelatedProductsList"/> + <see selector="{{StorefrontProductRelatedProductsSection.relatedProductsListSectionText}}" userInput="{{productName}}" stepKey="seeRelatedProduct"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertSubCategoryNameIsNotShownInMenuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertSubCategoryNameIsNotShownInMenuActionGroup.xml new file mode 100644 index 0000000000000..157138f5e6674 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertSubCategoryNameIsNotShownInMenuActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertSubCategoryNameIsNotShownInMenuActionGroup" extends="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup"> + <annotations> + <description>Validate that the subcategory is not present in menu on Frontend.</description> + </annotations> + <arguments> + <argument name="parentCategoryName" type="string"/> + </arguments> + <moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(parentCategoryName)}}" before="doNotSeeCatergoryInStoreFront" stepKey="showSubCategories"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontRemoveFirstProductFromCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontRemoveFirstProductFromCompareActionGroup.xml new file mode 100644 index 0000000000000..fefcdb6930c61 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontRemoveFirstProductFromCompareActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontRemoveFirstProductFromCompareActionGroup"> + <annotations> + <description>Open Compare Products list and remove a product</description> + </annotations> + + <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/> + <waitForElementVisible selector="{{StorefrontProductCompareMainSection.removeFirstItem}}" stepKey="waitForButton"/> + <click selector="{{StorefrontProductCompareMainSection.removeFirstItem}}" stepKey="clickOnButton"/> + <waitForElementVisible selector="{{ModalConfirmationSection.OkButton}}" stepKey="waitForModal"/> + <scrollTo selector="{{ModalConfirmationSection.OkButton}}" stepKey="scrollToModal"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOkButton"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml index 9639bc39b45f4..0fb4f3ef32050 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml @@ -11,6 +11,7 @@ <entity name="_defaultCategory" type="category"> <data key="name" unique="suffix">simpleCategory</data> <data key="name_lwr" unique="suffix">simplecategory</data> + <data key="urlKey" unique="suffix">simplecategory</data> <data key="is_active">true</data> </entity> <entity name="ApiCategory" type="category"> @@ -20,12 +21,14 @@ <entity name="SimpleSubCategory" type="category"> <data key="name" unique="suffix">SimpleSubCategory</data> <data key="name_lwr" unique="suffix">simplesubcategory</data> + <data key="urlKey" unique="suffix">simplesubcategory</data> <data key="is_active">true</data> <data key="include_in_menu">true</data> </entity> <entity name="NewRootCategory" type="category"> <data key="name" unique="suffix">NewRootCategory</data> <data key="name_lwr" unique="suffix">newrootcategory</data> + <data key="urlKey" unique="suffix">newrootcategory</data> <data key="is_active">true</data> <data key="include_in_menu">true</data> <data key="parent_id">1</data> @@ -45,22 +48,27 @@ <entity name="FirstLevelSubCat" type="category"> <data key="name" unique="suffix">FirstLevelSubCategory</data> <data key="name_lwr" unique="suffix">firstlevelsubcategory</data> + <data key="urlKey" unique="suffix">firstlevelsubcategory</data> </entity> <entity name="SecondLevelSubCat" type="category"> <data key="name" unique="suffix">SecondLevelSubCategory</data> <data key="name_lwr" unique="suffix">secondlevelsubcategory</data> + <data key="urlKey" unique="suffix">secondlevelsubcategory</data> </entity> <entity name="ThirdLevelSubCat" type="category"> <data key="name" unique="suffix">ThirdLevelSubCategory</data> - <data key="name_lwr" unique="suffix">subcategory</data> + <data key="name_lwr" unique="suffix">thirdlevelsubcategory</data> + <data key="urlKey" unique="suffix">thirdlevelsubcategory</data> </entity> <entity name="FourthLevelSubCat" type="category"> <data key="name" unique="suffix">FourthLevelSubCategory</data> - <data key="name_lwr" unique="suffix">subcategory</data> + <data key="name_lwr" unique="suffix">fourthlevelsubcategory</data> + <data key="urlKey" unique="suffix">fourthlevelsubcategory</data> </entity> <entity name="FifthLevelCat" type="category"> <data key="name" unique="suffix">FifthLevelCategory</data> - <data key="name_lwr" unique="suffix">category</data> + <data key="name_lwr" unique="suffix">fifthlevelcategory</data> + <data key="urlKey" unique="suffix">fifthlevelcategory</data> </entity> <entity name="SimpleRootSubCategory" type="category"> <data key="name" unique="suffix">SimpleRootSubCategory</data> @@ -73,6 +81,7 @@ <entity name="SubCategory" type="category"> <data key="name" unique="suffix">SubCategory</data> <data key="name_lwr" unique="suffix">subcategory</data> + <data key="urlKey" unique="suffix">subcategory</data> <data key="is_active">true</data> <data key="include_in_menu">true</data> </entity> @@ -95,6 +104,7 @@ <entity name="CatNotIncludeInMenu" type="category"> <data key="name" unique="suffix">NotInclMenu</data> <data key="name_lwr" unique="suffix">notinclemenu</data> + <data key="urlKey" unique="suffix">notinclemenu</data> <data key="is_active">true</data> <data key="include_in_menu">false</data> </entity> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml index 6e40499d0efeb..6f270feb20b60 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml @@ -8,11 +8,16 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="TestImageContent" type="ImageContent"> + <entity name="TestImageContent" type="ImageContent"> <data key="base64_encoded_data">/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDIBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAGAAYAMBIgACEQEDEQH/xACXAAEBAAMBAQEBAAAAAAAAAAAABgMEBQgCAQcQAAEDAQUFBgQDCQAAAAAAAAABAgMEBQYRFpESMTZV0QchcnOzwhMUIkEygaE1QlFSYXGCsbIBAAEFAQAAAAAAAAAAAAAAAAACAwQGBwERAAECAwMLBAMBAAAAAAAAAAEAAgMEERMhkRQxMzRBUVJTcXKxBRJhoSKBwUL/2gAMAwEAAhEDEQA/AP7+AYKysp7Po5aurlbFBEmL3u3NQ6ASaBdArcFnBN5/urzqn0d0Gf7q86p9HdCRkUzy3YFOWEXhOCpATef7q86p9HdBn+6vOqfR3QMimeW7AosIvCcFSAm8/wB1edU+jugz/dXnVPo7oGRTPLdgUWEXhOCpATef7q86p9HdBn+6vOqfR3QMimeW7AosIvCcFSA1bPtGktWiZWUM7Z6d6qjZG7lwXBf1Q2iO5paaOFCmyCDQoTd/uBLX8n3IUhN3+4EtfyfchIk9Zh9w8pyBpW9QvN4Bwbcsujis+pq2Q4Tq5HbW0u9XJj3Y4fc0ibjPgQjEY0GgJNTS4brj/FaIz3Q2FwFafNP4V3gc1aWz7FY+rjhVrsNjBrlcrsV3Iir/ABPxtqzRyM+boJKeJ7kakm2jkRV3Yom4TlbYf4xrnfFSBuqaCn7ouWwbc+4/FT90XTBz57RlbVvpqWjdUSRoiyfWjUbju71MUlqSyWdVPjpnsqIUVJI3ORFZ3fix+4OnoLSRU3V2HZnANKEjcEGOwVG74OxdUGjZM1RNQROqIlYuw3Zcr9pXpgn1f0xN4kQYgiww8bU4xwe0OG1eg+y7gCg8cvqOLEjuy7gCg8cvqOLEzT1HXIvcfKq0zpn9ShN3+4EtfyfchSE3f7gS1/J9yCJPWYfcPKTA0reoXm85l4P2HUf4/wDSHTPmSOOZiskY17F3tcmKKaXMwjGgvhj/AECMQrTFZ72ObvC5lvxq+gjeivRsUzXvVn4kb34qmpozxWc+NjVtWtqPiOREjbMj1Vf7YFHvMMdLTxP244ImP/maxEUhzMhaxC8UvABrXZuoR9pmLL+9xddfvXNrfkVtJyPqJaOpRiL8VHbKPT8+5THFVS1FnWnE+VKhsUbmsmamG3i1e78jsSwQzoiTRRyIm5HtRf8AZ9MjZGxGMY1rU/damCHTJPMQuDgAa5q31G0VpdnrnuRYO9xNaA1+/r9rUsmeGazqdscrHuZExHo1cVauH30U3THFBDBtfBijj2t+w1Ex0MhMgMcyG1r843J+GC1oDs69B9l3AFB45fUcWJHdl3AFB45fUcWJm3qOuRe4+VV5nTP6lCbv9wJa/k+5CkJu/wBwJa/k+5BEnrMPuHlJgaVvULzeADUlbUAAIQAAhAACF6D7LuAKDxy+o4sSO7LuAKDxy+o4sTMPUdci9x8qqTOmf1KE3f7gS1/J9yFITd/uBLX8n3IIk9Zh9w8pMDSt6hebwAakragABCAAEIAAQvQfZdwBQeOX1HFiR3ZdwBQeOX1HFiZh6jrkXuPlVSZ0z+pQwVlHT2hRy0lXE2WCVMHsduchnBEBINQmQaXhTeQLq8lp9XdRkC6vJafV3UpASMtmeY7Epy3i8RxU3kC6vJafV3UZAuryWn1d1KQBlszzHYlFvF4jipvIF1eS0+ruoyBdXktPq7qUgDLZnmOxKLeLxHFTeQLq8lp9XdRkC6vJafV3UpAGWzPMdiUW8XiOK1bPs6ksqiZR0MDYKdiqrY27kxXFf1U2gCO5xcauNSmySTUr/9k=</data> <data key="type">image/jpeg</data> <data key="name" unique="prefix">test_image.jpg</data> </entity> + <entity name="AdobeBaseContent" type="ImageContent"> + <data key="base64_encoded_data">/9j/4AAQSkZJRgABAQAASABIAAD/4QCARXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAKgAgAEAAAAAQAAAGSgAwAEAAAAAQAAAGQAAAAA/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/iDFhJQ0NfUFJPRklMRQABAQAADEhMaW5vAhAAAG1udHJSR0IgWFlaIAfOAAIACQAGADEAAGFjc3BNU0ZUAAAAAElFQyBzUkdCAAAAAAAAAAAAAAAAAAD21gABAAAAANMtSFAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEWNwcnQAAAFQAAAAM2Rlc2MAAAGEAAAAbHd0cHQAAAHwAAAAFGJrcHQAAAIEAAAAFHJYWVoAAAIYAAAAFGdYWVoAAAIsAAAAFGJYWVoAAAJAAAAAFGRtbmQAAAJUAAAAcGRtZGQAAALEAAAAiHZ1ZWQAAANMAAAAhnZpZXcAAAPUAAAAJGx1bWkAAAP4AAAAFG1lYXMAAAQMAAAAJHRlY2gAAAQwAAAADHJUUkMAAAQ8AAAIDGdUUkMAAAQ8AAAIDGJUUkMAAAQ8AAAIDHRleHQAAAAAQ29weXJpZ2h0IChjKSAxOTk4IEhld2xldHQtUGFja2FyZCBDb21wYW55AABkZXNjAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAEnNSR0IgSUVDNjE5NjYtMi4xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYWVogAAAAAAAA81EAAQAAAAEWzFhZWiAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAAG+iAAA49QAAA5BYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAkoAAAD4QAALbPZGVzYwAAAAAAAAAWSUVDIGh0dHA6Ly93d3cuaWVjLmNoAAAAAAAAAAAAAAAWSUVDIGh0dHA6Ly93d3cuaWVjLmNoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRlc2MAAAAAAAAALklFQyA2MTk2Ni0yLjEgRGVmYXVsdCBSR0IgY29sb3VyIHNwYWNlIC0gc1JHQgAAAAAAAAAAAAAALklFQyA2MTk2Ni0yLjEgRGVmYXVsdCBSR0IgY29sb3VyIHNwYWNlIC0gc1JHQgAAAAAAAAAAAAAAAAAAAAAAAAAAAABkZXNjAAAAAAAAACxSZWZlcmVuY2UgVmlld2luZyBDb25kaXRpb24gaW4gSUVDNjE5NjYtMi4xAAAAAAAAAAAAAAAsUmVmZXJlbmNlIFZpZXdpbmcgQ29uZGl0aW9uIGluIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdmlldwAAAAAAE6T+ABRfLgAQzxQAA+3MAAQTCwADXJ4AAAABWFlaIAAAAAAATAlWAFAAAABXH+dtZWFzAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAACjwAAAAJzaWcgAAAAAENSVCBjdXJ2AAAAAAAABAAAAAAFAAoADwAUABkAHgAjACgALQAyADcAOwBAAEUASgBPAFQAWQBeAGMAaABtAHIAdwB8AIEAhgCLAJAAlQCaAJ8ApACpAK4AsgC3ALwAwQDGAMsA0ADVANsA4ADlAOsA8AD2APsBAQEHAQ0BEwEZAR8BJQErATIBOAE+AUUBTAFSAVkBYAFnAW4BdQF8AYMBiwGSAZoBoQGpAbEBuQHBAckB0QHZAeEB6QHyAfoCAwIMAhQCHQImAi8COAJBAksCVAJdAmcCcQJ6AoQCjgKYAqICrAK2AsECywLVAuAC6wL1AwADCwMWAyEDLQM4A0MDTwNaA2YDcgN+A4oDlgOiA64DugPHA9MD4APsA/kEBgQTBCAELQQ7BEgEVQRjBHEEfgSMBJoEqAS2BMQE0wThBPAE/gUNBRwFKwU6BUkFWAVnBXcFhgWWBaYFtQXFBdUF5QX2BgYGFgYnBjcGSAZZBmoGewaMBp0GrwbABtEG4wb1BwcHGQcrBz0HTwdhB3QHhgeZB6wHvwfSB+UH+AgLCB8IMghGCFoIbgiCCJYIqgi+CNII5wj7CRAJJQk6CU8JZAl5CY8JpAm6Cc8J5Qn7ChEKJwo9ClQKagqBCpgKrgrFCtwK8wsLCyILOQtRC2kLgAuYC7ALyAvhC/kMEgwqDEMMXAx1DI4MpwzADNkM8w0NDSYNQA1aDXQNjg2pDcMN3g34DhMOLg5JDmQOfw6bDrYO0g7uDwkPJQ9BD14Peg+WD7MPzw/sEAkQJhBDEGEQfhCbELkQ1xD1ERMRMRFPEW0RjBGqEckR6BIHEiYSRRJkEoQSoxLDEuMTAxMjE0MTYxODE6QTxRPlFAYUJxRJFGoUixStFM4U8BUSFTQVVhV4FZsVvRXgFgMWJhZJFmwWjxayFtYW+hcdF0EXZReJF64X0hf3GBsYQBhlGIoYrxjVGPoZIBlFGWsZkRm3Gd0aBBoqGlEadxqeGsUa7BsUGzsbYxuKG7Ib2hwCHCocUhx7HKMczBz1HR4dRx1wHZkdwx3sHhYeQB5qHpQevh7pHxMfPh9pH5Qfvx/qIBUgQSBsIJggxCDwIRwhSCF1IaEhziH7IiciVSKCIq8i3SMKIzgjZiOUI8Ij8CQfJE0kfCSrJNolCSU4JWgllyXHJfcmJyZXJocmtyboJxgnSSd6J6sn3CgNKD8ocSiiKNQpBik4KWspnSnQKgIqNSpoKpsqzysCKzYraSudK9EsBSw5LG4soizXLQwtQS12Last4S4WLkwugi63Lu4vJC9aL5Evxy/+MDUwbDCkMNsxEjFKMYIxujHyMioyYzKbMtQzDTNGM38zuDPxNCs0ZTSeNNg1EzVNNYc1wjX9Njc2cjauNuk3JDdgN5w31zgUOFA4jDjIOQU5Qjl/Obw5+To2OnQ6sjrvOy07azuqO+g8JzxlPKQ84z0iPWE9oT3gPiA+YD6gPuA/IT9hP6I/4kAjQGRApkDnQSlBakGsQe5CMEJyQrVC90M6Q31DwEQDREdEikTORRJFVUWaRd5GIkZnRqtG8Ec1R3tHwEgFSEtIkUjXSR1JY0mpSfBKN0p9SsRLDEtTS5pL4kwqTHJMuk0CTUpNk03cTiVObk63TwBPSU+TT91QJ1BxULtRBlFQUZtR5lIxUnxSx1MTU19TqlP2VEJUj1TbVShVdVXCVg9WXFapVvdXRFeSV+BYL1h9WMtZGllpWbhaB1pWWqZa9VtFW5Vb5Vw1XIZc1l0nXXhdyV4aXmxevV8PX2Ffs2AFYFdgqmD8YU9homH1YklinGLwY0Njl2PrZEBklGTpZT1lkmXnZj1mkmboZz1nk2fpaD9olmjsaUNpmmnxakhqn2r3a09rp2v/bFdsr20IbWBtuW4SbmtuxG8eb3hv0XArcIZw4HE6cZVx8HJLcqZzAXNdc7h0FHRwdMx1KHWFdeF2Pnabdvh3VnezeBF4bnjMeSp5iXnnekZ6pXsEe2N7wnwhfIF84X1BfaF+AX5ifsJ/I3+Ef+WAR4CogQqBa4HNgjCCkoL0g1eDuoQdhICE44VHhauGDoZyhteHO4efiASIaYjOiTOJmYn+imSKyoswi5aL/IxjjMqNMY2Yjf+OZo7OjzaPnpAGkG6Q1pE/kaiSEZJ6kuOTTZO2lCCUipT0lV+VyZY0lp+XCpd1l+CYTJi4mSSZkJn8mmia1ZtCm6+cHJyJnPedZJ3SnkCerp8dn4uf+qBpoNihR6G2oiailqMGo3aj5qRWpMelOKWpphqmi6b9p26n4KhSqMSpN6mpqhyqj6sCq3Wr6axcrNCtRK24ri2uoa8Wr4uwALB1sOqxYLHWskuywrM4s660JbSctRO1irYBtnm28Ldot+C4WbjRuUq5wro7urW7LrunvCG8m70VvY++Cr6Evv+/er/1wHDA7MFnwePCX8Lbw1jD1MRRxM7FS8XIxkbGw8dBx7/IPci8yTrJuco4yrfLNsu2zDXMtc01zbXONs62zzfPuNA50LrRPNG+0j/SwdNE08bUSdTL1U7V0dZV1tjXXNfg2GTY6Nls2fHadtr724DcBdyK3RDdlt4c3qLfKd+v4DbgveFE4cziU+Lb42Pj6+Rz5PzlhOYN5pbnH+ep6DLovOlG6dDqW+rl63Dr++yG7RHtnO4o7rTvQO/M8Fjw5fFy8f/yjPMZ86f0NPTC9VD13vZt9vv3ivgZ+Kj5OPnH+lf65/t3/Af8mP0p/br+S/7c/23////AABEIAGQAZAMBEQACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/3QAEAA3/2gAMAwEAAhEDEQA/APy/r+Jz/roCgAoAKACgAoAKACgAoAKACgAoAKAP/9D8v6/ic/66AoAKACgAoAKACgAoAKACgAoAKACgD//R/L+v4nP+ugKACgAoAKACgAoAKACgAoAKACgAoA//0vy/r+Jz/roCgB8aGSRIx1d1QZ6AuwUE47Anmmt16ilJRjKT2hGUnbe0U5O22tk7frsfrz+x3/wRu+O37aH7P3g39onwB8V/g74U8LeNrzxTaaboXjPSPHdz4js28KeJtT8K3r382hajDpjrc3+kXVzaC3jDJaSQLPmXezfd5L4c53n2XUczwmZ5Th6GIlWUKWJw2MqV4exqyoy5pUsTCm+acJSjaOkZRTu05H8W+OH04PD/AMCfErPvDDiLgvjfOc34eo5PWxWZZHmXDtDK8Qs5yjB51QWHp5jllfFx9jhsdQo1va1ZJ141ZU/ctCP07/xDj/tU/wDReP2dP/BF8U//AJbV6v8AxCHiT/oc5H/4RZh/82/Lf8fePyX/AIqf+Ef/AEbjxN/8PHB3/wA52uvl+h+YH7cn7EPi39hH4heDvhh4/wDid8M/H/i/xX4OvvHNxpvw7tfENpL4V0GHWotC0ifxHF4j1C8uRJ4nvf7Q/sJbWGGN4dD1eWV2EKhfjOIuHMXwvjcPl+Ox+AxuJxGFljHHAUq9P6tSjV9jTeJVetVaeKl7T6vy8qaw1d/Zsf1p9H7x8yf6Q3DWe8WcPcI8V8M5Jk2eYbh6jjOJsTlmKp5xmVXAVcxxtHLKmVYDB0bZPh44aWZe2lUnGWZZfGnFe0fP8QzSCG3ubgo8otrW5ujDEAZpltYXuJI4VJCvM0cb+VGzJ5sm2MMGcV8/OXJCc+WU+SEp8kFec+VN8sI/am7Wim43el9T98pQVSrRpOUYe2rUaPPO6p03WqQpRnUaTcaUZTj7SSUnCDc+VqMuX97fh7/wQC/aC+KPgTwb8SPBX7Rv7NeueEfHnhfQfF/hrV7LR/iZcW2o6L4h0y11XT7qKa31mSCQSW90oYxOYw6sEyuK/SsH4WZ7j8Jhsbhc9yCrhsXQpYihVhhMdOFSlWpxnCcZLF2alGSd1ddm9Gf508R/tHvDnhTiDPOF898K/FTL864ezbMMlzXA4jNOEqVfCY/LMXVweKoVaVXJoVITp1aMk41Ep/zWa5TsD/wbj/tUgZ/4Xx+zpwCf+QF8Uv66sB+Z/LFdH/EIeJf+h1kf/hHj/wD5qf5feeN/xU98JP8Ao2/idv8A9Dfg/wC//kUP7rO/lf3fxY/aY+A/iP8AZe+P3xQ/Z58X63oPiTxT8K7/AMO2Gs674Xt9StfDuot4n8Mad4rsH0qHWZp9URYLDU4La7F45f7ZHMY8RFFX4POMoxORZhicsxdahiMRhZQjOthoVKdCftKUK0eSFWdSorQqRjLmk3zRbWj5Y/3d4VeIWWeLfhtwj4nZLl+Y5TlPGOHzbEYHLs3r4TEZnhY5NnGJyTExxlXA0cPhJOrisLOtQdClb6vOCnealOXhteWffBQAUAf/0/y/r+Jz/roCgCe1/wCPm3/67w/+jFprdeqM638Gt/15q/8ApuR/dJ/wQU/5RgfAH/sM/GX/ANXH41r+n/Dr/kksu/6+Y3/1MrH/AD9/tFv+Ut/Ev/sD4G/9YTh4/YDUtQstJ0++1TUrmKy07TbO61DULyd/LgtLGyge5u7md+iQwW8UkkjkgKqk5GBX205xpwlUnJRhCMpzk9FGMVeUm+iSTbP4mw2Hr4vEUMLhaU62JxNalh8PRpxcqlavXqRp0aVOK1c51JKMY63btZ7H+b3+2t+0je/ta/tP/GD49TT3Mmi+M/FMtn4Dtrh7ojT/AIXeEvP8P/Dq2iguY4GthqGjxXXi6eL7NFIl94uvLeZpvsscr/x/n+bTz7PMzziUrwxdfkwaUuaMMtwvNSwCi03F+1pueMlaMZRni5U5c3soyP8AqD8BvC2h4M+EvBPh1GlShmOR5TDEcSVacaN8TxhnipZnxTUnVoyqKs8JjHhsgpz9tOLw+QUa0I0vrE4R+Wkd43SSNikkbpJG45KSRsHRgOhKsobB4OMGvJTtr1Wp+uuMZxlCa5oTjKE47c0JpxnG+65otq61V7o/su/4N9P2nk+I/wCzh4r/AGatev5JfE/7OGs27+FYbmW8mnufg549mvtU8KJDNcoyyw+Etft/EngwolxPLBZaTpM9yYhqECV/QHhLnH1nJcRklaadbJa1sKnPmnLK8U5VMLo7yjHDVViMFHmlKU44eNRv31GP+HH7SPwnlwt4o5R4p5fh4QynxTwNV5vOjDD06dLjrhyGHweeynSoyi6c87y+tlPEXNLD0YVMRmWMo0VN4StM/oGf7jf7rfyr9YP84FuvVH+fB/wV3/5Sdftjf9jD8I//AFTXhSv5c8Qf+Sszf/r7hv8A1CoH/Sd9C7/lEzwN/wCxZx1/632bn50V8Uf0yFABQB//1Py/r+Jz/roCgCe1/wCPm3/67w/+jFprdeqM638Gt/15q/8ApuR/dJ/wQU/5RgfAH/sM/GX/ANXH41r+n/Dr/kksu/6+Y3/1MrH/AD9/tFv+Ut/Ev/sD4G/9YTh4qf8ABcj9pyb4CfsW6/4E8OasdM+IX7R+pf8ACovD81uzC+03wld2sup/FLxFbeTfWM8Mmm+B7TU7GyuUmzHq+qaYqRzySpby8HihnTyvhqpg6FR08ZnlaOWUXB8tSGHmnUzGtTfPT5J0sDCv7KfN7taVO0ZycYSf0AfCin4jeO+W5/muDWL4Z8L8L/rvmdOql9XxmcYevSwnCGVVufDYmlUp43iTEYCpiqM6bU8vw2Mc5U4RnVpfwvSPBFHJKVjs7O1t5JSkaMYbGwsrdpGWOOFGcwWNnAdqRIz+VDhEJwrfzb7kI6KNOnThsrRhTp04/JKEIR7WUV0P+gmMalScIc0sRXrVoU1OcoxqYnFYmtGCc5zcYqrisTVV5TkoqpVvOVryPevjt+zb8V/2cZPhLF8U9EbR5vjL8FvCPxw8LRLZ6hbmz0HxTNLb3PhrV2vIhGnivwpOdLi8R2yNB5Ta/pfl2cQZy3q5plOMyl5fHGUpUpZjlmHzOhGaSkqVdtToztJtV8M3TWIik4Q9tS5akudo/OvDzxS4N8UYcaVOD8esbT4G49zrw/zabxOErLE4/KKcK1DOMDHDvmeS55SjjqmU1ZRnzLK8ap4mpJQR9G/8EvP2m3/ZV/bU+EHjzUb77F4E8X6kvwe+KW//AI9z4L+Il7aadpOr3Gby1jB8JePh4Z1NJ5Y7s2umaj4gZIoo5JrhPR4Ozn+weJsrx0pcmFxNVZVmLekfquOko0KkvejeWHx/1Zwm1NU6VbFe6lOU4/l/0tvCleL/AID8bcP4bDvEcQ5FhXxzwgo/xP7d4Xw9bE5hgqdsPWm1nXC/9sYeVKFTDqvjcBlKlUnKNKjL/QuDB4iysHBQkOpBVgVyrKVJBDAhhgkYPU9a/rM/5rLWlZppqWqe8XfVNbpp6a6/gf58X/BXf/lJ1+2N/wBjD8I//VNeFK/lzxB/5KzN/wDr7hv/AFCoH/Sb9C7/AJRM8Df+xZx1/wCt9m5+dFfFH9MhQAUAf//V/L+v4nP+ugKAJ7X/AI+bf/rvD/6MWmt16ozrfwa3/Xmr/wCm5H90f/BBU4/4Jf8AwBPf+2fjJj3J+MfjUAfiePbvX9P+HX/JJZd/18xv/qZWP+fz9otr9LjxL/7A+Bvu/wBROHvXp5fefzkf8Fqf2oI/2jP22fF2gaBqq6h8Pv2dtPn+Cnhf7NPa3Fjc+LYb221n4u6zBJbozM7eIodC8IyF5yY5/Bl7AIotshl/F/EPO1nXE+JhScZYPJYyyrDTTup4nnhVzScbe44KvDD4W799VsHWg7KKcv8ATj6CHhLLwx8BcmzPMsG8LxL4n4qnx7mqq0q9LEUsjlQrZfwPgakKrhFR/s2rm2e03Gk1Ohn+Erc8uaCh8x/8E8f2Zj+1t+198Hfg1fWP27wbcavL4++KKulvLbp8Lvh3cadq/iGxu4rgsrweK9ZuPDfg2WMwSrPYa7qcBKFlavF4YyX/AFhz/LMqlrh6lSWMzGLimpZbgZU6lem7+644ivPC4SrGSkp0cRVjZWUo/q/0mPFb/iDHgpxvxzhsQ8PntPB0+GuEJQlWp1v9cOKaWMwWWYqhUoq8KuSZbQznPqc+eEqeMy/A1FzKMoy/qK/4L0fsu2vxV/Y/t/jX4c0WKXxh+yvezeMAtla2aXc3wh1eC20b4m6LC7mJltNK0mLTvGMNrHNFEt94TsZju8kI37V4qZJHG8PwzajGMcRw/N4qUuXfLKkVTzKk+VObhCioYuMI6e2wlKTUlHll/kp+zv8AFqtwf42y4DzLHzhkfjBQp5C/b1a7oUuNsHVqY7g/MJwp+0TrYrMZ4jIqladOc/qee4ymnD2nNH+KCa3hcXNldktbXENzY3bREZa2uoZLa4aE/ONxhkdoWG7B2Mp4DL/O04QqRnTmr06kZU5rXWE04yWlmrxbV07rdW0P946VWcXRxFD3atKpRxNBVE7RrUKkK9GNRe67KrCMakb6rmi7rm5v9Ar/AIJOftSv+1Z+xR8MvE2vatHqnxL+HdrJ8H/iyxntZLt/G/gK2ttPOs3cVqkSwf8ACXaC2j+LbXdBB5trrEUqxIrqi/1NwFnss/4awVevKLx+Dvl2ZRTV44vCKMHO13JRxNF0sVSc+WUqNenPlXMkf83n0xPCKPg948cWZRl2CnhOFOJK0ONuCl7OtCiuHOJKlXFU8DRnWc5VXkePWNyLENVa3JicuqwdWcouR/IV/wAFd/8AlJ1+2N/2MPwj/wDVNeFK/D/EH/krM3/6+4b/ANQqB/tV9C7/AJRM8Df+xZx1/wCt9m5+dFfFH9MhQAUAf//W/L+v4nP+ugKAJ7X/AI+bf/rvD/6MWmt16ozrfwa3/Xmr/wCm5H9cf7BX7TFl+yJ/wQO0P46ShJtc8OWvxm0jwHpjedv1v4keLPjT4x8OeA9JT7PDcSqlz4i1Kyku5xC8dpYQ3V7PsgtpJF/f8jzlZB4aPNEoSrUKePhhKU5qmq2NrY2tSwdFTekfaV5wjd3stUnsf4y/SP8ACrEeNP7RrNPD2nKVLA5tiOBMXxDjF7O2X8LZPwBkWa8R49+1q0acpYfKcJiXRpOrCeIxDpYelz1asIH8j17c315d3V5qWo3Gsapd3V3fapq93JJJdaxrGpXlzqetaxcvNJLJ5+s6ze6hqs6s7CKW9aJMRRotfz7FTS/eVHVqylOpWqu961erOVWvWd3Jp1q051XFPli5OMbRUVH/AGZw9LD0KNGhhMLSwGDo0aGHweAoxhCll+BwmHpYPLsvpRpwpx9nl2XYfC4CElFOpDDKrO85ycv6Sf8Aghf8Vv2Mf2ZfA3xf+Lvx4/aQ+CHw7+LnxJ8RweBtB8K+LfH2laT4n8PfC3wIzvbXF/pepRWNzpreN/Fmoa34ltwDdrd6B/wjsgu5Ujhjt/1vwzzPhbI6OZ5jmue5Xgsyx1aOEhhsZi6GHxOGwOCuoKVOc4yUcViKtfF05tN1KFSg/hUD/Lj9oJwd46eK3EXBPBfh54V+IfFHBfCuU1OIMwzjJeF8wx+UZnxhxIofWKeFx2CljKOLjw/kmFyvJazf1d0c0pZtB4eE51JT/p78DfEz4G/tT/DLWtV+G3jjwX8Yfhf4kj1/wVrGreE9YsfEPh7UBLaGw1/RZru1ae3aaO1vdlzAwZgkqkjDAr+24THZXnuCqVcDi8LmWArqrhp1cNVhXoT93kq0+eEpxbSlaSv11P8AJziDhXj7wl4pweB4q4fz7gni3K5ZfneEwOdYDFZVmmFcayxOXY6FCvCnWjCVWipUqiUbuL25fe/zsv2p/gBrX7LX7Qvxc+AOtRyj/hWPjLUNF8PXUzSO2r/D6/8A+Jz8M9cSWWzsfPF94KvNM0+7mjjnQ67omuQm7uZYJZX/AJIzbKp5FmuYZLPmvl2JlSouStz4Gp+9y+pHROcfqkqdGVS3vV6FePNOUJyP+mjwi8SMF4veGnBfiRgZQvxZkeHx+aUYckVguJ8M/qHF+AlThXxDpOhxDRxWNoU5ypyWWZpllRYehTqwpw/WL/ggV+1D/wAKl/am1j4A+INQkh8H/tMaGbTRI5pLtrOy+L/w+0y61HQGVFWW3tpPFvgSHWNFeV2tYpLrwho1uPPvNRRK+78Lc5ll/EFbLKk0sLnlH92pSso5pg4XpcsXdylisFGpCXLyqH1KDd3O5/HP7Rnwl/1y8JMD4kZbhoTzrwpx/tMxlCOHhXxHBHE+NpYbME5PkrVlkfE1XB46EIxxM1R4jx1T91hsFJx+NP8Agrv/AMpOv2xv+xh+Ef8A6prwp/n/APVXleIP/JWZv/19w3/qFQP3T6F3/KJngb/2LOOv/W+zc/Oivij+mQoAKAP/1/y/r+Jz/roCgCa3ZUngZjhVmiZieyhwWPGTwATwOfemt16oiqnKlVjFXlKlUjFd5ShJJfNtLyPtP4lftIJqv7Bf7FP7I/h/WUurX4ZXnxg+LXxZsrbztkXj7xX8QNZuPhn4YvybgRGTwl4V8Sa3rk1vJbzH+1P7Dvt9u4gD+9j82rYjhvhjJJTvHCSzPNcwguW0cZWxtT+zcJPltCrHB4evWm5xi+avRoV3KE0lP8L4X8L5YT6Rvj7405ll86FTiulwTwVwViK3s71eG8n4ZwNDi7OcLH2POo51m+TZfltKtCpBfUq2aYbkrJ1XD4mrwD93JUnmjXbHIyLkkhTjJPc8DJwPU8cccU7vbp/X4+f3ESp05vmlCMpWSvLVpLZLXS2+il6aWl/Qr/wQD/a98NfCD4o/GD4B/EzxZovhPwR8VtFtvil4Y1zxPqukaFoWn/EfwZBpnhjxPplxqepXdnHFdeLfB0nhvULBGD/a7nwzri+dvSCKv1Lwrz2llmZZlleMrQoYTM6UcwoVq06dKjTx2EhRwuIpSqT5IqWJwqw06MfelOWGxN5e7CJ/mr+0d8F804z4S4I8SOFsox2bZ5wdjqvB2bYDK8JjsxzDEcL57Wxuc5Ni6eFwtCtejkuexznCYqanH2NLNsqtStOpVOs/4OAfB3wa8ca78G/2n/hP8Svhr4u1qW3n+C3xR0nwj4x0HX9YnsXefxD8NPFNzY6Vq9zM9to+prrvhW7u2sX8iLxXZyy3MFpZXDNv4q4fAYjEZZnuX4vCYipKM8qzCnhq9KtVcJXr4HFSjSlOTp4eoq+Hm+S0Y4z2kp06dKo5eJ+zf4g41yHBcc+EnF/DHE+T4FTp8e8J4zOMlx+AwVLE0o08r4tyilXxeCpwVXMMDPL85pUliqftJ5DVpU6VfE4mjy/zs+E/GPiX4e+J/Dfj/wAF3jaf4y8B6/o/jjwffKHza+KfCd7FrWiBwk9rI1rf3Np/Y2pRi5gE2lanfQSSCOVxX5MqtfDTpYrCvlxmCq08Zg5bNYrCy9rRi3eNoVZL2FZKUOehVq03NRk3H/TfOMjyribKc14Zz6j9ZyLiPLcdw7nuH929XJ87oSy/MJQc6VaMa+EpVlmODqOlUdLHYHC1YU5ThE+nf2+fjD4V/aF/bF+NPx38EX0V94Y+K9l8I/EVmke/fo+qaf8AC7QvDninw1dBySt9oXiLSL6O6Rtrxm6SF1LROa93ijMo5txBmWY0Zc+FxiwGIoO0U6UvqFGjiMLJJKTlRr0ZTc53v7b2cdKVz8n+jlwVnXhr4G8A+HfEOEqYTN+DMRxxleJ53Fxx2FxvGGNzjKM3oOKSeGzHLMbRdCcXKFRYd1I2jOKPkKvBP2kKACgD/9D8v6/ic/66AoAKAFyeBk4HT278enPP+TQH66vz/pf1sJQAUAMkihmQx3FvbXUTEFoby1tr23YqcqWt7uKaB2U8ozRlkPKYJJWZwhUi4VIQqQlvCpCM4uzTV4yTi7NJq+zV001eN06lSlJTpVa1GaulUoV62HqpPdRq4epSqxUlpJKaUlo7pWjDFZWEDiS30zSbSUBgJrLSNLsZwrDay+fZWcExRhwyF9jdwcfLEMPh6T5qVChSk005UqNKnJxbTs5QhFtXSdtVdJtRtFS0nisXVjyVsZj68Lp+zxOYY7FU7p3T9licVWpqSdnGahzR6NXfNZrUwFJJ6kk8Dk54HQd+g4H9OlAf194lABQAUAf/0fy/r+Jz/roCgAoAKACgAoAKACgAoAKACgAoAKAP/9L8v6/ic/66AoAKACgAoAKACgAoAKACgAoAKACgD//T/L+v4nP+ugKACgAoAKACgAoAKACgAoAKACgAoA//2Q==</data> + <data key="type">image/jpeg</data> + <data key="name" unique="prefix">adobe-base.jpg</data> + </entity> <entity name="MagentoLogoImageContent" type="ImageContent"> <data key="base64_encoded_data">iVBORw0KGgoAAAANSUhEUgAAAP8AAAEsCAYAAAAM1WX/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACY7SURBVHhe7Z0LlBxXnd6HXWyWhx9g8HS3pJFGPVU1klmC2RB28frBIbY00y2NpBnN9GMkG4JJcOJsgCVrszZg56wJuxj2BTjLY8FsADsb20kwmEc4WYgNxPYuiwX2yg9ZxrKsefS7R5IlufP/qm+N76hbo5qa7p6qru875zs6M5quvvd/76/q3lt1/9VDhU/7Ll79ikrauL66y8pVUsZ1ezf1nan+i6KoblV+bP22uUlrT+1dG2vlycEa/pWfH5kej4+oP6Eoqpt0aGx9vJqxvnF892Dt2JUbavmMNW/8fEx+X81aXy9MxNerj1AUFWQ9eGHPy4sp4wOHJ60ZXOWLWauW08CH8TN+r0YBM8W0+f47B3vOUIegKCpoyo/HL6tkzAcA9eFdgw3Qn2z8/5z8Hf6+krEeyE/EL1WHoigqCHo+2X9+MW18dm5y8MSLV25sCvrpfEI+V520TuA4h4b6etWhKYryqwTWXTJ3fxpXbyzone5qfyrjc+WsjALeLSeBrPl0MWNOqq+gKMpPmh3rf2Mpbdxbu2pj7ejuDZ6hP9k4Do6HEUQpY34zl+r/TfWVFEWtpH52ee+rZF7/kbmsVQb4hZPgbZVxXBx/btIqldLmjQeSkVeqIlAU1Wnl0gNJAf/nGOJXlzHEd2scH99jLwhmzX8sTgwkVFEoiuqEcjvW9pWzxleO7hqsHT/pnn2njO/F95cz5pefk/KoolEU1S5VM+Y1law1hatvqck9+04Z34vvr48CrEMolyoiRVGtVG5n/0Vylf07zLvd3LPvlFEOlAflkqnA/5kdX/92VWSKopajZ8Zir53LGrdWJ61jL161oW0Lest1fUFwQ60i5ZxLG7fuT/Sdq6pAUdRSVU4ZqXLGenK59+w7ZZTP2SxUzlpPlNPGhKoKRVFuND22zpQh9N+euHJD7YXdK7Ogt1yj3Ch/JWv97fSOPktVjaKoZsK++krGuK6cNUu4emKzTTOwgmJns5CcyIqVtPkH9zJvAEU1amZi3eXVjPkQYMHmGr8P8d0a9XA2C1Wz5oOFsXX/UlWZosKt6a1rotWs9XmsmGOY3AygbjHqd3hysFbNWH+1X+qtQkBR4VMpZbynOmkewFWxlO2eq/2pjPqhnvboJms+i/qrUFBUOFRI9f+WdP7v4tbYkRZuwgmKUV/UG/WXqcB3Cjvjb1Ghoaju1L6RtedUM8YtMsw/2s5NOEGxs1moOmkdKWeMjyM+KlQU1T3KTxjb57LWL+3V7wDcs++UEQfEoz4VsH6RT63fpkJGUcFWPXGm+V+PyzD35MSZ9EI7iUQrGetriJsKIUUFS0icmU8ZH0BCTFzVmiXOpBca8XGeDTictaaLqYH/gDiqkFKU/1VKxy+Zy1h24sxuumffKSNe9mYhiV81a92fG4tfokJLUf7UoZ19vcWM8ZnqMhJn0guNONqJRFPGXyIxqQo1RflHFSTOnLT24WoVhE04QTHiaG8Werf9bMBTchLYrUJOUSurfCr+5lLG+taLV25oaeJMeqER13oi0Q21Ytr4Vn7nwD9TTUBRndWeS899dTltfFSu9hXes++cnWcD5iTuiP/By3tfpZqEotqvysRAopOJM+mFRrz1RKKVlDGsmoai2qN64kzzS0d3r1ziTHqh0Q5HdtmJRP86t7N/jWoqimqdyinj31Wz1iFcbVYycSa90GgHJ5GotM/zTCRKtUzFifjvyBDfTpyJKwyh96fRLmgftBMSiRbT639bNSFFLU3PXBF7bSVdT5yJ3WfNOhztPzuJRKXdXqhkjE8ykSi1JBVSRqqStR7nPftgGu3lPBuAdkR7qqalqOY6OBrfKJ3l7iAnzqQXGu2IRUEZBdw1s3XNBtXUFFXXnrHBM2SIf305Y5ZxtecmnO4x2lFLJFpCO+8ZHDxDNT0VZs2MDlxezVh24sxqiBb0AASemMO/zf6/24x2RfvW7woMPjjDRKLh1dT2NZG5tHkbEkqeCNEmHEAA6Oek3vm0+Rh2z4XtsWS0t51INGv+F2zGUl2CCoNKE8bV1UkrNIkzYdSxrJJnYgNSLjWQrSUjr5wZj++qZq2n8Xv8f1hi8VIiUetXTCQaAk3vjL9FzvahTJyJ9/xVZIg/lzH//Int/W9QIbF1UH6uZI2/kJOA/XfNPt+NRvs7iUQlLt/Jj8cvVCGhukUzm/vPKmaMj8sV70iYNuGgc9svzJA6y0nv/unR+KUqJE01PR6/rDpp3m9fEUO0/uFsFqpI/yimjFv2Sn9RIaGCrPzEeiTO/AU6dFgSZ6KO8yvcGTNXThkfuGN7z6+pkCyqj17c8+tyovygjBJy+HxY7nygjkwk2iWa2rbOqGSsO5AQMmyJM+uJMDfgzTjfOLTFWyLMqR39A3LiuBPHCWf87ESi30AcVEgovwsJH4sTxgfDljhTv3LJVfuX+fTADhWSZamUGhiVk8Cj9nFDOHJCP5KpwAd+ICMiFRLKj8qND1wcxsSZzpy1nDXx8otbprec8xoVkpZoZvPZZ1UzxsflpBLONZN32W8Wuh/9S4WE8ouwWl1MG39RnbSOvyids1lDdqPROZ3VagHzu+1+7RVeM1bJGN8L590S3CIdPI5+hv6mQkKtpJDQ8XDIEmeijs596nLGPFDp8H1qGQVcXZXvxfeH6jkJNa2qZq19chLYpcJBdVpI4FhKG6FMnGm/6lqGo5W0eRte8a1C0lHNjK2OyRTjr7CHvttfLa4b/cxJJCr9716ZCrxJhYRqtw4kI68sp4yPze2y7E04YZp/Os+mlzLmQ4Xx+BUqJCuqQmr9JinPw/YVMSQjL9hZZ5nLWmUkEkW/VCGh2qFieiCJhI2h62hq5bmaNYtytf+DvZt6zlQh8YX2buo7s5IxrkP57BOylLdZPbrN9glZTQWQ0LWYGUiokFCtUn5i7dpqxrr9qFz5wpQ4E50L+9ExrC6nzXtmR+MbVUh8qdlUfGM5Y/4PJx9CWE7OMPol+mc5bX0lP7J2rQoJtRzJvPLasCXORB21xaXHZVg5ocIRCMm0DJmQnkAmnXAtwjojNOsQEr6qcFBLVXE8/rZKxrITZ2JxKyxXEWcuiRx0hbRxq8wlz1MhCZRQ7lLa+BTqgfo0q2s3Gv3Ufsmo1BmJRGfHmEjUtZBwsZoxPilXjtB1Gjv7rP1AidU1nWYW2Y8n5SQu9QrfSdx+/uKFatb8k30ja89RIaGaqTAxkLaHizJ0CuNw8fCkdbCcMq+pqXh0i27o6XlZQYbBc1nr+bBO36RfM5FoM81MGIMSnLvCmDgTC0Uv7FZvnMms7VMh6Uqphdsvo75hWriFnYXbSsb879M7DEuFJLy6F7eI0sb1SKyIs2OYNuE4t4jkavgPsyF711xR6iv1/hnqH5Zbtqijs1mojESiGeM69H8VknBpdjx+hcyFHrQBCNtc0O70VjXMb5nFW47lJHBTNWvNIR5helirvlkIdwXMB5FAVoWk+4XEmdWM+QUs/oT1sVC56n0zlzJ+U4Uk1Do0PvAmice9oX1MW0Y+1bT1eXChQtKdKqSN91YnQ7ghRG3Ckavc0/kJ40oVDkpTfnzgKonPfsQpnIlEzWcLE8bVKhzdI2zCkcp9J6yJM6VT42r/508m+89XIaGa6HmJTyVj/aVMicKbSHTSvC8/Gn+zCklw9eTYurPLKeMW6fyHcc8+TPM650EPmdfdPzUWv0SFhHKh6Yn4pQJBaJOyVLODh8tp84/AjwpJsITEmQL9L9GAoUycmbVmkTiT6Z+8CXGrMJFosBKJHhpbH0fiyOOhTpxpfu35HX39KiTUMnRoIr5eLiJfC3MiUan/1wsSBxUS/8lOnClXusMhT5xZmjC2q5BQLRQSkoY+kWjafD84UyHxh/Lj8cukYew5Whg34eBlD9WMccujLU6cSS3U9BbzNSqR6NGwrSFpzwbcn59Y/OUrHRFWZ4tp47Nzk4MnXgzZyy6d1VkZkn13Zqz/rSokVAdUSPe/VaaW9USiu0J290g4q05aJ8op4zPgT4Wks0ICQ+n49Rc8hmgYNp84M2s9V8p04X3ZAKmUNt4ro4CDaI/QJRJ9tz0KeLqYMSdVONqv2bH+NyJxIYZdYU2cicSV0ylzRRJnUgs1M2bEymnj8+F9YtTO6fjNXKq/fU+M/uzy3lfJvP4jc1mrHNb5VhmJMydC9Cx2gFRIx6+Q9rETiYbx2YC5SatUSps3tjyRaA6JMzPmzxHYMCXOdFZaZY5VkCH+dX5LnEkt1A8uXv0KGZVeLyAU0G5ov2bt2m0Gj/OJRLPmPxYnWpBINLdjbV85a3wlbIkz4fnEmRnjLuQbUCGhAiC0l0wF7kb7hTE/hJ1INGN++TnhV4VkaapmzGsqWWsKZ5PQJs6cMMdVOKgAqpA2JtCOaM8wZoYSfg+BYxWO0yu3s/8iOWuEMnFm/X1s1jEZOt5aGIu9VoWECrCeHYm+TqZsn0a7on3DtFbl7C+xE4mOr3+7CkmjnpHOPpc1bq0HaUP4gvQupFiy/m7RIFGBVS5tXlS1s0GHNJGocD0nFzUkyFUhqQt54csZ68nwDY/qQ/w5GR4VJox/i0STKiRUF+qOnp5fU4lE7fdAhOkRdGc6W85aT8y/ByI3MXDHcRkahHJhROosQ/yvYGHTDgYVCiGRqEwFbg9lIlGpL3gH9z3Ht6+pFXbG6/8pV8KT/7ibjDOgljjzZ8VxY0j1ByqEQuJU9AP0h1DcwlZ8g3dw3zM7FKnZ3rq6lhuXkwD+oAtPAvbcB42ctSphTpxJLdSesXNfXcZbnyetStc+vKaYBt/g3GG+Z3Y4WrPtnAS29dXyKUN9oMmBAmaczecTZ05a/2t2vP8C1e4UNS88ti6jgO5KJAp+wbHwDK7nGVfMvwS/Y/Wfue1ra/m0Wf9wswP73PoiR3XS2ldMx3epdqaoU6qYMnZ3xYY1cCv8gmOda92N8DvGHyditdxo/0sHO/kLfOwT9tbHwVolY3zmudH1r1dtS1GnFfpLJWt9Zk76T+A2CylOwS34bQa941PDD+OD8JZVtRwWBXFgH58EcJaef7AhYz4wvSN+mWpPilqypsf63yH96MeBeOBNsQlOwes8u824Vl4cfsfqQLmta2r58QHfnQTQKM4mHDlj54oZ44NMnEm1QrchPV3a+H3pV3n0L989G+CwKFyCTzfQO3YHv2N10Ny2tbWcsyjYrEAd9nzizKz5tUPbfJzokAqs7MS0WevreC7AN4lEhT9wCB51Pt16afA7xpdgPWDHuhVbFMTZ10mcKY3CxJlUR2QnEp1c4USi4A2LecLf6eb1i9kb/I7xpUk5CYytf6lQJxe0Da4/r2xDf1iu9n/ExJlUJ7V389lnlTPGx/FyjY4+G6D4Am/gziv0jpcHP4wCwFva/5AQzrK4B2tvVMia353eGX+Lag+K6rimR/t/q+IkEm3nswGKKfshHZeLeW68fPgd2wWSf0fW1PITrV0URFDnE2dmzAOllPEeFf/QSaY3g7WxwTPUj77Q3k19Z6Jc6sfQqZoxrm7LC2gdhoQncGXz1QLoHbcOfseqcDn7ScHWrAfgXuuRXYO1ctr6/MzY6piKeah0aGdfbylrfTmXMp6ckWGn+rUvlHvnWWdLuZ4qZ80voZzq16HSzLboKrkwfQH9tCXPBoAbezGvbwFXrXTr4XeMwi5jURBnTydxZiljPlwYj1+h4hw6VVLWu8oZ61e1q9+IWD7+zGjsN9R/+UJIGjmbMp9C+UpSzkp64Cr1X6FTJR2/opQ2/x791lMiUXDSgsU8N24f/I5R+OSqJS0KOvfs5yatfCVtXI/EjCq2odLUePzCatb8NuaUWOuA82njsZZnaF2msEkqlzL3Yt7rrMlUs9a9U93wqmkP2if9Vfrth5eUSFRxUV/MU/P6Zjy10O2HH0ZFxDkXi4J64sywziORJr2aMf9T5aRXmwcBfpTTuRtTxt2YtHmz38rbKc2OxjeeNpGoYgFcgA+HlaYctdidgd+xU7GRNbXchLNzsD400l52+bjMnUKbOLM0Ed9azVh77FicdB85KPDDepvKKOCRXCq+Rf156FRIGSmJweN4y878ZiGn7wsH9cW8zkHvuLPwO1aVxI4j6TS1Oek0MkQ6WkoZn0TCRRWzUCk/tmadDPH/BleIUz1BFiT4daM+yJojo5mv5kfWrlUfC5Wkzc5DYlj0c/R39PvFdtx1wisDv2OpdHnLqlppbN3B2XEjlIkzsQehOGG+v5I1T/tq86DCj/q8tPfCnC6nzN9DPj318VAJiUQr0t/R71cKescrC7/4ha2x2vRQ5CcqNqGSDPl+V672/xdQuNk1FlT4HaN+zq5LGQb/KLfTvEgdIlSaHer9Kfp9Mx466RWH/6gEYWY48pCKSyj0mAwBKxnzzypZ6wTSpDcDpZmDDr9u5NAvS/0rafNPwzTVq4lnhyMPo98346GTJvwdVmFiIF2dtJ7A1X6pmWK6CX7U28m0JPPgx2dTRkodrqtF+DWHBX7kDpzLmPcgRxwW9ZYCveNugt8x4uDc3pXR0D2zqfhGddiuFOHX3O3wA9RCeuBGmeOWcZUruHng4xTuRvgdIy6IT3XSLEm8bnjIZ3VslQi/5m6Gf3Zi/WYZ0tqPerYiL3w3ww8jPtp7FR6eHVu/SX1F14jwa+5G+PFq5HLG/GKrX23e7fDrRtywSaYkcczt7F+jvirwIvyauw3+UnrgfXLVeg5Xr5Zu7xSHCX7Ebf5dipPWgVJq4F+rrwu0CL/mboFfhqi/Xc2a/9tO7LCrPYkdwgS/Y8QR8bQ3C2Ws7xfH429TXxtIEX7NQYd/38jac0pp84/l6nSk3Smdwgi/4/nUbRLnUsr8xJNj685WXx8oEX7NQYa/PGGNVTuYzDHM8MOIr7ZZ6JcyFRhVRQiMCL/mIMI/vcOwyhnzv9lpnNvc4XWHHX7d2CyE+JfT5p3TY5apiuJ7EX7NQYL/wQt7Xl7JmB+Sq878Cxyadcx2mfAvtLNZSNojV0kbv4/2UUXyrQi/5qDAXxg33ilX+/9nrz57Sc/UAhP+RqMdnHRv5Yz103LKfIcqli9F+DX7Hf79W9dEK1nzs/ZLG5ewCacdJvyLG5ukqpPWCbyc9entayKqeL4S4dfsZ/grafNflbPms7iqtPqevRcT/sWN9nGeDShlzGdlivZuVUTfiPBr9iP8eBmInjhzpaF3TPjdGe2FWKlnA76FRKiqqCsuwq/ZT/Dnd7/pHJnXNyTO9IsJ/9LsPBsg7TlXTps3o31VkVdMhF+zn+DP7ej/cO09F9SqbXpCb7km/Es32hHtiXadGe2/XhV5xUT4NfsJ/unNvTfXRvtquZ2dffGoWxP+JVq1H3Lh10bX1KR9b1JFXjERfs1+gn92KPrR2og0ylCkltu6ppYbb+07B5drwu/Sqs3Qfrmt9Vz4aFfpZx9RRV4xEX7NvoN/26p62VRmVbwrLZdy3jHQpKN10IT/NEb7APoJo5YbWfiOO7Qr4V9owq9pAfyOnZPAdm/vHGylCf8iRrvgHXfSTnq7OSb8jSb8mprC7xidCS8eHe1/qbOd3AHbbMLfxKod0C6LvdiS8Dea8GtaFH4YHQvesqq+KKiGmQ0dsk0m/JoRd4k/2gHtMd82zdpNTPgbTfg1nRZ+x05H27pa5pedWxQk/GIVa8Qd8T8d9I4Jf6MJvybX8DtWnQ6LgnlnUbBZh22RQw8/4itxRrz1+Lsx4W804de0ZPgdOyeBHe1dFAwt/IgnFvMkvnq8l2LC32jCr8kz/I7RKZOxWm6sPYuCoYNfxQ/xRFy9QO+Y8Dea8GtaNvwwOii8ZXUttzNe78AtOgmEBn4VM8QPcZyPabN4uzThbzTh19QS+B2rDpsbWWM/dNKKk0DXw+9APzFgx60V0Dsm/I0m/JpaCr9j1Xlz29Yue1Gwq+FHXOzFvLUL4tYqE/5GE35NbYHfsXMSsBcFVWdvBsEi7kr4EQeJx3IW89yY8Dea8GtqK/yO0bmTq+ydZvOd/2QgTuGugl/VG3FAPNoFvWPC32jCr6kj8MPo6DAWBcfdLwp2Bfyqrqh3qxbz3JjwN5rwa+oY/I5Vx8fiVn5+UbAJMMqBht95FNrecdfaxTw3JvyNJvyaOg6/YwVBbjsWBU/9kFBg4Ud9pF6on17fTprwN5rwa1ox+B0DikV2DgYOflX+3Oi6RXfcdcKEv9GEX9OKww8PwQIJFgXxkJAGUWDgd6DHQzrOYh7q1ay+HTLhbzTh1+QL+B3bwIixc1AtCh69cqO/4Uf5pJz2Yt4Sdtx1woS/0YRfk6/gd+wAtK2vdnQSw2nznwCbKrIvdOjSc1+dy1iPH8ladjn9BL1jwt9owq/Jl/A7FpiObJWpwLa+R2pjg2eoIvtCezf1nZnbtmbPYSmf36B3TPgbTfg1+Rp+sR2rod4HVXF9pdmh3of80KFPZcLfaMKvKRDw+yRWuvzUoU9lwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt/onmNbV9UKiagEpvkftNuE370Jv3cT/rrBOXgH9z0zQ9HPVZKx2gsrVBjC796E37sJf93gHLyDe7tAUphNpUT04drIqloZ/9HkQ+0y4Xdvwu/dYYYfPINr8F1KxB4C7/XSKO27ePUrSsnYHxYT0fKL8kd59aFmB2ulCb97E37vDiP84DcvQ3zwLBf3Umk48uEfCOf1kjTRbKL3AjlL3I3hwZEt7S8g4Xdvwu/dYYQf/ILjciJ218Et52+sl8CFColoRkYB+xA0+dc+izT7guWa8Ls34ffusMAPTsGr4vap2WQ0Xf/mJepAMnKeTAU+XU5GXzjepsISfvcm/N4dBvhz4uMjsVpJeBVuP/WY8Fv/1mUol4xcVEzEfoS5Q7XFC4KE370Jv3d3M/zgsSpDfPBZTER+ODsUeXv921qkG3p6XiYjgGtl/jCFQGIhoRUnAcLv3oTfu7sRfvAHDlE34fJQcTh6LTitf1MbdHBL77ricOyrWExoRQUIv3sTfu/uRvidRflSInp7ftMb1ta/oQMqJqJbxHvss84ypgKE370Jv3d3C/zgzL5nL/UR/h4pJqPJ+pE7rL2bzz6rOBS9uZKIVU7IfAMLDs0KvJgJv3sTfu/uBvjBF+b1MsSvCPgf23Ppua+uH3UFld8ce3N+OHLfiZFY7bAMQ5YyCiD87k34vTvo8IMrrOTLHP9bU8Jb/Wg+Un4odlUlGd2vhiSuTgKE370Jv3cHEX7wA45Q9nIiuj+XiO2uH8Wnmtq0JiKjgNuweQA7h5pVSjfhd2/C791BhB/8gKPcUPRzh4bO660fIQDKD/W+o5yM/gRBt3cRNakcTPjdm/B7d1DgByfgxd5kl4j+OD98/mX1TwZMezf1nSlzlA9JJXIIfrNnAwi/exN+7w4C/M49e5k6z+aHYx/cMzZ4Rv1TAdb0pqgpo4A7m20WIvzuTfi92+/wH1XPzQgnd0wNRY36X3eR8oneUTmrPYaGKCXrowDC796E37v9CD/6f0nds5fR8aP5ZGRH/a+6VPsTfeeWEtE/LiaiR/FsAEYDhN+dCb93+w1+9Hv0f2HhSCER/cTPhYv6X4RAM1esfmslEf1+bXR1TaD7hfr1iorwexPhX5okVo+i30v//9705t5/rn4dLqHTlJOR908PR+6rXX3hy+u/XTkRfm8i/O5VGxs8Q2J1nwzzf0/9Ktya3nLOa2oX9/y6+nHFRPi9ifC7F/o5+rv6kfKLCL83EX4q8CL83kT4qcCL8HsT4acCL8LvTYSfCrwIvzcRfirwIvzeRPipwIvwexPhpwIvwu9NhJ8KvAi/NxF+KvAi/N5E+KnAi/B7E+GnAi/C702Enwq8CL83EX4q8CL83kT4qcDL7/Aj+8v0cPQnqri+kpTvpyjfyWX2iwk/taj8Dj/e0VZIRA9ODUcuVkX2hXKbey8pSrlQvmbl9oMJP7Wo/A6/k9O9lIgeKyVif3rgksh5qugrouc29b5eyvFnUp7ji72bwQ8m/NSi8jv8MABzXuEk0D1ZHI5kVfE7qmIyMinf/xTK4fbVbCtpwk8tqunN0Zv8Dr9uvAPhmMyzy8noPQcv771AVaOten7oDW8sJ6L/89hI4zsY/Gy7XYd6P6aqQVELJVf+j9XGVmNe7fsrmWPntc1yFS6XEpEb9l28+hWqOi3VA2+L/UZpOHKjjDQq+D4vr2NfCaMd0Z5oV175qVNqZnh1TK6iX6jKFc3PK9cnGx0ci232VCAZ/fupzb1Dqkot0dRw77Ac9x9wfHxPUE6MMNqxIu1ZGI58YXrrmqiqEkU11+xwZFM5EXsoqJ29KmWWofkXf7U5ukpVyZOevSK6Wo7zpSCfDNGOU0ORzapKFHV64SWjpUTshqIMpwM5zMUoIBE9WBiOvU9VaUnKDcWukc8/j+MEaRqUF6O90G6lZOQP0Y6qShS1NB1M9F5QTMTuxsLa4QAtcAHWOSmvWg/4/kxi9VtVlRbVzPCqf1FJRr+PV0nh80Ea9WABEiMUmaLcM7vp/I2qShS1POGWmlxNAnNryzFGLOqdcEcLw9E/2XNF7LWqSgv0jPy+JP+Pv8PfB2mkg/ZQ7fJkLhHNqCpRVOt0IBk5T4aSn5J58LHjI8EaBeCtyACkkog+NpvoHVNVslUY7t0pV/t/sqcK6u3JzY7jN+MEhXYoJ6MvlJKxTz/7zujrVJUoqj2Sq8vvlhORH9bkConFtSAOjWeGIt+Y2Ry5fHYoegd+DtI9e8QbcX9RwC9KO+SSkYtU01BU+1W7oedlxWT02nIiNhXERTEAjxVx/Iufg1B2lNFZzETci0PRf3+DtINqEorqrA5tfv364nDsq1gM9POW1mbOC0jNfu9X40SFOMsJ4PbnE2/oV01AUSsrmQpsKSVij9TnzcGaCvjZiKNzz76SjP08NxzZqkJOUf4RXr0sV9Oby4loNUgr5n414odblTLEr8jU5KZHf4evtqZ8rvzm2JuLyci3j0vHxTCVo4ClGfFC3BC/4nDk24inCi1FBUP5odhVMgrYjyFrkJ4NWCkjPs49e7naP50f7r1ShZKigqepTa+L5Iain0Oyi2NyJWvW6em6ER+Z35/IS7yelripEFJUsJXfsuod5WT0x3g2wO9ZbzppxAHxQFxklPRAfvj8y1TIKKp7hE0m+eHof5ROnsNCVtButbXaqL+9oJeMzs4moh/aMzZ4hgoVRXWnnt0UNYvJ6J32k3UBezagVcYzEbDM8e+YGooaKjQUFQ4VEr1jlWT00fqzAd2/IIj6OXsM5Gr/aH5z76gKBUWFT/sTfeeWEtFPBG033VKNejm7C4vJ2H9GvVUIKCrcOhjgffSLGfVAfVCvaiL6Pbd5BSgqdJpN9P4bGRo/h6FxkDYLnWyU29mEI/U5UBqOvFdVkaKoUwm592R4/EVcMbEo2AwuvxvlRvmREPWZ4dUxVTWKotxodiiyWU4CD9v3wAPwbADK52zCKSViDyERqqoKRVFLFfLwF4ajNxZ9nEgU0DuJM+VkVSokIjf8oE3vD6Co0Gk20XuBXFXvxiOwfsu6g/LYj+YmYncd3MLEmRTVFqlEovswtF7JzUL4XmcTjvz7VIGJMymq/aonEo19WubVx4+vwIIgph524sxE7JiU41OPSXlU0SiK6oRyw5GLi4nYjzDX7kQiURy/njgTV/vID0tMnElRK6cbenpeVtYSiWKzTKtPAjgejovj43uKw9Fr8b2qCBRFraScRKJYfGt1IlF7A5Ict5SI3l5g4kyK8qeKiegW8R77Kr2MqQA+59yzl+M9UkxGk+orKIryq/ZuPvus4lD05koiVvGyWcjZhCND/IoM8W96dAsTZ1JUoITEl/nhyH0nRur57t2MAuqJM/Eij8i3p5g4k6KCLSQSrSRPnUgUP+P39QW96P5iIrZbfZSiqKBratOaiFzNb7MTiW5dmEgUP+P3SDR6aOi8XvURiqK6SfmhXiQS/Qnu1QN4/CtX+x8zcSZFhUC4R19I9l5THYk9kRuOvE/9mgqVenr+P+OvTjWo+kMRAAAAAElFTkSuQmCC</data> <data key="type">image/png</data> @@ -21,4 +26,21 @@ <entity name="MagentoLogoImageContentExportImport" extends="MagentoLogoImageContent" type="ImageContent"> <data key="name">magento-logo.png</data> </entity> + <entity name="BluePngImageContent" type="ImageContent"> + <data key="base64_encoded_data">iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAFpOLgnAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABgAAAAAQAAAGAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAADKgAwAEAAAAAQAAADIAAAAAaawubwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAN1JREFUaAXtllEKwlAMBFvvfwsP5XEUhf2MzLOwFp3+BF42TTL7KN236+2+Dc9lOH8dny65T6uMk341MY77MfSpcFxzKnien7xomd7yPha8ux7J/SWl5csXWitxmezKy6O1SUigKC6EKSJxhQSKFVx+u5AXEVU8sUlwoyguhCkicYUEiuJCmCISV0igKC6EKSJxhQSKlZ87NMlBUcX3gzOichdBmIoiHSnCRq10BGEqinSkCBu10hGEqSjSkSJs1EpHEKaiSEeKsFErHUGYiiIdKcJGrXQEYSqKfsaRB19MEgdQHhXpAAAAAElFTkSuQmCC</data> + <data key="type">image/png</data> + <data key="name" unique="prefix">blue.png</data> + <data key="baseImage_md5">5da9660dc7c0536210547e0000f9a9cf</data> + <data key="thumbnailImage_md5">b1e89172f4d192f00c1d947741759180</data> + </entity> + <entity name="RedPngImageContent" type="ImageContent"> + <data key="base64_encoded_data">iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAFpOLgnAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABgAAAAAQAAAGAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAADKgAwAEAAAAAQAAADIAAAAAaawubwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAN1JREFUaAXtllEKwlAMBFuP4f2v4PkUhf2MzLOwFp3+BF42TTL7KN1v1+2+Dc9lOH8dny65T6uMk341MY77MfSpcFxzKnien7xomd7yPha8ux7J/SWl5csXWitxmezKy6O1SUigKC6EKSJxhQSKFVx+u5AXEVU8sUlwoyguhCkicYUEiuJCmCISV0igKC6EKSJxhQSKlZ87NMlBUcX3gzOichdBmIoiHSnCRq10BGEqinSkCBu10hGEqSjSkSJs1EpHEKaiSEeKsFErHUGYiiIdKcJGrXQEYSqKfsaRB7YwDVopmL/PAAAAAElFTkSuQmCC</data> + <data key="type">image/png</data> + <data key="name" unique="prefix">red.png</data> + <data key="baseImage_md5">55942e709d0a1c85d5174839c2e55cea</data> + <data key="thumbnailImage_md5">263ab50a24625c8d4f855cee8b947daa</data> + </entity> + <entity name="MagentoPlaceHolderImageContent" type="ImageContent"> + <data key="baseImage_md5">c0459a796c5b8ee74254472c235a7460</data> + </entity> </entities> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMediaGalleryEntryData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMediaGalleryEntryData.xml index 7016a1c1d0358..5cc6b4ea34299 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMediaGalleryEntryData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMediaGalleryEntryData.xml @@ -20,6 +20,18 @@ <data key="disabled">false</data> <requiredEntity type="ImageContent">TestImageContent</requiredEntity> </entity> + <entity name="ApiProductAttributeMediaGalleryEntryTestImage2" type="ProductAttributeMediaGalleryEntry"> + <data key="media_type">image</data> + <data key="label" unique="suffix">Adobe Base </data> + <data key="position">1</data> + <array key="types"> + <item>image</item> + <item>small_image</item> + <item>thumbnail</item> + </array> + <data key="disabled">false</data> + <requiredEntity type="ImageContent">AdobeBaseContent</requiredEntity> + </entity> <entity name="ApiProductAttributeMediaGalleryEntryMagentoLogo" type="ProductAttributeMediaGalleryEntry"> <data key="media_type">image</data> <data key="label" unique="suffix">Magento Logo </data> @@ -30,6 +42,23 @@ <data key="disabled">false</data> <requiredEntity type="ImageContent">MagentoLogoImageContent</requiredEntity> </entity> + <entity name="ApiProductAttributeMediaGalleryEntryBluePng" type="ProductAttributeMediaGalleryEntry"> + <data key="media_type">image</data> + <data key="label" unique="suffix">Blue PNG </data> + <data key="position">1</data> + <array key="types"> + <item>image</item> + <item>small_image</item> + <item>thumbnail</item> + <item>swatch</item> + </array> + <data key="disabled">false</data> + <requiredEntity type="ImageContent">BluePngImageContent</requiredEntity> + </entity> + <entity name="ApiProductAttributeMediaGalleryEntryRedPng" extends="ApiProductAttributeMediaGalleryEntryBluePng" type="ProductAttributeMediaGalleryEntry"> + <data key="label" unique="suffix">Red PNG </data> + <requiredEntity type="ImageContent">RedPngImageContent</requiredEntity> + </entity> <!-- From file "export_import_configurable_product.csv" --> <entity name="ApiProductAttributeMediaGalleryForExportImport" extends="ApiProductAttributeMediaGalleryEntryTestImage" type="ProductAttributeMediaGalleryEntry"> <data key="label">Magento Logo</data> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml index 5375459122e69..567b3940eb6fa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml @@ -11,7 +11,7 @@ <entity name="_defaultProduct" type="product"> <data key="name" unique="suffix">testProductName</data> <data key="sku" unique="suffix">testSku</data> - <data key="urlKey" unique="suffix">testurlkey</data> + <data key="urlKey" unique="suffix">testproductname</data> <data key="type_id">simple</data> <data key="attribute_set_id">4</data> <data key="visibility">4</data> @@ -39,6 +39,10 @@ <data key="name">TestFooBar</data> <data key="sku" unique="suffix">foobar</data> </entity> + <entity name="ApiSimpleProductWithDoubleSpaces" type="product" extends="ApiSimpleProduct"> + <data key="name">Simple Product Double Space</data> + <data key="sku" unique="suffix">simple-product double-space</data> + </entity> <entity name="ApiSimpleProductWithSpecCharInName" type="product" extends="ApiSimpleProduct"> <data key="name">Pursuit Lumaflex&trade; Tone Band</data> <data key="sku" unique="suffix">x&trade;</data> @@ -59,9 +63,9 @@ <data key="urlKey" unique="suffix">api-simple-product</data> </entity> <entity name="SimpleProduct" type="product"> - <data key="name" unique="suffix">SimpleProduct</data> + <data key="name" unique="suffix">Simple Product </data> <data key="sku" unique="suffix">SimpleProduct</data> - <data key="urlKey" unique="suffix">simpleproduct</data> + <data key="urlKey" unique="suffix">simple-product-</data> <data key="type_id">simple</data> <data key="attribute_set_id">4</data> <data key="price">123.00</data> @@ -72,6 +76,11 @@ <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> </entity> + <entity name="SimpleProduct_NoSpaces" extends="SimpleProduct" type="product"> + <data key="name" unique="suffix">SimpleProduct</data> + <data key="sku" unique="suffix">SimpleProduct</data> + <data key="urlKey" unique="suffix">simpleproduct</data> + </entity> <entity name="ProductForPartialSearch" extends="SimpleProduct" type="product"> <data key="sku">partialTestSku</data> </entity> @@ -135,8 +144,9 @@ <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> </entity> <entity name="SimpleProduct2" type="product"> - <data key="name" unique="suffix">SimpleProduct</data> - <data key="sku" unique="suffix">SimpleProduct</data> + <data key="name" unique="suffix">Simple Product 2 </data> + <data key="sku" unique="suffix">SimpleProduct2</data> + <data key="urlKey" unique="suffix">simple-product-2-</data> <data key="type_id">simple</data> <data key="attribute_set_id">4</data> <data key="price">123.00</data> @@ -147,15 +157,15 @@ <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> </entity> <entity name="SimpleProduct3" type="product"> - <data key="name" unique="suffix">simple</data> - <data key="sku" unique="suffix">simple</data> + <data key="name" unique="suffix">Simple Product 3 </data> + <data key="sku" unique="suffix">SimpleProduct3</data> + <data key="urlKey" unique="suffix">simple-product-3-</data> <data key="type_id">simple</data> <data key="attribute_set_id">4</data> <data key="price">123.00</data> <data key="visibility">4</data> <data key="status">1</data> <data key="quantity">1000</data> - <data key="urlKey" unique="suffix">simple</data> <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> </entity> @@ -1392,9 +1402,34 @@ <entity name="SimpleProductUpdatePrice16" type="product2"> <data key="price">16.00</data> </entity> + <entity name="SimpleProductUpdatePrice90" type="product2"> + <data key="price">90.00</data> + </entity> + <entity name="SimpleProductUpdatePrice95" type="product2"> + <data key="price">95.00</data> + </entity> + <entity name="SimpleProductUpdatePrice80" type="product2"> + <data key="price">80.00</data> + </entity> <entity name="ProductWithTwoTextFieldOptions" type="product"> <var key="sku" entityType="product" entityKey="sku" /> <requiredEntity type="product_option">ProductOptionField</requiredEntity> <requiredEntity type="product_option">ProductOptionField2</requiredEntity> </entity> + <entity name="SimpleProductWithCustomSku24MB01" type="product" extends="SimpleProduct2"> + <data key="name" unique="suffix">ProductWithSku24MB01-</data> + <data key="sku" unique="suffix">24 MB01</data> + </entity> + <entity name="SimpleProductWithCustomSku24MB02" type="product" extends="SimpleProduct2"> + <data key="name" unique="suffix">ProductWithSku24MB02-</data> + <data key="sku" unique="suffix">24 MB02 </data> + </entity> + <entity name="SimpleProductWithCustomSku24MB04" type="product" extends="SimpleProduct2"> + <data key="name" unique="suffix">ProductWithSku24MB04-</data> + <data key="sku" unique="suffix">24 MB04 </data> + </entity> + <entity name="SimpleProductWithCustomSku24MB06" type="product" extends="SimpleProduct2"> + <data key="name" unique="suffix">ProductWithSku24MB06-</data> + <data key="sku" unique="suffix">24 MB06 </data> + </entity> </entities> diff --git a/app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php b/app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php new file mode 100644 index 0000000000000..14867cd130cd5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php @@ -0,0 +1,337 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Mftf\Helper; + +use Codeception\Lib\ModuleContainer; +use Magento\Framework\Filesystem\Driver\File; +use Magento\Framework\Filesystem\DriverInterface; +use Magento\FunctionalTestingFramework\Helper\Helper; + +/** + * Class for MFTF helpers for doing file assertions using the local filesystem. + * + * If relative file paths are given assume they're in context of the Magento base path. + */ +class LocalFileAssertions extends Helper +{ + /** + * @var DriverInterface $driver + */ + private $driver; + + /** + * Call the parent constructor then create the local filesystem driver + * + * @param ModuleContainer $moduleContainer + * @param array|null $config + * @return void + */ + public function __construct(ModuleContainer $moduleContainer, ?array $config = null) + { + parent::__construct($moduleContainer, $config); + + $this->driver = new File(); + } + + /** + * Create a text file + * + * @param string $filePath + * @param string $text + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function createTextFile($filePath, $text): void + { + $realPath = $this->expandPath($filePath); + $this->driver->filePutContents($realPath, $text); + } + + /** + * Delete a file if it exists + * + * @param string $filePath + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function deleteFileIfExists($filePath): void + { + $realPath = $this->expandPath($filePath); + if ($this->driver->isExists($realPath)) { + $this->driver->deleteFile($realPath); + } + } + + /** + * Recursive delete directory + * + * @param string $path + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function deleteDirectory($path): void + { + $realPath = $this->expandPath($path); + if ($this->driver->isExists($realPath)) { + $this->driver->deleteDirectory($realPath); + } + } + + /** + * Copy source into destination + * + * @param string $source + * @param string $destination + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function copy($source, $destination): void + { + $sourceRealPath = $this->expandPath($source); + $destinationRealPath = $this->expandPath($destination); + $this->driver->copy($sourceRealPath, $destinationRealPath); + } + + /** + * Create directory + * + * @param string $path + * @param int $permissions + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function createDirectory($path, $permissions = 0777): void + { + $permissions = $this->convertOctalStringToDecimalInt($permissions); + $sourceRealPath = $this->expandPath($path); + $oldUmask = umask(0); + $this->driver->createDirectory($sourceRealPath, $permissions); + umask($oldUmask); + } + + /** + * Assert a file exists + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileExists($filePath, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertTrue($this->driver->isExists($realPath), "Failed asserting $filePath exists. " . $message); + } + + /** + * Asserts that a file with the given glob pattern exists in the given path + * + * @param string $path + * @param string $pattern + * @param string $message + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileExists($path, $pattern, $message = ''): void + { + $realPath = $this->expandPath($path); + $files = $this->driver->search($pattern, $realPath); + $this->assertNotEmpty($files, "Failed asserting file matching glob pattern \"$pattern\" at location \"$path\" is not empty. " . $message); + } + + /** + * Asserts that a file or directory exists + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertPathExists($path, $message = ''): void + { + $realPath = $this->expandPath($path); + $this->assertTrue($this->driver->isExists($realPath), "Failed asserting $path exists. " . $message); + } + + /** + * Asserts that a file or directory does not exist + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertPathDoesNotExist($path, $message = ''): void + { + $realPath = $this->expandPath($path); + $this->assertFalse($this->driver->isExists($realPath), "Failed asserting $path does not exist. " . $message); + } + + /** + * Assert a file does not exist + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileDoesNotExist($filePath, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertFalse($this->driver->isExists($realPath), $message); + } + + /** + * Assert a file has no contents + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileEmpty($filePath, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertEmpty($this->driver->fileGetContents($realPath), "Failed asserting $filePath is empty. " . $message); + } + + /** + * Assert a file is not empty + * + * @param string $filePath + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileNotEmpty($filePath, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertNotEmpty($this->driver->fileGetContents($realPath), "Failed asserting $filePath is not empty. " . $message); + } + + /** + * Assert a file contains a given string + * + * @param string $filePath + * @param string $text + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileContainsString($filePath, $text, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertStringContainsString($text, $this->driver->fileGetContents($realPath), "Failed asserting $filePath contains $text. " . $message); + } + + /** + * Asserts that a file with the given glob pattern at the given path contains a given string + * + * @param string $path + * @param string $pattern + * @param string $text + * @param int $fileIndex + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ''): void + { + $realPath = $this->expandPath($path); + $files = $this->driver->search($pattern, $realPath); + $this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), "Failed asserting file of index \"$fileIndex\" matching glob pattern \"$pattern\" at location \"$path\" contains $text. " . $message); + } + + /** + * Assert a file does not contain a given string + * + * @param string $filePath + * @param string $text + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertFileDoesNotContainString($filePath, $text, $message = ''): void + { + $realPath = $this->expandPath($filePath); + $this->assertStringNotContainsString($text, $this->driver->fileGetContents($realPath), "Failed asserting $filePath does not contain $text. " . $message); + } + + /** + * Asserts that a directory is empty + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertDirectoryEmpty($path, $message = ''): void + { + $realPath = $this->expandPath($path); + $this->assertEmpty($this->driver->readDirectory($realPath), "Failed asserting $path is empty. " . $message); + } + + /** + * Asserts that a directory is not empty + * + * @param string $path + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertDirectoryNotEmpty($path, $message = ''): void + { + $realPath = $this->expandPath($path); + $this->assertNotEmpty($this->driver->readDirectory($realPath), "Failed asserting $path is not empty. " . $message); + } + + /** + * Helper function to convert an octal string to its decimal equivalent + * + * @param string $string + * @return int + * + */ + private function convertOctalStringToDecimalInt($string): int + { + if (is_string($string)) { + $string = octdec($string); + } + return $string; + } + + /** + * Helper function to construct the real path to the file + * + * If the given path isn't an absolute path then assume it's in context of the Magento root + * + * @param string $filePath + * @return string + */ + private function expandPath($filePath): string + { + return (substr($filePath, 0, 1) === '/') ? $filePath : MAGENTO_BP . '/' . $filePath; + + } +} diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryMessagesSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryMessagesSection.xml index ea4f4bf53eb71..14bf132c6a0cb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryMessagesSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryMessagesSection.xml @@ -11,5 +11,6 @@ <section name="AdminCategoryMessagesSection"> <element name="SuccessMessage" type="text" selector=".message-success"/> <element name="errorMessage" type="text" selector="//div[@class='message message-error error']"/> + <element name="saveCategoryWarningMessage" type="text" selector=".message-warning"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml index d70c48f2b00e3..590b9a185e5e4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml @@ -75,6 +75,7 @@ <element name="selectMultipleCategories" type="input" selector="//*[@data-index='container_category_ids']//*[contains(@class, '_selected')]"/> <element name="countryOfManufacture" type="select" selector="select[name='product[country_of_manufacture]']"/> <element name="newAddedAttribute" type="text" selector="//fieldset[@class='admin__fieldset']//div[contains(@data-index,'{{attributeCode}}')]" parameterized="true"/> + <element name="newAddedAttributeInput" type="text" selector="//fieldset[@class='admin__fieldset']//div[contains(@data-index,'{{attributeCode}}')]//input" parameterized="true"/> <element name="newCategoryButton" type="button" selector="button[data-index='create_category_button']" timeout="30"/> <element name="footerBlock" type="block" selector="//footer"/> <element name="categories" type="text" selector="//*[@class='admin__action-multiselect-crumb']/span[contains(text(), '{{categoryName}}')]" parameterized="true"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductImagesSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductImagesSection.xml index 0d26c43d2c34b..0de3e6de1dee1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductImagesSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductImagesSection.xml @@ -13,6 +13,7 @@ <element name="imageFileUpload" type="input" selector="#fileupload"/> <element name="imageUploadButton" type="button" selector="div.image div.fileinput-button"/> <element name="imageFile" type="text" selector="//*[@id='media_gallery_content']//img[contains(@src, '{{url}}')]" parameterized="true"/> + <element name="imageFileRoleByImage" type="text" selector="//*[@id='media_gallery_content']//img[contains(@src, '{{url}}')]/ancestor::div[@data-role='image']//*[@data-role-code='{{roleCode}}']" parameterized="true"/> <element name="imageElement" type="text" selector="#media_gallery_content img"/> <element name="removeImageButton" type="button" selector=".action-remove"/> <element name="removeImageButtonForExactImage" type="button" selector="[id='media_gallery_content'] img[src*='{{imageName}}'] + div[class='actions'] button[class='action-remove']" parameterized="true"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductMessagesSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductMessagesSection.xml index c51d481d7dc5e..ff7edf14a50f9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductMessagesSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductMessagesSection.xml @@ -11,5 +11,6 @@ <section name="AdminProductMessagesSection"> <element name="successMessage" type="text" selector=".message.message-success.success"/> <element name="errorMessage" type="text" selector=".message.message-error.error"/> + <element name="saveProductWarningMessage" type="text" selector=".message-warning"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml index 848035b911aab..3131e9a89e8cd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml @@ -16,8 +16,9 @@ <element name="filterOptionByLabel" type="button" selector=" div.filter-options-item div[data-option-label='{{optionLabel}}']" parameterized="true"/> <element name="removeFilter" type="button" selector="div.filter-current .remove" timeout="30"/> <element name="activeFilterOptions" type="text" selector=".filter-options-item.active .items"/> - <element name="activeFilterOptionItemByPosition" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a" parameterized="true"/> + <element name="activeFilterOptionItemByPosition" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a" parameterized="true" timeout="30"/> <element name="enabledFilterOptionItemByLabel" type="text" selector="//div[@class='filter-options']//li[@class='item']//a[contains(text(), '{{optionLabel}}')]" parameterized="true" timeout="30"/> <element name="disabledFilterOptionItemByLabel" type="text" selector="//div[@class='filter-options']//li[@class='item' and contains(text(), '{{optionLabel}}')]" parameterized="true" timeout="30"/> + <element name="visibleOptionQty" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a .count" parameterized="true" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductCompareMainSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductCompareMainSection.xml index ad31be6b277ee..f8000a25efdcf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductCompareMainSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductCompareMainSection.xml @@ -14,5 +14,7 @@ <element name="ProductPriceByName" type="text" selector="//*[@id='product-comparison']//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]]//span[@class='price']" parameterized="true"/> <element name="ProductImageByName" type="text" selector="//*[@id='product-comparison']//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]]//img[@class='product-image-photo']" parameterized="true"/> <element name="ProductAttributeByCodeAndProductName" type="text" selector="//*[@id='product-comparison']//tr[.//th[./span[contains(text(), '{{var1}}')]]]//td[count(//*[@id='product-comparison']//tr//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var2}}')]]/preceding-sibling::td)+1]/div" parameterized="true"/> + <element name="ProductAddToCartButton" type="button" selector=".product-item-photo[title='{{productName}}'] ~ .product-item-actions button[type='submit']" parameterized="true" timeout="30"/> + <element name="removeFirstItem" type="button" selector="table.table-comparison a.delete"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml index 5efa094e2c35e..63b50e2d82f07 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml @@ -11,6 +11,7 @@ <section name="StorefrontProductMediaSection"> <element name="gallerySpinner" type="block" selector="#maincontent .fotorama__spinner--show" /> <element name="gallery" type="block" selector="[data-gallery-role='gallery']" timeout="30"/> + <element name="galleryNoControlsElement" type="block" selector=".fotorama__wrap.fotorama__wrap--no-controls"/> <element name="productImage" type="text" selector="//*[@data-gallery-role='gallery' and not(contains(@class, 'fullscreen'))]//img[contains(@src, '{{filename}}') and not(contains(@class, 'full'))]" parameterized="true" /> <element name="productImageFullscreen" type="text" selector="//*[@data-gallery-role='gallery' and contains(@class, 'fullscreen')]//img[contains(@src, '{{filename}}') and contains(@class, 'full')]" parameterized="true" /> <element name="closeFullscreenImage" type="button" selector="//*[@data-gallery-role='gallery' and contains(@class, 'fullscreen')]//*[@data-gallery-role='fotorama__fullscreen-icon']" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml index e1499a2484353..fad0b26262d0a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml @@ -22,9 +22,7 @@ <before> <comment userInput="Adding the comment for preserving Backward Compatibility" stepKey="loginAsAdmin"/> <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <createData entity="SimpleSubCategory" stepKey="category"/> <createData entity="SimpleProduct4" stepKey="product"> <requiredEntity createDataKey="category"/> @@ -33,9 +31,7 @@ <after> <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="product" stepKey="deleteProduct"/> <deleteData createDataKey="category" stepKey="deleteCategory"/> <comment userInput="Adding the comment for preserving Backward Compatibility" stepKey="logout"/> @@ -58,9 +54,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_product_price"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <comment userInput="Open product page | Comment is kept to preserve the step key for backward compatibility" stepKey="openProductPage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToSimpleProductPage2"/> @@ -84,8 +78,7 @@ <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage"> <argument name="categoryName" value="$$category.name$$"/> </actionGroup> - - <actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage"/> + <comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="navigateToComparePage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad"/> <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList"> @@ -98,11 +91,13 @@ <argument name="categoryName" value="$$category.name$$"/> </actionGroup> - <actionGroup ref="StorefrontClearCompareActionGroup" stepKey="clickClearAll"/> + <actionGroup ref="StorefrontRemoveFirstProductFromCompareActionGroup" stepKey="clickClearAll"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmPageLoad"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="confirmProdDelate"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmLoad"/> - <comment userInput="Add product to compare list fom Category page | Comment is kept to preserve the step key for backward compatibility" stepKey="addToCmpFromCategPage"/> + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="addToCmpFromCategPage"> + <argument name="categoryName" value="$$category.name$$"/> + </actionGroup> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverOverProduct"/> @@ -114,11 +109,11 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabTextFromSuccessMessage2"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertSuccessMessage2"/> - <comment userInput="Check that product displays on add to compare widget | Comment is kept to preserve the step key for backward compatibility" stepKey="checkProdNameOnWidget"/> - <seeElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName($$product.name$$)}}" stepKey="seeProdNameOnCmpWidget"/> + <comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="checkProdNameOnWidget"/> + <comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="seeProdNameOnCmpWidget"/> <comment userInput="See product in the compare page" stepKey="seeProductInComparePage"/> - <actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage2"/> + <comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="navigateToComparePage2"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad2"/> <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList2"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml index 2dc840b60f3b8..bed5297041dd1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml @@ -42,9 +42,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"> - <argument name="image" value="MagentoLogo"/> - </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml index d1e292ff56444..d713660d7ee63 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml index 029c304873ce2..32444e3fee20f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml @@ -48,7 +48,7 @@ <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCatalog"/> - <amOnPage url="/{{SimpleSubCategory.name_lwr}}.html" stepKey="goToCategoryFrontPage"/> + <amOnPage url="/{{SimpleSubCategory.urlKey}}.html" stepKey="goToCategoryFrontPage"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <seeElement selector="{{StorefrontCategoryMainSection.mediaDescription(ImageUpload3.content)}}" stepKey="assertMediaDescription"/> <seeElementInDOM selector="{{StorefrontCategoryMainSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml index 5ea7253619ed9..e5c8cc5ee342c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml @@ -103,7 +103,7 @@ <click selector="{{ProductShortDescriptionWYSIWYGToolbarSection.OkBtn}}" stepKey="clickOkBtn2" /> <waitForPageLoad stepKey="waitForPageLoad6"/> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> - <amOnPage url="{{_defaultProduct.name}}.html" stepKey="navigateToProductPage"/> + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForPageLoad7"/> <seeElement selector="{{StorefrontProductInfoMainSection.mediaDescription}}" stepKey="assertMediaDescription"/> <seeElementInDOM selector="{{StorefrontCategoryMainSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource3"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml index 73019bb5ec0e0..a574b0c7eabf3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml @@ -59,17 +59,15 @@ <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Verify product is visible in category front page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="openCategoryStoreFrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="openCategoryStoreFrontPage"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="seeCategoryInFrontPage"/> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="clickOnCategory"/> <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInCategoryPage"/> <!--Verify Product In Store Front--> - <amOnPage url="$$createSimpleProduct.name$$.html" stepKey="goToStorefrontPage"/> + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInStoreFront"/> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{SimpleProduct.price}}" stepKey="seeProductPriceInStoreFront"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml index 1ed079b12d1fd..8add42ec7493f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml @@ -55,14 +55,14 @@ <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin1"> <argument name="Customer" value="$$createSimpleUSCustomer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage1"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage1"/> <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('90')}}" stepKey="assertProductFinalPriceIs90_1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabel_1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmount_1"/> <amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="logoutCustomer1"/> <waitForPageLoad time="30" stepKey="waitForPageLoad2"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage2"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad3"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('90')}}" stepKey="assertProductFinalPriceIs90_2"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabel_2"/> @@ -79,14 +79,14 @@ <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" userInput="General" stepKey="selectCustomerGroupGeneral"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton2"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage3"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage3"/> <waitForPageLoad time="30" stepKey="waitForPageLoad4"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('100')}}" stepKey="assertProductFinalPriceIs100_1"/> <dontSeeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabel_3"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin2"> <argument name="Customer" value="$$createSimpleUSCustomer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage4"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage4"/> <waitForPageLoad time="30" stepKey="waitForPageLoad5"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('90')}}" stepKey="assertProductFinalPriceIs90_3"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabel_4"/> @@ -109,19 +109,19 @@ <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('1')}}" userInput="18" stepKey="selectProductTierPricePriceInput18"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton3"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage5"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage5"/> <waitForPageLoad time="30" stepKey="waitForPageLoad6"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('100')}}" stepKey="assertProductFinalPriceIs100_2"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('As low as')}}" stepKey="assertAsLowAsPriceLabel_1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLinkAfterLabel('As low as', '82')}}" stepKey="assertPriceAfterAsLowAsLabel_1"/> <amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="logoutCustomer2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad7"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage6"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage6"/> <waitForPageLoad time="30" stepKey="waitForPageLoad8"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('100')}}" stepKey="assertProductFinalPriceIs100_3"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('As low as')}}" stepKey="assertAsLowAsPriceLabel_2"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLinkAfterLabel('As low as', '82')}}" stepKey="assertPriceAfterAsLowAsLabel_2"/> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="goToProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage1"/> <waitForPageLoad time="30" stepKey="waitForPageLoad9"/> <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceByForTextLabel('1', '15')}}" stepKey="assertProductTierPriceByForTextLabelForFirstRow1"/> <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceByForTextLabel('2', '20')}}" stepKey="assertProductTierPriceByForTextLabelForSecondRow1"/> @@ -213,7 +213,7 @@ <expectedResult type="string">$1,500.00</expectedResult> <actualResult type="variable">grabTextFromSubtotalField6</actualResult> </assertEquals> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="goToProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad10"/> <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceByForTextLabel('1', '15')}}" stepKey="assertProductTierPriceByForTextLabelForFirstRow2"/> <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceByForTextLabel('2', '20')}}" stepKey="assertProductTierPriceByForTextLabelForSecondRow2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml index 0b29d2edb6615..6ffd157468099 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -32,7 +32,7 @@ <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> - + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="loginAsAdmin"/> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -41,6 +41,10 @@ <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> + <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButtonForAssert"/> + <actionGroup ref="AssertAdminProductFormAdvancedPricingAddTierPriceActionGroup" stepKey="assertProductTierPriceInput"/> + <actionGroup ref="AdminProductFormDoneAdvancedPricingDialogActionGroup" stepKey="doneButtonAfterAssert"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToTopOfPage"/> <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCustomerGroupPriceAddButton"/> @@ -60,7 +64,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goProductPageOnStorefront"> - <argument name="productUrl" value="$$createSimpleProduct.sku$$"/> + <argument name="productUrl" value="$$createSimpleProduct.custom_attributes[url_key]$$"/> </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml index b52d18f3c0203..7a99afa3dcba7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <!-- Verify Parent Category and Sub category is not visible in navigation menu --> - <amOnPage url="$$createCategory.name_lwr$$/{{SimpleSubCategory.name_lwr}}.html" stepKey="openCategoryStoreFrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$/{{SimpleSubCategory.urlKey}}.html" stepKey="openCategoryStoreFrontPage"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="dontSeeCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigation"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml index a4a42a9999a5c..f361345478b53 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml @@ -41,7 +41,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <!-- Verify Parent Category and Sub category is not visible in navigation menu --> - <amOnPage url="$$createCategory.name_lwr$$/{{SimpleSubCategory.name_lwr}}.html" stepKey="openCategoryStoreFrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$/{{SimpleSubCategory.urlKey}}.html" stepKey="openCategoryStoreFrontPage"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="dontSeeCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigation"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml index 99fd1cf3caf3f..88d24540b11f8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <!-- Verify Parent Category and Sub category is not visible in navigation menu --> - <amOnPage url="$$createCategory.name_lwr$$/{{SimpleSubCategory.name_lwr}}.html" stepKey="openCategoryStoreFrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$/{{SimpleSubCategory.urlKey}}.html" stepKey="openCategoryStoreFrontPage"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="dontSeeCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigation"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml index 3fff2c118ae6d..f956c73319425 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml @@ -124,7 +124,7 @@ <waitForPageLoad stepKey="waitForPageTitleToBeSaved"/> <!--Open Category Store Front Page--> <comment userInput="Open Category Store Front Page" stepKey="commentOpenCategoryOnStorefront"/> - <amOnPage url="{{_defaultCategory.name}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{_defaultCategory.urlKey}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="selectCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml index 32c1599355f81..8e45c223fbf49 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml @@ -89,7 +89,7 @@ <!--See correct placeholder images on category page--> <comment userInput="Check placeholder images on the storefront" stepKey="checkStorefrontComment"/> - <amOnPage url="$$category.name$$.html" stepKey="goToCategoryStorefront1"/> + <amOnPage url="$$category.custom_attributes[url_key]$$.html" stepKey="goToCategoryStorefront1"/> <waitForPageLoad stepKey="waitForStorefrontCategory1"/> <!--Product with no images uses placeholder--> <seeElement selector="{{StorefrontCategoryProductSection.ProductImageByName($$productNoImages.name$$)}}" stepKey="seeProductNoImagesInCategory"/> @@ -124,7 +124,7 @@ <argument name="productName" value="$$productNoImages.name$$"/> </actionGroup> <!--Product which is NOT using placeholder--> - <amOnPage url="$$category.name$$.html" stepKey="goToCategoryStorefront2"/> + <amOnPage url="$$category.custom_attributes[url_key]$$.html" stepKey="goToCategoryStorefront2"/> <waitForPageLoad stepKey="waitForStorefrontCategory2"/> <click selector="{{StorefrontCategoryProductSection.ProductImageByName($$productWithImages.name$$)}}" stepKey="goToProductWithImages"/> <waitForPageLoad stepKey="waitForProductPageLoad2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml index 0525e7543accb..1ba9c3a6ddc7b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml @@ -64,7 +64,7 @@ <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{_defaultProduct.name}}"/> + <argument name="productUrl" value="{{_defaultProduct.urlKey}}"/> </actionGroup> <!-- Assert related products at the storefront --> @@ -114,7 +114,7 @@ <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="{{SimpleProduct.name}}"/> + <argument name="productUrl" value="{{SimpleProduct.urlKey}}"/> </actionGroup> <!-- Assert related products at the storefront --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml index ce3dd8fa0873c..61b7b8f6eaca8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml @@ -97,7 +97,7 @@ <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{defaultVirtualProduct.name}}"/> + <argument name="productUrl" value="{{defaultVirtualProduct.urlKey}}"/> </actionGroup> <!-- Assert two related products at the storefront --> @@ -166,7 +166,7 @@ <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="{{SimpleProduct.name}}"/> + <argument name="productUrl" value="{{SimpleProduct.urlKey}}"/> </actionGroup> <!-- Assert three related products at the storefront --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml index 8d0534891a29b..6886775bff57c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml @@ -71,15 +71,13 @@ </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Verify Product in store front page--> - <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name_lwr)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryPageTitle"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/> <waitForPageLoad stepKey="waitForProductToLoad"/> - <seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.urlKey$$)}}" stepKey="seeProductInCategory"/> + <seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="seeProductInCategory"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml index f61a97219903f..fcffd272a2fe4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml @@ -67,7 +67,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveFifthLevelCategory"/> <!-- Verify success message --> <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage4"/> - <amOnPage url="/{{FirstLevelSubCat.name}}/{{SecondLevelSubCat.name}}/{{ThirdLevelSubCat.name}}/{{FourthLevelSubCat.name}}/{{FifthLevelCat.name}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> + <amOnPage url="/{{FirstLevelSubCat.urlKey}}/{{SecondLevelSubCat.urlKey}}/{{ThirdLevelSubCat.urlKey}}/{{FourthLevelSubCat.urlKey}}/{{FifthLevelCat.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> <waitForPageLoad time="60" stepKey="waitForStoreFrontPageLoad"/> <!--<Verify category displayed in store front page--> <grabMultiple selector=".breadcrumbs li" stepKey="breadcrumbs"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml index 4173254c66fc3..d6fb7d0aa2c80 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml @@ -80,12 +80,12 @@ </actionGroup> <!--Verify Product in store front page--> - <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name_lwr)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryPageTitle"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/> <waitForPageLoad stepKey="waitForProductToLoad"/> - <seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.urlKey$$)}}" stepKey="seeProductInCategory"/> + <seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="seeProductInCategory"/> <dontSeeElement selector="{{StorefrontCategorySidebarSection.filterOptions}}" stepKey="dontSeeFilterOptionsForNonAnchorCategory"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml index af72dba3f8051..31ad92afb9d4f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml @@ -36,7 +36,7 @@ <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" /> <seeElement selector="{{AdminCategoryContentSection.activeCategoryInTree(_defaultCategory.name)}}" stepKey="seeCategoryInTree" /> <!--Verify Category is listed in store front page menu/>--> - <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryPageTitle"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml index 10cba3ab209ef..4758bf63859b8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml @@ -114,7 +114,7 @@ <see selector="{{AdminProductAttributeGridSection.isComparableColumn}}" userInput="Yes" stepKey="seeComparableColumn"/> <!--Verify Product Attribute is present in Category Store Front Page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad"/> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="clickOnCategory"/> <waitForPageLoad stepKey="waitForPageToLoad"/> @@ -130,7 +130,7 @@ <see selector="{{StorefrontProductMoreInformationSection.attributeValue}}" userInput="{{ProductAttributeOption8.value}}" stepKey="seeAttributeValue"/> <!--Verify Product Attribute present in search page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage1"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage1"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad1"/> <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{ProductAttributeOption8.value}}" stepKey="fillAttribute"/> <waitForPageLoad stepKey="waitForSearchTextBox"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml index 9db8e74b6ae7a..5931193dbe7ca 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml @@ -82,10 +82,7 @@ <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSave"/> <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Go to store's advanced catalog search page --> <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml index 7447c75a778af..47c7f86067cf6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml @@ -31,9 +31,7 @@ <argument name="storeView" value="customStoreFR"/> </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Enable Flat Catalog Category --> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> <!--Open Index Management Page and Select Index mode "Update by Schedule" --> @@ -64,14 +62,12 @@ <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{CatNotActive.name}}" stepKey="seeUpdatedCategoryTitle"/> <dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="verifyInactiveCategory"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Open Index Management Page --> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/> <!--Verify Category In Store Front--> - <amOnPage url="/$$createCategory.name$$.html" stepKey="openCategoryPage1"/> + <amOnPage url="/$$createCategory.custom_attributes[url_key]$$.html" stepKey="openCategoryPage1"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <seeElement selector="{{StorefrontBundledSection.pageNotFound}}" stepKey="seeWhoopsOurBadMessage"/> <!--Verify category is not visible in First Store View --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml index df2124759686d..fc09a1ac07d57 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml @@ -31,9 +31,7 @@ <argument name="storeView" value="customStoreFR"/> </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Enable Flat Catalog Category --> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> <!--Open Index Management Page and Select Index mode "Update by Schedule" --> @@ -67,13 +65,11 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_category_flat"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/> <!--Verify Category In Store Front--> - <amOnPage url="/$$createCategory.name$$.html" stepKey="openCategoryPage1"/> + <amOnPage url="/$$createCategory.custom_attributes[url_key]$$.html" stepKey="openCategoryPage1"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <!--Verify category is not visible in First Store View --> <click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml index 2f86209da1eba..a2bd771c58fec 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml @@ -31,9 +31,7 @@ <argument name="storeView" value="customStoreFR"/> </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Enable Flat Catalog Category --> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> <!--Open Index Management Page and Select Index mode "Update by Schedule" --> @@ -68,13 +66,11 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_category_flat"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/> <!--Verify Category In Store Front--> - <amOnPage url="/$$category.name$$.html" stepKey="openCategoryPage1"/> + <amOnPage url="/$$category.custom_attributes[url_key]$$.html" stepKey="openCategoryPage1"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <!--Verify category is not displayed in navigation menu in First Store View --> <click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml index 7b555aa84be05..45b776a6c8713 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml @@ -86,10 +86,7 @@ <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSave"/> <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Go to store's advanced catalog search page --> <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 100d4bdef5f48..8f56a062c9113 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -110,7 +110,7 @@ <see selector="{{AdminProductAttributeGridSection.isComparableColumn}}" userInput="Yes" stepKey="seeComparableColumn"/> <!--Verify Product Attribute is present in Category Store Front Page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad"/> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="clickOnCategory"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> @@ -126,7 +126,7 @@ <see selector="{{StorefrontProductMoreInformationSection.attributeValue}}" userInput="{{ProductAttributeOption8.value}}" stepKey="seeAttributeValue"/> <!--Verify Product Attribute present in search page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToStorefrontPage1"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage1"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad1"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillAttribute"> <argument name="phrase" value="{{ProductAttributeOption8.value}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml index d1110f593545d..432e64bded122 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml @@ -79,7 +79,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Check the storefront --> - <amOnPage url="{{_defaultProduct.name}}.html" stepKey="goToProductPage"/> + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <seeInTitle userInput="{{_defaultProduct.name}}" stepKey="seeProductNameInTitlte"/> <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml index 6b3768cc88b3c..e61684b91c082 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml @@ -32,13 +32,24 @@ <actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickAddSimpleProduct"> <argument name="productType" value="simple"/> </actionGroup> - <fillField userInput="$$simpleProduct.name$$new" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <fillField userInput="$$simpleProduct.sku$$new" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> - <fillField userInput="$$simpleProduct.price$$" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> - <fillField userInput="$$simpleProduct.quantity$$" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> + <actionGroup ref="AdminFillProductNameOnProductFormActionGroup" stepKey="fillName"> + <argument name="productName" value="$$simpleProduct.name$$new"/> + </actionGroup> + <actionGroup ref="AdminFillProductSkuOnProductFormActionGroup" stepKey="fillSKU"> + <argument name="productSku" value="$$simpleProduct.sku$$new"/> + </actionGroup> + <actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="fillPrice"> + <argument name="price" value="$$simpleProduct.price$$"/> + </actionGroup> + <actionGroup ref="AdminFillProductQtyOnProductFormActionGroup" stepKey="fillQuantity"> + <argument name="productQty" value="$$simpleProduct.quantity$$"/> + </actionGroup> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> <fillField userInput="$$simpleProduct.custom_attributes[url_key]$$" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> - <see userInput="The value specified in the URL Key field would generate a URL that already exists" selector="{{AdminProductMessagesSection.errorMessage}}" stepKey="assertErrorMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertErrorMessage"> + <argument name="messageType" value="error"/> + <argument name="message" value="The value specified in the URL Key field would generate a URL that already exists"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml index 12cd5454ea8e2..deaa736ea6b4f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml @@ -23,7 +23,11 @@ <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> </before> <after> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{simpleProductNotVisibleIndividually.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml index ac2e86a572455..819835dead304 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml @@ -5,8 +5,8 @@ * See COPYING.txt for license details. */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminConfigDefaultProductLayoutFromConfigurationSettingTest"> <annotations> <features value="Catalog"/> @@ -21,18 +21,29 @@ <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="RestoreLayoutSetting" stepKey="sampleActionGroup"/> + <actionGroup ref="NavigateToDefaultLayoutsSettingActionGroup" stepKey="navigateToWebConfigurationPage1"/> + <actionGroup ref="AdminSetProductLayoutSettingsActionGroup" stepKey="sampleActionGroup"> + <argument name="layout" value="1 column"/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBeforeTestFinishes"> + <argument name="tags" value="config"/> + </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="AdminOpenWebConfigurationPageActionGroup" stepKey="navigateToWebConfigurationPage"/> - <conditionalClick stepKey="expandDefaultLayouts" selector="{{WebSection.DefaultLayoutsTab}}" dependentSelector="{{WebSection.CheckIfTabExpand}}" visible="true"/> - <waitForElementVisible selector="{{DefaultLayoutsSection.productLayout}}" stepKey="DefaultProductLayout"/> - <selectOption selector="{{DefaultLayoutsSection.productLayout}}" userInput="3 columns" stepKey="select3ColumnsLayout"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> - <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> - <waitForPageLoad stepKey="wait1"/> - <click selector="{{ProductDesignSection.DesignTab}}" stepKey="clickOnDesignTab"/> - <waitForElementVisible selector="{{ProductDesignSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown"/> + + <actionGroup ref="NavigateToDefaultLayoutsSettingActionGroup" stepKey="navigateToWebConfigurationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandDefaultLayouts"/> + <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="DefaultProductLayout"/> + <actionGroup ref="AdminSetProductLayoutSettingsActionGroup" stepKey="select3ColumnsLayout"> + <argument name="layout" value="3 columns"/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="clickSaveConfig"> + <argument name="tags" value="config"/> + </actionGroup> + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="navigateToNewProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/> + <actionGroup ref="AdminExpandProductDesignSectionActionGroup" stepKey="clickOnDesignTab"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLayoutDropDown"/> <seeOptionIsSelected selector="{{ProductDesignSection.LayoutDropdown}}" userInput="3 columns" stepKey="see3ColumnsSelected"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml index 9f51d6227aa1d..32cce3633b10e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml @@ -18,11 +18,20 @@ <group value="product"/> </annotations> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <amOnPage url="{{AdminProductCreatePage.url(SimpleProduct.visibility, SimpleProduct.type_id)}}" stepKey="goToCreateProduct"/> - <waitForPageLoad stepKey="wait1"/> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillName"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="-42" stepKey="fillPrice"/> + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToCreateProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillName"/> + <actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillPrice"> + <argument name="productName" value="{{SimpleProduct.name}}"/> + <argument name="productSku" value="{{SimpleProduct.sku}}"/> + <argument name="productPrice" value="-42"/> + <argument name="productQuantity" value="{{SimpleProduct.quantity}}"/> + <argument name="productStatus" value="{{SimpleProduct.status}}"/> + <argument name="productWeight" value="{{SimpleProduct.weight}}"/> + </actionGroup> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/> - <see selector="{{AdminProductFormSection.priceFieldError}}" userInput="Please enter a number 0 or greater in this field." stepKey="seePriceValidationError"/> + <actionGroup ref="AssertAdminValidationErrorAppearedForPriceFieldOnProductEditPageActionGroup" stepKey="seePriceValidationError"> + <argument name="errorMessage" value="Please enter a number 0 or greater in this field."/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml index 3e5ccfd8bf3b9..1c478eb4b6546 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml @@ -22,6 +22,11 @@ </before> <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> </after> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml index 24f87cca958ab..b1f18a770ea0b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml @@ -18,13 +18,22 @@ <group value="product"/> </annotations> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <amOnPage url="{{AdminProductCreatePage.url(SimpleProduct.visibility, SimpleProduct.type_id)}}" stepKey="goToCreateProduct"/> - <waitForPageLoad stepKey="wait1"/> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillName"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="0" stepKey="fillPrice"/> + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToCreateProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillName"> + <argument name="product" value="SimpleProduct"/> + </actionGroup> + <actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="fillPrice"> + <argument name="price" value="0"/> + </actionGroup> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/> - <amOnPage url="{{StorefrontProductPage.url(SimpleProduct.name)}}" stepKey="viewProduct"/> - <waitForPageLoad stepKey="wait2"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$0.00" stepKey="seeZeroPrice"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="viewProduct"> + <argument name="productUrl" value="{{SimpleProduct.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait2"/> + <actionGroup ref="StorefrontAssertUpdatedProductPriceInStorefrontProductPageActionGroup" stepKey="seeZeroPrice"> + <argument name="productName" value="{{SimpleProduct.name}}"/> + <argument name="expectedPrice" value="$0.00"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml index 13efee209a556..47c7868b24002 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -48,10 +48,7 @@ </actionGroup> <!-- Save the product --> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!-- Flush config cache to reset product attributes in attribute set --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> <reloadPage stepKey="reloadProductEditPage"/> <!-- Check default value --> <waitForElementVisible selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="waitAttributesSectionAppears"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml index a00714e412b0a..0c1785b8f725a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml @@ -22,6 +22,10 @@ <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> </before> <after> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{ProductWithUnicode.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> </after> @@ -32,9 +36,7 @@ <argument name="simpleProduct" value="ProductWithUnicode"/> </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AssertProductInStorefrontCategoryPage" stepKey="assertProductInStorefront1"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="product" value="ProductWithUnicode"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml index cffefc4cd74c3..4c02c57dae535 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml @@ -25,31 +25,54 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" stepKey="clickAddProductToggle"/> - <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" stepKey="waitForProductToggleToSelectProduct"/> - <actionGroup ref="AdminClickAddProductToggleAndSelectProductTypeActionGroup" stepKey="clickVirtualProduct"> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="openProductCatalogPage"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="clickAddProductToggle"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="waitForProductToggleToSelectProduct"/> + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="clickVirtualProduct"> <argument name="productType" value="virtual"/> </actionGroup> <!-- Create virtual product with required fields only --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{virtualProductWithRequiredFields.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{virtualProductWithRequiredFields.sku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{virtualProductWithRequiredFields.price}}" stepKey="fillProductPrice"/> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductName"> + <argument name="product" value="virtualProductWithRequiredFields"/> + </actionGroup> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="fillProductSku"/> + <actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="fillProductPrice"> + <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> + </actionGroup> <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> <!-- Verify we see success message --> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertVirtualProductSuccessMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertVirtualProductSuccessMessage"> + <argument name="message" value="You saved the product."/> + </actionGroup> <!-- Verify we see created virtual product(from the above step) on the product grid page --> <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage1"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickSelector"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFilter"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{virtualProductWithRequiredFields.name}}" stepKey="fillProductName1"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{virtualProductWithRequiredFields.sku}}" stepKey="fillVirtualProductSku"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickSearch2"/> - <waitForPageLoad stepKey="waitForProductSearch"/> - <seeInField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{virtualProductWithRequiredFields.name}}" stepKey="seeVirtualProductName"/> - <seeInField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{virtualProductWithRequiredFields.sku}}" stepKey="seeVirtualProductSku"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="clickSelector"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="clickFilter"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="fillProductName1"/> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="fillVirtualProductSku"/> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickSearch2"> + <argument name="product" value="virtualProductWithRequiredFields"/> + </actionGroup> + <comment userInput="Adding the comment to replace clickAddProductToggle action for preserving Backward Compatibility" + stepKey="waitForProductSearch"/> + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeVirtualProductName"> + <argument name="column" value="Name"/> + <argument name="value" value="{{virtualProductWithRequiredFields.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeVirtualProductSku"> + <argument name="column" value="SKU"/> + <argument name="value" value="{{virtualProductWithRequiredFields.sku}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index e12394cbcb512..c9670ba5a8a7d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -118,9 +118,7 @@ <!-- Verify we see success message --> <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertVirtualProductSuccessMessage"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Verify customer see created virtual product with custom options suite and import options(from above step) on storefront page and is searchable by sku --> <amOnPage url="{{StorefrontProductPage.url(virtualProductCustomImportOptions.urlKey)}}" stepKey="goToProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml index e4cacba0224a7..0c4709b01da4f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml @@ -91,14 +91,12 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{virtualProductBigQty.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer see created virtual product on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{virtualProductBigQty.name}}" stepKey="seeVirtualProductNameOnCategoryPage"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Verify customer see created virtual product with tier price(from above step) on storefront page and is searchable by sku --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> @@ -111,7 +109,7 @@ <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeVirtualProductName"> <argument name="productName" value="{{virtualProductBigQty.name}}"/> </actionGroup> - + <grabTextFrom selector="{{StorefrontQuickSearchResultsSection.asLowAsLabel}}" stepKey="tierPriceTextOnStorefrontPage"/> <assertEquals stepKey="assertTierPriceTextOnCategoryPage"> <expectedResult type="string">As low as ${{tierPriceOnVirtualProduct.price}}</expectedResult> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml index bf0d5d99a23bb..fd2000a1c5491 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml @@ -87,7 +87,7 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> <!--Open Product in Store Front Page --> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="openProductInStoreFront"/> <waitForPageLoad stepKey="waitForProductToLoad"/> <!--Verify Product is visible and In Stock --> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage"/> @@ -107,13 +107,13 @@ <argument name="sku" value="$$createConfigChildProduct2.sku$$"/> </actionGroup> <!--Verify product is not visible in category store front page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="openCategoryStoreFrontPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="openCategoryStoreFrontPage"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInStoreFrontPage"/> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickOnCategory"/> <dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="dontSeeProductInCategoryPage"/> <!--Open Product Store Front Page and Verify Product is Out Of Stock --> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront1"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="openProductInStoreFront1"/> <waitForPageLoad stepKey="waitForProductToLoad1"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage1"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml index 4599d0c275214..2c05b1515bc9c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml @@ -35,7 +35,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on product page --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -45,7 +45,7 @@ <dontSee userInput="$$createSimpleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createSimpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml index 3514f53e8b937..0cb59ee54ae93 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml @@ -66,9 +66,7 @@ <argument name="websiteName" value="{{NewWebSiteData.name}}"/> </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="createSubCategory" stepKey="deleteSubCategory"/> <deleteData createDataKey="createRootCategory" stepKey="deleteRootCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> @@ -95,9 +93,7 @@ </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Switch to 'Default Store View' scope and open product page--> <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchDefaultStoreView"> <argument name="storeViewName" value="'Default Store View'"/> @@ -179,7 +175,7 @@ <waitForPageLoad stepKey="waitForImagesLoad3"/> <dontSeeElement selector="{{AdminProductImagesSection.imageFile(TestImageNew.fileName)}}" stepKey="seeImageIsDeleted"/> <!--Open Storefront on Default store view and assert image existence--> - <amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad0"/> <grabAttributeFrom userInput="src" selector="{{StorefrontCategoryMainSection.mediaDescription($$createProduct.name$$)}}" stepKey="grabAttributeFromImage"/> <assertStringContainsString stepKey="assertProductImageAbsence"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml index bdd1a4b4c70fe..2c6cc08d7689f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml @@ -34,7 +34,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -44,7 +44,7 @@ <dontSee userInput="$$createSimpleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createSimpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml index dcfcbd699fc6b..de72de2769299 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml @@ -35,7 +35,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on product page --> - <amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.name$$)}}" stepKey="amOnVirtualProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.custom_attributes[url_key]$$)}}" stepKey="amOnVirtualProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -45,7 +45,7 @@ <dontSee userInput="$$createVirtualProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createVirtualProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml index 283ed72e62faa..044e5fa9d0d9f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml @@ -46,7 +46,7 @@ <fillField selector="{{ProductAttributeWYSIWYGSection.TextArea($$myProductAttributeCreation.attribute_code$$)}}" userInput="Text Area" stepKey="fillContentTextarea" /> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> <!-- Go to storefront product page, assert product content --> - <amOnPage url="{{_defaultProduct.name}}.html" stepKey="navigateToProductPage"/> + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForPageLoad5"/> <see userInput="Text Area" stepKey="seeText2" /> <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="navigateToProductAttributeGrid2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml index 4dd76e55f9330..e8ed35ecb4a9f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml @@ -32,9 +32,7 @@ </createData> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml index 30ab17f65f3c8..44df83a4a7299 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml @@ -14,8 +14,8 @@ <title value="Admin should be able to mass update product attributes in store view scope"/> <description value="Admin should be able to mass update product attributes in store view scope"/> <severity value="AVERAGE"/> - <testCaseId value="MC-128"/> - <group value="Catalog"/> + <testCaseId value="MC-25333"/> + <group value="catalog"/> <group value="Product Attributes"/> <group value="SearchEngineElasticsearch"/> </annotations> @@ -51,35 +51,43 @@ <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchStoreViewActionGroup"/> <!-- Update attribute --> <click selector="{{AdminEditProductAttributesSection.ChangeAttributeDescriptionToggle}}" stepKey="toggleToChangeDescription"/> - <fillField selector="{{AdminEditProductAttributesSection.AttributeDescription}}" userInput="Updated $$createProductOne.custom_attributes[description]$$" stepKey="fillAttributeDescriptionField"/> + <fillField selector="{{AdminEditProductAttributesSection.AttributeDescription}}" userInput="Updated $createProductOne.custom_attributes[description]$" stepKey="fillAttributeDescriptionField"/> <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/> <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeAttributeUpateSuccessMsg"/> + <!-- Start message queue for product attribute consumer --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> + <argument name="consumerName" value="{{AdminProductAttributeUpdateMessageConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{AdminProductAttributeUpdateMessageConsumerData.messageLimit}}"/> + </actionGroup> <!-- Assert on storefront default view with partial word of product name --> <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupDefault"/> <actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameDefault"> - <argument name="name" value="$$createProductOne.name$$"/> - <argument name="description" value="$$createProductOne.custom_attributes[description]$$"/> + <argument name="name" value="$createProductOne.name$"/> + <argument name="description" value="$createProductOne.custom_attributes[description]$"/> </actionGroup> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault"/> - <see userInput="2 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInDefault"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInDefault"/> <!-- Assert on storefront custom view with partial word of product name --> <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupCustom"/> <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="StorefrontSwitchStoreViewActionGroup"/> <actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameCustom"> - <argument name="name" value="$$createProductOne.name$$"/> - <argument name="description" value="Updated $$createProductOne.custom_attributes[description]$$"/> + <argument name="name" value="$createProductTwo.name$"/> + <argument name="description" value="Updated $createProductOne.custom_attributes[description]$"/> </actionGroup> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultCustom"/> - <see userInput="2 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInCustom"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInCustom"/> <!-- Assert Storefront default view with exact product name --> <actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupDefault1"/> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToDefaultStoreView"> + <argument name="storeView" value="_defaultStore"/> + </actionGroup> <actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameDefault1"> - <argument name="name" value="$$createProductThree.name$$"/> - <argument name="description" value="$$createProductThree.custom_attributes[description]$$"/> + <argument name="name" value="$createProductThree.name$"/> + <argument name="description" value="$createProductThree.custom_attributes[description]$"/> </actionGroup> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault1"/> <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInDefault1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml index 3da19eb598012..ff9d99f76d6bf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml @@ -66,12 +66,10 @@ <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage2"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Open Category in store front page--> - <amOnPage url="/$$createDefaultCategory.name$$/{{FirstLevelSubCat.name}}/{{SimpleSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> + <amOnPage url="/$$createDefaultCategory.custom_attributes[url_key]$$/{{FirstLevelSubCat.urlKey}}/{{SimpleSubCategory.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontPageLoad"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeDefaultCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigationBar"/> @@ -98,7 +96,7 @@ <click selector="{{AdminCategoryModalSection.ok}}" stepKey="clickOkButtonOnWarningPopup"/> <waitForPageLoad stepKey="waitForPageToLoad3"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You moved the category." stepKey="seeSuccessMoveMessage"/> - <amOnPage url="/{{SimpleSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFrontPage1"/> + <amOnPage url="/{{SimpleSubCategory.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage1"/> <waitForPageLoad stepKey="waitForStoreFrontPageLoad1"/> <!--Verify breadcrumbs in store front page after the move--> @@ -109,7 +107,7 @@ </assertEquals> <!--Open Category in store front--> - <amOnPage url="{{StorefrontCategoryPage.url(SimpleSubCategory.name)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(SimpleSubCategory.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(SimpleSubCategory.name)}}" stepKey="seeCategoryInTitle"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="seeCategoryOnStoreNavigationBarAfterMove"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml index 1c55b09151cf3..96f905c3d916e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml @@ -22,7 +22,7 @@ <createData entity="FirstLevelSubCat" stepKey="createDefaultCategory"> <field key="is_active">true</field> </createData> - <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <magentoCron groups="index" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -110,7 +110,7 @@ <see stepKey="verifyTheTargetPathAfterMove1" selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Target Path')}}" userInput="{{FirstLevelSubCat.name_lwr}}2/{{SimpleSubCategory.name_lwr}}.html" /> <!--Verify before move Redirect Path directs to the category page--> - <amOnPage url="{{FirstLevelSubCat.name_lwr}}2/{{SubCategory.name_lwr}}/{{SimpleSubCategory.name_lwr}}.html" stepKey="openCategoryStoreFrontPage"/> + <amOnPage url="{{FirstLevelSubCat.urlKey}}2/{{SubCategory.urlKey}}/{{SimpleSubCategory.urlKey}}.html" stepKey="openCategoryStoreFrontPage"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(FirstLevelSubCat.name)}}" stepKey="seeCategoryOnStoreNavigationBar"/> <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(SimpleSubCategory.name)}}" stepKey="seeCategoryInTitle"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml index fe3ffbb4fc1d7..2a03effb51ae8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml @@ -59,7 +59,7 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify category displayed in store front page--> - <amOnPage url="/$$createDefaultCategory.name$$/{{SimpleSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> + <amOnPage url="/$$createDefaultCategory.custom_attributes[url_key]$$/{{SimpleSubCategory.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontPageLoad"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeDefaultCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigationBar"/> @@ -88,7 +88,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You moved the category." stepKey="seeSuccessMoveMessage"/> <!--Open category in store front page--> - <amOnPage url="/{{SimpleSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFrontPage1"/> + <amOnPage url="/{{SimpleSubCategory.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage1"/> <waitForPageLoad stepKey="waitForStoreFrontPageLoad1"/> <!--Verify breadcrumbs after the move in store front page--> @@ -99,7 +99,7 @@ </assertEquals> <!--Open category store front page --> - <amOnPage url="{{StorefrontCategoryPage.url(SimpleSubCategory.name)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(SimpleSubCategory.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <!--Verify Category in store front--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml index 8eb3d9bbb8063..c81e47a841891 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml @@ -56,7 +56,7 @@ <waitForText selector="{{AdminCategoryModalSection.message}}" userInput="This operation can take a long time" stepKey="seeWarningMessage"/> <click selector="{{AdminCategoryModalSection.cancel}}" stepKey="clickCancelButtonOnWarningPopup"/> <!-- Verify Category in store front page after clicking cancel button --> - <amOnPage url="/$$createDefaultCategory.name$$/{{FirstLevelSubCat.name}}/{{SecondLevelSubCat.name}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> + <amOnPage url="/$$createDefaultCategory.custom_attributes[url_key]$$/{{FirstLevelSubCat.urlKey}}/{{SecondLevelSubCat.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontPageLoad"/> <waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeDefaultCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigationBar"/> @@ -76,10 +76,10 @@ <click selector="{{AdminCategoryModalSection.ok}}" stepKey="clickOkButtonOnWarningPopup"/> <waitForPageLoad stepKey="waitTheForPageToLoad"/> <waitForText selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You moved the category." stepKey="seeSuccessMoveMessage"/> - <amOnPage url="/{{SimpleSubCategory.name}}.html" stepKey="seeCategoryNameInStoreFrontPage"/> + <amOnPage url="/{{SimpleSubCategory.urlKey}}.html" stepKey="seeCategoryNameInStoreFrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontPageToLoad"/> <!-- Verify Category in store front after moving category to another position in category tree --> - <amOnPage url="{{StorefrontCategoryPage.url(SecondLevelSubCat.name)}}" stepKey="amOnCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(SecondLevelSubCat.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <waitForElementVisible selector="{{StorefrontCategoryMainSection.CategoryTitle(SecondLevelSubCat.name)}}" stepKey="seeCategoryInTitle"/> <waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(SecondLevelSubCat.name)}}" stepKey="seeCategoryOnStoreNavigationBarAfterMove"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml index 0af3911474813..002f11b5adfca 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml @@ -140,7 +140,7 @@ <see userInput="$$simpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productName}}" stepKey="seeProduct"/> <!-- Open <product1> --> - <click selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.urlKey$$)}}" stepKey="openProduct"/> + <click selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProduct"/> <waitForPageLoad stepKey="waitForProductPageLoading"/> <!-- # Product page should open successfully # Breadcrumb for product should be like <Cat 2> --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml index 94d7ea14b096c..edde693c51203 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml @@ -156,9 +156,9 @@ <waitForPageLoad stepKey="waitForUpdatesTobeSaved1"/> <!--Go to SimpleProduct store front page--> - <amOnPage url="$$createSimpleProduct.sku$$.html" stepKey="goToSimpleProductFrontPage"/> + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductFrontPage"/> <waitForPageLoad stepKey="waitForProduct"/> - <see stepKey="seeProductName" userInput="$$createSimpleProduct.sku$$" selector="{{StorefrontProductInfoMainSection.productName}}"/> + <see stepKey="seeProductName" userInput="$$createSimpleProduct.name$$" selector="{{StorefrontProductInfoMainSection.productName}}"/> <scrollTo stepKey="scrollToTheUpSellHeading" selector="{{StorefrontProductUpSellProductsSection.upSellHeading}}"/> <!--Verify Up Sell Products displayed in SimpleProduct page--> @@ -167,7 +167,7 @@ <see stepKey="seeConfigProduct" selector="{{StorefrontProductUpSellProductsSection.upSellProducts}}" userInput="$$createConfigProduct.name$$"/> <!--Go to Config Product store front page--> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="goToConfigProductFrontPage"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="goToConfigProductFrontPage"/> <waitForPageLoad stepKey="waitForConfigProductToBeLoaded"/> <scrollTo stepKey="scrollToTheUpSellHeading1" selector="{{StorefrontProductUpSellProductsSection.upSellHeading}}"/> @@ -176,7 +176,7 @@ <see stepKey="seeSimpleProduct2" selector="{{StorefrontProductUpSellProductsSection.upSellProducts}}" userInput="$$createSimpleProduct1.name$$"/> <!--Go to SimpleProduct1 store front page--> - <amOnPage url="$$createSimpleProduct1.sku$$.html" stepKey="goToSimpleProduct1FrontPage"/> + <amOnPage url="$$createSimpleProduct1.custom_attributes[url_key]$$.html" stepKey="goToSimpleProduct1FrontPage"/> <waitForPageLoad stepKey="waitForSimpleProduct1ToBeLoaded"/> <!--Verify No Up Sell Products displayed in SimplProduct1 page--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml index e06a7f3c5679c..a422d781b8169 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml @@ -35,9 +35,7 @@ </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createSimpleProductFirst" stepKey="deleteFirstSimpleProduct"/> @@ -80,8 +78,8 @@ <actionGroup ref="AdminSaveCategoryFormActionGroup" stepKey="saveCategory"/> <executeJS function="return '$createCategory.name$'.toLowerCase();" stepKey="categoryNameLower" /> - <executeJS function="return '$createSimpleProductFirst.name$'.toLowerCase();" stepKey="simpleProductFirstNameLower" /> - <executeJS function="return '$createSimpleProductSecond.name$'.toLowerCase();" stepKey="simpleProductSecondNameLower" /> + <executeJS function="return '$createSimpleProductFirst.custom_attributes[url_key]$'.toLowerCase();" stepKey="simpleProductFirstNameLower" /> + <executeJS function="return '$createSimpleProductSecond.custom_attributes[url_key]$'.toLowerCase();" stepKey="simpleProductSecondNameLower" /> <!-- Make assertions on frontend --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateWithCustomLocaleTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateWithCustomLocaleTest.xml new file mode 100644 index 0000000000000..eae9cebd7e638 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateWithCustomLocaleTest.xml @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminProductGridFilteringByDateWithCustomLocaleTest"> + <annotations> + <features value="Catalog"/> + <stories value="Filter products"/> + <title value="Product grid date filters does not work for en_GB locale"/> + <description value="Product grid date filters does not work for en_GB locale"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-40644"/> + <useCaseId value="MC-40240"/> + <group value="catalog"/> + </annotations> + + <before> + <!-- Deploy static content with United Kingdom locale--> + <magentoCLI command="setup:static-content:deploy en_GB" stepKey="deployStaticContentWithUnitedKingdomLocale"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!-- Create new User --> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + <actionGroup ref="AdminCreateUserWithRoleAndLocaleActionGroup" stepKey="createAdminUser"> + <argument name="user" value="activeAdmin"/> + <argument name="role" value="roleDefaultAdministrator"/> + <argument name="interfaceLocale" value="en_GB"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> + <argument name="ProductAttribute" value="dateProductAttribute"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetGridFilter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- Generate date for use as default value, needs to be MM/d/YYYY and mm/d/yy --> + <generateDate date="now" format="m/j/Y" stepKey="generateDefaultDate"/> + <generateDate date="now" format="j/m/Y" stepKey="generateDefaultDateGB"/> + + <!-- Navigate to Stores > Attributes > Product. --> + <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/> + + <!-- Create new Product Attribute as TextField, with code and default value. --> + <actionGroup ref="CreateProductAttributeWithDateFieldActionGroup" stepKey="createAttribute"> + <argument name="attribute" value="dateProductAttribute"/> + <argument name="date" value="{$generateDefaultDate}"/> + </actionGroup> + + <!-- Go to default attribute set edit page --> + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/{{AddToDefaultSet.attributeSetId}}/" stepKey="onAttributeSetEdit"/> + <!-- Assert created attribute in unassigned section --> + <see userInput="{{dateProductAttribute.attribute_code}}" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> + <!-- Assign attribute to a group --> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> + <argument name="group" value="Product Details"/> + <argument name="attribute" value="{{dateProductAttribute.attribute_code}}"/> + </actionGroup> + <!-- Assert attribute in a group --> + <see userInput="{{dateProductAttribute.attribute_code}}" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> + <!-- Save attribute set --> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> + + <!-- Open Product Edit Page and set custom attribute value --> + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct"> + <argument name="product" value="$createProduct$"/> + </actionGroup> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> + <argument name="product" value="$createProduct$"/> + </actionGroup> + <fillField selector="{{AdminProductFormSection.newAddedAttributeInput(dateProductAttribute.attribute_code)}}" userInput="{$generateDefaultDate}" stepKey="fillCustomDateValue"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> + + <!-- Logout master admin and Login as new User --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutMasterAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToNewAdmin"> + <argument name="username" value="{{activeAdmin.username}}"/> + <argument name="password" value="{{activeAdmin.password}}"/> + </actionGroup> + + <!-- Open Product Index Page and filter the product --> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex2"/> + <actionGroup ref="FilterProductGridByCustomDateRangeActionGroup" stepKey="filterProductGridByCustomDateRange"> + <argument name="code" value="{{dateProductAttribute.attribute_code}}"/> + <argument name="date" value="{$generateDefaultDateGB}"/> + </actionGroup> + <!-- Check products filtering --> + <see selector="{{AdminProductGridSection.productGridNameProduct($createProduct.name$)}}" userInput="$createProduct.name$" stepKey="seeProductName"/> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminDownloadableProductTypeSwitchingToSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminDownloadableProductTypeSwitchingToSimpleProductTest.xml index 6cbf03a02f3b0..b9f199c3954ea 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminDownloadableProductTypeSwitchingToSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminDownloadableProductTypeSwitchingToSimpleProductTest.xml @@ -46,7 +46,7 @@ <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearSimpleProductFilters"/> <!--Assert simple product on storefront--> <comment userInput="Assert simple product on storefront" stepKey="commentAssertSimpleProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="openSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="openSimpleProductPage"/> <waitForPageLoad stepKey="waitForStorefrontSimpleProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertSimpleProductInStock"/> <dontSeeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkLabel(downloadableLinkWithMaxDownloads.title)}}" stepKey="dontSeeDownloadableLink"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml index 2311369db48f6..809096626270c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml @@ -66,7 +66,7 @@ <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearDownloadableProductFilters"/> <!--Assert downloadable product on storefront--> <comment userInput="Assert downloadable product on storefront" stepKey="commentAssertDownloadableProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="openDownloadableProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="openDownloadableProductPage"/> <waitForPageLoad stepKey="waitForStorefrontDownloadableProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertDownloadableProductInStock"/> <scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkBlock}}" stepKey="scrollToLinksInStorefront"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml index e989aa3758cf3..2cdbc26f90f7b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml @@ -66,9 +66,7 @@ <deleteData createDataKey="category" stepKey="deletePreReqCategory"/> <deleteData createDataKey="product" stepKey="deleteFirstProduct"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml index b2ed7b9628f38..49add85f76806 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml @@ -58,8 +58,8 @@ </assertEquals> <!-- Verify that the CMS page have the required field name indicator next to Page Title --> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnPagePagesGrid"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad1"/> <actionGroup ref="AdminClickAddNewPageOnPagesGridActionGroup" stepKey="clickAddNewPage"/> <executeJS function="{{CmsNewPagePageBasicFieldsSection.RequiredFieldIndicator}}" stepKey="pageTitleRequiredFieldIndicator"/> <assertEquals message="pass" stepKey="assertRequiredFieldIndicator5"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShowDoubleSpacesInProductGrid.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShowDoubleSpacesInProductGrid.xml new file mode 100644 index 0000000000000..c3e939b4155c8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShowDoubleSpacesInProductGrid.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminShowDoubleSpacesInProductGrid"> + <annotations> + <features value="Catalog"/> + <stories value="Edit products"/> + <title value="Show double spaces in the product grid"/> + <description value="Admin should be able to see double spaces in the Name and Sku fields in the product grid"/> + <testCaseId value="MC-40725"/> + <useCaseId value="MC-40122"/> + <severity value="AVERAGE"/> + <group value="Catalog"/> + </annotations> + + <before> + <createData entity="ApiCategory" stepKey="createCategory"/> + <createData entity="ApiSimpleProductWithDoubleSpaces" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <magentoCLI command="cron:run --group=index" stepKey="cronRun"/> + <magentoCLI command="cron:run --group=index" stepKey="cronRunSecondTime"/> + </before> + + <after> + <actionGroup ref="AdminDeleteAllProductsFromGridActionGroup" stepKey="deleteProduct"/> + <actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clearGridFilters"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + </after> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="searchForProduct"> + <argument name="product" value="$createProduct$"/> + </actionGroup> + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductName"> + <argument name="column" value="Name"/> + <argument name="value" value="$createProduct.name$"/> + </actionGroup> + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductSku"> + <argument name="column" value="SKU"/> + <argument name="value" value="$createProduct.sku$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml index 8a33f6132aeb9..17dac7600ef9e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml @@ -106,7 +106,7 @@ <!-- Save the first product and go to the storefront --> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> - <amOnPage url="$$firstProduct.name$$.html" stepKey="goToStorefront"/> + <amOnPage url="$$firstProduct.custom_attributes[url_key]$$.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> <!-- See all of the images that we uploaded --> @@ -118,7 +118,7 @@ <seeElementInDOM selector="{{StorefrontProductMediaSection.imageFile('png')}}" stepKey="seePng"/> <!-- Go to the category page and see a placeholder image for the second product --> - <amOnPage url="$$category.name$$.html" stepKey="goToCategoryPage"/> + <amOnPage url="$$category.custom_attributes[url_key]$$.html" stepKey="goToCategoryPage"/> <seeElement selector=".products-grid img[src*='placeholder/small_image.jpg']" stepKey="seePlaceholder"/> <!-- Go to the second product edit page --> @@ -142,9 +142,7 @@ <!-- Save the second product --> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct2"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Go to the admin grid and see the uploaded image --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndex3"/> @@ -155,11 +153,11 @@ <seeElement selector="img.admin__control-thumbnail[src*='/large']" stepKey="seeImgInGrid"/> <!-- Go to the category page and see the uploaded image --> - <amOnPage url="$$category.name$$.html" stepKey="goToCategoryPage2"/> + <amOnPage url="$$category.custom_attributes[url_key]$$.html" stepKey="goToCategoryPage2"/> <seeElement selector=".products-grid img[src*='/large']" stepKey="seeUploadedImg"/> <!-- Go to the product page and see the uploaded image --> - <amOnPage url="$$secondProduct.name$$.html" stepKey="goToStorefront2"/> + <amOnPage url="$$secondProduct.custom_attributes[url_key]$$.html" stepKey="goToStorefront2"/> <waitForPageLoad stepKey="waitForStorefront2"/> <seeElementInDOM selector="{{StorefrontProductMediaSection.imageFile('large')}}" stepKey="seeLarge2"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml index fc18531eca350..92966e0a00956 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml @@ -70,7 +70,7 @@ <seeInField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="EDIT ~ This is the short description ~ EDIT" stepKey="seeShortDescriptionAdmin"/> <!--Checking content storefront--> - <amOnPage url="{{SimpleProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{SimpleProduct.urlKey}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> <see selector="{{StorefrontProductInfoMainSection.productDescription}}" userInput="EDIT ~ This is the long description ~ EDIT" stepKey="seeLongDescriptionStorefront"/> <see selector="{{StorefrontProductInfoMainSection.productShortDescription}}" userInput="EDIT ~ This is the short description ~ EDIT" stepKey="seeShortDescriptionStorefront"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml index 3c90de572988c..a3ab78a11e09b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml @@ -78,7 +78,7 @@ <!--See related product in admin--> <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo"/> <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee"/> - <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.sku$$" stepKey="seeRelatedProduct"/> + <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.name$$" stepKey="seeRelatedProduct"/> <!--See more related products in admin--> <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct2"> @@ -98,13 +98,14 @@ </actionGroup> <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo2"/> <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee2"/> - <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.sku$$" stepKey="seeSixthRelatedProduct"/> + <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.name$$" stepKey="seeSixthRelatedProduct"/> <selectOption selector=".admin__collapsible-block-wrapper[data-index='related'] .admin__control-select" userInput="5" stepKey="selectFivePerPage"/> - <dontSee selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.sku$$" stepKey="dontSeeSixthRelatedProduct"/> + <waitForPageLoad stepKey="waitForLoadingAfterSelectFivePerPage"/> + <dontSee selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.name$$" stepKey="dontSeeSixthRelatedProduct"/> <!--See related product in storefront--> - <amOnPage url="{{SimpleProduct3.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{SimpleProduct3.urlKey}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> - <seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$simpleProduct1.sku$$)}}" stepKey="seeRelatedProductInStorefront"/> + <seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$simpleProduct1.name$$)}}" stepKey="seeRelatedProductInStorefront"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml index a9f8eab9a582f..b31ef59e30bbe 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml @@ -31,9 +31,7 @@ <argument name="websiteCode" value="{{customWebsite.code}}"/> </actionGroup> <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterEnableWebUrlOptions"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterEnableWebUrlOptions"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> @@ -46,9 +44,7 @@ <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml index e562faf523929..e800b72f33850 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml @@ -62,7 +62,7 @@ <waitForPageLoad stepKey="waitForPageToLoad2"/> <seeInField selector="{{AdminCategorySEOSection.UrlKeyInput}}" stepKey="seeCategoryUrlKey" userInput="{{SimpleRootSubCategory.name_lwr}}2" /> <!--Open Category in Store Front Page--> - <amOnPage url="/{{NewRootCategory.name}}/{{_defaultCategory.name}}.html" stepKey="seeTheCategoryInStoreFront"/> + <amOnPage url="/{{NewRootCategory.urlKey}}/{{_defaultCategory.urlKey}}.html" stepKey="seeTheCategoryInStoreFront"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="clickSwitchStoreButtonOnDefaultStore"/> <click selector="{{StorefrontFooterSection.storeLink(customStore.name)}}" stepKey="selectSecondStoreToSwitchOn"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml index f82294ece6478..20fb1f6dc4f49 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml @@ -65,16 +65,11 @@ <!--Verify Category Title--> <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" /> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Verify Category in store front page--> - <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name)}}" stepKey="seeDefaultProductPage"/> + <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.urlKey)}}" stepKey="seeDefaultProductPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="selectCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml index f7f87da77b401..a6523c018bdbf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml @@ -31,10 +31,7 @@ <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Enable Flat Catalog Category --> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> @@ -76,13 +73,11 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeCategoryIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/> <!--Verify Product In Store Front--> - <amOnPage url="$$createSimpleProduct.name$$.html" stepKey="goToStorefrontPage"/> + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <!--Verify product and category is visible in First Store View --> <click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml index b316e3194c986..2c7e26d4084b3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml @@ -33,11 +33,9 @@ <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> <!--Open Index Management Page and Select Index mode "Update by Schedule" --> <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="schedule" /> - <!-- Reindex invalidated indices and clear caches --> + <!-- Reindex invalidated indices --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> @@ -53,7 +51,7 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndicesAgain"/> </after> <!--Verify Category is not listed in navigation menu--> - <amOnPage url="/{{CatNotIncludeInMenu.name_lwr}}.html" stepKey="openCategoryPage"/> + <amOnPage url="/{{CatNotIncludeInMenu.urlKey}}.html" stepKey="openCategoryPage"/> <waitForPageLoad time="60" stepKey="waitForPageToBeLoaded"/> <dontSee selector="{{StorefrontHeaderSection.NavigationCategoryByName(CatNotIncludeInMenu.name)}}" stepKey="dontSeeCategoryOnNavigation"/> <!-- Select created category and enable Include In Menu option--> @@ -67,13 +65,11 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_category_flat"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/> <!--Verify Category In Store Front--> - <amOnPage url="/$$createCategory.name$$.html" stepKey="openCategoryPage1"/> + <amOnPage url="/$$createCategory.custom_attributes[url_key]$$.html" stepKey="openCategoryPage1"/> <waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/> <!--Verify category is visible in First Store View --> <click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml index 2124efed31293..13891c58c6018 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml @@ -35,9 +35,7 @@ <!--Open Index Management Page and Select Index mode "Update by Schedule" --> <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="schedule" /> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/> @@ -68,13 +66,11 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_category_flat"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/> <see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="READY"/> <!--Verify Category In Store Front--> - <amOnPage url="{{SimpleSubCategory.name}}.html" stepKey="goToStorefrontPage"/> + <amOnPage url="{{SimpleSubCategory.urlKey}}.html" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <!--Verify category is visible in First Store View --> <click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 321f83161e945..34aea06bb69cc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -27,9 +27,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> @@ -117,7 +115,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductTierPrice300InStock.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml index ab0fcea919af0..f35eee9d1a63d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml @@ -34,60 +34,106 @@ </after> <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> - <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> - <argument name="product" value="$$initialSimpleProduct$$"/> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openProductCatalogPage"> + <argument name="productSku" value="$initialSimpleProduct.sku$"/> </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="filterProductGrid"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductDisabled.name}}" stepKey="fillSimpleProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductDisabled.sku}}" stepKey="fillSimpleProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductDisabled.price}}" stepKey="fillSimpleProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductDisabled.quantity}}" stepKey="fillSimpleProductQuantity"/> - <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductDisabled.status}}" stepKey="selectStockStatusInStock"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductDisabled.weight}}" stepKey="fillSimpleProductWeight"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> - <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductDisabled.urlKey}}" stepKey="fillUrlKey"/> + <actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillSimpleProductName"> + <argument name="productName" value="{{simpleProductDisabled.name}}"/> + <argument name="productSku" value="{{simpleProductDisabled.sku}}"/> + <argument name="productPrice" value="{{simpleProductDisabled.price}}"/> + <argument name="productQuantity" value="{{simpleProductDisabled.quantity}}"/> + <argument name="productStatus" value="{{simpleProductDisabled.status}}"/> + <argument name="productWeight" value="{{simpleProductDisabled.weight}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="selectStockStatusInStock"/> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="fillSimpleProductWeight"> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickAdminProductSEOSection"/> + <actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillUrlKey"> + <argument name="urlKey" value="{{simpleProductDisabled.urlKey}}"/> + </actionGroup> <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> - <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="clickEnableProductLabelToDisableProduct"/> + <actionGroup ref="ToggleProductEnabledActionGroup" stepKey="clickEnableProductLabelToDisableProduct"/> <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> <!-- Verify customer see success message --> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertSimpleProductSaveSuccessMessage"> + <argument name="message" value="You saved the product."/> + </actionGroup> <!-- Search updated simple product(from above step) in the grid --> <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductDisabled.name}}" stepKey="fillSimpleProductNameInNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductDisabled.sku}}" stepKey="fillProductSku"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickClearAll"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickFiltersButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductNameInNameFilter"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillProductSku"/> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickApplyFiltersButton"> + <argument name="product" value="simpleProductDisabled"/> + </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> <waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/> <!-- Verify customer see updated simple product in the product form page --> - <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductDisabled.name}}" stepKey="seeSimpleProductName"/> - <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductDisabled.sku}}" stepKey="seeSimpleProductSku"/> - <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductDisabled.price}}" stepKey="seeSimpleProductPrice"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductDisabled.quantity}}" stepKey="seeSimpleProductQuantity"/> - <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductDisabled.status}}" stepKey="seeSimpleProductStockStatus"/> - <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductDisabled.weight}}" stepKey="seeSimpleProductWeight"/> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="seeSimpleProductName"> + <argument name="productStatus" value="{{SimpleProductDisabled.status}}"/> + <argument name="productName" value="{{simpleProductDisabled.name}}"/> + <argument name="productSku" value="{{simpleProductDisabled.sku}}"/> + <argument name="productPrice" value="{{simpleProductDisabled.price}}"/> + <argument name="productQuantity" value="{{simpleProductDisabled.quantity}}"/> + <argument name="productWeight" value="{{simpleProductDisabled.weight}}"/> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="seeSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="seeSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="seeSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="seeSimpleProductStockStatus"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="seeSimpleProductWeight"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSectionHeader"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSectionHeader"/> - <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductDisabled.urlKey}}" stepKey="seeSimpleProductUrlKey"/> + <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductDisabled.urlKey}}" + stepKey="seeSimpleProductUrlKey"/> <!--Verify customer don't see updated simple product link on magento storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductDisabled.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> - <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToMagentoStorefrontPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForStoreFrontProductPageLoad"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> <argument name="phrase" value="{{simpleProductDisabled.sku}}"/> </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> - <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductNameOnStorefrontPage"> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForSearchTextBox"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickSearchTextBoxButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForSearch"/> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" + stepKey="dontSeeProductNameOnStorefrontPage"> <argument name="productName" value="{{simpleProductDisabled.name}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index d2e145adb6a86..39ff6d99b5b75 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> <skip> <issueId value="DEPRECATED">Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead</issueId> - </skip> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> @@ -108,7 +108,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductEnabledFlat.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 52f550248819e..3ee9d0a9262c8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -36,67 +36,89 @@ </after> <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openProductCatalogPage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> - <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> - <argument name="product" value="$$initialSimpleProduct$$"/> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="productSku" value="$initialSimpleProduct.sku$"/> </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="fillSimpleProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="fillSimpleProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductNotVisibleIndividually.price}}" stepKey="fillSimpleProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductNotVisibleIndividually.quantity}}" stepKey="fillSimpleProductQuantity"/> - <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductNotVisibleIndividually.status}}" stepKey="selectStockStatusInStock"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductNotVisibleIndividually.weight}}" stepKey="fillSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> - <waitForPageLoad stepKey="waitForCategory1"/> - <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> - <waitForPageLoad stepKey="waitForCategory2"/> - <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> + <actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillSimpleProductName"> + <argument name="productName" value="{{simpleProductNotVisibleIndividually.name}}"/> + <argument name="productSku" value="{{simpleProductNotVisibleIndividually.sku}}"/> + <argument name="productPrice" value="{{simpleProductNotVisibleIndividually.price}}"/> + <argument name="productQuantity" value="{{simpleProductNotVisibleIndividually.quantity}}"/> + <argument name="productStatus" value="{{simpleProductNotVisibleIndividually.status}}"/> + <argument name="productWeight" value="{{simpleProductNotVisibleIndividually.weight}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectStockStatusInStock"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductWeight"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDown"/> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="fillSearchForInitialCategory"> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategory1"/> + <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="unselectInitialCategory"/> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="fillSearchCategory"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategory2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnCategory"/> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="selectVisibility"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> - <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductNotVisibleIndividually.urlKey}}" stepKey="fillSimpleProductUrlKey"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickAdminProductSEOSection"/> + <actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillSimpleProductUrlKey"> + <argument name="urlKey" value="{{simpleProductNotVisibleIndividually.urlKey}}"/> + </actionGroup> <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> <!-- Verify customer see success message --> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertSimpleProductSaveSuccessMessage"> + <argument name="message" value="You saved the product."/> + </actionGroup> <!-- Search updated simple product(from above step) in the grid page --> <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="fillSimpleProductNameInNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="fillProductSku"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickClearAll"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickFiltersButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductNameInNameFilter"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickApplyFiltersButton"> + <argument name="product" value="simpleProductNotVisibleIndividually"/> + </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> <waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/> - <!-- Verify customer see updated simple product in the product form page --> - <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="seeSimpleProductName"/> - <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="seeSimpleProductSku"/> - <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductNotVisibleIndividually.price}}" stepKey="seeSimpleProductPrice"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductNotVisibleIndividually.quantity}}" stepKey="seeSimpleProductQuantity"/> - <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductNotVisibleIndividually.status}}" stepKey="seeSimpleProductStockStatus"/> - <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductNotVisibleIndividually.weightNoDecimals}}" stepKey="seeSimpleProductWeight"/> - - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> - <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="seeSelectedCategories"> + <!--Verify customer see updated simple product in the product form page--> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="seeSimpleProductName"> + <argument name="productName" value="{{simpleProductNotVisibleIndividually.name}}"/> + <argument name="productSku" value="{{simpleProductNotVisibleIndividually.sku}}"/> + <argument name="productPrice" value="{{simpleProductNotVisibleIndividually.price}}"/> + <argument name="productQuantity" value="{{simpleProductNotVisibleIndividually.quantity}}"/> + <argument name="productWeight" value="{{simpleProductNotVisibleIndividually.weightNoDecimals}}"/> + <argument name="productVisibility" value="{{simpleProductNotVisibleIndividually.visibility}}"/> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="seeSimpleProductVisibility"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductStockStatus"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductWeight"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSelectedCategories"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSectionHeader"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductNotVisibleIndividually.urlKey}}" stepKey="seeSimpleProductUrlKey"/> <!--Verify customer don't see updated simple product link on magento storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductNotVisibleIndividually.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> - <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToMagentoStorefrontPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontProductPageLoad"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> <argument name="phrase" value="{{simpleProductNotVisibleIndividually.sku}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index bdb56af340e7b..6f8356f86986b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -97,7 +97,7 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify customer see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 08c4245147a2d..4de9552b863bb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -39,67 +39,105 @@ <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openProductCatalogPage"> <argument name="productSku" value="$initialSimpleProduct.sku$"/> </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="filterProductGrid"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="fillSimpleProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="fillSimpleProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductRegularPrice32501InStock.price}}" stepKey="fillSimpleProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32501InStock.quantity}}" stepKey="fillSimpleProductQuantity"/> - <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice32501InStock.status}}" stepKey="selectStockStatusInStock"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32501InStock.weight}}" stepKey="fillSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/> - <waitForPageLoad stepKey="waitForCategory1"/> - <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/> - <waitForPageLoad stepKey="waitForCategory2"/> - <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> + <actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillSimpleProductName"> + <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> + <argument name="productSku" value="{{simpleProductRegularPrice32501InStock.sku}}"/> + <argument name="productPrice" value="{{simpleProductRegularPrice32501InStock.price}}"/> + <argument name="productQuantity" value="{{simpleProductRegularPrice32501InStock.quantity}}"/> + <argument name="productStatus" value="{{simpleProductRegularPrice32501InStock.status}}"/> + <argument name="productWeight" value="{{simpleProductRegularPrice32501InStock.weight}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="selectStockStatusInStock"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSimpleProductWeight"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="clickCategoriesDropDown"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSearchForInitialCategory"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForCategory1"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="unselectInitialCategory"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="fillSearchCategory"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" + stepKey="waitForCategory2"/> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="clickOnCategory"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice32501InStock.visibility}}" stepKey="selectVisibility"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> - <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32501InStock.urlKey}}" stepKey="fillUrlKey"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickAdminProductSEOSection"/> + <actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillUrlKey"> + <argument name="urlKey" value="{{simpleProductRegularPrice32501InStock.urlKey}}"/> + </actionGroup> <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> <!-- Verify customer see success message --> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertSimpleProductSaveSuccessMessage"> + <argument name="message" value="You saved the product."/> + </actionGroup> <!-- Search updated simple product(from above step) in the grid page --> <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="fillSimpleProductNameInNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="fillProductSku"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickClearAll"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickFiltersButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductNameInNameFilter"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickApplyFiltersButton"> + <argument name="product" value="simpleProductRegularPrice32501InStock"/> + </actionGroup> <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilSimpleProductPageIsOpened"/> <!-- Verify customer see updated simple product in the product form page --> - <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductName"/> - <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="seeSimpleProductSku"/> - <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductRegularPrice32501InStock.price}}" stepKey="seeSimpleProductPrice"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32501InStock.quantity}}" stepKey="seeSimpleProductQuantity"/> - <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice32501InStock.status}}" stepKey="seeSimpleProductStockStatus"/> - <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32501InStock.weight}}" stepKey="seeSimpleProductWeight"/> - - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> - <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="seeSimpleProductName"> + <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> + <argument name="productSku" value="{{simpleProductRegularPrice32501InStock.sku}}"/> + <argument name="productPrice" value="{{simpleProductRegularPrice32501InStock.price}}"/> + <argument name="productQuantity" value="{{simpleProductRegularPrice32501InStock.quantity}}"/> + <argument name="productWeight" value="{{simpleProductRegularPrice32501InStock.weight}}"/> + <argument name="productVisibility" value="{{simpleProductRegularPrice32501InStock.visibility}}"/> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice32501InStock.visibility}}" stepKey="seeVisibility"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductSku"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductPrice"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductQuantity"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductStockStatus"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductWeight"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectedCategories"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32501InStock.urlKey}}" stepKey="seeUrlKey"/> - <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify customer see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> - <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductNameOnCategoryPage"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertFirstBundleProduct"> + <argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/> + </actionGroup> <!-- Verify customer see updated simple product (from the above step) on the storefront page --> <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> @@ -127,8 +165,8 @@ <comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/> <!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> - <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToMagentoStorefrontPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontProductPageLoad"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox"> <argument name="phrase" value="{{simpleProductRegularPrice32501InStock.sku}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 6f5f3488b1da4..312baff6b8bcb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -95,7 +95,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice325InStock.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer don't see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="dontSeeSimpleProductNameOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 0d1d83efefa5d..5fae92639b489 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -94,7 +94,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer don't see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="dontSeeSimpleProductNameOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml index 39ecb8c3bfd01..2a03187af26ba 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml @@ -127,7 +127,7 @@ </actionGroup> <!-- Verify customer see updated virtual product in category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductRegularPrice.name}}" stepKey="seeVirtualProductLinkOnCategoryPage"/> <grabTextFrom selector="{{StorefrontCategoryMainSection.asLowAs}}" stepKey="tierPriceTextOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml index 0cf0d22094cb6..4e0b5a635594c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml @@ -207,7 +207,7 @@ <seeInField selector="{{AdminProductCustomizableOptionsSection.fillOptionValueSku(virtualProductCustomizableOption4.title,'1')}}" userInput="{{virtualProductCustomizableOption4.option_1_sku}}" stepKey="seeOptionSkuForFourthDataSetSecondRow"/> <!--Verify customer don't see updated virtual product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductRegularPriceInStock.name}}" stepKey="dontSeeVirtualProductNameOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml index 1c23d2cd59f39..3cef25a62775b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml @@ -96,7 +96,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer don't see updated virtual product link(from above step) on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.name}}" stepKey="dontseeVirtualProductNameOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml index c738a589946c0..1e87a10fe753d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml @@ -111,7 +111,7 @@ </actionGroup> <!--Verify customer don't see updated virtual product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$initialCategoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$initialCategoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductRegularPrice99OutOfStock.name}}" stepKey="dontSeeVirtualProductLinkOnCategoryPage"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml index da43d12ab7983..41c187975a92b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml @@ -105,7 +105,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualProductSpecialPrice.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer see updated virtual product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductSpecialPrice.name}}" stepKey="seeVirtualProductNameOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml index 6d21178bbfa01..409ed2cd272a2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml @@ -114,7 +114,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualProductWithTierPriceInStock.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer see updated virtual product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualProductWithTierPriceInStock.name}}" stepKey="seeVirtualProductNameOnCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml index ded8f7d03029e..0123c226d3fa8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -114,7 +114,7 @@ <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{updateVirtualTierPriceOutOfStock.urlKey}}" stepKey="seeUrlKey"/> <!--Verify customer don't see updated virtual product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.custom_attributes[url_key]$$)}}" stepKey="openCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{updateVirtualTierPriceOutOfStock.name}}" stepKey="dontSeeVirtualProductNameOnCategoryPage"/> @@ -155,6 +155,6 @@ <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeVirtualProductName"> <argument name="productName" value="{{updateVirtualTierPriceOutOfStock.name}}"/> </actionGroup> - + </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml index 1e7b7cc14f9cc..ea562cbbd52bc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml @@ -35,6 +35,6 @@ </actionGroup> <!--Checking content storefront--> - <amOnPage url="{{defaultVirtualProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{defaultVirtualProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml index f70f5757ec5c2..f12512e998123 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml @@ -15,13 +15,9 @@ <title value="Admin should be able to set/edit Related Products information when editing a virtual product"/> <description value="Admin should be able to set/edit Related Products information when editing a virtual product"/> <severity value="CRITICAL"/> - <testCaseId value="MC-3415"/> - <group value="Catalog"/> - <skip> - <issueId value="MC-194"/> - </skip> + <testCaseId value="MC-25532"/> + <group value="catalog"/> </annotations> - <before></before> <after> <!-- Delete virtual product --> <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> @@ -38,6 +34,6 @@ </actionGroup> <!--See related product in storefront--> - <amOnPage url="{{defaultVirtualProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{StorefrontProductPage.url(defaultVirtualProduct.urlKey)}}" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml index 5431a19461f76..3faa9e8cf795d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml @@ -18,6 +18,8 @@ <group value="Catalog"/> </annotations> <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <createData entity="ApiProductWithDescription" stepKey="product"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml index 2095d56ce6c59..2f4e20c7c8b55 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml @@ -109,11 +109,7 @@ </actionGroup> <actionGroup ref="ClearProductsFilterActionGroup" stepKey="ClearProductsFilterActionGroup"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> - + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Edit customer info--> <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="OpenEditCustomerFrom"> @@ -159,14 +155,14 @@ <waitForPageLoad stepKey="waitForProductsOpened"/> <!--TEST CASE #1--> <!--Add 3 products to order with specified quantity--> - <click selector="{{OrdersGridSection.selectProduct($$product1.name$$)}}" stepKey="selectProduct1"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product1.name$$)}}" userInput="10" stepKey="AddProductQuantity1"/> + <click selector="{{OrdersGridSection.selectProduct($$product1.sku$$)}}" stepKey="selectProduct1"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product1.sku$$)}}" userInput="10" stepKey="AddProductQuantity1"/> - <click selector="{{OrdersGridSection.selectProduct($$product2.name$$)}}" stepKey="selectProduct2"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product2.name$$)}}" userInput="10" stepKey="AddProductQuantity2"/> + <click selector="{{OrdersGridSection.selectProduct($$product2.sku$$)}}" stepKey="selectProduct2"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product2.sku$$)}}" userInput="10" stepKey="AddProductQuantity2"/> - <click selector="{{OrdersGridSection.selectProduct($$product3.name$$)}}" stepKey="selectProduct3"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product3.name$$)}}" userInput="10" stepKey="AddProductQuantity3"/> + <click selector="{{OrdersGridSection.selectProduct($$product3.sku$$)}}" stepKey="selectProduct3"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product3.sku$$)}}" userInput="10" stepKey="AddProductQuantity3"/> <click stepKey="addProductsToOrder" selector="{{OrdersGridSection.addProductsToOrder}}"/> <waitForLoadingMaskToDisappear stepKey="wait6"/> <!--Verify tier price values--> @@ -224,14 +220,14 @@ <!--Add 3 products to order with specified quantity--> <scrollToTopOfPage stepKey="scrollToTopOfPage"/> <click stepKey="clickToAddProduct1" selector="{{OrdersGridSection.addProducts}}"/> - <click selector="{{OrdersGridSection.selectProduct($$product1.name$$)}}" stepKey="selectProduct5"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product1.name$$)}}" userInput="10" stepKey="AddProductQuantity5"/> + <click selector="{{OrdersGridSection.selectProduct($$product1.sku$$)}}" stepKey="selectProduct5"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product1.sku$$)}}" userInput="10" stepKey="AddProductQuantity5"/> - <click selector="{{OrdersGridSection.selectProduct($$product2.name$$)}}" stepKey="selectProduct6"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product2.name$$)}}" userInput="10" stepKey="AddProductQuantity6"/> + <click selector="{{OrdersGridSection.selectProduct($$product2.sku$$)}}" stepKey="selectProduct6"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product2.sku$$)}}" userInput="10" stepKey="AddProductQuantity6"/> - <click selector="{{OrdersGridSection.selectProduct($$product3.name$$)}}" stepKey="selectProduct7"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product3.name$$)}}" userInput="10" stepKey="AddProductQuantity7"/> + <click selector="{{OrdersGridSection.selectProduct($$product3.sku$$)}}" stepKey="selectProduct7"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product3.sku$$)}}" userInput="10" stepKey="AddProductQuantity7"/> <click stepKey="addProductsToOrder1" selector="{{OrdersGridSection.addProductsToOrder}}"/> <waitForLoadingMaskToDisappear stepKey="wait7"/> <!--Verify tier price values--> @@ -257,8 +253,8 @@ <waitForPageLoad stepKey="waitForPgeLoaded3"/> <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickToAddProduct2"/> <waitForLoadingMaskToDisappear stepKey="wait8"/> - <click selector="{{OrdersGridSection.selectProduct($$product4.name$$)}}" stepKey="selectProduct8"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product4.name$$)}}" userInput="10" stepKey="AddProductQuantity9"/> + <click selector="{{OrdersGridSection.selectProduct($$product4.sku$$)}}" stepKey="selectProduct8"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product4.sku$$)}}" userInput="10" stepKey="AddProductQuantity9"/> <click selector="{{OrdersGridSection.addProductsToOrder}}" stepKey="addProductsToOrder2"/> <waitForLoadingMaskToDisappear stepKey="wait9"/> <grabTextFrom selector="{{OrdersGridSection.productPrice($$product4.name$$)}}" stepKey="checkProductPrice10"/> @@ -296,8 +292,8 @@ <waitForPageLoad stepKey="WaitProductsDeleted1"/> <scrollToTopOfPage stepKey="scrollToTopOfPage1"/> <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickToAddProduct4" /> - <click selector="{{OrdersGridSection.selectProduct($$product1.name$$)}}" stepKey="selectProduct9"/> - <fillField selector="{{OrdersGridSection.setQuantity($$product1.name$$)}}" userInput="10" stepKey="AddProductQuantity10"/> + <click selector="{{OrdersGridSection.selectProduct($$product1.sku$$)}}" stepKey="selectProduct9"/> + <fillField selector="{{OrdersGridSection.setQuantity($$product1.sku$$)}}" userInput="10" stepKey="AddProductQuantity10"/> <click selector="{{OrdersGridSection.addProductsToOrder}}" stepKey="addProductsToOrder3"/> <waitForLoadingMaskToDisappear stepKey="wait11"/> <fillField selector="{{OrdersGridSection.applyCoupon}}" userInput="ship" stepKey="AddCouponCode"/> @@ -333,9 +329,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHintTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHintTest.xml index e50c124f7cfd9..9bebe97a8b344 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHintTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHintTest.xml @@ -22,8 +22,12 @@ <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> </before> <after> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml index e679402740398..1094af357b187 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml @@ -24,18 +24,14 @@ <comment userInput="Create category, flush cache and log in" stepKey="createCategoryAndLogIn"/> <createData entity="SimpleSubCategory" stepKey="simpleCategory"/> <actionGroup ref="AdminLoginActionGroup" stepKey="logInAsAdmin"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete category and log out --> <comment userInput="Delete category and log out" stepKey="deleteCategoryAndLogOut"/> <deleteData createDataKey="simpleCategory" stepKey="deleteCategory"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutFromAdmin"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <!-- Navigate to category details page --> <comment userInput="Navigate to category details page" stepKey="navigateToAdminCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml index 916bcd7405ecf..9c18ba6cd654b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml @@ -49,7 +49,7 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> <!--Open product page--> - <amOnPage url="{{StorefrontProductPage.url($$createProductDefault.name$$)}}" stepKey="goToProductDefaultPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProductDefault.custom_attributes[url_key]$$)}}" stepKey="goToProductDefaultPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <!--Click on 'Add to Compare' link--> <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickOnAddToCompare"> @@ -60,7 +60,7 @@ <argument name="productVar" value="$$createProductDefault$$"/> </actionGroup> <!--Open product with custom attribute page--> - <amOnPage url="{{StorefrontProductPage.url($$createProductCustom.name$$)}}" stepKey="goToProductCustomPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProductCustom.custom_attributes[url_key]$$)}}" stepKey="goToProductCustomPage"/> <waitForPageLoad stepKey="waitForProductCustomPage"/> <!--Click on 'Add to Compare' link--> <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickOnAddToCompareCustom"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml index f6292a3a96c40..662ff5d0195c7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml @@ -63,7 +63,7 @@ <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> <!-- navigate to the created product page --> - <amOnPage url="/{{SimpleProduct3.name}}.html" stepKey="goToCreatedProduct"/> + <amOnPage url="/{{SimpleProduct3.urlKey}}.html" stepKey="goToCreatedProduct"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <!-- Check to make sure all of the created names are there --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml index 64ad348257853..fe7bbd49dd408 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml @@ -75,9 +75,7 @@ <!-- Logout Admin --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterDeletion"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterDeletion"/> </after> <!--Create widget for recently viewed products--> <actionGroup ref="AdminEditCMSPageContentActionGroup" stepKey="clearRecentlyViewedWidgetsFromCMSContentBefore"> @@ -96,13 +94,10 @@ <argument name="buttonToShowSection1" value="1"/> <argument name="buttonToShowSection2" value="3"/> </actionGroup> - <!-- Warm up cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterWidgetCreated"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterWidgetCreated"/> <!-- Navigate to product 3 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStoreOneProductPageTwo"/> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct3.name$)}}" stepKey="goToStoreOneProductPageThree"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.custom_attributes[url_key]$)}}" stepKey="goToStoreOneProductPageTwo"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct3.custom_attributes[url_key]$)}}" stepKey="goToStoreOneProductPageThree"/> <!-- Go to Home Page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStoreFrontHomePage"/> <actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStoreOneRecentlyViewedProduct2"> @@ -116,8 +111,8 @@ <!-- Switch to second store and add second product (visible on second store) to wishlist --> <click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="clickSwitchStoreButtonOnDefaultStore"/> <click selector="{{StorefrontFooterSection.storeLink(customStore.name)}}" stepKey="selectCustomStore"/> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct1.name$)}}" stepKey="goToStore2ProductPage1"/> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStore2ProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct1.custom_attributes[url_key]$)}}" stepKey="goToStore2ProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.custom_attributes[url_key]$)}}" stepKey="goToStore2ProductPage2"/> <!-- Go to Home Page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnHomePage2"/> <actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertNextStore1RecentlyViewedProduct1"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml index 4d04a25c8d12f..8034e7911cb08 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml @@ -67,9 +67,7 @@ <!-- Logout Admin --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterDeletion"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterDeletion"/> </after> <!--Create widget for recently viewed products--> @@ -90,13 +88,11 @@ <argument name="buttonToShowSection2" value="3"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterWidgetCreated"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterWidgetCreated"/> <!-- Navigate to product 3 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStore1ProductPage2"/> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct3.name$)}}" stepKey="goToStore1ProductPage3"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.custom_attributes[url_key]$)}}" stepKey="goToStore1ProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct3.custom_attributes[url_key]$)}}" stepKey="goToStore1ProductPage3"/> <!-- Go to Home Page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnHomePage"/> <actionGroup ref="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup" stepKey="assertStore1RecentlyViewedProduct2"> @@ -114,8 +110,8 @@ <argument name="storeView" value="customStoreEN"/> </actionGroup> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct1.name$)}}" stepKey="goToStore2ProductPage1"/> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.name$)}}" stepKey="goToStore2ProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct1.custom_attributes[url_key]$)}}" stepKey="goToStore2ProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct2.custom_attributes[url_key]$)}}" stepKey="goToStore2ProductPage2"/> <!-- Go to Home Page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStoreViewHomePage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchSimpleProductBySkuWithHyphenTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchSimpleProductBySkuWithHyphenTest.xml index 69f78c63e2675..b1caeac384d85 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchSimpleProductBySkuWithHyphenTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchSimpleProductBySkuWithHyphenTest.xml @@ -15,12 +15,9 @@ <title value="Guest customer should be able to advance search simple product with product sku that contains hyphen"/> <description value="Guest customer should be able to advance search simple product with product sku that contains hyphen"/> <severity value="MAJOR"/> - <testCaseId value="MC-20361"/> + <testCaseId value="MC-28813"/> <group value="Catalog"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> <createData entity="ApiProductWithDescription" stepKey="product"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchVirtualProductBySkuWithHyphenTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchVirtualProductBySkuWithHyphenTest.xml index b87cce398498f..5ef2fd65fec1b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchVirtualProductBySkuWithHyphenTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontAdvanceCatalogSearchVirtualProductBySkuWithHyphenTest.xml @@ -15,12 +15,9 @@ <title value="Guest customer should be able to advance search virtual product with product sku that contains hyphen"/> <description value="Guest customer should be able to advance search virtual product with product sku that contains hyphen"/> <severity value="MAJOR"/> - <testCaseId value="MC-20385"/> - <group value="Catalog"/> + <testCaseId value="MC-28816"/> + <group value="catalog"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> <createData entity="ApiVirtualProductWithDescription" stepKey="product"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithCategoryFilterTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithCategoryFilterTest.xml index 3ff477070cc30..d8c798dbc1409 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithCategoryFilterTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithCategoryFilterTest.xml @@ -43,10 +43,7 @@ <!-- Set the category filter to be present on the category page layered navigation --> <magentoCLI command="config:set {{EnableCategoryFilterOnCategoryPageConfigData.path}} {{EnableCategoryFilterOnCategoryPageConfigData.value}}" stepKey="setCategoryFilterVisibleOnStorefront"/> - - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithoutCategoryFilterTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithoutCategoryFilterTest.xml index a2316efb3a743..befb64d01bfde 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithoutCategoryFilterTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryPageWithoutCategoryFilterTest.xml @@ -43,10 +43,7 @@ <!-- Set the category filter to NOT be present on the category page layered navigation --> <magentoCLI command="config:set {{DisableCategoryFilterOnCategoryPageConfigData.path}} {{DisableCategoryFilterOnCategoryPageConfigData.value}}" stepKey="hideCategoryFilterOnStorefront"/> - - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml index ca561e4af70de..c9be526e095aa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml @@ -188,13 +188,11 @@ <seeInField selector="{{AdminCatalogStorefrontConfigSection.productsPerPageDefaultValue}}" userInput="12" stepKey="seeDefaultValueProductPerPage"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Open storefront on the category page --> <comment userInput="Open storefront on the category page" stepKey="commentOpenStorefront"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="goToStorefrontCreatedCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goToStorefrontCreatedCategoryPage"/> <!-- Check the drop-down at the bottom of page contains options --> <comment userInput="Check the drop-down at the bottom of page contains options" stepKey="commentCheckOptions"/> <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" stepKey="scrollToBottomToolbarSection"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml index 5d584bed989b3..d0c6c4fe86aee 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml @@ -170,7 +170,7 @@ </after> <!-- Open ConfigProduct in Store Front Page --> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="openProductInStoreFront"/> <waitForPageLoad stepKey="waitForProductToLoad"/> <!-- Check fotorama thumbnail images (no selected options) --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml index 9731b66209df0..34d712f49e338 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml @@ -34,9 +34,7 @@ <deleteData createDataKey="category3" stepKey="deleteCategory3"/> <deleteData createDataKey="category2" stepKey="deleteCategory2"/> <deleteData createDataKey="category1" stepKey="deleteCategory1"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="cleanInvalidatedCaches"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="cleanInvalidatedCaches"/> </after> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStorefrontPage"/> <moveMouseOver diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml index df1eb0c502e18..f9ad2d69264f4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml @@ -51,7 +51,7 @@ <!-- Assert product in storefront product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openCreatedProductPage"> - <argument name="productUrl" value="$$createProduct.name$$"/> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> </actionGroup> <!-- Assert Fotorama arrows aren't visible --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml index 1032c322053da..02b21394770c1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml @@ -42,7 +42,7 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Check product in category listing--> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goToCategoryPage"/> <seeElement selector="{{StorefrontCategoryProductSection.ProductImageByNameAndSrc(SimpleProductNameWithDoubleQuote.name, ProductImage.fileName)}}" stepKey="seeCorrectImageCategoryPage"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(SimpleProductNameWithDoubleQuote.name)}}" userInput="{{SimpleProductNameWithDoubleQuote.name}}" stepKey="seeCorrectNameCategoryPage"/> <see selector="{{StorefrontCategoryProductSection.ProductPriceByName(SimpleProductNameWithDoubleQuote.name)}}" userInput="${{SimpleProductNameWithDoubleQuote.price}}" stepKey="seeCorrectPriceCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml index 9819357704d44..9c248a289ebd4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml @@ -36,7 +36,7 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Check product in category listing--> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategoryOne.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategoryOne.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <waitForPageLoad stepKey="waitforCategoryPageToLoad"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(productWithHTMLEntityOne.name)}}" userInput="{{productWithHTMLEntityOne.name}}" stepKey="seeCorrectNameProd1CategoryPage"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(productWithHTMLEntityTwo.name)}}" userInput="{{productWithHTMLEntityTwo.name}}" stepKey="seeCorrectNameProd2CategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml index a311b63418a69..203fa753d10fb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml @@ -26,6 +26,7 @@ <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml index c7817ed181ae0..d56faf9d5dec4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml @@ -46,7 +46,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear" /> <seeElement selector=".message-success" stepKey="assertSuccess"/> <actionGroup ref="ClearCacheActionGroup" stepKey="clearCache"/> - <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront1"/> + <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goProductPageOnStorefront1"/> <!-- View Simple Product 1 --> <comment userInput="View simple product 1" stepKey="commentViewSimpleProduct1" after="goProductPageOnStorefront1"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="browseClickCategorySimpleProduct1View" after="commentViewSimpleProduct1"/> @@ -54,7 +54,7 @@ <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="compareAddSimpleProduct1ToCompare"> <argument name="productVar" value="$$createSimpleProduct1$$"/> </actionGroup> - <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront2"/> + <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goProductPageOnStorefront2"/> <!-- View Simple Product 2 --> <comment userInput="View simple product 2" stepKey="commentViewSimpleProduct2" after="goProductPageOnStorefront2"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct2.name$$)}}" stepKey="browseClickCategorySimpleProduct2View" after="commentViewSimpleProduct2"/> @@ -62,7 +62,7 @@ <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="compareAddSimpleProduct2ToCompare"> <argument name="productVar" value="$$createSimpleProduct2$$"/> </actionGroup> - <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="goProductPageOnStorefront3"/> + <amOnPage url="{{StorefrontProductPage.NavigationCategoryByName($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goProductPageOnStorefront3"/> <!-- Check products in comparison sidebar --> <!-- Check simple product 1 in comparison sidebar --> <comment userInput="Check simple product 1 in comparison sidebar" stepKey="commentCheckSimpleProduct1InComparisonSidebar" after="goProductPageOnStorefront3"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml index 71041ee7e1349..dad3e05d81a53 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml @@ -120,9 +120,8 @@ <!--Select payment method--> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> <!-- Place Order --> - <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPlaceOrderButton"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Login to Admin and open Order --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml index ce419167e9514..e8bb48cfdd62b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml @@ -12,14 +12,11 @@ <annotations> <features value="Catalog"/> <stories value="Custom options"/> - <group value="Catalog"/> <title value="Admin should be able to see the full title of the selected custom option value in the order"/> <description value="Admin should be able to see the full title of the selected custom option value in the order"/> <severity value="MAJOR"/> - <testCaseId value="MC-3043"/> - <skip> - <issueId value="MQE-1128"/> - </skip> + <testCaseId value="MC-25479"/> + <group value="catalog"/> </annotations> <before> <!--Create Simple Product with Custom Options--> @@ -45,38 +42,39 @@ <!-- Login Customer Storefront --> <actionGroup ref="StorefrontOpenCustomerLoginPageActionGroup" stepKey="goToSignInPage"/> <actionGroup ref="StorefrontFillCustomerLoginFormActionGroup" stepKey="fillLoginFormWithCorrectCredentials"> - <argument name="customer" value="$$createCustomer$$"/> + <argument name="customer" value="$createCustomer$"/> </actionGroup> <actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButton" /> <!-- Checking the correctness of displayed prices for user parameters --> - <amOnPage url="{{StorefrontHomePage.url}}$$createProduct.custom_attributes[url_key]$$.html" stepKey="amOnProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="amOnProductPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> <seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptionsDropDown(ProductOptionDropDownWithLongValuesTitle.title, ProductOptionValueDropdownLongTitle1.price)}}" stepKey="checkDropDownProductOption"/> <!-- Adding items to the checkout --> <selectOption userInput="{{ProductOptionValueDropdownLongTitle1.price}}" selector="{{StorefrontProductInfoMainSection.productOptionSelect(ProductOptionDropDownWithLongValuesTitle.title)}}" stepKey="seeProductOptionDropDown"/> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="finalProductPrice"/> - + <comment userInput="BIC workaround" stepKey="finalProductPrice"/> <actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> - <argument name="productName" value="$$createProduct.name$$"/> + <argument name="productName" value="$createProduct.name$"/> </actionGroup> <!-- Checking the correctness of displayed custom options for user parameters on checkout --> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart" /> - <conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{CheckoutPaymentSection.cartItemsArea}}" visible="true" stepKey="exposeMiniCart"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.cartItemsArea}}" stepKey="waitForCartItemsVisible"/> + <conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{CheckoutPaymentSection.cartItemsAreaActive}}" visible="false" stepKey="exposeMiniCart"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForCartItem"/> - <waitForElement selector="{{CheckoutPaymentSection.cartItemsAreaActive}}" time="30" stepKey="waitForCartItemsAreaActive"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.cartItems}}" stepKey="waitForCartItemsAreaActive"/> - <see selector="{{CheckoutPaymentSection.cartItems}}" userInput="$$createProduct.name$$" stepKey="seeProductInCart"/> + <see selector="{{CheckoutPaymentSection.cartItems}}" userInput="$createProduct.name$" stepKey="seeProductInCart"/> - <conditionalClick selector="{{CheckoutPaymentSection.ProductOptionsByProductItemName($$createProduct.name$$)}}" dependentSelector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($$createProduct.name$$)}}" visible="false" stepKey="exposeProductOptions"/> + <conditionalClick selector="{{CheckoutPaymentSection.ProductOptionsByProductItemName($createProduct.name$)}}" dependentSelector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($createProduct.name$)}}" visible="false" stepKey="exposeProductOptions"/> - <see selector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($$createProduct.name$$)}}" userInput="{{ProductOptionValueDropdownLongTitle1.title}}" stepKey="seeProductOptionValueDropdown1Input1"/> + <see selector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($createProduct.name$)}}" userInput="{{ProductOptionValueDropdownLongTitle1.title}}" stepKey="seeProductOptionValueDropdown1Input1"/> <!--Select shipping method--> @@ -84,14 +82,13 @@ <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNext"/> <!-- Checkout select Check/Money Order payment --> - <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> + <comment userInput="BIC workaround" stepKey="selectCheckMoneyPayment"/> <!-- Place Order --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPlaceOrderButton"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Login to Admin and open Order --> @@ -117,6 +114,6 @@ </assertEquals> <moveMouseOver selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd" stepKey="hoverProduct"/> <waitForElementVisible selector="{{AdminOrderItemsOrderedSection.productNameOptions}} dd:nth-child(2)" stepKey="waitForCustomOptionValueFullName"/> - <see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111" stepKey="seeAdminOrderProductOptionValueDropdown1"/> + <see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj111 11Optisfvdklvfnkljvnfdklpvnfdjklfdvnjkvfdkjnvfdjkfvndj11111" stepKey="seeAdminOrderProductOptionValueDropdown1"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml index 78fbed1aef3a9..107000a337991 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml @@ -44,7 +44,7 @@ <argument name="numOfProductsPerPage" value="12"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$defaultCategory2.name$$)}}" stepKey="navigateToCategory2Page"/> + <amOnPage url="{{StorefrontCategoryPage.url($$defaultCategory2.custom_attributes[url_key]$$)}}" stepKey="navigateToCategory2Page"/> <waitForPageLoad stepKey="waitForCategory2PageToLoad"/> <actionGroup ref="VerifyCategoryPageParametersActionGroup" stepKey="verifyCategory2PageParameters"> @@ -61,10 +61,7 @@ <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> <deleteData createDataKey="defaultCategory2" stepKey="deleteCategory2"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> - + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml index 164701fa5bc6d..5ff0a002e11ed 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml @@ -69,7 +69,7 @@ </actionGroup> <!--Go to the product page and check special price--> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <grabTextFrom selector="{{StorefrontProductInfoMainSection.specialPriceValue}}" stepKey="grabSpecialPrice"/> <assertEquals stepKey="assertSpecialPrice"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml index ee6ff0c224545..1790b2be68e29 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml @@ -39,7 +39,7 @@ <dontSee selector="{{TinyMCESection.InsertVariableBtn}}" stepKey="insertVariable" /> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCatalog"/> <!-- Go to storefront product page, assert product content --> - <amOnPage url="/{{SimpleSubCategory.name_lwr}}.html" stepKey="goToCategoryFrontPage"/> + <amOnPage url="/{{SimpleSubCategory.urlKey}}.html" stepKey="goToCategoryFrontPage"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <waitForElementVisible selector="{{StorefrontCategoryMainSection.CatalogDescription}}" stepKey="waitForDesVisible" /> <see userInput="Hello World!" selector="{{StorefrontCategoryMainSection.CatalogDescription}}" stepKey="assertCatalogDescription"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml index f75053f495c4d..e52b334e66de9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml @@ -52,7 +52,7 @@ <dontSee selector="{{TinyMCESection.InsertVariableBtn}}" stepKey="insertVariable2" /> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> <!-- Go to storefront product page, assert product content --> - <amOnPage url="{{_defaultProduct.name}}.html" stepKey="navigateToProductPage"/> + <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <scrollTo selector="{{StorefrontProductInfoMainSection.stock}}" stepKey="scrollToStock"/> <see userInput="Hello World!" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php index 157f641335497..55551a4ed603a 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/ListProductTest.php @@ -195,7 +195,7 @@ public function testGetIdentities() $this->catCollectionMock->expects($this->once()) ->method('getIterator') - ->willReturn([$currentCategory]); + ->willReturn(new \ArrayIterator([$currentCategory])); $this->prodCollectionMock->expects($this->any()) ->method('getIterator') diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Ui/ProductViewCounterTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Ui/ProductViewCounterTest.php index 6026d1462e461..87f5be4b21333 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Ui/ProductViewCounterTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Ui/ProductViewCounterTest.php @@ -166,6 +166,7 @@ public function testGetCurrentProductDataWithNonEmptyProduct() { $productMock = $this->getMockBuilder(ProductInterface::class) ->disableOriginalConstructor() + ->addMethods(['isAvailable']) ->getMockForAbstractClass(); $productRendererMock = $this->getMockBuilder(ProductRenderInterface::class) ->disableOriginalConstructor() @@ -173,7 +174,6 @@ public function testGetCurrentProductDataWithNonEmptyProduct() $storeMock = $this->getMockBuilder(Store::class) ->disableOriginalConstructor() ->getMock(); - $this->registryMock->expects($this->once()) ->method('registry') ->with('product') diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilterTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilterTest.php index 2560b56a04e84..f38ffcd822cd9 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilterTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilterTest.php @@ -216,6 +216,29 @@ public function setupInputDataProvider() ['description', null, 'descr text'], ], ], + 'update_product_with_empty_string_attribute' => [ + 'requestProductData' => [ + 'name' => 'testName3', + 'sku' => 'testSku3', + 'price' => '103', + 'special_price' => '100', + 'custom_attribute' => '', + ], + 'useDefaults' => [], + 'expectedProductData' => [ + 'name' => 'testName3', + 'sku' => 'testSku3', + 'price' => '103', + 'special_price' => '100', + 'custom_attribute' => '', + ], + 'initialProductData' => [ + ['name', null, 'testName2'], + ['sku', null, 'testSku2'], + ['price', null, '101'], + ['custom_attribute', null, '0'], + ], + ], ]; } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/SaveHandlerTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/SaveHandlerTest.php index c807ea881da6e..8721e86614469 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/SaveHandlerTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/SaveHandlerTest.php @@ -180,4 +180,143 @@ public function testExecuteWithException(): void $this->saveHandler->execute($product); } + + /** + * @param $tierPrices + * @param $tierPricesStored + * @param $tierPricesExpected + * @dataProvider executeWithWebsitePriceDataProvider + */ + public function testExecuteWithWebsitePrice($tierPrices, $tierPricesStored, $tierPricesExpected): void + { + $productId = 10; + $linkField = 'entity_id'; + + /** @var MockObject $product */ + $product = $this->getMockBuilder(ProductInterface::class) + ->disableOriginalConstructor() + ->setMethods(['getData','setData', 'getStoreId']) + ->getMockForAbstractClass(); + $product->expects($this->atLeastOnce())->method('getData')->willReturnMap( + [ + ['tier_price', $tierPrices], + ['entity_id', $productId] + ] + ); + $product->expects($this->atLeastOnce())->method('getStoreId')->willReturn(0); + $product->expects($this->atLeastOnce())->method('setData')->with('tier_price_changed', 1); + $store = $this->getMockBuilder(StoreInterface::class) + ->disableOriginalConstructor() + ->setMethods(['getWebsiteId']) + ->getMockForAbstractClass(); + $store->expects($this->atLeastOnce())->method('getWebsiteId')->willReturn(1); + $this->storeManager->expects($this->atLeastOnce())->method('getStore')->willReturn($store); + /** @var MockObject $attribute */ + $attribute = $this->getMockBuilder(ProductAttributeInterface::class) + ->disableOriginalConstructor() + ->setMethods(['getName', 'isScopeGlobal']) + ->getMockForAbstractClass(); + $attribute->expects($this->atLeastOnce())->method('getName')->willReturn('tier_price'); + $attribute->expects($this->atLeastOnce())->method('isScopeGlobal')->willReturn(false); + $this->attributeRepository->expects($this->atLeastOnce())->method('get')->with('tier_price') + ->willReturn($attribute); + $productMetadata = $this->getMockBuilder(EntityMetadataInterface::class) + ->disableOriginalConstructor() + ->setMethods(['getLinkField']) + ->getMockForAbstractClass(); + $productMetadata->expects($this->atLeastOnce())->method('getLinkField')->willReturn($linkField); + $this->metadataPoll->expects($this->atLeastOnce())->method('getMetadata') + ->with(ProductInterface::class) + ->willReturn($productMetadata); + $customerGroup = $this->getMockBuilder(GroupInterface::class) + ->disableOriginalConstructor() + ->setMethods(['getId']) + ->getMockForAbstractClass(); + $customerGroup->expects($this->atLeastOnce())->method('getId')->willReturn(3200); + $this->groupManagement->expects($this->atLeastOnce())->method('getAllCustomersGroup') + ->willReturn($customerGroup); + $this->tierPriceResource + ->expects($this->at(1)) + ->method('savePriceData') + ->with(new \Magento\Framework\DataObject($tierPricesExpected[0])) + ->willReturnSelf(); + $this->tierPriceResource + ->expects($this->at(2)) + ->method('savePriceData') + ->with(new \Magento\Framework\DataObject($tierPricesExpected[1])) + ->willReturnSelf(); + $this->tierPriceResource + ->expects($this->at(3)) + ->method('savePriceData') + ->with(new \Magento\Framework\DataObject($tierPricesExpected[2])) + ->willReturnSelf(); + $this->tierPriceResource + ->expects($this->atLeastOnce()) + ->method('loadPriceData') + ->willReturn($tierPricesStored); + + $this->assertEquals($product, $this->saveHandler->execute($product)); + } + + public function executeWithWebsitePriceDataProvider(): array + { + $productId = 10; + return [[ + 'tierPrices' => [ + [ + 'price_id' => 1, + 'website_id' => 0, + 'price_qty' => 1, + 'cust_group' => 0, + 'price' => 10, + 'product_id' => $productId + ],[ + 'price_id' => 2, + 'website_id' => 1, + 'price_qty' => 2, + 'cust_group' => 3200, + 'price' => null, + 'percentage_value' => 20, + 'product_id' => $productId + ] + ], + 'tierPricesStored' => [ + [ + 'price_id' => 3, + 'website_id' => 1, + 'price_qty' => 3, + 'cust_group' => 0, + 'price' => 30, + 'product_id' => $productId + ] + ], + 'tierPricesExpected' => [ + [ + 'website_id' => 0, + 'qty' => 1, + 'customer_group_id' => 0, + 'all_groups' => 0, + 'value' => 10, + 'percentage_value' => null, + 'entity_id' => $productId + ],[ + 'website_id' => 1, + 'qty' => 2, + 'customer_group_id' => 0, + 'all_groups' => 1, + 'value' => null, + 'percentage_value' => 20, + 'entity_id' => $productId + ],[ + 'website_id' => 1, + 'qty' => 3, + 'customer_group_id' => 0, + 'all_groups' => 0, + 'value' => 30, + 'percentage_value' => null, + 'entity_id' => $productId + ] + ] + ]]; + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/FileInfoTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/FileInfoTest.php index 6928f9161b815..96948ed8d1aa8 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Category/FileInfoTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/FileInfoTest.php @@ -129,21 +129,13 @@ public function testGetMimeType() $absoluteFilePath = '/a/b/c/pub/media/catalog/category/filename.ext1'; $expected = 'ext1'; - - $this->mediaDirectory->expects($this->at(0)) - ->method('getAbsolutePath') - ->with(null) - ->willReturn('/a/b/c/pub/media/'); - - $this->mediaDirectory->expects($this->at(1)) - ->method('getAbsolutePath') - ->with(null) - ->willReturn('/a/b/c/pub/media/'); - - $this->mediaDirectory->expects($this->at(2)) - ->method('getAbsolutePath') - ->with('/catalog/category/filename.ext1') - ->willReturn($absoluteFilePath); + $this->mediaDirectory->method('getAbsolutePath') + ->willReturnMap( + [ + [null, '/a/b/c/pub/media'], + ['/catalog/category/filename.ext1', $absoluteFilePath] + ] + ); $this->mime->expects($this->once()) ->method('getMimeType') diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php index 673e12a5b42b5..2924bf66949c1 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php @@ -267,13 +267,16 @@ public function testSaveDoesNotSaveAttributeOptionsIfOptionsAreAbsentInPayload() { $attributeId = 1; $attributeCode = 'existing_attribute_code'; + $backendModel = 'backend_model'; $attributeMock = $this->createMock(Attribute::class); $attributeMock->expects($this->any())->method('getAttributeCode')->willReturn($attributeCode); $attributeMock->expects($this->any())->method('getAttributeId')->willReturn($attributeId); + $attributeMock->expects($this->once())->method('setBackendModel')->with($backendModel)->willReturnSelf(); $existingModelMock = $this->createMock(Attribute::class); $existingModelMock->expects($this->any())->method('getAttributeCode')->willReturn($attributeCode); $existingModelMock->expects($this->any())->method('getAttributeId')->willReturn($attributeId); + $existingModelMock->expects($this->once())->method('getBackendModel')->willReturn($backendModel); $this->eavAttributeRepositoryMock->expects($this->any()) ->method('get') @@ -292,6 +295,7 @@ public function testSaveDoesNotSaveAttributeOptionsIfOptionsAreAbsentInPayload() */ public function testSaveSavesDefaultFrontendLabelIfItIsPresentInPayload() { + $backendModel = 'backend_model'; $labelMock = $this->getMockForAbstractClass(AttributeFrontendLabelInterface::class); $labelMock->expects($this->any())->method('getStoreId')->willReturn(1); $labelMock->expects($this->any())->method('getLabel')->willReturn('Store Scope Label'); @@ -304,11 +308,13 @@ public function testSaveSavesDefaultFrontendLabelIfItIsPresentInPayload() $attributeMock->expects($this->any())->method('getDefaultFrontendLabel')->willReturn(null); $attributeMock->expects($this->any())->method('getFrontendLabels')->willReturn([$labelMock]); $attributeMock->expects($this->any())->method('getOptions')->willReturn([]); + $attributeMock->expects($this->once())->method('setBackendModel')->with($backendModel)->willReturnSelf(); $existingModelMock = $this->createMock(Attribute::class); $existingModelMock->expects($this->any())->method('getDefaultFrontendLabel')->willReturn('Default Label'); $existingModelMock->expects($this->any())->method('getAttributeId')->willReturn($attributeId); $existingModelMock->expects($this->any())->method('getAttributeCode')->willReturn($attributeCode); + $existingModelMock->expects($this->once())->method('getBackendModel')->willReturn($backendModel); $this->eavAttributeRepositoryMock->expects($this->any()) ->method('get') diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/RepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/RepositoryTest.php index ac67ba52d7728..016e755f27b4d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/RepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/RepositoryTest.php @@ -262,7 +262,7 @@ public function testSave() ->getMock(); $optionCollection->expects($this->once())->method('getProductOptions')->willReturn([$this->optionMock]); $this->optionCollectionFactory->expects($this->once())->method('create')->willReturn($optionCollection); - $this->optionMock->expects($this->once())->method('getValues')->willReturn([ + $this->optionMock->expects($this->exactly(2))->method('getValues')->willReturn([ $originalValue1, $originalValue2, $originalValue3 @@ -291,7 +291,7 @@ public function testSaveWhenOptionTypeWasChanged() ->getMock(); $optionCollection->expects($this->once())->method('getProductOptions')->willReturn([$this->optionMock]); $this->optionCollectionFactory->expects($this->once())->method('create')->willReturn($optionCollection); - $this->optionMock->expects($this->once())->method('getValues')->willReturn(null); + $this->optionMock->expects($this->exactly(2))->method('getValues')->willReturn(null); $this->assertEquals($this->optionMock, $this->optionRepository->save($this->optionMock)); } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php index fa8a3fc1e6059..82916cf42ebe3 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php @@ -11,9 +11,13 @@ use Magento\Catalog\Model\Product\Option; use Magento\Catalog\Model\Product\Option\Repository; use Magento\Catalog\Model\Product\Option\SaveHandler; +use Magento\Catalog\Model\ResourceModel\Product\Relation; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +/** + * Test for \Magento\Catalog\Model\Product\Option\SaveHandler. + */ class SaveHandlerTest extends TestCase { /** @@ -36,6 +40,14 @@ class SaveHandlerTest extends TestCase */ protected $optionRepository; + /** + * @var Relation|MockObject + */ + private $relationMock; + + /** + * @inheridoc + */ protected function setUp(): void { $this->entity = $this->getMockBuilder(Product::class) @@ -47,11 +59,19 @@ protected function setUp(): void $this->optionRepository = $this->getMockBuilder(Repository::class) ->disableOriginalConstructor() ->getMock(); + $this->relationMock = $this->getMockBuilder(Relation::class) + ->disableOriginalConstructor() + ->getMock(); - $this->model = new SaveHandler($this->optionRepository); + $this->model = new SaveHandler($this->optionRepository, $this->relationMock); } - public function testExecute() + /** + * Test for execute + * + * @return void + */ + public function testExecute(): void { $this->optionMock->expects($this->any())->method('getOptionId')->willReturn(5); $this->entity->expects($this->once())->method('getOptions')->willReturn([$this->optionMock]); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php index c14bb7f524d03..61bbaf94e9fff 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php @@ -21,6 +21,7 @@ use Magento\Store\Model\StoreManagerInterface; use Magento\Store\Model\Website; use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\RuntimeException; use PHPUnit\Framework\TestCase; /** @@ -110,7 +111,7 @@ protected function setUp(): void $this->groupManagementMock->expects($this->any())->method('getAllCustomersGroup') ->willReturn($group); $this->tierPriceExtensionFactoryMock = $this->getMockBuilder(ProductTierPriceExtensionFactory::class) - ->setMethods(['create']) + ->onlyMethods(['create']) ->disableOriginalConstructor() ->getMock(); $this->model = $this->objectManagerHelper->getObject( @@ -182,9 +183,7 @@ function () { ); // create sample TierPrice objects that would be coming from a REST call - $tierPriceExtensionMock = $this->getMockBuilder(ProductTierPriceExtensionInterface::class) - ->setMethods(['getWebsiteId', 'setWebsiteId', 'getPercentageValue', 'setPercentageValue']) - ->getMockForAbstractClass(); + $tierPriceExtensionMock = $this->getProductTierPriceExtensionInterfaceMock(); $tierPriceExtensionMock->expects($this->any())->method('getWebsiteId')->willReturn($expectedWebsiteId); $tierPriceExtensionMock->expects($this->any())->method('getPercentageValue')->willReturn(null); $tp1 = $this->objectManagerHelper->getObject(TierPrice::class); @@ -226,9 +225,7 @@ function () { $this->assertEquals($tps[$i]->getQty(), $tpData['price_qty'], 'Qty does not match'); } - $tierPriceExtensionMock = $this->getMockBuilder(ProductTierPriceExtensionInterface::class) - ->setMethods(['getWebsiteId', 'setWebsiteId', 'getPercentageValue', 'setPercentageValue']) - ->getMockForAbstractClass(); + $tierPriceExtensionMock = $this->getProductTierPriceExtensionInterfaceMock(); $tierPriceExtensionMock->expects($this->any())->method('getPercentageValue')->willReturn(50); $tierPriceExtensionMock->expects($this->any())->method('setWebsiteId'); $this->tierPriceExtensionFactoryMock->expects($this->any()) @@ -289,9 +286,7 @@ function () { return $this->objectManagerHelper->getObject(TierPrice::class); } ); - $tierPriceExtensionMock = $this->getMockBuilder(ProductTierPriceExtensionInterface::class) - ->onlyMethods(['getPercentageValue', 'setPercentageValue']) - ->getMockForAbstractClass(); + $tierPriceExtensionMock = $this->getProductTierPriceExtensionInterfaceMock(); $tierPriceExtensionMock->method('getPercentageValue') ->willReturn(50); $this->tierPriceExtensionFactoryMock->method('create') @@ -299,4 +294,22 @@ function () { $this->assertInstanceOf(TierPrice::class, $this->model->getTierPrices($this->product)[0]); } + + /** + * Build ProductTierPriceExtensionInterface mock. + * + * @return MockObject + */ + private function getProductTierPriceExtensionInterfaceMock(): MockObject + { + $mockBuilder = $this->getMockBuilder(ProductTierPriceExtensionInterface::class) + ->disableOriginalConstructor(); + try { + $mockBuilder->addMethods(['getPercentageValue', 'setPercentageValue', 'setWebsiteId', 'getWebsiteId']); + } catch (RuntimeException $e) { + // ProductTierPriceExtensionInterface already generated and has all necessary methods. + } + + return $mockBuilder->getMock(); + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php index a68eb3e652da9..a0c682aa3e416 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductIdLocatorTest.php @@ -13,7 +13,6 @@ use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; use Magento\Framework\EntityManager\EntityMetadataInterface; use Magento\Framework\EntityManager\MetadataPool; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -23,14 +22,19 @@ class ProductIdLocatorTest extends TestCase { /** - * @var MetadataPool|MockObject + * @var int */ - private $metadataPool; + private $idsLimit; /** - * @var CollectionFactory|MockObject + * @var string */ - private $collectionFactory; + private $linkField; + + /** + * @var Collection|MockObject + */ + private $collection; /** * @var ProductIdLocator @@ -38,79 +42,125 @@ class ProductIdLocatorTest extends TestCase private $model; /** - * Set up. - * - * @return void + * @inheritDoc */ protected function setUp(): void { - $this->metadataPool = $this->getMockBuilder(MetadataPool::class) - ->setMethods(['getMetadata']) - ->disableOriginalConstructor() - ->getMock(); - $this->collectionFactory = $this - ->getMockBuilder(CollectionFactory::class) + $metadataPool = $this->createMock(MetadataPool::class); + $collectionFactory = $this->getMockBuilder(CollectionFactory::class) ->setMethods(['create']) ->disableOriginalConstructor() ->getMock(); + $this->idsLimit = 4; - $objectManager = new ObjectManager($this); - $this->model = $objectManager->getObject( - ProductIdLocator::class, - [ - 'metadataPool' => $this->metadataPool, - 'collectionFactory' => $this->collectionFactory, - ] - ); + $this->linkField = 'entity_id'; + $metaDataInterface = $this->createMock(EntityMetadataInterface::class); + $metaDataInterface->method('getLinkField') + ->willReturn($this->linkField); + $metadataPool->method('getMetadata') + ->with(ProductInterface::class) + ->willReturn($metaDataInterface); + + $this->collection = $this->createMock(Collection::class); + $collectionFactory->method('create') + ->willReturn($this->collection); + + $this->model = new ProductIdLocator($metadataPool, $collectionFactory, $this->idsLimit); } - /** - * Test retrieve - */ public function testRetrieveProductIdsBySkus() { $skus = ['sku_1', 'sku_2']; - $collection = $this->getMockBuilder(Collection::class) - ->setMethods( - [ - 'getItems', - 'addFieldToFilter', - 'setPageSize', - 'getLastPageNumber', - 'setCurPage', - 'clear' - ] - ) - ->disableOriginalConstructor() - ->getMock(); + $product = $this->getMockBuilder(ProductInterface::class) ->setMethods(['getSku', 'getData', 'getTypeId']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $metaDataInterface = $this->getMockBuilder(EntityMetadataInterface::class) - ->setMethods(['getLinkField']) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); - $collection->expects($this->once())->method('addFieldToFilter') - ->with(ProductInterface::SKU, ['in' => $skus])->willReturnSelf(); - $collection->expects($this->atLeastOnce())->method('getItems')->willReturn([$product]); - $collection->expects($this->atLeastOnce())->method('setPageSize')->willReturnSelf(); - $collection->expects($this->atLeastOnce())->method('getLastPageNumber')->willReturn(1); - $collection->expects($this->atLeastOnce())->method('setCurPage')->with(1)->willReturnSelf(); - $collection->expects($this->atLeastOnce())->method('clear')->willReturnSelf(); - $this->metadataPool - ->expects($this->once()) - ->method('getMetadata') - ->with(ProductInterface::class) - ->willReturn($metaDataInterface); - $metaDataInterface->expects($this->once())->method('getLinkField')->willReturn('entity_id'); - $product->expects($this->once())->method('getSku')->willReturn('sku_1'); - $product->expects($this->once())->method('getData')->with('entity_id')->willReturn(1); - $product->expects($this->once())->method('getTypeId')->willReturn('simple'); + $product->method('getSku') + ->willReturn('sku_1'); + $product->method('getData') + ->with($this->linkField) + ->willReturn(1); + $product->method('getTypeId') + ->willReturn('simple'); + + $this->collection->expects($this->once()) + ->method('addFieldToFilter') + ->with(ProductInterface::SKU, ['in' => $skus]) + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('getItems') + ->willReturn([$product]); + $this->collection->expects($this->atLeastOnce()) + ->method('setPageSize') + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('getLastPageNumber') + ->willReturn(1); + $this->collection->expects($this->atLeastOnce()) + ->method('setCurPage') + ->with(1) + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('clear') + ->willReturnSelf(); + $this->assertEquals( ['sku_1' => [1 => 'simple']], $this->model->retrieveProductIdsBySkus($skus) ); } + + public function testRetrieveProductIdsWithNumericSkus() + { + $skus = ['111', '222', '333', '444', '555']; + $products = []; + foreach ($skus as $sku) { + $product = $this->getMockBuilder(ProductInterface::class) + ->setMethods(['getSku', 'getData', 'getTypeId']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $product->method('getSku') + ->willReturn($sku); + $product->method('getData') + ->with($this->linkField) + ->willReturn((int) $sku); + $product->method('getTypeId') + ->willReturn('simple'); + $products[] = $product; + } + + $this->collection->expects($this->atLeastOnce()) + ->method('addFieldToFilter') + ->withConsecutive([ProductInterface::SKU, ['in' => $skus]], [ProductInterface::SKU, ['in' => ['1']]]) + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('getItems') + ->willReturnOnConsecutiveCalls($products, []); + $this->collection->expects($this->atLeastOnce()) + ->method('setPageSize') + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('getLastPageNumber') + ->willReturn(1); + $this->collection->expects($this->atLeastOnce()) + ->method('setCurPage') + ->with(1) + ->willReturnSelf(); + $this->collection->expects($this->atLeastOnce()) + ->method('clear') + ->willReturnSelf(); + + $this->assertEquals( + [ + '111' => [111 => 'simple'], + '222' => [222 => 'simple'], + '333' => [333 => 'simple'], + '444' => [444 => 'simple'], + '555' => [555 => 'simple'], + ], + $this->model->retrieveProductIdsBySkus($skus) + ); + $this->assertEmpty($this->model->retrieveProductIdsBySkus(['1'])); + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php index 42d0778daa4af..91313d4cd1995 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php @@ -508,28 +508,17 @@ public function testGetStoreIds() /** * @dataProvider getSingleStoreIds * @param bool $isObjectNew + * @return void */ - public function testGetStoreSingleSiteModelIds( - bool $isObjectNew - ) { + public function testGetStoreSingleSiteModelIds(bool $isObjectNew): void + { $websiteIDs = [0 => 2]; - $this->model->setWebsiteIds( - !$isObjectNew ? $websiteIDs : array_flip($websiteIDs) - ); + $this->model->setWebsiteIds(!$isObjectNew ? $websiteIDs : array_flip($websiteIDs)); $this->model->isObjectNew($isObjectNew); - $this->storeManager->expects( - $this->exactly( - (int)!$isObjectNew - ) - ) - ->method('isSingleStoreMode') - ->willReturn(true); - - $this->website->expects( - $this->once() - )->method('getStoreIds') + $this->website->expects($this->once()) + ->method('getStoreIds') ->willReturn($websiteIDs); $this->assertEquals($websiteIDs, $this->model->getStoreIds()); @@ -1095,6 +1084,35 @@ public function testSaveAndDuplicate() $this->model->afterSave(); } + /** + * Test for save method behavior with type options + */ + public function testSaveWithoutTypeOptions() + { + $this->model->setCanSaveCustomOptions(false); + $this->model->setTypeHasOptions(true); + $this->model->setTypeHasRequiredOptions(true); + $this->configureSaveTest(); + $this->model->beforeSave(); + $this->model->afterSave(); + $this->assertTrue($this->model->getTypeHasOptions()); + $this->assertTrue($this->model->getTypeHasRequiredOptions()); + } + + /** + * Test for save method with provided options data + */ + public function testSaveWithProvidedRequiredOptions() + { + $this->model->setData("has_options", "1"); + $this->model->setData("required_options", "1"); + $this->configureSaveTest(); + $this->model->beforeSave(); + $this->model->afterSave(); + $this->assertTrue($this->model->getHasOptions()); + $this->assertTrue($this->model->getRequiredOptions()); + } + public function testGetIsSalableSimple() { $typeInstanceMock = diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/MediaImageDeleteProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/MediaImageDeleteProcessorTest.php new file mode 100644 index 0000000000000..bfc113ce41609 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/MediaImageDeleteProcessorTest.php @@ -0,0 +1,200 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\Model\ResourceModel; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\MediaImageDeleteProcessor; +use Magento\Catalog\Model\Product\Gallery\Processor; +use Magento\Catalog\Model\Product\Media\ConfigInterface as MediaConfig; +use Magento\Catalog\Model\ResourceModel\Product\Gallery; +use Magento\Framework\DataObject; +use Magento\Framework\Exception\FileSystemException; +use Magento\Framework\Filesystem; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Unit test for \Magento\Catalog\Model\ResourceModel\MediaImageDeleteProcessor + */ +class MediaImageDeleteProcessorTest extends TestCase +{ + /** + * Testable Object + * + * @var MediaImageDeleteProcessor + */ + private $mediaImageDeleteProcessor; + + /** + * @var ObjectManager|null + */ + private $objectManager; + + /** + * @var Product|MockObject + */ + private $productMock; + + /** + * @var MediaConfig|MockObject + */ + private $imageConfig; + + /** + * @var Filesystem|MockObject + */ + private $mediaDirectory; + + /** + * @var Processor|MockObject + */ + private $imageProcessor; + + /** + * @var Gallery|MockObject + */ + private $productGallery; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->objectManager = new ObjectManager($this); + + $this->productMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->setMethods(['getId', 'getMediaGalleryImages']) + ->getMock(); + + $this->imageConfig = $this->getMockBuilder(MediaConfig::class) + ->disableOriginalConstructor() + ->setMethods(['getBaseMediaUrl', 'getMediaUrl', 'getBaseMediaPath', 'getMediaPath']) + ->getMock(); + + $this->mediaDirectory = $this->getMockBuilder(Filesystem::class) + ->disableOriginalConstructor() + ->setMethods(['getRelativePath', 'isFile', 'delete']) + ->getMock(); + + $this->imageProcessor = $this->getMockBuilder(Processor::class) + ->disableOriginalConstructor() + ->setMethods(['removeImage']) + ->getMock(); + + $this->productGallery = $this->getMockBuilder(Gallery::class) + ->disableOriginalConstructor() + ->setMethods(['deleteGallery', 'countImageUses']) + ->getMock(); + + $this->mediaImageDeleteProcessor = $this->objectManager->getObject( + MediaImageDeleteProcessor::class, + [ + 'imageConfig' => $this->imageConfig, + 'mediaDirectory' => $this->mediaDirectory, + 'imageProcessor' => $this->imageProcessor, + 'productGallery' => $this->productGallery + ] + ); + } + + /** + * Test mediaImageDeleteProcessor execute method + * + * @dataProvider executeCategoryProductMediaDeleteDataProvider + * @param int $productId + * @param array $productImages + * @param bool $isValidFile + * @param bool $imageUsedBefore + */ + public function testExecuteCategoryProductMediaDelete( + int $productId, + array $productImages, + bool $isValidFile, + bool $imageUsedBefore + ): void { + $this->productMock->expects($this->any()) + ->method('getId') + ->willReturn($productId); + + $this->productMock->expects($this->any()) + ->method('getMediaGalleryImages') + ->willReturn($productImages); + + $this->mediaDirectory->expects($this->any()) + ->method('isFile') + ->willReturn($isValidFile); + + $this->mediaDirectory->expects($this->any()) + ->method('getRelativePath') + ->withConsecutive([$productImages[0]->getFile()], [$productImages[1]->getFile()]) + ->willReturnOnConsecutiveCalls($productImages[0]->getPath(), $productImages[1]->getPath()); + + $this->productGallery->expects($this->any()) + ->method('countImageUses') + ->willReturn($imageUsedBefore); + + $this->productGallery->expects($this->any()) + ->method('deleteGallery') + ->willReturnSelf(); + + $this->imageProcessor->expects($this->any()) + ->method('removeImage') + ->willReturnSelf(); + + $this->mediaImageDeleteProcessor->execute($this->productMock); + } + + /** + * @return array + */ + public function executeCategoryProductMediaDeleteDataProvider(): array + { + $imageDirectoryPath = '/media/dir1/dir2/catalog/product/'; + $image1FilePath = '/test/test1.jpg'; + $image2FilePath = '/test/test2.jpg'; + $productImages = [ + new DataObject([ + 'value_id' => 1, + 'file' => $image1FilePath, + 'media_type' => 'image', + 'path' => $imageDirectoryPath.$image1FilePath + ]), + new DataObject([ + 'value_id' => 2, + 'file' => $image2FilePath, + 'media_type' => 'image', + 'path' => $imageDirectoryPath.$image2FilePath + ]) + ]; + return [ + 'test image can be deleted with existing product and product images' => + [ + 12, + $productImages, + true, + false + ], + 'test image can not be deleted without valid product id' => + [ + 0, + $productImages, + true, + false + ], + 'test image can not be deleted without valid product images' => + [ + 12, + [new DataObject(['file' => null]), new DataObject(['file' => null])], + true, + false + ], + ]; + } +} diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Attribute/AbstractRepository.php b/app/code/Magento/Catalog/Ui/Component/Listing/Attribute/AbstractRepository.php index c7b339d5fac96..b1218c88264c4 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Attribute/AbstractRepository.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Attribute/AbstractRepository.php @@ -11,6 +11,11 @@ */ abstract class AbstractRepository implements RepositoryInterface { + /** + * @var \Magento\Catalog\Api\ProductAttributeRepositoryInterface + */ + private $productAttributeRepository; + /** * @var null|\Magento\Catalog\Api\Data\ProductAttributeInterface[] */ diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php index 1e056d9f8d517..88edfc7b36cb6 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php @@ -23,6 +23,11 @@ class Columns extends \Magento\Ui\Component\Listing\Columns */ protected $attributeRepository; + /** + * @var \Magento\Catalog\Ui\Component\ColumnFactory + */ + private $columnFactory; + /** * @var array */ diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Price.php b/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Price.php index 53347db23f5a1..c35dad5e37bdf 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Price.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Price.php @@ -24,6 +24,11 @@ class Price extends \Magento\Ui\Component\Listing\Columns\Column */ protected $localeCurrency; + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + private $storeManager; + /** * @param ContextInterface $context * @param UiComponentFactory $uiComponentFactory diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail.php b/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail.php index 09c9782fc0e32..0ef5adf7a1888 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail.php @@ -20,6 +20,16 @@ class Thumbnail extends \Magento\Ui\Component\Listing\Columns\Column const ALT_FIELD = 'name'; + /** + * @var \Magento\Catalog\Helper\Image + */ + private $imageHelper; + + /** + * @var \Magento\Framework\UrlInterface + */ + private $urlBuilder; + /** * @param ContextInterface $context * @param UiComponentFactory $uiComponentFactory diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php index 430b6c004e772..6915265b48818 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php @@ -165,7 +165,7 @@ protected function getFieldsForFieldset() $websitesList = $this->getWebsitesList(); $isNewProduct = !$this->locator->getProduct()->getId(); $tooltip = [ - 'link' => 'https://docs.magento.com/m2/ce/user_guide/configuration/scope.html', + 'link' => 'https://docs.magento.com/user-guide/configuration/scope.html', 'description' => __( 'If your Magento installation has multiple websites, ' . 'you can edit the scope to use the product on specific sites.' diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php index 298595b3d0f62..f4334bc25efd8 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php @@ -25,58 +25,4 @@ protected function _productLimitationJoinPrice() $this->_productLimitationFilters->setUsePriceIndex(false); return $this->_productLimitationPrice(true); } - - /** - * Return approximately amount if too much entities. - * - * @return int|mixed - */ - public function getSize() - { - $sql = $this->getSelectCountSql(); - $possibleCount = $this->analyzeCount($sql); - - if ($possibleCount > 20000) { - return $possibleCount; - } - - return parent::getSize(); - } - - /** - * Analyze amount of entities in DB. - * - * @param $sql - * @return int|mixed - * @throws \Zend_Db_Statement_Exception - */ - private function analyzeCount($sql) - { - $results = $this->getConnection()->query('EXPLAIN ' . $sql)->fetchAll(); - $alias = $this->getMainTableAlias(); - - foreach ($results as $result) { - if ($result['table'] == $alias) { - return $result['rows']; - } - } - - return 0; - } - - /** - * Identify main table alias or its name if alias is not defined. - * - * @return string - * @throws \LogicException - */ - private function getMainTableAlias() - { - foreach ($this->getSelect()->getPart(\Magento\Framework\DB\Select::FROM) as $tableAlias => $tableMetadata) { - if ($tableMetadata['joinType'] == 'from') { - return $tableAlias; - } - } - throw new \LogicException("Main table cannot be identified."); - } } diff --git a/app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php b/app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php index 00bac7e61b5b4..f486eed91da5f 100644 --- a/app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php +++ b/app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php @@ -7,10 +7,10 @@ namespace Magento\Catalog\ViewModel\Product\Checker; -use Magento\Framework\View\Element\Block\ArgumentInterface; use Magento\Catalog\Api\Data\ProductInterface; -use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\Framework\View\Element\Block\ArgumentInterface; /** * Check is available add to compare. @@ -39,25 +39,9 @@ public function __construct(StockConfigurationInterface $stockConfiguration) public function isAvailableForCompare(ProductInterface $product): bool { if ((int)$product->getStatus() !== Status::STATUS_DISABLED) { - return $this->isInStock($product) || $this->stockConfiguration->isShowOutOfStock(); + return $product->isSalable() || $this->stockConfiguration->isShowOutOfStock(); } return false; } - - /** - * Get is in stock status. - * - * @param ProductInterface $product - * @return bool - */ - private function isInStock(ProductInterface $product): bool - { - $quantityAndStockStatus = $product->getQuantityAndStockStatus(); - if (!$quantityAndStockStatus) { - return $product->isSalable(); - } - - return $quantityAndStockStatus['is_in_stock'] ?? false; - } } diff --git a/app/code/Magento/Catalog/ViewModel/Product/OptionsData.php b/app/code/Magento/Catalog/ViewModel/Product/OptionsData.php new file mode 100644 index 0000000000000..a4b77ca89ee7a --- /dev/null +++ b/app/code/Magento/Catalog/ViewModel/Product/OptionsData.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\ViewModel\Product; + +use Magento\Framework\View\Element\Block\ArgumentInterface; +use Magento\Catalog\Model\Product; + +/** + * Product options data view model + */ +class OptionsData implements ArgumentInterface +{ + /** + * Returns options data array + * + * @param Product $product + * @return array + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getOptionsData(Product $product) : array + { + return []; + } +} diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index 7d74ab38a8560..8e17c61c3926a 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -282,4 +282,12 @@ </argument> </arguments> </type> + <type name="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Advanced"> + <arguments> + <argument name="disableScopeChangeList" xsi:type="array"> + <item name="sku" xsi:type="string">sku</item> + <item name="media_gallery" xsi:type="string">media_gallery</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Catalog/etc/adminhtml/system.xml b/app/code/Magento/Catalog/etc/adminhtml/system.xml index 4e10453f542bb..a1b2202309d62 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/system.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/system.xml @@ -218,7 +218,7 @@ <field id="catalog_media_url_format" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1"> <label>Catalog media URL format</label> <source_model>Magento\Catalog\Model\Config\Source\Web\CatalogMediaUrlFormat</source_model> - <comment><![CDATA[Images should be optimized based on query parameters by your CDN or web server. Use the legacy mode for backward compatibility. <a href="https://docs.magento.com/m2/ee/user_guide/configuration/general/web.html#url-options">Learn more</a> about catalog URL formats.<br/><br/><strong style="color:red">Warning!</strong> If you switch back to legacy mode, you must <a href="https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-images.html#resize-catalog-images">use the CLI to regenerate images</a>.]]></comment> + <comment><![CDATA[Images should be optimized based on query parameters by your CDN or web server. Use the legacy mode for backward compatibility. <a href="https://docs.magento.com/user-guide/configuration/general/web.html#url-options">Learn more</a> about catalog URL formats.<br/><br/><strong style="color:red">Warning!</strong> If you switch back to legacy mode, you must <a href="https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-images.html#resize-catalog-images">use the CLI to regenerate images</a>.]]></comment> </field> </group> </section> diff --git a/app/code/Magento/Catalog/etc/db_schema.xml b/app/code/Magento/Catalog/etc/db_schema.xml index ce34914a2f5d4..f6a1dbe5e41a1 100644 --- a/app/code/Magento/Catalog/etc/db_schema.xml +++ b/app/code/Magento/Catalog/etc/db_schema.xml @@ -13,7 +13,7 @@ <column xsi:type="smallint" name="attribute_set_id" unsigned="true" nullable="false" identity="false" default="0" comment="Attribute Set ID"/> <column xsi:type="varchar" name="type_id" nullable="false" length="32" default="simple" comment="Type ID"/> - <column xsi:type="varchar" name="sku" nullable="true" length="64" comment="SKU"/> + <column xsi:type="varchar" name="sku" nullable="false" length="64" comment="SKU"/> <column xsi:type="smallint" name="has_options" unsigned="false" nullable="false" identity="false" default="0" comment="Has Options"/> <column xsi:type="smallint" name="required_options" unsigned="true" nullable="false" @@ -1693,7 +1693,7 @@ <constraint xsi:type="foreign" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID" table="catalog_product_entity_media_gallery_value_to_entity" column="entity_id" referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/> - <constraint xsi:type="unique" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID"> + <constraint xsi:type="primary" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID"> <column name="value_id"/> <column name="entity_id"/> </constraint> diff --git a/app/code/Magento/Catalog/etc/db_schema_whitelist.json b/app/code/Magento/Catalog/etc/db_schema_whitelist.json index efc45112920e2..fd332606bb220 100644 --- a/app/code/Magento/Catalog/etc/db_schema_whitelist.json +++ b/app/code/Magento/Catalog/etc/db_schema_whitelist.json @@ -1020,6 +1020,7 @@ "entity_id": true }, "constraint": { + "PRIMARY": true, "FK_A6C6C8FAA386736921D3A7C4B50B1185": true, "CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID": true, "CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID": true diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml index 8a116282e2578..b509debe7bae1 100644 --- a/app/code/Magento/Catalog/etc/di.xml +++ b/app/code/Magento/Catalog/etc/di.xml @@ -1319,4 +1319,13 @@ </argument> </arguments> </type> + <type name="Magento\Catalog\Model\Product\Configuration\Item\ItemResolverComposite"> + <arguments> + <argument name="itemResolvers" xsi:type="array"/> + </arguments> + </type> + <type name="Magento\Catalog\Api\ProductRepositoryInterface"> + <plugin name="remove_images_from_gallery_after_removing_product" + type="Magento\Catalog\Plugin\RemoveImagesFromGalleryAfterRemovingProduct"/> + </type> </config> diff --git a/app/code/Magento/Catalog/etc/webapi_rest/di.xml b/app/code/Magento/Catalog/etc/webapi_rest/di.xml index 1fd47fde304ec..a33c3a19e1e4f 100644 --- a/app/code/Magento/Catalog/etc/webapi_rest/di.xml +++ b/app/code/Magento/Catalog/etc/webapi_rest/di.xml @@ -40,4 +40,8 @@ <argument name="deserializer" xsi:type="object">Magento\Catalog\Model\Product\Webapi\Rest\RequestTypeBasedDeserializer</argument> </arguments> </type> + <type name="Magento\Catalog\Api\ProductLinkRepositoryInterface"> + <plugin name="reindex_after_save_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterSaveProductLinksPlugin"/> + <plugin name="reindex_after_delete_by_id_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterDeleteByIdProductLinksPlugin"/> + </type> </config> diff --git a/app/code/Magento/Catalog/etc/webapi_soap/di.xml b/app/code/Magento/Catalog/etc/webapi_soap/di.xml index a709f23d8c12b..03671ba0bb2e0 100644 --- a/app/code/Magento/Catalog/etc/webapi_soap/di.xml +++ b/app/code/Magento/Catalog/etc/webapi_soap/di.xml @@ -40,4 +40,8 @@ <argument name="deserializer" xsi:type="object">Magento\Framework\Webapi\Rest\Request\Deserializer\Xml</argument> </arguments> </type> + <type name="Magento\Catalog\Api\ProductLinkRepositoryInterface"> + <plugin name="reindex_after_save_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterSaveProductLinksPlugin"/> + <plugin name="reindex_after_delete_by_id_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterDeleteByIdProductLinksPlugin"/> + </type> </config> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml index e5f8a360c334c..7ae3a2ade6557 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Eav\Block\Adminhtml\Attribute\Edit\Options\Options */ $stores = $block->getStoresSortedBySortOrder(); diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/attribute_set.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/attribute_set.phtml index 261de795f7199..e4f3dba6f984d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/attribute_set.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/attribute_set.phtml @@ -5,6 +5,7 @@ */ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /* @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\AttributeSet */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/option.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/option.phtml index ce7dac70010b1..6848e6f269bc0 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/option.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/option.phtml @@ -5,6 +5,7 @@ */ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Option */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/date.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/date.phtml index 2063609bf0568..748f7d229dbbb 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/date.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/date.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <?php /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\Date */ ?> <script id="custom-option-date-type-template" type="text/x-magento-template"> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml index c0e61c5de9988..92178052f0a97 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml @@ -4,8 +4,9 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound +/** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\File */ ?> -<?php /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\File */ ?> <script id="custom-option-file-type-template" type="text/x-magento-template"> <div id="product_option_<%- data.option_id %>_type_<%- data.group %>" class="fieldset"> <table class="data-table"> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml index c7ff03a08d954..fa648ead21a66 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/select.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <?php /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\Select */ ?> <script id="custom-option-select-type-template" type="text/x-magento-template"> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/text.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/text.phtml index 89da5d633ef4d..280bdb6a93c97 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/text.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/text.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <?php /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Type\Text */ ?> <script id="custom-option-text-type-template" type="text/x-magento-template"> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/serializer.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/serializer.phtml index 0c1da98c7d85a..acd14f591e21d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/serializer.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/serializer.phtml @@ -8,7 +8,11 @@ ?> // phpcs:disable Magento2.Security.InsecureFunction.DiscouragedWithAlternative -<?php $_id = 'id_' . md5(microtime()) ?> +<?php +// md5() here is not for cryptographic use. +// phpcs:ignore Magento2.Security.InsecureFunction +$_id = 'id_' . md5(microtime()) +?> <input type="hidden" name="<?= $block->escapeHtmlAttr($block->getInputElementName()) ?>" value="" diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/helper/gallery.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/helper/gallery.phtml index 94d71dbb5ab28..12cbcd7031e98 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/helper/gallery.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/helper/gallery.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery\Content */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ $elementName = $block->getElement()->getName() . '[images]'; diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/product/edit/attribute/search.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/product/edit/attribute/search.phtml index f58e213b60772..bd6a846b49ba7 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/product/edit/attribute/search.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/product/edit/attribute/search.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes\Search */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml index 88bb578712056..2cd2a15b04900 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml @@ -132,7 +132,7 @@ <settings> <addField>true</addField> <filter>text</filter> - <bodyTmpl>ui/grid/cells/html</bodyTmpl> + <bodyTmpl>Magento_Catalog/grid/cells/preserved</bodyTmpl> <label translate="true">Name</label> </settings> </column> @@ -155,7 +155,7 @@ <column name="sku" sortOrder="60"> <settings> <filter>text</filter> - <bodyTmpl>ui/grid/cells/html</bodyTmpl> + <bodyTmpl>Magento_Catalog/grid/cells/preserved</bodyTmpl> <label translate="true">SKU</label> </settings> </column> diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js index 4040ff9d684f4..9ec3c0a640006 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js @@ -47,10 +47,14 @@ define([ * Initialize object */ initialize: function () { - var self = this; + var self = this, + popupDialog = jQuery('#product_composite_configure'); this._initWindowElements(); jQuery.async('#product_composite_configure', function (el) { + if (el !== popupDialog[0]) { + el = popupDialog[0]; + } self.dialog = jQuery(el).modal({ title: jQuery.mage.__('Configure Product'), type: 'slide', @@ -60,7 +64,10 @@ define([ click: function () { self.onConfirmBtn(); } - }] + }], + closed: function () { + self.clean('window'); + }, }); }); }, @@ -402,6 +409,7 @@ define([ this.blockMsgError.innerHTML = response.message; this._showWindow(); + jQuery(this.blockForm).trigger('processStop'); return false; } } @@ -444,6 +452,13 @@ define([ } }, + /** + * Helper to find select element of currently confirmed item + */ + getCurrentConfirmedSelectElement: function () { + return $(this.confirmedCurrentId).getElementsByTagName('select'); + }, + /** * Helper to find qty of active form */ diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/grid/cells/preserved.html b/app/code/Magento/Catalog/view/adminhtml/web/template/grid/cells/preserved.html new file mode 100644 index 0000000000000..936342df23795 --- /dev/null +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/grid/cells/preserved.html @@ -0,0 +1,7 @@ +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<div class="data-grid-cell-content white-space-preserved" html="$col.getLabel($row())"/> diff --git a/app/code/Magento/Catalog/view/base/web/js/product/addtocart-button.js b/app/code/Magento/Catalog/view/base/web/js/product/addtocart-button.js index 4baf082b37c02..f599d05ba5ea9 100644 --- a/app/code/Magento/Catalog/view/base/web/js/product/addtocart-button.js +++ b/app/code/Magento/Catalog/view/base/web/js/product/addtocart-button.js @@ -55,6 +55,16 @@ define([ return row['is_salable']; }, + /** + * Depends on this option, stock status text can be "In stock" or "Out Of Stock" + * + * @param {Object} row + * @returns {Boolean} + */ + isAvailable: function (row) { + return row['is_available']; + }, + /** * Depends on this option, "Add to cart" button can be shown or hide. Depends on backend configuration * diff --git a/app/code/Magento/Catalog/view/base/web/js/product/name.js b/app/code/Magento/Catalog/view/base/web/js/product/name.js index d83d58f94edfa..dad84ea52d708 100644 --- a/app/code/Magento/Catalog/view/base/web/js/product/name.js +++ b/app/code/Magento/Catalog/view/base/web/js/product/name.js @@ -5,11 +5,16 @@ define([ 'Magento_Ui/js/grid/columns/column', - 'Magento_Catalog/js/product/list/column-status-validator' -], function (Column, columnStatusValidator) { + 'Magento_Catalog/js/product/list/column-status-validator', + 'escaper' +], function (Column, columnStatusValidator, escaper) { 'use strict'; return Column.extend({ + defaults: { + allowedTags: ['div', 'span', 'b', 'strong', 'i', 'em', 'u', 'a'] + }, + /** * Depends on this option, product name can be shown or hide. Depends on backend configuration * @@ -17,6 +22,16 @@ define([ */ isAllowed: function () { return columnStatusValidator.isValid(this.source(), 'name', 'show_attributes'); + }, + + /** + * Name column. + * + * @param {String} label + * @returns {String} + */ + getNameUnsanitizedHtml: function (label) { + return escaper.escapeHtml(label, this.allowedTags); } }); }); diff --git a/app/code/Magento/Catalog/view/base/web/template/product/name.html b/app/code/Magento/Catalog/view/base/web/template/product/name.html index d0e1cf0fb4e48..9f8bb42f2a27e 100644 --- a/app/code/Magento/Catalog/view/base/web/template/product/name.html +++ b/app/code/Magento/Catalog/view/base/web/template/product/name.html @@ -6,5 +6,5 @@ --> <strong if="isAllowed()" class="product-item-name"> - <a attr="href: $row().url" html="$col.getLabel($row())"/> + <a attr="href: $row().url" html="getNameUnsanitizedHtml($col.getLabel($row()))"/> </strong> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml index c4adcaf785012..5e7b7ba867c13 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml @@ -54,5 +54,10 @@ </arguments> <block class="Magento\Catalog\Block\Category\Rss\Link" name="rss.link" template="Magento_Catalog::category/rss.phtml"/> </referenceBlock> + <referenceBlock name="category.products.list"> + <arguments> + <argument name="viewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\OptionsData</argument> + </arguments> + </referenceBlock> </body> </page> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml index 0bea3ca03dee8..b7d6e1f2079a0 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml @@ -73,12 +73,12 @@ action="<?= $block->escapeUrl($this->helper(Magento\Catalog\Helper\Product\Compare::class)->getAddToCartUrl($item)) ?>" method="post"> <?= $block->getBlockHtml('formkey') ?> - <button type="submit" class="action tocart primary"> + <button type="submit" class="action tocart primary" disabled> <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> </button> </form> <?php else :?> - <?php if ($item->getIsSalable()) :?> + <?php if ($item->isAvailable()) :?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else :?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> @@ -144,15 +144,13 @@ </tbody> </table> </div> - <?php if (!$block->isRedirectToCartEnabled()) :?> - <script type="text/x-magento-init"> - { - "[data-role=tocart-form]": { - "catalogAddToCart": {} - } + <script type="text/x-magento-init"> + { + "[data-role=tocart-form]": { + "catalogAddToCart": {} } - </script> - <?php endif; ?> + } + </script> <?php else :?> <div class="message info empty"><div><?= $block->escapeHtml(__('You have no items to compare.')) ?></div></div> <?php endif; ?> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml index 6a47978f1e5c6..afd804591fec1 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml @@ -87,6 +87,12 @@ $_helper = $block->getData('outputHelper'); data-product-sku="<?= $escaper->escapeHtml($_product->getSku()) ?>" action="<?= $escaper->escapeUrl($postParams['action']) ?>" method="post"> + <?php $optionsData = $block->getData('viewModel')->getOptionsData($_product); ?> + <?php foreach ($optionsData as $optionItem): ?> + <input type="hidden" + name="<?= $escaper->escapeHtml($optionItem['name']) ?>" + value="<?= $escaper->escapeHtml($optionItem['value']) ?>"> + <?php endforeach; ?> <input type="hidden" name="product" value="<?= /* @noEscape */ $postParams['data']['product'] ?>"> @@ -153,16 +159,14 @@ $_helper = $block->getData('outputHelper'); <?php endforeach; ?> </ol> </div> - <?= $block->getToolbarHtml() ?> - <?php if (!$block->isRedirectToCartEnabled()): ?> - <script type="text/x-magento-init"> - { - "[data-role=tocart-form], .form.map.checkout": { - "catalogAddToCart": { - "product_sku": "<?= $escaper->escapeJs($_product->getSku()) ?>" - } + <?= $block->getChildBlock('toolbar')->setIsBottom(true)->toHtml() ?> + <script type="text/x-magento-init"> + { + "[data-role=tocart-form], .form.map.checkout": { + "catalogAddToCart": { + "product_sku": "<?= $escaper->escapeJs($_product->getSku()) ?>" } } - </script> - <?php endif; ?> + } + </script> <?php endif; ?> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index e426b940deab7..6fd619de7fd6c 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -287,7 +287,7 @@ $_item = null; </form> <?php endif; ?> <?php else:?> - <?php if ($_item->getIsSalable()):?> + <?php if ($_item->isAvailable()):?> <div class="stock available"> <span><?= $block->escapeHtml(__('In stock')) ?></span> </div> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar.phtml index 76ef6baf4993e..3c8687d090baf 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar.phtml @@ -10,27 +10,23 @@ * * @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar */ - -// phpcs:disable Magento2.Security.IncludeFile.FoundIncludeFile -// phpcs:disable PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket ?> <?php if ($block->getCollection()->getSize()) :?> <?php $widget = $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonDecode($block->getWidgetOptionsJson()); $widgetOptions = $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($widget['productListToolbarForm']); ?> <div class="toolbar toolbar-products" data-mage-init='{"productListToolbarForm":<?= /* @noEscape */ $widgetOptions ?>}'> - <?php if ($block->isExpanded()) :?> - <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/viewmode.phtml')) ?> - <?php endif; ?> - - <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/amount.phtml')) ?> - - <?= $block->getPagerHtml() ?> - - <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/limiter.phtml')) ?> - - <?php if ($block->isExpanded()) :?> - <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/sorter.phtml')) ?> - <?php endif; ?> + <?php if ($block->getIsBottom()): ?> + <?= $block->getPagerHtml() ?> + <?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/limiter.phtml')) ?> + <?php else: ?> + <?php if ($block->isExpanded()): ?> + <?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/viewmode.phtml')) ?> + <?php endif ?> + <?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/amount.phtml')) ?> + <?php if ($block->isExpanded()): ?> + <?= $block->fetchView($block->getTemplateFile('Magento_Catalog::product/list/toolbar/sorter.phtml')) ?> + <?php endif ?> + <?php endif ?> </div> <?php endif ?> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml index 6cebd51284f48..49dd702a6e39c 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml @@ -63,7 +63,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class); . ' data-mage-init=\'{ "redirectUrl": { "event": "click", url: "' . $block->escapeUrl($block->getAddToCartUrl($_product)) . '"} }\'>' . '<span>' . $block->escapeHtml(__('Add to Cart')) . '</span></button>'; } else { - $info['button'] = $_product->getIsSalable() ? '<div class="stock available"><span>' . $block->escapeHtml(__('In stock')) . '</span></div>' : + $info['button'] = $_product->isAvailable() ? '<div class="stock available"><span>' . $block->escapeHtml(__('In stock')) . '</span></div>' : '<div class="stock unavailable"><span>' . $block->escapeHtml(__('Out of stock')) . '</span></div>'; } diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/file.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/file.phtml index f5fd1c5aa64e1..4385829a5bdc1 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/file.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/file.phtml @@ -51,7 +51,7 @@ id="<?= /* @noEscape */ $_fileName ?>" class="product-custom-option<?= $_option->getIsRequire() ? ' required' : '' ?>" <?= $_fileExists ? 'disabled="disabled"' : '' ?> /> - <input type="hidden" name="<?= /* @noEscape */ $_fieldNameAction ?>" + <input type="hidden" class="product-custom-option" name="<?= /* @noEscape */ $_fieldNameAction ?>" value="<?= /* @noEscape */ $_fieldValueAction ?>" /> <?php if ($_option->getFileExtension()):?> <p class="note"> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/column/new_default_list.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/column/new_default_list.phtml index 53a0682311b1f..fce91564c96a2 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/column/new_default_list.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/column/new_default_list.phtml @@ -52,7 +52,7 @@ </button> <?php endif; ?> <?php else :?> - <?php if ($_product->getIsSalable()) :?> + <?php if ($_product->isAvailable()) :?> <div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>"> <span><?= $block->escapeHtml(__('In stock')) ?></span> </div> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml index 5108c488aec19..66683ef328e08 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml @@ -89,7 +89,7 @@ if ($exist = ($block->getProductCollection() && $block->getProductCollection()-> </button> <?php endif; ?> <?php else :?> - <?php if ($_item->getIsSalable()) :?> + <?php if ($_item->isAvailable()) :?> <div class="stock available"> <span><?= $block->escapeHtml(__('In stock')) ?></span> </div> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_list.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_list.phtml index 378cd49493a6e..ceb32e78c7e44 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_list.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/widget/new/content/new_list.phtml @@ -88,7 +88,7 @@ if ($exist = ($block->getProductCollection() && $block->getProductCollection()-> </button> <?php endif; ?> <?php else :?> - <?php if ($_item->getIsSalable()) :?> + <?php if ($_item->isAvailable()) :?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else :?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Catalog/view/frontend/web/template/product/addtocart-button.html b/app/code/Magento/Catalog/view/frontend/web/template/product/addtocart-button.html index 05dbf02703285..867b5f40d98db 100644 --- a/app/code/Magento/Catalog/view/frontend/web/template/product/addtocart-button.html +++ b/app/code/Magento/Catalog/view/frontend/web/template/product/addtocart-button.html @@ -15,10 +15,10 @@ </button> </if> - <ifnot args="isSalable($row())"> + <if args="isAvailable($row()) === false"> <div class="stock unavailable"> <text args="$t('Availability')"/> <span translate="'Out of stock'"/> </div> - </ifnot> + </if> </if> diff --git a/app/code/Magento/CatalogAnalytics/README.md b/app/code/Magento/CatalogAnalytics/README.md index 0c4ee155c4f27..bfea74e7ddd88 100644 --- a/app/code/Magento/CatalogAnalytics/README.md +++ b/app/code/Magento/CatalogAnalytics/README.md @@ -1,3 +1,3 @@ # Magento_CatalogAnalytics module -The Magento_CatalogAnalytics module configures data definitions for a data collection related to the Catalog module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). +The Magento_CatalogAnalytics module configures data definitions for a data collection related to the Catalog module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). diff --git a/app/code/Magento/CatalogCustomerGraphQl/Model/Resolver/PriceTiers.php b/app/code/Magento/CatalogCustomerGraphQl/Model/Resolver/PriceTiers.php index efba88ff154bb..3c6cc849081ee 100644 --- a/app/code/Magento/CatalogCustomerGraphQl/Model/Resolver/PriceTiers.php +++ b/app/code/Magento/CatalogCustomerGraphQl/Model/Resolver/PriceTiers.php @@ -19,7 +19,6 @@ use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Framework\Pricing\PriceCurrencyInterface; -use Magento\Store\Api\Data\StoreInterface; /** * Resolver for price_tiers @@ -125,6 +124,10 @@ public function resolve( return []; } + if (!$product->getTierPrices()) { + return []; + } + $productId = (int)$product->getId(); $this->tiers->addProductFilter($productId); @@ -152,7 +155,8 @@ private function formatAndFilterTierPrices( array $tierPrices, string $currencyCode ): array { - + $this->formatAndFilterTierPrices = []; + $this->tierPricesQty = []; foreach ($tierPrices as $key => $tierPrice) { $tierPrice->setValue($this->priceCurrency->convertAndRound($tierPrice->getValue())); $this->formatTierPrices($productPrice, $currencyCode, $tierPrice); diff --git a/app/code/Magento/CatalogCustomerGraphQl/composer.json b/app/code/Magento/CatalogCustomerGraphQl/composer.json index a7c887af0379b..ce80ee602327e 100644 --- a/app/code/Magento/CatalogCustomerGraphQl/composer.json +++ b/app/code/Magento/CatalogCustomerGraphQl/composer.json @@ -7,8 +7,7 @@ "magento/framework": "*", "magento/module-catalog": "*", "magento/module-customer": "*", - "magento/module-catalog-graph-ql": "*", - "magento/module-store": "*" + "magento/module-catalog-graph-ql": "*" }, "license": [ "OSL-3.0", diff --git a/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/AttributeOptionProvider.php b/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/AttributeOptionProvider.php index d46776bfe498e..4501915682178 100644 --- a/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/AttributeOptionProvider.php +++ b/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/AttributeOptionProvider.php @@ -8,6 +8,7 @@ namespace Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation; use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Select; use Magento\Store\Model\Store; /** @@ -95,6 +96,8 @@ public function getOptions(array $optionIds, ?int $storeId, array $attributeCode )->where( 'a.attribute_id = options.attribute_id AND option_value.store_id = ?', Store::DEFAULT_STORE_ID + )->order( + 'options.sort_order ' . Select::SQL_ASC ); $select->where('option_value.option_id IN (?)', $optionIds); @@ -112,11 +115,11 @@ public function getOptions(array $optionIds, ?int $storeId, array $attributeCode /** * Format result * - * @param \Magento\Framework\DB\Select $select + * @param Select $select * @return array * @throws \Zend_Db_Statement_Exception */ - private function formatResult(\Magento\Framework\DB\Select $select): array + private function formatResult(Select $select): array { $statement = $this->resourceConnection->getConnection()->query($select); @@ -131,7 +134,9 @@ private function formatResult(\Magento\Framework\DB\Select $select): array 'options' => [], ]; } - $result[$option['attribute_code']]['options'][$option['option_id']] = $option['option_label']; + if (!empty($option['option_id'])) { + $result[$option['attribute_code']]['options'][$option['option_id']] = $option['option_label']; + } } return $result; diff --git a/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Builder/Attribute.php b/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Builder/Attribute.php index 5fce0fcdf3ca2..1d27a3afd7dbf 100644 --- a/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Builder/Attribute.php +++ b/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/Builder/Attribute.php @@ -86,12 +86,12 @@ public function build(AggregationInterface $aggregation, ?int $storeId): array $attribute['attribute_code'] ?? $bucketName ); - foreach ($bucket->getValues() as $value) { - $metrics = $value->getMetrics(); + $options = $this->getSortedOptions($bucket,$attribute['options'] ?: []); + foreach ($options as $option) { $result[$bucketName]['options'][] = $this->layerFormatter->buildItem( - $attribute['options'][$metrics['value']] ?? $metrics['value'], - $metrics['value'], - $metrics['count'] + $option['label'], + $option['value'], + $option['count'] ); } } @@ -161,4 +161,36 @@ function (AggregationValueInterface $value) { $attributes ); } + + /** + * Get sorted options + * + * @param BucketInterface $bucket + * @param array $optionLabels + * @return array + */ + private function getSortedOptions(BucketInterface $bucket, array $optionLabels): array + { + /** + * Option labels array has been sorted + */ + $options = $optionLabels; + foreach ($bucket->getValues() as $value) { + $metrics = $value->getMetrics(); + $optionValue = $metrics['value']; + $optionLabel = $optionLabels[$optionValue] ?? $optionValue; + $options[$optionValue] = $metrics + ['label' => $optionLabel]; + } + + /** + * Delete options without bucket values + */ + foreach ($options as $optionId => $option) { + if (!is_array($options[$optionId])) { + unset($options[$optionId]); + } + } + + return array_values($options); + } } diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php b/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php index ab100c7272ba0..356ff17183a57 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php +++ b/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php @@ -7,6 +7,7 @@ namespace Magento\CatalogGraphQl\Model\Category; +use GraphQL\Language\AST\Node; use GraphQL\Language\AST\FieldNode; use GraphQL\Language\AST\InlineFragmentNode; use GraphQL\Language\AST\NodeKind; @@ -26,22 +27,35 @@ class DepthCalculator */ public function calculate(ResolveInfo $resolveInfo, FieldNode $fieldNode) : int { - $selections = $fieldNode->selectionSet->selections ?? []; + return $this->calculateRecursive($resolveInfo, $fieldNode); + } + + /** + * Calculate recursive the total depth of a category tree inside a GraphQL request + * + * @param ResolveInfo $resolveInfo + * @param Node $node + * @return int + */ + private function calculateRecursive(ResolveInfo $resolveInfo, Node $node) : int + { + if ($node->kind === NodeKind::FRAGMENT_SPREAD) { + $selections = isset($resolveInfo->fragments[$node->name->value]) ? + $resolveInfo->fragments[$node->name->value]->selectionSet->selections : []; + } else { + $selections = $node->selectionSet->selections ?? []; + } $depth = count($selections) ? 1 : 0; $childrenDepth = [0]; - foreach ($selections as $node) { - if (isset($node->alias) && null !== $node->alias) { + foreach ($selections as $subNode) { + if (isset($subNode->alias) && null !== $subNode->alias) { continue; } - if ($node->kind === NodeKind::INLINE_FRAGMENT) { - $childrenDepth[] = $this->addInlineFragmentDepth($resolveInfo, $node); - } elseif ($node->kind === NodeKind::FRAGMENT_SPREAD && isset($resolveInfo->fragments[$node->name->value])) { - foreach ($resolveInfo->fragments[$node->name->value]->selectionSet->selections as $spreadNode) { - $childrenDepth[] = $this->calculate($resolveInfo, $spreadNode); - } + if ($subNode->kind === NodeKind::INLINE_FRAGMENT) { + $childrenDepth[] = $this->addInlineFragmentDepth($resolveInfo, $subNode); } else { - $childrenDepth[] = $this->calculate($resolveInfo, $node); + $childrenDepth[] = $this->calculateRecursive($resolveInfo, $subNode); } } diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/ParentCategoryUidsArgsProcessor.php b/app/code/Magento/CatalogGraphQl/Model/Category/ParentCategoryUidsArgsProcessor.php new file mode 100644 index 0000000000000..700b95d79990a --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/Category/ParentCategoryUidsArgsProcessor.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model\Category; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Uid; +use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface; + +/** + * Parent Category UID processor class for category uid and category id arguments + */ +class ParentCategoryUidsArgsProcessor implements ArgumentsProcessorInterface +{ + private const ID = 'parent_id'; + + private const UID = 'parent_category_uid'; + + /** @var Uid */ + private $uidEncoder; + + /** + * @param Uid $uidEncoder + */ + public function __construct(Uid $uidEncoder) + { + $this->uidEncoder = $uidEncoder; + } + + /** + * Composite processor that loops through available processors for arguments that come from graphql input + * + * @param string $fieldName, + * @param array $args + * @return array + * @throws GraphQlInputException + */ + public function process( + string $fieldName, + array $args + ): array { + $filterKey = 'filters'; + $parentUidFilter = $args[$filterKey][self::UID] ?? []; + $parentIdFilter = $args[$filterKey][self::ID] ?? []; + if (!empty($parentIdFilter) + && !empty($parentUidFilter) + && ($fieldName === 'categories' || $fieldName === 'categoryList')) { + throw new GraphQlInputException( + __('`%1` and `%2` can\'t be used at the same time.', [self::ID, self::UID]) + ); + } elseif (!empty($parentUidFilter)) { + if (isset($parentUidFilter['eq'])) { + $args[$filterKey][self::ID]['eq'] = $this->uidEncoder->decode( + $parentUidFilter['eq'] + ); + } elseif (!empty($parentUidFilter['in'])) { + foreach ($parentUidFilter['in'] as $parentUids) { + $args[$filterKey][self::ID]['in'][] = $this->uidEncoder->decode($parentUids); + } + } + unset($args[$filterKey][self::UID]); + } + return $args; + } +} diff --git a/app/code/Magento/CatalogGraphQl/Model/CategoryTypeResolver.php b/app/code/Magento/CatalogGraphQl/Model/CategoryTypeResolver.php new file mode 100755 index 0000000000000..d4b7c644fe828 --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/CategoryTypeResolver.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model; + +use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; + +/** + * @inheritdoc + */ +class CategoryTypeResolver implements TypeResolverInterface +{ + const CATEGORY = 'CATEGORY'; + const TYPE_RESOLVER = 'CategoryTree'; + + /** + * @inheritdoc + */ + public function resolveType(array $data) : string + { + if (isset($data['type_id']) && $data['type_id'] == self::CATEGORY) { + return self::TYPE_RESOLVER; + } + return ''; + } +} diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php index 0e653995ebcab..86715623eb9fb 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoriesQuery.php @@ -85,8 +85,9 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value throw new GraphQlInputException(__($e->getMessage())); } - $rootCategoryIds = $filterResult['category_ids']; - $filterResult['items'] = $this->fetchCategories($rootCategoryIds, $info); + $rootCategoryIds = $filterResult['category_ids'] ?? []; + + $filterResult['items'] = $this->fetchCategories($rootCategoryIds, $info, (int) $store->getId()); return $filterResult; } @@ -95,13 +96,14 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value * * @param array $categoryIds * @param ResolveInfo $info + * @param int $storeId * @return array */ - private function fetchCategories(array $categoryIds, ResolveInfo $info) + private function fetchCategories(array $categoryIds, ResolveInfo $info, int $storeId) { $fetchedCategories = []; foreach ($categoryIds as $categoryId) { - $categoryTree = $this->categoryTree->getTree($info, $categoryId); + $categoryTree = $this->categoryTree->getTree($info, $categoryId, $storeId); if (empty($categoryTree)) { continue; } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php index 747e05806a821..ee0ec69aaea74 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryList.php @@ -81,8 +81,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } catch (InputException $e) { throw new GraphQlInputException(__($e->getMessage())); } - - return $this->fetchCategories($rootCategoryIds, $info); + return $this->fetchCategories($rootCategoryIds, $info, (int) $store->getId()); } /** @@ -90,13 +89,14 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value * * @param array $categoryIds * @param ResolveInfo $info + * @param int $storeId * @return array */ - private function fetchCategories(array $categoryIds, ResolveInfo $info) + private function fetchCategories(array $categoryIds, ResolveInfo $info, int $storeId) { $fetchedCategories = []; foreach ($categoryIds as $categoryId) { - $categoryTree = $this->categoryTree->getTree($info, $categoryId); + $categoryTree = $this->categoryTree->getTree($info, $categoryId, $storeId); if (empty($categoryTree)) { continue; } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryTree.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryTree.php index 4284aed610848..cddba2e91f701 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryTree.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/CategoryTree.php @@ -71,7 +71,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value if ($rootCategoryId !== Category::TREE_ROOT_ID) { $this->checkCategoryIsActive->execute($rootCategoryId); } - $categoriesTree = $this->categoryTree->getTree($info, $rootCategoryId); + $store = $context->getExtensionAttributes()->getStore(); + $categoriesTree = $this->categoryTree->getTree($info, $rootCategoryId, (int)$store->getId()); if (empty($categoriesTree) || ($categoriesTree->count() == 0)) { throw new GraphQlNoSuchEntityException(__('Category doesn\'t exist')); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/CustomizableDateTypeOptionValue.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/CustomizableDateTypeOptionValue.php new file mode 100644 index 0000000000000..1b9583cc7239e --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/CustomizableDateTypeOptionValue.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model\Resolver\Product; + +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; + +/** + * Format the option type value. + */ +class CustomizableDateTypeOptionValue implements ResolverInterface +{ + /** + * Resolver option code. + */ + private const OPTION_CODE = 'type'; + + /** + * Resolver enum type options to up case format. + * + * @param Field $field + * @param ContextInterface $context + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args + * + * @return string + */ + public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null): string + { + $dteType = $value[self::OPTION_CODE] ?? ''; + + return strtoupper($dteType); + } +} diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php index c553d4486f9e9..86ee717d1ba39 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php @@ -80,9 +80,11 @@ public function __construct( * * @param ResolveInfo $resolveInfo * @param int $rootCategoryId + * @param int $storeId * @return \Iterator + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function getTree(ResolveInfo $resolveInfo, int $rootCategoryId): \Iterator + public function getTree(ResolveInfo $resolveInfo, int $rootCategoryId, int $storeId): \Iterator { $categoryQuery = $resolveInfo->fieldNodes[0]; $collection = $this->collectionFactory->create(); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ExtractDataFromCategoryTree.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ExtractDataFromCategoryTree.php index b38a2c9bb04d9..e212f33a35d29 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ExtractDataFromCategoryTree.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ExtractDataFromCategoryTree.php @@ -67,7 +67,8 @@ public function execute(\Iterator $iterator): array $tree = $this->mergeCategoriesTrees($currentLevelTree, $tree); } } - return $tree; + + return $this->sortTree($tree); } /** @@ -141,4 +142,24 @@ private function explodePathToArray(array $pathElements, int $index): array } return $tree; } + + /** + * Recursive method to sort tree + * + * @param array $tree + * @return array + */ + private function sortTree(array $tree): array + { + foreach ($tree as &$node) { + if ($node['children']) { + uasort($node['children'], function ($element1, $element2) { + return $element1['position'] > $element2['position']; + }); + $node['children'] = $this->sortTree($node['children']); + } + } + + return $tree; + } } diff --git a/app/code/Magento/CatalogGraphQl/etc/di.xml b/app/code/Magento/CatalogGraphQl/etc/di.xml index 8c6fac0fe621c..bb2a069d738ee 100644 --- a/app/code/Magento/CatalogGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogGraphQl/etc/di.xml @@ -72,6 +72,7 @@ <argument name="processors" xsi:type="array"> <item name="category_uid" xsi:type="object">Magento\CatalogGraphQl\Model\Resolver\Products\Query\CategoryUidArgsProcessor</item> <item name="category_uids" xsi:type="object">Magento\CatalogGraphQl\Model\Category\CategoryUidsArgsProcessor</item> + <item name="parent_category_uids" xsi:type="object">Magento\CatalogGraphQl\Model\Category\ParentCategoryUidsArgsProcessor</item> </argument> </arguments> </type> diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 79281ff42cf26..9bed85a3258e3 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -49,6 +49,12 @@ enum PriceTypeEnum @doc(description: "This enumeration the price type.") { DYNAMIC } +enum CustomizableDateTypeEnum @doc(description: "This enumeration customizable date type.") { + DATE + DATE_TIME + TIME +} + type ProductPrices @doc(description: "ProductPrices is deprecated, replaced by PriceRange. The ProductPrices object contains the regular price of an item, as well as its minimum and maximum prices. Only composite products, which include bundle, configurable, and grouped products, can contain a minimum and maximum price.") { minimalPrice: Price @deprecated(reason: "Use PriceRange.minimum_price.") @doc(description: "The lowest possible final price for all the options defined within a composite product. If you are specifying a price range, this would be the from value.") maximalPrice: Price @deprecated(reason: "Use PriceRange.maximum_price.") @doc(description: "The highest possible final price for all the options defined within a composite product. If you are specifying a price range, this would be the to value.") @@ -136,7 +142,7 @@ type CustomizableAreaValue @doc(description: "CustomizableAreaValue defines the uid: ID! @doc(description: "The unique ID for a `CustomizableAreaValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } -type CategoryTree implements CategoryInterface @doc(description: "Category Tree implementation.") { +type CategoryTree implements CategoryInterface, RoutableInterface @doc(description: "Category tree implementation") { children: [CategoryTree] @doc(description: "Child categories tree.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\CategoryTree") } @@ -154,6 +160,7 @@ type CustomizableDateOption implements CustomizableOptionInterface @doc(descript type CustomizableDateValue @doc(description: "CustomizableDateValue defines the price and sku of a product whose page contains a customized date picker.") { price: Float @doc(description: "The price assigned to this option.") price_type: PriceTypeEnum @doc(description: "FIXED, PERCENT, or DYNAMIC.") + type: CustomizableDateTypeEnum @doc(description: "DATE, DATE_TIME or TIME") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableDateTypeOptionValue") sku: String @doc(description: "The Stock Keeping Unit for this option.") uid: ID! @doc(description: "The unique ID for a `CustomizableDateValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableEnteredOptionValueUid") } @@ -301,10 +308,10 @@ type CustomizableCheckboxValue @doc(description: "CustomizableCheckboxValue defi uid: ID! @doc(description: "The unique ID for a `CustomizableCheckboxValue` object.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CustomizableSelectedOptionValueUid") } -type VirtualProduct implements ProductInterface, CustomizableProductInterface @doc(description: "A virtual product is non-tangible product that does not require shipping and is not kept in inventory.") { +type VirtualProduct implements ProductInterface, RoutableInterface, CustomizableProductInterface @doc(description: "A virtual product is a non-tangible product that does not require shipping and is not kept in inventory") { } -type SimpleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "A simple product is tangible and are usually sold as single units or in fixed quantities.") +type SimpleProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "A simple product is tangible and is usually sold in single units or in fixed quantities") { } @@ -332,7 +339,8 @@ input CategoryFilterInput @doc(description: "CategoryFilterInput defines the fi { ids: FilterEqualTypeInput @deprecated(reason: "Use the `category_uid` argument instead.") @doc(description: "Deprecated: use 'category_uid' to filter uniquely identifiers of categories.") category_uid: FilterEqualTypeInput @doc(description: "Filter by the unique category ID for a `CategoryInterface` object.") - parent_id: FilterEqualTypeInput @doc(description: "Filter by the unique parent category ID for a `CategoryInterface` object.") + parent_id: FilterEqualTypeInput @deprecated @doc(description: "Filter by the unique parent category ID for a `CategoryInterface` object.") + parent_category_uid: FilterEqualTypeInput @doc(description: "Filter by the unique parent category ID for a `CategoryInterface` object.") url_key: FilterEqualTypeInput @doc(description: "Filter by the part of the URL that identifies the category.") name: FilterMatchTypeInput @doc(description: "Filter by the display name of the category.") url_path: FilterEqualTypeInput @doc(description: "Filter by the URL path for the category.") diff --git a/app/code/Magento/CatalogImportExport/Model/Export/Product/WebsiteFilter.php b/app/code/Magento/CatalogImportExport/Model/Export/Product/WebsiteFilter.php new file mode 100644 index 0000000000000..11ef78a8ca815 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Model/Export/Product/WebsiteFilter.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Export\Product; + +use Magento\Catalog\Model\ResourceModel\Product\Collection; +use Magento\CatalogImportExport\Model\Export\ProductFilterInterface; + +/** + * Website filter for products export + */ +class WebsiteFilter implements ProductFilterInterface +{ + private const NAME = 'website_id'; + + /** + * @inheritDoc + */ + public function filter(Collection $collection, array $filters): Collection + { + if (!isset($filters[self::NAME])) { + return $collection; + } + + $collection->addWebsiteFilter($filters[self::NAME]); + + return $collection; + } +} diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 673dbcb3b3c99..d0c93658fc282 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1855,7 +1855,7 @@ protected function _saveProducts() } $productTypeModel = $this->_productTypeModels[$productType]; - if (!empty($rowData['tax_class_name'])) { + if (isset($rowData['tax_class_name']) && strlen($rowData['tax_class_name'])) { $rowData['tax_class_id'] = $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel); } diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/TaxClassProcessor.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/TaxClassProcessor.php index af102cc50b8b9..e068a07404822 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/TaxClassProcessor.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/TaxClassProcessor.php @@ -7,9 +7,25 @@ use Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType; use Magento\Tax\Model\ClassModel; +use Magento\Tax\Model\ClassModelFactory; +use Magento\Tax\Model\ResourceModel\TaxClass\Collection; +use Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory; +/** + * Imported products tax class processor + */ class TaxClassProcessor { + /** + * Empty tax class name + */ + private const CLASS_NONE_NAME = 'none'; + + /** + * Empty tax class ID + */ + private const CLASS_NONE_ID = 0; + /** * Tax attribute code. */ @@ -25,24 +41,24 @@ class TaxClassProcessor /** * Instance of tax class collection factory. * - * @var \Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory + * @var CollectionFactory */ protected $collectionFactory; /** * Instance of tax model factory. * - * @var \Magento\Tax\Model\ClassModelFactory + * @var ClassModelFactory */ protected $classModelFactory; /** - * @param \Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory $collectionFactory - * @param \Magento\Tax\Model\ClassModelFactory $classModelFactory + * @param CollectionFactory $collectionFactory + * @param ClassModelFactory $classModelFactory */ public function __construct( - \Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory $collectionFactory, - \Magento\Tax\Model\ClassModelFactory $classModelFactory + CollectionFactory $collectionFactory, + ClassModelFactory $classModelFactory ) { $this->collectionFactory = $collectionFactory; $this->classModelFactory = $classModelFactory; @@ -59,9 +75,9 @@ protected function initTaxClasses() if (empty($this->taxClasses)) { $collection = $this->collectionFactory->create(); $collection->addFieldToFilter('class_type', ClassModel::TAX_CLASS_TYPE_PRODUCT); - /* @var $collection \Magento\Tax\Model\ResourceModel\TaxClass\Collection */ + /* @var $collection Collection */ foreach ($collection as $taxClass) { - $this->taxClasses[$taxClass->getClassName()] = $taxClass->getId(); + $this->taxClasses[mb_strtolower($taxClass->getClassName())] = $taxClass->getId(); } } return $this; @@ -76,7 +92,7 @@ protected function initTaxClasses() */ protected function createTaxClass($taxClassName, AbstractType $productTypeModel) { - /** @var \Magento\Tax\Model\ClassModelFactory $taxClass */ + /** @var ClassModelFactory $taxClass */ $taxClass = $this->classModelFactory->create(); $taxClass->setClassType(ClassModel::TAX_CLASS_TYPE_PRODUCT); $taxClass->setClassName($taxClassName); @@ -98,10 +114,22 @@ protected function createTaxClass($taxClassName, AbstractType $productTypeModel) */ public function upsertTaxClass($taxClassName, AbstractType $productTypeModel) { - if (!isset($this->taxClasses[$taxClassName])) { - $this->taxClasses[$taxClassName] = $this->createTaxClass($taxClassName, $productTypeModel); + $normalizedTaxClassName = mb_strtolower($taxClassName); + + if ($normalizedTaxClassName === (string) self::CLASS_NONE_ID) { + $normalizedTaxClassName = self::CLASS_NONE_NAME; + } + + if (!isset($this->taxClasses[$normalizedTaxClassName])) { + $this->taxClasses[$normalizedTaxClassName] = $normalizedTaxClassName === self::CLASS_NONE_NAME + ? self::CLASS_NONE_ID + : $this->createTaxClass($taxClassName, $productTypeModel); + } + if ($normalizedTaxClassName === self::CLASS_NONE_NAME) { + // Add None option to tax_class_id options. + $productTypeModel->addAttributeOption(self::ATRR_CODE, self::CLASS_NONE_ID, self::CLASS_NONE_ID); } - return $this->taxClasses[$taxClassName]; + return $this->taxClasses[$normalizedTaxClassName]; } } diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml index 3edbb1b821843..bceac07f2a64e 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml @@ -12,13 +12,18 @@ <annotations> <description>Exports the unfiltered Products list. Validates that the Success Message is present.</description> </annotations> - + <arguments> + <argument name="fileFormat" defaultValue="CSV" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminExportMainSection.entityType}}" stepKey="waitForEntityTypeDropDown"/> <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> - <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible" time="5"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible"/> + <selectOption selector="{{AdminExportMainSection.fileFormat}}" userInput="{{fileFormat}}" stepKey="selectFileFormat"/> <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> - <wait stepKey="waitForScroll" time="5"/> + <waitForElementVisible selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="waitForScroll"/> <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> - <wait stepKey="waitForClick" time="5"/> - <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon. Make sure your cron job is running to export the file" stepKey="seeSuccessMessage"/> + <waitForPageLoad stepKey="waitForClick"/> + <waitForText userInput="Message is added to queue, wait to get your file soon. Make sure your cron job is running to export the file" selector="{{AdminMessagesSection.success}}" stepKey="seeSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml index f3ca894202893..f34236b49843c 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml @@ -17,8 +17,9 @@ <argument name="attribute" type="string"/> <argument name="attributeData" type="string"/> </arguments> - + <waitForElementVisible selector="{{AdminExportMainSection.entityType}}" stepKey="waitForEntityTypeDropDown"/> <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> + <waitForPageLoad stepKey="waitForPageLoad"/> <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible"/> <scrollTo selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="scrollToAttribute"/> <checkOption selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="selectAttribute"/> @@ -26,6 +27,7 @@ <waitForPageLoad stepKey="waitForUserInput"/> <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> - <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon" stepKey="seeSuccessMessage"/> + <waitForPageLoad stepKey="waitForClick"/> + <waitForText userInput="Message is added to queue, wait to get your file soon" selector="{{AdminMessagesSection.success}}" stepKey="seeSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 0000000000000..3ca2da4f1b894 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Product Attributes --> + <entity name="ProductAttributeFrontendLabelImport1" type="FrontendLabel"> + <data key="store_id">0</data> + <data key="label">import_attribute1</data> + </entity> + <entity name="ProductAttributeWithThreeOptionsForImport" extends="productAttributeDropdownTwoOptions" type="ProductAttribute"> + <data key="attribute_code">import_attribute1</data> + <requiredEntity type="FrontendLabel">ProductAttributeFrontendLabelImport1</requiredEntity> + </entity> + <entity name="ProductAttributeOptionThreeForImport" extends="productAttributeOption3" type="ProductAttributeOption"> + <data key="label">option3</data> + </entity> + + <!-- Images --> + <entity name="TestImageImageContentExportImport" extends="TestImageContent" type="ImageContent"> + <data key="name">test_image.jpg</data> + </entity> + <entity name="AdobeBaseContentExportImport" extends="AdobeBaseContent" type="ImageContent"> + <data key="name">adobe-base.jpg</data> + </entity> + <entity name="ApiProductAttributeMediaGalleryForExportImport2" extends="ApiProductAttributeMediaGalleryEntryTestImage" type="ProductAttributeMediaGalleryEntry"> + <data key="label">Test Image</data> + <requiredEntity type="ImageContent">TestImageImageContentExportImport</requiredEntity> + </entity> + <entity name="ApiProductAttributeMediaGalleryForExportImport3" extends="ApiProductAttributeMediaGalleryEntryTestImage2" type="ProductAttributeMediaGalleryEntry"> + <data key="label">Adobe Base</data> + <requiredEntity type="ImageContent">AdobeBaseContentExportImport</requiredEntity> + </entity> +</entities> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml index 785d19c000af0..1d837cd64bc08 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml @@ -11,14 +11,21 @@ <test name="AdminExportBundleProductTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> - <title value="Export Bundle Product"/> - <description value="Admin should be able to export Bundle Product"/> + <stories value="Export Products"/> + <title value="Export Bundle Products"/> + <description value="Verifies that a user can export Bundle and Simple child products for Bundled products + with a dynamic price, a fixed price, and a custom attribute. Verifies that the exported file and the + downloadable copy of the exported file contain the expected products. Note that MFTF cannot simply download + a file and have access to it due to the test not having access to the server that is running the test + browser. Therefore, this test verifies that the Download button can be successfully clicked, grabs the + request URL from the Download button, executes the request on the magento machine via a curl request, and + verifies the contents of the downloaded file."/> <severity value="CRITICAL"/> <testCaseId value="MC-14008"/> <group value="catalog_import_export"/> <group value="mtf_migrated"/> </annotations> + <before> <!--Create bundle product with dynamic price with two simple products --> <createData entity="SimpleProduct2" stepKey="firstSimpleProductForDynamic"/> @@ -81,7 +88,9 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> + <after> + <!-- Delete Data & Reindex --> <deleteData createDataKey="createDynamicBundleProduct" stepKey="deleteDynamicBundleProduct"/> <deleteData createDataKey="firstSimpleProductForDynamic" stepKey="deleteFirstSimpleProductForDynamic"/> <deleteData createDataKey="secondSimpleProductForDynamic" stepKey="deleteSecondSimpleProductForDynamic"/> @@ -92,33 +101,198 @@ <deleteData createDataKey="firstSimpleProductForFixedWithAttribute" stepKey="deleteFirstSimpleProductForFixedWithAttribute"/> <deleteData createDataKey="secondSimpleProductForFixedWithAttribute" stepKey="deleteSecondSimpleProductForFixedWithAttribute"/> <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Go to export page --> - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - - <!-- Export created below products --> + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> - <!-- Start message queue for export consumer --> + <!-- Start Message Queue for Export Consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> </actionGroup> <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> - <!-- Download product --> + <!-- Validate Export File on File System: Dynamic Bundle Product --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForDynamicBundledProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForDynamicBundledProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createDynamicBundleProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProductOption1"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$firstSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicBundleProductOption2"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$secondSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDynamicPriceBundleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">0.000000,,,,$$createDynamicBundleProduct.sku$$</argument> + </helper> + + <!-- Validate Export File on File System: Fixed Bundle Product --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForFixedBundledProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForFixed.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForFixedBundledProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForFixed.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductOption1"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$firstSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductOption2"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$secondSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedPriceBundleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProduct.price$$0000,,,,$$createFixedBundleProduct.sku$$</argument> + </helper> + + <!-- Validate Export File on File System: Fixed Bundle Product with Attribute --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProductForFixedBundledProductWithAttribute"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$firstSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProductForFixedBundledProductWithAttribute"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$secondSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttribute"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProductWithAttribute.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttributeOption1"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$firstSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedBundleProductWithAttributeOption2"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$secondSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFixedPriceBundleProductWithAttribute"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFixedBundleProductWithAttribute.price$$0000,,,,$$createFixedBundleProductWithAttribute.sku$$</argument> + </helper> + + <!-- Download Export File --> <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> <argument name="fileName" value="{$grabNameFile}"/> </actionGroup> - <!-- Delete exported file --> + <!-- Validate Downloaded Export File on File System: Dynamic Bundle Product --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstSimpleProductForDynamicBundledProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$firstSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondSimpleProductForDynamicBundledProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$secondSimpleProductForDynamic.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDynamicBundleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createDynamicBundleProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDynamicBundleProductOption1"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$firstSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDynamicBundleProductOption2"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createFirstBundleOption.option[title]$,type=$createFirstBundleOption.option[type]$,required=$createFirstBundleOption.option[required]$,sku=$$secondSimpleProductForDynamic.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDynamicPriceBundleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">0.000000,,,,$$createDynamicBundleProduct.sku$$</argument> + </helper> + + <!-- Validate Downloaded Export File on File System: Fixed Bundle Product --> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstSimpleProductForFixedBundledProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$firstSimpleProductForFixed.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondSimpleProductForFixedBundledProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$secondSimpleProductForFixed.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFixedBundleProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProductOption1"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$firstSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProductOption2"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createSecondBundleOption.option[title]$,type=$createSecondBundleOption.option[type]$,required=$createSecondBundleOption.option[required]$,sku=$$secondSimpleProductForFixed.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedPriceBundleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFixedBundleProduct.price$$0000,,,,$$createFixedBundleProduct.sku$$</argument> + </helper> + + <!-- Validate Downloaded Export File on File System: Fixed Bundle Product with Attribute --> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstSimpleProductForFixedBundledProductWithAttribute"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$firstSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondSimpleProductForFixedBundledProductWithAttribute"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$secondSimpleProductForFixedWithAttribute.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProductWithAttribute"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFixedBundleProductWithAttribute.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProductWithAttributeOption1"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$firstSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedBundleProductWithAttributeOption2"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">name=$createBundleOptionWithAttribute.option[title]$,type=$createBundleOptionWithAttribute.option[type]$,required=$createBundleOptionWithAttribute.option[required]$,sku=$$secondSimpleProductForFixedWithAttribute.sku$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFixedPriceBundleProductWithAttribute"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFixedBundleProductWithAttribute.price$$0000,,,,$$createFixedBundleProductWithAttribute.sku$$</argument> + </helper> + + <!-- Delete Export File --> <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="fileName" value="{$grabNameFile}"/> </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> </test> </tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml index 9f8d65968d741..5943760853e3e 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml @@ -11,14 +11,20 @@ <test name="AdminExportGroupedProductWithSpecialPriceTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> - <title value="Export grouped product with special price"/> - <description value="Admin should be able to export grouped product with special price"/> + <stories value="Export Products"/> + <title value="Export Grouped Products with Special Price"/> + <description value="Verifies that a user can export a Grouped product with a special price and Simple child + products. Verifies that exported file and the downloadable copy of the exported file contain the expected + products. Note that MFTF cannot simply download a file and have access to it due to the test not having + access to the server that is running the test browser. Therefore, this test verifies that the Download + button can be successfully clicked, grabs the request URL from the Download button, executes the request on + the magento machine via a curl request, and verifies the contents of the downloaded file."/> <severity value="CRITICAL"/> <testCaseId value="MC-14009"/> <group value="catalog_import_export"/> <group value="mtf_migrated"/> </annotations> + <before> <!-- Create first simple product and add special price --> <createData entity="SimpleProduct2" stepKey="createFirstSimpleProduct"/> @@ -50,40 +56,94 @@ <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> + <after> + <!-- Delete Data & Reindex --> <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> <deleteData createDataKey="createGroupedProduct" stepKey="deleteGroupedProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - <!-- Log out --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Go to export page --> - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> - - <!-- Export created below products --> + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> + <comment userInput="BIC workaround" stepKey="waitForExportIndexPageLoad"/> <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> - <!-- Start message queue for export consumer --> + <!-- Start Message Queue for Export Consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> </actionGroup> <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> - <!-- Download product --> + <!-- Validate Export File on File System: Grouped Product with Special Price --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFirstSimpleProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createSecondSimpleProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsGroupedProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createGroupedProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildGroupedProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createFirstSimpleProduct.sku$$=$$createFirstSimpleProduct.quantity$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildGroupedProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createSecondSimpleProduct.sku$$=$$createSecondSimpleProduct.quantity$$</argument> + </helper> + + <!-- Download Export File --> <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> <argument name="fileName" value="{$grabNameFile}"/> </actionGroup> - <!-- Delete exported file --> + <!-- Validate Downloaded Export File: Grouped Product with Special Price --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFirstSimpleProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createSecondSimpleProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsGroupedProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createGroupedProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstChildGroupedProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createFirstSimpleProduct.sku$$=$$createFirstSimpleProduct.quantity$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondChildGroupedProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createSecondSimpleProduct.sku$$=$$createSecondSimpleProduct.quantity$$</argument> + </helper> + + <!-- Delete Export File --> <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="fileName" value="{$grabNameFile}"/> </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> </test> </tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml index f0e6e12204a9e..5aacd9dae44f6 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml @@ -209,9 +209,7 @@ <!-- Go to "Images and Videos" section: assert image --> <scrollTo selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" stepKey="scrollToProductGalleryTab"/> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"> - <argument name="image" value="MagentoLogo"/> - </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Go to any ConfProd's configuration page: Product page open successfully --> <click selector="{{AdminProductFormConfigurationsSection.variationProductLinkByName($$createConfigFirstChildProduct.name$$)}}" stepKey="clickOnFirstProductLink"/> @@ -219,9 +217,7 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <!-- Go to "Images and Videos" section: assert image --> <scrollTo selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" stepKey="scrollToChildProductGalleryTab"/> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertChildProductImageAdminProductPage"> - <argument name="image" value="MagentoLogo"/> - </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertChildProductImageAdminProductPage"/> <closeTab stepKey="closeConfigChildProductPage"/> <!-- Delete exported file --> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml index 94478e63aa92a..6eadb8d11456b 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml @@ -11,14 +11,21 @@ <test name="AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> - <title value="Export Simple and Configurable products with custom options"/> - <description value="Admin should be able to export Simple and Configurable products with custom options"/> + <stories value="Export Products"/> + <title value="Export Simple and Configurable Products with Custom Options"/> + <description value="Verifies that a user can export a Configurable product with child simple products with + custom options. Verifies that the exported file and the downloadable copy of the exported file contain the + expected product (a filter is applied when exporting such that ONLY the configurable product row should be + in the export). Note that MFTF cannot simply download a file and have access to it due to the test not + having access to the server that is running the test browser. Therefore, this test verifies that the + Download button can be successfully clicked, grabs the request URL from the Download button, executes the + request on the magento machine via a curl request, and verifies the contents of the downloaded file."/> <severity value="CRITICAL"/> <testCaseId value="MC-14005"/> <group value="catalog_import_export"/> <group value="mtf_migrated"/> </annotations> + <before> <!-- Create category --> <createData entity="SimpleSubCategory" stepKey="createCategory"/> @@ -76,6 +83,7 @@ <magentoCron stepKey="runCronIndex" groups="index"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> + <after> <!-- Delete configurable product creation --> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> @@ -83,37 +91,90 @@ <deleteData createDataKey="createConfigSecondChildProduct" stepKey="deleteConfigSecondChildProduct"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Go to export page --> - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> - - <!-- Fill entity attributes data --> + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> + <comment userInput="BIC workaround" stepKey="waitForExportIndexPageLoad"/> <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> <argument name="attribute" value="sku"/> <argument name="attributeData" value="$$createConfigProduct.sku$$"/> </actionGroup> - <!-- Start message queue for export consumer --> + <!-- Start Message Queue for Export Consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> </actionGroup> <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> - <!-- Download product --> + <!-- Validate Export File on File System: Product with Custom Options --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildSimpleProductOption"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildSimpleProductOption"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainFirstSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainSecondSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigSecondChildProduct.name$$</argument> + </helper> + + <!-- Download Export File --> <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> <argument name="fileName" value="{$grabNameFile}"/> </actionGroup> - <!-- Delete exported file --> + <!-- Validate Downloaded Export File: Product with Custom Options --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsConfigurableProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstChildSimpleProductOption"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondChildSimpleProductOption"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseDoesNotContainString" stepKey="assertDownloadFileDoesNotContainFirstSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseDoesNotContainString" stepKey="assertDownloadFileDoesNotContainSecondSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigSecondChildProduct.name$$</argument> + </helper> + + <!-- Delete Export File --> <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="fileName" value="{$grabNameFile}"/> </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> </test> </tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml index 95cfe2c87bffb..981d63b4f23e3 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml @@ -11,14 +11,22 @@ <test name="AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> + <stories value="Export Products"/> <title value="Export Simple product and Configurable products with assigned images"/> - <description value="Admin should be able to export Simple and Configurable products with assigned images"/> + <description value="Verifies that a user can export a Configurable product with child simple products with + images. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the configurable product row should be in the + export) and the attached image. Note that MFTF cannot simply download a file and have access to it due to + the test not having access to the server that is running the test browser. Therefore, this test verifies + that the Download button can be successfully clicked, grabs the request URL from the Download button, + executes the request on the magento machine via a curl request, and verifies the contents of the downloaded + file"/> <severity value="CRITICAL"/> <testCaseId value="MC-14004"/> <group value="catalog_import_export"/> <group value="mtf_migrated"/> </annotations> + <before> <!-- Create category --> <createData entity="SimpleSubCategory" stepKey="createCategory"/> @@ -92,43 +100,105 @@ <magentoCron groups="index" stepKey="runCronIndex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> + <after> - <!-- Delete configurable product creation --> + <!-- Delete Data --> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> <deleteData createDataKey="createConfigFirstChildProduct" stepKey="deleteConfigFirstChildProduct"/> <deleteData createDataKey="createConfigSecondChildProduct" stepKey="deleteConfigSecondChildProduct"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Go to export page --> - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - - <!-- Fill entity attributes data --> + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> <argument name="attribute" value="sku"/> <argument name="attributeData" value="$$createConfigProduct.sku$$"/> </actionGroup> - <!-- Start message queue for export consumer --> + <!-- Start Message Queue for Export Consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> </actionGroup> <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> - <!-- Download product --> + <!-- Validate Export File on File System: Configurable Product --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsFirstChildSimpleProductOption"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsSecondChildSimpleProductOption"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsConfigurableProductImage"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$createConfigProductImage.entry[content][name]$,"$createConfigProductImage.entry[label]$"</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainFirstSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotContainString" stepKey="assertExportFileDoesNotContainSecondSimpleProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createConfigSecondChildProduct.name$$</argument> + </helper> + + <!-- Download Export File --> <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> <argument name="fileName" value="{$grabNameFile}"/> </actionGroup> - <!-- Delete exported file --> + <!-- Validate Downloaded Export File on File System: Configurable Product --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsConfigurableProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsFirstChildSimpleProductOption"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">sku=$$createConfigFirstChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option1</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsSecondChildSimpleProductOption"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">sku=$$createConfigSecondChildProduct.sku$$,$$createConfigProductAttribute.attribute_code$$=option2</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsConfigurableProductImage"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$createConfigProductImage.entry[content][name]$,"$createConfigProductImage.entry[label]$"</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseDoesNotContainString" stepKey="assertDownloadFileDoesNotContainFirstSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigFirstChildProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseDoesNotContainString" stepKey="assertDownloadFileDoesNotContainSecondSimpleProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createConfigSecondChildProduct.name$$</argument> + </helper> + + <!-- Delete Export File --> <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="fileName" value="{$grabNameFile}"/> </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> </test> </tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml index 2f57d94113d38..35e9603c3055e 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml @@ -11,7 +11,7 @@ <test name="AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> + <stories value="Export Products"/> <title value="Export Simple Product assigned to Main Website and Configurable Product assigned to Custom Website"/> <description value="Admin should be able to export Simple Product assigned to Main Website and Configurable Product assigned to Custom Website"/> <severity value="CRITICAL"/> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml index dac97a61a967b..7de972285215e 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml @@ -11,7 +11,7 @@ <test name="AdminExportSimpleProductWithCustomAttributeTest"> <annotations> <features value="CatalogImportExport"/> - <stories value="Export products"/> + <stories value="Export Products"/> <title value="Export Simple Product with custom attribute"/> <description value="Admin should be able to export Simple Product with custom attribute"/> <severity value="CRITICAL"/> diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/TaxClassProcessorTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/TaxClassProcessorTest.php index ba65ffa37c8c7..80ee5e92f2e79 100644 --- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/TaxClassProcessorTest.php +++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/TaxClassProcessorTest.php @@ -101,4 +101,22 @@ public function testUpsertTaxClassNotExist() $taxClassId = $this->taxClassProcessor->upsertTaxClass('noExistClassName', $this->product); $this->assertEquals(self::TEST_JUST_CREATED_TAX_CLASS_ID, $taxClassId); } + + public function testUpsertTaxClassExistCaseInsensitive() + { + $taxClassId = $this->taxClassProcessor->upsertTaxClass(strtoupper(self::TEST_TAX_CLASS_NAME), $this->product); + $this->assertEquals(self::TEST_TAX_CLASS_ID, $taxClassId); + } + + public function testUpsertTaxClassNone() + { + $taxClassId = $this->taxClassProcessor->upsertTaxClass('none', $this->product); + $this->assertEquals(0, $taxClassId); + } + + public function testUpsertTaxClassZero() + { + $taxClassId = $this->taxClassProcessor->upsertTaxClass(0, $this->product); + $this->assertEquals(0, $taxClassId); + } } diff --git a/app/code/Magento/CatalogImportExport/etc/di.xml b/app/code/Magento/CatalogImportExport/etc/di.xml index 040e9dcda132a..c35bcbd849511 100644 --- a/app/code/Magento/CatalogImportExport/etc/di.xml +++ b/app/code/Magento/CatalogImportExport/etc/di.xml @@ -48,6 +48,7 @@ <argument name="filters" xsi:type="array"> <item name="category_ids" xsi:type="object">Magento\CatalogImportExport\Model\Export\Product\CategoryFilter</item> <item name="quantity_and_stock_status" xsi:type="object">Magento\CatalogImportExport\Model\Export\Product\StockStatusFilter</item> + <item name="website_ids" xsi:type="object">Magento\CatalogImportExport\Model\Export\Product\WebsiteFilter</item> </argument> </arguments> </type> diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockCollectionInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockCollectionInterface.php index 07b8429ddf188..4b9383b9eb106 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockCollectionInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockCollectionInterface.php @@ -17,8 +17,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockCollectionInterface extends SearchResultsInterface { diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockInterface.php index 581081f2924ea..e0375471acf19 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockInterface.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockInterface extends ExtensibleDataInterface { diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockItemCollectionInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockItemCollectionInterface.php index 2d5f980a57039..d280df7e9fe1e 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockItemCollectionInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockItemCollectionInterface.php @@ -17,8 +17,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockItemCollectionInterface extends SearchResultsInterface { diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockItemInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockItemInterface.php index 759cc9883be9f..4b42c6498c942 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockItemInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockItemInterface.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockItemInterface extends ExtensibleDataInterface { diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php index a7d70a943d405..c3649496f2be8 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStatusCollectionInterface extends SearchResultsInterface { diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockStatusInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockStatusInterface.php index 35e56b0e3e7bb..10123c9c5a103 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockStatusInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockStatusInterface.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStatusInterface extends ExtensibleDataInterface { diff --git a/app/code/Magento/CatalogInventory/Api/RegisterProductSaleInterface.php b/app/code/Magento/CatalogInventory/Api/RegisterProductSaleInterface.php index ddb3fce22a853..e530b0d83c9c4 100644 --- a/app/code/Magento/CatalogInventory/Api/RegisterProductSaleInterface.php +++ b/app/code/Magento/CatalogInventory/Api/RegisterProductSaleInterface.php @@ -14,8 +14,8 @@ * @api * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html * @since 100.3.0 */ interface RegisterProductSaleInterface diff --git a/app/code/Magento/CatalogInventory/Api/RevertProductSaleInterface.php b/app/code/Magento/CatalogInventory/Api/RevertProductSaleInterface.php index 83f7d73deaed9..5d5f22580b1e4 100644 --- a/app/code/Magento/CatalogInventory/Api/RevertProductSaleInterface.php +++ b/app/code/Magento/CatalogInventory/Api/RevertProductSaleInterface.php @@ -11,8 +11,8 @@ * @api * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html * @since 100.3.0 */ interface RevertProductSaleInterface diff --git a/app/code/Magento/CatalogInventory/Api/StockConfigurationInterface.php b/app/code/Magento/CatalogInventory/Api/StockConfigurationInterface.php index ab52580988c5e..4436f3b220c2c 100644 --- a/app/code/Magento/CatalogInventory/Api/StockConfigurationInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockConfigurationInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockConfigurationInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockCriteriaInterface.php b/app/code/Magento/CatalogInventory/Api/StockCriteriaInterface.php index 92f2290ec08ad..5c3c82701339a 100644 --- a/app/code/Magento/CatalogInventory/Api/StockCriteriaInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockCriteriaInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockCriteriaInterface extends \Magento\Framework\Api\CriteriaInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockIndexInterface.php b/app/code/Magento/CatalogInventory/Api/StockIndexInterface.php index 24dbaf5bb6d5f..e3288d355f742 100644 --- a/app/code/Magento/CatalogInventory/Api/StockIndexInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockIndexInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockIndexInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockItemCriteriaInterface.php b/app/code/Magento/CatalogInventory/Api/StockItemCriteriaInterface.php index b72289ee09278..19c5f597d4b36 100644 --- a/app/code/Magento/CatalogInventory/Api/StockItemCriteriaInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockItemCriteriaInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockItemCriteriaInterface extends \Magento\Framework\Api\CriteriaInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockItemRepositoryInterface.php b/app/code/Magento/CatalogInventory/Api/StockItemRepositoryInterface.php index 4269569f9da1a..41b96b0d5ccd0 100644 --- a/app/code/Magento/CatalogInventory/Api/StockItemRepositoryInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockItemRepositoryInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockItemRepositoryInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockManagementInterface.php b/app/code/Magento/CatalogInventory/Api/StockManagementInterface.php index 3c1c7ea137c89..a3fca303236b4 100644 --- a/app/code/Magento/CatalogInventory/Api/StockManagementInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockManagementInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockManagementInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockRegistryInterface.php b/app/code/Magento/CatalogInventory/Api/StockRegistryInterface.php index bab5f9b457c45..07bf2746338d9 100644 --- a/app/code/Magento/CatalogInventory/Api/StockRegistryInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockRegistryInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockRegistryInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockRepositoryInterface.php b/app/code/Magento/CatalogInventory/Api/StockRepositoryInterface.php index a7d64ec9eedb3..f38d4a2ca91b3 100644 --- a/app/code/Magento/CatalogInventory/Api/StockRepositoryInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockRepositoryInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockRepositoryInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockStateInterface.php b/app/code/Magento/CatalogInventory/Api/StockStateInterface.php index d404e885d78df..ad7291281ed3e 100644 --- a/app/code/Magento/CatalogInventory/Api/StockStateInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockStateInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStateInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockStatusCriteriaInterface.php b/app/code/Magento/CatalogInventory/Api/StockStatusCriteriaInterface.php index be1c9642826a7..cd26a575b676e 100644 --- a/app/code/Magento/CatalogInventory/Api/StockStatusCriteriaInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockStatusCriteriaInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStatusCriteriaInterface extends \Magento\Framework\Api\CriteriaInterface { diff --git a/app/code/Magento/CatalogInventory/Api/StockStatusRepositoryInterface.php b/app/code/Magento/CatalogInventory/Api/StockStatusRepositoryInterface.php index 91efd55761335..b120b93c9193e 100644 --- a/app/code/Magento/CatalogInventory/Api/StockStatusRepositoryInterface.php +++ b/app/code/Magento/CatalogInventory/Api/StockStatusRepositoryInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStatusRepositoryInterface { diff --git a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php index bc63114d99801..e7918e32f78a2 100644 --- a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php +++ b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php @@ -14,8 +14,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Minsaleqty extends \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray { diff --git a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php index 3c1a6e7982708..c430d3c399b52 100644 --- a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php +++ b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php @@ -16,8 +16,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Stock extends \Magento\Framework\Data\Form\Element\Select { diff --git a/app/code/Magento/CatalogInventory/Block/Qtyincrements.php b/app/code/Magento/CatalogInventory/Block/Qtyincrements.php index dd8c987fe5da4..909ec9346ebf0 100644 --- a/app/code/Magento/CatalogInventory/Block/Qtyincrements.php +++ b/app/code/Magento/CatalogInventory/Block/Qtyincrements.php @@ -16,8 +16,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Qtyincrements extends Template implements IdentityInterface { diff --git a/app/code/Magento/CatalogInventory/Block/Stockqty/DefaultStockqty.php b/app/code/Magento/CatalogInventory/Block/Stockqty/DefaultStockqty.php index c19dc5fb34bf6..cb7d68c92ef6f 100644 --- a/app/code/Magento/CatalogInventory/Block/Stockqty/DefaultStockqty.php +++ b/app/code/Magento/CatalogInventory/Block/Stockqty/DefaultStockqty.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class DefaultStockqty extends AbstractStockqty implements \Magento\Framework\DataObject\IdentityInterface { diff --git a/app/code/Magento/CatalogInventory/Helper/Stock.php b/app/code/Magento/CatalogInventory/Helper/Stock.php index 87a0e3c32ad09..e79d2098be68a 100644 --- a/app/code/Magento/CatalogInventory/Helper/Stock.php +++ b/app/code/Magento/CatalogInventory/Helper/Stock.php @@ -20,8 +20,8 @@ * @api * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html * @since 100.0.2 */ class Stock diff --git a/app/code/Magento/CatalogInventory/Model/Adminhtml/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Adminhtml/Stock/Item.php index 04e54acad5c0e..c2715241fbe1d 100644 --- a/app/code/Magento/CatalogInventory/Model/Adminhtml/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Adminhtml/Stock/Item.php @@ -22,8 +22,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Item extends \Magento\CatalogInventory\Model\Stock\Item implements IdentityInterface { diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php index 005ffd11ac7a1..4cc44488a3a71 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php @@ -6,6 +6,7 @@ namespace Magento\CatalogInventory\Model\Indexer\Stock; +use Magento\Catalog\Model\Category; use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\Framework\App\ResourceConnection; use Magento\Framework\App\ObjectManager; @@ -88,6 +89,11 @@ public function clean(array $productIds, callable $reindex) if ($productIds) { $this->cacheContext->registerEntities(Product::CACHE_TAG, array_unique($productIds)); $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); + $categoryIds = $this->getCategoryIdsByProductIds($productIds); + if ($categoryIds){ + $this->cacheContext->registerEntities(Category::CACHE_TAG, array_unique($categoryIds)); + $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); + } } } @@ -159,6 +165,22 @@ private function getProductIdsForCacheClean(array $productStatusesBefore, array return $productIds; } + /** + * Get category ids for products + * + * @param array $productIds + * @return array + */ + private function getCategoryIdsByProductIds(array $productIds): array + { + $categoryProductTable = $this->getConnection()->getTableName('catalog_category_product'); + $select = $this->getConnection()->select() + ->from(['catalog_category_product' => $categoryProductTable], ['category_id']) + ->where('product_id IN (?)', $productIds); + + return $this->getConnection()->fetchCol($select); + } + /** * Get database connection. * diff --git a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php index 12a48caf62414..3304e39f2cb29 100644 --- a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php +++ b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php @@ -27,8 +27,8 @@ * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class QuantityValidator { diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php index dec18044b699e..05b645652093d 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php @@ -20,8 +20,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class DefaultStock extends AbstractIndexer implements StockInterface { diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/QueryProcessorInterface.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/QueryProcessorInterface.php index 665ebf2db2f30..4a78babd03201 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/QueryProcessorInterface.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/QueryProcessorInterface.php @@ -13,8 +13,8 @@ * @since 100.1.0 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface QueryProcessorInterface { diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/StockInterface.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/StockInterface.php index 9a1945d5aefac..e111a5267da77 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/StockInterface.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/StockInterface.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockInterface { diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/StockFactory.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/StockFactory.php index 49e4889c8edee..f109643bc09c5 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/StockFactory.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/StockFactory.php @@ -14,8 +14,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class StockFactory { diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php index afb7d51335df8..adf62b75b2adb 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php @@ -24,8 +24,8 @@ * @api * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html * @since 100.0.2 */ class Status extends AbstractDb diff --git a/app/code/Magento/CatalogInventory/Model/Source/Backorders.php b/app/code/Magento/CatalogInventory/Model/Source/Backorders.php index d28da4e5b3497..59d359433c268 100644 --- a/app/code/Magento/CatalogInventory/Model/Source/Backorders.php +++ b/app/code/Magento/CatalogInventory/Model/Source/Backorders.php @@ -11,8 +11,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Backorders implements \Magento\Framework\Option\ArrayInterface { diff --git a/app/code/Magento/CatalogInventory/Model/Source/Stock.php b/app/code/Magento/CatalogInventory/Model/Source/Stock.php index 69e80658ecd74..c0ffb619e36ce 100644 --- a/app/code/Magento/CatalogInventory/Model/Source/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Source/Stock.php @@ -13,8 +13,8 @@ * @since 100.0.2 * * @deprecated 100.3.0 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ class Stock extends AbstractSource { diff --git a/app/code/Magento/CatalogInventory/Model/Spi/StockRegistryProviderInterface.php b/app/code/Magento/CatalogInventory/Model/Spi/StockRegistryProviderInterface.php index b2dfe532ffbe0..bbba3498ab03f 100644 --- a/app/code/Magento/CatalogInventory/Model/Spi/StockRegistryProviderInterface.php +++ b/app/code/Magento/CatalogInventory/Model/Spi/StockRegistryProviderInterface.php @@ -9,8 +9,8 @@ * Interface StockRegistryProviderInterface * * @deprecated 100.3.2 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockRegistryProviderInterface { diff --git a/app/code/Magento/CatalogInventory/Model/Spi/StockStateProviderInterface.php b/app/code/Magento/CatalogInventory/Model/Spi/StockStateProviderInterface.php index 5bb78e1489b39..2cc69513f31b7 100644 --- a/app/code/Magento/CatalogInventory/Model/Spi/StockStateProviderInterface.php +++ b/app/code/Magento/CatalogInventory/Model/Spi/StockStateProviderInterface.php @@ -11,8 +11,8 @@ * Interface StockStateProviderInterface * * @deprecated 100.3.2 Replaced with Multi Source Inventory - * @link https://devdocs.magento.com/guides/v2.3/inventory/index.html - * @link https://devdocs.magento.com/guides/v2.3/inventory/catalog-inventory-replacements.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/index.html + * @link https://devdocs.magento.com/guides/v2.4/inventory/inventory-api-reference.html */ interface StockStateProviderInterface { diff --git a/app/code/Magento/CatalogInventory/Model/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/Stock/Status.php index 4941d5d333bdb..7066d06c7f1a7 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/Stock/Status.php @@ -27,6 +27,11 @@ class Status extends AbstractExtensibleModel implements StockStatusInterface const KEY_STOCK_STATUS = 'stock_status'; /**#@-*/ + /** + * @var StockRegistryInterface + */ + private $stockRegistry; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry diff --git a/app/code/Magento/CatalogInventory/Model/Stock/StockItemRepository.php b/app/code/Magento/CatalogInventory/Model/Stock/StockItemRepository.php index 515080d56541c..936cafb60f332 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock/StockItemRepository.php +++ b/app/code/Magento/CatalogInventory/Model/Stock/StockItemRepository.php @@ -25,6 +25,7 @@ use Magento\Framework\Stdlib\DateTime\DateTime; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; +use Psr\Log\LoggerInterface as PsrLogger; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -98,8 +99,11 @@ class StockItemRepository implements StockItemRepositoryInterface protected $productCollectionFactory; /** - * Constructor - * + * @var PsrLogger + */ + private $psrLogger; + + /** * @param StockConfigurationInterface $stockConfiguration * @param StockStateProviderInterface $stockStateProvider * @param StockItemResource $resource @@ -111,7 +115,8 @@ class StockItemRepository implements StockItemRepositoryInterface * @param TimezoneInterface $localeDate * @param Processor $indexProcessor * @param DateTime $dateTime - * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory|null $collectionFactory + * @param CollectionFactory|null $productCollectionFactory + * @param PsrLogger|null $psrLogger * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -126,7 +131,8 @@ public function __construct( TimezoneInterface $localeDate, Processor $indexProcessor, DateTime $dateTime, - \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory = null + \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory = null, + PsrLogger $psrLogger = null ) { $this->stockConfiguration = $stockConfiguration; $this->stockStateProvider = $stockStateProvider; @@ -141,6 +147,8 @@ public function __construct( $this->dateTime = $dateTime; $this->productCollectionFactory = $productCollectionFactory ?: ObjectManager::getInstance() ->get(CollectionFactory::class); + $this->psrLogger = $psrLogger ?: ObjectManager::getInstance() + ->get(PsrLogger::class); } /** @@ -184,6 +192,7 @@ public function save(\Magento\CatalogInventory\Api\Data\StockItemInterface $stoc $this->resource->save($stockItem); } catch (\Exception $exception) { + $this->psrLogger->error($exception->getMessage()); throw new CouldNotSaveException(__('The stock item was unable to be saved. Please try again.'), $exception); } return $stockItem; diff --git a/app/code/Magento/CatalogInventory/Model/StockStateProvider.php b/app/code/Magento/CatalogInventory/Model/StockStateProvider.php index b57518b681aa2..bfa854edeaaf4 100644 --- a/app/code/Magento/CatalogInventory/Model/StockStateProvider.php +++ b/app/code/Magento/CatalogInventory/Model/StockStateProvider.php @@ -105,47 +105,46 @@ public function verifyNotification(StockItemInterface $stockItem) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQty, $origQty = 0) { $result = $this->objectFactory->create(); $result->setHasError(false); - $qty = $this->getNumber($qty); - - /** - * Check quantity type - */ - $result->setItemIsQtyDecimal($stockItem->getIsQtyDecimal()); - if (!$stockItem->getIsQtyDecimal()) { - $result->setHasQtyOptionUpdate(true); - $qty = (int) $qty ?: 1; - /** - * Adding stock data to quote item - */ - $result->setItemQty($qty); - $result->setOrigQty((int)$this->getNumber($origQty) ?: 1); - } + $quoteMessage = __('Please correct the quantity for some products.'); if ($stockItem->getMinSaleQty() && $qty < $stockItem->getMinSaleQty()) { $result->setHasError(true) ->setMessage(__('The fewest you may purchase is %1.', $stockItem->getMinSaleQty() * 1)) ->setErrorCode('qty_min') - ->setQuoteMessage(__('Please correct the quantity for some products.')) + ->setQuoteMessage($quoteMessage) ->setQuoteMessageIndex('qty'); return $result; } if ($stockItem->getMaxSaleQty() && $qty > $stockItem->getMaxSaleQty()) { $result->setHasError(true) - ->setMessage(__('The most you may purchase is %1.', $stockItem->getMaxSaleQty() * 1)) + ->setMessage(__('The requested qty exceeds the maximum qty allowed in shopping cart')) ->setErrorCode('qty_max') - ->setQuoteMessage(__('Please correct the quantity for some products.')) + ->setQuoteMessage($quoteMessage) ->setQuoteMessageIndex('qty'); return $result; } $result->addData($this->checkQtyIncrements($stockItem, $qty)->getData()); + + $result->setItemIsQtyDecimal($stockItem->getIsQtyDecimal()); + if (!$stockItem->getIsQtyDecimal() && (floor($qty) !== $qty)) { + $result->setHasError(true) + ->setMessage(__('You cannot use decimal quantity for this product.')) + ->setErrorCode('qty_decimal') + ->setQuoteMessage($quoteMessage) + ->setQuoteMessageIndex('qty'); + + return $result; + } + if ($result->getHasError()) { return $result; } diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryChangeManageStockActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryChangeManageStockActionGroup.xml index 2c38f14f53379..b93c2af43e64d 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryChangeManageStockActionGroup.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryChangeManageStockActionGroup.xml @@ -16,6 +16,8 @@ <argument name="manageStock" type="string" defaultValue="Yes"/> </arguments> <conditionalClick selector="{{AdminProductFormSection.advancedInventoryLink}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" visible="false" stepKey="openAdvancedInventoryWindow"/> + <!-- Wait for close button appeared. That means animation finished and modal window is fully visible --> + <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="waitForCloseButtonAppeared"/> <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" stepKey="waitForAdvancedInventoryModalWindowOpen"/> <uncheckOption selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" stepKey="uncheckManageStockConfigSetting"/> <selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="{{manageStock}}" stepKey="changeManageStock"/> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml index a5e4d3e9c2af7..e8871365dabea 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml @@ -13,11 +13,11 @@ <argument name="qty" type="string"/> </arguments> <conditionalClick selector="{{AdminProductFormSection.advancedInventoryLink}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" visible="false" stepKey="clickOnAdvancedInventoryLinkIfNeeded"/> + <!-- Wait for close button appeared. That means animation finished and modal window is fully visible --> + <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="waitForCloseButtonAppeared"/> <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="waitForAdvancedInventoryModalWindowOpen"/> <uncheckOption selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="uncheckMaxQtyCheckBox"/> <fillField selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCart}}" userInput="{{qty}}" stepKey="fillMaxAllowedQty"/> <click selector="{{AdminSlideOutDialogSection.doneButton}}" stepKey="clickDone"/> </actionGroup> - - </actionGroups> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml index e7387ddd5d674..eb076d23919ba 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml @@ -109,8 +109,8 @@ <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNext"/> <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <waitForPageLoad stepKey="waitForOrderSuccessPage1"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForOrderSuccessPage1"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <actionGroup ref="StorefrontSignOutActionGroup" stepKey="StorefrontSignOutActionGroup"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/CacheCleanerTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/CacheCleanerTest.php index f65ccaf806c11..794f5d92da1e8 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/CacheCleanerTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/CacheCleanerTest.php @@ -7,6 +7,7 @@ namespace Magento\CatalogInventory\Test\Unit\Model\Indexer\Stock; +use Magento\Catalog\Model\Category; use Magento\Catalog\Model\Product; use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\CatalogInventory\Model\Indexer\Stock\CacheCleaner; @@ -20,6 +21,9 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +/** + * Test for CacheCleaner + */ class CacheCleanerTest extends TestCase { /** @@ -70,14 +74,16 @@ protected function setUp(): void $this->connectionMock = $this->getMockBuilder(AdapterInterface::class) ->getMock(); $this->stockConfigurationMock = $this->getMockBuilder(StockConfigurationInterface::class) - ->setMethods(['getStockThresholdQty'])->getMockForAbstractClass(); + ->setMethods(['getStockThresholdQty']) + ->getMockForAbstractClass(); $this->cacheContextMock = $this->getMockBuilder(CacheContext::class) ->disableOriginalConstructor() ->getMock(); $this->eventManagerMock = $this->getMockBuilder(ManagerInterface::class) ->getMock(); $this->metadataPoolMock = $this->getMockBuilder(MetadataPool::class) - ->setMethods(['getMetadata', 'getLinkField'])->disableOriginalConstructor() + ->setMethods(['getMetadata', 'getLinkField']) + ->disableOriginalConstructor() ->getMock(); $this->selectMock = $this->getMockBuilder(Select::class) ->disableOriginalConstructor() @@ -100,37 +106,63 @@ protected function setUp(): void } /** + * Test clean cache by product ids and category ids + * * @param bool $stockStatusBefore * @param bool $stockStatusAfter * @param int $qtyAfter * @param bool|int $stockThresholdQty * @dataProvider cleanDataProvider + * @return void */ - public function testClean($stockStatusBefore, $stockStatusAfter, $qtyAfter, $stockThresholdQty) + public function testClean($stockStatusBefore, $stockStatusAfter, $qtyAfter, $stockThresholdQty): void { $productId = 123; - $this->selectMock->expects($this->any())->method('from')->willReturnSelf(); - $this->selectMock->expects($this->any())->method('where')->willReturnSelf(); - $this->selectMock->expects($this->any())->method('joinLeft')->willReturnSelf(); - $this->connectionMock->expects($this->exactly(2))->method('select')->willReturn($this->selectMock); - $this->connectionMock->expects($this->exactly(2))->method('fetchAll')->willReturnOnConsecutiveCalls( - [ - ['product_id' => $productId, 'stock_status' => $stockStatusBefore], - ], - [ - ['product_id' => $productId, 'stock_status' => $stockStatusAfter, 'qty' => $qtyAfter], - ] - ); - $this->stockConfigurationMock->expects($this->once())->method('getStockThresholdQty') + $categoryId = 3; + $this->selectMock->expects($this->any()) + ->method('from') + ->willReturnSelf(); + $this->selectMock->expects($this->any()) + ->method('where') + ->willReturnSelf(); + $this->selectMock->expects($this->any()) + ->method('joinLeft') + ->willReturnSelf(); + $this->connectionMock->expects($this->exactly(3)) + ->method('select') + ->willReturn($this->selectMock); + $this->connectionMock->expects($this->exactly(2)) + ->method('fetchAll') + ->willReturnOnConsecutiveCalls( + [ + ['product_id' => $productId, 'stock_status' => $stockStatusBefore], + ], + [ + ['product_id' => $productId, 'stock_status' => $stockStatusAfter, 'qty' => $qtyAfter], + ] + ); + $this->connectionMock->expects($this->exactly(1)) + ->method('fetchCol') + ->willReturn([$categoryId]); + $this->stockConfigurationMock->expects($this->once()) + ->method('getStockThresholdQty') ->willReturn($stockThresholdQty); - $this->cacheContextMock->expects($this->once())->method('registerEntities') - ->with(Product::CACHE_TAG, [$productId]); - $this->eventManagerMock->expects($this->once())->method('dispatch') + $this->cacheContextMock->expects($this->exactly(2)) + ->method('registerEntities') + ->withConsecutive( + [Product::CACHE_TAG, [$productId]], + [Category::CACHE_TAG, [$categoryId]], + ); + $this->eventManagerMock->expects($this->exactly(2)) + ->method('dispatch') ->with('clean_cache_by_tags', ['object' => $this->cacheContextMock]); - $this->metadataPoolMock->expects($this->exactly(2))->method('getMetadata') + $this->metadataPoolMock->expects($this->exactly(2)) + ->method('getMetadata') ->willReturnSelf(); - $this->metadataPoolMock->expects($this->exactly(2))->method('getLinkField') + $this->metadataPoolMock->expects($this->exactly(2)) + ->method('getLinkField') ->willReturn('row_id'); + $callback = function () { }; $this->unit->clean([], $callback); @@ -139,7 +171,7 @@ public function testClean($stockStatusBefore, $stockStatusAfter, $qtyAfter, $sto /** * @return array */ - public function cleanDataProvider() + public function cleanDataProvider(): array { return [ [true, false, 1, false], @@ -155,29 +187,42 @@ public function cleanDataProvider() * @param int $qtyAfter * @param bool|int $stockThresholdQty * @dataProvider notCleanCacheDataProvider + * @return void */ - public function testNotCleanCache($stockStatusBefore, $stockStatusAfter, $qtyAfter, $stockThresholdQty) + public function testNotCleanCache($stockStatusBefore, $stockStatusAfter, $qtyAfter, $stockThresholdQty): void { $productId = 123; - $this->selectMock->expects($this->any())->method('from')->willReturnSelf(); - $this->selectMock->expects($this->any())->method('where')->willReturnSelf(); - $this->selectMock->expects($this->any())->method('joinLeft')->willReturnSelf(); - $this->connectionMock->expects($this->exactly(2))->method('select')->willReturn($this->selectMock); - $this->connectionMock->expects($this->exactly(2))->method('fetchAll')->willReturnOnConsecutiveCalls( - [ - ['product_id' => $productId, 'stock_status' => $stockStatusBefore], - ], - [ - ['product_id' => $productId, 'stock_status' => $stockStatusAfter, 'qty' => $qtyAfter], - ] - ); - $this->stockConfigurationMock->expects($this->once())->method('getStockThresholdQty') + $this->selectMock->expects($this->any())->method('from') + ->willReturnSelf(); + $this->selectMock->expects($this->any())->method('where') + ->willReturnSelf(); + $this->selectMock->expects($this->any())->method('joinLeft') + ->willReturnSelf(); + $this->connectionMock->expects($this->exactly(2)) + ->method('select') + ->willReturn($this->selectMock); + $this->connectionMock->expects($this->exactly(2)) + ->method('fetchAll') + ->willReturnOnConsecutiveCalls( + [ + ['product_id' => $productId, 'stock_status' => $stockStatusBefore], + ], + [ + ['product_id' => $productId, 'stock_status' => $stockStatusAfter, 'qty' => $qtyAfter], + ] + ); + $this->stockConfigurationMock->expects($this->once()) + ->method('getStockThresholdQty') ->willReturn($stockThresholdQty); - $this->cacheContextMock->expects($this->never())->method('registerEntities'); - $this->eventManagerMock->expects($this->never())->method('dispatch'); - $this->metadataPoolMock->expects($this->exactly(2))->method('getMetadata') + $this->cacheContextMock->expects($this->never()) + ->method('registerEntities'); + $this->eventManagerMock->expects($this->never()) + ->method('dispatch'); + $this->metadataPoolMock->expects($this->exactly(2)) + ->method('getMetadata') ->willReturnSelf(); - $this->metadataPoolMock->expects($this->exactly(2))->method('getLinkField') + $this->metadataPoolMock->expects($this->exactly(2)) + ->method('getLinkField') ->willReturn('row_id'); $callback = function () { @@ -188,7 +233,7 @@ public function testNotCleanCache($stockStatusBefore, $stockStatusAfter, $qtyAft /** * @return array */ - public function notCleanCacheDataProvider() + public function notCleanCacheDataProvider(): array { return [ [true, true, 1, false], diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php index 9d2fb66dc716b..0d900bde60157 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockStateProviderTest.php @@ -21,6 +21,8 @@ use PHPUnit\Framework\TestCase; /** + * Unit tests for \Magento\CatalogInventory\Model\StockStateProvider class. + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class StockStateProviderTest extends TestCase @@ -115,6 +117,9 @@ class StockStateProviderTest extends TestCase 'getProductName', ]; + /** + * @inheritDoc + */ protected function setUp(): void { $this->objectManagerHelper = new ObjectManagerHelper($this); @@ -383,7 +388,7 @@ protected function getVariations() 'suggestQty' => 51, 'getStockQty' => $stockQty, 'checkQtyIncrements' => false, - 'checkQuoteItemQty' => false, + 'checkQuoteItemQty' => true, ], ], [ @@ -411,7 +416,7 @@ protected function getVariations() 'getStockQty' => $stockQty, 'checkQtyIncrements' => false, 'checkQuoteItemQty' => true, - ] + ], ], [ 'values' => [ @@ -438,8 +443,8 @@ protected function getVariations() 'getStockQty' => null, 'checkQtyIncrements' => false, 'checkQuoteItemQty' => true, - ] - ] + ], + ], ]; } diff --git a/app/code/Magento/CatalogInventory/i18n/en_US.csv b/app/code/Magento/CatalogInventory/i18n/en_US.csv index af989dc06d47e..4bac24ed998b6 100644 --- a/app/code/Magento/CatalogInventory/i18n/en_US.csv +++ b/app/code/Magento/CatalogInventory/i18n/en_US.csv @@ -71,3 +71,5 @@ Stock,Stock "Qty Uses Decimals","Qty Uses Decimals" "Allow Multiple Boxes for Shipping","Allow Multiple Boxes for Shipping" "Done","Done" +"The requested qty exceeds the maximum qty allowed in shopping cart","The requested qty exceeds the maximum qty allowed in shopping cart" +"You cannot use decimal quantity for this product.","You cannot use decimal quantity for this product." diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index df167d171e001..38b48e05c55c2 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -7,13 +7,23 @@ namespace Magento\CatalogRule\Model\Indexer; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ProductFactory; +use Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher; +use Magento\CatalogRule\Model\Indexer\IndexBuilder\ProductLoader; +use Magento\CatalogRule\Model\Indexer\IndexerTableSwapperInterface as TableSwapper; use Magento\CatalogRule\Model\ResourceModel\Rule\Collection as RuleCollection; use Magento\CatalogRule\Model\ResourceModel\Rule\CollectionFactory as RuleCollectionFactory; use Magento\CatalogRule\Model\Rule; +use Magento\Eav\Model\Config; use Magento\Framework\App\ObjectManager; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Pricing\PriceCurrencyInterface; -use Magento\CatalogRule\Model\Indexer\IndexBuilder\ProductLoader; -use Magento\CatalogRule\Model\Indexer\IndexerTableSwapperInterface as TableSwapper; +use Magento\Framework\Stdlib\DateTime; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; +use Psr\Log\LoggerInterface; /** * Catalog rule index builder @@ -46,12 +56,12 @@ class IndexBuilder protected $_catalogRuleGroupWebsiteColumnsList = ['rule_id', 'customer_group_id', 'website_id']; /** - * @var \Magento\Framework\App\ResourceConnection + * @var ResourceConnection */ protected $resource; /** - * @var \Magento\Store\Model\StoreManagerInterface + * @var StoreManagerInterface */ protected $storeManager; @@ -61,7 +71,7 @@ class IndexBuilder protected $ruleCollectionFactory; /** - * @var \Psr\Log\LoggerInterface + * @var LoggerInterface */ protected $logger; @@ -71,22 +81,22 @@ class IndexBuilder protected $priceCurrency; /** - * @var \Magento\Eav\Model\Config + * @var Config */ protected $eavConfig; /** - * @var \Magento\Framework\Stdlib\DateTime + * @var DateTime */ protected $dateFormat; /** - * @var \Magento\Framework\Stdlib\DateTime\DateTime + * @var DateTime\DateTime */ protected $dateTime; /** - * @var \Magento\Catalog\Model\ProductFactory + * @var ProductFactory */ protected $productFactory; @@ -136,7 +146,12 @@ class IndexBuilder private $pricesPersistor; /** - * @var \Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher + * @var TimezoneInterface|mixed + */ + private $localeDate; + + /** + * @var ActiveTableSwitcher|mixed */ private $activeTableSwitcher; @@ -146,20 +161,20 @@ class IndexBuilder private $tableSwapper; /** - * @var ProductLoader + * @var ProductLoader|mixed */ private $productLoader; /** * @param RuleCollectionFactory $ruleCollectionFactory * @param PriceCurrencyInterface $priceCurrency - * @param \Magento\Framework\App\ResourceConnection $resource - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Psr\Log\LoggerInterface $logger - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Framework\Stdlib\DateTime $dateFormat - * @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime - * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param ResourceConnection $resource + * @param StoreManagerInterface $storeManager + * @param LoggerInterface $logger + * @param Config $eavConfig + * @param DateTime $dateFormat + * @param DateTime\DateTime $dateTime + * @param ProductFactory $productFactory * @param int $batchCount * @param ProductPriceCalculator|null $productPriceCalculator * @param ReindexRuleProduct|null $reindexRuleProduct @@ -167,21 +182,23 @@ class IndexBuilder * @param RuleProductsSelectBuilder|null $ruleProductsSelectBuilder * @param ReindexRuleProductPrice|null $reindexRuleProductPrice * @param RuleProductPricesPersistor|null $pricesPersistor - * @param \Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher|null $activeTableSwitcher + * @param ActiveTableSwitcher|null $activeTableSwitcher * @param ProductLoader|null $productLoader * @param TableSwapper|null $tableSwapper + * @param TimezoneInterface|null $localeDate * @SuppressWarnings(PHPMD.ExcessiveParameterList) + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( RuleCollectionFactory $ruleCollectionFactory, PriceCurrencyInterface $priceCurrency, - \Magento\Framework\App\ResourceConnection $resource, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Psr\Log\LoggerInterface $logger, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Framework\Stdlib\DateTime $dateFormat, - \Magento\Framework\Stdlib\DateTime\DateTime $dateTime, - \Magento\Catalog\Model\ProductFactory $productFactory, + ResourceConnection $resource, + StoreManagerInterface $storeManager, + LoggerInterface $logger, + Config $eavConfig, + DateTime $dateFormat, + DateTime\DateTime $dateTime, + ProductFactory $productFactory, $batchCount = 1000, ProductPriceCalculator $productPriceCalculator = null, ReindexRuleProduct $reindexRuleProduct = null, @@ -189,9 +206,10 @@ public function __construct( RuleProductsSelectBuilder $ruleProductsSelectBuilder = null, ReindexRuleProductPrice $reindexRuleProductPrice = null, RuleProductPricesPersistor $pricesPersistor = null, - \Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher $activeTableSwitcher = null, + ActiveTableSwitcher $activeTableSwitcher = null, ProductLoader $productLoader = null, - TableSwapper $tableSwapper = null + TableSwapper $tableSwapper = null, + TimezoneInterface $localeDate = null ) { $this->resource = $resource; $this->connection = $resource->getConnection(); @@ -224,19 +242,22 @@ public function __construct( RuleProductPricesPersistor::class ); $this->activeTableSwitcher = $activeTableSwitcher ?? ObjectManager::getInstance()->get( - \Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher::class + ActiveTableSwitcher::class ); $this->productLoader = $productLoader ?? ObjectManager::getInstance()->get( ProductLoader::class ); $this->tableSwapper = $tableSwapper ?? ObjectManager::getInstance()->get(TableSwapper::class); + $this->localeDate = $localeDate ?? + ObjectManager::getInstance()->get(TimezoneInterface::class); } /** * Reindex by id * * @param int $id + * @throws LocalizedException * @return void * @api */ @@ -254,7 +275,7 @@ public function reindexById($id) $this->reindexRuleGroupWebsite->execute(); } catch (\Exception $e) { $this->critical($e); - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __('Catalog rule indexing failed. See details in exception log.') ); } @@ -264,7 +285,7 @@ public function reindexById($id) * Reindex by ids * * @param array $ids - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException * @return void * @api */ @@ -274,7 +295,7 @@ public function reindexByIds(array $ids) $this->doReindexByIds($ids); } catch (\Exception $e) { $this->critical($e); - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __("Catalog rule indexing failed. See details in exception log.") ); } @@ -308,7 +329,7 @@ protected function doReindexByIds($ids) /** * Full reindex * - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException * @return void * @api */ @@ -318,7 +339,7 @@ public function reindexFull() $this->doReindexFull(); } catch (\Exception $e) { $this->critical($e); - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __("Catalog rule indexing failed. See details in exception log.") ); } @@ -404,9 +425,6 @@ private function assignProductToRule(Rule $rule, int $productEntityId, array $we ); $customerGroupIds = $rule->getCustomerGroupIds(); - $fromTime = strtotime($rule->getFromDate()); - $toTime = strtotime($rule->getToDate()); - $toTime = $toTime ? $toTime + self::SECONDS_IN_DAY - 1 : 0; $sortOrder = (int)$rule->getSortOrder(); $actionOperator = $rule->getSimpleAction(); $actionAmount = $rule->getDiscountAmount(); @@ -414,6 +432,15 @@ private function assignProductToRule(Rule $rule, int $productEntityId, array $we $rows = []; foreach ($websiteIds as $websiteId) { + $scopeTz = new \DateTimeZone( + $this->localeDate->getConfigTimezone(ScopeInterface::SCOPE_WEBSITE, $websiteId) + ); + $fromTime = $rule->getFromDate() + ? (new \DateTime($rule->getFromDate(), $scopeTz))->getTimestamp() + : 0; + $toTime = $rule->getToDate() + ? (new \DateTime($rule->getToDate(), $scopeTz))->getTimestamp() + IndexBuilder::SECONDS_IN_DAY - 1 + : 0; foreach ($customerGroupIds as $customerGroupId) { $rows[] = [ 'rule_id' => $ruleId, diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexerTableSwapper.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexerTableSwapper.php index f99f8c50a7f9a..0ddae74ff0a55 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexerTableSwapper.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexerTableSwapper.php @@ -122,4 +122,14 @@ public function swapIndexTables(array $originalTablesNames) $this->resourceConnection->getConnection()->dropTable($tableName); } } + + /** + * Cleanup leftover temporary tables + */ + public function __destruct() + { + foreach ($this->temporaryTables as $tableName) { + $this->resourceConnection->getConnection()->dropTable($tableName); + } + } } diff --git a/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProduct.php b/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProduct.php index 3e2301f34c4f8..ff9893ae1b906 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProduct.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProduct.php @@ -107,6 +107,11 @@ public function execute(Rule $rule, $batchCount, $useAdditionalTable = false) $actionStop = $rule->getStopRulesProcessing(); $fromTimeInAdminTz = $this->parseDateByWebsiteTz((string)$rule->getFromDate(), self::ADMIN_WEBSITE_ID); $toTimeInAdminTz = $this->parseDateByWebsiteTz((string)$rule->getToDate(), self::ADMIN_WEBSITE_ID); + $excludedWebsites = []; + $ruleExtensionAttributes = $rule->getExtensionAttributes(); + if ($ruleExtensionAttributes && $ruleExtensionAttributes->getExcludeWebsiteIds()) { + $excludedWebsites = $ruleExtensionAttributes->getExcludeWebsiteIds(); + } $rows = []; foreach ($websiteIds as $websiteId) { @@ -124,22 +129,26 @@ public function execute(Rule $rule, $batchCount, $useAdditionalTable = false) } foreach ($customerGroupIds as $customerGroupId) { - $rows[] = [ - 'rule_id' => $ruleId, - 'from_time' => $fromTime, - 'to_time' => $toTime, - 'website_id' => $websiteId, - 'customer_group_id' => $customerGroupId, - 'product_id' => $productId, - 'action_operator' => $actionOperator, - 'action_amount' => $actionAmount, - 'action_stop' => $actionStop, - 'sort_order' => $sortOrder, - ]; - - if (count($rows) == $batchCount) { - $connection->insertMultiple($indexTable, $rows); - $rows = []; + if (!array_key_exists($customerGroupId, $excludedWebsites) + || !in_array((int)$websiteId, array_values($excludedWebsites[$customerGroupId]), true) + ) { + $rows[] = [ + 'rule_id' => $ruleId, + 'from_time' => $fromTime, + 'to_time' => $toTime, + 'website_id' => $websiteId, + 'customer_group_id' => $customerGroupId, + 'product_id' => $productId, + 'action_operator' => $actionOperator, + 'action_amount' => $actionAmount, + 'action_stop' => $actionStop, + 'sort_order' => $sortOrder, + ]; + + if (count($rows) === $batchCount) { + $connection->insertMultiple($indexTable, $rows); + $rows = []; + } } } } diff --git a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule/Collection.php b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule/Collection.php index fdc039067cc3d..f7a01de2d2774 100644 --- a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule/Collection.php +++ b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule/Collection.php @@ -5,8 +5,8 @@ */ namespace Magento\CatalogRule\Model\ResourceModel\Rule; -use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Serialize\Serializer\Json; class Collection extends \Magento\Rule\Model\ResourceModel\Rule\Collection\AbstractCollection { @@ -22,6 +22,16 @@ class Collection extends \Magento\Rule\Model\ResourceModel\Rule\Collection\Abstr */ protected $serializer; + /** + * @var string + */ + protected $_eventPrefix = 'catalog_rule_collection'; + + /** + * @var string + */ + protected $_eventObject = 'catalog_rule'; + /** * Collection constructor. * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory diff --git a/app/code/Magento/CatalogRule/Model/Rule.php b/app/code/Magento/CatalogRule/Model/Rule.php index 2d92192368960..da32801ace477 100644 --- a/app/code/Magento/CatalogRule/Model/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Rule.php @@ -589,7 +589,7 @@ protected function _invalidateCache() */ public function afterSave() { - if (!$this->getIsActive()) { + if (!$this->getIsActive() && !$this->getOrigData(self::IS_ACTIVE)) { return parent::afterSave(); } @@ -601,6 +601,7 @@ public function afterSave() } else { $this->_ruleProductProcessor->getIndexer()->invalidate(); } + return parent::afterSave(); } diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCatalogPriceRuleDeleteAllActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCatalogPriceRuleDeleteAllActionGroup.xml index 27edab962033e..d16255e0237b3 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCatalogPriceRuleDeleteAllActionGroup.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCatalogPriceRuleDeleteAllActionGroup.xml @@ -16,7 +16,7 @@ <!-- It sometimes is loading too long for default 10s --> <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded"/> <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <helper class="\Magento\Rule\Test\Mftf\Helper\RuleHelper" method="deleteAllRulesOneByOne" stepKey="deleteAllRulesOneByOne"> + <helper class="Magento\Rule\Test\Mftf\Helper\RuleHelper" method="deleteAllRulesOneByOne" stepKey="deleteAllRulesOneByOne"> <argument name="firstNotEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow}}</argument> <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml index 3109c56122d1b..c49b31ad47342 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml @@ -78,16 +78,14 @@ <!-- 3. Save and apply the new catalog price rule --> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- 4. Verify the storefront --> - <amOnPage url="$$createCategoryOne.name$$.html" stepKey="goToCategoryOne"/> + <amOnPage url="$$createCategoryOne.custom_attributes[url_key]$$.html" stepKey="goToCategoryOne"/> <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$$createSimpleProductOne.name$$" stepKey="seeProductOne"/> <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$61.50" stepKey="seeProductOnePrice"/> <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="Regular Price $123.00" stepKey="seeProductOneRegularPrice"/> - <amOnPage url="$$createCategoryTwo.name$$.html" stepKey="goToCategoryTwo"/> + <amOnPage url="$$createCategoryTwo.custom_attributes[url_key]$$.html" stepKey="goToCategoryTwo"/> <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$$createSimpleProductTwo.name$$" stepKey="seeProductTwo"/> <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$123.00" stepKey="seeProductTwoPrice"/> <dontSee selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$61.50" stepKey="dontSeeDiscount"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml index 97e93c8f762c5..26e1966ece365 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml @@ -127,9 +127,7 @@ <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Open Storefront product page and assert created configurable product --> <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml index 946a25d721cba..843bc4e722e65 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml @@ -25,9 +25,7 @@ </createData> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- log in and create the price rule --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> @@ -49,13 +47,13 @@ </after> <!-- Go to category page and make sure that all of the prices are correct --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToCategoryPage"/> <waitForPageLoad stepKey="waitForCategory"/> <see stepKey="seeOldPrice" selector="{{StorefrontCategoryProductSection.ProductOldPriceByNumber('1')}}" userInput="$$createProduct.price$$"/> <see stepKey="seeNewPrice" selector="{{StorefrontCategoryProductSection.ProductSpecialPriceByNumber('1')}}" userInput="$110.70"/> <!-- Go to the simple product page and check that the prices are correct --> - <amOnPage stepKey="goToProductPage" url="$$createProduct.sku$$.html"/> + <amOnPage stepKey="goToProductPage" url="$$createProduct.custom_attributes[url_key]$$.html"/> <waitForPageLoad stepKey="waitForProductPage"/> <see stepKey="seeOldPriceTag" selector="{{StorefrontProductInfoMainSection.oldPriceTag}}" userInput="Regular Price"/> <see stepKey="seeOldPrice2" selector="{{StorefrontProductInfoMainSection.oldPriceAmount}}" userInput="$$createProduct.price$$"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml index e55cabd506466..a6a735bb81de8 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml @@ -49,9 +49,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- As a NOT LOGGED IN user, go to the storefront category page and should see the discount --> <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToCategory1"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml index 831470e0d64ca..c6a3291561fa1 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml @@ -72,9 +72,7 @@ </createData> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> @@ -115,12 +113,10 @@ <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." stepKey="seeDeletedRuleMessage1"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Assert that the rule isn't present on the Category page --> - <amOnPage url="$$createCategory1.name$$.html" stepKey="goToStorefrontCategoryPage1"/> + <amOnPage url="$$createCategory1.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage1"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <see selector="{{StorefrontCategoryProductSection.ProductPriceByName($$createConfigProduct1.name$$)}}" userInput="$$createConfigChildProduct1.price$$" stepKey="seeRegularPriceText1"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml index 5a62b1a373f94..c6452612f82a4 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml @@ -60,18 +60,16 @@ <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." stepKey="seeDeletedRuleMessage1"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Assert that the rule isn't present on the Category page --> - <amOnPage url="$$createCategory1.name$$.html" stepKey="goToStorefrontCategoryPage1"/> + <amOnPage url="$$createCategory1.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage1"/> <waitForPageLoad stepKey="waitForPageLoad3"/> <dontSee selector="{{StorefrontCategoryProductSection.ProductCatalogRulePriceTitleByName($$createProduct1.name$$)}}" userInput="Regular Price" stepKey="dontSeeRegularPriceText1"/> <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName($$createProduct1.name$$)}}" stepKey="dontSeeSpecialPrice1"/> <!-- Assert that the rule isn't present on the Product page --> - <amOnPage url="$$createProduct1.name$$.html" stepKey="goToStorefrontProductPage1"/> + <amOnPage url="$$createProduct1.custom_attributes[url_key]$$.html" stepKey="goToStorefrontProductPage1"/> <waitForPageLoad stepKey="waitForPageLoad4"/> <dontSee selector="{{StorefrontProductInfoMainSection.oldPriceTag}}" userInput="Regular Price" stepKey="dontSeeRegularPRiceText2"/> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createProduct1.price$$" stepKey="seeTrueProductPrice1"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index d03ca6b22d66a..333c4ab06aad1 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -38,6 +38,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToCatalogRuleGridPage"/> <waitForPageLoad stepKey="waitForCatalogRuleGridPageLoaded"/> @@ -52,7 +61,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> <!-- Verify that category page shows the discount --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToCategoryPage1"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToCategoryPage1"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(ApiSimpleProduct.name)}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct1"/> <see selector="{{StorefrontCategoryProductSection.ProductPriceByName(ApiSimpleProduct.name)}}" userInput="$110.70" stepKey="seeSimpleProductDiscount1"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(_defaultProduct.name)}}" userInput="{{_defaultProduct.name}}" stepKey="seeConfigurableProduct1"/> @@ -86,12 +95,10 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="catalog_product_price"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Verify that category page shows the original prices --> - <amOnPage url="$$createCategory.name$$.html" stepKey="goToCategoryPage2"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="goToCategoryPage2"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(ApiSimpleProduct.name)}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct2"/> <see selector="{{StorefrontCategoryProductSection.ProductPriceByName(ApiSimpleProduct.name)}}" userInput="$123.00" stepKey="seeSimpleProductDiscount2"/> <see selector="{{StorefrontCategoryProductSection.ProductTitleByName(_defaultProduct.name)}}" userInput="{{_defaultProduct.name}}" stepKey="seeConfigurableProduct2"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml index da62981c99202..1951aa6c0f6a8 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml @@ -80,9 +80,7 @@ </actionGroup> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="clickSaveAndApplyRules"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Check Catalog Price Rule for first product--> <amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToFirstProductPage"/> @@ -128,9 +126,7 @@ </actionGroup> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="clickSaveAndApplyRules1"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexSecondTime"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheSecondTime"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheSecondTime"/> <!--Check Catalog Price Rule for third product--> <amOnPage url="{{StorefrontProductPage.url($$createThirdProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToThirdProductPage"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml index 6de7bba59c340..0e1059f2f5f18 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml @@ -234,19 +234,17 @@ <!-- Run cron --> <magentoCron stepKey="runAllCronJobs"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Go to Frontend and open the simple product --> - <amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.sku$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> <!-- Verify Price for simple product with specialColor green=$20 --> <see userInput="20.00" selector="{{StorefrontProductInfoMainSection.updatedPrice}}" stepKey="seePrice20"/> <!-- Go to Frontend and Open the Configurable product --> - <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.sku$$)}}" stepKey="amOnConfigProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$)}}" stepKey="amOnConfigProductPage"/> <waitForPageLoad stepKey="waitForConfigProductPageLoad"/> <!-- Verify Price for configurable product with specialColor green=$30 --> @@ -259,7 +257,7 @@ <see userInput="30.00" selector="{{StorefrontProductInfoMainSection.updatedPrice}}" stepKey="seeOption2Price30"/> <!-- Go to Frontend and open the second simple product --> - <amOnPage url="{{StorefrontProductPage.url($$createSecondProduct.sku$$)}}" stepKey="amOnSecondProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSecondProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSecondProductPage"/> <waitForPageLoad stepKey="waitForSecondProductPageLoad"/> <!-- Verify Price for simple product with specialColor red=$40 --> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml index c3690e72e084f..b1d6935bec28d 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml @@ -113,12 +113,10 @@ <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Navigate to category on store front --> - <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontProductPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/> <!-- Sort products By Price --> <actionGroup ref="StorefrontCategoryPageSortProductActionGroup" stepKey="sortProductByPrice"/> @@ -156,7 +154,7 @@ </actionGroup> <!-- Navigate to simple product on store front --> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.name$)}}" stepKey="goToProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.custom_attributes[url_key]$)}}" stepKey="goToProductPage1"/> <!-- Assert regular and special price after selecting ProductOptionValueDropdown1 --> <actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertStorefrontProductPrices"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml index ece8dc4bacf28..6d8de2cb1d9bb 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml @@ -64,15 +64,11 @@ <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Navigate to category on store front --> - <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontProductPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/> <!-- Check product 1 name on store front category page --> <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProduct1Name"> @@ -93,7 +89,7 @@ </actionGroup> <!-- Navigate to product 1 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createProduct1.name$)}}" stepKey="goToProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct1.custom_attributes[url_key]$)}}" stepKey="goToProductPage1"/> <!-- Assert regular and special price after selecting ProductOptionValueDropdown1 --> <actionGroup ref="StorefrontSelectCustomOptionRadioAndAssertPricesActionGroup" stepKey="storefrontSelectCustomOptionAndAssertPrices1"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml index 3b7c9c181f1b1..ba446380a4f63 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml @@ -40,7 +40,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Customer Log Out --> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> - + <!-- Delete customer --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> @@ -74,7 +74,7 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Navigate to category on store front --> - <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontProductPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/> <!-- Check product 1 name on store front category page --> <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProductName"> @@ -95,7 +95,7 @@ </actionGroup> <!-- Navigate to product 1 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.name$)}}" stepKey="goToProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.custom_attributes[url_key]$)}}" stepKey="goToProductPage"/> <!-- Add product 1 to cart --> <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="cartAddSimpleProductToCart"> @@ -113,7 +113,7 @@ </actionGroup> <!-- Navigate to category on store front as customer--> - <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPageAsCustomer"/> + <amOnPage url="{{StorefrontProductPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPageAsCustomer"/> <!-- Check simple product name on store front category page --> <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProductNameAsCustomer"> @@ -134,7 +134,7 @@ </actionGroup> <!-- Navigate to simple product on store front as customer --> - <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.name$)}}" stepKey="goToProductPage1AsCustomer"/> + <amOnPage url="{{StorefrontProductPage.url($createSimpleProduct.custom_attributes[url_key]$)}}" stepKey="goToProductPage1AsCustomer"/> <!-- Assert regular and special price as customer--> <actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertStorefrontProductPrices"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml index 45e97f179a11f..77b10a09d6ce0 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml @@ -71,15 +71,11 @@ <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Navigate to category on store front --> - <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontProductPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/> <!-- Check product 1 price on store front category page --> <see selector="{{StorefrontCategoryProductSection.ProductInfoByName($createProduct1.name$)}}" userInput="$51.10" stepKey="storefrontProduct1Price"/> @@ -100,7 +96,7 @@ <see selector="{{StorefrontCategoryProductSection.ProductInfoByName($createProduct3.name$)}}" userInput="$56.78" stepKey="storefrontProduct3RegularPrice"/> <!-- Navigate to product 1 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createProduct1.name$)}}" stepKey="goToProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct1.custom_attributes[url_key]$)}}" stepKey="goToProductPage1"/> <!-- Assert regular and special price after selecting ProductOptionValueDropdown1 --> <actionGroup ref="StorefrontSelectCustomOptionDropDownAndAssertPricesActionGroup" stepKey="storefrontSelectCustomOptionAndAssertPrices1"> @@ -115,7 +111,7 @@ </actionGroup> <!-- Navigate to product 2 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createProduct1.name$)}}" stepKey="goToProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct1.custom_attributes[url_key]$)}}" stepKey="goToProductPage2"/> <!-- Assert regular and special price after selecting ProductOptionValueDropdown3 --> <actionGroup ref="StorefrontSelectCustomOptionDropDownAndAssertPricesActionGroup" stepKey="storefrontSelectCustomOptionAndAssertPrices2"> @@ -130,7 +126,7 @@ </actionGroup> <!-- Navigate to product 3 on store front --> - <amOnPage url="{{StorefrontProductPage.url($createProduct3.name$)}}" stepKey="goToProductPage3"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct3.custom_attributes[url_key]$)}}" stepKey="goToProductPage3"/> <!-- Add product 3 to cart with no custom option --> <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="cartAddSimpleProduct3ToCart"> diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductTest.php index 50f4eb0805ed2..fff8a80c88e3d 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductTest.php @@ -5,7 +5,6 @@ */ declare(strict_types=1); - namespace Magento\CatalogRule\Test\Unit\Model\Indexer; use Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher; @@ -33,11 +32,6 @@ class ReindexRuleProductTest extends TestCase */ private $resourceMock; - /** - * @var ActiveTableSwitcher|MockObject - */ - private $activeTableSwitcherMock; - /** * @var IndexerTableSwapperInterface|MockObject */ @@ -48,44 +42,56 @@ class ReindexRuleProductTest extends TestCase */ private $localeDateMock; + /** + * @var AdapterInterface|MockObject + */ + private $connectionMock; + + /** + * @var Rule|MockObject + */ + private $ruleMock; + protected function setUp(): void { $this->resourceMock = $this->createMock(ResourceConnection::class); - $this->activeTableSwitcherMock = $this->createMock(ActiveTableSwitcher::class); + $activeTableSwitcherMock = $this->createMock(ActiveTableSwitcher::class); $this->tableSwapperMock = $this->getMockForAbstractClass(IndexerTableSwapperInterface::class); $this->localeDateMock = $this->getMockForAbstractClass(TimezoneInterface::class); + $this->connectionMock = $this->getMockForAbstractClass(AdapterInterface::class); + $this->ruleMock = $this->createMock(Rule::class); $this->model = new ReindexRuleProduct( $this->resourceMock, - $this->activeTableSwitcherMock, + $activeTableSwitcherMock, $this->tableSwapperMock, $this->localeDateMock, true ); } - public function testExecuteIfRuleInactive() + public function testExecuteIfRuleInactive(): void { $ruleMock = $this->createMock(Rule::class); - $ruleMock->expects($this->once()) + $ruleMock->expects(self::once()) ->method('getIsActive') ->willReturn(false); - $this->assertFalse($this->model->execute($ruleMock, 100, true)); + self::assertFalse($this->model->execute($ruleMock, 100, true)); } - public function testExecuteIfRuleWithoutWebsiteIds() + public function testExecuteIfRuleWithoutWebsiteIds(): void { $ruleMock = $this->createMock(Rule::class); - $ruleMock->expects($this->once()) + $ruleMock->expects(self::once()) ->method('getIsActive') ->willReturn(true); - $ruleMock->expects($this->once()) + $ruleMock->expects(self::once()) ->method('getWebsiteIds') ->willReturn(null); - $this->assertFalse($this->model->execute($ruleMock, 100, true)); + self::assertFalse($this->model->execute($ruleMock, 100, true)); } - public function testExecute() + public function testExecute(): void { $websiteId = 3; $adminTimeZone = 'America/Chicago'; @@ -96,36 +102,8 @@ public function testExecute() 6 => [$websiteId => 1], ]; - $this->tableSwapperMock->expects($this->once()) - ->method('getWorkingTableName') - ->with('catalogrule_product') - ->willReturn('catalogrule_product_replica'); - - $connectionMock = $this->getMockForAbstractClass(AdapterInterface::class); - $this->resourceMock->expects($this->at(0)) - ->method('getConnection') - ->willReturn($connectionMock); - $this->resourceMock->expects($this->at(1)) - ->method('getTableName') - ->with('catalogrule_product') - ->willReturn('catalogrule_product'); - $this->resourceMock->expects($this->at(2)) - ->method('getTableName') - ->with('catalogrule_product_replica') - ->willReturn('catalogrule_product_replica'); - - $ruleMock = $this->createMock(Rule::class); - $ruleMock->expects($this->once())->method('getIsActive')->willReturn(true); - $ruleMock->expects($this->exactly(2))->method('getWebsiteIds')->willReturn([$websiteId]); - $ruleMock->expects($this->once())->method('getMatchingProductIds')->willReturn($productIds); - $ruleMock->expects($this->once())->method('getId')->willReturn(100); - $ruleMock->expects($this->once())->method('getCustomerGroupIds')->willReturn([10]); - $ruleMock->expects($this->atLeastOnce())->method('getFromDate')->willReturn('2017-06-21'); - $ruleMock->expects($this->atLeastOnce())->method('getToDate')->willReturn('2017-06-30'); - $ruleMock->expects($this->once())->method('getSortOrder')->willReturn(1); - $ruleMock->expects($this->once())->method('getSimpleAction')->willReturn('simple_action'); - $ruleMock->expects($this->once())->method('getDiscountAmount')->willReturn(43); - $ruleMock->expects($this->once())->method('getStopRulesProcessing')->willReturn(true); + $this->prepareResourceMock(); + $this->prepareRuleMock([3], $productIds, [10]); $this->localeDateMock->method('getConfigTimezone') ->willReturnMap([ @@ -175,13 +153,141 @@ public function testExecute() ] ]; - $connectionMock->expects($this->at(0)) + $this->connectionMock->expects(self::at(0)) ->method('insertMultiple') ->with('catalogrule_product_replica', $batchRows); - $connectionMock->expects($this->at(1)) + $this->connectionMock->expects(self::at(1)) ->method('insertMultiple') ->with('catalogrule_product_replica', $rowsNotInBatch); - $this->assertTrue($this->model->execute($ruleMock, 2, true)); + self::assertTrue($this->model->execute($this->ruleMock, 2, true)); + } + + public function testExecuteWithExcludedWebsites(): void + { + $websitesIds = [1, 2, 3]; + $adminTimeZone = 'America/Chicago'; + $websiteTz = 'America/Los_Angeles'; + $productIds = [ + 1 => [1 => 1], + 2 => [2 => 1], + 3 => [3 => 1], + ]; + + $this->prepareResourceMock(); + $this->prepareRuleMock($websitesIds, $productIds, [10, 20]); + + $extensionAttributes = $this->getMockBuilder(\Magento\Framework\Api\ExtensionAttributesInterface::class) + ->setMethods(['getExtensionAttributes', 'getExcludeWebsiteIds']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->ruleMock->expects(self::once())->method('getExtensionAttributes') + ->willReturn($extensionAttributes); + $extensionAttributes->expects(self::exactly(2))->method('getExcludeWebsiteIds') + ->willReturn([10 => [1, 2]]); + + $this->localeDateMock->method('getConfigTimezone') + ->willReturnMap([ + [ScopeInterface::SCOPE_WEBSITE, self::ADMIN_WEBSITE_ID, $adminTimeZone], + [ScopeInterface::SCOPE_WEBSITE, 1, $websiteTz], + [ScopeInterface::SCOPE_WEBSITE, 2, $websiteTz], + [ScopeInterface::SCOPE_WEBSITE, 3, $websiteTz], + ]); + + $batchRows = [ + [ + 'rule_id' => 100, + 'from_time' => 1498028400, + 'to_time' => 1498892399, + 'website_id' => 1, + 'customer_group_id' => 20, + 'product_id' => 1, + 'action_operator' => 'simple_action', + 'action_amount' => 43, + 'action_stop' => true, + 'sort_order' => 1, + ], + [ + 'rule_id' => 100, + 'from_time' => 1498028400, + 'to_time' => 1498892399, + 'website_id' => 2, + 'customer_group_id' => 20, + 'product_id' => 2, + 'action_operator' => 'simple_action', + 'action_amount' => 43, + 'action_stop' => true, + 'sort_order' => 1, + ], + [ + 'rule_id' => 100, + 'from_time' => 1498028400, + 'to_time' => 1498892399, + 'website_id' => 3, + 'customer_group_id' => 10, + 'product_id' => 3, + 'action_operator' => 'simple_action', + 'action_amount' => 43, + 'action_stop' => true, + 'sort_order' => 1, + ], + [ + 'rule_id' => 100, + 'from_time' => 1498028400, + 'to_time' => 1498892399, + 'website_id' => 3, + 'customer_group_id' => 20, + 'product_id' => 3, + 'action_operator' => 'simple_action', + 'action_amount' => 43, + 'action_stop' => true, + 'sort_order' => 1, + ] + ]; + + $this->connectionMock->expects(self::at(0)) + ->method('insertMultiple') + ->with('catalogrule_product_replica', $batchRows); + + self::assertTrue($this->model->execute($this->ruleMock, 100, true)); + } + + private function prepareResourceMock(): void + { + $this->tableSwapperMock->expects(self::once()) + ->method('getWorkingTableName') + ->with('catalogrule_product') + ->willReturn('catalogrule_product_replica'); + $this->resourceMock->expects(self::at(0)) + ->method('getConnection') + ->willReturn($this->connectionMock); + $this->resourceMock->expects(self::at(1)) + ->method('getTableName') + ->with('catalogrule_product') + ->willReturn('catalogrule_product'); + $this->resourceMock->expects(self::at(2)) + ->method('getTableName') + ->with('catalogrule_product_replica') + ->willReturn('catalogrule_product_replica'); + } + + /** + * @param array $websiteId + * @param array $productIds + * @param array $customerGroupIds + */ + private function prepareRuleMock(array $websiteId, array $productIds, array $customerGroupIds): void + { + $this->ruleMock->expects(self::once())->method('getIsActive')->willReturn(true); + $this->ruleMock->expects(self::exactly(2))->method('getWebsiteIds')->willReturn($websiteId); + $this->ruleMock->expects(self::once())->method('getMatchingProductIds')->willReturn($productIds); + $this->ruleMock->expects(self::once())->method('getId')->willReturn(100); + $this->ruleMock->expects(self::once())->method('getCustomerGroupIds')->willReturn($customerGroupIds); + $this->ruleMock->expects(self::atLeastOnce())->method('getFromDate')->willReturn('2017-06-21'); + $this->ruleMock->expects(self::atLeastOnce())->method('getToDate')->willReturn('2017-06-30'); + $this->ruleMock->expects(self::once())->method('getSortOrder')->willReturn(1); + $this->ruleMock->expects(self::once())->method('getSimpleAction')->willReturn('simple_action'); + $this->ruleMock->expects(self::once())->method('getDiscountAmount')->willReturn(43); + $this->ruleMock->expects(self::once())->method('getStopRulesProcessing')->willReturn(true); } } diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/RuleTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/RuleTest.php index e6d2fc78b2aeb..0649cfc6112cc 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/RuleTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Model/RuleTest.php @@ -9,6 +9,7 @@ use Magento\Catalog\Model\Product; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; +use Magento\CatalogRule\Api\Data\RuleInterface; use Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor; use Magento\CatalogRule\Model\Rule; use Magento\CatalogRule\Model\Rule\Condition\CombineFactory; @@ -31,46 +32,60 @@ */ class RuleTest extends TestCase { - /** @var Rule */ - protected $rule; + /** + * @var Rule + */ + private $rule; - /** @var ObjectManager */ + /** + * @var ObjectManager + */ private $objectManager; - /** @var StoreManagerInterface|MockObject */ - protected $storeManager; + /** + * @var StoreManagerInterface|MockObject + */ + private $storeManager; - /** @var MockObject */ - protected $combineFactory; + /** + * @var CombineFactory|MockObject + */ + private $combineFactory; - /** @var Store|MockObject */ - protected $storeModel; + /** + * @var Store|MockObject + */ + private $storeModel; - /** @var Website|MockObject */ - protected $websiteModel; + /** + * @var Website|MockObject + */ + private $websiteModel; - /** @var Combine|MockObject */ - protected $condition; + /** + * @var Combine|MockObject + */ + private $condition; /** * @var RuleProductProcessor|MockObject */ - protected $_ruleProductProcessor; + private $_ruleProductProcessor; /** * @var CollectionFactory|MockObject */ - protected $_productCollectionFactory; + private $_productCollectionFactory; /** * @var Iterator|MockObject */ - protected $_resourceIterator; + private $_resourceIterator; /** * @var Product|MockObject */ - protected $productModel; + private $productModel; /** * Set up before test @@ -85,7 +100,7 @@ protected function setUp(): void $this->combineFactory = $this->createPartialMock( CombineFactory::class, [ - 'create' + 'create', ] ); $this->productModel = $this->createPartialMock( @@ -93,7 +108,7 @@ protected function setUp(): void [ '__wakeup', 'getId', - 'setData' + 'setData', ] ); $this->condition = $this->getMockBuilder(Combine::class) @@ -106,7 +121,7 @@ protected function setUp(): void [ '__wakeup', 'getId', - 'getDefaultStore' + 'getDefaultStore', ] ); $this->_ruleProductProcessor = $this->createMock( @@ -192,7 +207,7 @@ public function testCallbackValidateProduct($validate) 'has_options' => '0', 'required_options' => '0', 'created_at' => '2014-06-25 13:14:30', - 'updated_at' => '2014-06-25 14:37:15' + 'updated_at' => '2014-06-25 14:37:15', ]; $this->storeManager->expects($this->any())->method('getWebsites')->with(false) ->willReturn([$this->websiteModel, $this->websiteModel]); @@ -263,14 +278,14 @@ public function validateDataDataProvider() 'simple_action' => 'by_fixed', 'discount_amount' => '123', ], - true + true, ], [ [ 'simple_action' => 'by_percent', 'discount_amount' => '9,99', ], - true + true, ], [ [ @@ -279,7 +294,7 @@ public function validateDataDataProvider() ], [ 'Percentage discount should be between 0 and 100.', - ] + ], ], [ [ @@ -288,7 +303,7 @@ public function validateDataDataProvider() ], [ 'Percentage discount should be between 0 and 100.', - ] + ], ], [ [ @@ -297,7 +312,7 @@ public function validateDataDataProvider() ], [ 'Discount value should be 0 or greater.', - ] + ], ], [ [ @@ -306,7 +321,7 @@ public function validateDataDataProvider() ], [ 'Unknown action.', - ] + ], ], ]; } @@ -325,33 +340,48 @@ public function testAfterDelete() } /** - * Test after update action for inactive rule + * Test after update action for active and deactivated rule. * + * @dataProvider afterUpdateDataProvider + * @param int $active * @return void */ - public function testAfterUpdateInactive() + public function testAfterUpdate(int $active) { $this->rule->isObjectNew(false); - $this->rule->setIsActive(0); - $this->_ruleProductProcessor->expects($this->never())->method('getIndexer'); + $this->rule->setIsActive($active); + $this->rule->setOrigData(RuleInterface::IS_ACTIVE, 1); + $indexer = $this->getMockForAbstractClass(IndexerInterface::class); + $indexer->expects($this->once())->method('invalidate'); + $this->_ruleProductProcessor->expects($this->once())->method('getIndexer')->willReturn($indexer); $this->rule->afterSave(); } /** - * Test after update action for active rule + * Test after update action for inactive rule. * * @return void */ - public function testAfterUpdateActive() + public function testAfterUpdateInactiveRule() { $this->rule->isObjectNew(false); - $this->rule->setIsActive(1); - $indexer = $this->getMockForAbstractClass(IndexerInterface::class); - $indexer->expects($this->once())->method('invalidate'); - $this->_ruleProductProcessor->expects($this->once())->method('getIndexer')->willReturn($indexer); + $this->rule->setIsActive(0); + $this->rule->setOrigData(RuleInterface::IS_ACTIVE, 0); + $this->_ruleProductProcessor->expects($this->never())->method('getIndexer'); $this->rule->afterSave(); } + /** + * @return array + */ + public function afterUpdateDataProvider(): array + { + return [ + ['active' => 0], + ['active' => 1], + ]; + } + /** * Test isRuleBehaviorChanged action * diff --git a/app/code/Magento/CatalogRule/etc/extension_attributes.xml b/app/code/Magento/CatalogRule/etc/extension_attributes.xml new file mode 100644 index 0000000000000..78568d8961ade --- /dev/null +++ b/app/code/Magento/CatalogRule/etc/extension_attributes.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> + <extension_attributes for="Magento\CatalogRule\Api\Data\RuleInterface"> + <attribute code="exclude_website_ids" type="int[]" /> + </extension_attributes> +</config> diff --git a/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml b/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml index 59e3c4668e8a4..64bc5efe8e385 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml @@ -133,7 +133,7 @@ </validation> <dataType>number</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link> + <link>https://docs.magento.com/user-guide/configuration/scope.html</link> <description>What is this?</description> </tooltip> <label translate="true">Websites</label> diff --git a/app/code/Magento/CatalogSearch/Model/Attribute/SearchWeight.php b/app/code/Magento/CatalogSearch/Model/Attribute/SearchWeight.php index fa42cadb8a2fa..840eb147a86fd 100644 --- a/app/code/Magento/CatalogSearch/Model/Attribute/SearchWeight.php +++ b/app/code/Magento/CatalogSearch/Model/Attribute/SearchWeight.php @@ -15,6 +15,11 @@ */ class SearchWeight { + /** + * @var \Magento\Framework\Search\Request\Config + */ + private $config; + /** * @param \Magento\Framework\Search\Request\Config $config */ diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php index 849137b57b52c..603a5c8a4793d 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php @@ -111,7 +111,7 @@ class Fulltext implements * @param array $data * @param ProcessManager|null $processManager * @param int|null $batchSize - * @param DeploymentConfig $deploymentConfig + * @param DeploymentConfig|null $deploymentConfig * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( @@ -182,7 +182,7 @@ public function executeByDimensions(array $dimensions, \Traversable $entityIds = $i = 0; $this->batchSize = $this->deploymentConfig->get( - self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . self::INDEXER_ID + self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . self::INDEXER_ID . '/partial_reindex' ) ?? $this->batchSize; foreach ($entityIds as $entityId) { diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php index 3ce8a96fb5070..59bdd0e47327a 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php @@ -7,6 +7,7 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\CatalogSearch\Model\Indexer\Fulltext; +use Magento\Framework\App\DeploymentConfig; use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResourceConnection; @@ -199,6 +200,19 @@ class Full private $batchSize; /** + * @var DeploymentConfig|null + */ + private $deploymentConfig; + + /** + * Deployment config path + * + * @var string + */ + private const DEPLOYMENT_CONFIG_INDEXER_BATCHES = 'indexer/batch_size/'; + + /** + * Full constructor. * @param ResourceConnection $resource * @param \Magento\Catalog\Model\Product\Type $catalogProductType * @param \Magento\Eav\Model\Config $eavConfig @@ -216,10 +230,12 @@ class Full * @param \Magento\CatalogSearch\Model\ResourceModel\Fulltext $fulltextResource * @param \Magento\Framework\Search\Request\DimensionFactory $dimensionFactory * @param \Magento\Framework\Indexer\ConfigInterface $indexerConfig - * @param mixed $indexIteratorFactory + * @param null $indexIteratorFactory * @param \Magento\Framework\EntityManager\MetadataPool|null $metadataPool * @param DataProvider|null $dataProvider * @param int $batchSize + * @param DeploymentConfig|null $deploymentConfig + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -244,7 +260,8 @@ public function __construct( $indexIteratorFactory = null, \Magento\Framework\EntityManager\MetadataPool $metadataPool = null, DataProvider $dataProvider = null, - $batchSize = 500 + $batchSize = 500, + ?DeploymentConfig $deploymentConfig = null ) { $this->resource = $resource; $this->connection = $resource->getConnection(); @@ -268,6 +285,7 @@ public function __construct( ->get(\Magento\Framework\EntityManager\MetadataPool::class); $this->dataProvider = $dataProvider ?: ObjectManager::getInstance()->get(DataProvider::class); $this->batchSize = $batchSize; + $this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class); } /** @@ -360,6 +378,9 @@ public function rebuildStoreIndex($storeId, $productIds = null) ]; $lastProductId = 0; + $this->batchSize = $this->deploymentConfig->get( + self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . Fulltext::INDEXER_ID . '/mysql_get' + ) ?? $this->batchSize; $products = $this->dataProvider ->getSearchableProducts($storeId, $staticFields, $productIds, $lastProductId, $this->batchSize); while (count($products) > 0) { diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/Category.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/Category.php index ed841996ea07b..5c5b4591f8a55 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/Category.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/Category.php @@ -9,6 +9,7 @@ use Magento\Catalog\Model\ResourceModel\Category as Resource; use Magento\CatalogSearch\Model\Indexer\Fulltext\Processor; +use Magento\Framework\DataObject; /** * Perform indexer invalidation after a category delete. @@ -33,12 +34,15 @@ public function __construct(Processor $fulltextIndexerProcessor) * * @param Resource $subjectCategory * @param Resource $resultCategory + * @param DataObject $object * @return Resource * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterDelete(Resource $subjectCategory, Resource $resultCategory) : Resource + public function afterDelete(Resource $subjectCategory, Resource $resultCategory, DataObject $object) : Resource { - $this->fulltextIndexerProcessor->markIndexerAsInvalid(); + if ($object->getIsActive() || $object->getDeletedChildrenIds()) { + $this->fulltextIndexerProcessor->markIndexerAsInvalid(); + } return $resultCategory; } diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php index d37f0f8a5153b..7e9be408a3850 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php @@ -17,6 +17,11 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection implements \Magento\Search\Model\SearchCollectionInterface { + /** + * @var array + */ + private $indexUsageEnforcements; + /** * Attribute collection * @@ -61,6 +66,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param \Magento\Customer\Api\GroupManagementInterface $groupManagement * @param \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $attributeCollectionFactory * @param \Magento\Framework\DB\Adapter\AdapterInterface $connection + * @param array $indexUsageEnforcements * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -84,7 +90,8 @@ public function __construct( \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Customer\Api\GroupManagementInterface $groupManagement, \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $attributeCollectionFactory, - \Magento\Framework\DB\Adapter\AdapterInterface $connection = null + \Magento\Framework\DB\Adapter\AdapterInterface $connection = null, + array $indexUsageEnforcements = [] ) { $this->_attributeCollectionFactory = $attributeCollectionFactory; parent::__construct( @@ -109,6 +116,7 @@ public function __construct( $groupManagement, $connection ); + $this->indexUsageEnforcements = $indexUsageEnforcements; } /** @@ -197,6 +205,35 @@ protected function _hasAttributeOptionsAndSearchable($attribute) return false; } + /** + * Prepare table names for the index enforcements + * + * @return array + */ + private function prepareIndexEnforcements() : array + { + $result = []; + foreach ($this->indexUsageEnforcements as $table => $index) { + $table = $this->getTable($table); + if ($this->isIndexExists($table, $index)) { + $result[$table] = $index; + } + } + return $result; + } + + /** + * Check if index exists in the table + * + * @param string $table + * @param string $index + * @return bool + */ + private function isIndexExists(string $table, string $index) : bool + { + return array_key_exists($index, $this->_conn->getIndexList($table)); + } + /** * Retrieve SQL for search entities * @@ -208,6 +245,7 @@ protected function _getSearchEntityIdsSql($query, $searchOnlyInCurrentStore = tr { $tables = []; $selects = []; + $preparedIndexEnforcements = $this->prepareIndexEnforcements(); $likeOptions = ['position' => 'any']; @@ -249,23 +287,56 @@ protected function _getSearchEntityIdsSql($query, $searchOnlyInCurrentStore = tr $ifValueId = $this->getConnection()->getIfNullSql('t2.value', 't1.value'); foreach ($tables as $table => $attributeIds) { - $selects[] = $this->getConnection()->select()->from( - ['t1' => $table], - $linkField - )->joinLeft( - ['t2' => $table], - $joinCondition, - [] - )->where( - 't1.attribute_id IN (?)', - $attributeIds, - \Zend_Db::INT_TYPE - )->where( - 't1.store_id = ?', - 0 - )->where( - $this->_resourceHelper->getCILike($ifValueId, $this->_searchQuery, $likeOptions) - ); + if (!empty($preparedIndexEnforcements[$table])) { + $condition1 = $this->_conn->quoteInto( + '`t1`.`attribute_id` IN (?)', + $attributeIds, + \Zend_Db::INT_TYPE + ); + $condition2 = '`t1`.`store_id` = 0'; + $quotedField = $this->_conn->quoteIdentifier($ifValueId); + $condition3 = $this->_conn->quoteInto( + $quotedField . ' LIKE ?', + $this->_resourceHelper->addLikeEscape($this->_searchQuery, $likeOptions) + ); + + //force index statement not implemented in framework + // phpcs:ignore Magento2.SQL.RawQuery + $select = sprintf( + 'SELECT `t1`.`%s` FROM `%s` AS `t1` FORCE INDEX(%s) + LEFT JOIN `%s` AS `t2` FORCE INDEX(%s) + ON %s WHERE %s AND %s AND (%s)', + $linkField, + $table, + $preparedIndexEnforcements[$table], + $table, + $preparedIndexEnforcements[$table], + $joinCondition, + $condition1, + $condition2, + $condition3 + ); + } else { + $select = $this->getConnection()->select(); + $select->from( + ['t1' => $table], + $linkField + )->joinLeft( + ['t2' => $table], + $joinCondition, + [] + )->where( + 't1.attribute_id IN (?)', + $attributeIds, + \Zend_Db::INT_TYPE + )->where( + 't1.store_id = ?', + 0 + )->where( + $this->_resourceHelper->getCILike($ifValueId, $this->_searchQuery, $likeOptions) + ); + } + $selects[] = $select; } $sql = $this->_getSearchInOptionSql($query); diff --git a/app/code/Magento/CatalogSearch/Model/Search/ReaderPlugin.php b/app/code/Magento/CatalogSearch/Model/Search/ReaderPlugin.php index 2f6a402b20406..4adb9c2299e95 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/ReaderPlugin.php +++ b/app/code/Magento/CatalogSearch/Model/Search/ReaderPlugin.php @@ -5,6 +5,9 @@ */ namespace Magento\CatalogSearch\Model\Search; +use Magento\CatalogSearch\Model\Search\Request\ModifierInterface; +use Magento\Framework\Config\ReaderInterface; + /** * @deprecated 101.0.0 * @see \Magento\ElasticSearch @@ -12,34 +15,34 @@ class ReaderPlugin { /** - * @var \Magento\CatalogSearch\Model\Search\RequestGenerator + * @var ModifierInterface */ - private $requestGenerator; + private $requestModifier; /** - * @param \Magento\CatalogSearch\Model\Search\RequestGenerator $requestGenerator + * @param ModifierInterface $requestModifier */ public function __construct( - \Magento\CatalogSearch\Model\Search\RequestGenerator $requestGenerator + ModifierInterface $requestModifier ) { - $this->requestGenerator = $requestGenerator; + $this->requestModifier = $requestModifier; } /** * Merge reader's value with generated * - * @param \Magento\Framework\Config\ReaderInterface $subject + * @param ReaderInterface $subject * @param array $result * @param string|null $scope * @return array * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterRead( - \Magento\Framework\Config\ReaderInterface $subject, + ReaderInterface $subject, array $result, $scope = null ) { - $result = array_merge_recursive($result, $this->requestGenerator->generate()); + $result = $this->requestModifier->modify($result); return $result; } } diff --git a/app/code/Magento/CatalogSearch/Model/Search/Request/MatchQueriesModifier.php b/app/code/Magento/CatalogSearch/Model/Search/Request/MatchQueriesModifier.php new file mode 100644 index 0000000000000..8d1675884c3ba --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/Request/MatchQueriesModifier.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\Request; + +/** + * Modifies match queries + */ +class MatchQueriesModifier implements ModifierInterface +{ + /** + * Queries node name + */ + private const NODE_QUERIES = 'queries'; + + /** + * Match query node name + */ + private const NODE_MATCH = 'match'; + + /** + * Match query node field attribute name + */ + private const NODE_MATCH_ATTRIBUTE_FIELD = 'field'; + + /** + * @var array + */ + private $queries; + + /** + * @param array $queries + */ + public function __construct(array $queries = []) + { + $this->queries = $queries; + } + + /** + * @inheritdoc + */ + public function modify(array $requests): array + { + foreach ($requests as &$request) { + foreach ($this->queries as $query => $fields) { + if (!empty($request[self::NODE_QUERIES][$query][self::NODE_MATCH])) { + foreach ($request[self::NODE_QUERIES][$query][self::NODE_MATCH] as $index => $match) { + $field = $match[self::NODE_MATCH_ATTRIBUTE_FIELD] ?? null; + if ($field !== null && isset($fields[$field])) { + $request[self::NODE_QUERIES][$query][self::NODE_MATCH][$index] += $fields[$field]; + } + } + } + } + } + return $requests; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierComposite.php b/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierComposite.php new file mode 100644 index 0000000000000..6290b5bd7ce48 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierComposite.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\Request; + +/** + * Search requests configuration composite modifier + */ +class ModifierComposite implements ModifierInterface +{ + /** + * @var ModifierInterface[] + */ + private $modifiers; + + /** + * @param ModifierInterface[] $modifiers + */ + public function __construct( + array $modifiers = [] + ) { + foreach ($modifiers as $modifier) { + if (!$modifier instanceof ModifierInterface) { + throw new \InvalidArgumentException( + get_class($modifier) . ' must implement ' . ModifierInterface::class + ); + } + } + $this->modifiers = $modifiers; + } + + /** + * @inheritdoc + */ + public function modify(array $requests): array + { + foreach ($this->modifiers as $modifier) { + $requests = $modifier->modify($requests); + } + return $requests; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierInterface.php b/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierInterface.php new file mode 100644 index 0000000000000..68421d6cb1d4f --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/Request/ModifierInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\Request; + +/** + * Search requests configuration modifier interface + */ +interface ModifierInterface +{ + /** + * Modifies search requests configuration + * + * @param array $requests + * @return array + */ + public function modify(array $requests): array; +} diff --git a/app/code/Magento/CatalogSearch/Model/Search/Request/PartialSearchModifier.php b/app/code/Magento/CatalogSearch/Model/Search/Request/PartialSearchModifier.php new file mode 100644 index 0000000000000..5a543b363c994 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/Request/PartialSearchModifier.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\Request; + +use Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection; +use Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory; +use Magento\Eav\Model\Entity\Attribute; + +/** + * Modifies partial search query in search requests configuration + */ +class PartialSearchModifier implements ModifierInterface +{ + /** + * @var CollectionFactory + */ + private $collectionFactory; + + /** + * @param CollectionFactory $collectionFactory + */ + public function __construct( + CollectionFactory $collectionFactory + ) { + $this->collectionFactory = $collectionFactory; + } + + /** + * @inheritdoc + */ + public function modify(array $requests): array + { + $attributes = $this->getSearchableAttributes(); + foreach ($requests as $code => $request) { + $matches = $request['queries']['partial_search']['match'] ?? []; + if ($matches) { + foreach ($matches as $index => $match) { + $field = $match['field'] ?? null; + if ($field && $field !== '*' && !isset($attributes[$field])) { + unset($matches[$index]); + } + } + $requests[$code]['queries']['partial_search']['match'] = array_values($matches); + } + } + return $requests; + } + + /** + * Retrieve searchable attributes + * + * @return Attribute[] + */ + private function getSearchableAttributes(): array + { + $attributes = []; + /** @var Collection $collection */ + $collection = $this->collectionFactory->create(); + $collection->addFieldToFilter( + ['is_searchable', 'is_visible_in_advanced_search', 'is_filterable', 'is_filterable_in_search'], + [1, 1, [1, 2], 1] + ); + + /** @var Attribute $attribute */ + foreach ($collection->getItems() as $attribute) { + $attributes[$attribute->getAttributeCode()] = $attribute; + } + + return $attributes; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Search/Request/SearchModifier.php b/app/code/Magento/CatalogSearch/Model/Search/Request/SearchModifier.php new file mode 100644 index 0000000000000..54082dd28ec04 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Search/Request/SearchModifier.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Model\Search\Request; + +use Magento\CatalogSearch\Model\Search\RequestGenerator; + +/** + * Modifies search requests configuration + */ +class SearchModifier implements ModifierInterface +{ + /** + * @var RequestGenerator + */ + private $requestGenerator; + + /** + * @param RequestGenerator $requestGenerator + */ + public function __construct( + RequestGenerator $requestGenerator + ) { + $this->requestGenerator = $requestGenerator; + } + + /** + * @inheritdoc + */ + public function modify(array $requests): array + { + $requests = array_merge_recursive($requests, $this->requestGenerator->generate()); + return $requests; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php index caa49d0f0c4a4..94922c9ce772d 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php +++ b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php @@ -186,6 +186,7 @@ private function generateAdvancedSearchRequest() [ 'field' => $attribute->getAttributeCode(), 'boost' => $attribute->getSearchWeight() ?: 1, + 'matchCondition' => 'match_phrase_prefix', ], ], ]; diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontNoResultsMessageOnSearchPageActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontNoResultsMessageOnSearchPageActionGroup.xml new file mode 100644 index 0000000000000..6001708b41a10 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontNoResultsMessageOnSearchPageActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontNoResultsMessageOnSearchPageActionGroup"> + <annotations> + <description>Check if search returned no results</description> + </annotations> + <arguments> + <argument name="message" type="string" defaultValue="Your search returned no results."/> + </arguments> + <see selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="{{message}}" stepKey="seeNoSearchResultsMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontProductNotOnSearchPageActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontProductNotOnSearchPageActionGroup.xml new file mode 100644 index 0000000000000..c35be6f46e7da --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertStorefrontProductNotOnSearchPageActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductNotOnSearchPageActionGroup"> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + <dontSee selector="{{StorefrontCatalogSearchMainSection.searchResults}}" userInput="{{productSku}}" stepKey="doNotSeeProduct"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontFillFormAdvancedSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontFillFormAdvancedSearchActionGroup.xml index 1afdb6e5e46fa..81a283b9fcf3a 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontFillFormAdvancedSearchActionGroup.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontFillFormAdvancedSearchActionGroup.xml @@ -23,6 +23,7 @@ <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ShortDescription}}" userInput="{{short_description}}" stepKey="fillShortDescription"/> <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceFrom}}" userInput="{{price_from}}" stepKey="fillPriceFrom"/> <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceTo}}" userInput="{{price_to}}" stepKey="fillPriceTo"/> + <scrollTo selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="scrollToSubmitButton"/> <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByDescriptionTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByDescriptionTest.xml index c02ef4957ad3d..395cfd1870130 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByDescriptionTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByDescriptionTest.xml @@ -12,9 +12,8 @@ <features value="CatalogSearch"/> <group value="CatalogSearch"/> </annotations> - <!-- Perform reindex and flush cache --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml index 0c8e192f9366e..99448fd730d99 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml @@ -13,9 +13,8 @@ <group value="CatalogSearch"/> </annotations> - <!-- Perform reindex and flush cache --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml index 99c09b5ba93a5..af70c3ba1c3ad 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml @@ -13,9 +13,8 @@ <group value="CatalogSearch"/> </annotations> - <!-- Perform reindex and flush cache --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml index 1e18c5ea4d0a9..38399f2729d3a 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml @@ -13,9 +13,8 @@ <group value="CatalogSearch"/> </annotations> - <!-- Perform reindex and flush cache --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductBySkuTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductBySkuTest.xml index 34e0a73e91fe0..e12505299c76b 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductBySkuTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductBySkuTest.xml @@ -13,9 +13,8 @@ <group value="CatalogSearch"/> </annotations> - <!-- Perform reindex and flush cache --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 28eb53542ad99..f787b160e7689 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -23,7 +23,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForSearchProductsloaded" after="searchClickAdvancedSearchSubmitButton"/> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="searchCheckAdvancedSearchResult" after="waitForSearchProductsloaded"/> <!-- Results returned will be different with ES vs MySQL --> - <see userInput="4" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.productCount}} span" stepKey="searchAdvancedAssertProductCount" after="searchCheckAdvancedSearchResult"/> + <see userInput="1" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.productCount}} span" stepKey="searchAdvancedAssertProductCount" after="searchCheckAdvancedSearchResult"/> <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml index 09f7ee455ebb5..a6cec94803738 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml @@ -43,10 +43,7 @@ </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml index 98d1b3412360c..e587840f3bffc 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml @@ -54,10 +54,7 @@ </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml index 3298eff34759b..1a25ee6bc57ad 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml @@ -25,10 +25,7 @@ <argument name="category" value="$$createCategory$$"/> </actionGroup> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -38,6 +35,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartDownloadableTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartDownloadableTest.xml index 85e3c46654502..2201b17c31a0b 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartDownloadableTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartDownloadableTest.xml @@ -27,10 +27,7 @@ <requiredEntity createDataKey="createProduct"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml index 3488a63140809..efe1018c29e55 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml @@ -27,10 +27,7 @@ <requiredEntity createDataKey="simple1"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartTest.xml index 26f4cd77b60bc..b0137f145bff2 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartTest.xml @@ -23,10 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartVirtualTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartVirtualTest.xml index 9277baba94aa8..b2e86ae896ab3 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartVirtualTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartVirtualTest.xml @@ -23,10 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchEmptyResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchEmptyResultsTest.xml index a6654db91effb..02f6ffd5db8e7 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchEmptyResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchEmptyResultsTest.xml @@ -24,10 +24,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchProductBySkuTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchProductBySkuTest.xml index 83436ebb44c6d..4bde337ab78dc 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchProductBySkuTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchProductBySkuTest.xml @@ -23,10 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchByPartialNameTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchByPartialNameTest.xml index d8f8924c4db0b..d85b17348b0bc 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchByPartialNameTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchByPartialNameTest.xml @@ -10,17 +10,15 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontAdvancedSearchByPartialNameTest" extends="StorefrontAdvancedSearchEntitySimpleProductTest"> <annotations> + <features value="CatalogSearch"/> <stories value="Use Advanced Search"/> <title value="Search product in advanced search by partial name"/> <description value="Search product in advanced search by partial name"/> - <testCaseId value="MAGETWO-24729"/> <severity value="CRITICAL"/> + <testCaseId value="MC-40416"/> <group value="searchFrontend"/> <group value="mtf_migrated"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <actionGroup ref="StorefrontFillFormAdvancedSearchActionGroup" stepKey="search"> <argument name="productName" value="abc"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml index 14ae988e6ce79..1e27f9f6d05af 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml @@ -31,10 +31,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/> </after> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchNotSearchableTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchNotSearchableTest.xml new file mode 100644 index 0000000000000..b8ca2a16e7515 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchNotSearchableTest.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontPartialWordQuickSearchNotSearchableTest"> + <annotations> + <features value="Search"/> + <stories value="Partial Word search using Elasticsearch"/> + <title value="Partial word search should be performed on searchable fields only"/> + <description value="Partial word search should be performed on searchable fields only"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40782"/> + <useCaseId value="MC-40715"/> + <group value="SearchEngineElasticsearch"/> + </annotations> + <before> + <!--Create category--> + <createData entity="SimpleSubCategory" stepKey="newCategory"/> + <!--Create product1--> + <createData entity="ProductForPartialSearch" stepKey="product1"> + <requiredEntity createDataKey="newCategory"/> + </createData> + <!--Create product2--> + <createData entity="SimpleProduct" stepKey="product2"> + <requiredEntity createDataKey="newCategory"/> + </createData> + <!--Create product3--> + <createData entity="ApiSimpleProduct" stepKey="product3"> + <requiredEntity createDataKey="newCategory"/> + </createData> + <!--Login as admin--> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!--Open "Name" attribute in admin--> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="OpenNameAttribute"> + <argument name="productAttributeCode" value="name"/> + </actionGroup> + <!--Configure "Name" attribute as not searchable--> + <actionGroup ref="AdminSetUseInSearchValueForProductAttributeActionGroup" stepKey="makeNameNotSearchable"> + <argument name="useInSearchValue" value="No"/> + </actionGroup> + <!--Save "Name" attribute--> + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveAttributeChanges"/> + <!--Reindex--> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <!--Clean cache--> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache"> + <argument name="tags" value=""/> + </actionGroup> + </before> + <after> + <!--Delete product1--> + <deleteData createDataKey="product1" stepKey="deleteProduct1"/> + <!--Delete product2--> + <deleteData createDataKey="product2" stepKey="deleteProduct2"/> + <!--Delete product3--> + <deleteData createDataKey="product3" stepKey="deleteProduct3"/> + <!--Delete category--> + <deleteData createDataKey="newCategory" stepKey="deleteCategory"/> + <!--Open "Name" attribute in admin--> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="OpenNameAttribute"> + <argument name="productAttributeCode" value="name"/> + </actionGroup> + <!--Configure "Name" attribute as searchable--> + <actionGroup ref="AdminSetUseInSearchValueForProductAttributeActionGroup" stepKey="makeNameSearchable"> + <argument name="useInSearchValue" value="Yes"/> + </actionGroup> + <!--Configure "Name" attribute to be visible in advanced search (this option is automatically turned off when "use in search" is off)--> + <actionGroup ref="AdminProductAttributeSetVisibleInAdvancedSearchActionGroup" stepKey="makeNameVisibleInAdvancedSearch"> + <argument name="isVisibleInAdvancedSearch" value="Yes"/> + </actionGroup> + <!--Save "Name" attribute--> + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveAttributeChanges"/> + <!--Clear grid filter--> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> + <!--Logout from admin--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + <!--Reindex--> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <!--Clean cache--> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache"> + <argument name="tags" value=""/> + </actionGroup> + </after> + <!--Navigate to home page--> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> + <!--Search for word "partial"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search1"> + <argument name="phrase" value="partial"/> + </actionGroup> + <!--Assert that product1 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct1"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct2"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product3 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct3"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + + <!--Search for word "simple"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search2"> + <argument name="phrase" value="simple"/> + </actionGroup> + <!--Assert that product1 is present in the search result--> + <comment userInput="BIC workaround" stepKey="dontSeeProduct1"/> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct1c"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct2"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product3 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct3"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + + <!--Search for word "api-sim"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search3"> + <argument name="phrase" value="api-sim"/> + </actionGroup> + <!--Assert that product1 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct1b"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct2b"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product3 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct3b"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + </test> +</tests> + diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchStemmingTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchStemmingTest.xml new file mode 100644 index 0000000000000..b1528b169cbdf --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontPartialWordQuickSearchStemmingTest.xml @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontPartialWordQuickSearchStemmingTest"> + <annotations> + <features value="Search"/> + <stories value="Partial Word search using Elasticsearch"/> + <title value="Partial word search should match only the documents that contain the words of a provided text, in the same order as provided"/> + <description value="Partial word search should match only the documents that contain the words of a provided text, in the same order as provided"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-41570"/> + <useCaseId value="MC-40981"/> + <group value="SearchEngineElasticsearch"/> + </annotations> + <before> + <!--Create category--> + <createData entity="SimpleSubCategory" stepKey="category1"/> + <!--Create product1--> + <createData entity="SimpleProduct" stepKey="product1"> + <field key="name">5127SS YALE JUNIOR KNOB ENTRANCE SET 5 PINS SATIN STAI</field> + <requiredEntity createDataKey="category1"/> + </createData> + <!--Create product2--> + <createData entity="SimpleProduct" stepKey="product2"> + <field key="name">5127AC YALE JUNIOR KNOB ENTRANCE SET 5 PINS ANTIQUE CO</field> + <requiredEntity createDataKey="category1"/> + </createData> + <!--Create product3--> + <createData entity="SimpleProduct" stepKey="product3"> + <field key="name">5127AB YALE JUNIOR KNOB ENTRANCE SET 5 PINS ANTIQUE BRASS</field> + <requiredEntity createDataKey="category1"/> + </createData> + <!--Create product4--> + <createData entity="SimpleProduct" stepKey="product4"> + <field key="sku">5127SS-YALE</field> + <requiredEntity createDataKey="category1"/> + </createData> + <!--Create product5--> + <createData entity="SimpleProduct" stepKey="product5"> + <field key="sku">5127AC-CO</field> + <requiredEntity createDataKey="category1"/> + </createData> + <!--Create product6--> + <createData entity="SimpleProduct" stepKey="product6"> + <field key="sku">5127AB-BRASS</field> + <requiredEntity createDataKey="category1"/> + </createData> + </before> + <after> + <!--Delete category--> + <deleteData createDataKey="category1" stepKey="deleteCategory"/> + <!--Delete product1--> + <deleteData createDataKey="product1" stepKey="deleteProduct1"/> + <!--Delete product2--> + <deleteData createDataKey="product2" stepKey="deleteProduct2"/> + <!--Delete product3--> + <deleteData createDataKey="product3" stepKey="deleteProduct3"/> + <!--Delete product4--> + <deleteData createDataKey="product4" stepKey="deleteProduct4"/> + <!--Delete product5--> + <deleteData createDataKey="product5" stepKey="deleteProduct5"/> + <!--Delete product6--> + <deleteData createDataKey="product6" stepKey="deleteProduct6"/> + </after> + <!--Navigate to home page--> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> + <!--Search for word "5127S"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search1"> + <argument name="phrase" value="5127S"/> + </actionGroup> + <!--Assert that product1 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct1"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct2"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product2 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct3"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + <!--Assert that product4 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct4"> + <argument name="productName" value="$$product4.name$$"/> + </actionGroup> + <!--Assert that product5 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct5"> + <argument name="productName" value="$$product5.name$$"/> + </actionGroup> + <!--Assert that product6 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct6"> + <argument name="productName" value="$$product6.name$$"/> + </actionGroup> + + <!--Search for word "5127A"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search2"> + <argument name="phrase" value="5127A"/> + </actionGroup> + <!--Assert that product1 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct1"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct2"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product3 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct3"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + <!--Assert that product4 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct4"> + <argument name="productName" value="$$product4.name$$"/> + </actionGroup> + <!--Assert that product5 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct5"> + <argument name="productName" value="$$product5.name$$"/> + </actionGroup> + <!--Assert that product6 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct6"> + <argument name="productName" value="$$product6.name$$"/> + </actionGroup> + + <!--Search for word "5127SS"--> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search3"> + <argument name="phrase" value="5127SS"/> + </actionGroup> + <!--Assert that product1 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct1b"> + <argument name="productName" value="$$product1.name$$"/> + </actionGroup> + <!--Assert that product2 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct2b"> + <argument name="productName" value="$$product2.name$$"/> + </actionGroup> + <!--Assert that product3 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct3b"> + <argument name="productName" value="$$product3.name$$"/> + </actionGroup> + <!--Assert that product4 is present in the search result--> + <actionGroup ref="StorefrontAssertProductNameOnProductMainPageActionGroup" stepKey="seeProduct4b"> + <argument name="productName" value="$$product4.name$$"/> + </actionGroup> + <!--Assert that product5 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct5b"> + <argument name="productName" value="$$product5.name$$"/> + </actionGroup> + <!--Assert that product6 is not present in the search result--> + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProduct6b"> + <argument name="productName" value="$$product6.name$$"/> + </actionGroup> + </test> +</tests> + diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml index 67e8bc6bf183c..fe30acc174249 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml @@ -72,10 +72,7 @@ <requiredEntity createDataKey="createSimpleProduct"/> </createData> - <!-- Perform reindex --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml index 26280ed67d183..634ee57f17237 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml @@ -25,10 +25,7 @@ <requiredEntity createDataKey="createCategory1"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php index 5f342f1735dee..3b19c98aca3ca 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php @@ -8,7 +8,7 @@ namespace Magento\CatalogSearch\Test\Unit\Model\Search; use Magento\CatalogSearch\Model\Search\ReaderPlugin; -use Magento\CatalogSearch\Model\Search\RequestGenerator; +use Magento\CatalogSearch\Model\Search\Request\ModifierInterface; use Magento\Framework\Config\ReaderInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; @@ -16,8 +16,8 @@ class ReaderPluginTest extends TestCase { - /** @var RequestGenerator|MockObject */ - protected $requestGenerator; + /** @var ModifierInterface|MockObject */ + protected $requestModifier; /** @var ObjectManager */ protected $objectManagerHelper; @@ -27,22 +27,20 @@ class ReaderPluginTest extends TestCase protected function setUp(): void { - $this->requestGenerator = $this->getMockBuilder(RequestGenerator::class) + $this->requestModifier = $this->getMockBuilder(ModifierInterface::class) ->disableOriginalConstructor() ->getMock(); $this->objectManagerHelper = new ObjectManager($this); - $this->object = $this->objectManagerHelper->getObject( - ReaderPlugin::class, - ['requestGenerator' => $this->requestGenerator] - ); + $this->object = new ReaderPlugin($this->requestModifier); } public function testAfterRead() { $readerConfig = ['test' => 'b', 'd' => 'e']; - $this->requestGenerator->expects($this->once()) - ->method('generate') + $this->requestModifier->expects($this->once()) + ->method('modify') + ->with($readerConfig) ->willReturn(['test' => 'a']); $result = $this->object->afterRead( @@ -53,6 +51,6 @@ public function testAfterRead() null ); - $this->assertEquals(['test' => ['b', 'a'], 'd' => 'e'], $result); + $this->assertEquals(['test' => 'a'], $result); } } diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/MatchQueriesModifierTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/MatchQueriesModifierTest.php new file mode 100644 index 0000000000000..00576f9ad029c --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/MatchQueriesModifierTest.php @@ -0,0 +1,130 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Test\Unit\Model\Search\Request; + +use Magento\CatalogSearch\Model\Search\Request\MatchQueriesModifier; +use PHPUnit\Framework\TestCase; + +/** + * Test match queries modifier + */ +class MatchQueriesModifierTest extends TestCase +{ + /** + * Test that queries configuration are merged into request + * + * @param array $queries + * @param array $requests + * @param array $expected + * @dataProvider modifyDataProvider + */ + public function testModify(array $queries, array $requests, array $expected): void + { + $model = new MatchQueriesModifier($queries); + $this->assertEquals($expected, $model->modify($requests)); + } + + /** + * @return array + */ + public function modifyDataProvider(): array + { + return [ + [ + [ + 'partial_search' => [ + 'name' => [ + 'analyzer' => 'standard', + 'max_expansions' => 20, + ] + ], + ], + [ + 'search_1' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ], + 'queries' => [ + 'partial_search' => [ + 'name' => 'partial_search', + 'value' => '$search_term$', + 'match' => [ + [ + 'field' => '*' + ], + [ + 'field' => 'sku', + 'matchCondition' => 'match_phrase_prefix', + ], + [ + 'field' => 'name', + 'matchCondition' => 'match_phrase_prefix', + ], + ] + ] + ] + ], + 'search_2' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ] + ] + ], + [ + 'search_1' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ], + 'queries' => [ + 'partial_search' => [ + 'name' => 'partial_search', + 'value' => '$search_term$', + 'match' => [ + [ + 'field' => '*' + ], + [ + 'field' => 'sku', + 'matchCondition' => 'match_phrase_prefix', + ], + [ + 'field' => 'name', + 'matchCondition' => 'match_phrase_prefix', + 'analyzer' => 'standard', + 'max_expansions' => 20, + ], + ] + ] + ] + ], + 'search_2' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ] + ] + ] + ] + ]; + } +} diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/ModifierCompositeTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/ModifierCompositeTest.php new file mode 100644 index 0000000000000..936ad83b8a630 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/ModifierCompositeTest.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Test\Unit\Model\Search\Request; + +use Magento\CatalogSearch\Model\Search\Request\ModifierComposite; +use Magento\CatalogSearch\Model\Search\Request\ModifierInterface; +use Magento\Framework\DataObject; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test composite search requests modifier + */ +class ModifierCompositeTest extends TestCase +{ + /** + * @var ModifierInterface|MockObject + */ + private $modifier1; + + /** + * @var ModifierInterface|MockObject + */ + private $modifier2; + + /** + * @var ModifierComposite + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->modifier1 = $this->getMockForAbstractClass(ModifierInterface::class); + $this->modifier2 = $this->getMockForAbstractClass(ModifierInterface::class); + $this->model = new ModifierComposite( + [ + $this->modifier1, + $this->modifier2 + ] + ); + } + + /** + * Test that all modifiers are executed + */ + public function testModify(): void + { + $requests = ['a', 'b', 'c']; + $this->modifier1->expects($this->once()) + ->method('modify') + ->with($requests) + ->willReturn(['a', 'b', 'c', 'd']); + + $this->modifier2->expects($this->once()) + ->method('modify') + ->with(['a', 'b', 'c', 'd']) + ->willReturn(['a', 'c', 'd']); + + $this->assertEquals(['a', 'c', 'd'], $this->model->modify($requests)); + } + + /** + * Test that exception is thrown if modifier is not instance of ModifierInterface + */ + public function testInvalidModifier(): void + { + $exception = new \InvalidArgumentException( + 'Magento\Framework\DataObject must implement Magento\CatalogSearch\Model\Search\Request\ModifierInterface' + ); + $this->expectExceptionObject($exception); + $this->model = new ModifierComposite( + [ + new DataObject() + ] + ); + } +} diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/PartialSearchModifierTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/PartialSearchModifierTest.php new file mode 100644 index 0000000000000..2fabec670a57e --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/PartialSearchModifierTest.php @@ -0,0 +1,157 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Test\Unit\Model\Search\Request; + +use Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection; +use Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory; +use Magento\CatalogSearch\Model\Search\Request\PartialSearchModifier; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test "partial" search requests modifier + */ +class PartialSearchModifierTest extends TestCase +{ + /** + * @var Collection|MockObject + */ + private $collection; + + /** + * @var PartialSearchModifier + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $collectionFactory = $this->createMock(CollectionFactory::class); + $this->collection = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->onlyMethods(['load', 'addFieldToFilter']) + ->getMock(); + $collectionFactory->method('create') + ->willReturn($this->collection); + $this->model = new PartialSearchModifier($collectionFactory); + } + + /** + * Test that not searchable attributes are removed from the request + * + * @param array $attributes + * @param array $requests + * @param array $expected + * @dataProvider modifyDataProvider + */ + public function testModify(array $attributes, array $requests, array $expected): void + { + $items = []; + foreach ($attributes as $attribute) { + $item = $this->getMockForAbstractClass(\Magento\Eav\Api\Data\AttributeInterface::class); + $item->method('getAttributeCode') + ->willReturn($attribute); + $items[] = $item; + } + $reflectionProperty = new \ReflectionProperty($this->collection, '_items'); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue($this->collection, $items); + $this->assertEquals($expected, $this->model->modify($requests)); + } + + /** + * @return array + */ + public function modifyDataProvider(): array + { + return [ + [ + [ + 'name', + ], + [ + 'search_1' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ], + 'queries' => [ + 'partial_search' => [ + 'name' => 'partial_search', + 'value' => '$search_term$', + 'match' => [ + [ + 'field' => '*' + ], + [ + 'field' => 'sku', + 'matchCondition' => 'match_phrase_prefix', + ], + [ + 'field' => 'name', + 'matchCondition' => 'match_phrase_prefix', + ], + ] + ] + ] + ], + 'search_2' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ] + ] + ], + [ + 'search_1' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ], + 'queries' => [ + 'partial_search' => [ + 'name' => 'partial_search', + 'value' => '$search_term$', + 'match' => [ + [ + 'field' => '*' + ], + [ + 'field' => 'name', + 'matchCondition' => 'match_phrase_prefix', + ], + ] + ] + ] + ], + 'search_2' => [ + 'filters' => [ + 'category_filter' => [ + 'name' => 'category_filter', + 'field' => 'category_ids', + 'value' => '$category_ids$', + ] + ] + ] + ] + ] + ]; + } +} diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/SearchModifierTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/SearchModifierTest.php new file mode 100644 index 0000000000000..2c7ce97751f1a --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/Request/SearchModifierTest.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogSearch\Test\Unit\Model\Search\Request; + +use Magento\CatalogSearch\Model\Search\Request\SearchModifier; +use Magento\CatalogSearch\Model\Search\RequestGenerator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test search requests modifier + */ +class SearchModifierTest extends TestCase +{ + /** + * @var RequestGenerator|MockObject + */ + private $requestGenerator; + + /** + * @var SearchModifier + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->requestGenerator = $this->createMock(RequestGenerator::class); + $this->model = new SearchModifier($this->requestGenerator); + } + + /** + * Test that the result is merged into the initial requests + */ + public function testModifier(): void + { + $requests = ['a' => ['x', 'y'], 'b' => ['k']]; + $expected = ['a' => ['x', 'y', 'z'], 'b' => ['k'], 'c' => ['n']]; + $this->requestGenerator->expects($this->once()) + ->method('generate') + ->willReturn(['a' => ['z'], 'c' => ['n']]); + $this->assertEquals($expected, $this->model->modify($requests)); + } +} diff --git a/app/code/Magento/CatalogSearch/etc/di.xml b/app/code/Magento/CatalogSearch/etc/di.xml index f8e2a262d73ca..43ba82f047e41 100644 --- a/app/code/Magento/CatalogSearch/etc/di.xml +++ b/app/code/Magento/CatalogSearch/etc/di.xml @@ -14,6 +14,7 @@ <preference for="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\TotalRecordsResolverInterface" type="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\TotalRecordsResolver"/> <preference for="Magento\CatalogSearch\Model\Search\ItemCollectionProviderInterface" type="Magento\CatalogSearch\Model\Search\ItemCollectionProvider"/> <preference for="Magento\Framework\Indexer\IndexStructureInterface" type="Magento\CatalogSearch\Model\Indexer\IndexStructure" /> + <preference for="Magento\CatalogSearch\Model\Search\Request\ModifierInterface" type="Magento\CatalogSearch\Model\Search\Request\ModifierComposite" /> <type name="Magento\Catalog\Model\Indexer\Product\Full"> <arguments> <argument name="indexerList" xsi:type="array"> @@ -248,4 +249,27 @@ <argument name="temporaryStorageFactory" xsi:type="null" /> </arguments> </type> + <type name="Magento\CatalogSearch\Model\Search\Request\ModifierComposite"> + <arguments> + <argument name="modifiers" xsi:type="array"> + <item name="search" xsi:type="object">Magento\CatalogSearch\Model\Search\Request\SearchModifier</item> + <item name="partial_search" xsi:type="object">Magento\CatalogSearch\Model\Search\Request\PartialSearchModifier</item> + <item name="match_queries" xsi:type="object">Magento\CatalogSearch\Model\Search\Request\MatchQueriesModifier</item> + </argument> + </arguments> + </type> + <type name="Magento\CatalogSearch\Model\Search\Request\MatchQueriesModifier"> + <arguments> + <argument name="queries" xsi:type="array"> + <item name="partial_search" xsi:type="array"> + <item name="name" xsi:type="array"> + <item name="analyzer" xsi:type="string">prefix_search</item> + </item> + <item name="sku" xsi:type="array"> + <item name="analyzer" xsi:type="string">sku_prefix_search</item> + </item> + </item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml index 9c20f614076b3..67958af8b54cb 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml @@ -36,5 +36,10 @@ <action method="setListCollection"/> </block> </referenceContainer> + <referenceBlock name="search_result_list"> + <arguments> + <argument name="viewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\OptionsData</argument> + </arguments> + </referenceBlock> </body> </page> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml index 8dd8e3ed72828..52cca45d8d7df 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml @@ -16,6 +16,7 @@ positions:list-secondary,grid-secondary,list-actions,grid-actions,list-primary,grid-primary --> <argument name="positioned" xsi:type="string">positions:list-secondary</argument> + <argument name="viewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\OptionsData</argument> </arguments> <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml"> <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Move.php b/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Move.php index f3984bf7d62ab..5a5b805ba189e 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Move.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Move.php @@ -67,13 +67,11 @@ public function afterChangeParent( $categoryStoreId = $category->getStoreId(); foreach ($category->getStoreIds() as $storeId) { $category->setStoreId($storeId); - if (!$this->isGlobalScope($storeId)) { - $this->updateCategoryUrlKeyForStore($category); - $category->unsUrlPath(); - $category->setUrlPath($this->categoryUrlPathGenerator->getUrlPath($category)); - $category->getResource()->saveAttribute($category, 'url_path'); - $this->updateUrlPathForChildren($category); - } + $this->updateCategoryUrlKeyForStore($category); + $category->unsUrlPath(); + $category->setUrlPath($this->categoryUrlPathGenerator->getUrlPath($category)); + $category->getResource()->saveAttribute($category, 'url_path'); + $this->updateUrlPathForChildren($category); } $category->setStoreId($categoryStoreId); diff --git a/app/code/Magento/CatalogUrlRewrite/Model/Product/Validator.php b/app/code/Magento/CatalogUrlRewrite/Model/Product/Validator.php new file mode 100644 index 0000000000000..01aa2155e322a --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Model/Product/Validator.php @@ -0,0 +1,101 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Model\Product; + +use Magento\Catalog\Model\Product; +use Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator; +use Magento\UrlRewrite\Model\Exception\UrlAlreadyExistsException; +use Magento\UrlRewrite\Model\UrlFinderInterface; +use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; +use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; +use Magento\Store\Model\StoreManagerInterface; + +/** + * Url Rewrites Product validator. + */ +class Validator +{ + /** + * @var ProductUrlPathGenerator + */ + private $productUrlPathGenerator; + + /** + * @var UrlFinderInterface + */ + private $urlFinder; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @param ProductUrlPathGenerator $productUrlPathGenerator + * @param UrlFinderInterface $urlFinder + * @param StoreManagerInterface $storeManager + */ + public function __construct( + ProductUrlPathGenerator $productUrlPathGenerator, + UrlFinderInterface $urlFinder, + StoreManagerInterface $storeManager + ) { + $this->productUrlPathGenerator = $productUrlPathGenerator; + $this->urlFinder = $urlFinder; + $this->storeManager = $storeManager; + } + + /** + * Validate Url Key of a Product has no conflicts. + * + * @param Product $product + * @throws UrlAlreadyExistsException + */ + public function validateUrlKeyConflicts(Product $product): void + { + $stores = $this->storeManager->getStores(); + + $storeIdsToPathForSave = []; + $searchData = [ + UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, + UrlRewrite::REQUEST_PATH => [], + ]; + + foreach ($stores as $store) { + if (!in_array($store->getWebsiteId(), $product->getWebsiteIds())) { + continue; + } + + $urlPath = $this->productUrlPathGenerator->getUrlPathWithSuffix($product, $store->getId()); + $storeIdsToPathForSave[$store->getId()] = $urlPath; + $searchData[UrlRewrite::REQUEST_PATH][] = $urlPath; + } + + $urlRewrites = $this->urlFinder->findAllByData($searchData); + $exceptionData = []; + + foreach ($urlRewrites as $urlRewrite) { + if (in_array($urlRewrite->getRequestPath(), $storeIdsToPathForSave) + && isset($storeIdsToPathForSave[$urlRewrite->getStoreId()]) + && $storeIdsToPathForSave[$urlRewrite->getStoreId()] === $urlRewrite->getRequestPath() + && $product->getId() !== $urlRewrite->getEntityId() + ) { + $exceptionData[$urlRewrite->getUrlRewriteId()] = $urlRewrite->toArray(); + } + } + + if ($exceptionData) { + throw new UrlAlreadyExistsException( + __('URL key for specified store already exists.'), + null, + 0, + $exceptionData + ); + } + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Category/GetDefaultUrlKey.php b/app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Category/GetDefaultUrlKey.php new file mode 100644 index 0000000000000..d5e603d9df59b --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Category/GetDefaultUrlKey.php @@ -0,0 +1,83 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Model\ResourceModel\Category; + +use Magento\Catalog\Api\Data\CategoryInterface; +use Magento\Catalog\Model\Category; +use Magento\Eav\Model\Config as EavConfig; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Select; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Store\Model\Store; + +/** + * Fetch category 'url_key' default value from the database. + */ +class GetDefaultUrlKey +{ + /** + * @var MetadataPool + */ + private $metadataPool; + + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @var EavConfig + */ + private $eavConfig; + + /** + * @param MetadataPool $metadataPool + * @param ResourceConnection $resourceConnection + * @param EavConfig $eavConfig + */ + public function __construct( + MetadataPool $metadataPool, + ResourceConnection $resourceConnection, + EavConfig $eavConfig + ) { + $this->metadataPool = $metadataPool; + $this->resourceConnection = $resourceConnection; + $this->eavConfig = $eavConfig; + } + + /** + * Retrieve 'url_key' value for default store. + * + * @param int $categoryId + * @return string|null + */ + public function execute(int $categoryId): ?string + { + $metadata = $this->metadataPool->getMetadata(CategoryInterface::class); + $entityTypeId = $this->eavConfig->getEntityType(Category::ENTITY)->getId(); + $linkField = $metadata->getLinkField(); + $whereConditions = [ + 'e.entity_type_id = ' . $entityTypeId, + "e.attribute_code = 'url_key'", + 'c.' . $linkField . ' = ' . $categoryId, + 'c.store_id = ' . Store::DEFAULT_STORE_ID, + ]; + $connection = $this->resourceConnection->getConnection(); + $select = $connection->select() + ->from(['c' => $this->resourceConnection->getTableName('catalog_category_entity_varchar')]) + ->joinLeft( + ['e' => $this->resourceConnection->getTableName('eav_attribute')], + 'e.attribute_id = c.attribute_id' + ) + ->reset(Select::COLUMNS) + ->columns(['c.value']) + ->where(implode(' AND ', $whereConditions)); + + return $connection->fetchOne($select) ?: null; + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Model/Storage/DynamicStorage.php b/app/code/Magento/CatalogUrlRewrite/Model/Storage/DynamicStorage.php index d9e9705ac039d..9da95d4270b74 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/Storage/DynamicStorage.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/Storage/DynamicStorage.php @@ -179,13 +179,16 @@ private function findProductRewriteByRequestPath(array $data): ?array unset($data[UrlRewrite::IS_AUTOGENERATED]); $categoryFromDb = $this->connection->fetchRow($this->prepareSelect($data)); + if ($categoryFromDb === false) { + return null; + } + if ($categoryFromDb[UrlRewrite::REDIRECT_TYPE]) { $productFromDb[UrlRewrite::REDIRECT_TYPE] = OptionProvider::PERMANENT; $categoryPath = str_replace($categorySuffix, '', $categoryFromDb[UrlRewrite::TARGET_PATH]); } - if ($categoryFromDb === false - || !$productResource->canBeShowInCategory( + if (!$productResource->canBeShowInCategory( $productFromDb[UrlRewrite::ENTITY_ID], $categoryFromDb[UrlRewrite::ENTITY_ID] ) diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorObserver.php index 401f2c9629f76..9593f5cb4fcc7 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorObserver.php @@ -11,11 +11,14 @@ use Magento\Catalog\Model\Category; use Magento\CatalogUrlRewrite\Model\Category\ChildrenCategoriesProvider; use Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator; +use Magento\CatalogUrlRewrite\Model\ResourceModel\Category\GetDefaultUrlKey; use Magento\CatalogUrlRewrite\Service\V1\StoreViewService; +use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Store\Model\Store; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; /** * Class for set or update url path. @@ -24,24 +27,17 @@ class CategoryUrlPathAutogeneratorObserver implements ObserverInterface { /** - * Reserved endpoint names. - * - * @var string[] - */ - private $invalidValues = []; - - /** - * @var \Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator + * @var CategoryUrlPathGenerator */ protected $categoryUrlPathGenerator; /** - * @var \Magento\CatalogUrlRewrite\Model\Category\ChildrenCategoriesProvider + * @var ChildrenCategoriesProvider */ protected $childrenCategoriesProvider; /** - * @var \Magento\CatalogUrlRewrite\Service\V1\StoreViewService + * @var StoreViewService */ protected $storeViewService; @@ -51,43 +47,47 @@ class CategoryUrlPathAutogeneratorObserver implements ObserverInterface private $categoryRepository; /** - * @var \Magento\Backend\App\Area\FrontNameResolver + * @var CompositeUrlKey + */ + private $compositeUrlValidator; + + /** + * @var GetDefaultUrlKey */ - private $frontNameResolver; + private $getDefaultUrlKey; /** * @param CategoryUrlPathGenerator $categoryUrlPathGenerator * @param ChildrenCategoriesProvider $childrenCategoriesProvider - * @param \Magento\CatalogUrlRewrite\Service\V1\StoreViewService $storeViewService + * @param StoreViewService $storeViewService * @param CategoryRepositoryInterface $categoryRepository - * @param \Magento\Backend\App\Area\FrontNameResolver $frontNameResolver - * @param string[] $invalidValues + * @param CompositeUrlKey $compositeUrlValidator + * @param GetDefaultUrlKey $getDefaultUrlKey */ public function __construct( CategoryUrlPathGenerator $categoryUrlPathGenerator, ChildrenCategoriesProvider $childrenCategoriesProvider, StoreViewService $storeViewService, CategoryRepositoryInterface $categoryRepository, - \Magento\Backend\App\Area\FrontNameResolver $frontNameResolver = null, - array $invalidValues = [] + CompositeUrlKey $compositeUrlValidator, + GetDefaultUrlKey $getDefaultUrlKey ) { $this->categoryUrlPathGenerator = $categoryUrlPathGenerator; $this->childrenCategoriesProvider = $childrenCategoriesProvider; $this->storeViewService = $storeViewService; $this->categoryRepository = $categoryRepository; - $this->frontNameResolver = $frontNameResolver ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Backend\App\Area\FrontNameResolver::class); - $this->invalidValues = $invalidValues; + $this->compositeUrlValidator = $compositeUrlValidator; + $this->getDefaultUrlKey = $getDefaultUrlKey; } /** * Method for update/set url path. * - * @param \Magento\Framework\Event\Observer $observer + * @param Observer $observer * @return void * @throws LocalizedException */ - public function execute(\Magento\Framework\Event\Observer $observer) + public function execute(Observer $observer) { /** @var Category $category */ $category = $observer->getEvent()->getCategory(); @@ -100,6 +100,12 @@ public function execute(\Magento\Framework\Event\Observer $observer) $resultUrlKey = $category->formatUrlKey($category->getOrigData('name')); $this->updateUrlKey($category, $resultUrlKey); } + if ($category->hasChildren()) { + $defaultUrlKey = $this->getDefaultUrlKey->execute((int)$category->getId()); + if ($defaultUrlKey) { + $this->updateUrlKey($category, $defaultUrlKey); + } + } $category->setUrlKey(null)->setUrlPath(null); } } @@ -161,27 +167,12 @@ private function validateUrlKey(Category $category, ?string $urlKey): void throw new LocalizedException(__('Invalid URL key')); } - if (in_array($urlKey, $this->getInvalidValues())) { - throw new LocalizedException( - __( - 'URL key "%1" matches a reserved endpoint name (%2). Use another URL key.', - $urlKey, - implode(', ', $this->getInvalidValues()) - ) - ); + $errors = $this->compositeUrlValidator->validate($urlKey); + if (!empty($errors)) { + throw new LocalizedException($errors[0]); } } - /** - * Get reserved endpoint names. - * - * @return array - */ - private function getInvalidValues() - { - return array_unique(array_merge($this->invalidValues, [$this->frontNameResolver->getFrontName()])); - } - /** * Update url path for children category. * diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php index 28afff56c019f..b3f06874b7110 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/ProductUrlKeyAutogeneratorObserver.php @@ -9,32 +9,49 @@ use Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; class ProductUrlKeyAutogeneratorObserver implements ObserverInterface { /** - * @var \Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator + * @var ProductUrlPathGenerator */ protected $productUrlPathGenerator; + /** + * @var CompositeUrlKey + */ + private $compositeUrlValidator; + /** * @param ProductUrlPathGenerator $productUrlPathGenerator + * @param CompositeUrlKey $compositeUrlValidator */ - public function __construct(ProductUrlPathGenerator $productUrlPathGenerator) - { + public function __construct( + ProductUrlPathGenerator $productUrlPathGenerator, + CompositeUrlKey $compositeUrlValidator + ) { $this->productUrlPathGenerator = $productUrlPathGenerator; + $this->compositeUrlValidator = $compositeUrlValidator; } /** - * @param \Magento\Framework\Event\Observer $observer - * @return void + * Validates and sets url key for product + * + * @param Observer $observer + * @throws LocalizedException */ - public function execute(\Magento\Framework\Event\Observer $observer) + public function execute(Observer $observer) { /** @var Product $product */ $product = $observer->getEvent()->getProduct(); $urlKey = $this->productUrlPathGenerator->getUrlKey($product); if (null !== $urlKey) { + $errors = $this->compositeUrlValidator->validate($urlKey); + if (!empty($errors)) { + throw new LocalizedException($errors[0]); + } $product->setUrlKey($urlKey); } } diff --git a/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php b/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php index f9c605ab489a5..ce951dc539d07 100644 --- a/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php +++ b/app/code/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewrites.php @@ -8,7 +8,7 @@ namespace Magento\CatalogUrlRewrite\Plugin\Catalog\Model\Product; use Magento\Catalog\Model\Product\Action as ProductAction; -use Magento\Catalog\Model\ResourceModel\Product\Collection; +use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; use Magento\CatalogUrlRewrite\Model\Products\AppendUrlRewritesToProducts; use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; use Magento\Store\Api\StoreWebsiteRelationInterface; @@ -27,9 +27,9 @@ class UpdateProductWebsiteUrlRewrites private $urlPersist; /** - * @var Collection + * @var CollectionFactory */ - private $productCollection; + private $productCollectionFactory; /** * @var AppendUrlRewritesToProducts @@ -43,18 +43,18 @@ class UpdateProductWebsiteUrlRewrites /** * @param UrlPersistInterface $urlPersist - * @param Collection $productCollection + * @param CollectionFactory $productCollectionFactory * @param AppendUrlRewritesToProducts $appendRewrites * @param GetStoresListByWebsiteIds $getStoresList */ public function __construct( UrlPersistInterface $urlPersist, - Collection $productCollection, + CollectionFactory $productCollectionFactory, AppendUrlRewritesToProducts $appendRewrites, GetStoresListByWebsiteIds $getStoresList ) { $this->urlPersist = $urlPersist; - $this->productCollection = $productCollection; + $this->productCollectionFactory = $productCollectionFactory; $this->appendRewrites = $appendRewrites; $this->getStoresList = $getStoresList; } @@ -90,8 +90,9 @@ public function afterUpdateWebsites( ] ); } else { - $collection = $this->productCollection->addFieldToFilter('entity_id', ['in' => implode(',', $productIds)]); - $this->appendRewrites->execute($collection->getItems(), $storeIds); + $productCollection = $this->productCollectionFactory->create(); + $productCollection->addFieldToFilter('entity_id', ['in' => implode(',', $productIds)]); + $this->appendRewrites->execute($productCollection->getItems(), $storeIds); } } } diff --git a/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php b/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php index 5e7039912999b..f74d8ca358b3f 100644 --- a/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php +++ b/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/UpdateUrlKeyForProducts.php @@ -34,19 +34,27 @@ class UpdateUrlKeyForProducts implements DataPatchInterface, PatchVersionInterfa */ private $urlProduct; + /** + * @var \Magento\Framework\EntityManager\MetadataPool + */ + private $metadataPool; + /** * @param ModuleDataSetupInterface $moduleDataSetup * @param EavSetupFactory $eavSetupFactory * @param Url $urlProduct + * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool */ public function __construct( ModuleDataSetupInterface $moduleDataSetup, EavSetupFactory $eavSetupFactory, - Url $urlProduct + Url $urlProduct, + \Magento\Framework\EntityManager\MetadataPool $metadataPool ) { $this->moduleDataSetup = $moduleDataSetup; $this->eavSetup = $eavSetupFactory->create(['setup' => $moduleDataSetup]); $this->urlProduct = $urlProduct; + $this->metadataPool = $metadataPool; } /** @@ -58,7 +66,7 @@ public function apply() $table = $this->moduleDataSetup->getTable('catalog_product_entity_varchar'); $select = $this->moduleDataSetup->getConnection()->select()->from( $table, - ['value_id', 'value'] + [$this->getProductLinkField(), 'attribute_id', 'store_id', 'value_id', 'value'] )->where( 'attribute_id = ?', $this->eavSetup->getAttributeId($productTypeId, 'url_key') @@ -99,4 +107,17 @@ public function getAliases() { return []; } + + /** + * Return product id field name - entity_id|row_id + * + * @return string + * @throws \Exception + */ + private function getProductLinkField() + { + return $this->metadataPool + ->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class) + ->getLinkField(); + } } diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/AdminCategoryRestrictedUrlMessageData.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/AdminCategoryRestrictedUrlMessageData.xml index b463b0524d5ff..5fbf9e474e232 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/AdminCategoryRestrictedUrlMessageData.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/AdminCategoryRestrictedUrlMessageData.xml @@ -13,5 +13,6 @@ <data key="urlSoap">URL key "soap" matches a reserved endpoint name (admin, soap, rest, graphql, standard). Use another URL key.</data> <data key="urlRest">URL key "rest" matches a reserved endpoint name (admin, soap, rest, graphql, standard). Use another URL key.</data> <data key="urlGraphql">URL key "graphql" matches a reserved endpoint name (admin, soap, rest, graphql, standard). Use another URL key.</data> + <data key="urlAdminError">URL key "admin" matches a reserved endpoint name (admin). Use another URL key.</data> </entity> </entities> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml index 213099d3ba974..89bb8285cd472 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml @@ -45,12 +45,12 @@ <argument name="categoryName" value="admin"/> <argument name="categoryUrlKey" value=""/> </actionGroup> - <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdmin}}' stepKey="seeAdminFirstErrorMessage"/> + <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdminError}}' stepKey="seeAdminFirstErrorMessage"/> <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminSecondCategoryForm"> <argument name="categoryName" value="{{SimpleSubCategory.name}}"/> <argument name="categoryUrlKey" value="admin"/> </actionGroup> - <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdmin}}' stepKey="seeAdminSecondErrorMessage"/> + <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdminError}}' stepKey="seeAdminSecondErrorMessage"/> <!--Create category with 'admin' name--> <comment userInput="Create category with 'admin' name" stepKey="commentAdminCategoryCreation"/> <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminThirdCategoryForm"> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml index 0e4ee26a462e6..b8af481c2eee1 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml @@ -17,10 +17,7 @@ <before> <magentoCLI command="config:set {{EnableCategoriesPathProductUrls.path}} {{EnableCategoriesPathProductUrls.value}}" stepKey="enableUseCategoriesPath"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> - + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> <createData entity="_defaultCategoryDifferentUrlStore" stepKey="defaultCategory"/> @@ -38,9 +35,7 @@ <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="defaultCategory" stepKey="deleteNewRootCategory"/> <magentoCLI command="config:set {{DisableCategoriesPathProductUrls.path}} {{DisableCategoriesPathProductUrls.value}}" stepKey="disableUseCategoriesPath"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedDefaultCategory"> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml index ad426c4bc6c4c..12caaca769762 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml @@ -80,7 +80,7 @@ <magentoCLI command="cron:run --group=index" stepKey="runCron"/> <!--Got to Store front product page and check url--> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.sku$$-new)}}" stepKey="navigateToSimpleProductPage"/> - <seeInCurrentUrl url="{{StorefrontProductPage.url($$createProduct.sku$$-new)}}" stepKey="seeProductNewUrl"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$-new)}}" stepKey="navigateToSimpleProductPage"/> + <seeInCurrentUrl url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$-new)}}" stepKey="seeProductNewUrl"/> </test> </tests> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml index 4880d438373f4..8f5d45513e624 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryAccessibleWhenSuffixIsNullTest.xml @@ -21,9 +21,7 @@ <magentoCLI command="config:set catalog/seo/category_url_suffix ''" stepKey="setCategoryUrlSuffix"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 0" stepKey="setCategoryProductRewrites"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBefore"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheBefore"/> <createData entity="_defaultCategory" stepKey="createCategory"/> </before> <after> @@ -32,12 +30,10 @@ stepKey="restoreCategoryUrlSuffix"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="restoreCategoryProductRewrites"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfter"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfter"/> </after> - <amOnPage url="/$$createCategory.name$$" stepKey="onCategoryPage"/> + <amOnPage url="/$$createCategory.custom_attributes[url_key]$$" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <seeInTitle userInput="$$createCategory.name$$" stepKey="assertCategoryNameInTitle"/> </test> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml index 783d9fa31c996..3275a136aa118 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml @@ -32,9 +32,7 @@ </actionGroup> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindexAfterCreate"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBefore"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheBefore"/> </before> <after> <magentoCLI command="config:set catalog/seo/product_use_categories 0" stepKey="setEnableUseCategoriesPath"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCheckCategoryUrlPathForCustomStoreAfterChangingHierarchyTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCheckCategoryUrlPathForCustomStoreAfterChangingHierarchyTest.xml new file mode 100644 index 0000000000000..c28b48f27006f --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCheckCategoryUrlPathForCustomStoreAfterChangingHierarchyTest.xml @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCheckCategoryUrlPathForCustomStoreAfterChangingHierarchyTest"> + <annotations> + <features value="CatalogUrlRewrite"/> + <stories value="Url rewrites"/> + <title value="Checking category URL path for custom store after changing hierarchy"/> + <description value="Checks that category and its children have correct URL path for custom store after changing hierarchy"/> + <severity value="MAJOR"/> + <testCaseId value="MC-41615"/> + <useCaseId value="MC-40780"/> + <group value="catalog"/> + <group value="urlRewrite"/> + </annotations> + <before> + <!-- Create categories --> + <createData entity="_defaultCategory" stepKey="createCategory1"/> + <createData entity="SubCategoryWithParent" stepKey="createCategory2"> + <requiredEntity createDataKey="createCategory1"/> + </createData> + <createData entity="_defaultCategory" stepKey="createCategory3"/> + <createData entity="_defaultCategory" stepKey="createCategory4"/> + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Create "EN" Store View --> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createEnStoreView"> + <argument name="customStore" value="customStoreEN"/> + </actionGroup> + </before> + <after> + <!-- Delete categories --> + <deleteData createDataKey="createCategory4" stepKey="deleteCategory4"/> + <deleteData createDataKey="createCategory3" stepKey="deleteCategory3"/> + <deleteData createDataKey="createCategory2" stepKey="deleteCategory2"/> + <deleteData createDataKey="createCategory1" stepKey="deleteCategory1"/> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteEnStoreView"> + <argument name="customStore" value="customStoreEN"/> + </actionGroup> + <!-- Clear grid filters --> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearStoreFilters"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Go to Category 1 edit page on "EN" store view --> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="goToCategory1PageOnEnStoreView"> + <argument name="Store" value="customStoreEN.name"/> + <argument name="CatName" value="$createCategory1.name$"/> + </actionGroup> + + <!-- Change Name and URL key for Category 1 --> + <actionGroup ref="AdminChangeCategoryNameOnStoreViewLevelActionGroup" stepKey="changeCategory1NameForEnStoreView"> + <argument name="categoryName" value="EN 1"/> + </actionGroup> + <actionGroup ref="AdminChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeCategory1UrlKeyForEnStoreView"> + <argument name="value" value="en 1"/> + </actionGroup> + + <!-- Change Name and URL key for Category 2 --> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory2EditPage"> + <argument name="category" value="$createCategory2$"/> + </actionGroup> + <actionGroup ref="AdminChangeCategoryNameOnStoreViewLevelActionGroup" stepKey="changeCategory2NameForEnStoreView"> + <argument name="categoryName" value="EN 2"/> + </actionGroup> + <actionGroup ref="AdminChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeCategory2UrlKeyForEnStoreView"> + <argument name="value" value="en 2"/> + </actionGroup> + + <!-- Change Name and URL key for Category 3 --> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory3EditPage"> + <argument name="category" value="$createCategory3$"/> + </actionGroup> + <actionGroup ref="AdminChangeCategoryNameOnStoreViewLevelActionGroup" stepKey="changeCategory3NameForEnStoreView"> + <argument name="categoryName" value="EN 3"/> + </actionGroup> + <actionGroup ref="AdminChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeCategory3UrlKeyForEnStoreView"> + <argument name="value" value="en 3"/> + </actionGroup> + + <!-- Change Name and URL key for Category 4 --> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory4EditPage"> + <argument name="category" value="$createCategory4$"/> + </actionGroup> + <actionGroup ref="AdminChangeCategoryNameOnStoreViewLevelActionGroup" stepKey="changeCategory4NameForEnStoreView"> + <argument name="categoryName" value="EN 4"/> + </actionGroup> + <actionGroup ref="AdminChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeCategory4UrlKeyForEnStoreView"> + <argument name="value" value="en 4"/> + </actionGroup> + + <!-- Go to Home page on the Storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> + <!-- Switch store view to 'EN' --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStoreViewToEn"> + <argument name="storeView" value="customStoreEN"/> + </actionGroup> + + <!-- Assert Category 2 URL path on the 'EN' store view --> + <actionGroup ref="StorefrontGoToSubCategoryPageActionGroup" stepKey="navigateToCategory2Page"> + <argument name="categoryName" value="EN 1"/> + <argument name="subCategoryName" value="EN 2"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProperUrlIsShownActionGroup" stepKey="assertUrlPathForCategory2"> + <argument name="urlPath" value="/en-1/en-2.html"/> + </actionGroup> + + <!-- Go to Categories page on the Admin --> + <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="goToAdminCategoriesPage"/> + <see userInput="All Store View" selector="{{AdminMainActionsSection.storeViewDropdown}}" stepKey="assertAllStoreView"/> + + <!-- Move Category 2 to 'Default Category' --> + <actionGroup ref="MoveCategoryActionGroup" stepKey="moveCategory2ToDefaultCategory"> + <argument name="childCategory" value="$createCategory2.name$"/> + <argument name="parentCategory" value="Default Category"/> + </actionGroup> + <!-- Move Category 4 to Category 3 --> + <actionGroup ref="MoveCategoryActionGroup" stepKey="moveCategory4ToCategory3"> + <argument name="childCategory" value="$createCategory4.name$"/> + <argument name="parentCategory" value="$createCategory3.name$"/> + </actionGroup> + + <!-- Create Category 5 --> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="navigateToCategory2EditPage"> + <argument name="category" value="$createCategory2$"/> + </actionGroup> + <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickToAddCategory5"/> + <checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory5"/> + <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SimpleSubCategory.name}}" stepKey="fillCategory5Name"/> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory5"/> + <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertCategory5Saved"/> + + <!-- Assert Category 5 URL path on the 'EN' store view --> + <actionGroup ref="StorefrontGoToSubCategoryPageActionGroup" stepKey="navigateToCategory5Page"> + <argument name="categoryName" value="EN 2"/> + <argument name="subCategoryName" value="{{SimpleSubCategory.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProperUrlIsShownActionGroup" stepKey="assertUrlPathForCategory5"> + <argument name="urlPath" value="en-2/{{SimpleSubCategory.name_lwr}}.html"/> + </actionGroup> + + <!-- Go to Category 2 edit page on "EN" store view --> + <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="goToAdminCategoryIndexPage"/> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="goToCategory2EditPage"> + <argument name="category" value="$createCategory2$"/> + </actionGroup> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToDefaultStoreView"> + <argument name="storeView" value="customStoreEN.name"/> + </actionGroup> + + <!-- Change Category 2 URL key to default value --> + <actionGroup ref="AdminChangeSeoUrlKeyToDefaultValueWithoutRedirectActionGroup" stepKey="changeCategory2UrlKeyToDefaultValue"/> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory2"/> + <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertCategory2Saved"/> + + <!-- Go to Home page on the Storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="navigateToHomePage"/> + <!-- Assert Category 5 URL path on the 'EN' store view after change parent category --> + <actionGroup ref="StorefrontGoToSubCategoryPageActionGroup" stepKey="goToCategory5Page"> + <argument name="categoryName" value="EN 2"/> + <argument name="subCategoryName" value="{{SimpleSubCategory.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProperUrlIsShownActionGroup" stepKey="assertUrlPathForCategory5AfterChangeParent"> + <argument name="urlPath" value="$createCategory2.name_lwr$/{{SimpleSubCategory.name_lwr}}.html"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Category/MoveTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Category/MoveTest.php index 6faebc1154dcf..44997591a6901 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Category/MoveTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Category/MoveTest.php @@ -91,27 +91,26 @@ protected function setUp(): void public function testAfterChangeParent() { $urlPath = 'test/path'; - $storeIds = [1]; + $storeIds = [0, 1]; $originalCategory = $this->getMockBuilder(Category::class) ->disableOriginalConstructor() ->getMock(); $this->categoryFactory->method('create') ->willReturn($originalCategory); - $this->categoryMock->method('getResource') ->willReturn($this->subjectMock); $this->categoryMock->expects($this->once()) ->method('getStoreIds') ->willReturn($storeIds); - $this->childrenCategoriesProviderMock->expects($this->once()) + $this->childrenCategoriesProviderMock->expects($this->exactly(2)) ->method('getChildren') ->with($this->categoryMock, true) ->willReturn([]); - $this->categoryUrlPathGeneratorMock->expects($this->once()) + $this->categoryUrlPathGeneratorMock->expects($this->exactly(2)) ->method('getUrlPath') ->with($this->categoryMock) ->willReturn($urlPath); - $this->categoryMock->expects($this->once()) + $this->categoryMock->expects($this->exactly(2)) ->method('setUrlPath') ->with($urlPath); $this->assertSame( diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Storage/DynamicStorageTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Storage/DynamicStorageTest.php new file mode 100644 index 0000000000000..4389498a3297b --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Storage/DynamicStorageTest.php @@ -0,0 +1,327 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewrite\Test\Unit\Model\Storage; + +use Magento\Catalog\Model\ResourceModel\Product; +use Magento\Catalog\Model\ResourceModel\ProductFactory; +use Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator; +use Magento\CatalogUrlRewrite\Model\Storage\DynamicStorage; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Framework\DB\Select; +use Magento\UrlRewrite\Model\OptionProvider; +use Magento\Store\Model\ScopeInterface; +use Magento\UrlRewrite\Service\V1\Data\UrlRewriteFactory; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use ReflectionMethod; + +class DynamicStorageTest extends TestCase +{ + /** + * @var DynamicStorage + */ + private $object; + + /** + * @var UrlRewriteFactory|MockObject + */ + private $urlRewriteFactoryMock; + + /** + * @var DataObjectHelper|MockObject + */ + private $dataObjectHelperMock; + + /** + * @var AdapterInterface|MockObject + */ + private $connectionMock; + + /** + * @var Select|MockObject + */ + private $selectMock; + + /** + * @var ResourceConnection|MockObject + */ + private $resourceConnectionMock; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @var Product|MockObject + */ + private $productResourceMock; + + /** + * @var ProductFactory|MockObject + */ + private $productFactoryMock; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->urlRewriteFactoryMock = $this->getMockBuilder(UrlRewriteFactory::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->dataObjectHelperMock = $this->getMockBuilder(DataObjectHelper::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->connectionMock = $this->getMockBuilder(AdapterInterface::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->selectMock = $this->getMockBuilder(Select::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->resourceConnectionMock = $this->getMockBuilder(ResourceConnection::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->connectionMock + ->method('select') + ->willReturn($this->selectMock); + + $this->resourceConnectionMock + ->method('getConnection') + ->willReturn($this->connectionMock); + + $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) + ->getMock(); + + $this->productResourceMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->productFactoryMock = $this->getMockBuilder(ProductFactory::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->productFactoryMock + ->method('create') + ->willReturn($this->productResourceMock); + + $this->object = new DynamicStorage( + $this->urlRewriteFactoryMock, + $this->dataObjectHelperMock, + $this->resourceConnectionMock, + $this->scopeConfigMock, + $this->productFactoryMock + ); + } + + /** + * @dataProvider findProductRewriteByRequestPathDataProvider + * @param array $data + * @param array|false $productFromDb + * @param string $categorySuffix + * @param array|false $categoryFromDb + * @param bool $canBeShownInCategory + * @param array|null $expectedProductRewrite + * @throws \ReflectionException + */ + public function testFindProductRewriteByRequestPath( + array $data, + $productFromDb, + string $categorySuffix, + $categoryFromDb, + bool $canBeShownInCategory, + ?array $expectedProductRewrite + ): void { + $this->connectionMock->expects($this->any()) + ->method('fetchRow') + ->will($this->onConsecutiveCalls($productFromDb, $categoryFromDb)); + + $scopeConfigMap = [ + [ + CategoryUrlPathGenerator::XML_PATH_CATEGORY_URL_SUFFIX, + ScopeInterface::SCOPE_STORE, + $data['store_id'], + $categorySuffix + ] + ]; + + $this->scopeConfigMock + ->method('getValue') + ->willReturnMap($scopeConfigMap); + + $this->productResourceMock + ->method('canBeShowInCategory') + ->willReturn($canBeShownInCategory); + + $method = new ReflectionMethod($this->object, 'findProductRewriteByRequestPath'); + $method->setAccessible(true); + + $this->assertSame($expectedProductRewrite, $method->invoke($this->object, $data)); + } + + /** + * @return array + */ + public function findProductRewriteByRequestPathDataProvider(): array + { + return [ + [ + // Non-existing product + [ + 'request_path' => 'test.html', + 'store_id' => 1 + ], + false, + '', + null, + true, + null + ], + [ + // Non-existing category + [ + 'request_path' => 'a/test.html', + 'store_id' => 1 + ], + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'test.html', + 'target_path' => 'catalog/product/view/id/1', + 'redirect_type' => '0', + ], + '.html', + false, + true, + null + ], + [ + // Existing category + [ + 'request_path' => 'shop/test.html', + 'store_id' => 1 + ], + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'test.html', + 'target_path' => 'catalog/product/view/id/1', + 'redirect_type' => '0', + ], + '.html', + [ + 'entity_type' => 'category', + 'entity_id' => '3', + 'request_path' => 'shop.html', + 'target_path' => 'catalog/category/view/id/3', + 'redirect_type' => '0', + ], + true, + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'shop/test.html', + 'target_path' => 'catalog/product/view/id/1/category/3', + 'redirect_type' => '0', + ] + ], + [ + // Existing category, but can't be shown in category + [ + 'request_path' => 'shop/test.html', + 'store_id' => 1 + ], + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'test.html', + 'target_path' => 'catalog/product/view/id/1', + 'redirect_type' => '0', + ], + '.html', + [ + 'entity_type' => 'category', + 'entity_id' => '3', + 'request_path' => 'shop.html', + 'target_path' => 'catalog/category/view/id/3', + 'redirect_type' => '0', + ], + false, + null + ], + [ + // Existing category, with product 301 redirect type + [ + 'request_path' => 'shop/test.html', + 'store_id' => 1 + ], + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'test.html', + 'target_path' => 'test-new.html', + 'redirect_type' => OptionProvider::PERMANENT, + ], + '.html', + [ + 'entity_type' => 'category', + 'entity_id' => '3', + 'request_path' => 'shop.html', + 'target_path' => 'catalog/category/view/id/3', + 'redirect_type' => '0', + ], + true, + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'shop/test.html', + 'target_path' => 'shop/test-new.html', + 'redirect_type' => OptionProvider::PERMANENT, + ] + ], + [ + // Existing category, with category 301 redirect type + [ + 'request_path' => 'shop/test.html', + 'store_id' => 1 + ], + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'test.html', + 'target_path' => 'catalog/product/view/id/1', + 'redirect_type' => '0', + ], + '.html', + [ + 'entity_type' => 'category', + 'entity_id' => '3', + 'request_path' => 'shop.html', + 'target_path' => 'shop-new.html', + 'redirect_type' => OptionProvider::PERMANENT, + ], + true, + [ + 'entity_type' => 'product', + 'entity_id' => '1', + 'request_path' => 'shop/test.html', + 'target_path' => 'shop-new/test.html', + 'redirect_type' => OptionProvider::PERMANENT, + ] + ], + ]; + } +} diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryUrlPathAutogeneratorObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryUrlPathAutogeneratorObserverTest.php index f491f63700a47..367336c09f862 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryUrlPathAutogeneratorObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryUrlPathAutogeneratorObserverTest.php @@ -7,9 +7,11 @@ namespace Magento\CatalogUrlRewrite\Test\Unit\Observer; -use Magento\Catalog\Model\ResourceModel\Category; +use Magento\Catalog\Model\Category; +use Magento\Catalog\Model\ResourceModel\Category as CategoryResource; use Magento\CatalogUrlRewrite\Model\Category\ChildrenCategoriesProvider; use Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator; +use Magento\CatalogUrlRewrite\Model\ResourceModel\Category\GetDefaultUrlKey; use Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogeneratorObserver; use Magento\CatalogUrlRewrite\Service\V1\StoreViewService; use Magento\Framework\Event\Observer; @@ -18,7 +20,11 @@ use Magento\Store\Model\Store; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; +/** + * Unit tests for \Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogeneratorObserver class. + */ class CategoryUrlPathAutogeneratorObserverTest extends TestCase { /** @@ -52,10 +58,20 @@ class CategoryUrlPathAutogeneratorObserverTest extends TestCase private $storeViewService; /** - * @var Category|MockObject + * @var CategoryResource|MockObject */ private $categoryResource; + /** + * @var CompositeUrlKey|MockObject + */ + private $compositeUrlValidator; + + /** + * @var GetDefaultUrlKey|MockObject + */ + private $getDefaultUrlKey; + /** * @inheritDoc */ @@ -66,34 +82,44 @@ protected function setUp(): void ->onlyMethods(['getEvent']) ->disableOriginalConstructor() ->getMock(); - $this->categoryResource = $this->createMock(Category::class); + $this->categoryResource = $this->createMock(CategoryResource::class); $this->category = $this->createPartialMock( - \Magento\Catalog\Model\Category::class, + Category::class, [ 'dataHasChangedFor', 'getResource', 'getStoreId', - 'formatUrlKey' + 'formatUrlKey', + 'getId', + 'hasChildren', ] ); $this->category->expects($this->any())->method('getResource')->willReturn($this->categoryResource); $this->observer->expects($this->any())->method('getEvent')->willReturnSelf(); $this->observer->expects($this->any())->method('getCategory')->willReturn($this->category); - $this->categoryUrlPathGenerator = $this->createMock( - CategoryUrlPathGenerator::class - ); - $this->childrenCategoriesProvider = $this->createMock( - ChildrenCategoriesProvider::class - ); + $this->categoryUrlPathGenerator = $this->createMock(CategoryUrlPathGenerator::class); + $this->childrenCategoriesProvider = $this->createMock(ChildrenCategoriesProvider::class); $this->storeViewService = $this->createMock(StoreViewService::class); + $this->compositeUrlValidator = $this->getMockBuilder(CompositeUrlKey::class) + ->disableOriginalConstructor() + ->onlyMethods(['validate']) + ->getMock(); + + $this->getDefaultUrlKey = $this->getMockBuilder(GetDefaultUrlKey::class) + ->disableOriginalConstructor() + ->onlyMethods(['execute']) + ->getMock(); + $this->categoryUrlPathAutogeneratorObserver = (new ObjectManagerHelper($this))->getObject( CategoryUrlPathAutogeneratorObserver::class, [ 'categoryUrlPathGenerator' => $this->categoryUrlPathGenerator, 'childrenCategoriesProvider' => $this->childrenCategoriesProvider, 'storeViewService' => $this->storeViewService, + 'compositeUrlValidator' => $this->compositeUrlValidator, + 'getDefaultUrlKey' => $this->getDefaultUrlKey, ] ); } @@ -114,6 +140,7 @@ public function testShouldFormatUrlKeyAndGenerateUrlPathIfUrlKeyIsNotUsingDefaul $this->categoryUrlPathGenerator->expects($this->once())->method('getUrlPath')->willReturn($expectedUrlPath); $this->assertEquals($categoryData['url_key'], $this->category->getUrlKey()); $this->assertEquals($categoryData['url_path'], $this->category->getUrlPath()); + $this->compositeUrlValidator->expects($this->once())->method('validate')->with('formatted_url_key')->willReturn([]); $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); $this->assertEquals($expectedUrlKey, $this->category->getUrlKey()); $this->assertEquals($expectedUrlPath, $this->category->getUrlPath()); @@ -132,16 +159,26 @@ public function shouldFormatUrlKeyAndGenerateUrlPathIfUrlKeyIsNotUsingDefaultVal } /** - * @param $isObjectNew + * @param bool $isObjectNew + * @param int $storeId + * @return void * @throws LocalizedException * @dataProvider shouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValueDataProvider */ - public function testShouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValue($isObjectNew) + public function testShouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValue(bool $isObjectNew, int $storeId): void { - $categoryData = ['use_default' => ['url_key' => 1], 'url_key' => 'some_key', 'url_path' => 'some_path']; + $categoryData = [ + 'use_default' => ['url_key' => 1], + 'url_key' => 'some_key', + 'url_path' => 'some_path', + ]; $this->category->setData($categoryData); $this->category->isObjectNew($isObjectNew); $this->category->expects($this->any())->method('formatUrlKey')->willReturn('formatted_key'); + $this->category->expects($this->any())->method('getStoreId')->willReturn($storeId); + $this->category->expects($this->once()) + ->method('hasChildren') + ->willReturn(false); $this->assertEquals($categoryData['url_key'], $this->category->getUrlKey()); $this->assertEquals($categoryData['url_path'], $this->category->getUrlPath()); $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); @@ -152,14 +189,83 @@ public function testShouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValue($isOb /** * @return array */ - public function shouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValueDataProvider() + public function shouldResetUrlPathAndUrlKeyIfUrlKeyIsUsingDefaultValueDataProvider(): array { return [ - [true], - [false], + [false, 0], + [false, 1], + [true, 1], + [true, 0], ]; } + /** + * @return void + */ + public function testShouldUpdateUrlPathForChildrenIfUrlKeyIsUsingDefaultValueForSpecificStore(): void + { + $storeId = 1; + $categoryId = 1; + $categoryData = [ + 'use_default' => ['url_key' => 1], + 'url_key' => null, + 'url_path' => 'some_path', + ]; + + $this->category->setData($categoryData); + $this->category->isObjectNew(false); + $this->category->expects($this->any()) + ->method('getStoreId') + ->willReturn($storeId); + $this->category->expects($this->once()) + ->method('hasChildren') + ->willReturn(true); + $this->category->expects($this->exactly(2)) + ->method('getId') + ->willReturn($categoryId); + $this->getDefaultUrlKey->expects($this->once()) + ->method('execute') + ->with($categoryId) + ->willReturn('default_url_key'); + $this->category->expects($this->once()) + ->method('dataHasChangedFor') + ->with('url_path') + ->willReturn(true); + + $childCategory = $this->getMockBuilder(Category::class) + ->onlyMethods( + [ + 'getResource', + 'getStore', + 'getStoreId', + 'setStoreId', + ] + ) + ->addMethods( + [ + 'getUrlPath', + 'setUrlPath', + ] + ) + ->disableOriginalConstructor() + ->getMock(); + $childCategory->expects($this->any()) + ->method('getResource') + ->willReturn($this->categoryResource); + $childCategory->expects($this->once()) + ->method('setStoreId') + ->with($storeId) + ->willReturnSelf(); + + $this->childrenCategoriesProvider->expects($this->once()) + ->method('getChildren') + ->willReturn([$childCategory]); + + $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); + $this->assertNull($this->category->getUrlKey()); + $this->assertNull($this->category->getUrlPath()); + } + /** * @param $useDefaultUrlKey * @param $isObjectNew @@ -206,6 +312,7 @@ public function testUrlPathAttributeUpdating() $this->categoryUrlPathGenerator->expects($this->any())->method('getUrlPath')->willReturn($expectedUrlPath); $this->categoryResource->expects($this->once())->method('saveAttribute')->with($this->category, 'url_path'); $this->category->expects($this->once())->method('dataHasChangedFor')->with('url_path')->willReturn(false); + $this->compositeUrlValidator->expects($this->once())->method('validate')->with('formatted_url_key')->willReturn([]); $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); } @@ -222,6 +329,7 @@ public function testChildrenUrlPathAttributeNoUpdatingIfParentUrlPathIsNotChange // break code execution $this->category->expects($this->once())->method('dataHasChangedFor')->with('url_path')->willReturn(false); + $this->compositeUrlValidator->expects($this->once())->method('validate')->with('url_key')->willReturn([]); $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); } @@ -238,10 +346,10 @@ public function testChildrenUrlPathAttributeUpdatingForSpecificStore() // only for specific store $this->category->expects($this->atLeastOnce())->method('getStoreId')->willReturn(1); - $childCategoryResource = $this->getMockBuilder(Category::class) + $childCategoryResource = $this->getMockBuilder(CategoryResource::class) ->disableOriginalConstructor() ->getMock(); - $childCategory = $this->getMockBuilder(\Magento\Catalog\Model\Category::class) + $childCategory = $this->getMockBuilder(Category::class) ->setMethods( [ 'getUrlPath', @@ -260,6 +368,7 @@ public function testChildrenUrlPathAttributeUpdatingForSpecificStore() $this->childrenCategoriesProvider->expects($this->once())->method('getChildren')->willReturn([$childCategory]); $childCategory->expects($this->once())->method('setUrlPath')->with('generated_url_path')->willReturnSelf(); $childCategoryResource->expects($this->once())->method('saveAttribute')->with($childCategory, 'url_path'); + $this->compositeUrlValidator->expects($this->once())->method('validate')->with('generated_url_key')->willReturn([]); $this->categoryUrlPathAutogeneratorObserver->execute($this->observer); } diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductUrlKeyAutogeneratorObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductUrlKeyAutogeneratorObserverTest.php index 51b6a3dd96682..8e0b4eee1a659 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductUrlKeyAutogeneratorObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductUrlKeyAutogeneratorObserverTest.php @@ -15,6 +15,7 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; /** * Unit tests for \Magento\CatalogUrlRewrite\Observer\ProductUrlKeyAutogeneratorObserver class @@ -29,6 +30,11 @@ class ProductUrlKeyAutogeneratorObserverTest extends TestCase /** @var ProductUrlKeyAutogeneratorObserver */ private $productUrlKeyAutogeneratorObserver; + /** + * @var CompositeUrlKey|MockObject + */ + private $compositeUrlValidator; + /** * @inheritdoc */ @@ -39,10 +45,16 @@ protected function setUp(): void ->setMethods(['getUrlKey']) ->getMock(); + $this->compositeUrlValidator = $this->getMockBuilder(CompositeUrlKey::class) + ->disableOriginalConstructor() + ->setMethods(['validate']) + ->getMock(); + $this->productUrlKeyAutogeneratorObserver = (new ObjectManagerHelper($this))->getObject( ProductUrlKeyAutogeneratorObserver::class, [ - 'productUrlPathGenerator' => $this->productUrlPathGenerator + 'productUrlPathGenerator' => $this->productUrlPathGenerator, + 'compositeUrlValidator' => $this->compositeUrlValidator ] ); } @@ -73,6 +85,8 @@ public function testExecuteWithUrlKey(): void $this->productUrlPathGenerator->expects($this->atLeastOnce())->method('getUrlKey')->with($product) ->willReturn($urlKey); + $this->compositeUrlValidator->expects($this->once())->method('validate')->with($urlKey)->willReturn([]); + $this->productUrlKeyAutogeneratorObserver->execute($observer); } diff --git a/app/code/Magento/CatalogUrlRewrite/etc/db_schema.xml b/app/code/Magento/CatalogUrlRewrite/etc/db_schema.xml index aaf86e7d4418e..5bbefc6445435 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/db_schema.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/db_schema.xml @@ -15,6 +15,9 @@ comment="category_id"/> <column xsi:type="int" name="product_id" unsigned="true" nullable="false" identity="false" comment="product_id"/> + <constraint xsi:type="primary" referenceId="PRIMARY"> + <column name="url_rewrite_id"/> + </constraint> <constraint xsi:type="foreign" referenceId="CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID" table="catalog_url_rewrite_product_category" column="product_id" referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/> diff --git a/app/code/Magento/CatalogUrlRewrite/etc/db_schema_whitelist.json b/app/code/Magento/CatalogUrlRewrite/etc/db_schema_whitelist.json index 5562ae5d48cc9..ce7cb7b9bb64d 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/db_schema_whitelist.json +++ b/app/code/Magento/CatalogUrlRewrite/etc/db_schema_whitelist.json @@ -9,6 +9,7 @@ "CATALOG_URL_REWRITE_PRODUCT_CATEGORY_CATEGORY_ID_PRODUCT_ID": true }, "constraint": { + "PRIMARY": true, "CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID": true, "FK_BB79E64705D7F17FE181F23144528FC8": true, "CAT_URL_REWRITE_PRD_CTGR_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID": true, @@ -16,4 +17,4 @@ "CAT_URL_REWRITE_PRD_CTGR_PRD_ID_SEQUENCE_PRD_SEQUENCE_VAL": true } } -} \ No newline at end of file +} diff --git a/app/code/Magento/CatalogUrlRewrite/etc/di.xml b/app/code/Magento/CatalogUrlRewrite/etc/di.xml index 533693692cd5c..5c25d11986eb9 100644 --- a/app/code/Magento/CatalogUrlRewrite/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewrite/etc/di.xml @@ -48,17 +48,6 @@ </argument> </arguments> </type> - <type name="Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogeneratorObserver"> - <arguments> - <argument name="invalidValues" xsi:type="array"> - <item name="0" xsi:type="string">admin</item> - <item name="1" xsi:type="string">soap</item> - <item name="2" xsi:type="string">rest</item> - <item name="3" xsi:type="string">graphql</item> - <item name="4" xsi:type="string">standard</item> - </argument> - </arguments> - </type> <type name="Magento\UrlRewrite\Model\UrlRewrite"> <arguments> <argument name="entityToCacheTagMap" xsi:type="array"> diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/CatalogTreeDataProvider.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/CatalogTreeDataProvider.php new file mode 100644 index 0000000000000..c4f7066340dc0 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/CatalogTreeDataProvider.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewriteGraphQl\Model\DataProvider\UrlRewrite; + +use Magento\Catalog\Model\CategoryRepository; +use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\CategoryTree as CategoryTreeDataProvider; +use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\ExtractDataFromCategoryTree; +use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderInterface; + +class CatalogTreeDataProvider implements EntityDataProviderInterface +{ + /** + * @var ExtractDataFromCategoryTree + */ + private $extractDataFromCategoryTree; + + /** + * @var CategoryTreeDataProvider + */ + private $categoryTree; + + /** + * @var CategoryRepository + */ + private $categoryRepository; + + /** + * @param CategoryTreeDataProvider $categoryTree + * @param ExtractDataFromCategoryTree $extractDataFromCategoryTree + * @param CategoryRepository $categoryRepository + */ + public function __construct( + CategoryTreeDataProvider $categoryTree, + ExtractDataFromCategoryTree $extractDataFromCategoryTree, + CategoryRepository $categoryRepository + ) { + $this->categoryTree = $categoryTree; + $this->extractDataFromCategoryTree = $extractDataFromCategoryTree; + $this->categoryRepository = $categoryRepository; + } + + /** + * Get catalog tree data + * + * @param string $entity_type + * @param int $id + * @param ResolveInfo|null $info + * @param int|null $storeId + * @return array + * @throws GraphQlNoSuchEntityException + */ + public function getData( + string $entity_type, + int $id, + ResolveInfo $info = null, + int $storeId = null + ): array { + $categoryId = (int)$id; + $categoriesTree = $this->categoryTree->getTree($info, $categoryId, $storeId); + if (empty($categoriesTree) || ($categoriesTree->count() == 0)) { + throw new GraphQlNoSuchEntityException(__('Category doesn\'t exist')); + } + $result = current($this->extractDataFromCategoryTree->execute($categoriesTree)); + $result['type_id'] = $entity_type; + return $result; + } +} diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/ProductDataProvider.php b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/ProductDataProvider.php new file mode 100644 index 0000000000000..a88c31e137221 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/ProductDataProvider.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogUrlRewriteGraphQl\Model\DataProvider\UrlRewrite; + +use Magento\Catalog\Model\ProductRepository; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderInterface; + +class ProductDataProvider implements EntityDataProviderInterface +{ + /** + * @var ProductRepository + */ + private $productRepository; + + /** + * @param ProductRepository $productRepository + */ + public function __construct( + ProductRepository $productRepository + ) { + $this->productRepository = $productRepository; + } + + /** + * Get catalog tree data + * + * @param string $entity_type + * @param int $id + * @param ResolveInfo|null $info + * @param int|null $storeId + * @return array + * @throws NoSuchEntityException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData( + string $entity_type, + int $id, + ResolveInfo $info = null, + int $storeId = null + ): array { + $product = $this->productRepository->getById($id, false, $storeId); + $result = $product->getData(); + $result['model'] = $product; + return $result; + } +} diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json b/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json index 3b64d51b85568..3119eb6667b06 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json @@ -6,6 +6,8 @@ "php": "~7.3.0||~7.4.0", "magento/module-store": "*", "magento/module-catalog": "*", + "magento/module-catalog-graph-ql": "*", + "magento/module-url-rewrite-graph-ql": "*", "magento/framework": "*" }, "suggest": { diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml index 8724972e71b17..cb7362717fff6 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml @@ -30,4 +30,13 @@ </argument> </arguments> </type> + + <type name="Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderComposite"> + <arguments> + <argument name="dataProviders" xsi:type="array"> + <item name="category" xsi:type="object">Magento\CatalogUrlRewriteGraphQl\Model\DataProvider\UrlRewrite\CatalogTreeDataProvider</item> + <item name="product" xsi:type="object">Magento\CatalogUrlRewriteGraphQl\Model\DataProvider\UrlRewrite\ProductDataProvider</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/graphql/di.xml b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/graphql/di.xml new file mode 100755 index 0000000000000..2e3e4a2aec0d7 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/graphql/di.xml @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="category_type_resolver" xsi:type="object">Magento\CatalogGraphQl\Model\CategoryTypeResolver</item> + <item name="catalog_type_resolver" xsi:type="object">Magento\CatalogGraphQl\Model\CatalogProductTypeResolver</item> + </argument> + </arguments> + </type> +</config> diff --git a/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php b/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php index f9340a495de65..e4bb0a8a66b0f 100644 --- a/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php +++ b/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php @@ -149,6 +149,8 @@ public function addToCollection($collection) $attributes[$attributeCode] = true; $this->getRule()->setCollectedAttributes($attributes); } + } else { + $this->joinedAttributes['price'] ='price_index.min_price'; } return $this; @@ -244,8 +246,6 @@ public function getMappedSqlField() $result = parent::getMappedSqlField(); } elseif (isset($this->joinedAttributes[$this->getAttribute()])) { $result = $this->joinedAttributes[$this->getAttribute()]; - } elseif ($this->getAttribute() === 'price') { - $result = 'price_index.min_price'; } elseif ($this->getAttributeObject()->isStatic()) { $result = $this->getAttributeObject()->getAttributeCode(); } elseif ($this->getValueParsed()) { diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml index c40071f4ef263..6019c00560bfe 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml @@ -75,7 +75,7 @@ <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="seeSuccessMessage"/> <!--Go to Storefront > category--> - <amOnPage url="$$simplecategory.name$$.html" stepKey="goToStorefrontCategoryPage"/> + <amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded"/> <!--Check operators Greater than--> @@ -95,7 +95,7 @@ </actionGroup> <!--Go to Storefront > category--> - <amOnPage url="$$simplecategory.name$$.html" stepKey="goToStorefrontCategoryPage2"/> + <amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage2"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded2"/> <!--Check operators Greater than--> @@ -115,7 +115,7 @@ </actionGroup> <!--Go to Storefront > category--> - <amOnPage url="$$simplecategory.name$$.html" stepKey="goToStorefrontCategoryPage3"/> + <amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage3"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded3"/> <!--Check operators Greater than--> @@ -135,7 +135,7 @@ </actionGroup> <!--Go to Storefront > category--> - <amOnPage url="$$simplecategory.name$$.html" stepKey="goToStorefrontCategoryPage4"/> + <amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage4"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded4"/> <!--Check operators Greater than--> diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Model/Rule/Condition/ProductTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Model/Rule/Condition/ProductTest.php index 415c9bd811747..600190d3899da 100644 --- a/app/code/Magento/CatalogWidget/Test/Unit/Model/Rule/Condition/ProductTest.php +++ b/app/code/Magento/CatalogWidget/Test/Unit/Model/Rule/Condition/ProductTest.php @@ -11,6 +11,7 @@ use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Catalog\Model\ResourceModel\Product; use Magento\Catalog\Model\ResourceModel\Product\Collection; +use Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitation; use Magento\CatalogWidget\Model\Rule\Condition\Product as ProductWidget; use Magento\Eav\Model\Config; use Magento\Eav\Model\Entity\AbstractEntity; @@ -57,9 +58,13 @@ protected function setUp(): void $storeManager = $this->getMockForAbstractClass(StoreManagerInterface::class); $storeMock = $this->getMockForAbstractClass(StoreInterface::class); $storeManager->expects($this->any())->method('getStore')->willReturn($storeMock); + $storeMock->method('getId') + ->willReturn(1); $this->productResource = $this->createMock(Product::class); $this->productResource->expects($this->once())->method('loadAllAttributes')->willReturnSelf(); $this->productResource->expects($this->once())->method('getAttributesByCode')->willReturn([]); + $connection = $this->getMockForAbstractClass(AdapterInterface::class); + $this->productResource->method('getConnection')->willReturn($connection); $productCategoryList = $this->getMockBuilder(ProductCategoryList::class) ->disableOriginalConstructor() ->getMock(); @@ -100,9 +105,6 @@ public function testAddToCollection() $entityMock = $this->createMock(AbstractEntity::class); $entityMock->expects($this->once())->method('getLinkField')->willReturn('entitiy_id'); $this->attributeMock->expects($this->once())->method('getEntity')->willReturn($entityMock); - $connection = $this->getMockForAbstractClass(AdapterInterface::class); - - $this->productResource->expects($this->atLeastOnce())->method('getConnection')->willReturn($connection); $this->model->addToCollection($collectionMock); } @@ -119,4 +121,116 @@ public function testGetMappedSqlFieldSku() $this->model->setAttribute('attribute_set_id'); $this->assertEquals('e.attribute_set_id', $this->model->getMappedSqlField()); } + + /** + * Test getMappedSqlField method for price attribute. + * + * @dataProvider getMappedSqlFieldPriceDataProvider + * @param bool $isScopeGlobal + * @param bool $isUsingPriceIndex + * @param string $expectedMappedField + */ + public function testGetMappedSqlFieldPrice( + bool $isScopeGlobal, + bool $isUsingPriceIndex, + string $expectedMappedField + ): void { + $productLimitation = new ProductLimitation(); + $productLimitation['use_price_index'] = $isUsingPriceIndex; + $collectionMock = $this->mockCollection( + [ + 'getLimitationFilters' => $productLimitation, + 'getAllAttributeValues' => [ + 1 => [ + 0 => 10, + 1 => 11 + ] + ] + ] + ); + $this->mockAttribute( + [ + 'getAttributeCode' => 'price', + 'isScopeGlobal' => $isScopeGlobal, + 'getBackendType' => 'decimal' + ] + ); + $this->model->setAttribute('price'); + $this->model->setValue(10); + $this->model->setOperator('>='); + $this->model->collectValidatedAttributes($collectionMock); + $this->assertEquals($expectedMappedField, $this->model->getMappedSqlField()); + } + + /** + * @return array + */ + public function getMappedSqlFieldPriceDataProvider(): array + { + return [ + [ + true, + true, + 'price_index.min_price' + ], + [ + true, + false, + 'at_price.value' + ], + [ + false, + true, + 'price_index.min_price' + ], + [ + false, + false, + 'e.entity_id' + ], + ]; + } + + /** + * @param array $configuration + */ + private function mockAttribute(array $configuration = []): void + { + $defaultConfiguration = [ + 'getAttributeCode' => 'code', + 'isStatic' => false, + 'getBackend' => true, + 'isScopeGlobal' => true, + 'getBackendType' => 'int', + ]; + $configuration = array_merge($defaultConfiguration, $configuration); + $this->attributeMock->method('getAttributeCode') + ->willReturn($configuration['getAttributeCode']); + $this->attributeMock->method('isStatic') + ->willReturn($configuration['isStatic']); + $this->attributeMock->method('getBackend') + ->willReturn($configuration['getBackend']); + $this->attributeMock->method('isScopeGlobal') + ->willReturn($configuration['isScopeGlobal']); + $this->attributeMock->method('getBackendType') + ->willReturn($configuration['getBackendType']); + $entityMock = $this->createMock(AbstractEntity::class); + $entityMock->method('getLinkField') + ->willReturn('entitiy_id'); + $this->attributeMock->method('getEntity') + ->willReturn($entityMock); + } + + /** + * @param array $configuration + * @return Collection + */ + private function mockCollection(array $configuration = []): Collection + { + $collectionMock = $this->createConfiguredMock(Collection::class, $configuration); + $selectMock = $this->createMock(Select::class); + $collectionMock->method('getSelect') + ->willReturn($selectMock); + return $collectionMock; + } } diff --git a/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml b/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml index 881d8b28dfaeb..000f3ffd36934 100644 --- a/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml +++ b/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml @@ -3,11 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + use Magento\Framework\App\Action\Action; /** @var \Magento\CatalogWidget\Block\Product\ProductsList $block */ + +// phpcs:disable Generic.Files.LineLength.TooLong +// phpcs:disable Magento2.Templates.ThisInTemplate.FoundHelper ?> -<?php if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())) : ?> +<?php if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())): ?> <?php $type = 'widget-product-grid'; @@ -23,7 +27,7 @@ use Magento\Framework\App\Action\Action; $description = false; ?> <div class="block widget block-products-list <?= /* @noEscape */ $mode ?>"> - <?php if ($block->getTitle()) : ?> + <?php if ($block->getTitle()): ?> <div class="block-title"> <strong><?= $block->escapeHtml(__($block->getTitle())) ?></strong> </div> @@ -33,7 +37,7 @@ use Magento\Framework\App\Action\Action; <div class="products-<?= /* @noEscape */ $mode ?> <?= /* @noEscape */ $mode ?>"> <ol class="product-items <?= /* @noEscape */ $type ?>"> <?php $iterator = 1; ?> - <?php foreach ($items as $_item) : ?> + <?php foreach ($items as $_item): ?> <?= /* @noEscape */ ($iterator++ == 1) ? '<li class="product-item">' : '</li><li class="product-item">' ?> <div class="product-item-info"> <a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>" class="product-item-photo"> @@ -47,7 +51,7 @@ use Magento\Framework\App\Action\Action; <?= $block->escapeHtml($_item->getName()) ?> </a> </strong> - <?php if ($templateType) : ?> + <?php if ($templateType): ?> <?= $block->getReviewsSummaryHtml($_item, $templateType) ?> <?php endif; ?> @@ -55,12 +59,12 @@ use Magento\Framework\App\Action\Action; <?= $block->getProductDetailsHtml($_item) ?> - <?php if ($showWishlist || $showCompare || $showCart) : ?> + <?php if ($showWishlist || $showCompare || $showCart): ?> <div class="product-item-inner"> <div class="product-item-actions"> - <?php if ($showCart) : ?> + <?php if ($showCart): ?> <div class="actions-primary"> - <?php if ($_item->isSaleable()) : ?> + <?php if ($_item->isSaleable()): ?> <?php $postParams = $block->getAddToCartPostParams($_item); ?> <form data-role="tocart-form" data-product-sku="<?= $block->escapeHtml($_item->getSku()) ?>" action="<?= $block->escapeUrl($postParams['action']) ?>" method="post"> <input type="hidden" name="product" value="<?= $block->escapeHtmlAttr($postParams['data']['product']) ?>"> @@ -72,24 +76,24 @@ use Magento\Framework\App\Action\Action; <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> </button> </form> - <?php else : ?> - <?php if ($_item->getIsSalable()) : ?> + <?php else: ?> + <?php if ($_item->isAvailable()): ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> - <?php else : ?> + <?php else: ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> <?php endif; ?> <?php endif; ?> </div> <?php endif; ?> - <?php if ($showWishlist || $showCompare) : ?> + <?php if ($showWishlist || $showCompare): ?> <div class="actions-secondary" data-role="add-to-links"> - <?php if ($this->helper(\Magento\Wishlist\Helper\Data::class)->isAllow() && $showWishlist) : ?> + <?php if ($this->helper(\Magento\Wishlist\Helper\Data::class)->isAllow() && $showWishlist): ?> <a href="#" data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($_item) ?>' class="action towishlist" data-action="add-to-wishlist" title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>"> <span><?= $block->escapeHtml(__('Add to Wish List')) ?></span> </a> <?php endif; ?> - <?php if ($block->getAddToCompareUrl() && $showCompare) : ?> + <?php if ($block->getAddToCompareUrl() && $showCompare): ?> <?php $compareHelper = $this->helper(\Magento\Catalog\Helper\Product\Compare::class);?> <a href="#" class="action tocompare" data-post='<?= /* @noEscape */ $compareHelper->getPostDataParams($_item) ?>' title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>"> <span><?= $block->escapeHtml(__('Add to Compare')) ?></span> @@ -109,4 +113,13 @@ use Magento\Framework\App\Action\Action; <?= $block->getPagerHtml() ?> </div> </div> + <?php if($block->getBlockHtml('formkey')): ?> + <script type="text/x-magento-init"> + { + ".block.widget [data-role=tocart-form]": { + "Magento_Catalog/js/validate-product": {} + } + } + </script> + <?php endif;?> <?php endif;?> diff --git a/app/code/Magento/Checkout/Api/Exception/PaymentProcessingRateLimitExceededException.php b/app/code/Magento/Checkout/Api/Exception/PaymentProcessingRateLimitExceededException.php index e398bf400391b..018c18112a763 100644 --- a/app/code/Magento/Checkout/Api/Exception/PaymentProcessingRateLimitExceededException.php +++ b/app/code/Magento/Checkout/Api/Exception/PaymentProcessingRateLimitExceededException.php @@ -11,7 +11,7 @@ use Magento\Framework\Exception\LocalizedException; /** - * Thrown when too many payment processing requests have been initiated by a user. + * Thrown when too many payment processing/saving requests have been initiated by a user. */ class PaymentProcessingRateLimitExceededException extends LocalizedException { diff --git a/app/code/Magento/Checkout/Api/PaymentSavingRateLimiterInterface.php b/app/code/Magento/Checkout/Api/PaymentSavingRateLimiterInterface.php new file mode 100644 index 0000000000000..c964029ff8b3a --- /dev/null +++ b/app/code/Magento/Checkout/Api/PaymentSavingRateLimiterInterface.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Checkout\Api; + +use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; + +/** + * Limits number of times a user can store payment method info. + */ +interface PaymentSavingRateLimiterInterface +{ + /** + * Limit an attempt. + * + * @return void + * @throws PaymentProcessingRateLimitExceededException + */ + public function limit(): void; +} diff --git a/app/code/Magento/Checkout/Block/Cart.php b/app/code/Magento/Checkout/Block/Cart.php index 76bf917f02d8b..f0305daf2abda 100644 --- a/app/code/Magento/Checkout/Block/Cart.php +++ b/app/code/Magento/Checkout/Block/Cart.php @@ -6,6 +6,7 @@ namespace Magento\Checkout\Block; use Magento\Customer\Model\Context; +use Magento\Framework\Phrase; /** * Shopping cart block @@ -69,7 +70,7 @@ protected function _construct() } /** - * prepare cart items URLs + * Prepare cart items URLs * * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) @@ -111,6 +112,8 @@ public function prepareItemUrls() } /** + * Check quote for error + * * @codeCoverageIgnore * @return bool */ @@ -120,6 +123,8 @@ public function hasError() } /** + * Get Items Summary Qty + * * @codeCoverageIgnore * @return int */ @@ -129,6 +134,8 @@ public function getItemsSummaryQty() } /** + * Check if Wishlist Active + * * @codeCoverageIgnore * @return bool */ @@ -148,6 +155,8 @@ public function isWishlistActive() } /** + * Get Checkout Url + * * @codeCoverageIgnore * @return string */ @@ -157,6 +166,8 @@ public function getCheckoutUrl() } /** + * Get Continue Shopping Url + * * @return string */ public function getContinueShoppingUrl() @@ -173,6 +184,8 @@ public function getContinueShoppingUrl() } /** + * Check if quote is virtual + * * @return bool * @codeCoverageIgnore * @SuppressWarnings(PHPMD.BooleanGetMethodName) @@ -208,7 +221,13 @@ public function getMethodHtml($name) { $block = $this->getLayout()->getBlock($name); if (!$block) { - throw new \Magento\Framework\Exception\LocalizedException(__('Invalid method: %1', $name)); + throw new \Magento\Framework\Exception\LocalizedException( + new Phrase( + $this->escapeHtml( + __('Invalid method: %1', $name) + ) + ) + ); } return $block->toHtml(); } @@ -228,6 +247,8 @@ public function getItems() } /** + * Get Item Count + * * @codeCoverageIgnore * @return int */ diff --git a/app/code/Magento/Checkout/Controller/Cart/Add.php b/app/code/Magento/Checkout/Controller/Cart/Add.php index c4294e0fbade1..009505d8e7b2f 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Add.php +++ b/app/code/Magento/Checkout/Controller/Cart/Add.php @@ -6,9 +6,11 @@ */ namespace Magento\Checkout\Controller\Cart; +use Magento\Checkout\Model\Cart\RequestQuantityProcessor; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Checkout\Model\Cart as CustomerCart; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResponseInterface; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\NoSuchEntityException; @@ -25,6 +27,11 @@ class Add extends \Magento\Checkout\Controller\Cart implements HttpPostActionInt */ protected $productRepository; + /** + * @var RequestQuantityProcessor + */ + private $quantityProcessor; + /** * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig @@ -33,6 +40,7 @@ class Add extends \Magento\Checkout\Controller\Cart implements HttpPostActionInt * @param \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator * @param CustomerCart $cart * @param ProductRepositoryInterface $productRepository + * @param RequestQuantityProcessor|null $quantityProcessor * @codeCoverageIgnore */ public function __construct( @@ -42,7 +50,8 @@ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator, CustomerCart $cart, - ProductRepositoryInterface $productRepository + ProductRepositoryInterface $productRepository, + ?RequestQuantityProcessor $quantityProcessor = null ) { parent::__construct( $context, @@ -53,6 +62,8 @@ public function __construct( $cart ); $this->productRepository = $productRepository; + $this->quantityProcessor = $quantityProcessor + ?? ObjectManager::getInstance()->get(RequestQuantityProcessor::class); } /** @@ -99,6 +110,7 @@ public function execute() \Magento\Framework\Locale\ResolverInterface::class )->getLocale()] ); + $params['qty'] = $this->quantityProcessor->prepareQuantity($params['qty']); $params['qty'] = $filter->filter($params['qty']); } diff --git a/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php b/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php index 40ce2252581cf..205f0aa8dbd2e 100644 --- a/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php +++ b/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php @@ -1,20 +1,29 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Checkout\Controller\Cart; +use Magento\Checkout\Controller\Cart; +use Magento\Checkout\Helper\Cart as CartHelper; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +use Magento\Framework\Controller\Result\Redirect; +use Magento\Framework\DataObject; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Locale\ResolverInterface; +use Psr\Log\LoggerInterface; -class UpdateItemOptions extends \Magento\Checkout\Controller\Cart implements HttpPostActionInterface +/** + * Process updating product options in a cart item. + */ +class UpdateItemOptions extends Cart implements HttpPostActionInterface { /** - * Update product configuration for a cart item + * Update product configuration for a cart item. * - * @return \Magento\Framework\Controller\Result\Redirect + * @return Redirect * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ @@ -28,27 +37,27 @@ public function execute() } try { if (isset($params['qty'])) { - $filter = new \Zend_Filter_LocalizedToNormalized( - ['locale' => $this->_objectManager->get( - \Magento\Framework\Locale\ResolverInterface::class - )->getLocale()] + $inputFilter = new \Zend_Filter_LocalizedToNormalized( + [ + 'locale' => $this->_objectManager->get(ResolverInterface::class)->getLocale(), + ] ); - $params['qty'] = $filter->filter($params['qty']); + $params['qty'] = $inputFilter->filter($params['qty']); } $quoteItem = $this->cart->getQuote()->getItemById($id); if (!$quoteItem) { - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __("The quote item isn't found. Verify the item and try again.") ); } - $item = $this->cart->updateItem($id, new \Magento\Framework\DataObject($params)); + $item = $this->cart->updateItem($id, new DataObject($params)); if (is_string($item)) { - throw new \Magento\Framework\Exception\LocalizedException(__($item)); + throw new LocalizedException(__($item)); } if ($item->getHasError()) { - throw new \Magento\Framework\Exception\LocalizedException(__($item->getMessage())); + throw new LocalizedException(__($item->getMessage())); } $related = $this->getRequest()->getParam('related_product'); @@ -73,7 +82,7 @@ public function execute() } return $this->_goBack($this->_url->getUrl('checkout/cart')); } - } catch (\Magento\Framework\Exception\LocalizedException $e) { + } catch (LocalizedException $e) { if ($this->_checkoutSession->getUseNotice(true)) { $this->messageManager->addNoticeMessage($e->getMessage()); } else { @@ -87,14 +96,15 @@ public function execute() if ($url) { return $this->resultRedirectFactory->create()->setUrl($url); } else { - $cartUrl = $this->_objectManager->get(\Magento\Checkout\Helper\Cart::class)->getCartUrl(); - return $this->resultRedirectFactory->create()->setUrl($this->_redirect->getRedirectUrl($cartUrl)); + $cartUrl = $this->_objectManager->get(CartHelper::class)->getCartUrl(); + return $this->resultRedirectFactory->create()->setUrl($cartUrl); } } catch (\Exception $e) { $this->messageManager->addExceptionMessage($e, __('We can\'t update the item right now.')); - $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + $this->_objectManager->get(LoggerInterface::class)->critical($e); return $this->_goBack(); } + return $this->resultRedirectFactory->create()->setPath('*/*'); } } diff --git a/app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php b/app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php index 0208519c33d78..44e40c57f6615 100644 --- a/app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php +++ b/app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php @@ -5,9 +5,11 @@ */ namespace Magento\Checkout\Controller\Sidebar; +use Magento\Checkout\Model\Cart\RequestQuantityProcessor; use Magento\Checkout\Model\Sidebar; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\Response\Http; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Json\Helper\Data; @@ -30,23 +32,32 @@ class UpdateItemQty extends Action */ protected $jsonHelper; + /** + * @var RequestQuantityProcessor + */ + private $quantityProcessor; + /** * @param Context $context * @param Sidebar $sidebar * @param LoggerInterface $logger * @param Data $jsonHelper + * @param RequestQuantityProcessor|null $quantityProcessor * @codeCoverageIgnore */ public function __construct( Context $context, Sidebar $sidebar, LoggerInterface $logger, - Data $jsonHelper + Data $jsonHelper, + ?RequestQuantityProcessor $quantityProcessor = null ) { $this->sidebar = $sidebar; $this->logger = $logger; $this->jsonHelper = $jsonHelper; parent::__construct($context); + $this->quantityProcessor = $quantityProcessor + ?? ObjectManager::getInstance()->get(RequestQuantityProcessor::class); } /** @@ -56,6 +67,7 @@ public function execute() { $itemId = (int)$this->getRequest()->getParam('item_id'); $itemQty = $this->getRequest()->getParam('item_qty') * 1; + $itemQty = $this->quantityProcessor->prepareQuantity($itemQty); try { $this->sidebar->checkQuoteItem($itemId); diff --git a/app/code/Magento/Checkout/Model/CaptchaPaymentProcessingRateLimiter.php b/app/code/Magento/Checkout/Model/CaptchaPaymentProcessingRateLimiter.php index 6f71423acbcaa..68860b629c246 100644 --- a/app/code/Magento/Checkout/Model/CaptchaPaymentProcessingRateLimiter.php +++ b/app/code/Magento/Checkout/Model/CaptchaPaymentProcessingRateLimiter.php @@ -12,42 +12,23 @@ use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Captcha\Model\DefaultModel as Captcha; use Magento\Captcha\Helper\Data as CaptchaHelper; use Magento\Captcha\Observer\CaptchaStringResolver as CaptchaResolver; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\RequestInterface; +use Magento\Framework\Exception\LocalizedException; /** - * Utilize CAPTCHA as a rate-limiting mechanism. + * Utilize CAPTCHA to limit payment processing requests. */ class CaptchaPaymentProcessingRateLimiter implements PaymentProcessingRateLimiterInterface { public const CAPTCHA_FORM = 'payment_processing_request'; /** - * @var UserContextInterface + * @var CaptchaRateLimiter */ - private $userContext; - - /** - * @var CustomerRepositoryInterface - */ - private $customerRepo; - - /** - * @var CaptchaHelper - */ - private $captchaHelper; - - /** - * @var RequestInterface - */ - private $request; - - /** - * @var CaptchaResolver - */ - private $captchaResolver; + private $limiter; /** * CaptchaPaymentProcessingRateLimiter constructor. @@ -57,19 +38,25 @@ class CaptchaPaymentProcessingRateLimiter implements PaymentProcessingRateLimite * @param CaptchaHelper $captchaHelper * @param RequestInterface $request * @param CaptchaResolver $captchaResolver + * @param CaptchaRateLimiterFactory|null $limiterFactory */ public function __construct( UserContextInterface $userContext, CustomerRepositoryInterface $customerRepo, CaptchaHelper $captchaHelper, RequestInterface $request, - CaptchaResolver $captchaResolver + CaptchaResolver $captchaResolver, + ?CaptchaRateLimiterFactory $limiterFactory ) { - $this->userContext = $userContext; - $this->customerRepo = $customerRepo; - $this->captchaHelper = $captchaHelper; - $this->request = $request; - $this->captchaResolver = $captchaResolver; + $limiterFactory = $limiterFactory ?? ObjectManager::getInstance()->get(CaptchaRateLimiterFactory::class); + $this->limiter = $limiterFactory->create([ + 'userContext' => $userContext, + 'customerRepo' => $customerRepo, + 'captchaHelper' => $captchaHelper, + 'captchaResolver' => $captchaResolver, + 'request' => $request, + 'captchaId' => self::CAPTCHA_FORM + ]); } /** @@ -77,47 +64,10 @@ public function __construct( */ public function limit(): void { - if ($this->userContext->getUserType() !== UserContextInterface::USER_TYPE_GUEST - && $this->userContext->getUserType() !== UserContextInterface::USER_TYPE_CUSTOMER - && $this->userContext->getUserType() !== null - ) { - return; + try { + $this->limiter->limit(); + } catch (LocalizedException $exception) { + throw new PaymentProcessingRateLimitExceededException(__($exception->getMessage()), $exception); } - - $login = $this->retrieveLogin(); - /** @var Captcha $captcha */ - $captcha = $this->captchaHelper->getCaptcha(self::CAPTCHA_FORM); - /** @var PaymentProcessingRateLimitExceededException|null $exception */ - $exception = null; - if ($captcha->isRequired($login)) { - $value = $this->captchaResolver->resolve($this->request, self::CAPTCHA_FORM); - if ($value && !$captcha->isCorrect($value)) { - $exception = new PaymentProcessingRateLimitExceededException(__('Incorrect CAPTCHA')); - } elseif (!$value) { - $exception = new PaymentProcessingRateLimitExceededException( - __('Please provide CAPTCHA code and try again') - ); - } - } - - $captcha->logAttempt($login); - if ($exception) { - throw $exception; - } - } - - /** - * Retrieve current user login. - * - * @return string|null - */ - private function retrieveLogin(): ?string - { - $login = null; - if ($this->userContext->getUserId()) { - $login = $this->customerRepo->getById($this->userContext->getUserId())->getEmail(); - } - - return $login; } } diff --git a/app/code/Magento/Checkout/Model/CaptchaPaymentSavingRateLimiter.php b/app/code/Magento/Checkout/Model/CaptchaPaymentSavingRateLimiter.php new file mode 100644 index 0000000000000..7d52a1a0e19a0 --- /dev/null +++ b/app/code/Magento/Checkout/Model/CaptchaPaymentSavingRateLimiter.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Checkout\Model; + +use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Utilize CAPTCHA to limit save payment requests. + */ +class CaptchaPaymentSavingRateLimiter implements PaymentSavingRateLimiterInterface +{ + public const CAPTCHA_FORM = 'payment_saving_request'; + + /** + * @var CaptchaRateLimiter + */ + private $limiter; + + /** + * CaptchaPaymentProcessingRateLimiter constructor. + * + * @param CaptchaRateLimiterFactory $limiterFactory + */ + public function __construct( + CaptchaRateLimiterFactory $limiterFactory + ) { + $this->limiter = $limiterFactory->create(['captchaId' => self::CAPTCHA_FORM]); + } + + /** + * @inheritDoc + */ + public function limit(): void + { + try { + $this->limiter->limit(); + } catch (LocalizedException $exception) { + throw new PaymentProcessingRateLimitExceededException( + __( + 'Could not store billing/shipping information at the moment' + .' but you can proceed with the checkout' + ), + $exception + ); + } + } +} diff --git a/app/code/Magento/Checkout/Model/CaptchaRateLimiter.php b/app/code/Magento/Checkout/Model/CaptchaRateLimiter.php new file mode 100644 index 0000000000000..e643d61e82b18 --- /dev/null +++ b/app/code/Magento/Checkout/Model/CaptchaRateLimiter.php @@ -0,0 +1,129 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Checkout\Model; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Captcha\Model\DefaultModel as Captcha; +use Magento\Captcha\Helper\Data as CaptchaHelper; +use Magento\Captcha\Observer\CaptchaStringResolver as CaptchaResolver; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Utilize CAPTCHA as a rate-limiting mechanism. + */ +class CaptchaRateLimiter +{ + /** + * @var string + */ + private $captchaId; + + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepo; + + /** + * @var CaptchaHelper + */ + private $captchaHelper; + + /** + * @var RequestInterface + */ + private $request; + + /** + * @var CaptchaResolver + */ + private $captchaResolver; + + /** + * @param UserContextInterface $userContext + * @param CustomerRepositoryInterface $customerRepo + * @param CaptchaHelper $captchaHelper + * @param RequestInterface $request + * @param CaptchaResolver $captchaResolver + * @param string $captchaId + */ + public function __construct( + UserContextInterface $userContext, + CustomerRepositoryInterface $customerRepo, + CaptchaHelper $captchaHelper, + RequestInterface $request, + CaptchaResolver $captchaResolver, + string $captchaId + ) { + $this->userContext = $userContext; + $this->customerRepo = $customerRepo; + $this->captchaHelper = $captchaHelper; + $this->request = $request; + $this->captchaResolver = $captchaResolver; + $this->captchaId = $captchaId; + } + + /** + * Validate CAPTCHA if necessary. + * + * @return void + * @throws LocalizedException + */ + public function limit(): void + { + if ($this->userContext->getUserType() !== UserContextInterface::USER_TYPE_GUEST + && $this->userContext->getUserType() !== UserContextInterface::USER_TYPE_CUSTOMER + && $this->userContext->getUserType() !== null + ) { + return; + } + + $login = $this->retrieveLogin(); + /** @var Captcha $captcha */ + $captcha = $this->captchaHelper->getCaptcha($this->captchaId); + /** @var LocalizedException|null $exception */ + $exception = null; + if ($captcha->isRequired($login)) { + $value = $this->captchaResolver->resolve($this->request, $this->captchaId); + if ($value && !$captcha->isCorrect($value)) { + $exception = new LocalizedException(__('Incorrect CAPTCHA')); + } elseif (!$value) { + $exception = new LocalizedException( + __('Please provide CAPTCHA code and try again') + ); + } + } + + $captcha->logAttempt($login); + if ($exception) { + throw $exception; + } + } + + /** + * Retrieve current user login. + * + * @return string|null + */ + private function retrieveLogin(): ?string + { + $login = null; + if ($this->userContext->getUserId()) { + $login = $this->customerRepo->getById($this->userContext->getUserId())->getEmail(); + } + + return $login; + } +} diff --git a/app/code/Magento/Checkout/Model/Cart/ImageProvider.php b/app/code/Magento/Checkout/Model/Cart/ImageProvider.php index bc409357bf409..d15d1a9f7549d 100644 --- a/app/code/Magento/Checkout/Model/Cart/ImageProvider.php +++ b/app/code/Magento/Checkout/Model/Cart/ImageProvider.php @@ -32,19 +32,37 @@ class ImageProvider */ protected $customerDataItem; + /** + * @var \Magento\Catalog\Helper\Image + */ + private $imageHelper; + + /** + * @var \Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface + */ + private $itemResolver; + /** * @param \Magento\Quote\Api\CartItemRepositoryInterface $itemRepository * @param \Magento\Checkout\CustomerData\ItemPoolInterface $itemPool * @param DefaultItem|null $customerDataItem + * @param \Magento\Catalog\Helper\Image $imageHelper + * @param \Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface $itemResolver */ public function __construct( \Magento\Quote\Api\CartItemRepositoryInterface $itemRepository, \Magento\Checkout\CustomerData\ItemPoolInterface $itemPool, - \Magento\Checkout\CustomerData\DefaultItem $customerDataItem = null + \Magento\Checkout\CustomerData\DefaultItem $customerDataItem = null, + \Magento\Catalog\Helper\Image $imageHelper = null, + \Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface $itemResolver = null ) { $this->itemRepository = $itemRepository; $this->itemPool = $itemPool; $this->customerDataItem = $customerDataItem ?: ObjectManager::getInstance()->get(DefaultItem::class); + $this->imageHelper = $imageHelper ?: ObjectManager::getInstance()->get(\Magento\Catalog\Helper\Image::class); + $this->itemResolver = $itemResolver ?: ObjectManager::getInstance()->get( + \Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface::class + ); } /** @@ -58,9 +76,30 @@ public function getImages($cartId) $items = $this->itemRepository->getList($cartId); /** @var \Magento\Quote\Model\Quote\Item $cartItem */ foreach ($items as $cartItem) { - $allData = $this->customerDataItem->getItemData($cartItem); - $itemData[$cartItem->getItemId()] = $allData['product_image']; + $itemData[$cartItem->getItemId()] = $this->getProductImageData($cartItem); } return $itemData; } + + /** + * Get product image data + * + * @param \Magento\Quote\Model\Quote\Item $cartItem + * + * @return array + */ + private function getProductImageData($cartItem) + { + $imageHelper = $this->imageHelper->init( + $this->itemResolver->getFinalProduct($cartItem), + 'mini_cart_product_thumbnail' + ); + $imageData = [ + 'src' => $imageHelper->getUrl(), + 'alt' => $imageHelper->getLabel(), + 'width' => $imageHelper->getWidth(), + 'height' => $imageHelper->getHeight(), + ]; + return $imageData; + } } diff --git a/app/code/Magento/Checkout/Model/Cart/RequestQuantityProcessor.php b/app/code/Magento/Checkout/Model/Cart/RequestQuantityProcessor.php index 27566ba6805af..d3d15f787fa92 100644 --- a/app/code/Magento/Checkout/Model/Cart/RequestQuantityProcessor.php +++ b/app/code/Magento/Checkout/Model/Cart/RequestQuantityProcessor.php @@ -41,6 +41,7 @@ public function process(array $cartData): array foreach ($cartData as $index => $data) { if (isset($data['qty'])) { + $data['qty'] = $this->prepareQuantity($data['qty']); $data['qty'] = is_string($data['qty']) ? trim($data['qty']) : $data['qty']; $cartData[$index]['qty'] = $filter->filter($data['qty']); } @@ -48,4 +49,31 @@ public function process(array $cartData): array return $cartData; } + + /** + * Prepare quantity with taking into account decimal separator by locale + * + * @param int|float|string|array $quantity + * @return int|float|string|array + * @throws \Zend_Locale_Exception + */ + public function prepareQuantity($quantity) + { + $formatter = new \NumberFormatter($this->localeResolver->getLocale(), \NumberFormatter::CURRENCY); + $decimalSymbol = $formatter->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL); + + if (is_array($quantity)) { + foreach ($quantity as $key => $qty) { + if (strpos((string)$qty, '.') !== false && $decimalSymbol !== '.') { + $quantity[$key] = str_replace('.', $decimalSymbol, $qty); + } + } + } else { + if (strpos((string)$quantity, '.') !== false && $decimalSymbol !== '.') { + $quantity = str_replace('.', $decimalSymbol, (string)$quantity); + } + } + + return $quantity; + } } diff --git a/app/code/Magento/Checkout/Model/DefaultConfigProvider.php b/app/code/Magento/Checkout/Model/DefaultConfigProvider.php index fdf49d6765a29..80748bfa042d7 100644 --- a/app/code/Magento/Checkout/Model/DefaultConfigProvider.php +++ b/app/code/Magento/Checkout/Model/DefaultConfigProvider.php @@ -5,11 +5,13 @@ */ namespace Magento\Checkout\Model; +use Magento\Captcha\Api\CaptchaConfigPostProcessorInterface; use Magento\Catalog\Helper\Product\ConfigurationPool; use Magento\Checkout\Helper\Data as CheckoutHelper; use Magento\Checkout\Model\Session as CheckoutSession; use Magento\Customer\Api\AddressMetadataInterface; use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\Address\CustomerAddressDataProvider; use Magento\Customer\Model\Context as CustomerContext; use Magento\Customer\Model\Session as CustomerSession; @@ -31,7 +33,7 @@ use Magento\Ui\Component\Form\Element\Multiline; /** - * Default Config Provider + * Default Config Provider for checkout * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.TooManyFields) @@ -184,6 +186,11 @@ class DefaultConfigProvider implements ConfigProviderInterface */ private $customerAddressData; + /** + * @var CaptchaConfigPostProcessorInterface + */ + private $configPostProcessor; + /** * @param CheckoutHelper $checkoutHelper * @param Session $checkoutSession @@ -211,6 +218,7 @@ class DefaultConfigProvider implements ConfigProviderInterface * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Quote\Api\PaymentMethodManagementInterface $paymentMethodManagement * @param UrlInterface $urlBuilder + * @param CaptchaConfigPostProcessorInterface $configPostProcessor * @param AddressMetadataInterface $addressMetadata * @param AttributeOptionManagementInterface $attributeOptionManager * @param CustomerAddressDataProvider|null $customerAddressData @@ -244,6 +252,7 @@ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Quote\Api\PaymentMethodManagementInterface $paymentMethodManagement, UrlInterface $urlBuilder, + CaptchaConfigPostProcessorInterface $configPostProcessor, AddressMetadataInterface $addressMetadata = null, AttributeOptionManagementInterface $attributeOptionManager = null, CustomerAddressDataProvider $customerAddressData = null @@ -279,6 +288,7 @@ public function __construct( ObjectManager::getInstance()->get(AttributeOptionManagementInterface::class); $this->customerAddressData = $customerAddressData ?: ObjectManager::getInstance()->get(CustomerAddressDataProvider::class); + $this->configPostProcessor = $configPostProcessor; } /** @@ -302,14 +312,11 @@ public function getConfig() $output['isCustomerLoggedIn'] = $this->isCustomerLoggedIn(); $output['selectedShippingMethod'] = $this->getSelectedShippingMethod(); if ($email && !$this->isCustomerLoggedIn()) { - $shippingAddressFromData = $this->getAddressFromData($quote->getShippingAddress()); - $billingAddressFromData = $this->getAddressFromData($quote->getBillingAddress()); - $output['shippingAddressFromData'] = $shippingAddressFromData; - if ($shippingAddressFromData != $billingAddressFromData) { - $output['billingAddressFromData'] = $billingAddressFromData; - } $output['validatedEmailValue'] = $email; } + if (!$this->isCustomerLoggedIn() || !$this->getCustomer()->getAddresses()) { + $output = array_merge($output, $this->getQuoteAddressData()); + } $output['storeCode'] = $this->getStoreCode(); $output['isGuestCheckoutAllowed'] = $this->isGuestCheckoutAllowed(); $output['isCustomerLoginRequired'] = $this->isCustomerLoginRequired(); @@ -352,7 +359,7 @@ public function getConfig() $output['paymentMethods'] = $this->getPaymentMethods(); $output['autocomplete'] = $this->isAutocompleteEnabled(); $output['displayBillingOnPaymentMethod'] = $this->checkoutHelper->isDisplayBillingOnPaymentMethodAvailable(); - return $output; + return $this->configPostProcessor->process($output); } /** @@ -378,8 +385,7 @@ private function getCustomerData(): array { $customerData = []; if ($this->isCustomerLoggedIn()) { - /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ - $customer = $this->customerRepository->getById($this->customerSession->getCustomerId()); + $customer = $this->getCustomer(); $customerData = $customer->__toArray(); $customerData['addresses'] = $this->customerAddressData->getAddressDataByCustomer($customer); } @@ -722,4 +728,43 @@ private function getQuoteItemsMessages(array $quoteItemData): array return $quoteItemsMessages; } + + /** + * Get quote address data for checkout + * + * @return array + */ + private function getQuoteAddressData(): array + { + $output = []; + $quote = $this->checkoutSession->getQuote(); + $shippingAddressFromData = []; + if ($quote->getShippingAddress()->getEmail()) { + $shippingAddressFromData = $this->getAddressFromData($quote->getShippingAddress()); + if ($shippingAddressFromData) { + $output['isShippingAddressFromDataValid'] = $quote->getShippingAddress()->validate() === true; + $output['shippingAddressFromData'] = $shippingAddressFromData; + } + } + + if ($quote->getBillingAddress()->getEmail()) { + $billingAddressFromData = $this->getAddressFromData($quote->getBillingAddress()); + if ($billingAddressFromData && $shippingAddressFromData != $billingAddressFromData) { + $output['isBillingAddressFromDataValid'] = $quote->getBillingAddress()->validate() === true; + $output['billingAddressFromData'] = $billingAddressFromData; + } + } + + return $output; + } + + /** + * Get logged-in customer + * + * @return CustomerInterface + */ + private function getCustomer(): CustomerInterface + { + return $this->customerRepository->getById($this->customerSession->getCustomerId()); + } } diff --git a/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php b/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php index 2b2824213df79..0ca398b73a08b 100644 --- a/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php +++ b/app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php @@ -7,7 +7,9 @@ namespace Magento\Checkout\Model; +use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Framework\App\ObjectManager; use Magento\Quote\Api\CartRepositoryInterface; use Magento\Framework\Exception\CouldNotSaveException; @@ -61,6 +63,16 @@ class GuestPaymentInformationManagement implements \Magento\Checkout\Api\GuestPa */ private $paymentsRateLimiter; + /** + * @var PaymentSavingRateLimiterInterface + */ + private $savingRateLimiter; + + /** + * @var bool + */ + private $saveRateLimitDisabled = false; + /** * @param \Magento\Quote\Api\GuestBillingAddressManagementInterface $billingAddressManagement * @param \Magento\Quote\Api\GuestPaymentMethodManagementInterface $paymentMethodManagement @@ -69,6 +81,7 @@ class GuestPaymentInformationManagement implements \Magento\Checkout\Api\GuestPa * @param \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory * @param CartRepositoryInterface $cartRepository * @param PaymentProcessingRateLimiterInterface|null $paymentsRateLimiter + * @param PaymentSavingRateLimiterInterface|null $savingRateLimiter * @codeCoverageIgnore */ public function __construct( @@ -78,7 +91,8 @@ public function __construct( \Magento\Checkout\Api\PaymentInformationManagementInterface $paymentInformationManagement, \Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory, CartRepositoryInterface $cartRepository, - ?PaymentProcessingRateLimiterInterface $paymentsRateLimiter = null + ?PaymentProcessingRateLimiterInterface $paymentsRateLimiter = null, + ?PaymentSavingRateLimiterInterface $savingRateLimiter = null ) { $this->billingAddressManagement = $billingAddressManagement; $this->paymentMethodManagement = $paymentMethodManagement; @@ -88,6 +102,8 @@ public function __construct( $this->cartRepository = $cartRepository; $this->paymentsRateLimiter = $paymentsRateLimiter ?? ObjectManager::getInstance()->get(PaymentProcessingRateLimiterInterface::class); + $this->savingRateLimiter = $savingRateLimiter + ?? ObjectManager::getInstance()->get(PaymentSavingRateLimiterInterface::class); } /** @@ -99,7 +115,14 @@ public function savePaymentInformationAndPlaceOrder( \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { - $this->savePaymentInformation($cartId, $email, $paymentMethod, $billingAddress); + $this->paymentsRateLimiter->limit(); + try { + //Have to do this hack because of savePaymentInformation() plugins. + $this->saveRateLimitDisabled = true; + $this->savePaymentInformation($cartId, $email, $paymentMethod, $billingAddress); + } finally { + $this->saveRateLimitDisabled = false; + } try { $orderId = $this->cartManagement->placeOrder($cartId); } catch (\Magento\Framework\Exception\LocalizedException $e) { @@ -130,7 +153,14 @@ public function savePaymentInformation( \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { - $this->paymentsRateLimiter->limit(); + if (!$this->saveRateLimitDisabled) { + try { + $this->savingRateLimiter->limit(); + } catch (PaymentProcessingRateLimitExceededException $ex) { + //Limit reached + return false; + } + } $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id'); /** @var Quote $quote */ diff --git a/app/code/Magento/Checkout/Model/PaymentInformationManagement.php b/app/code/Magento/Checkout/Model/PaymentInformationManagement.php index a6e448ecdb87e..3b36391530c8f 100644 --- a/app/code/Magento/Checkout/Model/PaymentInformationManagement.php +++ b/app/code/Magento/Checkout/Model/PaymentInformationManagement.php @@ -6,7 +6,9 @@ namespace Magento\Checkout\Model; +use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\CouldNotSaveException; @@ -58,6 +60,16 @@ class PaymentInformationManagement implements \Magento\Checkout\Api\PaymentInfor */ private $paymentRateLimiter; + /** + * @var PaymentSavingRateLimiterInterface + */ + private $saveRateLimiter; + + /** + * @var bool + */ + private $saveRateLimiterDisabled = false; + /** * @param \Magento\Quote\Api\BillingAddressManagementInterface $billingAddressManagement * @param \Magento\Quote\Api\PaymentMethodManagementInterface $paymentMethodManagement @@ -65,6 +77,7 @@ class PaymentInformationManagement implements \Magento\Checkout\Api\PaymentInfor * @param PaymentDetailsFactory $paymentDetailsFactory * @param \Magento\Quote\Api\CartTotalRepositoryInterface $cartTotalsRepository * @param PaymentProcessingRateLimiterInterface|null $paymentRateLimiter + * @param PaymentSavingRateLimiterInterface|null $saveRateLimiter * @codeCoverageIgnore */ public function __construct( @@ -73,7 +86,8 @@ public function __construct( \Magento\Quote\Api\CartManagementInterface $cartManagement, \Magento\Checkout\Model\PaymentDetailsFactory $paymentDetailsFactory, \Magento\Quote\Api\CartTotalRepositoryInterface $cartTotalsRepository, - ?PaymentProcessingRateLimiterInterface $paymentRateLimiter = null + ?PaymentProcessingRateLimiterInterface $paymentRateLimiter = null, + ?PaymentSavingRateLimiterInterface $saveRateLimiter = null ) { $this->billingAddressManagement = $billingAddressManagement; $this->paymentMethodManagement = $paymentMethodManagement; @@ -82,6 +96,8 @@ public function __construct( $this->cartTotalsRepository = $cartTotalsRepository; $this->paymentRateLimiter = $paymentRateLimiter ?? ObjectManager::getInstance()->get(PaymentProcessingRateLimiterInterface::class); + $this->saveRateLimiter = $saveRateLimiter + ?? ObjectManager::getInstance()->get(PaymentSavingRateLimiterInterface::class); } /** @@ -92,7 +108,14 @@ public function savePaymentInformationAndPlaceOrder( \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { - $this->savePaymentInformation($cartId, $paymentMethod, $billingAddress); + $this->paymentRateLimiter->limit(); + try { + //Have to do this hack because of plugins for savePaymentInformation() + $this->saveRateLimiterDisabled = true; + $this->savePaymentInformation($cartId, $paymentMethod, $billingAddress); + } finally { + $this->saveRateLimiterDisabled = false; + } try { $orderId = $this->cartManagement->placeOrder($cartId); } catch (\Magento\Framework\Exception\LocalizedException $e) { @@ -121,7 +144,14 @@ public function savePaymentInformation( \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { - $this->paymentRateLimiter->limit(); + if (!$this->saveRateLimiterDisabled) { + try { + $this->saveRateLimiter->limit(); + } catch (PaymentProcessingRateLimitExceededException $ex) { + //Limit reached + return false; + } + } if ($billingAddress) { /** @var \Magento\Quote\Api\CartRepositoryInterface $quoteRepository */ diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php index f7e55fdc84cf7..7c5c8790e4226 100644 --- a/app/code/Magento/Checkout/Model/Type/Onepage.php +++ b/app/code/Magento/Checkout/Model/Type/Onepage.php @@ -169,6 +169,11 @@ class Onepage */ protected $totalsCollector; + /** + * @var \Magento\Framework\Encryption\EncryptorInterface + */ + private $_encryptor; + /** * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Checkout\Helper\Data $helper @@ -405,7 +410,7 @@ public function saveShipping($data, $customerAddressId) $address = $this->getQuote()->getShippingAddress(); $addressForm = $this->_formFactory->create( - \customer_address::class, + 'customer_address', 'customer_address_edit', [], $this->_request->isAjax(), diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontGuestCheckoutShippingAddressFormPrefilledActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontGuestCheckoutShippingAddressFormPrefilledActionGroup.xml new file mode 100644 index 0000000000000..300e9c60ff362 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontGuestCheckoutShippingAddressFormPrefilledActionGroup.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontGuestCheckoutShippingAddressFormPrefilledActionGroup"> + <annotations> + <description>Verify that shipping address form is filled with provided customer and address information.</description> + </annotations> + <arguments> + <argument name="customer" defaultValue="Simple_US_Customer" type="entity"/> + <argument name="address" defaultValue="US_Address_TX" type="entity"/> + </arguments> + + <grabValueFrom selector="{{CheckoutShippingSection.email}}" stepKey="email"/> + <grabValueFrom selector="{{CheckoutShippingSection.firstName}}" stepKey="firstname"/> + <grabValueFrom selector="{{CheckoutShippingSection.lastName}}" stepKey="lastname"/> + <grabValueFrom selector="{{CheckoutShippingSection.street}}" stepKey="street"/> + <grabValueFrom selector="{{CheckoutShippingSection.city}}" stepKey="city"/> + <grabValueFrom selector="{{CheckoutShippingSection.postcode}}" stepKey="postcode"/> + <grabValueFrom selector="{{CheckoutShippingSection.telephone}}" stepKey="telephone"/> + + <assertEquals stepKey="assertEmail"> + <actualResult type="variable">email</actualResult> + <expectedResult type="string">{{customer.email}}</expectedResult> + </assertEquals> + <assertEquals stepKey="assertFirstName"> + <actualResult type="variable">firstname</actualResult> + <expectedResult type="string">{{customer.firstName}}</expectedResult> + </assertEquals> + <assertEquals stepKey="assertLastName"> + <actualResult type="variable">lastname</actualResult> + <expectedResult type="string">{{customer.lastName}}</expectedResult> + </assertEquals> + <assertEquals stepKey="assertStreet"> + <actualResult type="variable">street</actualResult> + <expectedResult type="string">{{address.street[0]}}</expectedResult> + </assertEquals> + <assertEquals stepKey="assertCity"> + <actualResult type="variable">city</actualResult> + <expectedResult type="string">{{address.city}}</expectedResult> + </assertEquals> + <seeOptionIsSelected selector="{{CheckoutShippingSection.region}}" userInput="{{address.state}}" stepKey="assertRegion"/> + <seeOptionIsSelected selector="{{CheckoutShippingSection.country}}" userInput="{{address.country}}" stepKey="assertCountry"/> + <assertEquals stepKey="assertPostcode"> + <actualResult type="variable">postcode</actualResult> + <expectedResult type="string">{{address.postcode}}</expectedResult> + </assertEquals> + <assertEquals stepKey="assertTelephone"> + <actualResult type="variable">telephone</actualResult> + <expectedResult type="string">{{address.telephone}}</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml index 968ee8b46d0ba..bb4853550e97d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml @@ -16,7 +16,9 @@ <argument name="shippingMethod"/> </arguments> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <waitForPageLoad stepKey="waitForPageFullyLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.shippingMethodInformation}}" stepKey="waitForShippingMethodInformationVisible"/> <see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.shippingMethodInformation}}" stepKey="assertshippingMethodInformation"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml index 079b89a879b77..f2fff4af48142 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml @@ -15,6 +15,7 @@ <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <waitForPageLoad stepKey="waitForCheckout"/> <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryAndStateActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryAndStateActionGroup.xml new file mode 100644 index 0000000000000..cf3bfcc29a375 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryAndStateActionGroup.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="FillGuestCheckoutShippingAddressWithCountryAndStateActionGroup" extends="FillGuestCheckoutShippingAddressFormActionGroup"> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddress.country_id}}" after="SetCustomerCity" stepKey="selectCustomerCountry"/> + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddress.state}}" after="selectCustomerCountry" stepKey="SetCustomerState"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml index f020cb42725c8..b74ace4847dd5 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml @@ -19,6 +19,7 @@ <argument name="shippingMethod" defaultValue="" type="string"/> </arguments> + <waitForElementVisible selector="{{CheckoutShippingSection.email}}" stepKey="waitForEmailField"/> <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml index 8c1ef9d973297..2e0f1b8e97f34 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml @@ -18,6 +18,7 @@ </arguments> <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart"/> + <waitForPageLoad stepKey="waitForPageLoad"/> <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> <see selector="{{StorefrontProductPageSection.messagesBlock}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddSimpleProductToCartFromComparisonListActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddSimpleProductToCartFromComparisonListActionGroup.xml new file mode 100644 index 0000000000000..0a4f37e783f7b --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddSimpleProductToCartFromComparisonListActionGroup.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <!-- Add Product to Cart from the category page and check message --> + <actionGroup name="StorefrontAddSimpleProductToCartFromComparisonListActionGroup"> + <annotations> + <description>Add simple product from comparison page to the cart. Starts on products comparison page.</description> + </annotations> + <arguments> + <argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/> + </arguments> + + <waitForElement selector="{{StorefrontProductCompareMainSection.ProductAddToCartButton(productName)}}" stepKey="waitForAddToCartButton"/> + <click selector="{{StorefrontProductCompareMainSection.ProductAddToCartButton(productName)}}" stepKey="clickAddToCartButton"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{productName}} to your shopping cart." stepKey="assertSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillNewShippingAddressFormInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillNewShippingAddressFormInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..a0abbd4644b66 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontFillNewShippingAddressFormInCheckoutActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontFillNewShippingAddressFormInCheckoutActionGroup"> + <annotations> + <description>Fills in the provided Address details in the New Address form on the Storefront Checkout pages. By default, this works for the Shipping Address but this can be used for Billing Addresses as well if you pass in the correct 'section' argument value</description> + </annotations> + <arguments> + <argument name="address"/> + <argument name="section" defaultValue="StorefrontCheckoutShippingNewAddressModalSection"/> + </arguments> + <fillField stepKey="fillFirstName" selector="{{section.firstName}}" userInput="{{address.firstname}}"/> + <fillField stepKey="fillLastName" selector="{{section.lastName}}" userInput="{{address.lastname}}"/> + <fillField stepKey="fillCompany" selector="{{section.company}}" userInput="{{address.company}}"/> + <fillField stepKey="fillStreetAddress" selector="{{section.street('0')}}" userInput="{{address.street[0]}}"/> + <selectOption stepKey="selectCounty" selector="{{section.country}}" userInput="{{address.country_id}}"/> + <selectOption stepKey="selectRegion" selector="{{section.region}}" userInput="{{address.state}}"/> + <fillField stepKey="fillCityName" selector="{{section.city}}" userInput="{{address.city}}"/> + <fillField stepKey="fillZip" selector="{{section.postcode}}" userInput="{{address.postcode}}"/> + <fillField stepKey="fillPhoneNumber" selector="{{section.telephone}}" userInput="{{address.telephone}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml b/app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml index 13d9385101f18..ebc69f7122385 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml @@ -32,4 +32,16 @@ <data key="label">No</data> <data key="value">0</data> </entity> -</entities> \ No newline at end of file + <entity name="EnableRedirectToShoppingCart"> + <data key="path">checkout/cart/redirect_to_cart</data> + <data key="scope_id">0</data> + <data key="label">Yes</data> + <data key="value">1</data> + </entity> + <entity name="DisableRedirectToShoppingCart"> + <data key="path">checkout/cart/redirect_to_cart</data> + <data key="scope_id">0</data> + <data key="label">No</data> + <data key="value">0</data> + </entity> +</entities> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutHeaderSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutHeaderSection.xml index 615db79b2ba6d..13a08edaae335 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutHeaderSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutHeaderSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="CheckoutHeaderSection"> - <element name="shippingMethodStep" type="text" selector=".opc-progress-bar-item:nth-of-type(1)"/> + <element name="shippingMethodStep" type="text" selector=".opc-progress-bar-item:nth-of-type(1)" timeout="30"/> <element name="reviewAndPaymentsStep" type="text" selector=".opc-progress-bar-item:nth-of-type(2)"/> <element name="errorMessageContainsText" type="text" selector="//div[contains(@class, 'message message-error error')]//div[contains(text(), '{{text}}')]" parameterized="true"/> </section> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml index 100567d503c77..4851e2f8c3166 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml @@ -18,7 +18,7 @@ <element name="addressDropdown" type="select" selector="[name=billing_address_id]"/> <element name="addressDropdownSelected" type="select" selector="[name=billing_address_id] option:checked"/> <element name="placeOrderDisabled" type="button" selector="#checkout-payment-method-load button.disabled"/> - <element name="update" type="button" selector=".payment-method._active .payment-method-billing-address .action.action-update"/> + <element name="update" type="button" selector=".payment-method._active .payment-method-billing-address .action.action-update" timeout="30"/> <element name="guestFirstName" type="input" selector=".payment-method._active .billing-address-form input[name='firstname']"/> <element name="guestLastName" type="input" selector=".payment-method._active .billing-address-form input[name*='lastname']"/> <element name="guestStreet" type="input" selector=".payment-method._active .billing-address-form input[name*='street[0]']"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml index c39fab8a52e8e..305d717ada27a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml @@ -26,7 +26,8 @@ <element name="shippingBlock" type="text" selector="#checkout-step-shipping"/> <!--Order Summary--> - <element name="itemInCart" type="button" selector="//div[@class='title']"/> + <element name="itemInCart" type="button" selector="div.items-in-cart div.title" timeout="30"/> + <element name="itemInCartActive" type="button" selector="div.items-in-cart.active div.title" timeout="30"/> <element name="productName" type="text" selector="//strong[@class='product-item-name']"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml index a5eba8835e354..4b8b1745c16df 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml @@ -45,5 +45,6 @@ <element name="addressFieldValidationError" type="text" selector="div.address div.field .field-error"/> <element name="textFieldAttrRequireMessage" type="text" selector="//input[@name='custom_attributes[{{attribute}}]']/ancestor::div[contains(@class, 'control')]/div/span" parameterized="true" timeout="30"/> <element name="textFieldAttribute" type="input" selector="[name*='custom_attributes[{{attribute}}]']" parameterized="true" timeout="30"/> + <element name="shippingAddressRequiredField" type="text" selector="//div[@id='shipping-new-address-form']//div[contains(@class, 'field _required') and contains(@name, 'shippingAddress.{{fieldName}}')]" parameterized="true" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutShippingNewAddressModalSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutShippingNewAddressModalSection.xml new file mode 100644 index 0000000000000..18071ff5fba44 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutShippingNewAddressModalSection.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCheckoutShippingNewAddressModalSection"> + <element name="firstName" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='firstname']"/> + <element name="lastName" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='lastname']"/> + <element name="company" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='company']"/> + <element name="street" type="input" parameterized="true" selector="//div[@id='shipping-new-address-form']//input[@name='street[{{index}}]']"/> + <element name="city" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='city']"/> + <element name="region" type="select" selector="//div[@id='shipping-new-address-form']//select[@name='region_id']"/> + <element name="postcode" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='postcode']"/> + <element name="country" type="select" selector="//div[@id='shipping-new-address-form']//select[@name='country_id']"/> + <element name="telephone" type="input" selector="//div[@id='shipping-new-address-form']//input[@name='telephone']"/> + <element name="saveAddress" type="button" selector="//div[@id='shipping-new-address-form']//button[contains(@class, 'action-save-address')]"/> + <element name="cancelChangeAddress" type="button" selector="//div[@id='shipping-new-address-form']//button[contains(@class, 'action-hide-popup')]"/> + </section> +</sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml index f43211e909cca..965732100ce3d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml @@ -8,17 +8,17 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest"> + <test name="AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest" deprecated="Use StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest instead"> <annotations> <features value="Checkout"/> <stories value="Guest checkout"/> - <title value="Address State Field For UK Customers Remain Option even After Browser Refresh"/> + <title value="DEPRECATED. Address State Field For UK Customers Remain Option even After Browser Refresh"/> <description value="Address State Field For UK Customers Remain Option even After Browser Refresh"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-93329"/> <group value="checkout"/> <skip> - <issueId value="MAGETWO-93726"/> + <issueId value="DEPRECATED">Use StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest instead</issueId> </skip> </annotations> <before> @@ -32,7 +32,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml index b825757636c0b..eddb7d430387c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AddressStateFieldShouldNotAcceptJustIntegerValuesTest.xml @@ -23,19 +23,15 @@ <createData entity="ApiSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml index 259934503ec0e..1a7e2255db35c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml @@ -88,10 +88,7 @@ <!-- Enable "Flat Rate" --> <actionGroup ref="AdminChangeFlatRateShippingMethodStatusActionGroup" stepKey="enableFlatRateShippingStatus"/> - <!-- Flush cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Back to the Checkout and refresh the page --> <switchToPreviousTab stepKey="switchToPreviousTab"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsGuestTest.xml index 3b15b9b4e0449..b80476bb633e5 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsGuestTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsGuestTest.xml @@ -62,9 +62,9 @@ <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> - <!--Click Place Order button--> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> + <!--Click Place Order button--> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoadSuccessPage"/> <!--See success messages--> <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsRegisterCustomerTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsRegisterCustomerTest.xml index 8836d54187cbb..ff0365a2f686c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsRegisterCustomerTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsRegisterCustomerTest.xml @@ -71,8 +71,8 @@ <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> <!--Click Place Order button--> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessTitle"/> <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order number is: " stepKey="seeOrderNumber"/> <see selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessNotify"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml index 561e73bc24f61..57b3a9f071cc4 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Go to product page--> - <amOnPage url="{{StorefrontProductPage.url($$simpleProduct.name$$)}}" stepKey="amOnStorefrontProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnStorefrontProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <!--Add product to cart--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml index d1f452896c84f..9958b12ceaf25 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml @@ -34,7 +34,7 @@ <requiredEntity createDataKey="createSimpleProduct"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTest.xml index 9734a05d2cc03..d45fb92744544 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTest.xml @@ -25,13 +25,8 @@ <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer_NY" stepKey="createCustomer"/> - <!--Clear cache and reindex--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> @@ -45,7 +40,7 @@ </actionGroup> <!-- Add product to cart --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <actionGroup ref="StorefrontAddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/NoErrorCartCheckoutForProductsDeletedFromMiniCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/NoErrorCartCheckoutForProductsDeletedFromMiniCartTest.xml index d269a666d975e..a783da18b78dc 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/NoErrorCartCheckoutForProductsDeletedFromMiniCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/NoErrorCartCheckoutForProductsDeletedFromMiniCartTest.xml @@ -26,18 +26,14 @@ <field key="price">100.00</field> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> </after> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onStorefrontCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addProductToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml index b3c5174605575..3b43ecfa6e8be 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml @@ -77,6 +77,7 @@ <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml index e6734cf9257ba..a508df5aad029 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml @@ -86,9 +86,9 @@ <waitForPageLoad stepKey="waitForAddressSaved"/> <!-- Place order --> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <waitForPageLoad stepKey="waitForCheckoutPaymentSectionPageLoad"/> - <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCheckoutPaymentSectionPageLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Login as admin --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml index 929943dcfde52..42bec1546e40e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml @@ -79,9 +79,9 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Place order --> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <waitForPageLoad stepKey="waitForCheckoutPaymentSectionPageLoad"/> - <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCheckoutPaymentSectionPageLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml index 78c4d3301e746..a8a5e4a4cc5ed 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonExistentCustomerGroupTest.xml @@ -87,6 +87,7 @@ <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutCancelEditingBillingAddress.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutCancelEditingBillingAddress.xml new file mode 100644 index 0000000000000..46947b869877a --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutCancelEditingBillingAddress.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="OnePageCheckoutCancelEditingBillingAddress"> + <annotations> + <features value="OnePageCheckout"/> + <stories value="MC-39581: Billing Address empty after going back and forth between shipping and payment step"/> + <title value="Billing Address empty after going back and forth between shipping and payment step"/> + <description value="Check billing address editing cancelation during checkout on the payment step"/> + <severity value="AVERAGE"/> + <group value="checkout"/> + </annotations> + <before> + <!-- Create Simple Product --> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> + <field key="price">160</field> + </createData> + </before> + <after> + <!-- Delete created product --> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + </after> + + <!-- Add Simple Product to cart --> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> + <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> + <argument name="productName" value="$$createSimpleProduct.name$$"/> + </actionGroup> + + <!-- Navigate to checkout --> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> + <!-- Fill shipping address --> + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"> + <argument name="shippingMethod" value="Flat Rate"/> + </actionGroup> + + <!-- Change the address --> + + <waitForElementVisible selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="waitForElementToBeVisible"/> + <uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="uncheckSameBillingAndShippingAddress"/> + <conditionalClick selector="{{CheckoutShippingSection.editActiveAddressButton}}" dependentSelector="{{CheckoutShippingSection.editActiveAddressButton}}" visible="true" stepKey="clickEditButton"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + + <!-- Fill in New Billing Address --> + <actionGroup ref="StorefrontFillBillingAddressActionGroup" stepKey="fillBillingAddress"> + <argument name="address" value="US_Address_CA"/> + </actionGroup> + <selectOption selector="{{CheckoutPaymentSection.guestRegion}}" userInput="{{US_Address_CA.state}}" stepKey="selectRegion"/> + <click selector="{{CheckoutPaymentSection.update}}" stepKey="clickOnUpdateButton"/> + + + <!-- Edit Billing Address --> + <waitForElementVisible selector="{{CheckoutShippingSection.editAddressButton}}" stepKey="waitForEditBillingAddressButton"/> + <click selector="{{CheckoutShippingSection.editAddressButton}}" stepKey="clickOnEditButton"/> + <fillField selector="{{CheckoutPaymentSection.guestFirstName}}" userInput="" stepKey="enterEmptyFirstName"/> + <fillField selector="{{CheckoutPaymentSection.guestLastName}}" userInput="" stepKey="enterEmptyLastName"/> + + <!-- Cancel Editing Billing Address --> + <click selector="{{CheckoutHeaderSection.shippingMethodStep}}" stepKey="goToShipping"/> + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickOnNextButton"/> + + <!-- Place order --> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> + <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml index 36ce5a87c9974..b60a46d348446 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml @@ -71,6 +71,7 @@ <!-- Check order summary in checkout --> <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index 5c13f9bbeb489..e3aec189bcd57 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -89,7 +89,7 @@ <createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml index 70faa3721efe9..d809e3824e17c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml @@ -19,10 +19,7 @@ <group value="checkout"/> </annotations> <before> - <!-- Flush cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Create two customers --> <createData entity="Simple_US_Customer" stepKey="createFirstCustomer"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml index b65cfe0eb574f..e360909d6d653 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml @@ -23,9 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <updateData createDataKey="createProduct" entity="productWithOptions" stepKey="updateProductWithCustomOptions"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml index 026f33b04f69a..806e5e44591a3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml @@ -28,9 +28,7 @@ <createData entity="_defaultProduct" stepKey="product"> <requiredEntity createDataKey="category"/> </createData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> @@ -39,7 +37,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> - <amOnPage url="$$product.name$$.html" stepKey="navigateToProductPage"/> + <amOnPage url="$$product.custom_attributes[url_key]$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$product.name$$"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 45f1df1237d09..a119cf4179edd 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -35,9 +35,7 @@ <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/> <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> <createData entity="MinimumOrderAmount90" stepKey="minimumOrderAmount90"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createCartPriceRule"> <argument name="ruleName" value="CatPriceRule"/> <argument name="couponCode" value="CatPriceRule.coupon_code"/> @@ -45,7 +43,7 @@ <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStoreFront"> <argument name="Customer" value="$$createSimpleUsCustomer$$"/> </actionGroup> - <amOnPage url="$$simpleProduct.name$$.html" stepKey="navigateToProductPage"/> + <amOnPage url="$$simpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> </before> <after> @@ -54,10 +52,7 @@ <createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/> <createData entity="DefaultMinimumOrderAmount" stepKey="defaultMinimumOrderAmount"/> <deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/> - - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule"> <argument name="ruleName" value="{{CatPriceRule.name}}"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.xml index bc9dddf53ad03..c29e19275f759 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest.xml @@ -32,9 +32,7 @@ <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/> <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> <createData entity="MinimumOrderAmount90" stepKey="minimumOrderAmount90"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/> <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createCartPriceRule"> @@ -55,10 +53,7 @@ <createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/> <createData entity="DefaultMinimumOrderAmount" stepKey="defaultMinimumOrderAmount"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> - - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml index 1f9948f80f391..9cddb6b648b6c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml @@ -30,7 +30,7 @@ </after> <!--Add product to cart--> - <amOnPage url="$$createProduct.name$$.html" stepKey="navigateToProductPage"/> + <amOnPage url="$$createProduct.custom_attributes[url_key]$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createProduct.name$$"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml index 714a06510952f..678929ff228c2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml @@ -53,9 +53,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value="cataloginventory_stock"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml index edb6f8ba97b27..4038c14cc70dc 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml @@ -50,11 +50,9 @@ <requiredEntity createDataKey="simpleProduct2"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> @@ -115,9 +113,7 @@ <!--Enabled Mini Cart --> <magentoCLI stepKey="enableShoppingCartSidebar" command="config:set checkout/sidebar/display 1"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <reloadPage stepKey="reloadThePage"/> <!--Click on mini cart--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml index 146ecde047016..699340e1694e8 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml @@ -110,12 +110,8 @@ <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct3"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml index 4f54363bd8dc4..81377db2c17c1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml @@ -28,12 +28,8 @@ <createData entity="downloadableLink2" stepKey="addDownloadableLink2"> <requiredEntity createDataKey="createDownloadableProduct"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove example.com static.magento.com"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml index 13a179fe52444..ca62e7c58dfb7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml @@ -43,9 +43,7 @@ <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple3"/> </updateData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simple1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml index cd6f4215adb5d..a5ff1907efc25 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml @@ -47,11 +47,9 @@ <requiredEntity createDataKey="simpleProduct2"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml index 3a87bc88f9377..a403f928229bb 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml @@ -23,9 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <updateData createDataKey="createProduct" entity="productWithOptions" stepKey="updateProductWithCustomOptions"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddSimpleProductToCartWithRedirectToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddSimpleProductToCartWithRedirectToShoppingCartTest.xml new file mode 100644 index 0000000000000..6718a566d523a --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddSimpleProductToCartWithRedirectToShoppingCartTest.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontAddSimpleProductToCartWithRedirectToShoppingCartTest"> + <annotations> + <stories value="Shopping Cart"/> + <features value="Checkout"/> + <title value="Add simple product to shopping cart with 'redirect to shopping cart' enabled."/> + <description value="Verify, user able add simple product to shopping cart from category page and compare products page when 'redirect to shopping cart' is enabled."/> + <testCaseId value="MC-41079"/> + <useCaseId value="MC-40983"/> + <severity value="CRITICAL"/> + <group value="shoppingCart"/> + <group value="checkout"/> + </annotations> + + <before> + <!--Enable redirect to shopping cart.--> + <magentoCLI command="config:set {{EnableRedirectToShoppingCart.path}} {{EnableRedirectToShoppingCart.value}}" stepKey="enableRedirectToShippingCart"/> + <!--Create test data.--> + <createData entity="_defaultCategory" stepKey="category"/> + <createData entity="SimpleProduct" stepKey="product"> + <requiredEntity createDataKey="category"/> + </createData> + </before> + <after> + <!--Disable redirect to shopping cart.--> + <magentoCLI command="config:set {{DisableRedirectToShoppingCart.path}} {{DisableRedirectToShoppingCart.value}}" stepKey="disableRedirectToShippingCart"/> + <!--Delete test data.--> + <deleteData createDataKey="product" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="category" stepKey="deleteCategory"/> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + </after> + + <!--Try to add simple product to shopping cart.--> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="$category.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="StorefrontAddSimpleProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$product$"/> + </actionGroup> + <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="verifyCartRedirectAfterAddingProductFromCategoryPage"/> + <!-- Add product to compare list --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$product.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare"> + <argument name="productVar" value="$product$"/> + </actionGroup> + <!--Try to add simple product to shopping cart from compare products page.--> + <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="checkProductInComparisonList"> + <argument name="productVar" value="$product$"/> + </actionGroup> + <actionGroup ref="StorefrontAddSimpleProductToCartFromComparisonListActionGroup" stepKey="addProductToCartFromComparisonList"> + <argument name="productName" value="$product.name$"/> + </actionGroup> + <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="verifyCartRedirectAfterAddingProductFromComparisonList"/> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml index cd1c0542c5c5b..feab5625c115d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml @@ -47,11 +47,9 @@ <requiredEntity createDataKey="simpleProduct2"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml new file mode 100644 index 0000000000000..6b9c1f8f9b009 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontAddressStateFieldForUKCustomerRemainOptionAfterRefreshTest"> + <annotations> + <features value="Checkout"/> + <stories value="Guest checkout"/> + <title value="Address State Field For UK Customers Remain Option even After Browser Refresh"/> + <description value="Address State Field For UK Customers Remain Option even After Browser Refresh"/> + <severity value="MAJOR"/> + <testCaseId value="MC-25694"/> + <group value="checkout"/> + </annotations> + <before> + <createData entity="simpleProductWithoutCategory" stepKey="createSimpleProduct"/> + </before> + <after> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + </after> + <!--Step 1 Add simple product to the cart --> + <actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$createSimpleProduct$"/> + </actionGroup> + + <!--Step 2 Proceed to Checkout and be on Shipping page --> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout"/> + + <!--Step 3 Select Country as United Kingdom and Refresh the page --> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{UK_Address.country_id}}" stepKey="selectCounty"/> + <waitForPageLoad stepKey="waitFormToReload"/> + <actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/> + <!-- Assert Selected Country is United States --> + <seeOptionIsSelected selector="{{CheckoutShippingSection.country}}" userInput="{{US_Address_TX.country}}" stepKey="selectedCountryIsUnitedStates"/> + + <!--Step 4 Select Country as United Kingdom, select address street and Refresh the page--> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{UK_Address.country_id}}" stepKey="selectUnitedKingdomCounty"/> + <waitForPageLoad stepKey="waitFormToReloadAfterSelectCountry"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{UK_Address.street[0]}}" stepKey="enterAddressStreet"/> + <actionGroup ref="ReloadPageActionGroup" stepKey="refreshPageAfterAddressIsAdded"/> + <!-- Assert Entered details should be retained and State/Province field should be displayed as an optional field (without * ) --> + <seeOptionIsSelected selector="{{CheckoutShippingSection.country}}" userInput="{{UK_Address.country}}" stepKey="selectedCountryIsUnitedKingdom"/> + <seeInField selector="{{CheckoutShippingSection.street}}" userInput="{{UK_Address.street[0]}}" stepKey="seeAddressStreetUnitedKingdom"/> + <dontSeeElement selector="{{CheckoutShippingSection.shippingAddressRequiredField('region_id')}}" stepKey="assertStateProvinceIsNotRequired"/> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml index 4c0484f88d549..6af6df2ea03f3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml @@ -51,9 +51,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct10"> <field key="price">100.00</field> </createData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml index b399d76e86e2f..e31db8ee28c7f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml @@ -54,12 +54,8 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct11"> <field key="price">110.00</field> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml index e0aeb2f93d30c..c68961c3e8c2b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml @@ -49,9 +49,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct10"> <field key="price">100.00</field> </createData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml index ce6d465408382..ee32ce6d928a1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml @@ -54,9 +54,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct11"> <field key="price">110.00</field> </createData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml index c1dc0b7e62ba7..f20a21da14969 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml @@ -34,9 +34,7 @@ <createData entity="VirtualProduct" stepKey="virtualProduct4"> <field key="price">40.00</field> </createData> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="virtualProduct1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml index 3aa93d72571f9..743f4e0165159 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml @@ -39,9 +39,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete category --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml index 35328c58cdd49..33517a490fde4 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml @@ -33,9 +33,7 @@ <argument name="price" value="Fixed"/> <argument name="amount" value="24.00"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="enableGuestCheckout"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithPurchaseOrderNumberTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithPurchaseOrderNumberTest.xml index 0b46bbdb7db65..c2dc47c006a1b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithPurchaseOrderNumberTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithPurchaseOrderNumberTest.xml @@ -55,8 +55,8 @@ </actionGroup> <!--Click Place Order button--> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <waitForPageLoad stepKey="waitForPageLoad"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad"/> <!--See success messages--> <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml index 646983eafcf08..1a85bb0bee1ee 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml @@ -90,12 +90,8 @@ <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct1"/> <waitForPageLoad time='60' stepKey="waitForSpecialPriceProductSaved"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSaveSuccessMessage1"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml index 05d24696197d2..2dc99accba8f8 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!-- Add product to shopping cart --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productCount" value="1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml index 535a3fb0c436b..3b7bd1d662cb1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml @@ -23,9 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml index 396ba5894aeb3..9a460c3fff8c9 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml @@ -42,13 +42,8 @@ <click stepKey="clickSave" selector="{{AdminStoresMainActionsSection.saveButton}}"/> - <!--TODO: REMOVE AFTER FIX MC-21717 --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Go to the tax rule page and delete the row we created--> @@ -80,7 +75,7 @@ <argument name="Customer" value="$$multiple_address_customer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$simplecategory.name$$)}}" stepKey="onCategoryPage1"/> + <amOnPage url="{{StorefrontCategoryPage.url($$simplecategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage1"/> <waitForPageLoad stepKey="waitForCatalogPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct1"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart1"/> @@ -99,7 +94,7 @@ <waitForPageLoad stepKey="waitForOrderSuccessPage1"/> <see stepKey="seeSuccessMessage1" selector="{{CheckoutSuccessMainSection.success}}" userInput="Your order number is:"/> - <amOnPage url="{{StorefrontCategoryPage.url($$simplecategory.name$$)}}" stepKey="onCategoryPage2"/> + <amOnPage url="{{StorefrontCategoryPage.url($$simplecategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage2"/> <waitForPageLoad stepKey="waitForCatalogPageLoad2"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct2"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart2"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithRestrictedCountriesForPaymentTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithRestrictedCountriesForPaymentTest.xml index 8325eeb0da7e3..6a56f653698b0 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithRestrictedCountriesForPaymentTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithRestrictedCountriesForPaymentTest.xml @@ -27,13 +27,8 @@ <magentoCLI command="config:set payment/checkmo/specificcountry GB" stepKey="specificCountryValue"/> <createData entity="Simple_US_Customer" stepKey="simpleuscustomer"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> @@ -49,7 +44,7 @@ </actionGroup> <!-- Add product to cart --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml index 38060e34cbb79..e09c2a3af2f3e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml @@ -72,9 +72,9 @@ <!--Refresh Page and Place Order--> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> <reloadPage stepKey="reloadPage"/> - <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPlaceOrderButton"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="grabOrderNumber"/> <!--Verify New addresses in Customer's Address Book--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml index 6e304ff9cfb50..d289bdc0dc8d1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml @@ -41,7 +41,7 @@ <requiredEntity createDataKey="simpleProduct1"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml index d012d44d84052..4d0196aebf4c5 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml @@ -63,12 +63,8 @@ <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct1"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml index d2bcaedb74fd1..c2c7a3c6f6631 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml @@ -27,12 +27,8 @@ <createData entity="downloadableLink1" stepKey="addDownloadableLink1"> <requiredEntity createDataKey="createDownloadableProduct"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove example.com static.magento.com"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml index 21966875519dc..153d30b1e226e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml @@ -40,7 +40,7 @@ <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!-- Add virtual Product to the cart --> - <amOnPage url="{{StorefrontProductPage.url($$virtualProduct.name$$)}}" stepKey="amOnStorefrontVirtualProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$virtualProduct.custom_attributes[url_key]$$)}}" stepKey="amOnStorefrontVirtualProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$virtualProduct.name$$"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml index 4c9828d17ca1a..da4a1b93691b6 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml @@ -23,13 +23,8 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> @@ -37,7 +32,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTestWithRestrictedCountriesForPaymentTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTestWithRestrictedCountriesForPaymentTest.xml index 7090b0d4fd3fd..a393d6b42df48 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTestWithRestrictedCountriesForPaymentTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTestWithRestrictedCountriesForPaymentTest.xml @@ -24,12 +24,8 @@ </createData> <magentoCLI stepKey="allowSpecificValue" command="config:set payment/checkmo/allowspecific 1"/> <magentoCLI stepKey="specificCountryValue" command="config:set payment/checkmo/specificcountry GB"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> @@ -40,7 +36,7 @@ </after> <!-- Add product to cart --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml index c03f10c3b2f38..f22bcef1a19a9 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -93,9 +93,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithDifferentShippingAndBillingAddressWithRestrictedCountriesForPaymentTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithDifferentShippingAndBillingAddressWithRestrictedCountriesForPaymentTest.xml new file mode 100644 index 0000000000000..ad4dbd0ab8047 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithDifferentShippingAndBillingAddressWithRestrictedCountriesForPaymentTest.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontGuestCheckoutWithDifferentShippingAndBillingAddressWithRestrictedCountriesForPaymentTest"> + <annotations> + <features value="Checkout"/> + <stories value="Check payment methods on checkout"/> + <title value="Check payment methods update on checkout payment step"/> + <description value="Check that payment methods will update on checkout payment step after updating customer billing address"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-41743"/> + <useCaseId value="MC-37820"/> + <group value="checkout"/> + </annotations> + + <before> + <magentoCLI command="config:set {{BankTransferEnableConfigData.path}} {{BankTransferEnableConfigData.value}}" stepKey="enableBankTransfer"/> + <magentoCLI command="config:set payment/checkmo/allowspecific 1" stepKey="allowSpecificValue"/> + <magentoCLI command="config:set payment/checkmo/specificcountry GB" stepKey="allowBankTransferOnlyForGB"/> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + </before> + + <after> + <magentoCLI command="config:set {{BankTransferDisabledConfigData.path}} {{BankTransferDisabledConfigData.value}}" stepKey="disableBankTransfer"/> + <magentoCLI command="config:set payment/checkmo/allowspecific 0" stepKey="disallowSpecificValue" /> + <magentoCLI command="config:set payment/checkmo/specificcountry ''" stepKey="defaultCountryValue"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + </after> + + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> + <argument name="productName" value="$createProduct.name$"/> + </actionGroup> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="fillShippingSectionAsGuest"> + <argument name="customerVar" value="CustomerEntityOne"/> + <argument name="customerAddressVar" value="CustomerAddressSimple"/> + </actionGroup> + <dontSee selector="{{CheckoutPaymentSection.paymentMethodTitle}}" userInput="Check / Money order" stepKey="assertNoCheckMoneyOrderPaymentMethod"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.billingAddressNotSameBankTransferCheckbox}}" stepKey="waitForBillingAddressNotSameAsShippingCheckbox"/> + <uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameBankTransferCheckbox}}" stepKey="uncheckSameBillingAndShippingAddress"/> + <conditionalClick selector="{{CheckoutPaymentSection.editAddress}}" dependentSelector="{{CheckoutShippingSection.editAddressButton}}" visible="true" stepKey="clickEditBillingAddressButton"/> + <waitForLoadingMaskToDisappear stepKey="waitForBillingAddressFormLoads"/> + + <!-- Fill Billing Address --> + <actionGroup ref="StorefrontFillBillingAddressActionGroup" stepKey="fillBillingAddress"/> + <click selector="{{CheckoutPaymentSection.update}}" stepKey="clickOnUpdateButton"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear" /> + <see selector="{{CheckoutPaymentSection.paymentMethodTitle}}" userInput="Check / Money order" stepKey="sdadasdasdsdaasd"/> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml index 321511e4e86d9..502a564a22ffd 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml @@ -30,7 +30,7 @@ </after> <!--Add product to cart and checkout--> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$createProduct.name$$"/> @@ -65,10 +65,10 @@ <!--Go to cart page, update qty and proceed to checkout--> <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCartPage"/> <see userInput="Shopping Cart" stepKey="seeCartPageIsOpened"/> - <fillField selector="{{CheckoutCartProductSection.qty($$createProduct.name$$)}}" userInput="2" stepKey="updateProductQty"/> + <fillField selector="{{CheckoutCartProductSection.qty($$createProduct.sku$$)}}" userInput="2" stepKey="updateProductQty"/> <click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickUpdateShoppingCart"/> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> - <grabValueFrom selector="{{CheckoutCartProductSection.qty($$createProduct.name$$)}}" stepKey="grabQty"/> + <grabValueFrom selector="{{CheckoutCartProductSection.qty($$createProduct.sku$$)}}" stepKey="grabQty"/> <assertEquals stepKey="assertQty"> <actualResult type="const">$grabQty</actualResult> <expectedResult type="const">2</expectedResult> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml index 91086a4b3788e..caba8a9f0f49d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml @@ -15,7 +15,7 @@ <title value="Checking Product name in Minicart and on Checkout page with different store views"/> <description value="Checking Product name in Minicart and on Checkout page with different store views"/> <severity value="MAJOR"/> - <testCaseId value="MAGETWO-96466"/> + <testCaseId value="MC-28566"/> <useCaseId value="MAGETWO-96421"/> <group value="checkout"/> </annotations> @@ -31,6 +31,7 @@ <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"> <argument name="customStore" value="customStore"/> </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> @@ -56,7 +57,7 @@ <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/> <!--Add product to cart--> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$createProduct.name$$"/> @@ -95,8 +96,8 @@ <!--Proceed to checkout and check product name in Order Summary area--> <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="proceedToCheckout"/> - <comment userInput="Adding the comment to replace waitForShippingPageLoad action for preserving Backward Compatibility" stepKey="waitForShippingPageLoad"/> - <click selector="{{CheckoutShippingGuestInfoSection.itemInCart}}" stepKey="clickItemInCart"/> + <waitForElementVisible selector="{{CheckoutShippingSection.email}}" stepKey="waitForShippingPageLoad"/> + <conditionalClick selector="{{CheckoutShippingGuestInfoSection.itemInCart}}" dependentSelector="{{CheckoutShippingGuestInfoSection.itemInCartActive}}" visible="false" stepKey="clickItemInCart"/> <grabTextFrom selector="{{CheckoutShippingGuestInfoSection.productName}}" stepKey="grabProductNameShipping"/> <assertStringContainsString stepKey="assertProductNameShipping"> <actualResult type="const">$grabProductNameShipping</actualResult> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml index f014a7a5bd1ee..dc926b6e7b370 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml @@ -30,9 +30,7 @@ <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <actionGroup ref="SetCustomerDataLifetimeActionGroup" stepKey="setDefaultCustomerDataLifetime"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexCustomerGrid"> - <argument name="indices" value="customer_grid"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexCustomerGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!--Go to product page--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyGuestCheckoutUsingFreeShippingAndTaxesTest.xml index 38cc4fe8abcf3..fed40f39d6122 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -83,11 +83,9 @@ </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCheckoutTest.xml index 7465ab6aa69e4..901c5c3598dbf 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCheckoutTest.xml @@ -25,7 +25,7 @@ <createData entity="_defaultProduct" stepKey="product"> <requiredEntity createDataKey="category"/> </createData> - <amOnPage url="{{StorefrontCategoryPage.url($$category.name$$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$category.custom_attributes[url_key]$$)}}" stepKey="goToCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="moveMouseOverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="clickAddToCartButton"/> @@ -35,15 +35,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="product" stepKey="deleteProduct"/> <deleteData createDataKey="category" stepKey="deleteCategory"/> </after> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml index f38061dbf6a6c..d4e473466c943 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml @@ -79,8 +79,8 @@ <waitForPageLoad stepKey="WaitForDiscountToBeAdded"/> <see userInput="Your coupon was successfully applied." stepKey="verifyText"/> - <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPlaceOrderButton"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!--Proceed to Admin panel > SALES > Orders. Created order should be in Processing status--> diff --git a/app/code/Magento/Checkout/Test/Unit/Block/CartTest.php b/app/code/Magento/Checkout/Test/Unit/Block/CartTest.php new file mode 100644 index 0000000000000..2937eed396529 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Unit/Block/CartTest.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Checkout\Test\Unit\Block; + +use Magento\Checkout\Block\Cart; +use Magento\Checkout\Model\Session; +use Magento\Framework\Escaper; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\View\Element\Template\Context; +use Magento\Framework\View\LayoutInterface; +use Magento\Quote\Model\Quote; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class CartTest extends TestCase +{ + + /** + * @var Cart + */ + private $cartBlock; + + /** + * @var Escaper|MockObject + */ + private $escaper; + + /** @var Cart|MockObject */ + private $context; + + /** @var LayoutInterface|MockObject */ + private $layoutMock; + + protected function setUp(): void + { + $objectManager = new ObjectManager($this); + $this->context = $this->createPartialMock(Context::class, ['getEscaper', 'getLayout']); + $quoteMock = $this->createMock(Quote::class); + $checkoutSession = $this->createMock(Session::class); + $this->layoutMock = $this->createMock(LayoutInterface::class); + $this->escaper = $objectManager->getObject(Escaper::class); + $quoteMock->expects($this->once())->method('getAllVisibleItems')->willReturn([]); + $checkoutSession->expects($this->any())->method('getQuote')->willReturn($quoteMock); + $this->context->expects($this->once())->method('getEscaper')->willReturn($this->escaper); + $this->context->expects($this->once())->method('getLayout')->willReturn($this->layoutMock); + + /** @var $cartBlock Cart */ + $this->cartBlock = $objectManager->getObject( + Cart::class, + [ + 'context'=> $this->context, + 'checkoutSession'=>$checkoutSession, + + ] + ); + } + + public function testGetMethodHtmlWithException() + { + $this->layoutMock->expects($this->any())->method('getBlock')->willReturn(false); + $name='blockMethod'; + $this->expectException(LocalizedException::class); + $this->expectExceptionMessage( + (string)__('Invalid method: %1', $name) + ); + $this->cartBlock->getMethodHtml($name); + } +} diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Sidebar/UpdateItemQtyTest.php b/app/code/Magento/Checkout/Test/Unit/Controller/Sidebar/UpdateItemQtyTest.php index 47f43c8580e22..c100571e10861 100644 --- a/app/code/Magento/Checkout/Test/Unit/Controller/Sidebar/UpdateItemQtyTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Controller/Sidebar/UpdateItemQtyTest.php @@ -8,6 +8,7 @@ namespace Magento\Checkout\Test\Unit\Controller\Sidebar; use Magento\Checkout\Controller\Sidebar\UpdateItemQty; +use Magento\Checkout\Model\Cart\RequestQuantityProcessor; use Magento\Checkout\Model\Sidebar; use Magento\Framework\App\RequestInterface; use Magento\Framework\App\ResponseInterface; @@ -41,11 +42,15 @@ class UpdateItemQtyTest extends TestCase /** @var ResponseInterface|MockObject */ protected $responseMock; + /** @var RequestQuantityProcessor|MockObject */ + private $quantityProcessor; + protected function setUp(): void { $this->sidebarMock = $this->createMock(Sidebar::class); $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); $this->jsonHelperMock = $this->createMock(Data::class); + $this->quantityProcessor = $this->createMock(RequestQuantityProcessor::class); $this->requestMock = $this->getMockForAbstractClass(RequestInterface::class); $this->responseMock = $this->getMockForAbstractClass( ResponseInterface::class, @@ -64,6 +69,7 @@ protected function setUp(): void 'sidebar' => $this->sidebarMock, 'logger' => $this->loggerMock, 'jsonHelper' => $this->jsonHelperMock, + 'quantityProcessor' => $this->quantityProcessor, 'request' => $this->requestMock, 'response' => $this->responseMock, ] @@ -115,6 +121,11 @@ public function testExecute() ) ->willReturn('json encoded'); + $this->quantityProcessor->expects($this->once()) + ->method('prepareQuantity') + ->with(2) + ->willReturn(2); + $this->responseMock->expects($this->once()) ->method('representJson') ->with('json encoded') diff --git a/app/code/Magento/Checkout/Test/Unit/Model/Cart/ImageProviderTest.php b/app/code/Magento/Checkout/Test/Unit/Model/Cart/ImageProviderTest.php index 71578131ad26e..f97dc2ecf8d0d 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/Cart/ImageProviderTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/Cart/ImageProviderTest.php @@ -37,6 +37,16 @@ class ImageProviderTest extends TestCase */ private $customerItem; + /** + * @var MockObject|\Magento\Catalog\Helper\Image + */ + private $imageHelper; + + /** + * @var MockObject|\Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface + */ + private $itemResolver; + protected function setUp(): void { $this->itemRepositoryMock = $this->getMockForAbstractClass(CartItemRepositoryInterface::class); @@ -44,10 +54,18 @@ protected function setUp(): void $this->customerItem = $this->getMockBuilder(DefaultItem::class) ->disableOriginalConstructor() ->getMock(); + $this->imageHelper = $this->getMockBuilder(\Magento\Catalog\Helper\Image::class) + ->disableOriginalConstructor() + ->getMock(); + $this->itemResolver = $this->getMockForAbstractClass( + \Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface::class + ); $this->model = new ImageProvider( $this->itemRepositoryMock, $this->itemPoolMock, - $this->customerItem + $this->customerItem, + $this->imageHelper, + $this->itemResolver ); } @@ -55,14 +73,23 @@ public function testGetImages() { $cartId = 42; $itemId = 74; - $itemData = ['product_image' => 'Magento.png', 'random' => '3.1415926535']; + $itemData = [ + 'src' => 'Url', + 'alt' => 'Label', + 'width' => 'Width', + 'height' => 'Height' + ]; $itemMock = $this->createMock(Item::class); $itemMock->expects($this->once())->method('getItemId')->willReturn($itemId); - $expectedResult = [$itemId => $itemData['product_image']]; + $expectedResult = [$itemId => $itemData]; $this->itemRepositoryMock->expects($this->once())->method('getList')->with($cartId)->willReturn([$itemMock]); - $this->customerItem->expects($this->once())->method('getItemData')->with($itemMock)->willReturn($itemData); + $this->imageHelper->expects($this->once())->method('init')->willReturnSelf(); + $this->imageHelper->expects($this->once())->method('getUrl')->willReturn('Url'); + $this->imageHelper->expects($this->once())->method('getLabel')->willReturn('Label'); + $this->imageHelper->expects($this->once())->method('getWidth')->willReturn('Width'); + $this->imageHelper->expects($this->once())->method('getHeight')->willReturn('Height'); $this->assertEquals($expectedResult, $this->model->getImages($cartId)); } diff --git a/app/code/Magento/Checkout/Test/Unit/Model/Cart/RequestQuantityProcessorTest.php b/app/code/Magento/Checkout/Test/Unit/Model/Cart/RequestQuantityProcessorTest.php index e536d5e286a1a..acd97fbc11bd5 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/Cart/RequestQuantityProcessorTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/Cart/RequestQuantityProcessorTest.php @@ -28,24 +28,24 @@ protected function setUp(): void { $this->localeResolver = $this->getMockBuilder(ResolverInterface::class) ->getMockForAbstractClass(); - - $this->localeResolver->method('getLocale') - ->willReturn('en_US'); - - $this->requestProcessor = new RequestQuantityProcessor( - $this->localeResolver - ); } /** * Test of cart data processing. * * @param array $cartData + * @param string $locale * @param array $expected * @dataProvider cartDataProvider */ - public function testProcess($cartData, $expected) + public function testProcess(array $cartData, string $locale, array $expected): void { + $this->localeResolver->method('getLocale') + ->willReturn($locale); + $this->requestProcessor = new RequestQuantityProcessor( + $this->localeResolver + ); + $this->assertEquals($this->requestProcessor->process($cartData), $expected); } @@ -57,6 +57,7 @@ public function cartDataProvider() return [ 'empty_array' => [ 'cartData' => [], + 'locale' => 'en_US', 'expected' => [], ], 'strings_array' => [ @@ -64,6 +65,7 @@ public function cartDataProvider() ['qty' => ' 10 '], ['qty' => ' 0.5 '] ], + 'locale' => 'en_US', 'expected' => [ ['qty' => 10], ['qty' => 0.5] @@ -74,6 +76,7 @@ public function cartDataProvider() ['qty' => 1], ['qty' => 0.002] ], + 'locale' => 'en_US', 'expected' => [ ['qty' => 1], ['qty' => 0.002] @@ -83,10 +86,22 @@ public function cartDataProvider() 'cartData' => [ ['qty' => [1, 2 ,3]], ], + 'locale' => 'en_US', 'expected' => [ ['qty' => [1, 2, 3]], ], ], + 'strings_array_spain_locale' => [ + 'cartData' => [ + ['qty' => ' 10 '], + ['qty' => ' 0.5 '] + ], + 'locale' => 'es_CL', + 'expected' => [ + ['qty' => 10], + ['qty' => 0.5] + ], + ], ]; } } diff --git a/app/code/Magento/Checkout/Test/Unit/Model/DefaultConfigProviderTest.php b/app/code/Magento/Checkout/Test/Unit/Model/DefaultConfigProviderTest.php new file mode 100644 index 0000000000000..401e4a03f4cae --- /dev/null +++ b/app/code/Magento/Checkout/Test/Unit/Model/DefaultConfigProviderTest.php @@ -0,0 +1,298 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Checkout\Test\Unit\Model; + +use Magento\Captcha\Api\CaptchaConfigPostProcessorInterface; +use Magento\Catalog\Helper\Image; +use Magento\Catalog\Helper\Product\ConfigurationPool; +use Magento\Checkout\Helper\Data as CheckoutHelper; +use Magento\Checkout\Model\Cart\ImageProvider; +use Magento\Checkout\Model\DefaultConfigProvider; +use Magento\Checkout\Model\Session as CheckoutSession; +use Magento\Customer\Api\AddressMetadataInterface; +use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository; +use Magento\Customer\Api\Data\AttributeMetadataInterface; +use Magento\Customer\Model\Address\CustomerAddressDataProvider; +use Magento\Customer\Model\Address\Mapper; +use Magento\Customer\Model\Session as CustomerSession; +use Magento\Customer\Model\Url as CustomerUrlManager; +use Magento\Directory\Helper\Data; +use Magento\Directory\Model\Country\Postcode\ConfigInterface; +use Magento\Eav\Api\AttributeOptionManagementInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Http\Context as HttpContext; +use Magento\Framework\Data\Form\FormKey; +use Magento\Framework\Locale\FormatInterface as LocaleFormat; +use Magento\Framework\UrlInterface; +use Magento\Quote\Api\CartItemRepositoryInterface as QuoteItemRepository; +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\Quote\Api\CartTotalRepositoryInterface; +use Magento\Quote\Api\Data\TotalsInterface; +use Magento\Quote\Api\PaymentMethodManagementInterface; +use Magento\Quote\Api\ShippingMethodManagementInterface as ShippingMethodManager; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Address; +use Magento\Quote\Model\QuoteIdMaskFactory; +use Magento\Shipping\Model\Config; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class DefaultConfigProviderTest extends TestCase +{ + /** + * @var DefaultConfigProvider + */ + private $model; + + /** + * @var CheckoutSession|MockObject + */ + private $checkoutSession; + + /** + * @var ShippingMethodManager|MockObject + */ + private $shippingMethodManager; + + /** + * @var AddressMetadataInterface|MockObject + */ + private $addressMetadata; + + /** + * @var CartTotalRepositoryInterface|MockObject + */ + private $cartTotalRepository; + + /** + * @var Config|MockObject + */ + private $shippingMethodConfig; + + /** + * @var CaptchaConfigPostProcessorInterface|MockObject + */ + private $configPostProcessor; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $checkoutHelper = $this->createMock(CheckoutHelper::class); + $this->checkoutSession = $this->createMock(CheckoutSession::class); + $customerRepository = $this->createMock(CustomerRepository::class); + $customerSession = $this->createMock(CustomerSession::class); + $customerUrlManager = $this->createMock(CustomerUrlManager::class); + $httpContext = $this->createMock(HttpContext::class); + $quoteRepository = $this->createMock(CartRepositoryInterface::class); + $quoteItemRepository = $this->createMock(QuoteItemRepository::class); + $this->shippingMethodManager = $this->getMockBuilder(ShippingMethodManager::class) + ->addMethods(['get']) + ->getMockForAbstractClass(); + $configurationPool = $this->createMock(ConfigurationPool::class); + $quoteIdMaskFactory = $this->createMock(QuoteIdMaskFactory::class); + $localeFormat = $this->createMock(LocaleFormat::class); + $addressMapper = $this->createMock(Mapper::class); + $addressConfig = $this->createMock(\Magento\Customer\Model\Address\Config::class); + $formKey = $this->createMock(FormKey::class); + $imageHelper = $this->createMock(Image::class); + $viewConfig = $this->createMock(\Magento\Framework\View\ConfigInterface::class); + $postCodesConfig = $this->createMock(ConfigInterface::class); + $imageProvider = $this->createMock(ImageProvider::class); + $directoryHelper = $this->createMock(Data::class); + $this->cartTotalRepository = $this->createMock(CartTotalRepositoryInterface::class); + $scopeConfig = $this->createMock(ScopeConfigInterface::class); + $this->shippingMethodConfig = $this->createMock(Config::class); + $storeManager = $this->createMock(StoreManagerInterface::class); + $paymentMethodManagement = $this->createMock(PaymentMethodManagementInterface::class); + $urlBuilder = $this->createMock(UrlInterface::class); + $this->configPostProcessor = $this->createMock(CaptchaConfigPostProcessorInterface::class); + $this->addressMetadata = $this->createMock(AddressMetadataInterface::class); + $attributeOptionManager = $this->createMock(AttributeOptionManagementInterface::class); + $customerAddressData = $this->createMock(CustomerAddressDataProvider::class); + $this->model = new DefaultConfigProvider( + $checkoutHelper, + $this->checkoutSession, + $customerRepository, + $customerSession, + $customerUrlManager, + $httpContext, + $quoteRepository, + $quoteItemRepository, + $this->shippingMethodManager, + $configurationPool, + $quoteIdMaskFactory, + $localeFormat, + $addressMapper, + $addressConfig, + $formKey, + $imageHelper, + $viewConfig, + $postCodesConfig, + $imageProvider, + $directoryHelper, + $this->cartTotalRepository, + $scopeConfig, + $this->shippingMethodConfig, + $storeManager, + $paymentMethodManagement, + $urlBuilder, + $this->configPostProcessor, + $this->addressMetadata, + $attributeOptionManager, + $customerAddressData + ); + } + + /** + * @param array $shippingAddressData + * @param array $billingAddressData + * @param array $expected + * @dataProvider getConfigQuoteAddressDataDataProvider + */ + public function testGetConfigQuoteAddressData( + array $shippingAddressData, + array $billingAddressData, + array $expected + ): void { + $shippingAddressData['email'] = 'john.doe@example.com'; + $billingAddressData['email'] = 'john.doe@example.com'; + $keys = [ + 'isShippingAddressFromDataValid', + 'shippingAddressFromData', + 'isBillingAddressFromDataValid', + 'billingAddressFromData', + ]; + $quote = $this->createMock(Quote::class); + $shippingAddress = $this->getMockBuilder(Address::class) + ->disableOriginalConstructor() + ->onlyMethods(['validate']) + ->getMockForAbstractClass(); + $shippingAddress->addData($shippingAddressData); + $shippingAddress->method('validate') + ->willReturn(!empty($shippingAddress['firstname'])); + $billingAddress = $this->getMockBuilder(Address::class) + ->disableOriginalConstructor() + ->onlyMethods(['validate']) + ->getMockForAbstractClass(); + $billingAddress->addData($billingAddressData); + $billingAddress->method('validate') + ->willReturn(!empty($shippingAddress['firstname'])); + $quote->method('getShippingAddress') + ->willReturn($shippingAddress); + $quote->method('getBillingAddress') + ->willReturn($billingAddress); + $quote->method('getStore') + ->willReturn($this->createMock(Store::class)); + $this->checkoutSession->expects($this->atLeast(1)) + ->method('getQuote') + ->willReturn($quote); + + $attributeMetadata1 = $this->createMock(AttributeMetadataInterface::class); + $attributeMetadata1->method('isVisible') + ->willReturn(true); + $attributeMetadata1->method('getAttributeCode') + ->willReturn('firstname'); + + $attributeMetadata2 = $this->createMock(AttributeMetadataInterface::class); + $attributeMetadata2->method('isVisible') + ->willReturn(true); + $attributeMetadata2->method('getAttributeCode') + ->willReturn('lastname'); + + $this->addressMetadata->method('getAllAttributesMetadata') + ->willReturn([$attributeMetadata1, $attributeMetadata2]); + + $totals = $this->getMockBuilder(TotalsInterface::class) + ->addMethods(['toArray']) + ->getMockForAbstractClass(); + $totals->method('getItems') + ->willReturn([]); + $totals->method('getTotalSegments') + ->willReturn([]); + $this->cartTotalRepository->method('get') + ->willReturn($totals); + $this->shippingMethodConfig->method('getActiveCarriers') + ->willReturn([]); + $this->configPostProcessor->method('process') + ->willReturnArgument(0); + $actual = array_intersect_key($this->model->getConfig(), array_flip($keys)); + $this->assertEquals($expected, $actual); + } + + /** + * @return array + */ + public function getConfigQuoteAddressDataDataProvider(): array + { + return [ + [ + [], + [], + [] + ], + [ + [ + 'firstname' => 'John' + ], + [ + 'firstname' => 'Jack' + ], + [ + 'isShippingAddressFromDataValid' => true, + 'shippingAddressFromData' => [ + 'firstname' => 'John' + ], + 'isBillingAddressFromDataValid' => true, + 'billingAddressFromData' => [ + 'firstname' => 'Jack' + ] + ] + ], + [ + [ + 'lastname' => 'John' + ], + [ + 'lastname' => 'Jack' + ], + [ + 'isShippingAddressFromDataValid' => false, + 'shippingAddressFromData' => [ + 'lastname' => 'John' + ], + 'isBillingAddressFromDataValid' => false, + 'billingAddressFromData' => [ + 'lastname' => 'Jack' + ] + ] + ], + [ + [ + 'firstname' => 'John' + ], + [ + 'firstname' => 'John' + ], + [ + 'isShippingAddressFromDataValid' => true, + 'shippingAddressFromData' => [ + 'firstname' => 'John' + ], + ] + ], + ]; + } +} diff --git a/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php b/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php index 4a89443f02f6d..b4cab724b0ef3 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php @@ -9,6 +9,7 @@ use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Checkout\Model\GuestPaymentInformationManagement; use Magento\Framework\Exception\CouldNotSaveException; use Magento\Framework\Exception\LocalizedException; @@ -74,6 +75,11 @@ class GuestPaymentInformationManagementTest extends TestCase */ private $limiterMock; + /** + * @var PaymentSavingRateLimiterInterface|MockObject + */ + private $saveLimiterMock; + protected function setUp(): void { $objectManager = new ObjectManager($this); @@ -92,6 +98,7 @@ protected function setUp(): void ); $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); $this->limiterMock = $this->getMockForAbstractClass(PaymentProcessingRateLimiterInterface::class); + $this->saveLimiterMock = $this->getMockForAbstractClass(PaymentSavingRateLimiterInterface::class); $this->model = $objectManager->getObject( GuestPaymentInformationManagement::class, [ @@ -100,7 +107,8 @@ protected function setUp(): void 'cartManagement' => $this->cartManagementMock, 'cartRepository' => $this->cartRepositoryMock, 'quoteIdMaskFactory' => $this->quoteIdMaskFactoryMock, - 'paymentsRateLimiter' => $this->limiterMock + 'paymentsRateLimiter' => $this->limiterMock, + 'savingRateLimiter' => $this->saveLimiterMock ] ); $objectManager->setBackwardCompatibleProperty($this->model, 'logger', $this->loggerMock); @@ -159,11 +167,10 @@ public function testSavePaymentInformation() */ public function testSavePaymentInformationLimited(): void { - $this->expectException(PaymentProcessingRateLimitExceededException::class); - $this->limiterMock->method('limit') + $this->saveLimiterMock->method('limit') ->willThrowException(new PaymentProcessingRateLimitExceededException(__('Error'))); - $this->savePayment(); + $this->assertFalse($this->savePayment()); } public function testSavePaymentInformationWithoutBillingAddress() diff --git a/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php b/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php index 294857765007e..a396b290f367f 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php @@ -9,6 +9,7 @@ use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Checkout\Model\PaymentInformationManagement; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Phrase; @@ -66,6 +67,11 @@ class PaymentInformationManagementTest extends TestCase */ private $rateLimiterMock; + /** + * @var PaymentSavingRateLimiterInterface|MockObject + */ + private $saveLimiterMock; + protected function setUp(): void { $objectManager = new ObjectManager($this); @@ -81,13 +87,15 @@ protected function setUp(): void $this->cartRepositoryMock = $this->getMockBuilder(CartRepositoryInterface::class) ->getMock(); $this->rateLimiterMock = $this->getMockForAbstractClass(PaymentProcessingRateLimiterInterface::class); + $this->saveLimiterMock = $this->getMockForAbstractClass(PaymentSavingRateLimiterInterface::class); $this->model = $objectManager->getObject( PaymentInformationManagement::class, [ 'billingAddressManagement' => $this->billingAddressManagementMock, 'paymentMethodManagement' => $this->paymentMethodManagementMock, 'cartManagement' => $this->cartManagementMock, - 'paymentRateLimiter' => $this->rateLimiterMock + 'paymentRateLimiter' => $this->rateLimiterMock, + 'saveRateLimiter' => $this->saveLimiterMock ] ); $objectManager->setBackwardCompatibleProperty($this->model, 'logger', $this->loggerMock); @@ -164,11 +172,10 @@ public function testSavePaymentInformation() */ public function testSavePaymentInformationLimited(): void { - $this->rateLimiterMock->method('limit') + $this->saveLimiterMock->method('limit') ->willThrowException(new PaymentProcessingRateLimitExceededException(__('Error'))); - $this->expectException(PaymentProcessingRateLimitExceededException::class); - $this->savePayment(); + $this->assertFalse($this->savePayment()); } public function testSavePaymentInformationWithoutBillingAddress() diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index 5f7b5425667e5..2c89c92648456 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -7,6 +7,7 @@ "require": { "php": "~7.3.0||~7.4.0", "magento/framework": "*", + "magento/module-captcha": "*", "magento/module-catalog": "*", "magento/module-catalog-inventory": "*", "magento/module-config": "*", @@ -19,12 +20,12 @@ "magento/module-quote": "*", "magento/module-sales": "*", "magento/module-sales-rule": "*", + "magento/module-security": "*", "magento/module-shipping": "*", "magento/module-store": "*", "magento/module-tax": "*", "magento/module-theme": "*", "magento/module-ui": "*", - "magento/module-captcha": "*", "magento/module-authorization": "*" }, "suggest": { diff --git a/app/code/Magento/Checkout/etc/di.xml b/app/code/Magento/Checkout/etc/di.xml index 0c1d866dfc2fb..1af46c878694b 100644 --- a/app/code/Magento/Checkout/etc/di.xml +++ b/app/code/Magento/Checkout/etc/di.xml @@ -51,4 +51,6 @@ </type> <preference for="Magento\Checkout\Api\PaymentProcessingRateLimiterInterface" type="Magento\Checkout\Model\CaptchaPaymentProcessingRateLimiter" /> + <preference for="Magento\Checkout\Api\PaymentSavingRateLimiterInterface" + type="Magento\Checkout\Model\CaptchaPaymentSavingRateLimiter" /> </config> diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/link.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/link.phtml index b667764ac7bba..c2f99c03c8f4c 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/link.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/link.phtml @@ -4,21 +4,27 @@ * See COPYING.txt for license details. */ -/** @var $block \Magento\Checkout\Block\Onepage\Link */ +use Magento\Checkout\Block\Onepage\Link; +use Magento\Framework\Escaper; + +/** + * @var Link $block + * @var Escaper $escaper + */ ?> -<?php if ($block->isPossibleOnepageCheckout()) :?> +<?php if ($block->isPossibleOnepageCheckout()): ?> <button type="button" data-role="proceed-to-checkout" - title="<?= $block->escapeHtmlAttr(__('Proceed to Checkout')) ?>" + title="<?= $escaper->escapeHtmlAttr(__('Proceed to Checkout')) ?>" data-mage-init='{ "Magento_Checkout/js/proceed-to-checkout":{ - "checkoutUrl":"<?= $block->escapeJs($block->escapeUrl($block->getCheckoutUrl())) ?>" + "checkoutUrl":"<?= $escaper->escapeJs($block->getCheckoutUrl()) ?>" } }' class="action primary checkout<?= ($block->isDisabled()) ? ' disabled' : '' ?>" - <?php if ($block->isDisabled()) :?> + <?php if ($block->isDisabled()): ?> disabled="disabled" <?php endif; ?>> - <span><?= $block->escapeHtml(__('Proceed to Checkout')) ?></span> + <span><?= $escaper->escapeHtml(__('Proceed to Checkout')) ?></span> </button> <?php endif?> diff --git a/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information-extended.js b/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information-extended.js index 43c8c5a3a4fe8..bb66c90980a74 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information-extended.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information-extended.js @@ -15,7 +15,7 @@ define([ 'Magento_Checkout/js/action/get-totals', 'Magento_Checkout/js/model/full-screen-loader', 'underscore', - 'Magento_Checkout/js/model/payment/set-payment-hooks' + 'Magento_Checkout/js/model/payment/place-order-hooks' ], function (quote, urlBuilder, storage, errorProcessor, customer, getTotalsAction, fullScreenLoader, _, hooks) { 'use strict'; diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js b/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js index 66539ad211859..9c00050d886e8 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js @@ -35,6 +35,8 @@ define([ ) { 'use strict'; + var isBillingAddressResolvedFromBackend = false; + return { /** @@ -90,9 +92,7 @@ define([ applyShippingAddress: function (isEstimatedAddress) { var address, shippingAddress, - isConvertAddress, - addressData, - isShippingAddressInitialized; + isConvertAddress; if (addressList().length === 0) { address = addressConverter.formAddressDataToQuoteAddress( @@ -104,39 +104,14 @@ define([ isConvertAddress = isEstimatedAddress || false; if (!shippingAddress) { - isShippingAddressInitialized = addressList.some(function (addressFromList) { - if (checkoutData.getSelectedShippingAddress() == addressFromList.getKey()) { //eslint-disable-line - addressData = isConvertAddress ? - addressConverter.addressToEstimationAddress(addressFromList) - : addressFromList; - selectShippingAddress(addressData); - - return true; - } - - return false; - }); - - if (!isShippingAddressInitialized) { - isShippingAddressInitialized = addressList.some(function (addrs) { - if (addrs.isDefaultShipping()) { - addressData = isConvertAddress ? - addressConverter.addressToEstimationAddress(addrs) - : addrs; - selectShippingAddress(addressData); - - return true; - } + shippingAddress = this.getShippingAddressFromCustomerAddressList(); - return false; - }); - } - - if (!isShippingAddressInitialized && addressList().length === 1) { - addressData = isConvertAddress ? - addressConverter.addressToEstimationAddress(addressList()[0]) - : addressList()[0]; - selectShippingAddress(addressData); + if (shippingAddress) { + selectShippingAddress( + isConvertAddress ? + addressConverter.addressToEstimationAddress(shippingAddress) + : shippingAddress + ); } } }, @@ -208,12 +183,6 @@ define([ var selectedBillingAddress, newCustomerBillingAddressData; - if (!checkoutData.getBillingAddressFromData() && - window.checkoutConfig.billingAddressFromData - ) { - checkoutData.setBillingAddressFromData(window.checkoutConfig.billingAddressFromData); - } - selectedBillingAddress = checkoutData.getSelectedBillingAddress(); newCustomerBillingAddressData = checkoutData.getNewCustomerBillingAddress(); @@ -230,6 +199,19 @@ define([ } else { this.applyBillingAddress(); } + + if (!isBillingAddressResolvedFromBackend && + !checkoutData.getBillingAddressFromData() && + !_.isEmpty(window.checkoutConfig.billingAddressFromData) && + !quote.billingAddress() + ) { + if (window.checkoutConfig.isBillingAddressFromDataValid === true) { + selectBillingAddress(createBillingAddress(window.checkoutConfig.billingAddressFromData)); + } else { + checkoutData.setBillingAddressFromData(window.checkoutConfig.billingAddressFromData); + } + isBillingAddressResolvedFromBackend = true; + } }, /** @@ -267,6 +249,35 @@ define([ //set billing address same as shipping by default if it is not empty selectBillingAddress(quote.shippingAddress()); } + }, + + /** + * Get shipping address from address list + * + * @return {Object|null} + */ + getShippingAddressFromCustomerAddressList: function () { + var shippingAddress = _.find( + addressList(), + function (address) { + return checkoutData.getSelectedShippingAddress() == address.getKey() //eslint-disable-line + } + ); + + if (!shippingAddress) { + shippingAddress = _.find( + addressList(), + function (address) { + return address.isDefaultShipping(); + } + ); + } + + if (!shippingAddress && addressList().length === 1) { + shippingAddress = addressList()[0]; + } + + return shippingAddress; } }; }); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/new-customer-address.js b/app/code/Magento/Checkout/view/frontend/web/js/model/new-customer-address.js index 4ef39421440ce..eb4b45d83817c 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/new-customer-address.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/new-customer-address.js @@ -54,6 +54,7 @@ define([ vatId: addressData['vat_id'], saveInAddressBook: addressData['save_in_address_book'], customAttributes: addressData['custom_attributes'], + extensionAttributes: addressData['extension_attributes'], /** * @return {*} diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js b/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js index aba0c31b998d1..fe525bddc02f3 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/totals.js @@ -22,7 +22,7 @@ define([ quoteItems(newValue.items); }); - if (quoteSubtotal !== subtotalAmount) { + if (!isNaN(subtotalAmount) && quoteSubtotal !== subtotalAmount) { customerData.reload(['cart'], false); } diff --git a/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js b/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js index 68f6b1b2753c0..f50332c9012aa 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/region-updater.js @@ -238,6 +238,7 @@ define([ // Add defaultvalue attribute to state/province select element regionList.attr('defaultvalue', this.options.defaultRegion); + this.options.form.find('[type="submit"]').removeAttr('disabled').show(); }, /** diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js b/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js index 127aa6ef01f55..0f21189cbec1e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js @@ -18,7 +18,8 @@ define([ 'Magento_Checkout/js/action/set-billing-address', 'Magento_Ui/js/model/messageList', 'mage/translate', - 'Magento_Checkout/js/model/billing-address-postcode-validator' + 'Magento_Checkout/js/model/billing-address-postcode-validator', + 'Magento_Checkout/js/model/address-converter' ], function ( ko, @@ -35,11 +36,14 @@ function ( setBillingAddressAction, globalMessageList, $t, - billingAddressPostcodeValidator + billingAddressPostcodeValidator, + addressConverter ) { 'use strict'; var lastSelectedBillingAddress = null, + addressUpadated = false, + addressEdited = false, countryData = customerData.get('directory-data'), addressOptions = addressList().filter(function (address) { return address.getType() === 'customer-address'; @@ -140,6 +144,8 @@ function ( updateAddress: function () { var addressData, newBillingAddress; + addressUpadated = true; + if (this.selectedAddress() && !this.isAddressFormVisible()) { selectBillingAddress(this.selectedAddress()); checkoutData.setSelectedBillingAddress(this.selectedAddress().getKey()); @@ -165,6 +171,7 @@ function ( checkoutData.setNewCustomerBillingAddress(addressData); } } + setBillingAddressAction(globalMessageList); this.updateAddresses(); }, @@ -172,6 +179,8 @@ function ( * Edit address action */ editAddress: function () { + addressUpadated = false; + addressEdited = true; lastSelectedBillingAddress = quote.billingAddress(); quote.billingAddress(null); this.isAddressDetailsVisible(false); @@ -181,6 +190,7 @@ function ( * Cancel address edit action */ cancelAddressEdit: function () { + addressUpadated = true; this.restoreBillingAddress(); if (quote.billingAddress()) { @@ -201,12 +211,26 @@ function ( return quote.billingAddress() || lastSelectedBillingAddress; }), + /** + * Check if Billing Address Changes should be canceled + */ + needCancelBillingAddressChanges: function () { + if (addressEdited && !addressUpadated) { + this.cancelAddressEdit(); + } + }, + /** * Restore billing address */ restoreBillingAddress: function () { + var lastBillingAddress; + if (lastSelectedBillingAddress != null) { selectBillingAddress(lastSelectedBillingAddress); + lastBillingAddress = addressConverter.quoteAddressToFormAddressData(lastSelectedBillingAddress); + + checkoutData.setNewCustomerBillingAddress(lastBillingAddress); } }, diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/checkout/setPaymentCaptcha.js b/app/code/Magento/Checkout/view/frontend/web/js/view/checkout/setPaymentCaptcha.js deleted file mode 100644 index 93f3bb8b2a45c..0000000000000 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/checkout/setPaymentCaptcha.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -define([ - 'Magento_Captcha/js/view/checkout/defaultCaptcha', - 'Magento_Captcha/js/model/captchaList', - 'underscore', - 'Magento_Checkout/js/model/payment/set-payment-hooks' -], -function (defaultCaptcha, captchaList, _, setPaymentHooks) { - 'use strict'; - - return defaultCaptcha.extend({ - /** @inheritdoc */ - initialize: function () { - var self = this, - currentCaptcha; - - this._super(); - currentCaptcha = captchaList.getCaptchaByFormId(this.formId); - - if (currentCaptcha != null) { - currentCaptcha.setIsVisible(true); - this.setCurrentCaptcha(currentCaptcha); - setPaymentHooks.requestModifiers.push(function (headers) { - if (self.isRequired()) { - headers['X-Captcha'] = self.captchaValue()(); - } - }); - setPaymentHooks.afterRequestListeners.push(function () { - self.refresh(); - }); - } - } - }); -}); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/form/element/email.js b/app/code/Magento/Checkout/view/frontend/web/js/view/form/element/email.js index 8311d97522980..f1ef00daaf527 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/form/element/email.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/form/element/email.js @@ -161,9 +161,13 @@ define([ return valid; } - validator = loginForm.validate(); + if (loginForm.is(':visible')) { + validator = loginForm.validate(); - return validator.check(usernameSelector); + return validator.check(usernameSelector); + } + + return true; }, /** diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/progress-bar.js b/app/code/Magento/Checkout/view/frontend/web/js/view/progress-bar.js index 30ea9da1dd601..6dd1f31562a65 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/progress-bar.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/progress-bar.js @@ -8,8 +8,9 @@ define([ 'underscore', 'ko', 'uiComponent', - 'Magento_Checkout/js/model/step-navigator' -], function ($, _, ko, Component, stepNavigator) { + 'Magento_Checkout/js/model/step-navigator', + 'Magento_Checkout/js/view/billing-address' +], function ($, _, ko, Component, stepNavigator, billingAddress) { 'use strict'; var steps = stepNavigator.steps; @@ -52,6 +53,9 @@ define([ * @param {Object} step */ navigateTo: function (step) { + if (step.code === 'shipping') { + billingAddress().needCancelBillingAddressChanges(); + } stepNavigator.navigateTo(step.code); }, diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/item/details.js b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/item/details.js index 2046413cbc686..22db7d52aed1e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/item/details.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/item/details.js @@ -4,19 +4,33 @@ */ define([ - 'uiComponent' -], function (Component) { + 'uiComponent', + 'escaper' +], function (Component, escaper) { 'use strict'; return Component.extend({ defaults: { - template: 'Magento_Checkout/summary/item/details' + template: 'Magento_Checkout/summary/item/details', + allowedTags: ['b', 'strong', 'i', 'em', 'u'] }, /** * @param {Object} quoteItem * @return {String} */ + getNameUnsanitizedHtml: function (quoteItem) { + var txt = document.createElement('textarea'); + + txt.innerHTML = quoteItem.name; + + return escaper.escapeHtml(txt.value, this.allowedTags); + }, + + /** + * @param {Object} quoteItem + * @return {String}Magento_Checkout/js/region-updater + */ getValue: function (quoteItem) { return quoteItem.name; } diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html index 2491ee12d263c..d92aa8553f47e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html @@ -12,7 +12,7 @@ <div class="product-item-inner"> <div class="product-item-name-block"> - <strong class="product-item-name" data-bind="html: $parent.name"></strong> + <strong class="product-item-name" data-bind="html: getNameUnsanitizedHtml($parent)"></strong> <div class="details-qty"> <span class="label"><!-- ko i18n: 'Qty' --><!-- /ko --></span> <span class="value" data-bind="text: $parent.qty"></span> @@ -32,10 +32,14 @@ <!--ko foreach: JSON.parse($parent.options)--> <dt class="label" data-bind="text: label"></dt> <!-- ko if: ($data.full_view)--> - <dd class="values" data-bind="html: full_view"></dd> + <!-- ko with: {full_viewUnsanitizedHtml: $data.full_view}--> + <dd class="values" data-bind="html: full_viewUnsanitizedHtml"></dd> + <!-- /ko --> <!-- /ko --> <!-- ko ifnot: ($data.full_view)--> - <dd class="values" data-bind="html: value"></dd> + <!-- ko with: {valueUnsanitizedHtml: $data.value}--> + <dd class="values" data-bind="html: valueUnsanitizedHtml"></dd> + <!-- /ko --> <!-- /ko --> <!-- /ko --> </dl> diff --git a/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php b/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php index 5338a16004a00..ceb0240af1dfd 100644 --- a/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php +++ b/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php @@ -86,30 +86,6 @@ public function beforeSavePaymentInformationAndPlaceOrder( } } - /** - * Check validation before saving the payment information - * - * @param \Magento\Checkout\Api\PaymentInformationManagementInterface $subject - * @param int $cartId - * @param \Magento\Quote\Api\Data\PaymentInterface $paymentMethod - * @param \Magento\Quote\Api\Data\AddressInterface|null $billingAddress - * @return void - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * @throws \Magento\Framework\Exception\NoSuchEntityException - * @throws \Magento\Framework\Exception\CouldNotSaveException - */ - public function beforeSavePaymentInformation( - \Magento\Checkout\Api\PaymentInformationManagementInterface $subject, - $cartId, - \Magento\Quote\Api\Data\PaymentInterface $paymentMethod, - \Magento\Quote\Api\Data\AddressInterface $billingAddress = null - ) { - $quote = $this->quoteRepository->getActive($cartId); - if ($this->isAgreementEnabled() && !$quote->getIsMultiShipping()) { - $this->validateAgreements($paymentMethod); - } - } - /** * Validate agreements base on the payment method * diff --git a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php index b7e5127df1f8b..6aa3d62230091 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php +++ b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php @@ -126,11 +126,9 @@ public function testBeforeSavePaymentInformationAndPlaceOrder() ->willReturn(true); $searchCriteriaMock = $this->createMock(SearchCriteria::class); $this->quoteMock - ->expects($this->once()) ->method('getIsMultiShipping') ->willReturn(false); $this->quoteRepositoryMock - ->expects($this->once()) ->method('getActive') ->with($cartId) ->willReturn($this->quoteMock); @@ -146,7 +144,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrder() $this->paymentMock->expects(static::atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); - $this->model->beforeSavePaymentInformation( + $this->model->beforeSavePaymentInformationAndPlaceOrder( $this->subjectMock, $cartId, $this->paymentMock, @@ -166,11 +164,9 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali ->willReturn(true); $searchCriteriaMock = $this->createMock(SearchCriteria::class); $this->quoteMock - ->expects($this->once()) ->method('getIsMultiShipping') ->willReturn(false); $this->quoteRepositoryMock - ->expects($this->once()) ->method('getActive') ->with($cartId) ->willReturn($this->quoteMock); @@ -186,7 +182,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali $this->paymentMock->expects(static::atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); - $this->model->beforeSavePaymentInformation( + $this->model->beforeSavePaymentInformationAndPlaceOrder( $this->subjectMock, $cartId, $this->paymentMock, @@ -198,40 +194,6 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali ); } - public function testBeforeSavePaymentInformation() - { - $cartId = 100; - $agreements = [1, 2, 3]; - $this->scopeConfigMock - ->expects($this->once()) - ->method('isSetFlag') - ->with(AgreementsProvider::PATH_ENABLED, ScopeInterface::SCOPE_STORE) - ->willReturn(true); - $this->quoteMock - ->expects($this->once()) - ->method('getIsMultiShipping') - ->willReturn(false); - $this->quoteRepositoryMock - ->expects($this->once()) - ->method('getActive') - ->with($cartId) - ->willReturn($this->quoteMock); - $searchCriteriaMock = $this->createMock(SearchCriteria::class); - $this->agreementsFilterMock->expects($this->once()) - ->method('buildSearchCriteria') - ->willReturn($searchCriteriaMock); - $this->checkoutAgreementsListMock->expects($this->once()) - ->method('getList') - ->with($searchCriteriaMock) - ->willReturn([1]); - $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements); - $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(true); - $this->paymentMock->expects(static::atLeastOnce()) - ->method('getExtensionAttributes') - ->willReturn($this->extensionAttributesMock); - $this->model->beforeSavePaymentInformation($this->subjectMock, $cartId, $this->paymentMock, $this->addressMock); - } - /** * Build payment extension mock. * diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Block/Save.php b/app/code/Magento/Cms/Controller/Adminhtml/Block/Save.php index 0c6c6470398c1..c18d2ef1fce78 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Block/Save.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Block/Save.php @@ -121,9 +121,9 @@ private function processBlockReturn($model, $data, $resultRedirect) if ($redirect ==='continue') { $resultRedirect->setPath('*/*/edit', ['block_id' => $model->getId()]); - } else if ($redirect === 'close') { + } elseif ($redirect === 'close') { $resultRedirect->setPath('*/*/'); - } else if ($redirect === 'duplicate') { + } elseif ($redirect === 'duplicate') { $duplicateModel = $this->blockFactory->create(['data' => $data]); $duplicateModel->setId(null); $duplicateModel->setIdentifier($data['identifier'] . '-' . uniqid()); diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Page/InlineEdit.php b/app/code/Magento/Cms/Controller/Adminhtml/Page/InlineEdit.php index 2237f35ed0b84..aeeae78e00e2d 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Page/InlineEdit.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Page/InlineEdit.php @@ -83,9 +83,9 @@ public function execute() /** @var \Magento\Cms\Model\Page $page */ $page = $this->pageRepository->getById($pageId); try { - $pageData = $this->filterPost($postItems[$pageId]); - $this->validatePost($pageData, $page, $error, $messages); $extendedPageData = $page->getData(); + $pageData = $this->filterPostWithDateConverting($postItems[$pageId], $extendedPageData); + $this->validatePost($pageData, $page, $error, $messages); $this->setCmsPageData($page, $extendedPageData, $pageData); $this->pageRepository->save($page); } catch (\Magento\Framework\Exception\LocalizedException $e) { @@ -127,6 +127,34 @@ protected function filterPost($postData = []) return $pageData; } + /** + * Filtering posted data with converting custom theme dates to proper format + * + * @param array $postData + * @param array $pageData + * @return array + */ + private function filterPostWithDateConverting($postData = [], $pageData = []) + { + $newPageData = $this->filterPost($postData); + if ( + !empty($newPageData['custom_theme_from']) + && date("Y-m-d", strtotime($postData['custom_theme_from'])) + === date("Y-m-d", strtotime($pageData['custom_theme_from'])) + ) { + $newPageData['custom_theme_from'] = date("Y-m-d", strtotime($postData['custom_theme_from'])); + } + if ( + !empty($newPageData['custom_theme_to']) + && date("Y-m-d", strtotime($postData['custom_theme_to'])) + === date("Y-m-d", strtotime($pageData['custom_theme_to'])) + ) { + $newPageData['custom_theme_to'] = date("Y-m-d", strtotime($postData['custom_theme_to'])); + } + + return $newPageData; + } + /** * Validate post data * diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Page/Save.php b/app/code/Magento/Cms/Controller/Adminhtml/Page/Save.php index 449fdb4224a57..34b1e949271d7 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Page/Save.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Page/Save.php @@ -3,13 +3,20 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Cms\Controller\Adminhtml\Page; -use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Backend\App\Action; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Cms\Api\Data\PageInterface; +use Magento\Cms\Api\PageRepositoryInterface; use Magento\Cms\Model\Page; +use Magento\Cms\Model\PageFactory; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\App\Request\DataPersistorInterface; +use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\LocalizedException; /** @@ -17,7 +24,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Save extends \Magento\Backend\App\Action implements HttpPostActionInterface +class Save extends Action implements HttpPostActionInterface { /** * Authorization level of a basic admin session @@ -37,12 +44,12 @@ class Save extends \Magento\Backend\App\Action implements HttpPostActionInterfac protected $dataPersistor; /** - * @var \Magento\Cms\Model\PageFactory + * @var PageFactory */ private $pageFactory; /** - * @var \Magento\Cms\Api\PageRepositoryInterface + * @var PageRepositoryInterface */ private $pageRepository; @@ -50,21 +57,20 @@ class Save extends \Magento\Backend\App\Action implements HttpPostActionInterfac * @param Action\Context $context * @param PostDataProcessor $dataProcessor * @param DataPersistorInterface $dataPersistor - * @param \Magento\Cms\Model\PageFactory|null $pageFactory - * @param \Magento\Cms\Api\PageRepositoryInterface|null $pageRepository + * @param PageFactory|null $pageFactory + * @param PageRepositoryInterface|null $pageRepository */ public function __construct( Action\Context $context, PostDataProcessor $dataProcessor, DataPersistorInterface $dataPersistor, - \Magento\Cms\Model\PageFactory $pageFactory = null, - \Magento\Cms\Api\PageRepositoryInterface $pageRepository = null + PageFactory $pageFactory = null, + PageRepositoryInterface $pageRepository = null ) { $this->dataProcessor = $dataProcessor; $this->dataPersistor = $dataPersistor; - $this->pageFactory = $pageFactory ?: ObjectManager::getInstance()->get(\Magento\Cms\Model\PageFactory::class); - $this->pageRepository = $pageRepository - ?: ObjectManager::getInstance()->get(\Magento\Cms\Api\PageRepositoryInterface::class); + $this->pageFactory = $pageFactory ?: ObjectManager::getInstance()->get(PageFactory::class); + $this->pageRepository = $pageRepository ?: ObjectManager::getInstance()->get(PageRepositoryInterface::class); parent::__construct($context); } @@ -72,12 +78,12 @@ public function __construct( * Save action * * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @return \Magento\Framework\Controller\ResultInterface + * @return ResultInterface */ public function execute() { $data = $this->getRequest()->getPostValue(); - /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ + /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); if ($data) { $data = $this->dataProcessor->filter($data); @@ -88,7 +94,7 @@ public function execute() $data['page_id'] = null; } - /** @var \Magento\Cms\Model\Page $model */ + /** @var Page $model */ $model = $this->pageFactory->create(); $id = $this->getRequest()->getParam('page_id'); @@ -117,7 +123,7 @@ public function execute() } catch (LocalizedException $e) { $this->messageManager->addExceptionMessage($e->getPrevious() ?: $e); } catch (\Throwable $e) { - $this->messageManager->addExceptionMessage($e, __('Something went wrong while saving the page.')); + $this->messageManager->addErrorMessage(__('Something went wrong while saving the page.')); } $this->dataPersistor->set('cms_page', $data); @@ -129,10 +135,10 @@ public function execute() /** * Process result redirect * - * @param \Magento\Cms\Api\Data\PageInterface $model - * @param \Magento\Backend\Model\View\Result\Redirect $resultRedirect + * @param PageInterface $model + * @param Redirect $resultRedirect * @param array $data - * @return \Magento\Backend\Model\View\Result\Redirect + * @return Redirect * @throws LocalizedException */ private function processResultRedirect($model, $resultRedirect, $data) @@ -149,7 +155,7 @@ private function processResultRedirect($model, $resultRedirect, $data) '*/*/edit', [ 'page_id' => $newPage->getId(), - '_current' => true + '_current' => true, ] ); } diff --git a/app/code/Magento/Cms/Helper/Wysiwyg/Images.php b/app/code/Magento/Cms/Helper/Wysiwyg/Images.php index e42bb0143f6bf..b45d4a04b62b3 100644 --- a/app/code/Magento/Cms/Helper/Wysiwyg/Images.php +++ b/app/code/Magento/Cms/Helper/Wysiwyg/Images.php @@ -6,9 +6,11 @@ namespace Magento\Cms\Helper\Wysiwyg; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\ValidatorException; /** * Wysiwyg Images Helper. + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Images extends \Magento\Framework\App\Helper\AbstractHelper { @@ -64,6 +66,11 @@ class Images extends \Magento\Framework\App\Helper\AbstractHelper */ protected $escaper; + /** + * @var \Magento\Framework\Filesystem\Directory\Read + */ + private $_readDirectory; + /** * Construct * @@ -87,6 +94,7 @@ public function __construct( $this->_directory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); $this->_directory->create($this->getStorageRoot()); + $this->_readDirectory = $filesystem->getDirectoryReadByPath($this->getStorageRoot()); } /** @@ -158,7 +166,7 @@ public function convertPathToId($path) * * @param string $id * @return string - * @throws \InvalidArgumentException When path contains restricted symbols. + * @throws \InvalidArgumentException */ public function convertIdToPath($id) { @@ -166,7 +174,10 @@ public function convertIdToPath($id) return $this->getStorageRoot(); } else { $path = $this->getStorageRoot() . $this->idDecode($id); - if (preg_match('/\.\.(\\\|\/)/', $path)) { + + try { + $this->_readDirectory->getAbsolutePath($path); + } catch (\Exception $e) { throw new \InvalidArgumentException('Path is invalid'); } diff --git a/app/code/Magento/Cms/Model/Block.php b/app/code/Magento/Cms/Model/Block.php index ab8d65399f37c..8b9cef07e3b57 100644 --- a/app/code/Magento/Cms/Model/Block.php +++ b/app/code/Magento/Cms/Model/Block.php @@ -15,6 +15,8 @@ use Magento\Framework\Registry; use Magento\Framework\Model\ResourceModel\AbstractResource; use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; +use Magento\Framework\Exception\LocalizedException; /** * CMS block model @@ -52,6 +54,11 @@ class Block extends AbstractModel implements BlockInterface, IdentityInterface */ private $wysiwygValidator; + /** + * @var CompositeUrlKey + */ + private $compositeUrlValidator; + /** * @param Context $context * @param Registry $registry @@ -59,6 +66,7 @@ class Block extends AbstractModel implements BlockInterface, IdentityInterface * @param AbstractDb|null $resourceCollection * @param array $data * @param WYSIWYGValidatorInterface|null $wysiwygValidator + * @param CompositeUrlKey|null $compositeUrlValidator */ public function __construct( Context $context, @@ -66,11 +74,14 @@ public function __construct( AbstractResource $resource = null, AbstractDb $resourceCollection = null, array $data = [], - ?WYSIWYGValidatorInterface $wysiwygValidator = null + ?WYSIWYGValidatorInterface $wysiwygValidator = null, + CompositeUrlKey $compositeUrlValidator = null ) { parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->wysiwygValidator = $wysiwygValidator ?? ObjectManager::getInstance()->get(WYSIWYGValidatorInterface::class); + $this->compositeUrlValidator = $compositeUrlValidator + ?? ObjectManager::getInstance()->get(CompositeUrlKey::class); } /** @@ -101,6 +112,12 @@ public function beforeSave() __('Make sure that static block content does not reference the block itself.') ); } + + $errors = $this->compositeUrlValidator->validate($this->getIdentifier()); + if (!empty($errors)) { + throw new LocalizedException($errors[0]); + } + parent::beforeSave(); //Validating HTML content. diff --git a/app/code/Magento/Cms/Model/Page.php b/app/code/Magento/Cms/Model/Page.php index 7e3e3ff44cfa0..8469d60f56fe9 100644 --- a/app/code/Magento/Cms/Model/Page.php +++ b/app/code/Magento/Cms/Model/Page.php @@ -15,6 +15,7 @@ use Magento\Framework\Model\AbstractModel; use Magento\Framework\Validation\ValidationException; use Magento\Framework\Validator\HTML\WYSIWYGValidatorInterface; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; /** * Cms Page Model @@ -72,6 +73,11 @@ class Page extends AbstractModel implements PageInterface, IdentityInterface */ private $wysiwygValidator; + /** + * @var CompositeUrlKey + */ + private $compositeUrlValidator; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -80,6 +86,7 @@ class Page extends AbstractModel implements PageInterface, IdentityInterface * @param array $data * @param CustomLayoutRepository|null $customLayoutRepository * @param WYSIWYGValidatorInterface|null $wysiwygValidator + * @param CompositeUrlKey|null $compositeUrlValidator */ public function __construct( \Magento\Framework\Model\Context $context, @@ -88,13 +95,16 @@ public function __construct( \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [], ?CustomLayoutRepository $customLayoutRepository = null, - ?WYSIWYGValidatorInterface $wysiwygValidator = null + ?WYSIWYGValidatorInterface $wysiwygValidator = null, + CompositeUrlKey $compositeUrlValidator = null ) { parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->customLayoutRepository = $customLayoutRepository ?? ObjectManager::getInstance()->get(CustomLayoutRepository::class); $this->wysiwygValidator = $wysiwygValidator ?? ObjectManager::getInstance()->get(WYSIWYGValidatorInterface::class); + $this->compositeUrlValidator = $compositeUrlValidator + ?? ObjectManager::getInstance()->get(CompositeUrlKey::class); } /** @@ -601,6 +611,10 @@ private function validateNewIdentifier(): void ); } } + $errors = $this->compositeUrlValidator->validate($currentIdentifier); + if (!empty($errors)) { + throw new LocalizedException($errors[0]); + } } /** diff --git a/app/code/Magento/Cms/Model/Page/DataProvider.php b/app/code/Magento/Cms/Model/Page/DataProvider.php index 41010575a1f27..6afde01cfe6c6 100644 --- a/app/code/Magento/Cms/Model/Page/DataProvider.php +++ b/app/code/Magento/Cms/Model/Page/DataProvider.php @@ -5,24 +5,24 @@ */ namespace Magento\Cms\Model\Page; -use Magento\Cms\Model\Page; +use Magento\Cms\Api\Data\PageInterface; +use Magento\Cms\Api\PageRepositoryInterface; +use Magento\Cms\Model\PageFactory; use Magento\Cms\Model\ResourceModel\Page\CollectionFactory; use Magento\Framework\App\ObjectManager; use Magento\Framework\App\Request\DataPersistorInterface; use Magento\Framework\App\RequestInterface; -use Magento\Ui\DataProvider\Modifier\PoolInterface; use Magento\Framework\AuthorizationInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Ui\DataProvider\Modifier\PoolInterface; +use Magento\Ui\DataProvider\ModifierPoolDataProvider; +use Psr\Log\LoggerInterface; /** - * Class DataProvider + * Cms Page DataProvider */ -class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider +class DataProvider extends ModifierPoolDataProvider { - /** - * @var \Magento\Cms\Model\ResourceModel\Page\Collection - */ - protected $collection; - /** * @var DataPersistorInterface */ @@ -33,6 +33,11 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider */ protected $loadedData; + /** + * @var PageRepositoryInterface + */ + private $pageRepository; + /** * @var AuthorizationInterface */ @@ -49,9 +54,14 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider private $customLayoutManager; /** - * @var CollectionFactory + * @var PageFactory + */ + private $pageFactory; + + /** + * @var LoggerInterface */ - private $collectionFactory; + private $logger; /** * @param string $name @@ -65,6 +75,9 @@ class DataProvider extends \Magento\Ui\DataProvider\ModifierPoolDataProvider * @param AuthorizationInterface|null $auth * @param RequestInterface|null $request * @param CustomLayoutManagerInterface|null $customLayoutManager + * @param PageRepositoryInterface|null $pageRepository + * @param PageFactory|null $pageFactory + * @param LoggerInterface|null $logger * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -78,33 +91,22 @@ public function __construct( PoolInterface $pool = null, ?AuthorizationInterface $auth = null, ?RequestInterface $request = null, - ?CustomLayoutManagerInterface $customLayoutManager = null + ?CustomLayoutManagerInterface $customLayoutManager = null, + ?PageRepositoryInterface $pageRepository = null, + ?PageFactory $pageFactory = null, + ?LoggerInterface $logger = null ) { + parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data, $pool); $this->collection = $pageCollectionFactory->create(); - $this->collectionFactory = $pageCollectionFactory; $this->dataPersistor = $dataPersistor; - parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data, $pool); $this->auth = $auth ?? ObjectManager::getInstance()->get(AuthorizationInterface::class); $this->meta = $this->prepareMeta($this->meta); $this->request = $request ?? ObjectManager::getInstance()->get(RequestInterface::class); $this->customLayoutManager = $customLayoutManager ?? ObjectManager::getInstance()->get(CustomLayoutManagerInterface::class); - } - - /** - * Find requested page. - * - * @return Page|null - */ - private function findCurrentPage(): ?Page - { - if ($this->getRequestFieldName() && ($pageId = (int)$this->request->getParam($this->getRequestFieldName()))) { - //Loading data for the collection. - $this->getData(); - return $this->collection->getItemById($pageId); - } - - return null; + $this->pageRepository = $pageRepository ?? ObjectManager::getInstance()->get(PageRepositoryInterface::class); + $this->pageFactory = $pageFactory ?: ObjectManager::getInstance()->get(PageFactory::class); + $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class); } /** @@ -128,29 +130,53 @@ public function getData() if (isset($this->loadedData)) { return $this->loadedData; } - $this->collection = $this->collectionFactory->create(); - $items = $this->collection->getItems(); - /** @var $page \Magento\Cms\Model\Page */ - foreach ($items as $page) { - $this->loadedData[$page->getId()] = $page->getData(); - if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) { - //Deprecated layout update exists. - $this->loadedData[$page->getId()]['layout_update_selected'] = '_existing_'; + + $page = $this->getCurrentPage(); + $this->loadedData[$page->getId()] = $page->getData(); + if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) { + //Deprecated layout update exists. + $this->loadedData[$page->getId()]['layout_update_selected'] = '_existing_'; + } + + return $this->loadedData; + } + + /** + * Return current page + * + * @return PageInterface + */ + private function getCurrentPage(): PageInterface + { + $pageId = $this->getPageId(); + if ($pageId) { + try { + $page = $this->pageRepository->getById($pageId); + } catch (LocalizedException $exception) { + $page = $this->pageFactory->create(); } + + return $page; } $data = $this->dataPersistor->get('cms_page'); - if (!empty($data)) { - $page = $this->collection->getNewEmptyItem(); - $page->setData($data); - $this->loadedData[$page->getId()] = $page->getData(); - if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) { - $this->loadedData[$page->getId()]['layout_update_selected'] = '_existing_'; - } - $this->dataPersistor->clear('cms_page'); + if (empty($data)) { + return $this->pageFactory->create(); } + $this->dataPersistor->clear('cms_page'); - return $this->loadedData; + return $this->pageFactory->create() + ->setData($data); + } + + /** + * Returns current page id from request + * + * @return int + */ + private function getPageId(): int + { + return (int) $this->request->getParam($this->getRequestFieldName()); } /** @@ -186,16 +212,20 @@ public function getMeta() //List of custom layout files available for current page. $options = [['label' => 'No update', 'value' => '_no_update_']]; - if ($page = $this->findCurrentPage()) { - //We must have a specific page selected. - //If custom layout XML is set then displaying this special option. + + $page = null; + try { + $page = $this->pageRepository->getById($this->getPageId()); if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) { $options[] = ['label' => 'Use existing layout update XML', 'value' => '_existing_']; } foreach ($this->customLayoutManager->fetchAvailableFiles($page) as $layoutFile) { $options[] = ['label' => $layoutFile, 'value' => $layoutFile]; } + } catch (LocalizedException $e) { + $this->logger->error($e->getMessage()); } + $customLayoutMeta = [ 'design' => [ 'children' => [ diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php index 617c8663d6f80..ad6a79e5bbd63 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php @@ -7,6 +7,7 @@ namespace Magento\Cms\Model\Wysiwyg\Images\Storage; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\FileSystemException; /** * Wysiwyg Images storage collection @@ -43,11 +44,16 @@ protected function _generateRow($filename) { $filename = preg_replace('~[/\\\]+(?<![htps?]://)~', '/', $filename); $path = $this->_filesystem->getDirectoryWrite(DirectoryList::MEDIA); + try { + $mtime = $path->stat($path->getRelativePath($filename))['mtime']; + } catch (FileSystemException $e) { + $mtime = 0; + } return [ 'filename' => rtrim($filename, '/'), // phpcs:ignore Magento2.Functions.DiscouragedFunction 'basename' => basename($filename), - 'mtime' => $path->stat($path->getRelativePath($filename))['mtime'] + 'mtime' => $mtime ]; } } diff --git a/app/code/Magento/Cms/Observer/PageValidatorObserver.php b/app/code/Magento/Cms/Observer/PageValidatorObserver.php index b4e5d2bc0e0a7..9b54712fb7d69 100644 --- a/app/code/Magento/Cms/Observer/PageValidatorObserver.php +++ b/app/code/Magento/Cms/Observer/PageValidatorObserver.php @@ -3,7 +3,6 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - declare(strict_types=1); namespace Magento\Cms\Observer; diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCloseContentMenuTabActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCloseContentMenuTabActionGroup.xml new file mode 100644 index 0000000000000..a1bf826e14916 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminCloseContentMenuTabActionGroup.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCloseContentMenuTabActionGroup"> + <annotations> + <description>Close tab 'Content' on main menu.</description> + </annotations> + <conditionalClick selector="{{AdminMenuSection.menuItem('magento-backend-content')}}" dependentSelector="{{AdminMenuSection.contentMenuClose}}" visible="true" stepKey="closeContentTab"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenContentMenuTabActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenContentMenuTabActionGroup.xml new file mode 100644 index 0000000000000..78451fbbbe61c --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminOpenContentMenuTabActionGroup.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminOpenContentMenuTabActionGroup"> + <annotations> + <description>Open tab 'Content' on main menu.</description> + </annotations> + <conditionalClick selector="{{AdminMenuSection.menuItem('magento-backend-content')}}" dependentSelector="{{AdminMenuSection.contentMenuClose}}" visible="false" stepKey="openContentTab"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetProductLayoutSettingsActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetProductLayoutSettingsActionGroup.xml new file mode 100644 index 0000000000000..4f8934d243b36 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetProductLayoutSettingsActionGroup.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminSetProductLayoutSettingsActionGroup"> + <annotations> + <description>Sets the 'Default Product Layout' to requested value.</description> + </annotations> + <arguments> + <argument name="layout" type="string"/> + </arguments> + + <waitForElementVisible selector="{{DefaultLayoutsSection.productLayout}}" stepKey="waittForDefaultProductLayout"/> + <selectOption selector="{{DefaultLayoutsSection.productLayout}}" userInput="{{layout}}" stepKey="selectLayout"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> + <waitForPageLoad stepKey="waitForSavingSystemConfiguration"/> + <see userInput="You saved the configuration." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml index 44e29f7e2fe55..e0729a55afa23 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml @@ -18,6 +18,7 @@ <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> <waitForPageLoad stepKey="waitForPageLoadAfterClickingSave"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppear"/> + <dontSee selector="{{BlockPageActionsSection.saveBlockWarningMessage}}" stepKey="dontSeeWarningMessage"/> <see userInput="You saved the block." selector="{{AdminMessagesSection.success}}" stepKey="assertSaveBlockSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml index 2f86df70ae8c8..5c58fc8538d0f 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml @@ -16,6 +16,7 @@ <waitForElementVisible selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="waitForSaveButton"/> <click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="clickSaveButton"/> <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSee selector="{{BlockPageActionsSection.saveBlockWarningMessage}}" stepKey="dontSeeWarningMessage"/> <see userInput="You saved the block." stepKey="seeSuccessfulSaveMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml index 5b3b0460edbdb..188a55d96e7e9 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml @@ -18,6 +18,7 @@ <waitForElementVisible selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="waitForSaveCmsPage"/> <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSaveCmsPage"/> <waitForElementVisible time="1" selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="waitForCmsPageSaveButton"/> + <dontSee selector="{{CmsPagesPageActionsSection.savePageWarningMessage}}" stepKey="dontSeeWarningMessage"/> <see userInput="You saved the page." selector="{{CmsPagesPageActionsSection.savePageSuccessMessage}}" stepKey="assertSavePageSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/Data/CmsPageData.xml b/app/code/Magento/Cms/Test/Mftf/Data/CmsPageData.xml index 5dc100573c373..5075a9cfa02be 100644 --- a/app/code/Magento/Cms/Test/Mftf/Data/CmsPageData.xml +++ b/app/code/Magento/Cms/Test/Mftf/Data/CmsPageData.xml @@ -88,6 +88,19 @@ <data key="height">1000</data> <data key="path">wysiwyg</data> </entity> + <entity name="ImageUploadMedium" type="uploadImage"> + <data key="title" unique="suffix">Medium Image</data> + <data key="price">1.00</data> + <data key="file_type">Upload File</data> + <data key="shareable">Yes</data> + <data key="value">medium.jpg</data> + <data key="file">medium.jpg</data> + <data key="fileName">medium</data> + <data key="extension">jpg</data> + <data key="content">Image content. Yeah.</data> + <data key="height">508</data> + <data key="path">wysiwyg</data> + </entity> <entity name="ImageFolder" type="uploadImage"> <data key="name" unique="suffix">Test</data> </entity> diff --git a/app/code/Magento/Cms/Test/Mftf/Page/CmsPagesPage.xml b/app/code/Magento/Cms/Test/Mftf/Page/CmsPagesPage.xml index 45ba6eb6cf00c..deeec372a4106 100644 --- a/app/code/Magento/Cms/Test/Mftf/Page/CmsPagesPage.xml +++ b/app/code/Magento/Cms/Test/Mftf/Page/CmsPagesPage.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="CmsPagesPage" url="/cms/page" area="admin" module="Magento_Cms"> <section name="CmsPagesPageActionsSection"/> + <section name="AdminCmsPageGridInlineEditSection"/> </page> </pages> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/AdminCmsPageGridInlineEditSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/AdminCmsPageGridInlineEditSection.xml new file mode 100644 index 0000000000000..713f15789ffcd --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Section/AdminCmsPageGridInlineEditSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminCmsPageGridInlineEditSection"> + <element name="customDesignFrom" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='custom_theme_from']"/> + <element name="customDesignTo" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='custom_theme_to']"/> + <element name="customLayout" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='page_layout']"/> + <element name="savePageButton" type="button" selector="tr.data-grid-editable-row-actions button.action-primary" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/BlockPageActionsSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/BlockPageActionsSection.xml index 38281d4d6d1d6..4cd61cc96ea39 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/BlockPageActionsSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/BlockPageActionsSection.xml @@ -19,6 +19,7 @@ <element name="FilterBtn" type="input" selector="//button[text()='Filters']"/> <element name="URLKey" type="input" selector="//div[@class='admin__form-field-control']/input[@name='identifier']"/> <element name="ApplyFiltersBtn" type="button" selector="//span[text()='Apply Filters']"/> + <element name="saveBlockWarningMessage" type="text" selector=".message-warning"/> <element name="blockGridRowByTitle" type="input" selector="//tbody//tr//td//div[contains(., '{{var1}}')]" parameterized="true" timeout="30"/> <element name="delete" type="button" selector="//a[@data-action='item-delete']"/> <element name="deleteConfirm" type="button" selector="//button[@data-role='action']//span[text()='OK']" timeout="60"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageContentSection/CmsDesignSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageContentSection/CmsDesignSection.xml index cf0f6797ce423..251e7101517a1 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageContentSection/CmsDesignSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageContentSection/CmsDesignSection.xml @@ -9,6 +9,10 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="CmsDesignSection"> <element name="DesignTab" type="button" selector="//strong[@class='admin__collapsible-title']//span[text()='Design']"/> + <element name="customDesignUpdateTab" type="button" selector="//strong[@class='admin__collapsible-title']//span[text()='Custom Design Update']"/> + <element name="customDesignFrom" type="input" selector="input[name='custom_theme_from']"/> + <element name="customDesignTo" type="input" selector="input[name='custom_theme_to']"/> + <element name="customTheme" type="select" selector="//div[@data-index='custom_design_update']//select[@name='custom_theme']"/> <element name="LayoutDropdown" type="select" selector="select[name='page_layout']"/> </section> </sections> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml index a287685dbdefb..f3389072f1776 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml @@ -22,10 +22,11 @@ <element name="clearFilters" type="button" selector=".admin__data-grid-header button[data-action='grid-filter-reset']" timeout="30"/> <element name="activeFilters" type="button" selector="//div[@class='admin__data-grid-header']//span[contains(text(), 'Active filters:')]" /> <element name="spinner" type="input" selector='//div[@data-component="cms_page_listing.cms_page_listing.cms_page_columns"]'/> - <element name="firstItemSelectButton" type="button" selector=".data-grid .action-select-wrap button.action-select"/> - <element name="firstItemEditButton" type="button" selector=".data-grid .action-select-wrap .action-menu-item[data-action~='item-edit']"/> + <element name="firstItemSelectButton" type="button" selector=".data-grid .action-select-wrap button.action-select" timeout="30"/> + <element name="firstItemEditButton" type="button" selector=".data-grid .action-select-wrap .action-menu-item[data-action~='item-edit']" timeout="30"/> <element name="activeFilter" type="button" selector="(//div[contains(@class, 'admin__data-grid-filters-current') and contains(@class, '_show')])[1]"/> <element name="savePageSuccessMessage" type="text" selector=".message-success"/> + <element name="savePageWarningMessage" type="text" selector=".message-warning"/> <element name="delete" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//a[text()='Delete']" parameterized="true"/> <element name="deleteConfirm" type="button" selector=".action-primary.action-accept" timeout="60"/> <element name="pageRowCheckboxByIdentifier" type="checkbox" selector="//table[@data-role='grid']//td[count(../../..//th[./*[.='URL Key']]/preceding-sibling::th) + 1][./*[.='{{identifier}}']]/../td//input[@data-action='select-row']" parameterized="true" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml index 4ce8842c1ad87..bb276b2adb0de 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml @@ -11,6 +11,7 @@ <section name="StorefrontCMSPageSection"> <element name="mediaDescription" type="text" selector=".column.main>p>img"/> <element name="imageSource" type="text" selector="//img[contains(@src,'{{imageName}}')]" parameterized="true"/> + <element name="imageBySource" type="text" selector="img[src*='{{imageName}}']" parameterized="true"/> <element name="mainTitle" type="text" selector="#maincontent .page-title"/> <element name="mainContent" type="text" selector="#maincontent"/> <element name="footerTop" type="text" selector="footer.page-footer"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml index e2111aac348cb..aeb950487f29f 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml @@ -63,8 +63,8 @@ <actionGroup ref="DeleteFolderActionGroup" stepKey="DeleteCreatedFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad"/> <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml index 39f44a3270944..d75341f65d6d3 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml @@ -60,10 +60,10 @@ <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="$$createCMSPage.identifier$$" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait4"/> <seeElement selector="{{StorefrontCMSPageSection.mediaDescription}}" stepKey="assertMediaDescription"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddLargeImageToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddLargeImageToWYSIWYGCMSTest.xml new file mode 100644 index 0000000000000..81e45ead9ff55 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddLargeImageToWYSIWYGCMSTest.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAddLargeImageToWYSIWYGCMSTest"> + <annotations> + <features value="Cms"/> + <stories value="Default WYSIWYG toolbar configuration with Magento Media Gallery"/> + <group value="Cms"/> + <title value="Resize image for CMS according to Upload Configuration"/> + <description value="The large image should be resized according to Upload Configuration"/> + <severity value="BLOCKER"/> + <testCaseId value="MC-41826"/> + </annotations> + <before> + <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> + <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage" /> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> + <argument name="CMSPage" value="$$createCMSPage$$"/> + </actionGroup> + <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE4" /> + <click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> + <waitForPageLoad stepKey="waitForPageLoad" /> + <actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage"> + <argument name="Image" value="ImageUploadMedium"/> + </actionGroup> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> + <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> + <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> + <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="$$createCMSPage.identifier$$" stepKey="fillFieldUrlKey"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/> + <waitForPageLoad stepKey="waitPageLoadOnFrontend"/> + <seeElementInDOM selector="{{StorefrontCMSPageSection.imageSource(ImageUploadMedium.fileName)}}" stepKey="assertMediaSource"/> + <executeJS function='return document.querySelector("{{StorefrontCMSPageSection.imageBySource(ImageUploadMedium.fileName)}}").naturalWidth;' stepKey="imageNaturalWith"/> + <assertLessThanOrEqual stepKey="assertMaxImageWith"> + <expectedResult type="int">{{SystemUploadConfigurationMaxWidth.value}}</expectedResult> + <actualResult type="variable">imageNaturalWith</actualResult> + </assertLessThanOrEqual> + <executeJS function='return document.querySelector("{{StorefrontCMSPageSection.imageBySource(ImageUploadMedium.fileName)}}").naturalHeight;' stepKey="imageNaturalHeight"/> + <assertLessThanOrEqual stepKey="assertMaxImageHeight"> + <expectedResult type="int">{{SystemUploadConfigurationMaxHeight.value}}</expectedResult> + <actualResult type="variable">imageNaturalHeight</actualResult> + </assertLessThanOrEqual> + </test> +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml index 71b2e7f772131..bc89ccbfbaecc 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml @@ -82,8 +82,8 @@ <seeElement selector="{{TinyMCESection.InsertVariableBtn}}" stepKey="InsertVariableBtn" /> <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad7"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad7"/> <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter1" visible="true"/> <waitForPageLoad stepKey="waitForFilterReload"/> <click selector="{{CmsPagesPageActionsSection.filterButton}}" stepKey="clickFiltersBtn" /> @@ -113,12 +113,12 @@ <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetBtn"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad10"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <waitForPageLoad stepKey="waitForPageLoadAfterSaveCmsPage" /> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSaveButtonVisible"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoadAfterSaveCmsPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <conditionalClick selector="{{BlockPageActionsSection.clearAll}}" dependentSelector="{{BlockPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage1"/> @@ -136,8 +136,8 @@ <!--see custom variable blank--> <dontSee userInput="{{customVariable.html}}" stepKey="dontSeeCustomVariableName" /> <after> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad2"/> <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml index 7f3d2537a9b0d..c09cf19555561 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml @@ -75,10 +75,10 @@ <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <!--see Default Variable on Storefront--> <see userInput="{{_defaultVariable.city}}" stepKey="seeDefaultVariable" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml index aca38e97dbe1a..49056cf9fb6a9 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml @@ -65,17 +65,17 @@ <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetBtn"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading2"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad6"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <actionGroup ref="ClearCacheActionGroup" stepKey="clearCache" /> <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage1"/> <waitForPageLoad stepKey="waitForPageLoad7" /> <see userInput="Home page" stepKey="seeHomePageCMSPage"/> <after> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad2"/> <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml index bcb1cf2e2c3e5..0a49ce48c1736 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml @@ -55,10 +55,10 @@ <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <wait stepKey="waitForPageLoad5" time="10" /> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait5" /> <see userInput="Hello CMS Page!" stepKey="seeContent"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml index bb915ea73256d..1018d9eb69727 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml @@ -56,10 +56,10 @@ <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait5" /> <!--see widget on Storefront--> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml index e58b66f1bbb8d..6a35169c3706f 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml @@ -54,10 +54,10 @@ <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait5" /> <see userInput="Hello CMS Page!" stepKey="seeContent"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml index 6825d4b21a089..97d3617d79246 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml @@ -61,10 +61,10 @@ <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait7" /> <!--see widget on Storefront--> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml index 721b8cda325e3..d7859758d6f8a 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml @@ -84,10 +84,10 @@ <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait5" /> <!--see widget on Storefront--> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml index 2315262f69c3b..2f51c35dbc547 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml @@ -56,14 +56,14 @@ <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="amOnProductPage" /> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="amOnProductPage" /> <waitForPageLoad stepKey="waitForPage" /> <click selector="{{WidgetSection.CompareBtn}}" stepKey="clickCompareBtn" /> - <amOnPage url="$$createPreReqCategory.name$$.html" stepKey="amOnCatalogPage" /> + <amOnPage url="$$createPreReqCategory.custom_attributes[url_key]$$.html" stepKey="amOnCatalogPage" /> <waitForPageLoad stepKey="waitForPage1" /> <waitForPageLoad stepKey="waitForPage2" /> <waitForElementVisible selector="{{WidgetSection.ClearCompare}}" stepKey="waitForClearBtn" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml index 27a8b596513a7..05e7e3b6ddc30 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml @@ -55,11 +55,11 @@ <scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="amOnProductPage" /> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSplitButtonMenuVisible"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="amOnProductPage" /> <waitForPageLoad stepKey="waitForPage" /> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="wait5" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageInlineEditTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageInlineEditTest.xml new file mode 100644 index 0000000000000..c03d46440bd3a --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageInlineEditTest.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCMSPageInlineEditTest"> + <annotations> + <features value="Cms"/> + <stories value="Inline Edit Cms Page"/> + <title value="Inline changing CMS page custom theme will be applied with proper dates"/> + <description value="Verify that Merchant can inline edit CMS pages in grid and dates will be proper"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40900" /> + <useCaseId value="MC-39953"/> + <group value="cms"/> + <group value="ui"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="navigateToCmsPageGridAgain"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetGridFilters"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <generateDate date="now" format="m/d/Y" stepKey="today"/> + <generateDate date="+1 day" format="m/d/Y" stepKey="tomorrow"/> + <generateDate date="now" format="M j, Y" stepKey="todayFormatted"/> + <generateDate date="+1 day" format="M j, Y" stepKey="tomorrowFormatted"/> + <generateDate date="+100 day" format="m/d/Y" stepKey="newDateFrom"/> + <generateDate date="+101 day" format="m/d/Y" stepKey="newDateTo"/> + <generateDate date="+100 day" format="M j, Y" stepKey="newDateFromFormatted"/> + <generateDate date="+101 day" format="M j, Y" stepKey="newDateToFormatted"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="navigateToCmsPageGrid"/> + <actionGroup ref="AdminGridColumnShowActionGroup" stepKey="showCustomerEmailColumn"> + <argument name="columnLabel" value="Custom design from"/> + </actionGroup> + <actionGroup ref="AdminGridColumnShowActionGroup" stepKey="showCustomerEmailColumnTwo"> + <argument name="columnLabel" value="Custom design to"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clickClearFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="404 Not Found" stepKey="fillKeywordSearchFieldWithSecondCustomerEmail"/> + <click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/> + <see userInput="404 Not Found" selector="{{AdminGridRow.rowOne}}" stepKey="seeFirstCmsPageAfterFiltering"/> + <click selector="{{CmsPagesPageActionsSection.firstItemSelectButton}}" stepKey="clickOnSelectButton"/> + <click selector="{{CmsPagesPageActionsSection.firstItemEditButton}}" stepKey="clickOnEditButton"/> + <click selector="{{CmsDesignSection.customDesignUpdateTab}}" stepKey="clickOnDesignTab"/> + <waitForElementVisible selector="{{CmsDesignSection.customDesignFrom}}" stepKey="waitForLayoutDropDown" /> + <fillField selector="{{CmsDesignSection.customDesignFrom}}" userInput="{$today}" stepKey="fillDateFrom"/> + <fillField selector="{{CmsDesignSection.customDesignTo}}" userInput="{$tomorrow}" stepKey="fillDateTo"/> + <selectOption selector="{{CmsDesignSection.customTheme}}" userInput="{{MagentoBlankTheme.name}}" stepKey="fillCustomTheme"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="saveCmsPage"/> + <see userInput="{$todayFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom"/> + <see userInput="{$tomorrowFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo"/> + <click selector="{{AdminDataGridTableSection.rows}}" stepKey="clickEdit"/> + <waitForElementVisible selector="{{AdminCmsPageGridInlineEditSection.customLayout}}" stepKey="waitForDate"/> + <selectOption userInput="2 columns with right bar" selector="{{AdminCmsPageGridInlineEditSection.customLayout}}" stepKey="changeLayoutFromGrid"/> + <click selector="{{AdminCmsPageGridInlineEditSection.savePageButton}}" stepKey="clickSaveFromGrid"/> + <see userInput="{$todayFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom2"/> + <see userInput="{$tomorrowFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo2"/> + <click selector="{{AdminDataGridTableSection.rows}}" stepKey="clickEdit2"/> + <waitForElementVisible selector="{{AdminCmsPageGridInlineEditSection.customLayout}}" stepKey="waitForDate2"/> + <selectOption userInput="2 columns with left bar" selector="{{AdminCmsPageGridInlineEditSection.customLayout}}" stepKey="changeLayoutFromGrid2"/> + <click selector="{{AdminCmsPageGridInlineEditSection.savePageButton}}" stepKey="clickSaveFromGrid2"/> + <see userInput="{$todayFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom3"/> + <see userInput="{$tomorrowFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo3"/> + <click selector="{{AdminDataGridTableSection.rows}}" stepKey="clickEdit3"/> + <waitForElementVisible selector="{{AdminCmsPageGridInlineEditSection.customDesignFrom}}" stepKey="waitForDate3"/> + <fillField selector="{{AdminCmsPageGridInlineEditSection.customDesignFrom}}" userInput="{$newDateFrom}" stepKey="fillDateFromInGrid"/> + <fillField selector="{{AdminCmsPageGridInlineEditSection.customDesignTo}}" userInput="{$newDateTo}" stepKey="fillDateToInGrid"/> + <click selector="{{AdminCmsPageGridInlineEditSection.savePageButton}}" stepKey="clickSaveFromGrid3"/> + <see userInput="{$newDateFromFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom4"/> + <see userInput="{$newDateToFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo4"/> + </test> +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsBlockGridUrlFilterApplierTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsBlockGridUrlFilterApplierTest.xml index e2cf9c20627f8..0d483e21499fb 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsBlockGridUrlFilterApplierTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsBlockGridUrlFilterApplierTest.xml @@ -20,6 +20,8 @@ </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminOpenCmsBlocksGridActionGroup" stepKey="goToCMSBlockPage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <createData entity="Sales25offBlock" stepKey="createBlock"/> </before> <after> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml index c3a38470a5c8f..641508df9a5b2 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml @@ -40,8 +40,8 @@ <see selector="{{TinyMCESection.InsertVariableBtn}}" userInput="Insert Variable..." stepKey="assertInfo19"/> <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad2"/> <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForGridReload"/> <click selector="{{CmsPagesPageActionsSection.filterButton}}" stepKey="clickFiltersBtn" /> @@ -76,17 +76,17 @@ <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad5"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSaveButtonVisible"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="$$createPreReqCMSPage.identifier$$" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="waitForPageLoad6" /> <!--see content of Block on Storefront--> <see userInput="Hello Block Page!" stepKey="seeContent"/> <after> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnEditPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad"/> <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createPreReqCMSPage" stepKey="deletePreReqCMSPage" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml index 711e126afc553..e27c9a8dd6b16 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml @@ -23,8 +23,8 @@ <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" /> </before> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnPagePagesGrid"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad1"/> <actionGroup ref="AdminClickAddNewPageOnPagesGridActionGroup" stepKey="clickAddNewPage"/> <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle"/> <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/> @@ -40,11 +40,11 @@ <see selector="{{TinyMCESection.InsertVariableBtn}}" userInput="Insert Variable..." stepKey="assertInfo19"/> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> - <see userInput="You saved the page." stepKey="seeSuccessMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSaveButtonVisible"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandButtonMenu"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoading"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSuccessMessage"/> <amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <see userInput="{{_defaultCmsPage.content_heading}}" stepKey="seeContentHeading"/> diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/SaveTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/SaveTest.php index 67a7f0a934480..1cd85364b2cdd 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/SaveTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/SaveTest.php @@ -1,4 +1,5 @@ <?php + /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. @@ -7,6 +8,7 @@ namespace Magento\Cms\Test\Unit\Controller\Adminhtml\Page; +use Magento\Backend\App\Action\Context; use Magento\Backend\Model\View\Result\Redirect; use Magento\Backend\Model\View\Result\RedirectFactory; use Magento\Cms\Api\PageRepositoryInterface; @@ -18,7 +20,6 @@ use Magento\Framework\App\RequestInterface; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Message\ManagerInterface; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -82,13 +83,14 @@ class SaveTest extends TestCase */ private $pageId = 1; + /** + * @inheirtDoc + */ protected function setUp(): void { - $objectManager = new ObjectManager($this); - $this->resultRedirectFactory = $this->getMockBuilder(RedirectFactory::class) ->disableOriginalConstructor() - ->setMethods(['create']) + ->onlyMethods(['create']) ->getMock(); $this->resultRedirect = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() @@ -98,7 +100,7 @@ protected function setUp(): void ->willReturn($this->resultRedirect); $this->dataProcessorMock = $this->getMockBuilder( PostDataProcessor::class - )->setMethods(['filter'])->disableOriginalConstructor() + )->onlyMethods(['filter'])->disableOriginalConstructor() ->getMock(); $this->dataPersistorMock = $this->getMockBuilder(DataPersistorInterface::class) ->getMock(); @@ -108,27 +110,28 @@ protected function setUp(): void $this->messageManagerMock = $this->getMockBuilder(ManagerInterface::class) ->getMockForAbstractClass(); $this->eventManagerMock = $this->getMockBuilder(\Magento\Framework\Event\ManagerInterface::class) - ->setMethods(['dispatch']) + ->onlyMethods(['dispatch']) ->getMockForAbstractClass(); $this->pageFactory = $this->getMockBuilder(PageFactory::class) ->disableOriginalConstructor() - ->setMethods(['create']) + ->onlyMethods(['create']) ->getMock(); $this->pageRepository = $this->getMockBuilder(PageRepositoryInterface::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $this->saveController = $objectManager->getObject( - Save::class, - [ - 'request' => $this->requestMock, - 'messageManager' => $this->messageManagerMock, - 'eventManager' => $this->eventManagerMock, - 'resultRedirectFactory' => $this->resultRedirectFactory, - 'dataProcessor' => $this->dataProcessorMock, - 'dataPersistor' => $this->dataPersistorMock, - 'pageFactory' => $this->pageFactory, - 'pageRepository' => $this->pageRepository - ] + $context = $this->getMockBuilder(Context::class) + ->disableOriginalConstructor() + ->getMock(); + $context->method('getRequest')->willReturn($this->requestMock); + $context->method('getMessageManager')->willReturn($this->messageManagerMock); + $context->method('getEventManager')->willReturn($this->eventManagerMock); + $context->method('getResultRedirectFactory')->willReturn($this->resultRedirectFactory); + $this->saveController = new Save( + $context, + $this->dataProcessorMock, + $this->dataPersistorMock, + $this->pageFactory, + $this->pageRepository ); } @@ -140,7 +143,7 @@ public function testSaveAction() 'stores' => ['0'], 'is_active' => true, 'content' => '"><script>alert("cookie: "+document.cookie)</script>', - 'back' => 'close' + 'back' => 'close', ]; $filteredPostData = [ @@ -149,7 +152,7 @@ public function testSaveAction() 'stores' => ['0'], 'is_active' => true, 'content' => '"><script>alert("cookie: "+document.cookie)</script>', - 'back' => 'close' + 'back' => 'close', ]; $this->dataProcessorMock->expects($this->any()) @@ -236,7 +239,7 @@ public function testSaveAndContinue() 'stores' => ['0'], 'is_active' => true, 'content' => '"><script>alert("cookie: "+document.cookie)</script>', - 'back' => 'continue' + 'back' => 'continue', ]; $this->requestMock->expects($this->any())->method('getPostValue')->willReturn($postData); $this->requestMock->expects($this->atLeastOnce()) @@ -304,12 +307,13 @@ public function testSaveActionThrowsException() $this->pageRepository->expects($this->once())->method('getById')->with($this->pageId)->willReturn($page); $page->expects($this->once())->method('setData'); $this->pageRepository->expects($this->once())->method('save')->with($page) - ->willThrowException(new \Exception('Error message.')); + ->willThrowException(new \Error('Error message.')); $this->messageManagerMock->expects($this->never()) ->method('addSuccessMessage'); $this->messageManagerMock->expects($this->once()) - ->method('addExceptionMessage'); + ->method('addErrorMessage') + ->with('Something went wrong while saving the page.'); $this->dataPersistorMock->expects($this->any()) ->method('set') @@ -318,7 +322,7 @@ public function testSaveActionThrowsException() [ 'page_id' => $this->pageId, 'layout_update_xml' => null, - 'custom_layout_update_xml' => null + 'custom_layout_update_xml' => null, ] ); diff --git a/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php b/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php index c9a664aeb4347..42acee7589986 100644 --- a/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php +++ b/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php @@ -16,7 +16,9 @@ use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\ValidatorException; use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\Read; use Magento\Framework\Filesystem\Directory\Write; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\Url\EncoderInterface; @@ -52,6 +54,11 @@ class ImagesTest extends TestCase */ protected $directoryWriteMock; + /** + * @var Read|MockObject + */ + protected $directoryReadMock; + /** * @var StoreManagerInterface|MockObject */ @@ -101,15 +108,10 @@ protected function setUp(): void { $this->path = 'PATH'; $this->objectManager = new ObjectManager($this); - $this->eventManagerMock = $this->getMockForAbstractClass(ManagerInterface::class); - $this->requestMock = $this->getMockForAbstractClass(RequestInterface::class); - $this->urlEncoderMock = $this->getMockForAbstractClass(EncoderInterface::class); - $this->backendDataMock = $this->createMock(Data::class); - $this->contextMock = $this->createMock(Context::class); $this->contextMock->expects($this->any()) ->method('getEventManager') @@ -120,26 +122,21 @@ protected function setUp(): void $this->contextMock->expects($this->any()) ->method('getUrlEncoder') ->willReturn($this->urlEncoderMock); - $this->directoryWriteMock = $this->getMockBuilder(Write::class) ->setConstructorArgs(['path' => $this->path]) ->disableOriginalConstructor() ->getMock(); - $this->directoryWriteMock->expects($this->any()) - ->method('getAbsolutePath') - ->willReturnMap( - [ - [WysiwygConfig::IMAGE_DIRECTORY, null, $this->getAbsolutePath(WysiwygConfig::IMAGE_DIRECTORY)], - [null, null, $this->getAbsolutePath(null)], - ['', null, $this->getAbsolutePath('')], - ] - ); - + $this->directoryReadMock = $this->getMockBuilder(Read::class) + ->setConstructorArgs(['path' => $this->path]) + ->disableOriginalConstructor() + ->getMock(); $this->filesystemMock = $this->createMock(Filesystem::class); $this->filesystemMock->expects($this->once()) ->method('getDirectoryWrite') ->willReturn($this->directoryWriteMock); - + $this->filesystemMock->expects($this->once()) + ->method('getDirectoryReadByPath') + ->willReturn($this->directoryReadMock); $this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class) ->setMethods( [ @@ -150,11 +147,8 @@ protected function setUp(): void ) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $this->storeMock = $this->createMock(Store::class); - $this->escaperMock = $this->createMock(Escaper::class); - $this->imagesHelper = $this->objectManager->getObject( Images::class, [ @@ -165,6 +159,44 @@ protected function setUp(): void 'escaper' => $this->escaperMock, ] ); + $this->directoryWriteMock->expects($this->any()) + ->method('getAbsolutePath') + ->willReturnMap([ + [ + WysiwygConfig::IMAGE_DIRECTORY, + null, + $this->getAbsolutePath(WysiwygConfig::IMAGE_DIRECTORY) + ], + [ + null, + null, + $this->getAbsolutePath(null) + ], + [ + '', + null, + $this->getAbsolutePath('') + ] + ]); + $this->directoryReadMock->expects($this->any()) + ->method('getAbsolutePath') + ->willReturnMap([ + [ + $this->path, + null, + $this->path + ], + [ + $this->path . '/test_path', + null, + $this->path . '/test_path' + ], + [ + $this->path . '/tmp', + null, + $this->path . '/tmp' + ] + ]); } protected function tearDown(): void @@ -231,6 +263,18 @@ public function testConvertPathToId() ); } + public function testConvertIdToPathInvalid() + { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('Path is invalid'); + $this->directoryReadMock->expects($this->any()) + ->method('getAbsolutePath') + ->will( + $this->throwException(new ValidatorException(__("Error"))) + ); + $this->imagesHelper->convertIdToPath('Ly4uLy4uLy4uLy4uLy4uL3dvcms-'); + } + /** * @param string $path * @param string $pathId @@ -260,13 +304,6 @@ public function testConvertIdToPathNodeRoot() $this->assertEquals($this->imagesHelper->getStorageRoot(), $this->imagesHelper->convertIdToPath($pathId)); } - public function testConvertIdToPathInvalid() - { - $this->expectException('InvalidArgumentException'); - $this->expectExceptionMessage('Path is invalid'); - $this->imagesHelper->convertIdToPath('Ly4uLy4uLy4uLy4uLy4uL3dvcms-'); - } - /** * @param string $fileName * @param int $maxLength @@ -403,7 +440,7 @@ public function testGetCurrentPathThrowException() { $this->requestMock->expects($this->any()) ->method('getParam') - ->willReturn('PATH'); + ->willReturn('L3RtcA'); $this->expectException(LocalizedException::class); $this->expectExceptionMessage( diff --git a/app/code/Magento/Cms/etc/di.xml b/app/code/Magento/Cms/etc/di.xml index 61cf33f88abd6..e52c2ff99c712 100644 --- a/app/code/Magento/Cms/etc/di.xml +++ b/app/code/Magento/Cms/etc/di.xml @@ -287,6 +287,8 @@ <item name="button" xsi:type="string">button</item> <item name="i" xsi:type="string">i</item> <item name="u" xsi:type="string">u</item> + <item name="br" xsi:type="string">br</item> + <item name="b" xsi:type="string">b</item> </argument> <argument name="allowedAttributes" xsi:type="array"> <item name="class" xsi:type="string">class</item> diff --git a/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml b/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml index 154e76bd93e41..a647558b39fc2 100644 --- a/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml +++ b/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml @@ -4,32 +4,22 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Uploader */ -/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ -$filters = $block->getConfig()->getFilters() ?? []; -$allowedExtensions = []; $blockHtmlId = $block->getHtmlId(); - -$listExtensions = []; -foreach ($filters as $media_type) { - $listExtensions[] = array_map(function ($fileExt) { - return ltrim($fileExt, '.*'); - }, $media_type['files']); -} - -$allowedExtensions = array_merge([], ...$listExtensions); - -$resizeConfig = $block->getImageUploadConfigData()->getIsResizeEnabled() - ? "{action: 'resize', maxWidth: " - . $block->escapeHtml($block->getImageUploadMaxWidth()) - . ", maxHeight: " - . $block->escapeHtml($block->getImageUploadMaxHeight()) - . "}" - : "{action: 'resize'}"; ?> -<div id="<?= /* @noEscape */ $blockHtmlId ?>" class="uploader"> +<div id="<?= /* @noEscape */ $blockHtmlId ?>" class="uploader" + data-mage-init='{ + "Magento_Backend/js/media-uploader" : { + "maxFileSize": <?= /* @noEscape */ $block->getFileSizeService()->getMaxFileSize() ?>, + "maxWidth": <?= /* @noEscape */ $block->getImageUploadMaxWidth() ?>, + "maxHeight": <?= /* @noEscape */ $block->getImageUploadMaxHeight() ?>, + "isResizeEnabled": <?= /* @noEscape */ $block->getImageUploadConfigData()->getIsResizeEnabled() ?> + } + }' +> <span class="fileinput-button form-buttons"> <span><?= $block->escapeHtml(__('Upload Images')) ?></span> <input class="fileupload" type="file" @@ -46,130 +36,4 @@ $resizeConfig = $block->getImageUploadConfigData()->getIsResizeEnabled() <div class="clear"></div> </div> </script> - <?php $intMaxSize = $block->getFileSizeService()->getMaxFileSize(); - $resizeConfig = /* @noEscape */ $resizeConfig; - $blockHtmlId = /* @noEscape */ $blockHtmlId; - $scriptString = <<<script - -require([ - 'jquery', - 'mage/template', - 'Magento_Ui/js/lib/validation/validator', - 'Magento_Ui/js/modal/alert', - 'jquery/file-uploader', - 'domReady!', - 'mage/translate' -], function ($, mageTemplate, validator, uiAlert) { - var maxFileSize = {$block->escapeJs($block->getFileSizeService()->getMaxFileSize())}, - allowedExtensions = '{$block->escapeJs(implode(' ', $allowedExtensions))}'; - - $('#{$blockHtmlId} .fileupload').fileupload({ - dataType: 'json', - formData: { - isAjax: 'true', - form_key: FORM_KEY - }, - sequentialUploads: true, - acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, - allowedExtensions: allowedExtensions, - maxFileSize: maxFileSize, - dropZone: $('#{$blockHtmlId}').closest('[role="dialog"]'), - add: function (e, data) { - var progressTmpl = mageTemplate('#{$blockHtmlId}-template'), - fileSize, - tmpl, - validationResult; - - data.files = data.files.filter(function (file) { - fileSize = typeof file.size == "undefined" ? - $.mage.__('We could not detect a size.') : - byteConvert(file.size); - - if (maxFileSize) { - validationResult = validator('validate-max-size', file.size, maxFileSize); - - if (!validationResult.passed) { - uiAlert({ - content: validationResult.message - }); - - return false; - } - } - - if (allowedExtensions) { - validationResult = validator('validate-file-type', file.name, allowedExtensions); - - if (!validationResult.passed) { - uiAlert({ - content: validationResult.message - }); - - return false; - } - } - - data.fileId = Math.random().toString(36).substr(2, 9); - - tmpl = progressTmpl({ - data: { - name: file.name, - size: fileSize, - id: data.fileId - } - }); - - $(tmpl).data('image', data).appendTo('#{$blockHtmlId}'); - - return true; - }); - - if (data.files.length) { - $(this).fileupload('process', data).done(function () { - data.submit(); - }); - } - }, - done: function (e, data) { - var progressSelector = '#' + data.fileId + ' .progressbar-container .progressbar'; - var tempErrorMessage = document.createElement("div"); - $(progressSelector).css('width', '100%'); - $('[data-action="show-error"]').children(".message").remove(); - if (data.result && !data.result.hasOwnProperty('errorcode')) { - $(progressSelector).removeClass('upload-progress').addClass('upload-success'); - } else { - tempErrorMessage.className = "message message-warning warning"; - tempErrorMessage.innerHTML = data.result.error; - - $('[data-action="show-error"]').append(tempErrorMessage); - $(progressSelector).removeClass('upload-progress').addClass('upload-failure'); - } - }, - progress: function (e, data) { - var progress = parseInt(data.loaded / data.total * 100, 10); - var progressSelector = '#' + data.fileId + ' .progressbar-container .progressbar'; - $(progressSelector).css('width', progress + '%'); - }, - fail: function (e, data) { - var progressSelector = '#' + data.fileId + ' .progressbar-container .progressbar'; - $(progressSelector).removeClass('upload-progress').addClass('upload-failure'); - } - }); - - $('#{$blockHtmlId} .fileupload').fileupload('option', { - process: [{ - action: 'load', - fileTypes: /^image\/(gif|jpeg|png)$/, - maxFileSize: {$intMaxSize} * 10 - }, - {$resizeConfig}, - { - action: 'save' - }] - }); -}); - -script; - ?> - <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?> </div> diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml index a2ce0ec1b8740..4da2e0c8c13d3 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml @@ -125,7 +125,7 @@ </validation> <dataType>int</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link> + <link>https://docs.magento.com/user-guide/configuration/scope.html</link> <description>What is this?</description> </tooltip> <label translate="true">Store View</label> diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml index 396923a2b6f3b..dd1c9d2b8ae45 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_form.xml @@ -208,7 +208,7 @@ </validation> <dataType>int</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link> + <link>https://docs.magento.com/user-guide/configuration/scope.html</link> <description>What is this?</description> </tooltip> <label translate="true">Store View</label> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml b/app/code/Magento/Cms/view/frontend/layout/cms_noroute_index.xml similarity index 100% rename from app/code/Magento/Cms/view/frontend/layout/cms_index_noroute.xml rename to app/code/Magento/Cms/view/frontend/layout/cms_noroute_index.xml diff --git a/app/code/Magento/CmsGraphQl/etc/schema.graphqls b/app/code/Magento/CmsGraphQl/etc/schema.graphqls index 2453cb61b9a6d..338dae0f6c6c9 100644 --- a/app/code/Magento/CmsGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CmsGraphQl/etc/schema.graphqls @@ -20,7 +20,7 @@ type Query { ): CmsBlocks @resolver(class: "Magento\\CmsGraphQl\\Model\\Resolver\\Blocks") @doc(description: "The CMS block query returns information about CMS blocks") @cache(cacheIdentity: "Magento\\CmsGraphQl\\Model\\Resolver\\Block\\Identity") } -type CmsPage @doc(description: "CMS page defines all CMS page information") { +type CmsPage implements RoutableInterface @doc(description: "CMS page defines all CMS page information") { identifier: String @doc(description: "Identifier of the CMS page") url_key: String @doc(description: "URL key of CMS page") title: String @doc(description: "CMS page title") @@ -40,4 +40,4 @@ type CmsBlock @doc(description: "CMS block defines all CMS block information") { identifier: String @doc(description: "CMS block identifier") title: String @doc(description: "CMS block title") content: String @doc(description: "CMS block content") -} \ No newline at end of file +} diff --git a/app/code/Magento/CmsUrlRewriteGraphQl/Model/CmsPageTypeResolver.php b/app/code/Magento/CmsUrlRewriteGraphQl/Model/CmsPageTypeResolver.php new file mode 100755 index 0000000000000..74b3c91a999cd --- /dev/null +++ b/app/code/Magento/CmsUrlRewriteGraphQl/Model/CmsPageTypeResolver.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CmsUrlRewriteGraphQl\Model; + +use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; + +/** + * @inheritdoc + */ +class CmsPageTypeResolver implements TypeResolverInterface +{ + const CMS_PAGE = 'CMS_PAGE'; + const TYPE_RESOLVER = 'CmsPage'; + + /** + * @inheritdoc + */ + public function resolveType(array $data) : string + { + if (isset($data['type_id']) && $data['type_id'] == self::CMS_PAGE) { + return self::TYPE_RESOLVER; + } + return ''; + } +} diff --git a/app/code/Magento/CmsUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/Page.php b/app/code/Magento/CmsUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/Page.php new file mode 100644 index 0000000000000..a83cbb8713d50 --- /dev/null +++ b/app/code/Magento/CmsUrlRewriteGraphQl/Model/DataProvider/UrlRewrite/Page.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CmsUrlRewriteGraphQl\Model\DataProvider\UrlRewrite; + +use Magento\CmsGraphQl\Model\Resolver\DataProvider\Page as PageDataProvider; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderInterface; + +class Page implements EntityDataProviderInterface +{ + /** + * @var PageDataProvider + */ + private $pageDataProvider; + + /** + * Route constructor. + * @param PageDataProvider $pageDataProvider + */ + public function __construct( + PageDataProvider $pageDataProvider + ) { + $this->pageDataProvider = $pageDataProvider; + } + + /** + * Get Page data + * + * @param string $entity_type + * @param int $id + * @param ResolveInfo|null $info + * @param int|null $storeId + * @return array + * @throws NoSuchEntityException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function getData( + string $entity_type, + int $id, + ResolveInfo $info = null, + int $storeId = null + ): array { + $result = $this->pageDataProvider->getDataByPageId((int)$id); + $result['type_id'] = $entity_type; + return $result; + } +} diff --git a/app/code/Magento/CmsUrlRewriteGraphQl/composer.json b/app/code/Magento/CmsUrlRewriteGraphQl/composer.json index d8fbbb4c2e6fd..fc393fdceadb5 100644 --- a/app/code/Magento/CmsUrlRewriteGraphQl/composer.json +++ b/app/code/Magento/CmsUrlRewriteGraphQl/composer.json @@ -7,7 +7,8 @@ "magento/framework": "*", "magento/module-cms": "*", "magento/module-store": "*", - "magento/module-url-rewrite-graph-ql": "*" + "magento/module-url-rewrite-graph-ql": "*", + "magento/module-cms-graph-ql": "*" }, "suggest": { "magento/module-cms-url-rewrite": "*", diff --git a/app/code/Magento/CmsUrlRewriteGraphQl/etc/di.xml b/app/code/Magento/CmsUrlRewriteGraphQl/etc/di.xml index ae8475cc113d2..4f4efff82a2d4 100644 --- a/app/code/Magento/CmsUrlRewriteGraphQl/etc/di.xml +++ b/app/code/Magento/CmsUrlRewriteGraphQl/etc/di.xml @@ -20,4 +20,11 @@ </argument> </arguments> </type> + <type name="Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderComposite"> + <arguments> + <argument name="dataProviders" xsi:type="array"> + <item name="cms_page" xsi:type="object">Magento\CmsUrlRewriteGraphQl\Model\DataProvider\UrlRewrite\Page</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/CmsUrlRewriteGraphQl/etc/graphql/di.xml b/app/code/Magento/CmsUrlRewriteGraphQl/etc/graphql/di.xml new file mode 100755 index 0000000000000..08b96da8accd4 --- /dev/null +++ b/app/code/Magento/CmsUrlRewriteGraphQl/etc/graphql/di.xml @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="cms_page_type_resolver" xsi:type="object">Magento\CmsUrlRewriteGraphQl\Model\CmsPageTypeResolver</item> + </argument> + </arguments> + </type> +</config> diff --git a/app/code/Magento/Config/Model/Config/PathValidator.php b/app/code/Magento/Config/Model/Config/PathValidator.php index bc4f863b7b05f..d0d1d46303b8e 100644 --- a/app/code/Magento/Config/Model/Config/PathValidator.php +++ b/app/code/Magento/Config/Model/Config/PathValidator.php @@ -6,6 +6,7 @@ namespace Magento\Config\Model\Config; +use Magento\Config\Model\Config\Structure\Element\Field; use Magento\Framework\Exception\ValidatorException; /** @@ -40,6 +41,11 @@ public function __construct(Structure $structure) */ public function validate($path) { + $element = $this->structure->getElementByConfigPath($path); + if ($element instanceof Field && $element->getConfigPath()) { + $path = $element->getConfigPath(); + } + $allPaths = $this->structure->getFieldPaths(); if (!array_key_exists($path, $allPaths)) { diff --git a/app/code/Magento/Config/Model/Config/Structure.php b/app/code/Magento/Config/Model/Config/Structure.php index 156867f34318a..3eb0a375091f3 100644 --- a/app/code/Magento/Config/Model/Config/Structure.php +++ b/app/code/Magento/Config/Model/Config/Structure.php @@ -191,7 +191,7 @@ public function getElementByConfigPath($path) { $allPaths = $this->getFieldPaths(); - if (isset($allPaths[$path])) { + if (isset($allPaths[$path]) && is_array($allPaths[$path])) { $path = array_shift($allPaths[$path]); } diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminNavigateToConfigurationSystemSectionActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminNavigateToConfigurationSystemSectionActionGroup.xml new file mode 100644 index 0000000000000..64cac92f3a3e5 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminNavigateToConfigurationSystemSectionActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminNavigateToConfigurationSystemSectionActionGroup"> + <annotations> + <description>Navigates to the specified section in admin on the Stores > Settings > Configuration > Advanced > System page.</description> + </annotations> + <arguments> + <argument name="section" defaultValue="" type="string"/> + </arguments> + <amOnPage url="{{AdminConfigSystemBySectionPage.url(section)}}" stepKey="navigateToConfigurationSystemPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml b/app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml index 53ca46e746206..378aa0bfc510c 100644 --- a/app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml +++ b/app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml @@ -21,4 +21,13 @@ <entity name="DefaultAdminAccountAllowCountry" type="checkoutTotalFlagZero"> <data key="value">0</data> </entity> + <entity name="SetAdminAccountAllowCountryToDefaultForDefaultWebsite" type="default_admin_account_country_options_config_for_default_website"> + <requiredEntity type="checkoutTotalFlagZero">DefaultAdminAccountAllowCountry</requiredEntity> + </entity> + <entity name="SetAllowedCountryUsConfig"> + <data key="path">general/country/allow</data> + <data key="value">US</data> + <data key="scope">websites</data> + <data key="scope_code">base</data> + </entity> </entities> diff --git a/app/code/Magento/Config/Test/Mftf/Metadata/SystemConfigCountriesMeta.xml b/app/code/Magento/Config/Test/Mftf/Metadata/SystemConfigCountriesMeta.xml index bd16c225af51d..100c874024a5e 100644 --- a/app/code/Magento/Config/Test/Mftf/Metadata/SystemConfigCountriesMeta.xml +++ b/app/code/Magento/Config/Test/Mftf/Metadata/SystemConfigCountriesMeta.xml @@ -32,4 +32,18 @@ </object> </object> </operation> + + <operation name="DefaultAdminAccountCountryOptionConfigDefaultWebsite" dataType="default_admin_account_country_options_config_for_default_website" type="create" auth="adminFormKey" url="/admin/system_config/save/section/general/website/1/" method="POST"> + <object key="groups" dataType="default_admin_account_country_options_config_for_default_website"> + <object key="country" dataType="default_admin_account_country_options_config_for_default_website"> + <object key="fields" dataType="default_admin_account_country_options_config_for_default_website"> + <object key="allow" dataType="default_admin_account_country_options_config_for_default_website"> + <object key="inherit" dataType="checkoutTotalFlagZero"> + <field key="value">string</field> + </object> + </object> + </object> + </object> + </object> + </operation> </operations> diff --git a/app/code/Magento/Config/Test/Mftf/Page/AdminConfigPage/AdminConfigSystemBySectionPage.xml b/app/code/Magento/Config/Test/Mftf/Page/AdminConfigPage/AdminConfigSystemBySectionPage.xml new file mode 100644 index 0000000000000..40977bb7b9552 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/Page/AdminConfigPage/AdminConfigSystemBySectionPage.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminConfigSystemBySectionPage" url="admin/system_config/edit/section/system/{{section}}" area="admin" module="Magento_Config" parameterized="true"/> +</pages> diff --git a/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml b/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml index d0edd4cf1cb64..f65f626f1a520 100644 --- a/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml +++ b/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml @@ -11,21 +11,25 @@ <test name="CheckingCountryDropDownWithOneAllowedCountryTest"> <annotations> <features value="Config"/> - <stories value="MAGETWO-96107: Additional blank option in country dropdown"/> + <stories value="Additional blank option in country dropdown"/> <title value="Checking country drop-down with one allowed country"/> <description value="Check country drop-down with one allowed country"/> <severity value="MAJOR"/> - <testCaseId value="MAGETWO-96133"/> + <testCaseId value="MAGETWO-28511"/> <group value="configuration"/> </annotations> <before> <createData entity="EnableAdminAccountAllowCountry" stepKey="setAllowedCountries"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> </before> <after> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <createData entity="DisableAdminAccountAllowCountry" stepKey="setDefaultValueForAllowCountries"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> <argument name="customerEmail" value="CustomerEntityOne.email"/> @@ -34,10 +38,7 @@ <waitForPageLoad stepKey="WaitForPageToLoad"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!--Flush Magento Cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Create a customer account from Storefront--> <actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/> <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm"> @@ -52,5 +53,12 @@ <click selector="{{StorefrontCustomerAddressSection.country}}" stepKey="clickToExpandCountryDropDown"/> <see selector="{{StorefrontCustomerAddressSection.country}}" userInput="United States" stepKey="seeSelectedCountry"/> <dontSee selector="{{StorefrontCustomerAddressSection.country}}" userInput="Brazil" stepKey="canNotSeeSelectedCountry"/> + <createData entity="DisableAdminAccountAllowCountry" stepKey="setDefaultValueForAllowCountries"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <reloadPage stepKey="realoadPageAfterConfigChanged"/> + <see selector="{{StorefrontCustomerAddressSection.country}}" userInput="United States" stepKey="seeUnitedStatesCountry"/> + <see selector="{{StorefrontCustomerAddressSection.country}}" userInput="Brazil" stepKey="seeBrazilCountry"/> </test> </tests> diff --git a/app/code/Magento/ConfigurableImportExport/Plugin/Import/Product/UpdateConfigurableProductsStockItemStatusPlugin.php b/app/code/Magento/ConfigurableImportExport/Plugin/Import/Product/UpdateConfigurableProductsStockItemStatusPlugin.php new file mode 100644 index 0000000000000..9a2881d3031bf --- /dev/null +++ b/app/code/Magento/ConfigurableImportExport/Plugin/Import/Product/UpdateConfigurableProductsStockItemStatusPlugin.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableImportExport\Plugin\Import\Product; + +use Magento\CatalogImportExport\Model\StockItemImporterInterface; +use Magento\ConfigurableProduct\Model\Inventory\ChangeParentStockStatus; + +/** + * Update configurable products stock item status based on children products stock status after import + */ +class UpdateConfigurableProductsStockItemStatusPlugin +{ + /** + * @var ChangeParentStockStatus + */ + private $changeParentStockStatus; + + /** + * @param ChangeParentStockStatus $changeParentStockStatus + */ + public function __construct( + ChangeParentStockStatus $changeParentStockStatus + ) { + $this->changeParentStockStatus = $changeParentStockStatus; + } + + /** + * Update configurable products stock item status based on children products stock status after import + * + * @param StockItemImporterInterface $subject + * @param mixed $result + * @param array $stockData + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterImport( + StockItemImporterInterface $subject, + $result, + array $stockData + ): void { + if ($stockData) { + $this->changeParentStockStatus->execute(array_column($stockData, 'product_id')); + } + } +} diff --git a/app/code/Magento/ConfigurableImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/ConfigurableImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 0000000000000..5c0c897c7313a --- /dev/null +++ b/app/code/Magento/ConfigurableImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Categories --> + <entity name="ImportCategory_Configurable" type="category"> + <data key="name">import-category-configurable</data> + <data key="name_lwr">import-category-configurable</data> + <data key="is_active">true</data> + <data key="include_in_menu">true</data> + <data key="urlKey">import-category-configurable</data> + </entity> + + <!-- Products --> + <entity name="ImportProductSimple1_Configurable" type="product"> + <data key="name">import-product-simple1-configurable</data> + <data key="sku">import-product-simple1-configurable</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="price">11.00</data> + <data key="quantity">101</data> + <data key="weight">1</data> + <data key="visibilityText">Not Visible Individually</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="urlKey">import-product-simple1-configurable</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">magento-logo.png</data> + <data key="smallImageName">magento-logo</data> + <data key="thumbnailImage">magento-logo.png</data> + <data key="thumbnailImageName">magento-logo</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple2_Configurable" type="product"> + <data key="name">import-product-simple2-configurable</data> + <data key="sku">import-product-simple2-configurable</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="price">12.00</data> + <data key="quantity">102</data> + <data key="weight">2</data> + <data key="visibilityText">Not Visible Individually</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="urlKey">import-product-simple2-configurable</data> + <data key="baseImage">m-logo.gif</data> + <data key="baseImageName">m-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">m-logo.gif</data> + <data key="thumbnailImageName">m-logo</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple3_Configurable" type="product"> + <data key="name">import-product-simple3-configurable</data> + <data key="sku">import-product-simple3-configurable</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="price">13.00</data> + <data key="quantity">103</data> + <data key="weight">3</data> + <data key="visibilityText">Not Visible Individually</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="urlKey">import-product-simple3-configurable</data> + <data key="baseImage">adobe-base.jpg</data> + <data key="baseImageName">adobe-base</data> + <data key="smallImage">adobe-base.jpg</data> + <data key="smallImageName">adobe-base</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProduct_Configurable" type="product"> + <data key="fileName">import_configurable_product.csv</data> + <data key="importSummary">Created: 4, Updated: 0, Deleted: 0</data> + <data key="name">import-product-configurable</data> + <data key="sku">import-product-configurable</data> + <data key="type_id">configurable</data> + <data key="attribute_set_id">4</data> + <data key="price"/> + <data key="quantity"/> + <data key="weight"/> + <data key="visibilityText">Catalog, Search</data> + <data key="status">1</data> + <data key="urlKey">import-product-configurable</data> + <data key="baseImage">adobe-base.jpg</data> + <data key="baseImageName">adobe-base</data> + <data key="smallImage">adobe-base.jpg</data> + <data key="smallImageName">adobe-base</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> +</entities> diff --git a/app/code/Magento/ConfigurableImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/ConfigurableImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml new file mode 100644 index 0000000000000..67a7a0970eb36 --- /dev/null +++ b/app/code/Magento/ConfigurableImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml @@ -0,0 +1,341 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest"> + <annotations> + <features value="Import/Export"/> + <stories value="Import Products"/> + <title value="Import Configurable Product With Simple Child Products With Images"/> + <description value="Imports a .csv file containing a configurable product with 3 child simple products that + have images. Verifies that products are imported successfully, that the images are attached to the + products as expected, and that the configurable product can be purchased successfully."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38222"/> + <group value="importExport"/> + <group value="ConfigurableProduct"/> + </annotations> + + <before> + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <!-- Create Category, Product Attribute with 3 Options, & Customer --> + <createData entity="ImportCategory_Configurable" stepKey="createImportCategory"/> + <createData entity="ProductAttributeWithThreeOptionsForImport" stepKey="createImportProductAttribute"/> + <createData entity="ProductAttributeOptionOneForExportImport" stepKey="createImportProductAttributeOption1"> + <requiredEntity createDataKey="createImportProductAttribute"/> + </createData> + <createData entity="ProductAttributeOptionTwoForExportImport" stepKey="createImportProductAttributeOption2"> + <requiredEntity createDataKey="createImportProductAttribute"/> + </createData> + <createData entity="ProductAttributeOptionThreeForImport" stepKey="createImportProductAttributeOption3"> + <requiredEntity createDataKey="createImportProductAttribute"/> + </createData> + <createData entity="AddToDefaultSet" stepKey="addToProductAttributeSet"> + <requiredEntity createDataKey="createImportProductAttribute"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Copy Images to Import Directory for Product Images --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages"> + <argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Configurable.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Configurable.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument> + </helper> + </before> + + <after> + <!-- Delete Data --> + <deleteData createDataKey="createImportCategory" stepKey="deleteImportCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="filterProductsGrid"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{ImportProduct_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterApplyActionGroup" stepKey="applyProductsFilter"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProducts"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="filterProductsGrid2"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="import-product"/> + </actionGroup> + <actionGroup ref="AdminGridFilterApplyActionGroup" stepKey="applyProductsFilter2"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProducts2"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetProductsGrid"/> + <actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteAttribute"> + <argument name="productAttributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}" /> + </actionGroup> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteProductImageDirectory"> + <argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument> + </helper> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Configurable Product with Simple Child Products & Assert No Errors --> + <actionGroup ref="AdminNavigateToImportPageActionGroup" stepKey="navigateToImportPage"/> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Configurable.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminClickCheckDataImportActionGroup" stepKey="clickCheckData"/> + <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{ImportCommonMessages.validFile}}" stepKey="seeCheckDataResultMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage"/> + <actionGroup ref="AdminClickImportActionGroup" stepKey="clickImport"/> + <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{ImportProduct_Configurable.importSummary}}" stepKey="seeNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.messageByType('success')}}" userInput="{{ImportCommonMessages.success}}" stepKey="seeImportMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage2"/> + + <!-- Reindex --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + + <!-- Admin: Verify Data on Import History Page --> + <actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/> + <actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending"> + <argument name="columnLabel" value="history_id"/> + </actionGroup> + <see userInput="{{ImportProduct_Configurable.fileName}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/> + <see userInput="{{ImportProduct_Configurable.importSummary}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/> + + <!-- Admin: Verify Simple Product 1 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct1EditPage"> + <argument name="product" value="ImportProductSimple1_Configurable"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct1OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple1_Configurable.status}}"/> + <argument name="productName" value="{{ImportProductSimple1_Configurable.name}}"/> + <argument name="productSku" value="{{ImportProductSimple1_Configurable.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple1_Configurable.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple1_Configurable.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple1_Configurable.weight}}"/> + <argument name="productVisibility" value="{{ImportProductSimple1_Configurable.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Configurable.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Configurable.baseImageName, 'image')}}" stepKey="seeBaseImageRole1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Configurable.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Configurable.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Configurable.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Configurable.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole1"/> + + <!-- Admin: Verify Simple Product 2 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct2EditPage"> + <argument name="product" value="ImportProductSimple2_Configurable"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct2OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple2_Configurable.status}}"/> + <argument name="productName" value="{{ImportProductSimple2_Configurable.name}}"/> + <argument name="productSku" value="{{ImportProductSimple2_Configurable.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple2_Configurable.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple2_Configurable.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple2_Configurable.weight}}"/> + <argument name="productVisibility" value="{{ImportProductSimple2_Configurable.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Configurable.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Configurable.baseImageName, 'image')}}" stepKey="seeBaseImageRole2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Configurable.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Configurable.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Configurable.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Configurable.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole2"/> + + <!-- Admin: Verify Simple Product 3 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct3EditPage"> + <argument name="product" value="ImportProductSimple3_Configurable"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct3OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple3_Configurable.status}}"/> + <argument name="productName" value="{{ImportProductSimple3_Configurable.name}}"/> + <argument name="productSku" value="{{ImportProductSimple3_Configurable.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple3_Configurable.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple3_Configurable.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple3_Configurable.weight}}"/> + <argument name="productVisibility" value="{{ImportProductSimple3_Configurable.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Configurable.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Configurable.baseImageName, 'image')}}" stepKey="seeBaseImageRole3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Configurable.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Configurable.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Configurable.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Configurable.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole3"/> + + <!-- Admin: Verify Configurable Product Common Data on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToConfigurableProductEditPage"> + <argument name="product" value="ImportProduct_Configurable"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertConfigurableProductOnEditPage"> + <argument name="productStatus" value="{{ImportProduct_Configurable.status}}"/> + <argument name="productName" value="{{ImportProduct_Configurable.name}}"/> + <argument name="productSku" value="{{ImportProduct_Configurable.sku}}"/> + <argument name="productPrice" value="{{ImportProduct_Configurable.price}}"/> + <argument name="productQuantity" value="{{ImportProduct_Configurable.quantity}}"/> + <argument name="productWeight" value="{{ImportProduct_Configurable.weight}}"/> + <argument name="productVisibility" value="{{ImportProduct_Configurable.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Configurable.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertConfigurableProductBaseImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Configurable.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Configurable.baseImageName, 'image')}}" stepKey="seeBaseImageRoleConfigurable"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertConfigurableProductSmallImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Configurable.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Configurable.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleConfigurable"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertConfigurableProductThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Configurable.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Configurable.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleConfigurable"/> + + <!-- Admin: Verify Configurable Product Information on Edit Product Page --> + <seeNumberOfElements userInput="3" selector="{{AdminProductFormConfigurationsSection.currentVariationsAllRows}}" stepKey="see3RowsAdmin"/> + <actionGroup ref="AdminVerifyCurrentVariationsForConfigurableProductActionGroup" stepKey="verifyConfigurableChildProduct1Admin"> + <argument name="image" value="{{ImportProductSimple1_Configurable.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple1_Configurable.name}}"/> + <argument name="sku" value="{{ImportProductSimple1_Configurable.sku}}"/> + <argument name="price" value="${{ImportProductSimple1_Configurable.price}}"/> + <argument name="quantity" value="{{ImportProductSimple1_Configurable.quantity}}"/> + <argument name="weight" value="{{ImportProductSimple1_Configurable.weight}}"/> + <argument name="status" value="{{ImportProductSimple1_Configurable.statusText}}"/> + <argument name="attributes" value="{{ProductAttributeWithThreeOptionsForImport.attribute_code}}: {{ProductAttributeOptionOneForExportImport.label}}"/> + <argument name="index" value="1"/> + </actionGroup> + <actionGroup ref="AdminVerifyCurrentVariationsForConfigurableProductActionGroup" stepKey="verifyConfigurableChildProduct2Admin"> + <argument name="image" value="{{ImportProductSimple2_Configurable.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple2_Configurable.name}}"/> + <argument name="sku" value="{{ImportProductSimple2_Configurable.sku}}"/> + <argument name="price" value="${{ImportProductSimple2_Configurable.price}}"/> + <argument name="quantity" value="{{ImportProductSimple2_Configurable.quantity}}"/> + <argument name="weight" value="{{ImportProductSimple2_Configurable.weight}}"/> + <argument name="status" value="{{ImportProductSimple2_Configurable.statusText}}"/> + <argument name="attributes" value="{{ProductAttributeWithThreeOptionsForImport.attribute_code}}: {{ProductAttributeOptionTwoForExportImport.label}}"/> + <argument name="index" value="2"/> + </actionGroup> + <actionGroup ref="AdminVerifyCurrentVariationsForConfigurableProductActionGroup" stepKey="verifyConfigurableChildProduct3Admin"> + <argument name="image" value="{{ImportProductSimple3_Configurable.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple3_Configurable.name}}"/> + <argument name="sku" value="{{ImportProductSimple3_Configurable.sku}}"/> + <argument name="price" value="${{ImportProductSimple3_Configurable.price}}"/> + <argument name="quantity" value="{{ImportProductSimple3_Configurable.quantity}}"/> + <argument name="weight" value="{{ImportProductSimple3_Configurable.weight}}"/> + <argument name="status" value="{{ImportProductSimple3_Configurable.statusText}}"/> + <argument name="attributes" value="{{ProductAttributeWithThreeOptionsForImport.attribute_code}}: {{ProductAttributeOptionThreeForImport.label}}"/> + <argument name="index" value="3"/> + </actionGroup> + + <!-- Storefront: Verify Configurable Product In Category --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="{{ImportCategory_Configurable.name_lwr}}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productName}}" userInput="1" stepKey="seeOnly1Product"/> + <see userInput="{{ImportProduct_Configurable.name}}" selector="{{StorefrontCategoryMainSection.productName}}" stepKey="seeConfigurableProduct"/> + <dontSee userInput="{{ImportProductSimple1_Configurable.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeSimpleProduct1"/> + <dontSee userInput="{{ImportProductSimple2_Configurable.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeSimpleProduct2"/> + <dontSee userInput="{{ImportProductSimple3_Configurable.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeSimpleProduct3"/> + + <!-- Storefront: Verify Configurable Product Info & Image --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> + <argument name="productUrl" value="{{ImportProduct_Configurable.urlKey}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="As low as ${{ImportProductSimple1_Configurable.price}}" stepKey="seePrice"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Configurable.baseImageName)}}" stepKey="seeBaseImage"/> + + <!-- Storefront: Verify Configurable Product Option 1 Info & Image --> + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption1"> + <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> + <argument name="optionLabel" value="{{ProductAttributeOptionOneForExportImport.label}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName2"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku2"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple1_Configurable.price}}" stepKey="seePrice2"/> + <waitForPageLoad stepKey="waitForImageLoad1"/> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple1_Configurable.baseImageName)}}" stepKey="seeBaseImage2"/> + + <!-- Storefront: Verify Configurable Product Option 2 Info & Image --> + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption2"> + <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> + <argument name="optionLabel" value="{{ProductAttributeOptionTwoForExportImport.label}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName3"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku3"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple2_Configurable.price}}" stepKey="seePrice3"/> + <waitForPageLoad stepKey="waitForImageLoad2"/> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple2_Configurable.baseImageName)}}" stepKey="seeBaseImage3"/> + + <!-- Storefront: Verify Configurable Product Option 3 Info & Image --> + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption3"> + <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> + <argument name="optionLabel" value="{{ProductAttributeOptionThreeForImport.label}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName4"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku4"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple3_Configurable.price}}" stepKey="seePrice4"/> + <waitForPageLoad stepKey="waitForImageLoad3"/> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple3_Configurable.baseImageName)}}" stepKey="seeBaseImage4"/> + + <!-- Purchase Configurable Product --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Confirm Purchased Configurable Product --> + <actionGroup ref="StorefrontOpenOrderFromSuccessPageActionGroup" stepKey="openOrderFromSuccessPage"> + <argument name="orderNumber" value="{$grabOrderNumber}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCustomerOrderViewSection.productRows}}" userInput="1" stepKey="seeOnly1ProductInOrder"/> + <actionGroup ref="StorefrontVerifyCustomerOrderProductRowDataActionGroup" stepKey="verifyProductRowInOrder"> + <argument name="name" value="{{ImportProduct_Configurable.name}}"/> + <argument name="sku" value="{{ImportProductSimple3_Configurable.sku}}"/> + <argument name="price" value="${{ImportProductSimple3_Configurable.price}}"/> + <argument name="quantity" value="1"/> + <argument name="subtotal" value="${{ImportProductSimple3_Configurable.price}}"/> + </actionGroup> + <waitForText userInput="{{ProductAttributeWithThreeOptionsForImport.attribute_code}}" selector="{{StorefrontCustomerOrderViewSection.productNameByRow('1')}}" stepKey="seeProductAttribute"/> + <waitForText userInput="{{ProductAttributeOptionThreeForImport.label}}" selector="{{StorefrontCustomerOrderViewSection.productNameByRow('1')}}" stepKey="seeProductAttributeOption"/> + </test> +</tests> diff --git a/app/code/Magento/ConfigurableImportExport/etc/di.xml b/app/code/Magento/ConfigurableImportExport/etc/di.xml index f72f3885d45cb..c30eae0aa9a7e 100644 --- a/app/code/Magento/ConfigurableImportExport/etc/di.xml +++ b/app/code/Magento/ConfigurableImportExport/etc/di.xml @@ -13,4 +13,9 @@ </argument> </arguments> </type> + <type name="Magento\CatalogImportExport\Model\StockItemImporterInterface"> + <plugin name="update_configurable_products_stock_item_status" + type="Magento\ConfigurableImportExport\Plugin\Import\Product\UpdateConfigurableProductsStockItemStatusPlugin" + sortOrder="100"/> + </type> </config> diff --git a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/GetAttributes.php b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/GetAttributes.php index 9f5d5062b5366..f7230fddfaf24 100644 --- a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/GetAttributes.php +++ b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/GetAttributes.php @@ -31,6 +31,11 @@ class GetAttributes extends Action implements HttpGetActionInterface */ protected $jsonHelper; + /** + * @var AttributesListInterface + */ + private $attributesList; + /** * @param Action\Context $context * @param \Magento\Store\Model\StoreManagerInterface $storeManager diff --git a/app/code/Magento/ConfigurableProduct/Model/Inventory/ChangeParentStockStatus.php b/app/code/Magento/ConfigurableProduct/Model/Inventory/ChangeParentStockStatus.php new file mode 100644 index 0000000000000..9bb4659b31dbe --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Model/Inventory/ChangeParentStockStatus.php @@ -0,0 +1,127 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProduct\Model\Inventory; + +use Magento\CatalogInventory\Api\Data\StockItemInterface; +use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\CatalogInventory\Api\StockItemCriteriaInterfaceFactory; +use Magento\CatalogInventory\Api\StockItemRepositoryInterface; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable; + +/*** + * Update stock status of configurable products based on children products stock status + */ +class ChangeParentStockStatus +{ + /** + * @var Configurable + */ + private $configurableType; + + /** + * @var StockItemCriteriaInterfaceFactory + */ + private $criteriaInterfaceFactory; + + /** + * @var StockItemRepositoryInterface + */ + private $stockItemRepository; + + /** + * @var StockConfigurationInterface + */ + private $stockConfiguration; + + /** + * @param Configurable $configurableType + * @param StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory + * @param StockItemRepositoryInterface $stockItemRepository + * @param StockConfigurationInterface $stockConfiguration + */ + public function __construct( + Configurable $configurableType, + StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory, + StockItemRepositoryInterface $stockItemRepository, + StockConfigurationInterface $stockConfiguration + ) { + $this->configurableType = $configurableType; + $this->criteriaInterfaceFactory = $criteriaInterfaceFactory; + $this->stockItemRepository = $stockItemRepository; + $this->stockConfiguration = $stockConfiguration; + } + + /** + * Update stock status of configurable products based on children products stock status + * + * @param array $childrenIds + * @return void + */ + public function execute(array $childrenIds): void + { + $parentIds = $this->configurableType->getParentIdsByChild($childrenIds); + foreach (array_unique($parentIds) as $productId) { + $this->processStockForParent((int)$productId); + } + } + + /** + * Update stock status of configurable product based on children products stock status + * + * @param int $productId + * @return void + */ + private function processStockForParent(int $productId): void + { + $criteria = $this->criteriaInterfaceFactory->create(); + $criteria->setScopeFilter($this->stockConfiguration->getDefaultScopeId()); + + $criteria->setProductsFilter($productId); + $stockItemCollection = $this->stockItemRepository->getList($criteria); + $allItems = $stockItemCollection->getItems(); + if (empty($allItems)) { + return; + } + $parentStockItem = array_shift($allItems); + + $childrenIds = $this->configurableType->getChildrenIds($productId); + $criteria->setProductsFilter($childrenIds); + $stockItemCollection = $this->stockItemRepository->getList($criteria); + $allItems = $stockItemCollection->getItems(); + + $childrenIsInStock = false; + + foreach ($allItems as $childItem) { + if ($childItem->getIsInStock() === true) { + $childrenIsInStock = true; + break; + } + } + + if ($this->isNeedToUpdateParent($parentStockItem, $childrenIsInStock)) { + $parentStockItem->setIsInStock($childrenIsInStock); + $parentStockItem->setStockStatusChangedAuto(1); + $this->stockItemRepository->save($parentStockItem); + } + } + + /** + * Check if parent item should be updated + * + * @param StockItemInterface $parentStockItem + * @param bool $childrenIsInStock + * @return bool + */ + private function isNeedToUpdateParent( + StockItemInterface $parentStockItem, + bool $childrenIsInStock + ): bool { + return $parentStockItem->getIsInStock() !== $childrenIsInStock && + ($childrenIsInStock === false || $parentStockItem->getStockStatusChangedAuto()); + } +} diff --git a/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php b/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php index f1567f2b196de..4ae3efdd6aca8 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php +++ b/app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php @@ -12,8 +12,8 @@ use Magento\CatalogInventory\Api\StockItemCriteriaInterfaceFactory; use Magento\CatalogInventory\Api\StockItemRepositoryInterface; use Magento\CatalogInventory\Api\StockConfigurationInterface; -use Magento\CatalogInventory\Api\Data\StockItemInterface; use Magento\CatalogInventory\Observer\ParentItemProcessorInterface; +use Magento\Framework\App\ObjectManager; /** * Process parent stock item @@ -21,41 +21,27 @@ class ParentItemProcessor implements ParentItemProcessorInterface { /** - * @var Configurable + * @var ChangeParentStockStatus */ - private $configurableType; - - /** - * @var StockItemCriteriaInterfaceFactory - */ - private $criteriaInterfaceFactory; - - /** - * @var StockItemRepositoryInterface - */ - private $stockItemRepository; - - /** - * @var StockConfigurationInterface - */ - private $stockConfiguration; + private $changeParentStockStatus; /** * @param Configurable $configurableType * @param StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory * @param StockItemRepositoryInterface $stockItemRepository * @param StockConfigurationInterface $stockConfiguration + * @param ChangeParentStockStatus|null $changeParentStockStatus + * @SuppressWarnings(PHPMD.UnusedFormalParameter) Deprecated dependencies */ public function __construct( Configurable $configurableType, StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory, StockItemRepositoryInterface $stockItemRepository, - StockConfigurationInterface $stockConfiguration + StockConfigurationInterface $stockConfiguration, + ?ChangeParentStockStatus $changeParentStockStatus = null ) { - $this->configurableType = $configurableType; - $this->criteriaInterfaceFactory = $criteriaInterfaceFactory; - $this->stockItemRepository = $stockItemRepository; - $this->stockConfiguration = $stockConfiguration; + $this->changeParentStockStatus = $changeParentStockStatus + ?? ObjectManager::getInstance()->get(ChangeParentStockStatus::class); } /** @@ -66,64 +52,6 @@ public function __construct( */ public function process(Product $product) { - $parentIds = $this->configurableType->getParentIdsByChild($product->getId()); - foreach ($parentIds as $productId) { - $this->processStockForParent((int)$productId); - } - } - - /** - * Change stock item for parent product depending on children stock items - * - * @param int $productId - * @return void - */ - private function processStockForParent(int $productId) - { - $criteria = $this->criteriaInterfaceFactory->create(); - $criteria->setScopeFilter($this->stockConfiguration->getDefaultScopeId()); - - $criteria->setProductsFilter($productId); - $stockItemCollection = $this->stockItemRepository->getList($criteria); - $allItems = $stockItemCollection->getItems(); - if (empty($allItems)) { - return; - } - $parentStockItem = array_shift($allItems); - - $childrenIds = $this->configurableType->getChildrenIds($productId); - $criteria->setProductsFilter($childrenIds); - $stockItemCollection = $this->stockItemRepository->getList($criteria); - $allItems = $stockItemCollection->getItems(); - - $childrenIsInStock = false; - - foreach ($allItems as $childItem) { - if ($childItem->getIsInStock() === true) { - $childrenIsInStock = true; - break; - } - } - - if ($this->isNeedToUpdateParent($parentStockItem, $childrenIsInStock)) { - $parentStockItem->setIsInStock($childrenIsInStock); - $parentStockItem->setStockStatusChangedAuto(1); - $this->stockItemRepository->save($parentStockItem); - } - } - - /** - * Check is parent item should be updated - * - * @param StockItemInterface $parentStockItem - * @param bool $childrenIsInStock - * @return bool - */ - private function isNeedToUpdateParent( - StockItemInterface $parentStockItem, - bool $childrenIsInStock - ): bool { - return $parentStockItem->getIsInStock() !== $childrenIsInStock && - ($childrenIsInStock === false || $parentStockItem->getStockStatusChangedAuto()); + $this->changeParentStockStatus->execute([$product->getId()]); } } diff --git a/app/code/Magento/ConfigurableProduct/Plugin/Model/Attribute/Backend/AttributeValidation.php b/app/code/Magento/ConfigurableProduct/Plugin/Model/Attribute/Backend/AttributeValidation.php index 4a11137b62af6..842ba25b163a3 100644 --- a/app/code/Magento/ConfigurableProduct/Plugin/Model/Attribute/Backend/AttributeValidation.php +++ b/app/code/Magento/ConfigurableProduct/Plugin/Model/Attribute/Backend/AttributeValidation.php @@ -3,10 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\ConfigurableProduct\Plugin\Model\Attribute\Backend; use Magento\Catalog\Api\Data\ProductInterface; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; +use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; +use Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend; +use Magento\Framework\DataObject; /** * Skip validate attributes used for create configurable product @@ -19,7 +24,6 @@ class AttributeValidation private $configurableProductType; /** - * AttributeValidation constructor. * @param Configurable $configurableProductType */ public function __construct( @@ -29,27 +33,42 @@ public function __construct( } /** - * @param \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend $subject + * Verify is attribute used for configurable product creation and should not be validated. + * + * @param AbstractBackend $subject * @param \Closure $proceed - * @param \Magento\Framework\DataObject $entity + * @param DataObject $entity * @return bool */ public function aroundValidate( - \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend $subject, + AbstractBackend $subject, \Closure $proceed, - \Magento\Framework\DataObject $entity + DataObject $entity ) { $attribute = $subject->getAttribute(); - if ($entity instanceof ProductInterface - && $entity->getTypeId() == Configurable::TYPE_CODE - && in_array( - $attribute->getAttributeId(), - $this->configurableProductType->getUsedProductAttributeIds($entity), - true - ) - ) { + if ($this->isAttributeShouldNotBeValidated($entity, $attribute)) { return true; } return $proceed($entity); } + + /** + * Verify if attribute is a part of configurable product and should not be validated. + * + * @param DataObject $entity + * @param AbstractAttribute $attribute + * @return bool + */ + private function isAttributeShouldNotBeValidated(DataObject $entity, AbstractAttribute $attribute): bool + { + if (!($entity instanceof ProductInterface && $entity->getTypeId() === Configurable::TYPE_CODE)) { + return false; + } + $attributeId = $attribute->getAttributeId(); + $options = $entity->getConfigurableProductOptions() ?: []; + $configurableAttributeIds = array_column($options, 'attribute_id'); + + return in_array($attributeId, $configurableAttributeIds) + || in_array($attributeId, $this->configurableProductType->getUsedProductAttributeIds($entity), true); + } } diff --git a/app/code/Magento/ConfigurableProduct/README.md b/app/code/Magento/ConfigurableProduct/README.md index 68e947abf8a4d..b0cc21d1bc77e 100644 --- a/app/code/Magento/ConfigurableProduct/README.md +++ b/app/code/Magento/ConfigurableProduct/README.md @@ -1,5 +1,44 @@ -Magento_ConfigurableProduct module introduces new product type in the Magento application called Configurable Product. +# Magento_ConfigurableProduct module + +The Magento_ConfigurableProduct module introduces new product type in the Magento application called Configurable Product. This module is designed to extend existing functionality of Magento_Catalog module by adding new product type. Configurable Products let the customers select the variant they desire by choosing options. For example, store owner sells t-shirts in two colors and three sizes. + +## Structure + +`ConfigurableProduct/` - the directory that declares ConfigurableProduct metadata used by the module. + +For information about a typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + +Extension developers can interact with the Magento_ConfigurableProduct module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_ConfigurableProduct module. + +## Additional information + +### Configurable variables through the theme view.xml + +Modify the value of the `gallery_switch_strategy` variable in the theme view.xml file to configure how gallery images should be updated when a user switches between product configurations. + +Learn how to [configure variables](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-images.html#view_xml_vars) in the view.xml file. + +There are two available values for the `gallery_switch_strategy` variable: + +Value | Description +--- | --- +`replace` | In replace mode, images of the parent configurable product will be replaced by the simple product images upon a configuration change +`prepend` | In prepend mode, the simple product images will be added in front of the parent configurable product upon a configuration change + +If the `gallery_switch_strategy` variable is not defined, the default value `replace` will be used. + +For example, adding these lines of code to the theme view.xml file will set the gallery behavior to `replace` mode. + +```xml +<vars module="Magento_ConfigurableProduct"> + <var name="gallery_switch_strategy">replace</var> +</vars> +``` diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminVerifyCurrentVariationsForConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminVerifyCurrentVariationsForConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..f85341da55742 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminVerifyCurrentVariationsForConfigurableProductActionGroup.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminVerifyCurrentVariationsForConfigurableProductActionGroup"> + <annotations> + <description>Verify product data for the specified row in the Configurations Current Variations grid on the + Edit Product page in admin for a Configurable Product.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="Magento_Catalog/images/product/placeholder/thumbnail.jpg" type="string"/> + <argument name="name" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="sku" defaultValue="{{_defaultProduct.sku}}" type="string"/> + <argument name="price" defaultValue="${{_defaultProduct.price}}" type="string"/> + <argument name="quantity" defaultValue="{{_defaultProduct.quantity}}" type="string"/> + <argument name="weight" defaultValue="{{_defaultProduct.weight}}" type="string"/> + <argument name="status" defaultValue="Enabled" type="string"/> + <argument name="attributes" type="string"/> + <argument name="index" defaultValue="1" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminProductFormConfigurationsSection.currentVariationsProductImage(index)}}" stepKey="waitForProductImage"/> + <grabAttributeFrom userInput="src" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductImage(index)}}" stepKey="grabProductImageSrc"/> + <assertStringContainsString stepKey="assertProductImageSrc"> + <expectedResult type="string">{{image}}</expectedResult> + <actualResult type="variable">$grabProductImageSrc</actualResult> + </assertStringContainsString> + <see userInput="{{name}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName(index)}}" stepKey="seeProductName"/> + <see userInput="{{sku}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductSku(index)}}" stepKey="seeProductSku"/> + <see userInput="{{price}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductPrice(index)}}" stepKey="seeProductPrice"/> + <see userInput="{{quantity}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductQuantity(index)}}" stepKey="seeProductQuantity"/> + <see userInput="{{weight}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductWeight(index)}}" stepKey="seeProductWeight"/> + <see userInput="{{status}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductStatus(index)}}" stepKey="seeProductStatus"/> + <see userInput="{{attributes}}" selector="{{AdminProductFormConfigurationsSection.currentVariationsProductAttributes(index)}}" stepKey="seeProductAttributes"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertAdminChildProductDataOnParentProductEditPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertAdminChildProductDataOnParentProductEditPageActionGroup.xml new file mode 100644 index 0000000000000..dc2924b655c3e --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertAdminChildProductDataOnParentProductEditPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminChildProductDataOnParentProductEditPageActionGroup"> + <annotations> + <description>Verify the proper child product data (name, sku, price) is shown on the Configurable Product edit page.</description> + </annotations> + <arguments> + <argument name="attribute" type="string"/> + <argument name="value" type="string"/> + </arguments> + <see selector="{{AdminProductFormConfigurationsSection.currentVariationsCells(attribute)}}" userInput="{{value}}" + stepKey="seeChildProductData"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeLabelVisibleActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeLabelVisibleActionGroup.xml new file mode 100644 index 0000000000000..ea2ea3b12ebab --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeLabelVisibleActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductAttributeLabelVisibleActionGroup"> + <arguments> + <argument name="productAttributeLabel" type="string"/> + </arguments> + <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{productAttributeLabel}}" stepKey="seeProductAttributeLabel"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeOptionVisibleActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeOptionVisibleActionGroup.xml new file mode 100644 index 0000000000000..f90be42e24fc3 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertStorefrontProductAttributeOptionVisibleActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductAttributeOptionVisibleActionGroup"> + <arguments> + <argument name="productAttributeOption" type="string"/> + </arguments> + <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{productAttributeOption}}" stepKey="seeProductAttributeOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml index 87b181616bd7a..f07faf4087c33 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml @@ -16,7 +16,7 @@ <data key="name" unique="suffix">configurable</data> <data key="price">123.00</data> <data key="weight">2</data> - <data key="urlKey" unique="suffix">configurableurlkey</data> + <data key="urlKey" unique="suffix">configurable</data> <data key="status">1</data> <data key="quantity">100</data> <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection/AdminProductFormConfigurationsSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection/AdminProductFormConfigurationsSection.xml index 320b3d575f3c6..264a3d4e75032 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection/AdminProductFormConfigurationsSection.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection/AdminProductFormConfigurationsSection.xml @@ -17,7 +17,17 @@ <element name="currentVariationsPriceCells" type="textarea" selector=".admin__control-fields[data-index='price_container']"/> <element name="currentVariationsQuantityCells" type="textarea" selector=".admin__control-fields[data-index='quantity_container']"/> <element name="currentVariationsAttributesCells" type="textarea" selector=".admin__control-fields[data-index='attributes']"/> + <element name="currentVariationsCells" type="textarea" selector=".admin__control-fields[data-index='{{var}}']" parameterized="true"/> <element name="currentVariationsStatusCells" type="textarea" selector="._no-header[data-index='status']"/> + <element name="currentVariationsAllRows" type="text" selector="[data-index=configurable-matrix] .data-row"/> + <element name="currentVariationsProductImage" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=thumbnail_image_container] img"/> + <element name="currentVariationsProductName" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=name_container]"/> + <element name="currentVariationsProductSku" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=sku_container]"/> + <element name="currentVariationsProductPrice" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=price_container]"/> + <element name="currentVariationsProductQuantity" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=quantity_container]"/> + <element name="currentVariationsProductWeight" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=price_weight]"/> + <element name="currentVariationsProductStatus" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=status]"/> + <element name="currentVariationsProductAttributes" type="text" parameterized="true" selector="[data-index=configurable-matrix] .data-row:nth-of-type({{index}}) td[data-index=attributes]"/> <element name="firstSKUInConfigurableProductsGrid" type="input" selector="//input[@name='configurable-matrix[0][sku]']"/> <element name="actionsBtn" type="button" selector="(//button[@class='action-select']/span[contains(text(), 'Select')])[{{var1}}]" parameterized="true"/> <element name="actionsBtnByProductName" type="textarea" selector="//*[.='Attributes']/ancestor::tr/td[@data-index='attributes']//span[contains(text(), '{{var}}')]/ancestor::tr//button[@class='action-select']" parameterized="true"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml index 4190dafb927e1..07ed24d9bdbc7 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml @@ -108,7 +108,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml index 59da88874f5b2..a17fcf1ddf306 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml @@ -25,6 +25,30 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersConfigurable"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterConfigurable"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterFillSelectFieldActionGroup" stepKey="addTypeFilterConfigurable"> + <argument name="filterName" value="type_id"/> + <argument name="filterValue" value="Configurable Product"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterConfigurable"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteConfigurableProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> @@ -37,35 +61,84 @@ <!-- assert color configurations on the admin create product page --> <dontSee selector="{{AdminProductFormConfigurationsSection.variationLabel}}" stepKey="seeLabelNotVisible"/> <seeNumberOfElements selector="{{AdminProductFormConfigurationsSection.currentVariationsRows}}" userInput="3" stepKey="seeNumberOfRows"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeAttributeName1InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeAttributeName2InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeAttributeName3InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeAttributeSku1InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeAttributeSku2InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeAttributeSku3InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute1.price}}" stepKey="seeUniquePrice1InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute2.price}}" stepKey="seeUniquePrice2InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute3.price}}" stepKey="seeUniquePrice3InField"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsQuantityCells}}" userInput="{{colorProductAttribute.attribute_quantity}}" stepKey="seeQuantityInField"/> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeName1InField"> + <argument name="attribute" value="name_container"/> + <argument name="value" value="{{colorProductAttribute1.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeName2InField"> + <argument name="attribute" value="name_container"/> + <argument name="value" value="{{colorProductAttribute2.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeName3InField"> + <argument name="attribute" value="name_container"/> + <argument name="value" value="{{colorProductAttribute3.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeSku1InField"> + <argument name="attribute" value="sku_container"/> + <argument name="value" value="{{colorProductAttribute1.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeSku2InField"> + <argument name="attribute" value="sku_container"/> + <argument name="value" value="{{colorProductAttribute2.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeAttributeSku3InField"> + <argument name="attribute" value="sku_container"/> + <argument name="value" value="{{colorProductAttribute3.name}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeUniquePrice1InField"> + <argument name="attribute" value="price_container"/> + <argument name="value" value="{{colorProductAttribute1.price}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeUniquePrice2InField"> + <argument name="attribute" value="price_container"/> + <argument name="value" value="{{colorProductAttribute2.price}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeUniquePrice3InField"> + <argument name="attribute" value="price_container"/> + <argument name="value" value="{{colorProductAttribute3.price}}"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeQuantityInField"> + <argument name="attribute" value="quantity_container"/> + <argument name="value" value="{{colorProductAttribute.attribute_quantity}}"/> + </actionGroup> <!-- assert storefront category list page --> - <amOnPage url="/" stepKey="amOnStorefront"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - <click userInput="$$createCategory.name$$" stepKey="clickOnCategoryName"/> - <waitForPageLoad stepKey="waitForPageLoad4"/> - <see userInput="{{_defaultProduct.name}}" stepKey="assertProductPresent"/> - <see userInput="{{colorProductAttribute1.price}}" stepKey="assertProductPricePresent"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="amOnStorefront"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad3"/> + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="clickOnCategoryName"> + <argument name="categoryName" value="$$createCategory.name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad4"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductPresent"> + <argument name="productName" value="{{_defaultProduct.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="assertProductPricePresent"> + <argument name="productName" value="{{_defaultProduct.name}}"/> + <argument name="productPrice" value="{{colorProductAttribute1.price}}"/> + </actionGroup> <!-- assert storefront product details page --> - <click userInput="{{_defaultProduct.name}}" stepKey="clickOnProductName"/> - <waitForPageLoad stepKey="waitForPageLoad5"/> - <seeInTitle userInput="{{_defaultProduct.name}}" stepKey="assertProductNameTitle"/> - <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{colorProductAttribute1.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> - <see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{colorProductAttribute.default_label}}" stepKey="seeColorAttributeName1"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeInDropDown1"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeInDropDown2"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeInDropDown3"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnProductName"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad5"/> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="assertProductNameTitle"> + <argument name="product" value="_defaultProduct"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertProductName"/> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="assertProductPrice"> + <argument name="productPrice" value="{{colorProductAttribute1.price}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertProductSku"/> + <actionGroup ref="AssertStorefrontProductAttributeLabelVisibleActionGroup" stepKey="seeColorAttributeName1"> + <argument name="productAttributeLabel" value="{{colorProductAttribute.default_label}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown1"> + <argument name="productAttributeOption" value="{{colorProductAttribute1.name}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown2"> + <argument name="productAttributeOption" value="{{colorProductAttribute2.name}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown3"> + <argument name="productAttributeOption" value="{{colorProductAttribute3.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml index 4f6407ca4150c..5f7d98e3fa91c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml @@ -158,15 +158,15 @@ <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="0" stepKey="seeNoResults"/> <!-- after delete, assert product pages are 404 --> - <amOnPage url="$$createProduct1.sku$$.html" stepKey="gotoStorefront1"/> + <amOnPage url="$$createProduct1.custom_attributes[url_key]$$.html" stepKey="gotoStorefront1"/> <waitForPageLoad stepKey="waitForProduct1"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops1"/> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createProduct1.name$$" stepKey="dontSeeProduct1"/> - <amOnPage url="$$createProduct1.sku$$.html" stepKey="gotoStorefront2"/> + <amOnPage url="$$createProduct1.custom_attributes[url_key]$$.html" stepKey="gotoStorefront2"/> <waitForPageLoad stepKey="waitForProduct2"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops2"/> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createProduct1.name$$" stepKey="dontSeeProduct2"/> - <amOnPage url="$$createProduct1.sku$$.html" stepKey="gotoStorefront3"/> + <amOnPage url="$$createProduct1.custom_attributes[url_key]$$.html" stepKey="gotoStorefront3"/> <waitForPageLoad stepKey="waitForProduct3"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops3"/> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createProduct1.name$$" stepKey="dontSeeProduct3"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml index 186752fd52684..56f74e4ff1fcd 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml @@ -75,7 +75,7 @@ </after> <!-- assert product visible in storefront --> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="gotoStorefront1"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="gotoStorefront1"/> <waitForPageLoad stepKey="wait1"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProduct"/> @@ -94,7 +94,7 @@ <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="seeSuccessMsg"/> <!-- after delete, assert product page is 404 --> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="gotoStorefront2"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="gotoStorefront2"/> <waitForPageLoad stepKey="wait3"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="dontSeeProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml index 0da4c265a73af..80efad157e87f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml @@ -35,6 +35,6 @@ </actionGroup> <!--Checking content storefront--> - <amOnPage url="{{BaseConfigurableProduct.name}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{BaseConfigurableProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml index 854cfb98607a7..4ef63ba348875 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml @@ -25,6 +25,30 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersConfigurable"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterConfigurable"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterFillSelectFieldActionGroup" stepKey="addTypeFilterConfigurable"> + <argument name="filterName" value="type_id"/> + <argument name="filterValue" value="Configurable Product"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterConfigurable"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteConfigurableProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml index 345b21246f30f..7fa4cc5006cb4 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml @@ -75,7 +75,7 @@ </after> <!--check storefront for both options--> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="amOnStorefront1"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="amOnStorefront1"/> <waitForPageLoad stepKey="wait1"/> <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="seeOption1Storefront"/> <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Storefront"/> @@ -91,7 +91,7 @@ <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/> <!--check storefront for one option--> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="amOnStorefront2"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="amOnStorefront2"/> <waitForPageLoad stepKey="wait4"/> <dontSee selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="dontSeeOption1InStorefront"/> <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Again"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml index ec0ed623d2b0c..9b61427274fcb 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml @@ -75,10 +75,16 @@ </after> <!--check storefront for both options--> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="amOnStorefront1"/> - <waitForPageLoad stepKey="wait1"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="seeOption1Storefront"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Storefront"/> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnStorefront1"> + <argument name="product" value="$createConfigProduct$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption1Storefront"> + <argument name="productAttributeOption" value="option1"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption2Storefront"> + <argument name="productAttributeOption" value="option2"/> + </actionGroup> <!--check admin for both options--> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> @@ -86,8 +92,14 @@ <argument name="productId" value="$$createConfigProduct.id$$"/> </actionGroup> <waitForPageLoad stepKey="wait2"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct1.name$$" stepKey="seeOption1Admin"/> - <see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct2.name$$" stepKey="seeOption2Admin"/> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeOption1Admin"> + <argument name="attribute" value="name_container"/> + <argument name="value" value="$$createConfigChildProduct1.name$$"/> + </actionGroup> + <actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeOption2Admin"> + <argument name="attribute" value="name_container"/> + <argument name="value" value="$$createConfigChildProduct2.name$$"/> + </actionGroup> <!--remove an option--> <click selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="clickToExpandActions"/> @@ -98,9 +110,13 @@ <dontSee selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct1.name$$" stepKey="dontSeeOption1Admin"/> <!--check storefront for one option--> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="amOnStorefront2"/> - <waitForPageLoad stepKey="wait4"/> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnStorefront2"> + <argument name="product" value="$createConfigProduct$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait4"/> <dontSee selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="dontSeeOption1InStorefront"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Again"/> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption2Again"> + <argument name="productAttributeOption" value="option2"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml index 75fbaa7f43887..3016ef4add007 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml @@ -28,6 +28,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProductFilteredBySkuAndName"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFiltersOnProductIndexPage"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> <!-- Reindex invalidated indices after product attribute has been created/deleted --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml index 924707a16600f..775ffe1cf1ad8 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml @@ -29,6 +29,7 @@ <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters" after="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml index 796a4628393bb..ef32b401fe09a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml @@ -51,7 +51,7 @@ <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{BaseConfigurableProduct.sku}}"/> + <argument name="productUrl" value="{{BaseConfigurableProduct.urlKey}}"/> </actionGroup> <!-- Assert product design settings "left bar is present at product page with 2 columns" --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml index c285287130aca..cce127f10ef10 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml @@ -98,13 +98,10 @@ <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert configurable product in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml index d210f90779d99..760b6a92d1691 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml @@ -107,13 +107,10 @@ <!-- Display out of stock product --> <actionGroup ref="DisplayOutOfStockProductActionGroup" stepKey="displayOutOfStockProduct"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Assert configurable product is not present in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml index 4984d296df5d0..2589d56cbbe55 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml @@ -134,7 +134,7 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Assert configurable product in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml index 4afc95f9a6355..7a5744dc00489 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml @@ -123,13 +123,10 @@ <!-- Display out of stock product --> <actionGroup ref="DisplayOutOfStockProductActionGroup" stepKey="displayOutOfStockProduct"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert configurable product in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml index ad634ed0144ae..361d7b4500ab9 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml @@ -119,13 +119,10 @@ <!-- Save configurable product --> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert configurable product in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml index 2fcf9a622a97f..048183e7df24d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml @@ -108,13 +108,10 @@ </actionGroup> <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert configurable product in category --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml index b562c8ab6fb1a..07118a0cc2aff 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml @@ -98,10 +98,7 @@ </actionGroup> <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - <!-- Flash cache --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Assert configurable product on product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithVideoAssociatedToVariantTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithVideoAssociatedToVariantTest.xml index 0eb730bf91afc..f541751db7e3a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithVideoAssociatedToVariantTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithVideoAssociatedToVariantTest.xml @@ -114,7 +114,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml index 1a6d802987cd3..7eef88f7317a0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml @@ -33,7 +33,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!-- Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createConfigurableProduct.name$$)}}" stepKey="amOnConfigurableProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createConfigurableProduct.custom_attributes[url_key]$$)}}" stepKey="amOnConfigurableProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchBarByProductSku"> @@ -43,7 +43,7 @@ <dontSee userInput="$$createConfigurableProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createConfigurableProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminConfigurableProductTypeSwitchingToVirtualProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminConfigurableProductTypeSwitchingToVirtualProductTest.xml index f287aca332b48..4243cffea72ea 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminConfigurableProductTypeSwitchingToVirtualProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminConfigurableProductTypeSwitchingToVirtualProductTest.xml @@ -43,7 +43,7 @@ <seeElement selector="{{AdminProductGridSection.productRowByTypeAndName('Virtual Product',$createProduct.name$)}}" stepKey="seeVirtualProductInGrid"/> <!--Assert virtual product on storefront--> <comment userInput="Assert virtual product on storefront" stepKey="commentAssertVirtualProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($createProduct.name$)}}" stepKey="openVirtualProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="openVirtualProductPage"/> <waitForPageLoad stepKey="waitForStorefrontVirtualProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertVirtualProductInStock"/> </test> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml index f3b79765f746d..d59a3f603df9f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml @@ -70,7 +70,7 @@ <seeElement selector="{{AdminProductGridSection.productRowByTypeAndName('Simple Product',$createProduct.name$-option2)}}" stepKey="seeSimpleProduct2NameInGrid"/> <!--Assert configurable product on storefront--> <comment userInput="Assert configurable product on storefront" stepKey="commentAssertConfigProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($createProduct.name$)}}" stepKey="openProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="openProductPage"/> <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> <click selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="clickAttributeDropDown"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml index bb5baf33d95fb..89084a0c4d46f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml @@ -87,7 +87,7 @@ <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearConfigurableProductFilters"/> <!--Assert configurable product on storefront--> <comment userInput="Assert configurable product on storefront" stepKey="commentAssertConfigurableProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="openConfigurableProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="openConfigurableProductPage"/> <waitForPageLoad stepKey="waitForStorefrontConfigurableProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertConfigurableProductInStock"/> <click selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="clickConfigurableAttributeDropDown"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 1b8dffbd3ac68..fc8a521ebc5c0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -79,9 +79,7 @@ <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAll"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <!-- Verify Configurable Product in checkout cart items --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml index 10d8aeb875742..328984e973d5c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml @@ -32,9 +32,16 @@ <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" - dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" - stepKey="clickClearFilters"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clickClearFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index 4baceead08a07..1a2972437e357 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -21,7 +21,7 @@ <group value="ConfigurableProduct"/> <skip> <issueId value="DEPRECATED">Use AdminCheckProductQtyAfterOrderCancellingTest instead</issueId> - </skip> + </skip> </annotations> <before> @@ -47,7 +47,7 @@ <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="changeProductQuantity"/> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveChanges"/> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="navigateToProductPage"/> + <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="4" stepKey="fillQuantity"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchConfigurableBySkuWithHyphenTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchConfigurableBySkuWithHyphenTest.xml index f26a8d611c56f..b7ab7323904c5 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchConfigurableBySkuWithHyphenTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchConfigurableBySkuWithHyphenTest.xml @@ -15,12 +15,9 @@ <title value="Guest customer should be able to advance search configurable product with product sku that contains hyphen"/> <description value="Guest customer should be able to advance search configurable product with product sku that contains hyphen"/> <severity value="MAJOR"/> - <testCaseId value="MC-20389"/> + <testCaseId value="MC-28817"/> <group value="ConfigurableProduct"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> <createData entity="SimpleSubCategory" stepKey="categoryHandle" before="simple1Handle"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml index ca3065c13ea67..a87b9bec99e86 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml @@ -145,9 +145,7 @@ </after> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAll"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Quick search the storefront for the first attribute option --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml index 317563a468d74..99b4cf5d4c3a5 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml @@ -33,22 +33,49 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!-- Verify configurable product details in storefront product view --> - <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> - <waitForPageLoad stepKey="wait"/> - <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/> - <see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeProductSku"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="amOnConfigurableProductPage"> + <argument name="productUrl" value="{{_defaultProduct.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait"/> + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductName"> + <argument name="productName" value="{{_defaultProduct.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSku"> + <argument name="productSku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <see userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="seeProductPriceLabel"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="seeProductStockStatus"/> - <see userInput="1.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice"/> - <see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeProductAttributeTitle"/> - <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{colorProductAttribute.default_label}}" stepKey="seeColorAttributeName1"/> - <see userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown1"/> - <see userInput="{{colorProductAttribute2.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown2"/> - <see userInput="{{colorProductAttribute3.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeInDropDown3"/> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStockStatus"> + <argument name="productStockStatus" value="In Stock"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeProductPrice"> + <argument name="productPrice" value="1.00"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeLabelVisibleActionGroup" stepKey="seeProductAttributeTitle"> + <argument name="productAttributeLabel" value="{{colorProductAttribute.default_label}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeColorAttributeName1"/> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown1"> + <argument name="productAttributeOption" value="{{colorProductAttribute1.name}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown2"> + <argument name="productAttributeOption" value="{{colorProductAttribute2.name}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown3"> + <argument name="productAttributeOption" value="{{colorProductAttribute3.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml index 9fc6dce10c21a..f0acc3834f7a6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml @@ -33,6 +33,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml index 01859f995b00b..13568701ecc6e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml @@ -33,6 +33,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml index 1aef8c33785ca..8bc3d21bb58f8 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml @@ -33,6 +33,15 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml index 238f1e107c11b..440899eb6fd4b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml @@ -31,11 +31,35 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersConfigurable"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterConfigurable"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterFillSelectFieldActionGroup" stepKey="addTypeFilterConfigurable"> + <argument name="filterName" value="type_id"/> + <argument name="filterValue" value="Configurable Product"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterConfigurable"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteConfigurableProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!-- Should be taken to product details page when adding to cart because an option needs to be selected --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="amOnCategoryPage1"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage1"/> <waitForPageLoad stepKey="wait1"/> <click selector="{{StorefrontCategoryMainSection.modeListButton}}" stepKey="clickListView"/> <waitForPageLoad stepKey="wait2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml index 81a083c5da068..146b40784fb90 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml @@ -26,11 +26,8 @@ <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> - <!-- TODO: REMOVE AFTER FIX MC-21717 --> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="eav"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> @@ -38,11 +35,21 @@ <actionGroup stepKey="deleteProduct" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!-- Verify the storefront category grid view --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="amOnCategoryPage1"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage1"/> <waitForPageLoad stepKey="wait1"/> <seeElement selector="{{StorefrontCategoryMainSection.productImage}}" stepKey="seePhoto"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{_defaultProduct.name}}" stepKey="seeName"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml index 619e50acba848..7e4045ca2967b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml @@ -31,11 +31,35 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersConfigurable"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterConfigurable"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterFillSelectFieldActionGroup" stepKey="addTypeFilterConfigurable"> + <argument name="filterName" value="type_id"/> + <argument name="filterValue" value="Configurable Product"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterConfigurable"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteConfigurableProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!-- Verify storefront category list view --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="amOnCategoryPage1"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage1"/> <waitForPageLoad stepKey="wait1"/> <click selector="{{StorefrontCategoryMainSection.modeListButton}}" stepKey="clickListView"/> <waitForPageLoad stepKey="wait2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductMSRPCovertTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductMSRPCovertTest.xml index 9526e8568b26d..54d131ce73270 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductMSRPCovertTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductMSRPCovertTest.xml @@ -98,10 +98,7 @@ <actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setAdvancedPricingSecond"> <argument name="advancedPrice" value="100"/> </actionGroup> - - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProduct"> <argument name="productUrlKey" value="$$createConfigProduct.custom_attributes[url_key]$$"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml index d9ad32df872f7..742b67d2a6918 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml @@ -25,6 +25,30 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersConfigurable"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterConfigurable"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{BaseConfigurableProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterFillSelectFieldActionGroup" stepKey="addTypeFilterConfigurable"> + <argument name="filterName" value="type_id"/> + <argument name="filterValue" value="Configurable Product"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterConfigurable"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteConfigurableProduct"> + <argument name="sku" value="{{BaseConfigurableProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{BaseConfigurableProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{BaseConfigurableProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index 14ce1fe71281b..c4f23dfebf5e7 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -122,7 +122,7 @@ <fillField selector="{{AdminProductFormSection.productName}}" userInput="$$createConfigProduct.name$$-Updated" stepKey="fillProductName"/> <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectInStock"> <argument name="stockStatus" value="In Stock"/> - </actionGroup> + </actionGroup> <!--Change product image--> <comment userInput="Change product image" stepKey="commentChangeProductImage"/> <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> @@ -195,17 +195,15 @@ <waitForPageLoad stepKey="waitForDuplicatedProductPageLoad"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDuplicatedProduct"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert configurable product in category--> <comment userInput="Assert configurable product in category" stepKey="commentAssertProductInCategoryPage"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onStorefrontCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$-Updated)}}" stepKey="assertProductNameInCategoryPage"/> <!--Assert product options in Storefront product page--> <comment userInput="Assert product options in Storefront product page" stepKey="commentAssertProductOptions"/> - <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.sku$$-1)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$-1)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoadOnStorefront"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$-Updated" stepKey="seeConfigurableProductName"/> <see userInput="{{productAttributeColor.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeColorAttributeName"/> diff --git a/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns.php b/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns.php index 2ca46b4e67288..f971dbe870adb 100644 --- a/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns.php +++ b/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns.php @@ -12,6 +12,11 @@ class Columns extends \Magento\Ui\Component\Listing\Columns */ protected $attributeRepository; + /** + * @var \Magento\Catalog\Ui\Component\ColumnFactory + */ + private $columnFactory; + /** * @param \Magento\Framework\View\Element\UiComponent\ContextInterface $context * @param \Magento\Catalog\Ui\Component\ColumnFactory $columnFactory diff --git a/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns/Price.php b/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns/Price.php index 1433a3736263b..14cbcf4f755fe 100644 --- a/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns/Price.php +++ b/app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Columns/Price.php @@ -20,6 +20,11 @@ class Price extends \Magento\Ui\Component\Listing\Columns\Column */ protected $localeCurrency; + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + private $storeManager; + /** * @param ContextInterface $context * @param UiComponentFactory $uiComponentFactory diff --git a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Attributes.php b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Attributes.php index 04db96bc158d1..0104dff342cce 100644 --- a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Attributes.php +++ b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Attributes.php @@ -13,6 +13,11 @@ class Attributes extends \Magento\Ui\DataProvider\AbstractDataProvider */ protected $collection; + /** + * @var \Magento\ConfigurableProduct\Model\ConfigurableAttributeHandler + */ + private $configurableAttributeHandler; + /** * @param string $name * @param string $primaryFieldName diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml index 6cd930978c85f..11ee28d28015c 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /* @var $block \Magento\ConfigurableProduct\Block\Adminhtml\Product\Steps\Bulk */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/matrix.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/matrix.phtml index 73067fdee3b84..dcff7a579a0a4 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/matrix.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/matrix.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Variations\Config\Matrix */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> diff --git a/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/tier_price.phtml b/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/tier_price.phtml index 7ce1fd2ccb451..fc4ad86f8bdad 100644 --- a/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/tier_price.phtml +++ b/app/code/Magento/ConfigurableProduct/view/base/templates/product/price/tier_price.phtml @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <script type="text/x-magento-template" id="tier-prices-template"> <ul class="prices-tier items"> diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js index 00030be74324f..85d9bfc06bcd8 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js +++ b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js @@ -578,7 +578,7 @@ define([ _.each(elements, function (element) { var selected = element.options[element.selectedIndex], config = selected && selected.config, - priceValue = {}; + priceValue = this._calculatePrice({}); if (config && config.allowedProducts.length === 1) { priceValue = this._calculatePrice(config); @@ -632,12 +632,10 @@ define([ */ _calculatePrice: function (config) { var displayPrices = $(this.options.priceHolderSelector).priceBox('option').prices, - newPrices = this.options.spConfig.optionPrices[_.first(config.allowedProducts)]; + newPrices = this.options.spConfig.optionPrices[_.first(config.allowedProducts)] || {}; _.each(displayPrices, function (price, code) { - if (newPrices[code]) { - displayPrices[code].amount = newPrices[code].amount - displayPrices[code].amount; - } + displayPrices[code].amount = newPrices[code] ? newPrices[code].amount - displayPrices[code].amount : 0; }); return displayPrices; diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php index 0fa4b8da50817..daf5fffed1105 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php @@ -93,7 +93,7 @@ public function execute(array $cartItemData): array throw new GraphQlNoSuchEntityException(__('Could not find specified product.')); } - $this->checkProductStock($sku, (float) $qty, (int) $cart->getStoreId()); + $this->checkProductStock($sku, (float) $qty, (int) $cart->getStore()->getWebsite()->getId()); $configurableProductLinks = $parentProduct->getExtensionAttributes()->getConfigurableProductLinks(); if (!in_array($product->getId(), $configurableProductLinks)) { diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Option.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Option.php new file mode 100644 index 0000000000000..68968b6f3819a --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Option.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Formatter; + +use Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute; +use Magento\Framework\GraphQl\Query\Uid; + +/** + * Formatter for configurable product options + */ +class Option +{ + /** + * @var Uid + */ + private $idEncoder; + + /** + * @var OptionValue + */ + private $valueFormatter; + + /** + * @param Uid $idEncoder + * @param OptionValue $valueFormatter + */ + public function __construct( + Uid $idEncoder, + OptionValue $valueFormatter + ) { + $this->idEncoder = $idEncoder; + $this->valueFormatter = $valueFormatter; + } + + /** + * Format configurable product options according to the GraphQL schema + * + * @param Attribute $attribute + * @param array $optionIds + * @return array|null + */ + public function format(Attribute $attribute, array $optionIds): ?array + { + $optionValues = []; + + foreach ($attribute->getOptions() as $option) { + $optionValues[] = $this->valueFormatter->format($option, $attribute, $optionIds); + } + + return [ + 'uid' => $this->idEncoder->encode($attribute->getProductSuperAttributeId()), + 'attribute_code' => $attribute->getProductAttribute()->getAttributeCode(), + 'label' => $attribute->getLabel(), + 'values' => $optionValues, + ]; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/OptionValue.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/OptionValue.php new file mode 100644 index 0000000000000..5d721f13fbb9d --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/OptionValue.php @@ -0,0 +1,83 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Formatter; + +use Magento\CatalogInventory\Model\StockRegistry; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute; +use Magento\ConfigurableProductGraphQl\Model\Options\SelectionUidFormatter; + +/** + * Formatter for configurable product option values + */ +class OptionValue +{ + /** + * @var SelectionUidFormatter + */ + private $selectionUidFormatter; + + /** + * @var StockRegistry + */ + private $stockRegistry; + + /** + * @param SelectionUidFormatter $selectionUidFormatter + * @param StockRegistry $stockRegistry + */ + public function __construct( + SelectionUidFormatter $selectionUidFormatter, + StockRegistry $stockRegistry + ) { + $this->selectionUidFormatter = $selectionUidFormatter; + $this->stockRegistry = $stockRegistry; + } + + /** + * Format configurable product option values according to the GraphQL schema + * + * @param array $optionValue + * @param Attribute $attribute + * @param array $optionIds + * @return array + */ + public function format(array $optionValue, Attribute $attribute, array $optionIds): array + { + $valueIndex = (int)$optionValue['value_index']; + $attributeId = (int)$attribute->getAttributeId(); + + return [ + 'uid' => $this->selectionUidFormatter->encode( + $attributeId, + $valueIndex + ), + 'is_available' => $this->getIsAvailable($optionIds[$valueIndex] ?? []), + 'is_use_default' => (bool)$attribute->getIsUseDefault(), + 'label' => $optionValue['label'], + 'value_index' => $optionValue['value_index'] + ]; + } + + /** + * Get is variants available + * + * @param array $variantIds + * @return bool + */ + private function getIsAvailable(array $variantIds): bool + { + foreach ($variantIds as $variantId) { + if ($this->stockRegistry->getProductStockStatus($variantId)) { + return true; + } + } + + return false; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Variant.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Variant.php new file mode 100644 index 0000000000000..1d73ad6a19336 --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Formatter/Variant.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Formatter; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; + +/** + * Formatter for configurable product variant + */ +class Variant +{ + /** + * Format selected variant of configurable product based on selected options + * + * @param array $options + * @param array $selectedOptions + * @param array $variants + * @return array|null + * @throws GraphQlInputException + */ + public function format(array $options, array $selectedOptions, array $variants): ?array + { + $variant = null; + $productIds = array_keys($variants); + + foreach ($selectedOptions as $attributeId => $selectedValue) { + if (!isset($options[$attributeId][$selectedValue])) { + throw new GraphQlInputException(__('configurableOptionValueUids values are incorrect')); + } + + $productIds = array_intersect($productIds, $options[$attributeId][$selectedValue]); + } + + if (count($productIds) === 1) { + $variantProduct = $variants[array_pop($productIds)]; + $variant = $variantProduct->getData(); + $variant['url_path'] = $variantProduct->getProductUrl(); + $variant['model'] = $variantProduct; + } + + return $variant; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/ConfigurableOptionsMetadata.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/ConfigurableOptionsMetadata.php new file mode 100644 index 0000000000000..ce81e970bcd58 --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/ConfigurableOptionsMetadata.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Options; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\ConfigurableProduct\Helper\Data; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute; +use Magento\ConfigurableProductGraphQl\Model\Formatter\Option; + +/** + * Retrieve metadata for configurable option selection. + */ +class ConfigurableOptionsMetadata +{ + /** + * @var Data + */ + private $configurableProductHelper; + + /** + * @var Option + */ + private $configurableOptionsFormatter; + + /** + * @param Data $configurableProductHelper + * @param Option $configurableOptionsFormatter + */ + public function __construct( + Data $configurableProductHelper, + Option $configurableOptionsFormatter + ) { + $this->configurableProductHelper = $configurableProductHelper; + $this->configurableOptionsFormatter = $configurableOptionsFormatter; + } + + /** + * Load available selections from configurable options and variant. + * + * @param ProductInterface $product + * @param array $options + * @param array $selectedOptions + * @return array + */ + public function getAvailableSelections(ProductInterface $product, array $options, array $selectedOptions): array + { + $attributes = $this->getAttributes($product); + $availableSelections = []; + + foreach ($options as $attributeId => $option) { + if ($attributeId === 'index' || isset($selectedOptions[$attributeId])) { + continue; + } + + $availableSelections[] = $this->configurableOptionsFormatter->format( + $attributes[$attributeId], + $options[$attributeId] ?? [] + ); + } + + return $availableSelections; + } + + /** + * Retrieve configurable attributes for the product + * + * @param ProductInterface $product + * @return Attribute[] + */ + private function getAttributes(ProductInterface $product): array + { + $allowedAttributes = $this->configurableProductHelper->getAllowAttributes($product); + $attributes = []; + foreach ($allowedAttributes as $attribute) { + $attributes[$attribute->getAttributeId()] = $attribute; + } + + return $attributes; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/DataProvider/Variant.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/DataProvider/Variant.php index 80fbdc76bacb3..7b5a3fb806a5f 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/DataProvider/Variant.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/DataProvider/Variant.php @@ -10,6 +10,7 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\CatalogInventory\Model\ResourceModel\Stock\StatusFactory; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; +use Magento\Framework\Exception\LocalizedException; /** * Retrieve child products @@ -45,7 +46,7 @@ public function __construct( * @return ProductInterface[] * @throws \Magento\Framework\Exception\LocalizedException */ - public function getSalableVariantsByParent(ProductInterface $product) + public function getSalableVariantsByParent(ProductInterface $product): array { $collection = $this->configurableType->getUsedProductCollection($product); $collection @@ -62,6 +63,6 @@ public function getSalableVariantsByParent(ProductInterface $product) } $collection->clear(); - return $collection->getItems(); + return $collection->getItems() ?? []; } } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/SelectionUidFormatter.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/SelectionUidFormatter.php index 1d13ad75489a1..8c82c9414763f 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Options/SelectionUidFormatter.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Options/SelectionUidFormatter.php @@ -3,8 +3,12 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\ConfigurableProductGraphQl\Model\Options; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Uid; + /** * Handle option selection uid. */ @@ -20,6 +24,19 @@ class SelectionUidFormatter */ private const UID_SEPARATOR = '/'; + /** + * @var Uid + */ + private $idEncoder; + + /** + * @param Uid $idEncoder + */ + public function __construct(Uid $idEncoder) + { + $this->idEncoder = $idEncoder; + } + /** * Create uid and encode. * @@ -29,28 +46,22 @@ class SelectionUidFormatter */ public function encode(int $attributeId, int $indexId): string { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - return base64_encode(implode(self::UID_SEPARATOR, [ - self::UID_PREFIX, - $attributeId, - $indexId - ])); + return $this->idEncoder->encode(implode(self::UID_SEPARATOR, [self::UID_PREFIX, $attributeId, $indexId])); } /** * Retrieve attribute and option index from uid. Array key is the id of attribute and value is the index of option * - * @param string $selectionUids + * @param array $selectionUids * @return array - * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @throws GraphQlInputException */ public function extract(array $selectionUids): array { $attributeOption = []; foreach ($selectionUids as $uid) { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $optionData = explode(self::UID_SEPARATOR, base64_decode($uid)); - if (count($optionData) == 3) { + $optionData = explode(self::UID_SEPARATOR, $this->idEncoder->decode($uid)); + if (count($optionData) === 3) { $attributeOption[(int)$optionData[1]] = (int)$optionData[2]; } } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/OptionsSelectionMetadata.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/OptionsSelectionMetadata.php index f7d5a96ad2aba..556aab7e39f7d 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/OptionsSelectionMetadata.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/OptionsSelectionMetadata.php @@ -3,17 +3,23 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\ConfigurableProductGraphQl\Model\Resolver; -use Magento\Catalog\Api\Data\ProductInterface; +use Magento\ConfigurableProduct\Helper\Data; +use Magento\ConfigurableProductGraphQl\Model\Formatter\Variant as VariantFormatter; +use Magento\ConfigurableProductGraphQl\Model\Options\ConfigurableOptionsMetadata; +use Magento\ConfigurableProductGraphQl\Model\Options\DataProvider\Variant; use Magento\ConfigurableProductGraphQl\Model\Options\Metadata; +use Magento\ConfigurableProductGraphQl\Model\Options\SelectionUidFormatter; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; /** - * Resolver class for option selection metadata. + * Resolver for options selection */ class OptionsSelectionMetadata implements ResolverInterface { @@ -22,13 +28,53 @@ class OptionsSelectionMetadata implements ResolverInterface */ private $configurableSelectionMetadata; + /** + * @var ConfigurableOptionsMetadata + */ + private $configurableOptionsMetadata; + + /** + * @var SelectionUidFormatter + */ + private $selectionUidFormatter; + + /** + * @var Variant + */ + private $variant; + + /** + * @var VariantFormatter + */ + private $variantFormatter; + + /** + * @var Data + */ + private $configurableProductHelper; + /** * @param Metadata $configurableSelectionMetadata + * @param ConfigurableOptionsMetadata $configurableOptionsMetadata + * @param SelectionUidFormatter $selectionUidFormatter + * @param Variant $variant + * @param VariantFormatter $variantFormatter + * @param Data $configurableProductHelper */ public function __construct( - Metadata $configurableSelectionMetadata + Metadata $configurableSelectionMetadata, + ConfigurableOptionsMetadata $configurableOptionsMetadata, + SelectionUidFormatter $selectionUidFormatter, + Variant $variant, + VariantFormatter $variantFormatter, + Data $configurableProductHelper ) { $this->configurableSelectionMetadata = $configurableSelectionMetadata; + $this->configurableOptionsMetadata = $configurableOptionsMetadata; + $this->selectionUidFormatter = $selectionUidFormatter; + $this->variant = $variant; + $this->variantFormatter = $variantFormatter; + $this->configurableProductHelper = $configurableProductHelper; } /** @@ -40,10 +86,31 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value throw new LocalizedException(__('"model" value should be specified')); } - $selectedOptions = $args['selectedConfigurableOptionValues'] ?? []; - /** @var ProductInterface $product */ $product = $value['model']; - return $this->configurableSelectionMetadata->getAvailableSelections($product, $selectedOptions); + $selectionUids = $args['configurableOptionValueUids'] ?? []; + $selectedOptions = $this->selectionUidFormatter->extract($selectionUids); + + $variants = $this->variant->getSalableVariantsByParent($product); + $options = $this->configurableProductHelper->getOptions($product, $variants); + + $configurableOptions = $this->configurableOptionsMetadata->getAvailableSelections( + $product, + $options, + $selectedOptions + ); + + $optionsAvailableForSelection = $this->configurableSelectionMetadata->getAvailableSelections( + $product, + $args['configurableOptionValueUids'] ?? [] + ); + + return [ + 'configurable_options' => $configurableOptions, + 'variant' => $this->variantFormatter->format($options, $selectedOptions, $variants), + 'model' => $product, + 'options_available_for_selection' => $optionsAvailableForSelection['options_available_for_selection'], + 'availableSelectionProducts' => $optionsAvailableForSelection['availableSelectionProducts'] + ]; } } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ProductResolver.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ProductResolver.php new file mode 100644 index 0000000000000..38662c86964d4 --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ProductResolver.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Resolver; + +use Magento\Catalog\Model\Product\Configuration\Item\ItemResolverInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; + +/** + * Fetches the Product data according to the GraphQL schema + */ +class ProductResolver implements ResolverInterface +{ + /** + * @var ItemResolverInterface + */ + private $configurableItemResolver; + + /** + * @param ItemResolverInterface $configurableItemResolver + */ + public function __construct(ItemResolverInterface $configurableItemResolver) + { + $this->configurableItemResolver = $configurableItemResolver; + } + + /** + * @inheritdoc + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + if (!isset($value['model'])) { + throw new LocalizedException(__('"model" value should be specified')); + } + + $product = $this->configurableItemResolver->getFinalProduct($value['model']); + $productData = $product->toArray(); + $productData['model'] = $product; + return $productData; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/SelectionMediaGallery.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/SelectionMediaGallery.php index 7b3ddc4ac1417..972e4a9fd629a 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/SelectionMediaGallery.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/SelectionMediaGallery.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\ConfigurableProductGraphQl\Model\Resolver; use Magento\Framework\GraphQl\Config\Element\Field; @@ -19,19 +21,21 @@ class SelectionMediaGallery implements ResolverInterface */ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) { - if (!isset($value['product']) || !$value['product']) { + if (!isset($value['model']) || !$value['model']) { return null; } - $product = $value['product']; + $product = $value['model']; $availableSelectionProducts = $value['availableSelectionProducts']; $mediaGalleryEntries = []; $usedProducts = $product->getTypeInstance()->getUsedProducts($product, null); foreach ($usedProducts as $usedProduct) { if (in_array($usedProduct->getId(), $availableSelectionProducts)) { foreach ($usedProduct->getMediaGalleryEntries() ?? [] as $key => $entry) { - $index = $usedProduct->getId() . '_' . $key; - $mediaGalleryEntries[$index] = $entry->getData(); + $entryData = $entry->getData(); + $initialIndex = $usedProduct->getId() . '_' . $key; + $index = $this->prepareIndex($entryData, $initialIndex); + $mediaGalleryEntries[$index] = $entryData; $mediaGalleryEntries[$index]['model'] = $usedProduct; if ($entry->getExtensionAttributes() && $entry->getExtensionAttributes()->getVideoContent()) { $mediaGalleryEntries[$index]['video_content'] @@ -42,4 +46,26 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } return $mediaGalleryEntries; } + + /** + * Formulate an index to have unique set of media entries + * + * @param array $entryData + * @param string $initialIndex + * @return string + */ + private function prepareIndex(array $entryData, string $initialIndex) : string + { + $index = $initialIndex; + if (isset($entryData['media_type'])) { + $index = $entryData['media_type']; + } + if (isset($entryData['file'])) { + $index = $index.'_'.$entryData['file']; + } + if (isset($entryData['position'])) { + $index = $index.'_'.$entryData['position']; + } + return $index; + } } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Plugin/Product/Configuration/Item/ItemResolver.php b/app/code/Magento/ConfigurableProductGraphQl/Plugin/Product/Configuration/Item/ItemResolver.php new file mode 100644 index 0000000000000..96e92c8039ea0 --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Plugin/Product/Configuration/Item/ItemResolver.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Plugin\Product\Configuration\Item; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface; +use Magento\ConfigurableProduct\Model\Product\Configuration\Item\ItemProductResolver; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable; + +/** + * Plugin for item resolver + */ +class ItemResolver +{ + /** + * After plugin for final product + * + * @param ItemProductResolver $subject + * @param $result + * @param ItemInterface $item + * @return ProductInterface + */ + public function afterGetFinalProduct(ItemProductResolver $subject, $result, ItemInterface $item): ProductInterface + { + if ($result->getTypeId() === Configurable::TYPE_CODE) { + $option = $item->getOptionByCode('simple_product'); + $result = $option ? $option->getProduct() : $item->getProduct(); + } + + return $result; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml b/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml index 227817b3887ba..06206e35712ad 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml @@ -59,4 +59,15 @@ </argument> </arguments> </type> + + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="configurable_product_type_resolver" xsi:type="object">Magento\ConfigurableProductGraphQl\Model\ConfigurableProductTypeResolver</item> + </argument> + </arguments> + </type> + <type name="Magento\ConfigurableProduct\Model\Product\Configuration\Item\ItemProductResolver"> + <plugin name="configured_variant" type="Magento\ConfigurableProductGraphQl\Plugin\Product\Configuration\Item\ItemResolver"/> + </type> </config> diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls index fc177557906ee..03fae0d34525d 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls @@ -4,10 +4,10 @@ type Mutation { addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput): AddConfigurableProductsToCartOutput @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\AddConfigurableProductsToCart") } -type ConfigurableProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "ConfigurableProduct defines basic features of a configurable product and its simple product variants") { +type ConfigurableProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "ConfigurableProduct defines basic features of a configurable product and its simple product variants") { variants: [ConfigurableVariant] @doc(description: "An array of variants of products") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableVariant") configurable_options: [ConfigurableProductOptions] @doc(description: "An array of linked simple product items") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Options") - configurable_options_selection_metadata(selectedConfigurableOptionValues: [ID!]): ConfigurableOptionsSelectionMetadata @doc(description: "Metadata for the specified configurable options selection") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\OptionsSelectionMetadata") + configurable_product_options_selection(configurableOptionValueUids: [ID!]): ConfigurableProductOptionsSelection @doc(description: "Specified configurable product options selection") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\OptionsSelectionMetadata") } type ConfigurableVariant @doc(description: "An array containing all the simple product variants of a configurable product") { @@ -64,6 +64,7 @@ input ConfigurableProductCartItemInput { type ConfigurableCartItem implements CartItemInterface { customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") configurable_options: [SelectedConfigurableOption!]! @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableCartItemOptions") + configured_variant: ProductInterface! @doc(description: "Product details of the cart item") @resolver(class: "\\Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ProductResolver") } type SelectedConfigurableOption { @@ -80,8 +81,9 @@ type ConfigurableWishlistItem implements WishlistItemInterface @doc(description: configurable_options: [SelectedConfigurableOption!] @resolver(class: "\\Magento\\ConfigurableProductGraphQl\\Model\\Wishlist\\ConfigurableOptions") @doc (description: "An array of selected configurable options") } -type ConfigurableOptionsSelectionMetadata @doc(description: "Metadata corresponding to the configurable options selection.") { +type ConfigurableProductOptionsSelection @doc(description: "Metadata corresponding to the configurable options selection.") { options_available_for_selection: [ConfigurableOptionAvailableForSelection!] @doc(description: "Configurable options available for further selection based on current selection.") + configurable_options: [ConfigurableProductOption!] @doc(description: "Configurable options available for further selection based on current selection.") media_gallery: [MediaGalleryInterface!] @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\SelectionMediaGallery") @doc(description: "Product images and videos corresponding to the specified configurable options selection.") variant: SimpleProduct @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\Variant\\Variant") @doc(description: "Variant represented by the specified configurable options selection. It is expected to be null, until selections are made for each configurable option.") } @@ -91,6 +93,20 @@ type ConfigurableOptionAvailableForSelection @doc(description: "Configurable opt attribute_code: String! @doc(description: "Attribute code that uniquely identifies configurable option.") } +type ConfigurableProductOption { + uid: ID! + attribute_code: String! + label: String! + values: [ConfigurableProductOptionValue!] +} + +type ConfigurableProductOptionValue { + uid: ID! + is_available: Boolean! + is_use_default: Boolean! + label: String! +} + type StoreConfig @doc(description: "The type contains information about a store config") { configurable_thumbnail_source : String @doc(description: "The configuration setting determines which thumbnail should be used in the cart for configurable products.") } diff --git a/app/code/Magento/ConfigurableProductSales/Test/Unit/ViewModel/ItemRendererTypeResolverTest.php b/app/code/Magento/ConfigurableProductSales/Test/Unit/ViewModel/ItemRendererTypeResolverTest.php new file mode 100644 index 0000000000000..f4d0ea78e2846 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/Test/Unit/ViewModel/ItemRendererTypeResolverTest.php @@ -0,0 +1,81 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductSales\Test\Unit\ViewModel; + +use Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver; +use Magento\Framework\DataObject; +use Magento\Sales\Model\Order\Item; +use PHPUnit\Framework\TestCase; + +/** + * Test configurable order item renderer type resolver + */ +class ItemRendererTypeResolverTest extends TestCase +{ + /** + * @var ItemRendererTypeResolver + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->model = new ItemRendererTypeResolver(); + } + + /** + * @param string|null $realProductType + * @param string $expectedProductType + * @dataProvider resolveConfigurableOrderItemDataProvider + */ + public function testResolveConfigurableOrderItem(?string $realProductType, string $expectedProductType): void + { + $orderItem = $this->getOrderItemMock(); + $orderItem->setProductType('configurable'); + $childOrderItem = $this->getOrderItemMock(); + $childOrderItem->setProductOptions(['real_product_type' => $realProductType]); + $orderItem->addChildItem($childOrderItem); + $this->assertEquals($expectedProductType, $this->model->resolve($orderItem)); + $this->assertEquals($expectedProductType, $this->model->resolve(new DataObject(['order_item' => $orderItem]))); + } + + /** + * @return array + */ + public function resolveConfigurableOrderItemDataProvider(): array + { + return [ + ['simple', 'simple'], + [null, 'configurable'], + ]; + } + + /** + * @return void + */ + public function testResolveSimpleOrderItem(): void + { + $orderItem = $this->getOrderItemMock(); + $orderItem->setProductType('virtual'); + $this->assertEquals('virtual', $this->model->resolve($orderItem)); + $this->assertEquals('virtual', $this->model->resolve(new DataObject(['order_item' => $orderItem]))); + } + + /** + * @return Item + */ + private function getOrderItemMock(): Item + { + return $this->getMockBuilder(Item::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + } +} diff --git a/app/code/Magento/ConfigurableProductSales/ViewModel/ItemRendererTypeResolver.php b/app/code/Magento/ConfigurableProductSales/ViewModel/ItemRendererTypeResolver.php new file mode 100644 index 0000000000000..12e35f6376042 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/ViewModel/ItemRendererTypeResolver.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductSales\ViewModel; + +use Magento\ConfigurableProduct\Model\Product\Type\Configurable as ProductType; +use Magento\Framework\DataObject; +use Magento\Framework\View\Element\Block\ArgumentInterface; +use Magento\Sales\Model\Order\Item; +use Magento\Sales\ViewModel\ItemRendererTypeResolverInterface; + +/** + * Configurable order item renderer type resolver + */ +class ItemRendererTypeResolver implements ItemRendererTypeResolverInterface, ArgumentInterface +{ + /** + * @inheritdoc + */ + public function resolve(DataObject $item): ?string + { + $orderItem = $item->getOrderItem() ? $item->getOrderItem() : $item; + if ($orderItem->getProductType() === ProductType::TYPE_CODE) { + $childItem = $this->getChildOrderItem($orderItem); + if ($childItem->getRealProductType() && $childItem->getRealProductType() !== ProductType::TYPE_CODE) { + return $childItem->getRealProductType(); + } + } + return $orderItem->getProductType(); + } + + /** + * Get child product order item + * + * @param Item $orderItem + * @return Item + */ + private function getChildOrderItem(Item $orderItem): Item + { + $childrenItems = $orderItem->getChildrenItems() ?: []; + if (count($childrenItems) === 1) { + $orderItem = reset($childrenItems); + } + + return $orderItem; + } +} diff --git a/app/code/Magento/ConfigurableProductSales/composer.json b/app/code/Magento/ConfigurableProductSales/composer.json index edac2b7782dcc..e72db7424a6cc 100644 --- a/app/code/Magento/ConfigurableProductSales/composer.json +++ b/app/code/Magento/ConfigurableProductSales/composer.json @@ -9,9 +9,7 @@ "magento/framework": "*", "magento/module-catalog": "*", "magento/module-sales": "*", - "magento/module-store": "*" - }, - "suggest": { + "magento/module-store": "*", "magento/module-configurable-product": "*" }, "type": "magento2-module", diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_creditmemo_items.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_creditmemo_items.xml new file mode 100644 index 0000000000000..5aac30f1ede9b --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_creditmemo_items.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_invoice_items.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_invoice_items.xml new file mode 100644 index 0000000000000..5aac30f1ede9b --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_invoice_items.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_items.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_items.xml new file mode 100644 index 0000000000000..5aac30f1ede9b --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_email_order_items.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_creditmemo.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_creditmemo.xml new file mode 100644 index 0000000000000..1437e8c69e807 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_creditmemo.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="creditmemo_items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_invoice.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_invoice.xml new file mode 100644 index 0000000000000..52623bdc0c99d --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_invoice.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="invoice_items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_print.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_print.xml new file mode 100644 index 0000000000000..8bd2260decdcb --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_print.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="order_items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printcreditmemo.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printcreditmemo.xml new file mode 100644 index 0000000000000..4d7f4f8823109 --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printcreditmemo.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="sales.order.print.creditmemo"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printinvoice.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printinvoice.xml new file mode 100644 index 0000000000000..194c37787575e --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_printinvoice.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="sales.order.print.invoice"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_view.xml b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_view.xml new file mode 100644 index 0000000000000..8bd2260decdcb --- /dev/null +++ b/app/code/Magento/ConfigurableProductSales/view/frontend/layout/sales_order_view.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> + <body> + <referenceBlock name="order_items"> + <arguments> + <argument name="configurable_renderer_type_resolver" xsi:type="object"> + Magento\ConfigurableProductSales\ViewModel\ItemRendererTypeResolver + </argument> + </arguments> + </referenceBlock> + </body> +</page> diff --git a/app/code/Magento/Contact/Test/Mftf/Test/StorefrontVerifySecureURLRedirectContactTest.xml b/app/code/Magento/Contact/Test/Mftf/Test/StorefrontVerifySecureURLRedirectContactTest.xml index 2300740f23c7d..2e085351f2d4c 100644 --- a/app/code/Magento/Contact/Test/Mftf/Test/StorefrontVerifySecureURLRedirectContactTest.xml +++ b/app/code/Magento/Contact/Test/Mftf/Test/StorefrontVerifySecureURLRedirectContactTest.xml @@ -25,15 +25,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <executeJS function="return window.location.host" stepKey="hostname"/> <amOnUrl url="http://{$hostname}/contact" stepKey="goToUnsecureContactURL"/> diff --git a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml index 56098cfec90cb..337410d61c06d 100644 --- a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml +++ b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml @@ -28,7 +28,7 @@ <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="tags" value="full_page"/> </actionGroup> </before> <after> @@ -37,9 +37,7 @@ <magentoCLI command="config:set web/unsecure/base_url http://{$hostname}/" stepKey="setUnsecureBaseURL"/> <magentoCLI command="config:set web/secure/base_url http://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <amOnPage url="/" stepKey="goToHomePage"/> <executeJS function="return window.cookiesConfig.secure ? 'true' : 'false'" stepKey="isCookieSecure"/> diff --git a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml index e601a6b1920b0..dccb432273b89 100644 --- a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml +++ b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml @@ -21,14 +21,10 @@ <group value="configuration"/> </annotations> <before> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <amOnPage url="/" stepKey="goToHomePage"/> <executeJS function="return window.cookiesConfig.secure ? 'true' : 'false'" stepKey="isCookieSecure"/> diff --git a/app/code/Magento/Cookie/view/base/web/js/jquery.storageapi.extended.js b/app/code/Magento/Cookie/view/base/web/js/jquery.storageapi.extended.js index c026b205f0374..c165866522642 100644 --- a/app/code/Magento/Cookie/view/base/web/js/jquery.storageapi.extended.js +++ b/app/code/Magento/Cookie/view/base/web/js/jquery.storageapi.extended.js @@ -16,8 +16,11 @@ define([ * @private */ function _extend(storage) { + var cookiesConfig = window.cookiesConfig || {}; + $.extend(storage, { - _secure: window.cookiesConfig ? window.cookiesConfig.secure : false, + _secure: !!cookiesConfig.secure, + _samesite: cookiesConfig.samesite ? cookiesConfig.samesite : 'lax', /** * Set value under name @@ -30,7 +33,8 @@ define([ expires: this._expires, path: this._path, domain: this._domain, - secure: this._secure + secure: this._secure, + samesite: this._samesite }; $.cookie(this._prefix + name, value, $.extend(_default, options || {})); @@ -58,6 +62,10 @@ define([ this._secure = c.secure; } + if (typeof c.samesite !== 'undefined') { + this._samesite = c.samesite; + } + return this; } }); diff --git a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php index f48394ac19b3c..431a7cf858b90 100644 --- a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php +++ b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php @@ -22,6 +22,11 @@ class Currencysymbol extends \Magento\Backend\Block\Widget\Form */ protected $_symbolSystemFactory; + /** + * @var string + */ + private $_controller; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolSystemFactory @@ -36,17 +41,6 @@ public function __construct( parent::__construct($context, $data); } - /** - * Constructor. Initialization required variables for class instance. - * - * @return void - */ - protected function _construct() - { - $this->_controller = 'adminhtml_system_currencysymbol'; - parent::_construct(); - } - /** * Custom currency symbol properties * diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminImportUnsupportedCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminImportUnsupportedCurrencyRatesActionGroup.xml new file mode 100644 index 0000000000000..6c6ce71506d74 --- /dev/null +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminImportUnsupportedCurrencyRatesActionGroup.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminImportUnsupportedCurrencyRatesActionGroup" extends="AdminImportCurrencyRatesActionGroup"> + <waitForElementVisible selector="{{AdminCurrencyRatesSection.oldRateLabel}}" stepKey="waitForOldRateVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Data/CurrencyRatesConfigData.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Data/CurrencyRatesConfigData.xml index d22430e3c0218..9b95f4017df08 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Data/CurrencyRatesConfigData.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Data/CurrencyRatesConfigData.xml @@ -32,6 +32,12 @@ <data key="scope">websites</data> <data key="scope_code">base</data> </entity> + <entity name="SetCurrencyRHDBaseConfig"> + <data key="path">currency/options/base</data> + <data key="value">RHD</data> + <data key="scope">websites</data> + <data key="scope_code">base</data> + </entity> <entity name="SetCurrencyAUDBaseConfig"> <data key="path">currency/options/base</data> <data key="value">AUD</data> @@ -62,6 +68,12 @@ <data key="scope">websites</data> <data key="scope_code">base</data> </entity> + <entity name="SetAllowedCurrenciesConfigForRHD"> + <data key="path">currency/options/allow</data> + <data key="value">RHD</data> + <data key="scope">websites</data> + <data key="scope_code">base</data> + </entity> <entity name="SetAllowedCurrenciesConfigForYEN"> <data key="path">currency/options/allow</data> <data key="value">JPY</data> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Section/AdminCurrencyRatesSection.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Section/AdminCurrencyRatesSection.xml index 10f345ec69369..a98495416cff2 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Section/AdminCurrencyRatesSection.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Section/AdminCurrencyRatesSection.xml @@ -13,6 +13,7 @@ <element name="saveCurrencyRates" type="button" selector="//button[@title='Save Currency Rates']"/> <element name="options" type="button" selector="//button[@title='Options']"/> <element name="oldRate" type="text" selector="//div[contains(@class, 'admin__field-note') and contains(text(), 'Old rate:')]/strong"/> + <element name="oldRateLabel" type="text" selector="//div[contains(@class, 'admin__field-note') and contains(text(), 'Old rate:')]"/> <element name="rateService" type="select" selector="#rate_services"/> <element name="currencyRate" type="input" selector="input[name='rate[{{fistCurrency}}][{{secondCurrency}}]']" parameterized="true"/> </section> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCheckCurrencyConverterApiConfigurationTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCheckCurrencyConverterApiConfigurationTest.xml new file mode 100644 index 0000000000000..c36ce89d9dfad --- /dev/null +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCheckCurrencyConverterApiConfigurationTest.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckCurrencyConverterApiConfigurationTest"> + <annotations> + <features value="CurrencySymbol"/> + <stories value="Currency Rates"/> + <title value="Currency Converter API configuration"/> + <description value="Admin should be able to import currency rates using Currency Converter API"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-28786"/> + <useCaseId value="MAGETWO-94919"/> + <group value="currency"/> + </annotations> + <before> + <!--Set currency configuration--> + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForRHD.value}}" stepKey="setAllowedCurrencyRHDAndUSD"/> + <magentoCLI command="config:set {{CurrencyConverterApiKeyConfigData.path}} {{CurrencyConverterApiKeyConfigData.value}}" stepKey="setCurrencyConverterApiKey"/> + <!--Create product--> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <!--Set currency allow previous config--> + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="setDefaultAllowedCurrencies"/> + <magentoCLI command="config:set {{DefaultCurrencyConverterApiKeyConfigData.path}} {{DefaultCurrencyConverterApiKeyConfigData.value}}" stepKey="setDefaultCurrencyConverterApiKey"/> + <!--Delete created data--> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + <!--Import rates from Currency Converter API--> + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="openCurrencyRatesPage"/> + <actionGroup ref="AdminImportUnsupportedCurrencyRatesActionGroup" stepKey="importCurrencyRates"> + <argument name="rateService" value="Currency Converter API"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeWarningMessageForRHD"> + <argument name="message" value="We can't retrieve a rate from https://free.currconv.com for RHD."/> + <argument name="messageType" value="warning"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeWarningMessageSaved"> + <argument name="message" value='Click "Save" to apply the rates we found.'/> + <argument name="messageType" value="warning"/> + </actionGroup> + <actionGroup ref="AdminSaveCurrencyRatesActionGroup" stepKey="saveCurrencyRates"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeRHDMessageAfterSave"> + <argument name="message" value="{{AdminSaveCurrencyRatesMessageData.success}}"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeValidRatesSaved"> + <argument name="message" value='Please correct the input data for "USD => RHD" rate'/> + <argument name="messageType" value="warning"/> + </actionGroup> + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyEURAndUSD"/> + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="openCurrencyRatesPageAfterSetEUR"/> + <actionGroup ref="AdminImportCurrencyRatesActionGroup" stepKey="importCurrencyRatesAfterEUR"> + <argument name="rateService" value="Currency Converter API"/> + </actionGroup> + <dontSee selector="{{AdminMessagesSection.warning}}" userInput="We can't retrieve a rate from https://free.currconv.com for EUR." stepKey="dontSeeWarningMessageForEUR"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessageForSaveRates"> + <argument name="message" value='Click "Save" to apply the rates we found.'/> + </actionGroup> + <actionGroup ref="AdminSaveCurrencyRatesActionGroup" stepKey="saveCurrencyRatesAfterEUR"/> + <dontSee selector="{{AdminMessagesSection.warning}}" userInput='Please correct the input data for "USD => EUR" rate' stepKey="dontSeeWarningMessageCorrectForEUR"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeValidRatesEURSaved"> + <argument name="message" value="{{AdminSaveCurrencyRatesMessageData.success}}"/> + </actionGroup> + <!--Go to the Storefront and check currency rates--> + <amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="openCreatedProductPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchToEURCurrency"> + <argument name="currency" value="EUR"/> + </actionGroup> + <see selector="{{StorefrontCategoryMainSection.productPrice}}" userInput="€" stepKey="seeEURCurrencySymbolInPrice"/> + <!--Set allowed currencies greater then 10--> + <magentoCLI command="config:set currency/options/allow RHD,CHW,YER,ZMK,CHE,EUR,USD,AMD,RUB,DZD,ARS,AWG" stepKey="setGreaterThanTenAllowedCurrencies"/> + <!--Import rates from Currency Converter API with currencies greater then 10--> + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="openCurrencyRatesPageAfterChangeAllowed"/> + <actionGroup ref="AdminImportUnsupportedCurrencyRatesActionGroup" stepKey="importCurrencyRatesGreaterThen10"> + <argument name="rateService" value="Currency Converter API"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeTooManyPairsMessage"> + <argument name="message" value="Too many pairs. Maximum of 2 is supported for this free version."/> + <argument name="messageType" value="warning"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml index ce586be359e42..3f82ca4f3855c 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml @@ -8,27 +8,25 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCurrencyConverterAPIConfigurationTest"> + <test name="AdminCurrencyConverterAPIConfigurationTest" deprecated="Use AdminCheckCurrencyConverterApiConfigurationTest instead"> <annotations> <features value="CurrencySymbol"/> <stories value="Currency Rates"/> - <title value="Currency Converter API configuration"/> - <description value="Currency Converter API configuration"/> + <title value="DEPRECATED. Currency Converter API configuration"/> + <description value="DEPRECATED. Currency Converter API configuration"/> <severity value="CRITICAL"/> <testCaseId value="MC-19272"/> <useCaseId value="MAGETWO-94919"/> <group value="currency"/> <skip> - <issueId value="MQE-1578"/> + <issueId value="DEPRECATED">Use AdminCheckCurrencyConverterApiConfigurationTest instead</issueId> </skip> </annotations> <before> <!--Set currency allow config--> <magentoCLI command="config:set currency/options/allow RHD,CHW,CHE,AMD,EUR,USD" stepKey="setCurrencyAllow"/> <!--TODO: Add Api key--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Create product--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createProduct"> @@ -58,7 +56,7 @@ <see selector="{{AdminMessagesSection.warning}}" userInput='Please correct the input data for "USD => RHD" rate' stepKey="seeRHDMessageAfterSave"/> <see selector="{{AdminMessagesSection.warning}}" userInput='Please correct the input data for "USD => CHW" rate' stepKey="seeCHWMessageAfterSave"/> <!--Go to the Storefront and check currency rates--> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchAMDCurrency"> <argument name="currency" value="AMD"/> @@ -70,9 +68,7 @@ <see selector="{{StorefrontCategoryMainSection.productPrice}}" userInput="€" stepKey="seeEURInPrice"/> <!--Set allowed currencies greater then 10--> <magentoCLI command="config:set currency/options/allow RHD,CHW,YER,ZMK,CHE,EUR,USD,AMD,RUB,DZD,ARS,AWG" stepKey="setCurrencyAllow"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Import rates from Currency Converter API with currencies greater then 10--> <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="onCurrencyRatePageSecondTime"/> <actionGroup ref="AdminImportCurrencyRatesActionGroup" stepKey="importCurrencyRatesGreaterThen10"> diff --git a/app/code/Magento/Customer/Api/Data/CustomerInterface.php b/app/code/Magento/Customer/Api/Data/CustomerInterface.php index 9e8f9a12d5a48..f03889050ef82 100644 --- a/app/code/Magento/Customer/Api/Data/CustomerInterface.php +++ b/app/code/Magento/Customer/Api/Data/CustomerInterface.php @@ -6,7 +6,8 @@ namespace Magento\Customer\Api\Data; /** - * Customer interface. + * Customer entity interface for API handling. + * * @api * @since 100.0.2 */ @@ -161,7 +162,10 @@ public function setCreatedIn($createdIn); /** * Get date of birth * - * @return string|null + * @return string|null In keeping with current security and privacy best practices, be sure you are aware of any + * potential legal and security risks associated with the storage of customers’ full date of birth + * (month, day, year) along with other personal identifiers (e.g., full name) before collecting or processing + * such data. */ public function getDob(); diff --git a/app/code/Magento/Customer/Api/Data/GroupExcludedWebsiteInterface.php b/app/code/Magento/Customer/Api/Data/GroupExcludedWebsiteInterface.php new file mode 100644 index 0000000000000..6758c67c2bbf3 --- /dev/null +++ b/app/code/Magento/Customer/Api/Data/GroupExcludedWebsiteInterface.php @@ -0,0 +1,88 @@ +<?php +/** + * + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Api\Data; + +use Magento\Framework\Api\ExtensibleDataInterface; + +/** + * Customer group website interface for websites that are excluded from customer group. + * @api + */ +interface GroupExcludedWebsiteInterface extends ExtensibleDataInterface +{ + /**#@+ + * Constants for keys of data array + */ + public const ID = 'entity_id'; + public const GROUP_ID = 'customer_group_id'; + public const WEBSITE_ID = 'website_id'; + /**#@-*/ + + /** + * Get entity id + * + * @return int|null + */ + public function getGroupWebsiteId(): ?int; + + /** + * Set entity id + * + * @param int $id + * @return $this + */ + public function setGroupWebsiteId(int $id): GroupExcludedWebsiteInterface; + + /** + * Get customer group id + * + * @return int|null + */ + public function getGroupId(): ?int; + + /** + * Set customer group id + * + * @param int $id + * @return $this + */ + public function setGroupId(int $id): GroupExcludedWebsiteInterface; + + /** + * Get excluded website id + * + * @return int|null + */ + public function getExcludedWebsiteId(): ?int; + + /** + * Set excluded website id + * + * @param int $websiteId + * @return $this + */ + public function setExcludedWebsiteId(int $websiteId): GroupExcludedWebsiteInterface; + + /** + * Retrieve existing extension attributes object or create a new one. + * + * @return \Magento\Customer\Api\Data\GroupExcludedWebsiteExtensionInterface|null + */ + public function getExtensionAttributes(): ?GroupExcludedWebsiteExtensionInterface; + + /** + * Set an extension attributes object. + * + * @param GroupExcludedWebsiteExtensionInterface $extensionAttributes + * @return $this + */ + public function setExtensionAttributes( + GroupExcludedWebsiteExtensionInterface $extensionAttributes + ): GroupExcludedWebsiteInterface; +} diff --git a/app/code/Magento/Customer/Api/GroupExcludedWebsiteRepositoryInterface.php b/app/code/Magento/Customer/Api/GroupExcludedWebsiteRepositoryInterface.php new file mode 100644 index 0000000000000..361ecfd7f245c --- /dev/null +++ b/app/code/Magento/Customer/Api/GroupExcludedWebsiteRepositoryInterface.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Api; + +use Magento\Customer\Api\Data\GroupExcludedWebsiteInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Customer group website repository interface for websites that are excluded from customer group. + * @api + */ +interface GroupExcludedWebsiteRepositoryInterface +{ + /** + * Save customer group excluded website. + * + * @param GroupExcludedWebsiteInterface $groupExcludedWebsite + * @return GroupExcludedWebsiteInterface + * @throws LocalizedException + */ + public function save(GroupExcludedWebsiteInterface $groupExcludedWebsite): GroupExcludedWebsiteInterface; + + /** + * Retrieve customer group excluded websites by customer group id. + * + * @param int $customerGroupId + * @return string[] + * @throws LocalizedException + */ + public function getCustomerGroupExcludedWebsites(int $customerGroupId): array; + + /** + * Retrieve all excluded customer group websites per customer groups. + * + * @return int[] + * @throws LocalizedException + */ + public function getAllExcludedWebsites(): array; + + /** + * Delete customer group with its excluded websites. + * + * @param int $customerGroupId + * @return bool + * @throws LocalizedException + */ + public function delete(int $customerGroupId): bool; + + /** + * Delete customer group excluded website by id. + * + * @param int $websiteId + * @return bool + * @throws LocalizedException + */ + public function deleteByWebsite(int $websiteId): bool; +} diff --git a/app/code/Magento/Customer/Block/Account/Dashboard/Address.php b/app/code/Magento/Customer/Block/Account/Dashboard/Address.php index 87fb6fc62bc24..5a22009221c0a 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard/Address.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard/Address.php @@ -104,17 +104,19 @@ public function getPrimaryBillingAddressHtml() try { $address = $this->currentCustomerAddress->getDefaultBillingAddress(); } catch (NoSuchEntityException $e) { - return __('You have not set a default billing address.'); + return $this->escapeHtml(__('You have not set a default billing address.')); } if ($address) { return $this->_getAddressHtml($address); } else { - return __('You have not set a default billing address.'); + return $this->escapeHtml(__('You have not set a default billing address.')); } } /** + * Get Primary Shipping Address Edit Url + * * @return string */ public function getPrimaryShippingAddressEditUrl() @@ -132,6 +134,8 @@ public function getPrimaryShippingAddressEditUrl() } /** + * Get Primary Billing Address Edit Url + * * @return string */ public function getPrimaryBillingAddressEditUrl() @@ -149,6 +153,8 @@ public function getPrimaryBillingAddressEditUrl() } /** + * Get Address Book Url + * * @return string */ public function getAddressBookUrl() diff --git a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php index c10ff421b7f92..703d9b2d0154a 100644 --- a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php +++ b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php @@ -172,9 +172,9 @@ public function renderArray($addressAttributes, $format = null) } $attributeCode = $attributeMetadata->getAttributeCode(); if ($attributeCode == 'country_id' && isset($addressAttributes['country_id'])) { - $data['country'] = $this->_countryFactory->create()->loadByCode( - $addressAttributes['country_id'] - )->getName(); + $data['country'] = $this->_countryFactory->create() + ->loadByCode($addressAttributes['country_id']) + ->getName($addressAttributes['locale'] ?? null); } elseif ($attributeCode == 'region' && isset($addressAttributes['region'])) { $data['region'] = (string)__($addressAttributes['region']); } elseif (isset($addressAttributes[$attributeCode])) { @@ -198,6 +198,7 @@ public function renderArray($addressAttributes, $format = null) } } $format = $format !== null ? $format : $this->getFormatArray($addressAttributes); + return $this->filterManager->template($format, ['variables' => $data]); } } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php index 56f5e07670e5b..818b3221db4e8 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php @@ -34,6 +34,11 @@ class Orders extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $collectionFactory; + /** + * @var \Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory + */ + private $_collectionFactory; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php index a6e0eb0bcbc58..da20bc9b4871d 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php @@ -314,11 +314,11 @@ public function getBillingAddressHtml() try { $address = $this->accountManagement->getDefaultBillingAddress($this->getCustomer()->getId()); } catch (NoSuchEntityException $e) { - return __('The customer does not have default billing address.'); + return $this->escapeHtml(__('The customer does not have default billing address.')); } if ($address === null) { - return __('The customer does not have default billing address.'); + return $this->escapeHtml(__('The customer does not have default billing address.')); } return $this->addressHelper->getFormatTypeRenderer( diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/File.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/File.php new file mode 100644 index 0000000000000..0286ef4b96aa6 --- /dev/null +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/File.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Block\Adminhtml\Form\Element\Address; + +/** + * Customer Address Widget Form File Element Block + */ +class File extends \Magento\Customer\Block\Adminhtml\Form\Element\File +{ + /** + * @inheritdoc + */ + protected function _getPreviewUrl() + { + return $this->_adminhtmlData->getUrl( + 'customer/address/viewfile', + ['file' => $this->urlEncoder->encode($this->getValue())] + ); + } +} diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/Image.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/Image.php new file mode 100644 index 0000000000000..fe1a0a26d6ffd --- /dev/null +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Address/Image.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Block\Adminhtml\Form\Element\Address; + +/** + * Customer Address Widget Form Image Element Block + */ +class Image extends \Magento\Customer\Block\Adminhtml\Form\Element\Image +{ + /** + * @inheritdoc + */ + protected function _getPreviewUrl() + { + return $this->_adminhtmlData->getUrl( + 'customer/address/viewfile', + ['file' => $this->urlEncoder->encode($this->getValue())] + ); + } +} diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php index 3452085a85c28..2f6609486ee73 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php @@ -73,7 +73,7 @@ protected function _getPreviewUrl() { return $this->_adminhtmlData->getUrl( 'customer/index/viewfile', - ['image' => $this->urlEncoder->encode($this->getValue())] + ['file' => $this->urlEncoder->encode($this->getValue())] ); } } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php index 1a57ab7c7b6a5..80b0ac662b13c 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php @@ -5,7 +5,10 @@ */ namespace Magento\Customer\Block\Adminhtml\Group\Edit; +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; use Magento\Customer\Controller\RegistryConstants; +use Magento\Framework\App\ObjectManager; +use Magento\Store\Model\System\Store as SystemStore; /** * Adminhtml customer groups edit form @@ -32,6 +35,16 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $groupDataFactory; + /** + * @var SystemStore + */ + private $systemStore; + + /** + * @var GroupExcludedWebsiteRepositoryInterface + */ + private $groupExcludedWebsiteRepository; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Framework\Registry $registry @@ -41,6 +54,8 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic * @param \Magento\Customer\Api\GroupRepositoryInterface $groupRepository * @param \Magento\Customer\Api\Data\GroupInterfaceFactory $groupDataFactory * @param array $data + * @param SystemStore|null $systemStore + * @param GroupExcludedWebsiteRepositoryInterface|null $groupExcludedWebsiteRepository */ public function __construct( \Magento\Backend\Block\Template\Context $context, @@ -50,12 +65,17 @@ public function __construct( \Magento\Tax\Helper\Data $taxHelper, \Magento\Customer\Api\GroupRepositoryInterface $groupRepository, \Magento\Customer\Api\Data\GroupInterfaceFactory $groupDataFactory, - array $data = [] + array $data = [], + SystemStore $systemStore = null, + GroupExcludedWebsiteRepositoryInterface $groupExcludedWebsiteRepository = null ) { $this->_taxCustomer = $taxCustomer; $this->_taxHelper = $taxHelper; $this->_groupRepository = $groupRepository; $this->groupDataFactory = $groupDataFactory; + $this->systemStore = $systemStore ?: ObjectManager::getInstance()->get(SystemStore::class); + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository + ?: ObjectManager::getInstance()->get(GroupExcludedWebsiteRepositoryInterface::class); parent::__construct($context, $registry, $formFactory, $data); } @@ -73,12 +93,16 @@ protected function _prepareLayout() $groupId = $this->_coreRegistry->registry(RegistryConstants::CURRENT_GROUP_ID); /** @var \Magento\Customer\Api\Data\GroupInterface $customerGroup */ + $customerGroupExcludedWebsites = []; if ($groupId === null) { $customerGroup = $this->groupDataFactory->create(); $defaultCustomerTaxClass = $this->_taxHelper->getDefaultCustomerTaxClass(); } else { $customerGroup = $this->_groupRepository->getById($groupId); $defaultCustomerTaxClass = $customerGroup->getTaxClassId(); + $customerGroupExcludedWebsites = $this->groupExcludedWebsiteRepository->getCustomerGroupExcludedWebsites( + $groupId + ); } $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Group Information')]); @@ -120,6 +144,20 @@ protected function _prepareLayout() ] ); + $fieldset->addField( + 'customer_group_excluded_website_ids', + 'multiselect', + [ + 'name' => 'customer_group_excluded_websites', + 'label' => __('Excluded Website(s)'), + 'title' => __('Excluded Website(s)'), + 'required' => false, + 'can_be_empty' => true, + 'values' => $this->systemStore->getWebsiteValuesForForm(), + 'note' => __('Select websites you want to exclude from this customer group.') + ] + ); + if ($customerGroup->getId() !== null) { // If edit add id $form->addField('id', 'hidden', ['name' => 'id', 'value' => $customerGroup->getId()]); @@ -135,6 +173,7 @@ protected function _prepareLayout() 'id' => $customerGroup->getId(), 'customer_group_code' => $customerGroup->getCode(), 'tax_class_id' => $defaultCustomerTaxClass, + 'customer_group_excluded_website_ids' => $customerGroupExcludedWebsites ] ); } diff --git a/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php b/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php index c980fe1fe7769..260efefe48ddb 100644 --- a/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php +++ b/app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php @@ -68,10 +68,9 @@ protected function execute(InputInterface $input, OutputInterface $output) $customer->load($customer->getId()); if (!$this->encryptor->validateHashVersion($customer->getPasswordHash())) { list($hash, $salt, $version) = explode(Encryptor::DELIMITER, $customer->getPasswordHash(), 3); - $version .= Encryptor::DELIMITER . $this->encryptor->getLatestHashVersion(); $hash = $this->encryptor->getHash($hash, $salt, $this->encryptor->getLatestHashVersion()); - list($hash, $salt) = explode(Encryptor::DELIMITER, $hash, 3); - $hash = implode(Encryptor::DELIMITER, [$hash, $salt, $version]); + list($hash, $salt, $newVersion) = explode(Encryptor::DELIMITER, $hash, 3); + $hash = implode(Encryptor::DELIMITER, [$hash, $salt, $version .Encryptor::DELIMITER .$newVersion]); $customer->setPasswordHash($hash); $customer->save(); $output->write("."); @@ -79,5 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $output->writeln("."); $output->writeln("<info>Finished</info>"); + + return 0; } } diff --git a/app/code/Magento/Customer/Controller/Account/CreatePost.php b/app/code/Magento/Customer/Controller/Account/CreatePost.php index 14c2ed43171f6..9171511f5ba2e 100644 --- a/app/code/Magento/Customer/Controller/Account/CreatePost.php +++ b/app/code/Magento/Customer/Controller/Account/CreatePost.php @@ -152,7 +152,7 @@ class CreatePost extends AbstractAccount implements CsrfAwareActionInterface, Ht /** * @var ScopeConfigInterface */ - private $scopeConfig; + protected $scopeConfig; /** * @param Context $context diff --git a/app/code/Magento/Customer/Controller/Account/EditPost.php b/app/code/Magento/Customer/Controller/Account/EditPost.php index c2137f1b40019..901036302c779 100644 --- a/app/code/Magento/Customer/Controller/Account/EditPost.php +++ b/app/code/Magento/Customer/Controller/Account/EditPost.php @@ -8,6 +8,7 @@ namespace Magento\Customer\Controller\Account; use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Api\SessionCleanerInterface; use Magento\Customer\Model\AddressRegistry; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Customer\Model\AuthenticationInterface; @@ -27,6 +28,7 @@ use Magento\Framework\Escaper; use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\InvalidEmailOrPasswordException; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Exception\State\UserLockedException; use Magento\Customer\Controller\AbstractAccount; @@ -72,7 +74,7 @@ class EditPost extends AbstractAccount implements CsrfAwareActionInterface, Http protected $session; /** - * @var \Magento\Customer\Model\EmailNotificationInterface + * @var EmailNotificationInterface */ private $emailNotification; @@ -101,6 +103,11 @@ class EditPost extends AbstractAccount implements CsrfAwareActionInterface, Http */ private $filesystem; + /** + * @var SessionCleanerInterface|null + */ + private $sessionCleaner; + /** * @param Context $context * @param Session $customerSession @@ -111,6 +118,7 @@ class EditPost extends AbstractAccount implements CsrfAwareActionInterface, Http * @param Escaper|null $escaper * @param AddressRegistry|null $addressRegistry * @param Filesystem $filesystem + * @param SessionCleanerInterface|null $sessionCleaner */ public function __construct( Context $context, @@ -121,7 +129,8 @@ public function __construct( CustomerExtractor $customerExtractor, ?Escaper $escaper = null, AddressRegistry $addressRegistry = null, - Filesystem $filesystem = null + Filesystem $filesystem = null, + ?SessionCleanerInterface $sessionCleaner = null ) { parent::__construct($context); $this->session = $customerSession; @@ -132,6 +141,7 @@ public function __construct( $this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class); $this->addressRegistry = $addressRegistry ?: ObjectManager::getInstance()->get(AddressRegistry::class); $this->filesystem = $filesystem ?: ObjectManager::getInstance()->get(Filesystem::class); + $this->sessionCleaner = $sessionCleaner ?: ObjectManager::getInstance()->get(SessionCleanerInterface::class); } /** @@ -143,9 +153,7 @@ private function getAuthentication() { if (!($this->authentication instanceof AuthenticationInterface)) { - return ObjectManager::getInstance()->get( - \Magento\Customer\Model\AuthenticationInterface::class - ); + return ObjectManager::getInstance()->get(AuthenticationInterface::class); } else { return $this->authentication; } @@ -160,9 +168,7 @@ private function getAuthentication() private function getEmailNotification() { if (!($this->emailNotification instanceof EmailNotificationInterface)) { - return ObjectManager::getInstance()->get( - EmailNotificationInterface::class - ); + return ObjectManager::getInstance()->get(EmailNotificationInterface::class); } else { return $this->emailNotification; } @@ -171,9 +177,8 @@ private function getEmailNotification() /** * @inheritDoc */ - public function createCsrfValidationException( - RequestInterface $request - ): ?InvalidRequestException { + public function createCsrfValidationException(RequestInterface $request): ?InvalidRequestException + { /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $resultRedirect->setPath('*/*/edit'); @@ -195,12 +200,12 @@ public function validateForCsrf(RequestInterface $request): ?bool /** * Change customer email or password action * - * @return \Magento\Framework\Controller\Result\Redirect + * @return Redirect * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function execute() { - /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */ + /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $validFormKey = $this->formKeyValidator->validate($this->getRequest()); @@ -254,13 +259,14 @@ public function execute() $this->session->logout(); $this->session->start(); $this->messageManager->addErrorMessage($message); + return $resultRedirect->setPath('customer/account/login'); } catch (InputException $e) { $this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage())); foreach ($e->getErrors() as $error) { $this->messageManager->addErrorMessage($this->escaper->escapeHtml($error->getMessage())); } - } catch (\Magento\Framework\Exception\LocalizedException $e) { + } catch (LocalizedException $e) { $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addException($e, __('We can\'t save the customer.')); @@ -272,16 +278,17 @@ public function execute() /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $resultRedirect->setPath('*/*/edit'); + return $resultRedirect; } /** * Account editing action completed successfully event * - * @param \Magento\Customer\Api\Data\CustomerInterface $customerCandidateDataObject + * @param CustomerInterface $customerCandidateDataObject * @return void */ - private function dispatchSuccessEvent(\Magento\Customer\Api\Data\CustomerInterface $customerCandidateDataObject) + private function dispatchSuccessEvent(CustomerInterface $customerCandidateDataObject) { $this->_eventManager->dispatch( 'customer_account_edited', @@ -294,7 +301,7 @@ private function dispatchSuccessEvent(\Magento\Customer\Api\Data\CustomerInterfa * * @param int $customerId * - * @return \Magento\Customer\Api\Data\CustomerInterface + * @return CustomerInterface */ private function getCustomerDataObject($customerId) { @@ -304,13 +311,13 @@ private function getCustomerDataObject($customerId) /** * Create Data Transfer Object of customer candidate * - * @param \Magento\Framework\App\RequestInterface $inputData - * @param \Magento\Customer\Api\Data\CustomerInterface $currentCustomerData - * @return \Magento\Customer\Api\Data\CustomerInterface + * @param RequestInterface $inputData + * @param CustomerInterface $currentCustomerData + * @return CustomerInterface */ private function populateNewCustomerDataObject( - \Magento\Framework\App\RequestInterface $inputData, - \Magento\Customer\Api\Data\CustomerInterface $currentCustomerData + RequestInterface $inputData, + CustomerInterface $currentCustomerData ) { $attributeValues = $this->getCustomerMapper()->toFlatArray($currentCustomerData); $customerDto = $this->customerExtractor->extract( @@ -356,12 +363,12 @@ protected function changeCustomerPassword($email) /** * Process change email request * - * @param \Magento\Customer\Api\Data\CustomerInterface $currentCustomerDataObject + * @param CustomerInterface $currentCustomerDataObject * @return void * @throws InvalidEmailOrPasswordException * @throws UserLockedException */ - private function processChangeEmailRequest(\Magento\Customer\Api\Data\CustomerInterface $currentCustomerDataObject) + private function processChangeEmailRequest(CustomerInterface $currentCustomerDataObject) { if ($this->getRequest()->getParam('change_email')) { // authenticate user for changing email @@ -370,6 +377,7 @@ private function processChangeEmailRequest(\Magento\Customer\Api\Data\CustomerIn $currentCustomerDataObject->getId(), $this->getRequest()->getPost('current_password') ); + $this->sessionCleaner->clearFor($currentCustomerDataObject->getId()); } catch (InvalidEmailOrPasswordException $e) { throw new InvalidEmailOrPasswordException( __("The password doesn't match this account. Verify the password and try again.") @@ -388,7 +396,7 @@ private function processChangeEmailRequest(\Magento\Customer\Api\Data\CustomerIn private function getCustomerMapper() { if ($this->customerMapper === null) { - $this->customerMapper = ObjectManager::getInstance()->get(\Magento\Customer\Model\Customer\Mapper::class); + $this->customerMapper = ObjectManager::getInstance()->get(Mapper::class); } return $this->customerMapper; } diff --git a/app/code/Magento/Customer/Controller/Account/Logout.php b/app/code/Magento/Customer/Controller/Account/Logout.php index 9344f482bd6e5..20b4fe30aa243 100644 --- a/app/code/Magento/Customer/Controller/Account/Logout.php +++ b/app/code/Magento/Customer/Controller/Account/Logout.php @@ -4,8 +4,11 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Customer\Controller\Account; +use Magento\Customer\Api\SessionCleanerInterface; use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Customer\Model\Session; @@ -35,15 +38,24 @@ class Logout extends AbstractAccount implements HttpGetActionInterface, HttpPost */ private $cookieMetadataManager; + /** + * @var SessionCleanerInterface + */ + private $sessionCleaner; + /** * @param Context $context * @param Session $customerSession + * @param SessionCleanerInterface|null $sessionCleaner */ public function __construct( Context $context, - Session $customerSession + Session $customerSession, + SessionCleanerInterface $sessionCleaner = null ) { $this->session = $customerSession; + $objectManager = ObjectManager::getInstance(); + $this->sessionCleaner = $sessionCleaner ?? $objectManager->get(SessionCleanerInterface::class); parent::__construct($context); } @@ -85,6 +97,7 @@ public function execute() $lastCustomerId = $this->session->getId(); $this->session->logout()->setBeforeAuthUrl($this->_redirect->getRefererUrl()) ->setLastCustomerId($lastCustomerId); + $this->sessionCleaner->clearFor((int)$lastCustomerId); if ($this->getCookieManager()->getCookie('mage-cache-sessid')) { $metadata = $this->getCookieMetadataFactory()->createCookieMetadata(); $metadata->setPath('/'); diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php b/app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php index a8cad14c23a72..71167f289ffb8 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php @@ -8,6 +8,7 @@ namespace Magento\Customer\Controller\Adminhtml\Address; use Magento\Customer\Api\AddressMetadataInterface; +use Magento\Framework\App\ResponseInterface; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Controller\Result\RawFactory; @@ -92,7 +93,7 @@ public function __construct( /** * Customer address view file action * - * @return ResultInterface|void + * @return ResultInterface|ResponseInterface|void * @throws NotFoundException */ public function execute() @@ -142,7 +143,7 @@ public function execute() return $resultRaw; } else { $name = $pathInfo['basename']; - $this->fileFactory->create( + return $this->fileFactory->create( $name, ['type' => 'filename', 'value' => $fileName], DirectoryList::MEDIA diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php b/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php index 64c94fa230fb1..4c07864f9b957 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php @@ -5,10 +5,10 @@ */ namespace Magento\Customer\Controller\Adminhtml\Group; -use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Customer\Api\Data\GroupInterfaceFactory; -use Magento\Customer\Api\Data\GroupInterface; use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\ObjectManager; /** * Controller class Save. Performs save action of customers group @@ -20,6 +20,11 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Group implements HttpP */ protected $dataObjectProcessor; + /** + * @var \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory + */ + private $groupExtensionInterfaceFactory; + /** * * @param \Magento\Backend\App\Action\Context $context @@ -29,6 +34,7 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Group implements HttpP * @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory * @param \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor + * @param \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, @@ -37,9 +43,12 @@ public function __construct( GroupInterfaceFactory $groupDataFactory, \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory, \Magento\Framework\View\Result\PageFactory $resultPageFactory, - \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor + \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor, + \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory ) { $this->dataObjectProcessor = $dataObjectProcessor; + $this->groupExtensionInterfaceFactory = $groupExtensionInterfaceFactory + ?: ObjectManager::getInstance()->get(\Magento\Customer\Api\Data\GroupExtensionInterfaceFactory::class); parent::__construct( $context, $coreRegistry, @@ -78,6 +87,8 @@ public function execute() $customerGroup = null; if ($taxClass) { $id = $this->getRequest()->getParam('id'); + $websitesToExclude = empty($this->getRequest()->getParam('customer_group_excluded_websites')) + ? [] : $this->getRequest()->getParam('customer_group_excluded_websites'); $resultRedirect = $this->resultRedirectFactory->create(); try { $customerGroupCode = (string)$this->getRequest()->getParam('code'); @@ -91,6 +102,12 @@ public function execute() $customerGroup->setCode(!empty($customerGroupCode) ? $customerGroupCode : null); $customerGroup->setTaxClassId($taxClass); + if ($websitesToExclude !== null) { + $customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create(); + $customerGroupExtensionAttributes->setExcludeWebsiteIds($websitesToExclude); + $customerGroup->setExtensionAttributes($customerGroupExtensionAttributes); + } + $this->groupRepository->save($customerGroup); $this->messageManager->addSuccessMessage(__('You saved the customer group.')); diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php index 02a045086224c..8aa55a6d1c5fc 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php @@ -14,6 +14,8 @@ use Magento\Customer\Api\Data\AddressInterfaceFactory; use Magento\Customer\Api\Data\CustomerInterfaceFactory; use Magento\Customer\Model\Address\Mapper; +use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\DataObjectFactory; @@ -130,7 +132,7 @@ public function __construct( /** * Customer view file action * - * @return \Magento\Framework\Controller\ResultInterface|void + * @return ResultInterface|ResponseInterface|void * @throws NotFoundException */ public function execute() @@ -181,7 +183,7 @@ public function execute() } else { // phpcs:ignore Magento2.Functions.DiscouragedFunction $name = pathinfo($path, PATHINFO_BASENAME); - $this->_fileFactory->create( + return $this->_fileFactory->create( $name, ['type' => 'filename', 'value' => $fileName], DirectoryList::MEDIA diff --git a/app/code/Magento/Customer/Helper/View.php b/app/code/Magento/Customer/Helper/View.php index a47930abb6d0e..dcd4ae01940a6 100644 --- a/app/code/Magento/Customer/Helper/View.php +++ b/app/code/Magento/Customer/Helper/View.php @@ -8,6 +8,8 @@ use Magento\Customer\Api\CustomerNameGenerationInterface; use Magento\Customer\Api\CustomerMetadataInterface; use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Escaper; /** * Customer helper for view. @@ -19,22 +21,30 @@ class View extends \Magento\Framework\App\Helper\AbstractHelper implements Custo */ protected $_customerMetadataService; + /** + * @var Escaper + */ + private $escaper; + /** * Initialize dependencies. * * @param \Magento\Framework\App\Helper\Context $context * @param CustomerMetadataInterface $customerMetadataService + * @param Escaper|null $escaper */ public function __construct( \Magento\Framework\App\Helper\Context $context, - CustomerMetadataInterface $customerMetadataService + CustomerMetadataInterface $customerMetadataService, + Escaper $escaper = null ) { $this->_customerMetadataService = $customerMetadataService; + $this->escaper = $escaper ?? ObjectManager::getInstance()->get(Escaper::class); parent::__construct($context); } /** - * {@inheritdoc} + * @inheritdoc */ public function getCustomerName(CustomerInterface $customerData) { @@ -57,6 +67,7 @@ public function getCustomerName(CustomerInterface $customerData) if ($suffixMetadata->isVisible() && $customerData->getSuffix()) { $name .= ' ' . $customerData->getSuffix(); } - return $name; + + return $this->escaper->escapeHtml($name); } } diff --git a/app/code/Magento/Customer/Model/Account/Redirect.php b/app/code/Magento/Customer/Model/Account/Redirect.php index 9824be73f36b5..dc83aee3a6aef 100644 --- a/app/code/Magento/Customer/Model/Account/Redirect.php +++ b/app/code/Magento/Customer/Model/Account/Redirect.php @@ -221,15 +221,15 @@ protected function processLoggedCustomer() ScopeInterface::SCOPE_STORE ) ) { - $referer = $this->request->getParam(CustomerUrl::REFERER_QUERY_PARAM_NAME); - if ($referer) { - $referer = $this->urlDecoder->decode($referer); - preg_match('/logoutSuccess\//', $referer, $matches, PREG_OFFSET_CAPTURE); + $referrer = $this->request->getParam(CustomerUrl::REFERER_QUERY_PARAM_NAME); + if ($referrer) { + $referrer = $this->urlDecoder->decode($referrer); + preg_match('/logoutSuccess\//', $referrer, $matches, PREG_OFFSET_CAPTURE); if (!empty($matches)) { - $referer = str_replace('logoutSuccess/', '', $referer); + $referrer = str_replace('logoutSuccess/', '', $referrer); } - if ($this->hostChecker->isOwnOrigin($referer)) { - $this->applyRedirect($referer); + if ($this->isReferrerValid($referrer) && $this->hostChecker->isOwnOrigin($referrer)) { + $this->applyRedirect($referrer); } } } elseif ($this->session->getAfterAuthUrl()) { @@ -237,6 +237,23 @@ protected function processLoggedCustomer() } } + /** + * Check if referrer is well-formatted + * + * @param string $referrer + * @return bool + */ + private function isReferrerValid(string $referrer) : bool + { + $result = true; + if (preg_match('/^(https?|\/\/)/i', $referrer)) { + if (filter_var($referrer, FILTER_VALIDATE_URL) === false) { + $result = false; + } + } + return $result; + } + /** * Prepare redirect URL * @@ -305,6 +322,7 @@ public function setRedirectCookie($route) ->setHttpOnly(true) ->setDuration(3600) ->setPath($this->storeManager->getStore()->getStorePath()) + ->setSameSite('Lax') ); } diff --git a/app/code/Magento/Customer/Model/Address/Validator/Customer.php b/app/code/Magento/Customer/Model/Address/Validator/Customer.php new file mode 100644 index 0000000000000..5b1d6decd151b --- /dev/null +++ b/app/code/Magento/Customer/Model/Address/Validator/Customer.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Address\Validator; + +use Magento\Customer\Model\Address\AbstractAddress; +use Magento\Customer\Model\Address\ValidatorInterface; +use Magento\Customer\Model\AddressFactory; +use Magento\Quote\Api\Data\AddressInterface as QuoteAddressInterface; + +/** + * Validates that current Address is related to given Customer. + */ +class Customer implements ValidatorInterface +{ + /** + * @var AddressFactory + */ + private $addressFactory; + + /** + * @param AddressFactory $addressFactory + */ + public function __construct(AddressFactory $addressFactory) + { + $this->addressFactory = $addressFactory; + } + + /** + * @inheritDoc + */ + public function validate(AbstractAddress $address): array + { + $errors = []; + $addressId = $address instanceof QuoteAddressInterface ? $address->getCustomerAddressId() : $address->getId(); + if ($addressId !== null) { + $addressCustomerId = (int) $address->getCustomerId(); + $originalAddressCustomerId = (int) $this->addressFactory->create() + ->load($addressId) + ->getCustomerId(); + + if ($originalAddressCustomerId !== 0 && $originalAddressCustomerId !== $addressCustomerId) { + $errors[] = __( + 'Provided customer ID "%customer_id" isn\'t related to current customer address.', + ['customer_id' => $addressCustomerId] + ); + } + } + + return $errors; + } +} diff --git a/app/code/Magento/Customer/Model/Data/GroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Data/GroupExcludedWebsite.php new file mode 100644 index 0000000000000..6ebe39e554ba0 --- /dev/null +++ b/app/code/Magento/Customer/Model/Data/GroupExcludedWebsite.php @@ -0,0 +1,93 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Data; + +use Magento\Customer\Api\Data\GroupExcludedWebsiteExtensionInterface; +use Magento\Customer\Api\Data\GroupExcludedWebsiteInterface; +use Magento\Framework\Model\AbstractExtensibleModel; + +/** + * Customer Group Excluded Website data model. + */ +class GroupExcludedWebsite extends AbstractExtensibleModel implements GroupExcludedWebsiteInterface +{ + /** + * Define resource model. + * + * @return void + */ + protected function _construct() + { + $this->_init(\Magento\Customer\Model\ResourceModel\GroupExcludedWebsite::class); + } + + /** + * {@inheritdoc} + */ + public function getGroupWebsiteId(): ?int + { + return $this->getData(self::ID); + } + + /** + * {@inheritdoc} + */ + public function setGroupWebsiteId(int $id): GroupExcludedWebsiteInterface + { + return $this->setData(self::ID, $id); + } + + /** + * {@inheritdoc} + */ + public function getGroupId(): ?int + { + return $this->getData(self::GROUP_ID); + } + + /** + * {@inheritdoc} + */ + public function setGroupId(int $id): GroupExcludedWebsiteInterface + { + return $this->setData(self::GROUP_ID, $id); + } + + /** + * {@inheritdoc} + */ + public function getExcludedWebsiteId(): ?int + { + return $this->getData(self::WEBSITE_ID); + } + + /** + * {@inheritdoc} + */ + public function setExcludedWebsiteId(int $websiteId): GroupExcludedWebsiteInterface + { + return $this->setData(self::WEBSITE_ID, $websiteId); + } + + /** + * {@inheritdoc} + */ + public function getExtensionAttributes(): ?GroupExcludedWebsiteExtensionInterface + { + return $this->_getExtensionAttributes(); + } + + /** + * {@inheritdoc} + */ + public function setExtensionAttributes( + GroupExcludedWebsiteExtensionInterface $extensionAttributes + ): GroupExcludedWebsiteInterface { + return $this->_setExtensionAttributes($extensionAttributes); + } +} diff --git a/app/code/Magento/Customer/Model/EmailNotification.php b/app/code/Magento/Customer/Model/EmailNotification.php index 55d82e0d7ccbe..a4f85a9c4a0c9 100644 --- a/app/code/Magento/Customer/Model/EmailNotification.php +++ b/app/code/Magento/Customer/Model/EmailNotification.php @@ -10,6 +10,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\Mail\Template\SenderResolverInterface; +use Magento\Store\Model\App\Emulation; use Magento\Store\Model\StoreManagerInterface; use Magento\Framework\Mail\Template\TransportBuilder; use Magento\Customer\Helper\View as CustomerViewHelper; @@ -103,6 +104,11 @@ class EmailNotification implements EmailNotificationInterface */ private $senderResolver; + /** + * @var Emulation + */ + private $emulation; + /** * @param CustomerRegistry $customerRegistry * @param StoreManagerInterface $storeManager @@ -111,6 +117,7 @@ class EmailNotification implements EmailNotificationInterface * @param DataObjectProcessor $dataProcessor * @param ScopeConfigInterface $scopeConfig * @param SenderResolverInterface|null $senderResolver + * @param Emulation|null $emulation */ public function __construct( CustomerRegistry $customerRegistry, @@ -119,7 +126,8 @@ public function __construct( CustomerViewHelper $customerViewHelper, DataObjectProcessor $dataProcessor, ScopeConfigInterface $scopeConfig, - SenderResolverInterface $senderResolver = null + SenderResolverInterface $senderResolver = null, + Emulation $emulation =null ) { $this->customerRegistry = $customerRegistry; $this->storeManager = $storeManager; @@ -128,6 +136,7 @@ public function __construct( $this->dataProcessor = $dataProcessor; $this->scopeConfig = $scopeConfig; $this->senderResolver = $senderResolver ?? ObjectManager::getInstance()->get(SenderResolverInterface::class); + $this->emulation = $emulation ?? ObjectManager::getInstance()->get(Emulation::class); } /** @@ -274,7 +283,9 @@ private function sendEmailTemplate( ->addTo($email, $this->customerViewHelper->getCustomerName($customer)) ->getTransport(); + $this->emulation->startEnvironmentEmulation($storeId, \Magento\Framework\App\Area::AREA_FRONTEND); $transport->sendMessage(); + $this->emulation->stopEnvironmentEmulation(); } /** diff --git a/app/code/Magento/Customer/Model/FileProcessor.php b/app/code/Magento/Customer/Model/FileProcessor.php index 59e2d5fb2b577..f566d7e9a91f7 100644 --- a/app/code/Magento/Customer/Model/FileProcessor.php +++ b/app/code/Magento/Customer/Model/FileProcessor.php @@ -29,6 +29,10 @@ class FileProcessor */ const TMP_DIR = 'tmp'; + private const CUSTOMER_FILE_URL_PATH = 'customer/index/viewfile'; + + private const CUSTOMER_ADDRESS_FILE_URL_PATH = 'customer/address/viewfile'; + /** * @var WriteInterface */ @@ -64,6 +68,16 @@ class FileProcessor */ private $mime; + /** + * @var string + */ + private $customerFileUrlPath; + + /** + * @var string + */ + private $customerAddressFileUrlPath; + /** * @param Filesystem $filesystem * @param UploaderFactory $uploaderFactory @@ -72,6 +86,8 @@ class FileProcessor * @param string $entityTypeCode * @param Mime $mime * @param array $allowedExtensions + * @param string $customerFileUrlPath + * @param string $customerAddressFileUrlPath */ public function __construct( Filesystem $filesystem, @@ -80,7 +96,9 @@ public function __construct( EncoderInterface $urlEncoder, $entityTypeCode, Mime $mime, - array $allowedExtensions = [] + array $allowedExtensions = [], + string $customerFileUrlPath = self::CUSTOMER_FILE_URL_PATH, + string $customerAddressFileUrlPath = self::CUSTOMER_ADDRESS_FILE_URL_PATH ) { $this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); $this->uploaderFactory = $uploaderFactory; @@ -89,6 +107,8 @@ public function __construct( $this->entityTypeCode = $entityTypeCode; $this->mime = $mime; $this->allowedExtensions = $allowedExtensions; + $this->customerFileUrlPath = $customerFileUrlPath; + $this->customerAddressFileUrlPath = $customerAddressFileUrlPath; } /** @@ -159,14 +179,14 @@ public function getViewUrl($filePath, $type) if ($this->entityTypeCode == AddressMetadataInterface::ENTITY_TYPE_ADDRESS) { $viewUrl = $this->urlBuilder->getUrl( - 'customer/address/viewfile', + $this->customerAddressFileUrlPath, [$type => $this->urlEncoder->encode(ltrim($filePath, '/'))] ); } if ($this->entityTypeCode == CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER) { $viewUrl = $this->urlBuilder->getUrl( - 'customer/index/viewfile', + $this->customerFileUrlPath, [$type => $this->urlEncoder->encode(ltrim($filePath, '/'))] ); } diff --git a/app/code/Magento/Customer/Model/Metadata/Form/File.php b/app/code/Magento/Customer/Model/Metadata/Form/File.php index 1add044c50c9e..16730f89ccd26 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/File.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/File.php @@ -11,9 +11,9 @@ use Magento\Framework\Api\Data\ImageContentInterface; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\File\UploaderFactory; use Magento\Framework\Filesystem; -use Magento\Framework\Filesystem\Io\File as IoFile; /** * Processes files that are save for customer. @@ -62,11 +62,6 @@ class File extends AbstractData */ protected $fileProcessorFactory; - /** - * @var IoFile|null - */ - private $ioFile; - /** * Constructor * @@ -82,7 +77,6 @@ class File extends AbstractData * @param Filesystem $fileSystem * @param UploaderFactory $uploaderFactory * @param \Magento\Customer\Model\FileProcessorFactory|null $fileProcessorFactory - * @param IoFile|null $ioFile * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -97,8 +91,7 @@ public function __construct( \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $fileValidator, Filesystem $fileSystem, UploaderFactory $uploaderFactory, - FileProcessorFactory $fileProcessorFactory = null, - IoFile $ioFile = null + \Magento\Customer\Model\FileProcessorFactory $fileProcessorFactory = null ) { $value = $this->prepareFileValue($value); parent::__construct($localeDate, $logger, $attribute, $localeResolver, $value, $entityTypeCode, $isAjax); @@ -109,8 +102,6 @@ public function __construct( $this->fileProcessorFactory = $fileProcessorFactory ?: ObjectManager::getInstance() ->get(FileProcessorFactory::class); $this->fileProcessor = $this->fileProcessorFactory->create(['entityTypeCode' => $this->_entityTypeCode]); - $this->ioFile = $ioFile ?: ObjectManager::getInstance() - ->get(IoFile::class); } /** @@ -137,9 +128,10 @@ public function extractValue(\Magento\Framework\App\RequestInterface $request) $mainScope = $this->_requestScope; $scopes = []; } - + // phpcs:disable Magento2.Security.Superglobal if (!empty($_FILES[$mainScope])) { foreach ($_FILES[$mainScope] as $fileKey => $scopeData) { + // phpcs:enable Magento2.Security.Superglobal foreach ($scopes as $scopeName) { if (isset($scopeData[$scopeName])) { $scopeData = $scopeData[$scopeName]; @@ -164,8 +156,10 @@ public function extractValue(\Magento\Framework\App\RequestInterface $request) $value = []; } } else { + // phpcs:disable Magento2.Security.Superglobal if (isset($_FILES[$attrCode])) { $value = $_FILES[$attrCode]; + // phpcs:enable Magento2.Security.Superglobal } else { $value = []; } @@ -189,9 +183,7 @@ protected function _validateByRules($value) { $label = $value['name']; $rules = $this->getAttribute()->getValidationRules(); - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $pathInfo = $this->ioFile->getPathInfo($label); - $extension = $pathInfo['extension'] ?? null; + $extension = $this->getFileExtension($value['name']); $fileExtensions = ArrayObjectSearch::getArrayElementByName( $rules, 'file_extensions' @@ -229,6 +221,28 @@ protected function _validateByRules($value) return []; } + /** + * Get file extension from the file if it exists, otherwise, get from filename. + * + * @param string $fileName + * @return string + */ + private function getFileExtension(string $fileName): string + { + return pathinfo($fileName, PATHINFO_EXTENSION); + } + + /** + * Get file basename from the file if it exists, otherwise, get from filename. + * + * @param string $fileName + * @return string + */ + private function getFileBasename(string $fileName): string + { + return pathinfo($fileName, PATHINFO_BASENAME); + } + /** * Helper function that checks if the file was uploaded. * @@ -245,8 +259,7 @@ protected function _isUploadedFile($filename) } // This case is required for file uploader UI component - $temporaryFile = FileProcessor::TMP_DIR . DIRECTORY_SEPARATOR . - $this->ioFile->getPathInfo($filename)['basename']; + $temporaryFile = FileProcessor::TMP_DIR . '/' . $this->getFileBasename($filename); if ($this->fileProcessor->isExist($temporaryFile)) { return true; } @@ -307,7 +320,10 @@ public function compactValue($value) } // Remove outdated file (in the case of file uploader UI component) - if (!empty($this->_value) && !empty($value['delete'])) { + if (!empty($this->_value) + && (!empty($value['delete']) + || ($this->_entityTypeCode == 'customer' && empty($value))) + ) { $this->fileProcessor->removeUploadedFile($this->_value); return $value; } @@ -368,16 +384,20 @@ protected function processInputFieldValue($value) } if (!empty($value['tmp_name'])) { + $uploader = $this->uploaderFactory->create(['fileId' => $value]); + $fileExtension = $uploader->getFileExtension(); + if (!$this->_fileValidator->isValid($fileExtension)) { + throw new LocalizedException($this->_fileValidator->getMessages()[$fileExtension]); + } + $uploader->setFilesDispersion(true); + $uploader->setFilenamesCaseSensitivity(false); + $uploader->setAllowRenameFiles(true); try { - $uploader = $this->uploaderFactory->create(['fileId' => $value]); - $uploader->setFilesDispersion(true); - $uploader->setFilenamesCaseSensitivity(false); - $uploader->setAllowRenameFiles(true); $uploader->save($mediaDir->getAbsolutePath($this->_entityTypeCode), $value['name']); - $result = $uploader->getUploadedFileName(); } catch (\Exception $e) { $this->_logger->critical($e); } + $result = $uploader->getUploadedFileName(); } return $result; diff --git a/app/code/Magento/Customer/Model/Plugin/CustomerGridIndexAfterWebsiteDelete.php b/app/code/Magento/Customer/Model/Plugin/CustomerGridIndexAfterWebsiteDelete.php new file mode 100644 index 0000000000000..0dc20a5a62383 --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/CustomerGridIndexAfterWebsiteDelete.php @@ -0,0 +1,75 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin; + +use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory as CustomerCollectionFactory; +use Magento\Framework\Indexer\IndexerRegistry; +use Magento\Store\Model\Website; + +/** + * Run customer_grid indexer after deleting website for specified customers + */ +class CustomerGridIndexAfterWebsiteDelete +{ + private const CUSTOMER_GRID_INDEXER_ID = 'customer_grid'; + + /** + * @var IndexerRegistry + */ + private $indexerRegistry; + + /** + * @var CustomerCollectionFactory + */ + private $customerCollectionFactory; + + /** + * @param IndexerRegistry $indexerRegistry + * @param CustomerCollectionFactory $customerCollectionFactory + */ + public function __construct(IndexerRegistry $indexerRegistry, CustomerCollectionFactory $customerCollectionFactory) + { + $this->indexerRegistry = $indexerRegistry; + $this->customerCollectionFactory = $customerCollectionFactory; + } + + /** + * Run customer_grid indexer after deleting website + * + * @param Website $subject + * @param callable $proceed + * @return Website + */ + public function aroundDelete(Website $subject, callable $proceed): Website + { + $customerIds = $this->getCustomerIdsByWebsiteId((int) $subject->getId()); + $result = $proceed(); + + if ($customerIds) { + $this->indexerRegistry->get(self::CUSTOMER_GRID_INDEXER_ID) + ->reindexList($customerIds); + } + + return $result; + } + + /** + * Returns customer ids by website id + * + * @param int $websiteId + * @return array + */ + private function getCustomerIdsByWebsiteId(int $websiteId): array + { + $collection = $this->customerCollectionFactory->create(); + $collection->addFieldToFilter('website_id', $websiteId); + + return $collection->getAllIds(); + } +} diff --git a/app/code/Magento/Customer/Model/Plugin/DeleteCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Plugin/DeleteCustomerGroupExcludedWebsite.php new file mode 100644 index 0000000000000..aa86b1fd97d20 --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/DeleteCustomerGroupExcludedWebsite.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin; + +use Magento\Catalog\Model\Indexer\Product\Price\Processor; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Customer\Model\ResourceModel\GroupExcludedWebsiteRepository; +use Magento\Framework\Exception\CouldNotDeleteException; +use Magento\Framework\Exception\LocalizedException; + +/** + * Delete customer group excluded websites while deleting customer group by id. + */ +class DeleteCustomerGroupExcludedWebsite +{ + /** + * @var GroupExcludedWebsiteRepository + */ + private $groupExcludedWebsiteRepository; + + /** + * @var Processor + */ + private $priceIndexProcessor; + + /** + * @param GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + * @param Processor $priceIndexProcessor + */ + public function __construct( + GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository, + Processor $priceIndexProcessor + ) { + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository; + $this->priceIndexProcessor = $priceIndexProcessor; + } + + /** + * Delete excluded customer group websites while deleting customer group by id. + * + * @param GroupRepositoryInterface $subject + * @param bool $result + * @param string $groupId + * @return bool + * @throws CouldNotDeleteException + * @throws LocalizedException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterDeleteById(GroupRepositoryInterface $subject, bool $result, string $groupId): bool + { + $excludedWebsites = $this->groupExcludedWebsiteRepository->getCustomerGroupExcludedWebsites((int)$groupId); + if (!empty($excludedWebsites)) { + try { + $this->groupExcludedWebsiteRepository->delete((int)$groupId); + } catch (LocalizedException $e) { + throw new CouldNotDeleteException( + __( + 'Could not delete customer group website with ID: %1', + $groupId + ), + $e + ); + } + // invalidate product price index if websites were deleted from customer group exclusion + $priceIndexer = $this->priceIndexProcessor->getIndexer(); + $priceIndexer->invalidate(); + } + + return $result; + } +} diff --git a/app/code/Magento/Customer/Model/Plugin/GetByIdCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Plugin/GetByIdCustomerGroupExcludedWebsite.php new file mode 100644 index 0000000000000..7600f242641b8 --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/GetByIdCustomerGroupExcludedWebsite.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin; + +use Magento\Customer\Api\Data\GroupInterface; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Customer\Model\ResourceModel\GroupExcludedWebsiteRepository; +use Magento\Framework\Exception\LocalizedException; + +/** + * Add excluded websites to customer group as extension attributes while retrieving this group by id. + */ +class GetByIdCustomerGroupExcludedWebsite +{ + /** + * @var \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory + */ + private $groupExtensionInterfaceFactory; + + /** + * @var GroupExcludedWebsiteRepository + */ + private $groupExcludedWebsiteRepository; + + /** + * @param \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory + * @param GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + */ + public function __construct( + \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory, + GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + ) { + $this->groupExtensionInterfaceFactory = $groupExtensionInterfaceFactory; + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository; + } + + /** + * Add excluded websites as extension attributes while getting customer group by id. + * + * @param GroupRepositoryInterface $subject + * @param GroupInterface $result + * @param int $id + * @return GroupInterface + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @throws LocalizedException + */ + public function afterGetById( + GroupRepositoryInterface $subject, + GroupInterface $result, + int $id + ): GroupInterface { + $excludedWebsites = $this->groupExcludedWebsiteRepository->getCustomerGroupExcludedWebsites($id); + if (!empty($excludedWebsites)) { + $customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create(); + $customerGroupExtensionAttributes->setExcludeWebsiteIds($excludedWebsites); + $result->setExtensionAttributes($customerGroupExtensionAttributes); + } + + return $result; + } +} diff --git a/app/code/Magento/Customer/Model/Plugin/GetListCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Plugin/GetListCustomerGroupExcludedWebsite.php new file mode 100644 index 0000000000000..a3adb28da5b4d --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/GetListCustomerGroupExcludedWebsite.php @@ -0,0 +1,77 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin; + +use Magento\Customer\Api\Data\GroupSearchResultsInterface; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Customer\Model\ResourceModel\GroupExcludedWebsiteRepository; +use Magento\Framework\Api\SearchCriteriaInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Add excluded websites to customer groups as extension attributes while retrieving the list of all groups. + */ +class GetListCustomerGroupExcludedWebsite +{ + /** + * @var \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory + */ + private $groupExtensionInterfaceFactory; + + /** + * @var GroupExcludedWebsiteRepository + */ + private $groupExcludedWebsiteRepository; + + /** + * @param \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory + * @param GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + */ + public function __construct( + \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory, + GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + ) { + $this->groupExtensionInterfaceFactory = $groupExtensionInterfaceFactory; + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository; + } + + /** + * Add excluded websites to customer groups as extension attributes while retrieving the list of all groups. + * + * @param GroupRepositoryInterface $subject + * @param GroupSearchResultsInterface $result + * @param SearchCriteriaInterface $searchCriteria + * @return GroupSearchResultsInterface + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @throws LocalizedException + */ + public function afterGetList( + GroupRepositoryInterface $subject, + GroupSearchResultsInterface $result, + SearchCriteriaInterface $searchCriteria + ): GroupSearchResultsInterface { + $customerGroups = $result->getItems(); + if (!empty($customerGroups)) { + $allExcludedWebsites = $this->groupExcludedWebsiteRepository->getAllExcludedWebsites(); + if (!empty($allExcludedWebsites)) { + foreach ($customerGroups as $customerGroup) { + $customerGroupId = (int)$customerGroup->getId(); + if (array_key_exists($customerGroupId, $allExcludedWebsites)) { + $excludedWebsites = $allExcludedWebsites[$customerGroupId]; + $customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create(); + $customerGroupExtensionAttributes->setExcludeWebsiteIds($excludedWebsites); + $customerGroup->setExtensionAttributes($customerGroupExtensionAttributes); + } + } + } + } + + return $result; + } +} diff --git a/app/code/Magento/Customer/Model/Plugin/SaveCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Plugin/SaveCustomerGroupExcludedWebsite.php new file mode 100644 index 0000000000000..33a857fd35277 --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/SaveCustomerGroupExcludedWebsite.php @@ -0,0 +1,149 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin; + +use Magento\Catalog\Model\Indexer\Product\Price\Processor; +use Magento\Customer\Api\Data\GroupInterface; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Customer\Model\Data\GroupExcludedWebsiteFactory; +use Magento\Framework\Exception\CouldNotSaveException; +use Magento\Framework\Exception\LocalizedException; +use Magento\Store\Model\System\Store as SystemStore; + +/** + * Save customer group websites excluded for certain customer group. + */ +class SaveCustomerGroupExcludedWebsite +{ + /** + * @var GroupExcludedWebsiteFactory + */ + private $groupExcludedWebsiteFactory; + + /** + * @var GroupExcludedWebsiteRepositoryInterface + */ + private $groupExcludedWebsiteRepository; + + /** + * @var SystemStore + */ + private $systemStore; + + /** + * @var Processor + */ + private $priceIndexProcessor; + + /** + * @param GroupExcludedWebsiteFactory $groupExcludedWebsiteFactory + * @param GroupExcludedWebsiteRepositoryInterface $groupExcludedWebsiteRepository + * @param SystemStore $systemStore + * @param Processor $priceIndexProcessor + */ + public function __construct( + GroupExcludedWebsiteFactory $groupExcludedWebsiteFactory, + GroupExcludedWebsiteRepositoryInterface $groupExcludedWebsiteRepository, + SystemStore $systemStore, + Processor $priceIndexProcessor + ) { + $this->groupExcludedWebsiteFactory = $groupExcludedWebsiteFactory; + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository; + $this->systemStore = $systemStore; + $this->priceIndexProcessor = $priceIndexProcessor; + } + + /** + * Save excluded websites for customer group. + * + * @param GroupRepositoryInterface $subject + * @param GroupInterface $result + * @param GroupInterface $group + * @return GroupInterface + * + * @throws CouldNotSaveException + * @throws LocalizedException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterSave( + GroupRepositoryInterface $subject, + GroupInterface $result, + GroupInterface $group + ): GroupInterface { + if ($result->getExtensionAttributes() && $result->getExtensionAttributes()->getExcludeWebsiteIds() !== null) { + $websitesToExclude = array_intersect( + $this->getAllWebsites(), + $result->getExtensionAttributes()->getExcludeWebsiteIds() + ); + $customerGroupId = (int)$result->getId(); + + // prevent NOT LOGGED IN customers with id 0 to have excluded websites + if ($customerGroupId !== null && $customerGroupId !== 0) { + $excludedWebsites = $this->groupExcludedWebsiteRepository + ->getCustomerGroupExcludedWebsites($customerGroupId); + $isValueChanged = $this->isValueChanged($excludedWebsites, $websitesToExclude); + if ($isValueChanged) { + $this->groupExcludedWebsiteRepository->delete($customerGroupId); + foreach ($websitesToExclude as $websiteToExclude) { + $groupExcludedWebsite = $this->groupExcludedWebsiteFactory->create(); + $groupExcludedWebsite->setGroupId($customerGroupId); + $groupExcludedWebsite->setExcludedWebsiteId((int)$websiteToExclude); + try { + $this->groupExcludedWebsiteRepository->save($groupExcludedWebsite); + } catch (LocalizedException $e) { + throw new CouldNotSaveException( + __( + 'Could not save customer group website to exclude with ID: %1', + $websiteToExclude + ), + $e + ); + } + } + // invalidate product price index if new websites are excluded from customer group + $priceIndexer = $this->priceIndexProcessor->getIndexer(); + $priceIndexer->invalidate(); + } + } + } + + return $result; + } + + /** + * Get all websites. + * + * @return array + */ + private function getAllWebsites(): array + { + $websiteCollection = $this->systemStore->getWebsiteCollection(); + + $websites = []; + foreach ($websiteCollection as $website) { + $websites[] = (int)$website->getWebsiteId(); + } + + return $websites; + } + + /** + * Check if there are new websites to exclude from the customer group. + * + * @param array $currentValues + * @param array $newValues + * @return bool + */ + private function isValueChanged(array $currentValues, array $newValues): bool + { + return !($currentValues === array_intersect($currentValues, $newValues) + && $newValues === array_intersect($newValues, $currentValues)); + } + +} diff --git a/app/code/Magento/Customer/Model/Plugin/Website/DeleteCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Model/Plugin/Website/DeleteCustomerGroupExcludedWebsite.php new file mode 100644 index 0000000000000..aac0c436d290f --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/Website/DeleteCustomerGroupExcludedWebsite.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin\Website; + +use Magento\Catalog\Model\Indexer\Product\Price\Processor; +use Magento\Customer\Model\ResourceModel\GroupExcludedWebsiteRepository; +use Magento\Framework\Exception\LocalizedException; +use Magento\Store\Model\Website; + +/** + * Delete excluded customer group website after deleting the website. + */ +class DeleteCustomerGroupExcludedWebsite +{ + /** + * @var GroupExcludedWebsiteRepository + */ + private $groupExcludedWebsiteRepository; + + /** + * @var Processor + */ + private $priceIndexProcessor; + + /** + * @param GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository + * @param Processor $priceIndexProcessor + */ + public function __construct( + GroupExcludedWebsiteRepository $groupExcludedWebsiteRepository, + Processor $priceIndexProcessor + ) { + $this->groupExcludedWebsiteRepository = $groupExcludedWebsiteRepository; + $this->priceIndexProcessor = $priceIndexProcessor; + } + + /** + * Delete excluded customer group website after deleting this website. + * + * @param Website $subject + * @param Website $result + * @return Website + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @throws LocalizedException + */ + public function afterDelete( + Website $subject, + Website $result + ): Website { + $websiteId = (int)$result->getId(); + if (!empty($websiteId)) { + $deletedRecords = $this->groupExcludedWebsiteRepository->deleteByWebsite($websiteId); + if ($deletedRecords) { + // invalidate product price index if website was deleted from customer group exclusion + $priceIndexer = $this->priceIndexProcessor->getIndexer(); + $priceIndexer->invalidate(); + } + } + + return $result; + } +} diff --git a/app/code/Magento/Customer/Model/Renderer/Region.php b/app/code/Magento/Customer/Model/Renderer/Region.php index a26cfb96fe02a..a3d747b0c0236 100644 --- a/app/code/Magento/Customer/Model/Renderer/Region.php +++ b/app/code/Magento/Customer/Model/Renderer/Region.php @@ -38,6 +38,11 @@ class Region implements \Magento\Framework\Data\Form\Element\Renderer\RendererIn */ protected $_countryFactory; + /** + * @var \Magento\Directory\Helper\Data + */ + private $_directoryHelper; + /** * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Directory\Helper\Data $directoryHelper diff --git a/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php b/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php index 0fab27161ce25..e14594daf8011 100644 --- a/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php +++ b/app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php @@ -7,10 +7,12 @@ use Magento\Customer\Model\ResourceModel\Customer; use Magento\Customer\Ui\Component\DataProvider\Document; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy; use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory; use Magento\Framework\Event\ManagerInterface as EventManager; use Magento\Framework\Locale\ResolverInterface; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult; use Psr\Log\LoggerInterface as Logger; @@ -24,6 +26,11 @@ class Collection extends SearchResult */ private $localeResolver; + /** + * @var TimezoneInterface + */ + private $timeZone; + /** * @inheritdoc */ @@ -42,6 +49,7 @@ class Collection extends SearchResult * @param ResolverInterface $localeResolver * @param string $mainTable * @param string $resourceModel + * @param TimezoneInterface|null $timeZone */ public function __construct( EntityFactory $entityFactory, @@ -50,10 +58,13 @@ public function __construct( EventManager $eventManager, ResolverInterface $localeResolver, $mainTable = 'customer_grid_flat', - $resourceModel = Customer::class + $resourceModel = Customer::class, + TimezoneInterface $timeZone = null ) { $this->localeResolver = $localeResolver; parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel); + $this->timeZone = $timeZone ?: ObjectManager::getInstance() + ->get(TimezoneInterface::class); } /** @@ -81,6 +92,14 @@ public function addFieldToFilter($field, $condition = null) return $this; } + if ($field === 'created_at') { + if (is_array($condition)) { + foreach ($condition as $key => $value) { + $condition[$key] = $this->timeZone->convertConfigTimeToUtc($value); + } + } + } + if (is_string($field) && count(explode('.', $field)) === 1) { $field = 'main_table.' . $field; } diff --git a/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsite.php b/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsite.php new file mode 100644 index 0000000000000..61696154f2314 --- /dev/null +++ b/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsite.php @@ -0,0 +1,105 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\ResourceModel; + +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Model\ResourceModel\Db\VersionControl\AbstractDb; + +/** + * Excluded customer group website resource model. + */ +class GroupExcludedWebsite extends AbstractDb +{ + /** + * Resource initialization + * + * @return void + */ + protected function _construct() + { + $this->_init('customer_group_excluded_website', 'entity_id'); + } + + /** + * Retrieve excluded website ids related to customer group. + * + * @param int $customerGroupId + * @return array + * @throws LocalizedException + */ + public function loadCustomerGroupExcludedWebsites(int $customerGroupId): array + { + $connection = $this->getConnection(); + $bind = ['customer_group_id' => $customerGroupId]; + + $select = $connection->select()->from( + $this->getMainTable(), + ['website_id'] + )->where( + 'customer_group_id = :customer_group_id' + ); + + return $connection->fetchCol($select, $bind); + } + + /** + * Retrieve all excluded website ids per related customer group. + * + * @return array + * @throws LocalizedException + */ + public function loadAllExcludedWebsites(): array + { + $connection = $this->getConnection(); + + $select = $connection->select()->from( + $this->getMainTable(), + ['customer_group_id', 'website_id'] + ); + + return $connection->fetchAll($select); + } + + /** + * Delete customer group with its excluded websites. + * + * @param int $customerGroupId + * @return GroupExcludedWebsite + * @throws LocalizedException + */ + public function delete($customerGroupId) + { + $connection = $this->getConnection(); + $connection->beginTransaction(); + try { + $where = $connection->quoteInto('customer_group_id = ?', $customerGroupId); + $connection->delete( + $this->getMainTable(), + $where + ); + $connection->commit(); + } catch (\Exception $e) { + $connection->rollBack(); + throw $e; + } + + return $this; + } + + /** + * Delete customer group excluded website by id. + * + * @param int $websiteId + * @return int + * @throws LocalizedException + */ + public function deleteByWebsite(int $websiteId): int + { + return $this->getConnection()->delete($this->getMainTable(), ['website_id = ?' => $websiteId]); + } +} diff --git a/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsiteRepository.php b/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsiteRepository.php new file mode 100644 index 0000000000000..1237ff3017c16 --- /dev/null +++ b/app/code/Magento/Customer/Model/ResourceModel/GroupExcludedWebsiteRepository.php @@ -0,0 +1,119 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\ResourceModel; + +use Magento\Customer\Api\Data\GroupExcludedWebsiteInterface; +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Framework\Exception\CouldNotSaveException; +use Magento\Framework\Exception\LocalizedException; + +/** + * Customer group website repository for CRUD operations with excluded websites. + */ +class GroupExcludedWebsiteRepository implements GroupExcludedWebsiteRepositoryInterface +{ + /** + * @var GroupExcludedWebsite + */ + private $groupExcludedWebsiteResourceModel; + + /** + * @param GroupExcludedWebsite $groupExcludedWebsiteResourceModel + */ + public function __construct( + GroupExcludedWebsite $groupExcludedWebsiteResourceModel + ) { + $this->groupExcludedWebsiteResourceModel = $groupExcludedWebsiteResourceModel; + } + + /** + * @inheritdoc + */ + public function save(GroupExcludedWebsiteInterface $groupExcludedWebsite): GroupExcludedWebsiteInterface + { + try { + $this->groupExcludedWebsiteResourceModel->save($groupExcludedWebsite); + } catch (\Exception $e) { + throw new CouldNotSaveException( + __('Could not save customer group website to exclude from customer group: "%1"', $e->getMessage()) + ); + } + + return $groupExcludedWebsite; + } + + /** + * @inheritdoc + */ + public function getCustomerGroupExcludedWebsites(int $customerGroupId): array + { + try { + return $this->groupExcludedWebsiteResourceModel->loadCustomerGroupExcludedWebsites($customerGroupId); + } catch (LocalizedException $e) { + throw new LocalizedException( + __('Could not retrieve excluded customer group websites by customer group: "%1"', $e->getMessage()) + ); + } + } + + /** + * @inheritdoc + */ + public function getAllExcludedWebsites(): array + { + try { + $allExcludedWebsites = $this->groupExcludedWebsiteResourceModel->loadAllExcludedWebsites(); + } catch (LocalizedException $e) { + throw new LocalizedException( + __('Could not retrieve all excluded customer group websites.') + ); + } + + $excludedWebsites = []; + + if (!empty($allExcludedWebsites)) { + foreach ($allExcludedWebsites as $allExcludedWebsite) { + $customerGroupId = (int)$allExcludedWebsite['customer_group_id']; + $websiteId = (int)$allExcludedWebsite['website_id']; + $excludedWebsites[$customerGroupId][] = $websiteId; + } + } + + return $excludedWebsites; + } + + /** + * @inheritdoc + */ + public function delete(int $customerGroupId): bool + { + try { + $this->groupExcludedWebsiteResourceModel->delete($customerGroupId); + } catch (LocalizedException $e) { + throw new LocalizedException( + __('Could not delete customer group with its excluded websites.') + ); + } + + return true; + } + + /** + * @inheritdoc + */ + public function deleteByWebsite(int $websiteId): bool + { + try { + return (bool)$this->groupExcludedWebsiteResourceModel->deleteByWebsite($websiteId); + } catch (LocalizedException $e) { + throw new LocalizedException( + __('Could not delete customer group excluded website by id.') + ); + } + } +} diff --git a/app/code/Magento/Customer/Model/ResourceModel/GroupRepository.php b/app/code/Magento/Customer/Model/ResourceModel/GroupRepository.php index 10979cd9cc22a..1ad002d5f4311 100644 --- a/app/code/Magento/Customer/Model/ResourceModel/GroupRepository.php +++ b/app/code/Magento/Customer/Model/ResourceModel/GroupRepository.php @@ -134,6 +134,15 @@ public function save(\Magento\Customer\Api\Data\GroupInterface $group) $taxClassId = $group->getTaxClassId() ?: self::DEFAULT_TAX_CLASS_ID; $this->_verifyTaxClassModel($taxClassId, $group); $groupModel->setTaxClassId($taxClassId); + + $groupDataAttributes = $this->dataObjectProcessor->buildOutputDataArray( + $group, + \Magento\Customer\Api\Data\GroupInterface::class + ); + + if (!empty($groupDataAttributes['extension_attributes'])) { + $groupModel->setDataUsingMethod('extension_attributes', $groupDataAttributes['extension_attributes']); + } } try { diff --git a/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerGroupId.php b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerGroupId.php new file mode 100644 index 0000000000000..346be97dc19c2 --- /dev/null +++ b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerGroupId.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\Webapi\Rest\Request\ParamOverriderInterface; + +/** + * Replaces a "%customer_group_id%" value with the real customer id + */ +class ParamOverriderCustomerGroupId implements ParamOverriderInterface +{ + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @param UserContextInterface $userContext + * @param CustomerRepositoryInterface $customerRepository + */ + public function __construct(UserContextInterface $userContext, CustomerRepositoryInterface $customerRepository) + { + $this->userContext = $userContext; + $this->customerRepository = $customerRepository; + } + + /** + * @inheritDoc + */ + public function getOverriddenValue() + { + if ((int) $this->userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + return $this->customerRepository->getById($this->userContext->getUserId())->getGroupId(); + } + + return null; + } +} diff --git a/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerStoreId.php b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerStoreId.php new file mode 100644 index 0000000000000..c7a2eb20be9cd --- /dev/null +++ b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerStoreId.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\Webapi\Rest\Request\ParamOverriderInterface; + +/** + * Replaces a "%customer_store_id%" value with the real customer id + */ +class ParamOverriderCustomerStoreId implements ParamOverriderInterface +{ + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @param UserContextInterface $userContext + * @param CustomerRepositoryInterface $customerRepository + */ + public function __construct(UserContextInterface $userContext, CustomerRepositoryInterface $customerRepository) + { + $this->userContext = $userContext; + $this->customerRepository = $customerRepository; + } + + /** + * @inheritDoc + */ + public function getOverriddenValue() + { + if ((int) $this->userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + return $this->customerRepository->getById($this->userContext->getUserId())->getStoreId(); + } + + return null; + } +} diff --git a/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerWebsiteId.php b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerWebsiteId.php new file mode 100644 index 0000000000000..9754937972083 --- /dev/null +++ b/app/code/Magento/Customer/Model/Webapi/ParamOverriderCustomerWebsiteId.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\Webapi\Rest\Request\ParamOverriderInterface; + +/** + * Replaces a "%customer_website_id%" value with the real customer id + */ +class ParamOverriderCustomerWebsiteId implements ParamOverriderInterface +{ + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @param UserContextInterface $userContext + * @param CustomerRepositoryInterface $customerRepository + */ + public function __construct(UserContextInterface $userContext, CustomerRepositoryInterface $customerRepository) + { + $this->userContext = $userContext; + $this->customerRepository = $customerRepository; + } + + /** + * @inheritDoc + */ + public function getOverriddenValue() + { + if ((int) $this->userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + return $this->customerRepository->getById($this->userContext->getUserId())->getWebsiteId(); + } + + return null; + } +} diff --git a/app/code/Magento/Customer/Observer/CatalogRule/AddCustomerGroupExcludedWebsite.php b/app/code/Magento/Customer/Observer/CatalogRule/AddCustomerGroupExcludedWebsite.php new file mode 100644 index 0000000000000..019c63d78f3bf --- /dev/null +++ b/app/code/Magento/Customer/Observer/CatalogRule/AddCustomerGroupExcludedWebsite.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Observer\CatalogRule; + +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Framework\Event\Observer; +use Magento\Framework\Event\ObserverInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Add excluded customer group websites to catalog rule. + */ +class AddCustomerGroupExcludedWebsite implements ObserverInterface +{ + /** + * @var GroupExcludedWebsiteRepositoryInterface + */ + private $customerGroupExcludedWebsiteRepository; + + /** + * @param GroupExcludedWebsiteRepositoryInterface $customerGroupExcludedWebsiteRepository + */ + public function __construct( + GroupExcludedWebsiteRepositoryInterface $customerGroupExcludedWebsiteRepository + ) { + $this->customerGroupExcludedWebsiteRepository = $customerGroupExcludedWebsiteRepository; + } + + /** + * Add excluded customer group websites to catalog rule as extension attributes. + * + * @param Observer $observer + * @return void + * @throws LocalizedException + */ + public function execute(\Magento\Framework\Event\Observer $observer): void + { + $catalogRule = $observer->getData('catalog_rule'); + $rules = $catalogRule->getItems(); + if (!empty($rules)) { + $allExcludedWebsiteIds = $this->customerGroupExcludedWebsiteRepository->getAllExcludedWebsites(); + if (!empty($allExcludedWebsiteIds)) { + foreach ($rules as $rule) { + if ($rule->getIsActive()) { + $excludedWebsites = []; + $customerGroupIds = $rule->getCustomerGroupIds(); + if (!empty($customerGroupIds)) { + foreach ($customerGroupIds as $customerGroupId) { + if (array_key_exists((int)$customerGroupId, $allExcludedWebsiteIds)) { + $excludedWebsites[$customerGroupId] = $allExcludedWebsiteIds[(int)$customerGroupId]; + } + } + if (!empty($excludedWebsites)) { + $ruleExtensionAttributes = $rule->getExtensionAttributes(); + $ruleExtensionAttributes->setExcludeWebsiteIds($excludedWebsites); + $rule->setExtensionAttributes($ruleExtensionAttributes); + } + } + } + } + } + } + } +} diff --git a/app/code/Magento/Customer/Observer/CustomerGroupAuthenticate.php b/app/code/Magento/Customer/Observer/CustomerGroupAuthenticate.php new file mode 100644 index 0000000000000..063c4f057df2e --- /dev/null +++ b/app/code/Magento/Customer/Observer/CustomerGroupAuthenticate.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Observer; + +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Framework\Event\Observer; +use Magento\Framework\Event\ObserverInterface; +use Magento\Framework\Exception\LocalizedException; + +/** + * Customer group authenticate observer. + */ +class CustomerGroupAuthenticate implements ObserverInterface +{ + /** + * @var GroupExcludedWebsiteRepositoryInterface + */ + private $customerGroupExcludedWebsiteRepository; + + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + private $storeManager; + + /** + * @param GroupExcludedWebsiteRepositoryInterface $customerGroupExcludedWebsiteRepository + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + */ + public function __construct( + GroupExcludedWebsiteRepositoryInterface $customerGroupExcludedWebsiteRepository, + \Magento\Store\Model\StoreManagerInterface $storeManager + ) { + $this->customerGroupExcludedWebsiteRepository = $customerGroupExcludedWebsiteRepository; + $this->storeManager = $storeManager; + } + + /** + * Do not authenticate customer if website is excluded from customer's group. + * + * @param Observer $observer + * @return void + * @throws LocalizedException + */ + public function execute(Observer $observer): void + { + $websiteId = $this->storeManager->getStore()->getWebsiteId(); + $customer = $observer->getData('model'); + if ($customer->getGroupId()) { + $excludedWebsites = $this->customerGroupExcludedWebsiteRepository->getCustomerGroupExcludedWebsites( + (int)$customer->getGroupId() + ); + if (in_array($websiteId, $excludedWebsites, true)) { + throw new LocalizedException(__('This website is excluded from customer\'s group.')); + } + } + } +} diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSelectWebsiteGroupStoreActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSelectWebsiteGroupStoreActionGroup.xml new file mode 100644 index 0000000000000..8f8cf0ba85bda --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSelectWebsiteGroupStoreActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCustomerSelectWebsiteGroupStoreActionGroup"> + <annotations> + <description>Select Website, Group, Send Welcome Email From on the Customer creation/edit page Account Information Tab.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + <argument name="customerGroup" type="string"/> + <argument name="store" type="string"/> + </arguments> + <selectOption stepKey="selectWebSite" selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{website}}"/> + <click selector="{{AdminCustomerAccountInformationSection.group}}" stepKey="clickToExpandGroup"/> + <click selector="{{AdminCustomerAccountInformationSection.customerGroupOption(customerGroup)}}" stepKey="clickToSelectCustomerGroup"/> + <selectOption stepKey="selectStoreView" selector="{{AdminCustomerAccountInformationSection.storeView}}" userInput="{{store}}"/> + <waitForElement selector="{{AdminCustomerAccountInformationSection.storeView}}" stepKey="waitForCustomerStoreViewExpand"/> + <click stepKey="saveCustomer" selector="{{AdminCustomerAccountInformationSection.saveCustomer}}"/> + <waitForPageLoad stepKey="waitForCustomersPage"/> + <see stepKey="seeCustomerSaveSuccessMessage" userInput="You saved the customer."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerWishlistConfigureItemActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerWishlistConfigureItemActionGroup.xml new file mode 100644 index 0000000000000..de126e6cc6585 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerWishlistConfigureItemActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCustomerWishlistConfigureItemActionGroup"> + <arguments> + <argument name="title" type="string" defaultValue="{{Attribute.label}}"/> + <argument name="option" type="string" defaultValue="option1"/> + <argument name="quantity" type="string" defaultValue="2"/> + <argument name="productName" type="string" defaultValue="{{ApiConfigurableProductWithOutCategory.name}}"/> + </arguments> + <click selector="{{AdminCustomerWishlistSection.configureButton(productName)}}" stepKey="clickConfigureButton"/> + <waitForElementVisible selector="{{AdminCustomerWishlistSection.productAttributeOptionsDropDown(title)}}" stepKey="waitForConfigurableOption"/> + <selectOption selector="{{AdminCustomerWishlistSection.productAttributeOptionsDropDown(title)}}" userInput="{{option}}" stepKey="selectConfigurableOption"/> + <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQty"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="confirmSave"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertCustomerEditFormPasswordFieldActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertCustomerEditFormPasswordFieldActionGroup.xml new file mode 100644 index 0000000000000..6548845994b2d --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertCustomerEditFormPasswordFieldActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertCustomerEditFormPasswordFieldActionGroup"> + <annotations> + <description>Validate the password is visible as plain text in customer account edit form.</description> + </annotations> + <arguments> + <argument name="passwordFieldType" type="string" defaultValue="text"/> + </arguments> + + <assertElementContainsAttribute stepKey="assertCurrentPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + <assertElementContainsAttribute stepKey="assertNewPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + <assertElementContainsAttribute stepKey="assertConfirmNewPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertLoginFormPasswordFieldActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertLoginFormPasswordFieldActionGroup.xml new file mode 100644 index 0000000000000..5882dd0ac80ef --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertLoginFormPasswordFieldActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertLoginFormPasswordFieldActionGroup"> + <annotations> + <description>Validate the password is visible as plain text in login form.</description> + </annotations> + <arguments> + <argument name="passwordFieldType" type="string" defaultValue="text"/> + </arguments> + + <assertElementContainsAttribute stepKey="assertPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerSignInFormSection.passwordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertRegistrationFormPasswordFieldActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertRegistrationFormPasswordFieldActionGroup.xml new file mode 100644 index 0000000000000..d5efbf58dda1f --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertRegistrationFormPasswordFieldActionGroup.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertRegistrationFormPasswordFieldActionGroup"> + <annotations> + <description>Validate the password is visible as plain text on customer registration form.</description> + </annotations> + <arguments> + <argument name="passwordFieldType" type="string" defaultValue="text"/> + </arguments> + + <assertElementContainsAttribute stepKey="assertPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerCreateFormSection.passwordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + <assertElementContainsAttribute stepKey="assertConfirmPasswordFieldType"> + <expectedResult selector="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult> + </assertElementContainsAttribute> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontCustomWelcomeMessageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontCustomWelcomeMessageActionGroup.xml new file mode 100644 index 0000000000000..966529d280cfb --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontCustomWelcomeMessageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontCustomWelcomeMessageActionGroup"> + <annotations> + <description>Validates that the custom Welcome message is present on storefront header.</description> + </annotations> + <arguments> + <argument name="customMessage" type="string" defaultValue="Welcome to "Food & Drinks" store"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="waitForWelcomeMessage"/> + <see userInput="{{customMessage}}" selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="verifyCustomMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAddCustomerDefaultAddressActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAddCustomerDefaultAddressActionGroup.xml index ce26d14bb95f7..0624f14006a25 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAddCustomerDefaultAddressActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAddCustomerDefaultAddressActionGroup.xml @@ -27,6 +27,7 @@ <fillField stepKey="fillZip" userInput="{{Address.postcode}}" selector="{{StorefrontCustomerAddressFormSection.zip}}"/> <selectOption stepKey="selectCountry" userInput="{{Address.country}}" selector="{{StorefrontCustomerAddressFormSection.country}}"/> <click stepKey="checkUseAsDefaultBillingAddressCheckBox" selector="{{StorefrontCustomerAddressFormSection.useAsDefaultBillingAddressCheckBox}}"/> + <scrollTo selector="{{StorefrontCustomerAddressFormSection.useAsDefaultShippingAddressCheckBox}}" stepKey="scrollToUseAsDefaultShippingAddressCheckbox"/> <click stepKey="checkUseAsDefaultShippingAddressCheckBox" selector="{{StorefrontCustomerAddressFormSection.useAsDefaultShippingAddressCheckBox}}"/> <click stepKey="saveCustomerAddress" selector="{{StorefrontCustomerAddressFormSection.saveAddress}}"/> <waitForPageLoad stepKey="waitForPageLoad"/> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup.xml new file mode 100644 index 0000000000000..cbe227c1809f3 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup"> + <annotations> + <description>Clicks the "Print Order" link on the My Account->My Orders->Order View page</description> + </annotations> + + <click selector="{{StorefrontCustomerOrderViewSection.printOrderLink}}" stepKey="clickPrintOrderLink"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup.xml new file mode 100644 index 0000000000000..232667cd9a8e5 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup"> + <annotations> + <description>Clicks the top "View Order" link on the My Account->My Orders page</description> + </annotations> + + <click selector="{{StorefrontCustomerOrderSection.viewOrder}}" stepKey="clickViewOrder"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAddressFormCheckDefaultShippingActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAddressFormCheckDefaultShippingActionGroup.xml new file mode 100644 index 0000000000000..6b9725de7e19e --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAddressFormCheckDefaultShippingActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCustomerAddressFormCheckDefaultShippingActionGroup"> + <annotations> + <description>Check default chipping address checkbox.</description> + </annotations> + <checkOption selector="{{StorefrontCustomerAddressFormSection.useAsDefaultShippingAddressCheckBox}}" stepKey="checkUseAsDefaultShippingAddressCheckBox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerEditFormClickShowPasswordActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerEditFormClickShowPasswordActionGroup.xml new file mode 100644 index 0000000000000..b5c73b02be208 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerEditFormClickShowPasswordActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCustomerEditFormClickShowPasswordActionGroup"> + <annotations> + <description>Click on the show password checkbox in customer account information form</description> + </annotations> + + <click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerAccountInformationSection.showPasswordCheckbox}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillChangePasswordFormActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillChangePasswordFormActionGroup.xml new file mode 100644 index 0000000000000..2c8f16db8987e --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillChangePasswordFormActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontFillChangePasswordFormActionGroup"> + <annotations> + <description>Fills in the provided Customer details on the Storefront Customer change password form.</description> + </annotations> + <arguments> + <argument name="customer" type="entity"/> + </arguments> + + <fillField stepKey="fillCurrentPassword" userInput="{{customer.password}}" selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}"/> + <fillField stepKey="fillNewPassword" userInput="{{customer.password}}" selector="{{StorefrontCustomerAccountInformationSection.newPassword}}"/> + <fillField stepKey="fillNewConfirmPassword" userInput="{{customer.password}}" selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillCustomerAddressFormActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillCustomerAddressFormActionGroup.xml new file mode 100644 index 0000000000000..c0faf297f35cf --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillCustomerAddressFormActionGroup.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontFillCustomerAddressFormActionGroup"> + <annotations> + <description>Fills address data in storefront customer address edit form.</description> + </annotations> + <arguments> + <argument name="Address"/> + </arguments> + <fillField userInput="{{Address.firstname}}" selector="{{StorefrontCustomerAddressFormSection.firstName}}" stepKey="fillFirstName"/> + <fillField userInput="{{Address.lastname}}" selector="{{StorefrontCustomerAddressFormSection.lastName}}" stepKey="fillLastName"/> + <fillField userInput="{{Address.company}}" selector="{{StorefrontCustomerAddressFormSection.company}}" stepKey="fillCompanyName"/> + <fillField userInput="{{Address.telephone}}" selector="{{StorefrontCustomerAddressFormSection.phoneNumber}}" stepKey="fillPhoneNumber"/> + <fillField userInput="{{Address.street[0]}}" selector="{{StorefrontCustomerAddressFormSection.streetAddress}}" stepKey="fillStreetAddress"/> + <fillField userInput="{{Address.city}}" selector="{{StorefrontCustomerAddressFormSection.city}}" stepKey="fillCity"/> + <selectOption userInput="{{Address.state}}" selector="{{StorefrontCustomerAddressFormSection.state}}" stepKey="selectState"/> + <fillField userInput="{{Address.postcode}}" selector="{{StorefrontCustomerAddressFormSection.zip}}" stepKey="fillZip"/> + <selectOption userInput="{{Address.country}}" selector="{{StorefrontCustomerAddressFormSection.country}}" stepKey="selectCountry"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup.xml new file mode 100644 index 0000000000000..8bd192b593ad5 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup"> + <annotations> + <description>Goes to the Storefront Customer Sign In page. Logs in using the provided Customer.</description> + </annotations> + <arguments> + <argument name="Customer"/> + </arguments> + + <click selector="{{StorefrontCustomerSignInFormSection.signInAccountLink}}" stepKey="clickSignInAccountLink"/> + <waitForPageLoad time="30" stepKey="waitPageFullyLoaded"/> + <waitForElementVisible selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="waitFormAppears"/> + <fillField userInput="{{Customer.email}}" selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="fillEmail"/> + <fillField userInput="{{Customer.password}}" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/> + <click selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="clickSignInAccountButton"/> + <waitForPageLoad stepKey="waitForCustomerLoggedIn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginFormClickShowPasswordActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginFormClickShowPasswordActionGroup.xml new file mode 100644 index 0000000000000..cec52b88dbac7 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontLoginFormClickShowPasswordActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontLoginFormClickShowPasswordActionGroup"> + <annotations> + <description>Click on the show password checkbox in login form</description> + </annotations> + + <click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerSignInFormSection.showPasswordCheckbox}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenCustomerChangePasswordPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenCustomerChangePasswordPageActionGroup.xml new file mode 100644 index 0000000000000..aebcfc6f488ec --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenCustomerChangePasswordPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontOpenCustomerChangePasswordPageActionGroup"> + <annotations> + <description>Goes to the Storefront Customer Change Password page.</description> + </annotations> + + <amOnPage url="{{StorefrontCustomerAccountChangePasswordPage.url}}" stepKey="goToCustomerAccountChangePasswordPage"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenNewCustomerAddressFormActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenNewCustomerAddressFormActionGroup.xml new file mode 100644 index 0000000000000..c3c85ac925578 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenNewCustomerAddressFormActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontOpenNewCustomerAddressFormActionGroup"> + <annotations> + <description>Open new customer address form on storefront.</description> + </annotations> + <amOnPage url="customer/address/new/" stepKey="OpenCustomerAddNewAddress"/> + <waitForPageLoad stepKey="waitForCustomerAddNewAddress"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontRegistrationFormClickShowPasswordActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontRegistrationFormClickShowPasswordActionGroup.xml new file mode 100644 index 0000000000000..6e441aee9d636 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontRegistrationFormClickShowPasswordActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontRegistrationFormClickShowPasswordActionGroup"> + <annotations> + <description>Click on the show password checkbox in registration form</description> + </annotations> + + <click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerCreateFormSection.showPasswordCheckbox}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSaveCustomerAddressActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSaveCustomerAddressActionGroup.xml new file mode 100644 index 0000000000000..80264f989219f --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontSaveCustomerAddressActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontSaveCustomerAddressActionGroup"> + <annotations> + <description>Clicks on the Save Address button. Validates that the Success Message is present.</description> + </annotations> + + <click selector="{{StorefrontCustomerAddressFormSection.saveAddress}}" stepKey="clickSaveAddress"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You saved the address." stepKey="assertSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontVerifyCustomerOrderProductRowDataActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontVerifyCustomerOrderProductRowDataActionGroup.xml new file mode 100644 index 0000000000000..7ca1911570a59 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontVerifyCustomerOrderProductRowDataActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontVerifyCustomerOrderProductRowDataActionGroup"> + <annotations> + <description>Verify a customer's order details for a product row on the view order page on the storefront</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + <argument name="sku" type="string"/> + <argument name="price" type="string"/> + <argument name="quantity" type="string"/> + <argument name="subtotal" type="string"/> + <argument name="index" defaultValue="1" type="string"/> + </arguments> + <waitForText userInput="{{name}}" selector="{{StorefrontCustomerOrderViewSection.productNameByRow(index)}}" stepKey="seeProductName"/> + <waitForText userInput="{{sku}}" selector="{{StorefrontCustomerOrderViewSection.productSkuByRow(index)}}" stepKey="seeProductSku"/> + <waitForText userInput="{{price}}" selector="{{StorefrontCustomerOrderViewSection.productPriceByRow(index)}}" stepKey="seeProductPrice"/> + <waitForText userInput="{{quantity}}" selector="{{StorefrontCustomerOrderViewSection.productQuantityByRow(index)}}" stepKey="seeProductQuantity"/> + <waitForText userInput="{{subtotal}}" selector="{{StorefrontCustomerOrderViewSection.productSubtotalByRow(index)}}" stepKey="seeProductSubtotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml b/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml index e31be78185aaf..1746a683ab0e6 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml @@ -159,6 +159,7 @@ </array> <data key="city">London</data> <data key="country_id">GB</data> + <data key="country">United Kingdom</data> <data key="telephone">512-345-6789</data> <data key="province">JS</data> </entity> @@ -198,6 +199,9 @@ </array> <data key="state">California</data> </entity> + <entity name="US_With_Vat_Number" type="address" extends="US_Address_CA"> + <data key="vat_id">U1234567891</data> + </entity> <entity name="US_Default_Billing_Address_TX" type="address" extends="US_Address_TX"> <data key="default_billing">false</data> <data key="default_shipping">true</data> @@ -240,7 +244,7 @@ <data key="postcode">12345</data> </entity> <entity name="updateCustomerFranceAddress" type="address"> - <data key="firstname">Jaen</data> + <data key="firstname">Jean</data> <data key="lastname">Reno</data> <data key="company">Magento</data> <data key="telephone">555-888-111-999</data> @@ -376,4 +380,10 @@ <data key="postcode">6690</data> <data key="telephone">0477-58-77867</data> </entity> + <entity name="UK_With_State_Default_Billing" extends="UK_Not_Default_Address"> + <requiredEntity type="region">RegionUKGL</requiredEntity> + <data key="country">United Kingdom</data> + <data key="state">Greater London</data> + <data key="default_billing">Yes</data> + </entity> </entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/AdminAddressTemplateData.xml b/app/code/Magento/Customer/Test/Mftf/Data/AdminAddressTemplateData.xml new file mode 100644 index 0000000000000..806b878c653ee --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Data/AdminAddressTemplateData.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="templateTypeHtml"> + <data key="templateType">html</data> + </entity> + <entity name="templateTypeOneLine"> + <data key="templateType">oneline</data> + </entity> + <entity name="templateTypeText"> + <data key="templateType">text</data> + </entity> +</entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml index 5db0b8f5581d7..df6520383d808 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml @@ -7,7 +7,7 @@ --> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="CustomerEntityOne" type="customer"> <data key="group_id">1</data> <data key="default_billing">defaultBillingValue</data> @@ -72,10 +72,10 @@ <data key="store_id">0</data> <data key="website_id">0</data> <requiredEntity type="address">US_Address_TX</requiredEntity> - <var entityType="customerGroup" entityKey="id" key="group_id" /> + <var entityType="customerGroup" entityKey="id" key="group_id"/> </entity> <entity name="UsCustomerAssignedToNewCustomerGroup" type="customer"> - <var key="group_id" entityKey="id" entityType="customerGroup" /> + <var key="group_id" entityKey="id" entityType="customerGroup"/> <data key="default_billing">true</data> <data key="default_shipping">true</data> <data key="email" unique="prefix">John.Doe@example.com</data> @@ -110,6 +110,32 @@ <data key="store_id">0</data> <data key="website_id">0</data> </entity> + <entity name="FrenchCustomerOneAssignedToNewCustomerGroup" type="customer"> + <var key="group_id" entityKey="id" entityType="customerGroup"/> + <data key="default_billing">true</data> + <data key="default_shipping">true</data> + <data key="email" unique="prefix">Alain.Delon@example.com</data> + <data key="firstname">Alain</data> + <data key="lastname">Delon</data> + <data key="fullname">Alain Delon</data> + <data key="password">pwdTest123!</data> + <data key="store_id">0</data> + <data key="website_id">0</data> + <requiredEntity type="address">updateCustomerFranceAddress</requiredEntity> + </entity> + <entity name="FrenchCustomerTwoAssignedToNewCustomerGroup" type="customer"> + <var key="group_id" entityKey="id" entityType="customerGroup"/> + <data key="default_billing">true</data> + <data key="default_shipping">true</data> + <data key="email" unique="prefix">Jean.Reno@example.com</data> + <data key="firstname">Jean</data> + <data key="lastname">Reno</data> + <data key="fullname">Jean Reno</data> + <data key="password">pwdTest123!</data> + <data key="store_id">0</data> + <data key="website_id">0</data> + <requiredEntity type="address">updateCustomerFranceAddress</requiredEntity> + </entity> <entity name="Simple_US_Customer_Multiple_Addresses" type="customer"> <data key="group_id">1</data> <data key="default_billing">true</data> @@ -233,6 +259,9 @@ <data key="website_id">0</data> <requiredEntity type="address">UK_Not_Default_Address</requiredEntity> </entity> + <entity name="Customer_With_Vat_Number" type="customer" extends="Simple_Customer_Without_Address"> + <requiredEntity type="address">US_With_Vat_Number</requiredEntity> + </entity> <entity name="Customer_With_Different_Default_Billing_Shipping_Addresses" type="customer"> <data key="group_id">1</data> <data key="email" unique="prefix">John.Doe@example.com</data> @@ -395,4 +424,9 @@ <requiredEntity type="address">US_Address_CA</requiredEntity> <requiredEntity type="address">US_Address_NY_Not_Default_Address</requiredEntity> </entity> + <entity name="Customer_UK_US" type="customer" extends="Simple_GB_Customer"> + <data key="country">United Kingdom</data> + <requiredEntity type="address">UK_With_State_Default_Billing</requiredEntity> + <requiredEntity type="address">US_Address_NY_Default_Shipping</requiredEntity> + </entity> </entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/RegionData.xml b/app/code/Magento/Customer/Test/Mftf/Data/RegionData.xml index 0a956f16767be..7f2ea38a6ab80 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/RegionData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/RegionData.xml @@ -37,4 +37,7 @@ <data key="region_code">AFE</data> <data key="region_id">9</data> </entity> + <entity name="RegionUKGL" type="region"> + <data key="region">Greater London</data> + </entity> </entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerConfigPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerConfigPage.xml index 282f9bb6fdeb5..774ee294bd3f5 100644 --- a/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerConfigPage.xml +++ b/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerConfigPage.xml @@ -8,5 +8,6 @@ <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminCustomerConfigPage" url="admin/system_config/edit/section/customer/{{tabLink}}" area="admin" parameterized="true" module="Magento_Customer"> <section name="AdminCustomerConfigSection"/> + <section name="AdminCustomerConfigAddressTemplateSection"/> </page> </pages> diff --git a/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerGroupPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerGroupPage.xml new file mode 100644 index 0000000000000..078b63037cd88 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerGroupPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminEditCustomerGroupPage" url="/customer/group/edit/id/{{var1}}" area="admin" module="Magento_Customer"> + <section name="AdminEditCustomerGroupSection"/> + </page> +</pages> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml index 50e923d9b32cc..1752cb6d04c3d 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml @@ -14,6 +14,7 @@ <element name="accountInformationTitle" type="text" selector=".admin__page-nav-title"/> <element name="accountInformationButton" type="text" selector="//a/span[text()='Account Information']"/> <element name="addressesButton" type="select" selector="//a//span[contains(text(), 'Addresses')]"/> + <element name="customerGroupOption" type="text" selector="//label/span[text()='{{groupValue}}']|//select/option[text()='{{groupValue}}']" parameterized="true"/> <element name="firstName" type="input" selector="input[name='customer[firstname]']"/> <element name="lastName" type="input" selector="input[name='customer[lastname]']"/> <element name="email" type="input" selector="input[name='customer[email]']"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml index 17a4a283c2648..f90a01a56841a 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml @@ -19,5 +19,6 @@ <element name="viewDropdown" type="button" selector=".admin__data-grid-action-bookmarks button.admin__action-dropdown"/> <element name="viewBookmark" type="button" selector="//div[contains(@class, 'admin__data-grid-action-bookmarks')]/ul/li/div/a[text() = '{{label}}']" parameterized="true" timeout="30"/> <element name="countryOptions" type="button" selector=".admin__data-grid-filters select[name=billing_country_id] option"/> + <element name="websiteOptions" type="button" selector=".admin__data-grid-filters select[name=website_id] option"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerWishlistSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerWishlistSection.xml index 39a67968c66e4..0a44149cb067b 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerWishlistSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerWishlistSection.xml @@ -14,5 +14,8 @@ <element name="deleteButton" type="text" selector="//*[@id='wishlistGrid_table']//*[@data-column='action']//*[text()='Delete']"/> <element name="deleteConfirm" type="button" selector=".modal-popup.confirm .action-primary.action-accept"/> <element name="gridTable" type="text" selector="#wishlistGrid_table"/> + <element name="configureButton" type="text" selector="//table[@id='wishlistGrid_table']//tbody//td[@data-column='product_name' and contains(text(),'{{productName}}')]/parent::tr//td[@data-column='action']//a[@class='configure-item-link']" timeout="30" parameterized="true"/> + <element name="productAttributeOptionsDropDown" type="text" selector="//label[contains(.,'{{var1}}')]/following::div[contains(@class,'control')]//select" parameterized="true"/> + <element name="productQty" type="text" selector="table#wishlistGrid_table td.col-number[data-column=qty]"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerGroupSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerGroupSection.xml index 917af88338d24..e9d988911a61c 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerGroupSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerGroupSection.xml @@ -9,6 +9,13 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminEditCustomerGroupSection"> + <element name="groupName" type="input" selector="#customer_group_code"/> + <element name="taxClass" type="select" selector="#tax_class_id"/> + <element name="saveCustomerGroup" type="button" selector="#save"/> + <element name="resetBtn" type="button" selector="#reset"/> + <element name="backBtn" type="button" selector="#back"/> + <element name="excludeWebsite" type="multiselect" selector="#customer_group_excluded_website_ids"/> + <element name="selectedExcludedWebsites" type="multiselect" selector="//select[@id='customer_group_excluded_website_ids']/option[contains(@selected, 'selected')]"/> <element name="deleteButton" type="button" selector=".page-actions-buttons button#delete"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml index 9828c42211e41..abb61d2dd0bef 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml @@ -18,6 +18,7 @@ <element name="currentPassword" type="input" selector="#current-password"/> <element name="newPassword" type="input" selector="#password"/> <element name="confirmNewPassword" type="input" selector="#password-confirmation"/> + <element name="showPasswordCheckbox" type="input" selector="#show-password"/> <element name="confirmNewPasswordError" type="text" selector="#password-confirmation-error"/> <element name="email" type="input" selector=".form-edit-account input[name='email']" /> <element name="emailErrorMessage" type="text" selector="#email-error"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml index 112ced1bc375f..5b111489a8414 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressFormSection.xml @@ -21,5 +21,6 @@ <element name="useAsDefaultBillingAddressCheckBox" type="input" selector="//form[@class='form-address-edit']//input[@name='default_billing']"/> <element name="useAsDefaultShippingAddressCheckBox" type="input" selector="//form[@class='form-address-edit']//input[@name='default_shipping']"/> <element name="saveAddress" type="button" selector="//button[@title='Save Address']" timeout="30"/> + <element name="formTitle" type="text" selector="//h1[@class='page-title']/span[text() = 'Edit Address']" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml index dee62070ab9bc..0b0625a084211 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml @@ -18,7 +18,7 @@ <element name="addressesList" type="text" selector=".additional-addresses" /> <element name="deleteAdditionalAddress" type="button" selector="//tbody//tr[{{var}}]//a[@class='action delete']" parameterized="true"/> <element name="editAdditionalAddress" type="button" selector="//tbody//tr[{{var}}]//a[@class='action edit']" parameterized="true" timeout="30"/> - <element name="addNewAddress" type="button" selector="//span[text()='Add New Address']"/> + <element name="addNewAddress" type="button" selector="//span[text()='Add New Address']" timeout="30"/> <element name="numberOfAddresses" type="text" selector=".toolbar-number"/> <element name="shippingAddress" type="text" selector="//div[contains(@class,'box box-shipping-address')]//div/address"/> <element name="billingAddress" type="text" selector="//div[contains(@class,'box box-billing-address')]//div/address"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml index d03e088104807..099c8da065525 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StoreFrontCustomerAdvancedAttributesSection.xml @@ -22,5 +22,7 @@ <element name="attributeLabel" type="text" selector="//span[text()='{{attributeLabel}}']" parameterized="true"/> <element name="fileAttribute" type="file" selector="//input[@type='file' and @name='{{attributeCode}}']" parameterized="true" timeout="30"/> <element name="customFileAttributeUploadButton" type="input" selector=".file-uploader-area input[name='{{attributeCode}}'] ~ .file-uploader-button" parameterized="true"/> + <element name="fileUploaderPreviewLink" type="block" selector="//input[@type='file' and @name='{{attributeCode}}']/ancestor::div[contains(@class, 'file-uploader')]//div[contains(@class, 'file-uploader-preview')]//a[contains(@class, 'preview-link')]" parameterized="true"/> + <element name="fileUploaderPreviewImage" type="block" selector="//input[@type='file' and @name='{{attributeCode}}']/ancestor::div[contains(@class, 'file-uploader')]//div[contains(@class, 'file-uploader-preview')]//img" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml index 6b65ef861472c..ead385d6e6dd0 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml @@ -16,6 +16,7 @@ <element name="emailField" type="input" selector="#email_address"/> <element name="passwordField" type="input" selector="#password"/> <element name="confirmPasswordField" type="input" selector="#password-confirmation"/> + <element name="showPasswordCheckbox" type="input" selector="#show-password"/> <element name="createAccountButton" type="button" selector="button.action.submit.primary" timeout="30"/> <element name="passwordErrorMessages" type="text" selector="#password-error"/> </section> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml index 42c6f5cea082f..4eb5e8aa02401 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml @@ -21,6 +21,12 @@ <element name="createdDate" type="text" selector=".block-order-details-comments .comment-date"/> <element name="orderPlacedBy" type="text" selector=".block-order-details-comments .comment-content"/> <element name="productName" type="text" selector="//td[@data-th='Product Name']"/> + <element name="productRows" type="text" selector="#my-orders-table tbody tr"/> + <element name="productNameByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.name"/> + <element name="productSkuByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.sku"/> + <element name="productPriceByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.price"/> + <element name="productQuantityByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.qty"/> + <element name="productSubtotalByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.subtotal"/> <element name="grandTotal" type="text" selector="//tr[@class='grand_total']//td[@data-th='Grand Total']"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection/StorefrontCustomerSignInFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection/StorefrontCustomerSignInFormSection.xml index 2e40610c18f82..5497ed9950a61 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection/StorefrontCustomerSignInFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection/StorefrontCustomerSignInFormSection.xml @@ -10,8 +10,10 @@ <section name="StorefrontCustomerSignInFormSection"> <element name="emailField" type="input" selector="#email"/> <element name="passwordField" type="input" selector="#pass"/> + <element name="showPasswordCheckbox" type="input" selector="#show-password"/> <element name="signInAccountButton" type="button" selector="#send2" timeout="30"/> <element name="forgotPasswordLink" type="button" selector=".action.remind" timeout="10"/> <element name="customerLoginBlock" type="text" selector=".login-container .block.block-customer-login"/> + <element name="signInAccountLink" type="button" selector="//header[@class='page-header']//li/a[contains(.,'Sign In')]"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml index 6aec5440193a2..543f26a1aaf65 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml @@ -20,9 +20,7 @@ </annotations> <before> <magentoCLI command="config:set customer/create_account/viv_disable_auto_group_assign_default 0" stepKey="setConfigDefaultIsNo"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml index d48fb90b24ec2..922063272cd16 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml @@ -20,16 +20,12 @@ </annotations> <before> <magentoCLI command="config:set customer/create_account/viv_disable_auto_group_assign_default 1" stepKey="setConfigDefaultIsYes"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> <magentoCLI command="config:set customer/create_account/viv_disable_auto_group_assign_default 0" stepKey="setConfigDefaultIsNo"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml index 5b6c4fd23e038..b191ae9406610 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml @@ -21,9 +21,7 @@ </annotations> <before> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexCustomerGrid"> - <argument name="indices" value="customer_grid"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexCustomerGrid"/> </before> <after> @@ -34,15 +32,15 @@ <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="navigateToCustomers"/> <waitForPageLoad stepKey="waitForLoad1"/> + <conditionalClick selector="{{AdminCustomerFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerFiltersSection.clearAll}}" visible="true" stepKey="clickClearFilters"/> + <waitForPageLoad stepKey="waitForFiltersClear"/> <click selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}" stepKey="clickCreateCustomer"/> <fillField userInput="{{CustomerEntityOne.firstname}}" selector="{{AdminCustomerAccountInformationSection.firstName}}" stepKey="fillFirstName"/> <fillField userInput="{{CustomerEntityOne.lastname}}" selector="{{AdminCustomerAccountInformationSection.lastName}}" stepKey="fillLastName"/> <fillField userInput="{{CustomerEntityOne.email}}" selector="{{AdminCustomerAccountInformationSection.email}}" stepKey="fillEmail"/> <click selector="{{AdminCustomerMainActionsSection.saveButton}}" stepKey="saveCustomer"/> <seeElement selector="{{AdminCustomerMessagesSection.successMessage}}" stepKey="assertSuccessMessage"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/> <comment userInput="Replacing reload action and preserve Backward Compatibility" stepKey="waitForLoad2"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml index 7cffd5f304e31..5b43d5baf8f74 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml @@ -39,7 +39,7 @@ <click selector="{{AdminCustomerMainActionsSection.saveButton}}" stepKey="saveCustomer"/> <seeElement selector="{{AdminCustomerMessagesSection.successMessage}}" stepKey="assertSuccessMessage"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="tags" value="compiled_config"/> </actionGroup> <reloadPage stepKey="reloadPage"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml index 62dcd6fc4d894..b3d432b7776aa 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml @@ -20,9 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml index c6e72901b062c..15eae933ccdda 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml @@ -20,9 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml index 52c8029b8f778..55c9315f42fa9 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml @@ -20,9 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminEditCustomerWithAssociatedNewsletterQueueTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminEditCustomerWithAssociatedNewsletterQueueTest.xml new file mode 100644 index 0000000000000..96e63b33d6247 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminEditCustomerWithAssociatedNewsletterQueueTest.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminEditCustomerWithAssociatedNewsletterQueueTest"> + <annotations> + <stories value="Edit customer if there is associated newsletter queue"/> + <title value="Edit customer if there is associated newsletter queue"/> + <description value="Edit customer if there is associated newsletter queue"/> + <severity value="BLOCKER"/> + <group value="customer"/> + </annotations> + <before> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> + <createData entity="Simple_US_Customer_Multiple_Addresses_No_Default_Address" stepKey="customer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToNewsletterGridPage"> + <argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuMarketingCommunicationsNewsletterTemplate.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminSearchNewsletterTemplateOnGridActionGroup" stepKey="findCreatedNewsletterTemplateInGrid"> + <argument name="name" value="{{_defaultNewsletter.name}}"/> + <argument name="subject" value="{{_defaultNewsletter.subject}}"/> + </actionGroup> + <actionGroup ref="AdminMarketingOpenNewsletterTemplateFromGridActionGroup" stepKey="openTemplate"/> + <actionGroup ref="AdminMarketingDeleteNewsletterTemplateActionGroup" stepKey="deleteTemplate"/> + + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="openCustomersGridPage"/> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPage"> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses_No_Default_Address"/> + </actionGroup> + <actionGroup ref="AdminSubscribeCustomerToNewsletters" stepKey="subscribeToNewsletter"/> + + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToNewsletterTemplatePage"> + <argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuMarketingCommunicationsNewsletterTemplate.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminNavigateToCreateNewsletterTemplatePageActionGroup" stepKey="navigateToCreateNewsletterTemplatePage"/> + <actionGroup ref="AdminCreateNewsletterTemplateActionGroup" stepKey="createNewsletterTemplate"> + <argument name="name" value="{{_defaultNewsletter.name}}"/> + <argument name="subject" value="{{_defaultNewsletter.subject}}"/> + <argument name="senderName" value="{{_defaultNewsletter.senderName}}"/> + <argument name="senderEmail" value="{{_defaultNewsletter.senderEmail}}"/> + <argument name="templateContent" value="{{_defaultNewsletter.textAreaContent}}"/> + </actionGroup> + <actionGroup ref="AdminSearchNewsletterTemplateOnGridActionGroup" stepKey="findCreatedNewsletterTemplate"> + <argument name="name" value="{{_defaultNewsletter.name}}"/> + <argument name="subject" value="{{_defaultNewsletter.subject}}"/> + </actionGroup> + <actionGroup ref="AdminQueueNewsletterActionGroup" stepKey="addNewsletterToQueue"> + <argument name="startAt" value="Dec 21, 2022 11:04:20 AM"/> + </actionGroup> + + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="editCustomerForm"> + <argument name="customer" value="Simple_US_Customer_Multiple_Addresses_No_Default_Address"/> + </actionGroup> + <actionGroup stepKey="editCustomerAddress" ref="AdminEditCustomerAddressesFromActionGroup"> + <argument name="customerAddress" value="CustomerAddressSimple"/> + </actionGroup> + <actionGroup ref="AdminSaveCustomerAndAssertSuccessMessage" stepKey="saveCustomer"/> + + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml index 77422c6e8da3f..b975cf62765c1 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml @@ -6,7 +6,8 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest"> <annotations> <features value="Customer"/> @@ -23,37 +24,41 @@ <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createSimpleCategory"/> </createData> - <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="login"/> </before> <after> <deleteData createDataKey="createSimpleCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> - <argument name="customer" value="$simpleCustomer$"/> - </actionGroup> - <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> - <argument name="product" value="$createSimpleProduct$"/> - </actionGroup> - <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> - <argument name="customer" value="$simpleCustomer$"/> - <argument name="address" value="US_Address_TX"/> - </actionGroup> - <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> - <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - - <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/> - <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> - <actionGroup ref="GoToShipmentIntoOrderActionGroup" stepKey="goToShipment"/> - <actionGroup ref="SubmitShipmentIntoOrderActionGroup" stepKey="submitShipment"/> - - <!--Create Credit Memo--> - <actionGroup ref="StartToCreateCreditMemoActionGroup" stepKey="startToCreateCreditMemo"> - <argument name="orderId" value="{$getOrderId}"/> - </actionGroup> - <actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="navigateToNewOrderPage"/> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="simpleCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addSecondProduct"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="fillCustomerInfo"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectFlatRate"/> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="submitOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="getOrderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="startCreateInvoice"/> + <createData entity="Invoice" stepKey="submitInvoice"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToShipment"/> + <createData entity="Shipment" stepKey="submitShipment"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="startToCreateCreditMemo"/> + <createData entity="CreditMemo" stepKey="submitCreditMemo"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="logInCustomer"> <argument name="Customer" value="$$simpleCustomer$$"/> @@ -61,12 +66,11 @@ <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToMyOrdersPage"> <argument name="menu" value="My Orders"/> </actionGroup> - <click selector="{{StorefrontCustomerOrderSection.viewOrder}}" stepKey="clickViewOrder"/> - <click selector="{{StorefrontCustomerOrderViewSection.printOrderLink}}" stepKey="clickPrintOrderLink"/> - <waitForPageLoad stepKey="waitPageReload"/> + <actionGroup ref="StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup" stepKey="clickViewOrder"/> + <actionGroup ref="StorefrontClickPrintOrderLinkOnViewOrderPageActionGroup" stepKey="clickPrintOrderLink"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitPageReload"/> <switchToWindow stepKey="switchToWindow"/> <switchToPreviousTab stepKey="switchToPreviousTab"/> - <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToAddressBook"> <argument name="menu" value="Address Book"/> </actionGroup> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminPlaceOrderWhenCountryAllowedOnlyOnCurrentWebsiteScopeTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminPlaceOrderWhenCountryAllowedOnlyOnCurrentWebsiteScopeTest.xml new file mode 100644 index 0000000000000..7217f452e83f5 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminPlaceOrderWhenCountryAllowedOnlyOnCurrentWebsiteScopeTest.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminPlaceOrderWhenCountryAllowedOnlyOnCurrentWebsiteScopeTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer Order"/> + <title value="Place an order when country allowed only on current website"/> + <description value="Place an order when country allowed only on current website scope"/> + <severity value="MAJOR"/> + <group value="customer"/> + </annotations> + <before> + <magentoCLI command="config:set --scope={{SetAllowedCountryUsConfig.scope}} --scope-code={{SetAllowedCountryUsConfig.scope_code}} {{SetAllowedCountryUsConfig.path}} {{SetAllowedCountryUsConfig.value}}" stepKey="setAllowedCountryUs"/> + <magentoCLI command="config:set {{SetAllowedCountryUsConfig.path}} ''" stepKey="unselectAllCountriesFromAllowedCounties"/> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <createData entity="DisableAdminAccountAllowCountry" stepKey="setDefaultValueForAllowCountries"/> + <createData entity="SetAdminAccountAllowCountryToDefaultForDefaultWebsite" stepKey="setDefaultValueForAllowCountriesForDefaultWebsites"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> + <argument name="customer" value="$createCustomer$"/> + </actionGroup> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> + <argument name="product" value="$createSimpleProduct$"/> + <argument name="productQty" value="2"/> + </actionGroup> + <actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="submitOrder"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml index 257d4c9b2e3c2..6ecb20ab8072a 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml @@ -25,12 +25,8 @@ <deleteData createDataKey="customer" stepKey="deleteCustomer"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Edit customer info--> <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="OpenEditCustomerFrom"> <argument name="customer" value="$$customer$$"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml index bac1c665cbe78..7a9743482f81e 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml @@ -20,9 +20,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml index 3f95e55c56132..3fa29aef9908e 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml @@ -20,9 +20,7 @@ </annotations> <before> <createData stepKey="customer" entity="Simple_US_Customer_Multiple_Addresses"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml index fb6793b1751a6..971a93f64d800 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml @@ -20,9 +20,7 @@ </annotations> <before> <createData stepKey="customer" entity="Simple_Customer_Without_Address"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerOnGridAfterDeletingWebsiteTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerOnGridAfterDeletingWebsiteTest.xml new file mode 100644 index 0000000000000..a28078995010a --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerOnGridAfterDeletingWebsiteTest.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminVerifyCustomerOnGridAfterDeletingWebsiteTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer grid"/> + <title value="The customer's grid is not available after deleting the website"/> + <description value="Verify grid after deleting website associated with customer"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-39783"/> + <group value="customer"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> + <argument name="websiteCode" value="{{customWebsite.code}}"/> + </actionGroup> + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> + <argument name="storeGroupCode" value="{{customStoreGroup.code}}"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> + <argument name="StoreGroup" value="customStoreGroup"/> + <argument name="customStore" value="customStore"/> + </actionGroup> + <actionGroup ref="AdminGoCreatedWebsitePageActionGroup" stepKey="openWebsiteToGetId"> + <argument name="websiteName" value="{{customWebsite.name}}"/> + </actionGroup> + <grabFromCurrentUrl regex="~/website_id/(\d+)/~" stepKey="grabWebsiteIdFromURL"/> + <createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"> + <field key="website_id">$grabWebsiteIdFromURL</field> + </createData> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="DeleteWebsite"> + <argument name="websiteName" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="goToCustomersGridPage"/> + <actionGroup stepKey="resetFilter" ref="AdminResetFilterInCustomerGrid"/> + <actionGroup stepKey="filterByEamil" ref="AdminFilterCustomerGridByEmail"> + <argument name="email" value="$$createCustomer.email$$"/> + </actionGroup> + <actionGroup stepKey="checkCustomerInGrid" ref="AdminAssertCustomerInCustomersGrid"> + <argument name="text" value="$$createCustomer.email$$"/> + <argument name="row" value="1"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml index 6a157c6312530..fb4680b2d0648 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml @@ -42,9 +42,7 @@ <!--Set account sharing option - Default value is 'Per Website'--> <comment userInput="Set account sharing option - Default value is 'Per Website'" stepKey="setAccountSharingOption"/> <createData entity="CustomerAccountSharingDefault" stepKey="setToAccountSharingToDefault"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <!--delete all created data and set main website country options to default--> @@ -62,12 +60,8 @@ <actionGroup ref="SetWebsiteCountryOptionsToDefaultActionGroup" stepKey="setCountryOptionsToDefault"/> <createData entity="CustomerAccountSharingSystemValue" stepKey="setAccountSharingToSystemValue"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <!--Check that all countries are allowed initially and get amount--> <comment userInput="Check that all countries are allowed initially and get amount" stepKey="checkAllCountriesAreAllowed"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingGlobalTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingGlobalTest.xml new file mode 100644 index 0000000000000..d2231f7c3e567 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingGlobalTest.xml @@ -0,0 +1,373 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="ExcludeWebsiteFromCustomerGroupCustomerAccountSharingGlobalTest"> + <annotations> + <features value="Customer"/> + <stories value="Exclude Website From Customer Group With Global Customer Account Sharing"/> + <title value="Exclude Website From Customer Group With Global Customer Account Sharing"/> + <description value="Exclude websites from Customer Group with Customer Accounts Sharing is Global"/> + <testCaseId value="MC-40713"/> + <severity value="MAJOR"/> + <group value="customers"/> + </annotations> + + <before> + <!-- Set indexer on save --> + <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> + <!-- Create French Root Category with its Subcategory--> + <createData entity="NewRootCategory" stepKey="createFrenchRootCategory"/> + <createData entity="SimpleRootSubCategory" stepKey="createFrenchSubcategory"> + <requiredEntity createDataKey="createFrenchRootCategory"/> + </createData> + <!-- Create subcategory to the Default Root Category --> + <createData entity="SimpleSubCategory" stepKey="createDefaultSubcategory"/> + + <!-- Create 3 products --> + <createData entity="SimpleProduct2" stepKey="simpleMainProduct"/> + <createData entity="SimpleProduct2" stepKey="simpleFrenchProduct"/> + <createData entity="SimpleProduct2" stepKey="simpleCommonProduct"/> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Create French Website, Store, & Store View --> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsiteFR"> + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> + <argument name="websiteCode" value="{{customWebsite.code}}"/> + </actionGroup> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createStoreFR"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="store" value="{{customStoreFR.name}}"/> + <argument name="rootCategory" value="$$createFrenchRootCategory.name$$"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewFR"> + <argument name="StoreGroup" value="customStoreFR"/> + <argument name="customStore" value="customStoreFR"/> + </actionGroup> + + <!-- 1. Open Admin > Catalog > Products > Default Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToDefaultProduct"> + <argument name="productId" value="$$simpleMainProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad1"/> + <!-- 2. Assign SubCategory Of Additional Root Category to Default product. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignDefaultProduct"> + <argument name="categoryName" value="$$createDefaultSubcategory.name$$"/> + </actionGroup> + + <!-- 1. Open Admin > Catalog > Products > Additional Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToAdditionalProduct"> + <argument name="productId" value="$$simpleFrenchProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad2"/> + <!-- 2. Assign subcategory of default root category to Additional product. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignAdditionalProduct"> + <argument name="categoryName" value="$$createFrenchSubcategory.name$$"/> + </actionGroup> + <!-- 3. Assign Additional Website to Additional product --> + <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectAdditionalWebsiteInAdditionalProduct"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> + + <!-- 1. Open Admin > Catalog > Products > Common Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToCommonProduct"> + <argument name="productId" value="$$simpleCommonProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad3"/> + <!-- 2. Assign product to Subcategory of Default and Additional Websites. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignCommonProduct1"> + <argument name="categoryName" value="$$createDefaultSubcategory.name$$"/> + </actionGroup> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignCommonProduct2"> + <argument name="categoryName" value="$$createFrenchSubcategory.name$$"/> + </actionGroup> + <!-- 3. Assign Additional Website to Additional product --> + <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectAdditionalWebsiteInCommonProduct"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> + + <!-- Create customer group Members --> + <createData entity="CustomCustomerGroup" stepKey="customerGroupMembers"/> + <!-- Create customer group Family --> + <createData entity="CustomCustomerGroup" stepKey="customerGroupFamily"/> + + <!-- Create customer assigned to Main Website and to Members group --> + <createData entity="UsCustomerAssignedToNewCustomerGroup" stepKey="customerAssignedToMainWebsiteMembersGroup"> + <requiredEntity createDataKey="customerGroupMembers"/> + </createData> + <!-- Create customer assigned to Main Website and to Family group --> + <createData entity="UsCustomerAssignedToNewCustomerGroup" stepKey="customerAssignedToMainWebsiteFamilyGroup"> + <requiredEntity createDataKey="customerGroupFamily"/> + </createData> + + <!-- Create customer assigned to FR Website and to Members group --> + <createData entity="FrenchCustomerOneAssignedToNewCustomerGroup" stepKey="customerAssignedToFrenchWebsiteMembersGroup"> + <requiredEntity createDataKey="customerGroupMembers"/> + </createData> + <amOnPage url="{{AdminEditCustomerPage.url($$customerAssignedToFrenchWebsiteMembersGroup.id$$)}}" stepKey="goToFRCustomerMembersGroupEditPage"/> + <waitForPageLoad stepKey="waitPageToLoad1"/> + <actionGroup ref="AdminOpenAccountInformationTabFromCustomerEditPageActionGroup" stepKey="clickOnAccountInformation1"/> + <actionGroup ref="AdminCustomerSelectWebsiteGroupStoreActionGroup" stepKey="selectWebsiteGroupStoreForFRCustomerMembersGroup"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="customerGroup" value="$$customerGroupMembers.code$$"/> + <argument name="store" value="{{customStoreFR.name}}"/> + </actionGroup> + + <!-- Create customer assigned to FR Website and to Family group --> + <createData entity="FrenchCustomerTwoAssignedToNewCustomerGroup" stepKey="customerAssignedToFrenchWebsiteFamilyGroup"> + <requiredEntity createDataKey="customerGroupFamily"/> + </createData> + <amOnPage url="{{AdminEditCustomerPage.url($$customerAssignedToFrenchWebsiteFamilyGroup.id$$)}}" stepKey="goToFRCustomerFamilyGroupEditPage"/> + <waitForPageLoad stepKey="waitPageToLoad2"/> + <actionGroup ref="AdminOpenAccountInformationTabFromCustomerEditPageActionGroup" stepKey="clickOnAccountInformation2"/> + <actionGroup ref="AdminCustomerSelectWebsiteGroupStoreActionGroup" stepKey="selectWebsiteGroupStoreForFRCustomerFamilyGroup"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="customerGroup" value="$$customerGroupFamily.code$$"/> + <argument name="store" value="{{customStoreFR.name}}"/> + </actionGroup> + + <!-- Add store code to url --> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> + <!-- Set Customer Accounts Sharing to Global --> + <magentoCLI command="config:set {{CustomerAccountShareGlobalConfigData.path}} {{CustomerAccountShareGlobalConfigData.value}}" stepKey="shareCustomerAccountsGlobal"/> + <magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches"/> + <!-- Reindex all indexers --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + </before> + <after> + <!-- Delete website --> + <actionGroup ref="DeleteCustomWebsiteActionGroup" stepKey="deleteStoreUS"> + <argument name="websiteName" value="customWebsite.name"/> + </actionGroup> + <!-- Delete root category and subcategory --> + <deleteData createDataKey="createFrenchRootCategory" stepKey="deleteAdditionalRootCategory"/> + <deleteData createDataKey="createDefaultSubcategory" stepKey="deleteSubCategoryOfDefaultRootCategory"/> + <!-- Delete products --> + <deleteData createDataKey="simpleMainProduct" stepKey="deleteSimpleMainProduct"/> + <deleteData createDataKey="simpleFrenchProduct" stepKey="deleteSimpleFrenchProduct"/> + <deleteData createDataKey="simpleCommonProduct" stepKey="deleteSimpleCommonProduct"/> + + <!-- Delete Main website customers --> + <deleteData createDataKey="customerAssignedToMainWebsiteMembersGroup" stepKey="deleteMainWebsiteMembersGroupCustomer"/> + <deleteData createDataKey="customerAssignedToMainWebsiteFamilyGroup" stepKey="deleteMainWebsiteFamilyGroupCustomer"/> + <!-- Delete FR Website customers --> + <deleteData createDataKey="customerAssignedToFrenchWebsiteMembersGroup" stepKey="deleteFRWebsiteMembersGroupCustomer"/> + <deleteData createDataKey="customerAssignedToFrenchWebsiteFamilyGroup" stepKey="deleteFRWebsiteFamilyGroupCustomer"/> + + <!-- Delete customer group --> + <deleteData createDataKey="customerGroupMembers" stepKey="deleteCustomerGroupMembers"/> + <deleteData createDataKey="customerGroupFamily" stepKey="deleteCustomerGroupFamily"/> + + <!-- Rollback config settings --> + <magentoCLI command="config:set {{CustomerAccountShareWebsiteConfigData.path}} {{CustomerAccountShareWebsiteConfigData.value}}" stepKey="shareCustomerAccountsPerWebsite"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <!-- Reindex all indexers --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + </after> + <!--Grab new store view code--> + <actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="navigateToNewWebsitePage"/> + <fillField userInput="{{customWebsite.name}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillSearchWebsiteField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <click selector="{{AdminStoresGridSection.storeNameInFirstRow}}" stepKey="clickFirstRow"/> + <grabValueFrom selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="grabStoreViewCode"/> + <click selector="{{AdminNewStoreViewActionsSection.backButton}}" stepKey="clickBack"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickResetButton"/> + <waitForPageLoad stepKey="waitForStorePageLoad"/> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore"/> + <waitForPageLoad stepKey="waitForHomePageLoad"/> + <!-- Sign In FR Members Group customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerMembersGroupLogin"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR"/> + <waitForPageLoad stepKey="waitForCategoryPageFR"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore2"/> + <waitForPageLoad stepKey="waitForHomePageLoad2"/> + <!-- Sign In FR Family Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerFamilyGroupLogin"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR2"/> + <waitForPageLoad stepKey="waitForCategoryPageFR2"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR2"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR2"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut2"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to Main Website home page with Family Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage1"/> + <waitForPageLoad stepKey="waitForHomePageLoad3"/> + <!-- Sign In Main Website Family Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerFamilyGroupLogin"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain1"/> + <waitForPageLoad stepKey="waitForCategoryPageMain1"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain1"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth1"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront1"/> + + <!-- Go to Main Website home page with Members Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage2"/> + <waitForPageLoad stepKey="waitForHomePageLoad4"/> + <!-- Sign In Main Website Members Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerMembersGroupLogin"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain2"/> + <waitForPageLoad stepKey="waitForCategoryPageMain2"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain2"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth2"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront2"/> + + <!-- Exclude French Website from Members group --> + <actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPage1"/> + <actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByMembersGroup"> + <argument name="customerGroupName" value="$$customerGroupMembers.code$$"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openMembersCustomerGroupEditPage"> + <argument name="groupCode" value="$$customerGroupMembers.code$$"/> + </actionGroup> + <selectOption selector="{{AdminEditCustomerGroupSection.excludeWebsite}}" userInput="{{customWebsite.name}}" stepKey="selectFRExcludedWebsiteOption"/> + <click selector="{{AdminNewCustomerGroupSection.saveCustomerGroup}}" stepKey="clickToSaveCustomerGroup1"/> + <waitForPageLoad stepKey="waitForCustomerGroupSaved1"/> + <see stepKey="seeCustomerGroupSaveMessage1" userInput="You saved the customer group."/> + + <!-- Exclude Main Website from Family group --> + <actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPage2"/> + <actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByFamilyGroup"> + <argument name="customerGroupName" value="$$customerGroupFamily.code$$"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openFamilyCustomerGroupEditPage"> + <argument name="groupCode" value="$$customerGroupFamily.code$$"/> + </actionGroup> + <selectOption selector="{{AdminEditCustomerGroupSection.excludeWebsite}}" userInput="Main Website" stepKey="selectMainExcludedWebsiteOption"/> + <click selector="{{AdminNewCustomerGroupSection.saveCustomerGroup}}" stepKey="clickToSaveCustomerGroup2"/> + <waitForPageLoad stepKey="waitForCustomerGroupSaved2"/> + <see stepKey="seeCustomerGroupSaveMessage2" userInput="You saved the customer group."/> + + <!-- Go to FR website home page as NOT LOGGED IN user --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore3"/> + <waitForPageLoad stepKey="waitForHomePageLoad5"/> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR3"/> + <waitForPageLoad stepKey="waitForCategoryPageFR3"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR3"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR3"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + + <!-- Sign In FR Website as Family Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerFamilyGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR4"/> + <waitForPageLoad stepKey="waitForCategoryPageFR4"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR4"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR4"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut3"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore4"/> + <waitForPageLoad stepKey="waitForHomePageLoad6"/> + <!-- Sign In FR Website as Members Group customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerMembersGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert that customer is excluded from Members customer group --> + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterLogin"> + <argument name="messageType" value="error"/> + <argument name="message" value="This website is excluded from customer's group."/> + </actionGroup> + + <!-- Go to Main Website home page with Members Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage3"/> + <waitForPageLoad stepKey="waitForHomePageLoad7"/> + <!-- Sign In Main Website as Members Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerMembersGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain3"/> + <waitForPageLoad stepKey="waitForCategoryPageMain4"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain3"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth3"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront3"/> + + <!-- Go to Main Website home page with Family Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage4"/> + <waitForPageLoad stepKey="waitForHomePageLoad8"/> + <!-- Sign In Main Website as Family Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerFamilyGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert that customer is excluded from Family customer group --> + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterLogin2"> + <argument name="messageType" value="error"/> + <argument name="message" value="This website is excluded from customer's group."/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingPerWebsiteTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingPerWebsiteTest.xml new file mode 100644 index 0000000000000..b6428e46d2625 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/ExcludeWebsiteFromCustomerGroupCustomerAccountSharingPerWebsiteTest.xml @@ -0,0 +1,385 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="ExcludeWebsiteFromCustomerGroupCustomerAccountSharingPerWebsiteTest"> + <annotations> + <features value="Customer"/> + <stories value="Exclude Website From Customer Group With Account Sharing Per Website"/> + <title value="Exclude Website From Customer Group With Account Sharing Per Website"/> + <description value="Exclude websites from Customer Group with Customer Accounts Sharing per Website"/> + <testCaseId value="MC-41141"/> + <severity value="MAJOR"/> + <group value="customers"/> + </annotations> + + <before> + <!-- Set indexer on save --> + <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> + <!-- Create French Root Category with its Subcategory--> + <createData entity="NewRootCategory" stepKey="createFrenchRootCategory"/> + <createData entity="SimpleRootSubCategory" stepKey="createFrenchSubcategory"> + <requiredEntity createDataKey="createFrenchRootCategory"/> + </createData> + <!-- Create subcategory to the Default Root Category --> + <createData entity="SimpleSubCategory" stepKey="createDefaultSubcategory"/> + + <!-- Create 3 products --> + <createData entity="SimpleProduct2" stepKey="simpleMainProduct"/> + <createData entity="SimpleProduct2" stepKey="simpleFrenchProduct"/> + <createData entity="SimpleProduct2" stepKey="simpleCommonProduct"/> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Create French Website, Store, & Store View --> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsiteFR"> + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> + <argument name="websiteCode" value="{{customWebsite.code}}"/> + </actionGroup> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createStoreFR"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="store" value="{{customStoreFR.name}}"/> + <argument name="rootCategory" value="$$createFrenchRootCategory.name$$"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewFR"> + <argument name="StoreGroup" value="customStoreFR"/> + <argument name="customStore" value="customStoreFR"/> + </actionGroup> + + <!-- 1. Open Admin > Catalog > Products > Default Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToDefaultProduct"> + <argument name="productId" value="$$simpleMainProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad1"/> + <!-- 2. Assign SubCategory Of Additional Root Category to Default product. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignDefaultProduct"> + <argument name="categoryName" value="$$createDefaultSubcategory.name$$"/> + </actionGroup> + + <!-- 1. Open Admin > Catalog > Products > Additional Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToAdditionalProduct"> + <argument name="productId" value="$$simpleFrenchProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad2"/> + <!-- 2. Assign subcategory of default root category to Additional product. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignAdditionalProduct"> + <argument name="categoryName" value="$$createFrenchSubcategory.name$$"/> + </actionGroup> + <!-- 3. Assign Additional Website to Additional product --> + <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectAdditionalWebsiteInAdditionalProduct"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> + + <!-- 1. Open Admin > Catalog > Products > Common Product --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToCommonProduct"> + <argument name="productId" value="$$simpleCommonProduct.id$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductPageLoad3"/> + <!-- 2. Assign product to Subcategory of Default and Additional Websites. Save product --> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignCommonProduct1"> + <argument name="categoryName" value="$$createDefaultSubcategory.name$$"/> + </actionGroup> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignCommonProduct2"> + <argument name="categoryName" value="$$createFrenchSubcategory.name$$"/> + </actionGroup> + <!-- 3. Assign Additional Website to Additional product --> + <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectAdditionalWebsiteInCommonProduct"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> + + <!-- Create customer group Members --> + <createData entity="CustomCustomerGroup" stepKey="customerGroupMembers"/> + <!-- Create customer group Family --> + <createData entity="CustomCustomerGroup" stepKey="customerGroupFamily"/> + + <!-- Create customer assigned to Main Website and to Members group --> + <createData entity="UsCustomerAssignedToNewCustomerGroup" stepKey="customerAssignedToMainWebsiteMembersGroup"> + <requiredEntity createDataKey="customerGroupMembers"/> + </createData> + <!-- Create customer assigned to Main Website and to Family group --> + <createData entity="UsCustomerAssignedToNewCustomerGroup" stepKey="customerAssignedToMainWebsiteFamilyGroup"> + <requiredEntity createDataKey="customerGroupFamily"/> + </createData> + + <!-- Create customer assigned to FR Website and to Members group --> + <createData entity="FrenchCustomerOneAssignedToNewCustomerGroup" stepKey="customerAssignedToFrenchWebsiteMembersGroup"> + <requiredEntity createDataKey="customerGroupMembers"/> + </createData> + <amOnPage url="{{AdminEditCustomerPage.url($$customerAssignedToFrenchWebsiteMembersGroup.id$$)}}" stepKey="goToFRCustomerMembersGroupEditPage"/> + <waitForPageLoad stepKey="waitPageToLoad1"/> + <actionGroup ref="AdminOpenAccountInformationTabFromCustomerEditPageActionGroup" stepKey="clickOnAccountInformation1"/> + <actionGroup ref="AdminCustomerSelectWebsiteGroupStoreActionGroup" stepKey="selectWebsiteGroupStoreForFRCustomerMembersGroup"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="customerGroup" value="$$customerGroupMembers.code$$"/> + <argument name="store" value="{{customStoreFR.name}}"/> + </actionGroup> + + <!-- Create customer assigned to FR Website and to Family group --> + <createData entity="FrenchCustomerTwoAssignedToNewCustomerGroup" stepKey="customerAssignedToFrenchWebsiteFamilyGroup"> + <requiredEntity createDataKey="customerGroupFamily"/> + </createData> + <amOnPage url="{{AdminEditCustomerPage.url($$customerAssignedToFrenchWebsiteFamilyGroup.id$$)}}" stepKey="goToFRCustomerFamilyGroupEditPage"/> + <waitForPageLoad stepKey="waitPageToLoad2"/> + <actionGroup ref="AdminOpenAccountInformationTabFromCustomerEditPageActionGroup" stepKey="clickOnAccountInformation2"/> + <actionGroup ref="AdminCustomerSelectWebsiteGroupStoreActionGroup" stepKey="selectWebsiteGroupStoreForFRCustomerFamilyGroup"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="customerGroup" value="$$customerGroupFamily.code$$"/> + <argument name="store" value="{{customStoreFR.name}}"/> + </actionGroup> + + <!-- Add store code to url --> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> + <!-- Set Customer Accounts Sharing to Per Website --> + <magentoCLI command="config:set {{CustomerAccountShareWebsiteConfigData.path}} {{CustomerAccountShareWebsiteConfigData.value}}" stepKey="setConfigCustomerAccountToWebsite"/> + <magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches"/> + <!-- Reindex all indexers --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + </before> + <after> + <!-- Delete website --> + <actionGroup ref="DeleteCustomWebsiteActionGroup" stepKey="deleteStoreUS"> + <argument name="websiteName" value="customWebsite.name"/> + </actionGroup> + <!-- Delete root category and subcategory --> + <deleteData createDataKey="createFrenchRootCategory" stepKey="deleteAdditionalRootCategory"/> + <deleteData createDataKey="createDefaultSubcategory" stepKey="deleteSubCategoryOfDefaultRootCategory"/> + <!-- Delete products --> + <deleteData createDataKey="simpleMainProduct" stepKey="deleteSimpleMainProduct"/> + <deleteData createDataKey="simpleFrenchProduct" stepKey="deleteSimpleFrenchProduct"/> + <deleteData createDataKey="simpleCommonProduct" stepKey="deleteSimpleCommonProduct"/> + + <!-- Delete Main website customers --> + <deleteData createDataKey="customerAssignedToMainWebsiteMembersGroup" stepKey="deleteMainWebsiteMembersGroupCustomer"/> + <deleteData createDataKey="customerAssignedToMainWebsiteFamilyGroup" stepKey="deleteMainWebsiteFamilyGroupCustomer"/> + <!-- Delete FR Website customers --> + <deleteData createDataKey="customerAssignedToFrenchWebsiteMembersGroup" stepKey="deleteFRWebsiteMembersGroupCustomer"/> + <deleteData createDataKey="customerAssignedToFrenchWebsiteFamilyGroup" stepKey="deleteFRWebsiteFamilyGroupCustomer"/> + + <!-- Delete customer group --> + <deleteData createDataKey="customerGroupMembers" stepKey="deleteCustomerGroupMembers"/> + <deleteData createDataKey="customerGroupFamily" stepKey="deleteCustomerGroupFamily"/> + + <!-- Rollback config settings --> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <!-- Reindex all indexers --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + </after> + <!--Grab new store view code--> + <actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="navigateToNewWebsitePage"/> + <fillField userInput="{{customWebsite.name}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillSearchWebsiteField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <click selector="{{AdminStoresGridSection.storeNameInFirstRow}}" stepKey="clickFirstRow"/> + <grabValueFrom selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="grabStoreViewCode"/> + <click selector="{{AdminNewStoreViewActionsSection.backButton}}" stepKey="clickBack"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickResetButton"/> + <waitForPageLoad stepKey="waitForStorePageLoad"/> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore"/> + <waitForPageLoad stepKey="waitForHomePageLoad"/> + <!-- Sign In FR Members Group customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerMembersGroupLogin"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR"/> + <waitForPageLoad stepKey="waitForCategoryPageFR"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore2"/> + <waitForPageLoad stepKey="waitForHomePageLoad2"/> + <!-- Sign In FR Family Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerFamilyGroupLogin"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR2"/> + <waitForPageLoad stepKey="waitForCategoryPageFR2"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR2"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR2"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut2"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to Main Website home page with Family Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage1"/> + <waitForPageLoad stepKey="waitForHomePageLoad3"/> + <!-- Sign In Main Website Family Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerFamilyGroupLogin"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain1"/> + <waitForPageLoad stepKey="waitForCategoryPageMain1"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain1"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth1"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront1"/> + + <!-- Go to Main Website home page with Members Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage2"/> + <waitForPageLoad stepKey="waitForHomePageLoad4"/> + <!-- Sign In Main Website Members Group Customer using Sign In header Link --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerMembersGroupLogin"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain2"/> + <waitForPageLoad stepKey="waitForCategoryPageMain2"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain2"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth2"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront2"/> + + <!-- Exclude French Website from Members group --> + <actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPage1"/> + <actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByMembersGroup"> + <argument name="customerGroupName" value="$$customerGroupMembers.code$$"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openMembersCustomerGroupEditPage"> + <argument name="groupCode" value="$$customerGroupMembers.code$$"/> + </actionGroup> + <selectOption selector="{{AdminEditCustomerGroupSection.excludeWebsite}}" userInput="{{customWebsite.name}}" stepKey="selectFRExcludedWebsiteOption"/> + <click selector="{{AdminNewCustomerGroupSection.saveCustomerGroup}}" stepKey="clickToSaveCustomerGroup1"/> + <waitForPageLoad stepKey="waitForCustomerGroupSaved1"/> + <see stepKey="seeCustomerGroupSaveMessage1" userInput="You saved the customer group."/> + + <!-- Exclude Main Website from Family group --> + <actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPage2"/> + <actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByFamilyGroup"> + <argument name="customerGroupName" value="$$customerGroupFamily.code$$"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openFamilyCustomerGroupEditPage"> + <argument name="groupCode" value="$$customerGroupFamily.code$$"/> + </actionGroup> + <selectOption selector="{{AdminEditCustomerGroupSection.excludeWebsite}}" userInput="Main Website" stepKey="selectMainExcludedWebsiteOption"/> + <click selector="{{AdminNewCustomerGroupSection.saveCustomerGroup}}" stepKey="clickToSaveCustomerGroup2"/> + <waitForPageLoad stepKey="waitForCustomerGroupSaved2"/> + <see stepKey="seeCustomerGroupSaveMessage2" userInput="You saved the customer group."/> + + <!-- Go to FR website home page as NOT LOGGED IN user --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore3"/> + <waitForPageLoad stepKey="waitForHomePageLoad5"/> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR3"/> + <waitForPageLoad stepKey="waitForCategoryPageFR3"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR3"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR3"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + + <!-- Sign In FR Website as Family Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerFamilyGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleFrenchProduct in FR website and FR category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFrenchSubcategory.name$$)}}" stepKey="goToCategoryFR4"/> + <waitForPageLoad stepKey="waitForCategoryPageFR4"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductFRInFR4"> + <argument name="productName" value="$$simpleFrenchProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBothInUS_FR4"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomStoreCustomerLogoutActionGroup" stepKey="storefrontSignOut3"> + <argument name="storeCode" value="{{customStoreFR.code}}"/> + </actionGroup> + + <!-- Go to FR website home page --> + <amOnPage url="$grabStoreViewCode" stepKey="navigateToHomePageOfFRStore4"/> + <waitForPageLoad stepKey="waitForHomePageLoad6"/> + <!-- Sign In FR Website as Members Group customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="FrCustomerMembersGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert that customer is excluded from Members customer group --> + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterLogin"> + <argument name="messageType" value="error"/> + <argument name="message" value="This website is excluded from customer's group."/> + </actionGroup> + + <!-- Go to Main Website home page with Members Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage3"/> + <waitForPageLoad stepKey="waitForHomePageLoad7"/> + <!-- Sign In Main Website as Members Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerMembersGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert simpleCommonProduct and simpleMainProduct in Main Website website and Main category product grid --> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createDefaultSubcategory.name$$)}}" stepKey="goToCategoryMain3"/> + <waitForPageLoad stepKey="waitForCategoryPageMain4"/> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductMainInMain3"> + <argument name="productName" value="$$simpleMainProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertProductBoth3"> + <argument name="productName" value="$$simpleCommonProduct.name$$"/> + </actionGroup> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront3"/> + + <!-- Go to Main Website home page with Family Group customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage4"/> + <waitForPageLoad stepKey="waitForHomePageLoad8"/> + <!-- Sign In Main Website as Family Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerFamilyGroupLogin2"> + <argument name="Customer" value="$$customerAssignedToMainWebsiteFamilyGroup$$"/> + </actionGroup> + <!-- Assert that customer is excluded from Family customer group --> + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterLogin2"> + <argument name="messageType" value="error"/> + <argument name="message" value="This website is excluded from customer's group."/> + </actionGroup> + + <!-- Login to the Main Website as FR customer --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage5"/> + <waitForPageLoad stepKey="waitForHomePageLoad9"/> + <!-- Sign In Main Website as FR Members Group Customer --> + <actionGroup ref="StorefrontLoginAsCustomerUsingHeaderSignInLinkActionGroup" stepKey="MainWebsiteCustomerMembersGroupLogin3"> + <argument name="Customer" value="$$customerAssignedToFrenchWebsiteMembersGroup$$"/> + </actionGroup> + <!-- Assert that customer cannot login --> + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterLogin3"> + <argument name="messageType" value="error"/> + <argument name="message" value="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later."/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontChangePasswordFormShowPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontChangePasswordFormShowPasswordTest.xml new file mode 100644 index 0000000000000..fe7a54bb23554 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontChangePasswordFormShowPasswordTest.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontChangePasswordFormShowPasswordTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer Password Update"/> + <title value="Show Password Checkbox on Customer Change Password Form"/> + <description value="Check Show Password Functionality in Customer Password Update Form"/> + <severity value="MAJOR"/> + <group value="Customer"/> + </annotations> + <before> + <createData stepKey="customer" entity="Simple_US_Customer"/> + </before> + <after> + <deleteData stepKey="deleteCustomer" createDataKey="customer" /> + </after> + + <actionGroup ref="StorefrontOpenCustomerLoginPageActionGroup" stepKey="goToSignInPage"/> + <actionGroup ref="StorefrontFillCustomerLoginFormActionGroup" stepKey="fillLoginFormWithCorrectCredentials"> + <argument name="customer" value="$$customer$$"/> + </actionGroup> + <actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButton" /> + <actionGroup ref="StorefrontOpenCustomerChangePasswordPageActionGroup" stepKey="openCustomerPasswordUpdatePage"/> + <actionGroup ref="StorefrontFillChangePasswordFormActionGroup" stepKey="fillChangePasswordForm"> + <argument name="customer" value="Simple_US_Customer"/> + </actionGroup> + <actionGroup ref="StorefrontCustomerEditFormClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox"/> + <actionGroup ref="AssertCustomerEditFormPasswordFieldActionGroup" stepKey="AssertCurrentPasswordField"/> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml index 28ae33ff7f56b..b9c558c65c513 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml @@ -79,7 +79,7 @@ </actionGroup> <!-- Go to product visible --> - <amOnPage url="$$createProduct.name$$.html" stepKey="navigateToProductPageOnDefaultStore"/> + <amOnPage url="$$createProduct.custom_attributes[url_key]$$.html" stepKey="navigateToProductPageOnDefaultStore"/> <see userInput="$$createProduct.name$$" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertFirstProductNameTitle"/> <!--Add a product to the cart--> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml index 130e1ba6723ae..d04e60ef86bba 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml @@ -102,12 +102,8 @@ <requiredEntity createDataKey="createDownloadableProduct1"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Login --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerFormShowPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerFormShowPasswordTest.xml new file mode 100644 index 0000000000000..39623a3419189 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerFormShowPasswordTest.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCreateCustomerFormShowPasswordTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer Creation"/> + <title value="Show Password Checkbox on Customer Create Form"/> + <description value="Check Show Password Functionality in Customer Creation Form"/> + <severity value="MAJOR"/> + <group value="Customer"/> + </annotations> + + <actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/> + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm"> + <argument name="customer" value="Simple_US_Customer"/> + </actionGroup> + <actionGroup ref="StorefrontRegistrationFormClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox"/> + <actionGroup ref="AssertRegistrationFormPasswordFieldActionGroup" stepKey="AssertPasswordField"/> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml index 47b61b332f571..148afb6d67c21 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml @@ -36,7 +36,7 @@ <argument name="dob" value="{{EN_US_DATE.short4DigitYear}}"/> </actionGroup> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="customer_grid"/> </actionGroup> <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteNewUser"> <argument name="email" value="{{CustomerEntityOne.email}}"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontLoginFormShowPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontLoginFormShowPasswordTest.xml new file mode 100644 index 0000000000000..4e967cdee8dfc --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontLoginFormShowPasswordTest.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontLoginFormShowPasswordTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer Login"/> + <title value="Show Password Checkbox on Customer Login Form"/> + <description value="Check Show Password Functionality on Customer Login Form"/> + <severity value="MAJOR"/> + <group value="Customer"/> + </annotations> + <before> + <createData stepKey="customer" entity="Simple_US_Customer"/> + </before> + <after> + <deleteData stepKey="deleteCustomer" createDataKey="customer" /> + </after> + + <actionGroup ref="StorefrontOpenCustomerLoginPageActionGroup" stepKey="goToSignInPage"/> + <actionGroup ref="StorefrontFillCustomerLoginFormWithWrongPasswordActionGroup" stepKey="fillLoginFormWithCustomerData"> + <argument name="customer" value="$$customer$$"/> + </actionGroup> + <actionGroup ref="StorefrontLoginFormClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox"/> + <actionGroup ref="AssertLoginFormPasswordFieldActionGroup" stepKey="AssertPasswordField"/> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest/StorefrontUpdateCustomerDefaultShippingAddressFromBlockTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest/StorefrontUpdateCustomerDefaultShippingAddressFromBlockTest.xml index f79ef0a397e27..0539b50dcaac4 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest/StorefrontUpdateCustomerDefaultShippingAddressFromBlockTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest/StorefrontUpdateCustomerDefaultShippingAddressFromBlockTest.xml @@ -9,17 +9,15 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontUpdateCustomerDefaultShippingAddressFromBlockTest"> <annotations> - <features value="Customer address"/> - <stories value="Implement handling of large number of addresses on storefront Address book"/> - <title value="Add default customer address via the Storefront611"/> - <description value="Storefront user should be able to create a new default address via the storefront"/> + <features value="Customer"/> + <stories value="Update Customer Address"/> + <title value="Update customer default shipping address via the Storefront"/> + <description value="Customer should be able to update a default shipping address via the Storefront"/> <severity value="MAJOR"/> - <testCaseId value="MAGETWO-97501"/> + <testCaseId value="MC-40247"/> + <useCaseId value="MAGETWO-97504"/> <group value="customer"/> <group value="update"/> - <skip> - <issueId value="MAGETWO-97504"/> - </skip> </annotations> <before> <createData entity="Simple_US_Customer_With_Different_Billing_Shipping_Addresses" stepKey="createCustomer"/> @@ -30,16 +28,18 @@ <!--Log in to Storefront as Customer 1 --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> - <argument name="Customer" value="$$createCustomer$$"/> + <argument name="Customer" value="$createCustomer$"/> </actionGroup> - <amOnPage url="customer/address/" stepKey="OpenCustomerAddNewAddress"/> - <click stepKey="ClickEditDefaultShippingAddress" selector="{{StorefrontCustomerAddressesSection.editDefaultShippingAddress}}"/> - <fillField stepKey="fillFirstName" userInput="EditedFirstNameShipping" selector="{{StorefrontCustomerAddressFormSection.firstName}}"/> - <fillField stepKey="fillLastName" userInput="EditedLastNameShipping" selector="{{StorefrontCustomerAddressFormSection.lastName}}"/> - <click stepKey="saveCustomerAddress" selector="{{StorefrontCustomerAddressFormSection.saveAddress}}"/> - <see userInput="You saved the address." stepKey="verifyAddressAdded"/> + <amOnPage url="{{StorefrontCustomerAddressesPage.url}}" stepKey="OpenCustomerAddNewAddress"/> + <waitForElementVisible selector="{{StorefrontCustomerAddressesSection.editDefaultShippingAddress}}" stepKey="waitForChangeShippingAddressLinkVisible"/> + <click selector="{{StorefrontCustomerAddressesSection.editDefaultShippingAddress}}" stepKey="ClickEditDefaultShippingAddress"/> + <fillField userInput="EditedFirstNameShipping" selector="{{StorefrontCustomerAddressFormSection.firstName}}" stepKey="fillFirstName"/> + <fillField userInput="EditedLastNameShipping" selector="{{StorefrontCustomerAddressFormSection.lastName}}" stepKey="fillLastName"/> + <click selector="{{StorefrontCustomerAddressFormSection.saveAddress}}" stepKey="saveCustomerAddress"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessageVisible"/> + <see userInput="You saved the address." selector="{{StorefrontMessagesSection.success}}" stepKey="verifyAddressAdded"/> <see userInput="EditedFirstNameShipping" selector="{{StorefrontCustomerAddressesSection.defaultShippingAddress}}" stepKey="checkNewAddressesFirstNameOnDefaultShipping"/> - <see userInput="EditedLastNameShipping" selector="{{StorefrontCustomerAddressesSection.defaultBillingAddress}}" stepKey="checkNewAddressesLastNameOnDefaultShipping"/> + <see userInput="EditedLastNameShipping" selector="{{StorefrontCustomerAddressesSection.defaultShippingAddress}}" stepKey="checkNewAddressesLastNameOnDefaultShipping"/> <see userInput="{{US_Address_TX_Default_Billing.firstname}}" selector="{{StorefrontCustomerAddressesSection.defaultBillingAddress}}" stepKey="checkNewAddressesFirstNameOnDefaultBilling"/> <see userInput="{{US_Address_TX_Default_Billing.lastname}}" selector="{{StorefrontCustomerAddressesSection.defaultBillingAddress}}" stepKey="checkNewAddressesLastNameOnDefaultBilling"/> </test> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCustomerTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCustomerTest.xml index 410070234b9c0..3fae59f03f346 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCustomerTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifySecureURLRedirectCustomerTest.xml @@ -25,15 +25,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <executeJS function="return window.location.host" stepKey="hostname"/> <amOnUrl url="http://{$hostname}/customer" stepKey="goToUnsecureCustomerURL"/> diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/FileTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/FileTest.php new file mode 100644 index 0000000000000..7a86b35a98022 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/FileTest.php @@ -0,0 +1,89 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Block\Adminhtml\Form\Element\Address; + +use Magento\Backend\Helper\Data; +use Magento\Customer\Block\Adminhtml\Form\Element\Address\File; +use Magento\Framework\Data\Form\Element\CollectionFactory; +use Magento\Framework\Data\Form\Element\Factory; +use Magento\Framework\Escaper; +use Magento\Framework\Url\EncoderInterface; +use Magento\Framework\View\Asset\Repository; +use PHPUnit\Framework\TestCase; + +/** + * Test customer address file element block + */ +class FileTest extends TestCase +{ + /** + * @var File + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $factoryElement = $this->createMock(Factory::class); + $factoryCollection = $this->createMock(CollectionFactory::class); + $escaper = $this->createMock(Escaper::class); + $adminhtmlData = $this->createMock(Data::class); + $assetRepo = $this->createMock(Repository::class); + $urlEncoder = $this->createMock(EncoderInterface::class); + $formKey = $this->createMock(\Magento\Framework\Data\Form\FormKey::class); + $form = new \Magento\Framework\Data\Form( + $factoryElement, + $factoryCollection, + $formKey + ); + $class = $this->modelClass(); + $this->model = new $class( + $factoryElement, + $factoryCollection, + $escaper, + $adminhtmlData, + $assetRepo, + $urlEncoder, + ); + $this->model->setForm($form); + $adminhtmlData->method('getUrl') + ->willReturnCallback( + function (string $path, array $params) { + $url = 'http://example.com/admin/' . trim($path, '/'); + foreach ($params as $key => $value) { + $url .= "/$key/$value"; + } + return $url; + } + ); + $urlEncoder->method('encode') + ->willReturnCallback('md5'); + } + + /** + * Test that the file element html has proper download link + */ + public function testGetElementHtml(): void + { + $expected = 'http://example.com/admin/customer/address/viewfile/file/a7aef9426d9744cdf873c83ee830f6f5'; + $filePath = '/i/m/image.png'; + $this->model->setValue($filePath); + $this->assertStringContainsString($expected, $this->model->getElementHtml()); + } + + /** + * @return string + */ + public function modelClass(): string + { + return File::class; + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/ImageTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/ImageTest.php new file mode 100644 index 0000000000000..c6289995be7b7 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Form/Element/Address/ImageTest.php @@ -0,0 +1,24 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Block\Adminhtml\Form\Element\Address; + +use Magento\Customer\Block\Adminhtml\Form\Element\Address\Image; + +/** + * Test customer address image element block + */ +class ImageTest extends FileTest +{ + /** + * @inheritdoc + */ + public function modelClass(): string + { + return Image::class; + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/ImageTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/ImageTest.php index 123ea590434c7..7016b22384e7a 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/ImageTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/ImageTest.php @@ -69,7 +69,7 @@ public function testGetPreviewFile() ->willReturnArgument(0); $this->backendHelperMock->expects($this->once()) ->method('getUrl') - ->with('customer/index/viewfile', ['image' => $value]) + ->with('customer/index/viewfile', ['file' => $value]) ->willReturn($url); $this->assertStringContainsString($url, $this->image->getElementHtml()); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php index ad024d7e65c07..fc32562e8aaaa 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php @@ -69,6 +69,14 @@ class CreateTest extends TestCase */ protected $pageFactoryMock; + /** + * @var Http|MockObject + */ + private $request; + + /** + * @inheritDoc + */ protected function setUp(): void { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/LogoutTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/LogoutTest.php index ff218ef7a2e39..2381e38fc1e74 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/LogoutTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/LogoutTest.php @@ -7,6 +7,7 @@ namespace Magento\Customer\Test\Unit\Controller\Account; +use Magento\Customer\Api\SessionCleanerInterface; use Magento\Customer\Controller\Account\Logout; use Magento\Customer\Model\Session; use Magento\Framework\App\Action\Context; @@ -48,6 +49,11 @@ class LogoutTest extends TestCase /** @var RedirectInterface|MockObject */ protected $redirect; + /** + * @var SessionCleanerInterface|MockObject + */ + private $sessionCleanerMock; + protected function setUp(): void { $this->contextMock = $this->getMockBuilder(Context::class) @@ -57,6 +63,7 @@ protected function setUp(): void ->disableOriginalConstructor() ->setMethods(['getId', 'logout', 'setBeforeAuthUrl', 'setLastCustomerId']) ->getMock(); + $this->sessionCleanerMock = $this->createMock(SessionCleanerInterface::class); $this->cookieMetadataFactory = $this->getMockBuilder(CookieMetadataFactory::class) ->disableOriginalConstructor() @@ -83,7 +90,7 @@ protected function setUp(): void ->method('getRedirect') ->willReturn($this->redirect); - $this->controller = new Logout($this->contextMock, $this->sessionMock); + $this->controller = new Logout($this->contextMock, $this->sessionMock, $this->sessionCleanerMock); $refClass = new \ReflectionClass(Logout::class); $cookieMetadataManagerProperty = $refClass->getProperty('cookieMetadataManager'); @@ -117,6 +124,11 @@ public function testExecute() ->method('setLastCustomerId') ->with($customerId); + $this->sessionCleanerMock->expects($this->once()) + ->method('clearFor') + ->with($customerId) + ->willReturnSelf(); + $this->cookieManager->expects($this->once()) ->method('getCookie') ->with('mage-cache-sessid') diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php index a5186e1dc5c05..7fd6806013efd 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php @@ -11,6 +11,8 @@ use Magento\Backend\Model\Session; use Magento\Backend\Model\View\Result\Forward; use Magento\Backend\Model\View\Result\ForwardFactory; +use Magento\Customer\Api\Data\GroupExtension; +use Magento\Customer\Api\Data\GroupExtensionInterfaceFactory; use Magento\Customer\Api\Data\GroupInterface; use Magento\Customer\Api\Data\GroupInterfaceFactory; use Magento\Customer\Api\GroupRepositoryInterface; @@ -64,9 +66,6 @@ class SaveTest extends TestCase /** @var Redirect|MockObject */ protected $resultRedirect; - /** @var GroupInterface|MockObject */ - protected $customerGroup; - /** @var ManagerInterface|MockObject */ protected $messageManager; @@ -79,6 +78,12 @@ class SaveTest extends TestCase /** @var Session|MockObject */ protected $session; + /** @var GroupExtensionInterfaceFactory $groupExtensionInterfaceFactory|MockObject */ + private $groupExtensionInterfaceFactory; + + /** @var GroupExtension/MockObject */ + private $groupExtension; + protected function setUp(): void { $this->contextMock = $this->getMockBuilder(Context::class) @@ -109,30 +114,36 @@ protected function setUp(): void $this->resultRedirect = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); - $this->customerGroup = $this->getMockBuilder(GroupInterface::class) - ->getMockForAbstractClass(); $this->messageManager = $this->getMockBuilder(ManagerInterface::class) ->getMockForAbstractClass(); $this->resultForward = $this->getMockBuilder(Forward::class) ->disableOriginalConstructor() ->getMock(); $this->group = $this->getMockBuilder(GroupInterface::class) + ->setMethods(['setExtensionAttributes']) ->getMockForAbstractClass(); $this->session = $this->getMockBuilder(Session::class) ->disableOriginalConstructor() ->setMethods(['setCustomerGroupData']) ->getMock(); + $this->groupExtensionInterfaceFactory = $this->getMockBuilder(GroupExtensionInterfaceFactory::class) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->groupExtension = $this->getMockBuilder(GroupExtension::class) + ->disableOriginalConstructor() + ->getMock(); - $this->contextMock->expects($this->once()) + $this->contextMock->expects(self::once()) ->method('getMessageManager') ->willReturn($this->messageManager); - $this->contextMock->expects($this->once()) + $this->contextMock->expects(self::once()) ->method('getRequest') ->willReturn($this->request); - $this->contextMock->expects($this->once()) + $this->contextMock->expects(self::once()) ->method('getResultRedirectFactory') ->willReturn($this->resultRedirectFactory); - $this->contextMock->expects($this->once()) + $this->contextMock->expects(self::once()) ->method('getSession') ->willReturn($this->session); @@ -143,24 +154,37 @@ protected function setUp(): void $this->groupInterfaceFactoryMock, $this->forwardFactoryMock, $this->pageFactoryMock, - $this->dataObjectProcessorMock + $this->dataObjectProcessorMock, + $this->groupExtensionInterfaceFactory ); } - public function testExecuteWithTaxClassAndException() + public function testExecuteWithTaxClassAndException(): void { $taxClass = '3'; $groupId = 0; $code = 'NOT LOGGED IN'; - $this->request->expects($this->exactly(3)) - ->method('getParam') - ->withConsecutive( - ['tax_class'], - ['id'], - ['code'] - ) - ->willReturnOnConsecutiveCalls($taxClass, $groupId, null); + $this->request->method('getParam') + ->willReturnMap( + [ + ['tax_class', null, $taxClass], + ['id', null, $groupId], + ['code', null, null], + ['customer_group_excluded_websites', null, ''] + ] + ); + $this->groupExtensionInterfaceFactory->expects(self::once()) + ->method('create') + ->willReturn($this->groupExtension); + $this->groupExtension->expects(self::once()) + ->method('setExcludeWebsiteIds') + ->with([]) + ->willReturnSelf(); + $this->group->expects(self::once()) + ->method('setExtensionAttributes') + ->with($this->groupExtension) + ->willReturnSelf(); $this->resultRedirectFactory->expects($this->once()) ->method('create') ->willReturn($this->resultRedirect); @@ -168,55 +192,55 @@ public function testExecuteWithTaxClassAndException() ->method('getById') ->with($groupId) ->willReturn($this->group); - $this->group->expects($this->once()) + $this->group->expects(self::once()) ->method('getCode') ->willReturn($code); - $this->group->expects($this->once()) + $this->group->expects(self::once()) ->method('setCode') ->with($code); - $this->group->expects($this->once()) + $this->group->expects(self::once()) ->method('setTaxClassId') ->with($taxClass); - $this->groupRepositoryMock->expects($this->once()) + $this->groupRepositoryMock->expects(self::once()) ->method('save') ->with($this->group); - $this->messageManager->expects($this->once()) + $this->messageManager->expects(self::once()) ->method('addSuccessMessage') ->with(__('You saved the customer group.')); $exception = new \Exception('Exception'); - $this->resultRedirect->expects($this->at(0)) + $this->resultRedirect->expects(self::at(0)) ->method('setPath') ->with('customer/group') ->willThrowException($exception); - $this->messageManager->expects($this->once()) + $this->messageManager->expects(self::once()) ->method('addErrorMessage') ->with('Exception'); - $this->dataObjectProcessorMock->expects($this->once()) + $this->dataObjectProcessorMock->expects(self::once()) ->method('buildOutputDataArray') ->with($this->group, GroupInterface::class) ->willReturn(['code' => $code]); - $this->session->expects($this->once()) + $this->session->expects(self::once()) ->method('setCustomerGroupData') ->with(['customer_group_code' => $code]); - $this->resultRedirect->expects($this->at(1)) + $this->resultRedirect->expects(self::at(1)) ->method('setPath') ->with('customer/group/edit', ['id' => $groupId]); - $this->assertSame($this->resultRedirect, $this->controller->execute()); + self::assertSame($this->resultRedirect, $this->controller->execute()); } - public function testExecuteWithoutTaxClass() + public function testExecuteWithoutTaxClass(): void { - $this->request->expects($this->once()) + $this->request->expects(self::once()) ->method('getParam') ->with('tax_class') ->willReturn(null); - $this->forwardFactoryMock->expects($this->once()) + $this->forwardFactoryMock->expects(self::once()) ->method('create') ->willReturn($this->resultForward); - $this->resultForward->expects($this->once()) + $this->resultForward->expects(self::once()) ->method('forward') ->with('new') ->willReturnSelf(); - $this->assertSame($this->resultForward, $this->controller->execute()); + self::assertSame($this->resultForward, $this->controller->execute()); } } diff --git a/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php b/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php index b93ee2b1abec8..03d6dbf1c2c77 100644 --- a/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php +++ b/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php @@ -12,6 +12,7 @@ use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Helper\View; use Magento\Framework\App\Helper\Context; +use Magento\Framework\Escaper; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -26,6 +27,11 @@ class ViewTest extends TestCase /** @var CustomerMetadataInterface|MockObject */ protected $customerMetadataService; + /** + * @var Escaper|MockObject + */ + private $escaperMock; + protected function setUp(): void { $this->context = $this->getMockBuilder(Context::class) @@ -38,8 +44,9 @@ protected function setUp(): void $this->customerMetadataService->expects($this->any()) ->method('getAttributeMetadata') ->willReturn($attributeMetadata); + $this->escaperMock = $this->createMock(Escaper::class); - $this->object = new View($this->context, $this->customerMetadataService); + $this->object = new View($this->context, $this->customerMetadataService, $this->escaperMock); } /** @@ -60,6 +67,7 @@ public function testGetCustomerName($prefix, $firstName, $middleName, $lastName, ->method('getLastname')->willReturn($lastName); $customerData->expects($this->any()) ->method('getSuffix')->willReturn($suffix); + $this->escaperMock->expects($this->once())->method('escapeHtml')->with($result)->willReturn($result); $this->assertEquals($result, $this->object->getCustomerName($customerData)); } diff --git a/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php b/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php index 0edeff1e6d12d..eb93fbf06f6e6 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php @@ -398,6 +398,10 @@ public function testSetRedirectCookie(): void ->method('setPath') ->with('storePath') ->willReturnSelf(); + $publicMetadataMock->expects($this->once()) + ->method('setSameSite') + ->with('Lax') + ->willReturnSelf(); $coockieManagerMock->expects($this->once()) ->method('setPublicCookie') ->with( diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/Validator/CustomerTest.php b/app/code/Magento/Customer/Test/Unit/Model/Address/Validator/CustomerTest.php new file mode 100644 index 0000000000000..ad50e09e11508 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/Validator/CustomerTest.php @@ -0,0 +1,201 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Model\Address\Validator; + +use Magento\Customer\Model\Address; +use Magento\Customer\Model\Address\Validator\Customer as CustomerValidator; +use Magento\Customer\Model\AddressFactory; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Quote\Model\Quote\Address as QuoteAddress; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for Magento\Customer\Model\Address\Validator\Customer class. + */ +class CustomerTest extends TestCase +{ + /** @var AddressFactory|MockObject */ + private $addressFactoryMock; + + /** @var CustomerValidator */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->addressFactoryMock = $this->createMock(AddressFactory::class); + $objectManager = new ObjectManager($this); + + $this->model = $objectManager->getObject( + CustomerValidator::class, + [ + 'addressFactory' => $this->addressFactoryMock, + ] + ); + } + + /** + * @return void + */ + public function testValidateNewCustomerWithNewCustomerAddress(): void + { + $addressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getId')->willReturn(null); + $addressMock->expects($this->never())->method('getCustomerId'); + + $this->assertEmpty($this->model->validate($addressMock)); + } + + /** + * @return void + */ + public function testValidateNewCustomerWithExistingCustomerAddress(): void + { + $addressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + $originalAddressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'load', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getId')->willReturn(1); + $addressMock->expects($this->once())->method('getCustomerId')->willReturn(null); + $this->addressFactoryMock->expects($this->once())->method('create')->willReturn($originalAddressMock); + $originalAddressMock->expects($this->once()) + ->method('load') + ->with(1) + ->willReturn($originalAddressMock); + $originalAddressMock->expects($this->once())->method('getCustomerId')->willReturn(2); + + $this->assertEquals( + [ + __( + 'Provided customer ID "%customer_id" isn\'t related to current customer address.', + ['customer_id' => null] + ) + ], + $this->model->validate($addressMock) + ); + } + + /** + * @return void + */ + public function testValidateExistingCustomerWithNewCustomerAddress(): void + { + $addressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getId')->willReturn(null); + $addressMock->expects($this->never())->method('getCustomerId'); + + $this->assertEmpty($this->model->validate($addressMock)); + } + + /** + * @return void + */ + public function testValidateExistingCustomerWithRelevantCustomerAddress(): void + { + $addressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + $originalAddressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'load', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getId')->willReturn(1); + $this->addressFactoryMock->expects($this->once())->method('create')->willReturn($originalAddressMock); + $originalAddressMock->expects($this->once()) + ->method('load') + ->with(1) + ->willReturn($originalAddressMock); + + $addressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + $originalAddressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + + $this->assertEmpty($this->model->validate($addressMock)); + } + + /** + * @return void + */ + public function testValidateExistingCustomerAddressWithNotRelevantCustomer(): void + { + $addressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + $originalAddressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'load', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getId')->willReturn(1); + $this->addressFactoryMock->expects($this->once())->method('create')->willReturn($originalAddressMock); + $originalAddressMock->expects($this->once()) + ->method('load') + ->with(1) + ->willReturn($originalAddressMock); + + $addressMock->expects($this->once())->method('getCustomerId')->willReturn(2); + $originalAddressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + + $this->assertEquals( + [ + __( + 'Provided customer ID "%customer_id" isn\'t related to current customer address.', + ['customer_id' => 2] + ) + ], + $this->model->validate($addressMock) + ); + } + + /** + * @return void + */ + public function testValidateExistingCustomerWithQuoteAddress(): void + { + $addressMock = $this->getMockBuilder(QuoteAddress::class) + ->onlyMethods(['getCustomerAddressId', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + $originalAddressMock = $this->getMockBuilder(Address::class) + ->onlyMethods(['getId', 'load', 'getCustomerId']) + ->disableOriginalConstructor() + ->getMock(); + + $addressMock->expects($this->once())->method('getCustomerAddressId')->willReturn(1); + $addressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + + $this->addressFactoryMock->expects($this->once())->method('create')->willReturn($originalAddressMock); + $originalAddressMock->expects($this->once()) + ->method('load') + ->with(1) + ->willReturn($originalAddressMock); + + $addressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + $originalAddressMock->expects($this->once())->method('getCustomerId')->willReturn(1); + + $this->assertEmpty($this->model->validate($addressMock)); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Model/CustomerTest.php b/app/code/Magento/Customer/Test/Unit/Model/CustomerTest.php index 65705fcc6ea42..f2cbac7810000 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/CustomerTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/CustomerTest.php @@ -123,7 +123,6 @@ protected function setUp(): void $this->_config = $this->createMock(Config::class); $this->_attribute = $this->createMock(Attribute::class); $this->_storeManager = $this->createMock(StoreManager::class); - $this->_storetMock = $this->createMock(Store::class); $this->_scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class); $this->_transportBuilderMock = $this->createMock(TransportBuilder::class); $this->_transportMock = $this->getMockForAbstractClass(TransportInterface::class); diff --git a/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php b/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php index 51d8c197831bd..81252121c500b 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php @@ -20,6 +20,7 @@ use Magento\Framework\Mail\TransportInterface; use Magento\Framework\Reflection\DataObjectProcessor; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Store\Model\App\Emulation; use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; @@ -113,6 +114,10 @@ class EmailNotificationTest extends TestCase * @var SenderResolverInterface|MockObject */ private $senderResolverMock; + /** + * @var Emulation|MockObject + */ + private $emulation; /** * @inheritdoc @@ -144,6 +149,7 @@ protected function setUp(): void ->setMethods(['resolve']) ->disableOriginalConstructor() ->getMockForAbstractClass(); + $this->emulation = $this->createMock(Emulation::class); $objectManager = new ObjectManagerHelper($this); @@ -157,6 +163,7 @@ protected function setUp(): void 'dataProcessor' => $this->dataProcessorMock, 'scopeConfig' => $this->scopeConfigMock, 'senderResolver' => $this->senderResolverMock, + 'emulation' => $this->emulation, ] ); } @@ -336,6 +343,14 @@ public function testEmailNotifyWhenCredentialsChanged( $transport->expects(clone $expects) ->method('sendMessage'); + $this->emulation->expects(clone $expects) + ->method('startEnvironmentEmulation') + ->willReturnSelf(); + + $this->emulation->expects(clone $expects) + ->method('stopEnvironmentEmulation') + ->willReturnSelf(); + $this->model->credentialsChanged($savedCustomer, $oldEmail, $isPasswordChanged); } @@ -498,6 +513,14 @@ public function testPasswordReminder($customerStoreId):void ['customer' => $this->customerSecureMock, 'store' => $this->storeMock] ); + $this->emulation->expects($this->once()) + ->method('startEnvironmentEmulation') + ->willReturnSelf(); + + $this->emulation->expects($this->once()) + ->method('stopEnvironmentEmulation') + ->willReturnSelf(); + $this->model->passwordReminder($customerMock); } @@ -595,6 +618,14 @@ public function testPasswordReminderCustomerWithoutStoreId():void self::STUB_CUSTOMER_NAME, ['customer' => $this->customerSecureMock, 'store' => $this->storeMock] ); + $this->emulation->expects($this->once()) + ->method('startEnvironmentEmulation') + ->willReturnSelf(); + + $this->emulation->expects($this->once()) + ->method('stopEnvironmentEmulation') + ->willReturnSelf(); + $this->model->passwordReminder($customer); } @@ -690,6 +721,13 @@ public function testPasswordResetConfirmation($customerStoreId):void self::STUB_CUSTOMER_NAME, ['customer' => $this->customerSecureMock, 'store' => $this->storeMock] ); + $this->emulation->expects($this->once()) + ->method('startEnvironmentEmulation') + ->willReturnSelf(); + + $this->emulation->expects($this->once()) + ->method('stopEnvironmentEmulation') + ->willReturnSelf(); $this->model->passwordResetConfirmation($customerMock); } @@ -785,6 +823,13 @@ public function testNewAccount($customerStoreId):void self::STUB_CUSTOMER_NAME, ['customer' => $this->customerSecureMock, 'back_url' => '', 'store' => $this->storeMock] ); + $this->emulation->expects($this->once()) + ->method('startEnvironmentEmulation') + ->willReturnSelf(); + + $this->emulation->expects($this->once()) + ->method('stopEnvironmentEmulation') + ->willReturnSelf(); $this->model->newAccount( $customer, diff --git a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php index fb775ce78bbbc..909e69accbabf 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/FileProcessorTest.php @@ -92,10 +92,16 @@ protected function setUp(): void /** * @param $entityTypeCode * @param array $allowedExtensions + * @param string|null $customerFileUrlPath + * @param string|null $customerAddressFileUrlPath * @return FileProcessor */ - private function getModel($entityTypeCode, array $allowedExtensions = []) - { + private function getModel( + $entityTypeCode, + array $allowedExtensions = [], + string $customerFileUrlPath = null, + string $customerAddressFileUrlPath = null + ) { $model = new FileProcessor( $this->filesystem, $this->uploaderFactory, @@ -103,7 +109,9 @@ private function getModel($entityTypeCode, array $allowedExtensions = []) $this->urlEncoder, $entityTypeCode, $this->mime, - $allowedExtensions + $allowedExtensions, + $customerFileUrlPath ?? 'customer/index/viewfile', + $customerAddressFileUrlPath ?? 'customer/address/viewfile' ); return $model; } @@ -138,46 +146,85 @@ public function testIsExist() $this->assertTrue($model->isExist($fileName)); } - public function testGetViewUrlCustomer() - { - $filePath = 'filename.ext1'; - $encodedFilePath = 'encodedfilenameext1'; - - $fileUrl = 'fileUrl'; - + /** + * @param array $params + * @param string $filePath + * @param string $expectedUrl + * @dataProvider getViewUrlDataProvider + */ + public function testGetViewUrlTest( + array $params, + string $filePath, + string $expectedUrl + ): void { $this->urlEncoder->expects($this->once()) ->method('encode') - ->with($filePath) - ->willReturn($encodedFilePath); + ->willReturnCallback('md5'); $this->urlBuilder->expects($this->once()) ->method('getUrl') - ->with('customer/index/viewfile', ['image' => $encodedFilePath]) - ->willReturn($fileUrl); - - $model = $this->getModel(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER); - $this->assertEquals($fileUrl, $model->getViewUrl($filePath, 'image')); + ->willReturnCallback( + function (string $path, array $params) { + $url = 'http://example.com/' . trim($path, '/'); + foreach ($params as $key => $value) { + $url .= "/$key/$value"; + } + return $url; + } + ); + + $model = $this->getModel( + $params['entityTypeCode'], + [], + $params['customerFileUrlPath'], + $params['addressFileUrlPath'] + ); + $this->assertEquals($expectedUrl, $model->getViewUrl($filePath, 'file')); } - public function testGetViewUrlCustomerAddress() + /** + * @return array[] + */ + public function getViewUrlDataProvider(): array { - $filePath = 'filename.ext1'; - $encodedFilePath = 'encodedfilenameext1'; - - $fileUrl = 'fileUrl'; - - $this->urlEncoder->expects($this->once()) - ->method('encode') - ->with($filePath) - ->willReturn($encodedFilePath); - - $this->urlBuilder->expects($this->once()) - ->method('getUrl') - ->with('customer/address/viewfile', ['image' => $encodedFilePath]) - ->willReturn($fileUrl); - - $model = $this->getModel(AddressMetadataInterface::ENTITY_TYPE_ADDRESS); - $this->assertEquals($fileUrl, $model->getViewUrl($filePath, 'image')); + return [ + [ + [ + 'entityTypeCode' => CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, + 'customerFileUrlPath' => 'customer/index/viewfile', + 'addressFileUrlPath' => 'customer/address/viewfile', + ], + '/i/m/image1.jpeg', + 'http://example.com/customer/index/viewfile/file/57523c876842c97ab9d5fd92f8d8d9ec' + ], + [ + [ + 'entityTypeCode' => AddressMetadataInterface::ENTITY_TYPE_ADDRESS, + 'customerFileUrlPath' => 'customer/index/viewfile', + 'addressFileUrlPath' => 'customer/address/viewfile', + ], + '/i/m/image2.png', + 'http://example.com/customer/address/viewfile/file/4498819248a7f824893bd3dac4babdfc' + ], + [ + [ + 'entityTypeCode' => CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, + 'customerFileUrlPath' => 'custom_module/customer/preview', + 'addressFileUrlPath' => 'custom_module/address/preview', + ], + '/i/m/image1.jpeg', + 'http://example.com/custom_module/customer/preview/file/57523c876842c97ab9d5fd92f8d8d9ec' + ], + [ + [ + 'entityTypeCode' => AddressMetadataInterface::ENTITY_TYPE_ADDRESS, + 'customerFileUrlPath' => 'custom_module/customer/preview', + 'addressFileUrlPath' => 'custom_module/address/preview', + ], + '/i/m/image2.png', + 'http://example.com/custom_module/address/preview/file/4498819248a7f824893bd3dac4babdfc' + ] + ]; } public function testRemoveUploadedFile() @@ -370,7 +417,6 @@ public function testMoveTemporaryFile() ->with($path, $newPath) ->willReturn(true); - $model = $this->getModel(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER); $this->assertEquals('/f/i' . $filePath, $model->moveTemporaryFile($filePath)); } @@ -406,7 +452,6 @@ public function testMoveTemporaryFileNewFileName() ->with($path, 'customer/f/i/filename_2.ext1') ->willReturn(true); - $model = $this->getModel(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER); $this->assertEquals('/f/i/filename_2.ext1', $model->moveTemporaryFile($filePath)); } diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php index b0e9805bb3d2a..32ac9ffc5b077 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php @@ -13,6 +13,7 @@ use Magento\Customer\Model\Metadata\Form\File; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\Request\Http; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\File\Uploader; use Magento\Framework\File\UploaderFactory; use Magento\Framework\Filesystem; @@ -302,6 +303,13 @@ public function testValidateValueToUpload($expected, $value, $parameters = []) $this->returnValue($parameters['valid']) ); + $this->fileProcessorMock->expects($this->any()) + ->method('getStat') + ->willReturn([ + 'extension' => $value['extension'], + 'basename' => $value['basename'] + ]); + $this->fileProcessorMock->expects($this->any()) ->method('isExist') ->willReturn($parameters['uploaded']); @@ -325,15 +333,33 @@ public function validateValueToUploadDataProvider() return [ 'notValid' => [ ['Validation error message.'], - ['tmp_name' => 'tempName_0001.bin', 'name' => 'realFileName.bin'], + [ + 'tmp_name' => 'tempName_0001.bin', + 'name' => 'realFileName.bin', + 'extension' => 'bin', + 'basename' => 'realFileName.bin', + ], ['valid' => false], ], 'notUploaded' => [ ['"realFileName.bin" is not a valid file.'], - ['tmp_name' => 'tempName_0001.bin', 'name' => 'realFileName.bin'], + [ + 'tmp_name' => 'tempName_0001.bin', + 'name' => 'realFileName.bin', + 'extension' => 'bin', + 'basename' => 'realFileName.bin', + ], ['uploaded' => false], ], - 'isValid' => [true, ['tmp_name' => 'tempName_0001.txt', 'name' => 'realFileName.txt']] + 'isValid' => [ + true, + [ + 'tmp_name' => 'tempName_0001.txt', + 'name' => 'realFileName.txt', + 'extension' => 'txt', + 'basename' => 'realFileName.txt', + ], + ], ]; } @@ -367,7 +393,7 @@ public function testCompactValueNoDelete() ->with('value') ->willReturnSelf(); - $this->assertSame('value', $model->compactValue([])); + $this->assertSame([], $model->compactValue([])); } public function testCompactValueDelete() @@ -416,7 +442,12 @@ public function testCompactValueTmpFile() $this->uploaderFactoryMock->expects($this->once()) ->method('create') ->with(['fileId' => $value]) - ->will($this->returnValue($uploaderMock)); + ->willReturn($uploaderMock); + $uploaderMock->expects($this->once())->method('getFileExtension')->willReturn('file'); + $this->fileValidatorMock->expects($this->once()) + ->method('isValid') + ->with('file') + ->willReturn(true); $uploaderMock->expects($this->once()) ->method('setFilesDispersion') ->with(true); @@ -594,7 +625,7 @@ public function testCompactValueRemoveUiComponentValue() ->with($value) ->willReturnSelf(); - $this->assertEquals($value, $model->compactValue([])); + $this->assertEquals([], $model->compactValue([])); } public function testCompactValueNoAction() @@ -659,8 +690,14 @@ public function testCompactValueInputField() ->willReturn($mediaDirectoryMock); $uploaderMock = $this->getMockBuilder( - \Magento\Framework\File\Uploader::class - )->disableOriginalConstructor()->getMock(); + Uploader::class + )->disableOriginalConstructor() + ->getMock(); + $uploaderMock->expects($this->once())->method('getFileExtension')->willReturn('ext1'); + $this->fileValidatorMock->expects($this->once()) + ->method('isValid') + ->with('ext1') + ->willReturn(true); $uploaderMock->expects($this->once()) ->method('setFilesDispersion') ->with(true) @@ -720,9 +757,31 @@ public function testCompactValueInputFieldWithException() $exception = new \Exception('Error'); + $uploaderMock = $this->createMock(Uploader::class); $this->uploaderFactoryMock->expects($this->once()) ->method('create') ->with(['fileId' => $value]) + ->willReturn($uploaderMock); + $uploaderMock->expects($this->once())->method('getFileExtension')->willReturn('ext1'); + $this->fileValidatorMock->expects($this->once()) + ->method('isValid') + ->with('ext1') + ->willReturn(true); + $uploaderMock->expects($this->once()) + ->method('setFilesDispersion') + ->with(true) + ->willReturnSelf(); + $uploaderMock->expects($this->once()) + ->method('setFilenamesCaseSensitivity') + ->with(false) + ->willReturnSelf(); + $uploaderMock->expects($this->once()) + ->method('setAllowRenameFiles') + ->with(true) + ->willReturnSelf(); + $uploaderMock->expects($this->once()) + ->method('save') + ->with(self::ENTITY_TYPE, $value['name']) ->willThrowException($exception); $this->loggerMock->expects($this->once()) @@ -740,4 +799,56 @@ public function testCompactValueInputFieldWithException() $this->assertEquals('', $model->compactValue($value)); } + + /** + * @return void + */ + public function testCompactValueWithProtectedExtension(): void + { + $value = [ + 'name' => 'filename.php', + 'tmp_name' => 'tmpfilename.php', + ]; + + $originValue = 'origin'; + + $mediaDirectoryMock = $this->getMockBuilder( + WriteInterface::class + )->getMockForAbstractClass(); + $mediaDirectoryMock->expects($this->once()) + ->method('delete') + ->with(self::ENTITY_TYPE . '/' . $originValue); + + $this->fileSystemMock->expects($this->once()) + ->method('getDirectoryWrite') + ->with(DirectoryList::MEDIA) + ->willReturn($mediaDirectoryMock); + + $uploaderMock = $this->createMock(Uploader::class); + $this->uploaderFactoryMock->expects($this->once()) + ->method('create') + ->with(['fileId' => $value]) + ->willReturn($uploaderMock); + $uploaderMock->expects($this->once())->method('getFileExtension')->willReturn('php'); + $this->fileValidatorMock->expects($this->once()) + ->method('isValid') + ->with('php') + ->willReturn(false); + $this->fileValidatorMock->expects($this->once()) + ->method('getMessages') + ->willReturn([ + 'php' => __('File with an extension php is protected and cannot be uploaded'), + ]); + + $model = $this->initialize([ + 'value' => $originValue, + 'isAjax' => false, + 'entityTypeCode' => self::ENTITY_TYPE, + ]); + + $this->expectException(LocalizedException::class); + $this->expectExceptionMessage('File with an extension php is protected and cannot be uploaded'); + + $this->assertEquals('', $model->compactValue($value)); + } } diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/ImageTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/ImageTest.php index 8017c367c081d..2a74bcdccd03b 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/ImageTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/ImageTest.php @@ -197,7 +197,7 @@ private function initialize(array $data): Image public function testValidateIsNotValidFile() { $value = [ - 'tmp_name' => 'tmp_file', + 'tmp_name' => 'tmp_file.txt', 'name' => 'realFileName', ]; diff --git a/app/code/Magento/Customer/Test/Unit/Model/Plugin/SaveCustomerGroupExcludedWebsiteTest.php b/app/code/Magento/Customer/Test/Unit/Model/Plugin/SaveCustomerGroupExcludedWebsiteTest.php new file mode 100644 index 0000000000000..b6c7cedbb4285 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Model/Plugin/SaveCustomerGroupExcludedWebsiteTest.php @@ -0,0 +1,290 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Model\Plugin; + +use Magento\Catalog\Model\Indexer\Product\Price\Processor; +use Magento\Customer\Api\Data\GroupExtensionInterface; +use Magento\Customer\Api\Data\GroupInterface; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Customer\Model\Data\GroupExcludedWebsite; +use Magento\Customer\Model\Data\GroupExcludedWebsiteFactory; +use Magento\Customer\Model\Plugin\SaveCustomerGroupExcludedWebsite; +use Magento\Customer\Model\ResourceModel\GroupExcludedWebsite as GroupExcludedWebsiteResourceModel; +use Magento\Framework\Indexer\IndexerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Model\System\Store; +use Magento\Store\Model\Website; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class SaveCustomerGroupExcludedWebsiteTest extends TestCase +{ + /** + * @var GroupInterface|MockObject + */ + private $groupInterface; + + /** + * @var GroupExtensionInterface|MockObject + */ + private $groupExtensionInterface; + + /** + * @var GroupRepositoryInterface|MockObject + */ + private $groupRepositoryInterface; + + /** + * @var GroupExcludedWebsiteFactory|MockObject + */ + private $groupExcludedWebsiteFactory; + + /** + * @var GroupExcludedWebsite|MockObject + */ + private $groupExcludedWebsite; + + /** + * @var GroupExcludedWebsiteRepositoryInterface|MockObject + */ + private $groupExcludedWebsiteRepository; + + /** + * @var GroupExcludedWebsiteResourceModel|MockObject + */ + private $groupExcludedWebsiteResourceModel; + + /** + * @var Store|MockObject + */ + private $store; + + /** + * @var Processor|MockObject + */ + private $priceIndexProcessor; + + /** + * @var IndexerInterface + */ + private $priceIndexer; + + /** + * @var SaveCustomerGroupExcludedWebsite + */ + private $plugin; + + protected function setUp(): void + { + $objectManagerHelper = new ObjectManager($this); + + $this->groupExcludedWebsiteFactory = $this->getMockBuilder(GroupExcludedWebsiteFactory::class) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->groupExcludedWebsiteRepository = $this->getMockForAbstractClass( + GroupExcludedWebsiteRepositoryInterface::class + ); + $this->groupExcludedWebsiteResourceModel = $this->createMock(GroupExcludedWebsiteResourceModel::class); + $this->groupExcludedWebsite = $this->getMockBuilder(GroupExcludedWebsite::class) + ->disableOriginalConstructor() + ->getMock(); + $this->groupRepositoryInterface = $this->getMockBuilder(GroupRepositoryInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->groupInterface = $this->getMockBuilder(GroupInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->groupExtensionInterface = $this->getMockBuilder(GroupExtensionInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->groupInterface->method('getExtensionAttributes') + ->willReturn($this->groupExtensionInterface); + $this->groupInterface->method('getId')->willReturn(1); + + $this->store = $this->createPartialMock( + Store::class, + ['getWebsiteCollection', 'getGroupCollection', 'getStoreCollection'] + ); + $this->priceIndexProcessor = $this->getMockBuilder(Processor::class) + ->disableOriginalConstructor() + ->getMock(); + $this->priceIndexer = $this->getMockBuilder(IndexerInterface::class) + ->getMockForAbstractClass(); + + $this->plugin = $objectManagerHelper->getObject( + SaveCustomerGroupExcludedWebsite::class, + [ + 'groupExcludedWebsiteFactory' => $this->groupExcludedWebsiteFactory, + 'groupExcludedWebsiteRepository' => $this->groupExcludedWebsiteRepository, + 'systemStore' => $this->store, + 'priceIndexProcessor' => $this->priceIndexProcessor + ] + ); + } + + public function testAfterSaveWithoutExtensionAttributes(): void + { + $this->groupExtensionInterface->method('getExcludeWebsiteIds')->willReturn(null); + $this->groupInterface->expects(self::never())->method('getId'); + + $this->plugin->afterSave($this->groupRepositoryInterface, $this->groupInterface, $this->groupInterface); + } + + /** + * @dataProvider dataProviderNoExcludedWebsitesChanged + * @param array $excludedWebsites + * @param array $websitesToExclude + * @throws \Magento\Framework\Exception\CouldNotSaveException + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function testAfterSaveWithNoExcludedWebsitesChanged(array $excludedWebsites, array $websitesToExclude): void + { + $this->getAllWebsites(); + + $this->groupExtensionInterface->method('getExcludeWebsiteIds')->willReturn($websitesToExclude); + $this->groupExcludedWebsiteRepository->method('getCustomerGroupExcludedWebsites') + ->with(1)->willReturn($excludedWebsites); + $this->groupExcludedWebsiteRepository->expects(self::never())->method('delete'); + $this->groupExcludedWebsiteFactory->expects(self::never())->method('create'); + + $this->plugin->afterSave($this->groupRepositoryInterface, $this->groupInterface, $this->groupInterface); + } + + /** + * @dataProvider dataProviderExcludedWebsitesChanged + * @param array $excludedWebsites + * @param array $websitesToExclude + * @param int $times + * @throws \Magento\Framework\Exception\CouldNotSaveException + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function testAfterSaveWithExcludedWebsitesChanged( + array $excludedWebsites, + array $websitesToExclude, + int $times + ): void { + $this->getAllWebsites(); + + $this->groupExtensionInterface->method('getExcludeWebsiteIds')->willReturn($websitesToExclude); + $this->groupExcludedWebsiteRepository->method('getCustomerGroupExcludedWebsites') + ->with(1)->willReturn($excludedWebsites); + $this->groupExcludedWebsiteRepository->expects(self::once())->method('delete'); + $this->groupExcludedWebsiteFactory->expects(self::exactly($times)) + ->method('create')->willReturn($this->groupExcludedWebsite); + $this->groupExcludedWebsite->expects(self::exactly($times)) + ->method('setGroupId') + ->with(1) + ->willReturnSelf(); + $this->groupExcludedWebsite->expects(self::exactly($times)) + ->method('setExcludedWebsiteId')->willReturnSelf(); + $this->groupExcludedWebsiteRepository->expects(self::exactly($times)) + ->method('save') + ->willReturn($this->groupExcludedWebsiteResourceModel); + + $this->priceIndexProcessor->expects(self::once())->method('getIndexer') + ->willReturn($this->priceIndexer); + $this->priceIndexer->expects(self::once())->method('invalidate') + ->willReturnSelf(); + + $this->plugin->afterSave($this->groupRepositoryInterface, $this->groupInterface, $this->groupInterface); + } + + private function getAllWebsites(): void + { + $websiteMock1 = $this->getMockBuilder(Website::class) + ->setMethods(['getWebsiteId']) + ->disableOriginalConstructor() + ->getMock(); + $websiteMock2 = $this->getMockBuilder(Website::class) + ->setMethods(['getWebsiteId']) + ->disableOriginalConstructor() + ->getMock(); + $this->store->expects(self::once())->method('getWebsiteCollection') + ->willReturn([$websiteMock1, $websiteMock2]); + $websiteMock1->method('getWebsiteId')->willReturn(1); + $websiteMock2->method('getWebsiteId')->willReturn(2); + } + + /** + * Data provider for customer groups where excluded websites has not changed. + * + * @return array[] + */ + public function dataProviderNoExcludedWebsitesChanged(): array + { + return [ + [ + [], [] + ], + [ + ['1', '2'], + [1, 2] + ], + [ + [1, 2], + [1, 2] + ], + [ + [1, 2], + ['1', '2'] + ], + [ + ['1', 2], + ['2', 1] + ], + [ + ['1', 2], + ['2', 1, 3] + ] + ]; + } + + /** + * Data provider for customer groups where excluded websites has changed. + * + * @return array[] + */ + public function dataProviderExcludedWebsitesChanged(): array + { + return [ + [ + ['2'], + [1, 2], + 2 + ], + [ + [], + [1, 2], + 2 + ], + [ + [2], + [1, 2], + 2 + ], + [ + [1, 2], + [], + 0 + ], + [ + [1, 2], + ['1'], + 1 + ], + [ + ['1', 2, 3], + ['2', 1], + 2 + ] + ]; + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/DeleteRelationTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/DeleteRelationTest.php index cce848240fe86..8730dba8c207f 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/DeleteRelationTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/DeleteRelationTest.php @@ -22,12 +22,11 @@ class DeleteRelationTest extends TestCase /** @var DeleteRelation */ protected $relation; + /** + * @inheritDoc + */ protected function setUp(): void { - $this->customerFactoryMock = $this->createPartialMock( - CustomerFactory::class, - ['create'] - ); $this->relation = (new ObjectManagerHelper($this))->getObject( DeleteRelation::class ); diff --git a/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerGroupIdTest.php b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerGroupIdTest.php new file mode 100644 index 0000000000000..05ea6cb5f2ea5 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerGroupIdTest.php @@ -0,0 +1,89 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Customer\Model\Webapi\ParamOverriderCustomerGroupId; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for Magento\Webapi\Controller\Rest\ParamOverriderCustomerGroupId class. + */ +class ParamOverriderCustomerGroupIdTest extends TestCase +{ + /** + * @var ParamOverriderCustomerGroupId + */ + private $model; + + /** + * @var UserContextInterface|MockObject + */ + private $userContextMock; + + /** + * @var CustomerRepositoryInterface|MockObject + */ + private $customerRepositoryMock; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->userContextMock = $this->createMock(UserContextInterface::class); + $this->customerRepositoryMock = $this->createMock(CustomerRepositoryInterface::class); + $this->model = (new ObjectManager($this))->getObject( + ParamOverriderCustomerGroupId::class, + [ + 'userContext' => $this->userContextMock, + 'customerRepository' => $this->customerRepositoryMock, + ] + ); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsCustomer(): void + { + $userId = 1; + $groupId = 1; + $customerMock = $this->createMock(CustomerInterface::class); + + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_CUSTOMER); + $this->userContextMock->expects($this->once()) + ->method('getUserId') + ->willReturn($userId); + $this->customerRepositoryMock->expects($this->once()) + ->method('getById') + ->with($userId) + ->willReturn($customerMock); + $customerMock->expects($this->once())->method('getGroupId')->willReturn($groupId); + + $this->assertSame($groupId, $this->model->getOverriddenValue()); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsNotCustomer(): void + { + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_ADMIN); + + $this->assertNull($this->model->getOverriddenValue()); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerStoreIdTest.php b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerStoreIdTest.php new file mode 100644 index 0000000000000..feb5701d540a6 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerStoreIdTest.php @@ -0,0 +1,89 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Customer\Model\Webapi\ParamOverriderCustomerStoreId; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for Magento\Webapi\Controller\Rest\ParamOverriderCustomerStoreId class. + */ +class ParamOverriderCustomerStoreIdTest extends TestCase +{ + /** + * @var ParamOverriderCustomerStoreId + */ + private $model; + + /** + * @var UserContextInterface|MockObject + */ + private $userContextMock; + + /** + * @var CustomerRepositoryInterface|MockObject + */ + private $customerRepositoryMock; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->userContextMock = $this->createMock(UserContextInterface::class); + $this->customerRepositoryMock = $this->createMock(CustomerRepositoryInterface::class); + $this->model = (new ObjectManager($this))->getObject( + ParamOverriderCustomerStoreId::class, + [ + 'userContext' => $this->userContextMock, + 'customerRepository' => $this->customerRepositoryMock, + ] + ); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsCustomer(): void + { + $userId = 1; + $groupId = 1; + $customerMock = $this->createMock(CustomerInterface::class); + + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_CUSTOMER); + $this->userContextMock->expects($this->once()) + ->method('getUserId') + ->willReturn($userId); + $this->customerRepositoryMock->expects($this->once()) + ->method('getById') + ->with($userId) + ->willReturn($customerMock); + $customerMock->expects($this->once())->method('getStoreId')->willReturn($groupId); + + $this->assertSame($groupId, $this->model->getOverriddenValue()); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsNotCustomer(): void + { + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_ADMIN); + + $this->assertNull($this->model->getOverriddenValue()); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerWebsiteIdTest.php b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerWebsiteIdTest.php new file mode 100644 index 0000000000000..070170a34d433 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Model/Webapi/ParamOverriderCustomerWebsiteIdTest.php @@ -0,0 +1,89 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Model\Webapi; + +use Magento\Authorization\Model\UserContextInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Customer\Model\Webapi\ParamOverriderCustomerWebsiteId; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test for Magento\Webapi\Controller\Rest\ParamOverriderCustomerWebsiteId class. + */ +class ParamOverriderCustomerWebsiteIdTest extends TestCase +{ + /** + * @var ParamOverriderCustomerWebsiteId + */ + private $model; + + /** + * @var UserContextInterface|MockObject + */ + private $userContextMock; + + /** + * @var CustomerRepositoryInterface|MockObject + */ + private $customerRepositoryMock; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->userContextMock = $this->createMock(UserContextInterface::class); + $this->customerRepositoryMock = $this->createMock(CustomerRepositoryInterface::class); + $this->model = (new ObjectManager($this))->getObject( + ParamOverriderCustomerWebsiteId::class, + [ + 'userContext' => $this->userContextMock, + 'customerRepository' => $this->customerRepositoryMock, + ] + ); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsCustomer(): void + { + $userId = 1; + $groupId = 1; + $customerMock = $this->createMock(CustomerInterface::class); + + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_CUSTOMER); + $this->userContextMock->expects($this->once()) + ->method('getUserId') + ->willReturn($userId); + $this->customerRepositoryMock->expects($this->once()) + ->method('getById') + ->with($userId) + ->willReturn($customerMock); + $customerMock->expects($this->once())->method('getWebsiteId')->willReturn($groupId); + + $this->assertSame($groupId, $this->model->getOverriddenValue()); + } + + /** + * @return void + */ + public function testGetOverriddenValueIsNotCustomer(): void + { + $this->userContextMock->expects($this->once()) + ->method('getUserType') + ->willReturn(UserContextInterface::USER_TYPE_ADMIN); + + $this->assertNull($this->model->getOverriddenValue()); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Observer/CatalogRule/AddCustomerGroupExcludedWebsiteTest.php b/app/code/Magento/Customer/Test/Unit/Observer/CatalogRule/AddCustomerGroupExcludedWebsiteTest.php new file mode 100644 index 0000000000000..2d430975d1f13 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Observer/CatalogRule/AddCustomerGroupExcludedWebsiteTest.php @@ -0,0 +1,112 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Observer\CatalogRule; + +use Magento\CatalogRule\Api\Data\RuleExtension; +use Magento\CatalogRule\Model\ResourceModel\Rule\Collection; +use Magento\CatalogRule\Model\Rule; +use Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface; +use Magento\Customer\Observer\CatalogRule\AddCustomerGroupExcludedWebsite; +use Magento\Framework\Event\Observer; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class AddCustomerGroupExcludedWebsiteTest extends TestCase +{ + /** @var GroupExcludedWebsiteRepositoryInterface|MockObject */ + private $groupExcludedWebsiteRepository; + + /** @var Collection */ + private $ruleCollection; + + /** @var Rule */ + private $rule; + + /** @var RuleExtension */ + private $ruleExtension; + + /** @var Observer */ + private $observer; + + /** @var AddCustomerGroupExcludedWebsite */ + protected $addCustomerGroupExcludedWebsiteObserver; + + protected function setUp(): void + { + $this->groupExcludedWebsiteRepository = $this->getMockBuilder(GroupExcludedWebsiteRepositoryInterface::class) + ->getMockForAbstractClass(); + $this->observer = $this->getMockBuilder(Observer::class) + ->disableOriginalConstructor() + ->getMock(); + $this->ruleCollection = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->getMock(); + $this->rule = $this->getMockBuilder(Rule::class) + ->disableOriginalConstructor() + ->getMock(); + $this->ruleExtension = $this->getMockBuilder(RuleExtension::class) + ->disableOriginalConstructor() + ->getMock(); + $this->observer->expects(self::atLeastOnce()) + ->method('getData') + ->willReturn($this->ruleCollection); + + $this->addCustomerGroupExcludedWebsiteObserver = new AddCustomerGroupExcludedWebsite( + $this->groupExcludedWebsiteRepository + ); + } + + public function testExecuteWithoutCatalogRules(): void + { + $this->ruleCollection->expects(self::once()) + ->method('getItems') + ->willReturn([]); + + $this->groupExcludedWebsiteRepository->expects(self::never()) + ->method('getAllExcludedWebsites') + ->willReturn([]); + + $this->addCustomerGroupExcludedWebsiteObserver->execute($this->observer); + } + + public function testExecuteWithCustomerGroupExcludedWebsites(): void + { + $excludedWebsites = [ + 1 => [2], + 3 => [1] + ]; + $this->ruleCollection->expects(self::once()) + ->method('getItems') + ->willReturn([$this->rule]); + + $this->groupExcludedWebsiteRepository->expects(self::once()) + ->method('getAllExcludedWebsites') + ->willReturn($excludedWebsites); + + $this->rule->expects(self::once()) + ->method('getIsActive') + ->willReturn(true); + $this->rule->expects(self::once()) + ->method('getCustomerGroupIds') + ->willReturn([1, 2, 3, 4]); + + $this->rule->expects(self::once()) + ->method('getExtensionAttributes') + ->willReturn($this->ruleExtension); + $this->ruleExtension->expects(self::once()) + ->method('setExcludeWebsiteIds') + ->with($excludedWebsites) + ->willReturnSelf(); + $this->rule->expects(self::once()) + ->method('setExtensionAttributes') + ->with($this->ruleExtension) + ->willReturnSelf(); + + $this->addCustomerGroupExcludedWebsiteObserver->execute($this->observer); + } +} diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index db3108a78e9aa..3c25bee14ebe7 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -28,7 +28,8 @@ }, "suggest": { "magento/module-cookie": "*", - "magento/module-customer-sample-data": "*" + "magento/module-customer-sample-data": "*", + "magento/module-webapi": "*" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/Customer/etc/adminhtml/di.xml b/app/code/Magento/Customer/etc/adminhtml/di.xml index 9f207ea8bebd1..8d7fc668bb61c 100644 --- a/app/code/Magento/Customer/etc/adminhtml/di.xml +++ b/app/code/Magento/Customer/etc/adminhtml/di.xml @@ -41,4 +41,8 @@ <argument name="reporting" xsi:type="object">CustomerGridCollectionReporting</argument> </arguments> </type> + <type name="Magento\Store\Model\Website"> + <plugin name="reindex_customer_grid_after_website_remove" type="Magento\Customer\Model\Plugin\CustomerGridIndexAfterWebsiteDelete" /> + <plugin name="deleteCustomerGroupExcludedWebsiteAfterWebsiteDelete" type="Magento\Customer\Model\Plugin\Website\DeleteCustomerGroupExcludedWebsite"/> + </type> </config> diff --git a/app/code/Magento/Customer/etc/db_schema.xml b/app/code/Magento/Customer/etc/db_schema.xml index 63ac8d9c1e46b..4d2b1c6454ae1 100644 --- a/app/code/Magento/Customer/etc/db_schema.xml +++ b/app/code/Magento/Customer/etc/db_schema.xml @@ -536,4 +536,19 @@ <column name="customer_id"/> </constraint> </table> + <table name="customer_group_excluded_website" resource="default" engine="innodb" + comment="Excluded Websites From Customer Group"> + <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"/> + <column xsi:type="int" name="customer_group_id" unsigned="true" nullable="false" identity="false" + comment="Customer Group ID"/> + <column xsi:type="smallint" name="website_id" unsigned="true" nullable="false" identity="false" + comment="Excluded Website ID from Customer Group"/> + <constraint xsi:type="primary" referenceId="PRIMARY"> + <column name="entity_id"/> + </constraint> + <index referenceId="CUSTOMER_GROUP_EXCLUDED_WEBSITE_CUSTOMER_GROUP_ID_WEBSITE_ID" indexType="btree"> + <column name="customer_group_id"/> + <column name="website_id"/> + </index> + </table> </schema> diff --git a/app/code/Magento/Customer/etc/db_schema_whitelist.json b/app/code/Magento/Customer/etc/db_schema_whitelist.json index 1e04a75ab300b..686afb985c31e 100644 --- a/app/code/Magento/Customer/etc/db_schema_whitelist.json +++ b/app/code/Magento/Customer/etc/db_schema_whitelist.json @@ -349,5 +349,19 @@ "PRIMARY": true, "CUSTOMER_LOG_CUSTOMER_ID": true } + }, + "customer_group_excluded_website": { + "column": { + "entity_id": true, + "customer_group_id": true, + "website_id": true + }, + "index": { + "CUSTOMER_GROUP_EXCLUDED_WEBSITE_CUSTOMER_GROUP_ID": true, + "CUSTOMER_GROUP_EXCLUDED_WEBSITE_CUSTOMER_GROUP_ID_WEBSITE_ID": true + }, + "constraint": { + "PRIMARY": true + } } } diff --git a/app/code/Magento/Customer/etc/di.xml b/app/code/Magento/Customer/etc/di.xml index 437912d29a334..06e986b8d7daa 100644 --- a/app/code/Magento/Customer/etc/di.xml +++ b/app/code/Magento/Customer/etc/di.xml @@ -22,6 +22,7 @@ <preference for="Magento\Customer\Api\Data\AttributeMetadataInterface" type="Magento\Customer\Model\Data\AttributeMetadata" /> <preference for="Magento\Customer\Api\Data\GroupInterface" type="Magento\Customer\Model\Data\Group" /> + <preference for="Magento\Customer\Api\Data\GroupExcludedWebsiteInterface" type="Magento\Customer\Model\Data\GroupExcludedWebsite" /> <preference for="Magento\Customer\Api\Data\OptionInterface" type="Magento\Customer\Model\Data\Option" /> <preference for="Magento\Customer\Api\Data\ValidationRuleInterface" type="Magento\Customer\Model\Data\ValidationRule" /> @@ -62,6 +63,8 @@ <preference for="Magento\Customer\Model\Group\RetrieverInterface" type="Magento\Customer\Model\Group\Retriever"/> <preference for="Magento\Customer\Api\SessionCleanerInterface" type="Magento\Customer\Model\Session\SessionCleaner"/> + <preference for="Magento\Customer\Api\GroupExcludedWebsiteRepositoryInterface" + type="Magento\Customer\Model\ResourceModel\GroupExcludedWebsiteRepository" /> <type name="Magento\Customer\Model\Session"> <arguments> <argument name="configShare" xsi:type="object">Magento\Customer\Model\Config\Share\Proxy</argument> @@ -457,6 +460,7 @@ <argument name="validators" xsi:type="array"> <item name="general" xsi:type="object">Magento\Customer\Model\Address\Validator\General</item> <item name="country" xsi:type="object">Magento\Customer\Model\Address\Validator\Country</item> + <item name="customer" xsi:type="object">Magento\Customer\Model\Address\Validator\Customer</item> </argument> </arguments> </type> @@ -476,6 +480,15 @@ <argument name="resourceModel" xsi:type="string">Magento\Customer\Model\ResourceModel\Address</argument> </arguments> </type> + <type name="Magento\Webapi\Controller\Rest\ParamsOverrider"> + <arguments> + <argument name="paramOverriders" xsi:type="array"> + <item name="%customer_group_id%" xsi:type="object">Magento\Customer\Model\Webapi\ParamOverriderCustomerGroupId</item> + <item name="%customer_website_id%" xsi:type="object">Magento\Customer\Model\Webapi\ParamOverriderCustomerWebsiteId</item> + <item name="%customer_store_id%" xsi:type="object">Magento\Customer\Model\Webapi\ParamOverriderCustomerStoreId</item> + </argument> + </arguments> + </type> <preference for="Magento\Customer\Api\AccountDelegationInterface" type="Magento\Customer\Model\Delegation\AccountDelegation" /> @@ -533,4 +546,10 @@ </argument> </arguments> </type> + <type name="Magento\Customer\Api\GroupRepositoryInterface"> + <plugin name="saveCustomerGroupExcludedWebsite" type="Magento\Customer\Model\Plugin\SaveCustomerGroupExcludedWebsite"/> + <plugin name="deleteCustomerGroupExcludedWebsite" type="Magento\Customer\Model\Plugin\DeleteCustomerGroupExcludedWebsite"/> + <plugin name="getByIdCustomerGroupExcludedWebsite" type="Magento\Customer\Model\Plugin\GetByIdCustomerGroupExcludedWebsite"/> + <plugin name="getListCustomerGroupExcludedWebsite" type="Magento\Customer\Model\Plugin\GetListCustomerGroupExcludedWebsite"/> + </type> </config> diff --git a/app/code/Magento/Customer/etc/events.xml b/app/code/Magento/Customer/etc/events.xml index 0194f91c591f5..e37983e122133 100644 --- a/app/code/Magento/Customer/etc/events.xml +++ b/app/code/Magento/Customer/etc/events.xml @@ -19,4 +19,10 @@ <observer name="upgrade_order_customer_email" instance="Magento\Customer\Observer\UpgradeOrderCustomerEmailObserver"/> <observer name="upgrade_quote_customer_email" instance="Magento\Customer\Observer\UpgradeQuoteCustomerEmailObserver"/> </event> + <event name="customer_customer_authenticated"> + <observer name="customerGroupAuthenticate" instance="Magento\Customer\Observer\CustomerGroupAuthenticate" /> + </event> + <event name="catalog_rule_collection_load_after"> + <observer name="catalogRuleCustomerGroupExcludedWebsite" instance="Magento\Customer\Observer\CatalogRule\AddCustomerGroupExcludedWebsite" /> + </event> </config> diff --git a/app/code/Magento/Customer/etc/extension_attributes.xml b/app/code/Magento/Customer/etc/extension_attributes.xml new file mode 100644 index 0000000000000..9e27de9d30f32 --- /dev/null +++ b/app/code/Magento/Customer/etc/extension_attributes.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> + <extension_attributes for="Magento\Customer\Api\Data\GroupInterface"> + <attribute code="exclude_website_ids" type="int[]" /> + </extension_attributes> +</config> diff --git a/app/code/Magento/Customer/etc/webapi.xml b/app/code/Magento/Customer/etc/webapi.xml index 68c8da8744a05..be025947cd752 100644 --- a/app/code/Magento/Customer/etc/webapi.xml +++ b/app/code/Magento/Customer/etc/webapi.xml @@ -141,6 +141,9 @@ </resources> <data> <parameter name="customer.id" force="true">%customer_id%</parameter> + <parameter name="customer.group_id" force="true">%customer_group_id%</parameter> + <parameter name="customer.website_id" force="true">%customer_website_id%</parameter> + <parameter name="customer.store_id" force="true">%customer_store_id%</parameter> </data> </route> <route url="/V1/customers/me" method="GET" soapOperation="getSelf"> diff --git a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml index 97ae9a9953eb6..a9f01d1cf9620 100644 --- a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml +++ b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml @@ -189,6 +189,7 @@ </column> <column name="website_id" class="Magento\Customer\Ui\Component\Listing\Column\Websites" component="Magento_Ui/js/grid/columns/select" sortOrder="110"> <settings> + <options class="Magento\Store\Model\ResourceModel\Website\Collection"/> <filter>select</filter> <editor> <editorType>select</editorType> diff --git a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml index 065d87792665f..8898ce1ee3575 100644 --- a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml +++ b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml @@ -129,7 +129,7 @@ </validation> <dataType>number</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link> + <link>https://docs.magento.com/user-guide/configuration/scope.html</link> <description translate="true">If your Magento installation has multiple websites, you can edit the scope to associate the customer with a specific site.</description> </tooltip> <imports> diff --git a/app/code/Magento/Customer/view/frontend/requirejs-config.js b/app/code/Magento/Customer/view/frontend/requirejs-config.js index f1bf5c1d1b67f..d09c61e880f97 100644 --- a/app/code/Magento/Customer/view/frontend/requirejs-config.js +++ b/app/code/Magento/Customer/view/frontend/requirejs-config.js @@ -12,6 +12,7 @@ var config = { passwordStrengthIndicator: 'Magento_Customer/js/password-strength-indicator', zxcvbn: 'Magento_Customer/js/zxcvbn', addressValidation: 'Magento_Customer/js/addressValidation', + showPassword: 'Magento_Customer/js/show-password', 'Magento_Customer/address': 'Magento_Customer/js/address', 'Magento_Customer/change-email-password': 'Magento_Customer/js/change-email-password' } diff --git a/app/code/Magento/Customer/view/frontend/templates/address/edit.phtml b/app/code/Magento/Customer/view/frontend/templates/address/edit.phtml index a4a500b7d1b37..71ac56475ae84 100644 --- a/app/code/Magento/Customer/view/frontend/templates/address/edit.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/address/edit.phtml @@ -202,6 +202,7 @@ $viewModel = $block->getViewModel(); <button type="submit" class="action save primary" data-action="save-address" + disabled="disabled" title="<?= $escaper->escapeHtmlAttr(__('Save Address')) ?>"> <span><?= $escaper->escapeHtml(__('Save Address')) ?></span> </button> diff --git a/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml b/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml index b64ad58c17afc..6734e9ad30a47 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml @@ -104,6 +104,9 @@ use Magento\Customer\Block\Widget\Name; autocomplete="off" /> </div> </div> + <div class="field choice" data-bind="scope: 'showPassword'"> + <!-- ko template: getTemplate() --><!-- /ko --> + </div> </fieldset> <fieldset class="fieldset additional_info"> @@ -176,6 +179,16 @@ script; "passwordStrengthIndicator": { "formSelector": "form.form-edit-account" } + }, + "*": { + "Magento_Ui/js/core/app": { + "components": { + "showPassword": { + "component": "Magento_Customer/js/show-password", + "passwordSelector": "#current-password,#password,#password-confirmation" + } + } + } } } </script> diff --git a/app/code/Magento/Customer/view/frontend/templates/form/login.phtml b/app/code/Magento/Customer/view/frontend/templates/form/login.phtml index 73e9ec35d51c8..119bb72083a4e 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/login.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/login.phtml @@ -42,6 +42,9 @@ data-validate="{required:true}"> </div> </div> + <div class="field choice" data-bind="scope: 'showPassword'"> + <!-- ko template: getTemplate() --><!-- /ko --> + </div> <?= $block->getChildHtml('form_additional_info') ?> <div class="actions-toolbar"> <div class="primary"><button type="submit" class="action login primary" name="send" id="send2"><span><?= $block->escapeHtml(__('Sign In')) ?></span></button></div> @@ -55,6 +58,14 @@ "*": { "Magento_Customer/js/block-submit-on-send": { "formId": "login-form" + }, + "Magento_Ui/js/core/app": { + "components": { + "showPassword": { + "component": "Magento_Customer/js/show-password", + "passwordSelector": "#pass" + } + } } } } diff --git a/app/code/Magento/Customer/view/frontend/templates/form/register.phtml b/app/code/Magento/Customer/view/frontend/templates/form/register.phtml index 1d25a601c5523..0394f112b1424 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/register.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/register.phtml @@ -276,6 +276,9 @@ $formData = $block->getFormData(); autocomplete="off"> </div> </div> + <div class="field choice" data-bind="scope: 'showPassword'"> + <!-- ko template: getTemplate() --><!-- /ko --> + </div> </fieldset> <fieldset class="fieldset additional_info"> @@ -352,9 +355,9 @@ script; "regionInputId": "#region", "postcodeId": "#zip", "form": "#form-validate", - "regionJson": {$regionJson}, - "defaultRegion": "{$regionId}", - "countriesWithOptionalZip": {$countriesWithOptionalZip} + "regionJson": <?= $regionJson ?>, + "defaultRegion": <?= $regionId ?>, + "countriesWithOptionalZip": <?= $countriesWithOptionalZip ?> } } } @@ -371,6 +374,14 @@ script; "*": { "Magento_Customer/js/block-submit-on-send": { "formId": "form-validate" + }, + "Magento_Ui/js/core/app": { + "components": { + "showPassword": { + "component": "Magento_Customer/js/show-password", + "passwordSelector": "#password,#password-confirmation" + } + } } } } diff --git a/app/code/Magento/Customer/view/frontend/templates/form/resetforgottenpassword.phtml b/app/code/Magento/Customer/view/frontend/templates/form/resetforgottenpassword.phtml index 76a755bab6e4d..7df33fea1accc 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/resetforgottenpassword.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/resetforgottenpassword.phtml @@ -37,6 +37,9 @@ <input type="password" class="input-text" name="password_confirmation" id="password-confirmation" data-validate="{required:true,equalTo:'#password'}" autocomplete="off"> </div> </div> + <div class="field choice" data-bind="scope: 'showPassword'"> + <!-- ko template: getTemplate() --><!-- /ko --> + </div> </fieldset> <div class="actions-toolbar"> <div class="primary"> @@ -44,3 +47,17 @@ </div> </div> </form> +<script type="text/x-magento-init"> + { + "*": { + "Magento_Ui/js/core/app": { + "components": { + "showPassword": { + "component": "Magento_Customer/js/show-password", + "passwordSelector": "#password,#password-confirmation" + } + } + } + } + } +</script> diff --git a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js index 2d7e26ecef768..c4c011c69a41a 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js +++ b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js @@ -219,7 +219,8 @@ define([ initStorage: function () { $.cookieStorage.setConf({ path: '/', - expires: new Date(Date.now() + parseInt(options.cookieLifeTime, 10) * 1000) + expires: new Date(Date.now() + parseInt(options.cookieLifeTime, 10) * 1000), + samesite: 'lax' }); storage = $.initNamespaceStorage('mage-cache-storage').localStorage; storageInvalidation = $.initNamespaceStorage('mage-cache-storage-section-invalidation').localStorage; @@ -357,6 +358,31 @@ define([ return deferred.promise(); }, + /** + * Reload sections on ajax complete + * + * @param {Object} jsonResponse + * @param {Object} settings + */ + onAjaxComplete: function (jsonResponse, settings) { + var sections, + redirects; + + if (settings.type.match(/post|put|delete/i)) { + sections = sectionConfig.getAffectedSections(settings.url); + + if (sections && sections.length) { + this.invalidate(sections); + redirects = ['redirect', 'backUrl']; + + if (_.isObject(jsonResponse) && !_.isEmpty(_.pick(jsonResponse, redirects))) { //eslint-disable-line + return; + } + this.reload(sections, true); + } + } + }, + /** * @param {Object} settings * @constructor @@ -375,22 +401,7 @@ define([ * Events listener */ $(document).on('ajaxComplete', function (event, xhr, settings) { - var sections, - redirects; - - if (settings.type.match(/post|put|delete/i)) { - sections = sectionConfig.getAffectedSections(settings.url); - - if (sections) { - customerData.invalidate(sections); - redirects = ['redirect', 'backUrl']; - - if (_.isObject(xhr.responseJSON) && !_.isEmpty(_.pick(xhr.responseJSON, redirects))) { //eslint-disable-line - return; - } - customerData.reload(sections, true); - } - } + customerData.onAjaxComplete(xhr.responseJSON, settings); }); /** diff --git a/app/code/Magento/Customer/view/frontend/web/js/show-password.js b/app/code/Magento/Customer/view/frontend/web/js/show-password.js new file mode 100644 index 0000000000000..f96ae0dee8617 --- /dev/null +++ b/app/code/Magento/Customer/view/frontend/web/js/show-password.js @@ -0,0 +1,46 @@ +/** +* Copyright © Magento, Inc. All rights reserved. +* See COPYING.txt for license details. +*/ + +define([ + 'jquery', + 'uiComponent' +], function ($, Component) { + 'use strict'; + + return Component.extend({ + passwordSelector: '', + passwordInputType: 'password', + textInputType: 'text', + + defaults: { + template: 'Magento_Customer/show-password', + isPasswordVisible: false + }, + + /** + * @return {Object} + */ + initObservable: function () { + this._super() + .observe(['isPasswordVisible']); + + this.isPasswordVisible.subscribe(function (isChecked) { + this._showPassword(isChecked); + }.bind(this)); + + return this; + }, + + /** + * Show/Hide password + * @private + */ + _showPassword: function (isChecked) { + $(this.passwordSelector).attr('type', + isChecked ? this.textInputType : this.passwordInputType + ); + } + }); +}); diff --git a/app/code/Magento/Customer/view/frontend/web/template/show-password.html b/app/code/Magento/Customer/view/frontend/web/template/show-password.html new file mode 100644 index 0000000000000..83027d56ecda3 --- /dev/null +++ b/app/code/Magento/Customer/view/frontend/web/template/show-password.html @@ -0,0 +1,9 @@ +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + --> + +<input type="checkbox" name="show-password" title="Show Password" id="show-password" class="checkbox" data-role="show-password" ko-checked="isPasswordVisible"> +<label for="show-password" class="label"><span translate="'Show Password'"></span></label> diff --git a/app/code/Magento/CustomerAnalytics/README.md b/app/code/Magento/CustomerAnalytics/README.md index 301025569f03d..5afc63015225d 100644 --- a/app/code/Magento/CustomerAnalytics/README.md +++ b/app/code/Magento/CustomerAnalytics/README.md @@ -1,3 +1,3 @@ # Magento_CustomerAnalytics module -The Magento_CustomerAnalytics module configures data definitions for a data collection related to the Customer module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). +The Magento_CustomerAnalytics module configures data definitions for a data collection related to the Customer module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). diff --git a/app/code/Magento/CustomerGraphQl/Model/Context/AddUserInfoToContext.php b/app/code/Magento/CustomerGraphQl/Model/Context/AddUserInfoToContext.php index 0f0b91967e473..595394a1a8d51 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Context/AddUserInfoToContext.php +++ b/app/code/Magento/CustomerGraphQl/Model/Context/AddUserInfoToContext.php @@ -60,6 +60,8 @@ public function execute(ContextParametersInterface $contextParameters): ContextP */ private function isCustomer(?int $customerId, ?int $customerType): bool { - return !empty($customerId) && !empty($customerType) && $customerType !== UserContextInterface::USER_TYPE_GUEST; + return !empty($customerId) + && !empty($customerType) + && $customerType === UserContextInterface::USER_TYPE_CUSTOMER; } } diff --git a/app/code/Magento/CustomerImportExport/Model/Import/Address.php b/app/code/Magento/CustomerImportExport/Model/Import/Address.php index 0c3be73ec5047..7e2e32f0e8957 100644 --- a/app/code/Magento/CustomerImportExport/Model/Import/Address.php +++ b/app/code/Magento/CustomerImportExport/Model/Import/Address.php @@ -645,7 +645,7 @@ protected function _prepareDataForUpdate(array $rowData): array $value = $rowData[$attributeAlias]; if (!strlen($rowData[$attributeAlias])) { - if (!$newAddress) { + if ($attributeParams['is_required']) { continue; } diff --git a/app/code/Magento/Deploy/Model/Filesystem.php b/app/code/Magento/Deploy/Model/Filesystem.php index 67632d0516214..59a2f0f7cfe9d 100644 --- a/app/code/Magento/Deploy/Model/Filesystem.php +++ b/app/code/Magento/Deploy/Model/Filesystem.php @@ -29,8 +29,8 @@ class Filesystem * Access permissions to the files are set during deploy Magento 2, directly after * uploading code of Magento. Also it is possible to specify the value * of inverse mask for setting access permissions to files generated by Magento. - * @link https://devdocs.magento.com/guides/v2.3/install-gde/install/post-install-umask.html - * @link https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/install/post-install-umask.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/prereq/file-system-perms.html */ const PERMISSIONS_FILE = 0640; @@ -41,8 +41,8 @@ class Filesystem * Access permissions to the directories are set during deploy Magento 2, directly after * uploading code of Magento. Also it is possible to specify the value * of inverse mask for setting access permissions to directories generated by Magento. - * @link https://devdocs.magento.com/guides/v2.3/install-gde/install/post-install-umask.html - * @link https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/install/post-install-umask.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/prereq/file-system-perms.html */ const PERMISSIONS_DIR = 0750; @@ -305,8 +305,8 @@ public function cleanupFilesystem($directoryCodeList) * Access permissions to the files and directories are set during deploy Magento 2, directly after * uploading code of Magento. Also it is possible to specify the value * of inverse mask for setting access permissions to files and directories generated by Magento. - * @link https://devdocs.magento.com/guides/v2.3/install-gde/install/post-install-umask.html - * @link https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/install/post-install-umask.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/prereq/file-system-perms.html * @throws \Magento\Framework\Exception\FileSystemException */ protected function changePermissions($directoryCodeList, $dirPermissions, $filePermissions) @@ -331,8 +331,8 @@ protected function changePermissions($directoryCodeList, $dirPermissions, $fileP * Access permissions to the files and directories are set during deploy Magento 2, directly after * uploading code of Magento. Also it is possible to specify the value * of inverse mask for setting access permissions to files and directories generated by Magento. - * @link https://devdocs.magento.com/guides/v2.3/install-gde/install/post-install-umask.html - * @link https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/install/post-install-umask.html + * @link https://devdocs.magento.com/guides/v2.4/install-gde/prereq/file-system-perms.html * @throws \Magento\Framework\Exception\FileSystemException */ public function lockStaticResources() diff --git a/app/code/Magento/Deploy/Package/Bundle/RequireJs.php b/app/code/Magento/Deploy/Package/Bundle/RequireJs.php index c7c9e5315c7ab..c5fa1c819ec11 100644 --- a/app/code/Magento/Deploy/Package/Bundle/RequireJs.php +++ b/app/code/Magento/Deploy/Package/Bundle/RequireJs.php @@ -104,6 +104,11 @@ class RequireJs implements BundleInterface */ private $pathToBundleDir; + /** + * @var Filesystem + */ + private $filesystem; + /** * Bundle constructor * @@ -185,6 +190,8 @@ public function flush() } $this->files = []; + + return true; } /** @@ -193,6 +200,8 @@ public function flush() public function clear() { $this->staticDir->delete($this->pathToBundleDir); + + return true; } /** diff --git a/app/code/Magento/Deploy/Package/BundleInterfaceFactory.php b/app/code/Magento/Deploy/Package/BundleInterfaceFactory.php index da691e7e25590..4cab52e1e00eb 100644 --- a/app/code/Magento/Deploy/Package/BundleInterfaceFactory.php +++ b/app/code/Magento/Deploy/Package/BundleInterfaceFactory.php @@ -23,6 +23,11 @@ class BundleInterfaceFactory */ private $objectManager; + /** + * @var string + */ + private $type; + /** * BundleFactory constructor * diff --git a/app/code/Magento/Deploy/Package/PackageFactory.php b/app/code/Magento/Deploy/Package/PackageFactory.php index 2d251a0a3eff4..686d854f79163 100644 --- a/app/code/Magento/Deploy/Package/PackageFactory.php +++ b/app/code/Magento/Deploy/Package/PackageFactory.php @@ -23,6 +23,11 @@ class PackageFactory */ private $objectManager; + /** + * @var string + */ + private $type; + /** * PackageFactory constructor * diff --git a/app/code/Magento/Deploy/Service/Bundle.php b/app/code/Magento/Deploy/Service/Bundle.php index 26e61624c219e..ee43ba5496f27 100644 --- a/app/code/Magento/Deploy/Service/Bundle.php +++ b/app/code/Magento/Deploy/Service/Bundle.php @@ -84,13 +84,15 @@ class Bundle private $file; /** - * Bundle constructor - * + * @var BundleConfig + */ + private $bundleConfig; + + /** * @param Filesystem $filesystem * @param BundleInterfaceFactory $bundleFactory * @param BundleConfig $bundleConfig * @param Files $files - * * @param File|null $file * * @throws \Magento\Framework\Exception\FileSystemException diff --git a/app/code/Magento/Deploy/Service/DeployStaticFile.php b/app/code/Magento/Deploy/Service/DeployStaticFile.php index 40986087c405e..a0cd91bfe684f 100644 --- a/app/code/Magento/Deploy/Service/DeployStaticFile.php +++ b/app/code/Magento/Deploy/Service/DeployStaticFile.php @@ -52,8 +52,11 @@ class DeployStaticFile private $tmpDir; /** - * DeployStaticFile constructor - * + * @var Filesystem\Directory\WriteInterface + */ + private $pubStaticDir; + + /** * @param Filesystem $filesystem * @param Repository $assetRepo * @param Publisher $assetPublisher diff --git a/app/code/Magento/Developer/Console/Command/DevTestsRunCommand.php b/app/code/Magento/Developer/Console/Command/DevTestsRunCommand.php index 5b8b79ef41392..69410b666f875 100644 --- a/app/code/Magento/Developer/Console/Command/DevTestsRunCommand.php +++ b/app/code/Magento/Developer/Console/Command/DevTestsRunCommand.php @@ -105,6 +105,8 @@ protected function execute(InputInterface $input, OutputInterface $output) } $message = $dirName . '> ' . $command; $output->writeln(['', str_pad("---- {$message} ", 70, '-'), '']); + // passthru() call have to be here. + // phpcs:ignore Magento2.Security.InsecureFunction passthru($command, $returnVal); if ($returnVal) { $failures[] = $message; diff --git a/app/code/Magento/Directory/Helper/Data.php b/app/code/Magento/Directory/Helper/Data.php index 3133e3d4c1957..b359989fe981b 100644 --- a/app/code/Magento/Directory/Helper/Data.php +++ b/app/code/Magento/Directory/Helper/Data.php @@ -13,6 +13,7 @@ use Magento\Directory\Model\ResourceModel\Region\CollectionFactory; use Magento\Framework\App\Cache\Type\Config; use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Helper\AbstractHelper; use Magento\Framework\App\Helper\Context; use Magento\Framework\Json\Helper\Data as JsonData; use Magento\Store\Model\ScopeInterface; @@ -25,8 +26,10 @@ * @since 100.0.2 * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Data extends \Magento\Framework\App\Helper\AbstractHelper +class Data extends AbstractHelper { + private const STORE_ID = 'store_id'; + /** * Config value that lists ISO2 country codes which have optional Zip/Postal pre-configured */ @@ -424,6 +427,11 @@ private function getCurrentScope(): array 'type' => ScopeInterface::SCOPE_STORE, 'value' => $request->getParam(ScopeInterface::SCOPE_STORE), ]; + } elseif ($request->getParam(self::STORE_ID)) { + $scope = [ + 'type' => ScopeInterface::SCOPE_STORE, + 'value' => $request->getParam(self::STORE_ID), + ]; } return $scope; diff --git a/app/code/Magento/Directory/Model/Currency.php b/app/code/Magento/Directory/Model/Currency.php index 6a2ebb4531502..65b47d7535cb2 100644 --- a/app/code/Magento/Directory/Model/Currency.php +++ b/app/code/Magento/Directory/Model/Currency.php @@ -9,6 +9,10 @@ use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\InputException; use Magento\Directory\Model\Currency\Filter; +use Magento\Framework\Locale\Currency as LocaleCurrency; +use Magento\Framework\Locale\ResolverInterface as LocalResolverInterface; +use Magento\Framework\NumberFormatterFactory; +use Magento\Framework\Serialize\Serializer\Json; /** * Currency model @@ -71,6 +75,31 @@ class Currency extends \Magento\Framework\Model\AbstractModel */ private $currencyConfig; + /** + * @var LocalResolverInterface + */ + private $localeResolver; + + /** + * @var NumberFormatterFactory + */ + private $numberFormatterFactory; + + /** + * @var \Magento\Framework\NumberFormatter + */ + private $numberFormatter; + + /** + * @var array + */ + private $numberFormatterCache; + + /** + * @var Json + */ + private $serializer; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -79,10 +108,13 @@ class Currency extends \Magento\Framework\Model\AbstractModel * @param \Magento\Directory\Helper\Data $directoryHelper * @param Currency\FilterFactory $currencyFilterFactory * @param \Magento\Framework\Locale\CurrencyInterface $localeCurrency - * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource - * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection + * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource + * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection * @param array $data - * @param CurrencyConfig $currencyConfig + * @param CurrencyConfig|null $currencyConfig + * @param LocalResolverInterface|null $localeResolver + * @param NumberFormatterFactory|null $numberFormatterFactory + * @param Json|null $serializer * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -96,7 +128,10 @@ public function __construct( \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [], - CurrencyConfig $currencyConfig = null + CurrencyConfig $currencyConfig = null, + LocalResolverInterface $localeResolver = null, + \Magento\Framework\NumberFormatterFactory $numberFormatterFactory = null, + Json $serializer = null ) { parent::__construct( $context, @@ -111,6 +146,9 @@ public function __construct( $this->_currencyFilterFactory = $currencyFilterFactory; $this->_localeCurrency = $localeCurrency; $this->currencyConfig = $currencyConfig ?: ObjectManager::getInstance()->get(CurrencyConfig::class); + $this->localeResolver = $localeResolver ?: ObjectManager::getInstance()->get(LocalResolverInterface::class); + $this->numberFormatterFactory = $numberFormatterFactory ?: ObjectManager::getInstance()->get(NumberFormatterFactory::class); + $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class); } /** @@ -326,9 +364,121 @@ public function formatTxt($price, $options = []) * %F - the argument is treated as a float, and presented as a floating-point number (non-locale aware). */ $price = sprintf("%F", $price); + + if ($this->canUseNumberFormatter($options)) { + return $this->formatCurrency($price, $options); + } + return $this->_localeCurrency->getCurrency($this->getCode())->toCurrency($price, $options); } + /** + * Check if to use Intl.NumberFormatter to format currency. + * + * @param array $options + * @return bool + */ + private function canUseNumberFormatter(array $options): bool + { + $allowedOptions = [ + 'precision', + LocaleCurrency::CURRENCY_OPTION_DISPLAY, + LocaleCurrency::CURRENCY_OPTION_SYMBOL + ]; + + if (!empty(array_diff(array_keys($options), $allowedOptions))) { + return false; + } + + if (array_key_exists('display', $options) + && $options['display'] !== \Magento\Framework\Currency::NO_SYMBOL + && $options['display'] !== \Magento\Framework\Currency::USE_SYMBOL + ) { + return false; + } + + return true; + } + + /** + * Format currency. + * + * @param string $price + * @param array $options + * @return string + */ + private function formatCurrency(string $price, array $options): string + { + $customerOptions = new \Magento\Framework\DataObject([]); + + $this->_eventManager->dispatch( + 'currency_display_options_forming', + ['currency_options' => $customerOptions, 'base_code' => $this->getCode()] + ); + $options += $customerOptions->toArray(); + + $this->numberFormatter = $this->getNumberFormatter($options); + + $formattedCurrency = $this->numberFormatter->formatCurrency( + $price, $this->getCode() ?? $this->numberFormatter->getTextAttribute(\NumberFormatter::CURRENCY_CODE) + ); + + if (array_key_exists(LocaleCurrency::CURRENCY_OPTION_SYMBOL, $options)) { + // remove only one non-breaking space from custom currency symbol to allow custom NBSP in currency symbol + $formattedCurrency = preg_replace('/ /u', '', $formattedCurrency, 1); + } + + if ((array_key_exists(LocaleCurrency::CURRENCY_OPTION_DISPLAY, $options) + && $options[LocaleCurrency::CURRENCY_OPTION_DISPLAY] === \Magento\Framework\Currency::NO_SYMBOL)) { + $formattedCurrency = str_replace(' ', '', $formattedCurrency); + } + + return preg_replace('/^\s+|\s+$/u', '', $formattedCurrency); + } + + /** + * Get NumberFormatter object from cache. + * + * @param array $options + * @return \Magento\Framework\NumberFormatter + */ + private function getNumberFormatter(array $options): \Magento\Framework\NumberFormatter + { + $key = 'currency_' . md5($this->localeResolver->getLocale() . $this->serializer->serialize($options)); + if (!isset($this->numberFormatterCache[$key])) { + $this->numberFormatter = $this->numberFormatterFactory->create( + ['locale' => $this->localeResolver->getLocale(), 'style' => \NumberFormatter::CURRENCY] + ); + + $this->setOptions($options); + $this->numberFormatterCache[$key] = $this->numberFormatter; + } + + return $this->numberFormatterCache[$key]; + } + + /** + * Set number formatter custom options. + * + * @param array $options + * @return void + */ + private function setOptions(array $options): void + { + if (array_key_exists(LocaleCurrency::CURRENCY_OPTION_SYMBOL, $options)) { + $this->numberFormatter->setSymbol( + \NumberFormatter::CURRENCY_SYMBOL, $options[LocaleCurrency::CURRENCY_OPTION_SYMBOL] + ); + } + if (array_key_exists(LocaleCurrency::CURRENCY_OPTION_DISPLAY, $options) + && $options[LocaleCurrency::CURRENCY_OPTION_DISPLAY] === \Magento\Framework\Currency::NO_SYMBOL) { + $this->numberFormatter->setSymbol(\NumberFormatter::CURRENCY_SYMBOL, ''); + } + if (array_key_exists('precision', $options)) { + $this->numberFormatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $options['precision']); + } + } + /** * Return currency symbol for current locale and currency code * diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForArgentina.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForArgentina.php new file mode 100644 index 0000000000000..98175b23e82ae --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForArgentina.php @@ -0,0 +1,111 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Argentina States + */ +class AddDataForArgentina implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForArgentina constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForArgentina() + ); + + return $this; + } + + /** + * Argentina states data. + * + * @return array + */ + private function getDataForArgentina() + { + return [ + ['AR', 'AR-C', 'Ciudad Autónoma de Buenos Aires'], + ['AR', 'AR-B', 'Buenos Aires'], + ['AR', 'AR-K', 'Catamarca'], + ['AR', 'AR-H', 'Chaco'], + ['AR', 'AR-U', 'Chubut'], + ['AR', 'AR-X', 'Córdoba'], + ['AR', 'AR-W', 'Corrientes'], + ['AR', 'AR-E', 'Entre Ríos'], + ['AR', 'AR-P', 'Formosa'], + ['AR', 'AR-Y', 'Jujuy'], + ['AR', 'AR-L', 'La Pampa'], + ['AR', 'AR-F', 'La Rioja'], + ['AR', 'AR-M', 'Mendoza'], + ['AR', 'AR-N', 'Misiones'], + ['AR', 'AR-Q', 'Neuquén'], + ['AR', 'AR-R', 'Río Negro'], + ['AR', 'AR-A', 'Salta'], + ['AR', 'AR-J', 'San Juan'], + ['AR', 'AR-D', 'San Luis'], + ['AR', 'AR-Z', 'Santa Cruz'], + ['AR', 'AR-S', 'Santa Fe'], + ['AR', 'AR-G', 'Santiago del Estero'], + ['AR', 'AR-V', 'Tierra del Fuego'], + ['AR', 'AR-T', 'Tucumán'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForBolivia.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForBolivia.php new file mode 100644 index 0000000000000..caa7856797a70 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForBolivia.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Bolivia States + */ +class AddDataForBolivia implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForBolivia constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForBolivia() + ); + + return $this; + } + + /** + * Bolivia states data. + * + * @return array + */ + private function getDataForBolivia() + { + return [ + ['BO', 'BO-C', 'Cochabamba'], + ['BO', 'BO-H', 'Chuquisaca'], + ['BO', 'BO-B', 'El Beni'], + ['BO', 'BO-L', 'La Paz'], + ['BO', 'BO-O', 'Oruro'], + ['BO', 'BO-N', 'Pando'], + ['BO', 'BO-P', 'Potosí'], + ['BO', 'BO-S', 'Santa Cruz'], + ['BO', 'BO-T', 'Tarija'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForChile.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForChile.php new file mode 100644 index 0000000000000..a92982db89e07 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForChile.php @@ -0,0 +1,103 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Chile States + */ +class AddDataForChile implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForChile constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForChile() + ); + + return $this; + } + + /** + * Chile states data. + * + * @return array + */ + private function getDataForChile() + { + return [ + ['CL', 'CL-AI', 'Aisén del General Carlos Ibañez del Campo'], + ['CL', 'CL-AN', 'Antofagasta'], + ['CL', 'CL-AP', 'Arica y Parinacota'], + ['CL', 'CL-AR', 'La Araucanía'], + ['CL', 'CL-AT', 'Atacama'], + ['CL', 'CL-BI', 'Biobío'], + ['CL', 'CL-CO', 'Coquimbo'], + ['CL', 'CL-LI', 'Libertador General Bernardo O\'Higgins'], + ['CL', 'CL-LL', 'Los Lagos'], + ['CL', 'CL-LR', 'Los Ríos'], + ['CL', 'CL-MA', 'Magallanes'], + ['CL', 'CL-ML', 'Maule'], + ['CL', 'CL-NB', 'Ñuble'], + ['CL', 'CL-RM', 'Región Metropolitana de Santiago'], + ['CL', 'CL-TA', 'Tarapacá'], + ['CL', 'CL-VS', 'Valparaíso'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForEcuador.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForEcuador.php new file mode 100644 index 0000000000000..5079b8c6f633a --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForEcuador.php @@ -0,0 +1,112 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Ecuador States + */ +class AddDataForEcuador implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForEcuador constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForEcuador() + ); + + return $this; + } + + /** + * Ecuador states data. + * + * @return array + */ + private function getDataForEcuador() + { + return [ + ['EC', 'EC-A', 'Azuay'], + ['EC', 'EC-B', 'Bolívar'], + ['EC', 'EC-F', 'Cañar'], + ['EC', 'EC-C', 'Carchi'], + ['EC', 'EC-H', 'Chimborazo'], + ['EC', 'EC-X', 'Cotopaxi'], + ['EC', 'EC-O', 'El Oro'], + ['EC', 'EC-E', 'Esmeraldas'], + ['EC', 'EC-W', 'Galápagos'], + ['EC', 'EC-G', 'Guayas'], + ['EC', 'EC-I', 'Imbabura'], + ['EC', 'EC-L', 'Loja'], + ['EC', 'EC-R', 'Los Ríos'], + ['EC', 'EC-M', 'Manabí'], + ['EC', 'EC-S', 'Morona Santiago'], + ['EC', 'EC-N', 'Napo'], + ['EC', 'EC-D', 'Orellana'], + ['EC', 'EC-Y', 'Pastaza'], + ['EC', 'EC-P', 'Pichincha'], + ['EC', 'EC-SE', 'Santa Elena'], + ['EC', 'EC-SD', 'Santo Domingo de los Tsáchilas'], + ['EC', 'EC-U', 'Sucumbíos'], + ['EC', 'EC-T', 'Tungurahua'], + ['EC', 'EC-Z', 'Zamora Chinchipe'], + + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForGuyana.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForGuyana.php new file mode 100644 index 0000000000000..35c40d026bfb7 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForGuyana.php @@ -0,0 +1,97 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Guyana States + */ +class AddDataForGuyana implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForGuyana constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForGuyana() + ); + + return $this; + } + + /** + * Guyana states data. + * + * @return array + */ + private function getDataForGuyana() + { + return [ + ['GY', 'GY-BA', 'Barima-Waini'], + ['GY', 'GY-CU', 'Cuyuni-Mazaruni'], + ['GY', 'GY-DE', 'Demerara-Mahaica'], + ['GY', 'GY-EB', 'East Berbice-Corentyne'], + ['GY', 'GY-ES', 'Essequibo Islands-West Demerara'], + ['GY', 'GY-MA', 'Mahaica-Berbice'], + ['GY', 'GY-PM', 'Pomeroon-Supenaam'], + ['GY', 'GY-PT', 'Potaro-Siparuni'], + ['GY', 'GY-UD', 'Upper Demerara-Berbice'], + ['GY', 'GY-UT', 'Upper Takutu-Upper Essequibo'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForParaguay.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForParaguay.php new file mode 100644 index 0000000000000..5c7724641aa93 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForParaguay.php @@ -0,0 +1,105 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Paraguay States + */ +class AddDataForParaguay implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForParaguay constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForParaguay() + ); + + return $this; + } + + /** + * Paraguay states data. + * + * @return array + */ + private function getDataForParaguay() + { + return [ + ['PY', 'PY-ASU', 'Asunción'], + ['PY', 'PY-16', 'Alto Paraguay'], + ['PY', 'PY-10', 'Alto Paraná'], + ['PY', 'PY-13', 'Amambay'], + ['PY', 'PY-19', 'Boquerón'], + ['PY', 'PY-5', 'Caaguazú'], + ['PY', 'PY-6', 'Caazapá'], + ['PY', 'PY-14', 'Canindeyú'], + ['PY', 'PY-11', 'Central'], + ['PY', 'PY-1', 'Concepción'], + ['PY', 'PY-3', 'Cordillera'], + ['PY', 'PY-4', 'Guairá'], + ['PY', 'PY-7', 'Itapúa'], + ['PY', 'PY-8', 'Misiones'], + ['PY', 'PY-12', 'Ñeembucú'], + ['PY', 'PY-9', 'Paraguarí'], + ['PY', 'PY-15', 'Presidente Hayes'], + ['PY', 'PY-2', 'San Pedro'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForPeru.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForPeru.php new file mode 100644 index 0000000000000..128fd5df6255a --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForPeru.php @@ -0,0 +1,113 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Peru States + */ +class AddDataForPeru implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForPeru constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForPeru() + ); + + return $this; + } + + /** + * Peru states data. + * + * @return array + */ + private function getDataForPeru() + { + return [ + ['PE', 'PE-LMA', 'Municipalidad Metropolitana de Lima'], + ['PE', 'PE-AMA', 'Amazonas'], + ['PE', 'PE-ANC', 'Ancash'], + ['PE', 'PE-APU', 'Apurímac'], + ['PE', 'PE-ARE', 'Arequipa'], + ['PE', 'PE-AYA', 'Ayacucho'], + ['PE', 'PE-CAJ', 'Cajamarca'], + ['PE', 'PE-CUS', 'Cusco'], + ['PE', 'PE-CAL', 'El Callao'], + ['PE', 'PE-HUV', 'Huancavelica'], + ['PE', 'PE-HUC', 'Huánuco'], + ['PE', 'PE-ICA', 'Ica'], + ['PE', 'PE-JUN', 'Junín'], + ['PE', 'PE-LAL', 'La Libertad'], + ['PE', 'PE-LAM', 'Lambayeque'], + ['PE', 'PE-LIM', 'Lima'], + ['PE', 'PE-LOR', 'Loreto'], + ['PE', 'PE-MDD', 'Madre de Dios'], + ['PE', 'PE-MOQ', 'Moquegua'], + ['PE', 'PE-PAS', 'Pasco'], + ['PE', 'PE-PIU', 'Piura'], + ['PE', 'PE-PUN', 'Puno'], + ['PE', 'PE-SAM', 'San Martín'], + ['PE', 'PE-TAC', 'Tacna'], + ['PE', 'PE-TUM', 'Tumbes'], + ['PE', 'PE-UCA', 'Ucayali'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForSuriname.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForSuriname.php new file mode 100644 index 0000000000000..f267d8d0168f4 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForSuriname.php @@ -0,0 +1,97 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Suriname States + */ +class AddDataForSuriname implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForSuriname constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForSuriname() + ); + + return $this; + } + + /** + * Suriname states data. + * + * @return array + */ + private function getDataForSuriname() + { + return [ + ['SR', 'SR-BR', 'Brokopondo'], + ['SR', 'SR-CM', 'Commewijne'], + ['SR', 'SR-CR', 'Coronie'], + ['SR', 'SR-MA', 'Marowijne'], + ['SR', 'SR-NI', 'Nickerie'], + ['SR', 'SR-PR', 'Para'], + ['SR', 'SR-PM', 'Paramaribo'], + ['SR', 'SR-SA', 'Saramacca'], + ['SR', 'SR-SI', 'Sipaliwini'], + ['SR', 'SR-WA', 'Wanica'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForVenezuela.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForVenezuela.php new file mode 100644 index 0000000000000..4fa9e1375deb9 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForVenezuela.php @@ -0,0 +1,112 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Directory\Setup\DataInstallerFactory; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Add Venezuela States + */ +class AddDataForVenezuela implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * AddDataForVenezuela constructor. + * + * @param ModuleDataSetupInterface $moduleDataSetup + * @param DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForVenezuela() + ); + + return $this; + } + + /** + * Venezuela states data. + * + * @return array + */ + private function getDataForVenezuela() + { + return [ + ['VE', 'VE-W', 'Dependencias Federales'], + ['VE', 'VE-A', 'Distrito Capital'], + ['VE', 'VE-Z', 'Amazonas'], + ['VE', 'VE-B', 'Anzoátegui'], + ['VE', 'VE-C', 'Apure'], + ['VE', 'VE-D', 'Aragua'], + ['VE', 'VE-E', 'Barinas'], + ['VE', 'VE-F', 'Bolívar'], + ['VE', 'VE-G', 'Carabobo'], + ['VE', 'VE-H', 'Cojedes'], + ['VE', 'VE-Y', 'Delta Amacuro'], + ['VE', 'VE-I', 'Falcón'], + ['VE', 'VE-J', 'Guárico'], + ['VE', 'VE-K', 'Lara'], + ['VE', 'VE-L', 'Mérida'], + ['VE', 'VE-M', 'Miranda'], + ['VE', 'VE-N', 'Monagas'], + ['VE', 'VE-O', 'Nueva Esparta'], + ['VE', 'VE-P', 'Portuguesa'], + ['VE', 'VE-R', 'Sucre'], + ['VE', 'VE-S', 'Táchira'], + ['VE', 'VE-T', 'Trujillo'], + ['VE', 'VE-X', 'Vargas'], + ['VE', 'VE-U', 'Yaracuy'], + ['VE', 'VE-V', 'Zulia'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Directory/Test/Mftf/Data/CurrencyConfigData.xml b/app/code/Magento/Directory/Test/Mftf/Data/CurrencyConfigData.xml index fb21ee42fe2fc..3424e727ab905 100644 --- a/app/code/Magento/Directory/Test/Mftf/Data/CurrencyConfigData.xml +++ b/app/code/Magento/Directory/Test/Mftf/Data/CurrencyConfigData.xml @@ -13,4 +13,12 @@ <data key="label">Russian Ruble</data> <data key="value">RUB</data> </entity> + <entity name="CurrencyConverterApiKeyConfigData"> + <data key="path">currency/currencyconverterapi/api_key</data> + <data key="value">{{_CREDS.magento/currency_currencyconverterapi_api_key}}</data> + </entity> + <entity name="DefaultCurrencyConverterApiKeyConfigData"> + <data key="path">currency/currencyconverterapi/api_key</data> + <data key="value">''</data> + </entity> </entities> diff --git a/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php b/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php index 80a19617ea31e..b67ebda692de3 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php @@ -9,6 +9,9 @@ use Magento\Directory\Model\Currency; use Magento\Framework\Locale\CurrencyInterface; +use Magento\Framework\Locale\ResolverInterface as LocalResolverInterface; +use Magento\Framework\NumberFormatterFactory; +use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -27,15 +30,46 @@ class CurrencyTest extends TestCase */ protected $localeCurrencyMock; + /** + * @var LocalResolverInterface + */ + private $localeResolver; + + /** + * @var NumberFormatterFactory + */ + private $numberFormatterFactory; + + /** + * @var Json + */ + private $serializer; + protected function setUp(): void { $this->localeCurrencyMock = $this->getMockForAbstractClass(CurrencyInterface::class); + $currencyFilterFactory = $this->getMockBuilder(\Magento\Directory\Model\Currency\FilterFactory::class) + ->disableOriginalConstructor() + ->getMock(); + $this->localeResolver = $this->getMockBuilder(LocalResolverInterface::class) + ->getMockForAbstractClass(); + $this->numberFormatterFactory = $this->getMockBuilder(NumberFormatterFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->serializer = $this->getMockBuilder(Json::class) + ->disableOriginalConstructor() + ->getMock(); $objectManager = new ObjectManager($this); $this->currency = $objectManager->getObject( Currency::class, [ 'localeCurrency' => $this->localeCurrencyMock, + 'currencyFilterFactory' => $currencyFilterFactory, + 'localeResolver' => $this->localeResolver, + 'numberFormatterFactory' => $this->numberFormatterFactory, + 'serializer' => $this->serializer, 'data' => [ 'currency_code' => $this->currencyCode, ] @@ -43,66 +77,151 @@ protected function setUp(): void ); } - public function testGetCurrencySymbol() + public function testGetCurrencySymbol(): void { $currencySymbol = '$'; $currencyMock = $this->getMockBuilder(\Magento\Framework\Currency::class) ->disableOriginalConstructor() ->getMock(); - $currencyMock->expects($this->once()) + $currencyMock->expects(self::once()) ->method('getSymbol') ->willReturn($currencySymbol); - $this->localeCurrencyMock->expects($this->once()) + $this->localeCurrencyMock->expects(self::once()) ->method('getCurrency') ->with($this->currencyCode) ->willReturn($currencyMock); - $this->assertEquals($currencySymbol, $this->currency->getCurrencySymbol()); + self::assertEquals($currencySymbol, $this->currency->getCurrencySymbol()); } /** * @dataProvider getOutputFormatDataProvider - * @param $withCurrency - * @param $noCurrency * @param $expected + * @param $locale */ - public function testGetOutputFormat($withCurrency, $noCurrency, $expected) + public function testGetOutputFormat($expected, $locale): void { - $currencyMock = $this->getMockBuilder(\Magento\Framework\Currency::class) - ->disableOriginalConstructor() - ->getMock(); - $currencyMock->expects($this->at(0)) - ->method('toCurrency') - ->willReturn($withCurrency); - $currencyMock->expects($this->at(1)) - ->method('toCurrency') - ->willReturn($noCurrency); - $this->localeCurrencyMock->expects($this->atLeastOnce()) - ->method('getCurrency') - ->with($this->currencyCode) - ->willReturn($currencyMock); - $this->assertEquals($expected, $this->currency->getOutputFormat()); + $this->localeResolver->method('getLocale')->willReturn($locale); + $this->numberFormatterFactory + ->method('create') + ->with(['locale' => $locale, 'style' => 2]) + ->willReturn(new \Magento\Framework\NumberFormatter($locale, 2)); + $this->serializer->method('serialize')->willReturnMap( + [ + [[], '[]'], + [['display' => 1], '{"display":1}'] + ] + ); + self::assertEquals($expected, $this->currency->getOutputFormat()); } /** - * Return data sets for testGetCurrencySymbol() + * Return data sets for testGetOutputFormat() * * @return array */ - public function getOutputFormatDataProvider() + public function getOutputFormatDataProvider(): array { return [ 'no_unicode' => [ - 'withCurrency' => '$0.00', - 'noCurrency' => '0.00', 'expected' => '$%s', + 'locale' => 'en_US' ], 'arabic_unicode' => [ - 'withCurrency' => json_decode('"\u200E"') . '$0.00', - 'noCurrency' => json_decode('"\u200E"') . '0.00', 'expected' => json_decode('"\u200E"') . '$%s', + 'locale' => 'fa_IR' ] ]; } + + /** + * @dataProvider getFormatTxtNumberFormatterDataProvider + * @param string $price + * @param array $options + * @param string $locale + * @param string $expected + */ + public function testFormatTxtWithNumberFormatter( + string $price, + array $options, + string $locale, + string $expected + ): void { + $this->localeResolver->expects(self::exactly(2))->method('getLocale')->willReturn($locale); + $this->numberFormatterFactory + ->expects(self::once()) + ->method('create') + ->with(['locale' => $locale, 'style' => 2]) + ->willReturn(new \Magento\Framework\NumberFormatter($locale, 2)); + $this->serializer->method('serialize')->willReturnMap( + [ + [[], '[]'] + ] + ); + + self::assertEquals($expected, $this->currency->formatTxt($price, $options)); + } + + /** + * Return data sets for testFormatTxtWithNumberFormatter() + * + * @return array + */ + public function getFormatTxtNumberFormatterDataProvider(): array + { + return [ + ['9999', [], 'en_US', '$9,999.00'], + ['9999', ['display' => \Magento\Framework\Currency::NO_SYMBOL, 'precision' => 2], 'en_US', '9,999.00'], + ['9999', ['display' => \Magento\Framework\Currency::NO_SYMBOL], 'en_US', '9,999.00'], + [' 9999', ['display' => \Magento\Framework\Currency::NO_SYMBOL], 'en_US', '9,999.00'], + ['9999', ['precision' => 1], 'en_US', '$9,999.0'], + ['9999', ['precision' => 2, 'symbol' => '#'], 'en_US', '#9,999.00'], + [ + '9999.99', + ['precision' => 2, 'symbol' => '#', 'display' => \Magento\Framework\Currency::NO_SYMBOL], + 'en_US', + '9,999.99' + ], + ]; + } + + /** + * @dataProvider getFormatTxtZendCurrencyDataProvider + * @param string $price + * @param array $options + * @param string $expected + * @throws \Zend_Currency_Exception + */ + public function testFormatTxtWithZendCurrency(string $price, array $options, string $expected): void + { + $this->localeCurrencyMock + ->expects(self::once()) + ->method('getCurrency') + ->with($this->currencyCode) + ->willReturn(new \Zend_Currency($options, 'en_US')); + $this->serializer->method('serialize')->willReturnMap( + [ + [[], '[]'] + ] + ); + + self::assertEquals($expected, $this->currency->formatTxt($price, $options)); + } + + /** + * Return data sets for testFormatTxtWithZendCurrency() + * + * @return array + */ + public function getFormatTxtZendCurrencyDataProvider(): array + { + return [ + ['9999', ['display' => \Magento\Framework\Currency::USE_SYMBOL, 'foo' => 'bar'], '$9,999.00'], + ['9999', ['display' => \Magento\Framework\Currency::USE_SHORTNAME, 'foo' => 'bar'], 'USD9,999.00'], + ['9999', ['currency' => 'USD'], '$9,999.00'], + ['9999', ['currency' => 'CNY'], 'CN¥9,999.00'], + ['9999', ['locale' => 'fr_FR'], '9 999,00 $'] + ]; + } } diff --git a/app/code/Magento/Directory/etc/zip_codes.xml b/app/code/Magento/Directory/etc/zip_codes.xml index 634d4abe06763..f186102911a6a 100644 --- a/app/code/Magento/Directory/etc/zip_codes.xml +++ b/app/code/Magento/Directory/etc/zip_codes.xml @@ -6,14 +6,14 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Directory:etc/zip_codes.xsd"> - <zip countryCode="DZ"> + <zip countryCode="AD"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="AD100">^AD\d{3}$</code> </codes> </zip> - <zip countryCode="AS"> + <zip countryCode="AM"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> <zip countryCode="AR"> @@ -22,51 +22,65 @@ <code id="pattern_2" active="true" example="A1234BCD">^[a-zA-z]{1}[0-9]{4}[a-zA-z]{3}$</code> </codes> </zip> - <zip countryCode="AM"> + <zip countryCode="AS"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="AU"> + <zip countryCode="AT"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="AT"> + <zip countryCode="AU"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="AX"> + <codes> + <code id="pattern_1" active="true" example="22123">^22\d{3}$</code> + </codes> + </zip> <zip countryCode="AZ"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> <code id="pattern_2" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> + <zip countryCode="BA"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="BB"> + <codes> + <code id="pattern_1" active="true" example="BB12345">^(BB\d{5})?$</code> + </codes> + </zip> <zip countryCode="BD"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="BY"> + <zip countryCode="BE"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="BE"> + <zip countryCode="BG"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="BA"> + <zip countryCode="BH"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="323">^((1[0-2]|[1-9])\d{2})?$</code> </codes> </zip> - <zip countryCode="BR"> + <zip countryCode="BM"> <codes> - <code id="pattern_1" active="true" example="12345678">^[0-9]{8}$</code> - <code id="pattern_2" active="true" example="12345-678">^[0-9]{5}\-[0-9]{3}$</code> + <code id="pattern_1" active="true" example="MA 02">^[A-Z]{2}[ ]?[A-Z0-9]{2}$</code> </codes> </zip> <zip countryCode="BN"> @@ -74,20 +88,42 @@ <code id="pattern_1" active="true" example="AB1234">^[a-zA-z]{2}[0-9]{4}$</code> </codes> </zip> - <zip countryCode="BG"> + <zip countryCode="BR"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="12345678">^[0-9]{8}$</code> + <code id="pattern_2" active="true" example="12345-678">^[0-9]{5}\-[0-9]{3}$</code> + </codes> + </zip> + <zip countryCode="BY"> + <codes> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> <zip countryCode="CA"> <codes> <code id="pattern_1" active="true" example="A1B 2C3">^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}\s[0-9]{1}[a-zA-z]{1}[0-9]{1}$</code> <code id="pattern_2" active="true" example="A1B2C3">^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}[0-9]{1}$</code> + <code id="pattern_3" active="true" example="A1B">^[a-zA-z]{1}[0-9]{1}[a-zA-z]{1}$</code> </codes> </zip> - <zip countryCode="IC"> + <zip countryCode="CC"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="6799">^6799$</code> + </codes> + </zip> + <zip countryCode="CH"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> + <zip countryCode="CK"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> + <zip countryCode="CL"> + <codes> + <code id="pattern_1" active="true" example="1234567">^\d{7}$</code> </codes> </zip> <zip countryCode="CN"> @@ -95,7 +131,12 @@ <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> - <zip countryCode="HR"> + <zip countryCode="CR"> + <codes> + <code id="pattern_1" active="true" example="12345 or 123-1234">^\d{4,5}|\d{3}-\d{4}$</code> + </codes> + </zip> + <zip countryCode="CS"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> @@ -105,6 +146,16 @@ <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="CV"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> + <zip countryCode="CX"> + <codes> + <code id="pattern_1" active="true" example="6798">^6798$</code> + </codes> + </zip> <zip countryCode="CY"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> @@ -115,29 +166,84 @@ <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> </codes> </zip> + <zip countryCode="DE"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> <zip countryCode="DK"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="DO"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="DZ"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="EC"> + <codes> + <code id="pattern_1" active="true" example="A1234B or AB123456 or 123456">^([A-Z]\d{4}[A-Z]|(?:[A-Z]{2})?\d{6})?$</code> + </codes> + </zip> <zip countryCode="EE"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="EG"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="ES"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="ET"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> <zip countryCode="FI"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="FK"> + <codes> + <code id="pattern_1" active="true" example="FIQQ 1ZZ">^FIQQ 1ZZ$</code> + </codes> + </zip> + <zip countryCode="FM"> + <codes> + <code id="pattern_1" active="true" example="96941">^(9694[1-4])([ \-]\d{4})?$</code> + </codes> + </zip> + <zip countryCode="FO"> + <codes> + <code id="pattern_1" active="true" example="123">^\d{3}$</code> + </codes> + </zip> <zip countryCode="FR"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="GF"> + <zip countryCode="GB"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="AB12 3CD">^[a-zA-Z]{2}[0-9]{2}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_2" active="true" example="A1B 2CD">^[a-zA-Z]{1}[0-9]{1}[a-zA-Z]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_3" active="true" example="AB1 2CD">^[a-zA-Z]{2}[0-9]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_4" active="true" example="AB1C 2DF">^[a-zA-Z]{2}[0-9]{1}[a-zA-Z]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_5" active="true" example="A12 3BC">^[a-zA-Z]{1}[0-9]{2}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_6" active="true" example="A1 2BC">^[a-zA-Z]{1}[0-9]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> </codes> </zip> <zip countryCode="GE"> @@ -145,14 +251,19 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="DE"> + <zip countryCode="GF"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="GR"> + <zip countryCode="GG"> <codes> - <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> + <code id="pattern_1" active="true" example="AB1 2CD">^[a-zA-Z]{2}[0-9]{1}\s[0-9]{1}[a-zA-Z]{2}$</code> + </codes> + </zip> + <zip countryCode="GH"> + <codes> + <code id="pattern_1" active="true" example="GA18400">^[A-Z][A-Z0-9]\d{3,5}$</code> </codes> </zip> <zip countryCode="GL"> @@ -160,34 +271,69 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="GN"> + <codes> + <code id="pattern_1" active="true" example="123">^\d{3}$</code> + </codes> + </zip> <zip countryCode="GP"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="GR"> + <codes> + <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> + </codes> + </zip> + <zip countryCode="GS"> + <codes> + <code id="pattern_1" active="true" example="SIQQ 1ZZ">^SIQQ 1ZZ$</code> + </codes> + </zip> + <zip countryCode="GT"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> <zip countryCode="GU"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="GG"> + <zip countryCode="GW"> <codes> - <code id="pattern_1" active="true" example="AB1 2CD">^[a-zA-Z]{2}[0-9]{1}\s[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> - <zip countryCode="HU"> + <zip countryCode="HM"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> - <zip countryCode="IS"> + <zip countryCode="HN"> <codes> - <code id="pattern_1" active="true" example="123">^[0-9]{3}$</code> + <code id="pattern_1" active="true" example="12345">^(?:\d{5})?$</code> </codes> </zip> - <zip countryCode="IN"> + <zip countryCode="HR"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="HT"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> + <zip countryCode="HU"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> + <zip countryCode="IC"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> <zip countryCode="ID"> @@ -200,15 +346,34 @@ <code id="pattern_1" active="true" example="6687865">^[0-9]{7}$</code> </codes> </zip> - <zip countryCode="IT"> + <zip countryCode="IM"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="IM1 1AD">^IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$</code> </codes> </zip> - <zip countryCode="JP"> + <zip countryCode="IN"> <codes> - <code id="pattern_1" active="true" example="123-4567">^[0-9]{3}-[0-9]{4}$</code> - <code id="pattern_2" active="true" example="1234567">^[0-9]{7}$</code> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + </codes> + </zip> + <zip countryCode="IO"> + <codes> + <code id="pattern_1" active="true" example="BBND 1ZZ">^BBND 1ZZ$</code> + </codes> + </zip> + <zip countryCode="IS"> + <codes> + <code id="pattern_1" active="true" example="123">^[0-9]{3}$</code> + </codes> + </zip> + <zip countryCode="IQ"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="IT"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> <zip countryCode="JE"> @@ -216,9 +381,15 @@ <code id="pattern_1" active="true" example="AB1 2CD">^[a-zA-Z]{2}[0-9]{1}\s[0-9]{1}[a-zA-Z]{2}$</code> </codes> </zip> - <zip countryCode="KZ"> + <zip countryCode="JO"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="JP"> + <codes> + <code id="pattern_1" active="true" example="123-4567">^[0-9]{3}-[0-9]{4}$</code> + <code id="pattern_2" active="true" example="1234567">^[0-9]{7}$</code> </codes> </zip> <zip countryCode="KE"> @@ -226,20 +397,40 @@ <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="KG"> + <codes> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + </codes> + </zip> <zip countryCode="KR"> <codes> <code id="pattern_1" active="true" example="123-456">^[0-9]{3}-[0-9]{3}$</code> <code id="pattern_2" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="KG"> + <zip countryCode="KH"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="KW"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="KZ"> <codes> <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> - <zip countryCode="LV"> + <zip countryCode="LA"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="LB"> + <codes> + <code id="pattern_1" active="true" example="1234 5678">^(\d{4}([ ]?\d{4})?)?$</code> </codes> </zip> <zip countryCode="LI"> @@ -247,6 +438,11 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="LK"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> <zip countryCode="LT"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> @@ -257,25 +453,64 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="MK"> + <zip countryCode="LV"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> + <zip countryCode="MA"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="MC"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="MD"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="ME"> + <codes> + <code id="pattern_1" active="true" example="81101">^8\d{4}$</code> + </codes> + </zip> <zip countryCode="MG"> <codes> <code id="pattern_1" active="true" example="123">^[0-9]{3}$</code> </codes> </zip> - <zip countryCode="MY"> + <zip countryCode="MH"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="MV"> + <zip countryCode="MK"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> + <zip countryCode="MN"> + <codes> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + </codes> + </zip> + <zip countryCode="MP"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="MS"> + <codes> + <code id="pattern_1" active="true" example="MSR1250">^MSR\s?\d{4}$</code> + </codes> + </zip> + <zip countryCode="MQ"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> - <code id="pattern_2" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> <zip countryCode="MT"> @@ -285,14 +520,15 @@ <code id="pattern_3" active="true" example="ABC 12">^[a-zA-Z]{3}\s[0-9]{2}$</code> </codes> </zip> - <zip countryCode="MH"> + <zip countryCode="MU"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="A1201 or 80110">^([AR]|[0-9])\d{4,5}$</code> </codes> </zip> - <zip countryCode="MQ"> + <zip countryCode="MV"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_2" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> <zip countryCode="MX"> @@ -300,24 +536,34 @@ <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="MD"> + <zip countryCode="MY"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="MC"> + <zip countryCode="NC"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="98800">^988\d{2}$</code> </codes> </zip> - <zip countryCode="MN"> + <zip countryCode="NE"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> - <zip countryCode="MA"> + <zip countryCode="NF"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="2899">^2899$</code> + </codes> + </zip> + <zip countryCode="NG"> + <codes> + <code id="pattern_1" active="true" example="123456">^(\d{6})?$</code> + </codes> + </zip> + <zip countryCode="NI"> + <codes> + <code id="pattern_1" active="true" example="22500">^\d{5}$</code> </codes> </zip> <zip countryCode="NL"> @@ -330,9 +576,34 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> - <zip countryCode="PK"> + <zip countryCode="NP"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="NZ"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> + <zip countryCode="OM"> + <codes> + <code id="pattern_1" active="true" example="PC 123 or 123">^(PC )?\d{3}$</code> + </codes> + </zip> + <zip countryCode="PA"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> + <zip countryCode="PF"> + <codes> + <code id="pattern_1" active="true" example="98701">^987\d{2}$</code> + </codes> + </zip> + <zip countryCode="PG"> + <codes> + <code id="pattern_1" active="true" example="123">^\d{3}$</code> </codes> </zip> <zip countryCode="PH"> @@ -340,20 +611,45 @@ <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> </codes> </zip> + <zip countryCode="PK"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> <zip countryCode="PL"> <codes> <code id="pattern_1" active="true" example="12-345">^[0-9]{2}-[0-9]{3}$</code> </codes> </zip> + <zip countryCode="PM"> + <codes> + <code id="pattern_1" active="true" example="97500">^9[78]5\d{2}$</code> + </codes> + </zip> + <zip countryCode="PN"> + <codes> + <code id="pattern_1" active="true" example="PCRN 1ZZ">^PCRN 1ZZ$</code> + </codes> + </zip> + <zip countryCode="PR"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> <zip countryCode="PT"> <codes> <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> <code id="pattern_2" active="true" example="1234-567">^[0-9]{4}-[0-9]{3}$</code> </codes> </zip> - <zip countryCode="PR"> + <zip countryCode="PW"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="96939 or 96940">^(?:96939|96940)$</code> + </codes> + </zip> + <zip countryCode="PY"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> <zip countryCode="RE"> @@ -366,19 +662,24 @@ <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> + <zip countryCode="RS"> + <codes> + <code id="pattern_1" active="true" example="123456">^\d{6}$</code> + </codes> + </zip> <zip countryCode="RU"> <codes> <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> - <zip countryCode="MP"> + <zip countryCode="SA"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> </codes> </zip> - <zip countryCode="CS"> + <zip countryCode="SE"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> </codes> </zip> <zip countryCode="SG"> @@ -386,50 +687,54 @@ <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> + <zip countryCode="SI"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> <zip countryCode="SK"> <codes> <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> </codes> </zip> - <zip countryCode="SI"> + <zip countryCode="SH"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="ASCN 1ZZ">^(ASCN|STHL) 1ZZ$</code> </codes> </zip> - <zip countryCode="ZA"> + <zip countryCode="SJ"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> - <zip countryCode="ES"> + <zip countryCode="SM"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="47890">^4789\d$</code> </codes> </zip> - <zip countryCode="XY"> + <zip countryCode="SN"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> </codes> </zip> - <zip countryCode="SZ"> + <zip countryCode="SO"> <codes> - <code id="pattern_1" active="true" example="A123">^[a-zA-Z]{1}[0-9]{3}$</code> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> </codes> </zip> - <zip countryCode="SE"> + <zip countryCode="SZ"> <codes> - <code id="pattern_1" active="true" example="123 45">^[0-9]{3}\s[0-9]{2}$</code> + <code id="pattern_1" active="true" example="A123">^[a-zA-Z]{1}[0-9]{3}$</code> </codes> </zip> - <zip countryCode="CH"> + <zip countryCode="TC"> <codes> - <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + <code id="pattern_1" active="true" example="TKCA 1ZZ">^TKCA 1ZZ$</code> </codes> </zip> - <zip countryCode="TW"> + <zip countryCode="TH"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> - <code id="pattern_2" active="true" example="123">^[0-9]{3}$</code> </codes> </zip> <zip countryCode="TJ"> @@ -437,9 +742,14 @@ <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> - <zip countryCode="TH"> + <zip countryCode="TM"> <codes> - <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + </codes> + </zip> + <zip countryCode="TN"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> </codes> </zip> <zip countryCode="TR"> @@ -447,24 +757,20 @@ <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> - <zip countryCode="TM"> + <zip countryCode="TT"> <codes> - <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> + <code id="pattern_1" active="true" example="120110">^\d{6}$</code> </codes> </zip> - <zip countryCode="UA"> + <zip countryCode="TW"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + <code id="pattern_2" active="true" example="123">^[0-9]{3}$</code> </codes> </zip> - <zip countryCode="GB"> + <zip countryCode="UA"> <codes> - <code id="pattern_1" active="true" example="AB12 3CD">^[a-zA-Z]{2}[0-9]{2}\s?[0-9]{1}[a-zA-Z]{2}$</code> - <code id="pattern_2" active="true" example="A1B 2CD">^[a-zA-Z]{1}[0-9]{1}[a-zA-Z]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> - <code id="pattern_3" active="true" example="AB1 2CD">^[a-zA-Z]{2}[0-9]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> - <code id="pattern_4" active="true" example="AB1C 2DF">^[a-zA-Z]{2}[0-9]{1}[a-zA-Z]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> - <code id="pattern_5" active="true" example="A12 3BC">^[a-zA-Z]{1}[0-9]{2}\s?[0-9]{1}[a-zA-Z]{2}$</code> - <code id="pattern_6" active="true" example="A1 2BC">^[a-zA-Z]{1}[0-9]{1}\s?[0-9]{1}[a-zA-Z]{2}$</code> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> <zip countryCode="US"> @@ -483,9 +789,49 @@ <code id="pattern_1" active="true" example="123456">^[0-9]{6}$</code> </codes> </zip> + <zip countryCode="VA"> + <codes> + <code id="pattern_1" active="true" example="00120">^00120$</code> + </codes> + </zip> + <zip countryCode="VE"> + <codes> + <code id="pattern_1" active="true" example="1234">^\d{4}$</code> + </codes> + </zip> <zip countryCode="VI"> <codes> <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> </codes> </zip> + <zip countryCode="WF"> + <codes> + <code id="pattern_1" active="true" example="98601">^986\d{2}$</code> + </codes> + </zip> + <zip countryCode="XK"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> + <zip countryCode="XY"> + <codes> + <code id="pattern_1" active="true" example="12345">^[0-9]{5}$</code> + </codes> + </zip> + <zip countryCode="YT"> + <codes> + <code id="pattern_1" active="true" example="97601">^976\d{2}$</code> + </codes> + </zip> + <zip countryCode="ZA"> + <codes> + <code id="pattern_1" active="true" example="1234">^[0-9]{4}$</code> + </codes> + </zip> + <zip countryCode="ZM"> + <codes> + <code id="pattern_1" active="true" example="12345">^\d{5}$</code> + </codes> + </zip> </config> diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php index 5895f3a92c54c..6b13e92553e89 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php @@ -180,7 +180,7 @@ public function getAddButtonHtml() \Magento\Backend\Block\Widget\Button::class )->setData( [ - 'label' => __('Add New Link'), + 'label' => $this->escapeHtmlAttr(__('Add New Link')), 'id' => 'add_link_item', 'class' => 'action-add', 'data_attribute' => ['action' => 'add-link'], diff --git a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php index 5a54a274485fe..54ae6dd953726 100644 --- a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php @@ -9,6 +9,7 @@ use Magento\Downloadable\Model\Link; use Magento\Downloadable\Model\Link\Purchased; use Magento\Downloadable\Model\Link\Purchased\Item; +use Magento\Framework\App\ObjectManager; use Magento\Store\Model\ScopeInterface; /** @@ -39,6 +40,10 @@ class Downloadable extends \Magento\Sales\Block\Order\Email\Items\DefaultItems * @since 100.1.0 */ protected $frontendUrlBuilder; + /** + * @var \Magento\Downloadable\Model\Sales\Order\Link\Purchased + */ + private $purchasedLink; /** * @param \Magento\Framework\View\Element\Template\Context $context @@ -46,18 +51,22 @@ class Downloadable extends \Magento\Sales\Block\Order\Email\Items\DefaultItems * @param \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory * @param \Magento\Framework\Url $frontendUrlBuilder * @param array $data + * @param \Magento\Downloadable\Model\Sales\Order\Link\Purchased|null $purchasedLink */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory, \Magento\Framework\Url $frontendUrlBuilder, - array $data = [] + array $data = [], + ?\Magento\Downloadable\Model\Sales\Order\Link\Purchased $purchasedLink = null ) { $this->_purchasedFactory = $purchasedFactory; $this->_itemsFactory = $itemsFactory; $this->frontendUrlBuilder = $frontendUrlBuilder; parent::__construct($context, $data); + $this->purchasedLink = $purchasedLink + ?? ObjectManager::getInstance()->get(\Magento\Downloadable\Model\Sales\Order\Link\Purchased::class); } /** @@ -67,15 +76,7 @@ public function __construct( */ public function getLinks() { - $this->_purchased = $this->_purchasedFactory->create()->load( - $this->getItem()->getOrderItemId(), - 'order_item_id' - ); - $purchasedLinks = $this->_itemsFactory->create()->addFieldToFilter( - 'order_item_id', - $this->getItem()->getOrderItemId() - ); - $this->_purchased->setPurchasedItems($purchasedLinks); + $this->_purchased = $this->purchasedLink->getLink($this->getItem()); return $this->_purchased; } diff --git a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php index c714a10d37f05..d0385900b09ac 100644 --- a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php @@ -38,42 +38,47 @@ class Downloadable extends \Magento\Sales\Block\Order\Email\Items\Order\DefaultO * @var \Magento\Framework\UrlInterface */ private $frontendUrlBuilder; + /** + * @var \Magento\Downloadable\Model\Sales\Order\Link\Purchased + */ + private $purchasedLink; /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory * @param array $data + * @param \Magento\Downloadable\Model\Sales\Order\Link\Purchased|null $purchasedLink */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory, - array $data = [] + array $data = [], + ?\Magento\Downloadable\Model\Sales\Order\Link\Purchased $purchasedLink = null ) { $this->_purchasedFactory = $purchasedFactory; $this->_itemsFactory = $itemsFactory; parent::__construct($context, $data); + $this->purchasedLink = $purchasedLink + ?? ObjectManager::getInstance()->get(\Magento\Downloadable\Model\Sales\Order\Link\Purchased::class); } /** - * Enter description here... + * Get purchased link * * @return \Magento\Downloadable\Model\Link\Purchased */ public function getLinks() { - $this->_purchased = $this->_purchasedFactory->create()->load( - $this->getItem()->getId(), - 'order_item_id' - ); - $purchasedLinks = $this->_itemsFactory->create()->addFieldToFilter('order_item_id', $this->getItem()->getId()); - $this->_purchased->setPurchasedItems($purchasedLinks); + $this->_purchased = $this->purchasedLink->getLink($this->getItem()); return $this->_purchased; } /** + * Get purchased link title + * * @return null|string */ public function getLinksTitle() @@ -85,6 +90,8 @@ public function getLinksTitle() } /** + * Get download link for given link + * * @param Item $item * @return string */ diff --git a/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php b/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php index e7b95ec0136f1..a16e3b6e2a719 100644 --- a/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php @@ -8,6 +8,7 @@ use Magento\Downloadable\Model\Link; use Magento\Downloadable\Model\Link\Purchased; +use Magento\Framework\App\ObjectManager; use Magento\Store\Model\ScopeInterface; /** @@ -32,6 +33,10 @@ class Downloadable extends \Magento\Sales\Block\Order\Item\Renderer\DefaultRende * @var \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory */ protected $_itemsFactory; + /** + * @var \Magento\Downloadable\Model\Sales\Order\Link\Purchased + */ + private $purchasedLink; /** * @param \Magento\Framework\View\Element\Template\Context $context @@ -40,6 +45,7 @@ class Downloadable extends \Magento\Sales\Block\Order\Item\Renderer\DefaultRende * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory * @param array $data + * @param \Magento\Downloadable\Model\Sales\Order\Link\Purchased|null $purchasedLink */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, @@ -47,32 +53,31 @@ public function __construct( \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory $itemsFactory, - array $data = [] + array $data = [], + ?\Magento\Downloadable\Model\Sales\Order\Link\Purchased $purchasedLink = null ) { $this->_purchasedFactory = $purchasedFactory; $this->_itemsFactory = $itemsFactory; parent::__construct($context, $string, $productOptionFactory, $data); + $this->purchasedLink = $purchasedLink + ?? ObjectManager::getInstance()->get(\Magento\Downloadable\Model\Sales\Order\Link\Purchased::class); } /** + * Get purchased link + * * @return Purchased */ public function getLinks() { - $this->_purchasedLinks = $this->_purchasedFactory->create()->load( - $this->getOrderItem()->getId(), - 'order_item_id' - ); - $purchasedItems = $this->_itemsFactory->create()->addFieldToFilter( - 'order_item_id', - $this->getOrderItem()->getId() - ); - $this->_purchasedLinks->setPurchasedItems($purchasedItems); + $this->_purchasedLinks = $this->purchasedLink->getLink($this->getOrderItem()); return $this->_purchasedLinks; } /** + * Get purchased link title + * * @return string */ public function getLinksTitle() diff --git a/app/code/Magento/Downloadable/Model/Link/DeleteHandler.php b/app/code/Magento/Downloadable/Model/Link/DeleteHandler.php index 399550e5f33c0..c2a3b20ff9e36 100644 --- a/app/code/Magento/Downloadable/Model/Link/DeleteHandler.php +++ b/app/code/Magento/Downloadable/Model/Link/DeleteHandler.php @@ -9,7 +9,7 @@ use Magento\Framework\EntityManager\Operation\ExtensionInterface; /** - * Class DeleteHandler + * Delete Handler for Downloadable Product Links. */ class DeleteHandler implements ExtensionInterface { @@ -27,6 +27,8 @@ public function __construct(LinkRepository $linkRepository) } /** + * Delete Downloadable Links for the provided Product. + * * @param object $entity * @param array $arguments * @return \Magento\Catalog\Api\Data\ProductInterface|object @@ -41,6 +43,8 @@ public function execute($entity, $arguments = []) foreach ($this->linkRepository->getList($entity->getSku()) as $link) { $this->linkRepository->delete($link->getId()); } + $entity->setDownloadableLinks(null); + return $entity; } } diff --git a/app/code/Magento/Downloadable/Model/Link/ReadHandler.php b/app/code/Magento/Downloadable/Model/Link/ReadHandler.php index a11b38ee3afd8..d3a2349739c26 100644 --- a/app/code/Magento/Downloadable/Model/Link/ReadHandler.php +++ b/app/code/Magento/Downloadable/Model/Link/ReadHandler.php @@ -9,7 +9,7 @@ use Magento\Framework\EntityManager\Operation\ExtensionInterface; /** - * Class ReadHandler + * Read Handler for Downloadable Product Links. */ class ReadHandler implements ExtensionInterface { @@ -27,6 +27,8 @@ public function __construct(LinkRepository $linkRepository) } /** + * Read Downloadable Links for the provided Product. + * * @param object $entity * @param array $arguments * @return \Magento\Catalog\Api\Data\ProductInterface|object @@ -40,10 +42,9 @@ public function execute($entity, $arguments = []) } $entityExtension = $entity->getExtensionAttributes(); $links = $this->linkRepository->getLinksByProduct($entity); - if ($links) { - $entityExtension->setDownloadableProductLinks($links); - } + $entityExtension->setDownloadableProductLinks($links); $entity->setExtensionAttributes($entityExtension); + return $entity; } } diff --git a/app/code/Magento/Downloadable/Model/Sales/Order/Link/Purchased.php b/app/code/Magento/Downloadable/Model/Sales/Order/Link/Purchased.php new file mode 100644 index 0000000000000..cfb768b6d7470 --- /dev/null +++ b/app/code/Magento/Downloadable/Model/Sales/Order/Link/Purchased.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Downloadable\Model\Sales\Order\Link; + +use Magento\Downloadable\Model\Link\Purchased as PurchasedEntity; +use Magento\Downloadable\Model\Link\PurchasedFactory; +use Magento\Downloadable\Model\Product\Type; +use Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory; +use Magento\Framework\DataObject; + +/** + * Order purchased link resolver + */ +class Purchased +{ + /** + * @var PurchasedFactory + */ + private $linkPurchasedFactory; + /** + * @var CollectionFactory + */ + private $linkPurchasedItemCollectionFactory; + + /** + * @param PurchasedFactory $linkPurchasedFactory + * @param CollectionFactory $linkPurchasedItemCollectionFactory + */ + public function __construct( + PurchasedFactory $linkPurchasedFactory, + CollectionFactory $linkPurchasedItemCollectionFactory + ) { + $this->linkPurchasedFactory = $linkPurchasedFactory; + $this->linkPurchasedItemCollectionFactory = $linkPurchasedItemCollectionFactory; + } + + /** + * Get order purchased link + * + * @param DataObject $item + * @return PurchasedEntity + */ + public function getLink(DataObject $item): PurchasedEntity + { + if ($item->getOrderItem()) { + $item = $item->getOrderItem(); + } + + if ($item->getProductType() !== Type::TYPE_DOWNLOADABLE) { + $childrenItems = $item->getChildrenItems() ?: []; + if (count($childrenItems) === 1) { + $childItem = reset($childrenItems); + if ($childItem->getProductType() == Type::TYPE_DOWNLOADABLE) { + $item = $childItem; + } + } + } + $itemId = $item->getId(); + + $purchased = $this->linkPurchasedFactory->create() + ->load($itemId, 'order_item_id'); + $purchasedLinks = $this->linkPurchasedItemCollectionFactory->create() + ->addFieldToFilter('order_item_id', $itemId); + $purchased->setPurchasedItems($purchasedLinks); + + return $purchased; + } +} diff --git a/app/code/Magento/Downloadable/Model/Sample/DeleteHandler.php b/app/code/Magento/Downloadable/Model/Sample/DeleteHandler.php index b34cedbdda01d..d7361b602673e 100644 --- a/app/code/Magento/Downloadable/Model/Sample/DeleteHandler.php +++ b/app/code/Magento/Downloadable/Model/Sample/DeleteHandler.php @@ -9,7 +9,7 @@ use Magento\Framework\EntityManager\Operation\ExtensionInterface; /** - * Class DeleteHandler + * Delete Handler for Downloadable Product Samples. */ class DeleteHandler implements ExtensionInterface { @@ -27,6 +27,8 @@ public function __construct(SampleRepository $sampleRepository) } /** + * Delete Downloadable Samples for the provided Entity. + * * @param object $entity * @param array $arguments * @return \Magento\Catalog\Api\Data\ProductInterface|object @@ -42,6 +44,8 @@ public function execute($entity, $arguments = []) foreach ($this->sampleRepository->getList($entity->getSku()) as $sample) { $this->sampleRepository->delete($sample->getId()); } + $entity->setDownloadableSamples(null); + return $entity; } } diff --git a/app/code/Magento/Downloadable/Model/Sample/ReadHandler.php b/app/code/Magento/Downloadable/Model/Sample/ReadHandler.php index abcefc720ca35..4704de24e2094 100644 --- a/app/code/Magento/Downloadable/Model/Sample/ReadHandler.php +++ b/app/code/Magento/Downloadable/Model/Sample/ReadHandler.php @@ -9,7 +9,7 @@ use Magento\Framework\EntityManager\Operation\ExtensionInterface; /** - * Class ReadHandler + * Read Handler for Downloadable Product Samples. */ class ReadHandler implements ExtensionInterface { @@ -27,6 +27,8 @@ public function __construct(SampleRepository $sampleRepository) } /** + * Read Downloadable Samples for the provided Entity. + * * @param object $entity * @param array $arguments * @return \Magento\Catalog\Api\Data\ProductInterface|object @@ -40,10 +42,9 @@ public function execute($entity, $arguments = []) } $entityExtension = $entity->getExtensionAttributes(); $samples = $this->sampleRepository->getSamplesByProduct($entity); - if ($samples) { - $entityExtension->setDownloadableProductSamples($samples); - } + $entityExtension->setDownloadableProductSamples($samples); $entity->setExtensionAttributes($entityExtension); + return $entity; } } diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableLinkInformationActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableLinkInformationActionGroup.xml new file mode 100644 index 0000000000000..474e6ec5ba199 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableLinkInformationActionGroup.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertDownloadableLinkInformationActionGroup"> + <annotations> + <description>Verifies the data for a downloadable link on the Edit Product page in admin.</description> + </annotations> + <arguments> + <argument name="title" defaultValue="{{downloadableLink.title}}" type="string"/> + <argument name="price" defaultValue="{{downloadableLink.price}}" type="string"/> + <argument name="fileType" defaultValue="{{downloadableLink.file_type}}" type="string"/> + <argument name="fileNameOrUrl" defaultValue="{{downloadableLink.file}}" type="string"/> + <argument name="sampleType" defaultValue="{{downloadableLink.sample_type}}" type="string"/> + <argument name="sampleFileNameOrUrl" defaultValue="{{downloadableLink.sample}}" type="string"/> + <argument name="shareable" defaultValue="{{downloadableLink.shareable}}" type="string"/> + <argument name="maxDownloads" defaultValue="0" type="string"/> + <argument name="index" defaultValue="0" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductDownloadableSection.sectionHeader}}" dependentSelector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" visible="false" stepKey="expandDownloadableSection"/> + <waitForElementVisible selector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" stepKey="waitForDownloadableLinks"/> + <seeInField userInput="{{title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="seeTitle"/> + <seeInField userInput="{{price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="seePrice"/> + <seeInField userInput="{{fileType}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="seeFileType"/> + <executeJS function=" + var element = document.evaluate("{{AdminProductDownloadableSection.linkFileNameOrUrl(index)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); + if ( typeof element.singleNodeValue.value !== "undefined" ) { + return element.singleNodeValue.value; } + else { + return element.singleNodeValue.innerText; };" + stepKey="grabFileNameOrUrl"/> + <assertStringContainsString stepKey="assertFileNameOrUrl"> + <actualResult type="variable">grabFileNameOrUrl</actualResult> + <expectedResult type="string">{{fileNameOrUrl}}</expectedResult> + </assertStringContainsString> + <seeInField userInput="{{sampleType}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="seeSampleType"/> + <executeJS function=" + var element = document.evaluate("{{AdminProductDownloadableSection.linkSampleFileNameOrUrl(index)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); + if ( typeof element.singleNodeValue.value !== "undefined" ) { + return element.singleNodeValue.value; } + else { + return element.singleNodeValue.innerText; };" + stepKey="grabSampleFileNameOrUrl"/> + <assertStringContainsString stepKey="assertSampleFileNameOrUrl"> + <actualResult type="variable">grabSampleFileNameOrUrl</actualResult> + <expectedResult type="string">{{sampleFileNameOrUrl}}</expectedResult> + </assertStringContainsString> + <seeInField userInput="{{shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="seeShareable"/> + <seeInField userInput="{{maxDownloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput(index)}}" stepKey="seeMaxDownloads"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableSampleLinkInformationActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableSampleLinkInformationActionGroup.xml new file mode 100644 index 0000000000000..733ed47549d46 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminAssertDownloadableSampleLinkInformationActionGroup.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertDownloadableSampleLinkInformationActionGroup"> + <annotations> + <description>Verifies the data for a downloadable sample link on the Edit Product page in admin.</description> + </annotations> + <arguments> + <argument name="title" defaultValue="{{downloadableSampleFile.title}}" type="string"/> + <argument name="fileType" defaultValue="{{downloadableSampleFile.file_type}}" type="string"/> + <argument name="fileNameOrUrl" defaultValue="{{downloadableSampleFile.file}}" type="string"/> + <argument name="index" defaultValue="0" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductDownloadableSection.sectionHeader}}" dependentSelector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" visible="false" stepKey="expandDownloadableSection"/> + <waitForElementVisible selector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" stepKey="waitForDownloadableLinks"/> + <seeInField userInput="{{title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" stepKey="seeTitle"/> + <seeInField userInput="{{fileType}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector(index)}}" stepKey="seeFileType"/> + <executeJS function=" + var element = document.evaluate("{{AdminProductDownloadableSection.sampleFileNameOrUrl(index)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); + if ( typeof element.singleNodeValue.value !== "undefined" ) { + return element.singleNodeValue.value; } + else { + return element.singleNodeValue.innerText; };" + stepKey="grabFileNameOrUrl"/> + <assertStringContainsString stepKey="assertFileNameOrUrl"> + <actualResult type="variable">grabFileNameOrUrl</actualResult> + <expectedResult type="string">{{fileNameOrUrl}}</expectedResult> + </assertStringContainsString> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontLinkOnDownloadableProductPageActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontLinkOnDownloadableProductPageActionGroup.xml new file mode 100644 index 0000000000000..978fff04938f0 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontLinkOnDownloadableProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontLinkOnDownloadableProductPageActionGroup"> + <annotations> + <description>Validates that the provided Link Title is present on Downloadable Product details page.</description> + </annotations> + <arguments> + <argument name="linkTitle" type="string" defaultValue="{{downloadableLink.title}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" stepKey="waitForDownloadableLinksList"/> + <see selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" userInput="{{linkTitle}}" stepKey="seeDownloadableLink"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoLinkOnDownloadableProductPageActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoLinkOnDownloadableProductPageActionGroup.xml new file mode 100644 index 0000000000000..8b71839669876 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoLinkOnDownloadableProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontNoLinkOnDownloadableProductPageActionGroup"> + <annotations> + <description>Validates that the provided Link Title is NOT present on Downloadable Product details page.</description> + </annotations> + <arguments> + <argument name="linkTitle" type="string" defaultValue="{{downloadableLink.title}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" stepKey="waitForDownloadableLinksList"/> + <dontSee selector="{{StorefrontDownloadableProductSection.downloadableLinksListSection}}" userInput="{{linkTitle}}" stepKey="dontSeeDownloadableLink"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoSampleOnDownloadableProductPageActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoSampleOnDownloadableProductPageActionGroup.xml new file mode 100644 index 0000000000000..693667b3dddf1 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontNoSampleOnDownloadableProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontNoSampleOnDownloadableProductPageActionGroup"> + <annotations> + <description>Validates that the provided Sample Title is NOT present on Downloadable Product details page.</description> + </annotations> + <arguments> + <argument name="sampleTitle" type="string" defaultValue="{{downloadableSampleUrl.title}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontDownloadableProductSection.downloadableSamplesListSection}}" stepKey="waitForDownloadableSamplesList"/> + <dontSeeElement selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(sampleTitle)}}" stepKey="dontSeeDownloadableSample"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontSampleOnDownloadableProductPageActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontSampleOnDownloadableProductPageActionGroup.xml new file mode 100644 index 0000000000000..8542c83892995 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AssertStorefrontSampleOnDownloadableProductPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontSampleOnDownloadableProductPageActionGroup"> + <annotations> + <description>Validates that the provided Sample Title is present on Downloadable Product details page.</description> + </annotations> + <arguments> + <argument name="sampleTitle" type="string" defaultValue="{{downloadableSampleUrl.title}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontDownloadableProductSection.downloadableSamplesListSection}}" stepKey="waitForDownloadableSamplesList"/> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(sampleTitle)}}" stepKey="seeDownloadableSample"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/StorefrontNavigateToCustomerDownloadableProductsPageActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/StorefrontNavigateToCustomerDownloadableProductsPageActionGroup.xml new file mode 100644 index 0000000000000..2e1218de31951 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/StorefrontNavigateToCustomerDownloadableProductsPageActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontNavigateToCustomerDownloadableProductsPageActionGroup"> + <annotations> + <description>Navigates to the storefront My Downloadable Products page. Must be signed in as a customer.</description> + </annotations> + <amOnPage url="{{StorefrontCustomerDownloadableProductsPage.url}}" stepKey="navigateToImportPage"/> + <waitForText userInput="My Downloadable Products" selector="{{StorefrontCustomerAccountMainSection.pageTitle}}" stepKey="waitForPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Data/LinkData.xml b/app/code/Magento/Downloadable/Test/Mftf/Data/LinkData.xml index 4c0382e0d444d..a406453438a63 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Data/LinkData.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Data/LinkData.xml @@ -8,10 +8,7 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="downloadableData" type="downloadable_data"> - <data key="link_title">Downloadable Links</data> - <data key="sample_title">Downloadable Samples</data> - </entity> + <!-- Downloadable Links --> <entity name="downloadableLink" type="downloadable_link"> <data key="title" unique="suffix">DownloadableLink</data> <data key="price">2.00</data> @@ -64,6 +61,28 @@ <data key="is_shareable">1</data> <data key="sort_order">2</data> </entity> + <entity name="ApiDownloadableLink" type="downloadable_link"> + <data key="title" unique="suffix">Api Downloadable Link</data> + <data key="price">2.00</data> + <data key="link_type">url</data> + <data key="shareable">No</data> + <data key="number_of_downloads">1000</data> + <data key="sort_order">0</data> + <data key="link_url">https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg</data> + </entity> + <entity name="downloadableLink_Files" type="downloadable_link"> + <data key="title" unique="suffix">LinkFiles</data> + <data key="sort_order">1</data> + <data key="is_shareable">1</data> + <data key="price">3.43</data> + <data key="number_of_downloads">2</data> + <data key="link_type">file</data> + <data key="sample_type">file</data> + <requiredEntity type="link_file_content">downloadableLink_MagentoLogo</requiredEntity> + <requiredEntity type="sample_file_content">downloadableSampleLink_AdobeBase</requiredEntity> + </entity> + + <!-- Downloadable Samples --> <entity name="downloadableSampleFile" type="downloadable_sample"> <data key="title" unique="suffix">SampleFile</data> <data key="file_type">Upload File</data> @@ -80,13 +99,30 @@ <data key="sample_type">url</data> <data key="sample_url">http://example.com</data> </entity> - <entity name="ApiDownloadableLink" type="downloadable_link"> - <data key="title" unique="suffix">Api Downloadable Link</data> - <data key="price">2.00</data> - <data key="link_type">url</data> - <data key="shareable">No</data> - <data key="number_of_downloads">1000</data> + <entity name="downloadableSample_File2" type="downloadable_sample"> + <data key="title" unique="suffix">SampleFile</data> <data key="sort_order">0</data> - <data key="link_url">https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg</data> + <data key="sample_type">file</data> + <requiredEntity type="sample_file_content">downloadableSampleLink_TestImage</requiredEntity> + </entity> + + <!-- File Content --> + <entity name="downloadableLink_MagentoLogo" type="link_file_content"> + <data key="file_data">iVBORw0KGgoAAAANSUhEUgAAAP8AAAEsCAYAAAAM1WX/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACY7SURBVHhe7Z0LlBxXnd6HXWyWhx9g8HS3pJFGPVU1klmC2RB28frBIbY00y2NpBnN9GMkG4JJcOJsgCVrszZg56wJuxj2BTjLY8FsADsb20kwmEc4WYgNxPYuiwX2yg9ZxrKsefS7R5IlufP/qm+N76hbo5qa7p6qru875zs6M5quvvd/76/q3lt1/9VDhU/7Ll79ikrauL66y8pVUsZ1ezf1nan+i6KoblV+bP22uUlrT+1dG2vlycEa/pWfH5kej4+oP6Eoqpt0aGx9vJqxvnF892Dt2JUbavmMNW/8fEx+X81aXy9MxNerj1AUFWQ9eGHPy4sp4wOHJ60ZXOWLWauW08CH8TN+r0YBM8W0+f47B3vOUIegKCpoyo/HL6tkzAcA9eFdgw3Qn2z8/5z8Hf6+krEeyE/EL1WHoigqCHo+2X9+MW18dm5y8MSLV25sCvrpfEI+V520TuA4h4b6etWhKYryqwTWXTJ3fxpXbyzone5qfyrjc+WsjALeLSeBrPl0MWNOqq+gKMpPmh3rf2Mpbdxbu2pj7ejuDZ6hP9k4Do6HEUQpY34zl+r/TfWVFEWtpH52ee+rZF7/kbmsVQb4hZPgbZVxXBx/btIqldLmjQeSkVeqIlAU1Wnl0gNJAf/nGOJXlzHEd2scH99jLwhmzX8sTgwkVFEoiuqEcjvW9pWzxleO7hqsHT/pnn2njO/F95cz5pefk/KoolEU1S5VM+Y1law1hatvqck9+04Z34vvr48CrEMolyoiRVGtVG5n/0Vylf07zLvd3LPvlFEOlAflkqnA/5kdX/92VWSKopajZ8Zir53LGrdWJ61jL161oW0Lest1fUFwQ60i5ZxLG7fuT/Sdq6pAUdRSVU4ZqXLGenK59+w7ZZTP2SxUzlpPlNPGhKoKRVFuND22zpQh9N+euHJD7YXdK7Ogt1yj3Ch/JWv97fSOPktVjaKoZsK++krGuK6cNUu4emKzTTOwgmJns5CcyIqVtPkH9zJvAEU1amZi3eXVjPkQYMHmGr8P8d0a9XA2C1Wz5oOFsXX/UlWZosKt6a1rotWs9XmsmGOY3AygbjHqd3hysFbNWH+1X+qtQkBR4VMpZbynOmkewFWxlO2eq/2pjPqhnvboJms+i/qrUFBUOFRI9f+WdP7v4tbYkRZuwgmKUV/UG/WXqcB3Cjvjb1Ghoaju1L6RtedUM8YtMsw/2s5NOEGxs1moOmkdKWeMjyM+KlQU1T3KTxjb57LWL+3V7wDcs++UEQfEoz4VsH6RT63fpkJGUcFWPXGm+V+PyzD35MSZ9EI7iUQrGetriJsKIUUFS0icmU8ZH0BCTFzVmiXOpBca8XGeDTictaaLqYH/gDiqkFKU/1VKxy+Zy1h24sxuumffKSNe9mYhiV81a92fG4tfokJLUf7UoZ19vcWM8ZnqMhJn0guNONqJRFPGXyIxqQo1RflHFSTOnLT24WoVhE04QTHiaG8Werf9bMBTchLYrUJOUSurfCr+5lLG+taLV25oaeJMeqER13oi0Q21Ytr4Vn7nwD9TTUBRndWeS899dTltfFSu9hXes++cnWcD5iTuiP/By3tfpZqEotqvysRAopOJM+mFRrz1RKKVlDGsmoai2qN64kzzS0d3r1ziTHqh0Q5HdtmJRP86t7N/jWoqimqdyinj31Wz1iFcbVYycSa90GgHJ5GotM/zTCRKtUzFifjvyBDfTpyJKwyh96fRLmgftBMSiRbT639bNSFFLU3PXBF7bSVdT5yJ3WfNOhztPzuJRKXdXqhkjE8ykSi1JBVSRqqStR7nPftgGu3lPBuAdkR7qqalqOY6OBrfKJ3l7iAnzqQXGu2IRUEZBdw1s3XNBtXUFFXXnrHBM2SIf305Y5ZxtecmnO4x2lFLJFpCO+8ZHDxDNT0VZs2MDlxezVh24sxqiBb0AASemMO/zf6/24x2RfvW7woMPjjDRKLh1dT2NZG5tHkbEkqeCNEmHEAA6Oek3vm0+Rh2z4XtsWS0t51INGv+F2zGUl2CCoNKE8bV1UkrNIkzYdSxrJJnYgNSLjWQrSUjr5wZj++qZq2n8Xv8f1hi8VIiUetXTCQaAk3vjL9FzvahTJyJ9/xVZIg/lzH//Int/W9QIbF1UH6uZI2/kJOA/XfNPt+NRvs7iUQlLt/Jj8cvVCGhukUzm/vPKmaMj8sV70iYNuGgc9svzJA6y0nv/unR+KUqJE01PR6/rDpp3m9fEUO0/uFsFqpI/yimjFv2Sn9RIaGCrPzEeiTO/AU6dFgSZ6KO8yvcGTNXThkfuGN7z6+pkCyqj17c8+tyovygjBJy+HxY7nygjkwk2iWa2rbOqGSsO5AQMmyJM+uJMDfgzTjfOLTFWyLMqR39A3LiuBPHCWf87ESi30AcVEgovwsJH4sTxgfDljhTv3LJVfuX+fTADhWSZamUGhiVk8Cj9nFDOHJCP5KpwAd+ICMiFRLKj8qND1wcxsSZzpy1nDXx8otbprec8xoVkpZoZvPZZ1UzxsflpBLONZN32W8Wuh/9S4WE8ouwWl1MG39RnbSOvyids1lDdqPROZ3VagHzu+1+7RVeM1bJGN8L590S3CIdPI5+hv6mQkKtpJDQ8XDIEmeijs596nLGPFDp8H1qGQVcXZXvxfeH6jkJNa2qZq19chLYpcJBdVpI4FhKG6FMnGm/6lqGo5W0eRte8a1C0lHNjK2OyRTjr7CHvttfLa4b/cxJJCr9716ZCrxJhYRqtw4kI68sp4yPze2y7E04YZp/Os+mlzLmQ4Xx+BUqJCuqQmr9JinPw/YVMSQjL9hZZ5nLWmUkEkW/VCGh2qFieiCJhI2h62hq5bmaNYtytf+DvZt6zlQh8YX2buo7s5IxrkP57BOylLdZPbrN9glZTQWQ0LWYGUiokFCtUn5i7dpqxrr9qFz5wpQ4E50L+9ExrC6nzXtmR+MbVUh8qdlUfGM5Y/4PJx9CWE7OMPol+mc5bX0lP7J2rQoJtRzJvPLasCXORB21xaXHZVg5ocIRCMm0DJmQnkAmnXAtwjojNOsQEr6qcFBLVXE8/rZKxrITZ2JxKyxXEWcuiRx0hbRxq8wlz1MhCZRQ7lLa+BTqgfo0q2s3Gv3Ufsmo1BmJRGfHmEjUtZBwsZoxPilXjtB1Gjv7rP1AidU1nWYW2Y8n5SQu9QrfSdx+/uKFatb8k30ja89RIaGaqTAxkLaHizJ0CuNw8fCkdbCcMq+pqXh0i27o6XlZQYbBc1nr+bBO36RfM5FoM81MGIMSnLvCmDgTC0Uv7FZvnMms7VMh6Uqphdsvo75hWriFnYXbSsb879M7DEuFJLy6F7eI0sb1SKyIs2OYNuE4t4jkavgPsyF711xR6iv1/hnqH5Zbtqijs1mojESiGeM69H8VknBpdjx+hcyFHrQBCNtc0O70VjXMb5nFW47lJHBTNWvNIR5helirvlkIdwXMB5FAVoWk+4XEmdWM+QUs/oT1sVC56n0zlzJ+U4Uk1Do0PvAmice9oX1MW0Y+1bT1eXChQtKdKqSN91YnQ7ghRG3Ckavc0/kJ40oVDkpTfnzgKonPfsQpnIlEzWcLE8bVKhzdI2zCkcp9J6yJM6VT42r/508m+89XIaGa6HmJTyVj/aVMicKbSHTSvC8/Gn+zCklw9eTYurPLKeMW6fyHcc8+TPM650EPmdfdPzUWv0SFhHKh6Yn4pQJBaJOyVLODh8tp84/AjwpJsITEmQL9L9GAoUycmbVmkTiT6Z+8CXGrMJFosBKJHhpbH0fiyOOhTpxpfu35HX39KiTUMnRoIr5eLiJfC3MiUan/1wsSBxUS/8lOnClXusMhT5xZmjC2q5BQLRQSkoY+kWjafD84UyHxh/Lj8cukYew5Whg34eBlD9WMccujLU6cSS3U9BbzNSqR6NGwrSFpzwbcn59Y/OUrHRFWZ4tp47Nzk4MnXgzZyy6d1VkZkn13Zqz/rSokVAdUSPe/VaaW9USiu0J290g4q05aJ8op4zPgT4Wks0ICQ+n49Rc8hmgYNp84M2s9V8p04X3ZAKmUNt4ro4CDaI/QJRJ9tz0KeLqYMSdVONqv2bH+NyJxIYZdYU2cicSV0ylzRRJnUgs1M2bEymnj8+F9YtTO6fjNXKq/fU+M/uzy3lfJvP4jc1mrHNb5VhmJMydC9Cx2gFRIx6+Q9rETiYbx2YC5SatUSps3tjyRaA6JMzPmzxHYMCXOdFZaZY5VkCH+dX5LnEkt1A8uXv0KGZVeLyAU0G5ov2bt2m0Gj/OJRLPmPxYnWpBINLdjbV85a3wlbIkz4fnEmRnjLuQbUCGhAiC0l0wF7kb7hTE/hJ1INGN++TnhV4VkaapmzGsqWWsKZ5PQJs6cMMdVOKgAqpA2JtCOaM8wZoYSfg+BYxWO0yu3s/8iOWuEMnFm/X1s1jEZOt5aGIu9VoWECrCeHYm+TqZsn0a7on3DtFbl7C+xE4mOr3+7CkmjnpHOPpc1bq0HaUP4gvQupFiy/m7RIFGBVS5tXlS1s0GHNJGocD0nFzUkyFUhqQt54csZ68nwDY/qQ/w5GR4VJox/i0STKiRUF+qOnp5fU4lE7fdAhOkRdGc6W85aT8y/ByI3MXDHcRkahHJhROosQ/yvYGHTDgYVCiGRqEwFbg9lIlGpL3gH9z3Ht6+pFXbG6/8pV8KT/7ibjDOgljjzZ8VxY0j1ByqEQuJU9AP0h1DcwlZ8g3dw3zM7FKnZ3rq6lhuXkwD+oAtPAvbcB42ctSphTpxJLdSesXNfXcZbnyetStc+vKaYBt/g3GG+Z3Y4WrPtnAS29dXyKUN9oMmBAmaczecTZ05a/2t2vP8C1e4UNS88ti6jgO5KJAp+wbHwDK7nGVfMvwS/Y/Wfue1ra/m0Wf9wswP73PoiR3XS2ldMx3epdqaoU6qYMnZ3xYY1cCv8gmOda92N8DvGHyditdxo/0sHO/kLfOwT9tbHwVolY3zmudH1r1dtS1GnFfpLJWt9Zk76T+A2CylOwS34bQa941PDD+OD8JZVtRwWBXFgH58EcJaef7AhYz4wvSN+mWpPilqypsf63yH96MeBeOBNsQlOwes8u824Vl4cfsfqQLmta2r58QHfnQTQKM4mHDlj54oZ44NMnEm1QrchPV3a+H3pV3n0L989G+CwKFyCTzfQO3YHv2N10Ny2tbWcsyjYrEAd9nzizKz5tUPbfJzokAqs7MS0WevreC7AN4lEhT9wCB51Pt16afA7xpdgPWDHuhVbFMTZ10mcKY3CxJlUR2QnEp1c4USi4A2LecLf6eb1i9kb/I7xpUk5CYytf6lQJxe0Da4/r2xDf1iu9n/ExJlUJ7V389lnlTPGx/FyjY4+G6D4Am/gziv0jpcHP4wCwFva/5AQzrK4B2tvVMia353eGX+Lag+K6rimR/t/q+IkEm3nswGKKfshHZeLeW68fPgd2wWSf0fW1PITrV0URFDnE2dmzAOllPEeFf/QSaY3g7WxwTPUj77Q3k19Z6Jc6sfQqZoxrm7LC2gdhoQncGXz1QLoHbcOfseqcDn7ScHWrAfgXuuRXYO1ctr6/MzY6piKeah0aGdfbylrfTmXMp6ckWGn+rUvlHvnWWdLuZ4qZ80voZzq16HSzLboKrkwfQH9tCXPBoAbezGvbwFXrXTr4XeMwi5jURBnTydxZiljPlwYj1+h4hw6VVLWu8oZ61e1q9+IWD7+zGjsN9R/+UJIGjmbMp9C+UpSzkp64Cr1X6FTJR2/opQ2/x791lMiUXDSgsU8N24f/I5R+OSqJS0KOvfs5yatfCVtXI/EjCq2odLUePzCatb8NuaUWOuA82njsZZnaF2msEkqlzL3Yt7rrMlUs9a9U93wqmkP2if9Vfrth5eUSFRxUV/MU/P6Zjy10O2HH0ZFxDkXi4J64sywziORJr2aMf9T5aRXmwcBfpTTuRtTxt2YtHmz38rbKc2OxjeeNpGoYgFcgA+HlaYctdidgd+xU7GRNbXchLNzsD400l52+bjMnUKbOLM0Ed9azVh77FicdB85KPDDepvKKOCRXCq+Rf156FRIGSmJweN4y878ZiGn7wsH9cW8zkHvuLPwO1aVxI4j6TS1Oek0MkQ6WkoZn0TCRRWzUCk/tmadDPH/BleIUz1BFiT4daM+yJojo5mv5kfWrlUfC5Wkzc5DYlj0c/R39PvFdtx1wisDv2OpdHnLqlppbN3B2XEjlIkzsQehOGG+v5I1T/tq86DCj/q8tPfCnC6nzN9DPj318VAJiUQr0t/R71cKescrC7/4ha2x2vRQ5CcqNqGSDPl+V672/xdQuNk1FlT4HaN+zq5LGQb/KLfTvEgdIlSaHer9Kfp9Mx466RWH/6gEYWY48pCKSyj0mAwBKxnzzypZ6wTSpDcDpZmDDr9u5NAvS/0rafNPwzTVq4lnhyMPo98346GTJvwdVmFiIF2dtJ7A1X6pmWK6CX7U28m0JPPgx2dTRkodrqtF+DWHBX7kDpzLmPcgRxwW9ZYCveNugt8x4uDc3pXR0D2zqfhGddiuFOHX3O3wA9RCeuBGmeOWcZUruHng4xTuRvgdIy6IT3XSLEm8bnjIZ3VslQi/5m6Gf3Zi/WYZ0tqPerYiL3w3ww8jPtp7FR6eHVu/SX1F14jwa+5G+PFq5HLG/GKrX23e7fDrRtywSaYkcczt7F+jvirwIvyauw3+UnrgfXLVeg5Xr5Zu7xSHCX7Ebf5dipPWgVJq4F+rrwu0CL/mboFfhqi/Xc2a/9tO7LCrPYkdwgS/Y8QR8bQ3C2Ws7xfH429TXxtIEX7NQYd/38jac0pp84/l6nSk3Smdwgi/4/nUbRLnUsr8xJNj685WXx8oEX7NQYa/PGGNVTuYzDHM8MOIr7ZZ6JcyFRhVRQiMCL/mIMI/vcOwyhnzv9lpnNvc4XWHHX7d2CyE+JfT5p3TY5apiuJ7EX7NQYL/wQt7Xl7JmB+Sq878Cxyadcx2mfAvtLNZSNojV0kbv4/2UUXyrQi/5qDAXxg33ilX+/9nrz57Sc/UAhP+RqMdnHRv5Yz103LKfIcqli9F+DX7Hf79W9dEK1nzs/ZLG5ewCacdJvyLG5ukqpPWCbyc9entayKqeL4S4dfsZ/grafNflbPms7iqtPqevRcT/sWN9nGeDShlzGdlivZuVUTfiPBr9iP8eBmInjhzpaF3TPjdGe2FWKlnA76FRKiqqCsuwq/ZT/Dnd7/pHJnXNyTO9IsJ/9LsPBsg7TlXTps3o31VkVdMhF+zn+DP7ej/cO09F9SqbXpCb7km/Es32hHtiXadGe2/XhV5xUT4NfsJ/unNvTfXRvtquZ2dffGoWxP+JVq1H3Lh10bX1KR9b1JFXjERfs1+gn92KPrR2og0ylCkltu6ppYbb+07B5drwu/Sqs3Qfrmt9Vz4aFfpZx9RRV4xEX7NvoN/26p62VRmVbwrLZdy3jHQpKN10IT/NEb7APoJo5YbWfiOO7Qr4V9owq9pAfyOnZPAdm/vHGylCf8iRrvgHXfSTnq7OSb8jSb8mprC7xidCS8eHe1/qbOd3AHbbMLfxKod0C6LvdiS8Dea8GtaFH4YHQvesqq+KKiGmQ0dsk0m/JoRd4k/2gHtMd82zdpNTPgbTfg1nRZ+x05H27pa5pedWxQk/GIVa8Qd8T8d9I4Jf6MJvybX8DtWnQ6LgnlnUbBZh22RQw8/4itxRrz1+Lsx4W804de0ZPgdOyeBHe1dFAwt/IgnFvMkvnq8l2LC32jCr8kz/I7RKZOxWm6sPYuCoYNfxQ/xRFy9QO+Y8Dea8GtaNvwwOii8ZXUttzNe78AtOgmEBn4VM8QPcZyPabN4uzThbzTh19QS+B2rDpsbWWM/dNKKk0DXw+9APzFgx60V0Dsm/I0m/JpaCr9j1Xlz29Yue1Gwq+FHXOzFvLUL4tYqE/5GE35NbYHfsXMSsBcFVWdvBsEi7kr4EQeJx3IW89yY8Dea8GtqK/yO0bmTq+ydZvOd/2QgTuGugl/VG3FAPNoFvWPC32jCr6kj8MPo6DAWBcfdLwp2Bfyqrqh3qxbz3JjwN5rwa+oY/I5Vx8fiVn5+UbAJMMqBht95FNrecdfaxTw3JvyNJvyaOg6/YwVBbjsWBU/9kFBg4Ud9pF6on17fTprwN5rwa1ox+B0DikV2DgYOflX+3Oi6RXfcdcKEv9GEX9OKww8PwQIJFgXxkJAGUWDgd6DHQzrOYh7q1ay+HTLhbzTh1+QL+B3bwIixc1AtCh69cqO/4Uf5pJz2Yt4Sdtx1woS/0YRfk6/gd+wAtK2vdnQSw2nznwCbKrIvdOjSc1+dy1iPH8ladjn9BL1jwt9owq/Jl/A7FpiObJWpwLa+R2pjg2eoIvtCezf1nZnbtmbPYSmf36B3TPgbTfg1+Rp+sR2rod4HVXF9pdmh3of80KFPZcLfaMKvKRDw+yRWuvzUoU9lwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt9owq+J8HsT4Xcvwq+Z8Ls34fduwt/onmNbV9UKiagEpvkftNuE370Jv3cT/rrBOXgH9z0zQ9HPVZKx2gsrVBjC796E37sJf93gHLyDe7tAUphNpUT04drIqloZ/9HkQ+0y4Xdvwu/dYYYfPINr8F1KxB4C7/XSKO27ePUrSsnYHxYT0fKL8kd59aFmB2ulCb97E37vDiP84DcvQ3zwLBf3Umk48uEfCOf1kjTRbKL3AjlL3I3hwZEt7S8g4Xdvwu/dYYQf/ILjciJ218Et52+sl8CFColoRkYB+xA0+dc+izT7guWa8Ls34ffusMAPTsGr4vap2WQ0Xf/mJepAMnKeTAU+XU5GXzjepsISfvcm/N4dBvhz4uMjsVpJeBVuP/WY8Fv/1mUol4xcVEzEfoS5Q7XFC4KE370Jv3d3M/zgsSpDfPBZTER+ODsUeXv921qkG3p6XiYjgGtl/jCFQGIhoRUnAcLv3oTfu7sRfvAHDlE34fJQcTh6LTitf1MbdHBL77ricOyrWExoRQUIv3sTfu/uRvidRflSInp7ftMb1ta/oQMqJqJbxHvss84ypgKE370Jv3d3C/zgzL5nL/UR/h4pJqPJ+pE7rL2bzz6rOBS9uZKIVU7IfAMLDs0KvJgJv3sTfu/uBvjBF+b1MsSvCPgf23Ppua+uH3UFld8ce3N+OHLfiZFY7bAMQ5YyCiD87k34vTvo8IMrrOTLHP9bU8Jb/Wg+Un4odlUlGd2vhiSuTgKE370Jv3cHEX7wA45Q9nIiuj+XiO2uH8Wnmtq0JiKjgNuweQA7h5pVSjfhd2/C791BhB/8gKPcUPRzh4bO660fIQDKD/W+o5yM/gRBt3cRNakcTPjdm/B7d1DgByfgxd5kl4j+OD98/mX1TwZMezf1nSlzlA9JJXIIfrNnAwi/exN+7w4C/M49e5k6z+aHYx/cMzZ4Rv1TAdb0pqgpo4A7m20WIvzuTfi92+/wH1XPzQgnd0wNRY36X3eR8oneUTmrPYaGKCXrowDC796E37v9CD/6f0nds5fR8aP5ZGRH/a+6VPsTfeeWEtE/LiaiR/FsAEYDhN+dCb93+w1+9Hv0f2HhSCER/cTPhYv6X4RAM1esfmslEf1+bXR1TaD7hfr1iorwexPhX5okVo+i30v//9705t5/rn4dLqHTlJOR908PR+6rXX3hy+u/XTkRfm8i/O5VGxs8Q2J1nwzzf0/9Ktya3nLOa2oX9/y6+nHFRPi9ifC7F/o5+rv6kfKLCL83EX4q8CL83kT4qcCL8HsT4acCL8LvTYSfCrwIvzcRfirwIvzeRPipwIvwexPhpwIvwu9NhJ8KvAi/NxF+KvAi/N5E+KnAi/B7E+GnAi/C702Enwq8CL83EX4q8CL83kT4qcDL7/Aj+8v0cPQnqri+kpTvpyjfyWX2iwk/taj8Dj/e0VZIRA9ODUcuVkX2hXKbey8pSrlQvmbl9oMJP7Wo/A6/k9O9lIgeKyVif3rgksh5qugrouc29b5eyvFnUp7ji72bwQ8m/NSi8jv8MABzXuEk0D1ZHI5kVfE7qmIyMinf/xTK4fbVbCtpwk8tqunN0Zv8Dr9uvAPhmMyzy8noPQcv771AVaOten7oDW8sJ6L/89hI4zsY/Gy7XYd6P6aqQVELJVf+j9XGVmNe7fsrmWPntc1yFS6XEpEb9l28+hWqOi3VA2+L/UZpOHKjjDQq+D4vr2NfCaMd0Z5oV175qVNqZnh1TK6iX6jKFc3PK9cnGx0ci232VCAZ/fupzb1Dqkot0dRw77Ac9x9wfHxPUE6MMNqxIu1ZGI58YXrrmqiqEkU11+xwZFM5EXsoqJ29KmWWofkXf7U5ukpVyZOevSK6Wo7zpSCfDNGOU0ORzapKFHV64SWjpUTshqIMpwM5zMUoIBE9WBiOvU9VaUnKDcWukc8/j+MEaRqUF6O90G6lZOQP0Y6qShS1NB1M9F5QTMTuxsLa4QAtcAHWOSmvWg/4/kxi9VtVlRbVzPCqf1FJRr+PV0nh80Ea9WABEiMUmaLcM7vp/I2qShS1POGWmlxNAnNryzFGLOqdcEcLw9E/2XNF7LWqSgv0jPy+JP+Pv8PfB2mkg/ZQ7fJkLhHNqCpRVOt0IBk5T4aSn5J58LHjI8EaBeCtyACkkog+NpvoHVNVslUY7t0pV/t/sqcK6u3JzY7jN+MEhXYoJ6MvlJKxTz/7zujrVJUoqj2Sq8vvlhORH9bkConFtSAOjWeGIt+Y2Ry5fHYoegd+DtI9e8QbcX9RwC9KO+SSkYtU01BU+1W7oedlxWT02nIiNhXERTEAjxVx/Iufg1B2lNFZzETci0PRf3+DtINqEorqrA5tfv364nDsq1gM9POW1mbOC0jNfu9X40SFOMsJ4PbnE2/oV01AUSsrmQpsKSVij9TnzcGaCvjZiKNzz76SjP08NxzZqkJOUf4RXr0sV9Oby4loNUgr5n414odblTLEr8jU5KZHf4evtqZ8rvzm2JuLyci3j0vHxTCVo4ClGfFC3BC/4nDk24inCi1FBUP5odhVMgrYjyFrkJ4NWCkjPs49e7naP50f7r1ShZKigqepTa+L5Iain0Oyi2NyJWvW6em6ER+Z35/IS7yelripEFJUsJXfsuod5WT0x3g2wO9ZbzppxAHxQFxklPRAfvj8y1TIKKp7hE0m+eHof5ROnsNCVtButbXaqL+9oJeMzs4moh/aMzZ4hgoVRXWnnt0UNYvJ6J32k3UBezagVcYzEbDM8e+YGooaKjQUFQ4VEr1jlWT00fqzAd2/IIj6OXsM5Gr/aH5z76gKBUWFT/sTfeeWEtFPBG033VKNejm7C4vJ2H9GvVUIKCrcOhjgffSLGfVAfVCvaiL6Pbd5BSgqdJpN9P4bGRo/h6FxkDYLnWyU29mEI/U5UBqOvFdVkaKoUwm592R4/EVcMbEo2AwuvxvlRvmREPWZ4dUxVTWKotxodiiyWU4CD9v3wAPwbADK52zCKSViDyERqqoKRVFLFfLwF4ajNxZ9nEgU0DuJM+VkVSokIjf8oE3vD6Co0Gk20XuBXFXvxiOwfsu6g/LYj+YmYncd3MLEmRTVFqlEovswtF7JzUL4XmcTjvz7VIGJMymq/aonEo19WubVx4+vwIIgph524sxE7JiU41OPSXlU0SiK6oRyw5GLi4nYjzDX7kQiURy/njgTV/vID0tMnElRK6cbenpeVtYSiWKzTKtPAjgejovj43uKw9Fr8b2qCBRFraScRKJYfGt1IlF7A5Ict5SI3l5g4kyK8qeKiegW8R77Kr2MqQA+59yzl+M9UkxGk+orKIryq/ZuPvus4lD05koiVvGyWcjZhCND/IoM8W96dAsTZ1JUoITEl/nhyH0nRur57t2MAuqJM/Eij8i3p5g4k6KCLSQSrSRPnUgUP+P39QW96P5iIrZbfZSiqKBratOaiFzNb7MTiW5dmEgUP+P3SDR6aOi8XvURiqK6SfmhXiQS/Qnu1QN4/CtX+x8zcSZFhUC4R19I9l5THYk9kRuOvE/9mgqVenr+P+OvTjWo+kMRAAAAAElFTkSuQmCC</data> + <data key="name" unique="suffix">magento_logo_</data> + </entity> + <entity name="downloadableSampleLink_AdobeBase" type="sample_file_content"> + <data key="file_data">/9j/4AAQSkZJRgABAQAASABIAAD/4QCARXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAKgAgAEAAAAAQAAAGSgAwAEAAAAAQAAAGQAAAAA/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/iDFhJQ0NfUFJPRklMRQABAQAADEhMaW5vAhAAAG1udHJSR0IgWFlaIAfOAAIACQAGADEAAGFjc3BNU0ZUAAAAAElFQyBzUkdCAAAAAAAAAAAAAAAAAAD21gABAAAAANMtSFAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEWNwcnQAAAFQAAAAM2Rlc2MAAAGEAAAAbHd0cHQAAAHwAAAAFGJrcHQAAAIEAAAAFHJYWVoAAAIYAAAAFGdYWVoAAAIsAAAAFGJYWVoAAAJAAAAAFGRtbmQAAAJUAAAAcGRtZGQAAALEAAAAiHZ1ZWQAAANMAAAAhnZpZXcAAAPUAAAAJGx1bWkAAAP4AAAAFG1lYXMAAAQMAAAAJHRlY2gAAAQwAAAADHJUUkMAAAQ8AAAIDGdUUkMAAAQ8AAAIDGJUUkMAAAQ8AAAIDHRleHQAAAAAQ29weXJpZ2h0IChjKSAxOTk4IEhld2xldHQtUGFja2FyZCBDb21wYW55AABkZXNjAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAEnNSR0IgSUVDNjE5NjYtMi4xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYWVogAAAAAAAA81EAAQAAAAEWzFhZWiAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAAG+iAAA49QAAA5BYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAkoAAAD4QAALbPZGVzYwAAAAAAAAAWSUVDIGh0dHA6Ly93d3cuaWVjLmNoAAAAAAAAAAAAAAAWSUVDIGh0dHA6Ly93d3cuaWVjLmNoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRlc2MAAAAAAAAALklFQyA2MTk2Ni0yLjEgRGVmYXVsdCBSR0IgY29sb3VyIHNwYWNlIC0gc1JHQgAAAAAAAAAAAAAALklFQyA2MTk2Ni0yLjEgRGVmYXVsdCBSR0IgY29sb3VyIHNwYWNlIC0gc1JHQgAAAAAAAAAAAAAAAAAAAAAAAAAAAABkZXNjAAAAAAAAACxSZWZlcmVuY2UgVmlld2luZyBDb25kaXRpb24gaW4gSUVDNjE5NjYtMi4xAAAAAAAAAAAAAAAsUmVmZXJlbmNlIFZpZXdpbmcgQ29uZGl0aW9uIGluIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdmlldwAAAAAAE6T+ABRfLgAQzxQAA+3MAAQTCwADXJ4AAAABWFlaIAAAAAAATAlWAFAAAABXH+dtZWFzAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAACjwAAAAJzaWcgAAAAAENSVCBjdXJ2AAAAAAAABAAAAAAFAAoADwAUABkAHgAjACgALQAyADcAOwBAAEUASgBPAFQAWQBeAGMAaABtAHIAdwB8AIEAhgCLAJAAlQCaAJ8ApACpAK4AsgC3ALwAwQDGAMsA0ADVANsA4ADlAOsA8AD2APsBAQEHAQ0BEwEZAR8BJQErATIBOAE+AUUBTAFSAVkBYAFnAW4BdQF8AYMBiwGSAZoBoQGpAbEBuQHBAckB0QHZAeEB6QHyAfoCAwIMAhQCHQImAi8COAJBAksCVAJdAmcCcQJ6AoQCjgKYAqICrAK2AsECywLVAuAC6wL1AwADCwMWAyEDLQM4A0MDTwNaA2YDcgN+A4oDlgOiA64DugPHA9MD4APsA/kEBgQTBCAELQQ7BEgEVQRjBHEEfgSMBJoEqAS2BMQE0wThBPAE/gUNBRwFKwU6BUkFWAVnBXcFhgWWBaYFtQXFBdUF5QX2BgYGFgYnBjcGSAZZBmoGewaMBp0GrwbABtEG4wb1BwcHGQcrBz0HTwdhB3QHhgeZB6wHvwfSB+UH+AgLCB8IMghGCFoIbgiCCJYIqgi+CNII5wj7CRAJJQk6CU8JZAl5CY8JpAm6Cc8J5Qn7ChEKJwo9ClQKagqBCpgKrgrFCtwK8wsLCyILOQtRC2kLgAuYC7ALyAvhC/kMEgwqDEMMXAx1DI4MpwzADNkM8w0NDSYNQA1aDXQNjg2pDcMN3g34DhMOLg5JDmQOfw6bDrYO0g7uDwkPJQ9BD14Peg+WD7MPzw/sEAkQJhBDEGEQfhCbELkQ1xD1ERMRMRFPEW0RjBGqEckR6BIHEiYSRRJkEoQSoxLDEuMTAxMjE0MTYxODE6QTxRPlFAYUJxRJFGoUixStFM4U8BUSFTQVVhV4FZsVvRXgFgMWJhZJFmwWjxayFtYW+hcdF0EXZReJF64X0hf3GBsYQBhlGIoYrxjVGPoZIBlFGWsZkRm3Gd0aBBoqGlEadxqeGsUa7BsUGzsbYxuKG7Ib2hwCHCocUhx7HKMczBz1HR4dRx1wHZkdwx3sHhYeQB5qHpQevh7pHxMfPh9pH5Qfvx/qIBUgQSBsIJggxCDwIRwhSCF1IaEhziH7IiciVSKCIq8i3SMKIzgjZiOUI8Ij8CQfJE0kfCSrJNolCSU4JWgllyXHJfcmJyZXJocmtyboJxgnSSd6J6sn3CgNKD8ocSiiKNQpBik4KWspnSnQKgIqNSpoKpsqzysCKzYraSudK9EsBSw5LG4soizXLQwtQS12Last4S4WLkwugi63Lu4vJC9aL5Evxy/+MDUwbDCkMNsxEjFKMYIxujHyMioyYzKbMtQzDTNGM38zuDPxNCs0ZTSeNNg1EzVNNYc1wjX9Njc2cjauNuk3JDdgN5w31zgUOFA4jDjIOQU5Qjl/Obw5+To2OnQ6sjrvOy07azuqO+g8JzxlPKQ84z0iPWE9oT3gPiA+YD6gPuA/IT9hP6I/4kAjQGRApkDnQSlBakGsQe5CMEJyQrVC90M6Q31DwEQDREdEikTORRJFVUWaRd5GIkZnRqtG8Ec1R3tHwEgFSEtIkUjXSR1JY0mpSfBKN0p9SsRLDEtTS5pL4kwqTHJMuk0CTUpNk03cTiVObk63TwBPSU+TT91QJ1BxULtRBlFQUZtR5lIxUnxSx1MTU19TqlP2VEJUj1TbVShVdVXCVg9WXFapVvdXRFeSV+BYL1h9WMtZGllpWbhaB1pWWqZa9VtFW5Vb5Vw1XIZc1l0nXXhdyV4aXmxevV8PX2Ffs2AFYFdgqmD8YU9homH1YklinGLwY0Njl2PrZEBklGTpZT1lkmXnZj1mkmboZz1nk2fpaD9olmjsaUNpmmnxakhqn2r3a09rp2v/bFdsr20IbWBtuW4SbmtuxG8eb3hv0XArcIZw4HE6cZVx8HJLcqZzAXNdc7h0FHRwdMx1KHWFdeF2Pnabdvh3VnezeBF4bnjMeSp5iXnnekZ6pXsEe2N7wnwhfIF84X1BfaF+AX5ifsJ/I3+Ef+WAR4CogQqBa4HNgjCCkoL0g1eDuoQdhICE44VHhauGDoZyhteHO4efiASIaYjOiTOJmYn+imSKyoswi5aL/IxjjMqNMY2Yjf+OZo7OjzaPnpAGkG6Q1pE/kaiSEZJ6kuOTTZO2lCCUipT0lV+VyZY0lp+XCpd1l+CYTJi4mSSZkJn8mmia1ZtCm6+cHJyJnPedZJ3SnkCerp8dn4uf+qBpoNihR6G2oiailqMGo3aj5qRWpMelOKWpphqmi6b9p26n4KhSqMSpN6mpqhyqj6sCq3Wr6axcrNCtRK24ri2uoa8Wr4uwALB1sOqxYLHWskuywrM4s660JbSctRO1irYBtnm28Ldot+C4WbjRuUq5wro7urW7LrunvCG8m70VvY++Cr6Evv+/er/1wHDA7MFnwePCX8Lbw1jD1MRRxM7FS8XIxkbGw8dBx7/IPci8yTrJuco4yrfLNsu2zDXMtc01zbXONs62zzfPuNA50LrRPNG+0j/SwdNE08bUSdTL1U7V0dZV1tjXXNfg2GTY6Nls2fHadtr724DcBdyK3RDdlt4c3qLfKd+v4DbgveFE4cziU+Lb42Pj6+Rz5PzlhOYN5pbnH+ep6DLovOlG6dDqW+rl63Dr++yG7RHtnO4o7rTvQO/M8Fjw5fFy8f/yjPMZ86f0NPTC9VD13vZt9vv3ivgZ+Kj5OPnH+lf65/t3/Af8mP0p/br+S/7c/23////AABEIAGQAZAMBEQACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/3QAEAA3/2gAMAwEAAhEDEQA/APy/r+Jz/roCgAoAKACgAoAKACgAoAKACgAoAKAP/9D8v6/ic/66AoAKACgAoAKACgAoAKACgAoAKACgD//R/L+v4nP+ugKACgAoAKACgAoAKACgAoAKACgAoA//0vy/r+Jz/roCgB8aGSRIx1d1QZ6AuwUE47Anmmt16ilJRjKT2hGUnbe0U5O22tk7frsfrz+x3/wRu+O37aH7P3g39onwB8V/g74U8LeNrzxTaaboXjPSPHdz4js28KeJtT8K3r382hajDpjrc3+kXVzaC3jDJaSQLPmXezfd5L4c53n2XUczwmZ5Th6GIlWUKWJw2MqV4exqyoy5pUsTCm+acJSjaOkZRTu05H8W+OH04PD/AMCfErPvDDiLgvjfOc34eo5PWxWZZHmXDtDK8Qs5yjB51QWHp5jllfFx9jhsdQo1va1ZJ141ZU/ctCP07/xDj/tU/wDReP2dP/BF8U//AJbV6v8AxCHiT/oc5H/4RZh/82/Lf8fePyX/AIqf+Ef/AEbjxN/8PHB3/wA52uvl+h+YH7cn7EPi39hH4heDvhh4/wDid8M/H/i/xX4OvvHNxpvw7tfENpL4V0GHWotC0ifxHF4j1C8uRJ4nvf7Q/sJbWGGN4dD1eWV2EKhfjOIuHMXwvjcPl+Ox+AxuJxGFljHHAUq9P6tSjV9jTeJVetVaeKl7T6vy8qaw1d/Zsf1p9H7x8yf6Q3DWe8WcPcI8V8M5Jk2eYbh6jjOJsTlmKp5xmVXAVcxxtHLKmVYDB0bZPh44aWZe2lUnGWZZfGnFe0fP8QzSCG3ubgo8otrW5ujDEAZpltYXuJI4VJCvM0cb+VGzJ5sm2MMGcV8/OXJCc+WU+SEp8kFec+VN8sI/am7Wim43el9T98pQVSrRpOUYe2rUaPPO6p03WqQpRnUaTcaUZTj7SSUnCDc+VqMuX97fh7/wQC/aC+KPgTwb8SPBX7Rv7NeueEfHnhfQfF/hrV7LR/iZcW2o6L4h0y11XT7qKa31mSCQSW90oYxOYw6sEyuK/SsH4WZ7j8Jhsbhc9yCrhsXQpYihVhhMdOFSlWpxnCcZLF2alGSd1ddm9Gf508R/tHvDnhTiDPOF898K/FTL864ezbMMlzXA4jNOEqVfCY/LMXVweKoVaVXJoVITp1aMk41Ep/zWa5TsD/wbj/tUgZ/4Xx+zpwCf+QF8Uv66sB+Z/LFdH/EIeJf+h1kf/hHj/wD5qf5feeN/xU98JP8Ao2/idv8A9Dfg/wC//kUP7rO/lf3fxY/aY+A/iP8AZe+P3xQ/Z58X63oPiTxT8K7/AMO2Gs674Xt9StfDuot4n8Mad4rsH0qHWZp9URYLDU4La7F45f7ZHMY8RFFX4POMoxORZhicsxdahiMRhZQjOthoVKdCftKUK0eSFWdSorQqRjLmk3zRbWj5Y/3d4VeIWWeLfhtwj4nZLl+Y5TlPGOHzbEYHLs3r4TEZnhY5NnGJyTExxlXA0cPhJOrisLOtQdClb6vOCnealOXhteWffBQAUAf/0/y/r+Jz/roCgCe1/wCPm3/67w/+jFprdeqM638Gt/15q/8ApuR/dJ/wQU/5RgfAH/sM/GX/ANXH41r+n/Dr/kksu/6+Y3/1MrH/AD9/tFv+Ut/Ev/sD4G/9YTh4/YDUtQstJ0++1TUrmKy07TbO61DULyd/LgtLGyge5u7md+iQwW8UkkjkgKqk5GBX205xpwlUnJRhCMpzk9FGMVeUm+iSTbP4mw2Hr4vEUMLhaU62JxNalh8PRpxcqlavXqRp0aVOK1c51JKMY63btZ7H+b3+2t+0je/ta/tP/GD49TT3Mmi+M/FMtn4Dtrh7ojT/AIXeEvP8P/Dq2iguY4GthqGjxXXi6eL7NFIl94uvLeZpvsscr/x/n+bTz7PMzziUrwxdfkwaUuaMMtwvNSwCi03F+1pueMlaMZRni5U5c3soyP8AqD8BvC2h4M+EvBPh1GlShmOR5TDEcSVacaN8TxhnipZnxTUnVoyqKs8JjHhsgpz9tOLw+QUa0I0vrE4R+Wkd43SSNikkbpJG45KSRsHRgOhKsobB4OMGvJTtr1Wp+uuMZxlCa5oTjKE47c0JpxnG+65otq61V7o/su/4N9P2nk+I/wCzh4r/AGatev5JfE/7OGs27+FYbmW8mnufg549mvtU8KJDNcoyyw+Etft/EngwolxPLBZaTpM9yYhqECV/QHhLnH1nJcRklaadbJa1sKnPmnLK8U5VMLo7yjHDVViMFHmlKU44eNRv31GP+HH7SPwnlwt4o5R4p5fh4QynxTwNV5vOjDD06dLjrhyGHweeynSoyi6c87y+tlPEXNLD0YVMRmWMo0VN4StM/oGf7jf7rfyr9YP84FuvVH+fB/wV3/5Sdftjf9jD8I//AFTXhSv5c8Qf+Sszf/r7hv8A1CoH/Sd9C7/lEzwN/wCxZx1/632bn50V8Uf0yFABQB//1Py/r+Jz/roCgCe1/wCPm3/67w/+jFprdeqM638Gt/15q/8ApuR/dJ/wQU/5RgfAH/sM/GX/ANXH41r+n/Dr/kksu/6+Y3/1MrH/AD9/tFv+Ut/Ev/sD4G/9YTh4qf8ABcj9pyb4CfsW6/4E8OasdM+IX7R+pf8ACovD81uzC+03wld2sup/FLxFbeTfWM8Mmm+B7TU7GyuUmzHq+qaYqRzySpby8HihnTyvhqpg6FR08ZnlaOWUXB8tSGHmnUzGtTfPT5J0sDCv7KfN7taVO0ZycYSf0AfCin4jeO+W5/muDWL4Z8L8L/rvmdOql9XxmcYevSwnCGVVufDYmlUp43iTEYCpiqM6bU8vw2Mc5U4RnVpfwvSPBFHJKVjs7O1t5JSkaMYbGwsrdpGWOOFGcwWNnAdqRIz+VDhEJwrfzb7kI6KNOnThsrRhTp04/JKEIR7WUV0P+gmMalScIc0sRXrVoU1OcoxqYnFYmtGCc5zcYqrisTVV5TkoqpVvOVryPevjt+zb8V/2cZPhLF8U9EbR5vjL8FvCPxw8LRLZ6hbmz0HxTNLb3PhrV2vIhGnivwpOdLi8R2yNB5Ta/pfl2cQZy3q5plOMyl5fHGUpUpZjlmHzOhGaSkqVdtToztJtV8M3TWIik4Q9tS5akudo/OvDzxS4N8UYcaVOD8esbT4G49zrw/zabxOErLE4/KKcK1DOMDHDvmeS55SjjqmU1ZRnzLK8ap4mpJQR9G/8EvP2m3/ZV/bU+EHjzUb77F4E8X6kvwe+KW//AI9z4L+Il7aadpOr3Gby1jB8JePh4Z1NJ5Y7s2umaj4gZIoo5JrhPR4Ozn+weJsrx0pcmFxNVZVmLekfquOko0KkvejeWHx/1Zwm1NU6VbFe6lOU4/l/0tvCleL/AID8bcP4bDvEcQ5FhXxzwgo/xP7d4Xw9bE5hgqdsPWm1nXC/9sYeVKFTDqvjcBlKlUnKNKjL/QuDB4iysHBQkOpBVgVyrKVJBDAhhgkYPU9a/rM/5rLWlZppqWqe8XfVNbpp6a6/gf58X/BXf/lJ1+2N/wBjD8I//VNeFK/lzxB/5KzN/wDr7hv/AFCoH/Sb9C7/AJRM8Df+xZx1/wCt9m5+dFfFH9MhQAUAf//V/L+v4nP+ugKAJ7X/AI+bf/rvD/6MWmt16ozrfwa3/Xmr/wCm5H90f/BBU4/4Jf8AwBPf+2fjJj3J+MfjUAfiePbvX9P+HX/JJZd/18xv/qZWP+fz9otr9LjxL/7A+Bvu/wBROHvXp5fefzkf8Fqf2oI/2jP22fF2gaBqq6h8Pv2dtPn+Cnhf7NPa3Fjc+LYb221n4u6zBJbozM7eIodC8IyF5yY5/Bl7AIotshl/F/EPO1nXE+JhScZYPJYyyrDTTup4nnhVzScbe44KvDD4W799VsHWg7KKcv8ATj6CHhLLwx8BcmzPMsG8LxL4n4qnx7mqq0q9LEUsjlQrZfwPgakKrhFR/s2rm2e03Gk1Ohn+Erc8uaCh8x/8E8f2Zj+1t+198Hfg1fWP27wbcavL4++KKulvLbp8Lvh3cadq/iGxu4rgsrweK9ZuPDfg2WMwSrPYa7qcBKFlavF4YyX/AFhz/LMqlrh6lSWMzGLimpZbgZU6lem7+644ivPC4SrGSkp0cRVjZWUo/q/0mPFb/iDHgpxvxzhsQ8PntPB0+GuEJQlWp1v9cOKaWMwWWYqhUoq8KuSZbQznPqc+eEqeMy/A1FzKMoy/qK/4L0fsu2vxV/Y/t/jX4c0WKXxh+yvezeMAtla2aXc3wh1eC20b4m6LC7mJltNK0mLTvGMNrHNFEt94TsZju8kI37V4qZJHG8PwzajGMcRw/N4qUuXfLKkVTzKk+VObhCioYuMI6e2wlKTUlHll/kp+zv8AFqtwf42y4DzLHzhkfjBQp5C/b1a7oUuNsHVqY7g/MJwp+0TrYrMZ4jIqladOc/qee4ymnD2nNH+KCa3hcXNldktbXENzY3bREZa2uoZLa4aE/ONxhkdoWG7B2Mp4DL/O04QqRnTmr06kZU5rXWE04yWlmrxbV07rdW0P946VWcXRxFD3atKpRxNBVE7RrUKkK9GNRe67KrCMakb6rmi7rm5v9Ar/AIJOftSv+1Z+xR8MvE2vatHqnxL+HdrJ8H/iyxntZLt/G/gK2ttPOs3cVqkSwf8ACXaC2j+LbXdBB5trrEUqxIrqi/1NwFnss/4awVevKLx+Dvl2ZRTV44vCKMHO13JRxNF0sVSc+WUqNenPlXMkf83n0xPCKPg948cWZRl2CnhOFOJK0ONuCl7OtCiuHOJKlXFU8DRnWc5VXkePWNyLENVa3JicuqwdWcouR/IV/wAFd/8AlJ1+2N/2MPwj/wDVNeFK/D/EH/krM3/6+4b/ANQqB/tV9C7/AJRM8Df+xZx1/wCt9m5+dFfFH9MhQAUAf//W/L+v4nP+ugKAJ7X/AI+bf/rvD/6MWmt16ozrfwa3/Xmr/wCm5H9cf7BX7TFl+yJ/wQO0P46ShJtc8OWvxm0jwHpjedv1v4keLPjT4x8OeA9JT7PDcSqlz4i1Kyku5xC8dpYQ3V7PsgtpJF/f8jzlZB4aPNEoSrUKePhhKU5qmq2NrY2tSwdFTekfaV5wjd3stUnsf4y/SP8ACrEeNP7RrNPD2nKVLA5tiOBMXxDjF7O2X8LZPwBkWa8R49+1q0acpYfKcJiXRpOrCeIxDpYelz1asIH8j17c315d3V5qWo3Gsapd3V3fapq93JJJdaxrGpXlzqetaxcvNJLJ5+s6ze6hqs6s7CKW9aJMRRotfz7FTS/eVHVqylOpWqu961erOVWvWd3Jp1q051XFPli5OMbRUVH/AGZw9LD0KNGhhMLSwGDo0aGHweAoxhCll+BwmHpYPLsvpRpwpx9nl2XYfC4CElFOpDDKrO85ycv6Sf8Aghf8Vv2Mf2ZfA3xf+Lvx4/aQ+CHw7+LnxJ8RweBtB8K+LfH2laT4n8PfC3wIzvbXF/pepRWNzpreN/Fmoa34ltwDdrd6B/wjsgu5Ujhjt/1vwzzPhbI6OZ5jmue5Xgsyx1aOEhhsZi6GHxOGwOCuoKVOc4yUcViKtfF05tN1KFSg/hUD/Lj9oJwd46eK3EXBPBfh54V+IfFHBfCuU1OIMwzjJeF8wx+UZnxhxIofWKeFx2CljKOLjw/kmFyvJazf1d0c0pZtB4eE51JT/p78DfEz4G/tT/DLWtV+G3jjwX8Yfhf4kj1/wVrGreE9YsfEPh7UBLaGw1/RZru1ae3aaO1vdlzAwZgkqkjDAr+24THZXnuCqVcDi8LmWArqrhp1cNVhXoT93kq0+eEpxbSlaSv11P8AJziDhXj7wl4pweB4q4fz7gni3K5ZfneEwOdYDFZVmmFcayxOXY6FCvCnWjCVWipUqiUbuL25fe/zsv2p/gBrX7LX7Qvxc+AOtRyj/hWPjLUNF8PXUzSO2r/D6/8A+Jz8M9cSWWzsfPF94KvNM0+7mjjnQ67omuQm7uZYJZX/AJIzbKp5FmuYZLPmvl2JlSouStz4Gp+9y+pHROcfqkqdGVS3vV6FePNOUJyP+mjwi8SMF4veGnBfiRgZQvxZkeHx+aUYckVguJ8M/qHF+AlThXxDpOhxDRxWNoU5ypyWWZpllRYehTqwpw/WL/ggV+1D/wAKl/am1j4A+INQkh8H/tMaGbTRI5pLtrOy+L/w+0y61HQGVFWW3tpPFvgSHWNFeV2tYpLrwho1uPPvNRRK+78Lc5ll/EFbLKk0sLnlH92pSso5pg4XpcsXdylisFGpCXLyqH1KDd3O5/HP7Rnwl/1y8JMD4kZbhoTzrwpx/tMxlCOHhXxHBHE+NpYbME5PkrVlkfE1XB46EIxxM1R4jx1T91hsFJx+NP8Agrv/AMpOv2xv+xh+Ef8A6prwp/n/APVXleIP/JWZv/19w3/qFQP3T6F3/KJngb/2LOOv/W+zc/Oivij+mQoAKAP/1/y/r+Jz/roCgCa3ZUngZjhVmiZieyhwWPGTwATwOfemt16oiqnKlVjFXlKlUjFd5ShJJfNtLyPtP4lftIJqv7Bf7FP7I/h/WUurX4ZXnxg+LXxZsrbztkXj7xX8QNZuPhn4YvybgRGTwl4V8Sa3rk1vJbzH+1P7Dvt9u4gD+9j82rYjhvhjJJTvHCSzPNcwguW0cZWxtT+zcJPltCrHB4evWm5xi+avRoV3KE0lP8L4X8L5YT6Rvj7405ll86FTiulwTwVwViK3s71eG8n4ZwNDi7OcLH2POo51m+TZfltKtCpBfUq2aYbkrJ1XD4mrwD93JUnmjXbHIyLkkhTjJPc8DJwPU8cccU7vbp/X4+f3ESp05vmlCMpWSvLVpLZLXS2+il6aWl/Qr/wQD/a98NfCD4o/GD4B/EzxZovhPwR8VtFtvil4Y1zxPqukaFoWn/EfwZBpnhjxPplxqepXdnHFdeLfB0nhvULBGD/a7nwzri+dvSCKv1Lwrz2llmZZlleMrQoYTM6UcwoVq06dKjTx2EhRwuIpSqT5IqWJwqw06MfelOWGxN5e7CJ/mr+0d8F804z4S4I8SOFsox2bZ5wdjqvB2bYDK8JjsxzDEcL57Wxuc5Ni6eFwtCtejkuexznCYqanH2NLNsqtStOpVOs/4OAfB3wa8ca78G/2n/hP8Svhr4u1qW3n+C3xR0nwj4x0HX9YnsXefxD8NPFNzY6Vq9zM9to+prrvhW7u2sX8iLxXZyy3MFpZXDNv4q4fAYjEZZnuX4vCYipKM8qzCnhq9KtVcJXr4HFSjSlOTp4eoq+Hm+S0Y4z2kp06dKo5eJ+zf4g41yHBcc+EnF/DHE+T4FTp8e8J4zOMlx+AwVLE0o08r4tyilXxeCpwVXMMDPL85pUliqftJ5DVpU6VfE4mjy/zs+E/GPiX4e+J/Dfj/wAF3jaf4y8B6/o/jjwffKHza+KfCd7FrWiBwk9rI1rf3Np/Y2pRi5gE2lanfQSSCOVxX5MqtfDTpYrCvlxmCq08Zg5bNYrCy9rRi3eNoVZL2FZKUOehVq03NRk3H/TfOMjyribKc14Zz6j9ZyLiPLcdw7nuH929XJ87oSy/MJQc6VaMa+EpVlmODqOlUdLHYHC1YU5ThE+nf2+fjD4V/aF/bF+NPx38EX0V94Y+K9l8I/EVmke/fo+qaf8AC7QvDninw1dBySt9oXiLSL6O6Rtrxm6SF1LROa93ijMo5txBmWY0Zc+FxiwGIoO0U6UvqFGjiMLJJKTlRr0ZTc53v7b2cdKVz8n+jlwVnXhr4G8A+HfEOEqYTN+DMRxxleJ53Fxx2FxvGGNzjKM3oOKSeGzHLMbRdCcXKFRYd1I2jOKPkKvBP2kKACgD/9D8v6/ic/66AoAKAFyeBk4HT278enPP+TQH66vz/pf1sJQAUAMkihmQx3FvbXUTEFoby1tr23YqcqWt7uKaB2U8ozRlkPKYJJWZwhUi4VIQqQlvCpCM4uzTV4yTi7NJq+zV001eN06lSlJTpVa1GaulUoV62HqpPdRq4epSqxUlpJKaUlo7pWjDFZWEDiS30zSbSUBgJrLSNLsZwrDay+fZWcExRhwyF9jdwcfLEMPh6T5qVChSk005UqNKnJxbTs5QhFtXSdtVdJtRtFS0nisXVjyVsZj68Lp+zxOYY7FU7p3T9licVWpqSdnGahzR6NXfNZrUwFJJ6kk8Dk54HQd+g4H9OlAf194lABQAUAf/0fy/r+Jz/roCgAoAKACgAoAKACgAoAKACgAoAKAP/9L8v6/ic/66AoAKACgAoAKACgAoAKACgAoAKACgD//T/L+v4nP+ugKACgAoAKACgAoAKACgAoAKACgAoA//2Q==</data> + <data key="name" unique="suffix">adobe_base_</data> + </entity> + <entity name="downloadableSampleLink_TestImage" type="sample_file_content"> + <data key="file_data">/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDIBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAGAAYAMBIgACEQEDEQH/xACXAAEBAAMBAQEBAAAAAAAAAAAABgMEBQgCAQcQAAEDAQUFBgQDCQAAAAAAAAABAgMEBQYRFpESMTZV0QchcnOzwhMUIkEygaE1QlFSYXGCsbIBAAEFAQAAAAAAAAAAAAAAAAACAwQGBwERAAECAwMLBAMBAAAAAAAAAAEAAgMEERMhkRQxMzRBUVJTcXKxBRJhoSKBwUL/2gAMAwEAAhEDEQA/AP7+AYKysp7Po5aurlbFBEmL3u3NQ6ASaBdArcFnBN5/urzqn0d0Gf7q86p9HdCRkUzy3YFOWEXhOCpATef7q86p9HdBn+6vOqfR3QMimeW7AosIvCcFSAm8/wB1edU+jugz/dXnVPo7oGRTPLdgUWEXhOCpATef7q86p9HdBn+6vOqfR3QMimeW7AosIvCcFSA1bPtGktWiZWUM7Z6d6qjZG7lwXBf1Q2iO5paaOFCmyCDQoTd/uBLX8n3IUhN3+4EtfyfchIk9Zh9w8pyBpW9QvN4Bwbcsujis+pq2Q4Tq5HbW0u9XJj3Y4fc0ibjPgQjEY0GgJNTS4brj/FaIz3Q2FwFafNP4V3gc1aWz7FY+rjhVrsNjBrlcrsV3Iir/ABPxtqzRyM+boJKeJ7kakm2jkRV3Yom4TlbYf4xrnfFSBuqaCn7ouWwbc+4/FT90XTBz57RlbVvpqWjdUSRoiyfWjUbju71MUlqSyWdVPjpnsqIUVJI3ORFZ3fix+4OnoLSRU3V2HZnANKEjcEGOwVG74OxdUGjZM1RNQROqIlYuw3Zcr9pXpgn1f0xN4kQYgiww8bU4xwe0OG1eg+y7gCg8cvqOLEjuy7gCg8cvqOLEzT1HXIvcfKq0zpn9ShN3+4EtfyfchSE3f7gS1/J9yCJPWYfcPKTA0reoXm85l4P2HUf4/wDSHTPmSOOZiskY17F3tcmKKaXMwjGgvhj/AECMQrTFZ72ObvC5lvxq+gjeivRsUzXvVn4kb34qmpozxWc+NjVtWtqPiOREjbMj1Vf7YFHvMMdLTxP244ImP/maxEUhzMhaxC8UvABrXZuoR9pmLL+9xddfvXNrfkVtJyPqJaOpRiL8VHbKPT8+5THFVS1FnWnE+VKhsUbmsmamG3i1e78jsSwQzoiTRRyIm5HtRf8AZ9MjZGxGMY1rU/damCHTJPMQuDgAa5q31G0VpdnrnuRYO9xNaA1+/r9rUsmeGazqdscrHuZExHo1cVauH30U3THFBDBtfBijj2t+w1Ex0MhMgMcyG1r843J+GC1oDs69B9l3AFB45fUcWJHdl3AFB45fUcWJm3qOuRe4+VV5nTP6lCbv9wJa/k+5CkJu/wBwJa/k+5BEnrMPuHlJgaVvULzeADUlbUAAIQAAhAACF6D7LuAKDxy+o4sSO7LuAKDxy+o4sTMPUdci9x8qqTOmf1KE3f7gS1/J9yFITd/uBLX8n3IIk9Zh9w8pMDSt6hebwAakragABCAAEIAAQvQfZdwBQeOX1HFiR3ZdwBQeOX1HFiZh6jrkXuPlVSZ0z+pQwVlHT2hRy0lXE2WCVMHsduchnBEBINQmQaXhTeQLq8lp9XdRkC6vJafV3UpASMtmeY7Epy3i8RxU3kC6vJafV3UZAuryWn1d1KQBlszzHYlFvF4jipvIF1eS0+ruoyBdXktPq7qUgDLZnmOxKLeLxHFTeQLq8lp9XdRkC6vJafV3UpAGWzPMdiUW8XiOK1bPs6ksqiZR0MDYKdiqrY27kxXFf1U2gCO5xcauNSmySTUr/9k=</data> + <data key="name" unique="suffix">test_image_</data> + </entity> + + <!-- Other --> + <entity name="downloadableData" type="downloadable_data"> + <data key="link_title">Downloadable Links</data> + <data key="sample_title">Downloadable Samples</data> </entity> </entities> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Section/AdminProductDownloadableSection.xml b/app/code/Magento/Downloadable/Test/Mftf/Section/AdminProductDownloadableSection.xml index 074ed55781103..fc21578f6c5ea 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Section/AdminProductDownloadableSection.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Section/AdminProductDownloadableSection.xml @@ -31,7 +31,9 @@ <element name="addLinkFileUrlInput" type="input" selector="input[name='downloadable[link][{{var1}}][link_url]']" parameterized="true" /> <element name="addLinkSampleUploadFile" type="file" selector="div[data-index='container_links'] tr[data-repeat-index='{{var1}}'] fieldset[data-index='container_sample'] input[type='file']" parameterized="true" /> <element name="addLinkSampleUrlInput" type="input" selector="input[name='downloadable[link][{{var1}}][sample][url]']" parameterized="true" /> - + <element name="linkFileNameOrUrl" type="text" parameterized="true" selector="//div[@data-index='container_links']//tr[@data-repeat-index='{{index}}']//fieldset[@data-index='container_file']//div[@class='file-uploader-filename']//a|//input[@name='downloadable[link][{{index}}][link_url]']"/> + <element name="linkSampleFileNameOrUrl" type="text" parameterized="true" selector="//div[@data-index='container_links']//tr[@data-repeat-index='{{index}}']//fieldset[@data-index='container_sample']//div[@class='file-uploader-filename']//a|//input[@name='downloadable[link][{{index}}][sample][url]']"/> + <element name="samplesTitleInput" type="input" selector="input[name='product[samples_title]']"/> <element name="samplesAddLinkButton" type="button" selector="div[data-index='container_samples'] button[data-action='add_new_row']" /> @@ -41,5 +43,6 @@ <element name="addSampleRemoveRowButton" type="button" selector="div[data-index='container_links'] tr[data-repeat-index='{{var1}}'] button[data-action='remove_row']" parameterized="true" /> <element name="addSampleFileUploadFile" type="file" selector="div[data-index='container_samples'] tr[data-repeat-index='{{var1}}'] input[type='file']" parameterized="true" /> <element name="addSampleFileUrlInput" type="input" selector="input[name='downloadable[sample][{{var1}}][sample_url]']" parameterized="true" /> + <element name="sampleFileNameOrUrl" type="text" parameterized="true" selector="//div[@data-index='sample']//tr[@data-repeat-index='{{index}}']//fieldset[@data-index='container_sample']//div[@class='file-uploader-filename']//a|//input[@name='downloadable[sample][{{index}}][sample_url]']"/> </section> </sections> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontCustomerDownloadableProductsSection.xml b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontCustomerDownloadableProductsSection.xml index 5d340e6c91060..07968d5581e67 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontCustomerDownloadableProductsSection.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontCustomerDownloadableProductsSection.xml @@ -11,5 +11,6 @@ <section name="StorefrontCustomerDownloadableProductsSection"> <element name="productName" type="text" selector="//table[@id='my-downloadable-products-table']//strong[contains(@class, 'product-name') and normalize-space(.)='{{productName}}']" parameterized="true"/> <element name="downloadableLink" type="button" selector="//table[@id='my-downloadable-products-table']//a[contains(@class, 'download')]"/> + <element name="downloadableLinkByOrderNumber" type="button" parameterized="true" selector="//table[@id='my-downloadable-products-table']//td[@data-th='Order #']//a[contains(.,'{{orderNumber}}')]/ancestor::tr//a[contains(@class, 'download')]"/> </section> </sections> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableLinkSection.xml b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableLinkSection.xml index 6364600faee30..e900ffe2f50a5 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableLinkSection.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableLinkSection.xml @@ -11,5 +11,8 @@ <section name="StorefrontDownloadableLinkSection"> <element name="downloadedImage" type="text" selector="//img[contains(@style, '-webkit-user-select')]"/> <element name="downloadedSvg" type="text" selector="//*[@id='{{id}}']" parameterized="true"/> + <element name="downloadableLinkTitle" type="text" parameterized="true" selector="//*[name()='title'][contains(.,'{{title}}')]"/> + <element name="downloadableLinkImage" type="text" selector="body>img"/> + <element name="downloadableLinkSvg" type="text" selector="svg"/> </section> </sections> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableProductSection.xml b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableProductSection.xml index dc2a58be138e7..7a23822dc27a0 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableProductSection.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontDownloadableProductSection.xml @@ -13,8 +13,10 @@ <element name="downloadableLinkLabel" type="text" selector="//label[contains(., '{{title}}')]" parameterized="true" timeout="30"/> <element name="downloadableLinkByTitle" type="input" selector="//*[@id='downloadable-links-list']/*[contains(.,'{{title}}')]//input" parameterized="true" timeout="30"/> <element name="downloadableLinkSampleByTitle" type="text" selector="//label[contains(., '{{title}}')]/a[contains(@class, 'sample link')]" parameterized="true"/> - <element name="downloadableSampleLabel" type="text" selector="//a[contains(.,normalize-space('{{title}}'))]" parameterized="true" timeout="30"/> + <element name="downloadableSampleLabel" type="text" selector="//dl[contains(@class,'samples')]//a[contains(.,normalize-space('{{title}}'))]" parameterized="true" timeout="30"/> <element name="downloadableLinkSelectAllCheckbox" type="checkbox" selector="#links_all" /> <element name="downloadableLinkSelectAllLabel" type="text" selector="label[for='links_all']" /> + <element name="downloadableLinksListSection" type="text" selector="#downloadable-links-list" timeout="30"/> + <element name="downloadableSamplesListSection" type="text" selector=".items.samples" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml index 44cc15272ff64..e1007477d60d1 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml @@ -61,7 +61,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml index 650cfd5ba8198..74f30eac78b7e 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml @@ -57,7 +57,7 @@ <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{DownloadableProduct.name}}"/> + <argument name="productUrl" value="{{DownloadableProduct.urlKey}}"/> </actionGroup> <!-- Assert product design settings "layout 1 column" --> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml index 7685017adc426..d5c317d7f7edf 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml @@ -90,7 +90,7 @@ <magentoCLI stepKey="runCronIndex" command="cron:run --group=index"/> <!-- Go to storefront category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <!-- Assert product in storefront category page --> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml index 43f2f07b83cde..b2878cfd3f86a 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml @@ -24,9 +24,7 @@ <!-- Create category --> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> @@ -77,9 +75,7 @@ <!-- Save product --> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Find downloadable product in grid --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPage"/> @@ -94,7 +90,7 @@ <seeElement selector="{{AdminProductDownloadableSection.addLinkTitleInput('1')}}" stepKey="seeSecondLinkTitle"/> <!-- Go to storefront category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <!-- Assert product in storefront category page --> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml index e7e00d2fb81ef..72dc6196ed56d 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml @@ -71,7 +71,7 @@ <magentoCron stepKey="runIndexCronJobs" groups="index"/> <!-- Assert product in storefront category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> <actionGroup ref="StorefrontCheckProductPriceInCategoryActionGroup" stepKey="StorefrontCheckCategorySimpleProduct"> <argument name="product" value="DownloadableProduct"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml index e04b53ff208af..6e7a1a65572ab 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml @@ -41,7 +41,7 @@ </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.name$$)}}" stepKey="amOnDownloadableProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="amOnDownloadableProductPage"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> @@ -51,7 +51,7 @@ <dontSee userInput="$$createDownloadableProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <!-- Should not see the product --> <dontSee userInput="$$createDownloadableProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml index 44c27c17adcd9..1baca344d3e30 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml @@ -35,6 +35,6 @@ </actionGroup> <!--Checking content storefront--> - <amOnPage url="{{DownloadableProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{DownloadableProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml index 27d505e070f5b..a4a03fc4baa03 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml @@ -37,6 +37,6 @@ <magentoCLI command="cron:run --group=index" stepKey="runCronIndexer"/> <!--See related product in storefront--> - <amOnPage url="{{DownloadableProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{DownloadableProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml index 0237eca61b784..b0ee5074e0a7c 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml @@ -66,7 +66,7 @@ <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearDownloadableProductFilters"/> <!--Assert downloadable product on storefront--> <comment userInput="Assert downloadable product on storefront" stepKey="commentAssertDownloadableProductOnStorefront"/> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="openDownloadableProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="openDownloadableProductPage"/> <waitForPageLoad stepKey="waitForStorefrontDownloadableProductPageLoad"/> <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertDownloadableProductInStock"/> <scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkBlock}}" stepKey="scrollToLinksInStorefront"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAdvanceCatalogSearchDownloadableBySkuWithHyphenTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAdvanceCatalogSearchDownloadableBySkuWithHyphenTest.xml index 5f7e9970c27e3..3e23c5f32660a 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAdvanceCatalogSearchDownloadableBySkuWithHyphenTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAdvanceCatalogSearchDownloadableBySkuWithHyphenTest.xml @@ -15,12 +15,9 @@ <title value="Guest customer should be able to advance search Downloadable product with product sku that contains hyphen"/> <description value="Guest customer should be able to advance search Downloadable product with product that contains hyphen"/> <severity value="MAJOR"/> - <testCaseId value="MC-252"/> + <testCaseId value="MC-28818"/> <group value="Downloadable"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> <magentoCLI command="downloadable:domains:add example.com static.magento.com" before="product" stepKey="addDownloadableDomain"/> @@ -36,4 +33,4 @@ <magentoCLI command="downloadable:domains:remove example.com static.magento.com" stepKey="removeDownloadableDomain"/> </after> </test> - </tests> + </tests> \ No newline at end of file diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontVerifySecureURLRedirectDownloadableTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontVerifySecureURLRedirectDownloadableTest.xml index 5f89db581a7c1..4ba8ef1b7fe20 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontVerifySecureURLRedirectDownloadableTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontVerifySecureURLRedirectDownloadableTest.xml @@ -28,15 +28,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> </after> <executeJS function="return window.location.host" stepKey="hostname"/> diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php index c8c363536a2fa..268339b937498 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php @@ -13,6 +13,7 @@ use Magento\Downloadable\Model\Link\PurchasedFactory; use Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\Collection; use Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory; +use Magento\Framework\DataObject; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Sales\Model\Order\Item; use PHPUnit\Framework\MockObject\MockObject; @@ -55,22 +56,29 @@ protected function setUp(): void ->setMethods(['create']) ->getMock(); + $purchasedLink = new \Magento\Downloadable\Model\Sales\Order\Link\Purchased( + $this->purchasedFactory, + $this->itemsFactory + ); + $this->block = $objectManager->getObject( Downloadable::class, [ 'context' => $contextMock, - 'purchasedFactory' => $this->purchasedFactory, - 'itemsFactory' => $this->itemsFactory + 'purchasedLink' => $purchasedLink ] ); } public function testGetLinks() { - $item = $this->getMockBuilder(Item::class) + $orderItem = $item = $this->getMockBuilder(Item::class) ->disableOriginalConstructor() - ->setMethods(['getOrderItemId']) + ->onlyMethods(['getId']) ->getMock(); + $orderItem->method('getId') + ->willReturn(1); + $item = new DataObject(['order_item' => $orderItem]); $linkPurchased = $this->getMockBuilder(Purchased::class) ->disableOriginalConstructor() ->setMethods(['load']) @@ -83,12 +91,11 @@ public function testGetLinks() $this->block->setData('item', $item); $this->purchasedFactory->expects($this->once())->method('create')->willReturn($linkPurchased); - $linkPurchased->expects($this->once())->method('load')->with('orderItemId', 'order_item_id')->willReturnSelf(); - $item->expects($this->any())->method('getOrderItemId')->willReturn('orderItemId'); + $linkPurchased->expects($this->once())->method('load')->with(1, 'order_item_id')->willReturnSelf(); $this->itemsFactory->expects($this->once())->method('create')->willReturn($itemCollection); $itemCollection->expects($this->once()) ->method('addFieldToFilter') - ->with('order_item_id', 'orderItemId') + ->with('order_item_id', 1) ->willReturnSelf(); $this->assertEquals($linkPurchased, $this->block->getLinks()); diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php index ffcf50c77c78f..0925648f6ffa1 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php @@ -55,12 +55,16 @@ protected function setUp(): void ->setMethods(['create']) ->getMock(); + $purchasedLink = new \Magento\Downloadable\Model\Sales\Order\Link\Purchased( + $this->purchasedFactory, + $this->itemsFactory + ); + $this->block = $objectManager->getObject( Downloadable::class, [ 'context' => $contextMock, - 'purchasedFactory' => $this->purchasedFactory, - 'itemsFactory' => $this->itemsFactory + 'purchasedLink' => $purchasedLink ] ); } diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php index 812f6697b43f7..20dfa624f43f4 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php @@ -55,12 +55,15 @@ protected function setUp(): void ->setMethods(['create']) ->getMock(); + $purchasedLink = new \Magento\Downloadable\Model\Sales\Order\Link\Purchased( + $this->purchasedFactory, + $this->itemsFactory + ); $this->block = $objectManager->getObject( Downloadable::class, [ 'context' => $contextMock, - 'purchasedFactory' => $this->purchasedFactory, - 'itemsFactory' => $this->itemsFactory + 'purchasedLink' => $purchasedLink ] ); } diff --git a/app/code/Magento/Downloadable/Test/Unit/Model/Sales/Order/Link/PurchasedTest.php b/app/code/Magento/Downloadable/Test/Unit/Model/Sales/Order/Link/PurchasedTest.php new file mode 100644 index 0000000000000..6a4bd6ba3dfe8 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Unit/Model/Sales/Order/Link/PurchasedTest.php @@ -0,0 +1,148 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Downloadable\Test\Unit\Model\Sales\Order\Link; + +use Magento\Downloadable\Model\Link\Purchased as PurchasedEntity; +use Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\Collection; +use Magento\Downloadable\Model\Sales\Order\Link\Purchased; +use Magento\Framework\DataObject; +use Magento\Sales\Model\Order\Item; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Magento\Downloadable\Model\Link\PurchasedFactory; +use Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\CollectionFactory; + +/** + * Test order purchased link resolver + */ +class PurchasedTest extends TestCase +{ + /** + * @var PurchasedFactory|MockObject + */ + private $linkPurchasedFactory; + /** + * @var CollectionFactory|MockObject + */ + private $linkPurchasedItemCollectionFactory; + /** + * @var Purchased + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->linkPurchasedFactory = $this->getMockBuilder(PurchasedFactory::class) + ->disableOriginalConstructor() + ->onlyMethods(['create']) + ->getMock(); + $this->linkPurchasedItemCollectionFactory = $this->getMockBuilder(CollectionFactory::class) + ->disableOriginalConstructor() + ->onlyMethods(['create']) + ->getMock(); + + $this->model = new Purchased( + $this->linkPurchasedFactory, + $this->linkPurchasedItemCollectionFactory + ); + } + + /** + * @param bool $hasChildItem + * @param int $expectedItemId + * @param array $itemData + * @param array $childItemData + * @dataProvider getLinkDataProvider + */ + public function testGetLink( + bool $hasChildItem, + int $expectedItemId, + array $itemData, + array $childItemData = [] + ): void { + /** @var Item $orderItem */ + $orderItem = $this->getMockBuilder(Item::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $orderItem->addData($itemData); + /** @var Item $childOrderItem */ + $childOrderItem = $this->getMockBuilder(Item::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $childOrderItem->addData($childItemData); + if ($hasChildItem) { + $orderItem->addChildItem($childOrderItem); + } + $linkPurchased = $this->getMockBuilder(PurchasedEntity::class) + ->disableOriginalConstructor() + ->onlyMethods(['load']) + ->getMock(); + $itemCollection = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->onlyMethods(['addFieldToFilter']) + ->getMock(); + $this->linkPurchasedFactory->method('create') + ->willReturn($linkPurchased); + $linkPurchased->method('load') + ->with($expectedItemId, 'order_item_id') + ->willReturnSelf(); + $this->linkPurchasedItemCollectionFactory->method('create') + ->willReturn($itemCollection); + $itemCollection->method('addFieldToFilter') + ->with('order_item_id', $expectedItemId) + ->willReturnSelf(); + + $this->assertEquals($linkPurchased, $this->model->getLink($orderItem)); + $this->assertEquals($linkPurchased, $this->model->getLink(new DataObject(['order_item' => $orderItem]))); + } + + /** + * @return array[] + */ + public function getLinkDataProvider(): array + { + return [ + [ + false, + 1, + [ + 'id' => 1, + 'product_type' => 'downloadable' + ], + ], + [ + true, + 2, + [ + 'id' => 1, + 'product_type' => 'configurable' + ], + [ + 'id' => 2, + 'product_type' => 'downloadable' + ], + ], + [ + true, + 1, + [ + 'id' => 1, + 'product_type' => 'configurable' + ], + [ + 'id' => 2, + 'product_type' => 'virtual' + ], + ] + ]; + } +} diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml index 699b384a8cdaa..478f27fd792e8 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable.phtml @@ -5,6 +5,7 @@ */ // @deprecated +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <?php diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml index 747ada71221f9..c57e0c99a4c0e 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml @@ -5,8 +5,7 @@ */ // @deprecated -?> -<?php +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** * @var $block \Magento\Downloadable\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable\Links diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml index c4f7ffa51f895..6dc5d1e49a8a5 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml @@ -5,8 +5,8 @@ */ // @deprecated -?> -<?php +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound + /** * @var $block \Magento\Downloadable\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable\Links */ diff --git a/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml b/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml index ba6d9e0abec71..e5397e758d63f 100644 --- a/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml +++ b/app/code/Magento/Downloadable/view/frontend/templates/catalog/product/type.phtml @@ -12,7 +12,7 @@ ?> <?php $_product = $block->getProduct() ?> -<?php if ($_product->getIsSalable()) : ?> +<?php if ($_product->isAvailable()) : ?> <div class="stock available" title="<?= $block->escapeHtmlAttr(__('Availability')) ?>"> <span><?= $block->escapeHtml(__('In stock')) ?></span> </div> diff --git a/app/code/Magento/Downloadable/view/frontend/web/js/downloadable.js b/app/code/Magento/Downloadable/view/frontend/web/js/downloadable.js index 8bdea0b3a70b6..a44ec1043ea7e 100644 --- a/app/code/Magento/Downloadable/view/frontend/web/js/downloadable.js +++ b/app/code/Magento/Downloadable/view/frontend/web/js/downloadable.js @@ -17,7 +17,19 @@ define([ */ $.widget('mage.downloadable', { options: { - priceHolderSelector: '.price-box' + priceHolderSelector: '.price-box', + linkElement: '', + allElements: '' + }, + + /** + * @inheritdoc + */ + _init: function initLinks() { + var element = this.element, + options = $(this.options.linkElement, element); + + options.trigger('change'); }, /** diff --git a/app/code/Magento/DownloadableGraphQl/etc/graphql/di.xml b/app/code/Magento/DownloadableGraphQl/etc/graphql/di.xml index d752b3f135278..7dae7856a3bdb 100644 --- a/app/code/Magento/DownloadableGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/DownloadableGraphQl/etc/graphql/di.xml @@ -67,4 +67,11 @@ </argument> </arguments> </type> + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="downloadable_product_type_resolver" xsi:type="object">Magento\DownloadableGraphQl\Model\DownloadableProductTypeResolver</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls b/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls index d8e9c9615b618..1c552dc858e92 100644 --- a/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls +++ b/app/code/Magento/DownloadableGraphQl/etc/schema.graphqls @@ -25,12 +25,12 @@ type AddDownloadableProductsToCartOutput { } type DownloadableCartItem implements CartItemInterface @doc(description: "Downloadable Cart Item") { - customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") + customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") links: [DownloadableProductLinks] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\DownloadableCartItem\\Links") @doc(description: "An array containing information about the links for the added to cart downloadable product") samples: [DownloadableProductSamples] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\DownloadableCartItem\\Samples") @doc(description: "DownloadableProductSamples defines characteristics of a downloadable product") } -type DownloadableProduct implements ProductInterface, CustomizableProductInterface @doc(description: "DownloadableProduct defines a product that the customer downloads") { +type DownloadableProduct implements ProductInterface, RoutableInterface, CustomizableProductInterface @doc(description: "DownloadableProduct defines a product that the shopper downloads") { downloadable_product_samples: [DownloadableProductSamples] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\Samples") @doc(description: "An array containing information about samples of this downloadable product.") downloadable_product_links: [DownloadableProductLinks] @resolver(class: "Magento\\DownloadableGraphQl\\Resolver\\Product\\Links") @doc(description: "An array containing information about the links for this downloadable product") links_purchased_separately: Int @doc(description: "A value of 1 indicates that each link in the array must be purchased separately") diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 0000000000000..2392efab81ce0 --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Categories --> + <entity name="ImportCategory_Downloadable_UrlLinks" type="category"> + <data key="name">import-category-downloadable-url-links</data> + <data key="name_lwr">import-category-downloadable-url-links</data> + <data key="is_active">true</data> + <data key="include_in_menu">true</data> + <data key="urlKey">import-category-downloadable-url-links</data> + </entity> + <entity name="ImportCategory_Downloadable_FileLinks" type="category"> + <data key="name">import-category-downloadable-file-links</data> + <data key="name_lwr">import-category-downloadable-file-links</data> + <data key="is_active">true</data> + <data key="include_in_menu">true</data> + <data key="urlKey">import-category-downloadable-file-links</data> + </entity> + + <!-- Products --> + <entity name="ImportProduct_Downloadable_UrlLinks" type="product"> + <data key="fileName">import_downloadable_product_url_links.csv</data> + <data key="importSummary">Created: 1, Updated: 0, Deleted: 0</data> + <data key="sku">import-product-downloadable-url-links</data> + <data key="type_id">downloadable</data> + <data key="attribute_set_id">4</data> + <data key="name">import-product-downloadable-url-links</data> + <data key="price">99.00</data> + <data key="quantity">100</data> + <data key="weight"/> + <data key="visibilityText">Catalog, Search</data> + <data key="status">1</data> + <data key="urlKey">import-product-downloadable-url-links</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <data key="linksTitle">Links</data> + <data key="linkTitle">Link1</data> + <data key="linkPrice">2.00</data> + <data key="totalPriceWithLink">101.00</data> + <data key="linkFileType">URL</data> + <data key="linkFileUrl">https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg</data> + <data key="linkFileName">magento-logo</data> + <data key="linkSampleFileType">URL</data> + <data key="linkSampleFileUrl">https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg</data> + <data key="linkSampleFileName">magento-logo</data> + <data key="linkShareable">Yes</data> + <data key="linkMaxDownloads">0</data> + <data key="samplesTitle">Samples</data> + <data key="sampleTitle">Sample1</data> + <data key="sampleFileType">URL</data> + <data key="sampleFileUrl">https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg</data> + <data key="sampleFileName">magento-logo</data> + </entity> + <entity name="ImportProduct_Downloadable_FileLinks" type="product"> + <data key="fileName">import_downloadable_product_file_links.csv</data> + <data key="importSummary">Created: 1, Updated: 0, Deleted: 0</data> + <data key="name">import-product-downloadable-file-links</data> + <data key="sku">import-product-downloadable-file-links</data> + <data key="type_id">downloadable</data> + <data key="attribute_set_id">4</data> + <data key="price">100.00</data> + <data key="quantity">100</data> + <data key="weight"/> + <data key="visibilityText">Catalog, Search</data> + <data key="status">1</data> + <data key="urlKey">import-product-downloadable-file-links</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <data key="linksTitle">Links</data> + <data key="linkTitle">Link1</data> + <data key="linkPrice">3.00</data> + <data key="totalPriceWithLink">103.00</data> + <data key="linkFileType">Upload File</data> + <data key="linkFileName">m-logo</data> + <data key="linkSampleFileType">Upload File</data> + <data key="linkSampleFileName">magento-logo</data> + <data key="linkShareable">No</data> + <data key="linkMaxDownloads">0</data> + <data key="samplesTitle">Samples</data> + <data key="sampleTitle">Sample1</data> + <data key="sampleFileType">Upload File</data> + <data key="sampleFileName">adobe-base</data> + </entity> +</entities> diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithFileLinksTest.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithFileLinksTest.xml new file mode 100644 index 0000000000000..e1e6d6c98f5fc --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithFileLinksTest.xml @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminExportDownloadableProductWithFileLinksTest"> + <annotations> + <features value="DownloadableImportExport"/> + <stories value="Export Products"/> + <title value="Export Downloadable Products with File Links"/> + <description value="Verifies that a user can export a Downloadable product with downloadable and sample file + links. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the downloadable product row should be in the + export), the correct downloadable link with files, and the correct downloadable sample links with files. + Note that MFTF cannot simply download a file and have access to it due to the test not having access to the + server that is running the test browser. Therefore, this test verifies that the Download button can be + successfully clicked, grabs the request URL from the Download button, executes the request on the magento + machine via a curl request, and verifies the contents of the downloaded file"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="Downloadable"/> + </annotations> + + <before> + <!-- Create Category, Create Downloadable Product --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="ApiDownloadableProduct" stepKey="createProduct"/> + <createData entity="downloadableLink_Files" stepKey="addDownloadableLink"> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="downloadableSample_File2" stepKey="addDownloadableSamples"> + <requiredEntity createDataKey="createProduct"/> + </createData> + <magentoCron groups="index" stepKey="runCronIndex"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Delete Data --> + <deleteData createDataKey="createProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> + <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> + <argument name="attribute" value="sku"/> + <argument name="attributeData" value="$$createProduct.sku$$"/> + </actionGroup> + + <!-- Start Message Queue for Export Consumer --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> + <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> + </actionGroup> + <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> + <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> + + <!-- Validate Export File on File System --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableLink"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_file=/a/d/$addDownloadableLink.link[sample_file_content][name]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,is_shareable=$addDownloadableLink.link[is_shareable]$,link_type=$addDownloadableLink.link[link_type]$,link_file=/m/a/$addDownloadableLink.link[link_file_content][name]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableSampleLink"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableSamples.sample[title]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_file=/t/e/$addDownloadableSamples.sample[sample_file_content][name]$</argument> + </helper> + + <!-- Download Export File --> + <actionGroup ref="DownloadFileActionGroup" stepKey="downloadExport"> + <argument name="fileName" value="{$grabNameFile}"/> + </actionGroup> + + <!-- Validate Downloaded Export File on File System --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableLink"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_file=/a/d/$addDownloadableLink.link[sample_file_content][name]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,is_shareable=$addDownloadableLink.link[is_shareable]$,link_type=$addDownloadableLink.link[link_type]$,link_file=/m/a/$addDownloadableLink.link[link_file_content][name]$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableSampleLink"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">title=$addDownloadableSamples.sample[title]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_file=/t/e/$addDownloadableSamples.sample[sample_file_content][name]$</argument> + </helper> + + <!-- Delete Export File --> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> + <argument name="fileName" value="{$grabNameFile}"/> + </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithURLLinksTest.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithURLLinksTest.xml new file mode 100644 index 0000000000000..3680511598ef1 --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminExportDownloadableProductWithURLLinksTest.xml @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminExportDownloadableProductWithURLLinksTest"> + <annotations> + <features value="DownloadableImportExport"/> + <stories value="Export Products"/> + <title value="Export Downloadable Products with URL Links"/> + <description value="Verifies that a user can export a Downloadable product with downloadable and sample Url + links. Verifies that the exported file and the downloadable copy of the exported file contain the expected + product (a filter is applied when exporting such that ONLY the downloadable product row should be in the + export), the correct downloadable link with Urls, and the correct downloadable sample links with Urls. + Note that MFTF cannot simply download a file and have access to it due to the test not having access to the + server that is running the test browser. Therefore, this test verifies that the Download button can be + successfully clicked, grabs the request URL from the Download button, executes the request on the magento + machine via a curl request, and verifies the contents of the downloaded file"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-38558"/> + <group value="importExport"/> + <group value="Downloadable"/> + </annotations> + + <before> + <!-- Add Downloadable Domain, Create Category, Create Downloadable Product --> + <magentoCLI command="downloadable:domains:add example.com" stepKey="addDownloadableDomain"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="ApiDownloadableProduct" stepKey="createProduct"/> + <createData entity="downloadableLink1" stepKey="addDownloadableLink"> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="DownloadableSample" stepKey="addDownloadableSamples"> + <requiredEntity createDataKey="createProduct"/> + </createData> + <magentoCron groups="index" stepKey="runCronIndex"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Revert Configuration & Delete Data --> + <magentoCLI command="downloadable:domains:remove example.com" stepKey="removeDownloadableDomain"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <deleteData createDataKey="createProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> + <argument name="path">var/export</argument> + </helper> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- Export Created Products --> + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> + <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> + <argument name="attribute" value="sku"/> + <argument name="attributeData" value="$$createProduct.sku$$"/> + </actionGroup> + + <!-- Start Message Queue for Export Consumer --> + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> + <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> + <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> + </actionGroup> + <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitForReload"/> + <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/> + + <!-- Validate Export File on File System --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileExists" stepKey="assertExportFileExists"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableProduct"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">$$createProduct.name$$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableLink"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_url=$addDownloadableLink.link[sample_url]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,link_type=$addDownloadableLink.link[link_type]$,link_url=$addDownloadableLink.link[link_url]$</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileContainsString" stepKey="assertExportFileContainsDownloadableSampleLink"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + <argument name="text">title=$addDownloadableSamples.sample[title]$,sort_order=$addDownloadableSamples.sample[sort_order]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_url=$addDownloadableSamples.sample[sample_url]$</argument> + </helper> + + <!-- Download Export File --> + <actionGroup ref="DownloadFileActionGroup" stepKey="downloadExport"> + <argument name="fileName" value="{$grabNameFile}"/> + </actionGroup> + + <!-- Validate Downloaded Export File on File System --> + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableProduct"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">$$createProduct.name$$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableLink"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">title=$addDownloadableLink.link[title]$,sort_order=$addDownloadableLink.link[sort_order]$,sample_type=$addDownloadableLink.link[sample_type]$,sample_url=$addDownloadableLink.link[sample_url]$,price=$addDownloadableLink.link[price]$0000,number_of_downloads=$addDownloadableLink.link[number_of_downloads]$,link_type=$addDownloadableLink.link[link_type]$,link_url=$addDownloadableLink.link[link_url]$</argument> + </helper> + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsDownloadableSampleLink"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="expectedString">title=$addDownloadableSamples.sample[title]$,sort_order=$addDownloadableSamples.sample[sort_order]$,sample_type=$addDownloadableSamples.sample[sample_type]$,sample_url=$addDownloadableSamples.sample[sample_url]$</argument> + </helper> + + <!-- Delete Export File --> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> + <argument name="fileName" value="{$grabNameFile}"/> + </actionGroup> + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> + <argument name="filePath">var/export/{$grabNameFile}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithFileLinksTest.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithFileLinksTest.xml new file mode 100644 index 0000000000000..441395e3114a9 --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithFileLinksTest.xml @@ -0,0 +1,220 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportDownloadableProductsWithFileLinksTest"> + <annotations> + <features value="DownloadableImportExport"/> + <stories value="Import Products"/> + <title value="Import Downloadable Products with File Links"/> + <description value="Imports a .csv file containing a downloadable product with file links. Verifies that + products are imported successfully and that the files are attached to the products as expected."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38325"/> + <group value="importExport"/> + <group value="Downloadable"/> + </annotations> + + <before> + <!-- Create Category & Customer --> + <createData entity="ImportCategory_Downloadable_FileLinks" stepKey="createImportCategory"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Copy Images to Import Directory for Product Images --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + </helper> + + <!-- Copy Images to Import Directory for Downloadable Links --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportDownloadableLinkFiles"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage2"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage2"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage3"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument> + </helper> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Delete Data --> + <deleteData createDataKey="createImportCategory" stepKey="deleteImportCategory"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteProductImageDirectory"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteDownloadableLinkFilesDirectory"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument> + </helper> + <deleteData url="/V1/products/{{ImportProduct_Downloadable_FileLinks.urlKey}}" stepKey="deleteImportedDownloadableProduct"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="navigateToAndResetProductGridToDefaultView"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Downloadable Product & Assert No Errors --> + <actionGroup ref="AdminNavigateToImportPageActionGroup" stepKey="navigateToImportPage"/> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Downloadable_FileLinks.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Downloadable_FileLinks.name}}"/> + </actionGroup> + <actionGroup ref="AdminClickCheckDataImportActionGroup" stepKey="clickCheckData"/> + <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{ImportCommonMessages.validFile}}" stepKey="seeCheckDataResultMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage"/> + <actionGroup ref="AdminClickImportActionGroup" stepKey="clickImport"/> + <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{ImportProduct_Downloadable_FileLinks.importSummary}}" stepKey="seeNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.messageByType('success')}}" userInput="{{ImportCommonMessages.success}}" stepKey="seeImportMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage2"/> + + <!-- Reindex --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + + <!-- Admin: Verify Data on Import History Page --> + <actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/> + <actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending"> + <argument name="columnLabel" value="history_id"/> + </actionGroup> + <see userInput="{{ImportProduct_Downloadable_FileLinks.fileName}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/> + <see userInput="{{ImportProduct_Downloadable_FileLinks.importSummary}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/> + + <!-- Admin: Verify Downloadable Product on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToDownloadableProductEditPage"> + <argument name="product" value="ImportProduct_Downloadable_FileLinks"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertDownloadableProductOnEditPage"> + <argument name="productStatus" value="{{ImportProduct_Downloadable_FileLinks.status}}"/> + <argument name="productName" value="{{ImportProduct_Downloadable_FileLinks.name}}"/> + <argument name="productSku" value="{{ImportProduct_Downloadable_FileLinks.sku}}"/> + <argument name="productPrice" value="{{ImportProduct_Downloadable_FileLinks.price}}"/> + <argument name="productQuantity" value="{{ImportProduct_Downloadable_FileLinks.quantity}}"/> + <argument name="productWeight" value="{{ImportProduct_Downloadable_FileLinks.weight}}"/> + <argument name="productVisibility" value="{{ImportProduct_Downloadable_FileLinks.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Downloadable_FileLinks.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductBaseImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_FileLinks.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_FileLinks.baseImageName, 'image')}}" stepKey="seeBaseImageRole"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductSmallImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_FileLinks.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_FileLinks.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_FileLinks.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_FileLinks.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole"/> + + <!-- Admin: Verify Downloadable Information --> + <actionGroup ref="ExpandAdminProductSectionActionGroup" stepKey="expandDownloadableSection"> + <argument name="sectionSelector" value="{{AdminProductDownloadableSection.sectionHeader}}"/> + <argument name="sectionDependentSelector" value="{{AdminProductDownloadableSection.sectionLinkGrid}}"/> + </actionGroup> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="seeDownloadableProductChecked"/> + <seeInField userInput="{{ImportProduct_Downloadable_FileLinks.linksTitle}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="seeLinksTitle"/> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="seeLinksPurchasedSeparateChecked"/> + <actionGroup ref="AdminAssertDownloadableLinkInformationActionGroup" stepKey="verifyDownloadableLinkAdmin"> + <argument name="title" value="{{ImportProduct_Downloadable_FileLinks.linkTitle}}"/> + <argument name="price" value="{{ImportProduct_Downloadable_FileLinks.linkPrice}}"/> + <argument name="fileType" value="{{ImportProduct_Downloadable_FileLinks.linkFileType}}"/> + <argument name="fileNameOrUrl" value="{{ImportProduct_Downloadable_FileLinks.linkFileName}}"/> + <argument name="sampleType" value="{{ImportProduct_Downloadable_FileLinks.linkSampleFileType}}"/> + <argument name="sampleFileNameOrUrl" value="{{ImportProduct_Downloadable_FileLinks.linkSampleFileName}}"/> + <argument name="shareable" value="{{ImportProduct_Downloadable_FileLinks.linkShareable}}"/> + <argument name="maxDownloads" value="{{ImportProduct_Downloadable_FileLinks.linkMaxDownloads}}"/> + </actionGroup> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads('0')}}" stepKey="seeLinkMaxDownloadsUnlimitedChecked"/> + <seeInField userInput="{{ImportProduct_Downloadable_FileLinks.samplesTitle}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="seeSamplesTitle"/> + <actionGroup ref="AdminAssertDownloadableSampleLinkInformationActionGroup" stepKey="verifyDownloadableSampleLinkAdmin"> + <argument name="title" value="{{ImportProduct_Downloadable_FileLinks.sampleTitle}}"/> + <argument name="fileType" value="{{ImportProduct_Downloadable_FileLinks.sampleFileType}}"/> + <argument name="fileNameOrUrl" value="{{ImportProduct_Downloadable_FileLinks.sampleFileName}}"/> + </actionGroup> + + <!-- Storefront: Verify Downloadable Product In Category --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="{{ImportCategory_Downloadable_FileLinks.name_lwr}}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productName}}" userInput="1" stepKey="seeOnly1Product2"/> + <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{ImportProduct_Downloadable_FileLinks.name}}" stepKey="seeProduct"/> + + <!-- Storefront: Verify Downloadable Product Info & Image --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> + <argument name="productUrl" value="{{ImportProduct_Downloadable_FileLinks.urlKey}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Downloadable_FileLinks.name}}" stepKey="seeProductName"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Downloadable_FileLinks.sku}}" stepKey="seeSku"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProduct_Downloadable_FileLinks.price}}" stepKey="seePrice"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_FileLinks.baseImageName)}}" stepKey="seeBaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_FileLinks.smallImageName)}}" stepKey="seeSmallImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_FileLinks.thumbnailImageName)}}" stepKey="seeThumbnailImage"/> + + <!-- Storefront: Verify Downloadable Product Link Data --> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(ImportProduct_Downloadable_FileLinks.sampleTitle)}}" stepKey="seeDownloadableSampleLink"/> + <click selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(ImportProduct_Downloadable_FileLinks.sampleTitle)}}" stepKey="clickDownloadableSampleLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkImage}}" stepKey="seeImage"/> + <closeTab stepKey="closeTab"/> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(ImportProduct_Downloadable_FileLinks.linkTitle)}}" stepKey="seeDownloadableLink"/> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkSampleByTitle('sample')}}" stepKey="seeDownloadableLinkSampleLink"/> + <click selector="{{StorefrontDownloadableProductSection.downloadableLinkSampleByTitle('sample')}}" stepKey="clickDownloadableLinkSampleLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab2"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkImage}}" stepKey="seeImage2"/> + <closeTab stepKey="closeTab2"/> + <checkOption selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(ImportProduct_Downloadable_FileLinks.linkTitle)}}" stepKey="selectDownloadableLink"/> + <waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProduct_Downloadable_FileLinks.totalPriceWithLink}}" stepKey="seeUpdatedPrice"/> + + <!-- Purchase Downloadable Product --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Create Invoice --> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="goToOrderInAdmin"> + <argument name="orderId" value="{$grabOrderNumber}"/> + </actionGroup> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> + + <!-- Storefront: Go to Purchased Downloadable Product & Verify Link --> + <actionGroup ref="StorefrontNavigateToCustomerDownloadableProductsPageActionGroup" stepKey="goToCustomerDownloadableProductsPage"/> + <see userInput="{{ImportProduct_Downloadable_FileLinks.linkTitle}}" selector="{{StorefrontCustomerDownloadableProductsSection.downloadableLinkByOrderNumber({$grabOrderNumber})}}" stepKey="seeDownloadableLink2"/> + <click selector="{{StorefrontCustomerDownloadableProductsSection.downloadableLinkByOrderNumber({$grabOrderNumber})}}" stepKey="clickDownloadableLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab3"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkImage}}" stepKey="seeImage3"/> + <closeTab stepKey="closeTab3"/> + </test> +</tests> diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithUrlLinksTest.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithUrlLinksTest.xml new file mode 100644 index 0000000000000..22cfca5224ad6 --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithUrlLinksTest.xml @@ -0,0 +1,231 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportDownloadableProductsWithUrlLinksTest"> + <annotations> + <features value="DownloadableImportExport"/> + <stories value="Import Products"/> + <title value="Import Downloadable Products with Url Links"/> + <description value="Imports a .csv file containing a downloadable product with url links. Verifies that + products are imported successfully."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38947"/> + <group value="importExport"/> + <group value="Downloadable"/> + </annotations> + + <before> + <!-- Add Downloadable Domain, Create Category, & Create Customer --> + <magentoCLI command="downloadable:domains:add static.magento.com" stepKey="addDownloadableDomain"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <createData entity="ImportCategory_Downloadable_UrlLinks" stepKey="createImportCategory"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Copy Images to Import Directory for Product Images --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + </helper> + + <!-- Copy Images to Import Directory for Downloadable Links --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportDownloadableLinkFiles"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage2"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage2"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage3"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + <argument name="destination">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}/{{ImportProduct_Downloadable_UrlLinks.thumbnailImage}}</argument> + </helper> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Revert Configuration & Delete Data --> + <magentoCLI command="downloadable:domains:remove static.magento.com" stepKey="removeDownloadableDomain"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <deleteData createDataKey="createImportCategory" stepKey="deleteImportCategory"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteProductImageDirectory"> + <argument name="path">var/import/images/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteDownloadableLinkFilesDirectory"> + <argument name="path">pub/media/import/{{ImportProduct_Downloadable_UrlLinks.name}}</argument> + </helper> + <deleteData url="/V1/products/{{ImportProduct_Downloadable_UrlLinks.urlKey}}" stepKey="deleteImportedDownloadableProduct"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="navigateToAndResetProductGridToDefaultView"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Downloadable Product & Assert No Errors --> + <actionGroup ref="AdminNavigateToImportPageActionGroup" stepKey="navigateToImportPage"/> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Downloadable_UrlLinks.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Downloadable_UrlLinks.name}}"/> + </actionGroup> + <actionGroup ref="AdminClickCheckDataImportActionGroup" stepKey="clickCheckData"/> + <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{ImportCommonMessages.validFile}}" stepKey="seeCheckDataResultMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage"/> + <actionGroup ref="AdminClickImportActionGroup" stepKey="clickImport"/> + <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{ImportProduct_Downloadable_UrlLinks.importSummary}}" stepKey="seeNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.messageByType('success')}}" userInput="{{ImportCommonMessages.success}}" stepKey="seeImportMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage2"/> + + <!-- Reindex --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + + <!-- Admin: Verify Data on Import History Page --> + <actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/> + <actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending"> + <argument name="columnLabel" value="history_id"/> + </actionGroup> + <see userInput="{{ImportProduct_Downloadable_UrlLinks.fileName}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/> + <see userInput="{{ImportProduct_Downloadable_UrlLinks.importSummary}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/> + + <!-- Admin: Verify Downloadable Product on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToDownloadableProductEditPage"> + <argument name="product" value="ImportProduct_Downloadable_UrlLinks"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertDownloadableProductOnEditPage"> + <argument name="productStatus" value="{{ImportProduct_Downloadable_UrlLinks.status}}"/> + <argument name="productName" value="{{ImportProduct_Downloadable_UrlLinks.name}}"/> + <argument name="productSku" value="{{ImportProduct_Downloadable_UrlLinks.sku}}"/> + <argument name="productPrice" value="{{ImportProduct_Downloadable_UrlLinks.price}}"/> + <argument name="productQuantity" value="{{ImportProduct_Downloadable_UrlLinks.quantity}}"/> + <argument name="productWeight" value="{{ImportProduct_Downloadable_UrlLinks.weight}}"/> + <argument name="productVisibility" value="{{ImportProduct_Downloadable_UrlLinks.visibilityText}}"/> + <argument name="categoryName" value="{{ImportCategory_Downloadable_UrlLinks.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductBaseImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_UrlLinks.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_UrlLinks.baseImageName, 'image')}}" stepKey="seeBaseImageRole"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductSmallImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_UrlLinks.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_UrlLinks.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Downloadable_UrlLinks.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Downloadable_UrlLinks.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole"/> + + <!-- Admin: Verify Downloadable Information --> + <actionGroup ref="ExpandAdminProductSectionActionGroup" stepKey="expandDownloadableSection"> + <argument name="sectionSelector" value="{{AdminProductDownloadableSection.sectionHeader}}"/> + <argument name="sectionDependentSelector" value="{{AdminProductDownloadableSection.sectionLinkGrid}}"/> + </actionGroup> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="seeDownloadableProductChecked"/> + <seeInField userInput="{{ImportProduct_Downloadable_UrlLinks.linksTitle}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="seeLinksTitle"/> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="seeLinksPurchasedSeparateChecked"/> + <actionGroup ref="AdminAssertDownloadableLinkInformationActionGroup" stepKey="verifyDownloadableLinkAdmin"> + <argument name="title" value="{{ImportProduct_Downloadable_UrlLinks.linkTitle}}"/> + <argument name="price" value="{{ImportProduct_Downloadable_UrlLinks.linkPrice}}"/> + <argument name="fileType" value="{{ImportProduct_Downloadable_UrlLinks.linkFileType}}"/> + <argument name="fileNameOrUrl" value="{{ImportProduct_Downloadable_UrlLinks.linkFileUrl}}"/> + <argument name="sampleType" value="{{ImportProduct_Downloadable_UrlLinks.linkSampleFileType}}"/> + <argument name="sampleFileNameOrUrl" value="{{ImportProduct_Downloadable_UrlLinks.linkSampleFileUrl}}"/> + <argument name="shareable" value="{{ImportProduct_Downloadable_UrlLinks.linkShareable}}"/> + <argument name="maxDownloads" value="{{ImportProduct_Downloadable_UrlLinks.linkMaxDownloads}}"/> + </actionGroup> + <seeCheckboxIsChecked selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads('0')}}" stepKey="seeLinkMaxDownloadsUnlimitedChecked"/> + <seeInField userInput="{{ImportProduct_Downloadable_UrlLinks.samplesTitle}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="seeSamplesTitle"/> + <actionGroup ref="AdminAssertDownloadableSampleLinkInformationActionGroup" stepKey="verifyDownloadableSampleLinkAdmin"> + <argument name="title" value="{{ImportProduct_Downloadable_UrlLinks.sampleTitle}}"/> + <argument name="fileType" value="{{ImportProduct_Downloadable_UrlLinks.sampleFileType}}"/> + <argument name="fileNameOrUrl" value="{{ImportProduct_Downloadable_UrlLinks.sampleFileUrl}}"/> + </actionGroup> + + <!-- Storefront: Verify Downloadable Product In Category --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="{{ImportCategory_Downloadable_UrlLinks.name_lwr}}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productName}}" userInput="1" stepKey="seeOnly1Product2"/> + <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{ImportProduct_Downloadable_UrlLinks.name}}" stepKey="seeProduct"/> + + <!-- Storefront: Verify Downloadable Product Info & Image --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> + <argument name="productUrl" value="{{ImportProduct_Downloadable_UrlLinks.urlKey}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Downloadable_UrlLinks.name}}" stepKey="seeProductName"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Downloadable_UrlLinks.sku}}" stepKey="seeSku"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProduct_Downloadable_UrlLinks.price}}" stepKey="seePrice"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_UrlLinks.baseImageName)}}" stepKey="seeBaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_UrlLinks.smallImageName)}}" stepKey="seeSmallImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_UrlLinks.thumbnailImageName)}}" stepKey="seeThumbnailImage"/> + + <!-- Storefront: Verify Downloadable Product Link Data --> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(ImportProduct_Downloadable_UrlLinks.sampleTitle)}}" stepKey="seeDownloadableSampleLink"/> + <click selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(ImportProduct_Downloadable_UrlLinks.sampleTitle)}}" stepKey="clickDownloadableSampleLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkTitle(ImportProduct_Downloadable_UrlLinks.sampleFileName)}}" stepKey="seeImageTitle"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkSvg}}" stepKey="seeImage"/> + <closeTab stepKey="closeTab"/> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(ImportProduct_Downloadable_UrlLinks.linkTitle)}}" stepKey="seeDownloadableLink"/> + <seeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkSampleByTitle('sample')}}" stepKey="seeDownloadableLinkSampleLink"/> + <click selector="{{StorefrontDownloadableProductSection.downloadableLinkSampleByTitle('sample')}}" stepKey="clickDownloadableLinkSampleLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab2"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkTitle(ImportProduct_Downloadable_UrlLinks.linkSampleFileName)}}" stepKey="seeImageTitle2"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkSvg}}" stepKey="seeImage2"/> + <closeTab stepKey="closeTab2"/> + <checkOption selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(ImportProduct_Downloadable_UrlLinks.linkTitle)}}" stepKey="selectDownloadableLink"/> + <waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProduct_Downloadable_UrlLinks.totalPriceWithLink}}" stepKey="seeUpdatedPrice"/> + + <!-- Purchase Downloadable Product --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Create Invoice --> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="goToOrderInAdmin"> + <argument name="orderId" value="{$grabOrderNumber}"/> + </actionGroup> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> + + <!-- Storefront: Go to Purchased Downloadable Product & Verify Link --> + <actionGroup ref="StorefrontNavigateToCustomerDownloadableProductsPageActionGroup" stepKey="goToCustomerDownloadableProductsPage"/> + <see userInput="{{ImportProduct_Downloadable_UrlLinks.linkTitle}}" selector="{{StorefrontCustomerDownloadableProductsSection.downloadableLinkByOrderNumber({$grabOrderNumber})}}" stepKey="seeDownloadableLink2"/> + <click selector="{{StorefrontCustomerDownloadableProductsSection.downloadableLinkByOrderNumber({$grabOrderNumber})}}" stepKey="clickDownloadableLink"/> + <switchToNextTab stepKey="switchToDownloadedLinkTab3"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkTitle(ImportProduct_Downloadable_UrlLinks.linkFileName)}}" stepKey="seeImageTitle3"/> + <waitForElement selector="{{StorefrontDownloadableLinkSection.downloadableLinkSvg}}" stepKey="seeImage3"/> + <closeTab stepKey="closeTab3"/> + </test> +</tests> diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php index fe660f01c8244..9070254bcc6c9 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php @@ -201,7 +201,7 @@ protected function _prepareForm() ] ); - $dateFormat = $this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT); + $dateFormat = $this->_localeDate->getDateFormatWithLongYear(); $fieldset->addField( 'default_value_date', 'date', diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Group.php b/app/code/Magento/Eav/Model/Entity/Attribute/Group.php index 2e55964560588..53df296f36abf 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Group.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Group.php @@ -128,6 +128,7 @@ public function beforeSave() $isReservedSystemName = in_array(strtolower($attributeGroupCode), $this->reservedSystemNames); if (empty($attributeGroupCode) || $isReservedSystemName) { // in the following code md5 is not used for security purposes + // phpcs:ignore Magento2.Security.InsecureFunction $attributeGroupCode = md5(strtolower($groupName)); } $this->setAttributeGroupCode($attributeGroupCode); diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php b/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php index 1cad781ad6d74..f5a70d2d09538 100644 --- a/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php +++ b/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php @@ -63,6 +63,15 @@ public function build() ), 'char_filter' => array_keys($charFilter) ], + // this analyzer must not include stemmer filter + 'prefix_search' => [ + 'type' => 'custom', + 'tokenizer' => key($tokenizer), + 'filter' => array_merge( + ['lowercase', 'keyword_repeat'] + ), + 'char_filter' => array_keys($charFilter) + ], 'sku' => [ 'type' => 'custom', 'tokenizer' => 'keyword', @@ -70,6 +79,14 @@ public function build() ['lowercase', 'keyword_repeat'], array_keys($filter) ), + ], + // this analyzer must not include stemmer filter + 'sku_prefix_search' => [ + 'type' => 'custom', + 'tokenizer' => 'keyword', + 'filter' => array_merge( + ['lowercase', 'keyword_repeat'] + ), ] ], 'tokenizer' => $tokenizer, diff --git a/app/code/Magento/Elasticsearch/Model/Indexer/IndexerHandler.php b/app/code/Magento/Elasticsearch/Model/Indexer/IndexerHandler.php index 90e21e9e3ea1e..6a780f43025d3 100644 --- a/app/code/Magento/Elasticsearch/Model/Indexer/IndexerHandler.php +++ b/app/code/Magento/Elasticsearch/Model/Indexer/IndexerHandler.php @@ -5,8 +5,11 @@ */ namespace Magento\Elasticsearch\Model\Indexer; +use Magento\CatalogSearch\Model\Indexer\Fulltext; use Magento\Elasticsearch\Model\Adapter\Elasticsearch as ElasticsearchAdapter; use Magento\Elasticsearch\Model\Adapter\Index\IndexNameResolver; +use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ScopeResolverInterface; use Magento\Framework\Indexer\IndexStructureInterface; use Magento\Framework\Indexer\SaveHandler\Batch; @@ -59,6 +62,19 @@ class IndexerHandler implements IndexerInterface private $scopeResolver; /** + * @var DeploymentConfig|null + */ + private $deploymentConfig; + + /** + * Deployment config path + * + * @var string + */ + private const DEPLOYMENT_CONFIG_INDEXER_BATCHES = 'indexer/batch_size/'; + + /** + * IndexerHandler constructor. * @param IndexStructureInterface $indexStructure * @param ElasticsearchAdapter $adapter * @param IndexNameResolver $indexNameResolver @@ -66,6 +82,7 @@ class IndexerHandler implements IndexerInterface * @param ScopeResolverInterface $scopeResolver * @param array $data * @param int $batchSize + * @param DeploymentConfig|null $deploymentConfig */ public function __construct( IndexStructureInterface $indexStructure, @@ -74,7 +91,8 @@ public function __construct( Batch $batch, ScopeResolverInterface $scopeResolver, array $data = [], - $batchSize = self::DEFAULT_BATCH_SIZE + $batchSize = self::DEFAULT_BATCH_SIZE, + ?DeploymentConfig $deploymentConfig = null ) { $this->indexStructure = $indexStructure; $this->adapter = $adapter; @@ -83,6 +101,7 @@ public function __construct( $this->data = $data; $this->batchSize = $batchSize; $this->scopeResolver = $scopeResolver; + $this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class); } /** @@ -92,6 +111,11 @@ public function saveIndex($dimensions, \Traversable $documents) { $dimension = current($dimensions); $scopeId = $this->scopeResolver->getScope($dimension->getValue())->getId(); + + $this->batchSize = $this->deploymentConfig->get( + self::DEPLOYMENT_CONFIG_INDEXER_BATCHES . Fulltext::INDEXER_ID . '/elastic_save' + ) ?? $this->batchSize; + foreach ($this->batch->getItems($documents, $this->batchSize) as $documentsBatch) { $docs = $this->adapter->prepareDocsPerStore($documentsBatch, $scopeId); $this->adapter->addDocs($docs, $scopeId, $this->getIndexerId()); diff --git a/app/code/Magento/Elasticsearch/Model/ResourceModel/Index.php b/app/code/Magento/Elasticsearch/Model/ResourceModel/Index.php index d75bb9c8ccd34..7cc2482946949 100644 --- a/app/code/Magento/Elasticsearch/Model/ResourceModel/Index.php +++ b/app/code/Magento/Elasticsearch/Model/ResourceModel/Index.php @@ -6,6 +6,7 @@ namespace Magento\Elasticsearch\Model\ResourceModel; use Magento\Catalog\Model\Indexer\Product\Price\DimensionCollectionFactory; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Model\ResourceModel\Db\Context; use Magento\Store\Model\StoreManagerInterface; use Magento\Catalog\Api\ProductRepositoryInterface; @@ -137,7 +138,11 @@ public function getFullCategoryProductIndexData($storeId = null, $productIds = n foreach ($categoryPositions as $productId => $positions) { foreach ($positions as $categoryId => $position) { - $category = $this->categoryRepository->get($categoryId, $storeId); + try { + $category = $this->categoryRepository->get($categoryId, $storeId); + } catch (NoSuchEntityException $e) { + continue; + } $categoryName = $category->getName(); $categoryData[$productId][] = [ 'id' => $categoryId, diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Dynamic/DataProvider.php b/app/code/Magento/Elasticsearch/SearchAdapter/Dynamic/DataProvider.php index 7bc64b59ffe78..594fa2fc4915a 100644 --- a/app/code/Magento/Elasticsearch/SearchAdapter/Dynamic/DataProvider.php +++ b/app/code/Magento/Elasticsearch/SearchAdapter/Dynamic/DataProvider.php @@ -7,6 +7,8 @@ use Magento\Elasticsearch\SearchAdapter\QueryAwareInterface; use Magento\Elasticsearch\SearchAdapter\QueryContainer; +use Magento\Framework\App\ObjectManager; +use Psr\Log\LoggerInterface; /** * Elastic search data provider @@ -83,6 +85,11 @@ class DataProvider implements \Magento\Framework\Search\Dynamic\DataProviderInte */ private $queryContainer; + /** + * @var LoggerInterface + */ + private $logger; + /** * @param \Magento\Elasticsearch\SearchAdapter\ConnectionManager $connectionManager * @param \Magento\Elasticsearch\Model\Adapter\FieldMapperInterface $fieldMapper @@ -94,7 +101,7 @@ class DataProvider implements \Magento\Framework\Search\Dynamic\DataProviderInte * @param string $indexerId * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param QueryContainer|null $queryContainer - * + * @param LoggerInterface|null $logger * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -107,7 +114,8 @@ public function __construct( \Magento\Elasticsearch\SearchAdapter\SearchIndexNameResolver $searchIndexNameResolver, $indexerId, \Magento\Framework\App\ScopeResolverInterface $scopeResolver, - QueryContainer $queryContainer = null + QueryContainer $queryContainer = null, + LoggerInterface $logger = null ) { $this->connectionManager = $connectionManager; $this->fieldMapper = $fieldMapper; @@ -119,6 +127,7 @@ public function __construct( $this->indexerId = $indexerId; $this->scopeResolver = $scopeResolver; $this->queryContainer = $queryContainer; + $this->logger = $logger ?? ObjectManager::getInstance()->get(LoggerInterface::class); } /** @@ -154,16 +163,19 @@ public function getAggregations(\Magento\Framework\Search\Dynamic\EntityStorage ], ]; - $queryResult = $this->connectionManager->getConnection() - ->query($query); - - if (isset($queryResult['aggregations']['prices'])) { - $aggregations = [ - 'count' => $queryResult['aggregations']['prices']['count'], - 'max' => $queryResult['aggregations']['prices']['max'], - 'min' => $queryResult['aggregations']['prices']['min'], - 'std' => $queryResult['aggregations']['prices']['std_deviation'], - ]; + try { + $queryResult = $this->connectionManager->getConnection() + ->query($query); + if (isset($queryResult['aggregations']['prices'])) { + $aggregations = [ + 'count' => $queryResult['aggregations']['prices']['count'], + 'max' => $queryResult['aggregations']['prices']['max'], + 'min' => $queryResult['aggregations']['prices']['min'], + 'std' => $queryResult['aggregations']['prices']['std_deviation'], + ]; + } + } catch (\Exception $e) { + $this->logger->critical($e); } return $aggregations; @@ -202,8 +214,6 @@ public function getAggregation( $range, \Magento\Framework\Search\Dynamic\EntityStorage $entityStorage ) { - $result = []; - $query = $this->getBasicSearchQuery($entityStorage); $fieldName = $this->fieldMapper->getFieldName($bucket->getField()); @@ -217,11 +227,16 @@ public function getAggregation( ], ]; - $queryResult = $this->connectionManager->getConnection() - ->query($query); - foreach ($queryResult['aggregations']['prices']['buckets'] as $bucket) { - $key = (int)($bucket['key'] / $range + 1); - $result[$key] = $bucket['doc_count']; + $result = []; + try { + $queryResult = $this->connectionManager->getConnection() + ->query($query); + foreach ($queryResult['aggregations']['prices']['buckets'] as $bucket) { + $key = (int)($bucket['key'] / $range + 1); + $result[$key] = $bucket['doc_count']; + } + } catch (\Exception $e) { + $this->logger->critical($e); } return $result; diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php index ac40e4ee3c089..b4ed33fb85f50 100644 --- a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php +++ b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php @@ -154,15 +154,18 @@ protected function buildQueries(array $matches, array $queryValue) continue; } $matchCondition = $match['matchCondition'] ?? $condition; + $fields = []; + $fields[$resolvedField] = [ + 'query' => $transformedValue, + 'boost' => $match['boost'] ?? 1, + ]; + if (isset($match['analyzer'])) { + $fields[$resolvedField]['analyzer'] = $match['analyzer']; + } $conditions[] = [ 'condition' => $queryValue['condition'], 'body' => [ - $matchCondition => [ - $resolvedField => [ - 'query' => $transformedValue, - 'boost' => $match['boost'] ?? 1, - ], - ], + $matchCondition => $fields, ], ]; } diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Suite/SearchEngineElasticsearchSuite.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Suite/SearchEngineElasticsearchSuite.xml index c2c8644a6fcf5..98df34b3c0117 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Suite/SearchEngineElasticsearchSuite.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Suite/SearchEngineElasticsearchSuite.xml @@ -9,12 +9,8 @@ <suite name="SearchEngineElasticsearchSuite"> <before> <magentoCLI stepKey="setSearchEngineToElasticsearch" command="config:set {{SearchEngineElasticsearchConfigData.path}} {{SearchEngineElasticsearchConfigData.value}}"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after></after> <include> diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml index 1e067f1560404..7dce38cd6babc 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml @@ -36,9 +36,7 @@ <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushFullPageCache"> - <argument name="tags" value="full_page"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushFullPageCache"/> </before> <after> diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml index 1c4d53b273661..baeb70ae3cb89 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml @@ -54,10 +54,7 @@ <deleteData createDataKey="newCategory" stepKey="deleteCategory"/> <!--Delete attribute--> <deleteData createDataKey="customAttribute" stepKey="deleteCustomAttribute"/> - <!--Reindex and clear cache--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> <argument name="tags" value=""/> </actionGroup> @@ -80,10 +77,7 @@ <argument name="product" value="$$product2.sku$$"/> </actionGroup> - <!--Reindex and clear cache--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Dynamic/DataProviderTest.php b/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Dynamic/DataProviderTest.php index 0595b667f4ee8..c19371fe9c5ac 100644 --- a/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Dynamic/DataProviderTest.php +++ b/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Dynamic/DataProviderTest.php @@ -281,6 +281,19 @@ public function testGetAggregations() ); } + public function testGetAggregationsWithException() + { + $this->queryContainer->expects($this->once()) + ->method('getQuery') + ->willReturn([]); + $this->clientMock->expects($this->once()) + ->method('query') + ->willThrowException(new \Exception()); + + $result = $this->model->getAggregations($this->entityStorage); + $this->assertIsArray($result); + } + /** * Test getInterval() method */ @@ -383,6 +396,22 @@ public function testGetAggregation() ); } + public function testGetAggregationWithException() + { + $bucket = $this->createMock(BucketInterface::class); + $dimension = $this->createMock(Dimension::class); + + $this->queryContainer->expects($this->once()) + ->method('getQuery') + ->willReturn([]); + $this->clientMock->expects($this->once()) + ->method('query') + ->willThrowException(new \Exception()); + + $result = $this->model->getAggregation($bucket, [$dimension], 10, $this->entityStorage); + $this->assertIsArray($result); + } + /** * Test prepareData() method */ diff --git a/app/code/Magento/Elasticsearch/composer.json b/app/code/Magento/Elasticsearch/composer.json index b79ae7bc5cc47..6bc6022cfc82d 100644 --- a/app/code/Magento/Elasticsearch/composer.json +++ b/app/code/Magento/Elasticsearch/composer.json @@ -12,7 +12,7 @@ "magento/module-store": "*", "magento/module-catalog-inventory": "*", "magento/framework": "*", - "elasticsearch/elasticsearch": "~7.7.0" + "elasticsearch/elasticsearch": "~7.11.0" }, "suggest": { "magento/module-config": "*" diff --git a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml index 1727e51371383..d6e896144cec4 100644 --- a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml @@ -68,7 +68,7 @@ <depends> <field id="engine">elasticsearch5</field> </depends> - <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <comment><![CDATA[<a href="https://docs.magento.com/user-guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> </group> diff --git a/app/code/Magento/Elasticsearch/etc/di.xml b/app/code/Magento/Elasticsearch/etc/di.xml index edec07cb5d51e..f3c109f830257 100644 --- a/app/code/Magento/Elasticsearch/etc/di.xml +++ b/app/code/Magento/Elasticsearch/etc/di.xml @@ -383,12 +383,12 @@ <virtualType name="elasticsearch5FieldNameResolver" type="\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> - <item name="notEav" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> - <item name="special" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> - <item name="price" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> - <item name="categoryName" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> - <item name="position" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> - <item name="default" xsi:type="object">elasticsearch5FieldNameDefaultResolver</item> + <item name="notEav" xsi:type="object" sortOrder="10">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> + <item name="special" xsi:type="object" sortOrder="20">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> + <item name="price" xsi:type="object" sortOrder="30">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> + <item name="categoryName" xsi:type="object" sortOrder="40">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> + <item name="position" xsi:type="object" sortOrder="50">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> + <item name="default" xsi:type="object" sortOrder="100">elasticsearch5FieldNameDefaultResolver</item> </argument> </arguments> </virtualType> @@ -401,21 +401,21 @@ <type name="Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> - <item name="integer" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\IntegerType</item> - <item name="datetime" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\DateTimeType</item> - <item name="float" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\FloatType</item> - <item name="default" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\DefaultResolver</item> + <item name="integer" xsi:type="object" sortOrder="10">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\IntegerType</item> + <item name="datetime" xsi:type="object" sortOrder="20">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\DateTimeType</item> + <item name="float" xsi:type="object" sortOrder="30">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\FloatType</item> + <item name="default" xsi:type="object" sortOrder="100">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\DefaultResolver</item> </argument> </arguments> </type> <type name="Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> - <item name="keyword" xsi:type="object">\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\KeywordType</item> - <item name="integer" xsi:type="object">\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\IntegerType</item> - <item name="datetime" xsi:type="object">elasticsearch5FieldTypeDateTimeResolver</item> - <item name="float" xsi:type="object">elasticsearch5FieldTypeFloatResolver</item> - <item name="default" xsi:type="object">elasticsearch5FieldTypeDefaultResolver</item> + <item name="keyword" xsi:type="object" sortOrder="10">\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\KeywordType</item> + <item name="integer" xsi:type="object" sortOrder="20">\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\IntegerType</item> + <item name="datetime" xsi:type="object" sortOrder="30">elasticsearch5FieldTypeDateTimeResolver</item> + <item name="float" xsi:type="object" sortOrder="40">elasticsearch5FieldTypeFloatResolver</item> + <item name="default" xsi:type="object" sortOrder="100">elasticsearch5FieldTypeDefaultResolver</item> </argument> </arguments> </type> @@ -506,6 +506,7 @@ <item name="default" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\TextTransformer</item> <item name="date" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\DateTransformer</item> <item name="float" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\FloatTransformer</item> + <item name="double" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\FloatTransformer</item> <item name="integer" xsi:type="object">Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\IntegerTransformer</item> </argument> </arguments> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml index 75e355126ff2b..79566e42c5af0 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml @@ -26,9 +26,7 @@ <magentoCLI command="config:set --scope={{GeneralLocalCodeConfigsForChina.scope}} --scope-code={{GeneralLocalCodeConfigsForChina.scope_code}} {{GeneralLocalCodeConfigsForChina.path}} {{GeneralLocalCodeConfigsForChina.value}}" stepKey="setLocaleToChina"/> <comment userInput="Moved to appropriate test suite" stepKey="enableElasticsearch6"/> <comment userInput="Moved to appropriate test suite" stepKey="checkConnection"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <createData entity="ApiCategory" stepKey="createCategory"/> <createData entity="ApiSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearchSearchInvalidValueTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearchSearchInvalidValueTest.xml index 627105751507a..9d2eefd23d714 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearchSearchInvalidValueTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearchSearchInvalidValueTest.xml @@ -25,13 +25,8 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!--Set Minimal Query Length--> <magentoCLI command="config:set {{SetMinQueryLength2Config.path}} {{SetMinQueryLength2Config.value}}" stepKey="setMinQueryLength"/> - <!--Reindex indexes and clear cache--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="catalogsearch_fulltext"/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!--Set configs to default--> @@ -50,12 +45,8 @@ <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="goToProductCatalog"/> <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProduct"/> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="catalogsearch_fulltext"/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!--Create new searchable product attribute--> @@ -85,13 +76,8 @@ </actionGroup> <fillField selector="{{AdminProductFormSection.attributeRequiredInput(textProductAttribute.attribute_code)}}" userInput="searchable" stepKey="fillTheAttributeRequiredInputField"/> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/> - <!-- TODO: REMOVE AFTER FIX MC-21717 --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value="eav"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Assert search results on storefront--> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPage"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchForFirstSearchTerm"> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontProductQuickSearchUsingElasticSearchTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontProductQuickSearchUsingElasticSearchTest.xml index 653c460733976..ef84482d342aa 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontProductQuickSearchUsingElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontProductQuickSearchUsingElasticSearchTest.xml @@ -31,9 +31,7 @@ </createData> <magentoCLI command="config:set {{CustomGridPerPageValuesConfigData.path}} {{CustomGridPerPageValuesConfigData.value}}" stepKey="setCustomGridPerPageValues"/> <magentoCLI command="config:set {{CustomGridPerPageDefaultConfigData.path}} {{CustomGridPerPageDefaultConfigData.value}}" stepKey="setCustomGridPerPageDefaults"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> <magentoCron groups="index" stepKey="runCronIndex"/> </before> diff --git a/app/code/Magento/Elasticsearch6/composer.json b/app/code/Magento/Elasticsearch6/composer.json index 1ee92c0b0a3b3..daf6c337b8703 100644 --- a/app/code/Magento/Elasticsearch6/composer.json +++ b/app/code/Magento/Elasticsearch6/composer.json @@ -8,7 +8,7 @@ "magento/module-catalog-search": "*", "magento/module-search": "*", "magento/module-elasticsearch": "*", - "elasticsearch/elasticsearch": "~7.7.0" + "elasticsearch/elasticsearch": "~7.11.0" }, "suggest": { "magento/module-config": "*" diff --git a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml index fee234ada43b4..5907442d28a0b 100644 --- a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml @@ -76,7 +76,7 @@ <depends> <field id="engine">elasticsearch6</field> </depends> - <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <comment><![CDATA[<a href="https://docs.magento.com/user-guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> </group> diff --git a/app/code/Magento/Elasticsearch6/etc/di.xml b/app/code/Magento/Elasticsearch6/etc/di.xml index e60f331f9ee8d..bb6fe436e6202 100644 --- a/app/code/Magento/Elasticsearch6/etc/di.xml +++ b/app/code/Magento/Elasticsearch6/etc/di.xml @@ -144,12 +144,12 @@ <virtualType name="elasticsearch6FieldNameResolver" type="\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> - <item name="notEav" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> - <item name="special" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> - <item name="price" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> - <item name="categoryName" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> - <item name="position" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> - <item name="default" xsi:type="object">\Magento\Elasticsearch6\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\DefaultResolver</item> + <item name="notEav" xsi:type="object" sortOrder="10">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> + <item name="special" xsi:type="object" sortOrder="20">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> + <item name="price" xsi:type="object" sortOrder="30">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> + <item name="categoryName" xsi:type="object" sortOrder="40">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> + <item name="position" xsi:type="object" sortOrder="50">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> + <item name="default" xsi:type="object" sortOrder="100">\Magento\Elasticsearch6\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\DefaultResolver</item> </argument> </arguments> </virtualType> diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/IntegerMapper.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/IntegerMapper.php new file mode 100644 index 0000000000000..f2ccdbeed0cd8 --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/IntegerMapper.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter\DynamicTemplates; + +/** + * @inheridoc + */ +class IntegerMapper implements MapperInterface +{ + /** + * @inheridoc + */ + public function processTemplates(array $templates): array + { + $templates[] = [ + 'integer_mapping' => [ + 'match_mapping_type' => 'long', + 'mapping' => [ + 'type' => 'integer', + ], + ], + ]; + + return $templates; + } +} diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/MapperInterface.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/MapperInterface.php new file mode 100644 index 0000000000000..236eede99cb80 --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/MapperInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter\DynamicTemplates; + +/** + * Elasticsearch dynamic templates mapper. + */ +interface MapperInterface +{ + /** + * Add/remove/edit dynamic template mapping. + * + * @param array $templates + * @return array + */ + public function processTemplates(array $templates): array; +} diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PositionMapper.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PositionMapper.php new file mode 100644 index 0000000000000..ac290e82ea91b --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PositionMapper.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter\DynamicTemplates; + +/** + * @inheridoc + */ +class PositionMapper implements MapperInterface +{ + /** + * @inheridoc + */ + public function processTemplates(array $templates): array + { + $templates[] = [ + 'position_mapping' => [ + 'match' => 'position_*', + 'match_mapping_type' => 'string', + 'mapping' => [ + 'type' => 'integer', + 'index' => true, + ], + ], + ]; + + return $templates; + } +} diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PriceMapper.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PriceMapper.php new file mode 100644 index 0000000000000..3c73cb28fe774 --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/PriceMapper.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter\DynamicTemplates; + +/** + * @inheridoc + */ +class PriceMapper implements MapperInterface +{ + /** + * @inheridoc + */ + public function processTemplates(array $templates): array + { + $templates[] = [ + 'price_mapping' => [ + 'match' => 'price_*', + 'match_mapping_type' => 'string', + 'mapping' => [ + 'type' => 'double', + 'store' => true, + ], + ], + ]; + + return $templates; + } +} diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/StringMapper.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/StringMapper.php new file mode 100644 index 0000000000000..71a4909769491 --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplates/StringMapper.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter\DynamicTemplates; + +/** + * @inheridoc + */ +class StringMapper implements MapperInterface +{ + /** + * @inheridoc + */ + public function processTemplates(array $templates): array + { + $templates[] = [ + 'string_mapping' => [ + 'match' => '*', + 'match_mapping_type' => 'string', + 'mapping' => [ + 'type' => 'text', + 'index' => true, + 'copy_to' => '_search', + ], + ], + ]; + + return $templates; + } +} diff --git a/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplatesProvider.php b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplatesProvider.php new file mode 100644 index 0000000000000..a5199fe06249c --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Model/Adapter/DynamicTemplatesProvider.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch7\Model\Adapter; + +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\MapperInterface; +use Magento\Framework\Exception\InvalidArgumentException; + +/** + * Elasticsearch dynamic templates provider. + */ +class DynamicTemplatesProvider +{ + /** + * @var array + */ + private $mappers; + + /** + * @param MapperInterface[] $mappers + */ + public function __construct(array $mappers) + { + $this->mappers = $mappers; + } + + /** + * Get elasticsearch dynamic templates. + * + * @return array + * @throws InvalidArgumentException + */ + public function getTemplates(): array + { + $templates = []; + foreach ($this->mappers as $mapper) { + if (!$mapper instanceof MapperInterface) { + throw new InvalidArgumentException( + __('Mapper %1 should implement %2', get_class($mapper), MapperInterface::class) + ); + } + $templates = $mapper->processTemplates($templates); + } + + return $templates; + } +} diff --git a/app/code/Magento/Elasticsearch7/Model/Client/Elasticsearch.php b/app/code/Magento/Elasticsearch7/Model/Client/Elasticsearch.php index d193c8aa108c8..87b9f7c93a653 100644 --- a/app/code/Magento/Elasticsearch7/Model/Client/Elasticsearch.php +++ b/app/code/Magento/Elasticsearch7/Model/Client/Elasticsearch.php @@ -7,9 +7,11 @@ namespace Magento\Elasticsearch7\Model\Client; +use Magento\AdvancedSearch\Model\Client\ClientInterface; use Magento\Elasticsearch\Model\Adapter\FieldsMappingPreprocessorInterface; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplatesProvider; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; -use Magento\AdvancedSearch\Model\Client\ClientInterface; /** * Elasticsearch client @@ -38,18 +40,25 @@ class Elasticsearch implements ClientInterface */ private $fieldsMappingPreprocessors; + /** + * @var DynamicTemplatesProvider|null + */ + private $dynamicTemplatesProvider; + /** * Initialize Elasticsearch 7 Client * * @param array $options * @param \Elasticsearch\Client|null $elasticsearchClient * @param array $fieldsMappingPreprocessors + * @param DynamicTemplatesProvider|null $dynamicTemplatesProvider * @throws LocalizedException */ public function __construct( $options = [], $elasticsearchClient = null, - $fieldsMappingPreprocessors = [] + $fieldsMappingPreprocessors = [], + ?DynamicTemplatesProvider $dynamicTemplatesProvider = null ) { if (empty($options['hostname']) || ((!empty($options['enableAuth']) && ($options['enableAuth'] == 1)) @@ -65,6 +74,8 @@ public function __construct( } $this->clientOptions = $options; $this->fieldsMappingPreprocessors = $fieldsMappingPreprocessors; + $this->dynamicTemplatesProvider = $dynamicTemplatesProvider ?: ObjectManager::getInstance() + ->get(DynamicTemplatesProvider::class); } /** @@ -235,8 +246,8 @@ public function updateAlias(string $alias, string $newIndex, string $oldIndex = { $params = [ 'body' => [ - 'actions' => [] - ] + 'actions' => [], + ], ]; if ($oldIndex) { $params['body']['actions'][] = ['remove' => ['alias' => $alias, 'index' => $oldIndex]]; @@ -304,47 +315,7 @@ public function addFieldsMapping(array $fields, string $index, string $entityTyp 'body' => [ $entityType => [ 'properties' => [], - 'dynamic_templates' => [ - [ - 'price_mapping' => [ - 'match' => 'price_*', - 'match_mapping_type' => 'string', - 'mapping' => [ - 'type' => 'double', - 'store' => true, - ], - ], - ], - [ - 'position_mapping' => [ - 'match' => 'position_*', - 'match_mapping_type' => 'string', - 'mapping' => [ - 'type' => 'integer', - 'index' => true, - ], - ], - ], - [ - 'string_mapping' => [ - 'match' => '*', - 'match_mapping_type' => 'string', - 'mapping' => [ - 'type' => 'text', - 'index' => true, - 'copy_to' => '_search', - ], - ], - ], - [ - 'integer_mapping' => [ - 'match_mapping_type' => 'long', - 'mapping' => [ - 'type' => 'integer', - ], - ], - ], - ], + 'dynamic_templates' => $this->dynamicTemplatesProvider->getTemplates(), ], ], ]; diff --git a/app/code/Magento/Elasticsearch7/Test/Mftf/Test/StorefrontQuickSearchUsingElasticSearchByProductSkuTest.xml b/app/code/Magento/Elasticsearch7/Test/Mftf/Test/StorefrontQuickSearchUsingElasticSearchByProductSkuTest.xml new file mode 100644 index 0000000000000..802553f20f7a9 --- /dev/null +++ b/app/code/Magento/Elasticsearch7/Test/Mftf/Test/StorefrontQuickSearchUsingElasticSearchByProductSkuTest.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontQuickSearchUsingElasticSearchByProductSkuTest"> + <annotations> + <features value="Elasticsearch7"/> + <stories value="Storefront Search"/> + <title value="Check that AND query is performed when searching using ElasticSearch 7"/> + <description value="Check that AND query is performed when searching using ElasticSearch 7"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-31114"/> + <useCaseId value="MC-29788"/> + <group value="SearchEngineElasticsearch"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> + + <createData entity="VirtualProduct" stepKey="createFirtsSimpleProduct"/> + <createData entity="SimpleProductWithCustomSku24MB06" stepKey="createSecondSimpleProduct"/> + <createData entity="SimpleProductWithCustomSku24MB04" stepKey="createThirdSimpleProduct"/> + <createData entity="SimpleProductWithCustomSku24MB02" stepKey="createFourthSimpleProduct"/> + <createData entity="SimpleProductWithCustomSku24MB01" stepKey="createFifthSimpleProduct"/> + + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value=""/> + </actionGroup> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createFirtsSimpleProduct" stepKey="deleteProductOne"/> + + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProductsAfterTest"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminPanel"/> + </after> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByProductSku"> + <argument name="phrase" value="24 MB04"/> + </actionGroup> + + <see userInput="4" selector="{{StorefrontCatalogSearchMainSection.productCount}}" stepKey="assertSearchResultCount"/> + + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertSecondProductName"> + <argument name="productName" value="$createSecondSimpleProduct.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertThirdProductName"> + <argument name="productName" value="$createThirdSimpleProduct.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertFourthProductName"> + <argument name="productName" value="$createFourthSimpleProduct.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertFifthProductName"> + <argument name="productName" value="$createFifthSimpleProduct.name$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Elasticsearch7/Test/Unit/Model/Client/ElasticsearchTest.php b/app/code/Magento/Elasticsearch7/Test/Unit/Model/Client/ElasticsearchTest.php index 3b3cbcfbb15f8..100a63e9bef0b 100644 --- a/app/code/Magento/Elasticsearch7/Test/Unit/Model/Client/ElasticsearchTest.php +++ b/app/code/Magento/Elasticsearch7/Test/Unit/Model/Client/ElasticsearchTest.php @@ -12,6 +12,11 @@ use Elasticsearch\Namespaces\IndicesNamespace; use Magento\AdvancedSearch\Model\Client\ClientInterface as ElasticsearchClient; use Magento\Elasticsearch\Model\Adapter\FieldMapper\AddDefaultSearchField; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\IntegerMapper; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\PositionMapper; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\PriceMapper; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\StringMapper; +use Magento\Elasticsearch7\Model\Adapter\DynamicTemplatesProvider; use Magento\Elasticsearch7\Model\Client\Elasticsearch; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; @@ -93,12 +98,21 @@ protected function setUp(): void ->willReturn(['version' => ['number' => '7.0.0']]); $this->objectManager = new ObjectManagerHelper($this); + $dynamicTemplatesProvider = new DynamicTemplatesProvider( + [ + new PriceMapper(), + new PositionMapper(), + new StringMapper(), + new IntegerMapper(), + ] + ); $this->model = $this->objectManager->getObject( Elasticsearch::class, [ 'options' => $this->getOptions(), 'elasticsearchClient' => $this->elasticsearchClientMock, - 'fieldsMappingPreprocessors' => [new AddDefaultSearchField()] + 'fieldsMappingPreprocessors' => [new AddDefaultSearchField()], + 'dynamicTemplatesProvider' => $dynamicTemplatesProvider, ] ); } @@ -109,7 +123,7 @@ public function testConstructorOptionsException() $result = $this->objectManager->getObject( Elasticsearch::class, [ - 'options' => [] + 'options' => [], ] ); $this->assertNotNull($result); @@ -123,7 +137,7 @@ public function testConstructorWithOptions() $result = $this->objectManager->getObject( Elasticsearch::class, [ - 'options' => $this->getOptions() + 'options' => $this->getOptions(), ] ); $this->assertNotNull($result); @@ -177,7 +191,7 @@ public function getOptionsDataProvider() 'index' => 'magento2', 'enableAuth' => 0, ], - 'expected_result' => 'http://localhost:9200' + 'expected_result' => 'http://localhost:9200', ], [ 'with_protocol' => [ @@ -187,8 +201,8 @@ public function getOptionsDataProvider() 'index' => 'magento2', 'enableAuth' => 0, ], - 'expected_result' => 'https://localhost:9200' - ] + 'expected_result' => 'https://localhost:9200', + ], ]; } @@ -228,7 +242,7 @@ public function testTestConnectionPing() Elasticsearch::class, [ 'options' => $this->getEmptyIndexOption(), - 'elasticsearchClient' => $this->elasticsearchClientMock + 'elasticsearchClient' => $this->elasticsearchClientMock, ] ); @@ -627,6 +641,7 @@ public function testGetMapping(): void /** * Test query() method + * * @return void */ public function testQuery() @@ -641,6 +656,7 @@ public function testQuery() /** * Test suggest() method + * * @return void */ public function testSuggest() diff --git a/app/code/Magento/Elasticsearch7/composer.json b/app/code/Magento/Elasticsearch7/composer.json index 1e59ceaebaf84..f14630e87a123 100644 --- a/app/code/Magento/Elasticsearch7/composer.json +++ b/app/code/Magento/Elasticsearch7/composer.json @@ -5,7 +5,7 @@ "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-elasticsearch": "*", - "elasticsearch/elasticsearch": "~7.7.0", + "elasticsearch/elasticsearch": "~7.11.0", "magento/module-advanced-search": "*", "magento/module-catalog-search": "*" }, diff --git a/app/code/Magento/Elasticsearch7/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch7/etc/adminhtml/system.xml index 9e818ff61eb89..6b5d3cf368867 100644 --- a/app/code/Magento/Elasticsearch7/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch7/etc/adminhtml/system.xml @@ -84,7 +84,7 @@ <depends> <field id="engine">elasticsearch7</field> </depends> - <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <comment><![CDATA[<a href="https://docs.magento.com/user-guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> </group> diff --git a/app/code/Magento/Elasticsearch7/etc/di.xml b/app/code/Magento/Elasticsearch7/etc/di.xml index 446331edc63fb..298d93b21af59 100644 --- a/app/code/Magento/Elasticsearch7/etc/di.xml +++ b/app/code/Magento/Elasticsearch7/etc/di.xml @@ -134,12 +134,12 @@ <virtualType name="\Magento\Elasticsearch7\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CompositeResolver" type="\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> - <item name="notEav" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> - <item name="special" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> - <item name="price" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> - <item name="categoryName" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> - <item name="position" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> - <item name="default" xsi:type="object">Magento\Elasticsearch7\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\DefaultResolver</item> + <item name="notEav" xsi:type="object" sortOrder="10">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> + <item name="special" xsi:type="object" sortOrder="20">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\SpecialAttribute</item> + <item name="price" xsi:type="object" sortOrder="30">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Price</item> + <item name="categoryName" xsi:type="object" sortOrder="40">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CategoryName</item> + <item name="position" xsi:type="object" sortOrder="50">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\Position</item> + <item name="default" xsi:type="object" sortOrder="100">Magento\Elasticsearch7\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\DefaultResolver</item> </argument> </arguments> </virtualType> @@ -251,4 +251,14 @@ </argument> </arguments> </type> + <type name="Magento\Elasticsearch7\Model\Adapter\DynamicTemplatesProvider"> + <arguments> + <argument name="mappers" xsi:type="array"> + <item name="price_mapping" xsi:type="object">Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\PriceMapper</item> + <item name="position_mapping" xsi:type="object">Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\PositionMapper</item> + <item name="string_mapping" xsi:type="object">Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\StringMapper</item> + <item name="integer_mapping" xsi:type="object">Magento\Elasticsearch7\Model\Adapter\DynamicTemplates\IntegerMapper</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Email/Model/Template/Filter.php b/app/code/Magento/Email/Model/Template/Filter.php index 648e4ab8fc380..18435d85574f3 100644 --- a/app/code/Magento/Email/Model/Template/Filter.php +++ b/app/code/Magento/Email/Model/Template/Filter.php @@ -3,15 +3,39 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Email\Model\Template; -use Magento\Framework\App\ObjectManager; +use Exception; +use Magento\Cms\Block\Block; +use Magento\Framework\App\Area; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\State; +use Magento\Framework\Css\PreProcessor\Adapter\CssInliner; +use Magento\Framework\Escaper; use Magento\Framework\Exception\MailException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\Read; +use Magento\Framework\Filter\Template; +use Magento\Framework\Filter\Template\Tokenizer\Parameter; use Magento\Framework\Filter\VariableResolverInterface; +use Magento\Framework\Stdlib\StringUtils; +use Magento\Framework\UrlInterface; use Magento\Framework\View\Asset\ContentProcessorException; use Magento\Framework\View\Asset\ContentProcessorInterface; +use Magento\Framework\View\Asset\File\NotFoundException; +use Magento\Framework\View\Asset\Repository; +use Magento\Framework\View\Element\AbstractBlock; +use Magento\Framework\View\LayoutFactory; +use Magento\Framework\View\LayoutInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Variable\Model\Source\Variables; +use Magento\Variable\Model\Variable; +use Magento\Variable\Model\VariableFactory; +use Psr\Log\LoggerInterface; /** * Core Email Template Filter Model @@ -22,7 +46,7 @@ * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @since 100.0.2 */ -class Filter extends \Magento\Framework\Filter\Template +class Filter extends Template { /** * The name used in the {{trans}} directive @@ -89,17 +113,17 @@ class Filter extends \Magento\Framework\Filter\Template private $plainTemplateMode = false; /** - * @var \Magento\Framework\View\Asset\Repository + * @var Repository */ protected $_assetRepo; /** - * @var \Psr\Log\LoggerInterface + * @var LoggerInterface */ protected $_logger; /** - * @var \Magento\Framework\Escaper + * @var Escaper */ protected $_escaper; @@ -107,29 +131,29 @@ class Filter extends \Magento\Framework\Filter\Template * Core store config * Variable factory * - * @var \Magento\Variable\Model\VariableFactory + * @var VariableFactory */ protected $_variableFactory; /** - * @var \Magento\Store\Model\StoreManagerInterface + * @var StoreManagerInterface */ protected $_storeManager; /** - * @var \Magento\Framework\View\LayoutInterface + * @var LayoutInterface */ protected $_layout; /** - * @var \Magento\Framework\View\LayoutFactory + * @var LayoutFactory */ protected $_layoutFactory; /** * Setup callbacks for filters * - * @var \Magento\Framework\App\Config\ScopeConfigInterface + * @var ScopeConfigInterface */ protected $_scopeConfig; @@ -143,28 +167,22 @@ class Filter extends \Magento\Framework\Filter\Template /** * App state * - * @var \Magento\Framework\App\State + * @var State */ protected $_appState; /** - * @var \Magento\Framework\UrlInterface + * @var UrlInterface */ protected $urlModel; /** - * @var \Pelago\Emogrifier - * @deprecated 100.2.0 - */ - protected $emogrifier; - - /** - * @var \Magento\Framework\Css\PreProcessor\Adapter\CssInliner + * @var CssInliner */ private $cssInliner; /** - * @var \Magento\Variable\Model\Source\Variables + * @var Variables */ protected $configVariables; @@ -179,52 +197,52 @@ class Filter extends \Magento\Framework\Filter\Template private $pubDirectory; /** - * @var \Magento\Framework\Filesystem\Directory\Read + * @var Read */ private $pubDirectoryRead; + /** - * @param \Magento\Framework\Stdlib\StringUtils $string - * @param \Psr\Log\LoggerInterface $logger - * @param \Magento\Framework\Escaper $escaper - * @param \Magento\Framework\View\Asset\Repository $assetRepo - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Variable\Model\VariableFactory $coreVariableFactory - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\View\LayoutInterface $layout - * @param \Magento\Framework\View\LayoutFactory $layoutFactory - * @param \Magento\Framework\App\State $appState - * @param \Magento\Framework\UrlInterface $urlModel - * @param \Pelago\Emogrifier $emogrifier - * @param \Magento\Variable\Model\Source\Variables $configVariables + * Filter constructor. + * @param StringUtils $string + * @param LoggerInterface $logger + * @param Escaper $escaper + * @param Repository $assetRepo + * @param ScopeConfigInterface $scopeConfig + * @param VariableFactory $coreVariableFactory + * @param StoreManagerInterface $storeManager + * @param LayoutInterface $layout + * @param LayoutFactory $layoutFactory + * @param State $appState + * @param UrlInterface $urlModel + * @param Variables $configVariables + * @param VariableResolverInterface $variableResolver + * @param Css\Processor $cssProcessor + * @param Filesystem $pubDirectory + * @param CssInliner $cssInliner * @param array $variables - * @param \Magento\Framework\Css\PreProcessor\Adapter\CssInliner|null $cssInliner * @param array $directiveProcessors - * @param VariableResolverInterface|null $variableResolver - * @param Css\Processor|null $cssProcessor - * @param Filesystem|null $pubDirectory * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\Stdlib\StringUtils $string, - \Psr\Log\LoggerInterface $logger, - \Magento\Framework\Escaper $escaper, - \Magento\Framework\View\Asset\Repository $assetRepo, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Variable\Model\VariableFactory $coreVariableFactory, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\View\LayoutInterface $layout, - \Magento\Framework\View\LayoutFactory $layoutFactory, - \Magento\Framework\App\State $appState, - \Magento\Framework\UrlInterface $urlModel, - \Pelago\Emogrifier $emogrifier, - \Magento\Variable\Model\Source\Variables $configVariables, + StringUtils $string, + LoggerInterface $logger, + Escaper $escaper, + Repository $assetRepo, + ScopeConfigInterface $scopeConfig, + VariableFactory $coreVariableFactory, + StoreManagerInterface $storeManager, + LayoutInterface $layout, + LayoutFactory $layoutFactory, + State $appState, + UrlInterface $urlModel, + Variables $configVariables, + VariableResolverInterface $variableResolver, + Css\Processor $cssProcessor, + Filesystem $pubDirectory, + CssInliner $cssInliner, $variables = [], - \Magento\Framework\Css\PreProcessor\Adapter\CssInliner $cssInliner = null, - array $directiveProcessors = [], - VariableResolverInterface $variableResolver = null, - Css\Processor $cssProcessor = null, - Filesystem $pubDirectory = null + array $directiveProcessors = [] ) { $this->_escaper = $escaper; $this->_assetRepo = $assetRepo; @@ -237,13 +255,9 @@ public function __construct( $this->_layoutFactory = $layoutFactory; $this->_appState = $appState; $this->urlModel = $urlModel; - $this->emogrifier = $emogrifier; - $this->cssInliner = $cssInliner ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Framework\Css\PreProcessor\Adapter\CssInliner::class); - $this->cssProcessor = $cssProcessor ?: ObjectManager::getInstance() - ->get(Css\Processor::class); - $this->pubDirectory = $pubDirectory ?: ObjectManager::getInstance() - ->get(Filesystem::class); + $this->cssInliner = $cssInliner; + $this->cssProcessor = $cssProcessor; + $this->pubDirectory = $pubDirectory; $this->configVariables = $configVariables; parent::__construct($string, $variables, $directiveProcessors, $variableResolver); } @@ -395,7 +409,7 @@ public function blockDirective($construction) if (isset($blockParameters['class'])) { $block = $this->_layout->createBlock($blockParameters['class'], null, ['data' => $blockParameters]); } elseif (isset($blockParameters['id'])) { - $block = $this->_layout->createBlock(\Magento\Cms\Block\Block::class); + $block = $this->_layout->createBlock(Block::class); if ($block) { $block->setBlockId($blockParameters['id']); } @@ -436,7 +450,7 @@ public function layoutDirective($construction) { $this->_directiveParams = $this->getParameters($construction[2]); if (!isset($this->_directiveParams['area'])) { - $this->_directiveParams['area'] = \Magento\Framework\App\Area::AREA_FRONTEND; + $this->_directiveParams['area'] = Area::AREA_FRONTEND; } if ($this->_directiveParams['area'] != $this->_appState->getAreaCode()) { return $this->_appState->emulateAreaCode( @@ -457,7 +471,7 @@ public function emulateAreaCallback() { $skipParams = ['handle', 'area']; - /** @var $layout \Magento\Framework\View\LayoutInterface */ + /** @var $layout LayoutInterface */ $layout = $this->_layoutFactory->create(['cacheable' => false]); $layout->getUpdate()->addHandle($this->_directiveParams['handle'])->load(); @@ -466,7 +480,7 @@ public function emulateAreaCallback() $rootBlock = false; foreach ($layout->getAllBlocks() as $block) { - /* @var $block \Magento\Framework\View\Element\AbstractBlock */ + /* @var $block AbstractBlock */ if (!$block->getParentBlock() && !$rootBlock) { $rootBlock = $block; } @@ -499,7 +513,7 @@ public function emulateAreaCallback() */ protected function _getBlockParameters($value) { - $tokenizer = new \Magento\Framework\Filter\Template\Tokenizer\Parameter(); + $tokenizer = new Parameter(); $tokenizer->setString($value); return $tokenizer->tokenize(); @@ -529,7 +543,7 @@ public function mediaDirective($construction) // phpcs:disable Magento2.Functions.DiscouragedFunction $params = $this->getParameters(html_entity_decode($construction[2], ENT_QUOTES)); return $this->_storeManager->getStore() - ->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . $params['url']; + ->getBaseUrl(UrlInterface::URL_TYPE_MEDIA) . $params['url']; } /** @@ -573,10 +587,10 @@ public function storeDirective($construction) /** * Set current URL model, which will be used for URLs generation. * - * @param \Magento\Framework\UrlInterface $urlModel + * @param UrlInterface $urlModel * @return $this */ - public function setUrlModel(\Magento\Framework\UrlInterface $urlModel) + public function setUrlModel(UrlInterface $urlModel) { $this->urlModel = $urlModel; return $this; @@ -752,7 +766,7 @@ public function protocolDirective($construction) if (isset($params['store'])) { try { $store = $this->_storeManager->getStore($params['store']); - } catch (\Exception $e) { + } catch (Exception $e) { throw new MailException( __('Requested invalid store "%1"', $params['store']) ); @@ -820,7 +834,7 @@ public function configDirective($construction) if (isset($params['path']) && $this->isAvailableConfigVariable($params['path'])) { $configValue = $this->_scopeConfig->getValue( $params['path'], - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + ScopeInterface::SCOPE_STORE, $storeId ); } @@ -858,8 +872,8 @@ public function customvarDirective($construction) $params['code'] ); $mode = $this->isPlainTemplateMode() - ? \Magento\Variable\Model\Variable::TYPE_TEXT - : \Magento\Variable\Model\Variable::TYPE_HTML; + ? Variable::TYPE_TEXT + : Variable::TYPE_HTML; $value = $variable->getValue($mode); if ($value) { $customVarValue = $value; @@ -892,19 +906,17 @@ public function cssDirective($construction) return '/* ' . __('"file" parameter must be specified') . ' */'; } - $css = $this->cssProcessor->process( - $this->getCssFilesContent([$params['file']]) - ); + try { + $css = $this->cssProcessor->process($this->getCssFilesContent([$params['file']])); + } catch (ContentProcessorException $exception) { + return '/*' . PHP_EOL . $exception->getMessage() . PHP_EOL . '*/'; + } - if (strpos($css, ContentProcessorInterface::ERROR_MESSAGE_PREFIX) !== false) { - // Return compilation error wrapped in CSS comment - return '/*' . PHP_EOL . $css . PHP_EOL . '*/'; - } elseif (!empty($css)) { - return $css; - } else { - // Return CSS comment for debugging purposes + if (empty($css)){ return '/* ' . __('Contents of the specified CSS file could not be loaded or is empty') . ' */'; } + + return $css; } /** @@ -922,7 +934,7 @@ public function cssDirective($construction) * * @param string[] $construction * @return string - * @throws \Magento\Framework\Exception\MailException + * @throws MailException */ public function inlinecssDirective($construction) { @@ -939,7 +951,7 @@ public function inlinecssDirective($construction) $params = $this->getParameters($construction[2]); if (!isset($params['file']) || !$params['file']) { - throw new \Magento\Framework\Exception\MailException( + throw new MailException( __('"file" parameter must be specified and must not be empty') ); } @@ -978,7 +990,8 @@ protected function getInlineCssFiles() * * @param [] $files * @return string - * @throws \Magento\Framework\Exception\MailException + * @throws MailException + * @throws ContentProcessorException */ public function getCssFilesContent(array $files) { @@ -987,7 +1000,7 @@ public function getCssFilesContent(array $files) $designParams = $this->getDesignParams(); if (!count($designParams)) { - throw new \Magento\Framework\Exception\MailException( + throw new MailException( __('Design params must be set before calling this method') ); } @@ -1002,9 +1015,7 @@ public function getCssFilesContent(array $files) $css .= $asset->getContent(); } } - } catch (ContentProcessorException $exception) { - $css = $exception->getMessage(); - } catch (\Magento\Framework\View\Asset\File\NotFoundException $exception) { + } catch (NotFoundException $exception) { $css = ''; } @@ -1019,50 +1030,55 @@ public function getCssFilesContent(array $files) * * @param string $html * @return string - * @throws \Magento\Framework\Exception\MailException + * @throws MailException */ public function applyInlineCss($html) { - // Check to see if the {{inlinecss file=""}} directive set CSS file(s) to inline and then load those files - $cssToInline = $this->getCssFilesContent( - $this->getInlineCssFiles() - ); + try { + // Check to see if the {{inlinecss file=""}} directive set CSS file(s) to inline and then load those files + $cssToInline = $this->getCssFilesContent($this->getInlineCssFiles()); + } catch (ContentProcessorException $exception) { + return $this->getExceptionHtml($html, $exception); + } + $cssToInline = $this->cssProcessor->process($cssToInline); // Only run Emogrify if HTML and CSS contain content - if ($html && $cssToInline) { - try { - // Don't try to compile CSS that has compilation errors - if (strpos($cssToInline, ContentProcessorInterface::ERROR_MESSAGE_PREFIX) - !== false - ) { - throw new \Magento\Framework\Exception\MailException( - __('<pre> %1 </pre>', PHP_EOL . $cssToInline . PHP_EOL) - ); - } - - $this->cssInliner->setHtml($html); - - $this->cssInliner->setCss($cssToInline); - - // Don't parse inline <style> tags, since existing tag is intentionally for non-inline styles - $this->cssInliner->disableStyleBlocksParsing(); + if (!$html || !$cssToInline) { + return $html; + } - $processedHtml = $this->cssInliner->process(); - } catch (\Exception $e) { - if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { - $processedHtml = __('CSS inlining error:') . PHP_EOL . $e->getMessage() - . PHP_EOL - . $html; - } else { - $processedHtml = $html; - } - $this->_logger->error($e); + try { + // Don't try to compile CSS that has compilation errors + if (strpos($cssToInline, ContentProcessorInterface::ERROR_MESSAGE_PREFIX) !== false) { + throw new MailException(__('<pre> %1 </pre>', PHP_EOL . $cssToInline . PHP_EOL)); } - } else { - $processedHtml = $html; + $this->cssInliner->setHtml($html); + $this->cssInliner->setCss($cssToInline); + // Don't parse inline <style> tags, since existing tag is intentionally for non-inline styles + $this->cssInliner->disableStyleBlocksParsing(); + return $this->cssInliner->process(); + } catch (Exception $exception) { + return $this->getExceptionHtml($html, $exception); + } + } + + /** + * Handle css inlining exception, log it, add to the content in developer mode + * + * @param string $html + * @param Exception $exception + * @return string + */ + private function getExceptionHtml(string $html, Exception $exception): string + { + $this->_logger->error($exception); + if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { + return __('CSS inlining error:') . PHP_EOL . $exception->getMessage() + . PHP_EOL + . $html; } - return $processedHtml; + return $html; } /** @@ -1078,15 +1094,15 @@ public function filter($value) { try { $value = parent::filter($value); - } catch (\Exception $e) { + } catch (Exception $e) { // Since a single instance of this class can be used to filter content multiple times, reset callbacks to // prevent callbacks running for unrelated content (e.g., email subject and email body) $this->resetAfterFilterCallbacks(); - if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) { + if ($this->_appState->getMode() == State::MODE_DEVELOPER) { $value = sprintf(__('Error filtering template: %s'), $e->getMessage()); } else { - $value = __("We're sorry, an error has occurred while generating this content."); + $value = (string) __("We're sorry, an error has occurred while generating this content."); } $this->_logger->critical($e); } diff --git a/app/code/Magento/Email/Model/Transport.php b/app/code/Magento/Email/Model/Transport.php index 8811809207313..54f884c99d5d3 100644 --- a/app/code/Magento/Email/Model/Transport.php +++ b/app/code/Magento/Email/Model/Transport.php @@ -8,6 +8,7 @@ namespace Magento\Email\Model; use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\MailException; use Magento\Framework\Mail\MessageInterface; use Magento\Framework\Mail\TransportInterface; @@ -15,6 +16,7 @@ use Magento\Store\Model\ScopeInterface; use Laminas\Mail\Message; use Laminas\Mail\Transport\Sendmail; +use Psr\Log\LoggerInterface; /** * Class that responsible for filling some message data before transporting it. @@ -60,15 +62,22 @@ class Transport implements TransportInterface */ private $message; + /** + * @var LoggerInterface|null + */ + private $logger; + /** * @param MessageInterface $message Email message object * @param ScopeConfigInterface $scopeConfig Core store config * @param null|string|array|\Traversable $parameters Config options for sendmail parameters + * @param LoggerInterface|null $logger */ public function __construct( MessageInterface $message, ScopeConfigInterface $scopeConfig, - $parameters = null + $parameters = null, + LoggerInterface $logger = null ) { $this->isSetReturnPath = (int) $scopeConfig->getValue( self::XML_PATH_SENDING_SET_RETURN_PATH, @@ -81,6 +90,7 @@ public function __construct( $this->laminasTransport = new Sendmail($parameters); $this->message = $message; + $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class); } /** @@ -100,7 +110,8 @@ public function sendMessage() $this->laminasTransport->send($laminasMessage); } catch (\Exception $e) { - throw new MailException(new Phrase($e->getMessage()), $e); + $this->logger->error($e); + throw new MailException(new Phrase('Unable to send mail. Please try again later.')); } } diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php index ac890dd3d4a73..97a684b92be5d 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php @@ -38,7 +38,6 @@ use Magento\Store\Model\StoreManagerInterface; use Magento\Variable\Model\Source\Variables; use Magento\Variable\Model\VariableFactory; -use Pelago\Emogrifier; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -114,11 +113,6 @@ class FilterTest extends TestCase */ private $configVariables; - /** - * @var Emogrifier - */ - private $emogrifier; - /** * @var CssInliner */ @@ -144,6 +138,11 @@ class FilterTest extends TestCase */ private $variableResolver; + /** + * @var MockObject|VariableResolverInterface + */ + private $variableResolverInterface; + /** * @var array */ @@ -195,8 +194,6 @@ protected function setUp(): void ->disableOriginalConstructor() ->getMockForAbstractClass(); - $this->emogrifier = $this->objectManager->getObject(Emogrifier::class); - $this->configVariables = $this->getMockBuilder(Variables::class) ->disableOriginalConstructor() ->getMock(); @@ -257,20 +254,29 @@ protected function getModel($mockedMethods = null) $this->layoutFactory, $this->appState, $this->backendUrlBuilder, - $this->emogrifier, $this->configVariables, - [], - $this->cssInliner, - $this->directiveProcessors, $this->variableResolver, $this->cssProcessor, - $this->pubDirectory + $this->pubDirectory, + $this->cssInliner, + [], + $this->directiveProcessors ] ) ->setMethods($mockedMethods) ->getMock(); } + /** + * Test exception handling of filter method + */ + public function testFilterExceptionHandler() + { + $filter = $this->getModel(); + $filteredValue = $filter->filter(null); + $this->assertTrue(is_string($filteredValue)); + } + /** * Test basic usages of applyInlineCss * diff --git a/app/code/Magento/Email/Test/Unit/Model/TransportTest.php b/app/code/Magento/Email/Test/Unit/Model/TransportTest.php new file mode 100644 index 0000000000000..2c1ed4575fd53 --- /dev/null +++ b/app/code/Magento/Email/Test/Unit/Model/TransportTest.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Email\Test\Unit\Model; + +use Laminas\Mail\Transport\Exception\RuntimeException; +use Magento\Email\Model\Transport; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Mail\Message; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; + +/** + * Tests for email transport functionality. + */ +class TransportTest extends TestCase +{ + /** + * @var MockObject|LoggerInterface + */ + private $loggerMock; + + /** + * @var Transport + */ + private $transport; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @inheridoc + */ + protected function setUp(): void + { + $this->loggerMock = $this->getMockBuilder(LoggerInterface::class) + ->disableOriginalConstructor() + ->onlyMethods(['error']) + ->getMockForAbstractClass(); + $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->transport = new Transport( + new Message(), + $this->scopeConfigMock, + null, + $this->loggerMock + ); + } + + /** + * Verify exception is properly handled in case one occurred when message sent. + * + * @return void + */ + public function testSendMessageBrokenMessage(): void + { + $exception = new RuntimeException('Invalid email; contains no at least one of "To", "Cc", and "Bcc" header'); + $this->loggerMock->expects(self::once())->method('error')->with($exception); + $this->expectException('Magento\Framework\Exception\MailException'); + $this->expectExceptionMessage('Unable to send mail. Please try again later.'); + + $this->transport->sendMessage(); + } +} diff --git a/app/code/Magento/Email/i18n/en_US.csv b/app/code/Magento/Email/i18n/en_US.csv index 412660d90d469..c66902d749bfb 100644 --- a/app/code/Magento/Email/i18n/en_US.csv +++ b/app/code/Magento/Email/i18n/en_US.csv @@ -98,3 +98,4 @@ Action,Action "Email template chosen based on theme fallback, when the ""Default"" option is selected.","Email template chosen based on theme fallback, when the ""Default"" option is selected." "Header Template","Header Template" "Footer Template","Footer Template" +"Unable to send mail. Please try again later.","Unable to send mail. Please try again later." diff --git a/app/code/Magento/EncryptionKey/Model/ResourceModel/Key/Change.php b/app/code/Magento/EncryptionKey/Model/ResourceModel/Key/Change.php index bce4ec096a5e1..e687817be7431 100644 --- a/app/code/Magento/EncryptionKey/Model/ResourceModel/Key/Change.php +++ b/app/code/Magento/EncryptionKey/Model/ResourceModel/Key/Change.php @@ -108,6 +108,9 @@ public function changeEncryptionKey($key = null) } if (null === $key) { + // md5() here is not for cryptographic use. It used for generate encryption key itself + // and do not encrypt any passwords + // phpcs:ignore Magento2.Security.InsecureFunction $key = md5($this->random->getRandomString(ConfigOptionsListConstants::STORE_KEY_RANDOM_STRING_SIZE)); } $this->encryptor->setNewKey($key); diff --git a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml index 2144f486f9bde..174c04b601859 100644 --- a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml +++ b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml @@ -53,9 +53,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!--Reset configs--> @@ -77,9 +75,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Delete created data--> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/GiftMessage/view/frontend/web/template/gift-message-item-level.html b/app/code/Magento/GiftMessage/view/frontend/web/template/gift-message-item-level.html index 37f559feb5fbd..fe07c87d64617 100644 --- a/app/code/Magento/GiftMessage/view/frontend/web/template/gift-message-item-level.html +++ b/app/code/Magento/GiftMessage/view/frontend/web/template/gift-message-item-level.html @@ -33,17 +33,17 @@ <!-- ko text: getObservable('message') --><!-- /ko --> </div> <!-- /ko --> - + <div class="actions-toolbar"> <div class="secondary"> <button type="submit" class="action action-edit" data-bind=" click: $data.editOptions.bind($data), - attr: {title: $t('Edit')"> + attr: {title: $t('Edit')}"> <span data-bind="i18n: 'Edit'"></span> </button> <button class="action action-delete" data-bind=" click: $data.deleteOptions.bind($data), - attr: {title: $t('Delete')"> + attr: {title: $t('Delete')}"> <span data-bind="i18n: 'Delete'"></span> </button> </div> diff --git a/app/code/Magento/GoogleAdwords/Observer/SetConversionValueObserver.php b/app/code/Magento/GoogleAdwords/Observer/SetConversionValueObserver.php index 5886d68a71a3d..b97975182a631 100644 --- a/app/code/Magento/GoogleAdwords/Observer/SetConversionValueObserver.php +++ b/app/code/Magento/GoogleAdwords/Observer/SetConversionValueObserver.php @@ -21,6 +21,11 @@ class SetConversionValueObserver implements ObserverInterface */ protected $_collection; + /** + * @var \Magento\Framework\Registry + */ + private $_registry; + /** * Constructor * diff --git a/app/code/Magento/GoogleOptimizer/README.md b/app/code/Magento/GoogleOptimizer/README.md index c513b0d370afb..bffdfab1dfbe5 100644 --- a/app/code/Magento/GoogleOptimizer/README.md +++ b/app/code/Magento/GoogleOptimizer/README.md @@ -4,5 +4,5 @@ Google Experiment (on Google side) allows to make two variants of the same page From Magento side, code generated by Google should be saved and displayed on a particular page. Google Experiment functionality is available on pages of products, categories and cms pages. This allows to save different codes for products and categories on different store views. -This functionality can be switched on and off on the configuration page (Stores -> Configuration -> General -> Google Api -> Google Analytics). +This functionality can be switched on and off on the configuration page (Stores -> Configuration -> Sales -> Google Api -> Google Analytics). Also this functionality depends on Google Analytics module and configuration options. diff --git a/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php b/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php index 300b3d4f44dca..7fe82c13ae4c4 100644 --- a/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php +++ b/app/code/Magento/GraphQl/Controller/HttpRequestValidator/HttpVerbValidator.php @@ -11,6 +11,8 @@ use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\App\Request\Http; use Magento\GraphQl\Controller\HttpRequestValidatorInterface; +use GraphQL\Language\AST\Node; +use GraphQL\Language\AST\NodeKind; /** * Validator to check HTTP verb for Graphql requests @@ -29,11 +31,25 @@ public function validate(HttpRequestInterface $request) : void /** @var Http $request */ if (false === $request->isPost()) { $query = $request->getParam('query', ''); - // The easiest way to determine mutations without additional parsing - if (strpos(trim($query), 'mutation') === 0) { - throw new GraphQlInputException( - new \Magento\Framework\Phrase('Mutation requests allowed only for POST requests') + if (!empty($query)) { + $operationType = null; + $queryAst = \GraphQL\Language\Parser::parse(new \GraphQL\Language\Source($query ?: '', 'GraphQL')); + \GraphQL\Language\Visitor::visit( + $queryAst, + [ + 'leave' => [ + NodeKind::OPERATION_DEFINITION => function (Node $node) use (&$operationType) { + $operationType = $node->operation; + } + ] + ] ); + + if (strtolower($operationType) === 'mutation') { + throw new GraphQlInputException( + new \Magento\Framework\Phrase('Mutation requests allowed only for POST requests') + ); + } } } } diff --git a/app/code/Magento/GraphQl/Test/Unit/Controller/HttpRequestValidator/HttpVerbValidatorTest.php b/app/code/Magento/GraphQl/Test/Unit/Controller/HttpRequestValidator/HttpVerbValidatorTest.php new file mode 100644 index 0000000000000..8570242c65841 --- /dev/null +++ b/app/code/Magento/GraphQl/Test/Unit/Controller/HttpRequestValidator/HttpVerbValidatorTest.php @@ -0,0 +1,97 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\Test\Unit\Controller\HttpRequestValidator; + +use Magento\Framework\App\HttpRequestInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\GraphQl\Controller\HttpRequestValidator\HttpVerbValidator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test HttpVerbValidator + */ +class HttpVerbValidatorTest extends TestCase +{ + /** + * @var HttpVerbValidator|MockObject + */ + private $httpVerbValidator; + + /** + * @var HttpRequestInterface|MockObject + */ + private $requestMock; + + /** + * @inheritDoc + */ + protected function setup(): void + { + $objectManager = new ObjectManager($this); + $this->requestMock = $this->getMockBuilder(HttpRequestInterface::class) + ->disableOriginalConstructor() + ->onlyMethods( + [ + 'isPost', + ] + )->addMethods( + [ + 'getParam', + ] + ) + ->getMockForAbstractClass(); + + $this->httpVerbValidator = $objectManager->getObject( + HttpVerbValidator::class + ); + } + + /** + * Test for validate method + * + * @param string $query + * @param bool $needException + * @dataProvider validateDataProvider + */ + public function testValidate(string $query, bool $needException): void + { + $this->requestMock + ->expects($this->once()) + ->method('isPost') + ->willReturn(false); + + $this->requestMock + ->method('getParam') + ->with('query', '') + ->willReturn($query); + + if ($needException) { + $this->expectExceptionMessage('Syntax Error: Unexpected <EOF>'); + } + + $this->httpVerbValidator->validate($this->requestMock); + } + + /** + * @return array + */ + public function validateDataProvider(): array + { + return [ + [ + 'query' => '', + 'needException' => false, + ], + [ + 'query' => ' ', + 'needException' => true + ], + ]; + } +} diff --git a/app/code/Magento/GroupedImportExport/Plugin/CatalogImportExport/Model/StockItemImporter/UpdateGroupedProductStockStatusPlugin.php b/app/code/Magento/GroupedImportExport/Plugin/CatalogImportExport/Model/StockItemImporter/UpdateGroupedProductStockStatusPlugin.php new file mode 100644 index 0000000000000..57eff48893606 --- /dev/null +++ b/app/code/Magento/GroupedImportExport/Plugin/CatalogImportExport/Model/StockItemImporter/UpdateGroupedProductStockStatusPlugin.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GroupedImportExport\Plugin\CatalogImportExport\Model\StockItemImporter; + +use Magento\CatalogImportExport\Model\StockItemImporterInterface; +use Magento\GroupedProduct\Model\Inventory\ChangeParentStockStatus; + +/** + * Update grouped product stock status during import plugin. + */ +class UpdateGroupedProductStockStatusPlugin +{ + /** + * @var ChangeParentStockStatus + */ + private $changeParentStockStatus; + + /** + * @param ChangeParentStockStatus $changeParentStockStatus + */ + public function __construct(ChangeParentStockStatus $changeParentStockStatus) + { + $this->changeParentStockStatus = $changeParentStockStatus; + } + + /** + * Update grouped product stock status during import. + * + * @param StockItemImporterInterface $subject + * @param null $result + * @param array $stockData + * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterImport( + StockItemImporterInterface $subject, + $result, + array $stockData + ) { + $productIds = array_column($stockData, 'product_id'); + foreach ($productIds as $productId) { + $this->changeParentStockStatus->execute((int)$productId); + } + } +} diff --git a/app/code/Magento/GroupedImportExport/Test/Mftf/ActionGroup/AdminAssertGroupedProductInfoOnEditPageActionGroup.xml b/app/code/Magento/GroupedImportExport/Test/Mftf/ActionGroup/AdminAssertGroupedProductInfoOnEditPageActionGroup.xml new file mode 100644 index 0000000000000..65199d9f4710d --- /dev/null +++ b/app/code/Magento/GroupedImportExport/Test/Mftf/ActionGroup/AdminAssertGroupedProductInfoOnEditPageActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertGroupedProductGeneralInfoOnEditPageActionGroup" extends="AdminAssertProductInfoOnEditPageActionGroup"> + <annotations> + <description>Verifies the general data on the Edit product details page in admin for a grouped product.</description> + </annotations> + <remove keyForRemoval="seeProductPrice"/> + <remove keyForRemoval="seeProductWeight"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/GroupedImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 0000000000000..1f9fb35824219 --- /dev/null +++ b/app/code/Magento/GroupedImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Categories --> + <entity name="ImportCategory_Grouped" type="category"> + <data key="name">import-category-grouped</data> + <data key="name_lwr">import-category-grouped</data> + <data key="is_active">true</data> + <data key="include_in_menu">true</data> + <data key="urlKey">import-category-grouped</data> + </entity> + + <!-- Products --> + <entity name="ImportProductSimple1_Grouped" type="product"> + <data key="name">import-product-simple1-grouped</data> + <data key="sku">import-product-simple1-grouped</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">11.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">101</data> + <data key="groupedDefaultQuantity">3</data> + <data key="groupedPosition">1</data> + <data key="urlKey">import-product-simple1-grouped</data> + <data key="weight">1</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">magento-logo.png</data> + <data key="smallImageName">magento-logo</data> + <data key="thumbnailImage">magento-logo.png</data> + <data key="thumbnailImageName">magento-logo</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple2_Grouped" type="product"> + <data key="name">import-product-simple2-grouped</data> + <data key="sku">import-product-simple2-grouped</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">12.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">102</data> + <data key="groupedDefaultQuantity">2</data> + <data key="groupedPosition">0</data> + <data key="urlKey">import-product-simple2-grouped</data> + <data key="weight">2</data> + <data key="baseImage">m-logo.gif</data> + <data key="baseImageName">m-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">m-logo.gif</data> + <data key="thumbnailImageName">m-logo</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProductSimple3_Grouped" type="product"> + <data key="name">import-product-simple3-grouped</data> + <data key="sku">import-product-simple3-grouped</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="attributeSetText">Default</data> + <data key="price">13.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="statusText">Enabled</data> + <data key="quantity">103</data> + <data key="groupedDefaultQuantity">1</data> + <data key="groupedPosition">2</data> + <data key="urlKey">import-product-simple3-grouped</data> + <data key="weight">3</data> + <data key="baseImage">adobe-base.jpg</data> + <data key="baseImageName">adobe-base</data> + <data key="smallImage">adobe-base.jpg</data> + <data key="smallImageName">adobe-base</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="ImportProduct_Grouped" type="product"> + <data key="fileName">import_grouped_product.csv</data> + <data key="importSummary">Created: 4, Updated: 0, Deleted: 0</data> + <data key="name">import-product-grouped</data> + <data key="sku">import-product-grouped</data> + <data key="type_id">grouped</data> + <data key="attribute_set_id">4</data> + <data key="price"/> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="quantity">0</data> + <data key="weight">1</data> + <data key="urlKey">import-product-grouped</data> + <data key="baseImage">magento-logo.png</data> + <data key="baseImageName">magento-logo</data> + <data key="smallImage">m-logo.gif</data> + <data key="smallImageName">m-logo</data> + <data key="thumbnailImage">adobe-base.jpg</data> + <data key="thumbnailImageName">adobe-base</data> + </entity> +</entities> diff --git a/app/code/Magento/GroupedImportExport/Test/Mftf/Test/AdminImportGroupedProductTest.xml b/app/code/Magento/GroupedImportExport/Test/Mftf/Test/AdminImportGroupedProductTest.xml new file mode 100644 index 0000000000000..d02764c09a50e --- /dev/null +++ b/app/code/Magento/GroupedImportExport/Test/Mftf/Test/AdminImportGroupedProductTest.xml @@ -0,0 +1,315 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportGroupedProductTest"> + <annotations> + <features value="GroupedImportExport"/> + <stories value="Import Products"/> + <title value="Import Grouped Product"/> + <description value="Imports a .csv file containing a grouped product. Verifies that product is imported + successfully and can be purchased."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38408"/> + <group value="importExport"/> + <group value="GroupedProduct"/> + </annotations> + + <before> + <!-- Create Category & Customer --> + <createData entity="ImportCategory_Grouped" stepKey="createImportCategory"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Copy Images to Import Directory for Product Images --> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages"> + <argument name="path">var/import/images/{{ImportProduct_Grouped.name}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Grouped.baseImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple1_Grouped.baseImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Grouped.smallImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple2_Grouped.smallImage}}</argument> + </helper> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage"> + <argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + <argument name="destination">var/import/images/{{ImportProduct_Grouped.name}}/{{ImportProductSimple3_Grouped.thumbnailImage}}</argument> + </helper> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Delete Data --> + <deleteData createDataKey="createImportCategory" stepKey="deleteImportCategory"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteProductImageDirectory"> + <argument name="path">var/import/images/{{ImportProduct_Grouped.name}}</argument> + </helper> + <deleteData url="/V1/products/{{ImportProductSimple1_Grouped.urlKey}}" stepKey="deleteImportedSimpleProduct1"/> + <deleteData url="/V1/products/{{ImportProductSimple2_Grouped.urlKey}}" stepKey="deleteImportedSimpleProduct2"/> + <deleteData url="/V1/products/{{ImportProductSimple3_Grouped.urlKey}}" stepKey="deleteImportedSimpleProduct3"/> + <deleteData url="/V1/products/{{ImportProduct_Grouped.urlKey}}" stepKey="deleteImportedGroupedProduct"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="navigateToAndResetProductGridToDefaultView"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Grouped Product & Assert No Errors --> + <actionGroup ref="AdminNavigateToImportPageActionGroup" stepKey="navigateToImportPage"/> + <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> + <argument name="importFile" value="{{ImportProduct_Grouped.fileName}}"/> + <argument name="imagesFileDirectory" value="{{ImportProduct_Grouped.name}}"/> + </actionGroup> + <actionGroup ref="AdminClickCheckDataImportActionGroup" stepKey="clickCheckData"/> + <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{ImportCommonMessages.validFile}}" stepKey="seeCheckDataResultMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage"/> + <actionGroup ref="AdminClickImportActionGroup" stepKey="clickImport"/> + <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{ImportProduct_Grouped.importSummary}}" stepKey="seeNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.messageByType('success')}}" userInput="{{ImportCommonMessages.success}}" stepKey="seeImportMessage"/> + <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage2"/> + + <!-- Reindex --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + + <!-- Admin: Verify Data on Import History Page --> + <actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/> + <actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending"> + <argument name="columnLabel" value="history_id"/> + </actionGroup> + <see userInput="{{ImportProduct_Grouped.fileName}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/> + <see userInput="{{ImportProduct_Grouped.importSummary}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/> + + <!-- Admin: Verify Simple Product 1 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct1EditPage"> + <argument name="product" value="ImportProductSimple1_Grouped"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct1OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple1_Grouped.status}}"/> + <argument name="productName" value="{{ImportProductSimple1_Grouped.name}}"/> + <argument name="productSku" value="{{ImportProductSimple1_Grouped.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple1_Grouped.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple1_Grouped.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple1_Grouped.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Grouped.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Grouped.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Grouped.baseImageName, 'image')}}" stepKey="seeBaseImageRole1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Grouped.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Grouped.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole1"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct1ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple1_Grouped.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple1_Grouped.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole1"/> + + <!-- Admin: Verify Simple Product 2 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct2EditPage"> + <argument name="product" value="ImportProductSimple2_Grouped"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct2OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple2_Grouped.status}}"/> + <argument name="productName" value="{{ImportProductSimple2_Grouped.name}}"/> + <argument name="productSku" value="{{ImportProductSimple2_Grouped.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple2_Grouped.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple2_Grouped.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple2_Grouped.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Grouped.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Grouped.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Grouped.baseImageName, 'image')}}" stepKey="seeBaseImageRole2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Grouped.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Grouped.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole2"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct2ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple2_Grouped.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple2_Grouped.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole2"/> + + <!-- Admin: Verify Simple Product 3 on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToSimpleProduct3EditPage"> + <argument name="product" value="ImportProductSimple3_Grouped"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct3OnEditPage"> + <argument name="productStatus" value="{{ImportProductSimple3_Grouped.status}}"/> + <argument name="productName" value="{{ImportProductSimple3_Grouped.name}}"/> + <argument name="productSku" value="{{ImportProductSimple3_Grouped.sku}}"/> + <argument name="productPrice" value="{{ImportProductSimple3_Grouped.price}}"/> + <argument name="productQuantity" value="{{ImportProductSimple3_Grouped.quantity}}"/> + <argument name="productWeight" value="{{ImportProductSimple3_Grouped.weight}}"/> + <argument name="categoryName" value="{{ImportCategory_Grouped.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3BaseImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Grouped.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Grouped.baseImageName, 'image')}}" stepKey="seeBaseImageRole3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3SmallImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Grouped.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Grouped.smallImageName, 'small_image')}}" stepKey="seeSmallImageRole3"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProduct3ThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProductSimple3_Grouped.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProductSimple3_Grouped.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRole3"/> + + <!-- Admin: Verify Grouped Product Common Data on Edit Product Page --> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToGroupedProductEditPage"> + <argument name="product" value="ImportProduct_Grouped"/> + </actionGroup> + <actionGroup ref="AdminAssertGroupedProductGeneralInfoOnEditPageActionGroup" stepKey="assertGroupedProductOnEditPage"> + <argument name="productStatus" value="{{ImportProduct_Grouped.status}}"/> + <argument name="productName" value="{{ImportProduct_Grouped.name}}"/> + <argument name="productSku" value="{{ImportProduct_Grouped.sku}}"/> + <argument name="productQuantity" value="{{ImportProduct_Grouped.quantity}}"/> + <argument name="categoryName" value="{{ImportCategory_Grouped.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertGroupedProductBaseImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Grouped.baseImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Grouped.baseImageName, 'image')}}" stepKey="seeBaseImageRoleGrouped"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertGroupedProductSmallImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Grouped.smallImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Grouped.smallImageName, 'small_image')}}" stepKey="seeSmallImageRoleGrouped"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertGroupedProductThumbnailImageOnEditPage"> + <argument name="image" value="{{ImportProduct_Grouped.thumbnailImageName}}"/> + </actionGroup> + <seeElement selector="{{AdminProductImagesSection.imageFileRoleByImage(ImportProduct_Grouped.thumbnailImageName, 'thumbnail')}}" stepKey="seeThumbnailImageRoleGrouped"/> + + <!-- Admin: Verify Grouped Product Information on Edit Product Page --> + <seeNumberOfElements userInput="3" selector="{{AdminGroupedProductOptionGridSection.allRows}}" stepKey="see3RowsAdmin"/> + <actionGroup ref="AdminVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct1Admin"> + <argument name="image" value="{{ImportProductSimple2_Grouped.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple2_Grouped.name}}"/> + <argument name="attributeSet" value="{{ImportProductSimple2_Grouped.attributeSetText}}"/> + <argument name="status" value="{{ImportProductSimple2_Grouped.statusText}}"/> + <argument name="sku" value="{{ImportProductSimple2_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple2_Grouped.price}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple2_Grouped.groupedDefaultQuantity}}"/> + <argument name="position" value="{{ImportProductSimple2_Grouped.groupedPosition}}"/> + <argument name="index" value="1"/> + </actionGroup> + <actionGroup ref="AdminVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct2Admin"> + <argument name="image" value="{{ImportProductSimple1_Grouped.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple1_Grouped.name}}"/> + <argument name="attributeSet" value="{{ImportProductSimple1_Grouped.attributeSetText}}"/> + <argument name="status" value="{{ImportProductSimple1_Grouped.statusText}}"/> + <argument name="sku" value="{{ImportProductSimple1_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple1_Grouped.price}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple1_Grouped.groupedDefaultQuantity}}"/> + <argument name="position" value="{{ImportProductSimple1_Grouped.groupedPosition}}"/> + <argument name="index" value="2"/> + </actionGroup> + <actionGroup ref="AdminVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct3Admin"> + <argument name="image" value="{{ImportProductSimple3_Grouped.thumbnailImageName}}"/> + <argument name="name" value="{{ImportProductSimple3_Grouped.name}}"/> + <argument name="attributeSet" value="{{ImportProductSimple3_Grouped.attributeSetText}}"/> + <argument name="status" value="{{ImportProductSimple3_Grouped.statusText}}"/> + <argument name="sku" value="{{ImportProductSimple3_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple3_Grouped.price}}"/> + <argument name="defaultQuantity" value="{{ImportProductSimple3_Grouped.groupedDefaultQuantity}}"/> + <argument name="position" value="{{ImportProductSimple3_Grouped.groupedPosition}}"/> + <argument name="index" value="3"/> + </actionGroup> + + <!-- Storefront: Verify Grouped Product In Category --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> + <argument name="categoryUrl" value="{{ImportCategory_Grouped.name}}"/> + </actionGroup> + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productName}}" userInput="4" stepKey="see4Products"/> + <see userInput="{{ImportProductSimple1_Grouped.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct1"/> + <see userInput="{{ImportProductSimple2_Grouped.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct2"/> + <see userInput="{{ImportProductSimple3_Grouped.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeSimpleProduct3"/> + <see userInput="{{ImportProduct_Grouped.name}}" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeGroupedProduct"/> + + <!-- Storefront: Verify Grouped Product Info & Images --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> + <argument name="productUrl" value="{{ImportProduct_Grouped.urlKey}}"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Grouped.name}}" stepKey="seeProductName"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Grouped.sku}}" stepKey="seeSku"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple1_Grouped.baseImageName)}}" stepKey="seeProduct1BaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple2_Grouped.baseImageName)}}" stepKey="seeProduct2BaseImage"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple3_Grouped.baseImageName)}}" stepKey="seeProduct3BaseImage"/> + + <!-- Storefront: Verify Associated Grouped Products --> + <seeNumberOfElements userInput="3" selector="{{StorefrontProductInfoMainSection.groupedProductsTableAllRows}}" stepKey="see3RowsStorefront"/> + <actionGroup ref="StorefrontVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct1Storefront"> + <argument name="name" value="{{ImportProductSimple2_Grouped.name}}"/> + <argument name="price" value="${{ImportProductSimple2_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple2_Grouped.groupedDefaultQuantity}}"/> + <argument name="index" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct2Storefront"> + <argument name="name" value="{{ImportProductSimple1_Grouped.name}}"/> + <argument name="price" value="${{ImportProductSimple1_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple1_Grouped.groupedDefaultQuantity}}"/> + <argument name="index" value="2"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedProduct3Storefront"> + <argument name="name" value="{{ImportProductSimple3_Grouped.name}}"/> + <argument name="price" value="${{ImportProductSimple3_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple3_Grouped.groupedDefaultQuantity}}"/> + <argument name="index" value="3"/> + </actionGroup> + + <!-- Purchase Grouped Product --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="navigateToCheckoutPage"/> + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Confirm Purchased Grouped Product --> + <actionGroup ref="StorefrontOpenOrderFromSuccessPageActionGroup" stepKey="openOrderFromSuccessPage"> + <argument name="orderNumber" value="{$grabOrderNumber}"/> + </actionGroup> + <executeJS function="return (Math.round(({{ImportProductSimple1_Grouped.price}}*{{ImportProductSimple1_Grouped.groupedDefaultQuantity}})*100)/100).toString()" stepKey="simpleProduct1Subtotal"/> + <executeJS function="return (Math.round(({{ImportProductSimple2_Grouped.price}}*{{ImportProductSimple2_Grouped.groupedDefaultQuantity}})*100)/100).toString()" stepKey="simpleProduct2Subtotal"/> + <executeJS function="return (Math.round(({{ImportProductSimple3_Grouped.price}}*{{ImportProductSimple3_Grouped.groupedDefaultQuantity}})*100)/100).toString()" stepKey="simpleProduct3Subtotal"/> + <actionGroup ref="StorefrontVerifyCustomerOrderProductRowDataActionGroup" stepKey="verifyProductRow1InOrder"> + <argument name="name" value="{{ImportProductSimple2_Grouped.name}}"/> + <argument name="sku" value="{{ImportProductSimple2_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple2_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple2_Grouped.groupedDefaultQuantity}}"/> + <argument name="subtotal" value="{$simpleProduct2Subtotal}"/> + <argument name="index" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyCustomerOrderProductRowDataActionGroup" stepKey="verifyProductRow2InOrder"> + <argument name="name" value="{{ImportProductSimple1_Grouped.name}}"/> + <argument name="sku" value="{{ImportProductSimple1_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple1_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple1_Grouped.groupedDefaultQuantity}}"/> + <argument name="subtotal" value="{$simpleProduct1Subtotal}"/> + <argument name="index" value="2"/> + </actionGroup> + <actionGroup ref="StorefrontVerifyCustomerOrderProductRowDataActionGroup" stepKey="verifyProductRow3InOrder"> + <argument name="name" value="{{ImportProductSimple3_Grouped.name}}"/> + <argument name="sku" value="{{ImportProductSimple3_Grouped.sku}}"/> + <argument name="price" value="${{ImportProductSimple3_Grouped.price}}"/> + <argument name="quantity" value="{{ImportProductSimple3_Grouped.groupedDefaultQuantity}}"/> + <argument name="subtotal" value="{$simpleProduct3Subtotal}"/> + <argument name="index" value="3"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/GroupedImportExport/etc/di.xml b/app/code/Magento/GroupedImportExport/etc/di.xml index 25fd3b5697514..d6a8ae2bfaff6 100644 --- a/app/code/Magento/GroupedImportExport/etc/di.xml +++ b/app/code/Magento/GroupedImportExport/etc/di.xml @@ -13,4 +13,7 @@ </argument> </arguments> </type> + <type name="Magento\CatalogImportExport\Model\StockItemImporterInterface"> + <plugin name="update_grouped_product_stock_status_plugin" type="Magento\GroupedImportExport\Plugin\CatalogImportExport\Model\StockItemImporter\UpdateGroupedProductStockStatusPlugin" /> + </type> </config> diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php index b56e8657df722..24e4e49f51b9c 100644 --- a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php @@ -351,7 +351,12 @@ protected function getProductInfo(\Magento\Framework\DataObject $buyRequest, $pr if ($isStrictProcessMode && !$subProduct->getQty() && $subProduct->isSalable()) { return __('Please specify the quantity of product(s).')->render(); } - $productsInfo[$subProduct->getId()] = $subProduct->isSalable() ? (float)$subProduct->getQty() : 0; + if (isset($buyRequest['qty']) && !isset($buyRequest['super_group'])) { + $subProductQty = (float)$subProduct->getQty() * (float)$buyRequest['qty']; + $productsInfo[$subProduct->getId()] = $subProduct->isSalable() ? $subProductQty : 0; + } else { + $productsInfo[$subProduct->getId()] = $subProduct->isSalable() ? (float)$subProduct->getQty() : 0; + } } } diff --git a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php index 4c24cdb752d3c..4a6e98ab966c4 100644 --- a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php @@ -157,6 +157,12 @@ private function prepareGroupedProductPriceDataSelect(array $dimensions, array $ 'tier_price' => new \Zend_Db_Expr('NULL'), ] ); + // customer group website limitations + $select->joinLeft( + ['cgw' => $this->getTable('customer_group_excluded_website')], + 'i.customer_group_id = cgw.customer_group_id AND i.website_id = cgw.website_id', + [] + ); $select->group( ['e.entity_id', 'i.customer_group_id', 'i.website_id'] ); @@ -169,6 +175,9 @@ private function prepareGroupedProductPriceDataSelect(array $dimensions, array $ $select->where('e.entity_id IN(?)', $entityIds, \Zend_Db::INT_TYPE); } + // exclude websites that are limited for customer group + $select->where('cgw.website_id IS NULL'); + return $select; } diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminVerifyAssociatedProductForGroupedProductActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminVerifyAssociatedProductForGroupedProductActionGroup.xml new file mode 100644 index 0000000000000..8d4c53e26d483 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminVerifyAssociatedProductForGroupedProductActionGroup.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminVerifyAssociatedProductForGroupedProductActionGroup"> + <annotations> + <description>Verify product data for the specified row in the Associated Grouped Products grid on the Edit + Product page in admin for a Grouped Product.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="Magento_Catalog/images/product/placeholder/thumbnail.jpg" type="string"/> + <argument name="name" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="attributeSet" defaultValue="Default" type="string"/> + <argument name="status" defaultValue="Enabled" type="string"/> + <argument name="sku" defaultValue="{{_defaultProduct.sku}}" type="string"/> + <argument name="price" defaultValue="${{_defaultProduct.price}}" type="string"/> + <argument name="defaultQuantity" defaultValue="0" type="string"/> + <argument name="position" defaultValue="0" type="string"/> + <argument name="index" defaultValue="1" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminGroupedProductOptionGridSection.productImage(index)}}" stepKey="waitForProductImage"/> + <grabAttributeFrom userInput="src" selector="{{AdminGroupedProductOptionGridSection.productImage(index)}}" stepKey="grabProductImageSrc"/> + <assertStringContainsString stepKey="assertProductImageSrc"> + <expectedResult type="string">{{image}}</expectedResult> + <actualResult type="variable">$grabProductImageSrc</actualResult> + </assertStringContainsString> + <see userInput="{{name}}" selector="{{AdminGroupedProductOptionGridSection.productNameByRow(index)}}" stepKey="seeProductName"/> + <see userInput="{{attributeSet}}" selector="{{AdminGroupedProductOptionGridSection.productAttributeSet(index)}}" stepKey="seeProductAttributeSet"/> + <see userInput="{{status}}" selector="{{AdminGroupedProductOptionGridSection.productStatus(index)}}" stepKey="seeProductStatus"/> + <see userInput="{{sku}}" selector="{{AdminGroupedProductOptionGridSection.productSku(index)}}" stepKey="seeProductSku"/> + <see userInput="{{price}}" selector="{{AdminGroupedProductOptionGridSection.productPrice(index)}}" stepKey="seeProductPrice"/> + <seeInField userInput="{{defaultQuantity}}" selector="{{AdminGroupedProductOptionGridSection.productDefaultQuantity(index)}}" stepKey="seeProductDefaultQuantity"/> + <seeInField userInput="{{position}}" selector="{{AdminGroupedProductOptionGridSection.productPosition(index)}}" stepKey="seeProductPosition"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontVerifyAssociatedProductForGroupedProductActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontVerifyAssociatedProductForGroupedProductActionGroup.xml new file mode 100644 index 0000000000000..1524f235edfe8 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontVerifyAssociatedProductForGroupedProductActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontVerifyAssociatedProductForGroupedProductActionGroup"> + <annotations> + <description>Verify product data for the specified row in the Associated Grouped Products grid on the + storefront Product page for a Grouped Product.</description> + </annotations> + <arguments> + <argument name="name" defaultValue="{{_defaultProduct.name}}" type="string"/> + <argument name="price" defaultValue="${{_defaultProduct.price}}" type="string"/> + <argument name="quantity" defaultValue="0" type="string"/> + <argument name="index" defaultValue="1" type="string"/> + </arguments> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.groupedProductsTableAllRows}}" stepKey="waitForGroupedProductRows"/> + <see userInput="{{name}}" selector="{{StorefrontProductInfoMainSection.groupedProductsAssociatedProductName(index)}}" stepKey="seeProductName"/> + <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.groupedProductsAssociatedProductPrice(index)}}" stepKey="seeProductPrice"/> + <seeInField userInput="{{quantity}}" selector="{{StorefrontProductInfoMainSection.groupedProductsAssociatedProductQuantity(index)}}" stepKey="seeProductQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml index 1fff52c1d30cd..1b61dd8cb4c0a 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml @@ -9,7 +9,18 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminGroupedProductOptionGridSection"> + <element name="allRows" type="text" selector="[data-index=associated] .data-row"/> + <element name="productId" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=id]"/> + <element name="productImage" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) [data-index=thumbnail] img"/> <element name="productName" type="text" selector=".data-row td[data-index='name']"/> + <element name="productNameByRow" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=name]"/> + <element name="productAttributeSet" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=attribute_set]"/> + <element name="productStatus" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=status]"/> <element name="productSku" type="text" selector=".data-row td[data-index='sku']"/> + <element name="productSkuByRow" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=sku]"/> + <element name="productPrice" type="text" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) span[data-index=price]"/> + <element name="productDefaultQuantity" type="input" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) [data-index=qty] input"/> + <element name="productPosition" type="input" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) .position-widget-input"/> + <element name="removeProduct" type="button" parameterized="true" selector="[data-index=associated] .data-row:nth-of-type({{index}}) button[data-action=remove_row]"/> </section> </sections> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml index 45d8e63343734..b9df178da4909 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml @@ -10,5 +10,9 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontProductInfoMainSection"> <element name="groupedProductsTable" type="text" selector="#super-product-table .product-item-name"/> + <element name="groupedProductsTableAllRows" type="text" selector="#super-product-table tbody tr"/> + <element name="groupedProductsAssociatedProductName" type="text" parameterized="true" selector="#super-product-table tbody tr:nth-of-type({{index}}) .product-item-name"/> + <element name="groupedProductsAssociatedProductPrice" type="text" parameterized="true" selector="#super-product-table tbody tr:nth-of-type({{index}}) .price"/> + <element name="groupedProductsAssociatedProductQuantity" type="input" parameterized="true" selector="#super-product-table tbody tr:nth-of-type({{index}}) input.qty"/> </section> </sections> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml index 23b1499c2d4e8..983c54d769708 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml @@ -68,7 +68,7 @@ <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AdminAssertProductImageOnProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml index a909582c32b3d..16a3ad59b5494 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml @@ -51,11 +51,7 @@ <argument name="StoreGroup" value="SecondStoreGroupUnique"/> <argument name="customStore" value="SecondStoreUnique"/> </actionGroup> - - <!-- Reindex --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAllIndexes"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAllIndexes"/> </before> <after> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml index b842dad9c8c4e..b6d6fbac370ea 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml @@ -90,7 +90,7 @@ <!-- Open grouped product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> - <argument name="productUrl" value="{{GroupedProduct.sku}}"/> + <argument name="productUrl" value="{{GroupedProduct.urlKey}}"/> </actionGroup> <!-- Assert product design settings "left bar is present at product page with 2 columns" --> @@ -153,7 +153,7 @@ <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="{{ApiGroupedProduct.name}}"/> + <argument name="productUrl" value="{{ApiGroupedProduct.urlKey}}"/> </actionGroup> <!-- Assert product design settings "right bar is present at the product page with 2 columns" --> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml index a00a341c4e6af..4dd89289d1027 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml @@ -37,21 +37,31 @@ <argument name="product" value="$$createGroupedProduct$$"/> </actionGroup> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="deleteMessage"> + <argument name="message" value="A total of 1 record(s) have been deleted."/> + </actionGroup> <!--Verify product on Product Page --> - <amOnPage url="{{StorefrontProductPage.url($$createGroupedProduct.name$$)}}" stepKey="amOnGroupedProductPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="amOnGroupedProductPage"> + <argument name="productUrl" value="$$createGroupedProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup" stepKey="seeWhoops"> + <argument name="product" value="$$createGroupedProduct$$"/> + </actionGroup> <!--Search for the product by sku--> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> <argument name="query" value="$$createGroupedProduct.sku$$"/> </actionGroup> <!-- Should not see any search results --> - <dontSee userInput="$$createGroupedProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/> - <see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/> + <actionGroup ref="AssertStorefrontProductNotOnSearchPageActionGroup" stepKey="dontSeeProduct"> + <argument name="productSku" value="$$createGroupedProduct.sku$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontNoResultsMessageOnSearchPageActionGroup" stepKey="seeCantFindProductOneMessage"/> <!-- Go to the category page that we created in the before block --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> - <!-- Should not see the product --> - <dontSee userInput="$$createGroupedProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> - <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="onCategoryPage"/> + <actionGroup ref="AssertStorefrontProductAbsentOnCategoryPageActionGroup" stepKey="dontSeeProductInCategory"> + <argument name="categoryUrlKey" value="$$createCategory.name$$"/> + <argument name="productName" value="$$createGroupedProduct.name$$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontNoProductsFoundActionGroup" stepKey="seeEmptyProductMessage"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml index d9f9d8ecd9382..2674ead37b348 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml @@ -35,6 +35,6 @@ </actionGroup> <!--Checking content storefront--> - <amOnPage url="{{GroupedProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{GroupedProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml index a0698224b780c..1023a320b248b 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml @@ -24,6 +24,7 @@ <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters" after="deleteProduct"/> </after> <!-- Create product --> @@ -37,6 +38,6 @@ <magentoCLI command="cron:run --group=index" stepKey="runCronIndexer"/> <!--See related product in storefront--> - <amOnPage url="{{GroupedProduct.sku}}.html" stepKey="goToStorefront"/> + <amOnPage url="{{GroupedProduct.urlKey}}.html" stepKey="goToStorefront"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml index 4aa4e99e79489..63909e5322ee7 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByDescriptionTest.xml @@ -14,8 +14,8 @@ <title value="Guest customer should be able to advance search Grouped product with product description"/> <description value="Guest customer should be able to advance search Grouped product with product description"/> <severity value="MAJOR"/> - <testCaseId value="MC-282"/> - <group value="GroupedProduct"/> + <testCaseId value="MC-25443"/> + <group value="groupedProduct"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -30,9 +30,7 @@ <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple2"/> </updateData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -41,9 +39,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml index 06dde74de20f9..099511395f9f5 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByNameTest.xml @@ -14,8 +14,8 @@ <title value="Guest customer should be able to advance search Grouped product with product name"/> <description value="Guest customer should be able to advance search Grouped product with product name"/> <severity value="MAJOR"/> - <testCaseId value="MC-141"/> - <group value="GroupedProduct"/> + <testCaseId value="MC-25344"/> + <group value="groupedProduct"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -30,9 +30,7 @@ <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple2"/> </updateData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -41,9 +39,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml index 66e1b60331e97..4c754628cd42c 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByPriceTest.xml @@ -14,8 +14,8 @@ <title value="Guest customer should be able to advance search Grouped product with product price"/> <description value="Guest customer should be able to advance search Grouped product with product price"/> <severity value="MAJOR"/> - <testCaseId value="MC-284"/> - <group value="GroupedProduct"/> + <testCaseId value="MC-25445"/> + <group value="groupedProduct"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -39,9 +39,7 @@ <getData entity="GetProduct" stepKey="arg3"> <requiredEntity createDataKey="simple2"/> </getData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -50,9 +48,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml index 79b465abe2ac6..bdbe079935e21 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductByShortDescriptionTest.xml @@ -14,8 +14,8 @@ <title value="Guest customer should be able to advance search Grouped product with product short description"/> <description value="Guest customer should be able to advance search Grouped product with product short description"/> <severity value="MAJOR"/> - <testCaseId value="MC-283"/> - <group value="GroupedProduct"/> + <testCaseId value="MC-25444"/> + <group value="groupedProduct"/> <group value="SearchEngineElasticsearch"/> </annotations> <before> @@ -30,9 +30,7 @@ <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple2"/> </updateData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -41,9 +39,9 @@ <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> </after> - <see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> - <see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> - <see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/> - <see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/> + <see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/> + <see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/> + <comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml index c196abbce99ed..5142558eaff66 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest/AdvanceCatalogSearchGroupedProductBySkuTest.xml @@ -29,9 +29,7 @@ <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple2"/> </updateData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchGroupedProductBySkuWithHyphenTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchGroupedProductBySkuWithHyphenTest.xml index c141c179330f5..632bdcfa78d85 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchGroupedProductBySkuWithHyphenTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/StorefrontAdvanceCatalogSearchGroupedProductBySkuWithHyphenTest.xml @@ -15,16 +15,13 @@ <title value="Guest customer should be able to advance search Grouped product with product sku that in camelCase format"/> <description value="Guest customer should be able to advance search Grouped product with product sku that in camelCase format"/> <severity value="MAJOR"/> - <testCaseId value="MC-20519"/> + <testCaseId value="MC-28832"/> <group value="GroupedProduct"/> <group value="SearchEngineElasticsearch"/> - <skip> - <issueId value="MC-34217"/> - </skip> </annotations> <before> - <createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/> - <createData entity="ApiProductWithDescription" stepKey="simple2" before="product"/> + <createData entity="ApiProductWithDescription" before="simple2" stepKey="simple1"/> + <createData entity="ApiProductWithDescription" before="product" stepKey="simple2"/> <createData entity="ApiGroupedProduct" stepKey="product"/> <createData entity="OneSimpleProductLink" stepKey="addProductOne"> <requiredEntity createDataKey="product"/> @@ -42,8 +39,8 @@ </actionGroup> </before> <after> - <deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/> - <deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/> + <deleteData createDataKey="simple1" before="deleteSimple2" stepKey="deleteSimple1"/> + <deleteData createDataKey="simple2" before="delete" stepKey="deleteSimple2"/> </after> </test> </tests> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml b/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml index 0872afcc8b3c7..99b6e44feffee 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /* @var $block \Magento\GroupedProduct\Block\Product\Grouped\AssociatedProducts\ListAssociatedProducts */ ?> <script type="text/x-magento-template" id="group-product-template"> diff --git a/app/code/Magento/GroupedProductGraphQl/etc/graphql/di.xml b/app/code/Magento/GroupedProductGraphQl/etc/graphql/di.xml index 003ce50834297..84eab3bf132a2 100644 --- a/app/code/Magento/GroupedProductGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/GroupedProductGraphQl/etc/graphql/di.xml @@ -45,4 +45,12 @@ </argument> </arguments> </type> + + <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver"> + <arguments> + <argument name="productTypeNameResolvers" xsi:type="array"> + <item name="grouped_product_type_resolver" xsi:type="object">Magento\GroupedProductGraphQl\Model\GroupedProductTypeResolver</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls b/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls index 7c9e17a3d6d0b..c0d309130a3ef 100644 --- a/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/GroupedProductGraphQl/etc/schema.graphqls @@ -1,7 +1,7 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. -type GroupedProduct implements ProductInterface, PhysicalProductInterface @doc(description: "GroupedProduct defines a grouped product") { +type GroupedProduct implements ProductInterface, RoutableInterface, PhysicalProductInterface @doc(description: "A grouped product consists of simple standalone products that are presented as a group") { items: [GroupedProductItem] @doc(description: "An array containing grouped product items") @resolver(class: "Magento\\GroupedProductGraphQl\\Model\\Resolver\\GroupedItems") } diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php index d032f2f7621b2..b4d45dde94a65 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php @@ -7,6 +7,8 @@ use Magento\Eav\Model\Entity\Attribute; use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Framework\App\ObjectManager; +use Magento\ImportExport\Model\ResourceModel\Export\AttributeGridCollectionFactory; /** * Export filter block @@ -40,20 +42,29 @@ class Filter extends \Magento\Backend\Block\Widget\Grid\Extended 'updated_at' => \Magento\ImportExport\Model\Export::FILTER_TYPE_DATE, ]; + /** + * @var AttributeGridCollectionFactory + */ + private $attributeGridCollectionFactory; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\ImportExport\Helper\Data $importExportData * @param array $data + * @param AttributeGridCollectionFactory|null $attributeGridCollectionFactory */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\ImportExport\Helper\Data $importExportData, - array $data = [] + array $data = [], + ?AttributeGridCollectionFactory $attributeGridCollectionFactory = null ) { $this->_importExportData = $importExportData; parent::__construct($context, $backendHelper, $data); + $this->attributeGridCollectionFactory = $attributeGridCollectionFactory + ?: ObjectManager::getInstance()->get(AttributeGridCollectionFactory::class); } /** @@ -263,7 +274,7 @@ protected function _getSelectHtmlWithValue(Attribute $attribute, $value) '', ['data' => $arguments] ); - return $selectBlock->setOptions($options)->setValue($value)->getHtml(); + return $selectBlock->setOptions($options)->setValue($value !== '' ? $value : null)->getHtml(); } else { return __('We can\'t filter an attribute with no attribute options.'); } @@ -426,7 +437,10 @@ public function getRowUrl($row) */ public function prepareCollection(\Magento\Framework\Data\Collection $collection) { - $this->setCollection($collection); - return $this->getCollection(); + $attributeGridCollection = $this->attributeGridCollectionFactory->create(); + $gridCollection = $attributeGridCollection->setItems($collection->getItems()); + $this->setCollection($gridCollection); + + return $collection; } } diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php index 07cf6f8c733d4..b24cad16897ac 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php @@ -287,7 +287,7 @@ private function getImportBehaviorTooltip() { $html = '<div class="admin__field-tooltip tooltip"> <a class="admin__field-tooltip-action action-help" target="_blank" title="What is this?" - href="https://docs.magento.com/m2/ce/user_guide/system/data-import.html"><span>' + href="https://docs.magento.com/user-guide/system/data-import.html"><span>' . __('What is this?') . '</span></a></div>'; return $html; diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php index 43cc467ad390b..18b319f7a25c9 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php @@ -76,7 +76,7 @@ public function execute() { if ($this->getRequest()->getPost(ExportModel::FILTER_ELEMENT_GROUP)) { try { - $params = $this->getRequest()->getParams(); + $params = $this->getRequestParameters(); if (!array_key_exists('skip_attr', $params)) { $params['skip_attr'] = []; @@ -109,4 +109,14 @@ public function execute() $resultRedirect->setPath('adminhtml/*/index'); return $resultRedirect; } + + /** + * Retrieve all params as array + * + * @return array + */ + public function getRequestParameters(): array + { + return $this->getRequest()->getParams(); + } } diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php index 8e432e395bdf4..dda5f232475c5 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php @@ -13,6 +13,7 @@ use Magento\Framework\App\Filesystem\DirectoryList; use Magento\ImportExport\Controller\Adminhtml\Export as ExportController; use Magento\Framework\Filesystem; +use Throwable; /** * Controller that download file by name. @@ -53,19 +54,27 @@ public function __construct( /** * Controller basic method implementation. * - * @return \Magento\Framework\App\ResponseInterface + * @return \Magento\Framework\Controller\Result\Redirect | \Magento\Framework\App\ResponseInterface */ public function execute() { - /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $resultRedirect->setPath('adminhtml/export/index'); $fileName = $this->getRequest()->getParam('filename'); - if (empty($fileName) || preg_match('/\.\.(\\\|\/)/', $fileName) !== 0) { + $exportDirectory = $this->filesystem->getDirectoryRead(DirectoryList::VAR_IMPORT_EXPORT); + + try { + $fileExist = $exportDirectory->isExist('export/' . $fileName); + } catch (Throwable $e) { + $fileExist = false; + } + + if (empty($fileName) || !$fileExist) { $this->messageManager->addErrorMessage(__('Please provide valid export file name')); return $resultRedirect; } + try { $path = 'export/' . $fileName; $directory = $this->filesystem->getDirectoryRead(DirectoryList::VAR_IMPORT_EXPORT); diff --git a/app/code/Magento/ImportExport/Helper/Report.php b/app/code/Magento/ImportExport/Helper/Report.php index d5be27a569942..845f449e1907b 100644 --- a/app/code/Magento/ImportExport/Helper/Report.php +++ b/app/code/Magento/ImportExport/Helper/Report.php @@ -7,7 +7,9 @@ namespace Magento\ImportExport\Helper; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\ValidatorException; use Magento\ImportExport\Model\Import; +use Magento\Framework\Filesystem\Directory\ReadInterface; /** * ImportExport history reports helper @@ -27,6 +29,11 @@ class Report extends \Magento\Framework\App\Helper\AbstractHelper */ protected $varDirectory; + /** + * @var ReadInterface + */ + private $importHistoryDirectory; + /** * Construct * @@ -41,6 +48,8 @@ public function __construct( ) { $this->timeZone = $timeZone; $this->varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); + $importHistoryPath = $this->varDirectory->getAbsolutePath('import_history'); + $this->importHistoryDirectory = $filesystem->getDirectoryReadByPath($importHistoryPath); parent::__construct($context); } @@ -129,11 +138,12 @@ public function getReportSize($filename) */ protected function getFilePath($filename) { - if (preg_match('/\.\.(\\\|\/)/', $filename)) { - throw new \InvalidArgumentException('Filename has not permitted symbols in it'); + try { + $filePath = $this->varDirectory->getRelativePath($this->importHistoryDirectory->getAbsolutePath($filename)); + } catch (ValidatorException $e) { + throw new \InvalidArgumentException('File not found'); } - - return $this->varDirectory->getRelativePath(Import::IMPORT_HISTORY_DIR . $filename); + return $filePath; } /** diff --git a/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php b/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php index df556e961d2ce..0ac4d5dd9a180 100644 --- a/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php +++ b/app/code/Magento/ImportExport/Model/Export/Entity/AbstractEav.php @@ -158,6 +158,11 @@ public function filterEntityCollection(AbstractCollection $collection) $attributeCode, ['eq' => $exportFilter[$attributeCode]] ); + } else if (is_array($exportFilter[$attributeCode])) { + $collection->addAttributeToFilter( + $attributeCode, + ['in' => $exportFilter[$attributeCode]] + ); } } elseif (Export::FILTER_TYPE_MULTISELECT == $attributeFilterType) { if (is_array($exportFilter[$attributeCode])) { diff --git a/app/code/Magento/ImportExport/Model/ResourceModel/Export/AttributeGridCollection.php b/app/code/Magento/ImportExport/Model/ResourceModel/Export/AttributeGridCollection.php new file mode 100644 index 0000000000000..1fccff62910b5 --- /dev/null +++ b/app/code/Magento/ImportExport/Model/ResourceModel/Export/AttributeGridCollection.php @@ -0,0 +1,124 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ImportExport\Model\ResourceModel\Export; + +use Magento\Framework\Data\Collection; +use Magento\Framework\Phrase; + +/** + * Association of attributes for grid + */ +class AttributeGridCollection extends Collection +{ + private const FILTERED_FLAG_NAME = 'agc_filtered'; + + /** + * Adding item to collection + * + * @param array $items + * @return $this + */ + public function setItems(array $items): self + { + foreach ($items as $item) { + $this->addItem($item); + } + + return $this; + } + + /** + * @inheritDoc + */ + public function getSize(): int + { + return count($this->getItems()); + } + + /** + * @inheritDoc + */ + public function addFieldToFilter($field, $condition) + { + if (isset($condition['like'])) { + $value = $this->unescapeLikeValue((string)$condition['like']); + $this->addFilter($field, $value); + } + + return $this; + } + + /** + * @inheritDoc + */ + public function load($printQuery = false, $logQuery = false) + { + $this->filterCollection(); + $this->sortCollectionByAttributeCode(); + + return $this; + } + + /** + * Add filters to collection + * + * @return $this + */ + private function filterCollection() + { + if (!$this->getFlag(self::FILTERED_FLAG_NAME) && !empty($this->_filters)) { + foreach ($this->_filters as $filter) { + foreach ($this->_items as $item) { + $field = $item->getData($filter->getData('field')) ?? ''; + if ($field instanceof Phrase) { + $field = (string)$field; + } + if (stripos($field, $filter->getData('value')) === false) { + $this->removeItemByKey($item->getId()); + } + } + } + $this->setFlag(self::FILTERED_FLAG_NAME, true); + } + + return $this; + } + + /** + * Sort collection by attribute code + * + * @return $this + */ + private function sortCollectionByAttributeCode() + { + $sortOrder = $this->_orders['attribute_code']; + uasort($this->_items, function ($a, $b) use ($sortOrder) { + $cmp = strnatcmp($a->getData('attribute_code'), $b->getData('attribute_code')); + + return $sortOrder === self::SORT_ORDER_ASC ? $cmp : -$cmp; + }); + + return $this; + } + + /** + * Unescape 'like' value from condition + * + * @param string $likeValue + * @return string + */ + private function unescapeLikeValue(string $likeValue): string + { + $replaceFrom = ['\\\\', '\_', '\%']; + $replaceTo = ['\\', '_', '%']; + $value = trim($likeValue, "'%"); + $value = str_replace($replaceFrom, $replaceTo, $value); + + return $value; + } +} diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminDownloadImportHistoryFileActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminDownloadImportHistoryFileActionGroup.xml new file mode 100644 index 0000000000000..b93364969231e --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminDownloadImportHistoryFileActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminDownloadImportHistoryFileActionGroup"> + <annotations> + <description>Downloads the imported file for the specified row on the admin System > Data Transfer > Import History page.</description> + </annotations> + <arguments> + <argument name="rowIndex" defaultValue="1" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminImportHistorySection.downloadLink(rowIndex)}}" stepKey="waitForDownloadLink"/> + <click selector="{{AdminImportHistorySection.downloadLink(rowIndex)}}" stepKey="clickDownloadLink"/> + <waitForPageLoad stepKey="waitForDownload"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminExportAttributeGridFillColumnFilterFieldsAndApplyActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminExportAttributeGridFillColumnFilterFieldsAndApplyActionGroup.xml new file mode 100644 index 0000000000000..51de367d470aa --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminExportAttributeGridFillColumnFilterFieldsAndApplyActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminExportAttributeGridFillColumnFilterFieldsAndApplyActionGroup"> + <arguments> + <argument name="attributeLabel" type="string" defaultValue=""/> + <argument name="attributeCode" type="string" defaultValue=""/> + </arguments> + + <waitForElementVisible selector="{{AdminExportAttributeSection.filterByFrontLabel}}" stepKey="seeFilterByFrontLabel"/> + <fillField selector="{{AdminExportAttributeSection.filterByFrontLabel}}" userInput="{{attributeLabel}}" stepKey="fillAttributeLabelField"/> + <fillField selector="{{AdminExportAttributeSection.filterByAttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCodeField"/> + <click selector="{{AdminExportAttributeSection.search}}" stepKey="clickSearch"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminFillImportFormActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminFillImportFormActionGroup.xml index a15c58b4d2b2e..ac88333a89e4c 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminFillImportFormActionGroup.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminFillImportFormActionGroup.xml @@ -15,8 +15,12 @@ <arguments> <argument name="entityType" defaultValue="Products" type="string"/> <argument name="importBehavior" defaultValue="Add/Update" type="string"/> - <argument name="validationStrategy" defaultValue="Stop on Error" type="string" /> - <argument name="allowedErrorsCount" defaultValue="10" type="string" /> + <argument name="validationStrategy" defaultValue="Stop on Error" type="string"/> + <argument name="allowedErrorsCount" defaultValue="10" type="string"/> + <argument name="fieldSeparator" defaultValue="," type="string"/> + <argument name="multipleValueSeparator" defaultValue="," type="string"/> + <argument name="emptyAttributeValueConstant" defaultValue="__EMPTY__VALUE__" type="string"/> + <argument name="imagesFileDirectory" defaultValue="" type="string"/> <argument name="importFile" type="string"/> </arguments> <waitForElementVisible selector="{{AdminImportMainSection.entityType}}" stepKey="waitForEntityType"/> @@ -25,6 +29,10 @@ <selectOption selector="{{AdminImportMainSection.importBehavior}}" userInput="{{importBehavior}}" stepKey="selectImportBehaviorOption"/> <selectOption selector="{{AdminImportMainSection.validationStrategy}}" userInput="{{validationStrategy}}" stepKey="selectValidationStrategyOption"/> <fillField selector="{{AdminImportMainSection.allowedErrorsCount}}" userInput="{{allowedErrorsCount}}" stepKey="fillAllowedErrorsCountField"/> + <fillField selector="{{AdminImportMainSection.fieldSeparator}}" userInput="{{fieldSeparator}}" stepKey="fillFieldSeparatorField"/> + <fillField selector="{{AdminImportMainSection.multipleValueSeparator}}" userInput="{{multipleValueSeparator}}" stepKey="fillMultipleValueSeparatorField"/> + <fillField selector="{{AdminImportMainSection.emptyAttributeValueConstant}}" userInput="{{emptyAttributeValueConstant}}" stepKey="fillEmptyAttributeValueConstantField"/> <attachFile selector="{{AdminImportMainSection.selectFileToImport}}" userInput="{{importFile}}" stepKey="attachFileForImport"/> + <fillField selector="{{AdminImportMainSection.imagesFileDirectory}}" userInput="{{imagesFileDirectory}}" stepKey="fillImagesFileDirectoryField"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AssertAdminExportFilterGridFirstRowContainsAttributeCodeActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AssertAdminExportFilterGridFirstRowContainsAttributeCodeActionGroup.xml new file mode 100644 index 0000000000000..2e9bd50ee75ff --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AssertAdminExportFilterGridFirstRowContainsAttributeCodeActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminExportFilterGridFirstRowContainsAttributeCodeActionGroup"> + <arguments> + <argument name="attributeCode" type="string" defaultValue="allow_message"/> + </arguments> + + <grabTextFrom selector="{{AdminExportAttributeSection.rowAttributeCodeCell('1')}}" stepKey="getTextFirstRowContainsAttributeCode"/> + <assertStringContainsString stepKey="checkTextInFirstRowContainsAttributeCode"> + <actualResult type="variable">getTextFirstRowContainsAttributeCode</actualResult> + <expectedResult type="string">{{attributeCode}}</expectedResult> + </assertStringContainsString> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/ImportExport/Test/Mftf/Data/ImportData.xml index 5a883af443348..b962588ab911b 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Data/ImportData.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Data/ImportData.xml @@ -7,100 +7,10 @@ --> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <!-- Common Messages --> <entity name="ImportCommonMessages"> <data key="validFile">File is valid! To start import process press "Import" button</data> <data key="success">Import successfully done</data> </entity> - - <!-- Categories --> - <entity name="Import1" type="category"> - <data key="name">Import1</data> - <data key="name_lwr">import1</data> - <data key="is_active">true</data> - <data key="include_in_menu">true</data> - </entity> - - <!-- Products --> - <entity name="ImportSimple1" type="product"> - <data key="name">import-simple1</data> - <data key="sku">import-simple1</data> - <data key="type_id">simple</data> - <data key="attribute_set_id">4</data> - <data key="price">12.00</data> - <data key="visibility">4</data> - <data key="status">1</data> - <data key="quantity">100</data> - <data key="urlKey">import-simple1</data> - <data key="weight">12</data> - <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> - <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> - </entity> - <entity name="ImportSimple2" type="product"> - <data key="name">import-simple2</data> - <data key="sku">import-simple2</data> - <data key="type_id">simple</data> - <data key="attribute_set_id">4</data> - <data key="price">15.00</data> - <data key="visibility">4</data> - <data key="status">1</data> - <data key="quantity">100</data> - <data key="urlKey">import-simple2</data> - <data key="weight">12</data> - <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> - <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> - </entity> - <entity name="ImportSimple3" type="product"> - <data key="name">import-simple3</data> - <data key="sku">import-simple3</data> - <data key="type_id">simple</data> - <data key="attribute_set_id">4</data> - <data key="price">10.00</data> - <data key="visibility">4</data> - <data key="status">1</data> - <data key="quantity">100</data> - <data key="urlKey">import-simple3</data> - <data key="weight">12</data> - <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> - <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> - </entity> - <entity name="ImportConfigurable" type="product"> - <data key="fileName">import_configurable_product.csv</data> - <data key="importSummary">Created: 4, Updated: 0, Deleted: 0</data> - <data key="name">import-configurable</data> - <data key="sku">import-configurable</data> - <data key="type_id">configurable</data> - <data key="attribute_set_id">4</data> - <data key="price"/> - <data key="visibility">4</data> - <data key="status">1</data> - <data key="quantity"/> - <data key="urlKey">import-configurable</data> - <data key="weight">12</data> - <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> - <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> - </entity> - - <!-- Product Attributes --> - <entity name="ProductAttributeFrontendLabelImport1" type="FrontendLabel"> - <data key="store_id">0</data> - <data key="label">import_attribute1</data> - </entity> - <entity name="ProductAttributeWithThreeOptionsForImport" extends="productAttributeDropdownTwoOptions" type="ProductAttribute"> - <data key="attribute_code">import_attribute1</data> - <requiredEntity type="FrontendLabel">ProductAttributeFrontendLabelImport1</requiredEntity> - </entity> - <entity name="ProductAttributeOptionThreeForImport" extends="productAttributeOption3" type="ProductAttributeOption"> - <data key="label">option3</data> - </entity> - - <!-- Images --> - <entity name="TestImageImageContentExportImport" extends="TestImageContent" type="ImageContent"> - <data key="name">test_image.jpg</data> - </entity> - <entity name="ApiProductAttributeMediaGalleryForExportImport2" extends="ApiProductAttributeMediaGalleryEntryTestImage" type="ProductAttributeMediaGalleryEntry"> - <data key="label">Test Image</data> - <requiredEntity type="ImageContent">TestImageImageContentExportImport</requiredEntity> - </entity> </entities> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Page/AdminImportHistoryPage.xml b/app/code/Magento/ImportExport/Test/Mftf/Page/AdminImportHistoryPage.xml index 211d81582793f..728db6fe51beb 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Page/AdminImportHistoryPage.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Page/AdminImportHistoryPage.xml @@ -7,6 +7,6 @@ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminImportHistoryPage" url="admin/history" area="admin" module="Magento_ImportExport"/> </pages> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportAttributeSection.xml b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportAttributeSection.xml index d6970feb4bb36..002b31a6e8520 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportAttributeSection.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportAttributeSection.xml @@ -9,8 +9,10 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminExportAttributeSection"> <element name="filterByAttributeCode" type="input" selector="#export_filter_grid_filter_attribute_code"/> + <element name="filterByFrontLabel" type="input" selector="#export_filter_grid_filter_frontend_label"/> <element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="30"/> <element name="search" type="button" selector="button[data-action=grid-filter-apply]" timeout="30"/> + <element name="rowAttributeCodeCell" type="block" selector="//table[@id='export_filter_grid_table']/tbody/tr[{{row}}]/td[contains(@class,'col-attribute_code')]" parameterized="true"/> <element name="chooseAttribute" type="checkbox" selector="//*[@name='export_filter[{{var}}]']/ancestor::tr//input[@type='checkbox']" parameterized="true"/> <element name="fillFilter" type="input" selector="//*[@name='export_filter[{{var}}]']/ancestor::tr//input[@type='text']" parameterized="true"/> <element name="continueBtn" type="button" selector="//*[@id='export_filter_container']/button" timeout="30"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportMainSection.xml b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportMainSection.xml index da1d928607e75..49a18d1f2a923 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportMainSection.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminExportMainSection.xml @@ -9,6 +9,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminExportMainSection"> <element name="entityType" type="select" selector="#entity"/> + <element name="fileFormat" type="select" selector="#file_format"/> + <element name="fieldsEnclosure" type="input" selector="#fields_enclosure"/> <element name="entityAttributes" type="select" selector="#export_filter_form"/> </section> </sections> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportHistorySection.xml b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportHistorySection.xml new file mode 100644 index 0000000000000..3dc63deb7ad03 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportHistorySection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminImportHistorySection"> + <element name="downloadLink" type="button" parameterized="true" selector="#importHistoryGrid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=imported_file] a"/> + <element name="importedFileName" type="text" parameterized="true" selector="#importHistoryGrid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=imported_file] p"/> + </section> +</sections> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml index 0f647aa027c23..5f4fa20154268 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml @@ -17,6 +17,10 @@ <element name="messageError" type="text" selector=".messages div.message-error"/> <element name="validationStrategy" type="select" selector="#basic_behaviorvalidation_strategy"/> <element name="allowedErrorsCount" type="input" selector="#basic_behavior_allowed_error_count"/> + <element name="fieldSeparator" type="input" selector="#basic_behavior__import_field_separator"/> + <element name="multipleValueSeparator" type="input" selector="#basic_behavior_import_multiple_value_separator"/> + <element name="emptyAttributeValueConstant" type="input" selector="#basic_behavior_import_empty_attribute_value_constant"/> + <element name="imagesFileDirectory" type="input" selector="#import_images_file_dir"/> <element name="importImagesFileDirNote" type="input" selector="#import_images_file_dir-note"/> </section> </sections> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml deleted file mode 100644 index a046724f9ac8d..0000000000000 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml +++ /dev/null @@ -1,206 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest"> - <annotations> - <features value="Import/Export"/> - <stories value="Import Products"/> - <title value="Import Configurable Product With Simple Child Products With Images"/> - <description value="Imports a .csv file containing a configurable product with 3 child simple products that - have images. Verifies that products are imported successfully and that the images are attached to the - products as expected."/> - <severity value="MAJOR"/> - <testCaseId value="MC-38222"/> - <group value="importExport"/> - </annotations> - - <before> - <!-- Create Product Attribute with 3 Options --> - <createData entity="ProductAttributeWithThreeOptionsForImport" stepKey="createImportProductAttribute"/> - <createData entity="ProductAttributeOptionOneForExportImport" stepKey="createImportProductAttributeOption1"> - <requiredEntity createDataKey="createImportProductAttribute"/> - </createData> - <createData entity="ProductAttributeOptionTwoForExportImport" stepKey="createImportProductAttributeOption2"> - <requiredEntity createDataKey="createImportProductAttribute"/> - </createData> - <createData entity="ProductAttributeOptionThreeForImport" stepKey="createImportProductAttributeOption3"> - <requiredEntity createDataKey="createImportProductAttribute"/> - </createData> - <createData entity="AddToDefaultSet" stepKey="addToProductAttributeSet"> - <requiredEntity createDataKey="createImportProductAttribute"/> - </createData> - - <!-- Create a Product & Attach a JPG & PNG --> - <createData entity="Import1" stepKey="createImportCategory"/> - <createData entity="_defaultCategory" stepKey="createCategory"/> - <createData entity="ApiSimpleProduct" stepKey="productForImages"> - <requiredEntity createDataKey="createCategory"/> - </createData> - <createData entity="ApiProductAttributeMediaGalleryForExportImport" stepKey="productImage1"> - <requiredEntity createDataKey="productForImages"/> - </createData> - <createData entity="ApiProductAttributeMediaGalleryForExportImport2" stepKey="productImage2"> - <requiredEntity createDataKey="productForImages"/> - </createData> - - <!-- Login as Admin --> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - </before> - - <after> - <!-- Delete Data --> - <deleteData createDataKey="createImportCategory" stepKey="deleteImportCategory"/> - <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <deleteData createDataKey="productForImages" stepKey="deleteProductForImages"/> - <deleteData url="/V1/products/{{ImportSimple1.urlKey}}" stepKey="deleteImportedSimpleProduct1"/> - <deleteData url="/V1/products/{{ImportSimple2.urlKey}}" stepKey="deleteImportedSimpleProduct2"/> - <deleteData url="/V1/products/{{ImportSimple3.urlKey}}" stepKey="deleteImportedSimpleProduct3"/> - <deleteData url="/V1/products/{{ImportConfigurable.urlKey}}" stepKey="deleteImportedConfigurableProduct"/> - <deleteData createDataKey="createImportProductAttribute" stepKey="deleteProductAttribute"/> - <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="navigateToAndResetProductGridToDefaultView"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> - </after> - - <!-- Import Configurable Product with Simple Child Products & Assert No Errors --> - <actionGroup ref="AdminNavigateToImportPageActionGroup" stepKey="navigateToImportPage"/> - <actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm"> - <argument name="importFile" value="{{ImportConfigurable.fileName}}"/> - </actionGroup> - <actionGroup ref="AdminClickCheckDataImportActionGroup" stepKey="clickCheckData"/> - <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{ImportCommonMessages.validFile}}" stepKey="seeCheckDataResultMessage"/> - <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage"/> - <actionGroup ref="AdminClickImportActionGroup" stepKey="clickImport"/> - <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{ImportConfigurable.importSummary}}" stepKey="seeNoticeMessage"/> - <see selector="{{AdminImportValidationMessagesSection.messageByType('success')}}" userInput="{{ImportCommonMessages.success}}" stepKey="seeImportMessage"/> - <dontSeeElementInDOM selector="{{AdminImportValidationMessagesSection.importErrorList}}" stepKey="dontSeeErrorMessage2"/> - - <!-- Reindex --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - - <!-- Admin: Verify Data on Import History Page --> - <actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/> - <actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending"> - <argument name="columnLabel" value="history_id"/> - </actionGroup> - <see userInput="{{ImportConfigurable.fileName}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/> - <see userInput="{{ImportConfigurable.importSummary}}" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/> - - <!-- Admin: Verify Simple Product 1 on Product Index Page --> - <actionGroup ref="AssertProductOnAdminGridActionGroup" stepKey="assertSimpleProduct1InAdminGrid"> - <argument name="product" value="ImportSimple1"/> - </actionGroup> - <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOnly1Product"/> - - <!-- Admin: Verify Simple Product 1 on Edit Product Page --> - <actionGroup ref="AssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct1OnEditPage"> - <argument name="product" value="ImportSimple1"/> - </actionGroup> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProduct1ImageOnEditPage"> - <argument name="image" value="MagentoLogo"/> - </actionGroup> - - <!-- Admin: Verify Simple Product 2 on Product Index Page --> - <actionGroup ref="AssertProductOnAdminGridActionGroup" stepKey="assertSimpleProduct2InAdminGrid"> - <argument name="product" value="ImportSimple2"/> - </actionGroup> - <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOnly1Product2"/> - - <!-- Admin: Verify Simple Product 2 on Edit Product Page --> - <actionGroup ref="AssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct2OnEditPage"> - <argument name="product" value="ImportSimple2"/> - </actionGroup> - <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProduct2ImageOnEditPage"> - <argument name="image" value="TestImage"/> - </actionGroup> - - <!-- Admin: Verify Simple Product 3 on Product Index Page --> - <actionGroup ref="AssertProductOnAdminGridActionGroup" stepKey="assertSimpleProduct3InAdminGrid"> - <argument name="product" value="ImportSimple3"/> - </actionGroup> - <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOnly1Product3"/> - - <!-- Admin: Verify Simple Product 3 on Edit Product Page --> - <actionGroup ref="AssertProductInfoOnEditPageActionGroup" stepKey="assertSimpleProduct3OnEditPage"> - <argument name="product" value="ImportSimple3"/> - </actionGroup> - <actionGroup ref="ExpandAdminProductSectionActionGroup" stepKey="expandImageAndVideosSection"> - <argument name="sectionSelector" value="{{AdminProductImagesSection.productImagesToggle}}"/> - <argument name="sectionDependentSelector" value="{{AdminProductImagesSection.imageUploadButton}}"/> - </actionGroup> - <dontSeeElementInDOM selector="{{AdminProductImagesSection.imageElement}}" stepKey="dontSeeProductImage"/> - - <!-- Admin: Verify Configurable Product on Product Index Page --> - <actionGroup ref="AssertProductOnAdminGridActionGroup" stepKey="assertConfigurableProductInAdminGrid"> - <argument name="product" value="ImportConfigurable"/> - </actionGroup> - <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOnly1Product4"/> - - <!-- Admin: Verify Configurable Product on Edit Product Page --> - <actionGroup ref="AssertProductInfoOnEditPageActionGroup" stepKey="assertConfigurableProductOnEditPage"> - <argument name="product" value="ImportConfigurable"/> - </actionGroup> - <actionGroup ref="ExpandAdminProductSectionActionGroup" stepKey="expandImageAndVideosSection2"> - <argument name="sectionSelector" value="{{AdminProductImagesSection.productImagesToggle}}"/> - <argument name="sectionDependentSelector" value="{{AdminProductImagesSection.imageUploadButton}}"/> - </actionGroup> - <dontSeeElementInDOM selector="{{AdminProductImagesSection.imageElement}}" stepKey="dontSeeProductImage2"/> - - <!-- Storefront: Verify Configurable Product In Category --> - <actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPage"> - <argument name="categoryUrl" value="{{Import1.name_lwr}}"/> - </actionGroup> - <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productName}}" userInput="1" stepKey="seeOnly1Product5"/> - <see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{ImportConfigurable.name}}" stepKey="seeConfigurableProduct"/> - <dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{ImportSimple1.name}}" stepKey="dontSeeSimpleProduct1"/> - <dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{ImportSimple2.name}}" stepKey="dontSeeSimpleProduct2"/> - <dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{ImportSimple3.name}}" stepKey="dontSeeSimpleProduct3"/> - - <!-- Storefront: Verify Configurable Product Info & Image --> - <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> - <argument name="productUrl" value="{{ImportConfigurable.urlKey}}"/> - </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportConfigurable.name}}" stepKey="seeProductName"/> - <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportConfigurable.sku}}" stepKey="seeSku"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="As low as ${{ImportSimple3.price}}" stepKey="seePrice"/> - <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc('placeholder')}}" stepKey="seePlaceholderImage"/> - - <!-- Storefront: Verify Configurable Product Option 1 Info & Image --> - <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption1"> - <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> - <argument name="optionLabel" value="{{ProductAttributeOptionOneForExportImport.label}}"/> - </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportConfigurable.name}}" stepKey="seeProductName2"/> - <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportConfigurable.sku}}" stepKey="seeSku2"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportSimple1.price}}" stepKey="seePrice2"/> - <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(MagentoLogo.filename)}}" stepKey="seeImage1"/> - - <!-- Storefront: Verify Configurable Product Option 2 Info & Image --> - <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption2"> - <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> - <argument name="optionLabel" value="{{ProductAttributeOptionTwoForExportImport.label}}"/> - </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportConfigurable.name}}" stepKey="seeProductName3"/> - <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportConfigurable.sku}}" stepKey="seeSku3"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportSimple2.price}}" stepKey="seePrice3"/> - <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(TestImage.filename)}}" stepKey="seeImage2"/> - - <!-- Storefront: Verify Configurable Product Option 3 Info & Image --> - <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption3"> - <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> - <argument name="optionLabel" value="{{ProductAttributeOptionThreeForImport.label}}"/> - </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportConfigurable.name}}" stepKey="seeProductName4"/> - <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportConfigurable.sku}}" stepKey="seeSku4"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportSimple3.price}}" stepKey="seePrice4"/> - <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc('placeholder')}}" stepKey="seePlaceholderImage2"/> - </test> -</tests> diff --git a/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php b/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php index a68bf19106928..cf69cdf7ee367 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php @@ -7,33 +7,20 @@ namespace Magento\ImportExport\Test\Unit\Block\Adminhtml\Export; +use Magento\Backend\Block\Template\Context; use Magento\Backend\Helper\Data; -use Magento\Catalog\Model\Product\ReservedAttributeList; -use Magento\Catalog\Model\ResourceModel\Product; use Magento\Eav\Api\Data\AttributeOptionInterfaceFactory; -use Magento\Eav\Model\Config; use Magento\Eav\Model\Entity\Attribute; use Magento\Eav\Model\Entity\TypeFactory; -use Magento\Eav\Model\ResourceModel\Helper; -use Magento\Framework\Api\AttributeValueFactory; -use Magento\Framework\Api\DataObjectHelper; -use Magento\Framework\Api\ExtensionAttributesFactory; -use Magento\Framework\Data\Collection\AbstractDb; use Magento\Framework\DataObject; use Magento\Framework\Escaper; use Magento\Framework\Filesystem; -use Magento\Framework\Locale\Resolver; -use Magento\Framework\Model\Context; -use Magento\Framework\Reflection\DataObjectProcessor; -use Magento\Framework\Registry; -use Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface; use Magento\Framework\Stdlib\DateTime\Timezone; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; -use Magento\Framework\Validator\UniversalFactory; use Magento\Framework\View\Element\Html\Date; +use Magento\Framework\View\Element\Html\Select; use Magento\Framework\View\Layout; use Magento\ImportExport\Block\Adminhtml\Export\Filter; -use Magento\Store\Model\StoreManager; +use Magento\ImportExport\Model\ResourceModel\Export\AttributeGridCollectionFactory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -43,279 +30,302 @@ class FilterTest extends TestCase { /** - * @var Context|MockObject - */ - protected $modelContext; - - /** - * @var Registry|MockObject - */ - protected $registry; - - /** - * @var ExtensionAttributesFactory|MockObject - */ - protected $extensionFactory; - - /** - * @var AttributeValueFactory|MockObject - */ - protected $customAttributeFactory; - - /** - * @var Config|MockObject - */ - protected $eavConfig; - - /** - * @var TypeFactory|MockObject - */ - protected $eavTypeFactory; - - /** - * @var StoreManager|MockObject - */ - protected $storeManager; - - /** - * @var Helper|MockObject - */ - protected $resourceHelper; - - /** - * @var UniversalFactory|MockObject - */ - protected $universalFactory; - - /** - * @var AttributeOptionInterfaceFactory|MockObject - */ - protected $optionDataFactory; - - /** - * @var DataObjectProcessor|MockObject - */ - protected $dataObjectProcessor; - - /** - * @var DataObjectHelper|MockObject - */ - protected $dataObjectHelper; - - /** - * @var Timezone|MockObject - */ - protected $localeDate; - - /** - * @var ReservedAttributeList|MockObject - */ - protected $reservedAttributeList; - - /** - * @var Resolver|MockObject + * @var Filter|MockObject */ - protected $localeResolver; + private $filter; /** - * @var Product|MockObject + * @var Layout|MockObject */ - protected $resource; + private $layout; /** - * @var MockObject + * @inheritdoc */ - protected $resourceCollection; + protected function setUp(): void + { + $context = $this->getMockBuilder(Context::class) + ->onlyMethods(['getFileSystem', 'getEscaper', 'getLocaleDate', 'getLayout']) + ->disableOriginalConstructor() + ->getMock(); + $filesystem = $this->createMock(Filesystem::class); + $context->expects($this->any())->method('getFileSystem')->willReturn($filesystem); + $escaper = $this->createPartialMock(Escaper::class, ['escapeHtml']); + $escaper->expects($this->any())->method('escapeHtml')->willReturnArgument(0); + $context->expects($this->any())->method('getEscaper')->willReturn($escaper); + $timeZone = $this->createMock(Timezone::class); + $timeZone->expects($this->any())->method('getDateFormat')->willReturn('M/d/yy'); + $context->expects($this->any())->method('getLocaleDate')->willReturn($timeZone); + $this->layout = $this->createMock(Layout::class); + $context->expects($this->any())->method('getLayout')->willReturn($this->layout); + $backendHelper = $this->createMock(Data::class); + $importExportData = $this->createMock(\Magento\ImportExport\Helper\Data::class); + $attributeGridCollectionFactory = $this->createMock(AttributeGridCollectionFactory::class); + $this->filter = new Filter( + $context, + $backendHelper, + $importExportData, + [], + $attributeGridCollectionFactory + ); + } /** - * @var \Magento\Backend\Block\Template\Context|MockObject + * Test date filter + * + * @param array $attributeData + * @param array $values + * @param array $expect + * @dataProvider dateFilterDataProvider */ - protected $context; + public function testDateFilter(array $attributeData, array $values, array $expect): void + { + $type = Date::class; + $block = $block = $this->getMockBuilder($type) + ->addMethods(['setValue']) + ->onlyMethods(['getHtml']) + ->disableOriginalConstructor() + ->getMock(); + $block->expects($this->exactly(2)) + ->method('setValue') + ->withConsecutive(...$expect) + ->willReturnSelf(); + $this->layout->expects($this->once()) + ->method('createBlock') + ->with($type) + ->willReturn($block); + $attribute = $this->getAttributeMock($attributeData); + $column = new DataObject(); + $column->addData($values); + $isExport = true; + $result = $this->filter->decorateFilter(null, $attribute, $column, $isExport); + $this->assertNotNull($result); + } /** - * @var Data|MockObject + * @return array[] */ - protected $backendHelper; + public function dateFilterDataProvider(): array + { + return [ + [ + [ + 'attribute_code' =>'updated_at', + 'frontend_input' => '', + 'options' => [], + 'filter_options' => [], + 'backend_type' => 'datetime', + ], + ['values' => ['updated_at' => ['12/12/12', '12/15/12']]], + [ + ['12/12/12'], + ['12/15/12'] + ] + ], + ]; + } /** - * @var \Magento\ImportExport\Helper\Data|MockObject + * Test select filter + * + * @param array $attributeData + * @param array $values + * @param array $expect + * @dataProvider selectFilterDataProvider */ - protected $importExportData; + public function testSelectFilter(array $attributeData, array $values, array $expect): void + { + $html = '<select></select>'; + $type = Select::class; + $block = $block = $this->getMockBuilder($type) + ->onlyMethods(['getHtml']) + ->disableOriginalConstructor() + ->getMock(); + $block->expects($this->once()) + ->method('getHtml') + ->willReturn($html); + $this->layout->expects($this->once()) + ->method('createBlock') + ->with($type) + ->willReturn($block); + $attribute = $this->getAttributeMock($attributeData); + $column = new DataObject(); + $column->addData($values); + $isExport = true; + $result = $this->filter->decorateFilter(null, $attribute, $column, $isExport); + $this->assertEquals($html, $result); + $this->assertSame($expect['value'], $block->getValue()); + $this->assertEquals($expect['options'], $block->getOptions()); + } /** - * @var ObjectManagerHelper + * @return array[] */ - protected $objectManagerHelper; + public function selectFilterDataProvider(): array + { + return [ + [ + [ + 'attribute_code' => 'color', + 'frontend_input' => 'select', + 'filter_options' => ['6' => 'Green', '7' => 'Blue'], + 'backend_type' => 'select', + ], + ['values' => ['color' => '6']], + [ + 'value' => '6', + 'options' => [ + [ + 'label' => '-- Not Selected --', + 'value' => '' + ], + [ + 'label' => 'Green', + 'value' => '6' + ], + [ + 'label' => 'Blue', + 'value' => '7' + ] + ] + ] + ], + [ + [ + 'attribute_code' => 'color', + 'frontend_input' => 'select', + 'filter_options' => ['6' => 'Green', '7' => 'Blue'], + 'backend_type' => 'select', + ], + ['values' => ['color' => '']], + [ + 'value' => null, + 'options' => [ + [ + 'label' => '-- Not Selected --', + 'value' => '' + ], + [ + 'label' => 'Green', + 'value' => '6' + ], + [ + 'label' => 'Blue', + 'value' => '7' + ] + ] + ] + ] + ]; + } /** - * @var Filter|MockObject + * Test input filter + * + * @param array $attributeData + * @param array $values + * @param array $expect + * @dataProvider inputFilterDataProvider */ - protected $filter; + public function testInputFilter(array $attributeData, array $values, array $expect): void + { + $this->layout->expects($this->never()) + ->method('createBlock'); + $attribute = $this->getAttributeMock($attributeData); + $column = new DataObject(); + $column->addData($values); + $isExport = true; + $result = $this->filter->decorateFilter(null, $attribute, $column, $isExport); + $tag = simplexml_load_string($result); + $attributes = []; + foreach ($tag->attributes() as $name => $value) { + $attributes[$name] = "$value"; + } + $this->assertEquals($expect, array_intersect_key($expect, $attributes)); + } /** - * @var DateTimeFormatterInterface|MockObject + * @return array[] */ - private $dateTimeFormatter; - - protected function setUp(): void + public function inputFilterDataProvider(): array { - $this->modelContext = $this->createMock(Context::class); - $this->registry = $this->createMock(Registry::class); - $this->extensionFactory = $this->createMock(ExtensionAttributesFactory::class); - $this->customAttributeFactory = $this->createMock(AttributeValueFactory::class); - $this->eavConfig = $this->createMock(Config::class); - $this->eavTypeFactory = $this->createMock(TypeFactory::class); - $this->storeManager = $this->createMock(StoreManager::class); - $this->resourceHelper = $this->createMock(Helper::class); - $this->universalFactory = $this->createMock(UniversalFactory::class); - $this->optionDataFactory = $this->createMock(AttributeOptionInterfaceFactory::class); - $this->dataObjectProcessor = $this->createMock(DataObjectProcessor::class); - $this->dataObjectHelper = $this->createMock(DataObjectHelper::class); - $this->localeDate = $this->createMock(Timezone::class); - $this->localeDate->expects($this->any())->method('getDateFormat')->willReturn('12-12-2012'); - $this->reservedAttributeList = $this->createMock(ReservedAttributeList::class); - $this->localeResolver = $this->createMock(Resolver::class); - $this->resource = $this->createMock(Product::class); - $this->resourceCollection = $this->getMockForAbstractClass( - AbstractDb::class, - [], - '', - false - ); - $this->context = $this->getMockBuilder(\Magento\Backend\Block\Template\Context::class) - ->onlyMethods(['getFileSystem', 'getEscaper', 'getLocaleDate', 'getLayout']) - ->disableOriginalConstructor() - ->getMock(); - $filesystem = $this->createMock(Filesystem::class); - $this->context->expects($this->any())->method('getFileSystem')->willReturn($filesystem); - $escaper = $this->createPartialMock(Escaper::class, ['escapeHtml']); - $escaper->expects($this->any())->method('escapeHtml')->willReturn(''); - $this->context->expects($this->any())->method('getEscaper')->willReturn($escaper); - $timeZone = $this->createMock(Timezone::class); - $timeZone->expects($this->any())->method('getDateFormat')->willReturn('M/d/yy'); - $this->context->expects($this->any())->method('getLocaleDate')->willReturn($timeZone); - $dateBlock = $this->getMockBuilder(Date::class) - ->addMethods(['setValue', 'setId', 'getId']) - ->onlyMethods(['getHtml']) - ->disableOriginalConstructor() - ->getMock(); - $dateBlock->expects($this->any())->method('setValue')->willReturnSelf(); - $dateBlock->expects($this->any())->method('getHtml')->willReturn(''); - $dateBlock->expects($this->any())->method('setId')->willReturnSelf(); - $dateBlock->expects($this->any())->method('getId')->willReturn(1); - $layout = $this->createMock(Layout::class); - $layout->expects($this->any())->method('createBlock')->willReturn($dateBlock); - $this->context->expects($this->any())->method('getLayout')->willReturn($layout); - $this->backendHelper = $this->createMock(Data::class); - $this->importExportData = $this->createMock(\Magento\ImportExport\Helper\Data::class); - $this->dateTimeFormatter = $this->createMock( - DateTimeFormatterInterface::class - ); - $this->objectManagerHelper = new ObjectManagerHelper($this); - $this->filter = $this->objectManagerHelper->getObject( - Filter::class, + return [ [ - 'context' => $this->context, - 'backendHelper' => $this->backendHelper, - 'importExportData' => $this->importExportData - ] - ); + [ + 'attribute_code' => 'category_ids', + 'frontend_input' => '', + 'options' => [], + 'filter_options' => [], + 'backend_type' => 'varchar', + ], + ['values' => ['category_ids' => '1']], + [ + 'name' => 'export_filter[category_ids]', + 'value' => '1', + ] + ], + ]; } /** - * Test decorateFilter() + * Test number filter * * @param array $attributeData - * @param string $backendType - * @param array $columnValue - * @dataProvider decorateFilterDataProvider + * @param array $values + * @param array $expect + * @dataProvider numberFilterDataProvider */ - public function testDecorateFilter($attributeData, $backendType, $columnValue) + public function testNumberFilter(array $attributeData, array $values, array $expect): void { - $value = ''; - $attribute = new Attribute( - $this->modelContext, - $this->registry, - $this->extensionFactory, - $this->customAttributeFactory, - $this->eavConfig, - $this->eavTypeFactory, - $this->storeManager, - $this->resourceHelper, - $this->universalFactory, - $this->optionDataFactory, - $this->dataObjectProcessor, - $this->dataObjectHelper, - $this->localeDate, - $this->reservedAttributeList, - $this->localeResolver, - $this->dateTimeFormatter, - $this->resource, - $this->resourceCollection - ); - $attribute->setAttributeCode($attributeData['code']); - $attribute->setFrontendInput($attributeData['input']); - $attribute->setOptions($attributeData['options']); - $attribute->setFilterOptions($attributeData['filter_options']); - $attribute->setBackendType($backendType); + $this->layout->expects($this->never()) + ->method('createBlock'); + $attribute = $this->getAttributeMock($attributeData); $column = new DataObject(); - $column->setData($columnValue, 'value'); + $column->addData($values); $isExport = true; - $result = $this->filter->decorateFilter($value, $attribute, $column, $isExport); - $this->assertNotNull($result); + $result = $this->filter->decorateFilter(null, $attribute, $column, $isExport); + $this->assertStringContainsString($expect[0], $result); + $this->assertStringContainsString($expect[1], $result); } /** - * Dataprovider for testDecorateFilter() - * - * @return array + * @return array[] */ - public function decorateFilterDataProvider() + public function numberFilterDataProvider(): array { return [ [ - 'attributeCode' => [ - 'code' =>'updated_at', - 'input' => '', + [ + 'attribute_code' => 'cost', + 'frontend_input' => '', 'options' => [], - 'filter_options' => [] + 'filter_options' => [], + 'backend_type' => 'decimal', ], - 'backendType' => 'datetime', - 'columnValue' => ['values' => ['updated_at' => '12/12/12']] + ['values' => ['cost' => ['3', '5']]], + [ + 'value="3"', + 'value="5"', + ] ], - [ - 'attributeCode' => [ - 'code' => 'category_ids', - 'input' => '', - 'options' => [], - 'filter_options' => [] - ], - 'backendType' => 'varchar', - 'columnValue' => ['values' => ['category_ids' => '1']] - ], - [ - 'attributeCode' => [ - 'code' => 'cost', - 'input' => '', - 'options' => [], - 'filter_options' => [] - ], - 'backendType' => 'decimal', - 'columnValue' => ['values' => ['cost' => 'cost']] - ], - [ - 'attributeCode' => [ - 'code' => 'color', - 'input' => 'select', - 'options' => ['red' => 'red'], - 'filter_options' => ['opt' => 'val'] - ], - 'backendType' => 'select', - 'columnValue' => ['values' => ['color' => 'red']] - ] ]; } + /** + * @param array $data + * @return Attribute + */ + private function getAttributeMock(array $data): Attribute + { + $attribute = $this->getMockBuilder(Attribute::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $attribute->addData($data); + + return $attribute; + } + /** * Test for protected method prepareForm() * diff --git a/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DownloadTest.php b/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DownloadTest.php index d5a3ca1424721..5e0385c3a5211 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DownloadTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DownloadTest.php @@ -131,6 +131,10 @@ protected function setUp(): void ->method('getMessageManager') ->willReturn($this->messageManagerMock); + $this->fileSystemMock->expects($this->any()) + ->method('getDirectoryRead') + ->willReturn($this->directoryMock); + $this->objectManagerHelper = new ObjectManagerHelper($this); $this->downloadControllerMock = $this->objectManagerHelper->getObject( Download::class, @@ -150,10 +154,7 @@ public function testExecuteSuccess() $this->requestMock->method('getParam') ->with('filename') ->willReturn('sampleFile.csv'); - - $this->fileSystemMock->expects($this->once()) - ->method('getDirectoryRead') - ->willReturn($this->directoryMock); + $this->directoryMock->expects($this->once())->method('isExist')->willReturn(true); $this->directoryMock->expects($this->once())->method('isFile')->willReturn(true); $this->fileFactoryMock->expects($this->once())->method('create'); @@ -169,10 +170,8 @@ public function testExecuteFileDoesntExists() ->with('filename') ->willReturn('sampleFile'); - $this->fileSystemMock->expects($this->once()) - ->method('getDirectoryRead') - ->willReturn($this->directoryMock); $this->directoryMock->expects($this->once())->method('isFile')->willReturn(false); + $this->directoryMock->expects($this->once())->method('isExist')->willReturn(true); $this->messageManagerMock->expects($this->once())->method('addErrorMessage'); $this->downloadControllerMock->execute(); diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php index a09de5b761a06..f7f576476246b 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php @@ -11,7 +11,9 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\Helper\Context; use Magento\Framework\App\Request\Http; +use Magento\Framework\Exception\ValidatorException; use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\Read; use Magento\Framework\Filesystem\Directory\Write; use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Indexer\IndexerRegistry; @@ -60,6 +62,11 @@ class ReportTest extends TestCase */ protected $varDirectory; + /** + * @var Read|MockObject + */ + protected $importHistoryDirectory; + /** * @var Report */ @@ -87,14 +94,48 @@ protected function setUp(): void ->getMock(); $this->varDirectory = $this->createPartialMock( Write::class, - ['getRelativePath', 'readFile', 'isFile', 'stat'] + ['getRelativePath', 'getAbsolutePath', 'readFile', 'isFile', 'stat'] + ); + $this->importHistoryDirectory = $this->createPartialMock( + Read::class, + ['getAbsolutePath'] + ); + + $this->filesystem = $this->createPartialMock( + Filesystem::class, + ['getDirectoryWrite', 'getDirectoryReadByPath'] ); - $this->filesystem = $this->createPartialMock(Filesystem::class, ['getDirectoryWrite']); - $this->varDirectory->expects($this->any())->method('getRelativePath')->willReturn('path'); - $this->varDirectory->expects($this->any())->method('readFile')->willReturn('contents'); - $this->varDirectory->expects($this->any())->method('isFile')->willReturn(true); - $this->varDirectory->expects($this->any())->method('stat')->willReturn(false); - $this->filesystem->expects($this->any())->method('getDirectoryWrite')->willReturn($this->varDirectory); + $this->varDirectory + ->expects($this->any()) + ->method('getRelativePath') + ->willReturn('path'); + $this->varDirectory + ->expects($this->any()) + ->method('getAbsolutePath') + ->willReturn('path'); + $this->varDirectory + ->expects($this->any()) + ->method('readFile') + ->willReturn('contents'); + $this->varDirectory + ->expects($this->any()) + ->method('isFile') + ->willReturn(true); + $this->varDirectory + ->expects($this->any()) + ->method('stat') + ->willReturn(false); + $this->filesystem + ->expects($this->any()) + ->method('getDirectoryWrite') + ->willReturn($this->varDirectory); + $this->importHistoryDirectory + ->expects($this->any())->method('getAbsolutePath') + ->willReturnArgument(0); + $this->filesystem + ->expects($this->any()) + ->method('getDirectoryReadByPath') + ->willReturn($this->importHistoryDirectory); $this->objectManagerHelper = new ObjectManagerHelper($this); $this->report = $this->objectManagerHelper->getObject( Report::class, @@ -144,9 +185,15 @@ public function testGetSummaryStats() Product::class, ['getEntityTypeCode', 'setParameters'] ); - $product->expects($this->any())->method('getEntityTypeCode')->willReturn('catalog_product'); - $product->expects($this->any())->method('setParameters')->willReturn(''); - $entityFactory->expects($this->any())->method('create')->willReturn($product); + $product->expects($this->any()) + ->method('getEntityTypeCode') + ->willReturn('catalog_product'); + $product->expects($this->any()) + ->method('setParameters') + ->willReturn(''); + $entityFactory->expects($this->any()) + ->method('create') + ->willReturn($product); $importData = $this->createMock(\Magento\ImportExport\Model\ResourceModel\Import\Data::class); $csvFactory = $this->createMock(CsvFactory::class); $httpFactory = $this->createMock(FileTransferFactory::class); @@ -184,7 +231,10 @@ public function testGetSummaryStats() public function testImportFileExistsException($fileName) { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Filename has not permitted symbols in it'); + $this->expectExceptionMessage('File not found'); + $this->importHistoryDirectory->expects($this->any()) + ->method('getAbsolutePath') + ->will($this->throwException(new ValidatorException(__("Error")))); $this->report->importFileExists($fileName); } diff --git a/app/code/Magento/Indexer/App/Indexer.php b/app/code/Magento/Indexer/App/Indexer.php index 89f153ee9aa47..9bb594c65678a 100644 --- a/app/code/Magento/Indexer/App/Indexer.php +++ b/app/code/Magento/Indexer/App/Indexer.php @@ -27,6 +27,11 @@ class Indexer implements \Magento\Framework\AppInterface */ protected $_response; + /** + * @var \Magento\Indexer\Model\Processor + */ + private $processor; + /** * @param string $reportDir * @param \Magento\Framework\Filesystem $filesystem diff --git a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php index d6e6c2f1fc2cb..5f21228665a0c 100644 --- a/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php +++ b/app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php @@ -16,6 +16,7 @@ use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\Indexer\StateInterface; use Magento\Indexer\Model\Processor\MakeSharedIndexValid; +use Psr\Log\LoggerInterface; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -50,21 +51,29 @@ class IndexerReindexCommand extends AbstractIndexerManageCommand */ private $makeSharedValid; + /** + * @var LoggerInterface + */ + private $logger; + /** * @param ObjectManagerFactory $objectManagerFactory * @param IndexerRegistry|null $indexerRegistry * @param DependencyInfoProvider|null $dependencyInfoProvider * @param MakeSharedIndexValid|null $makeSharedValid + * @param LoggerInterface|null $logger */ public function __construct( ObjectManagerFactory $objectManagerFactory, IndexerRegistry $indexerRegistry = null, DependencyInfoProvider $dependencyInfoProvider = null, - MakeSharedIndexValid $makeSharedValid = null + MakeSharedIndexValid $makeSharedValid = null, + ?LoggerInterface $logger = null ) { $this->indexerRegistry = $indexerRegistry; $this->dependencyInfoProvider = $dependencyInfoProvider; $this->makeSharedValid = $makeSharedValid; + $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class); parent::__construct($objectManagerFactory); } @@ -108,15 +117,14 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln( __('has been rebuilt successfully in %time', ['time' => gmdate('H:i:s', $resultTime)]) ); - } catch (LocalizedException $e) { - $output->writeln(__('exception: %message', ['message' => $e->getMessage()])); - $returnValue = Cli::RETURN_FAILURE; - } catch (\Exception $e) { - $output->writeln('process unknown error:'); + } catch (\Throwable $e) { + $output->writeln('process error during indexation process:'); $output->writeln($e->getMessage()); $output->writeln($e->getTraceAsString(), OutputInterface::VERBOSITY_DEBUG); $returnValue = Cli::RETURN_FAILURE; + + $this->logger->critical($e->getMessage()); } } diff --git a/app/code/Magento/Indexer/Model/Message/Invalid.php b/app/code/Magento/Indexer/Model/Message/Invalid.php index 309cab1a31029..086d06a88fa85 100644 --- a/app/code/Magento/Indexer/Model/Message/Invalid.php +++ b/app/code/Magento/Indexer/Model/Message/Invalid.php @@ -75,7 +75,7 @@ public function getText() return __( 'One or more <a href="%1">indexers are invalid</a>. Make sure your <a href="%2" target="_blank">Magento cron job</a> is running.', $url, - 'https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cron.html#create-or-remove-the-magento-crontab' + 'https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html#create-or-remove-the-magento-crontab' ); //@codingStandardsIgnoreEnd } diff --git a/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml b/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml index adb0b9d059d81..403a95885e031 100644 --- a/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml +++ b/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml @@ -24,18 +24,14 @@ <!--Open Index Management Page and Select Index mode "Update by Schedule" --> <magentoCLI command="indexer:set-mode" arguments="schedule" stepKey="setIndexerModeSchedule"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/></before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <magentoCLI command="indexer:set-mode" arguments="realtime" stepKey="setIndexerModeRealTime"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php b/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php index 8bdceb92b247b..244798e7261b8 100644 --- a/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php @@ -422,27 +422,6 @@ public function executeWithIndexDataProvider() ]; } - public function testExecuteWithLocalizedException() - { - $this->configureAdminArea(); - $indexerOne = $this->getIndexerMock( - ['reindexAll', 'getStatus'], - ['indexer_id' => 'indexer_1', 'title' => self::STUB_INDEXER_NAME] - ); - $localizedException = new LocalizedException(new Phrase('Some Exception Message')); - $indexerOne->expects($this->once())->method('reindexAll')->willThrowException($localizedException); - $this->initIndexerCollectionByItems([$indexerOne]); - $this->command = new IndexerReindexCommand($this->objectManagerFactory); - $commandTester = new CommandTester($this->command); - $commandTester->execute(['index' => ['indexer_1']]); - $actualValue = $commandTester->getDisplay(); - $this->assertSame(Cli::RETURN_FAILURE, $commandTester->getStatusCode()); - $this->assertStringStartsWith( - self::STUB_INDEXER_NAME . ' index exception: Some Exception Message', - $actualValue - ); - } - public function testExecuteWithException() { $this->configureAdminArea(); @@ -459,7 +438,10 @@ public function testExecuteWithException() $commandTester->execute(['index' => ['indexer_1']]); $actualValue = $commandTester->getDisplay(); $this->assertSame(Cli::RETURN_FAILURE, $commandTester->getStatusCode()); - $this->assertStringStartsWith('Title_indexer_1' . ' index process unknown error:', $actualValue); + $this->assertStringStartsWith( + 'Title_indexer_1' . ' index process error during indexation process:', + $actualValue + ); } public function testExecuteWithExceptionInGetIndexers() diff --git a/app/code/Magento/InstantPurchase/README.md b/app/code/Magento/InstantPurchase/README.md index 2c20dc869d60f..f54e2c05dfc8d 100644 --- a/app/code/Magento/InstantPurchase/README.md +++ b/app/code/Magento/InstantPurchase/README.md @@ -1,8 +1,9 @@ -## Overview +# Magento_InstantPurchase module Instant Purchase feature allows the Customer to place the order in seconds without going through full checkout. Once clicked, system places the order using default shipping and billing addresses and stored payment method. Order is placed and customer gets confirmation message in notification area. Prerequisites to display the Instant Purchase button: + 1. Instant purchase enabled for a store at `Store / Configurations / Sales / Sales / Instant Purchase` 2. Customer is logged in 3. Customer has default shipping and billing address defined @@ -10,7 +11,7 @@ Prerequisites to display the Instant Purchase button: ## Structure -In addition to [a typical file structure for a Magento 2 module](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/module-file-structure.html) `PaymentMethodsIntegration` directory contains interfaces and basic implementation of integration vault payment method to the instant purchase. +In addition to [a typical file structure for a Magento 2 module](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html) `PaymentMethodsIntegration` directory contains interfaces and basic implementation of integration vault payment method to the instant purchase. ## Extensibility @@ -22,11 +23,11 @@ All payments created for instant purchase also have `'instant-purchase' => true` ### Payment method integration -Instant purchase support may be implemented for any payment method with [vault support](https://devdocs.magento.com/guides/v2.3/payments-integrations/vault/vault-intro.html). +Instant purchase support may be implemented for any payment method with [vault support](https://devdocs.magento.com/guides/v2.4/payments-integrations/vault/vault-intro.html). Basic implementation provided in `Magento\InstantPurchase\PaymentMethodIntegration` should be enough in most cases. It is not enabled by default to avoid issues on production sites and authors of vault payment method should verify correct work for instant purchase manually. To enable basic implementation just add single option to configuration of payemnt method in `config.xml`: -``` +```xml <instant_purchase> <supported>1</supported> </instant_purchase> @@ -34,7 +35,7 @@ To enable basic implementation just add single option to configuration of payemn Basic implementation is a good start point but it's recommended to provide own implementation to improve user experience. If instant purchase integration has customization then `supported` option is not required. -``` +```xml <instant_purchase> <available>Implementation_Of_Magento\InstantPurchase\PaymentMethodIntegration\AvailabilityCheckerInterface</available> <tokenFormat>Implementation_Of_Magento\InstantPurchase\PaymentMethodIntegration\PaymentTokenFormatterInterface</tokenFormat> @@ -52,7 +53,7 @@ Basic implementation is a good start point but it's recommended to provide own i The `Magento_InstantPurchase` module does not introduce backward incompatible changes. -You can track [backward incompatible changes in patch releases](https://devdocs.magento.com/guides/v2.3/release-notes/backward-incompatible-changes/reference.html). +You can track [backward incompatible changes in patch releases](https://devdocs.magento.com/guides/v2.4/release-notes/backward-incompatible-changes/reference.html). *** diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php index 2f1884b8db735..50fb701e7a0dc 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php @@ -8,16 +8,21 @@ namespace Magento\Integration\Controller\Adminhtml\Integration; -use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Oauth\Exception; use Magento\Integration\Controller\Adminhtml\Integration; use Magento\Integration\Model\Integration as IntegrationModel; -class TokensExchange extends Integration implements HttpPostActionInterface +/** + * Tokens Exchange for integration + */ +class TokensExchange extends Integration implements HttpGetActionInterface { /** * Let the admin know that integration has been sent for activation and token exchange is in process. * - * @param bool $isReauthorize + * @param bool $isReauthorize * @param string $integrationName * @return void */ @@ -60,7 +65,7 @@ public function execute() $popupContent = $this->_response->getBody(); $consumer = $this->_oauthService->loadConsumer($integration->getConsumerId()); if (!$consumer->getId()) { - throw new \Magento\Framework\Oauth\Exception( + throw new Exception( __( 'A consumer with "%1" ID doesn\'t exist. Verify the ID and try again.', $integration->getConsumerId() @@ -74,7 +79,7 @@ public function execute() 'popup_content' => $popupContent, ]; $this->getResponse()->representJson($this->jsonHelper->jsonEncode($result)); - } catch (\Magento\Framework\Exception\LocalizedException $e) { + } catch (LocalizedException $e) { $this->messageManager->addErrorMessage($e->getMessage()); $this->_redirect('*/*'); return; diff --git a/app/code/Magento/Integration/Model/Message/RecreatedIntegration.php b/app/code/Magento/Integration/Model/Message/RecreatedIntegration.php index d3ef8dc5e262e..b90bc4e11cd59 100644 --- a/app/code/Magento/Integration/Model/Message/RecreatedIntegration.php +++ b/app/code/Magento/Integration/Model/Message/RecreatedIntegration.php @@ -81,6 +81,8 @@ public function isDisplayed() */ public function getIdentity() { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction return md5('INTEGRATION_RECREATED'); } diff --git a/app/code/Magento/Integration/etc/db_schema.xml b/app/code/Magento/Integration/etc/db_schema.xml index 91af330e8ef27..ecd967cf189b5 100644 --- a/app/code/Magento/Integration/etc/db_schema.xml +++ b/app/code/Magento/Integration/etc/db_schema.xml @@ -84,7 +84,7 @@ <constraint xsi:type="foreign" referenceId="OAUTH_NONCE_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID" table="oauth_nonce" column="consumer_id" referenceTable="oauth_consumer" referenceColumn="entity_id" onDelete="CASCADE"/> - <constraint xsi:type="unique" referenceId="OAUTH_NONCE_NONCE_CONSUMER_ID"> + <constraint xsi:type="primary" referenceId="OAUTH_NONCE_NONCE_CONSUMER_ID"> <column name="nonce"/> <column name="consumer_id"/> </constraint> diff --git a/app/code/Magento/Integration/etc/db_schema_whitelist.json b/app/code/Magento/Integration/etc/db_schema_whitelist.json index a7649eeb4ee1e..2bf014c94d109 100644 --- a/app/code/Magento/Integration/etc/db_schema_whitelist.json +++ b/app/code/Magento/Integration/etc/db_schema_whitelist.json @@ -54,6 +54,7 @@ "consumer_id": true }, "constraint": { + "PRIMARY": true, "OAUTH_NONCE_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID": true, "OAUTH_NONCE_NONCE_CONSUMER_ID": true }, @@ -94,4 +95,4 @@ "OAUTH_TOKEN_REQUEST_LOG_USER_NAME_USER_TYPE": true } } -} \ No newline at end of file +} diff --git a/app/code/Magento/JwtFrameworkAdapter/LICENSE.txt b/app/code/Magento/JwtFrameworkAdapter/LICENSE.txt new file mode 100644 index 0000000000000..49525fd99da9c --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/LICENSE.txt @@ -0,0 +1,48 @@ + +Open Software License ("OSL") v. 3.0 + +This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Open Software License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file diff --git a/app/code/Magento/JwtFrameworkAdapter/LICENSE_AFL.txt b/app/code/Magento/JwtFrameworkAdapter/LICENSE_AFL.txt new file mode 100644 index 0000000000000..f39d641b18a19 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/LICENSE_AFL.txt @@ -0,0 +1,48 @@ + +Academic Free License ("AFL") v. 3.0 + +This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Academic Free License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/AlgorithmProviderFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/AlgorithmProviderFactory.php new file mode 100644 index 0000000000000..365fa25fbd361 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/AlgorithmProviderFactory.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Easy\AlgorithmProvider; + +class AlgorithmProviderFactory +{ + /** + * Create provider instance. + * + * @param string[] $algorithms Algorithm classes. + * @return AlgorithmProvider + */ + public function create(array $algorithms): AlgorithmProvider + { + return new AlgorithmProvider($algorithms); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/Data/Claim.php b/app/code/Magento/JwtFrameworkAdapter/Model/Data/Claim.php new file mode 100644 index 0000000000000..cd102609201dd --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/Data/Claim.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model\Data; + +use Magento\Framework\Jwt\Claim\AbstractClaim; + +class Claim extends AbstractClaim +{ + public function __construct(string $name, $value, ?int $class) + { + parent::__construct($name, $value, $class, false); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/Data/Header.php b/app/code/Magento/JwtFrameworkAdapter/Model/Data/Header.php new file mode 100644 index 0000000000000..0916326e1865b --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/Data/Header.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model\Data; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +class Header implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string + */ + private $name; + + /** + * @var mixed + */ + private $value; + + /** + * @var int|null + */ + private $class; + + /** + * Header constructor. + * @param string $name + * @param mixed $value + * @param int|null $class + */ + public function __construct(string $name, $value, ?int $class) + { + $this->name = $name; + $this->value = $value; + $this->class = $class; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return $this->name; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return $this->class; + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweAlgorithmManagerFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweAlgorithmManagerFactory.php new file mode 100644 index 0000000000000..a1a53db3e450b --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweAlgorithmManagerFactory.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; + +class JweAlgorithmManagerFactory +{ + private const ALGOS = [ + \Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP256::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A128KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A192KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A256KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\Dir::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHES::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA128KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA192KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHESA256KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A128GCMKW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A192GCMKW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\A256GCMKW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2HS256A128KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2HS384A192KW::class, + \Jose\Component\Encryption\Algorithm\KeyEncryption\PBES2HS512A256KW::class + ]; + + /** + * @var AlgorithmProviderFactory + */ + private $algorithmProviderFactory; + + public function __construct(AlgorithmProviderFactory $algorithmProviderFactory) { + $this->algorithmProviderFactory = $algorithmProviderFactory; + } + + public function create(): AlgorithmManager + { + return new AlgorithmManager($this->algorithmProviderFactory->create(self::ALGOS)->getAvailableAlgorithms()); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweBuilderFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweBuilderFactory.php new file mode 100644 index 0000000000000..69a9a90dbaa33 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweBuilderFactory.php @@ -0,0 +1,54 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; +use Jose\Component\Encryption\Compression\CompressionMethodManager; +use Jose\Component\Encryption\JWEBuilder; +use Jose\Component\Encryption\Serializer\JWESerializerManager; + +class JweBuilderFactory +{ + /** + * @var JWESerializerManager + */ + private $serializers; + + /** + * @var AlgorithmManager + */ + private $algoManager; + + /** + * @var AlgorithmManager + */ + private $contentAlgoManager; + + /** + * @var CompressionMethodManager + */ + private $compressionManager; + + public function __construct( + JweSerializerPoolFactory $serializerPoolFactory, + JweAlgorithmManagerFactory $algorithmManagerFactory, + JweContentAlgorithmManagerFactory $contentAlgoManagerFactory, + JweCompressionManagerFactory $compressionManagerFactory + ) { + $this->serializers = $serializerPoolFactory->create(); + $this->algoManager = $algorithmManagerFactory->create(); + $this->contentAlgoManager = $contentAlgoManagerFactory->create(); + $this->compressionManager = $compressionManagerFactory->create(); + } + + public function create(): JWEBuilder + { + return new JWEBuilder($this->algoManager, $this->contentAlgoManager, $this->compressionManager); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweCompressionManagerFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweCompressionManagerFactory.php new file mode 100644 index 0000000000000..16367cff6a534 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweCompressionManagerFactory.php @@ -0,0 +1,20 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Encryption\Compression\CompressionMethodManager; +use Jose\Component\Encryption\Compression\Deflate; + +class JweCompressionManagerFactory +{ + public function create(): CompressionMethodManager + { + return new CompressionMethodManager([new Deflate()]); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweContentAlgorithmManagerFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweContentAlgorithmManagerFactory.php new file mode 100644 index 0000000000000..ded1e63fabf27 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweContentAlgorithmManagerFactory.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; + +class JweContentAlgorithmManagerFactory +{ + private const ALGOS = [ + \Jose\Component\Encryption\Algorithm\ContentEncryption\A128CBCHS256::class, + \Jose\Component\Encryption\Algorithm\ContentEncryption\A192CBCHS384::class, + \Jose\Component\Encryption\Algorithm\ContentEncryption\A256CBCHS512::class, + \Jose\Component\Encryption\Algorithm\ContentEncryption\A128GCM::class, + \Jose\Component\Encryption\Algorithm\ContentEncryption\A192GCM::class, + \Jose\Component\Encryption\Algorithm\ContentEncryption\A256GCM::class, + ]; + + /** + * @var AlgorithmProviderFactory + */ + private $algorithmProviderFactory; + + public function __construct(AlgorithmProviderFactory $algorithmProviderFactory) { + $this->algorithmProviderFactory = $algorithmProviderFactory; + } + + public function create(): AlgorithmManager + { + return new AlgorithmManager($this->algorithmProviderFactory->create(self::ALGOS)->getAvailableAlgorithms()); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweFactory.php new file mode 100644 index 0000000000000..07a99c202b3ef --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweFactory.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Magento\Framework\Jwt\Jwe\Jwe; +use Magento\Framework\Jwt\Jwe\JweHeader; +use Magento\Framework\Jwt\Jwe\JweInterface; +use Magento\Framework\Jwt\Jws\Jws; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Jws\JwsInterface; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayload; +use Magento\Framework\Jwt\Payload\NestedPayload; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\Data\Claim; +use Magento\JwtFrameworkAdapter\Model\Data\Header; + +/** + * Create JWE data object. + */ +class JweFactory +{ + public function create( + array $protectedHeadersMap, + string $payload, + ?array $unprotectedHeadersMap, + ?array $recipientHeadersMap + ): JweInterface { + $protectedHeaders = []; + foreach ($protectedHeadersMap as $header => $headerValue) { + $protectedHeaders[] = new Header($header, $headerValue, null); + } + $publicHeaders = null; + if ($unprotectedHeadersMap) { + $publicHeaders = []; + foreach ($unprotectedHeadersMap as $header => $headerValue) { + $publicHeaders[] = new Header($header, $headerValue, null); + } + } + $recipientHeader = null; + if ($recipientHeadersMap) { + $recipientHeader = []; + foreach ($recipientHeadersMap as $header => $headerValue) { + $recipientHeader[] = new Header($header, $headerValue, null); + } + } + $headersMap = array_merge($unprotectedHeadersMap ?? [], $recipientHeader ?? [], $protectedHeadersMap); + if (array_key_exists('cty', $headersMap)) { + if ($headersMap['cty'] === NestedPayloadInterface::CONTENT_TYPE) { + $payload = new NestedPayload($payload); + } else { + $payload = new ArbitraryPayload($payload); + } + } else { + $claimData = json_decode($payload, true); + $claims = []; + foreach ($claimData as $name => $value) { + $claims[] = new Claim($name, $value, null); + } + $payload = new ClaimsPayload($claims); + } + + return new Jwe( + new JweHeader($protectedHeaders), + $publicHeaders ? new JweHeader($publicHeaders) : null, + $recipientHeader ? [new JweHeader($recipientHeader)] : null, + $payload + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweLoaderFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweLoaderFactory.php new file mode 100644 index 0000000000000..25941e33b15cb --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweLoaderFactory.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; +use Jose\Component\Encryption\Compression\CompressionMethodManager; +use Jose\Component\Encryption\JWEDecrypter; +use Jose\Component\Encryption\JWELoader; +use Jose\Component\Encryption\Serializer\JWESerializerManager; + +class JweLoaderFactory +{ + /** + * @var JWESerializerManager + */ + private $serializers; + + /** + * @var AlgorithmManager + */ + private $algoManager; + + /** + * @var AlgorithmManager + */ + private $contentAlgoManager; + + /** + * @var CompressionMethodManager + */ + private $compressionManager; + + public function __construct( + JweSerializerPoolFactory $serializerPoolFactory, + JweAlgorithmManagerFactory $algorithmManagerFactory, + JweContentAlgorithmManagerFactory $contentAlgoManagerFactory, + JweCompressionManagerFactory $compressionManagerFactory + ) { + $this->serializers = $serializerPoolFactory->create(); + $this->algoManager = $algorithmManagerFactory->create(); + $this->contentAlgoManager = $contentAlgoManagerFactory->create(); + $this->compressionManager = $compressionManagerFactory->create(); + } + + public function create(): JWELoader + { + return new JWELoader( + $this->serializers, + new JWEDecrypter( + $this->algoManager, + $this->contentAlgoManager, + $this->compressionManager + ), + null + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweManager.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweManager.php new file mode 100644 index 0000000000000..552bc6616341e --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweManager.php @@ -0,0 +1,245 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Encryption\JWEBuilder; +use Jose\Component\Encryption\JWELoader; +use Jose\Component\Encryption\Serializer\JWESerializerManager; +use Magento\Framework\Jwt\EncryptionSettingsInterface; +use Magento\Framework\Jwt\Exception\EncryptionException; +use Magento\Framework\Jwt\Exception\JwtException; +use Magento\Framework\Jwt\Exception\MalformedTokenException; +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Jwe\JweEncryptionJwks; +use Magento\Framework\Jwt\Jwe\JweHeader; +use Magento\Framework\Jwt\Jwe\JweInterface; +use Jose\Component\Core\JWK as AdapterJwk; +use Jose\Component\Core\JWKSet as AdapterJwkSet; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\Data\Header; + +/** + * Works with JWE + */ +class JweManager +{ + /** + * @var JWEBuilder + */ + private $builder; + + /** + * @var JWESerializerManager + */ + private $serializer; + + /** + * @var JWELoader + */ + private $loader; + + /** + * @var JweFactory + */ + private $jweFactory; + + public function __construct( + JweBuilderFactory $jweBuilderFactory, + JweSerializerPoolFactory $serializerPoolFactory, + JweLoaderFactory $jweLoaderFactory, + JweFactory $jweFactory + ) { + $this->builder = $jweBuilderFactory->create(); + $this->serializer = $serializerPoolFactory->create(); + $this->loader = $jweLoaderFactory->create(); + $this->jweFactory = $jweFactory; + } + + /** + * Generate JWE token. + * + * @param JweInterface $jwe + * @param EncryptionSettingsInterface|JweEncryptionJwks $encryptionSettings + * @return string + */ + public function build(JweInterface $jwe, EncryptionSettingsInterface $encryptionSettings): string + { + $this->validateJweSettings($jwe, $encryptionSettings); + + $builder = $this->builder->create(); + + $payload = $jwe->getPayload(); + $builder = $builder->withPayload($payload->getContent()); + + $sharedProtected = $this->extractHeaderData($jwe->getProtectedHeader()); + $sharedProtected['enc'] = $encryptionSettings->getContentEncryptionAlgorithm(); + if ($payload->getContentType()) { + $sharedProtected['cty'] = $payload->getContentType(); + } + if (!$jwe->getPerRecipientUnprotectedHeaders()) { + $sharedProtected['alg'] = $encryptionSettings->getAlgorithmName(); + } + if ($payload instanceof ClaimsPayloadInterface) { + foreach ($payload->getClaims() as $claim) { + if ($claim->isHeaderDuplicated()) { + $sharedProtected[$claim->getName()] = $claim->getValue(); + } + } + } + $builder = $builder->withSharedProtectedHeader($sharedProtected); + + $sharedUnprotected = []; + if ($jwe->getSharedUnprotectedHeader()) { + $sharedUnprotected = array_merge( + $this->extractHeaderData($jwe->getSharedUnprotectedHeader()), + $sharedUnprotected + ); + } + if ($sharedUnprotected) { + $builder = $builder->withSharedHeader($sharedUnprotected); + } + + if (!$jwe->getPerRecipientUnprotectedHeaders()) { + $builder = $builder->addRecipient( + new AdapterJwk($encryptionSettings->getJwkSet()->getKeys()[0]->getJsonData()) + ); + } else { + foreach ($jwe->getPerRecipientUnprotectedHeaders() as $i => $header) { + $jwk = $encryptionSettings->getJwkSet()->getKeys()[$i]; + $headerData = $this->extractHeaderData($header); + $headerData['alg'] = $jwk->getAlgorithm(); + $builder = $builder->addRecipient(new AdapterJwk($jwk->getJsonData()), $headerData); + } + } + + $built = $builder->build(); + if ($jwe->getPerRecipientUnprotectedHeaders() + && count($jwe->getPerRecipientUnprotectedHeaders()) === 1 + || (!$jwe->getPerRecipientUnprotectedHeaders() && $jwe->getSharedUnprotectedHeader()) + ) { + return $this->serializer->serialize('jwe_json_flattened', $built); + } + if ($jwe->getPerRecipientUnprotectedHeaders()) { + return $this->serializer->serialize('jwe_json_general', $built); + } + return $this->serializer->serialize('jwe_compact', $built); + } + + /** + * Read JWE token. + * + * @param string $token + * @param EncryptionSettingsInterface|JweEncryptionJwks $encryptionSettings + * @return JweInterface + */ + public function read(string $token, EncryptionSettingsInterface $encryptionSettings): JweInterface + { + if (!$encryptionSettings instanceof JweEncryptionJwks) { + throw new JwtException('Can only work with JWK encryption settings for JWE tokens'); + } + + $jwkSet = new AdapterJwkSet( + array_map( + function (Jwk $jwk) { + return new AdapterJwk($jwk->getJsonData()); + }, + $encryptionSettings->getJwkSet()->getKeys() + ) + ); + try { + /** @var int|null $recipientId */ + $jwe = $this->loader->loadAndDecryptWithKeySet($token, $jwkSet, $recipientId); + } catch (\Throwable $exception) { + throw new EncryptionException('Failed to decrypt JWE token.', 0, $exception); + } + if ($recipientId) { + throw new EncryptionException('Failed to decrypt JWE token.'); + } + $recipientHeader = $jwe->getRecipient($recipientId)->getHeader(); + + return $this->jweFactory->create( + $jwe->getSharedProtectedHeader(), + $jwe->getPayload() ?? '', + $jwe->getSharedHeader() ? $jwe->getSharedHeader() : null, + $recipientHeader ? $recipientHeader : null + ); + } + + /** + * Read JWS headers. + * + * @param string $token + * @return HeaderInterface[] + */ + public function readHeaders(string $token): array + { + try { + $jwe = $this->serializer->unserialize($token); + } catch (\Throwable $exception) { + throw new JwtException('Failed to read JWE headers'); + } + $headers = []; + $headersValues = []; + if ($jwe->getSharedHeader()) { + $headersValues[] = $jwe->getSharedHeader(); + } + if ($jwe->getSharedProtectedHeader()) { + $headersValues[] = $jwe->getSharedProtectedHeader(); + } + foreach ($jwe->getRecipients() as $recipient) { + if ($recipient->getHeader()) { + $headersValues[] = $recipient->getHeader(); + } + } + foreach ($headersValues as $headerValues) { + $params = []; + foreach ($headerValues as $header => $value) { + $params[] = new Header($header, $value, null); + } + if ($params) { + $headers[] = new JweHeader($params); + } + } + + return $headers; + } + + private function validateJweSettings(JweInterface $jwe, EncryptionSettingsInterface $encryptionSettings): void + { + if (!$encryptionSettings instanceof JweEncryptionJwks) { + throw new JwtException('Can only work with JWK encryption settings for JWE tokens'); + } + if ($jwe->getPerRecipientUnprotectedHeaders() + && count($encryptionSettings->getJwkSet()->getKeys()) !== count($jwe->getPerRecipientUnprotectedHeaders()) + ) { + throw new EncryptionException('Not enough JWKs to encrypt all headers'); + } + if (count($encryptionSettings->getJwkSet()->getKeys()) > 1 && !$jwe->getPerRecipientUnprotectedHeaders()) { + throw new MalformedTokenException('Need more per-recipient headers for the amount of keys'); + } + } + + /** + * Extract JOSE header data. + * + * @param HeaderInterface $header + * @return array + */ + private function extractHeaderData(HeaderInterface $header): array + { + $data = []; + foreach ($header->getParameters() as $parameter) { + $data[$parameter->getName()] = $parameter->getValue(); + } + + return $data; + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JweSerializerPoolFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JweSerializerPoolFactory.php new file mode 100644 index 0000000000000..25418af169ed6 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JweSerializerPoolFactory.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Encryption\Serializer\CompactSerializer; +use Jose\Component\Encryption\Serializer\JSONFlattenedSerializer; +use Jose\Component\Encryption\Serializer\JSONGeneralSerializer; +use Jose\Component\Encryption\Serializer\JWESerializerManager; + +class JweSerializerPoolFactory +{ + public function create(): JWESerializerManager + { + return new JWESerializerManager( + [ + new CompactSerializer(), + new JSONGeneralSerializer(), + new JSONFlattenedSerializer() + ] + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsAlgorithmManagerFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsAlgorithmManagerFactory.php new file mode 100644 index 0000000000000..e9478727b5597 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsAlgorithmManagerFactory.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; +use Jose\Easy\AlgorithmProvider; + +class JwsAlgorithmManagerFactory +{ + private const ALGOS = [ + + \Jose\Component\Signature\Algorithm\HS256::class, + \Jose\Component\Signature\Algorithm\HS384::class, + \Jose\Component\Signature\Algorithm\HS512::class, + \Jose\Component\Signature\Algorithm\RS256::class, + \Jose\Component\Signature\Algorithm\RS384::class, + \Jose\Component\Signature\Algorithm\RS512::class, + \Jose\Component\Signature\Algorithm\PS256::class, + \Jose\Component\Signature\Algorithm\PS384::class, + \Jose\Component\Signature\Algorithm\PS512::class, + \Jose\Component\Signature\Algorithm\ES256::class, + \Jose\Component\Signature\Algorithm\ES384::class, + \Jose\Component\Signature\Algorithm\ES512::class, + \Jose\Component\Signature\Algorithm\EdDSA::class, + \Jose\Component\Signature\Algorithm\None::class + ]; + + /** + * @var AlgorithmProviderFactory + */ + private $algorithmProviderFactory; + + public function __construct(AlgorithmProviderFactory $algorithmProviderFactory) { + $this->algorithmProviderFactory = $algorithmProviderFactory; + } + + public function create(): AlgorithmManager + { + return new AlgorithmManager($this->algorithmProviderFactory->create(self::ALGOS)->getAvailableAlgorithms()); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsBuilderFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsBuilderFactory.php new file mode 100644 index 0000000000000..f851b0cf0a438 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsBuilderFactory.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; +use Jose\Component\Signature\JWSBuilder; + +class JwsBuilderFactory +{ + /** + * @var AlgorithmManager + */ + private $algoManager; + + public function __construct(JwsAlgorithmManagerFactory $algorithmManagerFactory) { + $this->algoManager = $algorithmManagerFactory->create(); + } + + public function create(): JWSBuilder + { + return new JWSBuilder($this->algoManager); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsFactory.php new file mode 100644 index 0000000000000..7a5aa282eed5c --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsFactory.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Magento\Framework\Jwt\Jws\Jws; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Jws\JwsInterface; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayload; +use Magento\Framework\Jwt\Payload\NestedPayload; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\Data\Claim; +use Magento\JwtFrameworkAdapter\Model\Data\Header; + +/** + * Create JWS data object. + */ +class JwsFactory +{ + public function create( + array $protectedHeadersMap, + string $payload, + ?array $unprotectedHeadersMap + ): JwsInterface { + $protectedHeaders = []; + foreach ($protectedHeadersMap as $header => $headerValue) { + $protectedHeaders[] = new Header($header, $headerValue, null); + } + $publicHeaders = null; + if ($unprotectedHeadersMap) { + $publicHeaders = []; + foreach ($unprotectedHeadersMap as $header => $headerValue) { + $publicHeaders[] = new Header($header, $headerValue, null); + } + } + $headersMap = array_merge($unprotectedHeadersMap ?? [], $protectedHeadersMap); + if (array_key_exists('cty', $headersMap)) { + if ($headersMap['cty'] === NestedPayloadInterface::CONTENT_TYPE) { + $payload = new NestedPayload($payload); + } else { + $payload = new ArbitraryPayload($payload); + } + } else { + $claimData = json_decode($payload, true); + $claims = []; + foreach ($claimData as $name => $value) { + $claims[] = new Claim($name, $value, null); + } + $payload = new ClaimsPayload($claims); + } + + return new Jws( + [new JwsHeader($protectedHeaders)], + $payload, + $publicHeaders ? [new JwsHeader($publicHeaders)] : null + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsLoaderFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsLoaderFactory.php new file mode 100644 index 0000000000000..ff67f0ac8c1a6 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsLoaderFactory.php @@ -0,0 +1,44 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Core\AlgorithmManager; +use Jose\Component\Signature\JWSLoader; +use Jose\Component\Signature\JWSVerifier; +use Jose\Component\Signature\Serializer\JWSSerializerManager; + +class JwsLoaderFactory +{ + /** + * @var JWSSerializerManager + */ + private $serializer; + + /** + * @var AlgorithmManager + */ + private $algoManager; + + public function __construct( + JwsSerializerPoolFactory $serializerPoolFactory, + JwsAlgorithmManagerFactory $algorithmManagerFactory + ) { + $this->serializer = $serializerPoolFactory->create(); + $this->algoManager = $algorithmManagerFactory->create(); + } + + public function create(): JWSLoader + { + return new JWSLoader( + $this->serializer, + new JWSVerifier($this->algoManager), + null + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsManager.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsManager.php new file mode 100644 index 0000000000000..b5e03be38dcc0 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsManager.php @@ -0,0 +1,223 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Signature\JWSBuilder; +use Jose\Component\Signature\JWSLoader; +use Jose\Component\Signature\Serializer\JWSSerializerManager; +use Magento\Framework\Jwt\EncryptionSettingsInterface; +use Magento\Framework\Jwt\Exception\EncryptionException; +use Magento\Framework\Jwt\Exception\JwtException; +use Magento\Framework\Jwt\Exception\MalformedTokenException; +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Jws\JwsInterface; +use Magento\Framework\Jwt\Jws\JwsSignatureJwks; +use Jose\Component\Core\JWK as AdapterJwk; +use Jose\Component\Core\JWKSet as AdapterJwkSet; +use Magento\JwtFrameworkAdapter\Model\Data\Header; + +/** + * Works with JWS. + */ +class JwsManager +{ + /** + * @var JWSBuilder + */ + private $jwsBuilder; + + /** + * @var JWSLoader + */ + private $jwsLoader; + + /** + * @var JWSSerializerManager + */ + private $jwsSerializer; + + /** + * @var JwsFactory + */ + private $jwsFactory; + + /** + * @param JwsBuilderFactory $builderFactory + * @param JwsSerializerPoolFactory $serializerPoolFactory + * @param JwsLoaderFactory $jwsLoaderFactory + * @param JwsFactory $jwsFactory + */ + public function __construct( + JwsBuilderFactory $builderFactory, + JwsSerializerPoolFactory $serializerPoolFactory, + JwsLoaderFactory $jwsLoaderFactory, + JwsFactory $jwsFactory + ) { + $this->jwsBuilder = $builderFactory->create(); + $this->jwsSerializer = $serializerPoolFactory->create(); + $this->jwsLoader = $jwsLoaderFactory->create(); + $this->jwsFactory = $jwsFactory; + } + + /** + * Generate JWS token. + * + * @param JwsInterface $jws + * @param EncryptionSettingsInterface|JwsSignatureJwks $encryptionSettings + * @return string + * @throws JwtException + */ + public function build(JwsInterface $jws, EncryptionSettingsInterface $encryptionSettings): string + { + if (!$encryptionSettings instanceof JwsSignatureJwks) { + throw new JwtException('Can only work with JWK encryption settings for JWS tokens'); + } + $signaturesCount = count($encryptionSettings->getJwkSet()->getKeys()); + if ($jws->getProtectedHeaders() && count($jws->getProtectedHeaders()) !== $signaturesCount) { + throw new MalformedTokenException('Number of headers must equal to number of JWKs'); + } + if ($jws->getUnprotectedHeaders() + && count($jws->getUnprotectedHeaders()) !== $signaturesCount + ) { + throw new MalformedTokenException('There must be an equal number of protected and unprotected headers.'); + } + $builder = $this->jwsBuilder->create(); + $builder = $builder->withPayload($jws->getPayload()->getContent()); + for ($i = 0; $i < $signaturesCount; $i++) { + $jwk = $encryptionSettings->getJwkSet()->getKeys()[$i]; + $alg = $jwk->getAlgorithm(); + if (!$alg) { + throw new EncryptionException('Algorithm is required for JWKs'); + } + $protected = []; + if ($jws->getPayload()->getContentType()) { + $protected['cty'] = $jws->getPayload()->getContentType(); + } + if ($jws->getProtectedHeaders()) { + $protected = $this->extractHeaderData($jws->getProtectedHeaders()[$i]); + } + $protected['alg'] = $alg; + $unprotected = []; + if ($jws->getUnprotectedHeaders()) { + $unprotected = $this->extractHeaderData($jws->getUnprotectedHeaders()[$i]); + } + $builder = $builder->addSignature(new AdapterJwk($jwk->getJsonData()), $protected, $unprotected); + } + $jwsCreated = $builder->build(); + + if ($signaturesCount > 1) { + return $this->jwsSerializer->serialize('jws_json_general', $jwsCreated); + } + if ($jws->getUnprotectedHeaders()) { + return $this->jwsSerializer->serialize('jws_json_flattened', $jwsCreated); + } + return $this->jwsSerializer->serialize('jws_compact', $jwsCreated); + } + + /** + * Read and verify JWS token. + * + * @param string $token + * @param EncryptionSettingsInterface|JwsSignatureJwks $encryptionSettings + * @return JwsInterface + * @throws JwtException + */ + public function read(string $token, EncryptionSettingsInterface $encryptionSettings): JwsInterface + { + if (!$encryptionSettings instanceof JwsSignatureJwks) { + throw new JwtException('Can only work with JWK settings for JWS tokens'); + } + + $jwkSet = new AdapterJwkSet( + array_map( + function (Jwk $jwk) { + return new AdapterJwk($jwk->getJsonData()); + }, + $encryptionSettings->getJwkSet()->getKeys() + ) + ); + try { + $jws = $this->jwsLoader->loadAndVerifyWithKeySet( + $token, + $jwkSet, + $signature, + null + ); + } catch (\Throwable $exception) { + throw new MalformedTokenException('Failed to read JWS token', 0, $exception); + } + if ($signature === null) { + throw new EncryptionException('Failed to verify a JWS token'); + } + $headers = $jws->getSignature($signature); + if ($jws->isPayloadDetached()) { + throw new JwtException('Detached payload is not supported'); + } + + return $this->jwsFactory->create( + $headers->getProtectedHeader(), + $jws->getPayload(), + $headers->getHeader() ? $headers->getHeader() : null + ); + } + + /** + * Read JWS headers. + * + * @param string $token + * @return HeaderInterface[] + */ + public function readHeaders(string $token): array + { + try { + $jws = $this->jwsSerializer->unserialize($token); + } catch (\Throwable $exception) { + throw new JwtException('Failed to read JWS headers'); + } + $headers = []; + $headersValues = []; + foreach ($jws->getSignatures() as $signature) { + if ($signature->getProtectedHeader()) { + $headersValues[] = $signature->getProtectedHeader(); + } + if ($signature->getHeader()) { + $headersValues[] = $signature->getHeader(); + } + } + foreach ($headersValues as $headerValues) { + $params = []; + foreach ($headerValues as $header => $value) { + $params[] = new Header($header, $value, null); + } + if ($params) { + $headers[] = new JwsHeader($params); + } + } + + return $headers; + } + + /** + * Extract JOSE header data. + * + * @param HeaderInterface $header + * @return array + */ + private function extractHeaderData(HeaderInterface $header): array + { + $data = []; + foreach ($header->getParameters() as $parameter) { + $data[$parameter->getName()] = $parameter->getValue(); + } + + return $data; + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwsSerializerPoolFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwsSerializerPoolFactory.php new file mode 100644 index 0000000000000..70306829b90a3 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwsSerializerPoolFactory.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Signature\Serializer\CompactSerializer; +use Jose\Component\Signature\Serializer\JSONFlattenedSerializer; +use Jose\Component\Signature\Serializer\JSONGeneralSerializer; +use Jose\Component\Signature\Serializer\JWSSerializerManager; + +class JwsSerializerPoolFactory +{ + public function create(): JWSSerializerManager + { + return new JWSSerializerManager( + [ + new CompactSerializer(), + new JSONGeneralSerializer(), + new JSONFlattenedSerializer() + ] + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/JwtManager.php b/app/code/Magento/JwtFrameworkAdapter/Model/JwtManager.php new file mode 100644 index 0000000000000..56208f349a705 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/JwtManager.php @@ -0,0 +1,199 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Magento\Framework\Jwt\EncryptionSettingsInterface; +use Magento\Framework\Jwt\Exception\EncryptionException; +use Magento\Framework\Jwt\Exception\JwtException; +use Magento\Framework\Jwt\Exception\MalformedTokenException; +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Jwe\JweEncryptionSettingsInterface; +use Magento\Framework\Jwt\Jwe\JweInterface; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\Jws\JwsInterface; +use Magento\Framework\Jwt\Jws\JwsSignatureSettingsInterface; +use Magento\Framework\Jwt\JwtInterface; +use Magento\Framework\Jwt\JwtManagerInterface; +use Magento\Framework\Jwt\Unsecured\NoEncryption; +use Magento\Framework\Jwt\Unsecured\UnsecuredJwtInterface; + +/** + * Adapter for jwt-framework. + */ +class JwtManager implements JwtManagerInterface +{ + private const JWT_TYPE_JWS = 1; + + private const JWT_TYPE_JWE = 2; + + private const JWT_TYPE_UNSECURED = 3; + + private const JWS_ALGORITHMS = [ + Jwk::ALGORITHM_HS256, + Jwk::ALGORITHM_HS384, + Jwk::ALGORITHM_HS512, + Jwk::ALGORITHM_RS256, + Jwk::ALGORITHM_RS384, + Jwk::ALGORITHM_RS512, + Jwk::ALGORITHM_ES256, + Jwk::ALGORITHM_ES384, + Jwk::ALGORITHM_ES512, + Jwk::ALGORITHM_PS256, + Jwk::ALGORITHM_PS384, + Jwk::ALGORITHM_PS512 + ]; + + private const JWE_ALGORITHMS = [ + Jwk::ALGORITHM_RSA_OAEP, + Jwk::ALGORITHM_RSA_OAEP_256, + Jwk::ALGORITHM_A128KW, + Jwk::ALGORITHM_A192KW, + Jwk::ALGORITHM_A256KW, + Jwk::ALGORITHM_DIR, + Jwk::ALGORITHM_ECDH_ES, + Jwk::ALGORITHM_ECDH_ES_A128KW, + Jwk::ALGORITHM_ECDH_ES_A192KW, + Jwk::ALGORITHM_ECDH_ES_A256KW, + Jwk::ALGORITHM_A128GCMKW, + Jwk::ALGORITHM_A192GCMKW, + Jwk::ALGORITHM_A256GCMKW, + Jwk::ALGORITHM_PBES2_HS256_A128KW, + Jwk::ALGORITHM_PBES2_HS384_A192KW, + Jwk::ALGORITHM_PBES2_HS512_A256KW, + ]; + + /** + * @var JwsManager + */ + private $jwsManager; + + /** + * @var JweManager + */ + private $jweManager; + + /** + * @var UnsecuredJwtManager + */ + private $unsecuredManager; + + /** + * @param JwsManager $jwsManager + * @param JweManager $jweManager + */ + public function __construct(JwsManager $jwsManager, JweManager $jweManager, UnsecuredJwtManager $unsecuredManager) + { + $this->jwsManager = $jwsManager; + $this->jweManager = $jweManager; + $this->unsecuredManager = $unsecuredManager; + } + + /** + * @inheritDoc + */ + public function create(JwtInterface $jwt, EncryptionSettingsInterface $encryption): string + { + if (!$jwt instanceof UnsecuredJwtInterface && !$jwt instanceof JwsInterface && !$jwt instanceof JweInterface) { + throw new MalformedTokenException('Can only build JWS, JWE or Unsecured tokens.'); + } + try { + if ($jwt instanceof JwsInterface) { + return $this->jwsManager->build($jwt, $encryption); + } + if ($jwt instanceof JweInterface) { + return $this->jweManager->build($jwt, $encryption); + } + if ($jwt instanceof UnsecuredJwtInterface) { + if (!$encryption instanceof NoEncryption) { + throw new EncryptionException('Unsecured JWTs can only work with no encryption settings'); + } + + return $this->unsecuredManager->build($jwt); + } + } catch (\Throwable $exception) { + if (!$exception instanceof JwtException) { + $exception = new JwtException('Failed to generate a JWT', 0, $exception); + } + throw $exception; + } + } + + /** + * @inheritDoc + */ + public function read(string $token, array $acceptableEncryption): JwtInterface + { + /** @var JwtInterface|null $read */ + $read = null; + /** @var \Throwable|null $lastException */ + $lastException = null; + foreach ($acceptableEncryption as $encryptionSettings) { + try { + switch ($this->detectJwtType($encryptionSettings)) { + case self::JWT_TYPE_JWS: + $read = $this->jwsManager->read($token, $encryptionSettings); + break; + case self::JWT_TYPE_JWE: + $read = $this->jweManager->read($token, $encryptionSettings); + break; + case self::JWT_TYPE_UNSECURED: + $read = $this->unsecuredManager->read($token); + break; + } + } catch (\Throwable $exception) { + if (!$exception instanceof JwtException) { + $exception = new JwtException('Failed to read JWT', 0, $exception); + } + $lastException = $exception; + } + } + + if (!$read) { + throw $lastException; + } + return $read; + } + + /** + * @inheritDoc + */ + public function readHeaders(string $token): array + { + try { + return $this->jwsManager->readHeaders($token); + } catch (JwtException $exception) { + return $this->jweManager->readHeaders($token); + } + } + + private function detectJwtType(EncryptionSettingsInterface $encryptionSettings): int + { + if ($encryptionSettings instanceof JwsSignatureSettingsInterface) { + return self::JWT_TYPE_JWS; + } + if ($encryptionSettings instanceof JweEncryptionSettingsInterface) { + return self::JWT_TYPE_JWE; + } + if ($encryptionSettings instanceof NoEncryption) { + return self::JWT_TYPE_UNSECURED; + } + + if ($encryptionSettings->getAlgorithmName() === Jwk::ALGORITHM_NONE) { + return self::JWT_TYPE_UNSECURED; + } + if (in_array($encryptionSettings->getAlgorithmName(), self::JWS_ALGORITHMS, true)) { + return self::JWT_TYPE_JWS; + } + if (in_array($encryptionSettings->getAlgorithmName(), self::JWE_ALGORITHMS, true)) { + return self::JWT_TYPE_JWE; + } + + throw new \RuntimeException('Failed to determine JWT type'); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtFactory.php b/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtFactory.php new file mode 100644 index 0000000000000..2d9fa891b9103 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtFactory.php @@ -0,0 +1,79 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Magento\Framework\Jwt\Jws\Jws; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayload; +use Magento\Framework\Jwt\Payload\NestedPayload; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\Framework\Jwt\Unsecured\UnsecuredJwt; +use Magento\Framework\Jwt\Unsecured\UnsecuredJwtInterface; +use Magento\JwtFrameworkAdapter\Model\Data\Claim; +use Magento\JwtFrameworkAdapter\Model\Data\Header; + +/** + * Creates unsecure JWT DTOs. + */ +class UnsecuredJwtFactory +{ + public function create( + array $protectedHeaderMaps, + ?array $unprotectedHeaderMaps, + string $payload + ): UnsecuredJwtInterface { + $cty = null; + $protectedHeaders = []; + foreach ($protectedHeaderMaps as $protectedHeaderMap) { + $parameters = []; + foreach ($protectedHeaderMap as $header => $headerValue) { + $parameters[] = new Header($header, $headerValue, null); + if ($header === 'cty') { + $cty = $headerValue; + } + } + $protectedHeaders[] = new JwsHeader($parameters); + } + $publicHeaders = null; + if ($unprotectedHeaderMaps) { + $publicHeaders = []; + foreach ($unprotectedHeaderMaps as $unprotectedHeaderMap) { + $parameters = []; + foreach ($unprotectedHeaderMap as $header => $headerValue) { + $parameters[] = new Header($header, $headerValue, null); + if ($header === 'cty') { + $cty = $headerValue; + } + } + $publicHeaders[] = new JwsHeader($parameters); + } + } + if ($cty) { + if ($cty === NestedPayloadInterface::CONTENT_TYPE) { + $payload = new NestedPayload($payload); + } else { + $payload = new ArbitraryPayload($payload); + } + } else { + $claimData = json_decode($payload, true); + $claims = []; + foreach ($claimData as $name => $value) { + $claims[] = new Claim($name, $value, null); + } + $payload = new ClaimsPayload($claims); + } + + return new UnsecuredJwt( + $protectedHeaders, + $payload, + $publicHeaders + ); + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtManager.php b/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtManager.php new file mode 100644 index 0000000000000..d3a35d5a0ad31 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Model/UnsecuredJwtManager.php @@ -0,0 +1,164 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Model; + +use Jose\Component\Signature\JWSBuilder; +use Jose\Component\Signature\JWSLoader; +use Jose\Component\Signature\Serializer\JWSSerializerManager; +use Magento\Framework\Jwt\Exception\JwtException; +use Magento\Framework\Jwt\Exception\MalformedTokenException; +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Jwk; +use Jose\Component\Core\JWK as AdapterJwk; +use Magento\Framework\Jwt\Unsecured\UnsecuredJwtInterface; + +/** + * Works with Unsecured JWT. + */ +class UnsecuredJwtManager +{ + /** + * @var JWSBuilder + */ + private $jwsBuilder; + + /** + * @var JWSLoader + */ + private $jwsLoader; + + /** + * @var JWSSerializerManager + */ + private $jwsSerializer; + + /** + * @var UnsecuredJwtFactory + */ + private $jwtFactory; + + /** + * @param JwsBuilderFactory $builderFactory + * @param JwsSerializerPoolFactory $serializerPoolFactory + * @param JwsLoaderFactory $jwsLoaderFactory + * @param UnsecuredJwtFactory $jwtFactory + */ + public function __construct( + JwsBuilderFactory $builderFactory, + JwsSerializerPoolFactory $serializerPoolFactory, + JwsLoaderFactory $jwsLoaderFactory, + UnsecuredJwtFactory $jwtFactory + ) { + $this->jwsBuilder = $builderFactory->create(); + $this->jwsSerializer = $serializerPoolFactory->create(); + $this->jwsLoader = $jwsLoaderFactory->create(); + $this->jwtFactory = $jwtFactory; + } + + /** + * Generate unsecured JWT token. + * + * @param UnsecuredJwtInterface $jwt + * @return string + * @throws JwtException + */ + public function build(UnsecuredJwtInterface $jwt): string + { + $signaturesCount = count($jwt->getProtectedHeaders()); + if ($jwt->getUnprotectedHeaders() + && count($jwt->getUnprotectedHeaders()) !== $signaturesCount + ) { + throw new MalformedTokenException('There must be an equal number of protected and unprotected headers.'); + } + $builder = $this->jwsBuilder->create(); + $builder = $builder->withPayload($jwt->getPayload()->getContent()); + for ($i = 0; $i < $signaturesCount; $i++) { + $protected = []; + if ($jwt->getPayload()->getContentType()) { + $protected['cty'] = $jwt->getPayload()->getContentType(); + } + if ($jwt->getProtectedHeaders()) { + $protected = $this->extractHeaderData($jwt->getProtectedHeaders()[$i]); + } + $protected['alg'] = Jwk::ALGORITHM_NONE; + $unprotected = []; + if ($jwt->getUnprotectedHeaders()) { + $unprotected = $this->extractHeaderData($jwt->getUnprotectedHeaders()[$i]); + } + $builder = $builder->addSignature( + new AdapterJwk(['kty' => 'none', 'alg' => 'none']), + $protected, + $unprotected + ); + } + $jwsCreated = $builder->build(); + + if ($signaturesCount > 1) { + return $this->jwsSerializer->serialize('jws_json_general', $jwsCreated); + } + if ($jwt->getUnprotectedHeaders()) { + return $this->jwsSerializer->serialize('jws_json_flattened', $jwsCreated); + } + return $this->jwsSerializer->serialize('jws_compact', $jwsCreated); + } + + /** + * Read unsecured JWT token. + * + * @param string $token + * @return UnsecuredJwtInterface + * @throws JwtException + */ + public function read(string $token): UnsecuredJwtInterface + { + try { + $jws = $this->jwsLoader->loadAndVerifyWithKey( + $token, + new AdapterJwk(['kty' => 'none', 'alg' => 'none']), + $signature, + null + ); + } catch (\Throwable $exception) { + throw new MalformedTokenException('Failed to read JWT token', 0, $exception); + } + if ($jws->isPayloadDetached()) { + throw new JwtException('Detached payload is not supported'); + } + $protectedHeaders = []; + $publicHeaders = []; + foreach ($jws->getSignatures() as $signature) { + $protectedHeaders[] = $signature->getProtectedHeader(); + if ($signature->getHeader()) { + $publicHeaders[] = $signature->getHeader(); + } + } + + return $this->jwtFactory->create( + $protectedHeaders, + $publicHeaders, + $jws->getPayload() + ); + } + + /** + * Extract JOSE header data. + * + * @param HeaderInterface $header + * @return array + */ + private function extractHeaderData(HeaderInterface $header): array + { + $data = []; + foreach ($header->getParameters() as $parameter) { + $data[$parameter->getName()] = $parameter->getValue(); + } + + return $data; + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/README.md b/app/code/Magento/JwtFrameworkAdapter/README.md new file mode 100644 index 0000000000000..4a2f9dc59aef7 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/README.md @@ -0,0 +1 @@ +Provides Magento\Framework\Jwt\JwtManagerInterface implementation based on jwt-framework. diff --git a/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JweFactoryTest.php b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JweFactoryTest.php new file mode 100644 index 0000000000000..1258aab828a0a --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JweFactoryTest.php @@ -0,0 +1,131 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Test\Unit\Model; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\JweFactory; +use PHPUnit\Framework\TestCase; + +class JweFactoryTest extends TestCase +{ + /** + * @var JweFactory + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->model = new JweFactory(); + } + + public function getCreateCases(): array + { + return [ + 'compact-arbitrary' => [ + ['cty' => 'MyType', 'typ' => 'JWT'], + 'some-value', + null, + null, + ArbitraryPayload::class + ], + 'compact-claims' => [ + ['typ' => 'JWT'], + '{"tst1":"val1","tst2":2,"tst3":true}', + null, + null, + ClaimsPayloadInterface::class + ], + 'compact-nested' => [ + ['typ' => 'JWT', 'cty' => NestedPayloadInterface::CONTENT_TYPE], + 'eyJhbGciOiJub25lIn0.' + .'eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ.', + null, + null, + NestedPayloadInterface::class + ], + 'json-arbitrary' => [ + ['typ' => 'JWT'], + 'arbitrary', + ['cty' => 'SomeType'], + ['crit' => 'exp'], + ArbitraryPayload::class + ], + 'json-claims' => [ + ['typ' => 'JWT'], + '{"tst1":"val1","tst2":2,"tst3":true}', + ['aud' => 'magento'], + ['custom' => 'value'], + ClaimsPayloadInterface::class + ] + ]; + } + + /** + * Test "create" method. + * + * @param array $headers + * @param string $content + * @param array|null $unprotected + * @param array|null $perRecipient + * @param string $payloadClass + * @return void + * @dataProvider getCreateCases + */ + public function testCreate( + array $headers, + string $content, + ?array $unprotected, + ?array $perRecipient, + string $payloadClass + ): void { + $jwe = $this->model->create($headers, $content, $unprotected, $perRecipient); + + $payload = $jwe->getPayload(); + $this->assertEquals($content, $payload->getContent()); + $this->assertInstanceOf($payloadClass, $payload); + if ($payload instanceof ClaimsPayloadInterface) { + $actualClaims = []; + foreach ($payload->getClaims() as $claim) { + $actualClaims[$claim->getName()] = $claim->getValue(); + } + $this->assertEquals(json_decode($content, true), $actualClaims); + } + + $this->validateHeader($headers, $jwe->getHeader()); + if ($unprotected === null) { + $this->assertNull($jwe->getSharedUnprotectedHeader()); + } else { + $this->assertNotNull($jwe->getSharedUnprotectedHeader()); + $this->validateHeader($unprotected, $jwe->getSharedUnprotectedHeader()); + } + if ($perRecipient === null) { + $this->assertNull($jwe->getSharedUnprotectedHeader()); + } else { + $this->assertNotNull($jwe->getSharedUnprotectedHeader()); + $this->validateHeader($unprotected, $jwe->getSharedUnprotectedHeader()); + } + } + + private function validateHeader(array $expectedHeaders, HeaderInterface $actual): void + { + foreach ($expectedHeaders as $header => $value) { + $parameter = $actual->getParameter($header); + $this->assertNotNull($parameter); + $this->assertEquals($value, $parameter->getValue()); + } + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JwsFactoryTest.php b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JwsFactoryTest.php new file mode 100644 index 0000000000000..addbf4c983832 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/JwsFactoryTest.php @@ -0,0 +1,118 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Test\Unit\Model; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\JwsFactory; +use PHPUnit\Framework\TestCase; + +class JwsFactoryTest extends TestCase +{ + /** + * @var JwsFactory + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->model = new JwsFactory(); + } + + public function getCreateCases(): array + { + return [ + 'compact-arbitrary' => [ + ['cty' => 'MyType', 'typ' => 'JWT'], + 'some-value', + null, + ArbitraryPayload::class + ], + 'compact-claims' => [ + ['typ' => 'JWT'], + '{"tst1":"val1","tst2":2,"tst3":true}', + null, + ClaimsPayloadInterface::class + ], + 'compact-nested' => [ + ['typ' => 'JWT', 'cty' => NestedPayloadInterface::CONTENT_TYPE], + 'eyJhbGciOiJub25lIn0.' + .'eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ.', + null, + NestedPayloadInterface::class + ], + 'json-arbitrary' => [ + ['typ' => 'JWT'], + 'arbitrary', + ['cty' => 'SomeType'], + ArbitraryPayload::class + ], + 'json-claims' => [ + ['typ' => 'JWT'], + '{"tst1":"val1","tst2":2,"tst3":true}', + ['aud' => 'magento'], + ClaimsPayloadInterface::class + ] + ]; + } + + /** + * Test "create" method. + * + * @param array $headers + * @param string $content + * @param array|null $unprotected + * @param string $payloadClass + * @return void + * @dataProvider getCreateCases + */ + public function testCreate( + array $headers, + string $content, + ?array $unprotected, + string $payloadClass + ): void { + $jws = $this->model->create($headers, $content, $unprotected); + + $payload = $jws->getPayload(); + $this->assertEquals($content, $payload->getContent()); + $this->assertInstanceOf($payloadClass, $payload); + if ($payload instanceof ClaimsPayloadInterface) { + $actualClaims = []; + foreach ($payload->getClaims() as $claim) { + $actualClaims[$claim->getName()] = $claim->getValue(); + } + $this->assertEquals(json_decode($content, true), $actualClaims); + } + + $this->validateHeader($headers, $jws->getHeader()); + if ($unprotected === null) { + $this->assertEmpty($jws->getUnprotectedHeaders()); + } else { + $this->assertNotEmpty($jws->getUnprotectedHeaders()); + $this->validateHeader($unprotected, array_values($jws->getUnprotectedHeaders())[0]); + } + } + + private function validateHeader(array $expectedHeaders, HeaderInterface $actual): void + { + foreach ($expectedHeaders as $header => $value) { + $parameter = $actual->getParameter($header); + $this->assertNotNull($parameter); + $this->assertEquals($value, $parameter->getValue()); + } + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/UnsecuredJwtFactoryTest.php b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/UnsecuredJwtFactoryTest.php new file mode 100644 index 0000000000000..551f2c0b8c3fe --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/Test/Unit/Model/UnsecuredJwtFactoryTest.php @@ -0,0 +1,120 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\JwtFrameworkAdapter\Test\Unit\Model; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\Payload\ArbitraryPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\JwtFrameworkAdapter\Model\UnsecuredJwtFactory; +use PHPUnit\Framework\TestCase; + +class UnsecuredJwtFactoryTest extends TestCase +{ + /** + * @var UnsecuredJwtFactory + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->model = new UnsecuredJwtFactory(); + } + + public function getCreateCases(): array + { + return [ + 'compact-arbitrary' => [ + [['cty' => 'MyType', 'typ' => 'JWT']], + 'some-value', + null, + ArbitraryPayload::class + ], + 'compact-claims' => [ + [['typ' => 'JWT']], + '{"tst1":"val1","tst2":2,"tst3":true}', + null, + ClaimsPayloadInterface::class + ], + 'compact-nested' => [ + [['typ' => 'JWT', 'cty' => NestedPayloadInterface::CONTENT_TYPE]], + 'eyJhbGciOiJub25lIn0.' + .'eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ.', + null, + NestedPayloadInterface::class + ], + 'json-flat-arbitrary' => [ + [['typ' => 'JWT']], + 'arbitrary', + [['cty' => 'SomeType']], + ArbitraryPayload::class + ], + 'json-flat-claims' => [ + [['typ' => 'JWT']], + '{"tst1":"val1","tst2":2,"tst3":true}', + [['aud' => 'magento']], + ClaimsPayloadInterface::class + ], + 'json-arbitrary' => [ + [['typ' => 'JWT'], ['typ' => 'JWT', 'aud' => 'magento']], + 'value', + [['cty' => 'MyType'], ['cty' => 'MyType', 'crit' => 'exp']], + ArbitraryPayload::class + ] + ]; + } + + /** + * Test "create" method. + * + * @param array $headers + * @param string $content + * @param array|null $unprotected + * @param string $payloadClass + * @return void + * @dataProvider getCreateCases + */ + public function testCreate( + array $headers, + string $content, + ?array $unprotected, + string $payloadClass + ): void { + $jwt = $this->model->create($headers, $unprotected, $content); + + $payload = $jwt->getPayload(); + $this->assertEquals($content, $payload->getContent()); + $this->assertInstanceOf($payloadClass, $payload); + if ($payload instanceof ClaimsPayloadInterface) { + $actualClaims = []; + foreach ($payload->getClaims() as $claim) { + $actualClaims[$claim->getName()] = $claim->getValue(); + } + $this->assertEquals(json_decode($content, true), $actualClaims); + } + + $actualHeaders = array_map([$this, 'extractHeader'], $jwt->getProtectedHeaders()); + $this->assertEquals($headers, $actualHeaders); + } + + private function extractHeader(HeaderInterface $header): array + { + $values = []; + foreach ($header->getParameters() as $parameter) { + $values[$parameter->getName()] = $parameter->getValue(); + } + + return $values; + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/composer.json b/app/code/Magento/JwtFrameworkAdapter/composer.json new file mode 100644 index 0000000000000..e99a527d0a97d --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/composer.json @@ -0,0 +1,25 @@ +{ + "name": "magento/module-jwt-framework-adapter", + "description": "JWT Manager implementation based on jwt-framework", + "config": { + "sort-packages": true + }, + "require": { + "php": "~7.3.0||~7.4.0", + "magento/framework": "*", + "web-token/jwt-framework": "^v2.2.7" + }, + "type": "magento2-module", + "license": [ + "OSL-3.0", + "AFL-3.0" + ], + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "Magento\\JwtFrameworkAdapter\\": "" + } + } +} diff --git a/app/code/Magento/JwtFrameworkAdapter/etc/di.xml b/app/code/Magento/JwtFrameworkAdapter/etc/di.xml new file mode 100644 index 0000000000000..2a8248c67c9b7 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/etc/di.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <preference for="Magento\Framework\Jwt\JwtManagerInterface" type="Magento\JwtFrameworkAdapter\Model\JwtManager" /> +</config> diff --git a/app/code/Magento/JwtFrameworkAdapter/etc/module.xml b/app/code/Magento/JwtFrameworkAdapter/etc/module.xml new file mode 100644 index 0000000000000..256d332ef3fec --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/etc/module.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> + <module name="Magento_JwtFrameworkAdapter" /> +</config> diff --git a/app/code/Magento/JwtFrameworkAdapter/registration.php b/app/code/Magento/JwtFrameworkAdapter/registration.php new file mode 100644 index 0000000000000..2b21e8fad6520 --- /dev/null +++ b/app/code/Magento/JwtFrameworkAdapter/registration.php @@ -0,0 +1,9 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_JwtFrameworkAdapter', __DIR__); diff --git a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml index 49f2294b978ee..e8dcbec4fb3c2 100644 --- a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml +++ b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml @@ -50,12 +50,8 @@ </actionGroup> <selectOption selector="{{AdminProductFormSection.customSelectField($$attribute.attribute[attribute_code]$$)}}" userInput="option1" stepKey="selectAttribute"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAll"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAll"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Check storefront mobile view for shop by button is functioning as expected --> <comment userInput="Check storefront mobile view for shop by button is functioning as expected" stepKey="commentCheckShopByButton" /> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> diff --git a/app/code/Magento/LoginAsCustomer/Model/AuthenticateCustomerBySecret.php b/app/code/Magento/LoginAsCustomer/Model/AuthenticateCustomerBySecret.php index 808b01bac58aa..54d855bb2deb3 100644 --- a/app/code/Magento/LoginAsCustomer/Model/AuthenticateCustomerBySecret.php +++ b/app/code/Magento/LoginAsCustomer/Model/AuthenticateCustomerBySecret.php @@ -39,7 +39,7 @@ class AuthenticateCustomerBySecret implements AuthenticateCustomerBySecretInterf /** * @param GetAuthenticationDataBySecretInterface $getAuthenticationDataBySecret * @param Session $customerSession - * @param SetLoggedAsCustomerAdminIdInterface $setLoggedAsCustomerAdminId + * @param SetLoggedAsCustomerAdminIdInterface|null $setLoggedAsCustomerAdminId */ public function __construct( GetAuthenticationDataBySecretInterface $getAuthenticationDataBySecret, @@ -57,7 +57,11 @@ public function __construct( */ public function execute(string $secret): void { - $authenticationData = $this->getAuthenticationDataBySecret->execute($secret); + try { + $authenticationData = $this->getAuthenticationDataBySecret->execute($secret); + } catch (LocalizedException $exception) { + throw new LocalizedException(__('Login was not successful.')); + } if ($this->customerSession->getId()) { $this->customerSession->logout(); @@ -67,7 +71,6 @@ public function execute(string $secret): void if (false === $result) { throw new LocalizedException(__('Login was not successful.')); } - $this->customerSession->regenerateId(); $this->setLoggedAsCustomerAdminId->execute($authenticationData->getAdminId()); } diff --git a/app/code/Magento/LoginAsCustomer/Model/GenerateAuthenticationSecret.php b/app/code/Magento/LoginAsCustomer/Model/GenerateAuthenticationSecret.php new file mode 100644 index 0000000000000..56a6bf8e74bf4 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Model/GenerateAuthenticationSecret.php @@ -0,0 +1,75 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LoginAsCustomer\Model; + +use Magento\Framework\Encryption\EncryptorInterface; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\LoginAsCustomerApi\Api\GenerateAuthenticationSecretInterface; +use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface; + +/** + * Generates authentication secret + */ +class GenerateAuthenticationSecret implements GenerateAuthenticationSecretInterface +{ + /**#@+ + * Constants + */ + private const CUSTOMER_ID = 'customer_id'; + private const ADMIN_ID = 'admin_id'; + private const TIME_STAMP = 'time_stamp'; + /**#@-*/ + + /** + * @var DateTime + */ + private $dateTime; + + /** + * @var EncryptorInterface + */ + private $encryptor; + + /** + * @var SerializerInterface + */ + private $serializer; + + /** + * @param DateTime $dateTime + * @param EncryptorInterface $encryptor + * @param SerializerInterface $serializer + */ + public function __construct( + DateTime $dateTime, + EncryptorInterface $encryptor, + SerializerInterface $serializer + ) { + $this->dateTime = $dateTime; + $this->encryptor = $encryptor; + $this->serializer = $serializer; + } + + /** + * @inheritdoc + */ + public function execute(AuthenticationDataInterface $authenticationData): string + { + $currentTimestamp = $this->dateTime->timestamp(); + $customerId = $authenticationData->getCustomerId(); + $adminId = $authenticationData->getAdminId(); + return $this->encryptor->encrypt($this->serializer->serialize( + [ + self::ADMIN_ID => $adminId, + self::CUSTOMER_ID => $customerId, + self::TIME_STAMP => $currentTimestamp + ] + )); + } +} diff --git a/app/code/Magento/LoginAsCustomer/Model/GetAuthenticationDataBySecret.php b/app/code/Magento/LoginAsCustomer/Model/GetAuthenticationDataBySecret.php new file mode 100644 index 0000000000000..feafe8f719094 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Model/GetAuthenticationDataBySecret.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LoginAsCustomer\Model; + +use Magento\Framework\Encryption\EncryptorInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface; +use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterfaceFactory; +use Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface; + +/** + * @inheritdoc + */ +class GetAuthenticationDataBySecret implements GetAuthenticationDataBySecretInterface +{ + /**#@+ + * Constants + */ + private const CUSTOMER_ID = 'customer_id'; + private const ADMIN_ID = 'admin_id'; + private const TIME_STAMP = 'time_stamp'; + /**#@-*/ + + /** + * Duration in seconds the encrypted data is valid for + */ + private const DATA_LIFETIME = 10; + + /** + * @var DateTime + */ + private $dateTime; + + /** + * @var EncryptorInterface + */ + private $encryptor; + + /** + * @var SerializerInterface + */ + private $serializer; + + /** + * @var AuthenticationDataInterfaceFactory + */ + private $authenticationDataFactory; + + /** + * @param DateTime $dateTime + * @param EncryptorInterface $encryptor + * @param SerializerInterface $serializer + * @param AuthenticationDataInterfaceFactory $authenticationDataFactory + */ + public function __construct( + DateTime $dateTime, + EncryptorInterface $encryptor, + SerializerInterface $serializer, + AuthenticationDataInterfaceFactory $authenticationDataFactory + ) { + $this->dateTime = $dateTime; + $this->encryptor = $encryptor; + $this->serializer = $serializer; + $this->authenticationDataFactory = $authenticationDataFactory; + } + + /** + * @inheritdoc + */ + public function execute(string $secret): AuthenticationDataInterface + { + $data = $this->serializer->unserialize($this->encryptor->decrypt($secret)); + $currentTimestamp = $this->dateTime->timestamp(); + $authenticationDataLifeTime = $currentTimestamp - $data[self::TIME_STAMP]; + if (isset($data[self::ADMIN_ID]) + && isset($data[self::CUSTOMER_ID]) + && isset($data[self::TIME_STAMP]) + && $authenticationDataLifeTime < self::DATA_LIFETIME) { + return $this->authenticationDataFactory->create( + [ + 'customerId' => $data[self::CUSTOMER_ID], + 'adminId' => $data[self::ADMIN_ID], + ] + ); + } else { + throw new LocalizedException(__('Fail to get authentication data.')); + } + } +} diff --git a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/DeleteAuthenticationDataForUser.php b/app/code/Magento/LoginAsCustomer/Model/ResourceModel/DeleteAuthenticationDataForUser.php index f023d08e40253..e1e0ddc9ef1cd 100644 --- a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/DeleteAuthenticationDataForUser.php +++ b/app/code/Magento/LoginAsCustomer/Model/ResourceModel/DeleteAuthenticationDataForUser.php @@ -8,8 +8,6 @@ namespace Magento\LoginAsCustomer\Model\ResourceModel; use Magento\Framework\App\ResourceConnection; -use Magento\Framework\Stdlib\DateTime\DateTime; -use Magento\LoginAsCustomerApi\Api\ConfigInterface; use Magento\LoginAsCustomerApi\Api\DeleteAuthenticationDataForUserInterface; /** @@ -22,29 +20,13 @@ class DeleteAuthenticationDataForUser implements DeleteAuthenticationDataForUser */ private $resourceConnection; - /** - * @var DateTime - */ - private $dateTime; - - /** - * @var ConfigInterface - */ - private $config; - /** * @param ResourceConnection $resourceConnection - * @param DateTime $dateTime - * @param ConfigInterface $config */ public function __construct( - ResourceConnection $resourceConnection, - DateTime $dateTime, - ConfigInterface $config + ResourceConnection $resourceConnection ) { $this->resourceConnection = $resourceConnection; - $this->dateTime = $dateTime; - $this->config = $config; } /** diff --git a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/GetAuthenticationDataBySecret.php b/app/code/Magento/LoginAsCustomer/Model/ResourceModel/GetAuthenticationDataBySecret.php deleted file mode 100644 index 0c417f78800a2..0000000000000 --- a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/GetAuthenticationDataBySecret.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\LoginAsCustomer\Model\ResourceModel; - -use Magento\Framework\App\ObjectManager; -use Magento\Framework\App\ResourceConnection; -use Magento\Framework\Encryption\EncryptorInterface; -use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Stdlib\DateTime\DateTime; -use Magento\LoginAsCustomerApi\Api\ConfigInterface; -use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface; -use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterfaceFactory; -use Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface; - -/** - * @inheritdoc - */ -class GetAuthenticationDataBySecret implements GetAuthenticationDataBySecretInterface -{ - /** - * @var ResourceConnection - */ - private $resourceConnection; - - /** - * @var DateTime - */ - private $dateTime; - - /** - * @var ConfigInterface - */ - private $config; - - /** - * @var AuthenticationDataInterfaceFactory - */ - private $authenticationDataFactory; - - /** - * @var EncryptorInterface - */ - private $encryptor; - - /** - * @param ResourceConnection $resourceConnection - * @param DateTime $dateTime - * @param ConfigInterface $config - * @param AuthenticationDataInterfaceFactory $authenticationDataFactory - * @param EncryptorInterface|null $encryptor - */ - public function __construct( - ResourceConnection $resourceConnection, - DateTime $dateTime, - ConfigInterface $config, - AuthenticationDataInterfaceFactory $authenticationDataFactory, - ?EncryptorInterface $encryptor = null - ) { - $this->resourceConnection = $resourceConnection; - $this->dateTime = $dateTime; - $this->config = $config; - $this->authenticationDataFactory = $authenticationDataFactory; - $this->encryptor = $encryptor ?? ObjectManager::getInstance()->get(EncryptorInterface::class); - } - - /** - * @inheritdoc - */ - public function execute(string $secret): AuthenticationDataInterface - { - $connection = $this->resourceConnection->getConnection(); - $tableName = $this->resourceConnection->getTableName('login_as_customer'); - - $timePoint = date( - 'Y-m-d H:i:s', - $this->dateTime->gmtTimestamp() - $this->config->getAuthenticationDataExpirationTime() - ); - - $hash = $this->encryptor->hash($secret); - - $select = $connection->select() - ->from(['main_table' => $tableName]) - ->where('main_table.secret = ?', $hash) - ->where('main_table.created_at > ?', $timePoint); - - $data = $connection->fetchRow($select); - - if (!$data) { - throw new LocalizedException(__('Secret key is not found or was expired.')); - } - - /** @var AuthenticationDataInterface $authenticationData */ - $authenticationData = $this->authenticationDataFactory->create( - [ - 'customerId' => (int)$data['customer_id'], - 'adminId' => (int)$data['admin_id'], - 'extensionAttributes' => null, - ] - ); - return $authenticationData; - } -} diff --git a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/SaveAuthenticationData.php b/app/code/Magento/LoginAsCustomer/Model/ResourceModel/SaveAuthenticationData.php index 10d110c8ddf0b..76f3bfafb0b4c 100644 --- a/app/code/Magento/LoginAsCustomer/Model/ResourceModel/SaveAuthenticationData.php +++ b/app/code/Magento/LoginAsCustomer/Model/ResourceModel/SaveAuthenticationData.php @@ -13,6 +13,7 @@ use Magento\Framework\Math\Random; use Magento\Framework\Stdlib\DateTime\DateTime; use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface; +use Magento\LoginAsCustomerApi\Api\GenerateAuthenticationSecretInterface; use Magento\LoginAsCustomerApi\Api\SaveAuthenticationDataInterface; /** @@ -40,22 +41,31 @@ class SaveAuthenticationData implements SaveAuthenticationDataInterface */ private $random; + /** + * @var GenerateAuthenticationSecretInterface + */ + private $generateAuthenticationSecret; + /** * @param ResourceConnection $resourceConnection * @param DateTime $dateTime * @param Random $random - * @param EncryptorInterface $encryptor + * @param EncryptorInterface|null $encryptor + * @param GenerateAuthenticationSecretInterface|null $generateAuthenticationSecret */ public function __construct( ResourceConnection $resourceConnection, DateTime $dateTime, Random $random, - ?EncryptorInterface $encryptor = null + ?EncryptorInterface $encryptor = null, + ?GenerateAuthenticationSecretInterface $generateAuthenticationSecret = null ) { $this->resourceConnection = $resourceConnection; $this->dateTime = $dateTime; $this->random = $random; $this->encryptor = $encryptor ?? ObjectManager::getInstance()->get(EncryptorInterface::class); + $this->generateAuthenticationSecret = $generateAuthenticationSecret + ?? ObjectManager::getInstance()->get(GenerateAuthenticationSecretInterface::class); } /** @@ -66,8 +76,8 @@ public function execute(AuthenticationDataInterface $authenticationData): string $connection = $this->resourceConnection->getConnection(); $tableName = $this->resourceConnection->getTableName('login_as_customer'); - $secret = $this->random->getRandomString(64); - $hash = $this->encryptor->hash($secret); + $key = $this->random->getRandomString(64); + $hash = $this->encryptor->hash($key); $connection->insert( $tableName, @@ -79,6 +89,6 @@ public function execute(AuthenticationDataInterface $authenticationData): string ] ); - return $secret; + return $this->generateAuthenticationSecret->execute($authenticationData); } } diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup.xml new file mode 100644 index 0000000000000..3367f20fe304a --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup"> + <annotations> + <description>Filter Login as Customer Log grid by current day.</description> + </annotations> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.filters}}" stepKey="clickFilters"/> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.DatePickerFrom}}" stepKey="clickFromDate"/> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.todayDate}}" stepKey="clickToToday"/> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.DatePickerTo}}" stepKey="clickToDate"/> + <click selector="{{AdminLoginAsCustomerLogToolbarSection.todayDate}}" stepKey="clickTodayDateAgain"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml index 599a6f8f9e270..983aba6a9a0ff 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageActionGroup.xml @@ -21,8 +21,9 @@ <click selector="{{AdminCustomerMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> <see selector="{{AdminConfirmationModalSection.title}}" userInput="You are about to Login as Customer" stepKey="seeModal"/> - <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> + <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> + <waitForPageLoad stepKey="waitForLoadingMaskToDisappear" /> <switchToNextTab stepKey="switchToNewTab"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml index dc953061ca433..ac827b03a7711 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup.xml @@ -24,6 +24,7 @@ <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> <selectOption selector="{{AdminLoginAsCustomerConfirmationModalSection.store}}" userInput="{{storeName}}" stepKey="selectStore"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> + <waitForPageLoad stepKey="waitForLoadingMaskToDisappear" /> <switchToNextTab stepKey="switchToNewTab"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml index a478f8e9d18cd..e83f7539cc6ae 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLoginFromOrderPageActionGroup.xml @@ -21,8 +21,9 @@ <click selector="{{AdminOrderDetailsMainActionsSection.loginAsCustomer}}" stepKey="clickLoginAsCustomerLink"/> <see selector="{{AdminConfirmationModalSection.title}}" userInput="You are about to Login as Customer" stepKey="seeModal"/> - <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> + <see selector="{{AdminConfirmationModalSection.message}}" userInput="Actions taken while in "Login as Customer" will affect actual customer data." stepKey="seeModalMessage"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickLogin"/> + <waitForPageLoad stepKey="waitForLoadingMaskToDisappear" /> <switchToNextTab stepKey="switchToNewTab"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup.xml new file mode 100644 index 0000000000000..bff81d0e3a05d --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup"> + <annotations> + <description>Verify "Allow remote shopping assistance" checkbox present on page and checked.</description> + </annotations> + + <waitForElement selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}" stepKey="waitForAllowAssistanceCheckbox"/> + <seeCheckboxIsChecked selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}" + stepKey="assertAllowAssistanceCheckboxChecked"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup.xml new file mode 100644 index 0000000000000..1b74eba6aba3c --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup"> + <annotations> + <description>Verify "Allow remote shopping assistance" checkbox present on page and unchecked.</description> + </annotations> + + <waitForElement selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}" stepKey="waitForAllowAssistanceCheckbox"/> + <dontSeeCheckboxIsChecked selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}" + stepKey="assertAllowAssistanceCheckboxUnchecked"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml index a917ab6acb182..c2d5017935217 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLogPage.xml @@ -7,7 +7,7 @@ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:/Page/etc/PageObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminLoginAsCustomerLogPage" url="loginascustomer_log/log/index/" area="admin" module="Magento_LoginAsCustomer"> <section name="AdminLoginAsCustomerLogToolbarSection"/> <section name="AdminLoginAsCustomerLogFiltersSection"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml index ddb87ba83bc3a..f7b213fe38df3 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/AdminLoginAsCustomerLoginManualPage.xml @@ -7,7 +7,7 @@ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:/Page/etc/PageObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminLoginAsCustomerLoginManualPage" url="loginascustomer/login/manual/entity_id/{{id}}/" area="storefront" module="Magento_LoginAsCustomer" parameterized="true"> <section name="AdminLoginAsCustomerLoginManualActionsSection"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.xml index 05af5f506112e..6c8ec8a86b2ca 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Page/StorefrontLoginAsCustomerLoginProceedPage.xml @@ -7,6 +7,6 @@ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:/Page/etc/PageObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="StorefrontLoginAsCustomerLoginProceedPage" url="loginascustomer/login/proceed" area="storefront" module="Magento_LoginAsCustomer"/> </pages> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml index a403367ee0d02..fdb684db8c804 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerLogToolbarSection.xml @@ -10,7 +10,11 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminLoginAsCustomerLogToolbarSection"> <element name="search" type="button" selector="button[data-action='grid-filter-apply']"/> - <element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']"/> + <element name="filters" type="button" selector="button[data-action='grid-filter-expand']"/> + <element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="15"/> + <element name="DatePickerFrom" type="button" selector="[name='time[from]'] + button" timeout="15"/> + <element name="DatePickerTo" type="button" selector="[name='time[to]'] + button" timeout="15"/> + <element name="todayDate" type="button" selector=".ui-datepicker-today"/> </section> </sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml new file mode 100644 index 0000000000000..625e474d5f011 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCustomerAccountInformationSection"> + <element name="allowAssistance" type="checkbox" selector=".form-edit-account input[name='assistance_allowed_checkbox']"/> + </section> +</sections> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAssistanceCheckboxTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAssistanceCheckboxTest.xml new file mode 100644 index 0000000000000..13b93f930b005 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAssistanceCheckboxTest.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminLoginAsCustomerAssistanceCheckboxTest"> + <annotations> + <features value="Login as Customer"/> + <stories value="Opt in/out"/> + <title value="Login as Customer assistance checkbox test"/> + <description + value="Verify that 'Allow remote shopping assistance' checkbox is present on Edit Account Information page"/> + <severity value="CRITICAL"/> + <group value="login_as_customer"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> + <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createFirstCustomer"/> + <createData entity="Simple_US_Customer" stepKey="createSecondCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/> + </before> + <after> + <deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/> + <deleteData createDataKey="createSecondCustomer" stepKey="deleteSecondCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAfter"/> + </after> + <!-- Login into First Customer account --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsFirstCustomer"> + <argument name="Customer" value="$createFirstCustomer$"/> + </actionGroup> + + <!-- Open My Account > Order by SKU --> + <actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToFirstMyAccountPage"/> + <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="openFirstAccountInformation"> + <argument name="menu" value="Account Information"/> + </actionGroup> + + <!-- Assert Assistance checkbox is present and checked --> + <actionGroup ref="StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup" + stepKey="assertAssistanceAllowedCheckboxChecked"/> + + <!-- Logout customer --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFirstCustomer"/> + + <!-- Login into Second Customer account --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsSecondCustomer"> + <argument name="Customer" value="$createSecondCustomer$"/> + </actionGroup> + + <!-- Open My Account > Order by SKU --> + <actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToSecondMyAccountPage"/> + <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="openSecondAccountInformation"> + <argument name="menu" value="Account Information"/> + </actionGroup> + + <!-- Assert Assistance checkbox is present and unchecked --> + <actionGroup ref="StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup" + stepKey="assertAssistanceAllowedCheckboxUnchecked"/> + </test> +</tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingFilterTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingFilterTest.xml new file mode 100644 index 0000000000000..592390c43bce7 --- /dev/null +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingFilterTest.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminLoginAsCustomerLoggingFilterTest"> + <annotations> + <features value="Login as Customer logs"/> + <stories value="Filter by date login as customer logs"/> + <title value="Filter by date login as customer logs"/> + <description value="Filter by date should be from/to"/> + <severity value="AVERAGE"/> + <group value="login_as_customer"/> + <testCaseId value="MC-38920"/> + </annotations> + <before> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" + stepKey="enableLoginAsCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" + stepKey="enableLoginAsCustomerAutoDetection"/> + <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createFirstCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/> + </before> + <after> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterAfter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsDefaultAdmin"/> + <deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/> + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" + stepKey="disableLoginAsCustomer"/> + </after> + <!-- Login into First Customer account --> + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" + stepKey="loginAsFirstCustomerByDefaultAdmin"> + <argument name="customerId" value="$$createFirstCustomer.id$$"/> + </actionGroup> + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutFirstCustomerDefaultAdmin"/> + <!-- Navigate to Login as Customer Log page --> + <actionGroup ref="AdminOpenLoginAsCustomerLogActionGroup" stepKey="gotoLoginAsCustomerLog"/> + <!-- Setup date filters --> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> + <actionGroup ref="AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup" stepKey="filterByToday"/> + <!-- Perform assertions --> + <actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyDefaultAdminFirstCustomerLogRecord"> + <argument name="rowNumber" value="1"/> + <argument name="adminId" value="1"/> + <argument name="customerId" value="$$createFirstCustomer.id$$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml index 8afaaabbc92bf..548f3637b5973 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml @@ -70,7 +70,7 @@ <!-- Place Order as Customer --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="$$createProduct.sku$$"/> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml index 8bef9fce9995b..4ddf500dec37e 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml @@ -69,7 +69,7 @@ <!-- Place Order as Customer --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="$$createProduct.sku$$"/> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml index 02a96df93eae4..b3297f6bb000d 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUIShownIfLoginAsCustomerEnabledTest.xml @@ -29,9 +29,7 @@ </createData> <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCachesAfterSet"> <argument name="tags" value="config full_page"/> </actionGroup> @@ -44,9 +42,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAfter"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAfter"/> <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCachesDefault"> <argument name="tags" value="config full_page"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml index 38e89050c275e..3811a1aa9fd50 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest.xml @@ -20,9 +20,7 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> @@ -40,9 +38,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> </after> <!-- Admin Login as Customer from Customer page and assert notification banner --> @@ -61,7 +57,7 @@ </actionGroup> <!-- Go to category page and assert notification banner --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnCategoryPage"> <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> </actionGroup> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml index c0d7d26816fa2..2b909d6ba2544 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerSeeSpecialPriceOnCategoryTest.xml @@ -20,9 +20,7 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> @@ -46,9 +44,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> </after> <!-- Creating a new catalog price rule with 50 percent discount for Retailer customer group --> @@ -63,12 +59,8 @@ <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Admin Login as Customer --> <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage"> @@ -79,7 +71,7 @@ </actionGroup> <!-- Check simple product prices on store front category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProduct1Price"> <argument name="productInfo" value="$5.00"/> <argument name="productNumber" value="1"/> @@ -91,7 +83,7 @@ <!-- Place order --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> - <argument name="productUrl" value="$$createProduct.sku$$"/> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml index b2c7c6c35db18..97e3cac9f4ecf 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerShoppingCartIsNotMergedWithGuestCartTest.xml @@ -20,9 +20,7 @@ <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> @@ -39,9 +37,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushConfigCache"/> </after> <!-- Add product to guest cart --> diff --git a/app/code/Magento/LoginAsCustomer/etc/config.xml b/app/code/Magento/LoginAsCustomer/etc/config.xml index 7e39cc39145eb..0532bb9912c2d 100644 --- a/app/code/Magento/LoginAsCustomer/etc/config.xml +++ b/app/code/Magento/LoginAsCustomer/etc/config.xml @@ -12,7 +12,6 @@ <general> <enabled>1</enabled> <store_view_manual_choice_enabled>0</store_view_manual_choice_enabled> - <authentication_data_expiration_time>60</authentication_data_expiration_time> </general> </login_as_customer> </default> diff --git a/app/code/Magento/LoginAsCustomer/etc/di.xml b/app/code/Magento/LoginAsCustomer/etc/di.xml index 9927237c51db6..e13fc15bf4029 100755 --- a/app/code/Magento/LoginAsCustomer/etc/di.xml +++ b/app/code/Magento/LoginAsCustomer/etc/di.xml @@ -9,10 +9,12 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface" type="Magento\LoginAsCustomer\Model\AuthenticationData"/> + <preference for="Magento\LoginAsCustomerApi\Api\GenerateAuthenticationSecretInterface" + type="Magento\LoginAsCustomer\Model\GenerateAuthenticationSecret"/> <preference for="Magento\LoginAsCustomerApi\Api\SaveAuthenticationDataInterface" type="Magento\LoginAsCustomer\Model\ResourceModel\SaveAuthenticationData"/> <preference for="Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface" - type="Magento\LoginAsCustomer\Model\ResourceModel\GetAuthenticationDataBySecret"/> + type="Magento\LoginAsCustomer\Model\GetAuthenticationDataBySecret"/> <preference for="Magento\LoginAsCustomerApi\Api\AuthenticateCustomerBySecretInterface" type="Magento\LoginAsCustomer\Model\AuthenticateCustomerBySecret"/> <preference for="Magento\LoginAsCustomerApi\Api\DeleteAuthenticationDataForUserInterface" diff --git a/app/code/Magento/LoginAsCustomerAdminUi/Controller/Adminhtml/Login/Login.php b/app/code/Magento/LoginAsCustomerAdminUi/Controller/Adminhtml/Login/Login.php index e80c3700349df..25e6053e685cf 100644 --- a/app/code/Magento/LoginAsCustomerAdminUi/Controller/Adminhtml/Login/Login.php +++ b/app/code/Magento/LoginAsCustomerAdminUi/Controller/Adminhtml/Login/Login.php @@ -11,10 +11,11 @@ use Magento\Backend\App\Action\Context; use Magento\Backend\Model\Auth\Session; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Customer\Model\Config\Share; use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\App\ObjectManager; -use Magento\Framework\Controller\Result\Redirect; +use Magento\Framework\Controller\Result\Json as JsonResult; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\LocalizedException; @@ -27,6 +28,7 @@ use Magento\LoginAsCustomerApi\Api\IsLoginAsCustomerEnabledForCustomerInterface; use Magento\LoginAsCustomerApi\Api\SaveAuthenticationDataInterface; use Magento\LoginAsCustomerApi\Api\SetLoggedAsCustomerCustomerIdInterface; +use Magento\LoginAsCustomerApi\Api\GenerateAuthenticationSecretInterface; use Magento\Store\Model\StoreManagerInterface; use Magento\Store\Model\StoreSwitcher\ManageStoreCookie; @@ -36,7 +38,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Login extends Action implements HttpGetActionInterface +class Login extends Action implements HttpPostActionInterface { /** * Authorization level of a basic admin session @@ -105,6 +107,11 @@ class Login extends Action implements HttpGetActionInterface */ private $isLoginAsCustomerEnabled; + /** + * @var GenerateAuthenticationSecretInterface + */ + private $generateAuthenticationSecret; + /** * @param Context $context * @param Session $authSession @@ -115,11 +122,11 @@ class Login extends Action implements HttpGetActionInterface * @param SaveAuthenticationDataInterface $saveAuthenticationData * @param DeleteAuthenticationDataForUserInterface $deleteAuthenticationDataForUser * @param Url $url - * @param Share $share - * @param ManageStoreCookie $manageStoreCookie - * @param SetLoggedAsCustomerCustomerIdInterface $setLoggedAsCustomerCustomerId - * @param IsLoginAsCustomerEnabledForCustomerInterface $isLoginAsCustomerEnabled - * + * @param Share|null $share + * @param ManageStoreCookie|null $manageStoreCookie + * @param SetLoggedAsCustomerCustomerIdInterface|null $setLoggedAsCustomerCustomerId + * @param IsLoginAsCustomerEnabledForCustomerInterface|null $isLoginAsCustomerEnabled + * @param GenerateAuthenticationSecretInterface|null $generateAuthenticationSecret * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -135,7 +142,8 @@ public function __construct( ?Share $share = null, ?ManageStoreCookie $manageStoreCookie = null, ?SetLoggedAsCustomerCustomerIdInterface $setLoggedAsCustomerCustomerId = null, - ?IsLoginAsCustomerEnabledForCustomerInterface $isLoginAsCustomerEnabled = null + ?IsLoginAsCustomerEnabledForCustomerInterface $isLoginAsCustomerEnabled = null, + ?GenerateAuthenticationSecretInterface $generateAuthenticationSecret = null ) { parent::__construct($context); @@ -153,6 +161,8 @@ public function __construct( ?? ObjectManager::getInstance()->get(SetLoggedAsCustomerCustomerIdInterface::class); $this->isLoginAsCustomerEnabled = $isLoginAsCustomerEnabled ?? ObjectManager::getInstance()->get(IsLoginAsCustomerEnabledForCustomerInterface::class); + $this->generateAuthenticationSecret = $generateAuthenticationSecret + ?? ObjectManager::getInstance()->get(GenerateAuthenticationSecretInterface::class); } /** @@ -164,8 +174,7 @@ public function __construct( */ public function execute(): ResultInterface { - /** @var Redirect $resultRedirect */ - $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); + $messages = []; $customerId = (int)$this->_request->getParam('customer_id'); if (!$customerId) { @@ -175,24 +184,24 @@ public function execute(): ResultInterface $isLoginAsCustomerEnabled = $this->isLoginAsCustomerEnabled->execute($customerId); if (!$isLoginAsCustomerEnabled->isEnabled()) { foreach ($isLoginAsCustomerEnabled->getMessages() as $message) { - $this->messageManager->addErrorMessage(__($message)); + $messages[] = __($message); } - return $resultRedirect->setPath('customer/index/index'); + return $this->prepareJsonResult($messages); } try { $customer = $this->customerRepository->getById($customerId); } catch (NoSuchEntityException $e) { - $this->messageManager->addErrorMessage('Customer with this ID are no longer exist.'); - return $resultRedirect->setPath('customer/index/index'); + $messages[] = __('Customer with this ID no longer exists.'); + return $this->prepareJsonResult($messages); } if ($this->config->isStoreManualChoiceEnabled()) { $storeId = (int)$this->_request->getParam('store_id'); if (empty($storeId)) { - $this->messageManager->addNoticeMessage(__('Please select a Store to login in.')); - return $resultRedirect->setPath('customer/index/edit', ['id' => $customerId]); + $messages[] = __('Please select a Store View to login in.'); + return $this->prepareJsonResult($messages); } } elseif ($this->share->isGlobalScope()) { $storeId = (int)$this->storeManager->getDefaultStoreView()->getId(); @@ -213,12 +222,13 @@ public function execute(): ResultInterface ); $this->deleteAuthenticationDataForUser->execute($userId); - $secret = $this->saveAuthenticationData->execute($authenticationData); + $this->saveAuthenticationData->execute($authenticationData); $this->setLoggedAsCustomerCustomerId->execute($customerId); + $secret = $this->generateAuthenticationSecret->execute($authenticationData); $redirectUrl = $this->getLoginProceedRedirectUrl($secret, $storeId); - $resultRedirect->setUrl($redirectUrl); - return $resultRedirect; + + return $this->prepareJsonResult($messages, $redirectUrl); } /** @@ -232,10 +242,10 @@ public function execute(): ResultInterface private function getLoginProceedRedirectUrl(string $secret, int $storeId): string { $targetStore = $this->storeManager->getStore($storeId); - + $queryParameters = ['secret' => $secret]; $redirectUrl = $this->url ->setScope($targetStore) - ->getUrl('loginascustomer/login/index', ['secret' => $secret, '_nosid' => true]); + ->getUrl('loginascustomer/login/index', ['_query' => $queryParameters, '_nosid' => true]); if (!$targetStore->isUseStoreInUrl()) { $fromStore = $this->storeManager->getStore(); @@ -244,4 +254,24 @@ private function getLoginProceedRedirectUrl(string $secret, int $storeId): strin return $redirectUrl; } + + /** + * Prepare JSON result + * + * @param array $messages + * @param string|null $redirectUrl + * @return JsonResult + */ + private function prepareJsonResult(array $messages, ?string $redirectUrl = null) + { + /** @var JsonResult $jsonResult */ + $jsonResult = $this->resultFactory->create(ResultFactory::TYPE_JSON); + + $jsonResult->setData([ + 'redirectUrl' => $redirectUrl, + 'messages' => $messages, + ]); + + return $jsonResult; + } } diff --git a/app/code/Magento/LoginAsCustomerAdminUi/Plugin/Button/ToolbarPlugin.php b/app/code/Magento/LoginAsCustomerAdminUi/Plugin/Button/ToolbarPlugin.php index 2cdcd5723df4b..8bab73963e885 100644 --- a/app/code/Magento/LoginAsCustomerAdminUi/Plugin/Button/ToolbarPlugin.php +++ b/app/code/Magento/LoginAsCustomerAdminUi/Plugin/Button/ToolbarPlugin.php @@ -78,7 +78,7 @@ public function beforePushButtons( if ($order && !empty($order['customer_id']) && $this->config->isEnabled() - && $this->authorization->isAllowed('Magento_LoginAsCustomer::login_button') + && $this->authorization->isAllowed('Magento_LoginAsCustomer::login') ) { $customerId = (int)$order['customer_id']; $buttonList->add( diff --git a/app/code/Magento/LoginAsCustomerAdminUi/Ui/Customer/Component/Control/LoginAsCustomerButton.php b/app/code/Magento/LoginAsCustomerAdminUi/Ui/Customer/Component/Control/LoginAsCustomerButton.php index ab43fca3d447e..73d756f80c519 100644 --- a/app/code/Magento/LoginAsCustomerAdminUi/Ui/Customer/Component/Control/LoginAsCustomerButton.php +++ b/app/code/Magento/LoginAsCustomerAdminUi/Ui/Customer/Component/Control/LoginAsCustomerButton.php @@ -61,7 +61,7 @@ public function getButtonData(): array { $customerId = (int)$this->getCustomerId(); $data = []; - $isAllowed = $customerId && $this->authorization->isAllowed('Magento_LoginAsCustomer::login_button'); + $isAllowed = $customerId && $this->authorization->isAllowed('Magento_LoginAsCustomer::login'); $isEnabled = $this->config->isEnabled(); if ($isAllowed && $isEnabled) { $data = $this->dataProvider->getData($customerId); diff --git a/app/code/Magento/LoginAsCustomerAdminUi/etc/acl.xml b/app/code/Magento/LoginAsCustomerAdminUi/etc/acl.xml index f49526f6bbb04..943bad2bf3235 100644 --- a/app/code/Magento/LoginAsCustomerAdminUi/etc/acl.xml +++ b/app/code/Magento/LoginAsCustomerAdminUi/etc/acl.xml @@ -10,9 +10,7 @@ <resources> <resource id="Magento_Backend::admin"> <resource id="Magento_Customer::customer"> - <resource id="Magento_LoginAsCustomer::login" title="Login as Customer" sortOrder="50"> - <resource id="Magento_LoginAsCustomer::login_button" title="Allow Login as Customer Button" sortOrder="10" /> - </resource> + <resource id="Magento_LoginAsCustomer::login" title="Login as Customer" sortOrder="50"/> </resource> <resource id="Magento_Backend::stores"> <resource id="Magento_Backend::stores_settings"> diff --git a/app/code/Magento/LoginAsCustomerAdminUi/view/adminhtml/web/js/confirmation-popup.js b/app/code/Magento/LoginAsCustomerAdminUi/view/adminhtml/web/js/confirmation-popup.js index 248b0eea1ca0a..0145fd73bd6b3 100644 --- a/app/code/Magento/LoginAsCustomerAdminUi/view/adminhtml/web/js/confirmation-popup.js +++ b/app/code/Magento/LoginAsCustomerAdminUi/view/adminhtml/web/js/confirmation-popup.js @@ -10,8 +10,10 @@ define([ 'ko', 'mage/translate', 'mage/template', + 'underscore', + 'Magento_Ui/js/modal/alert', 'text!Magento_LoginAsCustomerAdminUi/template/confirmation-popup/store-view-ptions.html' -], function (Component, confirm, $, ko, $t, template, selectTpl) { +], function (Component, confirm, $, ko, $t, template, _, alert, selectTpl) { 'use strict'; @@ -55,13 +57,63 @@ define([ * Confirm action. */ confirm: function () { - var storeId = $('#lac-confirmation-popup-store-id').val(); + var storeId = $('#lac-confirmation-popup-store-id').val(), + formKey = $('input[name="form_key"]').val(), + params = {}; + // jscs:disable requireCamelCaseOrUpperCaseIdentifiers if (storeId) { - url += url.indexOf('?') === -1 ? '?' : '&'; - url += 'store_id=' + storeId; + params.store_id = storeId; } - window.open(url); + + if (formKey) { + params.form_key = formKey; + } + // jscs:enable requireCamelCaseOrUpperCaseIdentifiers + + $.ajax({ + url: url, + type: 'POST', + dataType: 'json', + data: params, + showLoader: true, + + /** + * Open redirect URL in new window, or show messages if they are present + * + * @param {Object} data + */ + success: function (data) { + var messages = data.messages || []; + + if (data.message) { + messages.push(data.message); + } + + if (data.redirectUrl) { + window.open(data.redirectUrl); + } else if (messages.length) { + messages = messages.map(function (message) { + return _.escape(message); + }); + + alert({ + content: messages.join('<br>') + }); + } + }, + + /** + * Show XHR response text + * + * @param {Object} jqXHR + */ + error: function (jqXHR) { + alert({ + content: _.escape(jqXHR.responseText) + }); + } + }); } }, buttons: [{ diff --git a/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php b/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php index 7048fa5a9e418..97db22e62b5b4 100644 --- a/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php +++ b/app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php @@ -36,6 +36,7 @@ public function isStoreManualChoiceEnabled(): bool; * * @return int * @since 100.4.0 + * @deprecated */ public function getAuthenticationDataExpirationTime(): int; } diff --git a/app/code/Magento/LoginAsCustomerApi/Api/GenerateAuthenticationSecretInterface.php b/app/code/Magento/LoginAsCustomerApi/Api/GenerateAuthenticationSecretInterface.php new file mode 100644 index 0000000000000..5c29dab95bc7e --- /dev/null +++ b/app/code/Magento/LoginAsCustomerApi/Api/GenerateAuthenticationSecretInterface.php @@ -0,0 +1,24 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\LoginAsCustomerApi\Api; + +use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface; + +/** + * Generate authentication secret + */ +interface GenerateAuthenticationSecretInterface +{ + /** + * Generate authentication secret + * + * @param AuthenticationDataInterface $authenticationData + * @return string authentication secret + */ + public function execute(AuthenticationDataInterface $authenticationData): string; +} diff --git a/app/code/Magento/LoginAsCustomerAssistance/etc/acl.xml b/app/code/Magento/LoginAsCustomerAssistance/etc/acl.xml index fd16eb2e51b03..91f66be478a94 100644 --- a/app/code/Magento/LoginAsCustomerAssistance/etc/acl.xml +++ b/app/code/Magento/LoginAsCustomerAssistance/etc/acl.xml @@ -10,8 +10,10 @@ <resources> <resource id="Magento_Backend::admin"> <resource id="Magento_Customer::customer"> - <resource id="Magento_LoginAsCustomer::login" title="Login as Customer"> - <resource id="Magento_LoginAsCustomer::allow_shopping_assistance" title="Allow remote shopping assistance" sortOrder="20" /> + <resource id="Magento_Customer::manage"> + <resource id="Magento_Customer::actions"> + <resource id="Magento_LoginAsCustomer::allow_shopping_assistance" title="Remote shopping assistance opt-in" sortOrder="40" /> + </resource> </resource> </resource> </resource> diff --git a/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema.xml b/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema.xml index deaecc2bfb777..83a21b51a78d5 100644 --- a/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema.xml +++ b/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema.xml @@ -12,7 +12,7 @@ <constraint xsi:type="foreign" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID" table="login_as_customer_assistance_allowed" column="customer_id" referenceTable="customer_entity" referenceColumn="entity_id" onDelete="CASCADE"/> - <constraint xsi:type="unique" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID"> + <constraint xsi:type="primary" referenceId="LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID"> <column name="customer_id"/> </constraint> </table> diff --git a/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema_whitelist.json b/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema_whitelist.json index 2c8aa79f3c7b1..e50bd20264db9 100644 --- a/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema_whitelist.json +++ b/app/code/Magento/LoginAsCustomerAssistance/etc/db_schema_whitelist.json @@ -4,8 +4,9 @@ "customer_id": true }, "constraint": { + "PRIMARY": true, "LOGIN_AS_CSTR_ASSISTANCE_ALLOWED_CSTR_ID_CSTR_ENTT_ENTT_ID": true, "LOGIN_AS_CUSTOMER_ASSISTANCE_ALLOWED_CUSTOMER_ID": true } } -} \ No newline at end of file +} diff --git a/app/code/Magento/LoginAsCustomerFrontendUi/Controller/Login/Index.php b/app/code/Magento/LoginAsCustomerFrontendUi/Controller/Login/Index.php index e766f0c5e8701..2f529b02637de 100644 --- a/app/code/Magento/LoginAsCustomerFrontendUi/Controller/Login/Index.php +++ b/app/code/Magento/LoginAsCustomerFrontendUi/Controller/Login/Index.php @@ -8,12 +8,13 @@ namespace Magento\LoginAsCustomerFrontendUi\Controller\Login; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Model\Session; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\RequestInterface; use Magento\Framework\Controller\Result\Redirect; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\Message\ManagerInterface; use Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface; @@ -37,11 +38,13 @@ class Index implements HttpGetActionInterface /** * @var CustomerRepositoryInterface + * @deprecated */ private $customerRepository; /** * @var GetAuthenticationDataBySecretInterface + * @deprecated */ private $getAuthenticationDataBySecret; @@ -60,6 +63,11 @@ class Index implements HttpGetActionInterface */ private $logger; + /** + * @var Session + */ + private $customerSession; + /** * @param ResultFactory $resultFactory * @param RequestInterface $request @@ -68,6 +76,7 @@ class Index implements HttpGetActionInterface * @param AuthenticateCustomerBySecretInterface $authenticateCustomerBySecret * @param ManagerInterface $messageManager * @param LoggerInterface $logger + * @param Session|null $customerSession */ public function __construct( ResultFactory $resultFactory, @@ -76,7 +85,8 @@ public function __construct( GetAuthenticationDataBySecretInterface $getAuthenticationDataBySecret, AuthenticateCustomerBySecretInterface $authenticateCustomerBySecret, ManagerInterface $messageManager, - LoggerInterface $logger + LoggerInterface $logger, + Session $customerSession = null ) { $this->resultFactory = $resultFactory; $this->request = $request; @@ -85,6 +95,7 @@ public function __construct( $this->authenticateCustomerBySecret = $authenticateCustomerBySecret; $this->messageManager = $messageManager; $this->logger = $logger; + $this->customerSession = $customerSession ?? ObjectManager::getInstance()->get(Session::class); } /** @@ -97,22 +108,10 @@ public function execute(): ResultInterface /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); + $secret = $this->request->getParam('secret'); try { - $secret = $this->request->getParam('secret'); - if (empty($secret) || !is_string($secret)) { - throw new LocalizedException(__('Cannot login to account. No secret key provided.')); - } - - $authenticationData = $this->getAuthenticationDataBySecret->execute($secret); - - try { - $customer = $this->customerRepository->getById($authenticationData->getCustomerId()); - } catch (NoSuchEntityException $e) { - throw new LocalizedException(__('Customer are no longer exist.')); - } - $this->authenticateCustomerBySecret->execute($secret); - + $customer = $this->customerSession->getCustomer(); $this->messageManager->addSuccessMessage( __('You are logged in as customer: %1', $customer->getFirstname() . ' ' . $customer->getLastname()) ); diff --git a/app/code/Magento/LoginAsCustomerLog/view/adminhtml/ui_component/login_as_customer_log_listing.xml b/app/code/Magento/LoginAsCustomerLog/view/adminhtml/ui_component/login_as_customer_log_listing.xml index fdd1bf55c91b9..29c53f37746f4 100644 --- a/app/code/Magento/LoginAsCustomerLog/view/adminhtml/ui_component/login_as_customer_log_listing.xml +++ b/app/code/Magento/LoginAsCustomerLog/view/adminhtml/ui_component/login_as_customer_log_listing.xml @@ -83,9 +83,10 @@ <label translate="true">Admin Name</label> </settings> </column> - <column name="time" sortOrder="60"> + <column name="time" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date" sortOrder="60"> <settings> - <filter>text</filter> + <filter>dateRange</filter> + <dataType>date</dataType> <label translate="true">Logged In</label> </settings> </column> diff --git a/app/code/Magento/LoginAsCustomerQuote/Plugin/LoginAsCustomerApi/ProcessShoppingCartPlugin.php b/app/code/Magento/LoginAsCustomerQuote/Plugin/LoginAsCustomerApi/ProcessShoppingCartPlugin.php index 4aa068a0ccc61..7ebfe4088ab6b 100644 --- a/app/code/Magento/LoginAsCustomerQuote/Plugin/LoginAsCustomerApi/ProcessShoppingCartPlugin.php +++ b/app/code/Magento/LoginAsCustomerQuote/Plugin/LoginAsCustomerApi/ProcessShoppingCartPlugin.php @@ -12,7 +12,6 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Quote\Api\CartRepositoryInterface; use Magento\LoginAsCustomerApi\Api\AuthenticateCustomerBySecretInterface; -use Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface; /** * Remove all items from guest shopping cart and mark cart as not-guest @@ -21,11 +20,6 @@ */ class ProcessShoppingCartPlugin { - /** - * @var GetAuthenticationDataBySecretInterface - */ - private $getAuthenticationDataBySecret; - /** * @var CustomerSession */ @@ -42,18 +36,15 @@ class ProcessShoppingCartPlugin private $quoteRepository; /** - * @param GetAuthenticationDataBySecretInterface $getAuthenticationDataBySecret * @param CustomerSession $customerSession * @param CheckoutSession $checkoutSession * @param CartRepositoryInterface $quoteRepository */ public function __construct( - GetAuthenticationDataBySecretInterface $getAuthenticationDataBySecret, CustomerSession $customerSession, CheckoutSession $checkoutSession, CartRepositoryInterface $quoteRepository ) { - $this->getAuthenticationDataBySecret = $getAuthenticationDataBySecret; $this->customerSession = $customerSession; $this->checkoutSession = $checkoutSession; $this->quoteRepository = $quoteRepository; diff --git a/app/code/Magento/Marketplace/Model/Partners.php b/app/code/Magento/Marketplace/Model/Partners.php index f105cf186fc0d..9f75f2d17c459 100644 --- a/app/code/Magento/Marketplace/Model/Partners.php +++ b/app/code/Magento/Marketplace/Model/Partners.php @@ -35,6 +35,11 @@ class Partners */ protected $cache; + /** + * @var UrlInterface + */ + private $backendUrl; + /** * @param Curl $curl * @param Cache $cache diff --git a/app/code/Magento/MediaContent/README.md b/app/code/Magento/MediaContent/README.md index b5813540acef7..579d7b95fffd3 100644 --- a/app/code/Magento/MediaContent/README.md +++ b/app/code/Magento/MediaContent/README.md @@ -4,10 +4,10 @@ The Magento_MediaContent module provides implementations for managing relations ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentApi/README.md b/app/code/Magento/MediaContentApi/README.md index 87e0d7524f59b..4571bb956e7ac 100644 --- a/app/code/Magento/MediaContentApi/README.md +++ b/app/code/Magento/MediaContentApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentApi module provides interfaces for managing relations be ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentCatalog/README.md b/app/code/Magento/MediaContentCatalog/README.md index 359126a8b7a13..0fb59f6bb9bc0 100644 --- a/app/code/Magento/MediaContentCatalog/README.md +++ b/app/code/Magento/MediaContentCatalog/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentCatalog provides the implementation of MediaContent func ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentCms/README.md b/app/code/Magento/MediaContentCms/README.md index 32b0fdc2bbd2f..2ea462cb70e3a 100644 --- a/app/code/Magento/MediaContentCms/README.md +++ b/app/code/Magento/MediaContentCms/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentCms provides the implementation of MediaContent function ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentSynchronization/README.md b/app/code/Magento/MediaContentSynchronization/README.md index 69098ab02eb0b..3fb2c28f063b8 100644 --- a/app/code/Magento/MediaContentSynchronization/README.md +++ b/app/code/Magento/MediaContentSynchronization/README.md @@ -5,10 +5,10 @@ media asset information. ## Extensibility -Extension developers can interact with the Magento_MediaContentSynchronization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContentSynchronization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContentSynchronization module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContentSynchronization module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentSynchronization/etc/queue.xml b/app/code/Magento/MediaContentSynchronization/etc/queue.xml new file mode 100644 index 0000000000000..9d1b994c602a4 --- /dev/null +++ b/app/code/Magento/MediaContentSynchronization/etc/queue.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/queue.xsd"> + <broker topic="media.content.synchronization" exchange="magento-db" type="db"> + <queue name="media.content.synchronization" consumer="media.content.synchronization" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\MediaContentSynchronization\Model\Consume::execute" /> + </broker> +</config> diff --git a/app/code/Magento/MediaContentSynchronizationApi/README.md b/app/code/Magento/MediaContentSynchronizationApi/README.md index 25ceae24452f1..b074271149e28 100644 --- a/app/code/Magento/MediaContentSynchronizationApi/README.md +++ b/app/code/Magento/MediaContentSynchronizationApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentSynchronizationApi module is responsible for the media g ## Extensibility -Extension developers can interact with the Magento_MediaContentSynchronizationApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContentSynchronizationApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContentSynchronizationApi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContentSynchronizationApi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentSynchronizationCatalog/README.md b/app/code/Magento/MediaContentSynchronizationCatalog/README.md index 8395ffc10d4d2..9f985aa0afa62 100644 --- a/app/code/Magento/MediaContentSynchronizationCatalog/README.md +++ b/app/code/Magento/MediaContentSynchronizationCatalog/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentCatalog provides the implementation of MediaContentSyncr ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaContentSynchronizationCms/README.md b/app/code/Magento/MediaContentSynchronizationCms/README.md index 58582b1b2d706..5873102dfaa7e 100644 --- a/app/code/Magento/MediaContentSynchronizationCms/README.md +++ b/app/code/Magento/MediaContentSynchronizationCms/README.md @@ -4,10 +4,10 @@ The Magento_MediaContentCms provides the implementation of MediaContentSyncroniz ## Extensibility -Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaContent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaContent module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGallery/Model/Directory/IsExcluded.php b/app/code/Magento/MediaGallery/Model/Directory/IsExcluded.php index 8fb0e03b76548..5a74ce266cba5 100644 --- a/app/code/Magento/MediaGallery/Model/Directory/IsExcluded.php +++ b/app/code/Magento/MediaGallery/Model/Directory/IsExcluded.php @@ -7,6 +7,9 @@ namespace Magento\MediaGallery\Model\Directory; +use Magento\Framework\Filesystem\File\WriteInterface; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; use Magento\MediaGalleryApi\Api\IsPathExcludedInterface; use Magento\MediaGalleryApi\Model\ExcludedPatternsConfigInterface; @@ -20,12 +23,23 @@ class IsExcluded implements IsPathExcludedInterface */ private $config; + /** + * @var Filesystem + */ + private $filesystem; + + /** @var WriteInterface */ + private $mediaDirectory; + /** * @param ExcludedPatternsConfigInterface $config + * @param Filesystem $filesystem */ - public function __construct(ExcludedPatternsConfigInterface $config) + public function __construct(ExcludedPatternsConfigInterface $config, Filesystem $filesystem) { $this->config = $config; + $this->filesystem = $filesystem; + $this->mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA); } /** @@ -36,16 +50,18 @@ public function __construct(ExcludedPatternsConfigInterface $config) */ public function execute(string $path): bool { + $realPath = $this->mediaDirectory->getDriver()->getRealPathSafety($path); foreach ($this->config->get() as $pattern) { if (empty($pattern)) { continue; } - preg_match($pattern, $path, $result); + preg_match($pattern, $realPath, $result); if ($result) { return true; } } + return false; } } diff --git a/app/code/Magento/MediaGallery/README.md b/app/code/Magento/MediaGallery/README.md index ed97b5df98fc2..c96ecf3edadb3 100644 --- a/app/code/Magento/MediaGallery/README.md +++ b/app/code/Magento/MediaGallery/README.md @@ -10,14 +10,14 @@ The Magento_MediaGallery module creates the following tables in the database: - `media_gallery_keyword` - `media_gallery_asset_keyword` -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallery module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallery module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Directory/IsExcludedTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Directory/IsExcludedTest.php deleted file mode 100644 index cc57b043954d7..0000000000000 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Directory/IsExcludedTest.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\MediaGallery\Test\Unit\Model\Directory; - -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\MediaGallery\Model\Directory\IsExcluded; -use Magento\MediaGalleryApi\Model\ExcludedPatternsConfigInterface; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; - -/** - * Test for IsExcluded - */ -class IsExcludedTest extends TestCase -{ - /** - * @var IsExcluded - */ - private $object; - - /** - * @var ExcludedPatternsConfigInterface|MockObject - */ - private $configMock; - - /** - * Initialize basic test class mocks - */ - protected function setUp(): void - { - $this->configMock = $this->getMockBuilder(ExcludedPatternsConfigInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->configMock->expects($this->at(0))->method('get')->willReturn([ - 'tmp' => '/pub\/media\/tmp/', - 'captcha' => '/pub\/media\/captcha/' - ]); - $this->object = (new ObjectManager($this))->getObject(IsExcluded::class, [ - 'config' => $this->configMock - ]); - } - - /** - * Test if the directory path is excluded - * - * @param string $path - * @param bool $isExcluded - * @dataProvider pathsProvider - */ - public function testExecute(string $path, bool $isExcluded): void - { - $this->assertEquals($isExcluded, $this->object->execute($path)); - } - - /** - * Data provider for testIsExcluded - * - * @return array - */ - public function pathsProvider() - { - return [ - ['/var/www/html/pub/media/tmp/somedir', true], - ['/var/www/html/pub/media/wysiwyg/somedir', false] - ]; - } -} diff --git a/app/code/Magento/MediaGalleryApi/README.md b/app/code/Magento/MediaGalleryApi/README.md index 978a14691597b..099f5d3313a12 100644 --- a/app/code/Magento/MediaGalleryApi/README.md +++ b/app/code/Magento/MediaGalleryApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryApi module serves as application program interface (API) ## Extensibility -Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryApi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryApi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryCatalog/README.md b/app/code/Magento/MediaGalleryCatalog/README.md index b39b1fae756d5..18407f6aa03f7 100644 --- a/app/code/Magento/MediaGalleryCatalog/README.md +++ b/app/code/Magento/MediaGalleryCatalog/README.md @@ -4,14 +4,14 @@ The Magento_MediaGalleryCatalog module is responsible for for catalog gallery pr ## Installation details -For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html). +For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). ## Extensibility -Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGallery module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallery module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallery module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryCatalogUi/README.md b/app/code/Magento/MediaGalleryCatalogUi/README.md index f47b031875f5d..e23ef6d16de90 100644 --- a/app/code/Magento/MediaGalleryCatalogUi/README.md +++ b/app/code/Magento/MediaGalleryCatalogUi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryCatalogUi module that implement category grid for media ## Extensibility -Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryCmsUi/README.md b/app/code/Magento/MediaGalleryCmsUi/README.md index a5c2eb24c6c15..f016f39bedd47 100644 --- a/app/code/Magento/MediaGalleryCmsUi/README.md +++ b/app/code/Magento/MediaGalleryCmsUi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryCmsUi module provides Magento_Cms related UI elements to ## Extensibility -Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/ReadXmp.php b/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/ReadXmp.php index 518697d421474..60d6043f44bef 100644 --- a/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/ReadXmp.php +++ b/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/ReadXmp.php @@ -70,7 +70,7 @@ public function execute(FileInterface $file): MetadataInterface private function isXmpSegment(SegmentInterface $segment): bool { return $segment->getName() === self::XMP_SEGMENT_NAME - && strpos($segment->getData(), '<x:xmpmeta') !== -1; + && strpos($segment->getData(), '<x:xmpmeta') !== false; } /** diff --git a/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/WriteXmp.php b/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/WriteXmp.php index f03482ecf6054..ee49a7b4535a7 100644 --- a/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/WriteXmp.php +++ b/app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/WriteXmp.php @@ -152,7 +152,7 @@ private function updateSegment(SegmentInterface $segment, MetadataInterface $met private function isXmpSegment(SegmentInterface $segment): bool { return $segment->getName() === self::XMP_SEGMENT_NAME - && strpos($segment->getData(), '<x:xmpmeta') !== -1; + && strpos($segment->getData(), '<x:xmpmeta') !== false; } /** diff --git a/app/code/Magento/MediaGalleryMetadata/Test/Integration/Model/Png/Segment/XmpTest.php b/app/code/Magento/MediaGalleryMetadata/Test/Integration/Model/Png/Segment/XmpTest.php new file mode 100644 index 0000000000000..e3a3ab1709daa --- /dev/null +++ b/app/code/Magento/MediaGalleryMetadata/Test/Integration/Model/Png/Segment/XmpTest.php @@ -0,0 +1,144 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\MediaGalleryMetadata\Test\Integration\Model\Png\Segment; + +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Framework\Filesystem\DriverInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; +use Magento\MediaGalleryMetadata\Model\Png\Segment\WriteXmp; +use Magento\MediaGalleryMetadata\Model\Png\Segment\ReadXmp; +use Magento\MediaGalleryMetadata\Model\Png\ReadFile; +use Magento\MediaGalleryMetadata\Model\MetadataFactory; + +/** + * Test for Xmp reader and writer + */ +class XmpTest extends TestCase +{ + /** + * @var WriteXmp + */ + private $xmpWriter; + + /** + * @var ReadXmp + */ + private $xmpReader; + + /** + * @var DriverInterface + */ + private $driver; + + /** + * @var ReadFile + */ + private $fileReader; + + /** + * @var MetadataFactory + */ + private $metadataFactory; + + /** + * @var WriteInterface + */ + private $varDirectory; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->varDirectory = Bootstrap::getObjectManager()->get(Filesystem::class) + ->getDirectoryWrite(DirectoryList::VAR_DIR); + $this->xmpWriter = Bootstrap::getObjectManager()->get(WriteXmp::class); + $this->xmpReader = Bootstrap::getObjectManager()->get(ReadXmp::class); + $this->fileReader = Bootstrap::getObjectManager()->get(ReadFile::class); + $this->driver = Bootstrap::getObjectManager()->get(DriverInterface::class); + $this->metadataFactory = Bootstrap::getObjectManager()->get(MetadataFactory::class); + } + + /** + * Test for Xmp reader and writer + * + * @dataProvider filesProvider + * @param string $fileName + * @param string $title + * @param string $description + * @param array $keywords + * @throws LocalizedException + */ + public function testWriteRead( + string $fileName, + string $title, + string $description, + array $keywords + ): void { + $path = realpath(__DIR__ . '/../../../../_files/' . $fileName); + $modifiableFilePath = $this->varDirectory->getAbsolutePath($fileName); + $this->driver->copy( + $path, + $modifiableFilePath + ); + $modifiableFilePath = $this->fileReader->execute($modifiableFilePath); + $originalMetadata = $this->xmpReader->execute($modifiableFilePath); + + $this->assertEmpty($originalMetadata->getTitle()); + $this->assertEmpty($originalMetadata->getDescription()); + $this->assertEmpty($originalMetadata->getKeywords()); + + $updatedFile = $this->xmpWriter->execute( + $modifiableFilePath, + $this->metadataFactory->create([ + 'title' => $title, + 'description' => $description, + 'keywords' => $keywords + ]) + ); + + $updatedMetadata = $this->xmpReader->execute($updatedFile); + + $this->assertEquals($title, $updatedMetadata->getTitle()); + $this->assertEquals($description, $updatedMetadata->getDescription()); + $this->assertEquals($keywords, $updatedMetadata->getKeywords()); + } + + /** + * Data provider for testExecute + * + * @return array[] + */ + public function filesProvider(): array + { + return [ + [ + 'empty_xmp_image.png', + 'Updated Title', + 'Updated Description', + [ + 'magento2', + 'mediagallery', + ] + ], + [ + 'itxt_with_empty_xmp_image.png', + 'Title 2', + 'Description 2', + [ + 'magento2', + 'mediagallery', + ] + ], + ]; + } +} diff --git a/app/code/Magento/MediaGalleryMetadata/Test/_files/itxt_with_empty_xmp_image.png b/app/code/Magento/MediaGalleryMetadata/Test/_files/itxt_with_empty_xmp_image.png new file mode 100644 index 0000000000000..62d5d4347cb38 Binary files /dev/null and b/app/code/Magento/MediaGalleryMetadata/Test/_files/itxt_with_empty_xmp_image.png differ diff --git a/app/code/Magento/MediaGalleryRenditions/README.md b/app/code/Magento/MediaGalleryRenditions/README.md index df856e8003a84..4629933b287e8 100644 --- a/app/code/Magento/MediaGalleryRenditions/README.md +++ b/app/code/Magento/MediaGalleryRenditions/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryRenditions module implements height and width fields for ## Extensibility -Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditions module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryRenditions/etc/media_content.xml b/app/code/Magento/MediaGalleryRenditions/etc/media_content.xml index a1fbe5cba558e..7596de07b8922 100644 --- a/app/code/Magento/MediaGalleryRenditions/etc/media_content.xml +++ b/app/code/Magento/MediaGalleryRenditions/etc/media_content.xml @@ -9,7 +9,7 @@ <search> <patterns> <pattern name="media_gallery_renditions">/{{media url=(?:"|&quot;)(?:.renditions)?(.*?)(?:"|&quot;)}}/</pattern> - <pattern name="media_gallery">/{{media url="?((?!.*.renditions).*?)"?}}/</pattern> + <pattern name="media_gallery">/{{media url="?(?:.*?\.renditions\/)(.*?)"?}}/</pattern> <pattern name="wysiwyg">/src=".*\/media\/(?:.renditions\/)*(.*?)"/</pattern> <pattern name="catalog_image">/^\/?media\/(?:.renditions\/)?(.*)/</pattern> <pattern name="catalog_image_with_pub">/^\/pub\/?media\/(?:.renditions\/)?(.*)/</pattern> diff --git a/app/code/Magento/MediaGalleryRenditions/etc/queue.xml b/app/code/Magento/MediaGalleryRenditions/etc/queue.xml new file mode 100644 index 0000000000000..fc86fe7ce4e53 --- /dev/null +++ b/app/code/Magento/MediaGalleryRenditions/etc/queue.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/queue.xsd"> + <broker topic="media.gallery.renditions.update" exchange="magento-db" type="db"> + <queue name="media.gallery.renditions.update" consumer="media.gallery.renditions.update" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\MediaGalleryRenditions\Model\Queue\UpdateRenditions::execute" /> + </broker> +</config> diff --git a/app/code/Magento/MediaGalleryRenditionsApi/README.md b/app/code/Magento/MediaGalleryRenditionsApi/README.md index 42478c0c9b520..3f2724521fbf3 100644 --- a/app/code/Magento/MediaGalleryRenditionsApi/README.md +++ b/app/code/Magento/MediaGalleryRenditionsApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryRenditionsApi module is responsible for the API implemen ## Extensibility -Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryRenditions module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditionsApi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryRenditionsApi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGallerySynchronization/README.md b/app/code/Magento/MediaGallerySynchronization/README.md index 4947c18986f3b..b02a0f276a16c 100644 --- a/app/code/Magento/MediaGallerySynchronization/README.md +++ b/app/code/Magento/MediaGallerySynchronization/README.md @@ -5,10 +5,10 @@ media asset information. ## Extensibility -Extension developers can interact with the Magento_MediaGallerySynchronization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGallerySynchronization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallerySynchronization module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallerySynchronization module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGallerySynchronization/etc/queue.xml b/app/code/Magento/MediaGallerySynchronization/etc/queue.xml new file mode 100644 index 0000000000000..a331673c7c1b7 --- /dev/null +++ b/app/code/Magento/MediaGallerySynchronization/etc/queue.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/queue.xsd"> + <broker topic="media.gallery.synchronization" exchange="magento-db" type="db"> + <queue name="media.gallery.synchronization" consumer="media.gallery.synchronization" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\MediaGallerySynchronization\Model\Consume::execute" /> + </broker> +</config> diff --git a/app/code/Magento/MediaGallerySynchronizationApi/README.md b/app/code/Magento/MediaGallerySynchronizationApi/README.md index 1a12883413920..5043bbf704081 100644 --- a/app/code/Magento/MediaGallerySynchronizationApi/README.md +++ b/app/code/Magento/MediaGallerySynchronizationApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGallerySynchronizationApi module is responsible for the media g ## Extensibility -Extension developers can interact with the Magento_MediaGallerySynchronizationApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGallerySynchronizationApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallerySynchronizationApi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGallerySynchronizationApi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryUi/README.md b/app/code/Magento/MediaGalleryUi/README.md index 6fbad656b23a8..36226e43ca854 100644 --- a/app/code/Magento/MediaGalleryUi/README.md +++ b/app/code/Magento/MediaGalleryUi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryUi module is responsible for the media gallery user inte ## Extensibility -Extension developers can interact with the Magento_MediaGalleryUi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryUi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryUi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryUi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml index 4aa460327578a..52ad2b0d497cb 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AdminEnhancedMediaGalleryDeletedAllImagesActionGroup.xml @@ -12,8 +12,8 @@ <amOnPage url="{{AdminStandaloneMediaGalleryPage.url}}" stepKey="openMediaGalleryPage"/> <!-- It sometimes is loading too long for default 10s --> <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <helper class="\Magento\MediaGalleryUi\Test\Mftf\Helper\MediaGalleryUiHelper" method="deleteAllImagesUsingMassAction" stepKey="deleteAllImagesUsingMassAction"> + <conditionalClick selector="{{AdminEnhancedMediaGalleryFiltersSection.clearFilters}}" dependentSelector="{{AdminEnhancedMediaGalleryFiltersSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <helper class="Magento\MediaGalleryUi\Test\Mftf\Helper\MediaGalleryUiHelper" method="deleteAllImagesUsingMassAction" stepKey="deleteAllImagesUsingMassAction"> <argument name="emptyRow">{{AdminMediaGalleryGridSection.noDataMessage}}</argument> <argument name="deleteImagesButton">{{AdminEnhancedMediaGalleryMassActionSection.deleteImages}}</argument> <argument name="checkImage">{{AdminEnhancedMediaGalleryMassActionSection.massActionCheckboxAll}}</argument> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AssertAdminEnhancedMediaGalleryUsedInSectionDisplayedActionGroup.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AssertAdminEnhancedMediaGalleryUsedInSectionDisplayedActionGroup.xml new file mode 100644 index 0000000000000..488a68530c86b --- /dev/null +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/ActionGroup/AssertAdminEnhancedMediaGalleryUsedInSectionDisplayedActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminEnhancedMediaGalleryUsedInSectionDisplayedActionGroup"> + <annotations> + <description>Assert used in section is displayed in view details.</description> + </annotations> + + <seeElement selector="{{AdminEnhancedMediaGalleryViewDetailsSection.usedIn}}" stepKey="assertUsedInPresent"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml b/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml index da9f773d0f75e..77e42b780df81 100644 --- a/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml +++ b/app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminEnhancedMediaGalleryFiltersSection.xml @@ -26,5 +26,6 @@ <element name="searchOptionsFilterDone" type="button" selector="//div[label/span[contains(text(), '{{filterName}}')]]//button[@data-action='close-advanced-select']" parameterized="true"/> <element name="duplicatedFilterCheckbox" type="button" selector="//input[@name='duplicated']"/> <element name="activeFilterValue" type="text" selector="//div[@class='media-gallery-container']//div[@class='admin__current-filters-list-wrap']//li//span[contains(text(), '{{filterPlaceholder}}')]" parameterized="true"/> + <element name="clearFilters" type="button" selector="//div[@class='media-gallery-container']//div[@class='admin__data-grid-header']//button[@data-action='grid-filter-reset']" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-description.js b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-description.js index 127f1676015f1..eec95764a7ef5 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-description.js +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-description.js @@ -12,7 +12,7 @@ define([ $.validator.addMethod( 'validate-image-description', function (value) { - return /^[a-zA-Z0-9\-\_\.\,\n\ ]+$|^$/i.test(value); + return /^[a-zA-Z0-9\-\_\.\,\n\s]+$|^$/i.test(value); }, $.mage.__('Please use only letters (a-z or A-Z), numbers (0-9), ' + 'dots (.), commas(,), underscores (_), dashes (-), and spaces on this field.')); diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-title.js b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-title.js index 1429be64b7d12..0a55a22ab1a10 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-title.js +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/validation/validate-image-title.js @@ -12,7 +12,7 @@ define([ $.validator.addMethod( 'validate-image-title', function (value) { - return /^[a-zA-Z0-9\-\_\.\,\ ]+$/i.test(value); + return /^[a-zA-Z0-9\-\_\.\,\s]+$/i.test(value); }, $.mage.__('Please use only letters (a-z or A-Z), numbers (0-9), dots (.), commas(,), ' + 'underscores (_), dashes(-) and spaces on this field.')); diff --git a/app/code/Magento/MediaGalleryUiApi/README.md b/app/code/Magento/MediaGalleryUiApi/README.md index 005a445c68b2a..1b955704cce17 100644 --- a/app/code/Magento/MediaGalleryUiApi/README.md +++ b/app/code/Magento/MediaGalleryUiApi/README.md @@ -4,10 +4,10 @@ The Magento_MediaGalleryUiApi module is responsible for the media gallery user i ## Extensibility -Extension developers can interact with the Magento_MediaGalleryUiApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html). +Extension developers can interact with the Magento_MediaGalleryUiApi module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). -[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryUiApi module. +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_MediaGalleryUiApi module. ## Additional information -For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). +For information about significant changes in patch releases, see [Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php b/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php index 05e2e836abada..e0f5509830a0c 100644 --- a/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php +++ b/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php @@ -14,6 +14,9 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated + * */ class Database extends \Magento\Framework\App\Helper\AbstractHelper { diff --git a/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php b/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php index 1a55be299a75b..81e6c5e028be1 100644 --- a/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php +++ b/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php @@ -4,7 +4,9 @@ * See COPYING.txt for license details. */ namespace Magento\MediaStorage\Model\Config\Backend\Storage\Media; - +/** +* @deprecated Database Media Storage is deprecated +**/ class Database extends \Magento\Framework\App\Config\Value { /** diff --git a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php index 83134c2ac00ef..97f161e4c49d8 100644 --- a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php +++ b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php @@ -12,6 +12,9 @@ use Magento\Framework\App\DeploymentConfig; use Magento\Framework\Config\ConfigOptionsListConstants; +/** + * @deprecated Database Media Storage is deprecated + **/ class Database implements \Magento\Framework\Option\ArrayInterface { /** diff --git a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php index fb171831407e2..c881b59c5c593 100644 --- a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php +++ b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php @@ -23,7 +23,7 @@ public function toOptionArray() 'value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_FILE_SYSTEM, 'label' => __('File System'), ], - ['value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_DATABASE, 'label' => __('Database')] + ['value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_DATABASE, 'label' => __('Database (Deprecated)')] ]; } } diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/Database.php b/app/code/Magento/MediaStorage/Model/File/Storage/Database.php index 2bdc69f45ccb8..571dad7f0ae9a 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/Database.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/Database.php @@ -10,6 +10,8 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\File\Storage\Database\AbstractDatabase { diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php b/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php index c9812b86e8b91..3528ca5743ff7 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php @@ -7,7 +7,10 @@ /** * Class AbstractDatabase - */ + * + * @deprecated Database Media Storage is deprecated + * + **/ abstract class AbstractDatabase extends \Magento\Framework\Model\AbstractModel { /** diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php b/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php index 2617e88e7538a..03d5eee617b1b 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php @@ -11,6 +11,8 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\File\Storage\Database\AbstractDatabase { diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/File.php b/app/code/Magento/MediaStorage/Model/File/Storage/File.php index ffbc2e3e90aad..c47f578be1388 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/File.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/File.php @@ -58,6 +58,11 @@ class File */ protected $_logger; + /** + * @var \Magento\MediaStorage\Model\ResourceModel\File\Storage\File + */ + private $_fileUtility; + /** * @param \Psr\Log\LoggerInterface $logger * @param \Magento\MediaStorage\Helper\File\Storage\Database $storageHelper diff --git a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php index 227b428328b79..0533c0229ea3d 100644 --- a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php +++ b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php @@ -7,6 +7,8 @@ /** * Class AbstractStorage + * + * @deprecated Database Media Storage is deprecated */ abstract class AbstractStorage extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { diff --git a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php index ae896395b8eb5..863b368883fbe 100644 --- a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php +++ b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php @@ -10,6 +10,8 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\ResourceModel\File\Storage\AbstractStorage { diff --git a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php index e5f54cac4af6a..342761646e396 100644 --- a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php +++ b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php @@ -7,6 +7,8 @@ /** * Class Database + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\ResourceModel\File\Storage\AbstractStorage { diff --git a/app/code/Magento/Msrp/Helper/Data.php b/app/code/Magento/Msrp/Helper/Data.php index 2f6dd2da9bbc4..86ff76610251d 100644 --- a/app/code/Magento/Msrp/Helper/Data.php +++ b/app/code/Magento/Msrp/Helper/Data.php @@ -51,6 +51,11 @@ class Data extends AbstractHelper */ private $msrpPriceCalculator; + /** + * @var \Magento\Msrp\Model\Msrp + */ + private $msrp; + /** * @param Context $context * @param StoreManagerInterface $storeManager diff --git a/app/code/Magento/Msrp/README.md b/app/code/Magento/Msrp/README.md new file mode 100644 index 0000000000000..025b215d285a8 --- /dev/null +++ b/app/code/Magento/Msrp/README.md @@ -0,0 +1,123 @@ +# Magento_Msrp module + +The **Magento_Msrp** module is responsible for Manufacturer’s Suggested Retail Price functionality. +A current module provides base functional for msrp pricing rendering, configuration and calculation. + +## Installation +The Magento_Msrp module creates the following attributes: + +Entity type - `catalog_product`. + +Attribute group - `Advanced Pricing`. + +- `msrp` - Manufacturer's Suggested Retail Price +- `msrp_display_actual_price_type` -Display Actual Price + +**Pay attention** if described attributes not removed when the module is removed/disabled, it would trigger errors +because they use models and blocks from Magento_Msrp module: +- `\Magento\Msrp\Block\Adminhtml\Product\Helper\Form\Type` +- `\Magento\Msrp\Model\Product\Attribute\Source\Type\Price` +- `\Magento\Msrp\Block\Adminhtml\Product\Helper\Form\Type\Price` + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Structure +`Pricing\` - directory contains interfaces and implementation for msrp pricing calculations + (`\Magento\Msrp\Pricing\MsrpPriceCalculatorInterface`), price renderers + and price models. + +`Pricing\Price\` - the directory contains declares msrp price model interfaces and implementations. + +`Pricing\Renderer\` - contains price renderers implementations. + +For information about a typical file structure of a module in Magento 2, + see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + + Developers can pass custom `msrpPriceCalculators` for `Magento\Msrp\Pricing\MsrpPriceCalculator` using type configuration using `di.xml`. + + For example: + ``` + <type name="Magento\Msrp\Pricing\MsrpPriceCalculator"> + <arguments> + <argument name="msrpPriceCalculators" xsi:type="array"> + <item name="configurable" xsi:type="array"> + <item name="productType" xsi:type="const">Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE</item> + <item name="priceCalculator" xsi:type="object">Magento\MsrpConfigurableProduct\Pricing\MsrpPriceCalculator</item> + </item> + </argument> + </arguments> + </type> +``` + More information about [type configuration](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/di-xml-file.html). + + Extension developers can interact with the Magento_Msrp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Msrp module. + +### Events + +This module observes the following event: + +`etc/frontend/` + + - `sales_quote_collect_totals_after` in the `Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver` file. + +`etc/webapi_rest` + - `sales_quote_collect_totals_after` in the `Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver` file. + +`etc/webapi_soap` + - `sales_quote_collect_totals_after` in the `Magento\Msrp\Observer\Frontend\Quote\SetCanApplyMsrpObserver` file. + +For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). + +### Layouts + +The module interacts with the following layout handles: + +`view/base/layout` directory: + +- `catalog_product_prices` +- `cms_index_index` + +`view/frontend/layout` directory: + +- `catalog_category_view` +- `catalog_product_compare_index` +- `catalog_product_view` +- `catalogsearch_advanced_result` +- `catalogsearch_result_index` +- `checkout_cart_sidebar_total_renderers` +- `checkout_onepage_failure` +- `checkout_onepage_success` +- `review_product_list` +- `wishlist_index_configure_type_downloadable` +- `wishlist_index_index` +- `wishlist_search_view` +- `wishlist_shared_index` + +This module introduces the following layouts and layout handles: + +`view/frontend/layout` directory: + +- `msrp_popup` + +### UI components + +Module provides product admin form modifier: + +`Magento\Msrp\Ui\DataProvider\Product\Form\Modifier\Msrp` - removes `msrp_display_actual_price_type` field from the form if config disabled else adds `validate-zero-or-greater` validation to the fild. + +## Additional information + +### Catalog attributes + +A current module extends `etc/catalog_attributes.xml` and provides following attributes for `quote_item` group: +- `msrp` +- `msrp_display_actual_price_type` + +### Extension Attributes +The Magento_Msrp provides extension attributes for `Magento\Catalog\Api\Data\ProductRender\PriceInfoInterface` +- attribute code: `msrp` +- attribute type: `Magento\Msrp\Api\Data\ProductRender\MsrpPriceInfoInterface` diff --git a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml index 1a27bf5aa56a2..42bf5772e96e0 100644 --- a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml +++ b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml @@ -131,10 +131,7 @@ <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton1"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!--Clear cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Go to store front and check msrp for products--> <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToConfigProductPage"/> diff --git a/app/code/Magento/MsrpConfigurableProduct/README.md b/app/code/Magento/MsrpConfigurableProduct/README.md index 8911b6e9e6667..f3f24170c9445 100644 --- a/app/code/Magento/MsrpConfigurableProduct/README.md +++ b/app/code/Magento/MsrpConfigurableProduct/README.md @@ -1,3 +1,34 @@ -# MsrpConfigurableProduct +# Magento_MsrpConfigurableProduct module -**MsrpConfigurableProduct** provides type and resolver information for the Msrp module from the ConfigurableProduct module. \ No newline at end of file +The **Magento_MsrpConfigurableProduct** module provides type and resolver information for the Magento_Msrp module from the ConfigurableProduct module. +Provides implementation of msrp price calculation for Configurable Product. + +## Installation + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html) + +## Structure + +`Pricing\` - directory contains implementation of msrp price calculation +for Grouped Product (`Magento\MsrpGroupedProduct\Pricing\MsrpPriceCalculator` class). + +For information about a typical file structure of a module in Magento 2, + see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + + Extension developers can interact with the Magento_Msrp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Msrp module. + +### Layouts + +For more information about a layout in Magento 2, see the [Layout documentation](http://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). + +### UI components + +For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html). + +## Additional information + +For information about significant changes in patch releases, see [2.4.x Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/MsrpGroupedProduct/README.md b/app/code/Magento/MsrpGroupedProduct/README.md index d597ba7fc18a7..800bf0eedd743 100644 --- a/app/code/Magento/MsrpGroupedProduct/README.md +++ b/app/code/Magento/MsrpGroupedProduct/README.md @@ -1,3 +1,39 @@ -# MsrpGroupedProduct +# Magento_MsrpGroupedProduct module -**MsrpGroupedProduct** provides type and resolver information for the Msrp module from the GroupedProduct module. \ No newline at end of file +**Magento_MsrpGroupedProduct** module provides type and resolver information for the Msrp module from the GroupedProduct module. +Provides implementation of msrp price calculation for Grouped Product. + +## Installation + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html) + +## Structure + +`Pricing\` - directory contains implementation of msrp price calculation +for Configurable Product (`Magento\MsrpConfigurableProduct\Pricing\MsrpPriceCalculator` class). + +For information about a typical file structure of a module in Magento 2, + see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + +## Extensibility + + Extension developers can interact with the Magento_Msrp module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Msrp module. + +### Layouts + +For more information about a layout in Magento 2, see the [Layout documentation](http://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html). + +### UI components + +For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html). + +## Additional information + +### collection attributes + +Module adds attribute `msrp` to select for the `Magento\Catalog\Model\ResourceModel\Product\Link\Product\Collection` +in `Magento\MsrpGroupedProduct\Plugin\Model\Product\Type\Grouped` plugin. + +For information about significant changes in patch releases, see [2.4.x Release information](https://devdocs.magento.com/guides/v2.4/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/Multishipping/Block/Checkout/Overview.php b/app/code/Magento/Multishipping/Block/Checkout/Overview.php index e4d2efd50de5a..d08f6e22b57ba 100644 --- a/app/code/Magento/Multishipping/Block/Checkout/Overview.php +++ b/app/code/Magento/Multishipping/Block/Checkout/Overview.php @@ -136,7 +136,8 @@ protected function _prepareLayout() 'after' => '-', 'form_id' => CaptchaPaymentProcessingRateLimiter::CAPTCHA_FORM, 'image_width' => 230, - 'image_height' => 230 + 'image_height' => 230, + 'frontend_validation' => false ] ); } diff --git a/app/code/Magento/Multishipping/Block/Checkout/Shipping.php b/app/code/Magento/Multishipping/Block/Checkout/Shipping.php index 99450fc538070..29ff5c87cba94 100644 --- a/app/code/Magento/Multishipping/Block/Checkout/Shipping.php +++ b/app/code/Magento/Multishipping/Block/Checkout/Shipping.php @@ -35,6 +35,11 @@ class Shipping extends \Magento\Sales\Block\Items\AbstractItems */ protected $priceCurrency; + /** + * @var \Magento\Multishipping\Model\Checkout\Type\Multishipping + */ + private $_multishipping; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\Filter\DataObject\GridFactory $filterGridFactory diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php index 98d268f6be699..70846ed3ba58e 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php @@ -4,23 +4,34 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Multishipping\Controller\Checkout\Address; -class EditAddress extends \Magento\Multishipping\Controller\Checkout\Address +use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; +use Magento\Multishipping\Controller\Checkout\Address; + +/** + * Controller for editing the specified Address. + */ +class EditAddress extends Address implements HttpGetActionInterface { /** + * Execute edit Billing Address action. + * * @return void */ public function execute() { $this->_view->loadLayout(); if ($addressForm = $this->_view->getLayout()->getBlock('customer_address_edit')) { + $id = $this->getRequest()->getParam('id'); $addressForm->setTitle( __('Edit Address') )->setSuccessUrl( - $this->_url->getUrl('*/*/selectBilling') + $this->_url->getUrl('*/*/saveBillingFromList', ['id' => $id]) )->setErrorUrl( - $this->_url->getUrl('*/*/*', ['id' => $this->getRequest()->getParam('id')]) + $this->_url->getUrl('*/*/*', ['id' => $id]) )->setBackUrl( $this->_url->getUrl('*/*/selectBilling') ); diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/SaveBillingFromList.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/SaveBillingFromList.php new file mode 100644 index 0000000000000..4162037da5d72 --- /dev/null +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/SaveBillingFromList.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Multishipping\Controller\Checkout\Address; + +use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; +use Magento\Multishipping\Controller\Checkout\Address; + +/** + * Controller for Billing Address that was successfully saved. + */ +class SaveBillingFromList extends Address implements HttpGetActionInterface +{ + /** + * Reimport saved Address to Quote if it has same ID as current Billing Address. + * + * @return void + */ + public function execute(): void + { + if ($addressId = (int)$this->getRequest()->getParam('id')) { + $checkout = $this->_getCheckout(); + if ((int)$checkout->getQuote()->getBillingAddress()->getCustomerAddressId() === $addressId) { + $checkout->setQuoteCustomerBillingAddress($addressId); + } + } + $this->_redirect('*/*/selectBilling'); + } +} diff --git a/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php b/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php index f4dfd60d81980..2232682d92f16 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php @@ -11,6 +11,7 @@ use Magento\Customer\Api\AccountManagementInterface; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Framework\App\ObjectManager; use Magento\Customer\Model\Session; use Magento\Framework\App\Action\Context; @@ -134,6 +135,9 @@ public function execute() $this->_getCheckout()->getCheckoutSession()->setDisplaySuccess(true); $this->_redirect('*/*/success'); } + } catch (PaymentProcessingRateLimitExceededException $ex) { + $this->messageManager->addErrorMessage($ex->getMessage()); + $this->_redirect('*/*/overview'); } catch (PaymentException $e) { $message = $e->getMessage(); if (!empty($message)) { diff --git a/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php b/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php index 03587f71036f2..6f560cfceeab0 100644 --- a/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php +++ b/app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php @@ -12,7 +12,6 @@ use Magento\Customer\Api\AddressRepositoryInterface; use Magento\Framework\App\RequestInterface; use Magento\Framework\Exception\LocalizedException; -use Magento\Multishipping\Model\Checkout\Type\Multishipping\State; use Magento\Multishipping\Model\DisableMultishipping; use Magento\Quote\Api\CartRepositoryInterface; use Magento\Quote\Model\Quote; @@ -73,7 +72,7 @@ public function beforeDispatch(Cart $subject, RequestInterface $request) { /** @var Quote $quote */ $quote = $this->checkoutSession->getQuote(); - if ($quote->isMultipleShippingAddresses() && $this->isCheckoutComplete()) { + if ($quote->isMultipleShippingAddresses() || $this->isDisableMultishippingRequired($request, $quote)) { $this->disableMultishipping->execute($quote); foreach ($quote->getAllShippingAddresses() as $address) { $quote->removeAddress($address->getId()); @@ -92,16 +91,6 @@ public function beforeDispatch(Cart $subject, RequestInterface $request) } } - /** - * Checks whether the checkout flow is complete - * - * @return bool - */ - private function isCheckoutComplete() : bool - { - return (bool) ($this->checkoutSession->getStepData(State::STEP_SHIPPING)['is_complete'] ?? true); - } - /** * Checks whether quote has virtual items * @@ -121,4 +110,18 @@ private function isVirtualItemInQuote(Quote $quote): bool return false; } + + /** + * Check if we have to disable multishipping mode depends on the request action name + * + * We should not disable multishipping mode if we are adding a new product item to the existing quote + * + * @param RequestInterface $request + * @param Quote $quote + * @return bool + */ + private function isDisableMultishippingRequired(RequestInterface $request, Quote $quote): bool + { + return $request->getActionName() !== "add" && $quote->getIsMultiShipping(); + } } diff --git a/app/code/Magento/Multishipping/README.md b/app/code/Magento/Multishipping/README.md index 207416a094554..12bda8ae5f21d 100644 --- a/app/code/Magento/Multishipping/README.md +++ b/app/code/Magento/Multishipping/README.md @@ -1,2 +1,139 @@ -Magento\Multishipping module provides functionality that allows customer to request shipping to more than one address -using different carriers. The module provides alternative to standard checkout flow. \ No newline at end of file +# Magento_Multishipping module + +**Magento_Multishipping** module provides functionality that allows customer to request shipping to more than one address +using different carriers. The module provides alternative to standard checkout flow. + +## Installation + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Structure + +For information about a typical file structure of a module in Magento 2, + see [Module file structure](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/module-file-structure.html#module-file-structure). + + ## Extensibility + +Developers can interact with the module and change behaviour using type configuration feature. + +Namely, we can change `paymentSpecification` for `Magento\Multishipping\Block\Checkout\Billing` and `Magento\Multishipping\Model\Checkout\Type\Multishipping` classes. +As result, we will get changed behaviour, new logic or something what our business need. + +For example: +``` +<type name="Magento\Multishipping\Model\Checkout\Type\Multishipping"> + <arguments> + <argument name="paymentSpecification" xsi:type="object">multishippingPaymentSpecification</argument> + </arguments> +</type> +``` +Yo can check this configuration and find more examples in the `etc/frontend/di.xml` file. + +More information about [type configuration](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/build/di-xml-file.html). + + +Extension developers can interact with the Magento_Multishipping module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Msrp module. + +### Events + +This module observes the following event: + +`etc/frontend/` + + - `checkout_cart_save_before` in the `Magento\Multishipping\Observer\DisableMultishippingObserver` file. + +The module dispatches the following events: + +- `multishipping_checkout_controller_success_action` event in the + class `\Magento\Multishipping\Controller\Checkout\Success::execute()` method. Parameters: + - `order_ids` is order ids created during checkout +- `checkout_controller_multishipping_shipping_post` event in the + class `\Magento\Multishipping\Controller\Checkout\ShippingPost::execute()` method. Parameters: + - `request` is a request object `Magento\Framework\App\RequestInterface`. + - `quote` is a quote object for current checkout `Magento\Quote\Model\Quote`. +- `checkout_type_multishipping_set_shipping_items` event in the + class `\Magento\Multishipping\Model\Checkout\Type\Multishipping::setShippingItemsInformation()` method. Parameters: + - `quote` is a quote object for current checkout `Magento\Quote\Model\Quote`. +- `checkout_type_multishipping_create_orders_single` event in the + class `\Magento\Multishipping\Model\Checkout\Type\Multishipping::createOrders()` method. Parameters: + - `order` is a prepared order object for creating `\Magento\Sales\Model\Order`. + - `address` is an address array. + - `quote` is a quote object for current checkout `Magento\Quote\Model\Quote`. +- `checkout_submit_all_after` event in the + class `\Magento\Multishipping\Model\Checkout\Type\Multishipping::createOrders()` method. Parameters: + - `orders` is order object array `\Magento\Sales\Model\Order` that was created. + - `quote` is a quote object for current checkout `Magento\Quote\Model\Quote`. +- `checkout_multishipping_refund_all` event in the + class `\Magento\Multishipping\Model\Checkout\Type\Multishipping::createOrders()` method. Parameters: + - `orders` is order object array `\Magento\Sales\Model\Order` that was created. + +For information about an event in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events). + +### Layouts + +The module interacts with the following layout handles: + +`view/frontend/layout` directory: + + - `checkout_cart_index` + +This module introduces the following layouts and layout handles: + +`view/frontend/layout` directory: + + - `multishipping_checkout` + - `multishipping_checkout_address_editaddress` + - `multishipping_checkout_address_editbilling` + - `multishipping_checkout_address_editshipping` + - `multishipping_checkout_address_newbilling` + - `multishipping_checkout_address_newshipping` + - `multishipping_checkout_address_select` + - `multishipping_checkout_address_selectbilling` + - `multishipping_checkout_addresses` + - `multishipping_checkout_billing` + - `multishipping_checkout_customer_address` + - `multishipping_checkout_login` + - `multishipping_checkout_overview` + - `multishipping_checkout_register` + - `multishipping_checkout_results` + - `multishipping_checkout_shipping` + - `multishipping_checkout_success` + +## Additional information + +### ACL + +Module introduces the following resources: + +- `Magento_Multishipping::config_multishipping` - Multishipping Settings Section + +More information about [Access Control List rule](https://devdocs.magento.com/guides/v2.4/ext-best-practices/tutorials/create-access-control-list-rule.html). + +### Page Types + +Module introduces the new pages: + +`etc/frontend/page_types.xml` file. + +- `checkout_cart_multishipping` - Catalog Quick Search Form Suggestion +- `checkout_cart_multishipping_address_editaddress` - Multishipping Checkout One Address Edit Form +- `checkout_cart_multishipping_address_editbilling` - Multishipping Checkout Billing Address Edit Form +- `checkout_cart_multishipping_address_editshipping` - Multishipping Checkout Shipping Address Edit Form +- `checkout_cart_multishipping_address_newbilling` - Multishipping Checkout Billing Address Creation +- `checkout_cart_multishipping_address_newshipping` - Multishipping Checkout Shipping Address Creation +- `checkout_cart_multishipping_address_selectbilling` - Multishipping Checkout Billing Address Selection +- `checkout_cart_multishipping_addresses` - Multishipping Checkout Address (Any) Form +- `checkout_cart_multishipping_billing` - Multishipping Checkout Billing Information Step +- `checkout_cart_multishipping_customer_address` - Multishipping Checkout Customer Address Edit Form +- `checkout_cart_multishipping_login` - Multishipping Checkout Login User Form +- `checkout_cart_multishipping_overview` - Multishipping Checkout Overview +- `checkout_cart_multishipping_register` - Multishipping Checkout Register User Form +- `checkout_cart_multishipping_shipping` - Multishipping Checkout Shipping Information Step +- `checkout_cart_multishipping_success` - Multishipping Checkout Success + +More information about [layout types](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-types.html). + + +For information about significant changes in patch releases, see [2.3.x Release information](http://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultishippingAddressAndItemActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultishippingAddressAndItemActionGroup.xml new file mode 100644 index 0000000000000..4d59fef610180 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultishippingAddressAndItemActionGroup.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontMultishippingAddressAndItemActionGroup"> + <annotations> + <description>Verify item information on Ship to Multiple Addresses page.</description> + </annotations> + <arguments> + <argument name="sequenceNumber" type="string" defaultValue="1"/> + <argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/> + <argument name="quantity" type="string" defaultValue="1"/> + <argument name="firstName" type="string" defaultValue="{{US_Address_CA.firstname}}"/> + <argument name="lastName" type="string" defaultValue="{{US_Address_CA.lastname}}"/> + <argument name="city" type="string" defaultValue="{{US_Address_CA.city}}"/> + <argument name="state" type="string" defaultValue="{{US_Address_CA.state}}"/> + <argument name="postCode" type="string" defaultValue="{{US_Address_CA.postcode}}"/> + <argument name="country" type="string" defaultValue="{{US_Address_CA.country}}"/> + <argument name="addressStreetLine1" type="string" defaultValue="{{US_Address_CA.street[0]}}"/> + <argument name="addressStreetLine2" type="string" defaultValue="{{US_Address_CA.street[1]}}"/> + </arguments> + + <seeElement selector="{{MultishippingSection.productLink(productName, sequenceNumber)}}" stepKey="verifyProductName"/> + <seeInField selector="{{MultishippingSection.productQty(sequenceNumber)}}" userInput="{{quantity}}" stepKey="verifyQuantity"/> + <seeInField selector="{{MultishippingSection.shippingAddressSelector(sequenceNumber)}}" userInput="{{firstName}} {{lastName}}, {{addressStreetLine1}} {{addressStreetLine2}}, {{city}}, {{state}} {{postCode}}, {{country}}" stepKey="verifyAddress"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontAssertBillingAddressInBillingInfoStepActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontAssertBillingAddressInBillingInfoStepActionGroup.xml new file mode 100644 index 0000000000000..4f6f180d69d90 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontAssertBillingAddressInBillingInfoStepActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertBillingAddressInBillingInfoStepActionGroup"> + <annotations> + <description>Assert that Billing Address block contains provided Address data.</description> + </annotations> + <arguments> + <argument name="address" type="entity" defaultValue="US_Address_CA"/> + </arguments> + + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.firstname}}" stepKey="seeFirstname"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.lastname}}" stepKey="seeLastname"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.company}}" stepKey="seeCompany"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.street[0]}}" stepKey="seeStreet"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.city}}" stepKey="seeCity"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.state}}" stepKey="seeState"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.postcode}}" stepKey="seePostcode"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.country}}" stepKey="seeCountry"/> + <see selector="{{PaymentMethodSection.billingAddressBlock}}" userInput="{{address.telephone}}" stepKey="seeTelephone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontChangeMultishippingItemQtyActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontChangeMultishippingItemQtyActionGroup.xml new file mode 100644 index 0000000000000..eb9acd80a21ed --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontChangeMultishippingItemQtyActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontChangeMultishippingItemQtyActionGroup"> + <annotations> + <description>Change multishipping item quantity on Ship to Multiple Addresses page.</description> + </annotations> + <arguments> + <argument name="sequenceNumber" type="string" defaultValue="1"/> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + + <fillField selector="{{MultishippingSection.productQty(sequenceNumber)}}" userInput="{{quantity}}" stepKey="setQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInfoStepFromAddressListActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInfoStepFromAddressListActionGroup.xml new file mode 100644 index 0000000000000..164ba7506bc47 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInfoStepFromAddressListActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontGoToBillingInfoStepFromAddressListActionGroup"> + <annotations> + <description>Navigates to Billing Information step from Billing Address list.</description> + </annotations> + + <click selector="{{StorefrontBillingAddressesSection.backToBillingInformation}}" stepKey="navigateToBillingInformation"/> + <waitForElementVisible selector="{{PaymentMethodSection.goToReviewOrder}}" stepKey="waitForGoToReviewButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontOpenOrderByPositionAfterMultishippingCheckoutActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontOpenOrderByPositionAfterMultishippingCheckoutActionGroup.xml new file mode 100644 index 0000000000000..29a82630b5197 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontOpenOrderByPositionAfterMultishippingCheckoutActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontOpenOrderByPositionAfterMultishippingCheckoutActionGroup"> + <annotations> + <description>Clicks on 'order view' link by provided position from Multishipping Checkout success page.</description> + </annotations> + <arguments> + <argument name="position" type="string" defaultValue="{{CONST.one}}"/> + </arguments> + + <click selector="{{StorefrontMultipleShippingMethodSection.orderByPosition(position)}}" stepKey="openOrderDetailsPage"/> + <waitForElementVisible selector="{{StorefrontCustomerOrderViewSection.orderTitle}}" stepKey="waitForOrderPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontStartEditBillingAddressFromListActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontStartEditBillingAddressFromListActionGroup.xml new file mode 100644 index 0000000000000..80f351d781b6c --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontStartEditBillingAddressFromListActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontStartEditBillingAddressFromListActionGroup"> + <annotations> + <description>Navigates to Billing Address list. Starts editing specified Billing Address.</description> + </annotations> + <arguments> + <argument name="position" type="string" defaultValue="{{CONST.one}}"/> + </arguments> + + <click selector="{{PaymentMethodSection.changeBillingAddress}}" stepKey="goToBillingAddressesList"/> + <click selector="{{StorefrontBillingAddressesSection.editAddressByPosition(position)}}" stepKey="editBillingAddressByPosition"/> + <waitForElementVisible selector="{{StorefrontCustomerAddressFormSection.formTitle}}" stepKey="waitForAddressEditPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutSelectBillingPage.xml b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutSelectBillingPage.xml new file mode 100644 index 0000000000000..8523a3e495ab9 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Page/MultishippingCheckoutSelectBillingPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="MultishippingCheckoutSelectBillingPage" url="/multishipping/checkout_address/selectBilling" module="Magento_Multishipping" area="storefront"> + <section name="StorefrontBillingAddressesSection"/> + </page> +</pages> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/MultishippingSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/MultishippingSection.xml index 1b2f0c31b2cf3..304f0a9c7a12a 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/MultishippingSection.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/MultishippingSection.xml @@ -14,6 +14,8 @@ <element name="shippingAddressSelector" type="select" selector="//tr[position()={{addressPosition}}]//td[@data-th='Send To']//select" parameterized="true"/> <element name="shippingAddressOptions" type="select" selector="#multiship-addresses-table tbody tr:nth-of-type({{addressPosition}}) .col.address select option:nth-of-type({{optionIndex}})" parameterized="true"/> <element name="selectShippingAddress" type="select" selector="(//table[@id='multiship-addresses-table'] //div[@class='field address'] //select)[{{sequenceNumber}}]" parameterized="true"/> + <element name="productQty" type="input" selector="#multiship-addresses-table tbody tr:nth-of-type({{sequenceNumber}}) .col.qty input" parameterized="true"/> + <element name="productLink" type="button" selector="(//form[@id='checkout_multishipping_form']//a[contains(text(),'{{productName}}')])[{{sequenceNumber}}]" parameterized="true"/> <element name="removeItemButton" type="button" selector="//a[contains(@title, 'Remove Item')][{{var}}]" parameterized="true"/> <element name="back" type="button" selector=".action.back"/> </section> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/StorefrontMultipleShippingMethodSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/StorefrontMultipleShippingMethodSection.xml index 52899327c4df3..fbf477eae9162 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/StorefrontMultipleShippingMethodSection.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/StorefrontMultipleShippingMethodSection.xml @@ -9,6 +9,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontMultipleShippingMethodSection"> <element name="orderId" type="text" selector=".shipping-list:nth-child({{rowNum}}) .order-id" parameterized="true"/> + <element name="orderByPosition" type="button" selector=".shipping-list:nth-child({{position}}) > .order-id > a" timeout="30" parameterized="true"/> <element name="goToReviewYourOrderButton" type="button" selector="#payment-continue"/> <element name="continueToBillingInformationButton" type="button" selector=".action.primary.continue"/> <element name="successMessage" type="text" selector=".multicheckout.success"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/PaymentMethodSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/PaymentMethodSection.xml index fe69cba0059fd..6bdca5de480c3 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Section/PaymentMethodSection.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/PaymentMethodSection.xml @@ -9,6 +9,8 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="PaymentMethodSection"> - <element name="goToReviewOrder" type="button" selector="#payment-continue"/> + <element name="goToReviewOrder" type="button" selector="#payment-continue" timeout="30"/> + <element name="changeBillingAddress" type="button" selector="//div[@class='box box-billing-address']//a[normalize-space() = 'Change']" timeout="30"/> + <element name="billingAddressBlock" type="block" selector=".box-billing-address > .box-content > address" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontBillingAddressesSection.xml b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontBillingAddressesSection.xml new file mode 100644 index 0000000000000..ecb0077dbb530 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Section/StorefrontBillingAddressesSection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontBillingAddressesSection"> + <element name="editAddressByPosition" type="button" selector="div.box-billing-address:nth-of-type({{position}}) .action.edit" parameterized="true" timeout="30"/> + <element name="backToBillingInformation" type="button" selector=".actions-toolbar .action.back" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml index f1c3898cb5af7..618c32b21ad03 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckVatIdAtAccountCreateWithMultishipmentTest.xml @@ -27,14 +27,12 @@ </before> <after> <magentoCLI command="config:set customer/create_account/vat_frontend_visibility 0" stepKey="showVatNumberOnStorefrontNo"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfter"> - <argument name="tags" value="config"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfter"/> <deleteData createDataKey="category" stepKey="deleteCategory"/> <deleteData createDataKey="product" stepKey="deleteproduct"/> </after> <!-- Add product to the cart --> - <amOnPage url="$$product.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$product.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$product.name$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml index 5e1c14c57f533..76bd63d69df0a 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml @@ -37,11 +37,11 @@ </actionGroup> </before> - <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> + <amOnPage url="$$product1.custom_attributes[url_key]$$.html" stepKey="goToProduct1"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> - <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> + <amOnPage url="$$product2.custom_attributes[url_key]$$.html" stepKey="goToProduct2"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml index dcdc9203a2075..084e0ffc9f3ac 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml @@ -37,11 +37,11 @@ </actionGroup> </before> - <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> + <amOnPage url="$$product1.custom_attributes[url_key]$$.html" stepKey="goToProduct1"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> - <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> + <amOnPage url="$$product2.custom_attributes[url_key]$$.html" stepKey="goToProduct2"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontGuestCheckingWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontGuestCheckingWithMultishipmentTest.xml new file mode 100644 index 0000000000000..82563e5055c2a --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontGuestCheckingWithMultishipmentTest.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StoreFrontGuestCheckingWithMultishipmentTest"> + <annotations> + <features value="Multishipping"/> + <stories value="Multiple Shipping"/> + <title value="Guest can register through multi shipment checkout"/> + <description value="Check that guest can register through multi shipment checkout"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-41679"/> + <useCaseId value="MC-41668"/> + <group value="multishipping"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="product1"/> + <createData entity="SimpleProduct2" stepKey="product2"/> + <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRateShipping"/> + <actionGroup ref="CliEnableCheckMoneyOrderPaymentMethodActionGroup" stepKey="enableCheckMoneyOrderPaymentMethod"/> + </before> + <after> + <deleteData createDataKey="product1" stepKey="deleteProduct1"/> + <deleteData createDataKey="product2" stepKey="deleteProduct2"/> + <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/> + </after> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToProduct1Page"> + <argument name="productUrl" value="$product1.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> + <argument name="productName" value="$product1.name$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToProduct2Page"> + <argument name="productUrl" value="$product2.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> + <argument name="productName" value="$product2.name$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> + <click selector="{{MultishippingSection.checkoutWithMultipleAddresses}}" stepKey="proceedMultishipping"/> + <click selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="clickCreateAccount"/> + <seeElement selector="{{CheckoutShippingSection.region}}" stepKey="seeRegionSelector"/> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml index 043d0fc41abe7..f05c6e355bb1d 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml @@ -47,11 +47,11 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/> </after> - <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> + <amOnPage url="$$product1.custom_attributes[url_key]$$.html" stepKey="goToProduct1"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> - <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> + <amOnPage url="$$product2.custom_attributes[url_key]$$.html" stepKey="goToProduct2"/> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutSubtotalAfterQuantityUpdateTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutSubtotalAfterQuantityUpdateTest.xml index 31ea8c500e867..8c0df3c70677d 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutSubtotalAfterQuantityUpdateTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutSubtotalAfterQuantityUpdateTest.xml @@ -51,7 +51,7 @@ <!-- Go back to the cart --> <click selector="{{MultishippingSection.back}}" stepKey="backToCart"/> <!-- Update products quantity --> - <fillField selector="{{CheckoutCartProductSection.qty($createdSimpleProduct.name$)}}" userInput="2" stepKey="updateProductQty"/> + <fillField selector="{{CheckoutCartProductSection.qty($createdSimpleProduct.sku$)}}" userInput="2" stepKey="updateProductQty"/> <click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickUpdateShoppingCart"/> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <!-- Check subtotals --> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontDisableMultishippingModeAfterRemoveItemOnBackToCartTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontDisableMultishippingModeAfterRemoveItemOnBackToCartTest.xml new file mode 100644 index 0000000000000..93bce523832ae --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontDisableMultishippingModeAfterRemoveItemOnBackToCartTest.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontDisableMultishippingModeAfterRemoveItemOnBackToCartTest"> + <annotations> + <features value="Multishipping"/> + <stories value="Multishipping"/> + <title value="Disable multishipping checkout on backing to cart after remove item"/> + <description value="The cart page should display the proper subtotal after backing back to the cart from the multishipping checkout."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-41594"/> + <useCaseId value="MC-41464"/> + <group value="multishipping"/> + </annotations> + <before> + <createData entity="ApiCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomerWithMultipleAddresses"/> + </before> + <after> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createCustomerWithMultipleAddresses" stepKey="deleteCustomer"/> + </after> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$createCustomerWithMultipleAddresses$"/> + </actionGroup> + + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openSimpleProductPage"> + <argument name="product" value="$createSimpleProduct$"/> + </actionGroup> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.price}}" stepKey="grabPrice"/> + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addSimpleProductToCart"> + <argument name="product" value="$createSimpleProduct$"/> + <argument name="productCount" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addSimpleProductToCartAgain"> + <argument name="product" value="$createSimpleProduct$"/> + <argument name="productCount" value="2"/> + </actionGroup> + + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="StorefrontGoCheckoutWithMultipleAddressesActionGroup" stepKey="goCheckoutWithMultipleAddresses"/> + <actionGroup ref="StorefrontRemoveProductOnCheckoutActionGroup" stepKey="removeFirstProductItemFromMultishipping"/> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goBackToShoppingCartPage"/> + <grabTextFrom selector="{{CheckoutCartProductSection.productSubtotalByName($createSimpleProduct.name$)}}" stepKey="grabSubtotal"/> + <assertEquals stepKey="assertSubtotal" message="pass"> + <expectedResult type="variable">grabPrice</expectedResult> + <actualResult type="variable">grabSubtotal</actualResult> + </assertEquals> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontEditBillingAddressAtMultishippingCheckoutTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontEditBillingAddressAtMultishippingCheckoutTest.xml new file mode 100644 index 0000000000000..4ec9792107dc8 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontEditBillingAddressAtMultishippingCheckoutTest.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontEditBillingAddressAtMultishippingCheckoutTest"> + <annotations> + <features value="Multishipping"/> + <stories value="Multiple Shipping"/> + <title value="Change Billing Address during Multiple Shipping checkout"/> + <description value="Verify that Billing Address is changed on Billing Information page after editing it"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-40509"/> + <useCaseId value="MC-35289"/> + <group value="catalog"/> + <group value="sales"/> + <group value="multishipping"/> + </annotations> + + <before> + <!-- Create Product and Customer --> + <createData entity="simpleProductWithoutCategory" stepKey="createProduct"/> + <createData entity="Simple_US_Customer_Two_Addresses" stepKey="createCustomer"/> + + <!-- Login to Storefront as created Customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$createCustomer$"/> + </actionGroup> + </before> + + <after> + <!-- Logout from Customer account --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> + + <!-- Delete Product and Customer --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + </after> + + <!-- Add Product to Cart and go to Billing Information step --> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$createProduct$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/> + <actionGroup ref="CheckingWithSingleAddressActionGroup" stepKey="checkoutWithMultishipping"/> + <actionGroup ref="StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup" stepKey="goToBillingInformation"/> + + <!-- Select Check / Money order Payment method --> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> + + <!-- Change the first Address --> + <actionGroup ref="StorefrontStartEditBillingAddressFromListActionGroup" stepKey="openFirstAddressEditPage"/> + <actionGroup ref="FillNewCustomerAddressRequiredFieldsActionGroup" stepKey="editAddressFields"> + <argument name="address" value="US_Address_CA"/> + </actionGroup> + <actionGroup ref="StorefrontSaveCustomerAddressActionGroup" stepKey="saveAddress"/> + + <!-- Go back to Billing Information step and verify Billing Address --> + <actionGroup ref="StorefrontGoToBillingInfoStepFromAddressListActionGroup" stepKey="navigateToBillingInfoStep"/> + <actionGroup ref="StorefrontAssertBillingAddressInBillingInfoStepActionGroup" stepKey="verifyBillingAddress"/> + + <!-- Go to Review Order step and Place Order --> + <actionGroup ref="SelectBillingInfoActionGroup" stepKey="navigateToReviewOrderPage"/> + <actionGroup ref="PlaceOrderActionGroup" stepKey="placeOrder"/> + + <!-- Open Order Details page and verify Billing Address --> + <actionGroup ref="StorefrontOpenOrderByPositionAfterMultishippingCheckoutActionGroup" stepKey="openOrderDetailsPage"/> + <click selector="{{StorefrontGuestOrderViewSection.printOrder}}" stepKey="clickPrintOrderButton"/> + <actionGroup ref="AssertSalesPrintOrderBillingAddress" stepKey="verifyPrintOrderBillingAddress"> + <argument name="address" value="US_Address_CA"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontMultishippingUpdateProductQtyTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontMultishippingUpdateProductQtyTest.xml new file mode 100644 index 0000000000000..79d2a6942e6de --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontMultishippingUpdateProductQtyTest.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontMultishippingUpdateProductQtyTest"> + <annotations> + <features value="Multishipping"/> + <stories value="Checkout with multiple addresses."/> + <title value="Update Product Quantity on Ship to Multiple Addresses Page."/> + <description value="Verify customer will see correct product quantity after return to Ship to Multiple Addresses from Shipping information page."/> + <severity value="MAJOR"/> + <testCaseId value="MC-41697"/> + <useCaseId value="MC-40021"/> + <group value="multishipping"/> + </annotations> + + <before> + <createData entity="SimpleProduct2" stepKey="product"/> + <createData entity="Simple_US_CA_Customer" stepKey="customer"/> + </before> + <after> + <deleteData createDataKey="product" stepKey="deleteProduct"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$customer$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="navigateToSimpleProductDetailsPage"> + <argument name="product" value="$product$"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addSimpleProductToCart"> + <argument name="productQty" value="2"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> + <actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/> + <actionGroup ref="StorefrontChangeMultishippingItemQtyActionGroup" stepKey="setProductQuantity"> + <argument name="quantity" value="2"/> + </actionGroup> + <actionGroup ref="StorefrontNavigateToShippingInformationPageActionGroup" stepKey="navigateToShippingInformation"/> + <moveBack stepKey="moveBackToShippingInformation"/> + <actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="verifyLine1Qty"> + <argument name="productName" value="$product.name$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="verifyLine2Qty"> + <argument name="sequenceNumber" value="2"/> + <argument name="productName" value="$product.name$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="verifyLine3Qty"> + <argument name="sequenceNumber" value="3"/> + <argument name="productName" value="$product.name$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml index 46f1daad053d5..4377b8cfd8c18 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml @@ -45,13 +45,13 @@ <argument name="Customer" value="$$createCustomerWithMultipleAddresses$$"/> </actionGroup> <!-- Add two products to the Shopping Cart --> - <amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.name$$)}}" stepKey="amOnStorefrontProductFirstPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.custom_attributes[url_key]$$)}}" stepKey="amOnStorefrontProductFirstPage"/> <waitForPageLoad stepKey="waitForTheFirstProduct"/> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddProductToCart"> <argument name="product" value="$$createFirstProduct$$"/> <argument name="productCount" value="1"/> </actionGroup> - <amOnPage url="{{StorefrontProductPage.url($$createSecondProduct.name$$)}}" stepKey="amOnStorefrontSecondProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSecondProduct.custom_attributes[url_key]$$)}}" stepKey="amOnStorefrontSecondProductPage"/> <waitForPageLoad stepKey="waitForPageLoadForTheSecondProduct"/> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSecondProductToCart"> <argument name="product" value="$$createSecondProduct$$"/> @@ -85,6 +85,12 @@ </actionGroup> <switchToNextTab stepKey="switchToNextTab"/> <!-- Click 'Continue to Billing Information' and 'Go to Review Your Order' --> + <actionGroup ref="StorefrontGoToBillingInformationActionGroup" stepKey="redirectToSelectAddressAfterReset"/> + <seeOptionIsSelected selector="{{StorefrontCheckoutShippingMultipleAddressesSection.selectedMultipleShippingAddress('1')}}" userInput="{{US_Address_NY.street[1]}}" stepKey="checkAddressIsReset"/> + <actionGroup ref="StorefrontCheckoutShippingSelectMultipleAddressesActionGroup" stepKey="selectMultipleAddressesAfterReset"> + <argument name="firstAddress" value="{{UK_Not_Default_Address.street[0]}}"/> + <argument name="secondAddress" value="{{US_Address_NY.street[1]}}"/> + </actionGroup> <actionGroup ref="StorefrontGoToBillingInformationActionGroup" stepKey="goToBillingInformation"/> <see selector="{{ShipmentFormSection.shippingAddress}}" userInput="{{US_Address_NY.city}}" stepKey="seeBillingAddress"/> <waitForElementVisible selector="{{StorefrontMultipleShippingMethodSection.goToReviewYourOrderButton}}" stepKey="waitForGoToReviewYourOrderVisible" /> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontVerifySecureURLRedirectMultishippingTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontVerifySecureURLRedirectMultishippingTest.xml index 515c9b2102f5e..30e5d360f430f 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontVerifySecureURLRedirectMultishippingTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontVerifySecureURLRedirectMultishippingTest.xml @@ -30,7 +30,7 @@ <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefront"> <argument name="Customer" value="$$customer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$category.name$$)}}" stepKey="goToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$category.custom_attributes[url_key]$$)}}" stepKey="goToCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="moveMouseOverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="clickAddToCartButton"/> @@ -40,15 +40,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> <deleteData createDataKey="product" stepKey="deleteProduct"/> <deleteData createDataKey="category" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/EditAddressTest.php b/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/EditAddressTest.php index 09e1e87a028e4..7cba365e72801 100644 --- a/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/EditAddressTest.php +++ b/app/code/Magento/Multishipping/Test/Unit/Controller/Checkout/Address/EditAddressTest.php @@ -141,8 +141,9 @@ public function testExecute() ->getMock(); $helperMock->expects($this->any())->method('__')->willReturn('Edit Address'); $valueMap = [ - ['*/*/selectBilling', null, 'success/url'], + ['*/*/saveBillingFromList', ['id' => 1], 'success/url'], ['*/*/*', ['id' => 1], 'error/url'], + ['*/*/selectBilling', null, 'back/url'], ]; $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); @@ -151,7 +152,7 @@ public function testExecute() $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); - $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('success/url'); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('back/url'); $this->viewMock->expects($this->once())->method('renderLayout'); $this->controller->execute(); } diff --git a/app/code/Magento/Multishipping/view/frontend/requirejs-config.js b/app/code/Magento/Multishipping/view/frontend/requirejs-config.js index 0235d8b848154..e47915d6e508a 100644 --- a/app/code/Magento/Multishipping/view/frontend/requirejs-config.js +++ b/app/code/Magento/Multishipping/view/frontend/requirejs-config.js @@ -10,7 +10,8 @@ var config = { orderOverview: 'Magento_Multishipping/js/overview', payment: 'Magento_Multishipping/js/payment', billingLoader: 'Magento_Checkout/js/checkout-loader', - cartUpdate: 'Magento_Checkout/js/action/update-shopping-cart' + cartUpdate: 'Magento_Checkout/js/action/update-shopping-cart', + multiShippingBalance: 'Magento_Multishipping/js/multi-shipping-balance' } } }; diff --git a/app/code/Magento/Multishipping/view/frontend/templates/checkout/addresses.phtml b/app/code/Magento/Multishipping/view/frontend/templates/checkout/addresses.phtml index a37ff04a8dc2a..81a960b8a823c 100644 --- a/app/code/Magento/Multishipping/view/frontend/templates/checkout/addresses.phtml +++ b/app/code/Magento/Multishipping/view/frontend/templates/checkout/addresses.phtml @@ -64,7 +64,9 @@ size="2" min="0" class="input-text qty" - data-validate="{number: true, required:true, 'validate-greater-than-zero':true}"/> + data-validate="{number: true, required:true, 'validate-greater-than-zero':true}" + autocomplete="off" + /> </div> </div> </td> diff --git a/app/code/Magento/Multishipping/view/frontend/templates/checkout/billing.phtml b/app/code/Magento/Multishipping/view/frontend/templates/checkout/billing.phtml index c9ee0a8b12ce3..2fbdac12991fa 100644 --- a/app/code/Magento/Multishipping/view/frontend/templates/checkout/billing.phtml +++ b/app/code/Magento/Multishipping/view/frontend/templates/checkout/billing.phtml @@ -8,13 +8,14 @@ * Multishipping checkout billing information * * @var $block \Magento\Multishipping\Block\Checkout\Billing + * @var $escaper \Magento\Framework\Escaper * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> <div id="checkout-loader" data-role="checkout-loader" class="loading-mask" data-mage-init='{"billingLoader": {}}'> <div class="loader"> - <img src="<?= $block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')); ?>" - alt="<?= $block->escapeHtml(__('Loading...')); ?>"> + <img src="<?= $escaper->escapeUrl($block->getViewFileUrl('images/loader-1.gif')); ?>" + alt="<?= $escaper->escapeHtml(__('Loading...')); ?>"> </div> </div> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag('position: absolute;', 'div#checkout-loader .loader img') ?> @@ -43,7 +44,7 @@ script; } </script> </div> -<form action="<?= $block->escapeUrl($block->getPostActionUrl()); ?>" +<form action="<?= $escaper->escapeUrl($block->getPostActionUrl()); ?>" method="post" id="multishipping-billing-form" class="form multicheckout billing"> @@ -51,9 +52,9 @@ script; <div class="block-content"> <div class="box box-billing-address"> <strong class="box-title"> - <span><?= $block->escapeHtml(__('Billing Address')); ?></span> - <a href="<?= $block->escapeUrl($block->getSelectAddressUrl()); ?>" class="action"> - <span><?= $block->escapeHtml(__('Change')); ?></span> + <span><?= $escaper->escapeHtml(__('Billing Address')); ?></span> + <a href="<?= $escaper->escapeUrl($block->getSelectAddressUrl()); ?>" class="action"> + <span><?= $escaper->escapeHtml(__('Change')); ?></span> </a> </strong> <div class="box-content"> @@ -65,7 +66,7 @@ script; <div class="box box-billing-method"> <fieldset class="fieldset"> <legend class="legend box-title"> - <span><?= $block->escapeHtml(__('Payment Method')); ?></span> + <span><?= $escaper->escapeHtml(__('Payment Method')); ?></span> </legend><br> <div class="box-content"> <?= $block->getChildHtml('payment_methods_before') ?> @@ -84,14 +85,14 @@ script; $block->setMethodFormTemplate($code, $methodsForms[$code]); } ?> - <div data-bind="scope: 'payment_method_<?= $block->escapeHtml($code);?>'"> + <div data-bind="scope: 'payment_method_<?= $escaper->escapeHtml($code);?>'"> <dt class="item-title"> <?php if ($methodsCount > 1): ?> <input type="radio" - id="p_method_<?= $block->escapeHtml($code); ?>" - value="<?= $block->escapeHtml($code); ?>" + id="p_method_<?= $escaper->escapeHtml($code); ?>" + value="<?= $escaper->escapeHtml($code); ?>" name="payment[method]" - title="<?= $block->escapeHtml($_method->getTitle()) ?>" + title="<?= $escaper->escapeHtml($_method->getTitle()) ?>" data-bind=" value: getCode(), checked: isChecked, @@ -103,8 +104,8 @@ script; class="radio"/> <?php else: ?> <input type="radio" - id="p_method_<?= $block->escapeHtml($code); ?>" - value="<?= $block->escapeHtml($code); ?>" + id="p_method_<?= $escaper->escapeHtml($code); ?>" + value="<?= $escaper->escapeHtml($code); ?>" name="payment[method]" data-bind=" value: getCode(), @@ -112,8 +113,8 @@ script; checked="checked" class="radio solo method" /> <?php endif; ?> - <label for="p_method_<?= $block->escapeHtml($code); ?>"> - <?= $block->escapeHtml($_method->getTitle()) ?> + <label for="p_method_<?= $escaper->escapeHtml($code); ?>"> + <?= $escaper->escapeHtml($_method->getTitle()) ?> </label> </dt> <?php if ($html = $block->getChildHtml('payment.method.' . $code)): ?> @@ -136,12 +137,12 @@ script; <button id="payment-continue" type="button" class="action primary continue"> - <span><?= $block->escapeHtml(__('Go to Review Your Order')); ?></span> + <span><?= $escaper->escapeHtml(__('Go to Review Your Order')); ?></span> </button> </div> <div class="secondary"> - <a href="<?= $block->escapeUrl($block->getBackUrl()); ?>" class="action back"> - <span><?= $block->escapeHtml(__('Back to Shipping Information')); ?></span> + <a href="<?= $escaper->escapeUrl($block->getBackUrl()); ?>" class="action back"> + <span><?= $escaper->escapeHtml(__('Back to Shipping Information')); ?></span> </a> </div> </div> @@ -183,20 +184,21 @@ script; quote.billingAddress({ script; -$scriptString .= "city: '" . /* @noEscape */ $block->getAddress()->getCity() . "'," . PHP_EOL; -$scriptString .= "company: '" . /* @noEscape */ $block->getAddress()->getCompany() . "'," . PHP_EOL; -$scriptString .= "countryId: '" . /* @noEscape */ $block->getAddress()->getCountryId() . "'," . PHP_EOL; -$scriptString .= "customerAddressId: '" . /* @noEscape */ $block->getAddress()->getCustomerAddressId() . "'," . PHP_EOL; -$scriptString .= "customerId: '" . /* @noEscape */ $block->getAddress()->getCustomerId() . "'," . PHP_EOL; -$scriptString .= "fax: '" . /* @noEscape */ $block->getAddress()->getFax() . "'," . PHP_EOL; -$scriptString .= "firstname: '" . /* @noEscape */ $block->getAddress()->getFirstname() . "'," . PHP_EOL; -$scriptString .= "lastname: '" . /* @noEscape */ $block->getAddress()->getLastname() . "'," . PHP_EOL; -$scriptString .= "postcode: '" . /* @noEscape */ $block->getAddress()->getPostcode() . "'," . PHP_EOL; -$scriptString .= "regionId: '" . /* @noEscape */ $block->getAddress()->getRegionId() . "'," . PHP_EOL; -$scriptString .= "regionCode: '" . /* @noEscape */ $block->getAddress()->getRegionCode() . "'," . PHP_EOL; -$scriptString .= "region: '" . /* @noEscape */ $block->getAddress()->getRegion() . "'," . PHP_EOL; +$scriptString .= "city: '" . $escaper->escapeJs($block->getAddress()->getCity()) . "'," . PHP_EOL; +$scriptString .= "company: '" . $escaper->escapeJs($block->getAddress()->getCompany()) . "'," . PHP_EOL; +$scriptString .= "countryId: '" . $escaper->escapeJs($block->getAddress()->getCountryId()) . "'," . PHP_EOL; +$scriptString .= "customerAddressId: '" . $escaper->escapeJs($block->getAddress()->getCustomerAddressId()) . "'," + . PHP_EOL; +$scriptString .= "customerId: '" . $escaper->escapeJs($block->getAddress()->getCustomerId()) . "'," . PHP_EOL; +$scriptString .= "fax: '" . $escaper->escapeJs($block->getAddress()->getFax()) . "'," . PHP_EOL; +$scriptString .= "firstname: '" . $escaper->escapeJs($block->getAddress()->getFirstname()) . "'," . PHP_EOL; +$scriptString .= "lastname: '" . $escaper->escapeJs($block->getAddress()->getLastname()) . "'," . PHP_EOL; +$scriptString .= "postcode: '" . $escaper->escapeJs($block->getAddress()->getPostcode()) . "'," . PHP_EOL; +$scriptString .= "regionId: '" . $escaper->escapeJs($block->getAddress()->getRegionId()) . "'," . PHP_EOL; +$scriptString .= "regionCode: '" . $escaper->escapeJs($block->getAddress()->getRegionCode()) . "'," . PHP_EOL; +$scriptString .= "region: '" . $escaper->escapeJs($block->getAddress()->getRegion()) . "'," . PHP_EOL; $scriptString .= "street: " . /* @noEscape */ json_encode($block->getAddress()->getStreet()) . "," . PHP_EOL; -$scriptString .= "telephone: '" . /* @noEscape */ $block->getAddress()->getTelephone() . "'" . PHP_EOL; +$scriptString .= "telephone: '" . $escaper->escapeJs($block->getAddress()->getTelephone()) . "'" . PHP_EOL; $scriptString .= <<<script }); }); diff --git a/app/code/Magento/Multishipping/view/frontend/web/js/multi-shipping-balance.js b/app/code/Magento/Multishipping/view/frontend/web/js/multi-shipping-balance.js new file mode 100644 index 0000000000000..d0a9317b89af1 --- /dev/null +++ b/app/code/Magento/Multishipping/view/frontend/web/js/multi-shipping-balance.js @@ -0,0 +1,36 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery', + 'mage/dataPost', + 'jquery-ui-modules/widget' +], function ($, dataPost) { + 'use strict'; + + $.widget('mage.multiShippingBalance', { + options: { + changeUrl: '' + }, + + /** + * Initialize balance checkbox events. + * + * @private + */ + _create: function () { + this.element.on('change', $.proxy(function (event) { + dataPost().postData({ + action: this.options.changeUrl, + data: { + useBalance: +$(event.target).is(':checked') + } + }); + }, this)); + } + }); + + return $.mage.multiShippingBalance; +}); diff --git a/app/code/Magento/MysqlMq/README.md b/app/code/Magento/MysqlMq/README.md index 3ebc6a10d104d..5f41956aee4c4 100644 --- a/app/code/Magento/MysqlMq/README.md +++ b/app/code/Magento/MysqlMq/README.md @@ -1,3 +1,28 @@ -# MysqlMq +# Magento_MysqlMq module -**MysqlMq** provides message queue implementation based on MySQL. +**Magento_MysqlMq** provides message queue implementation based on MySQL. + +Module contain recurring script, declared in `Magento\MysqlMq\Setup\Recurring` +class. This script is executed by Magento post each schema installation or upgrade +stage and populates the queue table. + +## Installation + +Module creates the following tables: + +- `queue` - Table storing unique queues +- `queue_message` - Queue messages +- `queue_message_status` - Relation table to keep associations between queues and messages + + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Additional information + +For information about significant changes in patch releases, see [2.3.x Release information](http://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html). + +### cron options + +cron group configuration can be set in `etc/crontab.xml`. + +- `mysqlmq_clean_messages` - clean up old messages from database diff --git a/app/code/Magento/Newsletter/Model/CustomerSubscriberCache.php b/app/code/Magento/Newsletter/Model/CustomerSubscriberCache.php new file mode 100644 index 0000000000000..37abccea93b87 --- /dev/null +++ b/app/code/Magento/Newsletter/Model/CustomerSubscriberCache.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Model; + +/** + * This service provides caching Subscriber by Customer id. + */ +class CustomerSubscriberCache +{ + /** + * @var array + */ + private $customerSubscriber = []; + + /** + * Get Subscriber from cache by Customer id. + * + * @param int $customerId + * @return Subscriber|null + */ + public function getCustomerSubscriber(int $customerId): ?Subscriber + { + $subscriber = null; + if (isset($this->customerSubscriber[$customerId])) { + $subscriber = $this->customerSubscriber[$customerId]; + } + + return $subscriber; + } + + /** + * Set Subscriber to cache by Customer id. + * + * @param int $customerId + * @param Subscriber|null $subscriber + */ + public function setCustomerSubscriber(int $customerId, ?Subscriber $subscriber): void + { + $this->customerSubscriber[$customerId] = $subscriber; + } +} diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index d3f8bcb8765c3..7ec94ee5bc101 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -3,21 +3,24 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Newsletter\Model\Plugin; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerExtensionInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\Config\Share; use Magento\Framework\Api\ExtensionAttributesFactory; +use Magento\Framework\Api\SearchResults; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\CustomerSubscriberCache; use Magento\Newsletter\Model\ResourceModel\Subscriber\CollectionFactory; -use Magento\Customer\Api\Data\CustomerExtensionInterface; +use Magento\Newsletter\Model\Subscriber; use Magento\Newsletter\Model\SubscriberFactory; use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; -use Magento\Framework\Api\SearchResults; use Psr\Log\LoggerInterface; /** @@ -52,11 +55,6 @@ class CustomerPlugin */ private $storeManager; - /** - * @var array - */ - private $customerSubscriber = []; - /** * @var SubscriberFactory */ @@ -67,6 +65,11 @@ class CustomerPlugin */ private $logger; + /** + * @var CustomerSubscriberCache + */ + private $customerSubscriberCache; + /** * @param SubscriberFactory $subscriberFactory * @param ExtensionAttributesFactory $extensionFactory @@ -75,6 +78,7 @@ class CustomerPlugin * @param Share $shareConfig * @param StoreManagerInterface $storeManager * @param LoggerInterface $logger + * @param CustomerSubscriberCache|null $customerSubscriberCache */ public function __construct( SubscriberFactory $subscriberFactory, @@ -83,7 +87,8 @@ public function __construct( SubscriptionManagerInterface $subscriptionManager, Share $shareConfig, StoreManagerInterface $storeManager, - LoggerInterface $logger + LoggerInterface $logger, + CustomerSubscriberCache $customerSubscriberCache = null ) { $this->subscriberFactory = $subscriberFactory; $this->extensionFactory = $extensionFactory; @@ -92,6 +97,8 @@ public function __construct( $this->shareConfig = $shareConfig; $this->storeManager = $storeManager; $this->logger = $logger; + $this->customerSubscriberCache = $customerSubscriberCache + ?? ObjectManager::getInstance()->get(CustomerSubscriberCache::class); } /** @@ -129,10 +136,11 @@ public function afterSave( } if ($needToUpdate) { $storeId = $this->getCurrentStoreId($result); + $customerId = (int)$result->getId(); $subscriber = $subscribeStatus - ? $this->subscriptionManager->subscribeCustomer((int)$result->getId(), $storeId) - : $this->subscriptionManager->unsubscribeCustomer((int)$result->getId(), $storeId); - $this->customerSubscriber[(int)$result->getId()] = $subscriber; + ? $this->subscriptionManager->subscribeCustomer($customerId, $storeId) + : $this->subscriptionManager->unsubscribeCustomer($customerId, $storeId); + $this->customerSubscriberCache->setCustomerSubscriber($customerId, $subscriber); } $this->addIsSubscribedExtensionAttribute($result, $subscriber->isSubscribed()); @@ -258,7 +266,7 @@ public function afterGetList(CustomerRepositoryInterface $subject, SearchResults $extensionAttributes = $customer->getExtensionAttributes(); /** @var Subscriber $subscribe */ $subscribe = $collection->getItemByColumnValue('subscriber_email', $customer->getEmail()); - $isSubscribed = $subscribe && (int) $subscribe->getStatus() === Subscriber::STATUS_SUBSCRIBED; + $isSubscribed = $subscribe && (int)$subscribe->getStatus() === Subscriber::STATUS_SUBSCRIBED; $extensionAttributes->setIsSubscribed($isSubscribed); } @@ -315,22 +323,20 @@ private function deleteSubscriptionsAfterCustomerDelete(CustomerInterface $custo private function getSubscriber(CustomerInterface $customer): Subscriber { $customerId = (int)$customer->getId(); - if (isset($this->customerSubscriber[$customerId])) { - return $this->customerSubscriber[$customerId]; - } - - /** @var Subscriber $subscriber */ - $subscriber = $this->subscriberFactory->create(); - $websiteId = $this->getCurrentWebsiteId($customer); - $subscriber->loadByCustomer((int)$customer->getId(), $websiteId); - /** - * If subscriber was't found by customer id then try to find subscriber by customer email. - * It need when the customer is creating and he has already subscribed as guest by same email. - */ - if (!$subscriber->getId()) { - $subscriber->loadBySubscriberEmail((string)$customer->getEmail(), $websiteId); + $subscriber = $this->customerSubscriberCache->getCustomerSubscriber($customerId); + if ($subscriber === null) { + $subscriber = $this->subscriberFactory->create(); + $websiteId = $this->getCurrentWebsiteId($customer); + $subscriber->loadByCustomer((int)$customer->getId(), $websiteId); + /** + * If subscriber wasn't found by customer id then try to find subscriber by customer email. + * It need when the customer is creating and he has already subscribed as guest by same email. + */ + if (!$subscriber->getId()) { + $subscriber->loadBySubscriberEmail((string)$customer->getEmail(), $websiteId); + } + $this->customerSubscriberCache->setCustomerSubscriber($customerId, $subscriber); } - $this->customerSubscriber[$customerId] = $subscriber; return $subscriber; } diff --git a/app/code/Magento/Newsletter/Model/Plugin/RemoveSubscriberFromQueue.php b/app/code/Magento/Newsletter/Model/Plugin/RemoveSubscriberFromQueue.php new file mode 100644 index 0000000000000..93b79744c01e9 --- /dev/null +++ b/app/code/Magento/Newsletter/Model/Plugin/RemoveSubscriberFromQueue.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Model\Plugin; + +use Magento\Newsletter\Model\RemoveSubscriberFromQueueLink; +use Magento\Newsletter\Model\Subscriber; + +/** + * Plugin for removing subscriber from queue after unsubscribe + */ +class RemoveSubscriberFromQueue +{ + /** + * @var RemoveSubscriberFromQueueLink + */ + private $removeSubscriberFromQueueLink; + + /** + * @param RemoveSubscriberFromQueueLink $removeSubscriberFromQueueLink + */ + public function __construct(RemoveSubscriberFromQueueLink $removeSubscriberFromQueueLink) + { + $this->removeSubscriberFromQueueLink = $removeSubscriberFromQueueLink; + } + + /** + * Removes subscriber from queue + * + * @param Subscriber $subject + * @param Subscriber $subscriber + * @return Subscriber + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterUnsubscribe(Subscriber $subject, Subscriber $subscriber): Subscriber + { + if ($subscriber->isStatusChanged() && $subscriber->getSubscriberStatus() === Subscriber::STATUS_UNSUBSCRIBED) { + $this->removeSubscriberFromQueueLink->execute((int) $subscriber->getId()); + } + + return $subscriber; + } +} diff --git a/app/code/Magento/Newsletter/Model/RemoveSubscriberFromQueueLink.php b/app/code/Magento/Newsletter/Model/RemoveSubscriberFromQueueLink.php new file mode 100644 index 0000000000000..6f741ce719bfc --- /dev/null +++ b/app/code/Magento/Newsletter/Model/RemoveSubscriberFromQueueLink.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Model; + +use Magento\Framework\App\ResourceConnection; + +/** + * Responsible for removing subscriber from queue + */ +class RemoveSubscriberFromQueueLink +{ + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @param ResourceConnection $resourceConnection + */ + public function __construct(ResourceConnection $resourceConnection) + { + $this->resourceConnection = $resourceConnection; + } + + /** + * Removes subscriber from queue + * + * @param int $subscriberId + * @return void + */ + public function execute(int $subscriberId): void + { + $connection = $this->resourceConnection->getConnection(); + + $connection->delete( + $this->resourceConnection->getTableName('newsletter_queue_link'), + ['subscriber_id = ?' => $subscriberId, 'letter_sent_at IS NULL'] + ); + } +} diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Queue.php b/app/code/Magento/Newsletter/Model/ResourceModel/Queue.php index 06ff66e290646..476ce38fab107 100644 --- a/app/code/Magento/Newsletter/Model/ResourceModel/Queue.php +++ b/app/code/Magento/Newsletter/Model/ResourceModel/Queue.php @@ -86,7 +86,7 @@ public function addSubscribersToQueue(ModelQueue $queue, array $subscriberIds) $usedIds = array_flip($connection->fetchCol($select)); $subscriberIds = array_flip($subscriberIds); $newIds = array_diff_key($subscriberIds, $usedIds); - + $connection->beginTransaction(); try { foreach (array_keys($newIds) as $subscriberId) { diff --git a/app/code/Magento/Newsletter/Model/Subscriber.php b/app/code/Magento/Newsletter/Model/Subscriber.php index c2d80f9000792..29045bf5a8e38 100644 --- a/app/code/Magento/Newsletter/Model/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Subscriber.php @@ -308,6 +308,10 @@ public function getStatus() */ public function setStatus($value) { + if ($this->getSubscriberStatus() !== $value) { + $this->setStatusChanged(true); + } + return $this->setSubscriberStatus($value); } @@ -449,7 +453,8 @@ public function unsubscribe() } if ($this->getSubscriberStatus() != self::STATUS_UNSUBSCRIBED) { - $this->setSubscriberStatus(self::STATUS_UNSUBSCRIBED)->save(); + $this->setStatus(self::STATUS_UNSUBSCRIBED); + $this->save(); $this->sendUnsubscriptionEmail(); } return $this; diff --git a/app/code/Magento/Newsletter/Model/SubscriptionManager.php b/app/code/Magento/Newsletter/Model/SubscriptionManager.php index 57c6cd8b843a7..05be8325e3243 100644 --- a/app/code/Magento/Newsletter/Model/SubscriptionManager.php +++ b/app/code/Magento/Newsletter/Model/SubscriptionManager.php @@ -11,6 +11,7 @@ use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\MailException; use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\StoreManagerInterface; @@ -51,6 +52,11 @@ class SubscriptionManager implements SubscriptionManagerInterface */ private $customerRepository; + /** + * @var CustomerSubscriberCache + */ + private $customerSubscriberCache; + /** * @param SubscriberFactory $subscriberFactory * @param LoggerInterface $logger @@ -58,6 +64,7 @@ class SubscriptionManager implements SubscriptionManagerInterface * @param ScopeConfigInterface $scopeConfig * @param AccountManagementInterface $customerAccountManagement * @param CustomerRepositoryInterface $customerRepository + * @param CustomerSubscriberCache|null $customerSubscriberCache */ public function __construct( SubscriberFactory $subscriberFactory, @@ -65,7 +72,8 @@ public function __construct( StoreManagerInterface $storeManager, ScopeConfigInterface $scopeConfig, AccountManagementInterface $customerAccountManagement, - CustomerRepositoryInterface $customerRepository + CustomerRepositoryInterface $customerRepository, + CustomerSubscriberCache $customerSubscriberCache = null ) { $this->subscriberFactory = $subscriberFactory; $this->logger = $logger; @@ -73,6 +81,8 @@ public function __construct( $this->scopeConfig = $scopeConfig; $this->customerAccountManagement = $customerAccountManagement; $this->customerRepository = $customerRepository; + $this->customerSubscriberCache = $customerSubscriberCache + ?? ObjectManager::getInstance()->get(CustomerSubscriberCache::class); } /** @@ -209,14 +219,16 @@ private function saveSubscriber( if (!$subscriber->getId()) { $subscriber->setSubscriberConfirmCode($subscriber->randomSequence()); } + $customerId = (int)$customer->getId(); $subscriber->setStatus($status) ->setStatusChanged($statusChanged) - ->setCustomerId($customer->getId()) + ->setCustomerId($customerId) ->setStoreId($storeId) ->setEmail($customer->getEmail()) ->save(); if ($statusChanged) { + $this->customerSubscriberCache->setCustomerSubscriber($customerId, null); return true; } diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminCreateNewsletterTemplateActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminCreateNewsletterTemplateActionGroup.xml new file mode 100644 index 0000000000000..b7750f274abb3 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminCreateNewsletterTemplateActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCreateNewsletterTemplateActionGroup" extends="AdminMarketingCreateNewsletterTemplateActionGroup"> + <annotations> + <description> + Extends AdminMarketingCreateNewsletterTemplateActionGroup. + Clicks the Show/Hide button for the Template Content field before text is sent to this field. + </description> + </annotations> + + <click selector="{{BasicFieldNewsletterSection.showHide}}" stepKey="showWYSIWYG" before="fillTemplateContentField"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminQueueNewsletterActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminQueueNewsletterActionGroup.xml new file mode 100644 index 0000000000000..05ad191360b3c --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminQueueNewsletterActionGroup.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + + <actionGroup name="AdminQueueNewsletterActionGroup"> + <annotations> + <description> + Sends Newsletter template to queue: + Clicks the Queue Newsletter action. + Sets Queue Date Start. + Selects needed Store view if applicable. + Clicks the Save and Resume button. + </description> + </annotations> + <arguments> + <argument name="startAt" type="string"/> + <argument name="storeView" type="string" defaultValue="Default Store View"/> + </arguments> + + <click selector="{{AdminNewsletterGridMainActionsSection.action}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminNewsletterGridMainActionsSection.queueNewsletterOption}}" stepKey="cliclkQueueNewsletterOption"/> + <fillField selector="{{QueueInformationSection.queueStartFrom}}" userInput="{{startAt}}" stepKey="setDate"/> + <conditionalClick selector="{{QueueInformationSection.subscriberFromOption(storeView)}}" dependentSelector="{{QueueInformationSection.subscriberFromOption(storeView)}}" visible="true" stepKey="setStoreview"/> + <click selector="{{AdminNewsletterMainActionsSection.saveAndResumeButton}}" stepKey="clickSaveAndResumeButton"/> + <see userInput="You saved the newsletter queue." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Page/NewsletterTemplatePage/NewsletterTemplateFormPage.xml b/app/code/Magento/Newsletter/Test/Mftf/Page/NewsletterTemplatePage/NewsletterTemplateFormPage.xml index c24185f6afac6..5113232d85245 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Page/NewsletterTemplatePage/NewsletterTemplateFormPage.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Page/NewsletterTemplatePage/NewsletterTemplateFormPage.xml @@ -10,5 +10,6 @@ <page name="NewsletterTemplateForm" url="/newsletter/template/new/" area="admin" module="Magento_Cms"> <section name="StorefrontNewsletterSection"/> <section name="StorefrontNewsletterSection"/> + <section name="QueueInformationSection"/> </page> </pages> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterGridMainActionsSection.xml b/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterGridMainActionsSection.xml index ed1b432f798a5..b8ea4f35db536 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterGridMainActionsSection.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterGridMainActionsSection.xml @@ -16,5 +16,7 @@ <element name="resetFilter" type="button" selector=".action-default.scalable.action-reset.action-tertiary"/> <element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/> <element name="messageByType" type="block" selector="#messages .message-{{messageType}}" parameterized="true"/> + <element name="action" type="select" selector=".admin__control-select"/> + <element name="queueNewsletterOption" type="input" selector="//option[contains(text(),'Queue Newsletter')]"/> </section> </sections> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterMainActionsSection.xml b/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterMainActionsSection.xml index d824496f8e6b8..e9f44794a42a5 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterMainActionsSection.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Section/AdminNewsletterMainActionsSection.xml @@ -11,5 +11,6 @@ <element name="saveTemplateButton" type="button" selector=".page-actions-inner .page-actions-buttons .save"/> <element name="deleteTemplateButton" type="button" selector=".page-actions-inner .page-actions-buttons .delete"/> <element name="confirmDelete" type="button" selector=".action-primary.action-accept" timeout="10"/> + <element name="saveAndResumeButton" type="button" selector="//span[contains(text(),'Save and Resume')]/ancestor::button"/> </section> </sections> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/BasicFieldNewsletterSection.xml b/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/BasicFieldNewsletterSection.xml index 8df5053a5bf0c..98b786c0edd63 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/BasicFieldNewsletterSection.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/BasicFieldNewsletterSection.xml @@ -15,5 +15,6 @@ <element name="save" type="button" selector="button[data-role='template-save']" timeout="60"/> <element name="searchButton" type="button" selector=".admin__filter-actions button[title=Search]"/> <element name="searchInput" type="input" selector="input[name=code]"/> + <element name="showHide" type="button" selector=".action-show-hide"/> </section> </sections> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/QueueInformationSection.xml b/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/QueueInformationSection.xml new file mode 100644 index 0000000000000..150c037cf2c37 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection/QueueInformationSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="QueueInformationSection"> + <element name="queueStartFrom" type="input" selector="#date"/> + <element name="subscriberFromOption" type="select" selector="//option[contains(text(),'{{storeView}}')]" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml index 63b2741e7bd15..52635fb263efc 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml @@ -50,9 +50,7 @@ <argument name="websiteName" value="{{customWebsite.name}}"/> </actionGroup> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearFilters"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Newsletter/etc/di.xml b/app/code/Magento/Newsletter/etc/di.xml index 3c35936a2e8aa..cb97a6af7ddeb 100644 --- a/app/code/Magento/Newsletter/etc/di.xml +++ b/app/code/Magento/Newsletter/etc/di.xml @@ -26,6 +26,7 @@ type="Magento\Newsletter\Model\Plugin\CustomerPlugin"/> </type> <type name="Magento\Newsletter\Model\Subscriber"> + <plugin name="remove_subscriber_from_queue_after_unsubscribe" type="Magento\Newsletter\Model\Plugin\RemoveSubscriberFromQueue"/> <arguments> <argument name="customerSession" xsi:type="object">Magento\Customer\Model\Session\Proxy</argument> </arguments> diff --git a/app/code/Magento/PageCache/Model/App/CacheIdentifierPlugin.php b/app/code/Magento/PageCache/Model/App/CacheIdentifierPlugin.php index 0eca6a763796c..c944217d8200f 100644 --- a/app/code/Magento/PageCache/Model/App/CacheIdentifierPlugin.php +++ b/app/code/Magento/PageCache/Model/App/CacheIdentifierPlugin.php @@ -16,8 +16,21 @@ class CacheIdentifierPlugin { /** - * Constructor - * + * @var \Magento\Framework\View\DesignExceptions + */ + private $designExceptions; + + /** + * @var \Magento\Framework\App\RequestInterface + */ + private $request; + + /** + * @var \Magento\PageCache\Model\Config + */ + private $config; + + /** * @param \Magento\Framework\View\DesignExceptions $designExceptions * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\PageCache\Model\Config $config diff --git a/app/code/Magento/PageCache/Plugin/RegisterFormKeyFromCookie.php b/app/code/Magento/PageCache/Plugin/RegisterFormKeyFromCookie.php index 36a20ec658b6f..62f5461657fa2 100644 --- a/app/code/Magento/PageCache/Plugin/RegisterFormKeyFromCookie.php +++ b/app/code/Magento/PageCache/Plugin/RegisterFormKeyFromCookie.php @@ -96,6 +96,7 @@ private function updateCookieFormKey(string $formKey): void $cookieMetadata->setDomain($this->sessionConfig->getCookieDomain()); $cookieMetadata->setPath($this->sessionConfig->getCookiePath()); $cookieMetadata->setSecure($this->sessionConfig->getCookieSecure()); + $cookieMetadata->setSameSite('Lax'); $lifetime = $this->sessionConfig->getCookieLifetime(); if ($lifetime !== 0) { $cookieMetadata->setDuration($lifetime); diff --git a/app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js b/app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js index c63d97840e946..f602166e34143 100644 --- a/app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js +++ b/app/code/Magento/PageCache/view/frontend/web/js/form-key-provider.js @@ -18,13 +18,16 @@ define(function () { var expires, secure, date = new Date(), - isSecure = !!window.cookiesConfig && window.cookiesConfig.secure; + cookiesConfig = window.cookiesConfig || {}, + isSecure = !!cookiesConfig.secure, + samesite = cookiesConfig.samesite || 'lax'; date.setTime(date.getTime() + 86400000); expires = '; expires=' + date.toUTCString(); secure = isSecure ? '; secure' : ''; + samesite = '; samesite=' + samesite; - document.cookie = 'form_key=' + (value || '') + expires + secure + '; path=/'; + document.cookie = 'form_key=' + (value || '') + expires + secure + '; path=/' + samesite; } /** diff --git a/app/code/Magento/Payment/Helper/Data.php b/app/code/Magento/Payment/Helper/Data.php index 377dad8a3d22d..782ef39082438 100644 --- a/app/code/Magento/Payment/Helper/Data.php +++ b/app/code/Magento/Payment/Helper/Data.php @@ -200,7 +200,7 @@ public function getInfoBlock(InfoInterface $info, LayoutInterface $layout = null */ public function getInfoBlockHtml(InfoInterface $info, $storeId) { - $this->_appEmulation->startEnvironmentEmulation($storeId); + $this->_appEmulation->startEnvironmentEmulation($storeId, \Magento\Framework\App\Area::AREA_FRONTEND, true); try { // Retrieve specified view block from appropriate design package (depends on emulated store) diff --git a/app/code/Magento/Payment/Model/Method/AbstractMethod.php b/app/code/Magento/Payment/Model/Method/AbstractMethod.php index 3c21b281cd122..931d0856a78fa 100644 --- a/app/code/Magento/Payment/Model/Method/AbstractMethod.php +++ b/app/code/Magento/Payment/Model/Method/AbstractMethod.php @@ -25,7 +25,7 @@ * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @deprecated 100.0.6 * @see \Magento\Payment\Model\Method\Adapter - * @see https://devdocs.magento.com/guides/v2.3/payments-integrations/payment-gateway/payment-gateway-intro.html + * @see https://devdocs.magento.com/guides/v2.4/payments-integrations/payment-gateway/payment-gateway-intro.html * @since 100.0.2 */ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibleModel implements diff --git a/app/code/Magento/Payment/Test/Mftf/Data/PaymentMethodData.xml b/app/code/Magento/Payment/Test/Mftf/Data/PaymentMethodData.xml index eeae53d082443..a5ac53bc56cac 100644 --- a/app/code/Magento/Payment/Test/Mftf/Data/PaymentMethodData.xml +++ b/app/code/Magento/Payment/Test/Mftf/Data/PaymentMethodData.xml @@ -15,4 +15,8 @@ <entity name="CashOnDeliveryPaymentMethodDefault" type="cashondelivery_payment_method"> <requiredEntity type="active">CashOnDeliveryEnableConfigData</requiredEntity> </entity> + + <entity name="CashOnDeliveryPaymentMethod" type="payment_method"> + <data key="method">cashondelivery</data> + </entity> </entities> diff --git a/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php b/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php index 21c282635945b..3130aeeaffcb4 100644 --- a/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Payment/Test/Unit/Helper/DataTest.php @@ -234,7 +234,9 @@ public function testGetInfoBlockHtml() ->setMethods(['setArea', 'setIsSecureMode', 'getMethod', 'setStore', 'toHtml', 'setInfo']) ->getMockForAbstractClass(); - $this->appEmulation->expects($this->once())->method('startEnvironmentEmulation')->with($storeId); + $this->appEmulation->expects($this->once()) + ->method('startEnvironmentEmulation') + ->with($storeId, \Magento\Framework\App\Area::AREA_FRONTEND, true); $infoMock->expects($this->once())->method('getMethodInstance')->willReturn($methodMock); $methodMock->expects($this->once())->method('getInfoBlockType')->willReturn($blockType); $this->layoutMock->expects($this->once())->method('createBlock') diff --git a/app/code/Magento/Paypal/Controller/Express/GetTokenData.php b/app/code/Magento/Paypal/Controller/Express/GetTokenData.php index 5c41e753e8a95..4a799a91a4f36 100644 --- a/app/code/Magento/Paypal/Controller/Express/GetTokenData.php +++ b/app/code/Magento/Paypal/Controller/Express/GetTokenData.php @@ -7,6 +7,7 @@ namespace Magento\Paypal\Controller\Express; +use Magento\Authorization\Model\UserContextInterface; use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Controller\ResultInterface; @@ -73,6 +74,11 @@ class GetTokenData extends AbstractExpress implements HttpGetActionInterface */ private $guestCartRepository; + /** + * @var UserContextInterface + */ + private $userContext; + /** * @param Context $context * @param CustomerSession $customerSession @@ -86,6 +92,7 @@ class GetTokenData extends AbstractExpress implements HttpGetActionInterface * @param CustomerRepository $customerRepository * @param CartRepositoryInterface $cartRepository * @param GuestCartRepositoryInterface $guestCartRepository + * @param UserContextInterface $userContext * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -100,7 +107,8 @@ public function __construct( LoggerInterface $logger, CustomerRepository $customerRepository, CartRepositoryInterface $cartRepository, - GuestCartRepositoryInterface $guestCartRepository + GuestCartRepositoryInterface $guestCartRepository, + UserContextInterface $userContext ) { parent::__construct( $context, @@ -117,6 +125,7 @@ public function __construct( $this->customerRepository = $customerRepository; $this->cartRepository = $cartRepository; $this->guestCartRepository = $guestCartRepository; + $this->userContext = $userContext; } /** @@ -160,23 +169,33 @@ public function execute(): ResultInterface } /** - * Get paypal token + * Prepare quote specified for checkout. * - * @return string|null + * @return \Magento\Quote\Api\Data\CartInterface * @throws LocalizedException */ - private function getToken(): ?string + private function prepareQuote() { $quoteId = $this->getRequest()->getParam('quote_id'); - $customerId = $this->getRequest()->getParam('customer_id') ?: $this->_customerSession->getId(); - $hasButton = (bool)$this->getRequest()->getParam(Checkout::PAYMENT_INFO_BUTTON); - if ($quoteId) { - $quote = $customerId ? $this->cartRepository->get($quoteId) : $this->guestCartRepository->get($quoteId); - } else { - $quote = $this->_getQuote(); + $quote = $this->userContext->getUserId() + ? $this->cartRepository->get($quoteId) + : $this->guestCartRepository->get($quoteId); + if ((int)$quote->getCustomer()->getId() === (int)$this->userContext->getUserId()) { + return $quote; + } } - + return $this->_getQuote(); + } + /** + * Get paypal token + * + * @return string|null + * @throws LocalizedException + */ + private function getToken(): ?string + { + $quote = $this->prepareQuote(); $this->_initCheckout($quote); if ($quote->getIsMultiShipping()) { @@ -184,8 +203,8 @@ private function getToken(): ?string $quote->removeAllAddresses(); } - if ($customerId) { - $customerData = $this->customerRepository->getById((int)$customerId); + if ($this->userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER) { + $customerData = $this->customerRepository->getById((int)$this->userContext->getUserId()); $this->_checkout->setCustomerWithAddressChange( $customerData, @@ -200,6 +219,7 @@ private function getToken(): ?string $this->_url->getUrl('paypal/express/cancel'), $this->_url->getUrl('checkout/onepage/success') ); + $hasButton = (bool)$this->getRequest()->getParam(Checkout::PAYMENT_INFO_BUTTON); return $this->_checkout->start( $this->_url->getUrl('*/*/return'), diff --git a/app/code/Magento/Paypal/Model/Express/Checkout.php b/app/code/Magento/Paypal/Model/Express/Checkout.php index 389f20c757ae1..5099f0ccb35ff 100644 --- a/app/code/Magento/Paypal/Model/Express/Checkout.php +++ b/app/code/Magento/Paypal/Model/Express/Checkout.php @@ -1155,8 +1155,18 @@ private function setShippingOptions(PaypalCart $cart, Address $address = null) protected function prepareGuestQuote() { $quote = $this->_quote; + $billingAddress = $quote->getBillingAddress(); + + /* Check if Guest customer provided an email address on checkout page, and in case + it was provided, use it as priority, if not, use email address returned from PayPal. + (Guest customer can place order two ways: - from checkout page, where guest is asked to provide + an email address that later can be used for account creation; - from mini shopping cart, directly + proceeding to PayPal without providing an email address */ + $email = $billingAddress->getOrigData('email') !== null + ? $billingAddress->getOrigData('email') : $billingAddress->getEmail(); + $quote->setCustomerId(null) - ->setCustomerEmail($quote->getBillingAddress()->getEmail()) + ->setCustomerEmail($email) ->setCustomerIsGuest(true) ->setCustomerGroupId(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID); return $this; diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml index d43e894b014ff..e67e4ae97f8de 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml @@ -16,10 +16,10 @@ <description value="Users are able to place order using Paypal Smart Button on Checkout Page, payment action is Sale"/> <severity value="CRITICAL"/> <testCaseId value="MC-13690"/> + <group value="paypalExpress"/> <skip> <issueId value="MC-37236"/> </skip> - <group value="paypalExpress"/> </annotations> <before> <!-- Login --> @@ -57,7 +57,7 @@ <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="StorefrontAddProductToCartFromCategoryActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInMiniCartPageTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInMiniCartPageTest.xml index c19cb3ee4a646..2c1a7a43f6f0b 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInMiniCartPageTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInMiniCartPageTest.xml @@ -54,7 +54,7 @@ <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="StorefrontAddProductToCartFromCategoryActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInShoppingCartPageTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInShoppingCartPageTest.xml index 4aed4b3d7e414..0e1a0ab984057 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInShoppingCartPageTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInShoppingCartPageTest.xml @@ -68,7 +68,7 @@ <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="StorefrontAddProductToCartFromCategoryActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml index 7e3c4dab4588e..801af2d7c2702 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml @@ -16,10 +16,10 @@ <description value="Users are able to place order using Paypal Smart Button using Euro currency and merchant country is France"/> <severity value="MAJOR"/> <testCaseId value="MC-33274"/> + <group value="paypalExpress"/> <skip> <issueId value="MC-37236"/> </skip> - <group value="paypalExpress"/> </annotations> <before> <!--Set price scope global--> diff --git a/app/code/Magento/Paypal/composer.json b/app/code/Magento/Paypal/composer.json index 1b35fae2de1bc..389544b6a17a4 100644 --- a/app/code/Magento/Paypal/composer.json +++ b/app/code/Magento/Paypal/composer.json @@ -8,6 +8,7 @@ "php": "~7.3.0||~7.4.0", "lib-libxml": "*", "magento/framework": "*", + "magento/module-authorization": "*", "magento/module-backend": "*", "magento/module-catalog": "*", "magento/module-checkout": "*", diff --git a/app/code/Magento/Paypal/etc/adminhtml/system.xml b/app/code/Magento/Paypal/etc/adminhtml/system.xml index 80e9523c752e4..249f9a786096d 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system.xml @@ -75,7 +75,7 @@ <label>Payments Pro</label> <attribute type="activity_path">payment/paypal_payment_pro/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-pro.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-pro.html</comment> </group> <group id="paypal_payflow_required" showInDefault="1" showInWebsite="1" sortOrder="10"> <field id="enable_paypal_payflow"> @@ -95,7 +95,7 @@ <comment>Accept credit card and PayPal payments securely.</comment> <attribute type="activity_path">payment/wps_express/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-standard.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-standard.html</comment> </group> <group id="express_checkout_required"> <group id="express_checkout_required_express_checkout"> @@ -174,7 +174,7 @@ <comment>Accept credit card and PayPal payments securely.</comment> <attribute type="activity_path">payment/wps_express/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-standard.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-standard.html</comment> </group> <group id="express_checkout_required"> <group id="express_checkout_required_express_checkout" translate="label"> @@ -245,7 +245,7 @@ <comment>Accept credit card and PayPal payments securely.</comment> <attribute type="activity_path">payment/wps_express/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-standard.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-standard.html</comment> </group> <group id="express_checkout_required"> <group id="express_checkout_required_express_checkout" translate="label"> @@ -290,7 +290,7 @@ <label>Website Payments Pro</label> <attribute type="activity_path">payment/paypal_payment_pro/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-pro.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-pro.html</comment> </group> <group id="paypal_payflow_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> <group id="paypal_payflow_api_settings"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml b/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml index 2c5d669ccd9e9..22a9d89e784b9 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml @@ -13,7 +13,7 @@ <comment>Add PayPal as an additional payment method to your checkout page.</comment> <attribute type="activity_path">payment/paypal_express/active</attribute> <group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-express-checkout.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-express-checkout.html</comment> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model> </group> <group id="express_checkout_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml index 1ae0b52146c38..748b9bd66bafa 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_advanced.xml @@ -13,7 +13,7 @@ <comment><![CDATA[Accept payments with a PCI-compliant checkout that keeps customers on your site. (<u>Includes Express Checkout</u>)]]></comment> <attribute type="activity_path">payment/payflow_advanced/active</attribute> <group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-advanced.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-advanced.html</comment> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model> </group> <group id="required_settings" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml index ead70eca3fadd..357f38eec51e6 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/payflow_link.xml @@ -13,7 +13,7 @@ <comment><![CDATA[Connect your merchant account with a PCI-compliant gateway that lets customers pay without leaving your site. (<u>Includes Express Checkout</u>)]]></comment> <attribute type="activity_path">payment/payflow_link/active</attribute> <group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payflow-link.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payflow-link.html</comment> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model> </group> <group id="payflow_link_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml b/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml index 727bffdaf27e3..16e8ee570a078 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/payments_pro_hosted_solution.xml @@ -14,7 +14,7 @@ <comment><![CDATA[Accept payments with a PCI compliant checkout that keeps customers on your site. (<u>Includes Express Checkout</u>)]]></comment> <attribute type="paypal_ec_separate">1</attribute> <group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-pro.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-pro.html</comment> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model> </group> <group id="pphs_required_settings" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml index 77ec9eb0d0069..8afc2a961fb74 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml @@ -14,7 +14,7 @@ <attribute type="activity_path">payment/payflowpro/active</attribute> <attribute type="paypal_ec_separate">1</attribute> <group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payflow-pro.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payflow-pro.html</comment> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model> </group> <group id="paypal_payflow_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> diff --git a/app/code/Magento/Paypal/view/frontend/templates/express/review.phtml b/app/code/Magento/Paypal/view/frontend/templates/express/review.phtml index 69c7c8179850a..afd1e91c6e588 100644 --- a/app/code/Magento/Paypal/view/frontend/templates/express/review.phtml +++ b/app/code/Magento/Paypal/view/frontend/templates/express/review.phtml @@ -4,9 +4,14 @@ * See COPYING.txt for license details. */ +use Magento\Framework\Escaper; +use Magento\Framework\View\Helper\SecureHtmlRenderer; +use Magento\Paypal\Block\Express\Review; + /** - * @var \Magento\Paypal\Block\Express\Review $block - * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer + * @var Review $block + * @var Escaper $escaper + * @var SecureHtmlRenderer $secureRenderer */ ?> <div class="paypal-review view"> @@ -15,11 +20,11 @@ <?php if ($block->getShippingAddress()): ?> <div class="box box-order-shipping-method"> <strong class="box-title"> - <span><?= $block->escapeHtml(__('Shipping Method')) ?></span> + <span><?= $escaper->escapeHtml(__('Shipping Method')) ?></span> </strong> <div class="box-content"> <form method="post" id="shipping-method-form" - action="<?= $block->escapeUrl($block->getShippingMethodSubmitUrl()) ?>" + action="<?= $escaper->escapeUrl($block->getShippingMethodSubmitUrl()) ?>" class="form"> <?php if ($block->canEditShippingMethod()): ?> <?php if ($groups = $block->getShippingRateGroups()): ?> @@ -28,11 +33,14 @@ <select name="shipping_method" id="shipping-method" class="select"> <?php if (!$currentRate): ?> <option value=""> - <?= $block->escapeHtml(__('Please select a shipping method...')); ?> + <?= $escaper->escapeHtml( + __('Please select a shipping method...') + ); ?> </option> <?php endif; ?> <?php foreach ($groups as $code => $rates): ?> - <optgroup label="<?= $block->escapeHtml($block->getCarrierName($code)); + <optgroup label="<?= + $escaper->escapeHtml($block->getCarrierName($code)); ?>"> <?php foreach ($rates as $rate): ?> <option value="<?= @@ -51,19 +59,10 @@ <?php endforeach; ?> </select> </div> - <div class="actions-toolbar"> - <div class="primary"> - <button id="update-shipping-method-submit" type="submit" - class="action update primary"> - <span> - <?= $block->escapeHtml(__('Update Shipping Method')) ?> - </span> - </button> - </div> - </div> + <div class="actions-toolbar"></div> <?php else: ?> <p> - <?= $block->escapeHtml(__( + <?= $escaper->escapeHtml(__( 'Sorry, no quotes are available for this order right now.' )); ?> </p> @@ -80,40 +79,40 @@ </div> <div class="box box-order-shipping-address"> <strong class="box-title"> - <span><?= $block->escapeHtml(__('Shipping Address')) ?></span> + <span><?= $escaper->escapeHtml(__('Shipping Address')) ?></span> </strong> <div class="box-content"> <address> - <?= $block->escapeHtml( + <?= $escaper->escapeHtml( $block->renderAddress($block->getShippingAddress()), ['br'] - );?> + ); ?> </address> </div> <?php if ($block->getCanEditShippingAddress()): ?> <div class="box-actions"> - <a href="<?= $block->escapeUrl($block->getEditUrl()) ?>" class="action edit"> - <span><?= $block->escapeHtml(__('Edit')) ?></span> + <a href="<?= $escaper->escapeUrl($block->getEditUrl()) ?>" class="action edit"> + <span><?= $escaper->escapeHtml(__('Edit')) ?></span> </a> </div> <?php endif; ?> </div> <?php endif; ?> <div class="box box-order-billing-address"> - <strong class="box-title"><span><?= $block->escapeHtml(__('Payment Method')) ?></span></strong> + <strong class="box-title"><span><?= $escaper->escapeHtml(__('Payment Method')) ?></span></strong> <div class="box-content"> - <?= $block->escapeHtml($block->getPaymentMethodTitle()) ?><br> - <?= $block->escapeHtml($block->getEmail()) ?> <br> + <?= $escaper->escapeHtml($block->getPaymentMethodTitle()) ?><br> + <?= $escaper->escapeHtml($block->getEmail()) ?> <br> <img src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png" alt="<?= $block->escapeHtml(__('Buy now with PayPal')) ?>"/> </div> - <?php if ($block->getEditUrl()): ?> - <div class="box-actions"> - <a href="<?= $block->escapeUrl($block->getEditUrl()) ?>" class="action edit"> - <span><?= $block->escapeHtml(__('Edit Payment Information')) ?></span> - </a> - </div> - <?php endif ?> + <?php if ($block->getEditUrl()): ?> + <div class="box-actions"> + <a href="<?= $escaper->escapeUrl($block->getEditUrl()) ?>" class="action edit"> + <span><?= $escaper->escapeHtml(__('Edit Payment Information')) ?></span> + </a> + </div> + <?php endif ?> </div> </div> </div> @@ -124,29 +123,29 @@ <div class="paypal-review-items"> <div class="paypal-review-title"> - <strong><?= $block->escapeHtml(__('Items in Your Shopping Cart')) ?></strong> - <a href="<?= $block->escapeUrl($block->getUrl('checkout/cart')) ?>" class="action edit"> - <span><?= $block->escapeHtml(__('Edit Shopping Cart')) ?></span> + <strong><?= $escaper->escapeHtml(__('Items in Your Shopping Cart')) ?></strong> + <a href="<?= $escaper->escapeUrl($block->getUrl('checkout/cart')) ?>" class="action edit"> + <span><?= $escaper->escapeHtml(__('Edit Shopping Cart')) ?></span> </a> </div> <?= $block->getChildHtml('details') ?> - <form method="post" id="order-review-form" action="<?= $block->escapeUrl($block->getPlaceOrderUrl()) ?>" + <form method="post" id="order-review-form" action="<?= $escaper->escapeUrl($block->getPlaceOrderUrl()) ?>" class="form order-review-form"> <?= $block->getChildHtml('agreements') ?> <div class="actions-toolbar" id="review-buttons-container"> <div class="primary"> <button type="button" id="review-button" class="action checkout primary" - value="<?= $block->escapeHtml(__('Place Order')) ?>"> - <span><?= $block->escapeHtml(__('Place Order')) ?></span> + value="<?= $escaper->escapeHtml(__('Place Order')) ?>"> + <span><?= $escaper->escapeHtml(__('Place Order')) ?></span> </button> </div> <span class="please-wait load indicator" id="review-please-wait" - data-text="<?= $block->escapeHtml(__('Submitting order information...')) ?>"> - <span><?= $block->escapeHtml(__('Submitting order information...')) ?></span> + data-text="<?= $escaper->escapeHtml(__('Submitting order information...')) ?>"> + <span><?= $escaper->escapeHtml(__('Submitting order information...')) ?></span> </span> - <?= /* @noEscape */ $secureRenderer->renderStyleAsTag("display: none;", 'span#review-please-wait')?> + <?= /* @noEscape */ $secureRenderer->renderStyleAsTag("display: none;", 'span#review-please-wait') ?> </div> </form> </div> @@ -158,7 +157,7 @@ "orderReview": { "shippingSubmitFormSelector": "#shipping-method-form", "shippingSelector": "#shipping-method", - "shippingMethodUpdateUrl": "<?= $block->escapeUrl($block->getUpdateShippingMethodsUrl()) ?>", + "shippingMethodUpdateUrl": "<?= $escaper->escapeJs($block->getUpdateShippingMethodsUrl()) ?>", "isAjax": <?= /* @noEscape */ $block->getUseAjax() ? 'true' : 'false' ?>, "canEditShippingMethod": <?= /* @noEscape */ $block->canEditShippingMethod() ? 'true' : 'false' ?> } diff --git a/app/code/Magento/Paypal/view/frontend/web/js/order-review.js b/app/code/Magento/Paypal/view/frontend/web/js/order-review.js index e3db1010693ee..6a3914ed19d59 100644 --- a/app/code/Magento/Paypal/view/frontend/web/js/order-review.js +++ b/app/code/Magento/Paypal/view/frontend/web/js/order-review.js @@ -25,7 +25,6 @@ define([ shippingMethodContainer: '#shipping-method-container', agreementSelector: 'div.checkout-agreements input', isAjax: false, - updateShippingMethodSubmitSelector: '#update-shipping-method-submit', shippingMethodUpdateUrl: null, updateOrderSubmitUrl: null, canEditShippingMethod: false @@ -55,14 +54,12 @@ define([ this.options.updateOrderSubmitUrl, this.options.updateContainerSelector ) - ).find(this.options.updateOrderSelector).on('click', $.proxy(this._updateOrderHandler, this)).end() - .find(this.options.updateShippingMethodSubmitSelector).hide().end(); + ).find(this.options.updateOrderSelector).on('click', $.proxy(this._updateOrderHandler, this)).end(); this._shippingTobilling(); if ($(this.options.shippingSubmitFormSelector).length && this.options.canEditShippingMethod) { this.isShippingSubmitForm = true; $(this.options.shippingSubmitFormSelector) - .find(this.options.updateShippingMethodSubmitSelector).hide().end() .on('change', this.options.shippingSelector, $.proxy( diff --git a/app/code/Magento/PaypalCaptcha/Test/Mftf/ActionGroup/AddProductToCheckoutPageWithPayPalPayflowProActionGroup.xml b/app/code/Magento/PaypalCaptcha/Test/Mftf/ActionGroup/AddProductToCheckoutPageWithPayPalPayflowProActionGroup.xml new file mode 100644 index 0000000000000..a15de07a18008 --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/Test/Mftf/ActionGroup/AddProductToCheckoutPageWithPayPalPayflowProActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AddProductToCheckoutPageWithPayPalPayflowProActionGroup" extends="AddProductToCheckoutPageActionGroup"> + <annotations> + <description>Extends AddProductToCheckoutPageActionGroup to choose PayPal PayflowPro method</description> + </annotations> + <arguments> + </arguments> + <click selector="{{StorefrontPaypalCheckoutSection.creditCard}}" stepKey="clickPayPalCheckbox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE.txt b/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE.txt new file mode 100644 index 0000000000000..36b2459f6aa63 --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE.txt @@ -0,0 +1,48 @@ + +Open Software License ("OSL") v. 3.0 + +This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Open Software License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. diff --git a/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE_AFL.txt b/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE_AFL.txt new file mode 100644 index 0000000000000..f39d641b18a19 --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/Test/Mftf/LICENSE_AFL.txt @@ -0,0 +1,48 @@ + +Academic Free License ("AFL") v. 3.0 + +This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Academic Free License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. diff --git a/app/code/Magento/PaypalCaptcha/Test/Mftf/README.md b/app/code/Magento/PaypalCaptcha/Test/Mftf/README.md new file mode 100644 index 0000000000000..02a049335284e --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/Test/Mftf/README.md @@ -0,0 +1,3 @@ +# Captcha Functional Tests + +The Functional Test Module for **Magento PaypalCaptcha** module. diff --git a/app/code/Magento/PaypalCaptcha/Test/Mftf/Test/StorefrontPaymentsCaptchaWithPayflowProTest.xml b/app/code/Magento/PaypalCaptcha/Test/Mftf/Test/StorefrontPaymentsCaptchaWithPayflowProTest.xml new file mode 100644 index 0000000000000..0a84cebfe3770 --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/Test/Mftf/Test/StorefrontPaymentsCaptchaWithPayflowProTest.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontPaymentsCaptchaWithPayflowProTest"> + <annotations> + <features value="Captcha"/> + <stories value="Paypal PayflowPro and Captcha"/> + <title value="Storefront order creation with Paypal PayflowPro and Captcha"/> + <description value="Test for checking captcha while order creation in storefront with Paypal PayflowPro."/> + <testCaseId value="MC-41750" /> + <useCaseId value="MC-41572"/> + <severity value="AVERAGE"/> + <group value="captcha"/> + </annotations> + <before> + <!-- Configure Paypal Payflow Pro payment method --> + <createData entity="PaypalPayflowProConfig" stepKey="configurePaypalPayflowProPayment"/> + <createData entity="EnablePaypalPayflowProWithVault" stepKey="enablePaypalPayflowProPaymentWithVault"/> + + <!-- Enable captcha for Checkout/Placing Order --> + <magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}}" stepKey="enableOnOpageCheckoutCaptcha" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAlwaysConfigData.path}} {{StorefrontCustomerCaptchaModeAlwaysConfigData.value}}" stepKey="alwaysEnableCaptcha" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaLength3ConfigData.path}} {{StorefrontCustomerCaptchaLength3ConfigData.value}}" stepKey="setCaptchaLength" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaSymbols1ConfigData.path}} {{StorefrontCustomerCaptchaSymbols1ConfigData.value}}" stepKey="setCaptchaSymbols" /> + + <!-- Create customer --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Create product and category --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!-- Login as admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <!-- Set default configuration for Paypal PayflowPro payment method --> + <createData entity="DefaultPaypalPayflowProConfig" stepKey="defaultPaypalPayflowProConfig"/> + <createData entity="RollbackPaypalPayflowPro" stepKey="rollbackPaypalPayflowProConfig"/> + + <!-- Set default configuration for captcha --> + <magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}},{{StorefrontCaptchaOnCustomerForgotPasswordConfigData.value}}" stepKey="enableCaptchaOnDefaultForms" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAfterFailConfigData.path}} {{StorefrontCustomerCaptchaModeAfterFailConfigData.value}}" stepKey="defaultCaptchaMode" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultLengthConfigData.path}} {{StorefrontCustomerCaptchaDefaultLengthConfigData.value}}" stepKey="setDefaultCaptchaLength" /> + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.path}} {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.value}}" stepKey="setDefaultCaptchaSymbols" /> + + <!-- Delete customer --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + + <!-- Delete product and category--> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + + <!-- Admin logout --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + </after> + + <!--Login to storefront as previously created customer--> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$createCustomer$"/> + </actionGroup> + + <!-- Add product to cart and proceed to checkout payments method step --> + <actionGroup ref="AddProductToCheckoutPageWithPayPalPayflowProActionGroup" stepKey="goToCheckoutPaypalPayflowPro"> + <argument name="Category" value="$createCategory$"/> + </actionGroup> + + <!-- Fill credit card form with card number, expiration and CVV --> + <actionGroup ref="StorefrontPaypalFillCardDataActionGroup" stepKey="fillCardDataPaypal"> + <argument name="cardData" value="Visa3DSecureCard"/> + </actionGroup> + + <!-- Enter captcha value --> + <actionGroup ref="StorefrontCheckoutPaymentsWithCaptchaActionGroup" stepKey="fillCaptchaField"> + <argument name="captcha" value="{{PreconfiguredCaptcha.value}}"/> + </actionGroup> + + <!-- Place order --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Confirm Purchased Simple Product --> + <actionGroup ref="StorefrontOpenOrderFromSuccessPageActionGroup" stepKey="openOrderFromSuccessPage"> + <argument name="orderNumber" value="{$grabOrderNumber}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/PaypalCaptcha/view/frontend/requirejs-config.js b/app/code/Magento/PaypalCaptcha/view/frontend/requirejs-config.js index 78e7add4ec690..bf706dc2da972 100644 --- a/app/code/Magento/PaypalCaptcha/view/frontend/requirejs-config.js +++ b/app/code/Magento/PaypalCaptcha/view/frontend/requirejs-config.js @@ -8,6 +8,12 @@ var config = { mixins: { 'Magento_Checkout/js/view/payment/list': { 'Magento_PaypalCaptcha/js/view/payment/list-mixin': true + }, + 'Magento_Paypal/js/view/payment/method-renderer/payflowpro-method': { + 'Magento_PaypalCaptcha/js/view/payment/method-renderer/payflowpro-method-mixin': true + }, + 'Magento_Captcha/js/view/checkout/defaultCaptcha': { + 'Magento_PaypalCaptcha/js/view/checkout/defaultCaptcha-mixin': true } } } diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/payment/set-payment-hooks.js b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/model/skipRefreshCaptcha.js similarity index 61% rename from app/code/Magento/Checkout/view/frontend/web/js/model/payment/set-payment-hooks.js rename to app/code/Magento/PaypalCaptcha/view/frontend/web/js/model/skipRefreshCaptcha.js index 5cd31d85c9a29..813b43da774a1 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/payment/set-payment-hooks.js +++ b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/model/skipRefreshCaptcha.js @@ -3,11 +3,10 @@ * See COPYING.txt for license details. */ -define([], function () { +define(['ko'], function (ko) { 'use strict'; return { - requestModifiers: [], - afterRequestListeners: [] + skip: ko.observable(false) }; }); diff --git a/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/checkout/defaultCaptcha-mixin.js b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/checkout/defaultCaptcha-mixin.js new file mode 100644 index 0000000000000..524353abc01f4 --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/checkout/defaultCaptcha-mixin.js @@ -0,0 +1,27 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'Magento_PaypalCaptcha/js/model/skipRefreshCaptcha' +], function (skipRefreshCaptcha) { + 'use strict'; + + var defaultCaptchaMixin = { + /** + * @override + */ + refresh: function () { + if (!skipRefreshCaptcha.skip()) { + this._super(); + } else { + skipRefreshCaptcha.skip(false); + } + } + }; + + return function (defaultCaptcha) { + return defaultCaptcha.extend(defaultCaptchaMixin); + }; +}); diff --git a/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/payment/method-renderer/payflowpro-method-mixin.js b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/payment/method-renderer/payflowpro-method-mixin.js new file mode 100644 index 0000000000000..1b4b63012b8f7 --- /dev/null +++ b/app/code/Magento/PaypalCaptcha/view/frontend/web/js/view/payment/method-renderer/payflowpro-method-mixin.js @@ -0,0 +1,24 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'Magento_PaypalCaptcha/js/model/skipRefreshCaptcha' +], function (skipRefreshCaptcha) { + 'use strict'; + + var payflowProMethodMixin = { + /** + * @override + */ + placeOrder: function () { + skipRefreshCaptcha.skip(true); + this._super(); + } + }; + + return function (payflowProMethod) { + return payflowProMethod.extend(payflowProMethodMixin); + }; +}); diff --git a/app/code/Magento/Persistent/Block/Header/Additional.php b/app/code/Magento/Persistent/Block/Header/Additional.php index dfde2adf1e6ab..4f0458203a0df 100644 --- a/app/code/Magento/Persistent/Block/Header/Additional.php +++ b/app/code/Magento/Persistent/Block/Header/Additional.php @@ -66,7 +66,7 @@ public function __construct( Json $jsonSerializer = null, Data $persistentHelper = null ) { - $this->isScopePrivate = true; + $this->_isScopePrivate = true; $this->_customerViewHelper = $customerViewHelper; $this->_persistentSessionHelper = $persistentSessionHelper; $this->customerRepository = $customerRepository; diff --git a/app/code/Magento/Persistent/Model/Session.php b/app/code/Magento/Persistent/Model/Session.php index 701b4fc21d29a..705f4491db12d 100644 --- a/app/code/Magento/Persistent/Model/Session.php +++ b/app/code/Magento/Persistent/Model/Session.php @@ -12,6 +12,7 @@ * @method int getCustomerId() * @method Session setCustomerId() * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) * @since 100.0.2 */ class Session extends \Magento\Framework\Model\AbstractModel @@ -391,7 +392,8 @@ private function setCookie($value, $duration, $path) ->setDuration($duration) ->setPath($path) ->setSecure($this->getRequest()->isSecure()) - ->setHttpOnly(true); + ->setHttpOnly(true) + ->setSameSite('Lax'); $this->_cookieManager->setPublicCookie( self::COOKIE_NAME, $value, diff --git a/app/code/Magento/Persistent/README.md b/app/code/Magento/Persistent/README.md index 7f6e8b3d0e974..d3f015bf29d53 100644 --- a/app/code/Magento/Persistent/README.md +++ b/app/code/Magento/Persistent/README.md @@ -1,5 +1,61 @@ -Magento\Persistent module enables set customer a long-term cookie containing internal id (random hash - to exclude brute -force) of persistent session. Persistent session data is kept in DB - so it's not deleted in some days and is kept for +# Magento_Persistent module + +This module enables setting a long-term cookie containing internal id (random hash - to exclude brute +force) of persistent session for customer. Persistent session data is kept in DB - so it's not deleted in some days and is kept for as much time as we need. DB session keeps customerId + some data from real customer session that we want to sync (e.g. num items in shopping cart). For registered customer this info is synced to persistent session if choose "Remember me" checkbox during first login. + +## Installation + +Before installing this module, note that the Magento_Persistent is dependent on the following modules: +- `Magento_Checkout` +- `Magento_PageCache` + +The Magento_Persistent module creates the `persistent_session` table in the database. + +This module modifies the following tables in the database: +- `quote` - adds column `is_persistent` + +All database schema changes made by this module are rolled back when the module gets disabled and setup:upgrade command is run. + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_Persistent module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Persistent module. + +A lot of functionality in the module is on JavaScript, use [mixins](https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/javascript/js_mixins.html) to extend it. + +### Events + +The module dispatches the following events: + +#### Controller + +- `persistent_session_expired` event in the `\Magento\Persistent\Controller\Index\UnsetCookie::execute` method + +#### Observer + +- `persistent_session_expired` event in the `\Magento\Persistent\Observer\CheckExpirePersistentQuoteObserver::execute` method + +For information about an event in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). + +### Layouts + +For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). + +## Additional information + +More information can get at articles: +- [Persistent Shopping Cart](https://docs.magento.com/user-guide/configuration/customers/persistent-shopping-cart.html) +- [Persistent Cart](https://docs.magento.com/user-guide/sales/cart-persistent.html) + +### Cron options + +Cron group configuration can be set at `etc/crontab.xml`: +- `persistent_clear_expired` - clear expired persistent sessions + +[Learn how to configure and run cron in Magento.](http://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html). diff --git a/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php b/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php index 2155192b04adc..d2abe6c184ed8 100644 --- a/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php +++ b/app/code/Magento/Persistent/Test/Unit/Model/SessionTest.php @@ -143,6 +143,9 @@ public function testSetPersistentCookie() $cookieMetadataMock->expects($this->once()) ->method('setHttpOnly') ->with(true)->willReturnSelf(); + $cookieMetadataMock->expects($this->once()) + ->method('setSameSite') + ->with('Lax')->willReturnSelf(); $this->cookieMetadataFactoryMock->expects($this->once()) ->method('createPublicCookieMetadata') ->willReturn($cookieMetadataMock); @@ -186,6 +189,9 @@ public function testRenewPersistentCookie( $cookieMetadataMock->expects($this->exactly($numCalls)) ->method('setHttpOnly') ->with(true)->willReturnSelf(); + $cookieMetadataMock->expects($this->exactly($numCalls)) + ->method('setSameSite') + ->with('Lax')->willReturnSelf(); $this->cookieMetadataFactoryMock->expects($this->exactly($numCalls)) ->method('createPublicCookieMetadata') ->willReturn($cookieMetadataMock); diff --git a/app/code/Magento/ProductAlert/Model/Observer.php b/app/code/Magento/ProductAlert/Model/Observer.php index addc61d2f49a9..17b026010fe4d 100644 --- a/app/code/Magento/ProductAlert/Model/Observer.php +++ b/app/code/Magento/ProductAlert/Model/Observer.php @@ -5,10 +5,27 @@ */ namespace Magento\ProductAlert\Model; +use Magento\Backend\App\Area\FrontNameResolver; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Helper\Data; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Mail\Template\TransportBuilder; +use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; +use Magento\Framework\Stdlib\DateTime\DateTimeFactory; +use Magento\Framework\Translate\Inline\StateInterface; +use Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory as StockCollectionFactory; +use Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory as PriceCollectionFactory; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Store\Model\Website; + /** * ProductAlert observer * - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Observer @@ -40,6 +57,11 @@ class Observer */ const XML_PATH_STOCK_ALLOW = 'catalog/productalert/allow_stock'; + /** + * Default value of bunch size to load alert items + */ + private const DEFAULT_BUNCH_SIZE = 10000; + /** * Website collection array * @@ -57,59 +79,59 @@ class Observer /** * Catalog data * - * @var \Magento\Catalog\Helper\Data + * @var Data */ protected $_catalogData = null; /** * Core store config * - * @var \Magento\Framework\App\Config\ScopeConfigInterface + * @var ScopeConfigInterface */ protected $_scopeConfig; /** - * @var \Magento\Store\Model\StoreManagerInterface + * @var StoreManagerInterface */ protected $_storeManager; /** - * @var \Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory + * @var PriceCollectionFactory */ protected $_priceColFactory; /** - * @var \Magento\Customer\Api\CustomerRepositoryInterface + * @var CustomerRepositoryInterface */ protected $customerRepository; /** - * @var \Magento\Catalog\Api\ProductRepositoryInterface + * @var ProductRepositoryInterface */ protected $productRepository; /** - * @var \Magento\Framework\Stdlib\DateTime\DateTimeFactory + * @var DateTimeFactory */ protected $_dateFactory; /** - * @var \Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory + * @var StockCollectionFactory */ protected $_stockColFactory; /** - * @var \Magento\Framework\Mail\Template\TransportBuilder + * @var TransportBuilder */ protected $_transportBuilder; /** - * @var \Magento\ProductAlert\Model\EmailFactory + * @var EmailFactory */ protected $_emailFactory; /** - * @var \Magento\Framework\Translate\Inline\StateInterface + * @var StateInterface */ protected $inlineTranslation; @@ -119,33 +141,40 @@ class Observer protected $productSalability; /** - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory $priceColFactory - * @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository - * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository - * @param \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory - * @param \Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory $stockColFactory - * @param \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder - * @param \Magento\ProductAlert\Model\EmailFactory $emailFactory - * @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation + * @var int + */ + private $bunchSize; + + /** + * @param Data $catalogData + * @param ScopeConfigInterface $scopeConfig + * @param StoreManagerInterface $storeManager + * @param PriceCollectionFactory $priceColFactory + * @param CustomerRepositoryInterface $customerRepository + * @param ProductRepositoryInterface $productRepository + * @param DateTimeFactory $dateFactory + * @param StockCollectionFactory $stockColFactory + * @param TransportBuilder $transportBuilder + * @param EmailFactory $emailFactory + * @param StateInterface $inlineTranslation * @param ProductSalability|null $productSalability + * @param int $bunchSize * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory $priceColFactory, - \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository, - \Magento\Catalog\Api\ProductRepositoryInterface $productRepository, - \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory, - \Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory $stockColFactory, - \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder, - \Magento\ProductAlert\Model\EmailFactory $emailFactory, - \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation, - ProductSalability $productSalability = null + Data $catalogData, + ScopeConfigInterface $scopeConfig, + StoreManagerInterface $storeManager, + PriceCollectionFactory $priceColFactory, + CustomerRepositoryInterface $customerRepository, + ProductRepositoryInterface $productRepository, + DateTimeFactory $dateFactory, + StockCollectionFactory $stockColFactory, + TransportBuilder $transportBuilder, + EmailFactory $emailFactory, + StateInterface $inlineTranslation, + ProductSalability $productSalability = null, + int $bunchSize = 0 ) { $this->_catalogData = $catalogData; $this->_scopeConfig = $scopeConfig; @@ -158,8 +187,9 @@ public function __construct( $this->_transportBuilder = $transportBuilder; $this->_emailFactory = $emailFactory; $this->inlineTranslation = $inlineTranslation; - $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); + $objectManager = ObjectManager::getInstance(); $this->productSalability = $productSalability ?: $objectManager->get(ProductSalability::class); + $this->bunchSize = $bunchSize ?: self::DEFAULT_BUNCH_SIZE; } /** @@ -184,32 +214,33 @@ protected function _getWebsites() /** * Process price emails * - * @param \Magento\ProductAlert\Model\Email $email + * @param Email $email * @return $this * @throws \Exception * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ - protected function _processPrice(\Magento\ProductAlert\Model\Email $email) + protected function _processPrice(Email $email) { $email->setType('price'); foreach ($this->_getWebsites() as $website) { - /* @var $website \Magento\Store\Model\Website */ + /* @var $website Website */ if (!$website->getDefaultGroup() || !$website->getDefaultGroup()->getDefaultStore()) { continue; } if (!$this->_scopeConfig->getValue( - self::XML_PATH_PRICE_ALLOW, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $website->getDefaultGroup()->getDefaultStore()->getId() - ) + self::XML_PATH_PRICE_ALLOW, + ScopeInterface::SCOPE_STORE, + $website->getDefaultGroup()->getDefaultStore()->getId() + ) ) { continue; } try { - $collection = $this->_priceColFactory->create()->addWebsiteFilter( - $website->getId() - )->setCustomerOrder(); + $collection = $this->_priceColFactory->create() + ->addWebsiteFilter($website->getId()) + ->setCustomerOrder() + ->addOrder('product_id'); } catch (\Exception $e) { $this->_errors[] = $e->getMessage(); throw $e; @@ -217,7 +248,7 @@ protected function _processPrice(\Magento\ProductAlert\Model\Email $email) $previousCustomer = null; $email->setWebsite($website); - foreach ($collection as $alert) { + foreach ($this->loadItems($collection, $this->bunchSize) as $alert) { $this->setAlertStoreId($alert, $email); try { if (!$previousCustomer || $previousCustomer->getId() != $alert->getCustomerId()) { @@ -274,36 +305,36 @@ protected function _processPrice(\Magento\ProductAlert\Model\Email $email) /** * Process stock emails * - * @param \Magento\ProductAlert\Model\Email $email + * @param Email $email * @return $this * @throws \Exception * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ - protected function _processStock(\Magento\ProductAlert\Model\Email $email) + protected function _processStock(Email $email) { $email->setType('stock'); foreach ($this->_getWebsites() as $website) { - /* @var $website \Magento\Store\Model\Website */ + /* @var $website Website */ if (!$website->getDefaultGroup() || !$website->getDefaultGroup()->getDefaultStore()) { continue; } if (!$this->_scopeConfig->getValue( self::XML_PATH_STOCK_ALLOW, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + ScopeInterface::SCOPE_STORE, $website->getDefaultGroup()->getDefaultStore()->getId() ) ) { continue; } try { - $collection = $this->_stockColFactory->create()->addWebsiteFilter( - $website->getId() - )->addStatusFilter( - 0 - )->setCustomerOrder(); + $collection = $this->_stockColFactory->create() + ->addWebsiteFilter($website->getId()) + ->addStatusFilter(0) + ->setCustomerOrder() + ->addOrder('product_id'); } catch (\Exception $e) { $this->_errors[] = $e->getMessage(); throw $e; @@ -311,7 +342,7 @@ protected function _processStock(\Magento\ProductAlert\Model\Email $email) $previousCustomer = null; $email->setWebsite($website); - foreach ($collection as $alert) { + foreach ($this->loadItems($collection, $this->bunchSize) as $alert) { $this->setAlertStoreId($alert, $email); try { if (!$previousCustomer || $previousCustomer->getId() != $alert->getCustomerId()) { @@ -374,7 +405,7 @@ protected function _sendErrorEmail() if (count($this->_errors)) { if (!$this->_scopeConfig->getValue( self::XML_PATH_ERROR_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ScopeInterface::SCOPE_STORE ) ) { return $this; @@ -385,24 +416,24 @@ protected function _sendErrorEmail() $transport = $this->_transportBuilder->setTemplateIdentifier( $this->_scopeConfig->getValue( self::XML_PATH_ERROR_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ScopeInterface::SCOPE_STORE ) )->setTemplateOptions( [ - 'area' => \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE, - 'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID, + 'area' => FrontNameResolver::AREA_CODE, + 'store' => Store::DEFAULT_STORE_ID, ] )->setTemplateVars( ['warnings' => join("\n", $this->_errors)] )->setFrom( $this->_scopeConfig->getValue( self::XML_PATH_ERROR_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ScopeInterface::SCOPE_STORE ) )->addTo( $this->_scopeConfig->getValue( self::XML_PATH_ERROR_RECIPIENT, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ScopeInterface::SCOPE_STORE ) )->getTransport(); @@ -421,7 +452,7 @@ protected function _sendErrorEmail() */ public function process() { - /* @var $email \Magento\ProductAlert\Model\Email */ + /* @var $email Email */ $email = $this->_emailFactory->create(); $this->_processPrice($email); $this->_processStock($email); @@ -433,11 +464,11 @@ public function process() /** * Set alert store id. * - * @param \Magento\ProductAlert\Model\Price|\Magento\ProductAlert\Model\Stock $alert + * @param Price|Stock $alert * @param Email $email * @return Observer */ - private function setAlertStoreId($alert, \Magento\ProductAlert\Model\Email $email) : Observer + private function setAlertStoreId($alert, Email $email): Observer { $alertStoreId = $alert->getStoreId(); if ($alertStoreId) { @@ -446,4 +477,26 @@ private function setAlertStoreId($alert, \Magento\ProductAlert\Model\Email $emai return $this; } + + /** + * Load items by bunch size + * + * @param AbstractCollection $collection + * @param int $bunchSize + * @return \Generator + */ + private function loadItems(AbstractCollection $collection, int $bunchSize): \Generator + { + $collection->setPageSize($bunchSize); + $pageCount = $collection->getLastPageNumber(); + $curPage = 1; + while ($curPage <= $pageCount) { + $collection->clear(); + $collection->setCurPage($curPage); + foreach ($collection as $item) { + yield $item; + } + $curPage++; + } + } } diff --git a/app/code/Magento/ProductAlert/README.md b/app/code/Magento/ProductAlert/README.md index 7d5f51e8699dd..27a747d6ed4c6 100644 --- a/app/code/Magento/ProductAlert/README.md +++ b/app/code/Magento/ProductAlert/README.md @@ -1 +1,47 @@ -The Magento_ProductAlert module enables product alerts, which allow customers to sign up for emails about product price or stock status change. +# Magento_ProductAlert module + +This module enables product alerts, which allow customers to sign up for emails about product price or stock status change. + +## Installation + +Before installing this module, note that the Magento_ProductAlert is dependent on the following modules: +- `Magento_Catalog` +- `Magento_Customer` + +The Magento_ProductAlert module creates the following tables in the database: +- `product_alert_price` +- `product_alert_stock` + +All database schema changes made by this module are rolled back when the module gets disabled and setup:upgrade command is run. + +The Magento_ProductAlert module contains the recurring script. Script's modifications don't need to be manually reverted upon uninstallation. + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_ProductAlert module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_ProductAlert module. + +### Layouts + +This module introduces the following layouts in the `view/frontend/layout` directory: +- `catalog_product_view` +- `productalert_unsubscribe_email` + +For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). + +## Additional information + +More information can get at articles: +- [Product Alerts](https://docs.magento.com/user-guide/catalog/inventory-product-alerts.html) +- [Product Alert Run Settings](https://docs.magento.com/user-guide/catalog/inventory-product-alert-run-settings.html) + +### Cron options + +Cron group configuration can be set at `etc/crontab.xml`: +- `catalog_product_alert` - send product alerts to customers + +[Learn how to configure and run cron in Magento.](http://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-cron.html). + diff --git a/app/code/Magento/ProductAlert/Test/Unit/Model/ObserverTest.php b/app/code/Magento/ProductAlert/Test/Unit/Model/ObserverTest.php index bc3ef7418320b..c66b73f68191a 100644 --- a/app/code/Magento/ProductAlert/Test/Unit/Model/ObserverTest.php +++ b/app/code/Magento/ProductAlert/Test/Unit/Model/ObserverTest.php @@ -21,6 +21,8 @@ use Magento\ProductAlert\Model\EmailFactory; use Magento\ProductAlert\Model\Observer; use Magento\ProductAlert\Model\ProductSalability; +USE Magento\ProductAlert\Model\ResourceModel\Price\Collection as PriceCollection; +USE Magento\ProductAlert\Model\ResourceModel\Stock\Collection as StockCollection; use Magento\Sitemap\Model\ResourceModel\Sitemap\Collection; use Magento\Sitemap\Model\ResourceModel\Sitemap\CollectionFactory; use Magento\Sitemap\Model\Sitemap; @@ -141,7 +143,12 @@ class ObserverTest extends TestCase private $productSalabilityMock; /** - * @return void + * @var int + */ + private $bunchSize = 100; + + /** + * @inheritdoc */ protected function setUp(): void { @@ -175,16 +182,12 @@ protected function setUp(): void $this->emailMock = $this->getMockBuilder(Email::class) ->disableOriginalConstructor() ->getMock(); - $this->priceColFactoryMock = $this->getMockBuilder( + $this->priceColFactoryMock = $this->createMock( \Magento\ProductAlert\Model\ResourceModel\Price\CollectionFactory::class - )->disableOriginalConstructor() - ->setMethods(['create', 'addWebsiteFilter', 'setCustomerOrder']) - ->getMock(); - $this->stockColFactoryMock = $this->getMockBuilder( + ); + $this->stockColFactoryMock = $this->createMock( \Magento\ProductAlert\Model\ResourceModel\Stock\CollectionFactory::class - )->disableOriginalConstructor() - ->setMethods(['create', 'addWebsiteFilter', 'setCustomerOrder', 'addStatusFilter']) - ->getMock(); + ); $this->websiteMock = $this->createPartialMock( Website::class, @@ -223,27 +226,32 @@ protected function setUp(): void 'stockColFactory' => $this->stockColFactoryMock, 'customerRepository' => $this->customerRepositoryMock, 'productRepository' => $this->productRepositoryMock, - 'productSalability' => $this->productSalabilityMock + 'productSalability' => $this->productSalabilityMock, + 'bunchSize' => $this->bunchSize ] ); } public function testGetWebsitesThrowsException() { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); + $message = 'get website exception'; + $this->expectException(\Exception::class); + $this->expectErrorMessage($message); + $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); - - $this->storeManagerMock->expects($this->once())->method('getWebsites')->willThrowException(new \Exception()); + $this->storeManagerMock->expects($this->once()) + ->method('getWebsites') + ->willThrowException(new \Exception($message)); $this->observer->process(); } public function testProcessPriceThrowsException() { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); + $message = 'create collection exception'; + $this->expectException(\Exception::class); + $this->expectErrorMessage($message); $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); @@ -253,46 +261,40 @@ public function testProcessPriceThrowsException() $this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(true); - $this->priceColFactoryMock->expects($this->once())->method('create')->willThrowException(new \Exception()); + $this->priceColFactoryMock->expects($this->once()) + ->method('create') + ->willThrowException(new \Exception($message)); $this->observer->process(); } public function testProcessPriceCustomerRepositoryThrowsException() { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); + $message = 'no such entity exception'; + $this->expectException(\Exception::class); + $this->expectErrorMessage($message); $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); - $this->storeManagerMock->expects($this->once())->method('getWebsites')->willReturn([$this->websiteMock]); - $this->websiteMock->expects($this->any())->method('getDefaultGroup')->willReturn($this->storeMock); - $this->storeMock->expects($this->any())->method('getDefaultStore')->willReturnSelf(); - + $this->websiteMock->method('getDefaultGroup')->willReturn($this->storeMock); + $this->storeMock->method('getDefaultStore')->willReturnSelf(); $this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(true); - $this->priceColFactoryMock->expects($this->once())->method('create')->willReturnSelf(); - $this->priceColFactoryMock->expects($this->once())->method('addWebsiteFilter')->willReturnSelf(); - $items = [ - new DataObject([ - 'customer_id' => '42' - ]) - ]; - - $this->priceColFactoryMock->expects($this->once()) - ->method('setCustomerOrder') - ->willReturn(new \ArrayIterator($items)); - - $this->customerRepositoryMock->expects($this->once())->method('getById')->willThrowException(new \Exception()); + $collectionMock = $this->createCollectionMock(PriceCollection::class); + $this->priceColFactoryMock->expects($this->once())->method('create')->willReturn($collectionMock); + $this->customerRepositoryMock->expects($this->once()) + ->method('getById') + ->willThrowException(new \Exception($message)); $this->observer->process(); } public function testProcessPriceEmailThrowsException() { - $this->expectException('Exception'); + $message = 'send exception'; + $this->expectException(\Exception::class); + $this->expectErrorMessage($message); $id = 1; - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); @@ -305,17 +307,8 @@ public function testProcessPriceEmailThrowsException() $this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(true); - $this->priceColFactoryMock->expects($this->once())->method('create')->willReturnSelf(); - $this->priceColFactoryMock->expects($this->once())->method('addWebsiteFilter')->willReturnSelf(); - $this->storeManagerMock->expects($this->any())->method('getStore')->willReturn($this->storeMock); - $items = [ - new DataObject([ - 'customer_id' => $id - ]) - ]; - $this->priceColFactoryMock->expects($this->once()) - ->method('setCustomerOrder') - ->willReturn(new \ArrayIterator($items)); + $collectionMock = $this->createCollectionMock(PriceCollection::class, $id); + $this->priceColFactoryMock->expects($this->once())->method('create')->willReturn($collectionMock); $customerMock = $this->getMockForAbstractClass(CustomerInterface::class); $this->customerRepositoryMock->expects($this->once())->method('getById')->willReturn($customerMock); @@ -324,15 +317,16 @@ public function testProcessPriceEmailThrowsException() $this->productMock->expects($this->once())->method('getFinalPrice')->willReturn('655.99'); $this->productRepositoryMock->expects($this->once())->method('getById')->willReturn($this->productMock); - $this->emailMock->expects($this->once())->method('send')->willThrowException(new \Exception()); + $this->emailMock->expects($this->once())->method('send')->willThrowException(new \Exception($message)); $this->observer->process(); } public function testProcessStockThrowsException() { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); + $message = 'create collection exception'; + $this->expectException(\Exception::class); + $this->expectErrorMessage($message); $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); @@ -343,15 +337,18 @@ public function testProcessStockThrowsException() $this->scopeConfigMock->expects($this->at(0))->method('getValue')->willReturn(false); $this->scopeConfigMock->expects($this->at(1))->method('getValue')->willReturn(true); - $this->stockColFactoryMock->expects($this->once())->method('create')->willThrowException(new \Exception()); + $this->stockColFactoryMock->expects($this->once()) + ->method('create') + ->willThrowException(new \Exception($message)); $this->observer->process(); } public function testProcessStockCustomerRepositoryThrowsException() { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); + $message = 'no such entity exception'; + $this->expectException(\Exception::class); + $this->expectErrorMessage($message); $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); @@ -362,28 +359,27 @@ public function testProcessStockCustomerRepositoryThrowsException() $this->scopeConfigMock->expects($this->at(0))->method('getValue')->willReturn(false); $this->scopeConfigMock->expects($this->at(1))->method('getValue')->willReturn(true); - $this->stockColFactoryMock->expects($this->once())->method('create')->willReturnSelf(); - $this->stockColFactoryMock->expects($this->once())->method('addWebsiteFilter')->willReturnSelf(); - $this->stockColFactoryMock->expects($this->once())->method('addStatusFilter')->willReturnSelf(); - $items = [ - new DataObject([ - 'customer_id' => '42' - ]) - ]; - - $this->stockColFactoryMock->expects($this->once()) + $collectionMock = $this->createCollectionMock(StockCollection::class); + $collectionMock->expects($this->once()) + ->method('addStatusFilter') + ->willReturnSelf(); + $collectionMock->expects($this->once()) ->method('setCustomerOrder') - ->willReturn(new \ArrayIterator($items)); + ->willReturnSelf(); + $this->stockColFactoryMock->expects($this->once())->method('create')->willReturn($collectionMock); - $this->customerRepositoryMock->expects($this->once())->method('getById')->willThrowException(new \Exception()); + $this->customerRepositoryMock->expects($this->once()) + ->method('getById') + ->willThrowException(new \Exception($message)); $this->observer->process(); } public function testProcessStockEmailThrowsException() { - $this->expectException('Exception'); - $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->willReturn(false); + $message = 'send exception'; + $this->expectException(\Exception::class); + $this->expectErrorMessage($message); $this->emailFactoryMock->expects($this->once())->method('create')->willReturn($this->emailMock); @@ -396,18 +392,14 @@ public function testProcessStockEmailThrowsException() $this->scopeConfigMock->expects($this->at(0))->method('getValue')->willReturn(false); $this->scopeConfigMock->expects($this->at(1))->method('getValue')->willReturn(true); - $this->stockColFactoryMock->expects($this->once())->method('create')->willReturnSelf(); - $this->stockColFactoryMock->expects($this->once())->method('addWebsiteFilter')->willReturnSelf(); - $this->stockColFactoryMock->expects($this->once())->method('addStatusFilter')->willReturnSelf(); - $items = [ - new DataObject([ - 'customer_id' => '42' - ]) - ]; - - $this->stockColFactoryMock->expects($this->once()) + $collectionMock = $this->createCollectionMock(StockCollection::class); + $collectionMock->expects($this->once()) + ->method('addStatusFilter') + ->willReturnSelf(); + $collectionMock->expects($this->once()) ->method('setCustomerOrder') - ->willReturn(new \ArrayIterator($items)); + ->willReturnSelf(); + $this->stockColFactoryMock->expects($this->once())->method('create')->willReturn($collectionMock); $customerMock = $this->getMockForAbstractClass(CustomerInterface::class); $this->customerRepositoryMock->expects($this->once())->method('getById')->willReturn($customerMock); @@ -416,8 +408,48 @@ public function testProcessStockEmailThrowsException() $this->productSalabilityMock->expects($this->once())->method('isSalable')->willReturn(false); $this->productRepositoryMock->expects($this->once())->method('getById')->willReturn($this->productMock); - $this->emailMock->expects($this->once())->method('send')->willThrowException(new \Exception()); + $this->emailMock->expects($this->once())->method('send')->willThrowException(new \Exception($message)); $this->observer->process(); } + + /** + * Create mock for collection + * + * @param string $type + * @param int $customerId + * @return MockObject + */ + private function createCollectionMock(string $type, int $customerId = 1): MockObject + { + $items = [ + new DataObject(['customer_id' => $customerId]) + ]; + $collectionMock = $this->createMock($type); + $collectionMock->expects($this->once()) + ->method('addWebsiteFilter') + ->willReturnSelf(); + $collectionMock->expects($this->once()) + ->method('setCustomerOrder') + ->willReturnSelf(); + $collectionMock->expects($this->once()) + ->method('addOrder') + ->with('product_id') + ->willReturnSelf(); + $collectionMock->expects($this->once()) + ->method('setPageSize') + ->with($this->bunchSize) + ->willReturnSelf(); + $collectionMock->method('getLastPageNumber') + ->willReturn(1); + $collectionMock->expects($this->once()) + ->method('clear'); + $collectionMock->expects($this->once()) + ->method('setCurPage') + ->with(1); + $collectionMock->method('getIterator') + ->willReturn(new \ArrayIterator($items)); + + return $collectionMock; + } } diff --git a/app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php b/app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php index 914b5fa271717..dae322fbff3bc 100644 --- a/app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php +++ b/app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php @@ -180,7 +180,8 @@ protected function appendResultSaveRemoteImage($fileName) $result['name'] = $fileInfo['basename']; $result['type'] = $this->imageAdapter->getMimeType(); $result['error'] = 0; - $result['size'] = filesize($this->appendAbsoluteFileSystemPath($fileName)); + $result['size'] = $this->fileSystem->getDirectoryWrite(DirectoryList::MEDIA) + ->getDriver()->stat(($this->appendAbsoluteFileSystemPath($fileName)))['size']; $result['url'] = $this->mediaConfig->getTmpMediaUrl($tmpFileName); $result['file'] = $tmpFileName; return $result; diff --git a/app/code/Magento/ProductVideo/README.md b/app/code/Magento/ProductVideo/README.md index e94e5aba8aba7..76a8036e9c3c7 100644 --- a/app/code/Magento/ProductVideo/README.md +++ b/app/code/Magento/ProductVideo/README.md @@ -1 +1,46 @@ -The Magento_ProductVideo module implements functionality related with linking video files from external resources to product. +# Magento_ProductVideo module + +This module implements functionality related with linking video files from external resources to product. + +## Installation + +Before installing this module, note that the Magento_ProductAlert is dependent on the following modules: +- `Magento_Catalog` +- `Magento_Backend` + +The Magento_ProductVideo module creates the `catalog_product_entity_media_gallery_value_video` table in the database. + +All database schema changes made by this module are rolled back when the module gets disabled and setup:upgrade command is run. + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_ProductVideo module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_ProductVideo module. + +A lot of functionality in the module is on JavaScript, use [mixins](https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/javascript/js_mixins.html) to extend it. + +### Layouts + +This module introduces the following layouts in the `view/frontend/layout` and `view/adminhtml/layout` directories: +- `view/adminhtml/layout` + - `catalog_product_new` +- `view/frontend/layout` + - `catalog_product_view` + +For more information about a layout in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-overview.html). + +### UI components + +This module extends following ui components located in the `view/adminhtml/ui_component` directory: +- `product_form` + +For information about a UI component in Magento 2, see [Overview of UI components](http://devdocs.magento.com/guides/v2.4/ui_comp_guide/bk-ui_comps.html). + +## Additional information + +More information can get at articles: +- [Learn how to add Product Video](https://docs.magento.com/user-guide/catalog/product-video.html) +- [Learn how to configure Product Video](https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/product-video.html) diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNavigationArrowsActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNavigationArrowsActionGroup.xml index d0673dfc1adb7..72627f7e8dfee 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNavigationArrowsActionGroup.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNavigationArrowsActionGroup.xml @@ -18,25 +18,28 @@ </arguments> <dontSeeElement selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="dontSeePrevButton"/> - <moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOverImage"/> - <seeElement selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="seeNextButton"/> + <moveMouseOver selector="{{StorefrontProductInfoMainSection.clickPlayVideo}}" stepKey="hoverOverImage"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="seeNextButton"/> <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickNextButton"/> - <seeElement selector="{{StorefrontProductInfoMainSection.productVideo(videoType)}}" stepKey="seeProductVideoDataType"/> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productVideo(videoType)}}" stepKey="seeProductVideoDataType"/> <dontSeeElement selector="{{StorefrontProductInfoMainSection.clickCloseVideo}}" stepKey="dontSeeCloseVideo"/> <click selector="{{StorefrontProductInfoMainSection.clickPlayVideo}}" stepKey="clickToPlayVideo"/> - <wait stepKey="waitFiveSecondsToPlayVideo" time="5"/> + <wait time="5" stepKey="waitFiveSecondsToPlayVideo"/> <dontSeeElement selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="dontSeePrevButtonSecond"/> <dontSeeElement selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="dontSeeNextButton"/> <seeElement selector="{{StorefrontProductInfoMainSection.clickCloseVideo}}" stepKey="seeCloseVideo"/> <click selector="{{StorefrontProductInfoMainSection.clickCloseVideo}}" stepKey="clickToCloseVideo"/> - <wait stepKey="waitTwoSecondsToCloseVideo" time="2"/> + <wait time="2" stepKey="waitTwoSecondsToCloseVideo"/> + <dontSeeElementInDOM selector="{{StorefrontProductMediaSection.galleryNoControlsElement}}" stepKey="videoFocused"/> + <moveMouseOver selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="unFocusVideo"/> + <waitForElement selector="{{StorefrontProductMediaSection.galleryNoControlsElement}}" stepKey="waitForVideoUnFocus"/> - <moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOverImageSecond"/> - <seeElement selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="seePrevButton"/> + <moveMouseOver selector="{{StorefrontProductInfoMainSection.clickPlayVideo}}" stepKey="hoverOverImageSecond"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="seePrevButton"/> <click selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="clickPrevButton"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml index cc2c933812352..3bc76cbc9c5b1 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml @@ -53,7 +53,7 @@ <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveFirstProduct"/> <!-- Assert product video in storefront product page --> - <amOnPage url="$$createProduct.name$$.html" stepKey="goToStorefrontCategoryPage"/> + <amOnPage url="$$createProduct.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded"/> <actionGroup ref="AssertProductVideoStorefrontProductPageActionGroup" stepKey="assertProductVideoStorefrontProductPage" after="waitForStorefrontPageLoaded"/> diff --git a/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php b/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php index 770eaf1d3d342..61369502bcb50 100644 --- a/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php +++ b/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php @@ -10,6 +10,7 @@ use Magento\Backend\App\Action\Context; use Magento\Catalog\Model\Product\Media\Config; use Magento\Framework\App\RequestInterface; +use Magento\Framework\Controller\Result\Raw; use Magento\Framework\Controller\Result\RawFactory; use Magento\Framework\DataObject; use Magento\Framework\Filesystem; @@ -99,6 +100,11 @@ class RetrieveImageTest extends TestCase */ private $fileDriverMock; + /** + * @var Raw|MockObject + */ + private $responseMock; + private function setupObjectManagerForCheckImageExist($return) { $objectManagerMock = $this->getMockForAbstractClass(ObjectManagerInterface::class); @@ -119,8 +125,8 @@ protected function setUp(): void ->createMock(NotProtectedExtension::class); $this->rawFactoryMock = $this->createPartialMock(RawFactory::class, ['create']); - $response = new DataObject(); - $this->rawFactoryMock->expects($this->once())->method('create')->willReturn($response); + $this->responseMock = $this->createMock(Raw::class); + $this->rawFactoryMock->expects($this->once())->method('create')->willReturn($this->responseMock); $this->configMock = $this->createMock(Config::class); $this->filesystemMock = $this->createMock(Filesystem::class); $this->adapterMock = @@ -140,6 +146,8 @@ protected function setUp(): void ->getMockForAbstractClass(); $this->contextMock->expects($this->any())->method('getRequest')->willReturn($this->request); $this->contextMock->expects($this->any())->method('getObjectManager')->willReturn($managerMock); + $this->fileDriverMock->method('stat') + ->willReturn(['size' => 200]); $this->image = $objectManager->getObject( RetrieveImage::class, @@ -172,12 +180,24 @@ public function testExecute() $writeInterface = $this->createMock( WriteInterface::class ); + $writeInterface->method('getDriver') + ->willReturn($this->fileDriverMock); $this->filesystemMock->expects($this->any())->method('getDirectoryRead')->willReturn($readInterface); $readInterface->expects($this->any())->method('getAbsolutePath')->willReturn(''); $this->abstractAdapter->expects($this->any())->method('validateUploadFile')->willReturn('true'); $this->validatorMock->expects($this->once())->method('isValid')->with('jpg')->willReturn('true'); $this->filesystemMock->expects($this->once())->method('getDirectoryWrite')->willReturn($writeInterface); $this->curlMock->expects($this->once())->method('read')->willReturn('testimage'); + $this->responseMock->expects(self::once()) + ->method('setContents') + ->with(json_encode([ + 'name' => 'test.jpg', + 'type' => null, + 'error' => 0, + 'size' => 200, + 'url' => null, + 'file' => '/t/e/test.jpg' + ], JSON_THROW_ON_ERROR)); $this->image->execute(); } @@ -192,6 +212,8 @@ public function testExecuteInvalidFileImage() ); $readInterface = $this->createMock(ReadInterface::class); $writeInterface = $this->createMock(WriteInterface::class); + $writeInterface->method('getDriver') + ->willReturn($this->fileDriverMock); $this->filesystemMock->expects($this->any())->method('getDirectoryRead')->willReturn($readInterface); $readInterface->expects($this->any())->method('getAbsolutePath')->willReturn(''); $this->abstractAdapter->expects($this->any()) @@ -216,6 +238,8 @@ public function testExecuteInvalidFileType() ); $readInterface = $this->createMock(ReadInterface::class); $writeInterface = $this->createMock(WriteInterface::class); + $writeInterface->method('getDriver') + ->willReturn($this->fileDriverMock); $this->filesystemMock->expects($this->any())->method('getDirectoryRead')->willReturn($readInterface); $readInterface->expects($this->any())->method('getAbsolutePath')->willReturn(''); $this->abstractAdapter->expects($this->never())->method('validateUploadFile'); diff --git a/app/code/Magento/ProductVideo/etc/csp_whitelist.xml b/app/code/Magento/ProductVideo/etc/csp_whitelist.xml index 2e091440330b7..dd5cdc37496e0 100644 --- a/app/code/Magento/ProductVideo/etc/csp_whitelist.xml +++ b/app/code/Magento/ProductVideo/etc/csp_whitelist.xml @@ -10,8 +10,8 @@ <policies> <policy id="script-src"> <values> - <value id="youtube_cdn" type="host">s.ytimg.com</value> - <value id="google_video" type="host">www.googleapis.com</value> + <value id="youtube_script" type="host">s.ytimg.com</value> + <value id="google_apis" type="host">www.googleapis.com</value> <value id="vimeo" type="host">vimeo.com</value> <value id="www_vimeo" type="host">www.vimeo.com</value> <value id="vimeo_cdn" type="host">*.vimeocdn.com</value> @@ -20,11 +20,13 @@ <policy id="img-src"> <values> <value id="vimeo_cdn" type="host">*.vimeocdn.com</value> + <value id="youtube_image" type="host">i.ytimg.com</value> </values> </policy> <policy id="frame-src"> <values> <value id="player_vimeo" type="host">player.vimeo.com</value> + <value id="player_youtube" type="host">*.youtube.com</value> </values> </policy> </policies> diff --git a/app/code/Magento/ProductVideo/etc/db_schema.xml b/app/code/Magento/ProductVideo/etc/db_schema.xml index aa3dff4a27989..a0fbb8e70d7ff 100644 --- a/app/code/Magento/ProductVideo/etc/db_schema.xml +++ b/app/code/Magento/ProductVideo/etc/db_schema.xml @@ -25,7 +25,7 @@ <constraint xsi:type="foreign" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_STORE_STORE_ID" table="catalog_product_entity_media_gallery_value_video" column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/> - <constraint xsi:type="unique" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID"> + <constraint xsi:type="primary" referenceId="CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID"> <column name="value_id"/> <column name="store_id"/> </constraint> diff --git a/app/code/Magento/ProductVideo/etc/db_schema_whitelist.json b/app/code/Magento/ProductVideo/etc/db_schema_whitelist.json index 78fa6538da07c..8515dfa1e55b8 100644 --- a/app/code/Magento/ProductVideo/etc/db_schema_whitelist.json +++ b/app/code/Magento/ProductVideo/etc/db_schema_whitelist.json @@ -10,9 +10,10 @@ "metadata": true }, "constraint": { + "PRIMARY": true, "FK_6FDF205946906B0E653E60AA769899F8": true, "CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_STORE_STORE_ID": true, "CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID": true } } -} \ No newline at end of file +} diff --git a/app/code/Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml b/app/code/Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml index b75b59eeacce2..bfb1be1f978b4 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml +++ b/app/code/Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** * @var $block \Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery\Content * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer diff --git a/app/code/Magento/ProductVideo/view/adminhtml/templates/product/edit/base_image.phtml b/app/code/Magento/ProductVideo/view/adminhtml/templates/product/edit/base_image.phtml index 8c40c174c9787..91d5a27813089 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/templates/product/edit/base_image.phtml +++ b/app/code/Magento/ProductVideo/view/adminhtml/templates/product/edit/base_image.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> <div class="row"> diff --git a/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js b/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js index 4b3c1b7f8eec3..ee3a3db0621b3 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js +++ b/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js @@ -289,10 +289,10 @@ define([ * @private */ destroy: function () { - this.stop(); - if (this._player) { + this.stop(); this._player.destroy(); + this._player = undefined; } } }); diff --git a/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js b/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js index bfd685543d7f7..151c5196db25f 100644 --- a/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js +++ b/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js @@ -138,10 +138,9 @@ define([ * @private */ _create: function () { - $(this.element).on('gallery:loaded', $.proxy(function () { - this.fotoramaItem = $(this.element).find('.fotorama-item'); - this._initialize(); - }, this)); + $(this.element).data('gallery') ? + this._onGalleryLoaded() : + $(this.element).on('gallery:loaded', this._onGalleryLoaded.bind(this)); }, /** @@ -171,6 +170,14 @@ define([ } }, + /** + * Callback which fired after gallery gets initialized. + */ + _onGalleryLoaded: function () { + this.fotoramaItem = $(this.element).find('.fotorama-item'); + this._initialize(); + }, + /** * Clear gallery events to prevent duplicated calls. * diff --git a/app/code/Magento/Quote/Model/Cart/ShippingMethodConverter.php b/app/code/Magento/Quote/Model/Cart/ShippingMethodConverter.php index 16d53c58d42ef..3fbba1f047336 100644 --- a/app/code/Magento/Quote/Model/Cart/ShippingMethodConverter.php +++ b/app/code/Magento/Quote/Model/Cart/ShippingMethodConverter.php @@ -23,6 +23,11 @@ class ShippingMethodConverter */ protected $taxHelper; + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + private $storeManager; + /** * Constructs a shipping method converter object. * diff --git a/app/code/Magento/Quote/Model/GuestCart/GuestBillingAddressManagement.php b/app/code/Magento/Quote/Model/GuestCart/GuestBillingAddressManagement.php index 3de2e0c3ff3fc..3e491e0b1a24d 100644 --- a/app/code/Magento/Quote/Model/GuestCart/GuestBillingAddressManagement.php +++ b/app/code/Magento/Quote/Model/GuestCart/GuestBillingAddressManagement.php @@ -46,7 +46,7 @@ public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $addres { /** @var $quoteIdMask QuoteIdMask */ $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id'); - return $this->billingAddressManagement->assign($quoteIdMask->getQuoteId(), $address, $useForShipping); + return (int)$this->billingAddressManagement->assign($quoteIdMask->getQuoteId(), $address, $useForShipping); } /** diff --git a/app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php b/app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php index 3ce148ee80b8c..aef9fb04c19ae 100644 --- a/app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php +++ b/app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php @@ -71,15 +71,14 @@ public function collect( $address->setItemQty($data['addressQty']); $address->setWeight($data['addressWeight']); $address->setFreeMethodWeight($data['freeMethodWeight']); - $addressFreeShipping = (bool)$address->getFreeShipping(); + $isFreeShipping = $this->freeShipping->isFreeShipping($quote, $shippingAssignment->getItems()); $address->setFreeShipping($isFreeShipping); - if (!$addressFreeShipping && $isFreeShipping) { - $data = $this->getAssignmentWeightData($address, $shippingAssignment->getItems()); - $address->setItemQty($data['addressQty']); - $address->setWeight($data['addressWeight']); - $address->setFreeMethodWeight($data['freeMethodWeight']); - } + // recalculate weights + $data = $this->getAssignmentWeightData($address, $shippingAssignment->getItems()); + $address->setItemQty($data['addressQty']); + $address->setWeight($data['addressWeight']); + $address->setFreeMethodWeight($data['freeMethodWeight']); $address->collectShippingRates(); diff --git a/app/code/Magento/Quote/Model/Quote/Item.php b/app/code/Magento/Quote/Model/Quote/Item.php index 22554380ca61e..580aafb15aed4 100644 --- a/app/code/Magento/Quote/Model/Quote/Item.php +++ b/app/code/Magento/Quote/Model/Quote/Item.php @@ -9,6 +9,8 @@ use Magento\Framework\Api\AttributeValueFactory; use Magento\Framework\Api\ExtensionAttributesFactory; +use Magento\Framework\App\ObjectManager; +use Magento\Quote\Model\Quote\Item\Option\ComparatorInterface; /** * Sales Quote Item Model @@ -184,6 +186,13 @@ class Item extends \Magento\Quote\Model\Quote\Item\AbstractItem implements \Mage */ private $serializer; + /** + * Item options comparator + * + * @var ComparatorInterface + */ + private $itemOptionComparator; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -196,11 +205,12 @@ class Item extends \Magento\Quote\Model\Quote\Item\AbstractItem implements \Mage * @param Item\OptionFactory $itemOptionFactory * @param Item\Compare $quoteItemCompare * @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry - * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource - * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection + * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource + * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection * @param array $data * - * @param \Magento\Framework\Serialize\Serializer\Json $serializer + * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer + * @param ComparatorInterface|null $itemOptionComparator * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -218,15 +228,18 @@ public function __construct( \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [], - \Magento\Framework\Serialize\Serializer\Json $serializer = null + \Magento\Framework\Serialize\Serializer\Json $serializer = null, + ?ComparatorInterface $itemOptionComparator = null ) { $this->_errorInfos = $statusListFactory->create(); $this->_localeFormat = $localeFormat; $this->_itemOptionFactory = $itemOptionFactory; $this->quoteItemCompare = $quoteItemCompare; $this->stockRegistry = $stockRegistry; - $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance() + $this->serializer = $serializer ?: ObjectManager::getInstance() ->get(\Magento\Framework\Serialize\Serializer\Json::class); + $this->itemOptionComparator = $itemOptionComparator + ?: ObjectManager::getInstance()->get(ComparatorInterface::class); parent::__construct( $context, $registry, @@ -500,7 +513,9 @@ public function compareOptions($options1, $options2) if (in_array($code, $this->_notRepresentOptions)) { continue; } - if (!isset($options2[$code]) || $options2[$code]->getValue() != $option->getValue()) { + if (!isset($options2[$code]) + || !$this->itemOptionComparator->compare($options2[$code], $option) + ) { return false; } } diff --git a/app/code/Magento/Quote/Model/Quote/Item/Option/Comparator.php b/app/code/Magento/Quote/Model/Quote/Item/Option/Comparator.php new file mode 100644 index 0000000000000..2f683c7e57dc9 --- /dev/null +++ b/app/code/Magento/Quote/Model/Quote/Item/Option/Comparator.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Model\Quote\Item\Option; + +use InvalidArgumentException; +use Magento\Framework\DataObject; + +/** + * Quote item options comparator + */ +class Comparator implements ComparatorInterface +{ + /** + * @var ComparatorInterface[] + */ + private $customComparators; + + /** + * @param ComparatorInterface[] $customComparators + */ + public function __construct( + array $customComparators = [] + ) { + foreach ($customComparators as $comparator) { + if (!$comparator instanceof ComparatorInterface) { + throw new InvalidArgumentException( + sprintf( + '%s must implement %s', + get_class($comparator), + ComparatorInterface::class + ) + ); + } + } + $this->customComparators = $customComparators; + } + + /** + * @inheritdoc + */ + public function compare( + DataObject $option1, + DataObject $option2 + ): bool { + if ($option1->getCode() === $option2->getCode()) { + return isset($this->customComparators[$option1->getCode()]) + ? $this->customComparators[$option1->getCode()]->compare($option1, $option2) + : $option1->getValue() == $option2->getValue(); + } + + return false; + } +} diff --git a/app/code/Magento/Quote/Model/Quote/Item/Option/ComparatorInterface.php b/app/code/Magento/Quote/Model/Quote/Item/Option/ComparatorInterface.php new file mode 100644 index 0000000000000..b76fcffa2340a --- /dev/null +++ b/app/code/Magento/Quote/Model/Quote/Item/Option/ComparatorInterface.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Model\Quote\Item\Option; + +use Magento\Framework\DataObject; + +/** + * Quote item options comparator + */ +interface ComparatorInterface +{ + /** + * Compare two quote item options + * + * @param DataObject $option1 + * @param DataObject $option2 + * @return bool + */ + public function compare(DataObject $option1, DataObject $option2): bool; +} diff --git a/app/code/Magento/Quote/Model/ResourceModel/Quote/Address/Rate/Collection.php b/app/code/Magento/Quote/Model/ResourceModel/Quote/Address/Rate/Collection.php index 02839648f7061..4e0650de24852 100644 --- a/app/code/Magento/Quote/Model/ResourceModel/Quote/Address/Rate/Collection.php +++ b/app/code/Magento/Quote/Model/ResourceModel/Quote/Address/Rate/Collection.php @@ -19,6 +19,11 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\VersionContro */ protected $_allowFixedOnly = false; + /** + * @var \Magento\Shipping\Model\CarrierFactoryInterface + */ + private $_carrierFactory; + /** * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory * @param \Psr\Log\LoggerInterface $logger diff --git a/app/code/Magento/Quote/Model/ResourceModel/Quote/Item.php b/app/code/Magento/Quote/Model/ResourceModel/Quote/Item.php index 59cda0442af82..2430b733501a1 100644 --- a/app/code/Magento/Quote/Model/ResourceModel/Quote/Item.php +++ b/app/code/Magento/Quote/Model/ResourceModel/Quote/Item.php @@ -5,7 +5,9 @@ */ namespace Magento\Quote\Model\ResourceModel\Quote; +use Magento\Framework\Model\AbstractModel; use Magento\Framework\Model\ResourceModel\Db\VersionControl\AbstractDb; +use Magento\Quote\Model\Quote\Item\Option; /** * Quote resource model @@ -27,19 +29,39 @@ protected function _construct() /** * {@inheritdoc} */ - public function save(\Magento\Framework\Model\AbstractModel $object) + public function save(AbstractModel $object) { $hasDataChanges = $this->isModified($object); $object->setIsOptionsSaved(false); $result = parent::save($object); - if ($hasDataChanges && !$object->isOptionsSaved()) { + if (!$object->isOptionsSaved() && ($hasDataChanges || $this->hasOptionsChanged($object))) { $object->saveItemOptions(); } return $result; } + /** + * Check if quote item options have changed. + * + * @param AbstractModel $object + * @return bool + */ + private function hasOptionsChanged(AbstractModel $object): bool + { + $hasDataChanges = false; + $options = $object->getOptions() ?? []; + foreach ($options as $option) { + /** @var Option $option */ + if (!$option->getId() || $option->getResource()->hasDataChanged($option)) { + $hasDataChanges = true; + break; + } + } + return $hasDataChanges; + } + /** * {@inheritdoc} */ diff --git a/app/code/Magento/Quote/Observer/SendInvoiceEmailObserver.php b/app/code/Magento/Quote/Observer/SendInvoiceEmailObserver.php new file mode 100644 index 0000000000000..4e1f378215077 --- /dev/null +++ b/app/code/Magento/Quote/Observer/SendInvoiceEmailObserver.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Observer; + +use Magento\Framework\Event\Observer; +use Magento\Framework\Event\ObserverInterface; +use Magento\Quote\Model\Quote; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Email\Container\InvoiceIdentity; +use Magento\Sales\Model\Order\Email\Sender\InvoiceSender; +use Psr\Log\LoggerInterface; + +/** + * Class responsive for sending invoice emails when order created through storefront. + */ +class SendInvoiceEmailObserver implements ObserverInterface +{ + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @var InvoiceSender + */ + private $invoiceSender; + + /** + * @var InvoiceIdentity + */ + private $invoiceIdentity; + + /** + * @param LoggerInterface $logger + * @param InvoiceSender $invoiceSender + * @param InvoiceIdentity $invoiceIdentity + */ + public function __construct( + LoggerInterface $logger, + InvoiceSender $invoiceSender, + InvoiceIdentity $invoiceIdentity + ) { + $this->logger = $logger; + $this->invoiceSender = $invoiceSender; + $this->invoiceIdentity = $invoiceIdentity; + } + + /** + * Send invoice email if allowed. + * + * @param Observer $observer + * + * @return void + */ + public function execute(Observer $observer) + { + if (!$this->isInvoiceEmailAllowed()) { + return; + } + + /** @var Quote $quote */ + $quote = $observer->getEvent()->getQuote(); + /** @var Order $order */ + $order = $observer->getEvent()->getOrder(); + + /** + * a flag to set that there will be redirect to third party after confirmation + */ + $redirectUrl = $quote->getPayment()->getOrderPlaceRedirectUrl(); + if (!$redirectUrl && $order->getCanSendNewEmailFlag()) { + try { + $invoice = current($order->getInvoiceCollection()->getItems()); + if ($invoice) { + $this->invoiceSender->send($invoice); + } + } catch (\Throwable $e) { + $this->logger->critical($e); + } + } + } + + /** + * Is invoice email sending enabled + * + * @return bool + */ + private function isInvoiceEmailAllowed(): bool + { + return $this->invoiceIdentity->isEnabled(); + } +} diff --git a/app/code/Magento/Quote/Observer/SubmitObserver.php b/app/code/Magento/Quote/Observer/SubmitObserver.php index db0ba7fb77937..c67d310597b0f 100644 --- a/app/code/Magento/Quote/Observer/SubmitObserver.php +++ b/app/code/Magento/Quote/Observer/SubmitObserver.php @@ -9,12 +9,11 @@ use Magento\Framework\Event\ObserverInterface; use Magento\Quote\Model\Quote; use Magento\Sales\Model\Order; -use Magento\Sales\Model\Order\Email\Sender\InvoiceSender; use Magento\Sales\Model\Order\Email\Sender\OrderSender; use Psr\Log\LoggerInterface; /** - * Class responsive for sending order and invoice emails when it's created through storefront. + * Class responsive for sending order emails when it's created through storefront. */ class SubmitObserver implements ObserverInterface { @@ -28,28 +27,20 @@ class SubmitObserver implements ObserverInterface */ private $orderSender; - /** - * @var InvoiceSender - */ - private $invoiceSender; - /** * @param LoggerInterface $logger * @param OrderSender $orderSender - * @param InvoiceSender $invoiceSender */ public function __construct( LoggerInterface $logger, - OrderSender $orderSender, - InvoiceSender $invoiceSender + OrderSender $orderSender ) { $this->logger = $logger; $this->orderSender = $orderSender; - $this->invoiceSender = $invoiceSender; } /** - * Send order and invoice email. + * Send order email. * * @param Observer $observer * @@ -69,11 +60,7 @@ public function execute(Observer $observer) if (!$redirectUrl && $order->getCanSendNewEmailFlag()) { try { $this->orderSender->send($order); - $invoice = current($order->getInvoiceCollection()->getItems()); - if ($invoice) { - $this->invoiceSender->send($invoice); - } - } catch (\Exception $e) { + } catch (\Throwable $e) { $this->logger->critical($e); } } diff --git a/app/code/Magento/Quote/README.md b/app/code/Magento/Quote/README.md index 0a026ca9108a1..a40884aa98e0d 100644 --- a/app/code/Magento/Quote/README.md +++ b/app/code/Magento/Quote/README.md @@ -1,11 +1,297 @@ -# Overview -## Purpose of module +# Magento_Quote module +This module provides customer cart management functionality. -# Deployment -## System requirements +## Installation -The Magento_Quote module does not have any specific system requirements. +The Magento_Quote module is one of the base Magento 2 modules. You cannot disable or uninstall this module. + +The Magento_Quote module creates the following table in the database: +- `quote` +- `quote_address` +- `quote_item` +- `quote_address_item` +- `quote_item_option` +- `quote_payment` +- `quote_shipping_rate` +- `quote_id_mask` + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Extensibility + +Extension developers can interact with the Magento_Quote module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Quote module. + +### Events + +The module dispatches the following events: +- `sales_quote_address_collection_load_after` event in the `\Magento\Quote\Model\ResourceModel\Quote\Address\Collection::_afterLoad` method. Parameters: + - `quote_address_collection` is a `$this` object (`Magento\Quote\Model\ResourceModel\Quote\Address\Collection` class) + +- `items_additional_data` event in the `\Magento\Quote\Model\Cart\Totals\ItemConverter::modelToDataObject` method. Parameters: + - `item` is a quote_item object (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_remove_item` event in the `\Magento\Quote\Model\Quote::removeItem` method. Parameters: + - `quote_item` is a quote_item object (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_add_item` event in the `\Magento\Quote\Model\Quote::addItem` method. Parameters: + - `quote_item` is a quote_item object (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_product_add_after` event in the `\Magento\Quote\Model\Quote::addProduct` method. Parameters: + - `items` is an array with quot_item objects (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_merge_before` event in the `\Magento\Quote\Model\Quote::merge` method. Parameters: + - `quote` is a `$this` object (`\Magento\Quote\Model\Quote` class) + - `source` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_quote_merge_after` event in the `\Magento\Quote\Model\Quote::merge` method. Parameters: + - `quote` is a `$this` object (`\Magento\Quote\Model\Quote` class) + - `source` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_convert_quote_to_order` event in the `\Magento\Quote\Model\Quote\Address\ToOrder::convert` method. Parameters: + - `order` is an order object (`\Magento\Sales\Model\Order` class) + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_quote_item_qty_set_after` event in the `\Magento\Quote\Model\Quote\Item::setQty` method. Parameters: + - `item` is a `$this` object (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_item_set_product` event in the `\Magento\Quote\Model\Quote\Item::setProduct` method. Parameters: + - `product` is a product object (`\Magento\Catalog\Model\Product` class) + - `quote_item` is a `$this` object (`\Magento\Quote\Model\Quote\Item` class) + +- `sales_quote_payment_import_data_before` event in the `\Magento\Quote\Model\Quote\Payment::importData` method. Parameters: + - `payment` is a `$this` object (`\Magento\Quote\Model\Quote\Payment` class) + - `input` is a data object (`\Magento\Framework\DataObject` class) + +- `sales_quote_collect_totals_before` event in the `\Magento\Quote\Model\Quote\TotalsCollector::collect` method. Parameters: + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_quote_collect_totals_after` event in the `\Magento\Quote\Model\Quote\TotalsCollector::collect` method. Parameters: + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_quote_address_collect_totals_before` event in the `\Magento\Quote\Model\Quote\TotalsCollector::collectAddressTotals` method. Parameters: + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + - `shipping_assignment` is a shipping_assignment object (`\Magento\Quote\Model\ShippingAssignment` class) + - `total` is a total object (`\Magento\Quote\Model\Quote\Address\Total` class) + +- `sales_quote_address_collect_totals_after` event in the `\Magento\Quote\Model\Quote\TotalsCollector::collectAddressTotals` method. Parameters: + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + - `shipping_assignment` is a shipping_assignment object (`\Magento\Quote\Model\ShippingAssignment` class) + - `total` is a total object (`\Magento\Quote\Model\Quote\Address\Total` class) + +- `checkout_submit_before` event in the `\Magento\Quote\Model\QuoteManagement::placeOrder` method. Parameters: + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `checkout_submit_all_after` event in the `\Magento\Quote\Model\QuoteManagement::placeOrder` method. Parameters: + - `order` is an order object (`\Magento\Sales\Model\Order` class) + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_model_service_quote_submit_before` event in the `\Magento\Quote\Model\QuoteManagement::submitQuote` method. Parameters: + - `order` is an order object (`\Magento\Sales\Model\Order` class) + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_model_service_quote_submit_success` event in the `\Magento\Quote\Model\QuoteManagement::submitQuote` method. Parameters: + - `order` is an order object (`\Magento\Sales\Model\Order` class) + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + +- `sales_model_service_quote_submit_failure` event in the `\Magento\Quote\Model\QuoteManagement::rollbackAddresses` method. Parameters: + - `order` is an order object (`\Magento\Sales\Model\Order` class) + - `quote` is a quote object (`\Magento\Quote\Model\Quote` class) + - `exception` is an exception object (`\Exception` class) + +- `prepare_catalog_product_collection_prices` event in the `\Magento\Quote\Model\ResourceModel\Quote\Item\Collection::_assignProducts` method. Parameters: + - `collection` is a product collection object (`\Magento\Quote\Model\ResourceModel\Quote\Item\Collection` class) + - `store_id` is a store ID (`int` type) + +- `sales_quote_item_collection_products_after_load` event in the `\Magento\Quote\Model\QuoteManagement::_assignProducts` method. Parameters: + - `collection` is a product collection object (`\Magento\Catalog\Model\ResourceModel\Product\Collection` class) + +For information about an event in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/events-and-observers.html#events). + +### Public APIs + +#### Data + +- `\Magento\Quote\Api\Data\AddressAdditionalDataInterface` + - provides additional data with quote address information + +- `\Magento\Quote\Api\Data\AddressInterface` + - quote address data + +- `\Magento\Quote\Api\Data\CartInterface` + - quote data + +- `\Magento\Quote\Api\Data\CartItemInterface` + - quote item data + +- `\Magento\Quote\Api\Data\CartSearchResultsInterfac` + - quote search result data + +- `\Magento\Quote\Api\Data\CurrencyInterface` + - currency data + +- `\Magento\Quote\Api\Data\EstimateAddressInterface` + - estimate address data + +- `\Magento\Quote\Api\Data\PaymentInterface` + - payment data + +- `\Magento\Quote\Api\Data\PaymentMethodInterface` + - payment method data + +- `\Magento\Quote\Api\Data\ProductOptionInterface` + - product option data + +- `\Magento\Quote\Api\Data\ShippingAssignmentInterface` + - shipping assigment data + +- `\Magento\Quote\Api\Data\ShippingInterface` + - shipping data + +- `\Magento\Quote\Api\Data\ShippingMethodInterface` + - shipping method data + +- `\Magento\Quote\Api\Data\TotalsAdditionalDataInterface` + - provides additional data for totals collection + +- `\Magento\Quote\Api\Data\TotalSegmentInterface` + - total segment data + +- `\Magento\Quote\Api\Data\TotalsInterfacee` + - quote totals data + +- `\Magento\Quote\Api\Data\TotalsItemInterface` + - quote items totals data + +#### General + +- `\Magento\Quote\Api\ChangeQuoteControlInterface` + - checks if user is allowed to change the quote + +#### Guest + +- `\Magento\Quote\Api\GuestBillingAddressManagementInterface` + - assigns a specified billing address to a specified quote + - gets the billing address for a specified quote + +- `\Magento\Quote\Api\GuestCartItemRepositoryInterface` + - gets lists items that are assigned to a specified quote + - add/update the specified cart guest item + - removes the specified item from the specified quote + +- `\Magento\Quote\Api\GuestCouponManagementInterface` + - gets coupon for a specified quote by quote ID + - adds a coupon by code to a specified quote + - deletes a coupon from a specified quote by quote ID + +- `\Magento\Quote\Api\GuestCartManagementInterface` + - gets list items that are assigned to a specified quote + - add/update the specified quote item + - deletes the specified item from the specified quote + +- `\Magento\Quote\Api\GuestPaymentMethodManagementInterface` + - adds a specified payment method to a specified shopping quote + - gets the payment method for a specified shopping quote + - gets list available payment methods for a specified shopping quote + +- `\Magento\Quote\Api\GuestShipmentEstimationInterface` + - estimates shipping by address and return list of available shipping methods + +- `\Magento\Quote\Api\GuestShippingMethodManagementInterface` + - gets list applicable shipping methods for a specified quote + - estimates shipping + +- `\Magento\Quote\Api\GuestCartRepositoryInterface` + - gets quote by quote ID for guest user + +- `\Magento\Quote\Api\GuestCartTotalManagementInterface` + - sets shipping/billing methods and additional data for a quote and collect totals for guest + +- `\Magento\Quote\Api\GuestCartTotalRepositoryInterface` + - gets quote totals by quote ID for guest user + +- `\Magento\Quote\Model\GuestCart\GuestShippingAddressManagementInterface` + - assign a specified shipping address to a specified quote + - gets the shipping address for a specified quote + +- `\Magento\Quote\Model\GuestCart\GuestShippingMethodManagementInterface` + - sets the carrier and shipping methods codes for a specified quote + - gets the selected shipping method for a specified quote + +#### Registered customer + +- `\Magento\Quote\Api\BillingAddressManagementInterface` + - assigns a specified billing address to a specified quote + - gets the billing address for a specified quote + +- `\Magento\Quote\Api\CartItemRepositoryInterface` + - gets lists items that are assigned to a specified quote + - add/update the specified quote item + - removes the specified item from the specified quote + +- `\Magento\Quote\Api\CartManagementInterface` + - creates an empty quote and quote for a guest + - creates an empty quote and quote for a specified customer if customer does not have a quote yet + - returns information for the quote for a specified customer + - assigns a specified customer to a specified shopping quote + - places an order for a specified quote + +- `\Magento\Quote\Api\CartRepositoryInterface` + - gets quote by quote ID + - gets list carts that match specified search criteria + - gets quote by customer ID + - gets active quote by quote ID + - gets active quote by customer ID + - saves quote + - deletes quote + +- `\Magento\Quote\Api\CartTotalManagementInterface` + - sets shipping/billing methods and additional data for quote and collect totals + +- `\Magento\Quote\Api\CartTotalRepositoryInterface` + - gets quote totals by quote ID + +- `\Magento\Quote\Api\CouponManagementInterface` + - gets coupon for a specified quote by quote ID + - adds a coupon by code to a specified quote + - deletes a coupon from a specified quote by quote ID + +- `\Magento\Quote\Api\PaymentMethodManagementInterface` + - adds a specified payment method to a specified shopping quote + - gets the payment method for a specified shopping quote + - gets list available payment methods for a specified shopping quote + +- `\Magento\Quote\Api\ShipmentEstimationInterface` + - estimates shipping by address and return list of available shipping methods + +- `\Magento\Quote\Api\ShippingMethodManagementInterface` + - estimates shipping by quote ID an Address + - estimates shipping by quote ID an address ID + - get lists applicable shipping methods for a specified quote + +- `\Magento\Quote\Model\ShippingAddressManagementInterface` + - assigns a specified shipping address to a specified quote + - gets the shipping address for a specified quote + +- `\Magento\Quote\Model\ShippingMethodManagementInterface` + - sets the carrier and shipping methods codes for a specified quote + - gets the selected shipping method for a specified quote + +#### Model + +- `\Magento\Quote\Model\Quote\Address\FreeShippingInterface` + - checks if is a free shipping + +- `\Magento\Quote\Model\Quote\Address\RateCollectorInterface` + - retrieves all methods for supplied shipping data + +- `\Magento\Quote\Model\MaskedQuoteIdToQuoteIdInterface` + - converts masked quote ID to the quote ID (entity ID) + +- `\Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface` + - converts quote ID to the masked quote ID + +For information about a public API in Magento 2, see [Public interfaces & APIs](http://devdocs.magento.com/guides/v2.4/extension-dev-guide/api-concepts.html). -## Install -The Magento_Quote module is installed automatically (using the native Magento install mechanism) without any additional actions. diff --git a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml index a14be3b533fa8..b09f2fb376327 100755 --- a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml +++ b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml @@ -24,4 +24,10 @@ <requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity> <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> </entity> + + <entity name="CashOnDeliveryOrderPaymentMethod" type="CustomerPaymentInformation"> + <var key="cart_id" entityKey="return" entityType="CustomerCart"/> + <requiredEntity type="payment_method">CashOnDeliveryPaymentMethod</requiredEntity> + <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> + </entity> </entities> diff --git a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml index ee5f2fccfe203..165500d8a82b1 100644 --- a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml +++ b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml @@ -94,7 +94,7 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> <!-- Step 1: Add simple product to shopping cart --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productCount" value="1"/> @@ -129,7 +129,7 @@ <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickMiniCart"/> <dontSeeElement selector="{{StorefrontMinicartSection.quantity}}" stepKey="dontSeeCartItem"/> <!-- Add simple product to shopping cart --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct2.name$$)}}" stepKey="amOnSimpleProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct2.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage2"/> <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart2"> <argument name="product" value="$$createSimpleProduct2$$"/> <argument name="productCount" value="1"/> diff --git a/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestBillingAddressManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestBillingAddressManagementTest.php index 938764fd0b3aa..3df82d9119298 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestBillingAddressManagementTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestBillingAddressManagementTest.php @@ -97,6 +97,8 @@ public function testAssign() { $addressId = 1; $this->billingAddressManagementMock->expects($this->once())->method('assign')->willReturn($addressId); - $this->assertEquals($addressId, $this->model->assign($this->maskedCartId, $this->addressMock)); + $actualAddressId = $this->model->assign($this->maskedCartId, $this->addressMock); + $this->assertIsInt($actualAddressId); + $this->assertEquals($addressId, $actualAddressId); } } diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php index b8db6858ea2dd..7dd0bcf8f8b0b 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php @@ -13,6 +13,7 @@ use Magento\Quote\Model\Quote\Item; use Magento\Quote\Model\Quote\Item\Compare; use Magento\Quote\Model\Quote\Item\Option; +use Magento\Quote\Model\Quote\Item\Option\Comparator; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -51,15 +52,22 @@ class CompareTest extends TestCase */ protected function setUp(): void { + $objectManagerHelper = new ObjectManager($this); + $constrArgs = $objectManagerHelper->getConstructArguments( + Item::class, + [ + 'itemOptionComparator' => new Comparator() + ] + ); $this->itemMock = $this->getMockBuilder(Item::class) ->addMethods(['getProductId']) ->onlyMethods(['__wakeup', 'getOptions', 'getOptionsByCode']) - ->disableOriginalConstructor() + ->setConstructorArgs($constrArgs) ->getMock(); $this->comparedMock = $this->getMockBuilder(Item::class) ->addMethods(['getProductId']) ->onlyMethods(['__wakeup', 'getOptions', 'getOptionsByCode']) - ->disableOriginalConstructor() + ->setConstructorArgs($constrArgs) ->getMock(); $this->optionMock = $this->getMockBuilder(Option::class) ->addMethods(['getCode']) @@ -82,7 +90,6 @@ function ($value) { ->disableOriginalConstructor() ->getMock(); - $objectManagerHelper = new ObjectManager($this); $this->helper = $objectManagerHelper->getObject( Compare::class, [ diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/Option/ComparatorTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/Option/ComparatorTest.php new file mode 100644 index 0000000000000..ced7873b4b1be --- /dev/null +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/Option/ComparatorTest.php @@ -0,0 +1,111 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Test\Unit\Model\Quote\Item\Option; + +use Magento\Framework\DataObject; +use Magento\Quote\Model\Quote\Item\Option\Comparator; +use Magento\Quote\Model\Quote\Item\Option\ComparatorInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test quote item options comparator + */ +class ComparatorTest extends TestCase +{ + /** + * @var ComparatorInterface|MockObject + */ + private $customComparator; + + /** + * @var Comparator + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->customComparator = $this->createMock(ComparatorInterface::class); + $this->model = new Comparator( + [ + 'custom' => $this->customComparator + ] + ); + } + + /** + * @param array $option1 + * @param array $option2 + * @param bool $expected + * @dataProvider compareDataProvider + */ + public function testCompare(array $option1, array $option2, bool $expected): void + { + $this->customComparator + ->method('compare') + ->willReturnCallback( + function ($option1, $option2) { + return $option1->getValue() === $option2->getValue(); + } + ); + $this->assertEquals($expected, $this->model->compare(new DataObject($option1), new DataObject($option2))); + } + + /** + * @return array + */ + public function compareDataProvider(): array + { + return [ + [ + ['code' => 'test', 'value' => '1'], + ['code' => 'test', 'value' => '1'], + true + ], + [ + ['code' => 'test', 'value' => '1'], + ['code' => 'test', 'value' => 1], + true + ], + [ + ['code' => 'test', 'value' => '1'], + ['code' => 'test', 'value' => '2'], + false + ], + [ + ['code' => 'test', 'value' => '1'], + ['code' => 'test1', 'value' => '1'], + false + ], + [ + ['code' => 'custom', 'value' => '1'], + ['code' => 'custom', 'value' => '1'], + true + ], + [ + ['code' => 'custom', 'value' => '1'], + ['code' => 'custom', 'value' => 1], + false + ], + [ + ['code' => 'custom', 'value' => '1'], + ['code' => 'custom', 'value' => '2'], + false + ], + [ + ['code' => 'custom', 'value' => '1'], + ['code' => 'test1', 'value' => '1'], + false + ], + ]; + } +} diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php index 53486fed26186..f574a23850447 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php @@ -20,6 +20,7 @@ use Magento\Quote\Model\Quote\Item; use Magento\Quote\Model\Quote\Item\Compare; use Magento\Quote\Model\Quote\Item\Option; +use Magento\Quote\Model\Quote\Item\Option\Comparator; use Magento\Quote\Model\Quote\Item\OptionFactory; use Magento\Sales\Model\Status\ListFactory; use Magento\Sales\Model\Status\ListStatus; @@ -148,7 +149,8 @@ protected function setUp(): void 'statusListFactory' => $statusListFactory, 'itemOptionFactory' => $this->itemOptionFactory, 'quoteItemCompare' => $this->compareHelper, - 'serializer' => $this->serializer + 'serializer' => $this->serializer, + 'itemOptionComparator' => new Comparator() ] ); } diff --git a/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php b/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php index 3a4d6f91b6279..bf664322abab6 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php @@ -18,7 +18,9 @@ use Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\Quote\Model\Quote\Item as QuoteItem; +use Magento\Quote\Model\Quote\Item\Option; use Magento\Quote\Model\ResourceModel\Quote\Item; +use Magento\Quote\Model\ResourceModel\Quote\Item\Option as OptionResourceModel; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -126,7 +128,7 @@ public function testSaveNotModifiedItem() ->with($this->quoteItemMock) ->willReturn(false); - $this->quoteItemMock->expects($this->never()) + $this->quoteItemMock->expects($this->once()) ->method('isOptionsSaved'); $this->quoteItemMock->expects($this->never()) ->method('saveItemOptions'); @@ -177,4 +179,61 @@ public function testSaveModifiedItem() $this->assertEquals($this->model, $this->model->save($this->quoteItemMock)); } + + public function testSaveWithNewOption(): void + { + $this->entitySnapshotMock->expects($this->exactly(2)) + ->method('isModified') + ->with($this->quoteItemMock) + ->willReturn(false); + + $this->quoteItemMock->expects($this->once()) + ->method('isOptionsSaved') + ->willReturn(false); + $this->quoteItemMock->expects($this->once()) + ->method('saveItemOptions'); + + $this->resourceMock->expects($this->any()) + ->method('getConnection') + ->willReturn($this->connectionMock); + $optionMock = $this->createMock(Option::class); + $this->quoteItemMock->expects($this->once()) + ->method('getOptions') + ->willReturn([$optionMock]); + + $this->assertEquals($this->model, $this->model->save($this->quoteItemMock)); + } + + public function testSaveWithModifiedOption(): void + { + $this->entitySnapshotMock->expects($this->exactly(2)) + ->method('isModified') + ->with($this->quoteItemMock) + ->willReturn(false); + + $this->quoteItemMock->expects($this->once()) + ->method('isOptionsSaved') + ->willReturn(false); + $this->quoteItemMock->expects($this->once()) + ->method('saveItemOptions'); + + $this->resourceMock->expects($this->any()) + ->method('getConnection') + ->willReturn($this->connectionMock); + $optionMock = $this->createMock(Option::class); + $optionMock->method('getId') + ->willReturn(1); + $optionResourceModelMock = $this->createMock(OptionResourceModel::class); + $optionResourceModelMock->expects($this->once()) + ->method('hasDataChanged') + ->with($optionMock) + ->willReturn(true); + $optionMock->method('getResource') + ->willReturn($optionResourceModelMock); + $this->quoteItemMock->expects($this->once()) + ->method('getOptions') + ->willReturn([$optionMock]); + + $this->assertEquals($this->model, $this->model->save($this->quoteItemMock)); + } } diff --git a/app/code/Magento/Quote/Test/Unit/Observer/SendInvoiceEmailObserverTest.php b/app/code/Magento/Quote/Test/Unit/Observer/SendInvoiceEmailObserverTest.php new file mode 100644 index 0000000000000..c3cfc62fc0f97 --- /dev/null +++ b/app/code/Magento/Quote/Test/Unit/Observer/SendInvoiceEmailObserverTest.php @@ -0,0 +1,209 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Test\Unit\Observer; + +use Magento\Framework\Event; +use Magento\Framework\Event\Observer; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Payment; +use Magento\Quote\Observer\SubmitObserver; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Email\Sender\InvoiceSender; +use Magento\Sales\Model\Order\Email\Sender\OrderSender; +use Magento\Sales\Model\Order\Invoice; +use Magento\Sales\Model\ResourceModel\Order\Invoice\Collection; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; +use Magento\Sales\Model\Order\Email\Container\InvoiceIdentity; +use Magento\Quote\Observer\SendInvoiceEmailObserver; + +/** + * Test for sending invoice email during order place on frontend + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class SendInvoiceEmailObserverTest extends TestCase +{ + /** + * @var SendInvoiceEmailObserver + */ + private $model; + + /** + * @var LoggerInterface|MockObject + */ + private $loggerMock; + + /** + * @var InvoiceSender|MockObject + */ + private $invoiceSenderMock; + + /** + * @var InvoiceIdentity|MockObject + */ + private $invoiceIdentityMock; + + /** + * @var Observer|MockObject + */ + private $observerMock; + + /** + * @var Quote|MockObject + */ + private $quoteMock; + + /** + * @var Order|MockObject + */ + private $orderMock; + + /** + * @var Payment|MockObject + */ + private $paymentMock; + + /** + * @inheirtDoc + */ + protected function setUp(): void + { + $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); + $this->quoteMock = $this->createMock(Quote::class); + $this->orderMock = $this->createMock(Order::class); + $this->paymentMock = $this->createMock(Payment::class); + $this->invoiceSenderMock = $this->createMock(InvoiceSender::class); + $this->invoiceIdentityMock = $this->getMockBuilder(InvoiceIdentity::class) + ->disableOriginalConstructor() + ->setMethods(['isEnabled']) + ->getMock(); + $eventMock = $this->getMockBuilder(Event::class) + ->disableOriginalConstructor() + ->setMethods(['getQuote', 'getOrder']) + ->getMock(); + $this->observerMock = $this->createPartialMock(Observer::class, ['getEvent']); + $this->observerMock->expects($this->any())->method('getEvent')->willReturn($eventMock); + $eventMock->expects($this->any())->method('getQuote')->willReturn($this->quoteMock); + $eventMock->expects($this->any())->method('getOrder')->willReturn($this->orderMock); + $this->quoteMock->expects($this->any())->method('getPayment')->willReturn($this->paymentMock); + $this->model = new SendInvoiceEmailObserver( + $this->loggerMock, + $this->invoiceSenderMock, + $this->invoiceIdentityMock + ); + } + + /** + * Tests successful email sending. + */ + public function testSendEmail() + { + $this->invoiceIdentityMock + ->expects($this->once()) + ->method('isEnabled') + ->willReturn(true); + + $this->paymentMock->method('getOrderPlaceRedirectUrl')->willReturn(''); + + $invoice = $this->createMock(Invoice::class); + $invoiceCollection = $this->createMock(Collection::class); + $invoiceCollection->method('getItems') + ->willReturn([$invoice]); + $this->orderMock->method('getInvoiceCollection') + ->willReturn($invoiceCollection); + $this->quoteMock + ->expects($this->any()) + ->method('getPayment') + ->willReturn($this->paymentMock); + + $this->orderMock->method('getCanSendNewEmailFlag')->willReturn(true); + $this->invoiceSenderMock->expects($this->once()) + ->method('send') + ->with($invoice) + ->willReturn(true); + $this->loggerMock->expects($this->never()) + ->method('critical'); + + $this->model->execute($this->observerMock); + } + + /** + * Tests email sending disabled by configuration. + */ + public function testSendEmailDisabled() + { + $this->invoiceIdentityMock + ->expects($this->once()) + ->method('isEnabled') + ->willReturn(false); + + $this->paymentMock + ->expects($this->never()) + ->method('getOrderPlaceRedirectUrl'); + $this->orderMock + ->expects($this->never()) + ->method('getInvoiceCollection'); + + $this->quoteMock + ->expects($this->never()) + ->method('getPayment'); + + $this->orderMock + ->expects($this->never()) + ->method('getCanSendNewEmailFlag'); + $this->loggerMock->expects($this->never()) + ->method('critical'); + + $this->model->execute($this->observerMock); + } + + /** + * Tests failing email sending. + */ + public function testFailToSendEmail() + { + $this->invoiceIdentityMock + ->expects($this->once()) + ->method('isEnabled') + ->willReturn(true); + $this->paymentMock->expects($this->once())->method('getOrderPlaceRedirectUrl')->willReturn(''); + + $invoice = $this->createMock(Invoice::class); + $invoiceCollection = $this->createMock(Collection::class); + $invoiceCollection->method('getItems') + ->willReturn([$invoice]); + $this->orderMock->method('getInvoiceCollection') + ->willReturn($invoiceCollection); + + $this->orderMock->expects($this->once())->method('getCanSendNewEmailFlag')->willReturn(true); + $this->invoiceSenderMock->expects($this->once())->method('send')->willThrowException( + new \Exception('Some email sending Error') + ); + $this->loggerMock->expects($this->once())->method('critical'); + $this->model->execute($this->observerMock); + } + + /** + * Tests send email when redirect. + */ + public function testSendEmailWhenRedirectUrlExists() + { + $this->invoiceIdentityMock + ->expects($this->once()) + ->method('isEnabled') + ->willReturn(true); + + $this->paymentMock->expects($this->once())->method('getOrderPlaceRedirectUrl')->willReturn(false); + $this->orderMock->expects($this->once())->method('getCanSendNewEmailFlag'); + $this->invoiceSenderMock->expects($this->never())->method('send'); + $this->loggerMock->expects($this->never())->method('critical'); + $this->model->execute($this->observerMock); + } +} diff --git a/app/code/Magento/Quote/Test/Unit/Observer/SubmitObserverTest.php b/app/code/Magento/Quote/Test/Unit/Observer/SubmitObserverTest.php index 2b7c9e6b4d94f..e28ec3bf23e02 100644 --- a/app/code/Magento/Quote/Test/Unit/Observer/SubmitObserverTest.php +++ b/app/code/Magento/Quote/Test/Unit/Observer/SubmitObserverTest.php @@ -22,6 +22,8 @@ use Psr\Log\LoggerInterface; /** + * Test for sending order email during order place on frontend + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class SubmitObserverTest extends TestCase @@ -41,11 +43,6 @@ class SubmitObserverTest extends TestCase */ private $orderSenderMock; - /** - * @var InvoiceSender|MockObject - */ - private $invoiceSender; - /** * @var Observer|MockObject */ @@ -66,6 +63,9 @@ class SubmitObserverTest extends TestCase */ private $paymentMock; + /** + * @inheirtDoc + */ protected function setUp(): void { $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); @@ -73,7 +73,6 @@ protected function setUp(): void $this->orderMock = $this->createMock(Order::class); $this->paymentMock = $this->createMock(Payment::class); $this->orderSenderMock = $this->createMock(OrderSender::class); - $this->invoiceSender = $this->createMock(InvoiceSender::class); $eventMock = $this->getMockBuilder(Event::class) ->disableOriginalConstructor() ->setMethods(['getQuote', 'getOrder']) @@ -85,8 +84,7 @@ protected function setUp(): void $this->quoteMock->expects($this->once())->method('getPayment')->willReturn($this->paymentMock); $this->model = new SubmitObserver( $this->loggerMock, - $this->orderSenderMock, - $this->invoiceSender + $this->orderSenderMock ); } @@ -106,10 +104,6 @@ public function testSendEmail() $this->orderMock->method('getCanSendNewEmailFlag')->willReturn(true); $this->orderSenderMock->expects($this->once()) ->method('send')->willReturn(true); - $this->invoiceSender->expects($this->once()) - ->method('send') - ->with($invoice) - ->willReturn(true); $this->loggerMock->expects($this->never()) ->method('critical'); diff --git a/app/code/Magento/Quote/etc/di.xml b/app/code/Magento/Quote/etc/di.xml index f66001e7789cf..8687f673abe8b 100644 --- a/app/code/Magento/Quote/etc/di.xml +++ b/app/code/Magento/Quote/etc/di.xml @@ -44,6 +44,7 @@ <preference for="Magento\Quote\Api\Data\EstimateAddressInterface" type="Magento\Quote\Model\EstimateAddress" /> <preference for="Magento\Quote\Api\Data\ProductOptionInterface" type="Magento\Quote\Model\Quote\ProductOption" /> <preference for="Magento\Quote\Model\ValidationRules\QuoteValidationRuleInterface" type="Magento\Quote\Model\ValidationRules\QuoteValidationComposite\Proxy"/> + <preference for="Magento\Quote\Model\Quote\Item\Option\ComparatorInterface" type="Magento\Quote\Model\Quote\Item\Option\Comparator"/> <type name="Magento\Webapi\Controller\Rest\ParamsOverrider"> <arguments> <argument name="paramOverriders" xsi:type="array"> diff --git a/app/code/Magento/Quote/etc/frontend/events.xml b/app/code/Magento/Quote/etc/frontend/events.xml index 1e9822bbf3ef8..207d3077a681b 100644 --- a/app/code/Magento/Quote/etc/frontend/events.xml +++ b/app/code/Magento/Quote/etc/frontend/events.xml @@ -7,6 +7,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_success"> - <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver" /> + <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver"/> + <observer name="sendInvoiceEmail" instance="Magento\Quote\Observer\SendInvoiceEmailObserver"/> </event> </config> diff --git a/app/code/Magento/Quote/etc/webapi_rest/events.xml b/app/code/Magento/Quote/etc/webapi_rest/events.xml index 1e9822bbf3ef8..207d3077a681b 100644 --- a/app/code/Magento/Quote/etc/webapi_rest/events.xml +++ b/app/code/Magento/Quote/etc/webapi_rest/events.xml @@ -7,6 +7,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_success"> - <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver" /> + <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver"/> + <observer name="sendInvoiceEmail" instance="Magento\Quote\Observer\SendInvoiceEmailObserver"/> </event> </config> diff --git a/app/code/Magento/Quote/etc/webapi_soap/events.xml b/app/code/Magento/Quote/etc/webapi_soap/events.xml index 1e9822bbf3ef8..207d3077a681b 100644 --- a/app/code/Magento/Quote/etc/webapi_soap/events.xml +++ b/app/code/Magento/Quote/etc/webapi_soap/events.xml @@ -7,6 +7,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_success"> - <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver" /> + <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver"/> + <observer name="sendInvoiceEmail" instance="Magento\Quote\Observer\SendInvoiceEmailObserver"/> </event> </config> diff --git a/app/code/Magento/QuoteAnalytics/README.md b/app/code/Magento/QuoteAnalytics/README.md index 51c93983e2bca..c79bd7a669bba 100644 --- a/app/code/Magento/QuoteAnalytics/README.md +++ b/app/code/Magento/QuoteAnalytics/README.md @@ -1,3 +1,19 @@ -# Magento_QuoteAnalytics +# Magento_QuoteAnalytics module -The Magento_QuoteAnalytics module configures data definitions for a data collection related to the Quote module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). +This module configures data definitions for a data collection related to the Quote module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). + +## Installation + +Before installing this module, note that the Magento_QuoteAnalytics is dependent on the following modules: +- `Magento_Quote` +- `Magento_Analytics` + +This module does not introduce any database schema modifications or new data. + +For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html). + +## Additional data + +More information can get at articles: +- [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/overview.html) +- [Data collection for advanced reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/data-collection.html) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/CheckCartCheckoutAllowance.php b/app/code/Magento/QuoteGraphQl/Model/Cart/CheckCartCheckoutAllowance.php index fcadc38b0fa46..55423e374d99e 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/CheckCartCheckoutAllowance.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/CheckCartCheckoutAllowance.php @@ -39,7 +39,7 @@ public function __construct( */ public function execute(Quote $quote): void { - if (false === $quote->getCustomerIsGuest()) { + if (!$quote->getCustomerIsGuest()) { return; } diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetPaymentMethodOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetPaymentMethodOnCart.php index 81a30216f0035..56ff0a4edb035 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetPaymentMethodOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetPaymentMethodOnCart.php @@ -9,6 +9,7 @@ use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; @@ -22,6 +23,8 @@ /** * Saves related payment method info for a cart. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class SetPaymentMethodOnCart { @@ -41,7 +44,7 @@ class SetPaymentMethodOnCart private $additionalDataProviderPool; /** - * @var PaymentProcessingRateLimiterInterface + * @var PaymentSavingRateLimiterInterface */ private $paymentRateLimiter; @@ -50,18 +53,22 @@ class SetPaymentMethodOnCart * @param PaymentInterfaceFactory $paymentFactory * @param AdditionalDataProviderPool $additionalDataProviderPool * @param PaymentProcessingRateLimiterInterface|null $paymentRateLimiter + * @param PaymentSavingRateLimiterInterface|null $savingRateLimiter + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( PaymentMethodManagementInterface $paymentMethodManagement, PaymentInterfaceFactory $paymentFactory, AdditionalDataProviderPool $additionalDataProviderPool, - ?PaymentProcessingRateLimiterInterface $paymentRateLimiter = null + ?PaymentProcessingRateLimiterInterface $paymentRateLimiter = null, + ?PaymentSavingRateLimiterInterface $savingRateLimiter = null ) { $this->paymentMethodManagement = $paymentMethodManagement; $this->paymentFactory = $paymentFactory; $this->additionalDataProviderPool = $additionalDataProviderPool; - $this->paymentRateLimiter = $paymentRateLimiter - ?? ObjectManager::getInstance()->get(PaymentProcessingRateLimiterInterface::class); + $this->paymentRateLimiter = $savingRateLimiter + ?? ObjectManager::getInstance()->get(PaymentSavingRateLimiterInterface::class); } /** @@ -75,7 +82,12 @@ public function __construct( public function execute(Quote $cart, array $paymentData): void { try { - $this->paymentRateLimiter->limit(); + try { + $this->paymentRateLimiter->limit(); + } catch (PaymentProcessingRateLimitExceededException $ex) { + //Limit reached + return; + } } catch (PaymentProcessingRateLimitExceededException $exception) { throw new GraphQlInputException(__($exception->getMessage()), $exception); } diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php index d4ced5b8b97b0..d07a7241c9dd7 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItemPrices.php @@ -58,6 +58,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $currencyCode = $cartItem->getQuote()->getQuoteCurrencyCode(); return [ + 'model' => $cartItem, 'price' => [ 'currency' => $currencyCode, 'value' => $cartItem->getCalculationPrice(), diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php index 3a10c773c5f22..397455a2412a5 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php @@ -15,6 +15,7 @@ use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Quote\Api\CartManagementInterface; +use Magento\Quote\Api\PaymentMethodManagementInterface; use Magento\QuoteGraphQl\Model\Cart\GetCartForUser; use Magento\Sales\Api\OrderRepositoryInterface; use Magento\QuoteGraphQl\Model\Cart\CheckCartCheckoutAllowance; @@ -44,22 +45,30 @@ class PlaceOrder implements ResolverInterface */ private $checkCartCheckoutAllowance; + /** + * @var PaymentMethodManagementInterface + */ + private $paymentMethodManagement; + /** * @param GetCartForUser $getCartForUser * @param CartManagementInterface $cartManagement * @param OrderRepositoryInterface $orderRepository * @param CheckCartCheckoutAllowance $checkCartCheckoutAllowance + * @param PaymentMethodManagementInterface $paymentMethodManagement */ public function __construct( GetCartForUser $getCartForUser, CartManagementInterface $cartManagement, OrderRepositoryInterface $orderRepository, - CheckCartCheckoutAllowance $checkCartCheckoutAllowance + CheckCartCheckoutAllowance $checkCartCheckoutAllowance, + PaymentMethodManagementInterface $paymentMethodManagement ) { $this->getCartForUser = $getCartForUser; $this->cartManagement = $cartManagement; $this->orderRepository = $orderRepository; $this->checkCartCheckoutAllowance = $checkCartCheckoutAllowance; + $this->paymentMethodManagement = $paymentMethodManagement; } /** @@ -84,7 +93,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } try { - $orderId = $this->cartManagement->placeOrder($cart->getId()); + $cartId = $cart->getId(); + $orderId = $this->cartManagement->placeOrder($cartId, $this->paymentMethodManagement->get($cartId)); $order = $this->orderRepository->get($orderId); return [ diff --git a/app/code/Magento/QuoteGraphQl/Test/Unit/Model/Cart/SetPaymentMethodOnCartTest.php b/app/code/Magento/QuoteGraphQl/Test/Unit/Model/Cart/SetPaymentMethodOnCartTest.php index 281e1233d8bbe..45bd3538fbcb1 100644 --- a/app/code/Magento/QuoteGraphQl/Test/Unit/Model/Cart/SetPaymentMethodOnCartTest.php +++ b/app/code/Magento/QuoteGraphQl/Test/Unit/Model/Cart/SetPaymentMethodOnCartTest.php @@ -9,7 +9,7 @@ namespace Magento\QuoteGraphQl\Test\Unit\Model\Cart; use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; -use Magento\Checkout\Api\PaymentProcessingRateLimiterInterface; +use Magento\Checkout\Api\PaymentSavingRateLimiterInterface; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Quote\Model\Quote; @@ -25,7 +25,7 @@ class SetPaymentMethodOnCartTest extends TestCase private $model; /** - * @var PaymentProcessingRateLimiterInterface|MockObject + * @var PaymentSavingRateLimiterInterface|MockObject */ private $rateLimiterMock; @@ -37,10 +37,10 @@ protected function setUp(): void parent::setUp(); $objectManager = new ObjectManager($this); - $this->rateLimiterMock = $this->getMockForAbstractClass(PaymentProcessingRateLimiterInterface::class); + $this->rateLimiterMock = $this->getMockForAbstractClass(PaymentSavingRateLimiterInterface::class); $this->model = $objectManager->getObject( SetPaymentMethodOnCart::class, - ['paymentRateLimiter' => $this->rateLimiterMock] + ['savingRateLimiter' => $this->rateLimiterMock] ); } @@ -52,10 +52,9 @@ protected function setUp(): void public function testLimited(): void { $this->rateLimiterMock->method('limit') - ->willThrowException(new PaymentProcessingRateLimitExceededException(__($message = 'Error'))); - $this->expectException(GraphQlInputException::class); - $this->expectExceptionMessage($message); + ->willThrowException(new PaymentProcessingRateLimitExceededException(__('Error'))); + //There will be en error if the limiter won't stop the execution $this->model->execute($this->createMock(Quote::class), []); } } diff --git a/app/code/Magento/QuoteGraphQl/etc/graphql/events.xml b/app/code/Magento/QuoteGraphQl/etc/graphql/events.xml index 1e9822bbf3ef8..207d3077a681b 100644 --- a/app/code/Magento/QuoteGraphQl/etc/graphql/events.xml +++ b/app/code/Magento/QuoteGraphQl/etc/graphql/events.xml @@ -7,6 +7,7 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_model_service_quote_submit_success"> - <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver" /> + <observer name="sendEmail" instance="Magento\Quote\Observer\SubmitObserver"/> + <observer name="sendInvoiceEmail" instance="Magento\Quote\Observer\SendInvoiceEmailObserver"/> </event> </config> diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index bcbbb3dc97de3..35d7cf082fc94 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -322,11 +322,11 @@ type SetGuestEmailOnCartOutput { } type SimpleCartItem implements CartItemInterface @doc(description: "Simple Cart Item") { - customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") + customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") } type VirtualCartItem implements CartItemInterface @doc(description: "Virtual Cart Item") { - customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") + customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") } interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") { @@ -354,6 +354,7 @@ type SelectedCustomizableOption { id: Int! @deprecated(reason: "Use SelectedCustomizableOption.customizable_option_uid instead") customizable_option_uid: ID! @doc(description: "The unique ID for a `CustomizableRadioOption`, `CustomizableDropDownOption`, `CustomizableMultipleOption`, etc. of `CustomizableOptionInterface` objects") label: String! + type: String! is_required: Boolean! values: [SelectedCustomizableOptionValue!]! sort_order: Int! diff --git a/app/code/Magento/ReleaseNotification/README.md b/app/code/Magento/ReleaseNotification/README.md index c53e3cbde1d0f..6857377fe819f 100644 --- a/app/code/Magento/ReleaseNotification/README.md +++ b/app/code/Magento/ReleaseNotification/README.md @@ -14,7 +14,7 @@ The **Release Notification Module** serves to provide a notification delivery pl Release notification content is maintained by Magento for each Magento version, edition, and locale. To retrieve the content, a response is returned from a request with the following parameters: -* **version** = The Magento version that the client has installed (ex. 2.3.0). +* **version** = The Magento version that the client has installed (ex. 2.4.0). * **edition** = The Magento edition that the client has installed (ex. Community). * **locale** = The chosen locale of the admin user (ex. en_US). diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/CacheInterface.php b/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/CacheInterface.php new file mode 100644 index 0000000000000..678e73077e2f9 --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/CacheInterface.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter\Cache; + +/** + * Interface for filesystem adapter cache storage. Used in Cached adapter implementation to store metadata for + * filesystem entities in order to reduce calls to filesystem API. + */ +interface CacheInterface +{ + /** + * Cache tag + */ + public const CACHE_TAG = 'flysystem'; + + /** + * Check if path is cached as existing path. + * Returns: + * - true - path exists and there is a cache record for it + * - false - path is cached as non-existing in filesystem + * - null - no cached record on path + * + * @param string $path + * @return bool|null + */ + public function exists(string $path): ?bool; + + /** + * Get metadata for path. + * + * @param string $path + * @return array|null + */ + public function getMetadata(string $path): ?array; + + /** + * Flush the cache. + */ + public function flushCache(): void; + + /** + * Purges data enqueued for deletion. + */ + public function purgeQueue(): void; + + /** + * Rename/move a file or directory. + * + * @param string $path + * @param string $newpath + */ + public function moveFile(string $path, string $newpath): void; + + /** + * Copy file. + * + * @param string $path + * @param string $newpath + */ + public function copyFile(string $path, string $newpath): void; + + /** + * Delete an object from cache by path. + * + * @param string $path + */ + public function deleteFile(string $path): void; + + /** + * Delete objects in directory for cache. + * + * @param string $dirname + */ + public function deleteDir(string $dirname): void; + + /** + * Update metadata for the path. + * + * @param string $path + * @param array $objectMetadata + * @param bool $persist + */ + public function updateMetadata(string $path, array $objectMetadata, bool $persist = false): void; + + /** + * Store flag that path does not exist in the filesystem. + * + * @param string $path + */ + public function storeFileNotExists(string $path): void; +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/Generic.php b/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/Generic.php new file mode 100644 index 0000000000000..7adaf2de12e5b --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/Cache/Generic.php @@ -0,0 +1,251 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter\Cache; + +use Magento\Framework\App\CacheInterface as MagentoCacheInterface; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\RemoteStorage\Driver\Adapter\PathUtil; + +/** + * Generic cache implementation for filesystem storage. + */ +class Generic implements CacheInterface +{ + /** + * @var array + */ + private $cacheData = []; + + /** + * List of cache paths to be purged when persist is called + * + * @var array + */ + private $cachePathPurgeQueue = []; + + /** + * @var string + */ + private $prefix; + + /** + * @var SerializerInterface + */ + private $serializer; + + /** + * @var MagentoCacheInterface + */ + private $cacheAdapter; + + /** + * @var PathUtil + */ + private $pathUtil; + + /** + * @param MagentoCacheInterface $cacheAdapter + * @param SerializerInterface $serializer + * @param PathUtil $pathUtil + * @param string $prefix + */ + public function __construct( + MagentoCacheInterface $cacheAdapter, + SerializerInterface $serializer, + PathUtil $pathUtil, + $prefix = 'flysystem:' + ) { + $this->prefix = $prefix; + $this->serializer = $serializer; + $this->cacheAdapter = $cacheAdapter; + $this->pathUtil = $pathUtil; + } + + /** + * @inheritdoc + */ + public function purgeQueue(): void + { + foreach ($this->cachePathPurgeQueue as $path) { + unset($this->cacheData[$path]); + $this->cacheAdapter->remove($this->prefix . $path); + } + } + + /** + * @inheritdoc + */ + public function updateMetadata(string $path, array $objectMetadata, bool $persist = false): void + { + $this->cacheData[$path] = array_merge($this->pathUtil->pathInfo($path), $objectMetadata); + if ($persist) { + $this->cacheAdapter->save( + $this->serializer->serialize([$path => $this->cacheData[$path]]), + $this->prefix . $path, + [self::CACHE_TAG] + ); + } + + $this->ensureParentDirectories($path); + } + + /** + * @inheritdoc + */ + public function storeFileNotExists(string $path): void + { + $this->cacheData[$path] = false; + $this->cacheAdapter->save( + $this->serializer->serialize([$path => $this->cacheData[$path]]), + $this->prefix . $path, + [self::CACHE_TAG] + ); + } + + /** + * @inheritdoc + */ + public function exists(string $path): ?bool + { + if (!isset($this->cacheData[$path])) { + $fileMeta = $this->cacheAdapter->load($this->prefix . $path); + + if ($fileMeta === false) { + return null; + } + + $this->setFromStorage($fileMeta); + } + + return array_key_exists($path, $this->cacheData) ? $this->cacheData[$path] !== false : null; + } + + /** + * @inheritdoc + */ + public function moveFile(string $path, string $newpath): void + { + if ($this->exists($path)) { + $object = $this->cacheData[$path]; + unset($this->cacheData[$path]); + $this->cachePathPurgeQueue[] = $path; + $object['path'] = $newpath; + $object = array_merge($object, $this->pathUtil->pathInfo($newpath)); + $this->cacheData[$newpath] = $object; + $this->cacheAdapter->save( + $this->serializer->serialize([$newpath => $this->cacheData[$newpath]]), + $this->prefix . $newpath, + [self::CACHE_TAG] + ); + $this->purgeQueue(); + } + } + + /** + * @inheritdoc + */ + public function copyFile(string $path, string $newpath): void + { + if ($this->exists($path)) { + $object = $this->cacheData[$path]; + $object = array_merge($object, $this->pathUtil->pathInfo($newpath)); + $this->updateMetadata($newpath, $object, true); + } + } + + /** + * @inheritdoc + */ + public function deleteFile(string $path): void + { + $this->storeFileNotExists($path); + } + + /** + * @inheritdoc + */ + public function deleteDir(string $dirname): void + { + foreach ($this->cacheData as $path => $object) { + if ($this->pathIsInDirectory($dirname, $path) || $path === $dirname) { + unset($this->cacheData[$path]); + $this->cachePathPurgeQueue[] = $path; + } + } + + $this->purgeQueue(); + } + + /** + * @inheritdoc + */ + public function getMetadata(string $path): ?array + { + if (isset($this->cacheData[$path]['type'])) { + return $this->cacheData[$path]; + } else { + $meta = $this->cacheAdapter->load($this->prefix . $path); + if (!$meta) { + return null; + } + $meta = $this->serializer->unserialize($meta); + if (!$meta[$path]) { + return null; + } + $this->cacheData[$path] = $meta[$path]; + return $this->cacheData[$path]; + } + } + + /** + * @inheritdoc + */ + public function flushCache(): void + { + $this->cacheData = []; + $this->cacheAdapter->clean([self::CACHE_TAG]); + } + + /** + * Load from serialized cache data. + * + * @param string $json + */ + private function setFromStorage(string $json) + { + $this->cacheData = array_merge($this->cacheData, $this->serializer->unserialize($json)); + } + + /** + * Ensure parent directories of an object. + * + * @param string $path object path + */ + private function ensureParentDirectories($path) + { + $object = $this->cacheData[$path]; + + while ($object['dirname'] !== '' && ! isset($this->cacheData[$object['dirname']])) { + $object = $this->pathUtil->pathInfo($object['dirname']); + $object['type'] = 'dir'; + $this->cacheData[$object['path']] = $object; + } + } + + /** + * Determines if the path is inside the directory. + * + * @param string $directory + * @param string $path + * @return bool + */ + private function pathIsInDirectory($directory, $path) + { + return $directory === '' || strpos((string)$path, $directory . '/') === 0; + } +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapter.php b/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapter.php new file mode 100644 index 0000000000000..605a1a66e3867 --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapter.php @@ -0,0 +1,226 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter; + +use League\Flysystem\Config; +use League\Flysystem\FileAttributes; +use League\Flysystem\FilesystemAdapter; +use Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterface; + +/** + * Cached adapter implementation for filesystem storage. + */ +class CachedAdapter implements CachedAdapterInterface +{ + /** + * @var FilesystemAdapter + */ + private $adapter; + + /** + * @var CacheInterface + */ + private $cache; + + /** + * @var MetadataProviderInterface + */ + private $metadataProvider; + + /** + * Constructor. + * + * @param FilesystemAdapter $adapter + * @param CacheInterface $cache + * @param MetadataProviderInterface $metadataProvider + */ + public function __construct( + FilesystemAdapter $adapter, + CacheInterface $cache, + MetadataProviderInterface $metadataProvider + ) { + $this->adapter = $adapter; + $this->cache = $cache; + $this->metadataProvider = $metadataProvider; + } + + /** + * {@inheritdoc} + */ + public function write(string $path, string $contents, Config $config): void + { + $this->adapter->write($path, $contents, $config); + $object = [ + 'type' => 'file', + 'path' => $path, + ]; + $this->cache->updateMetadata($path, $object, true); + } + + /** + * {@inheritdoc} + */ + public function writeStream(string $path, $contents, Config $config): void + { + $this->adapter->writeStream($path, $contents, $config); + $object = [ + 'type' => 'file', + 'path' => $path, + ]; + $this->cache->updateMetadata($path, $object, true); + } + + /** + * {@inheritdoc} + */ + public function move(string $source, string $destination, Config $config): void + { + $this->adapter->move($source, $destination, $config); + $this->cache->moveFile($source, $destination); + } + + /** + * {@inheritdoc} + */ + public function copy(string $source, string $destination, Config $config): void + { + $this->adapter->copy($source, $destination, $config); + $this->cache->copyFile($source, $destination); + } + + /** + * {@inheritdoc} + */ + public function delete(string $path): void + { + $this->adapter->delete($path); + $this->cache->deleteFile($path); + } + + /** + * {@inheritdoc} + */ + public function deleteDirectory(string $path): void + { + $this->adapter->deleteDirectory($path); + $this->cache->deleteDir($path); + } + + /** + * {@inheritdoc} + */ + public function createDirectory(string $path, Config $config): void + { + $this->adapter->createDirectory($path, $config); + $type = 'dir'; + $dirname = $path; + $this->cache->updateMetadata($dirname, ['path' => $path, 'type' => $type], true); + } + + /** + * {@inheritdoc} + */ + public function setVisibility(string $path, string $visibility): void + { + $this->adapter->setVisibility($path, $visibility); + $this->cache->updateMetadata($path, ['path' => $path, 'visibility' => $visibility], true); + } + + /** + * {@inheritdoc} + */ + public function fileExists(string $path): bool + { + $cacheHas = $this->cache->exists($path); + + if ($cacheHas !== null) { + return $cacheHas; + } + + $exists = $this->adapter->fileExists($path); + + if (!$exists) { + try { + // check if target is a directory + $exists = iterator_count($this->adapter->listContents($path, false)) > 0; + } catch (\Throwable $e) { + // catch closed iterator + $exists = false; + } + } + + if (!$exists) { + $this->cache->storeFileNotExists($path); + } else { + $cacheEntry = is_array($exists) ? $exists : ['path' => $path]; + $this->cache->updateMetadata($path, $cacheEntry, true); + } + + return $exists; + } + + /** + * {@inheritdoc} + */ + public function read(string $path): string + { + return $this->adapter->read($path); + } + + /** + * {@inheritdoc} + */ + public function readStream(string $path) + { + return $this->adapter->readStream($path); + } + + /** + * {@inheritdoc} + */ + public function listContents(string $path, bool $deep): iterable + { + return $this->adapter->listContents($path, $deep); + } + + /** + * {@inheritdoc} + */ + public function fileSize(string $path): FileAttributes + { + $result = $this->metadataProvider->getMetadata($path); + return new FileAttributes($path, (int)$result['size']); + } + + /** + * {@inheritdoc} + */ + public function mimeType(string $path): FileAttributes + { + $result = $this->metadataProvider->getMetadata($path); + return new FileAttributes($path, null, null, null, $result['mimetype']); + } + + /** + * {@inheritdoc} + */ + public function lastModified(string $path): FileAttributes + { + $result = $this->metadataProvider->getMetadata($path); + return new FileAttributes($path, null, null, (int)$result['timestamp']); + } + + /** + * {@inheritdoc} + */ + public function visibility(string $path): FileAttributes + { + $result = $this->metadataProvider->getMetadata($path); + return new FileAttributes($path, null, $result['visibility']); + } +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapterInterface.php b/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapterInterface.php new file mode 100644 index 0000000000000..294dc4339db43 --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapterInterface.php @@ -0,0 +1,18 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter; + +use League\Flysystem\FilesystemAdapter; + +/** + * Cached adapter interface for filesystem storage. + */ +interface CachedAdapterInterface extends FilesystemAdapter +{ + +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProvider.php b/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProvider.php new file mode 100644 index 0000000000000..421bddd657bbe --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProvider.php @@ -0,0 +1,133 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter; + +use League\Flysystem\FilesystemAdapter; +use League\Flysystem\FilesystemException; +use League\Flysystem\UnableToRetrieveMetadata; +use Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterface; + +/** + * Metadata provider for filesystem storage. + */ +class MetadataProvider implements MetadataProviderInterface +{ + /** + * @var FilesystemAdapter + */ + private $adapter; + + /** + * @var Cache\CacheInterface + */ + private $cache; + + /** + * MetadataProvider constructor. + * + * @param FilesystemAdapter $adapter + * @param Cache\CacheInterface $cache + */ + public function __construct( + FilesystemAdapter $adapter, + CacheInterface $cache + ) { + $this->adapter = $adapter; + $this->cache = $cache; + } + + /** + * Check is the given path an existing directory. + * + * @param string $path + * @return bool + */ + private function isDirectory($path): bool + { + try { + return iterator_count($this->adapter->listContents($path, false)) > 0; + } catch (\Throwable $e) { + // catch closed iterator + return false; + } + } + + /** + * @inheritdoc + */ + public function getMetadata(string $path): array + { + $metadata = $this->cache->getMetadata($path); + if (isset($metadata['type']) && ($metadata['type'] == 'dir' || $this->isMetadataComplete($metadata))) { + return $metadata; + } + try { + $meta = $this->adapter->lastModified($path); + } catch (UnableToRetrieveMetadata $e) { + if ($this->isDirectory($path)) { + $data = [ + 'path' => $path, + 'type' => 'dir', + 'size' => null, + 'timestamp' => null, + 'visibility' => null, + 'mimetype' => null, + 'dirname' => dirname($path), + 'basename' => basename($path), + ]; + $this->cache->updateMetadata($path, $data, true); + return $data; + } else { + throw new UnableToRetrieveMetadata( + "Unable to retrieve metadata for file at location: {$path}. {$e->getMessage()}", + 0, + $e + ); + } + } catch (\InvalidArgumentException | FilesystemException $e) { + throw new UnableToRetrieveMetadata( + "Unable to retrieve metadata for file at location: {$path}. {$e->getMessage()}", + 0, + $e + ); + } + $data = [ + 'path' => $path, + 'type' => $meta->type(), + 'size' => $meta->fileSize(), + 'timestamp' => $meta->lastModified(), + 'visibility' => $meta->visibility(), + 'mimetype' => $meta->mimeType(), + 'dirname' => dirname($meta->path()), + 'basename' => basename($meta->path()), + ]; + $extraMetadata = $meta->extraMetadata(); + if (isset($extraMetadata['Metadata']['image-width']) && isset($extraMetadata['Metadata']['image-height'])) { + $data['extra'] = $extraMetadata['Metadata']; + } + $this->cache->updateMetadata($path, $data, true); + return $data; + } + + /** + * Check is the metadata structure complete. + * + * @param array $metadata + * @return bool + */ + private function isMetadataComplete($metadata) + { + $keys = ['type', 'size', 'timestamp', 'visibility', 'mimetype', 'dirname', 'basename']; + foreach ($keys as $key) { + if (!array_key_exists($key, $metadata)) { + return false; + } + } + return true; + } +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProviderInterface.php b/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProviderInterface.php new file mode 100644 index 0000000000000..fa4fb55838129 --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/MetadataProviderInterface.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter; + +use League\Flysystem\UnableToRetrieveMetadata; + +/** + * Interface for metadata provider. Provides metadata of the file by given path. + */ +interface MetadataProviderInterface +{ + /** + * Retrieve metadata for a file by path. + * + * @param string $path + * @return array + * @throws UnableToRetrieveMetadata + */ + public function getMetadata(string $path): array; +} diff --git a/app/code/Magento/RemoteStorage/Driver/Adapter/PathUtil.php b/app/code/Magento/RemoteStorage/Driver/Adapter/PathUtil.php new file mode 100644 index 0000000000000..5bcb6b4408069 --- /dev/null +++ b/app/code/Magento/RemoteStorage/Driver/Adapter/PathUtil.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\RemoteStorage\Driver\Adapter; + +/** + * Utility class for path operations. + */ +class PathUtil +{ + /** + * Get normalized path info. + * + * @param string $path + * @return array + */ + public function pathInfo($path) + { + $pathInfo = ['path' => $path]; + $dirname = dirname($path); + if ('' !== $dirname) { + $pathInfo['dirname'] = $dirname === '.' ? '' : $dirname; + } + $pathInfo['basename'] = $this->basename($path); + $pathInfo += pathinfo($pathInfo['basename']); + return $pathInfo + ['dirname' => '']; + } + + /** + * Get basename for path. + * + * @param string $path + * @return string + */ + private function basename($path) + { + $separators = DIRECTORY_SEPARATOR === '/' ? '/' : '\/'; + $path = rtrim($path, $separators); + return preg_replace('#.*?([^' . preg_quote($separators, '#') . ']+$)#', '$1', $path); + } +} diff --git a/app/code/Magento/RemoteStorage/Driver/Cache/CacheFactory.php b/app/code/Magento/RemoteStorage/Driver/Cache/CacheFactory.php deleted file mode 100644 index 703393b69ec6a..0000000000000 --- a/app/code/Magento/RemoteStorage/Driver/Cache/CacheFactory.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\RemoteStorage\Driver\Cache; - -use League\Flysystem\Adapter\Local; -use League\Flysystem\Cached\CacheInterface; -use League\Flysystem\Cached\Storage\Memory; -use League\Flysystem\Cached\Storage\Predis; -use League\Flysystem\Cached\Storage\Adapter; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem; -use Magento\RemoteStorage\Driver\DriverException; -use Magento\RemoteStorage\Driver\DriverPool; -use Predis\Client; - -/** - * Provides cache adapters. - */ -class CacheFactory -{ - public const ADAPTER_PREDIS = 'predis'; - public const ADAPTER_MEMORY = 'memory'; - public const ADAPTER_LOCAL = 'local'; - - private const CACHE_KEY = 'storage'; - private const CACHE_FILE = 'storage_cache.json'; - - /** - * Cache for 30 days. - */ - private const CACHE_EXPIRATION = 30 * 86400; - - /** - * @var string - */ - private $localCacheRoot; - - /** - * @param Filesystem $filesystem - */ - public function __construct(Filesystem $filesystem) - { - $this->localCacheRoot = $filesystem->getDirectoryRead( - DirectoryList::VAR_DIR, - DriverPool::FILE - )->getAbsolutePath(); - } - - /** - * Create cache adapter. - * - * @param string $adapter - * @param array $config - * @return CacheInterface - * @throws DriverException - */ - public function create(string $adapter, array $config = []): CacheInterface - { - switch ($adapter) { - case self::ADAPTER_PREDIS: - if (!class_exists(Client::class)) { - throw new DriverException(__('Predis client is not installed')); - } - - return new Predis(new Client($config), self::CACHE_KEY, self::CACHE_EXPIRATION); - case self::ADAPTER_MEMORY: - return new Memory(); - case self::ADAPTER_LOCAL: - return new Adapter(new Local($this->localCacheRoot), self::CACHE_FILE, self::CACHE_EXPIRATION); - } - - throw new DriverException(__('Cache adapter %1 is not supported', $adapter)); - } -} diff --git a/app/code/Magento/RemoteStorage/Driver/DriverFactoryInterface.php b/app/code/Magento/RemoteStorage/Driver/DriverFactoryInterface.php index f578d1cd57b3a..705c7bff0fb74 100644 --- a/app/code/Magento/RemoteStorage/Driver/DriverFactoryInterface.php +++ b/app/code/Magento/RemoteStorage/Driver/DriverFactoryInterface.php @@ -35,7 +35,7 @@ public function create(): RemoteDriverInterface; public function createConfigured( array $config, string $prefix, - string $cacheAdapter, - array $cacheConfig + string $cacheAdapter = '', + array $cacheConfig = [] ): RemoteDriverInterface; } diff --git a/app/code/Magento/RemoteStorage/Model/Config.php b/app/code/Magento/RemoteStorage/Model/Config.php index 1eedcb57d4cae..53de61194a065 100644 --- a/app/code/Magento/RemoteStorage/Model/Config.php +++ b/app/code/Magento/RemoteStorage/Model/Config.php @@ -10,7 +10,6 @@ use Magento\Framework\App\DeploymentConfig; use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\RuntimeException; -use Magento\RemoteStorage\Driver\Cache\CacheFactory; use Magento\RemoteStorage\Driver\DriverPool; use Magento\Framework\Filesystem\DriverPool as BaseDriverPool; @@ -94,28 +93,4 @@ public function getCache(): array { return (array)$this->config->get(DriverPool::PATH_CACHE, []); } - - /** - * Retrieves cache adapter. - * - * @return string - * @throws FileSystemException - * @throws RuntimeException - */ - public function getCacheAdapter(): string - { - return $this->getCache()['adapter'] ?? CacheFactory::ADAPTER_MEMORY; - } - - /** - * Retrieves cache config. - * - * @return array - * @throws FileSystemException - * @throws RuntimeException - */ - public function getCacheConfig(): array - { - return $this->getCache()['config'] ?? []; - } } diff --git a/app/code/Magento/RemoteStorage/Setup/ConfigOptionsList.php b/app/code/Magento/RemoteStorage/Setup/ConfigOptionsList.php index 693ee45517075..12c38b3e71ebd 100644 --- a/app/code/Magento/RemoteStorage/Setup/ConfigOptionsList.php +++ b/app/code/Magento/RemoteStorage/Setup/ConfigOptionsList.php @@ -12,7 +12,6 @@ use Magento\Framework\Config\File\ConfigFilePool; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Filesystem\DriverPool; -use Magento\RemoteStorage\Driver\Cache\CacheFactory; use Magento\RemoteStorage\Driver\DriverFactoryPool; use Magento\RemoteStorage\Driver\DriverPool as RemoteDriverPool; use Magento\Framework\Setup\ConfigOptionsListInterface; @@ -164,9 +163,7 @@ public function validate(array $options, DeploymentConfig $deploymentConfig): ar try { $this->driverFactoryPool->get($driver)->createConfigured( (array)$configData->getData()['remote_storage']['config'], - (string)$options[self::OPTION_REMOTE_STORAGE_PREFIX], - CacheFactory::ADAPTER_MEMORY, - [] + (string)$options[self::OPTION_REMOTE_STORAGE_PREFIX] )->test(); } catch (LocalizedException $exception) { $message = $exception->getMessage(); diff --git a/app/code/Magento/RemoteStorage/composer.json b/app/code/Magento/RemoteStorage/composer.json index d5428b4fbe62f..1b6b361366848 100644 --- a/app/code/Magento/RemoteStorage/composer.json +++ b/app/code/Magento/RemoteStorage/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "require": { "php": "~7.3.0||~7.4.0", - "magento/framework": "^100.0.2" + "magento/framework": "*" }, "suggest": { "magento/module-backend": "*", diff --git a/app/code/Magento/RemoteStorage/etc/di.xml b/app/code/Magento/RemoteStorage/etc/di.xml index d8ee5d609cb57..aa1447b84b2cd 100644 --- a/app/code/Magento/RemoteStorage/etc/di.xml +++ b/app/code/Magento/RemoteStorage/etc/di.xml @@ -6,6 +6,10 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <preference for="Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterface" type="Magento\RemoteStorage\Driver\Adapter\Cache\Generic"/> + <preference for="Magento\RemoteStorage\Driver\Adapter\CachedAdapterInterface" type="Magento\RemoteStorage\Driver\Adapter\CachedAdapter"/> + <preference for="Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterface" type="Magento\RemoteStorage\Driver\Adapter\MetadataProvider"/> + <preference for="Magento\RemoteStorage\Driver\Adapter\MetadataProviderFactoryInterface" type="Magento\RemoteStorage\Driver\Adapter\MetadataProviderFactory"/> <virtualType name="remoteWriteFactory" type="Magento\Framework\Filesystem\Directory\WriteFactory"> <arguments> <argument name="driverPool" xsi:type="object">Magento\RemoteStorage\Driver\DriverPool</argument> @@ -33,11 +37,6 @@ <virtualType name="fullRemoteFilesystem" type="Magento\RemoteStorage\Filesystem" /> <virtualType name="stdFilesystem" type="Magento\Framework\Filesystem" /> <preference for="Magento\Framework\Filesystem" type="customRemoteFilesystem"/> - <type name="Magento\RemoteStorage\Driver\Cache\CacheFactory"> - <arguments> - <argument name="filesystem" xsi:type="object">stdFilesystem</argument> - </arguments> - </type> <type name="Magento\Framework\Filesystem\Directory\TargetDirectory"> <arguments> <argument name="filesystem" xsi:type="object">fullRemoteFilesystem</argument> diff --git a/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php b/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php index 2ff87237222f0..160ddc8cfcd49 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php @@ -52,6 +52,11 @@ class AbstractGrid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_resourceFactory; + /** + * @var string + */ + protected $_columnGroupBy; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper diff --git a/app/code/Magento/Reports/Model/Product/Index/Factory.php b/app/code/Magento/Reports/Model/Product/Index/Factory.php index a1498d8fe43cc..4439553498792 100644 --- a/app/code/Magento/Reports/Model/Product/Index/Factory.php +++ b/app/code/Magento/Reports/Model/Product/Index/Factory.php @@ -15,6 +15,11 @@ class Factory const TYPE_VIEWED = 'viewed'; + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $_objectManager; + /** * @var array */ diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php index ab76cad8da5c4..48ee5f58499ef 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php @@ -8,6 +8,7 @@ namespace Magento\Reports\Model\ResourceModel\Product; use Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitationFactory; +use Magento\Framework\DataObject; /** * Products Report collection. @@ -64,6 +65,11 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection */ protected $quoteResource; + /** + * @var DataObject + */ + private $_totals; + /** * Collection constructor. * @@ -335,6 +341,7 @@ public function addViewsCount($from = '', $to = '') * Getting event type id for catalog_product_view event */ $eventTypes = $this->_eventTypeFactory->create()->getCollection(); + $productViewEvent = null; foreach ($eventTypes as $eventType) { if ($eventType->getEventName() == 'catalog_product_view') { $productViewEvent = (int)$eventType->getId(); diff --git a/app/code/Magento/Reports/Model/ResourceModel/Quote/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Quote/Collection.php index b69ea94aac9bb..9312e8b87ec48 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Quote/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Quote/Collection.php @@ -144,24 +144,24 @@ public function addSubtotal($storeIds = '', $filter = null) $this->getSelect()->columns( ['subtotal' => '(main_table.base_subtotal_with_discount*main_table.base_to_global_rate)'] ); - $this->_joinedFields['subtotal'] = + $joinedFields['subtotal'] = '(main_table.base_subtotal_with_discount*main_table.base_to_global_rate)'; } else { $this->getSelect()->columns(['subtotal' => 'main_table.base_subtotal_with_discount']); - $this->_joinedFields['subtotal'] = 'main_table.base_subtotal_with_discount'; + $joinedFields['subtotal'] = 'main_table.base_subtotal_with_discount'; } if ($filter && is_array($filter) && isset($filter['subtotal'])) { if (isset($filter['subtotal']['from'])) { $this->getSelect()->where( - $this->_joinedFields['subtotal'] . ' >= ?', + $joinedFields['subtotal'] . ' >= ?', $filter['subtotal']['from'], \Zend_Db::FLOAT_TYPE ); } if (isset($filter['subtotal']['to'])) { $this->getSelect()->where( - $this->_joinedFields['subtotal'] . ' <= ?', + $joinedFields['subtotal'] . ' <= ?', $filter['subtotal']['to'], \Zend_Db::FLOAT_TYPE ); diff --git a/app/code/Magento/Reports/Model/ResourceModel/Report/AbstractReport.php b/app/code/Magento/Reports/Model/ResourceModel/Report/AbstractReport.php index e949589e59eb4..4e0f9f71e4fc7 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Report/AbstractReport.php @@ -47,6 +47,11 @@ abstract class AbstractReport extends \Magento\Framework\Model\ResourceModel\Db\ */ protected $dateTime; + /** + * @var \Magento\Framework\Stdlib\DateTime\Timezone\Validator + */ + private $timezoneValidator; + /** * Constructor * diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml index beb1471bd6c4d..c38307790589f 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml @@ -30,6 +30,16 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteAttributeSet"> <argument name="productAttributeLabel" value="{{colorProductAttribute.default_label}}"/> </actionGroup> diff --git a/app/code/Magento/Reports/view/frontend/templates/product/widget/viewed/item.phtml b/app/code/Magento/Reports/view/frontend/templates/product/widget/viewed/item.phtml index 562c9a2b63a99..da11582a16133 100644 --- a/app/code/Magento/Reports/view/frontend/templates/product/widget/viewed/item.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/product/widget/viewed/item.phtml @@ -60,7 +60,7 @@ $rating = 'short'; </button> <?php endif; ?> <?php else : ?> - <?php if ($item->getIsSalable()) : ?> + <?php if ($item->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/compared/column/compared_default_list.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/compared/column/compared_default_list.phtml index a54259280e381..a9d5718449cd5 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/compared/column/compared_default_list.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/compared/column/compared_default_list.phtml @@ -78,7 +78,7 @@ if ($exist = $block->getRecentlyComparedProducts()) { <?php endif; ?> </div> <?php else : ?> - <?php if ($_product->getIsSalable()) : ?> + <?php if ($_product->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_grid.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_grid.phtml index ad6b33820c752..1222490065185 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_grid.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_grid.phtml @@ -83,7 +83,7 @@ if ($exist = $block->getRecentlyComparedProducts()) { </button> <?php endif; ?> <?php else : ?> - <?php if ($_item->getIsSalable()) : ?> + <?php if ($_item->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_list.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_list.phtml index ba7a50eef6485..6f7b4f4f66f27 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_list.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/compared/content/compared_list.phtml @@ -84,7 +84,7 @@ if ($exist = $block->getRecentlyComparedProducts()) { </button> <?php endif; ?> <?php else : ?> - <?php if ($_item->getIsSalable()) : ?> + <?php if ($_item->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/column/viewed_default_list.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/column/viewed_default_list.phtml index 16fc2b070b95c..3e5cd15bbc62b 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/column/viewed_default_list.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/column/viewed_default_list.phtml @@ -81,7 +81,7 @@ if ($exist = ($block->getRecentlyViewedProducts() && $block->getRecentlyViewedPr <?php endif; ?> </div> <?php else : ?> - <?php if ($_product->getIsSalable()) : ?> + <?php if ($_product->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_grid.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_grid.phtml index 567c3ebc57f9b..c2f98e72909d6 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_grid.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_grid.phtml @@ -86,7 +86,7 @@ if ($exist = ($block->getRecentlyViewedProducts() && $block->getRecentlyViewedPr </button> <?php endif; ?> <?php else : ?> - <?php if ($_item->getIsSalable()) : ?> + <?php if ($_item->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_list.phtml b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_list.phtml index 9a8bb9c3b734f..32cf0bc69d1e5 100644 --- a/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_list.phtml +++ b/app/code/Magento/Reports/view/frontend/templates/widget/viewed/content/viewed_list.phtml @@ -88,7 +88,7 @@ if ($exist = ($block->getRecentlyViewedProducts() && $block->getRecentlyViewedPr </button> <?php endif; ?> <?php else : ?> - <?php if ($_item->getIsSalable()) : ?> + <?php if ($_item->isAvailable()) : ?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> <?php else : ?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> diff --git a/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php b/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php index 346d5b60aad1b..b8514383d975d 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php @@ -187,15 +187,14 @@ protected function _prepareForm() \Magento\Backend\Block\Store\Switcher\Form\Renderer\Fieldset\Element::class ); $field->setRenderer($renderer); - $review->setSelectStores($review->getStores()); } else { $fieldset->addField( 'select_stores', 'hidden', - ['name' => 'stores[]', 'value' => $this->_storeManager->getStore(true)->getId()] + ['name' => 'stores[]', 'value' => $review->getStores()] ); - $review->setSelectStores($this->_storeManager->getStore(true)->getId()); } + $review->setSelectStores($review->getStores()); $fieldset->addField( 'nickname', diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index 37a93d40b1107..81f732f1b9ea1 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -43,6 +43,11 @@ class Rating extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb */ private $scopeConfig; + /** + * @var Review\Summary + */ + private $_reviewSummary; + /** * @param \Magento\Framework\Model\ResourceModel\Db\Context $context * @param \Psr\Log\LoggerInterface $logger diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating/Option.php b/app/code/Magento/Review/Model/ResourceModel/Rating/Option.php index ef4acb6c90cb8..af3137e6427ed 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating/Option.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating/Option.php @@ -79,6 +79,11 @@ class Option extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb */ protected $_ratingOptionVoteF; + /** + * @var \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress + */ + private $_remoteAddress; + /** * @param \Magento\Framework\Model\ResourceModel\Db\Context $context * @param \Magento\Customer\Model\Session $customerSession diff --git a/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml index 81f5db6d2fd10..86f4a717f01ad 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="goToProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> <dontSeeElement selector="{{StorefrontProductInfoDetailsSection.productNameForReview}}" stepKey="dontSeeReviewTab"/> <click selector="{{StorefrontProductInfoMainSection.addReviewLink}}" stepKey="clickAddReview"/> <dontSeeJsError stepKey="dontSeeJsError"/> diff --git a/app/code/Magento/Review/view/frontend/templates/customer/list.phtml b/app/code/Magento/Review/view/frontend/templates/customer/list.phtml index 6dd7aa575e9df..d44dc203dab85 100644 --- a/app/code/Magento/Review/view/frontend/templates/customer/list.phtml +++ b/app/code/Magento/Review/view/frontend/templates/customer/list.phtml @@ -6,6 +6,7 @@ /** * @var \Magento\Review\Block\Customer\ListCustomer $block + * @var \Magento\Framework\Escaper $escaper * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ @@ -15,36 +16,36 @@ $reviewHelper = $block->getData('reviewHelper'); <?php if ($block->getReviews() && count($block->getReviews())): ?> <div class="table-wrapper reviews"> <table class="data table table-reviews" id="my-reviews-table"> - <caption class="table-caption"><?= $block->escapeHtml(__('Product Reviews')) ?></caption> + <caption class="table-caption"><?= $escaper->escapeHtml(__('Product Reviews')) ?></caption> <thead> <tr> - <th scope="col" class="col date"><?= $block->escapeHtml(__('Created')) ?></th> - <th scope="col" class="col item"><?= $block->escapeHtml(__('Product Name')) ?></th> - <th scope="col" class="col summary"><?= $block->escapeHtml(__('Rating')) ?></th> - <th scope="col" class="col description"><?= $block->escapeHtml(__('Review')) ?></th> + <th scope="col" class="col date"><?= $escaper->escapeHtml(__('Created')) ?></th> + <th scope="col" class="col item"><?= $escaper->escapeHtml(__('Product Name')) ?></th> + <th scope="col" class="col summary"><?= $escaper->escapeHtml(__('Rating')) ?></th> + <th scope="col" class="col description"><?= $escaper->escapeHtml(__('Review')) ?></th> <th scope="col" class="col actions"> </th> </tr> </thead> <tbody> <?php foreach ($block->getReviews() as $review): ?> <tr> - <td data-th="<?= $block->escapeHtml(__('Created')) ?>" - class="col date"><?= $block->escapeHtml($block->dateFormat($review->getReviewCreatedAt())) ?> + <td data-th="<?= $escaper->escapeHtml(__('Created')) ?>" + class="col date"><?= $escaper->escapeHtml($block->dateFormat($review->getReviewCreatedAt())) ?> </td> - <td data-th="<?= $block->escapeHtml(__('Product Name')) ?>" class="col item"> + <td data-th="<?= $escaper->escapeHtml(__('Product Name')) ?>" class="col item"> <strong class="product-name"> - <a href="<?= $block->escapeUrl($block->getProductUrl($review)) ?>"> - <?= $block->escapeHtml($review->getName()) ?> + <a href="<?= $escaper->escapeUrl($block->getProductUrl($review)) ?>"> + <?= $escaper->escapeHtml($review->getName()) ?> </a> </strong> </td> - <td data-th="<?= $block->escapeHtml(__('Rating')) ?>" class="col summary"> + <td data-th="<?= $escaper->escapeHtml(__('Rating')) ?>" class="col summary"> <?php if ($review->getSum()): ?> <div class="rating-summary"> - <span class="label"><span><?= $block->escapeHtml(__('Rating')) ?>:</span></span> + <span class="label"><span><?= $escaper->escapeHtml(__('Rating')) ?>:</span></span> <div class="rating-result" title="<?= /* @noEscape */ ((int)$review->getSum() / (int)$review->getCount()) ?>%"> - <span> + <span class="rating_<?= $escaper->escapeUrl($review->getReviewId())?>"> <span> <?= /* @noEscape */ ((int)$review->getSum() / (int)$review->getCount()) ?>% </span> @@ -53,16 +54,16 @@ $reviewHelper = $block->getData('reviewHelper'); </div> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( "width:" . /* @noEscape */ ((int)$review->getSum() / (int)$review->getCount()) . "%;", - 'div.rating-summary div.rating-result>span:first-child' + 'div.rating-summary div.rating-result>span.rating_' . $escaper->escapeUrl($review->getReviewId()) ) ?> <?php endif; ?> </td> - <td data-th="<?= $block->escapeHtmlAttr(__('Review')) ?>" class="col description"> + <td data-th="<?= $escaper->escapeHtmlAttr(__('Review')) ?>" class="col description"> <?= $reviewHelper->getDetailHtml($review->getDetail()) ?> </td> - <td data-th="<?= $block->escapeHtmlAttr(__('Actions')) ?>" class="col actions"> - <a href="<?= $block->escapeUrl($block->getReviewUrl($review)) ?>" class="action more"> - <span><?= $block->escapeHtml(__('See Details')) ?></span> + <td data-th="<?= $escaper->escapeHtmlAttr(__('Actions')) ?>" class="col actions"> + <a href="<?= $escaper->escapeUrl($block->getReviewUrl($review)) ?>" class="action more"> + <span><?= $escaper->escapeHtml(__('See Details')) ?></span> </a> </td> </tr> @@ -76,12 +77,12 @@ $reviewHelper = $block->getData('reviewHelper'); </div> <?php endif; ?> <?php else: ?> - <div class="message info empty"><span><?= $block->escapeHtml(__('You have submitted no reviews.')) ?></span></div> + <div class="message info empty"><span><?= $escaper->escapeHtml(__('You have submitted no reviews.')) ?></span></div> <?php endif; ?> <div class="actions-toolbar"> <div class="secondary"> - <a class="action back" href="<?= $block->escapeUrl($block->getBackUrl()) ?>"> - <span><?= $block->escapeHtml(__('Back')) ?></span> + <a class="action back" href="<?= $escaper->escapeUrl($block->getBackUrl()) ?>"> + <span><?= $escaper->escapeHtml(__('Back')) ?></span> </a> </div> </div> diff --git a/app/code/Magento/Review/view/frontend/templates/customer/recent.phtml b/app/code/Magento/Review/view/frontend/templates/customer/recent.phtml index cf7d53e818c36..7a5f56153f16c 100644 --- a/app/code/Magento/Review/view/frontend/templates/customer/recent.phtml +++ b/app/code/Magento/Review/view/frontend/templates/customer/recent.phtml @@ -6,15 +6,16 @@ /** * @var \Magento\Review\Block\Customer\Recent $block + * @var \Magento\Framework\Escaper $escaper * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> <?php if ($block->getReviews() && count($block->getReviews())): ?> <div class="block block-reviews-dashboard"> <div class="block-title"> - <strong><?= $block->escapeHtml(__('My Recent Reviews')) ?></strong> - <a class="action view" href="<?= $block->escapeUrl($block->getAllReviewsUrl()) ?>"> - <span><?= $block->escapeHtml(__('View All')) ?></span> + <strong><?= $escaper->escapeHtml(__('My Recent Reviews')) ?></strong> + <a class="action view" href="<?= $escaper->escapeUrl($block->getAllReviewsUrl()) ?>"> + <span><?= $escaper->escapeHtml(__('View All')) ?></span> </a> </div> <div class="block-content"> @@ -22,22 +23,22 @@ <?php foreach ($block->getReviews() as $_review): ?> <li class="item"> <strong class="product-name"> - <a href="<?= $block->escapeUrl($block->getReviewUrl($_review->getReviewId())) ?>"> - <?= $block->escapeHtml($_review->getName()) ?> + <a href="<?= $escaper->escapeUrl($block->getReviewUrl($_review->getReviewId())) ?>"> + <?= $escaper->escapeHtml($_review->getName()) ?> </a> </strong> <?php if ($_review->getSum()): ?> <?php $rating = $_review->getSum() / $_review->getCount() ?> <div class="rating-summary"> - <span class="label"><span><?= $block->escapeHtml(__('Rating')) ?>:</span></span> - <div class="rating-result" title="<?= $block->escapeHtmlAttr($rating) ?>%"> - <span> - <span><?= $block->escapeHtml($rating) ?>%</span> + <span class="label"><span><?= $escaper->escapeHtml(__('Rating')) ?>:</span></span> + <div class="rating-result" title="<?= $escaper->escapeHtmlAttr($rating) ?>%"> + <span class="rating_<?= $escaper->escapeUrl($_review->getReviewId())?>"> + <span><?= $escaper->escapeHtml($rating) ?>%</span> </span> </div> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( - "width:". $block->escapeHtmlAttr($rating) . "%", - 'div.rating-result>span:first-child' + "width:". $escaper->escapeHtmlAttr($rating) . "%", + 'div.rating-result>span.rating_' . $escaper->escapeUrl($_review->getReviewId()) ) ?> </div> <?php endif; ?> diff --git a/app/code/Magento/Review/view/frontend/templates/customer/view.phtml b/app/code/Magento/Review/view/frontend/templates/customer/view.phtml index 862a9a466414f..d1d9d3b7ccae7 100644 --- a/app/code/Magento/Review/view/frontend/templates/customer/view.phtml +++ b/app/code/Magento/Review/view/frontend/templates/customer/view.phtml @@ -38,18 +38,22 @@ $product = $block->getProductData(); <?php foreach ($block->getRating() as $_rating): ?> <?php if ($_rating->getPercent()): ?> <?php $rating = ceil($_rating->getPercent()) ?> + <?php $ratingId = $_rating->getRatingId() ?> <div class="rating-summary item"> <span class="rating-label"> <span><?= $block->escapeHtml($_rating->getRatingCode()) ?></span> </span> - <div class="rating-result" title="<?= /* @noEscape */ $rating ?>%"> + <div class="rating-result" + id="rating-div-<?= $block->escapeHtml($ratingId) ?>" + title="<?= /* @noEscape */ $rating ?>%"> <span> <span><?= /* @noEscape */ $rating ?>%</span> </span> </div> <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( "width:" . /* @noEscape */ $rating . "%", - 'div.rating-result>span:first-child' + 'div#rating-div-'.$_rating->getRatingId(). + '>span:first-child' ) ?> </div> <?php endif; ?> diff --git a/app/code/Magento/Review/view/frontend/templates/product/view/list.phtml b/app/code/Magento/Review/view/frontend/templates/product/view/list.phtml index e631f5bc19580..2fe6f7f3109fe 100644 --- a/app/code/Magento/Review/view/frontend/templates/product/view/list.phtml +++ b/app/code/Magento/Review/view/frontend/templates/product/view/list.phtml @@ -4,79 +4,104 @@ * See COPYING.txt for license details. */ -/** @var Magento\Review\Block\Product\View\ListView $block */ -/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ +use Magento\Framework\Escaper; +use Magento\Framework\View\Helper\SecureHtmlRenderer; +use Magento\Review\Block\Product\View\ListView; + +/** + * @var ListView $block + * @var SecureHtmlRenderer $secureRenderer + * @var Escaper $escaper + */ $_items = $block->getReviewsCollection()->getItems(); $format = $block->getDateFormat() ?: \IntlDateFormatter::SHORT; ?> <?php if (count($_items)): ?> -<div class="block review-list" id="customer-reviews"> - <?php if (!$block->getHideTitle()): ?> - <div class="block-title"> - <strong><?= $block->escapeHtml(__('Customer Reviews')) ?></strong> - </div> - <?php endif ?> - <div class="block-content"> - <div class="toolbar review-toolbar"> - <?= $block->getChildHtml('toolbar') ?> - </div> - <ol class="items review-items"> - <?php foreach ($_items as $_review): ?> - <li class="item review-item" itemscope itemprop="review" itemtype="http://schema.org/Review"> - <div class="review-title" itemprop="name"><?= $block->escapeHtml($_review->getTitle()) ?></div> - <?php if (count($_review->getRatingVotes())): ?> - <div class="review-ratings"> - <?php foreach ($_review->getRatingVotes() as $_vote): ?> - <div class="rating-summary item" - itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> - <span class="label rating-label"> - <span><?= $block->escapeHtml($_vote->getRatingCode()) ?></span> - </span> - <div class="rating-result" - id="review_<?= /* @noEscape */ $_review->getReviewId() - ?>_vote_<?= /* @noEscape */ $_vote->getVoteId() ?>" - title="<?= $block->escapeHtmlAttr($_vote->getPercent()) ?>%"> - <meta itemprop="worstRating" content = "1"/> - <meta itemprop="bestRating" content = "100"/> - <span> - <span itemprop="ratingValue"><?= $block->escapeHtml($_vote->getPercent()) ?>%</span> - </span> + <div class="block review-list" id="customer-reviews"> + <?php if (!$block->getHideTitle()): ?> + <div class="block-title"> + <strong><?= $escaper->escapeHtml(__('Customer Reviews')) ?></strong> + </div> + <?php endif ?> + <div class="block-content"> + <div class="toolbar review-toolbar"> + <?= $block->getChildHtml('toolbar') ?> + </div> + <ol class="items review-items"> + <?php foreach ($_items as $_review): ?> + <li class="item review-item" itemscope itemprop="review" itemtype="http://schema.org/Review"> + <div class="review-title" itemprop="name"> + <?= $escaper->escapeHtml($_review->getTitle()) ?> + </div> + <?php if (count($_review->getRatingVotes())): ?> + <div class="review-ratings"> + <?php foreach ($_review->getRatingVotes() as $_vote): ?> + <div class="rating-summary item" + itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> + <span class="label rating-label"> + <span><?= $escaper->escapeHtml($_vote->getRatingCode()) ?></span> + </span> + <div class="rating-result" + id="review_<?= /* @noEscape */ $_review->getReviewId() + . '_vote_' + . $_vote->getVoteId() ?>" + title="<?= $escaper->escapeHtmlAttr($_vote->getPercent()) ?>%"> + <meta itemprop="worstRating" content="1"/> + <meta itemprop="bestRating" content="100"/> + <span> + <span itemprop="ratingValue"> + <?= $escaper->escapeHtml($_vote->getPercent()) ?>% + </span> + </span> + </div> + <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( + 'width:' . $_vote->getPercent() . '%', + 'div#review_' . $_review->getReviewId() + . '_vote_' . $_vote->getVoteId() . ' span' + ) ?> + </div> + <?php endforeach; ?> + </div> + <?php endif; ?> + <div class="review-content-container"> + <div class="review-content" itemprop="description"> + <?= /* @noEscape */ nl2br($escaper->escapeHtml($_review->getDetail())) ?> + </div> + <div class="review-details"> + <p class="review-author"> + <span class="review-details-label"> + <?= $escaper->escapeHtml(__('Review by')) ?> + </span> + <strong class="review-details-value" itemprop="author"> + <?= $escaper->escapeHtml($_review->getNickname()) ?> + </strong> + </p> + <p class="review-date"> + <span class="review-details-label"> + <?= $escaper->escapeHtml(__('Posted on')) ?> + </span> + <time class="review-details-value" itemprop="datePublished" + datetime="<?= $escaper->escapeHtmlAttr($block->formatDate( + $_review->getCreatedAt(), + $format + )) ?>"> + <?= $escaper->escapeHtml( + $block->formatDate( + $_review->getCreatedAt(), + $format + ) + ) ?> + </time> + </p> + </div> </div> - <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( - 'width:' . $_vote->getPercent() . '%', - 'div#review_' . $_review->getReviewId() . '_vote_' . $_vote->getVoteId() . ' span' - ) ?> - </div> - <?php endforeach; ?> - </div> - <?php endif; ?> - <div class="review-content" itemprop="description"> - <?= /* @noEscape */ nl2br($block->escapeHtml($_review->getDetail())) ?> - </div> - <div class="review-details"> - <p class="review-author"> - <span class="review-details-label"><?= $block->escapeHtml(__('Review by')) ?></span> - <strong class="review-details-value" - itemprop="author"><?= $block->escapeHtml($_review->getNickname()) ?></strong> - </p> - <p class="review-date"> - <span class="review-details-label"><?= $block->escapeHtml(__('Posted on')) ?></span> - <time class="review-details-value" - itemprop="datePublished" - datetime="<?= $block->escapeHtmlAttr($block->formatDate( - $_review->getCreatedAt(), - $format - )) ?>"><?= $block->escapeHtml($block->formatDate($_review->getCreatedAt(), $format)) ?> - </time> - </p> - </div> - </li> - <?php endforeach; ?> - </ol> - <div class="toolbar review-toolbar"> - <?= $block->getChildHtml('toolbar') ?> + </li> + <?php endforeach; ?> + </ol> + <div class="toolbar review-toolbar"> + <?= $block->getChildHtml('toolbar') ?> + </div> </div> </div> -</div> -<?php endif;?> +<?php endif; ?> diff --git a/app/code/Magento/ReviewAnalytics/README.md b/app/code/Magento/ReviewAnalytics/README.md index a0ec0ad1d77e1..5eb1f100c572c 100644 --- a/app/code/Magento/ReviewAnalytics/README.md +++ b/app/code/Magento/ReviewAnalytics/README.md @@ -1,3 +1,3 @@ # Magento_ReviewAnalytics module -The Magento_ReviewAnalytics module configures data definitions for a data collection related to the Review module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). +The Magento_ReviewAnalytics module configures data definitions for a data collection related to the Review module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). diff --git a/app/code/Magento/Rss/Model/RssManager.php b/app/code/Magento/Rss/Model/RssManager.php index c817c362b0fbe..2eafc2c329f56 100644 --- a/app/code/Magento/Rss/Model/RssManager.php +++ b/app/code/Magento/Rss/Model/RssManager.php @@ -21,6 +21,11 @@ class RssManager implements RssManagerInterface */ protected $providers; + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + /** * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param array $dataProviders diff --git a/app/code/Magento/Rule/Test/Mftf/Helper/RuleHelper.php b/app/code/Magento/Rule/Test/Mftf/Helper/RuleHelper.php index a8a9f78df7f28..502f2ec0822f2 100644 --- a/app/code/Magento/Rule/Test/Mftf/Helper/RuleHelper.php +++ b/app/code/Magento/Rule/Test/Mftf/Helper/RuleHelper.php @@ -18,7 +18,7 @@ class RuleHelper extends Helper { /** - * Delete all Catalog Price Rules obe by one. + * Deletes all Catalog Price Rules one by one. * * @param string $emptyRow * @param string $modalAceptButton diff --git a/app/code/Magento/Sales/Api/Data/OrderInterface.php b/app/code/Magento/Sales/Api/Data/OrderInterface.php index b45fddc7d7354..b483930fd7e1b 100644 --- a/app/code/Magento/Sales/Api/Data/OrderInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderInterface.php @@ -913,7 +913,10 @@ public function setCreatedAt($createdAt); /** * Gets the customer date-of-birth (DOB) for the order. * - * @return string|null Customer date-of-birth (DOB). + * @return string|null In keeping with current security and privacy best practices, be sure you are aware of any + * potential legal and security risks associated with the storage of customers’ full date of birth + * (month, day, year) along with other personal identifiers (e.g., full name) before collecting or processing + * such data. */ public function getCustomerDob(); diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php index bcdeb4e7d67de..123b777602924 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php @@ -399,4 +399,18 @@ protected function getAddressStoreId() { return $this->getBackendQuoteSession()->getStoreId(); } + + /** + * @inheritdoc + */ + protected function _getAdditionalFormElementTypes() + { + return array_merge( + parent::_getAdditionalFormElementTypes(), + [ + 'file' => \Magento\Customer\Block\Adminhtml\Form\Element\Address\File::class, + 'image' => \Magento\Customer\Block\Adminhtml\Form\Element\Address\Image::class, + ] + ); + } } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php index 8ec07f9765204..b0510ffbe4d94 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php @@ -545,12 +545,12 @@ public function getConfigureButtonHtml($item) { $product = $item->getProduct(); - $options = ['label' => __('Configure')]; + $options = ['label' => $this->escapeHtmlAttr(__('Configure'))]; if ($product->canConfigure()) { $options['onclick'] = sprintf('order.showQuoteItemConfiguration(%s)', $item->getId()); } else { $options['class'] = ' disabled'; - $options['title'] = __('This product does not have any configurable options'); + $options['title'] = $this->escapeHtmlAttr(__('This product does not have any configurable options')); } return $this->getLayout()->createBlock( diff --git a/app/code/Magento/Sales/Block/Items/AbstractItems.php b/app/code/Magento/Sales/Block/Items/AbstractItems.php index 7680d90cdd499..474c148518f14 100644 --- a/app/code/Magento/Sales/Block/Items/AbstractItems.php +++ b/app/code/Magento/Sales/Block/Items/AbstractItems.php @@ -5,6 +5,8 @@ */ namespace Magento\Sales\Block\Items; +use Magento\Sales\ViewModel\ItemRendererTypeResolverInterface; + /** * Abstract block for display sales (quote/order/invoice etc.) items * @@ -83,6 +85,10 @@ protected function _getItemType(\Magento\Framework\DataObject $item) public function getItemHtml(\Magento\Framework\DataObject $item) { $type = $this->_getItemType($item); + $itemRendererTypeResolver = $this->getData($type . '_renderer_type_resolver'); + if ($itemRendererTypeResolver instanceof ItemRendererTypeResolverInterface) { + $type = $itemRendererTypeResolver->resolve($item) ?? $type; + } $block = $this->getItemRenderer($type)->setItem($item); $this->_prepareItem($block); diff --git a/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php b/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php index 936a0613ac756..43949e8142bf6 100644 --- a/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php +++ b/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php @@ -47,6 +47,8 @@ public function getOrder() } /** + * Get CreditMemo Print Url + * * @param object $creditmemo * @return string */ @@ -56,6 +58,8 @@ public function getPrintCreditmemoUrl($creditmemo) } /** + * Get PrintAll CreditMemos Url + * * @param object $order * @return string */ @@ -92,7 +96,7 @@ public function getCommentsHtml($creditmemo) $html = ''; $comments = $this->getChildBlock('creditmemo_comments'); if ($comments) { - $comments->setEntity($creditmemo)->setTitle(__('About Your Refund')); + $comments->setEntity($creditmemo)->setTitle($this->escapeHtmlAttr(__('About Your Refund'))); $html = $comments->toHtml(); } return $html; diff --git a/app/code/Magento/Sales/Block/Order/Invoice/Items.php b/app/code/Magento/Sales/Block/Order/Invoice/Items.php index e72ee3339c77c..7f93c94a9698d 100644 --- a/app/code/Magento/Sales/Block/Order/Invoice/Items.php +++ b/app/code/Magento/Sales/Block/Order/Invoice/Items.php @@ -12,6 +12,8 @@ namespace Magento\Sales\Block\Order\Invoice; /** + * Sales order invoice items block + * * @api * @since 100.0.2 */ @@ -49,6 +51,8 @@ public function getOrder() } /** + * Get Print Invoice url + * * @param object $invoice * @return string */ @@ -58,6 +62,8 @@ public function getPrintInvoiceUrl($invoice) } /** + * Get PrintAll Invoice url + * * @param object $order * @return string */ @@ -94,7 +100,7 @@ public function getInvoiceCommentsHtml($invoice) $html = ''; $comments = $this->getChildBlock('invoice_comments'); if ($comments) { - $comments->setEntity($invoice)->setTitle(__('About Your Invoice')); + $comments->setEntity($invoice)->setTitle($this->escapeHtmlAttr(__('About Your Invoice'))); $html = $comments->toHtml(); } return $html; diff --git a/app/code/Magento/Sales/Block/Order/Items.php b/app/code/Magento/Sales/Block/Order/Items.php index d7255a24aead5..be3f9ce14c98d 100644 --- a/app/code/Magento/Sales/Block/Order/Items.php +++ b/app/code/Magento/Sales/Block/Order/Items.php @@ -9,18 +9,28 @@ */ namespace Magento\Sales\Block\Order; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Registry; +use Magento\Framework\View\Element\AbstractBlock; +use Magento\Framework\View\Element\Template\Context; +use Magento\Sales\Block\Items\AbstractItems; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\ResourceModel\Order\Item\Collection; +use Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory; +use Magento\Theme\Block\Html\Pager; + /** * Sales order view items block. * * @api * @since 100.0.2 */ -class Items extends \Magento\Sales\Block\Items\AbstractItems +class Items extends AbstractItems { /** * Core registry * - * @var \Magento\Framework\Registry + * @var Registry */ protected $_coreRegistry = null; @@ -32,30 +42,30 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems private $itemsPerPage; /** - * @var \Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory + * @var CollectionFactory */ private $itemCollectionFactory; /** - * @var \Magento\Sales\Model\ResourceModel\Order\Item\Collection|null + * @var Collection|null */ private $itemCollection; /** - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Framework\Registry $registry + * @param Context $context + * @param Registry $registry * @param array $data - * @param \Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory|null $itemCollectionFactory + * @param CollectionFactory|null $itemCollectionFactory */ public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Framework\Registry $registry, + Context $context, + Registry $registry, array $data = [], - \Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory $itemCollectionFactory = null + CollectionFactory $itemCollectionFactory = null ) { $this->_coreRegistry = $registry; - $this->itemCollectionFactory = $itemCollectionFactory ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory::class); + $this->itemCollectionFactory = $itemCollectionFactory ?: ObjectManager::getInstance() + ->get(CollectionFactory::class); parent::__construct($context, $data); } @@ -68,18 +78,12 @@ public function __construct( protected function _prepareLayout() { $this->itemsPerPage = $this->_scopeConfig->getValue('sales/orders/items_per_page'); + $this->itemCollection = $this->createItemsCollection(); - $this->itemCollection = $this->itemCollectionFactory->create(); - $this->itemCollection->setOrderFilter($this->getOrder()); - - /** @var \Magento\Theme\Block\Html\Pager $pagerBlock */ + /** @var Pager $pagerBlock */ $pagerBlock = $this->getChildBlock('sales_order_item_pager'); if ($pagerBlock) { - $pagerBlock->setLimit($this->itemsPerPage); - //here pager updates collection parameters - $pagerBlock->setCollection($this->itemCollection); - $pagerBlock->setAvailableLimit([$this->itemsPerPage]); - $pagerBlock->setShowAmounts($this->isPagerDisplayed()); + $this->preparePager($pagerBlock); } return parent::_prepareLayout(); @@ -122,7 +126,7 @@ public function getItems() */ public function getPagerHtml() { - /** @var \Magento\Theme\Block\Html\Pager $pagerBlock */ + /** @var Pager $pagerBlock */ $pagerBlock = $this->getChildBlock('sales_order_item_pager'); return $pagerBlock ? $pagerBlock->toHtml() : ''; } @@ -130,10 +134,39 @@ public function getPagerHtml() /** * Retrieve current order model instance * - * @return \Magento\Sales\Model\Order + * @return Order */ public function getOrder() { return $this->_coreRegistry->registry('current_order'); } + + /** + * Prepare pager block + * + * @param AbstractBlock $pagerBlock + */ + private function preparePager(AbstractBlock $pagerBlock): void + { + $collectionToPager = $this->createItemsCollection(); + $collectionToPager->addFieldToFilter('parent_item_id', ['null' => true]); + $pagerBlock->setCollection($collectionToPager); + + $pagerBlock->setLimit($this->itemsPerPage); + $pagerBlock->setAvailableLimit([$this->itemsPerPage]); + $pagerBlock->setShowAmounts($this->isPagerDisplayed()); + } + + /** + * Create items collection + * + * @return Collection + */ + private function createItemsCollection(): Collection + { + $collection = $this->itemCollectionFactory->create(); + $collection->setOrderFilter($this->getOrder()); + + return $collection; + } } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create/Reorder.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create/Reorder.php index eeaf4bee1b1c2..19825c9858540 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create/Reorder.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create/Reorder.php @@ -119,7 +119,6 @@ public function execute() $this->_getOrderCreateModel()->initFromOrder($order); $resultRedirect->setPath('sales/*'); } catch (\Magento\Framework\Exception\LocalizedException $e) { - $this->logger->critical($e); $this->messageManager->addErrorMessage($e->getMessage()); return $resultRedirect->setPath('sales/*'); } catch (\Exception $e) { diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddComment.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddComment.php index 4e158efe9702d..5c3e7e482d07b 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddComment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddComment.php @@ -31,7 +31,7 @@ class AddComment extends \Magento\Backend\App\Action /** * @var \Magento\Framework\View\Result\PageFactory */ - protected $pagePageFactory; + protected $resultPageFactory; /** * @var \Magento\Framework\Controller\Result\JsonFactory diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php index d49fa8b8dc608..47a9366727910 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/UpdateQty.php @@ -25,7 +25,7 @@ class UpdateQty extends \Magento\Backend\App\Action implements HttpPostActionInt /** * @var \Magento\Framework\View\Result\PageFactory */ - protected $pagePageFactory; + protected $resultPageFactory; /** * @var \Magento\Framework\Controller\Result\JsonFactory diff --git a/app/code/Magento/Sales/Helper/Guest.php b/app/code/Magento/Sales/Helper/Guest.php index 3b7e491086b17..8de104b62c0a3 100644 --- a/app/code/Magento/Sales/Helper/Guest.php +++ b/app/code/Magento/Sales/Helper/Guest.php @@ -211,7 +211,8 @@ private function setGuestViewCookie($cookieValue) { $metadata = $this->cookieMetadataFactory->createPublicCookieMetadata() ->setPath(self::COOKIE_PATH) - ->setHttpOnly(true); + ->setHttpOnly(true) + ->setSameSite('Lax'); $this->cookieManager->setPublicCookie(self::COOKIE_NAME, $cookieValue, $metadata); } diff --git a/app/code/Magento/Sales/Model/Convert/Order.php b/app/code/Magento/Sales/Model/Convert/Order.php index 0a35aa29da801..cedc964ca7848 100644 --- a/app/code/Magento/Sales/Model/Convert/Order.php +++ b/app/code/Magento/Sales/Model/Convert/Order.php @@ -51,6 +51,11 @@ class Order extends \Magento\Framework\DataObject */ protected $_objectCopyService; + /** + * @var \Magento\Sales\Model\Order\Shipment\ItemFactory + */ + private $_shipmentItemFactory; + /** * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Api\InvoiceRepositoryInterface $invoiceRepository diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index fc8088ffc8383..b164ba6c21499 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -8,6 +8,7 @@ use Magento\Config\Model\Config\Source\Nooptreq; use Magento\Directory\Model\Currency; use Magento\Directory\Model\RegionFactory; +use Magento\Directory\Model\ResourceModel\Region as RegionResource; use Magento\Framework\Api\AttributeValueFactory; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Framework\App\Config\ScopeConfigInterface; @@ -318,6 +319,11 @@ class Order extends AbstractModel implements EntityInterface, OrderInterface */ private $regionItems; + /** + * @var RegionResource + */ + private $regionResource; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -343,15 +349,16 @@ class Order extends AbstractModel implements EntityInterface, OrderInterface * @param ResourceModel\Order\CollectionFactory $salesOrderCollectionFactory * @param PriceCurrencyInterface $priceCurrency * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productListFactory - * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource - * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection + * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource + * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection * @param array $data - * @param ResolverInterface $localeResolver + * @param ResolverInterface|null $localeResolver * @param ProductOption|null $productOption - * @param OrderItemRepositoryInterface $itemRepository - * @param SearchCriteriaBuilder $searchCriteriaBuilder - * @param ScopeConfigInterface $scopeConfig - * @param RegionFactory $regionFactory + * @param OrderItemRepositoryInterface|null $itemRepository + * @param SearchCriteriaBuilder|null $searchCriteriaBuilder + * @param ScopeConfigInterface|null $scopeConfig + * @param RegionFactory|null $regionFactory + * @param RegionResource|null $regionResource * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -387,7 +394,8 @@ public function __construct( OrderItemRepositoryInterface $itemRepository = null, SearchCriteriaBuilder $searchCriteriaBuilder = null, ScopeConfigInterface $scopeConfig = null, - RegionFactory $regionFactory = null + RegionFactory $regionFactory = null, + RegionResource $regionResource = null ) { $this->_storeManager = $storeManager; $this->_orderConfig = $orderConfig; @@ -417,6 +425,7 @@ public function __construct( ->get(SearchCriteriaBuilder::class); $this->scopeConfig = $scopeConfig ?: ObjectManager::getInstance()->get(ScopeConfigInterface::class); $this->regionFactory = $regionFactory ?: ObjectManager::getInstance()->get(RegionFactory::class); + $this->regionResource = $regionResource ?: ObjectManager::getInstance()->get(RegionResource::class); $this->regionItems = []; parent::__construct( @@ -1361,7 +1370,6 @@ public function getShippingMethod($asObject = false) */ public function getAddressesCollection() { - $region = $this->regionFactory->create(); $collection = $this->_addressCollectionFactory->create()->setOrderFilter($this); if ($this->getId()) { foreach ($collection as $address) { @@ -1370,7 +1378,8 @@ public function getAddressesCollection() $address->setRegion($this->regionItems[$address->getCountryId()][$address->getRegion()]); } } else { - $region->loadByName($address->getRegion(), $address->getCountryId()); + $region = $this->regionFactory->create(); + $this->regionResource->loadByName($region, $address->getRegion(), $address->getCountryId()); $this->regionItems[$address->getCountryId()][$address->getRegion()] = $region->getName(); if ($region->getName()) { $address->setRegion($region->getName()); diff --git a/app/code/Magento/Sales/Model/Order/Address/Renderer.php b/app/code/Magento/Sales/Model/Order/Address/Renderer.php index 947c92e04942f..f5803d1121828 100644 --- a/app/code/Magento/Sales/Model/Order/Address/Renderer.php +++ b/app/code/Magento/Sales/Model/Order/Address/Renderer.php @@ -7,8 +7,12 @@ namespace Magento\Sales\Model\Order\Address; use Magento\Customer\Model\Address\Config as AddressConfig; +use Magento\Directory\Helper\Data; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Event\ManagerInterface as EventManager; use Magento\Sales\Model\Order\Address; +use Magento\Store\Model\ScopeInterface; /** * Class Renderer used for formatting an order address @@ -27,18 +31,26 @@ class Renderer */ protected $eventManager; + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + /** * Constructor * * @param AddressConfig $addressConfig * @param EventManager $eventManager + * @param ScopeConfigInterface|null $scopeConfig */ public function __construct( AddressConfig $addressConfig, - EventManager $eventManager + EventManager $eventManager, + ?ScopeConfigInterface $scopeConfig = null ) { $this->addressConfig = $addressConfig; $this->eventManager = $eventManager; + $this->scopeConfig = $scopeConfig ?: ObjectManager::getInstance()->get(ScopeConfigInterface::class); } /** @@ -50,12 +62,27 @@ public function __construct( */ public function format(Address $address, $type) { - $this->addressConfig->setStore($address->getOrder()->getStoreId()); + $storeId = $address->getOrder()->getStoreId(); + $this->addressConfig->setStore($storeId); $formatType = $this->addressConfig->getFormatByCode($type); if (!$formatType || !$formatType->getRenderer()) { return null; } $this->eventManager->dispatch('customer_address_format', ['type' => $formatType, 'address' => $address]); - return $formatType->getRenderer()->renderArray($address->getData()); + $addressData = $address->getData(); + $addressData['locale'] = $this->getLocaleByStoreId((int) $storeId); + + return $formatType->getRenderer()->renderArray($addressData); + } + + /** + * Returns locale by storeId + * + * @param int $storeId + * @return string + */ + private function getLocaleByStoreId(int $storeId): string + { + return $this->scopeConfig->getValue(Data::XML_PATH_DEFAULT_LOCALE, ScopeInterface::SCOPE_STORE, $storeId); } } diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php index c27afe9fb5b0d..db4baabdbd1f0 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php @@ -100,12 +100,11 @@ public function __construct( */ public function send(Creditmemo $creditmemo, $forceSyncMode = false) { + $this->identityContainer->setStore($creditmemo->getStore()); $creditmemo->setSendEmail($this->identityContainer->isEnabled()); if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) { $order = $creditmemo->getOrder(); - $this->identityContainer->setStore($order->getStore()); - $transport = [ 'order' => $order, 'order_id' => $order->getId(), diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php index d0247294e75a1..31fbf3e809004 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php @@ -102,12 +102,11 @@ public function __construct( */ public function send(Invoice $invoice, $forceSyncMode = false) { + $this->identityContainer->setStore($invoice->getStore()); $invoice->setSendEmail($this->identityContainer->isEnabled()); if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) { $order = $invoice->getOrder(); - $this->identityContainer->setStore($order->getStore()); - if ($this->checkIfPartialInvoice($order, $invoice)) { $order->setBaseSubtotal((float) $invoice->getBaseSubtotal()); $order->setBaseTaxAmount((float) $invoice->getBaseTaxAmount()); diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php index a2d61c3b2d31d..5ed017c4de74f 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php @@ -98,6 +98,7 @@ public function __construct( */ public function send(Order $order, $forceSyncMode = false) { + $this->identityContainer->setStore($order->getStore()); $order->setSendEmail($this->identityContainer->isEnabled()); if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) { diff --git a/app/code/Magento/Sales/Model/Order/Invoice/Total/Discount.php b/app/code/Magento/Sales/Model/Order/Invoice/Total/Discount.php index ef7205b374415..f2a99a4765909 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice/Total/Discount.php +++ b/app/code/Magento/Sales/Model/Order/Invoice/Total/Discount.php @@ -71,9 +71,9 @@ public function collect(Invoice $invoice) $invoice->setDiscountAmount(-$totalDiscountAmount); $invoice->setBaseDiscountAmount(-$baseTotalDiscountAmount); - $grandTotal = $invoice->getGrandTotal() - $totalDiscountAmount < 0.0001 + $grandTotal = abs($invoice->getGrandTotal() - $totalDiscountAmount) < 0.0001 ? 0 : $invoice->getGrandTotal() - $totalDiscountAmount; - $baseGrandTotal = $invoice->getBaseGrandTotal() - $baseTotalDiscountAmount < 0.0001 + $baseGrandTotal = abs($invoice->getBaseGrandTotal() - $baseTotalDiscountAmount) < 0.0001 ? 0 : $invoice->getBaseGrandTotal() - $baseTotalDiscountAmount; $invoice->setGrandTotal($grandTotal); $invoice->setBaseGrandTotal($baseGrandTotal); diff --git a/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php index 534bb127db067..0c32c21a36f9f 100644 --- a/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php +++ b/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php @@ -109,11 +109,10 @@ public function send( ShipmentCommentCreationInterface $comment = null, $forceSyncMode = false ) { + $this->identityContainer->setStore($order->getStore()); $shipment->setSendEmail($this->identityContainer->isEnabled()); if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) { - $this->identityContainer->setStore($order->getStore()); - $transport = [ 'order' => $order, 'order_id' => $order->getId(), diff --git a/app/code/Magento/Sales/Model/Service/InvoiceService.php b/app/code/Magento/Sales/Model/Service/InvoiceService.php index ceef0f054015b..c55e1a650b260 100644 --- a/app/code/Magento/Sales/Model/Service/InvoiceService.php +++ b/app/code/Magento/Sales/Model/Service/InvoiceService.php @@ -194,7 +194,7 @@ private function prepareItemsQty( ): array { foreach ($order->getAllItems() as $orderItem) { if (isset($orderItemsQtyToInvoice[$orderItem->getId()])) { - if ($orderItem->isDummy() && $orderItem->getHasChildren()) { + if ($orderItem->getHasChildren()) { $orderItemsQtyToInvoice = $this->setChildItemsQtyToInvoice($orderItem, $orderItemsQtyToInvoice); } } else { diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertActionOnInvoiceGridPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertActionOnInvoiceGridPageActionGroup.xml new file mode 100644 index 0000000000000..fb1e2594c1454 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertActionOnInvoiceGridPageActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertActionOnInvoiceGridPageActionGroup"> + <arguments> + <argument name="action" type="string"/> + </arguments> + <click selector="{{AdminInvoicesGridSection.selectActions}}" stepKey="openActions"/> + <seeElement selector="{{AdminInvoicesGridSection.dropdownActionItem(action)}}" stepKey="seeAction"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup.xml new file mode 100644 index 0000000000000..fe24996ba2834 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup"> + <annotations> + <description>Click create new status button</description> + </annotations> + + <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup.xml new file mode 100644 index 0000000000000..b8c9916283a6c --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup"> + + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickRefundOffline"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccesMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the credit memo." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup.xml new file mode 100644 index 0000000000000..ca33f8f70fccf --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup"> + <annotations> + <description>Admin assert fields filled default billing address from customer</description> + </annotations> + <arguments> + <argument name="namePrefix" type="string" defaultValue=""/> + <argument name="firstName" type="string" defaultValue="{{US_Address_CA.firstname}}"/> + <argument name="middleName" type="string" defaultValue=""/> + <argument name="lastName" type="string" defaultValue="{{US_Address_CA.lastname}}"/> + <argument name="nameSuffix" type="string" defaultValue=""/> + <argument name="company" type="string" defaultValue="{{US_Address_CA.company}}"/> + <argument name="streetLine1" type="string" defaultValue="{{US_Address_CA.street[0]}}"/> + <argument name="streetLine2" type="string" defaultValue="{{US_Address_CA.street[1]}}"/> + <argument name="country" type="string" defaultValue="{{US_Address_CA.country}}"/> + <argument name="state" type="string" defaultValue="{{US_Address_CA.state}}"/> + <argument name="province" type="string" defaultValue=""/> + <argument name="city" type="string" defaultValue="{{US_Address_CA.city}}"/> + <argument name="postcode" type="string" defaultValue="{{US_Address_CA.postcode}}"/> + <argument name="phone" type="string" defaultValue="{{US_Address_CA.telephone}}"/> + <argument name="fax" type="string" defaultValue=""/> + <argument name="vatNumber" type="string" defaultValue="{{US_With_Vat_Number.vat_id}}"/> + </arguments> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.NamePrefix}}" stepKey="getNamePrefix"/> + <assertEquals stepKey="assertNamePrefix"> + <expectedResult type="string">{{namePrefix}}</expectedResult> + <actualResult type="variable">getNamePrefix</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="getFirstName"/> + <assertEquals stepKey="assertFirstName"> + <expectedResult type="string">{{firstName}}</expectedResult> + <actualResult type="variable">getFirstName</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.MiddleName}}" stepKey="getMiddleName"/> + <assertEquals stepKey="assertMiddleName"> + <expectedResult type="string">{{middleName}}</expectedResult> + <actualResult type="variable">getMiddleName</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="getLastName"/> + <assertEquals stepKey="assertLastName"> + <expectedResult type="string">{{lastName}}</expectedResult> + <actualResult type="variable">getLastName</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.NameSuffix}}" stepKey="getNameSuffix"/> + <assertEquals stepKey="assertNameSuffix"> + <expectedResult type="string">{{nameSuffix}}</expectedResult> + <actualResult type="variable">getNameSuffix</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Company}}" stepKey="getCompany"/> + <assertEquals stepKey="assertCompany"> + <expectedResult type="string">{{company}}</expectedResult> + <actualResult type="variable">getCompany</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" stepKey="getStreetLine1"/> + <assertEquals stepKey="assertStreetLine1"> + <expectedResult type="string">{{streetLine1}}</expectedResult> + <actualResult type="variable">getStreetLine1</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.StreetLine2}}" stepKey="getStreetLine2"/> + <assertEquals stepKey="assertStreetLine2"> + <expectedResult type="string">{{streetLine2}}</expectedResult> + <actualResult type="variable">getStreetLine2</actualResult> + </assertEquals> + <grabTextFrom selector="{{AdminOrderFormBillingAddressSection.countrySelectedOption}}" stepKey="getCountrySelectedOption"/> + <assertEquals stepKey="assertCountrySelectedOption"> + <expectedResult type="string">{{country}}</expectedResult> + <actualResult type="variable">getCountrySelectedOption</actualResult> + </assertEquals> + <grabTextFrom selector="{{AdminOrderFormBillingAddressSection.stateSelectedOption}}" stepKey="getStateSelectedOption"/> + <assertEquals stepKey="assertStateSelectedOption"> + <expectedResult type="string">{{state}}</expectedResult> + <actualResult type="variable">getStateSelectedOption</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Province}}" stepKey="getProvince"/> + <assertEquals stepKey="assertProvince"> + <expectedResult type="string">{{province}}</expectedResult> + <actualResult type="variable">getProvince</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="getCity"/> + <assertEquals stepKey="assertCity"> + <expectedResult type="string">{{city}}</expectedResult> + <actualResult type="variable">getCity</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="getPostCode"/> + <assertEquals stepKey="assertPostCode"> + <expectedResult type="string">{{postcode}}</expectedResult> + <actualResult type="variable">getPostCode</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="getPhone"/> + <assertEquals stepKey="assertPhone"> + <expectedResult type="string">{{phone}}</expectedResult> + <actualResult type="variable">getPhone</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Fax}}" stepKey="getFax"/> + <assertEquals stepKey="assertFax"> + <expectedResult type="string">{{fax}}</expectedResult> + <actualResult type="variable">getFax</actualResult> + </assertEquals> + <grabValueFrom selector="{{AdminOrderFormBillingAddressSection.VatNumber}}" stepKey="getVatNumber"/> + <assertEquals stepKey="assertVatNumber"> + <expectedResult type="string">{{vatNumber}}</expectedResult> + <actualResult type="variable">getVatNumber</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminCreateOrderFormShippingAddressActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminCreateOrderFormShippingAddressActionGroup.xml new file mode 100644 index 0000000000000..32cedca015c97 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminCreateOrderFormShippingAddressActionGroup.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * seeInField COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminCreateOrderFormShippingAddressActionGroup"> + <annotations> + <description>Verify shipping address inputs on admin create order page. Start on admin create new order page.</description> + </annotations> + <arguments> + <argument name="prefix" type="string" defaultValue="{{CustomerAddressSimple.prefix}}"/> + <argument name="firstname" type="string" defaultValue="{{CustomerAddressSimple.firstname}}"/> + <argument name="middleName" type="string" defaultValue="{{CustomerAddressSimple.middlename}}"/> + <argument name="lastname" type="string" defaultValue="{{CustomerAddressSimple.lastname}}"/> + <argument name="suffix" type="string" defaultValue="{{CustomerAddressSimple.suffix}}"/> + <argument name="company" type="string" defaultValue="{{CustomerAddressSimple.company}}"/> + <argument name="streetLine1" type="string" defaultValue="{{CustomerAddressSimple.street[0]}}"/> + <argument name="streetLine2" type="string" defaultValue="{{CustomerAddressSimple.street[1]}}"/> + <argument name="city" type="string" defaultValue="{{CustomerAddressSimple.city}}"/> + <argument name="countryId" type="string" defaultValue="{{CustomerAddressSimple.country_id}}"/> + <argument name="state" type="string" defaultValue="{{CustomerAddressSimple.state}}"/> + <argument name="province" type="string" defaultValue=""/> + <argument name="postcode" type="string" defaultValue="{{CustomerAddressSimple.postcode}}"/> + <argument name="telephone" type="string" defaultValue="{{CustomerAddressSimple.telephone}}"/> + <argument name="fax" type="string" defaultValue="{{CustomerAddressSimple.fax}}"/> + <argument name="vatNumber" type="string" defaultValue=""/> + </arguments> + + <waitForElementVisible selector="{{AdminOrderFormShippingAddressSection.NamePrefix}}" stepKey="waitForInputVisible"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.NamePrefix}}" userInput="{{prefix}}" stepKey="verifyPrefix"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.FirstName}}" userInput="{{firstname}}" stepKey="verifyFirstName"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.MiddleName}}" userInput="{{middleName}}" stepKey="verifyMiddleName"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.LastName}}" userInput="{{lastname}}" stepKey="verifyLastName"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.NameSuffix}}" userInput="{{suffix}}" stepKey="verifySuffix"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.Company}}" userInput="{{company}}" stepKey="verifyCompany"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.StreetLine1}}" userInput="{{streetLine1}}" stepKey="verifyStreetLine1"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.StreetLine2}}" userInput="{{streetLine2}}" stepKey="verifyStreetLine2"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.City}}" userInput="{{city}}" stepKey="verifyCity"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.Country}}" userInput="{{countryId}}" stepKey="verifyCountry"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.State}}" userInput="{{state}}" stepKey="verifyState"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.Province}}" userInput="{{province}}" stepKey="verifyProvince"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.PostalCode}}" userInput="{{postcode}}" stepKey="verifyPostalCode"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.Phone}}" userInput="{{telephone}}" stepKey="verifyPhone"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.Fax}}" userInput="{{fax}}" stepKey="verifyFax"/> + <seeInField selector="{{AdminOrderFormShippingAddressSection.VatNumber}}" userInput="{{vatNumber}}" stepKey="verifyVatNumber"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup.xml new file mode 100644 index 0000000000000..1f2076a4d73da --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup"> + <annotations> + <description>Checks the provided payment method radio button presents on the Admin Create Order page.</description> + </annotations> + <arguments> + <argument name="paymentMethodName" type="string" defaultValue="Check / Money order"/> + </arguments> + + <conditionalClick selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" dependentSelector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" visible="true" stepKey="clickGetAvailablePaymentMethods"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> + <seeElement selector="{{AdminOrderFormPaymentSection.paymentLabelWithRadioButton(paymentMethodName)}}" stepKey="seeLabelWithRadioButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml index db3343794de01..3c2a5d7de0657 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AssertOrderAddressInformationActionGroup" extends="VerifyBasicOrderInformationActionGroup"> <remove keyForRemoval="seeCustomerName"/> <remove keyForRemoval="seeCustomerEmail"/> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressWithStateInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressWithStateInformationActionGroup.xml new file mode 100644 index 0000000000000..3b3c6fc4472ed --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressWithStateInformationActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertOrderAddressWithStateInformationActionGroup" extends="VerifyBasicOrderInformationActionGroup"> + <remove keyForRemoval="seeCustomerName"/> + <remove keyForRemoval="seeCustomerEmail"/> + <remove keyForRemoval="seeCustomerGroup"/> + <remove keyForRemoval="seeBillingAddressCountry"/> + <remove keyForRemoval="seeShippingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.state}}" stepKey="seeBillingAddressState"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.state}}" stepKey="seeShippingAddressState"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminCustomerConfigAddressTemplateSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminCustomerConfigAddressTemplateSection.xml new file mode 100644 index 0000000000000..711d8b14f691d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminCustomerConfigAddressTemplateSection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminCustomerConfigAddressTemplateSection"> + <element name="addressTemplatesTab" type="button" selector=".entry-edit-head #customer_address_templates-head" timeout="30"/> + <element name="addressTemplatesTabIsOpen" type="button" selector="//*[@class='entry-edit-head admin__collapsible-block']/a[@id='customer_address_templates-head' and @class='open']" timeout="30"/> + <element name="addressTemplateTypeDefaultCheckbox" type="checkbox" selector="#row_customer_address_templates_{{type_of_template}} #customer_address_templates_{{type_of_template}}_inherit" timeout="30" parameterized="true"/> + <element name="addressTemplateTypeValueInput" type="input" selector="#row_customer_address_templates_{{type_of_template}} #customer_address_templates_{{type_of_template}}" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesGridSection.xml index d4c4a9a0106ef..5b33008e9aad3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesGridSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicesGridSection.xml @@ -13,5 +13,7 @@ <element name="filter" type="button" selector="#container > div > div.admin__data-grid-header > div:nth-child(1) > div.data-grid-filters-actions-wrap > div > button"/> <element name="firstRow" type="button" selector="tr.data-row:nth-of-type(1)"/> <element name="clearFilters" type="button" selector="button.action-clear" timeout="30"/> + <element name="selectActions" type="button" selector=".action-select-wrap > .action-select" timeout="30"/> + <element name="dropdownActionItem" type="button" selector="(//div[contains(@class, 'action-select-wrap')]//span[text()='{{action}}'])[1]" timeout="30" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormBillingAddressSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormBillingAddressSection.xml index 279cf1dde15b3..391cc7ec999aa 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormBillingAddressSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormBillingAddressSection.xml @@ -20,7 +20,9 @@ <element name="StreetLine2" type="input" selector="#order-billing_address_street1" timeout="30"/> <element name="City" type="input" selector="#order-billing_address_city" timeout="30"/> <element name="Country" type="select" selector="#order-billing_address_country_id" timeout="30"/> + <element name="countrySelectedOption" type="select" selector="#order-billing_address_country_id option:checked"/> <element name="State" type="select" selector="#order-billing_address_region_id" timeout="30"/> + <element name="stateSelectedOption" type="select" selector="#order-billing_address_region_id option:checked"/> <element name="Province" type="input" selector="#order-billing_address_region" timeout="30"/> <element name="PostalCode" type="input" selector="#order-billing_address_postcode" timeout="30"/> <element name="Phone" type="input" selector="#order-billing_address_telephone" timeout="30"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml index 4f065ec7eb748..2e9b8b18d0586 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminOrderFormConfigureProductSection"> <element name="configure" type="button" selector="//a[@product_id='{{productId}}']" parameterized="true"/> - <element name="optionSelect" type="select" selector="//div[contains(@class,'product-options')]//select[//label[text() = '{{option}}']]" parameterized="true"/> + <element name="optionSelect" type="select" selector="//div[contains(@class,'product-options')]//select[//label[text() = '{{option}}']]" timeout="30" parameterized="true"/> <element name="optionSelectNew" type="select" selector="//label[text()='{{option1}}']/following-sibling::div/select" parameterized="true"/> <element name="quantity" type="input" selector="#product_composite_configure_input_qty"/> <element name="ok" type="button" selector=".modal-header .page-actions button[data-role='action']" timeout="30"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml index fae0bd4589580..5736b6b80b69e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml @@ -11,7 +11,7 @@ <section name="AdminOrderFormItemsOrderedSection"> <element name="addProductsBySku" type="button" selector="//section[@id='order-items']//span[contains(text(),'Add Products By SKU')]"/> <element name="configureButtonBySku" type="button" selector="//div[@class='sku-configure-button']//span[contains(text(),'Configure')]"/> - <element name="configureProductOk" type="button" selector="//div[@class='page-main-actions']//span[contains(text(),'OK')]"/> + <element name="configureProductOk" type="button" selector="//div[@class='page-main-actions']//span[contains(text(),'OK')]" timeout="30"/> <element name="configureProductQtyField" type="input" selector="//*[@id='super-product-table']/tbody/tr[{{arg}}]/td[5]/input[1]" parameterized="true"/> <element name="addProductToOrder" type="input" selector="//*[@title='Add Products to Order']" timeout="30"/> <element name="itemsOrderedSummaryText" type="textarea" selector="//table[@class='data-table admin__table-primary order-tables']/tfoot/tr"/> @@ -19,5 +19,6 @@ <element name="itemsSKU" type="text" selector="(//div[contains(@class, 'product-sku-block')])[{{productNumber}}]" parameterized="true"/> <element name="moveProduct" type="select" selector="//td[contains(.,'{{productName}}')]/../..//td//select" parameterized="true"/> <element name="productMessage" type="text" selector="//section[@id = 'order-items']//span[text()='{{productName}}']/ancestor::tr/..//div[contains(@class, 'message-{{messageType}}')]" parameterized="true"/> + <element name="productPrice" type="text" selector="//div[@id = 'order-errors']//strong[text()='{{productName}}']/ancestor::tr/td[@data-column='price']" timeout="30" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml index 72fe45465c67b..f17172a1f75c8 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml @@ -29,5 +29,6 @@ <element name="purchaseOrderOption" type="radio" selector="#p_method_purchaseorder" timeout="30"/> <element name="purchaseOrderNumber" type="input" selector="#po_number"/> <element name="freePaymentLabel" type="text" selector="#order-billing_method_form label[for='p_method_free']"/> + <element name="paymentLabelWithRadioButton" type="text" selector="#order-billing_method_form .admin__field-option input[title='{{paymentMethodName}}'] + label" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml index a6b856f9f814f..6434a4358711d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml @@ -19,15 +19,15 @@ <element name="website" type="radio" selector="//label[contains(text(), '{{arg}}')]" parameterized="true"/> <element name="addProducts" type="button" selector="#add_products" timeout="60"/> - <element name="selectProduct" type="checkbox" selector="//td[contains(text(), '{{arg}}')]/following-sibling::td[contains(@class, 'col-select col-in_products')]/label/input" parameterized="true"/> - <element name="setQuantity" type="checkbox" selector="//td[contains(text(), '{{arg}}')]/following-sibling::td[contains(@class, 'col-qty')]/input" parameterized="true"/> + <element name="selectProduct" type="checkbox" selector="//td[contains(., '{{arg}}')]/following-sibling::td[contains(@class, 'col-select col-in_products')]/label/input" parameterized="true"/> + <element name="setQuantity" type="checkbox" selector="//td[contains(., '{{arg}}')]/following-sibling::td[contains(@class, 'col-qty')]/input" parameterized="true"/> <element name="addProductsToOrder" type="button" selector="//span[text()='Add Selected Product(s) to Order']"/> - <element name="customPrice" type="checkbox" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td/div//span[contains(text(),'Custom Price')]" parameterized="true"/> - <element name="customQuantity" type="input" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td[@class='col-qty']/input" parameterized="true"/> + <element name="customPrice" type="checkbox" selector="//span[.='{{arg}}']/parent::td/following-sibling::td/div//span[contains(text(),'Custom Price')]" parameterized="true"/> + <element name="customQuantity" type="input" selector="//span[.='{{arg}}']/parent::td/following-sibling::td[@class='col-qty']/input" parameterized="true"/> <element name="update" type="button" selector="//span[text()='Update Items and Quantities']"/> - <element name="discount" type="text" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td[@class='col-discount col-price']/span" parameterized="true"/> - <element name="productPrice" type="text" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td[@class='col-price col-row-subtotal']/span" parameterized="true"/> - <element name="removeItems" type="select" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td/select[@class='admin__control-select']" parameterized="true"/> + <element name="discount" type="text" selector="//span[.='{{arg}}']/parent::td/following-sibling::td[@class='col-discount col-price']/span" parameterized="true"/> + <element name="productPrice" type="text" selector="//span[.='{{arg}}']/parent::td/following-sibling::td[@class='col-price col-row-subtotal']/span" parameterized="true"/> + <element name="removeItems" type="select" selector="//span[.='{{arg}}']/parent::td/following-sibling::td/select[@class='admin__control-select']" parameterized="true"/> <element name="applyCoupon" type="input" selector="#coupons:code"/> <element name="submitOrder" type="button" selector="#submit_order_top_button" timeout="60"/> </section> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml index 12beba19b4375..7cf0bf1a15cca 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml @@ -20,5 +20,6 @@ <element name="paymentMethod" type="text" selector=".box-order-billing-method dt.title"/> <element name="shippingMethod" type="text" selector=".box-order-shipping-method div.box-content"/> <element name="productNameCell" type="text" selector="//*[contains(@class, 'product-item-name')]"/> - </section> + <element name="shippingAddressBlock" type="block" selector=".block-order-details-view .box-order-shipping-address .box-content"/> + </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml index afede97556513..140a54b4b6e15 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml @@ -25,9 +25,7 @@ </createData> <!-- Enable *Free Shipping* --> <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> @@ -39,9 +37,7 @@ <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> <argument name="customerEmail" value="Simple_US_Customer.email"/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> -</actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> </after> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml index 7d6e2048c9432..ca3a9724e36e4 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml @@ -94,12 +94,8 @@ <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct1"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml index 9f09a59fa8d5e..1a785616a9101 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml @@ -35,12 +35,8 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct"> <field key="price">10.00</field> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set {{DisablePurchaseOrderConfigData.path}} {{DisablePurchaseOrderConfigData.value}}" stepKey="disablePurchaseOrderPayment"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckNewCreditMemoTotalsForFranceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckNewCreditMemoTotalsForFranceTest.xml index 03691cdd537d5..41e8df9370b5f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckNewCreditMemoTotalsForFranceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckNewCreditMemoTotalsForFranceTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCheckNewCreditMemoTotalsForFranceTest" extends="AdminCreateCreditMemoWithCashOnDeliveryTest"> + <test name="AdminCheckNewCreditMemoTotalsForFranceTest" extends="AdminCreateCreditMemoForOrderWithCashOnDeliveryTest"> <annotations> <stories value="Credit memo entity for France locale"/> <title value="Credit memo entity for France locale"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingFieldsFilledFromDefaultBillingAddressCustomerInNewOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingFieldsFilledFromDefaultBillingAddressCustomerInNewOrderTest.xml new file mode 100644 index 0000000000000..4d50217d3615e --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingFieldsFilledFromDefaultBillingAddressCustomerInNewOrderTest.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckingFieldsFilledFromDefaultBillingAddressCustomerInNewOrderTest"> + <annotations> + <features value="Sales"/> + <stories value="Create order in Admin"/> + <title value="Checking fields filled from default billing address customer"/> + <description value="Checking fields filled from default billing address customer on create new order page"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-40646"/> + <useCaseId value="MC-37657"/> + <group value="sales"/> + <group value="customer"/> + </annotations> + <before> + <createData entity="Customer_With_Vat_Number" stepKey="createCustomer"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + </after> + + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> + <argument name="customer" value="$createCustomer$"/> + </actionGroup> + <actionGroup ref="AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup" stepKey="assertFieldsFilled"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingPaymentMethodRadioButtonPresentAfterReloadOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingPaymentMethodRadioButtonPresentAfterReloadOrderPageTest.xml new file mode 100644 index 0000000000000..c29b2aa167ed7 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingPaymentMethodRadioButtonPresentAfterReloadOrderPageTest.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckingPaymentMethodRadioButtonPresentAfterReloadOrderPageTest"> + <annotations> + <features value="Sales"/> + <stories value="Create order in Admin"/> + <title value="Checking payment method radio button is presented after reloading the order page"/> + <description value="Checking payment method radio button is presented after reloading the order page"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-40878"/> + <useCaseId value="MC-40013"/> + <group value="sales"/> + </annotations> + <before> + <!-- Enable Check/Money order payment method --> + <magentoCLI command="config:set {{EnablePaymentCheckMOConfigData.path}} {{EnablePaymentCheckMOConfigData.value}}" stepKey="enableCheckMoneyOrderPayment"/> + <!-- Enable Bank Transfer Payment method --> + <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> + <!-- Create simple product --> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <!-- Create customer --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <!-- Login to Admin page --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <!-- Disable Bank Transfer Payment method --> + <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="disableBankTransferPayment"/> + <!-- Delete entities --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <!-- Logout from Admin page --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Create new order --> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> + <argument name="customer" value="$createCustomer$"/> + </actionGroup> + + <!-- Add Simple product to order --> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> + <argument name="product" value="$createProduct$"/> + </actionGroup> + + <!-- Assert label with radio button presents on the page --> + <actionGroup ref="AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup" stepKey="assertCheckMORadioButtonIsPresent"/> + <actionGroup ref="AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup" stepKey="assertBankTransferRadioButtonIsPresent"> + <argument name="paymentMethodName" value="Bank Transfer Payment"/> + </actionGroup> + + <actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/> + + <!-- Assert label with radio button presents after reload the page --> + <actionGroup ref="AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup" stepKey="assertCheckMORadioButtonIsPresentAfterReload"/> + <actionGroup ref="AssertAdminPaymentMethodRadioButtonExistsOnCreateOrderPageActionGroup" stepKey="assertBankTransferRadioButtonIsPresentAfterReload"> + <argument name="paymentMethodName" value="Bank Transfer Payment"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml index 33bc1a39ca11a..3a87c5fe6338a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml @@ -57,16 +57,13 @@ </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Go to bundle product page--> - <amOnPage url="{{StorefrontProductPage.url($$createCategory.name$$)}}" stepKey="navigateToBundleProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToBundleProductPage"/> <!--Place order bundle product with 10 options--> - <actionGroup ref="StorefrontAddCategoryBundleProductToCartActionGroup" stepKey="addBundleProductToCart"> + <actionGroup ref="StorefrontAddCategoryBundleProductWithSingleChoiceToCartActionGroup" stepKey="addBundleProductToCart"> <argument name="product" value="$$createBundleProduct$$"/> <argument name="quantity" value="10"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoForOrderWithCashOnDeliveryTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoForOrderWithCashOnDeliveryTest.xml new file mode 100644 index 0000000000000..7709b847b996b --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoForOrderWithCashOnDeliveryTest.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCreateCreditMemoForOrderWithCashOnDeliveryTest"> + <annotations> + <stories value="Credit memo entity"/> + <title value="Create Credit Memo with cash on delivery payment method"/> + <description value="Create Credit Memo with cash on delivery payment and assert 0 shipping refund"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-15863"/> + <group value="sales"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="defaultSimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <magentoCLI command="config:set {{enabledCashOnDeliveryPayment.label}} {{enabledCashOnDeliveryPayment.value}}" stepKey="enableBankTransfer"/> + + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + + <updateData createDataKey="createCustomerCart" entity="CashOnDeliveryOrderPaymentMethod" stepKey="sendCustomerPaymentInformation"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + + <createData entity="Invoice" stepKey="invoiceOrderOne"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + + </before> + <after> + <magentoCLI command="config:set {{disabledCashOnDeliveryPayment.label}} {{disabledCashOnDeliveryPayment.value}}" stepKey="disableBankTransfer"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="grabOrderId"/> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById"> + <argument name="orderId" value="{$grabOrderId}"/> + </actionGroup> + + <actionGroup ref="AdminOpenAndFillCreditMemoRefundActionGroup" stepKey="fillCreditMemoRefund"> + <argument name="itemQtyToRefund" value="1"/> + <argument name="shippingRefund" value="0"/> + <argument name="adjustmentRefund" value="5"/> + <argument name="adjustmentFee" value="10"/> + </actionGroup> + + <actionGroup ref="AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup" stepKey="clickRefundOffline"/> + + <actionGroup ref="AdminOpenCreditMemoFromOrderPageActionGroup" stepKey="openCreditMemo"/> + + <actionGroup ref="AssertAdminCreditMemoViewPageTotalsActionGroup" stepKey="assertCreditMemoViewPageTotals"> + <argument name="subtotal" value="$560.00"/> + <argument name="adjustmentRefund" value="$5.00"/> + <argument name="adjustmentFee" value="$10.00"/> + <argument name="grandTotal" value="$555.00"/> + </actionGroup> + + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <actionGroup ref="StorefrontGoToCustomerOrderDetailsPageActionGroup" stepKey="openOrderDetailPage"> + <argument name="orderId" value="$createCustomerCart.return$"/> + <argument name="orderNumber" value="{$grabOrderId}"/> + </actionGroup> + + <actionGroup ref="StorefrontClickRefundTabCustomerOrderViewActionGroup" stepKey="clickRefund"/> + <see selector="{{StorefrontCustomerOrderSection.grandTotalRefund}}" userInput="555.00" stepKey="seeGrandTotal"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml index a1027a9987b1f..5ff2f19d797b2 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml @@ -8,15 +8,18 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCreateCreditMemoWithCashOnDeliveryTest"> + <test name="AdminCreateCreditMemoWithCashOnDeliveryTest" deprecated="Use AdminCreateCreditMemoForOrderWithCashOnDeliveryTest instead"> <annotations> <stories value="Credit memo entity"/> - <title value="Create Credit Memo with cash on delivery payment method"/> + <title value="DEPRECATED. Create Credit Memo with cash on delivery payment method"/> <description value="Create Credit Memo with cash on delivery payment and assert 0 shipping refund"/> <severity value="CRITICAL"/> <testCaseId value="MC-15863"/> <group value="sales"/> <group value="mtf_migrated"/> + <skip> + <issueId value="DEPRECATED">Use AdminCreateCreditMemoForOrderWithCashOnDeliveryTest instead</issueId> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml index 96007caf0f8ba..b0af455ebd931 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml @@ -19,7 +19,7 @@ <group value="sales"/> <skip> <issueId value="DEPRECATED">Use AdminInvoiceOrderTest instead</issueId> - </skip> + </skip> </annotations> <before> <createData entity="_defaultCategory" stepKey="createCategory"/> @@ -34,7 +34,7 @@ </after> <!-- todo: Create an order via the api instead of driving the browser --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> <actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml index 5c61a8b089b97..f3ce8106c2730 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml @@ -27,7 +27,7 @@ <!-- Go to new order status page --> <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <actionGroup ref="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> <actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml index 84bda226c9512..f8e7be5fdb5b6 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml @@ -27,7 +27,7 @@ <!-- Go to new order status page --> <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <actionGroup ref="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> <actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml index f4ad885429189..c5fc6170d2782 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml @@ -27,7 +27,7 @@ <!-- Go to new order status page --> <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <actionGroup ref="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup" stepKey="clickCreateNewStatus"/> <!-- Fill the form and validate message --> <actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml index 68a8e9d347ddd..3b782aa4e22f4 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml @@ -24,9 +24,7 @@ <requiredEntity createDataKey="category"/> </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!--Clean up created test data.--> @@ -35,9 +33,7 @@ <!--Enable required 'email' field on create order page.--> <magentoCLI command="config:set {{EnableEmailRequiredForOrder.path}} {{EnableEmailRequiredForOrder.value}}" stepKey="enableRequiredFieldEmailForAdminOrderCreation"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <!--Create order.--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml index bf8e7e1868184..741928d3baa85 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml @@ -28,9 +28,7 @@ <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShippingMethod"/> <createData entity="setFreeShippingSubtotal" stepKey="setFreeShippingSubtotal"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> @@ -40,9 +38,7 @@ <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/> <createData entity="setFreeShippingSubtotalToDefault" stepKey="setFreeShippingSubtotalToDefault"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <!--Create new order with existing customer--> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminInvoiceOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminInvoiceOrderTest.xml index 922037fe4a3cd..c33dd04aa1b2c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminInvoiceOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminInvoiceOrderTest.xml @@ -18,8 +18,7 @@ <testCaseId value="MAGETWO-72096"/> <group value="sales"/> </annotations> - - <before> + <before> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="_defaultProduct" stepKey="createSimpleProductApi"> <requiredEntity createDataKey="createCategory"/> @@ -34,33 +33,31 @@ </createData> <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> <requiredEntity createDataKey="createGuestCart"/> - </updateData> + </updateData> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - </before> - <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProductApi" stepKey="deleteSimpleProductApi"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> - <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrder"> <argument name="entityId" value="$createGuestCart.return$"/> - </actionGroup> + </actionGroup> + + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOrderId"/> <actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createInvoice"/> <actionGroup ref="FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup" stepKey="filterInvoiceGridByOrderId"> - <argument name="orderId" value="$createGuestCart.return$"/> + <argument name="orderId" value="$grabOrderId"/> </actionGroup> <actionGroup ref="AdminSelectFirstGridRowActionGroup" stepKey="openInvoiceFromGrid"/> <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkIfOrderStatusIsProcessing"> <argument name="status" value="Processing"/> - </actionGroup> - + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndProcessingTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndProcessingTest.xml new file mode 100644 index 0000000000000..2671cd6989c51 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndProcessingTest.xml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminMassOrdersCancelClosedAndProcessingTest"> + <annotations> + <stories value="Mass Update Orders"/> + <title value="Mass cancel orders in status Processing, Closed"/> + <description value="Try to cancel orders in status Processing, Closed"/> + <severity value="MAJOR"/> + <testCaseId value="MC-16184"/> + <group value="sales"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="defaultSimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <createData entity="CustomerCart" stepKey="createCustomerCartOne"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + <updateData createDataKey="createCustomerCartOne" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrderOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + + <createData entity="CustomerCart" stepKey="createCustomerCartTwo"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddressTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + <updateData createDataKey="createCustomerCartTwo" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrderTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + <createData entity="CreditMemo" stepKey="refundOrderTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCartOne.return$)}}" stepKey="getFirstOrderId"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCartTwo.return$)}}" stepKey="getSecondOrderId"/> + + <actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel"> + <argument name="action" value="Cancel"/> + <argument name="orderId" value="{$getFirstOrderId}"/> + <argument name="secondOrderId" value="{$getSecondOrderId}"/> + </actionGroup> + <see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/> + + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> + <argument name="orderId" value="{$getFirstOrderId}"/> + <argument name="orderStatus" value="Processing"/> + </actionGroup> + <see userInput="{$getFirstOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> + <see userInput="Processing" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> + + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> + <argument name="orderId" value="{$getSecondOrderId}"/> + <argument name="orderStatus" value="Closed"/> + </actionGroup> + <see userInput="{$getSecondOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> + <see userInput="Closed" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml index 6eb4195524224..3400e07373f54 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml @@ -8,15 +8,18 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminMassOrdersCancelProcessingAndClosedTest"> + <test name="AdminMassOrdersCancelProcessingAndClosedTest" deprecated="Use AdminMassOrdersCancelClosedAndProcessingTest instead"> <annotations> <stories value="Mass Update Orders"/> - <title value="Mass cancel orders in status Processing, Closed"/> + <title value="DEPRECATED. Mass cancel orders in status Processing, Closed"/> <description value="Try to cancel orders in status Processing, Closed"/> <severity value="MAJOR"/> <testCaseId value="MC-16184"/> <group value="sales"/> <group value="mtf_migrated"/> + <skip> + <issueId value="DEPRECATED">Use AdminMassOrdersCancelClosedAndProcessingTest instead</issueId> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml index 41964cbf605da..592c8b7981bed 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml @@ -21,7 +21,6 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> - <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="defaultSimpleProduct" stepKey="createProduct"> @@ -29,43 +28,49 @@ </createData> </before> <after> - <!-- Delete data --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Create order --> - <actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> - <argument name="product" value="$$createProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderId"> - <actualResult type="const">$getOrderId</actualResult> - </assertNotEmpty> - - <!-- Create Shipment for Order --> - <actionGroup ref="AdminCreateInvoiceAndShipmentActionGroup" stepKey="createShipment"/> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="createFirstOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="getOrderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertOrderIdIsNotEmpty"/> + <createData entity="Shipment" stepKey="createShipment"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> - <!-- Navigate to backend: Go to Sales > Orders --> <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="grabOrderId"/> - <!-- Select Mass Action according to dataset: Hold --> <actionGroup ref="AdminOrderActionOnGridActionGroup" stepKey="actionHold"> <argument name="action" value="Hold"/> - <argument name="orderId" value="$getOrderId"/> + <argument name="orderId" value="$grabOrderId"/> </actionGroup> <see userInput="No order(s) were put on hold." stepKey="assertOrderOnHoldFailMessage"/> - <!--Assert order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> - <argument name="orderId" value="{$getOrderId}"/> + <argument name="orderId" value="{$grabOrderId}"/> <argument name="orderStatus" value="Complete"/> </actionGroup> - <see userInput="{$getOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> + <see userInput="{$grabOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> <see userInput="Complete" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertOrderStatus"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml index 2a4ad174abae0..7e6fe8fd6ca90 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml @@ -8,15 +8,18 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminMassOrdersHoldOnPendingAndProcessingTest"> + <test name="AdminMassOrdersHoldOnPendingAndProcessingTest" deprecated="Use AdminMassOrdersHoldOnProcessingAndPendingTest"> <annotations> <stories value="Mass Update Orders"/> - <title value="Mass put orders in statuses Pending, Processing on Hold"/> + <title value="DEPRECATED. Mass put orders in statuses Pending, Processing on Hold"/> <description value="Put orders in statuses Pending, Processing on Hold"/> <severity value="MAJOR"/> <testCaseId value="MC-16185"/> <group value="sales"/> <group value="mtf_migrated"/> + <skip> + <issueId value="DEPRECATED">Use AdminMassOrdersHoldOnProcessingAndPendingTest</issueId> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnProcessingAndPendingTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnProcessingAndPendingTest.xml new file mode 100644 index 0000000000000..97970cb5deed6 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnProcessingAndPendingTest.xml @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminMassOrdersHoldOnProcessingAndPendingTest"> + <annotations> + <stories value="Mass Update Orders"/> + <title value="Mass put orders in statuses Pending, Processing on Hold"/> + <description value="Put orders in statuses Pending, Processing on Hold"/> + <severity value="MAJOR"/> + <testCaseId value="MC-16185"/> + <group value="sales"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="defaultSimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <createData entity="CustomerCart" stepKey="createCustomerCartOne"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </createData> + <updateData createDataKey="createCustomerCartOne" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationOne"> + <requiredEntity createDataKey="createCustomerCartOne"/> + </updateData> + + <createData entity="CustomerCart" stepKey="createCustomerCartTwo"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItemTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddressTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + <updateData createDataKey="createCustomerCartTwo" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformationTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </updateData> + <createData entity="Invoice" stepKey="invoiceOrderTwo"> + <requiredEntity createDataKey="createCustomerCartTwo"/> + </createData> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCartOne.return$)}}" stepKey="getFirstOrderId"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCartTwo.return$)}}" stepKey="getSecondOrderId"/> + + <actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionHold"> + <argument name="action" value="Hold"/> + <argument name="orderId" value="{$getFirstOrderId}"/> + <argument name="secondOrderId" value="{$getSecondOrderId}"/> + </actionGroup> + <see userInput="You have put 2 order(s) on hold." stepKey="assertOrderOnHoldSuccessMessage"/> + + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> + <argument name="orderId" value="{$getFirstOrderId}"/> + <argument name="orderStatus" value="On Hold"/> + </actionGroup> + <see userInput="{$getFirstOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> + <see userInput="On Hold" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> + + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> + <argument name="orderId" value="{$getSecondOrderId}"/> + <argument name="orderStatus" value="On Hold"/> + </actionGroup> + <see userInput="{$getSecondOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> + <see userInput="On Hold" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml index 163da4917b50a..e8b842a48890e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml @@ -20,7 +20,6 @@ </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> - <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="defaultSimpleProduct" stepKey="createProduct"> @@ -28,40 +27,43 @@ </createData> </before> <after> - <!-- Delete data --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Create order --> - <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> - <argument name="product" value="$$createProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderId"> - <actualResult type="const">$getOrderId</actualResult> - </assertNotEmpty> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="createOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="getOrderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertOrderIdIsNotEmpty"/> - <!-- Navigate to backend: Go to Sales > Orders --> <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="grabOrderId"/> - <!-- Select Mass Action according to dataset: Cancel --> <actionGroup ref="AdminOrderActionOnGridActionGroup" stepKey="ActionCancel"> <argument name="action" value="Cancel"/> - <argument name="orderId" value="$getOrderId"/> + <argument name="orderId" value="$grabOrderId"/> </actionGroup> <see userInput="We canceled 1 order(s)." stepKey="assertOrderCancelMassActionSuccessMessage"/> - <!--Assert orders in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="filterOrder"> - <argument name="orderId" value="{$getOrderId}"/> + <argument name="orderId" value="{$grabOrderId}"/> <argument name="orderStatus" value="Canceled"/> </actionGroup> - <see userInput="{$getOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> + <see userInput="{$grabOrderId}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertOrderID"/> <see userInput="Canceled" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertOrderStatus"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml index 338975d3c1f25..38d69628d286f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml @@ -10,15 +10,13 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest"> <annotations> + <features value="Sales"/> <stories value="Admin create order"/> <title value="Product in the shopping cart could be reached by admin during order creation with multi website config"/> <description value="Product in the shopping cart could be reached by admin during order creation with multi website config"/> <severity value="MAJOR"/> - <testCaseId value="MC-6353"/> + <testCaseId value="MC-25877"/> <group value="sales"/> - <skip> - <issueId value="MC-20129"/> - </skip> </annotations> <before> <magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlEnable"/> @@ -38,7 +36,7 @@ <argument name="customStore" value="customStore"/> </actionGroup> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> - <argument name="productId" value="$$createProduct.id$$"/> + <argument name="productId" value="$createProduct.id$"/> </actionGroup> <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="assignProductToSecondWebsite"> <argument name="website" value="{{customWebsite.name}}"/> @@ -68,7 +66,7 @@ <!--Open product page and add to cart--> <actionGroup ref="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup" stepKey="openProductPageUsingStoreCodeInUrl"> - <argument name="product" value="$$createProduct$$"/> + <argument name="product" value="$createProduct$"/> <argument name="storeView" value="customStore"/> </actionGroup> <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> @@ -81,12 +79,12 @@ <!--Assert product in Shopping cart section--> <actionGroup ref="AdminAssertProductInShoppingCartSectionActionGroup" stepKey="seeProductInShoppingCart"> - <argument name="product" value="$$createProduct.name$$"/> + <argument name="product" value="$createProduct.name$"/> </actionGroup> <!--Move product to the order from shopping cart--> <actionGroup ref="AdminMoveProductToItemsOrderedFromShoppingCartActionGroup" stepKey="addProductToItemsOrderedFromShoppingCart"> - <argument name="product" value="$$createProduct.name$$"/> + <argument name="product" value="$createProduct.name$"/> </actionGroup> <!--Fill customer address information--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml index 4799984b76745..cd3b128b5c19c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml @@ -25,13 +25,8 @@ <createData entity="SimpleProduct2" stepKey="createSimpleProductApi"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/> - <!-- Clearing cache just in case --> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage2"/> <!-- It sometimes is loading too long for default 10s --> <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded2"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml index beaf098eee246..1ad7b3db21270 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml @@ -10,16 +10,13 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminSubmitConfigurableProductOrderTest"> <annotations> - <title value="Create Order in Admin and update product configuration"/> - <stories value="MAGETWO-59632: Create Sales > Order from admin add configurable product and change options click OK does not update Items Ordered List"/> - <description value="Create Order in Admin and update product configuration"/> <features value="Sales"/> - <severity value="AVERAGE"/> - <testCaseId value="MAGETWO-59633"/> - <group value="Sales"/> - <skip> - <issueId value="MAGETWO-96196"/> - </skip> + <stories value="Admin create order"/> + <title value="Create Order in Admin and update product configuration"/> + <description value="Create Order as admin and update product attribute configuration during order creation"/> + <severity value="MAJOR"/> + <testCaseId value="MC-26545"/> + <group value="sales"/> </annotations> <before> @@ -87,25 +84,41 @@ <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> + <!-- Reindex invalidated indices after product attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + + <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> + <deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/> + + <!-- Reindex invalidated indices after product attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + </after> <!--Create new customer order--> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> - <argument name="customer" value="$$simpleCustomer$$"/> + <argument name="customer" value="$simpleCustomer$"/> </actionGroup> <!--Add configurable product to order--> <actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder"> - <argument name="product" value="$$createConfigProduct$$"/> - <argument name="attribute" value="$$createConfigProductAttribute$$"/> - <argument name="option" value="$$getConfigAttributeOption1$$"/> + <argument name="product" value="$createConfigProduct$"/> + <argument name="attribute" value="$createConfigProductAttribute$"/> + <argument name="option" value="$getConfigAttributeOption1$"/> </actionGroup> <!--Configure ordered configurable product--> <actionGroup ref="ConfigureOrderedConfigurableProductActionGroup" stepKey="configureOrderedConfigurableProduct"> - <argument name="attribute" value="$$createConfigProductAttribute$$"/> - <argument name="option" value="$$getConfigAttributeOption2$$"/> + <argument name="attribute" value="$createConfigProductAttribute$"/> + <argument name="option" value="$getConfigAttributeOption2$"/> <argument name="quantity" value="2"/> </actionGroup> @@ -118,20 +131,5 @@ <!--Verify order information--> <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> - - <after> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - - <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> - - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> - <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> - <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> - <deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/> - - <!-- Reindex invalidated indices after product attribute has been created/deleted --> - <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - </after> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml index 0224bca9d96ac..814be5ccd86bf 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml @@ -26,7 +26,7 @@ <!--Go to new order status page--> <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <actionGroup ref="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup" stepKey="clickCreateNewStatus"/> <!--Fill the form and validate save success message--> <actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml index 861a5a5bf42df..ac17d41c43c3d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml @@ -49,7 +49,7 @@ <!-- Create order status --> <actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatusPage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForOrderStatusPageLoad"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> + <actionGroup ref="AdminClickCreateNewStatusButtonOnOrderStatusPageActionGroup" stepKey="clickCreateNewStatus"/> <!-- Fill form and validate message --> <actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 08d5776b79ea0..3a5dac85d2a86 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -75,12 +75,8 @@ <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct1"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml index 739d5f0d40f61..3ee973ff2b03f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml @@ -60,7 +60,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> <!-- Place an order from Storefront as a Guest --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="hoverOverProduct"/> <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> @@ -88,8 +88,8 @@ <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment3"/> - <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPlaceOrderButton"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml index 452d65ea5ae57..850dd9e1b5795 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml @@ -57,9 +57,7 @@ <!-- Change configuration --> <magentoCLI command="config:set reports/options/enabled 1" stepKey="enableReportModule"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> <!-- Admin logout --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontCreateOrderWithDifferentAddressesTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontCreateOrderWithDifferentAddressesTest.xml new file mode 100644 index 0000000000000..bf45d3305dcfd --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontCreateOrderWithDifferentAddressesTest.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCreateOrderWithDifferentAddressesTest"> + <annotations> + <stories value="Order billing and shipping addresses should show correctly the entered data"/> + <title value="Billing and Shipping addresses should show correct data on Admin Order View"/> + <description value="Place order on Store Front with manually filled billing address state and selected shipping address state. Check that billing address show correct state on Admin Order View page"/> + <severity value="MINOR"/> + <group value="sales"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> + <createData entity="Customer_UK_US" stepKey="createCustomer"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCreateCustomer"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> + </after> + + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProductPage"> + <argument name="productUrlKey" value="$createSimpleProduct.custom_attributes[url_key]$"/> + </actionGroup> + + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> + <argument name="product" value="$$createSimpleProduct$$"/> + <argument name="productCount" value="1"/> + </actionGroup> + + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="navigateToCheckout"/> + <waitForPageLoad stepKey="waitForPaymentSelectionPageLoad"/> + + <actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="loginAsCustomer"> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="gotoPaymentStep"/> + + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="customerPlaceOrder"> + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> + </actionGroup> + + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="getOrderNumber"/> + <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderNumber"> + <actualResult type="const">$getOrderNumber</actualResult> + </assertNotEmpty> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrders"/> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> + <argument name="orderId" value="$getOrderNumber"/> + </actionGroup> + + <actionGroup ref="AssertOrderAddressWithStateInformationActionGroup" stepKey="AssertOrderAddressInformation"> + <argument name="customer" value=""/> + <argument name="shippingAddress" value="US_Address_NY_Default_Shipping"/> + <argument name="billingAddress" value="UK_With_State_Default_Billing"/> + </actionGroup> + <dontSee selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{US_Address_NY_Default_Shipping.state}}" stepKey="dontSeeShippingAddressStateAtBillingAddress"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml index 6b6b0b2ef4a16..935a0f44ecc58 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml @@ -89,13 +89,8 @@ <!-- Customer is created --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <!-- Reindex and flush the cache to display products on the category page --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete category and products --> @@ -133,7 +128,7 @@ </actionGroup> <!-- Customer placed the order with 20 products --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <scrollTo selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="scrollToLimiter"/> <selectOption userInput="36" selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="selectLimitOnPage"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml index 9fba25688702d..752b2a5b7d824 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml @@ -122,7 +122,7 @@ </actionGroup> <!-- Customer placed the order with 20 products --> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <scrollTo selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="scrollToLimiter"/> <selectOption userInput="36" selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="selectLimitOnPage"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml index 807437510d045..074a976de9425 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml @@ -10,16 +10,14 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontPrintOrderGuestTest"> <annotations> + <features value="Sales"/> <stories value="Print Order"/> <title value="Print Order from Guest on Frontend"/> <description value="Print Order from Guest on Frontend"/> - <severity value="BLOCKER"/> - <testCaseId value="MC-16225"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-28494"/> <group value="sales"/> <group value="mtf_migrated"/> - <skip> - <issueId value="MQE-2288" /> - </skip> </annotations> <before> <magentoCLI command="downloadable:domains:add" arguments="example.com static.magento.com" stepKey="addDownloadableDomain"/> @@ -40,7 +38,7 @@ <!-- Check Links can be purchased separately for Downloadable Product --> <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToDownloadableProduct"> - <argument name="product" value="$$downloadableProduct$$"/> + <argument name="product" value="$downloadableProduct$"/> </actionGroup> <waitForPageLoad stepKey="waitForPageLoad"/> <scrollTo selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="scrollToDownloadableInformation"/> @@ -116,7 +114,7 @@ <!-- Grab attribute name for Configurable Product --> <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToConfigurableProduct"> - <argument name="product" value="$$createConfigProduct$$"/> + <argument name="product" value="$createConfigProduct$"/> </actionGroup> <grabTextFrom selector="{{AdminConfigurableProductFormSection.currentAttribute}}" stepKey="grabAttribute"/> <assertNotEmpty stepKey="assertNotEmpty"> @@ -151,13 +149,15 @@ <!-- Grab bundle option name for Bundle Product --> <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToBundleProduct"> - <argument name="product" value="$$createBundleProduct$$"/> + <argument name="product" value="$createBundleProduct$"/> </actionGroup> <grabTextFrom selector="{{AdminProductFormBundleSection.currentBundleOption}}" stepKey="grabBundleOption"/> <assertNotEmpty stepKey="assertBundleOptionNotEmpty"> <actualResult type="const">$grabBundleOption</actualResult> </assertNotEmpty> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductGridFilters"/> + <!-- Create sales rule --> <createData entity="ActiveSalesRuleCoupon50" stepKey="createCartPriceRule"/> <createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule"> @@ -170,36 +170,34 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Place order with options according to dataset --> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="newOrder"> - <argument name="customer" value="$$createCustomer$$"/> + <argument name="customer" value="$createCustomer$"/> </actionGroup> <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterConfigProduct"> - <argument name="productSKU" value="$$createConfigProduct.sku$$"/> + <argument name="productSKU" value="$createConfigProduct.sku$"/> </actionGroup> <actionGroup ref="AdminAddToOrderConfigurableProductActionGroup" stepKey="addConfProduct"> <argument name="attribute" value="{$grabAttribute}"/> - <argument name="option" value="$$getConfigAttributeOption1.label$$"/> + <argument name="option" value="$getConfigAttributeOption1.label$"/> <argument name="quantity" value="3"/> </actionGroup> <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterBundleProduct"> - <argument name="productSKU" value="$$createBundleProduct.sku$$"/> + <argument name="productSKU" value="$createBundleProduct.sku$"/> </actionGroup> <actionGroup ref="AdminAddToOrderBundleProductActionGroup" stepKey="addBundleProduct"> <argument name="option" value="{$grabBundleOption}"/> - <argument name="selectedProductName" value="$$simpleProduct1.name$$"/> + <argument name="selectedProductName" value="$simpleProduct1.name$"/> <argument name="quantity" value="2"/> </actionGroup> <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterDownloadableProduct"> - <argument name="productSKU" value="$$downloadableProduct.sku$$"/> + <argument name="productSKU" value="$downloadableProduct.sku$"/> </actionGroup> <actionGroup ref="AdminAddToOrderDownloadableProductActionGroup" stepKey="addDownloadableProduct"> <argument name="link" value="{$grabLink}"/> @@ -208,15 +206,16 @@ <!-- add Coupon --> <actionGroup ref="AdminAddToOrderCouponCodeActionGroup" stepKey="addCoupon"> - <argument name="couponCode" value="$$createCouponForCartPriceRule.code$$"/> + <argument name="couponCode" value="$createCouponForCartPriceRule.code$"/> </actionGroup> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillOrder"> - <argument name="customer" value="$$createCustomer$$"/> + <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> </before> <after> <magentoCLI command="downloadable:domains:remove" arguments="example.com static.magento.com" stepKey="removeDownloadableDomain"/> @@ -256,7 +255,7 @@ <!-- Fill the form with correspondent Order data --> <actionGroup ref="StorefrontFillOrdersAndReturnsFormActionGroup" stepKey="fillOrder"> <argument name="orderNumber" value="{$getOrderId}"/> - <argument name="customer" value="$$createCustomer$$"/> + <argument name="customer" value="$createCustomer$"/> </actionGroup> <!-- Click on the "Continue" button --> @@ -265,17 +264,17 @@ <!-- Click on the "Print Order" button --> <click selector="{{StorefrontGuestOrderViewSection.printOrder}}" stepKey="printOrder"/> - <wait time="5" stepKey="waitForPrintWindowToOpen" /> + <waitForPageLoad stepKey="waitForPrintWindowToOpen" /> <switchToWindow stepKey="switchToWindow"/> - <wait time="5" stepKey="waitForPrintTabToOpen" /> + <waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="waitForPrintTabToOpen"/> <switchToNextTab stepKey="switchToTab"/> - <wait stepKey="waitForPrintPreviewToLoad" time="5" /> + <waitForPageLoad stepKey="waitForPrintPreviewToLoad"/> <seeInCurrentUrl url="sales/guest/print/order_id/" stepKey="seePrintPage"/> <!-- AssertSalesPrintOrderProducts --> - <see userInput="$$createBundleProduct.name$$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeBundleProduct"/> - <see userInput="$$downloadableProduct.name$$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeDownloadableProduct"/> - <see userInput="$$createConfigProduct.name$$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeConfigurableProduct"/> + <see userInput="$createBundleProduct.name$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeBundleProduct"/> + <see userInput="$downloadableProduct.name$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeDownloadableProduct"/> + <see userInput="$createConfigProduct.name$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeConfigurableProduct"/> <!-- AssertSalesPrintOrderBillingAddress --> <scrollTo selector="{{StorefrontOrderDetailsSection.orderDetailsBlock}}" stepKey="scrollToFooter"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistoryTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistoryTest.xml index edc92bd2fac03..ccc675f20de01 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistoryTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistoryTest.xml @@ -10,17 +10,13 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontRedirectToOrderHistoryTest"> <annotations> - <features value="Redirection Rules"/> - <stories value="Create Invoice"/> - <title value="Create Invoice"/> - <description - value="Check while order printing URL with an id of not relevant order redirects to order history"/> + <features value="Sales"/> + <stories value="Print Order"/> + <title value="Redirect to Order History Page"/> + <description value="Check while order printing URL with an id of not relevant order redirects to order history"/> <severity value="MAJOR"/> - <testCaseId value="MAGETWO-92854"/> + <testCaseId value="MC-28543"/> <group value="sales"/> - <skip> - <issueId value="MQE-2288" /> - </skip> </annotations> <before> <createData entity="_defaultCategory" stepKey="createCategory"/> @@ -39,32 +35,32 @@ <!--Log in to Storefront as Customer 1 --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> - <argument name="Customer" value="$$createCustomer$$"/> + <argument name="Customer" value="$createCustomer$"/> </actionGroup> <!--Create an order at Storefront as Customer 1 --> <actionGroup ref="CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup" stepKey="createOrderToPrint"> - <argument name="Category" value="$$createCategory$$"/> + <argument name="Category" value="$createCategory$"/> </actionGroup> <!--Go to 'print order' page by grabbed order id--> <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderIdFromURL"/> - <wait time="5" stepKey="waitForPrintWindowToOpen" /> + <comment userInput="BIC workaround" stepKey="waitForPrintWindowToOpen"/> <switchToWindow stepKey="switchToPrintPage"/> <waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="checkPrintPage"/> <openNewTab stepKey="openNewTab"/> - <wait time="5" stepKey="waitForNewTabToOpen" /> + <waitForPageLoad stepKey="waitForNewTabToOpen" /> <switchToNextTab stepKey="switchForward"/> <waitForElement selector="body" stepKey="waitForNewTab3HTML" /> <amOnPage url="{{StorefrontSalesOrderPrintPage.url({$grabOrderIdFromURL})}}" stepKey="duplicatePrintPage"/> - <wait time="5" stepKey="waitForDuplicatePrintWindowToOpen" /> + <waitForPageLoad stepKey="waitForDuplicatePrintWindowToOpen" /> <switchToWindow stepKey="switchToDuplicatePrintPage"/> <waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="checkDuplicatePrintPage"/> <!--Log out as customer 1--> <openNewTab stepKey="openNewTab2"/> - <wait time="5" stepKey="waitForNewTabToOpen1" /> + <waitForPageLoad stepKey="waitForNewTabToOpen1" /> <switchToNextTab stepKey="switchForward2"/> <waitForElement selector="body" stepKey="waitForNewTab2HTML" /> @@ -73,24 +69,25 @@ <!--Log in to Storefront as Customer 2 --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp2"> - <argument name="Customer" value="$$createCustomer2$$"/> + <argument name="Customer" value="$createCustomer2$"/> </actionGroup> <!--Create an order at Storefront as Customer 2 --> <actionGroup ref="CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup" stepKey="createOrderToPrint2"> - <argument name="Category" value="$$createCategory$$"/> + <argument name="Category" value="$createCategory$"/> </actionGroup> <!--Try to load 'print order' page with not relevant order id to be redirected to 'order history' page--> - <wait time="5" stepKey="waitForPrintWindowToOpen2" /> + <waitForPageLoad stepKey="waitForPrintWindowToOpen2" /> <switchToWindow stepKey="switchToPrintPage2"/> <waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="checkPrintPage2"/> <openNewTab stepKey="openNewTab3"/> - <wait time="5" stepKey="waitForNewTabToOpen2" /> + <waitForPageLoad stepKey="waitForNewTabToOpen2" /> <switchToNextTab stepKey="switchForward4"/> <waitForElement selector="body" stepKey="waitForNewTabHTML" /> <amOnPage url="{{StorefrontSalesOrderPrintPage.url({$grabOrderIdFromURL})}}" stepKey="duplicatePrintPage2"/> + <waitForPageLoad stepKey="waitForOpenDuplicatePage" /> <seeElement selector="{{StorefrontCustomerOrderSection.isMyOrdersSection}}" stepKey="waitOrderHistoryPage"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifySecureURLRedirectSalesTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifySecureURLRedirectSalesTest.xml index ecf71e2bc80b3..4ab85138f7c4b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifySecureURLRedirectSalesTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifySecureURLRedirectSalesTest.xml @@ -28,15 +28,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> </after> <executeJS function="return window.location.host" stepKey="hostname"/> diff --git a/app/code/Magento/Sales/Test/Unit/Block/Items/AbstractTest.php b/app/code/Magento/Sales/Test/Unit/Block/Items/AbstractTest.php index a85bad2261644..6ed10609c7def 100644 --- a/app/code/Magento/Sales/Test/Unit/Block/Items/AbstractTest.php +++ b/app/code/Magento/Sales/Test/Unit/Block/Items/AbstractTest.php @@ -8,11 +8,13 @@ namespace Magento\Sales\Test\Unit\Block\Items; use Magento\Backend\Block\Template\Context; +use Magento\Framework\DataObject; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\View\Element\AbstractBlock; use Magento\Framework\View\Element\RendererList; use Magento\Framework\View\Layout; use Magento\Sales\Block\Items\AbstractItems; +use Magento\Sales\ViewModel\ItemRendererTypeResolverInterface; use PHPUnit\Framework\TestCase; class AbstractTest extends TestCase @@ -25,41 +27,24 @@ protected function setUp(): void $this->_objectManager = new ObjectManager($this); } - public function testGetItemRenderer() + public function testGetItemRenderer(): void { $rendererType = 'some-type'; - $renderer = $this->getMockBuilder(AbstractBlock::class) - ->addMethods(['setRenderedBlock']) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $rendererList = $this->createMock(RendererList::class); - $rendererList->expects( - $this->once() - )->method( - 'getRenderer' - )->with( - $rendererType, - AbstractItems::DEFAULT_TYPE - )->willReturn( - $renderer - ); + $renderer = $this->getRendererMock('some output'); + $rendererList = $this->getRendererListMock([$rendererType => $renderer]); + $block = $this->getBlock($rendererList); + $this->assertSame($renderer, $block->getItemRenderer($rendererType)); + $this->assertSame($block, $renderer->getRenderedBlock()); + } + public function testGetItemRendererThrowsExceptionForNonexistentRenderer() + { + $this->expectException('RuntimeException'); + $this->expectExceptionMessage('Renderer list for block "" is not defined'); $layout = $this->createPartialMock(Layout::class, ['getChildName', 'getBlock']); + $layout->expects($this->once())->method('getChildName')->willReturn(null); - $layout->expects($this->once())->method('getChildName')->willReturn('renderer.list'); - - $layout->expects( - $this->once() - )->method( - 'getBlock' - )->with( - 'renderer.list' - )->willReturn( - $rendererList - ); - - /** @var \Magento\Sales\Block\Items\AbstractItems $block */ + /** @var AbstractItems $block */ $block = $this->_objectManager->getObject( AbstractItems::class, [ @@ -70,29 +55,125 @@ public function testGetItemRenderer() ] ); - $renderer->expects($this->once())->method('setRenderedBlock')->with($block); + $block->getItemRenderer('some-type'); + } - $this->assertSame($renderer, $block->getItemRenderer($rendererType)); + /** + * @param string $type + * @param string|null $resolvedType + * @param string $expected + * @dataProvider getItemHtmlDataProvider + */ + public function testGetItemHtml(string $type, ?string $resolvedType, string $expected): void + { + $renderers = [ + 'type1' => $this->getRendererMock('type 1 renderer'), + 'type2' => $this->getRendererMock('type 2 renderer'), + ]; + $rendererList = $this->getRendererListMock($renderers); + $block = $this->getBlock($rendererList); + $item = new DataObject(['product_type' => $type]); + $itemRendererTypeResolver = $this->getMockBuilder(ItemRendererTypeResolverInterface::class) + ->getMockForAbstractClass(); + $itemRendererTypeResolver->method('resolve') + ->willReturn($resolvedType); + $block->setData($type . '_renderer_type_resolver', $itemRendererTypeResolver); + $this->assertEquals($expected, $block->getItemHtml($item)); } - public function testGetItemRendererThrowsExceptionForNonexistentRenderer() + /** + * @return array + */ + public function getItemHtmlDataProvider(): array { - $this->expectException('RuntimeException'); - $this->expectExceptionMessage('Renderer list for block "" is not defined'); - $layout = $this->createPartialMock(Layout::class, ['getChildName', 'getBlock']); - $layout->expects($this->once())->method('getChildName')->willReturn(null); + return [ + [ + 'type1', + null, + 'type 1 renderer' + ], + [ + 'type1', + 'type2', + 'type 2 renderer' + ], + [ + 'type3', + null, + 'default renderer' + ], + [ + 'type3', + 'type1', + 'type 1 renderer' + ], + ]; + } - /** @var \Magento\Sales\Block\Items\AbstractItems $block */ - $block = $this->_objectManager->getObject( - AbstractItems::class, + /** + * @param string $html + * @return AbstractBlock + */ + private function getRendererMock(string $html): AbstractBlock + { + $renderer = $this->getMockBuilder(AbstractBlock::class) + ->onlyMethods(['toHtml']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $renderer->method('toHtml') + ->willReturn($html); + + return $renderer; + } + + /** + * @param array $renderers + * @return RendererList + */ + private function getRendererListMock(array $renderers): RendererList + { + $renderers[AbstractItems::DEFAULT_TYPE] = $this->getRendererMock('default renderer'); + $rendererList = $this->createMock(RendererList::class); + $rendererList->expects($this->once()) + ->method('getRenderer') + ->willReturnCallback( + function ($type, $default) use ($renderers) { + return $renderers[$type] ?? $renderers[$default] ?? null; + } + ); + + return $rendererList; + } + + /** + * @param RendererList $rendererList + * @return AbstractItems + */ + private function getBlock(RendererList $rendererList): AbstractItems + { + $layout = $this->createPartialMock( + Layout::class, [ - 'context' => $this->_objectManager->getObject( - Context::class, - ['layout' => $layout] - ) + 'getChildName', + 'getBlock' ] ); - $block->getItemRenderer('some-type'); + $layout->expects($this->once()) + ->method('getChildName') + ->willReturn('renderer.list'); + + $layout->expects($this->once()) + ->method('getBlock') + ->with('renderer.list') + ->willReturn($rendererList); + + $context = $this->_objectManager->getObject( + Context::class, + ['layout' => $layout] + ); + + return new AbstractItems($context); } } diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ReorderTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ReorderTest.php index 5fb8b2ddbc468..9644e096b524c 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ReorderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ReorderTest.php @@ -14,6 +14,7 @@ use Magento\Backend\Model\View\Result\Redirect; use Magento\Backend\Model\View\Result\RedirectFactory; use Magento\Framework\App\RequestInterface; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Message\ManagerInterface; use Magento\Framework\ObjectManagerInterface; @@ -26,6 +27,7 @@ use Magento\Sales\Model\Order\Reorder\UnavailableProductsProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; /** * Verify reorder class. @@ -115,6 +117,11 @@ class ReorderTest extends TestCase */ private $orderId; + /** + * @var LoggerInterface|MockObject + */ + private $loggerMock; + /** * @inheritDoc */ @@ -141,6 +148,7 @@ protected function setUp(): void ->getMock(); $this->messageManagerMock = $this->getMockBuilder(ManagerInterface::class) ->getMockForAbstractClass(); + $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); $objectManager = new ObjectManager($this); $this->context = $objectManager->getObject( @@ -161,6 +169,7 @@ protected function setUp(): void 'reorderHelper' => $this->reorderHelperMock, 'context' => $this->context, 'resultForwardFactory' => $this->resultForwardFactoryMock, + 'logger' => $this->loggerMock ] ); } @@ -299,6 +308,43 @@ public function testExecuteRedirectNewOrderWithException(): void $this->assertInstanceOf(Redirect::class, $this->reorder->execute()); } + /** + * Verify redirect new order with throws out of stock exception. + * + * @return void + */ + public function testExecuteReorderWithThrowsLocalizedException(): void + { + $errorPhrase = __('This product is out of stock.'); + $exception = new LocalizedException($errorPhrase); + + $this->clearStorage(); + $this->getOrder(); + $this->canReorder(true); + $this->createRedirect(); + $this->getOrderId($this->orderId); + $this->getUnavailableProducts([]); + + $this->orderMock->expects($this->once()) + ->method('setReordered') + ->with(true) + ->willThrowException($exception); + $this->loggerMock + ->expects($this->any()) + ->method('critical') + ->willReturn($exception); + $this->messageManagerMock + ->expects($this->once()) + ->method('addErrorMessage') + ->willReturnSelf(); + $this->resultRedirectMock + ->expects($this->once()) + ->method('setPath') + ->with('sales/*') + ->willReturnSelf(); + $this->assertInstanceOf(Redirect::class, $this->reorder->execute()); + } + /** * Mock clear storage. * diff --git a/app/code/Magento/Sales/Test/Unit/Helper/GuestTest.php b/app/code/Magento/Sales/Test/Unit/Helper/GuestTest.php index 07f740f7c1fd8..e05752083955b 100644 --- a/app/code/Magento/Sales/Test/Unit/Helper/GuestTest.php +++ b/app/code/Magento/Sales/Test/Unit/Helper/GuestTest.php @@ -196,6 +196,10 @@ public function testLoadValidOrderNotEmptyPost($post) ->method('setHttpOnly') ->with(true) ->willReturnSelf(); + $metaDataMock->expects($this->once()) + ->method('setSameSite') + ->with('Lax') + ->willReturnSelf(); $this->cookieMetadataFactoryMock->expects($this->once()) ->method('createPublicCookieMetadata') ->willReturn($metaDataMock); @@ -279,6 +283,10 @@ public function testLoadValidOrderStoredCookie() ->method('setHttpOnly') ->with(true) ->willReturnSelf(); + $metaDataMock->expects($this->once()) + ->method('setSameSite') + ->with('Lax') + ->willReturnSelf(); $this->cookieMetadataFactoryMock->expects($this->once()) ->method('createPublicCookieMetadata') ->willReturn($metaDataMock); diff --git a/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php index d15a948bd89ed..d27ac09127a94 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php @@ -41,6 +41,14 @@ class InvoiceRepositoryTest extends TestCase */ private $collectionProcessorMock; + /** + * @var Type|MockObject + */ + private $type; + + /** + * @inheritDoc + */ protected function setUp(): void { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php index 28a74cd0f729a..1133ac6753297 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php @@ -9,6 +9,7 @@ use Magento\Customer\Block\Address\Renderer\RendererInterface as CustomerAddressBlockRenderer; use Magento\Customer\Model\Address\Config as CustomerAddressConfig; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\DataObject; use Magento\Framework\Event\ManagerInterface as EventManager; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; @@ -18,6 +19,9 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +/** + * Test for \Magento\Sales\Model\Order\Address\Renderer. + */ class RendererTest extends TestCase { /** @@ -55,6 +59,14 @@ class RendererTest extends TestCase */ private $customerAddressBlockRendererMock; + /** + * @var ScopeConfigInterface|MockObject + */ + private $storeConfigMock; + + /** + * @ingeritdoc + */ protected function setUp(): void { $this->customerAddressConfigMock = $this->getMockBuilder(CustomerAddressConfig::class) @@ -75,12 +87,15 @@ protected function setUp(): void ->method('getOrder') ->willReturn($this->orderMock); + $this->storeConfigMock = $this->createMock(ScopeConfigInterface::class); + $this->objectManagerHelper = new ObjectManagerHelper($this); $this->orderAddressRenderer = $this->objectManagerHelper->getObject( OrderAddressRenderer::class, [ 'addressConfig' => $this->customerAddressConfigMock, - 'eventManager' => $this->eventManagerMock + 'eventManager' => $this->eventManagerMock, + 'scopeConfig' => $this->storeConfigMock ] ); } @@ -89,7 +104,7 @@ public function testFormat() { $type = 'html'; $formatType = new DataObject(['renderer' => $this->customerAddressBlockRendererMock]); - $addressData = ['address', 'data']; + $addressData = ['address', 'data', 'locale' => 1]; $result = 'result string'; $this->setStoreExpectations(1); @@ -103,6 +118,9 @@ public function testFormat() $this->orderAddressMock->expects(static::atLeastOnce()) ->method('getData') ->willReturn($addressData); + $this->storeConfigMock->expects($this->once()) + ->method('getValue') + ->willReturn(1); $this->customerAddressBlockRendererMock->expects(static::once()) ->method('renderArray') ->with($addressData, null) diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php index b5dcadf83dbc6..888d0b793ef6f 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php @@ -36,6 +36,14 @@ class SubtotalTest extends TestCase */ protected $orderItemMock; + /** + * @var Order|MockObject + */ + private $orderMock; + + /** + * @inheritDoc + */ protected function setUp(): void { $this->orderMock = $this->createPartialMock( diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php index 5c720bcd50159..2ca50997d93f4 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php @@ -44,6 +44,14 @@ class CreditmemoRepositoryTest extends TestCase */ private $collectionProcessorMock; + /** + * @var Type|MockObject + */ + private $type; + + /** + * @inheritDoc + */ protected function setUp(): void { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceCommentSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceCommentSenderTest.php index 56d78789d7dda..c0b3f29065cba 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceCommentSenderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceCommentSenderTest.php @@ -26,6 +26,14 @@ class InvoiceCommentSenderTest extends AbstractSenderTest */ protected $invoiceMock; + /** + * @var Invoice|MockObject + */ + private $invoiceResource; + + /** + * @inheritDoc + */ protected function setUp(): void { $this->stepMockSetup(); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/DiscountTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/DiscountTest.php index f7587031337a7..3623e6800f536 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/DiscountTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/DiscountTest.php @@ -98,6 +98,43 @@ public function testCollectInvoiceWithZeroGrandTotal(array $invoiceData): void $this->model->collect($this->invoice); } + /** + * Test for collect invoice with negative grand total + * + * @return void + */ + public function testCollectInvoiceWithNegativeGrandTotal(): void + { + $invoiceData = [ + 'order_item' => [ + 'qty_ordered' => 1, + 'discount_amount' => 25.34, + 'base_discount_amount' => 25.34, + ], + 'is_last' => true, + 'qty' => 1, + ]; + $invoiceItem[] = $this->getInvoiceItem($invoiceData); + $this->invoice->method('getOrder') + ->willReturn($this->order); + $this->order->method('getInvoiceCollection') + ->willReturn([]); + $this->invoice->method('getAllItems') + ->willReturn($invoiceItem); + $this->invoice->method('getGrandTotal') + ->willReturn(15.6801); + $this->invoice->method('getBaseGrandTotal') + ->willReturn(15.6801); + + $this->invoice->expects($this->exactly(1)) + ->method('setGrandTotal') + ->with(-9.6599); + $this->invoice->expects($this->exactly(1)) + ->method('setBaseGrandTotal') + ->with(-9.6599); + $this->model->collect($this->invoice); + } + /** * @return array */ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php index b170a72d691ea..29c755d77faaf 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php @@ -318,7 +318,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending 'is_not_virtual' => $orderData['is_not_virtual'], 'email_customer_note' => $orderData['email_customer_note'], 'frontend_status_label' => $orderData['frontend_status_label'] - ] + ], ]; $transport = new DataObject($transport); diff --git a/app/code/Magento/Sales/ViewModel/ItemRendererTypeResolverInterface.php b/app/code/Magento/Sales/ViewModel/ItemRendererTypeResolverInterface.php new file mode 100644 index 0000000000000..e9442ec7e49ab --- /dev/null +++ b/app/code/Magento/Sales/ViewModel/ItemRendererTypeResolverInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Sales\ViewModel; + +/** + * Item renderer type resolver + */ +interface ItemRendererTypeResolverInterface +{ + /** + * Get renderer type for provided item object + * + * @param \Magento\Framework\DataObject $item + * @return string|null + */ + public function resolve(\Magento\Framework\DataObject $item): ?string; +} diff --git a/app/code/Magento/Sales/etc/adminhtml/di.xml b/app/code/Magento/Sales/etc/adminhtml/di.xml index e221467dbcf90..35ef510d277bf 100644 --- a/app/code/Magento/Sales/etc/adminhtml/di.xml +++ b/app/code/Magento/Sales/etc/adminhtml/di.xml @@ -48,9 +48,4 @@ </argument> </arguments> </type> - <type name="Magento\Sales\Block\Adminhtml\Order\Create\Search\Grid\DataProvider\ProductCollection"> - <arguments> - <argument name="collectionFactory" xsi:type="object">\Magento\Catalog\Ui\DataProvider\Product\ProductCollectionFactory</argument> - </arguments> - </type> </config> diff --git a/app/code/Magento/Sales/etc/fieldset.xml b/app/code/Magento/Sales/etc/fieldset.xml index 81dc8b6fa4dd4..8bf98ada3cd00 100644 --- a/app/code/Magento/Sales/etc/fieldset.xml +++ b/app/code/Magento/Sales/etc/fieldset.xml @@ -774,6 +774,9 @@ <field name="fax"> <aspect name="to_quote_address" /> </field> + <field name="vat_id"> + <aspect name="to_quote_address" /> + </field> </fieldset> <fieldset id="order_address"> <field name="prefix"> diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method/form.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method/form.phtml index f1c8b249fe68a..ba98e7274c138 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method/form.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/billing/method/form.phtml @@ -4,57 +4,68 @@ * See COPYING.txt for license details. */ -/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ +use Magento\Framework\Escaper; +use Magento\Framework\View\Helper\SecureHtmlRenderer; +use Magento\Sales\Block\Adminhtml\Order\Create\Billing\Method\Form as BillingMethodForm; + +/** + * @var BillingMethodForm $block + * @var Escaper $escaper + * @var SecureHtmlRenderer $secureRenderer + */ ?> <?php if ($block->hasMethods()): ?> -<div id="order-billing_method_form"> - <dl class="admin__payment-methods control"> - <?php - $_methods = $block->getMethods(); - $_methodsCount = count($_methods); - $_counter = 0; - $currentSelectedMethod = $block->getSelectedMethodCode(); - ?> - <?php foreach ($_methods as $_method): - $_code = $_method->getCode(); - $_counter++; - ?> - <dt class="admin__field-option"> - <?php if ($_methodsCount > 1): ?> - <input id="p_method_<?= $block->escapeHtmlAttr($_code); ?>" - value="<?= $block->escapeHtmlAttr($_code); ?>" - type="radio" name="payment[method]" - title="<?= $block->escapeHtmlAttr($_method->getTitle()); ?>" - <?php if ($currentSelectedMethod == $_code): ?> - checked="checked" + <div id="order-billing_method_form"> + <dl class="admin__payment-methods control"> + <?php + $_methods = $block->getMethods(); + $_methodsCount = count($_methods); + $_counter = 0; + $currentSelectedMethod = $block->getSelectedMethodCode(); + ?> + <?php foreach ($_methods as $_method): + $_code = $_method->getCode(); + $_counter++; + ?> + <dt class="admin__field-option"> + <?php if ($_methodsCount > 1): ?> + <input id="p_method_<?= $escaper->escapeHtmlAttr($_code); ?>" + value="<?= $escaper->escapeHtmlAttr($_code); ?>" + type="radio" name="payment[method]" + title="<?= $escaper->escapeHtmlAttr($_method->getTitle()); ?>" + <?php if ($currentSelectedMethod == $_code): ?> + checked="checked" + <?php endif; ?> + data-validate="{'validate-one-required-by-name':true}" + class="admin__control-radio"/> + <?php else: ?> + <span class="no-display"> + <input id="p_method_<?= $escaper->escapeHtmlAttr($_code); ?>" + value="<?= $escaper->escapeHtmlAttr($_code); ?>" + type="radio" + name="payment[method]" class="admin__control-radio" + checked="checked"/> + </span> <?php endif; ?> - data-validate="{'validate-one-required-by-name':true}" - class="admin__control-radio"/> - <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( - 'onclick', - "payment.switchMethod('" . $block->escapeJs($_code) . "')", - 'input#p_method_' . $block->escapeJs($_code) - ) ?> - <?php else:?> - <span class="no-display"> - <input id="p_method_<?= $block->escapeHtmlAttr($_code); ?>" - value="<?= $block->escapeHtmlAttr($_code); ?>" - type="radio" - name="payment[method]" class="admin__control-radio" - checked="checked"/> - </span> - <?php endif;?> - <label class="admin__field-label" for="p_method_<?= $block->escapeHtmlAttr($_code); ?>"> - <?= $block->escapeHtml($_method->getTitle()) ?> - </label> - </dt> - <dd class="admin__payment-method-wrapper"> - <?= $block->getChildHtml('payment.method.' . $_code) ?> - </dd> - <?php endforeach; ?> - </dl> -</div> + <label class="admin__field-label" for="p_method_<?= $escaper->escapeHtmlAttr($_code); ?>"> + <?= $escaper->escapeHtml($_method->getTitle()) ?> + </label> + + <?php if ($_methodsCount > 1): ?> + <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( + 'onclick', + "payment.switchMethod('" . $escaper->escapeJs($_code) . "')", + 'input#p_method_' . $escaper->escapeJs($_code) + ) ?> + <?php endif; ?> + </dt> + <dd class="admin__payment-method-wrapper"> + <?= $block->getChildHtml('payment.method.' . $_code) ?> + </dd> + <?php endforeach; ?> + </dl> + </div> <?php $scriptString = <<<script require([ 'mage/apply/main', @@ -65,11 +76,11 @@ script; if ($_methodsCount !== 1): $scriptString .= <<<script - order.setPaymentMethod('{$block->escapeJs($currentSelectedMethod)}'); + order.setPaymentMethod('{$escaper->escapeJs($currentSelectedMethod)}'); script; else: $scriptString .= <<<script - payment.switchMethod('{$block->escapeJs($currentSelectedMethod)}'); + payment.switchMethod('{$escaper->escapeJs($currentSelectedMethod)}'); script; endif; $scriptString .= <<<script @@ -78,7 +89,8 @@ script; script; ?> - <?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?> + <?= /* @noEscape */ + $secureRenderer->renderTag('script', [], $scriptString, false) ?> <?php else: ?> - <div class="admin__message-empty"><?= $block->escapeHtml(__('No Payment Methods')); ?></div> + <div class="admin__message-empty"><?= $escaper->escapeHtml(__('No Payment Methods')); ?></div> <?php endif; ?> diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml index 638ac7e66f769..79bc1e3a8df36 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml @@ -142,9 +142,10 @@ endif; ?> order.bindAddressFields('{$block->escapeJs($_addressChoiceContainerId)}'); script; - if ($block->getIsShipping() && $block->getIsAsBilling()): - $scriptString .= <<<script - order.disableShippingAddress(true); + if ($block->getIsShipping()): + $disable = $block->getIsAsBilling() ? 'true' : 'false'; + $scriptString .= <<<script + order.disableShippingAddress({$disable}); script; endif; diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/shipping/method/form.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/shipping/method/form.phtml index fd5b7a55b4960..d745a265e6d04 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/shipping/method/form.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/shipping/method/form.phtml @@ -38,11 +38,6 @@ $taxHelper = $block->getData('taxHelper'); value="<?= $block->escapeHtmlAttr($_code) ?>" id="s_method_<?= $block->escapeHtmlAttr($_code) ?>" <?= /* @noEscape */ $_checked ?> class="admin__control-radio required-entry"/> - <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( - 'onclick', - "order.setShippingMethod(this.value)", - 'input#s_method_' . $block->escapeHtmlAttr($_code) - ) ?> <label class="admin__field-label" for="s_method_<?= $block->escapeHtmlAttr($_code) ?>"> <?= $block->escapeHtml($_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription()) ?> - @@ -59,6 +54,11 @@ $taxHelper = $block->getData('taxHelper'); <?php endif; ?> </strong> </label> + <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag( + 'onclick', + "order.setShippingMethod(this.value)", + 'input#s_method_' . $block->escapeHtmlAttr($_code) + ) ?> <?php endif; ?> </li> <?php endforeach; ?> diff --git a/app/code/Magento/SalesAnalytics/README.md b/app/code/Magento/SalesAnalytics/README.md index 7b62229233969..4fc110af0bae8 100644 --- a/app/code/Magento/SalesAnalytics/README.md +++ b/app/code/Magento/SalesAnalytics/README.md @@ -1,3 +1,3 @@ # Magento_SalesAnalytics module -The Magento_SalesAnalytics module configures data definitions for a data collection related to the Sales module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html). +The Magento_SalesAnalytics module configures data definitions for a data collection related to the Sales module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html). diff --git a/app/code/Magento/SalesRule/Block/Rss/Discounts.php b/app/code/Magento/SalesRule/Block/Rss/Discounts.php index d939c5d272e8d..efc52f87fa182 100644 --- a/app/code/Magento/SalesRule/Block/Rss/Discounts.php +++ b/app/code/Magento/SalesRule/Block/Rss/Discounts.php @@ -28,6 +28,11 @@ class Discounts extends \Magento\Framework\View\Element\AbstractBlock implements */ protected $httpContext; + /** + * @var \Magento\Framework\App\Rss\UrlBuilderInterface + */ + private $rssUrlBuilder; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\App\Http\Context $httpContext diff --git a/app/code/Magento/SalesRule/Model/ResourceModel/Rule/Collection.php b/app/code/Magento/SalesRule/Model/ResourceModel/Rule/Collection.php index 2150db4238fbe..99c70936a3e23 100644 --- a/app/code/Magento/SalesRule/Model/ResourceModel/Rule/Collection.php +++ b/app/code/Magento/SalesRule/Model/ResourceModel/Rule/Collection.php @@ -312,6 +312,20 @@ public function addWebsiteGroupDateFilter($websiteId, $customerGroupId, $now = n [] ); + // exclude websites that are limited for customer group + $this->getSelect()->joinLeft( + ['cgw' => $this->getTable('customer_group_excluded_website')], + 'customer_group_ids.' . + $entityInfo['entity_id_field'] . + ' = cgw.' . + $entityInfo['entity_id_field'] . ' AND ' . $websiteId . ' = cgw.website_id', + [] + )->where( + 'cgw.website_id IS NULL', + $websiteId, + \Zend_Db::INT_TYPE + ); + $this->getDateApplier()->applyDate($this->getSelect(), $now); $this->addIsActiveFilter(); diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleDeleteAllActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleDeleteAllActionGroup.xml index 85437650efc35..cc6b2ad6a0647 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleDeleteAllActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleDeleteAllActionGroup.xml @@ -16,7 +16,7 @@ <!-- It sometimes is loading too long for default 10s --> <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded"/> <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <helper class="\Magento\Rule\Test\Mftf\Helper\RuleHelper" method="deleteAllRulesOneByOne" stepKey="deleteAllRulesOneByOne"> + <helper class="Magento\Rule\Test\Mftf\Helper\RuleHelper" method="deleteAllRulesOneByOne" stepKey="deleteAllRulesOneByOne"> <argument name="firstNotEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow}}</argument> <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionAndNotDefaultConditionOperatorActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionAndNotDefaultConditionOperatorActionGroup.xml new file mode 100644 index 0000000000000..dda2c58b11328 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionAndNotDefaultConditionOperatorActionGroup.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCreateCartPriceRuleWithConditionAndNotDefaultConditionOperatorActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Sets the not default Condition value and Product Child Attribute for Actions on the Admin Cart Price Rule creation/edit page.</description> + </annotations> + <arguments> + <argument name="childAttribute" type="string" defaultValue="SKU"/> + <argument name="conditionOperator" type="string" defaultValue="is"/> + <argument name="actionValue" type="string" defaultValue="{{ApiSimpleProduct.sku}}"/> + </arguments> + <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" after="fillDiscountAmount" stepKey="clickOnActionTab"/> + <click selector="{{AdminCartPriceRulesFormSection.conditions}}" after="clickOnActionTab" stepKey="clickConditionDropDownMenu"/> + <waitForPageLoad stepKey="waitForDropDownOpened"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{childAttribute}}" after="clickConditionDropDownMenu" stepKey="selectConditionAttribute"/> + <waitForPageLoad after="selectConditionAttribute" stepKey="waitForOperatorOpened"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('is')}}" after="waitForOperatorOpened" stepKey="clickToChooseCondition"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.operator}}" userInput="{{conditionOperator}}" after="clickToChooseCondition" stepKey="selectOperator"/> + <waitForPageLoad after="selectOperator" stepKey="waitForOperatorOpened1"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" after="waitForOperatorOpened1" stepKey="clickToChooserIcon"/> + <fillField selector="{{AdminCartPriceRulesFormSection.actionValue}}" userInput="{{actionValue}}" after="clickToChooserIcon" stepKey="choseNeededCategoryFromCategoryGrid"/> + <click selector="{{AdminCartPriceRulesFormSection.applyAction}}" after="choseNeededCategoryFromCategoryGrid" stepKey="applyAction"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml index 5f2b40dc63e2a..37125fef11fc7 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml @@ -30,6 +30,10 @@ <argument name="ruleName" value="{{_defaultCoupon.code}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml index 198ba1cd64f35..95f866cb290df 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml @@ -30,6 +30,10 @@ <argument name="ruleName" value="{{_defaultCoupon.code}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml index bc2f115b46873..fda6b35b06f5f 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml @@ -30,6 +30,10 @@ <argument name="ruleName" value="{{_defaultCoupon.code}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml index c80f43385d166..492efd048ff02 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml @@ -31,6 +31,7 @@ <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCreatedCartPriceRule"> <argument name="ruleName" value="{{CartPriceRuleConditionAppliedForCategory.name}}"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml index 2c3574906848c..c1ba77a4a1b9b 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml @@ -30,6 +30,10 @@ <argument name="ruleName" value="{{_defaultCoupon.code}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml index 1b24480b5808b..e7a31e83df0dc 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml @@ -30,6 +30,10 @@ <argument name="ruleName" value="{{SimpleSalesRule.name}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml index 724860b12603c..f0c6dce98e641 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml @@ -32,6 +32,10 @@ <argument name="ruleName" value="{{_defaultCoupon.code}}"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml index d60a81dcdcef9..a0d7218251494 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml @@ -123,11 +123,11 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add the first product to the cart --> - <amOnPage url="$$createConfigChildProduct1.sku$$.html" stepKey="goToProductPage1"/> + <amOnPage url="$$createConfigChildProduct1.custom_attributes[url_key]$$.html" stepKey="goToProductPage1"/> <waitForPageLoad stepKey="waitForProductPageLoad1"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> <!-- Add the second product to the cart --> - <amOnPage url="$$createConfigChildProduct2.sku$$.html" stepKey="goToProductPage2"/> + <amOnPage url="$$createConfigChildProduct2.custom_attributes[url_key]$$.html" stepKey="goToProductPage2"/> <waitForPageLoad stepKey="waitForProductPageLoad2"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontApplyCartPriceRuleToBundleChildProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontApplyCartPriceRuleToBundleChildProductTest.xml new file mode 100644 index 0000000000000..80eb79d9cc6f0 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontApplyCartPriceRuleToBundleChildProductTest.xml @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontApplyCartPriceRuleToBundleChildProductTest"> + <annotations> + <features value="SalesRule"/> + <stories value="Create cart price rule"/> + <title value="Checking Cart Price Rule for bundle products"/> + <description value="Checking Cart Price Rule for bundle products"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-36654"/> + <useCaseId value="MC-35548"/> + <group value="salesRule"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct1"> + <field key="price">5.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct2"> + <field key="price">3.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct3"> + <field key="price">7.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct4"> + <field key="price">18.00</field> + </createData> + <createData entity="ApiBundleProduct" stepKey="createBundleProduct"/> + <createData entity="DropDownBundleOption" stepKey="createDropDownBundleOption"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="CheckboxOption" stepKey="createCheckboxBundleOption"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct1"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createDropDownBundleOption"/> + <requiredEntity createDataKey="createSimpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createDropDownBundleOption"/> + <requiredEntity createDataKey="createSimpleProduct2"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct3"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createCheckboxBundleOption"/> + <requiredEntity createDataKey="createSimpleProduct3"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct4"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createCheckboxBundleOption"/> + <requiredEntity createDataKey="createSimpleProduct4"/> + </createData> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Make Attribute 'sku' accessible for Promo Rule Conditions --> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="editSkuAttribute"> + <argument name="ProductAttribute" value="sku"/> + </actionGroup> + <actionGroup ref="ChangeUseForPromoRuleConditionsProductAttributeActionGroup" stepKey="changeAttributePromoRule"> + <argument name="option" value="1"/> + </actionGroup> + <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteCartPriceRules"/> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value="cataloginventory_stock"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct1"/> + <deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/> + <deleteData createDataKey="createSimpleProduct3" stepKey="deleteSimpleProduct3"/> + <deleteData createDataKey="createSimpleProduct4" stepKey="deleteSimpleProduct4"/> + + <actionGroup ref="AdminDeleteCartPriceRuleActionGroup" stepKey="deleteCartPriceRule"> + <argument name="ruleName" value="CatPriceRule"/> + </actionGroup> + <!-- Revert Attribute 'sku' to it's default value (not accessible for Promo Rule Conditions) --> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="editSkuAttribute"> + <argument name="ProductAttribute" value="sku"/> + </actionGroup> + <actionGroup ref="ChangeUseForPromoRuleConditionsProductAttributeActionGroup" stepKey="changeAttributePromoRule"> + <argument name="option" value="0"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + <!-- Start to create new cart price rule via SKU conditions and not default condition value --> + <actionGroup ref="AdminCreateCartPriceRuleWithConditionAndNotDefaultConditionOperatorActionGroup" stepKey="createRule"> + <argument name="ruleName" value="CatPriceRule"/> + <argument name="conditionOperator" value="is one of"/> + <argument name="actionValue" value="$createSimpleProduct1.sku$, $createSimpleProduct2.sku$"/> + </actionGroup> + <!-- Add Bundle product with simple1 and simple3 products to the cart --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront"> + <argument name="productUrl" value="$createBundleProduct.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeAndAddToCart"/> + <actionGroup ref="StorefrontSelectBundleProductDropDownOptionActionGroup" stepKey="addSimpleProduct1"> + <argument name="productName" value="$createSimpleProduct1.name$"/> + </actionGroup> + <checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '1')}}" stepKey="selectFirstCheckboxOption"/> + <actionGroup ref="StorefrontAddToTheCartButtonActionGroup" stepKey="addToTheCartBundleProduct"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added $createBundleProduct.name$ to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> + <!-- Click "mini cart" icon--> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> + <waitForPageLoad stepKey="waitForDetailsOpen"/> + <!--Check all products and Cart Subtotal and Discount is only for SimpleProduct1--> + <actionGroup ref="StorefrontCheckCartTotalWithDiscountCategoryActionGroup" stepKey="checkDiscountIsAppliedOnlyForSimple1productOnly"> + <argument name="subtotal" value="12.00"/> + <argument name="shipping" value="5.00"/> + <argument name="discount" value="0.50"/> + <argument name="total" value="16.50"/> + </actionGroup> + <!-- Clear Shopping cart --> + <actionGroup ref="DeleteProductFromShoppingCartActionGroup" stepKey="clearShoppingCart"> + <argument name="productName" value="$createBundleProduct.name$"/> + </actionGroup> + <!-- Add Bundle product with simple2 and simple3 products to the cart --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront2"> + <argument name="productUrl" value="$createBundleProduct.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeAndAddToCart2"/> + <actionGroup ref="StorefrontSelectBundleProductDropDownOptionActionGroup" stepKey="addSimpleProduct2"> + <argument name="productName" value="$createSimpleProduct2.name$"/> + </actionGroup> + <checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '1')}}" stepKey="selectFirstCheckboxOption2"/> + <actionGroup ref="StorefrontAddToTheCartButtonActionGroup" stepKey="addToTheCartBundleProduct2"/> + <!--Click "mini cart" icon--> + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart2"/> + <waitForPageLoad stepKey="waitForDetailsOpen2"/> + <!--Check all products and Cart Subtotal and Discount is only for SimpleProduct2--> + <actionGroup ref="StorefrontCheckCartTotalWithDiscountCategoryActionGroup" stepKey="checkDiscountIsAppliedOnlyForSimple2productOnly"> + <argument name="subtotal" value="10.00"/> + <argument name="shipping" value="5.00"/> + <argument name="discount" value="0.30"/> + <argument name="total" value="14.70"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml index 42e6d9e1d5b09..ceb92a5bd2806 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml @@ -33,8 +33,8 @@ <argument name="productUrl" value="$$createBundleProductCreateBundleProduct.custom_attributes[url_key]$$"/> </actionGroup> <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="selectOption0Product1"/> - <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.sku$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="checkOption0Product1"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.name$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="selectOption0Product1"/> + <seeOptionIsSelected selector="{{StorefrontBundledSection.dropDownOptionOneProducts('Drop-down Option')}}" userInput="$$simpleProduct2CreateBundleProduct.name$$ +$$$simpleProduct2CreateBundleProduct.price$$.00" stepKey="checkOption0Product1"/> <checkOption selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Radio Buttons Option', '1')}}" stepKey="selectOption1Product0"/> <seeCheckboxIsChecked selector="{{StorefrontBundledSection.radioButtonOptionTwoProducts('Radio Buttons Option', '1')}}" stepKey="checkOption1Product0"/> <checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts('Checkbox Option', '1')}}" stepKey="selectOption2Product0"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml index 18de326a2919d..cacdc611cd562 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml @@ -79,7 +79,7 @@ </actionGroup> <!-- Step: 6-7. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -99,8 +99,8 @@ <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/> <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <waitForElement selector="{{CheckoutSuccessMainSection.success}}" time="30" stepKey="waitForLoadSuccessPage"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLoadSuccessPage"/> <!-- Start the usage processing consumer --> <actionGroup ref="CliConsumerStartActionGroup" stepKey="startUsageProcessingMessageQueue1"> @@ -109,7 +109,7 @@ </actionGroup> <!-- Step: 9-10. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage1"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage1"/> <waitForPageLoad stepKey="waitForPageLoad3"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule1"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -125,7 +125,7 @@ <actionGroup ref="StorefrontSignOutActionGroup" stepKey="storefrontSignOut"/> <!-- Step: 12-13. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage2"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage2"/> <waitForPageLoad stepKey="waitForPageLoad4"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule2"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -155,7 +155,7 @@ </actionGroup> <!-- Step; 15-16. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage3"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage3"/> <waitForPageLoad stepKey="waitForPageLoad5"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule3"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -171,7 +171,7 @@ <resetCookie userInput="PHPSESSID" stepKey="resetCookie"/> <!-- Step: 18-19. Open the Product Page, add the product to Cart, go to Shopping Cart and Apply the same coupon code --> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="openProductPage4"/> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="openProductPage4"/> <waitForPageLoad stepKey="waitForPageLoad6"/> <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartPriceRule4"> <argument name="product" value="$$createSimpleProduct$$"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml index 3b54df544210f..523387cb96ae8 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml @@ -62,7 +62,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add the product we created to our cart --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleForBundleProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleForBundleProductTest.xml index 56486d2331bd6..099936df04878 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleForBundleProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleForBundleProductTest.xml @@ -7,7 +7,7 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="StorefrontCartPriceRuleForBundleProductTest"> + <test name="StorefrontCartPriceRuleForBundleProductTest" deprecated="StorefrontApplyCartPriceRuleToBundleChildProductTest"> <annotations> <features value="SalesRule"/> <stories value="MAGETWO-28921 - Cart Price Rule for bundle products"/> @@ -17,7 +17,7 @@ <testCaseId value="MAGETWO-28921"/> <group value="SalesRule"/> <skip> - <issueId value="MQE-2288" /> + <issueId value="DEPRECATED">Use StorefrontApplyCartPriceRuleToBundleChildProductTest instead</issueId> </skip> </annotations> @@ -100,7 +100,7 @@ <argument name="option" value="0" /> </actionGroup> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices2" /> @@ -130,7 +130,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add the first product to the cart --> - <amOnPage url="$$createBundleProduct.sku$$.html" stepKey="goToProductPage1"/> + <amOnPage url="$$createBundleProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage1"/> <waitForPageLoad stepKey="waitForProductPageLoad1"/> <!--Click "Customize and Add to Cart" button--> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml index d0cba156f635e..cff82a7d8aac5 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml @@ -66,7 +66,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add the product we created to our cart --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml index 1a449017e0386..6f880caf6d98c 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml @@ -64,7 +64,7 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> <!-- Add 1 product to the cart --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> @@ -75,7 +75,7 @@ <dontSeeElement selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="dontSeeDiscount"/> <!-- Add the same product to the cart again (2 total) --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage2"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage2"/> <waitForPageLoad stepKey="waitForProductPageLoad2"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity2"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml index 68f6fc93eab94..07440a38e9f8c 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml @@ -62,7 +62,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add the product we created to our cart --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml index 0ffe1516d0232..0b246d394e5d8 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml @@ -62,7 +62,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Add 1 product worth $123.00 to the cart --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> @@ -73,7 +73,7 @@ <dontSeeElement selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="dontSeeDiscount"/> <!-- Add the same product to the cart again ($246.00 subtotal) --> - <amOnPage url="$$createPreReqProduct.name$$.html" stepKey="goToProductPage2"/> + <amOnPage url="$$createPreReqProduct.custom_attributes[url_key]$$.html" stepKey="goToProductPage2"/> <waitForPageLoad stepKey="waitForProductPageLoad2"/> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="1" stepKey="fillQuantity2"/> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml index 8df45937bb542..b4f4c157bbd44 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml @@ -56,12 +56,8 @@ <createData entity="SimpleProduct2" stepKey="createSimpleProductThird"> <field key="price">5.50</field> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Removed created Data --> diff --git a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml index 689ea0a1fa53d..a9e9e58563cef 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml @@ -120,7 +120,7 @@ </validation> <dataType>number</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/configuration/scope.html</link> + <link>https://docs.magento.com/user-guide/configuration/scope.html</link> <description>What is this?</description> </tooltip> <label translate="true">Websites</label> @@ -493,7 +493,7 @@ <field name="stop_rules_processing" formElement="checkbox"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> - <item name="default" xsi:type="number">0</item> + <item name="default" xsi:type="number">1</item> <item name="source" xsi:type="string">sales_rule</item> </item> </argument> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByControlButtonsTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByControlButtonsTest.xml index b9c491705316c..f105942ee6bb3 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByControlButtonsTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByControlButtonsTest.xml @@ -29,9 +29,7 @@ <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete create product --> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml index 8c468cce91829..dda47677ccfca 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml @@ -20,16 +20,14 @@ <before> <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Delete all existing products --> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <!-- Create product with description --> <createData entity="SimpleProductWithDescription" stepKey="simpleProduct"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete created product --> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml index fb1f35730fd80..579ff2c63dfc0 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml @@ -25,13 +25,8 @@ <!--Create Simple Product --> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete create product --> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml index 1558f9aa5342b..95ad0f75d6a68 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml @@ -25,13 +25,8 @@ <!-- Create product with short description --> <createData entity="ApiProductWithDescription" stepKey="product"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml index 19c12843c23a2..772eaba6647f8 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml @@ -25,13 +25,8 @@ <!--Create Simple Product --> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> diff --git a/app/code/Magento/Search/Ui/Component/Listing/Column/Website/Options.php b/app/code/Magento/Search/Ui/Component/Listing/Column/Website/Options.php index ede04b6d3db70..3deaa15f5bd38 100644 --- a/app/code/Magento/Search/Ui/Component/Listing/Column/Website/Options.php +++ b/app/code/Magento/Search/Ui/Component/Listing/Column/Website/Options.php @@ -65,8 +65,6 @@ public function toOptionArray() $currentOptions[$name]['value'] = $website->getId(); } - $this->options = array_values($currentOptions); - return $currentOptions; } } diff --git a/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml b/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml index cf2b0704dc15b..9cff8c07d82b6 100644 --- a/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml +++ b/app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml @@ -72,7 +72,7 @@ </validation> <dataType>text</dataType> <tooltip> - <link>https://docs.magento.com/m2/ce/user_guide/stores/websites-stores-views.html</link> + <link>https://docs.magento.com/user-guide/stores/websites-stores-views.html</link> <description translate="true">You can adjust the scope of this synonym group by selecting an option from the list.</description> </tooltip> <label translate="true">Scope</label> diff --git a/app/code/Magento/Security/Model/SecurityCookie.php b/app/code/Magento/Security/Model/SecurityCookie.php index 9717fa3985094..a39450f047ba1 100644 --- a/app/code/Magento/Security/Model/SecurityCookie.php +++ b/app/code/Magento/Security/Model/SecurityCookie.php @@ -10,6 +10,7 @@ /** * Manager for a cookie with logout reason * + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) * @api * @since 100.1.0 */ @@ -80,6 +81,7 @@ public function setLogoutReasonCookie($status) { $metaData = $this->createCookieMetaData(); $metaData->setPath('/' . $this->backendData->getAreaFrontName()); + $metaData->setSameSite('Strict'); $this->phpCookieManager->setPublicCookie( self::LOGOUT_REASON_CODE_COOKIE_NAME, diff --git a/app/code/Magento/Security/Test/Mftf/Test/StorefrontSecureChangingCustomerEmailTest.xml b/app/code/Magento/Security/Test/Mftf/Test/StorefrontSecureChangingCustomerEmailTest.xml index 6a89d90a2d8ca..6e866893fa51e 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/StorefrontSecureChangingCustomerEmailTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/StorefrontSecureChangingCustomerEmailTest.xml @@ -15,41 +15,44 @@ <title value="Changing Customer Email Test"/> <description value="Changing Customer's email with correct and wrong passwords"/> <testCaseId value="MC-14385"/> + <useCaseId value="MC-38673"/> <severity value="CRITICAL"/> <group value="security"/> <group value="mtf_migrated"/> </annotations> - <before> <createData entity="Simple_US_Customer" stepKey="customer"/> </before> <after> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> </after> - - <!-- TEST BODY --> <!-- Go to storefront home page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> <!-- Login as created customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> - <argument name="Customer" value="$$customer$$"/> + <argument name="Customer" value="$customer$"/> </actionGroup> <!-- Navigate to "Account Information" tab First Time--> <actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPageFirstTime"/> - <!-- Checking Email checkbox, entering new email, saving with correct password --> + <!-- Enter new email and save with correct password --> <actionGroup ref="StorefrontCustomerChangeEmailActionGroup" stepKey="changeEmailCorrectAttempt"> - <argument name="email" value="$$customer.email$$"/> - <argument name="password" value="$$customer.password$$"/> + <argument name="email" value="$customer.email$"/> + <argument name="password" value="$customer.password$"/> </actionGroup> <!-- See Success Notify--> <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="seeSuccessMessage"> <argument name="message" value="You saved the account information."/> </actionGroup> + <see userInput="Default welcome msg!" selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="assertWelcomeMessage"/> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccountAfterEmailChange"> + <argument name="Customer" value="$customer$"/> + </actionGroup> <!-- Navigate to "Account Information" tab Second Time--> <actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPageSecondTime" /> - <!-- Checking Email checkbox, entering new email, saving with incorrect password --> + <!-- Enter new email and save with correct password --> <actionGroup ref="StorefrontCustomerChangeEmailActionGroup" stepKey="changeEmailWrongAttempt"> - <argument name="email" value="$$customer.email$$"/> + <argument name="email" value="$customer.email$"/> <argument name="password" value="WRONG_PASSWORD_123123q"/> </actionGroup> <!-- See Failure Message--> @@ -57,8 +60,5 @@ <argument name="message" value="The password doesn't match this account. Verify the password and try again."/> <argument name="messageType" value="error"/> </actionGroup> - - <!-- END TEST BODY --> - </test> </tests> diff --git a/app/code/Magento/Security/Test/Unit/Model/SecurityCookieTest.php b/app/code/Magento/Security/Test/Unit/Model/SecurityCookieTest.php index 6af1139a561bb..10759d828d736 100644 --- a/app/code/Magento/Security/Test/Unit/Model/SecurityCookieTest.php +++ b/app/code/Magento/Security/Test/Unit/Model/SecurityCookieTest.php @@ -57,7 +57,7 @@ protected function setUp(): void $this->cookieMetadataMock = $this->createPartialMock( PublicCookieMetadata::class, - ['setPath', 'setDuration'] + ['setPath', 'setDuration', 'setSameSite'] ); $this->cookieReaderMock = $this->createPartialMock( @@ -118,6 +118,11 @@ public function testSetLogoutReasonCookie() ->with('/' . $frontName) ->willReturnSelf(); + $this->cookieMetadataMock->expects($this->once()) + ->method('setSameSite') + ->with('Strict') + ->willReturnSelf(); + $this->phpCookieManagerMock->expects($this->once()) ->method('setPublicCookie') ->with( diff --git a/app/code/Magento/SendFriend/Model/SendFriend.php b/app/code/Magento/SendFriend/Model/SendFriend.php index b84205b702016..bb5fda5438961 100644 --- a/app/code/Magento/SendFriend/Model/SendFriend.php +++ b/app/code/Magento/SendFriend/Model/SendFriend.php @@ -8,6 +8,9 @@ namespace Magento\SendFriend\Model; use Magento\Framework\Exception\LocalizedException as CoreException; +use Magento\Framework\Stdlib\Cookie\CookieMetadata; +use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory; +use Magento\Framework\App\ObjectManager; /** * SendFriend Log @@ -112,6 +115,11 @@ class SendFriend extends \Magento\Framework\Model\AbstractModel */ protected $remoteAddress; + /** + * @var CookieMetadataFactory + */ + private $cookieMetadataFactory; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -126,6 +134,7 @@ class SendFriend extends \Magento\Framework\Model\AbstractModel * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection * @param array $data + * @param CookieMetadataFactory $cookieMetadataFactory * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -141,7 +150,8 @@ public function __construct( \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, - array $data = [] + array $data = [], + CookieMetadataFactory $cookieMetadataFactory = null ) { $this->_storeManager = $storeManager; $this->_transportBuilder = $transportBuilder; @@ -151,6 +161,9 @@ public function __construct( $this->remoteAddress = $remoteAddress; $this->cookieManager = $cookieManager; $this->inlineTranslation = $inlineTranslation; + $this->cookieMetadataFactory = $cookieMetadataFactory ?? ObjectManager::getInstance()->get( + CookieMetadataFactory::class + ); parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -484,6 +497,11 @@ protected function _sentCountByCookies($increment = false) $cookieName = $this->_sendfriendData->getCookieName(); $time = time(); $newTimes = []; + $sensitiveCookMetadata = $this->cookieMetadataFactory->createSensitiveCookieMetadata( + [ + CookieMetadata::KEY_SAME_SITE => 'Lax' + ] + ); if (isset($this->_lastCookieValue[$cookieName])) { $oldTimes = $this->_lastCookieValue[$cookieName]; @@ -504,7 +522,7 @@ protected function _sentCountByCookies($increment = false) if ($increment) { $newTimes[] = $time; $newValue = implode(',', $newTimes); - $this->cookieManager->setSensitiveCookie($cookieName, $newValue); + $this->cookieManager->setSensitiveCookie($cookieName, $newValue, $sensitiveCookMetadata); $this->_lastCookieValue[$cookieName] = $newValue; } diff --git a/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php b/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php index c0de26a7c45ff..830b6caf96a37 100644 --- a/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php +++ b/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php @@ -7,12 +7,15 @@ namespace Magento\SendFriend\Test\Unit\Model; +use Magento\Framework\Stdlib\Cookie\CookieMetadata; +use Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata; use Magento\Framework\Stdlib\CookieManagerInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\SendFriend\Helper\Data; use Magento\SendFriend\Model\SendFriend; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory; /** * Test SendFriend @@ -35,6 +38,11 @@ class SendFriendTest extends TestCase */ protected $sendfriendDataMock; + /** + * @var MockObject|CookieMetadataFactory + */ + protected $cookieMetadataFactoryMock; + protected function setUp(): void { $objectManager = new ObjectManager($this); @@ -42,12 +50,18 @@ protected function setUp(): void ->disableOriginalConstructor() ->getMock(); $this->cookieManagerMock = $this->getMockForAbstractClass(CookieManagerInterface::class); + $this->cookieMetadataFactoryMock = $this->getMockBuilder( + CookieMetadataFactory::class + ) + ->disableOriginalConstructor() + ->getMock(); $this->model = $objectManager->getObject( SendFriend::class, [ 'sendfriendData' => $this->sendfriendDataMock, 'cookieManager' => $this->cookieManagerMock, + 'cookieMetadataFactory' => $this->cookieMetadataFactoryMock ] ); } @@ -69,12 +83,25 @@ public function testGetSentCountWithCheckCookie() public function testSentCountByCookies() { $cookieName = 'testCookieName'; + $sensitiveCookieMetadataMock = $this->getMockBuilder( + SensitiveCookieMetadata::class + ) + ->disableOriginalConstructor() + ->getMock(); $this->sendfriendDataMock->expects($this->once())->method('getCookieName')->with()->willReturn( $cookieName ); $this->cookieManagerMock->expects($this->once())->method('getCookie')->with($cookieName); $this->cookieManagerMock->expects($this->once())->method('setSensitiveCookie'); + $this->cookieMetadataFactoryMock->expects($this->once()) + ->method('createSensitiveCookieMetadata') + ->with( + [ + CookieMetadata::KEY_SAME_SITE => 'Lax' + ] + ) + ->willReturn($sensitiveCookieMetadataMock); $sendFriendClass = new \ReflectionClass(SendFriend::class); $method = $sendFriendClass->getMethod('_sentCountByCookies'); $method->setAccessible(true); diff --git a/app/code/Magento/SendFriend/etc/adminhtml/system.xml b/app/code/Magento/SendFriend/etc/adminhtml/system.xml index 6360c42655a09..0092fe4ab2918 100644 --- a/app/code/Magento/SendFriend/etc/adminhtml/system.xml +++ b/app/code/Magento/SendFriend/etc/adminhtml/system.xml @@ -16,7 +16,7 @@ <field id="enabled" translate="label comment" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Enabled</label> <comment> - <![CDATA[We strongly recommend to enable a <a href="https://devdocs.magento.com/guides/v2.3/security/google-recaptcha.html" target="_blank">CAPTCHA solution</a> alongside enabling "Email to a Friend" to ensure abuse of this feature does not occur.]]> + <![CDATA[We strongly recommend to enable a <a href="https://devdocs.magento.com/guides/v2.4/security/google-recaptcha.html" target="_blank">CAPTCHA solution</a> alongside enabling "Email to a Friend" to ensure abuse of this feature does not occur.]]> </comment> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> </field> diff --git a/app/code/Magento/SendFriend/i18n/en_US.csv b/app/code/Magento/SendFriend/i18n/en_US.csv index 8d5b596fe1ca6..96a0665df4d39 100644 --- a/app/code/Magento/SendFriend/i18n/en_US.csv +++ b/app/code/Magento/SendFriend/i18n/en_US.csv @@ -45,4 +45,4 @@ Enabled,Enabled "Max Recipients","Max Recipients" "Max Products Sent in 1 Hour","Max Products Sent in 1 Hour" "Limit Sending By","Limit Sending By" -"We strongly recommend to enable a <a href=""https://devdocs.magento.com/guides/v2.3/security/google-recaptcha.html"" target="_blank">CAPTCHA solution</a> alongside enabling ""Email to a Friend"" to ensure abuse of this feature does not occur.","We strongly recommend to enable a <a href=""https://devdocs.magento.com/guides/v2.3/security/google-recaptcha.html"" target="_blank">CAPTCHA solution</a> alongside enabling ""Email to a Friend"" to ensure abuse of this feature does not occur." +"We strongly recommend to enable a <a href=""https://devdocs.magento.com/guides/v2.4/security/google-recaptcha.html"" target="_blank">CAPTCHA solution</a> alongside enabling ""Email to a Friend"" to ensure abuse of this feature does not occur.","We strongly recommend to enable a <a href=""https://devdocs.magento.com/guides/v2.4/security/google-recaptcha.html"" target="_blank">CAPTCHA solution</a> alongside enabling ""Email to a Friend"" to ensure abuse of this feature does not occur." diff --git a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml index b1e3da8612f78..bcfc243a43642 100644 --- a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml +++ b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml @@ -11,6 +11,7 @@ * @var \Magento\SendFriend\Block\Send $block * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound ?> <script id="add-recipient-tmpl" type="text/x-magento-template"> diff --git a/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php b/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php index ce4521c9baa51..f66b37a9cd34f 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php @@ -380,7 +380,7 @@ public function getContentTypes() public function getCustomValueCurrencyCode() { $orderInfo = $this->getShipment()->getOrder(); - return $orderInfo->getBaseCurrency()->getCurrencyCode(); + return $orderInfo->getOrderCurrency()->getCurrencyCode(); } /** diff --git a/app/code/Magento/Shipping/Block/Items.php b/app/code/Magento/Shipping/Block/Items.php index f6dc5daa05fd8..59f92e8ea303d 100644 --- a/app/code/Magento/Shipping/Block/Items.php +++ b/app/code/Magento/Shipping/Block/Items.php @@ -12,6 +12,8 @@ namespace Magento\Shipping\Block; /** + * Shipping Items Block + * * @api * @since 100.0.2 */ @@ -49,6 +51,8 @@ public function getOrder() } /** + * Get Print Shipment Url + * * @param object $shipment * @return string */ @@ -58,6 +62,8 @@ public function getPrintShipmentUrl($shipment) } /** + * Get Print All Shipments Url + * * @param object $order * @return string */ @@ -77,7 +83,7 @@ public function getCommentsHtml($shipment) $html = ''; $comments = $this->getChildBlock('shipment_comments'); if ($comments) { - $comments->setEntity($shipment)->setTitle(__('About Your Shipment')); + $comments->setEntity($shipment)->setTitle($this->escapeHtmlAttr(__('About Your Shipment'))); $html = $comments->toHtml(); } return $html; diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php index 0965c4a472c25..e80b0f89b1934 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php @@ -404,6 +404,23 @@ public function getSortOrder() return $this->getConfigData('sort_order'); } + /** + * Check if the request has free shipping weight + * + * @param \Magento\Quote\Model\Quote\Address\RateRequest $request + * @return bool + */ + private function hasFreeMethodWeight($request): bool + { + return ( + $request->getFreeShipping() + || ( + $request->hasFreeMethodWeight() + && ((float) $request->getFreeMethodWeight()) !== ((float) $request->getPackageWeight()) + ) + ); + } + /** * Allows free shipping when all product items have free shipping. * @@ -414,10 +431,7 @@ public function getSortOrder() */ protected function _updateFreeMethodQuote($request) { - if (!$request->getFreeShipping()) { - return; - } - if ($request->getFreeMethodWeight() == $request->getPackageWeight() || !$request->hasFreeMethodWeight()) { + if (!$this->hasFreeMethodWeight($request)) { return; } diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php index c2238ff1a3809..f88fecf84be6a 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php @@ -654,7 +654,7 @@ public function getMethodPrice($cost, $method = '') 'free_shipping_enable' ) && $this->getConfigData( 'free_shipping_subtotal' - ) <= $this->_rawRequest->getBaseSubtotalInclTax() ? '0.00' : $this->getFinalPriceWithHandlingFee( + ) <= $this->_rawRequest->getValueWithDiscount() ? '0.00' : $this->getFinalPriceWithHandlingFee( $cost ); } diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml index fe2a1bf86a8ce..da2561ed7cf54 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml @@ -64,9 +64,7 @@ <argument name="file" value="usa_tablerates.csv"/> </actionGroup> <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!--Delete created data--> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml index 0d709e1d08006..de45cbf9bb2fe 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml @@ -19,6 +19,22 @@ <before> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + <createData entity="Shipment" stepKey="shipOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> @@ -26,12 +42,11 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="CreateOrderActionGroup" stepKey="goToCreateOrderPage"> - <argument name="customer" value="$$createCustomer$$"/> - <argument name="product" value="$$createSimpleProduct$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> - <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="createShipmentForOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToCreateOrderPage"/> + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="openOrdersGrid"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createCustomerCart.return$)}}" stepKey="orderId"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createShipmentForOrder"/> <actionGroup ref="FilterShipmentGridByOrderIdActionGroup" stepKey="filterForNewlyCreatedShipment"> <argument name="orderId" value="$orderId"/> </actionGroup> diff --git a/app/code/Magento/Shipping/view/adminhtml/templates/order/tracking.phtml b/app/code/Magento/Shipping/view/adminhtml/templates/order/tracking.phtml index 1dcc7439532b6..1f5ce694939fd 100644 --- a/app/code/Magento/Shipping/view/adminhtml/templates/order/tracking.phtml +++ b/app/code/Magento/Shipping/view/adminhtml/templates/order/tracking.phtml @@ -3,8 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -?> -<?php + +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** * @var $block Magento\Shipping\Block\Adminhtml\Order\Tracking * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer diff --git a/app/code/Magento/Store/App/Request/PathInfoProcessor.php b/app/code/Magento/Store/App/Request/PathInfoProcessor.php index fad0d07c3a0a7..23a0ca898bfbd 100644 --- a/app/code/Magento/Store/App/Request/PathInfoProcessor.php +++ b/app/code/Magento/Store/App/Request/PathInfoProcessor.php @@ -7,10 +7,13 @@ namespace Magento\Store\App\Request; +use Magento\Framework\App\Request\PathInfoProcessorInterface; +use Magento\Framework\App\RequestInterface; + /** * Processes the path and looks for the store in the url and removes it and modifies the path accordingly. */ -class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProcessorInterface +class PathInfoProcessor implements PathInfoProcessorInterface { /** * @var StorePathInfoValidator @@ -18,20 +21,11 @@ class PathInfoProcessor implements \Magento\Framework\App\Request\PathInfoProces private $storePathInfoValidator; /** - * @var \Magento\Framework\App\Config\ReinitableConfigInterface - */ - private $config; - - /** - * @param \Magento\Store\App\Request\StorePathInfoValidator $storePathInfoValidator - * @param \Magento\Framework\App\Config\ReinitableConfigInterface $config + * @param StorePathInfoValidator $storePathInfoValidator */ - public function __construct( - \Magento\Store\App\Request\StorePathInfoValidator $storePathInfoValidator, - \Magento\Framework\App\Config\ReinitableConfigInterface $config - ) { + public function __construct(StorePathInfoValidator $storePathInfoValidator) + { $this->storePathInfoValidator = $storePathInfoValidator; - $this->config = $config; } /** @@ -39,24 +33,22 @@ public function __construct( * * This method also sets request to no route if store is not valid and store is present in url config is enabled * - * @param \Magento\Framework\App\RequestInterface $request + * @param RequestInterface $request * @param string $pathInfo * @return string */ - public function process(\Magento\Framework\App\RequestInterface $request, $pathInfo) : string + public function process(RequestInterface $request, $pathInfo) : string { - //can store code be used in url - if ((bool)$this->config->getValue(\Magento\Store\Model\Store::XML_PATH_STORE_IN_URL)) { - $storeCode = $this->storePathInfoValidator->getValidStoreCode($request, $pathInfo); - if (!empty($storeCode)) { - if (!$request->isDirectAccessFrontendName($storeCode)) { - $pathInfo = $this->trimStoreCodeFromPathInfo($pathInfo, $storeCode); - } else { - //no route in case we're trying to access a store that has the same code as a direct access - $request->setActionName(\Magento\Framework\App\Router\Base::NO_ROUTE); - } + $storeCode = $this->storePathInfoValidator->getValidStoreCode($request, $pathInfo); + if (!empty($storeCode)) { + if (!$request->isDirectAccessFrontendName($storeCode)) { + $pathInfo = $this->trimStoreCodeFromPathInfo($pathInfo, $storeCode); + } else { + //no route in case we're trying to access a store that has the same code as a direct access + $request->setActionName(\Magento\Framework\App\Router\Base::NO_ROUTE); } } + return $pathInfo; } @@ -67,7 +59,7 @@ public function process(\Magento\Framework\App\RequestInterface $request, $pathI * @param string $storeCode * @return string */ - private function trimStoreCodeFromPathInfo(string $pathInfo, string $storeCode) : ?string + private function trimStoreCodeFromPathInfo(string $pathInfo, string $storeCode) : string { if (substr($pathInfo, 0, strlen('/' . $storeCode)) == '/'. $storeCode) { $pathInfo = substr($pathInfo, strlen($storeCode)+1); diff --git a/app/code/Magento/Store/App/Request/StorePathInfoValidator.php b/app/code/Magento/Store/App/Request/StorePathInfoValidator.php index 0b66ba7586009..abbf29fd0c916 100644 --- a/app/code/Magento/Store/App/Request/StorePathInfoValidator.php +++ b/app/code/Magento/Store/App/Request/StorePathInfoValidator.php @@ -7,8 +7,14 @@ namespace Magento\Store\App\Request; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Request\Http; +use Magento\Framework\App\Request\PathInfo; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Store\Api\StoreRepositoryInterface; use Magento\Store\Model\Store; +use Magento\Store\Model\StoreIsInactiveException; +use Magento\Store\Model\Validation\StoreCodeValidator; /** * Gets the store from the path if valid @@ -18,74 +24,74 @@ class StorePathInfoValidator /** * Store Config * - * @var \Magento\Framework\App\Config\ReinitableConfigInterface + * @var ScopeConfigInterface */ private $config; /** - * @var \Magento\Store\Api\StoreRepositoryInterface + * @var StoreRepositoryInterface */ private $storeRepository; /** - * @var \Magento\Framework\App\Request\PathInfo + * @var PathInfo */ private $pathInfo; /** - * @param \Magento\Framework\App\Config\ReinitableConfigInterface $config - * @param \Magento\Store\Api\StoreRepositoryInterface $storeRepository - * @param \Magento\Framework\App\Request\PathInfo $pathInfo + * @var StoreCodeValidator + */ + private $storeCodeValidator; + + /** + * @param ScopeConfigInterface $config + * @param StoreRepositoryInterface $storeRepository + * @param PathInfo $pathInfo + * @param StoreCodeValidator $storeCodeValidator */ public function __construct( - \Magento\Framework\App\Config\ReinitableConfigInterface $config, - \Magento\Store\Api\StoreRepositoryInterface $storeRepository, - \Magento\Framework\App\Request\PathInfo $pathInfo + ScopeConfigInterface $config, + StoreRepositoryInterface $storeRepository, + PathInfo $pathInfo, + StoreCodeValidator $storeCodeValidator ) { $this->config = $config; $this->storeRepository = $storeRepository; $this->pathInfo = $pathInfo; + $this->storeCodeValidator = $storeCodeValidator; } /** * Get store code from path info validate if config value. If path info is empty the try to calculate from request. * - * @param \Magento\Framework\App\Request\Http $request + * @param Http $request * @param string $pathInfo * @return string|null */ - public function getValidStoreCode( - \Magento\Framework\App\Request\Http $request, - string $pathInfo = '' - ) : ?string { + public function getValidStoreCode(Http $request, string $pathInfo = '') : ?string + { + $useStoreCodeInUrl = (bool) $this->config->getValue(Store::XML_PATH_STORE_IN_URL); + if (!$useStoreCodeInUrl) { + return null; + } + if (empty($pathInfo)) { - $pathInfo = $this->pathInfo->getPathInfo( - $request->getRequestUri(), - $request->getBaseUrl() - ); + $pathInfo = $this->pathInfo->getPathInfo($request->getRequestUri(), $request->getBaseUrl()); } $storeCode = $this->getStoreCode($pathInfo); - if (!empty($storeCode) - && $storeCode != Store::ADMIN_CODE - && (bool)$this->config->getValue(\Magento\Store\Model\Store::XML_PATH_STORE_IN_URL) - ) { - try { - $this->storeRepository->getActiveStoreByCode($storeCode); + if (empty($storeCode) || $storeCode === Store::ADMIN_CODE || !$this->storeCodeValidator->isValid($storeCode)) { + return null; + } + + try { + $this->storeRepository->getActiveStoreByCode($storeCode); - if ((bool)$this->config->getValue( - \Magento\Store\Model\Store::XML_PATH_STORE_IN_URL, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $storeCode - )) { - return $storeCode; - } - } catch (NoSuchEntityException $e) { - //return null; - } catch (\Magento\Store\Model\StoreIsInactiveException $e) { - //return null; - } + return $storeCode; + } catch (NoSuchEntityException $e) { + return null; + } catch (StoreIsInactiveException $e) { + return null; } - return null; } /** diff --git a/app/code/Magento/Store/Model/App/Emulation.php b/app/code/Magento/Store/Model/App/Emulation.php index 256c3976aa9cd..fe9df22c2433c 100644 --- a/app/code/Magento/Store/Model/App/Emulation.php +++ b/app/code/Magento/Store/Model/App/Emulation.php @@ -66,6 +66,11 @@ class Emulation extends \Magento\Framework\DataObject */ private $logger; + /** + * @var \Magento\Framework\View\DesignInterface + */ + private $_viewDesign; + /** * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\View\DesignInterface $viewDesign diff --git a/app/code/Magento/Store/Model/ResourceModel/StoreWebsiteRelation.php b/app/code/Magento/Store/Model/ResourceModel/StoreWebsiteRelation.php index 875c0e6cb3b05..d2b702a5821e0 100644 --- a/app/code/Magento/Store/Model/ResourceModel/StoreWebsiteRelation.php +++ b/app/code/Magento/Store/Model/ResourceModel/StoreWebsiteRelation.php @@ -50,30 +50,64 @@ public function getStoreByWebsiteId($websiteId) * @param int $websiteId * @param bool $available * @param int|null $storeGroupId + * @param int|null $storeId * @return array */ - public function getWebsiteStores(int $websiteId, bool $available = false, int $storeGroupId = null): array - { + public function getWebsiteStores( + int $websiteId, + bool $available = false, + int $storeGroupId = null, + int $storeId = null + ): array { $connection = $this->resource->getConnection(); $storeTable = $this->resource->getTableName('store'); - $storeSelect = $connection->select()->from($storeTable)->where( - 'website_id = ?', - $websiteId - ); + $storeSelect = $connection->select() + ->from(['main_table' => $storeTable]) + ->join( + ['group_table' => $this->resource->getTableName('store_group')], + 'main_table.group_id = group_table.group_id', + [ + 'store_group_code' => 'code', + 'store_group_name' => 'name', + 'default_store_id' + ] + ) + ->join( + ['website' => $this->resource->getTableName('store_website')], + 'main_table.website_id = website.website_id', + [ + 'website_code' => 'code', + 'website_name' => 'name', + 'website_sort_order' => 'sort_order', + 'default_group_id' + ] + ); if ($storeGroupId) { $storeSelect = $storeSelect->where( - 'group_id = ?', + 'main_table.group_id = ?', $storeGroupId ); } + if ($storeId) { + $storeSelect = $storeSelect->where( + 'main_table.store_id = ?', + $storeId + ); + } + if ($available) { $storeSelect = $storeSelect->where( - 'is_active = 1' + 'main_table.is_active = 1' ); } + $storeSelect = $storeSelect->where( + 'main_table.website_id = ?', + $websiteId + ); + return $connection->fetchAll($storeSelect); } } diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php index 7bcb3282ba552..f437d9bca0b74 100644 --- a/app/code/Magento/Store/Model/Store.php +++ b/app/code/Magento/Store/Model/Store.php @@ -332,6 +332,11 @@ class Store extends AbstractExtensibleModel implements */ private $pillPut; + /** + * @var \Magento\Store\Model\Validation\StoreValidator + */ + private $modelValidator; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -359,6 +364,7 @@ class Store extends AbstractExtensibleModel implements * @param array $data optional generic object data * @param \Magento\Framework\Event\ManagerInterface|null $eventManager * @param \Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface|null $pillPut + * @param \Magento\Store\Model\Validation\StoreValidator|null $modelValidator * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -388,7 +394,8 @@ public function __construct( $isCustomEntryPoint = false, array $data = [], \Magento\Framework\Event\ManagerInterface $eventManager = null, - \Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface $pillPut = null + \Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface $pillPut = null, + \Magento\Store\Model\Validation\StoreValidator $modelValidator = null ) { $this->_coreFileStorageDatabase = $coreFileStorageDatabase; $this->_config = $config; @@ -411,6 +418,9 @@ public function __construct( ->get(\Magento\Framework\Event\ManagerInterface::class); $this->pillPut = $pillPut ?: \Magento\Framework\App\ObjectManager::getInstance() ->get(\Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface::class); + $this->modelValidator = $modelValidator ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Store\Model\Validation\StoreValidator::class); + parent::__construct( $context, $registry, @@ -479,23 +489,7 @@ protected function _getSession() */ protected function _getValidationRulesBeforeSave() { - $validator = new \Magento\Framework\Validator\DataObject(); - - $storeLabelRule = new \Zend_Validate_NotEmpty(); - $storeLabelRule->setMessage(__('Name is required'), \Zend_Validate_NotEmpty::IS_EMPTY); - $validator->addRule($storeLabelRule, 'name'); - - $storeCodeRule = new \Zend_Validate_Regex('/^[a-z]+[a-z0-9_]*$/i'); - $storeCodeRule->setMessage( - __( - 'The store code may contain only letters (a-z), numbers (0-9) or underscore (_),' - . ' and the first character must be a letter.' - ), - \Zend_Validate_Regex::NOT_MATCH - ); - $validator->addRule($storeCodeRule, 'code'); - - return $validator; + return $this->modelValidator; } /** diff --git a/app/code/Magento/Store/Model/StoreCookieManager.php b/app/code/Magento/Store/Model/StoreCookieManager.php index d94357caf785c..71188396e7998 100644 --- a/app/code/Magento/Store/Model/StoreCookieManager.php +++ b/app/code/Magento/Store/Model/StoreCookieManager.php @@ -12,6 +12,8 @@ /** * DTO class to work with cookies. + * + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class StoreCookieManager implements StoreCookieManagerInterface { @@ -58,7 +60,8 @@ public function setStoreCookie(StoreInterface $store) $cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata() ->setHttpOnly(false) ->setDurationOneYear() - ->setPath($store->getStorePath()); + ->setPath($store->getStorePath()) + ->setSameSite('Lax'); $this->cookieManager->setPublicCookie(self::COOKIE_NAME, $store->getCode(), $cookieMetadata); } diff --git a/app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php b/app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php index 45e93a5af06de..0190a6c5d9584 100644 --- a/app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php +++ b/app/code/Magento/Store/Model/StoreSwitcher/HashProcessor.php @@ -96,39 +96,41 @@ public function __construct( */ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string { - $timestamp = (int) $this->request->getParam('time_stamp'); - $signature = (string) $this->request->getParam('signature'); - $data = (string) $this->request->getParam('data'); - $context = $this->contextFactory->create( - [ - 'fromStore' => $fromStore, - 'targetStore' => $targetStore, - 'redirectUrl' => $redirectUrl - ] - ); - $redirectDataObject = $this->dataFactory->create( - [ - 'signature' => $signature, - 'timestamp' => $timestamp, - 'data' => $data - ] - ); + if ($this->request->getParam('data') !== null) { + $timestamp = (int) $this->request->getParam('time_stamp'); + $signature = (string) $this->request->getParam('signature'); + $data = (string) $this->request->getParam('data'); + $context = $this->contextFactory->create( + [ + 'fromStore' => $fromStore, + 'targetStore' => $targetStore, + 'redirectUrl' => $redirectUrl + ] + ); + $redirectDataObject = $this->dataFactory->create( + [ + 'signature' => $signature, + 'timestamp' => $timestamp, + 'data' => $data + ] + ); - try { - if ($redirectUrl && $this->dataValidator->validate($context, $redirectDataObject)) { - $this->postprocessor->process($context, $this->dataSerializer->unserialize($data)); - } else { - throw new LocalizedException( - __('The requested store cannot be found. Please check the request and try again.') + try { + if ($redirectUrl && $this->dataValidator->validate($context, $redirectDataObject)) { + $this->postprocessor->process($context, $this->dataSerializer->unserialize($data)); + } else { + throw new LocalizedException( + __('The requested store cannot be found. Please check the request and try again.') + ); + } + } catch (LocalizedException $exception) { + $this->messageManager->addErrorMessage($exception->getMessage()); + } catch (\Throwable $exception) { + $this->logger->error($exception); + $this->messageManager->addErrorMessage( + __('Something went wrong.') ); } - } catch (LocalizedException $exception) { - $this->messageManager->addErrorMessage($exception->getMessage()); - } catch (\Throwable $exception) { - $this->logger->error($exception); - $this->messageManager->addErrorMessage( - __('Something went wrong.') - ); } return $redirectUrl; diff --git a/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php b/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php index 66fbce08a8b3d..80fd2be9c3b6a 100644 --- a/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php +++ b/app/code/Magento/Store/Model/StoreSwitcher/ManagePrivateContent.php @@ -12,6 +12,8 @@ /** * Set private content cookie to have actual local storage data on target store after store switching. + * + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class ManagePrivateContent implements StoreSwitcherInterface { @@ -46,6 +48,7 @@ public function __construct( * * @return string redirect url * @throws CannotSwitchStoreException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string { @@ -54,7 +57,8 @@ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, s ->setDurationOneYear() ->setPath('/') ->setSecure(false) - ->setHttpOnly(false); + ->setHttpOnly(false) + ->setSameSite('Lax'); $this->cookieManager->setPublicCookie( \Magento\Framework\App\PageCache\Version::COOKIE_NAME, \uniqid('updated-', true), diff --git a/app/code/Magento/Store/Model/StoresData.php b/app/code/Magento/Store/Model/StoresData.php index b3d00bc97cd2e..eb3a291f85785 100644 --- a/app/code/Magento/Store/Model/StoresData.php +++ b/app/code/Magento/Store/Model/StoresData.php @@ -56,6 +56,8 @@ public function __construct( */ public function getStoresData(string $runMode, string $scopeCode = null) : array { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $cacheKey = 'resolved_stores_' . md5($runMode . $scopeCode); $cacheData = $this->cache->load($cacheKey); if ($cacheData) { diff --git a/app/code/Magento/Store/Model/Validation/StoreCodeValidator.php b/app/code/Magento/Store/Model/Validation/StoreCodeValidator.php new file mode 100644 index 0000000000000..4dba36dfe935d --- /dev/null +++ b/app/code/Magento/Store/Model/Validation/StoreCodeValidator.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Model\Validation; + +use Magento\Framework\Validator\AbstractValidator; +use Magento\Framework\Validator\RegexFactory; + +/** + * Validator for store code. + */ +class StoreCodeValidator extends AbstractValidator +{ + /** + * @var RegexFactory + */ + private $regexValidatorFactory; + + /** + * @param RegexFactory $regexValidatorFactory + */ + public function __construct(RegexFactory $regexValidatorFactory) + { + $this->regexValidatorFactory = $regexValidatorFactory; + } + + /** + * @inheritDoc + */ + public function isValid($value) + { + $validator = $this->regexValidatorFactory->create(['pattern' => '/^[a-z]+[a-z0-9_]*$/i']); + $validator->setMessage( + __( + 'The store code may contain only letters (a-z), numbers (0-9) or underscore (_),' + . ' and the first character must be a letter.' + ), + \Zend_Validate_Regex::NOT_MATCH + ); + $result = $validator->isValid($value); + $this->_messages = $validator->getMessages(); + + return $result; + } +} diff --git a/app/code/Magento/Store/Model/Validation/StoreNameValidator.php b/app/code/Magento/Store/Model/Validation/StoreNameValidator.php new file mode 100644 index 0000000000000..7d97a37cc9f55 --- /dev/null +++ b/app/code/Magento/Store/Model/Validation/StoreNameValidator.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Model\Validation; + +use Magento\Framework\Validator\AbstractValidator; +use Magento\Framework\Validator\NotEmptyFactory; + +/** + * Validator for store name. + */ +class StoreNameValidator extends AbstractValidator +{ + /** + * @var NotEmptyFactory + */ + private $notEmptyValidatorFactory; + + /** + * @param NotEmptyFactory $notEmptyValidatorFactory + */ + public function __construct(NotEmptyFactory $notEmptyValidatorFactory) + { + $this->notEmptyValidatorFactory = $notEmptyValidatorFactory; + } + + /** + * @inheritDoc + */ + public function isValid($value) + { + $validator = $this->notEmptyValidatorFactory->create(['options' => []]); + $validator->setMessage( + __('Name is required'), + \Zend_Validate_NotEmpty::IS_EMPTY + ); + $result = $validator->isValid($value); + $this->_messages = $validator->getMessages(); + + return $result; + } +} diff --git a/app/code/Magento/Store/Model/Validation/StoreValidator.php b/app/code/Magento/Store/Model/Validation/StoreValidator.php new file mode 100644 index 0000000000000..7fa969f7c3621 --- /dev/null +++ b/app/code/Magento/Store/Model/Validation/StoreValidator.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Model\Validation; + +use Magento\Framework\Validator\AbstractValidator; +use Magento\Framework\Validator\DataObjectFactory; +use Magento\Framework\Validator\ValidatorInterface; + +/** + * Store model validator. + */ +class StoreValidator extends AbstractValidator +{ + /** + * @var DataObjectFactory + */ + private $dataObjectValidatorFactory; + + /** + * @var ValidatorInterface[] + */ + private $rules; + + /** + * @param DataObjectFactory $dataObjectValidatorFactory + * @param ValidatorInterface[] $rules + */ + public function __construct(DataObjectFactory $dataObjectValidatorFactory, array $rules = []) + { + $this->dataObjectValidatorFactory = $dataObjectValidatorFactory; + $this->rules = $rules; + } + + /** + * @inheritDoc + */ + public function isValid($value) + { + $validator = $this->dataObjectValidatorFactory->create(); + foreach ($this->rules as $fieldName => $rule) { + $validator->addRule($rule, $fieldName); + } + $result = $validator->isValid($value); + $this->_messages = $validator->getMessages(); + + return $result; + } +} diff --git a/app/code/Magento/Store/Model/Website.php b/app/code/Magento/Store/Model/Website.php index 42c89bbe4210d..1fc96a1128944 100644 --- a/app/code/Magento/Store/Model/Website.php +++ b/app/code/Magento/Store/Model/Website.php @@ -164,6 +164,11 @@ class Website extends \Magento\Framework\Model\AbstractExtensibleModel implement */ private $pillPut; + /** + * @var \Magento\Framework\App\Config\ScopeConfigInterface + */ + private $_coreConfig; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry diff --git a/app/code/Magento/Store/Test/Mftf/Test/StorefrontCheckSortOrderStoreViewTest.xml b/app/code/Magento/Store/Test/Mftf/Test/StorefrontCheckSortOrderStoreViewTest.xml index 442ee99e12793..6bced4a507df6 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/StorefrontCheckSortOrderStoreViewTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/StorefrontCheckSortOrderStoreViewTest.xml @@ -38,12 +38,8 @@ <argument name="storeGroupName" value="SecondStoreGroupUnique.name"/> </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <actionGroup ref="AdminCreateStoreViewFillSortOrderActionGroup" stepKey="createFirstStoreView"> <argument name="StoreGroup" value="customStoreGroup"/> diff --git a/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php b/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php index c6b8225530089..fd5da89a4523c 100644 --- a/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php +++ b/app/code/Magento/Store/Test/Unit/App/Request/PathInfoProcessorTest.php @@ -7,171 +7,87 @@ namespace Magento\Store\Test\Unit\App\Request; -use Magento\Framework\App\Config\ReinitableConfigInterface; use Magento\Framework\App\Request\Http; -use Magento\Framework\App\Request\PathInfo; -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Store\Api\StoreRepositoryInterface; use Magento\Store\App\Request\PathInfoProcessor; use Magento\Store\App\Request\StorePathInfoValidator; -use Magento\Store\Model\Store; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class PathInfoProcessorTest extends TestCase { /** - * @var PathInfoProcessor - */ - private $model; - - /** - * @var MockObject - */ - private $requestMock; - - /** - * @var MockObject + * @var StorePathInfoValidator|MockObject */ - private $validatorConfigMock; + private $storePathInfoValidatorMock; /** - * @var MockObject - */ - private $processorConfigMock; - - /** - * @var MockObject + * @var PathInfoProcessor */ - private $pathInfoMock; + private $model; /** - * @var MockObject + * @var Http|MockObject */ - private $storeRepositoryMock; + private $requestMock; /** - * @var MockObject + * @var string */ - private $storePathInfoValidator; + private $storeCode; /** * @var string */ - protected $pathInfo = '/storeCode/node_one/'; + private $pathInfo; protected function setUp(): void { - $this->requestMock = $this->getMockBuilder(Http::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->validatorConfigMock = $this->getMockForAbstractClass(ReinitableConfigInterface::class); - - $this->processorConfigMock = $this->getMockForAbstractClass(ReinitableConfigInterface::class); + $this->storePathInfoValidatorMock = $this->createMock(StorePathInfoValidator::class); + $this->model = new PathInfoProcessor($this->storePathInfoValidatorMock); - $this->storeRepositoryMock = $this->getMockForAbstractClass(StoreRepositoryInterface::class); - - $this->pathInfoMock = $this->getMockBuilder(PathInfo ::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->storePathInfoValidator = new StorePathInfoValidator( - $this->validatorConfigMock, - $this->storeRepositoryMock, - $this->pathInfoMock - ); - - $this->model = new PathInfoProcessor( - $this->storePathInfoValidator, - $this->validatorConfigMock - ); + $this->requestMock = $this->createMock(Http::class); + $this->storeCode = 'storeCode'; + $this->pathInfo = '/' . $this->storeCode . '/node_one/'; } - public function testProcessIfStoreExistsAndIsNotDirectAccessToFrontName() + public function testProcessIfStoreIsEmpty(): void { - $this->validatorConfigMock->expects($this->any())->method('getValue')->willReturn(true); + $this->storePathInfoValidatorMock->expects($this->once()) + ->method('getValidStoreCode') + ->willReturn(null); - $store = $this->createMock(Store::class); - $this->storeRepositoryMock->expects( - $this->atLeastOnce() - )->method( - 'getActiveStoreByCode' - )->with( - 'storeCode' - )->willReturn($store); - $this->requestMock->expects( - $this->atLeastOnce() - )->method( - 'isDirectAccessFrontendName' - )->with( - 'storeCode' - )->willReturn( - false - ); - $this->assertEquals('/node_one/', $this->model->process($this->requestMock, $this->pathInfo)); + $pathInfo = $this->model->process($this->requestMock, $this->pathInfo); + $this->assertEquals($this->pathInfo, $pathInfo); } - public function testProcessIfStoreExistsAndDirectAccessToFrontName() + public function testProcessIfStoreExistsAndIsNotDirectAccessToFrontName(): void { - $this->validatorConfigMock->expects($this->atLeastOnce())->method('getValue')->willReturn(true); - - $this->storeRepositoryMock->expects( - $this->any() - )->method( - 'getActiveStoreByCode' - ); - $this->requestMock->expects( - $this->atLeastOnce() - )->method( - 'isDirectAccessFrontendName' - )->with( - 'storeCode' - )->willReturn(true); - $this->requestMock->expects($this->once())->method('setActionName')->with('noroute'); - $this->assertEquals($this->pathInfo, $this->model->process($this->requestMock, $this->pathInfo)); + $this->storePathInfoValidatorMock->expects($this->once()) + ->method('getValidStoreCode') + ->willReturn($this->storeCode); + $this->requestMock->expects($this->atLeastOnce()) + ->method('isDirectAccessFrontendName') + ->with($this->storeCode) + ->willReturn(false); + + $pathInfo = $this->model->process($this->requestMock, $this->pathInfo); + $this->assertEquals('/node_one/', $pathInfo); } - public function testProcessIfStoreIsEmpty() + public function testProcessIfStoreExistsAndDirectAccessToFrontName(): void { - $this->validatorConfigMock->expects($this->any())->method('getValue')->willReturn(true); - - $path = '/0/node_one/'; - $this->storeRepositoryMock->expects( - $this->never() - )->method( - 'getActiveStoreByCode' - ); - $this->requestMock->expects( - $this->never() - )->method( - 'isDirectAccessFrontendName' - ); - $this->requestMock->expects($this->never())->method('setActionName'); - $this->assertEquals($path, $this->model->process($this->requestMock, $path)); - } - - public function testProcessIfStoreCodeIsNotExist() - { - $this->validatorConfigMock->expects($this->atLeastOnce())->method('getValue')->willReturn(true); - - $this->storeRepositoryMock->expects($this->once())->method('getActiveStoreByCode')->with('storeCode') - ->willThrowException(new NoSuchEntityException()); - $this->requestMock->expects($this->never())->method('isDirectAccessFrontendName'); - - $this->assertEquals($this->pathInfo, $this->model->process($this->requestMock, $this->pathInfo)); - } - - public function testProcessIfStoreUrlNotEnabled() - { - $this->validatorConfigMock->expects($this->at(0))->method('getValue')->willReturn(true); - - $this->validatorConfigMock->expects($this->at(1))->method('getValue')->willReturn(true); - - $this->validatorConfigMock->expects($this->at(2))->method('getValue')->willReturn(false); - - $this->storeRepositoryMock->expects($this->once())->method('getActiveStoreByCode')->willReturn(1); - - $this->assertEquals($this->pathInfo, $this->model->process($this->requestMock, $this->pathInfo)); + $this->storePathInfoValidatorMock->expects($this->once()) + ->method('getValidStoreCode') + ->willReturn($this->storeCode); + $this->requestMock->expects($this->atLeastOnce()) + ->method('isDirectAccessFrontendName') + ->with($this->storeCode) + ->willReturn(true); + $this->requestMock->expects($this->once()) + ->method('setActionName') + ->with('noroute'); + + $pathInfo = $this->model->process($this->requestMock, $this->pathInfo); + $this->assertEquals($this->pathInfo, $pathInfo); } } diff --git a/app/code/Magento/Store/Test/Unit/App/Request/StorePathInfoValidatorTest.php b/app/code/Magento/Store/Test/Unit/App/Request/StorePathInfoValidatorTest.php new file mode 100644 index 0000000000000..5c2b1fb2f6f38 --- /dev/null +++ b/app/code/Magento/Store/Test/Unit/App/Request/StorePathInfoValidatorTest.php @@ -0,0 +1,196 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Test\Unit\App\Request; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Request\Http; +use Magento\Framework\App\Request\PathInfo; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Store\Api\StoreRepositoryInterface; +use Magento\Store\App\Request\StorePathInfoValidator; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreIsInactiveException; +use Magento\Store\Model\Validation\StoreCodeValidator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class StorePathInfoValidatorTest extends TestCase +{ + /** + * @var ScopeConfigInterface|MockObject + */ + private $configMock; + + /** + * @var StoreRepositoryInterface|MockObject + */ + private $storeRepositoryMock; + + /** + * @var PathInfo|MockObject + */ + private $pathInfoMock; + + /** + * @var StoreCodeValidator|MockObject + */ + private $storeCodeValidatorMock; + + /** + * @var Http|MockObject + */ + private $requestMock; + + /** + * @var StorePathInfoValidator + */ + private $storePathInfoValidator; + + protected function setUp(): void + { + $this->configMock = $this->createMock(ScopeConfigInterface::class); + $this->storeRepositoryMock = $this->createMock(StoreRepositoryInterface::class); + $this->pathInfoMock = $this->createMock(PathInfo::class); + $this->storeCodeValidatorMock = $this->createMock(StoreCodeValidator::class); + $this->storePathInfoValidator = new StorePathInfoValidator( + $this->configMock, + $this->storeRepositoryMock, + $this->pathInfoMock, + $this->storeCodeValidatorMock + ); + + $this->requestMock = $this->createMock(Http::class); + $this->requestMock->method('getRequestUri') + ->willReturn('/path/'); + $this->requestMock->method('getBaseUrl') + ->willReturn('example.com'); + } + + public function testGetValidStoreCodeWithoutStoreInUrl(): void + { + $this->pathInfoMock->method('getPathInfo') + ->willReturn('/a/b/'); + $this->storeCodeValidatorMock->method('isValid') + ->willReturn(true); + + $this->configMock->expects($this->once()) + ->method('getValue') + ->with(Store::XML_PATH_STORE_IN_URL) + ->willReturn(false); + $this->storeRepositoryMock->expects($this->never()) + ->method('getActiveStoreByCode'); + + $result = $this->storePathInfoValidator->getValidStoreCode($this->requestMock, '/b/c/'); + $this->assertNull($result); + } + + public function testGetValidStoreCodeWithoutPathInfo(): void + { + $storeCode = 'store1'; + + $this->configMock->expects($this->once()) + ->method('getValue') + ->with(Store::XML_PATH_STORE_IN_URL) + ->willReturn(true); + $this->pathInfoMock->expects($this->once()) + ->method('getPathInfo') + ->willReturn('/' . $storeCode . '/path1/'); + $this->storeCodeValidatorMock->expects($this->once()) + ->method('isValid') + ->with($storeCode) + ->willReturn(true); + $store = $this->createMock(Store::class); + $this->storeRepositoryMock->expects($this->once()) + ->method('getActiveStoreByCode') + ->with($storeCode) + ->willReturn($store); + + $result = $this->storePathInfoValidator->getValidStoreCode($this->requestMock, ''); + $this->assertEquals($storeCode, $result); + } + + public function testGetValidStoreCodeWithEmptyPathInfo(): void + { + $this->configMock->expects($this->once()) + ->method('getValue') + ->with(Store::XML_PATH_STORE_IN_URL) + ->willReturn(true); + $this->pathInfoMock->expects($this->once()) + ->method('getPathInfo') + ->willReturn(''); + $this->storeCodeValidatorMock->method('isValid') + ->willReturn(true); + $this->storeRepositoryMock->expects($this->never()) + ->method('getActiveStoreByCode'); + + $result = $this->storePathInfoValidator->getValidStoreCode($this->requestMock, ''); + $this->assertNull($result); + } + + /** + * @dataProvider getValidStoreCodeExceptionDataProvider + * @param \Throwable $exception + */ + public function testGetValidStoreCodeThrowsException(\Throwable $exception): void + { + $this->configMock->method('getValue') + ->with(Store::XML_PATH_STORE_IN_URL) + ->willReturn(true); + $this->storeCodeValidatorMock->method('isValid') + ->willReturn(true); + + $this->storeRepositoryMock->expects($this->once()) + ->method('getActiveStoreByCode') + ->willThrowException($exception); + + $result = $this->storePathInfoValidator->getValidStoreCode($this->requestMock, '/store/'); + $this->assertNull($result); + } + + public function getValidStoreCodeExceptionDataProvider(): array + { + return [ + [new NoSuchEntityException()], + [new StoreIsInactiveException()], + ]; + } + + /** + * @dataProvider getValidStoreCodeDataProvider + * @param string $pathInfo + * @param bool $isStoreCodeValid + * @param string|null $expectedResult + */ + public function testGetValidStoreCode(string $pathInfo, bool $isStoreCodeValid, ?string $expectedResult): void + { + $this->configMock->method('getValue') + ->with(Store::XML_PATH_STORE_IN_URL) + ->willReturn(true); + $this->pathInfoMock->method('getPathInfo') + ->willReturn('/store2/path2/'); + $this->storeCodeValidatorMock->method('isValid') + ->willReturn($isStoreCodeValid); + $store = $this->createMock(Store::class); + $this->storeRepositoryMock->method('getActiveStoreByCode') + ->willReturn($store); + + $result = $this->storePathInfoValidator->getValidStoreCode($this->requestMock, $pathInfo); + $this->assertEquals($expectedResult, $result); + } + + public function getValidStoreCodeDataProvider(): array + { + return [ + ['store1', true, 'store1'], + ['/store1/path1/', true, 'store1'], + ['/', true, null], + ['admin', true, null], + ['1', false, null], + ]; + } +} diff --git a/app/code/Magento/Store/Test/Unit/Model/StoreSwitcher/HashProcessorTest.php b/app/code/Magento/Store/Test/Unit/Model/StoreSwitcher/HashProcessorTest.php index 89dc1d1c99ebd..c6bd515eaa3d7 100644 --- a/app/code/Magento/Store/Test/Unit/Model/StoreSwitcher/HashProcessorTest.php +++ b/app/code/Magento/Store/Test/Unit/Model/StoreSwitcher/HashProcessorTest.php @@ -128,12 +128,22 @@ function ($arg) { $this->postprocessor->expects($this->once()) ->method('process') ->with($this->isInstanceOf(ContextInterface::class), ['customer_id' => 1]); + $this->messageManager->expects($this->never()) + ->method('addErrorMessage'); $this->assertEquals($redirectUrl, $this->model->switch($this->store1, $this->store2, $redirectUrl)); } public function testShouldNotProcessIfDataValidationFailed(): void { $redirectUrl = '/category-1/category-1.1.html'; + $this->request->method('getParam') + ->willReturnMap( + [ + ['time_stamp', null, time() - 1], + ['data', null, '{"customer_id":1}'], + ['signature', null, 'randomstring'], + ] + ); $this->dataValidator->method('validate') ->willReturn(false); $this->postprocessor->expects($this->never()) @@ -148,6 +158,14 @@ public function testShouldNotProcessIfDataValidationFailed(): void public function testShouldNotProcessIfDataUnserializationFailed(): void { $redirectUrl = '/category-1/category-1.1.html'; + $this->request->method('getParam') + ->willReturnMap( + [ + ['time_stamp', null, time() - 1], + ['data', null, '{"customer_id":1}'], + ['signature', null, 'randomstring'], + ] + ); $this->dataValidator->method('validate') ->willReturn(true); $this->dataSerializer->method('unserialize') @@ -160,4 +178,16 @@ public function testShouldNotProcessIfDataUnserializationFailed(): void $this->assertEquals($redirectUrl, $this->model->switch($this->store1, $this->store2, $redirectUrl)); } + + public function testShouldNotProcessIfDataIsNotPresentInTheRequest(): void + { + $redirectUrl = '/category-1/category-1.1.html'; + $this->dataValidator->expects($this->never()) + ->method('validate'); + $this->postprocessor->expects($this->never()) + ->method('process'); + $this->messageManager->expects($this->never()) + ->method('addErrorMessage'); + $this->assertEquals($redirectUrl, $this->model->switch($this->store1, $this->store2, $redirectUrl)); + } } diff --git a/app/code/Magento/Store/Test/Unit/Model/Validation/StoreCodeValidatorTest.php b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreCodeValidatorTest.php new file mode 100644 index 0000000000000..7dbb3e3227bfb --- /dev/null +++ b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreCodeValidatorTest.php @@ -0,0 +1,82 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Test\Unit\Model\Validation; + +use Magento\Framework\Validator\Regex; +use Magento\Framework\Validator\RegexFactory; +use Magento\Store\Model\Validation\StoreCodeValidator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class StoreCodeValidatorTest extends TestCase +{ + /** + * @var RegexFactory|MockObject + */ + private $regexValidatorFactoryMock; + + /** + * @var Regex|MockObject + */ + private $regexValidatorMock; + + /** + * @var StoreCodeValidator + */ + private $model; + + protected function setUp(): void + { + $this->regexValidatorFactoryMock = $this->getMockBuilder(RegexFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->regexValidatorMock = $this->createMock(Regex::class); + $this->regexValidatorFactoryMock->method('create') + ->willReturn($this->regexValidatorMock); + + $this->model = new StoreCodeValidator($this->regexValidatorFactoryMock); + } + + /** + * @dataProvider isValidDataProvider + * @param string $value + * @param bool $isValid + * @param array $messages + */ + public function testIsValid(string $value, bool $isValid, array $messages): void + { + $this->regexValidatorMock->expects($this->once()) + ->method('isValid') + ->with($value) + ->willReturn($isValid); + $this->regexValidatorMock->expects($this->once()) + ->method('getMessages') + ->willReturn($messages); + + $result = $this->model->isValid($value); + $this->assertEquals($isValid, $result); + $this->assertEquals($messages, $this->model->getMessages()); + } + + public function isValidDataProvider(): array + { + return [ + 'true' => [ + 'abc', + true, + [] + ], + 'false' => [ + '5', + false, + ['code is not valid'] + ], + ]; + } +} diff --git a/app/code/Magento/Store/Test/Unit/Model/Validation/StoreNameValidatorTest.php b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreNameValidatorTest.php new file mode 100644 index 0000000000000..42caa124b13bb --- /dev/null +++ b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreNameValidatorTest.php @@ -0,0 +1,82 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Test\Unit\Model\Validation; + +use Magento\Framework\Validator\NotEmpty; +use Magento\Framework\Validator\NotEmptyFactory; +use Magento\Store\Model\Validation\StoreNameValidator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class StoreNameValidatorTest extends TestCase +{ + /** + * @var NotEmptyFactory|MockObject + */ + private $notEmptyValidatorFactoryMock; + + /** + * @var NotEmpty|MockObject + */ + private $notEmptyValidatorMock; + + /** + * @var StoreNameValidator + */ + private $model; + + protected function setUp(): void + { + $this->notEmptyValidatorFactoryMock = $this->getMockBuilder(NotEmptyFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->notEmptyValidatorMock = $this->createMock(NotEmpty::class); + $this->notEmptyValidatorFactoryMock->method('create') + ->willReturn($this->notEmptyValidatorMock); + + $this->model = new StoreNameValidator($this->notEmptyValidatorFactoryMock); + } + + /** + * @dataProvider isValidDataProvider + * @param string $value + * @param bool $isValid + * @param array $messages + */ + public function testIsValid(string $value, bool $isValid, array $messages): void + { + $this->notEmptyValidatorMock->expects($this->once()) + ->method('isValid') + ->with($value) + ->willReturn($isValid); + $this->notEmptyValidatorMock->expects($this->once()) + ->method('getMessages') + ->willReturn($messages); + + $result = $this->model->isValid($value); + $this->assertEquals($isValid, $result); + $this->assertEquals($messages, $this->model->getMessages()); + } + + public function isValidDataProvider(): array + { + return [ + 'true' => [ + 'Name1', + true, + [] + ], + 'false' => [ + '', + false, + ['name is not valid'] + ], + ]; + } +} diff --git a/app/code/Magento/Store/Test/Unit/Model/Validation/StoreValidatorTest.php b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreValidatorTest.php new file mode 100644 index 0000000000000..7b089939c1580 --- /dev/null +++ b/app/code/Magento/Store/Test/Unit/Model/Validation/StoreValidatorTest.php @@ -0,0 +1,100 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Test\Unit\Model\Validation; + +use Magento\Framework\Validator\DataObject; +use Magento\Framework\Validator\DataObjectFactory; +use Magento\Framework\Validator\ValidatorInterface; +use Magento\Store\Model\Validation\StoreValidator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class StoreValidatorTest extends TestCase +{ + /** + * @var DataObjectFactory|MockObject + */ + private $dataObjectValidatorFactoryMock; + + /** + * @var DataObject|MockObject + */ + private $dataObjectValidatorMock; + + /** + * @var array + */ + private $ruleMocks; + + /** + * @var StoreValidator + */ + private $model; + + protected function setUp(): void + { + $this->dataObjectValidatorFactoryMock = $this->getMockBuilder(DataObjectFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->dataObjectValidatorMock = $this->createMock(DataObject::class); + $this->dataObjectValidatorFactoryMock->method('create') + ->willReturn($this->dataObjectValidatorMock); + $ruleMock1 = $this->createMock(ValidatorInterface::class); + $ruleMock2 = $this->createMock(ValidatorInterface::class); + $this->ruleMocks = [ + [$ruleMock1, 'field1'], + [$ruleMock2, 'field2'], + ]; + + $this->model = new StoreValidator( + $this->dataObjectValidatorFactoryMock, + array_combine(array_column($this->ruleMocks, 1), array_column($this->ruleMocks, 0)) + ); + } + + /** + * @dataProvider isValidDataProvider + * @param \Magento\Framework\DataObject $value + * @param bool $isValid + * @param array $messages + */ + public function testIsValid(\Magento\Framework\DataObject $value, bool $isValid, array $messages): void + { + $this->dataObjectValidatorMock->expects($this->exactly(count($this->ruleMocks))) + ->method('addRule') + ->withConsecutive(...$this->ruleMocks); + $this->dataObjectValidatorMock->expects($this->once()) + ->method('isValid') + ->with($value) + ->willReturn($isValid); + $this->dataObjectValidatorMock->expects($this->once()) + ->method('getMessages') + ->willReturn($messages); + + $result = $this->model->isValid($value); + $this->assertEquals($isValid, $result); + $this->assertEquals($messages, $this->model->getMessages()); + } + + public function isValidDataProvider(): array + { + return [ + 'true' => [ + new \Magento\Framework\DataObject(['field1' => 'value1', 'field2' => 'value2']), + true, + [] + ], + 'false' => [ + new \Magento\Framework\DataObject(), + false, + ['store is not valid'] + ], + ]; + } +} diff --git a/app/code/Magento/Store/etc/config.xml b/app/code/Magento/Store/etc/config.xml index d4dddbb6a7dfa..2872b82566454 100644 --- a/app/code/Magento/Store/etc/config.xml +++ b/app/code/Magento/Store/etc/config.xml @@ -134,6 +134,7 @@ <pht>pht</pht> <svg>svg</svg> <xml>xml</xml> + <xhtml>xhtml</xhtml> </protected_extensions> <public_files_valid_paths> <protected> diff --git a/app/code/Magento/Store/etc/di.xml b/app/code/Magento/Store/etc/di.xml index ccfec562ba103..a51cb300cd80d 100644 --- a/app/code/Magento/Store/etc/di.xml +++ b/app/code/Magento/Store/etc/di.xml @@ -70,8 +70,6 @@ <preference for="Magento\Framework\App\Router\PathConfigInterface" type="Magento\Store\Model\PathConfig" /> <type name="Magento\Framework\App\ActionInterface"> <plugin name="storeCheck" type="Magento\Store\App\Action\Plugin\StoreCheck"/> - <plugin name="eventDispatch" type="Magento\Framework\App\Action\Plugin\EventDispatchPlugin"/> - <plugin name="actionFlagNoDispatch" type="Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin"/> </type> <type name="Magento\Framework\Url\SecurityInfo"> <plugin name="storeUrlSecurityInfo" type="Magento\Store\Url\Plugin\SecurityInfo"/> @@ -446,4 +444,12 @@ </argument> </arguments> </type> + <type name="Magento\Store\Model\Validation\StoreValidator"> + <arguments> + <argument name="rules" xsi:type="array"> + <item name="name" xsi:type="object">Magento\Store\Model\Validation\StoreNameValidator</item> + <item name="code" xsi:type="object">Magento\Store\Model\Validation\StoreCodeValidator</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php b/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php index 8011960915726..91726d2c62600 100644 --- a/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php +++ b/app/code/Magento/StoreGraphQl/Controller/HttpRequestValidator/StoreValidator.php @@ -45,7 +45,7 @@ public function validate(HttpRequestInterface $request): void $storeCode = trim($headerValue); if (!$this->isStoreActive($storeCode)) { $this->storeManager->setCurrentStore(null); - throw new GraphQlInputException(__('Requested store is not found ({$storeCode})')); + throw new GraphQlInputException(__('Requested store is not found (%1)', [$storeCode])); } } } diff --git a/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php b/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php index 8378b3bc7a4be..f732dea228eeb 100644 --- a/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php +++ b/app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php @@ -65,8 +65,19 @@ public function __construct( */ public function getStoreConfigData(StoreInterface $store): array { - $defaultStoreConfig = $this->storeConfigManager->getStoreConfigs([$store->getCode()]); - return $this->prepareStoreConfigData(current($defaultStoreConfig), $store->getName()); + $defaultWebsiteStore = $this->storeWebsiteRelation->getWebsiteStores( + (int) $store->getWebsiteId(), + true, + (int) $store->getStoreGroupId(), + (int) $store->getStoreId() + ); + if (empty($defaultWebsiteStore)) { + return []; + } + + $storeConfigs = $this->storeConfigManager->getStoreConfigs([$store->getCode()]); + + return $this->prepareStoreConfigData(current($storeConfigs), current($defaultWebsiteStore)); } /** @@ -86,7 +97,7 @@ public function getAvailableStoreConfig(int $websiteId, int $storeGroupId = null foreach ($storeConfigs as $storeConfig) { $key = array_search($storeConfig->getCode(), array_column($websiteStores, 'code'), true); - $storesConfigData[] = $this->prepareStoreConfigData($storeConfig, $websiteStores[$key]['name']); + $storesConfigData[] = $this->prepareStoreConfigData($storeConfig, $websiteStores[$key]); } return $storesConfigData; @@ -96,15 +107,25 @@ public function getAvailableStoreConfig(int $websiteId, int $storeGroupId = null * Prepare store config data * * @param StoreConfigInterface $storeConfig - * @param string $storeName + * @param array $storeData * @return array */ - private function prepareStoreConfigData(StoreConfigInterface $storeConfig, string $storeName): array + private function prepareStoreConfigData(StoreConfigInterface $storeConfig, array $storeData): array { return array_merge([ 'id' => $storeConfig->getId(), 'code' => $storeConfig->getCode(), + 'store_code' => $storeConfig->getCode(), + 'store_name' => $storeData['name'] ?? null, + 'store_sort_order' => $storeData['sort_order'] ?? null, + 'is_default_store' => $storeData['default_store_id'] == $storeConfig->getId() ?? null, + 'store_group_code' => $storeData['store_group_code'] ?? null, + 'store_group_name' => $storeData['store_group_name'] ?? null, + 'is_default_store_group' => $storeData['default_group_id'] == $storeData['group_id'] ?? null, + 'store_group_default_store_code' => $storeData['store_group_default_store_code'] ?? null, 'website_id' => $storeConfig->getWebsiteId(), + 'website_code' => $storeData['website_code'] ?? null, + 'website_name' => $storeData['website_name'] ?? null, 'locale' => $storeConfig->getLocale(), 'base_currency_code' => $storeConfig->getBaseCurrencyCode(), 'default_display_currency_code' => $storeConfig->getDefaultDisplayCurrencyCode(), @@ -118,7 +139,6 @@ private function prepareStoreConfigData(StoreConfigInterface $storeConfig, strin 'secure_base_link_url' => $storeConfig->getSecureBaseLinkUrl(), 'secure_base_static_url' => $storeConfig->getSecureBaseStaticUrl(), 'secure_base_media_url' => $storeConfig->getSecureBaseMediaUrl(), - 'store_name' => $storeName, ], $this->getExtendedConfigData((int)$storeConfig->getId())); } diff --git a/app/code/Magento/StoreGraphQl/Test/Unit/StoreValidatorTest.php b/app/code/Magento/StoreGraphQl/Test/Unit/StoreValidatorTest.php index 60a9c7f671324..a9dd484791f6c 100644 --- a/app/code/Magento/StoreGraphQl/Test/Unit/StoreValidatorTest.php +++ b/app/code/Magento/StoreGraphQl/Test/Unit/StoreValidatorTest.php @@ -95,7 +95,7 @@ public function testValidate(array $config): void ->method('setCurrentStore') ->with(null) ->willReturnSelf(); - $this->expectExceptionMessage('Requested store is not found ({$storeCode})'); + $this->expectExceptionMessage('Requested store is not found (sv1)'); $this->storeValidator->validate($this->requestMock); } diff --git a/app/code/Magento/StoreGraphQl/etc/schema.graphqls b/app/code/Magento/StoreGraphQl/etc/schema.graphqls index 1106987cc72c1..9efdb5a210403 100644 --- a/app/code/Magento/StoreGraphQl/etc/schema.graphqls +++ b/app/code/Magento/StoreGraphQl/etc/schema.graphqls @@ -17,9 +17,18 @@ type Website @doc(description: "Website is deprecated because it is should not b } type StoreConfig @doc(description: "The type contains information about a store config") { - id : Int @doc(description: "The ID number assigned to the store") - code : String @doc(description: "A code assigned to the store to identify it") - website_id : Int @doc(description: "The ID number assigned to the website store belongs") + id : Int @deprecated(reason: "Use `store_code` instead.") @doc(description: "The ID number assigned to the store") + code : String @deprecated(reason: "Use `store_code` instead.") @doc(description: "A code assigned to the store to identify it") + store_code: ID @doc(description: "The unique ID of the store view. In the Admin, this is called the Store View Code. When making a GraphQL call, assign this value to the `Store` header to provide the scope") + store_name : String @doc(description: "The label assigned to the store view") + store_sort_order : Int @doc(description: "The store view sort order") + is_default_store : Boolean @doc(description: "Indicates whether the store view has been designated as the default within the store group") + store_group_code : ID @doc(description: "The unique ID assigned to the store group. In the Admin, this is called the Store Name") + store_group_name : String @doc(description: "The label assigned to the store group") + is_default_store_group : Boolean @doc(description: "Indicates whether the store group has been designated as the default within the website") + website_id : Int @deprecated(reason: "The field should not be used on the storefront") @doc(description: "The ID number assigned to the website store") + website_code : ID @doc(description: "The unique ID for the website") + website_name : String @doc(description: "The label assigned to the website") locale : String @doc(description: "Store locale") base_currency_code : String @doc(description: "Base currency code") default_display_currency_code : String @doc(description: "Default display currency code") @@ -33,6 +42,5 @@ type StoreConfig @doc(description: "The type contains information about a store secure_base_link_url : String @doc(description: "Secure base link URL for the store") secure_base_static_url : String @doc(description: "Secure base static URL for the store") secure_base_media_url : String @doc(description: "Secure base media URL for the store") - store_name : String @doc(description: "Name of the store") use_store_in_url: Boolean @doc(description: "The configuration determines if the store code should be used in the URL") } diff --git a/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontApplyAdminTokenOnSwaggerPageActionGroup.xml b/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontApplyAdminTokenOnSwaggerPageActionGroup.xml new file mode 100644 index 0000000000000..2aa80e3455d2c --- /dev/null +++ b/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontApplyAdminTokenOnSwaggerPageActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontApplyAdminTokenOnSwaggerPageActionGroup"> + <annotations> + <description>Apply Admin Token on Swagger Page</description> + </annotations> + <arguments> + <argument name="token" type="string" defaultValue=""/> + </arguments> + + <clearField selector="{{SwaggerHeaderSection.apiKeyInput}}" stepKey="clearApiTokenField"/> + <fillField selector="{{SwaggerHeaderSection.apiKeyInput}}" userInput="{{token}}" stepKey="fillApiTokenInput"/> + <click selector="{{SwaggerHeaderSection.applyButton}}" stepKey="clickApplyButton" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontGoToSwaggerPageActionGroup.xml b/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontGoToSwaggerPageActionGroup.xml new file mode 100644 index 0000000000000..de68508ab70bf --- /dev/null +++ b/app/code/Magento/Swagger/Test/Mftf/ActionGroup/StorefrontGoToSwaggerPageActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontGoToSwaggerPageActionGroup"> + <annotations> + <description>Go to the swagger page</description> + </annotations> + + <amOnPage url="{{StorefrontSwaggerPage.url}}" stepKey="goToSwaggerPage"/> + <waitForPageLoad stepKey="waitForSwaggerPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swagger/Test/Mftf/Page/SwaggerPage.xml b/app/code/Magento/Swagger/Test/Mftf/Page/SwaggerPage.xml new file mode 100644 index 0000000000000..23b6f30b3aacc --- /dev/null +++ b/app/code/Magento/Swagger/Test/Mftf/Page/SwaggerPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="StorefrontSwaggerPage" url="/swagger" area="storefront" module="Swagger"> + <section name="SwaggerHeaderSection"/> + <section name="SwaggerApiListSection"/> + </page> +</pages> diff --git a/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerApiListSection.xml b/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerApiListSection.xml new file mode 100644 index 0000000000000..241955446a836 --- /dev/null +++ b/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerApiListSection.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="SwaggerApiListSection"> + <element name="swaggerActionTitle" type="text" selector="#operations-tag-{{operationName}}" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerHeaderSection.xml b/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerHeaderSection.xml new file mode 100644 index 0000000000000..cf4c78451648d --- /dev/null +++ b/app/code/Magento/Swagger/Test/Mftf/Section/SwaggerHeaderSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="SwaggerHeaderSection"> + <element name="apiKeyInput" type="input" selector="#input_apiKey"/> + <element name="applyButton" type="button" selector="#explore" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/swagger-ui.css b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/swagger-ui.css old mode 100644 new mode 100755 index 971751da7027e..c61e5a85f7acf --- a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/swagger-ui.css +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/css/swagger-ui.css @@ -1,2 +1,4 @@ -.swagger-ui{font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .wrapper{width:100%;max-width:1460px;margin:0 auto;padding:0 20px;-webkit-box-sizing:border-box;box-sizing:border-box}.swagger-ui .opblock-tag-section{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.swagger-ui .opblock-tag{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:10px 20px 10px 10px;cursor:pointer;-webkit-transition:all .2s;transition:all .2s;border-bottom:1px solid rgba(59,65,81,.3)}.swagger-ui .opblock-tag:hover{background:rgba(0,0,0,.02)}.swagger-ui .opblock-tag{font-size:24px;margin:0 0 5px;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .opblock-tag.no-desc span{-webkit-box-flex:1;-ms-flex:1;flex:1}.swagger-ui .opblock-tag svg{-webkit-transition:all .4s;transition:all .4s}.swagger-ui .opblock-tag small{font-size:14px;font-weight:400;-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 10px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .parameter__type{font-size:12px;padding:5px 0;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .view-line-link{position:relative;top:3px;width:20px;margin:0 5px;cursor:pointer;-webkit-transition:all .5s;transition:all .5s}.swagger-ui .opblock{margin:0 0 15px;border:1px solid #000;border-radius:4px;-webkit-box-shadow:0 0 3px rgba(0,0,0,.19);box-shadow:0 0 3px rgba(0,0,0,.19)}.swagger-ui .opblock .tab-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1}.swagger-ui .opblock .tab-header .tab-item{padding:0 40px;cursor:pointer}.swagger-ui .opblock .tab-header .tab-item:first-of-type{padding:0 40px 0 0}.swagger-ui .opblock .tab-header .tab-item.active h4 span{position:relative}.swagger-ui .opblock .tab-header .tab-item.active h4 span:after{position:absolute;bottom:-15px;left:50%;width:120%;height:4px;content:"";-webkit-transform:translateX(-50%);transform:translateX(-50%);background:gray}.swagger-ui .opblock.is-open .opblock-summary{border-bottom:1px solid #000}.swagger-ui .opblock .opblock-section-header{padding:8px 20px;min-height:50px;background:hsla(0,0%,100%,.8);-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1)}.swagger-ui .opblock .opblock-section-header,.swagger-ui .opblock .opblock-section-header label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swagger-ui .opblock .opblock-section-header label{font-size:12px;font-weight:700;margin:0;margin-left:auto;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-section-header label span{padding:0 10px 0 0}.swagger-ui .opblock .opblock-section-header h4{font-size:14px;-webkit-box-flex:1;-ms-flex:1;flex:1;margin:0;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-summary-method{font-size:14px;font-weight:700;min-width:80px;padding:6px 15px;text-align:center;border-radius:3px;background:#000;text-shadow:0 1px 0 rgba(0,0,0,.1);font-family:Titillium Web,sans-serif;color:#fff}.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{font-size:16px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 3 auto;flex:0 3 auto;-webkit-box-align:center;-ms-flex-align:center;align-items:center;word-break:break-all;padding:0 10px;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}@media (max-width:768px){.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{font-size:12px}}.swagger-ui .opblock .opblock-summary-operation-id .view-line-link,.swagger-ui .opblock .opblock-summary-path .view-line-link,.swagger-ui .opblock .opblock-summary-path__deprecated .view-line-link{position:relative;top:2px;width:0;margin:0;cursor:pointer;-webkit-transition:all .5s;transition:all .5s}.swagger-ui .opblock .opblock-summary-operation-id:hover .view-line-link,.swagger-ui .opblock .opblock-summary-path:hover .view-line-link,.swagger-ui .opblock .opblock-summary-path__deprecated:hover .view-line-link{width:18px;margin:0 5px}.swagger-ui .opblock .opblock-summary-path__deprecated{text-decoration:line-through}.swagger-ui .opblock .opblock-summary-operation-id{font-size:14px}.swagger-ui .opblock .opblock-summary-description{font-size:13px;-webkit-box-flex:1;-ms-flex:1;flex:1;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-summary{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:5px;cursor:pointer}.swagger-ui .opblock.opblock-post{border-color:#49cc90;background:rgba(73,204,144,.1)}.swagger-ui .opblock.opblock-post .opblock-summary-method{background:#49cc90}.swagger-ui .opblock.opblock-post .opblock-summary{border-color:#49cc90}.swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span:after{background:#49cc90}.swagger-ui .opblock.opblock-put{border-color:#fca130;background:rgba(252,161,48,.1)}.swagger-ui .opblock.opblock-put .opblock-summary-method{background:#fca130}.swagger-ui .opblock.opblock-put .opblock-summary{border-color:#fca130}.swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span:after{background:#fca130}.swagger-ui .opblock.opblock-delete{border-color:#f93e3e;background:rgba(249,62,62,.1)}.swagger-ui .opblock.opblock-delete .opblock-summary-method{background:#f93e3e}.swagger-ui .opblock.opblock-delete .opblock-summary{border-color:#f93e3e}.swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span:after{background:#f93e3e}.swagger-ui .opblock.opblock-get{border-color:#61affe;background:rgba(97,175,254,.1)}.swagger-ui .opblock.opblock-get .opblock-summary-method{background:#61affe}.swagger-ui .opblock.opblock-get .opblock-summary{border-color:#61affe}.swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span:after{background:#61affe}.swagger-ui .opblock.opblock-patch{border-color:#50e3c2;background:rgba(80,227,194,.1)}.swagger-ui .opblock.opblock-patch .opblock-summary-method{background:#50e3c2}.swagger-ui .opblock.opblock-patch .opblock-summary{border-color:#50e3c2}.swagger-ui .opblock.opblock-patch .tab-header .tab-item.active h4 span:after{background:#50e3c2}.swagger-ui .opblock.opblock-head{border-color:#9012fe;background:rgba(144,18,254,.1)}.swagger-ui .opblock.opblock-head .opblock-summary-method{background:#9012fe}.swagger-ui .opblock.opblock-head .opblock-summary{border-color:#9012fe}.swagger-ui .opblock.opblock-head .tab-header .tab-item.active h4 span:after{background:#9012fe}.swagger-ui .opblock.opblock-options{border-color:#0d5aa7;background:rgba(13,90,167,.1)}.swagger-ui .opblock.opblock-options .opblock-summary-method{background:#0d5aa7}.swagger-ui .opblock.opblock-options .opblock-summary{border-color:#0d5aa7}.swagger-ui .opblock.opblock-options .tab-header .tab-item.active h4 span:after{background:#0d5aa7}.swagger-ui .opblock.opblock-deprecated{opacity:.6;border-color:#ebebeb;background:hsla(0,0%,92%,.1)}.swagger-ui .opblock.opblock-deprecated .opblock-summary-method{background:#ebebeb}.swagger-ui .opblock.opblock-deprecated .opblock-summary{border-color:#ebebeb}.swagger-ui .opblock.opblock-deprecated .tab-header .tab-item.active h4 span:after{background:#ebebeb}.swagger-ui .opblock .opblock-schemes{padding:8px 20px}.swagger-ui .opblock .opblock-schemes .schemes-title{padding:0 10px 0 0}.swagger-ui .filter .operation-filter-input{width:100%;margin:20px 0;padding:10px;border:2px solid #d8dde7}.swagger-ui .tab{display:-webkit-box;display:-ms-flexbox;display:flex;margin:20px 0 10px;padding:0;list-style:none}.swagger-ui .tab li{font-size:12px;min-width:100px;min-width:90px;padding:0;cursor:pointer;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .tab li:first-of-type{position:relative;padding-left:0}.swagger-ui .tab li:first-of-type:after{position:absolute;top:0;right:6px;width:1px;height:100%;content:"";background:rgba(0,0,0,.2)}.swagger-ui .tab li.active{font-weight:700}.swagger-ui .opblock-description-wrapper,.swagger-ui .opblock-external-docs-wrapper,.swagger-ui .opblock-title_normal{font-size:12px;margin:0 0 5px;padding:15px 20px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .opblock-description-wrapper h4,.swagger-ui .opblock-external-docs-wrapper h4,.swagger-ui .opblock-title_normal h4{font-size:12px;margin:0 0 5px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .opblock-description-wrapper p,.swagger-ui .opblock-external-docs-wrapper p,.swagger-ui .opblock-title_normal p{font-size:14px;margin:0;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .opblock-external-docs-wrapper h4{padding-left:0}.swagger-ui .execute-wrapper{padding:20px;text-align:right}.swagger-ui .execute-wrapper .btn{width:100%;padding:8px 40px}.swagger-ui .body-param-options{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.swagger-ui .body-param-options .body-param-edit{padding:10px 0}.swagger-ui .body-param-options label{padding:8px 0}.swagger-ui .body-param-options label select{margin:3px 0 0}.swagger-ui .responses-inner{padding:20px}.swagger-ui .responses-inner h4,.swagger-ui .responses-inner h5{font-size:12px;margin:10px 0 5px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .response-col_status{font-size:14px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .response-col_status .response-undocumented{font-size:11px;font-family:Source Code Pro,monospace;font-weight:600;color:#909090}.swagger-ui .response-col_links{padding-left:2em;max-width:40em;font-size:14px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .response-col_links .response-undocumented{font-size:11px;font-family:Source Code Pro,monospace;font-weight:600;color:#909090}.swagger-ui .response-col_description__inner div.markdown,.swagger-ui .response-col_description__inner div.renderedMarkdown{font-size:12px;font-style:italic;display:block;margin:0;padding:10px;border-radius:4px;background:#41444e;font-family:Source Code Pro,monospace;font-weight:600;color:#fff}.swagger-ui .response-col_description__inner div.markdown p,.swagger-ui .response-col_description__inner div.renderedMarkdown p{margin:0;font-family:Source Code Pro,monospace;font-weight:600;color:#fff}.swagger-ui .response-col_description__inner div.markdown a,.swagger-ui .response-col_description__inner div.renderedMarkdown a{font-family:Source Code Pro,monospace;font-weight:600;color:#89bf04;text-decoration:underline}.swagger-ui .response-col_description__inner div.markdown a:hover,.swagger-ui .response-col_description__inner div.renderedMarkdown a:hover{color:#81b10c}.swagger-ui .response-col_description__inner div.markdown th,.swagger-ui .response-col_description__inner div.renderedMarkdown th{font-family:Source Code Pro,monospace;font-weight:600;color:#fff;border-bottom:1px solid #fff}.swagger-ui .opblock-body pre{font-size:12px;margin:0;padding:10px;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;border-radius:4px;background:#41444e;overflow-wrap:break-word;font-family:Source Code Pro,monospace;font-weight:600;color:#fff}.swagger-ui .opblock-body pre span{color:#fff!important}.swagger-ui .opblock-body pre .headerline{display:block}.swagger-ui .scheme-container{margin:0 0 20px;padding:30px 0;background:#fff;-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.15);box-shadow:0 1px 2px 0 rgba(0,0,0,.15)}.swagger-ui .scheme-container .schemes{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swagger-ui .scheme-container .schemes>label{font-size:12px;font-weight:700;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:-20px 15px 0 0;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .scheme-container .schemes>label select{min-width:130px;text-transform:uppercase}.swagger-ui .loading-container{padding:40px 0 60px;margin-top:1em;min-height:1px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.swagger-ui .loading-container .loading{position:relative}.swagger-ui .loading-container .loading:after{font-size:10px;font-weight:700;position:absolute;top:50%;left:50%;content:"loading";-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-transform:uppercase;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .loading-container .loading:before{position:absolute;top:50%;left:50%;display:block;width:60px;height:60px;margin:-30px;content:"";-webkit-animation:rotation 1s infinite linear,opacity .5s;animation:rotation 1s infinite linear,opacity .5s;opacity:1;border:2px solid rgba(85,85,85,.1);border-top-color:rgba(0,0,0,.6);border-radius:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden}@-webkit-keyframes rotation{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotation{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.swagger-ui .response-content-type{padding-top:1em}.swagger-ui .response-content-type.controls-accept-header select{border-color:green}.swagger-ui .response-content-type.controls-accept-header small{color:green;font-size:.7em}@-webkit-keyframes blinker{50%{opacity:0}}@keyframes blinker{50%{opacity:0}}.swagger-ui section h3{font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui a.nostyle{display:inline}.swagger-ui a.nostyle,.swagger-ui a.nostyle:visited{text-decoration:inherit;color:inherit;cursor:pointer}.swagger-ui .btn{font-size:14px;font-weight:700;padding:5px 23px;-webkit-transition:all .3s;transition:all .3s;border:2px solid gray;border-radius:4px;background:transparent;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1);font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .btn.btn-sm{font-size:12px;padding:4px 23px}.swagger-ui .btn[disabled]{cursor:not-allowed;opacity:.3}.swagger-ui .btn:hover{-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.swagger-ui .btn.cancel{border-color:#ff6060;background-color:transparent;font-family:Titillium Web,sans-serif;color:#ff6060}.swagger-ui .btn.authorize{line-height:1;display:inline;color:#49cc90;border-color:#49cc90;background-color:transparent}.swagger-ui .btn.authorize span{float:left;padding:4px 20px 0 0}.swagger-ui .btn.authorize svg{fill:#49cc90}.swagger-ui .btn.execute{background-color:#4990e2;color:#fff;border-color:#4990e2}.swagger-ui .btn-group{display:-webkit-box;display:-ms-flexbox;display:flex;padding:30px}.swagger-ui .btn-group .btn{-webkit-box-flex:1;-ms-flex:1;flex:1}.swagger-ui .btn-group .btn:first-child{border-radius:4px 0 0 4px}.swagger-ui .btn-group .btn:last-child{border-radius:0 4px 4px 0}.swagger-ui .authorization__btn{padding:0 10px;border:none;background:none}.swagger-ui .authorization__btn.locked{opacity:1}.swagger-ui .authorization__btn.unlocked{opacity:.4}.swagger-ui .expand-methods,.swagger-ui .expand-operation{border:none;background:none}.swagger-ui .expand-methods svg,.swagger-ui .expand-operation svg{width:20px;height:20px}.swagger-ui .expand-methods{padding:0 10px}.swagger-ui .expand-methods:hover svg{fill:#404040}.swagger-ui .expand-methods svg{-webkit-transition:all .3s;transition:all .3s;fill:#707070}.swagger-ui button{cursor:pointer;outline:none}.swagger-ui button.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui select{font-size:14px;font-weight:700;padding:5px 40px 5px 10px;border:2px solid #41444e;border-radius:4px;background:#f7f7f7 url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+ICAgIDxwYXRoIGQ9Ik0xMy40MTggNy44NTljLjI3MS0uMjY4LjcwOS0uMjY4Ljk3OCAwIC4yNy4yNjguMjcyLjcwMSAwIC45NjlsLTMuOTA4IDMuODNjLS4yNy4yNjgtLjcwNy4yNjgtLjk3OSAwbC0zLjkwOC0zLjgzYy0uMjctLjI2Ny0uMjctLjcwMSAwLS45NjkuMjcxLS4yNjguNzA5LS4yNjguOTc4IDBMMTAgMTFsMy40MTgtMy4xNDF6Ii8+PC9zdmc+) right 10px center no-repeat;background-size:20px;-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.25);box-shadow:0 1px 2px 0 rgba(0,0,0,.25);font-family:Titillium Web,sans-serif;color:#3b4151;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swagger-ui select[multiple]{margin:5px 0;padding:5px;background:#f7f7f7}.swagger-ui select.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui .opblock-body select{min-width:230px}@media (max-width:768px){.swagger-ui .opblock-body select{min-width:180px}}.swagger-ui label{font-size:12px;font-weight:700;margin:0 0 5px;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text]{min-width:100px;margin:5px 0;padding:8px 10px;border:1px solid #d9d9d9;border-radius:4px;background:#fff}@media (max-width:768px){.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text]{max-width:175px}}.swagger-ui input[type=email].invalid,.swagger-ui input[type=file].invalid,.swagger-ui input[type=password].invalid,.swagger-ui input[type=search].invalid,.swagger-ui input[type=text].invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-4px,0,0);transform:translate3d(-4px,0,0)}40%,60%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}}@keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-4px,0,0);transform:translate3d(-4px,0,0)}40%,60%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}}.swagger-ui textarea{font-size:12px;width:100%;min-height:280px;padding:10px;border:none;border-radius:4px;outline:none;background:hsla(0,0%,100%,.8);font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui textarea:focus{border:2px solid #61affe}.swagger-ui textarea.curl{font-size:12px;min-height:100px;margin:0;padding:10px;resize:none;border-radius:4px;background:#41444e;font-family:Source Code Pro,monospace;font-weight:600;color:#fff}.swagger-ui .checkbox{padding:5px 0 10px;-webkit-transition:opacity .5s;transition:opacity .5s;color:#303030}.swagger-ui .checkbox label{display:-webkit-box;display:-ms-flexbox;display:flex}.swagger-ui .checkbox p{font-weight:400!important;font-style:italic;margin:0!important;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .checkbox input[type=checkbox]{display:none}.swagger-ui .checkbox input[type=checkbox]+label>.item{position:relative;top:3px;display:inline-block;width:16px;height:16px;margin:0 8px 0 0;padding:5px;cursor:pointer;border-radius:1px;background:#e8e8e8;-webkit-box-shadow:0 0 0 2px #e8e8e8;box-shadow:0 0 0 2px #e8e8e8;-webkit-box-flex:0;-ms-flex:none;flex:none}.swagger-ui .checkbox input[type=checkbox]+label>.item:active{-webkit-transform:scale(.9);transform:scale(.9)}.swagger-ui .checkbox input[type=checkbox]:checked+label>.item{background:#e8e8e8 url("data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='8' viewBox='3 7 10 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2341474E' fill-rule='evenodd' d='M6.333 15L3 11.667l1.333-1.334 2 2L11.667 7 13 8.333z'/%3E%3C/svg%3E") 50% no-repeat}.swagger-ui .dialog-ux{position:fixed;z-index:9999;top:0;right:0;bottom:0;left:0}.swagger-ui .dialog-ux .backdrop-ux{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.8)}.swagger-ui .dialog-ux .modal-ux{position:absolute;z-index:9999;top:50%;left:50%;width:100%;min-width:300px;max-width:650px;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);border:1px solid #ebebeb;border-radius:4px;background:#fff;-webkit-box-shadow:0 10px 30px 0 rgba(0,0,0,.2);box-shadow:0 10px 30px 0 rgba(0,0,0,.2)}.swagger-ui .dialog-ux .modal-ux-content{overflow-y:auto;max-height:540px;padding:20px}.swagger-ui .dialog-ux .modal-ux-content p{font-size:12px;margin:0 0 5px;color:#41444e;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .dialog-ux .modal-ux-content h4{font-size:18px;font-weight:600;margin:15px 0 0;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .dialog-ux .modal-ux-header{display:-webkit-box;display:-ms-flexbox;display:flex;padding:12px 0;border-bottom:1px solid #ebebeb;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swagger-ui .dialog-ux .modal-ux-header .close-modal{padding:0 10px;border:none;background:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swagger-ui .dialog-ux .modal-ux-header h3{font-size:20px;font-weight:600;margin:0;padding:0 20px;-webkit-box-flex:1;-ms-flex:1;flex:1;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .model{font-size:12px;font-weight:300;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .model .deprecated span,.swagger-ui .model .deprecated td{color:#a0a0a0!important}.swagger-ui .model .deprecated>td:first-of-type{text-decoration:line-through}.swagger-ui .model-toggle{font-size:10px;position:relative;top:6px;display:inline-block;margin:auto .3em;cursor:pointer;-webkit-transition:-webkit-transform .15s ease-in;transition:-webkit-transform .15s ease-in;transition:transform .15s ease-in;transition:transform .15s ease-in,-webkit-transform .15s ease-in;-webkit-transform:rotate(90deg);transform:rotate(90deg);-webkit-transform-origin:50% 50%;transform-origin:50% 50%}.swagger-ui .model-toggle.collapsed{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.swagger-ui .model-toggle:after{display:block;width:20px;height:20px;content:"";background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E") 50% no-repeat;background-size:100%}.swagger-ui .model-jump-to-path{position:relative;cursor:pointer}.swagger-ui .model-jump-to-path .view-line-link{position:absolute;top:-.4em;cursor:pointer}.swagger-ui .model-title{position:relative}.swagger-ui .model-title:hover .model-hint{visibility:visible}.swagger-ui .model-hint{position:absolute;top:-1.8em;visibility:hidden;padding:.1em .5em;white-space:nowrap;color:#ebebeb;border-radius:4px;background:rgba(0,0,0,.7)}.swagger-ui .model p{margin:0 0 1em}.swagger-ui section.models{margin:30px 0;border:1px solid rgba(59,65,81,.3);border-radius:4px}.swagger-ui section.models.is-open{padding:0 0 20px}.swagger-ui section.models.is-open h4{margin:0 0 5px;border-bottom:1px solid rgba(59,65,81,.3)}.swagger-ui section.models h4{font-size:16px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0;padding:10px 20px 10px 10px;cursor:pointer;-webkit-transition:all .2s;transition:all .2s;font-family:Titillium Web,sans-serif;color:#606060}.swagger-ui section.models h4 svg{-webkit-transition:all .4s;transition:all .4s}.swagger-ui section.models h4 span{-webkit-box-flex:1;-ms-flex:1;flex:1}.swagger-ui section.models h4:hover{background:rgba(0,0,0,.02)}.swagger-ui section.models h5{font-size:16px;margin:0 0 10px;font-family:Titillium Web,sans-serif;color:#707070}.swagger-ui section.models .model-jump-to-path{position:relative;top:5px}.swagger-ui section.models .model-container{margin:0 20px 15px;-webkit-transition:all .5s;transition:all .5s;border-radius:4px;background:rgba(0,0,0,.05)}.swagger-ui section.models .model-container:hover{background:rgba(0,0,0,.07)}.swagger-ui section.models .model-container:first-of-type{margin:20px}.swagger-ui section.models .model-container:last-of-type{margin:0 20px}.swagger-ui section.models .model-box{background:none}.swagger-ui .model-box{padding:10px;border-radius:4px;background:rgba(0,0,0,.1)}.swagger-ui .model-box .model-jump-to-path{position:relative;top:4px}.swagger-ui .model-box.deprecated{opacity:.5}.swagger-ui .model-title{font-size:16px;font-family:Titillium Web,sans-serif;color:#505050}.swagger-ui .model-deprecated-warning{font-size:16px;font-weight:600;margin-right:1em;font-family:Titillium Web,sans-serif;color:#f93e3e}.swagger-ui span>span.model .brace-close{padding:0 0 0 10px}.swagger-ui .prop-name{display:inline-block;margin-right:1em}.swagger-ui .prop-type{color:#55a}.swagger-ui .prop-enum{display:block}.swagger-ui .prop-format{color:#606060}.swagger-ui .servers>label{font-size:12px;margin:-20px 15px 0 0;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .servers>label select{min-width:130px;max-width:100%}.swagger-ui .servers h4.message{padding-bottom:2em}.swagger-ui .servers table tr{width:30em}.swagger-ui .servers table td{display:inline-block;max-width:15em;vertical-align:middle;padding-top:10px;padding-bottom:10px}.swagger-ui .servers table td:first-of-type{padding-right:2em}.swagger-ui .servers table td input{width:100%;height:100%}.swagger-ui .servers .computed-url{margin:2em 0}.swagger-ui .servers .computed-url code{display:inline-block;padding:4px;font-size:16px;margin:0 1em}.swagger-ui .global-server-container{margin:0 0 20px;padding:30px 0;background:#fff;-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.15);box-shadow:0 1px 2px 0 rgba(0,0,0,.15)}.swagger-ui .global-server-container .servers-title{line-height:2em;font-weight:700}.swagger-ui .operation-servers h4.message{margin-bottom:2em}.swagger-ui table{width:100%;padding:0 10px;border-collapse:collapse}.swagger-ui table.model tbody tr td{padding:0;vertical-align:top}.swagger-ui table.model tbody tr td:first-of-type{width:174px;padding:0 0 0 2em}.swagger-ui table.headers td{font-size:12px;font-weight:300;vertical-align:middle;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui table tbody tr td{padding:10px 0 0;vertical-align:top}.swagger-ui table tbody tr td:first-of-type{max-width:20%;min-width:6em;padding:10px 0}.swagger-ui table thead tr td,.swagger-ui table thead tr th{font-size:12px;font-weight:700;padding:12px 0;text-align:left;border-bottom:1px solid rgba(59,65,81,.2);font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .parameters-col_description input[type=text]{width:100%;max-width:340px}.swagger-ui .parameters-col_description select{border-width:1px}.swagger-ui .parameter__name{font-size:16px;font-weight:400;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .parameter__name.required{font-weight:700}.swagger-ui .parameter__name.required:after{font-size:10px;position:relative;top:-6px;padding:5px;content:"required";color:rgba(255,0,0,.6)}.swagger-ui .parameter__extension,.swagger-ui .parameter__in{font-size:12px;font-style:italic;font-family:Source Code Pro,monospace;font-weight:600;color:gray}.swagger-ui .parameter__deprecated{font-size:12px;font-style:italic;font-family:Source Code Pro,monospace;font-weight:600;color:red}.swagger-ui .table-container{padding:20px}.swagger-ui .topbar{padding:8px 0;background-color:#89bf04}.swagger-ui .topbar .topbar-wrapper,.swagger-ui .topbar a{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swagger-ui .topbar a{font-size:1.5em;font-weight:700;-webkit-box-flex:1;-ms-flex:1;flex:1;max-width:300px;text-decoration:none;font-family:Titillium Web,sans-serif;color:#fff}.swagger-ui .topbar a span{margin:0;padding:0 10px}.swagger-ui .topbar .download-url-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:3;-ms-flex:3;flex:3;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.swagger-ui .topbar .download-url-wrapper input[type=text]{width:100%;margin:0;border:2px solid #547f00;border-radius:4px 0 0 4px;outline:none}.swagger-ui .topbar .download-url-wrapper .select-label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;max-width:600px;margin:0}.swagger-ui .topbar .download-url-wrapper .select-label span{font-size:16px;-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 10px 0 0;text-align:right}.swagger-ui .topbar .download-url-wrapper .select-label select{-webkit-box-flex:2;-ms-flex:2;flex:2;width:100%;border:2px solid #547f00;outline:none;-webkit-box-shadow:none;box-shadow:none}.swagger-ui .topbar .download-url-wrapper .download-url-button{font-size:16px;font-weight:700;padding:4px 30px;border:none;border-radius:0 4px 4px 0;background:#547f00;font-family:Titillium Web,sans-serif;color:#fff}.swagger-ui .info{margin:50px 0}.swagger-ui .info hgroup.main{margin:0 0 20px}.swagger-ui .info hgroup.main a{font-size:12px}.swagger-ui .info li,.swagger-ui .info p,.swagger-ui .info table{font-size:14px;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .info h1,.swagger-ui .info h2,.swagger-ui .info h3,.swagger-ui .info h4,.swagger-ui .info h5{font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .info code{padding:3px 5px;border-radius:4px;background:rgba(0,0,0,.05);font-family:Source Code Pro,monospace;font-weight:600;color:#9012fe}.swagger-ui .info a{font-size:14px;-webkit-transition:all .4s;transition:all .4s;font-family:Open Sans,sans-serif;color:#4990e2}.swagger-ui .info a:hover{color:#1f69c0}.swagger-ui .info>div{margin:0 0 5px}.swagger-ui .info .base-url{font-size:12px;font-weight:300!important;margin:0;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .info .title{font-size:36px;margin:0;font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui .info .title small{font-size:10px;position:relative;top:-5px;display:inline-block;margin:0 0 0 5px;padding:2px 4px;vertical-align:super;border-radius:57px;background:#7d8492}.swagger-ui .info .title small pre{margin:0;font-family:Titillium Web,sans-serif;color:#fff}.swagger-ui .auth-btn-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px 0;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.swagger-ui .auth-btn-wrapper .btn-done{margin-right:1em}.swagger-ui .auth-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.swagger-ui .auth-wrapper .authorize{padding-right:20px}.swagger-ui .auth-container{margin:0 0 10px;padding:10px 20px;border-bottom:1px solid #ebebeb}.swagger-ui .auth-container:last-of-type{margin:0;padding:10px 20px;border:0}.swagger-ui .auth-container h4{margin:5px 0 15px!important}.swagger-ui .auth-container .wrapper{margin:0;padding:0}.swagger-ui .auth-container input[type=password],.swagger-ui .auth-container input[type=text]{min-width:230px}.swagger-ui .auth-container .errors{font-size:12px;padding:10px;border-radius:4px;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .scopes h2{font-size:14px;font-family:Titillium Web,sans-serif;color:#3b4151}.swagger-ui .scope-def{padding:0 0 20px}.swagger-ui .errors-wrapper{margin:20px;padding:10px 20px;-webkit-animation:scaleUp .5s;animation:scaleUp .5s;border:2px solid #f93e3e;border-radius:4px;background:rgba(249,62,62,.1)}.swagger-ui .errors-wrapper .error-wrapper{margin:0 0 10px}.swagger-ui .errors-wrapper .errors h4{font-size:14px;margin:0;font-family:Source Code Pro,monospace;font-weight:600;color:#3b4151}.swagger-ui .errors-wrapper .errors small{color:#606060}.swagger-ui .errors-wrapper hgroup{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swagger-ui .errors-wrapper hgroup h4{font-size:20px;margin:0;-webkit-box-flex:1;-ms-flex:1;flex:1;font-family:Titillium Web,sans-serif;color:#3b4151}@-webkit-keyframes scaleUp{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes scaleUp{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}.swagger-ui .Resizer.vertical.disabled{display:none} +.swagger-ui{ + /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */font-family:sans-serif;color:#3b4151}.swagger-ui html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}.swagger-ui body{margin:0}.swagger-ui article,.swagger-ui aside,.swagger-ui footer,.swagger-ui header,.swagger-ui nav,.swagger-ui section{display:block}.swagger-ui h1{font-size:2em;margin:.67em 0}.swagger-ui figcaption,.swagger-ui figure,.swagger-ui main{display:block}.swagger-ui figure{margin:1em 40px}.swagger-ui hr{box-sizing:content-box;height:0;overflow:visible}.swagger-ui pre{font-family:monospace,monospace;font-size:1em}.swagger-ui a{background-color:transparent;-webkit-text-decoration-skip:objects}.swagger-ui abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.swagger-ui b,.swagger-ui strong{font-weight:inherit;font-weight:bolder}.swagger-ui code,.swagger-ui kbd,.swagger-ui samp{font-family:monospace,monospace;font-size:1em}.swagger-ui dfn{font-style:italic}.swagger-ui mark{background-color:#ff0;color:#000}.swagger-ui small{font-size:80%}.swagger-ui sub,.swagger-ui sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.swagger-ui sub{bottom:-.25em}.swagger-ui sup{top:-.5em}.swagger-ui audio,.swagger-ui video{display:inline-block}.swagger-ui audio:not([controls]){display:none;height:0}.swagger-ui img{border-style:none}.swagger-ui svg:not(:root){overflow:hidden}.swagger-ui button,.swagger-ui input,.swagger-ui optgroup,.swagger-ui select,.swagger-ui textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}.swagger-ui button,.swagger-ui input{overflow:visible}.swagger-ui button,.swagger-ui select{text-transform:none}.swagger-ui [type=reset],.swagger-ui [type=submit],.swagger-ui button,.swagger-ui html [type=button]{-webkit-appearance:button}.swagger-ui [type=button]::-moz-focus-inner,.swagger-ui [type=reset]::-moz-focus-inner,.swagger-ui [type=submit]::-moz-focus-inner,.swagger-ui button::-moz-focus-inner{border-style:none;padding:0}.swagger-ui [type=button]:-moz-focusring,.swagger-ui [type=reset]:-moz-focusring,.swagger-ui [type=submit]:-moz-focusring,.swagger-ui button:-moz-focusring{outline:1px dotted ButtonText}.swagger-ui fieldset{padding:.35em .75em .625em}.swagger-ui legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}.swagger-ui progress{display:inline-block;vertical-align:baseline}.swagger-ui textarea{overflow:auto}.swagger-ui [type=checkbox],.swagger-ui [type=radio]{box-sizing:border-box;padding:0}.swagger-ui [type=number]::-webkit-inner-spin-button,.swagger-ui [type=number]::-webkit-outer-spin-button{height:auto}.swagger-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.swagger-ui [type=search]::-webkit-search-cancel-button,.swagger-ui [type=search]::-webkit-search-decoration{-webkit-appearance:none}.swagger-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.swagger-ui details,.swagger-ui menu{display:block}.swagger-ui summary{display:list-item}.swagger-ui canvas{display:inline-block}.swagger-ui template{display:none}.swagger-ui [hidden]{display:none}.swagger-ui .debug *{outline:1px solid gold}.swagger-ui .debug-white *{outline:1px solid #fff}.swagger-ui .debug-black *{outline:1px solid #000}.swagger-ui .debug-grid{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTRDOTY4N0U2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTRDOTY4N0Q2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3NjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3NzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsBS+GMAAAAjSURBVHjaYvz//z8DLsD4gcGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) repeat 0 0}.swagger-ui .debug-grid-16{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODYyRjhERDU2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODYyRjhERDQ2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QTY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3QjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvCS01IAAABMSURBVHjaYmR4/5+BFPBfAMFm/MBgx8RAGWCn1AAmSg34Q6kBDKMGMDCwICeMIemF/5QawEipAWwUhwEjMDvbAWlWkvVBwu8vQIABAEwBCph8U6c0AAAAAElFTkSuQmCC) repeat 0 0}.swagger-ui .debug-grid-8-solid{background:#fff url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAAAAD/4QMxaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzExMSA3OS4xNTgzMjUsIDIwMTUvMDkvMTAtMDE6MTA6MjAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkIxMjI0OTczNjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkIxMjI0OTc0NjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QjEyMjQ5NzE2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QjEyMjQ5NzI2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAbGhopHSlBJiZBQi8vL0JHPz4+P0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHAR0pKTQmND8oKD9HPzU/R0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAAIAAgDASIAAhEBAxEB/8QAWQABAQAAAAAAAAAAAAAAAAAAAAYBAQEAAAAAAAAAAAAAAAAAAAIEEAEBAAMBAAAAAAAAAAAAAAABADECA0ERAAEDBQAAAAAAAAAAAAAAAAARITFBUWESIv/aAAwDAQACEQMRAD8AoOnTV1QTD7JJshP3vSM3P//Z) repeat 0 0}.swagger-ui .debug-grid-16-solid{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NzY3MkJEN0U2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NzY3MkJEN0Y2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3RDY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pve6J3kAAAAzSURBVHjaYvz//z8D0UDsMwMjSRoYP5Gq4SPNbRjVMEQ1fCRDg+in/6+J1AJUxsgAEGAA31BAJMS0GYEAAAAASUVORK5CYII=) repeat 0 0}.swagger-ui .border-box,.swagger-ui a,.swagger-ui article,.swagger-ui body,.swagger-ui code,.swagger-ui dd,.swagger-ui div,.swagger-ui dl,.swagger-ui dt,.swagger-ui fieldset,.swagger-ui footer,.swagger-ui form,.swagger-ui h1,.swagger-ui h2,.swagger-ui h3,.swagger-ui h4,.swagger-ui h5,.swagger-ui h6,.swagger-ui header,.swagger-ui html,.swagger-ui input[type=email],.swagger-ui input[type=number],.swagger-ui input[type=password],.swagger-ui input[type=tel],.swagger-ui input[type=text],.swagger-ui input[type=url],.swagger-ui legend,.swagger-ui li,.swagger-ui main,.swagger-ui ol,.swagger-ui p,.swagger-ui pre,.swagger-ui section,.swagger-ui table,.swagger-ui td,.swagger-ui textarea,.swagger-ui th,.swagger-ui tr,.swagger-ui ul{box-sizing:border-box}.swagger-ui .aspect-ratio{height:0;position:relative}.swagger-ui .aspect-ratio--16x9{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1{padding-bottom:100%}.swagger-ui .aspect-ratio--object{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}@media screen and (min-width:30em){.swagger-ui .aspect-ratio-ns{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-ns{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-ns{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-ns{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-ns{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-ns{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-ns{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-ns{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-ns{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-ns{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-ns{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-ns{padding-bottom:100%}.swagger-ui .aspect-ratio--object-ns{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .aspect-ratio-m{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-m{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-m{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-m{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-m{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-m{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-m{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-m{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-m{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-m{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-m{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-m{padding-bottom:100%}.swagger-ui .aspect-ratio--object-m{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}}@media screen and (min-width:60em){.swagger-ui .aspect-ratio-l{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-l{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-l{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-l{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-l{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-l{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-l{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-l{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-l{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-l{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-l{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-l{padding-bottom:100%}.swagger-ui .aspect-ratio--object-l{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}}.swagger-ui img{max-width:100%}.swagger-ui .cover{background-size:cover!important}.swagger-ui .contain{background-size:contain!important}@media screen and (min-width:30em){.swagger-ui .cover-ns{background-size:cover!important}.swagger-ui .contain-ns{background-size:contain!important}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .cover-m{background-size:cover!important}.swagger-ui .contain-m{background-size:contain!important}}@media screen and (min-width:60em){.swagger-ui .cover-l{background-size:cover!important}.swagger-ui .contain-l{background-size:contain!important}}.swagger-ui .bg-center{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left{background-repeat:no-repeat;background-position:0}@media screen and (min-width:30em){.swagger-ui .bg-center-ns{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top-ns{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right-ns{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom-ns{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left-ns{background-repeat:no-repeat;background-position:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .bg-center-m{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top-m{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right-m{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom-m{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left-m{background-repeat:no-repeat;background-position:0}}@media screen and (min-width:60em){.swagger-ui .bg-center-l{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top-l{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right-l{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom-l{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left-l{background-repeat:no-repeat;background-position:0}}.swagger-ui .outline{outline:1px solid}.swagger-ui .outline-transparent{outline:1px solid transparent}.swagger-ui .outline-0{outline:0}@media screen and (min-width:30em){.swagger-ui .outline-ns{outline:1px solid}.swagger-ui .outline-transparent-ns{outline:1px solid transparent}.swagger-ui .outline-0-ns{outline:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .outline-m{outline:1px solid}.swagger-ui .outline-transparent-m{outline:1px solid transparent}.swagger-ui .outline-0-m{outline:0}}@media screen and (min-width:60em){.swagger-ui .outline-l{outline:1px solid}.swagger-ui .outline-transparent-l{outline:1px solid transparent}.swagger-ui .outline-0-l{outline:0}}.swagger-ui .ba{border-style:solid;border-width:1px}.swagger-ui .bt{border-top-style:solid;border-top-width:1px}.swagger-ui .br{border-right-style:solid;border-right-width:1px}.swagger-ui .bb{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl{border-left-style:solid;border-left-width:1px}.swagger-ui .bn{border-style:none;border-width:0}@media screen and (min-width:30em){.swagger-ui .ba-ns{border-style:solid;border-width:1px}.swagger-ui .bt-ns{border-top-style:solid;border-top-width:1px}.swagger-ui .br-ns{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-ns{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-ns{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-ns{border-style:none;border-width:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .ba-m{border-style:solid;border-width:1px}.swagger-ui .bt-m{border-top-style:solid;border-top-width:1px}.swagger-ui .br-m{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-m{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-m{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-m{border-style:none;border-width:0}}@media screen and (min-width:60em){.swagger-ui .ba-l{border-style:solid;border-width:1px}.swagger-ui .bt-l{border-top-style:solid;border-top-width:1px}.swagger-ui .br-l{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-l{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-l{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-l{border-style:none;border-width:0}}.swagger-ui .b--black{border-color:#000}.swagger-ui .b--near-black{border-color:#111}.swagger-ui .b--dark-gray{border-color:#333}.swagger-ui .b--mid-gray{border-color:#555}.swagger-ui .b--gray{border-color:#777}.swagger-ui .b--silver{border-color:#999}.swagger-ui .b--light-silver{border-color:#aaa}.swagger-ui .b--moon-gray{border-color:#ccc}.swagger-ui .b--light-gray{border-color:#eee}.swagger-ui .b--near-white{border-color:#f4f4f4}.swagger-ui .b--white{border-color:#fff}.swagger-ui .b--white-90{border-color:hsla(0,0%,100%,.9)}.swagger-ui .b--white-80{border-color:hsla(0,0%,100%,.8)}.swagger-ui .b--white-70{border-color:hsla(0,0%,100%,.7)}.swagger-ui .b--white-60{border-color:hsla(0,0%,100%,.6)}.swagger-ui .b--white-50{border-color:hsla(0,0%,100%,.5)}.swagger-ui .b--white-40{border-color:hsla(0,0%,100%,.4)}.swagger-ui .b--white-30{border-color:hsla(0,0%,100%,.3)}.swagger-ui .b--white-20{border-color:hsla(0,0%,100%,.2)}.swagger-ui .b--white-10{border-color:hsla(0,0%,100%,.1)}.swagger-ui .b--white-05{border-color:hsla(0,0%,100%,.05)}.swagger-ui .b--white-025{border-color:hsla(0,0%,100%,.025)}.swagger-ui .b--white-0125{border-color:hsla(0,0%,100%,.0125)}.swagger-ui .b--black-90{border-color:rgba(0,0,0,.9)}.swagger-ui .b--black-80{border-color:rgba(0,0,0,.8)}.swagger-ui .b--black-70{border-color:rgba(0,0,0,.7)}.swagger-ui .b--black-60{border-color:rgba(0,0,0,.6)}.swagger-ui .b--black-50{border-color:rgba(0,0,0,.5)}.swagger-ui .b--black-40{border-color:rgba(0,0,0,.4)}.swagger-ui .b--black-30{border-color:rgba(0,0,0,.3)}.swagger-ui .b--black-20{border-color:rgba(0,0,0,.2)}.swagger-ui .b--black-10{border-color:rgba(0,0,0,.1)}.swagger-ui .b--black-05{border-color:rgba(0,0,0,.05)}.swagger-ui .b--black-025{border-color:rgba(0,0,0,.025)}.swagger-ui .b--black-0125{border-color:rgba(0,0,0,.0125)}.swagger-ui .b--dark-red{border-color:#e7040f}.swagger-ui .b--red{border-color:#ff4136}.swagger-ui .b--light-red{border-color:#ff725c}.swagger-ui .b--orange{border-color:#ff6300}.swagger-ui .b--gold{border-color:#ffb700}.swagger-ui .b--yellow{border-color:gold}.swagger-ui .b--light-yellow{border-color:#fbf1a9}.swagger-ui .b--purple{border-color:#5e2ca5}.swagger-ui .b--light-purple{border-color:#a463f2}.swagger-ui .b--dark-pink{border-color:#d5008f}.swagger-ui .b--hot-pink{border-color:#ff41b4}.swagger-ui .b--pink{border-color:#ff80cc}.swagger-ui .b--light-pink{border-color:#ffa3d7}.swagger-ui .b--dark-green{border-color:#137752}.swagger-ui .b--green{border-color:#19a974}.swagger-ui .b--light-green{border-color:#9eebcf}.swagger-ui .b--navy{border-color:#001b44}.swagger-ui .b--dark-blue{border-color:#00449e}.swagger-ui .b--blue{border-color:#357edd}.swagger-ui .b--light-blue{border-color:#96ccff}.swagger-ui .b--lightest-blue{border-color:#cdecff}.swagger-ui .b--washed-blue{border-color:#f6fffe}.swagger-ui .b--washed-green{border-color:#e8fdf5}.swagger-ui .b--washed-yellow{border-color:#fffceb}.swagger-ui .b--washed-red{border-color:#ffdfdf}.swagger-ui .b--transparent{border-color:transparent}.swagger-ui .b--inherit{border-color:inherit}.swagger-ui .br0{border-radius:0}.swagger-ui .br1{border-radius:.125rem}.swagger-ui .br2{border-radius:.25rem}.swagger-ui .br3{border-radius:.5rem}.swagger-ui .br4{border-radius:1rem}.swagger-ui .br-100{border-radius:100%}.swagger-ui .br-pill{border-radius:9999px}.swagger-ui .br--bottom{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left{border-top-right-radius:0;border-bottom-right-radius:0}@media screen and (min-width:30em){.swagger-ui .br0-ns{border-radius:0}.swagger-ui .br1-ns{border-radius:.125rem}.swagger-ui .br2-ns{border-radius:.25rem}.swagger-ui .br3-ns{border-radius:.5rem}.swagger-ui .br4-ns{border-radius:1rem}.swagger-ui .br-100-ns{border-radius:100%}.swagger-ui .br-pill-ns{border-radius:9999px}.swagger-ui .br--bottom-ns{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-ns{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-ns{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left-ns{border-top-right-radius:0;border-bottom-right-radius:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .br0-m{border-radius:0}.swagger-ui .br1-m{border-radius:.125rem}.swagger-ui .br2-m{border-radius:.25rem}.swagger-ui .br3-m{border-radius:.5rem}.swagger-ui .br4-m{border-radius:1rem}.swagger-ui .br-100-m{border-radius:100%}.swagger-ui .br-pill-m{border-radius:9999px}.swagger-ui .br--bottom-m{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-m{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-m{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left-m{border-top-right-radius:0;border-bottom-right-radius:0}}@media screen and (min-width:60em){.swagger-ui .br0-l{border-radius:0}.swagger-ui .br1-l{border-radius:.125rem}.swagger-ui .br2-l{border-radius:.25rem}.swagger-ui .br3-l{border-radius:.5rem}.swagger-ui .br4-l{border-radius:1rem}.swagger-ui .br-100-l{border-radius:100%}.swagger-ui .br-pill-l{border-radius:9999px}.swagger-ui .br--bottom-l{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-l{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-l{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left-l{border-top-right-radius:0;border-bottom-right-radius:0}}.swagger-ui .b--dotted{border-style:dotted}.swagger-ui .b--dashed{border-style:dashed}.swagger-ui .b--solid{border-style:solid}.swagger-ui .b--none{border-style:none}@media screen and (min-width:30em){.swagger-ui .b--dotted-ns{border-style:dotted}.swagger-ui .b--dashed-ns{border-style:dashed}.swagger-ui .b--solid-ns{border-style:solid}.swagger-ui .b--none-ns{border-style:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .b--dotted-m{border-style:dotted}.swagger-ui .b--dashed-m{border-style:dashed}.swagger-ui .b--solid-m{border-style:solid}.swagger-ui .b--none-m{border-style:none}}@media screen and (min-width:60em){.swagger-ui .b--dotted-l{border-style:dotted}.swagger-ui .b--dashed-l{border-style:dashed}.swagger-ui .b--solid-l{border-style:solid}.swagger-ui .b--none-l{border-style:none}}.swagger-ui .bw0{border-width:0}.swagger-ui .bw1{border-width:.125rem}.swagger-ui .bw2{border-width:.25rem}.swagger-ui .bw3{border-width:.5rem}.swagger-ui .bw4{border-width:1rem}.swagger-ui .bw5{border-width:2rem}.swagger-ui .bt-0{border-top-width:0}.swagger-ui .br-0{border-right-width:0}.swagger-ui .bb-0{border-bottom-width:0}.swagger-ui .bl-0{border-left-width:0}@media screen and (min-width:30em){.swagger-ui .bw0-ns{border-width:0}.swagger-ui .bw1-ns{border-width:.125rem}.swagger-ui .bw2-ns{border-width:.25rem}.swagger-ui .bw3-ns{border-width:.5rem}.swagger-ui .bw4-ns{border-width:1rem}.swagger-ui .bw5-ns{border-width:2rem}.swagger-ui .bt-0-ns{border-top-width:0}.swagger-ui .br-0-ns{border-right-width:0}.swagger-ui .bb-0-ns{border-bottom-width:0}.swagger-ui .bl-0-ns{border-left-width:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .bw0-m{border-width:0}.swagger-ui .bw1-m{border-width:.125rem}.swagger-ui .bw2-m{border-width:.25rem}.swagger-ui .bw3-m{border-width:.5rem}.swagger-ui .bw4-m{border-width:1rem}.swagger-ui .bw5-m{border-width:2rem}.swagger-ui .bt-0-m{border-top-width:0}.swagger-ui .br-0-m{border-right-width:0}.swagger-ui .bb-0-m{border-bottom-width:0}.swagger-ui .bl-0-m{border-left-width:0}}@media screen and (min-width:60em){.swagger-ui .bw0-l{border-width:0}.swagger-ui .bw1-l{border-width:.125rem}.swagger-ui .bw2-l{border-width:.25rem}.swagger-ui .bw3-l{border-width:.5rem}.swagger-ui .bw4-l{border-width:1rem}.swagger-ui .bw5-l{border-width:2rem}.swagger-ui .bt-0-l{border-top-width:0}.swagger-ui .br-0-l{border-right-width:0}.swagger-ui .bb-0-l{border-bottom-width:0}.swagger-ui .bl-0-l{border-left-width:0}}.swagger-ui .shadow-1{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}@media screen and (min-width:30em){.swagger-ui .shadow-1-ns{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-ns{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-ns{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-ns{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-ns{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .shadow-1-m{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-m{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-m{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-m{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-m{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}@media screen and (min-width:60em){.swagger-ui .shadow-1-l{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-l{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-l{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-l{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-l{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}.swagger-ui .pre{overflow-x:auto;overflow-y:hidden;overflow:scroll}.swagger-ui .top-0{top:0}.swagger-ui .right-0{right:0}.swagger-ui .bottom-0{bottom:0}.swagger-ui .left-0{left:0}.swagger-ui .top-1{top:1rem}.swagger-ui .right-1{right:1rem}.swagger-ui .bottom-1{bottom:1rem}.swagger-ui .left-1{left:1rem}.swagger-ui .top-2{top:2rem}.swagger-ui .right-2{right:2rem}.swagger-ui .bottom-2{bottom:2rem}.swagger-ui .left-2{left:2rem}.swagger-ui .top--1{top:-1rem}.swagger-ui .right--1{right:-1rem}.swagger-ui .bottom--1{bottom:-1rem}.swagger-ui .left--1{left:-1rem}.swagger-ui .top--2{top:-2rem}.swagger-ui .right--2{right:-2rem}.swagger-ui .bottom--2{bottom:-2rem}.swagger-ui .left--2{left:-2rem}.swagger-ui .absolute--fill{top:0;right:0;bottom:0;left:0}@media screen and (min-width:30em){.swagger-ui .top-0-ns{top:0}.swagger-ui .left-0-ns{left:0}.swagger-ui .right-0-ns{right:0}.swagger-ui .bottom-0-ns{bottom:0}.swagger-ui .top-1-ns{top:1rem}.swagger-ui .left-1-ns{left:1rem}.swagger-ui .right-1-ns{right:1rem}.swagger-ui .bottom-1-ns{bottom:1rem}.swagger-ui .top-2-ns{top:2rem}.swagger-ui .left-2-ns{left:2rem}.swagger-ui .right-2-ns{right:2rem}.swagger-ui .bottom-2-ns{bottom:2rem}.swagger-ui .top--1-ns{top:-1rem}.swagger-ui .right--1-ns{right:-1rem}.swagger-ui .bottom--1-ns{bottom:-1rem}.swagger-ui .left--1-ns{left:-1rem}.swagger-ui .top--2-ns{top:-2rem}.swagger-ui .right--2-ns{right:-2rem}.swagger-ui .bottom--2-ns{bottom:-2rem}.swagger-ui .left--2-ns{left:-2rem}.swagger-ui .absolute--fill-ns{top:0;right:0;bottom:0;left:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .top-0-m{top:0}.swagger-ui .left-0-m{left:0}.swagger-ui .right-0-m{right:0}.swagger-ui .bottom-0-m{bottom:0}.swagger-ui .top-1-m{top:1rem}.swagger-ui .left-1-m{left:1rem}.swagger-ui .right-1-m{right:1rem}.swagger-ui .bottom-1-m{bottom:1rem}.swagger-ui .top-2-m{top:2rem}.swagger-ui .left-2-m{left:2rem}.swagger-ui .right-2-m{right:2rem}.swagger-ui .bottom-2-m{bottom:2rem}.swagger-ui .top--1-m{top:-1rem}.swagger-ui .right--1-m{right:-1rem}.swagger-ui .bottom--1-m{bottom:-1rem}.swagger-ui .left--1-m{left:-1rem}.swagger-ui .top--2-m{top:-2rem}.swagger-ui .right--2-m{right:-2rem}.swagger-ui .bottom--2-m{bottom:-2rem}.swagger-ui .left--2-m{left:-2rem}.swagger-ui .absolute--fill-m{top:0;right:0;bottom:0;left:0}}@media screen and (min-width:60em){.swagger-ui .top-0-l{top:0}.swagger-ui .left-0-l{left:0}.swagger-ui .right-0-l{right:0}.swagger-ui .bottom-0-l{bottom:0}.swagger-ui .top-1-l{top:1rem}.swagger-ui .left-1-l{left:1rem}.swagger-ui .right-1-l{right:1rem}.swagger-ui .bottom-1-l{bottom:1rem}.swagger-ui .top-2-l{top:2rem}.swagger-ui .left-2-l{left:2rem}.swagger-ui .right-2-l{right:2rem}.swagger-ui .bottom-2-l{bottom:2rem}.swagger-ui .top--1-l{top:-1rem}.swagger-ui .right--1-l{right:-1rem}.swagger-ui .bottom--1-l{bottom:-1rem}.swagger-ui .left--1-l{left:-1rem}.swagger-ui .top--2-l{top:-2rem}.swagger-ui .right--2-l{right:-2rem}.swagger-ui .bottom--2-l{bottom:-2rem}.swagger-ui .left--2-l{left:-2rem}.swagger-ui .absolute--fill-l{top:0;right:0;bottom:0;left:0}}.swagger-ui .cf:after,.swagger-ui .cf:before{content:" ";display:table}.swagger-ui .cf:after{clear:both}.swagger-ui .cf{*zoom:1}.swagger-ui .cl{clear:left}.swagger-ui .cr{clear:right}.swagger-ui .cb{clear:both}.swagger-ui .cn{clear:none}@media screen and (min-width:30em){.swagger-ui .cl-ns{clear:left}.swagger-ui .cr-ns{clear:right}.swagger-ui .cb-ns{clear:both}.swagger-ui .cn-ns{clear:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .cl-m{clear:left}.swagger-ui .cr-m{clear:right}.swagger-ui .cb-m{clear:both}.swagger-ui .cn-m{clear:none}}@media screen and (min-width:60em){.swagger-ui .cl-l{clear:left}.swagger-ui .cr-l{clear:right}.swagger-ui .cb-l{clear:both}.swagger-ui .cn-l{clear:none}}.swagger-ui .flex{display:flex}.swagger-ui .inline-flex{display:inline-flex}.swagger-ui .flex-auto{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none{flex:none}.swagger-ui .flex-column{flex-direction:column}.swagger-ui .flex-row{flex-direction:row}.swagger-ui .flex-wrap{flex-wrap:wrap}.swagger-ui .flex-nowrap{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse{flex-direction:column-reverse}.swagger-ui .flex-row-reverse{flex-direction:row-reverse}.swagger-ui .items-start{align-items:flex-start}.swagger-ui .items-end{align-items:flex-end}.swagger-ui .items-center{align-items:center}.swagger-ui .items-baseline{align-items:baseline}.swagger-ui .items-stretch{align-items:stretch}.swagger-ui .self-start{align-self:flex-start}.swagger-ui .self-end{align-self:flex-end}.swagger-ui .self-center{align-self:center}.swagger-ui .self-baseline{align-self:baseline}.swagger-ui .self-stretch{align-self:stretch}.swagger-ui .justify-start{justify-content:flex-start}.swagger-ui .justify-end{justify-content:flex-end}.swagger-ui .justify-center{justify-content:center}.swagger-ui .justify-between{justify-content:space-between}.swagger-ui .justify-around{justify-content:space-around}.swagger-ui .content-start{align-content:flex-start}.swagger-ui .content-end{align-content:flex-end}.swagger-ui .content-center{align-content:center}.swagger-ui .content-between{align-content:space-between}.swagger-ui .content-around{align-content:space-around}.swagger-ui .content-stretch{align-content:stretch}.swagger-ui .order-0{order:0}.swagger-ui .order-1{order:1}.swagger-ui .order-2{order:2}.swagger-ui .order-3{order:3}.swagger-ui .order-4{order:4}.swagger-ui .order-5{order:5}.swagger-ui .order-6{order:6}.swagger-ui .order-7{order:7}.swagger-ui .order-8{order:8}.swagger-ui .order-last{order:99999}.swagger-ui .flex-grow-0{flex-grow:0}.swagger-ui .flex-grow-1{flex-grow:1}.swagger-ui .flex-shrink-0{flex-shrink:0}.swagger-ui .flex-shrink-1{flex-shrink:1}@media screen and (min-width:30em){.swagger-ui .flex-ns{display:flex}.swagger-ui .inline-flex-ns{display:inline-flex}.swagger-ui .flex-auto-ns{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none-ns{flex:none}.swagger-ui .flex-column-ns{flex-direction:column}.swagger-ui .flex-row-ns{flex-direction:row}.swagger-ui .flex-wrap-ns{flex-wrap:wrap}.swagger-ui .flex-nowrap-ns{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-ns{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-ns{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-ns{flex-direction:row-reverse}.swagger-ui .items-start-ns{align-items:flex-start}.swagger-ui .items-end-ns{align-items:flex-end}.swagger-ui .items-center-ns{align-items:center}.swagger-ui .items-baseline-ns{align-items:baseline}.swagger-ui .items-stretch-ns{align-items:stretch}.swagger-ui .self-start-ns{align-self:flex-start}.swagger-ui .self-end-ns{align-self:flex-end}.swagger-ui .self-center-ns{align-self:center}.swagger-ui .self-baseline-ns{align-self:baseline}.swagger-ui .self-stretch-ns{align-self:stretch}.swagger-ui .justify-start-ns{justify-content:flex-start}.swagger-ui .justify-end-ns{justify-content:flex-end}.swagger-ui .justify-center-ns{justify-content:center}.swagger-ui .justify-between-ns{justify-content:space-between}.swagger-ui .justify-around-ns{justify-content:space-around}.swagger-ui .content-start-ns{align-content:flex-start}.swagger-ui .content-end-ns{align-content:flex-end}.swagger-ui .content-center-ns{align-content:center}.swagger-ui .content-between-ns{align-content:space-between}.swagger-ui .content-around-ns{align-content:space-around}.swagger-ui .content-stretch-ns{align-content:stretch}.swagger-ui .order-0-ns{order:0}.swagger-ui .order-1-ns{order:1}.swagger-ui .order-2-ns{order:2}.swagger-ui .order-3-ns{order:3}.swagger-ui .order-4-ns{order:4}.swagger-ui .order-5-ns{order:5}.swagger-ui .order-6-ns{order:6}.swagger-ui .order-7-ns{order:7}.swagger-ui .order-8-ns{order:8}.swagger-ui .order-last-ns{order:99999}.swagger-ui .flex-grow-0-ns{flex-grow:0}.swagger-ui .flex-grow-1-ns{flex-grow:1}.swagger-ui .flex-shrink-0-ns{flex-shrink:0}.swagger-ui .flex-shrink-1-ns{flex-shrink:1}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .flex-m{display:flex}.swagger-ui .inline-flex-m{display:inline-flex}.swagger-ui .flex-auto-m{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none-m{flex:none}.swagger-ui .flex-column-m{flex-direction:column}.swagger-ui .flex-row-m{flex-direction:row}.swagger-ui .flex-wrap-m{flex-wrap:wrap}.swagger-ui .flex-nowrap-m{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-m{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-m{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-m{flex-direction:row-reverse}.swagger-ui .items-start-m{align-items:flex-start}.swagger-ui .items-end-m{align-items:flex-end}.swagger-ui .items-center-m{align-items:center}.swagger-ui .items-baseline-m{align-items:baseline}.swagger-ui .items-stretch-m{align-items:stretch}.swagger-ui .self-start-m{align-self:flex-start}.swagger-ui .self-end-m{align-self:flex-end}.swagger-ui .self-center-m{align-self:center}.swagger-ui .self-baseline-m{align-self:baseline}.swagger-ui .self-stretch-m{align-self:stretch}.swagger-ui .justify-start-m{justify-content:flex-start}.swagger-ui .justify-end-m{justify-content:flex-end}.swagger-ui .justify-center-m{justify-content:center}.swagger-ui .justify-between-m{justify-content:space-between}.swagger-ui .justify-around-m{justify-content:space-around}.swagger-ui .content-start-m{align-content:flex-start}.swagger-ui .content-end-m{align-content:flex-end}.swagger-ui .content-center-m{align-content:center}.swagger-ui .content-between-m{align-content:space-between}.swagger-ui .content-around-m{align-content:space-around}.swagger-ui .content-stretch-m{align-content:stretch}.swagger-ui .order-0-m{order:0}.swagger-ui .order-1-m{order:1}.swagger-ui .order-2-m{order:2}.swagger-ui .order-3-m{order:3}.swagger-ui .order-4-m{order:4}.swagger-ui .order-5-m{order:5}.swagger-ui .order-6-m{order:6}.swagger-ui .order-7-m{order:7}.swagger-ui .order-8-m{order:8}.swagger-ui .order-last-m{order:99999}.swagger-ui .flex-grow-0-m{flex-grow:0}.swagger-ui .flex-grow-1-m{flex-grow:1}.swagger-ui .flex-shrink-0-m{flex-shrink:0}.swagger-ui .flex-shrink-1-m{flex-shrink:1}}@media screen and (min-width:60em){.swagger-ui .flex-l{display:flex}.swagger-ui .inline-flex-l{display:inline-flex}.swagger-ui .flex-auto-l{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none-l{flex:none}.swagger-ui .flex-column-l{flex-direction:column}.swagger-ui .flex-row-l{flex-direction:row}.swagger-ui .flex-wrap-l{flex-wrap:wrap}.swagger-ui .flex-nowrap-l{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-l{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-l{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-l{flex-direction:row-reverse}.swagger-ui .items-start-l{align-items:flex-start}.swagger-ui .items-end-l{align-items:flex-end}.swagger-ui .items-center-l{align-items:center}.swagger-ui .items-baseline-l{align-items:baseline}.swagger-ui .items-stretch-l{align-items:stretch}.swagger-ui .self-start-l{align-self:flex-start}.swagger-ui .self-end-l{align-self:flex-end}.swagger-ui .self-center-l{align-self:center}.swagger-ui .self-baseline-l{align-self:baseline}.swagger-ui .self-stretch-l{align-self:stretch}.swagger-ui .justify-start-l{justify-content:flex-start}.swagger-ui .justify-end-l{justify-content:flex-end}.swagger-ui .justify-center-l{justify-content:center}.swagger-ui .justify-between-l{justify-content:space-between}.swagger-ui .justify-around-l{justify-content:space-around}.swagger-ui .content-start-l{align-content:flex-start}.swagger-ui .content-end-l{align-content:flex-end}.swagger-ui .content-center-l{align-content:center}.swagger-ui .content-between-l{align-content:space-between}.swagger-ui .content-around-l{align-content:space-around}.swagger-ui .content-stretch-l{align-content:stretch}.swagger-ui .order-0-l{order:0}.swagger-ui .order-1-l{order:1}.swagger-ui .order-2-l{order:2}.swagger-ui .order-3-l{order:3}.swagger-ui .order-4-l{order:4}.swagger-ui .order-5-l{order:5}.swagger-ui .order-6-l{order:6}.swagger-ui .order-7-l{order:7}.swagger-ui .order-8-l{order:8}.swagger-ui .order-last-l{order:99999}.swagger-ui .flex-grow-0-l{flex-grow:0}.swagger-ui .flex-grow-1-l{flex-grow:1}.swagger-ui .flex-shrink-0-l{flex-shrink:0}.swagger-ui .flex-shrink-1-l{flex-shrink:1}}.swagger-ui .dn{display:none}.swagger-ui .di{display:inline}.swagger-ui .db{display:block}.swagger-ui .dib{display:inline-block}.swagger-ui .dit{display:inline-table}.swagger-ui .dt{display:table}.swagger-ui .dtc{display:table-cell}.swagger-ui .dt-row{display:table-row}.swagger-ui .dt-row-group{display:table-row-group}.swagger-ui .dt-column{display:table-column}.swagger-ui .dt-column-group{display:table-column-group}.swagger-ui .dt--fixed{table-layout:fixed;width:100%}@media screen and (min-width:30em){.swagger-ui .dn-ns{display:none}.swagger-ui .di-ns{display:inline}.swagger-ui .db-ns{display:block}.swagger-ui .dib-ns{display:inline-block}.swagger-ui .dit-ns{display:inline-table}.swagger-ui .dt-ns{display:table}.swagger-ui .dtc-ns{display:table-cell}.swagger-ui .dt-row-ns{display:table-row}.swagger-ui .dt-row-group-ns{display:table-row-group}.swagger-ui .dt-column-ns{display:table-column}.swagger-ui .dt-column-group-ns{display:table-column-group}.swagger-ui .dt--fixed-ns{table-layout:fixed;width:100%}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .dn-m{display:none}.swagger-ui .di-m{display:inline}.swagger-ui .db-m{display:block}.swagger-ui .dib-m{display:inline-block}.swagger-ui .dit-m{display:inline-table}.swagger-ui .dt-m{display:table}.swagger-ui .dtc-m{display:table-cell}.swagger-ui .dt-row-m{display:table-row}.swagger-ui .dt-row-group-m{display:table-row-group}.swagger-ui .dt-column-m{display:table-column}.swagger-ui .dt-column-group-m{display:table-column-group}.swagger-ui .dt--fixed-m{table-layout:fixed;width:100%}}@media screen and (min-width:60em){.swagger-ui .dn-l{display:none}.swagger-ui .di-l{display:inline}.swagger-ui .db-l{display:block}.swagger-ui .dib-l{display:inline-block}.swagger-ui .dit-l{display:inline-table}.swagger-ui .dt-l{display:table}.swagger-ui .dtc-l{display:table-cell}.swagger-ui .dt-row-l{display:table-row}.swagger-ui .dt-row-group-l{display:table-row-group}.swagger-ui .dt-column-l{display:table-column}.swagger-ui .dt-column-group-l{display:table-column-group}.swagger-ui .dt--fixed-l{table-layout:fixed;width:100%}}.swagger-ui .fl{float:left;_display:inline}.swagger-ui .fr{float:right;_display:inline}.swagger-ui .fn{float:none}@media screen and (min-width:30em){.swagger-ui .fl-ns{float:left;_display:inline}.swagger-ui .fr-ns{float:right;_display:inline}.swagger-ui .fn-ns{float:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .fl-m{float:left;_display:inline}.swagger-ui .fr-m{float:right;_display:inline}.swagger-ui .fn-m{float:none}}@media screen and (min-width:60em){.swagger-ui .fl-l{float:left;_display:inline}.swagger-ui .fr-l{float:right;_display:inline}.swagger-ui .fn-l{float:none}}.swagger-ui .sans-serif{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica,helvetica neue,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.swagger-ui .serif{font-family:georgia,serif}.swagger-ui .system-sans-serif{font-family:sans-serif}.swagger-ui .system-serif{font-family:serif}.swagger-ui .code,.swagger-ui code{font-family:Consolas,monaco,monospace}.swagger-ui .courier{font-family:Courier Next,courier,monospace}.swagger-ui .helvetica{font-family:helvetica neue,helvetica,sans-serif}.swagger-ui .avenir{font-family:avenir next,avenir,sans-serif}.swagger-ui .athelas{font-family:athelas,georgia,serif}.swagger-ui .georgia{font-family:georgia,serif}.swagger-ui .times{font-family:times,serif}.swagger-ui .bodoni{font-family:Bodoni MT,serif}.swagger-ui .calisto{font-family:Calisto MT,serif}.swagger-ui .garamond{font-family:garamond,serif}.swagger-ui .baskerville{font-family:baskerville,serif}.swagger-ui .i{font-style:italic}.swagger-ui .fs-normal{font-style:normal}@media screen and (min-width:30em){.swagger-ui .i-ns{font-style:italic}.swagger-ui .fs-normal-ns{font-style:normal}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .i-m{font-style:italic}.swagger-ui .fs-normal-m{font-style:normal}}@media screen and (min-width:60em){.swagger-ui .i-l{font-style:italic}.swagger-ui .fs-normal-l{font-style:normal}}.swagger-ui .normal{font-weight:400}.swagger-ui .b{font-weight:700}.swagger-ui .fw1{font-weight:100}.swagger-ui .fw2{font-weight:200}.swagger-ui .fw3{font-weight:300}.swagger-ui .fw4{font-weight:400}.swagger-ui .fw5{font-weight:500}.swagger-ui .fw6{font-weight:600}.swagger-ui .fw7{font-weight:700}.swagger-ui .fw8{font-weight:800}.swagger-ui .fw9{font-weight:900}@media screen and (min-width:30em){.swagger-ui .normal-ns{font-weight:400}.swagger-ui .b-ns{font-weight:700}.swagger-ui .fw1-ns{font-weight:100}.swagger-ui .fw2-ns{font-weight:200}.swagger-ui .fw3-ns{font-weight:300}.swagger-ui .fw4-ns{font-weight:400}.swagger-ui .fw5-ns{font-weight:500}.swagger-ui .fw6-ns{font-weight:600}.swagger-ui .fw7-ns{font-weight:700}.swagger-ui .fw8-ns{font-weight:800}.swagger-ui .fw9-ns{font-weight:900}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .normal-m{font-weight:400}.swagger-ui .b-m{font-weight:700}.swagger-ui .fw1-m{font-weight:100}.swagger-ui .fw2-m{font-weight:200}.swagger-ui .fw3-m{font-weight:300}.swagger-ui .fw4-m{font-weight:400}.swagger-ui .fw5-m{font-weight:500}.swagger-ui .fw6-m{font-weight:600}.swagger-ui .fw7-m{font-weight:700}.swagger-ui .fw8-m{font-weight:800}.swagger-ui .fw9-m{font-weight:900}}@media screen and (min-width:60em){.swagger-ui .normal-l{font-weight:400}.swagger-ui .b-l{font-weight:700}.swagger-ui .fw1-l{font-weight:100}.swagger-ui .fw2-l{font-weight:200}.swagger-ui .fw3-l{font-weight:300}.swagger-ui .fw4-l{font-weight:400}.swagger-ui .fw5-l{font-weight:500}.swagger-ui .fw6-l{font-weight:600}.swagger-ui .fw7-l{font-weight:700}.swagger-ui .fw8-l{font-weight:800}.swagger-ui .fw9-l{font-weight:900}}.swagger-ui .input-reset{-webkit-appearance:none;-moz-appearance:none}.swagger-ui .button-reset::-moz-focus-inner,.swagger-ui .input-reset::-moz-focus-inner{border:0;padding:0}.swagger-ui .h1{height:1rem}.swagger-ui .h2{height:2rem}.swagger-ui .h3{height:4rem}.swagger-ui .h4{height:8rem}.swagger-ui .h5{height:16rem}.swagger-ui .h-25{height:25%}.swagger-ui .h-50{height:50%}.swagger-ui .h-75{height:75%}.swagger-ui .h-100{height:100%}.swagger-ui .min-h-100{min-height:100%}.swagger-ui .vh-25{height:25vh}.swagger-ui .vh-50{height:50vh}.swagger-ui .vh-75{height:75vh}.swagger-ui .vh-100{height:100vh}.swagger-ui .min-vh-100{min-height:100vh}.swagger-ui .h-auto{height:auto}.swagger-ui .h-inherit{height:inherit}@media screen and (min-width:30em){.swagger-ui .h1-ns{height:1rem}.swagger-ui .h2-ns{height:2rem}.swagger-ui .h3-ns{height:4rem}.swagger-ui .h4-ns{height:8rem}.swagger-ui .h5-ns{height:16rem}.swagger-ui .h-25-ns{height:25%}.swagger-ui .h-50-ns{height:50%}.swagger-ui .h-75-ns{height:75%}.swagger-ui .h-100-ns{height:100%}.swagger-ui .min-h-100-ns{min-height:100%}.swagger-ui .vh-25-ns{height:25vh}.swagger-ui .vh-50-ns{height:50vh}.swagger-ui .vh-75-ns{height:75vh}.swagger-ui .vh-100-ns{height:100vh}.swagger-ui .min-vh-100-ns{min-height:100vh}.swagger-ui .h-auto-ns{height:auto}.swagger-ui .h-inherit-ns{height:inherit}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .h1-m{height:1rem}.swagger-ui .h2-m{height:2rem}.swagger-ui .h3-m{height:4rem}.swagger-ui .h4-m{height:8rem}.swagger-ui .h5-m{height:16rem}.swagger-ui .h-25-m{height:25%}.swagger-ui .h-50-m{height:50%}.swagger-ui .h-75-m{height:75%}.swagger-ui .h-100-m{height:100%}.swagger-ui .min-h-100-m{min-height:100%}.swagger-ui .vh-25-m{height:25vh}.swagger-ui .vh-50-m{height:50vh}.swagger-ui .vh-75-m{height:75vh}.swagger-ui .vh-100-m{height:100vh}.swagger-ui .min-vh-100-m{min-height:100vh}.swagger-ui .h-auto-m{height:auto}.swagger-ui .h-inherit-m{height:inherit}}@media screen and (min-width:60em){.swagger-ui .h1-l{height:1rem}.swagger-ui .h2-l{height:2rem}.swagger-ui .h3-l{height:4rem}.swagger-ui .h4-l{height:8rem}.swagger-ui .h5-l{height:16rem}.swagger-ui .h-25-l{height:25%}.swagger-ui .h-50-l{height:50%}.swagger-ui .h-75-l{height:75%}.swagger-ui .h-100-l{height:100%}.swagger-ui .min-h-100-l{min-height:100%}.swagger-ui .vh-25-l{height:25vh}.swagger-ui .vh-50-l{height:50vh}.swagger-ui .vh-75-l{height:75vh}.swagger-ui .vh-100-l{height:100vh}.swagger-ui .min-vh-100-l{min-height:100vh}.swagger-ui .h-auto-l{height:auto}.swagger-ui .h-inherit-l{height:inherit}}.swagger-ui .tracked{letter-spacing:.1em}.swagger-ui .tracked-tight{letter-spacing:-.05em}.swagger-ui .tracked-mega{letter-spacing:.25em}@media screen and (min-width:30em){.swagger-ui .tracked-ns{letter-spacing:.1em}.swagger-ui .tracked-tight-ns{letter-spacing:-.05em}.swagger-ui .tracked-mega-ns{letter-spacing:.25em}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .tracked-m{letter-spacing:.1em}.swagger-ui .tracked-tight-m{letter-spacing:-.05em}.swagger-ui .tracked-mega-m{letter-spacing:.25em}}@media screen and (min-width:60em){.swagger-ui .tracked-l{letter-spacing:.1em}.swagger-ui .tracked-tight-l{letter-spacing:-.05em}.swagger-ui .tracked-mega-l{letter-spacing:.25em}}.swagger-ui .lh-solid{line-height:1}.swagger-ui .lh-title{line-height:1.25}.swagger-ui .lh-copy{line-height:1.5}@media screen and (min-width:30em){.swagger-ui .lh-solid-ns{line-height:1}.swagger-ui .lh-title-ns{line-height:1.25}.swagger-ui .lh-copy-ns{line-height:1.5}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .lh-solid-m{line-height:1}.swagger-ui .lh-title-m{line-height:1.25}.swagger-ui .lh-copy-m{line-height:1.5}}@media screen and (min-width:60em){.swagger-ui .lh-solid-l{line-height:1}.swagger-ui .lh-title-l{line-height:1.25}.swagger-ui .lh-copy-l{line-height:1.5}}.swagger-ui .link{text-decoration:none}.swagger-ui .link,.swagger-ui .link:link,.swagger-ui .link:visited{transition:color .15s ease-in}.swagger-ui .link:hover{transition:color .15s ease-in}.swagger-ui .link:active{transition:color .15s ease-in}.swagger-ui .link:focus{transition:color .15s ease-in;outline:1px dotted currentColor}.swagger-ui .list{list-style-type:none}.swagger-ui .mw-100{max-width:100%}.swagger-ui .mw1{max-width:1rem}.swagger-ui .mw2{max-width:2rem}.swagger-ui .mw3{max-width:4rem}.swagger-ui .mw4{max-width:8rem}.swagger-ui .mw5{max-width:16rem}.swagger-ui .mw6{max-width:32rem}.swagger-ui .mw7{max-width:48rem}.swagger-ui .mw8{max-width:64rem}.swagger-ui .mw9{max-width:96rem}.swagger-ui .mw-none{max-width:none}@media screen and (min-width:30em){.swagger-ui .mw-100-ns{max-width:100%}.swagger-ui .mw1-ns{max-width:1rem}.swagger-ui .mw2-ns{max-width:2rem}.swagger-ui .mw3-ns{max-width:4rem}.swagger-ui .mw4-ns{max-width:8rem}.swagger-ui .mw5-ns{max-width:16rem}.swagger-ui .mw6-ns{max-width:32rem}.swagger-ui .mw7-ns{max-width:48rem}.swagger-ui .mw8-ns{max-width:64rem}.swagger-ui .mw9-ns{max-width:96rem}.swagger-ui .mw-none-ns{max-width:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .mw-100-m{max-width:100%}.swagger-ui .mw1-m{max-width:1rem}.swagger-ui .mw2-m{max-width:2rem}.swagger-ui .mw3-m{max-width:4rem}.swagger-ui .mw4-m{max-width:8rem}.swagger-ui .mw5-m{max-width:16rem}.swagger-ui .mw6-m{max-width:32rem}.swagger-ui .mw7-m{max-width:48rem}.swagger-ui .mw8-m{max-width:64rem}.swagger-ui .mw9-m{max-width:96rem}.swagger-ui .mw-none-m{max-width:none}}@media screen and (min-width:60em){.swagger-ui .mw-100-l{max-width:100%}.swagger-ui .mw1-l{max-width:1rem}.swagger-ui .mw2-l{max-width:2rem}.swagger-ui .mw3-l{max-width:4rem}.swagger-ui .mw4-l{max-width:8rem}.swagger-ui .mw5-l{max-width:16rem}.swagger-ui .mw6-l{max-width:32rem}.swagger-ui .mw7-l{max-width:48rem}.swagger-ui .mw8-l{max-width:64rem}.swagger-ui .mw9-l{max-width:96rem}.swagger-ui .mw-none-l{max-width:none}}.swagger-ui .w1{width:1rem}.swagger-ui .w2{width:2rem}.swagger-ui .w3{width:4rem}.swagger-ui .w4{width:8rem}.swagger-ui .w5{width:16rem}.swagger-ui .w-10{width:10%}.swagger-ui .w-20{width:20%}.swagger-ui .w-25{width:25%}.swagger-ui .w-30{width:30%}.swagger-ui .w-33{width:33%}.swagger-ui .w-34{width:34%}.swagger-ui .w-40{width:40%}.swagger-ui .w-50{width:50%}.swagger-ui .w-60{width:60%}.swagger-ui .w-70{width:70%}.swagger-ui .w-75{width:75%}.swagger-ui .w-80{width:80%}.swagger-ui .w-90{width:90%}.swagger-ui .w-100{width:100%}.swagger-ui .w-third{width:33.33333%}.swagger-ui .w-two-thirds{width:66.66667%}.swagger-ui .w-auto{width:auto}@media screen and (min-width:30em){.swagger-ui .w1-ns{width:1rem}.swagger-ui .w2-ns{width:2rem}.swagger-ui .w3-ns{width:4rem}.swagger-ui .w4-ns{width:8rem}.swagger-ui .w5-ns{width:16rem}.swagger-ui .w-10-ns{width:10%}.swagger-ui .w-20-ns{width:20%}.swagger-ui .w-25-ns{width:25%}.swagger-ui .w-30-ns{width:30%}.swagger-ui .w-33-ns{width:33%}.swagger-ui .w-34-ns{width:34%}.swagger-ui .w-40-ns{width:40%}.swagger-ui .w-50-ns{width:50%}.swagger-ui .w-60-ns{width:60%}.swagger-ui .w-70-ns{width:70%}.swagger-ui .w-75-ns{width:75%}.swagger-ui .w-80-ns{width:80%}.swagger-ui .w-90-ns{width:90%}.swagger-ui .w-100-ns{width:100%}.swagger-ui .w-third-ns{width:33.33333%}.swagger-ui .w-two-thirds-ns{width:66.66667%}.swagger-ui .w-auto-ns{width:auto}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .w1-m{width:1rem}.swagger-ui .w2-m{width:2rem}.swagger-ui .w3-m{width:4rem}.swagger-ui .w4-m{width:8rem}.swagger-ui .w5-m{width:16rem}.swagger-ui .w-10-m{width:10%}.swagger-ui .w-20-m{width:20%}.swagger-ui .w-25-m{width:25%}.swagger-ui .w-30-m{width:30%}.swagger-ui .w-33-m{width:33%}.swagger-ui .w-34-m{width:34%}.swagger-ui .w-40-m{width:40%}.swagger-ui .w-50-m{width:50%}.swagger-ui .w-60-m{width:60%}.swagger-ui .w-70-m{width:70%}.swagger-ui .w-75-m{width:75%}.swagger-ui .w-80-m{width:80%}.swagger-ui .w-90-m{width:90%}.swagger-ui .w-100-m{width:100%}.swagger-ui .w-third-m{width:33.33333%}.swagger-ui .w-two-thirds-m{width:66.66667%}.swagger-ui .w-auto-m{width:auto}}@media screen and (min-width:60em){.swagger-ui .w1-l{width:1rem}.swagger-ui .w2-l{width:2rem}.swagger-ui .w3-l{width:4rem}.swagger-ui .w4-l{width:8rem}.swagger-ui .w5-l{width:16rem}.swagger-ui .w-10-l{width:10%}.swagger-ui .w-20-l{width:20%}.swagger-ui .w-25-l{width:25%}.swagger-ui .w-30-l{width:30%}.swagger-ui .w-33-l{width:33%}.swagger-ui .w-34-l{width:34%}.swagger-ui .w-40-l{width:40%}.swagger-ui .w-50-l{width:50%}.swagger-ui .w-60-l{width:60%}.swagger-ui .w-70-l{width:70%}.swagger-ui .w-75-l{width:75%}.swagger-ui .w-80-l{width:80%}.swagger-ui .w-90-l{width:90%}.swagger-ui .w-100-l{width:100%}.swagger-ui .w-third-l{width:33.33333%}.swagger-ui .w-two-thirds-l{width:66.66667%}.swagger-ui .w-auto-l{width:auto}}.swagger-ui .overflow-visible{overflow:visible}.swagger-ui .overflow-hidden{overflow:hidden}.swagger-ui .overflow-scroll{overflow:scroll}.swagger-ui .overflow-auto{overflow:auto}.swagger-ui .overflow-x-visible{overflow-x:visible}.swagger-ui .overflow-x-hidden{overflow-x:hidden}.swagger-ui .overflow-x-scroll{overflow-x:scroll}.swagger-ui .overflow-x-auto{overflow-x:auto}.swagger-ui .overflow-y-visible{overflow-y:visible}.swagger-ui .overflow-y-hidden{overflow-y:hidden}.swagger-ui .overflow-y-scroll{overflow-y:scroll}.swagger-ui .overflow-y-auto{overflow-y:auto}@media screen and (min-width:30em){.swagger-ui .overflow-visible-ns{overflow:visible}.swagger-ui .overflow-hidden-ns{overflow:hidden}.swagger-ui .overflow-scroll-ns{overflow:scroll}.swagger-ui .overflow-auto-ns{overflow:auto}.swagger-ui .overflow-x-visible-ns{overflow-x:visible}.swagger-ui .overflow-x-hidden-ns{overflow-x:hidden}.swagger-ui .overflow-x-scroll-ns{overflow-x:scroll}.swagger-ui .overflow-x-auto-ns{overflow-x:auto}.swagger-ui .overflow-y-visible-ns{overflow-y:visible}.swagger-ui .overflow-y-hidden-ns{overflow-y:hidden}.swagger-ui .overflow-y-scroll-ns{overflow-y:scroll}.swagger-ui .overflow-y-auto-ns{overflow-y:auto}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .overflow-visible-m{overflow:visible}.swagger-ui .overflow-hidden-m{overflow:hidden}.swagger-ui .overflow-scroll-m{overflow:scroll}.swagger-ui .overflow-auto-m{overflow:auto}.swagger-ui .overflow-x-visible-m{overflow-x:visible}.swagger-ui .overflow-x-hidden-m{overflow-x:hidden}.swagger-ui .overflow-x-scroll-m{overflow-x:scroll}.swagger-ui .overflow-x-auto-m{overflow-x:auto}.swagger-ui .overflow-y-visible-m{overflow-y:visible}.swagger-ui .overflow-y-hidden-m{overflow-y:hidden}.swagger-ui .overflow-y-scroll-m{overflow-y:scroll}.swagger-ui .overflow-y-auto-m{overflow-y:auto}}@media screen and (min-width:60em){.swagger-ui .overflow-visible-l{overflow:visible}.swagger-ui .overflow-hidden-l{overflow:hidden}.swagger-ui .overflow-scroll-l{overflow:scroll}.swagger-ui .overflow-auto-l{overflow:auto}.swagger-ui .overflow-x-visible-l{overflow-x:visible}.swagger-ui .overflow-x-hidden-l{overflow-x:hidden}.swagger-ui .overflow-x-scroll-l{overflow-x:scroll}.swagger-ui .overflow-x-auto-l{overflow-x:auto}.swagger-ui .overflow-y-visible-l{overflow-y:visible}.swagger-ui .overflow-y-hidden-l{overflow-y:hidden}.swagger-ui .overflow-y-scroll-l{overflow-y:scroll}.swagger-ui .overflow-y-auto-l{overflow-y:auto}}.swagger-ui .static{position:static}.swagger-ui .relative{position:relative}.swagger-ui .absolute{position:absolute}.swagger-ui .fixed{position:fixed}@media screen and (min-width:30em){.swagger-ui .static-ns{position:static}.swagger-ui .relative-ns{position:relative}.swagger-ui .absolute-ns{position:absolute}.swagger-ui .fixed-ns{position:fixed}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .static-m{position:static}.swagger-ui .relative-m{position:relative}.swagger-ui .absolute-m{position:absolute}.swagger-ui .fixed-m{position:fixed}}@media screen and (min-width:60em){.swagger-ui .static-l{position:static}.swagger-ui .relative-l{position:relative}.swagger-ui .absolute-l{position:absolute}.swagger-ui .fixed-l{position:fixed}}.swagger-ui .o-100{opacity:1}.swagger-ui .o-90{opacity:.9}.swagger-ui .o-80{opacity:.8}.swagger-ui .o-70{opacity:.7}.swagger-ui .o-60{opacity:.6}.swagger-ui .o-50{opacity:.5}.swagger-ui .o-40{opacity:.4}.swagger-ui .o-30{opacity:.3}.swagger-ui .o-20{opacity:.2}.swagger-ui .o-10{opacity:.1}.swagger-ui .o-05{opacity:.05}.swagger-ui .o-025{opacity:.025}.swagger-ui .o-0{opacity:0}.swagger-ui .rotate-45{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swagger-ui .rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.swagger-ui .rotate-135{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.swagger-ui .rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.swagger-ui .rotate-225{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.swagger-ui .rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.swagger-ui .rotate-315{-webkit-transform:rotate(315deg);transform:rotate(315deg)}@media screen and (min-width:30em){.swagger-ui .rotate-45-ns{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swagger-ui .rotate-90-ns{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.swagger-ui .rotate-135-ns{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.swagger-ui .rotate-180-ns{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.swagger-ui .rotate-225-ns{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.swagger-ui .rotate-270-ns{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.swagger-ui .rotate-315-ns{-webkit-transform:rotate(315deg);transform:rotate(315deg)}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .rotate-45-m{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swagger-ui .rotate-90-m{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.swagger-ui .rotate-135-m{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.swagger-ui .rotate-180-m{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.swagger-ui .rotate-225-m{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.swagger-ui .rotate-270-m{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.swagger-ui .rotate-315-m{-webkit-transform:rotate(315deg);transform:rotate(315deg)}}@media screen and (min-width:60em){.swagger-ui .rotate-45-l{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swagger-ui .rotate-90-l{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.swagger-ui .rotate-135-l{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.swagger-ui .rotate-180-l{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.swagger-ui .rotate-225-l{-webkit-transform:rotate(225deg);transform:rotate(225deg)}.swagger-ui .rotate-270-l{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.swagger-ui .rotate-315-l{-webkit-transform:rotate(315deg);transform:rotate(315deg)}}.swagger-ui .black-90{color:rgba(0,0,0,.9)}.swagger-ui .black-80{color:rgba(0,0,0,.8)}.swagger-ui .black-70{color:rgba(0,0,0,.7)}.swagger-ui .black-60{color:rgba(0,0,0,.6)}.swagger-ui .black-50{color:rgba(0,0,0,.5)}.swagger-ui .black-40{color:rgba(0,0,0,.4)}.swagger-ui .black-30{color:rgba(0,0,0,.3)}.swagger-ui .black-20{color:rgba(0,0,0,.2)}.swagger-ui .black-10{color:rgba(0,0,0,.1)}.swagger-ui .black-05{color:rgba(0,0,0,.05)}.swagger-ui .white-90{color:hsla(0,0%,100%,.9)}.swagger-ui .white-80{color:hsla(0,0%,100%,.8)}.swagger-ui .white-70{color:hsla(0,0%,100%,.7)}.swagger-ui .white-60{color:hsla(0,0%,100%,.6)}.swagger-ui .white-50{color:hsla(0,0%,100%,.5)}.swagger-ui .white-40{color:hsla(0,0%,100%,.4)}.swagger-ui .white-30{color:hsla(0,0%,100%,.3)}.swagger-ui .white-20{color:hsla(0,0%,100%,.2)}.swagger-ui .white-10{color:hsla(0,0%,100%,.1)}.swagger-ui .black{color:#000}.swagger-ui .near-black{color:#111}.swagger-ui .dark-gray{color:#333}.swagger-ui .mid-gray{color:#555}.swagger-ui .gray{color:#777}.swagger-ui .silver{color:#999}.swagger-ui .light-silver{color:#aaa}.swagger-ui .moon-gray{color:#ccc}.swagger-ui .light-gray{color:#eee}.swagger-ui .near-white{color:#f4f4f4}.swagger-ui .white{color:#fff}.swagger-ui .dark-red{color:#e7040f}.swagger-ui .red{color:#ff4136}.swagger-ui .light-red{color:#ff725c}.swagger-ui .orange{color:#ff6300}.swagger-ui .gold{color:#ffb700}.swagger-ui .yellow{color:gold}.swagger-ui .light-yellow{color:#fbf1a9}.swagger-ui .purple{color:#5e2ca5}.swagger-ui .light-purple{color:#a463f2}.swagger-ui .dark-pink{color:#d5008f}.swagger-ui .hot-pink{color:#ff41b4}.swagger-ui .pink{color:#ff80cc}.swagger-ui .light-pink{color:#ffa3d7}.swagger-ui .dark-green{color:#137752}.swagger-ui .green{color:#19a974}.swagger-ui .light-green{color:#9eebcf}.swagger-ui .navy{color:#001b44}.swagger-ui .dark-blue{color:#00449e}.swagger-ui .blue{color:#357edd}.swagger-ui .light-blue{color:#96ccff}.swagger-ui .lightest-blue{color:#cdecff}.swagger-ui .washed-blue{color:#f6fffe}.swagger-ui .washed-green{color:#e8fdf5}.swagger-ui .washed-yellow{color:#fffceb}.swagger-ui .washed-red{color:#ffdfdf}.swagger-ui .color-inherit{color:inherit}.swagger-ui .bg-black-90{background-color:rgba(0,0,0,.9)}.swagger-ui .bg-black-80{background-color:rgba(0,0,0,.8)}.swagger-ui .bg-black-70{background-color:rgba(0,0,0,.7)}.swagger-ui .bg-black-60{background-color:rgba(0,0,0,.6)}.swagger-ui .bg-black-50{background-color:rgba(0,0,0,.5)}.swagger-ui .bg-black-40{background-color:rgba(0,0,0,.4)}.swagger-ui .bg-black-30{background-color:rgba(0,0,0,.3)}.swagger-ui .bg-black-20{background-color:rgba(0,0,0,.2)}.swagger-ui .bg-black-10{background-color:rgba(0,0,0,.1)}.swagger-ui .bg-black-05{background-color:rgba(0,0,0,.05)}.swagger-ui .bg-white-90{background-color:hsla(0,0%,100%,.9)}.swagger-ui .bg-white-80{background-color:hsla(0,0%,100%,.8)}.swagger-ui .bg-white-70{background-color:hsla(0,0%,100%,.7)}.swagger-ui .bg-white-60{background-color:hsla(0,0%,100%,.6)}.swagger-ui .bg-white-50{background-color:hsla(0,0%,100%,.5)}.swagger-ui .bg-white-40{background-color:hsla(0,0%,100%,.4)}.swagger-ui .bg-white-30{background-color:hsla(0,0%,100%,.3)}.swagger-ui .bg-white-20{background-color:hsla(0,0%,100%,.2)}.swagger-ui .bg-white-10{background-color:hsla(0,0%,100%,.1)}.swagger-ui .bg-black{background-color:#000}.swagger-ui .bg-near-black{background-color:#111}.swagger-ui .bg-dark-gray{background-color:#333}.swagger-ui .bg-mid-gray{background-color:#555}.swagger-ui .bg-gray{background-color:#777}.swagger-ui .bg-silver{background-color:#999}.swagger-ui .bg-light-silver{background-color:#aaa}.swagger-ui .bg-moon-gray{background-color:#ccc}.swagger-ui .bg-light-gray{background-color:#eee}.swagger-ui .bg-near-white{background-color:#f4f4f4}.swagger-ui .bg-white{background-color:#fff}.swagger-ui .bg-transparent{background-color:transparent}.swagger-ui .bg-dark-red{background-color:#e7040f}.swagger-ui .bg-red{background-color:#ff4136}.swagger-ui .bg-light-red{background-color:#ff725c}.swagger-ui .bg-orange{background-color:#ff6300}.swagger-ui .bg-gold{background-color:#ffb700}.swagger-ui .bg-yellow{background-color:gold}.swagger-ui .bg-light-yellow{background-color:#fbf1a9}.swagger-ui .bg-purple{background-color:#5e2ca5}.swagger-ui .bg-light-purple{background-color:#a463f2}.swagger-ui .bg-dark-pink{background-color:#d5008f}.swagger-ui .bg-hot-pink{background-color:#ff41b4}.swagger-ui .bg-pink{background-color:#ff80cc}.swagger-ui .bg-light-pink{background-color:#ffa3d7}.swagger-ui .bg-dark-green{background-color:#137752}.swagger-ui .bg-green{background-color:#19a974}.swagger-ui .bg-light-green{background-color:#9eebcf}.swagger-ui .bg-navy{background-color:#001b44}.swagger-ui .bg-dark-blue{background-color:#00449e}.swagger-ui .bg-blue{background-color:#357edd}.swagger-ui .bg-light-blue{background-color:#96ccff}.swagger-ui .bg-lightest-blue{background-color:#cdecff}.swagger-ui .bg-washed-blue{background-color:#f6fffe}.swagger-ui .bg-washed-green{background-color:#e8fdf5}.swagger-ui .bg-washed-yellow{background-color:#fffceb}.swagger-ui .bg-washed-red{background-color:#ffdfdf}.swagger-ui .bg-inherit{background-color:inherit}.swagger-ui .hover-black:focus,.swagger-ui .hover-black:hover{color:#000}.swagger-ui .hover-near-black:focus,.swagger-ui .hover-near-black:hover{color:#111}.swagger-ui .hover-dark-gray:focus,.swagger-ui .hover-dark-gray:hover{color:#333}.swagger-ui .hover-mid-gray:focus,.swagger-ui .hover-mid-gray:hover{color:#555}.swagger-ui .hover-gray:focus,.swagger-ui .hover-gray:hover{color:#777}.swagger-ui .hover-silver:focus,.swagger-ui .hover-silver:hover{color:#999}.swagger-ui .hover-light-silver:focus,.swagger-ui .hover-light-silver:hover{color:#aaa}.swagger-ui .hover-moon-gray:focus,.swagger-ui .hover-moon-gray:hover{color:#ccc}.swagger-ui .hover-light-gray:focus,.swagger-ui .hover-light-gray:hover{color:#eee}.swagger-ui .hover-near-white:focus,.swagger-ui .hover-near-white:hover{color:#f4f4f4}.swagger-ui .hover-white:focus,.swagger-ui .hover-white:hover{color:#fff}.swagger-ui .hover-black-90:focus,.swagger-ui .hover-black-90:hover{color:rgba(0,0,0,.9)}.swagger-ui .hover-black-80:focus,.swagger-ui .hover-black-80:hover{color:rgba(0,0,0,.8)}.swagger-ui .hover-black-70:focus,.swagger-ui .hover-black-70:hover{color:rgba(0,0,0,.7)}.swagger-ui .hover-black-60:focus,.swagger-ui .hover-black-60:hover{color:rgba(0,0,0,.6)}.swagger-ui .hover-black-50:focus,.swagger-ui .hover-black-50:hover{color:rgba(0,0,0,.5)}.swagger-ui .hover-black-40:focus,.swagger-ui .hover-black-40:hover{color:rgba(0,0,0,.4)}.swagger-ui .hover-black-30:focus,.swagger-ui .hover-black-30:hover{color:rgba(0,0,0,.3)}.swagger-ui .hover-black-20:focus,.swagger-ui .hover-black-20:hover{color:rgba(0,0,0,.2)}.swagger-ui .hover-black-10:focus,.swagger-ui .hover-black-10:hover{color:rgba(0,0,0,.1)}.swagger-ui .hover-white-90:focus,.swagger-ui .hover-white-90:hover{color:hsla(0,0%,100%,.9)}.swagger-ui .hover-white-80:focus,.swagger-ui .hover-white-80:hover{color:hsla(0,0%,100%,.8)}.swagger-ui .hover-white-70:focus,.swagger-ui .hover-white-70:hover{color:hsla(0,0%,100%,.7)}.swagger-ui .hover-white-60:focus,.swagger-ui .hover-white-60:hover{color:hsla(0,0%,100%,.6)}.swagger-ui .hover-white-50:focus,.swagger-ui .hover-white-50:hover{color:hsla(0,0%,100%,.5)}.swagger-ui .hover-white-40:focus,.swagger-ui .hover-white-40:hover{color:hsla(0,0%,100%,.4)}.swagger-ui .hover-white-30:focus,.swagger-ui .hover-white-30:hover{color:hsla(0,0%,100%,.3)}.swagger-ui .hover-white-20:focus,.swagger-ui .hover-white-20:hover{color:hsla(0,0%,100%,.2)}.swagger-ui .hover-white-10:focus,.swagger-ui .hover-white-10:hover{color:hsla(0,0%,100%,.1)}.swagger-ui .hover-inherit:focus,.swagger-ui .hover-inherit:hover{color:inherit}.swagger-ui .hover-bg-black:focus,.swagger-ui .hover-bg-black:hover{background-color:#000}.swagger-ui .hover-bg-near-black:focus,.swagger-ui .hover-bg-near-black:hover{background-color:#111}.swagger-ui .hover-bg-dark-gray:focus,.swagger-ui .hover-bg-dark-gray:hover{background-color:#333}.swagger-ui .hover-bg-mid-gray:focus,.swagger-ui .hover-bg-mid-gray:hover{background-color:#555}.swagger-ui .hover-bg-gray:focus,.swagger-ui .hover-bg-gray:hover{background-color:#777}.swagger-ui .hover-bg-silver:focus,.swagger-ui .hover-bg-silver:hover{background-color:#999}.swagger-ui .hover-bg-light-silver:focus,.swagger-ui .hover-bg-light-silver:hover{background-color:#aaa}.swagger-ui .hover-bg-moon-gray:focus,.swagger-ui .hover-bg-moon-gray:hover{background-color:#ccc}.swagger-ui .hover-bg-light-gray:focus,.swagger-ui .hover-bg-light-gray:hover{background-color:#eee}.swagger-ui .hover-bg-near-white:focus,.swagger-ui .hover-bg-near-white:hover{background-color:#f4f4f4}.swagger-ui .hover-bg-white:focus,.swagger-ui .hover-bg-white:hover{background-color:#fff}.swagger-ui .hover-bg-transparent:focus,.swagger-ui .hover-bg-transparent:hover{background-color:transparent}.swagger-ui .hover-bg-black-90:focus,.swagger-ui .hover-bg-black-90:hover{background-color:rgba(0,0,0,.9)}.swagger-ui .hover-bg-black-80:focus,.swagger-ui .hover-bg-black-80:hover{background-color:rgba(0,0,0,.8)}.swagger-ui .hover-bg-black-70:focus,.swagger-ui .hover-bg-black-70:hover{background-color:rgba(0,0,0,.7)}.swagger-ui .hover-bg-black-60:focus,.swagger-ui .hover-bg-black-60:hover{background-color:rgba(0,0,0,.6)}.swagger-ui .hover-bg-black-50:focus,.swagger-ui .hover-bg-black-50:hover{background-color:rgba(0,0,0,.5)}.swagger-ui .hover-bg-black-40:focus,.swagger-ui .hover-bg-black-40:hover{background-color:rgba(0,0,0,.4)}.swagger-ui .hover-bg-black-30:focus,.swagger-ui .hover-bg-black-30:hover{background-color:rgba(0,0,0,.3)}.swagger-ui .hover-bg-black-20:focus,.swagger-ui .hover-bg-black-20:hover{background-color:rgba(0,0,0,.2)}.swagger-ui .hover-bg-black-10:focus,.swagger-ui .hover-bg-black-10:hover{background-color:rgba(0,0,0,.1)}.swagger-ui .hover-bg-white-90:focus,.swagger-ui .hover-bg-white-90:hover{background-color:hsla(0,0%,100%,.9)}.swagger-ui .hover-bg-white-80:focus,.swagger-ui .hover-bg-white-80:hover{background-color:hsla(0,0%,100%,.8)}.swagger-ui .hover-bg-white-70:focus,.swagger-ui .hover-bg-white-70:hover{background-color:hsla(0,0%,100%,.7)}.swagger-ui .hover-bg-white-60:focus,.swagger-ui .hover-bg-white-60:hover{background-color:hsla(0,0%,100%,.6)}.swagger-ui .hover-bg-white-50:focus,.swagger-ui .hover-bg-white-50:hover{background-color:hsla(0,0%,100%,.5)}.swagger-ui .hover-bg-white-40:focus,.swagger-ui .hover-bg-white-40:hover{background-color:hsla(0,0%,100%,.4)}.swagger-ui .hover-bg-white-30:focus,.swagger-ui .hover-bg-white-30:hover{background-color:hsla(0,0%,100%,.3)}.swagger-ui .hover-bg-white-20:focus,.swagger-ui .hover-bg-white-20:hover{background-color:hsla(0,0%,100%,.2)}.swagger-ui .hover-bg-white-10:focus,.swagger-ui .hover-bg-white-10:hover{background-color:hsla(0,0%,100%,.1)}.swagger-ui .hover-dark-red:focus,.swagger-ui .hover-dark-red:hover{color:#e7040f}.swagger-ui .hover-red:focus,.swagger-ui .hover-red:hover{color:#ff4136}.swagger-ui .hover-light-red:focus,.swagger-ui .hover-light-red:hover{color:#ff725c}.swagger-ui .hover-orange:focus,.swagger-ui .hover-orange:hover{color:#ff6300}.swagger-ui .hover-gold:focus,.swagger-ui .hover-gold:hover{color:#ffb700}.swagger-ui .hover-yellow:focus,.swagger-ui .hover-yellow:hover{color:gold}.swagger-ui .hover-light-yellow:focus,.swagger-ui .hover-light-yellow:hover{color:#fbf1a9}.swagger-ui .hover-purple:focus,.swagger-ui .hover-purple:hover{color:#5e2ca5}.swagger-ui .hover-light-purple:focus,.swagger-ui .hover-light-purple:hover{color:#a463f2}.swagger-ui .hover-dark-pink:focus,.swagger-ui .hover-dark-pink:hover{color:#d5008f}.swagger-ui .hover-hot-pink:focus,.swagger-ui .hover-hot-pink:hover{color:#ff41b4}.swagger-ui .hover-pink:focus,.swagger-ui .hover-pink:hover{color:#ff80cc}.swagger-ui .hover-light-pink:focus,.swagger-ui .hover-light-pink:hover{color:#ffa3d7}.swagger-ui .hover-dark-green:focus,.swagger-ui .hover-dark-green:hover{color:#137752}.swagger-ui .hover-green:focus,.swagger-ui .hover-green:hover{color:#19a974}.swagger-ui .hover-light-green:focus,.swagger-ui .hover-light-green:hover{color:#9eebcf}.swagger-ui .hover-navy:focus,.swagger-ui .hover-navy:hover{color:#001b44}.swagger-ui .hover-dark-blue:focus,.swagger-ui .hover-dark-blue:hover{color:#00449e}.swagger-ui .hover-blue:focus,.swagger-ui .hover-blue:hover{color:#357edd}.swagger-ui .hover-light-blue:focus,.swagger-ui .hover-light-blue:hover{color:#96ccff}.swagger-ui .hover-lightest-blue:focus,.swagger-ui .hover-lightest-blue:hover{color:#cdecff}.swagger-ui .hover-washed-blue:focus,.swagger-ui .hover-washed-blue:hover{color:#f6fffe}.swagger-ui .hover-washed-green:focus,.swagger-ui .hover-washed-green:hover{color:#e8fdf5}.swagger-ui .hover-washed-yellow:focus,.swagger-ui .hover-washed-yellow:hover{color:#fffceb}.swagger-ui .hover-washed-red:focus,.swagger-ui .hover-washed-red:hover{color:#ffdfdf}.swagger-ui .hover-bg-dark-red:focus,.swagger-ui .hover-bg-dark-red:hover{background-color:#e7040f}.swagger-ui .hover-bg-red:focus,.swagger-ui .hover-bg-red:hover{background-color:#ff4136}.swagger-ui .hover-bg-light-red:focus,.swagger-ui .hover-bg-light-red:hover{background-color:#ff725c}.swagger-ui .hover-bg-orange:focus,.swagger-ui .hover-bg-orange:hover{background-color:#ff6300}.swagger-ui .hover-bg-gold:focus,.swagger-ui .hover-bg-gold:hover{background-color:#ffb700}.swagger-ui .hover-bg-yellow:focus,.swagger-ui .hover-bg-yellow:hover{background-color:gold}.swagger-ui .hover-bg-light-yellow:focus,.swagger-ui .hover-bg-light-yellow:hover{background-color:#fbf1a9}.swagger-ui .hover-bg-purple:focus,.swagger-ui .hover-bg-purple:hover{background-color:#5e2ca5}.swagger-ui .hover-bg-light-purple:focus,.swagger-ui .hover-bg-light-purple:hover{background-color:#a463f2}.swagger-ui .hover-bg-dark-pink:focus,.swagger-ui .hover-bg-dark-pink:hover{background-color:#d5008f}.swagger-ui .hover-bg-hot-pink:focus,.swagger-ui .hover-bg-hot-pink:hover{background-color:#ff41b4}.swagger-ui .hover-bg-pink:focus,.swagger-ui .hover-bg-pink:hover{background-color:#ff80cc}.swagger-ui .hover-bg-light-pink:focus,.swagger-ui .hover-bg-light-pink:hover{background-color:#ffa3d7}.swagger-ui .hover-bg-dark-green:focus,.swagger-ui .hover-bg-dark-green:hover{background-color:#137752}.swagger-ui .hover-bg-green:focus,.swagger-ui .hover-bg-green:hover{background-color:#19a974}.swagger-ui .hover-bg-light-green:focus,.swagger-ui .hover-bg-light-green:hover{background-color:#9eebcf}.swagger-ui .hover-bg-navy:focus,.swagger-ui .hover-bg-navy:hover{background-color:#001b44}.swagger-ui .hover-bg-dark-blue:focus,.swagger-ui .hover-bg-dark-blue:hover{background-color:#00449e}.swagger-ui .hover-bg-blue:focus,.swagger-ui .hover-bg-blue:hover{background-color:#357edd}.swagger-ui .hover-bg-light-blue:focus,.swagger-ui .hover-bg-light-blue:hover{background-color:#96ccff}.swagger-ui .hover-bg-lightest-blue:focus,.swagger-ui .hover-bg-lightest-blue:hover{background-color:#cdecff}.swagger-ui .hover-bg-washed-blue:focus,.swagger-ui .hover-bg-washed-blue:hover{background-color:#f6fffe}.swagger-ui .hover-bg-washed-green:focus,.swagger-ui .hover-bg-washed-green:hover{background-color:#e8fdf5}.swagger-ui .hover-bg-washed-yellow:focus,.swagger-ui .hover-bg-washed-yellow:hover{background-color:#fffceb}.swagger-ui .hover-bg-washed-red:focus,.swagger-ui .hover-bg-washed-red:hover{background-color:#ffdfdf}.swagger-ui .hover-bg-inherit:focus,.swagger-ui .hover-bg-inherit:hover{background-color:inherit}.swagger-ui .pa0{padding:0}.swagger-ui .pa1{padding:.25rem}.swagger-ui .pa2{padding:.5rem}.swagger-ui .pa3{padding:1rem}.swagger-ui .pa4{padding:2rem}.swagger-ui .pa5{padding:4rem}.swagger-ui .pa6{padding:8rem}.swagger-ui .pa7{padding:16rem}.swagger-ui .pl0{padding-left:0}.swagger-ui .pl1{padding-left:.25rem}.swagger-ui .pl2{padding-left:.5rem}.swagger-ui .pl3{padding-left:1rem}.swagger-ui .pl4{padding-left:2rem}.swagger-ui .pl5{padding-left:4rem}.swagger-ui .pl6{padding-left:8rem}.swagger-ui .pl7{padding-left:16rem}.swagger-ui .pr0{padding-right:0}.swagger-ui .pr1{padding-right:.25rem}.swagger-ui .pr2{padding-right:.5rem}.swagger-ui .pr3{padding-right:1rem}.swagger-ui .pr4{padding-right:2rem}.swagger-ui .pr5{padding-right:4rem}.swagger-ui .pr6{padding-right:8rem}.swagger-ui .pr7{padding-right:16rem}.swagger-ui .pb0{padding-bottom:0}.swagger-ui .pb1{padding-bottom:.25rem}.swagger-ui .pb2{padding-bottom:.5rem}.swagger-ui .pb3{padding-bottom:1rem}.swagger-ui .pb4{padding-bottom:2rem}.swagger-ui .pb5{padding-bottom:4rem}.swagger-ui .pb6{padding-bottom:8rem}.swagger-ui .pb7{padding-bottom:16rem}.swagger-ui .pt0{padding-top:0}.swagger-ui .pt1{padding-top:.25rem}.swagger-ui .pt2{padding-top:.5rem}.swagger-ui .pt3{padding-top:1rem}.swagger-ui .pt4{padding-top:2rem}.swagger-ui .pt5{padding-top:4rem}.swagger-ui .pt6{padding-top:8rem}.swagger-ui .pt7{padding-top:16rem}.swagger-ui .pv0{padding-top:0;padding-bottom:0}.swagger-ui .pv1{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0{padding-left:0;padding-right:0}.swagger-ui .ph1{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0{margin:0}.swagger-ui .ma1{margin:.25rem}.swagger-ui .ma2{margin:.5rem}.swagger-ui .ma3{margin:1rem}.swagger-ui .ma4{margin:2rem}.swagger-ui .ma5{margin:4rem}.swagger-ui .ma6{margin:8rem}.swagger-ui .ma7{margin:16rem}.swagger-ui .ml0{margin-left:0}.swagger-ui .ml1{margin-left:.25rem}.swagger-ui .ml2{margin-left:.5rem}.swagger-ui .ml3{margin-left:1rem}.swagger-ui .ml4{margin-left:2rem}.swagger-ui .ml5{margin-left:4rem}.swagger-ui .ml6{margin-left:8rem}.swagger-ui .ml7{margin-left:16rem}.swagger-ui .mr0{margin-right:0}.swagger-ui .mr1{margin-right:.25rem}.swagger-ui .mr2{margin-right:.5rem}.swagger-ui .mr3{margin-right:1rem}.swagger-ui .mr4{margin-right:2rem}.swagger-ui .mr5{margin-right:4rem}.swagger-ui .mr6{margin-right:8rem}.swagger-ui .mr7{margin-right:16rem}.swagger-ui .mb0{margin-bottom:0}.swagger-ui .mb1{margin-bottom:.25rem}.swagger-ui .mb2{margin-bottom:.5rem}.swagger-ui .mb3{margin-bottom:1rem}.swagger-ui .mb4{margin-bottom:2rem}.swagger-ui .mb5{margin-bottom:4rem}.swagger-ui .mb6{margin-bottom:8rem}.swagger-ui .mb7{margin-bottom:16rem}.swagger-ui .mt0{margin-top:0}.swagger-ui .mt1{margin-top:.25rem}.swagger-ui .mt2{margin-top:.5rem}.swagger-ui .mt3{margin-top:1rem}.swagger-ui .mt4{margin-top:2rem}.swagger-ui .mt5{margin-top:4rem}.swagger-ui .mt6{margin-top:8rem}.swagger-ui .mt7{margin-top:16rem}.swagger-ui .mv0{margin-top:0;margin-bottom:0}.swagger-ui .mv1{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0{margin-left:0;margin-right:0}.swagger-ui .mh1{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7{margin-left:16rem;margin-right:16rem}@media screen and (min-width:30em){.swagger-ui .pa0-ns{padding:0}.swagger-ui .pa1-ns{padding:.25rem}.swagger-ui .pa2-ns{padding:.5rem}.swagger-ui .pa3-ns{padding:1rem}.swagger-ui .pa4-ns{padding:2rem}.swagger-ui .pa5-ns{padding:4rem}.swagger-ui .pa6-ns{padding:8rem}.swagger-ui .pa7-ns{padding:16rem}.swagger-ui .pl0-ns{padding-left:0}.swagger-ui .pl1-ns{padding-left:.25rem}.swagger-ui .pl2-ns{padding-left:.5rem}.swagger-ui .pl3-ns{padding-left:1rem}.swagger-ui .pl4-ns{padding-left:2rem}.swagger-ui .pl5-ns{padding-left:4rem}.swagger-ui .pl6-ns{padding-left:8rem}.swagger-ui .pl7-ns{padding-left:16rem}.swagger-ui .pr0-ns{padding-right:0}.swagger-ui .pr1-ns{padding-right:.25rem}.swagger-ui .pr2-ns{padding-right:.5rem}.swagger-ui .pr3-ns{padding-right:1rem}.swagger-ui .pr4-ns{padding-right:2rem}.swagger-ui .pr5-ns{padding-right:4rem}.swagger-ui .pr6-ns{padding-right:8rem}.swagger-ui .pr7-ns{padding-right:16rem}.swagger-ui .pb0-ns{padding-bottom:0}.swagger-ui .pb1-ns{padding-bottom:.25rem}.swagger-ui .pb2-ns{padding-bottom:.5rem}.swagger-ui .pb3-ns{padding-bottom:1rem}.swagger-ui .pb4-ns{padding-bottom:2rem}.swagger-ui .pb5-ns{padding-bottom:4rem}.swagger-ui .pb6-ns{padding-bottom:8rem}.swagger-ui .pb7-ns{padding-bottom:16rem}.swagger-ui .pt0-ns{padding-top:0}.swagger-ui .pt1-ns{padding-top:.25rem}.swagger-ui .pt2-ns{padding-top:.5rem}.swagger-ui .pt3-ns{padding-top:1rem}.swagger-ui .pt4-ns{padding-top:2rem}.swagger-ui .pt5-ns{padding-top:4rem}.swagger-ui .pt6-ns{padding-top:8rem}.swagger-ui .pt7-ns{padding-top:16rem}.swagger-ui .pv0-ns{padding-top:0;padding-bottom:0}.swagger-ui .pv1-ns{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2-ns{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3-ns{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4-ns{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5-ns{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6-ns{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7-ns{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0-ns{padding-left:0;padding-right:0}.swagger-ui .ph1-ns{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-ns{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-ns{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-ns{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-ns{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-ns{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-ns{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-ns{margin:0}.swagger-ui .ma1-ns{margin:.25rem}.swagger-ui .ma2-ns{margin:.5rem}.swagger-ui .ma3-ns{margin:1rem}.swagger-ui .ma4-ns{margin:2rem}.swagger-ui .ma5-ns{margin:4rem}.swagger-ui .ma6-ns{margin:8rem}.swagger-ui .ma7-ns{margin:16rem}.swagger-ui .ml0-ns{margin-left:0}.swagger-ui .ml1-ns{margin-left:.25rem}.swagger-ui .ml2-ns{margin-left:.5rem}.swagger-ui .ml3-ns{margin-left:1rem}.swagger-ui .ml4-ns{margin-left:2rem}.swagger-ui .ml5-ns{margin-left:4rem}.swagger-ui .ml6-ns{margin-left:8rem}.swagger-ui .ml7-ns{margin-left:16rem}.swagger-ui .mr0-ns{margin-right:0}.swagger-ui .mr1-ns{margin-right:.25rem}.swagger-ui .mr2-ns{margin-right:.5rem}.swagger-ui .mr3-ns{margin-right:1rem}.swagger-ui .mr4-ns{margin-right:2rem}.swagger-ui .mr5-ns{margin-right:4rem}.swagger-ui .mr6-ns{margin-right:8rem}.swagger-ui .mr7-ns{margin-right:16rem}.swagger-ui .mb0-ns{margin-bottom:0}.swagger-ui .mb1-ns{margin-bottom:.25rem}.swagger-ui .mb2-ns{margin-bottom:.5rem}.swagger-ui .mb3-ns{margin-bottom:1rem}.swagger-ui .mb4-ns{margin-bottom:2rem}.swagger-ui .mb5-ns{margin-bottom:4rem}.swagger-ui .mb6-ns{margin-bottom:8rem}.swagger-ui .mb7-ns{margin-bottom:16rem}.swagger-ui .mt0-ns{margin-top:0}.swagger-ui .mt1-ns{margin-top:.25rem}.swagger-ui .mt2-ns{margin-top:.5rem}.swagger-ui .mt3-ns{margin-top:1rem}.swagger-ui .mt4-ns{margin-top:2rem}.swagger-ui .mt5-ns{margin-top:4rem}.swagger-ui .mt6-ns{margin-top:8rem}.swagger-ui .mt7-ns{margin-top:16rem}.swagger-ui .mv0-ns{margin-top:0;margin-bottom:0}.swagger-ui .mv1-ns{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2-ns{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3-ns{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4-ns{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5-ns{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6-ns{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7-ns{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0-ns{margin-left:0;margin-right:0}.swagger-ui .mh1-ns{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-ns{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-ns{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-ns{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-ns{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-ns{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-ns{margin-left:16rem;margin-right:16rem}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .pa0-m{padding:0}.swagger-ui .pa1-m{padding:.25rem}.swagger-ui .pa2-m{padding:.5rem}.swagger-ui .pa3-m{padding:1rem}.swagger-ui .pa4-m{padding:2rem}.swagger-ui .pa5-m{padding:4rem}.swagger-ui .pa6-m{padding:8rem}.swagger-ui .pa7-m{padding:16rem}.swagger-ui .pl0-m{padding-left:0}.swagger-ui .pl1-m{padding-left:.25rem}.swagger-ui .pl2-m{padding-left:.5rem}.swagger-ui .pl3-m{padding-left:1rem}.swagger-ui .pl4-m{padding-left:2rem}.swagger-ui .pl5-m{padding-left:4rem}.swagger-ui .pl6-m{padding-left:8rem}.swagger-ui .pl7-m{padding-left:16rem}.swagger-ui .pr0-m{padding-right:0}.swagger-ui .pr1-m{padding-right:.25rem}.swagger-ui .pr2-m{padding-right:.5rem}.swagger-ui .pr3-m{padding-right:1rem}.swagger-ui .pr4-m{padding-right:2rem}.swagger-ui .pr5-m{padding-right:4rem}.swagger-ui .pr6-m{padding-right:8rem}.swagger-ui .pr7-m{padding-right:16rem}.swagger-ui .pb0-m{padding-bottom:0}.swagger-ui .pb1-m{padding-bottom:.25rem}.swagger-ui .pb2-m{padding-bottom:.5rem}.swagger-ui .pb3-m{padding-bottom:1rem}.swagger-ui .pb4-m{padding-bottom:2rem}.swagger-ui .pb5-m{padding-bottom:4rem}.swagger-ui .pb6-m{padding-bottom:8rem}.swagger-ui .pb7-m{padding-bottom:16rem}.swagger-ui .pt0-m{padding-top:0}.swagger-ui .pt1-m{padding-top:.25rem}.swagger-ui .pt2-m{padding-top:.5rem}.swagger-ui .pt3-m{padding-top:1rem}.swagger-ui .pt4-m{padding-top:2rem}.swagger-ui .pt5-m{padding-top:4rem}.swagger-ui .pt6-m{padding-top:8rem}.swagger-ui .pt7-m{padding-top:16rem}.swagger-ui .pv0-m{padding-top:0;padding-bottom:0}.swagger-ui .pv1-m{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2-m{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3-m{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4-m{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5-m{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6-m{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7-m{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0-m{padding-left:0;padding-right:0}.swagger-ui .ph1-m{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-m{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-m{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-m{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-m{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-m{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-m{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-m{margin:0}.swagger-ui .ma1-m{margin:.25rem}.swagger-ui .ma2-m{margin:.5rem}.swagger-ui .ma3-m{margin:1rem}.swagger-ui .ma4-m{margin:2rem}.swagger-ui .ma5-m{margin:4rem}.swagger-ui .ma6-m{margin:8rem}.swagger-ui .ma7-m{margin:16rem}.swagger-ui .ml0-m{margin-left:0}.swagger-ui .ml1-m{margin-left:.25rem}.swagger-ui .ml2-m{margin-left:.5rem}.swagger-ui .ml3-m{margin-left:1rem}.swagger-ui .ml4-m{margin-left:2rem}.swagger-ui .ml5-m{margin-left:4rem}.swagger-ui .ml6-m{margin-left:8rem}.swagger-ui .ml7-m{margin-left:16rem}.swagger-ui .mr0-m{margin-right:0}.swagger-ui .mr1-m{margin-right:.25rem}.swagger-ui .mr2-m{margin-right:.5rem}.swagger-ui .mr3-m{margin-right:1rem}.swagger-ui .mr4-m{margin-right:2rem}.swagger-ui .mr5-m{margin-right:4rem}.swagger-ui .mr6-m{margin-right:8rem}.swagger-ui .mr7-m{margin-right:16rem}.swagger-ui .mb0-m{margin-bottom:0}.swagger-ui .mb1-m{margin-bottom:.25rem}.swagger-ui .mb2-m{margin-bottom:.5rem}.swagger-ui .mb3-m{margin-bottom:1rem}.swagger-ui .mb4-m{margin-bottom:2rem}.swagger-ui .mb5-m{margin-bottom:4rem}.swagger-ui .mb6-m{margin-bottom:8rem}.swagger-ui .mb7-m{margin-bottom:16rem}.swagger-ui .mt0-m{margin-top:0}.swagger-ui .mt1-m{margin-top:.25rem}.swagger-ui .mt2-m{margin-top:.5rem}.swagger-ui .mt3-m{margin-top:1rem}.swagger-ui .mt4-m{margin-top:2rem}.swagger-ui .mt5-m{margin-top:4rem}.swagger-ui .mt6-m{margin-top:8rem}.swagger-ui .mt7-m{margin-top:16rem}.swagger-ui .mv0-m{margin-top:0;margin-bottom:0}.swagger-ui .mv1-m{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2-m{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3-m{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4-m{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5-m{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6-m{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7-m{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0-m{margin-left:0;margin-right:0}.swagger-ui .mh1-m{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-m{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-m{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-m{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-m{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-m{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-m{margin-left:16rem;margin-right:16rem}}@media screen and (min-width:60em){.swagger-ui .pa0-l{padding:0}.swagger-ui .pa1-l{padding:.25rem}.swagger-ui .pa2-l{padding:.5rem}.swagger-ui .pa3-l{padding:1rem}.swagger-ui .pa4-l{padding:2rem}.swagger-ui .pa5-l{padding:4rem}.swagger-ui .pa6-l{padding:8rem}.swagger-ui .pa7-l{padding:16rem}.swagger-ui .pl0-l{padding-left:0}.swagger-ui .pl1-l{padding-left:.25rem}.swagger-ui .pl2-l{padding-left:.5rem}.swagger-ui .pl3-l{padding-left:1rem}.swagger-ui .pl4-l{padding-left:2rem}.swagger-ui .pl5-l{padding-left:4rem}.swagger-ui .pl6-l{padding-left:8rem}.swagger-ui .pl7-l{padding-left:16rem}.swagger-ui .pr0-l{padding-right:0}.swagger-ui .pr1-l{padding-right:.25rem}.swagger-ui .pr2-l{padding-right:.5rem}.swagger-ui .pr3-l{padding-right:1rem}.swagger-ui .pr4-l{padding-right:2rem}.swagger-ui .pr5-l{padding-right:4rem}.swagger-ui .pr6-l{padding-right:8rem}.swagger-ui .pr7-l{padding-right:16rem}.swagger-ui .pb0-l{padding-bottom:0}.swagger-ui .pb1-l{padding-bottom:.25rem}.swagger-ui .pb2-l{padding-bottom:.5rem}.swagger-ui .pb3-l{padding-bottom:1rem}.swagger-ui .pb4-l{padding-bottom:2rem}.swagger-ui .pb5-l{padding-bottom:4rem}.swagger-ui .pb6-l{padding-bottom:8rem}.swagger-ui .pb7-l{padding-bottom:16rem}.swagger-ui .pt0-l{padding-top:0}.swagger-ui .pt1-l{padding-top:.25rem}.swagger-ui .pt2-l{padding-top:.5rem}.swagger-ui .pt3-l{padding-top:1rem}.swagger-ui .pt4-l{padding-top:2rem}.swagger-ui .pt5-l{padding-top:4rem}.swagger-ui .pt6-l{padding-top:8rem}.swagger-ui .pt7-l{padding-top:16rem}.swagger-ui .pv0-l{padding-top:0;padding-bottom:0}.swagger-ui .pv1-l{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2-l{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3-l{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4-l{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5-l{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6-l{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7-l{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0-l{padding-left:0;padding-right:0}.swagger-ui .ph1-l{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-l{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-l{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-l{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-l{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-l{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-l{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-l{margin:0}.swagger-ui .ma1-l{margin:.25rem}.swagger-ui .ma2-l{margin:.5rem}.swagger-ui .ma3-l{margin:1rem}.swagger-ui .ma4-l{margin:2rem}.swagger-ui .ma5-l{margin:4rem}.swagger-ui .ma6-l{margin:8rem}.swagger-ui .ma7-l{margin:16rem}.swagger-ui .ml0-l{margin-left:0}.swagger-ui .ml1-l{margin-left:.25rem}.swagger-ui .ml2-l{margin-left:.5rem}.swagger-ui .ml3-l{margin-left:1rem}.swagger-ui .ml4-l{margin-left:2rem}.swagger-ui .ml5-l{margin-left:4rem}.swagger-ui .ml6-l{margin-left:8rem}.swagger-ui .ml7-l{margin-left:16rem}.swagger-ui .mr0-l{margin-right:0}.swagger-ui .mr1-l{margin-right:.25rem}.swagger-ui .mr2-l{margin-right:.5rem}.swagger-ui .mr3-l{margin-right:1rem}.swagger-ui .mr4-l{margin-right:2rem}.swagger-ui .mr5-l{margin-right:4rem}.swagger-ui .mr6-l{margin-right:8rem}.swagger-ui .mr7-l{margin-right:16rem}.swagger-ui .mb0-l{margin-bottom:0}.swagger-ui .mb1-l{margin-bottom:.25rem}.swagger-ui .mb2-l{margin-bottom:.5rem}.swagger-ui .mb3-l{margin-bottom:1rem}.swagger-ui .mb4-l{margin-bottom:2rem}.swagger-ui .mb5-l{margin-bottom:4rem}.swagger-ui .mb6-l{margin-bottom:8rem}.swagger-ui .mb7-l{margin-bottom:16rem}.swagger-ui .mt0-l{margin-top:0}.swagger-ui .mt1-l{margin-top:.25rem}.swagger-ui .mt2-l{margin-top:.5rem}.swagger-ui .mt3-l{margin-top:1rem}.swagger-ui .mt4-l{margin-top:2rem}.swagger-ui .mt5-l{margin-top:4rem}.swagger-ui .mt6-l{margin-top:8rem}.swagger-ui .mt7-l{margin-top:16rem}.swagger-ui .mv0-l{margin-top:0;margin-bottom:0}.swagger-ui .mv1-l{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2-l{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3-l{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4-l{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5-l{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6-l{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7-l{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0-l{margin-left:0;margin-right:0}.swagger-ui .mh1-l{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-l{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-l{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-l{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-l{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-l{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-l{margin-left:16rem;margin-right:16rem}}.swagger-ui .na1{margin:-.25rem}.swagger-ui .na2{margin:-.5rem}.swagger-ui .na3{margin:-1rem}.swagger-ui .na4{margin:-2rem}.swagger-ui .na5{margin:-4rem}.swagger-ui .na6{margin:-8rem}.swagger-ui .na7{margin:-16rem}.swagger-ui .nl1{margin-left:-.25rem}.swagger-ui .nl2{margin-left:-.5rem}.swagger-ui .nl3{margin-left:-1rem}.swagger-ui .nl4{margin-left:-2rem}.swagger-ui .nl5{margin-left:-4rem}.swagger-ui .nl6{margin-left:-8rem}.swagger-ui .nl7{margin-left:-16rem}.swagger-ui .nr1{margin-right:-.25rem}.swagger-ui .nr2{margin-right:-.5rem}.swagger-ui .nr3{margin-right:-1rem}.swagger-ui .nr4{margin-right:-2rem}.swagger-ui .nr5{margin-right:-4rem}.swagger-ui .nr6{margin-right:-8rem}.swagger-ui .nr7{margin-right:-16rem}.swagger-ui .nb1{margin-bottom:-.25rem}.swagger-ui .nb2{margin-bottom:-.5rem}.swagger-ui .nb3{margin-bottom:-1rem}.swagger-ui .nb4{margin-bottom:-2rem}.swagger-ui .nb5{margin-bottom:-4rem}.swagger-ui .nb6{margin-bottom:-8rem}.swagger-ui .nb7{margin-bottom:-16rem}.swagger-ui .nt1{margin-top:-.25rem}.swagger-ui .nt2{margin-top:-.5rem}.swagger-ui .nt3{margin-top:-1rem}.swagger-ui .nt4{margin-top:-2rem}.swagger-ui .nt5{margin-top:-4rem}.swagger-ui .nt6{margin-top:-8rem}.swagger-ui .nt7{margin-top:-16rem}@media screen and (min-width:30em){.swagger-ui .na1-ns{margin:-.25rem}.swagger-ui .na2-ns{margin:-.5rem}.swagger-ui .na3-ns{margin:-1rem}.swagger-ui .na4-ns{margin:-2rem}.swagger-ui .na5-ns{margin:-4rem}.swagger-ui .na6-ns{margin:-8rem}.swagger-ui .na7-ns{margin:-16rem}.swagger-ui .nl1-ns{margin-left:-.25rem}.swagger-ui .nl2-ns{margin-left:-.5rem}.swagger-ui .nl3-ns{margin-left:-1rem}.swagger-ui .nl4-ns{margin-left:-2rem}.swagger-ui .nl5-ns{margin-left:-4rem}.swagger-ui .nl6-ns{margin-left:-8rem}.swagger-ui .nl7-ns{margin-left:-16rem}.swagger-ui .nr1-ns{margin-right:-.25rem}.swagger-ui .nr2-ns{margin-right:-.5rem}.swagger-ui .nr3-ns{margin-right:-1rem}.swagger-ui .nr4-ns{margin-right:-2rem}.swagger-ui .nr5-ns{margin-right:-4rem}.swagger-ui .nr6-ns{margin-right:-8rem}.swagger-ui .nr7-ns{margin-right:-16rem}.swagger-ui .nb1-ns{margin-bottom:-.25rem}.swagger-ui .nb2-ns{margin-bottom:-.5rem}.swagger-ui .nb3-ns{margin-bottom:-1rem}.swagger-ui .nb4-ns{margin-bottom:-2rem}.swagger-ui .nb5-ns{margin-bottom:-4rem}.swagger-ui .nb6-ns{margin-bottom:-8rem}.swagger-ui .nb7-ns{margin-bottom:-16rem}.swagger-ui .nt1-ns{margin-top:-.25rem}.swagger-ui .nt2-ns{margin-top:-.5rem}.swagger-ui .nt3-ns{margin-top:-1rem}.swagger-ui .nt4-ns{margin-top:-2rem}.swagger-ui .nt5-ns{margin-top:-4rem}.swagger-ui .nt6-ns{margin-top:-8rem}.swagger-ui .nt7-ns{margin-top:-16rem}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .na1-m{margin:-.25rem}.swagger-ui .na2-m{margin:-.5rem}.swagger-ui .na3-m{margin:-1rem}.swagger-ui .na4-m{margin:-2rem}.swagger-ui .na5-m{margin:-4rem}.swagger-ui .na6-m{margin:-8rem}.swagger-ui .na7-m{margin:-16rem}.swagger-ui .nl1-m{margin-left:-.25rem}.swagger-ui .nl2-m{margin-left:-.5rem}.swagger-ui .nl3-m{margin-left:-1rem}.swagger-ui .nl4-m{margin-left:-2rem}.swagger-ui .nl5-m{margin-left:-4rem}.swagger-ui .nl6-m{margin-left:-8rem}.swagger-ui .nl7-m{margin-left:-16rem}.swagger-ui .nr1-m{margin-right:-.25rem}.swagger-ui .nr2-m{margin-right:-.5rem}.swagger-ui .nr3-m{margin-right:-1rem}.swagger-ui .nr4-m{margin-right:-2rem}.swagger-ui .nr5-m{margin-right:-4rem}.swagger-ui .nr6-m{margin-right:-8rem}.swagger-ui .nr7-m{margin-right:-16rem}.swagger-ui .nb1-m{margin-bottom:-.25rem}.swagger-ui .nb2-m{margin-bottom:-.5rem}.swagger-ui .nb3-m{margin-bottom:-1rem}.swagger-ui .nb4-m{margin-bottom:-2rem}.swagger-ui .nb5-m{margin-bottom:-4rem}.swagger-ui .nb6-m{margin-bottom:-8rem}.swagger-ui .nb7-m{margin-bottom:-16rem}.swagger-ui .nt1-m{margin-top:-.25rem}.swagger-ui .nt2-m{margin-top:-.5rem}.swagger-ui .nt3-m{margin-top:-1rem}.swagger-ui .nt4-m{margin-top:-2rem}.swagger-ui .nt5-m{margin-top:-4rem}.swagger-ui .nt6-m{margin-top:-8rem}.swagger-ui .nt7-m{margin-top:-16rem}}@media screen and (min-width:60em){.swagger-ui .na1-l{margin:-.25rem}.swagger-ui .na2-l{margin:-.5rem}.swagger-ui .na3-l{margin:-1rem}.swagger-ui .na4-l{margin:-2rem}.swagger-ui .na5-l{margin:-4rem}.swagger-ui .na6-l{margin:-8rem}.swagger-ui .na7-l{margin:-16rem}.swagger-ui .nl1-l{margin-left:-.25rem}.swagger-ui .nl2-l{margin-left:-.5rem}.swagger-ui .nl3-l{margin-left:-1rem}.swagger-ui .nl4-l{margin-left:-2rem}.swagger-ui .nl5-l{margin-left:-4rem}.swagger-ui .nl6-l{margin-left:-8rem}.swagger-ui .nl7-l{margin-left:-16rem}.swagger-ui .nr1-l{margin-right:-.25rem}.swagger-ui .nr2-l{margin-right:-.5rem}.swagger-ui .nr3-l{margin-right:-1rem}.swagger-ui .nr4-l{margin-right:-2rem}.swagger-ui .nr5-l{margin-right:-4rem}.swagger-ui .nr6-l{margin-right:-8rem}.swagger-ui .nr7-l{margin-right:-16rem}.swagger-ui .nb1-l{margin-bottom:-.25rem}.swagger-ui .nb2-l{margin-bottom:-.5rem}.swagger-ui .nb3-l{margin-bottom:-1rem}.swagger-ui .nb4-l{margin-bottom:-2rem}.swagger-ui .nb5-l{margin-bottom:-4rem}.swagger-ui .nb6-l{margin-bottom:-8rem}.swagger-ui .nb7-l{margin-bottom:-16rem}.swagger-ui .nt1-l{margin-top:-.25rem}.swagger-ui .nt2-l{margin-top:-.5rem}.swagger-ui .nt3-l{margin-top:-1rem}.swagger-ui .nt4-l{margin-top:-2rem}.swagger-ui .nt5-l{margin-top:-4rem}.swagger-ui .nt6-l{margin-top:-8rem}.swagger-ui .nt7-l{margin-top:-16rem}}.swagger-ui .collapse{border-collapse:collapse;border-spacing:0}.swagger-ui .striped--light-silver:nth-child(odd){background-color:#aaa}.swagger-ui .striped--moon-gray:nth-child(odd){background-color:#ccc}.swagger-ui .striped--light-gray:nth-child(odd){background-color:#eee}.swagger-ui .striped--near-white:nth-child(odd){background-color:#f4f4f4}.swagger-ui .stripe-light:nth-child(odd){background-color:hsla(0,0%,100%,.1)}.swagger-ui .stripe-dark:nth-child(odd){background-color:rgba(0,0,0,.1)}.swagger-ui .strike{text-decoration:line-through}.swagger-ui .underline{text-decoration:underline}.swagger-ui .no-underline{text-decoration:none}@media screen and (min-width:30em){.swagger-ui .strike-ns{text-decoration:line-through}.swagger-ui .underline-ns{text-decoration:underline}.swagger-ui .no-underline-ns{text-decoration:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .strike-m{text-decoration:line-through}.swagger-ui .underline-m{text-decoration:underline}.swagger-ui .no-underline-m{text-decoration:none}}@media screen and (min-width:60em){.swagger-ui .strike-l{text-decoration:line-through}.swagger-ui .underline-l{text-decoration:underline}.swagger-ui .no-underline-l{text-decoration:none}}.swagger-ui .tl{text-align:left}.swagger-ui .tr{text-align:right}.swagger-ui .tc{text-align:center}.swagger-ui .tj{text-align:justify}@media screen and (min-width:30em){.swagger-ui .tl-ns{text-align:left}.swagger-ui .tr-ns{text-align:right}.swagger-ui .tc-ns{text-align:center}.swagger-ui .tj-ns{text-align:justify}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .tl-m{text-align:left}.swagger-ui .tr-m{text-align:right}.swagger-ui .tc-m{text-align:center}.swagger-ui .tj-m{text-align:justify}}@media screen and (min-width:60em){.swagger-ui .tl-l{text-align:left}.swagger-ui .tr-l{text-align:right}.swagger-ui .tc-l{text-align:center}.swagger-ui .tj-l{text-align:justify}}.swagger-ui .ttc{text-transform:capitalize}.swagger-ui .ttl{text-transform:lowercase}.swagger-ui .ttu{text-transform:uppercase}.swagger-ui .ttn{text-transform:none}@media screen and (min-width:30em){.swagger-ui .ttc-ns{text-transform:capitalize}.swagger-ui .ttl-ns{text-transform:lowercase}.swagger-ui .ttu-ns{text-transform:uppercase}.swagger-ui .ttn-ns{text-transform:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .ttc-m{text-transform:capitalize}.swagger-ui .ttl-m{text-transform:lowercase}.swagger-ui .ttu-m{text-transform:uppercase}.swagger-ui .ttn-m{text-transform:none}}@media screen and (min-width:60em){.swagger-ui .ttc-l{text-transform:capitalize}.swagger-ui .ttl-l{text-transform:lowercase}.swagger-ui .ttu-l{text-transform:uppercase}.swagger-ui .ttn-l{text-transform:none}}.swagger-ui .f-6,.swagger-ui .f-headline{font-size:6rem}.swagger-ui .f-5,.swagger-ui .f-subheadline{font-size:5rem}.swagger-ui .f1{font-size:3rem}.swagger-ui .f2{font-size:2.25rem}.swagger-ui .f3{font-size:1.5rem}.swagger-ui .f4{font-size:1.25rem}.swagger-ui .f5{font-size:1rem}.swagger-ui .f6{font-size:.875rem}.swagger-ui .f7{font-size:.75rem}@media screen and (min-width:30em){.swagger-ui .f-6-ns,.swagger-ui .f-headline-ns{font-size:6rem}.swagger-ui .f-5-ns,.swagger-ui .f-subheadline-ns{font-size:5rem}.swagger-ui .f1-ns{font-size:3rem}.swagger-ui .f2-ns{font-size:2.25rem}.swagger-ui .f3-ns{font-size:1.5rem}.swagger-ui .f4-ns{font-size:1.25rem}.swagger-ui .f5-ns{font-size:1rem}.swagger-ui .f6-ns{font-size:.875rem}.swagger-ui .f7-ns{font-size:.75rem}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .f-6-m,.swagger-ui .f-headline-m{font-size:6rem}.swagger-ui .f-5-m,.swagger-ui .f-subheadline-m{font-size:5rem}.swagger-ui .f1-m{font-size:3rem}.swagger-ui .f2-m{font-size:2.25rem}.swagger-ui .f3-m{font-size:1.5rem}.swagger-ui .f4-m{font-size:1.25rem}.swagger-ui .f5-m{font-size:1rem}.swagger-ui .f6-m{font-size:.875rem}.swagger-ui .f7-m{font-size:.75rem}}@media screen and (min-width:60em){.swagger-ui .f-6-l,.swagger-ui .f-headline-l{font-size:6rem}.swagger-ui .f-5-l,.swagger-ui .f-subheadline-l{font-size:5rem}.swagger-ui .f1-l{font-size:3rem}.swagger-ui .f2-l{font-size:2.25rem}.swagger-ui .f3-l{font-size:1.5rem}.swagger-ui .f4-l{font-size:1.25rem}.swagger-ui .f5-l{font-size:1rem}.swagger-ui .f6-l{font-size:.875rem}.swagger-ui .f7-l{font-size:.75rem}}.swagger-ui .measure{max-width:30em}.swagger-ui .measure-wide{max-width:34em}.swagger-ui .measure-narrow{max-width:20em}.swagger-ui .indent{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps{font-variant:small-caps}.swagger-ui .truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media screen and (min-width:30em){.swagger-ui .measure-ns{max-width:30em}.swagger-ui .measure-wide-ns{max-width:34em}.swagger-ui .measure-narrow-ns{max-width:20em}.swagger-ui .indent-ns{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps-ns{font-variant:small-caps}.swagger-ui .truncate-ns{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .measure-m{max-width:30em}.swagger-ui .measure-wide-m{max-width:34em}.swagger-ui .measure-narrow-m{max-width:20em}.swagger-ui .indent-m{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps-m{font-variant:small-caps}.swagger-ui .truncate-m{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}@media screen and (min-width:60em){.swagger-ui .measure-l{max-width:30em}.swagger-ui .measure-wide-l{max-width:34em}.swagger-ui .measure-narrow-l{max-width:20em}.swagger-ui .indent-l{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps-l{font-variant:small-caps}.swagger-ui .truncate-l{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}.swagger-ui .overflow-container{overflow-y:scroll}.swagger-ui .center{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto{margin-right:auto}.swagger-ui .ml-auto{margin-left:auto}@media screen and (min-width:30em){.swagger-ui .center-ns{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto-ns{margin-right:auto}.swagger-ui .ml-auto-ns{margin-left:auto}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .center-m{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto-m{margin-right:auto}.swagger-ui .ml-auto-m{margin-left:auto}}@media screen and (min-width:60em){.swagger-ui .center-l{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto-l{margin-right:auto}.swagger-ui .ml-auto-l{margin-left:auto}}.swagger-ui .clip{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}@media screen and (min-width:30em){.swagger-ui .clip-ns{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .clip-m{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}@media screen and (min-width:60em){.swagger-ui .clip-l{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}.swagger-ui .ws-normal{white-space:normal}.swagger-ui .nowrap{white-space:nowrap}.swagger-ui .pre{white-space:pre}@media screen and (min-width:30em){.swagger-ui .ws-normal-ns{white-space:normal}.swagger-ui .nowrap-ns{white-space:nowrap}.swagger-ui .pre-ns{white-space:pre}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .ws-normal-m{white-space:normal}.swagger-ui .nowrap-m{white-space:nowrap}.swagger-ui .pre-m{white-space:pre}}@media screen and (min-width:60em){.swagger-ui .ws-normal-l{white-space:normal}.swagger-ui .nowrap-l{white-space:nowrap}.swagger-ui .pre-l{white-space:pre}}.swagger-ui .v-base{vertical-align:baseline}.swagger-ui .v-mid{vertical-align:middle}.swagger-ui .v-top{vertical-align:top}.swagger-ui .v-btm{vertical-align:bottom}@media screen and (min-width:30em){.swagger-ui .v-base-ns{vertical-align:baseline}.swagger-ui .v-mid-ns{vertical-align:middle}.swagger-ui .v-top-ns{vertical-align:top}.swagger-ui .v-btm-ns{vertical-align:bottom}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .v-base-m{vertical-align:baseline}.swagger-ui .v-mid-m{vertical-align:middle}.swagger-ui .v-top-m{vertical-align:top}.swagger-ui .v-btm-m{vertical-align:bottom}}@media screen and (min-width:60em){.swagger-ui .v-base-l{vertical-align:baseline}.swagger-ui .v-mid-l{vertical-align:middle}.swagger-ui .v-top-l{vertical-align:top}.swagger-ui .v-btm-l{vertical-align:bottom}}.swagger-ui .dim{opacity:1;transition:opacity .15s ease-in}.swagger-ui .dim:focus,.swagger-ui .dim:hover{opacity:.5;transition:opacity .15s ease-in}.swagger-ui .dim:active{opacity:.8;transition:opacity .15s ease-out}.swagger-ui .glow{transition:opacity .15s ease-in}.swagger-ui .glow:focus,.swagger-ui .glow:hover{opacity:1;transition:opacity .15s ease-in}.swagger-ui .hide-child .child{opacity:0;transition:opacity .15s ease-in}.swagger-ui .hide-child:active .child,.swagger-ui .hide-child:focus .child,.swagger-ui .hide-child:hover .child{opacity:1;transition:opacity .15s ease-in}.swagger-ui .underline-hover:focus,.swagger-ui .underline-hover:hover{text-decoration:underline}.swagger-ui .grow{-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);transition:-webkit-transform .25s ease-out;transition:transform .25s ease-out;transition:transform .25s ease-out, -webkit-transform .25s ease-out}.swagger-ui .grow:focus,.swagger-ui .grow:hover{-webkit-transform:scale(1.05);transform:scale(1.05)}.swagger-ui .grow:active{-webkit-transform:scale(.9);transform:scale(.9)}.swagger-ui .grow-large{-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);transition:-webkit-transform .25s ease-in-out;transition:transform .25s ease-in-out;transition:transform .25s ease-in-out, -webkit-transform .25s ease-in-out}.swagger-ui .grow-large:focus,.swagger-ui .grow-large:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}.swagger-ui .grow-large:active{-webkit-transform:scale(.95);transform:scale(.95)}.swagger-ui .pointer:hover{cursor:pointer}.swagger-ui .shadow-hover{cursor:pointer;position:relative;transition:all .5s cubic-bezier(.165,.84,.44,1)}.swagger-ui .shadow-hover:after{content:"";box-shadow:0 0 16px 2px rgba(0,0,0,.2);border-radius:inherit;opacity:0;position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1;transition:opacity .5s cubic-bezier(.165,.84,.44,1)}.swagger-ui .shadow-hover:focus:after,.swagger-ui .shadow-hover:hover:after{opacity:1}.swagger-ui .bg-animate,.swagger-ui .bg-animate:focus,.swagger-ui .bg-animate:hover{transition:background-color .15s ease-in-out}.swagger-ui .z-0{z-index:0}.swagger-ui .z-1{z-index:1}.swagger-ui .z-2{z-index:2}.swagger-ui .z-3{z-index:3}.swagger-ui .z-4{z-index:4}.swagger-ui .z-5{z-index:5}.swagger-ui .z-999{z-index:999}.swagger-ui .z-9999{z-index:9999}.swagger-ui .z-max{z-index:2147483647}.swagger-ui .z-inherit{z-index:inherit}.swagger-ui .z-initial{z-index:auto}.swagger-ui .z-unset{z-index:unset}.swagger-ui .nested-copy-line-height ol,.swagger-ui .nested-copy-line-height p,.swagger-ui .nested-copy-line-height ul{line-height:1.5}.swagger-ui .nested-headline-line-height h1,.swagger-ui .nested-headline-line-height h2,.swagger-ui .nested-headline-line-height h3,.swagger-ui .nested-headline-line-height h4,.swagger-ui .nested-headline-line-height h5,.swagger-ui .nested-headline-line-height h6{line-height:1.25}.swagger-ui .nested-list-reset ol,.swagger-ui .nested-list-reset ul{padding-left:0;margin-left:0;list-style-type:none}.swagger-ui .nested-copy-indent p+p{text-indent:.1em;margin-top:0;margin-bottom:0}.swagger-ui .nested-copy-seperator p+p{margin-top:1.5em}.swagger-ui .nested-img img{width:100%;max-width:100%;display:block}.swagger-ui .nested-links a{color:#357edd;transition:color .15s ease-in}.swagger-ui .nested-links a:focus,.swagger-ui .nested-links a:hover{color:#96ccff;transition:color .15s ease-in}.swagger-ui .wrapper{width:100%;max-width:1460px;margin:0 auto;padding:0 20px;box-sizing:border-box}.swagger-ui .opblock-tag-section{display:flex;flex-direction:column}.swagger-ui .opblock-tag{display:flex;align-items:center;padding:10px 20px 10px 10px;cursor:pointer;transition:all .2s;border-bottom:1px solid rgba(59,65,81,.3)}.swagger-ui .opblock-tag:hover{background:rgba(0,0,0,.02)}.swagger-ui .opblock-tag{font-size:24px;margin:0 0 5px;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-tag.no-desc span{flex:1}.swagger-ui .opblock-tag svg{transition:all .4s}.swagger-ui .opblock-tag small{font-size:14px;font-weight:400;flex:1;padding:0 10px;font-family:sans-serif;color:#3b4151}.swagger-ui .parameter__type{font-size:12px;padding:5px 0;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .parameter-controls{margin-top:.75em}.swagger-ui .examples__title{display:block;font-size:1.1em;font-weight:700;margin-bottom:.75em}.swagger-ui .examples__section{margin-top:1.5em}.swagger-ui .examples__section-header{font-weight:700;font-size:.9rem;margin-bottom:.5rem}.swagger-ui .examples-select{margin-bottom:.75em}.swagger-ui .examples-select__section-label{font-weight:700;font-size:.9rem;margin-right:.5rem}.swagger-ui .example__section{margin-top:1.5em}.swagger-ui .example__section-header{font-weight:700;font-size:.9rem;margin-bottom:.5rem}.swagger-ui .view-line-link{position:relative;top:3px;width:20px;margin:0 5px;cursor:pointer;transition:all .5s}.swagger-ui .opblock{margin:0 0 15px;border:1px solid #000;border-radius:4px;box-shadow:0 0 3px rgba(0,0,0,.19)}.swagger-ui .opblock .tab-header{display:flex;flex:1}.swagger-ui .opblock .tab-header .tab-item{padding:0 40px;cursor:pointer}.swagger-ui .opblock .tab-header .tab-item:first-of-type{padding:0 40px 0 0}.swagger-ui .opblock .tab-header .tab-item.active h4 span{position:relative}.swagger-ui .opblock .tab-header .tab-item.active h4 span:after{position:absolute;bottom:-15px;left:50%;width:120%;height:4px;content:"";-webkit-transform:translateX(-50%);transform:translateX(-50%);background:grey}.swagger-ui .opblock.is-open .opblock-summary{border-bottom:1px solid #000}.swagger-ui .opblock .opblock-section-header{display:flex;align-items:center;padding:8px 20px;min-height:50px;background:hsla(0,0%,100%,.8);box-shadow:0 1px 2px rgba(0,0,0,.1)}.swagger-ui .opblock .opblock-section-header>label{font-size:12px;font-weight:700;display:flex;align-items:center;margin:0 0 0 auto;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-section-header>label>span{padding:0 10px 0 0}.swagger-ui .opblock .opblock-section-header h4{font-size:14px;flex:1;margin:0;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-summary-method{font-size:14px;font-weight:700;min-width:80px;padding:6px 15px;text-align:center;border-radius:3px;background:#000;text-shadow:0 1px 0 rgba(0,0,0,.1);font-family:sans-serif;color:#fff}.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{font-size:16px;display:flex;align-items:center;word-break:break-word;padding:0 10px;font-family:monospace;font-weight:600;color:#3b4151}@media (max-width:768px){.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{font-size:12px}}.swagger-ui .opblock .opblock-summary-path__deprecated{text-decoration:line-through}.swagger-ui .opblock .opblock-summary-operation-id{font-size:14px}.swagger-ui .opblock .opblock-summary-description{font-size:13px;flex:1 1 auto;word-break:break-word;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-summary{display:flex;align-items:center;padding:5px;cursor:pointer}.swagger-ui .opblock .opblock-summary .view-line-link{position:relative;top:2px;width:0;margin:0;cursor:pointer;transition:all .5s}.swagger-ui .opblock .opblock-summary:hover .view-line-link{width:18px;margin:0 5px}.swagger-ui .opblock.opblock-post{border-color:#49cc90;background:rgba(73,204,144,.1)}.swagger-ui .opblock.opblock-post .opblock-summary-method{background:#49cc90}.swagger-ui .opblock.opblock-post .opblock-summary{border-color:#49cc90}.swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span:after{background:#49cc90}.swagger-ui .opblock.opblock-put{border-color:#fca130;background:rgba(252,161,48,.1)}.swagger-ui .opblock.opblock-put .opblock-summary-method{background:#fca130}.swagger-ui .opblock.opblock-put .opblock-summary{border-color:#fca130}.swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span:after{background:#fca130}.swagger-ui .opblock.opblock-delete{border-color:#f93e3e;background:rgba(249,62,62,.1)}.swagger-ui .opblock.opblock-delete .opblock-summary-method{background:#f93e3e}.swagger-ui .opblock.opblock-delete .opblock-summary{border-color:#f93e3e}.swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span:after{background:#f93e3e}.swagger-ui .opblock.opblock-get{border-color:#61affe;background:rgba(97,175,254,.1)}.swagger-ui .opblock.opblock-get .opblock-summary-method{background:#61affe}.swagger-ui .opblock.opblock-get .opblock-summary{border-color:#61affe}.swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span:after{background:#61affe}.swagger-ui .opblock.opblock-patch{border-color:#50e3c2;background:rgba(80,227,194,.1)}.swagger-ui .opblock.opblock-patch .opblock-summary-method{background:#50e3c2}.swagger-ui .opblock.opblock-patch .opblock-summary{border-color:#50e3c2}.swagger-ui .opblock.opblock-patch .tab-header .tab-item.active h4 span:after{background:#50e3c2}.swagger-ui .opblock.opblock-head{border-color:#9012fe;background:rgba(144,18,254,.1)}.swagger-ui .opblock.opblock-head .opblock-summary-method{background:#9012fe}.swagger-ui .opblock.opblock-head .opblock-summary{border-color:#9012fe}.swagger-ui .opblock.opblock-head .tab-header .tab-item.active h4 span:after{background:#9012fe}.swagger-ui .opblock.opblock-options{border-color:#0d5aa7;background:rgba(13,90,167,.1)}.swagger-ui .opblock.opblock-options .opblock-summary-method{background:#0d5aa7}.swagger-ui .opblock.opblock-options .opblock-summary{border-color:#0d5aa7}.swagger-ui .opblock.opblock-options .tab-header .tab-item.active h4 span:after{background:#0d5aa7}.swagger-ui .opblock.opblock-deprecated{opacity:.6;border-color:#ebebeb;background:hsla(0,0%,92.2%,.1)}.swagger-ui .opblock.opblock-deprecated .opblock-summary-method{background:#ebebeb}.swagger-ui .opblock.opblock-deprecated .opblock-summary{border-color:#ebebeb}.swagger-ui .opblock.opblock-deprecated .tab-header .tab-item.active h4 span:after{background:#ebebeb}.swagger-ui .opblock .opblock-schemes{padding:8px 20px}.swagger-ui .opblock .opblock-schemes .schemes-title{padding:0 10px 0 0}.swagger-ui .filter .operation-filter-input{width:100%;margin:20px 0;padding:10px;border:2px solid #d8dde7}.swagger-ui .model-example{margin-top:1em}.swagger-ui .tab{display:flex;padding:0;list-style:none}.swagger-ui .tab li{font-size:12px;min-width:60px;padding:0;cursor:pointer;font-family:sans-serif;color:#3b4151}.swagger-ui .tab li:first-of-type{position:relative;padding-left:0;padding-right:12px}.swagger-ui .tab li:first-of-type:after{position:absolute;top:0;right:6px;width:1px;height:100%;content:"";background:rgba(0,0,0,.2)}.swagger-ui .tab li.active{font-weight:700}.swagger-ui .opblock-description-wrapper,.swagger-ui .opblock-external-docs-wrapper,.swagger-ui .opblock-title_normal{font-size:12px;margin:0 0 5px;padding:15px 20px;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-description-wrapper h4,.swagger-ui .opblock-external-docs-wrapper h4,.swagger-ui .opblock-title_normal h4{font-size:12px;margin:0 0 5px;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-description-wrapper p,.swagger-ui .opblock-external-docs-wrapper p,.swagger-ui .opblock-title_normal p{font-size:14px;margin:0;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-external-docs-wrapper h4{padding-left:0}.swagger-ui .execute-wrapper{padding:20px;text-align:right}.swagger-ui .execute-wrapper .btn{width:100%;padding:8px 40px}.swagger-ui .body-param-options{display:flex;flex-direction:column}.swagger-ui .body-param-options .body-param-edit{padding:10px 0}.swagger-ui .body-param-options label{padding:8px 0}.swagger-ui .body-param-options label select{margin:3px 0 0}.swagger-ui .responses-inner{padding:20px}.swagger-ui .responses-inner h4,.swagger-ui .responses-inner h5{font-size:12px;margin:10px 0 5px;font-family:sans-serif;color:#3b4151}.swagger-ui .response-col_status{font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .response-col_status .response-undocumented{font-size:11px;font-family:monospace;font-weight:600;color:#909090}.swagger-ui .response-col_links{padding-left:2em;max-width:40em;font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .response-col_links .response-undocumented{font-size:11px;font-family:monospace;font-weight:600;color:#909090}.swagger-ui .opblock-body .opblock-loading-animation{display:block;margin:3em auto}.swagger-ui .opblock-body pre.microlight{font-size:12px;margin:0;padding:10px;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;border-radius:4px;background:#41444e;overflow-wrap:break-word;font-family:monospace;font-weight:600;color:#fff}.swagger-ui .opblock-body pre.microlight span{color:#fff!important}.swagger-ui .opblock-body pre.microlight .headerline{display:block}.swagger-ui .highlight-code{position:relative}.swagger-ui .highlight-code>.microlight{overflow-y:auto;max-height:400px;min-height:6em}.swagger-ui .download-contents{position:absolute;bottom:10px;right:10px;cursor:pointer;background:#7d8293;text-align:center;padding:5px;border-radius:4px;font-family:sans-serif;font-weight:600;color:#fff;font-size:14px;height:30px;width:75px}.swagger-ui .scheme-container{margin:0 0 20px;padding:30px 0;background:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.15)}.swagger-ui .scheme-container .schemes{display:flex;align-items:flex-end}.swagger-ui .scheme-container .schemes>label{font-size:12px;font-weight:700;display:flex;flex-direction:column;margin:-20px 15px 0 0;font-family:sans-serif;color:#3b4151}.swagger-ui .scheme-container .schemes>label select{min-width:130px;text-transform:uppercase}.swagger-ui .loading-container{padding:40px 0 60px;margin-top:1em;min-height:1px;display:flex;justify-content:center;align-items:center;flex-direction:column}.swagger-ui .loading-container .loading{position:relative}.swagger-ui .loading-container .loading:after{font-size:10px;font-weight:700;position:absolute;top:50%;left:50%;content:"loading";-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-transform:uppercase;font-family:sans-serif;color:#3b4151}.swagger-ui .loading-container .loading:before{position:absolute;top:50%;left:50%;display:block;width:60px;height:60px;margin:-30px;content:"";-webkit-animation:rotation 1s linear infinite,opacity .5s;animation:rotation 1s linear infinite,opacity .5s;opacity:1;border:2px solid rgba(85,85,85,.1);border-top-color:rgba(0,0,0,.6);border-radius:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden}@-webkit-keyframes rotation{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotation{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.swagger-ui .response-controls{padding-top:1em;display:flex}.swagger-ui .response-control-media-type{margin-right:1em}.swagger-ui .response-control-media-type--accept-controller select{border-color:green}.swagger-ui .response-control-media-type__accept-message{color:green;font-size:.7em}.swagger-ui .response-control-examples__title,.swagger-ui .response-control-media-type__title{display:block;margin-bottom:.2em;font-size:.7em}@-webkit-keyframes blinker{50%{opacity:0}}@keyframes blinker{50%{opacity:0}}.swagger-ui section h3{font-family:sans-serif;color:#3b4151}.swagger-ui a.nostyle{display:inline}.swagger-ui a.nostyle,.swagger-ui a.nostyle:visited{text-decoration:inherit;color:inherit;cursor:pointer}.swagger-ui .version-pragma{height:100%;padding:5em 0}.swagger-ui .version-pragma__message{display:flex;justify-content:center;height:100%;font-size:1.2em;text-align:center;line-height:1.5em;padding:0 .6em}.swagger-ui .version-pragma__message>div{max-width:55ch;flex:1}.swagger-ui .version-pragma__message code{background-color:#dedede;padding:4px 4px 2px;white-space:pre}.swagger-ui .btn{font-size:14px;font-weight:700;padding:5px 23px;transition:all .3s;border:2px solid grey;border-radius:4px;background:transparent;box-shadow:0 1px 2px rgba(0,0,0,.1);font-family:sans-serif;color:#3b4151}.swagger-ui .btn.btn-sm{font-size:12px;padding:4px 23px}.swagger-ui .btn[disabled]{cursor:not-allowed;opacity:.3}.swagger-ui .btn:hover{box-shadow:0 0 5px rgba(0,0,0,.3)}.swagger-ui .btn.cancel{border-color:#ff6060;background-color:transparent;font-family:sans-serif;color:#ff6060}.swagger-ui .btn.authorize{line-height:1;display:inline;color:#49cc90;border-color:#49cc90;background-color:transparent}.swagger-ui .btn.authorize span{float:left;padding:4px 20px 0 0}.swagger-ui .btn.authorize svg{fill:#49cc90}.swagger-ui .btn.execute{background-color:#4990e2;color:#fff;border-color:#4990e2}.swagger-ui .btn-group{display:flex;padding:30px}.swagger-ui .btn-group .btn{flex:1}.swagger-ui .btn-group .btn:first-child{border-radius:4px 0 0 4px}.swagger-ui .btn-group .btn:last-child{border-radius:0 4px 4px 0}.swagger-ui .authorization__btn{padding:0 10px;border:none;background:none}.swagger-ui .authorization__btn.locked{opacity:1}.swagger-ui .authorization__btn.unlocked{opacity:.4}.swagger-ui .expand-methods,.swagger-ui .expand-operation{border:none;background:none}.swagger-ui .expand-methods svg,.swagger-ui .expand-operation svg{width:20px;height:20px}.swagger-ui .expand-methods{padding:0 10px}.swagger-ui .expand-methods:hover svg{fill:#404040}.swagger-ui .expand-methods svg{transition:all .3s;fill:#707070}.swagger-ui button{cursor:pointer;outline:none}.swagger-ui button.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui select{font-size:14px;font-weight:700;padding:5px 40px 5px 10px;border:2px solid #41444e;border-radius:4px;background:#f7f7f7 url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZD0iTTEzLjQxOCA3Ljg1OWEuNjk1LjY5NSAwIDAxLjk3OCAwIC42OC42OCAwIDAxMCAuOTY5bC0zLjkwOCAzLjgzYS42OTcuNjk3IDAgMDEtLjk3OSAwbC0zLjkwOC0zLjgzYS42OC42OCAwIDAxMC0uOTY5LjY5NS42OTUgMCAwMS45NzggMEwxMCAxMWwzLjQxOC0zLjE0MXoiLz48L3N2Zz4=) right 10px center no-repeat;background-size:20px;box-shadow:0 1px 2px 0 rgba(0,0,0,.25);font-family:sans-serif;color:#3b4151;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swagger-ui select[multiple]{margin:5px 0;padding:5px;background:#f7f7f7}.swagger-ui select.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui .opblock-body select{min-width:230px}@media (max-width:768px){.swagger-ui .opblock-body select{min-width:180px}}.swagger-ui label{font-size:12px;font-weight:700;margin:0 0 5px;font-family:sans-serif;color:#3b4151}.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text],.swagger-ui textarea{min-width:100px;margin:5px 0;padding:8px 10px;border:1px solid #d9d9d9;border-radius:4px;background:#fff}@media (max-width:768px){.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text],.swagger-ui textarea{max-width:175px}}.swagger-ui input[type=email].invalid,.swagger-ui input[type=file].invalid,.swagger-ui input[type=password].invalid,.swagger-ui input[type=search].invalid,.swagger-ui input[type=text].invalid,.swagger-ui textarea.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui input[disabled],.swagger-ui select[disabled],.swagger-ui textarea[disabled]{background-color:#fafafa;color:#888;cursor:not-allowed}.swagger-ui select[disabled]{border-color:#888}.swagger-ui textarea[disabled]{background-color:#41444e;color:#fff}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-4px,0,0);transform:translate3d(-4px,0,0)}40%,60%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}}@keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-4px,0,0);transform:translate3d(-4px,0,0)}40%,60%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}}.swagger-ui textarea{font-size:12px;width:100%;min-height:280px;padding:10px;border:none;border-radius:4px;outline:none;background:hsla(0,0%,100%,.8);font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui textarea:focus{border:2px solid #61affe}.swagger-ui textarea.curl{font-size:12px;min-height:100px;margin:0;padding:10px;resize:none;border-radius:4px;background:#41444e;font-family:monospace;font-weight:600;color:#fff}.swagger-ui .checkbox{padding:5px 0 10px;transition:opacity .5s;color:#303030}.swagger-ui .checkbox label{display:flex}.swagger-ui .checkbox p{font-weight:400!important;font-style:italic;margin:0!important;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .checkbox input[type=checkbox]{display:none}.swagger-ui .checkbox input[type=checkbox]+label>.item{position:relative;top:3px;display:inline-block;width:16px;height:16px;margin:0 8px 0 0;padding:5px;cursor:pointer;border-radius:1px;background:#e8e8e8;box-shadow:0 0 0 2px #e8e8e8;flex:none}.swagger-ui .checkbox input[type=checkbox]+label>.item:active{-webkit-transform:scale(.9);transform:scale(.9)}.swagger-ui .checkbox input[type=checkbox]:checked+label>.item{background:#e8e8e8 url("data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='8' viewBox='3 7 10 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2341474E' fill-rule='evenodd' d='M6.333 15L3 11.667l1.333-1.334 2 2L11.667 7 13 8.333z'/%3E%3C/svg%3E") 50% no-repeat}.swagger-ui .dialog-ux{position:fixed;z-index:9999;top:0;right:0;bottom:0;left:0}.swagger-ui .dialog-ux .backdrop-ux{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.8)}.swagger-ui .dialog-ux .modal-ux{position:absolute;z-index:9999;top:50%;left:50%;width:100%;min-width:300px;max-width:650px;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);border:1px solid #ebebeb;border-radius:4px;background:#fff;box-shadow:0 10px 30px 0 rgba(0,0,0,.2)}.swagger-ui .dialog-ux .modal-ux-content{overflow-y:auto;max-height:540px;padding:20px}.swagger-ui .dialog-ux .modal-ux-content p{font-size:12px;margin:0 0 5px;color:#41444e;font-family:sans-serif;color:#3b4151}.swagger-ui .dialog-ux .modal-ux-content h4{font-size:18px;font-weight:600;margin:15px 0 0;font-family:sans-serif;color:#3b4151}.swagger-ui .dialog-ux .modal-ux-header{display:flex;padding:12px 0;border-bottom:1px solid #ebebeb;align-items:center}.swagger-ui .dialog-ux .modal-ux-header .close-modal{padding:0 10px;border:none;background:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swagger-ui .dialog-ux .modal-ux-header h3{font-size:20px;font-weight:600;margin:0;padding:0 20px;flex:1;font-family:sans-serif;color:#3b4151}.swagger-ui .model{font-size:12px;font-weight:300;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .model .deprecated span,.swagger-ui .model .deprecated td{color:#a0a0a0!important}.swagger-ui .model .deprecated>td:first-of-type{text-decoration:line-through}.swagger-ui .model-toggle{font-size:10px;position:relative;top:6px;display:inline-block;margin:auto .3em;cursor:pointer;transition:-webkit-transform .15s ease-in;transition:transform .15s ease-in;transition:transform .15s ease-in, -webkit-transform .15s ease-in;-webkit-transform:rotate(90deg);transform:rotate(90deg);-webkit-transform-origin:50% 50%;transform-origin:50% 50%}.swagger-ui .model-toggle.collapsed{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.swagger-ui .model-toggle:after{display:block;width:20px;height:20px;content:"";background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E") 50% no-repeat;background-size:100%}.swagger-ui .model-jump-to-path{position:relative;cursor:pointer}.swagger-ui .model-jump-to-path .view-line-link{position:absolute;top:-.4em;cursor:pointer}.swagger-ui .model-title{position:relative}.swagger-ui .model-title:hover .model-hint{visibility:visible}.swagger-ui .model-hint{position:absolute;top:-1.8em;visibility:hidden;padding:.1em .5em;white-space:nowrap;color:#ebebeb;border-radius:4px;background:rgba(0,0,0,.7)}.swagger-ui .model p{margin:0 0 1em}.swagger-ui section.models{margin:30px 0;border:1px solid rgba(59,65,81,.3);border-radius:4px}.swagger-ui section.models.is-open{padding:0 0 20px}.swagger-ui section.models.is-open h4{margin:0 0 5px;border-bottom:1px solid rgba(59,65,81,.3)}.swagger-ui section.models h4{font-size:16px;display:flex;align-items:center;margin:0;padding:10px 20px 10px 10px;cursor:pointer;transition:all .2s;font-family:sans-serif;color:#606060}.swagger-ui section.models h4 svg{transition:all .4s}.swagger-ui section.models h4 span{flex:1}.swagger-ui section.models h4:hover{background:rgba(0,0,0,.02)}.swagger-ui section.models h5{font-size:16px;margin:0 0 10px;font-family:sans-serif;color:#707070}.swagger-ui section.models .model-jump-to-path{position:relative;top:5px}.swagger-ui section.models .model-container{margin:0 20px 15px;position:relative;transition:all .5s;border-radius:4px;background:rgba(0,0,0,.05)}.swagger-ui section.models .model-container:hover{background:rgba(0,0,0,.07)}.swagger-ui section.models .model-container:first-of-type{margin:20px}.swagger-ui section.models .model-container:last-of-type{margin:0 20px}.swagger-ui section.models .model-container .models-jump-to-path{position:absolute;top:8px;right:5px;opacity:.65}.swagger-ui section.models .model-box{background:none}.swagger-ui .model-box{padding:10px;display:inline-block;border-radius:4px;background:rgba(0,0,0,.1)}.swagger-ui .model-box .model-jump-to-path{position:relative;top:4px}.swagger-ui .model-box.deprecated{opacity:.5}.swagger-ui .model-title{font-size:16px;font-family:sans-serif;color:#505050}.swagger-ui .model-deprecated-warning{font-size:16px;font-weight:600;margin-right:1em;font-family:sans-serif;color:#f93e3e}.swagger-ui span>span.model .brace-close{padding:0 0 0 10px}.swagger-ui .prop-name{display:inline-block;margin-right:1em}.swagger-ui .prop-type{color:#55a}.swagger-ui .prop-enum{display:block}.swagger-ui .prop-format{color:#606060}.swagger-ui .servers>label{font-size:12px;margin:-20px 15px 0 0;font-family:sans-serif;color:#3b4151}.swagger-ui .servers>label select{min-width:130px;max-width:100%}.swagger-ui .servers h4.message{padding-bottom:2em}.swagger-ui .servers table tr{width:30em}.swagger-ui .servers table td{display:inline-block;max-width:15em;vertical-align:middle;padding-top:10px;padding-bottom:10px}.swagger-ui .servers table td:first-of-type{padding-right:2em}.swagger-ui .servers table td input{width:100%;height:100%}.swagger-ui .servers .computed-url{margin:2em 0}.swagger-ui .servers .computed-url code{display:inline-block;padding:4px;font-size:16px;margin:0 1em}.swagger-ui .servers-title{font-size:12px;font-weight:700}.swagger-ui .operation-servers h4.message{margin-bottom:2em}.swagger-ui table{width:100%;padding:0 10px;border-collapse:collapse}.swagger-ui table.model tbody tr td{padding:0;vertical-align:top}.swagger-ui table.model tbody tr td:first-of-type{width:174px;padding:0 0 0 2em}.swagger-ui table.headers td{font-size:12px;font-weight:300;vertical-align:middle;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui table tbody tr td{padding:10px 0 0;vertical-align:top}.swagger-ui table tbody tr td:first-of-type{max-width:20%;min-width:6em;padding:10px 0}.swagger-ui table thead tr td,.swagger-ui table thead tr th{font-size:12px;font-weight:700;padding:12px 0;text-align:left;border-bottom:1px solid rgba(59,65,81,.2);font-family:sans-serif;color:#3b4151}.swagger-ui .parameters-col_description{width:99%;margin-bottom:2em}.swagger-ui .parameters-col_description input[type=text]{width:100%;max-width:340px}.swagger-ui .parameters-col_description select{border-width:1px}.swagger-ui .parameter__name{font-size:16px;font-weight:400;margin-right:.75em;font-family:sans-serif;color:#3b4151}.swagger-ui .parameter__name.required{font-weight:700}.swagger-ui .parameter__name.required:after{font-size:10px;position:relative;top:-6px;padding:5px;content:"required";color:rgba(255,0,0,.6)}.swagger-ui .parameter__extension,.swagger-ui .parameter__in{font-size:12px;font-style:italic;font-family:monospace;font-weight:600;color:grey}.swagger-ui .parameter__deprecated{font-size:12px;font-style:italic;font-family:monospace;font-weight:600;color:red}.swagger-ui .parameter__empty_value_toggle{font-size:13px;padding-top:5px;padding-bottom:12px}.swagger-ui .parameter__empty_value_toggle input{margin-right:7px}.swagger-ui .parameter__empty_value_toggle.disabled{opacity:.7}.swagger-ui .table-container{padding:20px}.swagger-ui .response-col_description{width:99%}.swagger-ui .response-col_links{min-width:6em}.swagger-ui .topbar{padding:10px 0;background-color:#1b1b1b}.swagger-ui .topbar .topbar-wrapper,.swagger-ui .topbar a{display:flex;align-items:center}.swagger-ui .topbar a{font-size:1.5em;font-weight:700;flex:1;max-width:300px;text-decoration:none;font-family:sans-serif;color:#fff}.swagger-ui .topbar a span{margin:0;padding:0 10px}.swagger-ui .topbar .download-url-wrapper{display:flex;flex:3;justify-content:flex-end}.swagger-ui .topbar .download-url-wrapper input[type=text]{width:100%;margin:0;border:2px solid #62a03f;border-radius:4px 0 0 4px;outline:none}.swagger-ui .topbar .download-url-wrapper .select-label{display:flex;align-items:center;width:100%;max-width:600px;margin:0;color:#f0f0f0}.swagger-ui .topbar .download-url-wrapper .select-label span{font-size:16px;flex:1;padding:0 10px 0 0;text-align:right}.swagger-ui .topbar .download-url-wrapper .select-label select{flex:2;width:100%;border:2px solid #62a03f;outline:none;box-shadow:none}.swagger-ui .topbar .download-url-wrapper .download-url-button{font-size:16px;font-weight:700;padding:4px 30px;border:none;border-radius:0 4px 4px 0;background:#62a03f;font-family:sans-serif;color:#fff}.swagger-ui .info{margin:50px 0}.swagger-ui .info hgroup.main{margin:0 0 20px}.swagger-ui .info hgroup.main a{font-size:12px}.swagger-ui .info pre{font-size:14px}.swagger-ui .info li,.swagger-ui .info p,.swagger-ui .info table{font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .info h1,.swagger-ui .info h2,.swagger-ui .info h3,.swagger-ui .info h4,.swagger-ui .info h5{font-family:sans-serif;color:#3b4151}.swagger-ui .info a{font-size:14px;transition:all .4s;font-family:sans-serif;color:#4990e2}.swagger-ui .info a:hover{color:#1f69c0}.swagger-ui .info>div{margin:0 0 5px}.swagger-ui .info .base-url{font-size:12px;font-weight:300!important;margin:0;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .info .title{font-size:36px;margin:0;font-family:sans-serif;color:#3b4151}.swagger-ui .info .title small{font-size:10px;position:relative;top:-5px;display:inline-block;margin:0 0 0 5px;padding:2px 4px;vertical-align:super;border-radius:57px;background:#7d8492}.swagger-ui .info .title small pre{margin:0;padding:0;font-family:sans-serif;color:#fff}.swagger-ui .auth-btn-wrapper{display:flex;padding:10px 0;justify-content:center}.swagger-ui .auth-btn-wrapper .btn-done{margin-right:1em}.swagger-ui .auth-wrapper{display:flex;flex:1;justify-content:flex-end}.swagger-ui .auth-wrapper .authorize{padding-right:20px;margin-right:10px}.swagger-ui .auth-container{margin:0 0 10px;padding:10px 20px;border-bottom:1px solid #ebebeb}.swagger-ui .auth-container:last-of-type{margin:0;padding:10px 20px;border:0}.swagger-ui .auth-container h4{margin:5px 0 15px!important}.swagger-ui .auth-container .wrapper{margin:0;padding:0}.swagger-ui .auth-container input[type=password],.swagger-ui .auth-container input[type=text]{min-width:230px}.swagger-ui .auth-container .errors{font-size:12px;padding:10px;border-radius:4px;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .scopes h2{font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .scope-def{padding:0 0 20px}.swagger-ui .errors-wrapper{margin:20px;padding:10px 20px;-webkit-animation:scaleUp .5s;animation:scaleUp .5s;border:2px solid #f93e3e;border-radius:4px;background:rgba(249,62,62,.1)}.swagger-ui .errors-wrapper .error-wrapper{margin:0 0 10px}.swagger-ui .errors-wrapper .errors h4{font-size:14px;margin:0;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .errors-wrapper .errors small{color:#606060}.swagger-ui .errors-wrapper hgroup{display:flex;align-items:center}.swagger-ui .errors-wrapper hgroup h4{font-size:20px;margin:0;flex:1;font-family:sans-serif;color:#3b4151}@-webkit-keyframes scaleUp{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes scaleUp{0%{-webkit-transform:scale(.8);transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}.swagger-ui .Resizer.vertical.disabled{display:none}.swagger-ui .markdown p,.swagger-ui .markdown pre,.swagger-ui .renderedMarkdown p,.swagger-ui .renderedMarkdown pre{margin:1em auto}.swagger-ui .markdown pre,.swagger-ui .renderedMarkdown pre{color:#000;font-weight:400;white-space:pre-wrap;background:none;padding:0}.swagger-ui .markdown code,.swagger-ui .renderedMarkdown code{font-size:14px;padding:5px 7px;border-radius:4px;background:rgba(0,0,0,.05);font-family:monospace;font-weight:600;color:#9012fe}.swagger-ui .markdown pre>code,.swagger-ui .renderedMarkdown pre>code{display:block} + /*# sourceMappingURL=swagger-ui.css.map*/ \ No newline at end of file diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-bundle.min.js b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-bundle.min.js old mode 100644 new mode 100755 index 453934ea53626..16e565238e4af --- a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-bundle.min.js +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-bundle.min.js @@ -1,22 +1,35 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist",t(t.s=1213)}([function(e,t,n){"use strict";e.exports=n(92)},function(e,t,n){e.exports=n(996)()},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(331),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){e.exports={default:n(592),__esModule:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(565),o=r(i),a=n(330),s=r(a),u=n(48),l=r(u);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,l.default)(t)));e.prototype=(0,s.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(o.default?(0,o.default)(e,t):e.__proto__=t)}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(48),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){"use strict";function e(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function t(e){return o(e)?e:O(e)}function n(e){return a(e)?e:M(e)}function r(e){return s(e)?e:T(e)}function i(e){return o(e)&&!u(e)?e:P(e)}function o(e){return!(!e||!e[ln])}function a(e){return!(!e||!e[cn])}function s(e){return!(!e||!e[pn])}function u(e){return a(e)||s(e)}function l(e){return!(!e||!e[fn])}function c(e){return e.value=!1,e}function p(e){e&&(e.value=!0)}function f(){}function h(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;i<n;i++)r[i]=e[i+t];return r}function d(e){return void 0===e.size&&(e.size=e.__iterate(v)),e.size}function m(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?d(e)+t:t}function v(){return!0}function g(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function y(e,t){return b(e,t,0)}function _(e,t){return b(e,t,t)}function b(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}function x(e){this.next=e}function w(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function k(){return{value:void 0,done:!0}}function E(e){return!!A(e)}function S(e){return e&&"function"==typeof e.next}function C(e){var t=A(e);return t&&t.call(e)}function A(e){var t=e&&(wn&&e[wn]||e[kn]);if("function"==typeof t)return t}function D(e){return e&&"number"==typeof e.length}function O(e){return null===e||void 0===e?B():o(e)?e.toSeq():z(e)}function M(e){return null===e||void 0===e?B().toKeyedSeq():o(e)?a(e)?e.toSeq():e.fromEntrySeq():L(e)}function T(e){return null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e.toIndexedSeq():q(e)}function P(e){return(null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e:q(e)).toSetSeq()}function I(e){this._array=e,this.size=e.length}function R(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function j(e){this._iterable=e,this.size=e.length||e.size}function F(e){this._iterator=e,this._iteratorCache=[]}function N(e){return!(!e||!e[Sn])}function B(){return Cn||(Cn=new I([]))}function L(e){var t=Array.isArray(e)?new I(e).fromEntrySeq():S(e)?new F(e).fromEntrySeq():E(e)?new j(e).fromEntrySeq():"object"==typeof e?new R(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function q(e){var t=U(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function z(e){var t=U(e)||"object"==typeof e&&new R(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function U(e){return D(e)?new I(e):S(e)?new F(e):E(e)?new j(e):void 0}function W(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function V(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new x(function(){var e=i[n?o-a:a];return a++>o?k():w(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function H(e,t){return t?G(t,e,"",{"":e}):J(e)}function G(e,t,n,r){return Array.isArray(t)?e.call(r,n,T(t).map(function(n,r){return G(e,n,r,t)})):K(t)?e.call(r,n,M(t).map(function(n,r){return G(e,n,r,t)})):t}function J(e){return Array.isArray(e)?T(e).map(J).toList():K(e)?M(e).map(J).toMap():e}function K(e){return e&&(e.constructor===Object||void 0===e.constructor)}function X(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function Y(e,t){if(e===t)return!0;if(!o(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||a(e)!==a(t)||s(e)!==s(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!u(e);if(l(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&X(i[1],e)&&(n||X(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var c=e;e=t,t=c}var p=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):i?!X(t,e.get(r,vn)):!X(e.get(r,vn),t))return p=!1,!1});return p&&e.size===f}function $(e,t){if(!(this instanceof $))return new $(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(An)return An;An=this}}function Z(e,t){if(!e)throw new Error(t)}function Q(e,t,n){if(!(this instanceof Q))return new Q(e,t,n);if(Z(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(Dn)return Dn;Dn=this}}function ee(){throw TypeError("Abstract")}function te(){}function ne(){}function re(){}function ie(e){return e>>>1&1073741824|3221225471&e}function oe(e){if(!1===e||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null===e||void 0===e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!==e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)e/=4294967295,n^=e;return ie(n)}if("string"===t)return e.length>Fn?ae(e):se(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return ue(e);if("function"==typeof e.toString)return se(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ae(e){var t=Ln[e];return void 0===t&&(t=se(e),Bn===Nn&&(Bn=0,Ln={}),Bn++,Ln[e]=t),t}function se(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return ie(t)}function ue(e){var t;if(In&&void 0!==(t=On.get(e)))return t;if(void 0!==(t=e[jn]))return t;if(!Pn){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[jn]))return t;if(void 0!==(t=le(e)))return t}if(t=++Rn,1073741824&Rn&&(Rn=0),In)On.set(e,t);else{if(void 0!==Tn&&!1===Tn(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Pn)Object.defineProperty(e,jn,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[jn]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[jn]=t}}return t}function le(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function ce(e){Z(e!==1/0,"Cannot perform this action with an infinite size.")}function pe(e){return null===e||void 0===e?we():fe(e)&&!l(e)?e:we().withMutations(function(t){var r=n(e);ce(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function fe(e){return!(!e||!e[qn])}function he(e,t){this.ownerID=e,this.entries=t}function de(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function me(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&be(e._root)}function _e(e,t){return w(e,t[0],t[1])}function be(e,t){return{node:e,index:0,__prev:t}}function xe(e,t,n,r){var i=Object.create(zn);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function we(){return Un||(Un=xe(0))}function ke(e,t,n){var r,i;if(e._root){var o=c(gn),a=c(yn);if(r=Ee(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===vn?-1:1:0)}else{if(n===vn)return e;i=1,r=new he(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?xe(i,r):we()}function Ee(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===vn?e:(p(s),p(a),new ge(t,r,[i,o]))}function Se(e){return e.constructor===ge||e.constructor===ve}function Ce(e,t,n,r,i){if(e.keyHash===r)return new ve(t,r,[e.entry,i]);var o,a=(0===n?e.keyHash:e.keyHash>>>n)&mn,s=(0===n?r:r>>>n)&mn;return new de(t,1<<a|1<<s,a===s?[Ce(e,t,n+hn,r,i)]:(o=new ge(t,r,i),a<s?[e,o]:[o,e]))}function Ae(e,t,n,r){e||(e=new f);for(var i=new ge(e,oe(n),[n,r]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}function De(e,t,n,r){for(var i=0,o=0,a=new Array(n),s=0,u=1,l=t.length;s<l;s++,u<<=1){var c=t[s];void 0!==c&&s!==r&&(i|=u,a[o++]=c)}return new de(e,i,a)}function Oe(e,t,n,r,i){for(var o=0,a=new Array(dn),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new me(e,o+1,a)}function Me(e,t,r){for(var i=[],a=0;a<r.length;a++){var s=r[a],u=n(s);o(s)||(u=u.map(function(e){return H(e)})),i.push(u)}return Ie(e,t,i)}function Te(e,t,n){return e&&e.mergeDeep&&o(t)?e.mergeDeep(t):X(e,t)?e:t}function Pe(e){return function(t,n,r){if(t&&t.mergeDeepWith&&o(n))return t.mergeDeepWith(e,n);var i=e(t,n,r);return X(t,i)?t:i}}function Ie(e,t,n){return n=n.filter(function(e){return 0!==e.size}),0===n.length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations(function(e){for(var r=t?function(n,r){e.update(r,vn,function(e){return e===vn?n:t(e,n,r)})}:function(t,n){e.set(n,t)},i=0;i<n.length;i++)n[i].forEach(r)}):e.constructor(n[0])}function Re(e,t,n,r){var i=e===vn,o=t.next();if(o.done){var a=i?n:e,s=r(a);return s===a?e:s}Z(i||e&&e.set,"invalid keyPath");var u=o.value,l=i?vn:e.get(u,vn),c=Re(l,t,n,r);return c===l?e:c===vn?e.remove(u):(i?we():e).set(u,c)}function je(e){return e-=e>>1&1431655765,e=(858993459&e)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Fe(e,t,n,r){var i=r?e:h(e);return i[t]=n,i}function Ne(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=n,a=-1):o[s]=e[s+a];return o}function Be(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),o=0,a=0;a<r;a++)a===t&&(o=1),i[a]=e[a+o];return i}function Le(e){var t=Ve();if(null===e||void 0===e)return t;if(qe(e))return e;var n=r(e),i=n.size;return 0===i?t:(ce(i),i>0&&i<dn?We(0,i,hn,null,new ze(n.toArray())):t.withMutations(function(e){e.setSize(i),n.forEach(function(t,n){return e.set(n,t)})}))}function qe(e){return!(!e||!e[Gn])}function ze(e,t){this.array=e,this.ownerID=t}function Ue(e,t){function n(e,t,n){return 0===t?r(e,n):i(e,t,n)}function r(e,n){var r=n===s?u&&u.array:e&&e.array,i=n>o?0:o-n,l=a-n;return l>dn&&(l=dn),function(){if(i===l)return Xn;var e=t?--l:i++;return r&&r[e]}}function i(e,r,i){var s,u=e&&e.array,l=i>o?0:o-i>>r,c=1+(a-i>>r);return c>dn&&(c=dn),function(){for(;;){if(s){var e=s();if(e!==Xn)return e;s=null}if(l===c)return Xn;var o=t?--c:l++;s=n(u&&u[o],r-hn,i+(o<<r))}}}var o=e._origin,a=e._capacity,s=$e(a),u=e._tail;return n(e._root,e._level,0)}function We(e,t,n,r,i,o,a){var s=Object.create(Jn);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}function Ve(){return Kn||(Kn=We(0,0,hn))}function He(e,t,n){if((t=m(e,t))!==t)return e;if(t>=e.size||t<0)return e.withMutations(function(e){t<0?Xe(e,t).set(0,n):Xe(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=c(yn);return t>=$e(e._capacity)?r=Ge(r,e.__ownerID,0,t,n,o):i=Ge(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):We(e._origin,e._capacity,e._level,i,r):e}function Ge(e,t,n,r,i,o){var a=r>>>n&mn,s=e&&a<e.array.length;if(!s&&void 0===i)return e;var u;if(n>0){var l=e&&e.array[a],c=Ge(l,t,n-hn,r,i,o);return c===l?e:(u=Je(e,t),u.array[a]=c,u)}return s&&e.array[a]===i?e:(p(o),u=Je(e,t),void 0===i&&a===u.array.length-1?u.array.pop():u.array[a]=i,u)}function Je(e,t){return t&&e&&t===e.ownerID?e:new ze(e?e.array.slice():[],t)}function Ke(e,t){if(t>=$e(e._capacity))return e._tail;if(t<1<<e._level+hn){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&mn],r-=hn;return n}}function Xe(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new f,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var u=e._level,l=e._root,c=0;a+c<0;)l=new ze(l&&l.array.length?[void 0,l]:[],r),u+=hn,c+=1<<u;c&&(a+=c,i+=c,s+=c,o+=c);for(var p=$e(o),h=$e(s);h>=1<<u+hn;)l=new ze(l&&l.array.length?[l]:[],r),u+=hn;var d=e._tail,m=h<p?Ke(e,s-1):h>p?new ze([],r):d;if(d&&h>p&&a<o&&d.array.length){l=Je(l,r);for(var v=l,g=u;g>hn;g-=hn){var y=p>>>g&mn;v=v.array[y]=Je(v.array[y],r)}v.array[p>>>hn&mn]=d}if(s<o&&(m=m&&m.removeAfter(r,0,s)),a>=h)a-=h,s-=h,u=hn,l=null,m=m&&m.removeBefore(r,0,a);else if(a>i||h<p){for(c=0;l;){var _=a>>>u&mn;if(_!==h>>>u&mn)break;_&&(c+=(1<<u)*_),u-=hn,l=l.array[_]}l&&a>i&&(l=l.removeBefore(r,u,a-c)),l&&h<p&&(l=l.removeAfter(r,u,h-c)),c&&(a-=c,s-=c)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=u,e._root=l,e._tail=m,e.__hash=void 0,e.__altered=!0,e):We(a,s,u,l,m)}function Ye(e,t,n){for(var i=[],a=0,s=0;s<n.length;s++){var u=n[s],l=r(u);l.size>a&&(a=l.size),o(u)||(l=l.map(function(e){return H(e)})),i.push(l)}return a>e.size&&(e=e.setSize(a)),Ie(e,t,i)}function $e(e){return e<dn?0:e-1>>>hn<<hn}function Ze(e){return null===e||void 0===e?tt():Qe(e)?e:tt().withMutations(function(t){var r=n(e);ce(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function Qe(e){return fe(e)&&l(e)}function et(e,t,n,r){var i=Object.create(Ze.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=n,i.__hash=r,i}function tt(){return Yn||(Yn=et(we(),Ve()))}function nt(e,t,n){var r,i,o=e._map,a=e._list,s=o.get(t),u=void 0!==s;if(n===vn){if(!u)return e;a.size>=dn&&a.size>=2*o.size?(i=a.filter(function(e,t){return void 0!==e&&s!==t}),r=i.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(u){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):et(r,i)}function rt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function it(e){this._iter=e,this.size=e.size}function ot(e){this._iter=e,this.size=e.size}function at(e){this._iter=e,this.size=e.size}function st(e){var t=Dt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Ot,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===xn){var r=e.__iterator(t,n);return new x(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===bn?_n:bn,n)},t}function ut(e,t,n){var r=Dt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,vn);return o===vn?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate(function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)},i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(xn,i);return new x(function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return w(r,s,t.call(n,a[1],s,e),i)})},r}function lt(e,t){var n=Dt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=st(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Ot,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function ct(e,t,n,r){var i=Dt(e);return r&&(i.has=function(r){var i=e.get(r,vn);return i!==vn&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,vn);return o!==vn&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate(function(e,o,u){if(t.call(n,e,o,u))return s++,i(e,r?o:s-1,a)},o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(xn,o),s=0;return new x(function(){for(;;){var o=a.next();if(o.done)return o;var u=o.value,l=u[0],c=u[1];if(t.call(n,c,l,e))return w(i,r?l:s++,c,o)}})},i}function pt(e,t,n){var r=pe().asMutable();return e.__iterate(function(i,o){r.update(t.call(n,i,o,e),0,function(e){return e+1})}),r.asImmutable()}function ft(e,t,n){var r=a(e),i=(l(e)?Ze():pe()).asMutable();e.__iterate(function(o,a){i.update(t.call(n,o,a,e),function(e){return e=e||[],e.push(r?[a,o]:o),e})});var o=At(e);return i.map(function(t){return Et(e,o(t))})}function ht(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),g(t,n,i))return e;var o=y(t,i),a=_(n,i);if(o!==o||a!==a)return ht(e.toSeq().cacheResult(),t,n,r);var s,u=a-o;u===u&&(s=u<0?0:u);var l=Dt(e);return l.size=0===s?s:e.size&&s||void 0,!r&&N(e)&&s>=0&&(l.get=function(t,n){return t=m(this,t),t>=0&&t<s?e.get(t+o,n):n}),l.__iterateUncached=function(t,n){var i=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,u=!0,l=0;return e.__iterate(function(e,n){if(!u||!(u=a++<o))return l++,!1!==t(e,r?n:l-1,i)&&l!==s}),l},l.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var i=0!==s&&e.__iterator(t,n),a=0,u=0;return new x(function(){for(;a++<o;)i.next();if(++u>s)return k();var e=i.next();return r||t===bn?e:t===_n?w(t,u-1,void 0,e):w(t,u-1,e.value[1],e)})},l}function dt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)}),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(xn,i),s=!0;return new x(function(){if(!s)return k();var e=a.next();if(e.done)return e;var i=e.value,u=i[0],l=i[1];return t.call(n,l,u,o)?r===xn?e:w(r,u,l,e):(s=!1,k())})},r}function mt(e,t,n,r){var i=Dt(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,u=0;return e.__iterate(function(e,o,l){if(!s||!(s=t.call(n,e,o,l)))return u++,i(e,r?o:u-1,a)}),u},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(xn,o),u=!0,l=0;return new x(function(){var e,o,c;do{if(e=s.next(),e.done)return r||i===bn?e:i===_n?w(i,l++,void 0,e):w(i,l++,e.value[1],e);var p=e.value;o=p[0],c=p[1],u&&(u=t.call(n,c,o,a))}while(u);return i===xn?e:w(i,o,c,e)})},i}function vt(e,t){var r=a(e),i=[e].concat(t).map(function(e){return o(e)?r&&(e=n(e)):e=r?L(e):q(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var u=i[0];if(u===e||r&&a(u)||s(e)&&s(u))return u}var l=new I(i);return r?l=l.toKeyedSeq():s(e)||(l=l.toSetSeq()),l=l.flatten(!0),l.size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),l}function gt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){function a(e,l){var c=this;e.__iterate(function(e,i){return(!t||l<t)&&o(e)?a(e,l+1):!1===r(e,n?i:s++,c)&&(u=!0),!u},i)}var s=0,u=!1;return a(e,0),s},r.__iteratorUncached=function(r,i){var a=e.__iterator(r,i),s=[],u=0;return new x(function(){for(;a;){var e=a.next();if(!1===e.done){var l=e.value;if(r===xn&&(l=l[1]),t&&!(s.length<t)||!o(l))return n?e:w(r,u++,l,e);s.push(a),a=l.__iterator(r,i)}else a=s.pop()}return k()})},r}function yt(e,t,n){var r=At(e);return e.toSeq().map(function(i,o){return r(t.call(n,i,o,e))}).flatten(!0)}function _t(e,t){var n=Dt(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var i=this,o=0;return e.__iterate(function(e,r){return(!o||!1!==n(t,o++,i))&&!1!==n(e,o++,i)},r),o},n.__iteratorUncached=function(n,r){var i,o=e.__iterator(bn,r),a=0;return new x(function(){return(!i||a%2)&&(i=o.next(),i.done)?i:a%2?w(n,a++,t):w(n,a++,i.value,i)})},n}function bt(e,t,n){t||(t=Mt);var r=a(e),i=0,o=e.toSeq().map(function(t,r){return[r,t,i++,n?n(t,r,e):t]}).toArray();return o.sort(function(e,n){return t(e[3],n[3])||e[2]-n[2]}).forEach(r?function(e,t){o[t].length=2}:function(e,t){o[t]=e[1]}),r?M(o):s(e)?T(o):P(o)}function xt(e,t,n){if(t||(t=Mt),n){var r=e.toSeq().map(function(t,r){return[t,n(t,r,e)]}).reduce(function(e,n){return wt(t,e[1],n[1])?n:e});return r&&r[0]}return e.reduce(function(e,n){return wt(t,e,n)?n:e})}function wt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(void 0===n||null===n||n!==n)||r>0}function kt(e,n,r){var i=Dt(e);return i.size=new I(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(bn,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map(function(e){return e=t(e),C(i?e.reverse():e)}),a=0,s=!1;return new x(function(){var t;return s||(t=o.map(function(e){return e.next()}),s=t.some(function(e){return e.done})),s?k():w(e,a++,n.apply(null,t.map(function(e){return e.value})))})},i}function Et(e,t){return N(e)?t:e.constructor(t)}function St(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Ct(e){return ce(e.size),d(e)}function At(e){return a(e)?n:s(e)?r:i}function Dt(e){return Object.create((a(e)?M:s(e)?T:P).prototype)}function Ot(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Mt(e,t){return e>t?1:e<t?-1:0}function Tt(e){var n=C(e);if(!n){if(!D(e))throw new TypeError("Expected iterable or array-like: "+e);n=C(t(e))}return n}function Pt(e,t){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var a=Object.keys(e);jt(i,a),i.size=a.length,i._name=t,i._keys=a,i._defaultValues=e}this._map=pe(o)},i=r.prototype=Object.create($n);return i.constructor=r,r}function It(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function Rt(e){return e._name||e.constructor.name||"Record"}function jt(e,t){try{t.forEach(Ft.bind(void 0,e))}catch(e){}}function Ft(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){Z(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}function Nt(e){return null===e||void 0===e?zt():Bt(e)&&!l(e)?e:zt().withMutations(function(t){var n=i(e);ce(n.size),n.forEach(function(e){return t.add(e)})})}function Bt(e){return!(!e||!e[Zn])}function Lt(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function qt(e,t){var n=Object.create(Qn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function zt(){return er||(er=qt(we()))}function Ut(e){return null===e||void 0===e?Ht():Wt(e)?e:Ht().withMutations(function(t){var n=i(e);ce(n.size),n.forEach(function(e){return t.add(e)})})}function Wt(e){return Bt(e)&&l(e)}function Vt(e,t){var n=Object.create(tr);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function Ht(){return nr||(nr=Vt(tt()))}function Gt(e){return null===e||void 0===e?Xt():Jt(e)?e:Xt().unshiftAll(e)}function Jt(e){return!(!e||!e[rr])}function Kt(e,t,n,r){var i=Object.create(ir);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Xt(){return or||(or=Kt(0))}function Yt(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}function $t(e,t){return t}function Zt(e,t){return[t,e]}function Qt(e){return function(){return!e.apply(this,arguments)}}function en(e){return function(){return-e.apply(this,arguments)}}function tn(e){return"string"==typeof e?JSON.stringify(e):String(e)}function nn(){return h(arguments)}function rn(e,t){return e<t?1:e>t?-1:0}function on(e){if(e.size===1/0)return 0;var t=l(e),n=a(e),r=t?1:0;return an(e.__iterate(n?t?function(e,t){r=31*r+sn(oe(e),oe(t))|0}:function(e,t){r=r+sn(oe(e),oe(t))|0}:t?function(e){r=31*r+oe(e)|0}:function(e){r=r+oe(e)|0}),r)}function an(e,t){return t=Mn(t,3432918353),t=Mn(t<<15|t>>>-15,461845907),t=Mn(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Mn(t^t>>>16,2246822507),t=Mn(t^t>>>13,3266489909),t=ie(t^t>>>16)}function sn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var un=Array.prototype.slice;e(n,t),e(r,t),e(i,t),t.isIterable=o,t.isKeyed=a,t.isIndexed=s,t.isAssociative=u,t.isOrdered=l,t.Keyed=n,t.Indexed=r,t.Set=i;var ln="@@__IMMUTABLE_ITERABLE__@@",cn="@@__IMMUTABLE_KEYED__@@",pn="@@__IMMUTABLE_INDEXED__@@",fn="@@__IMMUTABLE_ORDERED__@@",hn=5,dn=1<<hn,mn=dn-1,vn={},gn={value:!1},yn={value:!1},_n=0,bn=1,xn=2,wn="function"==typeof Symbol&&Symbol.iterator,kn="@@iterator",En=wn||kn;x.prototype.toString=function(){return"[Iterator]"},x.KEYS=_n,x.VALUES=bn,x.ENTRIES=xn,x.prototype.inspect=x.prototype.toSource=function(){return this.toString()},x.prototype[En]=function(){return this},e(O,t),O.of=function(){return O(arguments)},O.prototype.toSeq=function(){return this},O.prototype.toString=function(){return this.__toString("Seq {","}")},O.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},O.prototype.__iterate=function(e,t){return W(this,e,t,!0)},O.prototype.__iterator=function(e,t){return V(this,e,t,!0)},e(M,O),M.prototype.toKeyedSeq=function(){return this},e(T,O),T.of=function(){return T(arguments)},T.prototype.toIndexedSeq=function(){return this},T.prototype.toString=function(){return this.__toString("Seq [","]")},T.prototype.__iterate=function(e,t){return W(this,e,t,!1)},T.prototype.__iterator=function(e,t){return V(this,e,t,!1)},e(P,O),P.of=function(){return P(arguments)},P.prototype.toSetSeq=function(){return this},O.isSeq=N,O.Keyed=M,O.Set=P,O.Indexed=T;var Sn="@@__IMMUTABLE_SEQ__@@";O.prototype[Sn]=!0,e(I,T),I.prototype.get=function(e,t){return this.has(e)?this._array[m(this,e)]:t},I.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,i=0;i<=r;i++)if(!1===e(n[t?r-i:i],i,this))return i+1;return i},I.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,i=0;return new x(function(){return i>r?k():w(e,i,n[t?r-i++:i++])})},e(R,M),R.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},R.prototype.has=function(e){return this._object.hasOwnProperty(e)},R.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},R.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new x(function(){var a=r[t?i-o:o];return o++>i?k():w(e,a,n[a])})},R.prototype[fn]=!0,e(j,T),j.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=C(n),i=0;if(S(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,i++,this););return i},j.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=C(n);if(!S(r))return new x(k);var i=0;return new x(function(){var t=r.next();return t.done?t:w(e,i++,t.value)})},e(F,T),F.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n=this._iterator,r=this._iteratorCache,i=0;i<r.length;)if(!1===e(r[i],i++,this))return i;for(var o;!(o=n.next()).done;){var a=o.value;if(r[i]=a,!1===e(a,i++,this))break}return i},F.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,i=0;return new x(function(){if(i>=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return w(e,i,r[i++])})};var Cn;e($,T),$.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},$.prototype.get=function(e,t){return this.has(e)?this._value:t},$.prototype.includes=function(e){return X(this._value,e)},$.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:new $(this._value,_(t,n)-y(e,n))},$.prototype.reverse=function(){return this},$.prototype.indexOf=function(e){return X(this._value,e)?0:-1},$.prototype.lastIndexOf=function(e){return X(this._value,e)?this.size:-1},$.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},$.prototype.__iterator=function(e,t){var n=this,r=0;return new x(function(){return r<n.size?w(e,r++,n._value):k()})},$.prototype.equals=function(e){return e instanceof $?X(this._value,e._value):Y(e)};var An;e(Q,T),Q.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},Q.prototype.get=function(e,t){return this.has(e)?this._start+m(this,e)*this._step:t},Q.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},Q.prototype.slice=function(e,t){return g(e,t,this.size)?this:(e=y(e,this.size),t=_(t,this.size),t<=e?new Q(0,0):new Q(this.get(e,this._end),this.get(t,this._end),this._step))},Q.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},Q.prototype.lastIndexOf=function(e){return this.indexOf(e)},Q.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,i=t?this._start+n*r:this._start,o=0;o<=n;o++){if(!1===e(i,o,this))return o+1;i+=t?-r:r}return o},Q.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,i=t?this._start+n*r:this._start,o=0;return new x(function(){var a=i;return i+=t?-r:r,o>n?k():w(e,o++,a)})},Q.prototype.equals=function(e){return e instanceof Q?this._start===e._start&&this._end===e._end&&this._step===e._step:Y(this,e)};var Dn;e(ee,t),e(te,ee),e(ne,ee),e(re,ee),ee.Keyed=te,ee.Indexed=ne,ee.Set=re;var On,Mn="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){e|=0,t|=0;var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0},Tn=Object.isExtensible,Pn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),In="function"==typeof WeakMap;In&&(On=new WeakMap);var Rn=0,jn="__immutablehash__";"function"==typeof Symbol&&(jn=Symbol(jn));var Fn=16,Nn=255,Bn=0,Ln={};e(pe,te),pe.of=function(){var e=un.call(arguments,0);return we().withMutations(function(t){for(var n=0;n<e.length;n+=2){if(n+1>=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},pe.prototype.toString=function(){return this.__toString("Map {","}")},pe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},pe.prototype.set=function(e,t){return ke(this,e,t)},pe.prototype.setIn=function(e,t){return this.updateIn(e,vn,function(){return t})},pe.prototype.remove=function(e){return ke(this,e,vn)},pe.prototype.deleteIn=function(e){return this.updateIn(e,function(){return vn})},pe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},pe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=Re(this,Tt(e),t,n);return r===vn?void 0:r},pe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):we()},pe.prototype.merge=function(){return Me(this,void 0,arguments)},pe.prototype.mergeWith=function(e){return Me(this,e,un.call(arguments,1))},pe.prototype.mergeIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.merge?e.merge.apply(e,t):t[t.length-1]})},pe.prototype.mergeDeep=function(){return Me(this,Te,arguments)},pe.prototype.mergeDeepWith=function(e){var t=un.call(arguments,1);return Me(this,Pe(e),t)},pe.prototype.mergeDeepIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,t):t[t.length-1]})},pe.prototype.sort=function(e){return Ze(bt(this,e))},pe.prototype.sortBy=function(e,t){return Ze(bt(this,t,e))},pe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},pe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new f)},pe.prototype.asImmutable=function(){return this.__ensureOwner()},pe.prototype.wasAltered=function(){return this.__altered},pe.prototype.__iterator=function(e,t){return new ye(this,e,t)},pe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},pe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?xe(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},pe.isMap=fe;var qn="@@__IMMUTABLE_MAP__@@",zn=pe.prototype;zn[qn]=!0,zn.delete=zn.remove,zn.removeIn=zn.deleteIn,he.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(X(n,i[o][0]))return i[o][1];return r},he.prototype.update=function(e,t,n,r,i,o,a){for(var s=i===vn,u=this.entries,l=0,c=u.length;l<c&&!X(r,u[l][0]);l++);var f=l<c;if(f?u[l][1]===i:s)return this;if(p(a),(s||!f)&&p(o),!s||1!==u.length){if(!f&&!s&&u.length>=Wn)return Ae(e,u,r,i);var d=e&&e===this.ownerID,m=d?u:h(u);return f?s?l===c-1?m.pop():m[l]=m.pop():m[l]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new he(e,m)}},de.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=1<<((0===e?t:t>>>e)&mn),o=this.bitmap;return 0==(o&i)?r:this.nodes[je(o&i-1)].get(e+hn,t,n,r)},de.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=1<<s,l=this.bitmap,c=0!=(l&u);if(!c&&i===vn)return this;var p=je(l&u-1),f=this.nodes,h=c?f[p]:void 0,d=Ee(h,e,t+hn,n,r,i,o,a);if(d===h)return this;if(!c&&d&&f.length>=Vn)return Oe(e,f,l,s,d);if(c&&!d&&2===f.length&&Se(f[1^p]))return f[1^p];if(c&&d&&1===f.length&&Se(d))return d;var m=e&&e===this.ownerID,v=c?d?l:l^u:l|u,g=c?d?Fe(f,p,d,m):Be(f,p,m):Ne(f,p,d,m);return m?(this.bitmap=v,this.nodes=g,this):new de(e,v,g)},me.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=(0===e?t:t>>>e)&mn,o=this.nodes[i];return o?o.get(e+hn,t,n,r):r},me.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=i===vn,l=this.nodes,c=l[s];if(u&&!c)return this;var p=Ee(c,e,t+hn,n,r,i,o,a);if(p===c)return this;var f=this.count;if(c){if(!p&&--f<Hn)return De(e,l,f,s)}else f++;var h=e&&e===this.ownerID,d=Fe(l,s,p,h);return h?(this.count=f,this.nodes=d,this):new me(e,f,d)},ve.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(X(n,i[o][0]))return i[o][1];return r},ve.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=i===vn;if(n!==this.keyHash)return s?this:(p(a),p(o),Ce(this,e,t,n,[r,i]));for(var u=this.entries,l=0,c=u.length;l<c&&!X(r,u[l][0]);l++);var f=l<c;if(f?u[l][1]===i:s)return this;if(p(a),(s||!f)&&p(o),s&&2===c)return new ge(e,this.keyHash,u[1^l]);var d=e&&e===this.ownerID,m=d?u:h(u);return f?s?l===c-1?m.pop():m[l]=m.pop():m[l]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new ve(e,this.keyHash,m)},ge.prototype.get=function(e,t,n,r){return X(n,this.entry[0])?this.entry[1]:r},ge.prototype.update=function(e,t,n,r,i,o,a){var s=i===vn,u=X(r,this.entry[0]);return(u?i===this.entry[1]:s)?this:(p(a),s?void p(o):u?e&&e===this.ownerID?(this.entry[1]=i,this):new ge(e,this.keyHash,[r,i]):(p(o),Ce(this,e,t,oe(r),[r,i])))},he.prototype.iterate=ve.prototype.iterate=function(e,t){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(!1===e(n[t?i-r:r]))return!1},de.prototype.iterate=me.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[t?i-r:r];if(o&&!1===o.iterate(e,t))return!1}},ge.prototype.iterate=function(e,t){return e(this.entry)},e(ye,x),ye.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,i=t.index++;if(r.entry){if(0===i)return _e(e,r.entry)}else if(r.entries){if(n=r.entries.length-1,i<=n)return _e(e,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,i<=n){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return _e(e,o.entry);t=this._stack=be(o,t)}continue}t=this._stack=this._stack.__prev}return k()};var Un,Wn=dn/4,Vn=dn/2,Hn=dn/4;e(Le,ne),Le.of=function(){return this(arguments)},Le.prototype.toString=function(){return this.__toString("List [","]")},Le.prototype.get=function(e,t){if((e=m(this,e))>=0&&e<this.size){e+=this._origin;var n=Ke(this,e);return n&&n.array[e&mn]}return t},Le.prototype.set=function(e,t){return He(this,e,t)},Le.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},Le.prototype.insert=function(e,t){return this.splice(e,0,t)},Le.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=hn,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Ve()},Le.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){Xe(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])})},Le.prototype.pop=function(){return Xe(this,0,-1)},Le.prototype.unshift=function(){var e=arguments;return this.withMutations(function(t){Xe(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])})},Le.prototype.shift=function(){return Xe(this,1)},Le.prototype.merge=function(){return Ye(this,void 0,arguments)},Le.prototype.mergeWith=function(e){return Ye(this,e,un.call(arguments,1))},Le.prototype.mergeDeep=function(){return Ye(this,Te,arguments)},Le.prototype.mergeDeepWith=function(e){var t=un.call(arguments,1);return Ye(this,Pe(e),t)},Le.prototype.setSize=function(e){return Xe(this,0,e)},Le.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:Xe(this,y(e,n),_(t,n))},Le.prototype.__iterator=function(e,t){var n=0,r=Ue(this,t);return new x(function(){var t=r();return t===Xn?k():w(e,n++,t)})},Le.prototype.__iterate=function(e,t){for(var n,r=0,i=Ue(this,t);(n=i())!==Xn&&!1!==e(n,r++,this););return r},Le.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?We(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},Le.isList=qe;var Gn="@@__IMMUTABLE_LIST__@@",Jn=Le.prototype;Jn[Gn]=!0,Jn.delete=Jn.remove,Jn.setIn=zn.setIn,Jn.deleteIn=Jn.removeIn=zn.removeIn,Jn.update=zn.update,Jn.updateIn=zn.updateIn,Jn.mergeIn=zn.mergeIn,Jn.mergeDeepIn=zn.mergeDeepIn,Jn.withMutations=zn.withMutations,Jn.asMutable=zn.asMutable,Jn.asImmutable=zn.asImmutable,Jn.wasAltered=zn.wasAltered,ze.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&mn;if(r>=this.array.length)return new ze([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-hn,n))===a&&o)return this}if(o&&!i)return this;var s=Je(this,e);if(!o)for(var u=0;u<r;u++)s.array[u]=void 0;return i&&(s.array[r]=i),s},ze.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r=n-1>>>t&mn;if(r>=this.array.length)return this;var i;if(t>0){var o=this.array[r];if((i=o&&o.removeAfter(e,t-hn,n))===o&&r===this.array.length-1)return this}var a=Je(this,e);return a.array.splice(r+1),i&&(a.array[r]=i),a};var Kn,Xn={};e(Ze,pe),Ze.of=function(){return this(arguments)},Ze.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ze.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Ze.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):tt()},Ze.prototype.set=function(e,t){return nt(this,e,t)},Ze.prototype.remove=function(e){return nt(this,e,vn)},Ze.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ze.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Ze.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Ze.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?et(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Ze.isOrderedMap=Qe,Ze.prototype[fn]=!0,Ze.prototype.delete=Ze.prototype.remove;var Yn;e(rt,M),rt.prototype.get=function(e,t){return this._iter.get(e,t)},rt.prototype.has=function(e){return this._iter.has(e)},rt.prototype.valueSeq=function(){return this._iter.valueSeq()},rt.prototype.reverse=function(){var e=this,t=lt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},rt.prototype.map=function(e,t){var n=this,r=ut(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},rt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Ct(this):0,function(i){return e(i,t?--n:n++,r)}),t)},rt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(bn,t),r=t?Ct(this):0;return new x(function(){var i=n.next();return i.done?i:w(e,t?--r:r++,i.value,i)})},rt.prototype[fn]=!0,e(it,T),it.prototype.includes=function(e){return this._iter.includes(e)},it.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},it.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t),r=0;return new x(function(){var t=n.next();return t.done?t:w(e,r++,t.value,t)})},e(ot,P),ot.prototype.has=function(e){return this._iter.includes(e)},ot.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},ot.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){var t=n.next();return t.done?t:w(e,t.value,t.value,t)})},e(at,M),at.prototype.entrySeq=function(){return this._iter.toSeq()},at.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){St(t);var r=o(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},at.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){St(r);var i=o(r);return w(e,i?r.get(0):r[0],i?r.get(1):r[1],t)}}})},it.prototype.cacheResult=rt.prototype.cacheResult=ot.prototype.cacheResult=at.prototype.cacheResult=Ot,e(Pt,te),Pt.prototype.toString=function(){return this.__toString(Rt(this)+" {","}")},Pt.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},Pt.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},Pt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=It(this,we()))},Pt.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+Rt(this));if(this._map&&!this._map.has(e)){if(t===this._defaultValues[e])return this}var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:It(this,n)},Pt.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:It(this,t)},Pt.prototype.wasAltered=function(){return this._map.wasAltered()},Pt.prototype.__iterator=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterator(e,t)},Pt.prototype.__iterate=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterate(e,t)},Pt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?It(this,t,e):(this.__ownerID=e,this._map=t,this)};var $n=Pt.prototype;$n.delete=$n.remove,$n.deleteIn=$n.removeIn=zn.removeIn,$n.merge=zn.merge,$n.mergeWith=zn.mergeWith,$n.mergeIn=zn.mergeIn,$n.mergeDeep=zn.mergeDeep,$n.mergeDeepWith=zn.mergeDeepWith,$n.mergeDeepIn=zn.mergeDeepIn,$n.setIn=zn.setIn,$n.update=zn.update,$n.updateIn=zn.updateIn,$n.withMutations=zn.withMutations,$n.asMutable=zn.asMutable,$n.asImmutable=zn.asImmutable,e(Nt,re),Nt.of=function(){return this(arguments)},Nt.fromKeys=function(e){return this(n(e).keySeq())},Nt.prototype.toString=function(){return this.__toString("Set {","}")},Nt.prototype.has=function(e){return this._map.has(e)},Nt.prototype.add=function(e){return Lt(this,this._map.set(e,!0))},Nt.prototype.remove=function(e){return Lt(this,this._map.remove(e))},Nt.prototype.clear=function(){return Lt(this,this._map.clear())},Nt.prototype.union=function(){var e=un.call(arguments,0);return e=e.filter(function(e){return 0!==e.size}),0===e.length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n<e.length;n++)i(e[n]).forEach(function(e){return t.add(e)})}):this.constructor(e[0])},Nt.prototype.intersect=function(){var e=un.call(arguments,0);if(0===e.length)return this;e=e.map(function(e){return i(e)});var t=this;return this.withMutations(function(n){t.forEach(function(t){e.every(function(e){return e.includes(t)})||n.remove(t)})})},Nt.prototype.subtract=function(){var e=un.call(arguments,0);if(0===e.length)return this;e=e.map(function(e){return i(e)});var t=this;return this.withMutations(function(n){t.forEach(function(t){e.some(function(e){return e.includes(t)})&&n.remove(t)})})},Nt.prototype.merge=function(){return this.union.apply(this,arguments)},Nt.prototype.mergeWith=function(e){var t=un.call(arguments,1);return this.union.apply(this,t)},Nt.prototype.sort=function(e){return Ut(bt(this,e))},Nt.prototype.sortBy=function(e,t){return Ut(bt(this,t,e))},Nt.prototype.wasAltered=function(){return this._map.wasAltered()},Nt.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate(function(t,r){return e(r,r,n)},t)},Nt.prototype.__iterator=function(e,t){return this._map.map(function(e,t){return t}).__iterator(e,t)},Nt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},Nt.isSet=Bt;var Zn="@@__IMMUTABLE_SET__@@",Qn=Nt.prototype;Qn[Zn]=!0,Qn.delete=Qn.remove,Qn.mergeDeep=Qn.merge,Qn.mergeDeepWith=Qn.mergeWith,Qn.withMutations=zn.withMutations,Qn.asMutable=zn.asMutable,Qn.asImmutable=zn.asImmutable,Qn.__empty=zt,Qn.__make=qt;var er;e(Ut,Nt),Ut.of=function(){return this(arguments)},Ut.fromKeys=function(e){return this(n(e).keySeq())},Ut.prototype.toString=function(){return this.__toString("OrderedSet {","}")},Ut.isOrderedSet=Wt;var tr=Ut.prototype;tr[fn]=!0,tr.__empty=Ht,tr.__make=Vt;var nr;e(Gt,ne),Gt.of=function(){return this(arguments)},Gt.prototype.toString=function(){return this.__toString("Stack [","]")},Gt.prototype.get=function(e,t){var n=this._head;for(e=m(this,e);n&&e--;)n=n.next;return n?n.value:t},Gt.prototype.peek=function(){return this._head&&this._head.value},Gt.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Kt(e,t)},Gt.prototype.pushAll=function(e){if(e=r(e),0===e.size)return this;ce(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Kt(t,n)},Gt.prototype.pop=function(){return this.slice(1)},Gt.prototype.unshift=function(){return this.push.apply(this,arguments)},Gt.prototype.unshiftAll=function(e){return this.pushAll(e)},Gt.prototype.shift=function(){return this.pop.apply(this,arguments)},Gt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Xt()},Gt.prototype.slice=function(e,t){if(g(e,t,this.size))return this;var n=y(e,this.size);if(_(t,this.size)!==this.size)return ne.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Kt(r,i)},Gt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Kt(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Gt.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Gt.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new x(function(){if(r){var t=r.value;return r=r.next,w(e,n++,t)}return k()})},Gt.isStack=Jt;var rr="@@__IMMUTABLE_STACK__@@",ir=Gt.prototype;ir[rr]=!0,ir.withMutations=zn.withMutations,ir.asMutable=zn.asMutable,ir.asImmutable=zn.asImmutable,ir.wasAltered=zn.wasAltered;var or;t.Iterator=x,Yt(t,{toArray:function(){ce(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new it(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new rt(this,!0)},toMap:function(){return pe(this.toKeyedSeq())},toObject:function(){ce(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Ze(this.toKeyedSeq())},toOrderedSet:function(){return Ut(a(this)?this.valueSeq():this)},toSet:function(){return Nt(a(this)?this.valueSeq():this)},toSetSeq:function(){return new ot(this)},toSeq:function(){return s(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Gt(a(this)?this.valueSeq():this)},toList:function(){return Le(a(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Et(this,vt(this,un.call(arguments,0)))},includes:function(e){return this.some(function(t){return X(t,e)})},entries:function(){return this.__iterator(xn)},every:function(e,t){ce(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1}),n},filter:function(e,t){return Et(this,ct(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return ce(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){ce(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(_n)},map:function(e,t){return Et(this,ut(this,e,t))},reduce:function(e,t,n){ce(this.size);var r,i;return arguments.length<2?i=!0:r=t,this.__iterate(function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Et(this,lt(this,!0))},slice:function(e,t){return Et(this,ht(this,e,t,!0))},some:function(e,t){return!this.every(Qt(e),t)},sort:function(e){return Et(this,bt(this,e))},values:function(){return this.__iterator(bn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return d(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return pt(this,e,t)},equals:function(e){return Y(this,e)},entrySeq:function(){var e=this;if(e._cache)return new I(e._cache);var t=e.toSeq().map(Zt).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Qt(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,i,o){if(e.call(t,n,i,o))return r=[i,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(v)},flatMap:function(e,t){return Et(this,yt(this,e,t))},flatten:function(e){return Et(this,gt(this,e,!0))},fromEntrySeq:function(){return new at(this)},get:function(e,t){return this.find(function(t,n){return X(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=Tt(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,vn):vn)===vn)return t}return r},groupBy:function(e,t){return ft(this,e,t)},has:function(e){return this.get(e,vn)!==vn},hasIn:function(e){return this.getIn(e,vn)!==vn},isSubset:function(e){return e="function"==typeof e.includes?e:t(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e="function"==typeof e.isSubset?e:t(e),e.isSubset(this)},keyOf:function(e){return this.findKey(function(t){return X(t,e)})},keySeq:function(){return this.toSeq().map($t).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return xt(this,e)},maxBy:function(e,t){return xt(this,t,e)},min:function(e){return xt(this,e?en(e):rn)},minBy:function(e,t){return xt(this,t?en(t):rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Et(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Et(this,mt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Qt(e),t)},sortBy:function(e,t){return Et(this,bt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Et(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Et(this,dt(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Qt(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=on(this))}});var ar=t.prototype;ar[ln]=!0,ar[En]=ar.values,ar.__toJS=ar.toArray,ar.__toStringMapper=tn,ar.inspect=ar.toSource=function(){return this.toString()},ar.chain=ar.flatMap,ar.contains=ar.includes,Yt(n,{flip:function(){return Et(this,st(this))},mapEntries:function(e,t){var n=this,r=0;return Et(this,this.toSeq().map(function(i,o){return e.call(t,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Et(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var sr=n.prototype;return sr[cn]=!0,sr[En]=ar.entries,sr.__toJS=ar.toObject,sr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+tn(e)},Yt(r,{toKeyedSeq:function(){return new rt(this,!1)},filter:function(e,t){return Et(this,ct(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Et(this,lt(this,!1))},slice:function(e,t){return Et(this,ht(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=y(e,e<0?this.count():this.size);var r=this.slice(0,e);return Et(this,1===n?r:r.concat(h(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Et(this,gt(this,e,!1))},get:function(e,t){return e=m(this,e),e<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=m(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Et(this,_t(this,e))},interleave:function(){var e=[this].concat(h(arguments)),t=kt(this.toSeq(),T.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Et(this,n)},keySeq:function(){return Q(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Et(this,mt(this,e,t,!1))},zip:function(){return Et(this,kt(this,nn,[this].concat(h(arguments))))},zipWith:function(e){var t=h(arguments);return t[0]=this,Et(this,kt(this,e,t))}}),r.prototype[pn]=!0,r.prototype[fn]=!0,Yt(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=ar.includes,i.prototype.contains=i.prototype.includes,Yt(M,n.prototype),Yt(T,r.prototype),Yt(P,i.prototype),Yt(te,n.prototype),Yt(ne,r.prototype),Yt(re,i.prototype),{Iterable:t,Seq:O,Collection:ee,Map:pe,OrderedMap:Ze,List:Le,Stack:Gt,Set:Nt,OrderedSet:Ut,Record:Pt,Range:Q,Repeat:$,is:X,fromJS:H}})},function(e,t,n){"use strict";function r(e,t,n,r,o,a,s,u){if(i(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,s,u],p=0;l=new Error(t.replace(/%s/g,function(){return c[p++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var i=function(e){};e.exports=r},function(e,t,n){"use strict";(function(e){function r(e){return e&&e.__esModule?e:{default:e}}function i(e){try{var t=JSON.parse(e);if(t&&"object"===(void 0===t?"undefined":(0,N.default)(t)))return t}catch(e){}return!1}function o(e){return p(e)?oe(e)?e.toObject():e:{}}function a(e){return e?e.toArray?e.toArray():l(e):[]}function s(e){return oe(e)?e:e instanceof te.default.File?e:p(e)?Array.isArray(e)?L.default.Seq(e).map(s).toList():L.default.OrderedMap(e).map(s):e}function u(e,t){var n={};return(0,j.default)(e).filter(function(t){return"function"==typeof e[t]}).forEach(function(r){return n[r]=e[r].bind(null,t)}),n}function l(e){return Array.isArray(e)?e:[e]}function c(e){return"function"==typeof e}function p(e){return!!e&&"object"===(void 0===e?"undefined":(0,N.default)(e))}function f(e){return"function"==typeof e}function h(e){return Array.isArray(e)}function d(e,t){return(0,j.default)(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})}function m(e,t){return(0,j.default)(e).reduce(function(n,r){var i=t(e[r],r);return i&&"object"===(void 0===i?"undefined":(0,N.default)(i))&&(0,I.default)(n,i),n},{})}function v(e){return function(t){t.dispatch,t.getState;return function(t){return function(n){return"function"==typeof n?n(e()):t(n)}}}}function g(e){var t=e.keySeq();return t.contains(ie)?ie:t.filter(function(e){return"2"===(e+"")[0]}).sort().first()}function y(e,t){if(!L.default.Iterable.isIterable(e))return L.default.List();var n=e.getIn(Array.isArray(t)?t:[t]);return L.default.List.isList(n)?n:L.default.List()}function _(e){var t=document;if(!e)return"";if(e.textContent.length>5e3)return e.textContent;return function(e){for(var n,r,i,o,a,s=e.textContent,u=0,l=s[0],c=1,p=e.innerHTML="",f=0;r=n,n=f<7&&"\\"==n?1:c;){if(c=l,l=s[++u],o=p.length>1,!c||f>8&&"\n"==c||[/\S/.test(c),1,1,!/[$\w]/.test(c),("/"==n||"\n"==n)&&o,'"'==n&&o,"'"==n&&o,s[u-4]+r+n=="--\x3e",r+n=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),i=f&&f<7?f:i,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(c),/[\])]/.test(c),/[$\w]/.test(c),"/"==c&&i<2&&"<"!=n,'"'==c,"'"==c,c+l+s[u+1]+s[u+2]=="\x3c!--",c+l=="/*",c+l=="//","#"==c][--f];);p+=c}}(e)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:L.default.Map();if(!L.default.Map.isMap(e)||!e.size)return L.default.List();if(Array.isArray(t)||(t=[t]),t.length<1)return e.merge(n);var r=L.default.List(),i=t[0],o=!0,a=!1,s=void 0;try{for(var u,l=(0,T.default)(e.entries());!(o=(u=l.next()).done);o=!0){var c=u.value,p=(0,O.default)(c,2),f=p[0],h=p[1],d=b(h,t.slice(1),n.set(i,f));r=L.default.List.isList(d)?r.concat(d):r.push(d)}}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}return r}function x(e){var t=/filename="([^;]*);?"/i.exec(e);return null===t&&(t=/filename=([^;]*);?/i.exec(e)),null!==t&&t.length>1?t[1]:null}function w(e){return(0,V.default)((0,U.default)(e))}function k(e){return w(e.replace(/\.[^.\/]*$/,""))}function E(e){return"string"!=typeof e||""===e?"":(0,q.sanitizeUrl)(e)}function S(e){if(!L.default.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&(0,j.default)(e.get("content")||{}).length>0}),n=e.get("default")||L.default.OrderedMap(),r=(n.get("content")||L.default.OrderedMap()).keySeq().toJS(),i=r.length?n:null;return t||i}Object.defineProperty(t,"__esModule",{value:!0}),t.getExtensions=t.escapeDeepLinkPath=t.createDeepLinkPath=t.shallowEqualKeys=t.buildFormData=t.sorters=t.btoa=t.parseSearch=t.getSampleSchema=t.validateParam=t.validatePattern=t.validateMinLength=t.validateMaxLength=t.validateGuid=t.validateDateTime=t.validateString=t.validateBoolean=t.validateFile=t.validateInteger=t.validateNumber=t.validateMinimum=t.validateMaximum=t.propChecker=t.memoize=t.isImmutable=void 0;var C=n(35),A=r(C),D=n(18),O=r(D),M=n(95),T=r(M),P=n(30),I=r(P),R=n(47),j=r(R),F=n(48),N=r(F);t.isJSONObject=i,t.objectify=o,t.arrayify=a,t.fromJSOrdered=s,t.bindToState=u,t.normalizeArray=l,t.isFn=c,t.isObject=p,t.isFunc=f,t.isArray=h,t.objMap=d,t.objReduce=m,t.systemThunkMiddleware=v,t.defaultStatusCode=g,t.getList=y,t.highlight=_,t.mapToList=b,t.extractFileNameFromContentDispositionHeader=x,t.pascalCase=w,t.pascalCaseFilename=k,t.sanitizeUrl=E,t.getAcceptControllingResponse=S;var B=n(7),L=r(B),q=n(506),z=n(940),U=r(z),W=n(428),V=r(W),H=n(425),G=r(H),J=n(223),K=r(J),X=n(955),Y=r(X),$=n(120),Z=r($),Q=n(172),ee=n(46),te=r(ee),ne=n(697),re=r(ne),ie="default",oe=t.isImmutable=function(e){return L.default.Iterable.isIterable(e)},ae=(t.memoize=G.default,t.propChecker=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,j.default)(e).length!==(0,j.default)(t).length||((0,Y.default)(e,function(e,n){if(r.includes(n))return!1;var i=t[n];return L.default.Iterable.isIterable(e)?!L.default.is(e,i):("object"!==(void 0===e?"undefined":(0,N.default)(e))||"object"!==(void 0===i?"undefined":(0,N.default)(i)))&&e!==i})||n.some(function(n){return!(0,Z.default)(e[n],t[n])}))},t.validateMaximum=function(e,t){if(e>t)return"Value must be less than Maximum"}),se=t.validateMinimum=function(e,t){if(e<t)return"Value must be greater than Minimum"},ue=t.validateNumber=function(e){if(!/^-?\d+(\.?\d+)?$/.test(e))return"Value must be a number"},le=t.validateInteger=function(e){if(!/^-?\d+$/.test(e))return"Value must be an integer"},ce=t.validateFile=function(e){if(e&&!(e instanceof te.default.File))return"Value must be a file"},pe=t.validateBoolean=function(e){if("true"!==e&&"false"!==e&&!0!==e&&!1!==e)return"Value must be a boolean"},fe=t.validateString=function(e){if(e&&"string"!=typeof e)return"Value must be a string"},he=t.validateDateTime=function(e){if(isNaN(Date.parse(e)))return"Value must be a DateTime"},de=t.validateGuid=function(e){if(e=e.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}[)}]?$/.test(e))return"Value must be a Guid"},me=t.validateMaxLength=function(e,t){if(e.length>t)return"Value must be less than MaxLength"},ve=t.validateMinLength=function(e,t){if(e.length<t)return"Value must be greater than MinLength"},ge=t.validatePattern=function(e,t){if(!new RegExp(t).test(e))return"Value must follow pattern "+t},ye=(t.validateParam=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=t&&"body"===e.get("in")?e.get("value_xml"):e.get("value"),o=e.get("required"),a=n?e.get("schema"):e;if(!a)return r;var s=a.get("maximum"),u=a.get("minimum"),l=a.get("type"),c=a.get("format"),p=a.get("maxLength"),f=a.get("minLength"),h=a.get("pattern");if(l&&(o||i)){var d="string"===l&&i,m="array"===l&&Array.isArray(i)&&i.length,v="array"===l&&L.default.List.isList(i)&&i.count(),g="file"===l&&i instanceof te.default.File,y="boolean"===l&&(i||!1===i),_="number"===l&&(i||0===i),b="integer"===l&&(i||0===i);if(o&&!(d||m||v||g||y||_||b))return r.push("Required field is not provided"),r;if(h){var x=ge(i,h);x&&r.push(x)}if(p||0===p){var w=me(i,p);w&&r.push(w)}if(f){var k=ve(i,f);k&&r.push(k)}if(s||0===s){var E=ae(i,s);E&&r.push(E)}if(u||0===u){var S=se(i,u);S&&r.push(S)}if("string"===l){var C=void 0;if(!(C="date-time"===c?he(i):"uuid"===c?de(i):fe(i)))return r;r.push(C)}else if("boolean"===l){var A=pe(i);if(!A)return r;r.push(A)}else if("number"===l){var D=ue(i);if(!D)return r;r.push(D)}else if("integer"===l){var O=le(i);if(!O)return r;r.push(O)}else if("array"===l){var M=void 0;if(!i.count())return r;M=a.getIn(["items","type"]),i.forEach(function(e,t){var n=void 0;"number"===M?n=ue(e):"integer"===M?n=le(e):"string"===M&&(n=fe(e)),n&&r.push({index:t,error:n})})}else if("file"===l){var T=ce(i);if(!T)return r;r.push(T)}}return r},t.getSampleSchema=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'<?xml version="1.0" encoding="UTF-8"?>\n\x3c!-- XML example cannot be generated --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return(0,Q.memoizedCreateXMLExample)(e,n)}return(0,A.default)((0,Q.memoizedSampleFromSchema)(e,n),null,2)},t.parseSearch=function(){var e={},t=te.default.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]))}return e},t.btoa=function(t){var n=void 0;return n=t instanceof e?t:new e(t.toString(),"utf-8"),n.toString("base64")},t.sorters={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},t.buildFormData=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},t.shallowEqualKeys=function(e,t,n){return!!(0,K.default)(n,function(n){return(0,Z.default)(e[n],t[n])})},t.createDeepLinkPath=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"_"):""});t.escapeDeepLinkPath=function(e){return(0,re.default)(ye(e))},t.getExtensions=function(e){return e.filter(function(e,t){return/^x-/.test(t)})}}).call(t,n(40).Buffer)},function(e,t,n){"use strict";var r=n(32),i=r;e.exports=i},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var i=new Error(n);throw i.name="Invariant Violation",i.framesToPop=1,i}e.exports=r},function(e,t,n){"use strict";function r(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof b.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function i(e){function t(t,n,r,i,o,a){for(var s=arguments.length,u=Array(s>6?s-6:0),l=6;l<s;l++)u[l-6]=arguments[l];if(a=a||r,i=i||x,null!=n[r])return e.apply(void 0,[n,r,i,o,a].concat(u));var c=o;return t?new Error("Required "+c+" `"+a+"` was not specified in `"+i+"`."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function o(e,t){function n(n,i,o,a,s){var u=n[i];if(!t(u)){var l=r(u);return new Error("Invalid "+a+" `"+s+"` of type `"+l+"` supplied to `"+o+"`, expected `"+e+"`.")}return null}return i(n)}function a(e,t,n){function o(i,o,a,s,u){for(var l=arguments.length,c=Array(l>5?l-5:0),p=5;p<l;p++)c[p-5]=arguments[p];var f=i[o];if(!n(f)){var h=s,d=r(f);return new Error("Invalid "+h+" `"+u+"` of type `"+d+"` supplied to `"+a+"`, expected an Immutable.js "+t+".")}if("function"!=typeof e)return new Error("Invalid typeChecker supplied to `"+a+"` for propType `"+u+"`, expected a function.");for(var m=f.toArray(),v=0,g=m.length;v<g;v++){var y=e.apply(void 0,[m,v,a,s,u+"["+v+"]"].concat(c));if(y instanceof Error)return y}}return i(o)}function s(e){function t(t,n,r,i,o){for(var a=arguments.length,s=Array(a>5?a-5:0),u=5;u<a;u++)s[u-5]=arguments[u];var l=t[n];if("function"!=typeof e)return new Error("Invalid keysTypeChecker (optional second argument) supplied to `"+r+"` for propType `"+o+"`, expected a function.");for(var c=l.keySeq().toArray(),p=0,f=c.length;p<f;p++){var h=e.apply(void 0,[c,p,r,i,o+" -> key("+c[p]+")"].concat(s));if(h instanceof Error)return h}}return i(t)}function u(e){return a(e,"List",b.List.isList)}function l(e,t,n,r){function o(){for(var i=arguments.length,o=Array(i),u=0;u<i;u++)o[u]=arguments[u];return a(e,n,r).apply(void 0,o)||t&&s(t).apply(void 0,o)}return i(o)}function c(e,t){return l(e,t,"Map",b.Map.isMap)}function p(e,t){return l(e,t,"OrderedMap",b.OrderedMap.isOrderedMap)}function f(e){return a(e,"Set",b.Set.isSet)}function h(e){return a(e,"OrderedSet",b.OrderedSet.isOrderedSet)}function d(e){return a(e,"Stack",b.Stack.isStack)}function m(e){return a(e,"Iterable",b.Iterable.isIterable)}function v(e){function t(t,n,i,o,a){for(var s=arguments.length,u=Array(s>5?s-5:0),l=5;l<s;l++)u[l-5]=arguments[l];var c=t[n];if(!(c instanceof b.Record)){var p=r(c),f=o;return new Error("Invalid "+f+" `"+a+"` of type `"+p+"` supplied to `"+i+"`, expected an Immutable.js Record.")}for(var h in e){var d=e[h];if(d){var m=c.toObject(),v=d.apply(void 0,[m,h,i,o,a+"."+h].concat(u));if(v)return v}}}return i(t)}function g(e){function t(t,i,a,s,u){for(var l=arguments.length,c=Array(l>5?l-5:0),p=5;p<l;p++)c[p-5]=arguments[p];var f=t[i];if(!o(f)){var h=r(f),d=s;return new Error("Invalid "+d+" `"+u+"` of type `"+h+"` supplied to `"+a+"`, expected an Immutable.js "+n+".")}var m=f.toObject();for(var v in e){var g=e[v];if(g){var y=g.apply(void 0,[m,v,a,s,u+"."+v].concat(c));if(y)return y}}}var n=void 0===arguments[1]?"Iterable":arguments[1],o=void 0===arguments[2]?b.Iterable.isIterable:arguments[2];return i(t)}function y(e){return g(e)}function _(e){return g(e,"Map",b.Map.isMap)}var b=n(7),x="<<anonymous>>",w={listOf:u,mapOf:c,orderedMapOf:p,setOf:f,orderedSetOf:h,stackOf:d,iterableOf:m,recordOf:v,shape:y,contains:y,mapContains:_,list:o("List",b.List.isList),map:o("Map",b.Map.isMap),orderedMap:o("OrderedMap",b.OrderedMap.isOrderedMap),set:o("Set",b.Set.isSet),orderedSet:o("OrderedSet",b.OrderedSet.isOrderedSet),stack:o("Stack",b.Stack.isStack),seq:o("Seq",b.Seq.isSeq),record:o("Record",function(e){return e instanceof b.Record}),iterable:o("Iterable",b.Iterable.isIterable)};e.exports=w},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/* +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["esprima"],t):"object"==typeof exports?exports.SwaggerUIBundle=t(function(){try{return require("esprima")}catch(e){}}()):e.SwaggerUIBundle=t(e.esprima)}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=488)}([function(e,t,n){"use strict";e.exports=n(104)},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:J(e)}function r(e){return s(e)?e:K(e)}function o(e){return u(e)?e:Y(e)}function i(e){return a(e)&&!c(e)?e:$(e)}function a(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function u(e){return!(!e||!e[h])}function c(e){return s(e)||u(e)}function l(e){return!(!e||!e[d])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=u,n.isAssociative=c,n.isOrdered=l,n.Keyed=r,n.Indexed=o,n.Set=i;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",m=5,v=1<<m,g=v-1,y={},b={value:!1},_={value:!1};function w(e){return e.value=!1,e}function x(e){e&&(e.value=!0)}function E(){}function S(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function C(e){return void 0===e.size&&(e.size=e.__iterate(O)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?C(e)+t:t}function O(){return!0}function A(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function T(e,t){return P(e,t,0)}function j(e,t){return P(e,t,t)}function P(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var I=0,M=1,N=2,R="function"==typeof Symbol&&Symbol.iterator,D="@@iterator",L=R||D;function U(e){this.next=e}function q(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function F(){return{value:void 0,done:!0}}function B(e){return!!H(e)}function z(e){return e&&"function"==typeof e.next}function V(e){var t=H(e);return t&&t.call(e)}function H(e){var t=e&&(R&&e[R]||e[D]);if("function"==typeof t)return t}function W(e){return e&&"number"==typeof e.length}function J(e){return null==e?ie():a(e)?e.toSeq():function(e){var t=ue(e)||"object"==typeof e&&new te(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function K(e){return null==e?ie().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():ae(e)}function Y(e){return null==e?ie():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():se(e)}function $(e){return(null==e?ie():a(e)?s(e)?e.entrySeq():e:se(e)).toSetSeq()}U.prototype.toString=function(){return"[Iterator]"},U.KEYS=I,U.VALUES=M,U.ENTRIES=N,U.prototype.inspect=U.prototype.toSource=function(){return this.toString()},U.prototype[L]=function(){return this},t(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},J.prototype.__iterate=function(e,t){return ce(this,e,t,!0)},J.prototype.__iterator=function(e,t){return le(this,e,t,!0)},t(K,J),K.prototype.toKeyedSeq=function(){return this},t(Y,J),Y.of=function(){return Y(arguments)},Y.prototype.toIndexedSeq=function(){return this},Y.prototype.toString=function(){return this.__toString("Seq [","]")},Y.prototype.__iterate=function(e,t){return ce(this,e,t,!1)},Y.prototype.__iterator=function(e,t){return le(this,e,t,!1)},t($,J),$.of=function(){return $(arguments)},$.prototype.toSetSeq=function(){return this},J.isSeq=oe,J.Keyed=K,J.Set=$,J.Indexed=Y;var G,Z,X,Q="@@__IMMUTABLE_SEQ__@@";function ee(e){this._array=e,this.size=e.length}function te(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function ne(e){this._iterable=e,this.size=e.length||e.size}function re(e){this._iterator=e,this._iteratorCache=[]}function oe(e){return!(!e||!e[Q])}function ie(){return G||(G=new ee([]))}function ae(e){var t=Array.isArray(e)?new ee(e).fromEntrySeq():z(e)?new re(e).fromEntrySeq():B(e)?new ne(e).fromEntrySeq():"object"==typeof e?new te(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function se(e){var t=ue(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ue(e){return W(e)?new ee(e):z(e)?new re(e):B(e)?new ne(e):void 0}function ce(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var s=o[n?i-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function le(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new U(function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:q(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function pe(e,t){return t?function e(t,n,r,o){return Array.isArray(n)?t.call(o,r,Y(n).map(function(r,o){return e(t,r,o,n)})):he(n)?t.call(o,r,K(n).map(function(r,o){return e(t,r,o,n)})):n}(t,e,"",{"":e}):fe(e)}function fe(e){return Array.isArray(e)?Y(e).map(fe).toList():he(e)?K(e).map(fe).toMap():e}function he(e){return e&&(e.constructor===Object||void 0===e.constructor)}function de(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function me(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||u(e)!==u(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(l(e)){var r=e.entries();return t.every(function(e,t){var o=r.next().value;return o&&de(o[1],e)&&(n||de(o[0],t))})&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var p=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):o?!de(t,e.get(r,y)):!de(e.get(r,y),t))return p=!1,!1});return p&&e.size===f}function ve(e,t){if(!(this instanceof ve))return new ve(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(Z)return Z;Z=this}}function ge(e,t){if(!e)throw new Error(t)}function ye(e,t,n){if(!(this instanceof ye))return new ye(e,t,n);if(ge(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(X)return X;X=this}}function be(){throw TypeError("Abstract")}function _e(){}function we(){}function xe(){}J.prototype[Q]=!0,t(ee,Y),ee.prototype.get=function(e,t){return this.has(e)?this._array[k(this,e)]:t},ee.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},ee.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new U(function(){return o>r?{value:void 0,done:!0}:q(e,o,n[t?r-o++:o++])})},t(te,K),te.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},te.prototype.has=function(e){return this._object.hasOwnProperty(e)},te.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},te.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new U(function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:q(e,a,n[a])})},te.prototype[d]=!0,t(ne,Y),ne.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=V(this._iterable),r=0;if(z(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},ne.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=V(this._iterable);if(!z(n))return new U(F);var r=0;return new U(function(){var t=n.next();return t.done?t:q(e,r++,t.value)})},t(re,Y),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===e(o[i],i++,this))return i;for(;!(n=r.next()).done;){var a=n.value;if(o[i]=a,!1===e(a,i++,this))break}return i},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new U(function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return q(e,o,r[o++])})},t(ve,Y),ve.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},ve.prototype.get=function(e,t){return this.has(e)?this._value:t},ve.prototype.includes=function(e){return de(this._value,e)},ve.prototype.slice=function(e,t){var n=this.size;return A(e,t,n)?this:new ve(this._value,j(t,n)-T(e,n))},ve.prototype.reverse=function(){return this},ve.prototype.indexOf=function(e){return de(this._value,e)?0:-1},ve.prototype.lastIndexOf=function(e){return de(this._value,e)?this.size:-1},ve.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},ve.prototype.__iterator=function(e,t){var n=this,r=0;return new U(function(){return r<n.size?q(e,r++,n._value):{value:void 0,done:!0}})},ve.prototype.equals=function(e){return e instanceof ve?de(this._value,e._value):me(e)},t(ye,Y),ye.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},ye.prototype.get=function(e,t){return this.has(e)?this._start+k(this,e)*this._step:t},ye.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},ye.prototype.slice=function(e,t){return A(e,t,this.size)?this:(e=T(e,this.size),(t=j(t,this.size))<=e?new ye(0,0):new ye(this.get(e,this._end),this.get(t,this._end),this._step))},ye.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},ye.prototype.lastIndexOf=function(e){return this.indexOf(e)},ye.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;i<=n;i++){if(!1===e(o,i,this))return i+1;o+=t?-r:r}return i},ye.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;return new U(function(){var a=o;return o+=t?-r:r,i>n?{value:void 0,done:!0}:q(e,i++,a)})},ye.prototype.equals=function(e){return e instanceof ye?this._start===e._start&&this._end===e._end&&this._step===e._step:me(this,e)},t(be,n),t(_e,be),t(we,be),t(xe,be),be.Keyed=_e,be.Indexed=we,be.Set=xe;var Ee="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Se(e){return e>>>1&1073741824|3221225471&e}function Ce(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return Se(n)}if("string"===t)return e.length>Me?function(e){var t=De[e];return void 0===t&&(t=ke(e),Re===Ne&&(Re=0,De={}),Re++,De[e]=t),t}(e):ke(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(je&&void 0!==(t=Oe.get(e)))return t;if(void 0!==(t=e[Ie]))return t;if(!Te){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Ie]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Pe,1073741824&Pe&&(Pe=0),je)Oe.set(e,t);else{if(void 0!==Ae&&!1===Ae(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Te)Object.defineProperty(e,Ie,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Ie]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Ie]=t}}return t}(e);if("function"==typeof e.toString)return ke(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ke(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Se(t)}var Oe,Ae=Object.isExtensible,Te=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),je="function"==typeof WeakMap;je&&(Oe=new WeakMap);var Pe=0,Ie="__immutablehash__";"function"==typeof Symbol&&(Ie=Symbol(Ie));var Me=16,Ne=255,Re=0,De={};function Le(e){ge(e!==1/0,"Cannot perform this action with an infinite size.")}function Ue(e){return null==e?Xe():qe(e)&&!l(e)?e:Xe().withMutations(function(t){var n=r(e);Le(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function qe(e){return!(!e||!e[Be])}t(Ue,_e),Ue.of=function(){var t=e.call(arguments,0);return Xe().withMutations(function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}})},Ue.prototype.toString=function(){return this.__toString("Map {","}")},Ue.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Ue.prototype.set=function(e,t){return Qe(this,e,t)},Ue.prototype.setIn=function(e,t){return this.updateIn(e,y,function(){return t})},Ue.prototype.remove=function(e){return Qe(this,e,y)},Ue.prototype.deleteIn=function(e){return this.updateIn(e,function(){return y})},Ue.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Ue.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=function e(t,n,r,o){var i=t===y,a=n.next();if(a.done){var s=i?r:t,u=o(s);return u===s?t:u}ge(i||t&&t.set,"invalid keyPath");var c=a.value,l=i?y:t.get(c,y),p=e(l,n,r,o);return p===l?t:p===y?t.remove(c):(i?Xe():t).set(c,p)}(this,rn(e),t,n);return r===y?void 0:r},Ue.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Xe()},Ue.prototype.merge=function(){return rt(this,void 0,arguments)},Ue.prototype.mergeWith=function(t){var n=e.call(arguments,1);return rt(this,t,n)},Ue.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]})},Ue.prototype.mergeDeep=function(){return rt(this,ot,arguments)},Ue.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return rt(this,it(t),n)},Ue.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Xe(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]})},Ue.prototype.sort=function(e){return Tt(Jt(this,e))},Ue.prototype.sortBy=function(e,t){return Tt(Jt(this,t,e))},Ue.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Ue.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new E)},Ue.prototype.asImmutable=function(){return this.__ensureOwner()},Ue.prototype.wasAltered=function(){return this.__altered},Ue.prototype.__iterator=function(e,t){return new Ye(this,e,t)},Ue.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},Ue.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ze(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Ue.isMap=qe;var Fe,Be="@@__IMMUTABLE_MAP__@@",ze=Ue.prototype;function Ve(e,t){this.ownerID=e,this.entries=t}function He(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function We(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Je(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Ke(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&Ge(e._root)}function $e(e,t){return q(e,t[0],t[1])}function Ge(e,t){return{node:e,index:0,__prev:t}}function Ze(e,t,n,r){var o=Object.create(ze);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Xe(){return Fe||(Fe=Ze(0))}function Qe(e,t,n){var r,o;if(e._root){var i=w(b),a=w(_);if(r=et(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===y?-1:1:0)}else{if(n===y)return e;o=1,r=new Ve(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ze(o,r):Xe()}function et(e,t,n,r,o,i,a,s){return e?e.update(t,n,r,o,i,a,s):i===y?e:(x(s),x(a),new Ke(t,r,[o,i]))}function tt(e){return e.constructor===Ke||e.constructor===Je}function nt(e,t,n,r,o){if(e.keyHash===r)return new Je(t,r,[e.entry,o]);var i,a=(0===n?e.keyHash:e.keyHash>>>n)&g,s=(0===n?r:r>>>n)&g;return new He(t,1<<a|1<<s,a===s?[nt(e,t,n+m,r,o)]:(i=new Ke(t,r,o),a<s?[e,i]:[i,e]))}function rt(e,t,n){for(var o=[],i=0;i<n.length;i++){var s=n[i],u=r(s);a(s)||(u=u.map(function(e){return pe(e)})),o.push(u)}return at(e,t,o)}function ot(e,t,n){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):de(e,t)?e:t}function it(e){return function(t,n,r){if(t&&t.mergeDeepWith&&a(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return de(t,o)?t:o}}function at(e,t,n){return 0===(n=n.filter(function(e){return 0!==e.size})).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations(function(e){for(var r=t?function(n,r){e.update(r,y,function(e){return e===y?n:t(e,n,r)})}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)}):e.constructor(n[0])}function st(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function ut(e,t,n,r){var o=r?e:S(e);return o[t]=n,o}ze[Be]=!0,ze.delete=ze.remove,ze.removeIn=ze.deleteIn,Ve.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(de(n,o[i][0]))return o[i][1];return r},Ve.prototype.update=function(e,t,n,r,o,i,a){for(var s=o===y,u=this.entries,c=0,l=u.length;c<l&&!de(r,u[c][0]);c++);var p=c<l;if(p?u[c][1]===o:s)return this;if(x(a),(s||!p)&&x(i),!s||1!==u.length){if(!p&&!s&&u.length>=ct)return function(e,t,n,r){e||(e=new E);for(var o=new Ke(e,Ce(n),[n,r]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}(e,u,r,o);var f=e&&e===this.ownerID,h=f?u:S(u);return p?s?c===l-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Ve(e,h)}},He.prototype.get=function(e,t,n,r){void 0===t&&(t=Ce(n));var o=1<<((0===e?t:t>>>e)&g),i=this.bitmap;return 0==(i&o)?r:this.nodes[st(i&o-1)].get(e+m,t,n,r)},He.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var s=(0===t?n:n>>>t)&g,u=1<<s,c=this.bitmap,l=0!=(c&u);if(!l&&o===y)return this;var p=st(c&u-1),f=this.nodes,h=l?f[p]:void 0,d=et(h,e,t+m,n,r,o,i,a);if(d===h)return this;if(!l&&d&&f.length>=lt)return function(e,t,n,r,o){for(var i=0,a=new Array(v),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[i++]:void 0;return a[r]=o,new We(e,i+1,a)}(e,f,c,s,d);if(l&&!d&&2===f.length&&tt(f[1^p]))return f[1^p];if(l&&d&&1===f.length&&tt(d))return d;var b=e&&e===this.ownerID,_=l?d?c:c^u:c|u,w=l?d?ut(f,p,d,b):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a<r;a++)a===t&&(i=1),o[a]=e[a+i];return o}(f,p,b):function(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var i=new Array(o),a=0,s=0;s<o;s++)s===t?(i[s]=n,a=-1):i[s]=e[s+a];return i}(f,p,d,b);return b?(this.bitmap=_,this.nodes=w,this):new He(e,_,w)},We.prototype.get=function(e,t,n,r){void 0===t&&(t=Ce(n));var o=(0===e?t:t>>>e)&g,i=this.nodes[o];return i?i.get(e+m,t,n,r):r},We.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var s=(0===t?n:n>>>t)&g,u=o===y,c=this.nodes,l=c[s];if(u&&!l)return this;var p=et(l,e,t+m,n,r,o,i,a);if(p===l)return this;var f=this.count;if(l){if(!p&&--f<pt)return function(e,t,n,r){for(var o=0,i=0,a=new Array(n),s=0,u=1,c=t.length;s<c;s++,u<<=1){var l=t[s];void 0!==l&&s!==r&&(o|=u,a[i++]=l)}return new He(e,o,a)}(e,c,f,s)}else f++;var h=e&&e===this.ownerID,d=ut(c,s,p,h);return h?(this.count=f,this.nodes=d,this):new We(e,f,d)},Je.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(de(n,o[i][0]))return o[i][1];return r},Je.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Ce(r));var s=o===y;if(n!==this.keyHash)return s?this:(x(a),x(i),nt(this,e,t,n,[r,o]));for(var u=this.entries,c=0,l=u.length;c<l&&!de(r,u[c][0]);c++);var p=c<l;if(p?u[c][1]===o:s)return this;if(x(a),(s||!p)&&x(i),s&&2===l)return new Ke(e,this.keyHash,u[1^c]);var f=e&&e===this.ownerID,h=f?u:S(u);return p?s?c===l-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Je(e,this.keyHash,h)},Ke.prototype.get=function(e,t,n,r){return de(n,this.entry[0])?this.entry[1]:r},Ke.prototype.update=function(e,t,n,r,o,i,a){var s=o===y,u=de(r,this.entry[0]);return(u?o===this.entry[1]:s)?this:(x(a),s?void x(i):u?e&&e===this.ownerID?(this.entry[1]=o,this):new Ke(e,this.keyHash,[r,o]):(x(i),nt(this,e,t,Ce(r),[r,o])))},Ve.prototype.iterate=Je.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},He.prototype.iterate=We.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[t?o-r:r];if(i&&!1===i.iterate(e,t))return!1}},Ke.prototype.iterate=function(e,t){return e(this.entry)},t(Ye,U),Ye.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return $e(e,r.entry)}else if(r.entries){if(o<=(n=r.entries.length-1))return $e(e,r.entries[this._reverse?n-o:o])}else if(o<=(n=r.nodes.length-1)){var i=r.nodes[this._reverse?n-o:o];if(i){if(i.entry)return $e(e,i.entry);t=this._stack=Ge(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var ct=v/4,lt=v/2,pt=v/4;function ft(e){var t=xt();if(null==e)return t;if(ht(e))return e;var n=o(e),r=n.size;return 0===r?t:(Le(r),r>0&&r<v?wt(0,r,m,null,new vt(n.toArray())):t.withMutations(function(e){e.setSize(r),n.forEach(function(t,n){return e.set(n,t)})}))}function ht(e){return!(!e||!e[dt])}t(ft,we),ft.of=function(){return this(arguments)},ft.prototype.toString=function(){return this.__toString("List [","]")},ft.prototype.get=function(e,t){if((e=k(this,e))>=0&&e<this.size){var n=Ct(this,e+=this._origin);return n&&n.array[e&g]}return t},ft.prototype.set=function(e,t){return function(e,t,n){if((t=k(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations(function(e){t<0?kt(e,t).set(0,n):kt(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,o=e._root,i=w(_);return t>=At(e._capacity)?r=Et(r,e.__ownerID,0,t,n,i):o=Et(o,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):wt(e._origin,e._capacity,e._level,o,r):e}(this,e,t)},ft.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},ft.prototype.insert=function(e,t){return this.splice(e,0,t)},ft.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=m,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):xt()},ft.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){kt(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])})},ft.prototype.pop=function(){return kt(this,0,-1)},ft.prototype.unshift=function(){var e=arguments;return this.withMutations(function(t){kt(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])})},ft.prototype.shift=function(){return kt(this,1)},ft.prototype.merge=function(){return Ot(this,void 0,arguments)},ft.prototype.mergeWith=function(t){var n=e.call(arguments,1);return Ot(this,t,n)},ft.prototype.mergeDeep=function(){return Ot(this,ot,arguments)},ft.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return Ot(this,it(t),n)},ft.prototype.setSize=function(e){return kt(this,0,e)},ft.prototype.slice=function(e,t){var n=this.size;return A(e,t,n)?this:kt(this,T(e,n),j(t,n))},ft.prototype.__iterator=function(e,t){var n=0,r=_t(this,t);return new U(function(){var t=r();return t===bt?{value:void 0,done:!0}:q(e,n++,t)})},ft.prototype.__iterate=function(e,t){for(var n,r=0,o=_t(this,t);(n=o())!==bt&&!1!==e(n,r++,this););return r},ft.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?wt(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},ft.isList=ht;var dt="@@__IMMUTABLE_LIST__@@",mt=ft.prototype;function vt(e,t){this.array=e,this.ownerID=t}mt[dt]=!0,mt.delete=mt.remove,mt.setIn=ze.setIn,mt.deleteIn=mt.removeIn=ze.removeIn,mt.update=ze.update,mt.updateIn=ze.updateIn,mt.mergeIn=ze.mergeIn,mt.mergeDeepIn=ze.mergeDeepIn,mt.withMutations=ze.withMutations,mt.asMutable=ze.asMutable,mt.asImmutable=ze.asImmutable,mt.wasAltered=ze.wasAltered,vt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&g;if(r>=this.array.length)return new vt([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-m,n))===a&&i)return this}if(i&&!o)return this;var s=St(this,e);if(!i)for(var u=0;u<r;u++)s.array[u]=void 0;return o&&(s.array[r]=o),s},vt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&g;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-m,n))===i&&o===this.array.length-1)return this}var a=St(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var gt,yt,bt={};function _t(e,t){var n=e._origin,r=e._capacity,o=At(r),i=e._tail;return a(e._root,e._level,0);function a(e,s,u){return 0===s?function(e,a){var s=a===o?i&&i.array:e&&e.array,u=a>n?0:n-a,c=r-a;return c>v&&(c=v),function(){if(u===c)return bt;var e=t?--c:u++;return s&&s[e]}}(e,u):function(e,o,i){var s,u=e&&e.array,c=i>n?0:n-i>>o,l=1+(r-i>>o);return l>v&&(l=v),function(){for(;;){if(s){var e=s();if(e!==bt)return e;s=null}if(c===l)return bt;var n=t?--l:c++;s=a(u&&u[n],o-m,i+(n<<o))}}}(e,s,u)}}function wt(e,t,n,r,o,i,a){var s=Object.create(mt);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=o,s.__ownerID=i,s.__hash=a,s.__altered=!1,s}function xt(){return gt||(gt=wt(0,0,m))}function Et(e,t,n,r,o,i){var a,s=r>>>n&g,u=e&&s<e.array.length;if(!u&&void 0===o)return e;if(n>0){var c=e&&e.array[s],l=Et(c,t,n-m,r,o,i);return l===c?e:((a=St(e,t)).array[s]=l,a)}return u&&e.array[s]===o?e:(x(i),a=St(e,t),void 0===o&&s===a.array.length-1?a.array.pop():a.array[s]=o,a)}function St(e,t){return t&&e&&t===e.ownerID?e:new vt(e?e.array.slice():[],t)}function Ct(e,t){if(t>=At(e._capacity))return e._tail;if(t<1<<e._level+m){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&g],r-=m;return n}}function kt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new E,o=e._origin,i=e._capacity,a=o+t,s=void 0===n?i:n<0?i+n:o+n;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var u=e._level,c=e._root,l=0;a+l<0;)c=new vt(c&&c.array.length?[void 0,c]:[],r),l+=1<<(u+=m);l&&(a+=l,o+=l,s+=l,i+=l);for(var p=At(i),f=At(s);f>=1<<u+m;)c=new vt(c&&c.array.length?[c]:[],r),u+=m;var h=e._tail,d=f<p?Ct(e,s-1):f>p?new vt([],r):h;if(h&&f>p&&a<i&&h.array.length){for(var v=c=St(c,r),y=u;y>m;y-=m){var b=p>>>y&g;v=v.array[b]=St(v.array[b],r)}v.array[p>>>m&g]=h}if(s<i&&(d=d&&d.removeAfter(r,0,s)),a>=f)a-=f,s-=f,u=m,c=null,d=d&&d.removeBefore(r,0,a);else if(a>o||f<p){for(l=0;c;){var _=a>>>u&g;if(_!==f>>>u&g)break;_&&(l+=(1<<u)*_),u-=m,c=c.array[_]}c&&a>o&&(c=c.removeBefore(r,u,a-l)),c&&f<p&&(c=c.removeAfter(r,u,f-l)),l&&(a-=l,s-=l)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=u,e._root=c,e._tail=d,e.__hash=void 0,e.__altered=!0,e):wt(a,s,u,c,d)}function Ot(e,t,n){for(var r=[],i=0,s=0;s<n.length;s++){var u=n[s],c=o(u);c.size>i&&(i=c.size),a(u)||(c=c.map(function(e){return pe(e)})),r.push(c)}return i>e.size&&(e=e.setSize(i)),at(e,t,r)}function At(e){return e<v?0:e-1>>>m<<m}function Tt(e){return null==e?It():jt(e)?e:It().withMutations(function(t){var n=r(e);Le(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function jt(e){return qe(e)&&l(e)}function Pt(e,t,n,r){var o=Object.create(Tt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function It(){return yt||(yt=Pt(Xe(),xt()))}function Mt(e,t,n){var r,o,i=e._map,a=e._list,s=i.get(t),u=void 0!==s;if(n===y){if(!u)return e;a.size>=v&&a.size>=2*i.size?(r=(o=a.filter(function(e,t){return void 0!==e&&s!==t})).toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=s===a.size-1?a.pop():a.set(s,void 0))}else if(u){if(n===a.get(s)[1])return e;r=i,o=a.set(s,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Pt(r,o)}function Nt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Rt(e){this._iter=e,this.size=e.size}function Dt(e){this._iter=e,this.size=e.size}function Lt(e){this._iter=e,this.size=e.size}function Ut(e){var t=en(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=tn,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===N){var r=e.__iterator(t,n);return new U(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===M?I:M,n)},t}function qt(e,t,n){var r=en(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,y);return i===y?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate(function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)},o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(N,o);return new U(function(){var o=i.next();if(o.done)return o;var a=o.value,s=a[0];return q(r,s,t.call(n,a[1],s,e),o)})},r}function Ft(e,t){var n=en(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Ut(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=tn,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function Bt(e,t,n,r){var o=en(e);return r&&(o.has=function(r){var o=e.get(r,y);return o!==y&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,y);return i!==y&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,s=0;return e.__iterate(function(e,i,u){if(t.call(n,e,i,u))return s++,o(e,r?i:s-1,a)},i),s},o.__iteratorUncached=function(o,i){var a=e.__iterator(N,i),s=0;return new U(function(){for(;;){var i=a.next();if(i.done)return i;var u=i.value,c=u[0],l=u[1];if(t.call(n,l,c,e))return q(o,r?c:s++,l,i)}})},o}function zt(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=o:n|=0),A(t,n,o))return e;var i=T(t,o),a=j(n,o);if(i!=i||a!=a)return zt(e.toSeq().cacheResult(),t,n,r);var s,u=a-i;u==u&&(s=u<0?0:u);var c=en(e);return c.size=0===s?s:e.size&&s||void 0,!r&&oe(e)&&s>=0&&(c.get=function(t,n){return(t=k(this,t))>=0&&t<s?e.get(t+i,n):n}),c.__iterateUncached=function(t,n){var o=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,u=!0,c=0;return e.__iterate(function(e,n){if(!u||!(u=a++<i))return c++,!1!==t(e,r?n:c-1,o)&&c!==s}),c},c.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var o=0!==s&&e.__iterator(t,n),a=0,u=0;return new U(function(){for(;a++<i;)o.next();if(++u>s)return{value:void 0,done:!0};var e=o.next();return r||t===M?e:q(t,u-1,t===I?void 0:e.value[1],e)})},c}function Vt(e,t,n,r){var o=en(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=!0,u=0;return e.__iterate(function(e,i,c){if(!s||!(s=t.call(n,e,i,c)))return u++,o(e,r?i:u-1,a)}),u},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator(N,i),u=!0,c=0;return new U(function(){var e,i,l;do{if((e=s.next()).done)return r||o===M?e:q(o,c++,o===I?void 0:e.value[1],e);var p=e.value;i=p[0],l=p[1],u&&(u=t.call(n,l,i,a))}while(u);return o===N?e:q(o,i,l,e)})},o}function Ht(e,t){var n=s(e),o=[e].concat(t).map(function(e){return a(e)?n&&(e=r(e)):e=n?ae(e):se(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&s(i)||u(e)&&u(i))return i}var c=new ee(o);return n?c=c.toKeyedSeq():u(e)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=o.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),c}function Wt(e,t,n){var r=en(e);return r.__iterateUncached=function(r,o){var i=0,s=!1;return function e(u,c){var l=this;u.__iterate(function(o,u){return(!t||c<t)&&a(o)?e(o,c+1):!1===r(o,n?u:i++,l)&&(s=!0),!s},o)}(e,0),i},r.__iteratorUncached=function(r,o){var i=e.__iterator(r,o),s=[],u=0;return new U(function(){for(;i;){var e=i.next();if(!1===e.done){var c=e.value;if(r===N&&(c=c[1]),t&&!(s.length<t)||!a(c))return n?e:q(r,u++,c,e);s.push(i),i=c.__iterator(r,o)}else i=s.pop()}return{value:void 0,done:!0}})},r}function Jt(e,t,n){t||(t=nn);var r=s(e),o=0,i=e.toSeq().map(function(t,r){return[r,t,o++,n?n(t,r,e):t]}).toArray();return i.sort(function(e,n){return t(e[3],n[3])||e[2]-n[2]}).forEach(r?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),r?K(i):u(e)?Y(i):$(i)}function Kt(e,t,n){if(t||(t=nn),n){var r=e.toSeq().map(function(t,r){return[t,n(t,r,e)]}).reduce(function(e,n){return Yt(t,e[1],n[1])?n:e});return r&&r[0]}return e.reduce(function(e,n){return Yt(t,e,n)?n:e})}function Yt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}function $t(e,t,r){var o=en(e);return o.size=new ee(r).map(function(e){return e.size}).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(M,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map(function(e){return e=n(e),V(o?e.reverse():e)}),a=0,s=!1;return new U(function(){var n;return s||(n=i.map(function(e){return e.next()}),s=n.some(function(e){return e.done})),s?{value:void 0,done:!0}:q(e,a++,t.apply(null,n.map(function(e){return e.value})))})},o}function Gt(e,t){return oe(e)?t:e.constructor(t)}function Zt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Xt(e){return Le(e.size),C(e)}function Qt(e){return s(e)?r:u(e)?o:i}function en(e){return Object.create((s(e)?K:u(e)?Y:$).prototype)}function tn(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):J.prototype.cacheResult.call(this)}function nn(e,t){return e>t?1:e<t?-1:0}function rn(e){var t=V(e);if(!t){if(!W(e))throw new TypeError("Expected iterable or array-like: "+e);t=V(n(e))}return t}function on(e,t){var n,r=function(i){if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var a=Object.keys(e);!function(e,t){try{t.forEach(function(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){ge(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}.bind(void 0,e))}catch(e){}}(o,a),o.size=a.length,o._name=t,o._keys=a,o._defaultValues=e}this._map=Ue(i)},o=r.prototype=Object.create(an);return o.constructor=r,r}t(Tt,Ue),Tt.of=function(){return this(arguments)},Tt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Tt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Tt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):It()},Tt.prototype.set=function(e,t){return Mt(this,e,t)},Tt.prototype.remove=function(e){return Mt(this,e,y)},Tt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Tt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Tt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Tt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Pt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Tt.isOrderedMap=jt,Tt.prototype[d]=!0,Tt.prototype.delete=Tt.prototype.remove,t(Nt,K),Nt.prototype.get=function(e,t){return this._iter.get(e,t)},Nt.prototype.has=function(e){return this._iter.has(e)},Nt.prototype.valueSeq=function(){return this._iter.valueSeq()},Nt.prototype.reverse=function(){var e=this,t=Ft(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Nt.prototype.map=function(e,t){var n=this,r=qt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Nt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Xt(this):0,function(o){return e(o,t?--n:n++,r)}),t)},Nt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(M,t),r=t?Xt(this):0;return new U(function(){var o=n.next();return o.done?o:q(e,t?--r:r++,o.value,o)})},Nt.prototype[d]=!0,t(Rt,Y),Rt.prototype.includes=function(e){return this._iter.includes(e)},Rt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},Rt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t),r=0;return new U(function(){var t=n.next();return t.done?t:q(e,r++,t.value,t)})},t(Dt,$),Dt.prototype.has=function(e){return this._iter.includes(e)},Dt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},Dt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new U(function(){var t=n.next();return t.done?t:q(e,t.value,t.value,t)})},t(Lt,K),Lt.prototype.entrySeq=function(){return this._iter.toSeq()},Lt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){Zt(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},Lt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new U(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){Zt(r);var o=a(r);return q(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}})},Rt.prototype.cacheResult=Nt.prototype.cacheResult=Dt.prototype.cacheResult=Lt.prototype.cacheResult=tn,t(on,_e),on.prototype.toString=function(){return this.__toString(un(this)+" {","}")},on.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},on.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},on.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=sn(this,Xe()))},on.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+un(this));if(this._map&&!this._map.has(e)&&t===this._defaultValues[e])return this;var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:sn(this,n)},on.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:sn(this,t)},on.prototype.wasAltered=function(){return this._map.wasAltered()},on.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterator(e,t)},on.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterate(e,t)},on.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?sn(this,t,e):(this.__ownerID=e,this._map=t,this)};var an=on.prototype;function sn(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function un(e){return e._name||e.constructor.name||"Record"}function cn(e){return null==e?vn():ln(e)&&!l(e)?e:vn().withMutations(function(t){var n=i(e);Le(n.size),n.forEach(function(e){return t.add(e)})})}function ln(e){return!(!e||!e[fn])}an.delete=an.remove,an.deleteIn=an.removeIn=ze.removeIn,an.merge=ze.merge,an.mergeWith=ze.mergeWith,an.mergeIn=ze.mergeIn,an.mergeDeep=ze.mergeDeep,an.mergeDeepWith=ze.mergeDeepWith,an.mergeDeepIn=ze.mergeDeepIn,an.setIn=ze.setIn,an.update=ze.update,an.updateIn=ze.updateIn,an.withMutations=ze.withMutations,an.asMutable=ze.asMutable,an.asImmutable=ze.asImmutable,t(cn,xe),cn.of=function(){return this(arguments)},cn.fromKeys=function(e){return this(r(e).keySeq())},cn.prototype.toString=function(){return this.__toString("Set {","}")},cn.prototype.has=function(e){return this._map.has(e)},cn.prototype.add=function(e){return dn(this,this._map.set(e,!0))},cn.prototype.remove=function(e){return dn(this,this._map.remove(e))},cn.prototype.clear=function(){return dn(this,this._map.clear())},cn.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter(function(e){return 0!==e.size})).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach(function(t){return e.add(t)})}):this.constructor(t[0])},cn.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return i(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.every(function(e){return e.includes(n)})||e.remove(n)})})},cn.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map(function(e){return i(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.some(function(e){return e.includes(n)})&&e.remove(n)})})},cn.prototype.merge=function(){return this.union.apply(this,arguments)},cn.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},cn.prototype.sort=function(e){return gn(Jt(this,e))},cn.prototype.sortBy=function(e,t){return gn(Jt(this,t,e))},cn.prototype.wasAltered=function(){return this._map.wasAltered()},cn.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate(function(t,r){return e(r,r,n)},t)},cn.prototype.__iterator=function(e,t){return this._map.map(function(e,t){return t}).__iterator(e,t)},cn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},cn.isSet=ln;var pn,fn="@@__IMMUTABLE_SET__@@",hn=cn.prototype;function dn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function mn(e,t){var n=Object.create(hn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function vn(){return pn||(pn=mn(Xe()))}function gn(e){return null==e?xn():yn(e)?e:xn().withMutations(function(t){var n=i(e);Le(n.size),n.forEach(function(e){return t.add(e)})})}function yn(e){return ln(e)&&l(e)}hn[fn]=!0,hn.delete=hn.remove,hn.mergeDeep=hn.merge,hn.mergeDeepWith=hn.mergeWith,hn.withMutations=ze.withMutations,hn.asMutable=ze.asMutable,hn.asImmutable=ze.asImmutable,hn.__empty=vn,hn.__make=mn,t(gn,cn),gn.of=function(){return this(arguments)},gn.fromKeys=function(e){return this(r(e).keySeq())},gn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},gn.isOrderedSet=yn;var bn,_n=gn.prototype;function wn(e,t){var n=Object.create(_n);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function xn(){return bn||(bn=wn(It()))}function En(e){return null==e?Tn():Sn(e)?e:Tn().unshiftAll(e)}function Sn(e){return!(!e||!e[kn])}_n[d]=!0,_n.__empty=xn,_n.__make=wn,t(En,we),En.of=function(){return this(arguments)},En.prototype.toString=function(){return this.__toString("Stack [","]")},En.prototype.get=function(e,t){var n=this._head;for(e=k(this,e);n&&e--;)n=n.next;return n?n.value:t},En.prototype.peek=function(){return this._head&&this._head.value},En.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):An(e,t)},En.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Le(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):An(t,n)},En.prototype.pop=function(){return this.slice(1)},En.prototype.unshift=function(){return this.push.apply(this,arguments)},En.prototype.unshiftAll=function(e){return this.pushAll(e)},En.prototype.shift=function(){return this.pop.apply(this,arguments)},En.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Tn()},En.prototype.slice=function(e,t){if(A(e,t,this.size))return this;var n=T(e,this.size);if(j(t,this.size)!==this.size)return we.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):An(r,o)},En.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?An(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},En.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},En.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new U(function(){if(r){var t=r.value;return r=r.next,q(e,n++,t)}return{value:void 0,done:!0}})},En.isStack=Sn;var Cn,kn="@@__IMMUTABLE_STACK__@@",On=En.prototype;function An(e,t,n,r){var o=Object.create(On);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Tn(){return Cn||(Cn=An(0))}function jn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}On[kn]=!0,On.withMutations=ze.withMutations,On.asMutable=ze.asMutable,On.asImmutable=ze.asImmutable,On.wasAltered=ze.wasAltered,n.Iterator=U,jn(n,{toArray:function(){Le(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new Rt(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new Nt(this,!0)},toMap:function(){return Ue(this.toKeyedSeq())},toObject:function(){Le(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Tt(this.toKeyedSeq())},toOrderedSet:function(){return gn(s(this)?this.valueSeq():this)},toSet:function(){return cn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Dt(this)},toSeq:function(){return u(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return En(s(this)?this.valueSeq():this)},toList:function(){return ft(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return Gt(this,Ht(this,t))},includes:function(e){return this.some(function(t){return de(t,e)})},entries:function(){return this.__iterator(N)},every:function(e,t){Le(this.size);var n=!0;return this.__iterate(function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1}),n},filter:function(e,t){return Gt(this,Bt(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Le(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Le(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""}),t},keys:function(){return this.__iterator(I)},map:function(e,t){return Gt(this,qt(this,e,t))},reduce:function(e,t,n){var r,o;return Le(this.size),arguments.length<2?o=!0:r=t,this.__iterate(function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Gt(this,Ft(this,!0))},slice:function(e,t){return Gt(this,zt(this,e,t,!0))},some:function(e,t){return!this.every(Rn(e),t)},sort:function(e){return Gt(this,Jt(this,e))},values:function(){return this.__iterator(M)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return C(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Ue().asMutable();return e.__iterate(function(o,i){r.update(t.call(n,o,i,e),0,function(e){return e+1})}),r.asImmutable()}(this,e,t)},equals:function(e){return me(this,e)},entrySeq:function(){var e=this;if(e._cache)return new ee(e._cache);var t=e.toSeq().map(Nn).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Rn(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,o,i){if(e.call(t,n,o,i))return r=[o,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(O)},flatMap:function(e,t){return Gt(this,function(e,t,n){var r=Qt(e);return e.toSeq().map(function(o,i){return r(t.call(n,o,i,e))}).flatten(!0)}(this,e,t))},flatten:function(e){return Gt(this,Wt(this,e,!0))},fromEntrySeq:function(){return new Lt(this)},get:function(e,t){return this.find(function(t,n){return de(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,o=rn(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,y):y)===y)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),o=(l(e)?Tt():Ue()).asMutable();e.__iterate(function(i,a){o.update(t.call(n,i,a,e),function(e){return(e=e||[]).push(r?[a,i]:i),e})});var i=Qt(e);return o.map(function(t){return Gt(e,i(t))})}(this,e,t)},has:function(e){return this.get(e,y)!==y},hasIn:function(e){return this.getIn(e,y)!==y},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return de(t,e)})},keySeq:function(){return this.toSeq().map(Mn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Kt(this,e)},maxBy:function(e,t){return Kt(this,t,e)},min:function(e){return Kt(this,e?Dn(e):qn)},minBy:function(e,t){return Kt(this,t?Dn(t):qn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Gt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Gt(this,Vt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Rn(e),t)},sortBy:function(e,t){return Gt(this,Jt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Gt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Gt(this,function(e,t,n){var r=en(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate(function(e,o,s){return t.call(n,e,o,s)&&++a&&r(e,o,i)}),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(N,o),s=!0;return new U(function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,u=o[0],c=o[1];return t.call(n,c,u,i)?r===N?e:q(r,u,c,e):(s=!1,{value:void 0,done:!0})})},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Rn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=l(e),n=s(e),r=t?1:0;return function(e,t){return t=Ee(t,3432918353),t=Ee(t<<15|t>>>-15,461845907),t=Ee(t<<13|t>>>-13,5),t=Ee((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=Se((t=Ee(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Fn(Ce(e),Ce(t))|0}:function(e,t){r=r+Fn(Ce(e),Ce(t))|0}:t?function(e){r=31*r+Ce(e)|0}:function(e){r=r+Ce(e)|0}),r)}(this))}});var Pn=n.prototype;Pn[p]=!0,Pn[L]=Pn.values,Pn.__toJS=Pn.toArray,Pn.__toStringMapper=Ln,Pn.inspect=Pn.toSource=function(){return this.toString()},Pn.chain=Pn.flatMap,Pn.contains=Pn.includes,jn(r,{flip:function(){return Gt(this,Ut(this))},mapEntries:function(e,t){var n=this,r=0;return Gt(this,this.toSeq().map(function(o,i){return e.call(t,[i,o],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Gt(this,this.toSeq().flip().map(function(r,o){return e.call(t,r,o,n)}).flip())}});var In=r.prototype;function Mn(e,t){return t}function Nn(e,t){return[t,e]}function Rn(e){return function(){return!e.apply(this,arguments)}}function Dn(e){return function(){return-e.apply(this,arguments)}}function Ln(e){return"string"==typeof e?JSON.stringify(e):String(e)}function Un(){return S(arguments)}function qn(e,t){return e<t?1:e>t?-1:0}function Fn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return In[f]=!0,In[L]=Pn.entries,In.__toJS=Pn.toObject,In.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Ln(e)},jn(o,{toKeyedSeq:function(){return new Nt(this,!1)},filter:function(e,t){return Gt(this,Bt(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Gt(this,Ft(this,!1))},slice:function(e,t){return Gt(this,zt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=T(e,e<0?this.count():this.size);var r=this.slice(0,e);return Gt(this,1===n?r:r.concat(S(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Gt(this,Wt(this,e,!1))},get:function(e,t){return(e=k(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=k(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Gt(this,function(e,t){var n=en(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return e.__iterate(function(e,r){return(!i||!1!==n(t,i++,o))&&!1!==n(e,i++,o)},r),i},n.__iteratorUncached=function(n,r){var o,i=e.__iterator(M,r),a=0;return new U(function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?q(n,a++,t):q(n,a++,o.value,o)})},n}(this,e))},interleave:function(){var e=[this].concat(S(arguments)),t=$t(this.toSeq(),Y.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Gt(this,n)},keySeq:function(){return ye(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Gt(this,Vt(this,e,t,!1))},zip:function(){var e=[this].concat(S(arguments));return Gt(this,$t(this,Un,e))},zipWith:function(e){var t=S(arguments);return t[0]=this,Gt(this,$t(this,e,t))}}),o.prototype[h]=!0,o.prototype[d]=!0,jn(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=Pn.includes,i.prototype.contains=i.prototype.includes,jn(K,r.prototype),jn(Y,o.prototype),jn($,i.prototype),jn(_e,r.prototype),jn(we,o.prototype),jn(xe,i.prototype),{Iterable:n,Seq:J,Collection:be,Map:Ue,OrderedMap:Tt,List:ft,Stack:En,Set:cn,OrderedSet:gn,Record:on,Range:ye,Repeat:ve,is:de,fromJS:pe}}()},function(e,t,n){var r=n(54);e.exports=function(e,t,n){return t in e?r(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";(function(e){n.d(t,"t",function(){return U}),n.d(t,"A",function(){return q}),n.d(t,"i",function(){return F}),n.d(t,"w",function(){return B}),n.d(t,"r",function(){return z}),n.d(t,"u",function(){return V}),n.d(t,"s",function(){return H}),n.d(t,"q",function(){return W}),n.d(t,"v",function(){return J}),n.d(t,"y",function(){return K}),n.d(t,"z",function(){return Y}),n.d(t,"J",function(){return $}),n.d(t,"f",function(){return G}),n.d(t,"n",function(){return Z}),n.d(t,"p",function(){return X}),n.d(t,"h",function(){return Q}),n.d(t,"E",function(){return ee}),n.d(t,"K",function(){return he}),n.d(t,"o",function(){return de}),n.d(t,"D",function(){return me}),n.d(t,"a",function(){return ve}),n.d(t,"H",function(){return ge}),n.d(t,"b",function(){return ye}),n.d(t,"G",function(){return be}),n.d(t,"F",function(){return _e}),n.d(t,"k",function(){return we}),n.d(t,"d",function(){return xe}),n.d(t,"g",function(){return Ee}),n.d(t,"m",function(){return Se}),n.d(t,"l",function(){return Ce}),n.d(t,"e",function(){return ke}),n.d(t,"I",function(){return Oe}),n.d(t,"x",function(){return Ae}),n.d(t,"B",function(){return Te}),n.d(t,"C",function(){return je}),n.d(t,"j",function(){return Pe}),n.d(t,"c",function(){return Ie});var r=n(28),o=n.n(r),i=(n(13),n(92),n(16)),a=n.n(i),s=n(17),u=n.n(s),c=n(14),l=n.n(c),p=n(26),f=n.n(p),h=n(1),d=n.n(h),m=n(471),v=n(472),g=n.n(v),y=n(270),b=n.n(y),_=n(271),w=n.n(_),x=n(272),E=n.n(x),S=(n(473),n(91)),C=n.n(S),k=n(120),O=n(18),A=n.n(O),T=n(475),j=n.n(T),P=n(122),I=n(476),M=n.n(I),N=n(477),R=n.n(N),D="default",L=function(e){return d.a.Iterable.isIterable(e)};function U(e){try{var t=JSON.parse(e);if(t&&"object"===f()(t))return t}catch(e){}return!1}function q(e){return V(e)?L(e)?e.toJS():e:{}}function F(e){return L(e)?e:e instanceof A.a.File?e:V(e)?l()(e)?d.a.Seq(e).map(F).toList():d.a.OrderedMap(e).map(F):e}function B(e){return l()(e)?e:[e]}function z(e){return"function"==typeof e}function V(e){return!!e&&"object"===f()(e)}function H(e){return"function"==typeof e}function W(e){return l()(e)}var J=w.a;function K(e,t){return u()(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})}function Y(e,t){return u()(e).reduce(function(n,r){var o=t(e[r],r);return o&&"object"===f()(o)&&a()(n,o),n},{})}function $(e){return function(t){t.dispatch,t.getState;return function(t){return function(n){return"function"==typeof n?n(e()):t(n)}}}}function G(e){var t=e.keySeq();return t.contains(D)?D:t.filter(function(e){return"2"===(e+"")[0]}).sort().first()}function Z(e,t){if(!d.a.Iterable.isIterable(e))return d.a.List();var n=e.getIn(l()(t)?t:[t]);return d.a.List.isList(n)?n:d.a.List()}function X(e){var t=document;if(!e)return"";if(e.textContent.length>5e3)return e.textContent;return function(e){for(var n,r,o,i,a,s=e.textContent,u=0,c=s[0],l=1,p=e.innerHTML="",f=0;r=n,n=f<7&&"\\"==n?1:l;){if(l=c,c=s[++u],i=p.length>1,!l||f>8&&"\n"==l||[/\S/.test(l),1,1,!/[$\w]/.test(l),("/"==n||"\n"==n)&&i,'"'==n&&i,"'"==n&&i,s[u-4]+r+n=="--\x3e",r+n=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),o=f&&f<7?f:o,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(l),/[\])]/.test(l),/[$\w]/.test(l),"/"==l&&o<2&&"<"!=n,'"'==l,"'"==l,l+c+s[u+1]+s[u+2]=="\x3c!--",l+c=="/*",l+c=="//","#"==l][--f];);p+=l}}(e)}function Q(e){var t;if([/filename\*=[^']+'\w*'"([^"]+)";?/i,/filename\*=[^']+'\w*'([^;]+);?/i,/filename="([^;]*);?"/i,/filename=([^;]*);?/i].some(function(n){return null!==(t=n.exec(e))}),null!==t&&t.length>1)try{return decodeURIComponent(t[1])}catch(e){console.error(e)}return null}function ee(e){return t=e.replace(/\.[^.\/]*$/,""),b()(g()(t));var t}var te=function(e,t){if(e>t)return"Value must be less than Maximum"},ne=function(e,t){if(e<t)return"Value must be greater than Minimum"},re=function(e){if(!/^-?\d+(\.?\d+)?$/.test(e))return"Value must be a number"},oe=function(e){if(!/^-?\d+$/.test(e))return"Value must be an integer"},ie=function(e){if(e&&!(e instanceof A.a.File))return"Value must be a file"},ae=function(e){if("true"!==e&&"false"!==e&&!0!==e&&!1!==e)return"Value must be a boolean"},se=function(e){if(e&&"string"!=typeof e)return"Value must be a string"},ue=function(e){if(isNaN(Date.parse(e)))return"Value must be a DateTime"},ce=function(e){if(e=e.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(e))return"Value must be a Guid"},le=function(e,t){if(e.length>t)return"Value must be less than MaxLength"},pe=function(e,t){if(e.length<t)return"Value must be greater than MinLength"},fe=function(e,t){if(!new RegExp(t).test(e))return"Value must follow pattern "+t},he=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.isOAS3,o=void 0!==r&&r,i=n.bypassRequiredCheck,a=void 0!==i&&i,s=[],u=e.get("required"),c=Object(P.a)(e,{isOAS3:o}),p=c.schema,h=c.parameterContentMediaType;if(!p)return s;var m=p.get("required"),v=p.get("maximum"),g=p.get("minimum"),y=p.get("type"),b=p.get("format"),_=p.get("maxLength"),w=p.get("minLength"),x=p.get("pattern");if(y&&(u||m||t)){var E="string"===y&&t,S="array"===y&&l()(t)&&t.length,C="array"===y&&d.a.List.isList(t)&&t.count(),k="array"===y&&"string"==typeof t&&t,O="file"===y&&t instanceof A.a.File,T="boolean"===y&&(t||!1===t),j="number"===y&&(t||0===t),I="integer"===y&&(t||0===t),M="object"===y&&"object"===f()(t)&&null!==t,N="object"===y&&"string"==typeof t&&t,R=[E,S,C,k,O,T,j,I,M,N],D=R.some(function(e){return!!e});if((u||m)&&!D&&!a)return s.push("Required field is not provided"),s;if("object"===y&&"string"==typeof t&&(null===h||"application/json"===h))try{JSON.parse(t)}catch(e){return s.push("Parameter string value must be valid JSON"),s}if(x){var L=fe(t,x);L&&s.push(L)}if(_||0===_){var U=le(t,_);U&&s.push(U)}if(w){var q=pe(t,w);q&&s.push(q)}if(v||0===v){var F=te(t,v);F&&s.push(F)}if(g||0===g){var B=ne(t,g);B&&s.push(B)}if("string"===y){var z;if(!(z="date-time"===b?ue(t):"uuid"===b?ce(t):se(t)))return s;s.push(z)}else if("boolean"===y){var V=ae(t);if(!V)return s;s.push(V)}else if("number"===y){var H=re(t);if(!H)return s;s.push(H)}else if("integer"===y){var W=oe(t);if(!W)return s;s.push(W)}else if("array"===y){var J;if(!C||!t.count())return s;J=p.getIn(["items","type"]),t.forEach(function(e,t){var n;"number"===J?n=re(e):"integer"===J?n=oe(e):"string"===J&&(n=se(e)),n&&s.push({index:t,error:n})})}else if("file"===y){var K=ie(t);if(!K)return s;s.push(K)}}return s},de=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'<?xml version="1.0" encoding="UTF-8"?>\n\x3c!-- XML example cannot be generated; root element name is undefined --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return Object(k.memoizedCreateXMLExample)(e,n)}var i=Object(k.memoizedSampleFromSchema)(e,n);return"object"===f()(i)?o()(i,null,2):i},me=function(){var e={},t=A.a.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=r[1]&&decodeURIComponent(r[1])||"")}return e},ve=function(t){return(t instanceof e?t:new e(t.toString(),"utf-8")).toString("base64")},ge={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},ye=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},be=function(e,t,n){return!!E()(n,function(n){return C()(e[n],t[n])})};function _e(e){return"string"!=typeof e||""===e?"":Object(m.sanitizeUrl)(e)}function we(e){if(!d.a.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&u()(e.get("content")||{}).length>0}),n=e.get("default")||d.a.OrderedMap(),r=(n.get("content")||d.a.OrderedMap()).keySeq().toJS().length?n:null;return t||r}var xe=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"%20"):""},Ee=function(e){return j()(xe(e).replace(/%20/g,"_"))},Se=function(e){return e.filter(function(e,t){return/^x-/.test(t)})},Ce=function(e){return e.filter(function(e,t){return/^pattern|maxLength|minLength|maximum|minimum/.test(t)})};function ke(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==f()(e)||l()(e)||null===e||!t)return e;var r=a()({},e);return u()(r).forEach(function(e){e===t&&n(r[e],e)?delete r[e]:r[e]=ke(r[e],t,n)}),r}function Oe(e){if("string"==typeof e)return e;if(e&&e.toJS&&(e=e.toJS()),"object"===f()(e)&&null!==e)try{return o()(e,null,2)}catch(t){return String(e)}return null==e?"":e.toString()}function Ae(e){return"number"==typeof e?e.toString():e}function Te(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.returnAll,r=void 0!==n&&n,o=t.allowHashes,i=void 0===o||o;if(!d.a.Map.isMap(e))throw new Error("paramToIdentifier: received a non-Im.Map parameter as input");var a=e.get("name"),s=e.get("in"),u=[];return e&&e.hashCode&&s&&a&&i&&u.push("".concat(s,".").concat(a,".hash-").concat(e.hashCode())),s&&a&&u.push("".concat(s,".").concat(a)),u.push(a),r?u:u[0]||""}function je(e,t){return Te(e,{returnAll:!0}).map(function(e){return t[e]}).filter(function(e){return void 0!==e})[0]}function Pe(){return Me(M()(32).toString("base64"))}function Ie(e){return Me(R()("sha256").update(e).digest("base64"))}function Me(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}}).call(this,n(64).Buffer)},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var r=n(54);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),r(e,o.key,o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}},function(e,t,n){var r=n(26),o=n(9);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){var r=n(806),o=n(420);function i(t){return e.exports=i=o?r:function(e){return e.__proto__||r(e)},i(t)}e.exports=i},function(e,t,n){var r=n(421),o=n(814);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=r(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){e.exports=n(892)()},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){return e===t}function i(e){var t=arguments.length<=1||void 0===arguments[1]?o:arguments[1],n=null,r=null;return function(){for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return null!==n&&n.length===i.length&&i.every(function(e,r){return t(e,n[r])})||(r=e.apply(void 0,i)),n=i,r}}function a(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var n=t.map(function(e){return typeof e}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function s(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return function(){for(var t=arguments.length,o=Array(t),i=0;i<t;i++)o[i]=arguments[i];var s=0,u=o.pop(),c=a(o),l=e.apply(void 0,[function(){return s++,u.apply(void 0,arguments)}].concat(n)),p=function(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];var a=c.map(function(n){return n.apply(void 0,[e,t].concat(o))});return l.apply(void 0,r(a))};return p.resultFunc=u,p.recomputations=function(){return s},p.resetRecomputations=function(){return s=0},p}}t.__esModule=!0,t.defaultMemoize=i,t.createSelectorCreator=s,t.createStructuredSelector=function(e){var t=arguments.length<=1||void 0===arguments[1]?u:arguments[1];if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t,r){return e[n[r]]=t,e},{})})};var u=t.createSelector=s(i)},function(e,t,n){var r=n(754),o=n(755),i=n(762);e.exports=function(e){return r(e)||o(e)||i()}},function(e,t,n){var r=n(597),o=n(598),i=n(601);e.exports=function(e,t){return r(e)||o(e,t)||i()}},function(e,t,n){e.exports=n(571)},function(e,t,n){"use strict";var r=function(e){};e.exports=function(e,t,n,o,i,a,s,u){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,i,a,s,u],p=0;(c=new Error(t.replace(/%s/g,function(){return l[p++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){e.exports=n(575)},function(e,t,n){e.exports=n(553)},function(e,t){e.exports=function(){var e={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return e;try{e=window;for(var t=0,n=["File","Blob","FormData"];t<n.length;t++){var r=n[t];r in window&&(e[r]=window[r])}}catch(e){console.error(e)}return e}()},function(e,t,n){"use strict";var r=n(1),o="<<anonymous>>",i={listOf:function(e){return c(e,"List",r.List.isList)},mapOf:function(e,t){return l(e,t,"Map",r.Map.isMap)},orderedMapOf:function(e,t){return l(e,t,"OrderedMap",r.OrderedMap.isOrderedMap)},setOf:function(e){return c(e,"Set",r.Set.isSet)},orderedSetOf:function(e){return c(e,"OrderedSet",r.OrderedSet.isOrderedSet)},stackOf:function(e){return c(e,"Stack",r.Stack.isStack)},iterableOf:function(e){return c(e,"Iterable",r.Iterable.isIterable)},recordOf:function(e){return s(function(t,n,o,i,s){for(var u=arguments.length,c=Array(u>5?u-5:0),l=5;l<u;l++)c[l-5]=arguments[l];var p=t[n];if(!(p instanceof r.Record)){var f=a(p);return new Error("Invalid "+i+" `"+s+"` of type `"+f+"` supplied to `"+o+"`, expected an Immutable.js Record.")}for(var h in e){var d=e[h];if(d){var m=p.toObject(),v=d.apply(void 0,[m,h,o,i,s+"."+h].concat(c));if(v)return v}}})},shape:f,contains:f,mapContains:function(e){return p(e,"Map",r.Map.isMap)},list:u("List",r.List.isList),map:u("Map",r.Map.isMap),orderedMap:u("OrderedMap",r.OrderedMap.isOrderedMap),set:u("Set",r.Set.isSet),orderedSet:u("OrderedSet",r.OrderedSet.isOrderedSet),stack:u("Stack",r.Stack.isStack),seq:u("Seq",r.Seq.isSeq),record:u("Record",function(e){return e instanceof r.Record}),iterable:u("Iterable",r.Iterable.isIterable)};function a(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof r.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function s(e){function t(t,n,r,i,a,s){for(var u=arguments.length,c=Array(u>6?u-6:0),l=6;l<u;l++)c[l-6]=arguments[l];return s=s||r,i=i||o,null!=n[r]?e.apply(void 0,[n,r,i,a,s].concat(c)):t?new Error("Required "+a+" `"+s+"` was not specified in `"+i+"`."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function u(e,t){return s(function(n,r,o,i,s){var u=n[r];if(!t(u)){var c=a(u);return new Error("Invalid "+i+" `"+s+"` of type `"+c+"` supplied to `"+o+"`, expected `"+e+"`.")}return null})}function c(e,t,n){return s(function(r,o,i,s,u){for(var c=arguments.length,l=Array(c>5?c-5:0),p=5;p<c;p++)l[p-5]=arguments[p];var f=r[o];if(!n(f)){var h=s,d=a(f);return new Error("Invalid "+h+" `"+u+"` of type `"+d+"` supplied to `"+i+"`, expected an Immutable.js "+t+".")}if("function"!=typeof e)return new Error("Invalid typeChecker supplied to `"+i+"` for propType `"+u+"`, expected a function.");for(var m=f.toArray(),v=0,g=m.length;v<g;v++){var y=e.apply(void 0,[m,v,i,s,u+"["+v+"]"].concat(l));if(y instanceof Error)return y}})}function l(e,t,n,r){return s(function(){for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return c(e,n,r).apply(void 0,i)||t&&(u=t,s(function(e,t,n,r,o){for(var i=arguments.length,a=Array(i>5?i-5:0),s=5;s<i;s++)a[s-5]=arguments[s];var c=e[t];if("function"!=typeof u)return new Error("Invalid keysTypeChecker (optional second argument) supplied to `"+n+"` for propType `"+o+"`, expected a function.");for(var l=c.keySeq().toArray(),p=0,f=l.length;p<f;p++){var h=u.apply(void 0,[l,p,n,r,o+" -> key("+l[p]+")"].concat(a));if(h instanceof Error)return h}})).apply(void 0,i);var u})}function p(e){var t=void 0===arguments[1]?"Iterable":arguments[1],n=void 0===arguments[2]?r.Iterable.isIterable:arguments[2];return s(function(r,o,i,s,u){for(var c=arguments.length,l=Array(c>5?c-5:0),p=5;p<c;p++)l[p-5]=arguments[p];var f=r[o];if(!n(f)){var h=a(f);return new Error("Invalid "+s+" `"+u+"` of type `"+h+"` supplied to `"+i+"`, expected an Immutable.js "+t+".")}var d=f.toObject();for(var m in e){var v=e[m];if(v){var g=v.apply(void 0,[d,m,i,s,u+"."+m].concat(l));if(g)return g}}})}function f(e){return p(e)}e.exports=i},function(e,t,n){var r=n(16);function o(){return e.exports=o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}e.exports=o},function(e,t,n){"use strict";e.exports=function(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}},function(e,t){var n=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";var r=n(57);e.exports=r},function(e,t,n){"use strict";n.r(t),n.d(t,"isOAS3",function(){return s}),n.d(t,"isSwagger2",function(){return u}),n.d(t,"OAS3ComponentWrapFactory",function(){return c});var r=n(20),o=n.n(r),i=n(0),a=n.n(i);function s(e){var t=e.get("openapi");return"string"==typeof t&&(t.startsWith("3.0.")&&t.length>4)}function u(e){var t=e.get("swagger");return"string"==typeof t&&t.startsWith("2.0")}function c(e){return function(t,n){return function(r){return n&&n.specSelectors&&n.specSelectors.specJson?s(n.specSelectors.specJson())?a.a.createElement(e,o()({},r,n,{Ori:t})):a.a.createElement(t,r):(console.warn("OAS3 wrapper: couldn't get spec"),null)}}}},function(e,t,n){"use strict"; +/* object-assign (c) Sindre Sorhus @license MIT +*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=a(e),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))o.call(n,l)&&(u[l]=n[l]);if(r){s=r(n);for(var p=0;p<s.length;p++)i.call(n,s[p])&&(u[s[p]]=n[s[p]])}}return u}},function(e,t,n){var r=n(557),o=n(563);function i(e){return(i="function"==typeof o&&"symbol"==typeof r?function(e){return typeof e}:function(e){return e&&"function"==typeof o&&e.constructor===o&&e!==o.prototype?"symbol":typeof e})(e)}function a(t){return"function"==typeof o&&"symbol"===i(r)?e.exports=a=function(e){return i(e)}:e.exports=a=function(e){return e&&"function"==typeof o&&e.constructor===o&&e!==o.prototype?"symbol":i(e)},a(t)}e.exports=a},function(e,t,n){"use strict";var r=n(21),o=n(115),i=n(422),a=(n(15),o.ID_ATTRIBUTE_NAME),s=i,u="__reactInternalInstance$"+Math.random().toString(36).slice(2);function c(e,t){return 1===e.nodeType&&e.getAttribute(a)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function l(e){for(var t;t=e._renderedComponent;)e=t;return e}function p(e,t){var n=l(e);n._hostNode=t,t[u]=n}function f(e,t){if(!(e._flags&s.hasCachedChildNodes)){var n=e._renderedChildren,o=t.firstChild;e:for(var i in n)if(n.hasOwnProperty(i)){var a=n[i],u=l(a)._domID;if(0!==u){for(;null!==o;o=o.nextSibling)if(c(o,u)){p(a,o);continue e}r("32",u)}}e._flags|=s.hasCachedChildNodes}}function h(e){if(e[u])return e[u];for(var t,n,r=[];!e[u];){if(r.push(e),!e.parentNode)return null;e=e.parentNode}for(;e&&(n=e[u]);e=r.pop())t=n,r.length&&f(n,e);return t}var d={getClosestInstanceFromNode:h,getInstanceFromNode:function(e){var t=h(e);return null!=t&&t._hostNode===e?t:null},getNodeFromInstance:function(e){if(void 0===e._hostNode&&r("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||r("34"),e=e._hostParent;for(;t.length;e=t.pop())f(e,e._hostNode);return e._hostNode},precacheChildNodes:f,precacheNode:p,uncacheNode:function(e){var t=e._hostNode;t&&(delete t[u],e._hostNode=null)}};e.exports=d},function(e,t,n){e.exports=n(552)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_SPEC",function(){return $}),n.d(t,"UPDATE_URL",function(){return G}),n.d(t,"UPDATE_JSON",function(){return Z}),n.d(t,"UPDATE_PARAM",function(){return X}),n.d(t,"UPDATE_EMPTY_PARAM_INCLUSION",function(){return Q}),n.d(t,"VALIDATE_PARAMS",function(){return ee}),n.d(t,"SET_RESPONSE",function(){return te}),n.d(t,"SET_REQUEST",function(){return ne}),n.d(t,"SET_MUTATED_REQUEST",function(){return re}),n.d(t,"LOG_REQUEST",function(){return oe}),n.d(t,"CLEAR_RESPONSE",function(){return ie}),n.d(t,"CLEAR_REQUEST",function(){return ae}),n.d(t,"CLEAR_VALIDATE_PARAMS",function(){return se}),n.d(t,"UPDATE_OPERATION_META_VALUE",function(){return ue}),n.d(t,"UPDATE_RESOLVED",function(){return ce}),n.d(t,"UPDATE_RESOLVED_SUBTREE",function(){return le}),n.d(t,"SET_SCHEME",function(){return pe}),n.d(t,"updateSpec",function(){return he}),n.d(t,"updateResolved",function(){return de}),n.d(t,"updateUrl",function(){return me}),n.d(t,"updateJsonSpec",function(){return ve}),n.d(t,"parseToJson",function(){return ge}),n.d(t,"resolveSpec",function(){return be}),n.d(t,"requestResolvedSubtree",function(){return xe}),n.d(t,"changeParam",function(){return Ee}),n.d(t,"changeParamByIdentity",function(){return Se}),n.d(t,"updateResolvedSubtree",function(){return Ce}),n.d(t,"invalidateResolvedSubtreeCache",function(){return ke}),n.d(t,"validateParams",function(){return Oe}),n.d(t,"updateEmptyParamInclusion",function(){return Ae}),n.d(t,"clearValidateParams",function(){return Te}),n.d(t,"changeConsumesValue",function(){return je}),n.d(t,"changeProducesValue",function(){return Pe}),n.d(t,"setResponse",function(){return Ie}),n.d(t,"setRequest",function(){return Me}),n.d(t,"setMutatedRequest",function(){return Ne}),n.d(t,"logRequest",function(){return Re}),n.d(t,"executeRequest",function(){return De}),n.d(t,"execute",function(){return Le}),n.d(t,"clearResponse",function(){return Ue}),n.d(t,"clearRequest",function(){return qe}),n.d(t,"setScheme",function(){return Fe});var r=n(94),o=n.n(r),i=n(60),a=n.n(i),s=n(61),u=n.n(s),c=n(55),l=n.n(c),p=n(2),f=n.n(p),h=n(40),d=n.n(h),m=n(332),v=n.n(m),g=n(16),y=n.n(g),b=n(17),_=n.n(b),w=n(192),x=n.n(w),E=n(123),S=n.n(E),C=n(193),k=n.n(C),O=n(54),A=n.n(O),T=n(14),j=n.n(T),P=n(26),I=n.n(P),M=n(146),N=n.n(M),R=n(1),D=n(95),L=n.n(D),U=n(119),q=n.n(U),F=n(283),B=n.n(F),z=n(479),V=n.n(z),H=n(333),W=n.n(H),J=n(3);function K(e,t){var n=_()(e);if(l.a){var r=l()(e);t&&(r=r.filter(function(t){return u()(e,t).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(n,!0).forEach(function(t){f()(e,t,n[t])}):a.a?o()(e,a()(n)):K(n).forEach(function(t){A()(e,t,u()(n,t))})}return e}var $="spec_update_spec",G="spec_update_url",Z="spec_update_json",X="spec_update_param",Q="spec_update_empty_param_inclusion",ee="spec_validate_param",te="spec_set_response",ne="spec_set_request",re="spec_set_mutated_request",oe="spec_log_request",ie="spec_clear_response",ae="spec_clear_request",se="spec_clear_validate_param",ue="spec_update_operation_meta_value",ce="spec_update_resolved",le="spec_update_resolved_subtree",pe="set_scheme",fe=function(e){return B()(e)?e:""};function he(e){var t=fe(e).replace(/\t/g," ");if("string"==typeof e)return{type:$,payload:t}}function de(e){return{type:ce,payload:e}}function me(e){return{type:G,payload:e}}function ve(e){return{type:Z,payload:e}}var ge=function(e){return function(t){var n=t.specActions,r=t.specSelectors,o=t.errActions,i=r.specStr,a=null;try{e=e||i(),o.clear({source:"parser"}),a=N.a.safeLoad(e)}catch(e){return console.error(e),o.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return a&&"object"===I()(a)?n.updateJsonSpec(a):{}}},ye=!1,be=function(e,t){return function(n){var r=n.specActions,o=n.specSelectors,i=n.errActions,a=n.fn,s=a.fetch,u=a.resolve,c=a.AST,l=void 0===c?{}:c,p=n.getConfigs;ye||(console.warn("specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!"),ye=!0);var f=p(),h=f.modelPropertyMacro,d=f.parameterMacro,m=f.requestInterceptor,v=f.responseInterceptor;void 0===e&&(e=o.specJson()),void 0===t&&(t=o.url());var g=l.getLineNumberForPath?l.getLineNumberForPath:function(){},y=o.specStr();return u({fetch:s,spec:e,baseDoc:t,modelPropertyMacro:h,parameterMacro:d,requestInterceptor:m,responseInterceptor:v}).then(function(e){var t=e.spec,n=e.errors;if(i.clear({type:"thrown"}),j()(n)&&n.length>0){var o=n.map(function(e){return console.error(e),e.line=e.fullPath?g(y,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",A()(e,"message",{enumerable:!0,value:e.message}),e});i.newThrownErrBatch(o)}return r.updateResolved(t)})}},_e=[],we=V()(k()(S.a.mark(function e(){var t,n,r,o,i,a,s,u,c,l,p,f,h,d,m,v,g;return S.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_e.system){e.next=4;break}return console.error("debResolveSubtrees: don't have a system to operate on, aborting."),e.abrupt("return");case 4:if(n=t.errActions,r=t.errSelectors,o=t.fn,i=o.resolveSubtree,a=o.AST,s=void 0===a?{}:a,u=t.specSelectors,c=t.specActions,i){e.next=8;break}return console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing."),e.abrupt("return");case 8:return l=s.getLineNumberForPath?s.getLineNumberForPath:function(){},p=u.specStr(),f=t.getConfigs(),h=f.modelPropertyMacro,d=f.parameterMacro,m=f.requestInterceptor,v=f.responseInterceptor,e.prev=11,e.next=14,_e.reduce(function(){var e=k()(S.a.mark(function e(t,o){var a,s,c,f,g,y,b;return S.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return a=e.sent,s=a.resultMap,c=a.specWithCurrentSubtrees,e.next=7,i(c,o,{baseDoc:u.url(),modelPropertyMacro:h,parameterMacro:d,requestInterceptor:m,responseInterceptor:v});case 7:return f=e.sent,g=f.errors,y=f.spec,r.allErrors().size&&n.clearBy(function(e){return"thrown"!==e.get("type")||"resolver"!==e.get("source")||!e.get("fullPath").every(function(e,t){return e===o[t]||void 0===o[t]})}),j()(g)&&g.length>0&&(b=g.map(function(e){return e.line=e.fullPath?l(p,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",A()(e,"message",{enumerable:!0,value:e.message}),e}),n.newThrownErrBatch(b)),W()(s,o,y),W()(c,o,y),e.abrupt("return",{resultMap:s,specWithCurrentSubtrees:c});case 15:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),x.a.resolve({resultMap:(u.specResolvedSubtree([])||Object(R.Map)()).toJS(),specWithCurrentSubtrees:u.specJson().toJS()}));case 14:g=e.sent,delete _e.system,_e=[],e.next=22;break;case 19:e.prev=19,e.t0=e.catch(11),console.error(e.t0);case 22:c.updateResolvedSubtree([],g.resultMap);case 23:case"end":return e.stop()}},e,null,[[11,19]])})),35),xe=function(e){return function(t){_e.map(function(e){return e.join("@@")}).indexOf(e.join("@@"))>-1||(_e.push(e),_e.system=t,we())}};function Ee(e,t,n,r,o){return{type:X,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:o}}}function Se(e,t,n,r){return{type:X,payload:{path:e,param:t,value:n,isXml:r}}}var Ce=function(e,t){return{type:le,payload:{path:e,value:t}}},ke=function(){return{type:le,payload:{path:[],value:Object(R.Map)()}}},Oe=function(e,t){return{type:ee,payload:{pathMethod:e,isOAS3:t}}},Ae=function(e,t,n,r){return{type:Q,payload:{pathMethod:e,paramName:t,paramIn:n,includeEmptyValue:r}}};function Te(e){return{type:se,payload:{pathMethod:e}}}function je(e,t){return{type:ue,payload:{path:e,value:t,key:"consumes_value"}}}function Pe(e,t){return{type:ue,payload:{path:e,value:t,key:"produces_value"}}}var Ie=function(e,t,n){return{payload:{path:e,method:t,res:n},type:te}},Me=function(e,t,n){return{payload:{path:e,method:t,req:n},type:ne}},Ne=function(e,t,n){return{payload:{path:e,method:t,req:n},type:re}},Re=function(e){return{payload:e,type:oe}},De=function(e){return function(t){var n=t.fn,r=t.specActions,o=t.specSelectors,i=t.getConfigs,a=t.oas3Selectors,s=e.pathName,u=e.method,c=e.operation,l=i(),p=l.requestInterceptor,f=l.responseInterceptor,h=c.toJS();if(c&&c.get("parameters")&&c.get("parameters").filter(function(e){return e&&!0===e.get("allowEmptyValue")}).forEach(function(t){if(o.parameterInclusionSettingFor([s,u],t.get("name"),t.get("in"))){e.parameters=e.parameters||{};var n=Object(J.C)(t,e.parameters);(!n||n&&0===n.size)&&(e.parameters[t.get("name")]="")}}),e.contextUrl=L()(o.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&s&&u&&(e.operationId=n.opId(h,s,u)),o.isOAS3()){var d="".concat(s,":").concat(u);e.server=a.selectedServer(d)||a.selectedServer();var m=a.serverVariables({server:e.server,namespace:d}).toJS(),g=a.serverVariables({server:e.server}).toJS();e.serverVariables=_()(m).length?m:g,e.requestContentType=a.requestContentType(s,u),e.responseContentType=a.responseContentType(s,u)||"*/*";var b=a.requestBodyValue(s,u);Object(J.t)(b)?e.requestBody=JSON.parse(b):b&&b.toJS?e.requestBody=b.toJS():e.requestBody=b}var w=y()({},e);w=n.buildRequest(w),r.setRequest(e.pathName,e.method,w);e.requestInterceptor=function(t){var n=p.apply(this,[t]),o=y()({},n);return r.setMutatedRequest(e.pathName,e.method,o),n},e.responseInterceptor=f;var x=v()();return n.execute(e).then(function(t){t.duration=v()()-x,r.setResponse(e.pathName,e.method,t)}).catch(function(t){console.error(t),r.setResponse(e.pathName,e.method,{error:!0,err:q()(t)})})}},Le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=d()(e,["path","method"]);return function(e){var o=e.fn.fetch,i=e.specSelectors,a=e.specActions,s=i.specJsonWithResolvedSubtrees().toJS(),u=i.operationScheme(t,n),c=i.contentTypeValues([t,n]).toJS(),l=c.requestContentType,p=c.responseContentType,f=/xml/i.test(l),h=i.parameterValues([t,n],f).toJS();return a.executeRequest(Y({},r,{fetch:o,spec:s,pathName:t,method:n,parameters:h,requestContentType:l,scheme:u,responseContentType:p}))}};function Ue(e,t){return{type:ie,payload:{path:e,method:t}}}function qe(e,t){return{type:ae,payload:{path:e,method:t}}}function Fe(e,t,n){return{type:pe,payload:{scheme:e,path:t,method:n}}}},function(e,t,n){var r=n(32),o=n(22),i=n(63),a=n(77),s=n(75),u=function(e,t,n){var c,l,p,f=e&u.F,h=e&u.G,d=e&u.S,m=e&u.P,v=e&u.B,g=e&u.W,y=h?o:o[t]||(o[t]={}),b=y.prototype,_=h?r:d?r[t]:(r[t]||{}).prototype;for(c in h&&(n=t),n)(l=!f&&_&&void 0!==_[c])&&s(y,c)||(p=l?_[c]:n[c],y[c]=h&&"function"!=typeof _[c]?n[c]:v&&l?i(p,r):g&&_[c]==p?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(p):m&&"function"==typeof p?i(Function.call,p):p,m&&((y.virtual||(y.virtual={}))[c]=p,e&u.R&&b&&!b[c]&&a(b,c,p)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){"use strict";var r=n(138),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach(function(e){n[e].forEach(function(t){a[String(t)]=e})}),a),-1===i.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(197)("wks"),o=n(199),i=n(41).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(214)("wks"),o=n(159),i=n(32).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(41),o=n(72),i=n(81),a=n(97),s=n(153),u=function(e,t,n){var c,l,p,f,h=e&u.F,d=e&u.G,m=e&u.S,v=e&u.P,g=e&u.B,y=d?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,b=d?o:o[t]||(o[t]={}),_=b.prototype||(b.prototype={});for(c in d&&(n=t),n)p=((l=!h&&y&&void 0!==y[c])?y:n)[c],f=g&&l?s(p,r):v&&"function"==typeof p?s(Function.call,p):p,y&&a(y,c,p,e&u.U),b[c]!=p&&i(b,c,f),v&&_[c]!=p&&(_[c]=p)};r.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return!!e&&r.call(e,t)}var i=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function a(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function s(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var u=/&([a-z#][a-z0-9]{1,31});/gi,c=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,l=n(463);function p(e,t){var n=0;return o(l,t)?l[t]:35===t.charCodeAt(0)&&c.test(t)&&a(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?s(n):e}var f=/[&<>"]/,h=/[&<>"]/g,d={"&":"&","<":"<",">":">",'"':"""};function m(e){return d[e]}t.assign=function(e){return[].slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=o,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(i,"$1")},t.isValidEntityCode=a,t.fromCodePoint=s,t.replaceEntities=function(e){return e.indexOf("&")<0?e:e.replace(u,p)},t.escapeHtml=function(e){return f.test(e)?e.replace(h,m):e}},function(e,t,n){var r=n(55),o=n(771);e.exports=function(e,t){if(null==e)return{};var n,i,a=o(e,t);if(r){var s=r(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(35),o=n(99),i=n(73),a=/"/g,s=function(e,t,n,r){var o=String(i(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+o+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*o(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){"use strict";n.r(t),n.d(t,"NEW_THROWN_ERR",function(){return i}),n.d(t,"NEW_THROWN_ERR_BATCH",function(){return a}),n.d(t,"NEW_SPEC_ERR",function(){return s}),n.d(t,"NEW_SPEC_ERR_BATCH",function(){return u}),n.d(t,"NEW_AUTH_ERR",function(){return c}),n.d(t,"CLEAR",function(){return l}),n.d(t,"CLEAR_BY",function(){return p}),n.d(t,"newThrownErr",function(){return f}),n.d(t,"newThrownErrBatch",function(){return h}),n.d(t,"newSpecErr",function(){return d}),n.d(t,"newSpecErrBatch",function(){return m}),n.d(t,"newAuthErr",function(){return v}),n.d(t,"clear",function(){return g}),n.d(t,"clearBy",function(){return y});var r=n(119),o=n.n(r),i="err_new_thrown_err",a="err_new_thrown_err_batch",s="err_new_spec_err",u="err_new_spec_err_batch",c="err_new_auth_err",l="err_clear",p="err_clear_by";function f(e){return{type:i,payload:o()(e)}}function h(e){return{type:a,payload:e}}function d(e){return{type:s,payload:e}}function m(e){return{type:u,payload:e}}function v(e){return{type:c,payload:e}}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:l,payload:e}}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return{type:p,payload:e}}},function(e,t,n){var r=n(98);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(43);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(64),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),i(o,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){var r=n(46),o=n(349),i=n(218),a=Object.defineProperty;t.f=n(50)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(82)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(366),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";e.exports={debugTool:null}},function(e,t,n){e.exports=n(573)},function(e,t,n){e.exports=n(770)},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=45)}([function(e,t){e.exports=n(17)},function(e,t){e.exports=n(14)},function(e,t){e.exports=n(26)},function(e,t){e.exports=n(16)},function(e,t){e.exports=n(123)},function(e,t){e.exports=n(60)},function(e,t){e.exports=n(61)},function(e,t){e.exports=n(55)},function(e,t){e.exports=n(2)},function(e,t){e.exports=n(54)},function(e,t){e.exports=n(94)},function(e,t){e.exports=n(28)},function(e,t){e.exports=n(930)},function(e,t){e.exports=n(12)},function(e,t){e.exports=n(192)},function(e,t){e.exports=n(936)},function(e,t){e.exports=n(93)},function(e,t){e.exports=n(193)},function(e,t){e.exports=n(939)},function(e,t){e.exports=n(943)},function(e,t){e.exports=n(944)},function(e,t){e.exports=n(92)},function(e,t){e.exports=n(13)},function(e,t){e.exports=n(146)},function(e,t){e.exports=n(4)},function(e,t){e.exports=n(5)},function(e,t){e.exports=n(946)},function(e,t){e.exports=n(421)},function(e,t){e.exports=n(949)},function(e,t){e.exports=n(52)},function(e,t){e.exports=n(64)},function(e,t){e.exports=n(283)},function(e,t){e.exports=n(272)},function(e,t){e.exports=n(950)},function(e,t){e.exports=n(145)},function(e,t){e.exports=n(951)},function(e,t){e.exports=n(959)},function(e,t){e.exports=n(960)},function(e,t){e.exports=n(961)},function(e,t){e.exports=n(40)},function(e,t){e.exports=n(264)},function(e,t){e.exports=n(37)},function(e,t){e.exports=n(964)},function(e,t){e.exports=n(965)},function(e,t){e.exports=n(966)},function(e,t,n){e.exports=n(50)},function(e,t){e.exports=n(967)},function(e,t){e.exports=n(968)},function(e,t){e.exports=n(969)},function(e,t){e.exports=n(970)},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"path",function(){return mn}),n.d(r,"query",function(){return vn}),n.d(r,"header",function(){return yn}),n.d(r,"cookie",function(){return bn});var o=n(9),i=n.n(o),a=n(10),s=n.n(a),u=n(5),c=n.n(u),l=n(6),p=n.n(l),f=n(7),h=n.n(f),d=n(0),m=n.n(d),v=n(8),g=n.n(v),y=(n(46),n(15)),b=n.n(y),_=n(20),w=n.n(_),x=n(12),E=n.n(x),S=n(4),C=n.n(S),k=n(22),O=n.n(k),A=n(11),T=n.n(A),j=n(2),P=n.n(j),I=n(1),M=n.n(I),N=n(17),R=n.n(N),D=(n(47),n(26)),L=n.n(D),U=n(23),q=n.n(U),F=n(31),B=n.n(F),z={serializeRes:J,mergeInQueryOrForm:Z};function V(e){return H.apply(this,arguments)}function H(){return(H=R()(C.a.mark(function e(t){var n,r,o,i,a,s=arguments;return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:{},"object"===P()(t)&&(t=(n=t).url),n.headers=n.headers||{},z.mergeInQueryOrForm(n),n.headers&&m()(n.headers).forEach(function(e){var t=n.headers[e];"string"==typeof t&&(n.headers[e]=t.replace(/\n+/g," "))}),!n.requestInterceptor){e.next=12;break}return e.next=8,n.requestInterceptor(n);case 8:if(e.t0=e.sent,e.t0){e.next=11;break}e.t0=n;case 11:n=e.t0;case 12:return r=n.headers["content-type"]||n.headers["Content-Type"],/multipart\/form-data/i.test(r)&&(delete n.headers["content-type"],delete n.headers["Content-Type"]),e.prev=14,e.next=17,(n.userFetch||fetch)(n.url,n);case 17:return o=e.sent,e.next=20,z.serializeRes(o,t,n);case 20:if(o=e.sent,!n.responseInterceptor){e.next=28;break}return e.next=24,n.responseInterceptor(o);case 24:if(e.t1=e.sent,e.t1){e.next=27;break}e.t1=o;case 27:o=e.t1;case 28:e.next=38;break;case 30:if(e.prev=30,e.t2=e.catch(14),o){e.next=34;break}throw e.t2;case 34:throw(i=new Error(o.statusText)).statusCode=i.status=o.status,i.responseError=e.t2,i;case 38:if(o.ok){e.next=43;break}throw(a=new Error(o.statusText)).statusCode=a.status=o.status,a.response=o,a;case 43:return e.abrupt("return",o);case 44:case"end":return e.stop()}},e,null,[[14,30]])}))).apply(this,arguments)}var W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(e)};function J(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).loadSpec,r=void 0!==n&&n,o={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:K(e.headers)},i=o.headers["content-type"],a=r||W(i);return(a?e.text:e.blob||e.buffer).call(e).then(function(e){if(o.text=e,o.data=e,a)try{var t=function(e,t){return t&&(0===t.indexOf("application/json")||t.indexOf("+json")>0)?JSON.parse(e):q.a.safeLoad(e)}(e,i);o.body=t,o.obj=t}catch(e){o.parseError=e}return o})}function K(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return"function"==typeof e.forEach?(e.forEach(function(e,n){void 0!==t[n]?(t[n]=M()(t[n])?t[n]:[t[n]],t[n].push(e)):t[n]=e}),t):t}function Y(e,t){return t||"undefined"==typeof navigator||(t=navigator),t&&"ReactNative"===t.product?!(!e||"object"!==P()(e)||"string"!=typeof e.uri):"undefined"!=typeof File?e instanceof File:null!==e&&"object"===P()(e)&&"function"==typeof e.pipe}function $(e,t){var n=e.collectionFormat,r=e.allowEmptyValue,o="object"===P()(e)?e.value:e;if(void 0===o&&r)return"";if(Y(o)||"boolean"==typeof o)return o;var i=encodeURIComponent;return t&&(i=B()(o)?function(e){return e}:function(e){return T()(e)}),"object"!==P()(o)||M()(o)?M()(o)?M()(o)&&!n?o.map(i).join(","):"multi"===n?o.map(i):o.map(i).join({csv:",",ssv:"%20",tsv:"%09",pipes:"|"}[n]):i(o):""}function G(e){var t=m()(e).reduce(function(t,n){var r,o=e[n],i=!!o.skipEncoding,a=i?n:encodeURIComponent(n),s=(r=o)&&"object"===P()(r)&&!M()(o);return t[a]=$(s?o:{value:o},i),t},{});return L.a.stringify(t,{encode:!1,indices:!1})||""}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.url,r=void 0===t?"":t,o=e.query,i=e.form;if(i){var a=m()(i).some(function(e){return Y(i[e].value)}),s=e.headers["content-type"]||e.headers["Content-Type"];if(a||/multipart\/form-data/i.test(s)){var u=n(48);e.body=new u,m()(i).forEach(function(t){e.body.append(t,$(i[t],!0))})}else e.body=G(i);delete e.form}if(o){var c=r.split("?"),l=O()(c,2),p=l[0],f=l[1],h="";if(f){var d=L.a.parse(f);m()(o).forEach(function(e){return delete d[e]}),h=L.a.stringify(d,{encode:!0})}var v=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(function(e){return e}).join("&");return r?"?".concat(r):""}(h,G(o));e.url=p+v,delete e.query}return e}var X=n(14),Q=n.n(X),ee=n(21),te=n.n(ee),ne=n(27),re=n.n(ne),oe=n(3),ie=n.n(oe),ae=n(24),se=n.n(ae),ue=n(25),ce=n.n(ue),le=n(32),pe=n.n(le),fe=n(13),he=n.n(fe),de=n(18),me=n.n(de),ve=n(33),ge=n.n(ve),ye=n(34),be=n.n(ye),_e={add:function(e,t){return{op:"add",path:e,value:t}},replace:xe,remove:function(e,t){return{op:"remove",path:e}},merge:function(e,t){return{type:"mutation",op:"merge",path:e,value:t}},mergeDeep:function(e,t){return{type:"mutation",op:"mergeDeep",path:e,value:t}},context:function(e,t){return{type:"context",path:e,value:t}},getIn:function(e,t){return t.reduce(function(e,t){return void 0!==t&&e?e[t]:e},e)},applyPatch:function(e,t,n){if(n=n||{},"merge"===(t=ie()({},t,{path:t.path&&we(t.path)})).op){var r=Re(e,t.path);ie()(r,t.value),me.a.applyPatch(e,[xe(t.path,r)])}else if("mergeDeep"===t.op){var o=Re(e,t.path);for(var i in t.value){var a=t.value[i],s=M()(a);if(s){var u=o[i]||[];o[i]=u.concat(a)}else if(Te(a)&&!s){var c=ie()({},o[i]);for(var l in a){if(Object.prototype.hasOwnProperty.call(c,l)){c=ge()(be()({},c),a);break}ie()(c,g()({},l,a[l]))}o[i]=c}else o[i]=a}}else if("add"===t.op&&""===t.path&&Te(t.value)){var p=m()(t.value).reduce(function(e,n){return e.push({op:"add",path:"/".concat(we(n)),value:t.value[n]}),e},[]);me.a.applyPatch(e,p)}else if("replace"===t.op&&""===t.path){var f=t.value;n.allowMetaPatches&&t.meta&&Me(t)&&(M()(t.value)||Te(t.value))&&(f=ie()({},f,t.meta)),e=f}else if(me.a.applyPatch(e,[t]),n.allowMetaPatches&&t.meta&&Me(t)&&(M()(t.value)||Te(t.value))){var h=Re(e,t.path),d=ie()({},h,t.meta);me.a.applyPatch(e,[xe(t.path,d)])}return e},parentPathMatch:function(e,t){if(!M()(t))return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0},flatten:Oe,fullyNormalizeArray:function(e){return Ae(Oe(ke(e)))},normalizeArray:ke,isPromise:function(e){return Te(e)&&je(e.then)},forEachNew:function(e,t){try{return Ee(e,Ce,t)}catch(e){return e}},forEachNewPrimitive:function(e,t){try{return Ee(e,Se,t)}catch(e){return e}},isJsonPatch:Pe,isContextPatch:function(e){return Ne(e)&&"context"===e.type},isPatch:Ne,isMutation:Ie,isAdditiveMutation:Me,isGenerator:function(e){return C.a.isGeneratorFunction(e)},isFunction:je,isObject:Te,isError:function(e){return e instanceof Error}};function we(e){return M()(e)?e.length<1?"":"/"+e.map(function(e){return(e+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/"):e}function xe(e,t,n){return{op:"replace",path:e,value:t,meta:n}}function Ee(e,t,n){return Ae(Oe(e.filter(Me).map(function(e){return t(e.value,n,e.path)})||[]))}function Se(e,t,n){return n=n||[],M()(e)?e.map(function(e,r){return Se(e,t,n.concat(r))}):Te(e)?m()(e).map(function(r){return Se(e[r],t,n.concat(r))}):t(e,n[n.length-1],n)}function Ce(e,t,n){var r=[];if((n=n||[]).length>0){var o=t(e,n[n.length-1],n);o&&(r=r.concat(o))}if(M()(e)){var i=e.map(function(e,r){return Ce(e,t,n.concat(r))});i&&(r=r.concat(i))}else if(Te(e)){var a=m()(e).map(function(r){return Ce(e[r],t,n.concat(r))});a&&(r=r.concat(a))}return r=Oe(r)}function ke(e){return M()(e)?e:[e]}function Oe(e){var t;return(t=[]).concat.apply(t,he()(e.map(function(e){return M()(e)?Oe(e):e})))}function Ae(e){return e.filter(function(e){return void 0!==e})}function Te(e){return e&&"object"===P()(e)}function je(e){return e&&"function"==typeof e}function Pe(e){if(Ne(e)){var t=e.op;return"add"===t||"remove"===t||"replace"===t}return!1}function Ie(e){return Pe(e)||Ne(e)&&"mutation"===e.type}function Me(e){return Ie(e)&&("add"===e.op||"replace"===e.op||"merge"===e.op||"mergeDeep"===e.op)}function Ne(e){return e&&"object"===P()(e)}function Re(e,t){try{return me.a.getValueByPointer(e,t)}catch(e){return console.error(e),{}}}var De=n(35),Le=n.n(De),Ue=n(36),qe=n(28),Fe=n.n(qe);function Be(e,t){function n(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.message=n[0],t&&t.apply(this,n)}return n.prototype=new Error,n.prototype.name=e,n.prototype.constructor=n,n}var ze=n(37),Ve=n.n(ze),He=["properties"],We=["properties"],Je=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],Ke=["schema/example","items/example"];function Ye(e){var t=e[e.length-1],n=e[e.length-2],r=e.join("/");return He.indexOf(t)>-1&&-1===We.indexOf(n)||Je.indexOf(r)>-1||Ke.some(function(e){return r.indexOf(e)>-1})}function $e(e,t){var n=e.split("#"),r=O()(n,2),o=r[0],i=r[1],a=E.a.resolve(o||"",t||"");return i?"".concat(a,"#").concat(i):a}var Ge="application/json, application/yaml",Ze=new RegExp("^([a-z]+://|//)","i"),Xe=Be("JSONRefError",function(e,t,n){this.originalError=n,ie()(this,t||{})}),Qe={},et=new Le.a,tt=[function(e){return"paths"===e[0]&&"responses"===e[3]&&"content"===e[5]&&"example"===e[7]},function(e){return"paths"===e[0]&&"requestBody"===e[3]&&"content"===e[4]&&"example"===e[6]}],nt={key:"$ref",plugin:function(e,t,n,r){var o=r.getInstance(),i=n.slice(0,-1);if(!Ye(i)&&(a=i,!tt.some(function(e){return e(a)}))){var a,s=r.getContext(n).baseDoc;if("string"!=typeof e)return new Xe("$ref: must be a string (JSON-Ref)",{$ref:e,baseDoc:s,fullPath:n});var u,c,l,p=st(e),f=p[0],h=p[1]||"";try{u=s||f?it(f,s):null}catch(t){return at(t,{pointer:h,$ref:e,basePath:u,fullPath:n})}if(function(e,t,n,r){var o=et.get(r);o||(o={},et.set(r,o));var i=function(e){if(0===e.length)return"";return"/".concat(e.map(ht).join("/"))}(n),a="".concat(t||"<specmap-base>","#").concat(e),s=i.replace(/allOf\/\d+\/?/g,""),u=r.contextTree.get([]).baseDoc;if(t==u&&mt(s,e))return!0;var c="";if(n.some(function(e){return c="".concat(c,"/").concat(ht(e)),o[c]&&o[c].some(function(e){return mt(e,a)||mt(a,e)})}))return!0;o[s]=(o[s]||[]).concat(a)}(h,u,i,r)&&!o.useCircularStructures){var d=$e(e,u);return e===d?null:_e.replace(n,d)}if(null==u?(l=pt(h),void 0===(c=r.get(l))&&(c=new Xe("Could not resolve reference: ".concat(e),{pointer:h,$ref:e,baseDoc:s,fullPath:n}))):c=null!=(c=ut(u,h)).__value?c.__value:c.catch(function(t){throw at(t,{pointer:h,$ref:e,baseDoc:s,fullPath:n})}),c instanceof Error)return[_e.remove(n),c];var v=$e(e,u),g=_e.replace(i,c,{$$ref:v});if(u&&u!==s)return[g,_e.context(i,{baseDoc:u})];try{if(!function(e,t){var n=[e];return t.path.reduce(function(e,t){return n.push(e[t]),e[t]},e),function e(t){return _e.isObject(t)&&(n.indexOf(t)>=0||m()(t).some(function(n){return e(t[n])}))}(t.value)}(r.state,g)||o.useCircularStructures)return g}catch(e){return null}}}},rt=ie()(nt,{docCache:Qe,absoluteify:it,clearCache:function(e){void 0!==e?delete Qe[e]:m()(Qe).forEach(function(e){delete Qe[e]})},JSONRefError:Xe,wrapError:at,getDoc:ct,split:st,extractFromDoc:ut,fetchJSON:function(e){return Object(Ue.fetch)(e,{headers:{Accept:Ge},loadSpec:!0}).then(function(e){return e.text()}).then(function(e){return q.a.safeLoad(e)})},extract:lt,jsonPointerToArray:pt,unescapeJsonPointerToken:ft}),ot=rt;function it(e,t){if(!Ze.test(e)){if(!t)throw new Xe("Tried to resolve a relative URL, without having a basePath. path: '".concat(e,"' basePath: '").concat(t,"'"));return E.a.resolve(t,e)}return e}function at(e,t){var n;return n=e&&e.response&&e.response.body?"".concat(e.response.body.code," ").concat(e.response.body.message):e.message,new Xe("Could not resolve reference: ".concat(n),t,e)}function st(e){return(e+"").split("#")}function ut(e,t){var n=Qe[e];if(n&&!_e.isPromise(n))try{var r=lt(t,n);return ie()(Q.a.resolve(r),{__value:r})}catch(e){return Q.a.reject(e)}return ct(e).then(function(e){return lt(t,e)})}function ct(e){var t=Qe[e];return t?_e.isPromise(t)?t:Q.a.resolve(t):(Qe[e]=rt.fetchJSON(e).then(function(t){return Qe[e]=t,t}),Qe[e])}function lt(e,t){var n=pt(e);if(n.length<1)return t;var r=_e.getIn(t,n);if(void 0===r)throw new Xe("Could not resolve pointer: ".concat(e," does not exist in document"),{pointer:e});return r}function pt(e){if("string"!=typeof e)throw new TypeError("Expected a string, got a ".concat(P()(e)));return"/"===e[0]&&(e=e.substr(1)),""===e?[]:e.split("/").map(ft)}function ft(e){return"string"!=typeof e?e:Fe.a.unescape(e.replace(/~1/g,"/").replace(/~0/g,"~"))}function ht(e){return Fe.a.escape(e.replace(/~/g,"~0").replace(/\//g,"~1"))}var dt=function(e){return!e||"/"===e||"#"===e};function mt(e,t){if(dt(t))return!0;var n=e.charAt(t.length),r=t.slice(-1);return 0===e.indexOf(t)&&(!n||"/"===n||"#"===n)&&"#"!==r}var vt={key:"allOf",plugin:function(e,t,n,r,o){if(!o.meta||!o.meta.$$ref){var i=n.slice(0,-1);if(!Ye(i)){if(!M()(e)){var a=new TypeError("allOf must be an array");return a.fullPath=n,a}var s=!1,u=o.value;i.forEach(function(e){u&&(u=u[e])}),delete(u=ie()({},u)).allOf;var c=[];return c.push(r.replace(i,{})),e.forEach(function(e,t){if(!r.isObject(e)){if(s)return null;s=!0;var o=new TypeError("Elements in allOf must be objects");return o.fullPath=n,c.push(o)}c.push(r.mergeDeep(i,e));var a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.specmap,o=n.getBaseUrlForNodePath,i=void 0===o?function(e){return r.getContext([].concat(he()(t),he()(e))).baseDoc}:o,a=n.targetKeys,s=void 0===a?["$ref","$$ref"]:a,u=[];return Ve()(e).forEach(function(){if(s.indexOf(this.key)>-1){var e=this.path,n=t.concat(this.path),o=$e(this.node,i(e));u.push(r.replace(n,o))}}),u}(e,n.slice(0,-1),{getBaseUrlForNodePath:function(e){return r.getContext([].concat(he()(n),[t],he()(e))).baseDoc},specmap:r});c.push.apply(c,he()(a))}),c.push(r.mergeDeep(i,u)),u.$$ref||c.push(r.remove([].concat(i,"$$ref"))),c}}}},gt={key:"parameters",plugin:function(e,t,n,r,o){if(M()(e)&&e.length){var i=ie()([],e),a=n.slice(0,-1),s=ie()({},_e.getIn(r.spec,a));return e.forEach(function(e,t){try{i[t].default=r.parameterMacro(s,e)}catch(e){var o=new Error(e);return o.fullPath=n,o}}),_e.replace(n,i)}return _e.replace(n,e)}},yt={key:"properties",plugin:function(e,t,n,r){var o=ie()({},e);for(var i in e)try{o[i].default=r.modelPropertyMacro(o[i])}catch(e){var a=new Error(e);return a.fullPath=n,a}return _e.replace(n,o)}};function bt(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}var _t=function(){function e(t){se()(this,e),this.root=wt(t||{})}return ce()(e,[{key:"set",value:function(e,t){var n=this.getParent(e,!0);if(n){var r=e[e.length-1],o=n.children;o[r]?xt(o[r],t,n):o[r]=wt(t,n)}else xt(this.root,t,null)}},{key:"get",value:function(e){if((e=e||[]).length<1)return this.root.value;for(var t,n,r=this.root,o=0;o<e.length&&(n=e[o],(t=r.children)[n]);o++)r=t[n];return r&&r.protoValue}},{key:"getParent",value:function(e,t){return!e||e.length<1?null:e.length<2?this.root:e.slice(0,-1).reduce(function(e,n){if(!e)return e;var r=e.children;return!r[n]&&t&&(r[n]=wt(null,e)),r[n]},this.root)}}]),e}();function wt(e,t){return xt({children:{}},e,t)}function xt(e,t,n){return e.value=t||{},e.protoValue=n?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bt(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):bt(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}({},n.protoValue,{},e.value):e.value,m()(e.children).forEach(function(t){var n=e.children[t];e.children[t]=xt(n,n.value,e)}),e}var Et=function(){function e(t){var n=this;se()(this,e),ie()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new _t,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:ie()(re()(this),_e,{getInstance:function(){return n}}),allowMetaPatches:!1},t),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=this.plugins.map(this.wrapPlugin.bind(this)).filter(_e.isFunction),this.patches.push(_e.add([],this.spec)),this.patches.push(_e.context([],this.context)),this.updatePatches(this.patches)}return ce()(e,[{key:"debug",value:function(e){if(this.debugLevel===e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console).log.apply(t,r)}}},{key:"verbose",value:function(e){if("verbose"===this.debugLevel){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console).log.apply(t,["[".concat(e,"] ")].concat(r))}}},{key:"wrapPlugin",value:function(e,t){var n,r,o,i=this.pathDiscriminator,a=null;return e[this.pluginProp]?(a=e,n=e[this.pluginProp]):_e.isFunction(e)?n=e:_e.isObject(e)&&(r=e,o=function(e,t){return!M()(e)||e.every(function(e,n){return e===t[n]})},n=C.a.mark(function e(t,n){var a,s,u,c,l,p,f,h,d;return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:d=function(e,t,u){var c,l,p,f,h,v,g,y,b,_,w,x,E;return C.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(_e.isObject(e)){a.next=6;break}if(r.key!==t[t.length-1]){a.next=4;break}return a.next=4,r.plugin(e,r.key,t,n);case 4:a.next=30;break;case 6:c=t.length-1,l=t[c],p=t.indexOf("properties"),f="properties"===l&&c===p,h=n.allowMetaPatches&&s[e.$$ref],v=0,g=m()(e);case 12:if(!(v<g.length)){a.next=30;break}if(y=g[v],b=e[y],_=t.concat(y),w=_e.isObject(b),x=e.$$ref,h){a.next=22;break}if(!w){a.next=22;break}return n.allowMetaPatches&&x&&(s[x]=!0),a.delegateYield(d(b,_,u),"t0",22);case 22:if(f||y!==r.key){a.next=27;break}if(E=o(i,t),i&&!E){a.next=27;break}return a.next=27,r.plugin(b,y,_,n,u);case 27:v++,a.next=12;break;case 30:case"end":return a.stop()}},a)},a=C.a.mark(d),s={},u=!0,c=!1,l=void 0,e.prev=6,p=te()(t.filter(_e.isAdditiveMutation));case 8:if(u=(f=p.next()).done){e.next=14;break}return h=f.value,e.delegateYield(d(h.value,h.path,h),"t0",11);case 11:u=!0,e.next=8;break;case 14:e.next=20;break;case 16:e.prev=16,e.t1=e.catch(6),c=!0,l=e.t1;case 20:e.prev=20,e.prev=21,u||null==p.return||p.return();case 23:if(e.prev=23,!c){e.next=26;break}throw l;case 26:return e.finish(23);case 27:return e.finish(20);case 28:case"end":return e.stop()}},e,null,[[6,16,20,28],[21,,23,27]])})),ie()(n.bind(a),{pluginName:e.name||t,isGenerator:_e.isGenerator(n)})}},{key:"nextPlugin",value:function(){var e=this;return pe()(this.wrappedPlugins,function(t){return e.getMutationsForPlugin(t).length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0)return Q.a.race(this.promisedPatches.map(function(e){return e.value}))}},{key:"getPluginHistory",value:function(e){var t=this.getPluginName(e);return this.pluginHistory[t]||[]}},{key:"getPluginRunCount",value:function(e){return this.getPluginHistory(e).length}},{key:"getPluginHistoryTip",value:function(e){var t=this.getPluginHistory(e);return t&&t[t.length-1]||{}}},{key:"getPluginMutationIndex",value:function(e){var t=this.getPluginHistoryTip(e).mutationIndex;return"number"!=typeof t?-1:t}},{key:"getPluginName",value:function(e){return e.pluginName}},{key:"updatePluginHistory",value:function(e,t){var n=this.getPluginName(e);(this.pluginHistory[n]=this.pluginHistory[n]||[]).push(t)}},{key:"updatePatches",value:function(e,t){var n=this;_e.normalizeArray(e).forEach(function(e){if(e instanceof Error)n.errors.push(e);else try{if(!_e.isObject(e))return void n.debug("updatePatches","Got a non-object patch",e);if(n.showDebug&&n.allPatches.push(e),_e.isPromise(e.value))return n.promisedPatches.push(e),void n.promisedPatchThen(e);if(_e.isContextPatch(e))return void n.setContext(e.path,e.value);if(_e.isMutation(e))return void n.updateMutations(e)}catch(e){console.error(e),n.errors.push(e)}})}},{key:"updateMutations",value:function(e){"object"===P()(e.value)&&!M()(e.value)&&this.allowMetaPatches&&(e.value=ie()({},e.value));var t=_e.applyPatch(this.state,e,{allowMetaPatches:this.allowMetaPatches});t&&(this.mutations.push(e),this.state=t)}},{key:"removePromisedPatch",value:function(e){var t=this.promisedPatches.indexOf(e);t<0?this.debug("Tried to remove a promisedPatch that isn't there!"):this.promisedPatches.splice(t,1)}},{key:"promisedPatchThen",value:function(e){var t=this;return e.value=e.value.then(function(n){var r=ie()({},e,{value:n});t.removePromisedPatch(e),t.updatePatches(r)}).catch(function(n){t.removePromisedPatch(e),t.updatePatches(n)})}},{key:"getMutations",value:function(e,t){return e=e||0,"number"!=typeof t&&(t=this.mutations.length),this.mutations.slice(e,t)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(e){var t=this.getPluginMutationIndex(e);return this.getMutations(t+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getPatchesOfType",value:function(e,t){return e.filter(t)}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(e){return _e.getIn(this.state,e)}},{key:"_getContext",value:function(e){return this.contextTree.get(e)}},{key:"setContext",value:function(e,t){return this.contextTree.set(e,t)}},{key:"_hasRun",value:function(e){return this.getPluginRunCount(this.getCurrentPlugin())>(e||0)}},{key:"_clone",value:function(e){return JSON.parse(T()(e))}},{key:"dispatch",value:function(){var e=this,t=this,n=this.nextPlugin();if(!n){var r=this.nextPromisedPatch();if(r)return r.then(function(){return e.dispatch()}).catch(function(){return e.dispatch()});var o={spec:this.state,errors:this.errors};return this.showDebug&&(o.patches=this.allPatches),Q.a.resolve(o)}if(t.pluginCount=t.pluginCount||{},t.pluginCount[n]=(t.pluginCount[n]||0)+1,t.pluginCount[n]>100)return Q.a.resolve({spec:t.state,errors:t.errors.concat(new Error("We've reached a hard limit of ".concat(100," plugin runs")))});if(n!==this.currentPlugin&&this.promisedPatches.length){var i=this.promisedPatches.map(function(e){return e.value});return Q.a.all(i.map(function(e){return e.then(Function,Function)})).then(function(){return e.dispatch()})}return function(){t.currentPlugin=n;var e=t.getCurrentMutations(),r=t.mutations.length-1;try{if(n.isGenerator){var o=!0,i=!1,s=void 0;try{for(var u,c=te()(n(e,t.getLib()));!(o=(u=c.next()).done);o=!0){a(u.value)}}catch(e){i=!0,s=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw s}}}else{a(n(e,t.getLib()))}}catch(e){console.error(e),a([ie()(re()(e),{plugin:n})])}finally{t.updatePluginHistory(n,{mutationIndex:r})}return t.dispatch()}();function a(e){e&&(e=_e.fullyNormalizeArray(e),t.updatePatches(e,n))}}}]),e}();var St={refs:ot,allOf:vt,parameters:gt,properties:yt},Ct=n(29),kt=n.n(Ct),Ot=function(e){return String.prototype.toLowerCase.call(e)},At=function(e){return e.replace(/[^\w]/gi,"_")};function Tt(e){var t=e.openapi;return!!t&&w()(t,"3")}function jt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).v2OperationIdCompatibilityMode;return e&&"object"===P()(e)?(e.operationId||"").replace(/\s/g,"").length?At(e.operationId):function(e,t){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).v2OperationIdCompatibilityMode){var n="".concat(t.toLowerCase(),"_").concat(e).replace(/[\s!@#$%^&*()_+=[{\]};:<>|.\/?,\\'""-]/g,"_");return(n=n||"".concat(e.substring(1),"_").concat(t)).replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return"".concat(Ot(t)).concat(At(e))}(t,n,{v2OperationIdCompatibilityMode:r}):null}function Pt(e,t){return"".concat(Ot(t),"-").concat(e)}function It(e,t){return e&&e.paths?function(e,t){return Mt(e,t,!0)||null}(e,function(e){var n=e.pathName,r=e.method,o=e.operation;if(!o||"object"!==P()(o))return!1;var i=o.operationId;return[jt(o,n,r),Pt(n,r),i].some(function(e){return e&&e===t})}):null}function Mt(e,t,n){if(!e||"object"!==P()(e)||!e.paths||"object"!==P()(e.paths))return null;var r=e.paths;for(var o in r)for(var i in r[o])if("PARAMETERS"!==i.toUpperCase()){var a=r[o][i];if(a&&"object"===P()(a)){var s={spec:e,pathName:o,method:i.toUpperCase(),operation:a},u=t(s);if(n&&u)return s}}}function Nt(e){var t=e.spec,n=t.paths,r={};if(!n||t.$$normalized)return e;for(var o in n){var i=n[o];if(kt()(i)){var a=i.parameters,s=function(e){var n=i[e];if(!kt()(n))return"continue";var s=jt(n,o,e);if(s){r[s]?r[s].push(n):r[s]=[n];var u=r[s];if(u.length>1)u.forEach(function(e,t){e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId="".concat(s).concat(t+1)});else if(void 0!==n.operationId){var c=u[0];c.__originalOperationId=c.__originalOperationId||n.operationId,c.operationId=s}}if("parameters"!==e){var l=[],p={};for(var f in t)"produces"!==f&&"consumes"!==f&&"security"!==f||(p[f]=t[f],l.push(p));if(a&&(p.parameters=a,l.push(p)),l.length)for(var h=0,d=l;h<d.length;h++){var m=d[h];for(var v in m)if(n[v]){if("parameters"===v){var g=!0,y=!1,b=void 0;try{for(var _,w=function(){var e=_.value;n[v].some(function(t){return t.name&&t.name===e.name||t.$ref&&t.$ref===e.$ref||t.$$ref&&t.$$ref===e.$$ref||t===e})||n[v].push(e)},x=te()(m[v]);!(g=(_=x.next()).done);g=!0)w()}catch(e){y=!0,b=e}finally{try{g||null==x.return||x.return()}finally{if(y)throw b}}}}else n[v]=m[v]}}};for(var u in i)s(u)}}return t.$$normalized=!0,e}function Rt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.requestInterceptor,r=t.responseInterceptor,o=e.withCredentials?"include":"same-origin";return function(t){return e({url:t,loadSpec:!0,requestInterceptor:n,responseInterceptor:r,headers:{Accept:Ge},credentials:o}).then(function(e){return e.body})}}function Dt(e){var t=e.fetch,n=e.spec,r=e.url,o=e.mode,i=e.allowMetaPatches,a=void 0===i||i,s=e.pathDiscriminator,u=e.modelPropertyMacro,c=e.parameterMacro,l=e.requestInterceptor,p=e.responseInterceptor,f=e.skipNormalization,h=e.useCircularStructures,d=e.http,m=e.baseDoc;return m=m||r,d=t||d||V,n?v(n):Rt(d,{requestInterceptor:l,responseInterceptor:p})(m).then(v);function v(e){m&&(St.refs.docCache[m]=e),St.refs.fetchJSON=Rt(d,{requestInterceptor:l,responseInterceptor:p});var t,n=[St.refs];return"function"==typeof c&&n.push(St.parameters),"function"==typeof u&&n.push(St.properties),"strict"!==o&&n.push(St.allOf),(t={spec:e,context:{baseDoc:m},plugins:n,allowMetaPatches:a,pathDiscriminator:s,parameterMacro:c,modelPropertyMacro:u,useCircularStructures:h},new Et(t).dispatch()).then(f?function(){var e=R()(C.a.mark(function e(t){return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t);case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}():Nt)}}var Lt=n(16),Ut=n.n(Lt);function qt(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qt(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):qt(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}function Bt(){return(Bt=R()(C.a.mark(function e(t,n){var r,o,i,a,s,u,c,l,p,f,h,d,m=arguments;return C.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=m.length>2&&void 0!==m[2]?m[2]:{},o=r.returnEntireTree,i=r.baseDoc,a=r.requestInterceptor,s=r.responseInterceptor,u=r.parameterMacro,c=r.modelPropertyMacro,l=r.useCircularStructures,p={pathDiscriminator:n,baseDoc:i,requestInterceptor:a,responseInterceptor:s,parameterMacro:u,modelPropertyMacro:c,useCircularStructures:l},f=Nt({spec:t}),h=f.spec,e.next=6,Dt(Ft({},p,{spec:h,allowMetaPatches:!0,skipNormalization:!0}));case 6:return d=e.sent,!o&&M()(n)&&n.length&&(d.spec=Ut()(d.spec,n)||null),e.abrupt("return",d);case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}var zt=n(38),Vt=n.n(zt);function Ht(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function Wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ht(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):Ht(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}var Jt=function(){return null},Kt=function(e){return M()(e)?e:[e]},Yt={mapTagOperations:function(e){var t=e.spec,n=e.cb,r=void 0===n?Jt:n,o=e.defaultTag,i=void 0===o?"default":o,a=e.v2OperationIdCompatibilityMode,s={},u={};return Mt(t,function(e){var n=e.pathName,o=e.method,c=e.operation;(c.tags?Kt(c.tags):[i]).forEach(function(e){if("string"==typeof e){var i=u[e]=u[e]||{},l=jt(c,n,o,{v2OperationIdCompatibilityMode:a}),p=r({spec:t,pathName:n,method:o,operation:c,operationId:l});if(s[l])s[l]++,i["".concat(l).concat(s[l])]=p;else if(void 0!==i[l]){var f=s[l]||1;s[l]=f+1,i["".concat(l).concat(s[l])]=p;var h=i[l];delete i[l],i["".concat(l).concat(f)]=h}else i[l]=p}})}),u},makeExecute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=t.pathName,r=t.method,o=t.operationId;return function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.execute(Wt({spec:e.spec},Vt()(e,"requestInterceptor","responseInterceptor","userFetch"),{pathName:n,method:r,parameters:t,operationId:o},i))}}}};var $t=n(39),Gt=n.n($t),Zt=n(40),Xt=n.n(Zt),Qt=n(41),en=n.n(Qt),tn=n(19),nn=n.n(tn),rn=n(42),on=n.n(rn),an={body:function(e){var t=e.req,n=e.value;t.body=n},header:function(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{},void 0!==r&&(t.headers[n.name]=r)},query:function(e){var t=e.req,n=e.value,r=e.parameter;t.query=t.query||{},!1===n&&"boolean"===r.type&&(n="false");0===n&&["number","integer"].indexOf(r.type)>-1&&(n="0");if(n)t.query[r.name]={collectionFormat:r.collectionFormat,value:n};else if(r.allowEmptyValue&&void 0!==n){var o=r.name;t.query[o]=t.query[o]||{},t.query[o].allowEmptyValue=!0}},path:function(e){var t=e.req,n=e.value,r=e.parameter;t.url=t.url.split("{".concat(r.name,"}")).join(encodeURIComponent(n))},formData:function(e){var t=e.req,n=e.value,r=e.parameter;(n||r.allowEmptyValue)&&(t.form=t.form||{},t.form[r.name]={value:n,allowEmptyValue:r.allowEmptyValue,collectionFormat:r.collectionFormat})}};n(49);var sn=n(43),un=n.n(sn),cn=n(44),ln=function(e){return":/?#[]@!$&'()*+,;=".indexOf(e)>-1},pn=function(e){return/^[a-z0-9\-._~]+$/i.test(e)};function fn(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).escape,n=arguments.length>2?arguments[2]:void 0;return"number"==typeof e&&(e=e.toString()),"string"==typeof e&&e.length&&t?n?JSON.parse(e):Object(cn.stringToCharArray)(e).map(function(e){return pn(e)?e:ln(e)&&"unsafe"===t?e:(un()(e)||[]).map(function(e){return"0".concat(e.toString(16).toUpperCase()).slice(-2)}).map(function(e){return"%".concat(e)}).join("")}).join(""):e}function hn(e){var t=e.value;return M()(t)?function(e){var t=e.key,n=e.value,r=e.style,o=e.explode,i=e.escape,a=function(e){return fn(e,{escape:i})};if("simple"===r)return n.map(function(e){return a(e)}).join(",");if("label"===r)return".".concat(n.map(function(e){return a(e)}).join("."));if("matrix"===r)return n.map(function(e){return a(e)}).reduce(function(e,n){return!e||o?"".concat(e||"",";").concat(t,"=").concat(n):"".concat(e,",").concat(n)},"");if("form"===r){var s=o?"&".concat(t,"="):",";return n.map(function(e){return a(e)}).join(s)}if("spaceDelimited"===r){var u=o?"".concat(t,"="):"";return n.map(function(e){return a(e)}).join(" ".concat(u))}if("pipeDelimited"===r){var c=o?"".concat(t,"="):"";return n.map(function(e){return a(e)}).join("|".concat(c))}}(e):"object"===P()(t)?function(e){var t=e.key,n=e.value,r=e.style,o=e.explode,i=e.escape,a=function(e){return fn(e,{escape:i})},s=m()(n);if("simple"===r)return s.reduce(function(e,t){var r=a(n[t]),i=o?"=":",",s=e?"".concat(e,","):"";return"".concat(s).concat(t).concat(i).concat(r)},"");if("label"===r)return s.reduce(function(e,t){var r=a(n[t]),i=o?"=":".",s=e?"".concat(e,"."):".";return"".concat(s).concat(t).concat(i).concat(r)},"");if("matrix"===r&&o)return s.reduce(function(e,t){var r=a(n[t]),o=e?"".concat(e,";"):";";return"".concat(o).concat(t,"=").concat(r)},"");if("matrix"===r)return s.reduce(function(e,r){var o=a(n[r]),i=e?"".concat(e,","):";".concat(t,"=");return"".concat(i).concat(r,",").concat(o)},"");if("form"===r)return s.reduce(function(e,t){var r=a(n[t]),i=e?"".concat(e).concat(o?"&":","):"",s=o?"=":",";return"".concat(i).concat(t).concat(s).concat(r)},"")}(e):function(e){var t=e.key,n=e.value,r=e.style,o=e.escape,i=function(e){return fn(e,{escape:o})};if("simple"===r)return i(n);if("label"===r)return".".concat(i(n));if("matrix"===r)return";".concat(t,"=").concat(i(n));if("form"===r)return i(n);if("deepObject"===r)return i(n)}(e)}function dn(e,t){return t.includes("application/json")?"string"==typeof e?e:T()(e):e.toString()}function mn(e){var t=e.req,n=e.value,r=e.parameter,o=r.name,i=r.style,a=r.explode,s=r.content;if(s){var u=m()(s)[0];t.url=t.url.split("{".concat(o,"}")).join(fn(dn(n,u),{escape:!0}))}else{var c=hn({key:r.name,value:n,style:i||"simple",explode:a||!1,escape:!0});t.url=t.url.split("{".concat(o,"}")).join(c)}}function vn(e){var t=e.req,n=e.value,r=e.parameter;if(t.query=t.query||{},r.content){var o=m()(r.content)[0];t.query[r.name]=dn(n,o)}else if(!1===n&&(n="false"),0===n&&(n="0"),n){var i=P()(n);if("deepObject"===r.style)m()(n).forEach(function(e){var o=n[e];t.query["".concat(r.name,"[").concat(e,"]")]={value:hn({key:e,value:o,style:"deepObject",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}});else if("object"!==i||M()(n)||"form"!==r.style&&r.style||!r.explode&&void 0!==r.explode){var a=encodeURIComponent(r.name);t.query[a]={value:hn({key:a,value:n,style:r.style||"form",explode:void 0===r.explode||r.explode,escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}}else{m()(n).forEach(function(e){var o=n[e];t.query[e]={value:hn({key:e,value:o,style:r.style||"form",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}})}}else if(r.allowEmptyValue&&void 0!==n){var s=r.name;t.query[s]=t.query[s]||{},t.query[s].allowEmptyValue=!0}}var gn=["accept","authorization","content-type"];function yn(e){var t=e.req,n=e.parameter,r=e.value;if(t.headers=t.headers||{},!(gn.indexOf(n.name.toLowerCase())>-1))if(n.content){var o=m()(n.content)[0];t.headers[n.name]=dn(r,o)}else void 0!==r&&(t.headers[n.name]=hn({key:n.name,value:r,style:n.style||"simple",explode:void 0!==n.explode&&n.explode,escape:!1}))}function bn(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{};var o=P()(r);if(n.content){var i=m()(n.content)[0];t.headers.Cookie="".concat(n.name,"=").concat(dn(r,i))}else if("undefined"!==o){var a="object"===o&&!M()(r)&&n.explode?"":"".concat(n.name,"=");t.headers.Cookie=a+hn({key:n.name,value:r,escape:!1,style:n.style||"form",explode:void 0!==n.explode&&n.explode})}}var _n=n(30),wn=function(e,t){var n=e.operation,r=e.requestBody,o=e.securities,i=e.spec,a=e.attachContentTypeForEmptyPayload,s=e.requestContentType;t=function(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,o=e.operation,i=void 0===o?{}:o,a=e.spec,s=b()({},t),u=r.authorized,c=void 0===u?{}:u,l=i.security||a.security||[],p=c&&!!m()(c).length,f=Ut()(a,["components","securitySchemes"])||{};if(s.headers=s.headers||{},s.query=s.query||{},!m()(r).length||!p||!l||M()(i.security)&&!i.security.length)return t;return l.forEach(function(e,t){for(var n in e){var r=c[n],o=f[n];if(r){var i=r.value||r,a=o.type;if(r)if("apiKey"===a)"query"===o.in&&(s.query[o.name]=i),"header"===o.in&&(s.headers[o.name]=i),"cookie"===o.in&&(s.cookies[o.name]=i);else if("http"===a){if("basic"===o.scheme){var u=i.username,l=i.password,p=nn()("".concat(u,":").concat(l));s.headers.Authorization="Basic ".concat(p)}"bearer"===o.scheme&&(s.headers.Authorization="Bearer ".concat(i))}else if("oauth2"===a){var h=r.token||{},d=h[o["x-tokenName"]||"access_token"],m=h.token_type;m&&"bearer"!==m.toLowerCase()||(m="Bearer"),s.headers.Authorization="".concat(m," ").concat(d)}}}}),s}({request:t,securities:o,operation:n,spec:i});var u=n.requestBody||{},c=m()(u.content||{}),l=s&&c.indexOf(s)>-1;if(r||a){if(s&&l)t.headers["Content-Type"]=s;else if(!s){var p=c[0];p&&(t.headers["Content-Type"]=p,s=p)}}else s&&l&&(t.headers["Content-Type"]=s);return r&&(s?c.indexOf(s)>-1&&("application/x-www-form-urlencoded"===s||0===s.indexOf("multipart/")?"object"===P()(r)?(t.form={},m()(r).forEach(function(e){var n,o,i=r[e];"undefined"!=typeof File&&(o=i instanceof File),"undefined"!=typeof Blob&&(o=o||i instanceof Blob),void 0!==_n.Buffer&&(o=o||_n.Buffer.isBuffer(i)),n="object"!==P()(i)||o?i:M()(i)?i.toString():T()(i),t.form[e]={value:n}})):t.form=r:t.body=r):t.body=r),t};var xn=function(e,t){var n=e.spec,r=e.operation,o=e.securities,i=e.requestContentType,a=e.attachContentTypeForEmptyPayload;if((t=function(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,o=e.operation,i=void 0===o?{}:o,a=e.spec,s=b()({},t),u=r.authorized,c=void 0===u?{}:u,l=r.specSecurity,p=void 0===l?[]:l,f=i.security||p,h=c&&!!m()(c).length,d=a.securityDefinitions;if(s.headers=s.headers||{},s.query=s.query||{},!m()(r).length||!h||!f||M()(i.security)&&!i.security.length)return t;return f.forEach(function(e,t){for(var n in e){var r=c[n];if(r){var o=r.token,i=r.value||r,a=d[n],u=a.type,l=a["x-tokenName"]||"access_token",p=o&&o[l],f=o&&o.token_type;if(r)if("apiKey"===u){var h="query"===a.in?"query":"headers";s[h]=s[h]||{},s[h][a.name]=i}else"basic"===u?i.header?s.headers.authorization=i.header:(i.base64=nn()("".concat(i.username,":").concat(i.password)),s.headers.authorization="Basic ".concat(i.base64)):"oauth2"===u&&p&&(f=f&&"bearer"!==f.toLowerCase()?f:"Bearer",s.headers.authorization="".concat(f," ").concat(p))}}}),s}({request:t,securities:o,operation:r,spec:n})).body||t.form||a)i?t.headers["Content-Type"]=i:M()(r.consumes)?t.headers["Content-Type"]=r.consumes[0]:M()(n.consumes)?t.headers["Content-Type"]=n.consumes[0]:r.parameters&&r.parameters.filter(function(e){return"file"===e.type}).length?t.headers["Content-Type"]="multipart/form-data":r.parameters&&r.parameters.filter(function(e){return"formData"===e.in}).length&&(t.headers["Content-Type"]="application/x-www-form-urlencoded");else if(i){var s=r.parameters&&r.parameters.filter(function(e){return"body"===e.in}).length>0,u=r.parameters&&r.parameters.filter(function(e){return"formData"===e.in}).length>0;(s||u)&&(t.headers["Content-Type"]=i)}return t};function En(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function Sn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?En(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):En(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}var Cn=function(e){return M()(e)?e:[]},kn=Be("OperationNotFoundError",function(e,t,n){this.originalError=n,ie()(this,t||{})}),On=function(e,t){return t.filter(function(t){return t.name===e})},An=function(e){var t={};e.forEach(function(e){t[e.in]||(t[e.in]={}),t[e.in][e.name]=e});var n=[];return m()(t).forEach(function(e){m()(t[e]).forEach(function(r){n.push(t[e][r])})}),n},Tn={buildRequest:jn};function jn(e){var t=e.spec,n=e.operationId,o=(e.securities,e.requestContentType,e.responseContentType),i=e.scheme,a=e.requestInterceptor,s=e.responseInterceptor,u=e.contextUrl,c=e.userFetch,l=(e.requestBody,e.server),p=e.serverVariables,f=e.http,h=e.parameters,d=e.parameterBuilders,v=Tt(t);d||(d=v?r:an);var g={url:"",credentials:f&&f.withCredentials?"include":"same-origin",headers:{},cookies:{}};a&&(g.requestInterceptor=a),s&&(g.responseInterceptor=s),c&&(g.userFetch=c);var y=It(t,n);if(!y)throw new kn("Operation ".concat(n," not found"));var b,_=y.operation,w=void 0===_?{}:_,x=y.method,S=y.pathName;if(g.url+=Tt((b={spec:t,scheme:i,contextUrl:u,server:l,serverVariables:p,pathName:S,method:x}).spec)?function(e){var t=e.spec,n=e.pathName,r=e.method,o=e.server,i=e.contextUrl,a=e.serverVariables,s=void 0===a?{}:a,u=Ut()(t,["paths",n,(r||"").toLowerCase(),"servers"])||Ut()(t,["paths",n,"servers"])||Ut()(t,["servers"]),c="",l=null;if(o&&u&&u.length){var p=u.map(function(e){return e.url});p.indexOf(o)>-1&&(c=o,l=u[p.indexOf(o)])}return!c&&u&&u.length&&(c=u[0].url,l=u[0]),c.indexOf("{")>-1&&function(e){for(var t,n=[],r=/{([^}]+)}/g;t=r.exec(e);)n.push(t[1]);return n}(c).forEach(function(e){if(l.variables&&l.variables[e]){var t=l.variables[e],n=s[e]||t.default,r=new RegExp("{".concat(e,"}"),"g");c=c.replace(r,n)}}),function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=E.a.parse(t),o=E.a.parse(n),i=Pn(r.protocol)||Pn(o.protocol)||"",a=r.host||o.host,s=r.pathname||"";return"/"===(e=i&&a?"".concat(i,"://").concat(a+s):s)[e.length-1]?e.slice(0,-1):e}(c,i)}(b):function(e){var t,n=e.spec,r=e.scheme,o=e.contextUrl,i=void 0===o?"":o,a=E.a.parse(i),s=M()(n.schemes)?n.schemes[0]:null,u=r||s||Pn(a.protocol)||"http",c=n.host||a.host||"",l=n.basePath||"";return"/"===(t=u&&c?"".concat(u,"://").concat(c+l):l)[t.length-1]?t.slice(0,-1):t}(b),!n)return delete g.cookies,g;g.url+=S,g.method="".concat(x).toUpperCase(),h=h||{};var C=t.paths[S]||{};o&&(g.headers.accept=o);var k=An([].concat(Cn(w.parameters)).concat(Cn(C.parameters)));k.forEach(function(e){var n,r=d[e.in];if("body"===e.in&&e.schema&&e.schema.properties&&(n=h),void 0===(n=e&&e.name&&h[e.name])?n=e&&e.name&&h["".concat(e.in,".").concat(e.name)]:On(e.name,k).length>1&&console.warn("Parameter '".concat(e.name,"' is ambiguous because the defined spec has more than one parameter with the name: '").concat(e.name,"' and the passed-in parameter values did not define an 'in' value.")),null!==n){if(void 0!==e.default&&void 0===n&&(n=e.default),void 0===n&&e.required&&!e.allowEmptyValue)throw new Error("Required parameter ".concat(e.name," is not provided"));if(v&&e.schema&&"object"===e.schema.type&&"string"==typeof n)try{n=JSON.parse(n)}catch(e){throw new Error("Could not parse object parameter value string as JSON")}r&&r({req:g,parameter:e,value:n,operation:w,spec:t})}});var O=Sn({},e,{operation:w});if((g=v?wn(O,g):xn(O,g)).cookies&&m()(g.cookies).length){var A=m()(g.cookies).reduce(function(e,t){var n=g.cookies[t];return e+(e?"&":"")+on.a.serialize(t,n)},"");g.headers.Cookie=A}return g.cookies&&delete g.cookies,Z(g),g}var Pn=function(e){return e?e.replace(/\W/g,""):null};function In(e,t){var n=m()(e);if(h.a){var r=h()(e);t&&(r=r.filter(function(t){return p()(e,t).enumerable})),n.push.apply(n,r)}return n}function Mn(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e?n.url=e:n=e,!(this instanceof Mn))return new Mn(n);b()(this,n);var r=this.resolve().then(function(){return t.disableInterfaces||b()(t,Mn.makeApisTagOperation(t)),t});return r.client=this,r}Mn.http=V,Mn.makeHttp=function(e,t,n){return n=n||function(e){return e},t=t||function(e){return e},function(r){return"string"==typeof r&&(r={url:r}),z.mergeInQueryOrForm(r),r=t(r),n(e(r))}}.bind(null,Mn.http),Mn.resolve=Dt,Mn.resolveSubtree=function(e,t){return Bt.apply(this,arguments)},Mn.execute=function(e){var t=e.http,n=e.fetch,r=e.spec,o=e.operationId,i=e.pathName,a=e.method,s=e.parameters,u=e.securities,c=Gt()(e,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),l=t||n||V;i&&a&&!o&&(o=Pt(i,a));var p=Tn.buildRequest(Sn({spec:r,operationId:o,parameters:s,securities:u,http:l},c));return p.body&&(Xt()(p.body)||en()(p.body))&&(p.body=T()(p.body)),l(p)},Mn.serializeRes=J,Mn.serializeHeaders=K,Mn.clearCache=function(){St.refs.clearCache()},Mn.makeApisTagOperation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Yt.makeExecute(e);return{apis:Yt.mapTagOperations({v2OperationIdCompatibilityMode:e.v2OperationIdCompatibilityMode,spec:e.spec,cb:t})}},Mn.buildRequest=jn,Mn.helpers={opId:jt},Mn.prototype={http:V,execute:function(e){return this.applyDefaults(),Mn.execute(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?In(n,!0).forEach(function(t){g()(e,t,n[t])}):c.a?s()(e,c()(n)):In(n).forEach(function(t){i()(e,t,p()(n,t))})}return e}({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:"string"==typeof this.url?this.url:void 0},e))},resolve:function(){var e=this;return Mn.resolve({spec:this.spec,url:this.url,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null}).then(function(t){return e.originalSpec=e.spec,e.spec=t.spec,e.errors=t.errors,e})}},Mn.prototype.applyDefaults=function(){var e=this.spec,t=this.url;if(t&&w()(t,"http")){var n=E.a.parse(t);e.host||(e.host=n.host),e.schemes||(e.schemes=[n.protocol.replace(":","")]),e.basePath||(e.basePath="/")}};t.default=Mn}]).default},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(426),a=n(90),s=n(427),u=n(116),c=n(185),l=n(15),p=[],f=0,h=i.getPooled(),d=!1,m=null;function v(){x.ReactReconcileTransaction&&m||r("123")}var g=[{initialize:function(){this.dirtyComponentsLength=p.length},close:function(){this.dirtyComponentsLength!==p.length?(p.splice(0,this.dirtyComponentsLength),w()):p.length=0}},{initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}}];function y(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=i.getPooled(),this.reconcileTransaction=x.ReactReconcileTransaction.getPooled(!0)}function b(e,t){return e._mountOrder-t._mountOrder}function _(e){var t=e.dirtyComponentsLength;t!==p.length&&r("124",t,p.length),p.sort(b),f++;for(var n=0;n<t;n++){var o,i=p[n],a=i._pendingCallbacks;if(i._pendingCallbacks=null,s.logTopLevelRenders){var c=i;i._currentElement.type.isReactTopLevelWrapper&&(c=i._renderedComponent),o="React update: "+c.getName(),console.time(o)}if(u.performUpdateIfNecessary(i,e.reconcileTransaction,f),o&&console.timeEnd(o),a)for(var l=0;l<a.length;l++)e.callbackQueue.enqueue(a[l],i.getPublicInstance())}}o(y.prototype,c,{getTransactionWrappers:function(){return g},destructor:function(){this.dirtyComponentsLength=null,i.release(this.callbackQueue),this.callbackQueue=null,x.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return c.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),a.addPoolingTo(y);var w=function(){for(;p.length||d;){if(p.length){var e=y.getPooled();e.perform(_,null,e),y.release(e)}if(d){d=!1;var t=h;h=i.getPooled(),t.notifyAll(),i.release(t)}}};var x={ReactReconcileTransaction:null,batchedUpdates:function(e,t,n,r,o,i){return v(),m.batchedUpdates(e,t,n,r,o,i)},enqueueUpdate:function e(t){v(),m.isBatchingUpdates?(p.push(t),null==t._updateBatchNumber&&(t._updateBatchNumber=f+1)):m.batchedUpdates(e,t)},flushBatchedUpdates:w,injection:{injectReconcileTransaction:function(e){e||r("126"),x.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e||r("127"),"function"!=typeof e.batchedUpdates&&r("128"),"boolean"!=typeof e.isBatchingUpdates&&r("129"),m=e}},asap:function(e,t){l(m.isBatchingUpdates,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."),h.enqueue(e,t),d=!0}};e.exports=x},function(e,t,n){var r; +/*! + Copyright (c) 2017 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames */ -var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),l=1;l<arguments.length;l++){n=Object(arguments[l]);for(var c in n)o.call(n,c)&&(u[c]=n[c]);if(i){s=i(n);for(var p=0;p<s.length;p++)a.call(n,s[p])&&(u[s[p]]=n[s[p]])}}return u}},function(e,t,n){"use strict";function r(e,t){return 1===e.nodeType&&e.getAttribute(d)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function i(e){for(var t;t=e._renderedComponent;)e=t;return e}function o(e,t){var n=i(e);n._hostNode=t,t[v]=n}function a(e){var t=e._hostNode;t&&(delete t[v],e._hostNode=null)}function s(e,t){if(!(e._flags&m.hasCachedChildNodes)){var n=e._renderedChildren,a=t.firstChild;e:for(var s in n)if(n.hasOwnProperty(s)){var u=n[s],l=i(u)._domID;if(0!==l){for(;null!==a;a=a.nextSibling)if(r(a,l)){o(u,a);continue e}p("32",l)}}e._flags|=m.hasCachedChildNodes}}function u(e){if(e[v])return e[v];for(var t=[];!e[v];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}for(var n,r;e&&(r=e[v]);e=t.pop())n=r,t.length&&s(r,e);return n}function l(e){var t=u(e);return null!=t&&t._hostNode===e?t:null}function c(e){if(void 0===e._hostNode&&p("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||p("34"),e=e._hostParent;for(;t.length;e=t.pop())s(e,e._hostNode);return e._hostNode}var p=n(11),f=n(89),h=n(453),d=(n(8),f.ID_ATTRIBUTE_NAME),m=h,v="__reactInternalInstance$"+Math.random().toString(36).slice(2),g={getClosestInstanceFromNode:u,getInstanceFromNode:l,getNodeFromInstance:c,precacheChildNodes:s,precacheNode:o,uncacheNode:a};e.exports=g},function(e,t){var n=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";function r(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===a.indexOf(t))throw new o('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=r(t.styleAliases||null),-1===s.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var o=n(117),a=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];e.exports=i},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(564),o=r(i),a=n(95),s=r(a);t.default=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=(0,s.default)(e);!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if((0,o.default)(Object(t)))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t,n){var r=n(361)("wks"),i=n(202),o=n(31).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";t.__esModule=!0;var r=n(30),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=i.default||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){var r=n(188)("wks"),i=n(134),o=n(24).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){var r=n(24),i=n(15),o=n(53),a=n(56),s=function(e,t,n){var u,l,c,p=e&s.F,f=e&s.G,h=e&s.S,d=e&s.P,m=e&s.B,v=e&s.W,g=f?i:i[t]||(i[t]={}),y=g.prototype,_=f?r:h?r[t]:(r[t]||{}).prototype;f&&(n=t);for(u in n)(l=!p&&_&&void 0!==_[u])&&u in g||(c=l?_[u]:n[u],g[u]=f&&"function"!=typeof _[u]?n[u]:m&&l?o(c,r):v&&_[u]==c?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(c):d&&"function"==typeof c?o(Function.call,c):c,d&&((g.virtual||(g.virtual={}))[u]=c,e&s.R&&y&&!y[u]&&a(y,u,c)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=i},function(e,t,n){"use strict";function r(e){return Object.prototype.toString.call(e)}function i(e){return"[object String]"===r(e)}function o(e,t){return!!e&&d.call(e,t)}function a(e){return[].slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function s(e){return e.indexOf("\\")<0?e:e.replace(m,"$1")}function u(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function l(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function c(e,t){var n=0;return o(y,t)?y[t]:35===t.charCodeAt(0)&&g.test(t)&&(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),u(n))?l(n):e}function p(e){return e.indexOf("&")<0?e:e.replace(v,c)}function f(e){return x[e]}function h(e){return _.test(e)?e.replace(b,f):e}var d=Object.prototype.hasOwnProperty,m=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,v=/&([a-z#][a-z0-9]{1,31});/gi,g=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,y=n(488),_=/[&<>"]/,b=/[&<>"]/g,x={"&":"&","<":"<",">":">",'"':"""};t.assign=a,t.isString=i,t.has=o,t.unescapeMd=s,t.isValidEntityCode=u,t.fromCodePoint=l,t.replaceEntities=p,t.escapeHtml=h},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(31),i=n(63),o=n(64),a=n(78),s=n(136),u=function(e,t,n){var l,c,p,f,h=e&u.F,d=e&u.G,m=e&u.S,v=e&u.P,g=e&u.B,y=d?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,_=d?i:i[t]||(i[t]={}),b=_.prototype||(_.prototype={});d&&(n=t);for(l in n)c=!h&&y&&void 0!==y[l],p=(c?y:n)[l],f=g&&c?s(p,r):v&&"function"==typeof p?s(Function.call,p):p,y&&a(y,l,p,e&u.U),_[l]!=p&&o(_,l,f),v&&b[l]!=p&&(b[l]=p)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(28),i=n(107),o=n(57),a=/"/g,s=function(e,t,n,r){var i=String(o(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){e.exports={default:n(589),__esModule:!0}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){m&&h&&(m=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!m){var e=i(a);m=!0;for(var t=d.length;t;){for(h=d,d=[];++v<t;)h&&h[v].run();v=-1,t=d.length}h=null,m=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var c,p,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(e){p=r}}();var h,d=[],m=!1,v=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new u(e,t)),1!==d.length||m||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.get("openapi");return!!t&&t.startsWith("3")}function o(e){var t=e.get("swagger");return!!t&&t.startsWith("2")}function a(e){return function(t,n){return function(r){if(n&&n.specSelectors&&n.specSelectors.specJson){return i(n.specSelectors.specJson())?c.default.createElement(e,(0,u.default)({},r,n,{Ori:t})):c.default.createElement(t,r)}return console.warn("OAS3 wrapper: couldn't get spec"),null}}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(21),u=r(s);t.isOAS3=i,t.isSwagger2=o,t.OAS3ComponentWrapFactory=a;var l=n(0),c=r(l)},function(e,t,n){e.exports={default:n(588),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(331),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e,t,n){return t in e?(0,i.default)(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var r=n(27);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){function n(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=n},function(e,t,n){"use strict";var r=null;e.exports={debugTool:r}},function(e,t,n){"use strict";(function(e){function r(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(r()<t)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):(null===e&&(e=new o(t)),e.length=t),e}function o(e,t,n){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return a(this,e,t,n)}function a(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?f(e,t,n,r):"string"==typeof t?c(e,t,n):h(e,t)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,n,r){return s(t),t<=0?i(e,t):void 0!==n?"string"==typeof r?i(e,t).fill(n,r):i(e,t).fill(n):i(e,t)}function l(e,t){if(s(t),e=i(e,t<0?0:0|d(t)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function c(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(t,n);e=i(e,r);var a=e.write(t,n);return a!==r&&(e=e.slice(0,a)),e}function p(e,t){var n=t.length<0?0:0|d(t.length);e=i(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function f(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),o.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=o.prototype):e=p(e,t),e}function h(e,t){if(o.isBuffer(t)){var n=0|d(t.length);return e=i(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||X(t.length)?i(e,0):p(e,t);if("Buffer"===t.type&&Z(t.data))return p(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(e){if(e>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return D(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}var l;if(i){var c=-1;for(l=n;l<s;l++)if(o(e,l)===o(t,-1===c?0:l-c)){if(-1===c&&(c=l),l-c+1===u)return c*a}else-1!==c&&(l-=l-c),c=-1}else for(n+u>s&&(n=s-u),l=n;l>=0;l--){for(var p=!0,f=0;f<u;f++)if(o(e,l+f)!==o(t,f)){p=!1;break}if(p)return l}return-1}function x(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function w(e,t,n,r){return K(V(t,e.length-n),e,n,r)}function k(e,t,n,r){return K(H(t),e,n,r)}function E(e,t,n,r){return k(e,t,n,r)}function S(e,t,n,r){return K(J(t),e,n,r)}function C(e,t,n,r){return K(G(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?Y.fromByteArray(e):Y.fromByteArray(e.slice(t,n))}function D(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=n){var u,l,c,p;switch(s){case 1:o<128&&(a=o);break;case 2:u=e[i+1],128==(192&u)&&(p=(31&o)<<6|63&u)>127&&(a=p);break;case 3:u=e[i+1],l=e[i+2],128==(192&u)&&128==(192&l)&&(p=(15&o)<<12|(63&u)<<6|63&l)>2047&&(p<55296||p>57343)&&(a=p);break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(p=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&p<1114112&&(a=p)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=s}return O(r)}function O(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Q));return n}function M(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function P(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=W(e[o]);return i}function I(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function F(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,i){return i||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,n,r,23,4),n+4}function q(e,t,n,r,i){return i||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,n,r,52,8),n+8}function z(e){if(e=U(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function U(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function H(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function G(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function J(e){return Y.toByteArray(z(e))}function K(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function X(e){return e!==e}/*! +/*! + Copyright (c) 2017 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){e.exports=n(765)},function(e,t,n){e.exports=n(768)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_SELECTED_SERVER",function(){return r}),n.d(t,"UPDATE_REQUEST_BODY_VALUE",function(){return o}),n.d(t,"UPDATE_ACTIVE_EXAMPLES_MEMBER",function(){return i}),n.d(t,"UPDATE_REQUEST_CONTENT_TYPE",function(){return a}),n.d(t,"UPDATE_RESPONSE_CONTENT_TYPE",function(){return s}),n.d(t,"UPDATE_SERVER_VARIABLE_VALUE",function(){return u}),n.d(t,"setSelectedServer",function(){return c}),n.d(t,"setRequestBodyValue",function(){return l}),n.d(t,"setActiveExamplesMember",function(){return p}),n.d(t,"setRequestContentType",function(){return f}),n.d(t,"setResponseContentType",function(){return h}),n.d(t,"setServerVariableValue",function(){return d});var r="oas3_set_servers",o="oas3_set_request_body_value",i="oas3_set_active_examples_member",a="oas3_set_request_content_type",s="oas3_set_response_content_type",u="oas3_set_server_variable_value";function c(e,t){return{type:r,payload:{selectedServerUrl:e,namespace:t}}}function l(e){var t=e.value,n=e.pathMethod;return{type:o,payload:{value:t,pathMethod:n}}}function p(e){var t=e.name,n=e.pathMethod,r=e.contextType,o=e.contextName;return{type:i,payload:{name:t,pathMethod:n,contextType:r,contextName:o}}}function f(e){var t=e.value,n=e.pathMethod;return{type:a,payload:{value:t,pathMethod:n}}}function h(e){var t=e.value,n=e.path,r=e.method;return{type:s,payload:{value:t,path:n,method:r}}}function d(e){var t=e.server,n=e.namespace,r=e.key,o=e.val;return{type:u,payload:{server:t,namespace:n,key:r,val:o}}}},function(e,t,n){var r=n(132);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";(function(e){ +/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ -var Y=n(570),$=n(764),Z=n(387);t.Buffer=o,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return a(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return u(null,e,t,n)},o.allocUnsafe=function(e){return l(null,e)},o.allocUnsafeSlow=function(e){return l(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Z(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=o.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},o.byteLength=v,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?D(this,0,e):g.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e,t,n,r,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,s=n-t,u=Math.min(a,s),l=this.slice(r,i),c=e.slice(t,n),p=0;p<u;++p)if(l[p]!==c[p]){a=l[p],s=c[p];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},o.prototype.indexOf=function(e,t,n){return _(this,e,t,n,!0)},o.prototype.lastIndexOf=function(e,t,n){return _(this,e,t,n,!1)},o.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return x(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return k(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r;if(o.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=o.prototype;else{var i=t-e;r=new o(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+e]}return r},o.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},o.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){j(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},o.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){j(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},o.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var s=o.isBuffer(e)?e:V(new o(e,r).toString()),u=s.length;for(a=0;a<n-t;++a)this[a+t]=s[a%u]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,n(17))},function(e,t,n){var r=n(37),i=n(335),o=n(190),a=Object.defineProperty;t.f=n(49)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(406),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){"use strict";function r(){D.ReactReconcileTransaction&&w||c("123")}function i(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=f.getPooled(),this.reconcileTransaction=D.ReactReconcileTransaction.getPooled(!0)}function o(e,t,n,i,o,a){return r(),w.batchedUpdates(e,t,n,i,o,a)}function a(e,t){return e._mountOrder-t._mountOrder}function s(e){var t=e.dirtyComponentsLength;t!==y.length&&c("124",t,y.length),y.sort(a),_++;for(var n=0;n<t;n++){var r=y[n],i=r._pendingCallbacks;r._pendingCallbacks=null;var o;if(d.logTopLevelRenders){var s=r;r._currentElement.type.isReactTopLevelWrapper&&(s=r._renderedComponent),o="React update: "+s.getName(),console.time(o)}if(m.performUpdateIfNecessary(r,e.reconcileTransaction,_),o&&console.timeEnd(o),i)for(var u=0;u<i.length;u++)e.callbackQueue.enqueue(i[u],r.getPublicInstance())}}function u(e){if(r(),!w.isBatchingUpdates)return void w.batchedUpdates(u,e);y.push(e),null==e._updateBatchNumber&&(e._updateBatchNumber=_+1)}function l(e,t){g(w.isBatchingUpdates,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."),b.enqueue(e,t),x=!0}var c=n(11),p=n(13),f=n(451),h=n(70),d=n(456),m=n(90),v=n(161),g=n(8),y=[],_=0,b=f.getPooled(),x=!1,w=null,k={initialize:function(){this.dirtyComponentsLength=y.length},close:function(){this.dirtyComponentsLength!==y.length?(y.splice(0,this.dirtyComponentsLength),C()):y.length=0}},E={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},S=[k,E];p(i.prototype,v,{getTransactionWrappers:function(){return S},destructor:function(){this.dirtyComponentsLength=null,f.release(this.callbackQueue),this.callbackQueue=null,D.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return v.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),h.addPoolingTo(i);var C=function(){for(;y.length||x;){if(y.length){var e=i.getPooled();e.perform(s,null,e),i.release(e)}if(x){x=!1;var t=b;b=f.getPooled(),t.notifyAll(),f.release(t)}}},A={injectReconcileTransaction:function(e){e||c("126"),D.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e||c("127"),"function"!=typeof e.batchedUpdates&&c("128"),"boolean"!=typeof e.isBatchingUpdates&&c("129"),w=e}},D={ReactReconcileTransaction:null,batchedUpdates:o,enqueueUpdate:u,flushBatchedUpdates:C,injection:A,asap:l};e.exports=D},function(e,t){(function(){var e=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},t=function(e,t){function r(){this.constructor=e}for(var i in t)n.call(t,i)&&(e[i]=t[i]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},n={}.hasOwnProperty;this.Mark=function(){function t(e,t,n,r){this.line=e,this.column=t,this.buffer=n,this.pointer=r}return t.prototype.get_snippet=function(t,n){var r,i,o,a,s,u,l;if(null==t&&(t=4),null==n&&(n=75),null==this.buffer)return null;for(r="\0\r\n…\u2028\u2029",o="",u=this.pointer;u>0&&(a=this.buffer[u-1],e.call(r,a)<0);)if(u--,this.pointer-u>n/2-1){o=" ... ",u+=5;break}for(l="",i=this.pointer;i<this.buffer.length&&(s=this.buffer[i],e.call(r,s)<0);)if(++i-this.pointer>n/2-1){l=" ... ",i-=5;break}return""+new Array(t).join(" ")+o+this.buffer.slice(u,i)+l+"\n"+new Array(t+this.pointer-u+o.length).join(" ")+"^"},t.prototype.toString=function(){var e,t;return e=this.get_snippet(),t=" on line "+(this.line+1)+", column "+(this.column+1),e?t:t+":\n"+e},t}(),this.YAMLError=function(e){function n(e){this.message=e,n.__super__.constructor.call(this),this.stack=this.toString()+"\n"+(new Error).stack.split("\n").slice(1).join("\n")}return t(n,e),n.prototype.toString=function(){return this.message},n}(Error),this.MarkedYAMLError=function(e){function n(e,t,r,i,o){this.context=e,this.context_mark=t,this.problem=r,this.problem_mark=i,this.note=o,n.__super__.constructor.call(this)}return t(n,e),n.prototype.toString=function(){var e;return e=[],null!=this.context&&e.push(this.context),null==this.context_mark||null!=this.problem&&null!=this.problem_mark&&this.context_mark.line===this.problem_mark.line&&this.context_mark.column===this.problem_mark.column||e.push(this.context_mark.toString()),null!=this.problem&&e.push(this.problem),null!=this.problem_mark&&e.push(this.problem_mark.toString()),null!=this.note&&e.push(this.note),e.join("\n")},n}(this.YAMLError)}).call(this)},function(e,t,n){"use strict";var r=n(95),i=function(e){return e&&e.__esModule?e:{default:e}}(r);e.exports=function(){var e={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return e;try{e=window;var t=["File","Blob","FormData"],n=!0,r=!1,o=void 0;try{for(var a,s=(0,i.default)(t);!(n=(a=s.next()).done);n=!0){var u=a.value;u in window&&(e[u]=window[u])}}catch(e){r=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}}catch(e){console.error(e)}return e}()},function(e,t,n){e.exports={default:n(593),__esModule:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(567),o=r(i),a=n(566),s=r(a),u="function"==typeof s.default&&"symbol"==typeof o.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};t.default="function"==typeof s.default&&"symbol"===u(o.default)?function(e){return void 0===e?"undefined":u(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":void 0===e?"undefined":u(e)}},function(e,t,n){e.exports=!n(54)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";function r(e,t,n){return n?[e,t]:e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var i=this.constructor.Interface;for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];s?this[o]=s(n):"target"===o?this.target=r:this[o]=n[o]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?a.thatReturnsTrue:a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse,this}var i=n(13),o=n(70),a=n(32),s=(n(10),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),u={type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};i(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n<s.length;n++)this[s[n]]=null}}),r.Interface=u,r.augmentClass=function(e,t){var n=this,r=function(){};r.prototype=n.prototype;var a=new r;i(a,e.prototype),e.prototype=a,e.prototype.constructor=e,e.Interface=i({},n.Interface,t),e.augmentClass=n.augmentClass,o.addPoolingTo(e,o.fourArgumentPooler)},o.addPoolingTo(r,o.fourArgumentPooler),e.exports=r},function(e,t,n){"use strict";var r={current:null};e.exports=r},function(e,t,n){var r=n(98);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(41),i=n(101);e.exports=n(49)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){function r(e){return a(e)?i(e):o(e)}var i=n(393),o=n(856),a=n(86);e.exports=r},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){return e===t}function o(e){var t=arguments.length<=1||void 0===arguments[1]?i:arguments[1],n=null,r=null;return function(){for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return null!==n&&n.length===o.length&&o.every(function(e,r){return t(e,n[r])})?r:(r=e.apply(void 0,o),n=o,r)}}function a(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var n=t.map(function(e){return typeof e}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function s(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return function(){for(var t=arguments.length,i=Array(t),o=0;o<t;o++)i[o]=arguments[o];var s=0,u=i.pop(),l=a(i),c=e.apply(void 0,[function(){return s++,u.apply(void 0,arguments)}].concat(n)),p=function(e,t){for(var n=arguments.length,i=Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];var a=l.map(function(n){return n.apply(void 0,[e,t].concat(i))});return c.apply(void 0,r(a))};return p.resultFunc=u,p.recomputations=function(){return s},p.resetRecomputations=function(){return s=0},p}}function u(){return s(o).apply(void 0,arguments)}function l(e){var t=arguments.length<=1||void 0===arguments[1]?u:arguments[1];if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t,r){return e[n[r]]=t,e},{})})}t.__esModule=!0,t.defaultMemoize=o,t.createSelectorCreator=s,t.createSelector=u,t.createStructuredSelector=l},function(e,t,n){(function(e){(function(){var t,r,i,o=[].slice,a={}.hasOwnProperty;this.StringStream=function(){function e(){this.string=""}return e.prototype.write=function(e){return this.string+=e},e}(),this.clone=function(e){return function(t){return e.extend({},t)}}(this),this.extend=function(){var e,t,n,r,i,a,s;for(e=arguments[0],a=2<=arguments.length?o.call(arguments,1):[],t=0,r=a.length;t<r;t++){i=a[t];for(n in i)s=i[n],e[n]=s}return e},this.is_empty=function(e){var t;if(Array.isArray(e)||"string"==typeof e)return 0===e.length;for(t in e)if(a.call(e,t))return!1;return!0},this.inspect=null!=(t=null!=(r=null!=(i=n(1194))?i.inspect:void 0)?r:e.inspect)?t:function(e){return""+e},this.pad_left=function(e,t,n){return e=String(e),e.length>=n?e:e.length+1===n?""+t+e:""+new Array(n-e.length+1).join(t)+e},this.to_hex=function(e){return"string"==typeof e&&(e=e.charCodeAt(0)),e.toString(16)}}).call(this)}).call(t,n(17))},function(e,t,n){var r=n(77);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(138),i=n(360);e.exports=n(106)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var r=n(725),i=Math.max;e.exports=function(e){return i(0,r(e))}},function(e,t,n){function r(e){return null==e?void 0===e?u:s:(e=Object(e),l&&l in e?o(e):a(e))}var i=n(82),o=n(896),a=n(925),s="[object Null]",u="[object Undefined]",l=i?i.toStringTag:void 0;e.exports=r},function(e,t,n){function r(e,t){var n=o(e,t);return i(n)?n:void 0}var i=n(854),o=n(897);e.exports=r},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r=n(11),i=(n(8),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),o=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,e,t,n),i}return new r(e,t,n)},s=function(e,t,n,r){var i=this;if(i.instancePool.length){var o=i.instancePool.pop();return i.call(o,e,t,n,r),o}return new i(e,t,n,r)},u=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},l=i,c=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||l,n.poolSize||(n.poolSize=10),n.release=u,n},p={addPoolingTo:c,oneArgumentPooler:i,twoArgumentPooler:o,threeArgumentPooler:a,fourArgumentPooler:s};e.exports=p},function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);l.call(this,e),c.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||a(o,this)}function o(e){e.end()}var a=n(158),s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=r;var u=n(111);u.inherits=n(42);var l=n(479),c=n(261);u.inherits(r,l);for(var p=s(c.prototype),f=0;f<p.length;f++){var h=p[f];r.prototype[h]||(r.prototype[h]=c.prototype[h])}Object.defineProperty(r.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),r.prototype._destroy=function(e,t){this.push(null),this.end(),a(t,e)}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";var r=n(430),i=n(429),o=n(114).decodeHTML,a="&(?:#x[a-f0-9]{1,8}|#[0-9]{1,8}|[a-z][a-z0-9]{1,31});",s="<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="</[A-Za-z][A-Za-z0-9-]*\\s*[>]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|</[A-Za-z][A-Za-z0-9-]*\\s*[>]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t){e.exports={}},function(e,t,n){var r=n(181),i=n(178);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(178);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(31),i=n(64),o=n(108),a=n(202)("src"),s=Function.toString,u=(""+s).split("toString");n(63).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var l="function"==typeof n;l&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(l&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,n){"use strict";var r=n(372)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";function r(e){return void 0===e||null===e}function i(e){return"object"==typeof e&&null!==e}function o(e){return Array.isArray(e)?e:r(e)?[]:[e]}function a(e,t){var n,r,i,o;if(t)for(o=Object.keys(t),n=0,r=o.length;n<r;n+=1)i=o[n],e[i]=t[i];return e}function s(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r}function u(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}e.exports.isNothing=r,e.exports.isObject=i,e.exports.toArray=o,e.exports.repeat=s,e.exports.isNegativeZero=u,e.exports.extend=a},function(e,t,n){"use strict";function r(e,t,n){var i=[];return e.include.forEach(function(e){n=r(e,t,n)}),e[t].forEach(function(e){n.forEach(function(t,n){t.tag===e.tag&&t.kind===e.kind&&i.push(n)}),n.push(e)}),n.filter(function(e,t){return-1===i.indexOf(t)})}function i(){function e(e){r[e.kind][e.tag]=r.fallback[e.tag]=e}var t,n,r={scalar:{},sequence:{},mapping:{},fallback:{}};for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(e);return r}function o(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new s("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=r(this,"implicit",[]),this.compiledExplicit=r(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var a=n(80),s=n(117),u=n(16);o.DEFAULT=null,o.create=function(){var e,t;switch(arguments.length){case 1:e=o.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new s("Wrong number of arguments for Schema.create function")}if(e=a.toArray(e),t=a.toArray(t),!e.every(function(e){return e instanceof o}))throw new s("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof u}))throw new s("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new o({include:e,explicit:t})},e.exports=o},function(e,t,n){var r=n(43),i=r.Symbol;e.exports=i},function(e,t,n){function r(e,t){return i(e)?e:o(e,t)?[e]:a(s(e))}var i=n(20),o=n(221),a=n(936),s=n(87);e.exports=r},function(e,t,n){function r(e,t,n,r){var a=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var l=t[s],c=r?r(n[l],e[l],l,n,e):void 0;void 0===c&&(c=e[l]),a?o(n,l,c):i(n,l,c)}return n}var i=n(148),o=n(396);e.exports=r},function(e,t,n){function r(e){if("string"==typeof e||i(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}var i=n(155),o=1/0;e.exports=r},function(e,t,n){function r(e){return null!=e&&o(e.length)&&!i(e)}var i=n(420),o=n(228);e.exports=r},function(e,t,n){function r(e){return null==e?"":i(e)}var i=n(401);e.exports=r},function(e,t,n){"use strict";function r(e){if(d){var t=e.node,n=e.children;if(n.length)for(var r=0;r<n.length;r++)m(t,n[r],null);else null!=e.html?p(t,e.html):null!=e.text&&h(t,e.text)}}function i(e,t){e.parentNode.replaceChild(t.node,e),r(t)}function o(e,t){d?e.children.push(t):e.node.appendChild(t.node)}function a(e,t){d?e.html=t:p(e.node,t)}function s(e,t){d?e.text=t:h(e.node,t)}function u(){return this.node.nodeName}function l(e){return{node:e,children:[],html:null,text:null,toString:u}}var c=n(241),p=n(163),f=n(249),h=n(469),d="undefined"!=typeof document&&"number"==typeof document.documentMode||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&/\bEdge\/\d/.test(navigator.userAgent),m=f(function(e,t,n){11===t.node.nodeType||1===t.node.nodeType&&"object"===t.node.nodeName.toLowerCase()&&(null==t.node.namespaceURI||t.node.namespaceURI===c.html)?(r(t),e.insertBefore(t.node,n)):(e.insertBefore(t.node,n),r(t))});l.insertTreeBefore=m,l.replaceChildWithTree=i,l.queueChild=o,l.queueHTML=a,l.queueText=s,e.exports=l},function(e,t,n){"use strict";function r(e,t){return(e&t)===t}var i=n(11),o=(n(8),{MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(e){var t=o,n=e.Properties||{},a=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},l=e.DOMPropertyNames||{},c=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var p in n){s.properties.hasOwnProperty(p)&&i("48",p);var f=p.toLowerCase(),h=n[p],d={attributeName:f,attributeNamespace:null,propertyName:p,mutationMethod:null,mustUseProperty:r(h,t.MUST_USE_PROPERTY),hasBooleanValue:r(h,t.HAS_BOOLEAN_VALUE),hasNumericValue:r(h,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(h,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(h,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(d.hasBooleanValue+d.hasNumericValue+d.hasOverloadedBooleanValue<=1||i("50",p),u.hasOwnProperty(p)){var m=u[p];d.attributeName=m}a.hasOwnProperty(p)&&(d.attributeNamespace=a[p]),l.hasOwnProperty(p)&&(d.propertyName=l[p]),c.hasOwnProperty(p)&&(d.mutationMethod=c[p]),s.properties[p]=d}}}),a=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",s={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:a,ATTRIBUTE_NAME_CHAR:a+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<s._isCustomAttributeFunctions.length;t++){if((0,s._isCustomAttributeFunctions[t])(e))return!0}return!1},injection:o};e.exports=s},function(e,t,n){"use strict";function r(){i.attachRefs(this,this._currentElement)}var i=n(1045),o=(n(39),n(10),{mountComponent:function(e,t,n,i,o,a){var s=e.mountComponent(t,n,i,o,a);return e._currentElement&&null!=e._currentElement.ref&&t.getReactMountReady().enqueue(r,e),s},getHostNode:function(e){return e.getHostNode()},unmountComponent:function(e,t){i.detachRefs(e,e._currentElement),e.unmountComponent(t)},receiveComponent:function(e,t,n,o){var a=e._currentElement;if(t!==a||o!==e._context){var s=i.shouldUpdateRefs(a,t);s&&i.detachRefs(e,a),e.receiveComponent(t,n,o),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t,n){e._updateBatchNumber===n&&e.performUpdateIfNecessary(t)}});e.exports=o},function(e,t,n){"use strict";var r=n(430),i=n(429),o=n(114).decodeHTML,a="&(?:#x[a-f0-9]{1,8}|#[0-9]{1,8}|[a-z][a-z0-9]{1,31});",s="<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="</[A-Za-z][A-Za-z0-9-]*\\s*[>]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|</[A-Za-z][A-Za-z0-9-]*\\s*[>]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t,n){"use strict";var r=n(13),i=n(474),o=n(1100),a=n(1101),s=n(93),u=n(1102),l=n(1103),c=n(1104),p=n(1108),f=s.createElement,h=s.createFactory,d=s.cloneElement,m=r,v=function(e){return e},g={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:p},Component:i.Component,PureComponent:i.PureComponent,createElement:f,cloneElement:d,isValidElement:s.isValidElement,PropTypes:u,createClass:c,createFactory:h,createMixin:v,DOM:a,version:l,__spread:m};e.exports=g},function(e,t,n){"use strict";function r(e){return void 0!==e.ref}function i(e){return void 0!==e.key}var o=n(13),a=n(52),s=(n(10),n(478),Object.prototype.hasOwnProperty),u=n(476),l={key:!0,ref:!0,__self:!0,__source:!0},c=function(e,t,n,r,i,o,a){var s={$$typeof:u,type:e,key:t,ref:n,props:a,_owner:o};return s};c.createElement=function(e,t,n){var o,u={},p=null,f=null;if(null!=t){r(t)&&(f=t.ref),i(t)&&(p=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source;for(o in t)s.call(t,o)&&!l.hasOwnProperty(o)&&(u[o]=t[o])}var h=arguments.length-2;if(1===h)u.children=n;else if(h>1){for(var d=Array(h),m=0;m<h;m++)d[m]=arguments[m+2];u.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(o in v)void 0===u[o]&&(u[o]=v[o])}return c(e,p,f,0,0,a.current,u)},c.createFactory=function(e){var t=c.createElement.bind(null,e);return t.type=e,t},c.cloneAndReplaceKey=function(e,t){return c(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},c.cloneElement=function(e,t,n){var u,p=o({},e.props),f=e.key,h=e.ref,d=(e._self,e._source,e._owner);if(null!=t){r(t)&&(h=t.ref,d=a.current),i(t)&&(f=""+t.key);var m;e.type&&e.type.defaultProps&&(m=e.type.defaultProps);for(u in t)s.call(t,u)&&!l.hasOwnProperty(u)&&(void 0===t[u]&&void 0!==m?p[u]=m[u]:p[u]=t[u])}var v=arguments.length-2;if(1===v)p.children=n;else if(v>1){for(var g=Array(v),y=0;y<v;y++)g[y]=arguments[y+2];p.children=g}return c(e.type,f,h,0,0,d,p)},c.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===u},e.exports=c},function(e,t){(function(){var e,t=function(e,t){function r(){this.constructor=e}for(var i in t)n.call(t,i)&&(e[i]=t[i]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},n={}.hasOwnProperty;e=0,this.Node=function(){function t(t,n,r,i){this.tag=t,this.value=n,this.start_mark=r,this.end_mark=i,this.unique_id="node_"+e++}return t}(),this.ScalarNode=function(e){function n(e,t,r,i,o){this.tag=e,this.value=t,this.start_mark=r,this.end_mark=i,this.style=o,n.__super__.constructor.apply(this,arguments)}return t(n,e),n.prototype.id="scalar",n}(this.Node),this.CollectionNode=function(e){function n(e,t,r,i,o){this.tag=e,this.value=t,this.start_mark=r,this.end_mark=i,this.flow_style=o,n.__super__.constructor.apply(this,arguments)}return t(n,e),n}(this.Node),this.SequenceNode=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.prototype.id="sequence",n}(this.CollectionNode),this.MappingNode=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.prototype.id="mapping",n}(this.CollectionNode)}).call(this)},function(e,t,n){e.exports={default:n(586),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(563),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,i.default)(e)}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(345),i=n(180);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(41).f,i=n(55),o=n(22)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){"use strict";var r=n(617)(!0);n(339)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){n(622);for(var r=n(24),i=n(56),o=n(74),a=n(22)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<s.length;u++){var l=s[u],c=r[l],p=c&&c.prototype;p&&!p[a]&&i(p,a,l),o[l]=o.Array}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){e.exports=!n(107)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports={}},function(e,t,n){var r=n(139),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){(function(e){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(e)}function r(e){return"boolean"==typeof e}function i(e){return null===e}function o(e){return null==e}function a(e){return"number"==typeof e}function s(e){return"string"==typeof e}function u(e){return"symbol"==typeof e}function l(e){return void 0===e}function c(e){return"[object RegExp]"===v(e)}function p(e){return"object"==typeof e&&null!==e}function f(e){return"[object Date]"===v(e)}function h(e){return"[object Error]"===v(e)||e instanceof Error}function d(e){return"function"==typeof e}function m(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function v(e){return Object.prototype.toString.call(e)}t.isArray=n,t.isBoolean=r,t.isNull=i,t.isNullOrUndefined=o,t.isNumber=a,t.isString=s,t.isSymbol=u,t.isUndefined=l,t.isRegExp=c,t.isObject=p,t.isDate=f,t.isError=h,t.isFunction=d,t.isPrimitive=m,t.isBuffer=e.isBuffer}).call(t,n(40).Buffer)},function(e,t,n){"use strict";function r(e){return"string"==typeof e&&i.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=/-webkit-|-moz-|-ms-/;e.exports=t.default},function(e,t){e.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",Doctype:"doctype",isTag:function(e){return"tag"===e.type||"script"===e.type||"style"===e.type}}},function(e,t,n){var r=n(711),i=n(710);t.decode=function(e,t){return(!t||t<=0?i.XML:i.HTML)(e)},t.decodeStrict=function(e,t){return(!t||t<=0?i.XML:i.HTMLStrict)(e)},t.encode=function(e,t){return(!t||t<=0?r.XML:r.HTML)(e)},t.encodeXML=r.XML,t.encodeHTML4=t.encodeHTML5=t.encodeHTML=r.HTML,t.decodeXML=t.decodeXMLStrict=i.XML,t.decodeHTML4=t.decodeHTML5=t.decodeHTML=i.HTML,t.decodeHTML4Strict=t.decodeHTML5Strict=t.decodeHTMLStrict=i.HTMLStrict,t.escape=r.escape},function(e,t,n){"use strict";var r=n(79);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){function r(t,n){return delete e.exports[t],e.exports[t]=n,n}var i=n(380),o=n(700);e.exports={Parser:i,Tokenizer:n(381),ElementType:n(113),DomHandler:o,get FeedHandler(){return r("FeedHandler",n(760))},get Stream(){return r("Stream",n(762))},get WritableStream(){return r("WritableStream",n(382))},get ProxyHandler(){return r("ProxyHandler",n(761))},get DomUtils(){return r("DomUtils",n(702))},get CollectingHandler(){return r("CollectingHandler",n(759))},DefaultHandler:o,get RssHandler(){return r("RssHandler",this.FeedHandler)},parseDOM:function(e,t){var n=new o(t);return new i(n,t).end(e),n.dom},parseFeed:function(t,n){var r=new e.exports.FeedHandler(n);return new i(r,n).end(t),r.dom},createDomStream:function(e,t,n){var r=new o(e,t,n);return new i(r,t)},EVENTS:{attribute:2,cdatastart:0,cdataend:0,text:1,processinginstruction:2,comment:1,commentend:0,closetag:1,opentag:2,opentagname:1,error:1,end:0}}},function(e,t,n){"use strict";function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=r},function(e,t,n){"use strict";var r=n(81);e.exports=new r({include:[n(388)],implicit:[n(814),n(807)],explicit:[n(799),n(809),n(810),n(812)]})},function(e,t,n){function r(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?s(e)?o(e[0],e[1]):i(e):u(e)}var i=n(858),o=n(859),a=n(225),s=n(20),u=n(952);e.exports=r},function(e,t){function n(e,t){return e===t||e!==e&&t!==t}e.exports=n},function(e,t){function n(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')}function r(e){var t=e.match(y);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function o(e){var n=e,o=r(e);if(o){if(!o.path)return e;n=o.path}for(var a,s=t.isAbsolute(n),u=n.split(/\/+/),l=0,c=u.length-1;c>=0;c--)a=u[c],"."===a?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return n=u.join("/"),""===n&&(n=s?"/":"."),o?(o.path=n,i(o)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=r(t),a=r(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(_))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var s="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=s,i(a)):s}function s(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}function u(e){return e}function l(e){return p(e)?"$"+e:e}function c(e){return p(e)?e.slice(1):e}function p(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function f(e,t,n){var r=d(e.source,t.source);return 0!==r?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)||n?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:(r=e.generatedLine-t.generatedLine,0!==r?r:d(e.name,t.name))}function h(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)||n?r:0!==(r=d(e.source,t.source))?r:0!==(r=e.originalLine-t.originalLine)?r:(r=e.originalColumn-t.originalColumn,0!==r?r:d(e.name,t.name))}function d(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}function m(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=d(e.source,t.source))?n:0!==(n=e.originalLine-t.originalLine)?n:(n=e.originalColumn-t.originalColumn,0!==n?n:d(e.name,t.name))}function v(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function g(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var s=r(n);if(!s)throw new Error("sourceMapURL could not be parsed");if(s.path){var u=s.path.lastIndexOf("/");u>=0&&(s.path=s.path.substring(0,u+1))}t=a(i(s),t)}return o(t)}t.getArg=n;var y=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,_=/^data:.+\,.+$/;t.urlParse=r,t.urlGenerate=i,t.normalize=o,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||y.test(e)},t.relative=s;var b=function(){return!("__proto__"in Object.create(null))}();t.toSetString=b?u:l,t.fromSetString=b?u:c,t.compareByOriginalPositions=f,t.compareByGeneratedPositionsDeflated=h,t.compareByGeneratedPositionsInflated=m,t.parseSourceMapInput=v,t.computeSourceURL=g},function(e,t,n){"use strict";function r(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}function i(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||!r(t));default:return!1}}var o=n(11),a=n(242),s=n(243),u=n(247),l=n(462),c=n(463),p=(n(8),{}),f=null,h=function(e,t){e&&(s.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},d=function(e){return h(e,!0)},m=function(e){return h(e,!1)},v=function(e){return"."+e._rootNodeID},g={injection:{injectEventPluginOrder:a.injectEventPluginOrder,injectEventPluginsByName:a.injectEventPluginsByName},putListener:function(e,t,n){"function"!=typeof n&&o("94",t,typeof n);var r=v(e);(p[t]||(p[t]={}))[r]=n;var i=a.registrationNameModules[t];i&&i.didPutListener&&i.didPutListener(e,t,n)},getListener:function(e,t){var n=p[t];if(i(t,e._currentElement.type,e._currentElement.props))return null;var r=v(e);return n&&n[r]},deleteListener:function(e,t){var n=a.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=p[t];if(r){delete r[v(e)]}},deleteAllListeners:function(e){var t=v(e);for(var n in p)if(p.hasOwnProperty(n)&&p[n][t]){var r=a.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete p[n][t]}},extractEvents:function(e,t,n,r){for(var i,o=a.plugins,s=0;s<o.length;s++){var u=o[s];if(u){var c=u.extractEvents(e,t,n,r);c&&(i=l(i,c))}}return i},enqueueEvents:function(e){e&&(f=l(f,e))},processEventQueue:function(e){var t=f;f=null,e?c(t,d):c(t,m),f&&o("95"),u.rethrowCaughtError()},__purge:function(){p={}},__getListenerBank:function(){return p}};e.exports=g},function(e,t,n){"use strict";function r(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return g(e,r)}function i(e,t,n){var i=r(e,n,t);i&&(n._dispatchListeners=m(n._dispatchListeners,i),n._dispatchInstances=m(n._dispatchInstances,e))}function o(e){e&&e.dispatchConfig.phasedRegistrationNames&&d.traverseTwoPhase(e._targetInst,i,e)}function a(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst,n=t?d.getParentInstance(t):null;d.traverseTwoPhase(n,i,e)}}function s(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,i=g(e,r);i&&(n._dispatchListeners=m(n._dispatchListeners,i),n._dispatchInstances=m(n._dispatchInstances,e))}}function u(e){e&&e.dispatchConfig.registrationName&&s(e._targetInst,null,e)}function l(e){v(e,o)}function c(e){v(e,a)}function p(e,t,n,r){d.traverseEnterLeave(n,r,s,e,t)}function f(e){v(e,u)}var h=n(122),d=n(243),m=n(462),v=n(463),g=(n(10),h.getListener),y={accumulateTwoPhaseDispatches:l,accumulateTwoPhaseDispatchesSkipTarget:c,accumulateDirectDispatches:f,accumulateEnterLeaveDispatches:p};e.exports=y},function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o=n(252),a={view:function(e){if(e.view)return e.view;var t=o(e);if(t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};i.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var i=new Error(n);throw i.name="Invariant Violation",i.framesToPop=1,i}e.exports=r},function(e,t){(function(){var e=function(e,n){function r(){this.constructor=e}for(var i in n)t.call(n,i)&&(e[i]=n[i]);return r.prototype=n.prototype,e.prototype=new r,e.__super__=n.prototype,e},t={}.hasOwnProperty;this.Event=function(){function e(e,t){this.start_mark=e,this.end_mark=t}return e}(),this.NodeEvent=function(t){function n(e,t,n){this.anchor=e,this.start_mark=t,this.end_mark=n}return e(n,t),n}(this.Event),this.CollectionStartEvent=function(t){function n(e,t,n,r,i,o){this.anchor=e,this.tag=t,this.implicit=n,this.start_mark=r,this.end_mark=i,this.flow_style=o}return e(n,t),n}(this.NodeEvent),this.CollectionEndEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.Event),this.StreamStartEvent=function(t){function n(e,t,n){this.start_mark=e,this.end_mark=t,this.encoding=n}return e(n,t),n}(this.Event),this.StreamEndEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.Event),this.DocumentStartEvent=function(t){function n(e,t,n,r,i){this.start_mark=e,this.end_mark=t,this.explicit=n,this.version=r,this.tags=i}return e(n,t),n}(this.Event),this.DocumentEndEvent=function(t){function n(e,t,n){this.start_mark=e,this.end_mark=t,this.explicit=n}return e(n,t),n}(this.Event),this.AliasEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.NodeEvent),this.ScalarEvent=function(t){function n(e,t,n,r,i,o,a){this.anchor=e,this.tag=t,this.implicit=n,this.value=r,this.start_mark=i,this.end_mark=o,this.style=a}return e(n,t),n}(this.NodeEvent),this.SequenceStartEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.CollectionStartEvent),this.SequenceEndEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.CollectionEndEvent),this.MappingStartEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.CollectionStartEvent),this.MappingEndEvent=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n}(this.CollectionEndEvent)}).call(this)},function(e,t,n){"use strict";function r(e){return{type:p,payload:(0,c.default)(e)}}function i(e){return{type:f,payload:e}}function o(e){return{type:h,payload:e}}function a(e){return{type:d,payload:e}}function s(e){return{type:m,payload:e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:v,payload:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CLEAR=t.NEW_AUTH_ERR=t.NEW_SPEC_ERR_BATCH=t.NEW_SPEC_ERR=t.NEW_THROWN_ERR_BATCH=t.NEW_THROWN_ERR=void 0,t.newThrownErr=r,t.newThrownErrBatch=i,t.newSpecErr=o,t.newSpecErrBatch=a,t.newAuthErr=s,t.clear=u;var l=n(264),c=function(e){return e&&e.__esModule?e:{default:e}}(l),p=t.NEW_THROWN_ERR="err_new_thrown_err",f=t.NEW_THROWN_ERR_BATCH="err_new_thrown_err_batch",h=t.NEW_SPEC_ERR="err_new_spec_err",d=t.NEW_SPEC_ERR_BATCH="err_new_spec_err_batch",m=t.NEW_AUTH_ERR="err_new_auth_err",v=t.CLEAR="err_clear"},function(e,t,n){var r=n(53),i=n(338),o=n(336),a=n(37),s=n(133),u=n(193),l={},c={},t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(h=s(e.length);h>_;_++)if((v=t?y(a(d=e[_])[0],d[1]):y(e[_]))===l||v===c)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=i(m,y,d.value,t))===l||v===c)return v};t.BREAK=l,t.RETURN=c},function(e,t){e.exports=!0},function(e,t,n){var r=n(134)("meta"),i=n(27),o=n(55),a=n(41).f,s=0,u=Object.isExtensible||function(){return!0},l=!n(54)(function(){return u(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},p=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},f=function(e,t){if(!o(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},h=function(e){return l&&d.NEED&&u(e)&&!o(e,r)&&c(e),e},d=e.exports={KEY:r,NEED:!1,fastKey:p,getWeak:f,onFreeze:h}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(189),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(135);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";var r=n(64),i=n(78),o=n(107),a=n(57),s=n(19);e.exports=function(e,t,n){var u=s(e),l=n(a,u,""[e]),c=l[0],p=l[1];o(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,c),r(RegExp.prototype,u,2==t?function(e,t){return p.call(e,this,t)}:function(e){return p.call(e,this)}))}},function(e,t,n){var r=n(62),i=n(642),o=n(661),a=Object.defineProperty;t.f=n(106)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(644),i=n(57);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";var r,i=n(373),o=n(376),a=n(729),s=n(734);r=e.exports=function(e,t){var n,r,a,u,l;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=a=!0,r=!1):(n=s.call(e,"c"),r=s.call(e,"e"),a=s.call(e,"w")),l={value:t,configurable:n,enumerable:r,writable:a},u?i(o(u),l):l},r.gs=function(e,t,n){var r,u,l,c;return"string"!=typeof e?(l=n,n=t,t=e,e=null):l=arguments[3],null==t?t=void 0:a(t)?null==n?n=void 0:a(n)||(l=n,n=void 0):(l=t,t=n=void 0),null==e?(r=!0,u=!1):(r=s.call(e,"c"),u=s.call(e,"e")),c={get:t,set:n,configurable:r,enumerable:u},l?i(o(l),c):c}},function(e,t,n){"use strict";e.exports=n(726)("forEach")},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),l=n.slice(),i=l.length,u=0;u<i;u++)l[u].apply(this,s);return!0},n.prototype.addListener=function(e,t){var i;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";var r=n(81);e.exports=r.DEFAULT=new r({include:[n(118)],explicit:[n(805),n(804),n(803)]})},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(911),o=n(912),a=n(913),s=n(914),u=n(915);r.prototype.clear=i,r.prototype.delete=o,r.prototype.get=a,r.prototype.has=s,r.prototype.set=u,e.exports=r},function(e,t){function n(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}e.exports=n},function(e,t,n){function r(e,t,n){var r=e[t];s.call(e,t)&&o(r,n)&&(void 0!==n||t in e)||i(e,t,n)}var i=n(396),o=n(120),a=Object.prototype,s=a.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){for(var n=e.length;n--;)if(i(e[n][0],t))return n;return-1}var i=n(120);e.exports=r},function(e,t,n){function r(e,t){t=i(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[o(t[n++])];return n&&n==r?e:void 0}var i=n(83),o=n(85);e.exports=r},function(e,t,n){function r(e,t){var n=e.__data__;return i(t)?n["string"==typeof t?"string":"hash"]:n.map}var i=n(909);e.exports=r},function(e,t){function n(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||i.test(e))&&e>-1&&e%1==0&&e<t}var r=9007199254740991,i=/^(?:0|[1-9]\d*)$/;e.exports=n},function(e,t){function n(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}var r=Object.prototype;e.exports=n},function(e,t,n){var r=n(67),i=r(Object,"create");e.exports=i},function(e,t,n){function r(e){return"symbol"==typeof e||o(e)&&i(e)==a}var i=n(66),o=n(68),a="[object Symbol]";e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=n(233),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=function(e){function t(n){r(this,t);var o=i(this,e.call(this,n));return o.type="atrule",o}return o(t,e),t.prototype.append=function(){var t;this.nodes||(this.nodes=[]);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.prototype.append).call.apply(t,[this].concat(r))},t.prototype.prepend=function(){var t;this.nodes||(this.nodes=[]);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.prototype.prepend).call.apply(t,[this].concat(r))},t}(s.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(233),l=r(u),c=n(435),p=r(c),f=function(e){function t(n){i(this,t);var r=o(this,e.call(this,n));return r.type="rule",r.nodes||(r.nodes=[]),r}return a(t,e),s(t,[{key:"selectors",get:function(){return p.default.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}]),t}(l.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";(function(t){function n(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,i)});default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick(function(){e.apply(null,o)})}}!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports=n:e.exports=t.nextTick}).call(t,n(33))},function(e,t,n){"use strict";function r(e){return Object.prototype.hasOwnProperty.call(e,m)||(e[m]=h++,p[e[m]]={}),p[e[m]]}var i,o=n(13),a=n(242),s=n(1037),u=n(461),l=n(1069),c=n(253),p={},f=!1,h=0,d={topAbort:"abort",topAnimationEnd:l("animationend")||"animationend",topAnimationIteration:l("animationiteration")||"animationiteration",topAnimationStart:l("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:l("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},m="_reactListenersID"+String(Math.random()).slice(2),v=o({},s,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(v.handleTopLevel),v.ReactEventListener=e}},setEnabled:function(e){v.ReactEventListener&&v.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!v.ReactEventListener||!v.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,i=r(n),o=a.registrationNameDependencies[e],s=0;s<o.length;s++){var u=o[s];i.hasOwnProperty(u)&&i[u]||("topWheel"===u?c("wheel")?v.ReactEventListener.trapBubbledEvent("topWheel","wheel",n):c("mousewheel")?v.ReactEventListener.trapBubbledEvent("topWheel","mousewheel",n):v.ReactEventListener.trapBubbledEvent("topWheel","DOMMouseScroll",n):"topScroll"===u?c("scroll",!0)?v.ReactEventListener.trapCapturedEvent("topScroll","scroll",n):v.ReactEventListener.trapBubbledEvent("topScroll","scroll",v.ReactEventListener.WINDOW_HANDLE):"topFocus"===u||"topBlur"===u?(c("focus",!0)?(v.ReactEventListener.trapCapturedEvent("topFocus","focus",n),v.ReactEventListener.trapCapturedEvent("topBlur","blur",n)):c("focusin")&&(v.ReactEventListener.trapBubbledEvent("topFocus","focusin",n),v.ReactEventListener.trapBubbledEvent("topBlur","focusout",n)),i.topBlur=!0,i.topFocus=!0):d.hasOwnProperty(u)&&v.ReactEventListener.trapBubbledEvent(u,d[u],n),i[u]=!0)}},trapBubbledEvent:function(e,t,n){return v.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return v.ReactEventListener.trapCapturedEvent(e,t,n)},supportsEventPageXY:function(){if(!document.createEvent)return!1;var e=document.createEvent("MouseEvent");return null!=e&&"pageX"in e},ensureScrollValueMonitoring:function(){if(void 0===i&&(i=v.supportsEventPageXY()),!i&&!f){var e=u.refreshScrollValues;v.ReactEventListener.monitorScrollValue(e),f=!0}}});e.exports=v},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(125),o=n(461),a=n(251),s={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:a,button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+o.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+o.currentScrollTop}};i.augmentClass(r,s),e.exports=r},function(e,t,n){"use strict";var r=n(11),i=(n(8),{}),o={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,n,i,o,a,s,u){this.isInTransaction()&&r("27");var l,c;try{this._isInTransaction=!0,l=!0,this.initializeAll(0),c=e.call(t,n,i,o,a,s,u),l=!1}finally{try{if(l)try{this.closeAll(0)}catch(e){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return c},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=i,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===i)try{this.initializeAll(n+1)}catch(e){}}}},closeAll:function(e){this.isInTransaction()||r("28");for(var t=this.transactionWrappers,n=e;n<t.length;n++){var o,a=t[n],s=this.wrapperInitData[n];try{o=!0,s!==i&&a.close&&a.close.call(this,s),o=!1}finally{if(o)try{this.closeAll(n+1)}catch(e){}}}this.wrapperInitData.length=0}};e.exports=o},function(e,t,n){"use strict";function r(e){var t=""+e,n=o.exec(t);if(!n)return t;var r,i="",a=0,s=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}s!==a&&(i+=t.substring(s,a)),s=a+1,i+=r}return s!==a?i+t.substring(s,a):i}function i(e){return"boolean"==typeof e||"number"==typeof e?""+e:r(e)}var o=/["'&<>]/;e.exports=i},function(e,t,n){"use strict";var r,i=n(25),o=n(241),a=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(249),l=u(function(e,t){if(e.namespaceURI!==o.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML="<svg>"+t+"</svg>";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(i.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(l=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=l},function(e,t,n){"use strict";function r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o=-1,a=e.posMax,s=e.pos,u=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos<a;){if(91===(i=e.src.charCodeAt(e.pos)))n++;else if(93===i&&0===--n){r=!0;break}e.parser.skipToken(e)}return r?(o=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=s,e.isInLabel=u,o}},function(e,t,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(e){for(var t=this.__rules__.length,n=-1;t--;)if(this.__rules__[++n].name===e)return n;return-1},r.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},r.prototype.at=function(e,t,n){var r=this.__find__(e),i=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},r.prototype.before=function(e,t,n,r){var i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},r.prototype.after=function(e,t,n,r){var i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},r.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},r.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach(function(e){e.enabled=!1}),e.forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0},this),this.__cache__=null},r.prototype.disable=function(e){e=Array.isArray(e)?e:[e],e.forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1},this),this.__cache__=null},r.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},e.exports=r},function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return a(e,t,n)}var o=n(40),a=o.Buffer;a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=o:(r(o,t),t.Buffer=i),r(a,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o.SlowBuffer(e)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return{type:v,payload:e}}function o(e){return{type:g,payload:e}}function a(e){return{type:y,payload:e}}function s(e){return{type:_,payload:e}}function u(e){return{type:b,payload:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.authorizeRequest=t.authorizeAccessCodeWithBasicAuthentication=t.authorizeAccessCodeWithFormParams=t.authorizeApplication=t.authorizePassword=t.preAuthorizeImplicit=t.CONFIGURE_AUTH=t.VALIDATE=t.AUTHORIZE_OAUTH2=t.PRE_AUTHORIZE_OAUTH2=t.LOGOUT=t.AUTHORIZE=t.SHOW_AUTH_POPUP=void 0;var l=n(30),c=r(l),p=n(35),f=r(p);t.showDefinitions=i,t.authorize=o,t.logout=a,t.authorizeOauth2=s,t.configureAuth=u;var h=n(46),d=r(h),m=n(9),v=t.SHOW_AUTH_POPUP="show_popup",g=t.AUTHORIZE="authorize",y=t.LOGOUT="logout",_=(t.PRE_AUTHORIZE_OAUTH2="pre_authorize_oauth2",t.AUTHORIZE_OAUTH2="authorize_oauth2"),b=(t.VALIDATE="validate",t.CONFIGURE_AUTH="configure_auth");t.preAuthorizeImplicit=function(e){return function(t){var n=t.authActions,r=t.errActions,i=e.auth,o=e.token,a=e.isValid,s=i.schema,u=i.name,l=s.get("flow");if(delete d.default.swaggerUIRedirectOauth2,"accessCode"===l||a||r.newAuthErr({authId:u,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),o.error)return void r.newAuthErr({authId:u,source:"auth",level:"error",message:(0,f.default)(o)});n.authorizeOauth2({auth:i,token:o})}},t.authorizePassword=function(e){return function(t){var n=t.authActions,r=e.schema,i=e.name,o=e.username,a=e.password,s=e.passwordType,u=e.clientId,l=e.clientSecret,p={grant_type:"password",scope:e.scopes.join(" ")},f={},h={};return"basic"===s?h.Authorization="Basic "+(0,m.btoa)(o+":"+a):((0,c.default)(p,{username:o},{password:a}),"query"===s?(u&&(f.client_id=u),l&&(f.client_secret=l)):h.Authorization="Basic "+(0,m.btoa)(u+":"+l)),n.authorizeRequest({body:(0,m.buildFormData)(p),url:r.get("tokenUrl"),name:i,headers:h,query:f,auth:e})}},t.authorizeApplication=function(e){return function(t){var n=t.authActions,r=e.schema,i=e.scopes,o=e.name,a=e.clientId,s=e.clientSecret,u={Authorization:"Basic "+(0,m.btoa)(a+":"+s)},l={grant_type:"client_credentials",scope:i.join(" ")};return n.authorizeRequest({body:(0,m.buildFormData)(l),name:o,url:r.get("tokenUrl"),auth:e,headers:u})}},t.authorizeAccessCodeWithFormParams=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,i=t.schema,o=t.name,a=t.clientId,s=t.clientSecret,u={grant_type:"authorization_code",code:t.code,client_id:a,client_secret:s,redirect_uri:n};return r.authorizeRequest({body:(0,m.buildFormData)(u),name:o,url:i.get("tokenUrl"),auth:t})}},t.authorizeAccessCodeWithBasicAuthentication=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,i=t.schema,o=t.name,a=t.clientId,s=t.clientSecret,u={Authorization:"Basic "+(0,m.btoa)(a+":"+s)},l={grant_type:"authorization_code",code:t.code,client_id:a,redirect_uri:n};return r.authorizeRequest({body:(0,m.buildFormData)(l),name:o,url:i.get("tokenUrl"),auth:t,headers:u})}},t.authorizeRequest=function(e){return function(t){var n=t.fn,r=t.getConfigs,i=t.authActions,o=t.errActions,a=t.authSelectors,s=e.body,u=e.query,l=void 0===u?{}:u,p=e.headers,h=void 0===p?{}:p,d=e.name,m=e.url,v=e.auth,g=a.getConfigs()||{},y=g.additionalQueryStringParams,_=m;for(var b in y)m+="&"+b+"="+encodeURIComponent(y[b]);var x=(0,c.default)({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded"},h);n.fetch({url:_,method:"post",headers:x,query:l,body:s,requestInterceptor:r().requestInterceptor,responseInterceptor:r().responseInterceptor}).then(function(e){var t=JSON.parse(e.data),n=t&&(t.error||""),r=t&&(t.parseError||"");return e.ok?n||r?void o.newAuthErr({authId:d,level:"error",source:"auth",message:(0,f.default)(t)}):void i.authorizeOauth2({auth:v,token:t}):void o.newAuthErr({authId:d,level:"error",source:"auth",message:e.statusText})}).catch(function(e){var t=new Error(e);o.newAuthErr({authId:d,level:"error",source:"auth",message:t.message})})}}},function(e,t,n){"use strict";function r(e,t){return{type:s,payload:(0,a.default)({},e,t)}}function i(e){return{type:u,payload:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TOGGLE_CONFIGS=t.UPDATE_CONFIGS=void 0;var o=n(36),a=function(e){return e&&e.__esModule?e:{default:e}}(o);t.update=r,t.toggle=i;var s=t.UPDATE_CONFIGS="configs_update",u=t.TOGGLE_CONFIGS="configs_toggle"},function(e,t,n){"use strict";function r(e){return{type:u,payload:e}}function i(e){return{type:l,payload:e}}function o(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=(0,s.normalizeArray)(e),{type:p,payload:{thing:e,shown:t}}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=(0,s.normalizeArray)(e),{type:c,payload:{thing:e,mode:t}}}Object.defineProperty(t,"__esModule",{value:!0}),t.SHOW=t.UPDATE_MODE=t.UPDATE_FILTER=t.UPDATE_LAYOUT=void 0,t.updateLayout=r,t.updateFilter=i,t.show=o,t.changeMode=a;var s=n(9),u=t.UPDATE_LAYOUT="layout_update_layout",l=t.UPDATE_FILTER="layout_update_filter",c=t.UPDATE_MODE="layout_update_mode",p=t.SHOW="layout_show"},function(e,t,n){"use strict";function r(e,t){return{type:u,payload:{selectedServerUrl:e,namespace:t}}}function i(e){var t=e.value,n=e.pathMethod;return{type:l,payload:{value:t,pathMethod:n}}}function o(e){var t=e.value,n=e.pathMethod;return{type:c,payload:{value:t,pathMethod:n}}}function a(e){var t=e.value,n=e.path,r=e.method;return{type:p,payload:{value:t,path:n,method:r}}}function s(e){var t=e.server,n=e.namespace,r=e.key,i=e.val;return{type:f,payload:{server:t,namespace:n,key:r,val:i}}}Object.defineProperty(t,"__esModule",{value:!0}),t.setSelectedServer=r,t.setRequestBodyValue=i,t.setRequestContentType=o,t.setResponseContentType=a,t.setServerVariableValue=s;var u=t.UPDATE_SELECTED_SERVER="oas3_set_servers",l=t.UPDATE_REQUEST_BODY_VALUE="oas3_set_request_body_value",c=t.UPDATE_REQUEST_CONTENT_TYPE="oas3_set_request_content_type",p=t.UPDATE_RESPONSE_CONTENT_TYPE="oas3_set_response_content_type",f=t.UPDATE_SERVER_VARIABLE_VALUE="oas3_set_server_variable_value"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=h(e,t);if(n)return(0,s.default)(n,{declaration:!0,indent:"\t"})}Object.defineProperty(t,"__esModule",{value:!0}),t.memoizedSampleFromSchema=t.memoizedCreateXMLExample=t.sampleXmlFromSchema=t.inferSchema=t.sampleFromSchema=void 0,t.createXMLExample=i;var o=n(9),a=n(1198),s=r(a),u=n(968),l=r(u),c={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},p=function(e){e=(0,o.objectify)(e);var t=e,n=t.type,r=t.format,i=c[n+"_"+r]||c[n];return(0,o.isFunc)(i)?i(e):"Unknown Type: "+e.type},f=t.sampleFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.example,s=r.properties,u=r.additionalProperties,l=r.items,c=n.includeReadOnly,f=n.includeWriteOnly;if(void 0!==a)return a;if(!i)if(s)i="object";else{if(!l)return;i="array"}if("object"===i){var h=(0,o.objectify)(s),d={};for(var m in h)h[m].readOnly&&!c||h[m].writeOnly&&!f||(d[m]=e(h[m],n));if(!0===u)d.additionalProp1={};else if(u)for(var v=(0,o.objectify)(u),g=e(v,n),y=1;y<4;y++)d["additionalProp"+y]=g;return d}return"array"===i?[e(l,n)]:t.enum?t.default?t.default:(0,o.normalizeArray)(t.enum)[0]:"file"!==i?p(t):void 0},h=(t.inferSchema=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},t.sampleXmlFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.properties,s=r.additionalProperties,u=r.items,l=r.example,c=n.includeReadOnly,f=n.includeWriteOnly,h=r.default,d={},m={},v=t.xml,g=v.name,y=v.prefix,_=v.namespace,b=r.enum,x=void 0,w=void 0;if(!i)if(a||s)i="object";else{if(!u)return;i="array"}if(g=g||"notagname",x=(y?y+":":"")+g,_){m[y?"xmlns:"+y:"xmlns"]=_}if("array"===i&&u){if(u.xml=u.xml||v||{},u.xml.name=u.xml.name||v.name,v.wrapped)return d[x]=[],Array.isArray(l)?l.forEach(function(t){u.example=t,d[x].push(e(u,n))}):Array.isArray(h)?h.forEach(function(t){u.default=t,d[x].push(e(u,n))}):d[x]=[e(u,n)],m&&d[x].push({_attr:m}),d;var k=[];return Array.isArray(l)?(l.forEach(function(t){u.example=t,k.push(e(u,n))}),k):Array.isArray(h)?(h.forEach(function(t){u.default=t,k.push(e(u,n))}),k):e(u,n)}if("object"===i){var E=(0,o.objectify)(a);d[x]=[],l=l||{};for(var S in E)if(E.hasOwnProperty(S)&&(!E[S].readOnly||c)&&(!E[S].writeOnly||f))if(E[S].xml=E[S].xml||{},E[S].xml.attribute){var C=Array.isArray(E[S].enum)&&E[S].enum[0],A=E[S].example,D=E[S].default;m[E[S].xml.name||S]=void 0!==A&&A||void 0!==l[S]&&l[S]||void 0!==D&&D||C||p(E[S])}else{E[S].xml.name=E[S].xml.name||S,E[S].example=void 0!==E[S].example?E[S].example:l[S];var O=e(E[S]);Array.isArray(O)?d[x]=d[x].concat(O):d[x].push(O)}return!0===s?d[x].push({additionalProp:"Anything can be here"}):s&&d[x].push({additionalProp:p(s)}),m&&d[x].push({_attr:m}),d}return w=void 0!==l?l:void 0!==h?h:Array.isArray(b)?b[0]:p(t),d[x]=m?[{_attr:m},w]:w,d});t.memoizedCreateXMLExample=(0,l.default)(i),t.memoizedSampleFromSchema=(0,l.default)(f)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=X(e).replace(/\t/g," ");if("string"==typeof e)return{type:R,payload:t}}function o(e){return{type:J,payload:e}}function a(e){return{type:j,payload:e}}function s(e){return{type:F,payload:e}}function u(e,t,n,r,i){return{type:N,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:i}}}function l(e){return{type:H,payload:{pathMethod:e}}}function c(e,t){return{type:G,payload:{path:e,value:t,key:"consumes_value"}}}function p(e,t){return{type:G,payload:{path:e,value:t,key:"produces_value"}}}function f(e,t){return{type:W,payload:{path:e,method:t}}}function h(e,t){return{type:V,payload:{path:e,method:t}}}function d(e,t,n){return{type:K,payload:{scheme:e,path:t,method:n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.executeRequest=t.logRequest=t.setMutatedRequest=t.setRequest=t.setResponse=t.validateParams=t.resolveSpec=t.parseToJson=t.SET_SCHEME=t.UPDATE_RESOLVED=t.UPDATE_OPERATION_META_VALUE=t.CLEAR_VALIDATE_PARAMS=t.CLEAR_REQUEST=t.CLEAR_RESPONSE=t.LOG_REQUEST=t.SET_MUTATED_REQUEST=t.SET_REQUEST=t.SET_RESPONSE=t.VALIDATE_PARAMS=t.UPDATE_PARAM=t.UPDATE_JSON=t.UPDATE_URL=t.UPDATE_SPEC=void 0;var m=n(21),v=r(m),g=n(96),y=r(g),_=n(30),b=r(_),x=n(47),w=r(x),k=n(48),E=r(k);t.updateSpec=i,t.updateResolved=o,t.updateUrl=a,t.updateJsonSpec=s,t.changeParam=u,t.clearValidateParams=l,t.changeConsumesValue=c,t.changeProducesValue=p,t.clearResponse=f,t.clearRequest=h,t.setScheme=d;var S=n(211),C=r(S),A=n(1187),D=r(A),O=n(264),M=r(O),T=n(422),P=r(T),I=n(9),R=t.UPDATE_SPEC="spec_update_spec",j=t.UPDATE_URL="spec_update_url",F=t.UPDATE_JSON="spec_update_json",N=t.UPDATE_PARAM="spec_update_param",B=t.VALIDATE_PARAMS="spec_validate_param",L=t.SET_RESPONSE="spec_set_response",q=t.SET_REQUEST="spec_set_request",z=t.SET_MUTATED_REQUEST="spec_set_mutated_request",U=t.LOG_REQUEST="spec_log_request",W=t.CLEAR_RESPONSE="spec_clear_response",V=t.CLEAR_REQUEST="spec_clear_request",H=t.CLEAR_VALIDATE_PARAMS="spec_clear_validate_param",G=t.UPDATE_OPERATION_META_VALUE="spec_update_operation_meta_value",J=t.UPDATE_RESOLVED="spec_update_resolved",K=t.SET_SCHEME="set_scheme",X=function(e){return(0,P.default)(e)?e:""},Y=(t.parseToJson=function(e){return function(t){var n=t.specActions,r=t.specSelectors,i=t.errActions,o=r.specStr,a=null;try{e=e||o(),i.clear({source:"parser"}),a=C.default.safeLoad(e)}catch(e){return console.error(e),i.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return a&&"object"===(void 0===a?"undefined":(0,E.default)(a))?n.updateJsonSpec(a):{}}},t.resolveSpec=function(e,t){return function(n){var r=n.specActions,i=n.specSelectors,o=n.errActions,a=n.fn,s=a.fetch,u=a.resolve,l=a.AST,c=n.getConfigs,p=c(),f=p.modelPropertyMacro,h=p.parameterMacro,d=p.requestInterceptor,m=p.responseInterceptor;void 0===e&&(e=i.specJson()),void 0===t&&(t=i.url());var v=l.getLineNumberForPath,g=i.specStr();return u({fetch:s,spec:e,baseDoc:t,modelPropertyMacro:f,parameterMacro:h,requestInterceptor:d,responseInterceptor:m}).then(function(e){var t=e.spec,n=e.errors;if(o.clear({type:"thrown"}),Array.isArray(n)&&n.length>0){var i=n.map(function(e){return console.error(e),e.line=e.fullPath?v(g,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",Object.defineProperty(e,"message",{enumerable:!0,value:e.message}),e});o.newThrownErrBatch(i)}return r.updateResolved(t)})}},t.validateParams=function(e,t){return{type:B,payload:{pathMethod:e,isOAS3:t}}},t.setResponse=function(e,t,n){return{payload:{path:e,method:t,res:n},type:L}},t.setRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:q}},t.setMutatedRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:z}},t.logRequest=function(e){return{payload:e,type:U}},t.executeRequest=function(e){return function(t){var n=t.fn,r=t.specActions,i=t.specSelectors,o=t.getConfigs,a=t.oas3Selectors,s=e.pathName,u=e.method,l=e.operation,c=o(),p=c.requestInterceptor,f=c.responseInterceptor,h=l.toJS();if(e.contextUrl=(0,D.default)(i.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&s&&u&&(e.operationId=n.opId(h,s,u)),i.isOAS3()){var d=s+":"+u;e.server=a.selectedServer(d)||a.selectedServer();var m=a.serverVariables({server:e.server,namespace:d}).toJS(),v=a.serverVariables({server:e.server}).toJS();e.serverVariables=(0,w.default)(m).length?m:v,e.requestContentType=a.requestContentType(s,u),e.responseContentType=a.responseContentType(s,u)||"*/*";var g=a.requestBodyValue(s,u);(0,I.isJSONObject)(g)?e.requestBody=JSON.parse(g):e.requestBody=g}var y=(0,b.default)({},e);y=n.buildRequest(y),r.setRequest(e.pathName,e.method,y);var _=function(t){var n=p.apply(this,[t]),i=(0,b.default)({},n);return r.setMutatedRequest(e.pathName,e.method,i),n};e.requestInterceptor=_,e.responseInterceptor=f;var x=Date.now();return n.execute(e).then(function(t){t.duration=Date.now()-x,r.setResponse(e.pathName,e.method,t)}).catch(function(t){return r.setResponse(e.pathName,e.method,{error:!0,err:(0,M.default)(t)})})}},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=(0,y.default)(e,["path","method"]);return function(e){var i=e.fn.fetch,o=e.specSelectors,a=e.specActions,s=o.spec().toJS(),u=o.operationScheme(t,n),l=o.contentTypeValues([t,n]).toJS(),c=l.requestContentType,p=l.responseContentType,f=/xml/i.test(c),h=o.parameterValues([t,n],f).toJS();return a.executeRequest((0,v.default)({fetch:i,spec:s,pathName:t,method:n,parameters:h,requestContentType:c,scheme:u,responseContentType:p},r))}});t.execute=Y},function(e,t,n){"use strict";function r(e){switch(e._type){case"document":case"block_quote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"link":case"image":case"custom_inline":case"custom_block":return!0;default:return!1}}var i=function(e,t){this.current=e,this.entering=!0===t},o=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=r(e);return t&&n?e._firstChild?(this.current=e._firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e._next?(this.current=e._parent,this.entering=!1):(this.current=e._next,this.entering=!0),{entering:t,node:e}},a=function(e){return{current:e,root:e,entering:!0,next:o,resumeAt:i}},s=function(e,t){this._type=e,this._parent=null,this._firstChild=null,this._lastChild=null,this._prev=null,this._next=null,this._sourcepos=t,this._lastLineBlank=!1,this._open=!0,this._string_content=null,this._literal=null,this._listData={},this._info=null,this._destination=null,this._title=null,this._isFenced=!1,this._fenceChar=null,this._fenceLength=0,this._fenceOffset=null,this._level=null,this._onEnter=null,this._onExit=null},u=s.prototype;Object.defineProperty(u,"isContainer",{get:function(){return r(this)}}),Object.defineProperty(u,"type",{get:function(){return this._type}}),Object.defineProperty(u,"firstChild",{get:function(){return this._firstChild}}),Object.defineProperty(u,"lastChild",{get:function(){return this._lastChild}}),Object.defineProperty(u,"next",{get:function(){return this._next}}),Object.defineProperty(u,"prev",{get:function(){return this._prev}}),Object.defineProperty(u,"parent",{get:function(){return this._parent}}),Object.defineProperty(u,"sourcepos",{get:function(){return this._sourcepos}}),Object.defineProperty(u,"literal",{get:function(){return this._literal},set:function(e){this._literal=e}}),Object.defineProperty(u,"destination",{get:function(){return this._destination},set:function(e){this._destination=e}}),Object.defineProperty(u,"title",{get:function(){return this._title},set:function(e){this._title=e}}),Object.defineProperty(u,"info",{get:function(){return this._info},set:function(e){this._info=e}}),Object.defineProperty(u,"level",{get:function(){return this._level},set:function(e){this._level=e}}),Object.defineProperty(u,"listType",{get:function(){return this._listData.type},set:function(e){this._listData.type=e}}),Object.defineProperty(u,"listTight",{get:function(){return this._listData.tight},set:function(e){this._listData.tight=e}}),Object.defineProperty(u,"listStart",{get:function(){return this._listData.start},set:function(e){this._listData.start=e}}),Object.defineProperty(u,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(e){this._listData.delimiter=e}}),Object.defineProperty(u,"onEnter",{get:function(){return this._onEnter},set:function(e){this._onEnter=e}}),Object.defineProperty(u,"onExit",{get:function(){return this._onExit},set:function(e){this._onExit=e}}),s.prototype.appendChild=function(e){e.unlink(),e._parent=this,this._lastChild?(this._lastChild._next=e,e._prev=this._lastChild,this._lastChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.prependChild=function(e){e.unlink(),e._parent=this,this._firstChild?(this._firstChild._prev=e,e._next=this._firstChild,this._firstChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.unlink=function(){this._prev?this._prev._next=this._next:this._parent&&(this._parent._firstChild=this._next),this._next?this._next._prev=this._prev:this._parent&&(this._parent._lastChild=this._prev),this._parent=null,this._next=null,this._prev=null},s.prototype.insertAfter=function(e){e.unlink(),e._next=this._next,e._next&&(e._next._prev=e),e._prev=this,this._next=e,e._parent=this._parent,e._next||(e._parent._lastChild=e)},s.prototype.insertBefore=function(e){e.unlink(),e._prev=this._prev,e._prev&&(e._prev._next=e),e._next=this,this._prev=e,e._parent=this._parent,e._prev||(e._parent._firstChild=e)},s.prototype.walker=function(){return new a(this)},e.exports=s},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(53),i=n(181),o=n(76),a=n(133),s=n(602);e.exports=function(e,t){var n=1==e,u=2==e,l=3==e,c=4==e,p=6==e,f=5==e||p,h=t||s;return function(t,s,d){for(var m,v,g=o(t),y=i(g),_=r(s,d,3),b=a(y.length),x=0,w=n?h(t,b):u?h(t,0):void 0;b>x;x++)if((f||x in y)&&(m=y[x],v=_(m,x,g),e))if(n)w[x]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return x;case 2:w.push(m)}else if(c)return!1;return p?-1:l||c?c:w}}},function(e,t,n){var r=n(99),i=n(22)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(27),i=n(24).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(99);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(98);e.exports.f=function(e){return new r(e)}},function(e,t,n){var r=n(37),i=n(611),o=n(180),a=n(187)("IE_PROTO"),s=function(){},u=function(){var e,t=n(179)("iframe"),r=o.length;for(t.style.display="none",n(334).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(56);e.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},function(e,t,n){e.exports=n(56)},function(e,t,n){var r=n(188)("keys"),i=n(134);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(24),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(27);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(24),i=n(15),o=n(130),a=n(192),s=n(41).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){t.f=n(22)},function(e,t,n){var r=n(177),i=n(22)("iterator"),o=n(74);e.exports=n(15).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t){},function(e,t,n){var r=n(105),i=n(19)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,n){var r=n(77),i=n(31).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(19)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(135);e.exports.f=function(e){return new r(e)}},function(e,t,n){var r=n(138).f,i=n(108),o=n(19)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(361)("keys"),i=n(202);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(354),i=n(57);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){"use strict";(function(t){/*! +var r=n(569),o=n(570),i=n(355);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):f(e,t);if("Buffer"===t.type&&i(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t){if(l(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(n+u>s&&(n=s-u),i=n;i>=0;i--){for(var p=!0,f=0;f<u;f++)if(c(e,i+f)!==c(t,f)){p=!1;break}if(p)return i}return-1}function b(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function _(e,t,n,r){return V(B(t,e.length-n),e,n,r)}function w(e,t,n,r){return V(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return w(e,t,n,r)}function E(e,t,n,r){return V(z(t),e,n,r)}function S(e,t,n,r){return V(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,u,c=e[o],l=null,p=c>239?4:c>223?3:c>191?2:1;if(o+p<=n)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,p=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=p}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=O));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return p(null,e)},u.allocUnsafeSlow=function(e){return p(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):m.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n),p=0;p<s;++p)if(c[p]!==l[p]){i=c[p],a=l[p];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function A(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function T(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function j(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=F(e[i]);return o}function P(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function I(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function N(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function D(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,i){return i||D(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,i){return i||D(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;n=new u(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=u.isBuffer(e)?e:B(new u(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var q=/[^+\/0-9A-Za-z-_]/g;function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(36))},function(e,t,n){"use strict";e.exports={current:null}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,p=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):p=-1,c.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++p<t;)u&&u[p].run();p=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||l||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(25),o=n(90),i=n(57),a=(n(23),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),s={type:null,target:null,currentTarget:i.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};function u(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var o=this.constructor.Interface;for(var a in o)if(o.hasOwnProperty(a)){0;var s=o[a];s?this[a]=s(n):"target"===a?this.target=r:this[a]=n[a]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?i.thatReturnsTrue:i.thatReturnsFalse,this.isPropagationStopped=i.thatReturnsFalse,this}r(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=i.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=i.thatReturnsTrue)},persist:function(){this.isPersistent=i.thatReturnsTrue},isPersistent:i.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n<a.length;n++)this[a[n]]=null}}),u.Interface=s,u.augmentClass=function(e,t){var n=function(){};n.prototype=this.prototype;var i=new n;r(i,e.prototype),e.prototype=i,e.prototype.constructor=e,e.Interface=r({},this.Interface,t),e.augmentClass=this.augmentClass,o.addPoolingTo(e,o.fourArgumentPooler)},o.addPoolingTo(u,o.fourArgumentPooler),e.exports=u},function(e,t,n){var r=n(365);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"lastError",function(){return d}),n.d(t,"url",function(){return m}),n.d(t,"specStr",function(){return v}),n.d(t,"specSource",function(){return g}),n.d(t,"specJson",function(){return y}),n.d(t,"specResolved",function(){return b}),n.d(t,"specResolvedSubtree",function(){return _}),n.d(t,"specJsonWithResolvedSubtrees",function(){return x}),n.d(t,"spec",function(){return E}),n.d(t,"isOAS3",function(){return S}),n.d(t,"info",function(){return C}),n.d(t,"externalDocs",function(){return k}),n.d(t,"version",function(){return O}),n.d(t,"semver",function(){return A}),n.d(t,"paths",function(){return T}),n.d(t,"operations",function(){return j}),n.d(t,"consumes",function(){return P}),n.d(t,"produces",function(){return I}),n.d(t,"security",function(){return M}),n.d(t,"securityDefinitions",function(){return N}),n.d(t,"findDefinition",function(){return R}),n.d(t,"definitions",function(){return D}),n.d(t,"basePath",function(){return L}),n.d(t,"host",function(){return U}),n.d(t,"schemes",function(){return q}),n.d(t,"operationsWithRootInherited",function(){return F}),n.d(t,"tags",function(){return B}),n.d(t,"tagDetails",function(){return z}),n.d(t,"operationsWithTags",function(){return V}),n.d(t,"taggedOperations",function(){return H}),n.d(t,"responses",function(){return W}),n.d(t,"requests",function(){return J}),n.d(t,"mutatedRequests",function(){return K}),n.d(t,"responseFor",function(){return Y}),n.d(t,"requestFor",function(){return $}),n.d(t,"mutatedRequestFor",function(){return G}),n.d(t,"allowTryItOutFor",function(){return Z}),n.d(t,"parameterWithMetaByIdentity",function(){return X}),n.d(t,"parameterInclusionSettingFor",function(){return Q}),n.d(t,"parameterWithMeta",function(){return ee}),n.d(t,"operationWithMeta",function(){return te}),n.d(t,"getParameter",function(){return ne}),n.d(t,"hasHost",function(){return re}),n.d(t,"parameterValues",function(){return oe}),n.d(t,"parametersIncludeIn",function(){return ie}),n.d(t,"parametersIncludeType",function(){return ae}),n.d(t,"contentTypeValues",function(){return se}),n.d(t,"currentProducesFor",function(){return ue}),n.d(t,"producesOptionsFor",function(){return ce}),n.d(t,"consumesOptionsFor",function(){return le}),n.d(t,"operationScheme",function(){return pe}),n.d(t,"canExecuteScheme",function(){return fe}),n.d(t,"validateBeforeExecute",function(){return he});var r=n(14),o=n.n(r),i=n(13),a=n.n(i),s=n(12),u=n.n(s),c=n(11),l=n(3),p=n(1),f=["get","put","post","delete","options","head","patch","trace"],h=function(e){return e||Object(p.Map)()},d=Object(c.createSelector)(h,function(e){return e.get("lastError")}),m=Object(c.createSelector)(h,function(e){return e.get("url")}),v=Object(c.createSelector)(h,function(e){return e.get("spec")||""}),g=Object(c.createSelector)(h,function(e){return e.get("specSource")||"not-editor"}),y=Object(c.createSelector)(h,function(e){return e.get("json",Object(p.Map)())}),b=Object(c.createSelector)(h,function(e){return e.get("resolved",Object(p.Map)())}),_=function(e,t){return e.getIn(["resolvedSubtrees"].concat(u()(t)),void 0)},w=function e(t,n){return p.Map.isMap(t)&&p.Map.isMap(n)?n.get("$$ref")?n:Object(p.OrderedMap)().mergeWith(e,t,n):n},x=Object(c.createSelector)(h,function(e){return Object(p.OrderedMap)().mergeWith(w,e.get("json"),e.get("resolvedSubtrees"))}),E=function(e){return y(e)},S=Object(c.createSelector)(E,function(){return!1}),C=Object(c.createSelector)(E,function(e){return de(e&&e.get("info"))}),k=Object(c.createSelector)(E,function(e){return de(e&&e.get("externalDocs"))}),O=Object(c.createSelector)(C,function(e){return e&&e.get("version")}),A=Object(c.createSelector)(O,function(e){return/v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(e).slice(1)}),T=Object(c.createSelector)(x,function(e){return e.get("paths")}),j=Object(c.createSelector)(T,function(e){if(!e||e.size<1)return Object(p.List)();var t=Object(p.List)();return e&&e.forEach?(e.forEach(function(e,n){if(!e||!e.forEach)return{};e.forEach(function(e,r){f.indexOf(r)<0||(t=t.push(Object(p.fromJS)({path:n,method:r,operation:e,id:"".concat(r,"-").concat(n)})))})}),t):Object(p.List)()}),P=Object(c.createSelector)(E,function(e){return Object(p.Set)(e.get("consumes"))}),I=Object(c.createSelector)(E,function(e){return Object(p.Set)(e.get("produces"))}),M=Object(c.createSelector)(E,function(e){return e.get("security",Object(p.List)())}),N=Object(c.createSelector)(E,function(e){return e.get("securityDefinitions")}),R=function(e,t){var n=e.getIn(["resolvedSubtrees","definitions",t],null),r=e.getIn(["json","definitions",t],null);return n||r||null},D=Object(c.createSelector)(E,function(e){var t=e.get("definitions");return p.Map.isMap(t)?t:Object(p.Map)()}),L=Object(c.createSelector)(E,function(e){return e.get("basePath")}),U=Object(c.createSelector)(E,function(e){return e.get("host")}),q=Object(c.createSelector)(E,function(e){return e.get("schemes",Object(p.Map)())}),F=Object(c.createSelector)(j,P,I,function(e,t,n){return e.map(function(e){return e.update("operation",function(e){if(e){if(!p.Map.isMap(e))return;return e.withMutations(function(e){return e.get("consumes")||e.update("consumes",function(e){return Object(p.Set)(e).merge(t)}),e.get("produces")||e.update("produces",function(e){return Object(p.Set)(e).merge(n)}),e})}return Object(p.Map)()})})}),B=Object(c.createSelector)(E,function(e){var t=e.get("tags",Object(p.List)());return p.List.isList(t)?t.filter(function(e){return p.Map.isMap(e)}):Object(p.List)()}),z=function(e,t){return(B(e)||Object(p.List)()).filter(p.Map.isMap).find(function(e){return e.get("name")===t},Object(p.Map)())},V=Object(c.createSelector)(F,B,function(e,t){return e.reduce(function(e,t){var n=Object(p.Set)(t.getIn(["operation","tags"]));return n.count()<1?e.update("default",Object(p.List)(),function(e){return e.push(t)}):n.reduce(function(e,n){return e.update(n,Object(p.List)(),function(e){return e.push(t)})},e)},t.reduce(function(e,t){return e.set(t.get("name"),Object(p.List)())},Object(p.OrderedMap)()))}),H=function(e){return function(t){var n=(0,t.getConfigs)(),r=n.tagsSorter,o=n.operationsSorter;return V(e).sortBy(function(e,t){return t},function(e,t){var n="function"==typeof r?r:l.H.tagsSorter[r];return n?n(e,t):null}).map(function(t,n){var r="function"==typeof o?o:l.H.operationsSorter[o],i=r?t.sort(r):t;return Object(p.Map)({tagDetails:z(e,n),operations:i})})}},W=Object(c.createSelector)(h,function(e){return e.get("responses",Object(p.Map)())}),J=Object(c.createSelector)(h,function(e){return e.get("requests",Object(p.Map)())}),K=Object(c.createSelector)(h,function(e){return e.get("mutatedRequests",Object(p.Map)())}),Y=function(e,t,n){return W(e).getIn([t,n],null)},$=function(e,t,n){return J(e).getIn([t,n],null)},G=function(e,t,n){return K(e).getIn([t,n],null)},Z=function(){return!0},X=function(e,t,n){var r=x(e).getIn(["paths"].concat(u()(t),["parameters"]),Object(p.OrderedMap)()),o=e.getIn(["meta","paths"].concat(u()(t),["parameters"]),Object(p.OrderedMap)());return r.map(function(e){var t=o.get("".concat(n.get("in"),".").concat(n.get("name"))),r=o.get("".concat(n.get("in"),".").concat(n.get("name"),".hash-").concat(n.hashCode()));return Object(p.OrderedMap)().merge(e,t,r)}).find(function(e){return e.get("in")===n.get("in")&&e.get("name")===n.get("name")},Object(p.OrderedMap)())},Q=function(e,t,n,r){var o="".concat(r,".").concat(n);return e.getIn(["meta","paths"].concat(u()(t),["parameter_inclusions",o]),!1)},ee=function(e,t,n,r){var o=x(e).getIn(["paths"].concat(u()(t),["parameters"]),Object(p.OrderedMap)()).find(function(e){return e.get("in")===r&&e.get("name")===n},Object(p.OrderedMap)());return X(e,t,o)},te=function(e,t,n){var r=x(e).getIn(["paths",t,n],Object(p.OrderedMap)()),o=e.getIn(["meta","paths",t,n],Object(p.OrderedMap)()),i=r.get("parameters",Object(p.List)()).map(function(r){return X(e,[t,n],r)});return Object(p.OrderedMap)().merge(r,o).set("parameters",i)};function ne(e,t,n,r){return t=t||[],e.getIn(["meta","paths"].concat(u()(t),["parameters"]),Object(p.fromJS)([])).find(function(e){return p.Map.isMap(e)&&e.get("name")===n&&e.get("in")===r})||Object(p.Map)()}var re=Object(c.createSelector)(E,function(e){var t=e.get("host");return"string"==typeof t&&t.length>0&&"/"!==t[0]});function oe(e,t,n){return t=t||[],te.apply(void 0,[e].concat(u()(t))).get("parameters",Object(p.List)()).reduce(function(e,t){var r=n&&"body"===t.get("in")?t.get("value_xml"):t.get("value");return e.set(Object(l.B)(t,{allowHashes:!1}),r)},Object(p.fromJS)({}))}function ie(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(p.List.isList(e))return e.some(function(e){return p.Map.isMap(e)&&e.get("in")===t})}function ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(p.List.isList(e))return e.some(function(e){return p.Map.isMap(e)&&e.get("type")===t})}function se(e,t){t=t||[];var n=x(e).getIn(["paths"].concat(u()(t)),Object(p.fromJS)({})),r=e.getIn(["meta","paths"].concat(u()(t)),Object(p.fromJS)({})),o=ue(e,t),i=n.get("parameters")||new p.List,a=r.get("consumes_value")?r.get("consumes_value"):ae(i,"file")?"multipart/form-data":ae(i,"formData")?"application/x-www-form-urlencoded":void 0;return Object(p.fromJS)({requestContentType:a,responseContentType:o})}function ue(e,t){t=t||[];var n=x(e).getIn(["paths"].concat(u()(t)),null);if(null!==n){var r=e.getIn(["meta","paths"].concat(u()(t),["produces_value"]),null),o=n.getIn(["produces",0],null);return r||o||"application/json"}}function ce(e,t){t=t||[];var n=x(e),r=n.getIn(["paths"].concat(u()(t)),null);if(null!==r){var o=t,i=a()(o,1)[0],s=r.get("produces",null),c=n.getIn(["paths",i,"produces"],null),l=n.getIn(["produces"],null);return s||c||l}}function le(e,t){t=t||[];var n=x(e),r=n.getIn(["paths"].concat(u()(t)),null);if(null!==r){var o=t,i=a()(o,1)[0],s=r.get("consumes",null),c=n.getIn(["paths",i,"consumes"],null),l=n.getIn(["consumes"],null);return s||c||l}}var pe=function(e,t,n){var r=e.get("url").match(/^([a-z][a-z0-9+\-.]*):/),i=o()(r)?r[1]:null;return e.getIn(["scheme",t,n])||e.getIn(["scheme","_defaultScheme"])||i||""},fe=function(e,t,n){return["http","https"].indexOf(pe(e,t,n))>-1},he=function(e,t){t=t||[];var n=e.getIn(["meta","paths"].concat(u()(t),["parameters"]),Object(p.fromJS)([])),r=!0;return n.forEach(function(e){var t=e.get("errors");t&&t.count()&&(r=!1)}),r};function de(e){return p.Map.isMap(e)?e:new p.Map}},function(e,t,n){"use strict";n.r(t),n.d(t,"SHOW_AUTH_POPUP",function(){return d}),n.d(t,"AUTHORIZE",function(){return m}),n.d(t,"LOGOUT",function(){return v}),n.d(t,"PRE_AUTHORIZE_OAUTH2",function(){return g}),n.d(t,"AUTHORIZE_OAUTH2",function(){return y}),n.d(t,"VALIDATE",function(){return b}),n.d(t,"CONFIGURE_AUTH",function(){return _}),n.d(t,"showDefinitions",function(){return w}),n.d(t,"authorize",function(){return x}),n.d(t,"logout",function(){return E}),n.d(t,"preAuthorizeImplicit",function(){return S}),n.d(t,"authorizeOauth2",function(){return C}),n.d(t,"authorizePassword",function(){return k}),n.d(t,"authorizeApplication",function(){return O}),n.d(t,"authorizeAccessCodeWithFormParams",function(){return A}),n.d(t,"authorizeAccessCodeWithBasicAuthentication",function(){return T}),n.d(t,"authorizeRequest",function(){return j}),n.d(t,"configureAuth",function(){return P});var r=n(26),o=n.n(r),i=n(16),a=n.n(i),s=n(28),u=n.n(s),c=n(95),l=n.n(c),p=n(18),f=n.n(p),h=n(3),d="show_popup",m="authorize",v="logout",g="pre_authorize_oauth2",y="authorize_oauth2",b="validate",_="configure_auth";function w(e){return{type:d,payload:e}}function x(e){return{type:m,payload:e}}function E(e){return{type:v,payload:e}}var S=function(e){return function(t){var n=t.authActions,r=t.errActions,o=e.auth,i=e.token,a=e.isValid,s=o.schema,c=o.name,l=s.get("flow");delete f.a.swaggerUIRedirectOauth2,"accessCode"===l||a||r.newAuthErr({authId:c,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),i.error?r.newAuthErr({authId:c,source:"auth",level:"error",message:u()(i)}):n.authorizeOauth2({auth:o,token:i})}};function C(e){return{type:y,payload:e}}var k=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.name,i=e.username,s=e.password,u=e.passwordType,c=e.clientId,l=e.clientSecret,p={grant_type:"password",scope:e.scopes.join(" "),username:i,password:s},f={};switch(u){case"request-body":!function(e,t,n){t&&a()(e,{client_id:t});n&&a()(e,{client_secret:n})}(p,c,l);break;case"basic":f.Authorization="Basic "+Object(h.a)(c+":"+l);break;default:console.warn("Warning: invalid passwordType ".concat(u," was passed, not including client id and secret"))}return n.authorizeRequest({body:Object(h.b)(p),url:r.get("tokenUrl"),name:o,headers:f,query:{},auth:e})}};var O=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.scopes,i=e.name,a=e.clientId,s=e.clientSecret,u={Authorization:"Basic "+Object(h.a)(a+":"+s)},c={grant_type:"client_credentials",scope:o.join(" ")};return n.authorizeRequest({body:Object(h.b)(c),name:i,url:r.get("tokenUrl"),auth:e,headers:u})}},A=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,s=t.clientSecret,u=t.codeVerifier,c={grant_type:"authorization_code",code:t.code,client_id:a,client_secret:s,redirect_uri:n,code_verifier:u};return r.authorizeRequest({body:Object(h.b)(c),name:i,url:o.get("tokenUrl"),auth:t})}},T=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,s=t.clientSecret,u={Authorization:"Basic "+Object(h.a)(a+":"+s)},c={grant_type:"authorization_code",code:t.code,client_id:a,redirect_uri:n};return r.authorizeRequest({body:Object(h.b)(c),name:i,url:o.get("tokenUrl"),auth:t,headers:u})}},j=function(e){return function(t){var n,r=t.fn,i=t.getConfigs,s=t.authActions,c=t.errActions,p=t.oas3Selectors,f=t.specSelectors,h=t.authSelectors,d=e.body,m=e.query,v=void 0===m?{}:m,g=e.headers,y=void 0===g?{}:g,b=e.name,_=e.url,w=e.auth,x=(h.getConfigs()||{}).additionalQueryStringParams;n=f.isOAS3()?l()(_,p.selectedServer(),!0):l()(_,f.url(),!0),"object"===o()(x)&&(n.query=a()({},n.query,x));var E=n.toString(),S=a()({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},y);r.fetch({url:E,method:"post",headers:S,query:v,body:d,requestInterceptor:i().requestInterceptor,responseInterceptor:i().responseInterceptor}).then(function(e){var t=JSON.parse(e.data),n=t&&(t.error||""),r=t&&(t.parseError||"");e.ok?n||r?c.newAuthErr({authId:b,level:"error",source:"auth",message:u()(t)}):s.authorizeOauth2({auth:w,token:t}):c.newAuthErr({authId:b,level:"error",source:"auth",message:e.statusText})}).catch(function(e){var t=new Error(e).message;if(e.response&&e.response.data){var n=e.response.data;try{var r="string"==typeof n?JSON.parse(n):n;r.error&&(t+=", error: ".concat(r.error)),r.error_description&&(t+=", description: ".concat(r.error_description))}catch(e){}}c.newAuthErr({authId:b,level:"error",source:"auth",message:t})})}};function P(e){return{type:_,payload:e}}},function(e,t){var n=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(127),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(211),o=n(210);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(49),o=n(133);e.exports=n(50)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_LAYOUT",function(){return o}),n.d(t,"UPDATE_FILTER",function(){return i}),n.d(t,"UPDATE_MODE",function(){return a}),n.d(t,"SHOW",function(){return s}),n.d(t,"updateLayout",function(){return u}),n.d(t,"updateFilter",function(){return c}),n.d(t,"show",function(){return l}),n.d(t,"changeMode",function(){return p});var r=n(3),o="layout_update_layout",i="layout_update_filter",a="layout_update_mode",s="layout_show";function u(e){return{type:o,payload:e}}function c(e){return{type:i,payload:e}}function l(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=Object(r.w)(e),{type:s,payload:{thing:e,shown:t}}}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=Object(r.w)(e),{type:a,payload:{thing:e,mode:t}}}},function(e,t,n){"use strict";(function(t){ +/*! * @description Recursive object extending * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com> * @license MIT * * The MIT License (MIT) * - * Copyright (c) 2013-2015 Viacheslav Lotsmanov + * Copyright (c) 2013-2018 Viacheslav Lotsmanov * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in @@ -35,7 +48,8 @@ var Y=n(570),$=n(764),Z=n(387);t.Buffer=o,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50, * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function i(e){var t=[];return e.forEach(function(e,a){"object"==typeof e&&null!==e?Array.isArray(e)?t[a]=i(e):n(e)?t[a]=r(e):t[a]=o({},e):t[a]=e}),t}var o=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,a=arguments[0],s=Array.prototype.slice.call(arguments,1);return s.forEach(function(s){"object"!=typeof s||Array.isArray(s)||Object.keys(s).forEach(function(u){return t=a[u],e=s[u],e===a?void 0:"object"!=typeof e||null===e?void(a[u]=e):Array.isArray(e)?void(a[u]=i(e)):n(e)?void(a[u]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(a[u]=o({},e)):void(a[u]=o(t,e))})}),a}}).call(t,n(40).Buffer)},function(e,t){e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},function(e,t){e.exports={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}},function(e,t,n){"use strict";var r=n(722),i=n(65),o=n(115),a=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,u=Math.abs,l=Math.floor;e.exports=function(e){var t,n,c,p;if(!r(e))return a.apply(this,arguments);for(n=i(o(this).length),c=arguments[1],c=isNaN(c)?0:c>=0?l(c):i(this.length)-l(u(c)),t=c;t<n;++t)if(s.call(this,t)&&(p=this[t],r(p)))return t;return-1}},function(e,t,n){"use strict";e.exports=n(713)()?Array.from:n(714)},function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!==e&&t!==t}function i(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var a=0;a<n.length;a++)if(!o.call(t,n[a])||!r(e[n[a]],t[n[a]]))return!1;return!0}var o=Object.prototype.hasOwnProperty;e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(765),o=r(i),a=n(768),s=r(a),u=n(767),l=r(u),c=n(769),p=r(c),f=n(770),h=r(f),d=n(771),m=r(d),v=n(772),g=r(v),y=n(773),_=r(y),b=n(774),x=r(b),w=n(775),k=r(w),E=n(776),S=r(E),C=n(778),A=r(C),D=n(766),O=r(D),M=[l.default,s.default,p.default,m.default,g.default,_.default,x.default,k.default,S.default,h.default],T=(0,o.default)({prefixMap:O.default.prefixMap,plugins:M},A.default);t.default=T,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e.charAt(0).toUpperCase()+e.slice(1)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";var r=n(795);e.exports=r},function(e,t,n){"use strict";var r=n(81);e.exports=new r({explicit:[n(813),n(811),n(806)]})},function(e,t,n){var r=n(67),i=n(43),o=r(i,"Map");e.exports=o},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(916),o=n(917),a=n(918),s=n(919),u=n(920);r.prototype.clear=i,r.prototype.delete=o,r.prototype.get=a,r.prototype.has=s,r.prototype.set=u,e.exports=r},function(e,t,n){function r(e){var t=this.__data__=new i(e);this.size=t.size}var i=n(146),o=n(930),a=n(931),s=n(932),u=n(933),l=n(934);r.prototype.clear=o,r.prototype.delete=a,r.prototype.get=s,r.prototype.has=u,r.prototype.set=l,e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}e.exports=n},function(e,t,n){var r=n(849),i=n(887),o=i(r);e.exports=o},function(e,t,n){function r(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}var i=n(392);e.exports=r},function(e,t,n){var r=n(222),i=r(Object.getPrototypeOf,Object);e.exports=i},function(e,t,n){var r=n(222),i=n(426),o=Object.getOwnPropertySymbols,a=o?r(o,Object):i;e.exports=a},function(e,t,n){function r(e,t){if(i(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||(s.test(e)||!a.test(e)||null!=t&&e in Object(t))}var i=n(20),o=n(155),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=r},function(e,t){function n(e,t){return function(n){return e(t(n))}}e.exports=n},function(e,t,n){var r=n(890),i=n(945),o=r(i);e.exports=o},function(e,t,n){function r(e,t,n){var r=null==e?void 0:i(e,t);return void 0===r?n:r}var i=n(150);e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){var r=n(851),i=n(68),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},function(e,t,n){(function(e){var r=n(43),i=n(957),o="object"==typeof t&&t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o,u=s?r.Buffer:void 0,l=u?u.isBuffer:void 0,c=l||i;e.exports=c}).call(t,n(72)(e))},function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}var r=9007199254740991;e.exports=n},function(e,t,n){"use strict";(function(t,n){var r,i;r=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},i=function(e){var t,n,i=document.createTextNode(""),o=0;return new e(function(){var e;if(t)n&&(t=n.concat(t));else{if(!n)return;t=n}if(n=t,t=null,"function"==typeof n)return e=n,n=null,void e();for(i.data=o=++o%2;n;)e=n.shift(),n.length||(n=null),e()}).observe(i,{characterData:!0}),function(e){if(r(e),t)return void("function"==typeof t?t=[t,e]:t.push(e));t=e,i.data=o=++o%2}},e.exports=function(){if("object"==typeof t&&t&&"function"==typeof t.nextTick)return t.nextTick;if("object"==typeof document&&document){if("function"==typeof MutationObserver)return i(MutationObserver);if("function"==typeof WebKitMutationObserver)return i(WebKitMutationObserver)}return"function"==typeof n?function(e){n(r(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(r(e),0)}:null}()}).call(t,n(33),n(496).setImmediate)},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===a(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u<a;u++)if(i[u]!==o[u]){s=u;break}for(var l=[],u=s;u<i.length;u++)l.push("..");return l=l.concat(o.slice(s)),l.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=o(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(t,n(33))},function(e,t,n){(function(t){(function(){var n,r,i;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:void 0!==t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-i)/1e6},r=t.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},i=n()):Date.now?(e.exports=function(){return Date.now()-i},i=Date.now()):(e.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(t,n(33))},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=n(235),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=function(e){function t(n){r(this,t);var o=i(this,e.call(this,n));return o.type="comment",o}return o(t,e),t}(s.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){return e.map(function(e){return e.nodes&&(e.nodes=s(e.nodes)),delete e.source,e})}t.__esModule=!0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(234),c=r(l),p=n(232),f=r(p),h=n(235),d=r(h),m=function(e){function t(){return i(this,t),o(this,e.apply(this,arguments))}return a(t,e),t.prototype.push=function(e){return e.parent=this,this.nodes.push(e),this},t.prototype.each=function(e){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var t=this.lastEach;if(this.indexes[t]=0,this.nodes){for(var n=void 0,r=void 0;this.indexes[t]<this.nodes.length&&(n=this.indexes[t],!1!==(r=e(this.nodes[n],n)));)this.indexes[t]+=1;return delete this.indexes[t],r}},t.prototype.walk=function(e){return this.each(function(t,n){var r=e(t,n);return!1!==r&&t.walk&&(r=t.walk(e)),r})},t.prototype.walkDecls=function(e,t){return t?e instanceof RegExp?this.walk(function(n,r){if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk(function(n,r){if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("decl"===e.type)return t(e,n)}))},t.prototype.walkRules=function(e,t){return t?e instanceof RegExp?this.walk(function(n,r){if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk(function(n,r){if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("rule"===e.type)return t(e,n)}))},t.prototype.walkAtRules=function(e,t){return t?e instanceof RegExp?this.walk(function(n,r){if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk(function(n,r){if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("atrule"===e.type)return t(e,n)}))},t.prototype.walkComments=function(e){return this.walk(function(t,n){if("comment"===t.type)return e(t,n)})},t.prototype.append=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t,i=Array.isArray(r),o=0,r=i?r:r[Symbol.iterator]();;){var a;if(i){if(o>=r.length)break;a=r[o++]}else{if(o=r.next(),o.done)break;a=o.value}for(var s=a,u=this.normalize(s,this.last),l=u,c=Array.isArray(l),p=0,l=c?l:l[Symbol.iterator]();;){var f;if(c){if(p>=l.length)break;f=l[p++]}else{if(p=l.next(),p.done)break;f=p.value}var h=f;this.nodes.push(h)}}return this},t.prototype.prepend=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t=t.reverse();for(var r=t,i=Array.isArray(r),o=0,r=i?r:r[Symbol.iterator]();;){var a;if(i){if(o>=r.length)break;a=r[o++]}else{if(o=r.next(),o.done)break;a=o.value}for(var s=a,u=this.normalize(s,this.first,"prepend").reverse(),l=u,c=Array.isArray(l),p=0,l=c?l:l[Symbol.iterator]();;){var f;if(c){if(p>=l.length)break;f=l[p++]}else{if(p=l.next(),p.done)break;f=p.value}var h=f;this.nodes.unshift(h)}for(var d in this.indexes)this.indexes[d]=this.indexes[d]+u.length}return this},t.prototype.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n=this.nodes,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if(i=n.next(),i.done)break;o=i.value}var a=o;a.cleanRaws(t)}},t.prototype.insertBefore=function(e,t){e=this.index(e);for(var n=0===e&&"prepend",r=this.normalize(t,this.nodes[e],n).reverse(),i=r,o=Array.isArray(i),a=0,i=o?i:i[Symbol.iterator]();;){var s;if(o){if(a>=i.length)break;s=i[a++]}else{if(a=i.next(),a.done)break;s=a.value}var u=s;this.nodes.splice(e,0,u)}var l=void 0;for(var c in this.indexes)l=this.indexes[c],e<=l&&(this.indexes[c]=l+r.length);return this},t.prototype.insertAfter=function(e,t){e=this.index(e);for(var n=this.normalize(t,this.nodes[e]).reverse(),r=n,i=Array.isArray(r),o=0,r=i?r:r[Symbol.iterator]();;){var a;if(i){if(o>=r.length)break;a=r[o++]}else{if(o=r.next(),o.done)break;a=o.value}var s=a;this.nodes.splice(e+1,0,s)}var u=void 0;for(var l in this.indexes)u=this.indexes[l],e<u&&(this.indexes[l]=u+n.length);return this},t.prototype.removeChild=function(e){e=this.index(e),this.nodes[e].parent=void 0,this.nodes.splice(e,1);var t=void 0;for(var n in this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this},t.prototype.removeAll=function(){for(var e=this.nodes,t=Array.isArray(e),n=0,e=t?e:e[Symbol.iterator]();;){var r;if(t){if(n>=e.length)break;r=e[n++]}else{if(n=e.next(),n.done)break;r=n.value}r.parent=void 0}return this.nodes=[],this},t.prototype.replaceValues=function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(r){t.props&&-1===t.props.indexOf(r.prop)||t.fast&&-1===r.value.indexOf(t.fast)||(r.value=r.value.replace(e,n))}),this},t.prototype.every=function(e){return this.nodes.every(e)},t.prototype.some=function(e){return this.nodes.some(e)},t.prototype.index=function(e){return"number"==typeof e?e:this.nodes.indexOf(e)},t.prototype.normalize=function(e,t){var r=this;if("string"==typeof e){e=s(n(236)(e).nodes)}else if(Array.isArray(e)){e=e.slice(0);for(var i=e,o=Array.isArray(i),a=0,i=o?i:i[Symbol.iterator]();;){var u;if(o){if(a>=i.length)break;u=i[a++]}else{if(a=i.next(),a.done)break;u=a.value}var l=u;l.parent&&l.parent.removeChild(l,"ignore")}}else if("root"===e.type){e=e.nodes.slice(0);for(var p=e,h=Array.isArray(p),d=0,p=h?p:p[Symbol.iterator]();;){var m;if(h){if(d>=p.length)break;m=p[d++]}else{if(d=p.next(),d.done)break;m=d.value}var v=m;v.parent&&v.parent.removeChild(v,"ignore")}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new c.default(e)]}else if(e.selector){var g=n(157);e=[new g(e)]}else if(e.name){var y=n(156);e=[new y(e)]}else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new f.default(e)]}return e.map(function(e){return"function"!=typeof e.before&&(e=r.rebuild(e)),e.parent&&e.parent.removeChild(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/[^\s]/g,"")),e.parent=r,e})},t.prototype.rebuild=function(e,t){var r=this,i=void 0;if("root"===e.type){var o=n(237);i=new o}else if("atrule"===e.type){var a=n(156);i=new a}else if("rule"===e.type){var s=n(157);i=new s}else"decl"===e.type?i=new c.default:"comment"===e.type&&(i=new f.default);for(var u in e)"nodes"===u?i.nodes=e.nodes.map(function(e){return r.rebuild(e,i)}):"parent"===u&&t?i.parent=t:e.hasOwnProperty(u)&&(i[u]=e[u]);return i},u(t,[{key:"first",get:function(){if(this.nodes)return this.nodes[0]}},{key:"last",get:function(){if(this.nodes)return this.nodes[this.nodes.length-1]}}]),t}(d.default);t.default=m,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=n(235),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=function(e){function t(n){r(this,t);var o=i(this,e.call(this,n));return o.type="decl",o}return o(t,e),t}(s.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=n(432),s=r(a),u=n(437),l=r(u),c=n(238),p=r(c),f=n(987),h=r(f),d=function e(t,n){var r=new t.constructor;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i],s=void 0===a?"undefined":o(a);"parent"===i&&"object"===s?n&&(r[i]=n):"source"===i?r[i]=a:a instanceof Array?r[i]=a.map(function(t){return e(t,r)}):("object"===s&&null!==a&&(a=e(a)),r[i]=a)}return r},m=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(i(this,e),this.raws={},"object"!==(void 0===t?"undefined":o(t))&&void 0!==t)throw new Error("PostCSS nodes constructor accepts object, not "+JSON.stringify(t));for(var n in t)this[n]=t[n]}return e.prototype.error=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.source){var n=this.positionBy(t);return this.source.input.error(e,n.line,n.column,t)}return new s.default(e)},e.prototype.warn=function(e,t,n){var r={node:this};for(var i in n)r[i]=n[i];return e.warn(t,r)},e.prototype.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},e.prototype.toString=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p.default;e.stringify&&(e=e.stringify);var t="";return e(this,function(e){t+=e}),t},e.prototype.clone=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=d(this);for(var n in e)t[n]=e[n];return t},e.prototype.cloneBefore=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.clone(e);return this.parent.insertBefore(this,t),t},e.prototype.cloneAfter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.clone(e);return this.parent.insertAfter(this,t),t},e.prototype.replaceWith=function(){if(this.parent){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t,i=Array.isArray(r),o=0,r=i?r:r[Symbol.iterator]();;){var a;if(i){if(o>=r.length)break;a=r[o++]}else{if(o=r.next(),o.done)break;a=o.value}var s=a;this.parent.insertBefore(this,s)}this.remove()}return this},e.prototype.moveTo=function(e){return(0,h.default)("Node#moveTo was deprecated. Use Container#append."),this.cleanRaws(this.root()===e.root()),this.remove(),e.append(this),this},e.prototype.moveBefore=function(e){return(0,h.default)("Node#moveBefore was deprecated. Use Node#before."),this.cleanRaws(this.root()===e.root()),this.remove(),e.parent.insertBefore(e,this),this},e.prototype.moveAfter=function(e){return(0,h.default)("Node#moveAfter was deprecated. Use Node#after."),this.cleanRaws(this.root()===e.root()),this.remove(),e.parent.insertAfter(e,this),this},e.prototype.next=function(){var e=this.parent.index(this);return this.parent.nodes[e+1]},e.prototype.prev=function(){var e=this.parent.index(this);return this.parent.nodes[e-1]},e.prototype.before=function(e){return this.parent.insertBefore(this,e),this},e.prototype.after=function(e){return this.parent.insertAfter(this,e),this},e.prototype.toJSON=function(){var e={};for(var t in this)if(this.hasOwnProperty(t)&&"parent"!==t){var n=this[t];n instanceof Array?e[t]=n.map(function(e){return"object"===(void 0===e?"undefined":o(e))&&e.toJSON?e.toJSON():e}):"object"===(void 0===n?"undefined":o(n))&&n.toJSON?e[t]=n.toJSON():e[t]=n}return e},e.prototype.raw=function(e,t){return(new l.default).raw(this,e,t)},e.prototype.root=function(){for(var e=this;e.parent;)e=e.parent;return e},e.prototype.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},e.prototype.positionInside=function(e){for(var t=this.toString(),n=this.source.start.column,r=this.source.start.line,i=0;i<e;i++)"\n"===t[i]?(n=1,r+=1):n+=1;return{line:r,column:n}},e.prototype.positionBy=function(e){var t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){var n=this.toString().indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t},e}();t.default=m,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(t&&t.safe)throw new Error('Option safe was removed. Use parser: require("postcss-safe-parser")');var n=new u.default(e,t),r=new a.default(n);try{r.parse()}catch(e){throw"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}t.__esModule=!0,t.default=i;var o=n(981),a=r(o),s=n(433),u=r(s);e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=n(233),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=function(e){function t(n){r(this,t);var o=i(this,e.call(this,n));return o.type="root",o.nodes||(o.nodes=[]),o}return o(t,e),t.prototype.removeChild=function(t,n){var r=this.index(t);return!n&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),e.prototype.removeChild.call(this,t)},t.prototype.normalize=function(t,n,r){var i=e.prototype.normalize.call(this,t);if(n)if("prepend"===r)this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(var o=i,a=Array.isArray(o),s=0,o=a?o:o[Symbol.iterator]();;){var u;if(a){if(s>=o.length)break;u=o[s++]}else{if(s=o.next(),s.done)break;u=s.value}var l=u;l.raws.before=n.raws.before}return i},t.prototype.toResult=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new(n(434))(new(n(436)),this,e).stringify()},t}(s.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){new o.default(t).stringify(e)}t.__esModule=!0,t.default=r;var i=n(437),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){(function(t){for(var r=n(1006),i="undefined"==typeof window?t:window,o=["moz","webkit"],a="AnimationFrame",s=i["request"+a],u=i["cancel"+a]||i["cancelRequest"+a],l=0;!s&&l<o.length;l++)s=i[o[l]+"Request"+a],u=i[o[l]+"Cancel"+a]||i[o[l]+"CancelRequest"+a];if(!s||!u){var c=0,p=0,f=[];s=function(e){if(0===f.length){var t=r(),n=Math.max(0,1e3/60-(t-c));c=n+t,setTimeout(function(){var e=f.slice(0);f.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(c)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return f.push({handle:++p,callback:e,cancelled:!1}),p},u=function(e){for(var t=0;t<f.length;t++)f[t].handle===e&&(f[t].cancelled=!0)}}e.exports=function(e){return s.call(i,e)},e.exports.cancel=function(){u.apply(i,arguments)},e.exports.polyfill=function(e){e||(e=i),e.requestAnimationFrame=s,e.cancelAnimationFrame=u}}).call(t,n(17))},function(e,t,n){"use strict";function r(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}function i(e,t,n){c.insertTreeBefore(e,t,n)}function o(e,t,n){Array.isArray(t)?s(e,t[0],t[1],n):m(e,t,n)}function a(e,t){if(Array.isArray(t)){var n=t[1];t=t[0],u(e,t,n),e.removeChild(n)}e.removeChild(t)}function s(e,t,n,r){for(var i=t;;){var o=i.nextSibling;if(m(e,i,r),i===n)break;i=o}}function u(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}function l(e,t,n){var r=e.parentNode,i=e.nextSibling;i===t?n&&m(r,document.createTextNode(n),i):n?(d(i,n),u(r,i,t)):u(r,e,t)}var c=n(88),p=n(1014),f=(n(14),n(39),n(249)),h=n(163),d=n(469),m=f(function(e,t,n){e.insertBefore(t,n)}),v=p.dangerouslyReplaceNodeWithMarkup,g={dangerouslyReplaceNodeWithMarkup:v,replaceDelimitedText:l,processUpdates:function(e,t){for(var n=0;n<t.length;n++){var s=t[n];switch(s.type){case"INSERT_MARKUP":i(e,s.content,r(e,s.afterNode));break;case"MOVE_EXISTING":o(e,s.fromNode,r(e,s.afterNode));break;case"SET_MARKUP":h(e,s.content);break;case"TEXT_CONTENT":d(e,s.content);break;case"REMOVE_NODE":a(e,s.fromNode)}}}};e.exports=g},function(e,t,n){"use strict";var r={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};e.exports=r},function(e,t,n){"use strict";function r(){if(s)for(var e in u){var t=u[e],n=s.indexOf(e);if(n>-1||a("96",e),!l.plugins[n]){t.extractEvents||a("97",e),l.plugins[n]=t;var r=t.eventTypes;for(var o in r)i(r[o],t,o)||a("98",o,e)}}}function i(e,t,n){l.eventNameDispatchConfigs.hasOwnProperty(n)&&a("99",n),l.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];o(s,t,n)}return!0}return!!e.registrationName&&(o(e.registrationName,t,n),!0)}function o(e,t,n){l.registrationNameModules[e]&&a("100",e),l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=n(11),s=(n(8),null),u={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){s&&a("101"),s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];u.hasOwnProperty(n)&&u[n]===i||(u[n]&&a("102",n),u[n]=i,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var i=l.registrationNameModules[n[r]];if(i)return i}}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var i in r)r.hasOwnProperty(i)&&delete r[i]}};e.exports=l},function(e,t,n){"use strict";function r(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e}function i(e){return"topMouseMove"===e||"topTouchMove"===e}function o(e){return"topMouseDown"===e||"topTouchStart"===e}function a(e,t,n,r){var i=e.type||"unknown-event";e.currentTarget=g.getNodeFromInstance(r),t?m.invokeGuardedCallbackWithCatch(i,n,e):m.invokeGuardedCallback(i,n,e),e.currentTarget=null}function s(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var i=0;i<n.length&&!e.isPropagationStopped();i++)a(e,t,n[i],r[i]);else n&&a(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null}function u(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}function l(e){var t=u(e);return e._dispatchInstances=null,e._dispatchListeners=null,t}function c(e){var t=e._dispatchListeners,n=e._dispatchInstances;Array.isArray(t)&&d("103"),e.currentTarget=t?g.getNodeFromInstance(n):null;var r=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,r}function p(e){return!!e._dispatchListeners}var f,h,d=n(11),m=n(247),v=(n(8),n(10),{injectComponentTree:function(e){f=e},injectTreeTraversal:function(e){h=e}}),g={isEndish:r,isMoveish:i,isStartish:o,executeDirectDispatch:c,executeDispatchesInOrder:s,executeDispatchesInOrderStopAtTrue:l,hasDispatches:p,getInstanceFromNode:function(e){return f.getInstanceFromNode(e)},getNodeFromInstance:function(e){return f.getNodeFromInstance(e)},isAncestor:function(e,t){return h.isAncestor(e,t)},getLowestCommonAncestor:function(e,t){return h.getLowestCommonAncestor(e,t)},getParentInstance:function(e){return h.getParentInstance(e)},traverseTwoPhase:function(e,t,n){return h.traverseTwoPhase(e,t,n)},traverseEnterLeave:function(e,t,n,r,i){return h.traverseEnterLeave(e,t,n,r,i)},injection:v};e.exports=g},function(e,t,n){"use strict";function r(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function i(e){var t=/(=0|=2)/g,n={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(t,function(e){return n[e]})}var o={escape:r,unescape:i};e.exports=o},function(e,t,n){"use strict";function r(e){null!=e.checkedLink&&null!=e.valueLink&&s("87")}function i(e){r(e),(null!=e.value||null!=e.onChange)&&s("88")}function o(e){r(e),(null!=e.checked||null!=e.onChange)&&s("89")}function a(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var s=n(11),u=n(1043),l=n(443),c=n(92),p=l(c.isValidElement),f=(n(8),n(10),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0}),h={value:function(e,t,n){return!e[t]||f[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:p.func},d={},m={checkPropTypes:function(e,t,n){for(var r in h){if(h.hasOwnProperty(r))var i=h[r](t,r,e,"prop",null,u);if(i instanceof Error&&!(i.message in d)){d[i.message]=!0;a(n)}}},getValue:function(e){return e.valueLink?(i(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(o(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(i(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(o(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};e.exports=m},function(e,t,n){"use strict";var r=n(11),i=(n(8),!1),o={replaceNodeWithMarkup:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){i&&r("104"),o.replaceNodeWithMarkup=e.replaceNodeWithMarkup,o.processChildrenUpdates=e.processChildrenUpdates,i=!0}}};e.exports=o},function(e,t,n){"use strict";function r(e,t,n){try{t(n)}catch(e){null===i&&(i=e)}}var i=null,o={invokeGuardedCallback:r,invokeGuardedCallbackWithCatch:r,rethrowCaughtError:function(){if(i){var e=i;throw i=null,e}}};e.exports=o},function(e,t,n){"use strict";function r(e){u.enqueueUpdate(e)}function i(e){var t=typeof e;if("object"!==t)return t;var n=e.constructor&&e.constructor.name||t,r=Object.keys(e);return r.length>0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function o(e,t){var n=s.get(e);if(!n){return null}return n}var a=n(11),s=(n(52),n(124)),u=(n(39),n(44)),l=(n(8),n(10),{isMounted:function(e){var t=s.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){l.validateCallback(t,n);var i=o(e);if(!i)return null;i._pendingCallbacks?i._pendingCallbacks.push(t):i._pendingCallbacks=[t],r(i)},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],r(e)},enqueueForceUpdate:function(e){var t=o(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t,n){var i=o(e,"replaceState");i&&(i._pendingStateQueue=[t],i._pendingReplaceState=!0,void 0!==n&&null!==n&&(l.validateCallback(n,"replaceState"),i._pendingCallbacks?i._pendingCallbacks.push(n):i._pendingCallbacks=[n]),r(i))},enqueueSetState:function(e,t){var n=o(e,"setState");if(n){(n._pendingStateQueue||(n._pendingStateQueue=[])).push(t),r(n)}},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,r(e)},validateCallback:function(e,t){e&&"function"!=typeof e&&a("122",t,i(e))}});e.exports=l},function(e,t,n){"use strict";var r=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e};e.exports=r},function(e,t,n){"use strict";function r(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,t>=32||13===t?t:0}e.exports=r},function(e,t,n){"use strict";function r(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return!!r&&!!n[r]}function i(e){return r}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=i},function(e,t,n){"use strict";function r(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}e.exports=r},function(e,t,n){"use strict";/** +function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(e){var t=[];return e.forEach(function(e,i){"object"==typeof e&&null!==e?Array.isArray(e)?t[i]=o(e):n(e)?t[i]=r(e):t[i]=a({},e):t[i]=e}),t}function i(e,t){return"__proto__"===t?void 0:e[t]}var a=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,s=arguments[0],u=Array.prototype.slice.call(arguments,1);return u.forEach(function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach(function(c){return t=i(s,c),(e=i(u,c))===s?void 0:"object"!=typeof e||null===e?void(s[c]=e):Array.isArray(e)?void(s[c]=o(e)):n(e)?void(s[c]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(s[c]=a({},e)):void(s[c]=a(t,e))})}),s}}).call(this,n(64).Buffer)},function(e,t,n){var r=n(151),o=n(336);e.exports=n(126)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(106),o=n(603),i=n(604),a="[object Null]",s="[object Undefined]",u=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?s:a:u&&u in Object(e)?o(e):i(e)}},function(e,t,n){var r=n(621),o=n(624);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(380),o=n(661),i=n(107);e.exports=function(e){return i(e)?r(e):o(e)}},function(e,t,n){"use strict";var r=n(178),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=p;var i=n(137);i.inherits=n(47);var a=n(390),s=n(240);i.inherits(p,a);for(var u=o(s.prototype),c=0;c<u.length;c++){var l=u[c];p.prototype[l]||(p.prototype[l]=s.prototype[l])}function p(e){if(!(this instanceof p))return new p(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(p.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),p.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){"use strict";var r=n(397)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";var r=n(696),o=Math.max;e.exports=function(e){return o(0,r(e))}},function(e,t,n){},function(e,t,n){"use strict";var r=n(21),o=(n(15),function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)}),i=function(e){e instanceof this||r("25"),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)},a=o,s={addPoolingTo:function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||a,n.poolSize||(n.poolSize=10),n.release=i,n},oneArgumentPooler:o,twoArgumentPooler:function(e,t){if(this.instancePool.length){var n=this.instancePool.pop();return this.call(n,e,t),n}return new this(e,t)},threeArgumentPooler:function(e,t,n){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,e,t,n),r}return new this(e,t,n)},fourArgumentPooler:function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}};e.exports=s},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){e.exports=n(599)},function(e,t,n){var r=n(177);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},function(e,t,n){e.exports=n(763)},function(e,t,n){"use strict";(function(t){var r=n(803),o=n(804),i=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,a=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,s=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function u(e){return(e||"").toString().replace(s,"")}var c=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function p(e){var n,r=("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{}).location||{},o={},a=typeof(e=e||r);if("blob:"===e.protocol)o=new h(unescape(e.pathname),{});else if("string"===a)for(n in o=new h(e,{}),l)delete o[n];else if("object"===a){for(n in e)n in l||(o[n]=e[n]);void 0===o.slashes&&(o.slashes=i.test(e.href))}return o}function f(e){e=u(e);var t=a.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function h(e,t,n){if(e=u(e),!(this instanceof h))return new h(e,t,n);var i,a,s,l,d,m,v=c.slice(),g=typeof t,y=this,b=0;for("object"!==g&&"string"!==g&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),t=p(t),i=!(a=f(e||"")).protocol&&!a.slashes,y.slashes=a.slashes||i&&t.slashes,y.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(v[3]=[/(.*)/,"pathname"]);b<v.length;b++)"function"!=typeof(l=v[b])?(s=l[0],m=l[1],s!=s?y[m]=e:"string"==typeof s?~(d=e.indexOf(s))&&("number"==typeof l[2]?(y[m]=e.slice(0,d),e=e.slice(d+l[2])):(y[m]=e.slice(d),e=e.slice(0,d))):(d=s.exec(e))&&(y[m]=d[1],e=e.slice(0,d.index)),y[m]=y[m]||i&&l[3]&&t[m]||"",l[4]&&(y[m]=y[m].toLowerCase())):e=l(e);n&&(y.query=n(y.query)),i&&t.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==t.pathname)&&(y.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],i=!1,a=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),a++):a&&(0===r&&(i=!0),n.splice(r,1),a--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(y.pathname,t.pathname)),r(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(l=y.auth.split(":"),y.username=l[0]||"",y.password=l[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}h.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),i[e]=t;break;case"port":i[e]=t,r(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var a="pathname"===e?"/":"#";i[e]=t.charAt(0)!==a?a+t:t}else i[e]=t;break;default:i[e]=t}for(var s=0;s<c.length;s++){var u=c[s];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.origin=i.protocol&&i.host&&"file:"!==i.protocol?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var i=r+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},h.extractProtocol=f,h.location=p,h.trimLeft=u,h.qs=o,e.exports=h}).call(this,n(36))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return a});var r=n(478),o=n.n(r),i=[n(275),n(276)];function a(e,t){var n={jsSpec:t.specSelectors.specJson().toJS()};return o()(i,function(e,t){try{return t.transform(e,n).filter(function(e){return!!e})}catch(t){return console.error("Transformer error:",t),e}},e).filter(function(e){return!!e}).map(function(e){return!e.get("line")&&e.get("path"),e})}},function(e,t,n){var r=n(41),o=n(81),i=n(152),a=n(199)("src"),s=n(494),u=(""+s).split("toString");n(72).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(c&&(i(n,a)||o(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(210);e.exports=function(e){return Object(r(e))}},function(e,t,n){"use strict";var r=n(559)(!0);n(219)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t){e.exports={}},function(e,t,n){n(561);for(var r=n(32),o=n(77),i=n(102),a=n(34)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<s.length;u++){var c=s[u],l=r[c],p=l&&l.prototype;p&&!p[a]&&o(p,a,c),i[c]=i.Array}},function(e,t,n){"use strict";var r=n(25),o=n(357),i=n(578),a=n(583),s=n(105),u=n(584),c=n(588),l=n(589),p=n(591),f=s.createElement,h=s.createFactory,d=s.cloneElement,m=r,v={Children:{map:i.map,forEach:i.forEach,count:i.count,toArray:i.toArray,only:p},Component:o.Component,PureComponent:o.PureComponent,createElement:f,cloneElement:d,isValidElement:s.isValidElement,PropTypes:u,createClass:l,createFactory:h,createMixin:function(e){return e},DOM:a,version:c,__spread:m};e.exports=v},function(e,t,n){"use strict";var r=n(25),o=n(65),i=(n(23),n(359),Object.prototype.hasOwnProperty),a=n(360),s={key:!0,ref:!0,__self:!0,__source:!0};function u(e){return void 0!==e.ref}function c(e){return void 0!==e.key}var l=function(e,t,n,r,o,i,s){return{$$typeof:a,type:e,key:t,ref:n,props:s,_owner:i}};l.createElement=function(e,t,n){var r,a={},p=null,f=null;if(null!=t)for(r in u(t)&&(f=t.ref),c(t)&&(p=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source,t)i.call(t,r)&&!s.hasOwnProperty(r)&&(a[r]=t[r]);var h=arguments.length-2;if(1===h)a.children=n;else if(h>1){for(var d=Array(h),m=0;m<h;m++)d[m]=arguments[m+2];0,a.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(r in v)void 0===a[r]&&(a[r]=v[r])}return l(e,p,f,0,0,o.current,a)},l.createFactory=function(e){var t=l.createElement.bind(null,e);return t.type=e,t},l.cloneAndReplaceKey=function(e,t){return l(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},l.cloneElement=function(e,t,n){var a,p,f=r({},e.props),h=e.key,d=e.ref,m=(e._self,e._source,e._owner);if(null!=t)for(a in u(t)&&(d=t.ref,m=o.current),c(t)&&(h=""+t.key),e.type&&e.type.defaultProps&&(p=e.type.defaultProps),t)i.call(t,a)&&!s.hasOwnProperty(a)&&(void 0===t[a]&&void 0!==p?f[a]=p[a]:f[a]=t[a]);var v=arguments.length-2;if(1===v)f.children=n;else if(v>1){for(var g=Array(v),y=0;y<v;y++)g[y]=arguments[y+2];f.children=g}return l(e.type,h,d,0,0,m,f)},l.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},e.exports=l},function(e,t,n){var r=n(51).Symbol;e.exports=r},function(e,t,n){var r=n(371),o=n(233);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(37),o=n(236),i=n(669),a=n(69);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},function(e,t,n){var r=n(167),o=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}},function(e,t,n){"use strict";var r=n(87);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){var r=n(48).Buffer;function o(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}o.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var n=this._block,o=this._blockSize,i=e.length,a=this._len,s=0;s<i;){for(var u=a%o,c=Math.min(i-s,o-u),l=0;l<c;l++)n[u+l]=e[s+l];s+=c,(a+=c)%o==0&&this._update(n)}return this._len+=i,this},o.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},o.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=o},function(e,t,n){var r=n(63),o=n(406),i=n(407),a=n(46),s=n(158),u=n(225),c={},l={};(t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(h=s(e.length);h>b;b++)if((v=t?y(a(d=e[b])[0],d[1]):y(e[b]))===c||v===l)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=o(m,y,d.value,t))===c||v===l)return v}).BREAK=c,t.RETURN=l},function(e,t,n){"use strict";function r(e){return null==e}e.exports.isNothing=r,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:r(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var n,r,o,i;if(t)for(n=0,r=(i=Object.keys(t)).length;n<r;n+=1)e[o=i[n]]=t[o];return e}},function(e,t,n){"use strict";var r=n(113),o=n(138),i=n(31);function a(e,t,n){var r=[];return e.include.forEach(function(e){n=a(e,t,n)}),e[t].forEach(function(e){n.forEach(function(t,n){t.tag===e.tag&&t.kind===e.kind&&r.push(n)}),n.push(e)}),n.filter(function(e,t){return-1===r.indexOf(t)})}function s(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=a(this,"implicit",[]),this.compiledExplicit=a(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(this.compiledImplicit,this.compiledExplicit)}s.DEFAULT=null,s.create=function(){var e,t;switch(arguments.length){case 1:e=s.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new o("Wrong number of arguments for Schema.create function")}if(e=r.toArray(e),t=r.toArray(t),!e.every(function(e){return e instanceof s}))throw new o("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof i}))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new s({include:e,explicit:t})},e.exports=s},function(e,t,n){"use strict";var r=n(21);n(15);function o(e,t){return(e&t)===t}var i={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(e){var t=i,n=e.Properties||{},a=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},c=e.DOMPropertyNames||{},l=e.DOMMutationMethods||{};for(var p in e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute),n){s.properties.hasOwnProperty(p)&&r("48",p);var f=p.toLowerCase(),h=n[p],d={attributeName:f,attributeNamespace:null,propertyName:p,mutationMethod:null,mustUseProperty:o(h,t.MUST_USE_PROPERTY),hasBooleanValue:o(h,t.HAS_BOOLEAN_VALUE),hasNumericValue:o(h,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:o(h,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:o(h,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(d.hasBooleanValue+d.hasNumericValue+d.hasOverloadedBooleanValue<=1||r("50",p),u.hasOwnProperty(p)){var m=u[p];d.attributeName=m}a.hasOwnProperty(p)&&(d.attributeNamespace=a[p]),c.hasOwnProperty(p)&&(d.propertyName=c[p]),l.hasOwnProperty(p)&&(d.mutationMethod=l[p]),s.properties[p]=d}}},a=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",s={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:a,ATTRIBUTE_NAME_CHAR:a+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<s._isCustomAttributeFunctions.length;t++){if((0,s._isCustomAttributeFunctions[t])(e))return!0}return!1},injection:i};e.exports=s},function(e,t,n){"use strict";var r=n(823);n(53),n(23);function o(){r.attachRefs(this,this._currentElement)}var i={mountComponent:function(e,t,n,r,i,a){var s=e.mountComponent(t,n,r,i,a);return e._currentElement&&null!=e._currentElement.ref&&t.getReactMountReady().enqueue(o,e),s},getHostNode:function(e){return e.getHostNode()},unmountComponent:function(e,t){r.detachRefs(e,e._currentElement),e.unmountComponent(t)},receiveComponent:function(e,t,n,i){var a=e._currentElement;if(t!==a||i!==e._context){0;var s=r.shouldUpdateRefs(a,t);s&&r.detachRefs(e,a),e.receiveComponent(t,n,i),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(o,e)}},performUpdateIfNecessary:function(e,t,n){e._updateBatchNumber===n&&e.performUpdateIfNecessary(t)}};e.exports=i},function(e,t,n){"use strict";var r=n(254),o=n(187),i=n(255),a=n(431),s="undefined"!=typeof document&&"number"==typeof document.documentMode||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&/\bEdge\/\d/.test(navigator.userAgent);function u(e){if(s){var t=e.node,n=e.children;if(n.length)for(var r=0;r<n.length;r++)c(t,n[r],null);else null!=e.html?o(t,e.html):null!=e.text&&a(t,e.text)}}var c=i(function(e,t,n){11===t.node.nodeType||1===t.node.nodeType&&"object"===t.node.nodeName.toLowerCase()&&(null==t.node.namespaceURI||t.node.namespaceURI===r.html)?(u(t),e.insertBefore(t.node,n)):(e.insertBefore(t.node,n),u(t))});function l(){return this.node.nodeName}function p(e){return{node:e,children:[],html:null,text:null,toString:l}}p.insertTreeBefore=c,p.replaceChildWithTree=function(e,t){e.parentNode.replaceChild(t.node,e),u(t)},p.queueChild=function(e,t){s?e.children.push(t):e.node.appendChild(t.node)},p.queueHTML=function(e,t){s?e.html=t:o(e.node,t)},p.queueText=function(e,t){s?e.text=t:a(e.node,t)},e.exports=p},function(e,t,n){var r=n(184),o=n(418);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=i?i(n[c],e[c],c,n,e):void 0;void 0===l&&(l=e[c]),a?o(n,c,l):r(n,c,l)}return n}},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e?function e(t,n){var r;r=Array.isArray(t)?[]:{};n.push(t);Object.keys(t).forEach(function(o){var i=t[o];"function"!=typeof i&&(i&&"object"==typeof i?-1!==n.indexOf(t[o])?r[o]="[Circular]":r[o]=e(t[o],n.slice(0)):r[o]=i)});"string"==typeof t.name&&(r.name=t.name);"string"==typeof t.message&&(r.message=t.message);"string"==typeof t.stack&&(r.stack=t.stack);return r}(e,[]):"function"==typeof e?"[Function: "+(e.name||"anonymous")+"]":e}},function(e,t,n){"use strict";n.r(t),n.d(t,"sampleFromSchema",function(){return d}),n.d(t,"inferSchema",function(){return m}),n.d(t,"sampleXmlFromSchema",function(){return v}),n.d(t,"createXMLExample",function(){return g}),n.d(t,"memoizedCreateXMLExample",function(){return y}),n.d(t,"memoizedSampleFromSchema",function(){return b});var r=n(14),o=n.n(r),i=n(3),a=n(474),s=n.n(a),u=n(331),c=n.n(u),l=n(145),p=n.n(l),f={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},string_date:function(){return(new Date).toISOString().substring(0,10)},string_uuid:function(){return"3fa85f64-5717-4562-b3fc-2c963f66afa6"},string_hostname:function(){return"example.com"},string_ipv4:function(){return"198.51.100.42"},string_ipv6:function(){return"2001:0db8:5b96:0000:0000:426f:8e17:642a"},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},h=function(e){var t=e=Object(i.A)(e),n=t.type,r=t.format,o=f["".concat(n,"_").concat(r)]||f[n];return Object(i.s)(o)?o(e):"Unknown Type: "+e.type},d=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(i.A)(t),a=r.type,s=r.example,u=r.properties,c=r.additionalProperties,l=r.items,p=n.includeReadOnly,f=n.includeWriteOnly;if(void 0!==s)return Object(i.e)(s,"$$ref",function(e){return"string"==typeof e&&e.indexOf("#")>-1});if(!a)if(u)a="object";else{if(!l)return;a="array"}if("object"===a){var d=Object(i.A)(u),m={};for(var v in d)d[v]&&d[v].deprecated||d[v]&&d[v].readOnly&&!p||d[v]&&d[v].writeOnly&&!f||(m[v]=e(d[v],n));if(!0===c)m.additionalProp1={};else if(c)for(var g=Object(i.A)(c),y=e(g,n),b=1;b<4;b++)m["additionalProp"+b]=y;return m}return"array"===a?o()(l.anyOf)?l.anyOf.map(function(t){return e(t,n)}):o()(l.oneOf)?l.oneOf.map(function(t){return e(t,n)}):[e(l,n)]:t.enum?t.default?t.default:Object(i.w)(t.enum)[0]:"file"!==a?h(t):void 0},m=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},v=function e(t){var n,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=p()({},Object(i.A)(t)),u=s.type,c=s.properties,l=s.additionalProperties,f=s.items,d=s.example,m=a.includeReadOnly,v=a.includeWriteOnly,g=s.default,y={},b={},_=t.xml,w=_.name,x=_.prefix,E=_.namespace,S=s.enum;if(!u)if(c||l)u="object";else{if(!f)return;u="array"}if(n=(x?x+":":"")+(w=w||"notagname"),E){var C=x?"xmlns:"+x:"xmlns";b[C]=E}if("array"===u&&f){if(f.xml=f.xml||_||{},f.xml.name=f.xml.name||_.name,_.wrapped)return y[n]=[],o()(d)?d.forEach(function(t){f.example=t,y[n].push(e(f,a))}):o()(g)?g.forEach(function(t){f.default=t,y[n].push(e(f,a))}):y[n]=[e(f,a)],b&&y[n].push({_attr:b}),y;var k=[];return o()(d)?(d.forEach(function(t){f.example=t,k.push(e(f,a))}),k):o()(g)?(g.forEach(function(t){f.default=t,k.push(e(f,a))}),k):e(f,a)}if("object"===u){var O=Object(i.A)(c);for(var A in y[n]=[],d=d||{},O)if(O.hasOwnProperty(A)&&(!O[A].readOnly||m)&&(!O[A].writeOnly||v))if(O[A].xml=O[A].xml||{},O[A].xml.attribute){var T=o()(O[A].enum)&&O[A].enum[0],j=O[A].example,P=O[A].default;b[O[A].xml.name||A]=void 0!==j&&j||void 0!==d[A]&&d[A]||void 0!==P&&P||T||h(O[A])}else{O[A].xml.name=O[A].xml.name||A,void 0===O[A].example&&void 0!==d[A]&&(O[A].example=d[A]);var I=e(O[A]);o()(I)?y[n]=y[n].concat(I):y[n].push(I)}return!0===l?y[n].push({additionalProp:"Anything can be here"}):l&&y[n].push({additionalProp:h(l)}),b&&y[n].push({_attr:b}),y}return r=void 0!==d?d:void 0!==g?g:o()(S)?S[0]:h(t),y[n]=b?[{_attr:b},r]:r,y};function g(e,t){var n=v(e,t);if(n)return s()(n,{declaration:!0,indent:"\t"})}var y=c()(g),b=c()(d)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_CONFIGS",function(){return i}),n.d(t,"TOGGLE_CONFIGS",function(){return a}),n.d(t,"update",function(){return s}),n.d(t,"toggle",function(){return u}),n.d(t,"loaded",function(){return c});var r=n(2),o=n.n(r),i="configs_update",a="configs_toggle";function s(e,t){return{type:i,payload:o()({},e,t)}}function u(e){return{type:a,payload:e}}var c=function(){return function(){}}},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),o=n.n(r),i=o.a.Set.of("type","format","items","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf");function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isOAS3;if(!o.a.Map.isMap(e))return{schema:o.a.Map(),parameterContentMediaType:null};if(!t)return"body"===e.get("in")?{schema:e.get("schema",o.a.Map()),parameterContentMediaType:null}:{schema:e.filter(function(e,t){return i.includes(t)}),parameterContentMediaType:null};if(e.get("content")){var n=e.get("content",o.a.Map({})).keySeq().first();return{schema:e.getIn(["content",n,"schema"],o.a.Map()),parameterContentMediaType:n}}return{schema:e.get("schema",o.a.Map()),parameterContentMediaType:null}}},function(e,t,n){e.exports=n(781)},function(e,t,n){"use strict";n.r(t);var r=n(469),o="object"==typeof self&&self&&self.Object===Object&&self,i=(r.a||o||Function("return this")()).Symbol,a=Object.prototype,s=a.hasOwnProperty,u=a.toString,c=i?i.toStringTag:void 0;var l=function(e){var t=s.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=u.call(e);return r&&(t?e[c]=n:delete e[c]),o},p=Object.prototype.toString;var f=function(e){return p.call(e)},h="[object Null]",d="[object Undefined]",m=i?i.toStringTag:void 0;var v=function(e){return null==e?void 0===e?d:h:m&&m in Object(e)?l(e):f(e)};var g=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);var y=function(e){return null!=e&&"object"==typeof e},b="[object Object]",_=Function.prototype,w=Object.prototype,x=_.toString,E=w.hasOwnProperty,S=x.call(Object);var C=function(e){if(!y(e)||v(e)!=b)return!1;var t=g(e);if(null===t)return!0;var n=E.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&x.call(n)==S},k=n(330),O={INIT:"@@redux/INIT"};function A(e,t,n){var r;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(A)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var o=e,i=t,a=[],s=a,u=!1;function c(){s===a&&(s=a.slice())}function l(){return i}function p(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return c(),s.push(e),function(){if(t){t=!1,c();var n=s.indexOf(e);s.splice(n,1)}}}function f(e){if(!C(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(u)throw new Error("Reducers may not dispatch actions.");try{u=!0,i=o(i,e)}finally{u=!1}for(var t=a=s,n=0;n<t.length;n++){(0,t[n])()}return e}return f({type:O.INIT}),(r={dispatch:f,subscribe:p,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");o=e,f({type:O.INIT})}})[k.a]=function(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(l())}return n(),{unsubscribe:t(n)}}})[k.a]=function(){return this},e},r}function T(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function j(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}var i=Object.keys(n);var a=void 0;try{!function(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:O.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+O.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(n)}catch(e){a=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(a)throw a;for(var r=!1,o={},s=0;s<i.length;s++){var u=i[s],c=n[u],l=e[u],p=c(l,t);if(void 0===p){var f=T(u,t);throw new Error(f)}o[u]=p,r=r||p!==l}return r?o:e}}function P(e,t){return function(){return t(e.apply(void 0,arguments))}}function I(e,t){if("function"==typeof e)return P(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),r={},o=0;o<n.length;o++){var i=n[o],a=e[i];"function"==typeof a&&(r[i]=P(a,t))}return r}function M(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}var N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function R(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,o){var i,a=e(n,r,o),s=a.dispatch,u={getState:a.getState,dispatch:function(e){return s(e)}};return i=t.map(function(e){return e(u)}),s=M.apply(void 0,i)(a.dispatch),N({},a,{dispatch:s})}}}n.d(t,"createStore",function(){return A}),n.d(t,"combineReducers",function(){return j}),n.d(t,"bindActionCreators",function(){return I}),n.d(t,"applyMiddleware",function(){return R}),n.d(t,"compose",function(){return M})},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){e.exports=!n(99)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports={}},function(e,t,n){var r=n(348),o=n(215);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=!0},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(49).f,o=n(75),i=n(34)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(159)("meta"),o=n(43),i=n(75),a=n(49).f,s=0,u=Object.isExtensible||function(){return!0},c=!n(82)(function(){return u(Object.preventExtensions({}))}),l=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},p=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!u(e))return"F";if(!t)return"E";l(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!u(e))return!0;if(!t)return!1;l(e)}return e[r].w},onFreeze:function(e){return c&&p.NEED&&u(e)&&!i(e,r)&&l(e),e}}},function(e,t,n){"use strict";e.exports=function(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(64).Buffer)},function(e,t,n){"use strict";function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=r},function(e,t,n){"use strict";var r=n(114);e.exports=new r({include:[n(415)],implicit:[n(792),n(793)],explicit:[n(794),n(795),n(796),n(797)]})},function(e,t,n){"use strict";var r=n(141),o=n(248),i=n(423),a=n(424),s=(n(23),r.getListener);function u(e,t,n){var r=function(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return s(e,r)}(e,n,t);r&&(n._dispatchListeners=i(n._dispatchListeners,r),n._dispatchInstances=i(n._dispatchInstances,e))}function c(e){e&&e.dispatchConfig.phasedRegistrationNames&&o.traverseTwoPhase(e._targetInst,u,e)}function l(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst,n=t?o.getParentInstance(t):null;o.traverseTwoPhase(n,u,e)}}function p(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=s(e,r);o&&(n._dispatchListeners=i(n._dispatchListeners,o),n._dispatchInstances=i(n._dispatchInstances,e))}}function f(e){e&&e.dispatchConfig.registrationName&&p(e._targetInst,0,e)}var h={accumulateTwoPhaseDispatches:function(e){a(e,c)},accumulateTwoPhaseDispatchesSkipTarget:function(e){a(e,l)},accumulateDirectDispatches:function(e){a(e,f)},accumulateEnterLeaveDispatches:function(e,t,n,r){o.traverseEnterLeave(n,r,p,e,t)}};e.exports=h},function(e,t,n){"use strict";var r=n(21),o=n(247),i=n(248),a=n(249),s=n(423),u=n(424),c=(n(15),{}),l=null,p=function(e,t){e&&(i.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},f=function(e){return p(e,!0)},h=function(e){return p(e,!1)},d=function(e){return"."+e._rootNodeID};var m={injection:{injectEventPluginOrder:o.injectEventPluginOrder,injectEventPluginsByName:o.injectEventPluginsByName},putListener:function(e,t,n){"function"!=typeof n&&r("94",t,typeof n);var i=d(e);(c[t]||(c[t]={}))[i]=n;var a=o.registrationNameModules[t];a&&a.didPutListener&&a.didPutListener(e,t,n)},getListener:function(e,t){var n=c[t];if(function(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||(r=t,"button"!==r&&"input"!==r&&"select"!==r&&"textarea"!==r));default:return!1}var r}(t,e._currentElement.type,e._currentElement.props))return null;var r=d(e);return n&&n[r]},deleteListener:function(e,t){var n=o.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=c[t];r&&delete r[d(e)]},deleteAllListeners:function(e){var t=d(e);for(var n in c)if(c.hasOwnProperty(n)&&c[n][t]){var r=o.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete c[n][t]}},extractEvents:function(e,t,n,r){for(var i,a=o.plugins,u=0;u<a.length;u++){var c=a[u];if(c){var l=c.extractEvents(e,t,n,r);l&&(i=s(i,l))}}return i},enqueueEvents:function(e){e&&(l=s(l,e))},processEventQueue:function(e){var t=l;l=null,u(t,e?f:h),l&&r("95"),a.rethrowCaughtError()},__purge:function(){c={}},__getListenerBank:function(){return c}};e.exports=m},function(e,t,n){"use strict";var r=n(68),o=n(250),i={view:function(e){if(e.view)return e.view;var t=o(e);if(t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=r},function(e,t,n){var r=n(43);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(e){return null===e?"null":void 0===e?"undefined":"object"===(void 0===e?"undefined":r(e))?Array.isArray(e)?"array":"object":void 0===e?"undefined":r(e)}function i(e){return"object"===o(e)?s(e):"array"===o(e)?a(e):e}function a(e){return e.map(i)}function s(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=i(e[n]));return t}function u(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={arrayBehaviour:(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).arrayBehaviour||"replace"},r=t.map(function(e){return e||{}}),i=e||{},c=0;c<r.length;c++)for(var l=r[c],p=Object.keys(l),f=0;f<p.length;f++){var h=p[f],d=l[h],m=o(d),v=o(i[h]);if("object"===m)if("undefined"!==v){var g="object"===v?i[h]:{};i[h]=u({},[g,s(d)],n)}else i[h]=s(d);else if("array"===m)if("array"===v){var y=a(d);i[h]="merge"===n.arrayBehaviour?i[h].concat(y):y}else i[h]=a(d);else i[h]=d}return i}e.exports=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return u(e,n)},e.exports.noMutate=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u({},t)},e.exports.withOptions=function(e,t,n){return u(e,t,n)}},function(e,t,n){"use strict";var r=n(782);e.exports=r},function(e,t,n){"use strict";n.r(t),n.d(t,"parseYamlConfig",function(){return i});var r=n(146),o=n.n(r),i=function(e,t){try{return o.a.safeLoad(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"makeMappedContainer",function(){return j}),n.d(t,"render",function(){return P}),n.d(t,"getComponent",function(){return N});var r=n(26),o=n.n(r),i=n(17),a=n.n(i),s=n(16),u=n.n(s),c=n(20),l=n.n(c),p=n(4),f=n.n(p),h=n(5),d=n.n(h),m=n(6),v=n.n(m),g=n(7),y=n.n(g),b=n(8),_=n.n(b),w=n(0),x=n.n(w),E=n(480),S=n.n(E),C=n(334),k=n(481),O=n.n(k),A=function(e,t,n){var r=function(e,t){return function(n){function r(){return f()(this,r),v()(this,y()(r).apply(this,arguments))}return _()(r,n),d()(r,[{key:"render",value:function(){return x.a.createElement(t,l()({},e(),this.props,this.context))}}]),r}(w.Component)}(e,t),o=Object(C.connect)(function(n,r){var o=u()({},r,e());return(t.prototype.mapStateToProps||function(e){return{state:e}})(n,o)})(r);return n?function(e,t){return function(n){function r(){return f()(this,r),v()(this,y()(r).apply(this,arguments))}return _()(r,n),d()(r,[{key:"render",value:function(){return x.a.createElement(C.Provider,{store:e},x.a.createElement(t,l()({},this.props,this.context)))}}]),r}(w.Component)}(n,o):o},T=function(e,t,n,r){for(var o in t){var i=t[o];"function"==typeof i&&i(n[o],r[o],e())}},j=function(e,t,n,r,o,i){return function(t){function r(t,n){var o;return f()(this,r),o=v()(this,y()(r).call(this,t,n)),T(e,i,t,{}),o}return _()(r,t),d()(r,[{key:"componentWillReceiveProps",value:function(t){T(e,i,t,this.props)}},{key:"render",value:function(){var e=O()(this.props,i?a()(i):[]),t=n(o,"root");return x.a.createElement(t,e)}}]),r}(w.Component)},P=function(e,t,n,r,o){var i=n(e,t,r,"App","root");S.a.render(x.a.createElement(i,null),o)},I=function(e){var t=e.name;return x.a.createElement("div",{style:{padding:"1em",color:"#aaa"}},"😱 ",x.a.createElement("i",null,"Could not render ","t"===t?"this component":t,", see the console."))},M=function(e){var t=function(e){return!(e.prototype&&e.prototype.isReactComponent)}(e)?function(e){return function(t){function n(){return f()(this,n),v()(this,y()(n).apply(this,arguments))}return _()(n,t),d()(n,[{key:"render",value:function(){return e(this.props)}}]),n}(w.Component)}(e):e,n=t.prototype.render;return t.prototype.render=function(){try{for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return n.apply(this,r)}catch(e){return console.error(e),x.a.createElement(I,{error:e,name:t.name})}},t},N=function(e,t,n,r,i){if("string"!=typeof r)throw new TypeError("Need a string, to fetch a component. Was given a "+o()(r));var a=n(r);return a?i?"root"===i?A(e,a,t()):A(e,M(a)):M(a):(e().log.warn("Could not find component",r),null)}},function(e,t,n){"use strict";n.r(t),n.d(t,"setHash",function(){return r});var r=function(e){return e?history.pushState(null,null,"#".concat(e)):window.location.hash=""}},function(e,t,n){var r=n(125),o=n(33)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var r=n(45),o=n(492),i=n(493),a=Object.defineProperty;t.f=n(126)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(154);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(499),o=n(73);e.exports=function(e){return r(o(e))}},function(e,t,n){"use strict";var r=n(150),o=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},function(e,t,n){"use strict";n(546);var r=n(97),o=n(81),i=n(99),a=n(73),s=n(33),u=n(209),c=s("species"),l=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),p=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var f=s(e),h=!i(function(){var t={};return t[f]=function(){return 7},7!=""[e](t)}),d=h?!i(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[f](""),!t}):void 0;if(!h||!d||"replace"===e&&!l||"split"===e&&!p){var m=/./[f],v=n(a,f,""[e],function(e,t,n,r,o){return t.exec===u?h&&!o?{done:!0,value:m.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),g=v[0],y=v[1];r(String.prototype,e,g),o(RegExp.prototype,f,2==t?function(e,t){return y.call(e,this,t)}:function(e){return y.call(e,this)})}}},function(e,t,n){var r=n(212),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(46),o=n(350),i=n(215),a=n(213)("IE_PROTO"),s=function(){},u=function(){var e,t=n(217)("iframe"),r=i.length;for(t.style.display="none",n(351).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[i[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:o(n,t)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(162),o=n(133),i=n(76),a=n(218),s=n(75),u=n(349),c=Object.getOwnPropertyDescriptor;t.f=n(50)?c:function(e,t){if(e=i(e),t=a(t,!0),u)try{return c(e,t)}catch(e){}if(s(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t){},function(e,t,n){"use strict";e.exports={}},function(e,t,n){var r=n(130),o=n(34)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var r=n(83),o=n(66),i="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&r(e)==i}},function(e,t,n){var r=n(84)(Object,"create");e.exports=r},function(e,t,n){var r=n(629),o=n(630),i=n(631),a=n(632),s=n(633);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(91);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(635);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(640),o=n(668),i=n(237),a=n(37),s=n(673);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):s(e)}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?n:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(663),o=n(227),i=n(664),a=n(665),s=n(666),u=n(83),c=n(372),l=c(r),p=c(o),f=c(i),h=c(a),d=c(s),m=u;(r&&"[object DataView]"!=m(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=m(new o)||i&&"[object Promise]"!=m(i.resolve())||a&&"[object Set]"!=m(new a)||s&&"[object WeakMap]"!=m(new s))&&(m=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case l:return"[object DataView]";case p:return"[object Map]";case f:return"[object Promise]";case h:return"[object Set]";case d:return"[object WeakMap]"}return t}),e.exports=m},function(e,t,n){var r=n(108),o=n(109);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},function(e,t,n){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,o)});default:for(i=new Array(s-1),a=0;a<i.length;)i[a++]=arguments[a];return t.nextTick(function(){e.apply(null,i)})}}}:e.exports=t}).call(this,n(67))},function(e,t,n){"use strict";e.exports=n(701)("forEach")},function(e,t,n){"use strict";var r=n(399),o=n(396),i=n(241),a=n(710);(e.exports=function(e,t){var n,i,s,u,c;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=s=!0,i=!1):(n=a.call(e,"c"),i=a.call(e,"e"),s=a.call(e,"w")),c={value:t,configurable:n,enumerable:i,writable:s},u?r(o(u),c):c}).gs=function(e,t,n){var s,u,c,l;return"string"!=typeof e?(c=n,n=t,t=e,e=null):c=arguments[3],null==t?t=void 0:i(t)?null==n?n=void 0:i(n)||(c=n,n=void 0):(c=t,t=n=void 0),null==e?(s=!0,u=!1):(s=a.call(e,"c"),u=a.call(e,"e")),l={get:t,set:n,configurable:s,enumerable:u},c?r(o(c),l):l}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(77);e.exports=function(e,t,n){for(var o in t)n&&e[o]?e[o]=t[o]:r(e,o,t[o]);return e}},function(e,t,n){"use strict";var r=n(114);e.exports=r.DEFAULT=new r({include:[n(139)],explicit:[n(798),n(799),n(800)]})},function(e,t,n){var r=n(418),o=n(91),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){"use strict";var r=n(21),o=(n(15),{}),i={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,n,o,i,a,s,u){var c,l;this.isInTransaction()&&r("27");try{this._isInTransaction=!0,c=!0,this.initializeAll(0),l=e.call(t,n,o,i,a,s,u),c=!1}finally{try{if(c)try{this.closeAll(0)}catch(e){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return l},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=o,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===o)try{this.initializeAll(n+1)}catch(e){}}}},closeAll:function(e){this.isInTransaction()||r("28");for(var t=this.transactionWrappers,n=e;n<t.length;n++){var i,a=t[n],s=this.wrapperInitData[n];try{i=!0,s!==o&&a.close&&a.close.call(this,s),i=!1}finally{if(i)try{this.closeAll(n+1)}catch(e){}}}this.wrapperInitData.length=0}};e.exports=i},function(e,t,n){"use strict";var r=n(142),o=n(430),i={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:n(252),button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+o.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+o.currentScrollTop}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r,o=n(38),i=n(254),a=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(255)(function(e,t){if(e.namespaceURI!==i.svg||"innerHTML"in e)e.innerHTML=t;else{(r=r||document.createElement("div")).innerHTML="<svg>"+t+"</svg>";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(o.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(u=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=u},function(e,t,n){"use strict";var r=/["'&<>]/;e.exports=function(e){return"boolean"==typeof e||"number"==typeof e?""+e:function(e){var t,n=""+e,o=r.exec(n);if(!o)return n;var i="",a=0,s=0;for(a=o.index;a<n.length;a++){switch(n.charCodeAt(a)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}s!==a&&(i+=n.substring(s,a)),s=a+1,i+=t}return s!==a?i+n.substring(s,a):i}(e)}},function(e,t,n){"use strict";var r,o=n(25),i=n(247),a=n(844),s=n(430),u=n(845),c=n(251),l={},p=!1,f=0,h={topAbort:"abort",topAnimationEnd:u("animationend")||"animationend",topAnimationIteration:u("animationiteration")||"animationiteration",topAnimationStart:u("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:u("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},d="_reactListenersID"+String(Math.random()).slice(2);var m=o({},a,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(m.handleTopLevel),m.ReactEventListener=e}},setEnabled:function(e){m.ReactEventListener&&m.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!m.ReactEventListener||!m.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,r=function(e){return Object.prototype.hasOwnProperty.call(e,d)||(e[d]=f++,l[e[d]]={}),l[e[d]]}(n),o=i.registrationNameDependencies[e],a=0;a<o.length;a++){var s=o[a];r.hasOwnProperty(s)&&r[s]||("topWheel"===s?c("wheel")?m.ReactEventListener.trapBubbledEvent("topWheel","wheel",n):c("mousewheel")?m.ReactEventListener.trapBubbledEvent("topWheel","mousewheel",n):m.ReactEventListener.trapBubbledEvent("topWheel","DOMMouseScroll",n):"topScroll"===s?c("scroll",!0)?m.ReactEventListener.trapCapturedEvent("topScroll","scroll",n):m.ReactEventListener.trapBubbledEvent("topScroll","scroll",m.ReactEventListener.WINDOW_HANDLE):"topFocus"===s||"topBlur"===s?(c("focus",!0)?(m.ReactEventListener.trapCapturedEvent("topFocus","focus",n),m.ReactEventListener.trapCapturedEvent("topBlur","blur",n)):c("focusin")&&(m.ReactEventListener.trapBubbledEvent("topFocus","focusin",n),m.ReactEventListener.trapBubbledEvent("topBlur","focusout",n)),r.topBlur=!0,r.topFocus=!0):h.hasOwnProperty(s)&&m.ReactEventListener.trapBubbledEvent(s,h[s],n),r[s]=!0)}},trapBubbledEvent:function(e,t,n){return m.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return m.ReactEventListener.trapCapturedEvent(e,t,n)},supportsEventPageXY:function(){if(!document.createEvent)return!1;var e=document.createEvent("MouseEvent");return null!=e&&"pageX"in e},ensureScrollValueMonitoring:function(){if(void 0===r&&(r=m.supportsEventPageXY()),!r&&!p){var e=s.refreshScrollValues;m.ReactEventListener.monitorScrollValue(e),p=!0}}});e.exports=m},function(e,t,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(e){for(var t=this.__rules__.length,n=-1;t--;)if(this.__rules__[++n].name===e)return n;return-1},r.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},r.prototype.at=function(e,t,n){var r=this.__find__(e),o=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=o.alt||[],this.__cache__=null},r.prototype.before=function(e,t,n,r){var o=this.__find__(e),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},r.prototype.after=function(e,t,n,r){var o=this.__find__(e),i=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},r.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},r.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach(function(e){e.enabled=!1}),e.forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0},this),this.__cache__=null},r.prototype.disable=function(e){(e=Array.isArray(e)?e:[e]).forEach(function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1},this),this.__cache__=null},r.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i=-1,a=e.posMax,s=e.pos,u=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos<a;){if(91===(o=e.src.charCodeAt(e.pos)))n++;else if(93===o&&0===--n){r=!0;break}e.parser.skipToken(e)}return r?(i=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=s,e.isInLabel=u,i}},function(e,t,n){e.exports=n(774)},function(e,t,n){var r=n(192);function o(e,t,n,o,i,a,s){try{var u=e[a](s),c=u.value}catch(e){return void n(e)}u.done?t(c):r.resolve(c).then(o,i)}e.exports=function(e){return function(){var t=this,n=arguments;return new r(function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,u,"next",e)}function u(e){o(a,r,i,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";n.d(t,"b",function(){return p});var r=n(0),o=n.n(r),i=(n(10),n(195)),a=n.n(i),s=n(335),u=n.n(s),c=n(59),l=n.n(c);function p(e){return u.a.sanitize(e,{ADD_ATTR:["target"],FORBID_TAGS:["style"]})}u.a.addHook("beforeSanitizeElements",function(e){return e.href&&e.setAttribute("rel","noopener noreferrer"),e}),t.a=function(e){var t=e.source,n=e.className,r=void 0===n?"":n;if("string"!=typeof t)return null;var i=new a.a({html:!0,typographer:!0,breaks:!0,linkify:!0,linkTarget:"_blank"});i.core.ruler.disable(["replacements","smartquotes"]);var s=i.render(t),u=p(s);return t&&s&&u?o.a.createElement("div",{className:l()(r,"markdown"),dangerouslySetInnerHTML:{__html:u}}):null}},function(e,t,n){"use strict";e.exports=n(980)},function(e,t,n){"use strict";var r=n(20),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(9),d=n.n(h),m=n(8),v=n.n(m),g=n(2),y=n.n(g),b=n(0),_=n.n(b),w=n(1),x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,_.a.Component),E(t,[{key:"shouldComponentUpdate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.state||{};return!(this.updateOnProps||Object.keys(x({},e,this.props))).every(function(n){return Object(w.is)(e[n],t.props[n])})||!(this.updateOnStates||Object.keys(x({},n,r))).every(function(e){return Object(w.is)(n[e],r[e])})}}]),t}(),C=n(19),k=n.n(C),O=n(10),A=n.n(O);n.d(t,"a",function(){return T});var T=function(e){function t(){var e,n;a()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=l()(this,(e=f()(t)).call.apply(e,[this].concat(o))),y()(d()(n),"getModelName",function(e){return-1!==e.indexOf("#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==e.indexOf("#/components/schemas/")?e.replace(/^.*#\/components\/schemas\//,""):void 0}),y()(d()(n),"getRefSchema",function(e){return n.props.specSelectors.findDefinition(e)}),n}return v()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,r=e.getConfigs,i=e.specSelectors,a=e.schema,s=e.required,u=e.name,c=e.isRef,l=e.specPath,p=e.displayName,f=t("ObjectModel"),h=t("ArrayModel"),d=t("PrimitiveModel"),m="object",v=a&&a.get("$$ref");if(!u&&v&&(u=this.getModelName(v)),!a&&v&&(a=this.getRefSchema(u)),!a)return _.a.createElement("span",{className:"model model-title"},_.a.createElement("span",{className:"model-title__text"},p||u),_.a.createElement("img",{src:n(462),height:"20px",width:"20px",style:{marginLeft:"1em",position:"relative",bottom:"0px"}}));var g=i.isOAS3()&&a.get("deprecated");switch(c=void 0!==c?c:!!v,m=a&&a.get("type")||m){case"object":return _.a.createElement(f,o()({className:"object"},this.props,{specPath:l,getConfigs:r,schema:a,name:u,deprecated:g,isRef:c}));case"array":return _.a.createElement(h,o()({className:"array"},this.props,{getConfigs:r,schema:a,name:u,deprecated:g,required:s}));case"string":case"number":case"integer":case"boolean":default:return _.a.createElement(d,o()({},this.props,{getComponent:t,getConfigs:r,schema:a,name:u,deprecated:g,required:s}))}}}]),t}(S);y()(T,"propTypes",{schema:k.a.orderedMap.isRequired,getComponent:A.a.func.isRequired,getConfigs:A.a.func.isRequired,specSelectors:A.a.object.isRequired,name:A.a.string,displayName:A.a.string,isRef:A.a.bool,required:A.a.bool,expandDepth:A.a.number,depth:A.a.number,specPath:k.a.list.isRequired})},function(e,t,n){var r=n(72),o=n(41),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(198)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(98),o=n(41).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(127),o=n(73);e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(i=s.charCodeAt(u))<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):i:e?s.slice(u,u+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){var r=n(197)("keys"),o=n(199);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(151).f,o=n(152),i=n(33)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(45),o=n(154),i=n(33)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},function(e,t,n){"use strict";var r=n(154);function o(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new o(e)}},function(e,t,n){var r=n(347),o=n(73);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(e))}},function(e,t,n){var r=n(33)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){"use strict";var r=n(201)(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},function(e,t,n){"use strict";var r,o,i=n(547),a=RegExp.prototype.exec,s=String.prototype.replace,u=a,c=(r=/a/,o=/b*/g,a.call(r,"a"),a.call(o,"a"),0!==r.lastIndex||0!==o.lastIndex),l=void 0!==/()??/.exec("")[1];(c||l)&&(u=function(e){var t,n,r,o,u=this;return l&&(n=new RegExp("^"+u.source+"$(?!\\s)",i.call(u))),c&&(t=u.lastIndex),r=a.call(u,e),c&&r&&(u.lastIndex=u.global?r.index+r[0].length:t),l&&r&&r.length>1&&s.call(r[0],n,function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)}),r}),e.exports=u},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(130);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(214)("keys"),o=n(159);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(22),o=n(32),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(131)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(30),o=n(22),i=n(82);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},function(e,t,n){var r=n(43),o=n(32).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(43);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){"use strict";var r=n(131),o=n(30),i=n(220),a=n(77),s=n(102),u=n(560),c=n(134),l=n(352),p=n(34)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,d,m,v,g){u(n,t,d);var y,b,_,w=function(e){if(!f&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",E="values"==m,S=!1,C=e.prototype,k=C[p]||C["@@iterator"]||m&&C[m],O=k||w(m),A=m?E?w("entries"):O:void 0,T="Array"==t&&C.entries||k;if(T&&(_=l(T.call(new e)))!==Object.prototype&&_.next&&(c(_,x,!0),r||"function"==typeof _[p]||a(_,p,h)),E&&k&&"values"!==k.name&&(S=!0,O=function(){return k.call(this)}),r&&!g||!f&&!S&&C[p]||a(C,p,O),s[t]=O,s[x]=h,m)if(y={values:E?O:w("values"),keys:v?O:w("keys"),entries:A},g)for(b in y)b in C||i(C,b,y[b]);else o(o.P+o.F*(f||S),t,y);return y}},function(e,t,n){e.exports=n(77)},function(e,t,n){t.f=n(34)},function(e,t,n){var r=n(32),o=n(22),i=n(131),a=n(221),s=n(49).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(130);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(348),o=n(215).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){var r=n(166),o=n(34)("iterator"),i=n(102);e.exports=n(22).getIteratorMethod=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t,n){var r=n(618),o=n(634),i=n(636),a=n(637),s=n(638);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(84)(n(51),"Map");e.exports=r},function(e,t,n){var r=n(169),o=n(642),i=n(643),a=n(644),s=n(645),u=n(646);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(656),o=n(379),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return i.call(e,t)}))}:o;e.exports=s},function(e,t,n){var r=n(658),o=n(66),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},function(e,t,n){(function(e){var r=n(51),o=n(659),i=t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;e.exports=u}).call(this,n(173)(e))},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(366),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s}).call(this,n(173)(e))},function(e,t,n){var r=n(37),o=n(167),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||(a.test(e)||!i.test(e)||null!=t&&e in Object(t))}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var o,i,a,s;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=c(e))>0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,i(this.listener,this.target,e))}.bind(r);return o.listener=n,r.wrapFn=o,o}function f(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):d(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function d(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else{var c=u.length,l=d(u,c);for(n=0;n<c;++n)i(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,o,i,a;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(390)).Stream=t,t.Readable=t,t.Writable=n(240),t.Duplex=n(86),t.Transform=n(395),t.PassThrough=n(691)},function(e,t,n){"use strict";(function(t,r,o){var i=n(178);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;y.WritableState=g;var c=n(137);c.inherits=n(47);var l={deprecate:n(690)},p=n(391),f=n(48).Buffer,h=o.Uint8Array||function(){};var d,m=n(392);function v(){}function g(e,t){s=s||n(86),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var p=!1===e.decodeStrings;this.decodeStrings=!p,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,o);else{var a=x(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?u(_,e,n,a,o):_(e,n,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||n(86),!(d.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),p.call(this)}function b(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function _(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,u=!0;n;)o[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;o.allBuffers=u,b(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,p=n.callback;if(b(e,t,!1,t.objectMode?1:c.length,c,l,p),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)})}function S(e,t){var n=x(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(y,p),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):d=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=e,f.isBuffer(r)||r instanceof h);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=v),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,s,r,o,i);return u}(this,o,s,e,t,n)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(67),n(393).setImmediate,n(36))},function(e,t,n){"use strict";e.exports=function(e){return"function"==typeof e}},function(e,t,n){"use strict";e.exports=n(716)()?Array.from:n(717)},function(e,t,n){"use strict";var r=n(730),o=n(88),i=n(110),a=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,u=Math.abs,c=Math.floor;e.exports=function(e){var t,n,l,p;if(!r(e))return a.apply(this,arguments);for(n=o(i(this).length),l=arguments[1],t=l=isNaN(l)?0:l>=0?c(l):o(this.length)-c(u(l));t<n;++t)if(s.call(this,t)&&(p=this[t],r(p)))return t;return-1}},function(e,t,n){"use strict";(function(t,n){var r,o;r=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},o=function(e){var t,n,o=document.createTextNode(""),i=0;return new e(function(){var e;if(t)n&&(t=n.concat(t));else{if(!n)return;t=n}if(n=t,t=null,"function"==typeof n)return e=n,n=null,void e();for(o.data=i=++i%2;n;)e=n.shift(),n.length||(n=null),e()}).observe(o,{characterData:!0}),function(e){r(e),t?"function"==typeof t?t=[t,e]:t.push(e):(t=e,o.data=i=++i%2)}},e.exports=function(){if("object"==typeof t&&t&&"function"==typeof t.nextTick)return t.nextTick;if("object"==typeof document&&document){if("function"==typeof MutationObserver)return o(MutationObserver);if("function"==typeof WebKitMutationObserver)return o(WebKitMutationObserver)}return"function"==typeof n?function(e){n(r(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(r(e),0)}:null}()}).call(this,n(67),n(393).setImmediate)},function(e,t,n){"use strict";var r=n(132);function o(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new o(e)}},function(e,t,n){"use strict";var r=n(114);e.exports=new r({explicit:[n(785),n(786),n(787)]})},function(e,t,n){"use strict";var r=n(21),o=(n(15),null),i={};function a(){if(o)for(var e in i){var t=i[e],n=o.indexOf(e);if(n>-1||r("96",e),!c.plugins[n]){t.extractEvents||r("97",e),c.plugins[n]=t;var a=t.eventTypes;for(var u in a)s(a[u],t,u)||r("98",u,e)}}}function s(e,t,n){c.eventNameDispatchConfigs.hasOwnProperty(n)&&r("99",n),c.eventNameDispatchConfigs[n]=e;var o=e.phasedRegistrationNames;if(o){for(var i in o){if(o.hasOwnProperty(i))u(o[i],t,n)}return!0}return!!e.registrationName&&(u(e.registrationName,t,n),!0)}function u(e,t,n){c.registrationNameModules[e]&&r("100",e),c.registrationNameModules[e]=t,c.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){o&&r("101"),o=Array.prototype.slice.call(e),a()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];i.hasOwnProperty(n)&&i[n]===o||(i[n]&&r("102",n),i[n]=o,t=!0)}t&&a()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=c.registrationNameModules[n[r]];if(o)return o}}return null},_resetEventPlugins:function(){for(var e in o=null,i)i.hasOwnProperty(e)&&delete i[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=c.registrationNameModules;for(var a in r)r.hasOwnProperty(a)&&delete r[a]}};e.exports=c},function(e,t,n){"use strict";var r,o,i=n(21),a=n(249);n(15),n(23);function s(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=u.getNodeFromInstance(r),t?a.invokeGuardedCallbackWithCatch(o,n,e):a.invokeGuardedCallback(o,n,e),e.currentTarget=null}var u={isEndish:function(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e},isMoveish:function(e){return"topMouseMove"===e||"topTouchMove"===e},isStartish:function(e){return"topMouseDown"===e||"topTouchStart"===e},executeDirectDispatch:function(e){var t=e._dispatchListeners,n=e._dispatchInstances;Array.isArray(t)&&i("103"),e.currentTarget=t?u.getNodeFromInstance(n):null;var r=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,r},executeDispatchesInOrder:function(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)s(e,t,n[o],r[o]);else n&&s(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null},executeDispatchesInOrderStopAtTrue:function(e){var t=function(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}(e);return e._dispatchInstances=null,e._dispatchListeners=null,t},hasDispatches:function(e){return!!e._dispatchListeners},getInstanceFromNode:function(e){return r.getInstanceFromNode(e)},getNodeFromInstance:function(e){return r.getNodeFromInstance(e)},isAncestor:function(e,t){return o.isAncestor(e,t)},getLowestCommonAncestor:function(e,t){return o.getLowestCommonAncestor(e,t)},getParentInstance:function(e){return o.getParentInstance(e)},traverseTwoPhase:function(e,t,n){return o.traverseTwoPhase(e,t,n)},traverseEnterLeave:function(e,t,n,r,i){return o.traverseEnterLeave(e,t,n,r,i)},injection:{injectComponentTree:function(e){r=e},injectTreeTraversal:function(e){o=e}}};e.exports=u},function(e,t,n){"use strict";var r=null;function o(e,t,n){try{t(n)}catch(e){null===r&&(r=e)}}var i={invokeGuardedCallback:o,invokeGuardedCallbackWithCatch:o,rethrowCaughtError:function(){if(r){var e=r;throw r=null,e}}};e.exports=i},function(e,t,n){"use strict";e.exports=function(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}},function(e,t,n){"use strict";var r,o=n(38);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")) +/** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, @@ -48,52 +62,73 @@ function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}func * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT + */,e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"==typeof a[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},function(e,t,n){"use strict";var r={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o(e){var t=this.nativeEvent;if(t.getModifierState)return t.getModifierState(e);var n=r[e];return!!n&&!!t[n]}e.exports=function(e){return o}},function(e,t,n){"use strict";var r=n(117),o=n(829),i=(n(27),n(53),n(255)),a=n(187),s=n(431);function u(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}var c=i(function(e,t,n){e.insertBefore(t,n)});function l(e,t,n){r.insertTreeBefore(e,t,n)}function p(e,t,n){Array.isArray(t)?function(e,t,n,r){var o=t;for(;;){var i=o.nextSibling;if(c(e,o,r),o===n)break;o=i}}(e,t[0],t[1],n):c(e,t,n)}function f(e,t){if(Array.isArray(t)){var n=t[1];h(e,t=t[0],n),e.removeChild(n)}e.removeChild(t)}function h(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}var d={dangerouslyReplaceNodeWithMarkup:o.dangerouslyReplaceNodeWithMarkup,replaceDelimitedText:function(e,t,n){var r=e.parentNode,o=e.nextSibling;o===t?n&&c(r,document.createTextNode(n),o):n?(s(o,n),h(r,o,t)):h(r,e,t)},processUpdates:function(e,t){for(var n=0;n<t.length;n++){var r=t[n];switch(r.type){case"INSERT_MARKUP":l(e,r.content,u(e,r.afterNode));break;case"MOVE_EXISTING":p(e,r.fromNode,u(e,r.afterNode));break;case"SET_MARKUP":a(e,r.content);break;case"TEXT_CONTENT":s(e,r.content);break;case"REMOVE_NODE":f(e,r.fromNode)}}}};e.exports=d},function(e,t,n){"use strict";e.exports={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}},function(e,t,n){"use strict";e.exports=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}},function(e,t,n){"use strict";var r=n(21),o=n(847),i=n(361)(n(104).isValidElement),a=(n(15),n(23),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0});function s(e){null!=e.checkedLink&&null!=e.valueLink&&r("87")}function u(e){s(e),(null!=e.value||null!=e.onChange)&&r("88")}function c(e){s(e),(null!=e.checked||null!=e.onChange)&&r("89")}var l={value:function(e,t,n){return!e[t]||a[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:i.func},p={};function f(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var h={checkPropTypes:function(e,t,n){for(var r in l){if(l.hasOwnProperty(r))var i=l[r](t,r,e,"prop",null,o);if(i instanceof Error&&!(i.message in p)){p[i.message]=!0;f(n)}}},getValue:function(e){return e.valueLink?(u(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(c(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(u(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(c(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};e.exports=h},function(e,t,n){"use strict";var r=n(21),o=(n(15),!1),i={replaceNodeWithMarkup:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){o&&r("104"),i.replaceNodeWithMarkup=e.replaceNodeWithMarkup,i.processChildrenUpdates=e.processChildrenUpdates,o=!0}}};e.exports=i},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}e.exports=function(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var a=0;a<n.length;a++)if(!r.call(t,n[a])||!o(e[n[a]],t[n[a]]))return!1;return!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n=null===e||!1===e,r=null===t||!1===t;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}},function(e,t,n){"use strict";var r={escape:function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})},unescape:function(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}};e.exports=r},function(e,t,n){"use strict";var r=n(21),o=(n(65),n(143)),i=(n(53),n(58));n(15),n(23);function a(e){i.enqueueUpdate(e)}function s(e,t){var n=o.get(e);return n||null}var u={isMounted:function(e){var t=o.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){u.validateCallback(t,n);var r=s(e);if(!r)return null;r._pendingCallbacks?r._pendingCallbacks.push(t):r._pendingCallbacks=[t],a(r)},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],a(e)},enqueueForceUpdate:function(e){var t=s(e);t&&(t._pendingForceUpdate=!0,a(t))},enqueueReplaceState:function(e,t,n){var r=s(e);r&&(r._pendingStateQueue=[t],r._pendingReplaceState=!0,null!=n&&(u.validateCallback(n,"replaceState"),r._pendingCallbacks?r._pendingCallbacks.push(n):r._pendingCallbacks=[n]),a(r))},enqueueSetState:function(e,t){var n=s(e);n&&((n._pendingStateQueue||(n._pendingStateQueue=[])).push(t),a(n))},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,a(e)},validateCallback:function(e,t){e&&"function"!=typeof e&&r("122",t,function(e){var t=typeof e;if("object"!==t)return t;var n=e.constructor&&e.constructor.name||t,r=Object.keys(e);return r.length>0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}(e))}};e.exports=u},function(e,t,n){"use strict";n(25);var r=n(57),o=(n(23),r);e.exports=o},function(e,t,n){"use strict";e.exports=function(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,t>=32||13===t?t:0}},function(e,t,n){var r=n(83),o=n(265),i=n(66),a="[object Object]",s=Function.prototype,u=Object.prototype,c=s.toString,l=u.hasOwnProperty,p=c.call(Object);e.exports=function(e){if(!i(e)||r(e)!=a)return!1;var t=o(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==p}},function(e,t,n){var r=n(382)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(376);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t){ +/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017 Joachim Wester + * MIT license */ -function r(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&i&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var i,o=n(25);o.canUseDOM&&(i=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=null===e||!1===e,r=null===t||!1===t;if(n||r)return n===r;var i=typeof e,o=typeof t;return"string"===i||"number"===i?"string"===o||"number"===o:"object"===o&&e.type===t.type&&e.key===t.key}e.exports=r},function(e,t,n){"use strict";var r=(n(13),n(32)),i=(n(10),r);e.exports=i},function(e,t,n){"use strict";function r(e){switch(e._type){case"Document":case"BlockQuote":case"List":case"Item":case"Paragraph":case"Heading":case"Emph":case"Strong":case"Link":case"Image":case"CustomInline":case"CustomBlock":return!0;default:return!1}}var i=function(e,t){this.current=e,this.entering=!0===t},o=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=r(e);return t&&n?e._firstChild?(this.current=e._firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e._next?(this.current=e._parent,this.entering=!1):(this.current=e._next,this.entering=!0),{entering:t,node:e}},a=function(e){return{current:e,root:e,entering:!0,next:o,resumeAt:i}},s=function(e,t){this._type=e,this._parent=null,this._firstChild=null,this._lastChild=null,this._prev=null,this._next=null,this._sourcepos=t,this._lastLineBlank=!1,this._open=!0,this._string_content=null,this._literal=null,this._listData={},this._info=null,this._destination=null,this._title=null,this._isFenced=!1,this._fenceChar=null,this._fenceLength=0,this._fenceOffset=null,this._level=null,this._onEnter=null,this._onExit=null},u=s.prototype;Object.defineProperty(u,"isContainer",{get:function(){return r(this)}}),Object.defineProperty(u,"type",{get:function(){return this._type}}),Object.defineProperty(u,"firstChild",{get:function(){return this._firstChild}}),Object.defineProperty(u,"lastChild",{get:function(){return this._lastChild}}),Object.defineProperty(u,"next",{get:function(){return this._next}}),Object.defineProperty(u,"prev",{get:function(){return this._prev}}),Object.defineProperty(u,"parent",{get:function(){return this._parent}}),Object.defineProperty(u,"sourcepos",{get:function(){return this._sourcepos}}),Object.defineProperty(u,"literal",{get:function(){return this._literal},set:function(e){this._literal=e}}),Object.defineProperty(u,"destination",{get:function(){return this._destination},set:function(e){this._destination=e}}),Object.defineProperty(u,"title",{get:function(){return this._title},set:function(e){this._title=e}}),Object.defineProperty(u,"info",{get:function(){return this._info},set:function(e){this._info=e}}),Object.defineProperty(u,"level",{get:function(){return this._level},set:function(e){this._level=e}}),Object.defineProperty(u,"listType",{get:function(){return this._listData.type},set:function(e){this._listData.type=e}}),Object.defineProperty(u,"listTight",{get:function(){return this._listData.tight},set:function(e){this._listData.tight=e}}),Object.defineProperty(u,"listStart",{get:function(){return this._listData.start},set:function(e){this._listData.start=e}}),Object.defineProperty(u,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(e){this._listData.delimiter=e}}),Object.defineProperty(u,"onEnter",{get:function(){return this._onEnter},set:function(e){this._onEnter=e}}),Object.defineProperty(u,"onExit",{get:function(){return this._onExit},set:function(e){this._onExit=e}}),s.prototype.appendChild=function(e){e.unlink(),e._parent=this,this._lastChild?(this._lastChild._next=e,e._prev=this._lastChild,this._lastChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.prependChild=function(e){e.unlink(),e._parent=this,this._firstChild?(this._firstChild._prev=e,e._next=this._firstChild,this._firstChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.unlink=function(){this._prev?this._prev._next=this._next:this._parent&&(this._parent._firstChild=this._next),this._next?this._next._prev=this._prev:this._parent&&(this._parent._lastChild=this._prev),this._parent=null,this._next=null,this._prev=null},s.prototype.insertAfter=function(e){e.unlink(),e._next=this._next,e._next&&(e._next._prev=e),e._prev=this,this._next=e,e._parent=this._parent,e._next||(e._parent._lastChild=e)},s.prototype.insertBefore=function(e){e.unlink(),e._prev=this._prev,e._prev&&(e._prev._next=e),e._next=this,this._prev=e,e._parent=this._parent,e._prev||(e._parent._firstChild=e)},s.prototype.walker=function(){return new a(this)},e.exports=s},function(e,t,n){"use strict";function r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=0);return t}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(0!==n[r])return!1;var i="number"==typeof t[r]?t[r]:t[r].val;if(e[r]!==i)return!1}return!0}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r,o,a,s){var u=-o*(t-r),l=-a*n,c=u+l,p=n+c*e,f=t+p*e;return Math.abs(p)<s&&Math.abs(f-r)<s?(i[0]=r,i[1]=0,i):(i[0]=f,i[1]=p,i)}t.__esModule=!0,t.default=r;var i=[0,0];e.exports=t.default},function(e,t,n){var r=n(1097),i=n(1);e.exports=function(e,t,n){var i=e[t];if(i){var o=[];if(Object.keys(i).forEach(function(e){-1===r.indexOf(e)&&o.push(e)}),o.length)throw new Error("Prop "+t+" passed to "+n+". Has invalid keys "+o.join(", "))}},e.exports.isRequired=function(t,n,r){if(!t[n])throw new Error("Prop "+n+" passed to "+r+" is required");return e.exports(t,n,r)},e.exports.supportingArrays=i.oneOfType([i.arrayOf(e.exports),e.exports])},function(e,t,n){"use strict";(function(t,r,i){function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){A(t,e)}}function a(e){return R.from(e)}function s(e){return R.isBuffer(e)||e instanceof j}function u(){}function l(e,t){O=O||n(71),e=e||{},this.objectMode=!!e.objectMode,t instanceof O&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){y(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function c(e){if(O=O||n(71),!(N.call(c,this)||this instanceof O))return new c(e);this._writableState=new l(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),I.call(this)}function p(e,t){var n=new Error("write after end");e.emit("error",n),D(t,n)}function f(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),D(r,o),i=!1),i}function h(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=R.from(t,n)),t}function d(e,t,n,r,i,o){if(!n){var a=h(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,s,r,i,o);return u}function m(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function v(e,t,n,r,i){--t.pendingcb,n?(D(i,r),D(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}function g(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function y(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(g(n),t)v(e,n,r,t,i);else{var o=w(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||x(e,n),r?M(_,e,n,o,i):_(e,n,o,i)}}function _(e,t,n,r){n||b(e,t),t.pendingcb--,r(),S(e,t)}function b(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function x(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,m(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t)}else{for(;n;){var l=n.chunk,c=n.encoding,p=n.callback;if(m(e,t,!1,t.objectMode?1:l.length,l,c,p),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function w(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)})}function E(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,D(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function S(e,t){var n=w(t);return n&&(E(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}function C(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?D(n):e.once("finish",n)),t.ended=!0,e.writable=!1}function A(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}var D=n(158);e.exports=c;var O,M=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:D;c.WritableState=l;var T=n(111);T.inherits=n(42);var P={deprecate:n(1191)},I=n(482),R=n(167).Buffer,j=i.Uint8Array||function(){},F=n(481);T.inherits(c,I),l.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(l.prototype,"buffer",{get:P.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var N;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(N=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(e){return!!N.call(this,e)||e&&e._writableState instanceof l}})):N=function(e){return e instanceof this},c.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},c.prototype.write=function(e,t,n){var r=this._writableState,i=!1,o=s(e)&&!r.objectMode;return o&&!R.isBuffer(e)&&(e=a(e)),"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=u),r.ended?p(this,n):(o||f(this,r,e,n))&&(r.pendingcb++,i=d(this,r,o,e,t,n)),i},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||x(this,e))},c.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},c.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},c.prototype._writev=null,c.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||C(this,r,n)},Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),c.prototype.destroy=F.destroy,c.prototype._undestroy=F.undestroy,c.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,n(33),n(496).setImmediate,n(17))},function(e,t,n){t=e.exports=n(479),t.Stream=t,t.Readable=t,t.Writable=n(261),t.Duplex=n(71),t.Transform=n(480),t.PassThrough=n(1111)},function(e,t,n){"use strict";function r(e,t,n,r,i){this.src=e,this.env=r,this.options=n,this.parser=t,this.tokens=i,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}r.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},r.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},r.prototype.cacheSet=function(e,t){for(var n=this.cache.length;n<=e;n++)this.cache.push(0);this.cache[e]=t},r.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0},e.exports=r},function(e,t,n){"use strict";function r(e,t){var n;return n=Array.isArray(e)?[]:{},t.push(e),Object.keys(e).forEach(function(i){var o=e[i];if("function"!=typeof o)return o&&"object"==typeof o?-1===t.indexOf(e[i])?void(n[i]=r(e[i],t.slice(0))):void(n[i]="[Circular]"):void(n[i]=o)}),n}e.exports=function(e){if("object"==typeof e){var t=r(e,[]);return"string"==typeof e.name&&(t.name=e.name),"string"==typeof e.message&&(t.message=e.message),"string"==typeof e.stack&&(t.stack=e.stack),t}return"function"==typeof e?"[Function: "+(e.name||"anonymous")+"]":e}},function(e,t,n){"use strict";function r(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function i(e){var t=r(e);if("string"!=typeof t&&(y.isEncoding===_||!_(e)))throw new Error("Unknown encoding: "+e);return t||e}function o(e){this.encoding=i(e);var t;switch(this.encoding){case"utf16le":this.text=f,this.end=h,t=4;break;case"utf8":this.fillLast=l,t=4;break;case"base64":this.text=d,this.end=m,t=3;break;default:return this.write=v,void(this.end=g)}this.lastNeed=0,this.lastTotal=0,this.lastChar=y.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function s(e,t,n){var r=t.length-1;if(r<n)return 0;var i=a(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n?0:(i=a(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n?0:(i=a(t[r]),i>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0)}function u(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(n);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(n+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(n+2)}}function l(e){var t=this.lastTotal-this.lastNeed,n=u(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�".repeat(this.lastTotal-this.lastNeed):t}function f(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function h(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function d(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function g(e){return e&&e.length?this.write(e):""}var y=n(167).Buffer,_=y.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},o.prototype.end=p,o.prototype.text=c,o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){(function(){var e,t,r,i=function(e,t){function n(){this.constructor=e}for(var r in t)o.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},o={}.hasOwnProperty,a=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};t=n(94),r=n(61),e=n(45).YAMLError,this.ResolverError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return i(t,e),t}(e),this.BaseResolver=function(){function e(){this.resolver_exact_paths=[],this.resolver_prefix_paths=[]}var n,i,o;return i="tag:yaml.org,2002:str",o="tag:yaml.org,2002:seq",n="tag:yaml.org,2002:map",e.prototype.yaml_implicit_resolvers={},e.prototype.yaml_path_resolvers={},e.add_implicit_resolver=function(e,t,n){var i,o,a,s,u;for(null==n&&(n=[null]),this.prototype.hasOwnProperty("yaml_implicit_resolvers")||(this.prototype.yaml_implicit_resolvers=r.extend({},this.prototype.yaml_implicit_resolvers)),u=[],a=0,s=n.length;a<s;a++)o=n[a],u.push((null!=(i=this.prototype.yaml_implicit_resolvers)[o]?i[o]:i[o]=[]).push([e,t]));return u},e.prototype.descend_resolver=function(e,t){var n,i,o,a,s,u,l,c,p,f,h,d,m;if(!r.is_empty(this.yaml_path_resolvers)){if(i={},p=[],e)for(n=this.resolver_prefix_paths.length,f=this.resolver_prefix_paths.slice(-1)[0],o=0,u=f.length;o<u;o++)h=f[o],c=h[0],s=h[1],this.check_resolver_prefix(n,c,s,e,t)&&(c.length>n?p.push([c,s]):i[s]=this.yaml_path_resolvers[c][s]);else for(d=this.yaml_path_resolvers,a=0,l=d.length;a<l;a++)m=d[a],c=m[0],s=m[1],c?p.push([c,s]):i[s]=this.yaml_path_resolvers[c][s];return this.resolver_exact_paths.push(i),this.resolver_prefix_paths.push(p)}},e.prototype.ascend_resolver=function(){if(!r.is_empty(this.yaml_path_resolvers))return this.resolver_exact_paths.pop(),this.resolver_prefix_paths.pop()},e.prototype.check_resolver_prefix=function(e,n,r,i,o){var a,s,u;if(u=n[e-1],s=u[0],a=u[1],"string"==typeof s){if(i.tag!==s)return}else if(null!==s&&!(i instanceof s))return;if((!0!==a||null===o)&&(!1!==a&&null!==a||null!==o)){if("string"==typeof a){if(!(o instanceof t.ScalarNode)&&a===o.value)return}else if("number"==typeof a&&a!==o)return;return!0}},e.prototype.resolve=function(e,r,s){var u,l,c,p,f,h,d,m,v,g,y,_;if(e===t.ScalarNode&&s[0]){for(y=""===r?null!=(h=this.yaml_implicit_resolvers[""])?h:[]:null!=(d=this.yaml_implicit_resolvers[r[0]])?d:[],y=y.concat(null!=(m=this.yaml_implicit_resolvers[null])?m:[]),c=0,f=y.length;c<f;c++)if(v=y[c],_=v[0],g=v[1],r.match(g))return _;s=s[1]}u=!0;for(p in this.yaml_path_resolvers)null=={}[p]&&(u=!1);if(!u){if(l=this.resolver_exact_paths.slice(-1)[0],a.call(l,e)>=0)return l[e];if(a.call(l,null)>=0)return l[null]}return e===t.ScalarNode?i:e===t.SequenceNode?o:e===t.MappingNode?n:void 0},e}(),this.Resolver=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return i(t,e),t}(this.BaseResolver),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:bool",/^(?:yes|Yes|YES|true|True|TRUE|on|On|ON|no|No|NO|false|False|FALSE|off|Off|OFF)$/,"yYnNtTfFoO"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:float",/^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)?|\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/,"-+0123456789."),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:int",/^(?:[-+]?0b[01_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[0-9a-fA-F_]+|[-+]?0o[0-7_]+|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$/,"-+0123456789"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:merge",/^(?:<<)$/,"<"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:null",/^(?:~|null|Null|NULL|)$/,["~","n","N",""]),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:timestamp",/^(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]|[0-9][0-9][0-9][0-9]-[0-9][0-9]?-[0-9][0-9]?(?:[Tt]|[\x20\t]+)[0-9][0-9]?:[0-9][0-9]:[0-9][0-9](?:\.[0-9]*)?(?:[\x20\t]*(?:Z|[-+][0-9][0-9]?(?::[0-9][0-9])?))?)$/,"0123456789"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:value",/^(?:=)$/,"="),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:yaml",/^(?:!|&|\*)$/,"!&*")}).call(this)},function(e,t){(function(){var e=function(e,n){function r(){this.constructor=e}for(var i in n)t.call(n,i)&&(e[i]=n[i]);return r.prototype=n.prototype,e.prototype=new r,e.__super__=n.prototype,e},t={}.hasOwnProperty;this.Token=function(){function e(e,t){this.start_mark=e,this.end_mark=t}return e}(),this.DirectiveToken=function(t){function n(e,t,n,r){this.name=e,this.value=t,this.start_mark=n,this.end_mark=r}return e(n,t),n.prototype.id="<directive>",n}(this.Token),this.DocumentStartToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<document start>",n}(this.Token),this.DocumentEndToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<document end>",n}(this.Token),this.StreamStartToken=function(t){function n(e,t,n){this.start_mark=e,this.end_mark=t,this.encoding=n}return e(n,t),n.prototype.id="<stream start>",n}(this.Token),this.StreamEndToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<stream end>",n}(this.Token),this.BlockSequenceStartToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<block sequence start>",n}(this.Token),this.BlockMappingStartToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<block mapping end>",n}(this.Token),this.BlockEndToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="<block end>",n}(this.Token),this.FlowSequenceStartToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="[",n}(this.Token),this.FlowMappingStartToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="{",n}(this.Token),this.FlowSequenceEndToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="]",n}(this.Token),this.FlowMappingEndToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="}",n}(this.Token),this.KeyToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="?",n}(this.Token),this.ValueToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id=":",n}(this.Token),this.BlockEntryToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id="-",n}(this.Token),this.FlowEntryToken=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return e(n,t),n.prototype.id=",",n}(this.Token),this.AliasToken=function(t){function n(e,t,n){this.value=e,this.start_mark=t,this.end_mark=n}return e(n,t),n.prototype.id="<alias>",n}(this.Token),this.AnchorToken=function(t){function n(e,t,n){this.value=e,this.start_mark=t,this.end_mark=n}return e(n,t),n.prototype.id="<anchor>",n}(this.Token),this.TagToken=function(t){function n(e,t,n){this.value=e,this.start_mark=t,this.end_mark=n}return e(n,t),n.prototype.id="<tag>",n}(this.Token),this.ScalarToken=function(t){function n(e,t,n,r,i){this.value=e,this.plain=t,this.start_mark=n,this.end_mark=r,this.style=i}return e(n,t),n.prototype.id="<scalar>",n}(this.Token)}).call(this)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return!!e}).join(" ").trim()}Object.defineProperty(t,"__esModule",{value:!0}),t.Collapse=t.Link=t.Select=t.Input=t.TextArea=t.Button=t.Row=t.Col=t.Container=void 0;var o=n(21),a=r(o),s=n(96),u=r(s),l=n(4),c=r(l),p=n(2),f=r(p),h=n(3),d=r(h),m=n(6),v=r(m),g=n(5),y=r(g),_=n(0),b=r(_),x=n(1),w=r(x),k=n(448);(t.Container=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,t=e.fullscreen,n=e.full,r=(0,u.default)(e,["fullscreen","full"]);if(t)return b.default.createElement("section",r);var o="swagger-container"+(n?"-full":"");return b.default.createElement("section",(0,a.default)({},r,{className:i(r.className,o)}))}}]),t}(b.default.Component)).propTypes={fullscreen:w.default.bool,full:w.default.bool,className:w.default.string};var E={mobile:"",tablet:"-tablet",desktop:"-desktop",large:"-hd"};(t.Col=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,t=e.hide,n=e.keepContents,r=(e.mobile,e.tablet,e.desktop,e.large,(0,u.default)(e,["hide","keepContents","mobile","tablet","desktop","large"]));if(t&&!n)return b.default.createElement("span",null);var o=[];for(var s in E)if(E.hasOwnProperty(s)){var l=E[s];if(s in this.props){var c=this.props[s];if(c<1){o.push("none"+l);continue}o.push("block"+l),o.push("col-"+c+l)}}var p=i.apply(void 0,[r.className].concat(o));return b.default.createElement("section",(0,a.default)({},r,{style:{display:t?"none":null},className:p}))}}]),t}(b.default.Component)).propTypes={hide:w.default.bool,keepContents:w.default.bool,mobile:w.default.number,tablet:w.default.number,desktop:w.default.number,large:w.default.number,className:w.default.string},(t.Row=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){return b.default.createElement("div",(0,a.default)({},this.props,{className:i(this.props.className,"wrapper")}))}}]),t}(b.default.Component)).propTypes={className:w.default.string};var S=t.Button=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){return b.default.createElement("button",(0,a.default)({},this.props,{className:i(this.props.className,"button")}))}}]),t}(b.default.Component);S.propTypes={className:w.default.string},S.defaultProps={className:""};var C=(t.TextArea=function(e){return b.default.createElement("textarea",e)},t.Input=function(e){return b.default.createElement("input",e)},t.Select=function(e){function t(e,n){(0,f.default)(this,t);var r=(0,v.default)(this,(t.__proto__||(0,c.default)(t)).call(this,e,n));A.call(r);var i=void 0;return i=e.value?e.value:e.multiple?[""]:"",r.state={value:i},r}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){var e=this.props,t=e.allowedValues,n=e.multiple,r=e.allowEmptyValue,i=this.state.value.toJS?this.state.value.toJS():this.state.value;return b.default.createElement("select",{className:this.props.className,multiple:n,value:i,onChange:this.onChange},r?b.default.createElement("option",{value:""},"--"):null,t.map(function(e,t){return b.default.createElement("option",{key:t,value:String(e)},String(e))}))}}]),t}(b.default.Component));C.propTypes={allowedValues:w.default.array,value:w.default.any,onChange:w.default.func,multiple:w.default.bool,allowEmptyValue:w.default.bool,className:w.default.string},C.defaultProps={multiple:!1,allowEmptyValue:!0};var A=function(){var e=this;this.onChange=function(t){var n=e.props,r=n.onChange,i=n.multiple,o=[].slice.call(t.target.options),a=void 0;a=i?o.filter(function(e){return e.selected}).map(function(e){return e.value}):t.target.value,e.setState({value:a}),r&&r(a)}};(t.Link=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"render",value:function(){return b.default.createElement("a",(0,a.default)({},this.props,{className:i(this.props.className,"link")}))}}]),t}(b.default.Component)).propTypes={className:w.default.string};var D=function(e){var t=e.children;return b.default.createElement("div",{style:{height:"auto",border:"none",margin:0,padding:0}}," ",t," ")};D.propTypes={children:w.default.node};var O=t.Collapse=function(e){function t(){return(0,f.default)(this,t),(0,v.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,d.default)(t,[{key:"renderNotAnimated",value:function(){return this.props.isOpened?b.default.createElement(D,null,this.props.children):b.default.createElement("noscript",null)}},{key:"render",value:function(){var e=this.props,t=e.animated,n=e.isOpened,r=e.children;return t?(r=n?r:null,b.default.createElement(k.Collapse,{isOpened:n},b.default.createElement(D,null,r))):this.renderNotAnimated()}}]),t}(b.default.Component);O.propTypes={isOpened:w.default.bool,children:w.default.node.isRequired,animated:w.default.bool},O.defaultProps={isOpened:!1,animated:!1}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1072),_=r(y),b=n(12),x=r(b),w=n(1),k=r(w),E=function(e){function t(){var e,n,r,i;(0,l.default)(this,t);for(var o=arguments.length,a=Array(o),u=0;u<o;u++)a[u]=arguments[u];return n=r=(0,h.default)(this,(e=t.__proto__||(0,s.default)(t)).call.apply(e,[this].concat(a))),r.getModelName=function(e){return-1!==e.indexOf("#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==e.indexOf("#/components/schemas/")?e.replace("#/components/schemas/",""):void 0},r.getRefSchema=function(e){return r.props.specSelectors.findDefinition(e)},i=n,(0,h.default)(r,i)}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.getConfigs,r=e.specSelectors,i=e.schema,a=e.required,s=e.name,u=e.isRef,l=e.specPath,c=t("ObjectModel"),p=t("ArrayModel"),f=t("PrimitiveModel"),h="object",d=i&&i.get("$$ref");!s&&d&&(s=this.getModelName(d)),!i&&d&&(i=this.getRefSchema(s));var m=r.isOAS3()&&i.get("deprecated");switch(u=void 0!==u?u:!!d,h=i&&i.get("type")||h){case"object":return g.default.createElement(c,(0,o.default)({className:"object"},this.props,{specPath:l,getConfigs:n,schema:i,name:s,deprecated:m,isRef:u}));case"array":return g.default.createElement(p,(0,o.default)({className:"array"},this.props,{getConfigs:n,schema:i,name:s,deprecated:m,required:a}));case"string":case"number":case"integer":case"boolean":default:return g.default.createElement(f,(0,o.default)({},this.props,{getComponent:t,getConfigs:n,schema:i,name:s,deprecated:m,required:a}))}}}]),t}(_.default);E.propTypes={schema:x.default.orderedMap.isRequired,getComponent:k.default.func.isRequired,getConfigs:k.default.func.isRequired,specSelectors:k.default.object.isRequired,name:k.default.string,isRef:k.default.bool,required:k.default.bool,expandDepth:k.default.number,depth:k.default.number,specPath:x.default.list.isRequired},t.default=E},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.source,n=new h.default({html:!0,typographer:!0,breaks:!0,linkify:!0,linkTarget:"_blank"}).render(t),r=o(n);return t&&n&&r?l.default.createElement("div",{className:"markdown",dangerouslySetInnerHTML:{__html:r}}):null}function o(e){return(0,m.default)(e,v)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(21),s=r(a);t.sanitizer=o;var u=n(0),l=r(u),c=n(1),p=r(c),f=n(1126),h=r(f),d=n(1179),m=r(d);i.propTypes={source:p.default.string.isRequired},t.default=i;var v={allowedTags:m.default.defaults.allowedTags.concat(["h1","h2","img","span"]),allowedAttributes:(0,s.default)({},m.default.defaults.allowedAttributes,{img:m.default.defaults.allowedAttributes.img.concat(["title"]),td:["colspan"],"*":["class"]}),textFilter:function(e){return e.replace(/"/g,'"')}}},function(e,t,n){"use strict";var r=n(9),i=n(1208);i.keys().forEach(function(t){if("./index.js"!==t){var n=i(t);e.exports[(0,r.pascalCaseFilename)(t)]=n.default?n.default:n}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){function n(e,t,i){if(!e)return i&&i.start_mark?i.start_mark.line:0;if(t.length&&e.tag===b)for(r=0;r<e.value.length;r++){var o=e.value[r],a=o[0],s=o[1];if(a.value===t[0])return n(s,t.slice(1),e);if(a.value===t[0].replace(/\[.*/,"")){var u=parseInt(t[0].match(/\[(.*)\]/)[1]);if(1===s.value.length&&0!==u&&u)var l=(0,g.default)(s.value[0],{value:u.toString()});else var l=s.value[u];return n(l,t.slice(1),s.value)}}if(t.length&&e.tag===x){var c=e.value[t[0]];if(c&&c.tag)return n(c,t.slice(1),e.value)}return e.tag!==b||Array.isArray(i)?e.start_mark.line+1:e.start_mark.line}if("string"!=typeof e)throw new TypeError("yaml should be a string");if(!(0,m.default)(t))throw new TypeError("path should be an array of strings");var r=0;return n(_(e),t)}function o(e,t){function n(e,o){if(e.tag===b)for(i=0;i<e.value.length;i++){var a=e.value[i],s=a[0],u=a[1];if(s.value===t[0])return t.shift(),n(u,s)}if(e.tag===x){var l=e.value[t[0]];if(l&&l.tag)return t.shift(),n(l,o)}if(t.length)return r;var c={start:{line:e.start_mark.line,column:e.start_mark.column,pointer:e.start_mark.pointer},end:{line:e.end_mark.line,column:e.end_mark.column,pointer:e.end_mark.pointer}};return o&&(c.key_start={line:o.start_mark.line,column:o.start_mark.column,pointer:o.start_mark.pointer},c.key_end={line:o.end_mark.line,column:o.end_mark.column,pointer:o.end_mark.pointer}),c}if("string"!=typeof e)throw new TypeError("yaml should be a string");if(!(0,m.default)(t))throw new TypeError("path should be an array of strings");var r={start:{line:-1,column:-1},end:{line:-1,column:-1}},i=0;return n(_(e))}function a(e,t){function n(e){function r(e){return e.start_mark.line===e.end_mark.line?t.line===e.start_mark.line&&e.start_mark.column<=t.column&&e.end_mark.column>=t.column:t.line===e.start_mark.line?t.column>=e.start_mark.column:t.line===e.end_mark.line?t.column<=e.end_mark.column:e.start_mark.line<t.line&&e.end_mark.line>t.line}var o=0;if(!e||-1===[b,x].indexOf(e.tag))return i;if(e.tag===b)for(o=0;o<e.value.length;o++){var a=e.value[o],s=a[0],u=a[1];if(r(s))return i;if(r(u))return i.push(s.value),n(u)}if(e.tag===x)for(o=0;o<e.value.length;o++){var l=e.value[o];if(r(l))return i.push(o.toString()),n(l)}return i}if("string"!=typeof e)throw new TypeError("yaml should be a string");if("object"!==(void 0===t?"undefined":(0,p.default)(t))||"number"!=typeof t.line||"number"!=typeof t.column)throw new TypeError("position should be an object with line and column properties");try{var r=_(e)}catch(n){return console.error("Error composing AST",n),console.error("Problem area:\n",e.split("\n").slice(t.line-5,t.line+5).join("\n")),null}var i=[];return n(r)}function s(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return new l.default(function(t){return t(e.apply(void 0,n))})}}Object.defineProperty(t,"__esModule",{value:!0}),t.getLineNumberForPathAsync=t.positionRangeForPathAsync=t.pathForPositionAsync=void 0;var u=n(332),l=r(u),c=n(48),p=r(c);t.getLineNumberForPath=i,t.positionRangeForPath=o,t.pathForPosition=a;var f=n(1206),h=r(f),d=n(20),m=r(d),v=n(223),g=r(v),y=n(9),_=(0,y.memoize)(h.default.compose),b="tag:yaml.org,2002:map",x="tag:yaml.org,2002:seq";t.pathForPositionAsync=s(a),t.positionRangeForPathAsync=s(o),t.getLineNumberForPathAsync=s(i)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{fn:{AST:i},components:{JumpToPath:a.default}}};var r=n(272),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r),o=n(274),a=function(e){return e&&e.__esModule?e:{default:e}}(o)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){return null}}]),t}(m.default.Component);t.default=v},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{afterLoad:function(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth},statePlugins:{auth:{reducers:o.default,actions:s,selectors:l},spec:{wrapActions:p}}}};var i=n(276),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(168),s=r(a),u=n(277),l=r(u),c=n(278),p=r(c)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(36),a=r(o),s=n(30),u=r(s),l=n(18),c=r(l),p=n(7),f=n(9),h=n(168);t.default=(i={},(0,a.default)(i,h.SHOW_AUTH_POPUP,function(e,t){var n=t.payload;return e.set("showDefinitions",n)}),(0,a.default)(i,h.AUTHORIZE,function(e,t){var n=t.payload,r=(0,p.fromJS)(n),i=e.get("authorized")||(0,p.Map)();return r.entrySeq().forEach(function(e){var t=(0,c.default)(e,2),n=t[0],r=t[1],o=r.getIn(["schema","type"]);if("apiKey"===o||"http"===o)i=i.set(n,r);else if("basic"===o){var a=r.getIn(["value","username"]),s=r.getIn(["value","password"]);i=i.setIn([n,"value"],{username:a,header:"Basic "+(0,f.btoa)(a+":"+s)}),i=i.setIn([n,"schema"],r.get("schema"))}}),e.set("authorized",i)}),(0,a.default)(i,h.AUTHORIZE_OAUTH2,function(e,t){var n=t.payload,r=n.auth,i=n.token,o=void 0;return r.token=(0,u.default)({},i),o=(0,p.fromJS)(r),e.setIn(["authorized",o.get("name")],o)}),(0,a.default)(i,h.LOGOUT,function(e,t){var n=t.payload,r=e.get("authorized").withMutations(function(e){n.forEach(function(t){e.delete(t)})});return e.set("authorized",r)}),(0,a.default)(i,h.CONFIGURE_AUTH,function(e,t){var n=t.payload;return e.set("configs",n)}),i)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigs=t.isAuthorized=t.authorized=t.definitionsForRequirements=t.getDefinitionsByNames=t.definitionsToAuthorize=t.shownDefinitions=void 0;var i=n(47),o=r(i),a=n(18),s=r(a),u=n(60),l=n(7),c=function(e){return e};t.shownDefinitions=(0,u.createSelector)(c,function(e){return e.get("showDefinitions")}),t.definitionsToAuthorize=(0,u.createSelector)(c,function(){return function(e){var t=e.specSelectors,n=t.securityDefinitions()||(0,l.Map)({}),r=(0,l.List)();return n.entrySeq().forEach(function(e){var t=(0,s.default)(e,2),n=t[0],i=t[1],o=(0,l.Map)();o=o.set(n,i),r=r.push(o)}),r}}),t.getDefinitionsByNames=function(e,t){return function(e){var n=e.specSelectors;console.warn("WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.");var r=n.securityDefinitions(),i=(0,l.List)();return t.valueSeq().forEach(function(e){var t=(0,l.Map)();e.entrySeq().forEach(function(e){var n=(0,s.default)(e,2),i=n[0],o=n[1],a=r.get(i),u=void 0;"oauth2"===a.get("type")&&o.size&&(u=a.get("scopes"),u.keySeq().forEach(function(e){o.contains(e)||(u=u.delete(e))}),a=a.set("allowedScopes",u)),t=t.set(i,a)}),i=i.push(t)}),i}},t.definitionsForRequirements=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,l.List)();return function(e){return(e.authSelectors.definitionsToAuthorize()||(0,l.List)()).filter(function(e){return t.some(function(t){return t.get(e.keySeq().first())})})}},t.authorized=(0,u.createSelector)(c,function(e){return e.get("authorized")||(0,l.Map)()}),t.isAuthorized=function(e,t){return function(e){var n=e.authSelectors,r=n.authorized();return l.List.isList(t)?!!t.toJS().filter(function(e){return-1===(0,o.default)(e).map(function(e){return!!r.get(e)}).indexOf(!1)}).length:null}},t.getConfigs=(0,u.createSelector)(c,function(e){return e.get("configs")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.execute=void 0;var r=n(21),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.execute=function(e,t){var n=t.authSelectors,r=t.specSelectors;return function(t){var o=t.path,a=t.method,s=t.operation,u=t.extras,l={authorized:n.authorized()&&n.authorized().toJS(),definitions:r.securityDefinitions()&&r.securityDefinitions().toJS(),specSecurity:r.security()&&r.security().toJS()};return e((0,i.default)({path:o,method:a,operation:s,securities:l},u))}}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function o(){return{statePlugins:{spec:{actions:g,selectors:y},configs:{reducers:m.default,actions:p,selectors:h}}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var a=n(211),s=i(a),u=n(1007),l=i(u),c=n(169),p=r(c),f=n(281),h=r(f),d=n(280),m=i(d),v=function(e,t){try{return s.default.safeLoad(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}},g={downloadConfig:function(e){return function(t){return(0,t.fn.fetch)(e)}},getConfigByUrl:function(e,t){return function(n){function r(n){n instanceof Error||n.status>=400?(i.updateLoadingStatus("failedConfig"),i.updateLoadingStatus("failedConfig"),i.updateUrl(""),console.error(n.statusText+" "+e),t(null)):t(v(n.text))}var i=n.specActions;if(e)return i.downloadConfig(e).then(r,r)}}},y={getLocalConfig:function(){return v(l.default)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(36),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(7),s=n(169);t.default=(r={},(0,o.default)(r,s.UPDATE_CONFIGS,function(e,t){return e.merge((0,a.fromJS)(t.payload))}),(0,o.default)(r,s.TOGGLE_CONFIGS,function(e,t){var n=t.payload,r=e.get(n);return e.set(n,!r)}),r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.get=function(e,t){return e.getIn(Array.isArray(t)?t:[t])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.setHash=function(e){return e?history.pushState(null,null,"#"+e):window.location.hash=""}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{spec:{wrapActions:o},layout:{wrapActions:s}}}};var i=n(285),o=r(i),a=n(284),s=r(a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.show=void 0;var r=n(18),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(282),a=n(9);t.show=function(e,t){var n=t.getConfigs;return function(){for(var t=arguments.length,r=Array(t),s=0;s<t;s++)r[s]=arguments[s];e.apply(void 0,r);var u=n().deepLinking;if(u&&"false"!==u)try{var l=r[0],c=r[1],p=(0,i.default)(l,1),f=p[0];if("operations-tag"===f||"operations"===f){if(!c)return(0,o.setHash)("/");if("operations"===f){var h=(0,i.default)(l,3),d=h[1],m=h[2];(0,o.setHash)("/"+(0,a.createDeepLinkPath)(d)+"/"+(0,a.createDeepLinkPath)(m))}if("operations-tag"===f){var v=(0,i.default)(l,2),g=v[1];(0,o.setHash)("/"+(0,a.createDeepLinkPath)(g))}}}catch(e){console.error(e)}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.updateResolved=void 0;var i=n(18),o=r(i),a=n(1207),s=r(a),u=n(9),l=!1;t.updateResolved=function(e,t){var n=t.layoutActions,r=t.getConfigs;return function(){e.apply(void 0,arguments);var t=r().deepLinking;if(t&&"false"!==t){if(window.location.hash&&!l){var i=window.location.hash.slice(1);"!"===i[0]&&(i=i.slice(1)),"/"===i[0]&&(i=i.slice(1));var a=i.split("/"),c=(0,o.default)(a,2),p=c[0],f=c[1],h=document.querySelector(".swagger-ui"),d=s.default.createScroller(h),m=void 0;p&&f?(n.show(["operations-tag",p],!0),n.show(["operations",p,f],!0),m=document.getElementById("operations-"+(0,u.escapeDeepLinkPath)(p)+"-"+(0,u.escapeDeepLinkPath)(f))):p&&(n.show(["operations-tag",p],!0),m=document.getElementById("operations-tag-"+(0,u.escapeDeepLinkPath)(p))),m&&(d.to(m),setTimeout(function(){0===s.default.getY()&&s.default.to(m)},50))}l=!0}}}},function(e,t,n){"use strict";function r(e){var t=e.fn;return{statePlugins:{spec:{actions:{download:function(e){return function(n){function r(t){if(t instanceof Error||t.status>=400)return a.updateLoadingStatus("failed"),i.newThrownErr(new Error((t.message||t.statusText)+" "+e));a.updateLoadingStatus("success"),a.updateSpec(t.text),a.updateUrl(e)}var i=n.errActions,o=n.specSelectors,a=n.specActions,s=n.getConfigs,u=t.fetch,l=s();e=e||o.url(),a.updateLoadingStatus("loading"),u({url:e,loadSpec:!0,requestInterceptor:l.requestInterceptor||function(e){return e},responseInterceptor:l.responseInterceptor||function(e){return e},credentials:"same-origin",headers:{Accept:"application/json,*/*"}}).then(r,r)}},updateLoadingStatus:function(e){var t=[null,"loading","failed","success","failedConfig"];return-1===t.indexOf(e)&&console.error("Error: "+e+" is not one of "+(0,o.default)(t)),{type:"spec_update_loading_status",payload:e}}},reducers:{spec_update_loading_status:function(e,t){return"string"==typeof t.payload?e.set("loadingStatus",t.payload):e}},selectors:{loadingStatus:(0,a.createSelector)(function(e){return e||(0,s.Map)()},function(e){return e.get("loadingStatus")||null})}}}}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(35),o=function(e){return e&&e.__esModule?e:{default:e}}(i);t.default=r;var a=n(60),s=n(7)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e,t){var n={jsSpec:t.specSelectors.specJson().toJS()};return(0,a.default)(h,function(e,t){try{return t.transform(e,n).filter(function(e){return!!e})}catch(t){return console.error("Transformer error:",t),e}},e).filter(function(e){return!!e}).map(function(e){return!e.get("line")&&e.get("path"),e})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(953),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s=n(288),u=r(s),l=n(289),c=r(l),p=n(290),f=r(p),h=[u,c,f]},function(e,t,n){"use strict";function r(e){return e.map(function(e){var t=e.get("message").indexOf("is not of a type(s)");if(t>-1){var n=e.get("message").slice(t+"is not of a type(s)".length).split(",");return e.set("message",e.get("message").slice(0,t)+i(n))}return e})}function i(e){return e.reduce(function(e,t,n,r){return n===r.length-1&&r.length>1?e+"or "+t:r[n+1]&&r.length>2?e+t+", ":r[n+1]?e+t+" ":e+t},"should be a")}Object.defineProperty(t,"__esModule",{value:!0}),t.transform=r},function(e,t,n){"use strict";function r(e,t){t.jsSpec;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.transform=r;var i=n(224);(function(e){e&&e.__esModule})(i),n(7)},function(e,t,n){"use strict";function r(e){return e.map(function(e){return e.set("message",i(e.get("message"),"instance."))})}function i(e,t){return e.replace(new RegExp(t,"g"),"")}Object.defineProperty(t,"__esModule",{value:!0}),t.transform=r},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{statePlugins:{err:{reducers:(0,o.default)(e),actions:s,selectors:l}}}};var i=n(292),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(128),s=r(a),u=n(293),l=r(u)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(36),o=r(i),a=n(30),s=r(a);t.default=function(e){var t;return t={},(0,o.default)(t,u.NEW_THROWN_ERR,function(t,n){var r=n.payload,i=(0,s.default)(m,r,{type:"thrown"});return t.update("errors",function(e){return(e||(0,p.List)()).push((0,p.fromJS)(i))}).update("errors",function(t){return(0,d.default)(t,e.getSystem())})}),(0,o.default)(t,u.NEW_THROWN_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return(0,p.fromJS)((0,s.default)(m,e,{type:"thrown"}))}),t.update("errors",function(e){return(e||(0,p.List)()).concat((0,p.fromJS)(r))}).update("errors",function(t){return(0,d.default)(t,e.getSystem())})}),(0,o.default)(t,u.NEW_SPEC_ERR,function(t,n){var r=n.payload,i=(0,p.fromJS)(r);return i=i.set("type","spec"),t.update("errors",function(e){return(e||(0,p.List)()).push((0,p.fromJS)(i)).sortBy(function(e){return e.get("line")})}).update("errors",function(t){return(0,d.default)(t,e.getSystem())})}),(0,o.default)(t,u.NEW_SPEC_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return(0,p.fromJS)((0,s.default)(m,e,{type:"spec"}))}),t.update("errors",function(e){return(e||(0,p.List)()).concat((0,p.fromJS)(r))}).update("errors",function(t){return(0,d.default)(t,e.getSystem())})}),(0,o.default)(t,u.NEW_AUTH_ERR,function(t,n){var r=n.payload,i=(0,p.fromJS)((0,s.default)({},r));return i=i.set("type","auth"),t.update("errors",function(e){return(e||(0,p.List)()).push((0,p.fromJS)(i))}).update("errors",function(t){return(0,d.default)(t,e.getSystem())})}),(0,o.default)(t,u.CLEAR,function(e,t){var n=t.payload;if(n){var r=f.default.fromJS((0,c.default)((e.get("errors")||(0,p.List)()).toJS(),n));return e.merge({errors:r})}}),t};var u=n(128),l=n(954),c=r(l),p=n(7),f=r(p),h=n(287),d=r(h),m={line:0,level:"error",message:"Unknown error"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastError=t.allErrors=void 0;var r=n(7),i=n(60),o=function(e){return e},a=t.allErrors=(0,i.createSelector)(o,function(e){return e.get("errors",(0,r.List)())});t.lastError=(0,i.createSelector)(a,function(e){return e.last()})},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{layout:{reducers:o.default,actions:s,selectors:l}}}};var i=n(295),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(170),s=r(a),u=n(296),l=r(u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(36),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(7),s=n(170);t.default=(r={},(0,o.default)(r,s.UPDATE_LAYOUT,function(e,t){return e.set("layout",t.payload)}),(0,o.default)(r,s.UPDATE_FILTER,function(e,t){return e.set("filter",t.payload)}),(0,o.default)(r,s.SHOW,function(e,t){var n=t.payload.shown,r=(0,a.fromJS)(t.payload.thing);return e.update("shown",(0,a.fromJS)({}),function(e){return e.set(r,n)})}),(0,o.default)(r,s.UPDATE_MODE,function(e,t){var n=t.payload.thing,r=t.payload.mode;return e.setIn(["modes"].concat(n),(r||"")+"")}),r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.showSummary=t.whatMode=t.isShown=t.currentFilter=t.current=void 0;var r=n(97),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(60),a=n(9),s=n(7),u=function(e){return e},l=(t.current=function(e){return e.get("layout")},t.currentFilter=function(e){return e.get("filter")},t.isShown=function(e,t,n){return t=(0,a.normalizeArray)(t),e.get("shown",(0,s.fromJS)({})).get((0,s.fromJS)(t),n)});t.whatMode=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t=(0,a.normalizeArray)(t),e.getIn(["modes"].concat((0,i.default)(t)),n)},t.showSummary=(0,o.createSelector)(u,function(e){return!l(e,"editor")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];i(e)>=a&&(t=console)[e].apply(t,r)}var n=e.configs,r={debug:0,info:1,log:2,warn:3,error:4},i=function(e){return r[e]||-1},o=n.logLevel,a=i(o);return t.warn=t.bind(null,"warn"),t.error=t.bind(null,"error"),t.info=t.bind(null,"info"),t.debug=t.bind(null,"debug"),{rootInjects:{log:t}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.definitionsToAuthorize=void 0;var i=n(36),o=r(i),a=n(18),s=r(a),u=n(60),l=n(7),c=n(34),p=function(e){return e};t.definitionsToAuthorize=function(e){return function(t,n){return function(r){for(var i=arguments.length,o=Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];var s=n.getSystem().specSelectors.specJson();return(0,c.isOAS3)(s)?e.apply(void 0,[n].concat(o)):t.apply(void 0,o)}}}((0,u.createSelector)(p,function(e){return e.specSelectors.securityDefinitions()},function(e,t){var n=(0,l.List)();return t.entrySeq().forEach(function(e){var t=(0,s.default)(e,2),r=t[0],i=t[1],a=i.get("type");"oauth2"===a&&i.get("flows").entrySeq().forEach(function(e){var t=(0,s.default)(e,2),a=t[0],u=t[1],c=(0,l.fromJS)({flow:a,authorizationUrl:u.get("authorizationUrl"),tokenUrl:u.get("tokenUrl"),scopes:u.get("scopes"),type:i.get("type")});n=n.push(new l.Map((0,o.default)({},r,c.filter(function(e){return void 0!==e}))))}),"http"!==a&&"apiKey"!==a||(n=n.push(new l.Map((0,o.default)({},r,i))))}),n}))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(0),s=r(a),u=n(1),l=r(u),c=n(12),p=r(c),f=n(7),h=function(e){var t=e.callbacks,n=e.getComponent,r=n("OperationContainer",!0);if(!t)return s.default.createElement("span",null,"No callbacks");var i=t.map(function(t,n){return s.default.createElement("div",{key:n},s.default.createElement("h2",null,n),t.map(function(t,n){return s.default.createElement("div",{key:n},t.map(function(t,i){var a=(0,f.fromJS)({operation:t});return s.default.createElement(r,(0,o.default)({},e,{op:a,key:i,tag:"",method:i,path:n,allowTryItOut:!1}))}))}))});return s.default.createElement("div",null,i)};h.propTypes={getComponent:l.default.func.isRequired,callbacks:p.default.iterable.isRequired},t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));_.call(r);var i=r.props,a=i.name,u=i.schema,l=r.getValue();return r.state={name:a,schema:u,value:l},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,i=e.name,o=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),l=n("Markdown"),c=n("JumpToPath",!0),p=t.get("scheme"),f=this.getValue(),h=r.allErrors().filter(function(e){return e.get("authId")===i});if("basic"===p){var d=f?f.get("username"):null;return m.default.createElement("div",null,m.default.createElement("h4",null,m.default.createElement("code",null,i||t.get("name")),"  (http, Basic)",m.default.createElement(c,{path:["securityDefinitions",i]})),d&&m.default.createElement("h6",null,"Authorized"),m.default.createElement(a,null,m.default.createElement(l,{source:t.get("description")})),m.default.createElement(a,null,m.default.createElement("label",null,"Username:"),d?m.default.createElement("code",null," ",d," "):m.default.createElement(s,null,m.default.createElement(o,{type:"text",required:"required",name:"username",onChange:this.onChange}))),m.default.createElement(a,null,m.default.createElement("label",null,"Password:"),d?m.default.createElement("code",null," ****** "):m.default.createElement(s,null,m.default.createElement(o,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return m.default.createElement(u,{error:e,key:t})}))}return"bearer"===p?m.default.createElement("div",null,m.default.createElement("h4",null,m.default.createElement("code",null,i||t.get("name")),"  (http, Bearer)",m.default.createElement(c,{path:["securityDefinitions",i]})),f&&m.default.createElement("h6",null,"Authorized"),m.default.createElement(a,null,m.default.createElement(l,{source:t.get("description")})),m.default.createElement(a,null,m.default.createElement("label",null,"Value:"),f?m.default.createElement("code",null," ****** "):m.default.createElement(s,null,m.default.createElement(o,{type:"text",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return m.default.createElement(u,{error:e,key:t})})):m.default.createElement("div",null,m.default.createElement("em",null,m.default.createElement("b",null,i)," HTTP authentication: unsupported or missing scheme"))}}]),t}(m.default.Component);y.propTypes={authorized:g.default.object,getComponent:g.default.func.isRequired,errSelectors:g.default.object.isRequired,schema:g.default.object.isRequired,name:g.default.string.isRequired,onChange:g.default.func};var _=function(){var e=this;this.onChange=function(t){var n=e.props.onChange,r=t.target,i=r.value,o=r.name,a=e.state.value||{};o?a[o]=i:a=i,e.setState({value:a},function(){return n(e.state)})}};t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(299),o=r(i),a=n(305),s=r(a),u=n(302),l=r(u),c=n(306),p=r(c),f=n(304),h=r(f),d=n(300),m=r(d),v=n(303),g=r(v);t.default={Callbacks:o.default,HttpAuth:m.default,RequestBody:s.default,Servers:p.default,RequestBodyEditor:h.default,OperationServers:g.default,operationLink:l.default}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return"string"!=typeof t?"":t.split("\n").map(function(t,n){return n>0?Array(e+1).join(" ")+t:t}).join("\n")}Object.defineProperty(t,"__esModule",{value:!0});var o=n(35),a=r(o),s=n(4),u=r(s),l=n(2),c=r(l),p=n(3),f=r(p),h=n(6),d=r(h),m=n(5),v=r(m),g=n(0),y=r(g),_=n(1),b=r(_),x=n(12),w=r(x),k=function(e){function t(){return(0,c.default)(this,t),(0,d.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,v.default)(t,e),(0,f.default)(t,[{key:"render",value:function(){var e=this.props,t=e.link,n=e.name,r=e.getComponent,o=r("Markdown"),s=t.get("operationId")||t.get("operationRef"),u=t.get("parameters")&&t.get("parameters").toJS(),l=t.get("description");return y.default.createElement("div",{style:{marginBottom:"1.5em"}},y.default.createElement("div",{style:{marginBottom:".5em"}},y.default.createElement("b",null,y.default.createElement("code",null,n)),l?y.default.createElement(o,{source:l}):null),y.default.createElement("pre",null,"Operation `",s,"`",y.default.createElement("br",null),y.default.createElement("br",null),"Parameters ",i(0,(0,a.default)(u,null,2))||"{}",y.default.createElement("br",null)))}}]),t}(g.Component);k.propTypes={getComponent:b.default.func.isRequired,link:w.default.orderedMap.isRequired,name:b.default.String},t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(12),x=r(b),w=function(e){function t(){var e,n,r,i;(0,l.default)(this,t);for(var a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];return n=r=(0,h.default)(this,(e=t.__proto__||(0,s.default)(t)).call.apply(e,[this].concat(u))),r.setSelectedServer=function(e){var t=r.props,n=t.path,i=t.method;return r.forceUpdate(),r.props.setSelectedServer(e,n+":"+i)},r.setServerVariableValue=function(e){var t=r.props,n=t.path,i=t.method;return r.forceUpdate(),r.props.setServerVariableValue((0,o.default)({},e,{namespace:n+":"+i}))},r.getSelectedServer=function(){var e=r.props,t=e.path,n=e.method;return r.props.getSelectedServer(t+":"+n)},r.getServerVariable=function(e,t){var n=r.props,i=n.path,o=n.method;return r.props.getServerVariable({namespace:i+":"+o,server:e},t)},r.getEffectiveServerValue=function(e){var t=r.props,n=t.path,i=t.method;return r.props.getEffectiveServerValue({server:e,namespace:n+":"+i})},i=n,(0,h.default)(r,i)}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.operationServers,n=e.pathServers,r=e.getComponent;if(!t&&!n)return null;var i=r("Servers"),o=t||n,a=t?"operation":"path";return g.default.createElement("div",{className:"opblock-section operation-servers"},g.default.createElement("div",{className:"opblock-section-header"},g.default.createElement("div",{className:"tab-header"},g.default.createElement("h4",{className:"opblock-title"},"Servers"))),g.default.createElement("div",{className:"opblock-description-wrapper"},g.default.createElement("h4",{className:"message"},"These ",a,"-level options override the global server options."),g.default.createElement(i,{servers:o,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}]),t}(g.default.Component);w.propTypes={path:_.default.string.isRequired,method:_.default.string.isRequired,operationServers:x.default.list,pathServers:x.default.list,setSelectedServer:_.default.func.isRequired,setServerVariableValue:_.default.func.isRequired,getSelectedServer:_.default.func.isRequired,getServerVariable:_.default.func.isRequired,getEffectiveServerValue:_.default.func.isRequired,getComponent:_.default.func.isRequired},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(7),_=n(9),b=Function.prototype,x=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));return r.setValueToSample=function(e){r.onChange(r.sample(e))},r.sample=function(e){var t=r.props,n=t.requestBody,i=t.mediaType,o=n.getIn(["content",e||i,"schema"]).toJS();return(0,_.getSampleSchema)(o,e||i,{includeWriteOnly:!0})},r.onChange=function(e){r.setState({value:e}),r.props.onChange(e)},r.handleOnChange=function(e){var t=r.props.mediaType,n=/json/i.test(t),i=n?e.target.value.trim():e.target.value;r.onChange(i)},r.toggleIsEditBox=function(){return r.setState(function(e){return{isEditBox:!e.isEditBox}})},r.state={isEditBox:!1,value:""},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){this.setValueToSample.call(this)}},{key:"componentWillReceiveProps",value:function(e){this.props.mediaType!==e.mediaType&&this.setValueToSample(e.mediaType),!this.props.isExecute&&e.isExecute&&this.setState({isEditBox:!0})}},{key:"componentDidUpdate",value:function(e){this.props.requestBody!==e.requestBody&&this.setValueToSample(this.props.mediaType)}},{key:"render",value:function(){var e=this.props,t=e.isExecute,n=e.getComponent,r=n("Button"),i=n("TextArea"),o=n("highlightCode"),a=this.state,s=a.value,u=a.isEditBox;return m.default.createElement("div",{className:"body-param"},u&&t?m.default.createElement(i,{className:"body-param__text",value:s,onChange:this.handleOnChange}):s&&m.default.createElement(o,{className:"body-param__example",value:s}),m.default.createElement("div",{className:"body-param-options"},t?m.default.createElement("div",{className:"body-param-edit"},m.default.createElement(r,{className:u?"btn cancel body-param__example-edit":"btn edit body-param__example-edit",onClick:this.toggleIsEditBox},u?"Cancel":"Edit")):null))}}]),t}(d.PureComponent);x.propTypes={requestBody:g.default.object.isRequired,mediaType:g.default.string.isRequired,onChange:g.default.func,getComponent:g.default.func.isRequired,isExecute:g.default.bool,specSelectors:g.default.object.isRequired},x.defaultProps={mediaType:"application/json",requestBody:(0,y.fromJS)({}),onChange:b},t.default=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(1),s=r(a),u=n(12),l=r(u),c=n(7),p=function(e){var t=e.requestBody,n=e.getComponent,r=e.getConfigs,i=e.specSelectors,a=e.contentType,s=e.isExecute,u=e.specPath,l=e.onChange,p=n("Markdown"),f=n("modelExample"),h=n("RequestBodyEditor"),d=t&&t.get("description")||null,m=t&&t.get("content")||new c.OrderedMap;a=a||m.keySeq().first();var v=m.get(a);return v?o.default.createElement("div",null,d&&o.default.createElement(p,{source:d}),o.default.createElement(f,{getComponent:n,getConfigs:r,specSelectors:i,expandDepth:1,isExecute:s,schema:v.get("schema"),specPath:u.push("content",a),example:o.default.createElement(h,{requestBody:t,onChange:l,mediaType:a,getComponent:n,isExecute:s,specSelectors:i})})):null};p.propTypes={requestBody:l.default.orderedMap.isRequired,getComponent:s.default.func.isRequired,getConfigs:s.default.func.isRequired,specSelectors:s.default.object.isRequired,contentType:s.default.string,isExecute:s.default.bool.isRequired,onChange:s.default.func.isRequired,specPath:s.default.array.isRequired},t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(7),g=n(1),y=r(g),_=n(12),b=r(_),x=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onServerChange=function(e){r.setServer(e.target.value)},r.onServerVariableValueChange=function(e){var t=r.props,n=t.setServerVariableValue,i=t.currentServer,o=e.target.getAttribute("data-variable"),a=e.target.value;"function"==typeof n&&n({server:i,key:o,val:a})},r.setServer=function(e){(0,r.props.setSelectedServer)(e)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.servers;e.currentServer||this.setServer(t.first().get("url"))}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.servers,r=t.setServerVariableValue,i=t.getServerVariable;if(this.props.currentServer!==e.currentServer){var o=n.find(function(t){return t.get("url")===e.currentServer});if(!o)return this.setServer(n.first().get("url"));(o.get("variables")||(0,v.OrderedMap)()).map(function(t,n){i(e.currentServer,n)||r({server:e.currentServer,key:n,val:t.get("default")||""})})}}},{key:"render",value:function(){var e=this,t=this.props,n=t.servers,r=t.currentServer,i=t.getServerVariable,o=t.getEffectiveServerValue,a=n.find(function(e){return e.get("url")===r})||(0,v.OrderedMap)(),s=a.get("variables")||(0,v.OrderedMap)(),u=0!==s.size;return m.default.createElement("div",{className:"servers"},m.default.createElement("label",{htmlFor:"servers"},m.default.createElement("select",{onChange:this.onServerChange},n.valueSeq().map(function(e){return m.default.createElement("option",{value:e.get("url"),key:e.get("url")},e.get("url"))}).toArray())),u?m.default.createElement("div",null,m.default.createElement("div",{className:"computed-url"},"Computed URL:",m.default.createElement("code",null,o(r))),m.default.createElement("h4",null,"Server variables"),m.default.createElement("table",null,m.default.createElement("tbody",null,s.map(function(t,n){return m.default.createElement("tr",{key:n},m.default.createElement("td",null,n),m.default.createElement("td",null,t.get("enum")?m.default.createElement("select",{"data-variable":n,onChange:e.onServerVariableValueChange},t.get("enum").map(function(e){return m.default.createElement("option",{selected:e===i(r,n),key:e,value:e},e)})):m.default.createElement("input",{type:"text",value:i(r,n)||"",onChange:e.onServerVariableValueChange,"data-variable":n})))})))):null)}}]),t}(m.default.Component);x.propTypes={servers:b.default.list.isRequired,currentServer:y.default.string.isRequired,setSelectedServer:y.default.func.isRequired,setServerVariableValue:y.default.func.isRequired,getServerVariable:y.default.func.isRequired,getEffectiveServerValue:y.default.func.isRequired},t.default=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{components:f.default,wrapComponents:d.default,statePlugins:{spec:{wrapSelectors:a,selectors:c},auth:{wrapSelectors:u},oas3:{actions:v,reducers:b.default,selectors:y}}}};var o=n(311),a=i(o),s=n(298),u=i(s),l=n(310),c=i(l),p=n(301),f=r(p),h=n(313),d=r(h),m=n(171),v=i(m),g=n(309),y=i(g),_=n(308),b=r(_)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(36),a=r(o),s=n(18),u=r(s),l=n(171);t.default=(i={},(0,a.default)(i,l.UPDATE_SELECTED_SERVER,function(e,t){var n=t.payload,r=n.selectedServerUrl,i=n.namespace,o=i?[i,"selectedServer"]:["selectedServer"];return e.setIn(o,r)}),(0,a.default)(i,l.UPDATE_REQUEST_BODY_VALUE,function(e,t){var n=t.payload,r=n.value,i=n.pathMethod,o=(0,u.default)(i,2),a=o[0],s=o[1];return e.setIn(["requestData",a,s,"bodyValue"],r)}),(0,a.default)(i,l.UPDATE_REQUEST_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,i=n.pathMethod,o=(0,u.default)(i,2),a=o[0],s=o[1];return e.setIn(["requestData",a,s,"requestContentType"],r)}),(0,a.default)(i,l.UPDATE_RESPONSE_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,i=n.path,o=n.method;return e.setIn(["requestData",i,o,"responseContentType"],r)}),(0,a.default)(i,l.UPDATE_SERVER_VARIABLE_VALUE,function(e,t){var n=t.payload,r=n.server,i=n.namespace,o=n.key,a=n.val,s=i?[i,"serverVariableValues",r,o]:["serverVariableValues",r,o];return e.setIn(s,a)}),i)},function(e,t,n){"use strict";function r(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(t){var r=t.getSystem().specSelectors.specJson();return(0,o.isOAS3)(r)?e.apply(void 0,n):null}}}Object.defineProperty(t,"__esModule",{value:!0}),t.serverEffectiveValue=t.serverVariables=t.serverVariableValue=t.responseContentType=t.requestContentType=t.requestBodyValue=t.selectedServer=void 0;var i=n(7),o=n(34);t.selectedServer=r(function(e,t){var n=t?[t,"selectedServer"]:["selectedServer"];return e.getIn(n)||""}),t.requestBodyValue=r(function(e,t,n){return e.getIn(["requestData",t,n,"bodyValue"])||null}),t.requestContentType=r(function(e,t,n){return e.getIn(["requestData",t,n,"requestContentType"])||null}),t.responseContentType=r(function(e,t,n){return e.getIn(["requestData",t,n,"responseContentType"])||null}),t.serverVariableValue=r(function(e,t,n){var r=void 0;if("string"!=typeof t){var i=t.server,o=t.namespace;r=o?[o,"serverVariableValues",i,n]:["serverVariableValues",i,n]}else{r=["serverVariableValues",t,n]}return e.getIn(r)||null}),t.serverVariables=r(function(e,t){var n=void 0;if("string"!=typeof t){var r=t.server,o=t.namespace;n=o?[o,"serverVariableValues",r]:["serverVariableValues",r]}else{n=["serverVariableValues",t]}return e.getIn(n)||(0,i.OrderedMap)()}),t.serverEffectiveValue=r(function(e,t){var n,r;if("string"!=typeof t){var o=t.server,a=t.namespace;r=o,n=a?e.getIn([a,"serverVariableValues",r]):e.getIn(["serverVariableValues",r])}else r=t,n=e.getIn(["serverVariableValues",r]);n=n||(0,i.OrderedMap)();var s=r;return n.map(function(e,t){s=s.replace(new RegExp("{"+t+"}","g"),e)}),s})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSwagger2=t.servers=void 0;var r=n(60),i=n(7),o=n(34),a=function(e){return e||(0,i.Map)()},s=(0,r.createSelector)(a,function(e){return e.get("json",(0,i.Map)())}),u=(0,r.createSelector)(a,function(e){return e.get("resolved",(0,i.Map)())}),l=function(e){var t=u(e);return t.count()<1&&(t=s(e)),t};t.servers=function(e){return function(){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=t.getSystem().specSelectors.specJson();return(0,o.isOAS3)(a)?e.apply(void 0,r):null}}}((0,r.createSelector)(l,function(e){return e.getIn(["servers"])||(0,i.Map)()})),t.isSwagger2=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return(0,o.isSwagger2)(e)}}},function(e,t,n){"use strict";function r(e){return function(t,n){return function(){var r=n.getSystem().specSelectors.specJson();return(0,a.isOAS3)(r)?e.apply(void 0,arguments):t.apply(void 0,arguments)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.isSwagger2=t.isOAS3=t.servers=t.schemes=t.produces=t.consumes=t.basePath=t.host=t.securityDefinitions=t.hasHost=t.definitions=void 0;var i=n(60),o=n(7),a=n(34),s=function(e){return e||(0,o.Map)()},u=(0,i.createSelector)(function(){return null}),l=r(u),c=(0,i.createSelector)(s,function(e){return e.get("json",(0,o.Map)())}),p=(0,i.createSelector)(s,function(e){return e.get("resolved",(0,o.Map)())}),f=function(e){var t=p(e);return t.count()<1&&(t=c(e)),t};t.definitions=r((0,i.createSelector)(f,function(e){return e.getIn(["components","schemas"])||(0,o.Map)()})),t.hasHost=r(function(e){return f(e).hasIn(["servers",0])}),t.securityDefinitions=r((0,i.createSelector)(f,function(e){return e.getIn(["components","securitySchemes"])||null})),t.host=l,t.basePath=l,t.consumes=l,t.produces=l,t.schemes=l,t.servers=r((0,i.createSelector)(f,function(e){return e.getIn(["servers"])||(0,o.Map)()})),t.isOAS3=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return(0,a.isOAS3)(o.Map.isMap(e)?e:(0,o.Map)())}},t.isSwagger2=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return(0,a.isSwagger2)(o.Map.isMap(e)?e:(0,o.Map)())}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(96),o=r(i),a=n(0),s=r(a),u=n(34);t.default=(0,u.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,n=(0,o.default)(e,["Ori"]),r=n.schema,i=n.getComponent,a=n.errSelectors,u=n.authorized,l=n.onAuthChange,c=n.name,p=i("HttpAuth");return"http"===r.get("type")?s.default.createElement(p,{key:c,schema:r,name:c,errSelectors:a,authorized:u,getComponent:i,onChange:l}):s.default.createElement(t,n)})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(314),o=r(i),a=n(312),s=r(a),u=n(317),l=r(u),c=n(318),p=r(c),f=n(316),h=r(f),d=n(315),m=r(d);t.default={Markdown:o.default,AuthItem:s.default,parameters:l.default,VersionStamp:p.default,model:m.default,onlineValidatorBadge:h.default}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Markdown=void 0;var i=n(0),o=r(i),a=n(1),s=r(a),u=n(1080),l=r(u),c=n(577),p=n(34),f=n(270),h=t.Markdown=function(e){var t=e.source;if(t){var n=new c.Parser,r=new c.HtmlRenderer,i=r.render(n.parse(t||"")),a=(0,f.sanitizer)(i);return t&&i&&a?o.default.createElement(l.default,{source:a,className:"renderedMarkdown"}):null}return null};h.propTypes={source:s.default.string},t.default=(0,p.OAS3ComponentWrapFactory)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(34),x=n(269),w=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getConfigs,n=e.schema,r=["model-box"],i=!0===n.get("deprecated"),a=null;return i&&(r.push("deprecated"),a=g.default.createElement("span",{className:"model-deprecated-warning"},"Deprecated:")),g.default.createElement("div",{className:r.join(" ")},a,g.default.createElement(x.Model,(0,o.default)({},this.props,{getConfigs:t,depth:1,expandDepth:this.props.expandDepth||0})))}}]),t}(v.Component);w.propTypes={schema:_.default.object.isRequired,name:_.default.string,getComponent:_.default.func.isRequired,getConfigs:_.default.func.isRequired,specSelectors:_.default.object.isRequired,expandDepth:_.default.number},t.default=(0,b.OAS3ComponentWrapFactory)(w)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(34);t.default=(0,r.OAS3ComponentWrapFactory)(function(){return null})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(97),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(7),x=r(b),w=n(12),k=r(w),E=n(34),S=function(e,t){return e.valueSeq().filter(x.default.Map.isMap).map(t)},C=function(e){function t(e){(0,l.default)(this,t);var n=(0,h.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e));return n.onChange=function(e,t,r){var i=n.props;(0,i.specActions.changeParam)(i.onChangeKey,e.get("name"),e.get("in"),t,r)},n.onChangeConsumesWrapper=function(e){var t=n.props;(0,t.specActions.changeConsumesValue)(t.onChangeKey,e)},n.toggleTab=function(e){return"parameters"===e?n.setState({parametersVisible:!0,callbackVisible:!1}):"callbacks"===e?n.setState({callbackVisible:!0,parametersVisible:!1}):void 0},n.state={callbackVisible:!1,parametersVisible:!0},n}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.onTryoutClick,r=t.onCancelClick,i=t.parameters,a=t.allowTryItOut,s=t.tryItOutEnabled,u=t.fn,l=t.getComponent,c=t.getConfigs,p=t.specSelectors,f=t.oas3Actions,h=t.oas3Selectors,d=t.pathMethod,m=t.specPath,v=t.operation,y=l("parameterRow"),_=l("TryItOutButton"),x=l("contentType"),w=l("Callbacks",!0),k=l("RequestBody",!0),E=s&&a,C=p.isOAS3,A=v.get("requestBody"),D=m.slice(0,-1).push("requestBody");return g.default.createElement("div",{className:"opblock-section"},g.default.createElement("div",{className:"opblock-section-header"},g.default.createElement("div",{className:"tab-header"},g.default.createElement("div",{onClick:function(){return e.toggleTab("parameters")},className:"tab-item "+(this.state.parametersVisible&&"active")},g.default.createElement("h4",{className:"opblock-title"},g.default.createElement("span",null,"Parameters"))),v.get("callbacks")?g.default.createElement("div",{onClick:function(){return e.toggleTab("callbacks")},className:"tab-item "+(this.state.callbackVisible&&"active")},g.default.createElement("h4",{className:"opblock-title"},g.default.createElement("span",null,"Callbacks"))):null),a?g.default.createElement(_,{enabled:s,onCancelClick:r,onTryoutClick:n}):null),this.state.parametersVisible?g.default.createElement("div",{className:"parameters-container"},i.count()?g.default.createElement("div",{className:"table-container"},g.default.createElement("table",{className:"parameters"},g.default.createElement("thead",null,g.default.createElement("tr",null,g.default.createElement("th",{className:"col col_header parameters-col_name"},"Name"),g.default.createElement("th",{className:"col col_header parameters-col_description"},"Description"))),g.default.createElement("tbody",null,S(i,function(t,n){return g.default.createElement(y,{fn:u,getComponent:l,specPath:m.push(n),getConfigs:c,param:t,key:t.get("name"),onChange:e.onChange,onChangeConsumes:e.onChangeConsumesWrapper,specSelectors:p,pathMethod:d,isExecute:E})}).toArray()))):g.default.createElement("div",{className:"opblock-description-wrapper"},g.default.createElement("p",null,"No parameters"))):"",this.state.callbackVisible?g.default.createElement("div",{className:"callbacks-container opblock-description-wrapper"},g.default.createElement(w,{callbacks:(0,b.Map)(v.get("callbacks"))})):"",C()&&A&&this.state.parametersVisible&&g.default.createElement("div",{className:"opblock-section"},g.default.createElement("div",{className:"opblock-section-header"},g.default.createElement("h4",{className:"opblock-title parameter__name "+(A.get("required")&&"required")},"Request body"),g.default.createElement("label",null,g.default.createElement(x,{value:h.requestContentType.apply(h,(0,o.default)(d)),contentTypes:A.get("content").keySeq(),onChange:function(e){f.setRequestContentType({value:e,pathMethod:d})},className:"body-param-content-type"}))),g.default.createElement("div",{className:"opblock-description-wrapper"},g.default.createElement(k,{specPath:D,requestBody:A,isExecute:E,onChange:function(e){f.setRequestBodyValue({value:e,pathMethod:d})},contentType:h.requestContentType.apply(h,(0,o.default)(d))}))))}}]),t}(v.Component);C.propTypes={parameters:k.default.list.isRequired,specActions:_.default.object.isRequired,operation:_.default.object.isRequired,getComponent:_.default.func.isRequired,getConfigs:_.default.func.isRequired,specSelectors:_.default.object.isRequired,oas3Actions:_.default.object.isRequired,oas3Selectors:_.default.object.isRequired,fn:_.default.object.isRequired,tryItOutEnabled:_.default.bool,allowTryItOut:_.default.bool,specPath:k.default.list.isRequired,onTryoutClick:_.default.func,onCancelClick:_.default.func,onChangeKey:_.default.array,pathMethod:_.default.array.isRequired},C.defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[]},t.default=(0,E.OAS3ComponentWrapFactory)(C)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(34);t.default=(0,o.OAS3ComponentWrapFactory)(function(e){var t=e.Ori;return i.default.createElement("span",null,i.default.createElement(t,e),i.default.createElement("small",{style:{backgroundColor:"#89bf04"}},i.default.createElement("pre",{className:"version"},"OAS3")))})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{fn:i}};var r=n(172),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{spec:{wrapActions:p,reducers:o.default,actions:s,selectors:l}}}};var i=n(321),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(173),s=r(a),u=n(322),l=r(u),c=n(323),p=r(c)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(36),a=r(o),s=n(30),u=r(s),l=n(97),c=r(l),p=n(7),f=n(9),h=n(46),d=r(h),m=n(173);t.default=(i={},(0,a.default)(i,m.UPDATE_SPEC,function(e,t){return"string"==typeof t.payload?e.set("spec",t.payload):e}),(0,a.default)(i,m.UPDATE_URL,function(e,t){return e.set("url",t.payload+"")}),(0,a.default)(i,m.UPDATE_JSON,function(e,t){return e.set("json",(0,f.fromJSOrdered)(t.payload))}),(0,a.default)(i,m.UPDATE_RESOLVED,function(e,t){return e.setIn(["resolved"],(0,f.fromJSOrdered)(t.payload))}),(0,a.default)(i,m.UPDATE_PARAM,function(e,t){var n=t.payload,r=n.path,i=n.paramName,o=n.paramIn,a=n.value,s=n.isXml;return e.updateIn(["resolved","paths"].concat((0,c.default)(r),["parameters"]),(0,p.fromJS)([]),function(e){var t=e.findIndex(function(e){return e.get("name")===i&&e.get("in")===o});return a instanceof d.default.File||(a=(0,f.fromJSOrdered)(a)),e.setIn([t,s?"value_xml":"value"],a)})}),(0,a.default)(i,m.VALIDATE_PARAMS,function(e,t){var n=t.payload,r=n.pathMethod,i=n.isOAS3,o=e.getIn(["meta","paths"].concat((0,c.default)(r)),(0,p.fromJS)({})),a=/xml/i.test(o.get("consumes_value"));return e.updateIn(["resolved","paths"].concat((0,c.default)(r),["parameters"]),(0,p.fromJS)([]),function(e){return e.withMutations(function(e){for(var t=0,n=e.count();t<n;t++){var r=(0,f.validateParam)(e.get(t),a,i);e.setIn([t,"errors"],(0,p.fromJS)(r))}})})}),(0,a.default)(i,m.CLEAR_VALIDATE_PARAMS,function(e,t){var n=t.payload.pathMethod;return e.updateIn(["resolved","paths"].concat((0,c.default)(n),["parameters"]),(0,p.fromJS)([]),function(e){return e.withMutations(function(e){for(var t=0,n=e.count();t<n;t++)e.setIn([t,"errors"],(0,p.fromJS)([]))})})}),(0,a.default)(i,m.SET_RESPONSE,function(e,t){var n=t.payload,r=n.res,i=n.path,o=n.method,a=void 0;a=r.error?(0,u.default)({error:!0,name:r.err.name,message:r.err.message,statusCode:r.err.statusCode},r.err.response):r,a.headers=a.headers||{};var s=e.setIn(["responses",i,o],(0,f.fromJSOrdered)(a));return d.default.Blob&&r.data instanceof d.default.Blob&&(s=s.setIn(["responses",i,o,"text"],r.data)),s}),(0,a.default)(i,m.SET_REQUEST,function(e,t){var n=t.payload,r=n.req,i=n.path,o=n.method;return e.setIn(["requests",i,o],(0,f.fromJSOrdered)(r))}),(0,a.default)(i,m.SET_MUTATED_REQUEST,function(e,t){var n=t.payload,r=n.req,i=n.path,o=n.method;return e.setIn(["mutatedRequests",i,o],(0,f.fromJSOrdered)(r))}),(0,a.default)(i,m.UPDATE_OPERATION_META_VALUE,function(e,t){var n=t.payload,r=n.path,i=n.value,o=n.key,a=["resolved","paths"].concat((0,c.default)(r)),s=["meta","paths"].concat((0,c.default)(r));return e.getIn(a)?e.setIn([].concat((0,c.default)(s),[o]),(0,p.fromJS)(i)):e}),(0,a.default)(i,m.CLEAR_RESPONSE,function(e,t){var n=t.payload,r=n.path,i=n.method;return e.deleteIn(["responses",r,i])}),(0,a.default)(i,m.CLEAR_REQUEST,function(e,t){var n=t.payload,r=n.path,i=n.method;return e.deleteIn(["requests",r,i])}),(0,a.default)(i,m.SET_SCHEME,function(e,t){var n=t.payload,r=n.scheme,i=n.path,o=n.method;return i&&o?e.setIn(["scheme",i,o],r):i||o?void 0:e.setIn(["scheme","_defaultScheme"],r)}),i)},function(e,t,n){"use strict";function r(e,t,n,r){return t=t||[],_(e).getIn(["paths"].concat((0,f.default)(t),["parameters"]),(0,m.fromJS)([])).find(function(e){return m.Map.isMap(e)&&e.get("name")===n&&e.get("in")===r})||(0,m.Map)()}function i(e,t,n){return t=t||[],_(e).getIn(["paths"].concat((0,f.default)(t),["parameters"]),(0,m.fromJS)([])).reduce(function(e,t){var r=n&&"body"===t.get("in")?t.get("value_xml"):t.get("value");return e.set(t.get("in")+"."+t.get("name"),r)},(0,m.fromJS)({}))}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(m.List.isList(e))return e.some(function(e){return m.Map.isMap(e)&&e.get("in")===t})}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(m.List.isList(e))return e.some(function(e){return m.Map.isMap(e)&&e.get("type")===t})}function s(e,t){t=t||[];var n=_(e).getIn(["paths"].concat((0,f.default)(t)),(0,m.fromJS)({})),r=e.getIn(["meta","paths"].concat((0,f.default)(t)),(0,m.fromJS)({})),i=l(e,t),o=n.get("parameters")||new m.List,s=r.get("consumes_value")?r.get("consumes_value"):a(o,"file")?"multipart/form-data":a(o,"formData")?"application/x-www-form-urlencoded":void 0;return(0,m.fromJS)({requestContentType:s,responseContentType:i})}function u(e,t){return t=t||[],_(e).getIn(["paths"].concat((0,f.default)(t),["consumes"]),(0,m.fromJS)({}))}function l(e,t){t=t||[];var n=_(e).getIn(["paths"].concat((0,f.default)(t)),null);if(null!==n){var r=e.getIn(["meta","paths"].concat((0,f.default)(t),["produces_value"]),null),i=n.getIn(["produces",0],null);return r||i||"application/json"}}function c(e){return m.Map.isMap(e)?e:new m.Map}Object.defineProperty(t,"__esModule",{value:!0}),t.validateBeforeExecute=t.canExecuteScheme=t.operationScheme=t.hasHost=t.allowTryItOutFor=t.mutatedRequestFor=t.requestFor=t.responseFor=t.mutatedRequests=t.requests=t.responses=t.taggedOperations=t.operationsWithTags=t.tagDetails=t.tags=t.operationsWithRootInherited=t.schemes=t.host=t.basePath=t.definitions=t.findDefinition=t.securityDefinitions=t.security=t.produces=t.consumes=t.operations=t.paths=t.semver=t.version=t.externalDocs=t.info=t.isOAS3=t.spec=t.specResolved=t.specJson=t.specSource=t.specStr=t.url=t.lastError=void 0;var p=n(97),f=function(e){return e&&e.__esModule?e:{default:e}}(p);t.getParameter=r,t.parameterValues=i,t.parametersIncludeIn=o,t.parametersIncludeType=a,t.contentTypeValues=s,t.operationConsumes=u,t.currentProducesFor=l;var h=n(60),d=n(9),m=n(7),v=["get","put","post","delete","options","head","patch","trace"],g=function(e){return e||(0,m.Map)()},y=(t.lastError=(0,h.createSelector)(g,function(e){return e.get("lastError")}),t.url=(0,h.createSelector)(g,function(e){return e.get("url")}),t.specStr=(0,h.createSelector)(g,function(e){return e.get("spec")||""}),t.specSource=(0,h.createSelector)(g,function(e){return e.get("specSource")||"not-editor"}),t.specJson=(0,h.createSelector)(g,function(e){return e.get("json",(0,m.Map)())}),t.specResolved=(0,h.createSelector)(g,function(e){return e.get("resolved",(0,m.Map)())})),_=t.spec=function(e){return y(e)},b=(t.isOAS3=(0,h.createSelector)(_,function(){return!1}),t.info=(0,h.createSelector)(_,function(e){return c(e&&e.get("info"))})),x=(t.externalDocs=(0,h.createSelector)(_,function(e){return c(e&&e.get("externalDocs"))}),t.version=(0,h.createSelector)(b,function(e){return e&&e.get("version")})),w=(t.semver=(0,h.createSelector)(x,function(e){return/v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(e).slice(1)}),t.paths=(0,h.createSelector)(_,function(e){return e.get("paths")})),k=t.operations=(0,h.createSelector)(w,function(e){if(!e||e.size<1)return(0,m.List)();var t=(0,m.List)();return e&&e.forEach?(e.forEach(function(e,n){if(!e||!e.forEach)return{};e.forEach(function(e,r){v.indexOf(r)<0||(t=t.push((0,m.fromJS)({path:n,method:r,operation:e,id:r+"-"+n})))})}),t):(0,m.List)()}),E=t.consumes=(0,h.createSelector)(_,function(e){return(0,m.Set)(e.get("consumes"))}),S=t.produces=(0,h.createSelector)(_,function(e){return(0,m.Set)(e.get("produces"))}),C=(t.security=(0,h.createSelector)(_,function(e){return e.get("security",(0,m.List)())}),t.securityDefinitions=(0,h.createSelector)(_,function(e){return e.get("securityDefinitions")}),t.findDefinition=function(e,t){return y(e).getIn(["definitions",t],null)},t.definitions=(0,h.createSelector)(_,function(e){return e.get("definitions")||(0,m.Map)()}),t.basePath=(0,h.createSelector)(_,function(e){return e.get("basePath")}),t.host=(0,h.createSelector)(_,function(e){return e.get("host")}),t.schemes=(0,h.createSelector)(_,function(e){return e.get("schemes",(0,m.Map)())}),t.operationsWithRootInherited=(0,h.createSelector)(k,E,S,function(e,t,n){return e.map(function(e){return e.update("operation",function(e){if(e){if(!m.Map.isMap(e))return;return e.withMutations(function(e){return e.get("consumes")||e.update("consumes",function(e){return(0,m.Set)(e).merge(t)}),e.get("produces")||e.update("produces",function(e){return(0,m.Set)(e).merge(n)}),e})}return(0,m.Map)()})})})),A=t.tags=(0,h.createSelector)(_,function(e){return e.get("tags",(0,m.List)())}),D=t.tagDetails=function(e,t){return(A(e)||(0,m.List)()).filter(m.Map.isMap).find(function(e){return e.get("name")===t},(0,m.Map)())},O=t.operationsWithTags=(0,h.createSelector)(C,A,function(e,t){return e.reduce(function(e,t){var n=(0,m.Set)(t.getIn(["operation","tags"]));return n.count()<1?e.update("default",(0,m.List)(),function(e){return e.push(t)}):n.reduce(function(e,n){return e.update(n,(0,m.List)(),function(e){return e.push(t)})},e)},t.reduce(function(e,t){return e.set(t.get("name"),(0,m.List)())},(0,m.OrderedMap)()))}),M=(t.taggedOperations=function(e){return function(t){var n=t.getConfigs,r=n(),i=r.tagsSorter,o=r.operationsSorter;return O(e).sortBy(function(e,t){return t},function(e,t){var n="function"==typeof i?i:d.sorters.tagsSorter[i];return n?n(e,t):null}).map(function(t,n){var r="function"==typeof o?o:d.sorters.operationsSorter[o],i=r?t.sort(r):t;return(0,m.Map)({tagDetails:D(e,n),operations:i})})}},t.responses=(0,h.createSelector)(g,function(e){return e.get("responses",(0,m.Map)())})),T=t.requests=(0,h.createSelector)(g,function(e){return e.get("requests",(0,m.Map)())}),P=t.mutatedRequests=(0,h.createSelector)(g,function(e){return e.get("mutatedRequests",(0,m.Map)())}),I=(t.responseFor=function(e,t,n){return M(e).getIn([t,n],null)},t.requestFor=function(e,t,n){return T(e).getIn([t,n],null)},t.mutatedRequestFor=function(e,t,n){return P(e).getIn([t,n],null)},t.allowTryItOutFor=function(){return!0},t.hasHost=(0,h.createSelector)(_,function(e){var t=e.get("host");return"string"==typeof t&&t.length>0&&"/"!==t[0]}),t.operationScheme=function(e,t,n){var r=e.get("url"),i=r.match(/^([a-z][a-z0-9+\-.]*):/),o=Array.isArray(i)?i[1]:null;return e.getIn(["scheme",t,n])||e.getIn(["scheme","_defaultScheme"])||o||""});t.canExecuteScheme=function(e,t,n){return["http","https"].indexOf(I(e,t,n))>-1},t.validateBeforeExecute=function(e,t){t=t||[];var n=_(e).getIn(["paths"].concat((0,f.default)(t),["parameters"]),(0,m.fromJS)([])),r=!0;return n.forEach(function(e){var t=e.get("errors");t&&t.count()&&(r=!1)}),r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.updateSpec=function(e,t){var n=t.specActions;return function(){e.apply(void 0,arguments),n.parseToJson.apply(n,arguments)}},t.updateJsonSpec=function(e,t){var n=t.specActions;return function(){e.apply(void 0,arguments),n.resolveSpec.apply(n,arguments)}},t.executeRequest=function(e,t){var n=t.specActions;return function(t){return n.logRequest(t),e(t)}},t.validateParams=function(e,t){var n=t.specSelectors;return function(t){return e(t,n.isOAS3())}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(1093),_=r(y),b=["split-pane-mode"],x="left",w="right",k="both",E=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.initializeComponent=function(e){r.splitPane=e},r.onDragFinished=function(){var e=r.props,t=e.threshold,n=e.layoutActions,i=r.splitPane.state,o=i.position,a=i.draggedSize;r.draggedSize=a;var s=o<=t,u=a<=t;n.changeMode(b,s?w:u?x:k)},r.sizeFromMode=function(e,t){return e===x?(r.draggedSize=null,"0px"):e===w?(r.draggedSize=null,"100%"):r.draggedSize||t},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.layoutSelectors,r=n.whatMode(b),i=r===w?m.default.createElement("noscript",null):t[0],o=r===x?m.default.createElement("noscript",null):t[1],a=this.sizeFromMode(r,"50%");return m.default.createElement(_.default,{disabledClass:"",ref:this.initializeComponent,split:"vertical",defaultSize:"50%",primary:"second",minSize:0,size:a,onDragFinished:this.onDragFinished,allowResize:r!==x&&r!==w,resizerStyle:{flex:"0 0 auto",position:"relative"}},i,o)}}]),t}(m.default.Component);E.propTypes={threshold:g.default.number,children:g.default.array,layoutSelectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired},E.defaultProps={threshold:100,children:[]},t.default=E},function(e,t,n){"use strict";function r(){return{components:{SplitPaneMode:o.default}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(324),o=function(e){return e&&e.__esModule?e:{default:e}}(i)},function(e,t,n){"use strict";var r=n(495),i=function(e){return e&&e.__esModule?e:{default:e}}(r);e.exports=function(e){var t=e.configs;return{fn:{fetch:i.default.makeHttp(t.preFetch,t.postFetch),buildRequest:i.default.buildRequest,execute:i.default.execute,resolve:i.default.resolve,serializeRes:i.default.serializeRes,opId:i.default.helpers.opId}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{fn:{shallowEqualKeys:r.shallowEqualKeys}}};var r=n(9)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.getComponents,n=e.getStore,r=e.getSystem,a=i.getComponent,s=i.render,u=i.makeMappedContainer,l=(0,o.memoize)(a.bind(null,r,n,t));return{rootInjects:{getComponent:l,makeMappedContainer:(0,o.memoize)(u.bind(null,r,n,l,t)),render:s.bind(null,r,n,a,t)}}};var r=n(329),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r),o=n(9)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getComponent=t.render=t.makeMappedContainer=void 0;var i=n(48),o=r(i),a=n(47),s=r(a),u=n(30),l=r(u),c=n(21),p=r(c),f=n(4),h=r(f),d=n(2),m=r(d),v=n(3),g=r(v),y=n(6),_=r(y),b=n(5),x=r(b),w=n(0),k=r(w),E=n(449),S=r(E),C=n(1090),A=n(950),D=r(A),O=function(e,t){return function(n){function r(){return(0,m.default)(this,r),(0,_.default)(this,(r.__proto__||(0,h.default)(r)).apply(this,arguments))}return(0,x.default)(r,n),(0,g.default)(r,[{key:"render",value:function(){return k.default.createElement(t,(0,p.default)({},e(),this.props,this.context))}}]),r}(w.Component)},M=function(e,t){return function(n){function r(){return(0,m.default)(this,r),(0,_.default)(this,(r.__proto__||(0,h.default)(r)).apply(this,arguments))}return(0,x.default)(r,n),(0,g.default)(r,[{key:"render",value:function(){return k.default.createElement(C.Provider,{store:e},k.default.createElement(t,(0,p.default)({},this.props,this.context)))}}]),r}(w.Component)},T=function(e,t,n){var r=function(n,r){var i=(0,l.default)({},r,e());return(t.prototype.mapStateToProps||function(e){return{state:e}})(n,i)},i=O(e,t),o=(0,C.connect)(r)(i);return n?M(n,o):o},P=function(e,t,n,r){for(var i in t){var o=t[i];"function"==typeof o&&o(n[i],r[i],e())}},I=(t.makeMappedContainer=function(e,t,n,r,i,o){return function(t){function r(t,n){(0,m.default)(this,r);var i=(0,_.default)(this,(r.__proto__||(0,h.default)(r)).call(this,t,n));return P(e,o,t,{}),i}return(0,x.default)(r,t),(0,g.default)(r,[{key:"componentWillReceiveProps",value:function(t){P(e,o,t,this.props)}},{key:"render",value:function(){var e=(0,D.default)(this.props,o?(0,s.default)(o):[]),t=n(i,"root");return k.default.createElement(t,e)}}]),r}(w.Component)},t.render=function(e,t,n,r,i){var o=n(e,t,r,"App","root");S.default.render(k.default.createElement(o,null),i)},function(e){return function(t){function n(){return(0,m.default)(this,n),(0,_.default)(this,(n.__proto__||(0,h.default)(n)).apply(this,arguments))}return(0,x.default)(n,t),(0,g.default)(n,[{key:"render",value:function(){return e(this.props)}}]),n}(w.Component)}),R=function(e){var t=e.name;return k.default.createElement("div",{style:{padding:"1em",color:"#aaa"}},"😱 ",k.default.createElement("i",null,"Could not render ","t"===t?"this component":t,", see the console."))},j=function(e){var t=function(e){return!(e.prototype&&e.prototype.isReactComponent)}(e)?I(e):e,n=t.prototype.render;return t.prototype.render=function(){try{for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return n.apply(this,r)}catch(e){return console.error(e),k.default.createElement(R,{error:e,name:t.name})}},t};t.getComponent=function(e,t,n,r,i){if("string"!=typeof r)throw new TypeError("Need a string, to fetch a component. Was given a "+(void 0===r?"undefined":(0,o.default)(r)));var a=n(r);return a?i?"root"===i?T(e,a,t()):T(e,j(a)):j(a):(e().log.warn("Could not find component",r),null)}},function(e,t,n){e.exports={default:n(590),__esModule:!0}},function(e,t,n){e.exports={default:n(591),__esModule:!0}},function(e,t,n){e.exports={default:n(595),__esModule:!0}},function(e,t,n){"use strict";function r(){}function i(e){var t,n,r=e.walker();for(this.buffer="",this.lastOut="\n";t=r.next();)n=t.node.type,this[n]&&this[n](t.node,t.entering);return this.buffer}function o(e){this.buffer+=e,this.lastOut=e}function a(){"\n"!==this.lastOut&&this.lit("\n")}function s(e){this.lit(e)}function u(e){return e}r.prototype.render=i,r.prototype.out=s,r.prototype.lit=o,r.prototype.cr=a,r.prototype.esc=u,e.exports=r},function(e,t,n){var r=n(24).document;e.exports=r&&r.documentElement},function(e,t,n){e.exports=!n(49)&&!n(54)(function(){return 7!=Object.defineProperty(n(179)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(74),i=n(22)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(99);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(37);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){"use strict";var r=n(130),i=n(23),o=n(186),a=n(56),s=n(55),u=n(74),l=n(608),c=n(102),p=n(344),f=n(22)("iterator"),h=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,m,v,g,y){l(n,t,m);var _,b,x,w=function(e){if(!h&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},k=t+" Iterator",E="values"==v,S=!1,C=e.prototype,A=C[f]||C["@@iterator"]||v&&C[v],D=!h&&A||w(v),O=v?E?w("entries"):D:void 0,M="Array"==t?C.entries||A:A;if(M&&(x=p(M.call(new e)))!==Object.prototype&&x.next&&(c(x,k,!0),r||s(x,f)||a(x,f,d)),E&&A&&"values"!==A.name&&(S=!0,D=function(){return A.call(this)}),r&&!y||!h&&!S&&C[f]||a(C,f,D),u[t]=D,u[k]=d,v)if(_={values:E?D:w("values"),keys:g?D:w("keys"),entries:O},y)for(b in _)b in C||o(C,b,_[b]);else i(i.P+i.F*(h||S),t,_);return _}},function(e,t,n){var r=n(22)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(100),i=n(184),o=n(132),a=n(76),s=n(181),u=Object.assign;e.exports=!u||n(54)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r})?function(e,t){for(var n=a(e),u=arguments.length,l=1,c=i.f,p=o.f;u>l;)for(var f,h=s(arguments[l++]),d=c?r(h).concat(c(h)):r(h),m=d.length,v=0;m>v;)p.call(h,f=d[v++])&&(n[f]=h[f]);return n}:u},function(e,t,n){var r=n(132),i=n(101),o=n(75),a=n(190),s=n(55),u=n(335),l=Object.getOwnPropertyDescriptor;t.f=n(49)?l:function(e,t){if(e=o(e),t=a(t,!0),u)try{return l(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(345),i=n(180).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(55),i=n(76),o=n(187)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(55),i=n(75),o=n(600)(!1),a=n(187)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,l=[];for(n in s)n!=a&&r(s,n)&&l.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(l,n)||l.push(n));return l}},function(e,t,n){var r=n(23),i=n(15),o=n(54);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(37),i=n(27),o=n(182);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var r=n(37),i=n(98),o=n(22)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[o])?t:i(n)}},function(e,t,n){var r,i,o,a=n(53),s=n(607),u=n(334),l=n(179),c=n(24),p=c.process,f=c.setImmediate,h=c.clearImmediate,d=c.MessageChannel,m=c.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},_=function(e){y.call(e.data)};f&&h||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},h=function(e){delete g[e]},"process"==n(99)(p)?r=function(e){p.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=_,r=a(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",_,!1)):r="onreadystatechange"in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:h}},function(e,t,n){var r=n(27);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(31).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(77),i=n(105),o=n(19)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){"use strict";var r=n(356),i=n(28),o=n(78),a=n(64),s=n(108),u=n(109),l=n(647),c=n(199),p=n(653),f=n(19)("iterator"),h=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,m,v,g,y){l(n,t,m);var _,b,x,w=function(e){if(!h&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},k=t+" Iterator",E="values"==v,S=!1,C=e.prototype,A=C[f]||C["@@iterator"]||v&&C[v],D=!h&&A||w(v),O=v?E?w("entries"):D:void 0,M="Array"==t?C.entries||A:A;if(M&&(x=p(M.call(new e)))!==Object.prototype&&x.next&&(c(x,k,!0),r||s(x,f)||a(x,f,d)),E&&A&&"values"!==A.name&&(S=!0,D=function(){return A.call(this)}),r&&!y||!h&&!S&&C[f]||a(C,f,D),u[t]=D,u[k]=d,v)if(_={values:E?D:w("values"),keys:g?D:w("keys"),entries:O},y)for(b in _)b in C||o(C,b,_[b]);else i(i.P+i.F*(h||S),t,_);return _}},function(e,t){e.exports=!1},function(e,t,n){var r=n(654),i=n(352);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(62),i=n(77),o=n(198);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(31),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t,n){var r=n(62),i=n(135),o=n(19)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[o])?t:i(n)}},function(e,t,n){var r=n(139),i=n(57);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),u=r(n),l=s.length;return u<0||u>=l?e?"":void 0:(o=s.charCodeAt(u),o<55296||o>56319||u+1===l||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536)}}},function(e,t,n){var r,i,o,a=n(136),s=n(643),u=n(353),l=n(196),c=n(31),p=c.process,f=c.setImmediate,h=c.clearImmediate,d=c.MessageChannel,m=c.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},_=function(e){y.call(e.data)};f&&h||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},h=function(e){delete g[e]},"process"==n(105)(p)?r=function(e){p.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=_,r=a(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",_,!1)):r="onreadystatechange"in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:h}},function(e,t,n){var r=n(139),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},function(e,t,n){"use strict";var r=n(363)(!0);n(355)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";function r(e){return(0,o.default)(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(763),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t){var n=e.exports={get firstChild(){var e=this.children;return e&&e[0]||null},get lastChild(){var e=this.children;return e&&e[e.length-1]||null},get nodeType(){return i[this.type]||i.element}},r={tagName:"name",childNodes:"children",parentNode:"parent",previousSibling:"prev",nextSibling:"next",nodeValue:"data"},i={element:1,text:3,cdata:4,comment:8};Object.keys(r).forEach(function(e){var t=r[e];Object.defineProperty(n,e,{get:function(){return this[t]||null},set:function(e){return this[t]=e,e}})})},function(e,t,n){function r(e){if(e>=55296&&e<=57343||e>1114111)return"�";e in i&&(e=i[e]);var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)}var i=n(712);e.exports=r},function(e,t){e.exports={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"}},function(e,t,n){"use strict";var r,i,o,a,s=n(65),u=function(e,t){return t};try{Object.defineProperty(u,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(e){}1===u.length?(r={configurable:!0,writable:!1,enumerable:!1},i=Object.defineProperty,e.exports=function(e,t){return t=s(t),e.length===t?e:(r.value=t,i(e,"length",r))}):(a=n(375),o=function(){var e=[];return function(t){var n,r=0;if(e[t])return e[t];for(n=[];t--;)n.push("a"+(++r).toString(36));return new Function("fn","return function ("+n.join(", ")+") { return fn.apply(this, arguments); };")}}(),e.exports=function(e,t){var n;if(t=s(t),e.length===t)return e;n=o(t)(e);try{a(n,e)}catch(e){}return n})},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";e.exports=n(727)()?Object.assign:n(728)},function(e,t,n){"use strict";var r=n(58),i=n(142),o=Function.prototype.call;e.exports=function(e,t){var n={},a=arguments[2];return r(t),i(e,function(e,r,i,s){n[r]=o.call(t,a,e,r,i,s)}),n}},function(e,t,n){"use strict";var r=n(115),i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;e.exports=function(e,t){var n,u=Object(r(t));if(e=Object(r(e)),a(u).forEach(function(r){try{i(e,r,o(t,r))}catch(e){n=e}}),"function"==typeof s&&s(u).forEach(function(r){try{i(e,r,o(t,r))}catch(e){n=e}}),void 0!==n)throw n;return e}},function(e,t,n){"use strict";var r=n(79),i=Array.prototype.forEach,o=Object.create,a=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=o(null);return i.call(arguments,function(e){r(e)&&a(Object(e),t)}),t}},function(e,t,n){"use strict";var r=n(32),i={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=i},function(e,t,n){"use strict";function r(e){try{e.focus()}catch(e){}}e.exports=r},function(e,t,n){"use strict";function r(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}e.exports=r},function(e,t,n){function r(e,t){this._options=t||{},this._cbs=e||{},this._tagname="",this._attribname="",this._attribvalue="",this._attribs=null,this._stack=[],this.startIndex=0,this.endIndex=null,this._lowerCaseTagNames="lowerCaseTags"in this._options?!!this._options.lowerCaseTags:!this._options.xmlMode,this._lowerCaseAttributeNames="lowerCaseAttributeNames"in this._options?!!this._options.lowerCaseAttributeNames:!this._options.xmlMode,this._options.Tokenizer&&(i=this._options.Tokenizer),this._tokenizer=new i(this._options,this),this._cbs.onparserinit&&this._cbs.onparserinit(this)}var i=n(381),o={input:!0,option:!0,optgroup:!0,select:!0,button:!0,datalist:!0,textarea:!0},a={tr:{tr:!0,th:!0,td:!0},th:{th:!0},td:{thead:!0,th:!0,td:!0},body:{head:!0,link:!0,script:!0},li:{li:!0},p:{p:!0},h1:{p:!0},h2:{p:!0},h3:{p:!0},h4:{p:!0},h5:{p:!0},h6:{p:!0},select:o,input:o,output:o,button:o,datalist:o,textarea:o,option:{option:!0},optgroup:{optgroup:!0}},s={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,path:!0,circle:!0,ellipse:!0,line:!0,rect:!0,use:!0,stop:!0,polyline:!0,polygon:!0},u=/\s|\//;n(42)(r,n(143).EventEmitter),r.prototype._updatePosition=function(e){null===this.endIndex?this._tokenizer._sectionStart<=e?this.startIndex=0:this.startIndex=this._tokenizer._sectionStart-e:this.startIndex=this.endIndex+1,this.endIndex=this._tokenizer.getAbsoluteIndex()},r.prototype.ontext=function(e){this._updatePosition(1),this.endIndex--,this._cbs.ontext&&this._cbs.ontext(e)},r.prototype.onopentagname=function(e){if(this._lowerCaseTagNames&&(e=e.toLowerCase()),this._tagname=e,!this._options.xmlMode&&e in a)for(var t;(t=this._stack[this._stack.length-1])in a[e];this.onclosetag(t));!this._options.xmlMode&&e in s||this._stack.push(e),this._cbs.onopentagname&&this._cbs.onopentagname(e),this._cbs.onopentag&&(this._attribs={})},r.prototype.onopentagend=function(){this._updatePosition(1),this._attribs&&(this._cbs.onopentag&&this._cbs.onopentag(this._tagname,this._attribs),this._attribs=null),!this._options.xmlMode&&this._cbs.onclosetag&&this._tagname in s&&this._cbs.onclosetag(this._tagname),this._tagname=""},r.prototype.onclosetag=function(e){if(this._updatePosition(1),this._lowerCaseTagNames&&(e=e.toLowerCase()),!this._stack.length||e in s&&!this._options.xmlMode)this._options.xmlMode||"br"!==e&&"p"!==e||(this.onopentagname(e),this._closeCurrentTag());else{var t=this._stack.lastIndexOf(e);if(-1!==t)if(this._cbs.onclosetag)for(t=this._stack.length-t;t--;)this._cbs.onclosetag(this._stack.pop());else this._stack.length=t;else"p"!==e||this._options.xmlMode||(this.onopentagname(e),this._closeCurrentTag())}},r.prototype.onselfclosingtag=function(){this._options.xmlMode||this._options.recognizeSelfClosing?this._closeCurrentTag():this.onopentagend()},r.prototype._closeCurrentTag=function(){var e=this._tagname;this.onopentagend(),this._stack[this._stack.length-1]===e&&(this._cbs.onclosetag&&this._cbs.onclosetag(e),this._stack.pop())},r.prototype.onattribname=function(e){this._lowerCaseAttributeNames&&(e=e.toLowerCase()),this._attribname=e},r.prototype.onattribdata=function(e){this._attribvalue+=e},r.prototype.onattribend=function(){this._cbs.onattribute&&this._cbs.onattribute(this._attribname,this._attribvalue),this._attribs&&!Object.prototype.hasOwnProperty.call(this._attribs,this._attribname)&&(this._attribs[this._attribname]=this._attribvalue),this._attribname="",this._attribvalue=""},r.prototype._getInstructionName=function(e){var t=e.search(u),n=t<0?e:e.substr(0,t);return this._lowerCaseTagNames&&(n=n.toLowerCase()),n},r.prototype.ondeclaration=function(e){if(this._cbs.onprocessinginstruction){var t=this._getInstructionName(e);this._cbs.onprocessinginstruction("!"+t,"!"+e)}},r.prototype.onprocessinginstruction=function(e){if(this._cbs.onprocessinginstruction){var t=this._getInstructionName(e);this._cbs.onprocessinginstruction("?"+t,"?"+e)}},r.prototype.oncomment=function(e){this._updatePosition(4),this._cbs.oncomment&&this._cbs.oncomment(e),this._cbs.oncommentend&&this._cbs.oncommentend()},r.prototype.oncdata=function(e){this._updatePosition(1),this._options.xmlMode||this._options.recognizeCDATA?(this._cbs.oncdatastart&&this._cbs.oncdatastart(),this._cbs.ontext&&this._cbs.ontext(e),this._cbs.oncdataend&&this._cbs.oncdataend()):this.oncomment("[CDATA["+e+"]]")},r.prototype.onerror=function(e){this._cbs.onerror&&this._cbs.onerror(e)},r.prototype.onend=function(){if(this._cbs.onclosetag)for(var e=this._stack.length;e>0;this._cbs.onclosetag(this._stack[--e]));this._cbs.onend&&this._cbs.onend()},r.prototype.reset=function(){this._cbs.onreset&&this._cbs.onreset(),this._tokenizer.reset(),this._tagname="",this._attribname="",this._attribs=null,this._stack=[],this._cbs.onparserinit&&this._cbs.onparserinit(this)},r.prototype.parseComplete=function(e){this.reset(),this.end(e)},r.prototype.write=function(e){this._tokenizer.write(e)},r.prototype.end=function(e){this._tokenizer.end(e)},r.prototype.pause=function(){this._tokenizer.pause()},r.prototype.resume=function(){this._tokenizer.resume()},r.prototype.parseChunk=r.prototype.write,r.prototype.done=r.prototype.end,e.exports=r},function(e,t,n){function r(e){return" "===e||"\n"===e||"\t"===e||"\f"===e||"\r"===e}function i(e,t,n){var r=e.toLowerCase();return e===r?function(e){e===r?this._state=t:(this._state=n,this._index--)}:function(i){i===r||i===e?this._state=t:(this._state=n,this._index--)}}function o(e,t){var n=e.toLowerCase();return function(r){r===n||r===e?this._state=t:(this._state=d,this._index--)}}function a(e,t){this._state=f,this._buffer="",this._sectionStart=0,this._index=0,this._bufferOffset=0,this._baseState=f,this._special=de,this._cbs=t,this._running=!0,this._ended=!1,this._xmlMode=!(!e||!e.xmlMode),this._decodeEntities=!(!e||!e.decodeEntities)}e.exports=a;var s=n(369),u=n(204),l=n(370),c=n(205),p=0,f=p++,h=p++,d=p++,m=p++,v=p++,g=p++,y=p++,_=p++,b=p++,x=p++,w=p++,k=p++,E=p++,S=p++,C=p++,A=p++,D=p++,O=p++,M=p++,T=p++,P=p++,I=p++,R=p++,j=p++,F=p++,N=p++,B=p++,L=p++,q=p++,z=p++,U=p++,W=p++,V=p++,H=p++,G=p++,J=p++,K=p++,X=p++,Y=p++,$=p++,Z=p++,Q=p++,ee=p++,te=p++,ne=p++,re=p++,ie=p++,oe=p++,ae=p++,se=p++,ue=p++,le=p++,ce=p++,pe=p++,fe=p++,he=0,de=he++,me=he++,ve=he++;a.prototype._stateText=function(e){"<"===e?(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._state=h,this._sectionStart=this._index):this._decodeEntities&&this._special===de&&"&"===e&&(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._baseState=f,this._state=ue,this._sectionStart=this._index)},a.prototype._stateBeforeTagName=function(e){"/"===e?this._state=v:"<"===e?(this._cbs.ontext(this._getSection()),this._sectionStart=this._index):">"===e||this._special!==de||r(e)?this._state=f:"!"===e?(this._state=C,this._sectionStart=this._index+1):"?"===e?(this._state=D,this._sectionStart=this._index+1):(this._state=this._xmlMode||"s"!==e&&"S"!==e?d:U,this._sectionStart=this._index)},a.prototype._stateInTagName=function(e){("/"===e||">"===e||r(e))&&(this._emitToken("onopentagname"),this._state=_,this._index--)},a.prototype._stateBeforeCloseingTagName=function(e){r(e)||(">"===e?this._state=f:this._special!==de?"s"===e||"S"===e?this._state=W:(this._state=f,this._index--):(this._state=g,this._sectionStart=this._index))},a.prototype._stateInCloseingTagName=function(e){(">"===e||r(e))&&(this._emitToken("onclosetag"),this._state=y,this._index--)},a.prototype._stateAfterCloseingTagName=function(e){">"===e&&(this._state=f,this._sectionStart=this._index+1)},a.prototype._stateBeforeAttributeName=function(e){">"===e?(this._cbs.onopentagend(),this._state=f,this._sectionStart=this._index+1):"/"===e?this._state=m:r(e)||(this._state=b,this._sectionStart=this._index)},a.prototype._stateInSelfClosingTag=function(e){">"===e?(this._cbs.onselfclosingtag(),this._state=f,this._sectionStart=this._index+1):r(e)||(this._state=_,this._index--)},a.prototype._stateInAttributeName=function(e){("="===e||"/"===e||">"===e||r(e))&&(this._cbs.onattribname(this._getSection()),this._sectionStart=-1,this._state=x,this._index--)},a.prototype._stateAfterAttributeName=function(e){"="===e?this._state=w:"/"===e||">"===e?(this._cbs.onattribend(),this._state=_,this._index--):r(e)||(this._cbs.onattribend(),this._state=b,this._sectionStart=this._index)},a.prototype._stateBeforeAttributeValue=function(e){'"'===e?(this._state=k,this._sectionStart=this._index+1):"'"===e?(this._state=E,this._sectionStart=this._index+1):r(e)||(this._state=S,this._sectionStart=this._index,this._index--)},a.prototype._stateInAttributeValueDoubleQuotes=function(e){'"'===e?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=_):this._decodeEntities&&"&"===e&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=ue,this._sectionStart=this._index)},a.prototype._stateInAttributeValueSingleQuotes=function(e){"'"===e?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=_):this._decodeEntities&&"&"===e&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=ue,this._sectionStart=this._index)},a.prototype._stateInAttributeValueNoQuotes=function(e){r(e)||">"===e?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=_,this._index--):this._decodeEntities&&"&"===e&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=ue,this._sectionStart=this._index)},a.prototype._stateBeforeDeclaration=function(e){this._state="["===e?I:"-"===e?O:A},a.prototype._stateInDeclaration=function(e){">"===e&&(this._cbs.ondeclaration(this._getSection()),this._state=f,this._sectionStart=this._index+1)},a.prototype._stateInProcessingInstruction=function(e){">"===e&&(this._cbs.onprocessinginstruction(this._getSection()),this._state=f,this._sectionStart=this._index+1)},a.prototype._stateBeforeComment=function(e){"-"===e?(this._state=M,this._sectionStart=this._index+1):this._state=A},a.prototype._stateInComment=function(e){"-"===e&&(this._state=T)},a.prototype._stateAfterComment1=function(e){this._state="-"===e?P:M},a.prototype._stateAfterComment2=function(e){">"===e?(this._cbs.oncomment(this._buffer.substring(this._sectionStart,this._index-2)),this._state=f,this._sectionStart=this._index+1):"-"!==e&&(this._state=M)},a.prototype._stateBeforeCdata1=i("C",R,A),a.prototype._stateBeforeCdata2=i("D",j,A),a.prototype._stateBeforeCdata3=i("A",F,A),a.prototype._stateBeforeCdata4=i("T",N,A),a.prototype._stateBeforeCdata5=i("A",B,A),a.prototype._stateBeforeCdata6=function(e){"["===e?(this._state=L,this._sectionStart=this._index+1):(this._state=A,this._index--)},a.prototype._stateInCdata=function(e){"]"===e&&(this._state=q)},a.prototype._stateAfterCdata1=function(e,t){return function(n){n===e&&(this._state=t)}}("]",z),a.prototype._stateAfterCdata2=function(e){">"===e?(this._cbs.oncdata(this._buffer.substring(this._sectionStart,this._index-2)),this._state=f,this._sectionStart=this._index+1):"]"!==e&&(this._state=L)},a.prototype._stateBeforeSpecial=function(e){"c"===e||"C"===e?this._state=V:"t"===e||"T"===e?this._state=ee:(this._state=d,this._index--)},a.prototype._stateBeforeSpecialEnd=function(e){this._special!==me||"c"!==e&&"C"!==e?this._special!==ve||"t"!==e&&"T"!==e?this._state=f:this._state=ie:this._state=X},a.prototype._stateBeforeScript1=o("R",H),a.prototype._stateBeforeScript2=o("I",G),a.prototype._stateBeforeScript3=o("P",J),a.prototype._stateBeforeScript4=o("T",K),a.prototype._stateBeforeScript5=function(e){("/"===e||">"===e||r(e))&&(this._special=me),this._state=d,this._index--},a.prototype._stateAfterScript1=i("R",Y,f),a.prototype._stateAfterScript2=i("I",$,f),a.prototype._stateAfterScript3=i("P",Z,f),a.prototype._stateAfterScript4=i("T",Q,f),a.prototype._stateAfterScript5=function(e){">"===e||r(e)?(this._special=de,this._state=g,this._sectionStart=this._index-6,this._index--):this._state=f},a.prototype._stateBeforeStyle1=o("Y",te),a.prototype._stateBeforeStyle2=o("L",ne),a.prototype._stateBeforeStyle3=o("E",re),a.prototype._stateBeforeStyle4=function(e){("/"===e||">"===e||r(e))&&(this._special=ve),this._state=d,this._index--},a.prototype._stateAfterStyle1=i("Y",oe,f),a.prototype._stateAfterStyle2=i("L",ae,f),a.prototype._stateAfterStyle3=i("E",se,f),a.prototype._stateAfterStyle4=function(e){">"===e||r(e)?(this._special=de,this._state=g,this._sectionStart=this._index-5,this._index--):this._state=f},a.prototype._stateBeforeEntity=i("#",le,ce),a.prototype._stateBeforeNumericEntity=i("X",fe,pe),a.prototype._parseNamedEntityStrict=function(){if(this._sectionStart+1<this._index){var e=this._buffer.substring(this._sectionStart+1,this._index),t=this._xmlMode?c:u;t.hasOwnProperty(e)&&(this._emitPartial(t[e]),this._sectionStart=this._index+1)}},a.prototype._parseLegacyEntity=function(){var e=this._sectionStart+1,t=this._index-e;for(t>6&&(t=6);t>=2;){var n=this._buffer.substr(e,t);if(l.hasOwnProperty(n))return this._emitPartial(l[n]),void(this._sectionStart+=t+1);t--}},a.prototype._stateInNamedEntity=function(e){";"===e?(this._parseNamedEntityStrict(),this._sectionStart+1<this._index&&!this._xmlMode&&this._parseLegacyEntity(),this._state=this._baseState):(e<"a"||e>"z")&&(e<"A"||e>"Z")&&(e<"0"||e>"9")&&(this._xmlMode||this._sectionStart+1===this._index||(this._baseState!==f?"="!==e&&this._parseNamedEntityStrict():this._parseLegacyEntity()),this._state=this._baseState,this._index--)},a.prototype._decodeNumericEntity=function(e,t){var n=this._sectionStart+e;if(n!==this._index){var r=this._buffer.substring(n,this._index),i=parseInt(r,t);this._emitPartial(s(i)),this._sectionStart=this._index}else this._sectionStart--;this._state=this._baseState},a.prototype._stateInNumericEntity=function(e){";"===e?(this._decodeNumericEntity(2,10),this._sectionStart++):(e<"0"||e>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(2,10),this._index--)},a.prototype._stateInHexEntity=function(e){";"===e?(this._decodeNumericEntity(3,16),this._sectionStart++):(e<"a"||e>"f")&&(e<"A"||e>"F")&&(e<"0"||e>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(3,16),this._index--)},a.prototype._cleanup=function(){this._sectionStart<0?(this._buffer="",this._bufferOffset+=this._index,this._index=0):this._running&&(this._state===f?(this._sectionStart!==this._index&&this._cbs.ontext(this._buffer.substr(this._sectionStart)),this._buffer="",this._bufferOffset+=this._index,this._index=0):this._sectionStart===this._index?(this._buffer="",this._bufferOffset+=this._index,this._index=0):(this._buffer=this._buffer.substr(this._sectionStart),this._index-=this._sectionStart,this._bufferOffset+=this._sectionStart),this._sectionStart=0)},a.prototype.write=function(e){this._ended&&this._cbs.onerror(Error(".write() after done!")),this._buffer+=e,this._parse()},a.prototype._parse=function(){for(;this._index<this._buffer.length&&this._running;){var e=this._buffer.charAt(this._index);this._state===f?this._stateText(e):this._state===h?this._stateBeforeTagName(e):this._state===d?this._stateInTagName(e):this._state===v?this._stateBeforeCloseingTagName(e):this._state===g?this._stateInCloseingTagName(e):this._state===y?this._stateAfterCloseingTagName(e):this._state===m?this._stateInSelfClosingTag(e):this._state===_?this._stateBeforeAttributeName(e):this._state===b?this._stateInAttributeName(e):this._state===x?this._stateAfterAttributeName(e):this._state===w?this._stateBeforeAttributeValue(e):this._state===k?this._stateInAttributeValueDoubleQuotes(e):this._state===E?this._stateInAttributeValueSingleQuotes(e):this._state===S?this._stateInAttributeValueNoQuotes(e):this._state===C?this._stateBeforeDeclaration(e):this._state===A?this._stateInDeclaration(e):this._state===D?this._stateInProcessingInstruction(e):this._state===O?this._stateBeforeComment(e):this._state===M?this._stateInComment(e):this._state===T?this._stateAfterComment1(e):this._state===P?this._stateAfterComment2(e):this._state===I?this._stateBeforeCdata1(e):this._state===R?this._stateBeforeCdata2(e):this._state===j?this._stateBeforeCdata3(e):this._state===F?this._stateBeforeCdata4(e):this._state===N?this._stateBeforeCdata5(e):this._state===B?this._stateBeforeCdata6(e):this._state===L?this._stateInCdata(e):this._state===q?this._stateAfterCdata1(e):this._state===z?this._stateAfterCdata2(e):this._state===U?this._stateBeforeSpecial(e):this._state===W?this._stateBeforeSpecialEnd(e):this._state===V?this._stateBeforeScript1(e):this._state===H?this._stateBeforeScript2(e):this._state===G?this._stateBeforeScript3(e):this._state===J?this._stateBeforeScript4(e):this._state===K?this._stateBeforeScript5(e):this._state===X?this._stateAfterScript1(e):this._state===Y?this._stateAfterScript2(e):this._state===$?this._stateAfterScript3(e):this._state===Z?this._stateAfterScript4(e):this._state===Q?this._stateAfterScript5(e):this._state===ee?this._stateBeforeStyle1(e):this._state===te?this._stateBeforeStyle2(e):this._state===ne?this._stateBeforeStyle3(e):this._state===re?this._stateBeforeStyle4(e):this._state===ie?this._stateAfterStyle1(e):this._state===oe?this._stateAfterStyle2(e):this._state===ae?this._stateAfterStyle3(e):this._state===se?this._stateAfterStyle4(e):this._state===ue?this._stateBeforeEntity(e):this._state===le?this._stateBeforeNumericEntity(e):this._state===ce?this._stateInNamedEntity(e):this._state===pe?this._stateInNumericEntity(e):this._state===fe?this._stateInHexEntity(e):this._cbs.onerror(Error("unknown _state"),this._state),this._index++}this._cleanup()},a.prototype.pause=function(){this._running=!1},a.prototype.resume=function(){this._running=!0,this._index<this._buffer.length&&this._parse(),this._ended&&this._finish()},a.prototype.end=function(e){this._ended&&this._cbs.onerror(Error(".end() after done!")),e&&this.write(e),this._ended=!0,this._running&&this._finish()},a.prototype._finish=function(){this._sectionStart<this._index&&this._handleTrailingData(),this._cbs.onend()},a.prototype._handleTrailingData=function(){var e=this._buffer.substr(this._sectionStart);this._state===L||this._state===q||this._state===z?this._cbs.oncdata(e):this._state===M||this._state===T||this._state===P?this._cbs.oncomment(e):this._state!==ce||this._xmlMode?this._state!==pe||this._xmlMode?this._state!==fe||this._xmlMode?this._state!==d&&this._state!==_&&this._state!==w&&this._state!==x&&this._state!==b&&this._state!==E&&this._state!==k&&this._state!==S&&this._state!==g&&this._cbs.ontext(e):(this._decodeNumericEntity(3,16),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData())):(this._decodeNumericEntity(2,10),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData())):(this._parseLegacyEntity(),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData()))},a.prototype.reset=function(){a.call(this,{xmlMode:this._xmlMode,decodeEntities:this._decodeEntities},this._cbs)},a.prototype.getAbsoluteIndex=function(){return this._bufferOffset+this._index},a.prototype._getSection=function(){return this._buffer.substring(this._sectionStart,this._index)},a.prototype._emitToken=function(e){this._cbs[e](this._getSection()),this._sectionStart=-1},a.prototype._emitPartial=function(e){this._baseState!==f?this._cbs.onattribdata(e):this._cbs.ontext(e)}},function(e,t,n){function r(e,t){var n=this._parser=new i(e,t),r=this._decoder=new a;o.call(this,{decodeStrings:!1}),this.once("finish",function(){n.end(r.end())})}e.exports=r;var i=n(380),o=n(493).Writable||n(1209).Writable,a=n(265).StringDecoder,s=n(40).Buffer;n(42)(r,o),o.prototype._write=function(e,t,n){e instanceof s&&(e=this._decoder.write(e)),this._parser.write(e),n()}},function(e,t,n){"use strict";function r(e,t){-1===e.indexOf(t)&&e.push(t)}function i(e,t){if(Array.isArray(t))for(var n=0,i=t.length;n<i;++n)r(e,t[n]);else r(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e instanceof Object&&!Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r,i){for(var o=0,a=e.length;o<a;++o){var s=e[o](t,n,r,i);if(s)return s}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t){function n(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}e.exports=n},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=n(81);e.exports=new r({include:[n(389)]})},function(e,t,n){"use strict";var r=n(81);e.exports=new r({include:[n(212)],implicit:[n(808),n(800),n(802),n(801)]})},function(e,t,n){"use strict";var r=n(821),i=r.a.Symbol;t.a=i},function(e,t,n){"use strict";function r(e){if(!n.i(a.a)(e)||n.i(i.a)(e)!=s)return!1;var t=n.i(o.a)(e);if(null===t)return!0;var r=p.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==f}var i=n(815),o=n(817),a=n(822),s="[object Object]",u=Function.prototype,l=Object.prototype,c=u.toString,p=l.hasOwnProperty,f=c.call(Object);t.a=r},function(e,t,n){var r=n(43),i=r.Uint8Array;e.exports=i},function(e,t,n){function r(e,t){var n=a(e),r=!n&&o(e),c=!n&&!r&&s(e),f=!n&&!r&&!c&&l(e),h=n||r||c||f,d=h?i(e.length,String):[],m=d.length;for(var v in e)!t&&!p.call(e,v)||h&&("length"==v||c&&("offset"==v||"parent"==v)||f&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||u(v,m))||d.push(v);return d}var i=n(870),o=n(226),a=n(20),s=n(227),u=n(152),l=n(423),c=Object.prototype,p=c.hasOwnProperty;e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}e.exports=n},function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}e.exports=n},function(e,t,n){function r(e,t,n){"__proto__"==t&&i?i(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var i=n(403);e.exports=r},function(e,t,n){function r(e,t,n,T,P,I){var R,j=t&k,F=t&E,N=t&S;if(n&&(R=P?n(e,T,P,I):n(e)),void 0!==R)return R;if(!x(e))return e;var B=_(e);if(B){if(R=v(e),!j)return c(e,R)}else{var L=m(e),q=L==A||L==D;if(b(e))return l(e,j);if(L==O||L==C||q&&!P){if(R=F||q?{}:y(e),!j)return F?f(e,u(R,e)):p(e,s(R,e))}else{if(!M[L])return P?e:{};R=g(e,L,r,j)}}I||(I=new i);var z=I.get(e);if(z)return z;I.set(e,R);var U=N?F?d:h:F?keysIn:w,W=B?void 0:U(e);return o(W||e,function(i,o){W&&(o=i,i=e[o]),a(R,o,r(i,t,n,o,e,I))}),R}var i=n(215),o=n(837),a=n(148),s=n(841),u=n(842),l=n(875),c=n(882),p=n(883),f=n(884),h=n(894),d=n(407),m=n(409),v=n(905),g=n(906),y=n(907),_=n(20),b=n(227),x=n(38),w=n(59),k=1,E=2,S=4,C="[object Arguments]",A="[object Function]",D="[object GeneratorFunction]",O="[object Object]",M={};M[C]=M["[object Array]"]=M["[object ArrayBuffer]"]=M["[object DataView]"]=M["[object Boolean]"]=M["[object Date]"]=M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Map]"]=M["[object Number]"]=M[O]=M["[object RegExp]"]=M["[object Set]"]=M["[object String]"]=M["[object Symbol]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M["[object Error]"]=M[A]=M["[object WeakMap]"]=!1,e.exports=r},function(e,t,n){function r(e,t,n){var r=t(e);return o(e)?r:i(r,n(e))}var i=n(216),o=n(20);e.exports=r},function(e,t,n){function r(e,t,n,s,u){return e===t||(null==e||null==t||!o(e)&&!a(t)?e!==e&&t!==t:i(e,t,n,s,r,u))}var i=n(852),o=n(38),a=n(68);e.exports=r},function(e,t){function n(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}e.exports=n},function(e,t,n){function r(e){if("string"==typeof e)return e;if(a(e))return o(e,r)+"";if(s(e))return c?c.call(e):"";var t=e+"";return"0"==t&&1/e==-u?"-0":t}var i=n(82),o=n(394),a=n(20),s=n(155),u=1/0,l=i?i.prototype:void 0,c=l?l.toString:void 0;e.exports=r},function(e,t,n){function r(e){return function(t){return i(a(o(t).replace(s,"")),e,"")}}var i=n(147),o=n(944),a=n(960),s=RegExp("['’]","g");e.exports=r},function(e,t,n){var r=n(67),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t,n){function r(e,t,n,r,l,c){var p=n&s,f=e.length,h=t.length;if(f!=h&&!(p&&h>f))return!1;var d=c.get(e);if(d&&c.get(t))return d==t;var m=-1,v=!0,g=n&u?new i:void 0;for(c.set(e,t),c.set(t,e);++m<f;){var y=e[m],_=t[m];if(r)var b=p?r(_,y,m,t,e,c):r(y,_,m,e,t,c);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!o(t,function(e,t){if(!a(g,t)&&(y===e||l(y,e,n,r,c)))return g.push(t)})){v=!1;break}}else if(y!==_&&!l(y,_,n,r,c)){v=!1;break}}return c.delete(e),c.delete(t),v}var i=n(832),o=n(395),a=n(873),s=1,u=2;e.exports=r},function(e,t,n){function r(e){return a(o(e,void 0,i),e+"")}var i=n(946),o=n(415),a=n(417);e.exports=r},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(t,n(17))},function(e,t,n){function r(e){return i(e,a,o)}var i=n(398),o=n(408),a=n(424);e.exports=r},function(e,t,n){var r=n(216),i=n(219),o=n(220),a=n(426),s=Object.getOwnPropertySymbols,u=s?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=u},function(e,t,n){var r=n(828),i=n(213),o=n(830),a=n(831),s=n(833),u=n(66),l=n(418),c=l(r),p=l(i),f=l(o),h=l(a),d=l(s),m=u;(r&&"[object DataView]"!=m(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=m(new i)||o&&"[object Promise]"!=m(o.resolve())||a&&"[object Set]"!=m(new a)||s&&"[object WeakMap]"!=m(new s))&&(m=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case c:return"[object DataView]";case p:return"[object Map]";case f:return"[object Promise]";case h:return"[object Set]";case d:return"[object WeakMap]"}return t}),e.exports=m},function(e,t){function n(e){return r.test(e)}var r=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=n},function(e,t,n){function r(e,t,n){if(!s(n))return!1;var r=typeof t;return!!("number"==r?o(n)&&a(t,n.length):"string"==r&&t in n)&&i(n[t],e)}var i=n(120),o=n(86),a=n(152),s=n(38);e.exports=r},function(e,t,n){function r(e){return e===e&&!i(e)}var i=n(38);e.exports=r},function(e,t){function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}e.exports=n},function(e,t){function n(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}e.exports=n},function(e,t,n){function r(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=o(r.length-t,0),u=Array(s);++a<s;)u[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(u),i(e,this,l)}}var i=n(836),o=Math.max;e.exports=r},function(e,t){function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}e.exports=n},function(e,t,n){var r=n(868),i=n(929),o=i(r);e.exports=o},function(e,t){function n(e){if(null!=e){try{return i.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var r=Function.prototype,i=r.toString;e.exports=n},function(e,t,n){function r(e,t){return null!=e&&o(e,t,i)}var i=n(850),o=n(898);e.exports=r},function(e,t,n){function r(e){if(!o(e))return!1;var t=i(e);return t==s||t==u||t==a||t==l}var i=n(66),o=n(38),a="[object AsyncFunction]",s="[object Function]",u="[object GeneratorFunction]",l="[object Proxy]";e.exports=r},function(e,t,n){function r(e){if(!a(e)||i(e)!=s)return!1;var t=o(e);if(null===t)return!0;var n=p.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==f}var i=n(66),o=n(219),a=n(68),s="[object Object]",u=Function.prototype,l=Object.prototype,c=u.toString,p=l.hasOwnProperty,f=c.call(Object);e.exports=r},function(e,t,n){function r(e){return"string"==typeof e||!o(e)&&a(e)&&i(e)==s}var i=n(66),o=n(20),a=n(68),s="[object String]";e.exports=r},function(e,t,n){var r=n(855),i=n(871),o=n(924),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},function(e,t,n){function r(e){return a(e)?i(e,!0):o(e)}var i=n(393),o=n(857),a=n(86);e.exports=r},function(e,t,n){function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(r.Cache||i),n}var i=n(214),o="Expected a function";r.Cache=i,e.exports=r},function(e,t){function n(){return[]}e.exports=n},function(e,t,n){function r(e){var t=i(e),n=t%1;return t===t?n?t-n:t:0}var i=n(958);e.exports=r},function(e,t,n){var r=n(889),i=r("toUpperCase");e.exports=i},function(e,t,n){"use strict";function r(e){var t,n,r=o[e];if(r)return r;for(r=o[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),r.push(n);for(t=0;t<e.length;t++)n=e.charCodeAt(t),r[n]="%"+("0"+n.toString(16).toUpperCase()).slice(-2);return r}function i(e,t){var n;return"string"!=typeof t&&(t=i.defaultChars),n=r(t),e.replace(/(%[a-f0-9]{2})+/gi,function(e){var t,r,i,o,a,s,u,l="";for(t=0,r=e.length;t<r;t+=3)i=parseInt(e.slice(t+1,t+3),16),i<128?l+=n[i]:192==(224&i)&&t+3<r&&128==(192&(o=parseInt(e.slice(t+4,t+6),16)))?(u=i<<6&1984|63&o,l+=u<128?"��":String.fromCharCode(u),t+=3):224==(240&i)&&t+6<r&&(o=parseInt(e.slice(t+4,t+6),16),a=parseInt(e.slice(t+7,t+9),16),128==(192&o)&&128==(192&a))?(u=i<<12&61440|o<<6&4032|63&a,l+=u<2048||u>=55296&&u<=57343?"���":String.fromCharCode(u),t+=6):240==(248&i)&&t+9<r&&(o=parseInt(e.slice(t+4,t+6),16),a=parseInt(e.slice(t+7,t+9),16),s=parseInt(e.slice(t+10,t+12),16),128==(192&o)&&128==(192&a)&&128==(192&s))?(u=i<<18&1835008|o<<12&258048|a<<6&4032|63&s,u<65536||u>1114111?l+="����":(u-=65536,l+=String.fromCharCode(55296+(u>>10),56320+(1023&u))),t+=9):l+="�";return l})}var o={};i.defaultChars=";/?:@&=+$,#",i.componentChars="",e.exports=i},function(e,t,n){"use strict";function r(e){var t,n,r=o[e];if(r)return r;for(r=o[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?r.push(n):r.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t<e.length;t++)r[e.charCodeAt(t)]=e[t];return r}function i(e,t,n){var o,a,s,u,l,c="";for("string"!=typeof t&&(n=t,t=i.defaultChars),void 0===n&&(n=!0),l=r(t),o=0,a=e.length;o<a;o++)if(s=e.charCodeAt(o),n&&37===s&&o+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3)))c+=e.slice(o,o+3),o+=2;else if(s<128)c+=l[s];else if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1<a&&(u=e.charCodeAt(o+1))>=56320&&u<=57343){c+=encodeURIComponent(e[o]+e[o+1]),o++;continue}c+="%EF%BF%BD"}else c+=encodeURIComponent(e[o]);return c}var o={};i.defaultChars=";/?:@&=+$,-_.!~*'()#",i.componentChars="-_.!~*'()",e.exports=i},function(e,t,n){"use strict";var r=n(65);e.exports=function(e,t,n){var i;return isNaN(e)?(i=t,i>=0?n&&i?i-1:i:1):!1!==e&&r(e)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(1211),a=r(o),s=n(503),u=r(s),l=n(985),c=r(l),p=function(){function e(t,n,r,o,a,s){i(this,e),this.name="CssSyntaxError",this.reason=t,a&&(this.file=a),o&&(this.source=o),s&&(this.plugin=s),void 0!==n&&void 0!==r&&(this.line=n,this.column=r),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}return e.prototype.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},e.prototype.showSourceCode=function(e){function t(t){return e&&u.default.red?u.default.red.bold(t):t}function n(t){return e&&u.default.gray?u.default.gray(t):t}var r=this;if(!this.source)return"";var i=this.source;void 0===e&&(e=a.default),e&&(i=(0,c.default)(i));var o=i.split(/\r?\n/),s=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),p=String(l).length;return o.slice(s,l).map(function(e,i){var o=s+1+i,a=" "+(" "+o).slice(-p)+" | ";if(o===r.line){var u=n(a.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," ");return t(">")+n(a)+e+"\n "+u+t("^")}return" "+n(a)+e}).join("\n")},e.prototype.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},e}();t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(432),s=r(a),u=n(983),l=r(u),c=n(230),p=r(c),f=0,h=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,e),this.css=t.toString(),"\ufeff"!==this.css[0]&&"￾"!==this.css[0]||(this.css=this.css.slice(1)),n.from&&(/^\w+:\/\//.test(n.from)?this.file=n.from:this.file=p.default.resolve(n.from));var r=new l.default(this.css,n);if(r.text){this.map=r;var o=r.consumer().file;!this.file&&o&&(this.file=this.mapResolve(o))}this.file||(f+=1,this.id="<input css "+f+">"),this.map&&(this.map.file=this.from)}return e.prototype.error=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0,o=this.origin(t,n);return i=o?new s.default(e,o.line,o.column,o.source,o.file,r.plugin):new s.default(e,t,n,this.css,this.file,r.plugin),i.input={line:t,column:n,source:this.css},this.file&&(i.input.file=this.file),i},e.prototype.origin=function(e,t){if(!this.map)return!1;var n=this.map.consumer(),r=n.originalPositionFor({line:e,column:t});if(!r.source)return!1;var i={file:this.mapResolve(r.source),line:r.line,column:r.column},o=n.sourceContentFor(r.source);return o&&(i.source=o),i},e.prototype.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:p.default.resolve(this.map.consumer().sourceRoot||".",e)},o(e,[{key:"from",get:function(){return this.file||this.id}}]),e}();t.default=h,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return"object"===(void 0===e?"undefined":s(e))&&"function"==typeof e.then}t.__esModule=!0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=n(980),l=r(u),c=n(238),p=r(c),f=n(984),h=r(f),d=n(236),m=r(d),v=function(){function e(t,n,r){i(this,e),this.stringified=!1,this.processed=!1;var o=void 0;if("object"===(void 0===n?"undefined":s(n))&&"root"===n.type)o=n;else if(n instanceof e||n instanceof h.default)o=n.root,n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var a=m.default;r.syntax&&(a=r.syntax.parse),r.parser&&(a=r.parser),a.parse&&(a=a.parse);try{o=a(n,r)}catch(e){this.error=e}}this.result=new h.default(t,o,r)}return e.prototype.warnings=function(){return this.sync().warnings()},e.prototype.toString=function(){return this.css},e.prototype.then=function(e,t){return this.async().then(e,t)},e.prototype.catch=function(e){return this.async().catch(e)},e.prototype.handleError=function(e,t){try{if(this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(t.postcssVersion){var n=t.postcssPlugin,r=t.postcssVersion,i=this.result.processor.version,o=r.split("."),a=i.split(".");(o[0]!==a[0]||parseInt(o[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below.")}}else e.plugin=t.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}},e.prototype.asyncTick=function(e,t){var n=this;if(this.plugin>=this.processor.plugins.length)return this.processed=!0,e();try{var r=this.processor.plugins[this.plugin],i=this.run(r);this.plugin+=1,o(i)?i.then(function(){n.asyncTick(e,t)}).catch(function(e){n.handleError(e,r),n.processed=!0,t(e)}):this.asyncTick(e,t)}catch(e){this.processed=!0,t(e)}},e.prototype.async=function(){var e=this;return this.processed?new Promise(function(t,n){e.error?n(e.error):t(e.stringify())}):this.processing?this.processing:(this.processing=new Promise(function(t,n){if(e.error)return n(e.error);e.plugin=0,e.asyncTick(t,n)}).then(function(){return e.processed=!0,e.stringify()}),this.processing)},e.prototype.sync=function(){if(this.processed)return this.result;if(this.processed=!0,this.processing)throw new Error("Use process(css).then(cb) to work with async plugins");if(this.error)throw this.error;for(var e=this.result.processor.plugins,t=Array.isArray(e),n=0,e=t?e:e[Symbol.iterator]();;){var r;if(t){if(n>=e.length)break;r=e[n++]}else{if(n=e.next(),n.done)break;r=n.value}var i=r;if(o(this.run(i)))throw new Error("Use process(css).then(cb) to work with async plugins")}return this.result},e.prototype.run=function(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){throw this.handleError(t,e),t}},e.prototype.stringify=function(){if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,t=p.default;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new l.default(t,this.result.root,this.result.opts),r=n.generate();return this.result.css=r[0],this.result.map=r[1],this.result},a(e,[{key:"processor",get:function(){return this.result.processor}},{key:"opts",get:function(){return this.result.opts}},{key:"css",get:function(){return this.stringify().css}},{key:"content",get:function(){return this.stringify().content}},{key:"map",get:function(){return this.stringify().map}},{key:"root",get:function(){return this.sync().root}},{key:"messages",get:function(){return this.sync().messages}}]),e}();t.default=v,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r={split:function(e,t,n){for(var r=[],i="",o=!1,a=0,s=!1,u=!1,l=0;l<e.length;l++){var c=e[l];s?u?u=!1:"\\"===c?u=!0:c===s&&(s=!1):'"'===c||"'"===c?s=c:"("===c?a+=1:")"===c?a>0&&(a-=1):0===a&&-1!==t.indexOf(c)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=c}return(n||""!==i)&&r.push(i.trim()),r},space:function(e){var t=[" ","\n","\t"];return r.split(e,t)},comma:function(e){return r.split(e,[","],!0)}};t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=n(434),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];r(this,e),this.version="6.0.14",this.plugins=this.normalize(t)}return e.prototype.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e.prototype.process=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new a.default(this,e,t)},e.prototype.normalize=function(e){for(var t=[],n=e,r=Array.isArray(n),o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var s=a;if(s.postcss&&(s=s.postcss),"object"===(void 0===s?"undefined":i(s))&&Array.isArray(s.plugins))t=t.concat(s.plugins);else{if("function"!=typeof s)throw"object"===(void 0===s?"undefined":i(s))&&(s.parse||s.stringify)?new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation."):new Error(s+" is not a PostCSS plugin");t.push(s)}}return t},e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return e[0].toUpperCase()+e.slice(1)}t.__esModule=!0;var o={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" "},a=function(){function e(t){r(this,e),this.builder=t}return e.prototype.stringify=function(e,t){this[e.type](e,t)},e.prototype.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},e.prototype.comment=function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)},e.prototype.decl=function(e,t){var n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)},e.prototype.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},e.prototype.atrule=function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{var i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}},e.prototype.body=function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}},e.prototype.block=function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start");var r=void 0;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")},e.prototype.raw=function(e,t,n){var r=void 0;if(n||(n=t),t&&void 0!==(r=e.raws[t]))return r;var a=e.parent;if("before"===n&&(!a||"root"===a.type&&a.first===e))return"";if(!a)return o[n];var s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var u="raw"+i(n);return this[u]?r=this[u](s,e):s.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=o[n]),s.rawCache[n]=r,r},e.prototype.rawSemicolon=function(e){var t=void 0;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t},e.prototype.rawEmptyBody=function(e){var t=void 0;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t},e.prototype.rawIndent=function(e){if(e.raws.indent)return e.raws.indent;var t=void 0;return e.walk(function(n){var r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){var i=n.raws.before.split("\n");return t=i[i.length-1],t=t.replace(/[^\s]/g,""),!1}}),t},e.prototype.rawBeforeComment=function(e,t){var n=void 0;return e.walkComments(function(e){if(void 0!==e.raws.before)return n=e.raws.before,-1!==n.indexOf("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/[^\s]/g,"")),n},e.prototype.rawBeforeDecl=function(e,t){var n=void 0;return e.walkDecls(function(e){if(void 0!==e.raws.before)return n=e.raws.before,-1!==n.indexOf("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/[^\s]/g,"")),n},e.prototype.rawBeforeRule=function(e){var t=void 0;return e.walk(function(n){if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,-1!==t.indexOf("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/[^\s]/g,"")),t},e.prototype.rawBeforeClose=function(e){var t=void 0;return e.walk(function(e){if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,-1!==t.indexOf("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/[^\s]/g,"")),t},e.prototype.rawBeforeOpen=function(e){var t=void 0;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t},e.prototype.rawColon=function(e){var t=void 0;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t},e.prototype.beforeAfter=function(e,t){var n=void 0;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");for(var r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(-1!==n.indexOf("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var a=0;a<i;a++)n+=o}return n},e.prototype.rawValue=function(e,t){var n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n},e}();t.default=a,e.exports=t.default},function(e,t,n){"use strict";function r(e){function t(t){throw e.error("Unclosed "+t,J,K-G)}function n(){return 0===Y.length&&K>=H}function r(){if(Y.length)return Y.pop();if(!(K>=H)){switch(T=O.charCodeAt(K),(T===u||T===c||T===f&&O.charCodeAt(K+1)!==u)&&(G=K,J+=1),T){case u:case l:case p:case f:case c:P=K;do{P+=1,(T=O.charCodeAt(P))===u&&(G=P,J+=1)}while(T===l||T===u||T===p||T===f||T===c);V=["space",O.slice(K,P)],K=P-1;break;case h:V=["[","[",J,K-G];break;case d:V=["]","]",J,K-G];break;case g:V=["{","{",J,K-G];break;case y:V=["}","}",J,K-G];break;case x:V=[":",":",J,K-G];break;case _:V=[";",";",J,K-G];break;case m:if(U=X.length?X.pop()[1]:"",W=O.charCodeAt(K+1),"url"===U&&W!==i&&W!==o&&W!==l&&W!==u&&W!==p&&W!==c&&W!==f){P=K;do{if(q=!1,-1===(P=O.indexOf(")",P+1))){if(M){P=K;break}t("bracket")}for(z=P;O.charCodeAt(z-1)===a;)z-=1,q=!q}while(q);V=["brackets",O.slice(K,P+1),J,K-G,J,P-G],K=P}else P=O.indexOf(")",K+1),F=O.slice(K,P+1),-1===P||S.test(F)?V=["(","(",J,K-G]:(V=["brackets",F,J,K-G,J,P-G],K=P);break;case v:V=[")",")",J,K-G];break;case i:case o:I=T===i?"'":'"',P=K;do{if(q=!1,-1===(P=O.indexOf(I,P+1))){if(M){P=K+1;break}t("string")}for(z=P;O.charCodeAt(z-1)===a;)z-=1,q=!q}while(q);F=O.slice(K,P+1),R=F.split("\n"),j=R.length-1,j>0?(B=J+j,L=P-R[j].length):(B=J,L=G),V=["string",O.slice(K,P+1),J,K-G,B,P-L],G=L,J=B,K=P;break;case w:k.lastIndex=K+1,k.test(O),P=0===k.lastIndex?O.length-1:k.lastIndex-2,V=["at-word",O.slice(K,P+1),J,K-G,J,P-G],K=P;break;case a:for(P=K,N=!0;O.charCodeAt(P+1)===a;)P+=1,N=!N;if(T=O.charCodeAt(P+1),N&&T!==s&&T!==l&&T!==u&&T!==p&&T!==f&&T!==c&&(P+=1,C.test(O.charAt(P)))){for(;C.test(O.charAt(P+1));)P+=1;O.charCodeAt(P+1)===l&&(P+=1)}V=["word",O.slice(K,P+1),J,K-G,J,P-G],K=P;break;default:T===s&&O.charCodeAt(K+1)===b?(P=O.indexOf("*/",K+2)+1,0===P&&(M?P=O.length:t("comment")),F=O.slice(K,P+1),R=F.split("\n"),j=R.length-1,j>0?(B=J+j,L=P-R[j].length):(B=J,L=G),V=["comment",F,J,K-G,B,P-L],G=L,J=B,K=P):(E.lastIndex=K+1,E.test(O),P=0===E.lastIndex?O.length-1:E.lastIndex-2,V=["word",O.slice(K,P+1),J,K-G,J,P-G],X.push(V),K=P)}return K++,V}}function A(e){Y.push(e)}var D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},O=e.css.valueOf(),M=D.ignoreErrors,T=void 0,P=void 0,I=void 0,R=void 0,j=void 0,F=void 0,N=void 0,B=void 0,L=void 0,q=void 0,z=void 0,U=void 0,W=void 0,V=void 0,H=O.length,G=-1,J=1,K=0,X=[],Y=[];return{back:A,nextToken:r,endOfFile:n}}t.__esModule=!0,t.default=r;var i=39,o=34,a=92,s=47,u=10,l=32,c=12,p=9,f=13,h=91,d=93,m=40,v=41,g=123,y=125,_=59,b=42,x=58,w=64,k=/[ \n\t\r\f\{\(\)'"\\;\/\[\]#]/g,E=/[ \n\t\r\f\(\)\{\}:;@!'"\\\]\[#]|\/(?=\*)/g,S=/.[\\\/\("'\n]/,C=/[a-f0-9]/i;e.exports=t.default},function(e,t,n){function r(){this._array=[],this._set=a?new Map:Object.create(null)}var i=n(121),o=Object.prototype.hasOwnProperty,a="undefined"!=typeof Map;r.fromArray=function(e,t){for(var n=new r,i=0,o=e.length;i<o;i++)n.add(e[i],t);return n},r.prototype.size=function(){return a?this._set.size:Object.getOwnPropertyNames(this._set).length},r.prototype.add=function(e,t){var n=a?e:i.toSetString(e),r=a?this.has(e):o.call(this._set,n),s=this._array.length;r&&!t||this._array.push(e),r||(a?this._set.set(e,s):this._set[n]=s)},r.prototype.has=function(e){if(a)return this._set.has(e);var t=i.toSetString(e);return o.call(this._set,t)},r.prototype.indexOf=function(e){if(a){var t=this._set.get(e);if(t>=0)return t}else{var n=i.toSetString(e);if(o.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},r.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},r.prototype.toArray=function(){return this._array.slice()},t.ArraySet=r},function(e,t,n){function r(e){return e<0?1+(-e<<1):0+(e<<1)}function i(e){var t=1==(1&e),n=e>>1;return t?-n:n}var o=n(989);t.encode=function(e){var t,n="",i=r(e);do{t=31&i,i>>>=5,i>0&&(t|=32),n+=o.encode(t)}while(i>0);return n},t.decode=function(e,t,n){var r,a,s=e.length,u=0,l=0;do{if(t>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(a=o.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(32&a),a&=31,u+=a<<l,l+=5}while(r);n.value=i(u),n.rest=t}},function(e,t,n){function r(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new a,this._names=new a,this._mappings=new s,this._sourcesContents=null}var i=n(440),o=n(121),a=n(439).ArraySet,s=n(991).MappingList;r.prototype._version=3,r.fromSourceMap=function(e){var t=e.sourceRoot,n=new r({file:e.file,sourceRoot:t});return e.eachMapping(function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=o.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)}),e.sources.forEach(function(r){var i=r;null!==t&&(i=o.relative(t,r)),n._sources.has(i)||n._sources.add(i);var a=e.sourceContentFor(r);null!=a&&n.setSourceContent(r,a)}),n},r.prototype.addMapping=function(e){var t=o.getArg(e,"generated"),n=o.getArg(e,"original",null),r=o.getArg(e,"source",null),i=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i})},r.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=o.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},r.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var i=this._sourceRoot;null!=i&&(r=o.relative(i,r));var s=new a,u=new a;this._mappings.unsortedForEach(function(t){if(t.source===r&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=n&&(t.source=o.join(n,t.source)),null!=i&&(t.source=o.relative(i,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var l=t.source;null==l||s.has(l)||s.add(l);var c=t.name;null==c||u.has(c)||u.add(c)},this),this._sources=s,this._names=u,e.sources.forEach(function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=o.join(n,t)),null!=i&&(t=o.relative(i,t)),this.setSourceContent(t,r))},this)},r.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},r.prototype._serializeMappings=function(){for(var e,t,n,r,a=0,s=1,u=0,l=0,c=0,p=0,f="",h=this._mappings.toArray(),d=0,m=h.length;d<m;d++){if(t=h[d],e="",t.generatedLine!==s)for(a=0;t.generatedLine!==s;)e+=";",s++;else if(d>0){if(!o.compareByGeneratedPositionsInflated(t,h[d-1]))continue;e+=","}e+=i.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=i.encode(r-p),p=r,e+=i.encode(t.originalLine-1-l),l=t.originalLine-1,e+=i.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=i.encode(n-c),c=n)),f+=e}return f},r.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},r.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},r.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=r},function(e,t,n){t.SourceMapGenerator=n(441).SourceMapGenerator,t.SourceMapConsumer=n(993).SourceMapConsumer,t.SourceNode=n(994).SourceNode},function(e,t,n){"use strict";var r=n(997);e.exports=function(e){return r(e,!1)}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),o=function(e){for(var t;e.length;){var n=e.pop();if(t=n.obj[n.prop],Array.isArray(t)){for(var r=[],i=0;i<t.length;++i)void 0!==t[i]&&r.push(t[i]);n.obj[n.prop]=r}}return t};t.arrayToObject=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},t.merge=function(e,n,i){if(!n)return e;if("object"!=typeof n){if(Array.isArray(e))e.push(n);else{if("object"!=typeof e)return[e,n];(i.plainObjects||i.allowPrototypes||!r.call(Object.prototype,n))&&(e[n]=!0)}return e}if("object"!=typeof e)return[e].concat(n);var o=e;return Array.isArray(e)&&!Array.isArray(n)&&(o=t.arrayToObject(e,i)),Array.isArray(e)&&Array.isArray(n)?(n.forEach(function(n,o){r.call(e,o)?e[o]&&"object"==typeof e[o]?e[o]=t.merge(e[o],n,i):e.push(n):e[o]=n}),e):Object.keys(n).reduce(function(e,o){var a=n[o];return r.call(e,o)?e[o]=t.merge(e[o],a,i):e[o]=a,e},o)},t.assign=function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),n="",r=0;r<t.length;++r){var o=t.charCodeAt(r);45===o||46===o||95===o||126===o||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?n+=t.charAt(r):o<128?n+=i[o]:o<2048?n+=i[192|o>>6]+i[128|63&o]:o<55296||o>=57344?n+=i[224|o>>12]+i[128|o>>6&63]+i[128|63&o]:(r+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(r)),n+=i[240|o>>18]+i[128|o>>12&63]+i[128|o>>6&63]+i[128|63&o])}return n},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],s=Object.keys(a),u=0;u<s.length;++u){var l=s[u],c=a[l];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t.push({obj:a,prop:l}),n.push(c))}return o(t)},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!==e&&void 0!==e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Collapse=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),p=r(c),f=n(1),h=r(f),d=n(1085),m="IDLING",v=function(){return null},g={collapse:"ReactCollapse--collapse",content:"ReactCollapse--content"},y=t.Collapse=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return _.call(n),n.state={currentState:m,from:0,to:0},n}return s(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isOpened,n=e.forceInitialAnimation,r=e.onRest;if(t){var i=this.getTo();if(n){var o=this.wrapper.clientHeight;this.setState({currentState:"RESIZING",from:o,to:i})}else this.setState({currentState:m,from:i,to:i})}r()}},{key:"componentWillReceiveProps",value:function(e){e.hasNestedCollapse?e.isOpened!==this.props.isOpened&&this.setState({currentState:"WAITING"}):this.state.currentState===m&&(e.isOpened||this.props.isOpened)&&this.setState({currentState:"WAITING"})}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.isOpened,i=n.onRest,o=n.onMeasure;if(this.state.currentState===m)return void i();t.to!==this.state.to&&o({height:this.state.to,width:this.content.clientWidth});var a=this.wrapper.clientHeight,s=r?this.getTo():0;if(a!==s)return void this.setState({currentState:"RESIZING",from:a,to:s});"RESTING"!==this.state.currentState&&"WAITING"!==this.state.currentState||this.setState({currentState:m,from:a,to:s})}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.raf)}},{key:"render",value:function(){return p.default.createElement(d.Motion,u({},this.getMotionProps(),{onRest:this.onRest,children:this.renderContent}))}}]),t}(p.default.PureComponent);y.propTypes={isOpened:h.default.bool.isRequired,springConfig:h.default.objectOf(h.default.number),forceInitialAnimation:h.default.bool,hasNestedCollapse:h.default.bool,fixedHeight:h.default.number,theme:h.default.objectOf(h.default.string),style:h.default.object,onRender:h.default.func,onRest:h.default.func,onMeasure:h.default.func,children:h.default.node.isRequired},y.defaultProps={forceInitialAnimation:!1,hasNestedCollapse:!1,fixedHeight:-1,style:{},theme:g,onRender:v,onRest:v,onMeasure:v};var _=function(){var e=this;this.onContentRef=function(t){e.content=t},this.onWrapperRef=function(t){e.wrapper=t},this.onRest=function(){e.raf=requestAnimationFrame(e.setResting)},this.setResting=function(){e.setState({currentState:"RESTING"})},this.getTo=function(){var t=e.props.fixedHeight;return t>-1?t:e.content.clientHeight},this.getWrapperStyle=function(t){if(e.state.currentState===m&&e.state.to){var n=e.props.fixedHeight;return n>-1?{overflow:"hidden",height:n}:{height:"auto"}}return"WAITING"!==e.state.currentState||e.state.to?{overflow:"hidden",height:Math.max(0,t)}:{overflow:"hidden",height:0}},this.getMotionProps=function(){var t=e.props.springConfig;return e.state.currentState===m?{defaultStyle:{height:e.state.to},style:{height:e.state.to}}:{defaultStyle:{height:e.state.from},style:{height:(0,d.spring)(e.state.to,u({precision:1},t))}}},this.renderContent=function(t){var n=t.height,r=e.props,o=(r.isOpened,r.springConfig,r.forceInitialAnimation,r.hasNestedCollapse,r.fixedHeight,r.theme),a=r.style,s=r.onRender,l=(r.onRest,r.onMeasure,r.children),c=i(r,["isOpened","springConfig","forceInitialAnimation","hasNestedCollapse","fixedHeight","theme","style","onRender","onRest","onMeasure","children"]),f=e.state;return s({current:n,from:f.from,to:f.to}),p.default.createElement("div",u({ref:e.onWrapperRef,className:o.collapse,style:u({},e.getWrapperStyle(Math.max(0,n)),a)},c),p.default.createElement("div",{ref:e.onContentRef,className:o.content},l))}}},function(e,t,n){"use strict";var r=n(447),i=r.Collapse,o=n(1008),a=o.UnmountClosed;a.Collapse=i,a.UnmountClosed=a,e.exports=a},function(e,t,n){"use strict";e.exports=n(1022)},function(e,t,n){"use strict";function r(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var i={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},o=["Webkit","ms","Moz","O"];Object.keys(i).forEach(function(e){o.forEach(function(t){i[r(t,e)]=i[e]})});var a={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},s={isUnitlessNumber:i,shorthandPropertyExpansions:a};e.exports=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(11),o=n(70),a=(n(8),function(){function e(t){r(this,e),this._callbacks=null,this._contexts=null,this._arg=t}return e.prototype.enqueue=function(e,t){this._callbacks=this._callbacks||[],this._callbacks.push(e),this._contexts=this._contexts||[],this._contexts.push(t)},e.prototype.notifyAll=function(){var e=this._callbacks,t=this._contexts,n=this._arg;if(e&&t){e.length!==t.length&&i("24"),this._callbacks=null,this._contexts=null;for(var r=0;r<e.length;r++)e[r].call(t[r],n);e.length=0,t.length=0}},e.prototype.checkpoint=function(){return this._callbacks?this._callbacks.length:0},e.prototype.rollback=function(e){this._callbacks&&this._contexts&&(this._callbacks.length=e,this._contexts.length=e)},e.prototype.reset=function(){this._callbacks=null,this._contexts=null},e.prototype.destructor=function(){this.reset()},e}());e.exports=o.addPoolingTo(a)},function(e,t,n){"use strict";function r(e){return!!l.hasOwnProperty(e)||!u.hasOwnProperty(e)&&(s.test(e)?(l[e]=!0,!0):(u[e]=!0,!1))}function i(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&!1===t}var o=n(89),a=(n(14),n(39),n(1070)),s=(n(10),new RegExp("^["+o.ATTRIBUTE_NAME_START_CHAR+"]["+o.ATTRIBUTE_NAME_CHAR+"]*$")),u={},l={},c={createMarkupForID:function(e){return o.ID_ATTRIBUTE_NAME+"="+a(e)},setAttributeForID:function(e,t){e.setAttribute(o.ID_ATTRIBUTE_NAME,t)},createMarkupForRoot:function(){return o.ROOT_ATTRIBUTE_NAME+'=""'},setAttributeForRoot:function(e){e.setAttribute(o.ROOT_ATTRIBUTE_NAME,"")},createMarkupForProperty:function(e,t){var n=o.properties.hasOwnProperty(e)?o.properties[e]:null;if(n){if(i(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&!0===t?r+'=""':r+"="+a(t)}return o.isCustomAttribute(e)?null==t?"":e+"="+a(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+a(t):""},setValueForProperty:function(e,t,n){var r=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(r){var a=r.mutationMethod;if(a)a(e,n);else{if(i(r,n))return void this.deleteValueForProperty(e,t);if(r.mustUseProperty)e[r.propertyName]=n;else{var s=r.attributeName,u=r.attributeNamespace;u?e.setAttributeNS(u,s,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&!0===n?e.setAttribute(s,""):e.setAttribute(s,""+n)}}}else if(o.isCustomAttribute(t))return void c.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){if(r(t)){null==n?e.removeAttribute(t):e.setAttribute(t,""+n)}},deleteValueForAttribute:function(e,t){e.removeAttribute(t)},deleteValueForProperty:function(e,t){var n=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseProperty){var i=n.propertyName;n.hasBooleanValue?e[i]=!1:e[i]=""}else e.removeAttribute(n.attributeName)}else o.isCustomAttribute(t)&&e.removeAttribute(t)}};e.exports=c},function(e,t,n){"use strict";var r={hasCachedChildNodes:1};e.exports=r},function(e,t,n){"use strict";function r(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=s.getValue(e);null!=t&&i(this,Boolean(e.multiple),t)}}function i(e,t,n){var r,i,o=u.getNodeFromInstance(e).options;if(t){for(r={},i=0;i<n.length;i++)r[""+n[i]]=!0;for(i=0;i<o.length;i++){var a=r.hasOwnProperty(o[i].value);o[i].selected!==a&&(o[i].selected=a)}}else{for(r=""+n,i=0;i<o.length;i++)if(o[i].value===r)return void(o[i].selected=!0);o.length&&(o[0].selected=!0)}}function o(e){var t=this._currentElement.props,n=s.executeOnChange(t,e);return this._rootNodeID&&(this._wrapperState.pendingUpdate=!0),l.asap(r,this),n}var a=n(13),s=n(245),u=n(14),l=n(44),c=(n(10),!1),p={getHostProps:function(e,t){return a({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){var n=s.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,listeners:null,onChange:o.bind(e),wasMultiple:Boolean(t.multiple)},void 0===t.value||void 0===t.defaultValue||c||(c=!0)},getSelectValueContext:function(e){return e._wrapperState.initialValue},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var n=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var r=s.getValue(t);null!=r?(e._wrapperState.pendingUpdate=!1,i(e,Boolean(t.multiple),r)):n!==Boolean(t.multiple)&&(null!=t.defaultValue?i(e,Boolean(t.multiple),t.defaultValue):i(e,Boolean(t.multiple),t.multiple?[]:""))}};e.exports=p},function(e,t,n){"use strict";var r,i={injectEmptyComponentFactory:function(e){r=e}},o={create:function(e){return r(e)}};o.injection=i,e.exports=o},function(e,t,n){"use strict";var r={logTopLevelRenders:!1};e.exports=r},function(e,t,n){"use strict";function r(e){return s||a("111",e.type),new s(e)}function i(e){return new u(e)}function o(e){return e instanceof u}var a=n(11),s=(n(8),null),u=null,l={injectGenericComponentClass:function(e){s=e},injectTextComponentClass:function(e){u=e}},c={createInternalComponent:r,createInstanceForText:i,isTextComponent:o,injection:l};e.exports=c},function(e,t,n){"use strict";function r(e){return o(document.documentElement,e)}var i=n(1030),o=n(748),a=n(378),s=n(379),u={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=s();return{focusedElem:e,selectionRange:u.hasSelectionCapabilities(e)?u.getSelection(e):null}},restoreSelection:function(e){var t=s(),n=e.focusedElem,i=e.selectionRange;t!==n&&r(n)&&(u.hasSelectionCapabilities(n)&&u.setSelection(n,i),a(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=i.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if(void 0===r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var o=e.createTextRange();o.collapse(!0),o.moveStart("character",n),o.moveEnd("character",r-n),o.select()}else i.setOffsets(e,t)}};e.exports=u},function(e,t,n){"use strict";function r(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function i(e){return e?e.nodeType===R?e.documentElement:e.firstChild:null}function o(e){return e.getAttribute&&e.getAttribute(T)||""}function a(e,t,n,r,i){var o;if(x.logTopLevelRenders){var a=e._currentElement.props.child,s=a.type;o="React mount: "+("string"==typeof s?s:s.displayName||s.name),console.time(o)}var u=E.mountComponent(e,n,null,_(e,t),i,0);o&&console.timeEnd(o),e._renderedComponent._topLevelWrapper=e,L._mountImageIntoNode(u,t,e,r,n)}function s(e,t,n,r){var i=C.ReactReconcileTransaction.getPooled(!n&&b.useCreateElement);i.perform(a,null,e,t,i,n,r),C.ReactReconcileTransaction.release(i)}function u(e,t,n){for(E.unmountComponent(e,n),t.nodeType===R&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function l(e){var t=i(e);if(t){var n=y.getInstanceFromNode(t);return!(!n||!n._hostParent)}}function c(e){return!(!e||e.nodeType!==I&&e.nodeType!==R&&e.nodeType!==j)}function p(e){var t=i(e),n=t&&y.getInstanceFromNode(t);return n&&!n._hostParent?n:null}function f(e){var t=p(e);return t?t._hostContainerInfo._topLevelWrapper:null}var h=n(11),d=n(88),m=n(89),v=n(92),g=n(159),y=(n(52),n(14)),_=n(1024),b=n(1026),x=n(456),w=n(124),k=(n(39),n(1040)),E=n(90),S=n(248),C=n(44),A=n(144),D=n(467),O=(n(8),n(163)),M=n(254),T=(n(10),m.ID_ATTRIBUTE_NAME),P=m.ROOT_ATTRIBUTE_NAME,I=1,R=9,j=11,F={},N=1,B=function(){this.rootID=N++};B.prototype.isReactComponent={},B.prototype.render=function(){return this.props.child},B.isReactTopLevelWrapper=!0;var L={TopLevelWrapper:B,_instancesByReactRootID:F,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r,i){return L.scrollMonitor(r,function(){S.enqueueElementInternal(e,t,n),i&&S.enqueueCallbackInternal(e,i)}),e},_renderNewRootComponent:function(e,t,n,r){c(t)||h("37"),g.ensureScrollValueMonitoring();var i=D(e,!1);C.batchedUpdates(s,i,t,n,r);var o=i._instance.rootID;return F[o]=i,i},renderSubtreeIntoContainer:function(e,t,n,r){return null!=e&&w.has(e)||h("38"),L._renderSubtreeIntoContainer(e,t,n,r)},_renderSubtreeIntoContainer:function(e,t,n,r){S.validateCallback(r,"ReactDOM.render"),v.isValidElement(t)||h("39","string"==typeof t?" Instead of passing a string like 'div', pass React.createElement('div') or <div />.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var a,s=v.createElement(B,{child:t});if(e){var u=w.get(e);a=u._processChildContext(u._context)}else a=A;var c=f(n);if(c){var p=c._currentElement,d=p.props.child;if(M(d,t)){var m=c._renderedComponent.getPublicInstance(),g=r&&function(){r.call(m)};return L._updateRootComponent(c,s,a,n,g),m}L.unmountComponentAtNode(n)}var y=i(n),_=y&&!!o(y),b=l(n),x=_&&!c&&!b,k=L._renderNewRootComponent(s,n,x,a)._renderedComponent.getPublicInstance();return r&&r.call(k),k},render:function(e,t,n){return L._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){c(e)||h("40");var t=f(e);if(!t){l(e),1===e.nodeType&&e.hasAttribute(P);return!1}return delete F[t._instance.rootID],C.batchedUpdates(u,t,e,!1),!0},_mountImageIntoNode:function(e,t,n,o,a){if(c(t)||h("41"),o){var s=i(t);if(k.canReuseMarkup(e,s))return void y.precacheNode(n,s);var u=s.getAttribute(k.CHECKSUM_ATTR_NAME);s.removeAttribute(k.CHECKSUM_ATTR_NAME);var l=s.outerHTML;s.setAttribute(k.CHECKSUM_ATTR_NAME,u);var p=e,f=r(p,l),m=" (client) "+p.substring(f-20,f+20)+"\n (server) "+l.substring(f-20,f+20);t.nodeType===R&&h("42",m)}if(t.nodeType===R&&h("43"),a.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);d.insertTreeBefore(t,e,null)}else O(t,e),y.precacheNode(n,t.firstChild)}};e.exports=L},function(e,t,n){"use strict";var r=n(11),i=n(92),o=(n(8),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||!1===e?o.EMPTY:i.isValidElement(e)?"function"==typeof e.type?o.COMPOSITE:o.HOST:void r("26",e)}});e.exports=o},function(e,t,n){"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};e.exports=r},function(e,t,n){"use strict";function r(e,t){return null==t&&i("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}var i=n(11);n(8);e.exports=r},function(e,t,n){"use strict";function r(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}e.exports=r},function(e,t,n){"use strict";function r(e){for(var t;(t=e._renderedNodeType)===i.COMPOSITE;)e=e._renderedComponent;return t===i.HOST?e._renderedComponent:t===i.EMPTY?null:void 0}var i=n(460);e.exports=r},function(e,t,n){"use strict";function r(){return!o&&i.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var i=n(25),o=null;e.exports=r},function(e,t,n){"use strict";function r(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function i(e){return e._wrapperState.valueTracker}function o(e,t){e._wrapperState.valueTracker=t}function a(e){e._wrapperState.valueTracker=null}function s(e){var t;return e&&(t=r(e)?""+e.checked:e.value),t}var u=n(14),l={_getTrackerFromNode:function(e){return i(u.getInstanceFromNode(e))},track:function(e){if(!i(e)){var t=u.getNodeFromInstance(e),n=r(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),l=""+t[n];t.hasOwnProperty(n)||"function"!=typeof s.get||"function"!=typeof s.set||(Object.defineProperty(t,n,{enumerable:s.enumerable,configurable:!0,get:function(){return s.get.call(this)},set:function(e){l=""+e,s.set.call(this,e)}}),o(e,{getValue:function(){return l},setValue:function(e){l=""+e},stopTracking:function(){a(e),delete t[n]}}))}},updateValueIfChanged:function(e){if(!e)return!1;var t=i(e);if(!t)return l.track(e),!0;var n=t.getValue(),r=s(u.getNodeFromInstance(e));return r!==n&&(t.setValue(r),!0)},stopTracking:function(e){var t=i(e);t&&t.stopTracking()}};e.exports=l},function(e,t,n){"use strict";function r(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function i(e){return"function"==typeof e&&void 0!==e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function o(e,t){var n;if(null===e||!1===e)n=l.create(o);else if("object"==typeof e){var s=e,u=s.type;if("function"!=typeof u&&"string"!=typeof u){var f="";f+=r(s._owner),a("130",null==u?u:typeof u,f)}"string"==typeof s.type?n=c.createInternalComponent(s):i(s.type)?(n=new s.type(s),n.getHostNode||(n.getHostNode=n.getNativeNode)):n=new p(s)}else"string"==typeof e||"number"==typeof e?n=c.createInstanceForText(e):a("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}var a=n(11),s=n(13),u=n(1021),l=n(455),c=n(457),p=(n(1106),n(8),n(10),function(e){this.construct(e)});s(p.prototype,u,{_instantiateReactComponent:o}),e.exports=o},function(e,t,n){"use strict";function r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!i[e.type]:"textarea"===t}var i={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=r},function(e,t,n){"use strict";var r=n(25),i=n(162),o=n(163),a=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){if(3===e.nodeType)return void(e.nodeValue=t);o(e,i(t))})),e.exports=a},function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?l.escape(e.key):t.toString(36)}function i(e,t,n,o){var f=typeof e;if("undefined"!==f&&"boolean"!==f||(e=null),null===e||"string"===f||"number"===f||"object"===f&&e.$$typeof===s)return n(o,e,""===t?c+r(e,0):t),1;var h,d,m=0,v=""===t?c:t+p;if(Array.isArray(e))for(var g=0;g<e.length;g++)h=e[g],d=v+r(h,g),m+=i(h,d,n,o);else{var y=u(e);if(y){var _,b=y.call(e);if(y!==e.entries)for(var x=0;!(_=b.next()).done;)h=_.value,d=v+r(h,x++),m+=i(h,d,n,o);else for(;!(_=b.next()).done;){var w=_.value;w&&(h=w[1],d=v+l.escape(w[0])+p+r(h,0),m+=i(h,d,n,o))}}else if("object"===f){var k="",E=String(e);a("31","[object Object]"===E?"object with keys {"+Object.keys(e).join(", ")+"}":E,k)}}return m}function o(e,t,n){return null==e?0:i(e,"",t,n)}var a=n(11),s=(n(52),n(1036)),u=n(1067),l=(n(8),n(244)),c=(n(10),"."),p=":";e.exports=o},function(e,t,n){"use strict";t.__esModule=!0,t.default={noWobble:{stiffness:170,damping:26},gentle:{stiffness:120,damping:14},wobbly:{stiffness:180,damping:12},stiff:{stiffness:210,damping:20}},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r=n(1),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=i.default.shape({subscribe:i.default.func.isRequired,dispatch:i.default.func.isRequired,getState:i.default.func.isRequired})},function(e,t,n){"use strict";function r(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}t.__esModule=!0,t.default=r},function(e,t,n){"use strict";function r(e,t,n){this.props=e,this.context=t,this.refs=l,this.updater=n||u}function i(e,t,n){this.props=e,this.context=t,this.refs=l,this.updater=n||u}function o(){}var a=n(126),s=n(13),u=n(477),l=(n(478),n(144));n(8),n(1107);r.prototype.isReactComponent={},r.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&a("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")};o.prototype=r.prototype,i.prototype=new o,i.prototype.constructor=i,s(i.prototype,r.prototype),i.prototype.isPureReactComponent=!0,e.exports={Component:r,PureComponent:i}},function(e,t,n){"use strict";function r(e){var t=Function.prototype.toString,n=Object.prototype.hasOwnProperty,r=RegExp("^"+t.call(n).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");try{var i=t.call(e);return r.test(i)}catch(e){return!1}}function i(e){var t=l(e);if(t){var n=t.childIDs;c(e),n.forEach(i)}}function o(e,t,n){return"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":n?" (created by "+n+")":"")}function a(e){return null==e?"#empty":"string"==typeof e||"number"==typeof e?"#text":"string"==typeof e.type?e.type:e.type.displayName||e.type.name||"Unknown"}function s(e){var t,n=S.getDisplayName(e),r=S.getElement(e),i=S.getOwnerID(e);return i&&(t=S.getDisplayName(i)),o(n,r&&r._source,t)}var u,l,c,p,f,h,d,m=n(126),v=n(52),g=(n(8),n(10),"function"==typeof Array.from&&"function"==typeof Map&&r(Map)&&null!=Map.prototype&&"function"==typeof Map.prototype.keys&&r(Map.prototype.keys)&&"function"==typeof Set&&r(Set)&&null!=Set.prototype&&"function"==typeof Set.prototype.keys&&r(Set.prototype.keys));if(g){var y=new Map,_=new Set;u=function(e,t){y.set(e,t)},l=function(e){return y.get(e)},c=function(e){y.delete(e)},p=function(){return Array.from(y.keys())},f=function(e){_.add(e)},h=function(e){_.delete(e)},d=function(){return Array.from(_.keys())}}else{var b={},x={},w=function(e){return"."+e},k=function(e){return parseInt(e.substr(1),10)};u=function(e,t){var n=w(e);b[n]=t},l=function(e){var t=w(e);return b[t]},c=function(e){var t=w(e);delete b[t]},p=function(){return Object.keys(b).map(k)},f=function(e){var t=w(e);x[t]=!0},h=function(e){var t=w(e);delete x[t]},d=function(){return Object.keys(x).map(k)}}var E=[],S={onSetChildren:function(e,t){var n=l(e);n||m("144"),n.childIDs=t;for(var r=0;r<t.length;r++){var i=t[r],o=l(i);o||m("140"),null==o.childIDs&&"object"==typeof o.element&&null!=o.element&&m("141"),o.isMounted||m("71"),null==o.parentID&&(o.parentID=e),o.parentID!==e&&m("142",i,o.parentID,e)}},onBeforeMountComponent:function(e,t,n){u(e,{element:t,parentID:n,text:null,childIDs:[],isMounted:!1,updateCount:0})},onBeforeUpdateComponent:function(e,t){var n=l(e);n&&n.isMounted&&(n.element=t)},onMountComponent:function(e){var t=l(e);t||m("144"),t.isMounted=!0,0===t.parentID&&f(e)},onUpdateComponent:function(e){var t=l(e);t&&t.isMounted&&t.updateCount++},onUnmountComponent:function(e){var t=l(e);if(t){t.isMounted=!1;0===t.parentID&&h(e)}E.push(e)},purgeUnmountedComponents:function(){if(!S._preventPurging){for(var e=0;e<E.length;e++){i(E[e])}E.length=0}},isMounted:function(e){var t=l(e);return!!t&&t.isMounted},getCurrentStackAddendum:function(e){var t="";if(e){var n=a(e),r=e._owner;t+=o(n,e._source,r&&r.getName())}var i=v.current,s=i&&i._debugID;return t+=S.getStackAddendumByID(s)},getStackAddendumByID:function(e){for(var t="";e;)t+=s(e),e=S.getParentID(e);return t},getChildIDs:function(e){var t=l(e);return t?t.childIDs:[]},getDisplayName:function(e){var t=S.getElement(e);return t?a(t):null},getElement:function(e){var t=l(e);return t?t.element:null},getOwnerID:function(e){var t=S.getElement(e);return t&&t._owner?t._owner._debugID:null},getParentID:function(e){var t=l(e);return t?t.parentID:null},getSource:function(e){var t=l(e),n=t?t.element:null;return null!=n?n._source:null},getText:function(e){var t=S.getElement(e);return"string"==typeof t?t:"number"==typeof t?""+t:null},getUpdateCount:function(e){var t=l(e);return t?t.updateCount:0},getRootIDs:d,getRegisteredIDs:p,pushNonStandardWarningStack:function(e,t){if("function"==typeof console.reactStack){var n=[],r=v.current,i=r&&r._debugID;try{for(e&&n.push({name:i?S.getDisplayName(i):null,fileName:t?t.fileName:null,lineNumber:t?t.lineNumber:null});i;){var o=S.getElement(i),a=S.getParentID(i),s=S.getOwnerID(i),u=s?S.getDisplayName(s):null,l=o&&o._source;n.push({name:u,fileName:l?l.fileName:null,lineNumber:l?l.lineNumber:null}),i=a}}catch(e){}console.reactStack(n)}},popNonStandardWarningStack:function(){"function"==typeof console.reactStackEnd&&console.reactStackEnd()}};e.exports=S},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r=(n(10),{isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}});e.exports=r},function(e,t,n){"use strict";var r=!1;e.exports=r},function(e,t,n){"use strict";(function(t,r){function i(e){return N.from(e)}function o(e){return N.isBuffer(e)||e instanceof B}function a(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?R(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function s(e,t){I=I||n(71),e=e||{},this.objectMode=!!e.objectMode,t instanceof I&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new W,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(U||(U=n(265).StringDecoder),this.decoder=new U(e.encoding),this.encoding=e.encoding)}function u(e){if(I=I||n(71),!(this instanceof u))return new u(e);this._readableState=new s(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),F.call(this)}function l(e,t,n,r,o){var a=e._readableState;if(null===t)a.reading=!1,m(e,a);else{var s;o||(s=p(a,t)),s?e.emit("error",s):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===N.prototype||(t=i(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):c(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?c(e,a,t,!1):y(e,a)):c(e,a,t,!1))):r||(a.reading=!1)}return f(a)}function c(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&v(e)),y(e,t)}function p(e,t){var n;return o(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function f(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function h(e){return e>=G?e=G:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function d(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=h(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function m(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,v(e)}}function v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(z("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?P(g,e):g(e))}function g(e){z("emit readable"),e.emit("readable"),E(e)}function y(e,t){t.readingMore||(t.readingMore=!0,P(_,e,t))}function _(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(z("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function b(e){return function(){var t=e._readableState;z("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&j(e,"data")&&(t.flowing=!0,E(e))}}function x(e){z("readable nexttick read 0"),e.read(0)}function w(e,t){t.resumeScheduled||(t.resumeScheduled=!0,P(k,e,t))}function k(e,t){t.reading||(z("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),E(e),t.flowing&&!t.reading&&e.read(0)}function E(e){var t=e._readableState;for(z("flow",t.flowing);t.flowing&&null!==e.read(););}function S(e,t){if(0===t.length)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=C(e,t.buffer,t.decoder),n}function C(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?A(e,t):D(e,t),r}function A(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}function D(e,t){var n=N.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,P(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function T(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}var P=n(158);e.exports=u;var I,R=n(387);u.ReadableState=s;var j=(n(143).EventEmitter,function(e,t){return e.listeners(t).length}),F=n(482),N=n(167).Buffer,B=t.Uint8Array||function(){},L=n(111);L.inherits=n(42);var q=n(1212),z=void 0;z=q&&q.debuglog?q.debuglog("stream"):function(){};var U,W=n(1112),V=n(481);L.inherits(u,F);var H=["error","close","destroy","pause","resume"];Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),u.prototype.destroy=V.destroy,u.prototype._undestroy=V.undestroy,u.prototype._destroy=function(e,t){this.push(null),t(e)},u.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=N.from(e,t),t=""),n=!0),l(this,e,t,!1,n)},u.prototype.unshift=function(e){return l(this,e,null,!0,!1)},u.prototype.isPaused=function(){return!1===this._readableState.flowing},u.prototype.setEncoding=function(e){return U||(U=n(265).StringDecoder),this._readableState.decoder=new U(e),this._readableState.encoding=e,this};var G=8388608;u.prototype.read=function(e){z("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return z("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):v(this),null;if(0===(e=d(e,t))&&t.ended)return 0===t.length&&O(this),null;var r=t.needReadable;z("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,z("length less than watermark",r)),t.ended||t.reading?(r=!1,z("reading or ended",r)):r&&(z("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=d(n,t)));var i;return i=e>0?S(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==i&&this.emit("data",i),i},u.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},u.prototype.pipe=function(e,t){function n(e,t){z("onunpipe"),e===f&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,o())}function i(){z("onend"),e.end()}function o(){z("cleanup"),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("drain",v),e.removeListener("error",u),e.removeListener("unpipe",n),f.removeListener("end",i),f.removeListener("end",p),f.removeListener("data",s),g=!0,!h.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function s(t){z("ondata"),y=!1,!1!==e.write(t)||y||((1===h.pipesCount&&h.pipes===e||h.pipesCount>1&&-1!==T(h.pipes,e))&&!g&&(z("false write response, pause",f._readableState.awaitDrain),f._readableState.awaitDrain++,y=!0),f.pause())}function u(t){z("onerror",t),p(),e.removeListener("error",u),0===j(e,"error")&&e.emit("error",t)}function l(){e.removeListener("finish",c),p()}function c(){z("onfinish"),e.removeListener("close",l),p()}function p(){z("unpipe"),f.unpipe(e)}var f=this,h=this._readableState;switch(h.pipesCount){case 0:h.pipes=e;break;case 1:h.pipes=[h.pipes,e];break;default:h.pipes.push(e)}h.pipesCount+=1,z("pipe count=%d opts=%j",h.pipesCount,t);var d=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,m=d?i:p;h.endEmitted?P(m):f.once("end",m),e.on("unpipe",n);var v=b(f);e.on("drain",v);var g=!1,y=!1;return f.on("data",s),a(e,"error",u),e.once("close",l),e.once("finish",c),e.emit("pipe",f),h.flowing||(z("pipe resume"),f.resume()),e},u.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var a=T(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},u.prototype.on=function(e,t){var n=F.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&v(this):P(x,this))}return n},u.prototype.addListener=u.prototype.on,u.prototype.resume=function(){var e=this._readableState;return e.flowing||(z("resume"),e.flowing=!0,w(this,e)),this},u.prototype.pause=function(){return z("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(z("pause"),this._readableState.flowing=!1,this.emit("pause")),this},u.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(z("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(z("wrapped data"),t.decoder&&(i=t.decoder.write(i)),(!t.objectMode||null!==i&&void 0!==i)&&(t.objectMode||i&&i.length)){r.push(i)||(n=!0,e.pause())}});for(var i in e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<H.length;o++)e.on(H[o],r.emit.bind(r,H[o]));return r._read=function(t){z("wrapped _read",t),n&&(n=!1,e.resume())},r},u._fromList=S}).call(t,n(17),n(33))},function(e,t,n){"use strict";function r(e){this.afterTransform=function(t,n){return i(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);s.call(this,e),this._transformState=new r(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e,n){a(t,e,n)}):a(t)})}function a(e,t,n){if(t)return e.emit("error",t);null!==n&&void 0!==n&&e.push(n);var r=e._writableState,i=e._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}e.exports=o;var s=n(71),u=n(111);u.inherits=n(42),u.inherits(o,s),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var n=this;s.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";function r(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;if(r||i)return void(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a(o,this,e));this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit("error",t)}var a=n(158);e.exports={destroy:r,undestroy:i}},function(e,t,n){e.exports=n(143).EventEmitter},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e&&"@@redux/INIT"===e.type?"initialState argument passed to createStore":"previous state received by the reducer"},e.exports=t.default},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}t.a=r},function(e,t,n){"use strict";function r(e,t,o){function u(){y===g&&(y=g.slice())}function l(){return v}function c(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return u(),y.push(e),function(){if(t){t=!1,u();var n=y.indexOf(e);y.splice(n,1)}}}function p(e){if(!n.i(i.a)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(_)throw new Error("Reducers may not dispatch actions.");try{_=!0,v=m(v,e)}finally{_=!1}for(var t=g=y,r=0;r<t.length;r++){(0,t[r])()}return e}function f(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");m=e,p({type:s.INIT})}function h(){var e,t=c;return e={subscribe:function(e){function n(){e.next&&e.next(l())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");return n(),{unsubscribe:t(n)}}},e[a.a]=function(){return this},e}var d;if("function"==typeof t&&void 0===o&&(o=t,t=void 0),void 0!==o){if("function"!=typeof o)throw new Error("Expected the enhancer to be a function.");return o(r)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var m=e,v=t,g=[],y=g,_=!1;return p({type:s.INIT}),d={dispatch:p,subscribe:c,getState:l,replaceReducer:f},d[a.a]=h,d}n.d(t,"b",function(){return s}),t.a=r;var i=n(391),o=n(1182),a=n.n(o),s={INIT:"@@redux/INIT"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(485),i=n(1123),o=n(1122),a=n(1121),s=n(484);n(487);n.d(t,"createStore",function(){return r.a}),n.d(t,"combineReducers",function(){return i.a}),n.d(t,"bindActionCreators",function(){return o.a}),n.d(t,"applyMiddleware",function(){return a.a}),n.d(t,"compose",function(){return s.a})},function(e,t,n){"use strict"},function(e,t,n){"use strict";e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",GT:">",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},function(e,t,n){"use strict";var r=n(26).replaceEntities;e.exports=function(e){var t=r(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}},function(e,t,n){"use strict";e.exports=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},function(e,t,n){"use strict";var r=n(489),i=n(26).unescapeMd;e.exports=function(e,t){var n,o,a,s=t,u=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t<u;){if(10===(n=e.src.charCodeAt(t)))return!1;if(62===n)return a=r(i(e.src.slice(s+1,t))),!!e.parser.validateLink(a)&&(e.pos=t+1,e.linkContent=a,!0);92===n&&t+1<u?t+=2:t++}return!1}for(o=0;t<u&&32!==(n=e.src.charCodeAt(t))&&!(n>8&&n<14);)if(92===n&&t+1<u)t+=2;else{if(40===n&&++o>1)break;if(41===n&&--o<0)break;t++}return s!==t&&(a=i(e.src.slice(s,t)),!!e.parser.validateLink(a)&&(e.linkContent=a,e.pos=t,!0))}},function(e,t,n){"use strict";var r=n(26).unescapeMd;e.exports=function(e,t){var n,i=t,o=e.posMax,a=e.src.charCodeAt(t);if(34!==a&&39!==a&&40!==a)return!1;for(t++,40===a&&(a=41);t<o;){if((n=e.src.charCodeAt(t))===a)return e.pos=t+1,e.linkContent=r(e.src.slice(i+1,t)),!0;92===n&&t+1<o?t+=2:t++}return!1}},function(e,t,n){function r(){i.call(this)}e.exports=r;var i=n(143).EventEmitter;n(42)(r,i),r.Readable=n(262),r.Writable=n(1115),r.Duplex=n(1110),r.Transform=n(1114),r.PassThrough=n(1113),r.Stream=r,r.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&l.pause&&l.pause()}function r(){l.readable&&l.resume&&l.resume()}function o(){c||(c=!0,e.end())}function a(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(u(),0===i.listenerCount(this,"error"))throw e}function u(){l.removeListener("data",n),e.removeListener("drain",r),l.removeListener("end",o),l.removeListener("close",a),l.removeListener("error",s),e.removeListener("error",s),l.removeListener("end",u),l.removeListener("close",u),e.removeListener("close",u)}var l=this;l.on("data",n),e.on("drain",r),e._isStdio||t&&!1===t.end||(l.on("end",o),l.on("close",a));var c=!1;return l.on("error",s),e.on("error",s),l.on("end",u),l.on("close",u),e.on("close",u),e.emit("pipe",l),e}},function(e,t){/*! http://mths.be/repeat v0.2.0 by @mathias */ -String.prototype.repeat||function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),t=function(e){if(null==this)throw TypeError();var t=String(this),n=e?Number(e):0;if(n!=n&&(n=0),n<0||n==1/0)throw RangeError();for(var r="";n;)n%2==1&&(r+=t),n>1&&(t+=t),n>>=1;return r};e?e(String.prototype,"repeat",{value:t,configurable:!0,writable:!0}):String.prototype.repeat=t}()},function(e,t,n){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=58)}([function(e,t){e.exports=n(47)},function(e,t){e.exports=n(30)},function(e,t){e.exports=n(48)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.openapi;return!!t&&(0,b.default)(t,"3")}function o(e){var t=e.swagger;return!!t&&(0,b.default)(t,"2")}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e&&"object"===(void 0===e?"undefined":(0,v.default)(e))?(e.operationId||"").replace(/\s/g,"").length?w(e.operationId):s(t,n):null}function s(e,t){return""+x(t)+w(e)}function u(e,t){return x(t)+"-"+e}function l(e,t){return e&&e.paths?c(e,function(e){var n=e.pathName,r=e.method,i=e.operation;if(!i||"object"!==(void 0===i?"undefined":(0,v.default)(i)))return!1;var o=i.operationId;return[a(i,n,r),u(n,r),o].some(function(e){return e&&e===t})}):null}function c(e,t){return p(e,t,!0)||null}function p(e,t,n){if(!e||"object"!==(void 0===e?"undefined":(0,v.default)(e))||!e.paths||"object"!==(0,v.default)(e.paths))return null;var r=e.paths;for(var i in r)for(var o in r[i])if("PARAMETERS"!==o.toUpperCase()){var a=r[i][o];if(a&&"object"===(void 0===a?"undefined":(0,v.default)(a))){var s={spec:e,pathName:i,method:o.toUpperCase(),operation:a},u=t(s);if(n&&u)return s}}}function f(e){var t=e.spec,n=t.paths,r={};if(!n)return e;for(var i in n){var o=n[i];if((0,y.default)(o)){var s=o.parameters;for(var u in o)!function(e){var n=o[e];if(!(0,y.default)(n))return"continue";var u=a(n,i,e);if(u){r[u]?r[u].push(n):r[u]=[n];var l=r[u];if(l.length>1)l.forEach(function(e,t){e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId=""+u+(t+1)});else if(void 0!==n.operationId){var c=l[0];c.__originalOperationId=c.__originalOperationId||n.operationId,c.operationId=u}}if("parameters"!==e){var p=[],f={};for(var h in t)"produces"!==h&&"consumes"!==h&&"security"!==h||(f[h]=t[h],p.push(f));if(s&&(f.parameters=s,p.push(f)),p.length){var m=!0,v=!1,g=void 0;try{for(var _,b=(0,d.default)(p);!(m=(_=b.next()).done);m=!0){var x=_.value;for(var w in x)if(n[w]){if("parameters"===w){var k=!0,E=!1,S=void 0;try{for(var C,A=(0,d.default)(x[w]);!(k=(C=A.next()).done);k=!0)!function(){var e=C.value;n[w].some(function(t){return t.name===e.name})||n[w].push(e)}()}catch(e){E=!0,S=e}finally{try{!k&&A.return&&A.return()}finally{if(E)throw S}}}}else n[w]=x[w]}}catch(e){v=!0,g=e}finally{try{!m&&b.return&&b.return()}finally{if(v)throw g}}}}}(u)}}return e}Object.defineProperty(t,"__esModule",{value:!0});var h=n(13),d=r(h),m=n(2),v=r(m);t.isOAS3=i,t.isSwagger2=o,t.opId=a,t.idFromPathMethod=s,t.legacyIdFromPathMethod=u,t.getOperationRaw=l,t.findOperation=c,t.eachOperation=p,t.normalizeSwagger=f;var g=n(51),y=r(g),_=n(19),b=r(_),x=function(e){return String.prototype.toLowerCase.call(e)},w=function(e){return e.replace(/[^\w]/gi,"_")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"object"===(void 0===e?"undefined":(0,b.default)(e))&&(t=e,e=t.url),t.headers=t.headers||{},A.mergeInQueryOrForm(t),t.requestInterceptor&&(t=t.requestInterceptor(t)||t),/multipart\/form-data/i.test(t.headers["content-type"]||t.headers["Content-Type"])&&(delete t.headers["content-type"],delete t.headers["Content-Type"]),(t.userFetch||fetch)(t.url,t).then(function(n){var r=A.serializeRes(n,e,t).then(function(e){return t.responseInterceptor&&(e=t.responseInterceptor(e)||e),e});if(!n.ok){var i=new Error(n.statusText);return i.statusCode=i.status=n.status,r.then(function(e){throw i.response=e,i},function(e){throw i.responseError=e,i})}return r})}function o(e,t){return"application/json"===t?JSON.parse(e):E.default.safeLoad(e)}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.loadSpec,i=void 0!==r&&r,a={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:s(e.headers)},u=a.headers["content-type"],l=i||D(u);return(l?e.text:e.blob||e.buffer).call(e).then(function(e){if(a.text=e,a.data=e,l)try{var t=o(e,u);a.body=t,a.obj=t}catch(e){a.parseError=e}return a})}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return"function"==typeof e.forEach?(e.forEach(function(e,n){void 0!==t[n]?(t[n]=Array.isArray(t[n])?t[n]:[t[n]],t[n].push(e)):t[n]=e}),t):t}function u(e){return"undefined"!=typeof File?e instanceof File:null!==e&&"object"===(void 0===e?"undefined":(0,b.default)(e))&&"function"==typeof e.pipe}function l(e,t){var n=e.collectionFormat,r=e.allowEmptyValue,i="object"===(void 0===e?"undefined":(0,b.default)(e))?e.value:e,o={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};if(void 0===i&&r)return"";if(u(i)||"boolean"==typeof i)return i;var a=encodeURIComponent;return t&&(a=(0,C.default)(i)?function(e){return e}:function(e){return(0,y.default)(e)}),"object"!==(void 0===i?"undefined":(0,b.default)(i))||Array.isArray(i)?Array.isArray(i)?Array.isArray(i)&&!n?i.map(a).join(","):"multi"===n?i.map(a):i.map(a).join(o[n]):a(i):""}function c(e){var t=(0,v.default)(e).reduce(function(t,n){var r=e[n],i=!!r.skipEncoding,o=i?n:encodeURIComponent(n),a=function(e){return e&&"object"===(void 0===e?"undefined":(0,b.default)(e))}(r)&&!Array.isArray(r);return t[o]=l(a?r:{value:r},i),t},{});return w.default.stringify(t,{encode:!1,indices:!1})||""}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.url,r=void 0===t?"":t,i=e.query,o=e.form;if(o){var a=(0,v.default)(o).some(function(e){return u(o[e].value)}),s=e.headers["content-type"]||e.headers["Content-Type"];if(a||/multipart\/form-data/i.test(s)){var p=n(46);e.body=new p,(0,v.default)(o).forEach(function(t){e.body.append(t,l(o[t],!0))})}else e.body=c(o);delete e.form}if(i){var f=r.split("?"),h=(0,d.default)(f,2),m=h[0],g=h[1],y="";if(g){var _=w.default.parse(g);(0,v.default)(i).forEach(function(e){return delete _[e]}),y=w.default.stringify(_,{encode:!0})}var b=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(function(e){return e}).join("&");return r?"?"+r:""}(y,c(i));e.url=m+b,delete e.query}return e}function f(e,t,n){return n=n||function(e){return e},t=t||function(e){return e},function(r){return"string"==typeof r&&(r={url:r}),A.mergeInQueryOrForm(r),r=t(r),n(e(r))}}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldDownloadAsText=t.self=void 0;var h=n(38),d=r(h),m=n(0),v=r(m),g=n(6),y=r(g),_=n(2),b=r(_);t.default=i,t.serializeRes=a,t.serializeHeaders=s,t.encodeFormOrQuery=c,t.mergeInQueryOrForm=p,t.makeHttp=f,n(42);var x=n(55),w=r(x),k=n(47),E=r(k),S=n(53),C=r(S),A=t.self={serializeRes:a,mergeInQueryOrForm:p},D=t.shouldDownloadAsText=function(){return/(json|xml|yaml|text)\b/.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){if(n=n||{},t=(0,z.default)({},t,{path:t.path&&o(t.path)}),"merge"===t.op){var r=I(e,t.path);(0,z.default)(r,t.value),W.default.applyPatch(e,[s(t.path,r)])}else if("mergeDeep"===t.op){var i=I(e,t.path),a=(0,z.default)({},i);(0,J.default)(i,t.value);for(var u in t.value)if(Object.prototype.hasOwnProperty.call(t.value,u)){var l=t.value[u];if(Array.isArray(l)){var c=a[u]||[];i[u]=c.concat(l)}}}else if("add"===t.op&&""===t.path&&k(t.value)){var p=(0,L.default)(t.value).reduce(function(e,n){return e.push({op:"add",path:"/"+o(n),value:t.value[n]}),e},[]);W.default.applyPatch(e,p)}else if("replace"===t.op&&""===t.path){var f=t.value;n.allowMetaPatches&&t.meta&&M(t)&&(Array.isArray(t.value)||k(t.value))&&(f=(0,z.default)({},f,t.meta)),e=f}else if(W.default.applyPatch(e,[t]),n.allowMetaPatches&&t.meta&&M(t)&&(Array.isArray(t.value)||k(t.value))){var h=I(e,t.path),d=(0,z.default)({},h,t.meta);W.default.applyPatch(e,[s(t.path,d)])}return e}function o(e){return Array.isArray(e)?e.length<1?"":"/"+e.map(function(e){return(e+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/"):e}function a(e,t){return{op:"add",path:e,value:t}}function s(e,t,n){return{op:"replace",path:e,value:t,meta:n}}function u(e,t){return{op:"remove",path:e}}function l(e,t){return{type:"mutation",op:"merge",path:e,value:t}}function c(e,t){return{type:"mutation",op:"mergeDeep",path:e,value:t}}function p(e,t){return{type:"context",path:e,value:t}}function f(e,t){try{return d(e,v,t)}catch(e){return e}}function h(e,t){try{return d(e,m,t)}catch(e){return e}}function d(e,t,n){return w(x(e.filter(M).map(function(e){return t(e.value,n,e.path)})||[]))}function m(e,t,n){return n=n||[],Array.isArray(e)?e.map(function(e,r){return m(e,t,n.concat(r))}):k(e)?(0,L.default)(e).map(function(r){return m(e[r],t,n.concat(r))}):t(e,n[n.length-1],n)}function v(e,t,n){n=n||[];var r=[];if(n.length>0){var i=t(e,n[n.length-1],n);i&&(r=r.concat(i))}if(Array.isArray(e)){var o=e.map(function(e,r){return v(e,t,n.concat(r))});o&&(r=r.concat(o))}else if(k(e)){var a=(0,L.default)(e).map(function(r){return v(e[r],t,n.concat(r))});a&&(r=r.concat(a))}return r=x(r)}function g(e,t){if(!Array.isArray(t))return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function y(e,t){return t.reduce(function(e,t){return void 0!==t&&e?e[t]:e},e)}function _(e){return w(x(b(e)))}function b(e){return Array.isArray(e)?e:[e]}function x(e){var t;return(t=[]).concat.apply(t,(0,N.default)(e.map(function(e){return Array.isArray(e)?x(e):e})))}function w(e){return e.filter(function(e){return void 0!==e})}function k(e){return e&&"object"===(void 0===e?"undefined":(0,j.default)(e))}function E(e){return k(e)&&S(e.then)}function S(e){return e&&"function"==typeof e}function C(e){return e instanceof Error}function A(e){if(P(e)){var t=e.op;return"add"===t||"remove"===t||"replace"===t}return!1}function D(e){return H.default.isGeneratorFunction(e)}function O(e){return A(e)||P(e)&&"mutation"===e.type}function M(e){return O(e)&&("add"===e.op||"replace"===e.op||"merge"===e.op||"mergeDeep"===e.op)}function T(e){return P(e)&&"context"===e.type}function P(e){return e&&"object"===(void 0===e?"undefined":(0,j.default)(e))}function I(e,t){try{return W.default.getValueByPointer(e,t)}catch(e){return console.error(e),{}}}Object.defineProperty(t,"__esModule",{value:!0});var R=n(2),j=r(R),F=n(39),N=r(F),B=n(0),L=r(B),q=n(1),z=r(q),U=n(45),W=r(U),V=n(17),H=r(V),G=n(43),J=r(G);t.default={add:a,replace:s,remove:u,merge:l,mergeDeep:c,context:p,getIn:y,applyPatch:i,parentPathMatch:g,flatten:x,fullyNormalizeArray:_,normalizeArray:b,isPromise:E,forEachNew:f,forEachNewPrimitive:h,isJsonPatch:A,isContextPatch:T,isPatch:P,isMutation:O,isAdditiveMutation:M,isGenerator:D,isFunction:S,isObject:k,isError:C}},function(e,t){e.exports=n(35)},function(e,t){e.exports=n(21)},function(e,t){e.exports=n(939)},function(e,t){e.exports=n(572)},function(e,t){e.exports=n(497)},function(e,t,n){"use strict";function r(e){var t=e[e.length-1],n=e.join("/");return i.indexOf(t)>-1||o.indexOf(n)>-1}Object.defineProperty(t,"__esModule",{value:!0}),t.isFreelyNamed=r;var i=["properties"],o=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"]},function(e,t,n){"use strict";function r(e,t){function n(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack;for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];this.message=n[0],t&&t.apply(this,n)}return n.prototype=new Error,n.prototype.name=e,n.prototype.constructor=n,n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t){e.exports=n(95)},function(e,t){e.exports=n(332)},function(e,t){e.exports=n(2)},function(e,t){e.exports=n(3)},function(e,t){e.exports=n(569)},function(e,t){e.exports=n(224)},function(e,t){e.exports=n(956)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e?n.url=e:n=e,!(this instanceof i))return new i(n);(0,l.default)(this,n);var r=this.resolve().then(function(){return t.disableInterfaces||(0,l.default)(t,i.makeApisTagOperation(t)),t});return r.client=this,r}var o=n(7),a=r(o),s=n(48),u=(r(s),n(8)),l=r(u),c=n(19),p=r(c),f=n(10),h=r(f),d=n(4),m=r(d),v=n(28),g=r(v),y=n(27),_=n(21),b=n(3);i.http=m.default,i.makeHttp=d.makeHttp.bind(null,i.http),i.resolve=g.default,i.execute=_.execute,i.serializeRes=d.serializeRes,i.serializeHeaders=d.serializeHeaders,i.clearCache=v.clearCache,i.parameterBuilders=_.PARAMETER_BUILDERS,i.makeApisTagOperation=y.makeApisTagOperation,i.buildRequest=_.buildRequest,i.helpers={opId:b.opId},e.exports=i,i.prototype={http:m.default,execute:function(e){return this.applyDefaults(),i.execute((0,a.default)({spec:this.spec,http:this.http,securities:{authorized:this.authorizations}},e))},resolve:function(){var e=this;return i.resolve({spec:this.spec,url:this.url,allowMetaPatches:this.allowMetaPatches,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null}).then(function(t){return e.originalSpec=e.spec,e.spec=t.spec,e.errors=t.errors,e})}},i.prototype.applyDefaults=function(){var e=this.spec,t=this.url;if(t&&(0,p.default)(t,"http")){var n=h.default.parse(t);e.host||(e.host=n.host),e.schemes||(e.schemes=[n.protocol.replace(":","")]),e.basePath||(e.basePath="/")}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.http,n=e.fetch,r=e.spec,i=e.operationId,o=e.pathName,a=e.method,s=e.parameters,u=e.securities,l=(0,v.default)(e,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),c=t||n||R.default;o&&a&&!i&&(i=(0,H.legacyIdFromPathMethod)(o,a));var p=Y.buildRequest((0,d.default)({spec:r,operationId:i,parameters:s,securities:u,http:c},l));return p.body&&((0,S.default)(p.body)||(0,A.default)(p.body))&&(p.body=(0,f.default)(p.body)),c(p)}function o(e){var t=e.spec,n=e.operationId,r=(e.securities,e.requestContentType,e.responseContentType),i=e.scheme,o=e.requestInterceptor,s=e.responseInterceptor,u=e.contextUrl,l=e.userFetch,c=(e.requestBody,e.server),p=e.serverVariables,f=e.http,h=e.parameters,m=e.parameterBuilders,v=(0,H.isOAS3)(t);m||(m=v?q.default:B.default);var g=f&&f.withCredentials?"include":"same-origin",_={url:"",credentials:g,headers:{},cookies:{}};o&&(_.requestInterceptor=o),s&&(_.responseInterceptor=s),l&&(_.userFetch=l);var b=(0,H.getOperationRaw)(t,n);if(!b)throw new J("Operation "+n+" not found");var x=b.operation,w=void 0===x?{}:x,k=b.method,E=b.pathName;if(_.url+=a({spec:t,scheme:i,contextUrl:u,server:c,serverVariables:p,pathName:E,method:k}),!n)return delete _.cookies,_;_.url+=E,_.method=(""+k).toUpperCase(),h=h||{};var S=t.paths[E]||{};r&&(_.headers.accept=r);var C=X([].concat(G(w.parameters)).concat(G(S.parameters)));C.forEach(function(e){var n=m[e.in],r=void 0;if("body"===e.in&&e.schema&&e.schema.properties&&(r=h),r=e&&e.name&&h[e.name],void 0===r?r=e&&e.name&&h[e.in+"."+e.name]:K(e.name,C).length>1&&console.warn("Parameter '"+e.name+"' is ambiguous because the defined spec has more than one parameter with the name: '"+e.name+"' and the passed-in parameter values did not define an 'in' value."),void 0!==e.default&&void 0===r&&(r=e.default),void 0===r&&e.required&&!e.allowEmptyValue)throw new Error("Required parameter "+e.name+" is not provided");n&&n({req:_,parameter:e,value:r,operation:w,spec:t})});var A=(0,d.default)({},e,{operation:w});if(_=v?(0,U.default)(A,_):(0,V.default)(A,_),_.cookies&&(0,y.default)(_.cookies).length){var D=(0,y.default)(_.cookies).reduce(function(e,t){var n=_.cookies[t];return e+(e?"&":"")+P.default.serialize(t,n)},"");_.headers.Cookie=D}return _.cookies&&delete _.cookies,(0,I.mergeInQueryOrForm)(_),_}function a(e){return(0,H.isOAS3)(e.spec)?s(e):c(e)}function s(e){var t=e.spec,n=e.pathName,r=e.method,i=e.server,o=e.contextUrl,a=e.serverVariables,s=void 0===a?{}:a,c=(0,k.default)(t,["paths",n,(r||"").toLowerCase(),"servers"])||(0,k.default)(t,["paths",n,"servers"])||(0,k.default)(t,["servers"]),p="",f=null;if(i&&c){var h=c.map(function(e){return e.url});h.indexOf(i)>-1&&(p=i,f=c[h.indexOf(i)])}return!p&&c&&(p=c[0].url,f=c[0]),p.indexOf("{")>-1&&l(p).forEach(function(e){if(f.variables&&f.variables[e]){var t=f.variables[e],n=s[e]||t.default,r=new RegExp("{"+e+"}","g");p=p.replace(r,n)}}),u(p,o)}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=M.default.parse(e),r=M.default.parse(t),i=$(n.protocol)||$(r.protocol)||"",o=n.host||r.host,a=n.pathname||"",s=void 0;return s=i&&o?i+"://"+(o+a):a,"/"===s[s.length-1]?s.slice(0,-1):s}function l(e){for(var t=[],n=/{([^}]+)}/g,r=void 0;r=n.exec(e);)t.push(r[1]);return t}function c(e){var t=e.spec,n=e.scheme,r=e.contextUrl,i=void 0===r?"":r,o=M.default.parse(i),a=Array.isArray(t.schemes)?t.schemes[0]:null,s=n||a||$(o.protocol)||"http",u=t.host||o.host||"",l=t.basePath||"",c=void 0;return c=s&&u?s+"://"+(u+l):l,"/"===c[c.length-1]?c.slice(0,-1):c}Object.defineProperty(t,"__esModule",{value:!0}),t.self=void 0;var p=n(6),f=r(p),h=n(7),d=r(h),m=n(37),v=r(m),g=n(0),y=r(g),_=n(1),b=r(_);t.execute=i,t.buildRequest=o,t.baseUrl=a;var x=n(8),w=(r(x),n(18)),k=r(w),E=n(52),S=r(E),C=n(50),A=r(C),D=n(9),O=(r(D),n(10)),M=r(O),T=n(40),P=r(T),I=n(4),R=r(I),j=n(12),F=r(j),N=n(26),B=r(N),L=n(23),q=r(L),z=n(22),U=r(z),W=n(25),V=r(W),H=n(3),G=function(e){return Array.isArray(e)?e:[]},J=(0,F.default)("OperationNotFoundError",function(e,t,n){this.originalError=n,(0,b.default)(this,t||{})}),K=function(e,t){return t.filter(function(t){return t.name===e})},X=function(e){var t={};e.forEach(function(e){t[e.in]||(t[e.in]={}),t[e.in][e.name]=e});var n=[];return(0,y.default)(t).forEach(function(e){(0,y.default)(t[e]).forEach(function(r){n.push(t[e][r])})}),n},Y=t.self={buildRequest:o},$=function(e){return e?e.replace(/\W/g,""):null}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,i=e.operation,o=void 0===i?{}:i,a=e.spec,s=(0,f.default)({},t),u=r.authorized,l=void 0===u?{}:u,p=o.security||a.security||[],h=l&&!!(0,c.default)(l).length,m=(0,d.default)(a,["components","securitySchemes"])||{};return s.headers=s.headers||{},s.query=s.query||{},(0,c.default)(r).length&&h&&p&&(!Array.isArray(o.security)||o.security.length)?(p.forEach(function(e,t){for(var n in e){var r=l[n],i=m[n];if(r){var o=r.value||r,a=i.type;if(r)if("apiKey"===a)"query"===i.in&&(s.query[i.name]=o),"header"===i.in&&(s.headers[i.name]=o),"cookie"===i.in&&(s.cookies[i.name]=o);else if("http"===a){if("basic"===i.scheme){var u=o.username,c=o.password,p=(0,v.default)(u+":"+c);s.headers.Authorization="Basic "+p}"bearer"===i.scheme&&(s.headers.Authorization="Bearer "+o)}else if("oauth2"===a){var f=r.token||{},h=f.access_token,d=f.token_type;d&&"bearer"!==d.toLowerCase()||(d="Bearer"),s.headers.Authorization=d+" "+h}}}}),s):t}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),a=r(o),s=n(2),u=r(s),l=n(0),c=r(l);t.default=function(e,t){var n=e.operation,r=e.requestBody,o=e.securities,s=e.spec,l=e.requestContentType;t=i({request:t,securities:o,operation:n,spec:s});var p=n.requestBody||{},f=(0,c.default)(p.content||{});if(r){var h=l&&f.indexOf(l)>-1;if(l&&h)t.headers["Content-Type"]=l;else if(!l){var d=f[0];d&&(t.headers["Content-Type"]=d,l=d)}}return r&&(l?f.indexOf(l)>-1&&("application/x-www-form-urlencoded"===l?"object"===(void 0===r?"undefined":(0,u.default)(r))?(t.form={},(0,c.default)(r).forEach(function(e){var n=r[e],i=void 0;i="object"===(void 0===n?"undefined":(0,u.default)(n))?Array.isArray(n)?n.toString():(0,a.default)(n):n,t.form[e]={value:i}})):t.form=r:t.body=r):t.body=r),t},t.applySecurities=i;var p=n(8),f=r(p),h=n(18),d=r(h),m=n(9),v=r(m)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.req,n=e.value,r=e.parameter,i=r.name,o=r.style,a=r.explode,s=(0,h.default)({key:r.name,value:n,style:o||"simple",explode:a||!1,escape:!1});t.url=t.url.replace("{"+i+"}",s)}function o(e){var t=e.req,n=e.value,r=e.parameter;if(t.query=t.query||{},!1===n&&(n="false"),0===n&&(n="0"),n){var i=void 0===n?"undefined":(0,p.default)(n);if("deepObject"===r.style)(0,l.default)(n).forEach(function(e){var i=n[e];t.query[r.name+"["+e+"]"]={value:(0,h.default)({key:e,value:i,style:"deepObject",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}});else if("object"!==i||Array.isArray(n)||"form"!==r.style&&r.style||!r.explode&&void 0!==r.explode)t.query[r.name]={value:(0,h.default)({key:r.name,value:n,style:r.style||"form",explode:void 0===r.explode||r.explode,escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0};else{var o=(0,l.default)(n);o.forEach(function(e){var i=n[e];t.query[e]={value:(0,h.default)({key:e,value:i,style:r.style||"form",escape:r.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}})}}else if(r.allowEmptyValue){var a=r.name;t.query[a]=t.query[a]||{},t.query[a].allowEmptyValue=!0}}function a(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{},d.indexOf(n.name.toLowerCase())>-1||void 0!==r&&(t.headers[n.name]=(0,h.default)({key:n.name,value:r,style:n.style||"simple",explode:void 0!==n.explode&&n.explode,escape:!1}))}function s(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{};var i=void 0===r?"undefined":(0,p.default)(r);if("undefined"!==i){var o="object"===i&&!Array.isArray(r)&&n.explode?"":n.name+"=";t.headers.Cookie=o+(0,h.default)({key:n.name,value:r,escape:!1,style:n.style||"form",explode:void 0!==n.explode&&n.explode})}}Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),l=r(u),c=n(2),p=r(c),f=n(24),h=r(f);t.default={path:i,query:o,header:a,cookie:s};var d=["accept","authorization","content-type"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.escape,r=arguments[2];return"number"==typeof e&&(e=e.toString()),"string"==typeof e&&e.length&&n?r?JSON.parse(e):(0,m.stringToCharArray)(e).map(function(e){return g(e)?e:v(e)&&"unsafe"===n?e:((0,d.default)(e)||[]).map(function(e){return e.toString(16).toUpperCase()}).map(function(e){return"%"+e}).join("")}).join(""):e}function o(e){var t=e.key,n=e.value,r=e.style,o=e.explode,a=e.escape,s=function(e){return i(e,{escape:a})};if("simple"===r)return n.map(function(e){return s(e)}).join(",");if("label"===r)return"."+n.map(function(e){return s(e)}).join(".");if("matrix"===r)return n.map(function(e){return s(e)}).reduce(function(e,n){return!e||o?(e||"")+";"+t+"="+n:e+","+n},"");if("form"===r){var u=o?"&"+t+"=":",";return n.map(function(e){return s(e)}).join(u)}if("spaceDelimited"===r){var l=o?t+"=":"";return n.map(function(e){return s(e)}).join(" "+l)}if("pipeDelimited"===r){var c=o?t+"=":"";return n.map(function(e){return s(e)}).join("|"+c)}}function a(e){var t=e.key,n=e.value,r=e.style,o=e.explode,a=e.escape,s=function(e){return i(e,{escape:a})},u=(0,l.default)(n);return"simple"===r?u.reduce(function(e,t){var r=s(n[t]),i=o?"=":",";return(e?e+",":"")+t+i+r},""):"label"===r?u.reduce(function(e,t){var r=s(n[t]),i=o?"=":".";return(e?e+".":".")+t+i+r},""):"matrix"===r&&o?u.reduce(function(e,t){var r=s(n[t]);return(e?e+";":";")+t+"="+r},""):"matrix"===r?u.reduce(function(e,r){var i=s(n[r]);return(e?e+",":";"+t+"=")+r+","+i},""):"form"===r?u.reduce(function(e,t){var r=s(n[t]);return(e?e+(o?"&":","):"")+t+(o?"=":",")+r},""):void 0}function s(e){var t=e.key,n=e.value,r=e.style,o=e.escape,a=function(e){return i(e,{escape:o})};return"simple"===r?a(n):"label"===r?"."+a(n):"matrix"===r?";"+t+"="+a(n):"form"===r?a(n):"deepObject"===r?a(n):void 0}Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),l=r(u),c=n(2),p=r(c);t.encodeDisallowedCharacters=i,t.default=function(e){var t=e.value;return Array.isArray(t)?o(e):"object"===(void 0===t?"undefined":(0,p.default)(t))?a(e):s(e)};var f=n(44),h=(r(f),n(56)),d=r(h),m=n(57),v=function(e){return":/?#[]@!$&'()*+,;=".indexOf(e)>-1},g=function(e){return/^[a-z0-9\-._~]+$/i.test(e)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,i=e.operation,o=void 0===i?{}:i,s=e.spec,l=(0,c.default)({},t),p=r.authorized,f=void 0===p?{}:p,h=r.specSecurity,d=void 0===h?[]:h,m=o.security||d,v=f&&!!(0,a.default)(f).length,g=s.securityDefinitions;return l.headers=l.headers||{},l.query=l.query||{},(0,a.default)(r).length&&v&&m&&(!Array.isArray(o.security)||o.security.length)?(m.forEach(function(e,t){for(var n in e){var r=f[n];if(r){var i=r.token,o=r.value||r,a=g[n],s=a.type,c=i&&i.access_token,p=i&&i.token_type;if(r)if("apiKey"===s){var h="query"===a.in?"query":"headers";l[h]=l[h]||{},l[h][a.name]=o}else"basic"===s?o.header?l.headers.authorization=o.header:(o.base64=(0,u.default)(o.username+":"+o.password),l.headers.authorization="Basic "+o.base64):"oauth2"===s&&c&&(p=p&&"bearer"!==p.toLowerCase()?p:"Bearer",l.headers.authorization=p+" "+c)}}}),l):t}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=r(o);t.default=function(e,t){var n=e.spec,r=e.operation,o=e.securities,a=e.requestContentType;return t=i({request:t,securities:o,operation:r,spec:n}),(t.body||t.form)&&(a?t.headers["Content-Type"]=a:Array.isArray(r.consumes)?t.headers["Content-Type"]=r.consumes[0]:Array.isArray(n.consumes)?t.headers["Content-Type"]=n.consumes[0]:r.parameters&&r.parameters.filter(function(e){return"file"===e.type}).length?t.headers["Content-Type"]="multipart/form-data":r.parameters&&r.parameters.filter(function(e){return"formData"===e.in}).length&&(t.headers["Content-Type"]="application/x-www-form-urlencoded")),t},t.applySecurities=i;var s=n(9),u=r(s),l=n(8),c=r(l);r(n(4))},function(e,t,n){"use strict";function r(e){var t=e.req,n=e.value;t.body=n}function i(e){var t=e.req,n=e.value,r=e.parameter;t.form=t.form||{},(n||r.allowEmptyValue)&&(t.form[r.name]={value:n,allowEmptyValue:r.allowEmptyValue,collectionFormat:r.collectionFormat})}function o(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{},void 0!==r&&(t.headers[n.name]=r)}function a(e){var t=e.req,n=e.value,r=e.parameter;t.url=t.url.replace("{"+r.name+"}",encodeURIComponent(n))}function s(e){var t=e.req,n=e.value,r=e.parameter;if(t.query=t.query||{},!1===n&&"boolean"===r.type&&(n="false"),0===n&&["number","integer"].indexOf(r.type)>-1&&(n="0"),n)t.query[r.name]={collectionFormat:r.collectionFormat,value:n};else if(r.allowEmptyValue){var i=r.name;t.query[i]=t.query[i]||{},t.query[i].allowEmptyValue=!0}}Object.defineProperty(t,"__esModule",{value:!0}),t.default={body:r,header:o,query:s,path:a,formData:i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var n=t.pathName,r=t.method,i=t.operationId;return function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.execute((0,l.default)({spec:e.spec},(0,p.default)(e,"requestInterceptor","responseInterceptor","userFetch"),{pathName:n,method:r,parameters:t,operationId:i},o))}}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=m.makeExecute(e),n=m.mapTagOperations({spec:e.spec,cb:t}),r={};for(var i in n){r[i]={operations:{}};for(var o in n[i])r[i].operations[o]={execute:n[i][o]}}return{apis:r}}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=m.makeExecute(e);return{apis:m.mapTagOperations({spec:e.spec,cb:t})}}function s(e){var t=e.spec,n=e.cb,r=void 0===n?h:n,i=e.defaultTag,o=void 0===i?"default":i,a={},s={};return(0,f.eachOperation)(t,function(e){var n=e.pathName,i=e.method,u=e.operation;(u.tags?d(u.tags):[o]).forEach(function(e){if("string"==typeof e){var o=s[e]=s[e]||{},l=(0,f.opId)(u,n,i),c=r({spec:t,pathName:n,method:i,operation:u,operationId:l});if(a[l])a[l]++,o[""+l+a[l]]=c;else if(void 0!==o[l]){var p=a[l]||1;a[l]=p+1,o[""+l+a[l]]=c;var h=o[l];delete o[l],o[""+l+p]=h}else o[l]=c}})}),s}Object.defineProperty(t,"__esModule",{value:!0}),t.self=void 0;var u=n(7),l=r(u);t.makeExecute=i,t.makeApisTagOperationsOperationExecute=o,t.makeApisTagOperation=a,t.mapTagOperations=s;var c=n(54),p=r(c),f=n(3),h=function(){return null},d=function(e){return Array.isArray(e)?e:[e]},m=t.self={mapTagOperations:s,makeExecute:i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.requestInterceptor,r=t.responseInterceptor,i=e.withCredentials?"include":"same-origin";return function(t){return e({url:t,loadSpec:!0,requestInterceptor:n,responseInterceptor:r,headers:{Accept:"application/json"},credentials:i}).then(function(e){return e.body})}}function o(){l.plugins.refs.clearCache()}function a(e){function t(e){y&&(l.plugins.refs.docCache[y]=e),l.plugins.refs.fetchJSON=i(g,{requestInterceptor:m,responseInterceptor:v});var t=[l.plugins.refs];return"function"==typeof d&&t.push(l.plugins.parameters),"function"==typeof h&&t.push(l.plugins.properties),"strict"!==a&&t.push(l.plugins.allOf),(0,c.default)({spec:e,context:{baseDoc:y},plugins:t,allowMetaPatches:f,parameterMacro:d,modelPropertyMacro:h}).then(p.normalizeSwagger)}var n=e.fetch,r=e.spec,o=e.url,a=e.mode,s=e.allowMetaPatches,f=void 0===s||s,h=e.modelPropertyMacro,d=e.parameterMacro,m=e.requestInterceptor,v=e.responseInterceptor,g=e.http,y=e.baseDoc;return y=y||o,g=n||g||u.default,r?t(r):i(g,{requestInterceptor:m,responseInterceptor:v})(y).then(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.makeFetchJSON=i,t.clearCache=o,t.default=a;var s=n(4),u=r(s),l=n(29),c=r(l),p=n(3)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return new N(e).dispatch()}Object.defineProperty(t,"__esModule",{value:!0}),t.plugins=t.SpecMap=void 0;var o=n(6),a=r(o),s=n(14),u=r(s),l=n(17),c=r(l),p=n(0),f=r(p),h=n(13),d=r(h),m=n(35),v=r(m),g=n(1),y=r(g),_=n(15),b=r(_),x=n(16),w=r(x);t.default=i;var k=n(49),E=r(k),S=n(5),C=r(S),A=n(34),D=r(A),O=n(30),M=r(O),T=n(32),P=r(T),I=n(33),R=r(I),j=n(31),F=r(j),N=function(){function e(t){(0,b.default)(this,e),(0,y.default)(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new F.default,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:(0,y.default)((0,v.default)(this),C.default),allowMetaPatches:!1},t),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=this.plugins.map(this.wrapPlugin.bind(this)).filter(C.default.isFunction),this.patches.push(C.default.add([],this.spec)),this.patches.push(C.default.context([],this.context)),this.updatePatches(this.patches)}return(0,w.default)(e,[{key:"debug",value:function(e){if(this.debugLevel===e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=console).log.apply(t,r)}}},{key:"verbose",value:function(e){if("verbose"===this.debugLevel){for(var t,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=console).log.apply(t,["["+e+"] "].concat(r))}}},{key:"wrapPlugin",value:function(e,t){var n=null,r=void 0;return e[this.pluginProp]?(n=e,r=e[this.pluginProp]):C.default.isFunction(e)?r=e:C.default.isObject(e)&&(r=function(e){return c.default.mark(function t(n,r){var i,o,a,s,u,l,p,h,m;return c.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:m=function t(n,a,s){var u,l,p,h,m,v,g,y,_,b,x,w,k,E,S;return c.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(C.default.isObject(n)){i.next=6;break}if(e.key!==a[a.length-1]){i.next=4;break}return i.next=4,e.plugin(n,e.key,a,r);case 4:i.next=46;break;case 6:u=a.length-1,l=a[u],p=a.indexOf("properties"),h="properties"===l&&u===p,m=r.allowMetaPatches&&o[n.$$ref],v=!0,g=!1,y=void 0,i.prev=14,_=(0,d.default)((0,f.default)(n));case 16:if(v=(b=_.next()).done){i.next=32;break}if(x=b.value,w=n[x],k=a.concat(x),E=C.default.isObject(w),S=n.$$ref,m){i.next=26;break}if(!E){i.next=26;break}return r.allowMetaPatches&&S&&(o[S]=!0),i.delegateYield(t(w,k,s),"t0",26);case 26:if(h||x!==e.key){i.next=29;break}return i.next=29,e.plugin(w,x,k,r,s);case 29:v=!0,i.next=16;break;case 32:i.next=38;break;case 34:i.prev=34,i.t1=i.catch(14),g=!0,y=i.t1;case 38:i.prev=38,i.prev=39,!v&&_.return&&_.return();case 41:if(i.prev=41,!g){i.next=44;break}throw y;case 44:return i.finish(41);case 45:return i.finish(38);case 46:case"end":return i.stop()}},i,this,[[14,34,38,46],[39,,41,45]])},i=c.default.mark(m),o={},a=!0,s=!1,u=void 0,t.prev=6,l=(0,d.default)(n.filter(C.default.isAdditiveMutation));case 8:if(a=(p=l.next()).done){t.next=14;break}return h=p.value,t.delegateYield(m(h.value,h.path,h),"t0",11);case 11:a=!0,t.next=8;break;case 14:t.next=20;break;case 16:t.prev=16,t.t1=t.catch(6),s=!0,u=t.t1;case 20:t.prev=20,t.prev=21,!a&&l.return&&l.return();case 23:if(t.prev=23,!s){t.next=26;break}throw u;case 26:return t.finish(23);case 27:return t.finish(20);case 28:case"end":return t.stop()}},t,this,[[6,16,20,28],[21,,23,27]])})}(e)),(0,y.default)(r.bind(n),{pluginName:e.name||t,isGenerator:C.default.isGenerator(r)})}},{key:"nextPlugin",value:function(){var e=this;return(0,E.default)(this.wrappedPlugins,function(t){return e.getMutationsForPlugin(t).length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0)return u.default.race(this.promisedPatches.map(function(e){return e.value}))}},{key:"getPluginHistory",value:function(e){var t=this.getPluginName(e);return this.pluginHistory[t]||[]}},{key:"getPluginRunCount",value:function(e){return this.getPluginHistory(e).length}},{key:"getPluginHistoryTip",value:function(e){var t=this.getPluginHistory(e);return t&&t[t.length-1]||{}}},{key:"getPluginMutationIndex",value:function(e){var t=this.getPluginHistoryTip(e).mutationIndex;return"number"!=typeof t?-1:t}},{key:"getPluginName",value:function(e){return e.pluginName}},{key:"updatePluginHistory",value:function(e,t){var n=this.getPluginName(e);(this.pluginHistory[n]=this.pluginHistory[n]||[]).push(t)}},{key:"updatePatches",value:function(e,t){var n=this;C.default.normalizeArray(e).forEach(function(e){if(e instanceof Error)return void n.errors.push(e);try{if(!C.default.isObject(e))return void n.debug("updatePatches","Got a non-object patch",e);if(n.showDebug&&n.allPatches.push(e),C.default.isPromise(e.value))return n.promisedPatches.push(e),void n.promisedPatchThen(e);if(C.default.isContextPatch(e))return void n.setContext(e.path,e.value);if(C.default.isMutation(e))return void n.updateMutations(e)}catch(e){n.errors.push(e)}})}},{key:"updateMutations",value:function(e){var t=C.default.applyPatch(this.state,e,{allowMetaPatches:this.allowMetaPatches});t&&(this.mutations.push(e),this.state=t)}},{key:"removePromisedPatch",value:function(e){var t=this.promisedPatches.indexOf(e);if(t<0)return void this.debug("Tried to remove a promisedPatch that isn't there!");this.promisedPatches.splice(t,1)}},{key:"promisedPatchThen",value:function(e){var t=this;return e.value=e.value.then(function(n){var r=(0,y.default)({},e,{value:n});t.removePromisedPatch(e),t.updatePatches(r)}).catch(function(n){t.removePromisedPatch(e),t.updatePatches(n)})}},{key:"getMutations",value:function(e,t){return e=e||0,"number"!=typeof t&&(t=this.mutations.length),this.mutations.slice(e,t)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(e){var t=this.getPluginMutationIndex(e);return this.getMutations(t+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getPatchesOfType",value:function(e,t){return e.filter(t)}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(e){return C.default.getIn(this.state,e)}},{key:"_getContext",value:function(e){return this.contextTree.get(e)}},{key:"setContext",value:function(e,t){return this.contextTree.set(e,t)}},{key:"_hasRun",value:function(e){return this.getPluginRunCount(this.getCurrentPlugin())>(e||0)}},{key:"_clone",value:function(e){return JSON.parse((0,a.default)(e))}},{key:"dispatch",value:function(){function e(e){e&&(e=C.default.fullyNormalizeArray(e),n.updatePatches(e,r))}var t=this,n=this,r=this.nextPlugin();if(!r){var i=this.nextPromisedPatch();if(i)return i.then(function(){return t.dispatch()}).catch(function(){return t.dispatch()});var o={spec:this.state,errors:this.errors};return this.showDebug&&(o.patches=this.allPatches),u.default.resolve(o)}if(n.pluginCount=n.pluginCount||{},n.pluginCount[r]=(n.pluginCount[r]||0)+1,n.pluginCount[r]>100)return u.default.resolve({spec:n.state,errors:n.errors.concat(new Error("We've reached a hard limit of 100 plugin runs"))});if(r!==this.currentPlugin&&this.promisedPatches.length){var a=this.promisedPatches.map(function(e){return e.value});return u.default.all(a.map(function(e){return e.then(Function,Function)})).then(function(){return t.dispatch()})}return function(){n.currentPlugin=r;var t=n.getCurrentMutations(),i=n.mutations.length-1;try{if(r.isGenerator){var o=!0,a=!1,s=void 0;try{for(var u,l=(0,d.default)(r(t,n.getLib()));!(o=(u=l.next()).done);o=!0)e(u.value)}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}}else e(r(t,n.getLib()))}catch(t){e([(0,y.default)((0,v.default)(t),{plugin:r})])}finally{n.updatePluginHistory(r,{mutationIndex:i})}return n.dispatch()}()}}]),e}(),B={refs:D.default,allOf:M.default,parameters:P.default,properties:R.default};t.SpecMap=N,t.plugins=B},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(11);t.default={key:"allOf",plugin:function(e,t,n,r,a){if(!a.meta||!a.meta.$$ref){var s=n.slice(0,-1);if(!(0,o.isFreelyNamed)(s)){if(!Array.isArray(e)){var u=new TypeError("allOf must be an array");return u.fullPath=n,u}var l=!1,c=a.value;s.forEach(function(e){c=c[e]}),c=(0,i.default)({},c),delete c.allOf;var p=[r.replace(s,{})].concat(e.map(function(e,t){if(!r.isObject(e)){if(l)return null;l=!0;var i=new TypeError("Elements in allOf must be objects");return i.fullPath=n,i}return r.mergeDeep(s,e)}));return p.push(r.mergeDeep(s,c)),c.$$ref||p.push(r.remove([].concat(s,"$$ref"))),p}}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return o({children:{}},e,t)}function o(e,t,n){return e.value=t||{},e.protoValue=n?(0,l.default)({},n.protoValue,e.value):e.value,(0,s.default)(e.children).forEach(function(t){var n=e.children[t];e.children[t]=o(n,n.value,e)}),e}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),s=r(a),u=n(7),l=r(u),c=n(15),p=r(c),f=n(16),h=r(f),d=function(){function e(t){(0,p.default)(this,e),this.root=i(t||{})}return(0,h.default)(e,[{key:"set",value:function(e,t){var n=this.getParent(e,!0);if(!n)return void o(this.root,t,null);var r=e[e.length-1],a=n.children;if(a[r])return void o(a[r],t,n);a[r]=i(t,n)}},{key:"get",value:function(e){if(e=e||[],e.length<1)return this.root.value;for(var t=this.root,n=void 0,r=void 0,i=0;i<e.length&&(r=e[i],n=t.children,n[r]);i++)t=n[r];return t&&t.protoValue}},{key:"getParent",value:function(e,t){return!e||e.length<1?null:e.length<2?this.root:e.slice(0,-1).reduce(function(e,n){if(!e)return e;var r=e.children;return!r[n]&&t&&(r[n]=i(null,e)),r[n]},this.root)}}]),e}();t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(5),s=r(a);t.default={key:"parameters",plugin:function(e,t,n,r,i){if(Array.isArray(e)&&e.length){var a=(0,o.default)([],e),u=n.slice(0,-1),l=(0,o.default)({},s.default.getIn(r.spec,u));return e.forEach(function(e,t){try{a[t].default=r.parameterMacro(l,e)}catch(e){var i=new Error(e);return i.fullPath=n,i}}),s.default.replace(n,a)}return s.default.replace(n,e)}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(5),s=r(a);t.default={key:"properties",plugin:function(e,t,n,r){var i=(0,o.default)({},e);for(var a in e)try{i[a].default=r.modelPropertyMacro(i[a])}catch(e){var u=new Error(e);return u.fullPath=n,u}return s.default.replace(n,i)}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!N.test(e)){if(!t)throw new B("Tried to resolve a relative URL, without having a basePath. path: '"+e+"' basePath: '"+t+"'");return T.default.resolve(t,e)}return e}function o(e,t){return new B("Could not resolve reference because of: "+e.message,t,e)}function a(e){return(e+"").split("#")}function s(e,t){var n=L[e];if(n&&!I.default.isPromise(n))try{var r=p(t,n);return(0,D.default)(E.default.resolve(r),{__value:r})}catch(e){return E.default.reject(e)}return l(e).then(function(e){return p(t,e)})}function u(e){void 0!==e?delete L[e]:(0,w.default)(L).forEach(function(e){delete L[e]})}function l(e){var t=L[e];return t?I.default.isPromise(t)?t:E.default.resolve(t):(L[e]=U.fetchJSON(e).then(function(t){return L[e]=t,t}),L[e])}function c(e){return(0,O.fetch)(e,{headers:{Accept:"application/json, application/yaml"},loadSpec:!0}).then(function(e){return e.json()})}function p(e,t){var n=f(e);if(n.length<1)return t;var r=I.default.getIn(t,n);if(void 0===r)throw new B("Could not resolve pointer: "+e+" does not exist in document",{pointer:e});return r}function f(e){if("string"!=typeof e)throw new TypeError("Expected a string, got a "+(void 0===e?"undefined":(0,b.default)(e)));return"/"===e[0]&&(e=e.substr(1)),""===e?[]:e.split("/").map(h)}function h(e){return"string"!=typeof e?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function d(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function m(e){return 0===e.length?"":"/"+e.map(d).join("/")}function v(e,t){if(W(t))return!0;var n=e.charAt(t.length);return 0===e.indexOf(t)&&(!n||"/"===n||"#"===n)}function g(e,t,n,r){var i=q.get(r);i||(i={},q.set(r,i));var o=m(n),a=(t||"<specmap-base>")+"#"+e;if(t==r.contextTree.get([]).baseDoc&&v(o,e))return!0;var s="";if(n.some(function(e){return s=s+"/"+d(e),i[s]&&i[s].some(function(e){return v(e,a)||v(a,e)})}))return!0;i[o]=(i[o]||[]).concat(a)}function y(e,t){function n(e){return I.default.isObject(e)&&(r.indexOf(e)>=0||(0,w.default)(e).some(function(t){return n(e[t])}))}var r=[e];return t.path.reduce(function(e,t){return r.push(e[t]),e[t]},e),n(t.value)}Object.defineProperty(t,"__esModule",{value:!0});var _=n(2),b=r(_),x=n(0),w=r(x),k=n(14),E=r(k),S=n(36),C=r(S),A=n(1),D=r(A),O=n(41),M=n(10),T=r(M),P=n(5),I=r(P),R=n(12),j=r(R),F=n(11),N=new RegExp("^([a-z]+://|//)","i"),B=(0,j.default)("JSONRefError",function(e,t,n){this.originalError=n,(0,D.default)(this,t||{})}),L={},q=new C.default,z={key:"$ref",plugin:function(e,t,n,r){var u=n.slice(0,-1);if(!(0,F.isFreelyNamed)(u)){var l=r.getContext(n).baseDoc;if("string"!=typeof e)return new B("$ref: must be a string (JSON-Ref)",{$ref:e,baseDoc:l,fullPath:n});var c=a(e),p=c[0],h=c[1]||"",d=void 0;try{d=l||p?i(p,l):null}catch(t){return o(t,{pointer:h,$ref:e,basePath:d,fullPath:n})}var m=void 0,v=void 0;if(!g(h,d,u,r)){if(null==d?(v=f(h),void 0===(m=r.get(v))&&(m=new B("Could not resolve reference: "+e,{pointer:h,$ref:e,baseDoc:l,fullPath:n}))):(m=s(d,h),m=null!=m.__value?m.__value:m.catch(function(t){throw o(t,{pointer:h,$ref:e,baseDoc:l,fullPath:n})})),m instanceof Error)return[I.default.remove(n),m];var _=I.default.replace(u,m,{$$ref:e});return d&&d!==l?[_,I.default.context(u,{baseDoc:d})]:y(r.state,_)?void 0:_}}}},U=(0,D.default)(z,{docCache:L,absoluteify:i,clearCache:u,JSONRefError:B,wrapError:o,getDoc:l,split:a,extractFromDoc:s,fetchJSON:c,extract:p,jsonPointerToArray:f,unescapeJsonPointerToken:h});t.default=U;var W=function(e){return!e||"/"===e||"#"===e}},function(e,t){e.exports=n(330)},function(e,t){e.exports=n(568)},function(e,t){e.exports=n(96)},function(e,t){e.exports=n(18)},function(e,t){e.exports=n(97)},function(e,t){e.exports=n(582)},function(e,t){e.exports=n(696)},function(e,t){e.exports=n(695)},function(e,t){e.exports=n(203)},function(e,t){e.exports=n(709)},function(e,t){e.exports=n(745)},function(e,t){e.exports=n(794)},function(e,t){e.exports=n(211)},function(e,t){e.exports=n(942)},function(e,t){e.exports=n(223)},function(e,t){e.exports=n(20)},function(e,t){e.exports=n(38)},function(e,t){e.exports=n(421)},function(e,t){e.exports=n(422)},function(e,t){e.exports=n(951)},function(e,t){e.exports=n(999)},function(e,t){e.exports=n(1189)},function(e,t){e.exports=n(1190)},function(e,t,n){e.exports=n(20)}])},function(e,t,n){function r(e,t){this._id=e,this._clearFn=t}var i=Function.prototype.apply;t.setTimeout=function(){return new r(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new r(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(1180),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,n){if(e&&l.isObject(e)&&e instanceof r)return e;var i=new r;return i.parse(e,t,n),i}function o(e){return l.isString(e)&&(e=i(e)),e instanceof r?e.format():r.prototype.format.call(e)}function a(e,t){return i(e,!1,!0).resolve(t)}function s(e,t){return e?i(e,!1,!0).resolveObject(t):t}var u=n(998),l=n(1188);t.parse=i,t.resolve=a,t.resolveObject=s,t.format=o,t.Url=r;var c=/^([a-z0-9.+-]+:)/i,p=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,h=["<",">",'"',"`"," ","\r","\n","\t"],d=["{","}","|","\\","^","`"].concat(h),m=["'"].concat(d),v=["%","/","?",";","#"].concat(m),g=["/","?","#"],y=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},k=n(1004);r.prototype.parse=function(e,t,n){if(!l.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),i=-1!==r&&r<e.indexOf("#")?"?":"#",o=e.split(i),a=/\\/g;o[0]=o[0].replace(a,"/"),e=o.join(i);var s=e;if(s=s.trim(),!n&&1===e.split("#").length){var p=f.exec(s);if(p)return this.path=s,this.href=s,this.pathname=p[1],p[2]?(this.search=p[2],this.query=t?k.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var h=c.exec(s);if(h){h=h[0];var d=h.toLowerCase();this.protocol=d,s=s.substr(h.length)}if(n||h||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===s.substr(0,2);!E||h&&x[h]||(s=s.substr(2),this.slashes=!0)}if(!x[h]&&(E||h&&!w[h])){for(var S=-1,C=0;C<g.length;C++){var A=s.indexOf(g[C]);-1!==A&&(-1===S||A<S)&&(S=A)}var D,O;O=-1===S?s.lastIndexOf("@"):s.lastIndexOf("@",S),-1!==O&&(D=s.slice(0,O),s=s.slice(O+1),this.auth=decodeURIComponent(D)),S=-1;for(var C=0;C<v.length;C++){var A=s.indexOf(v[C]);-1!==A&&(-1===S||A<S)&&(S=A)}-1===S&&(S=s.length),this.host=s.slice(0,S),s=s.slice(S),this.parseHost(),this.hostname=this.hostname||"";var M="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!M)for(var T=this.hostname.split(/\./),C=0,P=T.length;C<P;C++){var I=T[C];if(I&&!I.match(y)){for(var R="",j=0,F=I.length;j<F;j++)I.charCodeAt(j)>127?R+="x":R+=I[j];if(!R.match(y)){var N=T.slice(0,C),B=T.slice(C+1),L=I.match(_);L&&(N.push(L[1]),B.unshift(L[2])),B.length&&(s="/"+B.join(".")+s),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),M||(this.hostname=u.toASCII(this.hostname));var q=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+q,this.href+=this.host,M&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!b[d])for(var C=0,P=m.length;C<P;C++){var U=m[C];if(-1!==s.indexOf(U)){var W=encodeURIComponent(U);W===U&&(W=escape(U)),s=s.split(U).join(W)}}var V=s.indexOf("#");-1!==V&&(this.hash=s.substr(V),s=s.slice(0,V));var H=s.indexOf("?");if(-1!==H?(this.search=s.substr(H),this.query=s.substr(H+1),t&&(this.query=k.parse(this.query)),s=s.slice(0,H)):t&&(this.search="",this.query={}),s&&(this.pathname=s),w[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var q=this.pathname||"",G=this.search||"";this.path=q+G}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&l.isObject(this.query)&&Object.keys(this.query).length&&(o=k.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||w[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),a=a.replace("#","%23"),t+i+n+a+r},r.prototype.resolve=function(e){return this.resolveObject(i(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if(l.isString(e)){var t=new r;t.parse(e,!1,!0),e=t}for(var n=new r,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(n[c]=e[c])}return w[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!w[e.protocol]){for(var p=Object.keys(e),f=0;f<p.length;f++){var h=p[f];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||x[e.protocol])n.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),n.pathname=d.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",v=n.search||"";n.path=m+v}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var g=n.pathname&&"/"===n.pathname.charAt(0),y=e.host||e.pathname&&"/"===e.pathname.charAt(0),_=y||g||n.host&&e.pathname,b=_,k=n.pathname&&n.pathname.split("/")||[],d=e.pathname&&e.pathname.split("/")||[],E=n.protocol&&!w[n.protocol];if(E&&(n.hostname="",n.port=null,n.host&&(""===k[0]?k[0]=n.host:k.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),_=_&&(""===d[0]||""===k[0])),y)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,k=d;else if(d.length)k||(k=[]),k.pop(),k=k.concat(d),n.search=e.search,n.query=e.query;else if(!l.isNullOrUndefined(e.search)){if(E){n.hostname=n.host=k.shift();var S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");S&&(n.auth=S.shift(),n.host=n.hostname=S.shift())}return n.search=e.search,n.query=e.query,l.isNull(n.pathname)&&l.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=k.slice(-1)[0],A=(n.host||e.host||k.length>1)&&("."===C||".."===C)||""===C,D=0,O=k.length;O>=0;O--)C=k[O],"."===C?k.splice(O,1):".."===C?(k.splice(O,1),D++):D&&(k.splice(O,1),D--);if(!_&&!b)for(;D--;D)k.unshift("..");!_||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),A&&"/"!==k.join("/").substr(-1)&&k.push("");var M=""===k[0]||k[0]&&"/"===k[0].charAt(0);if(E){n.hostname=n.host=M?"":k.length?k.shift():"";var S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");S&&(n.auth=S.shift(),n.host=n.hostname=S.shift())}return _=_||n.host&&k.length,_&&!M&&k.unshift(""),k.length?n.pathname=k.join("/"):(n.pathname=null,n.path=null),l.isNull(n.pathname)&&l.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=p.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){(function(){var e,r,i,o=function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},a={}.hasOwnProperty;r=n(127),e=n(45).MarkedYAMLError,i=n(94),this.ComposerError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t}(e),this.Composer=function(){function e(){this.anchors={}}return e.prototype.check_node=function(){return this.check_event(r.StreamStartEvent)&&this.get_event(),!this.check_event(r.StreamEndEvent)},e.prototype.get_node=function(){if(!this.check_event(r.StreamEndEvent))return this.compose_document()},e.prototype.get_single_node=function(){var e,n;if(this.get_event(),e=null,this.check_event(r.StreamEndEvent)||(e=this.compose_document()),!this.check_event(r.StreamEndEvent))throw n=this.get_event(),new t.ComposerError("expected a single document in the stream",e.start_mark,"but found another document",n.start_mark);return this.get_event(),e},e.prototype.compose_document=function(){var e;return this.get_event(),e=this.compose_node(),this.get_event(),this.anchors={},e},e.prototype.compose_node=function(e,n){var i,o,a;if(this.check_event(r.AliasEvent)){if(o=this.get_event(),!((i=o.anchor)in this.anchors))throw new t.ComposerError(null,null,"found undefined alias "+i,o.start_mark);return this.anchors[i]}if(o=this.peek_event(),null!==(i=o.anchor)&&i in this.anchors)throw new t.ComposerError("found duplicate anchor "+i+"; first occurence",this.anchors[i].start_mark,"second occurrence",o.start_mark);return this.descend_resolver(e,n),this.check_event(r.ScalarEvent)?a=this.compose_scalar_node(i):this.check_event(r.SequenceStartEvent)?a=this.compose_sequence_node(i):this.check_event(r.MappingStartEvent)&&(a=this.compose_mapping_node(i)),this.ascend_resolver(),a},e.prototype.compose_scalar_node=function(e){var t,n,r;return t=this.get_event(),r=t.tag,null!==r&&"!"!==r||(r=this.resolve(i.ScalarNode,t.value,t.implicit)),n=new i.ScalarNode(r,t.value,t.start_mark,t.end_mark,t.style),null!==e&&(this.anchors[e]=n),n},e.prototype.compose_sequence_node=function(e){var t,n,o,a,s;for(a=this.get_event(),s=a.tag,null!==s&&"!"!==s||(s=this.resolve(i.SequenceNode,null,a.implicit)),o=new i.SequenceNode(s,[],a.start_mark,null,a.flow_style),null!==e&&(this.anchors[e]=o),n=0;!this.check_event(r.SequenceEndEvent);)o.value.push(this.compose_node(o,n)),n++;return t=this.get_event(),o.end_mark=t.end_mark,o},e.prototype.compose_mapping_node=function(e){var t,n,o,a,s,u;for(s=this.get_event(),u=s.tag,null!==u&&"!"!==u||(u=this.resolve(i.MappingNode,null,s.implicit)),a=new i.MappingNode(u,[],s.start_mark,null,s.flow_style),null!==e&&(this.anchors[e]=a);!this.check_event(r.MappingEndEvent);)n=this.compose_node(a),o=this.compose_node(a,n),a.value.push([n,o]);return t=this.get_event(),a.end_mark=t.end_mark,a},e}()}).call(this)},function(e,t,n){(function(e){(function(){var r,i,o,a=function(e,t){function n(){this.constructor=e}for(var r in t)s.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},s={}.hasOwnProperty,u=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};r=n(45).MarkedYAMLError,i=n(94),o=n(61),this.ConstructorError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return a(t,e),t}(r),this.BaseConstructor=function(){function e(){this.constructed_objects={},this.constructing_nodes=[],this.deferred_constructors=[]}return e.prototype.yaml_constructors={},e.prototype.yaml_multi_constructors={},e.add_constructor=function(e,t){return this.prototype.hasOwnProperty("yaml_constructors")||(this.prototype.yaml_constructors=o.extend({},this.prototype.yaml_constructors)),this.prototype.yaml_constructors[e]=t},e.add_multi_constructor=function(e,t){return this.prototype.hasOwnProperty("yaml_multi_constructors")||(this.prototype.yaml_multi_constructors=o.extend({},this.prototype.yaml_multi_constructors)),this.prototype.yaml_multi_constructors[e]=t},e.prototype.check_data=function(){return this.check_node()},e.prototype.get_data=function(){if(this.check_node())return this.construct_document(this.get_node())},e.prototype.get_single_data=function(){var e;return e=this.get_single_node(),null!=e?this.construct_document(e):null},e.prototype.construct_document=function(e){var t;for(t=this.construct_object(e);!o.is_empty(this.deferred_constructors);)this.deferred_constructors.pop()();return t},e.prototype.defer=function(e){return this.deferred_constructors.push(e)},e.prototype.construct_object=function(e){var n,r,o,a,s;if(e.unique_id in this.constructed_objects)return this.constructed_objects[e.unique_id];if(o=e.unique_id,u.call(this.constructing_nodes,o)>=0)throw new t.ConstructorError(null,null,"found unconstructable recursive node",e.start_mark);if(this.constructing_nodes.push(e.unique_id),n=null,s=null,e.tag in this.yaml_constructors)n=this.yaml_constructors[e.tag];else{for(a in this.yaml_multi_constructors)if(e.tag.indexOf(0===a)){s=e.tag.slice(a.length),n=this.yaml_multi_constructors[a];break}null==n&&(null in this.yaml_multi_constructors?(s=e.tag,n=this.yaml_multi_constructors[null]):null in this.yaml_constructors?n=this.yaml_constructors[null]:e instanceof i.ScalarNode?n=this.construct_scalar:e instanceof i.SequenceNode?n=this.construct_sequence:e instanceof i.MappingNode&&(n=this.construct_mapping))}return r=n.call(this,null!=s?s:e,e),this.constructed_objects[e.unique_id]=r,this.constructing_nodes.pop(),r},e.prototype.construct_scalar=function(e){if(!(e instanceof i.ScalarNode))throw new t.ConstructorError(null,null,"expected a scalar node but found "+e.id,e.start_mark);return e.value},e.prototype.construct_sequence=function(e){var n,r,o,a,s;if(!(e instanceof i.SequenceNode))throw new t.ConstructorError(null,null,"expected a sequence node but found "+e.id,e.start_mark);for(a=e.value,s=[],r=0,o=a.length;r<o;r++)n=a[r],s.push(this.construct_object(n));return s},e.prototype.construct_mapping=function(e){var n,r,o,a,s,u,l,c,p;if(!(e instanceof i.MappingNode))throw new ConstructorError(null,null,"expected a mapping node but found "+e.id,e.start_mark);for(s={},u=e.value,n=0,a=u.length;n<a;n++){if(l=u[n],o=l[0],p=l[1],"object"==typeof(r=this.construct_object(o)))throw new t.ConstructorError("while constructing a mapping",e.start_mark,"found unhashable key",o.start_mark);c=this.construct_object(p),s[r]=c}return s},e.prototype.construct_pairs=function(e){var n,r,o,a,s,u,l,c,p;if(!(e instanceof i.MappingNode))throw new t.ConstructorError(null,null,"expected a mapping node but found "+e.id,e.start_mark);for(s=[],u=e.value,n=0,a=u.length;n<a;n++)l=u[n],o=l[0],p=l[1],r=this.construct_object(o),c=this.construct_object(p),s.push([r,c]);return s},e}(),this.Constructor=function(n){function r(){return r.__super__.constructor.apply(this,arguments)}var o,s,l;return a(r,n),o={on:!0,off:!1,true:!0,false:!1,yes:!0,no:!1},l=/^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[\x20\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\.([0-9]*))?(?:[\x20\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$/,s={year:1,month:2,day:3,hour:4,minute:5,second:6,fraction:7,tz:8,tz_sign:9,tz_hour:10,tz_minute:11},r.prototype.construct_scalar=function(e){var t,n,o,a,s,u;if(e instanceof i.MappingNode)for(a=e.value,t=0,o=a.length;t<o;t++)if(s=a[t],n=s[0],u=s[1],"tag:yaml.org,2002:value"===n.tag)return this.construct_scalar(u);return r.__super__.construct_scalar.call(this,e)},r.prototype.flatten_mapping=function(e){var n,r,o,a,s,u,l,c,p,f,h,d,m;for(l=[],r=0;r<e.value.length;)if(c=e.value[r],a=c[0],m=c[1],"tag:yaml.org,2002:merge"===a.tag)if(e.value.splice(r,1),m instanceof i.MappingNode)this.flatten_mapping(m),l=l.concat(m.value);else{if(!(m instanceof i.SequenceNode))throw new t.ConstructorError("while constructing a mapping",e.start_mark,"expected a mapping or list of mappings for merging but found "+m.id,m.start_mark);for(f=[],p=m.value,n=0,s=p.length;n<s;n++){if(!((h=p[n])instanceof i.MappingNode))throw new t.ConstructorError("while constructing a mapping",e.start_mark,"expected a mapping for merging, but found "+h.id,h.start_mark);this.flatten_mapping(h),f.push(h.value)}for(f.reverse(),o=0,u=f.length;o<u;o++)d=f[o],l=l.concat(d)}else"tag:yaml.org,2002:value"===a.tag?(a.tag="tag:yaml.org,2002:str",r++):r++;if(l.length)return e.value=l.concat(e.value)},r.prototype.construct_mapping=function(e){return e instanceof i.MappingNode&&this.flatten_mapping(e),r.__super__.construct_mapping.call(this,e)},r.prototype.construct_yaml_null=function(e){return this.construct_scalar(e),null},r.prototype.construct_yaml_bool=function(e){var t;return t=this.construct_scalar(e),o[t.toLowerCase()]},r.prototype.construct_yaml_int=function(e){var t,n,r,i,o,a,s,l,c;if(c=this.construct_scalar(e),c=c.replace(/_/g,""),l="-"===c[0]?-1:1,s=c[0],u.call("+-",s)>=0&&(c=c.slice(1)),"0"===c)return 0;if(0===c.indexOf("0b"))return l*parseInt(c.slice(2),2);if(0===c.indexOf("0x"))return l*parseInt(c.slice(2),16);if(0===c.indexOf("0o"))return l*parseInt(c.slice(2),8);if("0"===c[0])return l*parseInt(c,8);if(u.call(c,":")>=0){for(r=function(){var e,t,n,r;for(n=c.split(/:/g),r=[],e=0,t=n.length;e<t;e++)a=n[e],r.push(parseInt(a));return r}(),r.reverse(),t=1,c=0,i=0,o=r.length;i<o;i++)n=r[i],c+=n*t,t*=60;return l*c}return l*parseInt(c)},r.prototype.construct_yaml_float=function(e){var t,n,r,i,o,a,s,l,c;if(c=this.construct_scalar(e),c=c.replace(/_/g,"").toLowerCase(),l="-"===c[0]?-1:1,s=c[0],u.call("+-",s)>=0&&(c=c.slice(1)),".inf"===c)return Infinity*l;if(".nan"===c)return NaN;if(u.call(c,":")>=0){for(r=function(){var e,t,n,r;for(n=c.split(/:/g),r=[],e=0,t=n.length;e<t;e++)a=n[e],r.push(parseFloat(a));return r}(),r.reverse(),t=1,c=0,i=0,o=r.length;i<o;i++)n=r[i],c+=n*t,t*=60;return l*c}return l*parseFloat(c)},r.prototype.construct_yaml_binary=function(n){var r,i;i=this.construct_scalar(n);try{return"undefined"!=typeof window&&null!==window?atob(i):new e(i,"base64").toString("ascii")}catch(e){throw r=e,new t.ConstructorError(null,null,"failed to decode base64 data: "+r,n.start_mark)}},r.prototype.construct_yaml_timestamp=function(e){var t,n,r,i,o,a,u,c,p,f,h,d,m,v,g;this.construct_scalar(e),a=e.value.match(l),v={};for(o in s)i=s[o],v[o]=a[i];if(g=parseInt(v.year),p=parseInt(v.month)-1,t=parseInt(v.day),!v.hour)return new Date(Date.UTC(g,p,t));if(r=parseInt(v.hour),c=parseInt(v.minute),f=parseInt(v.second),u=0,v.fraction){for(n=v.fraction.slice(0,6);n.length<6;)n+="0";n=parseInt(n),u=Math.round(n/1e3)}return v.tz_sign&&(m="-"===v.tz_sign?1:-1,(h=parseInt(v.tz_hour))&&(r+=m*h),(d=parseInt(v.tz_minute))&&(c+=m*d)),new Date(Date.UTC(g,p,t,r,c,f,u))},r.prototype.construct_yaml_pair_list=function(e,n){var r;if(r=[],!(n instanceof i.SequenceNode))throw new t.ConstructorError("while constructing "+e,n.start_mark,"expected a sequence but found "+n.id,n.start_mark);return this.defer(function(o){return function(){var a,s,u,l,c,p,f,h,d,m;for(c=n.value,f=[],a=0,l=c.length;a<l;a++){if(!((h=c[a])instanceof i.MappingNode))throw new t.ConstructorError("while constructing "+e,n.start_mark,"expected a mapping of length 1 but found "+h.id,h.start_mark);if(1!==h.value.length)throw new t.ConstructorError("while constructing "+e,n.start_mark,"expected a mapping of length 1 but found "+h.id,h.start_mark);p=h.value[0],u=p[0],m=p[1],s=o.construct_object(u),d=o.construct_object(m),f.push(r.push([s,d]))}return f}}(this)),r},r.prototype.construct_yaml_omap=function(e){return this.construct_yaml_pair_list("an ordered map",e)},r.prototype.construct_yaml_pairs=function(e){return this.construct_yaml_pair_list("pairs",e)},r.prototype.construct_yaml_set=function(e){var t;return t=[],this.defer(function(n){return function(){var r,i;i=[];for(r in n.construct_mapping(e))i.push(t.push(r));return i}}(this)),t},r.prototype.construct_yaml_str=function(e){return this.construct_scalar(e)},r.prototype.construct_yaml_seq=function(e){var t;return t=[],this.defer(function(n){return function(){var r,i,o,a,s;for(a=n.construct_sequence(e),s=[],r=0,o=a.length;r<o;r++)i=a[r],s.push(t.push(i));return s}}(this)),t},r.prototype.construct_yaml_map=function(e){var t;return t={},this.defer(function(n){return function(){var r,i,o,a;i=n.construct_mapping(e),o=[];for(r in i)a=i[r],o.push(t[r]=a);return o}}(this)),t},r.prototype.construct_yaml_object=function(e,t){var n;return n=new t,this.defer(function(t){return function(){var r,i,o,a;i=t.construct_mapping(e,!0),o=[];for(r in i)a=i[r],o.push(n[r]=a);return o}}(this)),n},r.prototype.construct_undefined=function(e){throw new t.ConstructorError(null,null,"could not determine a constructor for the tag "+e.tag,e.start_mark)},r}(this.BaseConstructor),this.Constructor.add_constructor("tag:yaml.org,2002:null",this.Constructor.prototype.construct_yaml_null),this.Constructor.add_constructor("tag:yaml.org,2002:bool",this.Constructor.prototype.construct_yaml_bool),this.Constructor.add_constructor("tag:yaml.org,2002:int",this.Constructor.prototype.construct_yaml_int),this.Constructor.add_constructor("tag:yaml.org,2002:float",this.Constructor.prototype.construct_yaml_float),this.Constructor.add_constructor("tag:yaml.org,2002:binary",this.Constructor.prototype.construct_yaml_binary),this.Constructor.add_constructor("tag:yaml.org,2002:timestamp",this.Constructor.prototype.construct_yaml_timestamp),this.Constructor.add_constructor("tag:yaml.org,2002:omap",this.Constructor.prototype.construct_yaml_omap),this.Constructor.add_constructor("tag:yaml.org,2002:pairs",this.Constructor.prototype.construct_yaml_pairs),this.Constructor.add_constructor("tag:yaml.org,2002:set",this.Constructor.prototype.construct_yaml_set),this.Constructor.add_constructor("tag:yaml.org,2002:str",this.Constructor.prototype.construct_yaml_str),this.Constructor.add_constructor("tag:yaml.org,2002:seq",this.Constructor.prototype.construct_yaml_seq),this.Constructor.add_constructor("tag:yaml.org,2002:map",this.Constructor.prototype.construct_yaml_map),this.Constructor.add_constructor(null,this.Constructor.prototype.construct_undefined)}).call(this)}).call(t,n(40).Buffer)},function(e,t,n){(function(){var e,r,i,o=function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},a={}.hasOwnProperty,s=[].slice;r=n(127),e=n(45).MarkedYAMLError,i=n(267),this.ParserError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t}(e),this.Parser=function(){function e(){this.current_event=null,this.yaml_version=null,this.tag_handles={},this.states=[],this.marks=[],this.state="parse_stream_start"}var n;return n={"!":"!","!!":"tag:yaml.org,2002:"},e.prototype.dispose=function(){return this.states=[],this.state=null},e.prototype.check_event=function(){var e,t,n,r;if(t=1<=arguments.length?s.call(arguments,0):[],null===this.current_event&&null!=this.state&&(this.current_event=this[this.state]()),null!==this.current_event){if(0===t.length)return!0;for(n=0,r=t.length;n<r;n++)if(e=t[n],this.current_event instanceof e)return!0}return!1},e.prototype.peek_event=function(){return null===this.current_event&&null!=this.state&&(this.current_event=this[this.state]()),this.current_event},e.prototype.get_event=function(){var e;return null===this.current_event&&null!=this.state&&(this.current_event=this[this.state]()),e=this.current_event,this.current_event=null,e},e.prototype.parse_stream_start=function(){var e,t;return t=this.get_token(),e=new r.StreamStartEvent(t.start_mark,t.end_mark),this.state="parse_implicit_document_start",e},e.prototype.parse_implicit_document_start=function(){var e,t,o,a;return this.check_token(i.DirectiveToken,i.DocumentStartToken,i.StreamEndToken)?this.parse_document_start():(this.tag_handles=n,a=this.peek_token(),o=e=a.start_mark,t=new r.DocumentStartEvent(o,e,!1),this.states.push("parse_document_end"),this.state="parse_block_node",t)},e.prototype.parse_document_start=function(){for(var e,n,o,a,s,u,l;this.check_token(i.DocumentEndToken);)this.get_token();if(this.check_token(i.StreamEndToken)){if(u=this.get_token(),n=new r.StreamEndEvent(u.start_mark,u.end_mark),0!==this.states.length)throw new Error("assertion error, states should be empty");if(0!==this.marks.length)throw new Error("assertion error, marks should be empty");this.state=null}else{if(a=this.peek_token().start_mark,o=this.process_directives(),l=o[0],s=o[1],!this.check_token(i.DocumentStartToken))throw new t.ParserError("expected '<document start>', but found "+this.peek_token().id,this.peek_token().start_mark);u=this.get_token(),e=u.end_mark,n=new r.DocumentStartEvent(a,e,!0,l,s),this.states.push("parse_document_end"),this.state="parse_document_content"}return n},e.prototype.parse_document_end=function(){var e,t,n,o,a;return a=this.peek_token(),o=e=a.start_mark,n=!1,this.check_token(i.DocumentEndToken)&&(a=this.get_token(),e=a.end_mark,n=!0),t=new r.DocumentEndEvent(o,e,n),this.state="parse_document_start",t},e.prototype.parse_document_content=function(){var e;return this.check_token(i.DirectiveToken,i.DocumentStartToken,i.DocumentEndToken,i.StreamEndToken)?(e=this.process_empty_scalar(this.peek_token().start_mark),this.state=this.states.pop(),e):this.parse_block_node()},e.prototype.process_directives=function(){var e,r,o,s,u,l,c,p,f;for(this.yaml_version=null,this.tag_handles={};this.check_token(i.DirectiveToken);)if(p=this.get_token(),"YAML"===p.name){if(null!==this.yaml_version)throw new t.ParserError(null,null,"found duplicate YAML directive",p.start_mark);if(s=p.value,r=s[0],s[1],1!==r)throw new t.ParserError(null,null,"found incompatible YAML document (version 1.* is required)",p.start_mark);this.yaml_version=p.value}else if("TAG"===p.name){if(u=p.value,e=u[0],o=u[1],e in this.tag_handles)throw new t.ParserError(null,null,"duplicate tag handle "+e,p.start_mark);this.tag_handles[e]=o}c=null,l=this.tag_handles;for(e in l)a.call(l,e)&&(o=l[e],null==c&&(c={}),c[e]=o);f=[this.yaml_version,c];for(e in n)a.call(n,e)&&((o=n[e])in this.tag_handles||(this.tag_handles[e]=o));return f},e.prototype.parse_block_node=function(){return this.parse_node(!0)},e.prototype.parse_flow_node=function(){return this.parse_node()},e.prototype.parse_block_node_or_indentless_sequence=function(){return this.parse_node(!0,!0)},e.prototype.parse_node=function(e,n){var o,a,s,u,l,c,p,f,h,d,m;if(null==e&&(e=!1),null==n&&(n=!1),this.check_token(i.AliasToken))m=this.get_token(),s=new r.AliasEvent(m.value,m.start_mark,m.end_mark),this.state=this.states.pop();else{if(o=null,h=null,p=a=d=null,this.check_token(i.AnchorToken)?(m=this.get_token(),p=m.start_mark,a=m.end_mark,o=m.value,this.check_token(i.TagToken)&&(m=this.get_token(),d=m.start_mark,a=m.end_mark,h=m.value)):this.check_token(i.TagToken)&&(m=this.get_token(),p=d=m.start_mark,a=m.end_mark,h=m.value,this.check_token(i.AnchorToken)&&(m=this.get_token(),a=m.end_mark,o=m.value)),null!==h)if(u=h[0],f=h[1],null!==u){if(!(u in this.tag_handles))throw new t.ParserError("while parsing a node",p,"found undefined tag handle "+u,d);h=this.tag_handles[u]+f}else h=f;if(null===p&&(p=a=this.peek_token().start_mark),s=null,l=null===h||"!"===h,n&&this.check_token(i.BlockEntryToken))a=this.peek_token().end_mark,s=new r.SequenceStartEvent(o,h,l,p,a),this.state="parse_indentless_sequence_entry";else if(this.check_token(i.ScalarToken))m=this.get_token(),a=m.end_mark,l=m.plain&&null===h||"!"===h?[!0,!1]:null===h?[!1,!0]:[!1,!1],s=new r.ScalarEvent(o,h,l,m.value,p,a,m.style),this.state=this.states.pop();else if(this.check_token(i.FlowSequenceStartToken))a=this.peek_token().end_mark,s=new r.SequenceStartEvent(o,h,l,p,a,!0),this.state="parse_flow_sequence_first_entry";else if(this.check_token(i.FlowMappingStartToken))a=this.peek_token().end_mark,s=new r.MappingStartEvent(o,h,l,p,a,!0),this.state="parse_flow_mapping_first_key";else if(e&&this.check_token(i.BlockSequenceStartToken))a=this.peek_token().end_mark,s=new r.SequenceStartEvent(o,h,l,p,a,!1),this.state="parse_block_sequence_first_entry";else if(e&&this.check_token(i.BlockMappingStartToken))a=this.peek_token().end_mark,s=new r.MappingStartEvent(o,h,l,p,a,!1),this.state="parse_block_mapping_first_key";else{if(null===o&&null===h)throw c=e?"block":"flow",m=this.peek_token(),new t.ParserError("while parsing a "+c+" node",p,"expected the node content, but found "+m.id,m.start_mark);s=new r.ScalarEvent(o,h,[l,!1],"",p,a),this.state=this.states.pop()}}return s},e.prototype.parse_block_sequence_first_entry=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_block_sequence_entry()},e.prototype.parse_block_sequence_entry=function(){var e,n;if(this.check_token(i.BlockEntryToken))return n=this.get_token(),this.check_token(i.BlockEntryToken,i.BlockEndToken)?(this.state="parse_block_sequence_entry",this.process_empty_scalar(n.end_mark)):(this.states.push("parse_block_sequence_entry"),this.parse_block_node());if(!this.check_token(i.BlockEndToken))throw n=this.peek_token(),new t.ParserError("while parsing a block collection",this.marks.slice(-1)[0],"expected <block end>, but found "+n.id,n.start_mark);return n=this.get_token(),e=new r.SequenceEndEvent(n.start_mark,n.end_mark),this.state=this.states.pop(),this.marks.pop(),e},e.prototype.parse_indentless_sequence_entry=function(){var e,t;return this.check_token(i.BlockEntryToken)?(t=this.get_token(),this.check_token(i.BlockEntryToken,i.KeyToken,i.ValueToken,i.BlockEndToken)?(this.state="parse_indentless_sequence_entry",this.process_empty_scalar(t.end_mark)):(this.states.push("parse_indentless_sequence_entry"),this.parse_block_node())):(t=this.peek_token(),e=new r.SequenceEndEvent(t.start_mark,t.start_mark),this.state=this.states.pop(),e)},e.prototype.parse_block_mapping_first_key=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_block_mapping_key()},e.prototype.parse_block_mapping_key=function(){var e,n;if(this.check_token(i.KeyToken))return n=this.get_token(),this.check_token(i.KeyToken,i.ValueToken,i.BlockEndToken)?(this.state="parse_block_mapping_value",this.process_empty_scalar(n.end_mark)):(this.states.push("parse_block_mapping_value"),this.parse_block_node_or_indentless_sequence());if(!this.check_token(i.BlockEndToken))throw n=this.peek_token(),new t.ParserError("while parsing a block mapping",this.marks.slice(-1)[0],"expected <block end>, but found "+n.id,n.start_mark);return n=this.get_token(),e=new r.MappingEndEvent(n.start_mark,n.end_mark),this.state=this.states.pop(),this.marks.pop(),e},e.prototype.parse_block_mapping_value=function(){var e;return this.check_token(i.ValueToken)?(e=this.get_token(),this.check_token(i.KeyToken,i.ValueToken,i.BlockEndToken)?(this.state="parse_block_mapping_key",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_block_mapping_key"),this.parse_block_node_or_indentless_sequence())):(this.state="parse_block_mapping_key",e=this.peek_token(),this.process_empty_scalar(e.start_mark))},e.prototype.parse_flow_sequence_first_entry=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_flow_sequence_entry(!0)},e.prototype.parse_flow_sequence_entry=function(e){var n,o;if(null==e&&(e=!1),!this.check_token(i.FlowSequenceEndToken)){if(!e){if(!this.check_token(i.FlowEntryToken))throw o=this.peek_token(),new t.ParserError("while parsing a flow sequence",this.marks.slice(-1)[0],"expected ',' or ']', but got "+o.id,o.start_mark);this.get_token()}if(this.check_token(i.KeyToken))return o=this.peek_token(),n=new r.MappingStartEvent(null,null,!0,o.start_mark,o.end_mark,!0),this.state="parse_flow_sequence_entry_mapping_key",n;if(!this.check_token(i.FlowSequenceEndToken))return this.states.push("parse_flow_sequence_entry"),this.parse_flow_node()}return o=this.get_token(),n=new r.SequenceEndEvent(o.start_mark,o.end_mark),this.state=this.states.pop(),this.marks.pop(),n},e.prototype.parse_flow_sequence_entry_mapping_key=function(){var e;return e=this.get_token(),this.check_token(i.ValueToken,i.FlowEntryToken,i.FlowSequenceEndToken)?(this.state="parse_flow_sequence_entry_mapping_value",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_flow_sequence_entry_mapping_value"),this.parse_flow_node())},e.prototype.parse_flow_sequence_entry_mapping_value=function(){var e;return this.check_token(i.ValueToken)?(e=this.get_token(),this.check_token(i.FlowEntryToken,i.FlowSequenceEndToken)?(this.state="parse_flow_sequence_entry_mapping_end",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_flow_sequence_entry_mapping_end"),this.parse_flow_node())):(this.state="parse_flow_sequence_entry_mapping_end",e=this.peek_token(),this.process_empty_scalar(e.start_mark))},e.prototype.parse_flow_sequence_entry_mapping_end=function(){var e;return this.state="parse_flow_sequence_entry",e=this.peek_token(),new r.MappingEndEvent(e.start_mark,e.start_mark)},e.prototype.parse_flow_mapping_first_key=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_flow_mapping_key(!0)},e.prototype.parse_flow_mapping_key=function(e){var n,o;if(null==e&&(e=!1),!this.check_token(i.FlowMappingEndToken)){if(!e){if(!this.check_token(i.FlowEntryToken))throw o=this.peek_token(),new t.ParserError("while parsing a flow mapping",this.marks.slice(-1)[0],"expected ',' or '}', but got "+o.id,o.start_mark);this.get_token()}if(this.check_token(i.KeyToken))return o=this.get_token(),this.check_token(i.ValueToken,i.FlowEntryToken,i.FlowMappingEndToken)?(this.state="parse_flow_mapping_value",this.process_empty_scalar(o.end_mark)):(this.states.push("parse_flow_mapping_value"),this.parse_flow_node());if(!this.check_token(i.FlowMappingEndToken))return this.states.push("parse_flow_mapping_empty_value"),this.parse_flow_node()}return o=this.get_token(),n=new r.MappingEndEvent(o.start_mark,o.end_mark),this.state=this.states.pop(),this.marks.pop(),n},e.prototype.parse_flow_mapping_value=function(){var e;return this.check_token(i.ValueToken)?(e=this.get_token(),this.check_token(i.FlowEntryToken,i.FlowMappingEndToken)?(this.state="parse_flow_mapping_key",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_flow_mapping_key"),this.parse_flow_node())):(this.state="parse_flow_mapping_key",e=this.peek_token(),this.process_empty_scalar(e.start_mark))},e.prototype.parse_flow_mapping_empty_value=function(){return this.state="parse_flow_mapping_key",this.process_empty_scalar(this.peek_token().start_mark)},e.prototype.process_empty_scalar=function(e){return new r.ScalarEvent(null,null,[!0,!1],"",e,e)},e}()}).call(this)},function(e,t,n){(function(){var e,r,i,o=function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},a={}.hasOwnProperty,s=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};i=n(45),e=i.Mark,r=i.YAMLError,this.ReaderError=function(e){function t(e,n,r){this.position=e,this.character=n,this.reason=r,t.__super__.constructor.call(this)}return o(t,e),t.prototype.toString=function(){return"unacceptable character #"+this.character.charCodeAt(0).toString(16)+": "+this.reason+"\n position "+this.position},t}(r),this.Reader=function(){function n(e){this.string=e,this.line=0,this.column=0,this.index=0,this.check_printable(),this.string+="\0"}var r;return r=/[^\x09\x0A\x0D\x20-\x7E\x85\xA0-\uFFFD]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,n.prototype.peek=function(e){return null==e&&(e=0),this.string[this.index+e]},n.prototype.prefix=function(e){return null==e&&(e=1),this.string.slice(this.index,this.index+e)},n.prototype.forward=function(e){var t,n;for(null==e&&(e=1),n=[];e;)t=this.string[this.index],this.index++,s.call("\n…₂\u2029",t)>=0||"\r"===t&&"\n"!==this.string[this.index]?(this.line++,this.column=0):this.column++,n.push(e--);return n},n.prototype.get_mark=function(){return new e(this.line,this.column,this.string,this.index)},n.prototype.check_printable=function(){var e,n,i;if(n=r.exec(this.string))throw e=n[0],i=this.string.length-this.index+n.index,new t.ReaderError(i,e,"special characters are not allowed")},n}()}).call(this)},function(e,t,n){(function(){var e,r,i,o,a=function(e,t){function n(){this.constructor=e}for(var r in t)s.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},s={}.hasOwnProperty,u=[].slice,l=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};e=n(45).MarkedYAMLError,i=n(267),o=n(61),this.ScannerError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return a(t,e),t}(e),r=function(){function e(e,t,n,r,i,o){this.token_number=e,this.required=t,this.index=n,this.line=r,this.column=i,this.mark=o}return e}(),this.Scanner=function(){function e(){this.done=!1,this.flow_level=0,this.tokens=[],this.fetch_stream_start(),this.tokens_taken=0,this.indent=-1,this.indents=[],this.allow_simple_key=!0,this.possible_simple_keys={}}var n,a,c,p,f;return n="\r\n…\u2028\u2029",c="\t ",a="0123456789",f={0:"\0",a:"",b:"\b",t:"\t","\t":"\t",n:"\n",v:"\v",f:"\f",r:"\r",e:""," ":" ",'"':'"',"\\":"\\",N:"…",_:" ",L:"\u2028",P:"\u2029"},p={x:2,u:4,U:8},e.prototype.check_token=function(){var e,t,n,r;for(t=1<=arguments.length?u.call(arguments,0):[];this.need_more_tokens();)this.fetch_more_tokens();if(0!==this.tokens.length){if(0===t.length)return!0;for(n=0,r=t.length;n<r;n++)if(e=t[n],this.tokens[0]instanceof e)return!0}return!1},e.prototype.peek_token=function(){for(;this.need_more_tokens();)this.fetch_more_tokens();if(0!==this.tokens.length)return this.tokens[0]},e.prototype.get_token=function(){for(;this.need_more_tokens();)this.fetch_more_tokens();if(0!==this.tokens.length)return this.tokens_taken++,this.tokens.shift()},e.prototype.need_more_tokens=function(){return!this.done&&(0===this.tokens.length||(this.stale_possible_simple_keys(),this.next_possible_simple_key()===this.tokens_taken))},e.prototype.fetch_more_tokens=function(){var e;if(this.scan_to_next_token(),this.stale_possible_simple_keys(),this.unwind_indent(this.column),"\0"===(e=this.peek()))return this.fetch_stream_end();if("%"===e&&this.check_directive())return this.fetch_directive();if("-"===e&&this.check_document_start())return this.fetch_document_start();if("."===e&&this.check_document_end())return this.fetch_document_end();if("["===e)return this.fetch_flow_sequence_start();if("{"===e)return this.fetch_flow_mapping_start();if("]"===e)return this.fetch_flow_sequence_end();if("}"===e)return this.fetch_flow_mapping_end();if(","===e)return this.fetch_flow_entry();if("-"===e&&this.check_block_entry())return this.fetch_block_entry();if("?"===e&&this.check_key())return this.fetch_key();if(":"===e&&this.check_value())return this.fetch_value();if("*"===e)return this.fetch_alias();if("&"===e)return this.fetch_anchor();if("!"===e)return this.fetch_tag();if("|"===e&&0===this.flow_level)return this.fetch_literal();if(">"===e&&0===this.flow_level)return this.fetch_folded();if("'"===e)return this.fetch_single();if('"'===e)return this.fetch_double();if(this.check_plain())return this.fetch_plain();throw new t.ScannerError("while scanning for the next token",null,"found character "+e+" that cannot start any token",this.get_mark())},e.prototype.next_possible_simple_key=function(){var e,t,n,r;n=null,r=this.possible_simple_keys;for(t in r)s.call(r,t)&&(e=r[t],(null===n||e.token_number<n)&&(n=e.token_number));return n},e.prototype.stale_possible_simple_keys=function(){var e,n,r,i;r=this.possible_simple_keys,i=[];for(n in r)if(s.call(r,n)&&(e=r[n],!(e.line===this.line&&this.index-e.index<=1024))){if(e.required)throw new t.ScannerError("while scanning a simple key",e.mark,"could not find expected ':'",this.get_mark());i.push(delete this.possible_simple_keys[n])}return i},e.prototype.save_possible_simple_key=function(){var e,t;if((e=0===this.flow_level&&this.indent===this.column)&&!this.allow_simple_key)throw new Error("logic failure");if(this.allow_simple_key)return this.remove_possible_simple_key(),t=this.tokens_taken+this.tokens.length,this.possible_simple_keys[this.flow_level]=new r(t,e,this.index,this.line,this.column,this.get_mark())},e.prototype.remove_possible_simple_key=function(){var e;if(e=this.possible_simple_keys[this.flow_level]){if(e.required)throw new t.ScannerError("while scanning a simple key",e.mark,"could not find expected ':'",this.get_mark());return delete this.possible_simple_keys[this.flow_level]}},e.prototype.unwind_indent=function(e){var t,n;if(0===this.flow_level){for(n=[];this.indent>e;)t=this.get_mark(),this.indent=this.indents.pop(),n.push(this.tokens.push(new i.BlockEndToken(t,t)));return n}},e.prototype.add_indent=function(e){return e>this.indent&&(this.indents.push(this.indent),this.indent=e,!0)},e.prototype.fetch_stream_start=function(){var e;return e=this.get_mark(),this.tokens.push(new i.StreamStartToken(e,e,this.encoding))},e.prototype.fetch_stream_end=function(){var e;return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_possible_simple_key=!1,this.possible_simple_keys={},e=this.get_mark(),this.tokens.push(new i.StreamEndToken(e,e)),this.done=!0},e.prototype.fetch_directive=function(){return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_directive())},e.prototype.fetch_document_start=function(){return this.fetch_document_indicator(i.DocumentStartToken)},e.prototype.fetch_document_end=function(){return this.fetch_document_indicator(i.DocumentEndToken)},e.prototype.fetch_document_indicator=function(e){var t;return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_simple_key=!1,t=this.get_mark(),this.forward(3),this.tokens.push(new e(t,this.get_mark()))},e.prototype.fetch_flow_sequence_start=function(){return this.fetch_flow_collection_start(i.FlowSequenceStartToken)},e.prototype.fetch_flow_mapping_start=function(){return this.fetch_flow_collection_start(i.FlowMappingStartToken)},e.prototype.fetch_flow_collection_start=function(e){var t;return this.save_possible_simple_key(),this.flow_level++,this.allow_simple_key=!0,t=this.get_mark(),this.forward(),this.tokens.push(new e(t,this.get_mark()))},e.prototype.fetch_flow_sequence_end=function(){return this.fetch_flow_collection_end(i.FlowSequenceEndToken)},e.prototype.fetch_flow_mapping_end=function(){return this.fetch_flow_collection_end(i.FlowMappingEndToken)},e.prototype.fetch_flow_collection_end=function(e){var t;return this.remove_possible_simple_key(),this.flow_level--,this.allow_simple_key=!1,t=this.get_mark(),this.forward(),this.tokens.push(new e(t,this.get_mark()))},e.prototype.fetch_flow_entry=function(){var e;return this.allow_simple_key=!0,this.remove_possible_simple_key(),e=this.get_mark(),this.forward(),this.tokens.push(new i.FlowEntryToken(e,this.get_mark()))},e.prototype.fetch_block_entry=function(){var e,n;if(0===this.flow_level){if(!this.allow_simple_key)throw new t.ScannerError(null,null,"sequence entries are not allowed here",this.get_mark());this.add_indent(this.column)&&(e=this.get_mark(),this.tokens.push(new i.BlockSequenceStartToken(e,e)))}return this.allow_simple_key=!0,this.remove_possible_simple_key(),n=this.get_mark(),this.forward(),this.tokens.push(new i.BlockEntryToken(n,this.get_mark()))},e.prototype.fetch_key=function(){var e,n;if(0===this.flow_level){if(!this.allow_simple_key)throw new t.ScannerError(null,null,"mapping keys are not allowed here",this.get_mark());this.add_indent(this.column)&&(e=this.get_mark(),this.tokens.push(new i.BlockMappingStartToken(e,e)))}return this.allow_simple_key=!this.flow_level,this.remove_possible_simple_key(),n=this.get_mark(),this.forward(),this.tokens.push(new i.KeyToken(n,this.get_mark()))},e.prototype.fetch_value=function(){var e,n,r;if(e=this.possible_simple_keys[this.flow_level])delete this.possible_simple_keys[this.flow_level],this.tokens.splice(e.token_number-this.tokens_taken,0,new i.KeyToken(e.mark,e.mark)),0===this.flow_level&&this.add_indent(e.column)&&this.tokens.splice(e.token_number-this.tokens_taken,0,new i.BlockMappingStartToken(e.mark,e.mark)),this.allow_simple_key=!1;else{if(0===this.flow_level){if(!this.allow_simple_key)throw new t.ScannerError(null,null,"mapping values are not allowed here",this.get_mark());this.add_indent(this.column)&&(n=this.get_mark(),this.tokens.push(new i.BlockMappingStartToken(n,n)))}this.allow_simple_key=!this.flow_level,this.remove_possible_simple_key()}return r=this.get_mark(),this.forward(),this.tokens.push(new i.ValueToken(r,this.get_mark()))},e.prototype.fetch_alias=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_anchor(i.AliasToken))},e.prototype.fetch_anchor=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_anchor(i.AnchorToken))},e.prototype.fetch_tag=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_tag())},e.prototype.fetch_literal=function(){return this.fetch_block_scalar("|")},e.prototype.fetch_folded=function(){return this.fetch_block_scalar(">")},e.prototype.fetch_block_scalar=function(e){return this.allow_simple_key=!0,this.remove_possible_simple_key(),this.tokens.push(this.scan_block_scalar(e))},e.prototype.fetch_single=function(){return this.fetch_flow_scalar("'")},e.prototype.fetch_double=function(){return this.fetch_flow_scalar('"')},e.prototype.fetch_flow_scalar=function(e){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_flow_scalar(e))},e.prototype.fetch_plain=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_plain())},e.prototype.check_directive=function(){return 0===this.column},e.prototype.check_document_start=function(){var e;return 0===this.column&&"---"===this.prefix(3)&&(e=this.peek(3),l.call(n+c+"\0",e)>=0)},e.prototype.check_document_end=function(){var e;return 0===this.column&&"..."===this.prefix(3)&&(e=this.peek(3),l.call(n+c+"\0",e)>=0)},e.prototype.check_block_entry=function(){var e;return e=this.peek(1),l.call(n+c+"\0",e)>=0},e.prototype.check_key=function(){var e;return 0!==this.flow_level||(e=this.peek(1),l.call(n+c+"\0",e)>=0)},e.prototype.check_value=function(){var e;return 0!==this.flow_level||(e=this.peek(1),l.call(n+c+"\0",e)>=0)},e.prototype.check_plain=function(){var e,t;return e=this.peek(),l.call(n+c+"\0-?:,[]{}#&*!|>'\"%@`",e)<0||(t=this.peek(1),l.call(n+c+"\0",t)<0&&("-"===e||0===this.flow_level&&l.call("?:",e)>=0))},e.prototype.scan_to_next_token=function(){var e,t,r;for(0===this.index&&"\ufeff"===this.peek()&&this.forward(),e=!1,r=[];!e;){for(;" "===this.peek();)this.forward();if("#"===this.peek())for(;t=this.peek(),l.call(n+"\0",t)<0;)this.forward();this.scan_line_break()?0===this.flow_level?r.push(this.allow_simple_key=!0):r.push(void 0):r.push(e=!0)}return r},e.prototype.scan_directive=function(){var e,t,r,o,a;if(o=this.get_mark(),this.forward(),t=this.scan_directive_name(o),a=null,"YAML"===t)a=this.scan_yaml_directive_value(o),e=this.get_mark();else if("TAG"===t)a=this.scan_tag_directive_value(o),e=this.get_mark();else for(e=this.get_mark();r=this.peek(),l.call(n+"\0",r)<0;)this.forward();return this.scan_directive_ignored_line(o),new i.DirectiveToken(t,a,o,e)},e.prototype.scan_directive_name=function(e){var r,i,o;for(i=0,r=this.peek(i);"0"<=r&&r<="9"||"A"<=r&&r<="Z"||"a"<=r&&r<="z"||l.call("-_",r)>=0;)i++,r=this.peek(i);if(0===i)throw new t.ScannerError("while scanning a directive",e,"expected alphanumeric or numeric character but found "+r,this.get_mark());if(o=this.prefix(i),this.forward(i),r=this.peek(),l.call(n+"\0 ",r)<0)throw new t.ScannerError("while scanning a directive",e,"expected alphanumeric or numeric character but found "+r,this.get_mark());return o},e.prototype.scan_yaml_directive_value=function(e){for(var r,i,o;" "===this.peek();)this.forward();if(r=this.scan_yaml_directive_number(e),"."!==this.peek())throw new t.ScannerError("while scanning a directive",e,"expected a digit or '.' but found "+this.peek(),this.get_mark());if(this.forward(),i=this.scan_yaml_directive_number(e),o=this.peek(),l.call(n+"\0 ",o)<0)throw new t.ScannerError("while scanning a directive",e,"expected a digit or ' ' but found "+this.peek(),this.get_mark());return[r,i]},e.prototype.scan_yaml_directive_number=function(e){var n,r,i,o;if(!("0"<=(n=this.peek())&&n<="9"))throw new t.ScannerError("while scanning a directive",e,"expected a digit but found "+n,this.get_mark());for(r=0;"0"<=(i=this.peek(r))&&i<="9";)r++;return o=parseInt(this.prefix(r)),this.forward(r),o},e.prototype.scan_tag_directive_value=function(e){for(var t,n;" "===this.peek();)this.forward();for(t=this.scan_tag_directive_handle(e);" "===this.peek();)this.forward();return n=this.scan_tag_directive_prefix(e),[t,n]},e.prototype.scan_tag_directive_handle=function(e){var n,r;if(r=this.scan_tag_handle("directive",e)," "!==(n=this.peek()))throw new t.ScannerError("while scanning a directive",e,"expected ' ' but found "+n,this.get_mark());return r},e.prototype.scan_tag_directive_prefix=function(e){var r,i;if(i=this.scan_tag_uri("directive",e),r=this.peek(),l.call(n+"\0 ",r)<0)throw new t.ScannerError("while scanning a directive",e,"expected ' ' but found "+r,this.get_mark());return i},e.prototype.scan_directive_ignored_line=function(e){for(var r,i;" "===this.peek();)this.forward();if("#"===this.peek())for(;i=this.peek(),l.call(n+"\0",i)<0;)this.forward();if(r=this.peek(),l.call(n+"\0",r)<0)throw new t.ScannerError("while scanning a directive",e,"expected a comment or a line break but found "+r,this.get_mark());return this.scan_line_break()},e.prototype.scan_anchor=function(e){var r,i,o,a,s,u;for(s=this.get_mark(),i=this.peek(),a="*"===i?"alias":"anchor",this.forward(),o=0,r=this.peek(o);"0"<=r&&r<="9"||"A"<=r&&r<="Z"||"a"<=r&&r<="z"||l.call("-_",r)>=0;)o++,r=this.peek(o);if(0===o)throw new t.ScannerError("while scanning an "+a,s,"expected alphabetic or numeric character but found '"+r+"'",this.get_mark());if(u=this.prefix(o),this.forward(o),r=this.peek(),l.call(n+c+"\0?:,]}%@`",r)<0)throw new t.ScannerError("while scanning an "+a,s,"expected alphabetic or numeric character but found '"+r+"'",this.get_mark());return new e(u,s,this.get_mark())},e.prototype.scan_tag=function(){var e,r,o,a,s,u;if(a=this.get_mark(),"<"===(e=this.peek(1))){if(r=null,this.forward(2),s=this.scan_tag_uri("tag",a),">"!==this.peek())throw new t.ScannerError("while parsing a tag",a,"expected '>' but found "+this.peek(),this.get_mark());this.forward()}else if(l.call(n+c+"\0",e)>=0)r=null,s="!",this.forward();else{for(o=1,u=!1;l.call(n+"\0 ",e)<0;){if("!"===e){u=!0;break}o++,e=this.peek(o)}u?r=this.scan_tag_handle("tag",a):(r="!",this.forward()),s=this.scan_tag_uri("tag",a)}if(e=this.peek(),l.call(n+"\0 ",e)<0)throw new t.ScannerError("while scanning a tag",a,"expected ' ' but found "+e,this.get_mark());return new i.TagToken([r,s],a,this.get_mark())},e.prototype.scan_block_scalar=function(e){var t,r,a,s,u,c,p,f,h,d,m,v,g,y,_,b,x,w,k,E;for(u=">"===e,a=[],E=this.get_mark(),this.forward(),g=this.scan_block_scalar_indicators(E),r=g[0],c=g[1],this.scan_block_scalar_ignored_line(E),v=this.indent+1,v<1&&(v=1),null==c?(y=this.scan_block_scalar_indentation(),t=y[0],m=y[1],s=y[2],p=Math.max(v,m)):(p=v+c-1,_=this.scan_block_scalar_breaks(p),t=_[0],s=_[1]),d="";this.column===p&&"\0"!==this.peek();){for(a=a.concat(t),b=this.peek(),f=l.call(" \t",b)<0,h=0;x=this.peek(h),l.call(n+"\0",x)<0;)h++;if(a.push(this.prefix(h)),this.forward(h),d=this.scan_line_break(),w=this.scan_block_scalar_breaks(p),t=w[0],s=w[1],this.column!==p||"\0"===this.peek())break;u&&"\n"===d&&f&&(k=this.peek(),l.call(" \t",k)<0)?o.is_empty(t)&&a.push(" "):a.push(d)}return!1!==r&&a.push(d),!0===r&&(a=a.concat(t)),new i.ScalarToken(a.join(""),!1,E,s,e)},e.prototype.scan_block_scalar_indicators=function(e){var r,i,o;if(i=null,o=null,r=this.peek(),l.call("+-",r)>=0){if(i="+"===r,this.forward(),r=this.peek(),l.call(a,r)>=0){if(0===(o=parseInt(r)))throw new t.ScannerError("while scanning a block scalar",e,"expected indentation indicator in the range 1-9 but found 0",this.get_mark());this.forward()}}else if(l.call(a,r)>=0){if(0===(o=parseInt(r)))throw new t.ScannerError("while scanning a block scalar",e,"expected indentation indicator in the range 1-9 but found 0",this.get_mark());this.forward(),r=this.peek(),l.call("+-",r)>=0&&(i="+"===r,this.forward())}if(r=this.peek(),l.call(n+"\0 ",r)<0)throw new t.ScannerError("while scanning a block scalar",e,"expected chomping or indentation indicators, but found "+r,this.get_mark());return[i,o]},e.prototype.scan_block_scalar_ignored_line=function(e){for(var r,i;" "===this.peek();)this.forward();if("#"===this.peek())for(;i=this.peek(),l.call(n+"\0",i)<0;)this.forward();if(r=this.peek(),l.call(n+"\0",r)<0)throw new t.ScannerError("while scanning a block scalar",e,"expected a comment or a line break but found "+r,this.get_mark());return this.scan_line_break()},e.prototype.scan_block_scalar_indentation=function(){var e,t,r,i;for(e=[],r=0,t=this.get_mark();i=this.peek(),l.call(n+" ",i)>=0;)" "!==this.peek()?(e.push(this.scan_line_break()),t=this.get_mark()):(this.forward(),this.column>r&&(r=this.column));return[e,r,t]},e.prototype.scan_block_scalar_breaks=function(e){var t,r,i;for(t=[],r=this.get_mark();this.column<e&&" "===this.peek();)this.forward();for(;i=this.peek(),l.call(n,i)>=0;)for(t.push(this.scan_line_break()),r=this.get_mark();this.column<e&&" "===this.peek();)this.forward();return[t,r]},e.prototype.scan_flow_scalar=function(e){var t,n,r,o;for(n='"'===e,t=[],o=this.get_mark(),r=this.peek(),this.forward(),t=t.concat(this.scan_flow_scalar_non_spaces(n,o));this.peek()!==r;)t=t.concat(this.scan_flow_scalar_spaces(n,o)),t=t.concat(this.scan_flow_scalar_non_spaces(n,o));return this.forward(),new i.ScalarToken(t.join(""),!1,o,this.get_mark(),e)},e.prototype.scan_flow_scalar_non_spaces=function(e,r){var i,o,s,u,h,d,m,v,g;for(o=[];;){for(d=0;m=this.peek(d),l.call(n+c+"'\"\\\0",m)<0;)d++;if(0!==d&&(o.push(this.prefix(d)),this.forward(d)),i=this.peek(),e||"'"!==i||"'"!==this.peek(1))if(e&&"'"===i||!e&&l.call('"\\',i)>=0)o.push(i),this.forward();else{if(!e||"\\"!==i)return o;if(this.forward(),(i=this.peek())in f)o.push(f[i]),this.forward();else if(i in p){for(d=p[i],this.forward(),h=u=0,v=d;0<=v?u<v:u>v;h=0<=v?++u:--u)if(g=this.peek(h),l.call(a+"ABCDEFabcdef",g)<0)throw new t.ScannerError("while scanning a double-quoted scalar",r,"expected escape sequence of "+d+" hexadecimal numbers, but found "+this.peek(h),this.get_mark());s=parseInt(this.prefix(d),16),o.push(String.fromCharCode(s)),this.forward(d)}else{if(!(l.call(n,i)>=0))throw new t.ScannerError("while scanning a double-quoted scalar",r,"found unknown escape character "+i,this.get_mark());this.scan_line_break(),o=o.concat(this.scan_flow_scalar_breaks(e,r))}}else o.push("'"),this.forward(2)}},e.prototype.scan_flow_scalar_spaces=function(e,r){var i,o,a,s,u,p,f;for(a=[],s=0;p=this.peek(s),l.call(c,p)>=0;)s++;if(f=this.prefix(s),this.forward(s),"\0"===(o=this.peek()))throw new t.ScannerError("while scanning a quoted scalar",r,"found unexpected end of stream",this.get_mark());return l.call(n,o)>=0?(u=this.scan_line_break(),i=this.scan_flow_scalar_breaks(e,r),"\n"!==u?a.push(u):0===i.length&&a.push(" "),a=a.concat(i)):a.push(f),a},e.prototype.scan_flow_scalar_breaks=function(e,r){var i,o,a,s,u;for(i=[];;){if("---"===(o=this.prefix(3))||"..."===o&&(a=this.peek(3),l.call(n+c+"\0",a)>=0))throw new t.ScannerError("while scanning a quoted scalar",r,"found unexpected document separator",this.get_mark());for(;s=this.peek(),l.call(c,s)>=0;)this.forward();if(u=this.peek(),!(l.call(n,u)>=0))return i;i.push(this.scan_line_break())}},e.prototype.scan_plain=function(){var e,r,o,a,s,u,p,f,h;for(r=[],h=o=this.get_mark(),a=this.indent+1,f=[];;){if(s=0,"#"===this.peek())break;for(;;){if(e=this.peek(s),l.call(n+c+"\0",e)>=0||0===this.flow_level&&":"===e&&(u=this.peek(s+1),l.call(n+c+"\0",u)>=0)||0!==this.flow_level&&l.call(",:?[]{}",e)>=0)break;s++}if(0!==this.flow_level&&":"===e&&(p=this.peek(s+1),l.call(n+c+"\0,[]{}",p)<0))throw this.forward(s),new t.ScannerError("while scanning a plain scalar",h,"found unexpected ':'",this.get_mark(),"Please check http://pyyaml.org/wiki/YAMLColonInFlowContext");if(0===s)break;if(this.allow_simple_key=!1,r=r.concat(f),r.push(this.prefix(s)),this.forward(s),o=this.get_mark(),null==(f=this.scan_plain_spaces(a,h))||0===f.length||"#"===this.peek()||0===this.flow_level&&this.column<a)break}return new i.ScalarToken(r.join(""),!0,h,o)},e.prototype.scan_plain_spaces=function(e,t){var r,i,o,a,s,u,p,f,h,d,m;for(o=[],a=0;p=this.peek(a),l.call(" ",p)>=0;)a++;if(m=this.prefix(a),this.forward(a),i=this.peek(),l.call(n,i)>=0){if(s=this.scan_line_break(),this.allow_simple_key=!0,"---"===(u=this.prefix(3))||"..."===u&&(f=this.peek(3),l.call(n+c+"\0",f)>=0))return;for(r=[];d=this.peek(),l.call(n+" ",d)>=0;)if(" "===this.peek())this.forward();else if(r.push(this.scan_line_break()),"---"===(u=this.prefix(3))||"..."===u&&(h=this.peek(3),l.call(n+c+"\0",h)>=0))return;"\n"!==s?o.push(s):0===r.length&&o.push(" "),o=o.concat(r)}else m&&o.push(m);return o},e.prototype.scan_tag_handle=function(e,n){var r,i,o;if("!"!==(r=this.peek()))throw new t.ScannerError("while scanning a "+e,n,"expected '!' but found "+r,this.get_mark());if(i=1," "!==(r=this.peek(i))){for(;"0"<=r&&r<="9"||"A"<=r&&r<="Z"||"a"<=r&&r<="z"||l.call("-_",r)>=0;)i++,r=this.peek(i);if("!"!==r)throw this.forward(i),new t.ScannerError("while scanning a "+e,n,"expected '!' but found "+r,this.get_mark());i++}return o=this.prefix(i),this.forward(i),o},e.prototype.scan_tag_uri=function(e,n){var r,i,o;for(i=[],o=0,r=this.peek(o);"0"<=r&&r<="9"||"A"<=r&&r<="Z"||"a"<=r&&r<="z"||l.call("-;/?:@&=+$,_.!~*'()[]%",r)>=0;)"%"===r?(i.push(this.prefix(o)),this.forward(o),o=0,i.push(this.scan_uri_escapes(e,n))):o++,r=this.peek(o);if(0!==o&&(i.push(this.prefix(o)),this.forward(o),o=0),0===i.length)throw new t.ScannerError("while parsing a "+e,n,"expected URI but found "+r,this.get_mark());return i.join("")},e.prototype.scan_uri_escapes=function(e,n){var r,i,o;for(r=[],this.get_mark();"%"===this.peek();){for(this.forward(),o=i=0;i<=2;o=++i)throw new t.ScannerError("while scanning a "+e,n,"expected URI escape sequence of 2 hexadecimal numbers but found "+this.peek(o),this.get_mark());r.push(String.fromCharCode(parseInt(this.prefix(2),16))),this.forward(2)}return r.join("")},e.prototype.scan_line_break=function(){var e;return e=this.peek(),l.call("\r\n…",e)>=0?("\r\n"===this.prefix(2)?this.forward(2):this.forward(),"\n"):l.call("\u2028\u2029",e)>=0?(this.forward(),e):""},e}()}).call(this)},function(e,t){},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(35),o=r(i),a=n(47),s=r(a),u=n(48),l=r(u),c=n(203),p=r(c),f=n(562),h=r(f),d=n(46),m=r(d),v=n(560),g=r(v),y=n(271),_=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(y),b=n(9),x={PACKAGE_VERSION:"3.10.0",GIT_COMMIT:"g2e05bb99",GIT_DIRTY:!0,HOSTNAME:"banjo",BUILD_TIME:"Sat, 10 Feb 2018 04:32:34 GMT"},w=x.GIT_DIRTY,k=x.GIT_COMMIT,E=x.PACKAGE_VERSION,S=x.HOSTNAME,C=x.BUILD_TIME;e.exports=function(e){m.default.versions=m.default.versions||{},m.default.versions.swaggerUi={version:E,gitRevision:k,gitDirty:w,buildTimestamp:C,machine:S};var t={dom_id:null,domNode:null,spec:{},url:"",urls:null,layout:"BaseLayout",docExpansion:"list",maxDisplayedTags:null,filter:null,validatorUrl:"https://online.swagger.io/validator",configs:{},custom:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,requestInterceptor:function(e){return e},responseInterceptor:function(e){return e},showMutatedRequest:!0,defaultModelRendering:"example",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,supportedSubmitMethods:["get","put","post","delete","options","head","patch","trace"],presets:[g.default],plugins:[],initialState:{},fn:{},components:{}},n=(0,b.parseSearch)(),r=e.domNode;delete e.domNode;var i=(0,p.default)({},t,e,n),a={system:{configs:i.configs},plugins:i.presets,state:(0,p.default)({layout:{layout:i.layout,filter:i.filter},spec:{spec:"",url:i.url}},i.initialState)};if(i.initialState)for(var u in i.initialState)i.initialState.hasOwnProperty(u)&&void 0===i.initialState[u]&&delete a.state[u];var c=function(){return{fn:i.fn,components:i.components,state:i.state}},f=new h.default(a);f.register([i.plugins,c]);var d=f.getSystem(),v=function(e){if("object"!==(void 0===i?"undefined":(0,l.default)(i)))return d;var t=d.specSelectors.getLocalConfig?d.specSelectors.getLocalConfig():{},a=(0,p.default)({},t,i,e||{},n);if(r&&(a.domNode=r),f.setConfigs(a),null!==e&&(!n.url&&"object"===(0,l.default)(a.spec)&&(0,s.default)(a.spec).length?(d.specActions.updateUrl(""),d.specActions.updateLoadingStatus("success"),d.specActions.updateSpec((0,o.default)(a.spec))):d.specActions.download&&a.url&&(d.specActions.updateUrl(a.url),d.specActions.download(a.url))),a.domNode)d.render(a.domNode,"App");else if(a.dom_id){var u=document.querySelector(a.dom_id);d.render(u,"App")}else null===a.dom_id||null===a.domNode||console.error("Skipped rendering: no `dom_id` or `domNode` was specified");return d},y=n.config||i.configUrl;return!y||!d.specActions.getConfigByUrl||d.specActions.getConfigByUrl&&!d.specActions.getConfigByUrl(y,v)?v():d},e.exports.presets={apis:g.default},e.exports.plugins=_},function(e,t,n){"use strict";var r=n(46);void 0===function(e){return e&&e.__esModule?e:{default:e}}(r).default.Promise&&n(584),String.prototype.startsWith||n(583)},function(e,t,n){"use strict";function r(e){return u.indexOf(e[0])>-1}function i(e){var t,n,i=e.replace(a,"");return r(i)?i:(n=i.match(s))?(t=n[0],o.test(t)?"about:blank":i):"about:blank"}var o=/^(%20|\s)*(javascript|data)/im,a=/[^\x20-\x7E]/gim,s=/^([^:]+):/gm,u=[".","/"];e.exports={sanitizeUrl:i}},function(e,t,n){"use strict";(function(t){function n(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}function r(e){var t=new Set;return e.filter(function(e){return!t.has(e)&&(t.add(e),!0)})}function i(e){var t=[];return new Set(e).forEach(function(e){t.push(e)}),t}"Set"in t?"function"==typeof Set.prototype.forEach&&function(){var e=!1;return new Set([!0]).forEach(function(t){e=t}),!0===e}()?e.exports=i:e.exports=r:e.exports=n}).call(t,n(17))},function(e,t,n){var r,i;!function(n,o){r=[],void 0!==(i=function(){return n.Autolinker=o()}.apply(t,r))&&(e.exports=i)}(this,function(){/*! - * Autolinker.js - * 0.15.3 +var n=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},r=Object.prototype.hasOwnProperty;function o(e,t){return r.call(e,t)}function i(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);t=[];for(var r in e)o(e,r)&&t.push(r);return t}function a(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function s(e,t){var n;for(var r in e)if(o(e,r)){if(e[r]===t)return a(r)+"/";if("object"==typeof e[r]&&""!=(n=s(e[r],t)))return a(r)+"/"+n}return""}function u(e,t){var n=[e];for(var r in t){var o="object"==typeof t[r]?JSON.stringify(t[r],null,2):t[r];void 0!==o&&n.push(r+": "+o)}return n.join("\n")}t.hasOwnProperty=o,t._objectKeys=i,t._deepClone=function(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}},t.isInteger=function(e){for(var t,n=0,r=e.length;n<r;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0},t.escapePathComponent=a,t.unescapePathComponent=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},t._getPathRecursive=s,t.getPath=function(e,t){if(e===t)return"/";var n=s(e,t);if(""===n)throw new Error("Object not found in root");return"/"+n},t.hasUndefined=function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var n=0,r=t.length;n<r;n++)if(e(t[n]))return!0}else if("object"==typeof t){var o=i(t),a=o.length;for(n=0;n<a;n++)if(e(t[o[n]]))return!0}return!1};var c=function(e){function t(t,n,r,o,i){e.call(this,u(t,{name:n,index:r,operation:o,tree:i})),this.name=n,this.index=r,this.operation=o,this.tree=i,this.message=u(t,{name:n,index:r,operation:o,tree:i})}return n(t,e),t}(Error);t.PatchError=c},function(e,t,n){var r=n(63),o=n(211),i=n(100),a=n(158),s=n(954);e.exports=function(e,t){var n=1==e,u=2==e,c=3==e,l=4==e,p=6==e,f=5==e||p,h=t||s;return function(t,s,d){for(var m,v,g=i(t),y=o(g),b=r(s,d,3),_=a(y.length),w=0,x=n?h(t,_):u?h(t,0):void 0;_>w;w++)if((f||w in y)&&(v=b(m=y[w],w,g),e))if(n)x[w]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return w;case 2:x.push(m)}else if(l)return!1;return p?-1:c||l?l:x}}},function(e,t,n){"use strict";function r(e,t,n,r,o){this.src=e,this.env=r,this.options=n,this.parser=t,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}r.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},r.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},r.prototype.cacheSet=function(e,t){for(var n=this.cache.length;n<=e;n++)this.cache.push(0);this.cache[e]=t},r.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0},e.exports=r},function(e,t,n){var r=n(605)("toUpperCase");e.exports=r},function(e,t,n){var r=n(226),o="Expected a function";function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},function(e,t,n){var r=n(639)(n(676));e.exports=r},function(e,t,n){"use strict";n.r(t);var r=n(274),o=n(44),i=n(277);t.default=function(e){return{statePlugins:{err:{reducers:Object(r.default)(e),actions:o,selectors:i}}}}},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),i=n(16),a=n.n(i),s=n(44),u=n(1),c=n(96),l={line:0,level:"error",message:"Unknown error"};t.default=function(e){var t;return t={},o()(t,s.NEW_THROWN_ERR,function(t,n){var r=n.payload,o=a()(l,r,{type:"thrown"});return t.update("errors",function(e){return(e||Object(u.List)()).push(Object(u.fromJS)(o))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_THROWN_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return Object(u.fromJS)(a()(l,e,{type:"thrown"}))}),t.update("errors",function(e){return(e||Object(u.List)()).concat(Object(u.fromJS)(r))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_SPEC_ERR,function(t,n){var r=n.payload,o=Object(u.fromJS)(r);return o=o.set("type","spec"),t.update("errors",function(e){return(e||Object(u.List)()).push(Object(u.fromJS)(o)).sortBy(function(e){return e.get("line")})}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_SPEC_ERR_BATCH,function(t,n){var r=n.payload;return r=r.map(function(e){return Object(u.fromJS)(a()(l,e,{type:"spec"}))}),t.update("errors",function(e){return(e||Object(u.List)()).concat(Object(u.fromJS)(r))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.NEW_AUTH_ERR,function(t,n){var r=n.payload,o=Object(u.fromJS)(a()({},r));return o=o.set("type","auth"),t.update("errors",function(e){return(e||Object(u.List)()).push(Object(u.fromJS)(o))}).update("errors",function(t){return Object(c.default)(t,e.getSystem())})}),o()(t,s.CLEAR,function(e,t){var n=t.payload;if(!n||!e.get("errors"))return e;var r=e.get("errors").filter(function(e){return e.keySeq().every(function(t){var r=e.get(t),o=n[t];return!o||r!==o})});return e.merge({errors:r})}),o()(t,s.CLEAR_BY,function(e,t){var n=t.payload;if(!n||"function"!=typeof n)return e;var r=e.get("errors").filter(function(e){return n(e)});return e.merge({errors:r})}),t}},function(e,t,n){"use strict";function r(e){return e.map(function(e){var t=e.get("message").indexOf("is not of a type(s)");if(t>-1){var n=e.get("message").slice(t+"is not of a type(s)".length).split(",");return e.set("message",e.get("message").slice(0,t)+function(e){return e.reduce(function(e,t,n,r){return n===r.length-1&&r.length>1?e+"or "+t:r[n+1]&&r.length>2?e+t+", ":r[n+1]?e+t+" ":e+t},"should be a")}(n))}return e})}n.r(t),n.d(t,"transform",function(){return r})},function(e,t,n){"use strict";n.r(t),n.d(t,"transform",function(){return r});n(93),n(1);function r(e,t){t.jsSpec;return e}},function(e,t,n){"use strict";n.r(t),n.d(t,"allErrors",function(){return i}),n.d(t,"lastError",function(){return a});var r=n(1),o=n(11),i=Object(o.createSelector)(function(e){return e},function(e){return e.get("errors",Object(r.List)())}),a=Object(o.createSelector)(i,function(e){return e.last()})},function(e,t,n){"use strict";n.r(t);var r=n(279),o=n(79),i=n(280);t.default=function(){return{statePlugins:{layout:{reducers:r.default,actions:o,selectors:i}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(1),s=n(79);t.default=(r={},i()(r,s.UPDATE_LAYOUT,function(e,t){return e.set("layout",t.payload)}),i()(r,s.UPDATE_FILTER,function(e,t){return e.set("filter",t.payload)}),i()(r,s.SHOW,function(e,t){var n=t.payload.shown,r=Object(a.fromJS)(t.payload.thing);return e.update("shown",Object(a.fromJS)({}),function(e){return e.set(r,n)})}),i()(r,s.UPDATE_MODE,function(e,t){var n=t.payload.thing,r=t.payload.mode;return e.setIn(["modes"].concat(n),(r||"")+"")}),r)},function(e,t,n){"use strict";n.r(t),n.d(t,"current",function(){return u}),n.d(t,"currentFilter",function(){return c}),n.d(t,"isShown",function(){return l}),n.d(t,"whatMode",function(){return p}),n.d(t,"showSummary",function(){return f});var r=n(12),o=n.n(r),i=n(11),a=n(3),s=n(1),u=function(e){return e.get("layout")},c=function(e){return e.get("filter")},l=function(e,t,n){return t=Object(a.w)(t),e.get("shown",Object(s.fromJS)({})).get(Object(s.fromJS)(t),n)},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t=Object(a.w)(t),e.getIn(["modes"].concat(o()(t)),n)},f=Object(i.createSelector)(function(e){return e},function(e){return!l(e,"editor")})},function(e,t,n){"use strict";n.r(t);var r=n(282),o=n(29),i=n(70),a=n(284);t.default=function(){return{statePlugins:{spec:{wrapActions:a,reducers:r.default,actions:o,selectors:i}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(16),s=n.n(a),u=n(12),c=n.n(u),l=n(1),p=n(3),f=n(18),h=n.n(f),d=n(70),m=n(29);t.default=(r={},i()(r,m.UPDATE_SPEC,function(e,t){return"string"==typeof t.payload?e.set("spec",t.payload):e}),i()(r,m.UPDATE_URL,function(e,t){return e.set("url",t.payload+"")}),i()(r,m.UPDATE_JSON,function(e,t){return e.set("json",Object(p.i)(t.payload))}),i()(r,m.UPDATE_RESOLVED,function(e,t){return e.setIn(["resolved"],Object(p.i)(t.payload))}),i()(r,m.UPDATE_RESOLVED_SUBTREE,function(e,t){var n=t.payload,r=n.value,o=n.path;return e.setIn(["resolvedSubtrees"].concat(c()(o)),Object(p.i)(r))}),i()(r,m.UPDATE_PARAM,function(e,t){var n=t.payload,r=n.path,o=n.paramName,i=n.paramIn,a=n.param,s=n.value,u=n.isXml,l=a?Object(p.B)(a):"".concat(i,".").concat(o),f=u?"value_xml":"value";return e.setIn(["meta","paths"].concat(c()(r),["parameters",l,f]),s)}),i()(r,m.UPDATE_EMPTY_PARAM_INCLUSION,function(e,t){var n=t.payload,r=n.pathMethod,o=n.paramName,i=n.paramIn,a=n.includeEmptyValue;if(!o||!i)return console.warn("Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey."),e;var s="".concat(i,".").concat(o);return e.setIn(["meta","paths"].concat(c()(r),["parameter_inclusions",s]),a)}),i()(r,m.VALIDATE_PARAMS,function(e,t){var n=t.payload,r=n.pathMethod,o=n.isOAS3,i=Object(d.specJsonWithResolvedSubtrees)(e).getIn(["paths"].concat(c()(r))),a=Object(d.parameterValues)(e,r).toJS();return e.updateIn(["meta","paths"].concat(c()(r),["parameters"]),Object(l.fromJS)({}),function(t){return i.get("parameters",Object(l.List)()).reduce(function(t,n){var i=Object(p.C)(n,a),s=Object(d.parameterInclusionSettingFor)(e,r,n.get("name"),n.get("in")),u=Object(p.K)(n,i,{bypassRequiredCheck:s,isOAS3:o});return t.setIn([Object(p.B)(n),"errors"],Object(l.fromJS)(u))},t)})}),i()(r,m.CLEAR_VALIDATE_PARAMS,function(e,t){var n=t.payload.pathMethod;return e.updateIn(["meta","paths"].concat(c()(n),["parameters"]),Object(l.fromJS)([]),function(e){return e.map(function(e){return e.set("errors",Object(l.fromJS)([]))})})}),i()(r,m.SET_RESPONSE,function(e,t){var n,r=t.payload,o=r.res,i=r.path,a=r.method;(n=o.error?s()({error:!0,name:o.err.name,message:o.err.message,statusCode:o.err.statusCode},o.err.response):o).headers=n.headers||{};var u=e.setIn(["responses",i,a],Object(p.i)(n));return h.a.Blob&&o.data instanceof h.a.Blob&&(u=u.setIn(["responses",i,a,"text"],o.data)),u}),i()(r,m.SET_REQUEST,function(e,t){var n=t.payload,r=n.req,o=n.path,i=n.method;return e.setIn(["requests",o,i],Object(p.i)(r))}),i()(r,m.SET_MUTATED_REQUEST,function(e,t){var n=t.payload,r=n.req,o=n.path,i=n.method;return e.setIn(["mutatedRequests",o,i],Object(p.i)(r))}),i()(r,m.UPDATE_OPERATION_META_VALUE,function(e,t){var n=t.payload,r=n.path,o=n.value,i=n.key,a=["paths"].concat(c()(r)),s=["meta","paths"].concat(c()(r));return e.getIn(["json"].concat(c()(a)))||e.getIn(["resolved"].concat(c()(a)))||e.getIn(["resolvedSubtrees"].concat(c()(a)))?e.setIn([].concat(c()(s),[i]),Object(l.fromJS)(o)):e}),i()(r,m.CLEAR_RESPONSE,function(e,t){var n=t.payload,r=n.path,o=n.method;return e.deleteIn(["responses",r,o])}),i()(r,m.CLEAR_REQUEST,function(e,t){var n=t.payload,r=n.path,o=n.method;return e.deleteIn(["requests",r,o])}),i()(r,m.SET_SCHEME,function(e,t){var n=t.payload,r=n.scheme,o=n.path,i=n.method;return o&&i?e.setIn(["scheme",o,i],r):o||i?void 0:e.setIn(["scheme","_defaultScheme"],r)}),r)},function(e,t,n){var r=n(83),o=n(37),i=n(66),a="[object String]";e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&r(e)==a}},function(e,t,n){"use strict";n.r(t),n.d(t,"updateSpec",function(){return s}),n.d(t,"updateJsonSpec",function(){return u}),n.d(t,"executeRequest",function(){return c}),n.d(t,"validateParams",function(){return l});var r=n(17),o=n.n(r),i=n(93),a=n.n(i),s=function(e,t){var n=t.specActions;return function(){e.apply(void 0,arguments),n.parseToJson.apply(n,arguments)}},u=function(e,t){var n=t.specActions;return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.apply(void 0,r),n.invalidateResolvedSubtreeCache();var s=r[0],u=a()(s,["paths"])||{},c=o()(u);c.forEach(function(e){a()(u,[e]).$ref&&n.requestResolvedSubtree(["paths",e])}),n.requestResolvedSubtree(["components","securitySchemes"])}},c=function(e,t){var n=t.specActions;return function(t){return n.logRequest(t),e(t)}},l=function(e,t){var n=t.specSelectors;return function(t){return e(t,n.isOAS3())}}},function(e,t,n){"use strict";n.r(t);var r=n(148),o=n(3);t.default=function(e){var t=e.getComponents,n=e.getStore,i=e.getSystem,a=r.getComponent,s=r.render,u=r.makeMappedContainer,c=Object(o.v)(a.bind(null,i,n,t));return{rootInjects:{getComponent:c,makeMappedContainer:Object(o.v)(u.bind(null,i,n,c,t)),render:s.bind(null,i,n,a,t)}}}},function(e,t,n){"use strict";n.r(t);var r=n(120);t.default=function(){return{fn:r}}},function(e,t,n){"use strict";n.r(t),t.default=function(e){var t=e.configs,n={debug:0,info:1,log:2,warn:3,error:4},r=function(e){return n[e]||-1},o=t.logLevel,i=r(o);function a(e){for(var t,n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];r(e)>=i&&(t=console)[e].apply(t,o)}return a.warn=a.bind(null,"warn"),a.error=a.bind(null,"error"),a.info=a.bind(null,"info"),a.debug=a.bind(null,"debug"),{rootInjects:{log:a}}}},function(e,t,n){"use strict";n.r(t);var r=n(56),o=n.n(r),i=n(289);t.default=function(e){var t=e.configs,n=e.getConfigs;return{fn:{fetch:o.a.makeHttp(t.preFetch,t.postFetch),buildRequest:o.a.buildRequest,execute:o.a.execute,resolve:o.a.resolve,resolveSubtree:function(e,t,r){if(void 0===r){var i=n();r={modelPropertyMacro:i.modelPropertyMacro,parameterMacro:i.parameterMacro,requestInterceptor:i.requestInterceptor,responseInterceptor:i.responseInterceptor}}for(var a=arguments.length,s=new Array(a>3?a-3:0),u=3;u<a;u++)s[u-3]=arguments[u];return o.a.resolveSubtree.apply(o.a,[e,t,r].concat(s))},serializeRes:o.a.serializeRes,opId:o.a.helpers.opId},statePlugins:{configs:{wrapActions:i}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"loaded",function(){return r});var r=function(e,t){return function(){e.apply(void 0,arguments);var n=t.getConfigs().withCredentials;void 0!==n&&(t.fn.fetch.withCredentials="string"==typeof n?"true"===n:!!n)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"preauthorizeBasic",function(){return c}),n.d(t,"preauthorizeApiKey",function(){return l});var r=n(2),o=n.n(r),i=n(291),a=n(71),s=n(292),u=n(293);function c(e,t,n,r){var i=e.authActions.authorize,a=e.specSelectors,s=a.specJson,u=(0,a.isOAS3)()?["components","securitySchemes"]:["securityDefinitions"],c=s().getIn([].concat(u,[t]));return c?i(o()({},t,{value:{username:n,password:r},schema:c.toJS()})):null}function l(e,t,n){var r=e.authActions.authorize,i=e.specSelectors,a=i.specJson,s=(0,i.isOAS3)()?["components","securitySchemes"]:["securityDefinitions"],u=a().getIn([].concat(s,[t]));return u?r(o()({},t,{value:n,schema:u.toJS()})):null}t.default=function(){return{afterLoad:function(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=l.bind(null,e),this.rootInjects.preauthorizeBasic=c.bind(null,e)},statePlugins:{auth:{reducers:i.default,actions:a,selectors:s},spec:{wrapActions:u}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(16),s=n.n(a),u=n(13),c=n.n(u),l=n(1),p=n(3),f=n(71);t.default=(r={},i()(r,f.SHOW_AUTH_POPUP,function(e,t){var n=t.payload;return e.set("showDefinitions",n)}),i()(r,f.AUTHORIZE,function(e,t){var n=t.payload,r=Object(l.fromJS)(n),o=e.get("authorized")||Object(l.Map)();return r.entrySeq().forEach(function(e){var t=c()(e,2),n=t[0],r=t[1],i=r.getIn(["schema","type"]);if("apiKey"===i||"http"===i)o=o.set(n,r);else if("basic"===i){var a=r.getIn(["value","username"]),s=r.getIn(["value","password"]);o=(o=o.setIn([n,"value"],{username:a,header:"Basic "+Object(p.a)(a+":"+s)})).setIn([n,"schema"],r.get("schema"))}}),e.set("authorized",o)}),i()(r,f.AUTHORIZE_OAUTH2,function(e,t){var n,r=t.payload,o=r.auth,i=r.token;return o.token=s()({},i),n=Object(l.fromJS)(o),e.setIn(["authorized",n.get("name")],n)}),i()(r,f.LOGOUT,function(e,t){var n=t.payload,r=e.get("authorized").withMutations(function(e){n.forEach(function(t){e.delete(t)})});return e.set("authorized",r)}),i()(r,f.CONFIGURE_AUTH,function(e,t){var n=t.payload;return e.set("configs",n)}),r)},function(e,t,n){"use strict";n.r(t),n.d(t,"shownDefinitions",function(){return l}),n.d(t,"definitionsToAuthorize",function(){return p}),n.d(t,"getDefinitionsByNames",function(){return f}),n.d(t,"definitionsForRequirements",function(){return h}),n.d(t,"authorized",function(){return d}),n.d(t,"isAuthorized",function(){return m}),n.d(t,"getConfigs",function(){return v});var r=n(17),o=n.n(r),i=n(13),a=n.n(i),s=n(11),u=n(1),c=function(e){return e},l=Object(s.createSelector)(c,function(e){return e.get("showDefinitions")}),p=Object(s.createSelector)(c,function(){return function(e){var t=e.specSelectors.securityDefinitions()||Object(u.Map)({}),n=Object(u.List)();return t.entrySeq().forEach(function(e){var t=a()(e,2),r=t[0],o=t[1],i=Object(u.Map)();i=i.set(r,o),n=n.push(i)}),n}}),f=function(e,t){return function(e){var n=e.specSelectors;console.warn("WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.");var r=n.securityDefinitions(),o=Object(u.List)();return t.valueSeq().forEach(function(e){var t=Object(u.Map)();e.entrySeq().forEach(function(e){var n,o=a()(e,2),i=o[0],s=o[1],u=r.get(i);"oauth2"===u.get("type")&&s.size&&((n=u.get("scopes")).keySeq().forEach(function(e){s.contains(e)||(n=n.delete(e))}),u=u.set("allowedScopes",n)),t=t.set(i,u)}),o=o.push(t)}),o}},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(u.List)();return function(e){return(e.authSelectors.definitionsToAuthorize()||Object(u.List)()).filter(function(e){return t.some(function(t){return t.get(e.keySeq().first())})})}},d=Object(s.createSelector)(c,function(e){return e.get("authorized")||Object(u.Map)()}),m=function(e,t){return function(e){var n=e.authSelectors.authorized();return u.List.isList(t)?!!t.toJS().filter(function(e){return-1===o()(e).map(function(e){return!!n.get(e)}).indexOf(!1)}).length:null}},v=Object(s.createSelector)(c,function(e){return e.get("configs")})},function(e,t,n){"use strict";n.r(t),n.d(t,"execute",function(){return y});var r=n(54),o=n.n(r),i=n(94),a=n.n(i),s=n(60),u=n.n(s),c=n(61),l=n.n(c),p=n(55),f=n.n(p),h=n(17),d=n.n(h),m=n(2),v=n.n(m);function g(e,t){var n=d()(e);if(f.a){var r=f()(e);t&&(r=r.filter(function(t){return l()(e,t).enumerable})),n.push.apply(n,r)}return n}var y=function(e,t){var n=t.authSelectors,r=t.specSelectors;return function(t){var i=t.path,s=t.method,c=t.operation,p=t.extras,f={authorized:n.authorized()&&n.authorized().toJS(),definitions:r.securityDefinitions()&&r.securityDefinitions().toJS(),specSecurity:r.security()&&r.security().toJS()};return e(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(n,!0).forEach(function(t){v()(e,t,n[t])}):u.a?a()(e,u()(n)):g(n).forEach(function(t){o()(e,t,l()(n,t))})}return e}({path:i,method:s,operation:c,securities:f},p))}}},function(e,t,n){"use strict";n.r(t);var r=n(3);t.default=function(){return{fn:{shallowEqualKeys:r.G}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return p});var r=n(28),o=n.n(r),i=n(16),a=n.n(i),s=n(11),u=n(1),c=n(18),l=n.n(c);function p(e){var t=e.fn;return{statePlugins:{spec:{actions:{download:function(e){return function(n){var r=n.errActions,o=n.specSelectors,i=n.specActions,s=n.getConfigs,u=t.fetch,c=s();function p(t){if(t instanceof Error||t.status>=400)return i.updateLoadingStatus("failed"),r.newThrownErr(a()(new Error((t.message||t.statusText)+" "+e),{source:"fetch"})),void(!t.status&&t instanceof Error&&function(){try{var t;if("URL"in l.a?t=new URL(e):(t=document.createElement("a")).href=e,"https:"!==t.protocol&&"https:"===l.a.location.protocol){var n=a()(new Error("Possible mixed-content issue? The page was loaded over https:// but a ".concat(t.protocol,"// URL was specified. Check that you are not attempting to load mixed content.")),{source:"fetch"});return void r.newThrownErr(n)}if(t.origin!==l.a.location.origin){var o=a()(new Error("Possible cross-origin (CORS) issue? The URL origin (".concat(t.origin,") does not match the page (").concat(l.a.location.origin,"). Check the server returns the correct 'Access-Control-Allow-*' headers.")),{source:"fetch"});r.newThrownErr(o)}}catch(e){return}}());i.updateLoadingStatus("success"),i.updateSpec(t.text),o.url()!==e&&i.updateUrl(e)}e=e||o.url(),i.updateLoadingStatus("loading"),r.clear({source:"fetch"}),u({url:e,loadSpec:!0,requestInterceptor:c.requestInterceptor||function(e){return e},responseInterceptor:c.responseInterceptor||function(e){return e},credentials:"same-origin",headers:{Accept:"application/json,*/*"}}).then(p,p)}},updateLoadingStatus:function(e){var t=[null,"loading","failed","success","failedConfig"];return-1===t.indexOf(e)&&console.error("Error: ".concat(e," is not one of ").concat(o()(t))),{type:"spec_update_loading_status",payload:e}}},reducers:{spec_update_loading_status:function(e,t){return"string"==typeof t.payload?e.set("loadingStatus",t.payload):e}},selectors:{loadingStatus:Object(s.createSelector)(function(e){return e||Object(u.Map)()},function(e){return e.get("loadingStatus")||null})}}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"downloadConfig",function(){return o}),n.d(t,"getConfigByUrl",function(){return i});var r=n(147),o=function(e){return function(t){return(0,t.fn.fetch)(e)}},i=function(e,t){return function(n){var o=n.specActions;if(e)return o.downloadConfig(e).then(i,i);function i(n){n instanceof Error||n.status>=400?(o.updateLoadingStatus("failedConfig"),o.updateLoadingStatus("failedConfig"),o.updateUrl(""),console.error(n.statusText+" "+e.url),t(null)):t(Object(r.parseYamlConfig)(n.text))}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"get",function(){return i});var r=n(14),o=n.n(r),i=function(e,t){return e.getIn(o()(t)?t:[t])}},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(1),s=n(121);t.default=(r={},i()(r,s.UPDATE_CONFIGS,function(e,t){return e.merge(Object(a.fromJS)(t.payload))}),i()(r,s.TOGGLE_CONFIGS,function(e,t){var n=t.payload,r=e.get(n);return e.set(n,!r)}),r)},function(e,t,n){"use strict";n.r(t);var r=n(300),o=n(301),i=n(302);t.default=function(){return[r.default,{statePlugins:{configs:{wrapActions:{loaded:function(e,t){return function(){e.apply(void 0,arguments);var n=decodeURIComponent(window.location.hash);t.layoutActions.parseDeepLinkHash(n)}}}}},wrapComponents:{operation:o.default,OperationTag:i.default}}]}},function(e,t,n){"use strict";n.r(t),n.d(t,"show",function(){return v}),n.d(t,"scrollTo",function(){return g}),n.d(t,"parseDeepLinkHash",function(){return y}),n.d(t,"readyToScroll",function(){return b}),n.d(t,"scrollToElement",function(){return _}),n.d(t,"clearScrollTo",function(){return w});var r,o=n(2),i=n.n(o),a=n(13),s=n.n(a),u=n(14),c=n.n(u),l=n(149),p=n(482),f=n.n(p),h=n(3),d=n(1),m=n.n(d),v=function(e,t){var n=t.getConfigs,r=t.layoutSelectors;return function(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];if(e.apply(void 0,o),n().deepLinking)try{var a=o[0],u=o[1];a=c()(a)?a:[a];var p=r.urlHashArrayFromIsShownKey(a);if(!p.length)return;var f=s()(p,2),d=f[0],m=f[1];if(!u)return Object(l.setHash)("/");2===p.length?Object(l.setHash)(Object(h.d)("/".concat(encodeURIComponent(d),"/").concat(encodeURIComponent(m)))):1===p.length&&Object(l.setHash)(Object(h.d)("/".concat(encodeURIComponent(d))))}catch(e){console.error(e)}}},g=function(e){return{type:"layout_scroll_to",payload:c()(e)?e:[e]}},y=function(e){return function(t){var n=t.layoutActions,r=t.layoutSelectors;if((0,t.getConfigs)().deepLinking&&e){var o=e.slice(1);"!"===o[0]&&(o=o.slice(1)),"/"===o[0]&&(o=o.slice(1));var i=o.split("/").map(function(e){return e||""}),a=r.isShownKeyFromUrlHashArray(i),u=s()(a,3),c=u[0],l=u[1],p=void 0===l?"":l,f=u[2],h=void 0===f?"":f;if("operations"===c){var d=r.isShownKeyFromUrlHashArray([p]);p.indexOf("_")>-1&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),n.show(d.map(function(e){return e.replace(/_/g," ")}),!0)),n.show(d,!0)}(p.indexOf("_")>-1||h.indexOf("_")>-1)&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),n.show(a.map(function(e){return e.replace(/_/g," ")}),!0)),n.show(a,!0),n.scrollTo(a)}}},b=function(e,t){return function(n){var r=n.layoutSelectors.getScrollToKey();m.a.is(r,Object(d.fromJS)(e))&&(n.layoutActions.scrollToElement(t),n.layoutActions.clearScrollTo())}},_=function(e,t){return function(n){try{t=t||n.fn.getScrollParent(e),f.a.createScroller(t).to(e)}catch(e){console.error(e)}}},w=function(){return{type:"layout_clear_scroll"}};t.default={fn:{getScrollParent:function(e,t){var n=document.documentElement,r=getComputedStyle(e),o="absolute"===r.position,i=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===r.position)return n;for(var a=e;a=a.parentElement;)if(r=getComputedStyle(a),(!o||"static"!==r.position)&&i.test(r.overflow+r.overflowY+r.overflowX))return a;return n}},statePlugins:{layout:{actions:{scrollToElement:_,scrollTo:g,clearScrollTo:w,readyToScroll:b,parseDeepLinkHash:y},selectors:{getScrollToKey:function(e){return e.get("scrollToKey")},isShownKeyFromUrlHashArray:function(e,t){var n=s()(t,2),r=n[0],o=n[1];return o?["operations",r,o]:r?["operations-tag",r]:[]},urlHashArrayFromIsShownKey:function(e,t){var n=s()(t,3),r=n[0],o=n[1],i=n[2];return"operations"==r?[o,i]:"operations-tag"==r?[o]:[]}},reducers:(r={},i()(r,"layout_scroll_to",function(e,t){return e.set("scrollToKey",m.a.fromJS(t.payload))}),i()(r,"layout_clear_scroll",function(e){return e.delete("scrollToKey")}),r),wrapActions:{show:v}}}}},function(e,t,n){"use strict";n.r(t);var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g);n(19);t.default=function(e,t){return function(n){function r(){var e,n;o()(this,r);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=u()(this,(e=l()(r)).call.apply(e,[this].concat(a))),v()(f()(n),"onLoad",function(e){var r=n.props.operation.toObject(),o=["operations",r.tag,r.operationId];t.layoutActions.readyToScroll(o,e)}),n}return d()(r,n),a()(r,[{key:"render",value:function(){return y.a.createElement("span",{ref:this.onLoad},y.a.createElement(e,this.props))}}]),r}(y.a.Component)}},function(e,t,n){"use strict";n.r(t);var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g);n(10);t.default=function(e,t){return function(n){function r(){var e,n;o()(this,r);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=u()(this,(e=l()(r)).call.apply(e,[this].concat(a))),v()(f()(n),"onLoad",function(e){var r=["operations-tag",n.props.tag];t.layoutActions.readyToScroll(r,e)}),n}return d()(r,n),a()(r,[{key:"render",value:function(){return y.a.createElement("span",{ref:this.onLoad},y.a.createElement(e,this.props))}}]),r}(y.a.Component)}},function(e,t,n){"use strict";n.r(t);var r=n(304);t.default=function(){return{fn:{opsFilter:r.default}}}},function(e,t,n){"use strict";n.r(t),t.default=function(e,t){return e.filter(function(e,n){return-1!==n.indexOf(t)})}},function(e,t,n){"use strict";n.r(t);var r=!1;t.default=function(){return{statePlugins:{spec:{wrapActions:{updateSpec:function(e){return function(){return r=!0,e.apply(void 0,arguments)}},updateJsonSpec:function(e,t){return function(){var n=t.getConfigs().onComplete;return r&&"function"==typeof n&&(setTimeout(n,0),r=!1),e.apply(void 0,arguments)}}}}}}}},function(e,t,n){"use strict";n.r(t);var r=n(307),o=n(308),i=n(309),a=n(310),s=n(319),u=n(62),c=n(326),l=n(327);t.default=function(){return{components:a.default,wrapComponents:s.default,statePlugins:{spec:{wrapSelectors:r,selectors:i},auth:{wrapSelectors:o},oas3:{actions:u,reducers:l.default,selectors:c}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"definitions",function(){return h}),n.d(t,"hasHost",function(){return d}),n.d(t,"securityDefinitions",function(){return m}),n.d(t,"host",function(){return v}),n.d(t,"basePath",function(){return g}),n.d(t,"consumes",function(){return y}),n.d(t,"produces",function(){return b}),n.d(t,"schemes",function(){return _}),n.d(t,"servers",function(){return w}),n.d(t,"isOAS3",function(){return x}),n.d(t,"isSwagger2",function(){return E});var r=n(11),o=n(70),i=n(1),a=n(24);function s(e){return function(t,n){return function(){var r=n.getSystem().specSelectors.specJson();return Object(a.isOAS3)(r)?e.apply(void 0,arguments):t.apply(void 0,arguments)}}}var u=function(e){return e||Object(i.Map)()},c=s(Object(r.createSelector)(function(){return null})),l=Object(r.createSelector)(u,function(e){return e.get("json",Object(i.Map)())}),p=Object(r.createSelector)(u,function(e){return e.get("resolved",Object(i.Map)())}),f=function(e){var t=p(e);return t.count()<1&&(t=l(e)),t},h=s(Object(r.createSelector)(f,function(e){var t=e.getIn(["components","schemas"]);return i.Map.isMap(t)?t:Object(i.Map)()})),d=s(function(e){return f(e).hasIn(["servers",0])}),m=s(Object(r.createSelector)(o.specJsonWithResolvedSubtrees,function(e){return e.getIn(["components","securitySchemes"])||null})),v=c,g=c,y=c,b=c,_=c,w=s(Object(r.createSelector)(f,function(e){return e.getIn(["servers"])||Object(i.Map)()})),x=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(a.isOAS3)(i.Map.isMap(e)?e:Object(i.Map)())}},E=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(a.isSwagger2)(i.Map.isMap(e)?e:Object(i.Map)())}}},function(e,t,n){"use strict";n.r(t),n.d(t,"definitionsToAuthorize",function(){return p});var r=n(2),o=n.n(r),i=n(13),a=n.n(i),s=n(11),u=n(1),c=n(24);var l,p=(l=Object(s.createSelector)(function(e){return e},function(e){return e.specSelectors.securityDefinitions()},function(e,t){var n=Object(u.List)();return t?(t.entrySeq().forEach(function(e){var t=a()(e,2),r=t[0],i=t[1],s=i.get("type");"oauth2"===s&&i.get("flows").entrySeq().forEach(function(e){var t=a()(e,2),s=t[0],c=t[1],l=Object(u.fromJS)({flow:s,authorizationUrl:c.get("authorizationUrl"),tokenUrl:c.get("tokenUrl"),scopes:c.get("scopes"),type:i.get("type")});n=n.push(new u.Map(o()({},r,l.filter(function(e){return void 0!==e}))))}),"http"!==s&&"apiKey"!==s||(n=n.push(new u.Map(o()({},r,i))))}),n):n}),function(e,t){return function(n){for(var r=t.getSystem().specSelectors.specJson(),o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return Object(c.isOAS3)(r)?l.apply(void 0,[t].concat(i)):e.apply(void 0,i)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"servers",function(){return l}),n.d(t,"isSwagger2",function(){return p});var r=n(11),o=n(1),i=n(24);var a,s=function(e){return e||Object(o.Map)()},u=Object(r.createSelector)(s,function(e){return e.get("json",Object(o.Map)())}),c=Object(r.createSelector)(s,function(e){return e.get("resolved",Object(o.Map)())}),l=(a=Object(r.createSelector)(function(e){var t=c(e);return t.count()<1&&(t=u(e)),t},function(e){return e.getIn(["servers"])||Object(o.Map)()}),function(){return function(e){var t=e.getSystem().specSelectors.specJson();if(Object(i.isOAS3)(t)){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return a.apply(void 0,r)}return null}}),p=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(i.isSwagger2)(e)}}},function(e,t,n){"use strict";n.r(t);var r=n(311),o=n(312),i=n(313),a=n(314),s=n(315),u=n(316),c=n(317),l=n(318);t.default={Callbacks:r.default,HttpAuth:c.default,RequestBody:o.default,Servers:a.default,ServersContainer:s.default,RequestBodyEditor:u.default,OperationServers:l.default,operationLink:i.default}},function(e,t,n){"use strict";n.r(t);var r=n(20),o=n.n(r),i=n(0),a=n.n(i),s=(n(10),n(19),n(1));t.default=function(e){var t=e.callbacks,n=e.getComponent,r=e.specPath,i=n("OperationContainer",!0);if(!t)return a.a.createElement("span",null,"No callbacks");var u=t.map(function(t,n){return a.a.createElement("div",{key:n},a.a.createElement("h2",null,n),t.map(function(t,u){return"$$ref"===u?null:a.a.createElement("div",{key:u},t.map(function(t,c){if("$$ref"===c)return null;var l=Object(s.fromJS)({operation:t});return a.a.createElement(i,o()({},e,{op:l,key:c,tag:"",method:c,path:u,specPath:r.push(n,u,c),allowTryItOut:!1}))}))}))});return a.a.createElement("div",null,u)}},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=(n(10),n(19),n(1)),a=n(3);function s(e,t,n){var r=e.getIn(["content",t]),o=r.get("schema").toJS(),i=void 0!==r.get("example")?Object(a.I)(r.get("example")):null,s=r.getIn(["examples",n,"value"]);return r.get("examples")?Object(a.I)(s)||"":Object(a.I)(i||Object(a.o)(o,t,{includeWriteOnly:!0})||"")}t.default=function(e){var t=e.requestBody,n=e.requestBodyValue,r=e.getComponent,u=e.getConfigs,c=e.specSelectors,l=e.fn,p=e.contentType,f=e.isExecute,h=e.specPath,d=e.onChange,m=e.activeExamplesKey,v=e.updateActiveExamplesKey,g=r("Markdown"),y=r("modelExample"),b=r("RequestBodyEditor"),_=r("highlightCode"),w=r("ExamplesSelectValueRetainer"),x=r("Example"),E=u().showCommonExtensions,S=t&&t.get("description")||null,C=t&&t.get("content")||new i.OrderedMap;p=p||C.keySeq().first()||"";var k=C.get(p,Object(i.OrderedMap)()),O=k.get("schema",Object(i.OrderedMap)()),A=k.get("examples",null);if(!k.size)return null;var T="object"===k.getIn(["schema","type"]);if("application/octet-stream"===p||0===p.indexOf("image/")||0===p.indexOf("audio/")||0===p.indexOf("video/")){var j=r("Input");return f?o.a.createElement(j,{type:"file",onChange:function(e){d(e.target.files[0])}}):o.a.createElement("i",null,"Example values are not available for ",o.a.createElement("code",null,"application/octet-stream")," media types.")}if(T&&("application/x-www-form-urlencoded"===p||0===p.indexOf("multipart/"))&&O.get("properties",Object(i.OrderedMap)()).size>0){var P=r("JsonSchemaForm"),I=r("ParameterExt"),M=O.get("properties",Object(i.OrderedMap)());return n=i.Map.isMap(n)?n:Object(i.OrderedMap)(),o.a.createElement("div",{className:"table-container"},S&&o.a.createElement(g,{source:S}),o.a.createElement("table",null,o.a.createElement("tbody",null,M.map(function(e,t){var s=E?Object(a.l)(e):null,u=O.get("required",Object(i.List)()).includes(t),c=e.get("type"),p=e.get("format"),h=e.get("description"),m=n.get(t),v=e.get("default")||e.get("example")||"";""===v&&"object"===c&&(v=Object(a.o)(e,!1,{includeWriteOnly:!0})),"string"!=typeof v&&"object"===c&&(v=Object(a.I)(v));var y="string"===c&&("binary"===p||"base64"===p);return o.a.createElement("tr",{key:t,className:"parameters","data-property-name":t},o.a.createElement("td",{className:"parameters-col_name"},o.a.createElement("div",{className:u?"parameter__name required":"parameter__name"},t,u?o.a.createElement("span",{style:{color:"red"}}," *"):null),o.a.createElement("div",{className:"parameter__type"},c,p&&o.a.createElement("span",{className:"prop-format"},"($",p,")"),E&&s.size?s.map(function(e,t){return o.a.createElement(I,{key:"".concat(t,"-").concat(e),xKey:t,xVal:e})}):null),o.a.createElement("div",{className:"parameter__deprecated"},e.get("deprecated")?"deprecated":null)),o.a.createElement("td",{className:"parameters-col_description"},o.a.createElement(g,{source:h}),f?o.a.createElement("div",null,o.a.createElement(P,{fn:l,dispatchInitialValue:!y,schema:e,description:t,getComponent:r,value:void 0===m?v:m,onChange:function(e){d(e,[t])}})):null))}))))}return o.a.createElement("div",null,S&&o.a.createElement(g,{source:S}),A?o.a.createElement(w,{examples:A,currentKey:m,currentUserInputValue:n,onSelect:function(e){v(e)},updateValue:d,defaultToFirstExample:!0,getComponent:r}):null,f?o.a.createElement("div",null,o.a.createElement(b,{value:n,defaultValue:s(t,p,m),onChange:d,getComponent:r})):o.a.createElement(y,{getComponent:r,getConfigs:u,specSelectors:c,expandDepth:1,isExecute:f,schema:k.get("schema"),specPath:h.push("content",p),example:o.a.createElement(_,{className:"body-param__example",value:Object(a.I)(n)||s(t,p,m)})}),A?o.a.createElement(x,{example:A.get(m),getComponent:r}):null)}},function(e,t,n){"use strict";n.r(t);var r=n(28),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(8),d=n.n(h),m=n(0),v=n.n(m),g=(n(10),n(19),function(e){function t(){return a()(this,t),l()(this,f()(t).apply(this,arguments))}return d()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.link,n=e.name,r=(0,e.getComponent)("Markdown"),i=t.get("operationId")||t.get("operationRef"),a=t.get("parameters")&&t.get("parameters").toJS(),s=t.get("description");return v.a.createElement("div",{style:{marginBottom:"1.5em"}},v.a.createElement("div",{style:{marginBottom:".5em"}},v.a.createElement("b",null,v.a.createElement("code",null,n)),s?v.a.createElement(r,{source:s}):null),v.a.createElement("pre",null,"Operation `",i,"`",v.a.createElement("br",null),v.a.createElement("br",null),"Parameters ",function(e,t){if("string"!=typeof t)return"";return t.split("\n").map(function(t,n){return n>0?Array(e+1).join(" ")+t:t}).join("\n")}(0,o()(a,null,2))||"{}",v.a.createElement("br",null)))}}]),t}(m.Component));t.default=g},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return _});var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g),b=n(1),_=(n(10),n(19),function(e){function t(){var e,n;o()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=u()(this,(e=l()(t)).call.apply(e,[this].concat(i))),v()(f()(n),"onServerChange",function(e){n.setServer(e.target.value)}),v()(f()(n),"onServerVariableValueChange",function(e){var t=n.props,r=t.setServerVariableValue,o=t.currentServer,i=e.target.getAttribute("data-variable"),a=e.target.value;"function"==typeof r&&r({server:o,key:i,val:a})}),v()(f()(n),"setServer",function(e){(0,n.props.setSelectedServer)(e)}),n}return d()(t,e),a()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.servers;e.currentServer||this.setServer(t.first().get("url"))}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.servers,r=t.setServerVariableValue,o=t.getServerVariable;if(this.props.currentServer!==e.currentServer){var i=n.find(function(t){return t.get("url")===e.currentServer});if(!i)return this.setServer(n.first().get("url"));(i.get("variables")||Object(b.OrderedMap)()).map(function(t,n){o(e.currentServer,n)||r({server:e.currentServer,key:n,val:t.get("default")||""})})}}},{key:"render",value:function(){var e=this,t=this.props,n=t.servers,r=t.currentServer,o=t.getServerVariable,i=t.getEffectiveServerValue,a=(n.find(function(e){return e.get("url")===r})||Object(b.OrderedMap)()).get("variables")||Object(b.OrderedMap)(),s=0!==a.size;return y.a.createElement("div",{className:"servers"},y.a.createElement("label",{htmlFor:"servers"},y.a.createElement("select",{onChange:this.onServerChange},n.valueSeq().map(function(e){return y.a.createElement("option",{value:e.get("url"),key:e.get("url")},e.get("url"),e.get("description")&&" - ".concat(e.get("description")))}).toArray())),s?y.a.createElement("div",null,y.a.createElement("div",{className:"computed-url"},"Computed URL:",y.a.createElement("code",null,i(r))),y.a.createElement("h4",null,"Server variables"),y.a.createElement("table",null,y.a.createElement("tbody",null,a.map(function(t,n){return y.a.createElement("tr",{key:n},y.a.createElement("td",null,n),y.a.createElement("td",null,t.get("enum")?y.a.createElement("select",{"data-variable":n,onChange:e.onServerVariableValueChange},t.get("enum").map(function(e){return y.a.createElement("option",{selected:e===o(r,n),key:e,value:e},e)})):y.a.createElement("input",{type:"text",value:o(r,n)||"",onChange:e.onServerVariableValueChange,"data-variable":n})))})))):null)}}]),t}(y.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return m});var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(8),f=n.n(p),h=n(0),d=n.n(h),m=(n(10),function(e){function t(){return o()(this,t),u()(this,l()(t).apply(this,arguments))}return f()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.oas3Selectors,r=e.oas3Actions,o=e.getComponent,i=t.servers(),a=o("Servers");return i&&i.size?d.a.createElement("div",null,d.a.createElement("span",{className:"servers-title"},"Servers"),d.a.createElement(a,{servers:i,currentServer:n.selectedServer(),setSelectedServer:r.setSelectedServer,setServerVariableValue:r.setServerVariableValue,getServerVariable:n.serverVariableValue,getEffectiveServerValue:n.serverEffectiveValue})):null}}]),t}(d.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return w});var r=n(4),o=n.n(r),i=n(5),a=n.n(i),s=n(6),u=n.n(s),c=n(7),l=n.n(c),p=n(9),f=n.n(p),h=n(8),d=n.n(h),m=n(2),v=n.n(m),g=n(0),y=n.n(g),b=(n(10),n(3)),_=Function.prototype,w=function(e){function t(e,n){var r;return o()(this,t),r=u()(this,l()(t).call(this,e,n)),v()(f()(r),"applyDefaultValue",function(e){var t=e||r.props,n=t.onChange,o=t.defaultValue;return r.setState({value:o}),n(o)}),v()(f()(r),"onChange",function(e){r.props.onChange(Object(b.I)(e))}),v()(f()(r),"onDomChange",function(e){var t=e.target.value;r.setState({value:t},function(){return r.onChange(t)})}),r.state={value:Object(b.I)(e.value)||e.defaultValue},e.onChange(e.value),r}return d()(t,e),a()(t,[{key:"componentWillReceiveProps",value:function(e){this.props.value!==e.value&&e.value!==this.state.value&&this.setState({value:Object(b.I)(e.value)}),!e.value&&e.defaultValue&&this.state.value&&this.applyDefaultValue(e)}},{key:"render",value:function(){var e=this.props.getComponent,t=this.state.value,n=e("TextArea");return y.a.createElement("div",{className:"body-param"},y.a.createElement(n,{className:"body-param__text",value:t,onChange:this.onDomChange}))}}]),t}(g.PureComponent);v()(w,"defaultProps",{onChange:_})},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return w});var r=n(16),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(9),d=n.n(h),m=n(8),v=n.n(m),g=n(2),y=n.n(g),b=n(0),_=n.n(b),w=(n(10),function(e){function t(e,n){var r;a()(this,t),r=l()(this,f()(t).call(this,e,n)),y()(d()(r),"onChange",function(e){var t=r.props.onChange,n=e.target,i=n.value,a=n.name,s=o()({},r.state.value);a?s[a]=i:s=i,r.setState({value:s},function(){return t(r.state)})});var i=r.props,s=i.name,u=i.schema,c=r.getValue();return r.state={name:s,schema:u,value:c},r}return v()(t,e),u()(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,o=e.name,i=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),c=n("Markdown"),l=n("JumpToPath",!0),p=(t.get("scheme")||"").toLowerCase(),f=this.getValue(),h=r.allErrors().filter(function(e){return e.get("authId")===o});if("basic"===p){var d=f?f.get("username"):null;return _.a.createElement("div",null,_.a.createElement("h4",null,_.a.createElement("code",null,o||t.get("name")),"  (http, Basic)",_.a.createElement(l,{path:["securityDefinitions",o]})),d&&_.a.createElement("h6",null,"Authorized"),_.a.createElement(a,null,_.a.createElement(c,{source:t.get("description")})),_.a.createElement(a,null,_.a.createElement("label",null,"Username:"),d?_.a.createElement("code",null," ",d," "):_.a.createElement(s,null,_.a.createElement(i,{type:"text",required:"required",name:"username",onChange:this.onChange}))),_.a.createElement(a,null,_.a.createElement("label",null,"Password:"),d?_.a.createElement("code",null," ****** "):_.a.createElement(s,null,_.a.createElement(i,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return _.a.createElement(u,{error:e,key:t})}))}return"bearer"===p?_.a.createElement("div",null,_.a.createElement("h4",null,_.a.createElement("code",null,o||t.get("name")),"  (http, Bearer)",_.a.createElement(l,{path:["securityDefinitions",o]})),f&&_.a.createElement("h6",null,"Authorized"),_.a.createElement(a,null,_.a.createElement(c,{source:t.get("description")})),_.a.createElement(a,null,_.a.createElement("label",null,"Value:"),f?_.a.createElement("code",null," ****** "):_.a.createElement(s,null,_.a.createElement(i,{type:"text",onChange:this.onChange}))),h.valueSeq().map(function(e,t){return _.a.createElement(u,{error:e,key:t})})):_.a.createElement("div",null,_.a.createElement("em",null,_.a.createElement("b",null,o)," HTTP authentication: unsupported scheme ","'".concat(p,"'")))}}]),t}(_.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return I});var r=n(54),o=n.n(r),i=n(94),a=n.n(i),s=n(60),u=n.n(s),c=n(61),l=n.n(c),p=n(55),f=n.n(p),h=n(17),d=n.n(h),m=n(4),v=n.n(m),g=n(5),y=n.n(g),b=n(6),_=n.n(b),w=n(7),x=n.n(w),E=n(9),S=n.n(E),C=n(8),k=n.n(C),O=n(2),A=n.n(O),T=n(0),j=n.n(T);n(10),n(19);function P(e,t){var n=d()(e);if(f.a){var r=f()(e);t&&(r=r.filter(function(t){return l()(e,t).enumerable})),n.push.apply(n,r)}return n}var I=function(e){function t(){var e,n;v()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=_()(this,(e=x()(t)).call.apply(e,[this].concat(i))),A()(S()(n),"setSelectedServer",function(e){var t=n.props,r=t.path,o=t.method;return n.forceUpdate(),n.props.setSelectedServer(e,"".concat(r,":").concat(o))}),A()(S()(n),"setServerVariableValue",function(e){var t=n.props,r=t.path,i=t.method;return n.forceUpdate(),n.props.setServerVariableValue(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(n,!0).forEach(function(t){A()(e,t,n[t])}):u.a?a()(e,u()(n)):P(n).forEach(function(t){o()(e,t,l()(n,t))})}return e}({},e,{namespace:"".concat(r,":").concat(i)}))}),A()(S()(n),"getSelectedServer",function(){var e=n.props,t=e.path,r=e.method;return n.props.getSelectedServer("".concat(t,":").concat(r))}),A()(S()(n),"getServerVariable",function(e,t){var r=n.props,o=r.path,i=r.method;return n.props.getServerVariable({namespace:"".concat(o,":").concat(i),server:e},t)}),A()(S()(n),"getEffectiveServerValue",function(e){var t=n.props,r=t.path,o=t.method;return n.props.getEffectiveServerValue({server:e,namespace:"".concat(r,":").concat(o)})}),n}return k()(t,e),y()(t,[{key:"render",value:function(){var e=this.props,t=e.operationServers,n=e.pathServers,r=e.getComponent;if(!t&&!n)return null;var o=r("Servers"),i=t||n,a=t?"operation":"path";return j.a.createElement("div",{className:"opblock-section operation-servers"},j.a.createElement("div",{className:"opblock-section-header"},j.a.createElement("div",{className:"tab-header"},j.a.createElement("h4",{className:"opblock-title"},"Servers"))),j.a.createElement("div",{className:"opblock-description-wrapper"},j.a.createElement("h4",{className:"message"},"These ",a,"-level options override the global server options."),j.a.createElement(o,{servers:i,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}]),t}(j.a.Component)},function(e,t,n){"use strict";n.r(t);var r=n(320),o=n(321),i=n(322),a=n(323),s=n(324),u=n(325);t.default={Markdown:r.default,AuthItem:o.default,JsonSchema_string:u.default,VersionStamp:i.default,model:s.default,onlineValidatorBadge:a.default}},function(e,t,n){"use strict";n.r(t),n.d(t,"Markdown",function(){return f});var r=n(0),o=n.n(r),i=(n(10),n(59)),a=n.n(i),s=n(195),u=n.n(s),c=n(24),l=n(194),p=new u.a("commonmark");p.block.ruler.enable(["table"]),p.set({linkTarget:"_blank"});var f=function(e){var t=e.source,n=e.className,r=void 0===n?"":n;if("string"!=typeof t)return null;if(t){var i,s=p.render(t),u=Object(l.b)(s);return"string"==typeof u&&(i=u.trim()),o.a.createElement("div",{dangerouslySetInnerHTML:{__html:i},className:a()(r,"renderedMarkdown")})}return null};t.default=Object(c.OAS3ComponentWrapFactory)(f)},function(e,t,n){"use strict";n.r(t);var r=n(40),o=n.n(r),i=n(0),a=n.n(i),s=n(24);t.default=Object(s.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,n=o()(e,["Ori"]),r=n.schema,i=n.getComponent,s=n.errSelectors,u=n.authorized,c=n.onAuthChange,l=n.name,p=i("HttpAuth");return"http"===r.get("type")?a.a.createElement(p,{key:l,schema:r,name:l,errSelectors:s,authorized:u,getComponent:i,onChange:c}):a.a.createElement(t,n)})},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=n(24);t.default=Object(i.OAS3ComponentWrapFactory)(function(e){var t=e.Ori;return o.a.createElement("span",null,o.a.createElement(t,e),o.a.createElement("small",{style:{backgroundColor:"#89bf04"}},o.a.createElement("pre",{className:"version"},"OAS3")))})},function(e,t,n){"use strict";n.r(t);var r=n(24);t.default=Object(r.OAS3ComponentWrapFactory)(function(){return null})},function(e,t,n){"use strict";n.r(t);var r=n(20),o=n.n(r),i=n(4),a=n.n(i),s=n(5),u=n.n(s),c=n(6),l=n.n(c),p=n(7),f=n.n(p),h=n(8),d=n.n(h),m=n(0),v=n.n(m),g=(n(10),n(24)),y=n(196),b=function(e){function t(){return a()(this,t),l()(this,f()(t).apply(this,arguments))}return d()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.getConfigs,n=["model-box"],r=null;return!0===e.schema.get("deprecated")&&(n.push("deprecated"),r=v.a.createElement("span",{className:"model-deprecated-warning"},"Deprecated:")),v.a.createElement("div",{className:n.join(" ")},r,v.a.createElement(y.a,o()({},this.props,{getConfigs:t,depth:1,expandDepth:this.props.expandDepth||0})))}}]),t}(m.Component);t.default=Object(g.OAS3ComponentWrapFactory)(b)},function(e,t,n){"use strict";n.r(t);var r=n(40),o=n.n(r),i=n(0),a=n.n(i),s=n(24);t.default=Object(s.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,n=o()(e,["Ori"]),r=n.schema,i=n.getComponent,s=n.errors,u=n.onChange,c=r.type,l=r.format,p=i("Input");return"string"!==c||"binary"!==l&&"base64"!==l?a.a.createElement(t,n):a.a.createElement(p,{type:"file",className:s.length?"invalid":"",title:s.length?s:"",onChange:function(e){u(e.target.files[0])},disabled:t.isDisabled})})},function(e,t,n){"use strict";n.r(t),n.d(t,"selectedServer",function(){return a}),n.d(t,"requestBodyValue",function(){return s}),n.d(t,"activeExamplesMember",function(){return u}),n.d(t,"requestContentType",function(){return c}),n.d(t,"responseContentType",function(){return l}),n.d(t,"serverVariableValue",function(){return p}),n.d(t,"serverVariables",function(){return f}),n.d(t,"serverEffectiveValue",function(){return h});var r=n(1),o=n(24);function i(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(t){var r=t.getSystem().specSelectors.specJson();return Object(o.isOAS3)(r)?e.apply(void 0,n):null}}}var a=i(function(e,t){var n=t?[t,"selectedServer"]:["selectedServer"];return e.getIn(n)||""}),s=i(function(e,t,n){return e.getIn(["requestData",t,n,"bodyValue"])||null}),u=i(function(e,t,n,r,o){return e.getIn(["examples",t,n,r,o,"activeExample"])||null}),c=i(function(e,t,n){return e.getIn(["requestData",t,n,"requestContentType"])||null}),l=i(function(e,t,n){return e.getIn(["requestData",t,n,"responseContentType"])||null}),p=i(function(e,t,n){var r;if("string"!=typeof t){var o=t.server,i=t.namespace;r=i?[i,"serverVariableValues",o,n]:["serverVariableValues",o,n]}else{r=["serverVariableValues",t,n]}return e.getIn(r)||null}),f=i(function(e,t){var n;if("string"!=typeof t){var o=t.server,i=t.namespace;n=i?[i,"serverVariableValues",o]:["serverVariableValues",o]}else{n=["serverVariableValues",t]}return e.getIn(n)||Object(r.OrderedMap)()}),h=i(function(e,t){var n,o;if("string"!=typeof t){var i=t.server,a=t.namespace;o=i,n=a?e.getIn([a,"serverVariableValues",o]):e.getIn(["serverVariableValues",o])}else o=t,n=e.getIn(["serverVariableValues",o]);n=n||Object(r.OrderedMap)();var s=o;return n.map(function(e,t){s=s.replace(new RegExp("{".concat(t,"}"),"g"),e)}),s})},function(e,t,n){"use strict";n.r(t);var r,o=n(2),i=n.n(o),a=n(13),s=n.n(a),u=n(62);t.default=(r={},i()(r,u.UPDATE_SELECTED_SERVER,function(e,t){var n=t.payload,r=n.selectedServerUrl,o=n.namespace,i=o?[o,"selectedServer"]:["selectedServer"];return e.setIn(i,r)}),i()(r,u.UPDATE_REQUEST_BODY_VALUE,function(e,t){var n=t.payload,r=n.value,o=n.pathMethod,i=s()(o,2),a=i[0],u=i[1];return e.setIn(["requestData",a,u,"bodyValue"],r)}),i()(r,u.UPDATE_ACTIVE_EXAMPLES_MEMBER,function(e,t){var n=t.payload,r=n.name,o=n.pathMethod,i=n.contextType,a=n.contextName,u=s()(o,2),c=u[0],l=u[1];return e.setIn(["examples",c,l,i,a,"activeExample"],r)}),i()(r,u.UPDATE_REQUEST_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,o=n.pathMethod,i=s()(o,2),a=i[0],u=i[1];return e.setIn(["requestData",a,u,"requestContentType"],r)}),i()(r,u.UPDATE_RESPONSE_CONTENT_TYPE,function(e,t){var n=t.payload,r=n.value,o=n.path,i=n.method;return e.setIn(["requestData",o,i,"responseContentType"],r)}),i()(r,u.UPDATE_SERVER_VARIABLE_VALUE,function(e,t){var n=t.payload,r=n.server,o=n.namespace,i=n.key,a=n.val,s=o?[o,"serverVariableValues",r,i]:["serverVariableValues",r,i];return e.setIn(s,a)}),r)},function(e,t,n){"use strict";n.r(t);var r=n(3),o=n(1033),i={};o.keys().forEach(function(e){if("./index.js"!==e){var t=o(e);i[Object(r.E)(e)]=t.default?t.default:t}}),t.default=i},function(e,t,n){"use strict";n.r(t);var r=n(147),o=n(121),i=n(296),a=n(297),s=n(298);n.d(t,"default",function(){return c});var u={getLocalConfig:function(){return Object(r.parseYamlConfig)('---\nurl: "https://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://validator.swagger.io/validator"\n')}};function c(){return{statePlugins:{spec:{actions:i,selectors:u},configs:{reducers:s.default,actions:o,selectors:a}}}}},function(e,t,n){"use strict";(function(e,r){var o,i=n(468);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=Object(i.a)(o);t.a=a}).call(this,n(36),n(592)(e))},function(e,t,n){"use strict";var r=n(396),o=n(398),i=n(700);e.exports=function(e){var t,a=r(arguments[1]);return a.normalizer||0!==(t=a.length=o(a.length,e.length,a.async))&&(a.primitive?!1===t?a.normalizer=n(727):t>1&&(a.normalizer=n(728)(t)):a.normalizer=!1===t?n(729)():1===t?n(733)():n(734)(t)),a.async&&n(735),a.promise&&n(736),a.dispose&&n(742),a.maxAge&&n(743),a.max&&n(746),a.refCounter&&n(748),i(e,a)}},function(e,t,n){e.exports=n(772)},function(e,t,n){var r=n(417);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},function(e,t,n){"use strict";t.__esModule=!0,t.connect=t.Provider=void 0;var r=i(n(891)),o=i(n(893));function i(e){return e&&e.__esModule?e:{default:e}}t.Provider=r.default,t.connect=o.default},function(e,t,n){e.exports=function(){"use strict";var e=Object.freeze||function(e){return e},t=e(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),n=e(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"]),r=e(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),o=e(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),i=e(["#text"]),a=Object.freeze||function(e){return e},s=a(["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","coords","crossorigin","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","integrity","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","minlength","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns"]),u=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),c=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),l=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),p=Object.hasOwnProperty,f=Object.setPrototypeOf,h=("undefined"!=typeof Reflect&&Reflect).apply;function d(e,t){f&&f(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=r.toLowerCase();o!==r&&(Object.isFrozen(t)||(t[n]=o),r=o)}e[r]=!0}return e}function m(e){var t={},n=void 0;for(n in e)h(p,e,[n])&&(t[n]=e[n]);return t}h||(h=function(e,t,n){return e.apply(t,n)});var v=Object.seal||function(e){return e},g=v(/\{\{[\s\S]*|[\s\S]*\}\}/gm),y=v(/<%[\s\S]*|[\s\S]*%>/gm),b=v(/^data-[\-\w.\u00B7-\uFFFF]/),_=v(/^aria-[\-\w]+$/),w=v(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),x=v(/^(?:\w+script|data):/i),E=v(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function C(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var k=("undefined"!=typeof Reflect&&Reflect).apply,O=Array.prototype.slice,A=Object.freeze,T=function(){return"undefined"==typeof window?null:window};k||(k=function(e,t,n){return e.apply(t,n)});var j=function(e,t){if("object"!==(void 0===e?"undefined":S(e))||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};return function e(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T(),p=function(t){return e(t)};if(p.version="2.0.7",p.removed=[],!a||!a.document||9!==a.document.nodeType)return p.isSupported=!1,p;var f=a.document,h=!1,v=!1,P=a.document,I=a.DocumentFragment,M=a.HTMLTemplateElement,N=a.Node,R=a.NodeFilter,D=a.NamedNodeMap,L=void 0===D?a.NamedNodeMap||a.MozNamedAttrMap:D,U=a.Text,q=a.Comment,F=a.DOMParser,B=a.TrustedTypes;if("function"==typeof M){var z=P.createElement("template");z.content&&z.content.ownerDocument&&(P=z.content.ownerDocument)}var V=j(B,f),H=V?V.createHTML(""):"",W=P,J=W.implementation,K=W.createNodeIterator,Y=W.getElementsByTagName,$=W.createDocumentFragment,G=f.importNode,Z={};p.isSupported=J&&void 0!==J.createHTMLDocument&&9!==P.documentMode;var X=g,Q=y,ee=b,te=_,ne=x,re=E,oe=w,ie=null,ae=d({},[].concat(C(t),C(n),C(r),C(o),C(i))),se=null,ue=d({},[].concat(C(s),C(u),C(c),C(l))),ce=null,le=null,pe=!0,fe=!0,he=!1,de=!1,me=!1,ve=!1,ge=!1,ye=!1,be=!1,_e=!1,we=!1,xe=!1,Ee=!0,Se=!0,Ce=!1,ke={},Oe=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ae=d({},["audio","video","img","source","image"]),Te=null,je=d({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Pe=null,Ie=P.createElement("form"),Me=function(e){Pe&&Pe===e||(e&&"object"===(void 0===e?"undefined":S(e))||(e={}),ie="ALLOWED_TAGS"in e?d({},e.ALLOWED_TAGS):ae,se="ALLOWED_ATTR"in e?d({},e.ALLOWED_ATTR):ue,Te="ADD_URI_SAFE_ATTR"in e?d(m(je),e.ADD_URI_SAFE_ATTR):je,ce="FORBID_TAGS"in e?d({},e.FORBID_TAGS):{},le="FORBID_ATTR"in e?d({},e.FORBID_ATTR):{},ke="USE_PROFILES"in e&&e.USE_PROFILES,pe=!1!==e.ALLOW_ARIA_ATTR,fe=!1!==e.ALLOW_DATA_ATTR,he=e.ALLOW_UNKNOWN_PROTOCOLS||!1,de=e.SAFE_FOR_JQUERY||!1,me=e.SAFE_FOR_TEMPLATES||!1,ve=e.WHOLE_DOCUMENT||!1,be=e.RETURN_DOM||!1,_e=e.RETURN_DOM_FRAGMENT||!1,we=e.RETURN_DOM_IMPORT||!1,xe=e.RETURN_TRUSTED_TYPE||!1,ye=e.FORCE_BODY||!1,Ee=!1!==e.SANITIZE_DOM,Se=!1!==e.KEEP_CONTENT,Ce=e.IN_PLACE||!1,oe=e.ALLOWED_URI_REGEXP||oe,me&&(fe=!1),_e&&(be=!0),ke&&(ie=d({},[].concat(C(i))),se=[],!0===ke.html&&(d(ie,t),d(se,s)),!0===ke.svg&&(d(ie,n),d(se,u),d(se,l)),!0===ke.svgFilters&&(d(ie,r),d(se,u),d(se,l)),!0===ke.mathMl&&(d(ie,o),d(se,c),d(se,l))),e.ADD_TAGS&&(ie===ae&&(ie=m(ie)),d(ie,e.ADD_TAGS)),e.ADD_ATTR&&(se===ue&&(se=m(se)),d(se,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&d(Te,e.ADD_URI_SAFE_ATTR),Se&&(ie["#text"]=!0),ve&&d(ie,["html","head","body"]),ie.table&&(d(ie,["tbody"]),delete ce.tbody),A&&A(e),Pe=e)},Ne=function(e){p.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=H}},Re=function(e,t){try{p.removed.push({attribute:t.getAttributeNode(e),from:t})}catch(e){p.removed.push({attribute:null,from:t})}t.removeAttribute(e)},De=function(e){var t=void 0,n=void 0;if(ye)e="<remove></remove>"+e;else{var r=e.match(/^[\s]+/);(n=r&&r[0])&&(e=e.slice(n.length))}if(h)try{t=(new F).parseFromString(e,"text/html")}catch(e){}if(v&&d(ce,["title"]),!t||!t.documentElement){var o=(t=J.createHTMLDocument("")).body;o.parentNode.removeChild(o.parentNode.firstElementChild),o.outerHTML=V?V.createHTML(e):e}return e&&n&&t.body.insertBefore(P.createTextNode(n),t.body.childNodes[0]||null),Y.call(t,ve?"html":"body")[0]};p.isSupported&&(function(){try{De('<svg><p><textarea><img src="</textarea><img src=x abc=1//">').querySelector("svg img")&&(h=!0)}catch(e){}}(),function(){try{var e=De("<x/><title></title><img>");/<\/title/.test(e.querySelector("title").innerHTML)&&(v=!0)}catch(e){}}());var Le=function(e){return K.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT,function(){return R.FILTER_ACCEPT},!1)},Ue=function(e){return"object"===(void 0===N?"undefined":S(N))?e instanceof N:e&&"object"===(void 0===e?"undefined":S(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},qe=function(e,t,n){Z[e]&&Z[e].forEach(function(e){e.call(p,t,n,Pe)})},Fe=function(e){var t,n=void 0;if(qe("beforeSanitizeElements",e,null),!((t=e)instanceof U||t instanceof q||"string"==typeof t.nodeName&&"string"==typeof t.textContent&&"function"==typeof t.removeChild&&t.attributes instanceof L&&"function"==typeof t.removeAttribute&&"function"==typeof t.setAttribute&&"string"==typeof t.namespaceURI))return Ne(e),!0;var r=e.nodeName.toLowerCase();if(qe("uponSanitizeElement",e,{tagName:r,allowedTags:ie}),("svg"===r||"math"===r)&&0!==e.querySelectorAll("p, br").length)return Ne(e),!0;if(!ie[r]||ce[r]){if(Se&&!Oe[r]&&"function"==typeof e.insertAdjacentHTML)try{var o=e.innerHTML;e.insertAdjacentHTML("AfterEnd",V?V.createHTML(o):o)}catch(e){}return Ne(e),!0}return"noscript"===r&&/<\/noscript/i.test(e.innerHTML)?(Ne(e),!0):"noembed"===r&&/<\/noembed/i.test(e.innerHTML)?(Ne(e),!0):(!de||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(p.removed.push({element:e.cloneNode()}),e.innerHTML?e.innerHTML=e.innerHTML.replace(/</g,"<"):e.innerHTML=e.textContent.replace(/</g,"<")),me&&3===e.nodeType&&(n=(n=(n=e.textContent).replace(X," ")).replace(Q," "),e.textContent!==n&&(p.removed.push({element:e.cloneNode()}),e.textContent=n)),qe("afterSanitizeElements",e,null),!1)},Be=function(e,t,n){if(Ee&&("id"===t||"name"===t)&&(n in P||n in Ie))return!1;if(fe&&ee.test(t));else if(pe&&te.test(t));else{if(!se[t]||le[t])return!1;if(Te[t]);else if(oe.test(n.replace(re,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==n.indexOf("data:")||!Ae[e])if(he&&!ne.test(n.replace(re,"")));else if(n)return!1}return!0},ze=function(e){var t=void 0,n=void 0,r=void 0,o=void 0,i=void 0;qe("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:se};for(i=a.length;i--;){var u=t=a[i],c=u.name,l=u.namespaceURI;if(n=t.value.trim(),r=c.toLowerCase(),s.attrName=r,s.attrValue=n,s.keepAttr=!0,qe("uponSanitizeAttribute",e,s),n=s.attrValue,"name"===r&&"IMG"===e.nodeName&&a.id)o=a.id,a=k(O,a,[]),Re("id",e),Re(c,e),a.indexOf(o)>i&&e.setAttribute("id",o.value);else{if("INPUT"===e.nodeName&&"type"===r&&"file"===n&&s.keepAttr&&(se[r]||!le[r]))continue;"id"===c&&e.setAttribute(c,""),Re(c,e)}if(s.keepAttr)if(/svg|math/i.test(e.namespaceURI)&&new RegExp("</("+Object.keys(Oe).join("|")+")","i").test(n))Re(c,e);else{me&&(n=(n=n.replace(X," ")).replace(Q," "));var f=e.nodeName.toLowerCase();if(Be(f,r,n))try{l?e.setAttributeNS(l,c,n):e.setAttribute(c,n),p.removed.pop()}catch(e){}}}qe("afterSanitizeAttributes",e,null)}},Ve=function e(t){var n=void 0,r=Le(t);for(qe("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)qe("uponSanitizeShadowNode",n,null),Fe(n)||(n.content instanceof I&&e(n.content),ze(n));qe("afterSanitizeShadowDOM",t,null)};return p.sanitize=function(e,t){var n=void 0,r=void 0,o=void 0,i=void 0,s=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!Ue(e)){if("function"!=typeof e.toString)throw new TypeError("toString is not a function");if("string"!=typeof(e=e.toString()))throw new TypeError("dirty is not a string, aborting")}if(!p.isSupported){if("object"===S(a.toStaticHTML)||"function"==typeof a.toStaticHTML){if("string"==typeof e)return a.toStaticHTML(e);if(Ue(e))return a.toStaticHTML(e.outerHTML)}return e}if(ge||Me(t),p.removed=[],Ce);else if(e instanceof N)1===(r=(n=De("\x3c!--\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===r.nodeName?n=r:"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!be&&!me&&!ve&&xe&&-1===e.indexOf("<"))return V?V.createHTML(e):e;if(!(n=De(e)))return be?null:H}n&&ye&&Ne(n.firstChild);for(var u=Le(Ce?e:n);o=u.nextNode();)3===o.nodeType&&o===i||Fe(o)||(o.content instanceof I&&Ve(o.content),ze(o),i=o);if(i=null,Ce)return e;if(be){if(_e)for(s=$.call(n.ownerDocument);n.firstChild;)s.appendChild(n.firstChild);else s=n;return we&&(s=G.call(f,s,!0)),s}var c=ve?n.outerHTML:n.innerHTML;return me&&(c=(c=c.replace(X," ")).replace(Q," ")),V&&xe?V.createHTML(c):c},p.setConfig=function(e){Me(e),ge=!0},p.clearConfig=function(){Pe=null,ge=!1},p.isValidAttribute=function(e,t,n){Pe||Me({});var r=e.toLowerCase(),o=t.toLowerCase();return Be(r,o,n)},p.addHook=function(e,t){"function"==typeof t&&(Z[e]=Z[e]||[],Z[e].push(t))},p.removeHook=function(e){Z[e]&&Z[e].pop()},p.removeHooks=function(e){Z[e]&&(Z[e]=[])},p.removeAllHooks=function(){Z={}},p}()}()},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){"use strict";var r=n(201)(!0);n(338)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";var r=n(198),o=n(35),i=n(97),a=n(81),s=n(128),u=n(495),c=n(203),l=n(501),p=n(33)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,d,m,v,g){u(n,t,d);var y,b,_,w=function(e){if(!f&&e in C)return C[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",E="values"==m,S=!1,C=e.prototype,k=C[p]||C["@@iterator"]||m&&C[m],O=k||w(m),A=m?E?w("entries"):O:void 0,T="Array"==t&&C.entries||k;if(T&&(_=l(T.call(new e)))!==Object.prototype&&_.next&&(c(_,x,!0),r||"function"==typeof _[p]||a(_,p,h)),E&&k&&"values"!==k.name&&(S=!0,O=function(){return k.call(this)}),r&&!g||!f&&!S&&C[p]||a(C,p,O),s[t]=O,s[x]=h,m)if(y={values:E?O:w("values"),keys:v?O:w("keys"),entries:A},g)for(b in y)b in C||i(C,b,y[b]);else o(o.P+o.F*(f||S),t,y);return y}},function(e,t,n){var r=n(498),o=n(341);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(127),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(41).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(73);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r,o,i,a=n(153),s=n(512),u=n(342),c=n(200),l=n(41),p=l.process,f=l.setImmediate,h=l.clearImmediate,d=l.MessageChannel,m=l.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};f&&h||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},h=function(e){delete g[e]},"process"==n(125)(p)?r=function(e){p.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:d?(i=(o=new d).port2,o.port1.onmessage=b,r=a(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:h}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(45),o=n(98),i=n(205);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var r=n(98),o=n(125),i=n(33)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(75),o=n(76),i=n(555)(!1),a=n(213)("IE_PROTO");e.exports=function(e,t){var n,s=o(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~i(c,n)||c.push(n));return c}},function(e,t,n){e.exports=!n(50)&&!n(82)(function(){return 7!=Object.defineProperty(n(217)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(49),o=n(46),i=n(129);e.exports=n(50)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(32).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(75),o=n(100),i=n(213)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r=n(32),o=n(75),i=n(50),a=n(30),s=n(220),u=n(135).KEY,c=n(82),l=n(214),p=n(134),f=n(159),h=n(34),d=n(221),m=n(222),v=n(565),g=n(223),y=n(46),b=n(43),_=n(76),w=n(218),x=n(133),E=n(160),S=n(566),C=n(163),k=n(49),O=n(129),A=C.f,T=k.f,j=S.f,P=r.Symbol,I=r.JSON,M=I&&I.stringify,N=h("_hidden"),R=h("toPrimitive"),D={}.propertyIsEnumerable,L=l("symbol-registry"),U=l("symbols"),q=l("op-symbols"),F=Object.prototype,B="function"==typeof P,z=r.QObject,V=!z||!z.prototype||!z.prototype.findChild,H=i&&c(function(){return 7!=E(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=A(F,t);r&&delete F[t],T(e,t,n),r&&e!==F&&T(F,t,r)}:T,W=function(e){var t=U[e]=E(P.prototype);return t._k=e,t},J=B&&"symbol"==typeof P.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof P},K=function(e,t,n){return e===F&&K(q,t,n),y(e),t=w(t,!0),y(n),o(U,t)?(n.enumerable?(o(e,N)&&e[N][t]&&(e[N][t]=!1),n=E(n,{enumerable:x(0,!1)})):(o(e,N)||T(e,N,x(1,{})),e[N][t]=!0),H(e,t,n)):T(e,t,n)},Y=function(e,t){y(e);for(var n,r=v(t=_(t)),o=0,i=r.length;i>o;)K(e,n=r[o++],t[n]);return e},$=function(e){var t=D.call(this,e=w(e,!0));return!(this===F&&o(U,e)&&!o(q,e))&&(!(t||!o(this,e)||!o(U,e)||o(this,N)&&this[N][e])||t)},G=function(e,t){if(e=_(e),t=w(t,!0),e!==F||!o(U,t)||o(q,t)){var n=A(e,t);return!n||!o(U,t)||o(e,N)&&e[N][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=j(_(e)),r=[],i=0;n.length>i;)o(U,t=n[i++])||t==N||t==u||r.push(t);return r},X=function(e){for(var t,n=e===F,r=j(n?q:_(e)),i=[],a=0;r.length>a;)!o(U,t=r[a++])||n&&!o(F,t)||i.push(U[t]);return i};B||(s((P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===F&&t.call(q,n),o(this,N)&&o(this[N],e)&&(this[N][e]=!1),H(this,e,x(1,n))};return i&&V&&H(F,e,{configurable:!0,set:t}),W(e)}).prototype,"toString",function(){return this._k}),C.f=G,k.f=K,n(224).f=S.f=Z,n(162).f=$,n(161).f=X,i&&!n(131)&&s(F,"propertyIsEnumerable",$,!0),d.f=function(e){return W(h(e))}),a(a.G+a.W+a.F*!B,{Symbol:P});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)h(Q[ee++]);for(var te=O(h.store),ne=0;te.length>ne;)m(te[ne++]);a(a.S+a.F*!B,"Symbol",{for:function(e){return o(L,e+="")?L[e]:L[e]=P(e)},keyFor:function(e){if(!J(e))throw TypeError(e+" is not a symbol!");for(var t in L)if(L[t]===e)return t},useSetter:function(){V=!0},useSimple:function(){V=!1}}),a(a.S+a.F*!B,"Object",{create:function(e,t){return void 0===t?E(e):Y(E(e),t)},defineProperty:K,defineProperties:Y,getOwnPropertyDescriptor:G,getOwnPropertyNames:Z,getOwnPropertySymbols:X}),I&&a(a.S+a.F*(!B||c(function(){var e=P();return"[null]"!=M([e])||"{}"!=M({a:e})||"{}"!=M(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=t=r[1],(b(t)||void 0!==e)&&!J(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!J(t))return t}),r[1]=t,M.apply(I,r)}}),P.prototype[R]||n(77)(P.prototype,R,P.prototype.valueOf),p(P,"Symbol"),p(Math,"Math",!0),p(r.JSON,"JSON",!0)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=n(129),o=n(161),i=n(162),a=n(100),s=n(211),u=Object.assign;e.exports=!u||n(82)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r})?function(e,t){for(var n=a(e),u=arguments.length,c=1,l=o.f,p=i.f;u>c;)for(var f,h=s(arguments[c++]),d=l?r(h).concat(l(h)):r(h),m=d.length,v=0;m>v;)p.call(h,f=d[v++])&&(n[f]=h[f]);return n}:u},function(e,t,n){"use strict";var r=n(136),o=n(25),i=n(358),a=(n(359),n(165));n(15),n(577);function s(e,t,n){this.props=e,this.context=t,this.refs=a,this.updater=n||i}function u(e,t,n){this.props=e,this.context=t,this.refs=a,this.updater=n||i}function c(){}s.prototype.isReactComponent={},s.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&r("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},s.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")},c.prototype=s.prototype,u.prototype=new c,u.prototype.constructor=u,o(u.prototype,s.prototype),u.prototype.isPureReactComponent=!0,e.exports={Component:s,PureComponent:u}},function(e,t,n){"use strict";n(23);var r={isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}};e.exports=r},function(e,t,n){"use strict";e.exports=!1},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r=n(585);e.exports=function(e){return r(e,!1)}},function(e,t,n){"use strict";e.exports=n(586)},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e&&"@@redux/INIT"===e.type?"initialState argument passed to createStore":"previous state received by the reducer"},e.exports=t.default},function(e,t,n){var r=n(106),o=n(367),i=n(37),a=n(167),s=1/0,u=r?r.prototype:void 0,c=u?u.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-s?"-0":n}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(36))},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},function(e,t){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}},function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},function(e,t){e.exports=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}},function(e,t,n){var r=n(83),o=n(52),i="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=r(e);return t==a||t==s||t==i||t==u}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(647),o=n(66);e.exports=function e(t,n,i,a,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,s))}},function(e,t,n){var r=n(648),o=n(375),i=n(651),a=1,s=2;e.exports=function(e,t,n,u,c,l){var p=n&a,f=e.length,h=t.length;if(f!=h&&!(p&&h>f))return!1;var d=l.get(e);if(d&&l.get(t))return d==t;var m=-1,v=!0,g=n&s?new r:void 0;for(l.set(e,t),l.set(t,e);++m<f;){var y=e[m],b=t[m];if(u)var _=p?u(b,y,m,t,e,l):u(y,b,m,e,t,l);if(void 0!==_){if(_)continue;v=!1;break}if(g){if(!o(t,function(e,t){if(!i(g,t)&&(y===e||c(y,e,n,u,l)))return g.push(t)})){v=!1;break}}else if(y!==b&&!c(y,b,n,u,l)){v=!1;break}}return l.delete(e),l.delete(t),v}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t,n){var r=n(51).Uint8Array;e.exports=r},function(e,t,n){var r=n(378),o=n(230),i=n(85);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(229),o=n(37);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(657),o=n(231),i=n(37),a=n(232),s=n(174),u=n(381),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),l=!n&&o(e),p=!n&&!l&&a(e),f=!n&&!l&&!p&&u(e),h=n||l||p||f,d=h?r(e.length,String):[],m=d.length;for(var v in e)!t&&!c.call(e,v)||h&&("length"==v||p&&("offset"==v||"parent"==v)||f&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,m))||d.push(v);return d}},function(e,t,n){var r=n(660),o=n(234),i=n(235),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(52);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},function(e,t,n){var r=n(671),o=n(672);e.exports=function(e,t){return null!=e&&o(e,t,r)}},function(e,t,n){var r=n(678);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){var r=n(52),o=n(167),i=NaN,a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return i;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=u.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):s.test(e)?i:+e}},function(e,t,n){var r=n(680),o=n(683)(r);e.exports=o},function(e,t,n){var r=n(91),o=n(107),i=n(174),a=n(52);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?o(n)&&i(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},function(e,t,n){"use strict";(function(t,r){var o=n(178);e.exports=b;var i,a=n(355);b.ReadableState=y;n(238).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(391),c=n(48).Buffer,l=t.Uint8Array||function(){};var p=n(137);p.inherits=n(47);var f=n(686),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var d,m=n(687),v=n(392);p.inherits(b,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var r=t instanceof(i=i||n(86));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=n(394).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function b(e){if(i=i||n(86),!(this instanceof b))return new b(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function _(e,t,n,r,o){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,S(e)}(e,a)):(o||(i=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):k(e,a)):w(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function w(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&S(e)),k(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=c.from(e,t),t=""),n=!0),_(this,e,t,!1,n)},b.prototype.unshift=function(e){return _(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return d||(d=n(394).StringDecoder),this._readableState.decoder=new d(e),this._readableState.encoding=e,this};var x=8388608;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=x?e=x:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(C,e):C(e))}function C(e){h("emit readable"),e.emit("readable"),j(e)}function k(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(O,e,t))}function O(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function A(e){h("readable nexttick read 0"),e.read(0)}function T(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,o=n.data;e-=o.length;for(;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}b.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):S(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,o=t.needReadable;return h("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",o=!0),t.ended||t.reading?h("reading or ended",o=!1):o&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(n,t))),null===(r=e>0?P(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&I(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:b;function c(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",p),e.removeListener("error",v),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",b),n.removeListener("data",m),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function l(){h("onend"),e.end()}i.endEmitted?o.nextTick(u):n.once("end",u),e.on("unpipe",c);var p=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,j(e))}}(n);e.on("drain",p);var f=!1;var d=!1;function m(t){h("ondata"),d=!1,!1!==e.write(t)||d||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==N(i.pipes,e))&&!f&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function v(t){h("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){h("onfinish"),e.removeListener("close",g),b()}function b(){h("unpipe"),n.unpipe(e)}return n.on("data",m),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",n),i.flowing||(h("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,n);return this}var a=N(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},b.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&S(this):o.nextTick(A,this))}return n},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(T,e,t))}(this,e)),this},b.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",function(){if(h("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(h("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<g.length;i++)e.on(g[i],this.emit.bind(this,g[i]));return this._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=P}).call(this,n(36),n(67))},function(e,t,n){e.exports=n(238).EventEmitter},function(e,t,n){"use strict";var r=n(178);function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(689),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(36))},function(e,t,n){"use strict";var r=n(48).Buffer,o=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=p,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=a(t[r]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=0)return o>0&&(e.lastNeed=o-2),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(86),o=n(137);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);r.call(this,e),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,n){u(e,t,n)}):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}o.inherits=n(47),o.inherits(a,r),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";var r=n(87),o=Array.prototype.forEach,i=Object.create,a=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=i(null);return o.call(arguments,function(e){r(e)&&a(Object(e),t)}),t}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r=n(88);e.exports=function(e,t,n){var o;return isNaN(e)?(o=t)>=0?n&&o?o-1:o:1:!1!==e&&r(e)}},function(e,t,n){"use strict";e.exports=n(704)()?Object.assign:n(705)},function(e,t,n){"use strict";var r,o,i,a,s,u=n(88),c=function(e,t){return t};try{Object.defineProperty(c,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(e){}1===c.length?(r={configurable:!0,writable:!1,enumerable:!1},o=Object.defineProperty,e.exports=function(e,t){return t=u(t),e.length===t?e:(r.value=t,o(e,"length",r))}):(a=n(401),s=[],i=function(e){var t,n=0;if(s[e])return s[e];for(t=[];e--;)t.push("a"+(++n).toString(36));return new Function("fn","return function ("+t.join(", ")+") { return fn.apply(this, arguments); };")},e.exports=function(e,t){var n;if(t=u(t),e.length===t)return e;n=i(t)(e);try{a(n,e)}catch(e){}return n})},function(e,t,n){"use strict";var r=n(110),o=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;e.exports=function(e,t){var n,u=Object(r(t));if(e=Object(r(e)),a(u).forEach(function(r){try{o(e,r,i(t,r))}catch(e){n=e}}),"function"==typeof s&&s(u).forEach(function(r){try{o(e,r,i(t,r))}catch(e){n=e}}),void 0!==n)throw n;return e}},function(e,t,n){"use strict";var r=n(78),o=n(179),i=Function.prototype.call;e.exports=function(e,t){var n={},a=arguments[2];return r(t),o(e,function(e,r,o,s){n[r]=i.call(t,a,e,r,o,s)}),n}},function(e,t){e.exports=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}},function(e,t,n){var r=n(47),o=n(111),i=n(48).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function p(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(u,o),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,u=0|this._e,d=0|this._f,m=0|this._g,v=0|this._h,g=0;g<16;++g)n[g]=e.readInt32BE(4*g);for(;g<64;++g)n[g]=0|(((t=n[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[g-7]+h(n[g-15])+n[g-16];for(var y=0;y<64;++y){var b=v+f(u)+c(u,d,m)+a[y]+n[y]|0,_=p(r)+l(r,o,i)|0;v=m,m=d,d=u,u=s+b|0,s=i,i=o,o=r,r=b+_|0}this._a=r+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},u.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,n){var r=n(47),o=n(111),i=n(48).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}function c(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function p(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}r(u,o),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,o=0|this._ch,i=0|this._dh,s=0|this._eh,u=0|this._fh,y=0|this._gh,b=0|this._hh,_=0|this._al,w=0|this._bl,x=0|this._cl,E=0|this._dl,S=0|this._el,C=0|this._fl,k=0|this._gl,O=0|this._hl,A=0;A<32;A+=2)t[A]=e.readInt32BE(4*A),t[A+1]=e.readInt32BE(4*A+4);for(;A<160;A+=2){var T=t[A-30],j=t[A-30+1],P=h(T,j),I=d(j,T),M=m(T=t[A-4],j=t[A-4+1]),N=v(j,T),R=t[A-14],D=t[A-14+1],L=t[A-32],U=t[A-32+1],q=I+D|0,F=P+R+g(q,I)|0;F=(F=F+M+g(q=q+N|0,N)|0)+L+g(q=q+U|0,U)|0,t[A]=F,t[A+1]=q}for(var B=0;B<160;B+=2){F=t[B],q=t[B+1];var z=l(n,r,o),V=l(_,w,x),H=p(n,_),W=p(_,n),J=f(s,S),K=f(S,s),Y=a[B],$=a[B+1],G=c(s,u,y),Z=c(S,C,k),X=O+K|0,Q=b+J+g(X,O)|0;Q=(Q=(Q=Q+G+g(X=X+Z|0,Z)|0)+Y+g(X=X+$|0,$)|0)+F+g(X=X+q|0,q)|0;var ee=W+V|0,te=H+z+g(ee,W)|0;b=y,O=k,y=u,k=C,u=s,C=S,s=i+Q+g(S=E+X|0,E)|0,i=o,E=x,o=r,x=w,r=n,w=_,n=Q+te+g(_=X+ee|0,X)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+x|0,this._dl=this._dl+E|0,this._el=this._el+S|0,this._fl=this._fl+C|0,this._gl=this._gl+k|0,this._hl=this._hl+O|0,this._ah=this._ah+n+g(this._al,_)|0,this._bh=this._bh+r+g(this._bl,w)|0,this._ch=this._ch+o+g(this._cl,x)|0,this._dh=this._dh+i+g(this._dl,E)|0,this._eh=this._eh+s+g(this._el,S)|0,this._fh=this._fh+u+g(this._fl,C)|0,this._gh=this._gh+y+g(this._gl,k)|0,this._hh=this._hh+b+g(this._hl,O)|0},u.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,n){var r=n(46);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(102),o=n(34)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){"use strict";var r=n(49),o=n(133);e.exports=function(e,t,n){t in e?r.f(e,t,o(0,n)):e[t]=n}},function(e,t,n){var r=n(34)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t,n){var r=n(46),o=n(132),i=n(34)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},function(e,t,n){var r,o,i,a=n(63),s=n(776),u=n(351),c=n(217),l=n(32),p=l.process,f=l.setImmediate,h=l.clearImmediate,d=l.MessageChannel,m=l.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};f&&h||(f=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},r(v),v},h=function(e){delete g[e]},"process"==n(130)(p)?r=function(e){p.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:d?(i=(o=new d).port2,o.port1.onmessage=b,r=a(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:h}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(46),o=n(43),i=n(245);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(32),o=n(22),i=n(49),a=n(50),s=n(34)("species");e.exports=function(e){var t="function"==typeof o[e]?o[e]:r[e];a&&t&&!t[s]&&i.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(114);e.exports=new r({include:[n(416)]})},function(e,t,n){"use strict";var r=n(114);e.exports=new r({include:[n(246)],implicit:[n(788),n(789),n(790),n(791)]})},function(e,t,n){var r=n(184),o=n(108),i=n(174),a=n(52),s=n(109);e.exports=function(e,t,n,u){if(!a(e))return e;for(var c=-1,l=(t=o(t,e)).length,p=l-1,f=e;null!=f&&++c<l;){var h=s(t[c]),d=n;if(c!=p){var m=f[h];void 0===(d=u?u(m,h,f):void 0)&&(d=a(m)?m:i(t[c+1])?[]:{})}r(f,h,d),f=f[h]}return e}},function(e,t,n){var r=n(419);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(84),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t,n){e.exports=n(809)},function(e,t,n){e.exports=n(812)},function(e,t,n){"use strict";e.exports={hasCachedChildNodes:1}},function(e,t,n){"use strict";var r=n(21);n(15);e.exports=function(e,t){return null==t&&r("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}},function(e,t,n){"use strict";e.exports=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}},function(e,t,n){"use strict";var r=n(38),o=null;e.exports=function(){return!o&&r.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}},function(e,t,n){"use strict";var r=n(21);var o=n(90),i=(n(15),function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._callbacks=null,this._contexts=null,this._arg=t}return e.prototype.enqueue=function(e,t){this._callbacks=this._callbacks||[],this._callbacks.push(e),this._contexts=this._contexts||[],this._contexts.push(t)},e.prototype.notifyAll=function(){var e=this._callbacks,t=this._contexts,n=this._arg;if(e&&t){e.length!==t.length&&r("24"),this._callbacks=null,this._contexts=null;for(var o=0;o<e.length;o++)e[o].call(t[o],n);e.length=0,t.length=0}},e.prototype.checkpoint=function(){return this._callbacks?this._callbacks.length:0},e.prototype.rollback=function(e){this._callbacks&&this._contexts&&(this._callbacks.length=e,this._contexts.length=e)},e.prototype.reset=function(){this._callbacks=null,this._contexts=null},e.prototype.destructor=function(){this.reset()},e}());e.exports=o.addPoolingTo(i)},function(e,t,n){"use strict";e.exports={logTopLevelRenders:!1}},function(e,t,n){"use strict";var r=n(27);function o(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function i(e){return e._wrapperState.valueTracker}var a={_getTrackerFromNode:function(e){return i(r.getInstanceFromNode(e))},track:function(e){if(!i(e)){var t=r.getNodeFromInstance(e),n=o(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),s=""+t[n];t.hasOwnProperty(n)||"function"!=typeof a.get||"function"!=typeof a.set||(Object.defineProperty(t,n,{enumerable:a.enumerable,configurable:!0,get:function(){return a.get.call(this)},set:function(e){s=""+e,a.set.call(this,e)}}),function(e,t){e._wrapperState.valueTracker=t}(e,{getValue:function(){return s},setValue:function(e){s=""+e},stopTracking:function(){!function(e){e._wrapperState.valueTracker=null}(e),delete t[n]}}))}},updateValueIfChanged:function(e){if(!e)return!1;var t=i(e);if(!t)return a.track(e),!0;var n,s,u=t.getValue(),c=((n=r.getNodeFromInstance(e))&&(s=o(n)?""+n.checked:n.value),s);return c!==u&&(t.setValue(c),!0)},stopTracking:function(e){var t=i(e);t&&t.stopTracking()}};e.exports=a},function(e,t,n){"use strict";var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!r[e.type]:"textarea"===t}},function(e,t,n){"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};e.exports=r},function(e,t,n){"use strict";var r=n(38),o=n(188),i=n(187),a=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){3!==e.nodeType?i(e,o(t)):e.nodeValue=t})),e.exports=a},function(e,t,n){"use strict";e.exports=function(e){try{e.focus()}catch(e){}}},function(e,t,n){"use strict";var r={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};var o=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){o.forEach(function(t){r[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(t,e)]=r[e]})});var i={isUnitlessNumber:r,shorthandPropertyExpansions:{background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}}};e.exports=i},function(e,t,n){"use strict";var r=n(115),o=(n(27),n(53),n(843)),i=(n(23),new RegExp("^["+r.ATTRIBUTE_NAME_START_CHAR+"]["+r.ATTRIBUTE_NAME_CHAR+"]*$")),a={},s={};function u(e){return!!s.hasOwnProperty(e)||!a.hasOwnProperty(e)&&(i.test(e)?(s[e]=!0,!0):(a[e]=!0,!1))}function c(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&!1===t}var l={createMarkupForID:function(e){return r.ID_ATTRIBUTE_NAME+"="+o(e)},setAttributeForID:function(e,t){e.setAttribute(r.ID_ATTRIBUTE_NAME,t)},createMarkupForRoot:function(){return r.ROOT_ATTRIBUTE_NAME+'=""'},setAttributeForRoot:function(e){e.setAttribute(r.ROOT_ATTRIBUTE_NAME,"")},createMarkupForProperty:function(e,t){var n=r.properties.hasOwnProperty(e)?r.properties[e]:null;if(n){if(c(n,t))return"";var i=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&!0===t?i+'=""':i+"="+o(t)}return r.isCustomAttribute(e)?null==t?"":e+"="+o(t):null},createMarkupForCustomAttribute:function(e,t){return u(e)&&null!=t?e+"="+o(t):""},setValueForProperty:function(e,t,n){var o=r.properties.hasOwnProperty(t)?r.properties[t]:null;if(o){var i=o.mutationMethod;if(i)i(e,n);else{if(c(o,n))return void this.deleteValueForProperty(e,t);if(o.mustUseProperty)e[o.propertyName]=n;else{var a=o.attributeName,s=o.attributeNamespace;s?e.setAttributeNS(s,a,""+n):o.hasBooleanValue||o.hasOverloadedBooleanValue&&!0===n?e.setAttribute(a,""):e.setAttribute(a,""+n)}}}else if(r.isCustomAttribute(t))return void l.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){u(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForAttribute:function(e,t){e.removeAttribute(t)},deleteValueForProperty:function(e,t){var n=r.properties.hasOwnProperty(t)?r.properties[t]:null;if(n){var o=n.mutationMethod;if(o)o(e,void 0);else if(n.mustUseProperty){var i=n.propertyName;n.hasBooleanValue?e[i]=!1:e[i]=""}else e.removeAttribute(n.attributeName)}else r.isCustomAttribute(t)&&e.removeAttribute(t)}};e.exports=l},function(e,t,n){"use strict";var r=n(25),o=n(256),i=n(27),a=n(58),s=(n(23),!1);function u(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=o.getValue(e);null!=t&&c(this,Boolean(e.multiple),t)}}function c(e,t,n){var r,o,a=i.getNodeFromInstance(e).options;if(t){for(r={},o=0;o<n.length;o++)r[""+n[o]]=!0;for(o=0;o<a.length;o++){var s=r.hasOwnProperty(a[o].value);a[o].selected!==s&&(a[o].selected=s)}}else{for(r=""+n,o=0;o<a.length;o++)if(a[o].value===r)return void(a[o].selected=!0);a.length&&(a[0].selected=!0)}}var l={getHostProps:function(e,t){return r({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){var n=o.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,listeners:null,onChange:p.bind(e),wasMultiple:Boolean(t.multiple)},void 0===t.value||void 0===t.defaultValue||s||(s=!0)},getSelectValueContext:function(e){return e._wrapperState.initialValue},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var n=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var r=o.getValue(t);null!=r?(e._wrapperState.pendingUpdate=!1,c(e,Boolean(t.multiple),r)):n!==Boolean(t.multiple)&&(null!=t.defaultValue?c(e,Boolean(t.multiple),t.defaultValue):c(e,Boolean(t.multiple),t.multiple?[]:""))}};function p(e){var t=this._currentElement.props,n=o.executeOnChange(t,e);return this._rootNodeID&&(this._wrapperState.pendingUpdate=!0),a.asap(u,this),n}e.exports=l},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(852),a=n(438),s=n(439),u=(n(853),n(15),n(23),function(e){this.construct(e)});function c(e,t){var n;if(null===e||!1===e)n=a.create(c);else if("object"==typeof e){var o=e,i=o.type;if("function"!=typeof i&&"string"!=typeof i){var l="";0,l+=function(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}(o._owner),r("130",null==i?i:typeof i,l)}"string"==typeof o.type?n=s.createInternalComponent(o):!function(e){return"function"==typeof e&&void 0!==e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}(o.type)?n=new u(o):(n=new o.type(o)).getHostNode||(n.getHostNode=n.getNativeNode)}else"string"==typeof e||"number"==typeof e?n=s.createInstanceForText(e):r("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}o(u.prototype,i,{_instantiateReactComponent:c}),e.exports=c},function(e,t,n){"use strict";var r=n(21),o=n(104),i=(n(15),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||!1===e?i.EMPTY:o.isValidElement(e)?"function"==typeof e.type?i.COMPOSITE:i.HOST:void r("26",e)}});e.exports=i},function(e,t,n){"use strict";var r,o={injectEmptyComponentFactory:function(e){r=e}},i={create:function(e){return r(e)}};i.injection=o,e.exports=i},function(e,t,n){"use strict";var r=n(21),o=(n(15),null),i=null;var a={createInternalComponent:function(e){return o||r("111",e.type),new o(e)},createInstanceForText:function(e){return new i(e)},isTextComponent:function(e){return e instanceof i},injection:{injectGenericComponentClass:function(e){o=e},injectTextComponentClass:function(e){i=e}}};e.exports=a},function(e,t,n){"use strict";var r=n(21),o=(n(65),n(854)),i=n(855),a=(n(15),n(260)),s=(n(23),"."),u=":";function c(e,t){return e&&"object"==typeof e&&null!=e.key?a.escape(e.key):t.toString(36)}e.exports=function(e,t,n){return null==e?0:function e(t,n,l,p){var f,h=typeof t;if("undefined"!==h&&"boolean"!==h||(t=null),null===t||"string"===h||"number"===h||"object"===h&&t.$$typeof===o)return l(p,t,""===n?s+c(t,0):n),1;var d=0,m=""===n?s:n+u;if(Array.isArray(t))for(var v=0;v<t.length;v++)d+=e(f=t[v],m+c(f,v),l,p);else{var g=i(t);if(g){var y,b=g.call(t);if(g!==t.entries)for(var _=0;!(y=b.next()).done;)d+=e(f=y.value,m+c(f,_++),l,p);else for(;!(y=b.next()).done;){var w=y.value;w&&(d+=e(f=w[1],m+a.escape(w[0])+u+c(f,0),l,p))}}else if("object"===h){var x=String(t);r("31","[object Object]"===x?"object with keys {"+Object.keys(t).join(", ")+"}":x,"")}}return d}(e,"",t,n)}},function(e,t,n){"use strict";var r,o,i,a,s,u,c,l=n(136),p=n(65);n(15),n(23);function f(e){var t=Function.prototype.toString,n=Object.prototype.hasOwnProperty,r=RegExp("^"+t.call(n).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");try{var o=t.call(e);return r.test(o)}catch(e){return!1}}if("function"==typeof Array.from&&"function"==typeof Map&&f(Map)&&null!=Map.prototype&&"function"==typeof Map.prototype.keys&&f(Map.prototype.keys)&&"function"==typeof Set&&f(Set)&&null!=Set.prototype&&"function"==typeof Set.prototype.keys&&f(Set.prototype.keys)){var h=new Map,d=new Set;r=function(e,t){h.set(e,t)},o=function(e){return h.get(e)},i=function(e){h.delete(e)},a=function(){return Array.from(h.keys())},s=function(e){d.add(e)},u=function(e){d.delete(e)},c=function(){return Array.from(d.keys())}}else{var m={},v={},g=function(e){return"."+e},y=function(e){return parseInt(e.substr(1),10)};r=function(e,t){var n=g(e);m[n]=t},o=function(e){var t=g(e);return m[t]},i=function(e){var t=g(e);delete m[t]},a=function(){return Object.keys(m).map(y)},s=function(e){var t=g(e);v[t]=!0},u=function(e){var t=g(e);delete v[t]},c=function(){return Object.keys(v).map(y)}}var b=[];function _(e){var t=o(e);if(t){var n=t.childIDs;i(e),n.forEach(_)}}function w(e,t,n){return"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":n?" (created by "+n+")":"")}function x(e){return null==e?"#empty":"string"==typeof e||"number"==typeof e?"#text":"string"==typeof e.type?e.type:e.type.displayName||e.type.name||"Unknown"}function E(e){var t,n=S.getDisplayName(e),r=S.getElement(e),o=S.getOwnerID(e);return o&&(t=S.getDisplayName(o)),w(n,r&&r._source,t)}var S={onSetChildren:function(e,t){var n=o(e);n||l("144"),n.childIDs=t;for(var r=0;r<t.length;r++){var i=t[r],a=o(i);a||l("140"),null==a.childIDs&&"object"==typeof a.element&&null!=a.element&&l("141"),a.isMounted||l("71"),null==a.parentID&&(a.parentID=e),a.parentID!==e&&l("142",i,a.parentID,e)}},onBeforeMountComponent:function(e,t,n){r(e,{element:t,parentID:n,text:null,childIDs:[],isMounted:!1,updateCount:0})},onBeforeUpdateComponent:function(e,t){var n=o(e);n&&n.isMounted&&(n.element=t)},onMountComponent:function(e){var t=o(e);t||l("144"),t.isMounted=!0,0===t.parentID&&s(e)},onUpdateComponent:function(e){var t=o(e);t&&t.isMounted&&t.updateCount++},onUnmountComponent:function(e){var t=o(e);t&&(t.isMounted=!1,0===t.parentID&&u(e));b.push(e)},purgeUnmountedComponents:function(){if(!S._preventPurging){for(var e=0;e<b.length;e++){_(b[e])}b.length=0}},isMounted:function(e){var t=o(e);return!!t&&t.isMounted},getCurrentStackAddendum:function(e){var t="";if(e){var n=x(e),r=e._owner;t+=w(n,e._source,r&&r.getName())}var o=p.current,i=o&&o._debugID;return t+=S.getStackAddendumByID(i)},getStackAddendumByID:function(e){for(var t="";e;)t+=E(e),e=S.getParentID(e);return t},getChildIDs:function(e){var t=o(e);return t?t.childIDs:[]},getDisplayName:function(e){var t=S.getElement(e);return t?x(t):null},getElement:function(e){var t=o(e);return t?t.element:null},getOwnerID:function(e){var t=S.getElement(e);return t&&t._owner?t._owner._debugID:null},getParentID:function(e){var t=o(e);return t?t.parentID:null},getSource:function(e){var t=o(e),n=t?t.element:null;return null!=n?n._source:null},getText:function(e){var t=S.getElement(e);return"string"==typeof t?t:"number"==typeof t?""+t:null},getUpdateCount:function(e){var t=o(e);return t?t.updateCount:0},getRootIDs:c,getRegisteredIDs:a,pushNonStandardWarningStack:function(e,t){if("function"==typeof console.reactStack){var n=[],r=p.current,o=r&&r._debugID;try{for(e&&n.push({name:o?S.getDisplayName(o):null,fileName:t?t.fileName:null,lineNumber:t?t.lineNumber:null});o;){var i=S.getElement(o),a=S.getParentID(o),s=S.getOwnerID(o),u=s?S.getDisplayName(s):null,c=i&&i._source;n.push({name:u,fileName:c?c.fileName:null,lineNumber:c?c.lineNumber:null}),o=a}}catch(e){}console.reactStack(n)}},popNonStandardWarningStack:function(){"function"==typeof console.reactStackEnd&&console.reactStackEnd()}};e.exports=S},function(e,t,n){"use strict";var r=n(57),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=o},function(e,t,n){"use strict";var r=n(867),o=n(869),i=n(432),a=n(444);var s={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=a();return{focusedElem:e,selectionRange:s.hasSelectionCapabilities(e)?s.getSelection(e):null}},restoreSelection:function(e){var t,n=a(),r=e.focusedElem,u=e.selectionRange;n!==r&&(t=r,o(document.documentElement,t))&&(s.hasSelectionCapabilities(r)&&s.setSelection(r,u),i(r))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if(void 0===o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",o-n),i.select()}else r.setOffsets(e,t)}};e.exports=s},function(e,t,n){"use strict";e.exports=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}},function(e,t,n){"use strict";var r=n(21),o=n(117),i=n(115),a=n(104),s=n(189),u=(n(65),n(27)),c=n(884),l=n(885),p=n(427),f=n(143),h=(n(53),n(886)),d=n(116),m=n(261),v=n(58),g=n(165),y=n(436),b=(n(15),n(187)),_=n(259),w=(n(23),i.ID_ATTRIBUTE_NAME),x=i.ROOT_ATTRIBUTE_NAME,E=1,S=9,C=11,k={};function O(e){return e?e.nodeType===S?e.documentElement:e.firstChild:null}function A(e,t,n,r,o){var i;if(p.logTopLevelRenders){var a=e._currentElement.props.child.type;i="React mount: "+("string"==typeof a?a:a.displayName||a.name),console.time(i)}var s=d.mountComponent(e,n,null,c(e,t),o,0);i&&console.timeEnd(i),e._renderedComponent._topLevelWrapper=e,D._mountImageIntoNode(s,t,e,r,n)}function T(e,t,n,r){var o=v.ReactReconcileTransaction.getPooled(!n&&l.useCreateElement);o.perform(A,null,e,t,o,n,r),v.ReactReconcileTransaction.release(o)}function j(e,t,n){for(0,d.unmountComponent(e,n),t.nodeType===S&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function P(e){var t=O(e);if(t){var n=u.getInstanceFromNode(t);return!(!n||!n._hostParent)}}function I(e){return!(!e||e.nodeType!==E&&e.nodeType!==S&&e.nodeType!==C)}function M(e){var t=function(e){var t=O(e),n=t&&u.getInstanceFromNode(t);return n&&!n._hostParent?n:null}(e);return t?t._hostContainerInfo._topLevelWrapper:null}var N=1,R=function(){this.rootID=N++};R.prototype.isReactComponent={},R.prototype.render=function(){return this.props.child},R.isReactTopLevelWrapper=!0;var D={TopLevelWrapper:R,_instancesByReactRootID:k,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r,o){return D.scrollMonitor(r,function(){m.enqueueElementInternal(e,t,n),o&&m.enqueueCallbackInternal(e,o)}),e},_renderNewRootComponent:function(e,t,n,o){I(t)||r("37"),s.ensureScrollValueMonitoring();var i=y(e,!1);v.batchedUpdates(T,i,t,n,o);var a=i._instance.rootID;return k[a]=i,i},renderSubtreeIntoContainer:function(e,t,n,o){return null!=e&&f.has(e)||r("38"),D._renderSubtreeIntoContainer(e,t,n,o)},_renderSubtreeIntoContainer:function(e,t,n,o){m.validateCallback(o,"ReactDOM.render"),a.isValidElement(t)||r("39","string"==typeof t?" Instead of passing a string like 'div', pass React.createElement('div') or <div />.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var i,s=a.createElement(R,{child:t});if(e){var u=f.get(e);i=u._processChildContext(u._context)}else i=g;var c=M(n);if(c){var l=c._currentElement.props.child;if(_(l,t)){var p=c._renderedComponent.getPublicInstance(),h=o&&function(){o.call(p)};return D._updateRootComponent(c,s,i,n,h),p}D.unmountComponentAtNode(n)}var d,v=O(n),y=v&&!(!(d=v).getAttribute||!d.getAttribute(w)),b=P(n),x=y&&!c&&!b,E=D._renderNewRootComponent(s,n,x,i)._renderedComponent.getPublicInstance();return o&&o.call(E),E},render:function(e,t,n){return D._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){I(e)||r("40");var t=M(e);if(!t){P(e),1===e.nodeType&&e.hasAttribute(x);return!1}return delete k[t._instance.rootID],v.batchedUpdates(j,t,e,!1),!0},_mountImageIntoNode:function(e,t,n,i,a){if(I(t)||r("41"),i){var s=O(t);if(h.canReuseMarkup(e,s))return void u.precacheNode(n,s);var c=s.getAttribute(h.CHECKSUM_ATTR_NAME);s.removeAttribute(h.CHECKSUM_ATTR_NAME);var l=s.outerHTML;s.setAttribute(h.CHECKSUM_ATTR_NAME,c);var p=e,f=function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}(p,l),d=" (client) "+p.substring(f-20,f+20)+"\n (server) "+l.substring(f-20,f+20);t.nodeType===S&&r("42",d)}if(t.nodeType===S&&r("43"),a.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);o.insertTreeBefore(t,e,null)}else b(t,e),u.precacheNode(n,t.firstChild)}};e.exports=D},function(e,t,n){"use strict";var r=n(437);e.exports=function(e){for(var t;(t=e._renderedNodeType)===r.COMPOSITE;)e=e._renderedComponent;return t===r.HOST?e._renderedComponent:t===r.EMPTY?null:void 0}},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(10),i=(r=o)&&r.__esModule?r:{default:r};t.default=i.default.shape({subscribe:i.default.func.isRequired,dispatch:i.default.func.isRequired,getState:i.default.func.isRequired})},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}},function(e,t,n){var r=n(228),o=n(898),i=n(184),a=n(899),s=n(900),u=n(903),c=n(904),l=n(905),p=n(906),f=n(377),h=n(452),d=n(176),m=n(907),v=n(908),g=n(913),y=n(37),b=n(232),_=n(915),w=n(52),x=n(917),E=n(85),S=1,C=2,k=4,O="[object Arguments]",A="[object Function]",T="[object GeneratorFunction]",j="[object Object]",P={};P[O]=P["[object Array]"]=P["[object ArrayBuffer]"]=P["[object DataView]"]=P["[object Boolean]"]=P["[object Date]"]=P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Map]"]=P["[object Number]"]=P[j]=P["[object RegExp]"]=P["[object Set]"]=P["[object String]"]=P["[object Symbol]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P["[object Error]"]=P[A]=P["[object WeakMap]"]=!1,e.exports=function e(t,n,I,M,N,R){var D,L=n&S,U=n&C,q=n&k;if(I&&(D=N?I(t,M,N,R):I(t)),void 0!==D)return D;if(!w(t))return t;var F=y(t);if(F){if(D=m(t),!L)return c(t,D)}else{var B=d(t),z=B==A||B==T;if(b(t))return u(t,L);if(B==j||B==O||z&&!N){if(D=U||z?{}:g(t),!L)return U?p(t,s(D,t)):l(t,a(D,t))}else{if(!P[B])return N?t:{};D=v(t,B,L)}}R||(R=new r);var V=R.get(t);if(V)return V;R.set(t,D),x(t)?t.forEach(function(r){D.add(e(r,n,I,r,t,R))}):_(t)&&t.forEach(function(r,o){D.set(o,e(r,n,I,o,t,R))});var H=q?U?h:f:U?keysIn:E,W=F?void 0:H(t);return o(W||t,function(r,o){W&&(r=t[o=r]),i(D,o,e(r,n,I,o,t,R))}),D}},function(e,t,n){var r=n(380),o=n(901),i=n(107);e.exports=function(e){return i(e)?r(e,!0):o(e)}},function(e,t,n){var r=n(229),o=n(265),i=n(230),a=n(379),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},function(e,t,n){var r=n(378),o=n(451),i=n(450);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(923),o=n(454),i=n(455);e.exports=function(e){return i(o(e,void 0,r),e+"")}},function(e,t,n){var r=n(926),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),u=Array(s);++a<s;)u[a]=i[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=i[a];return c[t]=n(u),r(e,this,c)}}},function(e,t,n){var r=n(927),o=n(929)(r);e.exports=o},function(e,t,n){var r={strict:!0},o=n(940),i=function(e,t){return o(e,t,r)},a=n(267);t.JsonPatchError=a.PatchError,t.deepClone=a._deepClone;var s={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=c(n,this.path);r&&(r=a._deepClone(r));var o=l(n,{op:"remove",path:this.from}).removed;return l(n,{op:"add",path:this.path,value:o}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=c(n,this.from);return l(n,{op:"add",path:this.path,value:a._deepClone(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:i(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},u={add:function(e,t,n){return a.isInteger(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:s.move,copy:s.copy,test:s.test,_get:s._get};function c(e,t){if(""==t)return e;var n={op:"_get",path:t};return l(e,n),n.value}function l(e,n,r,o,l,p){if(void 0===r&&(r=!1),void 0===o&&(o=!0),void 0===l&&(l=!0),void 0===p&&(p=0),r&&("function"==typeof r?r(n,0,e,n.path):f(n,0)),""===n.path){var h={newDocument:e};if("add"===n.op)return h.newDocument=n.value,h;if("replace"===n.op)return h.newDocument=n.value,h.removed=e,h;if("move"===n.op||"copy"===n.op)return h.newDocument=c(e,n.from),"move"===n.op&&(h.removed=e),h;if("test"===n.op){if(h.test=i(e,n.value),!1===h.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",p,n,e);return h.newDocument=e,h}if("remove"===n.op)return h.removed=e,h.newDocument=null,h;if("_get"===n.op)return n.value=e,h;if(r)throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",p,n,e);return h}o||(e=a._deepClone(e));var d=(n.path||"").split("/"),m=e,v=1,g=d.length,y=void 0,b=void 0,_=void 0;for(_="function"==typeof r?r:f;;){if(b=d[v],l&&"__proto__"==b)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===y&&(void 0===m[b]?y=d.slice(0,v).join("/"):v==g-1&&(y=n.path),void 0!==y&&_(n,0,e,y)),v++,Array.isArray(m)){if("-"===b)b=m.length;else{if(r&&!a.isInteger(b))throw new t.JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",p,n,e);a.isInteger(b)&&(b=~~b)}if(v>=g){if(r&&"add"===n.op&&b>m.length)throw new t.JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",p,n,e);if(!1===(h=u[n.op].call(n,m,b,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",p,n,e);return h}}else if(b&&-1!=b.indexOf("~")&&(b=a.unescapePathComponent(b)),v>=g){if(!1===(h=s[n.op].call(n,m,b,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",p,n,e);return h}m=m[b]}}function p(e,n,r,o,i){if(void 0===o&&(o=!0),void 0===i&&(i=!0),r&&!Array.isArray(n))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");o||(e=a._deepClone(e));for(var s=new Array(n.length),u=0,c=n.length;u<c;u++)s[u]=l(e,n[u],r,!0,i,u),e=s[u].newDocument;return s.newDocument=e,s}function f(e,n,r,o){if("object"!=typeof e||null===e||Array.isArray(e))throw new t.JsonPatchError("Operation is not an object","OPERATION_NOT_AN_OBJECT",n,e,r);if(!s[e.op])throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",n,e,r);if("string"!=typeof e.path)throw new t.JsonPatchError("Operation `path` property is not a string","OPERATION_PATH_INVALID",n,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new t.JsonPatchError('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",n,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new t.JsonPatchError("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",n,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",n,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&a.hasUndefined(e.value))throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",n,e,r);if(r)if("add"==e.op){var i=e.path.split("/").length,u=o.split("/").length;if(i!==u+1&&i!==u)throw new t.JsonPatchError("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",n,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==o)throw new t.JsonPatchError("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",n,e,r)}else if("move"===e.op||"copy"===e.op){var c=h([{op:"_get",path:e.from,value:void 0}],r);if(c&&"OPERATION_PATH_UNRESOLVABLE"===c.name)throw new t.JsonPatchError("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",n,e,r)}}function h(e,n,r){try{if(!Array.isArray(e))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(n)p(a._deepClone(n),a._deepClone(e),r||!0);else{r=r||f;for(var o=0;o<e.length;o++)r(e[o],o,n,void 0)}}catch(e){if(e instanceof t.JsonPatchError)return e;throw e}}t.getValueByPointer=c,t.applyOperation=l,t.applyPatch=p,t.applyReducer=function(e,n,r){var o=l(e,n);if(!1===o.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",r,n,e);return o.newDocument},t.validator=f,t.validate=h},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o=Array.isArray,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],s=Object.keys(a),u=0;u<s.length;++u){var c=s[u],l=a[c];"object"==typeof l&&null!==l&&-1===n.indexOf(l)&&(t.push({obj:a,prop:c}),n.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n){if(0===e.length)return e;var r="string"==typeof e?e:String(e);if("iso-8859-1"===n)return escape(r).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var o="",a=0;a<r.length;++a){var s=r.charCodeAt(a);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?o+=r.charAt(a):s<128?o+=i[s]:s<2048?o+=i[192|s>>6]+i[128|63&s]:s<55296||s>=57344?o+=i[224|s>>12]+i[128|s>>6&63]+i[128|63&s]:(a+=1,s=65536+((1023&s)<<10|1023&r.charCodeAt(a)),o+=i[240|s>>18]+i[128|s>>12&63]+i[128|s>>6&63]+i[128|63&s])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,i){if(!n)return t;if("object"!=typeof n){if(o(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(i&&(i.plainObjects||i.allowPrototypes)||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var s=t;return o(t)&&!o(n)&&(s=a(t,i)),o(t)&&o(n)?(n.forEach(function(n,o){if(r.call(t,o)){var a=t[o];a&&"object"==typeof a&&n&&"object"==typeof n?t[o]=e(a,n,i):t.push(n)}else t[o]=n}),t):Object.keys(n).reduce(function(t,o){var a=n[o];return r.call(t,o)?t[o]=e(t[o],a,i):t[o]=a,t},s)}}},function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){"use strict";var r=n(32),o=n(30),i=n(135),a=n(82),s=n(77),u=n(182),c=n(112),l=n(181),p=n(43),f=n(134),h=n(49).f,d=n(268)(0),m=n(50);e.exports=function(e,t,n,v,g,y){var b=r[e],_=b,w=g?"set":"add",x=_&&_.prototype,E={};return m&&"function"==typeof _&&(y||x.forEach&&!a(function(){(new _).entries().next()}))?(_=t(function(t,n){l(t,_,e,"_c"),t._c=new b,null!=n&&c(n,g,t[w],t)}),d("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in x&&(!y||"clear"!=e)&&s(_.prototype,e,function(n,r){if(l(this,_,e),!t&&y&&!p(n))return"get"==e&&void 0;var o=this._c[e](0===n?0:n,r);return t?this:o})}),y||h(_.prototype,"size",{get:function(){return this._c.size}})):(_=v.getConstructor(t,e,g,w),u(_.prototype,n),i.NEED=!0),f(_,e),E[e]=_,o(o.G+o.W+o.F,E),y||v.setStrong(_,e,g),_}},function(e,t,n){"use strict";var r=n(30);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){"use strict";var r=n(30),o=n(132),i=n(63),a=n(112);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,s,u=arguments[1];return o(this),(t=void 0!==u)&&o(u),null==e?new this:(n=[],t?(r=0,s=i(u,arguments[2],2),a(e,!1,function(e){n.push(s(e,r++))})):a(e,!1,n.push,n),new this(n))}})}},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwcHgiICBoZWlnaHQ9IjIwMHB4IiAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiIGNsYXNzPSJsZHMtcm9sbGluZyIgc3R5bGU9ImJhY2tncm91bmQtaW1hZ2U6IG5vbmU7IGJhY2tncm91bmQtcG9zaXRpb246IGluaXRpYWwgaW5pdGlhbDsgYmFja2dyb3VuZC1yZXBlYXQ6IGluaXRpYWwgaW5pdGlhbDsiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIGZpbGw9Im5vbmUiIG5nLWF0dHItc3Ryb2tlPSJ7e2NvbmZpZy5jb2xvcn19IiBuZy1hdHRyLXN0cm9rZS13aWR0aD0ie3tjb25maWcud2lkdGh9fSIgbmctYXR0ci1yPSJ7e2NvbmZpZy5yYWRpdXN9fSIgbmctYXR0ci1zdHJva2UtZGFzaGFycmF5PSJ7e2NvbmZpZy5kYXNoYXJyYXl9fSIgc3Ryb2tlPSIjNTU1NTU1IiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij48YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgY2FsY01vZGU9ImxpbmVhciIgdmFsdWVzPSIwIDUwIDUwOzM2MCA1MCA1MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49IjBzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlVHJhbnNmb3JtPjwvY2lyY2xlPjwvc3ZnPgo="},function(e,t,n){"use strict";e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",GT:">",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},function(e,t,n){"use strict";var r=n(465),o=n(39).unescapeMd;e.exports=function(e,t){var n,i,a,s=t,u=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t<u;){if(10===(n=e.src.charCodeAt(t)))return!1;if(62===n)return a=r(o(e.src.slice(s+1,t))),!!e.parser.validateLink(a)&&(e.pos=t+1,e.linkContent=a,!0);92===n&&t+1<u?t+=2:t++}return!1}for(i=0;t<u&&32!==(n=e.src.charCodeAt(t))&&!(n<32||127===n);)if(92===n&&t+1<u)t+=2;else{if(40===n&&++i>1)break;if(41===n&&--i<0)break;t++}return s!==t&&(a=o(e.src.slice(s,t)),!!e.parser.validateLink(a)&&(e.linkContent=a,e.pos=t,!0))}},function(e,t,n){"use strict";var r=n(39).replaceEntities;e.exports=function(e){var t=r(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}},function(e,t,n){"use strict";var r=n(39).unescapeMd;e.exports=function(e,t){var n,o=t,i=e.posMax,a=e.src.charCodeAt(t);if(34!==a&&39!==a&&40!==a)return!1;for(t++,40===a&&(a=41);t<i;){if((n=e.src.charCodeAt(t))===a)return e.pos=t+1,e.linkContent=r(e.src.slice(o+1,t)),!0;92===n&&t+1<i?t+=2:t++}return!1}},function(e,t,n){"use strict";e.exports=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(36))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineReducers=void 0;var r,o=n(593),i=(r=o)&&r.__esModule?r:{default:r};t.combineReducers=i.default},function(e,t,n){"use strict";var r=/^(%20|\s)*(javascript|data)/im,o=/[^\x20-\x7E]/gim,i=/^([^:]+):/gm,a=[".","/"];e.exports={sanitizeUrl:function(e){if(!e)return"about:blank";var t,n,s=e.replace(o,"").trim();return function(e){return a.indexOf(e[0])>-1}(s)?s:(n=s.match(i))?(t=n[0],r.test(t)?"about:blank":s):"about:blank"}}},function(e,t,n){var r=n(602),o=n(610)(function(e,t,n){return t=t.toLowerCase(),e+(n?r(t):t)});e.exports=o},function(e,t,n){var r=n(375),o=n(172),i=n(679),a=n(37),s=n(389);e.exports=function(e,t,n){var u=a(e)?r:i;return n&&s(e,t,n)&&(t=void 0),u(e,o(t,3))}},function(e,t,n){(function(t){var r=n(684),o=n(685).Stream,i=" ";function a(e,t,n){n=n||0;var o,i,s=(o=t,new Array(n||0).join(o||"")),u=e;if("object"==typeof e&&((u=e[i=Object.keys(e)[0]])&&u._elem))return u._elem.name=i,u._elem.icount=n,u._elem.indent=t,u._elem.indents=s,u._elem.interrupt=u,u._elem;var c,l=[],p=[];function f(e){Object.keys(e).forEach(function(t){l.push(function(e,t){return e+'="'+r(t)+'"'}(t,e[t]))})}switch(typeof u){case"object":if(null===u)break;u._attr&&f(u._attr),u._cdata&&p.push(("<![CDATA["+u._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),u.forEach&&(c=!1,p.push(""),u.forEach(function(e){"object"==typeof e?"_attr"==Object.keys(e)[0]?f(e._attr):p.push(a(e,t,n+1)):(p.pop(),c=!0,p.push(r(e)))}),c||p.push(""));break;default:p.push(r(u))}return{name:i,interrupt:!1,attributes:l,content:p,icount:n,indents:s,indent:t}}function s(e,t,n){if("object"!=typeof t)return e(!1,t);var r=t.interrupt?1:t.content.length;function o(){for(;t.content.length;){var o=t.content.shift();if(void 0!==o){if(i(o))return;s(e,o)}}e(!1,(r>1?t.indents:"")+(t.name?"</"+t.name+">":"")+(t.indent&&!n?"\n":"")),n&&n()}function i(t){return!!t.interrupt&&(t.interrupt.append=e,t.interrupt.end=o,t.interrupt=!1,e(!0),!0)}if(e(!1,t.indents+(t.name?"<"+t.name:"")+(t.attributes.length?" "+t.attributes.join(" "):"")+(r?t.name?">":"":t.name?"/>":"")+(t.indent&&r>1?"\n":"")),!r)return e(!1,t.indent?"\n":"");i(t)||o()}e.exports=function(e,n){"object"!=typeof n&&(n={indent:n});var r,u,c=n.stream?new o:null,l="",p=!1,f=n.indent?!0===n.indent?i:n.indent:"",h=!0;function d(e){h?t.nextTick(e):e()}function m(e,t){if(void 0!==t&&(l+=t),e&&!p&&(c=c||new o,p=!0),e&&p){var n=l;d(function(){c.emit("data",n)}),l=""}}function v(e,t){s(m,a(e,f,f?1:0),t)}function g(){if(c){var e=l;d(function(){c.emit("data",e),c.emit("end"),c.readable=!1,c.emit("close")})}}return d(function(){h=!1}),n.declaration&&(r=n.declaration,u={version:"1.0",encoding:r.encoding||"UTF-8"},r.standalone&&(u.standalone=r.standalone),v({"?xml":{_attr:u}}),l=l.replace("/>","?>")),e&&e.forEach?e.forEach(function(t,n){var r;n+1===e.length&&(r=g),v(t,r)}):v(e,g),c?(c.readable=!0,c):l},e.exports.element=e.exports.Element=function(){var e={_elem:a(Array.prototype.slice.call(arguments)),push:function(e){if(!this.append)throw new Error("not assigned to a parent!");var t=this,n=this._elem.indent;s(this.append,a(e,n,this._elem.icount+(n?1:0)),function(){t.append(!0)})},close:function(e){void 0!==e&&this.push(e),this.end&&this.end()}};return e}}).call(this,n(67))},function(e,t,n){(function(t){var n;n=void 0!==t?t:this,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),r=n.length,o=-1,i="",a=n.charCodeAt(0);++o<r;)0!=(t=n.charCodeAt(o))?i+=t>=1&&t<=31||127==t||0==o&&t>=48&&t<=57||1==o&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==o&&1==r&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(o):n.charAt(o):i+="�";return i};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(n)}).call(this,n(36))},function(e,t,n){"use strict";(function(t,r){var o=65536,i=4294967295;var a=n(48).Buffer,s=t.crypto||t.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>i)throw new RangeError("requested too many random bytes");var n=a.allocUnsafe(e);if(e>0)if(e>o)for(var u=0;u<e;u+=o)s.getRandomValues(n.slice(u,u+o));else s.getRandomValues(n);if("function"==typeof t)return r.nextTick(function(){t(null,n)});return n}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,n(36),n(67))},function(e,t,n){(t=e.exports=function(e){e=e.toLowerCase();var n=t[e];if(!n)throw new Error(e+" is not supported (we accept pull requests)");return new n}).sha=n(749),t.sha1=n(750),t.sha224=n(751),t.sha256=n(404),t.sha384=n(752),t.sha512=n(405)},function(e,t,n){var r=n(370),o=n(388),i=n(172),a=n(753),s=n(37);e.exports=function(e,t,n){var u=s(e)?r:a,c=arguments.length<3;return u(e,i(t,4),n,c,o)}},function(e,t,n){var r=n(52),o=n(805),i=n(387),a="Expected a function",s=Math.max,u=Math.min;e.exports=function(e,t,n){var c,l,p,f,h,d,m=0,v=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError(a);function b(t){var n=c,r=l;return c=l=void 0,m=t,f=e.apply(r,n)}function _(e){var n=e-d;return void 0===d||n>=t||n<0||g&&e-m>=p}function w(){var e=o();if(_(e))return x(e);h=setTimeout(w,function(e){var n=t-(e-d);return g?u(n,p-(e-m)):n}(e))}function x(e){return h=void 0,y&&c?b(e):(c=l=void 0,f)}function E(){var e=o(),n=_(e);if(c=arguments,l=this,d=e,n){if(void 0===h)return function(e){return m=e,h=setTimeout(w,t),v?b(e):f}(d);if(g)return clearTimeout(h),h=setTimeout(w,t),b(d)}return void 0===h&&(h=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(v=!!n.leading,p=(g="maxWait"in n)?s(i(n.maxWait)||0,t):p,y="trailing"in n?!!n.trailing:y),E.cancel=function(){void 0!==h&&clearTimeout(h),m=0,c=d=l=h=void 0},E.flush=function(){return void 0===h?f:x(o())},E}},function(e,t,n){"use strict";e.exports=n(815)},function(e,t,n){var r=n(367),o=n(449),i=n(919),a=n(108),s=n(118),u=n(922),c=n(453),l=n(452),p=c(function(e,t){var n={};if(null==e)return n;var c=!1;t=r(t,function(t){return t=a(t,e),c||(c=t.length>1),t}),s(e,l(e),n),c&&(n=o(n,7,u));for(var p=t.length;p--;)i(n,t[p]);return n});e.exports=p},function(e,t,n){var r,o,i;o=[],r=function(){"use strict";var e=function(e){return e&&"getComputedStyle"in window&&"smooth"===window.getComputedStyle(e)["scroll-behavior"]};if("undefined"==typeof window||!("document"in window))return{};var t=function(t,n,r){var o;n=n||999,r||0===r||(r=9);var i=function(e){o=e},a=function(){clearTimeout(o),i(0)},s=function(e){return Math.max(0,t.getTopOf(e)-r)},u=function(r,o,s){if(a(),0===o||o&&o<0||e(t.body))t.toY(r),s&&s();else{var u=t.getY(),c=Math.max(0,r)-u,l=(new Date).getTime();o=o||Math.min(Math.abs(c),n),function e(){i(setTimeout(function(){var n=Math.min(1,((new Date).getTime()-l)/o),r=Math.max(0,Math.floor(u+c*(n<.5?2*n*n:n*(4-2*n)-1)));t.toY(r),n<1&&t.getHeight()+r<t.body.scrollHeight?e():(setTimeout(a,99),s&&s())},9))}()}},c=function(e,t,n){u(s(e),t,n)};return{setup:function(e,t){return(0===e||e)&&(n=e),(0===t||t)&&(r=t),{defaultDuration:n,edgeOffset:r}},to:c,toY:u,intoView:function(e,n,o){var i=e.getBoundingClientRect().height,a=t.getTopOf(e)+i,l=t.getHeight(),p=t.getY(),f=p+l;s(e)<p||i+r>l?c(e,n,o):a+r>f?u(a-l+r,n,o):o&&o()},center:function(e,n,r,o){u(Math.max(0,t.getTopOf(e)-t.getHeight()/2+(r||e.getBoundingClientRect().height/2)),n,o)},stop:a,moving:function(){return!!o},getY:t.getY,getTopOf:t.getTopOf}},n=document.documentElement,r=function(){return window.scrollY||n.scrollTop},o=t({body:document.scrollingElement||document.body,toY:function(e){window.scrollTo(0,e)},getY:r,getHeight:function(){return window.innerHeight||n.clientHeight},getTopOf:function(e){return e.getBoundingClientRect().top+r()-n.offsetTop}});if(o.createScroller=function(e,r,o){return t({body:e,toY:function(t){e.scrollTop=t},getY:function(){return e.scrollTop},getHeight:function(){return Math.min(e.clientHeight,window.innerHeight||n.clientHeight)},getTopOf:function(e){return e.offsetTop}},r,o)},"addEventListener"in window&&!window.noZensmooth&&!e(document.body)){var i="history"in window&&"pushState"in history,a=i&&"scrollRestoration"in history;a&&(history.scrollRestoration="auto"),window.addEventListener("load",function(){a&&(setTimeout(function(){history.scrollRestoration="manual"},9),window.addEventListener("popstate",function(e){e.state&&"zenscrollY"in e.state&&o.toY(e.state.zenscrollY)},!1)),window.location.hash&&setTimeout(function(){var e=o.setup().edgeOffset;if(e){var t=document.getElementById(window.location.href.split("#")[1]);if(t){var n=Math.max(0,o.getTopOf(t)-e),r=o.getY()-n;0<=r&&r<9&&window.scrollTo(0,n)}}},9)},!1);var s=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",function(e){for(var t=e.target;t&&"A"!==t.tagName;)t=t.parentNode;if(!(!t||1!==e.which||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)){if(a){var n=history.state&&"object"==typeof history.state?history.state:{};n.zenscrollY=o.getY();try{history.replaceState(n,"")}catch(e){}}var r=t.getAttribute("href")||"";if(0===r.indexOf("#")&&!s.test(t.className)){var u=0,c=document.getElementById(r.substring(1));if("#"!==r){if(!c)return;u=o.getTopOf(c)}e.preventDefault();var l=function(){window.location=r},p=o.setup().edgeOffset;p&&(u=Math.max(0,u-p),i&&(l=function(){history.pushState({},"",r)})),o.toY(u,null,l)}}},!1)}return o}(),void 0===(i="function"==typeof r?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){e.exports=n(971)},function(e,t){e.exports=function(e,t,n){var r=new Blob([e],{type:n||"application/octet-stream"});if(void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(r,t);else{var o=window.URL.createObjectURL(r),i=document.createElement("a");i.style.display="none",i.href=o,i.setAttribute("download",t),void 0===i.download&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(o)}}},function(e,t,n){"use strict";var r=n(979),o=function(e){return e.split(/(<\/?[^>]+>)/g).filter(function(e){return""!==e.trim()})},i=function(e){return/<\/+[^>]+>/.test(e)},a=function(e){return/<[^>]+\/>/.test(e)},s=function(e){return function(e){return/<[^>!]+>/.test(e)}(e)&&!i(e)&&!a(e)};function u(e){return o(e).map(function(e){return{value:e,type:c(e)}})}function c(e){return i(e)?"ClosingTag":s(e)?"OpeningTag":a(e)?"SelfClosingTag":"Text"}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.indentor,o=t.textNodesOnSameLine,i=0,a=[];n=n||" ";var s=u(e).map(function(e,t,s){var u=e.value,c=e.type;"ClosingTag"===c&&i--;var l=r(n,i),p=l+u;if("OpeningTag"===c&&i++,o){var f=s[t-1],h=s[t-2];"ClosingTag"===c&&"Text"===f.type&&"OpeningTag"===h.type&&(p=""+l+h.value+f.value+u,a.push(t-2,t-1))}return p});return a.forEach(function(e){return s[e]=null}),s.filter(function(e){return!!e}).join("\n")}},function(e,t,n){var r=n(69);e.exports=function(e){return r(e).toLowerCase()}},function(e,t,n){"use strict";var r=n(1031).DebounceInput;r.DebounceInput=r,e.exports=r},function(e,t,n){n(489),e.exports=n(1034)},function(e,t,n){"use strict";n.r(t);var r=n(18);void 0===n.n(r).a.Promise&&n(490),String.prototype.startsWith||n(520)},function(e,t,n){n(491),n(337),n(502),n(506),n(518),n(519),e.exports=n(72).Promise},function(e,t,n){"use strict";var r=n(150),o={};o[n(33)("toStringTag")]="z",o+""!="[object z]"&&n(97)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){e.exports=!n(126)&&!n(99)(function(){return 7!=Object.defineProperty(n(200)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(98);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(197)("native-function-to-string",Function.toString)},function(e,t,n){"use strict";var r=n(496),o=n(336),i=n(203),a={};n(81)(a,n(33)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(45),o=n(497),i=n(341),a=n(202)("IE_PROTO"),s=function(){},u=function(){var e,t=n(200)("iframe"),r=i.length;for(t.style.display="none",n(342).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[i[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(151),o=n(45),i=n(339);e.exports=n(126)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(152),o=n(155),i=n(500)(!1),a=n(202)("IE_PROTO");e.exports=function(e,t){var n,s=o(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~i(c,n)||c.push(n));return c}},function(e,t,n){var r=n(125);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(155),o=n(74),i=n(340);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=o(u.length),l=i(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(152),o=n(343),i=n(202)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){for(var r=n(503),o=n(339),i=n(97),a=n(41),s=n(81),u=n(128),c=n(33),l=c("iterator"),p=c("toStringTag"),f=u.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=o(h),m=0;m<d.length;m++){var v,g=d[m],y=h[g],b=a[g],_=b&&b.prototype;if(_&&(_[l]||s(_,l,f),_[p]||s(_,p,g),u[g]=f,y))for(v in r)_[v]||i(_,v,r[v],!0)}},function(e,t,n){"use strict";var r=n(504),o=n(505),i=n(128),a=n(155);e.exports=n(338)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(33)("unscopables"),o=Array.prototype;null==o[r]&&n(81)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r,o,i,a,s=n(198),u=n(41),c=n(153),l=n(150),p=n(35),f=n(98),h=n(154),d=n(507),m=n(508),v=n(204),g=n(344).set,y=n(513)(),b=n(205),_=n(345),w=n(514),x=n(346),E=u.TypeError,S=u.process,C=S&&S.versions,k=C&&C.v8||"",O=u.Promise,A="process"==l(S),T=function(){},j=o=b.f,P=!!function(){try{var e=O.resolve(1),t=(e.constructor={})[n(33)("species")]=function(e){e(T,T)};return(A||"function"==typeof PromiseRejectionEvent)&&e.then(T)instanceof t&&0!==k.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(e){}}(),I=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,s=o?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{s?(o||(2==e._h&&D(e),e._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===t.promise?c(E("Promise-chain cycle")):(i=I(n))?i.call(n,u,c):u(n)):c(r)}catch(e){l&&!a&&l.exit(),c(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&N(e)})}},N=function(e){g.call(u,function(){var t,n,r,o=e._v,i=R(e);if(i&&(t=_(function(){A?S.emit("unhandledRejection",o,e):(n=u.onunhandledrejection)?n({promise:e,reason:o}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=A||R(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},R=function(e){return 1!==e._h&&0===(e._a||e._c).length},D=function(e){g.call(u,function(){var t;A?S.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},L=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},U=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=I(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,c(U,r,1),c(L,r,1))}catch(e){L.call(r,e)}}):(n._v=e,n._s=1,M(n,!1))}catch(e){L.call({_w:n,_d:!1},e)}}};P||(O=function(e){d(this,O,"Promise","_h"),h(e),r.call(this);try{e(c(U,this,1),c(L,this,1))}catch(e){L.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(515)(O.prototype,{then:function(e,t){var n=j(v(this,O));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=A?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(U,e,1),this.reject=c(L,e,1)},b.f=j=function(e){return e===O||e===a?new i(e):o(e)}),p(p.G+p.W+p.F*!P,{Promise:O}),n(203)(O,"Promise"),n(516)("Promise"),a=n(72).Promise,p(p.S+p.F*!P,"Promise",{reject:function(e){var t=j(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!P),"Promise",{resolve:function(e){return x(s&&this===a?O:this,e)}}),p(p.S+p.F*!(P&&n(517)(function(e){O.all(e).catch(T)})),"Promise",{all:function(e){var t=this,n=j(t),r=n.resolve,o=n.reject,i=_(function(){var n=[],i=0,a=1;m(e,!1,function(e){var s=i++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=j(t),r=n.reject,o=_(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(153),o=n(509),i=n(510),a=n(45),s=n(74),u=n(511),c={},l={};(t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(h=s(e.length);h>b;b++)if((v=t?y(a(d=e[b])[0],d[1]):y(e[b]))===c||v===l)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=o(m,y,d.value,t))===c||v===l)return v}).BREAK=c,t.RETURN=l},function(e,t,n){var r=n(45);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&r(i.call(e)),t}}},function(e,t,n){var r=n(128),o=n(33)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},function(e,t,n){var r=n(150),o=n(33)("iterator"),i=n(128);e.exports=n(72).getIteratorMethod=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(41),o=n(344).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(125)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(u&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);n=function(){l.then(c)}}else n=function(){o.call(r,c)};else{var p=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){var r=n(41).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){var r=n(97);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},function(e,t,n){"use strict";var r=n(41),o=n(151),i=n(126),a=n(33)("species");e.exports=function(e){var t=r[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(33)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(35),o=n(72),i=n(41),a=n(204),s=n(346);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,o.Promise||i.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(35),o=n(205),i=n(345);r(r.S,"Promise",{try:function(e){var t=o.f(this),n=i(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){n(521),n(522),n(523),n(337),n(526),n(527),n(528),n(529),n(531),n(532),n(533),n(534),n(535),n(536),n(537),n(538),n(539),n(540),n(541),n(542),n(543),n(544),n(545),n(548),n(549),n(551),e.exports=n(72).String},function(e,t,n){var r=n(35),o=n(340),i=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],o(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?i(t):i(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(35),o=n(155),i=n(74);r(r.S,"String",{raw:function(e){for(var t=o(e.raw),n=i(t.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(t[s++])),s<r&&a.push(String(arguments[s]));return a.join("")}})},function(e,t,n){"use strict";n(524)("trim",function(e){return function(){return e(this,3)}})},function(e,t,n){var r=n(35),o=n(73),i=n(99),a=n(525),s="["+a+"]",u=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),l=function(e,t,n){var o={},s=i(function(){return!!a[e]()||"​…"!="​…"[e]()}),u=o[e]=s?t(p):a[e];n&&(o[n]=u),r(r.P+r.F*s,"String",o)},p=l.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(u,"")),2&t&&(e=e.replace(c,"")),e};e.exports=l},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){"use strict";var r=n(35),o=n(201)(!1);r(r.P,"String",{codePointAt:function(e){return o(this,e)}})},function(e,t,n){"use strict";var r=n(35),o=n(74),i=n(206),a="".endsWith;r(r.P+r.F*n(207)("endsWith"),"String",{endsWith:function(e){var t=i(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(t.length),s=void 0===n?r:Math.min(o(n),r),u=String(e);return a?a.call(t,u,s):t.slice(s-u.length,s)===u}})},function(e,t,n){"use strict";var r=n(35),o=n(206);r(r.P+r.F*n(207)("includes"),"String",{includes:function(e){return!!~o(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(35);r(r.P,"String",{repeat:n(530)})},function(e,t,n){"use strict";var r=n(127),o=n(73);e.exports=function(e){var t=String(o(this)),n="",i=r(e);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n}},function(e,t,n){"use strict";var r=n(35),o=n(74),i=n(206),a="".startsWith;r(r.P+r.F*n(207)("startsWith"),"String",{startsWith:function(e){var t=i(this,e,"startsWith"),n=o(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(42)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},function(e,t,n){"use strict";n(42)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(42)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(42)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";n(42)("fixed",function(e){return function(){return e(this,"tt","","")}})},function(e,t,n){"use strict";n(42)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},function(e,t,n){"use strict";n(42)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},function(e,t,n){"use strict";n(42)("italics",function(e){return function(){return e(this,"i","","")}})},function(e,t,n){"use strict";n(42)("link",function(e){return function(t){return e(this,"a","href",t)}})},function(e,t,n){"use strict";n(42)("small",function(e){return function(){return e(this,"small","","")}})},function(e,t,n){"use strict";n(42)("strike",function(e){return function(){return e(this,"strike","","")}})},function(e,t,n){"use strict";n(42)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(42)("sup",function(e){return function(){return e(this,"sup","","")}})},function(e,t,n){"use strict";var r=n(45),o=n(74),i=n(208),a=n(156);n(157)("match",1,function(e,t,n,s){return[function(n){var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=s(n,e,this);if(t.done)return t.value;var u=r(e),c=String(this);if(!u.global)return a(u,c);var l=u.unicode;u.lastIndex=0;for(var p,f=[],h=0;null!==(p=a(u,c));){var d=String(p[0]);f[h]=d,""===d&&(u.lastIndex=i(c,o(u.lastIndex),l)),h++}return 0===h?null:f}]})},function(e,t,n){"use strict";var r=n(209);n(35)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(e,t,n){"use strict";var r=n(45);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(45),o=n(343),i=n(74),a=n(127),s=n(208),u=n(156),c=Math.max,l=Math.min,p=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;n(157)("replace",2,function(e,t,n,d){return[function(r,o){var i=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},function(e,t){var o=d(n,e,this,t);if(o.done)return o.value;var p=r(e),f=String(this),h="function"==typeof t;h||(t=String(t));var v=p.global;if(v){var g=p.unicode;p.lastIndex=0}for(var y=[];;){var b=u(p,f);if(null===b)break;if(y.push(b),!v)break;""===String(b[0])&&(p.lastIndex=s(f,i(p.lastIndex),g))}for(var _,w="",x=0,E=0;E<y.length;E++){b=y[E];for(var S=String(b[0]),C=c(l(a(b.index),f.length),0),k=[],O=1;O<b.length;O++)k.push(void 0===(_=b[O])?_:String(_));var A=b.groups;if(h){var T=[S].concat(k,C,f);void 0!==A&&T.push(A);var j=String(t.apply(void 0,T))}else j=m(S,f,C,k,A,t);C>=x&&(w+=f.slice(x,C)+j,x=C+S.length)}return w+f.slice(x)}];function m(e,t,r,i,a,s){var u=r+e.length,c=i.length,l=h;return void 0!==a&&(a=o(a),l=f),n.call(s,l,function(n,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(u);case"<":s=a[o.slice(1,-1)];break;default:var l=+o;if(0===l)return n;if(l>c){var f=p(l/10);return 0===f?n:f<=c?void 0===i[f-1]?o.charAt(1):i[f-1]+o.charAt(1):n}s=i[l-1]}return void 0===s?"":s})}})},function(e,t,n){"use strict";var r=n(45),o=n(550),i=n(156);n(157)("search",1,function(e,t,n,a){return[function(n){var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=a(n,e,this);if(t.done)return t.value;var s=r(e),u=String(this),c=s.lastIndex;o(c,0)||(s.lastIndex=0);var l=i(s,u);return o(s.lastIndex,c)||(s.lastIndex=c),null===l?-1:l.index}]})},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){"use strict";var r=n(347),o=n(45),i=n(204),a=n(208),s=n(74),u=n(156),c=n(209),l=n(99),p=Math.min,f=[].push,h=!l(function(){RegExp(4294967295,"y")});n(157)("split",2,function(e,t,n,l){var d;return d="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var o=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(o,e,t);for(var i,a,s,u=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),p=0,h=void 0===t?4294967295:t>>>0,d=new RegExp(e.source,l+"g");(i=c.call(d,o))&&!((a=d.lastIndex)>p&&(u.push(o.slice(p,i.index)),i.length>1&&i.index<o.length&&f.apply(u,i.slice(1)),s=i[0].length,p=a,u.length>=h));)d.lastIndex===i.index&&d.lastIndex++;return p===o.length?!s&&d.test("")||u.push(""):u.push(o.slice(p)),u.length>h?u.slice(0,h):u}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):d.call(String(o),n,r)},function(e,t){var r=l(d,e,this,t,d!==n);if(r.done)return r.value;var c=o(e),f=String(this),m=i(c,RegExp),v=c.unicode,g=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(h?"y":"g"),y=new m(h?c:"^(?:"+c.source+")",g),b=void 0===t?4294967295:t>>>0;if(0===b)return[];if(0===f.length)return null===u(y,f)?[f]:[];for(var _=0,w=0,x=[];w<f.length;){y.lastIndex=h?w:0;var E,S=u(y,h?f:f.slice(w));if(null===S||(E=p(s(y.lastIndex+(h?0:w)),f.length))===_)w=a(f,w,v);else{if(x.push(f.slice(_,w)),x.length===b)return x;for(var C=1;C<=S.length-1;C++)if(x.push(S[C]),x.length===b)return x;w=_=E}}return x.push(f.slice(_)),x}]})},function(e,t,n){var r=n(22),o=r.JSON||(r.JSON={stringify:JSON.stringify});e.exports=function(e){return o.stringify.apply(o,arguments)}},function(e,t,n){n(554),e.exports=n(22).Object.keys},function(e,t,n){var r=n(100),o=n(129);n(216)("keys",function(){return function(e){return o(r(e))}})},function(e,t,n){var r=n(76),o=n(158),i=n(556);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=o(u.length),l=i(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(212),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){e.exports=n(558)},function(e,t,n){n(101),n(103),e.exports=n(221).f("iterator")},function(e,t,n){var r=n(212),o=n(210);e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(i=s.charCodeAt(u))<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):i:e?s.slice(u,u+2):a-56320+(i-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(160),o=n(133),i=n(134),a={};n(77)(a,n(34)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){"use strict";var r=n(562),o=n(353),i=n(102),a=n(76);e.exports=n(219)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t,n){e.exports=n(564)},function(e,t,n){n(354),n(164),n(567),n(568),e.exports=n(22).Symbol},function(e,t,n){var r=n(129),o=n(161),i=n(162);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,s=n(e),u=i.f,c=0;s.length>c;)u.call(e,a=s[c++])&&t.push(a);return t}},function(e,t,n){var r=n(76),o=n(224).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},function(e,t,n){n(222)("asyncIterator")},function(e,t,n){n(222)("observable")},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=c(e),r=n[0],a=n[1],s=new i(function(e,t,n){return 3*(t+n)/4-n}(0,r,a)),u=0,l=a>0?r-4:r,p=0;p<l;p+=4)t=o[e.charCodeAt(p)]<<18|o[e.charCodeAt(p+1)]<<12|o[e.charCodeAt(p+2)]<<6|o[e.charCodeAt(p+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===a&&(t=o[e.charCodeAt(p)]<<2|o[e.charCodeAt(p+1)]>>4,s[u++]=255&t);1===a&&(t=o[e.charCodeAt(p)]<<10|o[e.charCodeAt(p+1)]<<4|o[e.charCodeAt(p+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(l(e,a,a+16383>s?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,l=-7,p=n?o-1:0,f=n?-1:1,h=e[t+p];for(p+=f,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+p],p+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+p],p+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,p=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+p>=1?f/u:f*Math.pow(2,1-p))*u>=2&&(a++,u/=2),a+p>=l?(s=0,a=l):a+p>=1?(s=(t*u-1)*Math.pow(2,o),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=d,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=d,a/=256,c-=8);e[n+h-d]|=128*m}},function(e,t,n){n(572),e.exports=n(22).Array.isArray},function(e,t,n){var r=n(30);r(r.S,"Array",{isArray:n(223)})},function(e,t,n){n(574);var r=n(22).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){var r=n(30);r(r.S+r.F*!n(50),"Object",{defineProperty:n(49).f})},function(e,t,n){n(576),e.exports=n(22).Object.assign},function(e,t,n){var r=n(30);r(r.S+r.F,"Object",{assign:n(356)})},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r=n(579),o=n(105),i=n(57),a=n(580),s=r.twoArgumentPooler,u=r.fourArgumentPooler,c=/\/+/g;function l(e){return(""+e).replace(c,"$&/")}function p(e,t){this.func=e,this.context=t,this.count=0}function f(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function h(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function d(e,t,n){var r=e.result,a=e.keyPrefix,s=e.func,u=e.context,c=s.call(u,t,e.count++);Array.isArray(c)?m(c,r,n,i.thatReturnsArgument):null!=c&&(o.isValidElement(c)&&(c=o.cloneAndReplaceKey(c,a+(!c.key||t&&t.key===c.key?"":l(c.key)+"/")+n)),r.push(c))}function m(e,t,n,r,o){var i="";null!=n&&(i=l(n)+"/");var s=h.getPooled(t,i,r,o);a(e,d,s),h.release(s)}function v(e,t,n){return null}p.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},r.addPoolingTo(p,s),h.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},r.addPoolingTo(h,u);var g={forEach:function(e,t,n){if(null==e)return e;var r=p.getPooled(t,n);a(e,f,r),p.release(r)},map:function(e,t,n){if(null==e)return e;var r=[];return m(e,r,null,t,n),r},mapIntoWithKeyPrefixInternal:m,count:function(e,t){return a(e,v,null)},toArray:function(e){var t=[];return m(e,t,null,i.thatReturnsArgument),t}};e.exports=g},function(e,t,n){"use strict";var r=n(136),o=(n(15),function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)}),i=function(e){e instanceof this||r("25"),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)},a=o,s={addPoolingTo:function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||a,n.poolSize||(n.poolSize=10),n.release=i,n},oneArgumentPooler:o,twoArgumentPooler:function(e,t){if(this.instancePool.length){var n=this.instancePool.pop();return this.call(n,e,t),n}return new this(e,t)},threeArgumentPooler:function(e,t,n){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,e,t,n),r}return new this(e,t,n)},fourArgumentPooler:function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)}};e.exports=s},function(e,t,n){"use strict";var r=n(136),o=(n(65),n(360)),i=n(581),a=(n(15),n(582)),s=(n(23),"."),u=":";function c(e,t){return e&&"object"==typeof e&&null!=e.key?a.escape(e.key):t.toString(36)}e.exports=function(e,t,n){return null==e?0:function e(t,n,l,p){var f,h=typeof t;if("undefined"!==h&&"boolean"!==h||(t=null),null===t||"string"===h||"number"===h||"object"===h&&t.$$typeof===o)return l(p,t,""===n?s+c(t,0):n),1;var d=0,m=""===n?s:n+u;if(Array.isArray(t))for(var v=0;v<t.length;v++)d+=e(f=t[v],m+c(f,v),l,p);else{var g=i(t);if(g){var y,b=g.call(t);if(g!==t.entries)for(var _=0;!(y=b.next()).done;)d+=e(f=y.value,m+c(f,_++),l,p);else for(;!(y=b.next()).done;){var w=y.value;w&&(d+=e(f=w[1],m+a.escape(w[0])+u+c(f,0),l,p))}}else if("object"===h){var x=String(t);r("31","[object Object]"===x?"object with keys {"+Object.keys(t).join(", ")+"}":x,"")}}return d}(e,"",t,n)}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=function(e){var t=e&&(r&&e[r]||e[o]);if("function"==typeof t)return t}},function(e,t,n){"use strict";var r={escape:function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})},unescape:function(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}};e.exports=r},function(e,t,n){"use strict";var r=n(105).createFactory,o={a:r("a"),abbr:r("abbr"),address:r("address"),area:r("area"),article:r("article"),aside:r("aside"),audio:r("audio"),b:r("b"),base:r("base"),bdi:r("bdi"),bdo:r("bdo"),big:r("big"),blockquote:r("blockquote"),body:r("body"),br:r("br"),button:r("button"),canvas:r("canvas"),caption:r("caption"),cite:r("cite"),code:r("code"),col:r("col"),colgroup:r("colgroup"),data:r("data"),datalist:r("datalist"),dd:r("dd"),del:r("del"),details:r("details"),dfn:r("dfn"),dialog:r("dialog"),div:r("div"),dl:r("dl"),dt:r("dt"),em:r("em"),embed:r("embed"),fieldset:r("fieldset"),figcaption:r("figcaption"),figure:r("figure"),footer:r("footer"),form:r("form"),h1:r("h1"),h2:r("h2"),h3:r("h3"),h4:r("h4"),h5:r("h5"),h6:r("h6"),head:r("head"),header:r("header"),hgroup:r("hgroup"),hr:r("hr"),html:r("html"),i:r("i"),iframe:r("iframe"),img:r("img"),input:r("input"),ins:r("ins"),kbd:r("kbd"),keygen:r("keygen"),label:r("label"),legend:r("legend"),li:r("li"),link:r("link"),main:r("main"),map:r("map"),mark:r("mark"),menu:r("menu"),menuitem:r("menuitem"),meta:r("meta"),meter:r("meter"),nav:r("nav"),noscript:r("noscript"),object:r("object"),ol:r("ol"),optgroup:r("optgroup"),option:r("option"),output:r("output"),p:r("p"),param:r("param"),picture:r("picture"),pre:r("pre"),progress:r("progress"),q:r("q"),rp:r("rp"),rt:r("rt"),ruby:r("ruby"),s:r("s"),samp:r("samp"),script:r("script"),section:r("section"),select:r("select"),small:r("small"),source:r("source"),span:r("span"),strong:r("strong"),style:r("style"),sub:r("sub"),summary:r("summary"),sup:r("sup"),table:r("table"),tbody:r("tbody"),td:r("td"),textarea:r("textarea"),tfoot:r("tfoot"),th:r("th"),thead:r("thead"),time:r("time"),title:r("title"),tr:r("tr"),track:r("track"),u:r("u"),ul:r("ul"),var:r("var"),video:r("video"),wbr:r("wbr"),circle:r("circle"),clipPath:r("clipPath"),defs:r("defs"),ellipse:r("ellipse"),g:r("g"),image:r("image"),line:r("line"),linearGradient:r("linearGradient"),mask:r("mask"),path:r("path"),pattern:r("pattern"),polygon:r("polygon"),polyline:r("polyline"),radialGradient:r("radialGradient"),rect:r("rect"),stop:r("stop"),svg:r("svg"),text:r("text"),tspan:r("tspan")};e.exports=o},function(e,t,n){"use strict";var r=n(105).isValidElement,o=n(361);e.exports=o(r)},function(e,t,n){"use strict";var r=n(362),o=n(25),i=n(363),a=n(587),s=Function.call.bind(Object.prototype.hasOwnProperty),u=function(){};function c(){return null}e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l="@@iterator";var p="<<anonymous>>",f={array:v("array"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:m(c),arrayOf:function(e){return m(function(t,n,r,o,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new d("Invalid "+o+" `"+a+"` of type `"+y(s)+"` supplied to `"+r+"`, expected an array.");for(var u=0;u<s.length;u++){var c=e(s,u,r,o,a+"["+u+"]",i);if(c instanceof Error)return c}return null})},element:m(function(t,n,r,o,i){var a=t[n];return e(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+y(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:m(function(e,t,n,o,i){var a=e[t];return r.isValidElementType(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+y(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return m(function(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||p;return new d("Invalid "+o+" `"+i+"` of type `"+function(e){if(!e.constructor||!e.constructor.name)return p;return e.constructor.name}(t[n])+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null})},node:m(function(e,t,n,r,o){return g(e[t])?null:new d("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return m(function(t,n,r,o,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=t[n],c=y(u);if("object"!==c)return new d("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var l in u)if(s(u,l)){var p=e(u,l,r,o,a+"."+l,i);if(p instanceof Error)return p}return null})},oneOf:function(e){if(!Array.isArray(e))return c;return m(function(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(h(a,e[s]))return null;var u=JSON.stringify(e,function(e,t){return"symbol"===b(t)?String(t):t});return new d("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+u+".")})},oneOfType:function(e){if(!Array.isArray(e))return c;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return u("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_(n)+" at index "+t+"."),c}return m(function(t,n,r,o,a){for(var s=0;s<e.length;s++){if(null==(0,e[s])(t,n,r,o,a,i))return null}return new d("Invalid "+o+" `"+a+"` supplied to `"+r+"`.")})},shape:function(e){return m(function(t,n,r,o,a){var s=t[n],u=y(s);if("object"!==u)return new d("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var c in e){var l=e[c];if(l){var p=l(s,c,r,o,a+"."+c,i);if(p)return p}}return null})},exact:function(e){return m(function(t,n,r,a,s){var u=t[n],c=y(u);if("object"!==c)return new d("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var l=o({},t[n],e);for(var p in l){var f=e[p];if(!f)return new d("Invalid "+a+" `"+s+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(u,p,r,a,s+"."+p,i);if(h)return h}return null})}};function h(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){this.message=e,this.stack=""}function m(e){function n(n,r,o,a,s,u,c){if((a=a||p,u=u||o,c!==i)&&t){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}return null==r[o]?n?null===r[o]?new d("The "+s+" `"+u+"` is marked as required in `"+a+"`, but its value is `null`."):new d("The "+s+" `"+u+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,o,a,s,u)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function v(e){return m(function(t,n,r,o,i,a){var s=t[n];return y(s)!==e?new d("Invalid "+o+" `"+i+"` of type `"+b(s)+"` supplied to `"+r+"`, expected `"+e+"`."):null})}function g(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(g);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e[l]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!g(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!g(a[1]))return!1}return!0;default:return!1}}function y(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=y(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function _(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return d.prototype=Error.prototype,f.checkPropTypes=a,f.resetWarningCache=a.resetWarningCache,f.PropTypes=f,f}},function(e,t,n){"use strict"; +/** @license React v16.8.6 + * react-is.production.min.js * - * Copyright(c) 2015 Gregory Jacobs <greg@greg-jacobs.com> - * MIT Licensed. http://www.opensource.org/licenses/mit-license.php + * Copyright (c) Facebook, Inc. and its affiliates. * - * https://github.com/gregjacobs/Autolinker.js + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116;function g(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case p:case f:case a:case u:case s:case d:return e;default:switch(e=e&&e.$$typeof){case l:case h:case c:return e;default:return t}}case v:case m:case i:return t}}}function y(e){return g(e)===f}t.typeOf=g,t.AsyncMode=p,t.ConcurrentMode=f,t.ContextConsumer=l,t.ContextProvider=c,t.Element=o,t.ForwardRef=h,t.Fragment=a,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=u,t.StrictMode=s,t.Suspense=d,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===f||e===u||e===s||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===c||e.$$typeof===l||e.$$typeof===h)},t.isAsyncMode=function(e){return y(e)||g(e)===p},t.isConcurrentMode=y,t.isContextConsumer=function(e){return g(e)===l},t.isContextProvider=function(e){return g(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return g(e)===h},t.isFragment=function(e){return g(e)===a},t.isLazy=function(e){return g(e)===v},t.isMemo=function(e){return g(e)===m},t.isPortal=function(e){return g(e)===i},t.isProfiler=function(e){return g(e)===u},t.isStrictMode=function(e){return g(e)===s},t.isSuspense=function(e){return g(e)===d}},function(e,t,n){"use strict";function r(e,t,n,r,o){}r.resetWarningCache=function(){0},e.exports=r},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(357).Component,o=n(105).isValidElement,i=n(358),a=n(590);e.exports=a(r,o,i)},function(e,t,n){"use strict";var r=n(25),o=n(165),i=n(15),a="mixins";e.exports=function(e,t,n){var s=[],u={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},c={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},l={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)f(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=r({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=r({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=d(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=r({},e.propTypes,t)},statics:function(e,t){!function(e,t){if(!t)return;for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){if(i(!(n in l),'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n),n in e){var o=c.hasOwnProperty(n)?c[n]:null;return i("DEFINE_MANY_MERGED"===o,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),void(e[n]=d(e[n],r))}e[n]=r}}}(e,t)},autobind:function(){}};function p(e,t){var n=u.hasOwnProperty(t)?u[t]:null;b.hasOwnProperty(t)&&i("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&i("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function f(e,n){if(n){i("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),i(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,o=r.__reactAutoBindPairs;for(var s in n.hasOwnProperty(a)&&l.mixins(e,n.mixins),n)if(n.hasOwnProperty(s)&&s!==a){var c=n[s],f=r.hasOwnProperty(s);if(p(f,s),l.hasOwnProperty(s))l[s](e,c);else{var h=u.hasOwnProperty(s);if("function"==typeof c&&!h&&!f&&!1!==n.autobind)o.push(s,c),r[s]=c;else if(f){var v=u[s];i(h&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,s),"DEFINE_MANY_MERGED"===v?r[s]=d(r[s],c):"DEFINE_MANY"===v&&(r[s]=m(r[s],c))}else r[s]=c}}}else;}function h(e,t){for(var n in i(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."),t)t.hasOwnProperty(n)&&(i(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function d(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return h(o,n),h(o,r),o}}function m(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function v(e,t){return t.bind(e)}var g={componentDidMount:function(){this.__isMounted=!0}},y={componentWillUnmount:function(){this.__isMounted=!1}},b={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},_=function(){};return r(_.prototype,e.prototype,b),function(e){var t=function(e,r,a){this.__reactAutoBindPairs.length&&function(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=v(e,o)}}(this),this.props=e,this.context=r,this.refs=o,this.updater=a||n,this.state=null;var s=this.getInitialState?this.getInitialState():null;i("object"==typeof s&&!Array.isArray(s),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=s};for(var r in t.prototype=new _,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],s.forEach(f.bind(null,t)),f(t,g),f(t,e),f(t,y),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),i(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),u)t.prototype[r]||(t.prototype[r]=null);return t}}},function(e,t,n){"use strict";var r=n(136),o=n(105);n(15);e.exports=function(e){return o.isValidElement(e)||r("143"),e}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),i=(r=o)&&r.__esModule?r:{default:r},a=n(594);t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.Map,n=Object.keys(e);return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t(),o=arguments[1];return r.withMutations(function(t){n.forEach(function(n){var r=(0,e[n])(t.get(n),o);(0,a.validateNextState)(r,n,o),t.set(n,r)})})}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateNextState=t.getUnexpectedInvocationParameterMessage=t.getStateName=void 0;var r=a(n(364)),o=a(n(595)),i=a(n(596));function a(e){return e&&e.__esModule?e:{default:e}}t.getStateName=r.default,t.getUnexpectedInvocationParameterMessage=o.default,t.validateNextState=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(1)),o=i(n(364));function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){var i=Object.keys(t);if(!i.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";var a=(0,o.default)(n);if(!r.default.Iterable.isIterable(e))return"The "+a+' is of unexpected type. Expected argument to be an instance of Immutable.Iterable with the following properties: "'+i.join('", "')+'".';var s=e.keySeq().toArray().filter(function(e){return!t.hasOwnProperty(e)});return s.length>0?"Unexpected "+(1===s.length?"property":"properties")+' "'+s.join('", "')+'" found in '+a+'. Expected to find one of the known reducer property names instead: "'+i.join('", "')+'". Unexpected properties will be ignored.':null},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(void 0===e)throw new Error('Reducer "'+t+'" returned undefined when handling "'+n.type+'" action. To ignore an action, you must explicitly return the previous state.')},e.exports=t.default},function(e,t,n){var r=n(14);e.exports=function(e){if(r(e))return e}},function(e,t,n){var r=n(92);e.exports=function(e,t){var n=[],o=!0,i=!1,a=void 0;try{for(var s,u=r(e);!(o=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return n}},function(e,t,n){n(103),n(101),e.exports=n(600)},function(e,t,n){var r=n(46),o=n(225);e.exports=n(22).getIterator=function(e){var t=o(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){var r=n(69),o=n(270);e.exports=function(e){return o(r(e).toLowerCase())}},function(e,t,n){var r=n(106),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(606),o=n(369),i=n(607),a=n(69);e.exports=function(e){return function(t){t=a(t);var n=o(t)?i(t):void 0,s=n?n[0]:t.charAt(0),u=n?r(n,1).join(""):t.slice(1);return s[e]()+u}}},function(e,t,n){var r=n(368);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},function(e,t,n){var r=n(608),o=n(369),i=n(609);e.exports=function(e){return o(e)?i(e):r(e)}},function(e,t){e.exports=function(e){return e.split("")}},function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+o+")"+"?",c="[\\ufe0e\\ufe0f]?"+u+("(?:\\u200d(?:"+[i,a,s].join("|")+")[\\ufe0e\\ufe0f]?"+u+")*"),l="(?:"+[i+r+"?",r,a,s,n].join("|")+")",p=RegExp(o+"(?="+o+")|"+l+c,"g");e.exports=function(e){return e.match(p)||[]}},function(e,t,n){var r=n(370),o=n(611),i=n(614),a=RegExp("['’]","g");e.exports=function(e){return function(t){return r(i(o(t).replace(a,"")),e,"")}}},function(e,t,n){var r=n(612),o=n(69),i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=o(e))&&e.replace(i,r).replace(a,"")}},function(e,t,n){var r=n(613)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,n){var r=n(615),o=n(616),i=n(69),a=n(617);e.exports=function(e,t,n){return e=i(e),void 0===(t=n?void 0:t)?o(e)?a(e):r(e):e.match(t)||[]}},function(e,t){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(n)||[]}},function(e,t){var n=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return n.test(e)}},function(e,t){var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",r="["+n+"]",o="\\d+",i="[\\u2700-\\u27bf]",a="[a-z\\xdf-\\xf6\\xf8-\\xff]",s="[^\\ud800-\\udfff"+n+o+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]",l="[A-Z\\xc0-\\xd6\\xd8-\\xde]",p="(?:"+a+"|"+s+")",f="(?:"+l+"|"+s+")",h="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",d="[\\ufe0e\\ufe0f]?"+h+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",u,c].join("|")+")[\\ufe0e\\ufe0f]?"+h+")*"),m="(?:"+[i,u,c].join("|")+")"+d,v=RegExp([l+"?"+a+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[r,l,"$"].join("|")+")",f+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[r,l+p,"$"].join("|")+")",l+"?"+p+"+(?:['’](?:d|ll|m|re|s|t|ve))?",l+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",o,m].join("|"),"g");e.exports=function(e){return e.match(v)||[]}},function(e,t,n){var r=n(619),o=n(169),i=n(227);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(620),o=n(625),i=n(626),a=n(627),s=n(628);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(168);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t,n){var r=n(371),o=n(622),i=n(52),a=n(372),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,p=c.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:s).test(a(e))}},function(e,t,n){var r,o=n(623),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},function(e,t,n){var r=n(51)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(168),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return n===o?void 0:n}return i.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(168),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(168),o="__lodash_hash_undefined__";e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?o:t,this}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(170),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(170);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(170);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(170);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(171);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(171);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(171);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(171);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(172),o=n(107),i=n(85);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!o(t)){var u=r(n,3);t=i(t),n=function(e){return u(s[e],e,s)}}var c=e(t,n,a);return c>-1?s[u?t[c]:c]:void 0}}},function(e,t,n){var r=n(641),o=n(667),i=n(384);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(228),o=n(373),i=1,a=2;e.exports=function(e,t,n,s){var u=n.length,c=u,l=!s;if(null==e)return!c;for(e=Object(e);u--;){var p=n[u];if(l&&p[2]?p[1]!==e[p[0]]:!(p[0]in e))return!1}for(;++u<c;){var f=(p=n[u])[0],h=e[f],d=p[1];if(l&&p[2]){if(void 0===h&&!(f in e))return!1}else{var m=new r;if(s)var v=s(h,d,f,e,t,m);if(!(void 0===v?o(d,h,i|a,s,m):v))return!1}}return!0}},function(e,t,n){var r=n(169);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(169),o=n(227),i=n(226),a=200;e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<a-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(228),o=n(374),i=n(652),a=n(655),s=n(176),u=n(37),c=n(232),l=n(381),p=1,f="[object Arguments]",h="[object Array]",d="[object Object]",m=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,y){var b=u(e),_=u(t),w=b?h:s(e),x=_?h:s(t),E=(w=w==f?d:w)==d,S=(x=x==f?d:x)==d,C=w==x;if(C&&c(e)){if(!c(t))return!1;b=!0,E=!1}if(C&&!E)return y||(y=new r),b||l(e)?o(e,t,n,v,g,y):i(e,t,w,n,v,g,y);if(!(n&p)){var k=E&&m.call(e,"__wrapped__"),O=S&&m.call(t,"__wrapped__");if(k||O){var A=k?e.value():e,T=O?t.value():t;return y||(y=new r),g(A,T,n,v,y)}}return!!C&&(y||(y=new r),a(e,t,n,v,g,y))}},function(e,t,n){var r=n(226),o=n(649),i=n(650);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},function(e,t){var n="__lodash_hash_undefined__";e.exports=function(e){return this.__data__.set(e,n),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(106),o=n(376),i=n(91),a=n(374),s=n(653),u=n(654),c=1,l=2,p="[object Boolean]",f="[object Date]",h="[object Error]",d="[object Map]",m="[object Number]",v="[object RegExp]",g="[object Set]",y="[object String]",b="[object Symbol]",_="[object ArrayBuffer]",w="[object DataView]",x=r?r.prototype:void 0,E=x?x.valueOf:void 0;e.exports=function(e,t,n,r,x,S,C){switch(n){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!S(new o(e),new o(t)));case p:case f:case m:return i(+e,+t);case h:return e.name==t.name&&e.message==t.message;case v:case y:return e==t+"";case d:var k=s;case g:var O=r&c;if(k||(k=u),e.size!=t.size&&!O)return!1;var A=C.get(e);if(A)return A==t;r|=l,C.set(e,t);var T=a(k(e),k(t),r,x,S,C);return C.delete(e),T;case b:if(E)return E.call(e)==E.call(t)}return!1}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},function(e,t,n){var r=n(377),o=1,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,s,u){var c=n&o,l=r(e),p=l.length;if(p!=r(t).length&&!c)return!1;for(var f=p;f--;){var h=l[f];if(!(c?h in t:i.call(t,h)))return!1}var d=u.get(e);if(d&&u.get(t))return d==t;var m=!0;u.set(e,t),u.set(t,e);for(var v=c;++f<p;){var g=e[h=l[f]],y=t[h];if(a)var b=c?a(y,g,h,t,e,u):a(g,y,h,e,t,u);if(!(void 0===b?g===y||s(g,y,n,a,u):b)){m=!1;break}v||(v="constructor"==h)}if(m&&!v){var _=e.constructor,w=t.constructor;_!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof _&&_ instanceof _&&"function"==typeof w&&w instanceof w)&&(m=!1)}return u.delete(e),u.delete(t),m}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(83),o=n(66),i="[object Arguments]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(83),o=n(233),i=n(66),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},function(e,t,n){var r=n(175),o=n(662),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(382)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(84)(n(51),"DataView");e.exports=r},function(e,t,n){var r=n(84)(n(51),"Promise");e.exports=r},function(e,t,n){var r=n(84)(n(51),"Set");e.exports=r},function(e,t,n){var r=n(84)(n(51),"WeakMap");e.exports=r},function(e,t,n){var r=n(383),o=n(85);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,r(a)]}return t}},function(e,t,n){var r=n(373),o=n(93),i=n(385),a=n(236),s=n(383),u=n(384),c=n(109),l=1,p=2;e.exports=function(e,t){return a(e)&&s(t)?u(c(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?i(n,e):r(t,a,l|p)}}},function(e,t,n){var r=n(670),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)}),t});e.exports=a},function(e,t,n){var r=n(271),o=500;e.exports=function(e){var t=r(e,function(e){return n.size===o&&n.clear(),e}),n=t.cache;return t}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(108),o=n(231),i=n(37),a=n(174),s=n(233),u=n(109);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,p=!1;++c<l;){var f=u(t[c]);if(!(p=null!=e&&n(e,f)))break;e=e[f]}return p||++c!=l?p:!!(l=null==e?0:e.length)&&s(l)&&a(f,l)&&(i(e)||o(e))}},function(e,t,n){var r=n(674),o=n(675),i=n(236),a=n(109);e.exports=function(e){return i(e)?r(a(e)):o(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(177);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(677),o=n(172),i=n(386),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var u=null==n?0:i(n);return u<0&&(u=a(s+u,0)),r(e,o(t,3),u)}},function(e,t){e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},function(e,t,n){var r=n(387),o=1/0,i=17976931348623157e292;e.exports=function(e){return e?(e=r(e))===o||e===-o?(e<0?-1:1)*i:e==e?e:0:0===e?e:0}},function(e,t,n){var r=n(388);e.exports=function(e,t){var n;return r(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}},function(e,t,n){var r=n(681),o=n(85);e.exports=function(e,t){return e&&r(e,t,o)}},function(e,t,n){var r=n(682)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++o];if(!1===n(i[u],u,i))break}return t}}},function(e,t,n){var r=n(107);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var i=n.length,a=t?i:-1,s=Object(n);(t?a--:++a<i)&&!1!==o(s[a],a,s););return n}}},function(e,t){var n={"&":"&",'"':""","'":"'","<":"<",">":">"};e.exports=function(e){return e&&e.replace?e.replace(/([&"<>'])/g,function(e,t){return n[t]}):e}},function(e,t,n){e.exports=o;var r=n(238).EventEmitter;function o(){r.call(this)}n(47)(o,r),o.Readable=n(239),o.Writable=n(692),o.Duplex=n(693),o.Transform=n(694),o.PassThrough=n(695),o.Stream=o,o.prototype.pipe=function(e,t){var n=this;function o(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===r.listenerCount(this,"error"))throw e}function l(){n.removeListener("data",o),e.removeListener("drain",i),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("error",c),e.on("error",c),n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e}},function(e,t){},function(e,t,n){"use strict";var r=n(48).Buffer,o=n(688);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=i,o=s,t.copy(n,o),s+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,u=1,c={},l=!1,p=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(o=p.documentElement,r=function(e){var t=p.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},f.clearImmediate=h}function h(e){delete c[e]}function d(e){if(l)setTimeout(d,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(36),n(67))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(36))},function(e,t,n){"use strict";e.exports=i;var r=n(395),o=n(137);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(47),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(240)},function(e,t,n){e.exports=n(86)},function(e,t,n){e.exports=n(239).Transform},function(e,t,n){e.exports=n(239).PassThrough},function(e,t,n){"use strict";var r=n(697),o=Math.abs,i=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*i(o(e)):e}},function(e,t,n){"use strict";e.exports=n(698)()?Math.sign:n(699)},function(e,t,n){"use strict";e.exports=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}},function(e,t,n){"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},function(e,t,n){"use strict";var r=n(78),o=n(179),i=n(89),a=n(702),s=n(398);e.exports=function e(t){var n,u,c;if(r(t),(n=Object(arguments[1])).async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(t,"__memoized__")&&!n.force?t:(u=s(n.length,t.length,n.async&&i.async),c=a(t,u,n),o(i,function(e,t){n[t]&&e(n[t],c,n)}),e.__profiler__&&e.__profiler__(c),c.updateEnv(),c.memoized)}},function(e,t,n){"use strict";var r=n(78),o=n(110),i=Function.prototype.bind,a=Function.prototype.call,s=Object.keys,u=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,c){var l,p=arguments[2],f=arguments[3];return n=Object(o(n)),r(c),l=s(n),f&&l.sort("function"==typeof f?i.call(f,n):void 0),"function"!=typeof e&&(e=l[e]),a.call(e,l,function(e,r){return u.call(n,e)?a.call(c,p,n[e],e,n,r):t})}}},function(e,t,n){"use strict";var r=n(703),o=n(400),i=n(180),a=n(713).methods,s=n(714),u=n(726),c=Function.prototype.apply,l=Function.prototype.call,p=Object.create,f=Object.defineProperties,h=a.on,d=a.emit;e.exports=function(e,t,n){var a,m,v,g,y,b,_,w,x,E,S,C,k,O,A,T=p(null);return m=!1!==t?t:isNaN(e.length)?1:e.length,n.normalizer&&(E=u(n.normalizer),v=E.get,g=E.set,y=E.delete,b=E.clear),null!=n.resolvers&&(A=s(n.resolvers)),O=v?o(function(t){var n,o,i=arguments;if(A&&(i=A(i)),null!==(n=v(i))&&hasOwnProperty.call(T,n))return S&&a.emit("get",n,i,this),T[n];if(o=1===i.length?l.call(e,this,i[0]):c.call(e,this,i),null===n){if(null!==(n=v(i)))throw r("Circular invocation","CIRCULAR_INVOCATION");n=g(i)}else if(hasOwnProperty.call(T,n))throw r("Circular invocation","CIRCULAR_INVOCATION");return T[n]=o,C&&a.emit("set",n,null,o),o},m):0===t?function(){var t;if(hasOwnProperty.call(T,"data"))return S&&a.emit("get","data",arguments,this),T.data;if(t=arguments.length?c.call(e,this,arguments):l.call(e,this),hasOwnProperty.call(T,"data"))throw r("Circular invocation","CIRCULAR_INVOCATION");return T.data=t,C&&a.emit("set","data",null,t),t}:function(t){var n,o,i=arguments;if(A&&(i=A(arguments)),o=String(i[0]),hasOwnProperty.call(T,o))return S&&a.emit("get",o,i,this),T[o];if(n=1===i.length?l.call(e,this,i[0]):c.call(e,this,i),hasOwnProperty.call(T,o))throw r("Circular invocation","CIRCULAR_INVOCATION");return T[o]=n,C&&a.emit("set",o,null,n),n},a={original:e,memoized:O,profileName:n.profileName,get:function(e){return A&&(e=A(e)),v?v(e):String(e[0])},has:function(e){return hasOwnProperty.call(T,e)},delete:function(e){var t;hasOwnProperty.call(T,e)&&(y&&y(e),t=T[e],delete T[e],k&&a.emit("delete",e,t))},clear:function(){var e=T;b&&b(),T=p(null),a.emit("clear",e)},on:function(e,t){return"get"===e?S=!0:"set"===e?C=!0:"delete"===e&&(k=!0),h.call(this,e,t)},emit:d,updateEnv:function(){e=a.original}},_=v?o(function(e){var t,n=arguments;A&&(n=A(n)),null!==(t=v(n))&&a.delete(t)},m):0===t?function(){return a.delete("data")}:function(e){return A&&(e=A(arguments)[0]),a.delete(e)},w=o(function(){var e,n=arguments;return 0===t?T.data:(A&&(n=A(n)),e=v?v(n):String(n[0]),T[e])}),x=o(function(){var e,n=arguments;return 0===t?a.has("data"):(A&&(n=A(n)),null!==(e=v?v(n):String(n[0]))&&a.has(e))}),f(O,{__memoized__:i(!0),delete:i(_),clear:i(a.clear),_get:i(w),_has:i(x)}),a}},function(e,t,n){"use strict";var r=n(399),o=n(709),i=n(87),a=Error.captureStackTrace;t=e.exports=function(e){var n=new Error(e),s=arguments[1],u=arguments[2];return i(u)||o(s)&&(u=s,s=null),i(u)&&r(n,u),i(s)&&(n.code=s),a&&a(n,t),n}},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var r=n(706),o=n(110),i=Math.max;e.exports=function(e,t){var n,a,s,u=i(arguments.length,2);for(e=Object(o(e)),s=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},a=1;a<u;++a)t=arguments[a],r(t).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(707)()?Object.keys:n(708)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var r=n(87),o=Object.keys;e.exports=function(e){return o(r(e)?Object(e):e)}},function(e,t,n){"use strict";var r=n(87),o={function:!0,object:!0};e.exports=function(e){return r(e)&&o[typeof e]||!1}},function(e,t,n){"use strict";e.exports=n(711)()?String.prototype.contains:n(712)},function(e,t,n){"use strict";var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(e,t,n){"use strict";var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";var r,o,i,a,s,u,c,l=n(180),p=n(78),f=Function.prototype.apply,h=Function.prototype.call,d=Object.create,m=Object.defineProperty,v=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};o=function(e,t){var n,o;return p(t),o=this,r.call(this,e,n=function(){i.call(o,e,n),f.call(t,this,arguments)}),n.__eeOnceListener__=t,this},s={on:r=function(e,t){var n;return p(t),g.call(this,"__ee__")?n=this.__ee__:(n=y.value=d(null),m(this,"__ee__",y),y.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},once:o,off:i=function(e,t){var n,r,o,i;if(p(t),!g.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(i=0;o=r[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},emit:a=function(e){var t,n,r,o,i;if(g.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)f.call(r,this,i)}else switch(arguments.length){case 1:h.call(o,this);break;case 2:h.call(o,this,arguments[1]);break;case 3:h.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];f.call(o,this,i)}}},u={on:l(r),once:l(o),off:l(i),emit:l(a)},c=v({},u),e.exports=t=function(e){return null==e?d(c):v(Object(e),u)},t.methods=s},function(e,t,n){"use strict";var r,o=n(715),i=n(87),a=n(78),s=Array.prototype.slice;r=function(e){return this.map(function(t,n){return t?t(e[n]):e[n]}).concat(s.call(e,this.length))},e.exports=function(e){return(e=o(e)).forEach(function(e){i(e)&&a(e)}),r.bind(e)}},function(e,t,n){"use strict";var r=n(242),o=Array.isArray;e.exports=function(e){return o(e)?e:r(e)}},function(e,t,n){"use strict";e.exports=function(){var e,t,n=Array.from;return"function"==typeof n&&(t=n(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}},function(e,t,n){"use strict";var r=n(718).iterator,o=n(723),i=n(724),a=n(88),s=n(78),u=n(110),c=n(87),l=n(725),p=Array.isArray,f=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(e){var t,n,m,v,g,y,b,_,w,x,E=arguments[1],S=arguments[2];if(e=Object(u(e)),c(E)&&s(E),this&&this!==Array&&i(this))t=this;else{if(!E){if(o(e))return 1!==(g=e.length)?Array.apply(null,e):((v=new Array(1))[0]=e[0],v);if(p(e)){for(v=new Array(g=e.length),n=0;n<g;++n)v[n]=e[n];return v}}v=[]}if(!p(e))if(void 0!==(w=e[r])){for(b=s(w).call(e),t&&(v=new t),_=b.next(),n=0;!_.done;)x=E?f.call(E,S,_.value,n):_.value,t?(h.value=x,d(v,n,h)):v[n]=x,_=b.next(),++n;g=n}else if(l(e)){for(g=e.length,t&&(v=new t),n=0,m=0;n<g;++n)x=e[n],n+1<g&&(y=x.charCodeAt(0))>=55296&&y<=56319&&(x+=e[++n]),x=E?f.call(E,S,x,m):x,t?(h.value=x,d(v,m,h)):v[m]=x,++m;g=m}if(void 0===g)for(g=a(e.length),t&&(v=new t(g)),n=0;n<g;++n)x=E?f.call(E,S,e[n],n):e[n],t?(h.value=x,d(v,n,h)):v[n]=x;return t&&(h.value=null,v.length=g),v}},function(e,t,n){"use strict";e.exports=n(719)()?Symbol:n(720)},function(e,t,n){"use strict";var r={object:!0,symbol:!0};e.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{String(e)}catch(e){return!1}return!!r[typeof Symbol.iterator]&&(!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag])}},function(e,t,n){"use strict";var r,o,i,a,s=n(180),u=n(721),c=Object.create,l=Object.defineProperties,p=Object.defineProperty,f=Object.prototype,h=c(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),a=!0}catch(e){}}var d,m=(d=c(null),function(e){for(var t,n,r=0;d[e+(r||"")];)++r;return d[e+=r||""]=!0,p(f,t="@@"+e,s.gs(null,function(e){n||(n=!0,p(this,t,s(e)),n=!1)})),t});i=function(e){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return o(e)},e.exports=o=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return a?r(t):(n=c(i.prototype),t=void 0===t?"":String(t),l(n,{__description__:s("",t),__name__:s("",m(t))}))},l(o,{for:s(function(e){return h[e]?h[e]:h[e]=o(String(e))}),keyFor:s(function(e){var t;for(t in u(e),h)if(h[t]===e)return t}),hasInstance:s("",r&&r.hasInstance||o("hasInstance")),isConcatSpreadable:s("",r&&r.isConcatSpreadable||o("isConcatSpreadable")),iterator:s("",r&&r.iterator||o("iterator")),match:s("",r&&r.match||o("match")),replace:s("",r&&r.replace||o("replace")),search:s("",r&&r.search||o("search")),species:s("",r&&r.species||o("species")),split:s("",r&&r.split||o("split")),toPrimitive:s("",r&&r.toPrimitive||o("toPrimitive")),toStringTag:s("",r&&r.toStringTag||o("toStringTag")),unscopables:s("",r&&r.unscopables||o("unscopables"))}),l(i.prototype,{constructor:s(o),toString:s("",function(){return this.__name__})}),l(o.prototype,{toString:s(function(){return"Symbol ("+u(this).__description__+")"}),valueOf:s(function(){return u(this)})}),p(o.prototype,o.toPrimitive,s("",function(){var e=u(this);return"symbol"==typeof e?e:e.toString()})),p(o.prototype,o.toStringTag,s("c","Symbol")),p(i.prototype,o.toStringTag,s("c",o.prototype[o.toStringTag])),p(i.prototype,o.toPrimitive,s("c",o.prototype[o.toPrimitive]))},function(e,t,n){"use strict";var r=n(722);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}},function(e,t,n){"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(n(397));e.exports=function(e){return"function"==typeof e&&r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===o)||!1}},function(e,t,n){"use strict";var r=n(78);e.exports=function(e){var t;return"function"==typeof e?{set:e,get:e}:(t={get:r(e.get)},void 0!==e.set?(t.set=r(e.set),e.delete&&(t.delete=r(e.delete)),e.clear&&(t.clear=r(e.clear)),t):(t.set=t.get,t))}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r=e.length;if(!r)return"";for(t=String(e[n=0]);--r;)t+=""+e[++n];return t}},function(e,t,n){"use strict";e.exports=function(e){return e?function(t){for(var n=String(t[0]),r=0,o=e;--o;)n+=""+t[++r];return n}:function(){return""}}},function(e,t,n){"use strict";var r=n(243),o=Object.create;e.exports=function(){var e=0,t=[],n=o(null);return{get:function(e){var n,o=0,i=t,a=e.length;if(0===a)return i[a]||null;if(i=i[a]){for(;o<a-1;){if(-1===(n=r.call(i[0],e[o])))return null;i=i[1][n],++o}return-1===(n=r.call(i[0],e[o]))?null:i[1][n]||null}return null},set:function(o){var i,a=0,s=t,u=o.length;if(0===u)s[u]=++e;else{for(s[u]||(s[u]=[[],[]]),s=s[u];a<u-1;)-1===(i=r.call(s[0],o[a]))&&(i=s[0].push(o[a])-1,s[1].push([[],[]])),s=s[1][i],++a;-1===(i=r.call(s[0],o[a]))&&(i=s[0].push(o[a])-1),s[1][i]=++e}return n[e]=o,e},delete:function(e){var o,i=0,a=t,s=n[e],u=s.length,c=[];if(0===u)delete a[u];else if(a=a[u]){for(;i<u-1;){if(-1===(o=r.call(a[0],s[i])))return;c.push(a,o),a=a[1][o],++i}if(-1===(o=r.call(a[0],s[i])))return;for(e=a[1][o],a[0].splice(o,1),a[1].splice(o,1);!a[0].length&&c.length;)o=c.pop(),(a=c.pop())[0].splice(o,1),a[1].splice(o,1)}delete n[e]},clear:function(){t=[],n=o(null)}}}},function(e,t,n){"use strict";e.exports=n(731)()?Number.isNaN:n(732)},function(e,t,n){"use strict";e.exports=function(){var e=Number.isNaN;return"function"==typeof e&&(!e({})&&e(NaN)&&!e(34))}},function(e,t,n){"use strict";e.exports=function(e){return e!=e}},function(e,t,n){"use strict";var r=n(243);e.exports=function(){var e=0,t=[],n=[];return{get:function(e){var o=r.call(t,e[0]);return-1===o?null:n[o]},set:function(r){return t.push(r[0]),n.push(++e),e},delete:function(e){var o=r.call(n,e);-1!==o&&(t.splice(o,1),n.splice(o,1))},clear:function(){t=[],n=[]}}}},function(e,t,n){"use strict";var r=n(243),o=Object.create;e.exports=function(e){var t=0,n=[[],[]],i=o(null);return{get:function(t){for(var o,i=0,a=n;i<e-1;){if(-1===(o=r.call(a[0],t[i])))return null;a=a[1][o],++i}return-1===(o=r.call(a[0],t[i]))?null:a[1][o]||null},set:function(o){for(var a,s=0,u=n;s<e-1;)-1===(a=r.call(u[0],o[s]))&&(a=u[0].push(o[s])-1,u[1].push([[],[]])),u=u[1][a],++s;return-1===(a=r.call(u[0],o[s]))&&(a=u[0].push(o[s])-1),u[1][a]=++t,i[t]=o,t},delete:function(t){for(var o,a=0,s=n,u=[],c=i[t];a<e-1;){if(-1===(o=r.call(s[0],c[a])))return;u.push(s,o),s=s[1][o],++a}if(-1!==(o=r.call(s[0],c[a]))){for(t=s[1][o],s[0].splice(o,1),s[1].splice(o,1);!s[0].length&&u.length;)o=u.pop(),(s=u.pop())[0].splice(o,1),s[1].splice(o,1);delete i[t]}},clear:function(){n=[[],[]],i=o(null)}}}},function(e,t,n){"use strict";var r=n(242),o=n(402),i=n(401),a=n(400),s=n(244),u=Array.prototype.slice,c=Function.prototype.apply,l=Object.create;n(89).async=function(e,t){var n,p,f,h=l(null),d=l(null),m=t.memoized,v=t.original;t.memoized=a(function(e){var t=arguments,r=t[t.length-1];return"function"==typeof r&&(n=r,t=u.call(t,0,-1)),m.apply(p=this,f=t)},m);try{i(t.memoized,m)}catch(e){}t.on("get",function(e){var r,o,i;if(n){if(h[e])return"function"==typeof h[e]?h[e]=[h[e],n]:h[e].push(n),void(n=null);r=n,o=p,i=f,n=p=f=null,s(function(){var a;hasOwnProperty.call(d,e)?(a=d[e],t.emit("getasync",e,i,o),c.call(r,a.context,a.args)):(n=r,p=o,f=i,m.apply(o,i))})}}),t.original=function(){var e,o,i,a;return n?(e=r(arguments),o=function e(n){var o,i,u=e.id;if(null!=u){if(delete e.id,o=h[u],delete h[u],o)return i=r(arguments),t.has(u)&&(n?t.delete(u):(d[u]={context:this,args:i},t.emit("setasync",u,"function"==typeof o?1:o.length))),"function"==typeof o?a=c.call(o,this,i):o.forEach(function(e){a=c.call(e,this,i)},this),a}else s(c.bind(e,this,arguments))},i=n,n=p=f=null,e.push(o),a=c.call(v,this,e),o.cb=i,n=o,a):c.call(v,this,arguments)},t.on("set",function(e){n?(h[e]?"function"==typeof h[e]?h[e]=[h[e],n.cb]:h[e].push(n.cb):h[e]=n.cb,delete n.cb,n.id=e,n=null):t.delete(e)}),t.on("delete",function(e){var n;hasOwnProperty.call(h,e)||d[e]&&(n=d[e],delete d[e],t.emit("deleteasync",e,u.call(n.args,1)))}),t.on("clear",function(){var e=d;d=l(null),t.emit("clearasync",o(e,function(e){return u.call(e.args,1)}))})}},function(e,t,n){"use strict";var r=n(402),o=n(737),i=n(738),a=n(740),s=n(403),u=n(244),c=Object.create,l=o("then","then:finally","done","done:finally");n(89).promise=function(e,t){var n=c(null),o=c(null),p=c(null);if(!0===e)e=null;else if(e=i(e),!l[e])throw new TypeError("'"+a(e)+"' is not valid promise mode");t.on("set",function(r,i,a){var c=!1;if(!s(a))return o[r]=a,void t.emit("setasync",r,1);n[r]=1,p[r]=a;var l=function(e){var i=n[r];if(c)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");i&&(delete n[r],o[r]=e,t.emit("setasync",r,i))},f=function(){c=!0,n[r]&&(delete n[r],delete p[r],t.delete(r))},h=e;if(h||(h="then"),"then"===h){var d=function(){u(f)};"function"==typeof(a=a.then(function(e){u(l.bind(this,e))},d)).finally&&a.finally(d)}else if("done"===h){if("function"!=typeof a.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");a.done(l,f)}else if("done:finally"===h){if("function"!=typeof a.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof a.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");a.done(l),a.finally(f)}}),t.on("get",function(e,r,o){var i;if(n[e])++n[e];else{i=p[e];var a=function(){t.emit("getasync",e,r,o)};s(i)?"function"==typeof i.done?i.done(a):i.then(function(){u(a)}):a()}}),t.on("delete",function(e){if(delete p[e],n[e])delete n[e];else if(hasOwnProperty.call(o,e)){var r=o[e];delete o[e],t.emit("deleteasync",e,[r])}}),t.on("clear",function(){var e=o;o=c(null),n=c(null),p=c(null),t.emit("clearasync",r(e,function(e){return[e]}))})}},function(e,t,n){"use strict";var r=Array.prototype.forEach,o=Object.create;e.exports=function(e){var t=o(null);return r.call(arguments,function(e){t[e]=!0}),t}},function(e,t,n){"use strict";var r=n(110),o=n(739);e.exports=function(e){return o(r(e))}},function(e,t,n){"use strict";var r=n(241);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(e){throw new TypeError("Passed argument cannot be stringifed")}}},function(e,t,n){"use strict";var r=n(741),o=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=r(e);return t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(o,function(e){return JSON.stringify(e).slice(1,-1)})}},function(e,t,n){"use strict";var r=n(241);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(e){return"<Non-coercible to string value>"}}},function(e,t,n){"use strict";var r=n(78),o=n(179),i=n(89),a=Function.prototype.apply;i.dispose=function(e,t,n){var s;if(r(e),n.async&&i.async||n.promise&&i.promise)return t.on("deleteasync",s=function(t,n){a.call(e,null,n)}),void t.on("clearasync",function(e){o(e,function(e,t){s(t,e)})});t.on("delete",s=function(t,n){e(n)}),t.on("clear",function(e){o(e,function(e,t){s(t,e)})})}},function(e,t,n){"use strict";var r=n(242),o=n(179),i=n(244),a=n(403),s=n(744),u=n(89),c=Function.prototype,l=Math.max,p=Math.min,f=Object.create;u.maxAge=function(e,t,n){var h,d,m,v;(e=s(e))&&(h=f(null),d=n.async&&u.async||n.promise&&u.promise?"async":"",t.on("set"+d,function(n){h[n]=setTimeout(function(){t.delete(n)},e),"function"==typeof h[n].unref&&h[n].unref(),v&&(v[n]&&"nextTick"!==v[n]&&clearTimeout(v[n]),v[n]=setTimeout(function(){delete v[n]},m),"function"==typeof v[n].unref&&v[n].unref())}),t.on("delete"+d,function(e){clearTimeout(h[e]),delete h[e],v&&("nextTick"!==v[e]&&clearTimeout(v[e]),delete v[e])}),n.preFetch&&(m=!0===n.preFetch||isNaN(n.preFetch)?.333:l(p(Number(n.preFetch),1),0))&&(v={},m=(1-m)*e,t.on("get"+d,function(e,o,s){v[e]||(v[e]="nextTick",i(function(){var i;"nextTick"===v[e]&&(delete v[e],t.delete(e),n.async&&(o=r(o)).push(c),i=t.memoized.apply(s,o),n.promise&&a(i)&&("function"==typeof i.done?i.done(c,c):i.then(c,c)))}))})),t.on("clear"+d,function(){o(h,function(e){clearTimeout(e)}),h={},v&&(o(v,function(e){"nextTick"!==e&&clearTimeout(e)}),v={})}))}},function(e,t,n){"use strict";var r=n(88),o=n(745);e.exports=function(e){if((e=r(e))>o)throw new TypeError(e+" exceeds maximum possible timeout");return e}},function(e,t,n){"use strict";e.exports=2147483647},function(e,t,n){"use strict";var r=n(88),o=n(747),i=n(89);i.max=function(e,t,n){var a,s,u;(e=r(e))&&(s=o(e),a=n.async&&i.async||n.promise&&i.promise?"async":"",t.on("set"+a,u=function(e){void 0!==(e=s.hit(e))&&t.delete(e)}),t.on("get"+a,u),t.on("delete"+a,s.delete),t.on("clear"+a,s.clear))}},function(e,t,n){"use strict";var r=n(88),o=Object.create,i=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n=0,a=1,s=o(null),u=o(null),c=0;return e=r(e),{hit:function(r){var o=u[r],l=++c;if(s[l]=r,u[r]=l,!o){if(++n<=e)return;return r=s[a],t(r),r}if(delete s[o],a===o)for(;!i.call(s,++a);)continue},delete:t=function(e){var t=u[e];if(t&&(delete s[t],delete u[e],--n,a===t)){if(!n)return c=0,void(a=1);for(;!i.call(s,++a);)continue}},clear:function(){n=0,a=1,s=o(null),u=o(null),c=0}}}},function(e,t,n){"use strict";var r=n(180),o=n(89),i=Object.create,a=Object.defineProperties;o.refCounter=function(e,t,n){var s,u;s=i(null),u=n.async&&o.async||n.promise&&o.promise?"async":"",t.on("set"+u,function(e,t){s[e]=t||1}),t.on("get"+u,function(e){++s[e]}),t.on("delete"+u,function(e){delete s[e]}),t.on("clear"+u,function(){s={}}),a(t.memoized,{deleteRef:r(function(){var e=t.get(arguments);return null===e?null:s[e]?!--s[e]&&(t.delete(e),!0):null}),getRefCount:r(function(){var e=t.get(arguments);return null===e?0:s[e]?s[e]:0})})}},function(e,t,n){var r=n(47),o=n(111),i=n(48).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<30|e>>>2}function l(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,u=0|this._e,p=0;p<16;++p)n[p]=e.readInt32BE(4*p);for(;p<80;++p)n[p]=n[p-3]^n[p-8]^n[p-14]^n[p-16];for(var f=0;f<80;++f){var h=~~(f/20),d=0|((t=r)<<5|t>>>27)+l(h,o,i,s)+u+n[f]+a[h];u=s,s=i,i=c(o),o=r,r=d}this._a=r+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(47),o=n(111),i=n(48).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function p(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,u=0|this._e,f=0;f<16;++f)n[f]=e.readInt32BE(4*f);for(;f<80;++f)n[f]=(t=n[f-3]^n[f-8]^n[f-14]^n[f-16])<<1|t>>>31;for(var h=0;h<80;++h){var d=~~(h/20),m=c(r)+p(d,o,i,s)+u+n[h]+a[d]|0;u=s,s=i,i=l(o),o=r,r=m}this._a=r+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(47),o=n(404),i=n(111),a=n(48).Buffer,s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}r(u,o),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,n){var r=n(47),o=n(405),i=n(111),a=n(48).Buffer,s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}r(u,o),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t){e.exports=function(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}},function(e,t,n){var r=n(14);e.exports=function(e){if(r(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t,n){var r=n(756),o=n(759);e.exports=function(e){if(o(Object(e))||"[object Arguments]"===Object.prototype.toString.call(e))return r(e)}},function(e,t,n){e.exports=n(757)},function(e,t,n){n(101),n(758),e.exports=n(22).Array.from},function(e,t,n){"use strict";var r=n(63),o=n(30),i=n(100),a=n(406),s=n(407),u=n(158),c=n(408),l=n(225);o(o.S+o.F*!n(409)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,o,p,f=i(e),h="function"==typeof this?this:Array,d=arguments.length,m=d>1?arguments[1]:void 0,v=void 0!==m,g=0,y=l(f);if(v&&(m=r(m,d>2?arguments[2]:void 0,2)),null==y||h==Array&&s(y))for(n=new h(t=u(f.length));t>g;g++)c(n,g,v?m(f[g],g):f[g]);else for(p=y.call(f),n=new h;!(o=p.next()).done;g++)c(n,g,v?a(p,m,[o.value,g],!0):o.value);return n.length=g,n}})},function(e,t,n){e.exports=n(760)},function(e,t,n){n(103),n(101),e.exports=n(761)},function(e,t,n){var r=n(166),o=n(34)("iterator"),i=n(102);e.exports=n(22).isIterable=function(e){var t=Object(e);return void 0!==t[o]||"@@iterator"in t||i.hasOwnProperty(r(t))}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t,n){n(764);var r=n(22).Object;e.exports=function(e,t){return r.defineProperties(e,t)}},function(e,t,n){var r=n(30);r(r.S+r.F*!n(50),"Object",{defineProperties:n(350)})},function(e,t,n){n(766),e.exports=n(22).Object.getOwnPropertyDescriptors},function(e,t,n){var r=n(30),o=n(767),i=n(76),a=n(163),s=n(408);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=i(e),u=a.f,c=o(r),l={},p=0;c.length>p;)void 0!==(n=u(r,t=c[p++]))&&s(l,t,n);return l}})},function(e,t,n){var r=n(224),o=n(161),i=n(46),a=n(32).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(i(e)),n=o.f;return n?t.concat(n(e)):t}},function(e,t,n){n(769);var r=n(22).Object;e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)}},function(e,t,n){var r=n(76),o=n(163).f;n(216)("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},function(e,t,n){n(354),e.exports=n(22).Object.getOwnPropertySymbols},function(e,t,n){var r=n(17);e.exports=function(e,t){if(null==e)return{};var n,o,i={},a=r(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}},function(e,t,n){n(773),e.exports=n(22).Date.now},function(e,t,n){var r=n(30);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){n(164),n(101),n(103),n(775),n(779),n(780),e.exports=n(22).Promise},function(e,t,n){"use strict";var r,o,i,a,s=n(131),u=n(32),c=n(63),l=n(166),p=n(30),f=n(43),h=n(132),d=n(181),m=n(112),v=n(410),g=n(411).set,y=n(777)(),b=n(245),_=n(412),w=n(778),x=n(413),E=u.TypeError,S=u.process,C=S&&S.versions,k=C&&C.v8||"",O=u.Promise,A="process"==l(S),T=function(){},j=o=b.f,P=!!function(){try{var e=O.resolve(1),t=(e.constructor={})[n(34)("species")]=function(e){e(T,T)};return(A||"function"==typeof PromiseRejectionEvent)&&e.then(T)instanceof t&&0!==k.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(e){}}(),I=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,s=o?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{s?(o||(2==e._h&&D(e),e._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===t.promise?c(E("Promise-chain cycle")):(i=I(n))?i.call(n,u,c):u(n)):c(r)}catch(e){l&&!a&&l.exit(),c(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&N(e)})}},N=function(e){g.call(u,function(){var t,n,r,o=e._v,i=R(e);if(i&&(t=_(function(){A?S.emit("unhandledRejection",o,e):(n=u.onunhandledrejection)?n({promise:e,reason:o}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",o)}),e._h=A||R(e)?2:1),e._a=void 0,i&&t.e)throw t.v})},R=function(e){return 1!==e._h&&0===(e._a||e._c).length},D=function(e){g.call(u,function(){var t;A?S.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},L=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},U=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=I(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,c(U,r,1),c(L,r,1))}catch(e){L.call(r,e)}}):(n._v=e,n._s=1,M(n,!1))}catch(e){L.call({_w:n,_d:!1},e)}}};P||(O=function(e){d(this,O,"Promise","_h"),h(e),r.call(this);try{e(c(U,this,1),c(L,this,1))}catch(e){L.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(182)(O.prototype,{then:function(e,t){var n=j(v(this,O));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=A?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(U,e,1),this.reject=c(L,e,1)},b.f=j=function(e){return e===O||e===a?new i(e):o(e)}),p(p.G+p.W+p.F*!P,{Promise:O}),n(134)(O,"Promise"),n(414)("Promise"),a=n(22).Promise,p(p.S+p.F*!P,"Promise",{reject:function(e){var t=j(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!P),"Promise",{resolve:function(e){return x(s&&this===a?O:this,e)}}),p(p.S+p.F*!(P&&n(409)(function(e){O.all(e).catch(T)})),"Promise",{all:function(e){var t=this,n=j(t),r=n.resolve,o=n.reject,i=_(function(){var n=[],i=0,a=1;m(e,!1,function(e){var s=i++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=j(t),r=n.reject,o=_(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(32),o=n(411).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(130)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(u&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);n=function(){l.then(c)}}else n=function(){o.call(r,c)};else{var p=!0,f=document.createTextNode("");new i(c).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t,n){var r=n(32).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){"use strict";var r=n(30),o=n(22),i=n(32),a=n(410),s=n(413);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,o.Promise||i.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(30),o=n(245),i=n(412);r(r.S,"Promise",{try:function(e){var t=o.f(this),n=i(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,i=Object.create(o.prototype),a=new O(r||[]);return i._invoke=function(e,t,n){var r=l;return function(o,i){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return T()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?h:p,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",p="suspendedYield",f="executing",h="completed",d={};function m(){}function v(){}function g(){}var y={};y[i]=function(){return this};var b=Object.getPrototypeOf,_=b&&b(b(A([])));_&&_!==n&&r.call(_,i)&&(y=_);var w=g.prototype=m.prototype=Object.create(y);function x(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function E(e){var t;this._invoke=function(n,o){function i(){return new Promise(function(t,i){!function t(n,o,i,a){var s=c(e[n],e,o);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,i,a)},function(e){t("throw",e,i,a)}):Promise.resolve(l).then(function(e){u.value=e,i(u)},function(e){return t("throw",e,i,a)})}a(s.arg)}(n,o,t,i)})}return t=t?t.then(i,i):i()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=c(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function A(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:T}}function T(){return{value:t,done:!0}}return v.prototype=w.constructor=g,g.constructor=v,g[s]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},x(E.prototype),E.prototype[a]=function(){return this},e.AsyncIterator=E,e.async=function(t,n,r,o){var i=new E(u(t,n,r,o));return e.isGeneratorFunction(n)?i:i.next().then(function(e){return e.done?e.value:i.next()})},x(w),w[s]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=A,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";var r=n(783),o=n(802);function i(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}e.exports.Type=n(31),e.exports.Schema=n(114),e.exports.FAILSAFE_SCHEMA=n(246),e.exports.JSON_SCHEMA=n(416),e.exports.CORE_SCHEMA=n(415),e.exports.DEFAULT_SAFE_SCHEMA=n(139),e.exports.DEFAULT_FULL_SCHEMA=n(183),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.safeLoad=r.safeLoad,e.exports.safeLoadAll=r.safeLoadAll,e.exports.dump=o.dump,e.exports.safeDump=o.safeDump,e.exports.YAMLException=n(138),e.exports.MINIMAL_SCHEMA=n(246),e.exports.SAFE_SCHEMA=n(139),e.exports.DEFAULT_SCHEMA=n(183),e.exports.scan=i("scan"),e.exports.parse=i("parse"),e.exports.compose=i("compose"),e.exports.addConstructor=i("addConstructor")},function(e,t,n){"use strict";var r=n(113),o=n(138),i=n(784),a=n(139),s=n(183),u=Object.prototype.hasOwnProperty,c=1,l=2,p=3,f=4,h=1,d=2,m=3,v=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g=/[\x85\u2028\u2029]/,y=/[,\[\]\{\}]/,b=/^(?:!|!!|![a-z\-]+!)$/i,_=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function w(e){return Object.prototype.toString.call(e)}function x(e){return 10===e||13===e}function E(e){return 9===e||32===e}function S(e){return 9===e||32===e||10===e||13===e}function C(e){return 44===e||91===e||93===e||123===e||125===e}function k(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function O(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e?"\t":9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function A(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var T=new Array(256),j=new Array(256),P=0;P<256;P++)T[P]=O(P)?1:0,j[P]=O(P);function I(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||s,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function M(e,t){return new o(t,new i(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function N(e,t){throw M(e,t)}function R(e,t){e.onWarning&&e.onWarning.call(null,M(e,t))}var D={YAML:function(e,t,n){var r,o,i;null!==e.version&&N(e,"duplication of %YAML directive"),1!==n.length&&N(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&N(e,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),i=parseInt(r[2],10),1!==o&&N(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=i<2,1!==i&&2!==i&&R(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,o;2!==n.length&&N(e,"TAG directive accepts exactly two arguments"),r=n[0],o=n[1],b.test(r)||N(e,"ill-formed tag handle (first argument) of the TAG directive"),u.call(e.tagMap,r)&&N(e,'there is a previously declared suffix for "'+r+'" tag handle'),_.test(o)||N(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=o}};function L(e,t,n,r){var o,i,a,s;if(t<n){if(s=e.input.slice(t,n),r)for(o=0,i=s.length;o<i;o+=1)9===(a=s.charCodeAt(o))||32<=a&&a<=1114111||N(e,"expected valid JSON character");else v.test(s)&&N(e,"the stream contains non-printable characters");e.result+=s}}function U(e,t,n,o){var i,a,s,c;for(r.isObject(n)||N(e,"cannot merge mappings; the provided source object is unacceptable"),s=0,c=(i=Object.keys(n)).length;s<c;s+=1)a=i[s],u.call(t,a)||(t[a]=n[a],o[a]=!0)}function q(e,t,n,r,o,i,a,s){var c,l;if(Array.isArray(o))for(c=0,l=(o=Array.prototype.slice.call(o)).length;c<l;c+=1)Array.isArray(o[c])&&N(e,"nested arrays are not supported inside keys"),"object"==typeof o&&"[object Object]"===w(o[c])&&(o[c]="[object Object]");if("object"==typeof o&&"[object Object]"===w(o)&&(o="[object Object]"),o=String(o),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(i))for(c=0,l=i.length;c<l;c+=1)U(e,t,i[c],n);else U(e,t,i,n);else e.json||u.call(n,o)||!u.call(t,o)||(e.line=a||e.line,e.position=s||e.position,N(e,"duplicated mapping key")),t[o]=i,delete n[o];return t}function F(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):N(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function B(e,t,n){for(var r=0,o=e.input.charCodeAt(e.position);0!==o;){for(;E(o);)o=e.input.charCodeAt(++e.position);if(t&&35===o)do{o=e.input.charCodeAt(++e.position)}while(10!==o&&13!==o&&0!==o);if(!x(o))break;for(F(e),o=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&R(e,"deficient indentation"),r}function z(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!S(t)))}function V(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function H(e,t){var n,r,o=e.tag,i=e.anchor,a=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),r=e.input.charCodeAt(e.position);0!==r&&45===r&&S(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,B(e,!0,-1)&&e.lineIndent<=t)a.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,K(e,t,p,!1,!0),a.push(e.result),B(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)N(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=o,e.anchor=i,e.kind="sequence",e.result=a,!0)}function W(e){var t,n,r,o,i=!1,a=!1;if(33!==(o=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&N(e,"duplication of a tag property"),60===(o=e.input.charCodeAt(++e.position))?(i=!0,o=e.input.charCodeAt(++e.position)):33===o?(a=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",t=e.position,i){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&62!==o);e.position<e.length?(r=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):N(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==o&&!S(o);)33===o&&(a?N(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),b.test(n)||N(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),y.test(r)&&N(e,"tag suffix cannot contain flow indicator characters")}return r&&!_.test(r)&&N(e,"tag name cannot contain such characters: "+r),i?e.tag=r:u.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:N(e,'undeclared tag handle "'+n+'"'),!0}function J(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&N(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!S(n)&&!C(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function K(e,t,n,o,i){var a,s,v,g,y,b,_,w,O=1,P=!1,I=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=s=v=f===n||p===n,o&&B(e,!0,-1)&&(P=!0,e.lineIndent>t?O=1:e.lineIndent===t?O=0:e.lineIndent<t&&(O=-1)),1===O)for(;W(e)||J(e);)B(e,!0,-1)?(P=!0,v=a,e.lineIndent>t?O=1:e.lineIndent===t?O=0:e.lineIndent<t&&(O=-1)):v=!1;if(v&&(v=P||i),1!==O&&f!==n||(_=c===n||l===n?t:t+1,w=e.position-e.lineStart,1===O?v&&(H(e,w)||function(e,t,n){var r,o,i,a,s,u=e.tag,c=e.anchor,p={},h={},d=null,m=null,v=null,g=!1,y=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=p),s=e.input.charCodeAt(e.position);0!==s;){if(r=e.input.charCodeAt(e.position+1),i=e.line,a=e.position,63!==s&&58!==s||!S(r)){if(!K(e,n,l,!1,!0))break;if(e.line===i){for(s=e.input.charCodeAt(e.position);E(s);)s=e.input.charCodeAt(++e.position);if(58===s)S(s=e.input.charCodeAt(++e.position))||N(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(q(e,p,h,d,m,null),d=m=v=null),y=!0,g=!1,o=!1,d=e.tag,m=e.result;else{if(!y)return e.tag=u,e.anchor=c,!0;N(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=u,e.anchor=c,!0;N(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(g&&(q(e,p,h,d,m,null),d=m=v=null),y=!0,g=!0,o=!0):g?(g=!1,o=!0):N(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,s=r;if((e.line===i||e.lineIndent>t)&&(K(e,t,f,!0,o)&&(g?m=e.result:v=e.result),g||(q(e,p,h,d,m,v,i,a),d=m=v=null),B(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)N(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return g&&q(e,p,h,d,m,null),y&&(e.tag=u,e.anchor=c,e.kind="mapping",e.result=p),y}(e,w,_))||function(e,t){var n,r,o,i,a,s,u,l,p,f,h=!0,d=e.tag,m=e.anchor,v={};if(91===(f=e.input.charCodeAt(e.position)))o=93,s=!1,r=[];else{if(123!==f)return!1;o=125,s=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),f=e.input.charCodeAt(++e.position);0!==f;){if(B(e,!0,t),(f=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=d,e.anchor=m,e.kind=s?"mapping":"sequence",e.result=r,!0;h||N(e,"missed comma between flow collection entries"),p=null,i=a=!1,63===f&&S(e.input.charCodeAt(e.position+1))&&(i=a=!0,e.position++,B(e,!0,t)),n=e.line,K(e,t,c,!1,!0),l=e.tag,u=e.result,B(e,!0,t),f=e.input.charCodeAt(e.position),!a&&e.line!==n||58!==f||(i=!0,f=e.input.charCodeAt(++e.position),B(e,!0,t),K(e,t,c,!1,!0),p=e.result),s?q(e,r,v,l,u,p):i?r.push(q(e,null,v,l,u,p)):r.push(u),B(e,!0,t),44===(f=e.input.charCodeAt(e.position))?(h=!0,f=e.input.charCodeAt(++e.position)):h=!1}N(e,"unexpected end of the stream within a flow collection")}(e,_)?I=!0:(s&&function(e,t){var n,o,i,a,s,u=h,c=!1,l=!1,p=t,f=0,v=!1;if(124===(a=e.input.charCodeAt(e.position)))o=!1;else{if(62!==a)return!1;o=!0}for(e.kind="scalar",e.result="";0!==a;)if(43===(a=e.input.charCodeAt(++e.position))||45===a)h===u?u=43===a?m:d:N(e,"repeat of a chomping mode identifier");else{if(!((i=48<=(s=a)&&s<=57?s-48:-1)>=0))break;0===i?N(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?N(e,"repeat of an indentation width identifier"):(p=t+i-1,l=!0)}if(E(a)){do{a=e.input.charCodeAt(++e.position)}while(E(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!x(a)&&0!==a)}for(;0!==a;){for(F(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!l||e.lineIndent<p)&&32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>p&&(p=e.lineIndent),x(a))f++;else{if(e.lineIndent<p){u===m?e.result+=r.repeat("\n",c?1+f:f):u===h&&c&&(e.result+="\n");break}for(o?E(a)?(v=!0,e.result+=r.repeat("\n",c?1+f:f)):v?(v=!1,e.result+=r.repeat("\n",f+1)):0===f?c&&(e.result+=" "):e.result+=r.repeat("\n",f):e.result+=r.repeat("\n",c?1+f:f),c=!0,l=!0,f=0,n=e.position;!x(a)&&0!==a;)a=e.input.charCodeAt(++e.position);L(e,n,e.position,!1)}}return!0}(e,_)||function(e,t){var n,r,o;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(L(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,o=e.position}else x(n)?(L(e,r,o,!0),V(e,B(e,!1,t)),r=o=e.position):e.position===e.lineStart&&z(e)?N(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);N(e,"unexpected end of the stream within a single quoted scalar")}(e,_)||function(e,t){var n,r,o,i,a,s,u;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return L(e,n,e.position,!0),e.position++,!0;if(92===s){if(L(e,n,e.position,!0),x(s=e.input.charCodeAt(++e.position)))B(e,!1,t);else if(s<256&&T[s])e.result+=j[s],e.position++;else if((a=120===(u=s)?2:117===u?4:85===u?8:0)>0){for(o=a,i=0;o>0;o--)(a=k(s=e.input.charCodeAt(++e.position)))>=0?i=(i<<4)+a:N(e,"expected hexadecimal character");e.result+=A(i),e.position++}else N(e,"unknown escape sequence");n=r=e.position}else x(s)?(L(e,n,r,!0),V(e,B(e,!1,t)),n=r=e.position):e.position===e.lineStart&&z(e)?N(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}N(e,"unexpected end of the stream within a double quoted scalar")}(e,_)?I=!0:!function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!S(r)&&!C(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||N(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],B(e,!0,-1),!0}(e)?function(e,t,n){var r,o,i,a,s,u,c,l,p=e.kind,f=e.result;if(S(l=e.input.charCodeAt(e.position))||C(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(S(r=e.input.charCodeAt(e.position+1))||n&&C(r)))return!1;for(e.kind="scalar",e.result="",o=i=e.position,a=!1;0!==l;){if(58===l){if(S(r=e.input.charCodeAt(e.position+1))||n&&C(r))break}else if(35===l){if(S(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&z(e)||n&&C(l))break;if(x(l)){if(s=e.line,u=e.lineStart,c=e.lineIndent,B(e,!1,-1),e.lineIndent>=t){a=!0,l=e.input.charCodeAt(e.position);continue}e.position=i,e.line=s,e.lineStart=u,e.lineIndent=c;break}}a&&(L(e,o,i,!1),V(e,e.line-s),o=i=e.position,a=!1),E(l)||(i=e.position+1),l=e.input.charCodeAt(++e.position)}return L(e,o,i,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,_,c===n)&&(I=!0,null===e.tag&&(e.tag="?")):(I=!0,null===e.tag&&null===e.anchor||N(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===O&&(I=v&&H(e,w))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(g=0,y=e.implicitTypes.length;g<y;g+=1)if((b=e.implicitTypes[g]).resolve(e.result)){e.result=b.construct(e.result),e.tag=b.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else u.call(e.typeMap[e.kind||"fallback"],e.tag)?(b=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&b.kind!==e.kind&&N(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result)?(e.result=b.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):N(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):N(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||I}function Y(e){var t,n,r,o,i=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(o=e.input.charCodeAt(e.position))&&(B(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==o));){for(a=!0,o=e.input.charCodeAt(++e.position),t=e.position;0!==o&&!S(o);)o=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&N(e,"directive name must not be less than one character in length");0!==o;){for(;E(o);)o=e.input.charCodeAt(++e.position);if(35===o){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&!x(o));break}if(x(o))break;for(t=e.position;0!==o&&!S(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==o&&F(e),u.call(D,n)?D[n](e,n,r):R(e,'unknown document directive "'+n+'"')}B(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,B(e,!0,-1)):a&&N(e,"directives end mark is expected"),K(e,e.lineIndent-1,f,!1,!0),B(e,!0,-1),e.checkLineBreaks&&g.test(e.input.slice(i,e.position))&&R(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&z(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,B(e,!0,-1)):e.position<e.length-1&&N(e,"end of the stream or a document separator is expected")}function $(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new I(e,t);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Y(n);return n.documents}function G(e,t,n){var r,o,i=$(e,n);if("function"!=typeof t)return i;for(r=0,o=i.length;r<o;r+=1)t(i[r])}function Z(e,t){var n=$(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new o("expected a single document in the stream, but found more")}}e.exports.loadAll=G,e.exports.load=Z,e.exports.safeLoadAll=function(e,t,n){if("function"!=typeof t)return G(e,r.extend({schema:a},n));G(e,t,r.extend({schema:a},n))},e.exports.safeLoad=function(e,t){return Z(e,r.extend({schema:a},t))}},function(e,t,n){"use strict";var r=n(113);function o(e,t,n,r,o){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=o}o.prototype.getSnippet=function(e,t){var n,o,i,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",o=this.position;o>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(o-1));)if(o-=1,this.position-o>t/2-1){n=" ... ",o+=5;break}for(i="",a=this.position;a<this.buffer.length&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(a));)if((a+=1)-this.position>t/2-1){i=" ... ",a-=5;break}return s=this.buffer.slice(o,a),r.repeat(" ",e)+n+s+i+"\n"+r.repeat(" ",e+this.position-o+n.length)+"^"},o.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},e.exports=o},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(113),o=n(31);function i(e){return 48<=e&&e<=55}function a(e){return 48<=e&&e<=57}e.exports=new o("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,o=0,s=!1;if(!r)return!1;if("-"!==(t=e[o])&&"+"!==t||(t=e[++o]),"0"===t){if(o+1===r)return!0;if("b"===(t=e[++o])){for(o++;o<r;o++)if("_"!==(t=e[o])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(o++;o<r;o++)if("_"!==(t=e[o])){if(!(48<=(n=e.charCodeAt(o))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==t}for(;o<r;o++)if("_"!==(t=e[o])){if(!i(e.charCodeAt(o)))return!1;s=!0}return s&&"_"!==t}if("_"===t)return!1;for(;o<r;o++)if("_"!==(t=e[o])){if(":"===t)break;if(!a(e.charCodeAt(o)))return!1;s=!0}return!(!s||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(o)))},construct:function(e){var t,n,r=e,o=1,i=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(t=r[0])&&"+"!==t||("-"===t&&(o=-1),t=(r=r.slice(1))[0]),"0"===r?0:"0"===t?"b"===r[1]?o*parseInt(r.slice(2),2):"x"===r[1]?o*parseInt(r,16):o*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(e){i.unshift(parseInt(e,10))}),r=0,n=1,i.forEach(function(e){r+=e*n,n*=60}),o*r):o*parseInt(r,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!r.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(e,t,n){"use strict";var r=n(113),o=n(31),i=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var a=/^[-+]?[0-9]+e/;e.exports=new o("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!i.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,r,o;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,o=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(e){o.unshift(parseFloat(e,10))}),t=0,r=1,o.forEach(function(e){t+=e*r,r*=60}),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(31),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==o.exec(e)||null!==i.exec(e))},construct:function(e){var t,n,r,a,s,u,c,l,p=0,f=null;if(null===(t=o.exec(e))&&(t=i.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(n,r,a));if(s=+t[4],u=+t[5],c=+t[6],t[7]){for(p=t[7].slice(0,3);p.length<3;)p+="0";p=+p}return t[9]&&(f=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(f=-f)),l=new Date(Date.UTC(n,r,a,s,u,c,p)),f&&l.setTime(l.getTime()-f),l},instanceOf:Date,represent:function(e){return e.toISOString()}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},function(e,t,n){"use strict";var r;try{r=n(64).Buffer}catch(e){}var o=n(31),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new o("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,o=e.length,a=i;for(n=0;n<o;n++)if(!((t=a.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,o=e.replace(/[\r\n=]/g,""),a=o.length,s=i,u=0,c=[];for(t=0;t<a;t++)t%4==0&&t&&(c.push(u>>16&255),c.push(u>>8&255),c.push(255&u)),u=u<<6|s.indexOf(o.charAt(t));return 0===(n=a%4*6)?(c.push(u>>16&255),c.push(u>>8&255),c.push(255&u)):18===n?(c.push(u>>10&255),c.push(u>>2&255)):12===n&&c.push(u>>4&255),r?r.from?r.from(c):new r(c):c},predicate:function(e){return r&&r.isBuffer(e)},represent:function(e){var t,n,r="",o=0,a=e.length,s=i;for(t=0;t<a;t++)t%3==0&&t&&(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]),o=(o<<8)+e[t];return 0===(n=a%3)?(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]):2===n?(r+=s[o>>10&63],r+=s[o>>4&63],r+=s[o<<2&63],r+=s[64]):1===n&&(r+=s[o>>2&63],r+=s[o<<4&63],r+=s[64],r+=s[64]),r}})},function(e,t,n){"use strict";var r=n(31),o=Object.prototype.hasOwnProperty,i=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,a,s,u=[],c=e;for(t=0,n=c.length;t<n;t+=1){if(r=c[t],s=!1,"[object Object]"!==i.call(r))return!1;for(a in r)if(o.call(r,a)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==u.indexOf(a))return!1;u.push(a)}return!0},construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";var r=n(31),o=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,a,s=e;for(a=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],"[object Object]"!==o.call(r))return!1;if(1!==(i=Object.keys(r)).length)return!1;a[t]=[i[0],r[i[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,o,i,a=e;for(i=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],o=Object.keys(r),i[t]=[o[0],r[o[0]]];return i}})},function(e,t,n){"use strict";var r=n(31),o=Object.prototype.hasOwnProperty;e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(o.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},function(e,t,n){"use strict";var r=n(31);e.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},function(e,t,n){"use strict";var r;try{r=n(801)}catch(e){"undefined"!=typeof window&&(r=window.esprima)}var o=n(31);e.exports=new o("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",n=r.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,n="("+e+")",o=r.parse(n,{range:!0}),i=[];if("Program"!==o.type||1!==o.body.length||"ExpressionStatement"!==o.body[0].type||"ArrowFunctionExpression"!==o.body[0].expression.type&&"FunctionExpression"!==o.body[0].expression.type)throw new Error("Failed to resolve function");return o.body[0].expression.params.forEach(function(e){i.push(e.name)}),t=o.body[0].expression.body.range,"BlockStatement"===o.body[0].expression.body.type?new Function(i,n.slice(t[0]+1,t[1]-1)):new Function(i,"return "+n.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},function(t,n){if(void 0===e){var r=new Error("Cannot find module 'esprima'");throw r.code="MODULE_NOT_FOUND",r}t.exports=e},function(e,t,n){"use strict";var r=n(113),o=n(138),i=n(183),a=n(139),s=Object.prototype.toString,u=Object.prototype.hasOwnProperty,c=9,l=10,p=32,f=33,h=34,d=35,m=37,v=38,g=39,y=42,b=44,_=45,w=58,x=62,E=63,S=64,C=91,k=93,O=96,A=123,T=124,j=125,P={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},I=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function M(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else{if(!(e<=4294967295))throw new o("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+r.repeat("0",i-t.length)+t}function N(e){this.schema=e.schema||i,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=r.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,o,i,a,s,c;if(null===t)return{};for(n={},o=0,i=(r=Object.keys(t)).length;o<i;o+=1)a=r[o],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&u.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[a]=s;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function R(e,t){for(var n,o=r.repeat(" ",t),i=0,a=-1,s="",u=e.length;i<u;)-1===(a=e.indexOf("\n",i))?(n=e.slice(i),i=u):(n=e.slice(i,a+1),i=a+1),n.length&&"\n"!==n&&(s+=o),s+=n;return s}function D(e,t){return"\n"+r.repeat(" ",e.indent*t)}function L(e){return e===p||e===c}function U(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function q(e){return U(e)&&65279!==e&&e!==b&&e!==C&&e!==k&&e!==A&&e!==j&&e!==w&&e!==d}function F(e){return/^\n* /.test(e)}var B=1,z=2,V=3,H=4,W=5;function J(e,t,n,r,o){var i,a,s,u=!1,c=!1,p=-1!==r,P=-1,I=U(s=e.charCodeAt(0))&&65279!==s&&!L(s)&&s!==_&&s!==E&&s!==w&&s!==b&&s!==C&&s!==k&&s!==A&&s!==j&&s!==d&&s!==v&&s!==y&&s!==f&&s!==T&&s!==x&&s!==g&&s!==h&&s!==m&&s!==S&&s!==O&&!L(e.charCodeAt(e.length-1));if(t)for(i=0;i<e.length;i++){if(!U(a=e.charCodeAt(i)))return W;I=I&&q(a)}else{for(i=0;i<e.length;i++){if((a=e.charCodeAt(i))===l)u=!0,p&&(c=c||i-P-1>r&&" "!==e[P+1],P=i);else if(!U(a))return W;I=I&&q(a)}c=c||p&&i-P-1>r&&" "!==e[P+1]}return u||c?n>9&&F(e)?W:c?H:V:I&&!o(e)?B:z}function K(e,t,n,r){e.dump=function(){if(0===t.length)return"''";if(!e.noCompatMode&&-1!==I.indexOf(t))return"'"+t+"'";var i=e.indent*Math.max(1,n),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=r||e.flowLevel>-1&&n>=e.flowLevel;switch(J(t,s,e.indent,a,function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)})){case B:return t;case z:return"'"+t.replace(/'/g,"''")+"'";case V:return"|"+Y(t,e.indent)+$(R(t,i));case H:return">"+Y(t,e.indent)+$(R(function(e,t){var n,r,o=/(\n+)([^\n]*)/g,i=(s=e.indexOf("\n"),s=-1!==s?s:e.length,o.lastIndex=s,G(e.slice(0,s),t)),a="\n"===e[0]||" "===e[0];var s;for(;r=o.exec(e);){var u=r[1],c=r[2];n=" "===c[0],i+=u+(a||n||""===c?"":"\n")+G(c,t),a=n}return i}(t,a),i));case W:return'"'+function(e){for(var t,n,r,o="",i=0;i<e.length;i++)(t=e.charCodeAt(i))>=55296&&t<=56319&&(n=e.charCodeAt(i+1))>=56320&&n<=57343?(o+=M(1024*(t-55296)+n-56320+65536),i++):(r=P[t],o+=!r&&U(t)?e[i]:r||M(t));return o}(t)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function Y(e,t){var n=F(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function $(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function G(e,t){if(""===e||" "===e[0])return e;for(var n,r,o=/ [^ ]/g,i=0,a=0,s=0,u="";n=o.exec(e);)(s=n.index)-i>t&&(r=a>i?a:s,u+="\n"+e.slice(i,r),i=r+1),a=s;return u+="\n",e.length-i>t&&a>i?u+=e.slice(i,a)+"\n"+e.slice(a+1):u+=e.slice(i),u.slice(1)}function Z(e,t,n){var r,i,a,c,l,p;for(a=0,c=(i=n?e.explicitTypes:e.implicitTypes).length;a<c;a+=1)if(((l=i[a]).instanceOf||l.predicate)&&(!l.instanceOf||"object"==typeof t&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(e.tag=n?l.tag:"?",l.represent){if(p=e.styleMap[l.tag]||l.defaultStyle,"[object Function]"===s.call(l.represent))r=l.represent(t,p);else{if(!u.call(l.represent,p))throw new o("!<"+l.tag+'> tag resolver accepts not "'+p+'" style');r=l.represent[p](t,p)}e.dump=r}return!0}return!1}function X(e,t,n,r,i,a){e.tag=null,e.dump=n,Z(e,n,!1)||Z(e,n,!0);var u=s.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var c,p,f="[object Object]"===u||"[object Array]"===u;if(f&&(p=-1!==(c=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||p||2!==e.indent&&t>0)&&(i=!1),p&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(f&&p&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),"[object Object]"===u)r&&0!==Object.keys(e.dump).length?(!function(e,t,n,r){var i,a,s,u,c,p,f="",h=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new o("sortKeys must be a boolean or a function");for(i=0,a=d.length;i<a;i+=1)p="",r&&0===i||(p+=D(e,t)),u=n[s=d[i]],X(e,t+1,s,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&l===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,c&&(p+=D(e,t)),X(e,t+1,u,!0,c)&&(e.dump&&l===e.dump.charCodeAt(0)?p+=":":p+=": ",f+=p+=e.dump));e.tag=h,e.dump=f||"{}"}(e,t,e.dump,i),p&&(e.dump="&ref_"+c+e.dump)):(!function(e,t,n){var r,o,i,a,s,u="",c=e.tag,l=Object.keys(n);for(r=0,o=l.length;r<o;r+=1)s=e.condenseFlow?'"':"",0!==r&&(s+=", "),a=n[i=l[r]],X(e,t,i,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),X(e,t,a,!1,!1)&&(u+=s+=e.dump));e.tag=c,e.dump="{"+u+"}"}(e,t,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump));else if("[object Array]"===u){var h=e.noArrayIndent&&t>0?t-1:t;r&&0!==e.dump.length?(!function(e,t,n,r){var o,i,a="",s=e.tag;for(o=0,i=n.length;o<i;o+=1)X(e,t+1,n[o],!0,!0)&&(r&&0===o||(a+=D(e,t)),e.dump&&l===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=s,e.dump=a||"[]"}(e,h,e.dump,i),p&&(e.dump="&ref_"+c+e.dump)):(!function(e,t,n){var r,o,i="",a=e.tag;for(r=0,o=n.length;r<o;r+=1)X(e,t,n[r],!1,!1)&&(0!==r&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=a,e.dump="["+i+"]"}(e,h,e.dump),p&&(e.dump="&ref_"+c+" "+e.dump))}else{if("[object String]"!==u){if(e.skipInvalid)return!1;throw new o("unacceptable kind of an object to dump "+u)}"?"!==e.tag&&K(e,e.dump,t,a)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function Q(e,t){var n,r,o=[],i=[];for(function e(t,n,r){var o,i,a;if(null!==t&&"object"==typeof t)if(-1!==(i=n.indexOf(t)))-1===r.indexOf(i)&&r.push(i);else if(n.push(t),Array.isArray(t))for(i=0,a=t.length;i<a;i+=1)e(t[i],n,r);else for(o=Object.keys(t),i=0,a=o.length;i<a;i+=1)e(t[o[i]],n,r)}(e,o,i),n=0,r=i.length;n<r;n+=1)t.duplicates.push(o[i[n]]);t.usedDuplicates=new Array(r)}function ee(e,t){var n=new N(t=t||{});return n.noRefs||Q(e,n),X(n,0,e,!0,!0)?n.dump+"\n":""}e.exports.dump=ee,e.exports.safeDump=function(e,t){return ee(e,r.extend({schema:a},t))}},function(e,t,n){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},function(e,t,n){"use strict";var r,o=Object.prototype.hasOwnProperty;function i(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,i,a=[];for(i in"string"!=typeof t&&(t="?"),e)if(o.call(e,i)){if((n=e[i])||null!==n&&n!==r&&!isNaN(n)||(n=""),i=encodeURIComponent(i),n=encodeURIComponent(n),null===i||null===n)continue;a.push(i+"="+n)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?&]+)=?([^&]*)/g,r={};t=n.exec(e);){var o=i(t[1]),a=i(t[2]);null===o||null===a||o in r||(r[o]=a)}return r}},function(e,t,n){var r=n(51);e.exports=function(){return r.Date.now()}},function(e,t,n){e.exports=n(807)},function(e,t,n){n(808),e.exports=n(22).Object.getPrototypeOf},function(e,t,n){var r=n(100),o=n(352);n(216)("getPrototypeOf",function(){return function(e){return o(r(e))}})},function(e,t,n){n(810),e.exports=n(22).Object.setPrototypeOf},function(e,t,n){var r=n(30);r(r.S,"Object",{setPrototypeOf:n(811).set})},function(e,t,n){var r=n(43),o=n(46),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(63)(Function.call,n(163).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t,n){n(813);var r=n(22).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){var r=n(30);r(r.S,"Object",{create:n(160)})},function(e,t,n){var r=n(420);function o(t,n){return e.exports=o=r||function(e,t){return e.__proto__=t,e},o(t,n)}e.exports=o},function(e,t,n){"use strict";var r=n(27),o=n(816),i=n(445),a=n(116),s=n(58),u=n(888),c=n(889),l=n(446),p=n(890);n(23);o.inject();var f={findDOMNode:c,render:i.render,unmountComponentAtNode:i.unmountComponentAtNode,version:u,unstable_batchedUpdates:s.batchedUpdates,unstable_renderSubtreeIntoContainer:p};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:r.getClosestInstanceFromNode,getNodeFromInstance:function(e){return e._renderedComponent&&(e=l(e)),e?r.getNodeFromInstance(e):null}},Mount:i,Reconciler:a}),e.exports=f},function(e,t,n){"use strict";var r=n(817),o=n(818),i=n(822),a=n(825),s=n(826),u=n(827),c=n(828),l=n(834),p=n(27),f=n(859),h=n(860),d=n(861),m=n(862),v=n(863),g=n(865),y=n(866),b=n(872),_=n(873),w=n(874),x=!1;e.exports={inject:function(){x||(x=!0,g.EventEmitter.injectReactEventListener(v),g.EventPluginHub.injectEventPluginOrder(a),g.EventPluginUtils.injectComponentTree(p),g.EventPluginUtils.injectTreeTraversal(h),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:s,ChangeEventPlugin:i,SelectEventPlugin:_,BeforeInputEventPlugin:o}),g.HostComponent.injectGenericComponentClass(l),g.HostComponent.injectTextComponentClass(d),g.DOMProperty.injectDOMPropertyConfig(r),g.DOMProperty.injectDOMPropertyConfig(u),g.DOMProperty.injectDOMPropertyConfig(b),g.EmptyComponent.injectEmptyComponentFactory(function(e){return new f(e)}),g.Updates.injectReconcileTransaction(y),g.Updates.injectBatchingStrategy(m),g.Component.injectEnvironment(c))}}},function(e,t,n){"use strict";e.exports={Properties:{"aria-current":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},DOMAttributeNames:{},DOMPropertyNames:{}}},function(e,t,n){"use strict";var r=n(140),o=n(38),i=n(819),a=n(820),s=n(821),u=[9,13,27,32],c=229,l=o.canUseDOM&&"CompositionEvent"in window,p=null;o.canUseDOM&&"documentMode"in document&&(p=document.documentMode);var f,h=o.canUseDOM&&"TextEvent"in window&&!p&&!("object"==typeof(f=window.opera)&&"function"==typeof f.version&&parseInt(f.version(),10)<=12),d=o.canUseDOM&&(!l||p&&p>8&&p<=11);var m=32,v=String.fromCharCode(m),g={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},y=!1;function b(e,t){switch(e){case"topKeyUp":return-1!==u.indexOf(t.keyCode);case"topKeyDown":return t.keyCode!==c;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function _(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}var w=null;function x(e,t,n,o){var s,u;if(l?s=function(e){switch(e){case"topCompositionStart":return g.compositionStart;case"topCompositionEnd":return g.compositionEnd;case"topCompositionUpdate":return g.compositionUpdate}}(e):w?b(e,n)&&(s=g.compositionEnd):function(e,t){return"topKeyDown"===e&&t.keyCode===c}(e,n)&&(s=g.compositionStart),!s)return null;d&&(w||s!==g.compositionStart?s===g.compositionEnd&&w&&(u=w.getData()):w=i.getPooled(o));var p=a.getPooled(s,t,n,o);if(u)p.data=u;else{var f=_(n);null!==f&&(p.data=f)}return r.accumulateTwoPhaseDispatches(p),p}function E(e,t,n,o){var a;if(!(a=h?function(e,t){switch(e){case"topCompositionEnd":return _(t);case"topKeyPress":return t.which!==m?null:(y=!0,v);case"topTextInput":var n=t.data;return n===v&&y?null:n;default:return null}}(e,n):function(e,t){if(w){if("topCompositionEnd"===e||!l&&b(e,t)){var n=w.getData();return i.release(w),w=null,n}return null}switch(e){case"topPaste":return null;case"topKeyPress":return t.which&&!function(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}(t)?String.fromCharCode(t.which):null;case"topCompositionEnd":return d?null:t.data;default:return null}}(e,n)))return null;var u=s.getPooled(g.beforeInput,t,n,o);return u.data=a,r.accumulateTwoPhaseDispatches(u),u}var S={eventTypes:g,extractEvents:function(e,t,n,r){return[x(e,t,n,r),E(e,t,n,r)]}};e.exports=S},function(e,t,n){"use strict";var r=n(25),o=n(90),i=n(425);function a(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}r(a.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[i()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),o.addPoolingTo(a),e.exports=a},function(e,t,n){"use strict";var r=n(68);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{data:null}),e.exports=o},function(e,t,n){"use strict";var r=n(68);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{data:null}),e.exports=o},function(e,t,n){"use strict";var r=n(141),o=n(140),i=n(38),a=n(27),s=n(58),u=n(68),c=n(428),l=n(250),p=n(251),f=n(429),h={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}};function d(e,t,n){var r=u.getPooled(h.change,e,t,n);return r.type="change",o.accumulateTwoPhaseDispatches(r),r}var m=null,v=null;var g=!1;function y(e){var t=d(v,e,l(e));s.batchedUpdates(b,t)}function b(e){r.enqueueEvents(e),r.processEventQueue(!1)}function _(){m&&(m.detachEvent("onchange",y),m=null,v=null)}function w(e,t){var n=c.updateValueIfChanged(e),r=!0===t.simulated&&P._allowSimulatedPassThrough;if(n||r)return e}function x(e,t){if("topChange"===e)return t}function E(e,t,n){"topFocus"===e?(_(),function(e,t){v=t,(m=e).attachEvent("onchange",y)}(t,n)):"topBlur"===e&&_()}i.canUseDOM&&(g=p("change")&&(!document.documentMode||document.documentMode>8));var S=!1;function C(){m&&(m.detachEvent("onpropertychange",k),m=null,v=null)}function k(e){"value"===e.propertyName&&w(v,e)&&y(e)}function O(e,t,n){"topFocus"===e?(C(),function(e,t){v=t,(m=e).attachEvent("onpropertychange",k)}(t,n)):"topBlur"===e&&C()}function A(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return w(v,n)}function T(e,t,n){if("topClick"===e)return w(t,n)}function j(e,t,n){if("topInput"===e||"topChange"===e)return w(t,n)}i.canUseDOM&&(S=p("input")&&(!document.documentMode||document.documentMode>9));var P={eventTypes:h,_allowSimulatedPassThrough:!0,_isInputEventSupported:S,extractEvents:function(e,t,n,r){var o,i,s,u,c=t?a.getNodeFromInstance(t):window;if("select"===(u=(s=c).nodeName&&s.nodeName.toLowerCase())||"input"===u&&"file"===s.type?g?o=x:i=E:f(c)?S?o=j:(o=A,i=O):function(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}(c)&&(o=T),o){var l=o(e,t,n);if(l)return d(l,n,r)}i&&i(e,c,t),"topBlur"===e&&function(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}(t,c)}};e.exports=P},function(e,t,n){"use strict";var r=n(824),o={};o.attachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&function(e,t,n){"function"==typeof e?e(t.getPublicInstance()):r.addComponentAsRefTo(t,e,n)}(n,e,t._owner)}},o.shouldUpdateRefs=function(e,t){var n=null,r=null;null!==e&&"object"==typeof e&&(n=e.ref,r=e._owner);var o=null,i=null;return null!==t&&"object"==typeof t&&(o=t.ref,i=t._owner),n!==o||"string"==typeof o&&i!==r},o.detachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&function(e,t,n){"function"==typeof e?e(null):r.removeComponentAsRefFrom(t,e,n)}(n,e,t._owner)}},e.exports=o},function(e,t,n){"use strict";var r=n(21);n(15);function o(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)}var i={addComponentAsRefTo:function(e,t,n){o(n)||r("119"),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){o(n)||r("120");var i=n.getPublicInstance();i&&i.refs[t]===e.getPublicInstance()&&n.detachRef(t)}};e.exports=i},function(e,t,n){"use strict";e.exports=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"]},function(e,t,n){"use strict";var r=n(140),o=n(27),i=n(186),a={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},s={eventTypes:a,extractEvents:function(e,t,n,s){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var u,c,l;if(s.window===s)u=s;else{var p=s.ownerDocument;u=p?p.defaultView||p.parentWindow:window}if("topMouseOut"===e){c=t;var f=n.relatedTarget||n.toElement;l=f?o.getClosestInstanceFromNode(f):null}else c=null,l=t;if(c===l)return null;var h=null==c?u:o.getNodeFromInstance(c),d=null==l?u:o.getNodeFromInstance(l),m=i.getPooled(a.mouseLeave,c,n,s);m.type="mouseleave",m.target=h,m.relatedTarget=d;var v=i.getPooled(a.mouseEnter,l,n,s);return v.type="mouseenter",v.target=d,v.relatedTarget=h,r.accumulateEnterLeaveDispatches(m,v,c,l),[m,v]}};e.exports=s},function(e,t,n){"use strict";var r=n(115),o=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,u=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,c={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:i,allowTransparency:0,alt:0,as:0,async:i,autoComplete:0,autoPlay:i,capture:i,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|i,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:i,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:i,defer:i,dir:0,disabled:i,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:i,formTarget:0,frameBorder:0,headers:0,height:0,hidden:i,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:i,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|i,muted:o|i,name:0,nonce:0,noValidate:i,open:i,optimum:0,pattern:0,placeholder:0,playsInline:i,poster:0,preload:0,profile:0,radioGroup:0,readOnly:i,referrerPolicy:0,rel:0,required:i,reversed:i,role:0,rows:s,rowSpan:a,sandbox:0,scope:0,scoped:i,scrolling:0,seamless:i,selected:o|i,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:a,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:i,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}};e.exports=c},function(e,t,n){"use strict";var r=n(253),o={processChildrenUpdates:n(833).dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};e.exports=o},function(e,t,n){"use strict";var r=n(21),o=n(117),i=n(38),a=n(830),s=n(57),u=(n(15),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(i.canUseDOM||r("56"),t||r("57"),"HTML"===e.nodeName&&r("58"),"string"==typeof t){var n=a(t,s)[0];e.parentNode.replaceChild(n,e)}else o.replaceChildWithTree(e,t)}});e.exports=u},function(e,t,n){"use strict";var r=n(38),o=n(831),i=n(832),a=n(15),s=r.canUseDOM?document.createElement("div"):null,u=/^\s*<(\w+)/;e.exports=function(e,t){var n=s;s||a(!1);var r=function(e){var t=e.match(u);return t&&t[1].toLowerCase()}(e),c=r&&i(r);if(c){n.innerHTML=c[1]+e+c[2];for(var l=c[0];l--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(t||a(!1),o(p).forEach(t));for(var f=Array.from(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return f}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e){return function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}(e)?Array.isArray(e)?e.slice():function(e){var t=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&r(!1),"number"!=typeof t&&r(!1),0===t||t-1 in e||r(!1),"function"==typeof e.callee&&r(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),o=0;o<t;o++)n[o]=e[o];return n}(e):[e]}},function(e,t,n){"use strict";var r=n(38),o=n(15),i=r.canUseDOM?document.createElement("div"):null,a={},s=[1,'<select multiple="true">',"</select>"],u=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],l=[1,'<svg xmlns="http://www.w3.org/2000/svg">',"</svg>"],p={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:s,option:s,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:c,th:c};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(e){p[e]=l,a[e]=!0}),e.exports=function(e){return i||o(!1),p.hasOwnProperty(e)||(e="*"),a.hasOwnProperty(e)||(i.innerHTML="*"===e?"<link />":"<"+e+"></"+e+">",a[e]=!i.firstChild),a[e]?p[e]:null}},function(e,t,n){"use strict";var r=n(253),o=n(27),i={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};e.exports=i},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(835),a=n(836),s=n(117),u=n(254),c=n(115),l=n(434),p=n(141),f=n(247),h=n(189),d=n(422),m=n(27),v=n(846),g=n(848),y=n(435),b=n(849),_=(n(53),n(850)),w=n(857),x=(n(57),n(188)),E=(n(15),n(251),n(258),n(428)),S=(n(262),n(23),d),C=p.deleteListener,k=m.getNodeFromInstance,O=h.listenTo,A=f.registrationNameModules,T={string:!0,number:!0},j="__html",P={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},I=11;function M(e,t){t&&(W[e._tag]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&j in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",function(e){if(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" This DOM node was rendered by `"+n+"`."}}return""}(e)))}function N(e,t,n,r){if(!(r instanceof w)){0;var o=e._hostContainerInfo,i=o._node&&o._node.nodeType===I?o._node:o._ownerDocument;O(t,i),r.getReactMountReady().enqueue(R,{inst:e,registrationName:t,listener:n})}}function R(){p.putListener(this.inst,this.registrationName,this.listener)}function D(){v.postMountWrapper(this)}function L(){b.postMountWrapper(this)}function U(){g.postMountWrapper(this)}var q={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"};function F(){E.track(this)}function B(){this._rootNodeID||r("63");var e=k(this);switch(e||r("64"),this._tag){case"iframe":case"object":this._wrapperState.listeners=[h.trapBubbledEvent("topLoad","load",e)];break;case"video":case"audio":for(var t in this._wrapperState.listeners=[],q)q.hasOwnProperty(t)&&this._wrapperState.listeners.push(h.trapBubbledEvent(t,q[t],e));break;case"source":this._wrapperState.listeners=[h.trapBubbledEvent("topError","error",e)];break;case"img":this._wrapperState.listeners=[h.trapBubbledEvent("topError","error",e),h.trapBubbledEvent("topLoad","load",e)];break;case"form":this._wrapperState.listeners=[h.trapBubbledEvent("topReset","reset",e),h.trapBubbledEvent("topSubmit","submit",e)];break;case"input":case"select":case"textarea":this._wrapperState.listeners=[h.trapBubbledEvent("topInvalid","invalid",e)]}}function z(){y.postUpdateWrapper(this)}var V={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},H={listing:!0,pre:!0,textarea:!0},W=o({menuitem:!0},V),J=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,K={},Y={}.hasOwnProperty;function $(e,t){return e.indexOf("-")>=0||null!=t.is}var G=1;function Z(e){var t=e.type;!function(e){Y.call(K,e)||(J.test(e)||r("65",e),K[e]=!0)}(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}Z.displayName="ReactDOMComponent",Z.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=G++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var o,a,c,p=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(B,this);break;case"input":v.mountWrapper(this,p,t),p=v.getHostProps(this,p),e.getReactMountReady().enqueue(F,this),e.getReactMountReady().enqueue(B,this);break;case"option":g.mountWrapper(this,p,t),p=g.getHostProps(this,p);break;case"select":y.mountWrapper(this,p,t),p=y.getHostProps(this,p),e.getReactMountReady().enqueue(B,this);break;case"textarea":b.mountWrapper(this,p,t),p=b.getHostProps(this,p),e.getReactMountReady().enqueue(F,this),e.getReactMountReady().enqueue(B,this)}if(M(this,p),null!=t?(o=t._namespaceURI,a=t._tag):n._tag&&(o=n._namespaceURI,a=n._tag),(null==o||o===u.svg&&"foreignobject"===a)&&(o=u.html),o===u.html&&("svg"===this._tag?o=u.svg:"math"===this._tag&&(o=u.mathml)),this._namespaceURI=o,e.useCreateElement){var f,h=n._ownerDocument;if(o===u.html)if("script"===this._tag){var d=h.createElement("div"),_=this._currentElement.type;d.innerHTML="<"+_+"></"+_+">",f=d.removeChild(d.firstChild)}else f=p.is?h.createElement(this._currentElement.type,p.is):h.createElement(this._currentElement.type);else f=h.createElementNS(o,this._currentElement.type);m.precacheNode(this,f),this._flags|=S.hasCachedChildNodes,this._hostParent||l.setAttributeForRoot(f),this._updateDOMProperties(null,p,e);var w=s(f);this._createInitialChildren(e,p,r,w),c=w}else{var x=this._createOpenTagMarkupAndPutListeners(e,p),E=this._createContentMarkup(e,p,r);c=!E&&V[this._tag]?x+"/>":x+">"+E+"</"+this._currentElement.type+">"}switch(this._tag){case"input":e.getReactMountReady().enqueue(D,this),p.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(L,this),p.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"select":case"button":p.autoFocus&&e.getReactMountReady().enqueue(i.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(U,this)}return c},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(A.hasOwnProperty(r))i&&N(this,r,i,e);else{"style"===r&&(i&&(i=this._previousStyleCopy=o({},t.style)),i=a.createMarkupForStyles(i,this));var s=null;null!=this._tag&&$(this._tag,t)?P.hasOwnProperty(r)||(s=l.createMarkupForCustomAttribute(r,i)):s=l.createMarkupForProperty(r,i),s&&(n+=" "+s)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+l.createMarkupForRoot()),n+=" "+l.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var i=T[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)r=x(i);else if(null!=a){r=this.mountChildren(a,e,n).join("")}}return H[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&s.queueHTML(r,o.__html);else{var i=T[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)""!==i&&s.queueText(r,i);else if(null!=a)for(var u=this.mountChildren(a,e,n),c=0;c<u.length;c++)s.queueChild(r,u[c])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var o=t.props,i=this._currentElement.props;switch(this._tag){case"input":o=v.getHostProps(this,o),i=v.getHostProps(this,i);break;case"option":o=g.getHostProps(this,o),i=g.getHostProps(this,i);break;case"select":o=y.getHostProps(this,o),i=y.getHostProps(this,i);break;case"textarea":o=b.getHostProps(this,o),i=b.getHostProps(this,i)}switch(M(this,i),this._updateDOMProperties(o,i,e),this._updateDOMChildren(o,i,e,r),this._tag){case"input":v.updateWrapper(this),E.updateValueIfChanged(this);break;case"textarea":b.updateWrapper(this);break;case"select":e.getReactMountReady().enqueue(z,this)}},_updateDOMProperties:function(e,t,n){var r,i,s;for(r in e)if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&null!=e[r])if("style"===r){var u=this._previousStyleCopy;for(i in u)u.hasOwnProperty(i)&&((s=s||{})[i]="");this._previousStyleCopy=null}else A.hasOwnProperty(r)?e[r]&&C(this,r):$(this._tag,e)?P.hasOwnProperty(r)||l.deleteValueForAttribute(k(this),r):(c.properties[r]||c.isCustomAttribute(r))&&l.deleteValueForProperty(k(this),r);for(r in t){var p=t[r],f="style"===r?this._previousStyleCopy:null!=e?e[r]:void 0;if(t.hasOwnProperty(r)&&p!==f&&(null!=p||null!=f))if("style"===r)if(p?p=this._previousStyleCopy=o({},p):this._previousStyleCopy=null,f){for(i in f)!f.hasOwnProperty(i)||p&&p.hasOwnProperty(i)||((s=s||{})[i]="");for(i in p)p.hasOwnProperty(i)&&f[i]!==p[i]&&((s=s||{})[i]=p[i])}else s=p;else if(A.hasOwnProperty(r))p?N(this,r,p,n):f&&C(this,r);else if($(this._tag,t))P.hasOwnProperty(r)||l.setValueForAttribute(k(this),r,p);else if(c.properties[r]||c.isCustomAttribute(r)){var h=k(this);null!=p?l.setValueForProperty(h,r,p):l.deleteValueForProperty(h,r)}}s&&a.setValueForStyles(k(this),s,this)},_updateDOMChildren:function(e,t,n,r){var o=T[typeof e.children]?e.children:null,i=T[typeof t.children]?t.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,u=null!=o?null:e.children,c=null!=i?null:t.children,l=null!=o||null!=a,p=null!=i||null!=s;null!=u&&null==c?this.updateChildren(null,n,r):l&&!p&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=s?a!==s&&this.updateMarkup(""+s):null!=c&&this.updateChildren(c,n,r)},getHostNode:function(){return k(this)},unmountComponent:function(e){switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":var t=this._wrapperState.listeners;if(t)for(var n=0;n<t.length;n++)t[n].remove();break;case"input":case"textarea":E.stopTracking(this);break;case"html":case"head":case"body":r("66",this._tag)}this.unmountChildren(e),m.uncacheNode(this),p.deleteAllListeners(this),this._rootNodeID=0,this._domID=0,this._wrapperState=null},getPublicInstance:function(){return k(this)}},o(Z.prototype,Z.Mixin,_.Mixin),e.exports=Z},function(e,t,n){"use strict";var r=n(27),o=n(432),i={focusDOMComponent:function(){o(r.getNodeFromInstance(this))}};e.exports=i},function(e,t,n){"use strict";var r=n(433),o=n(38),i=(n(53),n(837),n(839)),a=n(840),s=n(842),u=(n(23),s(function(e){return a(e)})),c=!1,l="cssFloat";if(o.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(e){c=!0}void 0===document.documentElement.style.cssFloat&&(l="styleFloat")}var f={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=0===r.indexOf("--"),a=e[r];0,null!=a&&(n+=u(r)+":",n+=i(r,a,t,o)+";")}return n||null},setValueForStyles:function(e,t,n){var o=e.style;for(var a in t)if(t.hasOwnProperty(a)){var s=0===a.indexOf("--");0;var u=i(a,t[a],n,s);if("float"!==a&&"cssFloat"!==a||(a=l),s)o.setProperty(a,u);else if(u)o[a]=u;else{var p=c&&r.shorthandPropertyExpansions[a];if(p)for(var f in p)o[f]="";else o[a]=""}}}};e.exports=f},function(e,t,n){"use strict";var r=n(838),o=/^-ms-/;e.exports=function(e){return r(e.replace(o,"ms-"))}},function(e,t,n){"use strict";var r=/-(.)/g;e.exports=function(e){return e.replace(r,function(e,t){return t.toUpperCase()})}},function(e,t,n){"use strict";var r=n(433),o=(n(23),r.isUnitlessNumber);e.exports=function(e,t,n,r){if(null==t||"boolean"==typeof t||""===t)return"";var i=isNaN(t);return r||i||0===t||o.hasOwnProperty(e)&&o[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}},function(e,t,n){"use strict";var r=n(841),o=/^ms-/;e.exports=function(e){return r(e).replace(o,"-ms-")}},function(e,t,n){"use strict";var r=/([A-Z])/g;e.exports=function(e){return e.replace(r,"-$1").toLowerCase()}},function(e,t,n){"use strict";e.exports=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}},function(e,t,n){"use strict";var r=n(188);e.exports=function(e){return'"'+r(e)+'"'}},function(e,t,n){"use strict";var r=n(141);var o={handleTopLevel:function(e,t,n,o){!function(e){r.enqueueEvents(e),r.processEventQueue(!1)}(r.extractEvents(e,t,n,o))}};e.exports=o},function(e,t,n){"use strict";var r=n(38);function o(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}var i={animationend:o("Animation","AnimationEnd"),animationiteration:o("Animation","AnimationIteration"),animationstart:o("Animation","AnimationStart"),transitionend:o("Transition","TransitionEnd")},a={},s={};r.canUseDOM&&(s=document.createElement("div").style,"AnimationEvent"in window||(delete i.animationend.animation,delete i.animationiteration.animation,delete i.animationstart.animation),"TransitionEvent"in window||delete i.transitionend.transition),e.exports=function(e){if(a[e])return a[e];if(!i[e])return e;var t=i[e];for(var n in t)if(t.hasOwnProperty(n)&&n in s)return a[e]=t[n];return""}},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(434),a=n(256),s=n(27),u=n(58);n(15),n(23);function c(){this._rootNodeID&&p.updateWrapper(this)}function l(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}var p={getHostProps:function(e,t){var n=a.getValue(t),r=a.getChecked(t);return o({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,listeners:null,onChange:f.bind(e),controlled:l(t)}},updateWrapper:function(e){var t=e._currentElement.props,n=t.checked;null!=n&&i.setValueForProperty(s.getNodeFromInstance(e),"checked",n||!1);var r=s.getNodeFromInstance(e),o=a.getValue(t);if(null!=o)if(0===o&&""===r.value)r.value="0";else if("number"===t.type){var u=parseFloat(r.value,10)||0;(o!=u||o==u&&r.value!=o)&&(r.value=""+o)}else r.value!==""+o&&(r.value=""+o);else null==t.value&&null!=t.defaultValue&&r.defaultValue!==""+t.defaultValue&&(r.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(r.defaultChecked=!!t.defaultChecked)},postMountWrapper:function(e){var t=e._currentElement.props,n=s.getNodeFromInstance(e);switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":n.value="",n.value=n.defaultValue;break;default:n.value=n.value}var r=n.name;""!==r&&(n.name=""),n.defaultChecked=!n.defaultChecked,n.defaultChecked=!n.defaultChecked,""!==r&&(n.name=r)}};function f(e){var t=this._currentElement.props,n=a.executeOnChange(t,e);u.asap(c,this);var o=t.name;if("radio"===t.type&&null!=o){for(var i=s.getNodeFromInstance(this),l=i;l.parentNode;)l=l.parentNode;for(var p=l.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),f=0;f<p.length;f++){var h=p[f];if(h!==i&&h.form===i.form){var d=s.getInstanceFromNode(h);d||r("90"),u.asap(c,d)}}}return n}e.exports=p},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(25),o=n(104),i=n(27),a=n(435),s=(n(23),!1);function u(e){var t="";return o.Children.forEach(e,function(e){null!=e&&("string"==typeof e||"number"==typeof e?t+=e:s||(s=!0))}),t}var c={mountWrapper:function(e,t,n){var r=null;if(null!=n){var o=n;"optgroup"===o._tag&&(o=o._hostParent),null!=o&&"select"===o._tag&&(r=a.getSelectValueContext(o))}var i,s=null;if(null!=r)if(i=null!=t.value?t.value+"":u(t.children),s=!1,Array.isArray(r)){for(var c=0;c<r.length;c++)if(""+r[c]===i){s=!0;break}}else s=""+r===i;e._wrapperState={selected:s}},postMountWrapper:function(e){var t=e._currentElement.props;null!=t.value&&i.getNodeFromInstance(e).setAttribute("value",t.value)},getHostProps:function(e,t){var n=r({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(n.selected=e._wrapperState.selected);var o=u(t.children);return o&&(n.children=o),n}};e.exports=c},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(256),a=n(27),s=n(58);n(15),n(23);function u(){this._rootNodeID&&c.updateWrapper(this)}var c={getHostProps:function(e,t){return null!=t.dangerouslySetInnerHTML&&r("91"),o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=i.getValue(t),o=n;if(null==n){var a=t.defaultValue,s=t.children;null!=s&&(null!=a&&r("92"),Array.isArray(s)&&(s.length<=1||r("93"),s=s[0]),a=""+s),null==a&&(a=""),o=a}e._wrapperState={initialValue:""+o,listeners:null,onChange:l.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=a.getNodeFromInstance(e),r=i.getValue(t);if(null!=r){var o=""+r;o!==n.value&&(n.value=o),null==t.defaultValue&&(n.defaultValue=o)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=a.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}};function l(e){var t=this._currentElement.props,n=i.executeOnChange(t,e);return s.asap(u,this),n}e.exports=c},function(e,t,n){"use strict";var r=n(21),o=n(257),i=(n(143),n(53),n(65),n(116)),a=n(851),s=(n(57),n(856));n(15);function u(e,t){return t&&(e=e||[]).push(t),e}function c(e,t){o.processChildrenUpdates(e,t)}var l={Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return a.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,o,i){var u;return u=s(t,0),a.updateChildren(e,u,n,r,o,this,this._hostContainerInfo,i,0),u},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],a=0;for(var s in r)if(r.hasOwnProperty(s)){var u=r[s];0;var c=i.mountComponent(u,t,this,this._hostContainerInfo,n,0);u._mountIndex=a++,o.push(c)}return o},updateTextContent:function(e){var t,n=this._renderedChildren;for(var o in a.unmountChildren(n,!1),n)n.hasOwnProperty(o)&&r("118");c(this,[(t=e,{type:"TEXT_CONTENT",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null})])},updateMarkup:function(e){var t,n=this._renderedChildren;for(var o in a.unmountChildren(n,!1),n)n.hasOwnProperty(o)&&r("118");c(this,[(t=e,{type:"SET_MARKUP",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null})])},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,o={},a=[],s=this._reconcilerUpdateChildren(r,e,a,o,t,n);if(s||r){var l,p=null,f=0,h=0,d=0,m=null;for(l in s)if(s.hasOwnProperty(l)){var v=r&&r[l],g=s[l];v===g?(p=u(p,this.moveChild(v,m,f,h)),h=Math.max(v._mountIndex,h),v._mountIndex=f):(v&&(h=Math.max(v._mountIndex,h)),p=u(p,this._mountChildAtIndex(g,a[d],m,f,t,n)),d++),f++,m=i.getHostNode(g)}for(l in o)o.hasOwnProperty(l)&&(p=u(p,this._unmountChild(r[l],o[l])));p&&c(this,p),this._renderedChildren=s}},unmountChildren:function(e){var t=this._renderedChildren;a.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex<r)return function(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:i.getHostNode(e),toIndex:n,afterNode:t}}(e,t,n)},createChild:function(e,t,n){return function(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}(n,t,e._mountIndex)},removeChild:function(e,t){return function(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}(e,t)},_mountChildAtIndex:function(e,t,n,r,o,i){return e._mountIndex=r,this.createChild(e,n,t)},_unmountChild:function(e,t){var n=this.removeChild(e,t);return e._mountIndex=null,n}}};e.exports=l},function(e,t,n){"use strict";(function(t){var r=n(116),o=n(436),i=(n(260),n(259)),a=n(440);n(23);function s(e,t,n,r){var i=void 0===e[n];null!=t&&i&&(e[n]=o(t,!0))}void 0!==t&&t.env;var u={instantiateChildren:function(e,t,n,r){if(null==e)return null;var o={};return a(e,s,o),o},updateChildren:function(e,t,n,a,s,u,c,l,p){if(t||e){var f,h;for(f in t)if(t.hasOwnProperty(f)){var d=(h=e&&e[f])&&h._currentElement,m=t[f];if(null!=h&&i(d,m))r.receiveComponent(h,m,s,l),t[f]=h;else{h&&(a[f]=r.getHostNode(h),r.unmountComponent(h,!1));var v=o(m,!0);t[f]=v;var g=r.mountComponent(v,s,u,c,l,p);n.push(g)}}for(f in e)!e.hasOwnProperty(f)||t&&t.hasOwnProperty(f)||(h=e[f],a[f]=r.getHostNode(h),r.unmountComponent(h,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];r.unmountComponent(o,t)}}};e.exports=u}).call(this,n(67))},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(104),a=n(257),s=n(65),u=n(249),c=n(143),l=(n(53),n(437)),p=n(116),f=n(165),h=(n(15),n(258)),d=n(259),m=(n(23),0),v=1,g=2;function y(e){}function b(e,t){0}y.prototype.render=function(){var e=c.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return b(e,t),t};var _=1,w={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,o){this._context=o,this._mountOrder=_++,this._hostParent=t,this._hostContainerInfo=n;var a,s=this._currentElement.props,u=this._processContext(o),l=this._currentElement.type,p=e.getUpdateQueue(),h=function(e){return!(!e.prototype||!e.prototype.isReactComponent)}(l),d=this._constructComponent(h,s,u,p);h||null!=d&&null!=d.render?!function(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}(l)?this._compositeType=m:this._compositeType=v:(a=d,b(),null===d||!1===d||i.isValidElement(d)||r("105",l.displayName||l.name||"Component"),d=new y(l),this._compositeType=g),d.props=s,d.context=u,d.refs=f,d.updater=p,this._instance=d,c.set(d,this);var w,x=d.state;return void 0===x&&(d.state=x=null),("object"!=typeof x||Array.isArray(x))&&r("106",this.getName()||"ReactCompositeComponent"),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,w=d.unstable_handleError?this.performInitialMountWithErrorHandling(a,t,n,e,o):this.performInitialMount(a,t,n,e,o),d.componentDidMount&&e.getReactMountReady().enqueue(d.componentDidMount,d),w},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var o=this._currentElement.type;return e?new o(t,n,r):o(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,o){var i,a=r.checkpoint();try{i=this.performInitialMount(e,t,n,r,o)}catch(s){r.rollback(a),this._instance.unstable_handleError(s),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),a=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(a),i=this.performInitialMount(e,t,n,r,o)}return i},performInitialMount:function(e,t,n,r,o){var i=this._instance;i.componentWillMount&&(i.componentWillMount(),this._pendingStateQueue&&(i.state=this._processPendingState(i.props,i.context))),void 0===e&&(e=this._renderValidatedComponent());var a=l.getType(e);this._renderedNodeType=a;var s=this._instantiateReactComponent(e,a!==l.EMPTY);return this._renderedComponent=s,p.mountComponent(s,r,t,n,this._processChildContext(o),0)},getHostNode:function(){return p.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";u.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(p.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,c.remove(t)}},_maskContext:function(e){var t=this._currentElement.type.contextTypes;if(!t)return f;var n={};for(var r in t)n[r]=e[r];return n},_processContext:function(e){return this._maskContext(e)},_processChildContext:function(e){var t,n=this._currentElement.type,i=this._instance;if(i.getChildContext&&(t=i.getChildContext()),t){for(var a in"object"!=typeof n.childContextTypes&&r("107",this.getName()||"ReactCompositeComponent"),t)a in n.childContextTypes||r("108",this.getName()||"ReactCompositeComponent",a);return o({},e,t)}return e},_checkContextTypes:function(e,t,n){0},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?p.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,o,i){var a=this._instance;null==a&&r("136",this.getName()||"ReactCompositeComponent");var s,u=!1;this._context===i?s=a.context:(s=this._processContext(i),u=!0);var c=t.props,l=n.props;t!==n&&(u=!0),u&&a.componentWillReceiveProps&&a.componentWillReceiveProps(l,s);var p=this._processPendingState(l,s),f=!0;this._pendingForceUpdate||(a.shouldComponentUpdate?f=a.shouldComponentUpdate(l,p,s):this._compositeType===v&&(f=!h(c,l)||!h(a.state,p))),this._updateBatchNumber=null,f?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,l,p,s,e,i)):(this._currentElement=n,this._context=i,a.props=l,a.state=p,a.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,i=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(i&&1===r.length)return r[0];for(var a=o({},i?r[0]:n.state),s=i?1:0;s<r.length;s++){var u=r[s];o(a,"function"==typeof u?u.call(n,a,e,t):u)}return a},_performComponentUpdate:function(e,t,n,r,o,i){var a,s,u,c=this._instance,l=Boolean(c.componentDidUpdate);l&&(a=c.props,s=c.state,u=c.context),c.componentWillUpdate&&c.componentWillUpdate(t,n,r),this._currentElement=e,this._context=i,c.props=t,c.state=n,c.context=r,this._updateRenderedComponent(o,i),l&&o.getReactMountReady().enqueue(c.componentDidUpdate.bind(c,a,s,u),c)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,o=this._renderValidatedComponent();if(d(r,o))p.receiveComponent(n,o,e,this._processChildContext(t));else{var i=p.getHostNode(n);p.unmountComponent(n,!1);var a=l.getType(o);this._renderedNodeType=a;var s=this._instantiateReactComponent(o,a!==l.EMPTY);this._renderedComponent=s;var u=p.mountComponent(s,e,this._hostParent,this._hostContainerInfo,this._processChildContext(t),0);this._replaceNodeWithMarkup(i,u,n)}},_replaceNodeWithMarkup:function(e,t,n){a.replaceNodeWithMarkup(e,t,n)},_renderValidatedComponentWithoutOwnerOrContext:function(){return this._instance.render()},_renderValidatedComponent:function(){var e;if(this._compositeType!==g){s.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{s.current=null}}else e=this._renderValidatedComponentWithoutOwnerOrContext();return null===e||!1===e||i.isValidElement(e)||r("109",this.getName()||"ReactCompositeComponent"),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n&&r("110");var o=t.getPublicInstance();(n.refs===f?n.refs={}:n.refs)[e]=o},detachRef:function(e){delete this.getPublicInstance().refs[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return this._compositeType===g?null:e},_instantiateReactComponent:null};e.exports=w},function(e,t,n){"use strict";var r=1;e.exports=function(){return r++}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=function(e){var t=e&&(r&&e[r]||e[o]);if("function"==typeof t)return t}},function(e,t,n){"use strict";(function(t){n(260);var r=n(440);n(23);function o(e,t,n,r){if(e&&"object"==typeof e){var o=e;0,void 0===o[n]&&null!=t&&(o[n]=t)}}void 0!==t&&t.env,e.exports=function(e,t){if(null==e)return e;var n={};return r(e,o,n),n}}).call(this,n(67))},function(e,t,n){"use strict";var r=n(25),o=n(90),i=n(185),a=(n(53),n(858)),s=[];var u={enqueue:function(){}};function c(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1,this.updateQueue=new a(this)}var l={getTransactionWrappers:function(){return s},getReactMountReady:function(){return u},getUpdateQueue:function(){return this.updateQueue},destructor:function(){},checkpoint:function(){},rollback:function(){}};r(c.prototype,i,l),o.addPoolingTo(c),e.exports=c},function(e,t,n){"use strict";var r=n(261);n(23);var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.transaction=t}return e.prototype.isMounted=function(e){return!1},e.prototype.enqueueCallback=function(e,t,n){this.transaction.isInTransaction()&&r.enqueueCallback(e,t,n)},e.prototype.enqueueForceUpdate=function(e){this.transaction.isInTransaction()&&r.enqueueForceUpdate(e)},e.prototype.enqueueReplaceState=function(e,t){this.transaction.isInTransaction()&&r.enqueueReplaceState(e,t)},e.prototype.enqueueSetState=function(e,t){this.transaction.isInTransaction()&&r.enqueueSetState(e,t)},e}();e.exports=o},function(e,t,n){"use strict";var r=n(25),o=n(117),i=n(27),a=function(e){this._currentElement=null,this._hostNode=null,this._hostParent=null,this._hostContainerInfo=null,this._domID=0};r(a.prototype,{mountComponent:function(e,t,n,r){var a=n._idCounter++;this._domID=a,this._hostParent=t,this._hostContainerInfo=n;var s=" react-empty: "+this._domID+" ";if(e.useCreateElement){var u=n._ownerDocument.createComment(s);return i.precacheNode(this,u),o(u)}return e.renderToStaticMarkup?"":"\x3c!--"+s+"--\x3e"},receiveComponent:function(){},getHostNode:function(){return i.getNodeFromInstance(this)},unmountComponent:function(){i.uncacheNode(this)}}),e.exports=a},function(e,t,n){"use strict";var r=n(21);n(15);function o(e,t){"_hostNode"in e||r("33"),"_hostNode"in t||r("33");for(var n=0,o=e;o;o=o._hostParent)n++;for(var i=0,a=t;a;a=a._hostParent)i++;for(;n-i>0;)e=e._hostParent,n--;for(;i-n>0;)t=t._hostParent,i--;for(var s=n;s--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}e.exports={isAncestor:function(e,t){"_hostNode"in e||r("35"),"_hostNode"in t||r("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1},getLowestCommonAncestor:o,getParentInstance:function(e){return"_hostNode"in e||r("36"),e._hostParent},traverseTwoPhase:function(e,t,n){for(var r,o=[];e;)o.push(e),e=e._hostParent;for(r=o.length;r-- >0;)t(o[r],"captured",n);for(r=0;r<o.length;r++)t(o[r],"bubbled",n)},traverseEnterLeave:function(e,t,n,r,i){for(var a=e&&t?o(e,t):null,s=[];e&&e!==a;)s.push(e),e=e._hostParent;for(var u,c=[];t&&t!==a;)c.push(t),t=t._hostParent;for(u=0;u<s.length;u++)n(s[u],"bubbled",r);for(u=c.length;u-- >0;)n(c[u],"captured",i)}}},function(e,t,n){"use strict";var r=n(21),o=n(25),i=n(253),a=n(117),s=n(27),u=n(188),c=(n(15),n(262),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});o(c.prototype,{mountComponent:function(e,t,n,r){var o=n._idCounter++,i=" react-text: "+o+" ";if(this._domID=o,this._hostParent=t,e.useCreateElement){var c=n._ownerDocument,l=c.createComment(i),p=c.createComment(" /react-text "),f=a(c.createDocumentFragment());return a.queueChild(f,a(l)),this._stringText&&a.queueChild(f,a(c.createTextNode(this._stringText))),a.queueChild(f,a(p)),s.precacheNode(this,l),this._closingComment=p,f}var h=u(this._stringText);return e.renderToStaticMarkup?h:"\x3c!--"+i+"--\x3e"+h+"\x3c!-- /react-text --\x3e"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();i.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=s.getNodeFromInstance(this).nextSibling;;){if(null==t&&r("67",this._domID),8===t.nodeType&&" /react-text "===t.nodeValue){this._closingComment=t;break}t=t.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),e.exports=c},function(e,t,n){"use strict";var r=n(25),o=n(58),i=n(185),a=n(57),s={initialize:a,close:function(){p.isBatchingUpdates=!1}},u=[{initialize:a,close:o.flushBatchedUpdates.bind(o)},s];function c(){this.reinitializeTransaction()}r(c.prototype,i,{getTransactionWrappers:function(){return u}});var l=new c,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,i){var a=p.isBatchingUpdates;return p.isBatchingUpdates=!0,a?e(t,n,r,o,i):l.perform(e,null,t,n,r,o,i)}};e.exports=p},function(e,t,n){"use strict";var r=n(25),o=n(442),i=n(38),a=n(90),s=n(27),u=n(58),c=n(250),l=n(864);function p(e){for(;e._hostParent;)e=e._hostParent;var t=s.getNodeFromInstance(e).parentNode;return s.getClosestInstanceFromNode(t)}function f(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function h(e){var t=c(e.nativeEvent),n=s.getClosestInstanceFromNode(t),r=n;do{e.ancestors.push(r),r=r&&p(r)}while(r);for(var o=0;o<e.ancestors.length;o++)n=e.ancestors[o],d._handleTopLevel(e.topLevelType,n,e.nativeEvent,c(e.nativeEvent))}r(f.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),a.addPoolingTo(f,a.twoArgumentPooler);var d={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:i.canUseDOM?window:null,setHandleTopLevel:function(e){d._handleTopLevel=e},setEnabled:function(e){d._enabled=!!e},isEnabled:function(){return d._enabled},trapBubbledEvent:function(e,t,n){return n?o.listen(n,t,d.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){return n?o.capture(n,t,d.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=function(e){e(l(window))}.bind(null,e);o.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(d._enabled){var n=f.getPooled(e,t);try{u.batchedUpdates(h,n)}finally{f.release(n)}}}};e.exports=d},function(e,t,n){"use strict";e.exports=function(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}},function(e,t,n){"use strict";var r=n(115),o=n(141),i=n(248),a=n(257),s=n(438),u=n(189),c=n(439),l=n(58),p={Component:a.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:o.injection,EventPluginUtils:i.injection,EventEmitter:u.injection,HostComponent:c.injection,Updates:l.injection};e.exports=p},function(e,t,n){"use strict";var r=n(25),o=n(426),i=n(90),a=n(189),s=n(443),u=(n(53),n(185)),c=n(261),l=[{initialize:s.getSelectionInformation,close:s.restoreSelection},{initialize:function(){var e=a.isEnabled();return a.setEnabled(!1),e},close:function(e){a.setEnabled(e)}},{initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}}];function p(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=o.getPooled(null),this.useCreateElement=e}var f={getTransactionWrappers:function(){return l},getReactMountReady:function(){return this.reactMountReady},getUpdateQueue:function(){return c},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null}};r(p.prototype,u,f),i.addPoolingTo(p),e.exports=p},function(e,t,n){"use strict";var r=n(38),o=n(868),i=n(425);function a(e,t,n,r){return e===n&&t===r}var s=r.canUseDOM&&"selection"in document&&!("getSelection"in window),u={getOffsets:s?function(e){var t=document.selection.createRange(),n=t.text.length,r=t.duplicate();r.moveToElementText(e),r.setEndPoint("EndToStart",t);var o=r.text.length;return{start:o,end:o+n}}:function(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,r=t.anchorOffset,o=t.focusNode,i=t.focusOffset,s=t.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(e){return null}var u=a(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)?0:s.toString().length,c=s.cloneRange();c.selectNodeContents(e),c.setEnd(s.startContainer,s.startOffset);var l=a(c.startContainer,c.startOffset,c.endContainer,c.endOffset)?0:c.toString().length,p=l+u,f=document.createRange();f.setStart(n,r),f.setEnd(o,i);var h=f.collapsed;return{start:h?p:l,end:h?l:p}},setOffsets:s?function(e,t){var n,r,o=document.selection.createRange().duplicate();void 0===t.end?r=n=t.start:t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}:function(e,t){if(window.getSelection){var n=window.getSelection(),r=e[i()].length,a=Math.min(t.start,r),s=void 0===t.end?a:Math.min(t.end,r);if(!n.extend&&a>s){var u=s;s=a,a=u}var c=o(e,a),l=o(e,s);if(c&&l){var p=document.createRange();p.setStart(c.node,c.offset),n.removeAllRanges(),a>s?(n.addRange(p),n.extend(l.node,l.offset)):(p.setEnd(l.node,l.offset),n.addRange(p))}}}};e.exports=u},function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function o(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}e.exports=function(e,t){for(var n=r(e),i=0,a=0;n;){if(3===n.nodeType){if(a=i+n.textContent.length,i<=t&&a>=t)return{node:n,offset:t-i};i=a}n=r(o(n))}}},function(e,t,n){"use strict";var r=n(870);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},function(e,t,n){"use strict";var r=n(871);e.exports=function(e){return r(e)&&3==e.nodeType}},function(e,t,n){"use strict";e.exports=function(e){var t=(e?e.ownerDocument||e:document).defaultView||window;return!(!e||!("function"==typeof t.Node?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}},function(e,t,n){"use strict";var r="http://www.w3.org/1999/xlink",o="http://www.w3.org/XML/1998/namespace",i={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},a={Properties:{},DOMAttributeNamespaces:{xlinkActuate:r,xlinkArcrole:r,xlinkHref:r,xlinkRole:r,xlinkShow:r,xlinkTitle:r,xlinkType:r,xmlBase:o,xmlLang:o,xmlSpace:o},DOMAttributeNames:{}};Object.keys(i).forEach(function(e){a.Properties[e]=0,i[e]&&(a.DOMAttributeNames[e]=i[e])}),e.exports=a},function(e,t,n){"use strict";var r=n(140),o=n(38),i=n(27),a=n(443),s=n(68),u=n(444),c=n(429),l=n(258),p=o.canUseDOM&&"documentMode"in document&&document.documentMode<=11,f={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},h=null,d=null,m=null,v=!1,g=!1;function y(e,t){if(v||null==h||h!==u())return null;var n=function(e){if("selectionStart"in e&&a.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}(h);if(!m||!l(m,n)){m=n;var o=s.getPooled(f.select,d,e,t);return o.type="select",o.target=h,r.accumulateTwoPhaseDispatches(o),o}return null}var b={eventTypes:f,extractEvents:function(e,t,n,r){if(!g)return null;var o=t?i.getNodeFromInstance(t):window;switch(e){case"topFocus":(c(o)||"true"===o.contentEditable)&&(h=o,d=t,m=null);break;case"topBlur":h=null,d=null,m=null;break;case"topMouseDown":v=!0;break;case"topContextMenu":case"topMouseUp":return v=!1,y(n,r);case"topSelectionChange":if(p)break;case"topKeyDown":case"topKeyUp":return y(n,r)}return null},didPutListener:function(e,t,n){"onSelect"===t&&(g=!0)}};e.exports=b},function(e,t,n){"use strict";var r=n(21),o=n(442),i=n(140),a=n(27),s=n(875),u=n(876),c=n(68),l=n(877),p=n(878),f=n(186),h=n(880),d=n(881),m=n(882),v=n(142),g=n(883),y=n(57),b=n(263),_=(n(15),{}),w={};["abort","animationEnd","animationIteration","animationStart","blur","canPlay","canPlayThrough","click","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t,r="top"+t,o={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[r]};_[e]=o,w[r]=o});var x={};function E(e){return"."+e._rootNodeID}function S(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}var C={eventTypes:_,extractEvents:function(e,t,n,o){var a,y=w[e];if(!y)return null;switch(e){case"topAbort":case"topCanPlay":case"topCanPlayThrough":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topVolumeChange":case"topWaiting":a=c;break;case"topKeyPress":if(0===b(n))return null;case"topKeyDown":case"topKeyUp":a=p;break;case"topBlur":case"topFocus":a=l;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":a=f;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":a=h;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":a=d;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":a=s;break;case"topTransitionEnd":a=m;break;case"topScroll":a=v;break;case"topWheel":a=g;break;case"topCopy":case"topCut":case"topPaste":a=u}a||r("86",e);var _=a.getPooled(y,t,n,o);return i.accumulateTwoPhaseDispatches(_),_},didPutListener:function(e,t,n){if("onClick"===t&&!S(e._tag)){var r=E(e),i=a.getNodeFromInstance(e);x[r]||(x[r]=o.listen(i,"click",y))}},willDeleteListener:function(e,t){if("onClick"===t&&!S(e._tag)){var n=E(e);x[n].remove(),delete x[n]}}};e.exports=C},function(e,t,n){"use strict";var r=n(68);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{animationName:null,elapsedTime:null,pseudoElement:null}),e.exports=o},function(e,t,n){"use strict";var r=n(68),o={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};function i(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(i,o),e.exports=i},function(e,t,n){"use strict";var r=n(142);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{relatedTarget:null}),e.exports=o},function(e,t,n){"use strict";var r=n(142),o=n(263),i={key:n(879),location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:n(252),charCode:function(e){return"keypress"===e.type?o(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?o(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,i),e.exports=a},function(e,t,n){"use strict";var r=n(263),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=function(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=r(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?i[e.keyCode]||"Unidentified":""}},function(e,t,n){"use strict";var r=n(186);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{dataTransfer:null}),e.exports=o},function(e,t,n){"use strict";var r=n(142),o={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:n(252)};function i(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(i,o),e.exports=i},function(e,t,n){"use strict";var r=n(68);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{propertyName:null,elapsedTime:null,pseudoElement:null}),e.exports=o},function(e,t,n){"use strict";var r=n(186);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),e.exports=o},function(e,t,n){"use strict";n(262);var r=9;e.exports=function(e,t){return{_topLevelWrapper:e,_idCounter:1,_ownerDocument:t?t.nodeType===r?t:t.ownerDocument:null,_node:t,_tag:t?t.nodeName.toLowerCase():null,_namespaceURI:t?t.namespaceURI:null}}},function(e,t,n){"use strict";e.exports={useCreateElement:!0,useFiber:!1}},function(e,t,n){"use strict";var r=n(887),o=/\/?>/,i=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return i.test(e)?e:e.replace(o," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(e)===n}};e.exports=a},function(e,t,n){"use strict";var r=65521;e.exports=function(e){for(var t=1,n=0,o=0,i=e.length,a=-4&i;o<a;){for(var s=Math.min(o+4096,a);o<s;o+=4)n+=(t+=e.charCodeAt(o))+(t+=e.charCodeAt(o+1))+(t+=e.charCodeAt(o+2))+(t+=e.charCodeAt(o+3));t%=r,n%=r}for(;o<i;o++)n+=t+=e.charCodeAt(o);return(t%=r)|(n%=r)<<16}},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(21),o=(n(65),n(27)),i=n(143),a=n(446);n(15),n(23);e.exports=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=i.get(e);if(t)return(t=a(t))?o.getNodeFromInstance(t):null;"function"==typeof e.render?r("44"):r("45",Object.keys(e))}},function(e,t,n){"use strict";var r=n(445);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(0),o=a(n(10)),i=a(n(447));a(n(448));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.store=n.store,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getChildContext=function(){return{store:this.store}},t.prototype.render=function(){return r.Children.only(this.props.children)},t}(r.Component);t.default=s,s.propTypes={store:i.default.isRequired,children:o.default.element.isRequired},s.childContextTypes={store:i.default.isRequired}},function(e,t,n){"use strict";var r=n(363);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e,t,n){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},v=Boolean(e),g=e||p,y=void 0;y="function"==typeof t?t:t?(0,s.default)(t):f;var b=n||h,_=l.pure,w=void 0===_||_,x=l.withRef,E=void 0!==x&&x,S=w&&b!==h,C=m++;return function(e){var t="Connect("+function(e){return e.displayName||e.name||"Component"}(e)+")";var n=function(n){function i(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e,r));o.version=C,o.store=e.store||r.store,(0,c.default)(o.store,'Could not find "store" in either the context or props of "'+t+'". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "'+t+'".');var a=o.store.getState();return o.state={storeState:a},o.clearCache(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,n),i.prototype.shouldComponentUpdate=function(){return!w||this.haveOwnPropsChanged||this.hasStoreStateChanged},i.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState();return this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n)},i.prototype.configureFinalMapState=function(e,t){var n=g(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:g,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):n},i.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch;return this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n)},i.prototype.configureFinalMapDispatch=function(e,t){var n=y(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:y,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):n},i.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return(!this.stateProps||!(0,a.default)(e,this.stateProps))&&(this.stateProps=e,!0)},i.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return(!this.dispatchProps||!(0,a.default)(e,this.dispatchProps))&&(this.dispatchProps=e,!0)},i.prototype.updateMergedPropsIfNeeded=function(){var e,t,n,r=(e=this.stateProps,t=this.dispatchProps,n=this.props,b(e,t,n));return!(this.mergedProps&&S&&(0,a.default)(r,this.mergedProps))&&(this.mergedProps=r,!0)},i.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},i.prototype.trySubscribe=function(){v&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},i.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},i.prototype.componentDidMount=function(){this.trySubscribe()},i.prototype.componentWillReceiveProps=function(e){w&&(0,a.default)(e,this.props)||(this.haveOwnPropsChanged=!0)},i.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},i.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},i.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!w||t!==e){if(w&&!this.doStatePropsDependOnOwnProps){var n=function(e,t){try{return e.apply(t)}catch(e){return d.value=e,d}}(this.updateStatePropsIfNeeded,this);if(!n)return;n===d&&(this.statePropsPrecalculationError=d.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},i.prototype.getWrappedInstance=function(){return(0,c.default)(E,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},i.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,i=this.haveStatePropsBeenPrecalculated,a=this.statePropsPrecalculationError,s=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,a)throw a;var u=!0,c=!0;w&&s&&(u=n||t&&this.doStatePropsDependOnOwnProps,c=t&&this.doDispatchPropsDependOnOwnProps);var l=!1,p=!1;i?l=!0:u&&(l=this.updateStatePropsIfNeeded()),c&&(p=this.updateDispatchPropsIfNeeded());return!(!!(l||p||t)&&this.updateMergedPropsIfNeeded())&&s?s:(this.renderedElement=E?(0,o.createElement)(e,r({},this.mergedProps,{ref:"wrappedInstance"})):(0,o.createElement)(e,this.mergedProps),this.renderedElement)},i}(o.Component);return n.displayName=t,n.WrappedComponent=e,n.contextTypes={store:i.default},n.propTypes={store:i.default},(0,u.default)(n,e)}};var o=n(0),i=l(n(447)),a=l(n(894)),s=l(n(895)),u=(l(n(448)),l(n(264)),l(n(896))),c=l(n(897));function l(e){return e&&e.__esModule?e:{default:e}}var p=function(e){return{}},f=function(e){return{dispatch:e}},h=function(e,t,n){return r({},n,e,t)};var d={value:null};var m=0},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<n.length;i++)if(!o.call(t,n[i])||e[n[i]]!==t[n[i]])return!1;return!0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){return function(t){return(0,r.bindActionCreators)(e,t)}};var r=n(124)},function(e,t,n){"use strict";var r=n(362),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var c=Object.defineProperty,l=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,d=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(d){var o=h(n);o&&o!==d&&e(t,o,r)}var a=l(n);p&&(a=a.concat(p(n)));for(var s=u(t),m=u(n),v=0;v<a.length;++v){var g=a[v];if(!(i[g]||r&&r[g]||m&&m[g]||s&&s[g])){var y=f(n,g);try{c(t,g,y)}catch(e){}}}return t}return t}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,s],l=0;(u=new Error(t.replace(/%s/g,function(){return c[l++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t,n){var r=n(118),o=n(85);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(118),o=n(450);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(52),o=n(175),i=n(902),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){(function(e){var r=n(51),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(173)(e))},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(118),o=n(230);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t,n){var r=n(118),o=n(451);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},function(e,t,n){var r=n(266),o=n(909),i=n(910),a=n(911),s=n(912),u="[object Boolean]",c="[object Date]",l="[object Map]",p="[object Number]",f="[object RegExp]",h="[object Set]",d="[object String]",m="[object Symbol]",v="[object ArrayBuffer]",g="[object DataView]",y="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",w="[object Int16Array]",x="[object Int32Array]",E="[object Uint8Array]",S="[object Uint8ClampedArray]",C="[object Uint16Array]",k="[object Uint32Array]";e.exports=function(e,t,n){var O=e.constructor;switch(t){case v:return r(e);case u:case c:return new O(+e);case g:return o(e,n);case y:case b:case _:case w:case x:case E:case S:case C:case k:return s(e,n);case l:return new O;case p:case d:return new O(e);case f:return i(e);case h:return new O;case m:return a(e)}}},function(e,t,n){var r=n(266);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},function(e,t,n){var r=n(106),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},function(e,t,n){var r=n(266);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(914),o=n(265),i=n(175);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},function(e,t,n){var r=n(52),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},function(e,t,n){var r=n(916),o=n(234),i=n(235),a=i&&i.isMap,s=a?o(a):r;e.exports=s},function(e,t,n){var r=n(176),o=n(66),i="[object Map]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t,n){var r=n(918),o=n(234),i=n(235),a=i&&i.isSet,s=a?o(a):r;e.exports=s},function(e,t,n){var r=n(176),o=n(66),i="[object Set]";e.exports=function(e){return o(e)&&r(e)==i}},function(e,t,n){var r=n(108),o=n(920),i=n(921),a=n(109);e.exports=function(e,t){return t=r(t,e),null==(e=i(e,t))||delete e[a(o(t))]}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){var r=n(177),o=n(368);e.exports=function(e,t){return t.length<2?e:r(e,o(t,0,-1))}},function(e,t,n){var r=n(264);e.exports=function(e){return r(e)?void 0:e}},function(e,t,n){var r=n(924);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},function(e,t,n){var r=n(229),o=n(925);e.exports=function e(t,n,i,a,s){var u=-1,c=t.length;for(i||(i=o),s||(s=[]);++u<c;){var l=t[u];n>0&&i(l)?n>1?e(l,n-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}},function(e,t,n){var r=n(106),o=n(231),i=n(37),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(928),o=n(419),i=n(237),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var n=800,r=16,o=Date.now;e.exports=function(e){var t=0,i=0;return function(){var a=o(),s=r-(a-i);if(i=a,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){"use strict";var r=n(931),o=n(932);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=b(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),p=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(933);function b(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var b=e=c.join(s);if(b=b.trim(),!n&&1===e.split("#").length){var _=u.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=a.exec(b);if(w){var x=(w=w[0]).toLowerCase();this.protocol=x,b=b.substr(w.length)}if(n||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===b.substr(0,2);!E||w&&v[w]||(b=b.substr(2),this.slashes=!0)}if(!v[w]&&(E||w&&!g[w])){for(var S,C,k=-1,O=0;O<f.length;O++){-1!==(A=b.indexOf(f[O]))&&(-1===k||A<k)&&(k=A)}-1!==(C=-1===k?b.lastIndexOf("@"):b.lastIndexOf("@",k))&&(S=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(S)),k=-1;for(O=0;O<p.length;O++){var A;-1!==(A=b.indexOf(p[O]))&&(-1===k||A<k)&&(k=A)}-1===k&&(k=b.length),this.host=b.slice(0,k),b=b.slice(k),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var j=this.hostname.split(/\./),P=(O=0,j.length);O<P;O++){var I=j[O];if(I&&!I.match(h)){for(var M="",N=0,R=I.length;N<R;N++)I.charCodeAt(N)>127?M+="x":M+=I[N];if(!M.match(h)){var D=j.slice(0,O),L=j.slice(O+1),U=I.match(d);U&&(D.push(U[1]),L.unshift(U[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=r.toASCII(this.hostname));var q=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+q,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[x])for(O=0,P=l.length;O<P;O++){var B=l[O];if(-1!==b.indexOf(B)){var z=encodeURIComponent(B);z===B&&(z=escape(B)),b=b.split(B).join(z)}}var V=b.indexOf("#");-1!==V&&(this.hash=b.substr(V),b=b.slice(0,V));var H=b.indexOf("?");if(-1!==H?(this.search=b.substr(H),this.query=b.substr(H+1),t&&(this.query=y.parse(this.query)),b=b.slice(0,H)):t&&(this.search="",this.query={}),b&&(this.pathname=b),g[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){q=this.pathname||"";var W=this.search||"";this.path=q+W}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,a="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(a=y.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+r},i.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,r=Object.keys(this),a=0;a<r.length;a++){var s=r[a];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(n[l]=e[l])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!g[e.protocol]){for(var p=Object.keys(e),f=0;f<p.length;f++){var h=p[f];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||v[e.protocol])n.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),n.pathname=d.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",y=n.search||"";n.path=m+y}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||b||n.host&&e.pathname,x=w,E=n.pathname&&n.pathname.split("/")||[],S=(d=e.pathname&&e.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(S&&(n.hostname="",n.port=null,n.host&&(""===E[0]?E[0]=n.host:E.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),w=w&&(""===d[0]||""===E[0])),_)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,E=d;else if(d.length)E||(E=[]),E.pop(),E=E.concat(d),n.search=e.search,n.query=e.query;else if(!o.isNullOrUndefined(e.search)){if(S)n.hostname=n.host=E.shift(),(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=E.slice(-1)[0],k=(n.host||e.host||E.length>1)&&("."===C||".."===C)||""===C,O=0,A=E.length;A>=0;A--)"."===(C=E[A])?E.splice(A,1):".."===C?(E.splice(A,1),O++):O&&(E.splice(A,1),O--);if(!w&&!x)for(;O--;O)E.unshift("..");!w||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),k&&"/"!==E.join("/").substr(-1)&&E.push("");var T,j=""===E[0]||E[0]&&"/"===E[0].charAt(0);S&&(n.hostname=n.host=j?"":E.length?E.shift():"",(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift()));return(w=w||n.host&&E.length)&&!j&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){(function(e,r){var o;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(i){t&&t.nodeType,e&&e.nodeType;var a="object"==typeof r&&r;a.global!==a&&a.window!==a&&a.self;var s,u=2147483647,c=36,l=1,p=26,f=38,h=700,d=72,m=128,v="-",g=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=c-l,x=Math.floor,E=String.fromCharCode;function S(e){throw RangeError(_[e])}function C(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function k(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+C((e=e.replace(b,".")).split("."),t).join(".")}function O(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function A(e){return C(e,function(e){var t="";return e>65535&&(t+=E((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=E(e)}).join("")}function T(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function j(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function P(e,t,n){var r=0;for(e=n?x(e/h):e>>1,e+=x(e/t);e>w*p>>1;r+=c)e=x(e/w);return x(r+(w+1)*e/(e+f))}function I(e){var t,n,r,o,i,a,s,f,h,g,y=[],b=e.length,_=0,w=m,E=d;for((n=e.lastIndexOf(v))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&S("not-basic"),y.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<b;){for(i=_,a=1,s=c;o>=b&&S("invalid-input"),((f=T(e.charCodeAt(o++)))>=c||f>x((u-_)/a))&&S("overflow"),_+=f*a,!(f<(h=s<=E?l:s>=E+p?p:s-E));s+=c)a>x(u/(g=c-h))&&S("overflow"),a*=g;E=P(_-i,t=y.length+1,0==i),x(_/t)>u-w&&S("overflow"),w+=x(_/t),_%=t,y.splice(_++,0,w)}return A(y)}function M(e){var t,n,r,o,i,a,s,f,h,g,y,b,_,w,C,k=[];for(b=(e=O(e)).length,t=m,n=0,i=d,a=0;a<b;++a)(y=e[a])<128&&k.push(E(y));for(r=o=k.length,o&&k.push(v);r<b;){for(s=u,a=0;a<b;++a)(y=e[a])>=t&&y<s&&(s=y);for(s-t>x((u-n)/(_=r+1))&&S("overflow"),n+=(s-t)*_,t=s,a=0;a<b;++a)if((y=e[a])<t&&++n>u&&S("overflow"),y==t){for(f=n,h=c;!(f<(g=h<=i?l:h>=i+p?p:h-i));h+=c)C=f-g,w=c-g,k.push(E(j(g+C%w,0))),f=x(C/w);k.push(E(j(f,0))),i=P(n,_,r==o),n=0,++r}++n,++t}return k.join("")}s={version:"1.3.2",ucs2:{decode:O,encode:A},decode:I,encode:M,toASCII:function(e){return k(e,function(e){return y.test(e)?"xn--"+M(e):e})},toUnicode:function(e){return k(e,function(e){return g.test(e)?I(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return s}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(173)(e),n(36))},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(934),t.encode=t.stringify=n(935)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var p,f,h,d,m=e[l].replace(s,"%20"),v=m.indexOf(n);v>=0?(p=m.substr(0,v),f=m.substr(v+1)):(p=m,f=""),h=decodeURIComponent(p),d=decodeURIComponent(f),r(a,h)?o(a[h])?a[h].push(d):a[h]=[a[h],d]:a[h]=d}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(a(e),function(a){var s=encodeURIComponent(r(a))+n;return o(e[a])?i(e[a],function(e){return s+encodeURIComponent(r(e))}).join(t):s+encodeURIComponent(r(e[a]))}).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){var r=n(184),o=n(118),i=n(937),a=n(107),s=n(175),u=n(85),c=Object.prototype.hasOwnProperty,l=i(function(e,t){if(s(t)||a(t))o(t,u(t),e);else for(var n in t)c.call(t,n)&&r(e,n,t[n])});e.exports=l},function(e,t,n){var r=n(938),o=n(389);e.exports=function(e){return r(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var u=n[r];u&&e(t,u,r,a)}return t})}},function(e,t,n){var r=n(237),o=n(454),i=n(455);e.exports=function(e,t){return i(o(e,t,r),e+"")}},function(e,t,n){ +/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017 Joachim Wester + * MIT license */ -var e=function(t){e.Util.assign(this,t)};return e.prototype={constructor:e,urls:!0,email:!0,twitter:!0,newWindow:!0,stripPrefix:!0,truncate:void 0,className:"",htmlParser:void 0,matchParser:void 0,tagBuilder:void 0,link:function(e){for(var t=this.getHtmlParser(),n=t.parse(e),r=0,i=[],o=0,a=n.length;o<a;o++){var s=n[o],u=s.getType(),l=s.getText();if("element"===u)"a"===s.getTagName()&&(s.isClosing()?r=Math.max(r-1,0):r++),i.push(l);else if("entity"===u)i.push(l);else if(0===r){var c=this.linkifyStr(l);i.push(c)}else i.push(l)}return i.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var n;return this.replaceFn&&(n=this.replaceFn.call(this,this,t)),"string"==typeof n?n:!1===n?t.getMatchedText():n instanceof e.HtmlTag?n.toString():this.getTagBuilder().build(t).toString()},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.htmlParser.HtmlParser),t},getMatchParser:function(){var t=this.matchParser;return t||(t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,stripPrefix:this.stripPrefix})),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t}},e.link=function(t,n){return new e(n).link(t)},e.match={},e.htmlParser={},e.matchParser={},e.Util={abstractMethod:function(){throw"abstract"},assign:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},extend:function(t,n){var r=t.prototype,i=function(){};i.prototype=r;var o;o=n.hasOwnProperty("constructor")?n.constructor:function(){r.constructor.apply(this,arguments)};var a=o.prototype=new i;return a.constructor=o,a.superclass=r,delete n.constructor,e.Util.assign(a,n),o},ellipsis:function(e,t,n){return e.length>t&&(n=null==n?"..":n,e=e.substring(0,t-n.length)+n),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],i=0;n=t.exec(e);)r.push(e.substring(i,n.index)),r.push(n[0]),i=n.index+n[0].length;return r.push(e.substring(i)),r}},e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){return this.getAttrs()[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var n=this.getAttrs();return e.Util.assign(n,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var n,r=this.getClass(),i=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(i):[],s=t.split(i);n=s.shift();)-1===o(a,n)&&a.push(n);return this.getAttrs().class=a.join(" "),this},removeClass:function(t){for(var n,r=this.getClass(),i=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(i):[],s=t.split(i);a.length&&(n=s.shift());){var u=o(a,n);-1!==u&&a.splice(u,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){return new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())})},createAttrs:function(e,t){var n={href:t},r=this.createCssClass(e);return r&&(n.class=r),this.newWindow&&(n.target="_blank"),n},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/[0-9a-zA-Z][0-9a-zA-Z:]*/,t=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,n=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,r=t.source+"(?:\\s*=\\s*"+n.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",r,"|",n.source+")",")*",">",")","|","(?:","<(/)?","("+e.source+")","(?:","\\s+",r,")*","\\s*/?",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,n,r=this.htmlRegex,i=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[1]||t[3],u=!!t[2],l=e.substring(i,t.index);l&&(n=this.parseTextAndEntityNodes(l),o.push.apply(o,n)),o.push(this.createElementNode(a,s,u)),i=t.index+a.length}if(i<e.length){var c=e.substring(i);c&&(n=this.parseTextAndEntityNodes(c),o.push.apply(o,n))}return o},parseTextAndEntityNodes:function(t){for(var n=[],r=e.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),i=0,o=r.length;i<o;i+=2){var a=r[i],s=r[i+1];a&&n.push(this.createTextNode(a)),s&&n.push(this.createEntityNode(s))}return n},createElementNode:function(t,n,r){return new e.htmlParser.ElementNode({text:t,tagName:n.toLowerCase(),closing:r})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}}),e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}}),e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}}),e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}}),e.matchParser.MatchParser=e.Util.extend(Object,{urls:!0,email:!0,twitter:!0,stripPrefix:!0,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(?:[\-;:&=\+\$,\w\.]+@)/,n=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,r=/(?:www\.)/,i=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,o=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,a=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",t.source,i.source,o.source,")","|","(","(?:","(",n.source,i.source,")","|","(?:","(.?//)?",r.source,i.source,")","|","(?:","(.?//)?",i.source,o.source,")",")","(?:"+a.source+")?",")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,n){var r=this;return e.replace(this.matcherRegex,function(e,i,o,a,s,u,l,c,p){var f=r.processCandidateMatch(e,i,o,a,s,u,l,c,p);if(f){var h=t.call(n,f.match);return f.prefixStr+h+f.suffixStr}return e})},processCandidateMatch:function(t,n,r,i,o,a,s,u,l){var c,p=u||l,f="",h="";if(n&&!this.twitter||o&&!this.email||a&&!this.urls||!this.matchValidator.isValidMatch(a,s,p))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),h=")"),o)c=new e.match.Email({matchedText:t,email:o});else if(n)r&&(f=r,t=t.slice(1)),c=new e.match.Twitter({matchedText:t,twitterHandle:i});else{if(p){var d=p.match(this.charBeforeProtocolRelMatchRegex)[1]||"";d&&(f=d,t=t.slice(1))}c=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!p,stripPrefix:this.stripPrefix})}return{prefixStr:f,suffixStr:h,match:c}},matchHasUnbalancedClosingParen:function(e){if(")"===e.charAt(e.length-1)){var t=e.match(/\(/g),n=e.match(/\)/g);if((t&&t.length||0)<(n&&n.length||0))return!0}return!1}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,n){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(n))},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return!(!e||!t)&&!this.hasWordCharAfterProtocolRegex.test(e)},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){return this.getUrl().replace(/&/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"getLayout",value:function(){var e=this.props,t=e.getComponent,n=e.layoutSelectors,r=n.current(),i=t(r,!0);return i||function(){return m.default.createElement("h1",null,' No layout defined for "',r,'" ')}}},{key:"render",value:function(){var e=this.getLayout();return m.default.createElement(e,null)}}]),t}(m.default.Component);t.default=y,y.propTypes={getComponent:g.default.func.isRequired,layoutSelectors:g.default.object.isRequired},y.defaultProps={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(18),s=r(a),u=n(4),l=r(u),c=n(2),p=r(c),f=n(3),h=r(f),d=n(6),m=r(d),v=n(5),g=r(v),y=n(0),_=r(y),b=n(1),x=r(b),w=n(12),k=r(w),E={color:"#999",fontStyle:"italic"},S=function(e){function t(){return(0,p.default)(this,t),(0,m.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,g.default)(t,e),(0,h.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.getConfigs,r=e.schema,i=e.depth,a=e.expandDepth,u=e.name,l=e.specPath,c=r.get("description"),p=r.get("items"),f=r.get("title")||u,h=r.filter(function(e,t){return-1===["type","items","description","$$ref"].indexOf(t)}),d=t("Markdown"),m=t("ModelCollapse"),v=t("Model"),g=t("Property"),y=f&&_.default.createElement("span",{className:"model-title"},_.default.createElement("span",{className:"model-title__text"},f));return _.default.createElement("span",{className:"model"},_.default.createElement(m,{title:y,expanded:i<=a,collapsedContent:"[...]"},"[",h.size?h.entrySeq().map(function(e){var t=(0,s.default)(e,2),n=t[0],r=t[1];return _.default.createElement(g,{key:n+"-"+r,propKey:n,propVal:r,propStyle:E})}):null,c?_.default.createElement(d,{source:c}):null,_.default.createElement("span",null,_.default.createElement(v,(0,o.default)({},this.props,{getConfigs:n,specPath:l.push("items"),name:null,schema:p,required:!1,depth:i+1}))),"]"))}}]),t}(y.Component);S.propTypes={schema:x.default.object.isRequired,getComponent:x.default.func.isRequired,getConfigs:x.default.func.isRequired,specSelectors:x.default.object.isRequired,name:x.default.string,required:x.default.bool,expandDepth:x.default.number,specPath:k.default.list.isRequired,depth:x.default.number},t.default=S},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(30),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=function(e){function t(e,n){(0,l.default)(this,t);var r=(0,h.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,n));x.call(r);var i=r.props,o=i.name,a=i.schema,u=r.getValue();return r.state={name:o,schema:a,value:u},r}return(0,m.default)(t,e),(0,p.default)(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,i=e.name,o=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),l=n("Markdown"),c=n("JumpToPath",!0),p=this.getValue(),f=r.allErrors().filter(function(e){return e.get("authId")===i});return g.default.createElement("div",null,g.default.createElement("h4",null,g.default.createElement("code",null,i||t.get("name")),"  (apiKey)",g.default.createElement(c,{path:["securityDefinitions",i]})),p&&g.default.createElement("h6",null,"Authorized"),g.default.createElement(a,null,g.default.createElement(l,{source:t.get("description")})),g.default.createElement(a,null,g.default.createElement("p",null,"Name: ",g.default.createElement("code",null,t.get("name")))),g.default.createElement(a,null,g.default.createElement("p",null,"In: ",g.default.createElement("code",null,t.get("in")))),g.default.createElement(a,null,g.default.createElement("label",null,"Value:"),p?g.default.createElement("code",null," ****** "):g.default.createElement(s,null,g.default.createElement(o,{type:"text",onChange:this.onChange}))),f.valueSeq().map(function(e,t){return g.default.createElement(u,{error:e,key:t})}))}}]),t}(g.default.Component);b.propTypes={authorized:_.default.object,getComponent:_.default.func.isRequired,errSelectors:_.default.object.isRequired,schema:_.default.object.isRequired,name:_.default.string.isRequired,onChange:_.default.func};var x=function(){var e=this;this.onChange=function(t){var n=e.props.onChange,r=t.target.value,i=(0,o.default)({},e.state,{value:r});e.setState(i),n(i)}};t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.name,r=e.getComponent,i=e.onAuthChange,o=e.authorized,a=e.errSelectors,s=r("apiKeyAuth"),u=r("basicAuth"),l=void 0,c=t.get("type");switch(c){case"apiKey":l=m.default.createElement(s,{key:n,schema:t,name:n,errSelectors:a,authorized:o,getComponent:r,onChange:i});break;case"basic":l=m.default.createElement(u,{key:n,schema:t,name:n,errSelectors:a,authorized:o,getComponent:r,onChange:i});break;default:l=m.default.createElement("div",{key:n},"Unknown security definition type ",c)}return m.default.createElement("div",{key:n+"-jump"},l)}}]),t}(m.default.Component);b.propTypes={schema:_.default.orderedMap.isRequired,name:g.default.string.isRequired,onAuthChange:g.default.func.isRequired,authorized:_.default.orderedMap.isRequired},b.propTypes={errSelectors:g.default.object.isRequired,getComponent:g.default.func.isRequired,authSelectors:g.default.object.isRequired,specSelectors:g.default.object.isRequired,authActions:g.default.object.isRequired,definitions:_.default.iterable.isRequired},t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.close=function(){r.props.authActions.showDefinitions(!1)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.authSelectors,n=e.authActions,r=e.getComponent,i=e.errSelectors,o=e.specSelectors,a=e.fn.AST,s=t.shownDefinitions(),u=r("auths");return m.default.createElement("div",{className:"dialog-ux"},m.default.createElement("div",{className:"backdrop-ux"}),m.default.createElement("div",{className:"modal-ux"},m.default.createElement("div",{className:"modal-dialog-ux"},m.default.createElement("div",{className:"modal-ux-inner"},m.default.createElement("div",{className:"modal-ux-header"},m.default.createElement("h3",null,"Available authorizations"),m.default.createElement("button",{type:"button",className:"close-modal",onClick:this.close},m.default.createElement("svg",{width:"20",height:"20"},m.default.createElement("use",{href:"#close",xlinkHref:"#close"})))),m.default.createElement("div",{className:"modal-ux-content"},s.valueSeq().map(function(e,s){return m.default.createElement(u,{key:s,AST:a,definitions:e,getComponent:r,errSelectors:i,authSelectors:t,authActions:n,specSelectors:o})}))))))}}]),t}(m.default.Component);y.propTypes={fn:g.default.object.isRequired,getComponent:g.default.func.isRequired,authSelectors:g.default.object.isRequired,specSelectors:g.default.object.isRequired,errSelectors:g.default.object.isRequired,authActions:g.default.object.isRequired},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onClick=function(){var e=r.props,t=e.authActions,n=e.authSelectors,i=n.definitionsToAuthorize();t.showDefinitions(i)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.authSelectors,n=e.getComponent,r=n("authorizationPopup",!0),i=!!t.shownDefinitions(),o=!!t.authorized().size;return m.default.createElement("div",{className:"auth-wrapper"},m.default.createElement("button",{className:o?"btn authorize locked":"btn authorize unlocked",onClick:this.onClick},m.default.createElement("span",null,"Authorize"),m.default.createElement("svg",{width:"20",height:"20"},m.default.createElement("use",{href:o?"#locked":"#unlocked",xlinkHref:o?"#locked":"#unlocked"}))),i&&m.default.createElement(r,null))}}]),t}(m.default.Component);y.propTypes={className:g.default.string},y.propTypes={getComponent:g.default.func.isRequired,authSelectors:g.default.object.isRequired,errActions:g.default.object.isRequired,authActions:g.default.object.isRequired},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onClick=function(e){e.stopPropagation();var t=r.props.onClick;t&&t()},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props.isAuthorized;return m.default.createElement("button",{className:e?"authorization__btn locked":"authorization__btn unlocked","aria-label":e?"authorization button locked":"authorization button unlocked",onClick:this.onClick},m.default.createElement("svg",{width:"20",height:"20"},m.default.createElement("use",{href:e?"#locked":"#unlocked",xlinkHref:e?"#locked":"#unlocked"})))}}]),t}(m.default.Component);y.propTypes={isAuthorized:g.default.bool.isRequired,onClick:g.default.func},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(36),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(12),x=r(b),w=function(e){function t(e,n){(0,l.default)(this,t);var r=(0,h.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,n));return r.onAuthChange=function(e){var t=e.name;r.setState((0,o.default)({},t,e))},r.submitAuth=function(e){e.preventDefault(),r.props.authActions.authorize(r.state)},r.logoutClick=function(e){e.preventDefault();var t=r.props,n=t.authActions,i=t.definitions,o=i.map(function(e,t){return t}).toArray();n.logout(o)},r.close=function(e){e.preventDefault(),r.props.authActions.showDefinitions(!1)},r.state={},r}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.definitions,r=t.getComponent,i=t.authSelectors,o=t.errSelectors,a=r("AuthItem"),s=r("oauth2",!0),u=r("Button"),l=i.authorized(),c=n.filter(function(e,t){return!!l.get(t)}),p=n.filter(function(e){return"oauth2"!==e.get("type")}),f=n.filter(function(e){return"oauth2"===e.get("type")});return g.default.createElement("div",{className:"auth-container"},!!p.size&&g.default.createElement("form",{onSubmit:this.submitAuth},p.map(function(t,n){return g.default.createElement(a,{key:n,schema:t,name:n,getComponent:r,onAuthChange:e.onAuthChange,authorized:l,errSelectors:o})}).toArray(),g.default.createElement("div",{className:"auth-btn-wrapper"},g.default.createElement(u,{className:"btn modal-btn auth btn-done",onClick:this.close},"Done"),p.size===c.size?g.default.createElement(u,{className:"btn modal-btn auth",onClick:this.logoutClick},"Logout"):g.default.createElement(u,{type:"submit",className:"btn modal-btn auth authorize"},"Authorize"))),f&&f.size?g.default.createElement("div",null,g.default.createElement("div",{className:"scope-def"},g.default.createElement("p",null,"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes."),g.default.createElement("p",null,"API requires the following scopes. Select which ones you want to grant to Swagger UI.")),n.filter(function(e){return"oauth2"===e.get("type")}).map(function(e,t){return g.default.createElement("div",{key:t},g.default.createElement(s,{authorized:l,schema:e,name:t}))}).toArray()):null)}}]),t}(g.default.Component);w.propTypes={definitions:_.default.object.isRequired,getComponent:_.default.func.isRequired,authSelectors:_.default.object.isRequired,authActions:_.default.object.isRequired,specSelectors:_.default.object.isRequired},w.propTypes={errSelectors:_.default.object.isRequired,getComponent:_.default.func.isRequired,authSelectors:_.default.object.isRequired,specSelectors:_.default.object.isRequired,authActions:_.default.object.isRequired,definitions:x.default.iterable.isRequired},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));x.call(r);var i=r.props,a=i.schema,u=i.name,l=r.getValue(),c=l.username;return r.state={name:u,schema:a,value:c?{username:c}:{}},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"getValue",value:function(){var e=this.props,t=e.authorized,n=e.name;return t&&t.getIn([n,"value"])||{}}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.name,i=e.errSelectors,o=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),l=n("JumpToPath",!0),c=n("Markdown"),p=this.getValue().username,f=i.allErrors().filter(function(e){return e.get("authId")===r});return m.default.createElement("div",null,m.default.createElement("h4",null,"Basic authorization",m.default.createElement(l,{path:["securityDefinitions",r]})),p&&m.default.createElement("h6",null,"Authorized"),m.default.createElement(a,null,m.default.createElement(c,{source:t.get("description")})),m.default.createElement(a,null,m.default.createElement("label",null,"Username:"),p?m.default.createElement("code",null," ",p," "):m.default.createElement(s,null,m.default.createElement(o,{type:"text",required:"required",name:"username",onChange:this.onChange}))),m.default.createElement(a,null,m.default.createElement("label",null,"Password:"),p?m.default.createElement("code",null," ****** "):m.default.createElement(s,null,m.default.createElement(o,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),f.valueSeq().map(function(e,t){return m.default.createElement(u,{error:e,key:t})}))}}]),t}(m.default.Component);b.propTypes={authorized:g.default.object,getComponent:g.default.func.isRequired,schema:g.default.object.isRequired,onChange:g.default.func.isRequired},b.propTypes={name:g.default.string.isRequired,errSelectors:g.default.object.isRequired,getComponent:g.default.func.isRequired,onChange:g.default.func,schema:_.default.map,authorized:_.default.map};var x=function(){var e=this;this.onChange=function(t){var n=e.props.onChange,r=t.target,i=r.value,o=r.name,a=e.state.value;a[o]=i,e.setState({value:a}),n(e.state)}};t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props.error,t=e.get("level"),n=e.get("message"),r=e.get("source");return m.default.createElement("div",{className:"errors",style:{backgroundColor:"#ffeeee",color:"red",margin:"1em"}},m.default.createElement("b",{style:{textTransform:"capitalize",marginRight:"1em"}},r," ",t),m.default.createElement("span",null,n))}}]),t}(m.default.Component);y.propTypes={error:g.default.object.isRequired},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(36),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(559),x=r(b),w=function(e){function t(e,n){(0,l.default)(this,t);var r=(0,h.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,n));k.call(r);var i=r.props,o=i.name,a=i.schema,u=i.authorized,c=i.authSelectors,p=u&&u.get(o),f=c.getConfigs()||{},d=p&&p.get("username")||"",m=p&&p.get("clientId")||f.clientId||"",v=p&&p.get("clientSecret")||f.clientSecret||"",g=p&&p.get("passwordType")||"request-body";return r.state={appName:f.appName,name:o,schema:a,scopes:[],clientId:m,clientSecret:v,username:d,password:"",passwordType:g},r}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.schema,r=t.getComponent,i=t.authSelectors,o=t.errSelectors,a=t.name,s=t.specSelectors,u=r("Input"),l=r("Row"),c=r("Col"),p=r("Button"),f=r("authError"),h=r("JumpToPath",!0),d=r("Markdown"),m=s.isOAS3,v=m()?"authorizationCode":"accessCode",y=m()?"clientCredentials":"application",_=n.get("flow"),b=n.get("allowedScopes")||n.get("scopes"),x=i.authorized().get(a),w=!!x,k=o.allErrors().filter(function(e){return e.get("authId")===a}),E=!k.filter(function(e){return"validation"===e.get("source")}).size,S=n.get("description");return g.default.createElement("div",null,g.default.createElement("h4",null,a," (OAuth2, ",n.get("flow"),") ",g.default.createElement(h,{path:["securityDefinitions",a]})),this.state.appName?g.default.createElement("h5",null,"Application: ",this.state.appName," "):null,S&&g.default.createElement(d,{source:n.get("description")}),w&&g.default.createElement("h6",null,"Authorized"),("implicit"===_||_===v)&&g.default.createElement("p",null,"Authorization URL: ",g.default.createElement("code",null,n.get("authorizationUrl"))),("password"===_||_===v||_===y)&&g.default.createElement("p",null,"Token URL:",g.default.createElement("code",null," ",n.get("tokenUrl"))),g.default.createElement("p",{className:"flow"},"Flow: ",g.default.createElement("code",null,n.get("flow"))),"password"!==_?null:g.default.createElement(l,null,g.default.createElement(l,null,g.default.createElement("label",{htmlFor:"oauth_username"},"username:"),w?g.default.createElement("code",null," ",this.state.username," "):g.default.createElement(c,{tablet:10,desktop:10},g.default.createElement("input",{id:"oauth_username",type:"text","data-name":"username",onChange:this.onInputChange}))),g.default.createElement(l,null,g.default.createElement("label",{htmlFor:"oauth_password"},"password:"),w?g.default.createElement("code",null," ****** "):g.default.createElement(c,{tablet:10,desktop:10},g.default.createElement("input",{id:"oauth_password",type:"password","data-name":"password",onChange:this.onInputChange}))),g.default.createElement(l,null,g.default.createElement("label",{htmlFor:"password_type"},"type:"),w?g.default.createElement("code",null," ",this.state.passwordType," "):g.default.createElement(c,{tablet:10,desktop:10},g.default.createElement("select",{id:"password_type","data-name":"passwordType",onChange:this.onInputChange},g.default.createElement("option",{value:"request-body"},"Request body"),g.default.createElement("option",{value:"basic"},"Basic auth"),g.default.createElement("option",{value:"query"},"Query parameters"))))),(_===y||"implicit"===_||_===v||"password"===_&&"basic"!==this.state.passwordType)&&(!w||w&&this.state.clientId)&&g.default.createElement(l,null,g.default.createElement("label",{htmlFor:"client_id"},"client_id:"),w?g.default.createElement("code",null," ****** "):g.default.createElement(c,{tablet:10,desktop:10},g.default.createElement("input",{id:"client_id",type:"text",required:"password"===_,value:this.state.clientId,"data-name":"clientId",onChange:this.onInputChange}))),(_===y||_===v||"password"===_&&"basic"!==this.state.passwordType)&&g.default.createElement(l,null,g.default.createElement("label",{htmlFor:"client_secret"},"client_secret:"),w?g.default.createElement("code",null," ****** "):g.default.createElement(c,{tablet:10,desktop:10},g.default.createElement("input",{id:"client_secret",value:this.state.clientSecret,type:"text","data-name":"clientSecret",onChange:this.onInputChange}))),!w&&b&&b.size?g.default.createElement("div",{className:"scopes"},g.default.createElement("h2",null,"Scopes:"),b.map(function(t,n){return g.default.createElement(l,{key:n},g.default.createElement("div",{className:"checkbox"},g.default.createElement(u,{"data-value":n,id:n+"-"+_+"-checkbox-"+e.state.name,disabled:w,type:"checkbox",onChange:e.onScopeChange}),g.default.createElement("label",{htmlFor:n+"-"+_+"-checkbox-"+e.state.name},g.default.createElement("span",{className:"item"}),g.default.createElement("div",{className:"text"},g.default.createElement("p",{className:"name"},n),g.default.createElement("p",{className:"description"},t)))))}).toArray()):null,k.valueSeq().map(function(e,t){return g.default.createElement(f,{error:e,key:t})}),g.default.createElement("div",{className:"auth-btn-wrapper"},E&&(w?g.default.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.logout},"Logout"):g.default.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.authorize},"Authorize"))))}}]),t}(g.default.Component);w.propTypes={name:_.default.string,authorized:_.default.object,getComponent:_.default.func.isRequired,schema:_.default.object.isRequired,authSelectors:_.default.object.isRequired,authActions:_.default.object.isRequired,errSelectors:_.default.object.isRequired,specSelectors:_.default.object.isRequired,errActions:_.default.object.isRequired,getConfigs:_.default.any};var k=function(){var e=this;this.authorize=function(){var t=e.props,n=t.authActions,r=t.errActions,i=t.getConfigs,o=t.authSelectors,a=i(),s=o.getConfigs();r.clear({authId:name,type:"auth",source:"auth"}),(0,x.default)({auth:e.state,authActions:n,errActions:r,configs:a,authConfigs:s})},this.onScopeChange=function(t){var n=t.target,r=n.checked,i=n.dataset.value;if(r&&-1===e.state.scopes.indexOf(i)){var o=e.state.scopes.concat([i]);e.setState({scopes:o})}else!r&&e.state.scopes.indexOf(i)>-1&&e.setState({scopes:e.state.scopes.filter(function(e){return e!==i})})},this.onInputChange=function(t){var n=t.target,r=n.dataset.name,i=n.value,a=(0,o.default)({},r,i);e.setState(a)},this.logout=function(t){t.preventDefault();var n=e.props,r=n.authActions,i=n.errActions,o=n.name;i.clear({authId:o,type:"auth",source:"auth"}),r.logout([o])}};t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onClick=function(){var e=r.props,t=e.specActions,n=e.path,i=e.method;t.clearResponse(n,i),t.clearRequest(n,i)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){return m.default.createElement("button",{className:"btn btn-clear opblock-control__btn",onClick:this.onClick},"Clear")}}]),t}(d.Component);y.propTypes={specActions:g.default.object.isRequired,path:g.default.string.isRequired,method:g.default.string.isRequired},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=n(7),x=function(){},w=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onChangeWrapper=function(e){return r.props.onChange(e.target.value)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}},{key:"componentWillReceiveProps",value:function(e){e.contentTypes&&e.contentTypes.size&&(e.contentTypes.includes(e.value)||e.onChange(e.contentTypes.first()))}},{key:"render",value:function(){var e=this.props,t=e.contentTypes,n=e.className,r=e.value;return t&&t.size?m.default.createElement("div",{className:"content-type-wrapper "+(n||"")},m.default.createElement("select",{className:"content-type",value:r||"",onChange:this.onChangeWrapper},t.map(function(e){return m.default.createElement("option",{key:e,value:e},e)}).toArray())):null}}]),t}(m.default.Component);w.propTypes={contentTypes:g.default.oneOfType([_.default.list,_.default.set,_.default.seq]),value:g.default.string,onChange:g.default.func,className:g.default.string},w.defaultProps={onChange:x,value:null,contentTypes:(0,b.fromJS)(["application/json"])},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(557),_=r(y),b=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"handleFocus",value:function(e){e.target.select(),document.execCommand("copy")}},{key:"render",value:function(){var e=this.props.request,t=(0,_.default)(e);return m.default.createElement("div",null,m.default.createElement("h4",null,"Curl"),m.default.createElement("div",{className:"copy-paste"},m.default.createElement("textarea",{onFocus:this.handleFocus,readOnly:"true",className:"curl",style:{whiteSpace:"normal"},value:t})))}}]),t}(m.default.Component);b.propTypes={request:g.default.object.isRequired},t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.DeepLink=void 0;var i=n(0),o=r(i),a=n(1),s=r(a),u=t.DeepLink=function(e){var t=e.enabled,n=e.path,r=e.text;return o.default.createElement("a",{className:"nostyle",onClick:t?function(e){return e.preventDefault()}:null,href:t?"#/"+n:null},o.default.createElement("span",null,r))};u.propTypes={enabled:s.default.bool,isShown:s.default.bool,path:s.default.string,text:s.default.string},t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(12),s=r(a),u=function(e){var t=e.value,n=e.getComponent,r=n("ModelCollapse"),i=o.default.createElement("span",null,"Array [ ",t.count()," ]");return o.default.createElement("span",{className:"prop-enum"},"Enum:",o.default.createElement("br",null),o.default.createElement(r,{collapsedContent:i},"[ ",t.join(", ")," ]"))};u.propTypes={value:s.default.iterable,getComponent:s.default.func},t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return(e||"").split(" ").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(" ")}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),a=r(o),s=n(2),u=r(s),l=n(3),c=r(l),p=n(6),f=r(p),h=n(5),d=r(h),m=n(0),v=r(m),g=n(1),y=r(g),_=n(7),b=n(448),x=function(e){function t(){return(0,u.default)(this,t),(0,f.default)(this,(t.__proto__||(0,a.default)(t)).apply(this,arguments))}return(0,d.default)(t,e),(0,c.default)(t,[{key:"render",value:function(){var e=this.props,t=e.editorActions,n=e.errSelectors,r=e.layoutSelectors,i=e.layoutActions;if(t&&t.jumpToLine)var o=t.jumpToLine;var a=n.allErrors(),s=a.filter(function(e){return"thrown"===e.get("type")||"error"===e.get("level")});if(!s||s.count()<1)return null;var u=r.isShown(["errorPane"],!0),l=function(){return i.show(["errorPane"],!u)},c=s.sortBy(function(e){return e.get("line")});return v.default.createElement("pre",{className:"errors-wrapper"},v.default.createElement("hgroup",{className:"error"},v.default.createElement("h4",{className:"errors__title"},"Errors"),v.default.createElement("button",{className:"btn errors__clear-btn",onClick:l},u?"Hide":"Show")),v.default.createElement(b.Collapse,{isOpened:u,animated:!0},v.default.createElement("div",{className:"errors"},c.map(function(e,t){var n=e.get("type");return"thrown"===n||"auth"===n?v.default.createElement(w,{key:t,error:e.get("error")||e,jumpToLine:o}):"spec"===n?v.default.createElement(k,{key:t,error:e,jumpToLine:o}):void 0}))))}}]),t}(v.default.Component);x.propTypes={editorActions:y.default.object,errSelectors:y.default.object.isRequired,layoutSelectors:y.default.object.isRequired,layoutActions:y.default.object.isRequired},t.default=x;var w=function(e){var t=e.error,n=e.jumpToLine;if(!t)return null;var r=t.get("line");return v.default.createElement("div",{className:"error-wrapper"},t?v.default.createElement("div",null,v.default.createElement("h4",null,t.get("source")&&t.get("level")?i(t.get("source"))+" "+t.get("level"):"",t.get("path")?v.default.createElement("small",null," at ",t.get("path")):null),v.default.createElement("span",{style:{whiteSpace:"pre-line",maxWidth:"100%"}},t.get("message")),v.default.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},r&&n?v.default.createElement("a",{onClick:n.bind(null,r)},"Jump to line ",r):null)):null)},k=function(e){var t=e.error,n=e.jumpToLine,r=null;return t.get("path")?r=_.List.isList(t.get("path"))?v.default.createElement("small",null,"at ",t.get("path").join(".")):v.default.createElement("small",null,"at ",t.get("path")):t.get("line")&&!n&&(r=v.default.createElement("small",null,"on line ",t.get("line"))),v.default.createElement("div",{className:"error-wrapper"},t?v.default.createElement("div",null,v.default.createElement("h4",null,i(t.get("source"))+" "+t.get("level")," ",r),v.default.createElement("span",{style:{whiteSpace:"pre-line"}},t.get("message")),v.default.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},n?v.default.createElement("a",{onClick:n.bind(null,t.get("line"))},"Jump to line ",t.get("line")):null)):null)};w.propTypes={error:y.default.object.isRequired,jumpToLine:y.default.func},w.defaultProps={jumpToLine:null},k.propTypes={error:y.default.object.isRequired,jumpToLine:y.default.func}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onClick=function(){var e=r.props,t=e.specSelectors,n=e.specActions,i=e.operation,o=e.path,a=e.method;n.validateParams([o,a]),t.validateBeforeExecute([o,a])&&(r.props.onExecute&&r.props.onExecute(),n.execute({operation:i,path:o,method:a}))},r.onChangeProducesWrapper=function(e){return r.props.specActions.changeProducesValue([r.props.path,r.props.method],e)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){return m.default.createElement("button",{className:"btn execute opblock-control__btn",onClick:this.onClick},"Execute")}}]),t}(d.Component);y.propTypes={specSelectors:g.default.object.isRequired,specActions:g.default.object.isRequired,operation:g.default.object.isRequired,path:g.default.string.isRequired,method:g.default.string.isRequired,onExecute:g.default.func},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){return m.default.createElement("div",{className:"footer"})}}]),t}(m.default.Component);t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(7),x=r(b),w={color:"#999",fontStyle:"italic"},k=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.headers,n=e.getComponent,r=n("Property");return t&&t.size?g.default.createElement("div",{className:"headers-wrapper"},g.default.createElement("h4",{className:"headers__title"},"Headers:"),g.default.createElement("table",{className:"headers"},g.default.createElement("thead",null,g.default.createElement("tr",{className:"header-row"},g.default.createElement("th",{className:"header-col"},"Name"),g.default.createElement("th",{className:"header-col"},"Description"),g.default.createElement("th",{className:"header-col"},"Type"))),g.default.createElement("tbody",null,t.entrySeq().map(function(e){var t=(0,o.default)(e,2),n=t[0],i=t[1];if(!x.default.Map.isMap(i))return null;var a=i.getIn(["schema"])?i.getIn(["schema","type"]):i.getIn(["type"]),s=i.getIn(["schema","example"]);return g.default.createElement("tr",{key:n},g.default.createElement("td",{className:"header-col"},n),g.default.createElement("td",{className:"header-col"},i.get("description")),g.default.createElement("td",{className:"header-col"},a," ",s?g.default.createElement(r,{propKey:"Example",propVal:s,propStyle:w}):null))}).toArray()))):null}}]),t}(g.default.Component);k.propTypes={headers:_.default.object.isRequired,getComponent:_.default.func.isRequired},t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(9),_=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.initializeComponent=function(e){r.el=e},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){(0,y.highlight)(this.el)}},{key:"componentDidUpdate",value:function(){(0,y.highlight)(this.el)}},{key:"render",value:function(){var e=this.props,t=e.value,n=e.className;return n=n||"",m.default.createElement("pre",{ref:this.initializeComponent,className:n+" microlight"},t)}}]),t}(d.Component);_.propTypes={value:g.default.string.isRequired,className:g.default.string},t.default=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(7),_=n(12),b=r(_),x=n(9),w=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.host,n=e.basePath;return m.default.createElement("pre",{className:"base-url"},"[ Base URL: ",t,n," ]")}}]),t}(m.default.Component);w.propTypes={host:g.default.string,basePath:g.default.string};var k=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props.data,t=e.get("name")||"the developer",n=e.get("url"),r=e.get("email");return m.default.createElement("div",null,n&&m.default.createElement("div",null,m.default.createElement("a",{href:(0,x.sanitizeUrl)(n),target:"_blank"},t," - Website")),r&&m.default.createElement("a",{href:(0,x.sanitizeUrl)("mailto:"+r)},n?"Send email to "+t:"Contact "+t))}}]),t}(m.default.Component);k.propTypes={data:g.default.object};var E=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props.license,t=e.get("name")||"License",n=e.get("url");return m.default.createElement("div",null,n?m.default.createElement("a",{target:"_blank",href:(0,x.sanitizeUrl)(n)},t):m.default.createElement("span",null,t))}}]),t}(m.default.Component);E.propTypes={license:g.default.object};var S=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.info,n=e.url,r=e.host,i=e.basePath,o=e.getComponent,a=e.externalDocs,s=t.get("version"),u=t.get("description"),l=t.get("title"),c=t.get("termsOfService"),p=t.get("contact"),f=t.get("license"),h=(a||(0,y.fromJS)({})).toJS(),d=h.url,v=h.description,g=o("Markdown"),_=o("VersionStamp");return m.default.createElement("div",{className:"info"},m.default.createElement("hgroup",{className:"main"},m.default.createElement("h2",{className:"title"},l,s&&m.default.createElement(_,{version:s})),r||i?m.default.createElement(w,{host:r,basePath:i}):null,n&&m.default.createElement("a",{target:"_blank",href:(0,x.sanitizeUrl)(n)},m.default.createElement("span",{className:"url"}," ",n," "))),m.default.createElement("div",{className:"description"},m.default.createElement(g,{source:u})),c&&m.default.createElement("div",null,m.default.createElement("a",{target:"_blank",href:(0,x.sanitizeUrl)(c)},"Terms of service")),p&&p.size?m.default.createElement(k,{data:p}):null,f&&f.size?m.default.createElement(E,{license:f}):null,d?m.default.createElement("a",{target:"_blank",href:(0,x.sanitizeUrl)(d)},v||d):null)}}]),t}(m.default.Component);S.propTypes={info:g.default.object,url:g.default.string,host:g.default.string,basePath:g.default.string,externalDocs:b.default.map,getComponent:g.default.func.isRequired},t.default=S,S.propTypes={title:g.default.any,description:g.default.any,version:g.default.any,url:g.default.string}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onFilterChange=function(e){var t=e.target.value;r.props.layoutActions.updateFilter(t)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.specActions,r=e.getComponent,i=e.layoutSelectors,o=e.oas3Selectors,a=e.oas3Actions,s=t.info(),u=t.url(),l=t.basePath(),c=t.host(),p=t.securityDefinitions(),f=t.externalDocs(),h=t.schemes(),d=t.servers(),v=r("info"),g=r("operations",!0),y=r("Models",!0),_=r("authorizeBtn",!0),b=r("Row"),x=r("Col"),w=r("Servers"),k=r("errors",!0),E="loading"===t.loadingStatus(),S="failed"===t.loadingStatus(),C=i.currentFilter(),A={};S&&(A.color="red"),E&&(A.color="#aaa");var D=r("schemes");if(!t.specStr()){var O=void 0;return O=E?m.default.createElement("div",{className:"loading"}):m.default.createElement("h4",null,"No API definition provided."),m.default.createElement("div",{className:"swagger-ui"},m.default.createElement("div",{className:"loading-container"},O))}return m.default.createElement("div",{className:"swagger-ui"},m.default.createElement("div",null,m.default.createElement(k,null),m.default.createElement(b,{className:"information-container"},m.default.createElement(x,{mobile:12},s.count()?m.default.createElement(v,{info:s,url:u,host:c,basePath:l,externalDocs:f,getComponent:r}):null)),h&&h.size||p?m.default.createElement("div",{className:"scheme-container"},m.default.createElement(x,{className:"schemes wrapper",mobile:12},h&&h.size?m.default.createElement(D,{currentScheme:t.operationScheme(),schemes:h,specActions:n}):null,p?m.default.createElement(_,null):null)):null,d&&d.size?m.default.createElement("div",{className:"global-server-container"},m.default.createElement(x,{className:"servers wrapper",mobile:12},m.default.createElement("span",{className:"servers-title"},"Server"),m.default.createElement(w,{servers:d,currentServer:o.selectedServer(),setSelectedServer:a.setSelectedServer,setServerVariableValue:a.setServerVariableValue,getServerVariable:o.serverVariableValue,getEffectiveServerValue:o.serverEffectiveValue}))):null,null===C||!1===C?null:m.default.createElement("div",{className:"filter-container"},m.default.createElement(x,{className:"filter wrapper",mobile:12},m.default.createElement("input",{className:"operation-filter-input",placeholder:"Filter by tag",type:"text",onChange:this.onFilterChange,value:!0===C||"true"===C?"":C,disabled:E,style:A}))),m.default.createElement(b,null,m.default.createElement(x,{mobile:12,desktop:12},m.default.createElement(g,null))),m.default.createElement(b,null,m.default.createElement(x,{mobile:12,desktop:12},m.default.createElement(y,null)))))}}]),t}(m.default.Component);y.propTypes={errSelectors:g.default.object.isRequired,errActions:g.default.object.isRequired,specActions:g.default.object.isRequired,specSelectors:g.default.object.isRequired,oas3Selectors:g.default.object.isRequired,oas3Actions:g.default.object.isRequired,layoutSelectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired,getComponent:g.default.func.isRequired},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(47),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(12),x=r(b),w=n(7),k=function(e){var t=e.headers;return g.default.createElement("div",null,g.default.createElement("h5",null,"Response headers"),g.default.createElement("pre",null,t))};k.propTypes={headers:_.default.array.isRequired};var E=function(e){var t=e.duration;return g.default.createElement("div",null,g.default.createElement("h5",null,"Request duration"),g.default.createElement("pre",null,t," ms"))};E.propTypes={duration:_.default.number.isRequired};var S=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.response!==e.response||this.props.path!==e.path||this.props.method!==e.method||this.props.displayRequestDuration!==e.displayRequestDuration}},{key:"render",value:function(){var e=this.props,t=e.response,n=e.getComponent,r=e.getConfigs,i=e.displayRequestDuration,a=e.specSelectors,s=e.path,u=e.method,l=r(),c=l.showMutatedRequest,p=c?a.mutatedRequestFor(s,u):a.requestFor(s,u),f=t.get("status"),h=p.get("url"),d=t.get("headers").toJS(),m=t.get("notDocumented"),v=t.get("error"),y=t.get("text"),_=t.get("duration"),b=(0,o.default)(d),x=d["content-type"],w=n("curl"),S=n("responseBody"),C=b.map(function(e){return g.default.createElement("span",{className:"headerline",key:e}," ",e,": ",d[e]," ")}),A=0!==C.length;return g.default.createElement("div",null,p&&g.default.createElement(w,{request:p}),h&&g.default.createElement("div",null,g.default.createElement("h4",null,"Request URL"),g.default.createElement("div",{className:"request-url"},g.default.createElement("pre",null,h))),g.default.createElement("h4",null,"Server response"),g.default.createElement("table",{className:"responses-table"},g.default.createElement("thead",null,g.default.createElement("tr",{className:"responses-header"},g.default.createElement("td",{className:"col col_header response-col_status"},"Code"),g.default.createElement("td",{className:"col col_header response-col_description"},"Details"))),g.default.createElement("tbody",null,g.default.createElement("tr",{className:"response"},g.default.createElement("td",{className:"col response-col_status"},f,m?g.default.createElement("div",{className:"response-undocumented"},g.default.createElement("i",null," Undocumented ")):null),g.default.createElement("td",{className:"col response-col_description"},v?g.default.createElement("span",null,t.get("name")+": "+t.get("message")):null,y?g.default.createElement(S,{content:y,contentType:x,url:h,headers:d,getComponent:n}):null,A?g.default.createElement(k,{headers:C}):null,i&&_?g.default.createElement(E,{duration:_}):null)))))}}]),t}(g.default.Component);S.propTypes={response:_.default.instanceOf(w.Iterable).isRequired,path:_.default.string.isRequired,method:_.default.string.isRequired,displayRequestDuration:_.default.bool.isRequired,specSelectors:_.default.object.isRequired,getComponent:_.default.func.isRequired,getConfigs:_.default.func.isRequired},S.propTypes={getComponent:_.default.func.isRequired,response:x.default.map},t.default=S},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));r.toggleCollapsed=function(){r.props.onToggle&&r.props.onToggle(r.props.modelName,!r.state.expanded),r.setState({expanded:!r.state.expanded})};var i=r.props,a=i.expanded,u=i.collapsedContent;return r.state={expanded:a,collapsedContent:u||t.defaultProps.collapsedContent},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentWillReceiveProps",value:function(e){this.props.expanded!=e.expanded&&this.setState({expanded:e.expanded})}},{key:"render",value:function(){var e=this.props.title;return m.default.createElement("span",null,e&&m.default.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},e),m.default.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},m.default.createElement("span",{className:"model-toggle"+(this.state.expanded?"":" collapsed")})),this.state.expanded?this.props.children:this.state.collapsedContent)}}]),t}(d.Component);y.propTypes={collapsedContent:g.default.any,expanded:g.default.bool,children:g.default.any,title:g.default.element,modelName:g.default.string,onToggle:g.default.func},y.defaultProps={collapsedContent:"{...}",expanded:!1,title:null,onToggle:function(){}},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));r.activeTab=function(e){var t=e.target.dataset.name;r.setState({activeTab:t})};var i=r.props.getConfigs,a=i(),u=a.defaultModelRendering;return"example"!==u&&"model"!==u&&(u="example"),r.state={activeTab:u},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.specSelectors,r=e.schema,i=e.example,o=e.isExecute,a=e.getConfigs,s=e.specPath,u=a(),l=u.defaultModelExpandDepth,c=t("ModelWrapper");return m.default.createElement("div",null,m.default.createElement("ul",{className:"tab"},m.default.createElement("li",{className:"tabitem"+(o||"example"===this.state.activeTab?" active":"")},m.default.createElement("a",{className:"tablinks","data-name":"example",onClick:this.activeTab},"Example Value")),r?m.default.createElement("li",{className:"tabitem"+(o||"model"!==this.state.activeTab?"":" active")},m.default.createElement("a",{className:"tablinks"+(o?" inactive":""),"data-name":"model",onClick:this.activeTab},"Model")):null),m.default.createElement("div",null,(o||"example"===this.state.activeTab)&&i,!o&&"model"===this.state.activeTab&&m.default.createElement(c,{schema:r,getComponent:t,getConfigs:a,specSelectors:n,expandDepth:l,specPath:s})))}}]),t}(m.default.Component);b.propTypes={getComponent:g.default.func.isRequired,specSelectors:g.default.object.isRequired,schema:g.default.object.isRequired,example:g.default.any.isRequired,isExecute:g.default.bool,getConfigs:g.default.func.isRequired,specPath:_.default.list.isRequired},t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=function(e){function t(){var e,n,r,i;(0,l.default)(this,t);for(var o=arguments.length,a=Array(o),u=0;u<o;u++)a[u]=arguments[u];return n=r=(0,h.default)(this,(e=t.__proto__||(0,s.default)(t)).call.apply(e,[this].concat(a))),r.onToggle=function(e,t){r.props.layoutActions&&r.props.layoutActions.show(["models",e],t)},i=n,(0,h.default)(r,i)}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.getConfigs,r=t("Model"),i=void 0;return this.props.layoutSelectors&&(i=this.props.layoutSelectors.isShown(["models",this.props.name])),g.default.createElement("div",{className:"model-box"},g.default.createElement(r,(0,o.default)({},this.props,{getConfigs:n,expanded:i,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}]),t}(v.Component);b.propTypes={schema:_.default.object.isRequired,name:_.default.string,getComponent:_.default.func.isRequired,getConfigs:_.default.func.isRequired,specSelectors:_.default.object.isRequired,expandDepth:_.default.number,layoutActions:_.default.object,layoutSelectors:_.default.object.isRequired},t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(7),_=r(y),b=n(1),x=r(b),w=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=e.layoutSelectors,i=e.layoutActions,a=e.getConfigs,s=t.definitions(),u=a(),l=u.docExpansion,c=u.defaultModelsExpandDepth;if(!s.size||c<0)return null;var p=r.isShown("models",c>0&&"none"!==l),f=t.isOAS3()?["components","schemas"]:["definitions"],h=n("ModelWrapper"),d=n("Collapse");return g.default.createElement("section",{className:p?"models is-open":"models"},g.default.createElement("h4",{onClick:function(){return i.show("models",!p)}},g.default.createElement("span",null,"Models"),g.default.createElement("svg",{width:"20",height:"20"},g.default.createElement("use",{xlinkHref:p?"#large-arrow-down":"#large-arrow"}))),g.default.createElement(d,{isOpened:p},s.entrySeq().map(function(e){var s=(0,o.default)(e,2),u=s[0],l=s[1];return g.default.createElement("div",{id:"model-"+u,className:"model-container",key:"models-section-"+u},g.default.createElement(h,{name:u,expandDepth:c,schema:l,specPath:_.default.List([].concat(f,[u])),getComponent:n,specSelectors:t,getConfigs:a,layoutSelectors:r,layoutActions:i}))}).toArray()))}}]),t}(v.Component);w.propTypes={getComponent:x.default.func,specSelectors:x.default.object,layoutSelectors:x.default.object,layoutActions:x.default.object,getConfigs:x.default.func.isRequired},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(35),o=r(i),a=n(21),s=r(a),u=n(18),l=r(u),c=n(96),p=r(c),f=n(4),h=r(f),d=n(2),m=r(d),v=n(3),g=r(v),y=n(6),_=r(y),b=n(5),x=r(b),w=n(0),k=r(w),E=n(1),S=r(E),C=n(7),A=n(12),D=r(A),O=function(e){function t(){return(0,m.default)(this,t),(0,_.default)(this,(t.__proto__||(0,h.default)(t)).apply(this,arguments))}return(0,x.default)(t,e),(0,g.default)(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.name,r=e.isRef,i=e.getComponent,a=e.getConfigs,u=e.depth,c=e.onToggle,f=e.expanded,h=e.specPath,d=(0,p.default)(e,["schema","name","isRef","getComponent","getConfigs","depth","onToggle","expanded","specPath"]),m=d.specSelectors,v=d.expandDepth,g=m.isOAS3;if(!t)return null;var y=a(),_=y.showExtensions,b=t.get("description"),x=t.get("properties"),w=t.get("additionalProperties"),E=t.get("title")||n,S=t.get("required"),A=i("JumpToPath",!0),D=i("Markdown"),O=i("Model"),M=i("ModelCollapse"),T=function(){return k.default.createElement("span",{className:"model-jump-to-path"},k.default.createElement(A,{specPath:h}))},P=k.default.createElement("span",null,k.default.createElement("span",null,"{"),"...",k.default.createElement("span",null,"}"),r?k.default.createElement(T,null):""),I=m.isOAS3()?t.get("anyOf"):null,R=m.isOAS3()?t.get("oneOf"):null,j=m.isOAS3()?t.get("not"):null,F=E&&k.default.createElement("span",{className:"model-title"},r&&t.get("$$ref")&&k.default.createElement("span",{className:"model-hint"},t.get("$$ref")),k.default.createElement("span",{className:"model-title__text"},E));return k.default.createElement("span",{className:"model"},k.default.createElement(M,{modelName:n,title:F,onToggle:c,expanded:!!f||u<=v,collapsedContent:P},k.default.createElement("span",{className:"brace-open object"},"{"),r?k.default.createElement(T,null):null,k.default.createElement("span",{className:"inner-object"},k.default.createElement("table",{className:"model"},k.default.createElement("tbody",null,b?k.default.createElement("tr",{style:{color:"#999",fontStyle:"italic"}},k.default.createElement("td",null,"description:"),k.default.createElement("td",null,k.default.createElement(D,{source:b}))):null,x&&x.size?x.entrySeq().map(function(e){var t=(0,l.default)(e,2),r=t[0],o=t[1],c=g()&&o.get("deprecated"),p=C.List.isList(S)&&S.contains(r),f={verticalAlign:"top",paddingRight:"0.2em"};return p&&(f.fontWeight="bold"),k.default.createElement("tr",{key:r,className:c&&"deprecated"},k.default.createElement("td",{style:f},r,p&&k.default.createElement("span",{style:{color:"red"}},"*")),k.default.createElement("td",{style:{verticalAlign:"top"}},k.default.createElement(O,(0,s.default)({key:"object-"+n+"-"+r+"_"+o},d,{required:p,getComponent:i,specPath:h.push("properties",r),getConfigs:a,schema:o,depth:u+1}))))}).toArray():null,_?k.default.createElement("tr",null," "):null,_?t.entrySeq().map(function(e){var t=(0,l.default)(e,2),n=t[0],r=t[1];if("x-"===n.slice(0,2)){var i=r?r.toJS?r.toJS():r:null;return k.default.createElement("tr",{key:n,style:{color:"#777"}},k.default.createElement("td",null,n),k.default.createElement("td",{style:{verticalAlign:"top"}},(0,o.default)(i)))}}).toArray():null,w&&w.size?k.default.createElement("tr",null,k.default.createElement("td",null,"< * >:"),k.default.createElement("td",null,k.default.createElement(O,(0,s.default)({},d,{required:!1,getComponent:i,specPath:h.push("additionalProperties"),getConfigs:a,schema:w,depth:u+1})))):null,I?k.default.createElement("tr",null,k.default.createElement("td",null,"anyOf ->"),k.default.createElement("td",null,I.map(function(e,t){return k.default.createElement("div",{key:t},k.default.createElement(O,(0,s.default)({},d,{required:!1,getComponent:i,specPath:h.push("anyOf",t),getConfigs:a,schema:e,depth:u+1})))}))):null,R?k.default.createElement("tr",null,k.default.createElement("td",null,"oneOf ->"),k.default.createElement("td",null,R.map(function(e,t){return k.default.createElement("div",{key:t},k.default.createElement(O,(0,s.default)({},d,{required:!1,getComponent:i,specPath:h.push("oneOf",t),getConfigs:a,schema:e,depth:u+1})))}))):null,j?k.default.createElement("tr",null,k.default.createElement("td",null,"not ->"),k.default.createElement("td",null,k.default.createElement("div",null,k.default.createElement(O,(0,s.default)({},d,{required:!1,getComponent:i,specPath:h.push("not"),getConfigs:a,schema:j,depth:u+1}))))):null))),k.default.createElement("span",{className:"brace-close"},"}")))}}]),t}(w.Component);O.propTypes={schema:S.default.object.isRequired,getComponent:S.default.func.isRequired,getConfigs:S.default.func.isRequired,expanded:S.default.bool,onToggle:S.default.func,specSelectors:S.default.object.isRequired,name:S.default.string,isRef:S.default.bool,expandDepth:S.default.number,depth:S.default.number,specPath:D.default.list.isRequired},t.default=O},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(47),o=r(i),a=n(48),s=r(a),u=n(4),l=r(u),c=n(2),p=r(c),f=n(3),h=r(f),d=n(6),m=r(d),v=n(5),g=r(v),y=n(0),_=r(y),b=n(1),x=r(b),w=n(9),k=function(e){function t(e,n){(0,p.default)(this,t);var r=(0,m.default)(this,(t.__proto__||(0,l.default)(t)).call(this,e,n)),i=e.specSelectors,o=e.getConfigs,a=o(),s=a.validatorUrl;return r.state={url:i.url(),validatorUrl:void 0===s?"https://online.swagger.io/validator":s},r}return(0,g.default)(t,e),(0,h.default)(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.specSelectors,n=e.getConfigs,r=n(),i=r.validatorUrl;this.setState({url:t.url(),validatorUrl:void 0===i?"https://online.swagger.io/validator":i})}},{key:"render",value:function(){var e=this.props.getConfigs,t=e(),n=t.spec,r=(0,w.sanitizeUrl)(this.state.validatorUrl);return"object"===(void 0===n?"undefined":(0,s.default)(n))&&(0,o.default)(n).length?null:!this.state.url||!this.state.validatorUrl||this.state.url.indexOf("localhost")>=0||this.state.url.indexOf("127.0.0.1")>=0?null:_.default.createElement("span",{style:{float:"right"}},_.default.createElement("a",{target:"_blank",href:r+"/debug?url="+this.state.url},_.default.createElement(E,{src:r+"?url="+this.state.url,alt:"Online validator badge"})))}}]),t}(_.default.Component);k.propTypes={getComponent:x.default.func.isRequired,getConfigs:x.default.func.isRequired,specSelectors:x.default.object.isRequired},t.default=k;var E=function(e){function t(e){(0,p.default)(this,t);var n=(0,m.default)(this,(t.__proto__||(0,l.default)(t)).call(this,e));return n.state={loaded:!1,error:!1},n}return(0,g.default)(t,e),(0,h.default)(t,[{key:"componentDidMount",value:function(){var e=this,t=new Image;t.onload=function(){e.setState({loaded:!0})},t.onerror=function(){e.setState({error:!0})},t.src=this.props.src}},{key:"componentWillReceiveProps",value:function(e){var t=this;if(e.src!==this.props.src){var n=new Image;n.onload=function(){t.setState({loaded:!0})},n.onerror=function(){t.setState({error:!0})},n.src=e.src}}},{key:"render",value:function(){return this.state.error?_.default.createElement("img",{alt:"Error"}):this.state.loaded?_.default.createElement("img",{src:this.props.src,alt:this.props.alt}):_.default.createElement("img",{alt:"Loading..."})}}]),t}(_.default.Component);E.propTypes={src:x.default.string,alt:x.default.string}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.OperationExtRow=void 0;var i=n(35),o=r(i),a=n(0),s=r(a),u=n(1),l=r(u),c=t.OperationExtRow=function(e){var t=e.xKey,n=e.xVal,r=n?n.toJS?n.toJS():n:null;return s.default.createElement("tr",null,s.default.createElement("td",null,t),s.default.createElement("td",null,(0,o.default)(r)))};c.propTypes={xKey:l.default.string,xVal:l.default.any},t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.OperationExt=void 0;var i=n(18),o=r(i),a=n(0),s=r(a),u=n(1),l=r(u),c=t.OperationExt=function(e){var t=e.extensions,n=e.getComponent,r=n("OperationExtRow");return s.default.createElement("div",{className:"opblock-section"},s.default.createElement("div",{className:"opblock-section-header"},s.default.createElement("h4",null,"Extensions")),s.default.createElement("div",{className:"table-container"},s.default.createElement("table",null,s.default.createElement("thead",null,s.default.createElement("tr",null,s.default.createElement("td",{className:"col col_header"},"Field"),s.default.createElement("td",{className:"col col_header"},"Value"))),s.default.createElement("tbody",null,t.entrySeq().map(function(e){var t=(0,o.default)(e,2),n=t[0],i=t[1];return s.default.createElement(r,{key:n+"-"+i,xKey:n,xVal:i})})))))};c.propTypes={extensions:l.default.object.isRequired,getComponent:l.default.func.isRequired},t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(9),_=n(7),b=n(12),x=r(b),w=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specPath,n=e.response,r=e.request,i=e.toggleShown,o=e.onTryoutClick,a=e.onCancelClick,s=e.onExecute,u=e.fn,l=e.getComponent,c=e.getConfigs,p=e.specActions,f=e.specSelectors,h=e.authActions,d=e.authSelectors,v=e.oas3Actions,g=e.oas3Selectors,_=this.props.operation,b=_.toJS(),x=b.isShown,w=b.isAuthorized,k=b.path,E=b.method,S=b.op,C=b.tag,A=b.showSummary,D=b.operationId,O=b.allowTryItOut,M=b.displayOperationId,T=b.displayRequestDuration,P=b.isDeepLinkingEnabled,I=b.tryItOutEnabled,R=b.executeInProgress,j=S.operation,F=j.summary,N=j.description,B=j.deprecated,L=j.externalDocs,q=j.schemes,z=_.getIn(["op","operation"]),U=_.get("security"),W=z.get("responses"),V=z.get("produces"),H=(0,y.getList)(z,["parameters"]),G=f.operationScheme(k,E),J=["operations",C,D],K=(0,y.getExtensions)(z),X=l("responses"),Y=l("parameters"),$=l("execute"),Z=l("clear"),Q=l("authorizeOperationBtn"),ee=l("JumpToPath",!0),te=l("Collapse"),ne=l("Markdown"),re=l("schemes"),ie=l("OperationServers"),oe=l("OperationExt"),ae=l("DeepLink"),se=c(),ue=se.showExtensions;if(W&&n&&n.size>0){var le=!W.get(String(n.get("status")))&&!W.get("default");n=n.set("notDocumented",le)}var ce=[k,E];return m.default.createElement("div",{className:B?"opblock opblock-deprecated":x?"opblock opblock-"+E+" is-open":"opblock opblock-"+E,id:J.join("-")},m.default.createElement("div",{className:"opblock-summary opblock-summary-"+E,onClick:i},m.default.createElement("span",{className:"opblock-summary-method"},E.toUpperCase()),m.default.createElement("span",{className:B?"opblock-summary-path__deprecated":"opblock-summary-path"},m.default.createElement(ae,{enabled:P,isShown:x,path:""+J.join("/"),text:k}),m.default.createElement(ee,{path:t})," "),A?m.default.createElement("div",{className:"opblock-summary-description"},F):null,M&&D?m.default.createElement("span",{className:"opblock-summary-operation-id"},D):null,U&&U.count()?m.default.createElement(Q,{isAuthorized:w,onClick:function(){var e=d.definitionsForRequirements(U);h.showDefinitions(e)}}):null),m.default.createElement(te,{isOpened:x},m.default.createElement("div",{className:"opblock-body"},B&&m.default.createElement("h4",{className:"opblock-title_normal"}," Warning: Deprecated"),N&&m.default.createElement("div",{className:"opblock-description-wrapper"},m.default.createElement("div",{className:"opblock-description"},m.default.createElement(ne,{source:N}))),L&&L.url?m.default.createElement("div",{className:"opblock-external-docs-wrapper"},m.default.createElement("h4",{className:"opblock-title_normal"},"Find more details"),m.default.createElement("div",{className:"opblock-external-docs"},m.default.createElement("span",{className:"opblock-external-docs__description"},m.default.createElement(ne,{source:L.description})),m.default.createElement("a",{target:"_blank",className:"opblock-external-docs__link",href:(0,y.sanitizeUrl)(L.url)},L.url))):null,m.default.createElement(Y,{parameters:H,specPath:t.push("parameters"),operation:z,onChangeKey:ce,onTryoutClick:o,onCancelClick:a,tryItOutEnabled:I,allowTryItOut:O,fn:u,getComponent:l,specActions:p,specSelectors:f,pathMethod:[k,E],getConfigs:c}),I?m.default.createElement(ie,{getComponent:l,path:k,method:E,operationServers:z.get("servers"),pathServers:f.paths().getIn([k,"servers"]),getSelectedServer:g.selectedServer,setSelectedServer:v.setSelectedServer,setServerVariableValue:v.setServerVariableValue,getServerVariable:g.serverVariableValue,getEffectiveServerValue:g.serverEffectiveValue}):null,I&&O&&q&&q.size?m.default.createElement("div",{className:"opblock-schemes"},m.default.createElement(re,{schemes:q,path:k,method:E,specActions:p,currentScheme:G})):null,m.default.createElement("div",{className:I&&n&&O?"btn-group":"execute-wrapper"},I&&O?m.default.createElement($,{operation:z,specActions:p,specSelectors:f,path:k,method:E,onExecute:s}):null,I&&n&&O?m.default.createElement(Z,{specActions:p,path:k,method:E}):null),R?m.default.createElement("div",{className:"loading-container"},m.default.createElement("div",{className:"loading"})):null,W?m.default.createElement(X,{responses:W,request:r,tryItOutResponse:n,getComponent:l,getConfigs:c,specSelectors:f,oas3Actions:v,specActions:p,produces:V,producesValue:f.currentProducesFor([k,E]),specPath:t.push("responses"),path:k,method:E,displayRequestDuration:T,fn:u}):null,ue&&K.size?m.default.createElement(oe,{extensions:K,getComponent:l}):null)))}}]),t}(d.PureComponent);w.propTypes={specPath:x.default.list.isRequired,operation:g.default.instanceOf(_.Iterable).isRequired,response:g.default.instanceOf(_.Iterable),request:g.default.instanceOf(_.Iterable),toggleShown:g.default.func.isRequired,onTryoutClick:g.default.func.isRequired,onCancelClick:g.default.func.isRequired,onExecute:g.default.func.isRequired,getComponent:g.default.func.isRequired,getConfigs:g.default.func.isRequired,authActions:g.default.object,authSelectors:g.default.object,specActions:g.default.object.isRequired,specSelectors:g.default.object.isRequired,oas3Actions:g.default.object.isRequired,oas3Selectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired,layoutSelectors:g.default.object.isRequired,fn:g.default.object.isRequired},w.defaultProps={operation:null,response:null,request:null,specPath:(0,_.List)()},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(7),_=r(y),b=n(9),x=["get","put","post","delete","options","head","patch"],w=x.concat(["trace"]),k=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=e.layoutSelectors,i=e.layoutActions,o=e.getConfigs,a=t.taggedOperations(),s=n("OperationContainer",!0),u=n("Collapse"),l=n("Markdown"),c=n("DeepLink"),p=o(),f=p.docExpansion,h=p.maxDisplayedTags,d=p.deepLinking,v=d&&"false"!==d,g=r.currentFilter();return g&&!0!==g&&(a=a.filter(function(e,t){return-1!==t.indexOf(g)})),h&&!isNaN(h)&&h>=0&&(a=a.slice(0,h)),m.default.createElement("div",null,a.map(function(e,n){var o=e.get("operations"),a=e.getIn(["tagDetails","description"],null),p=e.getIn(["tagDetails","externalDocs","description"]),h=e.getIn(["tagDetails","externalDocs","url"]),d=["operations-tag",(0,b.createDeepLinkPath)(n)],g=r.isShown(d,"full"===f||"list"===f);return m.default.createElement("div",{className:g?"opblock-tag-section is-open":"opblock-tag-section",key:"operation-"+n},m.default.createElement("h4",{onClick:function(){return i.show(d,!g)},className:a?"opblock-tag":"opblock-tag no-desc",id:d.join("-")},m.default.createElement(c,{enabled:v,isShown:g,path:n,text:n}),a?m.default.createElement("small",null,m.default.createElement(l,{source:a})):m.default.createElement("small",null),m.default.createElement("div",null,p?m.default.createElement("small",null,p,h?": ":null,h?m.default.createElement("a",{href:(0,b.sanitizeUrl)(h),onClick:function(e){return e.stopPropagation()},target:"_blank"},h):null):null),m.default.createElement("button",{className:"expand-operation",title:g?"Collapse operation":"Expand operation",onClick:function(){return i.show(d,!g)}},m.default.createElement("svg",{className:"arrow",width:"20",height:"20"},m.default.createElement("use",{href:g?"#large-arrow-down":"#large-arrow",xlinkHref:g?"#large-arrow-down":"#large-arrow"})))),m.default.createElement(u,{isOpened:g},o.map(function(e){var r=e.get("path"),i=e.get("method"),o=_.default.List(["paths",r,i]);return-1===(t.isOAS3()?w:x).indexOf(i)?null:m.default.createElement(s,{key:r+"-"+i,specPath:o,op:e,path:r,method:i,tag:n})}).toArray()))}).toArray(),a.size<1?m.default.createElement("h3",null," No operations defined in spec! "):null)}}]),t}(m.default.Component);k.propTypes={specSelectors:g.default.object.isRequired,specActions:g.default.object.isRequired,oas3Actions:g.default.object.isRequired,getComponent:g.default.func.isRequired,layoutSelectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired,authActions:g.default.object.isRequired,authSelectors:g.default.object.isRequired,getConfigs:g.default.func.isRequired},t.default=k,k.propTypes={layoutActions:g.default.object.isRequired,specSelectors:g.default.object.isRequired,specActions:g.default.object.isRequired,layoutSelectors:g.default.object.isRequired,getComponent:g.default.func.isRequired,fn:g.default.object.isRequired}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.OperationLink=void 0;var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(268),_=function(e){function t(){var e;(0,s.default)(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(r)));return a.setTagShown=a._setTagShown.bind(a),a}return(0,h.default)(t,e),(0,l.default)(t,[{key:"_setTagShown",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"showOp",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=e.layoutActions,i=e.getComponent,o=t.taggedOperations(),a=i("Collapse");return m.default.createElement("div",null,m.default.createElement("h4",{className:"overview-title"},"Overview"),o.map(function(e,t){var i=e.get("operations"),o=["overview-tags",t],s=n.isShown(o,!0),u=function(){return r.show(o,!s)};return m.default.createElement("div",{key:"overview-"+t},m.default.createElement("h4",{onClick:u,className:"link overview-tag"}," ",s?"-":"+",t),m.default.createElement(a,{isOpened:s,animated:!0},i.map(function(e){var t=e.toObject(),i=t.path,o=t.method,a=t.id,s=a,u=n.isShown(["operations",s]);return m.default.createElement(b,{key:a,path:i,method:o,id:i+"-"+o,shown:u,showOpId:s,showOpIdPrefix:"operations",href:"#operation-"+s,onClick:r.show})}).toArray()))}).toArray(),o.size<1&&m.default.createElement("h3",null," No operations defined in spec! "))}}]),t}(m.default.Component);t.default=_,_.propTypes={layoutSelectors:g.default.object.isRequired,specSelectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired,getComponent:g.default.func.isRequired};var b=t.OperationLink=function(e){function t(e){(0,s.default)(this,t);var n=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e));return n.onClick=n._onClick.bind(n),n}return(0,h.default)(t,e),(0,l.default)(t,[{key:"_onClick",value:function(){var e=this.props,t=e.showOpId,n=e.showOpIdPrefix;(0,e.onClick)([n,t],!e.shown)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.method,r=e.shown,i=e.href;return m.default.createElement(y.Link,{href:i,style:{fontWeight:r?"bold":"normal"},onClick:this.onClick,className:"block opblock-link"},m.default.createElement("div",null,m.default.createElement("small",{className:"bold-label-"+n},n.toUpperCase()),m.default.createElement("span",{className:"bold-label"},t)))}}]),t}(m.default.Component);b.propTypes={href:g.default.string,onClick:g.default.func,id:g.default.string.isRequired,method:g.default.string.isRequired,shown:g.default.bool.isRequired,showOpId:g.default.string.isRequired,showOpIdPrefix:g.default.string.isRequired}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(7),_=n(9),b=Function.prototype,x=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));return w.call(r),r.state={isEditBox:!1,value:""},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentDidMount",value:function(){this.updateValues.call(this,this.props)}},{key:"componentWillReceiveProps",value:function(e){this.updateValues.call(this,e)}},{key:"render",value:function(){var e=this.props,n=e.onChangeConsumes,r=e.param,i=e.isExecute,o=e.specSelectors,a=e.pathMethod,s=e.getComponent,u=s("Button"),l=s("TextArea"),c=s("highlightCode"),p=s("contentType"),f=o?o.getParameter(a,r.get("name"),r.get("in")):r,h=f.get("errors",(0,y.List)()),d=o.contentTypeValues(a).get("requestContentType"),v=this.props.consumes&&this.props.consumes.size?this.props.consumes:t.defaultProp.consumes,g=this.state,_=g.value,b=g.isEditBox;return m.default.createElement("div",{className:"body-param"},b&&i?m.default.createElement(l,{className:"body-param__text"+(h.count()?" invalid":""),value:_,onChange:this.handleOnChange}):_&&m.default.createElement(c,{className:"body-param__example",value:_}),m.default.createElement("div",{className:"body-param-options"},i?m.default.createElement("div",{className:"body-param-edit"},m.default.createElement(u,{className:b?"btn cancel body-param__example-edit":"btn edit body-param__example-edit",onClick:this.toggleIsEditBox},b?"Cancel":"Edit")):null,m.default.createElement("label",{htmlFor:""},m.default.createElement("span",null,"Parameter content type"),m.default.createElement(p,{value:d,contentTypes:v,onChange:n,className:"body-param-content-type"}))))}}]),t}(d.PureComponent);x.propTypes={param:g.default.object,onChange:g.default.func,onChangeConsumes:g.default.func,consumes:g.default.object,consumesValue:g.default.string,fn:g.default.object.isRequired,getComponent:g.default.func.isRequired,isExecute:g.default.bool,specSelectors:g.default.object.isRequired,pathMethod:g.default.array.isRequired},x.defaultProp={consumes:(0,y.fromJS)(["application/json"]),param:(0,y.fromJS)({}),onChange:b,onChangeConsumes:b};var w=function(){var e=this;this.updateValues=function(t){var n=t.specSelectors,r=t.pathMethod,i=t.param,o=t.isExecute,a=t.consumesValue,s=void 0===a?"":a,u=n?n.getParameter(r,i.get("name"),i.get("in")):(0,y.fromJS)({}),l=/xml/i.test(s),c=/json/i.test(s),p=l?u.get("value_xml"):u.get("value");if(void 0!==p){var f=!p&&c?"{}":p;e.setState({value:f}),e.onChange(f,{isXml:l,isEditBox:o})}else l?e.onChange(e.sample("xml"),{isXml:l,isEditBox:o}):e.onChange(e.sample(),{isEditBox:o})},this.sample=function(t){var n=e.props,r=n.param,i=n.fn.inferSchema,o=i(r.toJS());return(0,_.getSampleSchema)(o,t,{includeWriteOnly:!0})},this.onChange=function(t,n){var r=n.isEditBox,i=n.isXml;e.setState({value:t,isEditBox:r}),e._onChange(t,i)},this._onChange=function(t,n){(e.props.onChange||b)(e.props.param,t,n)},this.handleOnChange=function(t){var n=e.props.consumesValue,r=/json/i.test(n),i=/xml/i.test(n),o=r?t.target.value.trim():t.target.value;e.onChange(o,{isXml:i})},this.toggleIsEditBox=function(){return e.setState(function(e){return{isEditBox:!e.isEditBox}})}};t.default=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ParameterExt=void 0;var i=n(0),o=r(i),a=n(1),s=r(a),u=t.ParameterExt=function(e){var t=e.xKey,n=e.xVal;return o.default.createElement("div",{className:"parameter__extension"},t,": ",String(n))};u.propTypes={xKey:s.default.string,xVal:s.default.any},t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(7),g=n(1),y=r(g),_=n(12),b=r(_),x=n(46),w=r(x),k=n(9),E=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));S.call(r);var i=e.specSelectors,a=e.pathMethod,u=e.param,l=u.get("default"),c=i.getParameter(a,u.get("name"),u.get("in")),f=c?c.get("value"):"";return void 0!==l&&void 0===f&&r.onChangeWrapper(l),r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.specSelectors,n=e.pathMethod,r=e.param,i=t.isOAS3,o=r.get("example"),a=r.get("default"),s=t.getParameter(n,r.get("name"),r.get("in")),u=void 0;if(i()){u=(r.get("schema")||(0,v.Map)()).get("enum")}else u=s?s.get("enum"):void 0;var l=s?s.get("value"):void 0,c=void 0;void 0!==l?c=l:void 0!==o?c=o:void 0!==a?c=a:r.get("required")&&u&&u.size&&(c=u.first()),void 0!==c&&this.onChangeWrapper(c)}},{key:"render",value:function(){var e=this.props,t=e.param,n=e.onChange,r=e.getComponent,i=e.getConfigs,o=e.isExecute,a=e.fn,s=e.onChangeConsumes,u=e.specSelectors,l=e.pathMethod,c=e.specPath,p=u.isOAS3,f=i(),h=f.showExtensions,d=r("JsonSchemaForm"),v=r("ParamBody"),g=t.get("in"),y="body"!==g?null:m.default.createElement(v,{getComponent:r,fn:a,param:t,consumes:u.operationConsumes(l),consumesValue:u.contentTypeValues(l).get("requestContentType"),onChange:n,onChangeConsumes:s,isExecute:o,specSelectors:u,pathMethod:l}),_=r("modelExample"),b=r("Markdown"),x=r("ParameterExt"),E=t.get("schema"),S=p&&p()?t.getIn(["schema","type"]):t.get("type"),C="formData"===g,A="FormData"in w.default,D=t.get("required"),O=t.getIn(p&&p()?["schema","items","type"]:["items","type"]),M=u.getParameter(l,t.get("name"),t.get("in")),T=M?M.get("value"):"",P=(0,k.getExtensions)(t),I=void 0,R=void 0,j=!1;void 0!==t&&(I=t.get("items")),void 0!==I&&(R=t.get("items").get("enum")),void 0!==R&&R.size>0&&(j=!0);var F=void 0,N=void 0;return void 0!==t&&(F=t.get("default"),N=t.get("example")),j&&(F=I.get("default")),m.default.createElement("tr",null,m.default.createElement("td",{className:"col parameters-col_name"},m.default.createElement("div",{className:D?"parameter__name required":"parameter__name"},t.get("name"),D?m.default.createElement("span",{style:{color:"red"}}," *"):null),m.default.createElement("div",{className:"parameter__type"},S," ",O&&"["+O+"]"),m.default.createElement("div",{className:"parameter__deprecated"},p&&p()&&t.get("deprecated")?"deprecated":null),m.default.createElement("div",{className:"parameter__in"},"(",t.get("in"),")"),h&&P.size?P.map(function(e,t){return m.default.createElement(x,{key:t+"-"+e,xKey:t,xVal:e})}):null),m.default.createElement("td",{className:"col parameters-col_description"},m.default.createElement(b,{source:t.get("description")}),!y&&o||!j?null:m.default.createElement(b,{source:"<i>Available values</i>: "+R.map(function(e){return e}).toArray().join(", ")}),!y&&o||void 0===F?null:m.default.createElement(b,{source:"<i>Default value</i>: "+F}),!y&&o||void 0===N?null:m.default.createElement(b,{source:"<i>Example</i>: "+N}),C&&!A&&m.default.createElement("div",null,"Error: your browser does not support FormData"),y||!o?null:m.default.createElement(d,{fn:a,getComponent:r,value:T,required:D,description:t.get("description")?t.get("name")+" - "+t.get("description"):""+t.get("name"),onChange:this.onChangeWrapper,errors:t.get("errors"),schema:p&&p()?t.get("schema"):t}),y&&E?m.default.createElement(_,{getComponent:r,specPath:c.push("schema"),getConfigs:i,isExecute:o,specSelectors:u,schema:E,example:y}):null))}}]),t}(d.Component);E.propTypes={onChange:y.default.func.isRequired,param:y.default.object.isRequired,getComponent:y.default.func.isRequired,fn:y.default.object.isRequired,isExecute:y.default.bool,onChangeConsumes:y.default.func.isRequired,specSelectors:y.default.object.isRequired,pathMethod:y.default.array.isRequired,getConfigs:y.default.func.isRequired,specPath:b.default.list.isRequired};var S=function(){var e=this;this.onChangeWrapper=function(t){var n=e.props;return(0,n.onChange)(n.param,t)}};t.default=E},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=n(7),x=r(b),w=function(e,t){return e.valueSeq().filter(x.default.Map.isMap).map(t)},k=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onChange=function(e,t,n){var i=r.props;(0,i.specActions.changeParam)(i.onChangeKey,e.get("name"),e.get("in"),t,n)},r.onChangeConsumesWrapper=function(e){var t=r.props;(0,t.specActions.changeConsumesValue)(t.onChangeKey,e)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.onTryoutClick,r=t.onCancelClick,i=t.parameters,o=t.allowTryItOut,a=t.tryItOutEnabled,s=t.specPath,u=t.fn,l=t.getComponent,c=t.getConfigs,p=t.specSelectors,f=t.pathMethod,h=l("parameterRow"),d=l("TryItOutButton"),v=a&&o;return m.default.createElement("div",{className:"opblock-section"},m.default.createElement("div",{className:"opblock-section-header"},m.default.createElement("div",{className:"tab-header"},m.default.createElement("h4",{className:"opblock-title"},"Parameters")),o?m.default.createElement(d,{enabled:a,onCancelClick:r,onTryoutClick:n}):null),i.count()?m.default.createElement("div",{className:"table-container"},m.default.createElement("table",{className:"parameters"},m.default.createElement("thead",null,m.default.createElement("tr",null,m.default.createElement("th",{className:"col col_header parameters-col_name"},"Name"),m.default.createElement("th",{className:"col col_header parameters-col_description"},"Description"))),m.default.createElement("tbody",null,w(i,function(t,n){return m.default.createElement(h,{fn:u,specPath:s.push(n.toString()),getComponent:l,getConfigs:c,param:t,key:t.get("in")+"."+t.get("name"),onChange:e.onChange,onChangeConsumes:e.onChangeConsumesWrapper,specSelectors:p,pathMethod:f,isExecute:v})}).toArray()))):m.default.createElement("div",{className:"opblock-description-wrapper"},m.default.createElement("p",null,"No parameters")))}}]),t}(d.Component);k.propTypes={parameters:_.default.list.isRequired,specActions:g.default.object.isRequired,getComponent:g.default.func.isRequired,specSelectors:g.default.object.isRequired,fn:g.default.object.isRequired,tryItOutEnabled:g.default.bool,allowTryItOut:g.default.bool,onTryoutClick:g.default.func,onCancelClick:g.default.func,onChangeKey:g.default.array,pathMethod:g.default.array.isRequired,getConfigs:g.default.func.isRequired,specPath:_.default.list.isRequired},k.defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]},t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(9),x={color:"#6b6b6b",fontStyle:"italic"},w=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.getConfigs,i=e.name,a=e.depth,s=r(),u=s.showExtensions;if(!t||!t.get)return g.default.createElement("div",null);var l=t.get("type"),c=t.get("format"),p=t.get("xml"),f=t.get("enum"),h=t.get("title")||i,d=t.get("description"),m=(0,b.getExtensions)(t),v=t.filter(function(e,t){return-1===["enum","type","format","description","$$ref"].indexOf(t)}).filterNot(function(e,t){return m.has(t)}),y=n("Markdown"),_=n("EnumModel"),w=n("Property");return g.default.createElement("span",{className:"model"},g.default.createElement("span",{className:"prop"},i&&g.default.createElement("span",{className:(1===a&&"model-title")+" prop-name"},h),g.default.createElement("span",{className:"prop-type"},l),c&&g.default.createElement("span",{className:"prop-format"},"($",c,")"),v.size?v.entrySeq().map(function(e){var t=(0,o.default)(e,2),n=t[0],r=t[1];return g.default.createElement(w,{key:n+"-"+r,propKey:n,propVal:r,propStyle:x})}):null,u&&m.size?m.entrySeq().map(function(e){var t=(0,o.default)(e,2),n=t[0],r=t[1];return g.default.createElement(w,{key:n+"-"+r,propKey:n,propVal:r,propStyle:x})}):null,d?g.default.createElement(y,{source:d}):null,p&&p.size?g.default.createElement("span",null,g.default.createElement("br",null),g.default.createElement("span",{style:x},"xml:"),p.entrySeq().map(function(e){var t=(0,o.default)(e,2),n=t[0],r=t[1];return g.default.createElement("span",{key:n+"-"+r,style:x},g.default.createElement("br",null),"   ",n,": ",String(r))}).toArray()):null,f&&g.default.createElement(_,{value:f,getComponent:n})))}}]),t}(v.Component);w.propTypes={schema:_.default.object.isRequired,getComponent:_.default.func.isRequired,getConfigs:_.default.func.isRequired,name:_.default.string,depth:_.default.number},t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Property=void 0;var i=n(0),o=r(i),a=n(1),s=r(a),u=t.Property=function(e){var t=e.propKey,n=e.propVal,r=e.propStyle;return o.default.createElement("span",{style:r},o.default.createElement("br",null),t,": ",String(n))};u.propTypes={propKey:s.default.string,propVal:s.default.any,propStyle:s.default.object},t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(35),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(1),_=r(y),b=n(1196),x=r(b),w=n(948),k=r(w),E=n(9),S=function(e){function t(){return(0,l.default)(this,t),(0,h.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,m.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.content,n=e.contentType,r=e.url,i=e.headers,a=void 0===i?{}:i,s=e.getComponent,u=s("highlightCode"),l=void 0,c=void 0;if(r=r||"",/^application\/octet-stream/i.test(n)||a["Content-Disposition"]&&/attachment/i.test(a["Content-Disposition"])||a["content-disposition"]&&/attachment/i.test(a["content-disposition"])||a["Content-Description"]&&/File Transfer/i.test(a["Content-Description"])||a["content-description"]&&/File Transfer/i.test(a["content-description"])){if(!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&"Blob"in window){var p=n||"text/html",f=t instanceof Blob?t:new Blob([t],{type:p}),h=window.URL.createObjectURL(f),d=r.substr(r.lastIndexOf("/")+1),m=[p,d,h].join(":"),v=a["content-disposition"]||a["Content-Disposition"];if(void 0!==v){var y=(0,E.extractFileNameFromContentDispositionHeader)(v);null!==y&&(m=y)}c=g.default.createElement("div",null,g.default.createElement("a",{href:h,download:m},"Download file"))}else c=g.default.createElement("pre",null,"Download headers detected but your browser does not support downloading binary via XHR (Blob).")}else if(/json/i.test(n)){try{l=(0,o.default)(JSON.parse(t),null," ")}catch(e){l="can't parse JSON. Raw result:\n\n"+t}c=g.default.createElement(u,{value:l})}else/xml/i.test(n)?(l=(0,x.default)(t,{textNodesOnSameLine:!0,indentor:" "}),c=g.default.createElement(u,{value:l})):c="text/html"===(0,k.default)(n)||/text\/plain/.test(n)?g.default.createElement(u,{value:t}):/^image\//i.test(n)?n.includes("svg")?g.default.createElement("div",null," ",t," "):g.default.createElement("img",{style:{maxWidth:"100%"},src:window.URL.createObjectURL(t)}):/^audio\//i.test(n)?g.default.createElement("pre",null,g.default.createElement("audio",{controls:!0},g.default.createElement("source",{src:r,type:n}))):"string"==typeof t?g.default.createElement(u,{value:t}):t.size>0?g.default.createElement("div",null,"Unknown response type"):null;return c?g.default.createElement("div",null,g.default.createElement("h5",null,"Response body"),c):null}}]),t}(g.default.Component);S.propTypes={content:_.default.any.isRequired,contentType:_.default.string,getComponent:_.default.func.isRequired,headers:_.default.object,url:_.default.string},t.default=S},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(35),m=r(d),v=n(18),g=r(v),y=n(0),_=r(y),b=n(1),x=r(b),w=n(12),k=r(w),E=n(573),S=r(E),C=n(7),A=n(9),D=function(e,t,n){return t&&t.size?t.entrySeq().map(function(e){var t=(0,g.default)(e,2),r=t[0],i=t[1],o=i;if(i.toJS)try{o=(0,m.default)(i.toJS(),null,2)}catch(e){o=String(i)}return _.default.createElement("div",{key:r},_.default.createElement("h5",null,r),_.default.createElement(n,{className:"example",value:o}))}).toArray():e?_.default.createElement("div",null,_.default.createElement(n,{className:"example",value:e})):null},O=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));return r._onContentTypeChange=function(e){var t=r.props,n=t.onContentTypeChange,i=t.controlsAcceptHeader;r.setState({responseContentType:e}),n({value:e,controlsAcceptHeader:i})},r.state={responseContentType:""},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e,t,n,r=this.props,i=r.code,o=r.response,a=r.className,s=r.specPath,u=r.fn,l=r.getComponent,c=r.getConfigs,p=r.specSelectors,f=r.contentType,h=r.controlsAcceptHeader,d=u.inferSchema,m=p.isOAS3,v=o.get("headers"),g=o.get("examples"),y=o.get("links"),b=l("headers"),x=l("highlightCode"),w=l("modelExample"),k=l("Markdown"),E=l("operationLink"),O=l("contentType");if(m()){var M=(0,C.List)(["content",this.state.responseContentType,"schema"]),T=o.getIn(M);e=T?(0,A.getSampleSchema)(T.toJS(),this.state.responseContentType,{includeReadOnly:!0}):null,t=T?d(T.toJS()):null,n=T?M:s}else t=d(o.toJS()),n=o.has("schema")?s.push("schema"):s,e=t?(0,A.getSampleSchema)(t,f,{includeReadOnly:!0,includeWriteOnly:!0}):null;g&&(g=g.map(function(e){return e.set?e.set("$$ref",void 0):e}));var P=D(e,g,x);return _.default.createElement("tr",{className:"response "+(a||"")},_.default.createElement("td",{className:"col response-col_status"},i),_.default.createElement("td",{className:"col response-col_description"},_.default.createElement("div",{className:"response-col_description__inner"},_.default.createElement(k,{source:o.get("description")})),m?_.default.createElement("div",{className:(0,S.default)("response-content-type",{"controls-accept-header":h})},_.default.createElement(O,{value:this.state.responseContentType,contentTypes:o.get("content")?o.get("content").keySeq():(0,C.Seq)(),onChange:this._onContentTypeChange}),h?_.default.createElement("small",null,"Controls ",_.default.createElement("code",null,"Accept")," header."):null):null,P?_.default.createElement(w,{specPath:n,getComponent:l,getConfigs:c,specSelectors:p,schema:(0,A.fromJSOrdered)(t),example:P}):null,v?_.default.createElement(b,{headers:v,getComponent:l}):null),p.isOAS3()?_.default.createElement("td",{className:"col response-col_links"},y?y.toSeq().map(function(e,t){return _.default.createElement(E,{key:t,name:t,link:e,getComponent:l})}):_.default.createElement("i",null,"No links")):null)}}]),t}(_.default.Component);O.propTypes={code:x.default.string.isRequired,response:x.default.instanceOf(C.Iterable),className:x.default.string,getComponent:x.default.func.isRequired,getConfigs:x.default.func.isRequired,specSelectors:x.default.object.isRequired,specPath:k.default.list.isRequired,fn:x.default.object.isRequired,contentType:x.default.string,controlsAcceptHeader:x.default.bool,onContentTypeChange:x.default.func},O.defaultProps={response:(0,C.fromJS)({}),onContentTypeChange:function(){}},t.default=O},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=r(i),a=n(4),s=r(a),u=n(2),l=r(u),c=n(3),p=r(c),f=n(6),h=r(f),d=n(5),m=r(d),v=n(0),g=r(v),y=n(7),_=n(1),b=r(_),x=n(12),w=r(x),k=n(9),E=function(e){function t(){var e,n,r,i;(0,l.default)(this,t);for(var o=arguments.length,a=Array(o),u=0;u<o;u++)a[u]=arguments[u];return n=r=(0,h.default)(this,(e=t.__proto__||(0,s.default)(t)).call.apply(e,[this].concat(a))),r.onChangeProducesWrapper=function(e){return r.props.specActions.changeProducesValue([r.props.path,r.props.method],e)},r.onResponseContentTypeChange=function(e){var t=e.controlsAcceptHeader,n=e.value,i=r.props,o=i.oas3Actions,a=i.path,s=i.method;t&&o.setResponseContentType({value:n,path:a,method:s})},i=n,(0,h.default)(r,i)}return(0,m.default)(t,e),(0,p.default)(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.tryItOutResponse!==e.tryItOutResponse||this.props.responses!==e.responses||this.props.produces!==e.produces||this.props.producesValue!==e.producesValue||this.props.displayRequestDuration!==e.displayRequestDuration||this.props.path!==e.path||this.props.method!==e.method}},{key:"render",value:function(){var e=this,n=this.props,r=n.responses,i=n.tryItOutResponse,a=n.getComponent,s=n.getConfigs,u=n.specSelectors,l=n.fn,c=n.producesValue,p=n.displayRequestDuration,f=n.specPath,h=(0,k.defaultStatusCode)(r),d=a("contentType"),m=a("liveResponse"),v=a("response"),y=this.props.produces&&this.props.produces.size?this.props.produces:t.defaultProps.produces,_=u.isOAS3(),b=_?(0,k.getAcceptControllingResponse)(r):null;return g.default.createElement("div",{className:"responses-wrapper"},g.default.createElement("div",{className:"opblock-section-header"},g.default.createElement("h4",null,"Responses"),u.isOAS3()?null:g.default.createElement("label",null,g.default.createElement("span",null,"Response content type"),g.default.createElement(d,{value:c,onChange:this.onChangeProducesWrapper,contentTypes:y,className:"execute-content-type"}))),g.default.createElement("div",{className:"responses-inner"},i?g.default.createElement("div",null,g.default.createElement(m,{response:i,getComponent:a,getConfigs:s,specSelectors:u,path:this.props.path,method:this.props.method,displayRequestDuration:p}),g.default.createElement("h4",null,"Responses")):null,g.default.createElement("table",{className:"responses-table"},g.default.createElement("thead",null,g.default.createElement("tr",{className:"responses-header"},g.default.createElement("td",{className:"col col_header response-col_status"},"Code"),g.default.createElement("td",{className:"col col_header response-col_description"},"Description"),u.isOAS3()?g.default.createElement("td",{className:"col col_header response-col_links"},"Links"):null)),g.default.createElement("tbody",null,r.entrySeq().map(function(t){var n=(0,o.default)(t,2),r=n[0],p=n[1],d=i&&i.get("status")==r?"response_current":"";return g.default.createElement(v,{key:r,specPath:f.push(r),isDefault:h===r,fn:l,className:d,code:r,response:p,specSelectors:u,controlsAcceptHeader:p===b,onContentTypeChange:e.onResponseContentTypeChange,contentType:c,getConfigs:s,getComponent:a})}).toArray()))))}}]),t}(g.default.Component);E.propTypes={tryItOutResponse:b.default.instanceOf(y.Iterable),responses:b.default.instanceOf(y.Iterable).isRequired,produces:b.default.instanceOf(y.Iterable),producesValue:b.default.any,displayRequestDuration:b.default.bool.isRequired,path:b.default.string.isRequired,method:b.default.string.isRequired,getComponent:b.default.func.isRequired,getConfigs:b.default.func.isRequired,specSelectors:b.default.object.isRequired,specActions:b.default.object.isRequired,oas3Actions:b.default.object.isRequired,specPath:w.default.list.isRequired,fn:b.default.object.isRequired},E.defaultProps={tryItOutResponse:null,produces:(0,y.fromJS)(["application/json"]),displayRequestDuration:!1},t.default=E},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){var e,n,r,i;(0,s.default)(this,t);for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];return n=r=(0,p.default)(this,(e=t.__proto__||(0,o.default)(t)).call.apply(e,[this].concat(u))),r.onChange=function(e){r.setScheme(e.target.value)},r.setScheme=function(e){var t=r.props,n=t.path,i=t.method;t.specActions.setScheme(e,n,i)},i=n,(0,p.default)(r,i)}return(0,h.default)(t,e),(0,l.default)(t,[{key:"componentWillMount",value:function(){var e=this.props.schemes;this.setScheme(e.first())}},{key:"componentWillReceiveProps",value:function(e){this.props.currentScheme&&e.schemes.includes(this.props.currentScheme)||this.setScheme(e.schemes.first())}},{key:"render",value:function(){var e=this.props.schemes;return m.default.createElement("label",{htmlFor:"schemes"},m.default.createElement("span",{className:"schemes-title"},"Schemes"),m.default.createElement("select",{onChange:this.onChange},e.valueSeq().map(function(e){return m.default.createElement("option",{value:e,key:e},e)}).toArray()))}}]),t}(m.default.Component);y.propTypes={specActions:g.default.object.isRequired,schemes:g.default.object.isRequired,currentScheme:g.default.string.isRequired,path:g.default.string,method:g.default.string},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=function(e){function t(){return(0,s.default)(this,t),(0,p.default)(this,(t.__proto__||(0,o.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,l.default)(t,[{key:"render",value:function(){var e=this.props,t=e.onTryoutClick,n=e.onCancelClick,r=e.enabled;return m.default.createElement("div",{className:"try-out"},r?m.default.createElement("button",{className:"btn try-out__btn cancel",onClick:t},"Cancel"):m.default.createElement("button",{className:"btn try-out__btn",onClick:n},"Try it out "))}}]),t}(m.default.Component);y.propTypes={onTryoutClick:g.default.func,onCancelClick:g.default.func,enabled:g.default.bool},y.defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,enabled:!1},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(1),s=r(a),u=function(e){var t=e.version;return o.default.createElement("small",null,o.default.createElement("pre",{className:"version"}," ",t," "))};u.propTypes={version:s.default.string.isRequired},t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=r(i),a=n(2),s=r(a),u=n(3),l=r(u),c=n(6),p=r(c),f=n(5),h=r(f),d=n(0),m=r(d),v=n(1),g=r(v),y=n(12),_=r(y),b=n(495),x=n(7),w=b.helpers.opId,k=function(e){function t(e,n){(0,s.default)(this,t);var r=(0,p.default)(this,(t.__proto__||(0,o.default)(t)).call(this,e,n));return r.toggleShown=function(){var e=r.props,t=e.layoutActions,n=e.tag,i=e.operationId,o=e.isShown;t.show(["operations",n,i],!o)},r.onTryoutClick=function(){r.setState({tryItOutEnabled:!r.state.tryItOutEnabled})},r.onCancelClick=function(){var e=r.props,t=e.specActions,n=e.path,i=e.method;r.setState({tryItOutEnabled:!r.state.tryItOutEnabled}),t.clearValidateParams([n,i])},r.onExecute=function(){r.setState({executeInProgress:!0})},r.state={tryItOutEnabled:!1,executeInProgress:!1},r}return(0,h.default)(t,e),(0,l.default)(t,[{key:"mapStateToProps",value:function(e,t){var n=t.op,r=t.layoutSelectors,i=t.getConfigs,o=i(),a=o.docExpansion,s=o.deepLinking,u=o.displayOperationId,l=o.displayRequestDuration,c=o.supportedSubmitMethods,p=r.showSummary(),f=n.getIn(["operation","operationId"])||n.getIn(["operation","__originalOperationId"])||w(n.get("operation"),t.path,t.method)||n.get("id"),h=["operations",t.tag,f],d=s&&"false"!==s,m=c.indexOf(t.method)>=0&&(void 0===t.allowTryItOut?t.specSelectors.allowTryItOutFor(t.path,t.method):t.allowTryItOut),v=n.getIn(["operation","security"])||t.specSelectors.security();return{operationId:f,isDeepLinkingEnabled:d,showSummary:p,displayOperationId:u,displayRequestDuration:l,allowTryItOut:m,security:v,isAuthorized:t.authSelectors.isAuthorized(v),isShown:r.isShown(h,"full"===a),jumpToKey:"paths."+t.path+"."+t.method,response:t.specSelectors.responseFor(t.path,t.method),request:t.specSelectors.requestFor(t.path,t.method)}}},{key:"componentWillReceiveProps",value:function(e){e.response!==this.props.response&&this.setState({executeInProgress:!1})}},{key:"render",value:function(){var e=this.props,t=e.op,n=e.tag,r=e.path,i=e.method,o=e.security,a=e.isAuthorized,s=e.operationId,u=e.showSummary,l=e.isShown,c=e.jumpToKey,p=e.allowTryItOut,f=e.response,h=e.request,d=e.displayOperationId,v=e.displayRequestDuration,g=e.isDeepLinkingEnabled,y=e.specPath,_=e.specSelectors,b=e.specActions,w=e.getComponent,k=e.getConfigs,E=e.layoutSelectors,S=e.layoutActions,C=e.authActions,A=e.authSelectors,D=e.oas3Actions,O=e.oas3Selectors,M=e.fn,T=w("operation"),P=(0,x.fromJS)({op:t,tag:n,path:r,method:i,security:o,isAuthorized:a,operationId:s,showSummary:u,isShown:l,jumpToKey:c,allowTryItOut:p,request:h,displayOperationId:d,displayRequestDuration:v,isDeepLinkingEnabled:g,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return m.default.createElement(T,{operation:P,response:f,request:h,isShown:l,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:y,specActions:b,specSelectors:_,oas3Actions:D,oas3Selectors:O,layoutActions:S,layoutSelectors:E,authActions:C,authSelectors:A,getComponent:w,getConfigs:k,fn:M})}}]),t}(d.PureComponent);k.propTypes={op:g.default.instanceOf(x.Iterable).isRequired,tag:g.default.string.isRequired,path:g.default.string.isRequired,method:g.default.string.isRequired,operationId:g.default.string.isRequired,showSummary:g.default.bool.isRequired,isShown:g.default.bool.isRequired,jumpToKey:g.default.string.isRequired,allowTryItOut:g.default.bool,displayOperationId:g.default.bool,isAuthorized:g.default.bool,displayRequestDuration:g.default.bool,response:g.default.instanceOf(x.Iterable),request:g.default.instanceOf(x.Iterable),security:g.default.instanceOf(x.Iterable),isDeepLinkingEnabled:g.default.bool.isRequired,specPath:_.default.list.isRequired,getComponent:g.default.func.isRequired,authActions:g.default.object,oas3Actions:g.default.object,oas3Selectors:g.default.object,authSelectors:g.default.object,specActions:g.default.object.isRequired,specSelectors:g.default.object.isRequired,layoutActions:g.default.object.isRequired,layoutSelectors:g.default.object.isRequired,fn:g.default.object.isRequired,getConfigs:g.default.func.isRequired},k.defaultProps={showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1},t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=[],n="",r=e.get("headers");if(t.push("curl"),t.push("-X",e.get("method")),t.push('"'+e.get("url")+'"'),r&&r.size){var i=!0,o=!1,s=void 0;try{for(var l,p=(0,c.default)(e.get("headers").entries());!(i=(l=p.next()).done);i=!0){var h=l.value,d=(0,u.default)(h,2),m=d[0],v=d[1];n=v,t.push("-H "),t.push('"'+m+": "+v+'"')}}catch(e){o=!0,s=e}finally{try{!i&&p.return&&p.return()}finally{if(o)throw s}}}if(e.get("body"))if("multipart/form-data"===n&&"POST"===e.get("method")){var g=!0,y=!1,_=void 0;try{for(var b,x=(0,c.default)(e.get("body").entrySeq());!(g=(b=x.next()).done);g=!0){var w=(0,u.default)(b.value,2),k=w[0],v=w[1];t.push("-F"),v instanceof f.default.File?t.push('"'+k+"=@"+v.name+";type="+v.type+'"'):t.push('"'+k+"="+v+'"')}}catch(e){y=!0,_=e}finally{try{!g&&x.return&&x.return()}finally{if(y)throw _}}}else t.push("-d"),t.push((0,a.default)(e.get("body")).replace(/\\n/g,""));return t.join(" ")}Object.defineProperty(t,"__esModule",{value:!0});var o=n(35),a=r(o),s=n(18),u=r(s),l=n(95),c=r(l);t.default=i;var p=n(46),f=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.JsonSchema_boolean=t.JsonSchema_array=t.JsonSchema_string=t.JsonSchemaForm=void 0;var i=n(30),o=r(i),a=n(21),s=r(a),u=n(4),l=r(u),c=n(2),p=r(c),f=n(3),h=r(f),d=n(6),m=r(d),v=n(5),g=r(v),y=n(0),_=r(y),b=n(1),x=r(b),w=n(7),k=n(12),E=r(k),S=function(){},C={getComponent:x.default.func.isRequired,value:x.default.any,onChange:x.default.func,keyName:x.default.any,fn:x.default.object.isRequired,schema:x.default.object,errors:E.default.list,required:x.default.bool,description:x.default.any},A={value:"",onChange:S,schema:{},keyName:"",required:!1,errors:(0,w.List)()},D=t.JsonSchemaForm=function(e){function t(){return(0,p.default)(this,t),(0,m.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,g.default)(t,e),(0,h.default)(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.errors,r=e.value,i=e.onChange,o=e.getComponent,a=e.fn;t.toJS&&(t=t.toJS());var u=t,l=u.type,c=u.format,p=void 0===c?"":c,f=o(p?"JsonSchema_"+l+"_"+p:"JsonSchema_"+l)||o("JsonSchema_string");return _.default.createElement(f,(0,s.default)({},this.props,{errors:n,fn:a,getComponent:o,value:r,onChange:i,schema:t}))}}]),t}(y.Component);D.propTypes=C,D.defaultProps=A;var O=t.JsonSchema_string=function(e){function t(){var e,n,r,i;(0,p.default)(this,t);for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return n=r=(0,m.default)(this,(e=t.__proto__||(0,l.default)(t)).call.apply(e,[this].concat(a))),r.onChange=function(e){var t="file"===r.props.schema.type?e.target.files[0]:e.target.value;r.props.onChange(t,r.props.keyName)},r.onEnumChange=function(e){return r.props.onChange(e)},i=n,(0,m.default)(r,i)}return(0,g.default)(t,e),(0,h.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.schema,i=e.errors,o=e.required,a=e.description,s=r.enum;if(i=i.toJS?i.toJS():[],s){var u=t("Select");return _.default.createElement(u,{className:i.length?"invalid":"",title:i.length?i:"",allowedValues:s,value:n,allowEmptyValue:!o,onChange:this.onEnumChange})}var l="formData"===r.in&&!("FormData"in window),c=t("Input");return"file"===r.type?_.default.createElement(c,{type:"file",className:i.length?"invalid":"",title:i.length?i:"",onChange:this.onChange,disabled:l}):_.default.createElement(c,{type:"password"===r.format?"password":"text",className:i.length?"invalid":"",title:i.length?i:"",value:n,placeholder:a,onChange:this.onChange,disabled:l})}}]),t}(y.Component);O.propTypes=C,O.defaultProps=A;var M=t.JsonSchema_array=function(e){function t(e,n){(0,p.default)(this,t);var r=(0,m.default)(this,(t.__proto__||(0,l.default)(t)).call(this,e,n));return r.onChange=function(){return r.props.onChange(r.state.value)},r.onItemChange=function(e,t){r.setState(function(n){return{value:n.value.set(t,e)}},r.onChange)},r.removeItem=function(e){r.setState(function(t){return{value:t.value.remove(e)}},r.onChange)},r.addItem=function(){r.setState(function(e){return e.value=e.value||(0,w.List)(),{value:e.value.push("")}},r.onChange)},r.onEnumChange=function(e){r.setState(function(){return{value:e}},r.onChange)},r.state={value:e.value},r}return(0,g.default)(t,e),(0,h.default)(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value})}},{key:"render",value:function(){var e=this,t=this.props,n=t.getComponent,r=t.required,i=t.schema,a=t.errors,s=t.fn;a=a.toJS?a.toJS():[];var u=s.inferSchema(i.items),l=n("JsonSchemaForm"),c=n("Button"),p=u.enum,f=this.state.value;if(p){var h=n("Select");return _.default.createElement(h,{className:a.length?"invalid":"",title:a.length?a:"",multiple:!0,value:f,allowedValues:p,allowEmptyValue:!r,onChange:this.onEnumChange})}return _.default.createElement("div",null,!f||f.count()<1?null:f.map(function(t,r){var i=(0,o.default)({},u);if(a.length){var p=a.filter(function(e){return e.index===r});p.length&&(a=[p[0].error+r])}return _.default.createElement("div",{key:r,className:"json-schema-form-item"},_.default.createElement(l,{fn:s,getComponent:n,value:t,onChange:function(t){return e.onItemChange(t,r)},schema:i}),_.default.createElement(c,{className:"btn btn-sm json-schema-form-item-remove",onClick:function(){return e.removeItem(r)}}," - "))}).toArray(),_.default.createElement(c,{className:"btn btn-sm json-schema-form-item-add "+(a.length?"invalid":null),onClick:this.addItem}," Add item "))}}]),t}(y.PureComponent);M.propTypes=C,M.defaultProps=A;var T=t.JsonSchema_boolean=function(e){function t(){var e,n,r,i;(0,p.default)(this,t);for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return n=r=(0,m.default)(this,(e=t.__proto__||(0,l.default)(t)).call.apply(e,[this].concat(a))),r.onEnumChange=function(e){return r.props.onChange(e)},i=n,(0,m.default)(r,i)}return(0,g.default)(t,e),(0,h.default)(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,i=e.schema;r=r.toJS?r.toJS():[];var o=t("Select");return _.default.createElement(o,{className:r.length?"invalid":"",title:r.length?r:"",value:String(n),allowedValues:(0,w.fromJS)(i.enum||["true","false"]),allowEmptyValue:!this.props.required,onChange:this.onEnumChange})}}]),t}(y.Component);T.propTypes=C,T.defaultProps=A},function(e,t,n){"use strict";function r(e){var t=e.auth,n=e.authActions,r=e.errActions,i=e.configs,s=e.authConfigs,u=void 0===s?{}:s,l=t.schema,c=t.scopes,p=t.name,f=t.clientId,h=l.get("flow"),d=[];switch(h){case"password":return void n.authorizePassword(t);case"application":return void n.authorizeApplication(t);case"accessCode":d.push("response_type=code");break;case"implicit":d.push("response_type=token");break;case"clientCredentials":return void n.authorizeApplication(t);case"authorizationCode":d.push("response_type=code")}"string"==typeof f&&d.push("client_id="+encodeURIComponent(f));var m=i.oauth2RedirectUrl;if(void 0===m)return void r.newAuthErr({authId:p,source:"validation",level:"error",message:"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed."});if(d.push("redirect_uri="+encodeURIComponent(m)),Array.isArray(c)&&0<c.length){var v=u.scopeSeparator||" ";d.push("scope="+encodeURIComponent(c.join(v)))}var g=(0,a.btoa)(new Date);d.push("state="+encodeURIComponent(g)),void 0!==u.realm&&d.push("realm="+encodeURIComponent(u.realm));var y=u.additionalQueryStringParams;for(var _ in y)void 0!==y[_]&&d.push([_,y[_]].map(encodeURIComponent).join("="));var b=l.get("authorizationUrl"),x=[b,d.join("&")].join(-1===b.indexOf("?")?"?":"&"),w=void 0;w="implicit"===h?n.preAuthorizeImplicit:u.useBasicAuthenticationWithAccessCodeGrant?n.authorizeAccessCodeWithBasicAuthentication:n.authorizeAccessCodeWithFormParams,o.default.swaggerUIRedirectOauth2={auth:t,state:g,redirectUrl:m,callback:w,errCb:r.newAuthErr},o.default.open(x)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(46),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(9)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return[a.default,u.default]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(561),a=r(o),s=n(307),u=r(s)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e={components:{App:F.default,authorizationPopup:B.default,authorizeBtn:q.default,authorizeOperationBtn:U.default,auths:V.default,AuthItem:G.default,authError:K.default,oauth2:ee.default,apiKeyAuth:Y.default,basicAuth:Z.default,clear:ne.default,liveResponse:ie.default,info:qe.default,onlineValidatorBadge:ae.default,operations:ue.default,operation:ce.default,highlightCode:ve.default,responses:ye.default,response:be.default,responseBody:we.default,parameters:Ee.default,parameterRow:De.default,execute:Me.default,headers:Pe.default,errors:Re.default,contentType:Fe.default,overview:Be.default,footer:Ue.default,ParamBody:Ve.default,curl:Ge.default,schemes:Ke.default,modelExample:Ze.default,ModelWrapper:et.default,ModelCollapse:Ye.default,Model:nt.default,Models:it.default,EnumModel:at.default,ObjectModel:ut.default,ArrayModel:ct.default,PrimitiveModel:ft.default,Property:dt.default,TryItOutButton:vt.default,Markdown:wt.default,BaseLayout:Et.default,VersionStamp:yt.default,OperationExt:fe.default,OperationExtRow:de.default,ParameterExt:Ce.default,OperationContainer:R.default,DeepLink:bt.default}},t={components:Ct},n={components:Dt};return[M.default,E.default,v.default,f.default,c.default,a.default,u.default,d.default,e,t,b.default,n,w.default,y.default,C.default,D.default,P.default]};var o=n(291),a=i(o),s=n(294),u=i(s),l=n(320),c=i(l),p=n(328),f=i(p),h=n(319),d=i(h),m=n(297),v=i(m),g=n(273),y=i(g),_=n(326),b=i(_),x=n(275),w=i(x),k=n(327),E=i(k),S=n(325),C=i(S),A=n(286),D=i(A),O=n(279),M=i(O),T=n(283),P=i(T),I=n(556),R=i(I),j=n(509),F=i(j),N=n(513),B=i(N),L=n(514),q=i(L),z=n(515),U=i(z),W=n(516),V=i(W),H=n(512),G=i(H),J=n(518),K=i(J),X=n(511),Y=i(X),$=n(517),Z=i($),Q=n(519),ee=i(Q),te=n(520),ne=i(te),re=n(532),ie=i(re),oe=n(538),ae=i(oe),se=n(542),ue=i(se),le=n(541),ce=i(le),pe=n(540),fe=i(pe),he=n(539),de=i(he),me=n(529),ve=i(me),ge=n(552),ye=i(ge),_e=n(551),be=i(_e),xe=n(550),we=i(xe),ke=n(547),Ee=i(ke),Se=n(545),Ce=i(Se),Ae=n(546),De=i(Ae),Oe=n(526),Me=i(Oe),Te=n(528),Pe=i(Te),Ie=n(525),Re=i(Ie),je=n(521),Fe=i(je),Ne=n(543),Be=i(Ne),Le=n(530),qe=i(Le),ze=n(527),Ue=i(ze),We=n(544),Ve=i(We),He=n(522),Ge=i(He),Je=n(553),Ke=i(Je),Xe=n(533),Ye=i(Xe),$e=n(534),Ze=i($e),Qe=n(535),et=i(Qe),tt=n(269),nt=i(tt),rt=n(536),it=i(rt),ot=n(524),at=i(ot),st=n(537),ut=i(st),lt=n(510),ct=i(lt),pt=n(548),ft=i(pt),ht=n(549),dt=i(ht),mt=n(554),vt=i(mt),gt=n(555),yt=i(gt),_t=n(523),bt=i(_t),xt=n(270),wt=i(xt),kt=n(531),Et=i(kt),St=n(268),Ct=r(St),At=n(558),Dt=r(At)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var r=[(0,F.systemThunkMiddleware)(n)],i=j.default.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||S.compose;return(0,S.createStore)(e,t,i(S.applyMiddleware.apply(void 0,r)))}function o(e,t){return(0,F.isObject)(e)&&!(0,F.isArray)(e)?e:(0,F.isFunc)(e)?o(e(t),t):(0,F.isArray)(e)?e.map(function(e){return o(e,t)}).reduce(s,{}):{}}function a(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.hasLoaded,o=i;return(0,F.isObject)(e)&&!(0,F.isArray)(e)&&"function"==typeof e.afterLoad&&(o=!0,p(e.afterLoad).call(this,t)),(0,F.isFunc)(e)?a.call(this,e(t),t,{hasLoaded:o}):(0,F.isArray)(e)?e.map(function(e){return a.call(n,e,t,{hasLoaded:o})}):o}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,F.isObject)(e))return{};if(!(0,F.isObject)(t))return e;t.wrapComponents&&((0,F.objMap)(t.wrapComponents,function(n,r){var i=e.components&&e.components[r];i&&Array.isArray(i)?(e.components[r]=i.concat([n]),delete t.wrapComponents[r]):i&&(e.components[r]=[i,n],delete t.wrapComponents[r])}),(0,d.default)(t.wrapComponents).length||delete t.wrapComponents);var n=e.statePlugins;if((0,F.isObject)(n))for(var r in n){var i=n[r];if((0,F.isObject)(i)&&(0,F.isObject)(i.wrapActions)){var o=i.wrapActions;for(var a in o){var s=o[a];Array.isArray(s)||(s=[s],o[a]=s),t&&t.statePlugins&&t.statePlugins[r]&&t.statePlugins[r].wrapActions&&t.statePlugins[r].wrapActions[a]&&(t.statePlugins[r].wrapActions[a]=o[a].concat(t.statePlugins[r].wrapActions[a]))}}}return(0,O.default)(e,t)}function u(e){return l((0,F.objMap)(e,function(e){return e.reducers}))}function l(e){var t=(0,d.default)(e).reduce(function(t,n){return t[n]=c(e[n]),t},{});return(0,d.default)(t).length?(0,M.combineReducers)(t):N}function c(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new C.Map,n=arguments[1];if(!e)return t;var r=e[n.type];if(r){var i=p(r)(t,n);return null===i?t:i}return t}}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.logErrors,r=void 0===n||n;return"function"!=typeof e?e:function(){try{for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return e.call.apply(e,[this].concat(n))}catch(e){return r&&console.error(e),null}}}function f(e,t,n){return i(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0});var h=n(47),d=r(h),m=n(36),v=r(m),g=n(30),y=r(g),_=n(2),b=r(_),x=n(3),w=r(x),k=n(0),E=r(k),S=n(486),C=n(7),A=r(C),D=n(203),O=r(D),M=n(1117),T=n(264),P=r(T),I=n(128),R=n(46),j=r(R),F=n(9),N=function(e){return e},B=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,b.default)(this,e),(0,O.default)(this,{state:{},plugins:[],system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},t),this.getSystem=this._getSystem.bind(this),this.store=f(N,(0,C.fromJS)(this.state),this.getSystem),this.buildSystem(!1),this.register(this.plugins)}return(0,w.default)(e,[{key:"getStore",value:function(){return this.store}},{key:"register",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=o(e,this.getSystem());s(this.system,n),t&&this.buildSystem(),a.call(this.system,e,this.getSystem())&&this.buildSystem()}},{key:"buildSystem",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.getStore().dispatch,n=this.getStore().getState;this.boundSystem=(0,y.default)({},this.getRootInjects(),this.getWrappedAndBoundActions(t),this.getWrappedAndBoundSelectors(n,this.getSystem),this.getStateThunks(n),this.getFn(),this.getConfigs()),e&&this.rebuildReducer()}},{key:"_getSystem",value:function(){return this.boundSystem}},{key:"getRootInjects",value:function(){return(0,y.default)({getSystem:this.getSystem,getStore:this.getStore.bind(this),getComponents:this.getComponents.bind(this),getState:this.getStore().getState,getConfigs:this._getConfigs.bind(this),Im:A.default,React:E.default},this.system.rootInjects||{})}},{key:"_getConfigs",value:function(){return this.system.configs}},{key:"getConfigs",value:function(){return{configs:this.system.configs}}},{key:"setConfigs",value:function(e){this.system.configs=e}},{key:"rebuildReducer",value:function(){this.store.replaceReducer(u(this.system.statePlugins))}},{key:"getType",value:function(e){var t=e[0].toUpperCase()+e.slice(1);return(0,F.objReduce)(this.system.statePlugins,function(n,r){var i=n[e];if(i)return(0,v.default)({},r+t,i)})}},{key:"getSelectors",value:function(){return this.getType("selectors")}},{key:"getActions",value:function(){var e=this.getType("actions");return(0,F.objMap)(e,function(e){return(0,F.objReduce)(e,function(e,t){if((0,F.isFn)(e))return(0,v.default)({},t,e)})})}},{key:"getWrappedAndBoundActions",value:function(e){var t=this,n=this.getBoundActions(e);return(0,F.objMap)(n,function(e,n){var r=t.system.statePlugins[n.slice(0,-7)].wrapActions;return r?(0,F.objMap)(e,function(e,n){var i=r[n];return i?(Array.isArray(i)||(i=[i]),i.reduce(function(e,n){var r=function(){return n(e,t.getSystem()).apply(void 0,arguments)};if(!(0,F.isFn)(r))throw new TypeError("wrapActions needs to return a function that returns a new function (ie the wrapped action)");return p(r)},e||Function.prototype)):e}):e})}},{key:"getWrappedAndBoundSelectors",value:function(e,t){var n=this,r=this.getBoundSelectors(e,t);return(0,F.objMap)(r,function(t,r){var i=[r.slice(0,-9)],o=n.system.statePlugins[i].wrapSelectors;return o?(0,F.objMap)(t,function(t,r){var a=o[r];return a?(Array.isArray(a)||(a=[a]),a.reduce(function(t,r){var o=function(){for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return r(t,n.getSystem()).apply(void 0,[e().getIn(i)].concat(a))};if(!(0,F.isFn)(o))throw new TypeError("wrapSelector needs to return a function that returns a new function (ie the wrapped action)");return o},t||Function.prototype)):t}):t})}},{key:"getStates",value:function(e){return(0,d.default)(this.system.statePlugins).reduce(function(t,n){return t[n]=e.get(n),t},{})}},{key:"getStateThunks",value:function(e){return(0,d.default)(this.system.statePlugins).reduce(function(t,n){return t[n]=function(){return e().get(n)},t},{})}},{key:"getFn",value:function(){return{fn:this.system.fn}}},{key:"getComponents",value:function(e){var t=this,n=this.system.components[e];return Array.isArray(n)?n.reduce(function(e,n){return n(e,t.getSystem())}):void 0!==e?this.system.components[e]:this.system.components}},{key:"getBoundSelectors",value:function(e,t){return(0,F.objMap)(this.getSelectors(),function(n,r){var i=[r.slice(0,-9)],o=function(){return e().getIn(i)};return(0,F.objMap)(n,function(e){return function(){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=p(e).apply(null,[o()].concat(r));return"function"==typeof a&&(a=p(a)(t())),a}})})}},{key:"getBoundActions",value:function(e){e=e||this.getStore().dispatch;var t=this.getActions(),n=function e(t){return"function"!=typeof t?(0,F.objMap)(t,function(t){return e(t)}):function(){var e=null;try{e=t.apply(void 0,arguments)}catch(t){e={type:I.NEW_THROWN_ERR,error:!0,payload:(0,P.default)(t)}}finally{return e}}};return(0,F.objMap)(t,function(t){return(0,S.bindActionCreators)(n(t),e)})}},{key:"getMapStateToProps",value:function(){var e=this;return function(){return(0,y.default)({},e.getSystem())}}},{key:"getMapDispatchToProps",value:function(e){var t=this;return function(n){return(0,O.default)({},t.getWrappedAndBoundActions(n),t.getFn(),e)}}}]),e}();t.default=B},function(e,t,n){e.exports={default:n(585),__esModule:!0}},function(e,t,n){e.exports={default:n(587),__esModule:!0}},function(e,t,n){e.exports={default:n(594),__esModule:!0}},function(e,t,n){e.exports={default:n(596),__esModule:!0}},function(e,t,n){e.exports={default:n(597),__esModule:!0}},function(e,t,n){e.exports={default:n(598),__esModule:!0}},function(e,t,n){e.exports=n(1124)},function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-r(e)}function o(e){var t,n,i,o,a,s=e.length;o=r(e),a=new p(3*s/4-o),n=o>0?s-4:s;var u=0;for(t=0;t<n;t+=4)i=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}function a(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function s(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(a(r));return i.join("")}function u(e){for(var t,n=e.length,r=n%3,i="",o=[],a=0,u=n-r;a<u;a+=16383)o.push(s(e,a,a+16383>u?u:a+16383));return 1===r?(t=e[n-1],i+=l[t>>2],i+=l[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=l[t>>10],i+=l[t>>4&63],i+=l[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=i,t.toByteArray=o,t.fromByteArray=u;for(var l=[],c=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,d=f.length;h<d;++h)l[h]=f[h],c[f.charCodeAt(h)]=h;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(e,t,n){/*! - * Bowser - a browser detector - * https://github.com/ded/bowser - * MIT License | (c) Dustin Diaz 2015 +var r=n(267),o=n(456),i=n(456);t.applyOperation=i.applyOperation,t.applyPatch=i.applyPatch,t.applyReducer=i.applyReducer,t.getValueByPointer=i.getValueByPointer,t.validate=i.validate,t.validator=i.validator;var a=n(267);t.JsonPatchError=a.PatchError,t.deepClone=a._deepClone,t.escapePathComponent=a.escapePathComponent,t.unescapePathComponent=a.unescapePathComponent;var s=new WeakMap,u=function(e){this.observers=new Map,this.obj=e},c=function(e,t){this.callback=e,this.observer=t};function l(e){var t=s.get(e.object);p(t.value,e.object,e.patches,""),e.patches.length&&o.applyPatch(t.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function p(e,t,n,o){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=r._objectKeys(t),a=r._objectKeys(e),s=!1,u=a.length-1;u>=0;u--){var c=e[f=a[u]];if(!r.hasOwnProperty(t,f)||void 0===t[f]&&void 0!==c&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(n.push({op:"remove",path:o+"/"+r.escapePathComponent(f)}),s=!0):(n.push({op:"replace",path:o,value:t}),!0);else{var l=t[f];"object"==typeof c&&null!=c&&"object"==typeof l&&null!=l?p(c,l,n,o+"/"+r.escapePathComponent(f)):c!==l&&(!0,n.push({op:"replace",path:o+"/"+r.escapePathComponent(f),value:r._deepClone(l)}))}}if(s||i.length!=a.length)for(u=0;u<i.length;u++){var f=i[u];r.hasOwnProperty(e,f)||void 0===t[f]||n.push({op:"add",path:o+"/"+r.escapePathComponent(f),value:r._deepClone(t[f])})}}}t.unobserve=function(e,t){t.unobserve()},t.observe=function(e,t){var n,o=function(e){return s.get(e)}(e);if(o){var i=function(e,t){return e.observers.get(t)}(o,t);n=i&&i.observer}else o=new u(e),s.set(e,o);if(n)return n;if(n={},o.value=r._deepClone(e),t){n.callback=t,n.next=null;var a=function(){l(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(a)};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p)):(document.documentElement.attachEvent("onmouseup",p),document.documentElement.attachEvent("onkeyup",p),document.documentElement.attachEvent("onmousedown",p),document.documentElement.attachEvent("onkeydown",p),document.documentElement.attachEvent("onchange",p)))}return n.patches=[],n.object=e,n.unobserve=function(){l(n),clearTimeout(n.next),function(e,t){e.observers.delete(t.callback)}(o,n),"undefined"!=typeof window&&(window.removeEventListener?(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p)):(document.documentElement.detachEvent("onmouseup",p),document.documentElement.detachEvent("onkeyup",p),document.documentElement.detachEvent("onmousedown",p),document.documentElement.detachEvent("onkeydown",p)))},o.observers.set(t,new c(t,n)),n},t.generate=l,t.compare=function(e,t){var n=[];return p(e,t,n,""),n}},function(e,t,n){var r=Array.prototype.slice,o=n(941),i=n(942),a=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:function(e,t,n){var c,l;if(s(e)||s(t))return!1;if(e.prototype!==t.prototype)return!1;if(i(e))return!!i(t)&&(e=r.call(e),t=r.call(t),a(e,t,n));if(u(e)){if(!u(t))return!1;if(e.length!==t.length)return!1;for(c=0;c<e.length;c++)if(e[c]!==t[c])return!1;return!0}try{var p=o(e),f=o(t)}catch(e){return!1}if(p.length!=f.length)return!1;for(p.sort(),f.sort(),c=p.length-1;c>=0;c--)if(p[c]!=f[c])return!1;for(c=p.length-1;c>=0;c--)if(l=p[c],!a(e[l],t[l],n))return!1;return typeof e==typeof t}(e,t,n))};function s(e){return null==e}function u(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}(e.exports="function"==typeof Object.keys?Object.keys:n).shim=n},function(e,t){var n="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function r(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}(t=e.exports=n?r:o).supported=r,t.unsupported=o},function(e,t,n){(function(t){!function(){"use strict";e.exports=function(e){return(e instanceof t?e:new t(e.toString(),"binary")).toString("base64")}}()}).call(this,n(64).Buffer)},function(e,t,n){var r=n(945),o=n(365),i=n(386),a=n(69);e.exports=function(e,t,n){return e=a(e),n=null==n?0:r(i(n),0,e.length),t=o(t),e.slice(n,n+t.length)==t}},function(e,t){e.exports=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}},function(e,t,n){"use strict";var r=n(947),o=n(948),i=n(458);e.exports={formats:i,parse:o,stringify:r}},function(e,t,n){"use strict";var r=n(457),o=n(458),i=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,u=Array.prototype.push,c=function(e,t){u.apply(e,s(t)?t:[t])},l=Date.prototype.toISOString,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,formatter:o.formatters[o.default],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},f=function e(t,n,o,i,a,u,l,f,h,d,m,v,g){var y=t;if("function"==typeof l?y=l(n,y):y instanceof Date?y=d(y):"comma"===o&&s(y)&&(y=y.join(",")),null===y){if(i)return u&&!v?u(n,p.encoder,g):n;y=""}if("string"==typeof y||"number"==typeof y||"boolean"==typeof y||r.isBuffer(y))return u?[m(v?n:u(n,p.encoder,g))+"="+m(u(y,p.encoder,g))]:[m(n)+"="+m(String(y))];var b,_=[];if(void 0===y)return _;if(s(l))b=l;else{var w=Object.keys(y);b=f?w.sort(f):w}for(var x=0;x<b.length;++x){var E=b[x];a&&null===y[E]||(s(y)?c(_,e(y[E],"function"==typeof o?o(n,E):n,o,i,a,u,l,f,h,d,m,v,g)):c(_,e(y[E],n+(h?"."+E:"["+E+"]"),o,i,a,u,l,f,h,d,m,v,g)))}return _};e.exports=function(e,t){var n,r=e,u=function(e){if(!e)return p;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||p.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if(void 0!==e.format){if(!i.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],a=p.filter;return("function"==typeof e.filter||s(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:p.addQueryPrefix,allowDots:void 0===e.allowDots?p.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:p.charsetSentinel,delimiter:void 0===e.delimiter?p.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:p.encode,encoder:"function"==typeof e.encoder?e.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:p.encodeValuesOnly,filter:a,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:p.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:p.strictNullHandling}}(t);"function"==typeof u.filter?r=(0,u.filter)("",r):s(u.filter)&&(n=u.filter);var l,h=[];if("object"!=typeof r||null===r)return"";l=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var d=a[l];n||(n=Object.keys(r)),u.sort&&n.sort(u.sort);for(var m=0;m<n.length;++m){var v=n[m];u.skipNulls&&null===r[v]||c(h,f(r[v],v,d,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.formatter,u.encodeValuesOnly,u.charset))}var g=h.join(u.delimiter),y=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),g.length>0?y+g:""}},function(e,t,n){"use strict";var r=n(457),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),s=a?r.slice(0,a.index):r,u=[];if(s){if(!n.plainObjects&&o.call(Object.prototype,s)&&!n.allowPrototypes)return;u.push(s)}for(var c=0;null!==(a=i.exec(r))&&c<n.depth;){if(c+=1,!n.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+r.slice(a.index)+"]"),function(e,t,n){for(var r=t,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a&&n.parseArrays)i=[].concat(r);else{i=n.plainObjects?Object.create(null):{};var s="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(s,10);n.parseArrays||""!==s?!isNaN(u)&&a!==s&&String(u)===s&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[])[u]=r:i[s]=r:i={0:r}}r=i}return r}(u,t,n)}};e.exports=function(e,t){var n=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth?e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,s={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,c=t.parameterLimit===1/0?void 0:t.parameterLimit,l=u.split(t.delimiter,c),p=-1,f=t.charset;if(t.charsetSentinel)for(n=0;n<l.length;++n)0===l[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===l[n]?f="utf-8":"utf8=%26%2310003%3B"===l[n]&&(f="iso-8859-1"),p=n,n=l.length);for(n=0;n<l.length;++n)if(n!==p){var h,d,m=l[n],v=m.indexOf("]="),g=-1===v?m.indexOf("="):v+1;-1===g?(h=t.decoder(m,i.decoder,f),d=t.strictNullHandling?null:""):(h=t.decoder(m.slice(0,g),i.decoder,f),d=t.decoder(m.slice(g+1),i.decoder,f)),d&&t.interpretNumericEntities&&"iso-8859-1"===f&&(d=a(d)),d&&t.comma&&d.indexOf(",")>-1&&(d=d.split(",")),o.call(s,h)?s[h]=r.combine(s[h],d):s[h]=d}return s}(e,n):e,c=n.plainObjects?Object.create(null):{},l=Object.keys(u),p=0;p<l.length;++p){var f=l[p],h=s(f,u[f],n);c=r.merge(c,h,n)}return r.compact(c)}},function(e,t,n){"use strict";var r=t,o=n(64).Buffer;function i(e,t){try{return decodeURIComponent(e)}catch(n){return r.unescapeBuffer(e,t).toString()}}r.unescapeBuffer=function(e,t){for(var n,r,i,a=new o(e.length),s=0,u=0,c=0;u<=e.length;u++){var l=u<e.length?e.charCodeAt(u):NaN;switch(s){case 0:switch(l){case 37:n=0,r=0,s=1;break;case 43:t&&(l=32);default:a[c++]=l}break;case 1:if(i=l,l>=48&&l<=57)n=l-48;else if(l>=65&&l<=70)n=l-65+10;else{if(!(l>=97&&l<=102)){a[c++]=37,a[c++]=l,s=0;break}n=l-97+10}s=2;break;case 2:if(s=0,l>=48&&l<=57)r=l-48;else if(l>=65&&l<=70)r=l-65+10;else{if(!(l>=97&&l<=102)){a[c++]=37,a[c++]=i,a[c++]=l;break}r=l-97+10}a[c++]=16*n+r}}return a.slice(0,c-1)},r.unescape=i;for(var a=new Array(256),s=0;s<256;++s)a[s]="%"+((s<16?"0":"")+s.toString(16)).toUpperCase();r.escape=function(e){"string"!=typeof e&&(e+="");for(var t="",n=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);if(!(33===o||45===o||46===o||95===o||126===o||o>=39&&o<=42||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122))if(r-n>0&&(t+=e.slice(n,r)),o<128)n=r+1,t+=a[o];else if(o<2048)n=r+1,t+=a[192|o>>6]+a[128|63&o];else if(o<55296||o>=57344)n=r+1,t+=a[224|o>>12]+a[128|o>>6&63]+a[128|63&o];else{var i;if(!(++r<e.length))throw new URIError("URI malformed");i=1023&e.charCodeAt(r),n=r+1,t+=a[240|(o=65536+((1023&o)<<10|i))>>18]+a[128|o>>12&63]+a[128|o>>6&63]+a[128|63&o]}}return 0===n?e:n<e.length?t+e.slice(n):t};var u=function(e){return"string"==typeof e?e:"number"==typeof e&&isFinite(e)?""+e:"boolean"==typeof e?e?"true":"false":""};function c(e,t){try{return t(e)}catch(t){return r.unescape(e,!0)}}r.stringify=r.encode=function(e,t,n,o){t=t||"&",n=n||"=";var i=r.escape;if(o&&"function"==typeof o.encodeURIComponent&&(i=o.encodeURIComponent),null!==e&&"object"==typeof e){for(var a=Object.keys(e),s=a.length,c=s-1,l="",p=0;p<s;++p){var f=a[p],h=e[f],d=i(u(f))+n;if(Array.isArray(h)){for(var m=h.length,v=m-1,g=0;g<m;++g)l+=d+i(u(h[g])),g<v&&(l+=t);m&&p<c&&(l+=t)}else l+=d+i(u(h)),p<c&&(l+=t)}return l}return""},r.parse=r.decode=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;"string"!=typeof t&&(t+="");var s=n.length,u=t.length,l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var p=1/0;l>0&&(p=l);var f=r.unescape;o&&"function"==typeof o.decodeURIComponent&&(f=o.decodeURIComponent);for(var h=f!==i,d=[],m=0,v=0,g=0,y="",b="",_=h,w=h,x=0,E=0;E<e.length;++E){var S=e.charCodeAt(E);if(S!==t.charCodeAt(v)){if(v=0,w||(37===S?x=1:x>0&&(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102)?3==++x&&(w=!0):x=0),g<s){if(S===n.charCodeAt(g)){if(++g===s)m<(k=E-g+1)&&(y+=e.slice(m,k)),x=0,m=E+1;continue}g=0,_||(37===S?x=1:x>0&&(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102)?3==++x&&(_=!0):x=0)}43===S&&(g<s?(E-m>0&&(y+=e.slice(m,E)),y+="%20",_=!0):(E-m>0&&(b+=e.slice(m,E)),b+="%20",w=!0),m=E+1)}else if(++v===u){var C,k=E-v+1;if(g<s?m<k&&(y+=e.slice(m,k)):m<k&&(b+=e.slice(m,k)),_&&(y=c(y,f)),w&&(b=c(b,f)),-1===d.indexOf(y))a[y]=b,d[d.length]=y;else(C=a[y])instanceof Array?C[C.length]=b:a[y]=[C,b];if(0==--p)break;_=w=h,x=0,y=b="",m=E+1,v=g=0}}p>0&&(m<e.length||g>0)&&(m<e.length&&(g<s?y+=e.slice(m):v<u&&(b+=e.slice(m))),_&&(y=c(y,f)),w&&(b=c(b,f)),-1===d.indexOf(y)?(a[y]=b,d[d.length]=y):(C=a[y])instanceof Array?C[C.length]=b:a[y]=[C,b]);return a}},function(e,t,n){"use strict";(function(t){ +/*! + * @description Recursive object extending + * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com> + * @license MIT + * + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Viacheslav Lotsmanov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -!function(t,r,i){void 0!==e&&e.exports?e.exports=i():n(1195)("bowser",i)}(0,0,function(){function e(e){function t(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}function n(t){var n=e.match(t);return n&&n.length>1&&n[2]||""}var r,i=t(/(ipod|iphone|ipad)/i).toLowerCase(),o=/like android/i.test(e),s=!o&&/android/i.test(e),u=/nexus\s*[0-6]\s*/i.test(e),l=!u&&/nexus\s*[0-9]+/i.test(e),c=/CrOS/.test(e),p=/silk/i.test(e),f=/sailfish/i.test(e),h=/tizen/i.test(e),d=/(web|hpw)os/i.test(e),m=/windows phone/i.test(e),v=(/SamsungBrowser/i.test(e),!m&&/windows/i.test(e)),g=!i&&!p&&/macintosh/i.test(e),y=!s&&!f&&!h&&!d&&/linux/i.test(e),_=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),b=t(/version\/(\d+(\.\d+)?)/i),x=/tablet/i.test(e)&&!/tablet pc/i.test(e),w=!x&&/[^-]mobi/i.test(e),k=/xbox/i.test(e);/opera/i.test(e)?r={name:"Opera",opera:a,version:b||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?r={name:"Opera",opera:a,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||b}:/SamsungBrowser/i.test(e)?r={name:"Samsung Internet for Android",samsungBrowser:a,version:b||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?r={name:"Opera Coast",coast:a,version:b||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?r={name:"Yandex Browser",yandexbrowser:a,version:b||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?r={name:"UC Browser",ucbrowser:a,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?r={name:"Maxthon",maxthon:a,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?r={name:"Epiphany",epiphany:a,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?r={name:"Puffin",puffin:a,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?r={name:"Sleipnir",sleipnir:a,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?r={name:"K-Meleon",kMeleon:a,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:m?(r={name:"Windows Phone",osname:"Windows Phone",windowsphone:a},_?(r.msedge=a,r.version=_):(r.msie=a,r.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?r={name:"Internet Explorer",msie:a,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:c?r={name:"Chrome",osname:"Chrome OS",chromeos:a,chromeBook:a,chrome:a,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(e)?r={name:"Microsoft Edge",msedge:a,version:_}:/vivaldi/i.test(e)?r={name:"Vivaldi",vivaldi:a,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||b}:f?r={name:"Sailfish",osname:"Sailfish OS",sailfish:a,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?r={name:"SeaMonkey",seamonkey:a,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(r={name:"Firefox",firefox:a,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(r.firefoxos=a,r.osname="Firefox OS")):p?r={name:"Amazon Silk",silk:a,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?r={name:"PhantomJS",phantom:a,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?r={name:"SlimerJS",slimer:a,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?r={name:"BlackBerry",osname:"BlackBerry OS",blackberry:a,version:b||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:d?(r={name:"WebOS",osname:"WebOS",webos:a,version:b||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(r.touchpad=a)):/bada/i.test(e)?r={name:"Bada",osname:"Bada",bada:a,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:h?r={name:"Tizen",osname:"Tizen",tizen:a,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||b}:/qupzilla/i.test(e)?r={name:"QupZilla",qupzilla:a,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||b}:/chromium/i.test(e)?r={name:"Chromium",chromium:a,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||b}:/chrome|crios|crmo/i.test(e)?r={name:"Chrome",chrome:a,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:s?r={name:"Android",version:b}:/safari|applewebkit/i.test(e)?(r={name:"Safari",safari:a},b&&(r.version=b)):i?(r={name:"iphone"==i?"iPhone":"ipad"==i?"iPad":"iPod"},b&&(r.version=b)):r=/googlebot/i.test(e)?{name:"Googlebot",googlebot:a,version:t(/googlebot\/(\d+(\.\d+))/i)||b}:{name:t(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!r.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(r.name=r.name||"Blink",r.blink=a):(r.name=r.name||"Webkit",r.webkit=a),!r.version&&b&&(r.version=b)):!r.opera&&/gecko\//i.test(e)&&(r.name=r.name||"Gecko",r.gecko=a,r.version=r.version||t(/gecko\/(\d+(\.\d+)?)/i)),r.windowsphone||!s&&!r.silk?!r.windowsphone&&i?(r[i]=a,r.ios=a,r.osname="iOS"):g?(r.mac=a,r.osname="macOS"):k?(r.xbox=a,r.osname="Xbox"):v?(r.windows=a,r.osname="Windows"):y&&(r.linux=a,r.osname="Linux"):(r.android=a,r.osname="Android");var E="";r.windows?E=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)):r.windowsphone?E=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):r.mac?(E=t(/Mac OS X (\d+([_\.\s]\d+)*)/i),E=E.replace(/[_\s]/g,".")):i?(E=t(/os (\d+([_\s]\d+)*) like mac os x/i),E=E.replace(/[_\s]/g,".")):s?E=t(/android[ \/-](\d+(\.\d+)*)/i):r.webos?E=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):r.blackberry?E=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):r.bada?E=t(/bada\/(\d+(\.\d+)*)/i):r.tizen&&(E=t(/tizen[\/\s](\d+(\.\d+)*)/i)),E&&(r.osversion=E);var S=!r.windows&&E.split(".")[0];return x||l||"ipad"==i||s&&(3==S||S>=4&&!w)||r.silk?r.tablet=a:(w||"iphone"==i||"ipod"==i||s||u||r.blackberry||r.webos||r.bada)&&(r.mobile=a),r.msedge||r.msie&&r.version>=10||r.yandexbrowser&&r.version>=15||r.vivaldi&&r.version>=1||r.chrome&&r.version>=20||r.samsungBrowser&&r.version>=4||r.firefox&&r.version>=20||r.safari&&r.version>=6||r.opera&&r.version>=10||r.ios&&r.osversion&&r.osversion.split(".")[0]>=6||r.blackberry&&r.version>=10.1||r.chromium&&r.version>=20?r.a=a:r.msie&&r.version<10||r.chrome&&r.version<20||r.firefox&&r.version<20||r.safari&&r.version<6||r.opera&&r.version<10||r.ios&&r.osversion&&r.osversion.split(".")[0]<6||r.chromium&&r.version<20?r.c=a:r.x=a,r}function t(e){return e.split(".").length}function n(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n++)r.push(t(e[n]));return r}function r(e){for(var r=Math.max(t(e[0]),t(e[1])),i=n(e,function(e){var i=r-t(e);return e+=new Array(i+1).join(".0"),n(e.split("."),function(e){return new Array(20-e.length).join("0")+e}).reverse()});--r>=0;){if(i[0][r]>i[1][r])return 1;if(i[0][r]!==i[1][r])return-1;if(0===r)return 0}}function i(t,n,i){var o=s;"string"==typeof n&&(i=n,n=void 0),void 0===n&&(n=!1),i&&(o=e(i));var a=""+o.version;for(var u in t)if(t.hasOwnProperty(u)&&o[u]){if("string"!=typeof t[u])throw new Error("Browser version in the minVersion map should be a string: "+u+": "+String(t));return r([a,t[u]])<0}return n}function o(e,t,n){return!i(e,t,n)}var a=!0,s=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return s.test=function(e){for(var t=0;t<e.length;++t){var n=e[t];if("string"==typeof n&&n in s)return!0}return!1},s.isUnsupportedBrowser=i,s.compareVersions=r,s.check=o,s._detect=e,s})},function(e,t,n){(function(t){!function(){"use strict";function n(e){var n;return n=e instanceof t?e:new t(e.toString(),"binary"),n.toString("base64")}e.exports=n}()}).call(t,n(40).Buffer)},function(e,t,n){var r,i;/*! - Copyright (c) 2016 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ -!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===i)for(var a in r)o.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var o={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(r=[],void 0!==(i=function(){return n}.apply(t,r))&&(e.exports=i))}()},function(e,t,n){"use strict";function r(e){return{key:e.nodeKey,className:e.className,"data-sourcepos":e["data-sourcepos"]}}function i(e){var t=e.toLowerCase(),n=w[t]||t;return void 0!==k[n]?n:e}function o(e){return Object.keys(e||{}).reduce(function(t,n){return t[i(n)]=e[n],t},{})}function a(e){var t=r(e),n=e.escapeHtml?{}:{dangerouslySetInnerHTML:{__html:e.literal}},i=e.escapeHtml?[e.literal]:null;if(e.escapeHtml||!e.skipHtml){var o=y(t,n);return l(e.isBlock?"div":"span",o,i)}}function s(e){var t=e.parent.parent;return t&&"list"===t.type.toLowerCase()&&t.listTight}function u(e,t){var n=e;do{n=n.parent}while(!n.react);n.react.children.push(t)}function l(e,t,n){var r=Array.isArray(n)&&n.reduce(c,[]),i=[e,t].concat(r||n);return g.createElement.apply(g,i)}function c(e,t){var n=e.length-1;return"string"==typeof t&&"string"==typeof e[n]?e[n]+=t:e.push(t),e}function p(e){return[e[0][0],":",e[0][1],"-",e[1][0],":",e[1][1]].map(String).join("")}function f(e,t,n,r){var o={key:t};n.sourcePos&&e.sourcepos&&(o["data-sourcepos"]=p(e.sourcepos));var a=i(e.type);switch(a){case"html_inline":case"html_block":o.isBlock="html_block"===a,o.escapeHtml=n.escapeHtml,o.skipHtml=n.skipHtml;break;case"code_block":var s=e.info?e.info.split(/ +/):[];s.length>0&&s[0].length>0&&(o.language=s[0],o.codeinfo=s);break;case"code":o.children=e.literal,o.inline=!0;break;case"heading":o.level=e.level;break;case"softbreak":o.softBreak=n.softBreak;break;case"link":o.href=n.transformLinkUri?n.transformLinkUri(e.destination):e.destination,o.title=e.title||void 0,n.linkTarget&&(o.target=n.linkTarget);break;case"image":o.src=n.transformImageUri?n.transformImageUri(e.destination):e.destination,o.title=e.title||void 0,o.alt=e.react.children.join(""),e.react.children=void 0;break;case"list":o.start=e.listStart,o.type=e.listType,o.tight=e.listTight}"string"!=typeof r&&(o.literal=e.literal);var u=o.children||e.react&&e.react.children;return Array.isArray(u)&&(o.children=u.reduce(c,[])||null),o}function h(e){return e?e.sourcepos?p(e.sourcepos):h(e.parent):null}function d(e){for(var t,n,r,o,a,l,c,p,d,m=e.walker(),v={sourcePos:this.sourcePos,escapeHtml:this.escapeHtml,skipHtml:this.skipHtml,transformLinkUri:this.transformLinkUri,transformImageUri:this.transformImageUri,softBreak:this.softBreak,linkTarget:this.linkTarget},_=0;t=m.next();){var b=h(t.node.sourcepos?t.node:t.node.parent);if(d===b?(c=b+_,_++):(c=b,_=0),d=b,r=t.entering,o=!r,n=t.node,a=i(n.type),p=null,l){if(n!==l&&!("paragraph"===a&&s(n)||this.skipHtml&&("html_block"===a||"html_inline"===a))){var w=n===l,k=-1===this.allowedTypes.indexOf(a),E=!1,S=n.isContainer&&o,C=this.renderers[a];if(this.allowNode&&(S||!n.isContainer)){var A=S?n.react.children:[];p=f(n,c,v,C),E=!this.allowNode({type:x(a),renderer:this.renderers[a],props:p,children:A})}if(w||!E&&!k){var D="text"===a||"softbreak"===a;if("function"!=typeof C&&!D&&"string"!=typeof C)throw new Error("Renderer for type `"+x(n.type)+"` not defined or is not renderable");if(n.isContainer&&r)n.react={component:C,props:{},children:[]};else{var O=p||f(n,c,v,C);if(C)O="string"==typeof C?O:y(O,{nodeKey:O.key}),u(n,g.createElement(C,O));else if("text"===a)u(n,n.literal);else if("softbreak"===a){var M="br"===this.softBreak?g.createElement("br",{key:c}):this.softBreak;u(n,M)}}}else!this.unwrapDisallowed&&r&&n.isContainer&&m.resumeAt(n,!1)}}else l=n,n.react={children:[]}}return l.react.children}function m(e){var t=e.replace(/file:\/\//g,"x-file://");return decodeURI(b.uriInDoubleQuotedAttr(t))}function v(e){var t=e||{};if(t.allowedTypes&&t.disallowedTypes)throw new Error("Only one of `allowedTypes` and `disallowedTypes` should be defined");if(t.allowedTypes&&!Array.isArray(t.allowedTypes))throw new Error("`allowedTypes` must be an array");if(t.disallowedTypes&&!Array.isArray(t.disallowedTypes))throw new Error("`disallowedTypes` must be an array");if(t.allowNode&&"function"!=typeof t.allowNode)throw new Error("`allowNode` must be a function");var n=t.transformLinkUri;if(void 0===n)n=m;else if(n&&"function"!=typeof n)throw new Error("`transformLinkUri` must either be a function, or `null` to disable");var r=t.transformImageUri;if(void 0!==r&&"function"!=typeof r)throw new Error("`transformImageUri` must be a function");if(t.renderers&&!_(t.renderers))throw new Error("`renderers` must be a plain object of `Type`: `Renderer` pairs");var a=t.allowedTypes&&t.allowedTypes.map(i)||E;if(t.disallowedTypes){var s=t.disallowedTypes.map(i);a=a.filter(function(e){return-1===s.indexOf(e)})}return{sourcePos:Boolean(t.sourcePos),softBreak:t.softBreak||"\n",renderers:y({},k,o(t.renderers)),escapeHtml:Boolean(t.escapeHtml),skipHtml:Boolean(t.skipHtml),transformLinkUri:n,transformImageUri:r,allowNode:t.allowNode,allowedTypes:a,unwrapDisallowed:Boolean(t.unwrapDisallowed),render:d,linkTarget:t.linkTarget||!1}}var g=n(0),y=n(823),_=n(826),b=n(1199),x=n(979),w={blockquote:"block_quote",thematicbreak:"thematic_break",htmlblock:"html_block",htmlinline:"html_inline",codeblock:"code_block",hardbreak:"linebreak"},k={block_quote:"blockquote",emph:"em",linebreak:"br",image:"img",item:"li",link:"a",paragraph:"p",strong:"strong",thematic_break:"hr",html_block:a,html_inline:a,list:function(e){var t="bullet"===e.type.toLowerCase()?"ul":"ol",n=r(e);return null!==e.start&&1!==e.start&&(n.start=e.start.toString()),l(t,n,e.children)},code_block:function(e){var t=e.language&&"language-"+e.language,n=l("code",{className:t},e.literal);return l("pre",r(e),n)},code:function(e){return l("code",r(e),e.children)},heading:function(e){return l("h"+e.level,r(e),e.children)},text:null,softbreak:null},E=Object.keys(k);v.uriTransformer=m,v.types=E.map(x),v.renderers=E.reduce(function(e,t){return e[x(t)]=k[t],e},{}),e.exports=v},function(e,t,n){"use strict";function r(e){return{doc:new B,blocks:M,blockStarts:T,tip:this.doc,oldtip:this.doc,currentLine:"",lineNumber:0,offset:0,column:0,nextNonspace:0,nextNonspaceColumn:0,indent:0,indented:!1,blank:!1,partiallyConsumedTab:!1,allClosed:!0,lastMatchedContainer:this.doc,refmap:{},lastLineLength:0,inlineParser:new u(e),findNextNonspace:R,advanceOffset:P,advanceNextNonspace:I,addLine:S,addChild:C,incorporateLine:j,finalize:F,processInlines:N,closeUnmatchedBlocks:O,parse:L,options:e||{}}}var i=n(174),o=n(73).unescapeString,a=n(73).OPENTAG,s=n(73).CLOSETAG,u=n(578),l=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^<!--/,/^<[?]/,/^<![A-Z]/,/^<!\[CDATA\[/,/^<[\/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[\/]?[>]|$)/i,new RegExp("^(?:"+a+"|"+s+")\\s*$","i")],c=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],p=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/,f=/^[#`~*+_=<>0-9-]/,h=/[^ \t\f\v\r\n]/,d=/^[*+-]/,m=/^(\d{1,9})([.)])/,v=/^#{1,6}(?:[ \t]+|$)/,g=/^`{3,}(?!.*`)|^~{3,}(?!.*~)/,y=/^(?:`{3,}|~{3,})(?= *$)/,_=/^(?:=+|-+)[ \t]*$/,b=/\r\n|\n|\r/,x=function(e){return!h.test(e)},w=function(e){return 32===e||9===e},k=function(e,t){return t<e.length?e.charCodeAt(t):-1},E=function(e){for(;e;){if(e._lastLineBlank)return!0;var t=e.type;if("list"!==t&&"item"!==t)break;e=e._lastChild}return!1},S=function(){if(this.partiallyConsumedTab){this.offset+=1;var e=4-this.column%4;this.tip._string_content+=" ".repeat(e)}this.tip._string_content+=this.currentLine.slice(this.offset)+"\n"},C=function(e,t){for(;!this.blocks[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=new i(e,[[this.lineNumber,n],[0,0]]);return r._string_content="",this.tip.appendChild(r),this.tip=r,r},A=function(e,t){var n,r,i,o,a=e.currentLine.slice(e.nextNonspace),s={type:null,tight:!0,bulletChar:null,start:null,delimiter:null,padding:null,markerOffset:e.indent};if(n=a.match(d))s.type="bullet",s.bulletChar=n[0][0];else{if(!(n=a.match(m))||"paragraph"===t.type&&"1"!==n[1])return null;s.type="ordered",s.start=parseInt(n[1]),s.delimiter=n[2]}if(-1!==(r=k(e.currentLine,e.nextNonspace+n[0].length))&&9!==r&&32!==r)return null;if("paragraph"===t.type&&!e.currentLine.slice(e.nextNonspace+n[0].length).match(h))return null;e.advanceNextNonspace(),e.advanceOffset(n[0].length,!0),i=e.column,o=e.offset;do{e.advanceOffset(1,!0),r=k(e.currentLine,e.offset)}while(e.column-i<5&&w(r));var u=-1===k(e.currentLine,e.offset),l=e.column-i;return l>=5||l<1||u?(s.padding=n[0].length+1,e.column=i,e.offset=o,w(k(e.currentLine,e.offset))&&e.advanceOffset(1,!0)):s.padding=n[0].length+l,s},D=function(e,t){return e.type===t.type&&e.delimiter===t.delimiter&&e.bulletChar===t.bulletChar},O=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var e=this.oldtip._parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=e}this.allClosed=!0}},M={document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},list:{continue:function(){return 0},finalize:function(e,t){for(var n=t._firstChild;n;){if(E(n)&&n._next){t._listData.tight=!1;break}for(var r=n._firstChild;r;){if(E(r)&&(n._next||r._next)){t._listData.tight=!1;break}r=r._next}n=n._next}},canContain:function(e){return"item"===e},acceptsLines:!1},block_quote:{continue:function(e){var t=e.currentLine;return e.indented||62!==k(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),w(k(t,e.offset))&&e.advanceOffset(1,!0),0)},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},item:{continue:function(e,t){if(e.blank){if(null==t._firstChild)return 1;e.advanceNextNonspace()}else{if(!(e.indent>=t._listData.markerOffset+t._listData.padding))return 1;e.advanceOffset(t._listData.markerOffset+t._listData.padding,!0)}return 0},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},heading:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},thematic_break:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},code_block:{continue:function(e,t){var n=e.currentLine,r=e.indent;if(t._isFenced){var i=r<=3&&n.charAt(e.nextNonspace)===t._fenceChar&&n.slice(e.nextNonspace).match(y);if(i&&i[0].length>=t._fenceLength)return e.finalize(t,e.lineNumber),2;for(var o=t._fenceOffset;o>0&&w(k(n,e.offset));)e.advanceOffset(1,!0),o--}else if(r>=4)e.advanceOffset(4,!0);else{if(!e.blank)return 1;e.advanceNextNonspace()}return 0},finalize:function(e,t){if(t._isFenced){var n=t._string_content,r=n.indexOf("\n"),i=n.slice(0,r),a=n.slice(r+1);t.info=o(i.trim()),t._literal=a}else t._literal=t._string_content.replace(/(\n *)+$/,"\n");t._string_content=null},canContain:function(){return!1},acceptsLines:!0},html_block:{continue:function(e,t){return!e.blank||6!==t._htmlBlockType&&7!==t._htmlBlockType?0:1},finalize:function(e,t){t._literal=t._string_content.replace(/(\n *)+$/,""),t._string_content=null},canContain:function(){return!1},acceptsLines:!0},paragraph:{continue:function(e){return e.blank?1:0},finalize:function(e,t){for(var n,r=!1;91===k(t._string_content,0)&&(n=e.inlineParser.parseReference(t._string_content,e.refmap));)t._string_content=t._string_content.slice(n),r=!0;r&&x(t._string_content)&&t.unlink()},canContain:function(){return!1},acceptsLines:!0}},T=[function(e){return e.indented||62!==k(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),w(k(e.currentLine,e.offset))&&e.advanceOffset(1,!0),e.closeUnmatchedBlocks(),e.addChild("block_quote",e.nextNonspace),1)},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(v))){e.advanceNextNonspace(),e.advanceOffset(t[0].length,!1),e.closeUnmatchedBlocks();var n=e.addChild("heading",e.nextNonspace);return n.level=t[0].trim().length,n._string_content=e.currentLine.slice(e.offset).replace(/^[ \t]*#+[ \t]*$/,"").replace(/[ \t]+#+[ \t]*$/,""),e.advanceOffset(e.currentLine.length-e.offset),2}return 0},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(g))){var n=t[0].length;e.closeUnmatchedBlocks();var r=e.addChild("code_block",e.nextNonspace);return r._isFenced=!0,r._fenceLength=n,r._fenceChar=t[0][0],r._fenceOffset=e.indent,e.advanceNextNonspace(),e.advanceOffset(n,!1),2}return 0},function(e,t){if(!e.indented&&60===k(e.currentLine,e.nextNonspace)){var n,r=e.currentLine.slice(e.nextNonspace);for(n=1;n<=7;n++)if(l[n].test(r)&&(n<7||"paragraph"!==t.type)){e.closeUnmatchedBlocks();var i=e.addChild("html_block",e.offset);return i._htmlBlockType=n,2}}return 0},function(e,t){var n;if(!e.indented&&"paragraph"===t.type&&(n=e.currentLine.slice(e.nextNonspace).match(_))){e.closeUnmatchedBlocks();var r=new i("heading",t.sourcepos);return r.level="="===n[0][0]?1:2,r._string_content=t._string_content,t.insertAfter(r),t.unlink(),e.tip=r,e.advanceOffset(e.currentLine.length-e.offset,!1),2}return 0},function(e){return!e.indented&&p.test(e.currentLine.slice(e.nextNonspace))?(e.closeUnmatchedBlocks(),e.addChild("thematic_break",e.nextNonspace),e.advanceOffset(e.currentLine.length-e.offset,!1),2):0},function(e,t){var n;return e.indented&&"list"!==t.type||!(n=A(e,t))?0:(e.closeUnmatchedBlocks(),"list"===e.tip.type&&D(t._listData,n)||(t=e.addChild("list",e.nextNonspace),t._listData=n),t=e.addChild("item",e.nextNonspace),t._listData=n,1)},function(e){return e.indented&&"paragraph"!==e.tip.type&&!e.blank?(e.advanceOffset(4,!0),e.closeUnmatchedBlocks(),e.addChild("code_block",e.offset),2):0}],P=function(e,t){for(var n,r,i,o=this.currentLine;e>0&&(i=o[this.offset]);)"\t"===i?(n=4-this.column%4,t?(this.partiallyConsumedTab=n>e,r=n>e?e:n,this.column+=r,this.offset+=this.partiallyConsumedTab?0:1,e-=r):(this.partiallyConsumedTab=!1,this.column+=n,this.offset+=1,e-=1)):(this.partiallyConsumedTab=!1,this.offset+=1,this.column+=1,e-=1)},I=function(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn,this.partiallyConsumedTab=!1},R=function(){for(var e,t=this.currentLine,n=this.offset,r=this.column;""!==(e=t.charAt(n));)if(" "===e)n++,r++;else{if("\t"!==e)break;n++,r+=4-r%4}this.blank="\n"===e||"\r"===e||""===e,this.nextNonspace=n,this.nextNonspaceColumn=r,this.indent=this.nextNonspaceColumn-this.column,this.indented=this.indent>=4},j=function(e){var t,n=!0,r=this.doc;this.oldtip=this.tip,this.offset=0,this.column=0,this.blank=!1,this.partiallyConsumedTab=!1,this.lineNumber+=1,-1!==e.indexOf("\0")&&(e=e.replace(/\0/g,"�")),this.currentLine=e;for(var i;(i=r._lastChild)&&i._open;){switch(r=i,this.findNextNonspace(),this.blocks[r.type].continue(this,r)){case 0:break;case 1:n=!1;break;case 2:return void(this.lastLineLength=e.length);default:throw"continue returned illegal value, must be 0, 1, or 2"}if(!n){r=r._parent;break}}this.allClosed=r===this.oldtip,this.lastMatchedContainer=r;for(var o="paragraph"!==r.type&&M[r.type].acceptsLines,a=this.blockStarts,s=a.length;!o;){if(this.findNextNonspace(),!this.indented&&!f.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var u=0;u<s;){var l=a[u](this,r);if(1===l){r=this.tip;break}if(2===l){r=this.tip,o=!0;break}u++}if(u===s){this.advanceNextNonspace();break}}if(this.allClosed||this.blank||"paragraph"!==this.tip.type){this.closeUnmatchedBlocks(),this.blank&&r.lastChild&&(r.lastChild._lastLineBlank=!0),t=r.type;for(var p=this.blank&&!("block_quote"===t||"code_block"===t&&r._isFenced||"item"===t&&!r._firstChild&&r.sourcepos[0][0]===this.lineNumber),h=r;h;)h._lastLineBlank=p,h=h._parent;this.blocks[t].acceptsLines?(this.addLine(),"html_block"===t&&r._htmlBlockType>=1&&r._htmlBlockType<=5&&c[r._htmlBlockType].test(this.currentLine.slice(this.offset))&&this.finalize(r,this.lineNumber)):this.offset<e.length&&!this.blank&&(r=this.addChild("paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}else this.addLine();this.lastLineLength=e.length},F=function(e,t){var n=e._parent;e._open=!1,e.sourcepos[1]=[t,this.lastLineLength],this.blocks[e.type].finalize(this,e),this.tip=n},N=function(e){var t,n,r,i=e.walker();for(this.inlineParser.refmap=this.refmap,this.inlineParser.options=this.options;n=i.next();)t=n.node,r=t.type,n.entering||"paragraph"!==r&&"heading"!==r||this.inlineParser.parse(t)},B=function(){return new i("document",[[1,1],[0,0]])},L=function(e){this.doc=new B,this.tip=this.doc,this.refmap={},this.lineNumber=0,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="",this.options.time&&console.time("preparing input");var t=e.split(b),n=t.length;10===e.charCodeAt(e.length-1)&&(n-=1),this.options.time&&console.timeEnd("preparing input"),this.options.time&&console.time("block parsing");for(var r=0;r<n;r++)this.incorporateLine(t[r]);for(;this.tip;)this.finalize(this.tip,n);return this.options.time&&console.timeEnd("block parsing"),this.options.time&&console.time("inline parsing"),this.processInlines(this.doc),this.options.time&&console.timeEnd("inline parsing"),this.doc};e.exports=r},function(e,t,n){"use strict";/*! http://mths.be/fromcodepoint v0.2.1 by @mathias */ -if(String.fromCodePoint)e.exports=function(e){try{return String.fromCodePoint(e)}catch(e){if(e instanceof RangeError)return String.fromCharCode(65533);throw e}};else{var r=String.fromCharCode,i=Math.floor,o=function(){var e,t,n=[],o=-1,a=arguments.length;if(!a)return"";for(var s="";++o<a;){var u=Number(arguments[o]);if(!isFinite(u)||u<0||u>1114111||i(u)!==u)return String.fromCharCode(65533);u<=65535?n.push(u):(u-=65536,e=55296+(u>>10),t=u%1024+56320,n.push(e,t)),(o+1===a||n.length>16384)&&(s+=r.apply(null,n),n.length=0)}return s};e.exports=o}},function(e,t,n){"use strict";e.exports.Node=n(174),e.exports.Parser=n(575),e.exports.HtmlRenderer=n(580),e.exports.XmlRenderer=n(581)},function(e,t,n){"use strict";function r(e){return{subject:"",delimiters:null,brackets:null,pos:0,refmap:{},match:F,peek:N,spnl:B,parseBackticks:L,parseBackslash:q,parseAutolink:z,parseHtmlTag:U,scanDelims:W,handleDelim:V,parseLinkTitle:K,parseLinkDestination:X,parseLinkLabel:Y,parseOpenBracket:$,parseBang:Z,parseCloseBracket:Q,addBracket:ee,removeBracket:te,parseEntity:ne,parseString:re,parseNewline:ie,parseReference:oe,parseInline:ae,processEmphasis:J,removeDelimiter:H,options:e||{},parse:se}}var i=n(174),o=n(73),a=n(579),s=o.normalizeURI,u=o.unescapeString,l=n(576),c=n(114).decodeHTML;n(494);var p=o.ESCAPABLE,f="\\\\"+p,h=o.ENTITY,d=o.reHtmlTag,m=new RegExp(/[!"#$%&'()*+,\-.\/:;<=>?@\[\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/),v=new RegExp('^(?:"('+f+'|[^"\\x00])*"|\'('+f+"|[^'\\x00])*'|\\(("+f+"|[^)\\x00])*\\))"),g=new RegExp("^(?:[<](?:[^ <>\\t\\n\\\\\\x00]|"+f+"|\\\\)*[>])"),y=new RegExp("^"+p),_=new RegExp("^"+h,"i"),b=/`+/,x=/^`+/,w=/\.\.\./g,k=/--+/g,E=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,S=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,C=/^ *(?:\n *)?/,A=/^[ \t\n\x0b\x0c\x0d]/,D=/[ \t\n\x0b\x0c\x0d]+/g,O=/^\s/,M=/ *$/,T=/^ */,P=/^ *(?:\n|$)/,I=new RegExp("^\\[(?:[^\\\\\\[\\]]|"+f+"|\\\\){0,1000}\\]"),R=/^[^\n`\[\]\\!<&*_'"]+/m,j=function(e){var t=new i("text");return t._literal=e,t},F=function(e){var t=e.exec(this.subject.slice(this.pos));return null===t?null:(this.pos+=t.index+t[0].length,t[0])},N=function(){return this.pos<this.subject.length?this.subject.charCodeAt(this.pos):-1},B=function(){return this.match(C),!0},L=function(e){var t=this.match(x);if(null===t)return!1;for(var n,r,o=this.pos;null!==(n=this.match(b));)if(n===t)return r=new i("code"),r._literal=this.subject.slice(o,this.pos-t.length).trim().replace(D," "),e.appendChild(r),!0;return this.pos=o,e.appendChild(j(t)),!0},q=function(e){var t,n=this.subject;return this.pos+=1,10===this.peek()?(this.pos+=1,t=new i("linebreak"),e.appendChild(t)):y.test(n.charAt(this.pos))?(e.appendChild(j(n.charAt(this.pos))),this.pos+=1):e.appendChild(j("\\")),!0},z=function(e){var t,n,r;return(t=this.match(E))?(n=t.slice(1,t.length-1),r=new i("link"),r._destination=s("mailto:"+n),r._title="",r.appendChild(j(n)),e.appendChild(r),!0):!!(t=this.match(S))&&(n=t.slice(1,t.length-1),r=new i("link"),r._destination=s(n),r._title="",r.appendChild(j(n)),e.appendChild(r),!0)},U=function(e){var t=this.match(d);if(null===t)return!1;var n=new i("html_inline");return n._literal=t,e.appendChild(n),!0},W=function(e){var t,n,r,i,o,a,s,u,c,p,f,h=0,d=this.pos;if(39===e||34===e)h++,this.pos++;else for(;this.peek()===e;)h++,this.pos++;return 0===h?null:(t=0===d?"\n":this.subject.charAt(d-1),r=this.peek(),n=-1===r?"\n":l(r),u=O.test(n),c=m.test(n),p=O.test(t),f=m.test(t),i=!u&&(!c||p||f),o=!p&&(!f||u||c),95===e?(a=i&&(!o||f),s=o&&(!i||c)):39===e||34===e?(a=i&&!o,s=o):(a=i,s=o),this.pos=d,{numdelims:h,can_open:a,can_close:s})},V=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var r,i=n.numdelims,o=this.pos;this.pos+=i,r=39===e?"’":34===e?"“":this.subject.slice(o,this.pos);var a=j(r);return t.appendChild(a),this.delimiters={cc:e,numdelims:i,origdelims:i,node:a,previous:this.delimiters,next:null,can_open:n.can_open,can_close:n.can_close},null!==this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters),!0},H=function(e){null!==e.previous&&(e.previous.next=e.next),null===e.next?this.delimiters=e.previous:e.next.previous=e.previous},G=function(e,t){e.next!==t&&(e.next=t,t.previous=e)},J=function(e){var t,n,r,o,a,s,u,l,c,p,f=[],h=!1;for(f[95]=e,f[42]=e,f[39]=e,f[34]=e,n=this.delimiters;null!==n&&n.previous!==e;)n=n.previous;for(;null!==n;){var d=n.cc;if(n.can_close){for(t=n.previous,p=!1;null!==t&&t!==e&&t!==f[d];){if(h=(n.can_open||t.can_close)&&(t.origdelims+n.origdelims)%3==0,t.cc===n.cc&&t.can_open&&!h){p=!0;break}t=t.previous}if(r=n,42===d||95===d)if(p){u=n.numdelims>=2&&t.numdelims>=2?2:1,o=t.node,a=n.node,t.numdelims-=u,n.numdelims-=u,o._literal=o._literal.slice(0,o._literal.length-u),a._literal=a._literal.slice(0,a._literal.length-u);var m=new i(1===u?"emph":"strong");for(l=o._next;l&&l!==a;)c=l._next,l.unlink(),m.appendChild(l),l=c;o.insertAfter(m),G(t,n),0===t.numdelims&&(o.unlink(),this.removeDelimiter(t)),0===n.numdelims&&(a.unlink(),s=n.next,this.removeDelimiter(n),n=s)}else n=n.next;else 39===d?(n.node._literal="’",p&&(t.node._literal="‘"),n=n.next):34===d&&(n.node._literal="”",p&&(t.node.literal="“"),n=n.next);p||h||(f[d]=r.previous,r.can_open||this.removeDelimiter(r))}else n=n.next}for(;null!==this.delimiters&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},K=function(){var e=this.match(v);return null===e?null:u(e.substr(1,e.length-2))},X=function(){var e=this.match(g);if(null===e){for(var t,n=this.pos,r=0;-1!==(t=this.peek());)if(92===t)this.pos+=1,-1!==this.peek()&&(this.pos+=1);else if(40===t)this.pos+=1,r+=1;else if(41===t){if(r<1)break;this.pos+=1,r-=1}else{if(null!==A.exec(l(t)))break;this.pos+=1}return e=this.subject.substr(n,this.pos-n),s(u(e))}return s(u(e.substr(1,e.length-2)))},Y=function(){var e=this.match(I);return null===e||e.length>1001||/[^\\]\\\]$/.exec(e)?0:e.length},$=function(e){var t=this.pos;this.pos+=1;var n=j("[");return e.appendChild(n),this.addBracket(n,t,!1),!0},Z=function(e){var t=this.pos;if(this.pos+=1,91===this.peek()){this.pos+=1;var n=j("![");e.appendChild(n),this.addBracket(n,t+1,!0)}else e.appendChild(j("!"));return!0},Q=function(e){var t,n,r,o,s,u,l=!1;if(this.pos+=1,t=this.pos,null===(u=this.brackets))return e.appendChild(j("]")),!0;if(!u.active)return e.appendChild(j("]")),this.removeBracket(),!0;n=u.image;var c=this.pos;if(40===this.peek()&&(this.pos++,this.spnl()&&null!==(r=this.parseLinkDestination())&&this.spnl()&&(A.test(this.subject.charAt(this.pos-1))&&(o=this.parseLinkTitle()),!0)&&this.spnl()&&41===this.peek()?(this.pos+=1,l=!0):this.pos=c),!l){var p=this.pos,f=this.parseLinkLabel();if(f>2?s=this.subject.slice(p,p+f):u.bracketAfter||(s=this.subject.slice(u.index,t)),0===f&&(this.pos=c),s){var h=this.refmap[a(s)];h&&(r=h.destination,o=h.title,l=!0)}}if(l){var d=new i(n?"image":"link");d._destination=r,d._title=o||"";var m,v;for(m=u.node._next;m;)v=m._next,m.unlink(),d.appendChild(m),m=v;if(e.appendChild(d),this.processEmphasis(u.previousDelimiter),this.removeBracket(),u.node.unlink(),!n)for(u=this.brackets;null!==u;)u.image||(u.active=!1),u=u.previous;return!0}return this.removeBracket(),this.pos=t,e.appendChild(j("]")),!0},ee=function(e,t,n){null!==this.brackets&&(this.brackets.bracketAfter=!0),this.brackets={node:e,previous:this.brackets,previousDelimiter:this.delimiters,index:t,image:n,active:!0}},te=function(){this.brackets=this.brackets.previous},ne=function(e){var t;return!!(t=this.match(_))&&(e.appendChild(j(c(t))),!0)},re=function(e){var t;return!!(t=this.match(R))&&(this.options.smart?e.appendChild(j(t.replace(w,"…").replace(k,function(e){var t=0,n=0;return e.length%3==0?n=e.length/3:e.length%2==0?t=e.length/2:e.length%3==2?(t=1,n=(e.length-2)/3):(t=2,n=(e.length-4)/3),"—".repeat(n)+"–".repeat(t)}))):e.appendChild(j(t)),!0)},ie=function(e){this.pos+=1;var t=e._lastChild;if(t&&"text"===t.type&&" "===t._literal[t._literal.length-1]){var n=" "===t._literal[t._literal.length-2];t._literal=t._literal.replace(M,""),e.appendChild(new i(n?"linebreak":"softbreak"))}else e.appendChild(new i("softbreak"));return this.match(T),!0},oe=function(e,t){this.subject=e,this.pos=0;var n,r,i,o,s=this.pos;if(0===(o=this.parseLinkLabel()))return 0;if(n=this.subject.substr(0,o),58!==this.peek())return this.pos=s,0;if(this.pos++,this.spnl(),null===(r=this.parseLinkDestination())||0===r.length)return this.pos=s,0;var u=this.pos;this.spnl(),null===(i=this.parseLinkTitle())&&(i="",this.pos=u);var l=!0;if(null===this.match(P)&&(""===i?l=!1:(i="",this.pos=u,l=null!==this.match(P))),!l)return this.pos=s,0;var c=a(n);return""===c?(this.pos=s,0):(t[c]||(t[c]={destination:r,title:i}),this.pos-s)},ae=function(e){var t=!1,n=this.peek();if(-1===n)return!1;switch(n){case 10:t=this.parseNewline(e);break;case 92:t=this.parseBackslash(e);break;case 96:t=this.parseBackticks(e);break;case 42:case 95:t=this.handleDelim(n,e);break;case 39:case 34:t=this.options.smart&&this.handleDelim(n,e);break;case 91:t=this.parseOpenBracket(e);break;case 33:t=this.parseBang(e);break;case 93:t=this.parseCloseBracket(e);break;case 60:t=this.parseAutolink(e)||this.parseHtmlTag(e);break;case 38:t=this.parseEntity(e);break;default:t=this.parseString(e)}return t||(this.pos+=1,e.appendChild(j(l(n)))),!0},se=function(e){for(this.subject=e._string_content.trim(),this.pos=0,this.delimiters=null,this.brackets=null;this.parseInline(e););e._string_content=null,this.processEmphasis(null)};e.exports=r},function(e,t,n){"use strict";var r=/[ \t\r\n]+|[A-Z\xB5\xC0-\xD6\xD8-\xDF\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u0149\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u017F\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C5\u01C7\u01C8\u01CA\u01CB\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F0-\u01F2\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0345\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03AB\u03B0\u03C2\u03CF-\u03D1\u03D5\u03D6\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F0\u03F1\u03F4\u03F5\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u0587\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E96-\u1E9B\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F50\u1F52\u1F54\u1F56\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1F80-\u1FAF\u1FB2-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD2\u1FD3\u1FD6-\u1FDB\u1FE2-\u1FE4\u1FE6-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A\u212B\u2132\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0\uA7B1\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27]|\uD806[\uDCA0-\uDCBF]/g,i={A:"a",B:"b",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",J:"j",K:"k",L:"l",M:"m",N:"n",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",U:"u",V:"v",W:"w",X:"x",Y:"y",Z:"z","µ":"μ","À":"à","Á":"á","Â":"â","Ã":"ã","Ä":"ä","Å":"å","Æ":"æ","Ç":"ç","È":"è","É":"é","Ê":"ê","Ë":"ë","Ì":"ì","Í":"í","Î":"î","Ï":"ï","Ð":"ð","Ñ":"ñ","Ò":"ò","Ó":"ó","Ô":"ô","Õ":"õ","Ö":"ö","Ø":"ø","Ù":"ù","Ú":"ú","Û":"û","Ü":"ü","Ý":"ý","Þ":"þ","Ā":"ā","Ă":"ă","Ą":"ą","Ć":"ć","Ĉ":"ĉ","Ċ":"ċ","Č":"č","Ď":"ď","Đ":"đ","Ē":"ē","Ĕ":"ĕ","Ė":"ė","Ę":"ę","Ě":"ě","Ĝ":"ĝ","Ğ":"ğ","Ġ":"ġ","Ģ":"ģ","Ĥ":"ĥ","Ħ":"ħ","Ĩ":"ĩ","Ī":"ī","Ĭ":"ĭ","Į":"į","IJ":"ij","Ĵ":"ĵ","Ķ":"ķ","Ĺ":"ĺ","Ļ":"ļ","Ľ":"ľ","Ŀ":"ŀ","Ł":"ł","Ń":"ń","Ņ":"ņ","Ň":"ň","Ŋ":"ŋ","Ō":"ō","Ŏ":"ŏ","Ő":"ő","Œ":"œ","Ŕ":"ŕ","Ŗ":"ŗ","Ř":"ř","Ś":"ś","Ŝ":"ŝ","Ş":"ş","Š":"š","Ţ":"ţ","Ť":"ť","Ŧ":"ŧ","Ũ":"ũ","Ū":"ū","Ŭ":"ŭ","Ů":"ů","Ű":"ű","Ų":"ų","Ŵ":"ŵ","Ŷ":"ŷ","Ÿ":"ÿ","Ź":"ź","Ż":"ż","Ž":"ž","ſ":"s","Ɓ":"ɓ","Ƃ":"ƃ","Ƅ":"ƅ","Ɔ":"ɔ","Ƈ":"ƈ","Ɖ":"ɖ","Ɗ":"ɗ","Ƌ":"ƌ","Ǝ":"ǝ","Ə":"ə","Ɛ":"ɛ","Ƒ":"ƒ","Ɠ":"ɠ","Ɣ":"ɣ","Ɩ":"ɩ","Ɨ":"ɨ","Ƙ":"ƙ","Ɯ":"ɯ","Ɲ":"ɲ","Ɵ":"ɵ","Ơ":"ơ","Ƣ":"ƣ","Ƥ":"ƥ","Ʀ":"ʀ","Ƨ":"ƨ","Ʃ":"ʃ","Ƭ":"ƭ","Ʈ":"ʈ","Ư":"ư","Ʊ":"ʊ","Ʋ":"ʋ","Ƴ":"ƴ","Ƶ":"ƶ","Ʒ":"ʒ","Ƹ":"ƹ","Ƽ":"ƽ","DŽ":"dž","Dž":"dž","LJ":"lj","Lj":"lj","NJ":"nj","Nj":"nj","Ǎ":"ǎ","Ǐ":"ǐ","Ǒ":"ǒ","Ǔ":"ǔ","Ǖ":"ǖ","Ǘ":"ǘ","Ǚ":"ǚ","Ǜ":"ǜ","Ǟ":"ǟ","Ǡ":"ǡ","Ǣ":"ǣ","Ǥ":"ǥ","Ǧ":"ǧ","Ǩ":"ǩ","Ǫ":"ǫ","Ǭ":"ǭ","Ǯ":"ǯ","DZ":"dz","Dz":"dz","Ǵ":"ǵ","Ƕ":"ƕ","Ƿ":"ƿ","Ǹ":"ǹ","Ǻ":"ǻ","Ǽ":"ǽ","Ǿ":"ǿ","Ȁ":"ȁ","Ȃ":"ȃ","Ȅ":"ȅ","Ȇ":"ȇ","Ȉ":"ȉ","Ȋ":"ȋ","Ȍ":"ȍ","Ȏ":"ȏ","Ȑ":"ȑ","Ȓ":"ȓ","Ȕ":"ȕ","Ȗ":"ȗ","Ș":"ș","Ț":"ț","Ȝ":"ȝ","Ȟ":"ȟ","Ƞ":"ƞ","Ȣ":"ȣ","Ȥ":"ȥ","Ȧ":"ȧ","Ȩ":"ȩ","Ȫ":"ȫ","Ȭ":"ȭ","Ȯ":"ȯ","Ȱ":"ȱ","Ȳ":"ȳ","Ⱥ":"ⱥ","Ȼ":"ȼ","Ƚ":"ƚ","Ⱦ":"ⱦ","Ɂ":"ɂ","Ƀ":"ƀ","Ʉ":"ʉ","Ʌ":"ʌ","Ɇ":"ɇ","Ɉ":"ɉ","Ɋ":"ɋ","Ɍ":"ɍ","Ɏ":"ɏ","ͅ":"ι","Ͱ":"ͱ","Ͳ":"ͳ","Ͷ":"ͷ","Ϳ":"ϳ","Ά":"ά","Έ":"έ","Ή":"ή","Ί":"ί","Ό":"ό","Ύ":"ύ","Ώ":"ώ","Α":"α","Β":"β","Γ":"γ","Δ":"δ","Ε":"ε","Ζ":"ζ","Η":"η","Θ":"θ","Ι":"ι","Κ":"κ","Λ":"λ","Μ":"μ","Ν":"ν","Ξ":"ξ","Ο":"ο","Π":"π","Ρ":"ρ","Σ":"σ","Τ":"τ","Υ":"υ","Φ":"φ","Χ":"χ","Ψ":"ψ","Ω":"ω","Ϊ":"ϊ","Ϋ":"ϋ","ς":"σ","Ϗ":"ϗ","ϐ":"β","ϑ":"θ","ϕ":"φ","ϖ":"π","Ϙ":"ϙ","Ϛ":"ϛ","Ϝ":"ϝ","Ϟ":"ϟ","Ϡ":"ϡ","Ϣ":"ϣ","Ϥ":"ϥ","Ϧ":"ϧ","Ϩ":"ϩ","Ϫ":"ϫ","Ϭ":"ϭ","Ϯ":"ϯ","ϰ":"κ","ϱ":"ρ","ϴ":"θ","ϵ":"ε","Ϸ":"ϸ","Ϲ":"ϲ","Ϻ":"ϻ","Ͻ":"ͻ","Ͼ":"ͼ","Ͽ":"ͽ","Ѐ":"ѐ","Ё":"ё","Ђ":"ђ","Ѓ":"ѓ","Є":"є","Ѕ":"ѕ","І":"і","Ї":"ї","Ј":"ј","Љ":"љ","Њ":"њ","Ћ":"ћ","Ќ":"ќ","Ѝ":"ѝ","Ў":"ў","Џ":"џ","А":"а","Б":"б","В":"в","Г":"г","Д":"д","Е":"е","Ж":"ж","З":"з","И":"и","Й":"й","К":"к","Л":"л","М":"м","Н":"н","О":"о","П":"п","Р":"р","С":"с","Т":"т","У":"у","Ф":"ф","Х":"х","Ц":"ц","Ч":"ч","Ш":"ш","Щ":"щ","Ъ":"ъ","Ы":"ы","Ь":"ь","Э":"э","Ю":"ю","Я":"я","Ѡ":"ѡ","Ѣ":"ѣ","Ѥ":"ѥ","Ѧ":"ѧ","Ѩ":"ѩ","Ѫ":"ѫ","Ѭ":"ѭ","Ѯ":"ѯ","Ѱ":"ѱ","Ѳ":"ѳ","Ѵ":"ѵ","Ѷ":"ѷ","Ѹ":"ѹ","Ѻ":"ѻ","Ѽ":"ѽ","Ѿ":"ѿ","Ҁ":"ҁ","Ҋ":"ҋ","Ҍ":"ҍ","Ҏ":"ҏ","Ґ":"ґ","Ғ":"ғ","Ҕ":"ҕ","Җ":"җ","Ҙ":"ҙ","Қ":"қ","Ҝ":"ҝ","Ҟ":"ҟ","Ҡ":"ҡ","Ң":"ң","Ҥ":"ҥ","Ҧ":"ҧ","Ҩ":"ҩ","Ҫ":"ҫ","Ҭ":"ҭ","Ү":"ү","Ұ":"ұ","Ҳ":"ҳ","Ҵ":"ҵ","Ҷ":"ҷ","Ҹ":"ҹ","Һ":"һ","Ҽ":"ҽ","Ҿ":"ҿ","Ӏ":"ӏ","Ӂ":"ӂ","Ӄ":"ӄ","Ӆ":"ӆ","Ӈ":"ӈ","Ӊ":"ӊ","Ӌ":"ӌ","Ӎ":"ӎ","Ӑ":"ӑ","Ӓ":"ӓ","Ӕ":"ӕ","Ӗ":"ӗ","Ә":"ә","Ӛ":"ӛ","Ӝ":"ӝ","Ӟ":"ӟ","Ӡ":"ӡ","Ӣ":"ӣ","Ӥ":"ӥ","Ӧ":"ӧ","Ө":"ө","Ӫ":"ӫ","Ӭ":"ӭ","Ӯ":"ӯ","Ӱ":"ӱ","Ӳ":"ӳ","Ӵ":"ӵ","Ӷ":"ӷ","Ӹ":"ӹ","Ӻ":"ӻ","Ӽ":"ӽ","Ӿ":"ӿ","Ԁ":"ԁ","Ԃ":"ԃ","Ԅ":"ԅ","Ԇ":"ԇ","Ԉ":"ԉ","Ԋ":"ԋ","Ԍ":"ԍ","Ԏ":"ԏ","Ԑ":"ԑ","Ԓ":"ԓ","Ԕ":"ԕ","Ԗ":"ԗ","Ԙ":"ԙ","Ԛ":"ԛ","Ԝ":"ԝ","Ԟ":"ԟ","Ԡ":"ԡ","Ԣ":"ԣ","Ԥ":"ԥ","Ԧ":"ԧ","Ԩ":"ԩ","Ԫ":"ԫ","Ԭ":"ԭ","Ԯ":"ԯ","Ա":"ա","Բ":"բ","Գ":"գ","Դ":"դ","Ե":"ե","Զ":"զ","Է":"է","Ը":"ը","Թ":"թ","Ժ":"ժ","Ի":"ի","Լ":"լ","Խ":"խ","Ծ":"ծ","Կ":"կ","Հ":"հ","Ձ":"ձ","Ղ":"ղ","Ճ":"ճ","Մ":"մ","Յ":"յ","Ն":"ն","Շ":"շ","Ո":"ո","Չ":"չ","Պ":"պ","Ջ":"ջ","Ռ":"ռ","Ս":"ս","Վ":"վ","Տ":"տ","Ր":"ր","Ց":"ց","Ւ":"ւ","Փ":"փ","Ք":"ք","Օ":"օ","Ֆ":"ֆ","Ⴀ":"ⴀ","Ⴁ":"ⴁ","Ⴂ":"ⴂ","Ⴃ":"ⴃ","Ⴄ":"ⴄ","Ⴅ":"ⴅ","Ⴆ":"ⴆ","Ⴇ":"ⴇ","Ⴈ":"ⴈ","Ⴉ":"ⴉ","Ⴊ":"ⴊ","Ⴋ":"ⴋ","Ⴌ":"ⴌ","Ⴍ":"ⴍ","Ⴎ":"ⴎ","Ⴏ":"ⴏ","Ⴐ":"ⴐ","Ⴑ":"ⴑ","Ⴒ":"ⴒ","Ⴓ":"ⴓ","Ⴔ":"ⴔ","Ⴕ":"ⴕ","Ⴖ":"ⴖ","Ⴗ":"ⴗ","Ⴘ":"ⴘ","Ⴙ":"ⴙ","Ⴚ":"ⴚ","Ⴛ":"ⴛ","Ⴜ":"ⴜ","Ⴝ":"ⴝ","Ⴞ":"ⴞ","Ⴟ":"ⴟ","Ⴠ":"ⴠ","Ⴡ":"ⴡ","Ⴢ":"ⴢ","Ⴣ":"ⴣ","Ⴤ":"ⴤ","Ⴥ":"ⴥ","Ⴧ":"ⴧ","Ⴭ":"ⴭ","Ḁ":"ḁ","Ḃ":"ḃ","Ḅ":"ḅ","Ḇ":"ḇ","Ḉ":"ḉ","Ḋ":"ḋ","Ḍ":"ḍ","Ḏ":"ḏ","Ḑ":"ḑ","Ḓ":"ḓ","Ḕ":"ḕ","Ḗ":"ḗ","Ḙ":"ḙ","Ḛ":"ḛ","Ḝ":"ḝ","Ḟ":"ḟ","Ḡ":"ḡ","Ḣ":"ḣ","Ḥ":"ḥ","Ḧ":"ḧ","Ḩ":"ḩ","Ḫ":"ḫ","Ḭ":"ḭ","Ḯ":"ḯ","Ḱ":"ḱ","Ḳ":"ḳ","Ḵ":"ḵ","Ḷ":"ḷ","Ḹ":"ḹ","Ḻ":"ḻ","Ḽ":"ḽ","Ḿ":"ḿ","Ṁ":"ṁ","Ṃ":"ṃ","Ṅ":"ṅ","Ṇ":"ṇ","Ṉ":"ṉ","Ṋ":"ṋ","Ṍ":"ṍ","Ṏ":"ṏ","Ṑ":"ṑ","Ṓ":"ṓ","Ṕ":"ṕ","Ṗ":"ṗ","Ṙ":"ṙ","Ṛ":"ṛ","Ṝ":"ṝ","Ṟ":"ṟ","Ṡ":"ṡ","Ṣ":"ṣ","Ṥ":"ṥ","Ṧ":"ṧ","Ṩ":"ṩ","Ṫ":"ṫ","Ṭ":"ṭ","Ṯ":"ṯ","Ṱ":"ṱ","Ṳ":"ṳ","Ṵ":"ṵ","Ṷ":"ṷ","Ṹ":"ṹ","Ṻ":"ṻ","Ṽ":"ṽ","Ṿ":"ṿ","Ẁ":"ẁ","Ẃ":"ẃ","Ẅ":"ẅ","Ẇ":"ẇ","Ẉ":"ẉ","Ẋ":"ẋ","Ẍ":"ẍ","Ẏ":"ẏ","Ẑ":"ẑ","Ẓ":"ẓ","Ẕ":"ẕ","ẛ":"ṡ","Ạ":"ạ","Ả":"ả","Ấ":"ấ","Ầ":"ầ","Ẩ":"ẩ","Ẫ":"ẫ","Ậ":"ậ","Ắ":"ắ","Ằ":"ằ","Ẳ":"ẳ","Ẵ":"ẵ","Ặ":"ặ","Ẹ":"ẹ","Ẻ":"ẻ","Ẽ":"ẽ","Ế":"ế","Ề":"ề","Ể":"ể","Ễ":"ễ","Ệ":"ệ","Ỉ":"ỉ","Ị":"ị","Ọ":"ọ","Ỏ":"ỏ","Ố":"ố","Ồ":"ồ","Ổ":"ổ","Ỗ":"ỗ","Ộ":"ộ","Ớ":"ớ","Ờ":"ờ","Ở":"ở","Ỡ":"ỡ","Ợ":"ợ","Ụ":"ụ","Ủ":"ủ","Ứ":"ứ","Ừ":"ừ","Ử":"ử","Ữ":"ữ","Ự":"ự","Ỳ":"ỳ","Ỵ":"ỵ","Ỷ":"ỷ","Ỹ":"ỹ","Ỻ":"ỻ","Ỽ":"ỽ","Ỿ":"ỿ","Ἀ":"ἀ","Ἁ":"ἁ","Ἂ":"ἂ","Ἃ":"ἃ","Ἄ":"ἄ","Ἅ":"ἅ","Ἆ":"ἆ","Ἇ":"ἇ","Ἐ":"ἐ","Ἑ":"ἑ","Ἒ":"ἒ","Ἓ":"ἓ","Ἔ":"ἔ","Ἕ":"ἕ","Ἠ":"ἠ","Ἡ":"ἡ","Ἢ":"ἢ","Ἣ":"ἣ","Ἤ":"ἤ","Ἥ":"ἥ","Ἦ":"ἦ","Ἧ":"ἧ","Ἰ":"ἰ","Ἱ":"ἱ","Ἲ":"ἲ","Ἳ":"ἳ","Ἴ":"ἴ","Ἵ":"ἵ","Ἶ":"ἶ","Ἷ":"ἷ","Ὀ":"ὀ","Ὁ":"ὁ","Ὂ":"ὂ","Ὃ":"ὃ","Ὄ":"ὄ","Ὅ":"ὅ","Ὑ":"ὑ","Ὓ":"ὓ","Ὕ":"ὕ","Ὗ":"ὗ","Ὠ":"ὠ","Ὡ":"ὡ","Ὢ":"ὢ","Ὣ":"ὣ","Ὤ":"ὤ","Ὥ":"ὥ","Ὦ":"ὦ","Ὧ":"ὧ","Ᾰ":"ᾰ","Ᾱ":"ᾱ","Ὰ":"ὰ","Ά":"ά","ι":"ι","Ὲ":"ὲ","Έ":"έ","Ὴ":"ὴ","Ή":"ή","Ῐ":"ῐ","Ῑ":"ῑ","Ὶ":"ὶ","Ί":"ί","Ῠ":"ῠ","Ῡ":"ῡ","Ὺ":"ὺ","Ύ":"ύ","Ῥ":"ῥ","Ὸ":"ὸ","Ό":"ό","Ὼ":"ὼ","Ώ":"ώ","Ω":"ω","K":"k","Å":"å","Ⅎ":"ⅎ","Ⅰ":"ⅰ","Ⅱ":"ⅱ","Ⅲ":"ⅲ","Ⅳ":"ⅳ","Ⅴ":"ⅴ","Ⅵ":"ⅵ","Ⅶ":"ⅶ","Ⅷ":"ⅷ","Ⅸ":"ⅸ","Ⅹ":"ⅹ","Ⅺ":"ⅺ","Ⅻ":"ⅻ","Ⅼ":"ⅼ","Ⅽ":"ⅽ","Ⅾ":"ⅾ","Ⅿ":"ⅿ","Ↄ":"ↄ","Ⓐ":"ⓐ","Ⓑ":"ⓑ","Ⓒ":"ⓒ","Ⓓ":"ⓓ","Ⓔ":"ⓔ","Ⓕ":"ⓕ","Ⓖ":"ⓖ","Ⓗ":"ⓗ","Ⓘ":"ⓘ","Ⓙ":"ⓙ","Ⓚ":"ⓚ","Ⓛ":"ⓛ","Ⓜ":"ⓜ","Ⓝ":"ⓝ","Ⓞ":"ⓞ","Ⓟ":"ⓟ","Ⓠ":"ⓠ","Ⓡ":"ⓡ","Ⓢ":"ⓢ","Ⓣ":"ⓣ","Ⓤ":"ⓤ","Ⓥ":"ⓥ","Ⓦ":"ⓦ","Ⓧ":"ⓧ","Ⓨ":"ⓨ","Ⓩ":"ⓩ","Ⰰ":"ⰰ","Ⰱ":"ⰱ","Ⰲ":"ⰲ","Ⰳ":"ⰳ","Ⰴ":"ⰴ","Ⰵ":"ⰵ","Ⰶ":"ⰶ","Ⰷ":"ⰷ","Ⰸ":"ⰸ","Ⰹ":"ⰹ","Ⰺ":"ⰺ","Ⰻ":"ⰻ","Ⰼ":"ⰼ","Ⰽ":"ⰽ","Ⰾ":"ⰾ","Ⰿ":"ⰿ","Ⱀ":"ⱀ","Ⱁ":"ⱁ","Ⱂ":"ⱂ","Ⱃ":"ⱃ","Ⱄ":"ⱄ","Ⱅ":"ⱅ","Ⱆ":"ⱆ","Ⱇ":"ⱇ","Ⱈ":"ⱈ","Ⱉ":"ⱉ","Ⱊ":"ⱊ","Ⱋ":"ⱋ","Ⱌ":"ⱌ","Ⱍ":"ⱍ","Ⱎ":"ⱎ","Ⱏ":"ⱏ","Ⱐ":"ⱐ","Ⱑ":"ⱑ","Ⱒ":"ⱒ","Ⱓ":"ⱓ","Ⱔ":"ⱔ","Ⱕ":"ⱕ","Ⱖ":"ⱖ","Ⱗ":"ⱗ","Ⱘ":"ⱘ","Ⱙ":"ⱙ","Ⱚ":"ⱚ","Ⱛ":"ⱛ","Ⱜ":"ⱜ","Ⱝ":"ⱝ","Ⱞ":"ⱞ","Ⱡ":"ⱡ","Ɫ":"ɫ","Ᵽ":"ᵽ","Ɽ":"ɽ","Ⱨ":"ⱨ","Ⱪ":"ⱪ","Ⱬ":"ⱬ","Ɑ":"ɑ","Ɱ":"ɱ","Ɐ":"ɐ","Ɒ":"ɒ","Ⱳ":"ⱳ","Ⱶ":"ⱶ","Ȿ":"ȿ","Ɀ":"ɀ","Ⲁ":"ⲁ","Ⲃ":"ⲃ","Ⲅ":"ⲅ","Ⲇ":"ⲇ","Ⲉ":"ⲉ","Ⲋ":"ⲋ","Ⲍ":"ⲍ","Ⲏ":"ⲏ","Ⲑ":"ⲑ","Ⲓ":"ⲓ","Ⲕ":"ⲕ","Ⲗ":"ⲗ","Ⲙ":"ⲙ","Ⲛ":"ⲛ","Ⲝ":"ⲝ","Ⲟ":"ⲟ","Ⲡ":"ⲡ","Ⲣ":"ⲣ","Ⲥ":"ⲥ","Ⲧ":"ⲧ","Ⲩ":"ⲩ","Ⲫ":"ⲫ","Ⲭ":"ⲭ","Ⲯ":"ⲯ","Ⲱ":"ⲱ","Ⲳ":"ⲳ","Ⲵ":"ⲵ","Ⲷ":"ⲷ","Ⲹ":"ⲹ","Ⲻ":"ⲻ","Ⲽ":"ⲽ","Ⲿ":"ⲿ","Ⳁ":"ⳁ","Ⳃ":"ⳃ","Ⳅ":"ⳅ","Ⳇ":"ⳇ","Ⳉ":"ⳉ","Ⳋ":"ⳋ","Ⳍ":"ⳍ","Ⳏ":"ⳏ","Ⳑ":"ⳑ","Ⳓ":"ⳓ","Ⳕ":"ⳕ","Ⳗ":"ⳗ","Ⳙ":"ⳙ","Ⳛ":"ⳛ","Ⳝ":"ⳝ","Ⳟ":"ⳟ","Ⳡ":"ⳡ","Ⳣ":"ⳣ","Ⳬ":"ⳬ","Ⳮ":"ⳮ","Ⳳ":"ⳳ","Ꙁ":"ꙁ","Ꙃ":"ꙃ","Ꙅ":"ꙅ","Ꙇ":"ꙇ","Ꙉ":"ꙉ","Ꙋ":"ꙋ","Ꙍ":"ꙍ","Ꙏ":"ꙏ","Ꙑ":"ꙑ","Ꙓ":"ꙓ","Ꙕ":"ꙕ","Ꙗ":"ꙗ","Ꙙ":"ꙙ","Ꙛ":"ꙛ","Ꙝ":"ꙝ","Ꙟ":"ꙟ","Ꙡ":"ꙡ","Ꙣ":"ꙣ","Ꙥ":"ꙥ","Ꙧ":"ꙧ","Ꙩ":"ꙩ","Ꙫ":"ꙫ","Ꙭ":"ꙭ","Ꚁ":"ꚁ","Ꚃ":"ꚃ","Ꚅ":"ꚅ","Ꚇ":"ꚇ","Ꚉ":"ꚉ","Ꚋ":"ꚋ","Ꚍ":"ꚍ","Ꚏ":"ꚏ","Ꚑ":"ꚑ","Ꚓ":"ꚓ","Ꚕ":"ꚕ","Ꚗ":"ꚗ","Ꚙ":"ꚙ","Ꚛ":"ꚛ","Ꜣ":"ꜣ","Ꜥ":"ꜥ","Ꜧ":"ꜧ","Ꜩ":"ꜩ","Ꜫ":"ꜫ","Ꜭ":"ꜭ","Ꜯ":"ꜯ","Ꜳ":"ꜳ","Ꜵ":"ꜵ","Ꜷ":"ꜷ","Ꜹ":"ꜹ","Ꜻ":"ꜻ","Ꜽ":"ꜽ","Ꜿ":"ꜿ","Ꝁ":"ꝁ","Ꝃ":"ꝃ","Ꝅ":"ꝅ","Ꝇ":"ꝇ","Ꝉ":"ꝉ","Ꝋ":"ꝋ","Ꝍ":"ꝍ","Ꝏ":"ꝏ","Ꝑ":"ꝑ","Ꝓ":"ꝓ","Ꝕ":"ꝕ","Ꝗ":"ꝗ","Ꝙ":"ꝙ","Ꝛ":"ꝛ","Ꝝ":"ꝝ","Ꝟ":"ꝟ","Ꝡ":"ꝡ","Ꝣ":"ꝣ","Ꝥ":"ꝥ","Ꝧ":"ꝧ","Ꝩ":"ꝩ","Ꝫ":"ꝫ","Ꝭ":"ꝭ","Ꝯ":"ꝯ","Ꝺ":"ꝺ","Ꝼ":"ꝼ","Ᵹ":"ᵹ","Ꝿ":"ꝿ","Ꞁ":"ꞁ","Ꞃ":"ꞃ","Ꞅ":"ꞅ","Ꞇ":"ꞇ","Ꞌ":"ꞌ","Ɥ":"ɥ","Ꞑ":"ꞑ","Ꞓ":"ꞓ","Ꞗ":"ꞗ","Ꞙ":"ꞙ","Ꞛ":"ꞛ","Ꞝ":"ꞝ","Ꞟ":"ꞟ","Ꞡ":"ꞡ","Ꞣ":"ꞣ","Ꞥ":"ꞥ","Ꞧ":"ꞧ","Ꞩ":"ꞩ","Ɦ":"ɦ","Ɜ":"ɜ","Ɡ":"ɡ","Ɬ":"ɬ","Ʞ":"ʞ","Ʇ":"ʇ","A":"a","B":"b","C":"c","D":"d","E":"e","F":"f","G":"g","H":"h","I":"i","J":"j","K":"k","L":"l","M":"m","N":"n","O":"o","P":"p","Q":"q","R":"r","S":"s","T":"t","U":"u","V":"v","W":"w","X":"x","Y":"y","Z":"z","𐐀":"𐐨","𐐁":"𐐩","𐐂":"𐐪","𐐃":"𐐫","𐐄":"𐐬","𐐅":"𐐭","𐐆":"𐐮","𐐇":"𐐯","𐐈":"𐐰","𐐉":"𐐱","𐐊":"𐐲","𐐋":"𐐳","𐐌":"𐐴","𐐍":"𐐵","𐐎":"𐐶","𐐏":"𐐷","𐐐":"𐐸","𐐑":"𐐹","𐐒":"𐐺","𐐓":"𐐻","𐐔":"𐐼","𐐕":"𐐽","𐐖":"𐐾","𐐗":"𐐿","𐐘":"𐑀","𐐙":"𐑁","𐐚":"𐑂","𐐛":"𐑃","𐐜":"𐑄","𐐝":"𐑅","𐐞":"𐑆","𐐟":"𐑇","𐐠":"𐑈","𐐡":"𐑉","𐐢":"𐑊","𐐣":"𐑋","𐐤":"𐑌","𐐥":"𐑍","𐐦":"𐑎","𐐧":"𐑏","𑢠":"𑣀","𑢡":"𑣁","𑢢":"𑣂","𑢣":"𑣃","𑢤":"𑣄","𑢥":"𑣅","𑢦":"𑣆","𑢧":"𑣇","𑢨":"𑣈","𑢩":"𑣉","𑢪":"𑣊","𑢫":"𑣋","𑢬":"𑣌","𑢭":"𑣍","𑢮":"𑣎","𑢯":"𑣏","𑢰":"𑣐","𑢱":"𑣑","𑢲":"𑣒","𑢳":"𑣓","𑢴":"𑣔","𑢵":"𑣕","𑢶":"𑣖","𑢷":"𑣗","𑢸":"𑣘","𑢹":"𑣙","𑢺":"𑣚","𑢻":"𑣛","𑢼":"𑣜","𑢽":"𑣝","𑢾":"𑣞","𑢿":"𑣟","ß":"ss","İ":"i̇","ʼn":"ʼn","ǰ":"ǰ","ΐ":"ΐ","ΰ":"ΰ","և":"եւ","ẖ":"ẖ","ẗ":"ẗ","ẘ":"ẘ","ẙ":"ẙ","ẚ":"aʾ","ẞ":"ss","ὐ":"ὐ","ὒ":"ὒ","ὔ":"ὔ","ὖ":"ὖ","ᾀ":"ἀι","ᾁ":"ἁι","ᾂ":"ἂι","ᾃ":"ἃι","ᾄ":"ἄι","ᾅ":"ἅι","ᾆ":"ἆι","ᾇ":"ἇι","ᾈ":"ἀι","ᾉ":"ἁι","ᾊ":"ἂι","ᾋ":"ἃι","ᾌ":"ἄι","ᾍ":"ἅι","ᾎ":"ἆι","ᾏ":"ἇι","ᾐ":"ἠι","ᾑ":"ἡι","ᾒ":"ἢι","ᾓ":"ἣι","ᾔ":"ἤι","ᾕ":"ἥι","ᾖ":"ἦι","ᾗ":"ἧι","ᾘ":"ἠι","ᾙ":"ἡι","ᾚ":"ἢι","ᾛ":"ἣι","ᾜ":"ἤι","ᾝ":"ἥι","ᾞ":"ἦι","ᾟ":"ἧι","ᾠ":"ὠι","ᾡ":"ὡι","ᾢ":"ὢι","ᾣ":"ὣι","ᾤ":"ὤι","ᾥ":"ὥι","ᾦ":"ὦι","ᾧ":"ὧι","ᾨ":"ὠι","ᾩ":"ὡι","ᾪ":"ὢι","ᾫ":"ὣι","ᾬ":"ὤι","ᾭ":"ὥι","ᾮ":"ὦι","ᾯ":"ὧι","ᾲ":"ὰι","ᾳ":"αι","ᾴ":"άι","ᾶ":"ᾶ","ᾷ":"ᾶι","ᾼ":"αι","ῂ":"ὴι","ῃ":"ηι","ῄ":"ήι","ῆ":"ῆ","ῇ":"ῆι","ῌ":"ηι","ῒ":"ῒ","ΐ":"ΐ","ῖ":"ῖ","ῗ":"ῗ","ῢ":"ῢ","ΰ":"ΰ","ῤ":"ῤ","ῦ":"ῦ","ῧ":"ῧ","ῲ":"ὼι","ῳ":"ωι","ῴ":"ώι","ῶ":"ῶ","ῷ":"ῶι","ῼ":"ωι","ff":"ff","fi":"fi","fl":"fl","ffi":"ffi","ffl":"ffl","ſt":"st","st":"st","ﬓ":"մն","ﬔ":"մե","ﬕ":"մի","ﬖ":"վն","ﬗ":"մխ"};e.exports=function(e){return e.slice(1,e.length-1).trim().replace(r,function(e){return i[e]||" "})}},function(e,t,n){"use strict";function r(e,t,n){if(!(this.disableTags>0)){if(this.buffer+="<"+e,t&&t.length>0)for(var r,i=0;void 0!==(r=t[i]);)this.buffer+=" "+r[0]+'="'+r[1]+'"',i++;n&&(this.buffer+=" /"),this.buffer+=">",this.lastOut=">"}}function i(e){e=e||{},e.softbreak=e.softbreak||"\n",this.disableTags=0,this.lastOut="\n",this.options=e}function o(e){this.out(e.literal)}function a(){this.lit(this.options.softbreak)}function s(){this.tag("br",[],!0),this.cr()}function u(e,t){var n=this.attrs(e);t?(this.options.safe&&O(e.destination)||n.push(["href",this.esc(e.destination,!0)]),e.title&&n.push(["title",this.esc(e.title,!0)]),this.tag("a",n)):this.tag("/a")}function l(e,t){t?(0===this.disableTags&&(this.options.safe&&O(e.destination)?this.lit('<img src="" alt="'):this.lit('<img src="'+this.esc(e.destination,!0)+'" alt="')),this.disableTags+=1):(this.disableTags-=1,0===this.disableTags&&(e.title&&this.lit('" title="'+this.esc(e.title,!0)),this.lit('" />')))}function c(e,t){this.tag(t?"em":"/em")}function p(e,t){this.tag(t?"strong":"/strong")}function f(e,t){var n=e.parent.parent,r=this.attrs(e);null!==n&&"list"===n.type&&n.listTight||(t?(this.cr(),this.tag("p",r)):(this.tag("/p"),this.cr()))}function h(e,t){var n="h"+e.level,r=this.attrs(e);t?(this.cr(),this.tag(n,r)):(this.tag("/"+n),this.cr())}function d(e){this.tag("code"),this.out(e.literal),this.tag("/code")}function m(e){var t=e.info?e.info.split(/\s+/):[],n=this.attrs(e);t.length>0&&t[0].length>0&&n.push(["class","language-"+this.esc(t[0],!0)]),this.cr(),this.tag("pre"),this.tag("code",n),this.out(e.literal),this.tag("/code"),this.tag("/pre"),this.cr()}function v(e){var t=this.attrs(e);this.cr(),this.tag("hr",t,!0),this.cr()}function g(e,t){var n=this.attrs(e);t?(this.cr(),this.tag("blockquote",n),this.cr()):(this.cr(),this.tag("/blockquote"),this.cr())}function y(e,t){var n="bullet"===e.listType?"ul":"ol",r=this.attrs(e);if(t){var i=e.listStart;null!==i&&1!==i&&r.push(["start",i.toString()]),this.cr(),this.tag(n,r),this.cr()}else this.cr(),this.tag("/"+n),this.cr()}function _(e,t){var n=this.attrs(e);t?this.tag("li",n):(this.tag("/li"),this.cr())}function b(e){this.options.safe?this.lit("\x3c!-- raw HTML omitted --\x3e"):this.lit(e.literal)}function x(e){this.cr(),this.options.safe?this.lit("\x3c!-- raw HTML omitted --\x3e"):this.lit(e.literal),this.cr()}function w(e,t){t&&e.onEnter?this.lit(e.onEnter):!t&&e.onExit&&this.lit(e.onExit)}function k(e,t){this.cr(),t&&e.onEnter?this.lit(e.onEnter):!t&&e.onExit&&this.lit(e.onExit),this.cr()}function E(e){this.lit(this.esc(e,!1))}function S(e){var t=[];if(this.options.sourcepos){var n=e.sourcepos;n&&t.push(["data-sourcepos",String(n[0][0])+":"+String(n[0][1])+"-"+String(n[1][0])+":"+String(n[1][1])])}return t}var C=n(333),A=/^javascript:|vbscript:|file:|data:/i,D=/^data:image\/(?:png|gif|jpeg|webp)/i,O=function(e){return A.test(e)&&!D.test(e)};i.prototype=Object.create(C.prototype),i.prototype.text=o,i.prototype.html_inline=b,i.prototype.html_block=x,i.prototype.softbreak=a,i.prototype.linebreak=s,i.prototype.link=u,i.prototype.image=l,i.prototype.emph=c,i.prototype.strong=p,i.prototype.paragraph=f,i.prototype.heading=h,i.prototype.code=d,i.prototype.code_block=m,i.prototype.thematic_break=v,i.prototype.block_quote=g,i.prototype.list=y,i.prototype.item=_,i.prototype.custom_inline=w,i.prototype.custom_block=k,i.prototype.esc=n(73).escapeXml,i.prototype.out=E,i.prototype.tag=r,i.prototype.attrs=S,e.exports=i},function(e,t,n){"use strict";function r(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}function i(e){e=e||{},this.disableTags=0,this.lastOut="\n",this.indentLevel=0,this.indent=" ",this.options=e}function o(e){this.buffer="";var t,n,i,o,a,s,u,l,c=e.walker(),p=this.options;for(p.time&&console.time("rendering"),this.buffer+='<?xml version="1.0" encoding="UTF-8"?>\n',this.buffer+='<!DOCTYPE document SYSTEM "CommonMark.dtd">\n';i=c.next();)if(a=i.entering,o=i.node,l=o.type,s=o.isContainer,u="thematic_break"===l||"linebreak"===l||"softbreak"===l,n=r(l),a){switch(t=[],l){case"document":t.push(["xmlns","http://commonmark.org/xml/1.0"]);break;case"list":null!==o.listType&&t.push(["type",o.listType.toLowerCase()]),null!==o.listStart&&t.push(["start",String(o.listStart)]),null!==o.listTight&&t.push(["tight",o.listTight?"true":"false"]);var f=o.listDelimiter;if(null!==f){var h="";h="."===f?"period":"paren",t.push(["delimiter",h])}break;case"code_block":o.info&&t.push(["info",o.info]);break;case"heading":t.push(["level",String(o.level)]);break;case"link":case"image":t.push(["destination",o.destination]),t.push(["title",o.title]);break;case"custom_inline":case"custom_block":t.push(["on_enter",o.onEnter]),t.push(["on_exit",o.onExit])}if(p.sourcepos){var d=o.sourcepos;d&&t.push(["sourcepos",String(d[0][0])+":"+String(d[0][1])+"-"+String(d[1][0])+":"+String(d[1][1])])}if(this.cr(),this.out(this.tag(n,t,u)),s)this.indentLevel+=1;else if(!s&&!u){var m=o.literal;m&&this.out(this.esc(m)),this.out(this.tag("/"+n))}}else this.indentLevel-=1,this.cr(),this.out(this.tag("/"+n));return p.time&&console.timeEnd("rendering"),this.buffer+="\n",this.buffer}function a(e){this.disableTags>0?this.buffer+=e.replace(c,""):this.buffer+=e,this.lastOut=e}function s(){if("\n"!==this.lastOut){this.buffer+="\n",this.lastOut="\n";for(var e=this.indentLevel;e>0;e--)this.buffer+=this.indent}}function u(e,t,n){var r="<"+e;if(t&&t.length>0)for(var i,o=0;void 0!==(i=t[o]);)r+=" "+i[0]+'="'+this.esc(i[1])+'"',o++;return n&&(r+=" /"),r+=">"}var l=n(333),c=/\<[^>]*\>/;i.prototype=Object.create(l.prototype),i.prototype.render=o,i.prototype.out=a,i.prototype.cr=s,i.prototype.tag=u,i.prototype.esc=n(73).escapeXml,e.exports=i},function(e,t,n){"use strict";function r(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},r=t||{},i=e.split(u),s=r.decode||a,l=0;l<i.length;l++){var c=i[l],p=c.indexOf("=");if(!(p<0)){var f=c.substr(0,p).trim(),h=c.substr(++p,c.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),void 0==n[f]&&(n[f]=o(h,s))}}return n}function i(e,t,n){var r=n||{},i=r.encode||s;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!l.test(e))throw new TypeError("argument name is invalid");var o=i(t);if(o&&!l.test(o))throw new TypeError("argument val is invalid");var a=e+"="+o;if(null!=r.maxAge){var u=r.maxAge-0;if(isNaN(u))throw new Error("maxAge should be a Number");a+="; Max-Age="+Math.floor(u)}if(r.domain){if(!l.test(r.domain))throw new TypeError("option domain is invalid");a+="; Domain="+r.domain}if(r.path){if(!l.test(r.path))throw new TypeError("option path is invalid");a+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");a+="; Expires="+r.expires.toUTCString()}if(r.httpOnly&&(a+="; HttpOnly"),r.secure&&(a+="; Secure"),r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;default:throw new TypeError("option sameSite is invalid")}}return a}function o(e,t){try{return t(e)}catch(t){return e}}/*! +function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(e){var t=[];return e.forEach(function(e,i){"object"==typeof e&&null!==e?Array.isArray(e)?t[i]=o(e):n(e)?t[i]=r(e):t[i]=a({},e):t[i]=e}),t}function i(e,t){return"__proto__"===t?void 0:e[t]}var a=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,s=arguments[0],u=Array.prototype.slice.call(arguments,1);return u.forEach(function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach(function(c){return t=i(s,c),(e=i(u,c))===s?void 0:"object"!=typeof e||null===e?void(s[c]=e):Array.isArray(e)?void(s[c]=o(e)):n(e)?void(s[c]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(s[c]=a({},e)):void(s[c]=a(t,e))})}),s}}).call(this,n(64).Buffer)},function(e,t,n){e.exports=n(952)},function(e,t,n){n(164),n(103),n(953),n(957),n(958),e.exports=n(22).WeakMap},function(e,t,n){"use strict";var r,o=n(32),i=n(268)(0),a=n(220),s=n(135),u=n(356),c=n(956),l=n(43),p=n(144),f=n(144),h=!o.ActiveXObject&&"ActiveXObject"in o,d=s.getWeak,m=Object.isExtensible,v=c.ufstore,g=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(e){if(l(e)){var t=d(e);return!0===t?v(p(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return c.def(p(this,"WeakMap"),e,t)}},b=e.exports=n(459)("WeakMap",g,y,c,!0,!0);f&&h&&(u((r=c.getConstructor(g,"WeakMap")).prototype,y),s.NEED=!0,i(["delete","has","get","set"],function(e){var t=b.prototype,n=t[e];a(t,e,function(t,o){if(l(t)&&!m(t)){this._f||(this._f=new r);var i=this._f[e](t,o);return"set"==e?this:i}return n.call(this,t,o)})}))},function(e,t,n){var r=n(955);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(43),o=n(223),i=n(34)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){"use strict";var r=n(182),o=n(135).getWeak,i=n(46),a=n(43),s=n(181),u=n(112),c=n(268),l=n(75),p=n(144),f=c(5),h=c(6),d=0,m=function(e){return e._l||(e._l=new v)},v=function(){this.a=[]},g=function(e,t){return f(e.a,function(e){return e[0]===t})};v.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=h(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,i){var c=e(function(e,r){s(e,c,t,"_i"),e._t=t,e._i=d++,e._l=void 0,null!=r&&u(r,n,e[i],e)});return r(c.prototype,{delete:function(e){if(!a(e))return!1;var n=o(e);return!0===n?m(p(this,t)).delete(e):n&&l(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=o(e);return!0===n?m(p(this,t)).has(e):n&&l(n,this._i)}}),c},def:function(e,t,n){var r=o(i(t),!0);return!0===r?m(e).set(t,n):r[e._i]=n,e},ufstore:m}},function(e,t,n){n(460)("WeakMap")},function(e,t,n){n(461)("WeakMap")},function(e,t){var n={};!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return d.iterable&&(t[Symbol.iterator]=function(){return t}),t}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function u(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function c(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(d.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(d.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(d.arrayBuffer&&d.blob&&v(e))this._bodyArrayBuffer=u(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!d.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!g(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=u(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},d.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function l(e,t){var n=(t=t||{}).body;if(e instanceof l){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=function(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function p(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function f(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}function h(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var d={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(d.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=function(e){return e&&DataView.prototype.isPrototypeOf(e)},g=ArrayBuffer.isView||function(e){return e&&m.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];this.map[e]=o?o+","+r:r},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,r){this.map[t(e)]=n(r)},o.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},d.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this,{body:this._bodyInit})},c.call(l.prototype),c.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},h.error=function(){var e=new h(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];h.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new h(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=l,e.Response=h,e.fetch=function(e,t){return new Promise(function(n,r){var o=new l(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:f(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new h(t,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&d.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}(void 0!==n?n:this),e.exports=n},function(e,t){var n=e.exports=function(e){return new r(e)};function r(e){this.value=e}function o(e,t,n){var r=[],o=[],s=!0;return function e(p){var f=n?i(p):p,h={},d=!0,m={node:f,node_:p,path:[].concat(r),parent:o[o.length-1],parents:o,key:r.slice(-1)[0],isRoot:0===r.length,level:r.length,circular:null,update:function(e,t){m.isRoot||(m.parent.node[m.key]=e),m.node=e,t&&(d=!1)},delete:function(e){delete m.parent.node[m.key],e&&(d=!1)},remove:function(e){u(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],e&&(d=!1)},keys:null,before:function(e){h.before=e},after:function(e){h.after=e},pre:function(e){h.pre=e},post:function(e){h.post=e},stop:function(){s=!1},block:function(){d=!1}};if(!s)return m;function v(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=a(m.node)),m.isLeaf=0==m.keys.length;for(var e=0;e<o.length;e++)if(o[e].node_===p){m.circular=o[e];break}}else m.isLeaf=!0,m.keys=null;m.notLeaf=!m.isLeaf,m.notRoot=!m.isRoot}v();var g=t.call(m,m.node);return void 0!==g&&m.update&&m.update(g),h.before&&h.before.call(m,m.node),d?("object"!=typeof m.node||null===m.node||m.circular||(o.push(m),v(),c(m.keys,function(t,o){r.push(t),h.pre&&h.pre.call(m,m.node[t],t);var i=e(m.node[t]);n&&l.call(m.node,t)&&(m.node[t]=i.node),i.isLast=o==m.keys.length-1,i.isFirst=0==o,h.post&&h.post.call(m,i),r.pop()}),o.pop()),h.after&&h.after.call(m,m.node),m):m}(e).node}function i(e){if("object"==typeof e&&null!==e){var t;if(u(e))t=[];else if("[object Date]"===s(e))t=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===s(e)}(e))t=new RegExp(e);else if(function(e){return"[object Error]"===s(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===s(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===s(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===s(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},r=function(){};r.prototype=n,t=new r}return c(a(e),function(n){t[n]=e[n]}),t}return e}r.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!l.call(t,r)){t=void 0;break}t=t[r]}return t},r.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!l.call(t,r))return!1;t=t[r]}return!0},r.prototype.set=function(e,t){for(var n=this.value,r=0;r<e.length-1;r++){var o=e[r];l.call(n,o)||(n[o]={}),n=n[o]}return n[e[r]]=t,t},r.prototype.map=function(e){return o(this.value,e,!0)},r.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},r.prototype.reduce=function(e,t){var n=1===arguments.length,r=n?this.value:t;return this.forEach(function(t){this.isRoot&&n||(r=e.call(this,r,t))}),r},r.prototype.paths=function(){var e=[];return this.forEach(function(t){e.push(this.path)}),e},r.prototype.nodes=function(){var e=[];return this.forEach(function(t){e.push(this.node)}),e},r.prototype.clone=function(){var e=[],t=[];return function n(r){for(var o=0;o<e.length;o++)if(e[o]===r)return t[o];if("object"==typeof r&&null!==r){var s=i(r);return e.push(r),t.push(s),c(a(r),function(e){s[e]=n(r[e])}),e.pop(),t.pop(),s}return r}(this.value)};var a=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function s(e){return Object.prototype.toString.call(e)}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},c=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};c(a(r.prototype),function(e){n[e]=function(t){var n=[].slice.call(arguments,1),o=new r(t);return o[e].apply(o,n)}});var l=Object.hasOwnProperty||function(e,t){return t in e}},function(e,t,n){var r=n(962),o=n(453)(function(e,t){return null==e?{}:r(e,t)});e.exports=o},function(e,t,n){var r=n(963),o=n(385);e.exports=function(e,t){return r(e,t,function(t,n){return o(e,n)})}},function(e,t,n){var r=n(177),o=n(417),i=n(108);e.exports=function(e,t,n){for(var a=-1,s=t.length,u={};++a<s;){var c=t[a],l=r(e,c);n(l,c)&&o(u,i(c,e),l)}return u}},function(e,t,n){"use strict"; +/*! * cookie * Copyright(c) 2012-2014 Roman Shtylman * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed - */ -t.parse=r,t.serialize=i;var a=decodeURIComponent,s=encodeURIComponent,u=/; */,l=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/},function(e,t,n){n(679),n(683),n(690),n(366),n(674),n(675),n(680),n(684),n(686),n(670),n(671),n(672),n(673),n(676),n(677),n(678),n(681),n(682),n(685),n(687),n(688),n(689),n(666),n(667),n(668),n(669),e.exports=n(63).String},function(e,t,n){n(664),n(366),n(693),n(665),n(691),n(692),e.exports=n(63).Promise},function(e,t,n){n(103),n(621),e.exports=n(15).Array.from},function(e,t,n){n(104),n(103),e.exports=n(619)},function(e,t,n){n(104),n(103),e.exports=n(620)},function(e,t,n){var r=n(15),i=r.JSON||(r.JSON={stringify:JSON.stringify});e.exports=function(e){return i.stringify.apply(i,arguments)}},function(e,t,n){n(623),e.exports=n(15).Object.assign},function(e,t,n){n(624);var r=n(15).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){n(625);var r=n(15).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){n(626),e.exports=n(15).Object.getPrototypeOf},function(e,t,n){n(627),e.exports=n(15).Object.keys},function(e,t,n){n(628),e.exports=n(15).Object.setPrototypeOf},function(e,t,n){n(194),n(103),n(104),n(629),n(632),n(633),e.exports=n(15).Promise},function(e,t,n){n(630),n(194),n(634),n(635),e.exports=n(15).Symbol},function(e,t,n){n(103),n(104),e.exports=n(192).f("iterator")},function(e,t,n){n(194),n(104),n(631),n(637),n(636),e.exports=n(15).WeakMap},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(75),i=n(133),o=n(618);e.exports=function(e){return function(t,n,a){var s,u=r(t),l=i(u.length),c=o(a,l);if(e&&n!=n){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},function(e,t,n){var r=n(27),i=n(337),o=n(22)("species");e.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){var r=n(601);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){"use strict";var r=n(185),i=n(131).getWeak,o=n(37),a=n(27),s=n(175),u=n(129),l=n(176),c=n(55),p=n(351),f=l(5),h=l(6),d=0,m=function(e){return e._l||(e._l=new v)},v=function(){this.a=[]},g=function(e,t){return f(e.a,function(e){return e[0]===t})};v.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=h(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,o){var l=e(function(e,r){s(e,l,t,"_i"),e._t=t,e._i=d++,e._l=void 0,void 0!=r&&u(r,n,e[o],e)});return r(l.prototype,{delete:function(e){if(!a(e))return!1;var n=i(e);return!0===n?m(p(this,t)).delete(e):n&&c(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=i(e);return!0===n?m(p(this,t)).has(e):n&&c(n,this._i)}}),l},def:function(e,t,n){var r=i(o(t),!0);return!0===r?m(e).set(t,n):r[e._i]=n,e},ufstore:m}},function(e,t,n){"use strict";var r=n(24),i=n(23),o=n(131),a=n(54),s=n(56),u=n(185),l=n(129),c=n(175),p=n(27),f=n(102),h=n(41).f,d=n(176)(0),m=n(49);e.exports=function(e,t,n,v,g,y){var _=r[e],b=_,x=g?"set":"add",w=b&&b.prototype,k={};return m&&"function"==typeof b&&(y||w.forEach&&!a(function(){(new b).entries().next()}))?(b=t(function(t,n){c(t,b,e,"_c"),t._c=new _,void 0!=n&&l(n,g,t[x],t)}),d("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in w&&(!y||"clear"!=e)&&s(b.prototype,e,function(n,r){if(c(this,b,e),!t&&y&&!p(n))return"get"==e&&void 0;var i=this._c[e](0===n?0:n,r);return t?this:i})}),y||h(b.prototype,"size",{get:function(){return this._c.size}})):(b=v.getConstructor(t,e,g,x),u(b.prototype,n),o.NEED=!0),f(b,e),k[e]=b,i(i.G+i.W+i.F,k),y||v.setStrong(b,e,g),b}},function(e,t,n){"use strict";var r=n(41),i=n(101);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){var r=n(100),i=n(184),o=n(132);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,s=n(e),u=o.f,l=0;s.length>l;)u.call(e,a=s[l++])&&t.push(a);return t}},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){"use strict";var r=n(183),i=n(101),o=n(102),a={};n(56)(a,n(22)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(24),i=n(350).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(99)(a);e.exports=function(){var e,t,n,l=function(){var r,i;for(u&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(l)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve();n=function(){c.then(l)}}else n=function(){i.call(r,l)};else{var p=!0,f=document.createTextNode("");new o(l).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(41),i=n(37),o=n(100);e.exports=n(49)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(75),i=n(343).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch(e){return a.slice()}};e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?s(e):i(r(e))}},function(e,t,n){"use strict";var r=n(23),i=n(98),o=n(53),a=n(129);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,s,u=arguments[1];return i(this),t=void 0!==u,t&&i(u),void 0==e?new this:(n=[],t?(r=0,s=o(u,arguments[2],2),a(e,!1,function(e){n.push(s(e,r++))})):a(e,!1,n.push,n),new this(n))}})}},function(e,t,n){"use strict";var r=n(23);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){var r=n(27),i=n(37),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{r=n(53)(Function.call,n(342).f(Object.prototype,"__proto__").set,2),r(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t,n){"use strict";var r=n(24),i=n(15),o=n(41),a=n(49),s=n(22)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:r[e];a&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(189),i=n(178);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),u=r(n),l=s.length;return u<0||u>=l?e?"":void 0:(o=s.charCodeAt(u),o<55296||o>56319||u+1===l||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536)}}},function(e,t,n){var r=n(189),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(37),i=n(193);e.exports=n(15).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t,n){var r=n(177),i=n(22)("iterator"),o=n(74);e.exports=n(15).isIterable=function(e){var t=Object(e);return void 0!==t[i]||"@@iterator"in t||o.hasOwnProperty(r(t))}},function(e,t,n){"use strict";var r=n(53),i=n(23),o=n(76),a=n(338),s=n(336),u=n(133),l=n(605),c=n(193);i(i.S+i.F*!n(340)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,i,p,f=o(e),h="function"==typeof this?this:Array,d=arguments.length,m=d>1?arguments[1]:void 0,v=void 0!==m,g=0,y=c(f);if(v&&(m=r(m,d>2?arguments[2]:void 0,2)),void 0==y||h==Array&&s(y))for(t=u(f.length),n=new h(t);t>g;g++)l(n,g,v?m(f[g],g):f[g]);else for(p=y.call(f),n=new h;!(i=p.next()).done;g++)l(n,g,v?a(p,m,[i.value,g],!0):i.value);return n.length=g,n}})},function(e,t,n){"use strict";var r=n(599),i=n(609),o=n(74),a=n(75);e.exports=n(339)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(23);r(r.S+r.F,"Object",{assign:n(341)})},function(e,t,n){var r=n(23);r(r.S,"Object",{create:n(183)})},function(e,t,n){var r=n(23);r(r.S+r.F*!n(49),"Object",{defineProperty:n(41).f})},function(e,t,n){var r=n(76),i=n(344);n(346)("getPrototypeOf",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(76),i=n(100);n(346)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(23);r(r.S,"Object",{setPrototypeOf:n(615).set})},function(e,t,n){"use strict";var r,i,o,a,s=n(130),u=n(24),l=n(53),c=n(177),p=n(23),f=n(27),h=n(98),d=n(175),m=n(129),v=n(349),g=n(350).set,y=n(610)(),_=n(182),b=n(347),x=n(348),w=u.TypeError,k=u.process,E=u.Promise,S="process"==c(k),C=function(){},A=i=_.f,D=!!function(){try{var e=E.resolve(1),t=(e.constructor={})[n(22)("species")]=function(e){e(C,C)};return(S||"function"==typeof PromiseRejectionEvent)&&e.then(C)instanceof t}catch(e){}}(),O=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,i=1==e._s,o=0;n.length>o;)!function(t){var n,o,a=i?t.ok:t.fail,s=t.resolve,u=t.reject,l=t.domain;try{a?(i||(2==e._h&&I(e),e._h=1),!0===a?n=r:(l&&l.enter(),n=a(r),l&&l.exit()),n===t.promise?u(w("Promise-chain cycle")):(o=O(n))?o.call(n,s,u):s(n)):u(r)}catch(e){u(e)}}(n[o++]);e._c=[],e._n=!1,t&&!e._h&&T(e)})}},T=function(e){g.call(u,function(){var t,n,r,i=e._v,o=P(e);if(o&&(t=b(function(){S?k.emit("unhandledRejection",i,e):(n=u.onunhandledrejection)?n({promise:e,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=S||P(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},P=function(e){return 1!==e._h&&0===(e._a||e._c).length},I=function(e){g.call(u,function(){var t;S?k.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},R=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},j=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw w("Promise can't be resolved itself");(t=O(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,l(j,r,1),l(R,r,1))}catch(e){R.call(r,e)}}):(n._v=e,n._s=1,M(n,!1))}catch(e){R.call({_w:n,_d:!1},e)}}};D||(E=function(e){d(this,E,"Promise","_h"),h(e),r.call(this);try{e(l(j,this,1),l(R,this,1))}catch(e){R.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(185)(E.prototype,{then:function(e,t){var n=A(v(this,E));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=S?k.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=l(j,e,1),this.reject=l(R,e,1)},_.f=A=function(e){return e===E||e===a?new o(e):i(e)}),p(p.G+p.W+p.F*!D,{Promise:E}),n(102)(E,"Promise"),n(616)("Promise"),a=n(15).Promise,p(p.S+p.F*!D,"Promise",{reject:function(e){var t=A(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!D),"Promise",{resolve:function(e){return x(s&&this===a?E:this,e)}}),p(p.S+p.F*!(D&&n(340)(function(e){E.all(e).catch(C)})),"Promise",{all:function(e){var t=this,n=A(t),r=n.resolve,i=n.reject,o=b(function(){var n=[],o=0,a=1;m(e,!1,function(e){var s=o++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},i)}),--a||r(n)});return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=A(t),r=n.reject,i=b(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t,n){"use strict";var r=n(24),i=n(55),o=n(49),a=n(23),s=n(186),u=n(131).KEY,l=n(54),c=n(188),p=n(102),f=n(134),h=n(22),d=n(192),m=n(191),v=n(606),g=n(337),y=n(37),_=n(27),b=n(75),x=n(190),w=n(101),k=n(183),E=n(612),S=n(342),C=n(41),A=n(100),D=S.f,O=C.f,M=E.f,T=r.Symbol,P=r.JSON,I=P&&P.stringify,R=h("_hidden"),j=h("toPrimitive"),F={}.propertyIsEnumerable,N=c("symbol-registry"),B=c("symbols"),L=c("op-symbols"),q=Object.prototype,z="function"==typeof T,U=r.QObject,W=!U||!U.prototype||!U.prototype.findChild,V=o&&l(function(){return 7!=k(O({},"a",{get:function(){return O(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=D(q,t);r&&delete q[t],O(e,t,n),r&&e!==q&&O(q,t,r)}:O,H=function(e){var t=B[e]=k(T.prototype);return t._k=e,t},G=z&&"symbol"==typeof T.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof T},J=function(e,t,n){return e===q&&J(L,t,n),y(e),t=x(t,!0),y(n),i(B,t)?(n.enumerable?(i(e,R)&&e[R][t]&&(e[R][t]=!1),n=k(n,{enumerable:w(0,!1)})):(i(e,R)||O(e,R,w(1,{})),e[R][t]=!0),V(e,t,n)):O(e,t,n)},K=function(e,t){y(e);for(var n,r=v(t=b(t)),i=0,o=r.length;o>i;)J(e,n=r[i++],t[n]);return e},X=function(e,t){return void 0===t?k(e):K(k(e),t)},Y=function(e){var t=F.call(this,e=x(e,!0));return!(this===q&&i(B,e)&&!i(L,e))&&(!(t||!i(this,e)||!i(B,e)||i(this,R)&&this[R][e])||t)},$=function(e,t){if(e=b(e),t=x(t,!0),e!==q||!i(B,t)||i(L,t)){var n=D(e,t);return!n||!i(B,t)||i(e,R)&&e[R][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=M(b(e)),r=[],o=0;n.length>o;)i(B,t=n[o++])||t==R||t==u||r.push(t);return r},Q=function(e){for(var t,n=e===q,r=M(n?L:b(e)),o=[],a=0;r.length>a;)!i(B,t=r[a++])||n&&!i(q,t)||o.push(B[t]);return o};z||(T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===q&&t.call(L,n),i(this,R)&&i(this[R],e)&&(this[R][e]=!1),V(this,e,w(1,n))};return o&&W&&V(q,e,{configurable:!0,set:t}),H(e)},s(T.prototype,"toString",function(){return this._k}),S.f=$,C.f=J,n(343).f=E.f=Z,n(132).f=Y,n(184).f=Q,o&&!n(130)&&s(q,"propertyIsEnumerable",Y,!0),d.f=function(e){return H(h(e))}),a(a.G+a.W+a.F*!z,{Symbol:T});for(var ee="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),te=0;ee.length>te;)h(ee[te++]);for(var ne=A(h.store),re=0;ne.length>re;)m(ne[re++]);a(a.S+a.F*!z,"Symbol",{for:function(e){return i(N,e+="")?N[e]:N[e]=T(e)},keyFor:function(e){if(!G(e))throw TypeError(e+" is not a symbol!");for(var t in N)if(N[t]===e)return t},useSetter:function(){W=!0},useSimple:function(){W=!1}}),a(a.S+a.F*!z,"Object",{create:X,defineProperty:J,defineProperties:K,getOwnPropertyDescriptor:$,getOwnPropertyNames:Z,getOwnPropertySymbols:Q}),P&&a(a.S+a.F*(!z||l(function(){var e=T();return"[null]"!=I([e])||"{}"!=I({a:e})||"{}"!=I(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(_(t)||void 0!==e)&&!G(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!G(t))return t}),r[1]=t,I.apply(P,r)}}),T.prototype[j]||n(56)(T.prototype,j,T.prototype.valueOf),p(T,"Symbol"),p(Math,"Math",!0),p(r.JSON,"JSON",!0)},function(e,t,n){"use strict";var r,i=n(176)(0),o=n(186),a=n(131),s=n(341),u=n(603),l=n(27),c=n(54),p=n(351),f=a.getWeak,h=Object.isExtensible,d=u.ufstore,m={},v=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},g={get:function(e){if(l(e)){var t=f(e);return!0===t?d(p(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(p(this,"WeakMap"),e,t)}},y=e.exports=n(604)("WeakMap",v,g,u,!0,!0);c(function(){return 7!=(new y).set((Object.freeze||Object)(m),7).get(m)})&&(r=u.getConstructor(v,"WeakMap"),s(r.prototype,g),a.NEED=!0,i(["delete","has","get","set"],function(e){var t=y.prototype,n=t[e];o(t,e,function(t,i){if(l(t)&&!h(t)){this._f||(this._f=new r);var o=this._f[e](t,i);return"set"==e?this:o}return n.call(this,t,i)})}))},function(e,t,n){"use strict";var r=n(23),i=n(15),o=n(24),a=n(349),s=n(348);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(23),i=n(182),o=n(347);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){n(191)("asyncIterator")},function(e,t,n){n(191)("observable")},function(e,t,n){n(613)("WeakMap")},function(e,t,n){n(614)("WeakMap")},function(e,t,n){var r=n(19)("unscopables"),i=Array.prototype;void 0==i[r]&&n(64)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(140),i=n(110),o=n(365);e.exports=function(e){return function(t,n,a){var s,u=r(t),l=i(u.length),c=o(a,l);if(e&&n!=n){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},function(e,t,n){var r=n(136),i=n(646),o=n(645),a=n(62),s=n(110),u=n(662),l={},c={},t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(h=s(e.length);h>_;_++)if((v=t?y(a(d=e[_])[0],d[1]):y(e[_]))===l||v===c)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=i(m,y,d.value,t))===l||v===c)return v};t.BREAK=l,t.RETURN=c},function(e,t,n){e.exports=!n(106)&&!n(107)(function(){return 7!=Object.defineProperty(n(196)("div"),"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(105);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(109),i=n(19)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(62);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){"use strict";var r=n(651),i=n(360),o=n(199),a={};n(64)(a,n(19)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(19)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(31),i=n(364).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(105)(a);e.exports=function(){var e,t,n,l=function(){var r,i;for(u&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(l)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve();n=function(){c.then(l)}}else n=function(){i.call(r,l)};else{var p=!0,f=document.createTextNode("");new o(l).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(62),i=n(652),o=n(352),a=n(200)("IE_PROTO"),s=function(){},u=function(){var e,t=n(196)("iframe"),r=o.length;for(t.style.display="none",n(353).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(138),i=n(62),o=n(357);e.exports=n(106)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(108),i=n(660),o=n(200)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(108),i=n(140),o=n(640)(!1),a=n(200)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,l=[];for(n in s)n!=a&&r(s,n)&&l.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(l,n)||l.push(n));return l}},function(e,t,n){var r=n(78);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e,t,n){"use strict";var r=n(31),i=n(138),o=n(106),a=n(19)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(139),i=n(57);e.exports=function(e){var t=String(i(this)),n="",o=r(e);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},function(e,t,n){var r=n(28),i=n(57),o=n(107),a=n(659),s="["+a+"]",u="​…",l=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),p=function(e,t,n){var i={},s=o(function(){return!!a[e]()||u[e]()!=u}),l=i[e]=s?t(f):a[e];n&&(i[n]=l),r(r.P+r.F*s,"String",i)},f=p.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(l,"")),2&t&&(e=e.replace(c,"")),e};e.exports=p},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){var r=n(57);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(77);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(195),i=n(19)("iterator"),o=n(109);e.exports=n(63).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";var r=n(638),i=n(649),o=n(109),a=n(140);e.exports=n(355)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";var r=n(195),i={};i[n(19)("toStringTag")]="z",i+""!="[object z]"&&n(78)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){"use strict";var r,i,o,a,s=n(356),u=n(31),l=n(136),c=n(195),p=n(28),f=n(77),h=n(135),d=n(639),m=n(641),v=n(362),g=n(364).set,y=n(650)(),_=n(198),b=n(358),x=n(359),w=u.TypeError,k=u.process,E=u.Promise,S="process"==c(k),C=function(){},A=i=_.f,D=!!function(){try{var e=E.resolve(1),t=(e.constructor={})[n(19)("species")]=function(e){e(C,C)};return(S||"function"==typeof PromiseRejectionEvent)&&e.then(C)instanceof t}catch(e){}}(),O=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},M=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,i=1==e._s,o=0;n.length>o;)!function(t){var n,o,a=i?t.ok:t.fail,s=t.resolve,u=t.reject,l=t.domain;try{a?(i||(2==e._h&&I(e),e._h=1),!0===a?n=r:(l&&l.enter(),n=a(r),l&&l.exit()),n===t.promise?u(w("Promise-chain cycle")):(o=O(n))?o.call(n,s,u):s(n)):u(r)}catch(e){u(e)}}(n[o++]);e._c=[],e._n=!1,t&&!e._h&&T(e)})}},T=function(e){g.call(u,function(){var t,n,r,i=e._v,o=P(e);if(o&&(t=b(function(){S?k.emit("unhandledRejection",i,e):(n=u.onunhandledrejection)?n({promise:e,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=S||P(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},P=function(e){return 1!==e._h&&0===(e._a||e._c).length},I=function(e){g.call(u,function(){var t;S?k.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},R=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),M(t,!0))},j=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw w("Promise can't be resolved itself");(t=O(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,l(j,r,1),l(R,r,1))}catch(e){R.call(r,e)}}):(n._v=e,n._s=1,M(n,!1))}catch(e){R.call({_w:n,_d:!1},e)}}};D||(E=function(e){d(this,E,"Promise","_h"),h(e),r.call(this);try{e(l(j,this,1),l(R,this,1))}catch(e){R.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(655)(E.prototype,{then:function(e,t){var n=A(v(this,E));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=S?k.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=l(j,e,1),this.reject=l(R,e,1)},_.f=A=function(e){return e===E||e===a?new o(e):i(e)}),p(p.G+p.W+p.F*!D,{Promise:E}),n(199)(E,"Promise"),n(656)("Promise"),a=n(63).Promise,p(p.S+p.F*!D,"Promise",{reject:function(e){var t=A(this);return(0,t.reject)(e),t.promise}}),p(p.S+p.F*(s||!D),"Promise",{resolve:function(e){return x(s&&this===a?E:this,e)}}),p(p.S+p.F*!(D&&n(648)(function(e){E.all(e).catch(C)})),"Promise",{all:function(e){var t=this,n=A(t),r=n.resolve,i=n.reject,o=b(function(){var n=[],o=0,a=1;m(e,!1,function(e){var s=o++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},i)}),--a||r(n)});return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=A(t),r=n.reject,i=b(function(){m(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t,n){n(137)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(137)("replace",2,function(e,t,n){return[function(r,i){"use strict";var o=e(this),a=void 0==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},n]})},function(e,t,n){n(137)("search",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},n]})},function(e,t,n){n(137)("split",2,function(e,t,r){"use strict";var i=n(354),o=r,a=[].push,s="length";if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[s]||2!="ab".split(/(?:ab)*/)[s]||4!=".".split(/(.?)(.?)/)[s]||".".split(/()()/)[s]>1||"".split(/.?/)[s]){var u=void 0===/()??/.exec("")[1];r=function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!i(e))return o.call(n,e,t);var r,l,c,p,f,h=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),m=0,v=void 0===t?4294967295:t>>>0,g=new RegExp(e.source,d+"g");for(u||(r=new RegExp("^"+g.source+"$(?!\\s)",d));(l=g.exec(n))&&!((c=l.index+l[0][s])>m&&(h.push(n.slice(m,l.index)),!u&&l[s]>1&&l[0].replace(r,function(){for(f=1;f<arguments[s]-2;f++)void 0===arguments[f]&&(l[f]=void 0)}),l[s]>1&&l.index<n[s]&&a.apply(h,l.slice(1)),p=l[0][s],m=c,h[s]>=v));)g.lastIndex===l.index&&g.lastIndex++;return m===n[s]?!p&&g.test("")||h.push(""):h.push(n.slice(m)),h[s]>v?h.slice(0,v):h}}else"0".split(void 0,0)[s]&&(r=function(e,t){return void 0===e&&0===t?[]:o.call(this,e,t)});return[function(n,i){var o=e(this),a=void 0==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(String(o),n,i)},r]})},function(e,t,n){"use strict";n(29)("anchor",function(e){return function(t){return e(this,"a","name",t)}})},function(e,t,n){"use strict";n(29)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(29)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(29)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";var r=n(28),i=n(363)(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(28),i=n(110),o=n(201),a="".endsWith;r(r.P+r.F*n(197)("endsWith"),"String",{endsWith:function(e){var t=o(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(t.length),s=void 0===n?r:Math.min(i(n),r),u=String(e);return a?a.call(t,u,s):t.slice(s-u.length,s)===u}})},function(e,t,n){"use strict";n(29)("fixed",function(e){return function(){return e(this,"tt","","")}})},function(e,t,n){"use strict";n(29)("fontcolor",function(e){return function(t){return e(this,"font","color",t)}})},function(e,t,n){"use strict";n(29)("fontsize",function(e){return function(t){return e(this,"font","size",t)}})},function(e,t,n){var r=n(28),i=n(365),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){"use strict";var r=n(28),i=n(201);r(r.P+r.F*n(197)("includes"),"String",{includes:function(e){return!!~i(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){"use strict";n(29)("italics",function(e){return function(){return e(this,"i","","")}})},function(e,t,n){"use strict";n(29)("link",function(e){return function(t){return e(this,"a","href",t)}})},function(e,t,n){var r=n(28),i=n(140),o=n(110);r(r.S,"String",{raw:function(e){for(var t=i(e.raw),n=o(t.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(t[s++])),s<r&&a.push(String(arguments[s]));return a.join("")}})},function(e,t,n){var r=n(28);r(r.P,"String",{repeat:n(657)})},function(e,t,n){"use strict";n(29)("small",function(e){return function(){return e(this,"small","","")}})},function(e,t,n){"use strict";var r=n(28),i=n(110),o=n(201),a="".startsWith;r(r.P+r.F*n(197)("startsWith"),"String",{startsWith:function(e){var t=o(this,e,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(29)("strike",function(e){return function(){return e(this,"strike","","")}})},function(e,t,n){"use strict";n(29)("sub",function(e){return function(){return e(this,"sub","","")}})},function(e,t,n){"use strict";n(29)("sup",function(e){return function(){return e(this,"sup","","")}})},function(e,t,n){"use strict";n(658)("trim",function(e){return function(){return e(this,3)}})},function(e,t,n){"use strict";var r=n(28),i=n(63),o=n(31),a=n(362),s=n(359);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(28),i=n(198),o=n(358);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){for(var r=n(663),i=n(357),o=n(78),a=n(31),s=n(64),u=n(109),l=n(19),c=l("iterator"),p=l("toStringTag"),f=u.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(h),m=0;m<d.length;m++){var v,g=d[m],y=h[g],_=a[g],b=_&&_.prototype;if(b&&(b[c]||s(b,c,f),b[p]||s(b,p,g),u[g]=f,y))for(v in r)b[v]||o(b,v,r[v],!0)}},function(e,t,n){"use strict";function r(e){return e}function i(e,t,n){function i(e,t){var n=y.hasOwnProperty(t)?y[t]:null;w.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function l(e,n){if(n){s("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,o=r.__reactAutoBindPairs;n.hasOwnProperty(u)&&_.mixins(e,n.mixins);for(var a in n)if(n.hasOwnProperty(a)&&a!==u){var l=n[a],c=r.hasOwnProperty(a);if(i(c,a),_.hasOwnProperty(a))_[a](e,l);else{var p=y.hasOwnProperty(a),d="function"==typeof l,m=d&&!p&&!c&&!1!==n.autobind;if(m)o.push(a,l),r[a]=l;else if(c){var v=y[a];s(p&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,a),"DEFINE_MANY_MERGED"===v?r[a]=f(r[a],l):"DEFINE_MANY"===v&&(r[a]=h(r[a],l))}else r[a]=l}}}else;}function c(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var i=n in _;s(!i,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var o=n in e;s(!o,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function p(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function f(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var i={};return p(i,n),p(i,r),i}}function h(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function d(e,t){var n=t.bind(e);return n}function m(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];e[r]=d(e,i)}}function v(e){var t=r(function(e,r,i){this.__reactAutoBindPairs.length&&m(this),this.props=e,this.context=r,this.refs=a,this.updater=i||n,this.state=null;var o=this.getInitialState?this.getInitialState():null;s("object"==typeof o&&!Array.isArray(o),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=o});t.prototype=new k,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],g.forEach(l.bind(null,t)),l(t,b),l(t,e),l(t,x),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),s(t.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var i in y)t.prototype[i]||(t.prototype[i]=null);return t}var g=[],y={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},_={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)l(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=o({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=o({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=f(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=o({},e.propTypes,t)},statics:function(e,t){c(e,t)},autobind:function(){}},b={componentDidMount:function(){this.__isMounted=!0}},x={componentWillUnmount:function(){this.__isMounted=!1}},w={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},k=function(){};return o(k.prototype,e.prototype,w),v}var o=n(13),a=n(144),s=n(8),u="mixins";e.exports=i},function(e,t){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return g.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function o(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function u(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}function l(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function c(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(g.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(g.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(g.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(g.arrayBuffer&&g.blob&&_(e))this._bodyArrayBuffer=c(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!g.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!b(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=c(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):g.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},g.blob&&(this.blob=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?o(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(l(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},g.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(e){var t=e.toUpperCase();return x.indexOf(t)>-1?t:e}function h(e,t){var n=(t=t||{}).body;if(e instanceof h){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=f(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function d(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function m(e){var t=new i;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}}),t}function v(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var g={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(g.arrayBuffer)var y=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],_=function(e){return e&&DataView.prototype.isPrototypeOf(e)},b=ArrayBuffer.isView||function(e){return e&&y.indexOf(Object.prototype.toString.call(e))>-1};i.prototype.append=function(e,r){e=t(e),r=n(r);var i=this.map[e];this.map[e]=i?i+","+r:r},i.prototype.delete=function(e){delete this.map[t(e)]},i.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,r){this.map[t(e)]=n(r)},i.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},g.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var x=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},p.call(h.prototype),p.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];v.redirect=function(e,t){if(-1===w.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=h,e.Response=v,e.fetch=function(e,t){return new Promise(function(n,r){var i=new h(e,t),o=new XMLHttpRequest;o.onload=function(){var e={status:o.status,statusText:o.statusText,headers:m(o.getAllResponseHeaders()||"")};e.url="responseURL"in o?o.responseURL:e.headers.get("X-Request-URL");var t="response"in o?o.response:o.responseText;n(new v(t,e))},o.onerror=function(){r(new TypeError("Network request failed"))},o.ontimeout=function(){r(new TypeError("Network request failed"))},o.open(i.method,i.url,!0),"include"===i.credentials&&(o.withCredentials=!0),"responseType"in o&&g.blob&&(o.responseType="blob"),i.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),o.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t){var n={};!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return g.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function o(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function u(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}function l(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function c(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(g.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(g.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(g.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(g.arrayBuffer&&g.blob&&_(e))this._bodyArrayBuffer=c(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!g.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!b(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=c(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):g.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},g.blob&&(this.blob=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?o(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(l(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},g.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(e){var t=e.toUpperCase();return x.indexOf(t)>-1?t:e}function h(e,t){var n=(t=t||{}).body;if(e instanceof h){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=f(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function d(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function m(e){var t=new i;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}}),t}function v(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var g={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(g.arrayBuffer)var y=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],_=function(e){return e&&DataView.prototype.isPrototypeOf(e)},b=ArrayBuffer.isView||function(e){return e&&y.indexOf(Object.prototype.toString.call(e))>-1};i.prototype.append=function(e,r){e=t(e),r=n(r);var i=this.map[e];this.map[e]=i?i+","+r:r},i.prototype.delete=function(e){delete this.map[t(e)]},i.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,r){this.map[t(e)]=n(r)},i.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},g.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var x=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},p.call(h.prototype),p.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},v.error=function(){var e=new v(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];v.redirect=function(e,t){if(-1===w.indexOf(t))throw new RangeError("Invalid status code");return new v(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=h,e.Response=v,e.fetch=function(e,t){return new Promise(function(n,r){var i=new h(e,t),o=new XMLHttpRequest;o.onload=function(){var e={status:o.status,statusText:o.statusText,headers:m(o.getAllResponseHeaders()||"")};e.url="responseURL"in o?o.responseURL:e.headers.get("X-Request-URL");var t="response"in o?o.response:o.responseText;n(new v(t,e))},o.onerror=function(){r(new TypeError("Network request failed"))},o.ontimeout=function(){r(new TypeError("Network request failed"))},o.open(i.method,i.url,!0),"include"===i.credentials&&(o.withCredentials=!0),"responseType"in o&&g.blob&&(o.responseType="blob"),i.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),o.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}}(void 0!==n?n:this),e.exports=n},function(e,t,n){(function(t){!function(t,n){e.exports=n(t)}(void 0!==t?t:this,function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),r=n.length,i=-1,o="",a=n.charCodeAt(0);++i<r;)t=n.charCodeAt(i),o+=0!=t?t>=1&&t<=31||127==t||0==i&&t>=48&&t<=57||1==i&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":(0!=i||1!=r||45!=t)&&(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?n.charAt(i):"\\"+n.charAt(i):"�";return o};return e.CSS||(e.CSS={}),e.CSS.escape=t,t})}).call(t,n(17))},function(e,t,n){function r(e,t){if(e){var n,r="";for(var i in e)n=e[i],r&&(r+=" "),!n&&p[i]?r+=i:r+=i+'="'+(t.decodeEntities?c.encodeXML(n):n)+'"';return r}}function i(e,t){"svg"===e.name&&(t={decodeEntities:t.decodeEntities,xmlMode:!0});var n="<"+e.name,i=r(e.attribs,t);return i&&(n+=" "+i),!t.xmlMode||e.children&&0!==e.children.length?(n+=">",e.children&&(n+=d(e.children,t)),h[e.name]&&!t.xmlMode||(n+="</"+e.name+">")):n+="/>",n}function o(e){return"<"+e.data+">"}function a(e,t){var n=e.data||"";return!t.decodeEntities||e.parent&&e.parent.name in f||(n=c.encodeXML(n)),n}function s(e){return"<![CDATA["+e.children[0].data+"]]>"}function u(e){return"\x3c!--"+e.data+"--\x3e"}var l=n(699),c=n(114),p={__proto__:null,allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,hidden:!0,ismap:!0,loop:!0,multiple:!0,muted:!0,open:!0,readonly:!0,required:!0,reversed:!0,scoped:!0,seamless:!0,selected:!0,typemustmatch:!0},f={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0},h={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},d=e.exports=function(e,t){Array.isArray(e)||e.cheerio||(e=[e]),t=t||{};for(var n="",r=0;r<e.length;r++){var c=e[r];"root"===c.type?n+=d(c.children,t):l.isTag(c)?n+=i(c,t):c.type===l.Directive?n+=o(c):c.type===l.Comment?n+=u(c):c.type===l.CDATA?n+=s(c):n+=a(c,t)}return n}},function(e,t){e.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",isTag:function(e){return"tag"===e.type||"script"===e.type||"style"===e.type}}},function(e,t,n){function r(e,t,n){"object"==typeof e?(n=t,t=e,e=null):"function"==typeof t&&(n=t,t=u),this._callback=e,this._options=t||u,this._elementCB=n,this.dom=[],this._done=!1,this._tagStack=[],this._parser=this._parser||null}var i=n(113),o=/\s+/g,a=n(368),s=n(701),u={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1};r.prototype.onparserinit=function(e){this._parser=e},r.prototype.onreset=function(){r.call(this,this._callback,this._options,this._elementCB)},r.prototype.onend=function(){this._done||(this._done=!0,this._parser=null,this._handleCallback(null))},r.prototype._handleCallback=r.prototype.onerror=function(e){if("function"==typeof this._callback)this._callback(e,this.dom);else if(e)throw e},r.prototype.onclosetag=function(){var e=this._tagStack.pop();this._options.withEndIndices&&(e.endIndex=this._parser.endIndex),this._elementCB&&this._elementCB(e)},r.prototype._createDomElement=function(e){if(!this._options.withDomLvl1)return e;var t;t="tag"===e.type?Object.create(s):Object.create(a);for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},r.prototype._addDomElement=function(e){var t=this._tagStack[this._tagStack.length-1],n=t?t.children:this.dom,r=n[n.length-1];e.next=null,this._options.withStartIndices&&(e.startIndex=this._parser.startIndex),this._options.withEndIndices&&(e.endIndex=this._parser.endIndex),r?(e.prev=r,r.next=e):e.prev=null,n.push(e),e.parent=t||null},r.prototype.onopentag=function(e,t){var n={type:"script"===e?i.Script:"style"===e?i.Style:i.Tag,name:e,attribs:t,children:[]},r=this._createDomElement(n);this._addDomElement(r),this._tagStack.push(r)},r.prototype.ontext=function(e){var t,n=this._options.normalizeWhitespace||this._options.ignoreWhitespace;if(!this._tagStack.length&&this.dom.length&&(t=this.dom[this.dom.length-1]).type===i.Text)n?t.data=(t.data+e).replace(o," "):t.data+=e;else if(this._tagStack.length&&(t=this._tagStack[this._tagStack.length-1])&&(t=t.children[t.children.length-1])&&t.type===i.Text)n?t.data=(t.data+e).replace(o," "):t.data+=e;else{n&&(e=e.replace(o," "));var r=this._createDomElement({data:e,type:i.Text});this._addDomElement(r)}},r.prototype.oncomment=function(e){var t=this._tagStack[this._tagStack.length-1];if(t&&t.type===i.Comment)return void(t.data+=e);var n={data:e,type:i.Comment},r=this._createDomElement(n);this._addDomElement(r),this._tagStack.push(r)},r.prototype.oncdatastart=function(){var e={children:[{data:"",type:i.Text}],type:i.CDATA},t=this._createDomElement(e);this._addDomElement(t),this._tagStack.push(t)},r.prototype.oncommentend=r.prototype.oncdataend=function(){this._tagStack.pop()},r.prototype.onprocessinginstruction=function(e,t){var n=this._createDomElement({name:e,data:t,type:i.Directive});this._addDomElement(n)},e.exports=r},function(e,t,n){var r=n(368),i=e.exports=Object.create(r),o={tagName:"name"};Object.keys(o).forEach(function(e){var t=o[e];Object.defineProperty(i,e,{get:function(){return this[t]||null},set:function(e){return this[t]=e,e}})})},function(e,t,n){var r=e.exports;[n(707),n(708),n(705),n(706),n(704),n(703)].forEach(function(e){Object.keys(e).forEach(function(t){r[t]=e[t].bind(r)})})},function(e,t){t.removeSubsets=function(e){for(var t,n,r,i=e.length;--i>-1;){for(t=n=e[i],e[i]=null,r=!0;n;){if(e.indexOf(n)>-1){r=!1,e.splice(i,1);break}n=n.parent}r&&(e[i]=t)}return e};var n={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},r=t.compareDocumentPosition=function(e,t){var r,i,o,a,s,u,l=[],c=[];if(e===t)return 0;for(r=e;r;)l.unshift(r),r=r.parent;for(r=t;r;)c.unshift(r),r=r.parent;for(u=0;l[u]===c[u];)u++;return 0===u?n.DISCONNECTED:(i=l[u-1],o=i.children,a=l[u],s=c[u],o.indexOf(a)>o.indexOf(s)?i===t?n.FOLLOWING|n.CONTAINED_BY:n.FOLLOWING:i===e?n.PRECEDING|n.CONTAINS:n.PRECEDING)};t.uniqueSort=function(e){var t,i,o=e.length;for(e=e.slice();--o>-1;)t=e[o],(i=e.indexOf(t))>-1&&i<o&&e.splice(o,1);return e.sort(function(e,t){var i=r(e,t);return i&n.PRECEDING?-1:i&n.FOLLOWING?1:0}),e}},function(e,t,n){function r(e,t){return"function"==typeof t?function(n){return n.attribs&&t(n.attribs[e])}:function(n){return n.attribs&&n.attribs[e]===t}}function i(e,t){return function(n){return e(n)||t(n)}}var o=n(113),a=t.isTag=o.isTag;t.testElement=function(e,t){for(var n in e)if(e.hasOwnProperty(n)){if("tag_name"===n){if(!a(t)||!e.tag_name(t.name))return!1}else if("tag_type"===n){if(!e.tag_type(t.type))return!1}else if("tag_contains"===n){if(a(t)||!e.tag_contains(t.data))return!1}else if(!t.attribs||!e[n](t.attribs[n]))return!1}else;return!0};var s={tag_name:function(e){return"function"==typeof e?function(t){return a(t)&&e(t.name)}:"*"===e?a:function(t){return a(t)&&t.name===e}},tag_type:function(e){return"function"==typeof e?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return"function"==typeof e?function(t){return!a(t)&&e(t.data)}:function(t){return!a(t)&&t.data===e}}};t.getElements=function(e,t,n,o){var a=Object.keys(e).map(function(t){var n=e[t];return t in s?s[t](n):r(t,n)});return 0===a.length?[]:this.filter(a.reduce(i),t,n,o)},t.getElementById=function(e,t,n){return Array.isArray(t)||(t=[t]),this.findOne(r("id",e),t,!1!==n)},t.getElementsByTagName=function(e,t,n,r){return this.filter(s.tag_name(e),t,n,r)},t.getElementsByTagType=function(e,t,n,r){return this.filter(s.tag_type(e),t,n,r)}},function(e,t){t.removeElement=function(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children;t.splice(t.lastIndexOf(e),1)}},t.replaceElement=function(e,t){var n=t.prev=e.prev;n&&(n.next=t);var r=t.next=e.next;r&&(r.prev=t);var i=t.parent=e.parent;if(i){var o=i.children;o[o.lastIndexOf(e)]=t}},t.appendChild=function(e,t){if(t.parent=e,1!==e.children.push(t)){var n=e.children[e.children.length-2];n.next=t,t.prev=n,t.next=null}},t.append=function(e,t){var n=e.parent,r=e.next;if(t.next=r,t.prev=e,e.next=t,t.parent=n,r){if(r.prev=t,n){var i=n.children;i.splice(i.lastIndexOf(r),0,t)}}else n&&n.children.push(t)},t.prepend=function(e,t){var n=e.parent;if(n){var r=n.children;r.splice(r.lastIndexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=n,t.prev=e.prev,t.next=e,e.prev=t}},function(e,t,n){function r(e,t,n,r){return Array.isArray(t)||(t=[t]),"number"==typeof r&&isFinite(r)||(r=1/0),i(e,t,!1!==n,r)}function i(e,t,n,r){for(var o,a=[],s=0,u=t.length;s<u&&!(e(t[s])&&(a.push(t[s]),--r<=0))&&(o=t[s].children,!(n&&o&&o.length>0&&(o=i(e,o,n,r),a=a.concat(o),(r-=o.length)<=0)));s++);return a}function o(e,t){for(var n=0,r=t.length;n<r;n++)if(e(t[n]))return t[n];return null}function a(e,t){for(var n=null,r=0,i=t.length;r<i&&!n;r++)l(t[r])&&(e(t[r])?n=t[r]:t[r].children.length>0&&(n=a(e,t[r].children)));return n}function s(e,t){for(var n=0,r=t.length;n<r;n++)if(l(t[n])&&(e(t[n])||t[n].children.length>0&&s(e,t[n].children)))return!0;return!1}function u(e,t){for(var n=[],r=[t];r.length;){for(var i=r.pop(),o=0,a=i.length;o<a;o++)l(i[o])&&e(i[o])&&n.push(i[o]);for(;a-- >0;)i[a].children&&i[a].children.length>0&&r.push(i[a].children)}return n}var l=n(113).isTag;e.exports={filter:r,find:i,findOneChild:o,findOne:a,existsOne:s,findAll:u}},function(e,t,n){function r(e,t){return e.children?e.children.map(function(e){return a(e,t)}).join(""):""}function i(e){return Array.isArray(e)?e.map(i).join(""):s(e)?"br"===e.name?"\n":i(e.children):e.type===o.CDATA?i(e.children):e.type===o.Text?e.data:""}var o=n(113),a=n(698),s=o.isTag;e.exports={getInnerHTML:r,getOuterHTML:a,getText:i}},function(e,t){var n=t.getChildren=function(e){return e.children},r=t.getParent=function(e){return e.parent};t.getSiblings=function(e){var t=r(e);return t?n(t):[e]},t.getAttributeValue=function(e,t){return e.attribs&&e.attribs[t]},t.hasAttrib=function(e,t){return!!e.attribs&&hasOwnProperty.call(e.attribs,t)},t.getName=function(e){return e.name}},function(e,t,n){"use strict";var r=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})};e.exports=r},function(e,t,n){function r(e){var t=Object.keys(e).join("|"),n=o(e);t+="|#[xX][\\da-fA-F]+|#\\d+";var r=new RegExp("&(?:"+t+");","g");return function(e){return String(e).replace(r,n)}}function i(e,t){return e<t?1:-1}function o(e){return function(t){return"#"===t.charAt(1)?l("X"===t.charAt(2)||"x"===t.charAt(2)?parseInt(t.substr(3),16):parseInt(t.substr(2),10)):e[t.slice(1,-1)]}}var a=n(204),s=n(370),u=n(205),l=n(369),c=r(u),p=r(a),f=function(){function e(e){return";"!==e.substr(-1)&&(e+=";"),c(e)}for(var t=Object.keys(s).sort(i),n=Object.keys(a).sort(i),r=0,u=0;r<n.length;r++)t[u]===n[r]?(n[r]+=";?",u++):n[r]+=";";var l=new RegExp("&(?:"+n.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),c=o(a);return function(t){return String(t).replace(l,e)}}();e.exports={XML:c,HTML:f,HTMLStrict:p}},function(e,t,n){function r(e){return Object.keys(e).sort().reduce(function(t,n){return t[e[n]]="&"+n+";",t},{})}function i(e){var t=[],n=[];return Object.keys(e).forEach(function(e){1===e.length?t.push("\\"+e):n.push(e)}),n.unshift("["+t.join("")+"]"),new RegExp(n.join("|"),"g")}function o(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function a(e){return"&#x"+(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536).toString(16).toUpperCase()+";"}function s(e,t){function n(t){return e[t]}return function(e){return e.replace(t,n).replace(d,a).replace(h,o)}}function u(e){return e.replace(m,o).replace(d,a).replace(h,o)}var l=r(n(205)),c=i(l);t.XML=s(l,c);var p=r(n(204)),f=i(p);t.HTML=s(p,f);var h=/[^\0-\x7F]/g,d=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,m=i(l);t.escape=u},function(e,t){e.exports={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}},function(e,t,n){"use strict";e.exports=function(){var e,t,n=Array.from;return"function"==typeof n&&(e=["raz","dwa"],t=n(e),Boolean(t&&t!==e&&"dwa"===t[1]))}},function(e,t,n){"use strict";var r=n(738).iterator,i=n(717),o=n(718),a=n(65),s=n(58),u=n(115),l=n(79),c=n(737),p=Array.isArray,f=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(e){var t,n,m,v,g,y,_,b,x,w,k=arguments[1],E=arguments[2];if(e=Object(u(e)),l(k)&&s(k),this&&this!==Array&&o(this))t=this;else{if(!k){if(i(e))return 1!==(g=e.length)?Array.apply(null,e):(v=new Array(1),v[0]=e[0],v);if(p(e)){for(v=new Array(g=e.length),n=0;n<g;++n)v[n]=e[n];return v}}v=[]}if(!p(e))if(void 0!==(x=e[r])){for(_=s(x).call(e),t&&(v=new t),b=_.next(),n=0;!b.done;)w=k?f.call(k,E,b.value,n):b.value,t?(h.value=w,d(v,n,h)):v[n]=w,b=_.next(),++n;g=n}else if(c(e)){for(g=e.length,t&&(v=new t),n=0,m=0;n<g;++n)w=e[n],n+1<g&&(y=w.charCodeAt(0))>=55296&&y<=56319&&(w+=e[++n]),w=k?f.call(k,E,w,m):w,t?(h.value=w,d(v,m,h)):v[m]=w,++m;g=m}if(void 0===g)for(g=a(e.length),t&&(v=new t(g)),n=0;n<g;++n)w=k?f.call(k,E,e[n],n):e[n],t?(h.value=w,d(v,n,h)):v[n]=w;return t&&(h.value=null,v.length=g),v}},function(e,t,n){"use strict";var r=n(207),i=Array.isArray;e.exports=function(e){return i(e)?e:r(e)}},function(e,t,n){"use strict";var r=n(373),i=n(730),o=n(79),a=Error.captureStackTrace;t=e.exports=function(e){var n=new Error(e),s=arguments[1],u=arguments[2];return o(u)||i(s)&&(u=s,s=null),o(u)&&r(n,u),o(s)&&(n.code=s),a&&a(n,t),n}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===i}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call(n(372));e.exports=function(e){return"function"==typeof e&&r.call(e)===i}},function(e,t,n){"use strict";e.exports=n(720)()?Math.sign:n(721)},function(e,t,n){"use strict";e.exports=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}},function(e,t,n){"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},function(e,t,n){"use strict";e.exports=n(723)()?Number.isNaN:n(724)},function(e,t,n){"use strict";e.exports=function(){var e=Number.isNaN;return"function"==typeof e&&(!e({})&&e(NaN)&&!e(34))}},function(e,t,n){"use strict";e.exports=function(e){return e!==e}},function(e,t,n){"use strict";var r=n(719),i=Math.abs,o=Math.floor;e.exports=function(e){return isNaN(e)?0:(e=Number(e),0!==e&&isFinite(e)?r(e)*o(i(e)):e)}},function(e,t,n){"use strict";var r=n(58),i=n(115),o=Function.prototype.bind,a=Function.prototype.call,s=Object.keys,u=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,l){var c,p=arguments[2],f=arguments[3];return n=Object(i(n)),r(l),c=s(n),f&&c.sort("function"==typeof f?o.call(f,n):void 0),"function"!=typeof e&&(e=c[e]),a.call(e,c,function(e,r){return u.call(n,e)?a.call(l,p,n[e],e,n,r):t})}}},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(e={foo:"raz"},t(e,{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var r=n(731),i=n(115),o=Math.max;e.exports=function(e,t){var n,a,s,u=o(arguments.length,2);for(e=Object(i(e)),s=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},a=1;a<u;++a)t=arguments[a],r(t).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=function(e){return"function"==typeof e}},function(e,t,n){"use strict";var r=n(79),i={function:!0,object:!0};e.exports=function(e){return r(e)&&i[typeof e]||!1}},function(e,t,n){"use strict";e.exports=n(732)()?Object.keys:n(733)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var r=n(79),i=Object.keys;e.exports=function(e){return i(r(e)?Object(e):e)}},function(e,t,n){"use strict";e.exports=n(735)()?String.prototype.contains:n(736)},function(e,t,n){"use strict";var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(e,t,n){"use strict";var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===i)||!1}},function(e,t,n){"use strict";e.exports=n(739)()?Symbol:n(741)},function(e,t,n){"use strict";var r={object:!0,symbol:!0};e.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{String(e)}catch(e){return!1}return!!r[typeof Symbol.iterator]&&(!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag])}},function(e,t,n){"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},function(e,t,n){"use strict";var r,i,o,a,s=n(141),u=n(742),l=Object.create,c=Object.defineProperties,p=Object.defineProperty,f=Object.prototype,h=l(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),a=!0}catch(e){}}var d=function(){var e=l(null);return function(t){for(var n,r,i=0;e[t+(i||"")];)++i;return t+=i||"",e[t]=!0,n="@@"+t,p(f,n,s.gs(null,function(e){r||(r=!0,p(this,n,s(e)),r=!1)})),n}}();o=function(e){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(e)},e.exports=i=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return a?r(t):(n=l(o.prototype),t=void 0===t?"":String(t),c(n,{__description__:s("",t),__name__:s("",d(t))}))},c(i,{for:s(function(e){return h[e]?h[e]:h[e]=i(String(e))}),keyFor:s(function(e){var t;u(e);for(t in h)if(h[t]===e)return t}),hasInstance:s("",r&&r.hasInstance||i("hasInstance")),isConcatSpreadable:s("",r&&r.isConcatSpreadable||i("isConcatSpreadable")),iterator:s("",r&&r.iterator||i("iterator")),match:s("",r&&r.match||i("match")),replace:s("",r&&r.replace||i("replace")),search:s("",r&&r.search||i("search")),species:s("",r&&r.species||i("species")),split:s("",r&&r.split||i("split")),toPrimitive:s("",r&&r.toPrimitive||i("toPrimitive")),toStringTag:s("",r&&r.toStringTag||i("toStringTag")),unscopables:s("",r&&r.unscopables||i("unscopables"))}),c(o.prototype,{constructor:s(i),toString:s("",function(){return this.__name__})}),c(i.prototype,{toString:s(function(){return"Symbol ("+u(this).__description__+")"}),valueOf:s(function(){return u(this)})}),p(i.prototype,i.toPrimitive,s("",function(){var e=u(this);return"symbol"==typeof e?e:e.toString()})),p(i.prototype,i.toStringTag,s("c","Symbol")),p(o.prototype,i.toStringTag,s("c",i.prototype[i.toStringTag])),p(o.prototype,i.toPrimitive,s("c",i.prototype[i.toPrimitive]))},function(e,t,n){"use strict";var r=n(740);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e,t,n){var r=null,i=function(e,t){n&&n(e,t),r&&r.visit(e,t)},o="function"==typeof n?i:null,a=!1;if(t){a="boolean"==typeof t.comment&&t.comment;var c="boolean"==typeof t.attachComment&&t.attachComment;(a||c)&&(r=new s.CommentHandler,r.attach=c,t.comment=!0,o=i)}var p=!1;t&&"string"==typeof t.sourceType&&(p="module"===t.sourceType);var f;f=t&&"boolean"==typeof t.jsx&&t.jsx?new u.JSXParser(e,t,o):new l.Parser(e,t,o);var h=p?f.parseModule():f.parseScript(),d=h;return a&&r&&(d.comments=r.comments),f.config.tokens&&(d.tokens=f.tokens),f.config.tolerant&&(d.errors=f.errorHandler.errors),d}function i(e,t,n){var i=t||{};return i.sourceType="module",r(e,i,n)}function o(e,t,n){var i=t||{};return i.sourceType="script",r(e,i,n)}function a(e,t,n){var r,i=new c.Tokenizer(e,t);r=[];try{for(;;){var o=i.getNextToken();if(!o)break;n&&(o=n(o)),r.push(o)}}catch(e){i.errorHandler.tolerate(e)}return i.errorHandler.tolerant&&(r.errors=i.errors()),r}Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),u=n(3),l=n(8),c=n(15);t.parse=r,t.parseModule=i,t.parseScript=o,t.tokenize=a;var p=n(2);t.Syntax=p.Syntax,t.version="4.0.0"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(){function e(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return e.prototype.insertInnerComments=function(e,t){if(e.type===r.Syntax.BlockStatement&&0===e.body.length){for(var n=[],i=this.leading.length-1;i>=0;--i){var o=this.leading[i];t.end.offset>=o.start&&(n.unshift(o.comment),this.leading.splice(i,1),this.trailing.splice(i,1))}n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e){var t=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var r=this.trailing[n];r.start>=e.end.offset&&t.unshift(r.comment)}return this.trailing.length=0,t}var i=this.stack[this.stack.length-1];if(i&&i.node.trailingComments){var o=i.node.trailingComments[0];o&&o.range[0]>=e.end.offset&&(t=i.node.trailingComments,delete i.node.trailingComments)}return t},e.prototype.findLeadingComments=function(e){for(var t,n=[];this.stack.length>0;){var r=this.stack[this.stack.length-1];if(!(r&&r.start>=e.start.offset))break;t=r.node,this.stack.pop()}if(t){for(var i=t.leadingComments?t.leadingComments.length:0,o=i-1;o>=0;--o){var a=t.leadingComments[o];a.range[1]<=e.start.offset&&(n.unshift(a),t.leadingComments.splice(o,1))}return t.leadingComments&&0===t.leadingComments.length&&delete t.leadingComments,n}for(var o=this.leading.length-1;o>=0;--o){var r=this.leading[o];r.start<=e.start.offset&&(n.unshift(r.comment),this.leading.splice(o,1))}return n},e.prototype.visitNode=function(e,t){if(!(e.type===r.Syntax.Program&&e.body.length>0)){this.insertInnerComments(e,t);var n=this.findTrailingComments(t),i=this.findLeadingComments(t);i.length>0&&(e.leadingComments=i),n.length>0&&(e.trailingComments=n),this.stack.push({node:e,start:t.start.offset})}},e.prototype.visitComment=function(e,t){var n="L"===e.type[0]?"Line":"Block",r={type:n,value:e.value};if(e.range&&(r.range=e.range),e.loc&&(r.loc=e.loc),this.comments.push(r),this.attach){var i={comment:{type:n,value:e.value,range:[t.start.offset,t.end.offset]},start:t.start.offset};e.loc&&(i.comment.loc=e.loc),e.type=n,this.leading.push(i),this.trailing.push(i)}},e.prototype.visit=function(e,t){"LineComment"===e.type?this.visitComment(e,t):"BlockComment"===e.type?this.visitComment(e,t):this.attach&&this.visitNode(e,t)},e}();t.CommentHandler=i},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,n){"use strict";function r(e){var t;switch(e.type){case s.JSXSyntax.JSXIdentifier:t=e.name;break;case s.JSXSyntax.JSXNamespacedName:var n=e;t=r(n.namespace)+":"+r(n.name);break;case s.JSXSyntax.JSXMemberExpression:var i=e;t=r(i.object)+"."+r(i.property)}return t}var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),a=n(5),s=n(6),u=n(7),l=n(8),c=n(13),p=n(14);c.TokenName[100]="JSXIdentifier",c.TokenName[101]="JSXText";var f=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return i(t,e),t.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():e.prototype.parsePrimaryExpression.call(this)},t.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},t.prototype.finishJSX=function(){this.nextToken()},t.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},t.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.scanXHTMLEntity=function(e){for(var t="&",n=!0,r=!1,i=!1,a=!1;!this.scanner.eof()&&n&&!r;){var s=this.scanner.source[this.scanner.index];if(s===e)break;if(r=";"===s,t+=s,++this.scanner.index,!r)switch(t.length){case 2:i="#"===s;break;case 3:i&&(a="x"===s,n=a||o.Character.isDecimalDigit(s.charCodeAt(0)),i=i&&!a);break;default:n=n&&!(i&&!o.Character.isDecimalDigit(s.charCodeAt(0))),n=n&&!(a&&!o.Character.isHexDigit(s.charCodeAt(0)))}}if(n&&r&&t.length>2){var u=t.substr(1,t.length-2);i&&u.length>1?t=String.fromCharCode(parseInt(u.substr(1),10)):a&&u.length>2?t=String.fromCharCode(parseInt("0"+u.substr(1),16)):i||a||!p.XHTMLEntities[u]||(t=p.XHTMLEntities[u])}return t},t.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e){var t=this.scanner.source[this.scanner.index++];return{type:7,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(34===e||39===e){for(var n=this.scanner.index,r=this.scanner.source[this.scanner.index++],i="";!this.scanner.eof();){var a=this.scanner.source[this.scanner.index++];if(a===r)break;i+="&"===a?this.scanXHTMLEntity(r):a}return{type:8,value:i,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(46===e){var s=this.scanner.source.charCodeAt(this.scanner.index+1),u=this.scanner.source.charCodeAt(this.scanner.index+2),t=46===s&&46===u?"...":".",n=this.scanner.index;return this.scanner.index+=t.length,{type:7,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(96===e)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(o.Character.isIdentifierStart(e)&&92!==e){var n=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var a=this.scanner.source.charCodeAt(this.scanner.index);if(o.Character.isIdentifierPart(a)&&92!==a)++this.scanner.index;else{if(45!==a)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(n,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}return this.scanner.lex()},t.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},t.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var e=this.scanner.index,t="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,t+=n,o.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var r={type:101,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return t.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(r)),r},t.prototype.peekJSXToken=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.lexJSX();return this.scanner.restoreState(e),t},t.prototype.expectJSX=function(e){var t=this.nextJSXToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},t.prototype.matchJSX=function(e){var t=this.peekJSXToken();return 7===t.type&&t.value===e},t.prototype.parseJSXIdentifier=function(){var e=this.createJSXNode(),t=this.nextJSXToken();return 100!==t.type&&this.throwUnexpectedToken(t),this.finalize(e,new a.JSXIdentifier(t.value))},t.prototype.parseJSXElementName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=t;this.expectJSX(":");var r=this.parseJSXIdentifier();t=this.finalize(e,new a.JSXNamespacedName(n,r))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var i=t;this.expectJSX(".");var o=this.parseJSXIdentifier();t=this.finalize(e,new a.JSXMemberExpression(i,o))}return t},t.prototype.parseJSXAttributeName=function(){var e,t=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=n;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new a.JSXNamespacedName(r,i))}else e=n;return e},t.prototype.parseJSXStringLiteralAttribute=function(){var e=this.createJSXNode(),t=this.nextJSXToken();8!==t.type&&this.throwUnexpectedToken(t);var n=this.getTokenRaw(t);return this.finalize(e,new u.Literal(t.value,n))},t.prototype.parseJSXExpressionAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new a.JSXExpressionContainer(t))},t.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},t.prototype.parseJSXNameValueAttribute=function(){var e=this.createJSXNode(),t=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(e,new a.JSXAttribute(t,n))},t.prototype.parseJSXSpreadAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new a.JSXSpreadAttribute(t))},t.prototype.parseJSXAttributes=function(){for(var e=[];!this.matchJSX("/")&&!this.matchJSX(">");){var t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();e.push(t)}return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),n=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new a.JSXOpeningElement(t,r,n))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new a.JSXClosingElement(t))}var n=this.parseJSXElementName(),r=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new a.JSXOpeningElement(n,i,r))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(e,new a.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e=this.createJSXNode();this.expectJSX("{");var t;return this.matchJSX("}")?(t=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),t=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(e,new a.JSXExpressionContainer(t))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.start<n.end){var r=this.getTokenRaw(n),i=this.finalize(t,new a.JSXText(n.value,r));e.push(i)}if("{"!==this.scanner.source[this.scanner.index])break;var o=this.parseJSXExpressionContainer();e.push(o)}return e},t.prototype.parseComplexJSXElement=function(e){for(var t=[];!this.scanner.eof();){e.children=e.children.concat(this.parseJSXChildren());var n=this.createJSXChildNode(),i=this.parseJSXBoundaryElement();if(i.type===s.JSXSyntax.JSXOpeningElement){var o=i;if(o.selfClosing){var u=this.finalize(n,new a.JSXElement(o,[],null));e.children.push(u)}else t.push(e),e={node:n,opening:o,closing:null,children:[]}}if(i.type===s.JSXSyntax.JSXClosingElement){e.closing=i;var l=r(e.opening.name);if(l!==r(e.closing.name)&&this.tolerateError("Expected corresponding JSX closing tag for %0",l),!(t.length>0))break;var u=this.finalize(e.node,new a.JSXElement(e.opening,e.children,e.closing));e=t[t.length-1],e.children.push(u),t.pop()}}return e},t.prototype.parseJSXElement=function(){var e=this.createJSXNode(),t=this.parseJSXOpeningElement(),n=[],r=null;if(!t.selfClosing){var i=this.parseComplexJSXElement({node:e,opening:t,closing:r,children:n});n=i.children,r=i.closing}return this.finalize(e,new a.JSXElement(t,n,r))},t.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var e=this.parseJSXElement();return this.finishJSX(),e},t.prototype.isStartOfExpression=function(){return e.prototype.isStartOfExpression.call(this)||this.match("<")},t}(l.Parser);t.JSXParser=f},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&n.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&n.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return e>=48&&e<=57},isHexDigit:function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},isOctalDigit:function(e){return e>=48&&e<=55}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),i=function(){function e(e){this.type=r.JSXSyntax.JSXClosingElement,this.name=e}return e}();t.JSXClosingElement=i;var o=function(){function e(e,t,n){this.type=r.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n}return e}();t.JSXElement=o;var a=function(){function e(){this.type=r.JSXSyntax.JSXEmptyExpression}return e}();t.JSXEmptyExpression=a;var s=function(){function e(e){this.type=r.JSXSyntax.JSXExpressionContainer,this.expression=e}return e}();t.JSXExpressionContainer=s;var u=function(){function e(e){this.type=r.JSXSyntax.JSXIdentifier,this.name=e}return e}();t.JSXIdentifier=u;var l=function(){function e(e,t){this.type=r.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t}return e}();t.JSXMemberExpression=l;var c=function(){function e(e,t){this.type=r.JSXSyntax.JSXAttribute,this.name=e,this.value=t}return e}();t.JSXAttribute=c;var p=function(){function e(e,t){this.type=r.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t}return e}();t.JSXNamespacedName=p;var f=function(){function e(e,t,n){this.type=r.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n}return e}();t.JSXOpeningElement=f;var h=function(){function e(e){this.type=r.JSXSyntax.JSXSpreadAttribute,this.argument=e}return e}();t.JSXSpreadAttribute=h;var d=function(){function e(e,t){this.type=r.JSXSyntax.JSXText,this.value=e,this.raw=t}return e}();t.JSXText=d},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(){function e(e){this.type=r.Syntax.ArrayExpression,this.elements=e}return e}();t.ArrayExpression=i;var o=function(){function e(e){this.type=r.Syntax.ArrayPattern,this.elements=e}return e}();t.ArrayPattern=o;var a=function(){function e(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!1}return e}();t.ArrowFunctionExpression=a;var s=function(){function e(e,t,n){this.type=r.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n}return e}();t.AssignmentExpression=s;var u=function(){function e(e,t){this.type=r.Syntax.AssignmentPattern,this.left=e,this.right=t}return e}();t.AssignmentPattern=u;var l=function(){function e(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!0}return e}();t.AsyncArrowFunctionExpression=l;var c=function(){function e(e,t,n){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}return e}();t.AsyncFunctionDeclaration=c;var p=function(){function e(e,t,n){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}return e}();t.AsyncFunctionExpression=p;var f=function(){function e(e){this.type=r.Syntax.AwaitExpression,this.argument=e}return e}();t.AwaitExpression=f;var h=function(){function e(e,t,n){var i="||"===e||"&&"===e;this.type=i?r.Syntax.LogicalExpression:r.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=n}return e}();t.BinaryExpression=h;var d=function(){function e(e){this.type=r.Syntax.BlockStatement,this.body=e}return e}();t.BlockStatement=d;var m=function(){function e(e){this.type=r.Syntax.BreakStatement,this.label=e}return e}();t.BreakStatement=m;var v=function(){function e(e,t){this.type=r.Syntax.CallExpression,this.callee=e,this.arguments=t}return e}();t.CallExpression=v;var g=function(){function e(e,t){this.type=r.Syntax.CatchClause,this.param=e,this.body=t}return e}();t.CatchClause=g;var y=function(){function e(e){this.type=r.Syntax.ClassBody,this.body=e}return e}();t.ClassBody=y;var _=function(){function e(e,t,n){this.type=r.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n}return e}();t.ClassDeclaration=_;var b=function(){function e(e,t,n){this.type=r.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n}return e}();t.ClassExpression=b;var x=function(){function e(e,t){this.type=r.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t}return e}();t.ComputedMemberExpression=x;var w=function(){function e(e,t,n){this.type=r.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n}return e}();t.ConditionalExpression=w;var k=function(){function e(e){this.type=r.Syntax.ContinueStatement,this.label=e}return e}();t.ContinueStatement=k;var E=function(){function e(){this.type=r.Syntax.DebuggerStatement}return e}();t.DebuggerStatement=E;var S=function(){function e(e,t){this.type=r.Syntax.ExpressionStatement,this.expression=e,this.directive=t}return e}();t.Directive=S;var C=function(){function e(e,t){this.type=r.Syntax.DoWhileStatement,this.body=e,this.test=t}return e}();t.DoWhileStatement=C;var A=function(){function e(){this.type=r.Syntax.EmptyStatement}return e}();t.EmptyStatement=A;var D=function(){function e(e){this.type=r.Syntax.ExportAllDeclaration,this.source=e}return e}();t.ExportAllDeclaration=D;var O=function(){function e(e){this.type=r.Syntax.ExportDefaultDeclaration,this.declaration=e}return e}();t.ExportDefaultDeclaration=O;var M=function(){function e(e,t,n){this.type=r.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n}return e}();t.ExportNamedDeclaration=M;var T=function(){function e(e,t){this.type=r.Syntax.ExportSpecifier,this.exported=t,this.local=e}return e}();t.ExportSpecifier=T;var P=function(){function e(e){this.type=r.Syntax.ExpressionStatement,this.expression=e}return e}();t.ExpressionStatement=P;var I=function(){function e(e,t,n){this.type=r.Syntax.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1}return e}();t.ForInStatement=I;var R=function(){function e(e,t,n){this.type=r.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n}return e}();t.ForOfStatement=R;var j=function(){function e(e,t,n,i){this.type=r.Syntax.ForStatement,this.init=e,this.test=t,this.update=n,this.body=i}return e}();t.ForStatement=j;var F=function(){function e(e,t,n,i){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1,this.async=!1}return e}();t.FunctionDeclaration=F;var N=function(){function e(e,t,n,i){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1,this.async=!1}return e}();t.FunctionExpression=N;var B=function(){function e(e){this.type=r.Syntax.Identifier,this.name=e}return e}();t.Identifier=B;var L=function(){function e(e,t,n){this.type=r.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n}return e}();t.IfStatement=L;var q=function(){function e(e,t){this.type=r.Syntax.ImportDeclaration,this.specifiers=e,this.source=t}return e}();t.ImportDeclaration=q;var z=function(){function e(e){this.type=r.Syntax.ImportDefaultSpecifier,this.local=e}return e}();t.ImportDefaultSpecifier=z;var U=function(){function e(e){this.type=r.Syntax.ImportNamespaceSpecifier,this.local=e}return e}();t.ImportNamespaceSpecifier=U;var W=function(){function e(e,t){this.type=r.Syntax.ImportSpecifier,this.local=e,this.imported=t}return e}();t.ImportSpecifier=W;var V=function(){function e(e,t){this.type=r.Syntax.LabeledStatement,this.label=e,this.body=t}return e}();t.LabeledStatement=V;var H=function(){function e(e,t){this.type=r.Syntax.Literal,this.value=e,this.raw=t}return e}();t.Literal=H;var G=function(){function e(e,t){this.type=r.Syntax.MetaProperty,this.meta=e,this.property=t}return e}();t.MetaProperty=G;var J=function(){function e(e,t,n,i,o){this.type=r.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=i,this.static=o}return e}();t.MethodDefinition=J;var K=function(){function e(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="module"}return e}();t.Module=K;var X=function(){function e(e,t){this.type=r.Syntax.NewExpression,this.callee=e,this.arguments=t}return e}();t.NewExpression=X;var Y=function(){function e(e){this.type=r.Syntax.ObjectExpression,this.properties=e}return e}();t.ObjectExpression=Y;var $=function(){function e(e){this.type=r.Syntax.ObjectPattern,this.properties=e}return e}();t.ObjectPattern=$;var Z=function(){function e(e,t,n,i,o,a){this.type=r.Syntax.Property,this.key=t,this.computed=n,this.value=i,this.kind=e,this.method=o,this.shorthand=a}return e}();t.Property=Z;var Q=function(){function e(e,t,n,i){this.type=r.Syntax.Literal,this.value=e,this.raw=t,this.regex={pattern:n,flags:i}}return e}();t.RegexLiteral=Q;var ee=function(){function e(e){this.type=r.Syntax.RestElement,this.argument=e}return e}();t.RestElement=ee;var te=function(){function e(e){this.type=r.Syntax.ReturnStatement,this.argument=e}return e}();t.ReturnStatement=te;var ne=function(){function e(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="script"}return e}();t.Script=ne;var re=function(){function e(e){this.type=r.Syntax.SequenceExpression,this.expressions=e}return e}();t.SequenceExpression=re;var ie=function(){function e(e){this.type=r.Syntax.SpreadElement,this.argument=e}return e}();t.SpreadElement=ie;var oe=function(){function e(e,t){this.type=r.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t}return e}();t.StaticMemberExpression=oe;var ae=function(){function e(){this.type=r.Syntax.Super}return e}();t.Super=ae;var se=function(){function e(e,t){this.type=r.Syntax.SwitchCase,this.test=e,this.consequent=t}return e}();t.SwitchCase=se;var ue=function(){function e(e,t){this.type=r.Syntax.SwitchStatement,this.discriminant=e,this.cases=t}return e}();t.SwitchStatement=ue;var le=function(){function e(e,t){this.type=r.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t}return e}();t.TaggedTemplateExpression=le;var ce=function(){function e(e,t){this.type=r.Syntax.TemplateElement,this.value=e,this.tail=t}return e}();t.TemplateElement=ce;var pe=function(){function e(e,t){this.type=r.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t}return e}();t.TemplateLiteral=pe;var fe=function(){function e(){this.type=r.Syntax.ThisExpression}return e}();t.ThisExpression=fe;var he=function(){function e(e){this.type=r.Syntax.ThrowStatement,this.argument=e}return e}();t.ThrowStatement=he;var de=function(){function e(e,t,n){this.type=r.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n}return e}();t.TryStatement=de;var me=function(){function e(e,t){this.type=r.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0}return e}();t.UnaryExpression=me;var ve=function(){function e(e,t,n){this.type=r.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n}return e}();t.UpdateExpression=ve;var ge=function(){function e(e,t){this.type=r.Syntax.VariableDeclaration,this.declarations=e,this.kind=t}return e}();t.VariableDeclaration=ge;var ye=function(){function e(e,t){this.type=r.Syntax.VariableDeclarator,this.id=e,this.init=t}return e}();t.VariableDeclarator=ye;var _e=function(){function e(e,t){this.type=r.Syntax.WhileStatement,this.test=e,this.body=t}return e}();t.WhileStatement=_e;var be=function(){function e(e,t){this.type=r.Syntax.WithStatement,this.object=e,this.body=t}return e}();t.WithStatement=be;var xe=function(){function e(e,t){this.type=r.Syntax.YieldExpression,this.argument=e,this.delegate=t}return e}();t.YieldExpression=xe},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n(10),o=n(11),a=n(7),s=n(12),u=n(2),l=n(13),c=function(){function e(e,t,n){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=String(t.source)),this.delegate=n,this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new s.Scanner(e,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=Array.prototype.slice.call(arguments,1),o=e.replace(/%(\d)/g,function(e,t){return r.assert(t<i.length,"Message reference must be in range"),i[t]}),a=this.lastMarker.index,s=this.lastMarker.line,u=this.lastMarker.column+1;throw this.errorHandler.createError(a,s,u,o)},e.prototype.tolerateError=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=Array.prototype.slice.call(arguments,1),o=e.replace(/%(\d)/g,function(e,t){return r.assert(t<i.length,"Message reference must be in range"),i[t]}),a=this.lastMarker.index,s=this.scanner.lineNumber,u=this.lastMarker.column+1;this.errorHandler.tolerateError(a,s,u,o)},e.prototype.unexpectedTokenError=function(e,t){var n,r=t||o.Messages.UnexpectedToken;if(e?(t||(r=2===e.type?o.Messages.UnexpectedEOS:3===e.type?o.Messages.UnexpectedIdentifier:6===e.type?o.Messages.UnexpectedNumber:8===e.type?o.Messages.UnexpectedString:10===e.type?o.Messages.UnexpectedTemplate:o.Messages.UnexpectedToken,4===e.type&&(this.scanner.isFutureReservedWord(e.value)?r=o.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(e.value)&&(r=o.Messages.StrictReservedWord))),n=e.value):n="ILLEGAL",r=r.replace("%0",n),e&&"number"==typeof e.lineNumber){var i=e.start,a=e.lineNumber,s=this.lastMarker.index-this.lastMarker.column,u=e.start-s+1;return this.errorHandler.createError(i,a,u,r)}var i=this.lastMarker.index,a=this.lastMarker.line,u=this.lastMarker.column+1;return this.errorHandler.createError(i,a,u,r)},e.prototype.throwUnexpectedToken=function(e,t){throw this.unexpectedTokenError(e,t)},e.prototype.tolerateUnexpectedToken=function(e,t){this.errorHandler.tolerate(this.unexpectedTokenError(e,t))},e.prototype.collectComments=function(){if(this.config.comment){var e=this.scanner.scanComments();if(e.length>0&&this.delegate)for(var t=0;t<e.length;++t){var n=e[t],r=void 0;r={type:n.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(n.slice[0],n.slice[1])},this.config.range&&(r.range=n.range),this.config.loc&&(r.loc=n.loc);var i={start:{line:n.loc.start.line,column:n.loc.start.column,offset:n.range[0]},end:{line:n.loc.end.line,column:n.loc.end.column,offset:n.range[1]}};this.delegate(r,i)}}else this.scanner.scanComments()},e.prototype.getTokenRaw=function(e){return this.scanner.source.slice(e.start,e.end)},e.prototype.convertToken=function(e){var t={type:l.TokenName[e.type],value:this.getTokenRaw(e)};if(this.config.range&&(t.range=[e.start,e.end]),this.config.loc&&(t.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),9===e.type){var n=e.pattern,r=e.flags;t.regex={pattern:n,flags:r}}return t},e.prototype.nextToken=function(){var e=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var t=this.scanner.lex();return this.hasLineTerminator=e.lineNumber!==t.lineNumber,t&&this.context.strict&&3===t.type&&this.scanner.isStrictModeReservedWord(t.value)&&(t.type=4),this.lookahead=t,this.config.tokens&&2!==t.type&&this.tokens.push(this.convertToken(t)),e},e.prototype.nextRegexToken=function(){this.collectComments();var e=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(e))),this.lookahead=e,this.nextToken(),e},e.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},e.prototype.startNode=function(e){return{index:e.start,line:e.lineNumber,column:e.start-e.lineStart}},e.prototype.finalize=function(e,t){if(this.config.range&&(t.range=[e.index,this.lastMarker.index]),this.config.loc&&(t.loc={start:{line:e.line,column:e.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(t.loc.source=this.config.source)),this.delegate){var n={start:{line:e.line,column:e.column,offset:e.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(t,n)}return t},e.prototype.expect=function(e){var t=this.nextToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},e.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var e=this.lookahead;7===e.type&&","===e.value?this.nextToken():7===e.type&&";"===e.value?(this.nextToken(),this.tolerateUnexpectedToken(e)):this.tolerateUnexpectedToken(e,o.Messages.UnexpectedToken)}else this.expect(",")},e.prototype.expectKeyword=function(e){var t=this.nextToken();4===t.type&&t.value===e||this.throwUnexpectedToken(t)},e.prototype.match=function(e){return 7===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchKeyword=function(e){return 4===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchContextualKeyword=function(e){return 3===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchAssign=function(){if(7!==this.lookahead.type)return!1;var e=this.lookahead.value;return"="===e||"*="===e||"**="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=r,i},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=r||this.context.firstCoverInitializedNameError,i},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},e.prototype.parsePrimaryExpression=function(){var e,t,n,r=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),e=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(r,new a.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,o.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.Literal(t.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.Literal("true"===t.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.Literal(null,n));break;case 10:e=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,e=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":e=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":e=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,t=this.nextRegexToken(),n=this.getTokenRaw(t),e=this.finalize(r,new a.RegexLiteral(t.regex,n,t.pattern,t.flags));break;default:e=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?e=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?e=this.finalize(r,new a.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?e=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),e=this.finalize(r,new a.ThisExpression)):e=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:e=this.throwUnexpectedToken(this.nextToken())}return e},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new a.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(n)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new a.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=e.simple;var r=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,this.context.allowStrictDirective=n,r},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters(),r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!1))},e.prototype.parsePropertyMethodAsyncFunction=function(){var e=this.createNode(),t=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var r=this.parseFormalParameters(),i=this.parsePropertyMethod(r);return this.context.allowYield=t,this.context.await=n,this.finalize(e,new a.AsyncFunctionExpression(null,r.params,i))},e.prototype.parseObjectPropertyKey=function(){var e,t=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,o.Messages.StrictOctalLiteral);var r=this.getTokenRaw(n);e=this.finalize(t,new a.Literal(n.value,r));break;case 3:case 1:case 5:case 4:e=this.finalize(t,new a.Identifier(n.value));break;case 7:"["===n.value?(e=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):e=this.throwUnexpectedToken(n);break;default:e=this.throwUnexpectedToken(n)}return e},e.prototype.isPropertyKey=function(e,t){return e.type===u.Syntax.Identifier&&e.name===t||e.type===u.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t,n=this.createNode(),r=this.lookahead,i=null,s=null,u=!1,l=!1,c=!1,p=!1;if(3===r.type){var f=r.value;this.nextToken(),u=this.match("["),p=!(this.hasLineTerminator||"async"!==f||this.match(":")||this.match("(")||this.match("*")),i=p?this.parseObjectPropertyKey():this.finalize(n,new a.Identifier(f))}else this.match("*")?this.nextToken():(u=this.match("["),i=this.parseObjectPropertyKey());var h=this.qualifiedPropertyName(this.lookahead);if(3===r.type&&!p&&"get"===r.value&&h)t="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod();else if(3===r.type&&!p&&"set"===r.value&&h)t="set",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseSetterMethod();else if(7===r.type&&"*"===r.value&&h)t="init",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),l=!0;else if(i||this.throwUnexpectedToken(this.lookahead),t="init",this.match(":")&&!p)!u&&this.isPropertyKey(i,"__proto__")&&(e.value&&this.tolerateError(o.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),s=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))s=p?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),l=!0;else if(3===r.type){var f=this.finalize(n,new a.Identifier(r.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),c=!0;var d=this.isolateCoverGrammar(this.parseAssignmentExpression);s=this.finalize(n,new a.AssignmentPattern(f,d))}else c=!0,s=f}else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new a.Property(t,i,u,s,l,c))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],n={value:!1};!this.match("}");)t.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new a.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){r.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),n=t.value,i=t.cooked;return this.finalize(e,new a.TemplateElement({raw:n,cooked:i},t.tail))},e.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n=t.value,r=t.cooked;return this.finalize(e,new a.TemplateElement({raw:n,cooked:r},t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],n=[],r=this.parseTemplateHead();for(n.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize(e,new a.TemplateLiteral(n,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case u.Syntax.Identifier:case u.Syntax.MemberExpression:case u.Syntax.RestElement:case u.Syntax.AssignmentPattern:break;case u.Syntax.SpreadElement:e.type=u.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case u.Syntax.ArrayExpression:e.type=u.Syntax.ArrayPattern;for(var t=0;t<e.elements.length;t++)null!==e.elements[t]&&this.reinterpretExpressionAsPattern(e.elements[t]);break;case u.Syntax.ObjectExpression:e.type=u.Syntax.ObjectPattern;for(var t=0;t<e.properties.length;t++)this.reinterpretExpressionAsPattern(e.properties[t].value);break;case u.Syntax.AssignmentExpression:e.type=u.Syntax.AssignmentPattern,delete e.operator,this.reinterpretExpressionAsPattern(e.left)}},e.prototype.parseGroupExpression=function(){var e;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),e={type:"ArrowParameterPlaceHolder",params:[],async:!1};else{var t=this.lookahead,n=[];if(this.match("..."))e=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:"ArrowParameterPlaceHolder",params:[e],async:!1};else{var r=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var i=[];for(this.context.isAssignmentTarget=!1,i.push(e);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var o=0;o<i.length;o++)this.reinterpretExpressionAsPattern(i[o]);r=!0,e={type:"ArrowParameterPlaceHolder",params:i,async:!1}}else if(this.match("...")){this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),i.push(this.parseRestElement(n)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1;for(var o=0;o<i.length;o++)this.reinterpretExpressionAsPattern(i[o]);r=!0,e={type:"ArrowParameterPlaceHolder",params:i,async:!1}}else i.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(r)break}r||(e=this.finalize(this.startNode(t),new a.SequenceExpression(i)))}if(!r){if(this.expect(")"),this.match("=>")&&(e.type===u.Syntax.Identifier&&"yield"===e.name&&(r=!0,e={type:"ArrowParameterPlaceHolder",params:[e],async:!1}),!r)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===u.Syntax.SequenceExpression)for(var o=0;o<e.expressions.length;o++)this.reinterpretExpressionAsPattern(e.expressions[o]);else this.reinterpretExpressionAsPattern(e);e={type:"ArrowParameterPlaceHolder",params:e.type===u.Syntax.SequenceExpression?e.expressions:[e],async:!1}}this.context.isBindingElement=!1}}}return e},e.prototype.parseArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.isIdentifierName=function(e){return 3===e.type||4===e.type||1===e.type||5===e.type},e.prototype.parseIdentifierName=function(){var e=this.createNode(),t=this.nextToken();return this.isIdentifierName(t)||this.throwUnexpectedToken(t),this.finalize(e,new a.Identifier(t.value))},e.prototype.parseNewExpression=function(){var e=this.createNode(),t=this.parseIdentifierName();r.assert("new"===t.name,"New expression must start with `new`");var n;if(this.match("."))if(this.nextToken(),3===this.lookahead.type&&this.context.inFunctionBody&&"target"===this.lookahead.value){var i=this.parseIdentifierName();n=new a.MetaProperty(t,i)}else this.throwUnexpectedToken(this.lookahead);else{var o=this.isolateCoverGrammar(this.parseLeftHandSideExpression),s=this.match("(")?this.parseArguments():[];n=new a.NewExpression(o,s),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(e,n)},e.prototype.parseAsyncArgument=function(){var e=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,e},e.prototype.parseAsyncArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.parseLeftHandSideExpressionAllowCall=function(){var e=this.lookahead,t=this.matchContextualKeyword("async"),n=this.context.allowIn;this.context.allowIn=!0;var r;for(this.matchKeyword("super")&&this.context.inFunctionBody?(r=this.createNode(),this.nextToken(),r=this.finalize(r,new a.Super),this.match("(")||this.match(".")||this.match("[")||this.throwUnexpectedToken(this.lookahead)):r=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var i=this.parseIdentifierName();r=this.finalize(this.startNode(e),new a.StaticMemberExpression(r,i))}else if(this.match("(")){var o=t&&e.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var s=o?this.parseAsyncArguments():this.parseArguments();if(r=this.finalize(this.startNode(e),new a.CallExpression(r,s)),o&&this.match("=>")){for(var u=0;u<s.length;++u)this.reinterpretExpressionAsPattern(s[u]);r={type:"ArrowParameterPlaceHolder",params:s,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var i=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),r=this.finalize(this.startNode(e),new a.ComputedMemberExpression(r,i))}else{if(10!==this.lookahead.type||!this.lookahead.head)break;var l=this.parseTemplateLiteral();r=this.finalize(this.startNode(e),new a.TaggedTemplateExpression(r,l))}return this.context.allowIn=n,r},e.prototype.parseSuper=function(){var e=this.createNode();return this.expectKeyword("super"),this.match("[")||this.match(".")||this.throwUnexpectedToken(this.lookahead),this.finalize(e,new a.Super)},e.prototype.parseLeftHandSideExpression=function(){r.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var e=this.startNode(this.lookahead),t=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var n=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),t=this.finalize(e,new a.ComputedMemberExpression(t,n))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var n=this.parseIdentifierName();t=this.finalize(e,new a.StaticMemberExpression(t,n))}else{if(10!==this.lookahead.type||!this.lookahead.head)break;var i=this.parseTemplateLiteral();t=this.finalize(e,new a.TaggedTemplateExpression(t,i))}return t},e.prototype.parseUpdateExpression=function(){var e,t=this.lookahead;if(this.match("++")||this.match("--")){var n=this.startNode(t),r=this.nextToken();e=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&e.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(e.name)&&this.tolerateError(o.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment);var i=!0;e=this.finalize(n,new a.UpdateExpression(r.value,e,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(e=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&7===this.lookahead.type&&(this.match("++")||this.match("--"))){this.context.strict&&e.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(e.name)&&this.tolerateError(o.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var s=this.nextToken().value,i=!1;e=this.finalize(this.startNode(t),new a.UpdateExpression(s,e,i))}return e},e.prototype.parseAwaitExpression=function(){var e=this.createNode();this.nextToken();var t=this.parseUnaryExpression();return this.finalize(e,new a.AwaitExpression(t))},e.prototype.parseUnaryExpression=function(){var e;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var t=this.startNode(this.lookahead),n=this.nextToken();e=this.inheritCoverGrammar(this.parseUnaryExpression),e=this.finalize(t,new a.UnaryExpression(n.value,e)),this.context.strict&&"delete"===e.operator&&e.argument.type===u.Syntax.Identifier&&this.tolerateError(o.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else e=this.context.await&&this.matchContextualKeyword("await")?this.parseAwaitExpression():this.parseUpdateExpression();return e},e.prototype.parseExponentiationExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseUnaryExpression);if(t.type!==u.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var n=t,r=this.isolateCoverGrammar(this.parseExponentiationExpression);t=this.finalize(this.startNode(e),new a.BinaryExpression("**",n,r))}return t},e.prototype.binaryPrecedence=function(e){var t=e.value;return 7===e.type?this.operatorPrecedence[t]||0:4===e.type&&("instanceof"===t||this.context.allowIn&&"in"===t)?7:0},e.prototype.parseBinaryExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseExponentiationExpression),n=this.lookahead,r=this.binaryPrecedence(n);if(r>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var i=[e,this.lookahead],o=t,s=this.isolateCoverGrammar(this.parseExponentiationExpression),u=[o,n.value,s],l=[r];;){if((r=this.binaryPrecedence(this.lookahead))<=0)break;for(;u.length>2&&r<=l[l.length-1];){s=u.pop();var c=u.pop();l.pop(),o=u.pop(),i.pop();var p=this.startNode(i[i.length-1]);u.push(this.finalize(p,new a.BinaryExpression(c,o,s)))}u.push(this.nextToken().value),l.push(r),i.push(this.lookahead),u.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var f=u.length-1;for(t=u[f],i.pop();f>1;){var p=this.startNode(i.pop()),c=u[f-1];t=this.finalize(p,new a.BinaryExpression(c,u[f-2],t)),f-=2}}return t},e.prototype.parseConditionalExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var r=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var i=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new a.ConditionalExpression(t,r,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return t},e.prototype.checkPatternParam=function(e,t){switch(t.type){case u.Syntax.Identifier:this.validateParam(e,t,t.name);break;case u.Syntax.RestElement:this.checkPatternParam(e,t.argument);break;case u.Syntax.AssignmentPattern:this.checkPatternParam(e,t.left);break;case u.Syntax.ArrayPattern:for(var n=0;n<t.elements.length;n++)null!==t.elements[n]&&this.checkPatternParam(e,t.elements[n]);break;case u.Syntax.ObjectPattern:for(var n=0;n<t.properties.length;n++)this.checkPatternParam(e,t.properties[n].value)}e.simple=e.simple&&t instanceof a.Identifier},e.prototype.reinterpretAsCoverFormalsList=function(e){var t,n=[e],r=!1;switch(e.type){case u.Syntax.Identifier:break;case"ArrowParameterPlaceHolder":n=e.params,r=e.async;break;default:return null}t={simple:!0,paramSet:{}};for(var i=0;i<n.length;++i){var a=n[i];a.type===u.Syntax.AssignmentPattern?a.right.type===u.Syntax.YieldExpression&&(a.right.argument&&this.throwUnexpectedToken(this.lookahead),a.right.type=u.Syntax.Identifier,a.right.name="yield",delete a.right.argument,delete a.right.delegate):r&&a.type===u.Syntax.Identifier&&"await"===a.name&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(t,a),n[i]=a}if(this.context.strict||!this.context.allowYield)for(var i=0;i<n.length;++i){var a=n[i];a.type===u.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(t.message===o.Messages.StrictParamDupe){var s=this.context.strict?t.stricted:t.firstRestricted;this.throwUnexpectedToken(s,t.message)}return{simple:t.simple,params:n,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}},e.prototype.parseAssignmentExpression=function(){var e;if(!this.context.allowYield&&this.matchKeyword("yield"))e=this.parseYieldExpression();else{var t=this.lookahead,n=t;if(e=this.parseConditionalExpression(),3===n.type&&n.lineNumber===this.lookahead.lineNumber&&"async"===n.value&&(3===this.lookahead.type||this.matchKeyword("yield"))){var r=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(r),e={type:"ArrowParameterPlaceHolder",params:[r],async:!0}}if("ArrowParameterPlaceHolder"===e.type||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var i=e.async,s=this.reinterpretAsCoverFormalsList(e);if(s){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var l=this.context.strict,c=this.context.allowStrictDirective;this.context.allowStrictDirective=s.simple;var p=this.context.allowYield,f=this.context.await;this.context.allowYield=!0,this.context.await=i;var h=this.startNode(t);this.expect("=>");var d=void 0;if(this.match("{")){var m=this.context.allowIn;this.context.allowIn=!0,d=this.parseFunctionSourceElements(),this.context.allowIn=m}else d=this.isolateCoverGrammar(this.parseAssignmentExpression);var v=d.type!==u.Syntax.BlockStatement;this.context.strict&&s.firstRestricted&&this.throwUnexpectedToken(s.firstRestricted,s.message),this.context.strict&&s.stricted&&this.tolerateUnexpectedToken(s.stricted,s.message),e=i?this.finalize(h,new a.AsyncArrowFunctionExpression(s.params,d,v)):this.finalize(h,new a.ArrowFunctionExpression(s.params,d,v)),this.context.strict=l,this.context.allowStrictDirective=c,this.context.allowYield=p,this.context.await=f}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===u.Syntax.Identifier){var g=e;this.scanner.isRestrictedWord(g.name)&&this.tolerateUnexpectedToken(n,o.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(g.name)&&this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),n=this.nextToken();var y=n.value,_=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new a.AssignmentExpression(y,e,_)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(t);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));t=this.finalize(this.startNode(e),new a.SequenceExpression(n))}return t},e.prototype.parseStatementListItem=function(){var e;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalExportDeclaration),e=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalImportDeclaration),e=this.parseImportDeclaration();break;case"const":e=this.parseLexicalDeclaration({inFor:!1});break;case"function":e=this.parseFunctionDeclaration();break;case"class":e=this.parseClassDeclaration();break;case"let":e=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:e=this.parseStatement()}else e=this.parseStatement();return e},e.prototype.parseBlock=function(){var e=this.createNode();this.expect("{");for(var t=[];;){if(this.match("}"))break;t.push(this.parseStatementListItem())}return this.expect("}"),this.finalize(e,new a.BlockStatement(t))},e.prototype.parseLexicalBinding=function(e,t){var n=this.createNode(),r=[],i=this.parsePattern(r,e);this.context.strict&&i.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(i.name)&&this.tolerateError(o.Messages.StrictVarName);var s=null;return"const"===e?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),s=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(o.Messages.DeclarationMissingInitializer,"const")):(!t.inFor&&i.type!==u.Syntax.Identifier||this.match("="))&&(this.expect("="),s=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new a.VariableDeclarator(i,s))},e.prototype.parseBindingList=function(e,t){for(var n=[this.parseLexicalBinding(e,t)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(e,t));return n},e.prototype.isLexicalDeclaration=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.scanner.lex();return this.scanner.restoreState(e),3===t.type||7===t.type&&"["===t.value||7===t.type&&"{"===t.value||4===t.type&&"let"===t.value||4===t.type&&"yield"===t.value},e.prototype.parseLexicalDeclaration=function(e){var t=this.createNode(),n=this.nextToken().value;r.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var i=this.parseBindingList(n,e);return this.consumeSemicolon(),this.finalize(t,new a.VariableDeclaration(i,n))},e.prototype.parseBindingRestElement=function(e,t){var n=this.createNode();this.expect("...");var r=this.parsePattern(e,t);return this.finalize(n,new a.RestElement(r))},e.prototype.parseArrayPattern=function(e,t){var n=this.createNode();this.expect("[");for(var r=[];!this.match("]");)if(this.match(","))this.nextToken(),r.push(null);else{if(this.match("...")){r.push(this.parseBindingRestElement(e,t));break}r.push(this.parsePatternWithDefault(e,t)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new a.ArrayPattern(r))},e.prototype.parsePropertyPattern=function(e,t){var n,r,i=this.createNode(),o=!1,s=!1;if(3===this.lookahead.type){var u=this.lookahead;n=this.parseVariableIdentifier();var l=this.finalize(i,new a.Identifier(u.value));if(this.match("=")){e.push(u),s=!0,this.nextToken();var c=this.parseAssignmentExpression();r=this.finalize(this.startNode(u),new a.AssignmentPattern(l,c))}else this.match(":")?(this.expect(":"),r=this.parsePatternWithDefault(e,t)):(e.push(u),s=!0,r=l)}else o=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),r=this.parsePatternWithDefault(e,t);return this.finalize(i,new a.Property("init",n,o,r,!1,s))},e.prototype.parseObjectPattern=function(e,t){var n=this.createNode(),r=[];for(this.expect("{");!this.match("}");)r.push(this.parsePropertyPattern(e,t)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new a.ObjectPattern(r))},e.prototype.parsePattern=function(e,t){var n;return this.match("[")?n=this.parseArrayPattern(e,t):this.match("{")?n=this.parseObjectPattern(e,t):(!this.matchKeyword("let")||"const"!==t&&"let"!==t||this.tolerateUnexpectedToken(this.lookahead,o.Messages.LetInLexicalBinding),e.push(this.lookahead),n=this.parseVariableIdentifier(t)),n},e.prototype.parsePatternWithDefault=function(e,t){var n=this.lookahead,r=this.parsePattern(e,t);if(this.match("=")){this.nextToken();var i=this.context.allowYield;this.context.allowYield=!0;var o=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=i,r=this.finalize(this.startNode(n),new a.AssignmentPattern(r,o))}return r},e.prototype.parseVariableIdentifier=function(e){var t=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==e)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(t,new a.Identifier(n.value))},e.prototype.parseVariableDeclaration=function(e){var t=this.createNode(),n=[],r=this.parsePattern(n,"var");this.context.strict&&r.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(r.name)&&this.tolerateError(o.Messages.StrictVarName);var i=null;return this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):r.type===u.Syntax.Identifier||e.inFor||this.expect("="),this.finalize(t,new a.VariableDeclarator(r,i))},e.prototype.parseVariableDeclarationList=function(e){var t={inFor:e.inFor},n=[];for(n.push(this.parseVariableDeclaration(t));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(t));return n},e.prototype.parseVariableStatement=function(){var e=this.createNode();this.expectKeyword("var");var t=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(e,new a.VariableDeclaration(t,"var"))},e.prototype.parseEmptyStatement=function(){var e=this.createNode();return this.expect(";"),this.finalize(e,new a.EmptyStatement)},e.prototype.parseExpressionStatement=function(){var e=this.createNode(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new a.ExpressionStatement(t))},e.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(o.Messages.StrictFunction),this.parseStatement()},e.prototype.parseIfStatement=function(){var e,t=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement)):(this.expect(")"),e=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(t,new a.IfStatement(r,e,n))},e.prototype.parseDoWhileStatement=function(){var e=this.createNode();this.expectKeyword("do");var t=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=t,this.expectKeyword("while"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(e,new a.DoWhileStatement(n,r))},e.prototype.parseWhileStatement=function(){var e,t=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement);else{this.expect(")");var r=this.context.inIteration;this.context.inIteration=!0,e=this.parseStatement(),this.context.inIteration=r}return this.finalize(t,new a.WhileStatement(n,e))},e.prototype.parseForStatement=function(){var e,t,n=null,r=null,i=null,s=!0,l=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){n=this.createNode(),this.nextToken();var c=this.context.allowIn;this.context.allowIn=!1;var p=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=c,1===p.length&&this.matchKeyword("in")){var f=p[0];f.init&&(f.id.type===u.Syntax.ArrayPattern||f.id.type===u.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(o.Messages.ForInOfLoopInitializer,"for-in"),n=this.finalize(n,new a.VariableDeclaration(p,"var")),this.nextToken(),e=n,t=this.parseExpression(),n=null}else 1===p.length&&null===p[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new a.VariableDeclaration(p,"var")),this.nextToken(),e=n,t=this.parseAssignmentExpression(),n=null,s=!1):(n=this.finalize(n,new a.VariableDeclaration(p,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){n=this.createNode();var h=this.nextToken().value;if(this.context.strict||"in"!==this.lookahead.value){var c=this.context.allowIn;this.context.allowIn=!1;var p=this.parseBindingList(h,{inFor:!0});this.context.allowIn=c,1===p.length&&null===p[0].init&&this.matchKeyword("in")?(n=this.finalize(n,new a.VariableDeclaration(p,h)),this.nextToken(),e=n,t=this.parseExpression(),n=null):1===p.length&&null===p[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new a.VariableDeclaration(p,h)),this.nextToken(),e=n,t=this.parseAssignmentExpression(),n=null,s=!1):(this.consumeSemicolon(),n=this.finalize(n,new a.VariableDeclaration(p,h)))}else n=this.finalize(n,new a.Identifier(h)),this.nextToken(),e=n,t=this.parseExpression(),n=null}else{var d=this.lookahead,c=this.context.allowIn;if(this.context.allowIn=!1,n=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=c,this.matchKeyword("in"))this.context.isAssignmentTarget&&n.type!==u.Syntax.AssignmentExpression||this.tolerateError(o.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(n),e=n,t=this.parseExpression(),n=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&n.type!==u.Syntax.AssignmentExpression||this.tolerateError(o.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(n),e=n,t=this.parseAssignmentExpression(),n=null,s=!1;else{if(this.match(",")){for(var m=[n];this.match(",");)this.nextToken(),m.push(this.isolateCoverGrammar(this.parseAssignmentExpression));n=this.finalize(this.startNode(d),new a.SequenceExpression(m))}this.expect(";")}}void 0===e&&(this.match(";")||(r=this.parseExpression()),this.expect(";"),this.match(")")||(i=this.parseExpression()));var v;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),v=this.finalize(this.createNode(),new a.EmptyStatement);else{this.expect(")");var g=this.context.inIteration;this.context.inIteration=!0,v=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=g}return void 0===e?this.finalize(l,new a.ForStatement(n,r,i,v)):s?this.finalize(l,new a.ForInStatement(e,t,v)):this.finalize(l,new a.ForOfStatement(e,t,v))},e.prototype.parseContinueStatement=function(){var e=this.createNode();this.expectKeyword("continue");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();t=n;var r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(o.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.throwError(o.Messages.IllegalContinue),this.finalize(e,new a.ContinueStatement(t))},e.prototype.parseBreakStatement=function(){var e=this.createNode();this.expectKeyword("break");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier(),r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(o.Messages.UnknownLabel,n.name),t=n}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.context.inSwitch||this.throwError(o.Messages.IllegalBreak),this.finalize(e,new a.BreakStatement(t))},e.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(o.Messages.IllegalReturn);var e=this.createNode();this.expectKeyword("return");var t=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&2!==this.lookahead.type,n=t?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(e,new a.ReturnStatement(n))},e.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(o.Messages.StrictModeWith);var e,t=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement)):(this.expect(")"),e=this.parseStatement()),this.finalize(t,new a.WithStatement(n,e))},e.prototype.parseSwitchCase=function(){var e,t=this.createNode();this.matchKeyword("default")?(this.nextToken(),e=null):(this.expectKeyword("case"),e=this.parseExpression()),this.expect(":");for(var n=[];;){if(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"))break;n.push(this.parseStatementListItem())}return this.finalize(t,new a.SwitchCase(e,n))},e.prototype.parseSwitchStatement=function(){var e=this.createNode();this.expectKeyword("switch"),this.expect("(");var t=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var r=[],i=!1;for(this.expect("{");;){if(this.match("}"))break;var s=this.parseSwitchCase();null===s.test&&(i&&this.throwError(o.Messages.MultipleDefaultsInSwitch),i=!0),r.push(s)}return this.expect("}"),this.context.inSwitch=n,this.finalize(e,new a.SwitchStatement(t,r))},e.prototype.parseLabelledStatement=function(){var e,t=this.createNode(),n=this.parseExpression();if(n.type===u.Syntax.Identifier&&this.match(":")){this.nextToken();var r=n,i="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,i)&&this.throwError(o.Messages.Redeclaration,"Label",r.name),this.context.labelSet[i]=!0;var s=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),s=this.parseClassDeclaration();else if(this.matchKeyword("function")){var l=this.lookahead,c=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(l,o.Messages.StrictFunction):c.generator&&this.tolerateUnexpectedToken(l,o.Messages.GeneratorInLegacyContext),s=c}else s=this.parseStatement();delete this.context.labelSet[i],e=new a.LabeledStatement(r,s)}else this.consumeSemicolon(),e=new a.ExpressionStatement(n);return this.finalize(t,e)},e.prototype.parseThrowStatement=function(){var e=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(o.Messages.NewlineAfterThrow);var t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new a.ThrowStatement(t))},e.prototype.parseCatchClause=function(){var e=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var t=[],n=this.parsePattern(t),r={},i=0;i<t.length;i++){var s="$"+t[i].value;Object.prototype.hasOwnProperty.call(r,s)&&this.tolerateError(o.Messages.DuplicateBinding,t[i].value),r[s]=!0}this.context.strict&&n.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(o.Messages.StrictCatchVariable),this.expect(")");var l=this.parseBlock();return this.finalize(e,new a.CatchClause(n,l))},e.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},e.prototype.parseTryStatement=function(){var e=this.createNode();this.expectKeyword("try");var t=this.parseBlock(),n=this.matchKeyword("catch")?this.parseCatchClause():null,r=this.matchKeyword("finally")?this.parseFinallyClause():null;return n||r||this.throwError(o.Messages.NoCatchOrFinally),this.finalize(e,new a.TryStatement(t,n,r))},e.prototype.parseDebuggerStatement=function(){var e=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(e,new a.DebuggerStatement)},e.prototype.parseStatement=function(){var e;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:e=this.parseExpressionStatement();break;case 7:var t=this.lookahead.value;e="{"===t?this.parseBlock():"("===t?this.parseExpressionStatement():";"===t?this.parseEmptyStatement():this.parseExpressionStatement();break;case 3:e=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":e=this.parseBreakStatement();break;case"continue":e=this.parseContinueStatement();break;case"debugger":e=this.parseDebuggerStatement();break;case"do":e=this.parseDoWhileStatement();break;case"for":e=this.parseForStatement();break;case"function":e=this.parseFunctionDeclaration();break;case"if":e=this.parseIfStatement();break;case"return":e=this.parseReturnStatement();break;case"switch":e=this.parseSwitchStatement();break;case"throw":e=this.parseThrowStatement();break;case"try":e=this.parseTryStatement();break;case"var":e=this.parseVariableStatement();break;case"while":e=this.parseWhileStatement();break;case"with":e=this.parseWithStatement();break;default:e=this.parseExpressionStatement()}break;default:e=this.throwUnexpectedToken(this.lookahead)}return e},e.prototype.parseFunctionSourceElements=function(){var e=this.createNode();this.expect("{");var t=this.parseDirectivePrologues(),n=this.context.labelSet,r=this.context.inIteration,i=this.context.inSwitch,o=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;2!==this.lookahead.type&&!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=n,this.context.inIteration=r,this.context.inSwitch=i,this.context.inFunctionBody=o,this.finalize(e,new a.BlockStatement(t))},e.prototype.validateParam=function(e,t,n){var r="$"+n;this.context.strict?(this.scanner.isRestrictedWord(n)&&(e.stricted=t,e.message=o.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=o.Messages.StrictParamDupe)):e.firstRestricted||(this.scanner.isRestrictedWord(n)?(e.firstRestricted=t,e.message=o.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(n)?(e.firstRestricted=t,e.message=o.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=o.Messages.StrictParamDupe)),"function"==typeof Object.defineProperty?Object.defineProperty(e.paramSet,r,{value:!0,enumerable:!0,writable:!0,configurable:!0}):e.paramSet[r]=!0},e.prototype.parseRestElement=function(e){var t=this.createNode();this.expect("...");var n=this.parsePattern(e);return this.match("=")&&this.throwError(o.Messages.DefaultRestParameter),this.match(")")||this.throwError(o.Messages.ParameterAfterRestParameter),this.finalize(t,new a.RestElement(n))},e.prototype.parseFormalParameter=function(e){for(var t=[],n=this.match("...")?this.parseRestElement(t):this.parsePatternWithDefault(t),r=0;r<t.length;r++)this.validateParam(e,t[r],t[r].value);e.simple=e.simple&&n instanceof a.Identifier,e.params.push(n)},e.prototype.parseFormalParameters=function(e){var t;if(t={simple:!0,params:[],firstRestricted:e},this.expect("("),!this.match(")"))for(t.paramSet={};2!==this.lookahead.type&&(this.parseFormalParameter(t),!this.match(")"))&&(this.expect(","),!this.match(")")););return this.expect(")"),{simple:t.simple,params:t.params,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}},e.prototype.matchAsyncFunction=function(){var e=this.matchContextualKeyword("async");if(e){var t=this.scanner.saveState();this.scanner.scanComments();var n=this.scanner.lex();this.scanner.restoreState(t),e=t.lineNumber===n.lineNumber&&4===n.type&&"function"===n.value}return e},e.prototype.parseFunctionDeclaration=function(e){var t=this.createNode(),n=this.matchContextualKeyword("async");n&&this.nextToken(),this.expectKeyword("function");var r=!n&&this.match("*");r&&this.nextToken();var i,s=null,u=null;if(!e||!this.match("(")){var l=this.lookahead;s=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(l.value)&&this.tolerateUnexpectedToken(l,o.Messages.StrictFunctionName):this.scanner.isRestrictedWord(l.value)?(u=l,i=o.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(l.value)&&(u=l,i=o.Messages.StrictReservedWord)}var c=this.context.await,p=this.context.allowYield;this.context.await=n,this.context.allowYield=!r;var f=this.parseFormalParameters(u),h=f.params,d=f.stricted;u=f.firstRestricted,f.message&&(i=f.message);var m=this.context.strict,v=this.context.allowStrictDirective;this.context.allowStrictDirective=f.simple;var g=this.parseFunctionSourceElements();return this.context.strict&&u&&this.throwUnexpectedToken(u,i),this.context.strict&&d&&this.tolerateUnexpectedToken(d,i),this.context.strict=m,this.context.allowStrictDirective=v,this.context.await=c,this.context.allowYield=p,n?this.finalize(t,new a.AsyncFunctionDeclaration(s,h,g)):this.finalize(t,new a.FunctionDeclaration(s,h,g,r))},e.prototype.parseFunctionExpression=function(){var e=this.createNode(),t=this.matchContextualKeyword("async");t&&this.nextToken(),this.expectKeyword("function");var n=!t&&this.match("*");n&&this.nextToken();var r,i,s=null,u=this.context.await,l=this.context.allowYield;if(this.context.await=t,this.context.allowYield=!n,!this.match("(")){var c=this.lookahead;s=this.context.strict||n||!this.matchKeyword("yield")?this.parseVariableIdentifier():this.parseIdentifierName(),this.context.strict?this.scanner.isRestrictedWord(c.value)&&this.tolerateUnexpectedToken(c,o.Messages.StrictFunctionName):this.scanner.isRestrictedWord(c.value)?(i=c,r=o.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(c.value)&&(i=c,r=o.Messages.StrictReservedWord)}var p=this.parseFormalParameters(i),f=p.params,h=p.stricted;i=p.firstRestricted,p.message&&(r=p.message);var d=this.context.strict,m=this.context.allowStrictDirective;this.context.allowStrictDirective=p.simple;var v=this.parseFunctionSourceElements();return this.context.strict&&i&&this.throwUnexpectedToken(i,r),this.context.strict&&h&&this.tolerateUnexpectedToken(h,r),this.context.strict=d,this.context.allowStrictDirective=m,this.context.await=u,this.context.allowYield=l,t?this.finalize(e,new a.AsyncFunctionExpression(s,f,v)):this.finalize(e,new a.FunctionExpression(s,f,v,n))},e.prototype.parseDirective=function(){var e=this.lookahead,t=this.createNode(),n=this.parseExpression(),r=n.type===u.Syntax.Literal?this.getTokenRaw(e).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(t,r?new a.Directive(n,r):new a.ExpressionStatement(n))},e.prototype.parseDirectivePrologues=function(){for(var e=null,t=[];;){var n=this.lookahead;if(8!==n.type)break;var r=this.parseDirective();t.push(r);var i=r.directive;if("string"!=typeof i)break;"use strict"===i?(this.context.strict=!0,e&&this.tolerateUnexpectedToken(e,o.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(n,o.Messages.IllegalLanguageModeDirective)):!e&&n.octal&&(e=n)}return t},e.prototype.qualifiedPropertyName=function(e){switch(e.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return"["===e.value}return!1},e.prototype.parseGetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters();n.params.length>0&&this.tolerateError(o.Messages.BadGetterArity);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!1))},e.prototype.parseSetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(o.Messages.BadSetterArity):n.params[0]instanceof a.RestElement&&this.tolerateError(o.Messages.BadSetterRestParameter);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!1))},e.prototype.parseGeneratorMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,n.params,r,!0))},e.prototype.isStartOfExpression=function(){var e=!0,t=this.lookahead.value;switch(this.lookahead.type){case 7:e="["===t||"("===t||"{"===t||"+"===t||"-"===t||"!"===t||"~"===t||"++"===t||"--"===t||"/"===t||"/="===t;break;case 4:e="class"===t||"delete"===t||"function"===t||"let"===t||"new"===t||"super"===t||"this"===t||"typeof"===t||"void"===t||"yield"===t}return e},e.prototype.parseYieldExpression=function(){var e=this.createNode();this.expectKeyword("yield");var t=null,n=!1;if(!this.hasLineTerminator){var r=this.context.allowYield;this.context.allowYield=!1,n=this.match("*"),n?(this.nextToken(),t=this.parseAssignmentExpression()):this.isStartOfExpression()&&(t=this.parseAssignmentExpression()),this.context.allowYield=r}return this.finalize(e,new a.YieldExpression(t,n))},e.prototype.parseClassElement=function(e){var t=this.lookahead,n=this.createNode(),r="",i=null,s=null,u=!1,l=!1,c=!1,p=!1;if(this.match("*"))this.nextToken();else{u=this.match("["),i=this.parseObjectPropertyKey();if("static"===i.name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(t=this.lookahead,c=!0,u=this.match("["),this.match("*")?this.nextToken():i=this.parseObjectPropertyKey()),3===t.type&&!this.hasLineTerminator&&"async"===t.value){var f=this.lookahead.value;":"!==f&&"("!==f&&"*"!==f&&(p=!0,t=this.lookahead,i=this.parseObjectPropertyKey(),3===t.type&&("get"===t.value||"set"===t.value?this.tolerateUnexpectedToken(t):"constructor"===t.value&&this.tolerateUnexpectedToken(t,o.Messages.ConstructorIsAsync)))}}var h=this.qualifiedPropertyName(this.lookahead);return 3===t.type?"get"===t.value&&h?(r="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod()):"set"===t.value&&h&&(r="set",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseSetterMethod()):7===t.type&&"*"===t.value&&h&&(r="init",u=this.match("["),i=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),l=!0),!r&&i&&this.match("(")&&(r="init",s=p?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),l=!0),r||this.throwUnexpectedToken(this.lookahead),"init"===r&&(r="method"),u||(c&&this.isPropertyKey(i,"prototype")&&this.throwUnexpectedToken(t,o.Messages.StaticPrototype),!c&&this.isPropertyKey(i,"constructor")&&(("method"!==r||!l||s&&s.generator)&&this.throwUnexpectedToken(t,o.Messages.ConstructorSpecialMethod),e.value?this.throwUnexpectedToken(t,o.Messages.DuplicateConstructor):e.value=!0,r="constructor")),this.finalize(n,new a.MethodDefinition(i,u,s,r,c))},e.prototype.parseClassElementList=function(){var e=[],t={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():e.push(this.parseClassElement(t));return this.expect("}"),e},e.prototype.parseClassBody=function(){var e=this.createNode(),t=this.parseClassElementList();return this.finalize(e,new a.ClassBody(t))},e.prototype.parseClassDeclaration=function(e){var t=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var r=e&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var o=this.parseClassBody();return this.context.strict=n,this.finalize(t,new a.ClassDeclaration(r,i,o))},e.prototype.parseClassExpression=function(){var e=this.createNode(),t=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var i=this.parseClassBody();return this.context.strict=t,this.finalize(e,new a.ClassExpression(n,r,i))},e.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0;for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new a.Module(t))},e.prototype.parseScript=function(){for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new a.Script(t))},e.prototype.parseModuleSpecifier=function(){var e=this.createNode();8!==this.lookahead.type&&this.throwError(o.Messages.InvalidModuleSpecifier);var t=this.nextToken(),n=this.getTokenRaw(t);return this.finalize(e,new a.Literal(t.value,n))},e.prototype.parseImportSpecifier=function(){var e,t,n=this.createNode();return 3===this.lookahead.type?(e=this.parseVariableIdentifier(),t=e,this.matchContextualKeyword("as")&&(this.nextToken(),t=this.parseVariableIdentifier())):(e=this.parseIdentifierName(),t=e,this.matchContextualKeyword("as")?(this.nextToken(),t=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new a.ImportSpecifier(t,e))},e.prototype.parseNamedImports=function(){this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),e},e.prototype.parseImportDefaultSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName();return this.finalize(e,new a.ImportDefaultSpecifier(t))},e.prototype.parseImportNamespaceSpecifier=function(){var e=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(o.Messages.NoAsAfterImportNamespace),this.nextToken();var t=this.parseIdentifierName();return this.finalize(e,new a.ImportNamespaceSpecifier(t))},e.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalImportDeclaration);var e=this.createNode();this.expectKeyword("import");var t,n=[];if(8===this.lookahead.type)t=this.parseModuleSpecifier();else{if(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken(),t=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(e,new a.ImportDeclaration(n,t))},e.prototype.parseExportSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName(),n=t;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(e,new a.ExportSpecifier(t,n))},e.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalExportDeclaration);var e=this.createNode();this.expectKeyword("export");var t;if(this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);t=this.finalize(e,new a.ExportDefaultDeclaration(n))}else if(this.matchKeyword("class")){var n=this.parseClassDeclaration(!0);t=this.finalize(e,new a.ExportDefaultDeclaration(n))}else if(this.matchContextualKeyword("async")){var n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();t=this.finalize(e,new a.ExportDefaultDeclaration(n))}else{this.matchContextualKeyword("from")&&this.throwError(o.Messages.UnexpectedToken,this.lookahead.value);var n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),t=this.finalize(e,new a.ExportDefaultDeclaration(n))}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),t=this.finalize(e,new a.ExportAllDeclaration(i))}else if(4===this.lookahead.type){var n=void 0;switch(this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}t=this.finalize(e,new a.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction()){var n=this.parseFunctionDeclaration();t=this.finalize(e,new a.ExportNamedDeclaration(n,[],null))}else{var s=[],u=null,l=!1;for(this.expect("{");!this.match("}");)l=l||this.matchKeyword("default"),s.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),u=this.parseModuleSpecifier(),this.consumeSemicolon();else if(l){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}else this.consumeSemicolon();t=this.finalize(e,new a.ExportNamedDeclaration(null,s,u))}return t},e}();t.Parser=c},function(e,t){"use strict";function n(e,t){if(!e)throw new Error("ASSERT: "+t)}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.errors=[],this.tolerant=!1}return e.prototype.recordError=function(e){this.errors.push(e)},e.prototype.tolerate=function(e){if(!this.tolerant)throw e;this.recordError(e)},e.prototype.constructError=function(e,t){var n=new Error(e);try{throw n}catch(e){Object.create&&Object.defineProperty&&(n=Object.create(e),Object.defineProperty(n,"column",{value:t}))}return n},e.prototype.createError=function(e,t,n,r){var i="Line "+t+": "+r,o=this.constructError(i,n);return o.index=e,o.lineNumber=t,o.description=r,o},e.prototype.throwError=function(e,t,n,r){throw this.createError(e,t,n,r)},e.prototype.tolerateError=function(e,t,n,r){var i=this.createError(e,t,n,r);if(!this.tolerant)throw i;this.recordError(i)},e}();t.ErrorHandler=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(e,t,n){"use strict";function r(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function i(e){return"01234567".indexOf(e)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(9),a=n(4),s=n(11),u=function(){function e(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return e.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},e.prototype.restoreState=function(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart},e.prototype.eof=function(){return this.index>=this.length},e.prototype.throwUnexpectedToken=function(e){return void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(e){void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.skipSingleLineComment=function(e){var t,n,r=[];for(this.trackComment&&(r=[],t=this.index-e,n={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(++this.index,a.Character.isLineTerminator(i)){if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};var o={multiLine:!1,slice:[t+e,this.index-1],range:[t,this.index-1],loc:n};r.push(o)}return 13===i&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,r}}if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var o={multiLine:!1,slice:[t+e,this.index],range:[t,this.index],loc:n};r.push(o)}return r},e.prototype.skipMultiLineComment=function(){var e,t,n=[];for(this.trackComment&&(n=[],e=this.index-2,t={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(a.Character.isLineTerminator(r))13===r&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===r){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[e+2,this.index-2],range:[e,this.index],loc:t};n.push(i)}return n}++this.index}else++this.index}if(this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[e+2,this.index],range:[e,this.index],loc:t};n.push(i)}return this.tolerateUnexpectedToken(),n},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(a.Character.isWhiteSpace(n))++this.index;else if(a.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var r=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(r)),t=!0}else{if(42!==n)break;this.index+=2;var r=this.skipMultiLineComment();this.trackComment&&(e=e.concat(r))}else if(t&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3;var r=this.skipSingleLineComment(3);this.trackComment&&(e=e.concat(r))}else{if(60!==n)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4;var r=this.skipSingleLineComment(4);this.trackComment&&(e=e.concat(r))}}return e},e.prototype.isFutureReservedWord=function(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}},e.prototype.isStrictModeReservedWord=function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){var n=this.source.charCodeAt(e+1);if(n>=56320&&n<=57343){t=1024*(t-55296)+n-56320+65536}}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,n=0,i=0;i<t;++i){if(this.eof()||!a.Character.isHexDigit(this.source.charCodeAt(this.index)))return null;n=16*n+r(this.source[this.index++])}return String.fromCharCode(n)},e.prototype.scanUnicodeCodePointEscape=function(){var e=this.source[this.index],t=0;for("}"===e&&this.throwUnexpectedToken();!this.eof()&&(e=this.source[this.index++],a.Character.isHexDigit(e.charCodeAt(0)));)t=16*t+r(e);return(t>1114111||"}"!==e)&&this.throwUnexpectedToken(),a.Character.fromCodePoint(t)},e.prototype.getIdentifier=function(){for(var e=this.index++;!this.eof();){var t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!a.Character.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e=this.codePointAt(this.index),t=a.Character.fromCodePoint(e);this.index+=t.length;var n;for(92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):null!==(n=this.scanHexEscape("u"))&&"\\"!==n&&a.Character.isIdentifierStart(n.charCodeAt(0))||this.throwUnexpectedToken(),t=n);!this.eof()&&(e=this.codePointAt(this.index),a.Character.isIdentifierPart(e));)n=a.Character.fromCodePoint(e),t+=n,this.index+=n.length,92===e&&(t=t.substr(0,t.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):null!==(n=this.scanHexEscape("u"))&&"\\"!==n&&a.Character.isIdentifierPart(n.charCodeAt(0))||this.throwUnexpectedToken(),t+=n);return t},e.prototype.octalToDecimal=function(e){var t="0"!==e,n=i(e);return!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+i(this.source[this.index++]),"0123".indexOf(e)>=0&&!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+i(this.source[this.index++]))),{code:n,octal:t}},e.prototype.scanIdentifier=function(){var e,t=this.index,n=92===this.source.charCodeAt(t)?this.getComplexIdentifier():this.getIdentifier();if(3!==(e=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&t+n.length!==this.index){var r=this.index;this.index=t,this.tolerateUnexpectedToken(s.Messages.InvalidEscapedReservedWord),this.index=r}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.scanPunctuator=function(){var e=this.index,t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:t=this.source.substr(this.index,4),">>>="===t?this.index+=4:(t=t.substr(0,3),"==="===t||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:(t=t.substr(0,2),"&&"===t||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".indexOf(t)>=0&&++this.index)))}return this.index===e&&this.throwUnexpectedToken(),{type:7,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&a.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),a.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t,n="";!this.eof()&&("0"===(t=this.source[this.index])||"1"===t);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(t=this.source.charCodeAt(this.index),(a.Character.isIdentifierStart(t)||a.Character.isDecimalDigit(t))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var n="",r=!1;for(a.Character.isOctalDigit(e.charCodeAt(0))?(r=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&a.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return r||0!==n.length||this.throwUnexpectedToken(),(a.Character.isIdentifierStart(this.source.charCodeAt(this.index))||a.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1;e<this.length;++e){var t=this.source[e];if("8"===t||"9"===t)return!1;if(!a.Character.isOctalDigit(t.charCodeAt(0)))return!0}return!0},e.prototype.scanNumericLiteral=function(){var e=this.index,t=this.source[e];o.assert(a.Character.isDecimalDigit(t.charCodeAt(0))||"."===t,"Numeric literal must start with a decimal digit or a decimal point");var n="";if("."!==t){if(n=this.source[this.index++],t=this.source[this.index],"0"===n){if("x"===t||"X"===t)return++this.index,this.scanHexLiteral(e);if("b"===t||"B"===t)return++this.index,this.scanBinaryLiteral(e);if("o"===t||"O"===t)return this.scanOctalLiteral(t,e);if(t&&a.Character.isOctalDigit(t.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(t,e)}for(;a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];t=this.source[this.index]}if("."===t){for(n+=this.source[this.index++];a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];t=this.source[this.index]}if("e"===t||"E"===t)if(n+=this.source[this.index++],t=this.source[this.index],"+"!==t&&"-"!==t||(n+=this.source[this.index++]),a.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;a.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];else this.throwUnexpectedToken();return a.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanStringLiteral=function(){var e=this.index,t=this.source[e];o.assert("'"===t||'"'===t,"String literal must starts with a quote"),++this.index;for(var n=!1,r="";!this.eof();){var i=this.source[this.index++];if(i===t){t="";break}if("\\"===i)if((i=this.source[this.index++])&&a.Character.isLineTerminator(i.charCodeAt(0)))++this.lineNumber,"\r"===i&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(i){case"u":if("{"===this.source[this.index])++this.index,r+=this.scanUnicodeCodePointEscape();else{var u=this.scanHexEscape(i);null===u&&this.throwUnexpectedToken(),r+=u}break;case"x":var l=this.scanHexEscape(i);null===l&&this.throwUnexpectedToken(s.Messages.InvalidHexEscapeSequence),r+=l;break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;case"8":case"9":r+=i,this.tolerateUnexpectedToken();break;default:if(i&&a.Character.isOctalDigit(i.charCodeAt(0))){var c=this.octalToDecimal(i);n=c.octal||n,r+=String.fromCharCode(c.code)}else r+=i}else{if(a.Character.isLineTerminator(i.charCodeAt(0)))break;r+=i}}return""!==t&&(this.index=e,this.throwUnexpectedToken()),{type:8,value:r,octal:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanTemplate=function(){var e="",t=!1,n=this.index,r="`"===this.source[n],i=!1,o=2;for(++this.index;!this.eof();){var u=this.source[this.index++];if("`"===u){o=1,i=!0,t=!0;break}if("$"===u){if("{"===this.source[this.index]){this.curlyStack.push("${"),++this.index,t=!0;break}e+=u}else if("\\"===u)if(u=this.source[this.index++],a.Character.isLineTerminator(u.charCodeAt(0)))++this.lineNumber,"\r"===u&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(u){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":if("{"===this.source[this.index])++this.index,e+=this.scanUnicodeCodePointEscape();else{var l=this.index,c=this.scanHexEscape(u);null!==c?e+=c:(this.index=l,e+=u)}break;case"x":var p=this.scanHexEscape(u);null===p&&this.throwUnexpectedToken(s.Messages.InvalidHexEscapeSequence),e+=p;break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:"0"===u?(a.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(s.Messages.TemplateOctalLiteral),e+="\0"):a.Character.isOctalDigit(u.charCodeAt(0))?this.throwUnexpectedToken(s.Messages.TemplateOctalLiteral):e+=u}else a.Character.isLineTerminator(u.charCodeAt(0))?(++this.lineNumber,"\r"===u&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index,e+="\n"):e+=u}return t||this.throwUnexpectedToken(),r||this.curlyStack.pop(),{type:10,value:this.source.slice(n+1,this.index-o),cooked:e,head:r,tail:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}},e.prototype.testRegExp=function(e,t){var n=e,r=this;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(e,t,n){var i=parseInt(t||n,16);return i>1114111&&r.throwUnexpectedToken(s.Messages.InvalidRegExp),i<=65535?String.fromCharCode(i):"￿"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"￿"));try{RegExp(n)}catch(e){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];o.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],n=!1,r=!1;!this.eof();)if(e=this.source[this.index++],t+=e,"\\"===e)e=this.source[this.index++],a.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t+=e;else if(a.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else{if("/"===e){r=!0;break}"["===e&&(n=!0)}return r||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t.substr(1,t.length-2)},e.prototype.scanRegExpFlags=function(){for(var e="",t="";!this.eof();){var n=this.source[this.index];if(!a.Character.isIdentifierPart(n.charCodeAt(0)))break;if(++this.index,"\\"!==n||this.eof())t+=n,e+=n;else if("u"===(n=this.source[this.index])){++this.index;var r=this.index,i=this.scanHexEscape("u");if(null!==i)for(t+=i,e+="\\u";r<this.index;++r)e+=this.source[r];else this.index=r,t+="u",e+="\\u";this.tolerateUnexpectedToken()}else e+="\\",this.tolerateUnexpectedToken()}return t},e.prototype.scanRegExp=function(){var e=this.index,t=this.scanRegExpBody(),n=this.scanRegExpFlags();return{type:9,value:"",pattern:t,flags:n,regex:this.testRegExp(t,n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var e=this.source.charCodeAt(this.index);return a.Character.isIdentifierStart(e)?this.scanIdentifier():40===e||41===e||59===e?this.scanPunctuator():39===e||34===e?this.scanStringLiteral():46===e?a.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():a.Character.isDecimalDigit(e)?this.scanNumericLiteral():96===e||125===e&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():e>=55296&&e<57343&&a.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=u},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenName={},t.TokenName[1]="Boolean",t.TokenName[2]="<end>",t.TokenName[3]="Identifier",t.TokenName[4]="Keyword",t.TokenName[5]="Null",t.TokenName[6]="Numeric",t.TokenName[7]="Punctuator",t.TokenName[8]="String",t.TokenName[9]="RegularExpression",t.TokenName[10]="Template"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(12),o=n(13),a=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)>=0},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var n=this.values[this.paren-1];t="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(t=!1,"function"===this.values[this.curly-3]){var r=this.values[this.curly-4];t=!!r&&!this.beforeFunctionExpression(r)}else if("function"===this.values[this.curly-4]){var r=this.values[this.curly-5];t=!r||!this.beforeFunctionExpression(r)}}return t},e.prototype.push=function(e){7===e.type||4===e.type?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),s=function(){function e(e,t){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=!!t&&("boolean"==typeof t.tolerant&&t.tolerant),this.scanner=new i.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&("boolean"==typeof t.comment&&t.comment),this.trackRange=!!t&&("boolean"==typeof t.range&&t.range),this.trackLoc=!!t&&("boolean"==typeof t.loc&&t.loc),this.buffer=[],this.reader=new a}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var e=this.scanner.scanComments();if(this.scanner.trackComment)for(var t=0;t<e.length;++t){var n=e[t],r=this.scanner.source.slice(n.slice[0],n.slice[1]),i={type:n.multiLine?"BlockComment":"LineComment",value:r};this.trackRange&&(i.range=n.range),this.trackLoc&&(i.loc=n.loc),this.buffer.push(i)}if(!this.scanner.eof()){var a=void 0;this.trackLoc&&(a={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var s="/"===this.scanner.source[this.scanner.index]&&this.reader.isRegexStart(),u=s?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(u);var l={type:o.TokenName[u.type],value:this.scanner.source.slice(u.start,u.end)};if(this.trackRange&&(l.range=[u.start,u.end]),this.trackLoc&&(a.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},l.loc=a),9===u.type){var c=u.pattern,p=u.flags;l.regex={pattern:c,flags:p}}this.buffer.push(l)}}return this.buffer.shift()},e}();t.Tokenizer=s}])})},function(e,t,n){"use strict";var r,i,o,a,s,u,l,c=n(141),p=n(58),f=Function.prototype.apply,h=Function.prototype.call,d=Object.create,m=Object.defineProperty,v=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(e,t){var n;return p(t),g.call(this,"__ee__")?n=this.__ee__:(n=y.value=d(null),m(this,"__ee__",y),y.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},i=function(e,t){var n,i;return p(t),i=this,r.call(this,e,n=function(){o.call(i,e,n),f.call(t,this,arguments)}),n.__eeOnceListener__=t,this},o=function(e,t){var n,r,i,o;if(p(t),!g.call(this,"__ee__"))return this;if(n=this.__ee__,!n[e])return this;if("object"==typeof(r=n[e]))for(o=0;i=r[o];++o)i!==t&&i.__eeOnceListener__!==t||(2===r.length?n[e]=r[o?0:1]:r.splice(o,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},a=function(e){var t,n,r,i,o;if(g.call(this,"__ee__")&&(i=this.__ee__[e]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];for(i=i.slice(),t=0;r=i[t];++t)f.call(r,this,o)}else switch(arguments.length){case 1:h.call(i,this);break;case 2:h.call(i,this,arguments[1]);break;case 3:h.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];f.call(i,this,o)}},s={on:r,once:i,off:o,emit:a},u={on:c(r),once:c(i),off:c(o),emit:c(a)},l=v({},u),e.exports=t=function(e){return null==e?d(l):v(Object(e),u)},t.methods=s},function(e,t){/*! - * https://github.com/Starcounter-Jack/JSON-Patch - * json-patch-duplex.js version: 1.2.2 - * (c) 2013 Joachim Wester - * MIT license - */ -var n;if(function(e){function t(e,n){switch(typeof e){case"undefined":case"boolean":case"string":case"number":return e===n;case"object":if(null===e)return null===n;if(k(e)){if(!k(n)||e.length!==n.length)return!1;for(var r=0,i=e.length;r<i;r++)if(!t(e[r],n[r]))return!1;return!0}for(var o=E(e),a=E(n),s=0;s<o.length;s++){var u=o[s];if(!t(e[u],n[u]))return!1;var l=a.indexOf(u);l>=0&&a.splice(l,1)}for(var c=0;c<a.length;c++){var p=a[c];if(!t(e[p],n[p]))return!1}return!0;default:return!1}}function n(e){for(var t=0,n=A.length;t<n;t++)if(A[t].obj===e)return A[t]}function r(e,t){for(var n=0,r=e.observers.length;n<r;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function i(e,t){for(var n=0,r=e.observers.length;n<r;n++)if(e.observers[n].observer===t)return void e.observers.splice(n,1)}function o(e,t){t.unobserve()}function a(e,t){var o,a=[],u=n(e);if(u?o=r(u,t):(u=new D(e),A.push(u)),o)return o;if(o={},u.value=c(e),t){o.callback=t,o.next=null;var l=function(){s(o)},p=function(){clearTimeout(o.next),o.next=setTimeout(l)};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p)):(document.documentElement.attachEvent("onmouseup",p),document.documentElement.attachEvent("onkeyup",p),document.documentElement.attachEvent("onmousedown",p),document.documentElement.attachEvent("onkeydown",p),document.documentElement.attachEvent("onchange",p)))}return o.patches=a,o.object=e,o.unobserve=function(){s(o),clearTimeout(o.next),i(u,o),"undefined"!=typeof window&&(window.removeEventListener?(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p)):(document.documentElement.detachEvent("onmouseup",p),document.documentElement.detachEvent("onkeyup",p),document.documentElement.detachEvent("onmousedown",p),document.documentElement.detachEvent("onkeydown",p)))},u.observers.push(new O(t,o)),o}function s(e){for(var t,n=0,r=A.length;n<r;n++)if(A[n].obj===e.object){t=A[n];break}u(t.value,e.object,e.patches,""),e.patches.length&&m(t.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function u(e,t,n,r){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=E(t),o=E(e),a=!1,s=o.length-1;s>=0;s--){var l=o[s],f=e[l];if(!t.hasOwnProperty(l)||void 0===t[l]&&void 0!==f&&!1===k(t))n.push({op:"remove",path:r+"/"+p(l)}),a=!0;else{var h=t[l];"object"==typeof f&&null!=f&&"object"==typeof h&&null!=h?u(f,h,n,r+"/"+p(l)):f!==h&&(!0,n.push({op:"replace",path:r+"/"+p(l),value:c(h)}))}}if(a||i.length!=o.length)for(var s=0;s<i.length;s++){var l=i[s];e.hasOwnProperty(l)||void 0===t[l]||n.push({op:"add",path:r+"/"+p(l),value:c(t[l])})}}}function l(e){for(var t,n=0,r=e.length;n<r;){t=e.charCodeAt(n);{if(!(t>=48&&t<=57))return!1;n++}}return!0}function c(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function p(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function h(e,t){if(""==t)return e;var n={op:"_get",path:t};return d(e,n),n.value}function d(e,n,r,i){if(void 0===r&&(r=!1),void 0===i&&(i=!0),r&&("function"==typeof r?r(n,0,e,n.path):b(n,0)),""===n.path){var o={newDocument:e};if("add"===n.op)return o.newDocument=n.value,o;if("replace"===n.op)return o.newDocument=n.value,o.removed=e,o;if("move"===n.op||"copy"===n.op)return o.newDocument=h(e,n.from),"move"===n.op&&(o.removed=e),o;if("test"===n.op){if(o.test=t(e,n.value),!1===o.test)throw new M("Test operation failed","TEST_OPERATION_FAILED",0,n,e);return o.newDocument=e,o}if("remove"===n.op)return o.removed=e,o.newDocument=null,o;if("_get"===n.op)return n.value=e,o;if(r)throw new M("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",0,n,e);return o}i||(e=c(e));var a=n.path||"",s=a.split("/"),u=e,p=1,d=s.length,m=void 0,v=void 0,g=void 0;for(g="function"==typeof r?r:b;;){if(v=s[p],r&&void 0===m&&(void 0===u[v]?m=s.slice(0,p).join("/"):p==d-1&&(m=n.path),void 0!==m&&g(n,0,e,m)),p++,k(u)){if("-"===v)v=u.length;else{if(r&&!l(v))throw new M("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",0,n.path,n);v=~~v}if(p>=d){if(r&&"add"===n.op&&v>u.length)throw new M("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",0,n.path,n);var o=C[n.op].call(n,u,v,e);if(!1===o.test)throw new M("Test operation failed","TEST_OPERATION_FAILED",0,n,e);return o}}else if(v&&-1!=v.indexOf("~")&&(v=f(v)),p>=d){var o=S[n.op].call(n,u,v,e);if(!1===o.test)throw new M("Test operation failed","TEST_OPERATION_FAILED",0,n,e);return o}u=u[v]}}function m(e,t,n){for(var r=new Array(t.length),i=0,o=t.length;i<o;i++)r[i]=d(e,t[i],n),e=r[i].newDocument;return r.newDocument=e,r}function v(e,t,n){console.warn("jsonpatch.apply is deprecated, please use `applyPatch` for applying patch sequences, or `applyOperation` to apply individual operations.");for(var r=new Array(t.length),i=0,o=t.length;i<o;i++)!function(i,o){if(""==t[i].path&&"remove"!=t[i].op&&"test"!=t[i].op){var a;if("_get"==t[i].op)return t[i].value=e,"continue";"replace"!=t[i].op&&"move"!=t[i].op||(r[i]=c(e)),"copy"!=t[i].op&&"move"!=t[i].op||(a=h(e,t[i].from)),"replace"!=t[i].op&&"add"!=t[i].op||(a=t[i].value),Object.keys(e).forEach(function(t){return delete e[t]}),Object.keys(a).forEach(function(t){return e[t]=a[t]})}else r[i]=d(e,t[i],n),r[i]=r[i].removed||r[i].test}(i);return r}function g(e,t){var n=d(e,t);if(!1===n.test)throw new M("Test operation failed","TEST_OPERATION_FAILED",0,t,e);return n.newDocument}function y(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function _(e){if(void 0===e)return!0;if(e)if(k(e)){for(var t=0,n=e.length;t<n;t++)if(_(e[t]))return!0}else if("object"==typeof e)for(var r=E(e),i=r.length,t=0;t<i;t++)if(_(e[r[t]]))return!0;return!1}function b(e,t,n,r){if("object"!=typeof e||null===e||k(e))throw new M("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(!S[e.op])throw new M("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n);if("string"!=typeof e.path)throw new M("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new M('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new M("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new M("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&_(e.value))throw new M("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new M("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==r)throw new M("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var a={op:"_get",path:e.from,value:void 0},s=x([a],n);if(s&&"OPERATION_PATH_UNRESOLVABLE"===s.name)throw new M("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function x(e,t,n){try{if(!k(e))throw new M("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)m(c(t),c(e),n||!0);else{n=n||b;for(var r=0;r<e.length;r++)n(e[r],r,t,void 0)}}catch(e){if(e instanceof M)return e;throw e}}function w(e,t){var n=[];return u(e,t,n,""),n}var k,E=function(e){if(k(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t},S={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=h(n,this.path);r&&(r=c(r));var i=d(n,{op:"remove",path:this.from}).removed;return d(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=h(n,this.from);return d(n,{op:"add",path:this.path,value:c(r)}),{newDocument:n}},test:function(e,n,r){return{newDocument:r,test:t(e[n],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},C={add:function(e,t,n){return e.splice(t,0,this.value),{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:S.move,copy:S.copy,test:S.test,_get:S._get};k=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length};var A=[],D=function(){function e(e){this.observers=[],this.obj=e}return e}(),O=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=o,e.observe=a,e.generate=s;var k;k=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.deepClone=c,e.escapePathComponent=p,e.unescapePathComponent=f,e.getValueByPointer=h,e.applyOperation=d,e.applyPatch=m,e.apply=v,e.applyReducer=g;var M=function(e){function t(t,n,r,i,o){e.call(this,t),this.message=t,this.name=n,this.index=r,this.operation=i,this.tree=o}return y(t,e),t}(Error);e.JsonPatchError=M,e.validator=b,e.validate=x,e.compare=w}(n||(n={})),void 0!==t)t.apply=n.apply,t.applyPatch=n.applyPatch,t.applyOperation=n.applyOperation,t.applyReducer=n.applyReducer,t.getValueByPointer=n.getValueByPointer,t.deepClone=n.deepClone,t.escapePathComponent=n.escapePathComponent,t.unescapePathComponent=n.unescapePathComponent,t.observe=n.observe,t.unobserve=n.unobserve,t.generate=n.generate,t.compare=n.compare,t.validate=n.validate,t.validator=n.validator,t.JsonPatchError=n.JsonPatchError;else var t={},r=!0;Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,r&&(t=void 0)},function(e,t,n){"use strict";function r(e){return e.replace(i,function(e,t){return t.toUpperCase()})}var i=/-(.)/g;e.exports=r},function(e,t,n){"use strict";function r(e){return i(e.replace(o,"ms-"))}var i=n(746),o=/^-ms-/;e.exports=r},function(e,t,n){"use strict";function r(e,t){return!(!e||!t)&&(e===t||!i(e)&&(i(t)?r(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}var i=n(756);e.exports=r},function(e,t,n){"use strict";function r(e){var t=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&a(!1),"number"!=typeof t&&a(!1),0===t||t-1 in e||a(!1),"function"==typeof e.callee&&a(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}function i(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function o(e){return i(e)?Array.isArray(e)?e.slice():r(e):[e]}var a=n(8);e.exports=o},function(e,t,n){"use strict";function r(e){var t=e.match(c);return t&&t[1].toLowerCase()}function i(e,t){var n=l;l||u(!1);var i=r(e),o=i&&s(i);if(o){n.innerHTML=o[1]+e+o[2];for(var c=o[0];c--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(t||u(!1),a(p).forEach(t));for(var f=Array.from(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return f}var o=n(25),a=n(749),s=n(751),u=n(8),l=o.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;e.exports=i},function(e,t,n){"use strict";function r(e){return a||o(!1),f.hasOwnProperty(e)||(e="*"),s.hasOwnProperty(e)||(a.innerHTML="*"===e?"<link />":"<"+e+"></"+e+">",s[e]=!a.firstChild),s[e]?f[e]:null}var i=n(25),o=n(8),a=i.canUseDOM?document.createElement("div"):null,s={},u=[1,'<select multiple="true">',"</select>"],l=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],p=[1,'<svg xmlns="http://www.w3.org/2000/svg">',"</svg>"],f={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:u,option:u,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach(function(e){f[e]=p,s[e]=!0}),e.exports=r},function(e,t,n){"use strict";function r(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}e.exports=r},function(e,t,n){"use strict";function r(e){return e.replace(i,"-$1").toLowerCase()}var i=/([A-Z])/g;e.exports=r},function(e,t,n){"use strict";function r(e){return i(e).replace(o,"-ms-")}var i=n(753),o=/^ms-/;e.exports=r},function(e,t,n){"use strict";function r(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!(!e||!("function"==typeof n.Node?e instanceof n.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=r},function(e,t,n){"use strict";function r(e){return i(e)&&3==e.nodeType}var i=n(755);e.exports=r},function(e,t,n){"use strict";function r(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}e.exports=r},function(e,t,n){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},o="function"==typeof Object.getOwnPropertySymbols;e.exports=function(e,t,n){if("string"!=typeof t){var a=Object.getOwnPropertyNames(t);o&&(a=a.concat(Object.getOwnPropertySymbols(t)));for(var s=0;s<a.length;++s)if(!(r[a[s]]||i[a[s]]||n&&n[a[s]]))try{e[a[s]]=t[a[s]]}catch(e){}}return e}},function(e,t,n){function r(e){this._cbs=e||{},this.events=[]}e.exports=r;var i=n(116).EVENTS;Object.keys(i).forEach(function(e){if(0===i[e])e="on"+e,r.prototype[e]=function(){this.events.push([e]),this._cbs[e]&&this._cbs[e]()};else if(1===i[e])e="on"+e,r.prototype[e]=function(t){this.events.push([e,t]),this._cbs[e]&&this._cbs[e](t)};else{if(2!==i[e])throw Error("wrong number of arguments");e="on"+e,r.prototype[e]=function(t,n){this.events.push([e,t,n]),this._cbs[e]&&this._cbs[e](t,n)}}}),r.prototype.onreset=function(){this.events=[],this._cbs.onreset&&this._cbs.onreset()},r.prototype.restart=function(){this._cbs.onreset&&this._cbs.onreset();for(var e=0,t=this.events.length;e<t;e++)if(this._cbs[this.events[e][0]]){var n=this.events[e].length;1===n?this._cbs[this.events[e][0]]():2===n?this._cbs[this.events[e][0]](this.events[e][1]):this._cbs[this.events[e][0]](this.events[e][1],this.events[e][2])}}},function(e,t,n){function r(e,t){this.init(e,t)}function i(e,t){return c.getElementsByTagName(e,t,!0)}function o(e,t){return c.getElementsByTagName(e,t,!0,1)[0]}function a(e,t,n){return c.getText(c.getElementsByTagName(e,t,n,1)).trim()}function s(e,t,n,r,i){var o=a(n,r,i);o&&(e[t]=o)}var u=n(116),l=u.DomHandler,c=u.DomUtils;n(42)(r,l),r.prototype.init=l;var p=function(e){return"rss"===e||"feed"===e||"rdf:RDF"===e};r.prototype.onend=function(){var e,t,n={},r=o(p,this.dom);r&&("feed"===r.name?(t=r.children,n.type="atom",s(n,"id","id",t),s(n,"title","title",t),(e=o("link",t))&&(e=e.attribs)&&(e=e.href)&&(n.link=e),s(n,"description","subtitle",t),(e=a("updated",t))&&(n.updated=new Date(e)),s(n,"author","email",t,!0),n.items=i("entry",t).map(function(e){var t,n={};return e=e.children,s(n,"id","id",e),s(n,"title","title",e),(t=o("link",e))&&(t=t.attribs)&&(t=t.href)&&(n.link=t),(t=a("summary",e)||a("content",e))&&(n.description=t),(t=a("updated",e))&&(n.pubDate=new Date(t)),n})):(t=o("channel",r.children).children,n.type=r.name.substr(0,3),n.id="",s(n,"title","title",t),s(n,"link","link",t),s(n,"description","description",t),(e=a("lastBuildDate",t))&&(n.updated=new Date(e)),s(n,"author","managingEditor",t,!0),n.items=i("item",r.children).map(function(e){var t,n={};return e=e.children,s(n,"id","guid",e),s(n,"title","title",e),s(n,"link","link",e),s(n,"description","description",e),(t=a("pubDate",e))&&(n.pubDate=new Date(t)),n}))),this.dom=n,l.prototype._handleCallback.call(this,r?null:Error("couldn't find root of feed"))},e.exports=r},function(e,t,n){function r(e){this._cbs=e||{}}e.exports=r;var i=n(116).EVENTS;Object.keys(i).forEach(function(e){if(0===i[e])e="on"+e,r.prototype[e]=function(){this._cbs[e]&&this._cbs[e]()};else if(1===i[e])e="on"+e,r.prototype[e]=function(t){this._cbs[e]&&this._cbs[e](t)};else{if(2!==i[e])throw Error("wrong number of arguments");e="on"+e,r.prototype[e]=function(t,n){this._cbs[e]&&this._cbs[e](t,n)}}})},function(e,t,n){function r(e){o.call(this,new i(this),e)}function i(e){this.scope=e}e.exports=r;var o=n(382);n(42)(r,o),r.prototype.readable=!0;var a=n(116).EVENTS;Object.keys(a).forEach(function(e){if(0===a[e])i.prototype["on"+e]=function(){this.scope.emit(e)};else if(1===a[e])i.prototype["on"+e]=function(t){this.scope.emit(e,t)};else{if(2!==a[e])throw Error("wrong number of arguments!");i.prototype["on"+e]=function(t,n){this.scope.emit(e,t,n)}}})},function(e,t,n){"use strict";function r(e){return e in a?a[e]:a[e]=e.replace(i,"-$&").toLowerCase().replace(o,"-ms-")}var i=/[A-Z]/g,o=/^ms-/,a={};e.exports=r},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,p=n?i-1:0,f=n?-1:1,h=e[t+p];for(p+=f,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+p],p+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+p],p+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=l}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,p=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,d=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+p>=1?f/u:f*Math.pow(2,1-p),t*u>=2&&(a++,u/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*u-1)*Math.pow(2,i),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[n+h]=255&a,h+=d,a/=256,l-=8);e[n+h-d]|=128*m}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){var t=e.prefixMap,n=e.plugins,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};return function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r="undefined"!=typeof navigator?navigator.userAgent:void 0;if(this._userAgent=n.userAgent||r,this._keepUnprefixed=n.keepUnprefixed||!1,this._userAgent&&(this._browserInfo=(0,u.default)(this._userAgent)),!this._browserInfo||!this._browserInfo.cssPrefix)return this._useFallback=!0,!1;this.prefixedKeyframes=(0,c.default)(this._browserInfo.browserName,this._browserInfo.browserVersion,this._browserInfo.cssPrefix);var o=this._browserInfo.browserName&&t[this._browserInfo.browserName];if(o){this._requiresPrefix={};for(var a in o)o[a]>=this._browserInfo.browserVersion&&(this._requiresPrefix[a]=!0);this._hasPropsRequiringPrefix=Object.keys(this._requiresPrefix).length>0}else this._useFallback=!0;this._metaData={browserVersion:this._browserInfo.browserVersion,browserName:this._browserInfo.browserName,cssPrefix:this._browserInfo.cssPrefix,jsPrefix:this._browserInfo.jsPrefix,keepUnprefixed:this._keepUnprefixed,requiresPrefix:this._requiresPrefix}}return a(e,[{key:"prefix",value:function(e){return this._useFallback?r(e):this._hasPropsRequiringPrefix?this._prefixStyle(e):e}},{key:"_prefixStyle",value:function(e){for(var t in e){var r=e[t];if((0,v.default)(r))e[t]=this.prefix(r);else if(Array.isArray(r)){for(var i=[],o=0,a=r.length;o<a;++o){var s=(0,y.default)(n,t,r[o],e,this._metaData);(0,d.default)(i,s||r[o])}i.length>0&&(e[t]=i)}else{var u=(0,y.default)(n,t,r,e,this._metaData);u&&(e[t]=u),this._requiresPrefix.hasOwnProperty(t)&&(e[this._browserInfo.jsPrefix+(0,f.default)(t)]=r,this._keepUnprefixed||delete e[t])}}return e}}],[{key:"prefixAll",value:function(e){return r(e)}}]),e}()}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=o;var s=n(790),u=r(s),l=n(791),c=r(l),p=n(210),f=r(p),h=n(383),d=r(h),m=n(384),v=r(m),g=n(385),y=r(g);e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={plugins:[],prefixMap:{chrome:{appearance:64,userSelect:53,textEmphasisPosition:64,textEmphasis:64,textEmphasisStyle:64,textEmphasisColor:64,boxDecorationBreak:64,clipPath:54,maskImage:64,maskMode:64,maskRepeat:64,maskPosition:64,maskClip:64,maskOrigin:64,maskSize:64,maskComposite:64,mask:64,maskBorderSource:64,maskBorderMode:64,maskBorderSlice:64,maskBorderWidth:64,maskBorderOutset:64,maskBorderRepeat:64,maskBorder:64,maskType:64,textDecorationStyle:56,textDecorationSkip:56,textDecorationLine:56,textDecorationColor:56,filter:52,fontFeatureSettings:47,breakAfter:49,breakBefore:49,breakInside:49,columnCount:49,columnFill:49,columnGap:49,columnRule:49,columnRuleColor:49,columnRuleStyle:49,columnRuleWidth:49,columns:49,columnSpan:49,columnWidth:49,writingMode:47},safari:{flex:8,flexBasis:8,flexDirection:8,flexGrow:8,flexFlow:8,flexShrink:8,flexWrap:8,alignContent:8,alignItems:8,alignSelf:8,justifyContent:8,order:8,transform:8,transformOrigin:8,transformOriginX:8,transformOriginY:8,backfaceVisibility:8,perspective:8,perspectiveOrigin:8,transformStyle:8,transformOriginZ:8,animation:8,animationDelay:8,animationDirection:8,animationFillMode:8,animationDuration:8,animationIterationCount:8,animationName:8,animationPlayState:8,animationTimingFunction:8,appearance:11,userSelect:11,backdropFilter:11,fontKerning:9,scrollSnapType:10.1,scrollSnapPointsX:10.1,scrollSnapPointsY:10.1,scrollSnapDestination:10.1,scrollSnapCoordinate:10.1,boxDecorationBreak:11,clipPath:11,maskImage:11,maskMode:11,maskRepeat:11,maskPosition:11,maskClip:11,maskOrigin:11,maskSize:11,maskComposite:11,mask:11,maskBorderSource:11,maskBorderMode:11,maskBorderSlice:11,maskBorderWidth:11,maskBorderOutset:11,maskBorderRepeat:11,maskBorder:11,maskType:11,textDecorationStyle:11,textDecorationSkip:11,textDecorationLine:11,textDecorationColor:11,shapeImageThreshold:10,shapeImageMargin:10,shapeImageOutside:10,filter:9,hyphens:11,flowInto:11,flowFrom:11,breakBefore:8,breakAfter:8,breakInside:8,regionFragment:11,columnCount:8,columnFill:8,columnGap:8,columnRule:8,columnRuleColor:8,columnRuleStyle:8,columnRuleWidth:8,columns:8,columnSpan:8,columnWidth:8,writingMode:11},firefox:{appearance:58,userSelect:58,textAlignLast:48,tabSize:58,hyphens:42,breakAfter:51,breakBefore:51,breakInside:51,columnCount:51,columnFill:51,columnGap:51,columnRule:51,columnRuleColor:51,columnRuleStyle:51,columnRuleWidth:51,columns:51,columnSpan:51,columnWidth:51},opera:{flex:16,flexBasis:16,flexDirection:16,flexGrow:16,flexFlow:16,flexShrink:16,flexWrap:16,alignContent:16,alignItems:16,alignSelf:16,justifyContent:16,order:16,transform:22,transformOrigin:22,transformOriginX:22,transformOriginY:22,backfaceVisibility:22,perspective:22,perspectiveOrigin:22,transformStyle:22,transformOriginZ:22,animation:29,animationDelay:29,animationDirection:29,animationFillMode:29,animationDuration:29,animationIterationCount:29,animationName:29,animationPlayState:29,animationTimingFunction:29,appearance:49,userSelect:40,fontKerning:19,textEmphasisPosition:49,textEmphasis:49,textEmphasisStyle:49,textEmphasisColor:49,boxDecorationBreak:49,clipPath:41,maskImage:49,maskMode:49,maskRepeat:49,maskPosition:49,maskClip:49,maskOrigin:49,maskSize:49,maskComposite:49,mask:49,maskBorderSource:49,maskBorderMode:49,maskBorderSlice:49,maskBorderWidth:49,maskBorderOutset:49,maskBorderRepeat:49,maskBorder:49,maskType:49,textDecorationStyle:43,textDecorationSkip:43,textDecorationLine:43,textDecorationColor:43,filter:39,fontFeatureSettings:34,breakAfter:36,breakBefore:36,breakInside:36,columnCount:36,columnFill:36,columnGap:36,columnRule:36,columnRuleColor:36,columnRuleStyle:36,columnRuleWidth:36,columns:36,columnSpan:36,columnWidth:36,writingMode:34},ie:{userSelect:11,wrapFlow:11,wrapThrough:11,wrapMargin:11,scrollSnapType:11,scrollSnapPointsX:11,scrollSnapPointsY:11,scrollSnapDestination:11,scrollSnapCoordinate:11,hyphens:11,flowInto:11,flowFrom:11,breakBefore:11,breakAfter:11,breakInside:11,regionFragment:11,gridTemplateColumns:11,gridTemplateRows:11,gridTemplateAreas:11,gridTemplate:11,gridAutoColumns:11,gridAutoRows:11,gridAutoFlow:11,grid:11,gridRowStart:11,gridColumnStart:11,gridRowEnd:11,gridRow:11,gridColumn:11,gridColumnEnd:11,gridColumnGap:11,gridRowGap:11,gridArea:11,gridGap:11,textSizeAdjust:11,writingMode:11},edge:{userSelect:16,wrapFlow:16,wrapThrough:16,wrapMargin:16,scrollSnapType:16,scrollSnapPointsX:16,scrollSnapPointsY:16,scrollSnapDestination:16,scrollSnapCoordinate:16,hyphens:16,flowInto:16,flowFrom:16,breakBefore:16,breakAfter:16,breakInside:16,regionFragment:16,gridTemplateColumns:15,gridTemplateRows:15,gridTemplateAreas:15,gridTemplate:15,gridAutoColumns:15,gridAutoRows:15,gridAutoFlow:15,grid:15,gridRowStart:15,gridColumnStart:15,gridRowEnd:15,gridRow:15,gridColumn:15,gridColumnEnd:15,gridColumnGap:15,gridRowGap:15,gridArea:15,gridGap:15},ios_saf:{flex:8.1,flexBasis:8.1,flexDirection:8.1,flexGrow:8.1,flexFlow:8.1,flexShrink:8.1,flexWrap:8.1,alignContent:8.1,alignItems:8.1,alignSelf:8.1,justifyContent:8.1,order:8.1,transform:8.1,transformOrigin:8.1,transformOriginX:8.1,transformOriginY:8.1,backfaceVisibility:8.1,perspective:8.1,perspectiveOrigin:8.1,transformStyle:8.1,transformOriginZ:8.1,animation:8.1,animationDelay:8.1,animationDirection:8.1,animationFillMode:8.1,animationDuration:8.1,animationIterationCount:8.1,animationName:8.1,animationPlayState:8.1,animationTimingFunction:8.1,appearance:11,userSelect:11,backdropFilter:11,fontKerning:11,scrollSnapType:11,scrollSnapPointsX:11,scrollSnapPointsY:11,scrollSnapDestination:11,scrollSnapCoordinate:11,boxDecorationBreak:11,clipPath:11,maskImage:11,maskMode:11,maskRepeat:11,maskPosition:11,maskClip:11,maskOrigin:11,maskSize:11,maskComposite:11,mask:11,maskBorderSource:11,maskBorderMode:11,maskBorderSlice:11,maskBorderWidth:11,maskBorderOutset:11,maskBorderRepeat:11,maskBorder:11,maskType:11,textSizeAdjust:11,textDecorationStyle:11,textDecorationSkip:11,textDecorationLine:11,textDecorationColor:11,shapeImageThreshold:10,shapeImageMargin:10,shapeImageOutside:10,filter:9,hyphens:11,flowInto:11,flowFrom:11,breakBefore:8.1,breakAfter:8.1,breakInside:8.1,regionFragment:11,columnCount:8.1,columnFill:8.1,columnGap:8.1,columnRule:8.1,columnRuleColor:8.1,columnRuleStyle:8.1,columnRuleWidth:8.1,columns:8.1,columnSpan:8.1,columnWidth:8.1,writingMode:11},android:{borderImage:4.2,borderImageOutset:4.2,borderImageRepeat:4.2,borderImageSlice:4.2,borderImageSource:4.2,borderImageWidth:4.2,flex:4.2,flexBasis:4.2,flexDirection:4.2,flexGrow:4.2,flexFlow:4.2,flexShrink:4.2,flexWrap:4.2,alignContent:4.2,alignItems:4.2,alignSelf:4.2,justifyContent:4.2,order:4.2,transition:4.2,transitionDelay:4.2,transitionDuration:4.2,transitionProperty:4.2,transitionTimingFunction:4.2,transform:4.4,transformOrigin:4.4,transformOriginX:4.4,transformOriginY:4.4,backfaceVisibility:4.4,perspective:4.4,perspectiveOrigin:4.4,transformStyle:4.4,transformOriginZ:4.4,animation:4.4,animationDelay:4.4,animationDirection:4.4,animationFillMode:4.4,animationDuration:4.4,animationIterationCount:4.4,animationName:4.4,animationPlayState:4.4,animationTimingFunction:4.4,appearance:56,userSelect:4.4,fontKerning:4.4,textEmphasisPosition:56,textEmphasis:56,textEmphasisStyle:56,textEmphasisColor:56,boxDecorationBreak:56,clipPath:4.4,maskImage:56,maskMode:56,maskRepeat:56,maskPosition:56,maskClip:56,maskOrigin:56,maskSize:56,maskComposite:56,mask:56,maskBorderSource:56,maskBorderMode:56,maskBorderSlice:56,maskBorderWidth:56,maskBorderOutset:56,maskBorderRepeat:56,maskBorder:56,maskType:56,filter:4.4,fontFeatureSettings:4.4,breakAfter:4.4,breakBefore:4.4,breakInside:4.4,columnCount:4.4,columnFill:4.4,columnGap:4.4,columnRule:4.4,columnRuleColor:4.4,columnRuleStyle:4.4,columnRuleWidth:4.4,columns:4.4,columnSpan:4.4,columnWidth:4.4,writingMode:4.4},and_chr:{appearance:61,textEmphasisPosition:61,textEmphasis:61,textEmphasisStyle:61,textEmphasisColor:61,boxDecorationBreak:61,maskImage:61,maskMode:61,maskRepeat:61,maskPosition:61,maskClip:61,maskOrigin:61,maskSize:61,maskComposite:61,mask:61,maskBorderSource:61,maskBorderMode:61,maskBorderSlice:61,maskBorderWidth:61,maskBorderOutset:61,maskBorderRepeat:61,maskBorder:61,maskType:61},and_uc:{flex:11.4,flexBasis:11.4,flexDirection:11.4,flexGrow:11.4,flexFlow:11.4,flexShrink:11.4,flexWrap:11.4,alignContent:11.4,alignItems:11.4,alignSelf:11.4,justifyContent:11.4,order:11.4,transform:11.4,transformOrigin:11.4,transformOriginX:11.4,transformOriginY:11.4,backfaceVisibility:11.4,perspective:11.4,perspectiveOrigin:11.4,transformStyle:11.4,transformOriginZ:11.4,animation:11.4,animationDelay:11.4,animationDirection:11.4,animationFillMode:11.4,animationDuration:11.4,animationIterationCount:11.4,animationName:11.4,animationPlayState:11.4,animationTimingFunction:11.4,appearance:11.4,userSelect:11.4,textEmphasisPosition:11.4,textEmphasis:11.4,textEmphasisStyle:11.4,textEmphasisColor:11.4,clipPath:11.4,maskImage:11.4,maskMode:11.4,maskRepeat:11.4,maskPosition:11.4,maskClip:11.4,maskOrigin:11.4,maskSize:11.4,maskComposite:11.4,mask:11.4,maskBorderSource:11.4,maskBorderMode:11.4,maskBorderSlice:11.4,maskBorderWidth:11.4,maskBorderOutset:11.4,maskBorderRepeat:11.4,maskBorder:11.4,maskType:11.4,textSizeAdjust:11.4,filter:11.4,hyphens:11.4,fontFeatureSettings:11.4,breakAfter:11.4,breakBefore:11.4,breakInside:11.4,columnCount:11.4,columnFill:11.4,columnGap:11.4,columnRule:11.4,columnRuleColor:11.4,columnRuleStyle:11.4,columnRuleWidth:11.4,columns:11.4,columnSpan:11.4,columnWidth:11.4,writingMode:11.4},op_mini:{}}},e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,a=r.browserVersion,s=r.cssPrefix,u=r.keepUnprefixed;if("string"==typeof t&&t.indexOf("cross-fade(")>-1&&("chrome"===i||"opera"===i||"and_chr"===i||("ios_saf"===i||"safari"===i)&&a<10))return(0,o.default)(t.replace(/cross-fade\(/g,s+"cross-fade("),t,u)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,u=r.browserVersion,l=r.cssPrefix,c=r.keepUnprefixed;return"cursor"!==e||!a[t]||"firefox"!==i&&"chrome"!==i&&"safari"!==i&&"opera"!==i?"cursor"===e&&s[t]&&("firefox"===i&&u<24||"chrome"===i&&u<37||"safari"===i&&u<9||"opera"===i&&u<24)?(0,o.default)(l+t,t,c):void 0:(0,o.default)(l+t,t,c)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a={grab:!0,grabbing:!0},s={"zoom-in":!0,"zoom-out":!0};e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,a=r.browserVersion,s=r.cssPrefix,u=r.keepUnprefixed;if("string"==typeof t&&t.indexOf("filter(")>-1&&("ios_saf"===i||"safari"===i&&a<9.1))return(0,o.default)(t.replace(/filter\(/g,s+"filter("),t,u)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,s=r.browserVersion,u=r.cssPrefix,l=r.keepUnprefixed;if("display"===e&&a[t]&&("chrome"===i&&s<29&&s>20||("safari"===i||"ios_saf"===i)&&s<9&&s>6||"opera"===i&&(15===s||16===s)))return(0,o.default)(u+t,t,l)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a={flex:!0,"inline-flex":!0};e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,u=r.browserVersion,c=r.cssPrefix,p=r.keepUnprefixed,f=r.requiresPrefix;if((l.indexOf(e)>-1||"display"===e&&"string"==typeof t&&t.indexOf("flex")>-1)&&("firefox"===i&&u<22||"chrome"===i&&u<21||("safari"===i||"ios_saf"===i)&&u<=6.1||"android"===i&&u<4.4||"and_uc"===i)){if(delete f[e],p||Array.isArray(n[e])||delete n[e],"flexDirection"===e&&"string"==typeof t&&(t.indexOf("column")>-1?n.WebkitBoxOrient="vertical":n.WebkitBoxOrient="horizontal",t.indexOf("reverse")>-1?n.WebkitBoxDirection="reverse":n.WebkitBoxDirection="normal"),"display"===e&&a.hasOwnProperty(t))return(0,o.default)(c+a[t],t,p);s.hasOwnProperty(e)&&(n[s[e]]=a[t]||t)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple",flex:"box","inline-flex":"inline-box"},s={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines"},u=["alignContent","alignSelf","order","flexGrow","flexShrink","flexBasis","flexDirection"],l=Object.keys(s).concat(u);e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,s=r.browserVersion,u=r.cssPrefix,l=r.keepUnprefixed;if("string"==typeof t&&a.test(t)&&("firefox"===i&&s<16||"chrome"===i&&s<26||("safari"===i||"ios_saf"===i)&&s<7||("opera"===i||"op_mini"===i)&&s<12.1||"android"===i&&s<4.4||"and_uc"===i))return(0,o.default)(u+t,t,l)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/;e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,a=r.cssPrefix,s=r.keepUnprefixed;if("string"==typeof t&&t.indexOf("image-set(")>-1&&("chrome"===i||"opera"===i||"and_chr"===i||"and_uc"===i||"ios_saf"===i||"safari"===i))return(0,o.default)(t.replace(/image-set\(/g,a+"image-set("),t,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.browserName,a=r.cssPrefix,s=r.keepUnprefixed;if("position"===e&&"sticky"===t&&("safari"===i||"ios_saf"===i))return(0,o.default)(a+t,t,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.cssPrefix,u=r.keepUnprefixed;if(a.hasOwnProperty(e)&&s.hasOwnProperty(t))return(0,o.default)(i+t,t,u)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(50),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},s={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){var i=r.cssPrefix,u=r.keepUnprefixed,l=r.requiresPrefix;if("string"==typeof t&&a.hasOwnProperty(e)){s||(s=Object.keys(l).map(function(e){return(0,o.default)(e)}));var c=t.split(/,(?![^()]*(?:\([^()]*\))?\))/g);return s.forEach(function(e){c.forEach(function(t,n){t.indexOf(e)>-1&&"order"!==e&&(c[n]=t.replace(e,i+e)+(u?","+t:""))})}),c.join(",")}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(367),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},s=void 0;e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){function t(e){for(var i in e){var o=e[i];if((0,f.default)(o))e[i]=t(o);else if(Array.isArray(o)){for(var s=[],l=0,p=o.length;l<p;++l){var h=(0,u.default)(r,i,o[l],e,n);(0,c.default)(s,h||o[l])}s.length>0&&(e[i]=s)}else{var d=(0,u.default)(r,i,o,e,n);d&&(e[i]=d),(0,a.default)(n,i,e)}}return e}var n=e.prefixMap,r=e.plugins;return t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(792),a=r(o),s=n(385),u=r(s),l=n(383),c=r(l),p=n(384),f=r(p);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(777),o=r(i),a=n(789),s=r(a),u=n(780),l=r(u),c=n(779),p=r(c),f=n(781),h=r(f),d=n(782),m=r(d),v=n(783),g=r(v),y=n(784),_=r(y),b=n(785),x=r(b),w=n(786),k=r(w),E=n(787),S=r(E),C=n(788),A=r(C),D=[p.default,l.default,h.default,g.default,_.default,x.default,k.default,S.default,A.default,m.default];t.default=(0,o.default)({prefixMap:s.default.prefixMap,plugins:D}),e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("string"==typeof t&&!(0,o.default)(t)&&t.indexOf("cross-fade(")>-1)return a.map(function(e){return t.replace(/cross-fade\(/g,e+"cross-fade(")})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(112),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=["-webkit-",""];e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("cursor"===e&&o.hasOwnProperty(t))return i.map(function(e){return e+t})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=["-webkit-","-moz-",""],o={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("string"==typeof t&&!(0,o.default)(t)&&t.indexOf("filter(")>-1)return a.map(function(e){return t.replace(/filter\(/g,e+"filter(")})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(112),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=["-webkit-",""];e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("display"===e&&i.hasOwnProperty(t))return i[t]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]};e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){"flexDirection"===e&&"string"==typeof t&&(t.indexOf("column")>-1?n.WebkitBoxOrient="vertical":n.WebkitBoxOrient="horizontal",t.indexOf("reverse")>-1?n.WebkitBoxDirection="reverse":n.WebkitBoxDirection="normal"),o.hasOwnProperty(e)&&(n[o[e]]=i[t]||t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},o={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines"};e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("string"==typeof t&&!(0,o.default)(t)&&s.test(t))return a.map(function(e){return e+t})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(112),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=["-webkit-","-moz-",""],s=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/;e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("string"==typeof t&&!(0,o.default)(t)&&t.indexOf("image-set(")>-1)return a.map(function(e){return t.replace(/image-set\(/g,e+"image-set(")})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(112),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=["-webkit-",""];e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if("position"===e&&"sticky"===t)return["-webkit-sticky","sticky"]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(o.hasOwnProperty(e)&&a.hasOwnProperty(t))return i.map(function(e){return e+t})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=["-webkit-","-moz-",""],o={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},a={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if((0,l.default)(e))return e;for(var n=e.split(/,(?![^()]*(?:\([^()]*\))?\))/g),r=0,i=n.length;r<i;++r){var o=n[r],a=[o];for(var u in t){var c=(0,s.default)(u);if(o.indexOf(c)>-1&&"order"!==c)for(var p=t[u],f=0,d=p.length;f<d;++f)a.unshift(o.replace(c,h[p[f]]+c))}n[r]=a.join(",")}return n.join(",")}function o(e,t,n,r){if("string"==typeof t&&f.hasOwnProperty(e)){var o=i(t,r),a=o.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(e){return!/-moz-|-ms-/.test(e)}).join(",");if(e.indexOf("Webkit")>-1)return a;var s=o.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(e){return!/-webkit-|-ms-/.test(e)}).join(",");return e.indexOf("Moz")>-1?s:(n["Webkit"+(0,p.default)(e)]=a,n["Moz"+(0,p.default)(e)]=s,o)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var a=n(367),s=r(a),u=n(112),l=r(u),c=n(210),p=r(c),f={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},h={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=["Webkit"],i=["Moz"],o=["ms"],a=["Webkit","Moz"],s=["Webkit","ms"],u=["Webkit","Moz","ms"];t.default={plugins:[],prefixMap:{appearance:a,userSelect:u,textEmphasisPosition:r,textEmphasis:r,textEmphasisStyle:r,textEmphasisColor:r,boxDecorationBreak:r,clipPath:r,maskImage:r,maskMode:r,maskRepeat:r,maskPosition:r,maskClip:r,maskOrigin:r,maskSize:r,maskComposite:r,mask:r,maskBorderSource:r,maskBorderMode:r,maskBorderSlice:r,maskBorderWidth:r,maskBorderOutset:r,maskBorderRepeat:r,maskBorder:r,maskType:r,textDecorationStyle:r,textDecorationSkip:r,textDecorationLine:r,textDecorationColor:r,filter:r,fontFeatureSettings:r,breakAfter:u,breakBefore:u,breakInside:u,columnCount:a,columnFill:a,columnGap:a,columnRule:a,columnRuleColor:a,columnRuleStyle:a,columnRuleWidth:a,columns:a,columnSpan:a,columnWidth:a,writingMode:s,flex:r,flexBasis:r,flexDirection:r,flexGrow:r,flexFlow:r,flexShrink:r,flexWrap:r,alignContent:r,alignItems:r,alignSelf:r,justifyContent:r,order:r,transform:r,transformOrigin:r,transformOriginX:r,transformOriginY:r,backfaceVisibility:r,perspective:r,perspectiveOrigin:r,transformStyle:r,transformOriginZ:r,animation:r,animationDelay:r,animationDirection:r,animationFillMode:r,animationDuration:r,animationIterationCount:r,animationName:r,animationPlayState:r,animationTimingFunction:r,backdropFilter:r,fontKerning:r,scrollSnapType:s,scrollSnapPointsX:s,scrollSnapPointsY:s,scrollSnapDestination:s,scrollSnapCoordinate:s,shapeImageThreshold:r,shapeImageMargin:r,shapeImageOutside:r,hyphens:u,flowInto:s,flowFrom:s,regionFragment:s,textAlignLast:i,tabSize:i,wrapFlow:o,wrapThrough:o,wrapMargin:o,gridTemplateColumns:o,gridTemplateRows:o,gridTemplateAreas:o,gridTemplate:o,gridAutoColumns:o,gridAutoRows:o,gridAutoFlow:o,grid:o,gridRowStart:o,gridColumnStart:o,gridRowEnd:o,gridRow:o,gridColumn:o,gridColumnEnd:o,gridColumnGap:o,gridRowGap:o,gridArea:o,gridGap:o,textSizeAdjust:s,borderImage:r,borderImageOutset:r,borderImageRepeat:r,borderImageSlice:r,borderImageSource:r,borderImageWidth:r,transitionDelay:r,transitionDuration:r,transitionProperty:r,transitionTimingFunction:r}},e.exports=t.default},function(e,t,n){"use strict";function r(e){if(e.firefox)return"firefox";if(e.mobile||e.tablet){if(e.ios)return"ios_saf";if(e.android)return"android";if(e.opera)return"op_mini"}for(var t in u)if(e.hasOwnProperty(t))return u[t]}function i(e){var t=a.default._detect(e);t.yandexbrowser&&(t=a.default._detect(e.replace(/YaBrowser\/[0-9.]*/,"")));for(var n in s)if(t.hasOwnProperty(n)){var i=s[n];t.jsPrefix=i,t.cssPrefix="-"+i.toLowerCase()+"-";break}return t.browserName=r(t),t.version?t.browserVersion=parseFloat(t.version):t.browserVersion=parseInt(parseFloat(t.osversion),10),t.osVersion=parseFloat(t.osversion),"ios_saf"===t.browserName&&t.browserVersion>t.osVersion&&(t.browserVersion=t.osVersion),"android"===t.browserName&&t.chrome&&t.browserVersion>37&&(t.browserName="and_chr"),"android"===t.browserName&&t.osVersion<5&&(t.browserVersion=t.osVersion),"android"===t.browserName&&t.samsungBrowser&&(t.browserName="and_chr",t.browserVersion=44),t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(571),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s={chrome:"Webkit",safari:"Webkit",ios:"Webkit",android:"Webkit",phantom:"Webkit",opera:"Webkit",webos:"Webkit",blackberry:"Webkit",bada:"Webkit",tizen:"Webkit",chromium:"Webkit",vivaldi:"Webkit",firefox:"Moz",seamoney:"Moz",sailfish:"Moz",msie:"ms",msedge:"ms"},u={chrome:"chrome",chromium:"chrome",safari:"safari",firfox:"firefox",msedge:"edge",opera:"opera",vivaldi:"opera",msie:"ie"};e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){return"chrome"===e&&t<43||("safari"===e||"ios_saf"===e)&&t<9||"opera"===e&&t<30||"android"===e&&t<=4.4||"and_uc"===e?n+"keyframes":"keyframes"}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){if(e.hasOwnProperty(t))for(var r=e[t],i=0,a=r.length;i<a;++i)n[r[i]+(0,o.default)(t)]=n[t]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(210),o=function(e){return e&&e.__esModule?e:{default:e}}(i);e.exports=t.default},function(e,t,n){"use strict";var r=function(e,t,n,r,i,o,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,s],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};e.exports=r},function(e,t){e.exports=FormData},function(e,t,n){"use strict";function r(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}var i=n(797),o=n(796);e.exports.Type=n(16),e.exports.Schema=n(81),e.exports.FAILSAFE_SCHEMA=n(212),e.exports.JSON_SCHEMA=n(389),e.exports.CORE_SCHEMA=n(388),e.exports.DEFAULT_SAFE_SCHEMA=n(118),e.exports.DEFAULT_FULL_SCHEMA=n(145),e.exports.load=i.load,e.exports.loadAll=i.loadAll,e.exports.safeLoad=i.safeLoad,e.exports.safeLoadAll=i.safeLoadAll,e.exports.dump=o.dump,e.exports.safeDump=o.safeDump,e.exports.YAMLException=n(117),e.exports.MINIMAL_SCHEMA=n(212),e.exports.SAFE_SCHEMA=n(118),e.exports.DEFAULT_SCHEMA=n(145),e.exports.scan=r("scan"),e.exports.parse=r("parse"),e.exports.compose=r("compose"),e.exports.addConstructor=r("addConstructor")},function(e,t,n){"use strict";function r(e,t){var n,r,i,o,a,s,u;if(null===t)return{};for(n={},r=Object.keys(t),i=0,o=r.length;i<o;i+=1)a=r[i],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),u=e.compiledTypeMap.fallback[a],u&&j.call(u.styleAliases,s)&&(s=u.styleAliases[s]),n[a]=s;return n}function i(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else{if(!(e<=4294967295))throw new T("code point within a string may not be greater than 0xFFFFFFFF");n="U",r=8}return"\\"+n+M.repeat("0",r-t.length)+t}function o(e){this.schema=e.schema||P,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=M.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=r(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function a(e,t){for(var n,r=M.repeat(" ",t),i=0,o=-1,a="",s=e.length;i<s;)o=e.indexOf("\n",i),-1===o?(n=e.slice(i),i=s):(n=e.slice(i,o+1),i=o+1),n.length&&"\n"!==n&&(a+=r),a+=n;return a}function s(e,t){return"\n"+M.repeat(" ",e.indent*t)}function u(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function l(e){return e===B||e===F}function c(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function p(e){return c(e)&&65279!==e&&e!==G&&e!==Z&&e!==Q&&e!==te&&e!==re&&e!==K&&e!==z}function f(e){return c(e)&&65279!==e&&!l(e)&&e!==J&&e!==Y&&e!==K&&e!==G&&e!==Z&&e!==Q&&e!==te&&e!==re&&e!==z&&e!==W&&e!==H&&e!==L&&e!==ne&&e!==X&&e!==V&&e!==q&&e!==U&&e!==$&&e!==ee}function h(e,t,n,r,i){var o,a,s=!1,u=!1,h=-1!==r,d=-1,m=f(e.charCodeAt(0))&&!l(e.charCodeAt(e.length-1));if(t)for(o=0;o<e.length;o++){if(a=e.charCodeAt(o),!c(a))return ce;m=m&&p(a)}else{for(o=0;o<e.length;o++){if((a=e.charCodeAt(o))===N)s=!0,h&&(u=u||o-d-1>r&&" "!==e[d+1],d=o);else if(!c(a))return ce;m=m&&p(a)}u=u||h&&o-d-1>r&&" "!==e[d+1]}return s||u?" "===e[0]&&n>9?ce:u?le:ue:m&&!i(e)?ae:se}function d(e,t,n,r){e.dump=function(){function i(t){return u(e,t)}if(0===t.length)return"''";if(!e.noCompatMode&&-1!==oe.indexOf(t))return"'"+t+"'";var o=e.indent*Math.max(1,n),s=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),l=r||e.flowLevel>-1&&n>=e.flowLevel;switch(h(t,l,e.indent,s,i)){case ae:return t;case se:return"'"+t.replace(/'/g,"''")+"'";case ue:return"|"+m(t,e.indent)+v(a(t,o));case le:return">"+m(t,e.indent)+v(a(g(t,s),o));case ce:return'"'+_(t)+'"';default:throw new T("impossible error: invalid scalar style")}}()}function m(e,t){var n=" "===e[0]?String(t):"",r="\n"===e[e.length-1];return n+(!r||"\n"!==e[e.length-2]&&"\n"!==e?r?"":"-":"+")+"\n"}function v(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function g(e,t){for(var n,r,i=/(\n+)([^\n]*)/g,o=function(){var n=e.indexOf("\n");return n=-1!==n?n:e.length,i.lastIndex=n,y(e.slice(0,n),t)}(),a="\n"===e[0]||" "===e[0];r=i.exec(e);){var s=r[1],u=r[2];n=" "===u[0],o+=s+(a||n||""===u?"":"\n")+y(u,t),a=n}return o}function y(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,o=0,a=0,s=0,u="";n=i.exec(e);)s=n.index,s-o>t&&(r=a>o?a:s,u+="\n"+e.slice(o,r),o=r+1),a=s;return u+="\n",e.length-o>t&&a>o?u+=e.slice(o,a)+"\n"+e.slice(a+1):u+=e.slice(o),u.slice(1)}function _(e){for(var t,n,r,o="",a=0;a<e.length;a++)t=e.charCodeAt(a),t>=55296&&t<=56319&&(n=e.charCodeAt(a+1))>=56320&&n<=57343?(o+=i(1024*(t-55296)+n-56320+65536),a++):(r=ie[t],o+=!r&&c(t)?e[a]:r||i(t));return o}function b(e,t,n){var r,i,o="",a=e.tag;for(r=0,i=n.length;r<i;r+=1)S(e,t,n[r],!1,!1)&&(0!==r&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=a,e.dump="["+o+"]"}function x(e,t,n,r){var i,o,a="",u=e.tag;for(i=0,o=n.length;i<o;i+=1)S(e,t+1,n[i],!0,!0)&&(r&&0===i||(a+=s(e,t)),e.dump&&N===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=u,e.dump=a||"[]"}function w(e,t,n){var r,i,o,a,s,u="",l=e.tag,c=Object.keys(n);for(r=0,i=c.length;r<i;r+=1)s=e.condenseFlow?'"':"",0!==r&&(s+=", "),o=c[r],a=n[o],S(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),S(e,t,a,!1,!1)&&(s+=e.dump,u+=s));e.tag=l,e.dump="{"+u+"}"}function k(e,t,n,r){var i,o,a,u,l,c,p="",f=e.tag,h=Object.keys(n);if(!0===e.sortKeys)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new T("sortKeys must be a boolean or a function");for(i=0,o=h.length;i<o;i+=1)c="",r&&0===i||(c+=s(e,t)),a=h[i],u=n[a],S(e,t+1,a,!0,!0,!0)&&(l=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,l&&(e.dump&&N===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,l&&(c+=s(e,t)),S(e,t+1,u,!0,l)&&(e.dump&&N===e.dump.charCodeAt(0)?c+=":":c+=": ",c+=e.dump,p+=c));e.tag=f,e.dump=p||"{}"}function E(e,t,n){var r,i,o,a,s,u;for(i=n?e.explicitTypes:e.implicitTypes,o=0,a=i.length;o<a;o+=1)if(s=i[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(u=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===R.call(s.represent))r=s.represent(t,u);else{if(!j.call(s.represent,u))throw new T("!<"+s.tag+'> tag resolver accepts not "'+u+'" style');r=s.represent[u](t,u)}e.dump=r}return!0}return!1}function S(e,t,n,r,i,o){e.tag=null,e.dump=n,E(e,n,!1)||E(e,n,!0);var a=R.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var s,u,l="[object Object]"===a||"[object Array]"===a;if(l&&(s=e.duplicates.indexOf(n),u=-1!==s),(null!==e.tag&&"?"!==e.tag||u||2!==e.indent&&t>0)&&(i=!1),u&&e.usedDuplicates[s])e.dump="*ref_"+s;else{if(l&&u&&!e.usedDuplicates[s]&&(e.usedDuplicates[s]=!0),"[object Object]"===a)r&&0!==Object.keys(e.dump).length?(k(e,t,e.dump,i),u&&(e.dump="&ref_"+s+e.dump)):(w(e,t,e.dump),u&&(e.dump="&ref_"+s+" "+e.dump));else if("[object Array]"===a)r&&0!==e.dump.length?(x(e,t,e.dump,i),u&&(e.dump="&ref_"+s+e.dump)):(b(e,t,e.dump),u&&(e.dump="&ref_"+s+" "+e.dump));else{if("[object String]"!==a){if(e.skipInvalid)return!1;throw new T("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&d(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function C(e,t){var n,r,i=[],o=[];for(A(e,i,o),n=0,r=o.length;n<r;n+=1)t.duplicates.push(i[o[n]]);t.usedDuplicates=new Array(r)}function A(e,t,n){var r,i,o;if(null!==e&&"object"==typeof e)if(-1!==(i=t.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)A(e[i],t,n);else for(r=Object.keys(e),i=0,o=r.length;i<o;i+=1)A(e[r[i]],t,n)}function D(e,t){t=t||{};var n=new o(t);return n.noRefs||C(e,n),S(n,0,e,!0,!0)?n.dump+"\n":""}function O(e,t){return D(e,M.extend({schema:I},t))}var M=n(80),T=n(117),P=n(145),I=n(118),R=Object.prototype.toString,j=Object.prototype.hasOwnProperty,F=9,N=10,B=32,L=33,q=34,z=35,U=37,W=38,V=39,H=42,G=44,J=45,K=58,X=62,Y=63,$=64,Z=91,Q=93,ee=96,te=123,ne=124,re=125,ie={};ie[0]="\\0",ie[7]="\\a",ie[8]="\\b",ie[9]="\\t",ie[10]="\\n",ie[11]="\\v",ie[12]="\\f",ie[13]="\\r",ie[27]="\\e",ie[34]='\\"',ie[92]="\\\\",ie[133]="\\N",ie[160]="\\_",ie[8232]="\\L",ie[8233]="\\P";var oe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ae=1,se=2,ue=3,le=4,ce=5;e.exports.dump=D,e.exports.safeDump=O},function(e,t,n){"use strict";function r(e){return 10===e||13===e}function i(e){return 9===e||32===e}function o(e){return 9===e||32===e||10===e||13===e}function a(e){return 44===e||91===e||93===e||123===e||125===e}function s(e){var t;return 48<=e&&e<=57?e-48:(t=32|e,97<=t&&t<=102?t-97+10:-1)}function u(e){return 120===e?2:117===e?4:85===e?8:0}function l(e){return 48<=e&&e<=57?e-48:-1}function c(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e?"\t":9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function p(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}function f(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||V,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function h(e,t){return new z(t,new U(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function d(e,t){throw h(e,t)}function m(e,t){e.onWarning&&e.onWarning.call(null,h(e,t))}function v(e,t,n,r){var i,o,a,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,o=s.length;i<o;i+=1)9===(a=s.charCodeAt(i))||32<=a&&a<=1114111||d(e,"expected valid JSON character");else Q.test(s)&&d(e,"the stream contains non-printable characters");e.result+=s}}function g(e,t,n,r){var i,o,a,s;for(q.isObject(n)||d(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),a=0,s=i.length;a<s;a+=1)o=i[a],H.call(t,o)||(t[o]=n[o],r[o]=!0)}function y(e,t,n,r,i,o,a,s){var u,l;if(i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(u=0,l=o.length;u<l;u+=1)g(e,t,o[u],n);else g(e,t,o,n);else e.json||H.call(n,i)||!H.call(t,i)||(e.line=a||e.line,e.position=s||e.position,d(e,"duplicated mapping key")),t[i]=o,delete n[i];return t}function _(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):d(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function b(e,t,n){for(var o=0,a=e.input.charCodeAt(e.position);0!==a;){for(;i(a);)a=e.input.charCodeAt(++e.position);if(t&&35===a)do{a=e.input.charCodeAt(++e.position)}while(10!==a&&13!==a&&0!==a);if(!r(a))break;for(_(e),a=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position)}return-1!==n&&0!==o&&e.lineIndent<n&&m(e,"deficient indentation"),o}function x(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!o(t)))}function w(e,t){1===t?e.result+=" ":t>1&&(e.result+=q.repeat("\n",t-1))}function k(e,t,n){var s,u,l,c,p,f,h,d,m,g=e.kind,y=e.result;if(m=e.input.charCodeAt(e.position),o(m)||a(m)||35===m||38===m||42===m||33===m||124===m||62===m||39===m||34===m||37===m||64===m||96===m)return!1;if((63===m||45===m)&&(u=e.input.charCodeAt(e.position+1),o(u)||n&&a(u)))return!1;for(e.kind="scalar",e.result="",l=c=e.position,p=!1;0!==m;){if(58===m){if(u=e.input.charCodeAt(e.position+1),o(u)||n&&a(u))break}else if(35===m){if(s=e.input.charCodeAt(e.position-1),o(s))break}else{if(e.position===e.lineStart&&x(e)||n&&a(m))break;if(r(m)){if(f=e.line,h=e.lineStart,d=e.lineIndent,b(e,!1,-1),e.lineIndent>=t){p=!0,m=e.input.charCodeAt(e.position);continue}e.position=c,e.line=f,e.lineStart=h,e.lineIndent=d;break}}p&&(v(e,l,c,!1),w(e,e.line-f),l=c=e.position,p=!1),i(m)||(c=e.position+1),m=e.input.charCodeAt(++e.position)}return v(e,l,c,!1),!!e.result||(e.kind=g,e.result=y,!1)}function E(e,t){var n,i,o;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(v(e,i,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;i=e.position,e.position++,o=e.position}else r(n)?(v(e,i,o,!0),w(e,b(e,!1,t)),i=o=e.position):e.position===e.lineStart&&x(e)?d(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);d(e,"unexpected end of the stream within a single quoted scalar")}function S(e,t){var n,i,o,a,l,c;if(34!==(c=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(c=e.input.charCodeAt(e.position));){if(34===c)return v(e,n,e.position,!0),e.position++,!0;if(92===c){if(v(e,n,e.position,!0),c=e.input.charCodeAt(++e.position),r(c))b(e,!1,t);else if(c<256&&ie[c])e.result+=oe[c],e.position++;else if((l=u(c))>0){for(o=l,a=0;o>0;o--)c=e.input.charCodeAt(++e.position),(l=s(c))>=0?a=(a<<4)+l:d(e,"expected hexadecimal character");e.result+=p(a),e.position++}else d(e,"unknown escape sequence");n=i=e.position}else r(c)?(v(e,n,i,!0),w(e,b(e,!1,t)),n=i=e.position):e.position===e.lineStart&&x(e)?d(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}d(e,"unexpected end of the stream within a double quoted scalar")}function C(e,t){var n,r,i,a,s,u,l,c,p,f,h,m=!0,v=e.tag,g=e.anchor,_={};if(91===(h=e.input.charCodeAt(e.position)))a=93,l=!1,r=[];else{if(123!==h)return!1;a=125,l=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),h=e.input.charCodeAt(++e.position);0!==h;){if(b(e,!0,t),(h=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=v,e.anchor=g,e.kind=l?"mapping":"sequence",e.result=r,!0;m||d(e,"missed comma between flow collection entries"),p=c=f=null,s=u=!1,63===h&&(i=e.input.charCodeAt(e.position+1),o(i)&&(s=u=!0,e.position++,b(e,!0,t))),n=e.line,I(e,t,G,!1,!0),p=e.tag,c=e.result,b(e,!0,t),h=e.input.charCodeAt(e.position),!u&&e.line!==n||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),b(e,!0,t),I(e,t,G,!1,!0),f=e.result),l?y(e,r,_,p,c,f):s?r.push(y(e,null,_,p,c,f)):r.push(c),b(e,!0,t),h=e.input.charCodeAt(e.position),44===h?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}d(e,"unexpected end of the stream within a flow collection")}function A(e,t){var n,o,a,s,u=Y,c=!1,p=!1,f=t,h=0,m=!1;if(124===(s=e.input.charCodeAt(e.position)))o=!1;else{if(62!==s)return!1;o=!0}for(e.kind="scalar",e.result="";0!==s;)if(43===(s=e.input.charCodeAt(++e.position))||45===s)Y===u?u=43===s?Z:$:d(e,"repeat of a chomping mode identifier");else{if(!((a=l(s))>=0))break;0===a?d(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):p?d(e,"repeat of an indentation width identifier"):(f=t+a-1,p=!0)}if(i(s)){do{s=e.input.charCodeAt(++e.position)}while(i(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!r(s)&&0!==s)}for(;0!==s;){for(_(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!p||e.lineIndent<f)&&32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position);if(!p&&e.lineIndent>f&&(f=e.lineIndent),r(s))h++;else{if(e.lineIndent<f){u===Z?e.result+=q.repeat("\n",c?1+h:h):u===Y&&c&&(e.result+="\n");break}for(o?i(s)?(m=!0,e.result+=q.repeat("\n",c?1+h:h)):m?(m=!1,e.result+=q.repeat("\n",h+1)):0===h?c&&(e.result+=" "):e.result+=q.repeat("\n",h):e.result+=q.repeat("\n",c?1+h:h),c=!0,p=!0,h=0,n=e.position;!r(s)&&0!==s;)s=e.input.charCodeAt(++e.position);v(e,n,e.position,!1)}}return!0}function D(e,t){var n,r,i,a=e.tag,s=e.anchor,u=[],l=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=u),i=e.input.charCodeAt(e.position);0!==i&&45===i&&(r=e.input.charCodeAt(e.position+1),o(r));)if(l=!0,e.position++,b(e,!0,-1)&&e.lineIndent<=t)u.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,I(e,t,K,!1,!0),u.push(e.result),b(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)d(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!l&&(e.tag=a,e.anchor=s,e.kind="sequence",e.result=u,!0)}function O(e,t,n){var r,a,s,u,l,c=e.tag,p=e.anchor,f={},h={},m=null,v=null,g=null,_=!1,x=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=f),l=e.input.charCodeAt(e.position);0!==l;){if(r=e.input.charCodeAt(e.position+1),s=e.line,u=e.position,63!==l&&58!==l||!o(r)){if(!I(e,n,J,!1,!0))break;if(e.line===s){for(l=e.input.charCodeAt(e.position);i(l);)l=e.input.charCodeAt(++e.position);if(58===l)l=e.input.charCodeAt(++e.position),o(l)||d(e,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(y(e,f,h,m,v,null),m=v=g=null),x=!0,_=!1,a=!1,m=e.tag,v=e.result;else{if(!x)return e.tag=c,e.anchor=p,!0;d(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!x)return e.tag=c,e.anchor=p,!0;d(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(_&&(y(e,f,h,m,v,null),m=v=g=null),x=!0,_=!0,a=!0):_?(_=!1,a=!0):d(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=r;if((e.line===s||e.lineIndent>t)&&(I(e,t,X,!0,a)&&(_?v=e.result:g=e.result),_||(y(e,f,h,m,v,g,s,u),m=v=g=null),b(e,!0,-1),l=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==l)d(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return _&&y(e,f,h,m,v,null),x&&(e.tag=c,e.anchor=p,e.kind="mapping",e.result=f),x}function M(e){var t,n,r,i,a=!1,s=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&d(e,"duplication of a tag property"),i=e.input.charCodeAt(++e.position),60===i?(a=!0,i=e.input.charCodeAt(++e.position)):33===i?(s=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,a){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):d(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!o(i);)33===i&&(s?d(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),ne.test(n)||d(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),te.test(r)&&d(e,"tag suffix cannot contain flow indicator characters")}return r&&!re.test(r)&&d(e,"tag name cannot contain such characters: "+r),a?e.tag=r:H.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:d(e,'undeclared tag handle "'+n+'"'),!0}function T(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&d(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!o(n)&&!a(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&d(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function P(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!o(r)&&!a(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&d(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||d(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],b(e,!0,-1),!0}function I(e,t,n,r,i){var o,a,s,u,l,c,p,f,h=1,m=!1,v=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=X===n||K===n,r&&b(e,!0,-1)&&(m=!0,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)),1===h)for(;M(e)||T(e);)b(e,!0,-1)?(m=!0,s=o,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)):s=!1;if(s&&(s=m||i),1!==h&&X!==n||(p=G===n||J===n?t:t+1,f=e.position-e.lineStart,1===h?s&&(D(e,f)||O(e,f,p))||C(e,p)?v=!0:(a&&A(e,p)||E(e,p)||S(e,p)?v=!0:P(e)?(v=!0,null===e.tag&&null===e.anchor||d(e,"alias node should not have any properties")):k(e,p,G===n)&&(v=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===h&&(v=s&&D(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(u=0,l=e.implicitTypes.length;u<l;u+=1)if(c=e.implicitTypes[u],c.resolve(e.result)){e.result=c.construct(e.result),e.tag=c.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else H.call(e.typeMap[e.kind||"fallback"],e.tag)?(c=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&c.kind!==e.kind&&d(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+c.kind+'", not "'+e.kind+'"'),c.resolve(e.result)?(e.result=c.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):d(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):d(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||v}function R(e){var t,n,a,s,u=e.position,l=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(s=e.input.charCodeAt(e.position))&&(b(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(l=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!o(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(t,e.position),a=[],n.length<1&&d(e,"directive name must not be less than one character in length");0!==s;){for(;i(s);)s=e.input.charCodeAt(++e.position);if(35===s){do{s=e.input.charCodeAt(++e.position)}while(0!==s&&!r(s));break}if(r(s))break;for(t=e.position;0!==s&&!o(s);)s=e.input.charCodeAt(++e.position);a.push(e.input.slice(t,e.position))}0!==s&&_(e),H.call(se,n)?se[n](e,n,a):m(e,'unknown document directive "'+n+'"')}if(b(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,b(e,!0,-1)):l&&d(e,"directives end mark is expected"),I(e,e.lineIndent-1,X,!1,!0),b(e,!0,-1),e.checkLineBreaks&&ee.test(e.input.slice(u,e.position))&&m(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&x(e))return void(46===e.input.charCodeAt(e.position)&&(e.position+=3,b(e,!0,-1)));e.position<e.length-1&&d(e,"end of the stream or a document separator is expected")}function j(e,t){e=String(e),t=t||{},0!==e.length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new f(e,t);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)R(n);return n.documents}function F(e,t,n){var r,i,o=j(e,n);if("function"!=typeof t)return o;for(r=0,i=o.length;r<i;r+=1)t(o[r])}function N(e,t){var n=j(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new z("expected a single document in the stream, but found more")}}function B(e,t,n){if("function"!=typeof t)return F(e,q.extend({schema:W},n));F(e,t,q.extend({schema:W},n))}function L(e,t){return N(e,q.extend({schema:W},t))}for(var q=n(80),z=n(117),U=n(798),W=n(118),V=n(145),H=Object.prototype.hasOwnProperty,G=1,J=2,K=3,X=4,Y=1,$=2,Z=3,Q=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ee=/[\x85\u2028\u2029]/,te=/[,\[\]\{\}]/,ne=/^(?:!|!!|![a-z\-]+!)$/i,re=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,ie=new Array(256),oe=new Array(256),ae=0;ae<256;ae++)ie[ae]=c(ae)?1:0,oe[ae]=c(ae);var se={YAML:function(e,t,n){var r,i,o;null!==e.version&&d(e,"duplication of %YAML directive"),1!==n.length&&d(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===r&&d(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&d(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&m(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&d(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],ne.test(r)||d(e,"ill-formed tag handle (first argument) of the TAG directive"),H.call(e.tagMap,r)&&d(e,'there is a previously declared suffix for "'+r+'" tag handle'),re.test(i)||d(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=i}};e.exports.loadAll=F,e.exports.load=N,e.exports.safeLoadAll=B,e.exports.safeLoad=L},function(e,t,n){"use strict";function r(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}var i=n(80);r.prototype.getSnippet=function(e,t){var n,r,o,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",r=this.position;r>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>t/2-1){n=" ... ",r+=5;break}for(o="",a=this.position;a<this.buffer.length&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(a));)if((a+=1)-this.position>t/2-1){o=" ... ",a-=5;break}return s=this.buffer.slice(r,a),i.repeat(" ",e)+n+s+o+"\n"+i.repeat(" ",e+this.position-r+n.length)+"^"},r.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},e.exports=r},function(e,t,n){"use strict";function r(e){if(null===e)return!1;var t,n,r=0,i=e.length,o=l;for(n=0;n<i;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0}function i(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=l,a=0,u=[];for(t=0;t<i;t++)t%4==0&&t&&(u.push(a>>16&255),u.push(a>>8&255),u.push(255&a)),a=a<<6|o.indexOf(r.charAt(t));return n=i%4*6,0===n?(u.push(a>>16&255),u.push(a>>8&255),u.push(255&a)):18===n?(u.push(a>>10&255),u.push(a>>2&255)):12===n&&u.push(a>>4&255),s?s.from?s.from(u):new s(u):u}function o(e){var t,n,r="",i=0,o=e.length,a=l;for(t=0;t<o;t++)t%3==0&&t&&(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]),i=(i<<8)+e[t];return n=o%3,0===n?(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]):2===n?(r+=a[i>>10&63],r+=a[i>>4&63],r+=a[i<<2&63],r+=a[64]):1===n&&(r+=a[i>>2&63],r+=a[i<<4&63],r+=a[64],r+=a[64]),r}function a(e){return s&&s.isBuffer(e)}var s;try{s=n(40).Buffer}catch(e){}var u=n(16),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new u("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:o})},function(e,t,n){"use strict";function r(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function i(e){return"true"===e||"True"===e||"TRUE"===e}function o(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var a=n(16);e.exports=new a("tag:yaml.org,2002:bool",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";function r(e){return null!==e&&!(!l.test(e)||"_"===e[e.length-1])}function i(e){var t,n,r,i;return t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),t=0,r=1,i.forEach(function(e){t+=e*r,r*=60}),n*t):n*parseFloat(t,10)}function o(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(s.isNegativeZero(e))return"-0.0";return n=e.toString(10),c.test(n)?n.replace("e",".e"):n}function a(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||s.isNegativeZero(e))}var s=n(80),u=n(16),l=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),c=/^[-+]?[0-9]+e/;e.exports=new u("tag:yaml.org,2002:float",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:o,defaultStyle:"lowercase"})},function(e,t,n){"use strict";function r(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function i(e){return 48<=e&&e<=55}function o(e){return 48<=e&&e<=57}function a(e){if(null===e)return!1;var t,n=e.length,a=0,s=!1;if(!n)return!1;if(t=e[a],"-"!==t&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===n)return!0;if("b"===(t=e[++a])){for(a++;a<n;a++)if("_"!==(t=e[a])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(a++;a<n;a++)if("_"!==(t=e[a])){if(!r(e.charCodeAt(a)))return!1;s=!0}return s&&"_"!==t}for(;a<n;a++)if("_"!==(t=e[a])){if(!i(e.charCodeAt(a)))return!1;s=!0}return s&&"_"!==t}if("_"===t)return!1;for(;a<n;a++)if("_"!==(t=e[a])){if(":"===t)break;if(!o(e.charCodeAt(a)))return!1;s=!0}return!(!s||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(a)))}function s(e){var t,n,r=e,i=1,o=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),t=r[0],"-"!==t&&"+"!==t||("-"===t&&(i=-1),r=r.slice(1),t=r[0]),"0"===r?0:"0"===t?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(e){o.unshift(parseInt(e,10))}),r=0,n=1,o.forEach(function(e){r+=e*n,n*=60}),i*r):i*parseInt(r,10)}function u(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!l.isNegativeZero(e)}var l=n(80),c=n(16);e.exports=new c("tag:yaml.org,2002:int",{kind:"scalar",resolve:a,construct:s,predicate:u,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(e,t,n){"use strict";function r(e){if(null===e)return!1;try{var t="("+e+")",n=s.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&"FunctionExpression"===n.body[0].expression.type}catch(e){return!1}}function i(e){var t,n="("+e+")",r=s.parse(n,{range:!0}),i=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(e){i.push(e.name)}),t=r.body[0].expression.body.range,new Function(i,n.slice(t[0]+1,t[1]-1))}function o(e){return e.toString()}function a(e){return"[object Function]"===Object.prototype.toString.call(e)}var s;try{s=n(743)}catch(e){"undefined"!=typeof window&&(s=window.esprima)}var u=n(16);e.exports=new u("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:o})},function(e,t,n){"use strict";function r(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1}return!0}function i(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)}function o(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function a(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var s=n(16);e.exports=new s("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:o})},function(e,t,n){"use strict";function r(){return!0}function i(){}function o(){return""}function a(e){return void 0===e}var s=n(16);e.exports=new s("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:o})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";function r(e){return"<<"===e||null===e}var i=n(16);e.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:r})},function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function i(){return null}function o(e){return null===e}var a=n(16);e.exports=new a("tag:yaml.org,2002:null",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n,r,i,o,u=[],l=e;for(t=0,n=l.length;t<n;t+=1){if(r=l[t],o=!1,"[object Object]"!==s.call(r))return!1;for(i in r)if(a.call(r,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==u.indexOf(i))return!1;u.push(i)}return!0}function i(e){return null!==e?e:[]}var o=n(16),a=Object.prototype.hasOwnProperty,s=Object.prototype.toString;e.exports=new o("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:i})},function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],"[object Object]"!==a.call(r))return!1;if(i=Object.keys(r),1!==i.length)return!1;o[t]=[i[0],r[i[0]]]}return!0}function i(e){if(null===e)return[];var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}var o=n(16),a=Object.prototype.toString;e.exports=new o("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n=e;for(t in n)if(a.call(n,t)&&null!==n[t])return!1;return!0}function i(e){return null!==e?e:{}}var o=n(16),a=Object.prototype.hasOwnProperty;e.exports=new o("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i})},function(e,t,n){"use strict";var r=n(16);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},function(e,t,n){"use strict";function r(e){return null!==e&&(null!==s.exec(e)||null!==u.exec(e))}function i(e){var t,n,r,i,o,a,l,c,p,f,h=0,d=null;if(t=s.exec(e),null===t&&(t=u.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],a=+t[5],l=+t[6],t[7]){for(h=t[7].slice(0,3);h.length<3;)h+="0";h=+h}return t[9]&&(c=+t[10],p=+(t[11]||0),d=6e4*(60*c+p),"-"===t[9]&&(d=-d)),f=new Date(Date.UTC(n,r,i,o,a,l,h)),d&&f.setTime(f.getTime()-d),f}function o(e){return e.toISOString()}var a=n(16),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),u=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new a("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:i,instanceOf:Date,represent:o})},function(e,t,n){"use strict";function r(e){return null==e?void 0===e?u:s:l&&l in Object(e)?n.i(o.a)(e):n.i(a.a)(e)}var i=n(390),o=n(818),a=n(819),s="[object Null]",u="[object Undefined]",l=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(t,n(17))},function(e,t,n){"use strict";var r=n(820),i=n.i(r.a)(Object.getPrototypeOf,Object);t.a=i},function(e,t,n){"use strict";function r(e){var t=a.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[u]=n:delete e[u]),i}var i=n(390),o=Object.prototype,a=o.hasOwnProperty,s=o.toString,u=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";function r(e){return o.call(e)}var i=Object.prototype,o=i.toString;t.a=r},function(e,t,n){"use strict";function r(e,t){return function(n){return e(t(n))}}t.a=r},function(e,t,n){"use strict";var r=n(816),i="object"==typeof self&&self&&self.Object===Object&&self,o=r.a||i||Function("return this")();t.a=o},function(e,t,n){"use strict";function r(e){return null!=e&&"object"==typeof e}t.a=r},function(e,t){function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function r(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function i(e,t){var n=I(e)||h(e)?r(e.length,String):[],i=n.length,o=!!i;for(var a in e)!t&&!A.call(e,a)||o&&("length"==a||l(a,i))||n.push(a);return n}function o(e,t,n){var r=e[t];A.call(e,t)&&f(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function a(e){if(!p(e))return M(e);var t=[];for(var n in Object(e))A.call(e,n)&&"constructor"!=n&&t.push(n);return t}function s(e,t){return t=T(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=T(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=a,n(e,this,s)}}function u(e,t,n,r){n||(n={});for(var i=-1,a=t.length;++i<a;){var s=t[i],u=r?r(n[s],e[s],s,n,e):void 0;o(n,s,void 0===u?e[s]:u)}return n}function l(e,t){return!!(t=null==t?x:t)&&("number"==typeof e||S.test(e))&&e>-1&&e%1==0&&e<t}function c(e,t,n){if(!y(n))return!1;var r=typeof t;return!!("number"==r?d(n)&&l(t,n.length):"string"==r&&t in n)&&f(n[t],e)}function p(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||C)}function f(e,t){return e===t||e!==e&&t!==t}function h(e){return m(e)&&A.call(e,"callee")&&(!O.call(e,"callee")||D.call(e)==w)}function d(e){return null!=e&&g(e.length)&&!v(e)}function m(e){return _(e)&&d(e)}function v(e){var t=y(e)?D.call(e):"";return t==k||t==E}function g(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=x}function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function _(e){return!!e&&"object"==typeof e}function b(e){return d(e)?i(e):a(e)}var x=9007199254740991,w="[object Arguments]",k="[object Function]",E="[object GeneratorFunction]",S=/^(?:0|[1-9]\d*)$/,C=Object.prototype,A=C.hasOwnProperty,D=C.toString,O=C.propertyIsEnumerable,M=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),T=Math.max,P=!O.call({valueOf:1},"valueOf"),I=Array.isArray,R=function(e){return s(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&c(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}(function(e,t){if(P||p(t)||d(t))return void u(t,b(t),e);for(var n in t)A.call(t,n)&&o(e,n,t[n])});e.exports=R},function(e,t,n){(function(e,n){function r(e,t){return e.set(t[0],t[1]),e}function i(e,t){return e.add(t),e}function o(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););return e}function a(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function s(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function u(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function l(e,t){return null==e?void 0:e[t]}function c(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function p(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function f(e,t){return function(n){return e(t(n))}}function h(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function d(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function m(){this.__data__=jt?jt(null):{}}function v(e){return this.has(e)&&delete this.__data__[e]}function g(e){var t=this.__data__;if(jt){var n=t[e];return n===Oe?void 0:n}return gt.call(t,e)?t[e]:void 0}function y(e){var t=this.__data__;return jt?void 0!==t[e]:gt.call(t,e)}function _(e,t){return this.__data__[e]=jt&&void 0===t?Oe:t,this}function b(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function x(){this.__data__=[]}function w(e){var t=this.__data__,n=q(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ct.call(t,n,1),!0)}function k(e){var t=this.__data__,n=q(t,e);return n<0?void 0:t[n][1]}function E(e){return q(this.__data__,e)>-1}function S(e,t){var n=this.__data__,r=q(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}function C(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function A(){this.__data__={hash:new d,map:new(Tt||b),string:new d}}function D(e){return ae(this,e).delete(e)}function O(e){return ae(this,e).get(e)}function M(e){return ae(this,e).has(e)}function T(e,t){return ae(this,e).set(e,t),this}function P(e){this.__data__=new b(e)}function I(){this.__data__=new b}function R(e){return this.__data__.delete(e)}function j(e){return this.__data__.get(e)}function F(e){return this.__data__.has(e)}function N(e,t){var n=this.__data__;if(n instanceof b){var r=n.__data__;if(!Tt||r.length<De-1)return r.push([e,t]),this;n=this.__data__=new C(r)}return n.set(e,t),this}function B(e,t){var n=Ht(e)||ye(e)?u(e.length,String):[],r=n.length,i=!!r;for(var o in e)!t&&!gt.call(e,o)||i&&("length"==o||pe(o,r))||n.push(o);return n}function L(e,t,n){var r=e[t];gt.call(e,t)&&ge(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function q(e,t){for(var n=e.length;n--;)if(ge(e[n][0],t))return n;return-1}function z(e,t){return e&&re(t,Se(t),e)}function U(e,t,n,r,i,a,s){var u;if(r&&(u=a?r(e,i,a,s):r(e)),void 0!==u)return u;if(!ke(e))return e;var l=Ht(e);if(l){if(u=ue(e),!t)return ne(e,u)}else{var p=Vt(e),f=p==Re||p==je;if(Gt(e))return K(e,t);if(p==Be||p==Te||f&&!a){if(c(e))return a?e:{};if(u=le(f?{}:e),!t)return ie(e,z(u,e))}else{if(!it[p])return a?e:{};u=ce(e,p,U,t)}}s||(s=new P);var h=s.get(e);if(h)return h;if(s.set(e,u),!l)var d=n?oe(e):Se(e);return o(d||e,function(i,o){d&&(o=i,i=e[o]),L(u,o,U(i,t,n,r,o,e,s))}),u}function W(e){return ke(e)?Et(e):{}}function V(e,t,n){var r=t(e);return Ht(e)?r:a(r,n(e))}function H(e){return yt.call(e)}function G(e){return!(!ke(e)||he(e))&&(xe(e)||c(e)?_t:nt).test(me(e))}function J(e){if(!de(e))return Ot(e);var t=[];for(var n in Object(e))gt.call(e,n)&&"constructor"!=n&&t.push(n);return t}function K(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function X(e){var t=new e.constructor(e.byteLength);return new wt(t).set(new wt(e)),t}function Y(e,t){var n=t?X(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function $(e,t,n){return s(t?n(p(e),!0):p(e),r,new e.constructor)}function Z(e){var t=new e.constructor(e.source,tt.exec(e));return t.lastIndex=e.lastIndex,t}function Q(e,t,n){return s(t?n(h(e),!0):h(e),i,new e.constructor)}function ee(e){return Ut?Object(Ut.call(e)):{}}function te(e,t){var n=t?X(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ne(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function re(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],s=r?r(n[a],e[a],a,n,e):void 0;L(n,a,void 0===s?e[a]:s)}return n}function ie(e,t){return re(e,Wt(e),t)}function oe(e){return V(e,Se,Wt)}function ae(e,t){var n=e.__data__;return fe(t)?n["string"==typeof t?"string":"hash"]:n.map}function se(e,t){var n=l(e,t);return G(n)?n:void 0}function ue(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&>.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function le(e){return"function"!=typeof e.constructor||de(e)?{}:W(kt(e))}function ce(e,t,n,r){var i=e.constructor;switch(t){case We:return X(e);case Pe:case Ie:return new i(+e);case Ve:return Y(e,r);case He:case Ge:case Je:case Ke:case Xe:case Ye:case $e:case Ze:case Qe:return te(e,r);case Fe:return $(e,r,n);case Ne:case ze:return new i(e);case Le:return Z(e);case qe:return Q(e,r,n);case Ue:return ee(e)}}function pe(e,t){return!!(t=null==t?Me:t)&&("number"==typeof e||rt.test(e))&&e>-1&&e%1==0&&e<t}function fe(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function he(e){return!!mt&&mt in e}function de(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ht)}function me(e){if(null!=e){try{return vt.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function ve(e){return U(e,!0,!0)}function ge(e,t){return e===t||e!==e&&t!==t}function ye(e){return be(e)&>.call(e,"callee")&&(!St.call(e,"callee")||yt.call(e)==Te)}function _e(e){return null!=e&&we(e.length)&&!xe(e)}function be(e){return Ee(e)&&_e(e)}function xe(e){var t=ke(e)?yt.call(e):"";return t==Re||t==je}function we(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Me}function ke(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ee(e){return!!e&&"object"==typeof e}function Se(e){return _e(e)?B(e):J(e)}function Ce(){return[]}function Ae(){return!1}var De=200,Oe="__lodash_hash_undefined__",Me=9007199254740991,Te="[object Arguments]",Pe="[object Boolean]",Ie="[object Date]",Re="[object Function]",je="[object GeneratorFunction]",Fe="[object Map]",Ne="[object Number]",Be="[object Object]",Le="[object RegExp]",qe="[object Set]",ze="[object String]",Ue="[object Symbol]",We="[object ArrayBuffer]",Ve="[object DataView]",He="[object Float32Array]",Ge="[object Float64Array]",Je="[object Int8Array]",Ke="[object Int16Array]",Xe="[object Int32Array]",Ye="[object Uint8Array]",$e="[object Uint8ClampedArray]",Ze="[object Uint16Array]",Qe="[object Uint32Array]",et=/[\\^$.*+?()[\]{}|]/g,tt=/\w*$/,nt=/^\[object .+?Constructor\]$/,rt=/^(?:0|[1-9]\d*)$/,it={};it[Te]=it["[object Array]"]=it[We]=it[Ve]=it[Pe]=it[Ie]=it[He]=it[Ge]=it[Je]=it[Ke]=it[Xe]=it[Fe]=it[Ne]=it[Be]=it[Le]=it[qe]=it[ze]=it[Ue]=it[Ye]=it[$e]=it[Ze]=it[Qe]=!0,it["[object Error]"]=it[Re]=it["[object WeakMap]"]=!1;var ot="object"==typeof e&&e&&e.Object===Object&&e,at="object"==typeof self&&self&&self.Object===Object&&self,st=ot||at||Function("return this")(),ut="object"==typeof t&&t&&!t.nodeType&&t,lt=ut&&"object"==typeof n&&n&&!n.nodeType&&n,ct=lt&<.exports===ut,pt=Array.prototype,ft=Function.prototype,ht=Object.prototype,dt=st["__core-js_shared__"],mt=function(){var e=/[^.]+$/.exec(dt&&dt.keys&&dt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),vt=ft.toString,gt=ht.hasOwnProperty,yt=ht.toString,_t=RegExp("^"+vt.call(gt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bt=ct?st.Buffer:void 0,xt=st.Symbol,wt=st.Uint8Array,kt=f(Object.getPrototypeOf,Object),Et=Object.create,St=ht.propertyIsEnumerable,Ct=pt.splice,At=Object.getOwnPropertySymbols,Dt=bt?bt.isBuffer:void 0,Ot=f(Object.keys,Object),Mt=se(st,"DataView"),Tt=se(st,"Map"),Pt=se(st,"Promise"),It=se(st,"Set"),Rt=se(st,"WeakMap"),jt=se(Object,"create"),Ft=me(Mt),Nt=me(Tt),Bt=me(Pt),Lt=me(It),qt=me(Rt),zt=xt?xt.prototype:void 0,Ut=zt?zt.valueOf:void 0;d.prototype.clear=m,d.prototype.delete=v,d.prototype.get=g,d.prototype.has=y,d.prototype.set=_,b.prototype.clear=x,b.prototype.delete=w,b.prototype.get=k,b.prototype.has=E,b.prototype.set=S,C.prototype.clear=A,C.prototype.delete=D,C.prototype.get=O,C.prototype.has=M,C.prototype.set=T,P.prototype.clear=I,P.prototype.delete=R,P.prototype.get=j,P.prototype.has=F,P.prototype.set=N;var Wt=At?f(At,Object):Ce,Vt=H;(Mt&&Vt(new Mt(new ArrayBuffer(1)))!=Ve||Tt&&Vt(new Tt)!=Fe||Pt&&"[object Promise]"!=Vt(Pt.resolve())||It&&Vt(new It)!=qe||Rt&&"[object WeakMap]"!=Vt(new Rt))&&(Vt=function(e){var t=yt.call(e),n=t==Be?e.constructor:void 0,r=n?me(n):void 0;if(r)switch(r){case Ft:return Ve;case Nt:return Fe;case Bt:return"[object Promise]";case Lt:return qe;case qt:return"[object WeakMap]"}return t});var Ht=Array.isArray,Gt=Dt||Ae;n.exports=ve}).call(t,n(17),n(72)(e))},function(e,t,n){(function(t){function n(e){if("string"==typeof e)return e;if(i(e))return y?y.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}function r(e){return!!e&&"object"==typeof e}function i(e){return"symbol"==typeof e||r(e)&&m.call(e)==u}function o(e){return null==e?"":n(e)}function a(e){return e=o(e),e&&c.test(e)?e.replace(l,"\\$&"):e}var s=1/0,u="[object Symbol]",l=/[\\^$.*+?()[\]{}|]/g,c=RegExp(l.source),p="object"==typeof t&&t&&t.Object===Object&&t,f="object"==typeof self&&self&&self.Object===Object&&self,h=p||f||Function("return this")(),d=Object.prototype,m=d.toString,v=h.Symbol,g=v?v.prototype:void 0,y=g?g.toString:void 0;e.exports=a}).call(t,n(17))},function(e,t){function n(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function r(e){return!!e&&"object"==typeof e}function i(e){if(!r(e)||p.call(e)!=o||n(e))return!1;var t=f(e);if(null===t)return!0;var i=l.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&u.call(i)==c}var o="[object Object]",a=Function.prototype,s=Object.prototype,u=a.toString,l=s.hasOwnProperty,c=u.call(Object),p=s.toString,f=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);e.exports=i},function(e,t,n){(function(e,n){function r(e,t){return e.set(t[0],t[1]),e}function i(e,t){return e.add(t),e}function o(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function a(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););return e}function s(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function u(e,t,n,r){var i=-1,o=e?e.length:0;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function l(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function c(e,t){return null==e?void 0:e[t]}function p(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function f(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function h(e,t){return function(n){return e(t(n))}}function d(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function m(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function v(){this.__data__=Qt?Qt(null):{}}function g(e){return this.has(e)&&delete this.__data__[e]}function y(e){var t=this.__data__;if(Qt){var n=t[e];return n===qe?void 0:n}return It.call(t,e)?t[e]:void 0}function _(e){var t=this.__data__;return Qt?void 0!==t[e]:It.call(t,e)}function b(e,t){return this.__data__[e]=Qt&&void 0===t?qe:t,this}function x(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function w(){this.__data__=[]}function k(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():Wt.call(t,n,1),!0)}function E(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]}function S(e){return U(this.__data__,e)>-1}function C(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}function A(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function D(){this.__data__={hash:new m,map:new(Xt||x),string:new m}}function O(e){return he(this,e).delete(e)}function M(e){return he(this,e).get(e)}function T(e){return he(this,e).has(e)}function P(e,t){return he(this,e).set(e,t),this}function I(e){this.__data__=new x(e)}function R(){this.__data__=new x}function j(e){return this.__data__.delete(e)}function F(e){return this.__data__.get(e)}function N(e){return this.__data__.has(e)}function B(e,t){var n=this.__data__;if(n instanceof x){var r=n.__data__;if(!Xt||r.length<Le-1)return r.push([e,t]),this;n=this.__data__=new A(r)}return n.set(e,t),this}function L(e,t){var n=cn(e)||Ce(e)?l(e.length,String):[],r=n.length,i=!!r;for(var o in e)!t&&!It.call(e,o)||i&&("length"==o||ye(o,r))||n.push(o);return n}function q(e,t,n){(void 0===n||Se(e[t],n))&&("number"!=typeof t||void 0!==n||t in e)||(e[t]=n)}function z(e,t,n){var r=e[t];It.call(e,t)&&Se(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function U(e,t){for(var n=e.length;n--;)if(Se(e[n][0],t))return n;return-1}function W(e,t){return e&&ce(t,je(t),e)}function V(e,t,n,r,i,o,s){var u;if(r&&(u=o?r(e,i,o,s):r(e)),void 0!==u)return u;if(!Te(e))return e;var l=cn(e);if(l){if(u=me(e),!t)return le(e,u)}else{var c=ln(e),f=c==He||c==Ge;if(pn(e))return te(e,t);if(c==Xe||c==Ue||f&&!o){if(p(e))return o?e:{};if(u=ve(f?{}:e),!t)return pe(e,W(u,e))}else{if(!gt[c])return o?e:{};u=ge(e,c,V,t)}}s||(s=new I);var h=s.get(e);if(h)return h;if(s.set(e,u),!l)var d=n?fe(e):je(e);return a(d||e,function(i,o){d&&(o=i,i=e[o]),z(u,o,V(i,t,n,r,o,e,s))}),u}function H(e){return Te(e)?zt(e):{}}function G(e,t,n){var r=t(e);return cn(e)?r:s(r,n(e))}function J(e){return jt.call(e)}function K(e){return!(!Te(e)||xe(e))&&(Oe(e)||p(e)?Ft:dt).test(Ee(e))}function X(e){return Pe(e)&&Me(e.length)&&!!vt[jt.call(e)]}function Y(e){if(!we(e))return Gt(e);var t=[];for(var n in Object(e))It.call(e,n)&&"constructor"!=n&&t.push(n);return t}function $(e){if(!Te(e))return ke(e);var t=we(e),n=[];for(var r in e)("constructor"!=r||!t&&It.call(e,r))&&n.push(r);return n}function Z(e,t,n,r,i){if(e!==t){if(!cn(t)&&!fn(t))var o=$(t);a(o||t,function(a,s){if(o&&(s=a,a=t[s]),Te(a))i||(i=new I),Q(e,t,s,n,Z,r,i);else{var u=r?r(e[s],a,s+"",e,t,i):void 0;void 0===u&&(u=a),q(e,s,u)}})}}function Q(e,t,n,r,i,o,a){var s=e[n],u=t[n],l=a.get(u);if(l)return void q(e,n,l);var c=o?o(s,u,n+"",e,t,a):void 0,p=void 0===c;p&&(c=u,cn(u)||fn(u)?cn(s)?c=s:De(s)?c=le(s):(p=!1,c=V(u,!0)):Ie(u)||Ce(u)?Ce(s)?c=Re(s):!Te(s)||r&&Oe(s)?(p=!1,c=V(u,!0)):c=s:p=!1),p&&(a.set(u,c),i(c,u,r,o,a),a.delete(u)),q(e,n,c)}function ee(e,t){return t=Jt(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,i=Jt(n.length-t,0),a=Array(i);++r<i;)a[r]=n[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=n[r];return s[t]=a,o(e,this,s)}}function te(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function ne(e){var t=new e.constructor(e.byteLength);return new Lt(t).set(new Lt(e)),t}function re(e,t){var n=t?ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function ie(e,t,n){return u(t?n(f(e),!0):f(e),r,new e.constructor)}function oe(e){var t=new e.constructor(e.source,ht.exec(e));return t.lastIndex=e.lastIndex,t}function ae(e,t,n){return u(t?n(d(e),!0):d(e),i,new e.constructor)}function se(e){return sn?Object(sn.call(e)):{}}function ue(e,t){var n=t?ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function le(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function ce(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],s=r?r(n[a],e[a],a,n,e):void 0;z(n,a,void 0===s?e[a]:s)}return n}function pe(e,t){return ce(e,un(e),t)}function fe(e){return G(e,je,un)}function he(e,t){var n=e.__data__;return be(t)?n["string"==typeof t?"string":"hash"]:n.map}function de(e,t){var n=c(e,t);return K(n)?n:void 0}function me(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&It.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function ve(e){return"function"!=typeof e.constructor||we(e)?{}:H(qt(e))}function ge(e,t,n,r){var i=e.constructor;switch(t){case tt:return ne(e);case We:case Ve:return new i(+e);case nt:return re(e,r);case rt:case it:case ot:case at:case st:case ut:case lt:case ct:case pt:return ue(e,r);case Je:return ie(e,r,n);case Ke:case Ze:return new i(e);case Ye:return oe(e);case $e:return ae(e,r,n);case Qe:return se(e)}}function ye(e,t){return!!(t=null==t?ze:t)&&("number"==typeof e||mt.test(e))&&e>-1&&e%1==0&&e<t}function _e(e,t,n){if(!Te(n))return!1;var r=typeof t;return!!("number"==r?Ae(n)&&ye(t,n.length):"string"==r&&t in n)&&Se(n[t],e)}function be(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function xe(e){return!!Tt&&Tt in e}function we(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ot)}function ke(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}function Ee(e){if(null!=e){try{return Pt.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Se(e,t){return e===t||e!==e&&t!==t}function Ce(e){return De(e)&&It.call(e,"callee")&&(!Ut.call(e,"callee")||jt.call(e)==Ue)}function Ae(e){return null!=e&&Me(e.length)&&!Oe(e)}function De(e){return Pe(e)&&Ae(e)}function Oe(e){var t=Te(e)?jt.call(e):"";return t==He||t==Ge}function Me(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=ze}function Te(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Pe(e){return!!e&&"object"==typeof e}function Ie(e){if(!Pe(e)||jt.call(e)!=Xe||p(e))return!1;var t=qt(e);if(null===t)return!0;var n=It.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Pt.call(n)==Rt}function Re(e){return ce(e,Fe(e))}function je(e){return Ae(e)?L(e):Y(e)}function Fe(e){return Ae(e)?L(e,!0):$(e)}function Ne(){return[]}function Be(){return!1}var Le=200,qe="__lodash_hash_undefined__",ze=9007199254740991,Ue="[object Arguments]",We="[object Boolean]",Ve="[object Date]",He="[object Function]",Ge="[object GeneratorFunction]",Je="[object Map]",Ke="[object Number]",Xe="[object Object]",Ye="[object RegExp]",$e="[object Set]",Ze="[object String]",Qe="[object Symbol]",et="[object WeakMap]",tt="[object ArrayBuffer]",nt="[object DataView]",rt="[object Float32Array]",it="[object Float64Array]",ot="[object Int8Array]",at="[object Int16Array]",st="[object Int32Array]",ut="[object Uint8Array]",lt="[object Uint8ClampedArray]",ct="[object Uint16Array]",pt="[object Uint32Array]",ft=/[\\^$.*+?()[\]{}|]/g,ht=/\w*$/,dt=/^\[object .+?Constructor\]$/,mt=/^(?:0|[1-9]\d*)$/,vt={};vt[rt]=vt[it]=vt[ot]=vt[at]=vt[st]=vt[ut]=vt[lt]=vt[ct]=vt[pt]=!0,vt[Ue]=vt["[object Array]"]=vt[tt]=vt[We]=vt[nt]=vt[Ve]=vt["[object Error]"]=vt[He]=vt[Je]=vt[Ke]=vt[Xe]=vt[Ye]=vt[$e]=vt[Ze]=vt[et]=!1;var gt={};gt[Ue]=gt["[object Array]"]=gt[tt]=gt[nt]=gt[We]=gt[Ve]=gt[rt]=gt[it]=gt[ot]=gt[at]=gt[st]=gt[Je]=gt[Ke]=gt[Xe]=gt[Ye]=gt[$e]=gt[Ze]=gt[Qe]=gt[ut]=gt[lt]=gt[ct]=gt[pt]=!0,gt["[object Error]"]=gt[He]=gt[et]=!1;var yt="object"==typeof e&&e&&e.Object===Object&&e,_t="object"==typeof self&&self&&self.Object===Object&&self,bt=yt||_t||Function("return this")(),xt="object"==typeof t&&t&&!t.nodeType&&t,wt=xt&&"object"==typeof n&&n&&!n.nodeType&&n,kt=wt&&wt.exports===xt,Et=kt&&yt.process,St=function(){try{return Et&&Et.binding("util")}catch(e){}}(),Ct=St&&St.isTypedArray,At=Array.prototype,Dt=Function.prototype,Ot=Object.prototype,Mt=bt["__core-js_shared__"],Tt=function(){var e=/[^.]+$/.exec(Mt&&Mt.keys&&Mt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Pt=Dt.toString,It=Ot.hasOwnProperty,Rt=Pt.call(Object),jt=Ot.toString,Ft=RegExp("^"+Pt.call(It).replace(ft,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nt=kt?bt.Buffer:void 0,Bt=bt.Symbol,Lt=bt.Uint8Array,qt=h(Object.getPrototypeOf,Object),zt=Object.create,Ut=Ot.propertyIsEnumerable,Wt=At.splice,Vt=Object.getOwnPropertySymbols,Ht=Nt?Nt.isBuffer:void 0,Gt=h(Object.keys,Object),Jt=Math.max,Kt=de(bt,"DataView"),Xt=de(bt,"Map"),Yt=de(bt,"Promise"),$t=de(bt,"Set"),Zt=de(bt,"WeakMap"),Qt=de(Object,"create"),en=Ee(Kt),tn=Ee(Xt),nn=Ee(Yt),rn=Ee($t),on=Ee(Zt),an=Bt?Bt.prototype:void 0,sn=an?an.valueOf:void 0;m.prototype.clear=v,m.prototype.delete=g,m.prototype.get=y,m.prototype.has=_,m.prototype.set=b,x.prototype.clear=w,x.prototype.delete=k,x.prototype.get=E,x.prototype.has=S,x.prototype.set=C,A.prototype.clear=D,A.prototype.delete=O,A.prototype.get=M,A.prototype.has=T,A.prototype.set=P,I.prototype.clear=R,I.prototype.delete=j,I.prototype.get=F,I.prototype.has=N,I.prototype.set=B;var un=Vt?h(Vt,Object):Ne,ln=J;(Kt&&ln(new Kt(new ArrayBuffer(1)))!=nt||Xt&&ln(new Xt)!=Je||Yt&&"[object Promise]"!=ln(Yt.resolve())||$t&&ln(new $t)!=$e||Zt&&ln(new Zt)!=et)&&(ln=function(e){var t=jt.call(e),n=t==Xe?e.constructor:void 0,r=n?Ee(n):void 0;if(r)switch(r){case en:return nt;case tn:return Je;case nn:return"[object Promise]";case rn:return $e;case on:return et}return t});var cn=Array.isArray,pn=Ht||Be,fn=Ct?function(e){return function(t){return e(t)}}(Ct):X,hn=function(e){return ee(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&_e(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}(function(e,t,n,r){Z(e,t,n,r)});n.exports=hn}).call(t,n(17),n(72)(e))},function(e,t,n){var r=n(67),i=n(43),o=r(i,"DataView");e.exports=o},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var i=n(900),o=n(901),a=n(902),s=n(903),u=n(904);r.prototype.clear=i,r.prototype.delete=o,r.prototype.get=a,r.prototype.has=s,r.prototype.set=u,e.exports=r},function(e,t,n){var r=n(67),i=n(43),o=r(i,"Promise");e.exports=o},function(e,t,n){var r=n(67),i=n(43),o=r(i,"Set");e.exports=o},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new i;++t<n;)this.add(e[t])}var i=n(214),o=n(927),a=n(928);r.prototype.add=r.prototype.push=o,r.prototype.has=a,e.exports=r},function(e,t,n){var r=n(67),i=n(43),o=r(i,"WeakMap");e.exports=o},function(e,t){function n(e,t){return e.set(t[0],t[1]),e}e.exports=n},function(e,t){function n(e,t){return e.add(t),e}e.exports=n},function(e,t){function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}e.exports=n},function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}e.exports=n},function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}e.exports=n},function(e,t){function n(e){return e.split("")}e.exports=n},function(e,t){function n(e){return e.match(r)||[]}var r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=n},function(e,t,n){function r(e,t){return e&&i(t,o(t),e)}var i=n(84),o=n(59);e.exports=r},function(e,t,n){function r(e,t){return e&&i(t,o(t),e)}var i=n(84),o=n(424);e.exports=r},function(e,t){function n(e,t,n){return e===e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}e.exports=n},function(e,t,n){var r=n(38),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},function(e,t,n){function r(e,t){var n=[];return i(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}var i=n(217);e.exports=r},function(e,t){function n(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}e.exports=n},function(e,t,n){function r(e,t,n,a,s){var u=-1,l=e.length;for(n||(n=o),s||(s=[]);++u<l;){var c=e[u];t>0&&n(c)?t>1?r(c,t-1,n,a,s):i(s,c):a||(s[s.length]=c)}return s}var i=n(216),o=n(908);e.exports=r},function(e,t,n){var r=n(888),i=r();e.exports=i},function(e,t,n){function r(e,t){return e&&i(e,t,o)}var i=n(848),o=n(59);e.exports=r},function(e,t){function n(e,t){return null!=e&&t in Object(e)}e.exports=n},function(e,t,n){function r(e){return o(e)&&i(e)==a}var i=n(66),o=n(68),a="[object Arguments]";e.exports=r},function(e,t,n){function r(e,t,n,r,v,y){var _=l(e),b=l(t),x=d,w=d;_||(x=u(e),x=x==h?m:x),b||(w=u(t),w=w==h?m:w);var k=x==m,E=w==m,S=x==w;if(S&&c(e)){if(!c(t))return!1;_=!0,k=!1}if(S&&!k)return y||(y=new i),_||p(e)?o(e,t,n,r,v,y):a(e,t,x,n,r,v,y);if(!(n&f)){var C=k&&g.call(e,"__wrapped__"),A=E&&g.call(t,"__wrapped__");if(C||A){var D=C?e.value():e,O=A?t.value():t;return y||(y=new i),v(D,O,n,r,y)}}return!!S&&(y||(y=new i),s(e,t,n,r,v,y))}var i=n(215),o=n(404),a=n(892),s=n(893),u=n(409),l=n(20),c=n(227),p=n(423),f=1,h="[object Arguments]",d="[object Array]",m="[object Object]",v=Object.prototype,g=v.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t,n,r){var u=n.length,l=u,c=!r;if(null==e)return!l;for(e=Object(e);u--;){var p=n[u];if(c&&p[2]?p[1]!==e[p[0]]:!(p[0]in e))return!1}for(;++u<l;){p=n[u];var f=p[0],h=e[f],d=p[1];if(c&&p[2]){if(void 0===h&&!(f in e))return!1}else{var m=new i;if(r)var v=r(h,d,f,e,t,m);if(!(void 0===v?o(d,h,a|s,r,m):v))return!1}}return!0}var i=n(215),o=n(399),a=1,s=2;e.exports=r},function(e,t,n){function r(e){return!(!a(e)||o(e))&&(i(e)?d:l).test(s(e))}var i=n(420),o=n(910),a=n(38),s=n(418),u=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,c=Function.prototype,p=Object.prototype,f=c.toString,h=p.hasOwnProperty,d=RegExp("^"+f.call(h).replace(u,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},function(e,t,n){function r(e){return a(e)&&o(e.length)&&!!s[i(e)]}var i=n(66),o=n(228),a=n(68),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=r},function(e,t,n){function r(e){if(!i(e))return o(e);var t=[];for(var n in Object(e))s.call(e,n)&&"constructor"!=n&&t.push(n);return t}var i=n(153),o=n(922),a=Object.prototype,s=a.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){if(!i(e))return a(e);var t=o(e),n=[];for(var r in e)("constructor"!=r||!t&&u.call(e,r))&&n.push(r);return n}var i=n(38),o=n(153),a=n(923),s=Object.prototype,u=s.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||i(n,e,t)}}var i=n(853),o=n(895),a=n(414);e.exports=r},function(e,t,n){function r(e,t){return s(e)&&u(t)?l(c(e),t):function(n){var r=o(n,e);return void 0===r&&r===t?a(n,e):i(t,r,p|f)}}var i=n(399),o=n(224),a=n(419),s=n(221),u=n(412),l=n(414),c=n(85),p=1,f=2;e.exports=r},function(e,t,n){function r(e,t){return e=Object(e),i(e,t,function(t,n){return o(e,n)})}var i=n(861),o=n(419);e.exports=r},function(e,t,n){function r(e,t,n){for(var r=-1,s=t.length,u={};++r<s;){var l=t[r],c=i(e,l);n(c,l)&&o(u,a(l,e),c)}return u}var i=n(150),o=n(867),a=n(83);e.exports=r},function(e,t){function n(e){return function(t){return null==t?void 0:t[e]}}e.exports=n},function(e,t,n){function r(e){return function(t){return i(t,e)}}var i=n(150);e.exports=r},function(e,t){function n(e){return function(t){return null==e?void 0:e[t]}}e.exports=n},function(e,t){function n(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}e.exports=n},function(e,t,n){function r(e,t){return a(o(e,t,i),e+"")}var i=n(225),o=n(415),a=n(417);e.exports=r},function(e,t,n){function r(e,t,n,r){if(!s(e))return e;t=o(t,e);for(var l=-1,c=t.length,p=c-1,f=e;null!=f&&++l<c;){var h=u(t[l]),d=n;if(l!=p){var m=f[h];d=r?r(m,h,f):void 0,void 0===d&&(d=s(m)?m:a(t[l+1])?[]:{})}i(f,h,d),f=f[h]}return e}var i=n(148),o=n(83),a=n(152),s=n(38),u=n(85);e.exports=r},function(e,t,n){var r=n(943),i=n(403),o=n(225),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},function(e,t,n){function r(e,t){var n;return i(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}var i=n(217);e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}e.exports=n},function(e,t){function n(e){return function(t){return e(t)}}e.exports=n},function(e,t,n){function r(e,t){return t=i(t,e),null==(e=a(e,t))||delete e[s(o(t))]}var i=n(83),o=n(947),a=n(926),s=n(85);e.exports=r},function(e,t){function n(e,t){return e.has(t)}e.exports=n},function(e,t,n){function r(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:i(e,t,n)}var i=n(400);e.exports=r},function(e,t,n){(function(e){function r(e,t){if(t)return e.slice();var n=e.length,r=l?l(n):new e.constructor(n);return e.copy(r),r}var i=n(43),o="object"==typeof t&&t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o,u=s?i.Buffer:void 0,l=u?u.allocUnsafe:void 0;e.exports=r}).call(t,n(72)(e))},function(e,t,n){function r(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var i=n(218);e.exports=r},function(e,t,n){function r(e,t,n){var r=t?n(a(e),s):a(e);return o(r,i,new e.constructor)}var i=n(834),o=n(147),a=n(413),s=1;e.exports=r},function(e,t){function n(e){var t=new e.constructor(e.source,r.exec(e));return t.lastIndex=e.lastIndex,t}var r=/\w*$/;e.exports=n},function(e,t,n){function r(e,t,n){var r=t?n(a(e),s):a(e);return o(r,i,new e.constructor)}var i=n(835),o=n(147),a=n(416),s=1;e.exports=r},function(e,t,n){function r(e){return a?Object(a.call(e)):{}}var i=n(82),o=i?i.prototype:void 0,a=o?o.valueOf:void 0;e.exports=r},function(e,t,n){function r(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var i=n(218);e.exports=r},function(e,t){function n(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}e.exports=n},function(e,t,n){function r(e,t){return i(e,o(e),t)}var i=n(84),o=n(220);e.exports=r},function(e,t,n){function r(e,t){return i(e,o(e),t)}var i=n(84),o=n(408);e.exports=r},function(e,t,n){var r=n(43),i=r["__core-js_shared__"];e.exports=i},function(e,t,n){function r(e){return i(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var u=n[r];u&&e(t,u,r,a)}return t})}var i=n(866),o=n(411);e.exports=r},function(e,t,n){function r(e,t){return function(n,r){if(null==n)return n;if(!i(n))return e(n,r);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==r(s[a],a,s););return n}}var i=n(86);e.exports=r},function(e,t){function n(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}e.exports=n},function(e,t,n){function r(e){return function(t){t=s(t);var n=o(t)?a(t):void 0,r=n?n[0]:t.charAt(0),u=n?i(n,1).join(""):t.slice(1);return r[e]()+u}}var i=n(874),o=n(410),a=n(935),s=n(87);e.exports=r},function(e,t,n){function r(e){return function(t,n,r){var s=Object(t);if(!o(t)){var u=i(n,3);t=a(t),n=function(e){return u(s[e],e,s)}}var l=e(t,n,r);return l>-1?s[u?t[l]:l]:void 0}}var i=n(119),o=n(86),a=n(59);e.exports=r},function(e,t,n){var r=n(864),i={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},o=r(i);e.exports=o},function(e,t,n){function r(e,t,n,r,i,k,S){switch(n){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x:return!(e.byteLength!=t.byteLength||!k(new o(e),new o(t)));case f:case h:case v:return a(+e,+t);case d:return e.name==t.name&&e.message==t.message;case g:case _:return e==t+"";case m:var C=u;case y:var A=r&c;if(C||(C=l),e.size!=t.size&&!A)return!1;var D=S.get(e);if(D)return D==t;r|=p,S.set(e,t);var O=s(C(e),C(t),r,i,k,S);return S.delete(e),O;case b:if(E)return E.call(e)==E.call(t)}return!1}var i=n(82),o=n(392),a=n(120),s=n(404),u=n(413),l=n(416),c=1,p=2,f="[object Boolean]",h="[object Date]",d="[object Error]",m="[object Map]",v="[object Number]",g="[object RegExp]",y="[object Set]",_="[object String]",b="[object Symbol]",x="[object ArrayBuffer]",w="[object DataView]",k=i?i.prototype:void 0,E=k?k.valueOf:void 0;e.exports=r},function(e,t,n){function r(e,t,n,r,a,u){var l=n&o,c=i(e),p=c.length;if(p!=i(t).length&&!l)return!1;for(var f=p;f--;){var h=c[f];if(!(l?h in t:s.call(t,h)))return!1}var d=u.get(e);if(d&&u.get(t))return d==t;var m=!0;u.set(e,t),u.set(t,e);for(var v=l;++f<p;){h=c[f];var g=e[h],y=t[h];if(r)var _=l?r(y,g,h,t,e,u):r(g,y,h,e,t,u);if(!(void 0===_?g===y||a(g,y,n,r,u):_)){m=!1;break}v||(v="constructor"==h)}if(m&&!v){var b=e.constructor,x=t.constructor;b!=x&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof x&&x instanceof x)&&(m=!1)}return u.delete(e),u.delete(t),m}var i=n(59),o=1,a=Object.prototype,s=a.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return i(e,a,o)}var i=n(398),o=n(220),a=n(59);e.exports=r},function(e,t,n){function r(e){for(var t=o(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,i(a)]}return t}var i=n(412),o=n(59);e.exports=r},function(e,t,n){function r(e){var t=a.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[u]=n:delete e[u]),i}var i=n(82),o=Object.prototype,a=o.hasOwnProperty,s=o.toString,u=i?i.toStringTag:void 0;e.exports=r},function(e,t){function n(e,t){return null==e?void 0:e[t]}e.exports=n},function(e,t,n){function r(e,t,n){t=i(t,e);for(var r=-1,c=t.length,p=!1;++r<c;){var f=l(t[r]);if(!(p=null!=e&&n(e,f)))break;e=e[f]}return p||++r!=c?p:!!(c=null==e?0:e.length)&&u(c)&&s(f,c)&&(a(e)||o(e))}var i=n(83),o=n(226),a=n(20),s=n(152),u=n(228),l=n(85);e.exports=r},function(e,t){function n(e){return r.test(e)}var r=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=n},function(e,t,n){function r(){this.__data__=i?i(null):{},this.size=0}var i=n(154);e.exports=r},function(e,t){function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}e.exports=n},function(e,t,n){function r(e){var t=this.__data__;if(i){var n=t[e];return n===o?void 0:n}return s.call(t,e)?t[e]:void 0}var i=n(154),o="__lodash_hash_undefined__",a=Object.prototype,s=a.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){var t=this.__data__;return i?void 0!==t[e]:a.call(t,e)}var i=n(154),o=Object.prototype,a=o.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=i&&void 0===t?o:t,this}var i=n(154),o="__lodash_hash_undefined__";e.exports=r},function(e,t){function n(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&i.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var r=Object.prototype,i=r.hasOwnProperty;e.exports=n},function(e,t,n){function r(e,t,n,r){var M=e.constructor;switch(t){case _:return i(e);case p:case f:return new M(+e);case b:return o(e,r);case x:case w:case k:case E:case S:case C:case A:case D:case O:return c(e,r);case h:return a(e,r,n);case d:case g:return new M(e);case m:return s(e);case v:return u(e,r,n);case y:return l(e)}}var i=n(218),o=n(876),a=n(877),s=n(878),u=n(879),l=n(880),c=n(881),p="[object Boolean]",f="[object Date]",h="[object Map]",d="[object Number]",m="[object RegExp]",v="[object Set]",g="[object String]",y="[object Symbol]",_="[object ArrayBuffer]",b="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",k="[object Int8Array]",E="[object Int16Array]",S="[object Int32Array]",C="[object Uint8Array]",A="[object Uint8ClampedArray]",D="[object Uint16Array]",O="[object Uint32Array]";e.exports=r},function(e,t,n){function r(e){return"function"!=typeof e.constructor||a(e)?{}:i(o(e))}var i=n(844),o=n(219),a=n(153);e.exports=r},function(e,t,n){function r(e){return a(e)||o(e)||!!(s&&e&&e[s])}var i=n(82),o=n(226),a=n(20),s=i?i.isConcatSpreadable:void 0;e.exports=r},function(e,t){function n(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}e.exports=n},function(e,t,n){function r(e){return!!o&&o in e}var i=n(885),o=function(){var e=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=r},function(e,t){function n(){this.__data__=[],this.size=0}e.exports=n},function(e,t,n){function r(e){var t=this.__data__,n=i(t,e);return!(n<0)&&(n==t.length-1?t.pop():a.call(t,n,1),--this.size,!0)}var i=n(149),o=Array.prototype,a=o.splice;e.exports=r},function(e,t,n){function r(e){var t=this.__data__,n=i(t,e);return n<0?void 0:t[n][1]}var i=n(149);e.exports=r},function(e,t,n){function r(e){return i(this.__data__,e)>-1}var i=n(149);e.exports=r},function(e,t,n){function r(e,t){var n=this.__data__,r=i(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var i=n(149);e.exports=r},function(e,t,n){function r(){this.size=0,this.__data__={hash:new i,map:new(a||o),string:new i}}var i=n(829),o=n(146),a=n(213);e.exports=r},function(e,t,n){function r(e){var t=i(this,e).delete(e);return this.size-=t?1:0,t}var i=n(151);e.exports=r},function(e,t,n){function r(e){return i(this,e).get(e)}var i=n(151);e.exports=r},function(e,t,n){function r(e){return i(this,e).has(e)}var i=n(151);e.exports=r},function(e,t,n){function r(e,t){var n=i(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var i=n(151);e.exports=r},function(e,t,n){function r(e){var t=i(e,function(e){return n.size===o&&n.clear(),e}),n=t.cache;return t}var i=n(425),o=500;e.exports=r},function(e,t,n){var r=n(222),i=r(Object.keys,Object);e.exports=i},function(e,t){function n(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}e.exports=n},function(e,t,n){(function(e){var r=n(406),i="object"==typeof t&&t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i,s=a&&r.process,u=function(){try{return s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=u}).call(t,n(72)(e))},function(e,t){function n(e){return i.call(e)}var r=Object.prototype,i=r.toString;e.exports=n},function(e,t,n){function r(e,t){return t.length<2?e:i(e,o(t,0,-1))}var i=n(150),o=n(400);e.exports=r},function(e,t){function n(e){return this.__data__.set(e,r),this}var r="__lodash_hash_undefined__";e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t){function n(e){var t=0,n=0;return function(){var a=o(),s=i-(a-n);if(n=a,s>0){if(++t>=r)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var r=800,i=16,o=Date.now;e.exports=n},function(e,t,n){function r(){this.__data__=new i,this.size=0}var i=n(146);e.exports=r},function(e,t){function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}e.exports=n},function(e,t){function n(e){return this.__data__.get(e)}e.exports=n},function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},function(e,t,n){function r(e,t){var n=this.__data__;if(n instanceof i){var r=n.__data__;if(!o||r.length<s-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(r)}return n.set(e,t),this.size=n.size,this}var i=n(146),o=n(213),a=n(214),s=200;e.exports=r},function(e,t,n){function r(e){return o(e)?a(e):i(e)}var i=n(839),o=n(410),a=n(937);e.exports=r},function(e,t,n){var r=n(921),i=/^\./,o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,s=r(function(e){var t=[];return i.test(e)&&t.push(""),e.replace(o,function(e,n,r,i){t.push(r?i.replace(a,"$1"):n||e)}),t});e.exports=s},function(e,t){function n(e){return e.match(p)||[]}var r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",u="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",o,a].join("|")+")[\\ufe0e\\ufe0f]?"+s+")*",l="[\\ufe0e\\ufe0f]?"+s+u,c="(?:"+["[^\\ud800-\\udfff]"+r+"?",r,o,a,"[\\ud800-\\udfff]"].join("|")+")",p=RegExp(i+"(?="+i+")|"+c+l,"g");e.exports=n},function(e,t){function n(e){return e.match(m)||[]}var r="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",i="["+r+"]",o="[a-z\\xdf-\\xf6\\xf8-\\xff]",a="[^\\ud800-\\udfff"+r+"\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",l="[A-Z\\xc0-\\xd6\\xd8-\\xde]",c="(?:"+o+"|"+a+")",p="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",f="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",s,u].join("|")+")[\\ufe0e\\ufe0f]?"+p+")*",h="[\\ufe0e\\ufe0f]?"+p+f,d="(?:"+["[\\u2700-\\u27bf]",s,u].join("|")+")"+h,m=RegExp([l+"?"+o+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[i,l,"$"].join("|")+")","(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[i,l+c,"$"].join("|")+")",l+"?"+c+"+(?:['’](?:d|ll|m|re|s|t|ve))?",l+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)","\\d+",d].join("|"),"g");e.exports=n},function(e,t,n){var r=n(148),i=n(84),o=n(886),a=n(86),s=n(153),u=n(59),l=Object.prototype,c=l.hasOwnProperty,p=o(function(e,t){if(s(t)||a(t))return void i(t,u(t),e);for(var n in t)c.call(t,n)&&r(e,n,t[n])});e.exports=p},function(e,t,n){var r=n(941),i=n(402),o=i(function(e,t,n){return t=t.toLowerCase(),e+(n?r(t):t)});e.exports=o},function(e,t,n){function r(e){return o(i(e).toLowerCase())}var i=n(87),o=n(428);e.exports=r},function(e,t,n){function r(e){return i(e,o|a)}var i=n(397),o=1,a=4;e.exports=r},function(e,t){function n(e){return function(){return e}}e.exports=n},function(e,t,n){function r(e){return(e=o(e))&&e.replace(a,i).replace(s,"")}var i=n(891),o=n(87),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=r},function(e,t,n){function r(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var u=null==n?0:a(n);return u<0&&(u=s(r+u,0)),i(e,o(t,3),u)}var i=n(846),o=n(119),a=n(427),s=Math.max;e.exports=r},function(e,t,n){function r(e){return(null==e?0:e.length)?i(e,1):[]}var i=n(847);e.exports=r},function(e,t){function n(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=n},function(e,t,n){var r=n(402),i=r(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()});e.exports=i},function(e,t){function n(e){if("function"!=typeof e)throw new TypeError(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var r="Expected a function";e.exports=n},function(e,t,n){var r=n(394),i=n(397),o=n(872),a=n(83),s=n(84),u=n(405),l=n(407),c=u(function(e,t){var n={};if(null==e)return n;var u=!1;t=r(t,function(t){return t=a(t,e),u||(u=t.length>1),t}),s(e,l(e),n),u&&(n=i(n,7));for(var c=t.length;c--;)o(n,t[c]);return n});e.exports=c},function(e,t,n){var r=n(860),i=n(405),o=i(function(e,t){return null==e?{}:r(e,t)});e.exports=o},function(e,t,n){function r(e){return a(e)?i(s(e)):o(e)}var i=n(862),o=n(863),a=n(221),s=n(85);e.exports=r},function(e,t,n){function r(e,t,n){var r=u(e)?i:s,l=arguments.length<3;return r(e,a(t,4),n,l,o)}var i=n(147),o=n(217),a=n(119),s=n(865),u=n(20);e.exports=r},function(e,t,n){function r(e,t){return(s(e)?i:o)(e,u(a(t,3)))}var i=n(838),o=n(845),a=n(119),s=n(20),u=n(949);e.exports=r},function(e,t,n){function r(e,t,n){var r=s(e)?i:a;return n&&u(e,t,n)&&(t=void 0),r(e,o(t,3))}var i=n(395),o=n(119),a=n(869),s=n(20),u=n(411);e.exports=r},function(e,t,n){function r(e,t,n){return e=s(e),n=i(a(n),0,e.length),t=o(t),e.slice(n,n+t.length)==t}var i=n(843),o=n(401),a=n(427),s=n(87);e.exports=r},function(e,t){function n(){return!1}e.exports=n},function(e,t,n){function r(e){if(!e)return 0===e?e:0;if((e=i(e))===o||e===-o){return(e<0?-1:1)*a}return e===e?e:0}var i=n(959),o=1/0,a=1.7976931348623157e308;e.exports=r},function(e,t,n){function r(e){if("number"==typeof e)return e;if(o(e))return a;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var n=l.test(e);return n||c.test(e)?p(e.slice(2),n?2:8):u.test(e)?a:+e}var i=n(38),o=n(155),a=NaN,s=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,p=parseInt;e.exports=r},function(e,t,n){function r(e,t,n){return e=a(e),t=n?void 0:t,void 0===t?o(e)?s(e):i(e):e.match(t)||[]}var i=n(840),o=n(899),a=n(87),s=n(938);e.exports=r},function(e,t,n){"use strict";var r=n(65),i=Object.create,o=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n=0,a=1,s=i(null),u=i(null),l=0;return e=r(e),{hit:function(r){var i=u[r],c=++l;if(s[c]=r,u[r]=c,!i){if(++n<=e)return;return r=s[a],t(r),r}if(delete s[i],a===i)for(;!o.call(s,++a);)continue},delete:t=function(e){var t=u[e];if(t&&(delete s[t],delete u[e],--n,a===t)){if(!n)return l=0,void(a=1);for(;!o.call(s,++a);)continue}},clear:function(){n=0,a=1,s=i(null),u=i(null),l=0}}}},function(e,t,n){"use strict";var r=n(207),i=n(374),o=n(375),a=n(371),s=n(229),u=Array.prototype.slice,l=Function.prototype.apply,c=Object.create,p=Object.prototype.hasOwnProperty;n(69).async=function(e,t){var n,f,h,d=c(null),m=c(null),v=t.memoized,g=t.original;t.memoized=a(function(e){var t=arguments,r=t[t.length-1];return"function"==typeof r&&(n=r,t=u.call(t,0,-1)),v.apply(f=this,h=t)},v);try{o(t.memoized,v)}catch(e){}t.on("get",function(e){var r,i,o;if(n){if(d[e])return"function"==typeof d[e]?d[e]=[d[e],n]:d[e].push(n),void(n=null);r=n,i=f,o=h,n=f=h=null,s(function(){var a;p.call(m,e)?(a=m[e],t.emit("getasync",e,o,i),l.call(r,a.context,a.args)):(n=r,f=i,h=o,v.apply(i,o))})}}),t.original=function(){var e,i,o,a;return n?(e=r(arguments),i=function e(n){var i,o,u=e.id;return null==u?void s(l.bind(e,this,arguments)):(delete e.id,i=d[u],delete d[u],i?(o=r(arguments),t.has(u)&&(n?t.delete(u):(m[u]={context:this,args:o},t.emit("setasync",u,"function"==typeof i?1:i.length))),"function"==typeof i?a=l.call(i,this,o):i.forEach(function(e){a=l.call(e,this,o)},this),a):void 0)},o=n,n=f=h=null,e.push(i),a=l.call(g,this,e),i.cb=o,n=i,a):l.call(g,this,arguments)},t.on("set",function(e){if(!n)return void t.delete(e);d[e]?"function"==typeof d[e]?d[e]=[d[e],n.cb]:d[e].push(n.cb):d[e]=n.cb,delete n.cb,n.id=e,n=null}),t.on("delete",function(e){var n;p.call(d,e)||m[e]&&(n=m[e],delete m[e],t.emit("deleteasync",e,u.call(n.args,1)))}),t.on("clear",function(){var e=m;m=c(null),t.emit("clearasync",i(e,function(e){return u.call(e.args,1)}))})}},function(e,t,n){"use strict";var r=n(58),i=n(142),o=n(69),a=Function.prototype.apply;o.dispose=function(e,t,n){var s;if(r(e),n.async&&o.async||n.promise&&o.promise)return t.on("deleteasync",s=function(t,n){a.call(e,null,n)}),void t.on("clearasync",function(e){i(e,function(e,t){s(t,e)})});t.on("delete",s=function(t,n){e(n)}),t.on("clear",function(e){i(e,function(e,t){s(t,e)})})}},function(e,t,n){"use strict";var r=n(207),i=n(142),o=n(229),a=n(386),s=n(1186),u=n(69),l=Function.prototype,c=Math.max,p=Math.min,f=Object.create;u.maxAge=function(e,t,n){var h,d,m,v;(e=s(e))&&(h=f(null),d=n.async&&u.async||n.promise&&u.promise?"async":"",t.on("set"+d,function(n){h[n]=setTimeout(function(){t.delete(n)},e),v&&(v[n]&&"nextTick"!==v[n]&&clearTimeout(v[n]),v[n]=setTimeout(function(){delete v[n]},m))}),t.on("delete"+d,function(e){clearTimeout(h[e]),delete h[e],v&&("nextTick"!==v[e]&&clearTimeout(v[e]),delete v[e])}),n.preFetch&&(m=!0===n.preFetch||isNaN(n.preFetch)?.333:c(p(Number(n.preFetch),1),0))&&(v={},m=(1-m)*e,t.on("get"+d,function(e,i,s){v[e]||(v[e]="nextTick",o(function(){var o;"nextTick"===v[e]&&(delete v[e],t.delete(e),n.async&&(i=r(i),i.push(l)),o=t.memoized.apply(s,i),n.promise&&a(o)&&("function"==typeof o.done?o.done(l,l):o.then(l,l)))}))})),t.on("clear"+d,function(){i(h,function(e){clearTimeout(e)}),h={},v&&(i(v,function(e){"nextTick"!==e&&clearTimeout(e)}),v={})}))}},function(e,t,n){"use strict";var r=n(65),i=n(961),o=n(69);o.max=function(e,t,n){var a,s,u;(e=r(e))&&(s=i(e),a=n.async&&o.async||n.promise&&o.promise?"async":"",t.on("set"+a,u=function(e){void 0!==(e=s.hit(e))&&t.delete(e)}),t.on("get"+a,u),t.on("delete"+a,s.delete),t.on("clear"+a,s.clear))}},function(e,t,n){"use strict";var r=n(374),i=n(386),o=n(229),a=Object.create,s=Object.prototype.hasOwnProperty;n(69).promise=function(e,t){var n=a(null),u=a(null),l=a(null);t.on("set",function(r,a,s){if(!i(s))return u[r]=s,void t.emit("setasync",r,1);n[r]=1,l[r]=s;var c=function(e){var i=n[r];i&&(delete n[r],u[r]=e,t.emit("setasync",r,i))},p=function(){n[r]&&(delete n[r],delete l[r],t.delete(r))};"then"!==e&&"function"==typeof s.done?"done"!==e&&"function"==typeof s.finally?(s.done(c),s.finally(p)):s.done(c,p):s.then(function(e){o(c.bind(this,e))},function(){o(p)})}),t.on("get",function(e,r,a){var s;if(n[e])return void++n[e];s=l[e];var u=function(){t.emit("getasync",e,r,a)};i(s)?"function"==typeof s.done?s.done(u):s.then(function(){o(u)}):u()}),t.on("delete",function(e){if(delete l[e],n[e])return void delete n[e];if(s.call(u,e)){var r=u[e];delete u[e],t.emit("deleteasync",e,[r])}}),t.on("clear",function(){var e=u;u=a(null),n=a(null),l=a(null),t.emit("clearasync",r(e,function(e){return[e]}))})}},function(e,t,n){"use strict";var r=n(141),i=n(69),o=Object.create,a=Object.defineProperties;i.refCounter=function(e,t,n){var s,u;s=o(null),u=n.async&&i.async||n.promise&&i.promise?"async":"",t.on("set"+u,function(e,t){s[e]=t||1}),t.on("get"+u,function(e){++s[e]}),t.on("delete"+u,function(e){delete s[e]}),t.on("clear"+u,function(){s={}}),a(t.memoized,{deleteRef:r(function(){var e=t.get(arguments);return null===e?null:s[e]?!--s[e]&&(t.delete(e),!0):null}),getRefCount:r(function(){var e=t.get(arguments);return null===e?0:s[e]?s[e]:0})})}},function(e,t,n){"use strict";var r=n(376),i=n(431),o=n(977);e.exports=function(e){var t,a=r(arguments[1]);return a.normalizer||0!==(t=a.length=i(a.length,e.length,a.async))&&(a.primitive?!1===t?a.normalizer=n(976):t>1&&(a.normalizer=n(974)(t)):a.normalizer=!1===t?n(975)():1===t?n(972)():n(973)(t)),a.async&&n(962),a.promise&&n(966),a.dispose&&n(963),a.maxAge&&n(964),a.max&&n(965),a.refCounter&&n(967),o(e,a)}},function(e,t,n){"use strict";var r=n(716),i=n(371),o=n(141),a=n(744).methods,s=n(971),u=n(970),l=Function.prototype.apply,c=Function.prototype.call,p=Object.create,f=Object.prototype.hasOwnProperty,h=Object.defineProperties,d=a.on,m=a.emit;e.exports=function(e,t,n){var a,v,g,y,_,b,x,w,k,E,S,C,A,D=p(null);return v=!1!==t?t:isNaN(e.length)?1:e.length,n.normalizer&&(w=u(n.normalizer),g=w.get,y=w.set,_=w.delete,b=w.clear),null!=n.resolvers&&(A=s(n.resolvers)),C=g?i(function(t){var n,i,o=arguments;if(A&&(o=A(o)),null!==(n=g(o))&&f.call(D,n))return k&&a.emit("get",n,o,this),D[n];if(i=1===o.length?c.call(e,this,o[0]):l.call(e,this,o),null===n){if(null!==(n=g(o)))throw r("Circular invocation","CIRCULAR_INVOCATION");n=y(o)}else if(f.call(D,n))throw r("Circular invocation","CIRCULAR_INVOCATION");return D[n]=i,E&&a.emit("set",n,null,i),i},v):0===t?function(){var t;if(f.call(D,"data"))return k&&a.emit("get","data",arguments,this),D.data;if(t=arguments.length?l.call(e,this,arguments):c.call(e,this),f.call(D,"data"))throw r("Circular invocation","CIRCULAR_INVOCATION");return D.data=t,E&&a.emit("set","data",null,t),t}:function(t){var n,i,o=arguments;if(A&&(o=A(arguments)),i=String(o[0]),f.call(D,i))return k&&a.emit("get",i,o,this),D[i];if(n=1===o.length?c.call(e,this,o[0]):l.call(e,this,o),f.call(D,i))throw r("Circular invocation","CIRCULAR_INVOCATION");return D[i]=n,E&&a.emit("set",i,null,n),n},a={original:e,memoized:C,get:function(e){return A&&(e=A(e)),g?g(e):String(e[0])},has:function(e){return f.call(D,e)},delete:function(e){var t;f.call(D,e)&&(_&&_(e),t=D[e],delete D[e],S&&a.emit("delete",e,t))},clear:function(){var e=D;b&&b(),D=p(null),a.emit("clear",e)},on:function(e,t){return"get"===e?k=!0:"set"===e?E=!0:"delete"===e&&(S=!0),d.call(this,e,t)},emit:m,updateEnv:function(){e=a.original}},x=g?i(function(e){var t,n=arguments;A&&(n=A(n)),null!==(t=g(n))&&a.delete(t)},v):0===t?function(){return a.delete("data")}:function(e){return A&&(e=A(arguments)[0]),a.delete(e)},h(C,{__memoized__:o(!0),delete:o(x),clear:o(a.clear)}),a}},function(e,t,n){"use strict";var r=n(58);e.exports=function(e){var t;return"function"==typeof e?{set:e,get:e}:(t={get:r(e.get)},void 0!==e.set?(t.set=r(e.set),t.delete=r(e.delete),t.clear=r(e.clear),t):(t.set=t.get,t))}},function(e,t,n){"use strict";var r,i=n(715),o=n(58),a=Array.prototype.slice;r=function(e){return this.map(function(t,n){return t?t(e[n]):e[n]}).concat(a.call(e,this.length))},e.exports=function(e){return e=i(e),e.forEach(function(e){null!=e&&o(e)}),r.bind(e)}},function(e,t,n){"use strict";var r=n(206);e.exports=function(){var e=0,t=[],n=[];return{get:function(e){var i=r.call(t,e[0]);return-1===i?null:n[i]},set:function(r){return t.push(r[0]),n.push(++e),e},delete:function(e){var i=r.call(n,e);-1!==i&&(t.splice(i,1),n.splice(i,1))},clear:function(){t=[],n=[]}}}},function(e,t,n){"use strict";var r=n(206),i=Object.create;e.exports=function(e){var t=0,n=[[],[]],o=i(null);return{get:function(t){for(var i,o=0,a=n;o<e-1;){if(-1===(i=r.call(a[0],t[o])))return null;a=a[1][i],++o}return i=r.call(a[0],t[o]),-1===i?null:a[1][i]||null},set:function(i){for(var a,s=0,u=n;s<e-1;)a=r.call(u[0],i[s]),-1===a&&(a=u[0].push(i[s])-1,u[1].push([[],[]])),u=u[1][a],++s;return a=r.call(u[0],i[s]),-1===a&&(a=u[0].push(i[s])-1),u[1][a]=++t,o[t]=i,t},delete:function(t){for(var i,a=0,s=n,u=[],l=o[t];a<e-1;){if(-1===(i=r.call(s[0],l[a])))return;u.push(s,i),s=s[1][i],++a}if(-1!==(i=r.call(s[0],l[a]))){for(t=s[1][i],s[0].splice(i,1),s[1].splice(i,1);!s[0].length&&u.length;)i=u.pop(),s=u.pop(),s[0].splice(i,1),s[1].splice(i,1);delete o[t]}},clear:function(){n=[[],[]],o=i(null)}}}},function(e,t,n){"use strict";e.exports=function(e){return e?function(t){for(var n=String(t[0]),r=0,i=e;--i;)n+=""+t[++r];return n}:function(){return""}}},function(e,t,n){"use strict";var r=n(206),i=Object.create;e.exports=function(){var e=0,t=[],n=i(null);return{get:function(e){var n,i=0,o=t,a=e.length;if(0===a)return o[a]||null;if(o=o[a]){for(;i<a-1;){if(-1===(n=r.call(o[0],e[i])))return null;o=o[1][n],++i}return n=r.call(o[0],e[i]),-1===n?null:o[1][n]||null}return null},set:function(i){var o,a=0,s=t,u=i.length;if(0===u)s[u]=++e;else{for(s[u]||(s[u]=[[],[]]),s=s[u];a<u-1;)o=r.call(s[0],i[a]),-1===o&&(o=s[0].push(i[a])-1,s[1].push([[],[]])),s=s[1][o],++a;o=r.call(s[0],i[a]),-1===o&&(o=s[0].push(i[a])-1),s[1][o]=++e}return n[e]=i,e},delete:function(e){var i,o=0,a=t,s=n[e],u=s.length,l=[];if(0===u)delete a[u];else if(a=a[u]){for(;o<u-1;){if(-1===(i=r.call(a[0],s[o])))return;l.push(a,i),a=a[1][i],++o}if(-1===(i=r.call(a[0],s[o])))return;for(e=a[1][i],a[0].splice(i,1),a[1].splice(i,1);!a[0].length&&l.length;)i=l.pop(),a=l.pop(),a[0].splice(i,1),a[1].splice(i,1)}delete n[e]},clear:function(){t=[],n=i(null)}}}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r=e.length;if(!r)return"";for(t=String(e[n=0]);--r;)t+=""+e[++n];return t}},function(e,t,n){"use strict";var r=n(58),i=n(142),o=n(69),a=n(969),s=n(431),u=Object.prototype.hasOwnProperty;e.exports=function e(t){var n,l,c;if(r(t),n=Object(arguments[1]),n.async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return u.call(t,"__memoized__")&&!n.force?t:(l=s(n.length,t.length,n.async&&o.async),c=a(t,l,n),i(o,function(e,t){n[t]&&e(n[t],c,n)}),e.__profiler__&&e.__profiler__(c),c.updateEnv(),c.memoized)}},function(e,t,n){"use strict";e.exports=Number.isNaN||function(e){return e!==e}},function(e,t){/*! - * pascalcase <https://github.com/jonschlinkert/pascalcase> - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ -function n(e){if("string"!=typeof e)throw new TypeError("expected a string.");return e=e.replace(/([A-Z])/g," $1"),1===e.length?e.toUpperCase():(e=e.replace(/^[\W_]+|[\W_]+$/g,"").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\W_]+(\w|$)/g,function(e,t){return t.toUpperCase()}))}e.exports=n},function(e,t,n){"use strict";(function(r){function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var a=n(442),s=i(a),u=n(230),l=i(u),c=function(){function e(t,n,r){o(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r}return e.prototype.isMap=function(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0},e.prototype.previous=function(){var e=this;return this.previousMaps||(this.previousMaps=[],this.root.walk(function(t){if(t.source&&t.source.input.map){var n=t.source.input.map;-1===e.previousMaps.indexOf(n)&&e.previousMaps.push(n)}})),this.previousMaps},e.prototype.isInline=function(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))},e.prototype.isSourcesContent=function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})},e.prototype.clearAnnotation=function(){if(!1!==this.mapOpts.annotation)for(var e=void 0,t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)},e.prototype.setSourcesContent=function(){var e=this,t={};this.root.walk(function(n){if(n.source){var r=n.source.input.from;if(r&&!t[r]){t[r]=!0;var i=e.relative(r);e.map.setSourceContent(i,n.source.input.css)}}})},e.prototype.applyPrevMaps=function(){for(var e=this.previous(),t=Array.isArray(e),n=0,e=t?e:e[Symbol.iterator]();;){var r;if(t){if(n>=e.length)break;r=e[n++]}else{if(n=e.next(),n.done)break;r=n.value}var i=r,o=this.relative(i.file),a=i.root||l.default.dirname(i.file),u=void 0;!1===this.mapOpts.sourcesContent?(u=new s.default.SourceMapConsumer(i.text),u.sourcesContent&&(u.sourcesContent=u.sourcesContent.map(function(){return null}))):u=i.consumer(),this.map.applySourceMap(u,o,this.relative(a))}},e.prototype.isAnnotation=function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))},e.prototype.toBase64=function(e){return r?r.from&&r.from!==Uint8Array.from?r.from(e).toString("base64"):new r(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},e.prototype.addAnnotation=function(){var e=void 0;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:this.outputFile()+".map";var t="\n";-1!==this.css.indexOf("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"},e.prototype.outputFile=function(){return this.opts.to?this.relative(this.opts.to):this.opts.from?this.relative(this.opts.from):"to.css"},e.prototype.generateMap=function(){return this.generateString(),this.isSourcesContent()&&this.setSourcesContent(),this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},e.prototype.relative=function(e){if(0===e.indexOf("<"))return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?l.default.dirname(this.opts.to):".";return"string"==typeof this.mapOpts.annotation&&(t=l.default.dirname(l.default.resolve(t,this.mapOpts.annotation))),e=l.default.relative(t,e),"\\"===l.default.sep?e.replace(/\\/g,"/"):e},e.prototype.sourcePath=function(e){return this.mapOpts.from?this.mapOpts.from:this.relative(e.source.input.from)},e.prototype.generateString=function(){var e=this;this.css="",this.map=new s.default.SourceMapGenerator({file:this.outputFile()});var t=1,n=1,r=void 0,i=void 0;this.stringify(this.root,function(o,a,s){e.css+=o,a&&"end"!==s&&(a.source&&a.source.start?e.map.addMapping({source:e.sourcePath(a),generated:{line:t,column:n-1},original:{line:a.source.start.line,column:a.source.start.column-1}}):e.map.addMapping({source:"<no source>",original:{line:1,column:0},generated:{line:t,column:n-1}})),r=o.match(/\n/g),r?(t+=r.length,i=o.lastIndexOf("\n"),n=o.length-i):n+=o.length,a&&"start"!==s&&(a.source&&a.source.end?e.map.addMapping({source:e.sourcePath(a),generated:{line:t,column:n-1},original:{line:a.source.end.line,column:a.source.end.column}}):e.map.addMapping({source:"<no source>",original:{line:1,column:0},generated:{line:t,column:n-1}}))})},e.prototype.generate=function(){if(this.clearAnnotation(),this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(t){e+=t}),[e]},e}();t.default=c,e.exports=t.default}).call(t,n(40).Buffer)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(234),a=r(o),s=n(438),u=r(s),l=n(232),c=r(l),p=n(156),f=r(p),h=n(237),d=r(h),m=n(157),v=r(m),g=function(){function e(t){i(this,e),this.input=t,this.root=new d.default,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{line:1,column:1}}}return e.prototype.createTokenizer=function(){this.tokenizer=(0,u.default)(this.input)},e.prototype.parse=function(){for(var e=void 0;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()},e.prototype.comment=function(e){var t=new c.default;this.init(t,e[2],e[3]),t.source.end={line:e[4],column:e[5]};var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var r=n.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}},e.prototype.emptyRule=function(e){var t=new v.default;this.init(t,e[2],e[3]),t.selector="",t.raws.between="",this.current=t},e.prototype.other=function(e){for(var t=!1,n=null,r=!1,i=null,o=[],a=[],s=e;s;){if(n=s[0],a.push(s),"("===n||"["===n)i||(i=s),o.push("("===n?")":"]");else if(0===o.length){if(";"===n){if(r)return void this.decl(a);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));s=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){for(;a.length&&("space"===(s=a[a.length-1][0])||"comment"===s);)this.tokenizer.back(a.pop());return void this.decl(a)}this.unknownWord(a)},e.prototype.rule=function(e){e.pop();var t=new v.default;this.init(t,e[0][2],e[0][3]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t},e.prototype.decl=function(e){var t=new a.default;this.init(t);var n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),n[4]?t.source.end={line:n[4],column:n[5]}:t.source.end={line:n[2],column:n[3]};"word"!==e[0][0];)1===e.length&&this.unknownWord(e),t.raws.before+=e.shift()[1];for(t.source.start={line:e[0][2],column:e[0][3]},t.prop="";e.length;){var r=e[0][0];if(":"===r||"space"===r||"comment"===r)break;t.prop+=e.shift()[1]}t.raws.between="";for(var i=void 0;e.length;){if(i=e.shift(),":"===i[0]){t.raws.between+=i[1];break}t.raws.between+=i[1]}"_"!==t.prop[0]&&"*"!==t.prop[0]||(t.raws.before+=t.prop[0],t.prop=t.prop.slice(1)),t.raws.between+=this.spacesAndCommentsFromStart(e),this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){if(i=e[o],"!important"===i[1].toLowerCase()){t.important=!0;var s=this.stringFrom(e,o);s=this.spacesFromEnd(e)+s," !important"!==s&&(t.raws.important=s);break}if("important"===i[1].toLowerCase()){for(var u=e.slice(0),l="",c=o;c>0;c--){var p=u[c][0];if(0===l.trim().indexOf("!")&&"space"!==p)break;l=u.pop()[1]+l}0===l.trim().indexOf("!")&&(t.important=!0,t.raws.important=l,e=u)}if("space"!==i[0]&&"comment"!==i[0])break}this.raw(t,"value",e),-1!==t.value.indexOf(":")&&this.checkMissedSemicolon(e)},e.prototype.atrule=function(e){var t=new f.default;t.name=e[1].slice(1),""===t.name&&this.unnamedAtrule(t,e),this.init(t,e[2],e[3]);for(var n=void 0,r=void 0,i=!1,o=!1,a=[];!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),";"===e[0]){t.source.end={line:e[2],column:e[3]},this.semicolon=!0;break}if("{"===e[0]){o=!0;break}if("}"===e[0]){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(t.source.end={line:n[4],column:n[5]})}this.end(e);break}if(a.push(e),this.tokenizer.endOfFile()){i=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),i&&(e=a[a.length-1],t.source.end={line:e[4],column:e[5]},this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),o&&(t.nodes=[],this.current=t)},e.prototype.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end={line:e[2],column:e[3]},this.current=this.current.parent):this.unexpectedClose(e)},e.prototype.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces},e.prototype.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}},e.prototype.init=function(e,t,n){this.current.push(e),e.source={start:{line:t,column:n},input:this.input},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)},e.prototype.raw=function(e,t,n){for(var r=void 0,i=void 0,o=n.length,a="",s=!0,u=0;u<o;u+=1)r=n[u],i=r[0],"comment"===i||"space"===i&&u===o-1?s=!1:a+=r[1];if(!s){var l=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={value:a,raw:l}}e[t]=a},e.prototype.spacesAndCommentsFromEnd=function(e){for(var t=void 0,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n},e.prototype.spacesAndCommentsFromStart=function(e){for(var t=void 0,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n},e.prototype.spacesFromEnd=function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t},e.prototype.stringFrom=function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n},e.prototype.colon=function(e){for(var t=0,n=void 0,r=void 0,i=void 0,o=0;o<e.length;o++){if(n=e[o],"("===(r=n[0]))t+=1;else if(")"===r)t-=1;else if(0===t&&":"===r){if(i){if("word"===i[0]&&"progid"===i[1])continue;return o}this.doubleColon(n)}i=n}return!1},e.prototype.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",e[2],e[3])},e.prototype.unknownWord=function(e){throw this.input.error("Unknown word",e[0][2],e[0][3])},e.prototype.unexpectedClose=function(e){throw this.input.error("Unexpected }",e[2],e[3])},e.prototype.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},e.prototype.doubleColon=function(e){throw this.input.error("Double colon",e[2],e[3])},e.prototype.unnamedAtrule=function(e,t){throw this.input.error("At-rule without name",t[2],t[3])},e.prototype.precheckMissedSemicolon=function(e){},e.prototype.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n=0,r=void 0,i=t-1;i>=0&&(r=e[i],"space"===r[0]||2!==(n+=1));i--);throw this.input.error("Missed semicolon",r[2],r[3])}},e}();t.default=g,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new u.default(t)}t.__esModule=!0;var o=n(234),a=r(o),s=n(436),u=r(s),l=n(238),c=r(l),p=n(232),f=r(p),h=n(156),d=r(h),m=n(986),v=r(m),g=n(236),y=r(g),_=n(435),b=r(_),x=n(157),w=r(x),k=n(237),E=r(k);i.plugin=function(e,t){var n=function(){var n=t.apply(void 0,arguments);return n.postcssPlugin=e,n.postcssVersion=(new u.default).version,n},r=void 0;return Object.defineProperty(n,"postcss",{get:function(){return r||(r=n()),r}}),n.process=function(e,t,r){return i([n(r)]).process(e,t)},n},i.stringify=c.default,i.parse=y.default,i.vendor=v.default,i.list=b.default,i.comment=function(e){return new f.default(e)},i.atRule=function(e){return new d.default(e)},i.decl=function(e){return new a.default(e)},i.rule=function(e){return new w.default(e)},i.root=function(e){return new E.default(e)},t.default=i,e.exports=t.default},function(e,t,n){"use strict";(function(r){function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return r?r.from&&r.from!==Uint8Array.from?r.from(e,"base64").toString():new r(e,"base64").toString():window.atob(e)}t.__esModule=!0;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=n(442),l=i(u),c=n(230),p=i(c),f=n(1210),h=i(f),d=function(){function e(t,n){o(this,e),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");var r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);i&&(this.text=i)}return e.prototype.consumer=function(){return this.consumerCache||(this.consumerCache=new l.default.SourceMapConsumer(this.text)),this.consumerCache},e.prototype.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},e.prototype.startWith=function(e,t){return!!e&&e.substr(0,t.length)===t},e.prototype.loadAnnotation=function(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//);t&&(this.annotation=t[1].trim())},e.prototype.decodeInline=function(e){var t=/^data:application\/json;(?:charset=utf-?8;)?base64,/,n="data:application/json,";if(this.startWith(e,n))return decodeURIComponent(e.substr(n.length));if(t.test(e))return a(e.substr(RegExp.lastMatch.length));var r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)},e.prototype.loadMap=function(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"==typeof t){var n=t(e);if(n&&h.default.existsSync&&h.default.existsSync(n))return h.default.readFileSync(n,"utf-8").toString().trim();throw new Error("Unable to load previous source map: "+n.toString())}if(t instanceof l.default.SourceMapConsumer)return l.default.SourceMapGenerator.fromSourceMap(t).toString();if(t instanceof l.default.SourceMapGenerator)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var r=this.annotation;return e&&(r=p.default.join(p.default.dirname(e),r)),this.root=p.default.dirname(r),!(!h.default.existsSync||!h.default.existsSync(r))&&h.default.readFileSync(r,"utf-8").toString().trim()}},e.prototype.isMap=function(e){return"object"===(void 0===e?"undefined":s(e))&&("string"==typeof e.mappings||"string"==typeof e._mappings)},e}();t.default=d,e.exports=t.default}).call(t,n(40).Buffer)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(988),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s=function(){function e(t,n,i){r(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=i,this.css=void 0,this.map=void 0}return e.prototype.toString=function(){return this.css},e.prototype.warn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new a.default(e,t);return this.messages.push(n),n},e.prototype.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},i(e,[{key:"content",get:function(){return this.css}}]),e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e[0],r=e[1];if("word"===n){if("."===r[0])return"class";if("#"===r[0])return"hash"}if(!t.endOfFile()){var i=t.nextToken();if(t.back(i),"brackets"===i[0]||"("===i[0])return"call"}return n}function o(e){for(var t=(0,l.default)(new p.default(e),{ignoreErrors:!0}),n="";!t.endOfFile();)!function(){var e=t.nextToken(),r=f[i(e,t)];n+=r?e[1].split(/\r?\n/).map(function(e){return r(e)}).join("\n"):e[1]}();return n}t.__esModule=!0;var a=n(503),s=r(a),u=n(438),l=r(u),c=n(433),p=r(c),f={brackets:s.default.cyan,"at-word":s.default.cyan,call:s.default.cyan,comment:s.default.gray,string:s.default.green,class:s.default.yellow,hash:s.default.magenta,"(":s.default.cyan,")":s.default.cyan,"{":s.default.yellow,"}":s.default.yellow,"[":s.default.yellow,"]":s.default.yellow,":":s.default.yellow,";":s.default.yellow};t.default=o,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r={prefix:function(e){var t=e.match(/^(-\w+-)/);return t?t[0]:""},unprefixed:function(e){return e.replace(/^-\w+-/,"")}};t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e){i[e]||(i[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}t.__esModule=!0,t.default=r;var i={};e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r(this,e),this.type="warning",this.text=t,n.node&&n.node.source){var i=n.node.positionBy(n);this.line=i.line,this.column=i.column}for(var o in n)this[o]=n[o]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}();t.default=i,e.exports=t.default},function(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},function(e,t){function n(e,r,i,o,a,s){var u=Math.floor((r-e)/2)+e,l=a(i,o[u],!0);return 0===l?u:l>0?r-u>1?n(u,r,i,o,a,s):s==t.LEAST_UPPER_BOUND?r<o.length?r:-1:u:u-e>1?n(e,u,i,o,a,s):s==t.LEAST_UPPER_BOUND?u:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,r,i,o){if(0===r.length)return-1;var a=n(-1,r.length,e,r,i,o||t.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===i(r[a],r[a-1],!0);)--a;return a}},function(e,t,n){function r(e,t){var n=e.generatedLine,r=t.generatedLine,i=e.generatedColumn,a=t.generatedColumn;return r>n||r==n&&a>=i||o.compareByGeneratedPositionsInflated(e,t)<=0}function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var o=n(121);i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){r(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(o.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=i},function(e,t){function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t){return Math.round(e+Math.random()*(t-e))}function i(e,t,o,a){if(o<a){var s=r(o,a),u=o-1;n(e,s,a);for(var l=e[a],c=o;c<a;c++)t(e[c],l)<=0&&(u+=1,n(e,u,c));n(e,u+1,c);var p=u+1;i(e,t,o,p-1),i(e,t,p+1,a)}}t.quickSort=function(e,t){i(e,t,0,e.length-1)}},function(e,t,n){function r(e,t){var n=e;return"string"==typeof e&&(n=s.parseSourceMapInput(e)),null!=n.sections?new a(n,t):new i(n,t)}function i(e,t){var n=e;"string"==typeof e&&(n=s.parseSourceMapInput(e));var r=s.getArg(n,"version"),i=s.getArg(n,"sources"),o=s.getArg(n,"names",[]),a=s.getArg(n,"sourceRoot",null),u=s.getArg(n,"sourcesContent",null),c=s.getArg(n,"mappings"),p=s.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);a&&(a=s.normalize(a)),i=i.map(String).map(s.normalize).map(function(e){return a&&s.isAbsolute(a)&&s.isAbsolute(e)?s.relative(a,e):e}),this._names=l.fromArray(o.map(String),!0),this._sources=l.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(e){return s.computeSourceURL(a,e,t)}),this.sourceRoot=a,this.sourcesContent=u,this._mappings=c,this._sourceMapURL=t,this.file=p}function o(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function a(e,t){var n=e;"string"==typeof e&&(n=s.parseSourceMapInput(e));var i=s.getArg(n,"version"),o=s.getArg(n,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new l,this._names=new l;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=s.getArg(e,"offset"),i=s.getArg(n,"line"),o=s.getArg(n,"column");if(i<a.line||i===a.line&&o<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=n,{generatedOffset:{generatedLine:i+1,generatedColumn:o+1},consumer:new r(s.getArg(e,"map"),t)}})}var s=n(121),u=n(990),l=n(439).ArraySet,c=n(440),p=n(992).quickSort;r.fromSourceMap=function(e,t){return i.fromSourceMap(e,t)},r.prototype._version=3,r.prototype.__generatedMappings=null,Object.defineProperty(r.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),r.prototype.__originalMappings=null,Object.defineProperty(r.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),r.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},r.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},r.GENERATED_ORDER=1,r.ORIGINAL_ORDER=2,r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.prototype.eachMapping=function(e,t,n){var i,o=t||null,a=n||r.GENERATED_ORDER;switch(a){case r.GENERATED_ORDER:i=this._generatedMappings;break;case r.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;i.map(function(e){var t=null===e.source?null:this._sources.at(e.source);return t=s.computeSourceURL(u,t,this._sourceMapURL),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,o)},r.prototype.allGeneratedPositionsFor=function(e){var t=s.getArg(e,"line"),n={source:s.getArg(e,"source"),originalLine:t,originalColumn:s.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var r=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(i>=0){var o=this._originalMappings[i];if(void 0===e.column)for(var a=o.originalLine;o&&o.originalLine===a;)r.push({line:s.getArg(o,"generatedLine",null),column:s.getArg(o,"generatedColumn",null),lastColumn:s.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++i];else for(var l=o.originalColumn;o&&o.originalLine===t&&o.originalColumn==l;)r.push({line:s.getArg(o,"generatedLine",null),column:s.getArg(o,"generatedColumn",null),lastColumn:s.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++i]}return r},t.SourceMapConsumer=r,i.prototype=Object.create(r.prototype),i.prototype.consumer=r,i.prototype._findSourceIndex=function(e){var t=e;if(null!=this.sourceRoot&&(t=s.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var n;for(n=0;n<this._absoluteSources.length;++n)if(this._absoluteSources[n]==e)return n;return-1},i.fromSourceMap=function(e,t){var n=Object.create(i.prototype),r=n._names=l.fromArray(e._names.toArray(),!0),a=n._sources=l.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(e){return s.computeSourceURL(n.sourceRoot,e,t)});for(var u=e._mappings.toArray().slice(),c=n.__generatedMappings=[],f=n.__originalMappings=[],h=0,d=u.length;h<d;h++){var m=u[h],v=new o;v.generatedLine=m.generatedLine,v.generatedColumn=m.generatedColumn,m.source&&(v.source=a.indexOf(m.source),v.originalLine=m.originalLine,v.originalColumn=m.originalColumn,m.name&&(v.name=r.indexOf(m.name)),f.push(v)),c.push(v)}return p(n.__originalMappings,s.compareByOriginalPositions),n},i.prototype._version=3,Object.defineProperty(i.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),i.prototype._parseMappings=function(e,t){for(var n,r,i,a,u,l=1,f=0,h=0,d=0,m=0,v=0,g=e.length,y=0,_={},b={},x=[],w=[];y<g;)if(";"===e.charAt(y))l++,y++,f=0;else if(","===e.charAt(y))y++;else{for(n=new o,n.generatedLine=l,a=y;a<g&&!this._charIsMappingSeparator(e,a);a++);if(r=e.slice(y,a),i=_[r])y+=r.length;else{for(i=[];y<a;)c.decode(e,y,b),u=b.value,y=b.rest,i.push(u);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");_[r]=i}n.generatedColumn=f+i[0],f=n.generatedColumn,i.length>1&&(n.source=m+i[1],m+=i[1],n.originalLine=h+i[2],h=n.originalLine,n.originalLine+=1,n.originalColumn=d+i[3],d=n.originalColumn,i.length>4&&(n.name=v+i[4],v+=i[4])),w.push(n),"number"==typeof n.originalLine&&x.push(n)}p(w,s.compareByGeneratedPositionsDeflated),this.__generatedMappings=w,p(x,s.compareByOriginalPositions),this.__originalMappings=x},i.prototype._findMapping=function(e,t,n,r,i,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return u.search(e,t,i,o)},i.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},i.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",s.compareByGeneratedPositionsDeflated,s.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var o=s.getArg(i,"source",null);null!==o&&(o=this._sources.at(o),o=s.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var a=s.getArg(i,"name",null);return null!==a&&(a=this._names.at(a)),{source:o,line:s.getArg(i,"originalLine",null),column:s.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},i.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var r=e;null!=this.sourceRoot&&(r=s.relative(this.sourceRoot,r));var i;if(null!=this.sourceRoot&&(i=s.urlParse(this.sourceRoot))){var o=r.replace(/^file:\/\//,"");if("file"==i.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!i.path||"/"==i.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var t=s.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:s.getArg(e,"line"),originalColumn:s.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===n.source)return{line:s.getArg(o,"generatedLine",null),column:s.getArg(o,"generatedColumn",null),lastColumn:s.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=i,a.prototype=Object.create(r.prototype),a.prototype.constructor=r,a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),a.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},n=u.search(t,this._sections,function(e,t){var n=e.generatedLine-t.generatedOffset.generatedLine;return n||e.generatedColumn-t.generatedOffset.generatedColumn}),r=this._sections[n];return r?r.consumer.originalPositionFor({line:t.generatedLine-(r.generatedOffset.generatedLine-1),column:t.generatedColumn-(r.generatedOffset.generatedLine===t.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},a.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},a.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var r=this._sections[n],i=r.consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},a.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(-1!==n.consumer._findSourceIndex(s.getArg(e,"source"))){var r=n.consumer.generatedPositionFor(e);if(r){return{line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)}}}}return{line:null,column:null}},a.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var r=this._sections[n],i=r.consumer._generatedMappings,o=0;o<i.length;o++){var a=i[o],u=r.consumer._sources.at(a.source);u=s.computeSourceURL(r.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var l=null;a.name&&(l=r.consumer._names.at(a.name),this._names.add(l),l=this._names.indexOf(l));var c={source:u,generatedLine:a.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(r.generatedOffset.generatedLine===a.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:l};this.__generatedMappings.push(c),"number"==typeof c.originalLine&&this.__originalMappings.push(c)}p(this.__generatedMappings,s.compareByGeneratedPositionsDeflated),p(this.__originalMappings,s.compareByOriginalPositions)},t.IndexedSourceMapConsumer=a},function(e,t,n){function r(e,t,n,r,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==i?null:i,this[s]=!0,null!=r&&this.add(r)}var i=n(441).SourceMapGenerator,o=n(121),a=/(\r?\n)/,s="$$$isSourceNode$$$";r.fromStringWithSourceMap=function(e,t,n){function i(e,t){if(null===e||void 0===e.source)s.add(t);else{var i=n?o.join(n,e.source):e.source;s.add(new r(e.originalLine,e.originalColumn,i,t,e.name))}}var s=new r,u=e.split(a),l=0,c=function(){function e(){return l<u.length?u[l++]:void 0}return e()+(e()||"")},p=1,f=0,h=null;return t.eachMapping(function(e){if(null!==h){if(!(p<e.generatedLine)){var t=u[l]||"",n=t.substr(0,e.generatedColumn-f);return u[l]=t.substr(e.generatedColumn-f),f=e.generatedColumn,i(h,n),void(h=e)}i(h,c()),p++,f=0}for(;p<e.generatedLine;)s.add(c()),p++;if(f<e.generatedColumn){var t=u[l]||"";s.add(t.substr(0,e.generatedColumn)),u[l]=t.substr(e.generatedColumn),f=e.generatedColumn}h=e},this),l<u.length&&(h&&i(h,c()),s.add(u.splice(l).join(""))),t.sources.forEach(function(e){var r=t.sourceContentFor(e);null!=r&&(null!=n&&(e=o.join(n,e)),s.setSourceContent(e,r))}),s},r.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},r.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},r.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n<r;n++)t=this.children[n],t[s]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},r.prototype.join=function(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;n<r-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},r.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[s]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},r.prototype.setSourceContent=function(e,t){this.sourceContents[o.toSetString(e)]=t},r.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][s]&&this.children[t].walkSourceContents(e);for(var r=Object.keys(this.sourceContents),t=0,n=r.length;t<n;t++)e(o.fromSetString(r[t]),this.sourceContents[r[t]])},r.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e},r.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new i(e),r=!1,o=null,a=null,s=null,u=null;return this.walk(function(e,i){t.code+=e,null!==i.source&&null!==i.line&&null!==i.column?(o===i.source&&a===i.line&&s===i.column&&u===i.name||n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name}),o=i.source,a=i.line,s=i.column,u=i.name,r=!0):r&&(n.addMapping({generated:{line:t.line,column:t.column}}),o=null,r=!1);for(var l=0,c=e.length;l<c;l++)10===e.charCodeAt(l)?(t.line++,t.column=0,l+1===c?(o=null,r=!1):r&&n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name})):t.column++}),this.walkSourceContents(function(e,t){n.setSourceContent(e,t)}),{code:t.code,map:n}},t.SourceNode=r},function(e,t,n){"use strict";function r(e,t,n,r,i){}e.exports=r},function(e,t,n){"use strict";var r=n(32),i=n(8),o=n(444);e.exports=function(){function e(e,t,n,r,a,s){s!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";var r=n(32),i=n(8),o=n(10),a=n(13),s=n(444),u=n(995);e.exports=function(e,t){function n(e){var t=e&&(C&&e[C]||e[A]);if("function"==typeof t)return t}function l(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function p(e){function n(n,r,o,a,u,l,p){if(a=a||D,l=l||o,p!==s)if(t)i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[o]?n?new c(null===r[o]?"The "+u+" `"+l+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+u+" `"+l+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,o,a,u,l)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function f(e){function t(t,n,r,i,o,a){var s=t[n];if(w(s)!==e)return new c("Invalid "+i+" `"+o+"` of type `"+k(s)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return p(t)}function h(e){function t(t,n,r,i,o){if("function"!=typeof e)return new c("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){return new c("Invalid "+i+" `"+o+"` of type `"+w(a)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<a.length;u++){var l=e(a,u,r,i,o+"["+u+"]",s);if(l instanceof Error)return l}return null}return p(t)}function d(e){function t(t,n,r,i,o){if(!(t[n]instanceof e)){var a=e.name||D;return new c("Invalid "+i+" `"+o+"` of type `"+S(t[n])+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null}return p(t)}function m(e){function t(t,n,r,i,o){for(var a=t[n],s=0;s<e.length;s++)if(l(a,e[s]))return null;return new c("Invalid "+i+" `"+o+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?p(t):r.thatReturnsNull}function v(e){function t(t,n,r,i,o){if("function"!=typeof e)return new c("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],u=w(a);if("object"!==u)return new c("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var l in a)if(a.hasOwnProperty(l)){var p=e(a,l,r,i,o+"."+l,s);if(p instanceof Error)return p}return null}return p(t)}function g(e){function t(t,n,r,i,o){for(var a=0;a<e.length;a++){if(null==(0,e[a])(t,n,r,i,o,s))return null}return new c("Invalid "+i+" `"+o+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return r.thatReturnsNull;for(var n=0;n<e.length;n++){var i=e[n];if("function"!=typeof i)return o(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",E(i),n),r.thatReturnsNull}return p(t)}function y(e){function t(t,n,r,i,o){var a=t[n],u=w(a);if("object"!==u)return new c("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var l in e){var p=e[l];if(p){var f=p(a,l,r,i,o+"."+l,s);if(f)return f}}return null}return p(t)}function _(e){function t(t,n,r,i,o){var u=t[n],l=w(u);if("object"!==l)return new c("Invalid "+i+" `"+o+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");var p=a({},t[n],e);for(var f in p){var h=e[f];if(!h)return new c("Invalid "+i+" `"+o+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var d=h(u,f,r,i,o+"."+f,s);if(d)return d}return null}return p(t)}function b(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(b);if(null===t||e(t))return!0;var r=n(t);if(!r)return!1;var i,o=r.call(t);if(r!==t.entries){for(;!(i=o.next()).done;)if(!b(i.value))return!1}else for(;!(i=o.next()).done;){var a=i.value;if(a&&!b(a[1]))return!1}return!0;default:return!1}}function x(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function w(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":x(t,e)?"symbol":t}function k(e){if(void 0===e||null===e)return""+e;var t=w(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function E(e){var t=k(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function S(e){return e.constructor&&e.constructor.name?e.constructor.name:D}var C="function"==typeof Symbol&&Symbol.iterator,A="@@iterator",D="<<anonymous>>",O={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:function(){return p(r.thatReturnsNull)}(),arrayOf:h,element:function(){function t(t,n,r,i,o){var a=t[n];if(!e(a)){return new c("Invalid "+i+" `"+o+"` of type `"+w(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return p(t)}(),instanceOf:d,node:function(){function e(e,t,n,r,i){return b(e[t])?null:new c("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}return p(e)}(),objectOf:v,oneOf:m,oneOfType:g,shape:y,exact:_};return c.prototype=Error.prototype,O.checkPropTypes=u,O.PropTypes=O,O}},function(e,t,n){(function(e,r){var i;!function(o){function a(e){throw RangeError(P[e])}function s(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function u(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(T,"."),r+s(e.split("."),t).join(".")}function l(e){for(var t,n,r=[],i=0,o=e.length;i<o;)t=e.charCodeAt(i++),t>=55296&&t<=56319&&i<o?(n=e.charCodeAt(i++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--)):r.push(t);return r}function c(e){return s(e,function(e){var t="";return e>65535&&(e-=65536,t+=j(e>>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function p(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:x}function f(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function h(e,t,n){var r=0;for(e=n?R(e/S):e>>1,e+=R(e/t);e>I*k>>1;r+=x)e=R(e/I);return R(r+(I+1)*e/(e+E))}function d(e){var t,n,r,i,o,s,u,l,f,d,m=[],v=e.length,g=0,y=A,_=C;for(n=e.lastIndexOf(D),n<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&a("not-basic"),m.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<v;){for(o=g,s=1,u=x;i>=v&&a("invalid-input"),l=p(e.charCodeAt(i++)),(l>=x||l>R((b-g)/s))&&a("overflow"),g+=l*s,f=u<=_?w:u>=_+k?k:u-_,!(l<f);u+=x)d=x-f,s>R(b/d)&&a("overflow"),s*=d;t=m.length+1,_=h(g-o,t,0==o),R(g/t)>b-y&&a("overflow"),y+=R(g/t),g%=t,m.splice(g++,0,y)}return c(m)}function m(e){var t,n,r,i,o,s,u,c,p,d,m,v,g,y,_,E=[];for(e=l(e),v=e.length,t=A,n=0,o=C,s=0;s<v;++s)(m=e[s])<128&&E.push(j(m));for(r=i=E.length,i&&E.push(D);r<v;){for(u=b,s=0;s<v;++s)(m=e[s])>=t&&m<u&&(u=m);for(g=r+1,u-t>R((b-n)/g)&&a("overflow"),n+=(u-t)*g,t=u,s=0;s<v;++s)if(m=e[s],m<t&&++n>b&&a("overflow"),m==t){for(c=n,p=x;d=p<=o?w:p>=o+k?k:p-o,!(c<d);p+=x)_=c-d,y=x-d,E.push(j(f(d+_%y,0))),c=R(_/y);E.push(j(f(c,0))),o=h(n,g,r==i),n=0,++r}++n,++t}return E.join("")}function v(e){return u(e,function(e){return O.test(e)?d(e.slice(4).toLowerCase()):e})}function g(e){return u(e,function(e){return M.test(e)?"xn--"+m(e):e})}var y=("object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType,"object"==typeof r&&r);var _,b=2147483647,x=36,w=1,k=26,E=38,S=700,C=72,A=128,D="-",O=/^xn--/,M=/[^\x20-\x7E]/,T=/[\x2E\u3002\uFF0E\uFF61]/g,P={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=x-w,R=Math.floor,j=String.fromCharCode;_={version:"1.3.2",ucs2:{decode:l,encode:c},decode:d,encode:m,toASCII:g,toUnicode:v},void 0!==(i=function(){return _}.call(t,n,t,e))&&(e.exports=i)}()}).call(t,n(72)(e),n(17))},function(e,t,n){"use strict";var r=n(1001),i=n(1e3),o=n(445);e.exports={formats:o,parse:i,stringify:r}},function(e,t,n){"use strict";var r=n(446),i=Object.prototype.hasOwnProperty,o={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:r.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t){for(var n={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,s=r.split(t.delimiter,a),u=0;u<s.length;++u){var l,c,p=s[u],f=p.indexOf("]="),h=-1===f?p.indexOf("="):f+1;-1===h?(l=t.decoder(p,o.decoder),c=t.strictNullHandling?null:""):(l=t.decoder(p.slice(0,h),o.decoder),c=t.decoder(p.slice(h+1),o.decoder)),i.call(n,l)?n[l]=[].concat(n[l]).concat(c):n[l]=c}return n},s=function(e,t,n){for(var r=t,i=e.length-1;i>=0;--i){var o,a=e[i];if("[]"===a)o=[],o=o.concat(r);else{o=n.plainObjects?Object.create(null):{};var s="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(s,10);!isNaN(u)&&a!==s&&String(u)===s&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(o=[],o[u]=r):o[s]=r}r=o}return r},u=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,u=o.exec(r),l=u?r.slice(0,u.index):r,c=[];if(l){if(!n.plainObjects&&i.call(Object.prototype,l)&&!n.allowPrototypes)return;c.push(l)}for(var p=0;null!==(u=a.exec(r))&&p<n.depth;){if(p+=1,!n.plainObjects&&i.call(Object.prototype,u[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(u[1])}return u&&c.push("["+r.slice(u.index)+"]"),s(c,t,n)}};e.exports=function(e,t){var n=t?r.assign({},t):{};if(null!==n.decoder&&void 0!==n.decoder&&"function"!=typeof n.decoder)throw new TypeError("Decoder has to be a function.");if(n.ignoreQueryPrefix=!0===n.ignoreQueryPrefix,n.delimiter="string"==typeof n.delimiter||r.isRegExp(n.delimiter)?n.delimiter:o.delimiter,n.depth="number"==typeof n.depth?n.depth:o.depth,n.arrayLimit="number"==typeof n.arrayLimit?n.arrayLimit:o.arrayLimit,n.parseArrays=!1!==n.parseArrays,n.decoder="function"==typeof n.decoder?n.decoder:o.decoder,n.allowDots="boolean"==typeof n.allowDots?n.allowDots:o.allowDots,n.plainObjects="boolean"==typeof n.plainObjects?n.plainObjects:o.plainObjects,n.allowPrototypes="boolean"==typeof n.allowPrototypes?n.allowPrototypes:o.allowPrototypes,n.parameterLimit="number"==typeof n.parameterLimit?n.parameterLimit:o.parameterLimit,n.strictNullHandling="boolean"==typeof n.strictNullHandling?n.strictNullHandling:o.strictNullHandling,""===e||null===e||void 0===e)return n.plainObjects?Object.create(null):{};for(var i="string"==typeof e?a(e,n):e,s=n.plainObjects?Object.create(null):{},l=Object.keys(i),c=0;c<l.length;++c){var p=l[c],f=u(p,i[p],n);s=r.merge(s,f,n)}return r.compact(s)}},function(e,t,n){"use strict";var r=n(446),i=n(445),o={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},u=function e(t,n,i,o,a,u,l,c,p,f,h,d){var m=t;if("function"==typeof l)m=l(n,m);else if(m instanceof Date)m=f(m);else if(null===m){if(o)return u&&!d?u(n,s.encoder):n;m=""}if("string"==typeof m||"number"==typeof m||"boolean"==typeof m||r.isBuffer(m)){if(u){return[h(d?n:u(n,s.encoder))+"="+h(u(m,s.encoder))]}return[h(n)+"="+h(String(m))]}var v=[];if(void 0===m)return v;var g;if(Array.isArray(l))g=l;else{var y=Object.keys(m);g=c?y.sort(c):y}for(var _=0;_<g.length;++_){var b=g[_];a&&null===m[b]||(v=Array.isArray(m)?v.concat(e(m[b],i(n,b),i,o,a,u,l,c,p,f,h,d)):v.concat(e(m[b],n+(p?"."+b:"["+b+"]"),i,o,a,u,l,c,p,f,h,d)))}return v};e.exports=function(e,t){var n=e,a=t?r.assign({},t):{};if(null!==a.encoder&&void 0!==a.encoder&&"function"!=typeof a.encoder)throw new TypeError("Encoder has to be a function.");var l=void 0===a.delimiter?s.delimiter:a.delimiter,c="boolean"==typeof a.strictNullHandling?a.strictNullHandling:s.strictNullHandling,p="boolean"==typeof a.skipNulls?a.skipNulls:s.skipNulls,f="boolean"==typeof a.encode?a.encode:s.encode,h="function"==typeof a.encoder?a.encoder:s.encoder,d="function"==typeof a.sort?a.sort:null,m=void 0!==a.allowDots&&a.allowDots,v="function"==typeof a.serializeDate?a.serializeDate:s.serializeDate,g="boolean"==typeof a.encodeValuesOnly?a.encodeValuesOnly:s.encodeValuesOnly;if(void 0===a.format)a.format=i.default;else if(!Object.prototype.hasOwnProperty.call(i.formatters,a.format))throw new TypeError("Unknown format option provided.");var y,_,b=i.formatters[a.format];"function"==typeof a.filter?(_=a.filter,n=_("",n)):Array.isArray(a.filter)&&(_=a.filter,y=_);var x=[];if("object"!=typeof n||null===n)return"";var w;w=a.arrayFormat in o?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var k=o[w];y||(y=Object.keys(n)),d&&y.sort(d);for(var E=0;E<y.length;++E){var S=y[E];p&&null===n[S]||(x=x.concat(u(n[S],S,k,c,p,f?h:null,_,d,m,v,b,g)))}var C=x.join(l),A=!0===a.addQueryPrefix?"?":"";return C.length>0?A+C:""}},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c<l;++c){var p,f,h,d,m=e[c].replace(s,"%20"),v=m.indexOf(n);v>=0?(p=m.substr(0,v),f=m.substr(v+1)):(p=m,f=""),h=decodeURIComponent(p),d=decodeURIComponent(f),r(a,h)?i(a[h])?a[h].push(d):a[h]=[a[h],d]:a[h]=d}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";function r(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?r(a(e),function(a){var s=encodeURIComponent(i(a))+n;return o(e[a])?r(e[a],function(e){return s+encodeURIComponent(i(e))}).join(t):s+encodeURIComponent(i(e[a]))}).join(t):s?encodeURIComponent(i(s))+n+encodeURIComponent(i(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){"use strict";t.decode=t.parse=n(1002),t.encode=t.stringify=n(1003)},function(e,t,n){"use strict";function r(e){return decodeURIComponent(e.replace(/\+/g," "))}function i(e){for(var t,n=/([^=?&]+)=?([^&]*)/g,i={};t=n.exec(e);i[r(t[1])]=r(t[2]));return i}function o(e,t){t=t||"";var n=[];"string"!=typeof t&&(t="?");for(var r in e)a.call(e,r)&&n.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return n.length?t+n.join("&"):""}var a=Object.prototype.hasOwnProperty;t.stringify=o,t.parse=i},function(e,t,n){(function(t){(function(){var n,r,i,o,a,s;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:void 0!==t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},o=n(),s=1e9*t.uptime(),a=o-s):Date.now?(e.exports=function(){return Date.now()-i},i=Date.now()):(e.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(t,n(33))},function(e,t){e.exports='---\nurl: "http://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://online.swagger.io/validator"\noauth2RedirectUrl: "http://localhost:3200/oauth2-redirect.html"\n'},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.UnmountClosed=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),p=r(c),f=n(1),h=r(f),d=n(447);(t.UnmountClosed=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.componentWillReceiveProps=function(e){var t=e.isOpened;!n.props.isOpened&&t&&n.setState({forceInitialAnimation:!0,shouldUnmount:!1})},n.onRest=function(){var e=n.props,t=e.isOpened,r=e.onRest;t||n.setState({shouldUnmount:!0}),r&&r.apply(void 0,arguments)},n.state={shouldUnmount:!n.props.isOpened,forceInitialAnimation:!n.props.isOpened},n}return s(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.isOpened,n=(e.onRest,i(e,["isOpened","onRest"])),r=this.state,o=r.forceInitialAnimation;return r.shouldUnmount?null:p.default.createElement(d.Collapse,u({forceInitialAnimation:o,isOpened:t,onRest:this.onRest},n))}}]),t}(p.default.PureComponent)).propTypes={isOpened:h.default.bool.isRequired,onRest:h.default.func}},function(e,t,n){"use strict";var r={Properties:{"aria-current":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},DOMAttributeNames:{},DOMPropertyNames:{}};e.exports=r},function(e,t,n){"use strict";var r=n(14),i=n(378),o={focusDOMComponent:function(){i(r.getNodeFromInstance(this))}};e.exports=o},function(e,t,n){"use strict";function r(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function i(e){switch(e){case"topCompositionStart":return S.compositionStart;case"topCompositionEnd":return S.compositionEnd;case"topCompositionUpdate":return S.compositionUpdate}}function o(e,t){return"topKeyDown"===e&&t.keyCode===y}function a(e,t){switch(e){case"topKeyUp":return-1!==g.indexOf(t.keyCode);case"topKeyDown":return t.keyCode!==y;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function s(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function u(e,t,n,r){var u,l;if(_?u=i(e):A?a(e,n)&&(u=S.compositionEnd):o(e,n)&&(u=S.compositionStart),!u)return null;w&&(A||u!==S.compositionStart?u===S.compositionEnd&&A&&(l=A.getData()):A=d.getPooled(r));var c=m.getPooled(u,t,n,r);if(l)c.data=l;else{var p=s(n);null!==p&&(c.data=p)}return f.accumulateTwoPhaseDispatches(c),c}function l(e,t){switch(e){case"topCompositionEnd":return s(t);case"topKeyPress":return t.which!==k?null:(C=!0,E);case"topTextInput":var n=t.data;return n===E&&C?null:n;default:return null}}function c(e,t){if(A){if("topCompositionEnd"===e||!_&&a(e,t)){var n=A.getData();return d.release(A),A=null,n}return null}switch(e){case"topPaste":return null;case"topKeyPress":return t.which&&!r(t)?String.fromCharCode(t.which):null;case"topCompositionEnd":return w?null:t.data;default:return null}}function p(e,t,n,r){var i;if(!(i=x?l(e,n):c(e,n)))return null;var o=v.getPooled(S.beforeInput,t,n,r);return o.data=i,f.accumulateTwoPhaseDispatches(o),o}var f=n(123),h=n(25),d=n(1017),m=n(1054),v=n(1057),g=[9,13,27,32],y=229,_=h.canUseDOM&&"CompositionEvent"in window,b=null;h.canUseDOM&&"documentMode"in document&&(b=document.documentMode);var x=h.canUseDOM&&"TextEvent"in window&&!b&&!function(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}(),w=h.canUseDOM&&(!_||b&&b>8&&b<=11),k=32,E=String.fromCharCode(k),S={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},C=!1,A=null,D={eventTypes:S,extractEvents:function(e,t,n,r){return[u(e,t,n,r),p(e,t,n,r)]}};e.exports=D},function(e,t,n){"use strict";var r=n(450),i=n(25),o=(n(39),n(747),n(1063)),a=n(754),s=n(757),u=(n(10),s(function(e){return a(e)})),l=!1,c="cssFloat";if(i.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(e){l=!0}void 0===document.documentElement.style.cssFloat&&(c="styleFloat")}var f={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var i=0===r.indexOf("--"),a=e[r];null!=a&&(n+=u(r)+":",n+=o(r,a,t,i)+";")}return n||null},setValueForStyles:function(e,t,n){var i=e.style;for(var a in t)if(t.hasOwnProperty(a)){var s=0===a.indexOf("--"),u=o(a,t[a],n,s);if("float"!==a&&"cssFloat"!==a||(a=c),s)i.setProperty(a,u);else if(u)i[a]=u;else{var p=l&&r.shorthandPropertyExpansions[a];if(p)for(var f in p)i[f]="";else i[a]=""}}}};e.exports=f},function(e,t,n){"use strict";function r(e,t,n){var r=C.getPooled(T.change,e,t,n);return r.type="change",w.accumulateTwoPhaseDispatches(r),r}function i(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function o(e){var t=r(I,e,D(e));S.batchedUpdates(a,t)}function a(e){x.enqueueEvents(e),x.processEventQueue(!1)}function s(e,t){P=e,I=t,P.attachEvent("onchange",o)}function u(){P&&(P.detachEvent("onchange",o),P=null,I=null)}function l(e,t){var n=A.updateValueIfChanged(e),r=!0===t.simulated&&F._allowSimulatedPassThrough;if(n||r)return e}function c(e,t){if("topChange"===e)return t}function p(e,t,n){"topFocus"===e?(u(),s(t,n)):"topBlur"===e&&u()}function f(e,t){P=e,I=t,P.attachEvent("onpropertychange",d)}function h(){P&&(P.detachEvent("onpropertychange",d),P=null,I=null)}function d(e){"value"===e.propertyName&&l(I,e)&&o(e)}function m(e,t,n){"topFocus"===e?(h(),f(t,n)):"topBlur"===e&&h()}function v(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return l(I,n)}function g(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function y(e,t,n){if("topClick"===e)return l(t,n)}function _(e,t,n){if("topInput"===e||"topChange"===e)return l(t,n)}function b(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}var x=n(122),w=n(123),k=n(25),E=n(14),S=n(44),C=n(51),A=n(466),D=n(252),O=n(253),M=n(468),T={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}},P=null,I=null,R=!1;k.canUseDOM&&(R=O("change")&&(!document.documentMode||document.documentMode>8));var j=!1;k.canUseDOM&&(j=O("input")&&(!document.documentMode||document.documentMode>9));var F={eventTypes:T,_allowSimulatedPassThrough:!0,_isInputEventSupported:j,extractEvents:function(e,t,n,o){var a,s,u=t?E.getNodeFromInstance(t):window;if(i(u)?R?a=c:s=p:M(u)?j?a=_:(a=v,s=m):g(u)&&(a=y),a){var l=a(e,t,n);if(l){return r(l,n,o)}}s&&s(e,u,t),"topBlur"===e&&b(t,u)}};e.exports=F},function(e,t,n){"use strict";var r=n(11),i=n(88),o=n(25),a=n(750),s=n(32),u=(n(8),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(o.canUseDOM||r("56"),t||r("57"),"HTML"===e.nodeName&&r("58"),"string"==typeof t){var n=a(t,s)[0];e.parentNode.replaceChild(n,e)}else i.replaceChildWithTree(e,t)}});e.exports=u},function(e,t,n){"use strict";var r=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"];e.exports=r},function(e,t,n){"use strict";var r=n(123),i=n(14),o=n(160),a={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},s={eventTypes:a,extractEvents:function(e,t,n,s){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var u;if(s.window===s)u=s;else{var l=s.ownerDocument;u=l?l.defaultView||l.parentWindow:window}var c,p;if("topMouseOut"===e){c=t;var f=n.relatedTarget||n.toElement;p=f?i.getClosestInstanceFromNode(f):null}else c=null,p=t;if(c===p)return null;var h=null==c?u:i.getNodeFromInstance(c),d=null==p?u:i.getNodeFromInstance(p),m=o.getPooled(a.mouseLeave,c,n,s);m.type="mouseleave",m.target=h,m.relatedTarget=d;var v=o.getPooled(a.mouseEnter,p,n,s);return v.type="mouseenter",v.target=d,v.relatedTarget=h,r.accumulateEnterLeaveDispatches(m,v,c,p),[m,v]}};e.exports=s},function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var i=n(13),o=n(70),a=n(465);i(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[a()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,i=this.getText(),o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=i.slice(e,s),this._fallbackText}}),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r=n(89),i=r.injection.MUST_USE_PROPERTY,o=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,u=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,l={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:o,allowTransparency:0,alt:0,as:0,async:o,autoComplete:0,autoPlay:o,capture:o,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:i|o,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:o,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:o,defer:o,dir:0,disabled:o,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:o,formTarget:0,frameBorder:0,headers:0,height:0,hidden:o,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:o,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:i|o,muted:i|o,name:0,nonce:0,noValidate:o,open:o,optimum:0,pattern:0,placeholder:0,playsInline:o,poster:0,preload:0,profile:0,radioGroup:0,readOnly:o,referrerPolicy:0,rel:0,required:o,reversed:o,role:0,rows:s,rowSpan:a,sandbox:0,scope:0,scoped:o,scrolling:0,seamless:o,selected:i|o,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:a,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:o,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}};e.exports=l},function(e,t,n){"use strict";(function(t){function r(e,t,n,r){var i=void 0===e[n];null!=t&&i&&(e[n]=o(t,!0))}var i=n(90),o=n(467),a=(n(244),n(254)),s=n(470);n(10);void 0!==t&&n.i({NODE_ENV:"production",WEBPACK_INLINE_STYLES:!1});var u={instantiateChildren:function(e,t,n,i){if(null==e)return null;var o={};return s(e,r,o),o},updateChildren:function(e,t,n,r,s,u,l,c,p){if(t||e){var f,h;for(f in t)if(t.hasOwnProperty(f)){h=e&&e[f];var d=h&&h._currentElement,m=t[f];if(null!=h&&a(d,m))i.receiveComponent(h,m,s,c),t[f]=h;else{h&&(r[f]=i.getHostNode(h),i.unmountComponent(h,!1));var v=o(m,!0);t[f]=v;var g=i.mountComponent(v,s,u,l,c,p);n.push(g)}}for(f in e)!e.hasOwnProperty(f)||t&&t.hasOwnProperty(f)||(h=e[f],r[f]=i.getHostNode(h),i.unmountComponent(h,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];i.unmountComponent(r,t)}}};e.exports=u}).call(t,n(33))},function(e,t,n){"use strict";var r=n(240),i=n(1027),o={processChildrenUpdates:i.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};e.exports=o},function(e,t,n){"use strict";function r(e){}function i(e){return!(!e.prototype||!e.prototype.isReactComponent)}function o(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}var a=n(11),s=n(13),u=n(92),l=n(246),c=n(52),p=n(247),f=n(124),h=(n(39),n(460)),d=n(90),m=n(144),v=(n(8),n(208)),g=n(254),y=(n(10),{ImpureClass:0,PureClass:1,StatelessFunctional:2});r.prototype.render=function(){var e=f.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return t};var _=1,b={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,s){this._context=s,this._mountOrder=_++,this._hostParent=t,this._hostContainerInfo=n;var l,c=this._currentElement.props,p=this._processContext(s),h=this._currentElement.type,d=e.getUpdateQueue(),v=i(h),g=this._constructComponent(v,c,p,d);v||null!=g&&null!=g.render?o(h)?this._compositeType=y.PureClass:this._compositeType=y.ImpureClass:(l=g,null===g||!1===g||u.isValidElement(g)||a("105",h.displayName||h.name||"Component"),g=new r(h),this._compositeType=y.StatelessFunctional);g.props=c,g.context=p,g.refs=m,g.updater=d,this._instance=g,f.set(g,this);var b=g.state;void 0===b&&(g.state=b=null),("object"!=typeof b||Array.isArray(b))&&a("106",this.getName()||"ReactCompositeComponent"),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var x;return x=g.unstable_handleError?this.performInitialMountWithErrorHandling(l,t,n,e,s):this.performInitialMount(l,t,n,e,s),g.componentDidMount&&e.getReactMountReady().enqueue(g.componentDidMount,g),x},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var i=this._currentElement.type;return e?new i(t,n,r):i(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,i){var o,a=r.checkpoint();try{o=this.performInitialMount(e,t,n,r,i)}catch(s){r.rollback(a),this._instance.unstable_handleError(s),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),a=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(a),o=this.performInitialMount(e,t,n,r,i)}return o},performInitialMount:function(e,t,n,r,i){var o=this._instance,a=0;o.componentWillMount&&(o.componentWillMount(),this._pendingStateQueue&&(o.state=this._processPendingState(o.props,o.context))),void 0===e&&(e=this._renderValidatedComponent());var s=h.getType(e);this._renderedNodeType=s;var u=this._instantiateReactComponent(e,s!==h.EMPTY);this._renderedComponent=u;var l=d.mountComponent(u,r,t,n,this._processChildContext(i),a);return l},getHostNode:function(){return d.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";p.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(d.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,f.remove(t)}},_maskContext:function(e){var t=this._currentElement.type,n=t.contextTypes;if(!n)return m;var r={};for(var i in n)r[i]=e[i];return r},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t,n=this._currentElement.type,r=this._instance;if(r.getChildContext&&(t=r.getChildContext()),t){"object"!=typeof n.childContextTypes&&a("107",this.getName()||"ReactCompositeComponent");for(var i in t)i in n.childContextTypes||a("108",this.getName()||"ReactCompositeComponent",i);return s({},e,t)}return e},_checkContextTypes:function(e,t,n){},receiveComponent:function(e,t,n){var r=this._currentElement,i=this._context;this._pendingElement=null,this.updateComponent(t,r,e,i,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?d.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,r,i){var o=this._instance;null==o&&a("136",this.getName()||"ReactCompositeComponent");var s,u=!1;this._context===i?s=o.context:(s=this._processContext(i),u=!0);var l=t.props,c=n.props;t!==n&&(u=!0),u&&o.componentWillReceiveProps&&o.componentWillReceiveProps(c,s);var p=this._processPendingState(c,s),f=!0;this._pendingForceUpdate||(o.shouldComponentUpdate?f=o.shouldComponentUpdate(c,p,s):this._compositeType===y.PureClass&&(f=!v(l,c)||!v(o.state,p))),this._updateBatchNumber=null,f?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,c,p,s,e,i)):(this._currentElement=n,this._context=i,o.props=c,o.state=p,o.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,i=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(i&&1===r.length)return r[0];for(var o=s({},i?r[0]:n.state),a=i?1:0;a<r.length;a++){var u=r[a];s(o,"function"==typeof u?u.call(n,o,e,t):u)}return o},_performComponentUpdate:function(e,t,n,r,i,o){var a,s,u,l=this._instance,c=Boolean(l.componentDidUpdate);c&&(a=l.props,s=l.state,u=l.context),l.componentWillUpdate&&l.componentWillUpdate(t,n,r),this._currentElement=e,this._context=o,l.props=t,l.state=n,l.context=r,this._updateRenderedComponent(i,o),c&&i.getReactMountReady().enqueue(l.componentDidUpdate.bind(l,a,s,u),l)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,i=this._renderValidatedComponent(),o=0;if(g(r,i))d.receiveComponent(n,i,e,this._processChildContext(t));else{var a=d.getHostNode(n);d.unmountComponent(n,!1);var s=h.getType(i);this._renderedNodeType=s;var u=this._instantiateReactComponent(i,s!==h.EMPTY);this._renderedComponent=u;var l=d.mountComponent(u,e,this._hostParent,this._hostContainerInfo,this._processChildContext(t),o);this._replaceNodeWithMarkup(a,l,n)}},_replaceNodeWithMarkup:function(e,t,n){l.replaceNodeWithMarkup(e,t,n)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e=this._instance;return e.render()},_renderValidatedComponent:function(){var e;if(this._compositeType!==y.StatelessFunctional){c.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{c.current=null}}else e=this._renderValidatedComponentWithoutOwnerOrContext();return null===e||!1===e||u.isValidElement(e)||a("109",this.getName()||"ReactCompositeComponent"),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n&&a("110");var r=t.getPublicInstance();(n.refs===m?n.refs={}:n.refs)[e]=r},detachRef:function(e){delete this.getPublicInstance().refs[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return this._compositeType===y.StatelessFunctional?null:e},_instantiateReactComponent:null};e.exports=b},function(e,t,n){"use strict";var r=n(14),i=n(1035),o=n(459),a=n(90),s=n(44),u=n(1048),l=n(1064),c=n(464),p=n(1071);n(10);i.inject();var f={findDOMNode:l,render:o.render,unmountComponentAtNode:o.unmountComponentAtNode,version:u,unstable_batchedUpdates:s.batchedUpdates,unstable_renderSubtreeIntoContainer:p};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:r.getClosestInstanceFromNode,getNodeFromInstance:function(e){return e._renderedComponent&&(e=c(e)),e?r.getNodeFromInstance(e):null}},Mount:o,Reconciler:a});e.exports=f},function(e,t,n){"use strict";function r(e){if(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" This DOM node was rendered by `"+n+"`."}}return""}function i(e,t){t&&(X[e._tag]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&v("137",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&v("60"),"object"==typeof t.dangerouslySetInnerHTML&&W in t.dangerouslySetInnerHTML||v("61")),null!=t.style&&"object"!=typeof t.style&&v("62",r(e)))}function o(e,t,n,r){if(!(r instanceof R)){var i=e._hostContainerInfo,o=i._node&&i._node.nodeType===H,s=o?i._node:i._ownerDocument;q(t,s),r.getReactMountReady().enqueue(a,{inst:e,registrationName:t,listener:n})}}function a(){var e=this;E.putListener(e.inst,e.registrationName,e.listener)}function s(){var e=this;O.postMountWrapper(e)}function u(){var e=this;P.postMountWrapper(e)}function l(){var e=this;M.postMountWrapper(e)}function c(){F.track(this)}function p(){var e=this;e._rootNodeID||v("63");var t=L(e);switch(t||v("64"),e._tag){case"iframe":case"object":e._wrapperState.listeners=[C.trapBubbledEvent("topLoad","load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var n in G)G.hasOwnProperty(n)&&e._wrapperState.listeners.push(C.trapBubbledEvent(n,G[n],t));break;case"source":e._wrapperState.listeners=[C.trapBubbledEvent("topError","error",t)];break;case"img":e._wrapperState.listeners=[C.trapBubbledEvent("topError","error",t),C.trapBubbledEvent("topLoad","load",t)];break;case"form":e._wrapperState.listeners=[C.trapBubbledEvent("topReset","reset",t),C.trapBubbledEvent("topSubmit","submit",t)];break;case"input":case"select":case"textarea":e._wrapperState.listeners=[C.trapBubbledEvent("topInvalid","invalid",t)]}}function f(){T.postUpdateWrapper(this)}function h(e){Z.call($,e)||(Y.test(e)||v("65",e),$[e]=!0)}function d(e,t){return e.indexOf("-")>=0||null!=t.is}function m(e){var t=e.type;h(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}var v=n(11),g=n(13),y=n(1010),_=n(1012),b=n(88),x=n(241),w=n(89),k=n(452),E=n(122),S=n(242),C=n(159),A=n(453),D=n(14),O=n(1028),M=n(1029),T=n(454),P=n(1032),I=(n(39),n(1041)),R=n(1046),j=(n(32),n(162)),F=(n(8),n(253),n(208),n(466)),N=(n(255),n(10),A),B=E.deleteListener,L=D.getNodeFromInstance,q=C.listenTo,z=S.registrationNameModules,U={string:!0,number:!0},W="__html",V={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},H=11,G={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},J={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},K={listing:!0,pre:!0,textarea:!0},X=g({menuitem:!0},J),Y=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,$={},Z={}.hasOwnProperty,Q=1;m.displayName="ReactDOMComponent",m.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=Q++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var o=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(p,this);break;case"input":O.mountWrapper(this,o,t),o=O.getHostProps(this,o),e.getReactMountReady().enqueue(c,this),e.getReactMountReady().enqueue(p,this);break;case"option":M.mountWrapper(this,o,t),o=M.getHostProps(this,o);break;case"select":T.mountWrapper(this,o,t),o=T.getHostProps(this,o),e.getReactMountReady().enqueue(p,this);break;case"textarea":P.mountWrapper(this,o,t),o=P.getHostProps(this,o),e.getReactMountReady().enqueue(c,this),e.getReactMountReady().enqueue(p,this)}i(this,o);var a,f;null!=t?(a=t._namespaceURI,f=t._tag):n._tag&&(a=n._namespaceURI,f=n._tag),(null==a||a===x.svg&&"foreignobject"===f)&&(a=x.html),a===x.html&&("svg"===this._tag?a=x.svg:"math"===this._tag&&(a=x.mathml)),this._namespaceURI=a;var h;if(e.useCreateElement){var d,m=n._ownerDocument;if(a===x.html)if("script"===this._tag){var v=m.createElement("div"),g=this._currentElement.type;v.innerHTML="<"+g+"></"+g+">",d=v.removeChild(v.firstChild)}else d=o.is?m.createElement(this._currentElement.type,o.is):m.createElement(this._currentElement.type);else d=m.createElementNS(a,this._currentElement.type);D.precacheNode(this,d),this._flags|=N.hasCachedChildNodes,this._hostParent||k.setAttributeForRoot(d),this._updateDOMProperties(null,o,e);var _=b(d);this._createInitialChildren(e,o,r,_),h=_}else{var w=this._createOpenTagMarkupAndPutListeners(e,o),E=this._createContentMarkup(e,o,r);h=!E&&J[this._tag]?w+"/>":w+">"+E+"</"+this._currentElement.type+">"}switch(this._tag){case"input":e.getReactMountReady().enqueue(s,this),o.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(u,this),o.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"select":case"button":o.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(l,this)}return h},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(z.hasOwnProperty(r))i&&o(this,r,i,e);else{"style"===r&&(i&&(i=this._previousStyleCopy=g({},t.style)),i=_.createMarkupForStyles(i,this));var a=null;null!=this._tag&&d(this._tag,t)?V.hasOwnProperty(r)||(a=k.createMarkupForCustomAttribute(r,i)):a=k.createMarkupForProperty(r,i),a&&(n+=" "+a)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+k.createMarkupForRoot()),n+=" "+k.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&(r=i.__html);else{var o=U[typeof t.children]?t.children:null,a=null!=o?null:t.children;if(null!=o)r=j(o);else if(null!=a){var s=this.mountChildren(a,e,n);r=s.join("")}}return K[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&b.queueHTML(r,i.__html);else{var o=U[typeof t.children]?t.children:null,a=null!=o?null:t.children;if(null!=o)""!==o&&b.queueText(r,o);else if(null!=a)for(var s=this.mountChildren(a,e,n),u=0;u<s.length;u++)b.queueChild(r,s[u])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var o=t.props,a=this._currentElement.props;switch(this._tag){case"input":o=O.getHostProps(this,o),a=O.getHostProps(this,a);break;case"option":o=M.getHostProps(this,o),a=M.getHostProps(this,a);break;case"select":o=T.getHostProps(this,o),a=T.getHostProps(this,a);break;case"textarea":o=P.getHostProps(this,o),a=P.getHostProps(this,a)}switch(i(this,a),this._updateDOMProperties(o,a,e),this._updateDOMChildren(o,a,e,r),this._tag){case"input":O.updateWrapper(this),F.updateValueIfChanged(this);break;case"textarea":P.updateWrapper(this);break;case"select":e.getReactMountReady().enqueue(f,this)}},_updateDOMProperties:function(e,t,n){var r,i,a;for(r in e)if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&null!=e[r])if("style"===r){var s=this._previousStyleCopy;for(i in s)s.hasOwnProperty(i)&&(a=a||{},a[i]="");this._previousStyleCopy=null}else z.hasOwnProperty(r)?e[r]&&B(this,r):d(this._tag,e)?V.hasOwnProperty(r)||k.deleteValueForAttribute(L(this),r):(w.properties[r]||w.isCustomAttribute(r))&&k.deleteValueForProperty(L(this),r);for(r in t){var u=t[r],l="style"===r?this._previousStyleCopy:null!=e?e[r]:void 0;if(t.hasOwnProperty(r)&&u!==l&&(null!=u||null!=l))if("style"===r)if(u?u=this._previousStyleCopy=g({},u):this._previousStyleCopy=null,l){for(i in l)!l.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(a=a||{},a[i]="");for(i in u)u.hasOwnProperty(i)&&l[i]!==u[i]&&(a=a||{},a[i]=u[i])}else a=u;else if(z.hasOwnProperty(r))u?o(this,r,u,n):l&&B(this,r);else if(d(this._tag,t))V.hasOwnProperty(r)||k.setValueForAttribute(L(this),r,u);else if(w.properties[r]||w.isCustomAttribute(r)){var c=L(this);null!=u?k.setValueForProperty(c,r,u):k.deleteValueForProperty(c,r)}}a&&_.setValueForStyles(L(this),a,this)},_updateDOMChildren:function(e,t,n,r){var i=U[typeof e.children]?e.children:null,o=U[typeof t.children]?t.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,u=null!=i?null:e.children,l=null!=o?null:t.children,c=null!=i||null!=a,p=null!=o||null!=s;null!=u&&null==l?this.updateChildren(null,n,r):c&&!p&&this.updateTextContent(""),null!=o?i!==o&&this.updateTextContent(""+o):null!=s?a!==s&&this.updateMarkup(""+s):null!=l&&this.updateChildren(l,n,r)},getHostNode:function(){return L(this)},unmountComponent:function(e){switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":var t=this._wrapperState.listeners;if(t)for(var n=0;n<t.length;n++)t[n].remove();break;case"input":case"textarea":F.stopTracking(this);break;case"html":case"head":case"body":v("66",this._tag)}this.unmountChildren(e),D.uncacheNode(this),E.deleteAllListeners(this),this._rootNodeID=0,this._domID=0,this._wrapperState=null},getPublicInstance:function(){return L(this)}},g(m.prototype,m.Mixin,I.Mixin),e.exports=m},function(e,t,n){"use strict";function r(e,t){var n={_topLevelWrapper:e,_idCounter:1,_ownerDocument:t?t.nodeType===i?t:t.ownerDocument:null,_node:t,_tag:t?t.nodeName.toLowerCase():null,_namespaceURI:t?t.namespaceURI:null};return n}var i=(n(255),9);e.exports=r},function(e,t,n){"use strict";var r=n(13),i=n(88),o=n(14),a=function(e){this._currentElement=null,this._hostNode=null,this._hostParent=null,this._hostContainerInfo=null,this._domID=0};r(a.prototype,{mountComponent:function(e,t,n,r){var a=n._idCounter++;this._domID=a,this._hostParent=t,this._hostContainerInfo=n;var s=" react-empty: "+this._domID+" ";if(e.useCreateElement){var u=n._ownerDocument,l=u.createComment(s);return o.precacheNode(this,l),i(l)}return e.renderToStaticMarkup?"":"\x3c!--"+s+"--\x3e"},receiveComponent:function(){},getHostNode:function(){return o.getNodeFromInstance(this)},unmountComponent:function(){o.uncacheNode(this)}}),e.exports=a},function(e,t,n){"use strict";var r={useCreateElement:!0,useFiber:!1};e.exports=r},function(e,t,n){"use strict";var r=n(240),i=n(14),o={dangerouslyProcessChildrenUpdates:function(e,t){var n=i.getNodeFromInstance(e);r.processUpdates(n,t)}};e.exports=o},function(e,t,n){"use strict";function r(){this._rootNodeID&&f.updateWrapper(this)}function i(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}function o(e){var t=this._currentElement.props,n=l.executeOnChange(t,e);p.asap(r,this);var i=t.name;if("radio"===t.type&&null!=i){for(var o=c.getNodeFromInstance(this),s=o;s.parentNode;)s=s.parentNode;for(var u=s.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),f=0;f<u.length;f++){var h=u[f];if(h!==o&&h.form===o.form){var d=c.getInstanceFromNode(h);d||a("90"),p.asap(r,d)}}}return n}var a=n(11),s=n(13),u=n(452),l=n(245),c=n(14),p=n(44),f=(n(8),n(10),{getHostProps:function(e,t){var n=l.getValue(t),r=l.getChecked(t);return s({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,listeners:null,onChange:o.bind(e),controlled:i(t)}},updateWrapper:function(e){var t=e._currentElement.props,n=t.checked;null!=n&&u.setValueForProperty(c.getNodeFromInstance(e),"checked",n||!1);var r=c.getNodeFromInstance(e),i=l.getValue(t);if(null!=i)if(0===i&&""===r.value)r.value="0";else if("number"===t.type){var o=parseFloat(r.value,10)||0;(i!=o||i==o&&r.value!=i)&&(r.value=""+i)}else r.value!==""+i&&(r.value=""+i);else null==t.value&&null!=t.defaultValue&&r.defaultValue!==""+t.defaultValue&&(r.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(r.defaultChecked=!!t.defaultChecked)},postMountWrapper:function(e){var t=e._currentElement.props,n=c.getNodeFromInstance(e);switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":n.value="",n.value=n.defaultValue;break;default:n.value=n.value}var r=n.name;""!==r&&(n.name=""),n.defaultChecked=!n.defaultChecked,n.defaultChecked=!n.defaultChecked,""!==r&&(n.name=r)}});e.exports=f},function(e,t,n){"use strict";function r(e){var t="";return o.Children.forEach(e,function(e){null!=e&&("string"==typeof e||"number"==typeof e?t+=e:u||(u=!0))}),t}var i=n(13),o=n(92),a=n(14),s=n(454),u=(n(10),!1),l={mountWrapper:function(e,t,n){var i=null;if(null!=n){var o=n;"optgroup"===o._tag&&(o=o._hostParent),null!=o&&"select"===o._tag&&(i=s.getSelectValueContext(o))}var a=null;if(null!=i){var u;if(u=null!=t.value?t.value+"":r(t.children),a=!1,Array.isArray(i)){for(var l=0;l<i.length;l++)if(""+i[l]===u){a=!0;break}}else a=""+i===u}e._wrapperState={selected:a}},postMountWrapper:function(e){var t=e._currentElement.props;if(null!=t.value){a.getNodeFromInstance(e).setAttribute("value",t.value)}},getHostProps:function(e,t){var n=i({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(n.selected=e._wrapperState.selected);var o=r(t.children);return o&&(n.children=o),n}};e.exports=l},function(e,t,n){"use strict";function r(e,t,n,r){return e===n&&t===r}function i(e){var t=document.selection,n=t.createRange(),r=n.text.length,i=n.duplicate();i.moveToElementText(e),i.setEndPoint("EndToStart",n);var o=i.text.length;return{start:o,end:o+r}}function o(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,i=t.anchorOffset,o=t.focusNode,a=t.focusOffset,s=t.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(e){return null}var u=r(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),l=u?0:s.toString().length,c=s.cloneRange();c.selectNodeContents(e),c.setEnd(s.startContainer,s.startOffset);var p=r(c.startContainer,c.startOffset,c.endContainer,c.endOffset),f=p?0:c.toString().length,h=f+l,d=document.createRange();d.setStart(n,i),d.setEnd(o,a);var m=d.collapsed;return{start:m?h:f,end:m?f:h}}function a(e,t){var n,r,i=document.selection.createRange().duplicate();void 0===t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),i.moveToElementText(e),i.moveStart("character",n),i.setEndPoint("EndToStart",i),i.moveEnd("character",r-n),i.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,i=Math.min(t.start,r),o=void 0===t.end?i:Math.min(t.end,r);if(!n.extend&&i>o){var a=o;o=i,i=a}var s=l(e,i),u=l(e,o);if(s&&u){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),i>o?(n.addRange(p),n.extend(u.node,u.offset)):(p.setEnd(u.node,u.offset),n.addRange(p))}}}var u=n(25),l=n(1068),c=n(465),p=u.canUseDOM&&"selection"in document&&!("getSelection"in window),f={getOffsets:p?i:o,setOffsets:p?a:s};e.exports=f},function(e,t,n){"use strict";var r=n(11),i=n(13),o=n(240),a=n(88),s=n(14),u=n(162),l=(n(8),n(255),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});i(l.prototype,{mountComponent:function(e,t,n,r){var i=n._idCounter++,o=" react-text: "+i+" ";if(this._domID=i,this._hostParent=t,e.useCreateElement){var l=n._ownerDocument,c=l.createComment(o),p=l.createComment(" /react-text "),f=a(l.createDocumentFragment());return a.queueChild(f,a(c)),this._stringText&&a.queueChild(f,a(l.createTextNode(this._stringText))),a.queueChild(f,a(p)),s.precacheNode(this,c),this._closingComment=p,f}var h=u(this._stringText);return e.renderToStaticMarkup?h:"\x3c!--"+o+"--\x3e"+h+"\x3c!-- /react-text --\x3e"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();o.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=s.getNodeFromInstance(this),n=t.nextSibling;;){if(null==n&&r("67",this._domID),8===n.nodeType&&" /react-text "===n.nodeValue){this._closingComment=n;break}n=n.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),e.exports=l},function(e,t,n){"use strict";function r(){this._rootNodeID&&c.updateWrapper(this)}function i(e){var t=this._currentElement.props,n=s.executeOnChange(t,e);return l.asap(r,this),n}var o=n(11),a=n(13),s=n(245),u=n(14),l=n(44),c=(n(8),n(10),{getHostProps:function(e,t){return null!=t.dangerouslySetInnerHTML&&o("91"),a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=s.getValue(t),r=n;if(null==n){var a=t.defaultValue,u=t.children;null!=u&&(null!=a&&o("92"),Array.isArray(u)&&(u.length<=1||o("93"),u=u[0]),a=""+u),null==a&&(a=""),r=a}e._wrapperState={initialValue:""+r,listeners:null,onChange:i.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=u.getNodeFromInstance(e),r=s.getValue(t);if(null!=r){var i=""+r;i!==n.value&&(n.value=i),null==t.defaultValue&&(n.defaultValue=i)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=u.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}});e.exports=c},function(e,t,n){"use strict";function r(e,t){"_hostNode"in e||u("33"),"_hostNode"in t||u("33");for(var n=0,r=e;r;r=r._hostParent)n++;for(var i=0,o=t;o;o=o._hostParent)i++;for(;n-i>0;)e=e._hostParent,n--;for(;i-n>0;)t=t._hostParent,i--;for(var a=n;a--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}function i(e,t){"_hostNode"in e||u("35"),"_hostNode"in t||u("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1}function o(e){return"_hostNode"in e||u("36"),e._hostParent}function a(e,t,n){for(var r=[];e;)r.push(e),e=e._hostParent;var i;for(i=r.length;i-- >0;)t(r[i],"captured",n);for(i=0;i<r.length;i++)t(r[i],"bubbled",n)}function s(e,t,n,i,o){for(var a=e&&t?r(e,t):null,s=[];e&&e!==a;)s.push(e),e=e._hostParent;for(var u=[];t&&t!==a;)u.push(t),t=t._hostParent;var l;for(l=0;l<s.length;l++)n(s[l],"bubbled",i);for(l=u.length;l-- >0;)n(u[l],"captured",o)}var u=n(11);n(8);e.exports={isAncestor:i,getLowestCommonAncestor:r,getParentInstance:o,traverseTwoPhase:a,traverseEnterLeave:s}},function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var i=n(13),o=n(44),a=n(161),s=n(32),u={initialize:s,close:function(){f.isBatchingUpdates=!1}},l={initialize:s,close:o.flushBatchedUpdates.bind(o)},c=[l,u];i(r.prototype,a,{getTransactionWrappers:function(){return c}});var p=new r,f={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,i,o){var a=f.isBatchingUpdates;return f.isBatchingUpdates=!0,a?e(t,n,r,i,o):p.perform(e,null,t,n,r,i,o)}};e.exports=f},function(e,t,n){"use strict";function r(){k||(k=!0,y.EventEmitter.injectReactEventListener(g),y.EventPluginHub.injectEventPluginOrder(s),y.EventPluginUtils.injectComponentTree(f),y.EventPluginUtils.injectTreeTraversal(d),y.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:u,ChangeEventPlugin:a,SelectEventPlugin:x,BeforeInputEventPlugin:o}),y.HostComponent.injectGenericComponentClass(p),y.HostComponent.injectTextComponentClass(m),y.DOMProperty.injectDOMPropertyConfig(i),y.DOMProperty.injectDOMPropertyConfig(l),y.DOMProperty.injectDOMPropertyConfig(b),y.EmptyComponent.injectEmptyComponentFactory(function(e){return new h(e)}),y.Updates.injectReconcileTransaction(_),y.Updates.injectBatchingStrategy(v),y.Component.injectEnvironment(c))}var i=n(1009),o=n(1011),a=n(1013),s=n(1015),u=n(1016),l=n(1018),c=n(1020),p=n(1023),f=n(14),h=n(1025),d=n(1033),m=n(1031),v=n(1034),g=n(1038),y=n(1039),_=n(1044),b=n(1049),x=n(1050),w=n(1051),k=!1;e.exports={inject:r}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";function r(e){i.enqueueEvents(e),i.processEventQueue(!1)}var i=n(122),o={handleTopLevel:function(e,t,n,o){r(i.extractEvents(e,t,n,o))}};e.exports=o},function(e,t,n){"use strict";function r(e){for(;e._hostParent;)e=e._hostParent;var t=p.getNodeFromInstance(e),n=t.parentNode;return p.getClosestInstanceFromNode(n)}function i(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function o(e){var t=h(e.nativeEvent),n=p.getClosestInstanceFromNode(t),i=n;do{e.ancestors.push(i),i=i&&r(i)}while(i);for(var o=0;o<e.ancestors.length;o++)n=e.ancestors[o],m._handleTopLevel(e.topLevelType,n,e.nativeEvent,h(e.nativeEvent))}function a(e){e(d(window))}var s=n(13),u=n(377),l=n(25),c=n(70),p=n(14),f=n(44),h=n(252),d=n(752);s(i.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),c.addPoolingTo(i,c.twoArgumentPooler);var m={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:l.canUseDOM?window:null,setHandleTopLevel:function(e){m._handleTopLevel=e},setEnabled:function(e){m._enabled=!!e},isEnabled:function(){return m._enabled},trapBubbledEvent:function(e,t,n){return n?u.listen(n,t,m.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){return n?u.capture(n,t,m.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=a.bind(null,e);u.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(m._enabled){var n=i.getPooled(e,t);try{f.batchedUpdates(o,n)}finally{i.release(n)}}}};e.exports=m},function(e,t,n){"use strict";var r=n(89),i=n(122),o=n(243),a=n(246),s=n(455),u=n(159),l=n(457),c=n(44),p={Component:a.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:i.injection,EventPluginUtils:o.injection,EventEmitter:u.injection,HostComponent:l.injection,Updates:c.injection};e.exports=p},function(e,t,n){"use strict";var r=n(1062),i=/\/?>/,o=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return o.test(e)?e:e.replace(i," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(e)===n}};e.exports=a},function(e,t,n){"use strict";function r(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}function i(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:f.getHostNode(e),toIndex:n,afterNode:t}}function o(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}function a(e){return{type:"SET_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(e){return{type:"TEXT_CONTENT",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function u(e,t){return t&&(e=e||[],e.push(t)),e}function l(e,t){p.processChildrenUpdates(e,t)}var c=n(11),p=n(246),f=(n(124),n(39),n(52),n(90)),h=n(1019),d=(n(32),n(1065)),m=(n(8),{Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return h.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,i,o){var a,s=0;return a=d(t,s),h.updateChildren(e,a,n,r,i,this,this._hostContainerInfo,o,s),a},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var i=[],o=0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],u=0,l=f.mountComponent(s,t,this,this._hostContainerInfo,n,u);s._mountIndex=o++,i.push(l)}return i},updateTextContent:function(e){var t=this._renderedChildren;h.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&c("118");l(this,[s(e)])},updateMarkup:function(e){var t=this._renderedChildren;h.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&c("118");l(this,[a(e)])},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,i={},o=[],a=this._reconcilerUpdateChildren(r,e,o,i,t,n);if(a||r){var s,c=null,p=0,h=0,d=0,m=null;for(s in a)if(a.hasOwnProperty(s)){var v=r&&r[s],g=a[s];v===g?(c=u(c,this.moveChild(v,m,p,h)),h=Math.max(v._mountIndex,h),v._mountIndex=p):(v&&(h=Math.max(v._mountIndex,h)),c=u(c,this._mountChildAtIndex(g,o[d],m,p,t,n)),d++),p++,m=f.getHostNode(g)}for(s in i)i.hasOwnProperty(s)&&(c=u(c,this._unmountChild(r[s],i[s])));c&&l(this,c),this._renderedChildren=a}},unmountChildren:function(e){var t=this._renderedChildren;h.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex<r)return i(e,t,n)},createChild:function(e,t,n){return r(n,t,e._mountIndex)},removeChild:function(e,t){return o(e,t)},_mountChildAtIndex:function(e,t,n,r,i,o){return e._mountIndex=r,this.createChild(e,n,t)},_unmountChild:function(e,t){var n=this.removeChild(e,t);return e._mountIndex=null,n}}});e.exports=m},function(e,t,n){"use strict";function r(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)}var i=n(11),o=(n(8),{addComponentAsRefTo:function(e,t,n){r(n)||i("119"),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){r(n)||i("120");var o=n.getPublicInstance();o&&o.refs[t]===e.getPublicInstance()&&n.detachRef(t)}});e.exports=o},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=o.getPooled(null),this.useCreateElement=e}var i=n(13),o=n(451),a=n(70),s=n(159),u=n(458),l=(n(39),n(161)),c=n(248),p={initialize:u.getSelectionInformation,close:u.restoreSelection},f={initialize:function(){var e=s.isEnabled();return s.setEnabled(!1),e},close:function(e){s.setEnabled(e)}},h={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},d=[p,f,h],m={getTransactionWrappers:function(){return d},getReactMountReady:function(){return this.reactMountReady},getUpdateQueue:function(){return c},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null}};i(r.prototype,l,m),a.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){"function"==typeof e?e(t.getPublicInstance()):o.addComponentAsRefTo(t,e,n)}function i(e,t,n){"function"==typeof e?e(null):o.removeComponentAsRefFrom(t,e,n)}var o=n(1042),a={};a.attachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&r(n,e,t._owner)}},a.shouldUpdateRefs=function(e,t){var n=null,r=null;null!==e&&"object"==typeof e&&(n=e.ref,r=e._owner);var i=null,o=null;return null!==t&&"object"==typeof t&&(i=t.ref,o=t._owner),n!==i||"string"==typeof i&&o!==r},a.detachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&i(n,e,t._owner)}},e.exports=a},function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1,this.updateQueue=new s(this)}var i=n(13),o=n(70),a=n(161),s=(n(39),n(1047)),u=[],l={enqueue:function(){}},c={getTransactionWrappers:function(){return u},getReactMountReady:function(){return l},getUpdateQueue:function(){return this.updateQueue},destructor:function(){},checkpoint:function(){},rollback:function(){}};i(r.prototype,a,c),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(248),o=(n(10),function(){function e(t){r(this,e),this.transaction=t}return e.prototype.isMounted=function(e){return!1},e.prototype.enqueueCallback=function(e,t,n){this.transaction.isInTransaction()&&i.enqueueCallback(e,t,n)},e.prototype.enqueueForceUpdate=function(e){this.transaction.isInTransaction()&&i.enqueueForceUpdate(e)},e.prototype.enqueueReplaceState=function(e,t){this.transaction.isInTransaction()&&i.enqueueReplaceState(e,t)},e.prototype.enqueueSetState=function(e,t){this.transaction.isInTransaction()&&i.enqueueSetState(e,t)},e}());e.exports=o},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},i={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},o={Properties:{},DOMAttributeNamespaces:{xlinkActuate:r.xlink,xlinkArcrole:r.xlink,xlinkHref:r.xlink,xlinkRole:r.xlink,xlinkShow:r.xlink,xlinkTitle:r.xlink,xlinkType:r.xlink,xmlBase:r.xml,xmlLang:r.xml,xmlSpace:r.xml},DOMAttributeNames:{}};Object.keys(i).forEach(function(e){o.Properties[e]=0,i[e]&&(o.DOMAttributeNames[e]=i[e])}),e.exports=o},function(e,t,n){"use strict";function r(e){if("selectionStart"in e&&u.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function i(e,t){if(y||null==m||m!==c())return null;var n=r(m);if(!g||!f(g,n)){g=n;var i=l.getPooled(d.select,v,e,t);return i.type="select",i.target=m,o.accumulateTwoPhaseDispatches(i),i}return null}var o=n(123),a=n(25),s=n(14),u=n(458),l=n(51),c=n(379),p=n(468),f=n(208),h=a.canUseDOM&&"documentMode"in document&&document.documentMode<=11,d={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},m=null,v=null,g=null,y=!1,_=!1,b={eventTypes:d,extractEvents:function(e,t,n,r){if(!_)return null;var o=t?s.getNodeFromInstance(t):window;switch(e){case"topFocus":(p(o)||"true"===o.contentEditable)&&(m=o,v=t,g=null);break;case"topBlur":m=null,v=null,g=null;break;case"topMouseDown":y=!0;break;case"topContextMenu":case"topMouseUp":return y=!1,i(n,r);case"topSelectionChange":if(h)break;case"topKeyDown":case"topKeyUp":return i(n,r)}return null},didPutListener:function(e,t,n){"onSelect"===t&&(_=!0)}};e.exports=b},function(e,t,n){"use strict";function r(e){return"."+e._rootNodeID}function i(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}var o=n(11),a=n(377),s=n(123),u=n(14),l=n(1052),c=n(1053),p=n(51),f=n(1056),h=n(1058),d=n(160),m=n(1055),v=n(1059),g=n(1060),y=n(125),_=n(1061),b=n(32),x=n(250),w=(n(8),{}),k={};["abort","animationEnd","animationIteration","animationStart","blur","canPlay","canPlayThrough","click","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t,r="top"+t,i={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[r]};w[e]=i,k[r]=i});var E={},S={eventTypes:w,extractEvents:function(e,t,n,r){var i=k[e];if(!i)return null;var a;switch(e){case"topAbort":case"topCanPlay":case"topCanPlayThrough":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topVolumeChange":case"topWaiting":a=p;break;case"topKeyPress":if(0===x(n))return null;case"topKeyDown":case"topKeyUp":a=h;break;case"topBlur":case"topFocus":a=f;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":a=d;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":a=m;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":a=v;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":a=l;break;case"topTransitionEnd":a=g;break;case"topScroll":a=y;break;case"topWheel":a=_;break;case"topCopy":case"topCut":case"topPaste":a=c}a||o("86",e);var u=a.getPooled(i,t,n,r);return s.accumulateTwoPhaseDispatches(u),u},didPutListener:function(e,t,n){if("onClick"===t&&!i(e._tag)){var o=r(e),s=u.getNodeFromInstance(e);E[o]||(E[o]=a.listen(s,"click",b))}},willDeleteListener:function(e,t){if("onClick"===t&&!i(e._tag)){var n=r(e);E[n].remove(),delete E[n]}}};e.exports=S},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={animationName:null,elapsedTime:null,pseudoElement:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={data:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(160),o={dataTransfer:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(125),o={relatedTarget:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={data:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(125),o=n(250),a=n(1066),s=n(251),u={key:a,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:s,charCode:function(e){return"keypress"===e.type?o(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?o(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};i.augmentClass(r,u),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(125),o=n(251),a={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:o};i.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={propertyName:null,elapsedTime:null,pseudoElement:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(160),o={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e){for(var t=1,n=0,r=0,o=e.length,a=-4&o;r<a;){for(var s=Math.min(r+4096,a);r<s;r+=4)n+=(t+=e.charCodeAt(r))+(t+=e.charCodeAt(r+1))+(t+=e.charCodeAt(r+2))+(t+=e.charCodeAt(r+3));t%=i,n%=i}for(;r<o;r++)n+=t+=e.charCodeAt(r);return t%=i,n%=i,t|n<<16}var i=65521;e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){if(null==t||"boolean"==typeof t||""===t)return"";var i=isNaN(t);if(r||i||0===t||o.hasOwnProperty(e)&&o[e])return""+t;if("string"==typeof t){t=t.trim()}return t+"px"}var i=n(450),o=(n(10),i.isUnitlessNumber);e.exports=r},function(e,t,n){"use strict";function r(e){if(null==e)return null;if(1===e.nodeType)return e;var t=a.get(e);if(t)return t=s(t),t?o.getNodeFromInstance(t):null;"function"==typeof e.render?i("44"):i("45",Object.keys(e))}var i=n(11),o=(n(52),n(14)),a=n(124),s=n(464);n(8),n(10);e.exports=r},function(e,t,n){"use strict";(function(t){function r(e,t,n,r){if(e&&"object"==typeof e){var i=e,o=void 0===i[n];o&&null!=t&&(i[n]=t)}}function i(e,t){if(null==e)return e;var n={};return o(e,r,n),n}var o=(n(244),n(470));n(10);void 0!==t&&n.i({NODE_ENV:"production",WEBPACK_INLINE_STYLES:!1}),e.exports=i}).call(t,n(33))},function(e,t,n){"use strict";function r(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=i(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var i=n(250),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=r},function(e,t,n){"use strict";function r(e){var t=e&&(i&&e[i]||e[o]);if("function"==typeof t)return t}var i="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=r},function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function i(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function o(e,t){for(var n=r(e),o=0,a=0;n;){if(3===n.nodeType){if(a=o+n.textContent.length,o<=t&&a>=t)return{node:n,offset:t-o};o=a}n=r(i(n))}}e.exports=o},function(e,t,n){"use strict";function r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function i(e){if(s[e])return s[e];if(!a[e])return e;var t=a[e];for(var n in t)if(t.hasOwnProperty(n)&&n in u)return s[e]=t[n];return""}var o=n(25),a={animationend:r("Animation","AnimationEnd"),animationiteration:r("Animation","AnimationIteration"),animationstart:r("Animation","AnimationStart"),transitionend:r("Transition","TransitionEnd")},s={},u={};o.canUseDOM&&(u=document.createElement("div").style,"AnimationEvent"in window||(delete a.animationend.animation,delete a.animationiteration.animation,delete a.animationstart.animation),"TransitionEvent"in window||delete a.transitionend.transition),e.exports=i},function(e,t,n){"use strict";function r(e){return'"'+i(e)+'"'}var i=n(162);e.exports=r},function(e,t,n){"use strict";var r=n(459);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){!function(e,r){r(t,n(0),n(7))}(0,function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t=t&&"default"in t?t.default:t;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,[{key:"shouldComponentUpdate",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.state||{};return!(this.updateOnProps||Object.keys(a({},e,this.props))).every(function(r){return n.is(e[r],t.props[r])})||!(this.updateOnStates||Object.keys(a({},r,i))).every(function(e){return n.is(r[e],i[e])})}}]),t}(t.Component);e.ImmutablePureComponent=u,e.default=u,Object.defineProperty(e,"__esModule",{value:!0})})},function(e,t,n){"use strict";function r(e){return{doc:new B,blocks:M,blockStarts:T,tip:this.doc,oldtip:this.doc,currentLine:"",lineNumber:0,offset:0,column:0,nextNonspace:0,nextNonspaceColumn:0,indent:0,indented:!1,blank:!1,allClosed:!0,lastMatchedContainer:this.doc,refmap:{},lastLineLength:0,inlineParser:new u(e),findNextNonspace:R,advanceOffset:P,advanceNextNonspace:I,breakOutOfLists:E,addLine:S,addChild:C,incorporateLine:j,finalize:F,processInlines:N,closeUnmatchedBlocks:O,parse:L,options:e||{}}}var i=n(256),o=n(91).unescapeString,a=n(91).OPENTAG,s=n(91).CLOSETAG,u=n(1077),l=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^<!--/,/^<[?]/,/^<![A-Z]/,/^<!\[CDATA\[/,/^<[\/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[\/]?[>]|$)/i,new RegExp("^(?:"+a+"|"+s+")s*$","i")],c=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],p=/^(?:(?:\* *){3,}|(?:_ *){3,}|(?:- *){3,}) *$/,f=/^[#`~*+_=<>0-9-]/,h=/[^ \t\f\v\r\n]/,d=/^[*+-]/,m=/^(\d{1,9})([.)])/,v=/^#{1,6}(?: +|$)/,g=/^`{3,}(?!.*`)|^~{3,}(?!.*~)/,y=/^(?:`{3,}|~{3,})(?= *$)/,_=/^(?:=+|-+) *$/,b=/\r\n|\n|\r/,x=function(e){return!h.test(e)},w=function(e,t){return t<e.length?e.charCodeAt(t):-1},k=function(e){for(;e;){if(e._lastLineBlank)return!0;var t=e.type;if("List"!==t&&"Item"!==t)break;e=e._lastChild}return!1},E=function(e){var t=e,n=null;do{"List"===t.type&&(n=t),t=t._parent}while(t);if(n){for(;e!==n;)this.finalize(e,this.lineNumber),e=e._parent;this.finalize(n,this.lineNumber),this.tip=n._parent}},S=function(){this.tip._string_content+=this.currentLine.slice(this.offset)+"\n"},C=function(e,t){for(;!this.blocks[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=new i(e,[[this.lineNumber,n],[0,0]]);return r._string_content="",this.tip.appendChild(r),this.tip=r,r},A=function(e){var t,n,r,i,o=e.currentLine.slice(e.nextNonspace),a={type:null,tight:!0,bulletChar:null,start:null,delimiter:null,padding:null,markerOffset:e.indent};if(t=o.match(d))a.type="Bullet",a.bulletChar=t[0][0];else{if(!(t=o.match(m)))return null;a.type="Ordered",a.start=parseInt(t[1]),a.delimiter=t[2]}if(-1!==(n=w(e.currentLine,e.nextNonspace+t[0].length))&&9!==n&&32!==n)return null;e.advanceNextNonspace(),e.advanceOffset(t[0].length,!0),r=e.column,i=e.offset;do{e.advanceOffset(1,!0),n=w(e.currentLine,e.offset)}while(e.column-r<5&&(32===n||9===n));var s=-1===w(e.currentLine,e.offset),u=e.column-r;return u>=5||u<1||s?(a.padding=t[0].length+1,e.column=r,e.offset=i,32===w(e.currentLine,e.offset)&&e.advanceOffset(1,!0)):a.padding=t[0].length+u,a},D=function(e,t){return e.type===t.type&&e.delimiter===t.delimiter&&e.bulletChar===t.bulletChar},O=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var e=this.oldtip._parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=e}this.allClosed=!0}},M={Document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"Item"!==e},acceptsLines:!1},List:{continue:function(){return 0},finalize:function(e,t){for(var n=t._firstChild;n;){if(k(n)&&n._next){t._listData.tight=!1;break}for(var r=n._firstChild;r;){if(k(r)&&(n._next||r._next)){t._listData.tight=!1;break}r=r._next}n=n._next}},canContain:function(e){return"Item"===e},acceptsLines:!1},BlockQuote:{continue:function(e){var t=e.currentLine;return e.indented||62!==w(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),32===w(t,e.offset)&&e.offset++,0)},finalize:function(){},canContain:function(e){return"Item"!==e},acceptsLines:!1},Item:{continue:function(e,t){if(e.blank&&null!==t._firstChild)e.advanceNextNonspace();else{if(!(e.indent>=t._listData.markerOffset+t._listData.padding))return 1;e.advanceOffset(t._listData.markerOffset+t._listData.padding,!0)}return 0},finalize:function(){},canContain:function(e){return"Item"!==e},acceptsLines:!1},Heading:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},ThematicBreak:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},CodeBlock:{continue:function(e,t){var n=e.currentLine,r=e.indent;if(t._isFenced){var i=r<=3&&n.charAt(e.nextNonspace)===t._fenceChar&&n.slice(e.nextNonspace).match(y);if(i&&i[0].length>=t._fenceLength)return e.finalize(t,e.lineNumber),2;for(var o=t._fenceOffset;o>0&&32===w(n,e.offset);)e.advanceOffset(1,!1),o--}else if(r>=4)e.advanceOffset(4,!0);else{if(!e.blank)return 1;e.advanceNextNonspace()}return 0},finalize:function(e,t){if(t._isFenced){var n=t._string_content,r=n.indexOf("\n"),i=n.slice(0,r),a=n.slice(r+1);t.info=o(i.trim()),t._literal=a}else t._literal=t._string_content.replace(/(\n *)+$/,"\n");t._string_content=null},canContain:function(){return!1},acceptsLines:!0},HtmlBlock:{continue:function(e,t){return!e.blank||6!==t._htmlBlockType&&7!==t._htmlBlockType?0:1},finalize:function(e,t){t._literal=t._string_content.replace(/(\n *)+$/,""),t._string_content=null},canContain:function(){return!1},acceptsLines:!0},Paragraph:{continue:function(e){return e.blank?1:0},finalize:function(e,t){for(var n,r=!1;91===w(t._string_content,0)&&(n=e.inlineParser.parseReference(t._string_content,e.refmap));)t._string_content=t._string_content.slice(n),r=!0;r&&x(t._string_content)&&t.unlink()},canContain:function(){return!1},acceptsLines:!0}},T=[function(e){return e.indented||62!==w(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),32===w(e.currentLine,e.offset)&&e.advanceOffset(1,!1),e.closeUnmatchedBlocks(),e.addChild("BlockQuote",e.nextNonspace),1)},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(v))){e.advanceNextNonspace(),e.advanceOffset(t[0].length,!1),e.closeUnmatchedBlocks();var n=e.addChild("Heading",e.nextNonspace);return n.level=t[0].trim().length,n._string_content=e.currentLine.slice(e.offset).replace(/^ *#+ *$/,"").replace(/ +#+ *$/,""),e.advanceOffset(e.currentLine.length-e.offset),2}return 0},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(g))){var n=t[0].length;e.closeUnmatchedBlocks();var r=e.addChild("CodeBlock",e.nextNonspace);return r._isFenced=!0,r._fenceLength=n,r._fenceChar=t[0][0],r._fenceOffset=e.indent,e.advanceNextNonspace(),e.advanceOffset(n,!1),2}return 0},function(e,t){if(!e.indented&&60===w(e.currentLine,e.nextNonspace)){var n,r=e.currentLine.slice(e.nextNonspace);for(n=1;n<=7;n++)if(l[n].test(r)&&(n<7||"Paragraph"!==t.type)){e.closeUnmatchedBlocks();var i=e.addChild("HtmlBlock",e.offset);return i._htmlBlockType=n,2}}return 0},function(e,t){var n;if(!e.indented&&"Paragraph"===t.type&&(n=e.currentLine.slice(e.nextNonspace).match(_))){e.closeUnmatchedBlocks();var r=new i("Heading",t.sourcepos);return r.level="="===n[0][0]?1:2,r._string_content=t._string_content,t.insertAfter(r),t.unlink(),e.tip=r,e.advanceOffset(e.currentLine.length-e.offset,!1),2}return 0},function(e){return!e.indented&&p.test(e.currentLine.slice(e.nextNonspace))?(e.closeUnmatchedBlocks(),e.addChild("ThematicBreak",e.nextNonspace),e.advanceOffset(e.currentLine.length-e.offset,!1),2):0},function(e,t){var n;return e.indented&&"List"!==t.type||!(n=A(e))?0:(e.closeUnmatchedBlocks(),"List"===e.tip.type&&D(t._listData,n)||(t=e.addChild("List",e.nextNonspace),t._listData=n),t=e.addChild("Item",e.nextNonspace),t._listData=n,1)},function(e){return e.indented&&"Paragraph"!==e.tip.type&&!e.blank?(e.advanceOffset(4,!0),e.closeUnmatchedBlocks(),e.addChild("CodeBlock",e.offset),2):0}],P=function(e,t){for(var n,r,i=0,o=this.currentLine;e>0&&(r=o[this.offset]);)"\t"===r?(n=4-this.column%4,this.column+=n,this.offset+=1,e-=t?n:1):(i+=1,this.offset+=1,this.column+=1,e-=1)},I=function(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn},R=function(){for(var e,t=this.currentLine,n=this.offset,r=this.column;""!==(e=t.charAt(n));)if(" "===e)n++,r++;else{if("\t"!==e)break;n++,r+=4-r%4}this.blank="\n"===e||"\r"===e||""===e,this.nextNonspace=n,this.nextNonspaceColumn=r,this.indent=this.nextNonspaceColumn-this.column,this.indented=this.indent>=4},j=function(e){var t,n=!0,r=this.doc;this.oldtip=this.tip,this.offset=0,this.column=0,this.lineNumber+=1,-1!==e.indexOf("\0")&&(e=e.replace(/\0/g,"�")),this.currentLine=e;for(var i;(i=r._lastChild)&&i._open;){switch(r=i,this.findNextNonspace(),this.blocks[r.type].continue(this,r)){case 0:break;case 1:n=!1;break;case 2:return void(this.lastLineLength=e.length);default:throw"continue returned illegal value, must be 0, 1, or 2"}if(!n){r=r._parent;break}}this.allClosed=r===this.oldtip,this.lastMatchedContainer=r,this.blank&&r._lastLineBlank&&(this.breakOutOfLists(r),r=this.tip);for(var o="Paragraph"!==r.type&&M[r.type].acceptsLines,a=this.blockStarts,s=a.length;!o;){if(this.findNextNonspace(),!this.indented&&!f.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var u=0;u<s;){var l=a[u](this,r);if(1===l){r=this.tip;break}if(2===l){r=this.tip,o=!0;break}u++}if(u===s){this.advanceNextNonspace();break}}if(this.allClosed||this.blank||"Paragraph"!==this.tip.type){this.closeUnmatchedBlocks(),this.blank&&r.lastChild&&(r.lastChild._lastLineBlank=!0),t=r.type;for(var p=this.blank&&!("BlockQuote"===t||"CodeBlock"===t&&r._isFenced||"Item"===t&&!r._firstChild&&r.sourcepos[0][0]===this.lineNumber),h=r;h;)h._lastLineBlank=p,h=h._parent;this.blocks[t].acceptsLines?(this.addLine(),"HtmlBlock"===t&&r._htmlBlockType>=1&&r._htmlBlockType<=5&&c[r._htmlBlockType].test(this.currentLine.slice(this.offset))&&this.finalize(r,this.lineNumber)):this.offset<e.length&&!this.blank&&(r=this.addChild("Paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}else this.addLine();this.lastLineLength=e.length},F=function(e,t){var n=e._parent;e._open=!1,e.sourcepos[1]=[t,this.lastLineLength],this.blocks[e.type].finalize(this,e),this.tip=n},N=function(e){var t,n,r,i=e.walker();for(this.inlineParser.refmap=this.refmap,this.inlineParser.options=this.options;n=i.next();)t=n.node,r=t.type,n.entering||"Paragraph"!==r&&"Heading"!==r||this.inlineParser.parse(t)},B=function(){return new i("Document",[[1,1],[0,0]])},L=function(e){this.doc=new B,this.tip=this.doc,this.refmap={},this.lineNumber=0,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="",this.options.time&&console.time("preparing input");var t=e.split(b),n=t.length;10===e.charCodeAt(e.length-1)&&(n-=1),this.options.time&&console.timeEnd("preparing input"),this.options.time&&console.time("block parsing");for(var r=0;r<n;r++)this.incorporateLine(t[r]);for(;this.tip;)this.finalize(this.tip,n);return this.options.time&&console.timeEnd("block parsing"),this.options.time&&console.time("inline parsing"),this.processInlines(this.doc),this.options.time&&console.timeEnd("inline parsing"),this.doc};e.exports=r},function(e,t,n){"use strict";/*! http://mths.be/fromcodepoint v0.2.1 by @mathias */ -if(String.fromCodePoint)e.exports=function(e){try{return String.fromCodePoint(e)}catch(e){if(e instanceof RangeError)return String.fromCharCode(65533);throw e}};else{var r=String.fromCharCode,i=Math.floor,o=function(){var e,t,n=[],o=-1,a=arguments.length;if(!a)return"";for(var s="";++o<a;){var u=Number(arguments[o]);if(!isFinite(u)||u<0||u>1114111||i(u)!==u)return String.fromCharCode(65533);u<=65535?n.push(u):(u-=65536,e=55296+(u>>10),t=u%1024+56320,n.push(e,t)),(o+1===a||n.length>16384)&&(s+=r.apply(null,n),n.length=0)}return s};e.exports=o}},function(e,t,n){"use strict";function r(e){return{softbreak:"\n",escape:i,options:e||{},render:c}}var i=n(91).escapeXml,o=function(e,t,n){var r="<"+e;if(t&&t.length>0)for(var i,o=0;void 0!==(i=t[o]);)r+=" "+i[0]+'="'+i[1]+'"',o++;return n&&(r+=" /"),r+=">"},a=/\<[^>]*\>/,s=/^javascript:|vbscript:|file:|data:/i,u=/^data:image\/(?:png|gif|jpeg|webp)/i,l=function(e){return s.test(e)&&!u.test(e)},c=function(e){var t,n,r,i,s,u,c,p=e.walker(),f="",h="\n",d=0,m=function(e){f+=d>0?e.replace(a,""):e,h=e},v=this.escape,g=function(){"\n"!==h&&(f+="\n",h="\n")},y=this.options;for(y.time&&console.time("rendering");i=p.next();){if(u=i.entering,s=i.node,t=[],y.sourcepos){var _=s.sourcepos;_&&t.push(["data-sourcepos",String(_[0][0])+":"+String(_[0][1])+"-"+String(_[1][0])+":"+String(_[1][1])])}switch(s.type){case"Text":m(v(s.literal,!1));break;case"Softbreak":m(this.softbreak);break;case"Hardbreak":m(o("br",[],!0)),g();break;case"Emph":m(o(u?"em":"/em"));break;case"Strong":m(o(u?"strong":"/strong"));break;case"HtmlInline":m(y.safe?"\x3c!-- raw HTML omitted --\x3e":s.literal);break;case"CustomInline":u&&s.onEnter?m(s.onEnter):!u&&s.onExit&&m(s.onExit);break;case"Link":u?(y.safe&&l(s.destination)||t.push(["href",v(s.destination,!0)]),s.title&&t.push(["title",v(s.title,!0)]),m(o("a",t))):m(o("/a"));break;case"Image":u?(0===d&&m(y.safe&&l(s.destination)?'<img src="" alt="':'<img src="'+v(s.destination,!0)+'" alt="'),d+=1):0===(d-=1)&&(s.title&&m('" title="'+v(s.title,!0)),m('" />'));break;case"Code":m(o("code")+v(s.literal,!1)+o("/code"));break;case"Document":break;case"Paragraph":if(null!==(c=s.parent.parent)&&"List"===c.type&&c.listTight)break;u?(g(),m(o("p",t))):(m(o("/p")),g());break;case"BlockQuote":u?(g(),m(o("blockquote",t)),g()):(g(),m(o("/blockquote")),g());break;case"Item":u?m(o("li",t)):(m(o("/li")),g());break;case"List":if(r="Bullet"===s.listType?"ul":"ol",u){var b=s.listStart;null!==b&&1!==b&&t.push(["start",b.toString()]),g(),m(o(r,t)),g()}else g(),m(o("/"+r)),g();break;case"Heading":r="h"+s.level,u?(g(),m(o(r,t))):(m(o("/"+r)),g());break;case"CodeBlock":n=s.info?s.info.split(/\s+/):[],n.length>0&&n[0].length>0&&t.push(["class","language-"+v(n[0],!0)]),g(),m(o("pre")+o("code",t)),m(v(s.literal,!1)),m(o("/code")+o("/pre")),g();break;case"HtmlBlock":g(),m(y.safe?"\x3c!-- raw HTML omitted --\x3e":s.literal),g();break;case"CustomBlock":g(),u&&s.onEnter?m(s.onEnter):!u&&s.onExit&&m(s.onExit),g();break;case"ThematicBreak":g(),m(o("hr",t,!0)),g();break;default:throw"Unknown node type "+s.type}}return y.time&&console.timeEnd("rendering"),f};e.exports=r},function(e,t,n){"use strict";e.exports.version="0.24.0",e.exports.Node=n(256),e.exports.Parser=n(1073),e.exports.HtmlRenderer=n(1075),e.exports.XmlRenderer=n(1079)},function(e,t,n){"use strict";function r(e){return{subject:"",delimiters:null,pos:0,refmap:{},match:N,peek:B,spnl:L,parseBackticks:q,parseBackslash:z,parseAutolink:U,parseHtmlTag:W,scanDelims:V,handleDelim:H,parseLinkTitle:X,parseLinkDestination:Y,parseLinkLabel:$,parseOpenBracket:Z,parseCloseBracket:ee,parseBang:Q,parseEntity:te,parseString:ne,parseNewline:re,parseReference:ie,parseInline:oe,processEmphasis:K,removeDelimiter:G,options:e||{},parse:ae}}var i=n(256),o=n(91),a=n(1078),s=o.normalizeURI,u=o.unescapeString,l=n(1074),c=n(114).decodeHTML;n(494);var p=o.ESCAPABLE,f="\\\\"+p,h="\\(([^\\\\()\\x00-\\x20]|"+f+"|\\\\)*\\)",d=o.ENTITY,m=o.reHtmlTag,v=new RegExp(/^[\u2000-\u206F\u2E00-\u2E7F\\'!"#\$%&\(\)\*\+,\-\.\/:;<=>\?@\[\]\^_`\{\|\}~]/),g=new RegExp('^(?:"('+f+'|[^"\\x00])*"|\'('+f+"|[^'\\x00])*'|\\(("+f+"|[^)\\x00])*\\))"),y=new RegExp("^(?:[<](?:[^ <>\\t\\n\\\\\\x00]|"+f+"|\\\\)*[>])"),_=new RegExp("^(?:[^\\\\()\\x00-\\x20]+|"+f+"|\\\\|"+h+")*"),b=new RegExp("^"+p),x=new RegExp("^"+d,"i"),w=/`+/,k=/^`+/,E=/\.\.\./g,S=/--+/g,C=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,A=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,D=/^ *(?:\n *)?/,O=/^\s/,M=/\s+/g,T=/ *$/,P=/^ */,I=/^ *(?:\n|$)/,R=new RegExp("^\\[(?:[^\\\\\\[\\]]|"+f+"|\\\\){0,1000}\\]"),j=/^[^\n`\[\]\\!<&*_'"]+/m,F=function(e){var t=new i("Text");return t._literal=e,t},N=function(e){var t=e.exec(this.subject.slice(this.pos));return null===t?null:(this.pos+=t.index+t[0].length,t[0])},B=function(){return this.pos<this.subject.length?this.subject.charCodeAt(this.pos):-1},L=function(){return this.match(D),!0},q=function(e){var t=this.match(k);if(null===t)return!1;for(var n,r,o=this.pos;null!==(n=this.match(w));)if(n===t)return r=new i("Code"),r._literal=this.subject.slice(o,this.pos-t.length).trim().replace(M," "),e.appendChild(r),!0;return this.pos=o,e.appendChild(F(t)),!0},z=function(e){var t,n=this.subject;return this.pos+=1,10===this.peek()?(this.pos+=1,t=new i("Hardbreak"),e.appendChild(t)):b.test(n.charAt(this.pos))?(e.appendChild(F(n.charAt(this.pos))),this.pos+=1):e.appendChild(F("\\")),!0},U=function(e){var t,n,r;return(t=this.match(C))?(n=t.slice(1,t.length-1),r=new i("Link"),r._destination=s("mailto:"+n),r._title="",r.appendChild(F(n)),e.appendChild(r),!0):!!(t=this.match(A))&&(n=t.slice(1,t.length-1),r=new i("Link"),r._destination=s(n),r._title="",r.appendChild(F(n)),e.appendChild(r),!0)},W=function(e){var t=this.match(m);if(null===t)return!1;var n=new i("HtmlInline");return n._literal=t,e.appendChild(n),!0},V=function(e){var t,n,r,i,o,a,s,u,c,p,f,h=0,d=this.pos;if(39===e||34===e)h++,this.pos++;else for(;this.peek()===e;)h++,this.pos++;return 0===h?null:(t=0===d?"\n":this.subject.charAt(d-1),r=this.peek(),n=-1===r?"\n":l(r),u=O.test(n),c=v.test(n),p=O.test(t),f=v.test(t),i=!(u||c&&!p&&!f),o=!(p||f&&!u&&!c),95===e?(a=i&&(!o||f),s=o&&(!i||c)):39===e||34===e?(a=i&&!o,s=o):(a=i,s=o),this.pos=d,{numdelims:h,can_open:a,can_close:s})},H=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var r,i=n.numdelims,o=this.pos;this.pos+=i,r=39===e?"’":34===e?"“":this.subject.slice(o,this.pos);var a=F(r);return t.appendChild(a),this.delimiters={cc:e,numdelims:i,node:a,previous:this.delimiters,next:null,can_open:n.can_open,can_close:n.can_close,active:!0},null!==this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters),!0},G=function(e){null!==e.previous&&(e.previous.next=e.next),null===e.next?this.delimiters=e.previous:e.next.previous=e.previous},J=function(e,t){e.next!==t&&(e.next=t,t.previous=e)},K=function(e){var t,n,r,o,a,s,u,l,c,p,f=[];for(f[95]=e,f[42]=e,f[39]=e,f[34]=e,n=this.delimiters;null!==n&&n.previous!==e;)n=n.previous;for(;null!==n;){var h=n.cc;if(!n.can_close||95!==h&&42!==h&&39!==h&&34!==h)n=n.next;else{for(t=n.previous,p=!1;null!==t&&t!==e&&t!==f[h];){if(t.cc===n.cc&&t.can_open){p=!0;break}t=t.previous}if(r=n,42===h||95===h)if(p){u=n.numdelims<3||t.numdelims<3?n.numdelims<=t.numdelims?n.numdelims:t.numdelims:n.numdelims%2==0?2:1,o=t.node,a=n.node,t.numdelims-=u,n.numdelims-=u,o._literal=o._literal.slice(0,o._literal.length-u),a._literal=a._literal.slice(0,a._literal.length-u);var d=new i(1===u?"Emph":"Strong");for(l=o._next;l&&l!==a;)c=l._next,l.unlink(),d.appendChild(l),l=c;o.insertAfter(d),J(t,n),0===t.numdelims&&(o.unlink(),this.removeDelimiter(t)),0===n.numdelims&&(a.unlink(),s=n.next,this.removeDelimiter(n),n=s)}else n=n.next;else 39===h?(n.node._literal="’",p&&(t.node._literal="‘"),n=n.next):34===h&&(n.node._literal="”",p&&(t.node.literal="“"),n=n.next);p||(f[h]=r.previous,r.can_open||this.removeDelimiter(r))}}for(;null!==this.delimiters&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},X=function(){var e=this.match(g);return null===e?null:u(e.substr(1,e.length-2))},Y=function(){var e=this.match(y);return null===e?(e=this.match(_),null===e?null:s(u(e))):s(u(e.substr(1,e.length-2)))},$=function(){var e=this.match(R);return null===e||e.length>1001?0:e.length},Z=function(e){var t=this.pos;this.pos+=1;var n=F("[");return e.appendChild(n),this.delimiters={cc:91,numdelims:1,node:n,previous:this.delimiters,next:null,can_open:!0,can_close:!1,index:t,active:!0},null!==this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters),!0},Q=function(e){var t=this.pos;if(this.pos+=1,91===this.peek()){this.pos+=1;var n=F("![");e.appendChild(n),this.delimiters={cc:33,numdelims:1,node:n,previous:this.delimiters,next:null,can_open:!0,can_close:!1,index:t+1,active:!0},null!==this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters)}else e.appendChild(F("!"));return!0},ee=function(e){var t,n,r,o,s,u,l=!1;for(this.pos+=1,t=this.pos,u=this.delimiters;null!==u&&91!==u.cc&&33!==u.cc;)u=u.previous;if(null===u)return e.appendChild(F("]")),!0;if(!u.active)return e.appendChild(F("]")),this.removeDelimiter(u),!0;if(n=33===u.cc,40===this.peek())this.pos++,this.spnl()&&null!==(r=this.parseLinkDestination())&&this.spnl()&&(O.test(this.subject.charAt(this.pos-1))&&(o=this.parseLinkTitle()),!0)&&this.spnl()&&41===this.peek()&&(this.pos+=1,l=!0);else{var c=this.pos,p=this.pos,f=this.parseLinkLabel();s=0===f||2===f?this.subject.slice(u.index,t):this.subject.slice(p,p+f),0===f&&(this.pos=c);var h=this.refmap[a(s)];h&&(r=h.destination,o=h.title,l=!0)}if(l){var d=new i(n?"Image":"Link");d._destination=r,d._title=o||"";var m,v;for(m=u.node._next;m;)v=m._next,m.unlink(),d.appendChild(m),m=v;if(e.appendChild(d),this.processEmphasis(u.previous),u.node.unlink(),!n)for(u=this.delimiters;null!==u;)91===u.cc&&(u.active=!1),u=u.previous;return!0}return this.removeDelimiter(u),this.pos=t,e.appendChild(F("]")),!0},te=function(e){var t;return!!(t=this.match(x))&&(e.appendChild(F(c(t))),!0)},ne=function(e){var t;return!!(t=this.match(j))&&(this.options.smart?e.appendChild(F(t.replace(E,"…").replace(S,function(e){var t=0,n=0;return e.length%3==0?n=e.length/3:e.length%2==0?t=e.length/2:e.length%3==2?(t=1,n=(e.length-2)/3):(t=2,n=(e.length-4)/3),"—".repeat(n)+"–".repeat(t)}))):e.appendChild(F(t)),!0)},re=function(e){this.pos+=1;var t=e._lastChild;if(t&&"Text"===t.type&&" "===t._literal[t._literal.length-1]){var n=" "===t._literal[t._literal.length-2];t._literal=t._literal.replace(T,""),e.appendChild(new i(n?"Hardbreak":"Softbreak"))}else e.appendChild(new i("Softbreak"));return this.match(P),!0},ie=function(e,t){this.subject=e,this.pos=0;var n,r,i,o,s=this.pos;if(0===(o=this.parseLinkLabel()))return 0;if(n=this.subject.substr(0,o),58!==this.peek())return this.pos=s,0;if(this.pos++,this.spnl(),null===(r=this.parseLinkDestination())||0===r.length)return this.pos=s,0;var u=this.pos;this.spnl(),null===(i=this.parseLinkTitle())&&(i="",this.pos=u);var l=!0;if(null===this.match(I)&&(""===i?l=!1:(i="",this.pos=u,l=null!==this.match(I))),!l)return this.pos=s,0;var c=a(n);return""===c?(this.pos=s,0):(t[c]||(t[c]={destination:r,title:i}),this.pos-s)},oe=function(e){var t=!1,n=this.peek();if(-1===n)return!1;switch(n){case 10:t=this.parseNewline(e);break;case 92:t=this.parseBackslash(e);break;case 96:t=this.parseBackticks(e);break;case 42:case 95:t=this.handleDelim(n,e);break;case 39:case 34:t=this.options.smart&&this.handleDelim(n,e);break;case 91:t=this.parseOpenBracket(e);break;case 33:t=this.parseBang(e);break;case 93:t=this.parseCloseBracket(e);break;case 60:t=this.parseAutolink(e)||this.parseHtmlTag(e);break;case 38:t=this.parseEntity(e);break;default:t=this.parseString(e)}return t||(this.pos+=1,e.appendChild(F(l(n)))),!0},ae=function(e){for(this.subject=e._string_content.trim(),this.pos=0,this.delimiters=null;this.parseInline(e););e._string_content=null,this.processEmphasis(null)};e.exports=r},function(e,t,n){"use strict";var r=/[ \t\r\n]+|[A-Z\xB5\xC0-\xD6\xD8-\xDF\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u0149\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u017F\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C5\u01C7\u01C8\u01CA\u01CB\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F0-\u01F2\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0345\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03AB\u03B0\u03C2\u03CF-\u03D1\u03D5\u03D6\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F0\u03F1\u03F4\u03F5\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u0587\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E96-\u1E9B\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F50\u1F52\u1F54\u1F56\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1F80-\u1FAF\u1FB2-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD2\u1FD3\u1FD6-\u1FDB\u1FE2-\u1FE4\u1FE6-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A\u212B\u2132\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0\uA7B1\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27]|\uD806[\uDCA0-\uDCBF]/g,i={A:"a",B:"b",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",J:"j",K:"k",L:"l",M:"m",N:"n",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",U:"u",V:"v",W:"w",X:"x",Y:"y",Z:"z","µ":"μ","À":"à","Á":"á","Â":"â","Ã":"ã","Ä":"ä","Å":"å","Æ":"æ","Ç":"ç","È":"è","É":"é","Ê":"ê","Ë":"ë","Ì":"ì","Í":"í","Î":"î","Ï":"ï","Ð":"ð","Ñ":"ñ","Ò":"ò","Ó":"ó","Ô":"ô","Õ":"õ","Ö":"ö","Ø":"ø","Ù":"ù","Ú":"ú","Û":"û","Ü":"ü","Ý":"ý","Þ":"þ","Ā":"ā","Ă":"ă","Ą":"ą","Ć":"ć","Ĉ":"ĉ","Ċ":"ċ","Č":"č","Ď":"ď","Đ":"đ","Ē":"ē","Ĕ":"ĕ","Ė":"ė","Ę":"ę","Ě":"ě","Ĝ":"ĝ","Ğ":"ğ","Ġ":"ġ","Ģ":"ģ","Ĥ":"ĥ","Ħ":"ħ","Ĩ":"ĩ","Ī":"ī","Ĭ":"ĭ","Į":"į","IJ":"ij","Ĵ":"ĵ","Ķ":"ķ","Ĺ":"ĺ","Ļ":"ļ","Ľ":"ľ","Ŀ":"ŀ","Ł":"ł","Ń":"ń","Ņ":"ņ","Ň":"ň","Ŋ":"ŋ","Ō":"ō","Ŏ":"ŏ","Ő":"ő","Œ":"œ","Ŕ":"ŕ","Ŗ":"ŗ","Ř":"ř","Ś":"ś","Ŝ":"ŝ","Ş":"ş","Š":"š","Ţ":"ţ","Ť":"ť","Ŧ":"ŧ","Ũ":"ũ","Ū":"ū","Ŭ":"ŭ","Ů":"ů","Ű":"ű","Ų":"ų","Ŵ":"ŵ","Ŷ":"ŷ","Ÿ":"ÿ","Ź":"ź","Ż":"ż","Ž":"ž","ſ":"s","Ɓ":"ɓ","Ƃ":"ƃ","Ƅ":"ƅ","Ɔ":"ɔ","Ƈ":"ƈ","Ɖ":"ɖ","Ɗ":"ɗ","Ƌ":"ƌ","Ǝ":"ǝ","Ə":"ə","Ɛ":"ɛ","Ƒ":"ƒ","Ɠ":"ɠ","Ɣ":"ɣ","Ɩ":"ɩ","Ɨ":"ɨ","Ƙ":"ƙ","Ɯ":"ɯ","Ɲ":"ɲ","Ɵ":"ɵ","Ơ":"ơ","Ƣ":"ƣ","Ƥ":"ƥ","Ʀ":"ʀ","Ƨ":"ƨ","Ʃ":"ʃ","Ƭ":"ƭ","Ʈ":"ʈ","Ư":"ư","Ʊ":"ʊ","Ʋ":"ʋ","Ƴ":"ƴ","Ƶ":"ƶ","Ʒ":"ʒ","Ƹ":"ƹ","Ƽ":"ƽ","DŽ":"dž","Dž":"dž","LJ":"lj","Lj":"lj","NJ":"nj","Nj":"nj","Ǎ":"ǎ","Ǐ":"ǐ","Ǒ":"ǒ","Ǔ":"ǔ","Ǖ":"ǖ","Ǘ":"ǘ","Ǚ":"ǚ","Ǜ":"ǜ","Ǟ":"ǟ","Ǡ":"ǡ","Ǣ":"ǣ","Ǥ":"ǥ","Ǧ":"ǧ","Ǩ":"ǩ","Ǫ":"ǫ","Ǭ":"ǭ","Ǯ":"ǯ","DZ":"dz","Dz":"dz","Ǵ":"ǵ","Ƕ":"ƕ","Ƿ":"ƿ","Ǹ":"ǹ","Ǻ":"ǻ","Ǽ":"ǽ","Ǿ":"ǿ","Ȁ":"ȁ","Ȃ":"ȃ","Ȅ":"ȅ","Ȇ":"ȇ","Ȉ":"ȉ","Ȋ":"ȋ","Ȍ":"ȍ","Ȏ":"ȏ","Ȑ":"ȑ","Ȓ":"ȓ","Ȕ":"ȕ","Ȗ":"ȗ","Ș":"ș","Ț":"ț","Ȝ":"ȝ","Ȟ":"ȟ","Ƞ":"ƞ","Ȣ":"ȣ","Ȥ":"ȥ","Ȧ":"ȧ","Ȩ":"ȩ","Ȫ":"ȫ","Ȭ":"ȭ","Ȯ":"ȯ","Ȱ":"ȱ","Ȳ":"ȳ","Ⱥ":"ⱥ","Ȼ":"ȼ","Ƚ":"ƚ","Ⱦ":"ⱦ","Ɂ":"ɂ","Ƀ":"ƀ","Ʉ":"ʉ","Ʌ":"ʌ","Ɇ":"ɇ","Ɉ":"ɉ","Ɋ":"ɋ","Ɍ":"ɍ","Ɏ":"ɏ","ͅ":"ι","Ͱ":"ͱ","Ͳ":"ͳ","Ͷ":"ͷ","Ϳ":"ϳ","Ά":"ά","Έ":"έ","Ή":"ή","Ί":"ί","Ό":"ό","Ύ":"ύ","Ώ":"ώ","Α":"α","Β":"β","Γ":"γ","Δ":"δ","Ε":"ε","Ζ":"ζ","Η":"η","Θ":"θ","Ι":"ι","Κ":"κ","Λ":"λ","Μ":"μ","Ν":"ν","Ξ":"ξ","Ο":"ο","Π":"π","Ρ":"ρ","Σ":"σ","Τ":"τ","Υ":"υ","Φ":"φ","Χ":"χ","Ψ":"ψ","Ω":"ω","Ϊ":"ϊ","Ϋ":"ϋ","ς":"σ","Ϗ":"ϗ","ϐ":"β","ϑ":"θ","ϕ":"φ","ϖ":"π","Ϙ":"ϙ","Ϛ":"ϛ","Ϝ":"ϝ","Ϟ":"ϟ","Ϡ":"ϡ","Ϣ":"ϣ","Ϥ":"ϥ","Ϧ":"ϧ","Ϩ":"ϩ","Ϫ":"ϫ","Ϭ":"ϭ","Ϯ":"ϯ","ϰ":"κ","ϱ":"ρ","ϴ":"θ","ϵ":"ε","Ϸ":"ϸ","Ϲ":"ϲ","Ϻ":"ϻ","Ͻ":"ͻ","Ͼ":"ͼ","Ͽ":"ͽ","Ѐ":"ѐ","Ё":"ё","Ђ":"ђ","Ѓ":"ѓ","Є":"є","Ѕ":"ѕ","І":"і","Ї":"ї","Ј":"ј","Љ":"љ","Њ":"њ","Ћ":"ћ","Ќ":"ќ","Ѝ":"ѝ","Ў":"ў","Џ":"џ","А":"а","Б":"б","В":"в","Г":"г","Д":"д","Е":"е","Ж":"ж","З":"з","И":"и","Й":"й","К":"к","Л":"л","М":"м","Н":"н","О":"о","П":"п","Р":"р","С":"с","Т":"т","У":"у","Ф":"ф","Х":"х","Ц":"ц","Ч":"ч","Ш":"ш","Щ":"щ","Ъ":"ъ","Ы":"ы","Ь":"ь","Э":"э","Ю":"ю","Я":"я","Ѡ":"ѡ","Ѣ":"ѣ","Ѥ":"ѥ","Ѧ":"ѧ","Ѩ":"ѩ","Ѫ":"ѫ","Ѭ":"ѭ","Ѯ":"ѯ","Ѱ":"ѱ","Ѳ":"ѳ","Ѵ":"ѵ","Ѷ":"ѷ","Ѹ":"ѹ","Ѻ":"ѻ","Ѽ":"ѽ","Ѿ":"ѿ","Ҁ":"ҁ","Ҋ":"ҋ","Ҍ":"ҍ","Ҏ":"ҏ","Ґ":"ґ","Ғ":"ғ","Ҕ":"ҕ","Җ":"җ","Ҙ":"ҙ","Қ":"қ","Ҝ":"ҝ","Ҟ":"ҟ","Ҡ":"ҡ","Ң":"ң","Ҥ":"ҥ","Ҧ":"ҧ","Ҩ":"ҩ","Ҫ":"ҫ","Ҭ":"ҭ","Ү":"ү","Ұ":"ұ","Ҳ":"ҳ","Ҵ":"ҵ","Ҷ":"ҷ","Ҹ":"ҹ","Һ":"һ","Ҽ":"ҽ","Ҿ":"ҿ","Ӏ":"ӏ","Ӂ":"ӂ","Ӄ":"ӄ","Ӆ":"ӆ","Ӈ":"ӈ","Ӊ":"ӊ","Ӌ":"ӌ","Ӎ":"ӎ","Ӑ":"ӑ","Ӓ":"ӓ","Ӕ":"ӕ","Ӗ":"ӗ","Ә":"ә","Ӛ":"ӛ","Ӝ":"ӝ","Ӟ":"ӟ","Ӡ":"ӡ","Ӣ":"ӣ","Ӥ":"ӥ","Ӧ":"ӧ","Ө":"ө","Ӫ":"ӫ","Ӭ":"ӭ","Ӯ":"ӯ","Ӱ":"ӱ","Ӳ":"ӳ","Ӵ":"ӵ","Ӷ":"ӷ","Ӹ":"ӹ","Ӻ":"ӻ","Ӽ":"ӽ","Ӿ":"ӿ","Ԁ":"ԁ","Ԃ":"ԃ","Ԅ":"ԅ","Ԇ":"ԇ","Ԉ":"ԉ","Ԋ":"ԋ","Ԍ":"ԍ","Ԏ":"ԏ","Ԑ":"ԑ","Ԓ":"ԓ","Ԕ":"ԕ","Ԗ":"ԗ","Ԙ":"ԙ","Ԛ":"ԛ","Ԝ":"ԝ","Ԟ":"ԟ","Ԡ":"ԡ","Ԣ":"ԣ","Ԥ":"ԥ","Ԧ":"ԧ","Ԩ":"ԩ","Ԫ":"ԫ","Ԭ":"ԭ","Ԯ":"ԯ","Ա":"ա","Բ":"բ","Գ":"գ","Դ":"դ","Ե":"ե","Զ":"զ","Է":"է","Ը":"ը","Թ":"թ","Ժ":"ժ","Ի":"ի","Լ":"լ","Խ":"խ","Ծ":"ծ","Կ":"կ","Հ":"հ","Ձ":"ձ","Ղ":"ղ","Ճ":"ճ","Մ":"մ","Յ":"յ","Ն":"ն","Շ":"շ","Ո":"ո","Չ":"չ","Պ":"պ","Ջ":"ջ","Ռ":"ռ","Ս":"ս","Վ":"վ","Տ":"տ","Ր":"ր","Ց":"ց","Ւ":"ւ","Փ":"փ","Ք":"ք","Օ":"օ","Ֆ":"ֆ","Ⴀ":"ⴀ","Ⴁ":"ⴁ","Ⴂ":"ⴂ","Ⴃ":"ⴃ","Ⴄ":"ⴄ","Ⴅ":"ⴅ","Ⴆ":"ⴆ","Ⴇ":"ⴇ","Ⴈ":"ⴈ","Ⴉ":"ⴉ","Ⴊ":"ⴊ","Ⴋ":"ⴋ","Ⴌ":"ⴌ","Ⴍ":"ⴍ","Ⴎ":"ⴎ","Ⴏ":"ⴏ","Ⴐ":"ⴐ","Ⴑ":"ⴑ","Ⴒ":"ⴒ","Ⴓ":"ⴓ","Ⴔ":"ⴔ","Ⴕ":"ⴕ","Ⴖ":"ⴖ","Ⴗ":"ⴗ","Ⴘ":"ⴘ","Ⴙ":"ⴙ","Ⴚ":"ⴚ","Ⴛ":"ⴛ","Ⴜ":"ⴜ","Ⴝ":"ⴝ","Ⴞ":"ⴞ","Ⴟ":"ⴟ","Ⴠ":"ⴠ","Ⴡ":"ⴡ","Ⴢ":"ⴢ","Ⴣ":"ⴣ","Ⴤ":"ⴤ","Ⴥ":"ⴥ","Ⴧ":"ⴧ","Ⴭ":"ⴭ","Ḁ":"ḁ","Ḃ":"ḃ","Ḅ":"ḅ","Ḇ":"ḇ","Ḉ":"ḉ","Ḋ":"ḋ","Ḍ":"ḍ","Ḏ":"ḏ","Ḑ":"ḑ","Ḓ":"ḓ","Ḕ":"ḕ","Ḗ":"ḗ","Ḙ":"ḙ","Ḛ":"ḛ","Ḝ":"ḝ","Ḟ":"ḟ","Ḡ":"ḡ","Ḣ":"ḣ","Ḥ":"ḥ","Ḧ":"ḧ","Ḩ":"ḩ","Ḫ":"ḫ","Ḭ":"ḭ","Ḯ":"ḯ","Ḱ":"ḱ","Ḳ":"ḳ","Ḵ":"ḵ","Ḷ":"ḷ","Ḹ":"ḹ","Ḻ":"ḻ","Ḽ":"ḽ","Ḿ":"ḿ","Ṁ":"ṁ","Ṃ":"ṃ","Ṅ":"ṅ","Ṇ":"ṇ","Ṉ":"ṉ","Ṋ":"ṋ","Ṍ":"ṍ","Ṏ":"ṏ","Ṑ":"ṑ","Ṓ":"ṓ","Ṕ":"ṕ","Ṗ":"ṗ","Ṙ":"ṙ","Ṛ":"ṛ","Ṝ":"ṝ","Ṟ":"ṟ","Ṡ":"ṡ","Ṣ":"ṣ","Ṥ":"ṥ","Ṧ":"ṧ","Ṩ":"ṩ","Ṫ":"ṫ","Ṭ":"ṭ","Ṯ":"ṯ","Ṱ":"ṱ","Ṳ":"ṳ","Ṵ":"ṵ","Ṷ":"ṷ","Ṹ":"ṹ","Ṻ":"ṻ","Ṽ":"ṽ","Ṿ":"ṿ","Ẁ":"ẁ","Ẃ":"ẃ","Ẅ":"ẅ","Ẇ":"ẇ","Ẉ":"ẉ","Ẋ":"ẋ","Ẍ":"ẍ","Ẏ":"ẏ","Ẑ":"ẑ","Ẓ":"ẓ","Ẕ":"ẕ","ẛ":"ṡ","Ạ":"ạ","Ả":"ả","Ấ":"ấ","Ầ":"ầ","Ẩ":"ẩ","Ẫ":"ẫ","Ậ":"ậ","Ắ":"ắ","Ằ":"ằ","Ẳ":"ẳ","Ẵ":"ẵ","Ặ":"ặ","Ẹ":"ẹ","Ẻ":"ẻ","Ẽ":"ẽ","Ế":"ế","Ề":"ề","Ể":"ể","Ễ":"ễ","Ệ":"ệ","Ỉ":"ỉ","Ị":"ị","Ọ":"ọ","Ỏ":"ỏ","Ố":"ố","Ồ":"ồ","Ổ":"ổ","Ỗ":"ỗ","Ộ":"ộ","Ớ":"ớ","Ờ":"ờ","Ở":"ở","Ỡ":"ỡ","Ợ":"ợ","Ụ":"ụ","Ủ":"ủ","Ứ":"ứ","Ừ":"ừ","Ử":"ử","Ữ":"ữ","Ự":"ự","Ỳ":"ỳ","Ỵ":"ỵ","Ỷ":"ỷ","Ỹ":"ỹ","Ỻ":"ỻ","Ỽ":"ỽ","Ỿ":"ỿ","Ἀ":"ἀ","Ἁ":"ἁ","Ἂ":"ἂ","Ἃ":"ἃ","Ἄ":"ἄ","Ἅ":"ἅ","Ἆ":"ἆ","Ἇ":"ἇ","Ἐ":"ἐ","Ἑ":"ἑ","Ἒ":"ἒ","Ἓ":"ἓ","Ἔ":"ἔ","Ἕ":"ἕ","Ἠ":"ἠ","Ἡ":"ἡ","Ἢ":"ἢ","Ἣ":"ἣ","Ἤ":"ἤ","Ἥ":"ἥ","Ἦ":"ἦ","Ἧ":"ἧ","Ἰ":"ἰ","Ἱ":"ἱ","Ἲ":"ἲ","Ἳ":"ἳ","Ἴ":"ἴ","Ἵ":"ἵ","Ἶ":"ἶ","Ἷ":"ἷ","Ὀ":"ὀ","Ὁ":"ὁ","Ὂ":"ὂ","Ὃ":"ὃ","Ὄ":"ὄ","Ὅ":"ὅ","Ὑ":"ὑ","Ὓ":"ὓ","Ὕ":"ὕ","Ὗ":"ὗ","Ὠ":"ὠ","Ὡ":"ὡ","Ὢ":"ὢ","Ὣ":"ὣ","Ὤ":"ὤ","Ὥ":"ὥ","Ὦ":"ὦ","Ὧ":"ὧ","Ᾰ":"ᾰ","Ᾱ":"ᾱ","Ὰ":"ὰ","Ά":"ά","ι":"ι","Ὲ":"ὲ","Έ":"έ","Ὴ":"ὴ","Ή":"ή","Ῐ":"ῐ","Ῑ":"ῑ","Ὶ":"ὶ","Ί":"ί","Ῠ":"ῠ","Ῡ":"ῡ","Ὺ":"ὺ","Ύ":"ύ","Ῥ":"ῥ","Ὸ":"ὸ","Ό":"ό","Ὼ":"ὼ","Ώ":"ώ","Ω":"ω","K":"k","Å":"å","Ⅎ":"ⅎ","Ⅰ":"ⅰ","Ⅱ":"ⅱ","Ⅲ":"ⅲ","Ⅳ":"ⅳ","Ⅴ":"ⅴ","Ⅵ":"ⅵ","Ⅶ":"ⅶ","Ⅷ":"ⅷ","Ⅸ":"ⅸ","Ⅹ":"ⅹ","Ⅺ":"ⅺ","Ⅻ":"ⅻ","Ⅼ":"ⅼ","Ⅽ":"ⅽ","Ⅾ":"ⅾ","Ⅿ":"ⅿ","Ↄ":"ↄ","Ⓐ":"ⓐ","Ⓑ":"ⓑ","Ⓒ":"ⓒ","Ⓓ":"ⓓ","Ⓔ":"ⓔ","Ⓕ":"ⓕ","Ⓖ":"ⓖ","Ⓗ":"ⓗ","Ⓘ":"ⓘ","Ⓙ":"ⓙ","Ⓚ":"ⓚ","Ⓛ":"ⓛ","Ⓜ":"ⓜ","Ⓝ":"ⓝ","Ⓞ":"ⓞ","Ⓟ":"ⓟ","Ⓠ":"ⓠ","Ⓡ":"ⓡ","Ⓢ":"ⓢ","Ⓣ":"ⓣ","Ⓤ":"ⓤ","Ⓥ":"ⓥ","Ⓦ":"ⓦ","Ⓧ":"ⓧ","Ⓨ":"ⓨ","Ⓩ":"ⓩ","Ⰰ":"ⰰ","Ⰱ":"ⰱ","Ⰲ":"ⰲ","Ⰳ":"ⰳ","Ⰴ":"ⰴ","Ⰵ":"ⰵ","Ⰶ":"ⰶ","Ⰷ":"ⰷ","Ⰸ":"ⰸ","Ⰹ":"ⰹ","Ⰺ":"ⰺ","Ⰻ":"ⰻ","Ⰼ":"ⰼ","Ⰽ":"ⰽ","Ⰾ":"ⰾ","Ⰿ":"ⰿ","Ⱀ":"ⱀ","Ⱁ":"ⱁ","Ⱂ":"ⱂ","Ⱃ":"ⱃ","Ⱄ":"ⱄ","Ⱅ":"ⱅ","Ⱆ":"ⱆ","Ⱇ":"ⱇ","Ⱈ":"ⱈ","Ⱉ":"ⱉ","Ⱊ":"ⱊ","Ⱋ":"ⱋ","Ⱌ":"ⱌ","Ⱍ":"ⱍ","Ⱎ":"ⱎ","Ⱏ":"ⱏ","Ⱐ":"ⱐ","Ⱑ":"ⱑ","Ⱒ":"ⱒ","Ⱓ":"ⱓ","Ⱔ":"ⱔ","Ⱕ":"ⱕ","Ⱖ":"ⱖ","Ⱗ":"ⱗ","Ⱘ":"ⱘ","Ⱙ":"ⱙ","Ⱚ":"ⱚ","Ⱛ":"ⱛ","Ⱜ":"ⱜ","Ⱝ":"ⱝ","Ⱞ":"ⱞ","Ⱡ":"ⱡ","Ɫ":"ɫ","Ᵽ":"ᵽ","Ɽ":"ɽ","Ⱨ":"ⱨ","Ⱪ":"ⱪ","Ⱬ":"ⱬ","Ɑ":"ɑ","Ɱ":"ɱ","Ɐ":"ɐ","Ɒ":"ɒ","Ⱳ":"ⱳ","Ⱶ":"ⱶ","Ȿ":"ȿ","Ɀ":"ɀ","Ⲁ":"ⲁ","Ⲃ":"ⲃ","Ⲅ":"ⲅ","Ⲇ":"ⲇ","Ⲉ":"ⲉ","Ⲋ":"ⲋ","Ⲍ":"ⲍ","Ⲏ":"ⲏ","Ⲑ":"ⲑ","Ⲓ":"ⲓ","Ⲕ":"ⲕ","Ⲗ":"ⲗ","Ⲙ":"ⲙ","Ⲛ":"ⲛ","Ⲝ":"ⲝ","Ⲟ":"ⲟ","Ⲡ":"ⲡ","Ⲣ":"ⲣ","Ⲥ":"ⲥ","Ⲧ":"ⲧ","Ⲩ":"ⲩ","Ⲫ":"ⲫ","Ⲭ":"ⲭ","Ⲯ":"ⲯ","Ⲱ":"ⲱ","Ⲳ":"ⲳ","Ⲵ":"ⲵ","Ⲷ":"ⲷ","Ⲹ":"ⲹ","Ⲻ":"ⲻ","Ⲽ":"ⲽ","Ⲿ":"ⲿ","Ⳁ":"ⳁ","Ⳃ":"ⳃ","Ⳅ":"ⳅ","Ⳇ":"ⳇ","Ⳉ":"ⳉ","Ⳋ":"ⳋ","Ⳍ":"ⳍ","Ⳏ":"ⳏ","Ⳑ":"ⳑ","Ⳓ":"ⳓ","Ⳕ":"ⳕ","Ⳗ":"ⳗ","Ⳙ":"ⳙ","Ⳛ":"ⳛ","Ⳝ":"ⳝ","Ⳟ":"ⳟ","Ⳡ":"ⳡ","Ⳣ":"ⳣ","Ⳬ":"ⳬ","Ⳮ":"ⳮ","Ⳳ":"ⳳ","Ꙁ":"ꙁ","Ꙃ":"ꙃ","Ꙅ":"ꙅ","Ꙇ":"ꙇ","Ꙉ":"ꙉ","Ꙋ":"ꙋ","Ꙍ":"ꙍ","Ꙏ":"ꙏ","Ꙑ":"ꙑ","Ꙓ":"ꙓ","Ꙕ":"ꙕ","Ꙗ":"ꙗ","Ꙙ":"ꙙ","Ꙛ":"ꙛ","Ꙝ":"ꙝ","Ꙟ":"ꙟ","Ꙡ":"ꙡ","Ꙣ":"ꙣ","Ꙥ":"ꙥ","Ꙧ":"ꙧ","Ꙩ":"ꙩ","Ꙫ":"ꙫ","Ꙭ":"ꙭ","Ꚁ":"ꚁ","Ꚃ":"ꚃ","Ꚅ":"ꚅ","Ꚇ":"ꚇ","Ꚉ":"ꚉ","Ꚋ":"ꚋ","Ꚍ":"ꚍ","Ꚏ":"ꚏ","Ꚑ":"ꚑ","Ꚓ":"ꚓ","Ꚕ":"ꚕ","Ꚗ":"ꚗ","Ꚙ":"ꚙ","Ꚛ":"ꚛ","Ꜣ":"ꜣ","Ꜥ":"ꜥ","Ꜧ":"ꜧ","Ꜩ":"ꜩ","Ꜫ":"ꜫ","Ꜭ":"ꜭ","Ꜯ":"ꜯ","Ꜳ":"ꜳ","Ꜵ":"ꜵ","Ꜷ":"ꜷ","Ꜹ":"ꜹ","Ꜻ":"ꜻ","Ꜽ":"ꜽ","Ꜿ":"ꜿ","Ꝁ":"ꝁ","Ꝃ":"ꝃ","Ꝅ":"ꝅ","Ꝇ":"ꝇ","Ꝉ":"ꝉ","Ꝋ":"ꝋ","Ꝍ":"ꝍ","Ꝏ":"ꝏ","Ꝑ":"ꝑ","Ꝓ":"ꝓ","Ꝕ":"ꝕ","Ꝗ":"ꝗ","Ꝙ":"ꝙ","Ꝛ":"ꝛ","Ꝝ":"ꝝ","Ꝟ":"ꝟ","Ꝡ":"ꝡ","Ꝣ":"ꝣ","Ꝥ":"ꝥ","Ꝧ":"ꝧ","Ꝩ":"ꝩ","Ꝫ":"ꝫ","Ꝭ":"ꝭ","Ꝯ":"ꝯ","Ꝺ":"ꝺ","Ꝼ":"ꝼ","Ᵹ":"ᵹ","Ꝿ":"ꝿ","Ꞁ":"ꞁ","Ꞃ":"ꞃ","Ꞅ":"ꞅ","Ꞇ":"ꞇ","Ꞌ":"ꞌ","Ɥ":"ɥ","Ꞑ":"ꞑ","Ꞓ":"ꞓ","Ꞗ":"ꞗ","Ꞙ":"ꞙ","Ꞛ":"ꞛ","Ꞝ":"ꞝ","Ꞟ":"ꞟ","Ꞡ":"ꞡ","Ꞣ":"ꞣ","Ꞥ":"ꞥ","Ꞧ":"ꞧ","Ꞩ":"ꞩ","Ɦ":"ɦ","Ɜ":"ɜ","Ɡ":"ɡ","Ɬ":"ɬ","Ʞ":"ʞ","Ʇ":"ʇ","A":"a","B":"b","C":"c","D":"d","E":"e","F":"f","G":"g","H":"h","I":"i","J":"j","K":"k","L":"l","M":"m","N":"n","O":"o","P":"p","Q":"q","R":"r","S":"s","T":"t","U":"u","V":"v","W":"w","X":"x","Y":"y","Z":"z","𐐀":"𐐨","𐐁":"𐐩","𐐂":"𐐪","𐐃":"𐐫","𐐄":"𐐬","𐐅":"𐐭","𐐆":"𐐮","𐐇":"𐐯","𐐈":"𐐰","𐐉":"𐐱","𐐊":"𐐲","𐐋":"𐐳","𐐌":"𐐴","𐐍":"𐐵","𐐎":"𐐶","𐐏":"𐐷","𐐐":"𐐸","𐐑":"𐐹","𐐒":"𐐺","𐐓":"𐐻","𐐔":"𐐼","𐐕":"𐐽","𐐖":"𐐾","𐐗":"𐐿","𐐘":"𐑀","𐐙":"𐑁","𐐚":"𐑂","𐐛":"𐑃","𐐜":"𐑄","𐐝":"𐑅","𐐞":"𐑆","𐐟":"𐑇","𐐠":"𐑈","𐐡":"𐑉","𐐢":"𐑊","𐐣":"𐑋","𐐤":"𐑌","𐐥":"𐑍","𐐦":"𐑎","𐐧":"𐑏","𑢠":"𑣀","𑢡":"𑣁","𑢢":"𑣂","𑢣":"𑣃","𑢤":"𑣄","𑢥":"𑣅","𑢦":"𑣆","𑢧":"𑣇","𑢨":"𑣈","𑢩":"𑣉","𑢪":"𑣊","𑢫":"𑣋","𑢬":"𑣌","𑢭":"𑣍","𑢮":"𑣎","𑢯":"𑣏","𑢰":"𑣐","𑢱":"𑣑","𑢲":"𑣒","𑢳":"𑣓","𑢴":"𑣔","𑢵":"𑣕","𑢶":"𑣖","𑢷":"𑣗","𑢸":"𑣘","𑢹":"𑣙","𑢺":"𑣚","𑢻":"𑣛","𑢼":"𑣜","𑢽":"𑣝","𑢾":"𑣞","𑢿":"𑣟","ß":"ss","İ":"i̇","ʼn":"ʼn","ǰ":"ǰ","ΐ":"ΐ","ΰ":"ΰ","և":"եւ","ẖ":"ẖ","ẗ":"ẗ","ẘ":"ẘ","ẙ":"ẙ","ẚ":"aʾ","ẞ":"ss","ὐ":"ὐ","ὒ":"ὒ","ὔ":"ὔ","ὖ":"ὖ","ᾀ":"ἀι","ᾁ":"ἁι","ᾂ":"ἂι","ᾃ":"ἃι","ᾄ":"ἄι","ᾅ":"ἅι","ᾆ":"ἆι","ᾇ":"ἇι","ᾈ":"ἀι","ᾉ":"ἁι","ᾊ":"ἂι","ᾋ":"ἃι","ᾌ":"ἄι","ᾍ":"ἅι","ᾎ":"ἆι","ᾏ":"ἇι","ᾐ":"ἠι","ᾑ":"ἡι","ᾒ":"ἢι","ᾓ":"ἣι","ᾔ":"ἤι","ᾕ":"ἥι","ᾖ":"ἦι","ᾗ":"ἧι","ᾘ":"ἠι","ᾙ":"ἡι","ᾚ":"ἢι","ᾛ":"ἣι","ᾜ":"ἤι","ᾝ":"ἥι","ᾞ":"ἦι","ᾟ":"ἧι","ᾠ":"ὠι","ᾡ":"ὡι","ᾢ":"ὢι","ᾣ":"ὣι","ᾤ":"ὤι","ᾥ":"ὥι","ᾦ":"ὦι","ᾧ":"ὧι","ᾨ":"ὠι","ᾩ":"ὡι","ᾪ":"ὢι","ᾫ":"ὣι","ᾬ":"ὤι","ᾭ":"ὥι","ᾮ":"ὦι","ᾯ":"ὧι","ᾲ":"ὰι","ᾳ":"αι","ᾴ":"άι","ᾶ":"ᾶ","ᾷ":"ᾶι","ᾼ":"αι","ῂ":"ὴι","ῃ":"ηι","ῄ":"ήι","ῆ":"ῆ","ῇ":"ῆι","ῌ":"ηι","ῒ":"ῒ","ΐ":"ΐ","ῖ":"ῖ","ῗ":"ῗ","ῢ":"ῢ","ΰ":"ΰ","ῤ":"ῤ","ῦ":"ῦ","ῧ":"ῧ","ῲ":"ὼι","ῳ":"ωι","ῴ":"ώι","ῶ":"ῶ","ῷ":"ῶι","ῼ":"ωι","ff":"ff","fi":"fi","fl":"fl","ffi":"ffi","ffl":"ffl","ſt":"st","st":"st","ﬓ":"մն","ﬔ":"մե","ﬕ":"մի","ﬖ":"վն","ﬗ":"մխ"};e.exports=function(e){return e.slice(1,e.length-1).trim().replace(r,function(e){return i[e]||" "})}},function(e,t,n){"use strict";function r(e){return{softbreak:"\n",escape:i,options:e||{},render:s}}var i=n(91).escapeXml,o=function(e,t,n){var r="<"+e;if(t&&t.length>0)for(var i,o=0;void 0!==(i=t[o]);)r+=" "+i[0]+'="'+i[1]+'"',o++;return n&&(r+=" /"),r+=">"},a=function(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()},s=function(e){var t,n,r,i,s,u,l,c,p=e.walker(),f="",h="\n",d=0,m=function(e){f+=e,h=e},v=this.escape,g=function(){if("\n"!==h){f+="\n",h="\n";for(var e=d;e>0;e--)f+=" "}},y=this.options;for(y.time&&console.time("rendering"),f+='<?xml version="1.0" encoding="UTF-8"?>\n',f+='<!DOCTYPE CommonMark SYSTEM "CommonMark.dtd">\n';r=p.next();)if(s=r.entering,i=r.node,c=i.type,u=i.isContainer,l="ThematicBreak"===c||"Hardbreak"===c||"Softbreak"===c,n=a(c),s){switch(t=[],c){case"Document":t.push(["xmlns","http://commonmark.org/xml/1.0"]);break;case"List":null!==i.listType&&t.push(["type",i.listType.toLowerCase()]),null!==i.listStart&&t.push(["start",String(i.listStart)]),null!==i.listTight&&t.push(["tight",i.listTight?"true":"false"]);var _=i.listDelimiter;if(null!==_){var b="";b="."===_?"period":"paren",t.push(["delimiter",b])}break;case"CodeBlock":i.info&&t.push(["info",i.info]);break;case"Heading":t.push(["level",String(i.level)]);break;case"Link":case"Image":t.push(["destination",i.destination]),t.push(["title",i.title]);break;case"CustomInline":case"CustomBlock":t.push(["on_enter",i.onEnter]),t.push(["on_exit",i.onExit])}if(y.sourcepos){var x=i.sourcepos;x&&t.push(["sourcepos",String(x[0][0])+":"+String(x[0][1])+"-"+String(x[1][0])+":"+String(x[1][1])])}if(g(),m(o(n,t,l)),u)d+=1;else if(!u&&!l){var w=i.literal;w&&m(v(w)),m(o("/"+n))}}else d-=1,g(),m(o("/"+n));return y.time&&console.timeEnd("rendering"),f+="\n"};e.exports=r},function(e,t,n){"use strict";function r(e){i.Component.call(this,e)}var i=n(0),o=n(1076).Parser,a=n(574),s=n(1);r.prototype=Object.create(i.Component.prototype),r.prototype.constructor=r,r.prototype.render=function(){var e=this.props.containerProps||{},t=new a(this.props),n=new o(this.props.parserOptions),r=n.parse(this.props.source||"");if(this.props.walker)for(var s,u=r.walker();s=u.next();)this.props.walker.call(this,s,u);return this.props.className&&(e.className=this.props.className),i.createElement.apply(i,[this.props.containerTagName,e,this.props.childBefore].concat(t.render(r).concat([this.props.childAfter])))},r.propTypes={className:s.string,containerProps:s.object,source:s.string.isRequired,containerTagName:s.string,childBefore:s.object,childAfter:s.object,sourcePos:s.bool,escapeHtml:s.bool,skipHtml:s.bool,softBreak:s.string,allowNode:s.func,allowedTypes:s.array,disallowedTypes:s.array,transformLinkUri:s.func,transformImageUri:s.func,unwrapDisallowed:s.bool,renderers:s.object,walker:s.func,parserOptions:s.object},r.defaultProps={containerTagName:"div",parserOptions:{}},r.types=a.types,r.renderers=a.renderers,r.uriTransformer=a.uriTransformer,e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(257),l=r(u),c=n(164),p=r(c),f=n(259),h=r(f),d=n(231),m=r(d),v=n(239),g=r(v),y=n(258),_=r(y),b=n(0),x=r(b),w=n(1),k=r(w),E=1e3/60,S=function(e){function t(n){var r=this;i(this,t),e.call(this,n),this.wasAnimating=!1,this.animationID=null,this.prevTime=0,this.accumulatedTime=0,this.unreadPropStyle=null,this.clearUnreadPropStyle=function(e){var t=!1,n=r.state,i=n.currentStyle,o=n.currentVelocity,s=n.lastIdealStyle,u=n.lastIdealVelocity;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var c=e[l];"number"==typeof c&&(t||(t=!0,i=a({},i),o=a({},o),s=a({},s),u=a({},u)),i[l]=c,o[l]=0,s[l]=c,u[l]=0)}t&&r.setState({currentStyle:i,currentVelocity:o,lastIdealStyle:s,lastIdealVelocity:u})},this.startAnimationIfNecessary=function(){r.animationID=g.default(function(e){var t=r.props.style;if(_.default(r.state.currentStyle,t,r.state.currentVelocity))return r.wasAnimating&&r.props.onRest&&r.props.onRest(),r.animationID=null,r.wasAnimating=!1,void(r.accumulatedTime=0);r.wasAnimating=!0;var n=e||m.default(),i=n-r.prevTime;if(r.prevTime=n,r.accumulatedTime=r.accumulatedTime+i,r.accumulatedTime>10*E&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();var o=(r.accumulatedTime-Math.floor(r.accumulatedTime/E)*E)/E,a=Math.floor(r.accumulatedTime/E),s={},u={},l={},c={};for(var p in t)if(Object.prototype.hasOwnProperty.call(t,p)){var f=t[p];if("number"==typeof f)l[p]=f,c[p]=0,s[p]=f,u[p]=0;else{for(var d=r.state.lastIdealStyle[p],v=r.state.lastIdealVelocity[p],g=0;g<a;g++){var y=h.default(E/1e3,d,v,f.val,f.stiffness,f.damping,f.precision);d=y[0],v=y[1]}var b=h.default(E/1e3,d,v,f.val,f.stiffness,f.damping,f.precision),x=b[0],w=b[1];l[p]=d+(x-d)*o,c[p]=v+(w-v)*o,s[p]=d,u[p]=v}}r.animationID=null,r.accumulatedTime-=a*E,r.setState({currentStyle:l,currentVelocity:c,lastIdealStyle:s,lastIdealVelocity:u}),r.unreadPropStyle=null,r.startAnimationIfNecessary()})},this.state=this.defaultState()}return o(t,e),s(t,null,[{key:"propTypes",value:{defaultStyle:k.default.objectOf(k.default.number),style:k.default.objectOf(k.default.oneOfType([k.default.number,k.default.object])).isRequired,children:k.default.func.isRequired,onRest:k.default.func},enumerable:!0}]),t.prototype.defaultState=function(){var e=this.props,t=e.defaultStyle,n=e.style,r=t||p.default(n),i=l.default(r);return{currentStyle:r,currentVelocity:i,lastIdealStyle:r,lastIdealVelocity:i}},t.prototype.componentDidMount=function(){this.prevTime=m.default(),this.startAnimationIfNecessary()},t.prototype.componentWillReceiveProps=function(e){null!=this.unreadPropStyle&&this.clearUnreadPropStyle(this.unreadPropStyle),this.unreadPropStyle=e.style,null==this.animationID&&(this.prevTime=m.default(),this.startAnimationIfNecessary())},t.prototype.componentWillUnmount=function(){null!=this.animationID&&(g.default.cancel(this.animationID),this.animationID=null)},t.prototype.render=function(){var e=this.props.children(this.state.currentStyle);return e&&x.default.Children.only(e)},t}(x.default.Component);t.default=S,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){for(var r=0;r<e.length;r++)if(!b.default(e[r],t[r],n[r]))return!1;return!0}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(257),c=r(l),p=n(164),f=r(p),h=n(259),d=r(h),m=n(231),v=r(m),g=n(239),y=r(g),_=n(258),b=r(_),x=n(0),w=r(x),k=n(1),E=r(k),S=1e3/60,C=function(e){function t(n){var r=this;i(this,t),e.call(this,n),this.animationID=null,this.prevTime=0,this.accumulatedTime=0,this.unreadPropStyles=null,this.clearUnreadPropStyle=function(e){for(var t=r.state,n=t.currentStyles,i=t.currentVelocities,o=t.lastIdealStyles,a=t.lastIdealVelocities,u=!1,l=0;l<e.length;l++){var c=e[l],p=!1;for(var f in c)if(Object.prototype.hasOwnProperty.call(c,f)){var h=c[f];"number"==typeof h&&(p||(p=!0,u=!0,n[l]=s({},n[l]),i[l]=s({},i[l]),o[l]=s({},o[l]),a[l]=s({},a[l])),n[l][f]=h,i[l][f]=0,o[l][f]=h,a[l][f]=0)}}u&&r.setState({currentStyles:n,currentVelocities:i,lastIdealStyles:o,lastIdealVelocities:a})},this.startAnimationIfNecessary=function(){r.animationID=y.default(function(e){var t=r.props.styles(r.state.lastIdealStyles);if(a(r.state.currentStyles,t,r.state.currentVelocities))return r.animationID=null,void(r.accumulatedTime=0);var n=e||v.default(),i=n-r.prevTime;if(r.prevTime=n,r.accumulatedTime=r.accumulatedTime+i,r.accumulatedTime>10*S&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();for(var o=(r.accumulatedTime-Math.floor(r.accumulatedTime/S)*S)/S,s=Math.floor(r.accumulatedTime/S),u=[],l=[],c=[],p=[],f=0;f<t.length;f++){var h=t[f],m={},g={},y={},_={};for(var b in h)if(Object.prototype.hasOwnProperty.call(h,b)){var x=h[b];if("number"==typeof x)m[b]=x,g[b]=0,y[b]=x,_[b]=0;else{for(var w=r.state.lastIdealStyles[f][b],k=r.state.lastIdealVelocities[f][b],E=0;E<s;E++){var C=d.default(S/1e3,w,k,x.val,x.stiffness,x.damping,x.precision);w=C[0],k=C[1]}var A=d.default(S/1e3,w,k,x.val,x.stiffness,x.damping,x.precision),D=A[0],O=A[1];m[b]=w+(D-w)*o,g[b]=k+(O-k)*o,y[b]=w,_[b]=k}}c[f]=m,p[f]=g,u[f]=y,l[f]=_}r.animationID=null,r.accumulatedTime-=s*S,r.setState({currentStyles:c,currentVelocities:p,lastIdealStyles:u,lastIdealVelocities:l}),r.unreadPropStyles=null,r.startAnimationIfNecessary()})},this.state=this.defaultState()}return o(t,e),u(t,null,[{key:"propTypes",value:{defaultStyles:E.default.arrayOf(E.default.objectOf(E.default.number)),styles:E.default.func.isRequired,children:E.default.func.isRequired},enumerable:!0}]),t.prototype.defaultState=function(){var e=this.props,t=e.defaultStyles,n=e.styles,r=t||n().map(f.default),i=r.map(function(e){return c.default(e)});return{currentStyles:r,currentVelocities:i,lastIdealStyles:r,lastIdealVelocities:i}},t.prototype.componentDidMount=function(){this.prevTime=v.default(),this.startAnimationIfNecessary()},t.prototype.componentWillReceiveProps=function(e){null!=this.unreadPropStyles&&this.clearUnreadPropStyle(this.unreadPropStyles),this.unreadPropStyles=e.styles(this.state.lastIdealStyles),null==this.animationID&&(this.prevTime=v.default(),this.startAnimationIfNecessary())},t.prototype.componentWillUnmount=function(){null!=this.animationID&&(y.default.cancel(this.animationID),this.animationID=null)},t.prototype.render=function(){var e=this.props.children(this.state.currentStyles);return e&&w.default.Children.only(e)},t}(w.default.Component);t.default=C,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){var r=t;return null==r?e.map(function(e,t){return{key:e.key,data:e.data,style:n[t]}}):e.map(function(e,t){for(var i=0;i<r.length;i++)if(r[i].key===e.key)return{key:r[i].key,data:r[i].data,style:n[t]};return{key:e.key,data:e.data,style:n[t]}})}function s(e,t,n,r){if(r.length!==t.length)return!1;for(var i=0;i<r.length;i++)if(r[i].key!==t[i].key)return!1;for(var i=0;i<r.length;i++)if(!E.default(e[i],t[i].style,n[i]))return!1;return!0}function u(e,t,n,r,i,o,a,s,u){for(var l=y.default(r,i,function(e,r){var i=t(r);return null==i?(n({key:r.key,data:r.data}),null):E.default(o[e],i,a[e])?(n({key:r.key,data:r.data}),null):{key:r.key,data:r.data,style:i}}),c=[],p=[],h=[],d=[],m=0;m<l.length;m++){for(var v=l[m],g=null,_=0;_<r.length;_++)if(r[_].key===v.key){g=_;break}if(null==g){var b=e(v);c[m]=b,h[m]=b;var x=f.default(v.style);p[m]=x,d[m]=x}else c[m]=o[g],h[m]=s[g],p[m]=a[g],d[m]=u[g]}return[l,c,p,h,d]}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=n(257),f=r(p),h=n(164),d=r(h),m=n(259),v=r(m),g=n(1084),y=r(g),_=n(231),b=r(_),x=n(239),w=r(x),k=n(258),E=r(k),S=n(0),C=r(S),A=n(1),D=r(A),O=1e3/60,M=function(e){function t(n){var r=this;i(this,t),e.call(this,n),this.unmounting=!1,this.animationID=null,this.prevTime=0,this.accumulatedTime=0,this.unreadPropStyles=null,this.clearUnreadPropStyle=function(e){for(var t=u(r.props.willEnter,r.props.willLeave,r.props.didLeave,r.state.mergedPropsStyles,e,r.state.currentStyles,r.state.currentVelocities,r.state.lastIdealStyles,r.state.lastIdealVelocities),n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=0;c<e.length;c++){var p=e[c].style,f=!1;for(var h in p)if(Object.prototype.hasOwnProperty.call(p,h)){var d=p[h];"number"==typeof d&&(f||(f=!0,i[c]=l({},i[c]),o[c]=l({},o[c]),a[c]=l({},a[c]),s[c]=l({},s[c]),n[c]={key:n[c].key,data:n[c].data,style:l({},n[c].style)}),i[c][h]=d,o[c][h]=0,a[c][h]=d,s[c][h]=0,n[c].style[h]=d)}}r.setState({currentStyles:i,currentVelocities:o,mergedPropsStyles:n,lastIdealStyles:a,lastIdealVelocities:s})},this.startAnimationIfNecessary=function(){r.unmounting||(r.animationID=w.default(function(e){if(!r.unmounting){var t=r.props.styles,n="function"==typeof t?t(a(r.state.mergedPropsStyles,r.unreadPropStyles,r.state.lastIdealStyles)):t;if(s(r.state.currentStyles,n,r.state.currentVelocities,r.state.mergedPropsStyles))return r.animationID=null,void(r.accumulatedTime=0);var i=e||b.default(),o=i-r.prevTime;if(r.prevTime=i,r.accumulatedTime=r.accumulatedTime+o,r.accumulatedTime>10*O&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();for(var l=(r.accumulatedTime-Math.floor(r.accumulatedTime/O)*O)/O,c=Math.floor(r.accumulatedTime/O),p=u(r.props.willEnter,r.props.willLeave,r.props.didLeave,r.state.mergedPropsStyles,n,r.state.currentStyles,r.state.currentVelocities,r.state.lastIdealStyles,r.state.lastIdealVelocities),f=p[0],h=p[1],d=p[2],m=p[3],g=p[4],y=0;y<f.length;y++){var _=f[y].style,x={},w={},k={},E={};for(var S in _)if(Object.prototype.hasOwnProperty.call(_,S)){var C=_[S];if("number"==typeof C)x[S]=C,w[S]=0,k[S]=C,E[S]=0;else{for(var A=m[y][S],D=g[y][S],M=0;M<c;M++){var T=v.default(O/1e3,A,D,C.val,C.stiffness,C.damping,C.precision);A=T[0],D=T[1]}var P=v.default(O/1e3,A,D,C.val,C.stiffness,C.damping,C.precision),I=P[0],R=P[1];x[S]=A+(I-A)*l,w[S]=D+(R-D)*l,k[S]=A,E[S]=D}}m[y]=k,g[y]=E,h[y]=x,d[y]=w}r.animationID=null,r.accumulatedTime-=c*O,r.setState({currentStyles:h,currentVelocities:d,lastIdealStyles:m,lastIdealVelocities:g,mergedPropsStyles:f}),r.unreadPropStyles=null,r.startAnimationIfNecessary()}}))},this.state=this.defaultState()}return o(t,e),c(t,null,[{key:"propTypes",value:{defaultStyles:D.default.arrayOf(D.default.shape({key:D.default.string.isRequired,data:D.default.any,style:D.default.objectOf(D.default.number).isRequired})),styles:D.default.oneOfType([D.default.func,D.default.arrayOf(D.default.shape({key:D.default.string.isRequired,data:D.default.any,style:D.default.objectOf(D.default.oneOfType([D.default.number,D.default.object])).isRequired}))]).isRequired,children:D.default.func.isRequired,willEnter:D.default.func,willLeave:D.default.func,didLeave:D.default.func},enumerable:!0},{key:"defaultProps",value:{willEnter:function(e){return d.default(e.style)},willLeave:function(){return null},didLeave:function(){}},enumerable:!0}]),t.prototype.defaultState=function(){var e=this.props,t=e.defaultStyles,n=e.styles,r=e.willEnter,i=e.willLeave,o=e.didLeave,a="function"==typeof n?n(t):n,s=void 0;s=null==t?a:t.map(function(e){for(var t=0;t<a.length;t++)if(a[t].key===e.key)return a[t];return e});var l=null==t?a.map(function(e){return d.default(e.style)}):t.map(function(e){return d.default(e.style)}),c=null==t?a.map(function(e){return f.default(e.style)}):t.map(function(e){return f.default(e.style)}),p=u(r,i,o,s,a,l,c,l,c),h=p[0];return{currentStyles:p[1],currentVelocities:p[2],lastIdealStyles:p[3],lastIdealVelocities:p[4],mergedPropsStyles:h}},t.prototype.componentDidMount=function(){this.prevTime=b.default(),this.startAnimationIfNecessary()},t.prototype.componentWillReceiveProps=function(e){this.unreadPropStyles&&this.clearUnreadPropStyle(this.unreadPropStyles);var t=e.styles;this.unreadPropStyles="function"==typeof t?t(a(this.state.mergedPropsStyles,this.unreadPropStyles,this.state.lastIdealStyles)):t,null==this.animationID&&(this.prevTime=b.default(),this.startAnimationIfNecessary())},t.prototype.componentWillUnmount=function(){this.unmounting=!0,null!=this.animationID&&(w.default.cancel(this.animationID),this.animationID=null)},t.prototype.render=function(){var e=a(this.state.mergedPropsStyles,this.unreadPropStyles,this.state.currentStyles),t=this.props.children(e);return t&&C.default.Children.only(t)},t}(C.default.Component);t.default=M,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){for(var r={},i=0;i<e.length;i++)r[e[i].key]=i;for(var o={},i=0;i<t.length;i++)o[t[i].key]=i;for(var a=[],i=0;i<t.length;i++)a[i]=t[i];for(var i=0;i<e.length;i++)if(!Object.prototype.hasOwnProperty.call(o,e[i].key)){var s=n(i,e[i]);null!=s&&a.push(s)}return a.sort(function(e,n){var i=o[e.key],a=o[n.key],s=r[e.key],u=r[n.key];if(null!=i&&null!=a)return o[e.key]-o[n.key];if(null!=s&&null!=u)return r[e.key]-r[n.key];if(null!=i){for(var l=0;l<t.length;l++){var c=t[l].key;if(Object.prototype.hasOwnProperty.call(r,c)){if(i<o[c]&&u>r[c])return-1;if(i>o[c]&&u<r[c])return 1}}return 1}for(var l=0;l<t.length;l++){var c=t[l].key;if(Object.prototype.hasOwnProperty.call(r,c)){if(a<o[c]&&s>r[c])return 1;if(a>o[c]&&s<r[c])return-1}}return-1})}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e.default:e}t.__esModule=!0;var i=n(1081);t.Motion=r(i);var o=n(1082);t.StaggeredMotion=r(o);var a=n(1083);t.TransitionMotion=r(a);var s=n(1087);t.spring=r(s);var u=n(471);t.presets=r(u);var l=n(164);t.stripStyle=r(l);var c=n(1086);t.reorderKeys=r(c)},function(e,t,n){"use strict";function r(){}t.__esModule=!0,t.default=r;e.exports=t.default},function(e,t,n){"use strict";function r(e,t){return i({},s,t,{val:e})}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=r;var o=n(471),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s=i({},a.default.noWobble,{precision:.01});e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0,t.default=void 0;var s=n(0),u=n(1),l=r(u),c=n(472),p=r(c),f=n(473),h=(r(f),function(e){function t(n,r){i(this,t);var a=o(this,e.call(this,n,r));return a.store=n.store,a}return a(t,e),t.prototype.getChildContext=function(){return{store:this.store}},t.prototype.render=function(){return s.Children.only(this.props.children)},t}(s.Component));t.default=h,h.propTypes={store:p.default.isRequired,children:l.default.element.isRequired},h.childContextTypes={store:p.default.isRequired}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){return e.displayName||e.name||"Component"}function u(e,t){try{return e.apply(t)}catch(e){return A.value=e,A}}function l(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=Boolean(e),f=e||E,d=void 0;d="function"==typeof t?t:t?(0,g.default)(t):S;var v=n||C,y=r.pure,_=void 0===y||y,b=r.withRef,w=void 0!==b&&b,O=_&&v!==C,M=D++;return function(e){function t(e,t,n){var r=v(e,t,n);return r}var n="Connect("+s(e)+")",r=function(r){function s(e,t){i(this,s);var a=o(this,r.call(this,e,t));a.version=M,a.store=e.store||t.store,(0,k.default)(a.store,'Could not find "store" in either the context or props of "'+n+'". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "'+n+'".');var u=a.store.getState();return a.state={storeState:u},a.clearCache(),a}return a(s,r),s.prototype.shouldComponentUpdate=function(){return!_||this.haveOwnPropsChanged||this.hasStoreStateChanged},s.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState(),r=this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n);return r},s.prototype.configureFinalMapState=function(e,t){var n=f(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:f,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):n},s.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch,r=this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n);return r},s.prototype.configureFinalMapDispatch=function(e,t){var n=d(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:d,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):n},s.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return(!this.stateProps||!(0,m.default)(e,this.stateProps))&&(this.stateProps=e,!0)},s.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return(!this.dispatchProps||!(0,m.default)(e,this.dispatchProps))&&(this.dispatchProps=e,!0)},s.prototype.updateMergedPropsIfNeeded=function(){var e=t(this.stateProps,this.dispatchProps,this.props);return!(this.mergedProps&&O&&(0,m.default)(e,this.mergedProps))&&(this.mergedProps=e,!0)},s.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},s.prototype.trySubscribe=function(){l&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},s.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},s.prototype.componentDidMount=function(){this.trySubscribe()},s.prototype.componentWillReceiveProps=function(e){_&&(0,m.default)(e,this.props)||(this.haveOwnPropsChanged=!0)},s.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},s.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},s.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!_||t!==e){if(_&&!this.doStatePropsDependOnOwnProps){var n=u(this.updateStatePropsIfNeeded,this);if(!n)return;n===A&&(this.statePropsPrecalculationError=A.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},s.prototype.getWrappedInstance=function(){return(0,k.default)(w,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},s.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,r=this.haveStatePropsBeenPrecalculated,i=this.statePropsPrecalculationError,o=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,i)throw i;var a=!0,s=!0;_&&o&&(a=n||t&&this.doStatePropsDependOnOwnProps,s=t&&this.doDispatchPropsDependOnOwnProps);var u=!1,l=!1;r?u=!0:a&&(u=this.updateStatePropsIfNeeded()),s&&(l=this.updateDispatchPropsIfNeeded());return!(!!(u||l||t)&&this.updateMergedPropsIfNeeded())&&o?o:(this.renderedElement=w?(0,p.createElement)(e,c({},this.mergedProps,{ref:"wrappedInstance"})):(0,p.createElement)(e,this.mergedProps),this.renderedElement)},s}(p.Component);return r.displayName=n,r.WrappedComponent=e,r.contextTypes={store:h.default},r.propTypes={store:h.default},(0,x.default)(r,e)}}t.__esModule=!0;var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=l;var p=n(0),f=n(472),h=r(f),d=n(1091),m=r(d),v=n(1092),g=r(v),y=n(473),_=(r(y),n(421)),b=(r(_),n(758)),x=r(b),w=n(793),k=r(w),E=function(e){return{}},S=function(e){return{dispatch:e}},C=function(e,t,n){return c({},n,e,t)},A={value:null},D=0},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.connect=t.Provider=void 0;var i=n(1088),o=r(i),a=n(1089),s=r(a);t.Provider=o.default,t.connect=s.default},function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++)if(!i.call(t,n[o])||e[n[o]]!==t[n[o]])return!1;return!0}t.__esModule=!0,t.default=r},function(e,t,n){"use strict";function r(e){return function(t){return(0,i.bindActionCreators)(e,t)}}t.__esModule=!0,t.default=r;var i=n(486)},function(e,t,n){var r=n(1096);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=r(l),p=n(1),f=r(p),h=n(209),d=r(h),m=n(260),v=r(m),g="undefined"!=typeof navigator?navigator.userAgent:"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Safari/537.2",y=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={size:n.props.size},n}return a(t,e),u(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.prefixer,i=e.split,o=e.style,a=this.state.size,u=["Pane",i,n],l=s({},o||{},{flex:1,position:"relative",outline:"none"});return void 0!==a&&("vertical"===i?l.width=a:(l.height=a,l.display="flex"),l.flex="none"),c.default.createElement("div",{className:u.join(" "),style:r.prefix(l)},t)}}]),t}(c.default.Component);y.propTypes={className:f.default.string.isRequired,children:f.default.node.isRequired,prefixer:f.default.instanceOf(d.default).isRequired,size:f.default.oneOfType([f.default.string,f.default.number]),split:f.default.oneOf(["vertical","horizontal"]),style:v.default},y.defaultProps={prefixer:new d.default({userAgent:g})},t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.RESIZER_DEFAULT_CLASSNAME=void 0;var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),l=r(u),c=n(1),p=r(c),f=n(209),h=r(f),d=n(260),m=r(d),v="undefined"!=typeof navigator?navigator.userAgent:"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Safari/537.2",g=t.RESIZER_DEFAULT_CLASSNAME="Resizer",y=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),s(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.onClick,r=e.onDoubleClick,i=e.onMouseDown,o=e.onTouchEnd,a=e.onTouchStart,s=e.prefixer,u=e.resizerClassName,c=e.split,p=e.style,f=[u,c,t];return l.default.createElement("span",{className:f.join(" "),style:s.prefix(p)||{},onMouseDown:function(e){return i(e)},onTouchStart:function(e){e.preventDefault(),a(e)},onTouchEnd:function(e){e.preventDefault(),o(e)},onClick:function(e){n&&(e.preventDefault(),n(e))},onDoubleClick:function(e){r&&(e.preventDefault(),r(e))}})}}]),t}(l.default.Component);y.propTypes={className:p.default.string.isRequired,onClick:p.default.func,onDoubleClick:p.default.func,onMouseDown:p.default.func.isRequired,onTouchStart:p.default.func.isRequired,onTouchEnd:p.default.func.isRequired,prefixer:p.default.instanceOf(h.default).isRequired,split:p.default.oneOf(["vertical","horizontal"]),style:m.default,resizerClassName:p.default.string.isRequired},y.defaultProps={prefixer:new h.default({userAgent:v}),resizerClassName:g},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){if(e.selection)e.selection.empty();else try{t.getSelection().removeAllRanges()}catch(e){}}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),p=r(c),f=n(1),h=r(f),d=n(449),m=r(d),v=n(209),g=r(v),y=n(260),_=r(y),b=n(1094),x=r(b),w=n(1095),k=r(w),E="undefined"!=typeof navigator?navigator.userAgent:"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Safari/537.2",S=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onMouseDown=e.onMouseDown.bind(e),e.onTouchStart=e.onTouchStart.bind(e),e.onMouseMove=e.onMouseMove.bind(e),e.onTouchMove=e.onTouchMove.bind(e),e.onMouseUp=e.onMouseUp.bind(e),e.state={active:!1,resized:!1},e}return a(t,e),l(t,[{key:"componentDidMount",value:function(){this.setSize(this.props,this.state),document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("touchmove",this.onTouchMove)}},{key:"componentWillReceiveProps",value:function(e){this.setSize(e,this.state)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("touchmove",this.onTouchMove)}},{key:"onMouseDown",value:function(e){var t=u({},e,{touches:[{clientX:e.clientX,clientY:e.clientY}]});this.onTouchStart(t)}},{key:"onTouchStart",value:function(e){var t=this.props,n=t.allowResize,r=t.onDragStarted,i=t.split;if(n){s(document,window);var o="vertical"===i?e.touches[0].clientX:e.touches[0].clientY;"function"==typeof r&&r(),this.setState({active:!0,position:o})}}},{key:"onMouseMove",value:function(e){var t=u({},e,{touches:[{clientX:e.clientX,clientY:e.clientY}]});this.onTouchMove(t)}},{key:"onTouchMove",value:function(e){var t=this.props,n=t.allowResize,r=t.maxSize,i=t.minSize,o=t.onChange,a=t.split,u=t.step,l=this.state,c=l.active,p=l.position;if(n&&c){s(document,window);var f="first"===this.props.primary,h=f?this.pane1:this.pane2;if(h){var d=m.default.findDOMNode(h);if(d.getBoundingClientRect){var v=d.getBoundingClientRect().width,g=d.getBoundingClientRect().height,y="vertical"===a?e.touches[0].clientX:e.touches[0].clientY,_="vertical"===a?v:g,b=p-y;if(u){if(Math.abs(b)<u)return;b=~~(b/u)*u}var x=f?b:-b,w=r;if(void 0!==r&&r<=0){var k=this.splitPane;w="vertical"===a?k.getBoundingClientRect().width+r:k.getBoundingClientRect().height+r}var E=_-x,S=p-b;E<i?E=i:void 0!==r&&E>w?E=w:this.setState({position:S,resized:!0}),o&&o(E),this.setState({draggedSize:E}),h.setState({size:E})}}}}},{key:"onMouseUp",value:function(){var e=this.props,t=e.allowResize,n=e.onDragFinished,r=this.state,i=r.active,o=r.draggedSize;t&&i&&("function"==typeof n&&n(o),this.setState({active:!1}))}},{key:"setSize",value:function(e,t){var n=this.props.primary,r="first"===n?this.pane1:this.pane2,i=void 0;r&&(i=e.size||t&&t.draggedSize||e.defaultSize||e.minSize,r.setState({size:i}),e.size!==t.draggedSize&&this.setState({draggedSize:i}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.allowResize,r=t.children,i=t.className,o=t.defaultSize,a=t.minSize,s=t.onResizerClick,l=t.onResizerDoubleClick,c=t.paneClassName,f=t.pane1ClassName,h=t.pane2ClassName,d=t.paneStyle,m=t.pane1Style,v=t.pane2Style,g=t.primary,y=t.prefixer,_=t.resizerClassName,b=t.resizerStyle,E=t.size,S=t.split,C=t.style,A=n?"":"disabled",D=_?_+" "+w.RESIZER_DEFAULT_CLASSNAME:_,O=u({},{display:"flex",flex:1,height:"100%",position:"absolute",outline:"none",overflow:"hidden",MozUserSelect:"text",WebkitUserSelect:"text",msUserSelect:"text",userSelect:"text"},C||{});"vertical"===S?u(O,{flexDirection:"row",left:0,right:0}):u(O,{bottom:0,flexDirection:"column",minHeight:"100%",top:0,width:"100%"});var M=["SplitPane",i,S,A],T=y.prefix(u({},d||{},m||{})),P=y.prefix(u({},d||{},v||{})),I=["Pane1",c,f].join(" "),R=["Pane2",c,h].join(" ");return p.default.createElement("div",{className:M.join(" "),ref:function(t){e.splitPane=t},style:y.prefix(O)},p.default.createElement(x.default,{className:I,key:"pane1",ref:function(t){e.pane1=t},size:"first"===g?E||o||a:void 0,split:S,style:T},r[0]),p.default.createElement(k.default,{className:A,onClick:s,onDoubleClick:l,onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onTouchEnd:this.onMouseUp,key:"resizer",ref:function(t){e.resizer=t},resizerClassName:D,split:S,style:b||{}}),p.default.createElement(x.default,{className:R,key:"pane2",ref:function(t){e.pane2=t},size:"second"===g?E||o||a:void 0,split:S,style:P},r[1]))}}]),t}(p.default.Component);S.propTypes={allowResize:h.default.bool,children:h.default.arrayOf(h.default.node).isRequired,className:h.default.string,primary:h.default.oneOf(["first","second"]),minSize:h.default.oneOfType([h.default.string,h.default.number]),maxSize:h.default.oneOfType([h.default.string,h.default.number]),defaultSize:h.default.oneOfType([h.default.string,h.default.number]),size:h.default.oneOfType([h.default.string,h.default.number]),split:h.default.oneOf(["vertical","horizontal"]),onDragStarted:h.default.func,onDragFinished:h.default.func,onChange:h.default.func,onResizerClick:h.default.func,onResizerDoubleClick:h.default.func,prefixer:h.default.instanceOf(g.default).isRequired,style:_.default,resizerStyle:_.default,paneClassName:h.default.string,pane1ClassName:h.default.string,pane2ClassName:h.default.string,paneStyle:_.default,pane1Style:_.default,pane2Style:_.default,resizerClassName:h.default.string,step:h.default.number},S.defaultProps={allowResize:!0,minSize:50,prefixer:new g.default({userAgent:E}),primary:"first",split:"vertical",paneClassName:"",pane1ClassName:"",pane2ClassName:""},t.default=S,e.exports=t.default},function(e,t){e.exports=["alignContent","MozAlignContent","WebkitAlignContent","MSAlignContent","OAlignContent","alignItems","MozAlignItems","WebkitAlignItems","MSAlignItems","OAlignItems","alignSelf","MozAlignSelf","WebkitAlignSelf","MSAlignSelf","OAlignSelf","all","MozAll","WebkitAll","MSAll","OAll","animation","MozAnimation","WebkitAnimation","MSAnimation","OAnimation","animationDelay","MozAnimationDelay","WebkitAnimationDelay","MSAnimationDelay","OAnimationDelay","animationDirection","MozAnimationDirection","WebkitAnimationDirection","MSAnimationDirection","OAnimationDirection","animationDuration","MozAnimationDuration","WebkitAnimationDuration","MSAnimationDuration","OAnimationDuration","animationFillMode","MozAnimationFillMode","WebkitAnimationFillMode","MSAnimationFillMode","OAnimationFillMode","animationIterationCount","MozAnimationIterationCount","WebkitAnimationIterationCount","MSAnimationIterationCount","OAnimationIterationCount","animationName","MozAnimationName","WebkitAnimationName","MSAnimationName","OAnimationName","animationPlayState","MozAnimationPlayState","WebkitAnimationPlayState","MSAnimationPlayState","OAnimationPlayState","animationTimingFunction","MozAnimationTimingFunction","WebkitAnimationTimingFunction","MSAnimationTimingFunction","OAnimationTimingFunction","backfaceVisibility","MozBackfaceVisibility","WebkitBackfaceVisibility","MSBackfaceVisibility","OBackfaceVisibility","background","MozBackground","WebkitBackground","MSBackground","OBackground","backgroundAttachment","MozBackgroundAttachment","WebkitBackgroundAttachment","MSBackgroundAttachment","OBackgroundAttachment","backgroundBlendMode","MozBackgroundBlendMode","WebkitBackgroundBlendMode","MSBackgroundBlendMode","OBackgroundBlendMode","backgroundClip","MozBackgroundClip","WebkitBackgroundClip","MSBackgroundClip","OBackgroundClip","backgroundColor","MozBackgroundColor","WebkitBackgroundColor","MSBackgroundColor","OBackgroundColor","backgroundImage","MozBackgroundImage","WebkitBackgroundImage","MSBackgroundImage","OBackgroundImage","backgroundOrigin","MozBackgroundOrigin","WebkitBackgroundOrigin","MSBackgroundOrigin","OBackgroundOrigin","backgroundPosition","MozBackgroundPosition","WebkitBackgroundPosition","MSBackgroundPosition","OBackgroundPosition","backgroundRepeat","MozBackgroundRepeat","WebkitBackgroundRepeat","MSBackgroundRepeat","OBackgroundRepeat","backgroundSize","MozBackgroundSize","WebkitBackgroundSize","MSBackgroundSize","OBackgroundSize","blockSize","MozBlockSize","WebkitBlockSize","MSBlockSize","OBlockSize","border","MozBorder","WebkitBorder","MSBorder","OBorder","borderBlockEnd","MozBorderBlockEnd","WebkitBorderBlockEnd","MSBorderBlockEnd","OBorderBlockEnd","borderBlockEndColor","MozBorderBlockEndColor","WebkitBorderBlockEndColor","MSBorderBlockEndColor","OBorderBlockEndColor","borderBlockEndStyle","MozBorderBlockEndStyle","WebkitBorderBlockEndStyle","MSBorderBlockEndStyle","OBorderBlockEndStyle","borderBlockEndWidth","MozBorderBlockEndWidth","WebkitBorderBlockEndWidth","MSBorderBlockEndWidth","OBorderBlockEndWidth","borderBlockStart","MozBorderBlockStart","WebkitBorderBlockStart","MSBorderBlockStart","OBorderBlockStart","borderBlockStartColor","MozBorderBlockStartColor","WebkitBorderBlockStartColor","MSBorderBlockStartColor","OBorderBlockStartColor","borderBlockStartStyle","MozBorderBlockStartStyle","WebkitBorderBlockStartStyle","MSBorderBlockStartStyle","OBorderBlockStartStyle","borderBlockStartWidth","MozBorderBlockStartWidth","WebkitBorderBlockStartWidth","MSBorderBlockStartWidth","OBorderBlockStartWidth","borderBottom","MozBorderBottom","WebkitBorderBottom","MSBorderBottom","OBorderBottom","borderBottomColor","MozBorderBottomColor","WebkitBorderBottomColor","MSBorderBottomColor","OBorderBottomColor","borderBottomLeftRadius","MozBorderBottomLeftRadius","WebkitBorderBottomLeftRadius","MSBorderBottomLeftRadius","OBorderBottomLeftRadius","borderBottomRightRadius","MozBorderBottomRightRadius","WebkitBorderBottomRightRadius","MSBorderBottomRightRadius","OBorderBottomRightRadius","borderBottomStyle","MozBorderBottomStyle","WebkitBorderBottomStyle","MSBorderBottomStyle","OBorderBottomStyle","borderBottomWidth","MozBorderBottomWidth","WebkitBorderBottomWidth","MSBorderBottomWidth","OBorderBottomWidth","borderCollapse","MozBorderCollapse","WebkitBorderCollapse","MSBorderCollapse","OBorderCollapse","borderColor","MozBorderColor","WebkitBorderColor","MSBorderColor","OBorderColor","borderImage","MozBorderImage","WebkitBorderImage","MSBorderImage","OBorderImage","borderImageOutset","MozBorderImageOutset","WebkitBorderImageOutset","MSBorderImageOutset","OBorderImageOutset","borderImageRepeat","MozBorderImageRepeat","WebkitBorderImageRepeat","MSBorderImageRepeat","OBorderImageRepeat","borderImageSlice","MozBorderImageSlice","WebkitBorderImageSlice","MSBorderImageSlice","OBorderImageSlice","borderImageSource","MozBorderImageSource","WebkitBorderImageSource","MSBorderImageSource","OBorderImageSource","borderImageWidth","MozBorderImageWidth","WebkitBorderImageWidth","MSBorderImageWidth","OBorderImageWidth","borderInlineEnd","MozBorderInlineEnd","WebkitBorderInlineEnd","MSBorderInlineEnd","OBorderInlineEnd","borderInlineEndColor","MozBorderInlineEndColor","WebkitBorderInlineEndColor","MSBorderInlineEndColor","OBorderInlineEndColor","borderInlineEndStyle","MozBorderInlineEndStyle","WebkitBorderInlineEndStyle","MSBorderInlineEndStyle","OBorderInlineEndStyle","borderInlineEndWidth","MozBorderInlineEndWidth","WebkitBorderInlineEndWidth","MSBorderInlineEndWidth","OBorderInlineEndWidth","borderInlineStart","MozBorderInlineStart","WebkitBorderInlineStart","MSBorderInlineStart","OBorderInlineStart","borderInlineStartColor","MozBorderInlineStartColor","WebkitBorderInlineStartColor","MSBorderInlineStartColor","OBorderInlineStartColor","borderInlineStartStyle","MozBorderInlineStartStyle","WebkitBorderInlineStartStyle","MSBorderInlineStartStyle","OBorderInlineStartStyle","borderInlineStartWidth","MozBorderInlineStartWidth","WebkitBorderInlineStartWidth","MSBorderInlineStartWidth","OBorderInlineStartWidth","borderLeft","MozBorderLeft","WebkitBorderLeft","MSBorderLeft","OBorderLeft","borderLeftColor","MozBorderLeftColor","WebkitBorderLeftColor","MSBorderLeftColor","OBorderLeftColor","borderLeftStyle","MozBorderLeftStyle","WebkitBorderLeftStyle","MSBorderLeftStyle","OBorderLeftStyle","borderLeftWidth","MozBorderLeftWidth","WebkitBorderLeftWidth","MSBorderLeftWidth","OBorderLeftWidth","borderRadius","MozBorderRadius","WebkitBorderRadius","MSBorderRadius","OBorderRadius","borderRight","MozBorderRight","WebkitBorderRight","MSBorderRight","OBorderRight","borderRightColor","MozBorderRightColor","WebkitBorderRightColor","MSBorderRightColor","OBorderRightColor","borderRightStyle","MozBorderRightStyle","WebkitBorderRightStyle","MSBorderRightStyle","OBorderRightStyle","borderRightWidth","MozBorderRightWidth","WebkitBorderRightWidth","MSBorderRightWidth","OBorderRightWidth","borderSpacing","MozBorderSpacing","WebkitBorderSpacing","MSBorderSpacing","OBorderSpacing","borderStyle","MozBorderStyle","WebkitBorderStyle","MSBorderStyle","OBorderStyle","borderTop","MozBorderTop","WebkitBorderTop","MSBorderTop","OBorderTop","borderTopColor","MozBorderTopColor","WebkitBorderTopColor","MSBorderTopColor","OBorderTopColor","borderTopLeftRadius","MozBorderTopLeftRadius","WebkitBorderTopLeftRadius","MSBorderTopLeftRadius","OBorderTopLeftRadius","borderTopRightRadius","MozBorderTopRightRadius","WebkitBorderTopRightRadius","MSBorderTopRightRadius","OBorderTopRightRadius","borderTopStyle","MozBorderTopStyle","WebkitBorderTopStyle","MSBorderTopStyle","OBorderTopStyle","borderTopWidth","MozBorderTopWidth","WebkitBorderTopWidth","MSBorderTopWidth","OBorderTopWidth","borderWidth","MozBorderWidth","WebkitBorderWidth","MSBorderWidth","OBorderWidth","bottom","MozBottom","WebkitBottom","MSBottom","OBottom","boxDecorationBreak","MozBoxDecorationBreak","WebkitBoxDecorationBreak","MSBoxDecorationBreak","OBoxDecorationBreak","boxShadow","MozBoxShadow","WebkitBoxShadow","MSBoxShadow","OBoxShadow","boxSizing","MozBoxSizing","WebkitBoxSizing","MSBoxSizing","OBoxSizing","breakAfter","MozBreakAfter","WebkitBreakAfter","MSBreakAfter","OBreakAfter","breakBefore","MozBreakBefore","WebkitBreakBefore","MSBreakBefore","OBreakBefore","breakInside","MozBreakInside","WebkitBreakInside","MSBreakInside","OBreakInside","captionSide","MozCaptionSide","WebkitCaptionSide","MSCaptionSide","OCaptionSide","caretColor","MozCaretColor","WebkitCaretColor","MSCaretColor","OCaretColor","ch","MozCh","WebkitCh","MSCh","OCh","clear","MozClear","WebkitClear","MSClear","OClear","clip","MozClip","WebkitClip","MSClip","OClip","clipPath","MozClipPath","WebkitClipPath","MSClipPath","OClipPath","cm","MozCm","WebkitCm","MSCm","OCm","color","MozColor","WebkitColor","MSColor","OColor","columnCount","MozColumnCount","WebkitColumnCount","MSColumnCount","OColumnCount","columnFill","MozColumnFill","WebkitColumnFill","MSColumnFill","OColumnFill","columnGap","MozColumnGap","WebkitColumnGap","MSColumnGap","OColumnGap","columnRule","MozColumnRule","WebkitColumnRule","MSColumnRule","OColumnRule","columnRuleColor","MozColumnRuleColor","WebkitColumnRuleColor","MSColumnRuleColor","OColumnRuleColor","columnRuleStyle","MozColumnRuleStyle","WebkitColumnRuleStyle","MSColumnRuleStyle","OColumnRuleStyle","columnRuleWidth","MozColumnRuleWidth","WebkitColumnRuleWidth","MSColumnRuleWidth","OColumnRuleWidth","columnSpan","MozColumnSpan","WebkitColumnSpan","MSColumnSpan","OColumnSpan","columnWidth","MozColumnWidth","WebkitColumnWidth","MSColumnWidth","OColumnWidth","columns","MozColumns","WebkitColumns","MSColumns","OColumns","content","MozContent","WebkitContent","MSContent","OContent","counterIncrement","MozCounterIncrement","WebkitCounterIncrement","MSCounterIncrement","OCounterIncrement","counterReset","MozCounterReset","WebkitCounterReset","MSCounterReset","OCounterReset","cursor","MozCursor","WebkitCursor","MSCursor","OCursor","deg","MozDeg","WebkitDeg","MSDeg","ODeg","direction","MozDirection","WebkitDirection","MSDirection","ODirection","display","MozDisplay","WebkitDisplay","MSDisplay","ODisplay","dpcm","MozDpcm","WebkitDpcm","MSDpcm","ODpcm","dpi","MozDpi","WebkitDpi","MSDpi","ODpi","dppx","MozDppx","WebkitDppx","MSDppx","ODppx","em","MozEm","WebkitEm","MSEm","OEm","emptyCells","MozEmptyCells","WebkitEmptyCells","MSEmptyCells","OEmptyCells","ex","MozEx","WebkitEx","MSEx","OEx","filter","MozFilter","WebkitFilter","MSFilter","OFilter","flexBasis","MozFlexBasis","WebkitFlexBasis","MSFlexBasis","OFlexBasis","flexDirection","MozFlexDirection","WebkitFlexDirection","MSFlexDirection","OFlexDirection","flexFlow","MozFlexFlow","WebkitFlexFlow","MSFlexFlow","OFlexFlow","flexGrow","MozFlexGrow","WebkitFlexGrow","MSFlexGrow","OFlexGrow","flexShrink","MozFlexShrink","WebkitFlexShrink","MSFlexShrink","OFlexShrink","flexWrap","MozFlexWrap","WebkitFlexWrap","MSFlexWrap","OFlexWrap","float","MozFloat","WebkitFloat","MSFloat","OFloat","font","MozFont","WebkitFont","MSFont","OFont","fontFamily","MozFontFamily","WebkitFontFamily","MSFontFamily","OFontFamily","fontFeatureSettings","MozFontFeatureSettings","WebkitFontFeatureSettings","MSFontFeatureSettings","OFontFeatureSettings","fontKerning","MozFontKerning","WebkitFontKerning","MSFontKerning","OFontKerning","fontLanguageOverride","MozFontLanguageOverride","WebkitFontLanguageOverride","MSFontLanguageOverride","OFontLanguageOverride","fontSize","MozFontSize","WebkitFontSize","MSFontSize","OFontSize","fontSizeAdjust","MozFontSizeAdjust","WebkitFontSizeAdjust","MSFontSizeAdjust","OFontSizeAdjust","fontStretch","MozFontStretch","WebkitFontStretch","MSFontStretch","OFontStretch","fontStyle","MozFontStyle","WebkitFontStyle","MSFontStyle","OFontStyle","fontSynthesis","MozFontSynthesis","WebkitFontSynthesis","MSFontSynthesis","OFontSynthesis","fontVariant","MozFontVariant","WebkitFontVariant","MSFontVariant","OFontVariant","fontVariantAlternates","MozFontVariantAlternates","WebkitFontVariantAlternates","MSFontVariantAlternates","OFontVariantAlternates","fontVariantCaps","MozFontVariantCaps","WebkitFontVariantCaps","MSFontVariantCaps","OFontVariantCaps","fontVariantEastAsian","MozFontVariantEastAsian","WebkitFontVariantEastAsian","MSFontVariantEastAsian","OFontVariantEastAsian","fontVariantLigatures","MozFontVariantLigatures","WebkitFontVariantLigatures","MSFontVariantLigatures","OFontVariantLigatures","fontVariantNumeric","MozFontVariantNumeric","WebkitFontVariantNumeric","MSFontVariantNumeric","OFontVariantNumeric","fontVariantPosition","MozFontVariantPosition","WebkitFontVariantPosition","MSFontVariantPosition","OFontVariantPosition","fontWeight","MozFontWeight","WebkitFontWeight","MSFontWeight","OFontWeight","fr","MozFr","WebkitFr","MSFr","OFr","grad","MozGrad","WebkitGrad","MSGrad","OGrad","grid","MozGrid","WebkitGrid","MSGrid","OGrid","gridArea","MozGridArea","WebkitGridArea","MSGridArea","OGridArea","gridAutoColumns","MozGridAutoColumns","WebkitGridAutoColumns","MSGridAutoColumns","OGridAutoColumns","gridAutoFlow","MozGridAutoFlow","WebkitGridAutoFlow","MSGridAutoFlow","OGridAutoFlow","gridAutoRows","MozGridAutoRows","WebkitGridAutoRows","MSGridAutoRows","OGridAutoRows","gridColumn","MozGridColumn","WebkitGridColumn","MSGridColumn","OGridColumn","gridColumnEnd","MozGridColumnEnd","WebkitGridColumnEnd","MSGridColumnEnd","OGridColumnEnd","gridColumnGap","MozGridColumnGap","WebkitGridColumnGap","MSGridColumnGap","OGridColumnGap","gridColumnStart","MozGridColumnStart","WebkitGridColumnStart","MSGridColumnStart","OGridColumnStart","gridGap","MozGridGap","WebkitGridGap","MSGridGap","OGridGap","gridRow","MozGridRow","WebkitGridRow","MSGridRow","OGridRow","gridRowEnd","MozGridRowEnd","WebkitGridRowEnd","MSGridRowEnd","OGridRowEnd","gridRowGap","MozGridRowGap","WebkitGridRowGap","MSGridRowGap","OGridRowGap","gridRowStart","MozGridRowStart","WebkitGridRowStart","MSGridRowStart","OGridRowStart","gridTemplate","MozGridTemplate","WebkitGridTemplate","MSGridTemplate","OGridTemplate","gridTemplateAreas","MozGridTemplateAreas","WebkitGridTemplateAreas","MSGridTemplateAreas","OGridTemplateAreas","gridTemplateColumns","MozGridTemplateColumns","WebkitGridTemplateColumns","MSGridTemplateColumns","OGridTemplateColumns","gridTemplateRows","MozGridTemplateRows","WebkitGridTemplateRows","MSGridTemplateRows","OGridTemplateRows","height","MozHeight","WebkitHeight","MSHeight","OHeight","hyphens","MozHyphens","WebkitHyphens","MSHyphens","OHyphens","hz","MozHz","WebkitHz","MSHz","OHz","imageOrientation","MozImageOrientation","WebkitImageOrientation","MSImageOrientation","OImageOrientation","imageRendering","MozImageRendering","WebkitImageRendering","MSImageRendering","OImageRendering","imageResolution","MozImageResolution","WebkitImageResolution","MSImageResolution","OImageResolution","imeMode","MozImeMode","WebkitImeMode","MSImeMode","OImeMode","in","MozIn","WebkitIn","MSIn","OIn","inherit","MozInherit","WebkitInherit","MSInherit","OInherit","initial","MozInitial","WebkitInitial","MSInitial","OInitial","inlineSize","MozInlineSize","WebkitInlineSize","MSInlineSize","OInlineSize","isolation","MozIsolation","WebkitIsolation","MSIsolation","OIsolation","justifyContent","MozJustifyContent","WebkitJustifyContent","MSJustifyContent","OJustifyContent","khz","MozKhz","WebkitKhz","MSKhz","OKhz","left","MozLeft","WebkitLeft","MSLeft","OLeft","letterSpacing","MozLetterSpacing","WebkitLetterSpacing","MSLetterSpacing","OLetterSpacing","lineBreak","MozLineBreak","WebkitLineBreak","MSLineBreak","OLineBreak","lineHeight","MozLineHeight","WebkitLineHeight","MSLineHeight","OLineHeight","listStyle","MozListStyle","WebkitListStyle","MSListStyle","OListStyle","listStyleImage","MozListStyleImage","WebkitListStyleImage","MSListStyleImage","OListStyleImage","listStylePosition","MozListStylePosition","WebkitListStylePosition","MSListStylePosition","OListStylePosition","listStyleType","MozListStyleType","WebkitListStyleType","MSListStyleType","OListStyleType","margin","MozMargin","WebkitMargin","MSMargin","OMargin","marginBlockEnd","MozMarginBlockEnd","WebkitMarginBlockEnd","MSMarginBlockEnd","OMarginBlockEnd","marginBlockStart","MozMarginBlockStart","WebkitMarginBlockStart","MSMarginBlockStart","OMarginBlockStart","marginBottom","MozMarginBottom","WebkitMarginBottom","MSMarginBottom","OMarginBottom","marginInlineEnd","MozMarginInlineEnd","WebkitMarginInlineEnd","MSMarginInlineEnd","OMarginInlineEnd","marginInlineStart","MozMarginInlineStart","WebkitMarginInlineStart","MSMarginInlineStart","OMarginInlineStart","marginLeft","MozMarginLeft","WebkitMarginLeft","MSMarginLeft","OMarginLeft","marginRight","MozMarginRight","WebkitMarginRight","MSMarginRight","OMarginRight","marginTop","MozMarginTop","WebkitMarginTop","MSMarginTop","OMarginTop","mask","MozMask","WebkitMask","MSMask","OMask","maskClip","MozMaskClip","WebkitMaskClip","MSMaskClip","OMaskClip","maskComposite","MozMaskComposite","WebkitMaskComposite","MSMaskComposite","OMaskComposite","maskImage","MozMaskImage","WebkitMaskImage","MSMaskImage","OMaskImage","maskMode","MozMaskMode","WebkitMaskMode","MSMaskMode","OMaskMode","maskOrigin","MozMaskOrigin","WebkitMaskOrigin","MSMaskOrigin","OMaskOrigin","maskPosition","MozMaskPosition","WebkitMaskPosition","MSMaskPosition","OMaskPosition","maskRepeat","MozMaskRepeat","WebkitMaskRepeat","MSMaskRepeat","OMaskRepeat","maskSize","MozMaskSize","WebkitMaskSize","MSMaskSize","OMaskSize","maskType","MozMaskType","WebkitMaskType","MSMaskType","OMaskType","maxHeight","MozMaxHeight","WebkitMaxHeight","MSMaxHeight","OMaxHeight","maxWidth","MozMaxWidth","WebkitMaxWidth","MSMaxWidth","OMaxWidth","minBlockSize","MozMinBlockSize","WebkitMinBlockSize","MSMinBlockSize","OMinBlockSize","minHeight","MozMinHeight","WebkitMinHeight","MSMinHeight","OMinHeight","minInlineSize","MozMinInlineSize","WebkitMinInlineSize","MSMinInlineSize","OMinInlineSize","minWidth","MozMinWidth","WebkitMinWidth","MSMinWidth","OMinWidth","mixBlendMode","MozMixBlendMode","WebkitMixBlendMode","MSMixBlendMode","OMixBlendMode","mm","MozMm","WebkitMm","MSMm","OMm","ms","MozMs","WebkitMs","MSMs","OMs","objectFit","MozObjectFit","WebkitObjectFit","MSObjectFit","OObjectFit","objectPosition","MozObjectPosition","WebkitObjectPosition","MSObjectPosition","OObjectPosition","offsetBlockEnd","MozOffsetBlockEnd","WebkitOffsetBlockEnd","MSOffsetBlockEnd","OOffsetBlockEnd","offsetBlockStart","MozOffsetBlockStart","WebkitOffsetBlockStart","MSOffsetBlockStart","OOffsetBlockStart","offsetInlineEnd","MozOffsetInlineEnd","WebkitOffsetInlineEnd","MSOffsetInlineEnd","OOffsetInlineEnd","offsetInlineStart","MozOffsetInlineStart","WebkitOffsetInlineStart","MSOffsetInlineStart","OOffsetInlineStart","opacity","MozOpacity","WebkitOpacity","MSOpacity","OOpacity","order","MozOrder","WebkitOrder","MSOrder","OOrder","orphans","MozOrphans","WebkitOrphans","MSOrphans","OOrphans","outline","MozOutline","WebkitOutline","MSOutline","OOutline","outlineColor","MozOutlineColor","WebkitOutlineColor","MSOutlineColor","OOutlineColor","outlineOffset","MozOutlineOffset","WebkitOutlineOffset","MSOutlineOffset","OOutlineOffset","outlineStyle","MozOutlineStyle","WebkitOutlineStyle","MSOutlineStyle","OOutlineStyle","outlineWidth","MozOutlineWidth","WebkitOutlineWidth","MSOutlineWidth","OOutlineWidth","overflow","MozOverflow","WebkitOverflow","MSOverflow","OOverflow","overflowWrap","MozOverflowWrap","WebkitOverflowWrap","MSOverflowWrap","OOverflowWrap","overflowX","MozOverflowX","WebkitOverflowX","MSOverflowX","OOverflowX","overflowY","MozOverflowY","WebkitOverflowY","MSOverflowY","OOverflowY","padding","MozPadding","WebkitPadding","MSPadding","OPadding","paddingBlockEnd","MozPaddingBlockEnd","WebkitPaddingBlockEnd","MSPaddingBlockEnd","OPaddingBlockEnd","paddingBlockStart","MozPaddingBlockStart","WebkitPaddingBlockStart","MSPaddingBlockStart","OPaddingBlockStart","paddingBottom","MozPaddingBottom","WebkitPaddingBottom","MSPaddingBottom","OPaddingBottom","paddingInlineEnd","MozPaddingInlineEnd","WebkitPaddingInlineEnd","MSPaddingInlineEnd","OPaddingInlineEnd","paddingInlineStart","MozPaddingInlineStart","WebkitPaddingInlineStart","MSPaddingInlineStart","OPaddingInlineStart","paddingLeft","MozPaddingLeft","WebkitPaddingLeft","MSPaddingLeft","OPaddingLeft","paddingRight","MozPaddingRight","WebkitPaddingRight","MSPaddingRight","OPaddingRight","paddingTop","MozPaddingTop","WebkitPaddingTop","MSPaddingTop","OPaddingTop","pageBreakAfter","MozPageBreakAfter","WebkitPageBreakAfter","MSPageBreakAfter","OPageBreakAfter","pageBreakBefore","MozPageBreakBefore","WebkitPageBreakBefore","MSPageBreakBefore","OPageBreakBefore","pageBreakInside","MozPageBreakInside","WebkitPageBreakInside","MSPageBreakInside","OPageBreakInside","pc","MozPc","WebkitPc","MSPc","OPc","perspective","MozPerspective","WebkitPerspective","MSPerspective","OPerspective","perspectiveOrigin","MozPerspectiveOrigin","WebkitPerspectiveOrigin","MSPerspectiveOrigin","OPerspectiveOrigin","pointerEvents","MozPointerEvents","WebkitPointerEvents","MSPointerEvents","OPointerEvents","position","MozPosition","WebkitPosition","MSPosition","OPosition","pt","MozPt","WebkitPt","MSPt","OPt","px","MozPx","WebkitPx","MSPx","OPx","q","MozQ","WebkitQ","MSQ","OQ","quotes","MozQuotes","WebkitQuotes","MSQuotes","OQuotes","rad","MozRad","WebkitRad","MSRad","ORad","rem","MozRem","WebkitRem","MSRem","ORem","resize","MozResize","WebkitResize","MSResize","OResize","revert","MozRevert","WebkitRevert","MSRevert","ORevert","right","MozRight","WebkitRight","MSRight","ORight","rubyAlign","MozRubyAlign","WebkitRubyAlign","MSRubyAlign","ORubyAlign","rubyMerge","MozRubyMerge","WebkitRubyMerge","MSRubyMerge","ORubyMerge","rubyPosition","MozRubyPosition","WebkitRubyPosition","MSRubyPosition","ORubyPosition","s","MozS","WebkitS","MSS","OS","scrollBehavior","MozScrollBehavior","WebkitScrollBehavior","MSScrollBehavior","OScrollBehavior","scrollSnapCoordinate","MozScrollSnapCoordinate","WebkitScrollSnapCoordinate","MSScrollSnapCoordinate","OScrollSnapCoordinate","scrollSnapDestination","MozScrollSnapDestination","WebkitScrollSnapDestination","MSScrollSnapDestination","OScrollSnapDestination","scrollSnapType","MozScrollSnapType","WebkitScrollSnapType","MSScrollSnapType","OScrollSnapType","shapeImageThreshold","MozShapeImageThreshold","WebkitShapeImageThreshold","MSShapeImageThreshold","OShapeImageThreshold","shapeMargin","MozShapeMargin","WebkitShapeMargin","MSShapeMargin","OShapeMargin","shapeOutside","MozShapeOutside","WebkitShapeOutside","MSShapeOutside","OShapeOutside","tabSize","MozTabSize","WebkitTabSize","MSTabSize","OTabSize","tableLayout","MozTableLayout","WebkitTableLayout","MSTableLayout","OTableLayout","textAlign","MozTextAlign","WebkitTextAlign","MSTextAlign","OTextAlign","textAlignLast","MozTextAlignLast","WebkitTextAlignLast","MSTextAlignLast","OTextAlignLast","textCombineUpright","MozTextCombineUpright","WebkitTextCombineUpright","MSTextCombineUpright","OTextCombineUpright","textDecoration","MozTextDecoration","WebkitTextDecoration","MSTextDecoration","OTextDecoration","textDecorationColor","MozTextDecorationColor","WebkitTextDecorationColor","MSTextDecorationColor","OTextDecorationColor","textDecorationLine","MozTextDecorationLine","WebkitTextDecorationLine","MSTextDecorationLine","OTextDecorationLine","textDecorationStyle","MozTextDecorationStyle","WebkitTextDecorationStyle","MSTextDecorationStyle","OTextDecorationStyle","textEmphasis","MozTextEmphasis","WebkitTextEmphasis","MSTextEmphasis","OTextEmphasis","textEmphasisColor","MozTextEmphasisColor","WebkitTextEmphasisColor","MSTextEmphasisColor","OTextEmphasisColor","textEmphasisPosition","MozTextEmphasisPosition","WebkitTextEmphasisPosition","MSTextEmphasisPosition","OTextEmphasisPosition","textEmphasisStyle","MozTextEmphasisStyle","WebkitTextEmphasisStyle","MSTextEmphasisStyle","OTextEmphasisStyle","textIndent","MozTextIndent","WebkitTextIndent","MSTextIndent","OTextIndent","textOrientation","MozTextOrientation","WebkitTextOrientation","MSTextOrientation","OTextOrientation","textOverflow","MozTextOverflow","WebkitTextOverflow","MSTextOverflow","OTextOverflow","textRendering","MozTextRendering","WebkitTextRendering","MSTextRendering","OTextRendering","textShadow","MozTextShadow","WebkitTextShadow","MSTextShadow","OTextShadow","textTransform","MozTextTransform","WebkitTextTransform","MSTextTransform","OTextTransform","textUnderlinePosition","MozTextUnderlinePosition","WebkitTextUnderlinePosition","MSTextUnderlinePosition","OTextUnderlinePosition","top","MozTop","WebkitTop","MSTop","OTop","touchAction","MozTouchAction","WebkitTouchAction","MSTouchAction","OTouchAction","transform","MozTransform","WebkitTransform","msTransform","OTransform","transformBox","MozTransformBox","WebkitTransformBox","MSTransformBox","OTransformBox","transformOrigin","MozTransformOrigin","WebkitTransformOrigin","MSTransformOrigin","OTransformOrigin","transformStyle","MozTransformStyle","WebkitTransformStyle","MSTransformStyle","OTransformStyle","transition","MozTransition","WebkitTransition","MSTransition","OTransition","transitionDelay","MozTransitionDelay","WebkitTransitionDelay","MSTransitionDelay","OTransitionDelay","transitionDuration","MozTransitionDuration","WebkitTransitionDuration","MSTransitionDuration","OTransitionDuration","transitionProperty","MozTransitionProperty","WebkitTransitionProperty","MSTransitionProperty","OTransitionProperty","transitionTimingFunction","MozTransitionTimingFunction","WebkitTransitionTimingFunction","MSTransitionTimingFunction","OTransitionTimingFunction","turn","MozTurn","WebkitTurn","MSTurn","OTurn","unicodeBidi","MozUnicodeBidi","WebkitUnicodeBidi","MSUnicodeBidi","OUnicodeBidi","unset","MozUnset","WebkitUnset","MSUnset","OUnset","verticalAlign","MozVerticalAlign","WebkitVerticalAlign","MSVerticalAlign","OVerticalAlign","vh","MozVh","WebkitVh","MSVh","OVh","visibility","MozVisibility","WebkitVisibility","MSVisibility","OVisibility","vmax","MozVmax","WebkitVmax","MSVmax","OVmax","vmin","MozVmin","WebkitVmin","MSVmin","OVmin","vw","MozVw","WebkitVw","MSVw","OVw","whiteSpace","MozWhiteSpace","WebkitWhiteSpace","MSWhiteSpace","OWhiteSpace","widows","MozWidows","WebkitWidows","MSWidows","OWidows","width","MozWidth","WebkitWidth","MSWidth","OWidth","willChange","MozWillChange","WebkitWillChange","MSWillChange","OWillChange","wordBreak","MozWordBreak","WebkitWordBreak","MSWordBreak","OWordBreak","wordSpacing","MozWordSpacing","WebkitWordSpacing","MSWordSpacing","OWordSpacing","wordWrap","MozWordWrap","WebkitWordWrap","MSWordWrap","OWordWrap","writingMode","MozWritingMode","WebkitWritingMode","MSWritingMode","OWritingMode","zIndex","MozZIndex","WebkitZIndex","MSZIndex","OZIndex","fontSize","MozFontSize","WebkitFontSize","MSFontSize","OFontSize","flex","MozFlex","WebkitFlex","MSFlex","OFlex","fr","MozFr","WebkitFr","MSFr","OFr","overflowScrolling","MozOverflowScrolling","WebkitOverflowScrolling","MSOverflowScrolling","OOverflowScrolling"]},function(e,t,n){"use strict";function r(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function i(e){var t=/(=0|=2)/g,n={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(t,function(e){return n[e]})}var o={escape:r,unescape:i};e.exports=o},function(e,t,n){"use strict";var r=n(126),i=(n(8),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),o=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,e,t,n),i}return new r(e,t,n)},s=function(e,t,n,r){var i=this;if(i.instancePool.length){var o=i.instancePool.pop();return i.call(o,e,t,n,r),o}return new i(e,t,n,r)},u=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},l=i,c=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||l,n.poolSize||(n.poolSize=10),n.release=u,n},p={addPoolingTo:c,oneArgumentPooler:i,twoArgumentPooler:o,threeArgumentPooler:a,fourArgumentPooler:s};e.exports=p},function(e,t,n){"use strict";function r(e){return(""+e).replace(b,"$&/")}function i(e,t){this.func=e,this.context=t,this.count=0}function o(e,t,n){var r=e.func,i=e.context;r.call(i,t,e.count++)}function a(e,t,n){if(null==e)return e;var r=i.getPooled(t,n);g(e,o,r),i.release(r)}function s(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function u(e,t,n){var i=e.result,o=e.keyPrefix,a=e.func,s=e.context,u=a.call(s,t,e.count++);Array.isArray(u)?l(u,i,n,v.thatReturnsArgument):null!=u&&(m.isValidElement(u)&&(u=m.cloneAndReplaceKey(u,o+(!u.key||t&&t.key===u.key?"":r(u.key)+"/")+n)),i.push(u))}function l(e,t,n,i,o){var a="";null!=n&&(a=r(n)+"/");var l=s.getPooled(t,a,i,o);g(e,u,l),s.release(l)}function c(e,t,n){if(null==e)return e;var r=[];return l(e,r,null,t,n),r}function p(e,t,n){return null}function f(e,t){return g(e,p,null)}function h(e){var t=[];return l(e,t,null,v.thatReturnsArgument),t}var d=n(1099),m=n(93),v=n(32),g=n(1109),y=d.twoArgumentPooler,_=d.fourArgumentPooler,b=/\/+/g;i.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},d.addPoolingTo(i,y),s.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},d.addPoolingTo(s,_);var x={forEach:a,map:c,mapIntoWithKeyPrefixInternal:l,count:f,toArray:h};e.exports=x},function(e,t,n){"use strict";var r=n(93),i=r.createFactory,o={a:i("a"),abbr:i("abbr"),address:i("address"),area:i("area"),article:i("article"),aside:i("aside"),audio:i("audio"),b:i("b"),base:i("base"),bdi:i("bdi"),bdo:i("bdo"),big:i("big"),blockquote:i("blockquote"),body:i("body"),br:i("br"),button:i("button"),canvas:i("canvas"),caption:i("caption"),cite:i("cite"),code:i("code"),col:i("col"),colgroup:i("colgroup"),data:i("data"),datalist:i("datalist"),dd:i("dd"),del:i("del"),details:i("details"),dfn:i("dfn"),dialog:i("dialog"),div:i("div"),dl:i("dl"),dt:i("dt"),em:i("em"),embed:i("embed"),fieldset:i("fieldset"),figcaption:i("figcaption"),figure:i("figure"),footer:i("footer"),form:i("form"),h1:i("h1"),h2:i("h2"),h3:i("h3"),h4:i("h4"),h5:i("h5"),h6:i("h6"),head:i("head"),header:i("header"),hgroup:i("hgroup"),hr:i("hr"),html:i("html"),i:i("i"),iframe:i("iframe"),img:i("img"),input:i("input"),ins:i("ins"),kbd:i("kbd"),keygen:i("keygen"),label:i("label"),legend:i("legend"),li:i("li"),link:i("link"),main:i("main"),map:i("map"),mark:i("mark"),menu:i("menu"),menuitem:i("menuitem"),meta:i("meta"),meter:i("meter"),nav:i("nav"),noscript:i("noscript"),object:i("object"),ol:i("ol"),optgroup:i("optgroup"),option:i("option"),output:i("output"),p:i("p"),param:i("param"),picture:i("picture"),pre:i("pre"),progress:i("progress"),q:i("q"),rp:i("rp"),rt:i("rt"),ruby:i("ruby"),s:i("s"),samp:i("samp"),script:i("script"),section:i("section"),select:i("select"),small:i("small"),source:i("source"),span:i("span"),strong:i("strong"),style:i("style"),sub:i("sub"),summary:i("summary"),sup:i("sup"),table:i("table"),tbody:i("tbody"),td:i("td"),textarea:i("textarea"),tfoot:i("tfoot"),th:i("th"),thead:i("thead"),time:i("time"),title:i("title"),tr:i("tr"),track:i("track"),u:i("u"),ul:i("ul"),var:i("var"),video:i("video"),wbr:i("wbr"),circle:i("circle"),clipPath:i("clipPath"),defs:i("defs"),ellipse:i("ellipse"),g:i("g"),image:i("image"),line:i("line"),linearGradient:i("linearGradient"),mask:i("mask"),path:i("path"),pattern:i("pattern"),polygon:i("polygon"),polyline:i("polyline"),radialGradient:i("radialGradient"),rect:i("rect"),stop:i("stop"),svg:i("svg"),text:i("text"),tspan:i("tspan")};e.exports=o},function(e,t,n){"use strict";var r=n(93),i=r.isValidElement,o=n(443);e.exports=o(i)},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(474),i=r.Component,o=n(93),a=o.isValidElement,s=n(477),u=n(694);e.exports=u(i,a,s)},function(e,t,n){"use strict";function r(e){var t=e&&(i&&e[i]||e[o]);if("function"==typeof t)return t}var i="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=r},function(e,t,n){"use strict";function r(){return i++}var i=1;e.exports=r},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return o.isValidElement(e)||i("143"),e}var i=n(126),o=n(93);n(8);e.exports=r},function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?l.escape(e.key):t.toString(36)}function i(e,t,n,o){var f=typeof e;if("undefined"!==f&&"boolean"!==f||(e=null),null===e||"string"===f||"number"===f||"object"===f&&e.$$typeof===s)return n(o,e,""===t?c+r(e,0):t),1;var h,d,m=0,v=""===t?c:t+p;if(Array.isArray(e))for(var g=0;g<e.length;g++)h=e[g],d=v+r(h,g),m+=i(h,d,n,o);else{var y=u(e);if(y){var _,b=y.call(e);if(y!==e.entries)for(var x=0;!(_=b.next()).done;)h=_.value,d=v+r(h,x++),m+=i(h,d,n,o);else for(;!(_=b.next()).done;){var w=_.value;w&&(h=w[1],d=v+l.escape(w[0])+p+r(h,0),m+=i(h,d,n,o))}}else if("object"===f){var k="",E=String(e);a("31","[object Object]"===E?"object with keys {"+Object.keys(e).join(", ")+"}":E,k)}}return m}function o(e,t,n){return null==e?0:i(e,"",t,n)}var a=n(126),s=(n(52),n(476)),u=n(1105),l=(n(8),n(1098)),c=(n(10),"."),p=":";e.exports=o},function(e,t,n){e.exports=n(71)},function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);i.call(this,e)}e.exports=r;var i=n(480),o=n(111);o.inherits=n(42),o.inherits(r,i),r.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,n){e.copy(t,n)}var o=n(167).Buffer;e.exports=function(){function e(){r(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var t=o.allocUnsafe(e>>>0),n=this.head,r=0;n;)i(n.data,t,r),r+=n.data.length,n=n.next;return t},e}()},function(e,t,n){e.exports=n(262).PassThrough},function(e,t,n){e.exports=n(262).Transform},function(e,t,n){e.exports=n(261)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(1119);t.default=function(e){var t=Object.keys(e);return function(){var n=arguments.length<=0||void 0===arguments[0]?i.default.Map():arguments[0],r=arguments[1];return n.withMutations(function(n){t.forEach(function(t){var i=e[t],a=n.get(t),s=i(a,r);(0,o.validateNextState)(s,t,r),n.set(t,s)})})}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineReducers=void 0;var r=n(1116),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.combineReducers=i.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),o=r(i),a=n(483),s=r(a);t.default=function(e,t,n){var r=Object.keys(t);if(!r.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";var i=(0,s.default)(n);if(!o.default.Iterable.isIterable(e))return"The "+i+' is of unexpected type. Expected argument to be an instance of Immutable.Iterable with the following properties: "'+r.join('", "')+'".';var a=e.keySeq().toArray().filter(function(e){return!t.hasOwnProperty(e)});return a.length>0?"Unexpected "+(1===a.length?"property":"properties")+' "'+a.join('", "')+'" found in '+i+'. Expected to find one of the known reducer property names instead: "'+r.join('", "')+'". Unexpected properties will be ignored.':null},e.exports=t.default},function(e,t,n){"use strict";"create index";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.validateNextState=t.getUnexpectedInvocationParameterMessage=t.getStateName=void 0;var i=n(483),o=r(i),a=n(1118),s=r(a),u=n(1120),l=r(u);t.getStateName=o.default,t.getUnexpectedInvocationParameterMessage=s.default,t.validateNextState=l.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(void 0===e)throw new Error('Reducer "'+t+'" returned undefined when handling "'+n.type+'" action. To ignore an action, you must explicitly return the previous state.');return null},e.exports=t.default},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,a){var s=e(n,r,a),u=s.dispatch,l=[],c={getState:s.getState,dispatch:function(e){return u(e)}};return l=t.map(function(e){return e(c)}),u=i.a.apply(void 0,l)(s.dispatch),o({},s,{dispatch:u})}}}t.a=r;var i=n(484),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";function r(e,t){return function(){return t(e.apply(void 0,arguments))}}function i(e,t){if("function"==typeof e)return r(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),i={},o=0;o<n.length;o++){var a=n[o],s=e[a];"function"==typeof s&&(i[a]=r(s,t))}return i}t.a=i},function(e,t,n){"use strict";function r(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function i(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:a.b.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+a.b.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}function o(e){for(var t=Object.keys(e),n={},o=0;o<t.length;o++){var a=t[o];"function"==typeof e[a]&&(n[a]=e[a])}var s=Object.keys(n),u=void 0;try{i(n)}catch(e){u=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(u)throw u;for(var i=!1,o={},a=0;a<s.length;a++){var l=s[a],c=n[l],p=e[l],f=c(p,t);if(void 0===f){var h=r(l,t);throw new Error(h)}o[l]=f,i=i||f!==p}return i?o:e}}t.a=o;var a=n(485);n(391),n(487)},function(e,t,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(1125),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";function n(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,a=Object.create(o.prototype),s=new h(r||[]);return a._invoke=l(e,n,s),a}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function o(){}function a(){}function s(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function u(e){function t(n,i,o,a){var s=r(e[n],e,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&y.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):Promise.resolve(l).then(function(e){u.value=e,o(u)},a)}a(s.arg)}function n(e,n){function r(){return new Promise(function(r,i){t(e,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function l(e,t,n){var i=S;return function(o,a){if(i===A)throw new Error("Generator is already running");if(i===D){if("throw"===o)throw a;return m()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=c(s,n);if(u){if(u===O)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===S)throw i=D,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=A;var l=r(e,t,n);if("normal"===l.type){if(i=n.done?D:C,l.arg===O)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=D,n.method="throw",n.arg=l.arg)}}}function c(e,t){var n=e.iterator[t.method];if(n===v){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=v,c(e,t),"throw"===t.method))return O;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,O;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=v),t.delegate=null,O):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O)}function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function f(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function h(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(p,this),this.reset(!0)}function d(e){if(e){var t=e[b];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(y.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=v,t.done=!0,t};return r.next=r}}return{next:m}}function m(){return{value:v,done:!0}}var v,g=Object.prototype,y=g.hasOwnProperty,_="function"==typeof Symbol?Symbol:{},b=_.iterator||"@@iterator",x=_.asyncIterator||"@@asyncIterator",w=_.toStringTag||"@@toStringTag",k="object"==typeof e,E=t.regeneratorRuntime;if(E)return void(k&&(e.exports=E));E=t.regeneratorRuntime=k?e.exports:{},E.wrap=n;var S="suspendedStart",C="suspendedYield",A="executing",D="completed",O={},M={};M[b]=function(){return this};var T=Object.getPrototypeOf,P=T&&T(T(d([])));P&&P!==g&&y.call(P,b)&&(M=P);var I=a.prototype=i.prototype=Object.create(M);o.prototype=I.constructor=a,a.constructor=o,a[w]=o.displayName="GeneratorFunction",E.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===o||"GeneratorFunction"===(t.displayName||t.name))},E.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,w in e||(e[w]="GeneratorFunction")),e.prototype=Object.create(I),e},E.awrap=function(e){return{__await:e}},s(u.prototype),u.prototype[x]=function(){return this},E.AsyncIterator=u,E.async=function(e,t,r,i){var o=new u(n(e,t,r,i));return E.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},s(I),I[w]="Generator",I[b]=function(){return this},I.toString=function(){return"[object Generator]"},E.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},E.values=d,h.prototype={constructor:h,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(f),!e)for(var t in this)"t"===t.charAt(0)&&y.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=v)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,r){return o.type="throw",o.arg=e,n.next=t,r&&(n.method="next",n.arg=v),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,O):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),O},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),f(n),O}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;f(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=v),O}}}(function(){return this}()||Function("return this")())},function(e,t,n){"use strict";e.exports=n(1133)},function(e,t,n){"use strict";var r={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach(function(e){r[e]=!0}),e.exports=r},function(e,t,n){"use strict";function r(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,e=e.replace(r,i),n):new RegExp(e,t)}}var i=/[a-zA-Z_:][a-zA-Z0-9:._-]*/,o=/[^"'=<>`\x00-\x20]+/,a=/'[^']*'/,s=/"[^"]*"/,u=r(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",o)("single_quoted",a)("double_quoted",s)(),l=r(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",i)("attr_value",u)(),c=r(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",l)(),p=/<\/[A-Za-z][A-Za-z0-9]*\s*>/,f=/<!--([^-]+|[-][^-]+)*-->/,h=/<[?].*?[?]>/,d=/<![A-Z]+\s+[^>]*>/,m=/<!\[CDATA\[([^\]]+|\][^\]]|\]\][^>])*\]\]>/,v=r(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",c)("close_tag",p)("comment",f)("processing",h)("declaration",d)("cdata",m)();e.exports.HTML_TAG_RE=v},function(e,t,n){"use strict";e.exports=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"]},function(e,t,n){"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","linkify","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}}},function(e,t,n){"use strict";function r(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function i(e,t){"string"!=typeof e&&(t=e,e="default"),this.inline=new l,this.block=new u,this.core=new s,this.renderer=new a,this.ruler=new c,this.options={},this.configure(p[e]),this.set(t||{})}var o=n(26).assign,a=n(1137),s=n(1135),u=n(1134),l=n(1136),c=n(166),p={default:n(1131),full:n(1132),commonmark:n(1130)};i.prototype.set=function(e){o(this.options,e)},i.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enable(e.components[n].rules,!0)})},i.prototype.use=function(e,t){return e(this,t),this},i.prototype.parse=function(e,t){var n=new r(this,e,t);return this.core.process(n),n.tokens},i.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},i.prototype.parseInline=function(e,t){var n=new r(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},i.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=i,e.exports.utils=n(26)},function(e,t,n){"use strict";function r(){this.ruler=new i;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1],{alt:(a[e][2]||[]).slice()})}var i=n(166),o=n(1150),a=[["code",n(1140)],["fences",n(1142),["paragraph","blockquote","list"]],["blockquote",n(1139),["paragraph","blockquote","list"]],["hr",n(1145),["paragraph","blockquote","list"]],["list",n(1148),["paragraph","blockquote"]],["footnote",n(1143),["paragraph"]],["heading",n(1144),["paragraph","blockquote"]],["lheading",n(1147)],["htmlblock",n(1146),["paragraph","blockquote"]],["table",n(1151),["paragraph"]],["deflist",n(1141),["paragraph"]],["paragraph",n(1149)]];r.prototype.tokenize=function(e,t,n){for(var r,i=this.ruler.getRules(""),o=i.length,a=t,s=!1;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n))&&!(e.tShift[a]<e.blkIndent);){for(r=0;r<o&&!i[r](e,a,n,!1);r++);if(e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),(a=e.line)<n&&e.isEmpty(a)){if(s=!0,++a<n&&"list"===e.parentType&&e.isEmpty(a))break;e.line=a}}};var s=/[\n\t]/g,u=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,l=/\u00a0/g;r.prototype.parse=function(e,t,n,r){var i,a=0,c=0;if(!e)return[];e=e.replace(l," "),e=e.replace(u,"\n"),e.indexOf("\t")>=0&&(e=e.replace(s,function(t,n){var r;return 10===e.charCodeAt(n)?(a=n+1,c=0,t):(r=" ".slice((n-a-c)%4),c=n-a+1,r)})),i=new o(e,this,t,n,r),this.tokenize(i,i.line,i.lineMax)},e.exports=r},function(e,t,n){"use strict";function r(){this.options={},this.ruler=new i;for(var e=0;e<o.length;e++)this.ruler.push(o[e][0],o[e][1])}var i=n(166),o=[["block",n(1154)],["abbr",n(1152)],["references",n(1158)],["inline",n(1156)],["footnote_tail",n(1155)],["abbr2",n(1153)],["replacements",n(1159)],["smartquotes",n(1160)],["linkify",n(1157)]];r.prototype.process=function(e){var t,n,r;for(r=this.ruler.getRules(""),t=0,n=r.length;t<n;t++)r[t](e)},e.exports=r},function(e,t,n){"use strict";function r(){this.ruler=new o;for(var e=0;e<u.length;e++)this.ruler.push(u[e][0],u[e][1]);this.validateLink=i}function i(e){var t=["vbscript","javascript","file","data"],n=e.trim().toLowerCase();return n=s.replaceEntities(n),-1===n.indexOf(":")||-1===t.indexOf(n.split(":")[0])}var o=n(166),a=n(263),s=n(26),u=[["text",n(1176)],["newline",n(1173)],["escape",n(1166)],["backticks",n(1162)],["del",n(1163)],["ins",n(1170)],["mark",n(1172)],["emphasis",n(1164)],["sub",n(1174)],["sup",n(1175)],["links",n(1171)],["footnote_inline",n(1167)],["footnote_ref",n(1168)],["autolink",n(1161)],["htmltag",n(1169)],["entity",n(1165)]];r.prototype.skipToken=function(e){var t,n,r=this.ruler.getRules(""),i=r.length,o=e.pos;if((n=e.cacheGet(o))>0)return void(e.pos=n);for(t=0;t<i;t++)if(r[t](e,!0))return void e.cacheSet(o,e.pos);e.pos++,e.cacheSet(o,e.pos)},r.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),i=r.length,o=e.posMax;e.pos<o;){for(n=0;n<i&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},r.prototype.parse=function(e,t,n,r){var i=new a(e,this,t,n,r);this.tokenize(i)},e.exports=r},function(e,t,n){"use strict";function r(){this.rules=i.assign({},o),this.getBreak=o.getBreak}var i=n(26),o=n(1138);e.exports=r,r.prototype.renderInline=function(e,t,n){for(var r=this.rules,i=e.length,o=0,a="";i--;)a+=r[e[o].type](e,o++,t,n,this);return a},r.prototype.render=function(e,t,n){for(var r=this.rules,i=e.length,o=-1,a="";++o<i;)"inline"===e[o].type?a+=this.renderInline(e[o].children,t,n):a+=r[e[o].type](e,o,t,n,this);return a}},function(e,t,n){"use strict";function r(e,t){return++t>=e.length-2?t:"paragraph_open"===e[t].type&&e[t].tight&&"inline"===e[t+1].type&&0===e[t+1].content.length&&"paragraph_close"===e[t+2].type&&e[t+2].tight?r(e,t+2):t}var i=n(26).has,o=n(26).unescapeMd,a=n(26).replaceEntities,s=n(26).escapeHtml,u={};u.blockquote_open=function(){return"<blockquote>\n"},u.blockquote_close=function(e,t){return"</blockquote>"+l(e,t)},u.code=function(e,t){return e[t].block?"<pre><code>"+s(e[t].content)+"</code></pre>"+l(e,t):"<code>"+s(e[t].content)+"</code>"},u.fence=function(e,t,n,r,u){var c,p,f,h=e[t],d="",m=n.langPrefix,v="";if(h.params){if(c=h.params.split(/\s+/g),p=c.join(" "),i(u.rules.fence_custom,c[0]))return u.rules.fence_custom[c[0]](e,t,n,r,u);v=s(a(o(p))),d=' class="'+m+v+'"'}return f=n.highlight?n.highlight.apply(n.highlight,[h.content].concat(c))||s(h.content):s(h.content),"<pre><code"+d+">"+f+"</code></pre>"+l(e,t)},u.fence_custom={},u.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},u.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},u.hr=function(e,t,n){return(n.xhtmlOut?"<hr />":"<hr>")+l(e,t)},u.bullet_list_open=function(){return"<ul>\n"},u.bullet_list_close=function(e,t){return"</ul>"+l(e,t)},u.list_item_open=function(){return"<li>"},u.list_item_close=function(){return"</li>\n"},u.ordered_list_open=function(e,t){var n=e[t];return"<ol"+(n.order>1?' start="'+n.order+'"':"")+">\n"},u.ordered_list_close=function(e,t){return"</ol>"+l(e,t)},u.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},u.paragraph_close=function(e,t){var n=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"</p>")+(n?l(e,t):"")},u.link_open=function(e,t,n){var r=e[t].title?' title="'+s(a(e[t].title))+'"':"",i=n.linkTarget?' target="'+n.linkTarget+'"':"";return'<a href="'+s(e[t].href)+'"'+r+i+">"},u.link_close=function(){return"</a>"},u.image=function(e,t,n){var r=' src="'+s(e[t].src)+'"',i=e[t].title?' title="'+s(a(e[t].title))+'"':"";return"<img"+r+' alt="'+(e[t].alt?s(a(o(e[t].alt))):"")+'"'+i+(n.xhtmlOut?" /":"")+">"},u.table_open=function(){return"<table>\n"},u.table_close=function(){return"</table>\n"},u.thead_open=function(){return"<thead>\n"},u.thead_close=function(){return"</thead>\n"},u.tbody_open=function(){return"<tbody>\n"},u.tbody_close=function(){return"</tbody>\n"},u.tr_open=function(){return"<tr>"},u.tr_close=function(){return"</tr>\n"},u.th_open=function(e,t){var n=e[t];return"<th"+(n.align?' style="text-align:'+n.align+'"':"")+">"},u.th_close=function(){return"</th>"},u.td_open=function(e,t){var n=e[t];return"<td"+(n.align?' style="text-align:'+n.align+'"':"")+">"},u.td_close=function(){return"</td>"},u.strong_open=function(){return"<strong>"},u.strong_close=function(){return"</strong>"},u.em_open=function(){return"<em>"},u.em_close=function(){return"</em>"},u.del_open=function(){return"<del>"},u.del_close=function(){return"</del>"},u.ins_open=function(){return"<ins>"},u.ins_close=function(){return"</ins>"},u.mark_open=function(){return"<mark>"},u.mark_close=function(){return"</mark>"},u.sub=function(e,t){return"<sub>"+s(e[t].content)+"</sub>"},u.sup=function(e,t){return"<sup>"+s(e[t].content)+"</sup>"},u.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},u.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},u.text=function(e,t){return s(e[t].content)},u.htmlblock=function(e,t){return e[t].content},u.htmltag=function(e,t){return e[t].content},u.abbr_open=function(e,t){return'<abbr title="'+s(a(e[t].title))+'">'},u.abbr_close=function(){return"</abbr>"},u.footnote_ref=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+n+'" id="'+r+'">['+n+"]</a></sup>"},u.footnote_block_open=function(e,t,n){return(n.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},u.footnote_block_close=function(){return"</ol>\n</section>\n"},u.footnote_open=function(e,t){return'<li id="fn'+Number(e[t].id+1).toString()+'" class="footnote-item">'},u.footnote_close=function(){return"</li>\n"},u.footnote_anchor=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),' <a href="#'+r+'" class="footnote-backref">↩</a>'},u.dl_open=function(){return"<dl>\n"},u.dt_open=function(){return"<dt>"},u.dd_open=function(){return"<dd>"},u.dl_close=function(){return"</dl>\n"},u.dt_close=function(){return"</dt>\n"},u.dd_close=function(){return"</dd>\n"};var l=u.getBreak=function(e,t){return t=r(e,t),t<e.length&&"list_item_close"===e[t].type?"":"\n"};e.exports=u},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i,o,a,s,u,l,c,p,f,h,d,m=e.bMarks[t]+e.tShift[t],v=e.eMarks[t];if(m>v)return!1;if(62!==e.src.charCodeAt(m++))return!1;if(e.level>=e.options.maxNesting)return!1;if(r)return!0;for(32===e.src.charCodeAt(m)&&m++,u=e.blkIndent,e.blkIndent=0,s=[e.bMarks[t]],e.bMarks[t]=m,m=m<v?e.skipSpaces(m):m,o=m>=v,a=[e.tShift[t]],e.tShift[t]=m-e.bMarks[t],p=e.parser.ruler.getRules("blockquote"),i=t+1;i<n&&(m=e.bMarks[i]+e.tShift[i],v=e.eMarks[i],!(m>=v));i++)if(62!==e.src.charCodeAt(m++)){if(o)break;for(d=!1,f=0,h=p.length;f<h;f++)if(p[f](e,i,n,!0)){d=!0;break}if(d)break;s.push(e.bMarks[i]),a.push(e.tShift[i]),e.tShift[i]=-1337}else 32===e.src.charCodeAt(m)&&m++,s.push(e.bMarks[i]),e.bMarks[i]=m,m=m<v?e.skipSpaces(m):m,o=m>=v,a.push(e.tShift[i]),e.tShift[i]=m-e.bMarks[i];for(l=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:c=[t,0],level:e.level++}),e.parser.tokenize(e,t,i),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=l,c[1]=e.line,f=0;f<a.length;f++)e.bMarks[f+t]=s[f],e.tShift[f+t]=a[f];return e.blkIndent=u,!0}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,i;if(e.tShift[t]-e.blkIndent<4)return!1;for(i=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.tShift[r]-e.blkIndent>=4))break;r++,i=r}return e.line=r,e.tokens.push({type:"code",content:e.getLines(t,i,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";function r(e,t){var n,r,i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return i>=o?-1:126!==(r=e.src.charCodeAt(i++))&&58!==r?-1:(n=e.skipSpaces(i),i===n?-1:n>=o?-1:n)}function i(e,t){var n,r,i=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===i&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}e.exports=function(e,t,n,o){var a,s,u,l,c,p,f,h,d,m,v,g,y,_;if(o)return!(e.ddIndent<0)&&r(e,t)>=0;if(f=t+1,e.isEmpty(f)&&++f>n)return!1;if(e.tShift[f]<e.blkIndent)return!1;if((a=r(e,f))<0)return!1;if(e.level>=e.options.maxNesting)return!1;p=e.tokens.length,e.tokens.push({type:"dl_open",lines:c=[t,0],level:e.level++}),u=t,s=f;e:for(;;){for(_=!0,y=!1,e.tokens.push({type:"dt_open",lines:[u,u],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(u,u+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[u,u],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:l=[f,0],level:e.level++}),g=e.tight,d=e.ddIndent,h=e.blkIndent,v=e.tShift[s],m=e.parentType,e.blkIndent=e.ddIndent=e.tShift[s]+2,e.tShift[s]=a-e.bMarks[s],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,s,n,!0),e.tight&&!y||(_=!1),y=e.line-s>1&&e.isEmpty(e.line-1),e.tShift[s]=v,e.tight=g,e.parentType=m,e.blkIndent=h,e.ddIndent=d,e.tokens.push({type:"dd_close",level:--e.level}),l[1]=f=e.line,f>=n)break e;if(e.tShift[f]<e.blkIndent)break e;if((a=r(e,f))<0)break;s=f}if(f>=n)break;if(u=f,e.isEmpty(u))break;if(e.tShift[u]<e.blkIndent)break;if((s=u+1)>=n)break;if(e.isEmpty(s)&&s++,s>=n)break;if(e.tShift[s]<e.blkIndent)break;if((a=r(e,s))<0)break}return e.tokens.push({type:"dl_close",level:--e.level}),c[1]=f,e.line=f,_&&i(e,p),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i,o,a,s,u,l=!1,c=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(c+3>p)return!1;if(126!==(i=e.src.charCodeAt(c))&&96!==i)return!1;if(u=c,c=e.skipChars(c,i),(o=c-u)<3)return!1;if(a=e.src.slice(c,p).trim(),a.indexOf("`")>=0)return!1;if(r)return!0;for(s=t;!(++s>=n)&&(c=u=e.bMarks[s]+e.tShift[s],p=e.eMarks[s],!(c<p&&e.tShift[s]<e.blkIndent));)if(e.src.charCodeAt(c)===i&&!(e.tShift[s]-e.blkIndent>=4||(c=e.skipChars(c,i))-u<o||(c=e.skipSpaces(c))<p)){l=!0;break}return o=e.tShift[t],e.line=s+(l?1:0),e.tokens.push({type:"fence",params:a,content:e.getLines(t+1,s,o,!0),lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i,o,a,s,u,l=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(l+4>c)return!1;if(91!==e.src.charCodeAt(l))return!1;if(94!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(s=l+2;s<c;s++){if(32===e.src.charCodeAt(s))return!1;if(93===e.src.charCodeAt(s))break}return s!==l+2&&(!(s+1>=c||58!==e.src.charCodeAt(++s))&&(!!r||(s++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),u=e.src.slice(l+2,s-2),e.env.footnotes.refs[":"+u]=-1,e.tokens.push({type:"footnote_reference_open",label:u,level:e.level++}),i=e.bMarks[t],o=e.tShift[t],a=e.parentType,e.tShift[t]=e.skipSpaces(s)-s,e.bMarks[t]=s,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]<e.blkIndent&&(e.tShift[t]+=e.blkIndent,e.bMarks[t]-=e.blkIndent),e.parser.tokenize(e,t,n,!0),e.parentType=a,e.blkIndent-=4,e.tShift[t]=o,e.bMarks[t]=i,e.tokens.push({type:"footnote_reference_close",level:--e.level}),!0)))}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i,o,a,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(s>=u)return!1;if(35!==(i=e.src.charCodeAt(s))||s>=u)return!1;for(o=1,i=e.src.charCodeAt(++s);35===i&&s<u&&o<=6;)o++,i=e.src.charCodeAt(++s);return!(o>6||s<u&&32!==i)&&(!!r||(u=e.skipCharsBack(u,32,s),a=e.skipCharsBack(u,35,s),a>s&&32===e.src.charCodeAt(a-1)&&(u=a),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:o,lines:[t,e.line],level:e.level}),s<u&&e.tokens.push({type:"inline",content:e.src.slice(s,u).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:o,level:e.level}),!0))}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i,o,a,s=e.bMarks[t],u=e.eMarks[t];if((s+=e.tShift[t])>u)return!1;if(42!==(i=e.src.charCodeAt(s++))&&45!==i&&95!==i)return!1;for(o=1;s<u;){if((a=e.src.charCodeAt(s++))!==i&&32!==a)return!1;a===i&&o++}return!(o<3)&&(!!r||(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level}),!0))}},function(e,t,n){"use strict";function r(e){var t=32|e;return t>=97&&t<=122}var i=n(1127),o=/^<([a-zA-Z]{1,15})[\s\/>]/,a=/^<\/([a-zA-Z]{1,15})[\s>]/;e.exports=function(e,t,n,s){var u,l,c,p=e.bMarks[t],f=e.eMarks[t],h=e.tShift[t];if(p+=h,!e.options.html)return!1;if(h>3||p+2>=f)return!1;if(60!==e.src.charCodeAt(p))return!1;if(33===(u=e.src.charCodeAt(p+1))||63===u){if(s)return!0}else{if(47!==u&&!r(u))return!1;if(47===u){if(!(l=e.src.slice(p,f).match(a)))return!1}else if(!(l=e.src.slice(p,f).match(o)))return!1;if(!0!==i[l[1].toLowerCase()])return!1;if(s)return!0}for(c=t+1;c<e.lineMax&&!e.isEmpty(c);)c++;return e.line=c,e.tokens.push({type:"htmlblock",level:e.level,lines:[t,e.line],content:e.getLines(t,c,0,!0)}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,i,o,a=t+1;return!(a>=n)&&(!(e.tShift[a]<e.blkIndent)&&(!(e.tShift[a]-e.blkIndent>3)&&(i=e.bMarks[a]+e.tShift[a],o=e.eMarks[a],!(i>=o)&&((45===(r=e.src.charCodeAt(i))||61===r)&&(i=e.skipChars(i,r),!((i=e.skipSpaces(i))<o)&&(i=e.bMarks[t]+e.tShift[t],e.line=a+1,e.tokens.push({type:"heading_open",hLevel:61===r?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(i,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===r?1:2,level:e.level}),!0))))))}},function(e,t,n){"use strict";function r(e,t){var n,r,i;return r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r>=i?-1:(n=e.src.charCodeAt(r++),42!==n&&45!==n&&43!==n?-1:r<i&&32!==e.src.charCodeAt(r)?-1:r)}function i(e,t){var n,r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(r+1>=i)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=i)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}}return r<i&&32!==e.src.charCodeAt(r)?-1:r}function o(e,t){var n,r,i=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===i&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}e.exports=function(e,t,n,a){var s,u,l,c,p,f,h,d,m,v,g,y,_,b,x,w,k,E,S,C,A,D,O=!0;if((d=i(e,t))>=0)_=!0;else{if(!((d=r(e,t))>=0))return!1;_=!1}if(e.level>=e.options.maxNesting)return!1;if(y=e.src.charCodeAt(d-1),a)return!0;for(x=e.tokens.length,_?(h=e.bMarks[t]+e.tShift[t],g=Number(e.src.substr(h,d-h-1)),e.tokens.push({type:"ordered_list_open",order:g,lines:k=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:k=[t,0],level:e.level++}),s=t,w=!1,S=e.parser.ruler.getRules("list");!(!(s<n)||(b=e.skipSpaces(d),m=e.eMarks[s],v=b>=m?1:b-d,v>4&&(v=1),v<1&&(v=1),u=d-e.bMarks[s]+v,e.tokens.push({type:"list_item_open",lines:E=[t,0],level:e.level++}),c=e.blkIndent,p=e.tight,l=e.tShift[t],f=e.parentType,e.tShift[t]=b-e.bMarks[t],e.blkIndent=u,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,n,!0),e.tight&&!w||(O=!1),w=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=c,e.tShift[t]=l,e.tight=p,e.parentType=f,e.tokens.push({type:"list_item_close",level:--e.level}),s=t=e.line,E[1]=s,b=e.bMarks[t],s>=n)||e.isEmpty(s)||e.tShift[s]<e.blkIndent);){for(D=!1,C=0,A=S.length;C<A;C++)if(S[C](e,s,n,!0)){D=!0;break}if(D)break;if(_){if((d=i(e,s))<0)break}else if((d=r(e,s))<0)break;if(y!==e.src.charCodeAt(d-1))break}return e.tokens.push({type:_?"ordered_list_close":"bullet_list_close",level:--e.level}),k[1]=s,e.line=s,O&&o(e,x),!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,s,u=t+1;if(n=e.lineMax,u<n&&!e.isEmpty(u))for(s=e.parser.ruler.getRules("paragraph");u<n&&!e.isEmpty(u);u++)if(!(e.tShift[u]-e.blkIndent>3)){for(i=!1,o=0,a=s.length;o<a;o++)if(s[o](e,u,n,!0)){i=!0;break}if(i)break}return r=e.getLines(t,u,e.blkIndent,!1).trim(),e.line=u,r.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:r,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}},function(e,t,n){"use strict";function r(e,t,n,r,i){var o,a,s,u,l,c,p;for(this.src=e,this.parser=t,this.options=n,this.env=r,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",a=this.src,c=0,p=!1,s=u=c=0,l=a.length;u<l;u++){if(o=a.charCodeAt(u),!p){if(32===o){c++;continue}p=!0}10!==o&&u!==l-1||(10!==o&&u++,this.bMarks.push(s),this.eMarks.push(u),this.tShift.push(c),p=!1,c=0,s=u+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}r.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},r.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},r.prototype.skipSpaces=function(e){for(var t=this.src.length;e<t&&32===this.src.charCodeAt(e);e++);return e},r.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},r.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},r.prototype.getLines=function(e,t,n,r){var i,o,a,s,u,l=e;if(e>=t)return"";if(l+1===t)return o=this.bMarks[l]+Math.min(this.tShift[l],n),a=r?this.eMarks[l]+1:this.eMarks[l],this.src.slice(o,a);for(s=new Array(t-e),i=0;l<t;l++,i++)u=this.tShift[l],u>n&&(u=n),u<0&&(u=0),o=this.bMarks[l]+u,a=l+1<t||r?this.eMarks[l]+1:this.eMarks[l],s[i]=this.src.slice(o,a);return s.join("")},e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}e.exports=function(e,t,n,i){var o,a,s,u,l,c,p,f,h,d,m;if(t+2>n)return!1;if(l=t+1,e.tShift[l]<e.blkIndent)return!1;if((s=e.bMarks[l]+e.tShift[l])>=e.eMarks[l])return!1;if(124!==(o=e.src.charCodeAt(s))&&45!==o&&58!==o)return!1;if(a=r(e,t+1),!/^[-:| ]+$/.test(a))return!1;if((c=a.split("|"))<=2)return!1;for(f=[],u=0;u<c.length;u++){if(!(h=c[u].trim())){if(0===u||u===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(h))return!1;58===h.charCodeAt(h.length-1)?f.push(58===h.charCodeAt(0)?"center":"right"):58===h.charCodeAt(0)?f.push("left"):f.push("")}if(a=r(e,t).trim(),-1===a.indexOf("|"))return!1;if(c=a.replace(/^\||\|$/g,"").split("|"),f.length!==c.length)return!1;if(i)return!0;for(e.tokens.push({type:"table_open",lines:d=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),u=0;u<c.length;u++)e.tokens.push({type:"th_open",align:f[u],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:c[u].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:m=[t+2,0],level:e.level++}),l=t+2;l<n&&!(e.tShift[l]<e.blkIndent)&&(a=r(e,l).trim(),-1!==a.indexOf("|"));l++){for(c=a.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),u=0;u<c.length;u++)e.tokens.push({type:"td_open",align:f[u],level:e.level++}),p=c[u].substring(124===c[u].charCodeAt(0)?1:0,124===c[u].charCodeAt(c[u].length-1)?c[u].length-1:c[u].length).trim(),e.tokens.push({type:"inline",content:p,level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),d[1]=m[1]=l,e.line=l,!0}},function(e,t,n){"use strict";function r(e,t,n,r){var a,s,u,l,c,p;if(42!==e.charCodeAt(0))return-1;if(91!==e.charCodeAt(1))return-1;if(-1===e.indexOf("]:"))return-1;if(a=new i(e,t,n,r,[]),(s=o(a,1))<0||58!==e.charCodeAt(s+1))return-1;for(l=a.posMax,u=s+2;u<l&&10!==a.src.charCodeAt(u);u++);return c=e.slice(2,s),p=e.slice(s+2,u).trim(),0===p.length?-1:(r.abbreviations||(r.abbreviations={}),void 0===r.abbreviations[":"+c]&&(r.abbreviations[":"+c]=p),u)}var i=n(263),o=n(165);e.exports=function(e){var t,n,i,o,a=e.tokens;if(!e.inlineMode)for(t=1,n=a.length-1;t<n;t++)if("paragraph_open"===a[t-1].type&&"inline"===a[t].type&&"paragraph_close"===a[t+1].type){for(i=a[t].content;i.length&&!((o=r(i,e.inline,e.options,e.env))<0);)i=i.slice(o).trim();a[t].content=i,i.length||(a[t-1].tight=!0,a[t+1].tight=!0)}}},function(e,t,n){"use strict";function r(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var i=" \n()[]'\".,!?-";e.exports=function(e){var t,n,o,a,s,u,l,c,p,f,h,d,m=e.tokens;if(e.env.abbreviations)for(e.env.abbrRegExp||(d="(^|["+i.split("").map(r).join("")+"])("+Object.keys(e.env.abbreviations).map(function(e){return e.substr(1)}).sort(function(e,t){return t.length-e.length}).map(r).join("|")+")($|["+i.split("").map(r).join("")+"])",e.env.abbrRegExp=new RegExp(d,"g")),f=e.env.abbrRegExp,n=0,o=m.length;n<o;n++)if("inline"===m[n].type)for(a=m[n].children,t=a.length-1;t>=0;t--)if(s=a[t],"text"===s.type){for(c=0,u=s.content,f.lastIndex=0,p=s.level,l=[];h=f.exec(u);)f.lastIndex>c&&l.push({type:"text",content:u.slice(c,h.index+h[1].length),level:p}),l.push({type:"abbr_open",title:e.env.abbreviations[":"+h[2]],level:p++}),l.push({type:"text",content:h[2],level:p}),l.push({type:"abbr_close",level:--p}),c=f.lastIndex-h[3].length;l.length&&(c<u.length&&l.push({type:"text",content:u.slice(c),level:p}),m[n].children=a=[].concat(a.slice(0,t),l,a.slice(t+1)))}}},function(e,t,n){"use strict";e.exports=function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,i,o,a,s,u,l,c=0,p=!1,f={};if(e.env.footnotes&&(e.tokens=e.tokens.filter(function(e){return"footnote_reference_open"===e.type?(p=!0,u=[],l=e.label,!1):"footnote_reference_close"===e.type?(p=!1,f[":"+l]=u,!1):(p&&u.push(e),!p)}),e.env.footnotes.list)){for(a=e.env.footnotes.list,e.tokens.push({type:"footnote_block_open",level:c++}),t=0,n=a.length;t<n;t++){for(e.tokens.push({type:"footnote_open",id:t,level:c++}),a[t].tokens?(s=[],s.push({type:"paragraph_open",tight:!1,level:c++}),s.push({type:"inline",content:"",level:c,children:a[t].tokens}),s.push({type:"paragraph_close",tight:!1,level:--c})):a[t].label&&(s=f[":"+a[t].label]),e.tokens=e.tokens.concat(s),o="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,i=a[t].count>0?a[t].count:1,r=0;r<i;r++)e.tokens.push({type:"footnote_anchor",id:t,subId:r,level:c});o&&e.tokens.push(o),e.tokens.push({type:"footnote_close",level:--c})}e.tokens.push({type:"footnote_block_close",level:--c})}}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,i=e.tokens;for(n=0,r=i.length;n<r;n++)t=i[n],"inline"===t.type&&e.inline.parse(t.content,e.options,e.env,t.children)}},function(e,t,n){"use strict";function r(e){return/^<a[>\s]/i.test(e)}function i(e){return/^<\/a\s*>/i.test(e)}function o(){var e=[],t=new a({stripPrefix:!1,url:!0,email:!0,twitter:!1,replaceFn:function(t,n){switch(n.getType()){case"url":e.push({text:n.matchedText,url:n.getUrl()});break;case"email":e.push({text:n.matchedText,url:"mailto:"+n.getEmail().replace(/^mailto:/i,"")})}return!1}});return{links:e,autolinker:t}}var a=n(508),s=/www|@|\:\/\//;e.exports=function(e){var t,n,a,u,l,c,p,f,h,d,m,v,g,y=e.tokens,_=null;if(e.options.linkify)for(n=0,a=y.length;n<a;n++)if("inline"===y[n].type)for(u=y[n].children,m=0,t=u.length-1;t>=0;t--)if(l=u[t],"link_close"!==l.type){if("htmltag"===l.type&&(r(l.content)&&m>0&&m--,i(l.content)&&m++),!(m>0)&&"text"===l.type&&s.test(l.content)){if(_||(_=o(),v=_.links,g=_.autolinker),c=l.content,v.length=0,g.link(c),!v.length)continue;for(p=[],d=l.level,f=0;f<v.length;f++)e.inline.validateLink(v[f].url)&&(h=c.indexOf(v[f].text),h&&(d=d,p.push({type:"text",content:c.slice(0,h),level:d})),p.push({type:"link_open",href:v[f].url,title:"",level:d++}),p.push({type:"text",content:v[f].text,level:d}),p.push({type:"link_close",level:--d}),c=c.slice(h+v[f].text.length));c.length&&p.push({type:"text",content:c,level:d}),y[n].children=u=[].concat(u.slice(0,t),p,u.slice(t+1))}}else for(t--;u[t].level!==l.level&&"link_open"!==u[t].type;)t--}},function(e,t,n){"use strict";function r(e,t,n,r){var l,c,p,f,h,d,m,v,g;if(91!==e.charCodeAt(0))return-1;if(-1===e.indexOf("]:"))return-1;if(l=new i(e,t,n,r,[]),(c=o(l,0))<0||58!==e.charCodeAt(c+1))return-1;for(f=l.posMax,p=c+2;p<f&&(32===(h=l.src.charCodeAt(p))||10===h);p++);if(!a(l,p))return-1;for(m=l.linkContent,p=l.pos,d=p,p+=1;p<f&&(32===(h=l.src.charCodeAt(p))||10===h);p++);for(p<f&&d!==p&&s(l,p)?(v=l.linkContent,p=l.pos):(v="",p=d);p<f&&32===l.src.charCodeAt(p);)p++;return p<f&&10!==l.src.charCodeAt(p)?-1:(g=u(e.slice(1,c)),void 0===r.references[g]&&(r.references[g]={title:v,href:m}),p)}var i=n(263),o=n(165),a=n(491),s=n(492),u=n(490);e.exports=function(e){var t,n,i,o,a=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=a.length-1;t<n;t++)if("inline"===a[t].type&&"paragraph_open"===a[t-1].type&&"paragraph_close"===a[t+1].type){for(i=a[t].content;i.length&&!((o=r(i,e.inline,e.options,e.env))<0);)i=i.slice(o).trim();a[t].content=i,i.length||(a[t-1].tight=!0,a[t+1].tight=!0)}}},function(e,t,n){"use strict";function r(e){return e.indexOf("(")<0?e:e.replace(o,function(e,t){return a[t.toLowerCase()]})}var i=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,o=/\((c|tm|r|p)\)/gi,a={c:"©",r:"®",p:"§",tm:"™"};e.exports=function(e){var t,n,o,a,s;if(e.options.typographer)for(s=e.tokens.length-1;s>=0;s--)if("inline"===e.tokens[s].type)for(a=e.tokens[s].children,t=a.length-1;t>=0;t--)n=a[t],"text"===n.type&&(o=n.content,o=r(o),i.test(o)&&(o=o.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),n.content=o)}},function(e,t,n){"use strict";function r(e,t){return!(t<0||t>=e.length)&&!s.test(e[t])}function i(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}var o=/['"]/,a=/['"]/g,s=/[-\s()\[\]]/;e.exports=function(e){var t,n,s,u,l,c,p,f,h,d,m,v,g,y,_,b,x;if(e.options.typographer)for(x=[],_=e.tokens.length-1;_>=0;_--)if("inline"===e.tokens[_].type)for(b=e.tokens[_].children,x.length=0,t=0;t<b.length;t++)if(n=b[t],"text"===n.type&&!o.test(n.text)){for(p=b[t].level,g=x.length-1;g>=0&&!(x[g].level<=p);g--);x.length=g+1,s=n.content,l=0,c=s.length;e:for(;l<c&&(a.lastIndex=l,u=a.exec(s));)if(f=!r(s,u.index-1),l=u.index+1,y="'"===u[0],(h=!r(s,l))||f){if(m=!h,v=!f)for(g=x.length-1;g>=0&&(d=x[g],!(x[g].level<p));g--)if(d.single===y&&x[g].level===p){d=x[g],y?(b[d.token].content=i(b[d.token].content,d.pos,e.options.quotes[2]),n.content=i(n.content,u.index,e.options.quotes[3])):(b[d.token].content=i(b[d.token].content,d.pos,e.options.quotes[0]),n.content=i(n.content,u.index,e.options.quotes[1])),x.length=g;continue e}m?x.push({token:t,pos:u.index,single:y,level:p}):v&&y&&(n.content=i(n.content,u.index,"’"))}else y&&(n.content=i(n.content,u.index,"’"))}}},function(e,t,n){"use strict";var r=n(1129),i=n(489),o=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,a=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;e.exports=function(e,t){var n,s,u,l,c,p=e.pos;return 60===e.src.charCodeAt(p)&&(n=e.src.slice(p),!(n.indexOf(">")<0)&&((s=n.match(a))?!(r.indexOf(s[1].toLowerCase())<0)&&(l=s[0].slice(1,-1),c=i(l),!!e.parser.validateLink(l)&&(t||(e.push({type:"link_open",href:c,level:e.level}),e.push({type:"text",content:l,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=s[0].length,!0)):!!(u=n.match(o))&&(l=u[0].slice(1,-1),c=i("mailto:"+l),!!e.parser.validateLink(c)&&(t||(e.push({type:"link_open",href:c,level:e.level}),e.push({type:"text",content:l,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=u[0].length,!0))))}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,s=e.pos;if(96!==e.src.charCodeAt(s))return!1;for(n=s,s++,r=e.posMax;s<r&&96===e.src.charCodeAt(s);)s++;for(i=e.src.slice(n,s),o=a=s;-1!==(o=e.src.indexOf("`",a));){for(a=o+1;a<r&&96===e.src.charCodeAt(a);)a++;if(a-o===i.length)return t||e.push({type:"code",content:e.src.slice(s,o).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=a,!0}return t||(e.pending+=i),e.pos+=i.length,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,s=e.posMax,u=e.pos;if(126!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(126!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),126===o)return!1;if(126===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&126===e.src.charCodeAt(r);)r++;if(r>u+3)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,i=1;e.pos+1<s;){if(126===e.src.charCodeAt(e.pos)&&126===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),126!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&126!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";function r(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function i(e,t){var n,i,o,a=t,s=!0,u=!0,l=e.posMax,c=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;a<l&&e.src.charCodeAt(a)===c;)a++;return a>=l&&(s=!1),o=a-t,o>=4?s=u=!1:(i=a<l?e.src.charCodeAt(a):-1,32!==i&&10!==i||(s=!1),32!==n&&10!==n||(u=!1),95===c&&(r(n)&&(s=!1),r(i)&&(u=!1))),{can_open:s,can_close:u,delims:o}}e.exports=function(e,t){var n,r,o,a,s,u,l,c=e.posMax,p=e.pos,f=e.src.charCodeAt(p);if(95!==f&&42!==f)return!1;if(t)return!1;if(l=i(e,p),n=l.delims,!l.can_open)return e.pos+=n,t||(e.pending+=e.src.slice(p,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=p+n,u=[n];e.pos<c;)if(e.src.charCodeAt(e.pos)!==f)e.parser.skipToken(e);else{if(l=i(e,e.pos),r=l.delims,l.can_close){for(a=u.pop(),s=r;a!==s;){if(s<a){u.push(a-s);break}if(s-=a,0===u.length)break;e.pos+=a,a=u.pop()}if(0===u.length){n=a,o=!0;break}e.pos+=r;continue}l.can_open&&u.push(r),e.pos+=r}return o?(e.posMax=e.pos,e.pos=p+n,t||(2!==n&&3!==n||e.push({type:"strong_open",level:e.level++}),1!==n&&3!==n||e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),1!==n&&3!==n||e.push({type:"em_close",level:--e.level}),2!==n&&3!==n||e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+n,e.posMax=c,!0):(e.pos=p,!1)}},function(e,t,n){"use strict";var r=n(488),i=n(26).has,o=n(26).isValidEntityCode,a=n(26).fromCodePoint,s=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,u=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n,l,c=e.pos,p=e.posMax;if(38!==e.src.charCodeAt(c))return!1;if(c+1<p)if(35===e.src.charCodeAt(c+1)){if(l=e.src.slice(c).match(s))return t||(n="x"===l[1][0].toLowerCase()?parseInt(l[1].slice(1),16):parseInt(l[1],10),e.pending+=a(o(n)?n:65533)),e.pos+=l[0].length,!0}else if((l=e.src.slice(c).match(u))&&i(r,l[1]))return t||(e.pending+=r[l[1]]),e.pos+=l[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},function(e,t,n){"use strict";for(var r=[],i=0;i<256;i++)r.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){r[e.charCodeAt(0)]=1}),e.exports=function(e,t){var n,i=e.pos,o=e.posMax;if(92!==e.src.charCodeAt(i))return!1;if(++i<o){if((n=e.src.charCodeAt(i))<256&&0!==r[n])return t||(e.pending+=e.src[i]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),i++;i<o&&32===e.src.charCodeAt(i);)i++;return e.pos=i,!0}}return t||(e.pending+="\\"),e.pos++,!0}},function(e,t,n){"use strict";var r=n(165);e.exports=function(e,t){var n,i,o,a,s=e.posMax,u=e.pos;return!(u+2>=s)&&(94===e.src.charCodeAt(u)&&(91===e.src.charCodeAt(u+1)&&(!(e.level>=e.options.maxNesting)&&(n=u+2,!((i=r(e,u+1))<0)&&(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),o=e.env.footnotes.list.length,e.pos=n,e.posMax=i,e.push({type:"footnote_ref",id:o,level:e.level}),e.linkLevel++,a=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[o]={tokens:e.tokens.splice(a)},e.linkLevel--),e.pos=i+1,e.posMax=s,!0)))))}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a=e.posMax,s=e.pos;if(s+3>a)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(s))return!1;if(94!==e.src.charCodeAt(s+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(r=s+2;r<a;r++){if(32===e.src.charCodeAt(r))return!1;if(10===e.src.charCodeAt(r))return!1;if(93===e.src.charCodeAt(r))break}return r!==s+2&&(!(r>=a)&&(r++,n=e.src.slice(s+2,r-1),void 0!==e.env.footnotes.refs[":"+n]&&(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(i=e.env.footnotes.list.length,e.env.footnotes.list[i]={label:n,count:0},e.env.footnotes.refs[":"+n]=i):i=e.env.footnotes.refs[":"+n],o=e.env.footnotes.list[i].count,e.env.footnotes.list[i].count++,e.push({type:"footnote_ref",id:i,subId:o,level:e.level})),e.pos=r,e.posMax=a,!0)))}},function(e,t,n){"use strict";function r(e){var t=32|e;return t>=97&&t<=122}var i=n(1128).HTML_TAG_RE;e.exports=function(e,t){var n,o,a,s=e.pos;return!!e.options.html&&(a=e.posMax,!(60!==e.src.charCodeAt(s)||s+2>=a)&&(!(33!==(n=e.src.charCodeAt(s+1))&&63!==n&&47!==n&&!r(n))&&(!!(o=e.src.slice(s).match(i))&&(t||e.push({type:"htmltag",content:e.src.slice(s,s+o[0].length),level:e.level}),e.pos+=o[0].length,!0))))}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,s=e.posMax,u=e.pos;if(43!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(43!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),43===o)return!1;if(43===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&43===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,i=1;e.pos+1<s;){if(43===e.src.charCodeAt(e.pos)&&43===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),43!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&43!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";var r=n(165),i=n(491),o=n(492),a=n(490);e.exports=function(e,t){var n,s,u,l,c,p,f,h,d=!1,m=e.pos,v=e.posMax,g=e.pos,y=e.src.charCodeAt(g);if(33===y&&(d=!0,y=e.src.charCodeAt(++g)),91!==y)return!1;if(e.level>=e.options.maxNesting)return!1;if(n=g+1,(s=r(e,g))<0)return!1;if((p=s+1)<v&&40===e.src.charCodeAt(p)){for(p++;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p>=v)return!1;for(g=p,i(e,p)?(l=e.linkContent,p=e.pos):l="",g=p;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p<v&&g!==p&&o(e,p))for(c=e.linkContent,p=e.pos;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);else c="";if(p>=v||41!==e.src.charCodeAt(p))return e.pos=m,!1;p++}else{if(e.linkLevel>0)return!1;for(;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p<v&&91===e.src.charCodeAt(p)&&(g=p+1,p=r(e,p),p>=0?u=e.src.slice(g,p++):p=g-1),u||(void 0===u&&(p=s+1),u=e.src.slice(n,s)),!(f=e.env.references[a(u)]))return e.pos=m,!1;l=f.href,c=f.title}return t||(e.pos=n,e.posMax=s,d?e.push({type:"image",src:l,title:c,alt:e.src.substr(n,s-n),level:e.level}):(e.push({type:"link_open",href:l,title:c,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=p,e.posMax=v,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,s=e.posMax,u=e.pos;if(61!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(61!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),61===o)return!1;if(61===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&61===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,i=1;e.pos+1<s;){if(61===e.src.charCodeAt(e.pos)&&61===e.src.charCodeAt(e.pos+1)&&(o=e.src.charCodeAt(e.pos-1),61!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&61!==o&&(32!==o&&10!==o?i--:32!==a&&10!==a&&i++,i<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i=e.pos;if(10!==e.src.charCodeAt(i))return!1;if(n=e.pending.length-1,r=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(var o=n-2;o>=0;o--)if(32!==e.pending.charCodeAt(o)){e.pending=e.pending.substring(0,o+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(i++;i<r&&32===e.src.charCodeAt(i);)i++;return e.pos=i,!0}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,i,o=e.posMax,a=e.pos;if(126!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<o;){if(126===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(i=e.src.slice(a+1,e.pos),i.match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sub",level:e.level,content:i.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=o,!0)):(e.pos=a,!1)}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,i,o=e.posMax,a=e.pos;if(94!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<o;){if(94===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(i=e.src.slice(a+1,e.pos),i.match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sup",level:e.level,content:i.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=o,!0)):(e.pos=a,!1)}},function(e,t,n){"use strict";function r(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}e.exports=function(e,t){for(var n=e.pos;n<e.posMax&&!r(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}},function(e,t,n){"use strict";function r(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var n=e.length*t;if(i!==e||void 0===i)i=e,o="";else if(o.length>=n)return o.substr(0,n);for(;n>o.length&&t>1;)1&t&&(o+=e),t>>=1,e+=e;return o+=e,o=o.substr(0,n)}/*! + */t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},o=t||{},a=e.split(i),u=o.decode||r,c=0;c<a.length;c++){var l=a[c],p=l.indexOf("=");if(!(p<0)){var f=l.substr(0,p).trim(),h=l.substr(++p,l.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),null==n[f]&&(n[f]=s(h,u))}}return n},t.serialize=function(e,t,n){var r=n||{},i=r.encode||o;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!a.test(e))throw new TypeError("argument name is invalid");var s=i(t);if(s&&!a.test(s))throw new TypeError("argument val is invalid");var u=e+"="+s;if(null!=r.maxAge){var c=r.maxAge-0;if(isNaN(c))throw new Error("maxAge should be a Number");u+="; Max-Age="+Math.floor(c)}if(r.domain){if(!a.test(r.domain))throw new TypeError("option domain is invalid");u+="; Domain="+r.domain}if(r.path){if(!a.test(r.path))throw new TypeError("option path is invalid");u+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");u+="; Expires="+r.expires.toUTCString()}r.httpOnly&&(u+="; HttpOnly");r.secure&&(u+="; Secure");if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;default:throw new TypeError("option sameSite is invalid")}}return u};var r=decodeURIComponent,o=encodeURIComponent,i=/; */,a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e,t){try{return t(e)}catch(t){return e}}},function(e,t){e.exports=function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){var o=e.charCodeAt(n+1);if(o>=56320&&o<=57343){var i=1024*(r-55296)+o-56320+65536;t.push(240+Math.floor(i/64/64/64),128+Math.floor(i/64/64)%64,128+Math.floor(i/64)%64,128+i%64),n+=1;continue}}r>=2048?t.push(224+Math.floor(r/64/64),128+Math.floor(r/64)%64,128+r%64):r>=128?t.push(192+Math.floor(r/64),128+r%64):t.push(r)}return t}},function(e,t,n){!function(){var e;function n(e,t){function n(e,t,n){if(!r(e))return n;for(var o=0,i=0;;){var a,s=t.exec(e);for(a=s?s.index:e.length;i<n;){if(o==a){i<n&&(i++,s?o+=s[0].length:o++);break}o++,i++}if(i==n)break;if(o>=e.length||!s)return-1}return o}function r(e){return a.test(e)}function o(e,n){null==e&&(e=["[^]"]),null==n&&(n="g");var r=[];return t.forEach(function(e){r.push(e.source)}),r.push(i.source),r=r.concat(e),new RegExp(r.join("|"),n)}e.findCharIndex=function(e,t){if(t>=e.length)return-1;if(!r(e))return t;for(var n=o(),i=0;null!==n.exec(e)&&!(n.lastIndex>t);)i++;return i},e.findByteIndex=function(e,t){return t>=this.length(e)?-1:n(e,o(),t)},e.charAt=function(e,t){var n=this.findByteIndex(e,t);if(n<0||n>=e.length)return"";var r=e.slice(n,n+8),o=a.exec(r);return null===o?r[0]:o[0]},e.charCodeAt=function(e,t){var r=function(e,t){return n(e,new RegExp(i.source,"g"),t)}(e,t);if(r<0)return NaN;var o=e.charCodeAt(r);return 55296<=o&&o<=56319?1024*(o-55296)+(e.charCodeAt(r+1)-56320)+65536:o},e.fromCharCode=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):String.fromCharCode(e)},e.indexOf=function(e,t,n){null==n&&(n=0);var r=this.findByteIndex(e,n),o=e.indexOf(t,r);return o<0?-1:this.findCharIndex(e,o)},e.lastIndexOf=function(e,t,n){var r;if(null==n)r=e.lastIndexOf(t);else{var o=this.findByteIndex(e,n);r=e.lastIndexOf(t,o)}return r<0?-1:this.findCharIndex(e,r)},e.slice=function(e,t,n){var r,o=this.findByteIndex(e,t);return o<0&&(o=e.length),null==n?r=e.length:(r=this.findByteIndex(e,n))<0&&(r=e.length),e.slice(o,r)},e.substr=function(e,t,n){return t<0&&(t=this.length(e)+t),null==n?this.slice(e,t):this.slice(e,t,t+n)},e.substring=e.slice,e.length=function(e){return this.findCharIndex(e,e.length-1)+1},e.stringToCodePoints=function(e){for(var t=[],n=0;n<e.length&&(codePoint=this.charCodeAt(e,n),codePoint);n++)t.push(codePoint);return t},e.codePointsToString=function(e){for(var t=[],n=0;n<e.length;n++)t.push(this.fromCharCode(e[n]));return t.join("")},e.stringToBytes=function(e){for(var t=[],n=0;n<e.length;n++){for(var r=e.charCodeAt(n),o=[];r>0;)o.push(255&r),r>>=8;1==o.length&&o.push(0),t=t.concat(o.reverse())}return t},e.bytesToString=function(e){for(var t=[],n=0;n<e.length;n+=2){var r=e[n]<<8|e[n+1];t.push(String.fromCharCode(r))}return t.join("")},e.stringToCharArray=function(e){var t=[],n=o();do{var r=n.exec(e);if(null===r)break;t.push(r[0])}while(null!==r);return t};var i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,a=o([],"")}null!==t?e=t:"undefined"!=typeof window&&null!==window&&(void 0!==window.UtfString&&null!==window.UtfString||(window.UtfString={}),e=window.UtfString);e.visual={},n(e,[]),n(e.visual,[/\uD83C[\uDDE6-\uDDFF]\uD83C[\uDDE6-\uDDFF]/])}()},function(e,t,n){var r=n(449),o=1,i=4;e.exports=function(e){return r(e,o|i)}},function(e,t){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return d.iterable&&(t[Symbol.iterator]=function(){return t}),t}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=a(t);return t.readAsArrayBuffer(e),n}function u(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function c(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(d.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(d.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(d.arrayBuffer&&d.blob&&v(e))this._bodyArrayBuffer=u(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!d.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!g(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=u(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):d.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},d.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=a(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},d.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function l(e,t){var n=(t=t||{}).body;if(e instanceof l){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=function(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function p(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function f(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}function h(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var d={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(d.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=function(e){return e&&DataView.prototype.isPrototypeOf(e)},g=ArrayBuffer.isView||function(e){return e&&m.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];this.map[e]=o?o+","+r:r},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,r){this.map[t(e)]=n(r)},o.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},d.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];l.prototype.clone=function(){return new l(this,{body:this._bodyInit})},c.call(l.prototype),c.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},h.error=function(){var e=new h(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];h.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new h(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=l,e.Response=h,e.fetch=function(e,t){return new Promise(function(n,r){var o=new l(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:f(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new h(t,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&d.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t){e.exports=FormData},function(e,t,n){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},function(e,t,n){n(164),n(101),n(103),n(972),n(974),n(977),n(978),e.exports=n(22).Map},function(e,t,n){"use strict";var r=n(973),o=n(144);e.exports=n(459)("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(o(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(o(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(49).f,o=n(160),i=n(182),a=n(63),s=n(181),u=n(112),c=n(219),l=n(353),p=n(414),f=n(50),h=n(135).fastKey,d=n(144),m=f?"_s":"size",v=function(e,t){var n,r=h(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,c){var l=e(function(e,r){s(e,l,t,"_i"),e._t=t,e._i=o(null),e._f=void 0,e._l=void 0,e[m]=0,null!=r&&u(r,n,e[c],e)});return i(l.prototype,{clear:function(){for(var e=d(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var n=d(this,t),r=v(n,e);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[m]--}return!!r},forEach:function(e){d(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!v(d(this,t),e)}}),f&&r(l.prototype,"size",{get:function(){return d(this,t)[m]}}),l},def:function(e,t,n){var r,o,i=v(e,t);return i?i.v=n:(e._l=i={i:o=h(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[m]++,"F"!==o&&(e._i[o]=i)),e},getEntry:v,setStrong:function(e,t,n){c(e,t,function(e,n){this._t=d(e,t),this._k=n,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?l(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,l(1))},n?"entries":"values",!n,!0),p(t)}}},function(e,t,n){var r=n(30);r(r.P+r.R,"Map",{toJSON:n(975)("Map")})},function(e,t,n){var r=n(166),o=n(976);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return o(this)}}},function(e,t,n){var r=n(112);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t,n){n(460)("Map")},function(e,t,n){n(461)("Map")},function(e,t,n){"use strict"; +/*! * repeat-string <https://github.com/jonschlinkert/repeat-string> * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. - */ -var i,o="";e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},function(e,t,n){"use strict";function r(e,t){e&&Object.keys(e).forEach(function(n){t(e[n],n)})}function i(e,t){return{}.hasOwnProperty.call(e,t)}function o(e,t){var n=[];return r(e,function(e){t(e)&&n.push(e)}),n}function a(e,t,n){function g(e,t){var n=this;this.tag=e,this.attribs=t||{},this.tagPosition=E.length,this.text="",this.updateParentNodeText=function(){if(P.length){P[P.length-1].text+=n.text}}}function y(e){return"string"!=typeof e&&(e+=""),e.replace(/\&/g,"&").replace(/</g,"<").replace(/\>/g,">").replace(/\"/g,""")}function _(e,n){n=n.replace(/[\x00-\x20]+/g,""),n=n.replace(/<\!\-\-.*?\-\-\>/g,"");var r=n.match(/^([a-zA-Z]+)\:/);if(!r)return!!n.match(/^[\/\\]{2}/)&&!t.allowProtocolRelative;var o=r[1].toLowerCase();return i(t.allowedSchemesByTag,e)?-1===t.allowedSchemesByTag[e].indexOf(o):!t.allowedSchemes||-1===t.allowedSchemes.indexOf(o)}function b(e,t){if(!t)return e;var n,r=c(e),i=e.nodes[0];return n=t[i.selector]&&t["*"]?p(c(t[i.selector]),t["*"],function(e,t){if(Array.isArray(e))return e.concat(t)}):t[i.selector]||t["*"],n&&(r.nodes[0].nodes=i.nodes.reduce(w(n),[])),r}function x(e){return e.nodes[0].nodes.reduce(function(e,t){return e.push(t.prop+":"+t.value+";"),e},[]).join("")}function w(e){return function(t,n){if(e.hasOwnProperty(n.prop)){e[n.prop].some(function(e){return e.test(n.value)})&&t.push(n)}return t}}function k(e,t){return t?(e=e.split(/\s+/),e.filter(function(e){return-1!==t.indexOf(e)}).join(" ")):e}var E="";t?(t=u(a.defaults,t),t.parser?t.parser=u(v,t.parser):t.parser=v):(t=a.defaults,t.parser=v);var S,C,A=t.nonTextTags||["script","style","textarea"];t.allowedAttributes&&(S={},C={},r(t.allowedAttributes,function(e,t){S[t]=[];var n=[];e.forEach(function(e){e.indexOf("*")>=0?n.push(l(e).replace(/\\\*/g,".*")):S[t].push(e)}),C[t]=new RegExp("^("+n.join("|")+")$")}));var D={};r(t.allowedClasses,function(e,t){S&&(i(S,t)||(S[t]=[]),S[t].push("class")),D[t]=e});var O,M={};r(t.transformTags,function(e,t){var n;"function"==typeof e?n=e:"string"==typeof e&&(n=a.simpleTransform(e)),"*"===t?O=n:M[t]=n});var T=0,P=[],I={},R={},j=!1,F=0,N=new s.Parser({onopentag:function(e,n){if(j)return void F++;var a=new g(e,n);P.push(a);var s,u=!1,l=!!a.text;i(M,e)&&(s=M[e](e,n),a.attribs=n=s.attribs,void 0!==s.text&&(a.innerText=s.text),e!==s.tagName&&(a.name=e=s.tagName,R[T]=s.tagName)),O&&(s=O(e,n),a.attribs=n=s.attribs,e!==s.tagName&&(a.name=e=s.tagName,R[T]=s.tagName)),t.allowedTags&&-1===t.allowedTags.indexOf(e)&&(u=!0,-1!==A.indexOf(e)&&(j=!0,F=1),I[T]=!0),T++,u||(E+="<"+e,(!S||i(S,e)||S["*"])&&r(n,function(n,s){if(!m.test(s))return void delete a.attribs[s];var u;if(!S||i(S,e)&&-1!==S[e].indexOf(s)||S["*"]&&-1!==S["*"].indexOf(s)||i(C,e)&&C[e].test(s)||C["*"]&&C["*"].test(s)){if(("href"===s||"src"===s)&&_(e,n))return void delete a.attribs[s];if("iframe"===e&&"src"===s){if("//"===n.substring(0,2)){n="https:".concat(n)}try{if(u=d.parse(n),t.allowedIframeHostnames){if(!t.allowedIframeHostnames.find(function(e){return e===u.hostname}))return void delete a.attribs[s]}}catch(e){return void delete a.attribs[s]}}if("srcset"===s)try{if(u=f.parse(n),r(u,function(e){_("srcset",e.url)&&(e.evil=!0)}),u=o(u,function(e){return!e.evil}),!u.length)return void delete a.attribs[s];n=f.stringify(o(u,function(e){return!e.evil})),a.attribs[s]=n}catch(e){return void delete a.attribs[s]}if("class"===s&&(n=k(n,D[e]),!n.length))return void delete a.attribs[s];if("style"===s)try{if(n=x(b(h.parse(e+" {"+n+"}"),t.allowedStyles)),0===n.length)return void delete a.attribs[s]}catch(e){return void delete a.attribs[s]}E+=" "+s,n.length&&(E+='="'+y(n)+'"')}else delete a.attribs[s]}),-1!==t.selfClosing.indexOf(e)?E+=" />":(E+=">",!a.innerText||l||t.textFilter||(E+=a.innerText)))},ontext:function(e){if(!j){var n,r=P[P.length-1];if(r&&(n=r.tag,e=void 0!==r.innerText?r.innerText:e),"script"===n||"style"===n)E+=e;else{var i=y(e);t.textFilter?E+=t.textFilter(i):E+=i}if(P.length){P[P.length-1].text+=e}}},onclosetag:function(e){if(j){if(--F)return;j=!1}var n=P.pop();if(n){if(j=!1,T--,I[T])return delete I[T],void n.updateParentNodeText();if(R[T]&&(e=R[T],delete R[T]),t.exclusiveFilter&&t.exclusiveFilter(n))return void(E=E.substr(0,n.tagPosition));n.updateParentNodeText(),-1===t.selfClosing.indexOf(e)&&(E+="</"+e+">")}}},t.parser);return N.write(e),N.end(),E}var s=n(116),u=n(1200),l=n(825),c=n(824),p=n(827),f=n(1181),h=n(982),d=n(497);e.exports=a;var m=/^[^\0\t\n\f\r \/<=>]+$/,v={decodeEntities:!0};a.defaults={allowedTags:["h3","h4","h5","h6","blockquote","p","a","ul","ol","nl","li","b","i","strong","em","strike","code","hr","br","div","table","thead","caption","tbody","tr","th","td","pre","iframe"],allowedAttributes:{a:["href","name","target"],img:["src"]},selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto"],allowedSchemesByTag:{},allowProtocolRelative:!0},a.simpleTransform=function(e,t,n){return n=void 0===n||n,t=t||{},function(r,i){var o;if(n)for(o in t)i[o]=t[o];else i=t;return{tagName:e,attribs:i}}}},function(e,t,n){(function(e,t){!function(e,n){"use strict";function r(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return l[u]=r,s(u),u++}function i(e){delete l[e]}function o(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}function a(e){if(c)setTimeout(a,0,e);else{var t=l[e];if(t){c=!0;try{o(t)}finally{i(e),c=!1}}}}if(!e.setImmediate){var s,u=1,l={},c=!1,p=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?function(){s=function(e){t.nextTick(function(){a(e)})}}():function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&a(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),s=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){a(e.data)},s=function(t){e.port2.postMessage(t)}}():p&&"onreadystatechange"in p.createElement("script")?function(){var e=p.documentElement;s=function(t){var n=p.createElement("script");n.onreadystatechange=function(){a(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():function(){s=function(e){setTimeout(a,0,e)}}(),f.setImmediate=r,f.clearImmediate=i}}("undefined"==typeof self?void 0===e?this:e:self)}).call(t,n(17),n(33))},function(e,t,n){"use strict";function r(e){return e.sort().filter(function(t,n){return JSON.stringify(t)!==JSON.stringify(e[n-1])})}var i=n(978),o=n(507),a=/^\d+$/;t.parse=function(e){return r(e.split(",").map(function(e){var t={};return e.trim().split(/\s+/).forEach(function(e,n){if(0===n)return t.url=e;var r=e.substring(0,e.length-1),o=e[e.length-1],s=parseInt(r,10),u=parseFloat(r);if("w"===o&&a.test(r))t.width=s;else if("h"===o&&a.test(r))t.height=s;else{if("x"!==o||i(u))throw new Error("Invalid srcset descriptor: "+e+".");t.density=u}}),t}))},t.stringify=function(e){return o(e.map(function(e){if(!e.url)throw new Error("URL is required.");var t=[e.url];return e.width&&t.push(e.width+"w"),e.height&&t.push(e.height+"h"),e.density&&t.push(e.density+"x"),t.join(" ")})).join(", ")}},function(e,t,n){e.exports=n(1183)},function(e,t,n){"use strict";(function(e,r){Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(1184),a=function(e){return e&&e.__esModule?e:{default:e}}(o);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var s=(0,a.default)(i);t.default=s}).call(t,n(17),n(72)(e))},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,n){"use strict";e.exports=2147483647},function(e,t,n){"use strict";var r=n(65),i=n(1185);e.exports=function(e){if((e=r(e))>i)throw new TypeError(e+" exceeds maximum possible timeout");return e}},function(e,t,n){"use strict";(function(t){function r(e){e=e||t.location||{};var n,r={},i=typeof e;if("blob:"===e.protocol)r=new a(unescape(e.pathname),{});else if("string"===i){r=new a(e,{});for(n in d)delete r[n]}else if("object"===i){for(n in e)n in d||(r[n]=e[n]);void 0===r.slashes&&(r.slashes=f.test(e.href))}return r}function i(e){var t=p.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function o(e,t){for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,i=n[r-1],o=!1,a=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),a++):a&&(0===r&&(o=!0),n.splice(r,1),a--);return o&&n.unshift(""),"."!==i&&".."!==i||n.push(""),n.join("/")}function a(e,t,n){if(!(this instanceof a))return new a(e,t,n);var s,u,p,f,d,m,v=h.slice(),g=typeof t,y=this,_=0;for("object"!==g&&"string"!==g&&(n=t,t=null),n&&"function"!=typeof n&&(n=c.parse),t=r(t),u=i(e||""),s=!u.protocol&&!u.slashes,y.slashes=u.slashes||s&&t.slashes,y.protocol=u.protocol||t.protocol||"",e=u.rest,u.slashes||(v[2]=[/(.*)/,"pathname"]);_<v.length;_++)f=v[_],p=f[0],m=f[1],p!==p?y[m]=e:"string"==typeof p?~(d=e.indexOf(p))&&("number"==typeof f[2]?(y[m]=e.slice(0,d),e=e.slice(d+f[2])):(y[m]=e.slice(d),e=e.slice(0,d))):(d=p.exec(e))&&(y[m]=d[1],e=e.slice(0,d.index)),y[m]=y[m]||(s&&f[3]?t[m]||"":""),f[4]&&(y[m]=y[m].toLowerCase());n&&(y.query=n(y.query)),s&&t.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==t.pathname)&&(y.pathname=o(y.pathname,t.pathname)),l(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(f=y.auth.split(":"),y.username=f[0]||"",y.password=f[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}function s(e,t,n){var r=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||c.parse)(t)),r[e]=t;break;case"port":r[e]=t,l(t,r.protocol)?t&&(r.host=r.hostname+":"+t):(r.host=r.hostname,r[e]="");break;case"hostname":r[e]=t,r.port&&(t+=":"+r.port),r.host=t;break;case"host":r[e]=t,/:\d+$/.test(t)?(t=t.split(":"),r.port=t.pop(),r.hostname=t.join(":")):(r.hostname=t,r.port="");break;case"protocol":r.protocol=t.toLowerCase(),r.slashes=!n;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";r[e]=t.charAt(0)!==i?i+t:t}else r[e]=t;break;default:r[e]=t}for(var o=0;o<h.length;o++){var a=h[o];a[4]&&(r[a[1]]=r[a[1]].toLowerCase())}return r.origin=r.protocol&&r.host&&"file:"!==r.protocol?r.protocol+"//"+r.host:"null",r.href=r.toString(),r}function u(e){e&&"function"==typeof e||(e=c.stringify);var t,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var i=r+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,t="object"==typeof n.query?e(n.query):n.query,t&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}var l=n(1178),c=n(1005),p=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,f=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,h=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};a.prototype={set:s,toString:u},a.extractProtocol=i,a.location=r,a.qs=c,e.exports=a}).call(t,n(17))},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t){e.exports=function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){var i=e.charCodeAt(n+1);if(i>=56320&&i<=57343){var o=1024*(r-55296)+i-56320+65536;t.push(240+Math.floor(o/64/64/64),128+Math.floor(o/64/64)%64,128+Math.floor(o/64)%64,128+o%64),n+=1;continue}}r>=2048?t.push(224+Math.floor(r/64/64),128+Math.floor(r/64)%64,128+r%64):r>=128?t.push(192+Math.floor(r/64),128+r%64):t.push(r)}return t}},function(e,t){!function(){function e(e,t){function n(e,t){return r(e,new RegExp(a.source,"g"),t)}function r(e,t,n){if(!i(e))return n;var r=0,o=0;do{var a=t.exec(e);if(null===a)break;if(!(o<n))break;r+=a[0].length,o++}while(null!==a);return r>=e.length?-1:r}function i(e){return s.test(e)}function o(e,n){void 0==e&&(e=["[^]"]),void 0==n&&(n="g");var r=[];return t.forEach(function(e){r.push(e.source)}),r.push(a.source),r=r.concat(e),new RegExp(r.join("|"),n)}e.findCharIndex=function(e,t){if(t>=e.length)return-1;if(!i(e))return t;for(var n=o(),r=0;null!==n.exec(e)&&!(n.lastIndex>t);)r++;return r},e.findByteIndex=function(e,t){return t>=this.length(e)?-1:r(e,o(),t)},e.charAt=function(e,t){var n=this.findByteIndex(e,t);if(n<0||n>=e.length)return"";var r=e.slice(n,n+8),i=s.exec(r);return null===i?r[0]:i[0]},e.charCodeAt=function(e,t){var r=n(e,t);if(r<0)return NaN;var i=e.charCodeAt(r);if(55296<=i&&i<=56319){return 1024*(i-55296)+(e.charCodeAt(r+1)-56320)+65536}return i},e.fromCharCode=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):String.fromCharCode(e)},e.indexOf=function(e,t,n){void 0!==n&&null!==n||(n=0);var r=this.findByteIndex(e,n),i=e.indexOf(t,r);return i<0?-1:this.findCharIndex(e,i)},e.lastIndexOf=function(e,t,n){var r;if(void 0===n||null===n)r=e.lastIndexOf(t);else{var i=this.findByteIndex(e,n);r=e.lastIndexOf(t,i)}return r<0?-1:this.findCharIndex(e,r)},e.slice=function(e,t,n){var r,i=this.findByteIndex(e,t);return i<0&&(i=e.length),void 0===n||null===n?r=e.length:(r=this.findByteIndex(e,n))<0&&(r=e.length),e.slice(i,r)},e.substr=function(e,t,n){return t<0&&(t=this.length(e)+t),void 0===n||null===n?this.slice(e,t):this.slice(e,t,t+n)},e.substring=e.slice,e.length=function(e){return this.findCharIndex(e,e.length-1)+1},e.stringToCodePoints=function(e){for(var t=[],n=0;n<e.length&&(codePoint=this.charCodeAt(e,n),codePoint);n++)t.push(codePoint);return t},e.codePointsToString=function(e){for(var t=[],n=0;n<e.length;n++)t.push(this.fromCharCode(e[n]));return t.join("")},e.stringToBytes=function(e){for(var t=[],n=0;n<e.length;n++){for(var r=e.charCodeAt(n),i=[];r>0;)i.push(255&r),r>>=8;1==i.length&&i.push(0),t=t.concat(i.reverse())}return t},e.bytesToString=function(e){for(var t=[],n=0;n<e.length;n+=2){var r=e[n],i=e[n+1],o=r<<8|i;t.push(String.fromCharCode(o))}return t.join("")},e.stringToCharArray=function(e){var t=[],n=o();do{var r=n.exec(e);if(null===r)break;t.push(r[0])}while(null!==r);return t};var a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,s=o([],"")}var n;void 0!==t&&null!==t?n=t:"undefined"!=typeof window&&null!==window&&(void 0!==window.UtfString&&null!==window.UtfString||(window.UtfString={}),n=window.UtfString);var r=/\uD83C[\uDDE6-\uDDFF]\uD83C[\uDDE6-\uDDFF]/;n.visual={},e(n,[]),e(n.visual,[r])}()},function(e,t,n){(function(t){function n(e,t){function n(){if(!i){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}if(r("noDeprecation"))return e;var i=!1;return n}function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=n}).call(t,n(17))},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,n){(function(e,r){function i(e,n){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),x(r.showHidden)&&(r.showHidden=!1),x(r.depth)&&(r.depth=2),x(r.colors)&&(r.colors=!1),x(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function a(e,t){return e}function s(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(e,n,r){if(e.customInspect&&n&&C(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return _(i)||(i=u(e,i,r)),i}var o=l(e,n);if(o)return o;var a=Object.keys(n),m=s(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),S(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(n);if(0===a.length){if(C(n)){var v=n.name?": "+n.name:"";return e.stylize("[Function"+v+"]","special")}if(w(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(S(n))return c(n)}var g="",y=!1,b=["{","}"];if(d(n)&&(y=!0,b=["[","]"]),C(n)){g=" [Function"+(n.name?": "+n.name:"")+"]"}if(w(n)&&(g=" "+RegExp.prototype.toString.call(n)),E(n)&&(g=" "+Date.prototype.toUTCString.call(n)),S(n)&&(g=" "+c(n)),0===a.length&&(!y||0==n.length))return b[0]+g+b[1];if(r<0)return w(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var x;return x=y?p(e,n,r,m,a):a.map(function(t){return f(e,n,r,m,t,y)}),e.seen.pop(),h(x,g,b)}function l(e,t){if(x(t))return e.stylize("undefined","undefined");if(_(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return y(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,i){for(var o=[],a=0,s=t.length;a<s;++a)T(t,String(a))?o.push(f(e,t,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(f(e,t,n,r,i,!0))}),o}function f(e,t,n,r,i,o){var a,s,l;if(l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},l.get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),T(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=v(n)?u(e,l.value,null):u(e,l.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),x(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function h(e,t,n){var r=0;return e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function d(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function g(e){return null==e}function y(e){return"number"==typeof e}function _(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function x(e){return void 0===e}function w(e){return k(e)&&"[object RegExp]"===D(e)}function k(e){return"object"==typeof e&&null!==e}function E(e){return k(e)&&"[object Date]"===D(e)}function S(e){return k(e)&&("[object Error]"===D(e)||e instanceof Error)}function C(e){return"function"==typeof e}function A(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function D(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}function M(){var e=new Date,t=[O(e.getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":");return[e.getDate(),j[e.getMonth()],t].join(" ")}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var P=/%[sdj%]/g;t.format=function(e){if(!_(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,a=String(e).replace(P,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),s=r[n];n<o;s=r[++n])v(s)||!k(s)?a+=" "+s:a+=" "+i(s);return a},t.deprecate=function(n,i){function o(){if(!a){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?console.trace(i):console.error(i),a=!0}return n.apply(this,arguments)}if(x(e.process))return function(){return t.deprecate(n,i).apply(this,arguments)};if(!0===r.noDeprecation)return n;var a=!1;return o};var I,R={};t.debuglog=function(e){if(x(I)&&(I=n.i({NODE_ENV:"production",WEBPACK_INLINE_STYLES:!1}).NODE_DEBUG||""),e=e.toUpperCase(),!R[e])if(new RegExp("\\b"+e+"\\b","i").test(I)){var i=r.pid;R[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,i,n)}}else R[e]=function(){};return R[e]},t.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=g,t.isNumber=y,t.isString=_,t.isSymbol=b,t.isUndefined=x,t.isRegExp=w,t.isObject=k,t.isDate=E,t.isError=S,t.isFunction=C,t.isPrimitive=A,t.isBuffer=n(1193);var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",M(),t.format.apply(t,arguments))},t.inherits=n(1192),t._extend=function(e,t){if(!t||!k(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(t,n(17),n(33))},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";function r(e){return a(e).map(function(e){return{value:e,type:i(e)}})}function i(e){return u(e)?"ClosingTag":c(e)?"OpeningTag":l(e)?"SelfClosingTag":"Text"}var o=n(1177),a=function(e){return e.split(/(<\/?[^>]+>)/g).filter(function(e){return""!==e.trim()})},s=function(e){return/<[^>!]+>/.test(e)},u=function(e){return/<\/+[^>]+>/.test(e)},l=function(e){return/<[^>]+\/>/.test(e)},c=function(e){return s(e)&&!u(e)&&!l(e)};e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.indentor,i=t.textNodesOnSameLine,a=0,s=[];n=n||" ";var u=r(e).map(function(e,t,r){var u=e.value,l=e.type;"ClosingTag"===l&&a--;var c=o(n,a),p=c+u;if("OpeningTag"===l&&a++,i){var f=r[t-1],h=r[t-2];"ClosingTag"===l&&"Text"===f.type&&"OpeningTag"===h.type&&(p=""+c+h.value+f.value+u,s.push(t-2,t-1))}return p});return s.forEach(function(e){return u[e]=null}),u.filter(function(e){return!!e}).join("\n")}},function(e,t){function n(e){return e&&e.replace?e.replace(/([&"<>'])/g,function(e,t){return r[t]}):e}var r={"&":"&",'"':""","'":"'","<":"<",">":">"};e.exports=n},function(e,t,n){(function(t){function r(e,n){function r(e){m?t.nextTick(e):e()}function i(e,t){if(void 0!==t&&(f+=t),e&&!h&&(l=l||new c,h=!0),e&&h){var n=f;r(function(){l.emit("data",n)}),f=""}}function o(e,t){s(i,a(e,d,d?1:0),t)}function u(){if(l){var e=f;r(function(){l.emit("data",e),l.emit("end"),l.readable=!1,l.emit("close")})}}"object"!=typeof n&&(n={indent:n});var l=n.stream?new c:null,f="",h=!1,d=n.indent?!0===n.indent?p:n.indent:"",m=!0;return r(function(){m=!1}),n.declaration&&function(e){var t=e.encoding||"UTF-8",n={version:"1.0",encoding:t};e.standalone&&(n.standalone=e.standalone),o({"?xml":{_attr:n}}),f=f.replace("/>","?>")}(n.declaration),e&&e.forEach?e.forEach(function(t,n){var r;n+1===e.length&&(r=u),o(t,r)}):o(e,u),l?(l.readable=!0,l):f}function i(){var e=Array.prototype.slice.call(arguments),t={_elem:a(e)};return t.push=function(e){if(!this.append)throw new Error("not assigned to a parent!");var t=this,n=this._elem.indent;s(this.append,a(e,n,this._elem.icount+(n?1:0)),function(){t.append(!0)})},t.close=function(e){void 0!==e&&this.push(e),this.end&&this.end()},t}function o(e,t){return new Array(t||0).join(e||"")}function a(e,t,n){function r(e){Object.keys(e).forEach(function(t){f.push(u(t,e[t]))})}n=n||0;var i,s=o(t,n),c=e;if("object"==typeof e){if(i=Object.keys(e)[0],(c=e[i])&&c._elem)return c._elem.name=i,c._elem.icount=n,c._elem.indent=t,c._elem.indents=s,c._elem.interrupt=c,c._elem}var p,f=[],h=[];switch(typeof c){case"object":if(null===c)break;c._attr&&r(c._attr),c._cdata&&h.push(("<![CDATA["+c._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),c.forEach&&(p=!1,h.push(""),c.forEach(function(e){if("object"==typeof e){"_attr"==Object.keys(e)[0]?r(e._attr):h.push(a(e,t,n+1))}else h.pop(),p=!0,h.push(l(e))}),p||h.push(""));break;default:h.push(l(c))}return{name:i,interrupt:!1,attributes:f,content:h,icount:n,indents:s,indent:t}}function s(e,t,n){function r(){for(;t.content.length;){var r=t.content.shift();if(void 0!==r){if(i(r))return;s(e,r)}}e(!1,(o>1?t.indents:"")+(t.name?"</"+t.name+">":"")+(t.indent&&!n?"\n":"")),n&&n()}function i(t){return!!t.interrupt&&(t.interrupt.append=e,t.interrupt.end=r,t.interrupt=!1,e(!0),!0)}if("object"!=typeof t)return e(!1,t);var o=t.interrupt?1:t.content.length;if(e(!1,t.indents+(t.name?"<"+t.name:"")+(t.attributes.length?" "+t.attributes.join(" "):"")+(o?t.name?">":"":t.name?"/>":"")+(t.indent&&o>1?"\n":"")),!o)return e(!1,t.indent?"\n":"");i(t)||r()}function u(e,t){return e+'="'+l(t)+'"'}var l=n(1197),c=n(493).Stream,p=" ";e.exports=r,e.exports.element=e.exports.Element=i}).call(t,n(33))},function(e,t){function n(e,t,n){return r.yubl(t((n||r.yufull)(e)))}t._getPrivFilters=function(){function e(e){var t=e.split(k,2);return!t[0]||2!==t.length&&e.length===t[0].length?null:t[0]}function t(e,t,n,r){function i(e,n,i,a){return n?(n=Number(n[0]<="9"?n:"0"+n),r?A(n):128===n?"€":130===n?"‚":131===n?"ƒ":132===n?"„":133===n?"…":134===n?"†":135===n?"‡":136===n?"ˆ":137===n?"‰":138===n?"Š":139===n?"‹":140===n?"Œ":142===n?"Ž":145===n?"‘":146===n?"’":147===n?"“":148===n?"”":149===n?"•":150===n?"–":151===n?"—":152===n?"˜":153===n?"™":154===n?"š":155===n?"›":156===n?"œ":158===n?"ž":159===n?"Ÿ":n>=55296&&n<=57343||13===n?"�":o.frCoPt(n)):t[i||a]||e}return t=t||m,n=n||d,void 0===e?"undefined":null===e?"null":e.toString().replace(c,"�").replace(n,i)}function n(e){return"\\"+e.charCodeAt(0).toString(16).toLowerCase()+" "}function r(e){return e.replace(_,function(e){return"-x-"+e})}function i(n){n=o.yufull(t(n));var r=e(n);return r&&w[r.toLowerCase()]?"##"+n:n}var o,a=/</g,s=/"/g,u=/'/g,l=/&/g,c=/\x00/g,p=/(?:^$|[\x00\x09-\x0D "'`=<>])/g,f=/[&<>"'`]/g,h=/(?:\x00|^-*!?>|--!?>|--?!?$|\]>|\]$)/g,d=/&(?:#([xX][0-9A-Fa-f]+|\d+);?|(Tab|NewLine|colon|semi|lpar|rpar|apos|sol|comma|excl|ast|midast|ensp|emsp|thinsp);|(nbsp|amp|AMP|lt|LT|gt|GT|quot|QUOT);?)/g,m={Tab:"\t",NewLine:"\n",colon:":",semi:";",lpar:"(",rpar:")",apos:"'",sol:"/",comma:",",excl:"!",ast:"*",midast:"*",ensp:" ",emsp:" ",thinsp:" ",nbsp:" ",amp:"&",lt:"<",gt:">",quot:'"',QUOT:'"'},v=/^(?:(?!-*expression)#?[-\w]+|[+-]?(?:\d+|\d*\.\d+)(?:r?em|ex|ch|cm|mm|in|px|pt|pc|%|vh|vw|vmin|vmax)?|!important|)$/i,g=/[\x00-\x1F\x7F\[\]{}\\"]/g,y=/[\x00-\x1F\x7F\[\]{}\\']/g,_=/url[\(\u207D\u208D]+/g,b=/['\(\)]/g,x=/\/\/%5[Bb]([A-Fa-f0-9:]+)%5[Dd]/,w={javascript:1,data:1,vbscript:1,mhtml:1,"x-schema":1},k=/(?::|&#[xX]0*3[aA];?|�*58;?|:)/,E=/(?:^[\x00-\x20]+|[\t\n\r\x00]+)/g,S={Tab:"\t",NewLine:"\n"},C=function(e,t,n){return void 0===e?"undefined":null===e?"null":e.toString().replace(t,n)},A=String.fromCodePoint||function(e){return 0===arguments.length?"":e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),e%1024+56320))};return o={frCoPt:function(e){return void 0===e||null===e?"":!isFinite(e=Number(e))||e<=0||e>1114111||e>=1&&e<=8||e>=14&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||11===e||65535==(65535&e)||65534==(65535&e)?"�":A(e)},d:t,yup:function(n){return n=e(n.replace(c,"")),n?t(n,S,null,!0).replace(E,"").toLowerCase():null},y:function(e){return C(e,f,function(e){return"&"===e?"&":"<"===e?"<":">"===e?">":'"'===e?""":"'"===e?"'":"`"})},ya:function(e){return C(e,l,"&")},yd:function(e){return C(e,a,"<")},yc:function(e){return C(e,h,function(e){return"\0"===e?"�":"--!"===e||"--"===e||"-"===e||"]"===e?e+" ":e.slice(0,-1)+" >"})},yavd:function(e){return C(e,s,""")},yavs:function(e){return C(e,u,"'")},yavu:function(e){return C(e,p,function(e){return"\t"===e?" ":"\n"===e?" ":"\v"===e?" ":"\f"===e?" ":"\r"===e?" ":" "===e?" ":"="===e?"=":"<"===e?"<":">"===e?">":'"'===e?""":"'"===e?"'":"`"===e?"`":"�"})},yu:encodeURI,yuc:encodeURIComponent,yubl:function(e){return w[o.yup(e)]?"x-"+e:e},yufull:function(e){return o.yu(e).replace(x,function(e,t){return"//["+t+"]"})},yublf:function(e){return o.yubl(o.yufull(e))},yceu:function(e){return e=t(e),v.test(e)?e:";-x:'"+r(e.replace(y,n))+"';-v:"},yced:function(e){return r(t(e).replace(g,n))},yces:function(e){return r(t(e).replace(y,n))},yceuu:function(e){return i(e).replace(b,function(e){return"'"===e?"\\27 ":"("===e?"%28":"%29"})},yceud:function(e){return i(e)},yceus:function(e){return i(e).replace(u,"\\27 ")}}};var r=t._privFilters=t._getPrivFilters();t.inHTMLData=r.yd,t.inHTMLComment=r.yc,t.inSingleQuotedAttr=r.yavs,t.inDoubleQuotedAttr=r.yavd,t.inUnQuotedAttr=r.yavu,t.uriInSingleQuotedAttr=function(e){return n(e,r.yavs)},t.uriInDoubleQuotedAttr=function(e){return n(e,r.yavd)},t.uriInUnQuotedAttr=function(e){return n(e,r.yavu)},t.uriInHTMLData=r.yufull,t.uriInHTMLComment=function(e){return r.yc(r.yufull(e))},t.uriPathInSingleQuotedAttr=function(e){return n(e,r.yavs,r.yu)},t.uriPathInDoubleQuotedAttr=function(e){return n(e,r.yavd,r.yu)},t.uriPathInUnQuotedAttr=function(e){return n(e,r.yavu,r.yu)},t.uriPathInHTMLData=r.yu,t.uriPathInHTMLComment=function(e){return r.yc(r.yu(e))},t.uriQueryInSingleQuotedAttr=t.uriPathInSingleQuotedAttr,t.uriQueryInDoubleQuotedAttr=t.uriPathInDoubleQuotedAttr,t.uriQueryInUnQuotedAttr=t.uriPathInUnQuotedAttr,t.uriQueryInHTMLData=t.uriPathInHTMLData,t.uriQueryInHTMLComment=t.uriPathInHTMLComment,t.uriComponentInSingleQuotedAttr=function(e){return r.yavs(r.yuc(e))},t.uriComponentInDoubleQuotedAttr=function(e){return r.yavd(r.yuc(e))},t.uriComponentInUnQuotedAttr=function(e){return r.yavu(r.yuc(e))},t.uriComponentInHTMLData=r.yuc,t.uriComponentInHTMLComment=function(e){return r.yc(r.yuc(e))},t.uriFragmentInSingleQuotedAttr=function(e){return r.yubl(r.yavs(r.yuc(e)))},t.uriFragmentInDoubleQuotedAttr=function(e){return r.yubl(r.yavd(r.yuc(e)))},t.uriFragmentInUnQuotedAttr=function(e){return r.yubl(r.yavu(r.yuc(e)))},t.uriFragmentInHTMLData=t.uriComponentInHTMLData,t.uriFragmentInHTMLComment=t.uriComponentInHTMLComment},function(e,t){function n(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e}e.exports=n;var r=Object.prototype.hasOwnProperty},function(e,t,n){(function(){var e,t,r,i,o,a=[].slice;o=n(61),e=n(1202),i=n(1205),t=n(1204),r=n(266),this.make_dumper=function(n,s,u,l){var c;return null==n&&(n=e.Emitter),null==s&&(s=i.Serializer),null==u&&(u=t.Representer),null==l&&(l=r.Resolver),c=[n,s,u,l],function(){function e(e,n){var r,i,o;for(null==n&&(n={}),c[0].call(this,e,n),o=c.slice(1),r=0,i=o.length;r<i;r++)t=o[r],t.call(this,n)}var t;return o.extend.apply(o,[e.prototype].concat(a.call(function(){var e,n,r;for(r=[],e=0,n=c.length;e<n;e++)t=c[e],r.push(t.prototype);return r}()))),e}()},this.Dumper=this.make_dumper()}).call(this)},function(e,t,n){(function(){var e,r,i,o,a=function(e,t){function n(){this.constructor=e}for(var r in t)s.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},s={}.hasOwnProperty,u=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};i=n(127),o=n(61),r=n(45).YAMLError,this.EmitterError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return a(t,e),t}(r),this.Emitter=function(){function n(e,t){var n;this.stream=e,this.encoding=null,this.states=[],this.state=this.expect_stream_start,this.events=[],this.event=null,this.indents=[],this.indent=null,this.flow_level=0,this.root_context=!1,this.sequence_context=!1,this.mapping_context=!1,this.simple_key_context=!1,this.line=0,this.column=0,this.whitespace=!0,this.indentation=!0,this.open_ended=!1,this.canonical=t.canonical,this.allow_unicode=t.allow_unicode,null==this.canonical&&(this.canonical=!1),null==this.allow_unicode&&(this.allow_unicode=!0),this.best_indent=1<t.indent&&t.indent<10?t.indent:2,this.best_width=t.width>2*this.indent?t.width:80,this.best_line_break="\r"===(n=t.line_break)||"\n"===n||"\r\n"===n?t.line_break:"\n",this.tag_prefixes=null,this.prepared_anchor=null,this.prepared_tag=null,this.analysis=null,this.style=null}var r,a,l;return r="\0 \t\r\n…\u2028\u2029",a={"!":"!","tag:yaml.org,2002:":"!!"},l={"\0":"0","":"a","\b":"b","\t":"t","\n":"n","\v":"v","\f":"f","\r":"r","":"e",'"':'"',"\\":"\\","…":"N"," ":"_","\u2028":"L","\u2029":"P"},n.prototype.dispose=function(){return this.states=[],this.state=null},n.prototype.emit=function(e){var t;for(this.events.push(e),t=[];!this.need_more_events();)this.event=this.events.shift(),this.state(),t.push(this.event=null);return t},n.prototype.need_more_events=function(){var e;return 0===this.events.length||(e=this.events[0],e instanceof i.DocumentStartEvent?this.need_events(1):e instanceof i.SequenceStartEvent?this.need_events(2):e instanceof i.MappingStartEvent&&this.need_events(3))},n.prototype.need_events=function(e){var t,n,r,o,a;for(o=0,a=this.events.slice(1),n=0,r=a.length;n<r;n++)if(t=a[n],t instanceof i.DocumentStartEvent||t instanceof i.CollectionStartEvent?o++:t instanceof i.DocumentEndEvent||t instanceof i.CollectionEndEvent?o--:t instanceof i.StreamEndEvent&&(o=-1),o<0)return!1;return this.events.length<e+1},n.prototype.increase_indent=function(e){return null==e&&(e={}),this.indents.push(this.indent),null==this.indent?this.indent=e.flow?this.best_indent:0:e.indentless?void 0:this.indent+=this.best_indent},n.prototype.expect_stream_start=function(){return this.event instanceof i.StreamStartEvent?(!this.event.encoding||"encoding"in this.stream||(this.encoding=this.event.encoding),this.write_stream_start(),this.state=this.expect_first_document_start):this.error("expected StreamStartEvent, but got",this.event)},n.prototype.expect_nothing=function(){return this.error("expected nothing, but got",this.event)},n.prototype.expect_first_document_start=function(){return this.expect_document_start(!0)},n.prototype.expect_document_start=function(e){var t,n,r,u,l,c,p;if(null==e&&(e=!1),this.event instanceof i.DocumentStartEvent){if((this.event.version||this.event.tags)&&this.open_ended&&(this.write_indicator("...",!0),this.write_indent()),this.event.version&&this.write_version_directive(this.prepare_version(this.event.version)),this.tag_prefixes=o.clone(a),this.event.tags)for(p=function(){var e,t;e=this.event.tags,t=[];for(u in e)s.call(e,u)&&t.push(u);return t}.call(this).sort(),r=0,l=p.length;r<l;r++)n=p[r],c=this.event.tags[n],this.tag_prefixes[c]=n,this.write_tag_directive(this.prepare_tag_handle(n),this.prepare_tag_prefix(c));return t=!e||this.event.explicit||this.canonical||this.event.version||this.event.tags||this.check_empty_document(),t&&(this.write_indent(),this.write_indicator("---",!0),this.canonical&&this.write_indent()),this.state=this.expect_document_root}return this.event instanceof i.StreamEndEvent?(this.open_ended&&(this.write_indicator("...",!0),this.write_indent()),this.write_stream_end(),this.state=this.expect_nothing):this.error("expected DocumentStartEvent, but got",this.event)},n.prototype.expect_document_end=function(){return this.event instanceof i.DocumentEndEvent?(this.write_indent(),this.event.explicit&&(this.write_indicator("...",!0),this.write_indent()),this.flush_stream(),this.state=this.expect_document_start):this.error("expected DocumentEndEvent, but got",this.event)},n.prototype.expect_document_root=function(){return this.states.push(this.expect_document_end),this.expect_node({root:!0})},n.prototype.expect_node=function(e){return null==e&&(e={}),this.root_context=!!e.root,this.sequence_context=!!e.sequence,this.mapping_context=!!e.mapping,this.simple_key_context=!!e.simple_key,this.event instanceof i.AliasEvent?this.expect_alias():this.event instanceof i.ScalarEvent||this.event instanceof i.CollectionStartEvent?(this.process_anchor("&"),this.process_tag(),this.event instanceof i.ScalarEvent?this.expect_scalar():this.event instanceof i.SequenceStartEvent?this.flow_level||this.canonical||this.event.flow_style||this.check_empty_sequence()?this.expect_flow_sequence():this.expect_block_sequence():this.event instanceof i.MappingStartEvent?this.flow_level||this.canonical||this.event.flow_style||this.check_empty_mapping()?this.expect_flow_mapping():this.expect_block_mapping():void 0):this.error("expected NodeEvent, but got",this.event)},n.prototype.expect_alias=function(){return this.event.anchor||this.error("anchor is not specified for alias"),this.process_anchor("*"),this.state=this.states.pop()},n.prototype.expect_scalar=function(){return this.increase_indent({flow:!0}),this.process_scalar(),this.indent=this.indents.pop(),this.state=this.states.pop()},n.prototype.expect_flow_sequence=function(){return this.write_indicator("[",!0,{whitespace:!0}),this.flow_level++,this.increase_indent({flow:!0}),this.state=this.expect_first_flow_sequence_item},n.prototype.expect_first_flow_sequence_item=function(){return this.event instanceof i.SequenceEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.write_indicator("]",!1),this.state=this.states.pop()):((this.canonical||this.column>this.best_width)&&this.write_indent(),this.states.push(this.expect_flow_sequence_item),this.expect_node({sequence:!0}))},n.prototype.expect_flow_sequence_item=function(){return this.event instanceof i.SequenceEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.canonical&&(this.write_indicator(",",!1),this.write_indent()),this.write_indicator("]",!1),this.state=this.states.pop()):(this.write_indicator(",",!1),(this.canonical||this.column>this.best_width)&&this.write_indent(),this.states.push(this.expect_flow_sequence_item),this.expect_node({sequence:!0}))},n.prototype.expect_flow_mapping=function(){return this.write_indicator("{",!0,{whitespace:!0}),this.flow_level++,this.increase_indent({flow:!0}),this.state=this.expect_first_flow_mapping_key},n.prototype.expect_first_flow_mapping_key=function(){return this.event instanceof i.MappingEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.write_indicator("}",!1),this.state=this.states.pop()):((this.canonical||this.column>this.best_width)&&this.write_indent(),!this.canonical&&this.check_simple_key()?(this.states.push(this.expect_flow_mapping_simple_value),this.expect_node({mapping:!0,simple_key:!0})):(this.write_indicator("?",!0),this.states.push(this.expect_flow_mapping_value),this.expect_node({mapping:!0})))},n.prototype.expect_flow_mapping_key=function(){return this.event instanceof i.MappingEndEvent?(this.indent=this.indents.pop(),this.flow_level--,this.canonical&&(this.write_indicator(",",!1),this.write_indent()),this.write_indicator("}",!1),this.state=this.states.pop()):(this.write_indicator(",",!1),(this.canonical||this.column>this.best_width)&&this.write_indent(),!this.canonical&&this.check_simple_key()?(this.states.push(this.expect_flow_mapping_simple_value),this.expect_node({mapping:!0,simple_key:!0})):(this.write_indicator("?",!0),this.states.push(this.expect_flow_mapping_value),this.expect_node({mapping:!0})))},n.prototype.expect_flow_mapping_simple_value=function(){return this.write_indicator(":",!1),this.states.push(this.expect_flow_mapping_key),this.expect_node({mapping:!0})},n.prototype.expect_flow_mapping_value=function(){return(this.canonical||this.column>this.best_width)&&this.write_indent(),this.write_indicator(":",!0),this.states.push(this.expect_flow_mapping_key),this.expect_node({mapping:!0})},n.prototype.expect_block_sequence=function(){var e;return e=this.mapping_context&&!this.indentation,this.increase_indent({indentless:e}),this.state=this.expect_first_block_sequence_item},n.prototype.expect_first_block_sequence_item=function(){return this.expect_block_sequence_item(!0)},n.prototype.expect_block_sequence_item=function(e){return null==e&&(e=!1),!e&&this.event instanceof i.SequenceEndEvent?(this.indent=this.indents.pop(),this.state=this.states.pop()):(this.write_indent(),this.write_indicator("-",!0,{indentation:!0}),this.states.push(this.expect_block_sequence_item),this.expect_node({sequence:!0}))},n.prototype.expect_block_mapping=function(){return this.increase_indent(),this.state=this.expect_first_block_mapping_key},n.prototype.expect_first_block_mapping_key=function(){return this.expect_block_mapping_key(!0)},n.prototype.expect_block_mapping_key=function(e){return null==e&&(e=!1),!e&&this.event instanceof i.MappingEndEvent?(this.indent=this.indents.pop(),this.state=this.states.pop()):(this.write_indent(),this.check_simple_key()?(this.states.push(this.expect_block_mapping_simple_value),this.expect_node({mapping:!0,simple_key:!0})):(this.write_indicator("?",!0,{indentation:!0}),this.states.push(this.expect_block_mapping_value),this.expect_node({mapping:!0})))},n.prototype.expect_block_mapping_simple_value=function(){return this.write_indicator(":",!1),this.states.push(this.expect_block_mapping_key),this.expect_node({mapping:!0})},n.prototype.expect_block_mapping_value=function(){return this.write_indent(),this.write_indicator(":",!0,{indentation:!0}),this.states.push(this.expect_block_mapping_key),this.expect_node({mapping:!0})},n.prototype.check_empty_document=function(){var e;return this.event instanceof i.DocumentStartEvent&&0!==this.events.length&&((e=this.events[0])instanceof i.ScalarEvent&&null==e.anchor&&null==e.tag&&e.implicit&&""===e.value)},n.prototype.check_empty_sequence=function(){return this.event instanceof i.SequenceStartEvent&&this.events[0]instanceof i.SequenceEndEvent},n.prototype.check_empty_mapping=function(){return this.event instanceof i.MappingStartEvent&&this.events[0]instanceof i.MappingEndEvent},n.prototype.check_simple_key=function(){var e;return e=0,this.event instanceof i.NodeEvent&&null!=this.event.anchor&&(null==this.prepared_anchor&&(this.prepared_anchor=this.prepare_anchor(this.event.anchor)),e+=this.prepared_anchor.length),null!=this.event.tag&&(this.event instanceof i.ScalarEvent||this.event instanceof i.CollectionStartEvent)&&(null==this.prepared_tag&&(this.prepared_tag=this.prepare_tag(this.event.tag)),e+=this.prepared_tag.length),this.event instanceof i.ScalarEvent&&(null==this.analysis&&(this.analysis=this.analyze_scalar(this.event.value)),e+=this.analysis.scalar.length),e<128&&(this.event instanceof i.AliasEvent||this.event instanceof i.ScalarEvent&&!this.analysis.empty&&!this.analysis.multiline||this.check_empty_sequence()||this.check_empty_mapping())},n.prototype.process_anchor=function(e){return null==this.event.anchor?void(this.prepared_anchor=null):(null==this.prepared_anchor&&(this.prepared_anchor=this.prepare_anchor(this.event.anchor)),this.prepared_anchor&&this.write_indicator(""+e+this.prepared_anchor,!0),this.prepared_anchor=null)},n.prototype.process_tag=function(){var e;if(e=this.event.tag,this.event instanceof i.ScalarEvent){if(null==this.style&&(this.style=this.choose_scalar_style()),(!this.canonical||null==e)&&(""===this.style&&this.event.implicit[0]||""!==this.style&&this.event.implicit[1]))return void(this.prepared_tag=null);this.event.implicit[0]&&null==e&&(e="!",this.prepared_tag=null)}else if((!this.canonical||null==e)&&this.event.implicit)return void(this.prepared_tag=null);return null==e&&this.error("tag is not specified"),null==this.prepared_tag&&(this.prepared_tag=this.prepare_tag(e)),this.write_indicator(this.prepared_tag,!0),this.prepared_tag=null},n.prototype.process_scalar=function(){var e;switch(null==this.analysis&&(this.analysis=this.analyze_scalar(this.event.value)),null==this.style&&(this.style=this.choose_scalar_style()),e=!this.simple_key_context,this.style){case'"':this.write_double_quoted(this.analysis.scalar,e);break;case"'":this.write_single_quoted(this.analysis.scalar,e);break;case">":this.write_folded(this.analysis.scalar);break;case"|":this.write_literal(this.analysis.scalar);break;default:this.write_plain(this.analysis.scalar,e)}return this.analysis=null,this.style=null},n.prototype.choose_scalar_style=function(){var e;return null==this.analysis&&(this.analysis=this.analyze_scalar(this.event.value)),'"'===this.event.style||this.canonical?'"':this.event.style||!this.event.implicit[0]||this.simple_key_context&&(this.analysis.empty||this.analysis.multiline)||!(this.flow_level&&this.analysis.allow_flow_plain||!this.flow_level&&this.analysis.allow_block_plain)?this.event.style&&(e=this.event.style,u.call("|>",e)>=0)&&!this.flow_level&&!this.simple_key_context&&this.analysis.allow_block?this.event.style:this.event.style&&"'"!==this.event.style||!this.analysis.allow_single_quoted||this.simple_key_context&&this.analysis.multiline?'"':"'":""},n.prototype.prepare_version=function(e){var t,n,r;return t=e[0],n=e[1],r=t+"."+n,1===t?r:this.error("unsupported YAML version",r)},n.prototype.prepare_tag_handle=function(e){var t,n,r,i;for(e||this.error("tag handle must not be empty"),"!"===e[0]&&"!"===e.slice(-1)||this.error("tag handle must start and end with '!':",e),i=e.slice(1,-1),n=0,r=i.length;n<r;n++)"0"<=(t=i[n])&&t<="9"||"A"<=t&&t<="Z"||"a"<=t&&t<="z"||u.call("-_",t)>=0||this.error("invalid character '"+t+"' in the tag handle:",e);return e},n.prototype.prepare_tag_prefix=function(e){var t,n,r,i;for(e||this.error("tag prefix must not be empty"),n=[],i=0,r=+("!"===e[0]);r<e.length;)t=e[r],"0"<=t&&t<="9"||"A"<=t&&t<="Z"||"a"<=t&&t<="z"||u.call("-;/?!:@&=+$,_.~*'()[]",t)>=0?r++:(i<r&&n.push(e.slice(i,r)),i=r+=1,n.push(t));return i<r&&n.push(e.slice(i,r)),n.join("")},n.prototype.prepare_tag=function(e){var t,n,r,i,o,a,l,c,p,f,h,d;if(e||this.error("tag must not be empty"),"!"===e)return e;for(i=null,h=e,p=function(){var e,t;e=this.tag_prefixes,t=[];for(a in e)s.call(e,a)&&t.push(a);return t}.call(this).sort(),o=0,l=p.length;o<l;o++)c=p[o],0===e.indexOf(c)&&("!"===c||c.length<e.length)&&(i=this.tag_prefixes[c],h=e.slice(c.length));for(n=[],f=r=0;r<h.length;)t=h[r],"0"<=t&&t<="9"||"A"<=t&&t<="Z"||"a"<=t&&t<="z"||u.call("-;/?!:@&=+$,_.~*'()[]",t)>=0||"!"===t&&"!"!==i?r++:(f<r&&n.push(h.slice(f,r)),f=r+=1,n.push(t));return f<r&&n.push(h.slice(f,r)),d=n.join(""),i?""+i+d:"!<"+d+">"},n.prototype.prepare_anchor=function(e){var t,n,r;for(e||this.error("anchor must not be empty"),n=0,r=e.length;n<r;n++)"0"<=(t=e[n])&&t<="9"||"A"<=t&&t<="Z"||"a"<=t&&t<="z"||u.call("-_",t)>=0||this.error("invalid character '"+t+"' in the anchor:",e);return e},n.prototype.analyze_scalar=function(t){var n,i,o,a,s,l,c,p,f,h,d,m,v,g,y,_,b,x,w,k,E,S,C,A,D;for(t||new e(t,!0,!1,!1,!0,!0,!0,!1),l=!1,f=!1,_=!1,C=!1,!1,g=!1,v=!1,D=!1,A=!1,c=!1,S=!1,0!==t.indexOf("---")&&0!==t.indexOf("...")||(l=!0,f=!0),b=!0,h=1===t.length||(k=t[1],u.call("\0 \t\r\n…\u2028\u2029",k)>=0),w=!1,x=!1,m=0,m=d=0,y=t.length;d<y;m=++d)p=t[m],0===m?u.call("#,[]{}&*!|>'\"%@`",p)>=0||"-"===p&&h?(f=!0,l=!0):u.call("?:",p)>=0&&(f=!0,h&&(l=!0)):u.call(",?[]{}",p)>=0?f=!0:":"===p?(f=!0,h&&(l=!0)):"#"===p&&b&&(f=!0,l=!0),u.call("\n…\u2028\u2029",p)>=0&&(_=!0),"\n"===p||" "<=p&&p<="~"||("\ufeff"!==p&&("…"===p||" "<=p&&p<="퟿"||""<=p&&p<="�")?(!0,this.allow_unicode||(C=!0)):C=!0)," "===p?(0===m&&(g=!0),m===t.length-1&&(D=!0),x&&(c=!0),x=!1,w=!0):u.call("\n…\u2028\u2029",p)>=0?(0===m&&(v=!0),m===t.length-1&&(A=!0),w&&(S=!0),x=!0,w=!1):(x=!1,w=!1),b=u.call(r,p)>=0,h=m+2>=t.length||(E=t[m+2],u.call(r,E)>=0);return a=!0,i=!0,s=!0,o=!0,n=!0,(g||v||D||A)&&(a=i=!1),D&&(n=!1),c&&(a=i=s=!1),(S||C)&&(a=i=s=n=!1),_&&(a=i=!1),f&&(a=!1),l&&(i=!1),new e(t,!1,_,a,i,s,o,n)},n.prototype.write_stream_start=function(){if(this.encoding&&0===this.encoding.indexOf("utf-16"))return this.stream.write("\ufeff",this.encoding)},n.prototype.write_stream_end=function(){return this.flush_stream()},n.prototype.write_indicator=function(e,t,n){var r;return null==n&&(n={}),r=this.whitespace||!t?e:" "+e,this.whitespace=!!n.whitespace,this.indentation&&(this.indentation=!!n.indentation),this.column+=r.length,this.open_ended=!1,this.stream.write(r,this.encoding)},n.prototype.write_indent=function(){var e,t,n;if(t=null!=(n=this.indent)?n:0,(!this.indentation||this.column>t||this.column===t&&!this.whitespace)&&this.write_line_break(),this.column<t)return this.whitespace=!0,e=new Array(t-this.column+1).join(" "),this.column=t,this.stream.write(e,this.encoding)},n.prototype.write_line_break=function(e){return this.whitespace=!0,this.indentation=!0,this.line+=1,this.column=0,this.stream.write(null!=e?e:this.best_line_break,this.encoding)},n.prototype.write_version_directive=function(e){return this.stream.write("%YAML "+e,this.encoding),this.write_line_break()},n.prototype.write_tag_directive=function(e,t){return this.stream.write("%TAG "+e+" "+t,this.encoding),this.write_line_break()},n.prototype.write_single_quoted=function(e,t){var n,r,i,o,a,s,l,c,p,f;for(null==t&&(t=!0),this.write_indicator("'",!0),p=!1,r=!1,f=a=0;a<=e.length;){if(i=e[a],p)null!=i&&" "===i||(f+1===a&&this.column>this.best_width&&t&&0!==f&&a!==e.length?this.write_indent():(o=e.slice(f,a),this.column+=o.length,this.stream.write(o,this.encoding)),f=a);else if(r){if(null==i||u.call("\n…\u2028\u2029",i)<0){for("\n"===e[f]&&this.write_line_break(),c=e.slice(f,a),s=0,l=c.length;s<l;s++)n=c[s],"\n"===n?this.write_line_break():this.write_line_break(n);this.write_indent(),f=a}}else(null==i||u.call(" \n…\u2028\u2029",i)>=0||"'"===i)&&f<a&&(o=e.slice(f,a),this.column+=o.length,this.stream.write(o,this.encoding),f=a);"'"===i&&(this.column+=2,this.stream.write("''",this.encoding),f=a+1),null!=i&&(p=" "===i,r=u.call("\n…\u2028\u2029",i)>=0),a++}return this.write_indicator("'",!1)},n.prototype.write_double_quoted=function(e,t){var n,r,i,a;for(null==t&&(t=!0),this.write_indicator('"',!0),a=i=0;i<=e.length;)n=e[i],(null==n||u.call('"\\…\u2028\u2029\ufeff',n)>=0||!(" "<=n&&n<="~"||this.allow_unicode&&(" "<=n&&n<="퟿"||""<=n&&n<="�")))&&(a<i&&(r=e.slice(a,i),this.column+=r.length,this.stream.write(r,this.encoding),a=i),null!=n&&(r=n in l?"\\"+l[n]:n<="ÿ"?"\\x"+o.pad_left(o.to_hex(n),"0",2):n<="￿"?"\\u"+o.pad_left(o.to_hex(n),"0",4):"\\U"+o.pad_left(o.to_hex(n),"0",16),this.column+=r.length,this.stream.write(r,this.encoding),a=i+1)),t&&0<i&&i<e.length-1&&(" "===n||a>=i)&&this.column+(i-a)>this.best_width&&(r=e.slice(a,i)+"\\",a<i&&(a=i),this.column+=r.length,this.stream.write(r,this.encoding),this.write_indent(),this.whitespace=!1,this.indentation=!1," "===e[a]&&(r="\\",this.column+=r.length,this.stream.write(r,this.encoding))),i++;return this.write_indicator('"',!1)},n.prototype.write_folded=function(e){var t,n,r,i,o,a,s,l,c,p,f,h,d;for(a=this.determine_block_hints(e),this.write_indicator(">"+a,!0),"+"===a.slice(-1)&&(this.open_ended=!0),this.write_line_break(),l=!0,n=!0,h=!1,d=o=0,f=[];o<=e.length;){if(r=e[o],n){if(null==r||u.call("\n…\u2028\u2029",r)<0){for(l||null==r||" "===r||"\n"!==e[d]||this.write_line_break(),l=" "===r,p=e.slice(d,o),s=0,c=p.length;s<c;s++)t=p[s],"\n"===t?this.write_line_break():this.write_line_break(t);null!=r&&this.write_indent(),d=o}}else h?" "!==r&&(d+1===o&&this.column>this.best_width?this.write_indent():(i=e.slice(d,o),this.column+=i.length,this.stream.write(i,this.encoding)),d=o):(null==r||u.call(" \n…\u2028\u2029",r)>=0)&&(i=e.slice(d,o),this.column+=i.length,this.stream.write(i,this.encoding),null==r&&this.write_line_break(),d=o);null!=r&&(n=u.call("\n…\u2028\u2029",r)>=0,h=" "===r),f.push(o++)}return f},n.prototype.write_literal=function(e){var t,n,r,i,o,a,s,l,c,p,f;for(a=this.determine_block_hints(e),this.write_indicator("|"+a,!0),"+"===a.slice(-1)&&(this.open_ended=!0),this.write_line_break(),n=!0,f=o=0,p=[];o<=e.length;){if(r=e[o],n){if(null==r||u.call("\n…\u2028\u2029",r)<0){for(c=e.slice(f,o),s=0,l=c.length;s<l;s++)t=c[s],"\n"===t?this.write_line_break():this.write_line_break(t);null!=r&&this.write_indent(),f=o}}else(null==r||u.call("\n…\u2028\u2029",r)>=0)&&(i=e.slice(f,o),this.stream.write(i,this.encoding),null==r&&this.write_line_break(),f=o);null!=r&&(n=u.call("\n…\u2028\u2029",r)>=0),p.push(o++)}return p},n.prototype.write_plain=function(e,t){var n,r,i,o,a,s,l,c,p,f,h;if(null==t&&(t=!0),e){for(this.root_context&&(this.open_ended=!0),this.whitespace||(o=" ",this.column+=o.length,this.stream.write(o,this.encoding)),this.whitespace=!1,this.indentation=!1,f=!1,r=!1,h=a=0,p=[];a<=e.length;){if(i=e[a],f)" "!==i&&(h+1===a&&this.column>this.best_width&&t?(this.write_indent(),this.whitespace=!1,this.indentation=!1):(o=e.slice(h,a),this.column+=o.length,this.stream.write(o,this.encoding)),h=a);else if(r){if(u.call("\n…\u2028\u2029",i)<0){for("\n"===e[h]&&this.write_line_break(),c=e.slice(h,a),s=0,l=c.length;s<l;s++)n=c[s],"\n"===n?this.write_line_break():this.write_line_break(n);this.write_indent(),this.whitespace=!1,this.indentation=!1,h=a}}else(null==i||u.call(" \n…\u2028\u2029",i)>=0)&&(o=e.slice(h,a),this.column+=o.length,this.stream.write(o,this.encoding),h=a);null!=i&&(f=" "===i,r=u.call("\n…\u2028\u2029",i)>=0),p.push(a++)}return p}},n.prototype.determine_block_hints=function(e){var t,n,r,i,o;return n="",t=e[0],r=e.length-2,o=e[r++],i=e[r++],u.call(" \n…\u2028\u2029",t)>=0&&(n+=this.best_indent),u.call("\n…\u2028\u2029",i)<0?n+="-":(1===e.length||u.call("\n…\u2028\u2029",o)>=0)&&(n+="+"),n},n.prototype.flush_stream=function(){var e;return"function"==typeof(e=this.stream).flush?e.flush():void 0},n.prototype.error=function(e,n){var r,i;throw n&&(n=null!=(r=null!=n&&null!=(i=n.constructor)?i.name:void 0)?r:o.inspect(n)),new t.EmitterError(e+(n?" "+n:""))},n}(),e=function(){function e(e,t,n,r,i,o,a,s){this.scalar=e,this.empty=t,this.multiline=n,this.allow_flow_plain=r,this.allow_block_plain=i,this.allow_single_quoted=o,this.allow_double_quoted=a,this.allow_block=s}return e}()}).call(this)},function(e,t,n){(function(){var e,t,r,i,o,a,s,u=[].slice;s=n(61),i=n(501),a=n(502),r=n(500),e=n(498),o=n(266),t=n(499),this.make_loader=function(n,l,c,p,f,h){var d;return null==n&&(n=i.Reader),null==l&&(l=a.Scanner),null==c&&(c=r.Parser),null==p&&(p=e.Composer),null==f&&(f=o.Resolver),null==h&&(h=t.Constructor),d=[n,l,c,p,f,h],function(){function e(e){var n,r,i;for(d[0].call(this,e),i=d.slice(1),n=0,r=i.length;n<r;n++)t=i[n],t.call(this)}var t;return s.extend.apply(s,[e.prototype].concat(u.call(function(){var e,n,r;for(r=[],e=0,n=d.length;e<n;e++)t=d[e],r.push(t.prototype);return r}()))),e}()},this.Loader=this.make_loader()}).call(this)},function(e,t,n){(function(){var e,r,i=function(e,t){function n(){this.constructor=e}for(var r in t)o.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},o={}.hasOwnProperty;r=n(94),e=n(45).YAMLError,this.RepresenterError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return i(t,e),t}(e),this.BaseRepresenter=function(){function e(e){var t;t=null!=e?e:{},this.default_style=t.default_style,this.default_flow_style=t.default_flow_style,this.represented_objects={},this.object_keeper=[],this.alias_key=null}return e.prototype.yaml_representers_types=[],e.prototype.yaml_representers_handlers=[],e.prototype.yaml_multi_representers_types=[],e.prototype.yaml_multi_representers_handlers=[],e.add_representer=function(e,t){return this.prototype.hasOwnProperty("yaml_representers_types")||(this.prototype.yaml_representers_types=[].concat(this.prototype.yaml_representers_types)),this.prototype.hasOwnProperty("yaml_representers_handlers")||(this.prototype.yaml_representers_handlers=[].concat(this.prototype.yaml_representers_handlers)),this.prototype.yaml_representers_types.push(e),this.prototype.yaml_representers_handlers.push(t)},e.add_multi_representer=function(e,t){return this.prototype.hasOwnProperty("yaml_multi_representers_types")||(this.prototype.yaml_multi_representers_types=[].concat(this.prototype.yaml_multi_representers_types)),this.prototype.hasOwnProperty("yaml_multi_representers_handlers")||(this.prototype.yaml_multi_representers_handlers=[].concat(this.prototype.yaml_multi_representers_handlers)),this.prototype.yaml_multi_representers_types.push(e),this.prototype.yaml_multi_representers_handlers.push(t)},e.prototype.represent=function(e){var t;return t=this.represent_data(e),this.serialize(t),this.represented_objects={},this.object_keeper=[],this.alias_key=null},e.prototype.represent_data=function(e){var t,n,i,o,a,s,u;if(this.ignore_aliases(e))this.alias_key=null;else if(-1!==(n=this.object_keeper.indexOf(e))){if(this.alias_key=n,this.alias_key in this.represented_objects)return this.represented_objects[this.alias_key]}else this.alias_key=this.object_keeper.length,this.object_keeper.push(e);if(s=null,t=null===e?"null":typeof e,"object"===t&&(t=e.constructor),-1!==(n=this.yaml_representers_types.lastIndexOf(t))&&(s=this.yaml_representers_handlers[n]),null==s)for(a=this.yaml_multi_representers_types,n=i=0,o=a.length;i<o;n=++i)if(u=a[n],e instanceof u){s=this.yaml_multi_representers_handlers[n];break}return null==s&&(-1!==(n=this.yaml_multi_representers_types.lastIndexOf(void 0))?s=this.yaml_multi_representers_handlers[n]:-1!==(n=this.yaml_representers_types.lastIndexOf(void 0))&&(s=this.yaml_representers_handlers[n])),null!=s?s.call(this,e):new r.ScalarNode(null,""+e)},e.prototype.represent_scalar=function(e,t,n){var i;return null==n&&(n=this.default_style),i=new r.ScalarNode(e,t,null,null,n),null!=this.alias_key&&(this.represented_objects[this.alias_key]=i),i},e.prototype.represent_sequence=function(e,t,n){var i,o,a,s,u,l,c,p;for(p=[],u=new r.SequenceNode(e,p,null,null,n),null!=this.alias_key&&(this.represented_objects[this.alias_key]=u),i=!0,a=0,s=t.length;a<s;a++)o=t[a],l=this.represent_data(o),l instanceof r.ScalarNode||l.style||(i=!1),p.push(l);return null==n&&(u.flow_style=null!=(c=this.default_flow_style)?c:i),u},e.prototype.represent_mapping=function(e,t,n){var i,a,s,u,l,c,p,f;f=[],u=new r.MappingNode(e,f,n),this.alias_key&&(this.represented_objects[this.alias_key]=u),i=!0;for(a in t)o.call(t,a)&&(s=t[a],l=this.represent_data(a),c=this.represent_data(s),l instanceof r.ScalarNode||l.style||(i=!1),c instanceof r.ScalarNode||c.style||(i=!1),f.push([l,c]));return n||(u.flow_style=null!=(p=this.default_flow_style)?p:i),u},e.prototype.ignore_aliases=function(e){return!1},e}(),this.Representer=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return i(n,e),n.prototype.represent_boolean=function(e){return this.represent_scalar("tag:yaml.org,2002:bool",e?"true":"false")},n.prototype.represent_null=function(e){return this.represent_scalar("tag:yaml.org,2002:null","null")},n.prototype.represent_number=function(e){var t,n;return t="tag:yaml.org,2002:"+(e%1==0?"int":"float"),n=e!==e?".nan":Infinity===e?".inf":-Infinity===e?"-.inf":e.toString(),this.represent_scalar(t,n)},n.prototype.represent_string=function(e){return this.represent_scalar("tag:yaml.org,2002:str",e)},n.prototype.represent_array=function(e){return this.represent_sequence("tag:yaml.org,2002:seq",e)},n.prototype.represent_date=function(e){return this.represent_scalar("tag:yaml.org,2002:timestamp",e.toISOString())},n.prototype.represent_object=function(e){return this.represent_mapping("tag:yaml.org,2002:map",e)},n.prototype.represent_undefined=function(e){throw new t.RepresenterError("cannot represent an onbject: "+e)},n.prototype.ignore_aliases=function(e){var t;return null==e||("boolean"==(t=typeof e)||"number"===t||"string"===t)},n}(this.BaseRepresenter),this.Representer.add_representer("boolean",this.Representer.prototype.represent_boolean),this.Representer.add_representer("null",this.Representer.prototype.represent_null),this.Representer.add_representer("number",this.Representer.prototype.represent_number),this.Representer.add_representer("string",this.Representer.prototype.represent_string),this.Representer.add_representer(Array,this.Representer.prototype.represent_array),this.Representer.add_representer(Date,this.Representer.prototype.represent_date),this.Representer.add_representer(Object,this.Representer.prototype.represent_object),this.Representer.add_representer(null,this.Representer.prototype.represent_undefined)}).call(this)},function(e,t,n){(function(){var e,t,r,i,o=function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},a={}.hasOwnProperty;t=n(127),r=n(94),i=n(61),e=n(45).YAMLError,this.SerializerError=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t}(e),this.Serializer=function(){function e(e){var t;t=null!=e?e:{},this.encoding=t.encoding,this.explicit_start=t.explicit_start,this.explicit_end=t.explicit_end,this.version=t.version,this.tags=t.tags,this.serialized_nodes={},this.anchors={},this.last_anchor_id=0,this.closed=null}return e.prototype.open=function(){if(null===this.closed)return this.emit(new t.StreamStartEvent(this.encoding)),this.closed=!1;throw this.closed?new SerializerError("serializer is closed"):new SerializerError("serializer is already open")},e.prototype.close=function(){if(null===this.closed)throw new SerializerError("serializer is not opened");if(!this.closed)return this.emit(new t.StreamEndEvent),this.closed=!0},e.prototype.serialize=function(e){if(null===this.closed)throw new SerializerError("serializer is not opened");if(this.closed)throw new SerializerError("serializer is closed");return null!=e&&(this.emit(new t.DocumentStartEvent(void 0,void 0,this.explicit_start,this.version,this.tags)),this.anchor_node(e),this.serialize_node(e),this.emit(new t.DocumentEndEvent(void 0,void 0,this.explicit_end))),this.serialized_nodes={},this.anchors={},this.last_anchor_id=0},e.prototype.anchor_node=function(e){var t,n,i,o,a,s,u,l,c,p,f,h,d,m;if(e.unique_id in this.anchors)return null!=(t=this.anchors)[l=e.unique_id]?t[l]:t[l]=this.generate_anchor(e);if(this.anchors[e.unique_id]=null,e instanceof r.SequenceNode){for(c=e.value,h=[],n=0,s=c.length;n<s;n++)i=c[n],h.push(this.anchor_node(i));return h}if(e instanceof r.MappingNode){for(p=e.value,d=[],o=0,u=p.length;o<u;o++)f=p[o],a=f[0],m=f[1],this.anchor_node(a),d.push(this.anchor_node(m));return d}},e.prototype.generate_anchor=function(e){return"id"+i.pad_left(++this.last_anchor_id,"0",4)},e.prototype.serialize_node=function(e,n,i){var o,a,s,u,l,c,p,f,h,d,m,v,g,y;if(o=this.anchors[e.unique_id],e.unique_id in this.serialized_nodes)return this.emit(new t.AliasEvent(o));if(this.serialized_nodes[e.unique_id]=!0,this.descend_resolver(n,i),e instanceof r.ScalarNode)s=this.resolve(r.ScalarNode,e.value,[!0,!1]),a=this.resolve(r.ScalarNode,e.value,[!1,!0]),l=[e.tag===s,e.tag===a],this.emit(new t.ScalarEvent(o,e.tag,l,e.value,void 0,void 0,e.style));else if(e instanceof r.SequenceNode){for(l=e.tag===this.resolve(r.SequenceNode,e.value,!0),this.emit(new t.SequenceStartEvent(o,e.tag,l,void 0,void 0,e.flow_style)),m=e.value,i=u=0,h=m.length;u<h;i=++u)c=m[i],this.serialize_node(c,e,i);this.emit(new t.SequenceEndEvent)}else if(e instanceof r.MappingNode){for(l=e.tag===this.resolve(r.MappingNode,e.value,!0),this.emit(new t.MappingStartEvent(o,e.tag,l,void 0,void 0,e.flow_style)),v=e.value,p=0,d=v.length;p<d;p++)g=v[p],f=g[0],y=g[1],this.serialize_node(f,e,null),this.serialize_node(y,e,f);this.emit(new t.MappingEndEvent)}return this.ascend_resolver()},e}()}).call(this)},function(e,t,n){(function(){var e,r,i;this.composer=n(498),this.constructor=n(499),e=this.dumper=n(1201),this.errors=n(45),this.events=n(127),r=this.loader=n(1203),this.nodes=n(94),this.parser=n(500),this.reader=n(501),this.resolver=n(266),this.scanner=n(502),this.tokens=n(267),i=n(61),this.scan=function(e,t){var n,i;for(null==t&&(t=r.Loader),n=new t(e),i=[];n.check_token();)i.push(n.get_token());return i},this.parse=function(e,t){var n,i;for(null==t&&(t=r.Loader),n=new t(e),i=[];n.check_event();)i.push(n.get_event());return i},this.compose=function(e,t){var n;return null==t&&(t=r.Loader),n=new t(e),n.get_single_node()},this.compose_all=function(e,t){var n,i;for(null==t&&(t=r.Loader),n=new t(e),i=[];n.check_node();)i.push(n.get_node());return i},this.load=function(e,t){var n;return null==t&&(t=r.Loader),n=new t(e),n.get_single_data()},this.load_all=function(e,t){var n,i;for(null==t&&(t=r.Loader),n=new t(e),i=[];n.check_data();)i.push(n.get_data());return i},this.emit=function(t,n,r,o){var a,s,u,l,c;null==r&&(r=e.Dumper),null==o&&(o={}),s=n||new i.StringStream,a=new r(s,o);try{for(l=0,c=t.length;l<c;l++)u=t[l],a.emit(u)}finally{a.dispose()}return n||s.string},this.serialize=function(n,r,i,o){return null==i&&(i=e.Dumper),null==o&&(o={}),t.serialize_all([n],r,i,o)},this.serialize_all=function(t,n,r,o){var a,s,u,l,c;null==r&&(r=e.Dumper),null==o&&(o={}),s=n||new i.StringStream,a=new r(s,o);try{for(a.open(),u=0,l=t.length;u<l;u++)c=t[u],a.serialize(c);a.close()}finally{a.dispose()}return n||s.string},this.dump=function(n,r,i,o){return null==i&&(i=e.Dumper),null==o&&(o={}),t.dump_all([n],r,i,o)},this.dump_all=function(t,n,r,o){var a,s,u,l,c;null==r&&(r=e.Dumper),null==o&&(o={}),s=n||new i.StringStream,a=new r(s,o);try{for(a.open(),l=0,c=t.length;l<c;l++)u=t[l],a.represent(u);a.close()}finally{a.dispose()}return n||s.string}}).call(this)},function(e,t,n){var r,i,o;!function(n,a){i=[],r=a(),void 0!==(o="function"==typeof r?r.apply(t,i):r)&&(e.exports=o)}(0,function(){"use strict";var e=function(e){return"getComputedStyle"in window&&"smooth"===window.getComputedStyle(e)["scroll-behavior"]};if("undefined"==typeof window||!("document"in window))return{};var t=function(t,n,r){n=n||999,r||0===r||(r=9);var i,o=function(e){i=e},a=function(){clearTimeout(i),o(0)},s=function(e){return Math.max(0,t.getTopOf(e)-r)},u=function(r,i,s){if(a(),0===i||i&&i<0||e(t.body))t.toY(r),s&&s();else{var u=t.getY(),l=Math.max(0,r)-u,c=(new Date).getTime();i=i||Math.min(Math.abs(l),n),function e(){o(setTimeout(function(){var n=Math.min(1,((new Date).getTime()-c)/i),r=Math.max(0,Math.floor(u+l*(n<.5?2*n*n:n*(4-2*n)-1)));t.toY(r),n<1&&t.getHeight()+r<t.body.scrollHeight?e():(setTimeout(a,99),s&&s())},9))}()}},l=function(e,t,n){u(s(e),t,n)},c=function(e,n,i){var o=e.getBoundingClientRect().height,a=t.getTopOf(e)+o,c=t.getHeight(),p=t.getY(),f=p+c;s(e)<p||o+r>c?l(e,n,i):a+r>f?u(a-c+r,n,i):i&&i()},p=function(e,n,r,i){u(Math.max(0,t.getTopOf(e)-t.getHeight()/2+(r||e.getBoundingClientRect().height/2)),n,i)};return{setup:function(e,t){return(0===e||e)&&(n=e),(0===t||t)&&(r=t),{defaultDuration:n,edgeOffset:r}},to:l,toY:u,intoView:c,center:p,stop:a,moving:function(){return!!i},getY:t.getY,getTopOf:t.getTopOf}},n=document.documentElement,r=function(){return window.scrollY||n.scrollTop},i=t({body:document.scrollingElement||document.body,toY:function(e){window.scrollTo(0,e)},getY:r,getHeight:function(){return window.innerHeight||n.clientHeight},getTopOf:function(e){return e.getBoundingClientRect().top+r()-n.offsetTop}});if(i.createScroller=function(e,r,i){return t({body:e,toY:function(t){e.scrollTop=t},getY:function(){return e.scrollTop},getHeight:function(){return Math.min(e.clientHeight,window.innerHeight||n.clientHeight)},getTopOf:function(e){return e.offsetTop}},r,i)},"addEventListener"in window&&!window.noZensmooth&&!e(document.body)){var o="scrollRestoration"in history;o&&(history.scrollRestoration="auto"),window.addEventListener("load",function(){o&&(setTimeout(function(){history.scrollRestoration="manual"},9),window.addEventListener("popstate",function(e){e.state&&"zenscrollY"in e.state&&i.toY(e.state.zenscrollY)},!1)),window.location.hash&&setTimeout(function(){var e=i.setup().edgeOffset;if(e){var t=document.getElementById(window.location.href.split("#")[1]);if(t){var n=Math.max(0,i.getTopOf(t)-e),r=i.getY()-n;0<=r&&r<9&&window.scrollTo(0,n)}}},9)},!1);var a=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",function(e){for(var t=e.target;t&&"A"!==t.tagName;)t=t.parentNode;if(!(!t||1!==e.which||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)){if(o)try{history.replaceState({zenscrollY:i.getY()},"")}catch(e){}var n=t.getAttribute("href")||"";if(0===n.indexOf("#")&&!a.test(t.className)){var r=0,s=document.getElementById(n.substring(1));if("#"!==n){if(!s)return;r=i.getTopOf(s)}e.preventDefault();var u=function(){window.location=n},l=i.setup().edgeOffset;l&&(r=Math.max(0,r-l),u=function(){history.pushState(null,"",n)}),i.toY(r,null,u)}}},!1)}return i})},function(e,t,n){function r(e){return n(i(e))}function i(e){var t=o[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var o={"./all.js":271,"./ast/ast.js":272,"./ast/index.js":273,"./ast/jump-to-path.jsx":274,"./auth/actions.js":168,"./auth/index.js":275,"./auth/reducers.js":276,"./auth/selectors.js":277,"./auth/spec-wrap-actions.js":278,"./configs/actions.js":169,"./configs/index.js":279,"./configs/reducers.js":280,"./configs/selectors.js":281,"./deep-linking/helpers.js":282,"./deep-linking/index.js":283,"./deep-linking/layout-wrap-actions.js":284,"./deep-linking/spec-wrap-actions.js":285,"./download-url.js":286,"./err/actions.js":128,"./err/error-transformers/hook.js":287,"./err/error-transformers/transformers/not-of-type.js":288,"./err/error-transformers/transformers/parameter-oneof.js":289,"./err/error-transformers/transformers/strip-instance.js":290,"./err/index.js":291,"./err/reducers.js":292,"./err/selectors.js":293,"./layout/actions.js":170,"./layout/index.js":294,"./layout/reducers.js":295,"./layout/selectors.js":296,"./logs/index.js":297,"./oas3/actions.js":171,"./oas3/auth-extensions/wrap-selectors.js":298,"./oas3/components/callbacks.jsx":299,"./oas3/components/http-auth.jsx":300,"./oas3/components/index.js":301,"./oas3/components/operation-link.jsx":302,"./oas3/components/operation-servers.jsx":303,"./oas3/components/request-body-editor.jsx":304,"./oas3/components/request-body.jsx":305,"./oas3/components/servers.jsx":306,"./oas3/helpers.js":34,"./oas3/index.js":307,"./oas3/reducers.js":308,"./oas3/selectors.js":309,"./oas3/spec-extensions/selectors.js":310,"./oas3/spec-extensions/wrap-selectors.js":311,"./oas3/wrap-components/auth-item.jsx":312,"./oas3/wrap-components/index.js":313,"./oas3/wrap-components/markdown.js":314,"./oas3/wrap-components/model.jsx":315,"./oas3/wrap-components/online-validator-badge.js":316,"./oas3/wrap-components/parameters.jsx":317,"./oas3/wrap-components/version-stamp.jsx":318,"./samples/fn.js":172,"./samples/index.js":319,"./spec/actions.js":173,"./spec/index.js":320,"./spec/reducers.js":321,"./spec/selectors.js":322,"./spec/wrap-actions.js":323,"./split-pane-mode/components/split-pane-mode.jsx":324,"./split-pane-mode/index.js":325,"./swagger-js/index.js":326,"./util/index.js":327,"./view/index.js":328,"./view/root-injects.js":329};r.keys=function(){return Object.keys(o)},r.resolve=i,e.exports=r,r.id=1208},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){n(505),e.exports=n(504)}])}); -//# sourceMappingURL=swagger-ui-bundle.js.map + */var r,o="";e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var n=e.length*t;if(r!==e||void 0===r)r=e,o="";else if(o.length>=n)return o.substr(0,n);for(;n>o.length&&t>1;)1&t&&(o+=e),t>>=1,e+=e;return o=(o+=e).substr(0,n)}},function(e,t,n){"use strict";var r=n(39).assign,o=n(981),i=n(983),a=n(994),s=n(1009),u=n(190),c={default:n(1028),full:n(1029),commonmark:n(1030)};function l(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function p(e,t){"string"!=typeof e&&(t=e,e="default"),this.inline=new s,this.block=new a,this.core=new i,this.renderer=new o,this.ruler=new u,this.options={},this.configure(c[e]),this.set(t||{})}p.prototype.set=function(e){r(this.options,e)},p.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enable(e.components[n].rules,!0)})},p.prototype.use=function(e,t){return e(this,t),this},p.prototype.parse=function(e,t){var n=new l(this,e,t);return this.core.process(n),n.tokens},p.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},p.prototype.parseInline=function(e,t){var n=new l(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},p.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=p,e.exports.utils=n(39)},function(e,t,n){"use strict";var r=n(39),o=n(982);function i(){this.rules=r.assign({},o),this.getBreak=o.getBreak}e.exports=i,i.prototype.renderInline=function(e,t,n){for(var r=this.rules,o=e.length,i=0,a="";o--;)a+=r[e[i].type](e,i++,t,n,this);return a},i.prototype.render=function(e,t,n){for(var r=this.rules,o=e.length,i=-1,a="";++i<o;)"inline"===e[i].type?a+=this.renderInline(e[i].children,t,n):a+=r[e[i].type](e,i,t,n,this);return a}},function(e,t,n){"use strict";var r=n(39).has,o=n(39).unescapeMd,i=n(39).replaceEntities,a=n(39).escapeHtml,s={};s.blockquote_open=function(){return"<blockquote>\n"},s.blockquote_close=function(e,t){return"</blockquote>"+u(e,t)},s.code=function(e,t){return e[t].block?"<pre><code>"+a(e[t].content)+"</code></pre>"+u(e,t):"<code>"+a(e[t].content)+"</code>"},s.fence=function(e,t,n,s,c){var l,p,f=e[t],h="",d=n.langPrefix;if(f.params){if(p=(l=f.params.split(/\s+/g)).join(" "),r(c.rules.fence_custom,l[0]))return c.rules.fence_custom[l[0]](e,t,n,s,c);h=' class="'+d+a(i(o(p)))+'"'}return"<pre><code"+h+">"+(n.highlight&&n.highlight.apply(n.highlight,[f.content].concat(l))||a(f.content))+"</code></pre>"+u(e,t)},s.fence_custom={},s.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},s.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},s.hr=function(e,t,n){return(n.xhtmlOut?"<hr />":"<hr>")+u(e,t)},s.bullet_list_open=function(){return"<ul>\n"},s.bullet_list_close=function(e,t){return"</ul>"+u(e,t)},s.list_item_open=function(){return"<li>"},s.list_item_close=function(){return"</li>\n"},s.ordered_list_open=function(e,t){var n=e[t];return"<ol"+(n.order>1?' start="'+n.order+'"':"")+">\n"},s.ordered_list_close=function(e,t){return"</ol>"+u(e,t)},s.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},s.paragraph_close=function(e,t){var n=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"</p>")+(n?u(e,t):"")},s.link_open=function(e,t,n){var r=e[t].title?' title="'+a(i(e[t].title))+'"':"",o=n.linkTarget?' target="'+n.linkTarget+'"':"";return'<a href="'+a(e[t].href)+'"'+r+o+">"},s.link_close=function(){return"</a>"},s.image=function(e,t,n){var r=' src="'+a(e[t].src)+'"',s=e[t].title?' title="'+a(i(e[t].title))+'"':"";return"<img"+r+(' alt="'+(e[t].alt?a(i(o(e[t].alt))):"")+'"')+s+(n.xhtmlOut?" /":"")+">"},s.table_open=function(){return"<table>\n"},s.table_close=function(){return"</table>\n"},s.thead_open=function(){return"<thead>\n"},s.thead_close=function(){return"</thead>\n"},s.tbody_open=function(){return"<tbody>\n"},s.tbody_close=function(){return"</tbody>\n"},s.tr_open=function(){return"<tr>"},s.tr_close=function(){return"</tr>\n"},s.th_open=function(e,t){var n=e[t];return"<th"+(n.align?' style="text-align:'+n.align+'"':"")+">"},s.th_close=function(){return"</th>"},s.td_open=function(e,t){var n=e[t];return"<td"+(n.align?' style="text-align:'+n.align+'"':"")+">"},s.td_close=function(){return"</td>"},s.strong_open=function(){return"<strong>"},s.strong_close=function(){return"</strong>"},s.em_open=function(){return"<em>"},s.em_close=function(){return"</em>"},s.del_open=function(){return"<del>"},s.del_close=function(){return"</del>"},s.ins_open=function(){return"<ins>"},s.ins_close=function(){return"</ins>"},s.mark_open=function(){return"<mark>"},s.mark_close=function(){return"</mark>"},s.sub=function(e,t){return"<sub>"+a(e[t].content)+"</sub>"},s.sup=function(e,t){return"<sup>"+a(e[t].content)+"</sup>"},s.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},s.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},s.text=function(e,t){return a(e[t].content)},s.htmlblock=function(e,t){return e[t].content},s.htmltag=function(e,t){return e[t].content},s.abbr_open=function(e,t){return'<abbr title="'+a(i(e[t].title))+'">'},s.abbr_close=function(){return"</abbr>"},s.footnote_ref=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+n+'" id="'+r+'">['+n+"]</a></sup>"},s.footnote_block_open=function(e,t,n){return(n.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},s.footnote_block_close=function(){return"</ol>\n</section>\n"},s.footnote_open=function(e,t){return'<li id="fn'+Number(e[t].id+1).toString()+'" class="footnote-item">'},s.footnote_close=function(){return"</li>\n"},s.footnote_anchor=function(e,t){var n="fnref"+Number(e[t].id+1).toString();return e[t].subId>0&&(n+=":"+e[t].subId),' <a href="#'+n+'" class="footnote-backref">↩</a>'},s.dl_open=function(){return"<dl>\n"},s.dt_open=function(){return"<dt>"},s.dd_open=function(){return"<dd>"},s.dl_close=function(){return"</dl>\n"},s.dt_close=function(){return"</dt>\n"},s.dd_close=function(){return"</dd>\n"};var u=s.getBreak=function(e,t){return(t=function e(t,n){return++n>=t.length-2?n:"paragraph_open"===t[n].type&&t[n].tight&&"inline"===t[n+1].type&&0===t[n+1].content.length&&"paragraph_close"===t[n+2].type&&t[n+2].tight?e(t,n+2):n}(e,t))<e.length&&"list_item_close"===e[t].type?"":"\n"};e.exports=s},function(e,t,n){"use strict";var r=n(190),o=[["block",n(984)],["abbr",n(985)],["references",n(986)],["inline",n(987)],["footnote_tail",n(988)],["abbr2",n(989)],["replacements",n(990)],["smartquotes",n(991)],["linkify",n(992)]];function i(){this.options={},this.ruler=new r;for(var e=0;e<o.length;e++)this.ruler.push(o[e][0],o[e][1])}i.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},e.exports=i},function(e,t,n){"use strict";e.exports=function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}},function(e,t,n){"use strict";var r=n(269),o=n(191);function i(e,t,n,i){var a,s,u,c,l,p;if(42!==e.charCodeAt(0))return-1;if(91!==e.charCodeAt(1))return-1;if(-1===e.indexOf("]:"))return-1;if(a=new r(e,t,n,i,[]),(s=o(a,1))<0||58!==e.charCodeAt(s+1))return-1;for(c=a.posMax,u=s+2;u<c&&10!==a.src.charCodeAt(u);u++);return l=e.slice(2,s),0===(p=e.slice(s+2,u).trim()).length?-1:(i.abbreviations||(i.abbreviations={}),void 0===i.abbreviations[":"+l]&&(i.abbreviations[":"+l]=p),u)}e.exports=function(e){var t,n,r,o,a=e.tokens;if(!e.inlineMode)for(t=1,n=a.length-1;t<n;t++)if("paragraph_open"===a[t-1].type&&"inline"===a[t].type&&"paragraph_close"===a[t+1].type){for(r=a[t].content;r.length&&!((o=i(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();a[t].content=r,r.length||(a[t-1].tight=!0,a[t+1].tight=!0)}}},function(e,t,n){"use strict";var r=n(269),o=n(191),i=n(464),a=n(466),s=n(467);function u(e,t,n,u){var c,l,p,f,h,d,m,v,g;if(91!==e.charCodeAt(0))return-1;if(-1===e.indexOf("]:"))return-1;if(c=new r(e,t,n,u,[]),(l=o(c,0))<0||58!==e.charCodeAt(l+1))return-1;for(f=c.posMax,p=l+2;p<f&&(32===(h=c.src.charCodeAt(p))||10===h);p++);if(!i(c,p))return-1;for(m=c.linkContent,d=p=c.pos,p+=1;p<f&&(32===(h=c.src.charCodeAt(p))||10===h);p++);for(p<f&&d!==p&&a(c,p)?(v=c.linkContent,p=c.pos):(v="",p=d);p<f&&32===c.src.charCodeAt(p);)p++;return p<f&&10!==c.src.charCodeAt(p)?-1:(g=s(e.slice(1,l)),void 0===u.references[g]&&(u.references[g]={title:v,href:m}),p)}e.exports=function(e){var t,n,r,o,i=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=i.length-1;t<n;t++)if("inline"===i[t].type&&"paragraph_open"===i[t-1].type&&"paragraph_close"===i[t+1].type){for(r=i[t].content;r.length&&!((o=u(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();i[t].content=r,r.length||(i[t-1].tight=!0,i[t+1].tight=!0)}}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,o=e.tokens;for(n=0,r=o.length;n<r;n++)"inline"===(t=o[n]).type&&e.inline.parse(t.content,e.options,e.env,t.children)}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r,o,i,a,s,u,c,l=0,p=!1,f={};if(e.env.footnotes&&(e.tokens=e.tokens.filter(function(e){return"footnote_reference_open"===e.type?(p=!0,u=[],c=e.label,!1):"footnote_reference_close"===e.type?(p=!1,f[":"+c]=u,!1):(p&&u.push(e),!p)}),e.env.footnotes.list)){for(a=e.env.footnotes.list,e.tokens.push({type:"footnote_block_open",level:l++}),t=0,n=a.length;t<n;t++){for(e.tokens.push({type:"footnote_open",id:t,level:l++}),a[t].tokens?((s=[]).push({type:"paragraph_open",tight:!1,level:l++}),s.push({type:"inline",content:"",level:l,children:a[t].tokens}),s.push({type:"paragraph_close",tight:!1,level:--l})):a[t].label&&(s=f[":"+a[t].label]),e.tokens=e.tokens.concat(s),i="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,o=a[t].count>0?a[t].count:1,r=0;r<o;r++)e.tokens.push({type:"footnote_anchor",id:t,subId:r,level:l});i&&e.tokens.push(i),e.tokens.push({type:"footnote_close",level:--l})}e.tokens.push({type:"footnote_block_close",level:--l})}}},function(e,t,n){"use strict";function r(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}e.exports=function(e){var t,n,o,i,a,s,u,c,l,p,f,h,d=e.tokens;if(e.env.abbreviations)for(e.env.abbrRegExp||(h="(^|["+" \n()[]'\".,!?-".split("").map(r).join("")+"])("+Object.keys(e.env.abbreviations).map(function(e){return e.substr(1)}).sort(function(e,t){return t.length-e.length}).map(r).join("|")+")($|["+" \n()[]'\".,!?-".split("").map(r).join("")+"])",e.env.abbrRegExp=new RegExp(h,"g")),p=e.env.abbrRegExp,n=0,o=d.length;n<o;n++)if("inline"===d[n].type)for(t=(i=d[n].children).length-1;t>=0;t--)if("text"===(a=i[t]).type){for(c=0,s=a.content,p.lastIndex=0,l=a.level,u=[];f=p.exec(s);)p.lastIndex>c&&u.push({type:"text",content:s.slice(c,f.index+f[1].length),level:l}),u.push({type:"abbr_open",title:e.env.abbreviations[":"+f[2]],level:l++}),u.push({type:"text",content:f[2],level:l}),u.push({type:"abbr_close",level:--l}),c=p.lastIndex-f[3].length;u.length&&(c<s.length&&u.push({type:"text",content:s.slice(c),level:l}),d[n].children=i=[].concat(i.slice(0,t),u,i.slice(t+1)))}}},function(e,t,n){"use strict";var r=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,o=/\((c|tm|r|p)\)/gi,i={c:"©",r:"®",p:"§",tm:"™"};e.exports=function(e){var t,n,a,s,u,c;if(e.options.typographer)for(u=e.tokens.length-1;u>=0;u--)if("inline"===e.tokens[u].type)for(t=(s=e.tokens[u].children).length-1;t>=0;t--)"text"===(n=s[t]).type&&(a=n.content,a=(c=a).indexOf("(")<0?c:c.replace(o,function(e,t){return i[t.toLowerCase()]}),r.test(a)&&(a=a.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),n.content=a)}},function(e,t,n){"use strict";var r=/['"]/,o=/['"]/g,i=/[-\s()\[\]]/;function a(e,t){return!(t<0||t>=e.length)&&!i.test(e[t])}function s(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}e.exports=function(e){var t,n,i,u,c,l,p,f,h,d,m,v,g,y,b,_,w;if(e.options.typographer)for(w=[],b=e.tokens.length-1;b>=0;b--)if("inline"===e.tokens[b].type)for(_=e.tokens[b].children,w.length=0,t=0;t<_.length;t++)if("text"===(n=_[t]).type&&!r.test(n.text)){for(p=_[t].level,g=w.length-1;g>=0&&!(w[g].level<=p);g--);w.length=g+1,c=0,l=(i=n.content).length;e:for(;c<l&&(o.lastIndex=c,u=o.exec(i));)if(f=!a(i,u.index-1),c=u.index+1,y="'"===u[0],(h=!a(i,c))||f){if(m=!h,v=!f)for(g=w.length-1;g>=0&&(d=w[g],!(w[g].level<p));g--)if(d.single===y&&w[g].level===p){d=w[g],y?(_[d.token].content=s(_[d.token].content,d.pos,e.options.quotes[2]),n.content=s(n.content,u.index,e.options.quotes[3])):(_[d.token].content=s(_[d.token].content,d.pos,e.options.quotes[0]),n.content=s(n.content,u.index,e.options.quotes[1])),w.length=g;continue e}m?w.push({token:t,pos:u.index,single:y,level:p}):v&&y&&(n.content=s(n.content,u.index,"’"))}else y&&(n.content=s(n.content,u.index,"’"))}}},function(e,t,n){"use strict";var r=n(993),o=/www|@|\:\/\//;function i(e){return/^<\/a\s*>/i.test(e)}function a(){var e=[],t=new r({stripPrefix:!1,url:!0,email:!0,twitter:!1,replaceFn:function(t,n){switch(n.getType()){case"url":e.push({text:n.matchedText,url:n.getUrl()});break;case"email":e.push({text:n.matchedText,url:"mailto:"+n.getEmail().replace(/^mailto:/i,"")})}return!1}});return{links:e,autolinker:t}}e.exports=function(e){var t,n,r,s,u,c,l,p,f,h,d,m,v,g,y=e.tokens,b=null;if(e.options.linkify)for(n=0,r=y.length;n<r;n++)if("inline"===y[n].type)for(d=0,t=(s=y[n].children).length-1;t>=0;t--)if("link_close"!==(u=s[t]).type){if("htmltag"===u.type&&(g=u.content,/^<a[>\s]/i.test(g)&&d>0&&d--,i(u.content)&&d++),!(d>0)&&"text"===u.type&&o.test(u.content)){if(b||(m=(b=a()).links,v=b.autolinker),c=u.content,m.length=0,v.link(c),!m.length)continue;for(l=[],h=u.level,p=0;p<m.length;p++)e.inline.validateLink(m[p].url)&&((f=c.indexOf(m[p].text))&&(h=h,l.push({type:"text",content:c.slice(0,f),level:h})),l.push({type:"link_open",href:m[p].url,title:"",level:h++}),l.push({type:"text",content:m[p].text,level:h}),l.push({type:"link_close",level:--h}),c=c.slice(f+m[p].text.length));c.length&&l.push({type:"text",content:c,level:h}),y[n].children=s=[].concat(s.slice(0,t),l,s.slice(t+1))}}else for(t--;s[t].level!==u.level&&"link_open"!==s[t].type;)t--}},function(e,t,n){var r,o,i; +/*! + * Autolinker.js + * 0.28.1 + * + * Copyright(c) 2016 Gregory Jacobs <greg@greg-jacobs.com> + * MIT License + * + * https://github.com/gregjacobs/Autolinker.js + */o=[],void 0===(i="function"==typeof(r=function(){var e,t,n,r,o,i,a,s=function(e){e=e||{},this.version=s.version,this.urls=this.normalizeUrlsCfg(e.urls),this.email="boolean"!=typeof e.email||e.email,this.twitter="boolean"!=typeof e.twitter||e.twitter,this.phone="boolean"!=typeof e.phone||e.phone,this.hashtag=e.hashtag||!1,this.newWindow="boolean"!=typeof e.newWindow||e.newWindow,this.stripPrefix="boolean"!=typeof e.stripPrefix||e.stripPrefix;var t=this.hashtag;if(!1!==t&&"twitter"!==t&&"facebook"!==t&&"instagram"!==t)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||"",this.replaceFn=e.replaceFn||null,this.htmlParser=null,this.matchers=null,this.tagBuilder=null};return s.link=function(e,t){return new s(t).link(e)},s.version="0.28.1",s.prototype={constructor:s,normalizeUrlsCfg:function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},normalizeTruncateCfg:function(e){return"number"==typeof e?{length:e,location:"end"}:s.Util.defaults(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},parse:function(e){for(var t=this.getHtmlParser().parse(e),n=0,r=[],o=0,i=t.length;o<i;o++){var a=t[o],s=a.getType();if("element"===s&&"a"===a.getTagName())a.isClosing()?n=Math.max(n-1,0):n++;else if("text"===s&&0===n){var u=this.parseText(a.getText(),a.getOffset());r.push.apply(r,u)}}return r=this.compactMatches(r),r=this.removeUnwantedMatches(r)},compactMatches:function(e){e.sort(function(e,t){return e.getOffset()-t.getOffset()});for(var t=0;t<e.length-1;t++)for(var n=e[t],r=n.getOffset()+n.getMatchedText().length;t+1<e.length&&e[t+1].getOffset()<=r;)e.splice(t+1,1);return e},removeUnwantedMatches:function(e){var t=s.Util.remove;return this.hashtag||t(e,function(e){return"hashtag"===e.getType()}),this.email||t(e,function(e){return"email"===e.getType()}),this.phone||t(e,function(e){return"phone"===e.getType()}),this.twitter||t(e,function(e){return"twitter"===e.getType()}),this.urls.schemeMatches||t(e,function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()}),this.urls.wwwMatches||t(e,function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()}),this.urls.tldMatches||t(e,function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()}),e},parseText:function(e,t){t=t||0;for(var n=this.getMatchers(),r=[],o=0,i=n.length;o<i;o++){for(var a=n[o].parseMatches(e),s=0,u=a.length;s<u;s++)a[s].setOffset(t+a[s].getOffset());r.push.apply(r,a)}return r},link:function(e){if(!e)return"";for(var t=this.parse(e),n=[],r=0,o=0,i=t.length;o<i;o++){var a=t[o];n.push(e.substring(r,a.getOffset())),n.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return n.push(e.substring(r)),n.join("")},createMatchReturnVal:function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this,this,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof s.HtmlTag?t.toAnchorString():e.buildTag().toAnchorString()},getHtmlParser:function(){var e=this.htmlParser;return e||(e=this.htmlParser=new s.htmlParser.HtmlParser),e},getMatchers:function(){if(this.matchers)return this.matchers;var e=s.matcher,t=this.getTagBuilder(),n=[new e.Hashtag({tagBuilder:t,serviceName:this.hashtag}),new e.Email({tagBuilder:t}),new e.Phone({tagBuilder:t}),new e.Twitter({tagBuilder:t}),new e.Url({tagBuilder:t,stripPrefix:this.stripPrefix})];return this.matchers=n},getTagBuilder:function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new s.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e}},s.match={},s.matcher={},s.htmlParser={},s.truncate={},s.Util={abstractMethod:function(){throw"abstract"},trimRegex:/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,assign:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},defaults:function(e,t){for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=t[n]);return e},extend:function(e,t){var n,r=e.prototype,o=function(){};o.prototype=r;var i=(n=t.hasOwnProperty("constructor")?t.constructor:function(){r.constructor.apply(this,arguments)}).prototype=new o;return i.constructor=n,i.superclass=r,delete t.constructor,s.Util.assign(i,t),n},ellipsis:function(e,t,n){return e.length>t&&(n=null==n?"..":n,e=e.substring(0,t-n.length)+n),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},remove:function(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],o=0;n=t.exec(e);)r.push(e.substring(o,n.index)),r.push(n[0]),o=n.index+n[0].length;return r.push(e.substring(o)),r},trim:function(e){return e.replace(this.trimRegex,"")}},s.HtmlTag=s.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(e){s.Util.assign(this,e),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){return this.getAttrs()[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(e){var t=this.getAttrs();return s.Util.assign(t,e),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,o=s.Util.indexOf,i=n?n.split(r):[],a=e.split(r);t=a.shift();)-1===o(i,t)&&i.push(t);return this.getAttrs().class=i.join(" "),this},removeClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,o=s.Util.indexOf,i=n?n.split(r):[],a=e.split(r);i.length&&(t=a.shift());){var u=o(i,t);-1!==u&&i.splice(u,1)}return this.getAttrs().class=i.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toAnchorString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")}}),s.RegexLib={alphaNumericCharsStr:a="A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞭꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯෦-෯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꧰-꧹꩐-꩙꯰-꯹0-9",domainNameRegex:new RegExp("["+a+".\\-]*["+a+"\\-]"),tldRegex:/(?:travelersinsurance|sandvikcoromant|kerryproperties|cancerresearch|weatherchannel|kerrylogistics|spreadbetting|international|wolterskluwer|lifeinsurance|construction|pamperedchef|scholarships|versicherung|bridgestone|creditunion|kerryhotels|investments|productions|blackfriday|enterprises|lamborghini|photography|motorcycles|williamhill|playstation|contractors|barclaycard|accountants|redumbrella|engineering|management|telefonica|protection|consulting|tatamotors|creditcard|vlaanderen|schaeffler|associates|properties|foundation|republican|bnpparibas|boehringer|eurovision|extraspace|industries|immobilien|university|technology|volkswagen|healthcare|restaurant|cuisinella|vistaprint|apartments|accountant|travelers|homedepot|institute|vacations|furniture|fresenius|insurance|christmas|bloomberg|solutions|barcelona|firestone|financial|kuokgroup|fairwinds|community|passagens|goldpoint|equipment|lifestyle|yodobashi|aquarelle|marketing|analytics|education|amsterdam|statefarm|melbourne|allfinanz|directory|microsoft|stockholm|montblanc|accenture|lancaster|landrover|everbank|istanbul|graphics|grainger|ipiranga|softbank|attorney|pharmacy|saarland|catering|airforce|yokohama|mortgage|frontier|mutuelle|stcgroup|memorial|pictures|football|symantec|cipriani|ventures|telecity|cityeats|verisign|flsmidth|boutique|cleaning|firmdale|clinique|clothing|redstone|infiniti|deloitte|feedback|services|broadway|plumbing|commbank|training|barclays|exchange|computer|brussels|software|delivery|barefoot|builders|business|bargains|engineer|holdings|download|security|helsinki|lighting|movistar|discount|hdfcbank|supplies|marriott|property|diamonds|capetown|partners|democrat|jpmorgan|bradesco|budapest|rexroth|zuerich|shriram|academy|science|support|youtube|singles|surgery|alibaba|statoil|dentist|schwarz|android|cruises|cricket|digital|markets|starhub|systems|courses|coupons|netbank|country|domains|corsica|network|neustar|realtor|lincoln|limited|schmidt|yamaxun|cooking|contact|auction|spiegel|liaison|leclerc|latrobe|lasalle|abogado|compare|lanxess|exposed|express|company|cologne|college|avianca|lacaixa|fashion|recipes|ferrero|komatsu|storage|wanggou|clubmed|sandvik|fishing|fitness|bauhaus|kitchen|flights|florist|flowers|watches|weather|temasek|samsung|bentley|forsale|channel|theater|frogans|theatre|okinawa|website|tickets|jewelry|gallery|tiffany|iselect|shiksha|brother|organic|wedding|genting|toshiba|origins|philips|hyundai|hotmail|hoteles|hosting|rentals|windows|cartier|bugatti|holiday|careers|whoswho|hitachi|panerai|caravan|reviews|guitars|capital|trading|hamburg|hangout|finance|stream|family|abbott|health|review|travel|report|hermes|hiphop|gratis|career|toyota|hockey|dating|repair|google|social|soccer|reisen|global|otsuka|giving|unicom|casino|photos|center|broker|rocher|orange|bostik|garden|insure|ryukyu|bharti|safety|physio|sakura|oracle|online|jaguar|gallup|piaget|tienda|futbol|pictet|joburg|webcam|berlin|office|juegos|kaufen|chanel|chrome|xihuan|church|tennis|circle|kinder|flickr|bayern|claims|clinic|viajes|nowruz|xperia|norton|yachts|studio|coffee|camera|sanofi|nissan|author|expert|events|comsec|lawyer|tattoo|viking|estate|villas|condos|realty|yandex|energy|emerck|virgin|vision|durban|living|school|coupon|london|taobao|natura|taipei|nagoya|luxury|walter|aramco|sydney|madrid|credit|maison|makeup|schule|market|anquan|direct|design|swatch|suzuki|alsace|vuelos|dental|alipay|voyage|shouji|voting|airtel|mutual|degree|supply|agency|museum|mobily|dealer|monash|select|mormon|active|moscow|racing|datsun|quebec|nissay|rodeo|email|gifts|works|photo|chloe|edeka|cheap|earth|vista|tushu|koeln|glass|shoes|globo|tunes|gmail|nokia|space|kyoto|black|ricoh|seven|lamer|sener|epson|cisco|praxi|trust|citic|crown|shell|lease|green|legal|lexus|ninja|tatar|gripe|nikon|group|video|wales|autos|gucci|party|nexus|guide|linde|adult|parts|amica|lixil|boats|azure|loans|locus|cymru|lotte|lotto|stada|click|poker|quest|dabur|lupin|nadex|paris|faith|dance|canon|place|gives|trade|skype|rocks|mango|cloud|boots|smile|final|swiss|homes|honda|media|horse|cards|deals|watch|bosch|house|pizza|miami|osaka|tours|total|xerox|coach|sucks|style|delta|toray|iinet|tools|money|codes|beats|tokyo|salon|archi|movie|baidu|study|actor|yahoo|store|apple|world|forex|today|bible|tmall|tirol|irish|tires|forum|reise|vegas|vodka|sharp|omega|weber|jetzt|audio|promo|build|bingo|chase|gallo|drive|dubai|rehab|press|solar|sale|beer|bbva|bank|band|auto|sapo|sarl|saxo|audi|asia|arte|arpa|army|yoga|ally|zara|scor|scot|sexy|seat|zero|seek|aero|adac|zone|aarp|maif|meet|meme|menu|surf|mini|mobi|mtpc|porn|desi|star|ltda|name|talk|navy|love|loan|live|link|news|limo|like|spot|life|nico|lidl|lgbt|land|taxi|team|tech|kred|kpmg|sony|song|kiwi|kddi|jprs|jobs|sohu|java|itau|tips|info|immo|icbc|hsbc|town|host|page|toys|here|help|pars|haus|guru|guge|tube|goog|golf|gold|sncf|gmbh|gift|ggee|gent|gbiz|game|vana|pics|fund|ford|ping|pink|fish|film|fast|farm|play|fans|fail|plus|skin|pohl|fage|moda|post|erni|dvag|prod|doha|prof|docs|viva|diet|luxe|site|dell|sina|dclk|show|qpon|date|vote|cyou|voto|read|coop|cool|wang|club|city|chat|cern|cash|reit|rent|casa|cars|care|camp|rest|call|cafe|weir|wien|rich|wiki|buzz|wine|book|bond|room|work|rsvp|shia|ruhr|blue|bing|shaw|bike|safe|xbox|best|pwc|mtn|lds|aig|boo|fyi|nra|nrw|ntt|car|gal|obi|zip|aeg|vin|how|one|ong|onl|dad|ooo|bet|esq|org|htc|bar|uol|ibm|ovh|gdn|ice|icu|uno|gea|ifm|bot|top|wtf|lol|day|pet|eus|wtc|ubs|tvs|aco|ing|ltd|ink|tab|abb|afl|cat|int|pid|pin|bid|cba|gle|com|cbn|ads|man|wed|ceb|gmo|sky|ist|gmx|tui|mba|fan|ski|iwc|app|pro|med|ceo|jcb|jcp|goo|dev|men|aaa|meo|pub|jlc|bom|jll|gop|jmp|mil|got|gov|win|jot|mma|joy|trv|red|cfa|cfd|bio|moe|moi|mom|ren|biz|aws|xin|bbc|dnp|buy|kfh|mov|thd|xyz|fit|kia|rio|rip|kim|dog|vet|nyc|bcg|mtr|bcn|bms|bmw|run|bzh|rwe|tel|stc|axa|kpn|fly|krd|cab|bnl|foo|crs|eat|tci|sap|srl|nec|sas|net|cal|sbs|sfr|sca|scb|csc|edu|new|xxx|hiv|fox|wme|ngo|nhk|vip|sex|frl|lat|yun|law|you|tax|soy|sew|om|ac|hu|se|sc|sg|sh|sb|sa|rw|ru|rs|ro|re|qa|py|si|pw|pt|ps|sj|sk|pr|pn|pm|pl|sl|sm|pk|sn|ph|so|pg|pf|pe|pa|zw|nz|nu|nr|np|no|nl|ni|ng|nf|sr|ne|st|nc|na|mz|my|mx|mw|mv|mu|mt|ms|mr|mq|mp|mo|su|mn|mm|ml|mk|mh|mg|me|sv|md|mc|sx|sy|ma|ly|lv|sz|lu|lt|ls|lr|lk|li|lc|lb|la|tc|kz|td|ky|kw|kr|kp|kn|km|ki|kh|tf|tg|th|kg|ke|jp|jo|jm|je|it|is|ir|tj|tk|tl|tm|iq|tn|to|io|in|im|il|ie|ad|sd|ht|hr|hn|hm|tr|hk|gy|gw|gu|gt|gs|gr|gq|tt|gp|gn|gm|gl|tv|gi|tw|tz|ua|gh|ug|uk|gg|gf|ge|gd|us|uy|uz|va|gb|ga|vc|ve|fr|fo|fm|fk|fj|vg|vi|fi|eu|et|es|er|eg|ee|ec|dz|do|dm|dk|vn|dj|de|cz|cy|cx|cw|vu|cv|cu|cr|co|cn|cm|cl|ck|ci|ch|cg|cf|cd|cc|ca|wf|bz|by|bw|bv|bt|bs|br|bo|bn|bm|bj|bi|ws|bh|bg|bf|be|bd|bb|ba|az|ax|aw|au|at|as|ye|ar|aq|ao|am|al|yt|ai|za|ag|af|ae|zm|id)\b/},s.AnchorTagBuilder=s.Util.extend(Object,{constructor:function(e){s.Util.assign(this,e)},build:function(e){return new s.HtmlTag({tagName:"a",attrs:this.createAttrs(e.getType(),e.getAnchorHref()),innerHtml:this.processAnchorText(e.getAnchorText())})},createAttrs:function(e,t){var n={href:t},r=this.createCssClass(e);return r&&(n.class=r),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),n},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(e){var t=this.truncate;if(!t||!t.length)return e;var n=t.length,r=t.location;return"smart"===r?s.truncate.TruncateSmart(e,n,".."):"middle"===r?s.truncate.TruncateMiddle(e,n,".."):s.truncate.TruncateEnd(e,n,"..")}}),s.htmlParser.HtmlParser=s.Util.extend(Object,{htmlRegex:(o=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,i=/[^\s"'>\/=\x00-\x1F\x7F]+/.source+"(?:\\s*=\\s*"+o.source+")?",new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",i,"|",o.source+")",")*",">",")","|","(?:","<(/)?","(?:",/!--([\s\S]+?)--/.source,"|","(?:","("+/[0-9a-zA-Z][0-9a-zA-Z:]*/.source+")","(?:","(?:\\s+|\\b)",i,")*","\\s*/?",")",")",">",")"].join(""),"gi")),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,n,r=this.htmlRegex,o=0,i=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],u=t[1]||t[4],c=!!t[2],l=t.index,p=e.substring(o,l);p&&(n=this.parseTextAndEntityNodes(o,p),i.push.apply(i,n)),s?i.push(this.createCommentNode(l,a,s)):i.push(this.createElementNode(l,a,u,c)),o=l+a.length}if(o<e.length){var f=e.substring(o);f&&(n=this.parseTextAndEntityNodes(o,f),i.push.apply(i,n))}return i},parseTextAndEntityNodes:function(e,t){for(var n=[],r=s.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),o=0,i=r.length;o<i;o+=2){var a=r[o],u=r[o+1];a&&(n.push(this.createTextNode(e,a)),e+=a.length),u&&(n.push(this.createEntityNode(e,u)),e+=u.length)}return n},createCommentNode:function(e,t,n){return new s.htmlParser.CommentNode({offset:e,text:t,comment:s.Util.trim(n)})},createElementNode:function(e,t,n,r){return new s.htmlParser.ElementNode({offset:e,text:t,tagName:n.toLowerCase(),closing:r})},createEntityNode:function(e,t){return new s.htmlParser.EntityNode({offset:e,text:t})},createTextNode:function(e,t){return new s.htmlParser.TextNode({offset:e,text:t})}}),s.htmlParser.HtmlNode=s.Util.extend(Object,{offset:void 0,text:void 0,constructor:function(e){if(s.Util.assign(this,e),null==this.offset)throw new Error("`offset` cfg required");if(null==this.text)throw new Error("`text` cfg required")},getType:s.Util.abstractMethod,getOffset:function(){return this.offset},getText:function(){return this.text}}),s.htmlParser.CommentNode=s.Util.extend(s.htmlParser.HtmlNode,{comment:"",getType:function(){return"comment"},getComment:function(){return this.comment}}),s.htmlParser.ElementNode=s.Util.extend(s.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),s.htmlParser.EntityNode=s.Util.extend(s.htmlParser.HtmlNode,{getType:function(){return"entity"}}),s.htmlParser.TextNode=s.Util.extend(s.htmlParser.HtmlNode,{getType:function(){return"text"}}),s.match.Match=s.Util.extend(Object,{constructor:function(e){if(null==e.tagBuilder)throw new Error("`tagBuilder` cfg required");if(null==e.matchedText)throw new Error("`matchedText` cfg required");if(null==e.offset)throw new Error("`offset` cfg required");this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset},getType:s.Util.abstractMethod,getMatchedText:function(){return this.matchedText},setOffset:function(e){this.offset=e},getOffset:function(){return this.offset},getAnchorHref:s.Util.abstractMethod,getAnchorText:s.Util.abstractMethod,buildTag:function(){return this.tagBuilder.build(this)}}),s.match.Email=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.email)throw new Error("`email` cfg required");this.email=e.email},getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),s.match.Hashtag=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.hashtag)throw new Error("`hashtag` cfg required");this.serviceName=e.serviceName,this.hashtag=e.hashtag},getType:function(){return"hashtag"},getServiceName:function(){return this.serviceName},getHashtag:function(){return this.hashtag},getAnchorHref:function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: ",e)}},getAnchorText:function(){return"#"+this.hashtag}}),s.match.Phone=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.number)throw new Error("`number` cfg required");if(null==e.plusSign)throw new Error("`plusSign` cfg required");this.number=e.number,this.plusSign=e.plusSign},getType:function(){return"phone"},getNumber:function(){return this.number},getAnchorHref:function(){return"tel:"+(this.plusSign?"+":"")+this.number},getAnchorText:function(){return this.matchedText}}),s.match.Twitter=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),!e.twitterHandle)throw new Error("`twitterHandle` cfg required");this.twitterHandle=e.twitterHandle},getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),s.match.Url=s.Util.extend(s.match.Match,{constructor:function(e){if(s.match.Match.prototype.constructor.call(this,e),"scheme"!==e.urlMatchType&&"www"!==e.urlMatchType&&"tld"!==e.urlMatchType)throw new Error('`urlMatchType` cfg must be one of: "scheme", "www", or "tld"');if(!e.url)throw new Error("`url` cfg required");if(null==e.protocolUrlMatch)throw new Error("`protocolUrlMatch` cfg required");if(null==e.protocolRelativeMatch)throw new Error("`protocolRelativeMatch` cfg required");if(null==e.stripPrefix)throw new Error("`stripPrefix` cfg required");this.urlMatchType=e.urlMatchType,this.url=e.url,this.protocolUrlMatch=e.protocolUrlMatch,this.protocolRelativeMatch=e.protocolRelativeMatch,this.stripPrefix=e.stripPrefix},urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrlMatchType:function(){return this.urlMatchType},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){return this.getUrl().replace(/&/g,"&")},getAnchorText:function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),s.matcher.Matcher=s.Util.extend(Object,{constructor:function(e){if(!e.tagBuilder)throw new Error("`tagBuilder` cfg required");this.tagBuilder=e.tagBuilder},parseMatches:s.Util.abstractMethod}),s.matcher.Email=s.Util.extend(s.matcher.Matcher,{matcherRegex:(e=s.RegexLib.alphaNumericCharsStr,t=new RegExp("["+e+"\\-_';:&=+$.,]+@"),n=s.RegexLib.domainNameRegex,r=s.RegexLib.tldRegex,new RegExp([t.source,n.source,"\\.",r.source].join(""),"gi")),parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,o=[];null!==(t=n.exec(e));){var i=t[0];o.push(new s.match.Email({tagBuilder:r,matchedText:i,offset:t.index,email:i}))}return o}}),s.matcher.Hashtag=s.Util.extend(s.matcher.Matcher,{matcherRegex:new RegExp("#[_"+s.RegexLib.alphaNumericCharsStr+"]{1,139}","g"),nonWordCharRegex:new RegExp("[^"+s.RegexLib.alphaNumericCharsStr+"]"),constructor:function(e){s.matcher.Matcher.prototype.constructor.call(this,e),this.serviceName=e.serviceName},parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,o=this.serviceName,i=this.tagBuilder,a=[];null!==(t=n.exec(e));){var u=t.index,c=e.charAt(u-1);if(0===u||r.test(c)){var l=t[0],p=t[0].slice(1);a.push(new s.match.Hashtag({tagBuilder:i,matchedText:l,offset:u,serviceName:o,hashtag:p}))}}return a}}),s.matcher.Phone=s.Util.extend(s.matcher.Matcher,{matcherRegex:/(?:(\+)?\d{1,3}[-\040.])?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]\d{4}/g,parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,o=[];null!==(t=n.exec(e));){var i=t[0],a=i.replace(/\D/g,""),u=!!t[1];o.push(new s.match.Phone({tagBuilder:r,matchedText:i,offset:t.index,number:a,plusSign:u}))}return o}}),s.matcher.Twitter=s.Util.extend(s.matcher.Matcher,{matcherRegex:new RegExp("@[_"+s.RegexLib.alphaNumericCharsStr+"]{1,20}","g"),nonWordCharRegex:new RegExp("[^"+s.RegexLib.alphaNumericCharsStr+"]"),parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,o=this.tagBuilder,i=[];null!==(t=n.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||r.test(u)){var c=t[0],l=t[0].slice(1);i.push(new s.match.Twitter({tagBuilder:o,matchedText:c,offset:a,twitterHandle:l}))}}return i}}),s.matcher.Url=s.Util.extend(s.matcher.Matcher,{matcherRegex:function(){var e=s.RegexLib.domainNameRegex,t=s.RegexLib.tldRegex,n=s.RegexLib.alphaNumericCharsStr,r=new RegExp("["+n+"\\-+&@#/%=~_()|'$*\\[\\]?!:,.;]*["+n+"\\-+&@#/%=~_()|'$*\\[\\]]");return new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]*:(?![A-Za-z][-.+A-Za-z0-9]*:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,e.source,")","|","(","(//)?",/(?:www\.)/.source,e.source,")","|","(","(//)?",e.source+"\\.",t.source,")",")","(?:"+r.source+")?"].join(""),"gi")}(),wordCharRegExp:/\w/,openParensRe:/\(/g,closeParensRe:/\)/g,constructor:function(e){if(s.matcher.Matcher.prototype.constructor.call(this,e),this.stripPrefix=e.stripPrefix,null==this.stripPrefix)throw new Error("`stripPrefix` cfg required")},parseMatches:function(e){for(var t,n=this.matcherRegex,r=this.stripPrefix,o=this.tagBuilder,i=[];null!==(t=n.exec(e));){var a=t[0],u=t[1],c=t[2],l=t[3],p=t[5],f=t.index,h=l||p,d=e.charAt(f-1);if(s.matcher.UrlMatchValidator.isValid(a,u)&&!(f>0&&"@"===d||f>0&&h&&this.wordCharRegExp.test(d))){if(this.matchHasUnbalancedClosingParen(a))a=a.substr(0,a.length-1);else{var m=this.matchHasInvalidCharAfterTld(a,u);m>-1&&(a=a.substr(0,m))}var v=u?"scheme":c?"www":"tld",g=!!u;i.push(new s.match.Url({tagBuilder:o,matchedText:a,offset:f,urlMatchType:v,url:a,protocolUrlMatch:g,protocolRelativeMatch:!!h,stripPrefix:r}))}}return i},matchHasUnbalancedClosingParen:function(e){if(")"===e.charAt(e.length-1)){var t=e.match(this.openParensRe),n=e.match(this.closeParensRe);if((t&&t.length||0)<(n&&n.length||0))return!0}return!1},matchHasInvalidCharAfterTld:function(e,t){if(!e)return-1;var n=0;t&&(n=e.indexOf(":"),e=e.slice(n));var r=/^((.?\/\/)?[A-Za-z0-9\u00C0-\u017F\.\-]*[A-Za-z0-9\u00C0-\u017F\-]\.[A-Za-z]+)/.exec(e);return null===r?-1:(n+=r[1].length,e=e.slice(r[1].length),/^[^.A-Za-z:\/?#]/.test(e)?n:-1)}}),s.matcher.UrlMatchValidator={hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]*:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z\u00C0-\u017F]/,ipRegex:/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,isValid:function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e))},isValidIpAddress:function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return!(!e||!t||this.hasWordCharAfterProtocolRegex.test(e))}},s.truncate.TruncateEnd=function(e,t,n){return s.Util.ellipsis(e,t,n)},s.truncate.TruncateMiddle=function(e,t,n){if(e.length<=t)return e;var r=t-n.length,o="";return r>0&&(o=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+o).substr(0,t)},s.truncate.TruncateSmart=function(e,t,n){var r=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},o=function(e,t){var r=t/2,o=Math.ceil(r),i=-1*Math.floor(r),a="";return i<0&&(a=e.substr(i)),e.substr(0,o)+n+a};if(e.length<=t)return e;var i=t-n.length,a=function(e){var t={},n=e,r=n.match(/^([a-z]+):\/\//i);return r&&(t.scheme=r[1],n=n.substr(r[0].length)),(r=n.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=r[1],n=n.substr(r[0].length)),(r=n.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=r[1],n=n.substr(r[0].length)),(r=n.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=r[1],n=n.substr(r[0].length)),(r=n.match(/^#(.*?)$/i))&&(t.fragment=r[1]),t}(e);if(a.query){var s=a.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);s&&(a.query=a.query.substr(0,s[1].length),e=r(a))}if(e.length<=t)return e;if(a.host&&(a.host=a.host.replace(/^www\./,""),e=r(a)),e.length<=t)return e;var u="";if(a.host&&(u+=a.host),u.length>=i)return a.host.length==t?(a.host.substr(0,t-n.length)+n).substr(0,t):o(u,i).substr(0,t);var c="";if(a.path&&(c+="/"+a.path),a.query&&(c+="?"+a.query),c){if((u+c).length>=i)return(u+c).length==t?(u+c).substr(0,t):(u+o(c,i-u.length)).substr(0,t);u+=c}if(a.fragment){var l="#"+a.fragment;if((u+l).length>=i)return(u+l).length==t?(u+l).substr(0,t):(u+o(l,i-u.length)).substr(0,t);u+=l}if(a.scheme&&a.host){var p=a.scheme+"://";if((u+p).length<i)return(p+u).substr(0,t)}if(u.length<=t)return u;var f="";return i>0&&(f=u.substr(-1*Math.floor(i/2))),(u.substr(0,Math.ceil(i/2))+n+f).substr(0,t)},s})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){"use strict";var r=n(190),o=n(995),i=[["code",n(996)],["fences",n(997),["paragraph","blockquote","list"]],["blockquote",n(998),["paragraph","blockquote","list"]],["hr",n(999),["paragraph","blockquote","list"]],["list",n(1e3),["paragraph","blockquote"]],["footnote",n(1001),["paragraph"]],["heading",n(1002),["paragraph","blockquote"]],["lheading",n(1003)],["htmlblock",n(1004),["paragraph","blockquote"]],["table",n(1006),["paragraph"]],["deflist",n(1007),["paragraph"]],["paragraph",n(1008)]];function a(){this.ruler=new r;for(var e=0;e<i.length;e++)this.ruler.push(i[e][0],i[e][1],{alt:(i[e][2]||[]).slice()})}a.prototype.tokenize=function(e,t,n){for(var r,o=this.ruler.getRules(""),i=o.length,a=t,s=!1;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n))&&!(e.tShift[a]<e.blkIndent);){for(r=0;r<i&&!o[r](e,a,n,!1);r++);if(e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),(a=e.line)<n&&e.isEmpty(a)){if(s=!0,++a<n&&"list"===e.parentType&&e.isEmpty(a))break;e.line=a}}};var s=/[\n\t]/g,u=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,c=/\u00a0/g;a.prototype.parse=function(e,t,n,r){var i,a=0,l=0;if(!e)return[];(e=(e=e.replace(c," ")).replace(u,"\n")).indexOf("\t")>=0&&(e=e.replace(s,function(t,n){var r;return 10===e.charCodeAt(n)?(a=n+1,l=0,t):(r=" ".slice((n-a-l)%4),l=n-a+1,r)})),i=new o(e,this,t,n,r),this.tokenize(i,i.line,i.lineMax)},e.exports=a},function(e,t,n){"use strict";function r(e,t,n,r,o){var i,a,s,u,c,l,p;for(this.src=e,this.parser=t,this.options=n,this.env=r,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",l=0,p=!1,s=u=l=0,c=(a=this.src).length;u<c;u++){if(i=a.charCodeAt(u),!p){if(32===i){l++;continue}p=!0}10!==i&&u!==c-1||(10!==i&&u++,this.bMarks.push(s),this.eMarks.push(u),this.tShift.push(l),p=!1,l=0,s=u+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}r.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},r.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},r.prototype.skipSpaces=function(e){for(var t=this.src.length;e<t&&32===this.src.charCodeAt(e);e++);return e},r.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},r.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},r.prototype.getLines=function(e,t,n,r){var o,i,a,s,u,c=e;if(e>=t)return"";if(c+1===t)return i=this.bMarks[c]+Math.min(this.tShift[c],n),a=r?this.eMarks[c]+1:this.eMarks[c],this.src.slice(i,a);for(s=new Array(t-e),o=0;c<t;c++,o++)(u=this.tShift[c])>n&&(u=n),u<0&&(u=0),i=this.bMarks[c]+u,a=c+1<t||r?this.eMarks[c]+1:this.eMarks[c],s[o]=this.src.slice(i,a);return s.join("")},e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,o;if(e.tShift[t]-e.blkIndent<4)return!1;for(o=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.tShift[r]-e.blkIndent>=4))break;o=++r}return e.line=r,e.tokens.push({type:"code",content:e.getLines(t,o,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s,u,c=!1,l=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(l+3>p)return!1;if(126!==(o=e.src.charCodeAt(l))&&96!==o)return!1;if(u=l,(i=(l=e.skipChars(l,o))-u)<3)return!1;if((a=e.src.slice(l,p).trim()).indexOf("`")>=0)return!1;if(r)return!0;for(s=t;!(++s>=n)&&!((l=u=e.bMarks[s]+e.tShift[s])<(p=e.eMarks[s])&&e.tShift[s]<e.blkIndent);)if(e.src.charCodeAt(l)===o&&!(e.tShift[s]-e.blkIndent>=4||(l=e.skipChars(l,o))-u<i||(l=e.skipSpaces(l))<p)){c=!0;break}return i=e.tShift[t],e.line=s+(c?1:0),e.tokens.push({type:"fence",params:a,content:e.getLines(t+1,s,i,!0),lines:[t,e.line],level:e.level}),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s,u,c,l,p,f,h,d,m=e.bMarks[t]+e.tShift[t],v=e.eMarks[t];if(m>v)return!1;if(62!==e.src.charCodeAt(m++))return!1;if(e.level>=e.options.maxNesting)return!1;if(r)return!0;for(32===e.src.charCodeAt(m)&&m++,u=e.blkIndent,e.blkIndent=0,s=[e.bMarks[t]],e.bMarks[t]=m,i=(m=m<v?e.skipSpaces(m):m)>=v,a=[e.tShift[t]],e.tShift[t]=m-e.bMarks[t],p=e.parser.ruler.getRules("blockquote"),o=t+1;o<n&&!((m=e.bMarks[o]+e.tShift[o])>=(v=e.eMarks[o]));o++)if(62!==e.src.charCodeAt(m++)){if(i)break;for(d=!1,f=0,h=p.length;f<h;f++)if(p[f](e,o,n,!0)){d=!0;break}if(d)break;s.push(e.bMarks[o]),a.push(e.tShift[o]),e.tShift[o]=-1337}else 32===e.src.charCodeAt(m)&&m++,s.push(e.bMarks[o]),e.bMarks[o]=m,i=(m=m<v?e.skipSpaces(m):m)>=v,a.push(e.tShift[o]),e.tShift[o]=m-e.bMarks[o];for(c=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:l=[t,0],level:e.level++}),e.parser.tokenize(e,t,o),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=c,l[1]=e.line,f=0;f<a.length;f++)e.bMarks[f+t]=s[f],e.tShift[f+t]=a[f];return e.blkIndent=u,!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s=e.bMarks[t],u=e.eMarks[t];if((s+=e.tShift[t])>u)return!1;if(42!==(o=e.src.charCodeAt(s++))&&45!==o&&95!==o)return!1;for(i=1;s<u;){if((a=e.src.charCodeAt(s++))!==o&&32!==a)return!1;a===o&&i++}return!(i<3)&&(!!r||(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level}),!0))}},function(e,t,n){"use strict";function r(e,t){var n,r,o;return(r=e.bMarks[t]+e.tShift[t])>=(o=e.eMarks[t])?-1:42!==(n=e.src.charCodeAt(r++))&&45!==n&&43!==n?-1:r<o&&32!==e.src.charCodeAt(r)?-1:r}function o(e,t){var n,r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(r+1>=o)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=o)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}}return r<o&&32!==e.src.charCodeAt(r)?-1:r}e.exports=function(e,t,n,i){var a,s,u,c,l,p,f,h,d,m,v,g,y,b,_,w,x,E,S,C,k,O=!0;if((h=o(e,t))>=0)g=!0;else{if(!((h=r(e,t))>=0))return!1;g=!1}if(e.level>=e.options.maxNesting)return!1;if(v=e.src.charCodeAt(h-1),i)return!0;for(b=e.tokens.length,g?(f=e.bMarks[t]+e.tShift[t],m=Number(e.src.substr(f,h-f-1)),e.tokens.push({type:"ordered_list_open",order:m,lines:w=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:w=[t,0],level:e.level++}),a=t,_=!1,E=e.parser.ruler.getRules("list");!(!(a<n)||((d=(y=e.skipSpaces(h))>=e.eMarks[a]?1:y-h)>4&&(d=1),d<1&&(d=1),s=h-e.bMarks[a]+d,e.tokens.push({type:"list_item_open",lines:x=[t,0],level:e.level++}),c=e.blkIndent,l=e.tight,u=e.tShift[t],p=e.parentType,e.tShift[t]=y-e.bMarks[t],e.blkIndent=s,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,n,!0),e.tight&&!_||(O=!1),_=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=c,e.tShift[t]=u,e.tight=l,e.parentType=p,e.tokens.push({type:"list_item_close",level:--e.level}),a=t=e.line,x[1]=a,y=e.bMarks[t],a>=n)||e.isEmpty(a)||e.tShift[a]<e.blkIndent);){for(k=!1,S=0,C=E.length;S<C;S++)if(E[S](e,a,n,!0)){k=!0;break}if(k)break;if(g){if((h=o(e,a))<0)break}else if((h=r(e,a))<0)break;if(v!==e.src.charCodeAt(h-1))break}return e.tokens.push({type:g?"ordered_list_close":"bullet_list_close",level:--e.level}),w[1]=a,e.line=a,O&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,b),!0}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s,u,c=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(c+4>l)return!1;if(91!==e.src.charCodeAt(c))return!1;if(94!==e.src.charCodeAt(c+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(s=c+2;s<l;s++){if(32===e.src.charCodeAt(s))return!1;if(93===e.src.charCodeAt(s))break}return s!==c+2&&(!(s+1>=l||58!==e.src.charCodeAt(++s))&&(!!r||(s++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),u=e.src.slice(c+2,s-2),e.env.footnotes.refs[":"+u]=-1,e.tokens.push({type:"footnote_reference_open",label:u,level:e.level++}),o=e.bMarks[t],i=e.tShift[t],a=e.parentType,e.tShift[t]=e.skipSpaces(s)-s,e.bMarks[t]=s,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]<e.blkIndent&&(e.tShift[t]+=e.blkIndent,e.bMarks[t]-=e.blkIndent),e.parser.tokenize(e,t,n,!0),e.parentType=a,e.blkIndent-=4,e.tShift[t]=i,e.bMarks[t]=o,e.tokens.push({type:"footnote_reference_close",level:--e.level}),!0)))}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){var o,i,a,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(s>=u)return!1;if(35!==(o=e.src.charCodeAt(s))||s>=u)return!1;for(i=1,o=e.src.charCodeAt(++s);35===o&&s<u&&i<=6;)i++,o=e.src.charCodeAt(++s);return!(i>6||s<u&&32!==o)&&(!!r||(u=e.skipCharsBack(u,32,s),(a=e.skipCharsBack(u,35,s))>s&&32===e.src.charCodeAt(a-1)&&(u=a),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:i,lines:[t,e.line],level:e.level}),s<u&&e.tokens.push({type:"inline",content:e.src.slice(s,u).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:i,level:e.level}),!0))}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,o,i,a=t+1;return!(a>=n)&&(!(e.tShift[a]<e.blkIndent)&&(!(e.tShift[a]-e.blkIndent>3)&&(!((o=e.bMarks[a]+e.tShift[a])>=(i=e.eMarks[a]))&&((45===(r=e.src.charCodeAt(o))||61===r)&&(o=e.skipChars(o,r),!((o=e.skipSpaces(o))<i)&&(o=e.bMarks[t]+e.tShift[t],e.line=a+1,e.tokens.push({type:"heading_open",hLevel:61===r?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(o,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===r?1:2,level:e.level}),!0))))))}},function(e,t,n){"use strict";var r=n(1005),o=/^<([a-zA-Z]{1,15})[\s\/>]/,i=/^<\/([a-zA-Z]{1,15})[\s>]/;e.exports=function(e,t,n,a){var s,u,c,l=e.bMarks[t],p=e.eMarks[t],f=e.tShift[t];if(l+=f,!e.options.html)return!1;if(f>3||l+2>=p)return!1;if(60!==e.src.charCodeAt(l))return!1;if(33===(s=e.src.charCodeAt(l+1))||63===s){if(a)return!0}else{if(47!==s&&!function(e){var t=32|e;return t>=97&&t<=122}(s))return!1;if(47===s){if(!(u=e.src.slice(l,p).match(i)))return!1}else if(!(u=e.src.slice(l,p).match(o)))return!1;if(!0!==r[u[1].toLowerCase()])return!1;if(a)return!0}for(c=t+1;c<e.lineMax&&!e.isEmpty(c);)c++;return e.line=c,e.tokens.push({type:"htmlblock",level:e.level,lines:[t,e.line],content:e.getLines(t,c,0,!0)}),!0}},function(e,t,n){"use strict";var r={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach(function(e){r[e]=!0}),e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}e.exports=function(e,t,n,o){var i,a,s,u,c,l,p,f,h,d,m;if(t+2>n)return!1;if(c=t+1,e.tShift[c]<e.blkIndent)return!1;if((s=e.bMarks[c]+e.tShift[c])>=e.eMarks[c])return!1;if(124!==(i=e.src.charCodeAt(s))&&45!==i&&58!==i)return!1;if(a=r(e,t+1),!/^[-:| ]+$/.test(a))return!1;if((l=a.split("|"))<=2)return!1;for(f=[],u=0;u<l.length;u++){if(!(h=l[u].trim())){if(0===u||u===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(h))return!1;58===h.charCodeAt(h.length-1)?f.push(58===h.charCodeAt(0)?"center":"right"):58===h.charCodeAt(0)?f.push("left"):f.push("")}if(-1===(a=r(e,t).trim()).indexOf("|"))return!1;if(l=a.replace(/^\||\|$/g,"").split("|"),f.length!==l.length)return!1;if(o)return!0;for(e.tokens.push({type:"table_open",lines:d=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),u=0;u<l.length;u++)e.tokens.push({type:"th_open",align:f[u],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:l[u].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:m=[t+2,0],level:e.level++}),c=t+2;c<n&&!(e.tShift[c]<e.blkIndent)&&-1!==(a=r(e,c).trim()).indexOf("|");c++){for(l=a.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),u=0;u<l.length;u++)e.tokens.push({type:"td_open",align:f[u],level:e.level++}),p=l[u].substring(124===l[u].charCodeAt(0)?1:0,124===l[u].charCodeAt(l[u].length-1)?l[u].length-1:l[u].length).trim(),e.tokens.push({type:"inline",content:p,level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),d[1]=m[1]=c,e.line=c,!0}},function(e,t,n){"use strict";function r(e,t){var n,r,o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return o>=i?-1:126!==(r=e.src.charCodeAt(o++))&&58!==r?-1:o===(n=e.skipSpaces(o))?-1:n>=i?-1:n}e.exports=function(e,t,n,o){var i,a,s,u,c,l,p,f,h,d,m,v,g,y;if(o)return!(e.ddIndent<0)&&r(e,t)>=0;if(p=t+1,e.isEmpty(p)&&++p>n)return!1;if(e.tShift[p]<e.blkIndent)return!1;if((i=r(e,p))<0)return!1;if(e.level>=e.options.maxNesting)return!1;l=e.tokens.length,e.tokens.push({type:"dl_open",lines:c=[t,0],level:e.level++}),s=t,a=p;e:for(;;){for(y=!0,g=!1,e.tokens.push({type:"dt_open",lines:[s,s],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(s,s+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[s,s],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:u=[p,0],level:e.level++}),v=e.tight,h=e.ddIndent,f=e.blkIndent,m=e.tShift[a],d=e.parentType,e.blkIndent=e.ddIndent=e.tShift[a]+2,e.tShift[a]=i-e.bMarks[a],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,a,n,!0),e.tight&&!g||(y=!1),g=e.line-a>1&&e.isEmpty(e.line-1),e.tShift[a]=m,e.tight=v,e.parentType=d,e.blkIndent=f,e.ddIndent=h,e.tokens.push({type:"dd_close",level:--e.level}),u[1]=p=e.line,p>=n)break e;if(e.tShift[p]<e.blkIndent)break e;if((i=r(e,p))<0)break;a=p}if(p>=n)break;if(s=p,e.isEmpty(s))break;if(e.tShift[s]<e.blkIndent)break;if((a=s+1)>=n)break;if(e.isEmpty(a)&&a++,a>=n)break;if(e.tShift[a]<e.blkIndent)break;if((i=r(e,a))<0)break}return e.tokens.push({type:"dl_close",level:--e.level}),c[1]=p,e.line=p,y&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,l),!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s,u=t+1;if(u<(n=e.lineMax)&&!e.isEmpty(u))for(s=e.parser.ruler.getRules("paragraph");u<n&&!e.isEmpty(u);u++)if(!(e.tShift[u]-e.blkIndent>3)){for(o=!1,i=0,a=s.length;i<a;i++)if(s[i](e,u,n,!0)){o=!0;break}if(o)break}return r=e.getLines(t,u,e.blkIndent,!1).trim(),e.line=u,r.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:r,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}},function(e,t,n){"use strict";var r=n(190),o=n(269),i=n(39),a=[["text",n(1010)],["newline",n(1011)],["escape",n(1012)],["backticks",n(1013)],["del",n(1014)],["ins",n(1015)],["mark",n(1016)],["emphasis",n(1017)],["sub",n(1018)],["sup",n(1019)],["links",n(1020)],["footnote_inline",n(1021)],["footnote_ref",n(1022)],["autolink",n(1023)],["htmltag",n(1025)],["entity",n(1027)]];function s(){this.ruler=new r;for(var e=0;e<a.length;e++)this.ruler.push(a[e][0],a[e][1]);this.validateLink=u}function u(e){var t=e.trim().toLowerCase();return-1===(t=i.replaceEntities(t)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(t.split(":")[0])}s.prototype.skipToken=function(e){var t,n,r=this.ruler.getRules(""),o=r.length,i=e.pos;if((n=e.cacheGet(i))>0)e.pos=n;else{for(t=0;t<o;t++)if(r[t](e,!0))return void e.cacheSet(i,e.pos);e.pos++,e.cacheSet(i,e.pos)}},s.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),o=r.length,i=e.posMax;e.pos<i;){for(n=0;n<o&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=i)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},s.prototype.parse=function(e,t,n,r){var i=new o(e,this,t,n,r);this.tokenize(i)},e.exports=s},function(e,t,n){"use strict";function r(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}e.exports=function(e,t){for(var n=e.pos;n<e.posMax&&!r(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o=e.pos;if(10!==e.src.charCodeAt(o))return!1;if(n=e.pending.length-1,r=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(var i=n-2;i>=0;i--)if(32!==e.pending.charCodeAt(i)){e.pending=e.pending.substring(0,i+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(o++;o<r&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}},function(e,t,n){"use strict";for(var r=[],o=0;o<256;o++)r.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){r[e.charCodeAt(0)]=1}),e.exports=function(e,t){var n,o=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(o))return!1;if(++o<i){if((n=e.src.charCodeAt(o))<256&&0!==r[n])return t||(e.pending+=e.src[o]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),o++;o<i&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}}return t||(e.pending+="\\"),e.pos++,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.pos;if(96!==e.src.charCodeAt(s))return!1;for(n=s,s++,r=e.posMax;s<r&&96===e.src.charCodeAt(s);)s++;for(o=e.src.slice(n,s),i=a=s;-1!==(i=e.src.indexOf("`",a));){for(a=i+1;a<r&&96===e.src.charCodeAt(a);)a++;if(a-i===o.length)return t||e.push({type:"code",content:e.src.slice(s,i).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=a,!0}return t||(e.pending+=o),e.pos+=o.length,!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.posMax,u=e.pos;if(126!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(126!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),126===i)return!1;if(126===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&126===e.src.charCodeAt(r);)r++;if(r>u+3)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(126===e.src.charCodeAt(e.pos)&&126===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),126!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&126!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.posMax,u=e.pos;if(43!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(43!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),43===i)return!1;if(43===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&43===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(43===e.src.charCodeAt(e.pos)&&43===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),43!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&43!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a,s=e.posMax,u=e.pos;if(61!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(61!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(i=u>0?e.src.charCodeAt(u-1):-1,a=e.src.charCodeAt(u+2),61===i)return!1;if(61===a)return!1;if(32===a||10===a)return!1;for(r=u+2;r<s&&61===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(61===e.src.charCodeAt(e.pos)&&61===e.src.charCodeAt(e.pos+1)&&(i=e.src.charCodeAt(e.pos-1),61!==(a=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&61!==i&&(32!==i&&10!==i?o--:32!==a&&10!==a&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}},function(e,t,n){"use strict";function r(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function o(e,t){var n,o,i,a=t,s=!0,u=!0,c=e.posMax,l=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;a<c&&e.src.charCodeAt(a)===l;)a++;return a>=c&&(s=!1),(i=a-t)>=4?s=u=!1:(32!==(o=a<c?e.src.charCodeAt(a):-1)&&10!==o||(s=!1),32!==n&&10!==n||(u=!1),95===l&&(r(n)&&(s=!1),r(o)&&(u=!1))),{can_open:s,can_close:u,delims:i}}e.exports=function(e,t){var n,r,i,a,s,u,c,l=e.posMax,p=e.pos,f=e.src.charCodeAt(p);if(95!==f&&42!==f)return!1;if(t)return!1;if(n=(c=o(e,p)).delims,!c.can_open)return e.pos+=n,t||(e.pending+=e.src.slice(p,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=p+n,u=[n];e.pos<l;)if(e.src.charCodeAt(e.pos)!==f)e.parser.skipToken(e);else{if(r=(c=o(e,e.pos)).delims,c.can_close){for(a=u.pop(),s=r;a!==s;){if(s<a){u.push(a-s);break}if(s-=a,0===u.length)break;e.pos+=a,a=u.pop()}if(0===u.length){n=a,i=!0;break}e.pos+=r;continue}c.can_open&&u.push(r),e.pos+=r}return i?(e.posMax=e.pos,e.pos=p+n,t||(2!==n&&3!==n||e.push({type:"strong_open",level:e.level++}),1!==n&&3!==n||e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),1!==n&&3!==n||e.push({type:"em_close",level:--e.level}),2!==n&&3!==n||e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+n,e.posMax=l,!0):(e.pos=p,!1)}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,o,i=e.posMax,a=e.pos;if(126!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<i;){if(126===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(o=e.src.slice(a+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sub",level:e.level,content:o.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=a,!1)}},function(e,t,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;e.exports=function(e,t){var n,o,i=e.posMax,a=e.pos;if(94!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=i)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<i;){if(94===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(o=e.src.slice(a+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sup",level:e.level,content:o.replace(r,"$1")}),e.pos=e.posMax+1,e.posMax=i,!0):(e.pos=a,!1)}},function(e,t,n){"use strict";var r=n(191),o=n(464),i=n(466),a=n(467);e.exports=function(e,t){var n,s,u,c,l,p,f,h,d=!1,m=e.pos,v=e.posMax,g=e.pos,y=e.src.charCodeAt(g);if(33===y&&(d=!0,y=e.src.charCodeAt(++g)),91!==y)return!1;if(e.level>=e.options.maxNesting)return!1;if(n=g+1,(s=r(e,g))<0)return!1;if((p=s+1)<v&&40===e.src.charCodeAt(p)){for(p++;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p>=v)return!1;for(g=p,o(e,p)?(c=e.linkContent,p=e.pos):c="",g=p;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p<v&&g!==p&&i(e,p))for(l=e.linkContent,p=e.pos;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);else l="";if(p>=v||41!==e.src.charCodeAt(p))return e.pos=m,!1;p++}else{if(e.linkLevel>0)return!1;for(;p<v&&(32===(h=e.src.charCodeAt(p))||10===h);p++);if(p<v&&91===e.src.charCodeAt(p)&&(g=p+1,(p=r(e,p))>=0?u=e.src.slice(g,p++):p=g-1),u||(void 0===u&&(p=s+1),u=e.src.slice(n,s)),!(f=e.env.references[a(u)]))return e.pos=m,!1;c=f.href,l=f.title}return t||(e.pos=n,e.posMax=s,d?e.push({type:"image",src:c,title:l,alt:e.src.substr(n,s-n),level:e.level}):(e.push({type:"link_open",href:c,title:l,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=p,e.posMax=v,!0}},function(e,t,n){"use strict";var r=n(191);e.exports=function(e,t){var n,o,i,a,s=e.posMax,u=e.pos;return!(u+2>=s)&&(94===e.src.charCodeAt(u)&&(91===e.src.charCodeAt(u+1)&&(!(e.level>=e.options.maxNesting)&&(n=u+2,!((o=r(e,u+1))<0)&&(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),i=e.env.footnotes.list.length,e.pos=n,e.posMax=o,e.push({type:"footnote_ref",id:i,level:e.level}),e.linkLevel++,a=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[i]={tokens:e.tokens.splice(a)},e.linkLevel--),e.pos=o+1,e.posMax=s,!0)))))}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o,i,a=e.posMax,s=e.pos;if(s+3>a)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(s))return!1;if(94!==e.src.charCodeAt(s+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(r=s+2;r<a;r++){if(32===e.src.charCodeAt(r))return!1;if(10===e.src.charCodeAt(r))return!1;if(93===e.src.charCodeAt(r))break}return r!==s+2&&(!(r>=a)&&(r++,n=e.src.slice(s+2,r-1),void 0!==e.env.footnotes.refs[":"+n]&&(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(o=e.env.footnotes.list.length,e.env.footnotes.list[o]={label:n,count:0},e.env.footnotes.refs[":"+n]=o):o=e.env.footnotes.refs[":"+n],i=e.env.footnotes.list[o].count,e.env.footnotes.list[o].count++,e.push({type:"footnote_ref",id:o,subId:i,level:e.level})),e.pos=r,e.posMax=a,!0)))}},function(e,t,n){"use strict";var r=n(1024),o=n(465),i=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,a=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;e.exports=function(e,t){var n,s,u,c,l,p=e.pos;return 60===e.src.charCodeAt(p)&&(!((n=e.src.slice(p)).indexOf(">")<0)&&((s=n.match(a))?!(r.indexOf(s[1].toLowerCase())<0)&&(c=s[0].slice(1,-1),l=o(c),!!e.parser.validateLink(c)&&(t||(e.push({type:"link_open",href:l,level:e.level}),e.push({type:"text",content:c,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=s[0].length,!0)):!!(u=n.match(i))&&(c=u[0].slice(1,-1),l=o("mailto:"+c),!!e.parser.validateLink(l)&&(t||(e.push({type:"link_open",href:l,level:e.level}),e.push({type:"text",content:c,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=u[0].length,!0))))}},function(e,t,n){"use strict";e.exports=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"]},function(e,t,n){"use strict";var r=n(1026).HTML_TAG_RE;e.exports=function(e,t){var n,o,i,a=e.pos;return!!e.options.html&&(i=e.posMax,!(60!==e.src.charCodeAt(a)||a+2>=i)&&(!(33!==(n=e.src.charCodeAt(a+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n))&&(!!(o=e.src.slice(a).match(r))&&(t||e.push({type:"htmltag",content:e.src.slice(a,a+o[0].length),level:e.level}),e.pos+=o[0].length,!0))))}},function(e,t,n){"use strict";function r(e,t){return e=e.source,t=t||"",function n(r,o){return r?(o=o.source||o,e=e.replace(r,o),n):new RegExp(e,t)}}var o=r(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),i=r(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",o)(),a=r(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",i)(),s=r(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",a)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();e.exports.HTML_TAG_RE=s},function(e,t,n){"use strict";var r=n(463),o=n(39).has,i=n(39).isValidEntityCode,a=n(39).fromCodePoint,s=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,u=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n,c,l=e.pos,p=e.posMax;if(38!==e.src.charCodeAt(l))return!1;if(l+1<p)if(35===e.src.charCodeAt(l+1)){if(c=e.src.slice(l).match(s))return t||(n="x"===c[1][0].toLowerCase()?parseInt(c[1].slice(1),16):parseInt(c[1],10),e.pending+=i(n)?a(n):a(65533)),e.pos+=c[0].length,!0}else if((c=e.src.slice(l).match(u))&&o(r,c[1]))return t||(e.pending+=r[c[1]]),e.pos+=c[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","linkify","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}}},function(e,t,n){"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}}},function(e,t,n){"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebounceInput=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(0)),a=s(n(1032));function s(e){return e&&e.__esModule?e:{default:e}}(t.DebounceInput=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){e.persist();var t=n.state.value;n.setState({value:e.target.value},function(){var o=n.state.value;o.length>=n.props.minLength?n.notify(e):t.length>o.length&&n.notify(r({},e,{target:r({},e.target,{value:""})}))})},n.onKeyDown=function(e){var t=n.props.onKeyDown;"Enter"===e.key&&n.forceNotify(e),t&&t(e)},n.onBlur=function(e){var t=n.props.onBlur;n.forceNotify(e),t&&t(e)},n.createNotifier=function(e){if(e<0)n.notify=function(){return null};else if(0===e)n.notify=n.doNotify;else{var t=(0,a.default)(function(e){n.isDebouncing=!1,n.doNotify(e)},e);n.notify=function(e){n.isDebouncing=!0,t(e)},n.flush=function(){return t.flush()},n.cancel=function(){n.isDebouncing=!1,t.cancel()}}},n.doNotify=function(){var e=n.props.onChange;e.apply(void 0,arguments)},n.forceNotify=function(e){if(n.isDebouncing){n.cancel&&n.cancel();var t=n.state.value,o=n.props.minLength;t.length>=o?n.doNotify(e):n.doNotify(r({},e,{target:r({},e.target,{value:t})}))}},n.state={value:e.value||""},n.isDebouncing=!1,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.default.PureComponent),o(t,[{key:"componentWillMount",value:function(){this.createNotifier(this.props.debounceTimeout)}},{key:"componentWillReceiveProps",value:function(e){var t=e.value,n=e.debounceTimeout;this.isDebouncing||(void 0!==t&&this.state.value!==t&&this.setState({value:t}),n!==this.props.debounceTimeout&&this.createNotifier(n))}},{key:"componentWillUnmount",value:function(){this.flush&&this.flush()}},{key:"render",value:function(){var e=this.props,t=e.element,n=(e.onChange,e.value,e.minLength,e.debounceTimeout,e.forceNotifyByEnter),o=e.forceNotifyOnBlur,a=e.onKeyDown,s=e.onBlur,u=e.inputRef,c=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["element","onChange","value","minLength","debounceTimeout","forceNotifyByEnter","forceNotifyOnBlur","onKeyDown","onBlur","inputRef"]),l=void 0;l=n?{onKeyDown:this.onKeyDown}:a?{onKeyDown:a}:{};var p=void 0;p=o?{onBlur:this.onBlur}:s?{onBlur:s}:{};var f=u?{ref:u}:{};return i.default.createElement(t,r({},c,{onChange:this.onChange,value:this.state.value},l,p,f))}}]),t}()).defaultProps={element:"input",type:"text",onKeyDown:void 0,onBlur:void 0,value:void 0,minLength:0,debounceTimeout:100,forceNotifyByEnter:!0,forceNotifyOnBlur:!0,inputRef:void 0}},function(e,t,n){(function(t){var n="Expected a function",r=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt,l="object"==typeof t&&t&&t.Object===Object&&t,p="object"==typeof self&&self&&self.Object===Object&&self,f=l||p||Function("return this")(),h=Object.prototype.toString,d=Math.max,m=Math.min,v=function(){return f.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&h.call(e)==o}(e))return r;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):a.test(e)?r:+e}e.exports=function(e,t,r){var o,i,a,s,u,c,l=0,p=!1,f=!1,h=!0;if("function"!=typeof e)throw new TypeError(n);function b(t){var n=o,r=i;return o=i=void 0,l=t,s=e.apply(r,n)}function _(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-l>=a}function w(){var e=v();if(_(e))return x(e);u=setTimeout(w,function(e){var n=t-(e-c);return f?m(n,a-(e-l)):n}(e))}function x(e){return u=void 0,h&&o?b(e):(o=i=void 0,s)}function E(){var e=v(),n=_(e);if(o=arguments,i=this,c=e,n){if(void 0===u)return function(e){return l=e,u=setTimeout(w,t),p?b(e):s}(c);if(f)return u=setTimeout(w,t),b(c)}return void 0===u&&(u=setTimeout(w,t)),s}return t=y(t)||0,g(r)&&(p=!!r.leading,a=(f="maxWait"in r)?d(y(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h),E.cancel=function(){void 0!==u&&clearTimeout(u),l=0,o=c=i=u=void 0},E.flush=function(){return void 0===u?s:x(v())},E}}).call(this,n(36))},function(e,t,n){var r={"./all.js":328,"./auth/actions.js":71,"./auth/index.js":290,"./auth/reducers.js":291,"./auth/selectors.js":292,"./auth/spec-wrap-actions.js":293,"./configs/actions.js":121,"./configs/helpers.js":147,"./configs/index.js":329,"./configs/reducers.js":298,"./configs/selectors.js":297,"./configs/spec-actions.js":296,"./deep-linking/helpers.js":149,"./deep-linking/index.js":299,"./deep-linking/layout.js":300,"./deep-linking/operation-tag-wrapper.jsx":302,"./deep-linking/operation-wrapper.jsx":301,"./download-url.js":295,"./err/actions.js":44,"./err/error-transformers/hook.js":96,"./err/error-transformers/transformers/not-of-type.js":275,"./err/error-transformers/transformers/parameter-oneof.js":276,"./err/index.js":273,"./err/reducers.js":274,"./err/selectors.js":277,"./filter/index.js":303,"./filter/opsFilter.js":304,"./layout/actions.js":79,"./layout/index.js":278,"./layout/reducers.js":279,"./layout/selectors.js":280,"./logs/index.js":287,"./oas3/actions.js":62,"./oas3/auth-extensions/wrap-selectors.js":308,"./oas3/components/callbacks.jsx":311,"./oas3/components/http-auth.jsx":317,"./oas3/components/index.js":310,"./oas3/components/operation-link.jsx":313,"./oas3/components/operation-servers.jsx":318,"./oas3/components/request-body-editor.jsx":316,"./oas3/components/request-body.jsx":312,"./oas3/components/servers-container.jsx":315,"./oas3/components/servers.jsx":314,"./oas3/helpers.jsx":24,"./oas3/index.js":306,"./oas3/reducers.js":327,"./oas3/selectors.js":326,"./oas3/spec-extensions/selectors.js":309,"./oas3/spec-extensions/wrap-selectors.js":307,"./oas3/wrap-components/auth-item.jsx":321,"./oas3/wrap-components/index.js":319,"./oas3/wrap-components/json-schema-string.jsx":325,"./oas3/wrap-components/markdown.jsx":320,"./oas3/wrap-components/model.jsx":324,"./oas3/wrap-components/online-validator-badge.js":323,"./oas3/wrap-components/version-stamp.jsx":322,"./on-complete/index.js":305,"./samples/fn.js":120,"./samples/index.js":286,"./spec/actions.js":29,"./spec/index.js":281,"./spec/reducers.js":282,"./spec/selectors.js":70,"./spec/wrap-actions.js":284,"./swagger-js/configs-wrap-actions.js":289,"./swagger-js/index.js":288,"./util/index.js":294,"./view/index.js":285,"./view/root-injects.jsx":148};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=1033},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"Container",function(){return jt}),n.d(r,"Col",function(){return It}),n.d(r,"Row",function(){return Mt}),n.d(r,"Button",function(){return Nt}),n.d(r,"TextArea",function(){return Rt}),n.d(r,"Input",function(){return Dt}),n.d(r,"Select",function(){return Lt}),n.d(r,"Link",function(){return Ut}),n.d(r,"Collapse",function(){return Ft});var o={};n.r(o),n.d(o,"JsonSchemaForm",function(){return Tn}),n.d(o,"JsonSchema_string",function(){return jn}),n.d(o,"JsonSchema_array",function(){return Pn}),n.d(o,"JsonSchema_boolean",function(){return In}),n.d(o,"JsonSchema_object",function(){return Mn});var i=n(28),a=n.n(i),s=n(17),u=n.n(s),c=n(26),l=n.n(c),p=n(80),f=n.n(p),h=n(14),d=n.n(h),m=n(2),v=n.n(m),g=n(16),y=n.n(g),b=n(4),_=n.n(b),w=n(5),x=n.n(w),E=n(0),S=n.n(E),C=n(124),k=n(1),O=n.n(k),A=n(470),T=n(119),j=n.n(T),P=n(145),I=n.n(P),M=n(44),N=n(18),R=n.n(N),D=n(3),L=function(e){return e};var U=function(){function e(){var t,n,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_()(this,e),f()(this,{state:{},plugins:[],system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},o),this.getSystem=this._getSystem.bind(this),this.store=(t=L,n=Object(k.fromJS)(this.state),r=this.getSystem,function(e,t,n){var r=[Object(D.J)(n)],o=R.a.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||C.compose;return Object(C.createStore)(e,t,o(C.applyMiddleware.apply(void 0,r)))}(t,n,r)),this.buildSystem(!1),this.register(this.plugins)}return x()(e,[{key:"getStore",value:function(){return this.store}},{key:"register",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=q(e,this.getSystem());B(this.system,n),t&&this.buildSystem();var r=F.call(this.system,e,this.getSystem());r&&this.buildSystem()}},{key:"buildSystem",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.getStore().dispatch,n=this.getStore().getState;this.boundSystem=y()({},this.getRootInjects(),this.getWrappedAndBoundActions(t),this.getWrappedAndBoundSelectors(n,this.getSystem),this.getStateThunks(n),this.getFn(),this.getConfigs()),e&&this.rebuildReducer()}},{key:"_getSystem",value:function(){return this.boundSystem}},{key:"getRootInjects",value:function(){return y()({getSystem:this.getSystem,getStore:this.getStore.bind(this),getComponents:this.getComponents.bind(this),getState:this.getStore().getState,getConfigs:this._getConfigs.bind(this),Im:O.a,React:S.a},this.system.rootInjects||{})}},{key:"_getConfigs",value:function(){return this.system.configs}},{key:"getConfigs",value:function(){return{configs:this.system.configs}}},{key:"setConfigs",value:function(e){this.system.configs=e}},{key:"rebuildReducer",value:function(){var e,t,n;this.store.replaceReducer((n=this.system.statePlugins,e=Object(D.y)(n,function(e){return e.reducers}),t=u()(e).reduce(function(t,n){var r;return t[n]=(r=e[n],function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new k.Map,t=arguments.length>1?arguments[1]:void 0;if(!r)return e;var n=r[t.type];if(n){var o=z(n)(e,t);return null===o?e:o}return e}),t},{}),u()(t).length?Object(A.combineReducers)(t):L))}},{key:"getType",value:function(e){var t=e[0].toUpperCase()+e.slice(1);return Object(D.z)(this.system.statePlugins,function(n,r){var o=n[e];if(o)return v()({},r+t,o)})}},{key:"getSelectors",value:function(){return this.getType("selectors")}},{key:"getActions",value:function(){var e=this.getType("actions");return Object(D.y)(e,function(e){return Object(D.z)(e,function(e,t){if(Object(D.r)(e))return v()({},t,e)})})}},{key:"getWrappedAndBoundActions",value:function(e){var t=this,n=this.getBoundActions(e);return Object(D.y)(n,function(e,n){var r=t.system.statePlugins[n.slice(0,-7)].wrapActions;return r?Object(D.y)(e,function(e,n){var o=r[n];return o?(d()(o)||(o=[o]),o.reduce(function(e,n){var r=function(){return n(e,t.getSystem()).apply(void 0,arguments)};if(!Object(D.r)(r))throw new TypeError("wrapActions needs to return a function that returns a new function (ie the wrapped action)");return z(r)},e||Function.prototype)):e}):e})}},{key:"getWrappedAndBoundSelectors",value:function(e,t){var n=this,r=this.getBoundSelectors(e,t);return Object(D.y)(r,function(t,r){var o=[r.slice(0,-9)],i=n.system.statePlugins[o].wrapSelectors;return i?Object(D.y)(t,function(t,r){var a=i[r];return a?(d()(a)||(a=[a]),a.reduce(function(t,r){var i=function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r(t,n.getSystem()).apply(void 0,[e().getIn(o)].concat(a))};if(!Object(D.r)(i))throw new TypeError("wrapSelector needs to return a function that returns a new function (ie the wrapped action)");return i},t||Function.prototype)):t}):t})}},{key:"getStates",value:function(e){return u()(this.system.statePlugins).reduce(function(t,n){return t[n]=e.get(n),t},{})}},{key:"getStateThunks",value:function(e){return u()(this.system.statePlugins).reduce(function(t,n){return t[n]=function(){return e().get(n)},t},{})}},{key:"getFn",value:function(){return{fn:this.system.fn}}},{key:"getComponents",value:function(e){var t=this,n=this.system.components[e];return d()(n)?n.reduce(function(e,n){return n(e,t.getSystem())}):void 0!==e?this.system.components[e]:this.system.components}},{key:"getBoundSelectors",value:function(e,t){return Object(D.y)(this.getSelectors(),function(n,r){var o=[r.slice(0,-9)],i=function(){return e().getIn(o)};return Object(D.y)(n,function(e){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=z(e).apply(null,[i()].concat(r));return"function"==typeof a&&(a=z(a)(t())),a}})})}},{key:"getBoundActions",value:function(e){e=e||this.getStore().dispatch;var t=this.getActions();return Object(D.y)(t,function(t){return Object(C.bindActionCreators)(function e(t){return"function"!=typeof t?Object(D.y)(t,function(t){return e(t)}):function(){var e=null;try{e=t.apply(void 0,arguments)}catch(t){e={type:M.NEW_THROWN_ERR,error:!0,payload:j()(t)}}finally{return e}}}(t),e)})}},{key:"getMapStateToProps",value:function(){var e=this;return function(){return y()({},e.getSystem())}}},{key:"getMapDispatchToProps",value:function(e){var t=this;return function(n){return f()({},t.getWrappedAndBoundActions(n),t.getFn(),e)}}}]),e}();function q(e,t){return Object(D.u)(e)&&!Object(D.q)(e)?I()({},e):Object(D.s)(e)?q(e(t),t):Object(D.q)(e)?e.map(function(e){return q(e,t)}).reduce(B,{}):{}}function F(e,t){var n=this,r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).hasLoaded;return Object(D.u)(e)&&!Object(D.q)(e)&&"function"==typeof e.afterLoad&&(r=!0,z(e.afterLoad).call(this,t)),Object(D.s)(e)?F.call(this,e(t),t,{hasLoaded:r}):Object(D.q)(e)?e.map(function(e){return F.call(n,e,t,{hasLoaded:r})}):r}function B(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(D.u)(e))return{};if(!Object(D.u)(t))return e;t.wrapComponents&&(Object(D.y)(t.wrapComponents,function(n,r){var o=e.components&&e.components[r];o&&d()(o)?(e.components[r]=o.concat([n]),delete t.wrapComponents[r]):o&&(e.components[r]=[o,n],delete t.wrapComponents[r])}),u()(t.wrapComponents).length||delete t.wrapComponents);var n=e.statePlugins;if(Object(D.u)(n))for(var r in n){var o=n[r];if(Object(D.u)(o)&&Object(D.u)(o.wrapActions)){var i=o.wrapActions;for(var a in i){var s=i[a];d()(s)||(s=[s],i[a]=s),t&&t.statePlugins&&t.statePlugins[r]&&t.statePlugins[r].wrapActions&&t.statePlugins[r].wrapActions[a]&&(t.statePlugins[r].wrapActions[a]=i[a].concat(t.statePlugins[r].wrapActions[a]))}}}return f()(e,t)}function z(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).logErrors,n=void 0===t||t;return"function"!=typeof e?e:function(){try{for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e.call.apply(e,[this].concat(r))}catch(e){return n&&console.error(e),null}}}var V=n(273),H=n(278),W=n(281),J=n(285),K=n(286),Y=n(287),$=n(288),G=n(290),Z=n(294),X=n(295),Q=n(329),ee=n(299),te=n(303),ne=n(305),re=n(6),oe=n.n(re),ie=n(7),ae=n.n(ie),se=n(9),ue=n.n(se),ce=n(8),le=n.n(ce),pe=(n(10),n(19),n(56).helpers.opId),fe=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"toggleShown",function(){var e=r.props,t=e.layoutActions,n=e.tag,o=e.operationId,i=e.isShown,a=r.getResolvedSubtree();i||void 0!==a||r.requestResolvedSubtree(),t.show(["operations",n,o],!i)}),v()(ue()(r),"onCancelClick",function(){r.setState({tryItOutEnabled:!r.state.tryItOutEnabled})}),v()(ue()(r),"onTryoutClick",function(){var e=r.props,t=e.specActions,n=e.path,o=e.method;r.setState({tryItOutEnabled:!r.state.tryItOutEnabled}),t.clearValidateParams([n,o])}),v()(ue()(r),"onExecute",function(){r.setState({executeInProgress:!0})}),v()(ue()(r),"getResolvedSubtree",function(){var e=r.props,t=e.specSelectors,n=e.path,o=e.method,i=e.specPath;return i?t.specResolvedSubtree(i.toJS()):t.specResolvedSubtree(["paths",n,o])}),v()(ue()(r),"requestResolvedSubtree",function(){var e=r.props,t=e.specActions,n=e.path,o=e.method,i=e.specPath;return i?t.requestResolvedSubtree(i.toJS()):t.requestResolvedSubtree(["paths",n,o])}),r.state={tryItOutEnabled:!1,executeInProgress:!1},r}return le()(t,e),x()(t,[{key:"mapStateToProps",value:function(e,t){var n=t.op,r=t.layoutSelectors,o=(0,t.getConfigs)(),i=o.docExpansion,a=o.deepLinking,s=o.displayOperationId,u=o.displayRequestDuration,c=o.supportedSubmitMethods,l=r.showSummary(),p=n.getIn(["operation","__originalOperationId"])||n.getIn(["operation","operationId"])||pe(n.get("operation"),t.path,t.method)||n.get("id"),f=["operations",t.tag,p],h=a&&"false"!==a,d=c.indexOf(t.method)>=0&&(void 0===t.allowTryItOut?t.specSelectors.allowTryItOutFor(t.path,t.method):t.allowTryItOut),m=n.getIn(["operation","security"])||t.specSelectors.security();return{operationId:p,isDeepLinkingEnabled:h,showSummary:l,displayOperationId:s,displayRequestDuration:u,allowTryItOut:d,security:m,isAuthorized:t.authSelectors.isAuthorized(m),isShown:r.isShown(f,"full"===i),jumpToKey:"paths.".concat(t.path,".").concat(t.method),response:t.specSelectors.responseFor(t.path,t.method),request:t.specSelectors.requestFor(t.path,t.method)}}},{key:"componentDidMount",value:function(){var e=this.props.isShown,t=this.getResolvedSubtree();e&&void 0===t&&this.requestResolvedSubtree()}},{key:"componentWillReceiveProps",value:function(e){var t=e.response,n=e.isShown,r=this.getResolvedSubtree();t!==this.props.response&&this.setState({executeInProgress:!1}),n&&void 0===r&&this.requestResolvedSubtree()}},{key:"render",value:function(){var e=this.props,t=e.op,n=e.tag,r=e.path,o=e.method,i=e.security,a=e.isAuthorized,s=e.operationId,u=e.showSummary,c=e.isShown,l=e.jumpToKey,p=e.allowTryItOut,f=e.response,h=e.request,d=e.displayOperationId,m=e.displayRequestDuration,v=e.isDeepLinkingEnabled,g=e.specPath,y=e.specSelectors,b=e.specActions,_=e.getComponent,w=e.getConfigs,x=e.layoutSelectors,E=e.layoutActions,C=e.authActions,O=e.authSelectors,A=e.oas3Actions,T=e.oas3Selectors,j=e.fn,P=_("operation"),I=this.getResolvedSubtree()||Object(k.Map)(),M=Object(k.fromJS)({op:I,tag:n,path:r,summary:t.getIn(["operation","summary"])||"",deprecated:I.get("deprecated")||t.getIn(["operation","deprecated"])||!1,method:o,security:i,isAuthorized:a,operationId:s,originalOperationId:I.getIn(["operation","__originalOperationId"]),showSummary:u,isShown:c,jumpToKey:l,allowTryItOut:p,request:h,displayOperationId:d,displayRequestDuration:m,isDeepLinkingEnabled:v,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return S.a.createElement(P,{operation:M,response:f,request:h,isShown:c,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:g,specActions:b,specSelectors:y,oas3Actions:A,oas3Selectors:T,layoutActions:E,layoutSelectors:x,authActions:C,authSelectors:O,getComponent:_,getConfigs:w,fn:j})}}]),t}(E.PureComponent);v()(fe,"defaultProps",{showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1});var he=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"getLayout",value:function(){var e=this.props,t=e.getComponent,n=e.layoutSelectors.current(),r=t(n,!0);return r||function(){return S.a.createElement("h1",null,' No layout defined for "',n,'" ')}}},{key:"render",value:function(){var e=this.getLayout();return S.a.createElement(e,null)}}]),t}(S.a.Component);he.defaultProps={};var de=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"close",function(){n.props.authActions.showDefinitions(!1)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.authSelectors,n=e.authActions,r=e.getComponent,o=e.errSelectors,i=e.specSelectors,a=e.fn.AST,s=void 0===a?{}:a,u=t.shownDefinitions(),c=r("auths");return S.a.createElement("div",{className:"dialog-ux"},S.a.createElement("div",{className:"backdrop-ux"}),S.a.createElement("div",{className:"modal-ux"},S.a.createElement("div",{className:"modal-dialog-ux"},S.a.createElement("div",{className:"modal-ux-inner"},S.a.createElement("div",{className:"modal-ux-header"},S.a.createElement("h3",null,"Available authorizations"),S.a.createElement("button",{type:"button",className:"close-modal",onClick:this.close},S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{href:"#close",xlinkHref:"#close"})))),S.a.createElement("div",{className:"modal-ux-content"},u.valueSeq().map(function(e,a){return S.a.createElement(c,{key:a,AST:s,definitions:e,getComponent:r,errSelectors:o,authSelectors:t,authActions:n,specSelectors:i})}))))))}}]),t}(S.a.Component),me=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.isAuthorized,n=e.showPopup,r=e.onClick,o=(0,e.getComponent)("authorizationPopup",!0);return S.a.createElement("div",{className:"auth-wrapper"},S.a.createElement("button",{className:t?"btn authorize locked":"btn authorize unlocked",onClick:r},S.a.createElement("span",null,"Authorize"),S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{href:t?"#locked":"#unlocked",xlinkHref:t?"#locked":"#unlocked"}))),n&&S.a.createElement(o,null))}}]),t}(S.a.Component),ve=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.authActions,n=e.authSelectors,r=e.specSelectors,o=e.getComponent,i=r.securityDefinitions(),a=n.definitionsToAuthorize(),s=o("authorizeBtn");return i?S.a.createElement(s,{onClick:function(){return t.showDefinitions(a)},isAuthorized:!!n.authorized().size,showPopup:!!n.shownDefinitions(),getComponent:o}):null}}]),t}(S.a.Component),ge=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onClick",function(e){e.stopPropagation();var t=n.props.onClick;t&&t()}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props.isAuthorized;return S.a.createElement("button",{className:e?"authorization__btn locked":"authorization__btn unlocked","aria-label":e?"authorization button locked":"authorization button unlocked",onClick:this.onClick},S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{href:e?"#locked":"#unlocked",xlinkHref:e?"#locked":"#unlocked"})))}}]),t}(S.a.Component),ye=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onAuthChange",function(e){var t=e.name;r.setState(v()({},t,e))}),v()(ue()(r),"submitAuth",function(e){e.preventDefault(),r.props.authActions.authorize(r.state)}),v()(ue()(r),"logoutClick",function(e){e.preventDefault();var t=r.props,n=t.authActions,o=t.definitions.map(function(e,t){return t}).toArray();r.setState(o.reduce(function(e,t){return e[t]="",e},{})),n.logout(o)}),v()(ue()(r),"close",function(e){e.preventDefault(),r.props.authActions.showDefinitions(!1)}),r.state={},r}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.definitions,r=t.getComponent,o=t.authSelectors,i=t.errSelectors,a=r("AuthItem"),s=r("oauth2",!0),u=r("Button"),c=o.authorized(),l=n.filter(function(e,t){return!!c.get(t)}),p=n.filter(function(e){return"oauth2"!==e.get("type")}),f=n.filter(function(e){return"oauth2"===e.get("type")});return S.a.createElement("div",{className:"auth-container"},!!p.size&&S.a.createElement("form",{onSubmit:this.submitAuth},p.map(function(t,n){return S.a.createElement(a,{key:n,schema:t,name:n,getComponent:r,onAuthChange:e.onAuthChange,authorized:c,errSelectors:i})}).toArray(),S.a.createElement("div",{className:"auth-btn-wrapper"},p.size===l.size?S.a.createElement(u,{className:"btn modal-btn auth",onClick:this.logoutClick},"Logout"):S.a.createElement(u,{type:"submit",className:"btn modal-btn auth authorize"},"Authorize"),S.a.createElement(u,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close"))),f&&f.size?S.a.createElement("div",null,S.a.createElement("div",{className:"scope-def"},S.a.createElement("p",null,"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes."),S.a.createElement("p",null,"API requires the following scopes. Select which ones you want to grant to Swagger UI.")),n.filter(function(e){return"oauth2"===e.get("type")}).map(function(e,t){return S.a.createElement("div",{key:t},S.a.createElement(s,{authorized:c,schema:e,name:t}))}).toArray()):null)}}]),t}(S.a.Component),be=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e,t=this.props,n=t.schema,r=t.name,o=t.getComponent,i=t.onAuthChange,a=t.authorized,s=t.errSelectors,u=o("apiKeyAuth"),c=o("basicAuth"),l=n.get("type");switch(l){case"apiKey":e=S.a.createElement(u,{key:r,schema:n,name:r,errSelectors:s,authorized:a,getComponent:o,onChange:i});break;case"basic":e=S.a.createElement(c,{key:r,schema:n,name:r,errSelectors:s,authorized:a,getComponent:o,onChange:i});break;default:e=S.a.createElement("div",{key:r},"Unknown security definition type ",l)}return S.a.createElement("div",{key:"".concat(r,"-jump")},e)}}]),t}(S.a.Component),_e=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props.error,t=e.get("level"),n=e.get("message"),r=e.get("source");return S.a.createElement("div",{className:"errors",style:{backgroundColor:"#ffeeee",color:"red",margin:"1em"}},S.a.createElement("b",{style:{textTransform:"capitalize",marginRight:"1em"}},r," ",t),S.a.createElement("span",null,n))}}]),t}(S.a.Component),we=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(e){var t=r.props.onChange,n=e.target.value,o=y()({},r.state,{value:n});r.setState(o),t(o)});var o=r.props,i=o.name,a=o.schema,s=r.getValue();return r.state={name:i,schema:a,value:s},r}return le()(t,e),x()(t,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.errSelectors,o=e.name,i=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),c=n("Markdown"),l=n("JumpToPath",!0),p=this.getValue(),f=r.allErrors().filter(function(e){return e.get("authId")===o});return S.a.createElement("div",null,S.a.createElement("h4",null,S.a.createElement("code",null,o||t.get("name")),"  (apiKey)",S.a.createElement(l,{path:["securityDefinitions",o]})),p&&S.a.createElement("h6",null,"Authorized"),S.a.createElement(a,null,S.a.createElement(c,{source:t.get("description")})),S.a.createElement(a,null,S.a.createElement("p",null,"Name: ",S.a.createElement("code",null,t.get("name")))),S.a.createElement(a,null,S.a.createElement("p",null,"In: ",S.a.createElement("code",null,t.get("in")))),S.a.createElement(a,null,S.a.createElement("label",null,"Value:"),p?S.a.createElement("code",null," ****** "):S.a.createElement(s,null,S.a.createElement(i,{type:"text",onChange:this.onChange}))),f.valueSeq().map(function(e,t){return S.a.createElement(u,{error:e,key:t})}))}}]),t}(S.a.Component),xe=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(e){var t=r.props.onChange,n=e.target,o=n.value,i=n.name,a=r.state.value;a[i]=o,r.setState({value:a}),t(r.state)});var o=r.props,i=o.schema,a=o.name,s=r.getValue().username;return r.state={name:a,schema:i,value:s?{username:s}:{}},r}return le()(t,e),x()(t,[{key:"getValue",value:function(){var e=this.props,t=e.authorized,n=e.name;return t&&t.getIn([n,"value"])||{}}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.name,o=e.errSelectors,i=n("Input"),a=n("Row"),s=n("Col"),u=n("authError"),c=n("JumpToPath",!0),l=n("Markdown"),p=this.getValue().username,f=o.allErrors().filter(function(e){return e.get("authId")===r});return S.a.createElement("div",null,S.a.createElement("h4",null,"Basic authorization",S.a.createElement(c,{path:["securityDefinitions",r]})),p&&S.a.createElement("h6",null,"Authorized"),S.a.createElement(a,null,S.a.createElement(l,{source:t.get("description")})),S.a.createElement(a,null,S.a.createElement("label",null,"Username:"),p?S.a.createElement("code",null," ",p," "):S.a.createElement(s,null,S.a.createElement(i,{type:"text",required:"required",name:"username",onChange:this.onChange}))),S.a.createElement(a,null,S.a.createElement("label",null,"Password:"),p?S.a.createElement("code",null," ****** "):S.a.createElement(s,null,S.a.createElement(i,{required:"required",autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),f.valueSeq().map(function(e,t){return S.a.createElement(u,{error:e,key:t})}))}}]),t}(S.a.Component);function Ee(e){var t=e.example,n=e.showValue,r=e.getComponent,o=r("Markdown"),i=r("highlightCode");return t?S.a.createElement("div",{className:"example"},t.get("description")?S.a.createElement("section",{className:"example__section"},S.a.createElement("div",{className:"example__section-header"},"Example Description"),S.a.createElement("p",null,S.a.createElement(o,{source:t.get("description")}))):null,n&&t.has("value")?S.a.createElement("section",{className:"example__section"},S.a.createElement("div",{className:"example__section-header"},"Example Value"),S.a.createElement(i,{value:Object(D.I)(t.get("value"))})):null):null}var Se=n(483),Ce=n.n(Se),ke=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"_onSelect",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.isSyntheticChange,o=void 0!==r&&r;"function"==typeof n.props.onSelect&&n.props.onSelect(e,{isSyntheticChange:o})}),v()(ue()(n),"_onDomSelect",function(e){if("function"==typeof n.props.onSelect){var t=e.target.selectedOptions[0].getAttribute("value");n._onSelect(t,{isSyntheticChange:!1})}}),v()(ue()(n),"getCurrentExample",function(){var e=n.props,t=e.examples,r=e.currentExampleKey,o=t.get(r),i=t.keySeq().first(),a=t.get(i);return o||a||Ce()({})}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.onSelect,n=e.examples;if("function"==typeof t){var r=n.first(),o=n.keyOf(r);this._onSelect(o,{isSyntheticChange:!0})}}},{key:"componentWillReceiveProps",value:function(e){var t=e.currentExampleKey,n=e.examples;if(n!==this.props.examples&&!n.has(t)){var r=n.first(),o=n.keyOf(r);this._onSelect(o,{isSyntheticChange:!0})}}},{key:"render",value:function(){var e=this.props,t=e.examples,n=e.currentExampleKey,r=e.isValueModified,o=e.isModifiedValueAvailable,i=e.showLabels;return S.a.createElement("div",{className:"examples-select"},i?S.a.createElement("span",{className:"examples-select__section-label"},"Examples: "):null,S.a.createElement("select",{onChange:this._onDomSelect,value:o&&r?"__MODIFIED__VALUE__":n||""},o?S.a.createElement("option",{value:"__MODIFIED__VALUE__"},"[Modified value]"):null,t.map(function(e,t){return S.a.createElement("option",{key:t,value:t},e.get("summary")||t)}).valueSeq()))}}]),t}(S.a.PureComponent);v()(ke,"defaultProps",{examples:O.a.Map({}),onSelect:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).log.apply(e,["DEBUG: ExamplesSelect was not given an onSelect callback"].concat(n))},currentExampleKey:null,showLabels:!0});var Oe=function(e){return k.List.isList(e)?e:Object(D.I)(e)},Ae=function(e){function t(e){var n;_()(this,t),n=oe()(this,ae()(t).call(this,e)),v()(ue()(n),"_getStateForCurrentNamespace",function(){var e=n.props.currentNamespace;return(n.state[e]||Object(k.Map)()).toObject()}),v()(ue()(n),"_setStateForCurrentNamespace",function(e){var t=n.props.currentNamespace;return n._setStateForNamespace(t,e)}),v()(ue()(n),"_setStateForNamespace",function(e,t){var r=(n.state[e]||Object(k.Map)()).mergeDeep(t);return n.setState(v()({},e,r))}),v()(ue()(n),"_isCurrentUserInputSameAsExampleValue",function(){var e=n.props.currentUserInputValue;return n._getCurrentExampleValue()===e}),v()(ue()(n),"_getValueForExample",function(e,t){var r=(t||n.props).examples;return Oe((r||Object(k.Map)({})).getIn([e,"value"]))}),v()(ue()(n),"_getCurrentExampleValue",function(e){var t=(e||n.props).currentKey;return n._getValueForExample(t,e||n.props)}),v()(ue()(n),"_onExamplesSelect",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.isSyntheticChange,o=n.props,i=o.onSelect,a=o.updateValue,s=o.currentUserInputValue,u=n._getStateForCurrentNamespace(),c=u.lastUserEditedValue,l=n._getValueForExample(e);if("__MODIFIED__VALUE__"===e)return a(Oe(c)),n._setStateForCurrentNamespace({isModifiedValueSelected:!0});if("function"==typeof i){for(var p=arguments.length,f=new Array(p>2?p-2:0),h=2;h<p;h++)f[h-2]=arguments[h];i.apply(void 0,[e,{isSyntheticChange:r}].concat(f))}n._setStateForCurrentNamespace({lastDownstreamValue:l,isModifiedValueSelected:r&&!!s&&s!==l}),r||"function"==typeof a&&a(Oe(l))});var r=n._getCurrentExampleValue();return n.state=v()({},e.currentNamespace,Object(k.Map)({lastUserEditedValue:n.props.currentUserInputValue,lastDownstreamValue:r,isModifiedValueSelected:n.props.currentUserInputValue!==r})),n}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){var t=e.currentUserInputValue,n=e.examples,r=e.onSelect,o=this._getStateForCurrentNamespace(),i=o.lastUserEditedValue,a=o.lastDownstreamValue,s=this._getValueForExample(e.currentKey,e),u=n.find(function(e){return e.get("value")===t||Object(D.I)(e.get("value"))===t});u?r(n.keyOf(u),{isSyntheticChange:!0}):t!==this.props.currentUserInputValue&&t!==i&&t!==a&&this._setStateForNamespace(e.currentNamespace,{lastUserEditedValue:e.currentUserInputValue,isModifiedValueSelected:t!==s})}},{key:"render",value:function(){var e=this.props,t=e.currentUserInputValue,n=e.examples,r=e.currentKey,o=e.getComponent,i=this._getStateForCurrentNamespace(),a=i.lastDownstreamValue,s=i.lastUserEditedValue,u=i.isModifiedValueSelected,c=o("ExamplesSelect");return S.a.createElement(c,{examples:n,currentExampleKey:r,onSelect:this._onExamplesSelect,isModifiedValueAvailable:!!s&&s!==a,isValueModified:void 0!==t&&u&&t!==this._getCurrentExampleValue()})}}]),t}(S.a.PureComponent);v()(Ae,"defaultProps",{examples:Object(k.Map)({}),currentNamespace:"__DEFAULT__NAMESPACE__",onSelect:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).log.apply(e,["ExamplesSelectValueRetainer: no `onSelect` function was provided"].concat(n))},updateValue:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).log.apply(e,["ExamplesSelectValueRetainer: no `updateValue` function was provided"].concat(n))}});var Te=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"close",function(e){e.preventDefault(),r.props.authActions.showDefinitions(!1)}),v()(ue()(r),"authorize",function(){var e=r.props,t=e.authActions,n=e.errActions,o=e.getConfigs,i=e.authSelectors,a=o(),s=i.getConfigs();n.clear({authId:name,type:"auth",source:"auth"}),function(e){var t=e.auth,n=e.authActions,r=e.errActions,o=e.configs,i=e.authConfigs,a=void 0===i?{}:i,s=t.schema,u=t.scopes,c=t.name,l=t.clientId,p=s.get("flow"),f=[];switch(p){case"password":return void n.authorizePassword(t);case"application":return void n.authorizeApplication(t);case"accessCode":f.push("response_type=code");break;case"implicit":f.push("response_type=token");break;case"clientCredentials":return void n.authorizeApplication(t);case"authorizationCode":f.push("response_type=code")}"string"==typeof l&&f.push("client_id="+encodeURIComponent(l));var h=o.oauth2RedirectUrl;if(void 0!==h){if(f.push("redirect_uri="+encodeURIComponent(h)),d()(u)&&0<u.length){var m=a.scopeSeparator||" ";f.push("scope="+encodeURIComponent(u.join(m)))}var v=Object(D.a)(new Date);if(f.push("state="+encodeURIComponent(v)),void 0!==a.realm&&f.push("realm="+encodeURIComponent(a.realm)),"authorizationCode"===p&&a.usePkceWithAuthorizationCodeGrant){var g=Object(D.j)(),y=Object(D.c)(g);f.push("code_challenge="+y),f.push("code_challenge_method=S256"),t.codeVerifier=g}var b=a.additionalQueryStringParams;for(var _ in b)void 0!==b[_]&&f.push([_,b[_]].map(encodeURIComponent).join("="));var w,x=s.get("authorizationUrl"),E=[Object(D.F)(x),f.join("&")].join(-1===x.indexOf("?")?"?":"&");w="implicit"===p?n.preAuthorizeImplicit:a.useBasicAuthenticationWithAccessCodeGrant?n.authorizeAccessCodeWithBasicAuthentication:n.authorizeAccessCodeWithFormParams,R.a.swaggerUIRedirectOauth2={auth:t,state:v,redirectUrl:h,callback:w,errCb:r.newAuthErr},R.a.open(E)}else r.newAuthErr({authId:c,source:"validation",level:"error",message:"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed."})}({auth:r.state,authActions:t,errActions:n,configs:a,authConfigs:s})}),v()(ue()(r),"onScopeChange",function(e){var t=e.target,n=t.checked,o=t.dataset.value;if(n&&-1===r.state.scopes.indexOf(o)){var i=r.state.scopes.concat([o]);r.setState({scopes:i})}else!n&&r.state.scopes.indexOf(o)>-1&&r.setState({scopes:r.state.scopes.filter(function(e){return e!==o})})}),v()(ue()(r),"onInputChange",function(e){var t=e.target,n=t.dataset.name,o=t.value,i=v()({},n,o);r.setState(i)}),v()(ue()(r),"logout",function(e){e.preventDefault();var t=r.props,n=t.authActions,o=t.errActions,i=t.name;o.clear({authId:i,type:"auth",source:"auth"}),n.logout([i])});var o=r.props,i=o.name,a=o.schema,s=o.authorized,u=o.authSelectors,c=s&&s.get(i),l=u.getConfigs()||{},p=c&&c.get("username")||"",f=c&&c.get("clientId")||l.clientId||"",h=c&&c.get("clientSecret")||l.clientSecret||"",m=c&&c.get("passwordType")||"basic";return r.state={appName:l.appName,name:i,schema:a,scopes:[],clientId:f,clientSecret:h,username:p,password:"",passwordType:m},r}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.schema,r=t.getComponent,o=t.authSelectors,i=t.errSelectors,a=t.name,s=t.specSelectors,u=r("Input"),c=r("Row"),l=r("Col"),p=r("Button"),f=r("authError"),h=r("JumpToPath",!0),d=r("Markdown"),m=r("InitializedInput"),v=s.isOAS3,g=v()?"authorizationCode":"accessCode",y=v()?"clientCredentials":"application",b=n.get("flow"),_=n.get("allowedScopes")||n.get("scopes"),w=!!o.authorized().get(a),x=i.allErrors().filter(function(e){return e.get("authId")===a}),E=!x.filter(function(e){return"validation"===e.get("source")}).size,C=n.get("description");return S.a.createElement("div",null,S.a.createElement("h4",null,a," (OAuth2, ",n.get("flow"),") ",S.a.createElement(h,{path:["securityDefinitions",a]})),this.state.appName?S.a.createElement("h5",null,"Application: ",this.state.appName," "):null,C&&S.a.createElement(d,{source:n.get("description")}),w&&S.a.createElement("h6",null,"Authorized"),("implicit"===b||b===g)&&S.a.createElement("p",null,"Authorization URL: ",S.a.createElement("code",null,n.get("authorizationUrl"))),("password"===b||b===g||b===y)&&S.a.createElement("p",null,"Token URL:",S.a.createElement("code",null," ",n.get("tokenUrl"))),S.a.createElement("p",{className:"flow"},"Flow: ",S.a.createElement("code",null,n.get("flow"))),"password"!==b?null:S.a.createElement(c,null,S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"oauth_username"},"username:"),w?S.a.createElement("code",null," ",this.state.username," "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement("input",{id:"oauth_username",type:"text","data-name":"username",onChange:this.onInputChange}))),S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"oauth_password"},"password:"),w?S.a.createElement("code",null," ****** "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement("input",{id:"oauth_password",type:"password","data-name":"password",onChange:this.onInputChange}))),S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"password_type"},"Client credentials location:"),w?S.a.createElement("code",null," ",this.state.passwordType," "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement("select",{id:"password_type","data-name":"passwordType",onChange:this.onInputChange},S.a.createElement("option",{value:"basic"},"Authorization header"),S.a.createElement("option",{value:"request-body"},"Request body"))))),(b===y||"implicit"===b||b===g||"password"===b)&&(!w||w&&this.state.clientId)&&S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"client_id"},"client_id:"),w?S.a.createElement("code",null," ****** "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement(m,{id:"client_id",type:"text",required:"password"===b,initialValue:this.state.clientId,"data-name":"clientId",onChange:this.onInputChange}))),(b===y||b===g||"password"===b)&&S.a.createElement(c,null,S.a.createElement("label",{htmlFor:"client_secret"},"client_secret:"),w?S.a.createElement("code",null," ****** "):S.a.createElement(l,{tablet:10,desktop:10},S.a.createElement(m,{id:"client_secret",initialValue:this.state.clientSecret,type:"password","data-name":"clientSecret",onChange:this.onInputChange}))),!w&&_&&_.size?S.a.createElement("div",{className:"scopes"},S.a.createElement("h2",null,"Scopes:"),_.map(function(t,n){return S.a.createElement(c,{key:n},S.a.createElement("div",{className:"checkbox"},S.a.createElement(u,{"data-value":n,id:"".concat(n,"-").concat(b,"-checkbox-").concat(e.state.name),disabled:w,type:"checkbox",onChange:e.onScopeChange}),S.a.createElement("label",{htmlFor:"".concat(n,"-").concat(b,"-checkbox-").concat(e.state.name)},S.a.createElement("span",{className:"item"}),S.a.createElement("div",{className:"text"},S.a.createElement("p",{className:"name"},n),S.a.createElement("p",{className:"description"},t)))))}).toArray()):null,x.valueSeq().map(function(e,t){return S.a.createElement(f,{error:e,key:t})}),S.a.createElement("div",{className:"auth-btn-wrapper"},E&&(w?S.a.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.logout},"Logout"):S.a.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.authorize},"Authorize")),S.a.createElement(p,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close")))}}]),t}(S.a.Component),je=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onClick",function(){var e=n.props,t=e.specActions,r=e.path,o=e.method;t.clearResponse(r,o),t.clearRequest(r,o)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("button",{className:"btn btn-clear opblock-control__btn",onClick:this.onClick},"Clear")}}]),t}(E.Component),Pe=function(e){var t=e.headers;return S.a.createElement("div",null,S.a.createElement("h5",null,"Response headers"),S.a.createElement("pre",{className:"microlight"},t))},Ie=function(e){var t=e.duration;return S.a.createElement("div",null,S.a.createElement("h5",null,"Request duration"),S.a.createElement("pre",{className:"microlight"},t," ms"))},Me=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.response!==e.response||this.props.path!==e.path||this.props.method!==e.method||this.props.displayRequestDuration!==e.displayRequestDuration}},{key:"render",value:function(){var e=this.props,t=e.response,n=e.getComponent,r=e.getConfigs,o=e.displayRequestDuration,i=e.specSelectors,a=e.path,s=e.method,c=r().showMutatedRequest?i.mutatedRequestFor(a,s):i.requestFor(a,s),l=t.get("status"),p=c.get("url"),f=t.get("headers").toJS(),h=t.get("notDocumented"),d=t.get("error"),m=t.get("text"),v=t.get("duration"),g=u()(f),y=f["content-type"]||f["Content-Type"],b=n("curl"),_=n("responseBody"),w=g.map(function(e){return S.a.createElement("span",{className:"headerline",key:e}," ",e,": ",f[e]," ")}),x=0!==w.length;return S.a.createElement("div",null,c&&S.a.createElement(b,{request:c}),p&&S.a.createElement("div",null,S.a.createElement("h4",null,"Request URL"),S.a.createElement("div",{className:"request-url"},S.a.createElement("pre",{className:"microlight"},p))),S.a.createElement("h4",null,"Server response"),S.a.createElement("table",{className:"responses-table live-responses-table"},S.a.createElement("thead",null,S.a.createElement("tr",{className:"responses-header"},S.a.createElement("td",{className:"col_header response-col_status"},"Code"),S.a.createElement("td",{className:"col_header response-col_description"},"Details"))),S.a.createElement("tbody",null,S.a.createElement("tr",{className:"response"},S.a.createElement("td",{className:"response-col_status"},l,h?S.a.createElement("div",{className:"response-undocumented"},S.a.createElement("i",null," Undocumented ")):null),S.a.createElement("td",{className:"response-col_description"},d?S.a.createElement("span",null,"".concat(t.get("name"),": ").concat(t.get("message"))):null,m?S.a.createElement(_,{content:m,contentType:y,url:p,headers:f,getComponent:n}):null,x?S.a.createElement(Pe,{headers:w}):null,o&&v?S.a.createElement(Ie,{duration:v}):null)))))}}]),t}(S.a.Component),Ne=n(95),Re=n.n(Ne),De=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"getDefinitionUrl",function(){var e=r.props.specSelectors;return new Re.a(e.url(),R.a.location).toString()});var o=(0,e.getConfigs)().validatorUrl;return r.state={url:r.getDefinitionUrl(),validatorUrl:void 0===o?"https://validator.swagger.io/validator":o},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){var t=(0,e.getConfigs)().validatorUrl;this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===t?"https://validator.swagger.io/validator":t})}},{key:"render",value:function(){var e=(0,this.props.getConfigs)().spec,t=Object(D.F)(this.state.validatorUrl);return"object"===l()(e)&&u()(e).length?null:!this.state.url||!this.state.validatorUrl||this.state.url.indexOf("localhost")>=0||this.state.url.indexOf("127.0.0.1")>=0?null:S.a.createElement("span",{style:{float:"right"}},S.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"".concat(t,"/debug?url=").concat(encodeURIComponent(this.state.url))},S.a.createElement(Le,{src:"".concat(t,"?url=").concat(encodeURIComponent(this.state.url)),alt:"Online validator badge"})))}}]),t}(S.a.Component),Le=function(e){function t(e){var n;return _()(this,t),(n=oe()(this,ae()(t).call(this,e))).state={loaded:!1,error:!1},n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this,t=new Image;t.onload=function(){e.setState({loaded:!0})},t.onerror=function(){e.setState({error:!0})},t.src=this.props.src}},{key:"componentWillReceiveProps",value:function(e){var t=this;if(e.src!==this.props.src){var n=new Image;n.onload=function(){t.setState({loaded:!0})},n.onerror=function(){t.setState({error:!0})},n.src=e.src}}},{key:"render",value:function(){return this.state.error?S.a.createElement("img",{alt:"Error"}):this.state.loaded?S.a.createElement("img",{src:this.props.src,alt:this.props.alt}):null}}]),t}(S.a.Component),Ue=["get","put","post","delete","options","head","patch"],qe=Ue.concat(["trace"]),Fe=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=e.layoutSelectors,o=e.layoutActions,i=e.getConfigs,a=e.fn,s=t.taggedOperations(),u=n("OperationContainer",!0),c=n("OperationTag"),l=i().maxDisplayedTags,p=r.currentFilter();return p&&!0!==p&&(s=a.opsFilter(s,p)),l&&!isNaN(l)&&l>=0&&(s=s.slice(0,l)),S.a.createElement("div",null,s.map(function(e,a){var s=e.get("operations");return S.a.createElement(c,{key:"operation-"+a,tagObj:e,tag:a,layoutSelectors:r,layoutActions:o,getConfigs:i,getComponent:n},s.map(function(e){var n=e.get("path"),r=e.get("method"),o=O.a.List(["paths",n,r]);return-1===(t.isOAS3()?qe:Ue).indexOf(r)?null:S.a.createElement(u,{key:"".concat(n,"-").concat(r),specPath:o,op:e,path:n,method:r,tag:a})}).toArray())}).toArray(),s.size<1?S.a.createElement("h3",null," No operations defined in spec! "):null)}}]),t}(S.a.Component),Be=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.tagObj,n=e.tag,r=e.children,o=e.layoutSelectors,i=e.layoutActions,a=e.getConfigs,s=e.getComponent,u=a(),c=u.docExpansion,l=u.deepLinking,p=l&&"false"!==l,f=s("Collapse"),h=s("Markdown"),d=s("DeepLink"),m=s("Link"),v=t.getIn(["tagDetails","description"],null),g=t.getIn(["tagDetails","externalDocs","description"]),y=t.getIn(["tagDetails","externalDocs","url"]),b=["operations-tag",n],_=o.isShown(b,"full"===c||"list"===c);return S.a.createElement("div",{className:_?"opblock-tag-section is-open":"opblock-tag-section"},S.a.createElement("h4",{onClick:function(){return i.show(b,!_)},className:v?"opblock-tag":"opblock-tag no-desc",id:b.map(function(e){return Object(D.g)(e)}).join("-"),"data-tag":n,"data-is-open":_},S.a.createElement(d,{enabled:p,isShown:_,path:Object(D.d)(n),text:n}),v?S.a.createElement("small",null,S.a.createElement(h,{source:v})):S.a.createElement("small",null),S.a.createElement("div",null,g?S.a.createElement("small",null,g,y?": ":null,y?S.a.createElement(m,{href:Object(D.F)(y),onClick:function(e){return e.stopPropagation()},target:"_blank"},y):null):null),S.a.createElement("button",{className:"expand-operation",title:_?"Collapse operation":"Expand operation",onClick:function(){return i.show(b,!_)}},S.a.createElement("svg",{className:"arrow",width:"20",height:"20"},S.a.createElement("use",{href:_?"#large-arrow-down":"#large-arrow",xlinkHref:_?"#large-arrow-down":"#large-arrow"})))),S.a.createElement(f,{isOpened:_},r))}}]),t}(S.a.Component);v()(Be,"defaultProps",{tagObj:O.a.fromJS({}),tag:""});var ze=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specPath,r=e.response,o=e.request,i=e.toggleShown,a=e.onTryoutClick,s=e.onCancelClick,u=e.onExecute,c=e.fn,l=e.getComponent,p=e.getConfigs,f=e.specActions,h=e.specSelectors,d=e.authActions,m=e.authSelectors,v=e.oas3Actions,g=e.oas3Selectors,y=this.props.operation,b=y.toJS(),_=b.deprecated,w=b.isShown,x=b.path,E=b.method,C=b.op,k=b.tag,O=b.operationId,A=b.allowTryItOut,T=b.displayRequestDuration,j=b.tryItOutEnabled,P=b.executeInProgress,I=C.description,M=C.externalDocs,N=C.schemes,R=y.getIn(["op"]),L=R.get("responses"),U=Object(D.n)(R,["parameters"]),q=h.operationScheme(x,E),F=["operations",k,O],B=Object(D.m)(R),z=l("responses"),V=l("parameters"),H=l("execute"),W=l("clear"),J=l("Collapse"),K=l("Markdown"),Y=l("schemes"),$=l("OperationServers"),G=l("OperationExt"),Z=l("OperationSummary"),X=l("Link"),Q=p().showExtensions;if(L&&r&&r.size>0){var ee=!L.get(String(r.get("status")))&&!L.get("default");r=r.set("notDocumented",ee)}var te=[x,E];return S.a.createElement("div",{className:_?"opblock opblock-deprecated":w?"opblock opblock-".concat(E," is-open"):"opblock opblock-".concat(E),id:Object(D.g)(F.join("-"))},S.a.createElement(Z,{operationProps:y,toggleShown:i,getComponent:l,authActions:d,authSelectors:m,specPath:t}),S.a.createElement(J,{isOpened:w},S.a.createElement("div",{className:"opblock-body"},R&&R.size||null===R?null:S.a.createElement("img",{height:"32px",width:"32px",src:n(462),className:"opblock-loading-animation"}),_&&S.a.createElement("h4",{className:"opblock-title_normal"}," Warning: Deprecated"),I&&S.a.createElement("div",{className:"opblock-description-wrapper"},S.a.createElement("div",{className:"opblock-description"},S.a.createElement(K,{source:I}))),M&&M.url?S.a.createElement("div",{className:"opblock-external-docs-wrapper"},S.a.createElement("h4",{className:"opblock-title_normal"},"Find more details"),S.a.createElement("div",{className:"opblock-external-docs"},S.a.createElement("span",{className:"opblock-external-docs__description"},S.a.createElement(K,{source:M.description})),S.a.createElement(X,{target:"_blank",className:"opblock-external-docs__link",href:Object(D.F)(M.url)},M.url))):null,R&&R.size?S.a.createElement(V,{parameters:U,specPath:t.push("parameters"),operation:R,onChangeKey:te,onTryoutClick:a,onCancelClick:s,tryItOutEnabled:j,allowTryItOut:A,fn:c,getComponent:l,specActions:f,specSelectors:h,pathMethod:[x,E],getConfigs:p,oas3Actions:v,oas3Selectors:g}):null,j?S.a.createElement($,{getComponent:l,path:x,method:E,operationServers:R.get("servers"),pathServers:h.paths().getIn([x,"servers"]),getSelectedServer:g.selectedServer,setSelectedServer:v.setSelectedServer,setServerVariableValue:v.setServerVariableValue,getServerVariable:g.serverVariableValue,getEffectiveServerValue:g.serverEffectiveValue}):null,j&&A&&N&&N.size?S.a.createElement("div",{className:"opblock-schemes"},S.a.createElement(Y,{schemes:N,path:x,method:E,specActions:f,currentScheme:q})):null,S.a.createElement("div",{className:j&&r&&A?"btn-group":"execute-wrapper"},j&&A?S.a.createElement(H,{operation:R,specActions:f,specSelectors:h,path:x,method:E,onExecute:u}):null,j&&r&&A?S.a.createElement(W,{specActions:f,path:x,method:E}):null),P?S.a.createElement("div",{className:"loading-container"},S.a.createElement("div",{className:"loading"})):null,L?S.a.createElement(z,{responses:L,request:o,tryItOutResponse:r,getComponent:l,getConfigs:p,specSelectors:h,oas3Actions:v,oas3Selectors:g,specActions:f,produces:h.producesOptionsFor([x,E]),producesValue:h.currentProducesFor([x,E]),specPath:t.push("responses"),path:x,method:E,displayRequestDuration:T,fn:c}):null,Q&&B.size?S.a.createElement(G,{extensions:B,getComponent:l}):null)))}}]),t}(E.PureComponent);v()(ze,"defaultProps",{operation:null,response:null,request:null,specPath:Object(k.List)(),summary:""});var Ve=n(69),He=n.n(Ve),We=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.toggleShown,n=e.getComponent,r=e.authActions,o=e.authSelectors,i=e.operationProps,a=e.specPath,s=i.toJS(),u=s.summary,c=s.isAuthorized,l=s.method,p=s.op,f=s.showSummary,h=s.operationId,d=s.originalOperationId,m=s.displayOperationId,v=p.summary,g=i.get("security"),y=n("authorizeOperationBtn"),b=n("OperationSummaryMethod"),_=n("OperationSummaryPath"),w=n("JumpToPath",!0);return S.a.createElement("div",{className:"opblock-summary opblock-summary-".concat(l),onClick:t},S.a.createElement(b,{method:l}),S.a.createElement(_,{getComponent:n,operationProps:i,specPath:a}),f?S.a.createElement("div",{className:"opblock-summary-description"},He()(v||u)):null,m&&(d||h)?S.a.createElement("span",{className:"opblock-summary-operation-id"},d||h):null,g&&g.count()?S.a.createElement(y,{isAuthorized:c,onClick:function(){var e=o.definitionsForRequirements(g);r.showDefinitions(e)}}):null,S.a.createElement(w,{path:a}))}}]),t}(E.PureComponent);v()(We,"defaultProps",{operationProps:null,specPath:Object(k.List)(),summary:""});var Je=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props.method;return S.a.createElement("span",{className:"opblock-summary-method"},e.toUpperCase())}}]),t}(E.PureComponent);v()(Je,"defaultProps",{operationProps:null});var Ke=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onCopyCapture",function(e){e.clipboardData.setData("text/plain",n.props.operationProps.get("path")),e.preventDefault()}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.operationProps.toJS(),r=n.deprecated,o=n.isShown,i=n.path,a=n.tag,s=n.operationId,u=n.isDeepLinkingEnabled,c=t("DeepLink");return S.a.createElement("span",{className:r?"opblock-summary-path__deprecated":"opblock-summary-path",onCopyCapture:this.onCopyCapture,"data-path":i},S.a.createElement(c,{enabled:u,isShown:o,path:Object(D.d)("".concat(a,"/").concat(s)),text:i.replace(/\//g,"​/")}))}}]),t}(E.PureComponent),Ye=n(13),$e=n.n(Ye),Ge=function(e){var t=e.extensions,n=(0,e.getComponent)("OperationExtRow");return S.a.createElement("div",{className:"opblock-section"},S.a.createElement("div",{className:"opblock-section-header"},S.a.createElement("h4",null,"Extensions")),S.a.createElement("div",{className:"table-container"},S.a.createElement("table",null,S.a.createElement("thead",null,S.a.createElement("tr",null,S.a.createElement("td",{className:"col_header"},"Field"),S.a.createElement("td",{className:"col_header"},"Value"))),S.a.createElement("tbody",null,t.entrySeq().map(function(e){var t=$e()(e,2),r=t[0],o=t[1];return S.a.createElement(n,{key:"".concat(r,"-").concat(o),xKey:r,xVal:o})})))))},Ze=function(e){var t=e.xKey,n=e.xVal,r=n?n.toJS?n.toJS():n:null;return S.a.createElement("tr",null,S.a.createElement("td",null,t),S.a.createElement("td",null,a()(r)))},Xe=n(484),Qe=n.n(Xe),et=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"initializeComponent",function(e){n.el=e}),v()(ue()(n),"downloadText",function(){Qe()(n.props.value,n.props.fileName||"response.txt")}),v()(ue()(n),"preventYScrollingBeyondElement",function(e){var t=e.target,n=e.nativeEvent.deltaY,r=t.scrollHeight,o=t.offsetHeight,i=t.scrollTop;r>o&&(0===i&&n<0||o+i>=r&&n>0)&&e.preventDefault()}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){Object(D.p)(this.el)}},{key:"componentDidUpdate",value:function(){Object(D.p)(this.el)}},{key:"render",value:function(){var e=this.props,t=e.value,n=e.className,r=e.downloadable;return n=n||"",S.a.createElement("div",{className:"highlight-code"},r?S.a.createElement("div",{className:"download-contents",onClick:this.downloadText},"Download"):null,S.a.createElement("pre",{ref:this.initializeComponent,onWheel:this.preventYScrollingBeyondElement,className:n+" microlight"},t))}}]),t}(E.Component),tt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChangeProducesWrapper",function(e){return n.props.specActions.changeProducesValue([n.props.path,n.props.method],e)}),v()(ue()(n),"onResponseContentTypeChange",function(e){var t=e.controlsAcceptHeader,r=e.value,o=n.props,i=o.oas3Actions,a=o.path,s=o.method;t&&i.setResponseContentType({value:r,path:a,method:s})}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,n=this.props,r=n.responses,o=n.tryItOutResponse,i=n.getComponent,a=n.getConfigs,s=n.specSelectors,u=n.fn,c=n.producesValue,l=n.displayRequestDuration,p=n.specPath,f=n.path,h=n.method,d=n.oas3Selectors,m=n.oas3Actions,v=Object(D.f)(r),g=i("contentType"),y=i("liveResponse"),b=i("response"),_=this.props.produces&&this.props.produces.size?this.props.produces:t.defaultProps.produces,w=s.isOAS3()?Object(D.k)(r):null;return S.a.createElement("div",{className:"responses-wrapper"},S.a.createElement("div",{className:"opblock-section-header"},S.a.createElement("h4",null,"Responses"),s.isOAS3()?null:S.a.createElement("label",null,S.a.createElement("span",null,"Response content type"),S.a.createElement(g,{value:c,onChange:this.onChangeProducesWrapper,contentTypes:_,className:"execute-content-type"}))),S.a.createElement("div",{className:"responses-inner"},o?S.a.createElement("div",null,S.a.createElement(y,{response:o,getComponent:i,getConfigs:a,specSelectors:s,path:this.props.path,method:this.props.method,displayRequestDuration:l}),S.a.createElement("h4",null,"Responses")):null,S.a.createElement("table",{className:"responses-table"},S.a.createElement("thead",null,S.a.createElement("tr",{className:"responses-header"},S.a.createElement("td",{className:"col_header response-col_status"},"Code"),S.a.createElement("td",{className:"col_header response-col_description"},"Description"),s.isOAS3()?S.a.createElement("td",{className:"col col_header response-col_links"},"Links"):null)),S.a.createElement("tbody",null,r.entrySeq().map(function(t){var n=$e()(t,2),r=n[0],l=n[1],g=o&&o.get("status")==r?"response_current":"";return S.a.createElement(b,{key:r,path:f,method:h,specPath:p.push(r),isDefault:v===r,fn:u,className:g,code:r,response:l,specSelectors:s,controlsAcceptHeader:l===w,onContentTypeChange:e.onResponseContentTypeChange,contentType:c,getConfigs:a,activeExamplesKey:d.activeExamplesMember(f,h,"responses",r),oas3Actions:m,getComponent:i})}).toArray()))))}}]),t}(S.a.Component);v()(tt,"defaultProps",{tryItOutResponse:null,produces:Object(k.fromJS)(["application/json"]),displayRequestDuration:!1});var nt=n(59),rt=n.n(nt),ot=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"_onContentTypeChange",function(e){var t=r.props,n=t.onContentTypeChange,o=t.controlsAcceptHeader;r.setState({responseContentType:e}),n({value:e,controlsAcceptHeader:o})}),v()(ue()(r),"getTargetExamplesKey",function(){var e=r.props,t=e.response,n=e.contentType,o=e.activeExamplesKey,i=r.state.responseContentType||n,a=t.getIn(["content",i],Object(k.Map)({})).get("examples",null).keySeq().first();return o||a}),r.state={responseContentType:""},r}return le()(t,e),x()(t,[{key:"render",value:function(){var e,t,n,r=this.props,o=r.path,i=r.method,a=r.code,s=r.response,u=r.className,c=r.specPath,l=r.fn,p=r.getComponent,f=r.getConfigs,h=r.specSelectors,d=r.contentType,m=r.controlsAcceptHeader,v=r.oas3Actions,g=l.inferSchema,y=h.isOAS3(),b=s.get("headers"),_=s.get("links"),w=p("headers"),x=p("highlightCode"),E=p("modelExample"),C=p("Markdown"),O=p("operationLink"),A=p("contentType"),T=p("ExamplesSelect"),j=p("Example"),P=this.state.responseContentType||d,I=s.getIn(["content",P],Object(k.Map)({})),M=I.get("examples",null);if(y){var N=I.get("schema");t=N?g(N.toJS()):null,n=N?Object(k.List)(["content",this.state.responseContentType,"schema"]):c}else t=s.get("schema"),n=s.has("schema")?c.push("schema"):c;if(y){var R=I.get("schema",Object(k.Map)({}));if(M){var L=this.getTargetExamplesKey(),U=M.get(L,Object(k.Map)({}));e=Object(D.I)(U.get("value"))}else e=void 0!==I.get("example")?Object(D.I)(I.get("example")):Object(D.o)(R.toJS(),this.state.responseContentType,{includeReadOnly:!0})}else e=s.getIn(["examples",P])?s.getIn(["examples",P]):t?Object(D.o)(t.toJS(),P,{includeReadOnly:!0,includeWriteOnly:!0}):null;var q=function(e,t){return null!=e?S.a.createElement("div",null,S.a.createElement(t,{className:"example",value:Object(D.I)(e)})):null}(e,x);return S.a.createElement("tr",{className:"response "+(u||""),"data-code":a},S.a.createElement("td",{className:"response-col_status"},a),S.a.createElement("td",{className:"response-col_description"},S.a.createElement("div",{className:"response-col_description__inner"},S.a.createElement(C,{source:s.get("description")})),y&&s.get("content")?S.a.createElement("section",{className:"response-controls"},S.a.createElement("div",{className:rt()("response-control-media-type",{"response-control-media-type--accept-controller":m})},S.a.createElement("small",{className:"response-control-media-type__title"},"Media type"),S.a.createElement(A,{value:this.state.responseContentType,contentTypes:s.get("content")?s.get("content").keySeq():Object(k.Seq)(),onChange:this._onContentTypeChange}),m?S.a.createElement("small",{className:"response-control-media-type__accept-message"},"Controls ",S.a.createElement("code",null,"Accept")," header."):null),M?S.a.createElement("div",{className:"response-control-examples"},S.a.createElement("small",{className:"response-control-examples__title"},"Examples"),S.a.createElement(T,{examples:M,currentExampleKey:this.getTargetExamplesKey(),onSelect:function(e){return v.setActiveExamplesMember({name:e,pathMethod:[o,i],contextType:"responses",contextName:a})},showLabels:!1})):null):null,q||t?S.a.createElement(E,{specPath:n,getComponent:p,getConfigs:f,specSelectors:h,schema:Object(D.i)(t),example:q}):null,y&&M?S.a.createElement(j,{example:M.get(this.getTargetExamplesKey(),Object(k.Map)({})),getComponent:p,omitValue:!0}):null,b?S.a.createElement(w,{headers:b,getComponent:p}):null),y?S.a.createElement("td",{className:"response-col_links"},_?_.toSeq().map(function(e,t){return S.a.createElement(O,{key:t,name:t,link:e,getComponent:p})}):S.a.createElement("i",null,"No links")):null)}}]),t}(S.a.Component);v()(ot,"defaultProps",{response:Object(k.fromJS)({}),onContentTypeChange:function(){}});var it=n(485),at=n.n(it),st=n(486),ut=n.n(st),ct=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"state",{parsedContent:null}),v()(ue()(n),"updateParsedContent",function(e){var t=n.props.content;if(e!==t)if(t&&t instanceof Blob){var r=new FileReader;r.onload=function(){n.setState({parsedContent:r.result})},r.readAsText(t)}else n.setState({parsedContent:t.toString()})}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.updateParsedContent(null)}},{key:"componentDidUpdate",value:function(e){this.updateParsedContent(e.content)}},{key:"render",value:function(){var e,t,n=this.props,r=n.content,o=n.contentType,i=n.url,s=n.headers,u=void 0===s?{}:s,c=n.getComponent,l=this.state.parsedContent,p=c("highlightCode"),f="response_"+(new Date).getTime();if(i=i||"",/^application\/octet-stream/i.test(o)||u["Content-Disposition"]&&/attachment/i.test(u["Content-Disposition"])||u["content-disposition"]&&/attachment/i.test(u["content-disposition"])||u["Content-Description"]&&/File Transfer/i.test(u["Content-Description"])||u["content-description"]&&/File Transfer/i.test(u["content-description"]))if("Blob"in window){var h=o||"text/html",d=r instanceof Blob?r:new Blob([r],{type:h}),m=window.URL.createObjectURL(d),v=[h,i.substr(i.lastIndexOf("/")+1),m].join(":"),g=u["content-disposition"]||u["Content-Disposition"];if(void 0!==g){var y=Object(D.h)(g);null!==y&&(v=y)}t=R.a.navigator&&R.a.navigator.msSaveOrOpenBlob?S.a.createElement("div",null,S.a.createElement("a",{href:m,onClick:function(){return R.a.navigator.msSaveOrOpenBlob(d,v)}},"Download file")):S.a.createElement("div",null,S.a.createElement("a",{href:m,download:v},"Download file"))}else t=S.a.createElement("pre",{className:"microlight"},"Download headers detected but your browser does not support downloading binary via XHR (Blob).");else if(/json/i.test(o)){try{e=a()(JSON.parse(r),null," ")}catch(t){e="can't parse JSON. Raw result:\n\n"+r}t=S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".json"),value:e})}else/xml/i.test(o)?(e=at()(r,{textNodesOnSameLine:!0,indentor:" "}),t=S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".xml"),value:e})):t="text/html"===ut()(o)||/text\/plain/.test(o)?S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".html"),value:r}):/^image\//i.test(o)?o.includes("svg")?S.a.createElement("div",null," ",r," "):S.a.createElement("img",{style:{maxWidth:"100%"},src:window.URL.createObjectURL(r)}):/^audio\//i.test(o)?S.a.createElement("pre",{className:"microlight"},S.a.createElement("audio",{controls:!0},S.a.createElement("source",{src:i,type:o}))):"string"==typeof r?S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".txt"),value:r}):r.size>0?l?S.a.createElement("div",null,S.a.createElement("p",{className:"i"},"Unrecognized response type; displaying content as text."),S.a.createElement(p,{downloadable:!0,fileName:"".concat(f,".txt"),value:l})):S.a.createElement("p",{className:"i"},"Unrecognized response type; unable to display."):null;return t?S.a.createElement("div",null,S.a.createElement("h5",null,"Response body"),t):null}}]),t}(S.a.PureComponent),lt=n(12),pt=n.n(lt),ft=function(e){function t(e){var n;return _()(this,t),n=oe()(this,ae()(t).call(this,e)),v()(ue()(n),"onChange",function(e,t,r){var o=n.props;(0,o.specActions.changeParamByIdentity)(o.onChangeKey,e,t,r)}),v()(ue()(n),"onChangeConsumesWrapper",function(e){var t=n.props;(0,t.specActions.changeConsumesValue)(t.onChangeKey,e)}),v()(ue()(n),"toggleTab",function(e){return"parameters"===e?n.setState({parametersVisible:!0,callbackVisible:!1}):"callbacks"===e?n.setState({callbackVisible:!0,parametersVisible:!1}):void 0}),n.state={callbackVisible:!1,parametersVisible:!0},n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.onTryoutClick,r=t.onCancelClick,o=t.parameters,i=t.allowTryItOut,a=t.tryItOutEnabled,s=t.specPath,u=t.fn,c=t.getComponent,l=t.getConfigs,p=t.specSelectors,f=t.specActions,h=t.pathMethod,d=t.oas3Actions,m=t.oas3Selectors,v=t.operation,g=c("parameterRow"),y=c("TryItOutButton"),b=c("contentType"),_=c("Callbacks",!0),w=c("RequestBody",!0),x=a&&i,E=p.isOAS3(),C=v.get("requestBody");return S.a.createElement("div",{className:"opblock-section"},S.a.createElement("div",{className:"opblock-section-header"},E?S.a.createElement("div",{className:"tab-header"},S.a.createElement("div",{onClick:function(){return e.toggleTab("parameters")},className:"tab-item ".concat(this.state.parametersVisible&&"active")},S.a.createElement("h4",{className:"opblock-title"},S.a.createElement("span",null,"Parameters"))),v.get("callbacks")?S.a.createElement("div",{onClick:function(){return e.toggleTab("callbacks")},className:"tab-item ".concat(this.state.callbackVisible&&"active")},S.a.createElement("h4",{className:"opblock-title"},S.a.createElement("span",null,"Callbacks"))):null):S.a.createElement("div",{className:"tab-header"},S.a.createElement("h4",{className:"opblock-title"},"Parameters")),i?S.a.createElement(y,{enabled:a,onCancelClick:r,onTryoutClick:n}):null),this.state.parametersVisible?S.a.createElement("div",{className:"parameters-container"},o.count()?S.a.createElement("div",{className:"table-container"},S.a.createElement("table",{className:"parameters"},S.a.createElement("thead",null,S.a.createElement("tr",null,S.a.createElement("th",{className:"col_header parameters-col_name"},"Name"),S.a.createElement("th",{className:"col_header parameters-col_description"},"Description"))),S.a.createElement("tbody",null,function(e,t){return e.valueSeq().filter(O.a.Map.isMap).map(t)}(o,function(t,n){return S.a.createElement(g,{fn:u,specPath:s.push(n.toString()),getComponent:c,getConfigs:l,rawParam:t,param:p.parameterWithMetaByIdentity(h,t),key:"".concat(t.get("in"),".").concat(t.get("name")),onChange:e.onChange,onChangeConsumes:e.onChangeConsumesWrapper,specSelectors:p,specActions:f,oas3Actions:d,oas3Selectors:m,pathMethod:h,isExecute:x})}).toArray()))):S.a.createElement("div",{className:"opblock-description-wrapper"},S.a.createElement("p",null,"No parameters"))):null,this.state.callbackVisible?S.a.createElement("div",{className:"callbacks-container opblock-description-wrapper"},S.a.createElement(_,{callbacks:Object(k.Map)(v.get("callbacks")),specPath:s.slice(0,-1).push("callbacks")})):null,E&&C&&this.state.parametersVisible&&S.a.createElement("div",{className:"opblock-section opblock-section-request-body"},S.a.createElement("div",{className:"opblock-section-header"},S.a.createElement("h4",{className:"opblock-title parameter__name ".concat(C.get("required")&&"required")},"Request body"),S.a.createElement("label",null,S.a.createElement(b,{value:m.requestContentType.apply(m,pt()(h)),contentTypes:C.get("content",Object(k.List)()).keySeq(),onChange:function(e){d.setRequestContentType({value:e,pathMethod:h})},className:"body-param-content-type"}))),S.a.createElement("div",{className:"opblock-description-wrapper"},S.a.createElement(w,{specPath:s.slice(0,-1).push("requestBody"),requestBody:C,requestBodyValue:m.requestBodyValue.apply(m,pt()(h)),isExecute:x,activeExamplesKey:m.activeExamplesMember.apply(m,pt()(h).concat(["requestBody","requestBody"])),updateActiveExamplesKey:function(t){e.props.oas3Actions.setActiveExamplesMember({name:t,pathMethod:e.props.pathMethod,contextType:"requestBody",contextName:"requestBody"})},onChange:function(e,t){if(t){var n=m.requestBodyValue.apply(m,pt()(h)),r=k.Map.isMap(n)?n:Object(k.Map)();return d.setRequestBodyValue({pathMethod:h,value:r.setIn(t,e)})}d.setRequestBodyValue({value:e,pathMethod:h})},contentType:m.requestContentType.apply(m,pt()(h))}))))}}]),t}(E.Component);v()(ft,"defaultProps",{onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]});var ht=function(e){var t=e.xKey,n=e.xVal;return S.a.createElement("div",{className:"parameter__extension"},t,": ",String(n))},dt=function(e){var t=e.param,n=e.isIncluded,r=e.onChange,o=e.isDisabled;return t.get("allowEmptyValue")?S.a.createElement("div",{className:rt()("parameter__empty_value_toggle",{disabled:o})},S.a.createElement("input",{type:"checkbox",disabled:o,checked:!o&&n,onChange:function(e){r(e.target.checked)}}),"Send empty value"):null},mt=n(122),vt=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChangeWrapper",function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=r.props,o=n.onChange,i=n.rawParam;return o(i,""===e||e&&0===e.size?null:e,t)}),v()(ue()(r),"_onExampleSelect",function(e){r.props.oas3Actions.setActiveExamplesMember({name:e,pathMethod:r.props.pathMethod,contextType:"parameters",contextName:r.getParamKey()})}),v()(ue()(r),"onChangeIncludeEmpty",function(e){var t=r.props,n=t.specActions,o=t.param,i=t.pathMethod,a=o.get("name"),s=o.get("in");return n.updateEmptyParamInclusion(i,a,s,e)}),v()(ue()(r),"setDefaultValue",function(){var e=r.props,t=e.specSelectors,n=e.pathMethod,o=e.rawParam,i=e.oas3Selectors,a=t.parameterWithMetaByIdentity(n,o)||Object(k.Map)(),s=Object(mt.a)(a,{isOAS3:t.isOAS3()}).schema,u=a.get("content",Object(k.Map)()).keySeq().first(),c=Object(D.o)(s.toJS(),u,{includeWriteOnly:!0});if(a&&void 0===a.get("value")&&"body"!==a.get("in")){var l;if(t.isSwagger2())l=a.get("x-example")||a.getIn(["schema","example"])||s.getIn(["default"]);else if(t.isOAS3()){var p=i.activeExamplesMember.apply(i,pt()(n).concat(["parameters",r.getParamKey()]));l=a.getIn(["examples",p,"value"])||a.getIn(["content",u,"example"])||a.get("example")||s.get("example")||s.get("default")||a.get("default")}void 0===l||k.List.isList(l)||(l=Object(D.I)(l)),void 0!==l?r.onChangeWrapper(l):"object"===s.get("type")&&c&&!a.get("examples")&&r.onChangeWrapper(k.List.isList(c)?c:Object(D.I)(c))}}),r.setDefaultValue(),r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){var t,n=e.specSelectors,r=e.pathMethod,o=e.rawParam,i=n.isOAS3(),a=n.parameterWithMetaByIdentity(r,o)||new k.Map;(a=a.isEmpty()?o:a,i)?t=Object(mt.a)(a,{isOAS3:i}).schema.get("enum"):t=a?a.get("enum"):void 0;var s,u=a?a.get("value"):void 0;void 0!==u?s=u:o.get("required")&&t&&t.size&&(s=t.first()),void 0!==s&&s!==u&&this.onChangeWrapper(Object(D.x)(s)),this.setDefaultValue()}},{key:"getParamKey",value:function(){var e=this.props.param;return e?"".concat(e.get("name"),"-").concat(e.get("in")):null}},{key:"render",value:function(){var e=this.props,t=e.param,n=e.rawParam,r=e.getComponent,o=e.getConfigs,i=e.isExecute,a=e.fn,s=e.onChangeConsumes,u=e.specSelectors,c=e.pathMethod,l=e.specPath,p=e.oas3Selectors,f=u.isOAS3(),h=o(),d=h.showExtensions,m=h.showCommonExtensions;if(t||(t=n),!n)return null;var v,g,y,b=r("JsonSchemaForm"),_=r("ParamBody"),w=t.get("in"),x="body"!==w?null:S.a.createElement(_,{getComponent:r,fn:a,param:t,consumes:u.consumesOptionsFor(c),consumesValue:u.contentTypeValues(c).get("requestContentType"),onChange:this.onChangeWrapper,onChangeConsumes:s,isExecute:i,specSelectors:u,pathMethod:c}),E=r("modelExample"),C=r("Markdown"),O=r("ParameterExt"),A=r("ParameterIncludeEmpty"),T=r("ExamplesSelectValueRetainer"),j=r("Example"),P=Object(mt.a)(t,{isOAS3:f}).schema,I=u.parameterWithMetaByIdentity(c,n)||Object(k.Map)(),M=t.get("format"),N=P.get("type"),L="formData"===w,U="FormData"in R.a,q=t.get("required"),F=P.getIn(["items","type"]),B=I?I.get("value"):"",z=m?Object(D.l)(t):null,V=d?Object(D.m)(t):null,H=!1;return void 0!==t&&(v=P.get("items")),void 0!==v?(g=v.get("enum"),y=v.get("default")):g=P.get("enum"),void 0!==g&&g.size>0&&(H=!0),void 0!==t&&(void 0===(y=P.get("default"))&&(y=t.get("default")),void 0===t.get("example")&&t.get("x-example")),S.a.createElement("tr",{"data-param-name":t.get("name"),"data-param-in":t.get("in")},S.a.createElement("td",{className:"parameters-col_name"},S.a.createElement("div",{className:q?"parameter__name required":"parameter__name"},t.get("name"),q?S.a.createElement("span",{style:{color:"red"}}," *"):null),S.a.createElement("div",{className:"parameter__type"},N,F&&"[".concat(F,"]"),M&&S.a.createElement("span",{className:"prop-format"},"($",M,")")),S.a.createElement("div",{className:"parameter__deprecated"},f&&t.get("deprecated")?"deprecated":null),S.a.createElement("div",{className:"parameter__in"},"(",t.get("in"),")"),m&&z.size?z.map(function(e,t){return S.a.createElement(O,{key:"".concat(t,"-").concat(e),xKey:t,xVal:e})}):null,d&&V.size?V.map(function(e,t){return S.a.createElement(O,{key:"".concat(t,"-").concat(e),xKey:t,xVal:e})}):null),S.a.createElement("td",{className:"parameters-col_description"},t.get("description")?S.a.createElement(C,{source:t.get("description")}):null,!x&&i||!H?null:S.a.createElement(C,{className:"parameter__enum",source:"<i>Available values</i> : "+g.map(function(e){return e}).toArray().join(", ")}),!x&&i||void 0===y?null:S.a.createElement(C,{className:"parameter__default",source:"<i>Default value</i> : "+y}),L&&!U&&S.a.createElement("div",null,"Error: your browser does not support FormData"),f&&t.get("examples")?S.a.createElement("section",{className:"parameter-controls"},S.a.createElement(T,{examples:t.get("examples"),onSelect:this._onExampleSelect,updateValue:this.onChangeWrapper,getComponent:r,defaultToFirstExample:!0,currentKey:p.activeExamplesMember.apply(p,pt()(c).concat(["parameters",this.getParamKey()])),currentUserInputValue:B})):null,x?null:S.a.createElement(b,{fn:a,getComponent:r,value:B,required:q,disabled:!i,description:t.get("description")?"".concat(t.get("name")," - ").concat(t.get("description")):"".concat(t.get("name")),onChange:this.onChangeWrapper,errors:I.get("errors"),schema:P}),x&&P?S.a.createElement(E,{getComponent:r,specPath:l.push("schema"),getConfigs:o,isExecute:i,specSelectors:u,schema:P,example:x}):null,!x&&i?S.a.createElement(A,{onChange:this.onChangeIncludeEmpty,isIncluded:u.parameterInclusionSettingFor(c,t.get("name"),t.get("in")),isDisabled:B&&0!==B.size,param:t}):null,f&&t.get("examples")?S.a.createElement(j,{example:t.getIn(["examples",p.activeExamplesMember.apply(p,pt()(c).concat(["parameters",this.getParamKey()]))]),getComponent:r}):null))}}]),t}(E.Component),gt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onClick",function(){var e=n.props,t=e.specSelectors,r=e.specActions,o=e.operation,i=e.path,a=e.method;r.validateParams([i,a]),t.validateBeforeExecute([i,a])&&(n.props.onExecute&&n.props.onExecute(),r.execute({operation:o,path:i,method:a}))}),v()(ue()(n),"onChangeProducesWrapper",function(e){return n.props.specActions.changeProducesValue([n.props.path,n.props.method],e)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("button",{className:"btn execute opblock-control__btn",onClick:this.onClick},"Execute")}}]),t}(E.Component),yt={color:"#999",fontStyle:"italic"},bt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.headers,n=e.getComponent,r=n("Property"),o=n("Markdown");return t&&t.size?S.a.createElement("div",{className:"headers-wrapper"},S.a.createElement("h4",{className:"headers__title"},"Headers:"),S.a.createElement("table",{className:"headers"},S.a.createElement("thead",null,S.a.createElement("tr",{className:"header-row"},S.a.createElement("th",{className:"header-col"},"Name"),S.a.createElement("th",{className:"header-col"},"Description"),S.a.createElement("th",{className:"header-col"},"Type"))),S.a.createElement("tbody",null,t.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],i=t[1];if(!O.a.Map.isMap(i))return null;var a=i.get("description"),s=i.getIn(["schema"])?i.getIn(["schema","type"]):i.getIn(["type"]),u=i.getIn(["schema","example"]);return S.a.createElement("tr",{key:n},S.a.createElement("td",{className:"header-col"},n),S.a.createElement("td",{className:"header-col"},a?S.a.createElement(o,{source:a}):null),S.a.createElement("td",{className:"header-col"},s," ",u?S.a.createElement(r,{propKey:"Example",propVal:u,propStyle:yt}):null))}).toArray()))):null}}]),t}(S.a.Component),_t=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.editorActions,n=e.errSelectors,r=e.layoutSelectors,o=e.layoutActions,i=(0,e.getComponent)("Collapse");if(t&&t.jumpToLine)var a=t.jumpToLine;var s=n.allErrors().filter(function(e){return"thrown"===e.get("type")||"error"===e.get("level")});if(!s||s.count()<1)return null;var u=r.isShown(["errorPane"],!0),c=s.sortBy(function(e){return e.get("line")});return S.a.createElement("pre",{className:"errors-wrapper"},S.a.createElement("hgroup",{className:"error"},S.a.createElement("h4",{className:"errors__title"},"Errors"),S.a.createElement("button",{className:"btn errors__clear-btn",onClick:function(){return o.show(["errorPane"],!u)}},u?"Hide":"Show")),S.a.createElement(i,{isOpened:u,animated:!0},S.a.createElement("div",{className:"errors"},c.map(function(e,t){var n=e.get("type");return"thrown"===n||"auth"===n?S.a.createElement(wt,{key:t,error:e.get("error")||e,jumpToLine:a}):"spec"===n?S.a.createElement(xt,{key:t,error:e,jumpToLine:a}):void 0}))))}}]),t}(S.a.Component),wt=function(e){var t=e.error,n=e.jumpToLine;if(!t)return null;var r=t.get("line");return S.a.createElement("div",{className:"error-wrapper"},t?S.a.createElement("div",null,S.a.createElement("h4",null,t.get("source")&&t.get("level")?Et(t.get("source"))+" "+t.get("level"):"",t.get("path")?S.a.createElement("small",null," at ",t.get("path")):null),S.a.createElement("span",{style:{whiteSpace:"pre-line",maxWidth:"100%"}},t.get("message")),S.a.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},r&&n?S.a.createElement("a",{onClick:n.bind(null,r)},"Jump to line ",r):null)):null)},xt=function(e){var t=e.error,n=e.jumpToLine,r=null;return t.get("path")?r=k.List.isList(t.get("path"))?S.a.createElement("small",null,"at ",t.get("path").join(".")):S.a.createElement("small",null,"at ",t.get("path")):t.get("line")&&!n&&(r=S.a.createElement("small",null,"on line ",t.get("line"))),S.a.createElement("div",{className:"error-wrapper"},t?S.a.createElement("div",null,S.a.createElement("h4",null,Et(t.get("source"))+" "+t.get("level")," ",r),S.a.createElement("span",{style:{whiteSpace:"pre-line"}},t.get("message")),S.a.createElement("div",{style:{"text-decoration":"underline",cursor:"pointer"}},n?S.a.createElement("a",{onClick:n.bind(null,t.get("line"))},"Jump to line ",t.get("line")):null)):null)};function Et(e){return(e||"").split(" ").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(" ")}wt.defaultProps={jumpToLine:null};var St=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChangeWrapper",function(e){return n.props.onChange(e.target.value)}),n}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}},{key:"componentWillReceiveProps",value:function(e){e.contentTypes&&e.contentTypes.size&&(e.contentTypes.includes(e.value)||e.onChange(e.contentTypes.first()))}},{key:"render",value:function(){var e=this.props,t=e.contentTypes,n=e.className,r=e.value;return t&&t.size?S.a.createElement("div",{className:"content-type-wrapper "+(n||"")},S.a.createElement("select",{className:"content-type",value:r||"",onChange:this.onChangeWrapper},t.map(function(e){return S.a.createElement("option",{key:e,value:e},e)}).toArray())):null}}]),t}(S.a.Component);v()(St,"defaultProps",{onChange:function(){},value:null,contentTypes:Object(k.fromJS)(["application/json"])});var Ct=n(20),kt=n.n(Ct),Ot=n(40),At=n.n(Ot);function Tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return!!e}).join(" ").trim()}var jt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.fullscreen,n=e.full,r=At()(e,["fullscreen","full"]);if(t)return S.a.createElement("section",r);var o="swagger-container"+(n?"-full":"");return S.a.createElement("section",kt()({},r,{className:Tt(r.className,o)}))}}]),t}(S.a.Component),Pt={mobile:"",tablet:"-tablet",desktop:"-desktop",large:"-hd"},It=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.hide,n=e.keepContents,r=(e.mobile,e.tablet,e.desktop,e.large,At()(e,["hide","keepContents","mobile","tablet","desktop","large"]));if(t&&!n)return S.a.createElement("span",null);var o=[];for(var i in Pt)if(Pt.hasOwnProperty(i)){var a=Pt[i];if(i in this.props){var s=this.props[i];if(s<1){o.push("none"+a);continue}o.push("block"+a),o.push("col-"+s+a)}}var u=Tt.apply(void 0,[r.className].concat(o));return S.a.createElement("section",kt()({},r,{style:{display:t?"none":null},className:u}))}}]),t}(S.a.Component),Mt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("div",kt()({},this.props,{className:Tt(this.props.className,"wrapper")}))}}]),t}(S.a.Component),Nt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("button",kt()({},this.props,{className:Tt(this.props.className,"button")}))}}]),t}(S.a.Component);v()(Nt,"defaultProps",{className:""});var Rt=function(e){return S.a.createElement("textarea",e)},Dt=function(e){return S.a.createElement("input",e)},Lt=function(e){function t(e,n){var r,o;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(e){var t,n=r.props,o=n.onChange,i=n.multiple,a=[].slice.call(e.target.options);t=i?a.filter(function(e){return e.selected}).map(function(e){return e.value}):e.target.value,r.setState({value:t}),o&&o(t)}),o=e.value?e.value:e.multiple?[""]:"",r.state={value:o},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.props.value&&this.setState({value:e.value})}},{key:"render",value:function(){var e,t,n=this.props,r=n.allowedValues,o=n.multiple,i=n.allowEmptyValue,a=n.disabled,s=(null===(e=this.state.value)||void 0===e?void 0:null===(t=e.toJS)||void 0===t?void 0:t.call(e))||this.state.value;return S.a.createElement("select",{className:this.props.className,multiple:o,value:s,onChange:this.onChange,disabled:a},i?S.a.createElement("option",{value:""},"--"):null,r.map(function(e,t){return S.a.createElement("option",{key:t,value:String(e)},String(e))}))}}]),t}(S.a.Component);v()(Lt,"defaultProps",{multiple:!1,allowEmptyValue:!0});var Ut=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("a",kt()({},this.props,{rel:"noopener noreferrer",className:Tt(this.props.className,"link")}))}}]),t}(S.a.Component),qt=function(e){var t=e.children;return S.a.createElement("div",{style:{height:"auto",border:"none",margin:0,padding:0}}," ",t," ")},Ft=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"renderNotAnimated",value:function(){return this.props.isOpened?S.a.createElement(qt,null,this.props.children):S.a.createElement("noscript",null)}},{key:"render",value:function(){var e=this.props,t=e.animated,n=e.isOpened,r=e.children;return t?(r=n?r:null,S.a.createElement(qt,null,r)):this.renderNotAnimated()}}]),t}(S.a.Component);v()(Ft,"defaultProps",{isOpened:!1,animated:!1});var Bt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o)))).setTagShown=n._setTagShown.bind(ue()(n)),n}return le()(t,e),x()(t,[{key:"_setTagShown",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"showOp",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=e.layoutActions,o=e.getComponent,i=t.taggedOperations(),a=o("Collapse");return S.a.createElement("div",null,S.a.createElement("h4",{className:"overview-title"},"Overview"),i.map(function(e,t){var o=e.get("operations"),i=["overview-tags",t],s=n.isShown(i,!0);return S.a.createElement("div",{key:"overview-"+t},S.a.createElement("h4",{onClick:function(){return r.show(i,!s)},className:"link overview-tag"}," ",s?"-":"+",t),S.a.createElement(a,{isOpened:s,animated:!0},o.map(function(e){var t=e.toObject(),o=t.path,i=t.method,a=t.id,s=a,u=n.isShown(["operations",s]);return S.a.createElement(zt,{key:a,path:o,method:i,id:o+"-"+i,shown:u,showOpId:s,showOpIdPrefix:"operations",href:"#operation-".concat(s),onClick:r.show})}).toArray()))}).toArray(),i.size<1&&S.a.createElement("h3",null," No operations defined in spec! "))}}]),t}(S.a.Component),zt=function(e){function t(e){var n;return _()(this,t),(n=oe()(this,ae()(t).call(this,e))).onClick=n._onClick.bind(ue()(n)),n}return le()(t,e),x()(t,[{key:"_onClick",value:function(){var e=this.props,t=e.showOpId,n=e.showOpIdPrefix;(0,e.onClick)([n,t],!e.shown)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.method,r=e.shown,o=e.href;return S.a.createElement(Ut,{href:o,style:{fontWeight:r?"bold":"normal"},onClick:this.onClick,className:"block opblock-link"},S.a.createElement("div",null,S.a.createElement("small",{className:"bold-label-".concat(n)},n.toUpperCase()),S.a.createElement("span",{className:"bold-label"},t)))}}]),t}(S.a.Component),Vt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.props.initialValue&&(this.inputRef.value=this.props.initialValue)}},{key:"render",value:function(){var e=this,t=this.props,n=(t.value,t.defaultValue,At()(t,["value","defaultValue"]));return S.a.createElement("input",kt()({},n,{ref:function(t){return e.inputRef=t}}))}}]),t}(S.a.Component),Ht=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.host,n=e.basePath;return S.a.createElement("pre",{className:"base-url"},"[ Base URL: ",t,n," ]")}}]),t}(S.a.Component),Wt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=e.getComponent,r=t.get("name")||"the developer",o=t.get("url"),i=t.get("email"),a=n("Link");return S.a.createElement("div",{className:"info__contact"},o&&S.a.createElement("div",null,S.a.createElement(a,{href:Object(D.F)(o),target:"_blank"},r," - Website")),i&&S.a.createElement(a,{href:Object(D.F)("mailto:".concat(i))},o?"Send email to ".concat(r):"Contact ".concat(r)))}}]),t}(S.a.Component),Jt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.license,n=(0,e.getComponent)("Link"),r=t.get("name")||"License",o=t.get("url");return S.a.createElement("div",{className:"info__license"},o?S.a.createElement(n,{target:"_blank",href:Object(D.F)(o)},r):S.a.createElement("span",null,r))}}]),t}(S.a.Component),Kt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.url,n=(0,e.getComponent)("Link");return S.a.createElement(n,{target:"_blank",href:Object(D.F)(t)},S.a.createElement("span",{className:"url"}," ",t," "))}}]),t}(S.a.PureComponent),Yt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.info,n=e.url,r=e.host,o=e.basePath,i=e.getComponent,a=e.externalDocs,s=t.get("version"),u=t.get("description"),c=t.get("title"),l=t.get("termsOfService"),p=t.get("contact"),f=t.get("license"),h=(a||Object(k.fromJS)({})).toJS(),d=h.url,m=h.description,v=i("Markdown"),g=i("Link"),y=i("VersionStamp"),b=i("InfoUrl"),_=i("InfoBasePath");return S.a.createElement("div",{className:"info"},S.a.createElement("hgroup",{className:"main"},S.a.createElement("h2",{className:"title"},c,s&&S.a.createElement(y,{version:s})),r||o?S.a.createElement(_,{host:r,basePath:o}):null,n&&S.a.createElement(b,{getComponent:i,url:n})),S.a.createElement("div",{className:"description"},S.a.createElement(v,{source:u})),l&&S.a.createElement("div",{className:"info__tos"},S.a.createElement(g,{target:"_blank",href:Object(D.F)(l)},"Terms of service")),p&&p.size?S.a.createElement(Wt,{getComponent:i,data:p}):null,f&&f.size?S.a.createElement(Jt,{getComponent:i,license:f}):null,d?S.a.createElement(g,{className:"info__extdocs",target:"_blank",href:Object(D.F)(d)},m||d):null)}}]),t}(S.a.Component),$t=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=t.info(),o=t.url(),i=t.basePath(),a=t.host(),s=t.externalDocs(),u=n("info");return S.a.createElement("div",null,r&&r.count()?S.a.createElement(u,{info:r,url:o,host:a,basePath:i,externalDocs:s,getComponent:n}):null)}}]),t}(S.a.Component),Gt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return null}}]),t}(S.a.Component),Zt=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){return S.a.createElement("div",{className:"footer"})}}]),t}(S.a.Component),Xt=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onFilterChange",function(e){var t=e.target.value;n.props.layoutActions.updateFilter(t)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=(0,e.getComponent)("Col"),o="loading"===t.loadingStatus(),i="failed"===t.loadingStatus(),a=n.currentFilter(),s={};return i&&(s.color="red"),o&&(s.color="#aaa"),S.a.createElement("div",null,null===a||!1===a?null:S.a.createElement("div",{className:"filter-container"},S.a.createElement(r,{className:"filter wrapper",mobile:12},S.a.createElement("input",{className:"operation-filter-input",placeholder:"Filter by tag",type:"text",onChange:this.onFilterChange,value:!0===a||"true"===a?"":a,disabled:o,style:s}))))}}]),t}(S.a.Component),Qt=Function.prototype,en=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"updateValues",function(e){var t=e.param,n=e.isExecute,o=e.consumesValue,i=void 0===o?"":o,a=/xml/i.test(i),s=/json/i.test(i),u=a?t.get("value_xml"):t.get("value");if(void 0!==u){var c=!u&&s?"{}":u;r.setState({value:c}),r.onChange(c,{isXml:a,isEditBox:n})}else a?r.onChange(r.sample("xml"),{isXml:a,isEditBox:n}):r.onChange(r.sample(),{isEditBox:n})}),v()(ue()(r),"sample",function(e){var t=r.props,n=t.param,o=(0,t.fn.inferSchema)(n.toJS());return Object(D.o)(o,e,{includeWriteOnly:!0})}),v()(ue()(r),"onChange",function(e,t){var n=t.isEditBox,o=t.isXml;r.setState({value:e,isEditBox:n}),r._onChange(e,o)}),v()(ue()(r),"_onChange",function(e,t){(r.props.onChange||Qt)(e,t)}),v()(ue()(r),"handleOnChange",function(e){var t=r.props.consumesValue,n=/xml/i.test(t),o=e.target.value;r.onChange(o,{isXml:n})}),v()(ue()(r),"toggleIsEditBox",function(){return r.setState(function(e){return{isEditBox:!e.isEditBox}})}),r.state={isEditBox:!1,value:""},r}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){this.updateValues.call(this,this.props)}},{key:"componentWillReceiveProps",value:function(e){this.updateValues.call(this,e)}},{key:"render",value:function(){var e=this.props,n=e.onChangeConsumes,r=e.param,o=e.isExecute,i=e.specSelectors,a=e.pathMethod,s=e.getComponent,u=s("Button"),c=s("TextArea"),l=s("highlightCode"),p=s("contentType"),f=(i?i.parameterWithMetaByIdentity(a,r):r).get("errors",Object(k.List)()),h=i.contentTypeValues(a).get("requestContentType"),d=this.props.consumes&&this.props.consumes.size?this.props.consumes:t.defaultProp.consumes,m=this.state,v=m.value,g=m.isEditBox;return S.a.createElement("div",{className:"body-param","data-param-name":r.get("name"),"data-param-in":r.get("in")},g&&o?S.a.createElement(c,{className:"body-param__text"+(f.count()?" invalid":""),value:v,onChange:this.handleOnChange}):v&&S.a.createElement(l,{className:"body-param__example",value:v}),S.a.createElement("div",{className:"body-param-options"},o?S.a.createElement("div",{className:"body-param-edit"},S.a.createElement(u,{className:g?"btn cancel body-param__example-edit":"btn edit body-param__example-edit",onClick:this.toggleIsEditBox},g?"Cancel":"Edit")):null,S.a.createElement("label",{htmlFor:""},S.a.createElement("span",null,"Parameter content type"),S.a.createElement(p,{value:h,contentTypes:d,onChange:n,className:"body-param-content-type"}))))}}]),t}(E.PureComponent);v()(en,"defaultProp",{consumes:Object(k.fromJS)(["application/json"]),param:Object(k.fromJS)({}),onChange:Qt,onChangeConsumes:Qt});var tn=n(92),nn=n.n(tn);var rn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"handleFocus",value:function(e){e.target.select(),document.execCommand("copy")}},{key:"render",value:function(){var e=function(e){var t=[],n="",r=e.get("headers");if(t.push("curl"),t.push("-X",e.get("method")),t.push('"'.concat(e.get("url"),'"')),r&&r.size){var o=!0,i=!1,s=void 0;try{for(var u,c=nn()(e.get("headers").entries());!(o=(u=c.next()).done);o=!0){var l=u.value,p=$e()(l,2),f=p[0],h=p[1];n=h,t.push("-H "),t.push('"'.concat(f,": ").concat(h,'"'))}}catch(e){i=!0,s=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw s}}}if(e.get("body"))if("multipart/form-data"===n&&"POST"===e.get("method")){var d=!0,m=!1,v=void 0;try{for(var g,y=nn()(e.get("body").entrySeq());!(d=(g=y.next()).done);d=!0){var b=$e()(g.value,2),_=b[0],w=b[1];t.push("-F"),w instanceof R.a.File?t.push('"'.concat(_,"=@").concat(w.name).concat(w.type?";type=".concat(w.type):"",'"')):t.push('"'.concat(_,"=").concat(w,'"'))}}catch(e){m=!0,v=e}finally{try{d||null==y.return||y.return()}finally{if(m)throw v}}}else t.push("-d"),t.push(a()(e.get("body")).replace(/\\n/g,""));return t.join(" ")}(this.props.request);return S.a.createElement("div",null,S.a.createElement("h4",null,"Curl"),S.a.createElement("div",{className:"copy-paste"},S.a.createElement("textarea",{onFocus:this.handleFocus,readOnly:!0,className:"curl",style:{whiteSpace:"normal"},value:e})))}}]),t}(S.a.Component),on=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChange",function(e){n.setScheme(e.target.value)}),v()(ue()(n),"setScheme",function(e){var t=n.props,r=t.path,o=t.method;t.specActions.setScheme(e,r,o)}),n}return le()(t,e),x()(t,[{key:"componentWillMount",value:function(){var e=this.props.schemes;this.setScheme(e.first())}},{key:"componentWillReceiveProps",value:function(e){this.props.currentScheme&&e.schemes.includes(this.props.currentScheme)||this.setScheme(e.schemes.first())}},{key:"render",value:function(){var e=this.props,t=e.schemes,n=e.currentScheme;return S.a.createElement("label",{htmlFor:"schemes"},S.a.createElement("span",{className:"schemes-title"},"Schemes"),S.a.createElement("select",{onChange:this.onChange,value:n},t.valueSeq().map(function(e){return S.a.createElement("option",{value:e,key:e},e)}).toArray()))}}]),t}(S.a.Component),an=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.specActions,n=e.specSelectors,r=e.getComponent,o=n.operationScheme(),i=n.schemes(),a=r("schemes");return i&&i.size?S.a.createElement(a,{currentScheme:o,schemes:i,specActions:t}):null}}]),t}(S.a.Component),sn=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"toggleCollapsed",function(){r.props.onToggle&&r.props.onToggle(r.props.modelName,!r.state.expanded),r.setState({expanded:!r.state.expanded})});var o=r.props,i=o.expanded,a=o.collapsedContent;return r.state={expanded:i,collapsedContent:a||t.defaultProps.collapsedContent},r}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.hideSelfOnExpand,n=e.expanded,r=e.modelName;t&&n&&this.props.onToggle(r,n)}},{key:"componentWillReceiveProps",value:function(e){this.props.expanded!==e.expanded&&this.setState({expanded:e.expanded})}},{key:"render",value:function(){var e=this.props,t=e.title,n=e.classes;return this.state.expanded&&this.props.hideSelfOnExpand?S.a.createElement("span",{className:n||""},this.props.children):S.a.createElement("span",{className:n||""},t&&S.a.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},t),S.a.createElement("span",{onClick:this.toggleCollapsed,style:{cursor:"pointer"}},S.a.createElement("span",{className:"model-toggle"+(this.state.expanded?"":" collapsed")})),this.state.expanded?this.props.children:this.state.collapsedContent)}}]),t}(E.Component);v()(sn,"defaultProps",{collapsedContent:"{...}",expanded:!1,title:null,onToggle:function(){},hideSelfOnExpand:!1});var un=function(e){function t(e,n){var r;_()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"activeTab",function(e){var t=e.target.dataset.name;r.setState({activeTab:t})});var o=r.props,i=o.getConfigs,a=o.isExecute,s=i().defaultModelRendering,u=s;return"example"!==s&&"model"!==s&&(u="example"),a&&(u="example"),r.state={activeTab:u},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){e.isExecute&&!this.props.isExecute&&this.props.example&&this.setState({activeTab:"example"})}},{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.specSelectors,r=e.schema,o=e.example,i=e.isExecute,a=e.getConfigs,s=e.specPath,u=a().defaultModelExpandDepth,c=t("ModelWrapper"),l=t("highlightCode"),p=n.isOAS3();return S.a.createElement("div",{className:"model-example"},S.a.createElement("ul",{className:"tab"},S.a.createElement("li",{className:"tabitem"+("example"===this.state.activeTab?" active":"")},S.a.createElement("a",{className:"tablinks","data-name":"example",onClick:this.activeTab},i?"Edit Value":"Example Value")),r?S.a.createElement("li",{className:"tabitem"+("model"===this.state.activeTab?" active":"")},S.a.createElement("a",{className:"tablinks"+(i?" inactive":""),"data-name":"model",onClick:this.activeTab},p?"Schema":"Model")):null),S.a.createElement("div",null,"example"===this.state.activeTab?o||S.a.createElement(l,{value:"(no example available)"}):null,"model"===this.state.activeTab&&S.a.createElement(c,{schema:r,getComponent:t,getConfigs:a,specSelectors:n,expandDepth:u,specPath:s})))}}]),t}(S.a.Component),cn=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onToggle",function(e,t){n.props.layoutActions&&n.props.layoutActions.show(["models",e],t)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e,t=this.props,n=t.getComponent,r=t.getConfigs,o=n("Model");return this.props.layoutSelectors&&(e=this.props.layoutSelectors.isShown(["models",this.props.name])),S.a.createElement("div",{className:"model-box"},S.a.createElement(o,kt()({},this.props,{getConfigs:r,expanded:e,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}]),t}(E.Component),ln=n(196),pn=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"getSchemaBasePath",function(){return n.props.specSelectors.isOAS3()?["components","schemas"]:["definitions"]}),v()(ue()(n),"getCollapsedContent",function(){return" "}),v()(ue()(n),"handleToggle",function(e,t){n.props.layoutActions.show(["models",e],t),t&&n.props.specActions.requestResolvedSubtree([].concat(pt()(n.getSchemaBasePath()),[e]))}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.specSelectors,r=t.getComponent,o=t.layoutSelectors,i=t.layoutActions,a=t.getConfigs,s=n.definitions(),u=a(),c=u.docExpansion,l=u.defaultModelsExpandDepth;if(!s.size||l<0)return null;var p=o.isShown("models",l>0&&"none"!==c),f=this.getSchemaBasePath(),h=n.isOAS3(),d=r("ModelWrapper"),m=r("Collapse"),v=r("ModelCollapse"),g=r("JumpToPath");return S.a.createElement("section",{className:p?"models is-open":"models"},S.a.createElement("h4",{onClick:function(){return i.show("models",!p)}},S.a.createElement("span",null,h?"Schemas":"Models"),S.a.createElement("svg",{width:"20",height:"20"},S.a.createElement("use",{xlinkHref:p?"#large-arrow-down":"#large-arrow"}))),S.a.createElement(m,{isOpened:p},s.entrySeq().map(function(t){var s=$e()(t,1)[0],u=[].concat(pt()(f),[s]),c=n.specResolvedSubtree(u),p=n.specJson().getIn(u),h=k.Map.isMap(c)?c:O.a.Map(),m=k.Map.isMap(p)?p:O.a.Map(),y=h.get("title")||m.get("title")||s,b=o.isShown(["models",s],!1);b&&0===h.size&&m.size>0&&e.props.specActions.requestResolvedSubtree([].concat(pt()(e.getSchemaBasePath()),[s]));var _=O.a.List([].concat(pt()(f),[s])),w=S.a.createElement(d,{name:s,expandDepth:l,schema:h||O.a.Map(),displayName:y,specPath:_,getComponent:r,specSelectors:n,getConfigs:a,layoutSelectors:o,layoutActions:i}),x=S.a.createElement("span",{className:"model-box"},S.a.createElement("span",{className:"model model-title"},y));return S.a.createElement("div",{id:"model-".concat(s),className:"model-container",key:"models-section-".concat(s)},S.a.createElement("span",{className:"models-jump-to-path"},S.a.createElement(g,{specPath:_})),S.a.createElement(v,{classes:"model-box",collapsedContent:e.getCollapsedContent(s),onToggle:e.handleToggle,title:x,displayName:y,modelName:s,hideSelfOnExpand:!0,expanded:l>0&&b},w))}).toArray()))}}]),t}(E.Component),fn=function(e){var t=e.value,n=(0,e.getComponent)("ModelCollapse"),r=S.a.createElement("span",null,"Array [ ",t.count()," ]");return S.a.createElement("span",{className:"prop-enum"},"Enum:",S.a.createElement("br",null),S.a.createElement(n,{collapsedContent:r},"[ ",t.join(", ")," ]"))},hn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.name,r=e.displayName,o=e.isRef,i=e.getComponent,s=e.getConfigs,u=e.depth,c=e.onToggle,l=e.expanded,p=e.specPath,f=At()(e,["schema","name","displayName","isRef","getComponent","getConfigs","depth","onToggle","expanded","specPath"]),h=f.specSelectors,d=f.expandDepth,m=h.isOAS3;if(!t)return null;var v=s().showExtensions,g=t.get("description"),y=t.get("properties"),b=t.get("additionalProperties"),_=t.get("title")||r||n,w=t.get("required"),x=i("JumpToPath",!0),E=i("Markdown"),C=i("Model"),O=i("ModelCollapse"),A=function(){return S.a.createElement("span",{className:"model-jump-to-path"},S.a.createElement(x,{specPath:p}))},T=S.a.createElement("span",null,S.a.createElement("span",null,"{"),"...",S.a.createElement("span",null,"}"),o?S.a.createElement(A,null):""),j=h.isOAS3()?t.get("anyOf"):null,P=h.isOAS3()?t.get("oneOf"):null,I=h.isOAS3()?t.get("not"):null,M=_&&S.a.createElement("span",{className:"model-title"},o&&t.get("$$ref")&&S.a.createElement("span",{className:"model-hint"},t.get("$$ref")),S.a.createElement("span",{className:"model-title__text"},_));return S.a.createElement("span",{className:"model"},S.a.createElement(O,{modelName:n,title:M,onToggle:c,expanded:!!l||u<=d,collapsedContent:T},S.a.createElement("span",{className:"brace-open object"},"{"),o?S.a.createElement(A,null):null,S.a.createElement("span",{className:"inner-object"},S.a.createElement("table",{className:"model"},S.a.createElement("tbody",null,g?S.a.createElement("tr",{style:{color:"#666",fontWeight:"normal"}},S.a.createElement("td",{style:{fontWeight:"bold"}},"description:"),S.a.createElement("td",null,S.a.createElement(E,{source:g}))):null,y&&y.size?y.entrySeq().map(function(e){var t=$e()(e,2),r=t[0],o=t[1],a=m()&&o.get("deprecated"),c=k.List.isList(w)&&w.contains(r),l={verticalAlign:"top",paddingRight:"0.2em"};return c&&(l.fontWeight="bold"),S.a.createElement("tr",{key:r,className:a&&"deprecated"},S.a.createElement("td",{style:l},r,c&&S.a.createElement("span",{style:{color:"red"}},"*")),S.a.createElement("td",{style:{verticalAlign:"top"}},S.a.createElement(C,kt()({key:"object-".concat(n,"-").concat(r,"_").concat(o)},f,{required:c,getComponent:i,specPath:p.push("properties",r),getConfigs:s,schema:o,depth:u+1}))))}).toArray():null,v?S.a.createElement("tr",null," "):null,v?t.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],r=t[1];if("x-"===n.slice(0,2)){var o=r?r.toJS?r.toJS():r:null;return S.a.createElement("tr",{key:n,style:{color:"#777"}},S.a.createElement("td",null,n),S.a.createElement("td",{style:{verticalAlign:"top"}},a()(o)))}}).toArray():null,b&&b.size?S.a.createElement("tr",null,S.a.createElement("td",null,"< * >:"),S.a.createElement("td",null,S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("additionalProperties"),getConfigs:s,schema:b,depth:u+1})))):null,j?S.a.createElement("tr",null,S.a.createElement("td",null,"anyOf ->"),S.a.createElement("td",null,j.map(function(e,t){return S.a.createElement("div",{key:t},S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("anyOf",t),getConfigs:s,schema:e,depth:u+1})))}))):null,P?S.a.createElement("tr",null,S.a.createElement("td",null,"oneOf ->"),S.a.createElement("td",null,P.map(function(e,t){return S.a.createElement("div",{key:t},S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("oneOf",t),getConfigs:s,schema:e,depth:u+1})))}))):null,I?S.a.createElement("tr",null,S.a.createElement("td",null,"not ->"),S.a.createElement("td",null,S.a.createElement("div",null,S.a.createElement(C,kt()({},f,{required:!1,getComponent:i,specPath:p.push("not"),getConfigs:s,schema:I,depth:u+1}))))):null))),S.a.createElement("span",{className:"brace-close"},"}")))}}]),t}(E.Component),dn={color:"#999",fontStyle:"italic"},mn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.getConfigs,r=e.schema,o=e.depth,i=e.expandDepth,a=e.name,s=e.displayName,u=e.specPath,c=r.get("description"),l=r.get("items"),p=r.get("title")||s||a,f=r.filter(function(e,t){return-1===["type","items","description","$$ref"].indexOf(t)}),h=t("Markdown"),d=t("ModelCollapse"),m=t("Model"),v=t("Property"),g=p&&S.a.createElement("span",{className:"model-title"},S.a.createElement("span",{className:"model-title__text"},p));return S.a.createElement("span",{className:"model"},S.a.createElement(d,{title:g,expanded:o<=i,collapsedContent:"[...]"},"[",f.size?f.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],r=t[1];return S.a.createElement(v,{key:"".concat(n,"-").concat(r),propKey:n,propVal:r,propStyle:dn})}):null,c?S.a.createElement(h,{source:c}):f.size?S.a.createElement("div",{className:"markdown"}):null,S.a.createElement("span",null,S.a.createElement(m,kt()({},this.props,{getConfigs:n,specPath:u.push("items"),name:null,schema:l,required:!1,depth:o+1}))),"]"))}}]),t}(E.Component),vn={color:"#6b6b6b",fontStyle:"italic"},gn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.schema,n=e.getComponent,r=e.getConfigs,o=e.name,i=e.displayName,a=e.depth,s=r().showExtensions;if(!t||!t.get)return S.a.createElement("div",null);var u=t.get("type"),c=t.get("format"),l=t.get("xml"),p=t.get("enum"),f=t.get("title")||i||o,h=t.get("description"),d=Object(D.m)(t),m=t.filter(function(e,t){return-1===["enum","type","format","description","$$ref"].indexOf(t)}).filterNot(function(e,t){return d.has(t)}),v=n("Markdown"),g=n("EnumModel"),y=n("Property");return S.a.createElement("span",{className:"model"},S.a.createElement("span",{className:"prop"},o&&S.a.createElement("span",{className:"".concat(1===a&&"model-title"," prop-name")},f),S.a.createElement("span",{className:"prop-type"},u),c&&S.a.createElement("span",{className:"prop-format"},"($",c,")"),m.size?m.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],r=t[1];return S.a.createElement(y,{key:"".concat(n,"-").concat(r),propKey:n,propVal:r,propStyle:vn})}):null,s&&d.size?d.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],r=t[1];return S.a.createElement(y,{key:"".concat(n,"-").concat(r),propKey:n,propVal:r,propStyle:vn})}):null,h?S.a.createElement(v,{source:h}):null,l&&l.size?S.a.createElement("span",null,S.a.createElement("br",null),S.a.createElement("span",{style:vn},"xml:"),l.entrySeq().map(function(e){var t=$e()(e,2),n=t[0],r=t[1];return S.a.createElement("span",{key:"".concat(n,"-").concat(r),style:vn},S.a.createElement("br",null),"   ",n,": ",String(r))}).toArray()):null,p&&S.a.createElement(g,{value:p,getComponent:n})))}}]),t}(E.Component),yn=function(e){var t=e.propKey,n=e.propVal,r=e.propStyle;return S.a.createElement("span",{style:r},S.a.createElement("br",null),t,": ",String(n))},bn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.onTryoutClick,n=e.onCancelClick,r=e.enabled;return S.a.createElement("div",{className:"try-out"},r?S.a.createElement("button",{className:"btn try-out__btn cancel",onClick:n},"Cancel"):S.a.createElement("button",{className:"btn try-out__btn",onClick:t},"Try it out "))}}]),t}(S.a.Component);v()(bn,"defaultProps",{onTryoutClick:Function.prototype,onCancelClick:Function.prototype,enabled:!1});var _n=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.bypass,n=e.isSwagger2,r=e.isOAS3,o=e.alsoShow;return t?S.a.createElement("div",null,this.props.children):n&&r?S.a.createElement("div",{className:"version-pragma"},o,S.a.createElement("div",{className:"version-pragma__message version-pragma__message--ambiguous"},S.a.createElement("div",null,S.a.createElement("h3",null,"Unable to render this definition"),S.a.createElement("p",null,S.a.createElement("code",null,"swagger")," and ",S.a.createElement("code",null,"openapi")," fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields."),S.a.createElement("p",null,"Supported version fields are ",S.a.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",S.a.createElement("code",null,"openapi: 3.0.n")," (for example, ",S.a.createElement("code",null,"openapi: 3.0.0"),").")))):n||r?S.a.createElement("div",null,this.props.children):S.a.createElement("div",{className:"version-pragma"},o,S.a.createElement("div",{className:"version-pragma__message version-pragma__message--missing"},S.a.createElement("div",null,S.a.createElement("h3",null,"Unable to render this definition"),S.a.createElement("p",null,"The provided definition does not specify a valid version field."),S.a.createElement("p",null,"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are ",S.a.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",S.a.createElement("code",null,"openapi: 3.0.n")," (for example, ",S.a.createElement("code",null,"openapi: 3.0.0"),")."))))}}]),t}(S.a.PureComponent);v()(_n,"defaultProps",{alsoShow:null,children:null,bypass:!1});var wn=function(e){var t=e.version;return S.a.createElement("small",null,S.a.createElement("pre",{className:"version"}," ",t," "))},xn=function(e){var t=e.enabled,n=e.path,r=e.text;return S.a.createElement("a",{className:"nostyle",onClick:t?function(e){return e.preventDefault()}:null,href:t?"#/".concat(n):null},S.a.createElement("span",null,r))},En=function(){return S.a.createElement("div",null,S.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",style:{position:"absolute",width:0,height:0}},S.a.createElement("defs",null,S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"unlocked"},S.a.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"locked"},S.a.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"close"},S.a.createElement("path",{d:"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow"},S.a.createElement("path",{d:"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z"})),S.a.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow-down"},S.a.createElement("path",{d:"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z"})),S.a.createElement("symbol",{viewBox:"0 0 24 24",id:"jump-to"},S.a.createElement("path",{d:"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"})),S.a.createElement("symbol",{viewBox:"0 0 24 24",id:"expand"},S.a.createElement("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})))))},Sn=n(194),Cn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.errSelectors,n=e.specSelectors,r=e.getComponent,o=r("SvgAssets"),i=r("InfoContainer",!0),a=r("VersionPragmaFilter"),s=r("operations",!0),u=r("Models",!0),c=r("Row"),l=r("Col"),p=r("errors",!0),f=r("ServersContainer",!0),h=r("SchemesContainer",!0),d=r("AuthorizeBtnContainer",!0),m=r("FilterContainer",!0),v=n.isSwagger2(),g=n.isOAS3(),y=!n.specStr(),b=n.loadingStatus(),_=null;if("loading"===b&&(_=S.a.createElement("div",{className:"info"},S.a.createElement("div",{className:"loading-container"},S.a.createElement("div",{className:"loading"})))),"failed"===b&&(_=S.a.createElement("div",{className:"info"},S.a.createElement("div",{className:"loading-container"},S.a.createElement("h4",{className:"title"},"Failed to load API definition."),S.a.createElement(p,null)))),"failedConfig"===b){var w=t.lastError(),x=w?w.get("message"):"";_=S.a.createElement("div",{className:"info",style:{maxWidth:"880px",marginLeft:"auto",marginRight:"auto",textAlign:"center"}},S.a.createElement("div",{className:"loading-container"},S.a.createElement("h4",{className:"title"},"Failed to load remote configuration."),S.a.createElement("p",null,x)))}if(!_&&y&&(_=S.a.createElement("h4",null,"No API definition provided.")),_)return S.a.createElement("div",{className:"swagger-ui"},S.a.createElement("div",{className:"loading-container"},_));var E=n.servers(),C=n.schemes(),k=E&&E.size,O=C&&C.size,A=!!n.securityDefinitions();return S.a.createElement("div",{className:"swagger-ui"},S.a.createElement(o,null),S.a.createElement(a,{isSwagger2:v,isOAS3:g,alsoShow:S.a.createElement(p,null)},S.a.createElement(p,null),S.a.createElement(c,{className:"information-container"},S.a.createElement(l,{mobile:12},S.a.createElement(i,null))),k||O||A?S.a.createElement("div",{className:"scheme-container"},S.a.createElement(l,{className:"schemes wrapper",mobile:12},k?S.a.createElement(f,null):null,O?S.a.createElement(h,null):null,A?S.a.createElement(d,null):null)):null,S.a.createElement(m,null),S.a.createElement(c,null,S.a.createElement(l,{mobile:12,desktop:12},S.a.createElement(s,null))),S.a.createElement(c,null,S.a.createElement(l,{mobile:12,desktop:12},S.a.createElement(u,null)))))}}]),t}(S.a.Component),kn=n(487),On=n.n(kn),An={value:"",onChange:function(){},schema:{},keyName:"",required:!1,errors:Object(k.List)()},Tn=function(e){function t(){return _()(this,t),oe()(this,ae()(t).apply(this,arguments))}return le()(t,e),x()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.dispatchInitialValue,n=e.value,r=e.onChange;t&&r(n)}},{key:"render",value:function(){var e=this.props,t=e.schema,n=e.errors,r=e.value,o=e.onChange,i=e.getComponent,a=e.fn,s=e.disabled;t.toJS&&(t=t.toJS());var u=t,c=u.type,l=u.format,p=void 0===l?"":l,f=i(p?"JsonSchema_".concat(c,"_").concat(p):"JsonSchema_".concat(c))||i("JsonSchema_string");return S.a.createElement(f,kt()({},this.props,{errors:n,fn:a,getComponent:i,value:r,onChange:o,schema:t,disabled:s}))}}]),t}(E.Component);v()(Tn,"defaultProps",An);var jn=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onChange",function(e){var t="file"===n.props.schema.type?e.target.files[0]:e.target.value;n.props.onChange(t,n.props.keyName)}),v()(ue()(n),"onEnumChange",function(e){return n.props.onChange(e)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.schema,o=e.errors,i=e.required,a=e.description,s=e.disabled,u=r.enum;if(o=o.toJS?o.toJS():[],u){var c=t("Select");return S.a.createElement(c,{className:o.length?"invalid":"",title:o.length?o:"",allowedValues:u,value:n,allowEmptyValue:!i,disabled:s,onChange:this.onEnumChange})}var l=s||"formData"===r.in&&!("FormData"in window),p=t("Input");return"file"===r.type?S.a.createElement(p,{type:"file",className:o.length?"invalid":"",title:o.length?o:"",onChange:this.onChange,disabled:l}):S.a.createElement(On.a,{type:"password"===r.format?"password":"text",className:o.length?"invalid":"",title:o.length?o:"",value:n,minLength:0,debounceTimeout:350,placeholder:a,onChange:this.onChange,disabled:l})}}]),t}(E.Component);v()(jn,"defaultProps",An);var Pn=function(e){function t(e,n){var r;return _()(this,t),r=oe()(this,ae()(t).call(this,e,n)),v()(ue()(r),"onChange",function(){return r.props.onChange(r.state.value)}),v()(ue()(r),"onItemChange",function(e,t){r.setState(function(n){return{value:n.value.set(t,e)}},r.onChange)}),v()(ue()(r),"removeItem",function(e){r.setState(function(t){return{value:t.value.remove(e)}},r.onChange)}),v()(ue()(r),"addItem",function(){r.setState(function(e){return e.value=Nn(e.value),{value:e.value.push("")}},r.onChange)}),v()(ue()(r),"onEnumChange",function(e){r.setState(function(){return{value:e}},r.onChange)}),r.state={value:Nn(e.value)},r}return le()(t,e),x()(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value})}},{key:"render",value:function(){var e=this,t=this.props,n=t.getComponent,r=t.required,o=t.schema,i=t.errors,a=t.fn,s=t.disabled;i=i.toJS?i.toJS():[];var u=a.inferSchema(o.items),c=n("JsonSchemaForm"),l=n("Button"),p=u.enum,f=this.state.value;if(p){var h=n("Select");return S.a.createElement(h,{className:i.length?"invalid":"",title:i.length?i:"",multiple:!0,value:f,disabled:s,allowedValues:p,allowEmptyValue:!r,onChange:this.onEnumChange})}return S.a.createElement("div",{className:"json-schema-array"},!f||!f.count||f.count()<1?null:f.map(function(t,r){var o=y()({},u);if(i.length){var p=i.filter(function(e){return e.index===r});p.length&&(i=[p[0].error+r])}return S.a.createElement("div",{key:r,className:"json-schema-form-item"},S.a.createElement(c,{fn:a,getComponent:n,value:t,onChange:function(t){return e.onItemChange(t,r)},schema:o,disabled:s}),s?null:S.a.createElement(l,{className:"btn btn-sm json-schema-form-item-remove",onClick:function(){return e.removeItem(r)}}," - "))}).toArray(),s?null:S.a.createElement(l,{className:"btn btn-sm json-schema-form-item-add ".concat(i.length?"invalid":null),onClick:this.addItem},"Add item"))}}]),t}(E.PureComponent);v()(Pn,"defaultProps",An);var In=function(e){function t(){var e,n;_()(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=oe()(this,(e=ae()(t)).call.apply(e,[this].concat(o))),v()(ue()(n),"onEnumChange",function(e){return n.props.onChange(e)}),n}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,o=e.schema,i=e.required,a=e.disabled;r=r.toJS?r.toJS():[];var s=t("Select");return S.a.createElement(s,{className:r.length?"invalid":"",title:r.length?r:"",value:String(n),disabled:a,allowedValues:Object(k.fromJS)(o.enum||["true","false"]),allowEmptyValue:!o.enum||!i,onChange:this.onEnumChange})}}]),t}(E.Component);v()(In,"defaultProps",An);var Mn=function(e){function t(){var e;return _()(this,t),e=oe()(this,ae()(t).call(this)),v()(ue()(e),"onChange",function(t){e.props.onChange(t)}),v()(ue()(e),"handleOnChange",function(t){var n=t.target.value;e.onChange(n)}),e}return le()(t,e),x()(t,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,o=e.disabled,i=t("TextArea");return S.a.createElement("div",null,S.a.createElement(i,{className:rt()({invalid:r.size}),title:r.size?r.join(", "):"",value:Object(D.I)(n),disabled:o,onChange:this.handleOnChange}))}}]),t}(E.PureComponent);function Nn(e){return k.List.isList(e)?e:Object(k.List)()}v()(Mn,"defaultProps",An);var Rn=function(){var e={components:{App:he,authorizationPopup:de,authorizeBtn:me,AuthorizeBtnContainer:ve,authorizeOperationBtn:ge,auths:ye,AuthItem:be,authError:_e,oauth2:Te,apiKeyAuth:we,basicAuth:xe,clear:je,liveResponse:Me,InitializedInput:Vt,info:Yt,InfoContainer:$t,JumpToPath:Gt,onlineValidatorBadge:De,operations:Fe,operation:ze,OperationSummary:We,OperationSummaryMethod:Je,OperationSummaryPath:Ke,highlightCode:et,responses:tt,response:ot,responseBody:ct,parameters:ft,parameterRow:vt,execute:gt,headers:bt,errors:_t,contentType:St,overview:Bt,footer:Zt,FilterContainer:Xt,ParamBody:en,curl:rn,schemes:on,SchemesContainer:an,modelExample:un,ModelWrapper:cn,ModelCollapse:sn,Model:ln.a,Models:pn,EnumModel:fn,ObjectModel:hn,ArrayModel:mn,PrimitiveModel:gn,Property:yn,TryItOutButton:bn,Markdown:Sn.a,BaseLayout:Cn,VersionPragmaFilter:_n,VersionStamp:wn,OperationExt:Ge,OperationExtRow:Ze,ParameterExt:ht,ParameterIncludeEmpty:dt,OperationTag:Be,OperationContainer:fe,DeepLink:xn,InfoUrl:Kt,InfoBasePath:Ht,SvgAssets:En,Example:Ee,ExamplesSelect:ke,ExamplesSelectValueRetainer:Ae}},t={components:r},n={components:o};return[Q.default,Z.default,Y.default,J.default,W.default,V.default,H.default,K.default,e,t,$.default,n,G.default,X.default,ee.default,te.default,ne.default]},Dn=n(306);function Ln(){return[Rn,Dn.default]}var Un=n(328);n.d(t,"default",function(){return Hn});var qn=!0,Fn="g3911391",Bn="3.25.0",zn="ip-172-31-21-173",Vn="Fri, 17 Jan 2020 21:38:59 GMT";function Hn(e){R.a.versions=R.a.versions||{},R.a.versions.swaggerUi={version:Bn,gitRevision:Fn,gitDirty:qn,buildTimestamp:Vn,machine:zn};var t={dom_id:null,domNode:null,spec:{},url:"",urls:null,layout:"BaseLayout",docExpansion:"list",maxDisplayedTags:null,filter:null,validatorUrl:"https://validator.swagger.io/validator",oauth2RedirectUrl:"".concat(window.location.protocol,"//").concat(window.location.host,"/oauth2-redirect.html"),configs:{},custom:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,requestInterceptor:function(e){return e},responseInterceptor:function(e){return e},showMutatedRequest:!0,defaultModelRendering:"example",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,showCommonExtensions:!1,withCredentials:void 0,supportedSubmitMethods:["get","put","post","delete","options","head","patch","trace"],presets:[Ln],plugins:[],initialState:{},fn:{},components:{}},n=Object(D.D)(),r=e.domNode;delete e.domNode;var o=f()({},t,e,n),i={system:{configs:o.configs},plugins:o.presets,state:f()({layout:{layout:o.layout,filter:o.filter},spec:{spec:"",url:o.url}},o.initialState)};if(o.initialState)for(var s in o.initialState)o.initialState.hasOwnProperty(s)&&void 0===o.initialState[s]&&delete i.state[s];var c=new U(i);c.register([o.plugins,function(){return{fn:o.fn,components:o.components,state:o.state}}]);var p=c.getSystem(),h=function(e){var t=p.specSelectors.getLocalConfig?p.specSelectors.getLocalConfig():{},i=f()({},t,o,e||{},n);if(r&&(i.domNode=r),c.setConfigs(i),p.configsActions.loaded(),null!==e&&(!n.url&&"object"===l()(i.spec)&&u()(i.spec).length?(p.specActions.updateUrl(""),p.specActions.updateLoadingStatus("success"),p.specActions.updateSpec(a()(i.spec))):p.specActions.download&&i.url&&!i.urls&&(p.specActions.updateUrl(i.url),p.specActions.download(i.url))),i.domNode)p.render(i.domNode,"App");else if(i.dom_id){var s=document.querySelector(i.dom_id);p.render(s,"App")}else null===i.dom_id||null===i.domNode||console.error("Skipped rendering: no `dom_id` or `domNode` was specified");return p},d=n.config||o.configUrl;return d&&p.specActions&&p.specActions.getConfigByUrl&&(!p.specActions.getConfigByUrl||p.specActions.getConfigByUrl({url:d,loadRemoteConfig:!0,requestInterceptor:o.requestInterceptor,responseInterceptor:o.responseInterceptor},h))?(p.specActions.getConfigByUrl(d,h),p):h()}Hn.presets={apis:Ln},Hn.plugins=Un.default}]).default}); +//# sourceMappingURL=swagger-ui-bundle.js.map \ No newline at end of file diff --git a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-standalone-preset.min.js b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-standalone-preset.min.js old mode 100644 new mode 100755 index cd5a1d0859910..66f7007f7478b --- a/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-standalone-preset.min.js +++ b/app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-standalone-preset.min.js @@ -1,13 +1,22 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e():t.SwaggerUIStandalonePreset=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist",e(e.s=275)}([function(t,e,n){"use strict";function r(t){var e={};return null!==t&&Object.keys(t).forEach(function(n){t[n].forEach(function(t){e[String(t)]=n})}),e}function i(t,e){if(e=e||{},Object.keys(e).forEach(function(e){if(-1===s.indexOf(e))throw new o('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=r(e.styleAliases||null),-1===a.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var o=n(33),s=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"];t.exports=i},function(t,e,n){var r=n(103)("wks"),i=n(70),o=n(4).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(4),i=n(13),o=n(14),s=n(22),a=n(40),u=function(t,e,n){var c,h,l,p,f=t&u.F,d=t&u.G,m=t&u.S,y=t&u.P,v=t&u.B,x=d?r:m?r[e]||(r[e]={}):(r[e]||{}).prototype,g=d?i:i[e]||(i[e]={}),D=g.prototype||(g.prototype={});d&&(n=e);for(c in n)h=!f&&x&&void 0!==x[c],l=(h?x:n)[c],p=v&&h?a(l,r):y&&"function"==typeof l?a(Function.call,l):l,x&&s(x,c,l,t&u.U),g[c]!=l&&o(g,c,p),y&&D[c]!=l&&(D[c]=l)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){var r=n(2),i=n(29),o=n(8),s=/"/g,a=function(t,e,n,r){var i=String(o(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(r).replace(s,""")+'"'),a+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(a),r(r.P+r.F*i(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",n)}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(58)("wks"),i=n(38),o=n(6).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){t.exports=!n(26)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(16),i=n(83),o=n(60),s=Object.defineProperty;e.f=n(9)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(21);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(42),i=n(102);t.exports=n(28)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";function r(t,e,n,r,o,s,a,u){if(i(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[n,r,o,s,a,u],l=0;c=new Error(e.replace(/%s/g,function(){return h[l++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var i=function(t){};t.exports=r},function(t,e,n){var r=n(19);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(6),i=n(5),o=n(81),s=n(18),a=function(t,e,n){var u,c,h,l=t&a.F,p=t&a.G,f=t&a.S,d=t&a.P,m=t&a.B,y=t&a.W,v=p?i:i[e]||(i[e]={}),x=v.prototype,g=p?r:f?r[e]:(r[e]||{}).prototype;p&&(n=e);for(u in n)(c=!l&&g&&void 0!==g[u])&&u in v||(h=c?g[u]:n[u],v[u]=p&&"function"!=typeof g[u]?n[u]:m&&c?o(h,r):y&&g[u]==h?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(h):d&&"function"==typeof h?o(Function.call,h):h,d&&((v.virtual||(v.virtual={}))[u]=h,t&a.R&&x&&!x[u]&&s(x,u,h)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,n){var r=n(11),i=n(37);t.exports=n(9)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(151),i=n(50);t.exports=function(t){return r(i(t))}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(4),i=n(14),o=n(30),s=n(70)("src"),a=Function.toString,u=(""+a).split("toString");n(13).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(c&&(o(n,s)||i(n,s,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||a.call(this)})},function(t,e,n){"use strict";function r(t){return void 0===t||null===t}function i(t){return"object"==typeof t&&null!==t}function o(t){return Array.isArray(t)?t:r(t)?[]:[t]}function s(t,e){var n,r,i,o;if(e)for(o=Object.keys(e),n=0,r=o.length;n<r;n+=1)i=o[n],t[i]=e[i];return t}function a(t,e){var n,r="";for(n=0;n<e;n+=1)r+=t;return r}function u(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t}t.exports.isNothing=r,t.exports.isObject=i,t.exports.toArray=o,t.exports.repeat=a,t.exports.isNegativeZero=u,t.exports.extend=s},function(t,e,n){"use strict";function r(t,e,n){var i=[];return t.include.forEach(function(t){n=r(t,e,n)}),t[e].forEach(function(t){n.forEach(function(e,n){e.tag===t.tag&&e.kind===t.kind&&i.push(n)}),n.push(t)}),n.filter(function(t,e){return-1===i.indexOf(e)})}function i(){function t(t){r[t.kind][t.tag]=r.fallback[t.tag]=t}var e,n,r={scalar:{},sequence:{},mapping:{},fallback:{}};for(e=0,n=arguments.length;e<n;e+=1)arguments[e].forEach(t);return r}function o(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&"scalar"!==t.loadKind)throw new a("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=r(this,"implicit",[]),this.compiledExplicit=r(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var s=n(23),a=n(33),u=n(0);o.DEFAULT=null,o.create=function(){var t,e;switch(arguments.length){case 1:t=o.DEFAULT,e=arguments[0];break;case 2:t=arguments[0],e=arguments[1];break;default:throw new a("Wrong number of arguments for Schema.create function")}if(t=s.toArray(t),e=s.toArray(e),!t.every(function(t){return t instanceof o}))throw new a("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!e.every(function(t){return t instanceof u}))throw new a("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new o({include:t,explicit:e})},t.exports=o},function(t,e,n){"use strict";function r(t){return void 0!==t.ref}function i(t){return void 0!==t.key}var o=n(35),s=n(115),a=(n(46),n(118),Object.prototype.hasOwnProperty),u=n(116),c={key:!0,ref:!0,__self:!0,__source:!0},h=function(t,e,n,r,i,o,s){var a={$$typeof:u,type:t,key:e,ref:n,props:s,_owner:o};return a};h.createElement=function(t,e,n){var o,u={},l=null,p=null;if(null!=e){r(e)&&(p=e.ref),i(e)&&(l=""+e.key),void 0===e.__self?null:e.__self,void 0===e.__source?null:e.__source;for(o in e)a.call(e,o)&&!c.hasOwnProperty(o)&&(u[o]=e[o])}var f=arguments.length-2;if(1===f)u.children=n;else if(f>1){for(var d=Array(f),m=0;m<f;m++)d[m]=arguments[m+2];u.children=d}if(t&&t.defaultProps){var y=t.defaultProps;for(o in y)void 0===u[o]&&(u[o]=y[o])}return h(t,l,p,0,0,s.current,u)},h.createFactory=function(t){var e=h.createElement.bind(null,t);return e.type=t,e},h.cloneAndReplaceKey=function(t,e){return h(t.type,e,t.ref,t._self,t._source,t._owner,t.props)},h.cloneElement=function(t,e,n){var u,l=o({},t.props),p=t.key,f=t.ref,d=(t._self,t._source,t._owner);if(null!=e){r(e)&&(f=e.ref,d=s.current),i(e)&&(p=""+e.key);var m;t.type&&t.type.defaultProps&&(m=t.type.defaultProps);for(u in e)a.call(e,u)&&!c.hasOwnProperty(u)&&(void 0===e[u]&&void 0!==m?l[u]=m[u]:l[u]=e[u])}var y=arguments.length-2;if(1===y)l.children=n;else if(y>1){for(var v=Array(y),x=0;x<y;x++)v[x]=arguments[x+2];l.children=v}return h(t.type,p,f,0,0,d,l)},h.isValidElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===u},t.exports=h},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){t.exports=!n(29)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){t.exports={}},function(t,e,n){var r=n(43),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){"use strict";function r(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(t){var e=this.name+": ";return e+=this.reason||"(unknown reason)",!t&&this.mark&&(e+=" "+this.mark.toString()),e},t.exports=r},function(t,e,n){"use strict";var r=n(24);t.exports=new r({include:[n(110)],implicit:[n(255),n(248)],explicit:[n(240),n(250),n(251),n(253)]})},function(t,e,n){"use strict";function r(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}/* +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(function(){try{return require("esprima")}catch(t){}}()):"function"==typeof define&&define.amd?define(["esprima"],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e(function(){try{return require("esprima")}catch(t){}}()):t.SwaggerUIStandalonePreset=e(t.esprima)}(window,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist",n(n.s=183)}([function(t,e,n){t.exports=function(){"use strict";var t=Array.prototype.slice;function e(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function n(t){return u(t)?t:q(t)}function r(t){return s(t)?t:J(t)}function i(t){return a(t)?t:Z(t)}function o(t){return u(t)&&!c(t)?t:V(t)}function u(t){return!(!t||!t[l])}function s(t){return!(!t||!t[h])}function a(t){return!(!t||!t[p])}function c(t){return s(t)||a(t)}function f(t){return!(!t||!t[d])}e(r,n),e(i,n),e(o,n),n.isIterable=u,n.isKeyed=s,n.isIndexed=a,n.isAssociative=c,n.isOrdered=f,n.Keyed=r,n.Indexed=i,n.Set=o;var l="@@__IMMUTABLE_ITERABLE__@@",h="@@__IMMUTABLE_KEYED__@@",p="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",y=5,w=1<<y,v=w-1,g={},M={value:!1},_={value:!1};function m(t){return t.value=!1,t}function L(t){t&&(t.value=!0)}function b(){}function j(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;i<n;i++)r[i]=t[i+e];return r}function x(t){return void 0===t.size&&(t.size=t.__iterate(S)),t.size}function N(t,e){if("number"!=typeof e){var n=e>>>0;if(""+n!==e||4294967295===n)return NaN;e=n}return e<0?x(t)+e:e}function S(){return!0}function D(t,e,n){return(0===t||void 0!==n&&t<=-n)&&(void 0===e||void 0!==n&&e>=n)}function I(t,e){return C(t,e,0)}function E(t,e){return C(t,e,e)}function C(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}var T=0,A=1,O=2,z="function"==typeof Symbol&&Symbol.iterator,k="@@iterator",Y=z||k;function U(t){this.next=t}function P(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function R(){return{value:void 0,done:!0}}function Q(t){return!!G(t)}function F(t){return t&&"function"==typeof t.next}function B(t){var e=G(t);return e&&e.call(t)}function G(t){var e=t&&(z&&t[z]||t[k]);if("function"==typeof e)return e}function W(t){return t&&"number"==typeof t.length}function q(t){return null==t?ot():u(t)?t.toSeq():function(t){var e=at(t)||"object"==typeof t&&new et(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}(t)}function J(t){return null==t?ot().toKeyedSeq():u(t)?s(t)?t.toSeq():t.fromEntrySeq():ut(t)}function Z(t){return null==t?ot():u(t)?s(t)?t.entrySeq():t.toIndexedSeq():st(t)}function V(t){return(null==t?ot():u(t)?s(t)?t.entrySeq():t:st(t)).toSetSeq()}U.prototype.toString=function(){return"[Iterator]"},U.KEYS=T,U.VALUES=A,U.ENTRIES=O,U.prototype.inspect=U.prototype.toSource=function(){return this.toString()},U.prototype[Y]=function(){return this},e(q,n),q.of=function(){return q(arguments)},q.prototype.toSeq=function(){return this},q.prototype.toString=function(){return this.__toString("Seq {","}")},q.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},q.prototype.__iterate=function(t,e){return ct(this,t,e,!0)},q.prototype.__iterator=function(t,e){return ft(this,t,e,!0)},e(J,q),J.prototype.toKeyedSeq=function(){return this},e(Z,q),Z.of=function(){return Z(arguments)},Z.prototype.toIndexedSeq=function(){return this},Z.prototype.toString=function(){return this.__toString("Seq [","]")},Z.prototype.__iterate=function(t,e){return ct(this,t,e,!1)},Z.prototype.__iterator=function(t,e){return ft(this,t,e,!1)},e(V,q),V.of=function(){return V(arguments)},V.prototype.toSetSeq=function(){return this},q.isSeq=it,q.Keyed=J,q.Set=V,q.Indexed=Z;var X,H,K,$="@@__IMMUTABLE_SEQ__@@";function tt(t){this._array=t,this.size=t.length}function et(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function nt(t){this._iterable=t,this.size=t.length||t.size}function rt(t){this._iterator=t,this._iteratorCache=[]}function it(t){return!(!t||!t[$])}function ot(){return X||(X=new tt([]))}function ut(t){var e=Array.isArray(t)?new tt(t).fromEntrySeq():F(t)?new rt(t).fromEntrySeq():Q(t)?new nt(t).fromEntrySeq():"object"==typeof t?new et(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function st(t){var e=at(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function at(t){return W(t)?new tt(t):F(t)?new rt(t):Q(t)?new nt(t):void 0}function ct(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,u=0;u<=o;u++){var s=i[n?o-u:u];if(!1===e(s[1],r?s[0]:u,t))return u+1}return u}return t.__iterateUncached(e,n)}function ft(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,u=0;return new U(function(){var t=i[n?o-u:u];return u++>o?{value:void 0,done:!0}:P(e,r?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,n)}function lt(t,e){return e?function t(e,n,r,i){return Array.isArray(n)?e.call(i,r,Z(n).map(function(r,i){return t(e,r,i,n)})):pt(n)?e.call(i,r,J(n).map(function(r,i){return t(e,r,i,n)})):n}(e,t,"",{"":t}):ht(t)}function ht(t){return Array.isArray(t)?Z(t).map(ht).toList():pt(t)?J(t).map(ht).toMap():t}function pt(t){return t&&(t.constructor===Object||void 0===t.constructor)}function dt(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function yt(t,e){if(t===e)return!0;if(!u(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||s(t)!==s(e)||a(t)!==a(e)||f(t)!==f(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!c(t);if(f(t)){var r=t.entries();return e.every(function(t,e){var i=r.next().value;return i&&dt(i[1],t)&&(n||dt(i[0],e))})&&r.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var l=!0,h=e.__iterate(function(e,r){if(n?!t.has(e):i?!dt(e,t.get(r,g)):!dt(t.get(r,g),e))return l=!1,!1});return l&&t.size===h}function wt(t,e){if(!(this instanceof wt))return new wt(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(H)return H;H=this}}function vt(t,e){if(!t)throw new Error(e)}function gt(t,e,n){if(!(this instanceof gt))return new gt(t,e,n);if(vt(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),n=void 0===n?1:Math.abs(n),e<t&&(n=-n),this._start=t,this._end=e,this._step=n,this.size=Math.max(0,Math.ceil((e-t)/n-1)+1),0===this.size){if(K)return K;K=this}}function Mt(){throw TypeError("Abstract")}function _t(){}function mt(){}function Lt(){}q.prototype[$]=!0,e(tt,Z),tt.prototype.get=function(t,e){return this.has(t)?this._array[N(this,t)]:e},tt.prototype.__iterate=function(t,e){for(var n=this._array,r=n.length-1,i=0;i<=r;i++)if(!1===t(n[e?r-i:i],i,this))return i+1;return i},tt.prototype.__iterator=function(t,e){var n=this._array,r=n.length-1,i=0;return new U(function(){return i>r?{value:void 0,done:!0}:P(t,i,n[e?r-i++:i++])})},e(et,J),et.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},et.prototype.has=function(t){return this._object.hasOwnProperty(t)},et.prototype.__iterate=function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var u=r[e?i-o:o];if(!1===t(n[u],u,this))return o+1}return o},et.prototype.__iterator=function(t,e){var n=this._object,r=this._keys,i=r.length-1,o=0;return new U(function(){var u=r[e?i-o:o];return o++>i?{value:void 0,done:!0}:P(t,u,n[u])})},et.prototype[d]=!0,e(nt,Z),nt.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var n=B(this._iterable),r=0;if(F(n))for(var i;!(i=n.next()).done&&!1!==t(i.value,r++,this););return r},nt.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=B(this._iterable);if(!F(n))return new U(R);var r=0;return new U(function(){var e=n.next();return e.done?e:P(t,r++,e.value)})},e(rt,Z),rt.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var n,r=this._iterator,i=this._iteratorCache,o=0;o<i.length;)if(!1===t(i[o],o++,this))return o;for(;!(n=r.next()).done;){var u=n.value;if(i[o]=u,!1===t(u,o++,this))break}return o},rt.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterator,r=this._iteratorCache,i=0;return new U(function(){if(i>=r.length){var e=n.next();if(e.done)return e;r[i]=e.value}return P(t,i,r[i++])})},e(wt,Z),wt.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},wt.prototype.get=function(t,e){return this.has(t)?this._value:e},wt.prototype.includes=function(t){return dt(this._value,t)},wt.prototype.slice=function(t,e){var n=this.size;return D(t,e,n)?this:new wt(this._value,E(e,n)-I(t,n))},wt.prototype.reverse=function(){return this},wt.prototype.indexOf=function(t){return dt(this._value,t)?0:-1},wt.prototype.lastIndexOf=function(t){return dt(this._value,t)?this.size:-1},wt.prototype.__iterate=function(t,e){for(var n=0;n<this.size;n++)if(!1===t(this._value,n,this))return n+1;return n},wt.prototype.__iterator=function(t,e){var n=this,r=0;return new U(function(){return r<n.size?P(t,r++,n._value):{value:void 0,done:!0}})},wt.prototype.equals=function(t){return t instanceof wt?dt(this._value,t._value):yt(t)},e(gt,Z),gt.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},gt.prototype.get=function(t,e){return this.has(t)?this._start+N(this,t)*this._step:e},gt.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},gt.prototype.slice=function(t,e){return D(t,e,this.size)?this:(t=I(t,this.size),(e=E(e,this.size))<=t?new gt(0,0):new gt(this.get(t,this._end),this.get(e,this._end),this._step))},gt.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var n=e/this._step;if(n>=0&&n<this.size)return n}return-1},gt.prototype.lastIndexOf=function(t){return this.indexOf(t)},gt.prototype.__iterate=function(t,e){for(var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;o<=n;o++){if(!1===t(i,o,this))return o+1;i+=e?-r:r}return o},gt.prototype.__iterator=function(t,e){var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;return new U(function(){var u=i;return i+=e?-r:r,o>n?{value:void 0,done:!0}:P(t,o++,u)})},gt.prototype.equals=function(t){return t instanceof gt?this._start===t._start&&this._end===t._end&&this._step===t._step:yt(this,t)},e(Mt,n),e(_t,Mt),e(mt,Mt),e(Lt,Mt),Mt.Keyed=_t,Mt.Indexed=mt,Mt.Set=Lt;var bt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var n=65535&(t|=0),r=65535&(e|=0);return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0};function jt(t){return t>>>1&1073741824|3221225471&t}function xt(t){if(!1===t||null==t)return 0;if("function"==typeof t.valueOf&&(!1===(t=t.valueOf())||null==t))return 0;if(!0===t)return 1;var e=typeof t;if("number"===e){if(t!=t||t===1/0)return 0;var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)n^=t/=4294967295;return jt(n)}if("string"===e)return t.length>At?function(t){var e=kt[t];return void 0===e&&(e=Nt(t),zt===Ot&&(zt=0,kt={}),zt++,kt[t]=e),e}(t):Nt(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"===e)return function(t){var e;if(Et&&void 0!==(e=St.get(t)))return e;if(void 0!==(e=t[Tt]))return e;if(!It){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Tt]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=++Ct,1073741824&Ct&&(Ct=0),Et)St.set(t,e);else{if(void 0!==Dt&&!1===Dt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(It)Object.defineProperty(t,Tt,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Tt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Tt]=e}}return e}(t);if("function"==typeof t.toString)return Nt(t.toString());throw new Error("Value type "+e+" cannot be hashed.")}function Nt(t){for(var e=0,n=0;n<t.length;n++)e=31*e+t.charCodeAt(n)|0;return jt(e)}var St,Dt=Object.isExtensible,It=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),Et="function"==typeof WeakMap;Et&&(St=new WeakMap);var Ct=0,Tt="__immutablehash__";"function"==typeof Symbol&&(Tt=Symbol(Tt));var At=16,Ot=255,zt=0,kt={};function Yt(t){vt(t!==1/0,"Cannot perform this action with an infinite size.")}function Ut(t){return null==t?Kt():Pt(t)&&!f(t)?t:Kt().withMutations(function(e){var n=r(t);Yt(n.size),n.forEach(function(t,n){return e.set(n,t)})})}function Pt(t){return!(!t||!t[Qt])}e(Ut,_t),Ut.of=function(){var e=t.call(arguments,0);return Kt().withMutations(function(t){for(var n=0;n<e.length;n+=2){if(n+1>=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},Ut.prototype.toString=function(){return this.__toString("Map {","}")},Ut.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Ut.prototype.set=function(t,e){return $t(this,t,e)},Ut.prototype.setIn=function(t,e){return this.updateIn(t,g,function(){return e})},Ut.prototype.remove=function(t){return $t(this,t,g)},Ut.prototype.deleteIn=function(t){return this.updateIn(t,function(){return g})},Ut.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},Ut.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=function t(e,n,r,i){var o=e===g,u=n.next();if(u.done){var s=o?r:e,a=i(s);return a===s?e:a}vt(o||e&&e.set,"invalid keyPath");var c=u.value,f=o?g:e.get(c,g),l=t(f,n,r,i);return l===f?e:l===g?e.remove(c):(o?Kt():e).set(c,l)}(this,rn(t),e,n);return r===g?void 0:r},Ut.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Kt()},Ut.prototype.merge=function(){return re(this,void 0,arguments)},Ut.prototype.mergeWith=function(e){var n=t.call(arguments,1);return re(this,e,n)},Ut.prototype.mergeIn=function(e){var n=t.call(arguments,1);return this.updateIn(e,Kt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,n):n[n.length-1]})},Ut.prototype.mergeDeep=function(){return re(this,ie,arguments)},Ut.prototype.mergeDeepWith=function(e){var n=t.call(arguments,1);return re(this,oe(e),n)},Ut.prototype.mergeDeepIn=function(e){var n=t.call(arguments,1);return this.updateIn(e,Kt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,n):n[n.length-1]})},Ut.prototype.sort=function(t){return Ie(qe(this,t))},Ut.prototype.sortBy=function(t,e){return Ie(qe(this,e,t))},Ut.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Ut.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new b)},Ut.prototype.asImmutable=function(){return this.__ensureOwner()},Ut.prototype.wasAltered=function(){return this.__altered},Ut.prototype.__iterator=function(t,e){return new Zt(this,t,e)},Ut.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},Ut.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ht(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ut.isMap=Pt;var Rt,Qt="@@__IMMUTABLE_MAP__@@",Ft=Ut.prototype;function Bt(t,e){this.ownerID=t,this.entries=e}function Gt(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n}function Wt(t,e,n){this.ownerID=t,this.count=e,this.nodes=n}function qt(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n}function Jt(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n}function Zt(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&Xt(t._root)}function Vt(t,e){return P(t,e[0],e[1])}function Xt(t,e){return{node:t,index:0,__prev:e}}function Ht(t,e,n,r){var i=Object.create(Ft);return i.size=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Kt(){return Rt||(Rt=Ht(0))}function $t(t,e,n){var r,i;if(t._root){var o=m(M),u=m(_);if(r=te(t._root,t.__ownerID,0,void 0,e,n,o,u),!u.value)return t;i=t.size+(o.value?n===g?-1:1:0)}else{if(n===g)return t;i=1,r=new Bt(t.__ownerID,[[e,n]])}return t.__ownerID?(t.size=i,t._root=r,t.__hash=void 0,t.__altered=!0,t):r?Ht(i,r):Kt()}function te(t,e,n,r,i,o,u,s){return t?t.update(e,n,r,i,o,u,s):o===g?t:(L(s),L(u),new Jt(e,r,[i,o]))}function ee(t){return t.constructor===Jt||t.constructor===qt}function ne(t,e,n,r,i){if(t.keyHash===r)return new qt(e,r,[t.entry,i]);var o,u=(0===n?t.keyHash:t.keyHash>>>n)&v,s=(0===n?r:r>>>n)&v;return new Gt(e,1<<u|1<<s,u===s?[ne(t,e,n+y,r,i)]:(o=new Jt(e,r,i),u<s?[t,o]:[o,t]))}function re(t,e,n){for(var i=[],o=0;o<n.length;o++){var s=n[o],a=r(s);u(s)||(a=a.map(function(t){return lt(t)})),i.push(a)}return ue(t,e,i)}function ie(t,e,n){return t&&t.mergeDeep&&u(e)?t.mergeDeep(e):dt(t,e)?t:e}function oe(t){return function(e,n,r){if(e&&e.mergeDeepWith&&u(n))return e.mergeDeepWith(t,n);var i=t(e,n,r);return dt(e,i)?e:i}}function ue(t,e,n){return 0===(n=n.filter(function(t){return 0!==t.size})).length?t:0!==t.size||t.__ownerID||1!==n.length?t.withMutations(function(t){for(var r=e?function(n,r){t.update(r,g,function(t){return t===g?n:e(t,n,r)})}:function(e,n){t.set(n,e)},i=0;i<n.length;i++)n[i].forEach(r)}):t.constructor(n[0])}function se(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function ae(t,e,n,r){var i=r?t:j(t);return i[e]=n,i}Ft[Qt]=!0,Ft.delete=Ft.remove,Ft.removeIn=Ft.deleteIn,Bt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(dt(n,i[o][0]))return i[o][1];return r},Bt.prototype.update=function(t,e,n,r,i,o,u){for(var s=i===g,a=this.entries,c=0,f=a.length;c<f&&!dt(r,a[c][0]);c++);var l=c<f;if(l?a[c][1]===i:s)return this;if(L(u),(s||!l)&&L(o),!s||1!==a.length){if(!l&&!s&&a.length>=ce)return function(t,e,n,r){t||(t=new b);for(var i=new Jt(t,xt(n),[n,r]),o=0;o<e.length;o++){var u=e[o];i=i.update(t,0,void 0,u[0],u[1])}return i}(t,a,r,i);var h=t&&t===this.ownerID,p=h?a:j(a);return l?s?c===f-1?p.pop():p[c]=p.pop():p[c]=[r,i]:p.push([r,i]),h?(this.entries=p,this):new Bt(t,p)}},Gt.prototype.get=function(t,e,n,r){void 0===e&&(e=xt(n));var i=1<<((0===t?e:e>>>t)&v),o=this.bitmap;return 0==(o&i)?r:this.nodes[se(o&i-1)].get(t+y,e,n,r)},Gt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=xt(r));var s=(0===e?n:n>>>e)&v,a=1<<s,c=this.bitmap,f=0!=(c&a);if(!f&&i===g)return this;var l=se(c&a-1),h=this.nodes,p=f?h[l]:void 0,d=te(p,t,e+y,n,r,i,o,u);if(d===p)return this;if(!f&&d&&h.length>=fe)return function(t,e,n,r,i){for(var o=0,u=new Array(w),s=0;0!==n;s++,n>>>=1)u[s]=1&n?e[o++]:void 0;return u[r]=i,new Wt(t,o+1,u)}(t,h,c,s,d);if(f&&!d&&2===h.length&&ee(h[1^l]))return h[1^l];if(f&&d&&1===h.length&&ee(d))return d;var M=t&&t===this.ownerID,_=f?d?c:c^a:c|a,m=f?d?ae(h,l,d,M):function(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var i=new Array(r),o=0,u=0;u<r;u++)u===e&&(o=1),i[u]=t[u+o];return i}(h,l,M):function(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var o=new Array(i),u=0,s=0;s<i;s++)s===e?(o[s]=n,u=-1):o[s]=t[s+u];return o}(h,l,d,M);return M?(this.bitmap=_,this.nodes=m,this):new Gt(t,_,m)},Wt.prototype.get=function(t,e,n,r){void 0===e&&(e=xt(n));var i=(0===t?e:e>>>t)&v,o=this.nodes[i];return o?o.get(t+y,e,n,r):r},Wt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=xt(r));var s=(0===e?n:n>>>e)&v,a=i===g,c=this.nodes,f=c[s];if(a&&!f)return this;var l=te(f,t,e+y,n,r,i,o,u);if(l===f)return this;var h=this.count;if(f){if(!l&&--h<le)return function(t,e,n,r){for(var i=0,o=0,u=new Array(n),s=0,a=1,c=e.length;s<c;s++,a<<=1){var f=e[s];void 0!==f&&s!==r&&(i|=a,u[o++]=f)}return new Gt(t,i,u)}(t,c,h,s)}else h++;var p=t&&t===this.ownerID,d=ae(c,s,l,p);return p?(this.count=h,this.nodes=d,this):new Wt(t,h,d)},qt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(dt(n,i[o][0]))return i[o][1];return r},qt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=xt(r));var s=i===g;if(n!==this.keyHash)return s?this:(L(u),L(o),ne(this,t,e,n,[r,i]));for(var a=this.entries,c=0,f=a.length;c<f&&!dt(r,a[c][0]);c++);var l=c<f;if(l?a[c][1]===i:s)return this;if(L(u),(s||!l)&&L(o),s&&2===f)return new Jt(t,this.keyHash,a[1^c]);var h=t&&t===this.ownerID,p=h?a:j(a);return l?s?c===f-1?p.pop():p[c]=p.pop():p[c]=[r,i]:p.push([r,i]),h?(this.entries=p,this):new qt(t,this.keyHash,p)},Jt.prototype.get=function(t,e,n,r){return dt(n,this.entry[0])?this.entry[1]:r},Jt.prototype.update=function(t,e,n,r,i,o,u){var s=i===g,a=dt(r,this.entry[0]);return(a?i===this.entry[1]:s)?this:(L(u),s?void L(o):a?t&&t===this.ownerID?(this.entry[1]=i,this):new Jt(t,this.keyHash,[r,i]):(L(o),ne(this,t,e,xt(r),[r,i])))},Bt.prototype.iterate=qt.prototype.iterate=function(t,e){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(!1===t(n[e?i-r:r]))return!1},Gt.prototype.iterate=Wt.prototype.iterate=function(t,e){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[e?i-r:r];if(o&&!1===o.iterate(t,e))return!1}},Jt.prototype.iterate=function(t,e){return t(this.entry)},e(Zt,U),Zt.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return Vt(t,r.entry)}else if(r.entries){if(i<=(n=r.entries.length-1))return Vt(t,r.entries[this._reverse?n-i:i])}else if(i<=(n=r.nodes.length-1)){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return Vt(t,o.entry);e=this._stack=Xt(o,e)}continue}e=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var ce=w/4,fe=w/2,le=w/4;function he(t){var e=Le();if(null==t)return e;if(pe(t))return t;var n=i(t),r=n.size;return 0===r?e:(Yt(r),r>0&&r<w?me(0,r,y,null,new we(n.toArray())):e.withMutations(function(t){t.setSize(r),n.forEach(function(e,n){return t.set(n,e)})}))}function pe(t){return!(!t||!t[de])}e(he,mt),he.of=function(){return this(arguments)},he.prototype.toString=function(){return this.__toString("List [","]")},he.prototype.get=function(t,e){if((t=N(this,t))>=0&&t<this.size){var n=xe(this,t+=this._origin);return n&&n.array[t&v]}return e},he.prototype.set=function(t,e){return function(t,e,n){if((e=N(t,e))!=e)return t;if(e>=t.size||e<0)return t.withMutations(function(t){e<0?Ne(t,e).set(0,n):Ne(t,0,e+1).set(e,n)});e+=t._origin;var r=t._tail,i=t._root,o=m(_);return e>=De(t._capacity)?r=be(r,t.__ownerID,0,e,n,o):i=be(i,t.__ownerID,t._level,e,n,o),o.value?t.__ownerID?(t._root=i,t._tail=r,t.__hash=void 0,t.__altered=!0,t):me(t._origin,t._capacity,t._level,i,r):t}(this,t,e)},he.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},he.prototype.insert=function(t,e){return this.splice(t,0,e)},he.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=y,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Le()},he.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(n){Ne(n,0,e+t.length);for(var r=0;r<t.length;r++)n.set(e+r,t[r])})},he.prototype.pop=function(){return Ne(this,0,-1)},he.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){Ne(e,-t.length);for(var n=0;n<t.length;n++)e.set(n,t[n])})},he.prototype.shift=function(){return Ne(this,1)},he.prototype.merge=function(){return Se(this,void 0,arguments)},he.prototype.mergeWith=function(e){var n=t.call(arguments,1);return Se(this,e,n)},he.prototype.mergeDeep=function(){return Se(this,ie,arguments)},he.prototype.mergeDeepWith=function(e){var n=t.call(arguments,1);return Se(this,oe(e),n)},he.prototype.setSize=function(t){return Ne(this,0,t)},he.prototype.slice=function(t,e){var n=this.size;return D(t,e,n)?this:Ne(this,I(t,n),E(e,n))},he.prototype.__iterator=function(t,e){var n=0,r=_e(this,e);return new U(function(){var e=r();return e===Me?{value:void 0,done:!0}:P(t,n++,e)})},he.prototype.__iterate=function(t,e){for(var n,r=0,i=_e(this,e);(n=i())!==Me&&!1!==t(n,r++,this););return r},he.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?me(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},he.isList=pe;var de="@@__IMMUTABLE_LIST__@@",ye=he.prototype;function we(t,e){this.array=t,this.ownerID=e}ye[de]=!0,ye.delete=ye.remove,ye.setIn=Ft.setIn,ye.deleteIn=ye.removeIn=Ft.removeIn,ye.update=Ft.update,ye.updateIn=Ft.updateIn,ye.mergeIn=Ft.mergeIn,ye.mergeDeepIn=Ft.mergeDeepIn,ye.withMutations=Ft.withMutations,ye.asMutable=Ft.asMutable,ye.asImmutable=Ft.asImmutable,ye.wasAltered=Ft.wasAltered,we.prototype.removeBefore=function(t,e,n){if(n===e?1<<e:0===this.array.length)return this;var r=n>>>e&v;if(r>=this.array.length)return new we([],t);var i,o=0===r;if(e>0){var u=this.array[r];if((i=u&&u.removeBefore(t,e-y,n))===u&&o)return this}if(o&&!i)return this;var s=je(this,t);if(!o)for(var a=0;a<r;a++)s.array[a]=void 0;return i&&(s.array[r]=i),s},we.prototype.removeAfter=function(t,e,n){if(n===(e?1<<e:0)||0===this.array.length)return this;var r,i=n-1>>>e&v;if(i>=this.array.length)return this;if(e>0){var o=this.array[i];if((r=o&&o.removeAfter(t,e-y,n))===o&&i===this.array.length-1)return this}var u=je(this,t);return u.array.splice(i+1),r&&(u.array[i]=r),u};var ve,ge,Me={};function _e(t,e){var n=t._origin,r=t._capacity,i=De(r),o=t._tail;return u(t._root,t._level,0);function u(t,s,a){return 0===s?function(t,u){var s=u===i?o&&o.array:t&&t.array,a=u>n?0:n-u,c=r-u;return c>w&&(c=w),function(){if(a===c)return Me;var t=e?--c:a++;return s&&s[t]}}(t,a):function(t,i,o){var s,a=t&&t.array,c=o>n?0:n-o>>i,f=1+(r-o>>i);return f>w&&(f=w),function(){for(;;){if(s){var t=s();if(t!==Me)return t;s=null}if(c===f)return Me;var n=e?--f:c++;s=u(a&&a[n],i-y,o+(n<<i))}}}(t,s,a)}}function me(t,e,n,r,i,o,u){var s=Object.create(ye);return s.size=e-t,s._origin=t,s._capacity=e,s._level=n,s._root=r,s._tail=i,s.__ownerID=o,s.__hash=u,s.__altered=!1,s}function Le(){return ve||(ve=me(0,0,y))}function be(t,e,n,r,i,o){var u,s=r>>>n&v,a=t&&s<t.array.length;if(!a&&void 0===i)return t;if(n>0){var c=t&&t.array[s],f=be(c,e,n-y,r,i,o);return f===c?t:((u=je(t,e)).array[s]=f,u)}return a&&t.array[s]===i?t:(L(o),u=je(t,e),void 0===i&&s===u.array.length-1?u.array.pop():u.array[s]=i,u)}function je(t,e){return e&&t&&e===t.ownerID?t:new we(t?t.array.slice():[],e)}function xe(t,e){if(e>=De(t._capacity))return t._tail;if(e<1<<t._level+y){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&v],r-=y;return n}}function Ne(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var r=t.__ownerID||new b,i=t._origin,o=t._capacity,u=i+e,s=void 0===n?o:n<0?o+n:i+n;if(u===i&&s===o)return t;if(u>=s)return t.clear();for(var a=t._level,c=t._root,f=0;u+f<0;)c=new we(c&&c.array.length?[void 0,c]:[],r),f+=1<<(a+=y);f&&(u+=f,i+=f,s+=f,o+=f);for(var l=De(o),h=De(s);h>=1<<a+y;)c=new we(c&&c.array.length?[c]:[],r),a+=y;var p=t._tail,d=h<l?xe(t,s-1):h>l?new we([],r):p;if(p&&h>l&&u<o&&p.array.length){for(var w=c=je(c,r),g=a;g>y;g-=y){var M=l>>>g&v;w=w.array[M]=je(w.array[M],r)}w.array[l>>>y&v]=p}if(s<o&&(d=d&&d.removeAfter(r,0,s)),u>=h)u-=h,s-=h,a=y,c=null,d=d&&d.removeBefore(r,0,u);else if(u>i||h<l){for(f=0;c;){var _=u>>>a&v;if(_!==h>>>a&v)break;_&&(f+=(1<<a)*_),a-=y,c=c.array[_]}c&&u>i&&(c=c.removeBefore(r,a,u-f)),c&&h<l&&(c=c.removeAfter(r,a,h-f)),f&&(u-=f,s-=f)}return t.__ownerID?(t.size=s-u,t._origin=u,t._capacity=s,t._level=a,t._root=c,t._tail=d,t.__hash=void 0,t.__altered=!0,t):me(u,s,a,c,d)}function Se(t,e,n){for(var r=[],o=0,s=0;s<n.length;s++){var a=n[s],c=i(a);c.size>o&&(o=c.size),u(a)||(c=c.map(function(t){return lt(t)})),r.push(c)}return o>t.size&&(t=t.setSize(o)),ue(t,e,r)}function De(t){return t<w?0:t-1>>>y<<y}function Ie(t){return null==t?Te():Ee(t)?t:Te().withMutations(function(e){var n=r(t);Yt(n.size),n.forEach(function(t,n){return e.set(n,t)})})}function Ee(t){return Pt(t)&&f(t)}function Ce(t,e,n,r){var i=Object.create(Ie.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=n,i.__hash=r,i}function Te(){return ge||(ge=Ce(Kt(),Le()))}function Ae(t,e,n){var r,i,o=t._map,u=t._list,s=o.get(e),a=void 0!==s;if(n===g){if(!a)return t;u.size>=w&&u.size>=2*o.size?(r=(i=u.filter(function(t,e){return void 0!==t&&s!==e})).toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(r.__ownerID=i.__ownerID=t.__ownerID)):(r=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(n===u.get(s)[1])return t;r=o,i=u.set(s,[e,n])}else r=o.set(e,u.size),i=u.set(u.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=i,t.__hash=void 0,t):Ce(r,i)}function Oe(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ze(t){this._iter=t,this.size=t.size}function ke(t){this._iter=t,this.size=t.size}function Ye(t){this._iter=t,this.size=t.size}function Ue(t){var e=tn(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=en,e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return!1!==e(n,t,r)},n)},e.__iteratorUncached=function(e,n){if(e===O){var r=t.__iterator(e,n);return new U(function(){var t=r.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===A?T:A,n)},e}function Pe(t,e,n){var r=tn(t);return r.size=t.size,r.has=function(e){return t.has(e)},r.get=function(r,i){var o=t.get(r,g);return o===g?i:e.call(n,o,r,t)},r.__iterateUncached=function(r,i){var o=this;return t.__iterate(function(t,i,u){return!1!==r(e.call(n,t,i,u),i,o)},i)},r.__iteratorUncached=function(r,i){var o=t.__iterator(O,i);return new U(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return P(r,s,e.call(n,u[1],s,t),i)})},r}function Re(t,e){var n=tn(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=Ue(t);return e.reverse=function(){return t.flip()},e}),n.get=function(n,r){return t.get(e?n:-1-n,r)},n.has=function(n){return t.has(e?n:-1-n)},n.includes=function(e){return t.includes(e)},n.cacheResult=en,n.__iterate=function(e,n){var r=this;return t.__iterate(function(t,n){return e(t,n,r)},!n)},n.__iterator=function(e,n){return t.__iterator(e,!n)},n}function Qe(t,e,n,r){var i=tn(t);return r&&(i.has=function(r){var i=t.get(r,g);return i!==g&&!!e.call(n,i,r,t)},i.get=function(r,i){var o=t.get(r,g);return o!==g&&e.call(n,o,r,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){if(e.call(n,t,o,a))return s++,i(t,r?o:s-1,u)},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(O,o),s=0;return new U(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,c=a[0],f=a[1];if(e.call(n,f,c,t))return P(i,r?c:s++,f,o)}})},i}function Fe(t,e,n,r){var i=t.size;if(void 0!==e&&(e|=0),void 0!==n&&(n===1/0?n=i:n|=0),D(e,n,i))return t;var o=I(e,i),u=E(n,i);if(o!=o||u!=u)return Fe(t.toSeq().cacheResult(),e,n,r);var s,a=u-o;a==a&&(s=a<0?0:a);var c=tn(t);return c.size=0===s?s:t.size&&s||void 0,!r&&it(t)&&s>=0&&(c.get=function(e,n){return(e=N(this,e))>=0&&e<s?t.get(e+o,n):n}),c.__iterateUncached=function(e,n){var i=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(e,n);var u=0,a=!0,c=0;return t.__iterate(function(t,n){if(!a||!(a=u++<o))return c++,!1!==e(t,r?n:c-1,i)&&c!==s}),c},c.__iteratorUncached=function(e,n){if(0!==s&&n)return this.cacheResult().__iterator(e,n);var i=0!==s&&t.__iterator(e,n),u=0,a=0;return new U(function(){for(;u++<o;)i.next();if(++a>s)return{value:void 0,done:!0};var t=i.next();return r||e===A?t:P(e,a-1,e===T?void 0:t.value[1],t)})},c}function Be(t,e,n,r){var i=tn(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,c){if(!s||!(s=e.call(n,t,o,c)))return a++,i(t,r?o:a-1,u)}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(O,o),a=!0,c=0;return new U(function(){var t,o,f;do{if((t=s.next()).done)return r||i===A?t:P(i,c++,i===T?void 0:t.value[1],t);var l=t.value;o=l[0],f=l[1],a&&(a=e.call(n,f,o,u))}while(a);return i===O?t:P(i,o,f,t)})},i}function Ge(t,e){var n=s(t),i=[t].concat(e).map(function(t){return u(t)?n&&(t=r(t)):t=n?ut(t):st(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===i.length)return t;if(1===i.length){var o=i[0];if(o===t||n&&s(o)||a(t)&&a(o))return o}var c=new tt(i);return n?c=c.toKeyedSeq():a(t)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=i.reduce(function(t,e){if(void 0!==t){var n=e.size;if(void 0!==n)return t+n}},0),c}function We(t,e,n){var r=tn(t);return r.__iterateUncached=function(r,i){var o=0,s=!1;return function t(a,c){var f=this;a.__iterate(function(i,a){return(!e||c<e)&&u(i)?t(i,c+1):!1===r(i,n?a:o++,f)&&(s=!0),!s},i)}(t,0),o},r.__iteratorUncached=function(r,i){var o=t.__iterator(r,i),s=[],a=0;return new U(function(){for(;o;){var t=o.next();if(!1===t.done){var c=t.value;if(r===O&&(c=c[1]),e&&!(s.length<e)||!u(c))return n?t:P(r,a++,c,t);s.push(o),o=c.__iterator(r,i)}else o=s.pop()}return{value:void 0,done:!0}})},r}function qe(t,e,n){e||(e=nn);var r=s(t),i=0,o=t.toSeq().map(function(e,r){return[r,e,i++,n?n(e,r,t):e]}).toArray();return o.sort(function(t,n){return e(t[3],n[3])||t[2]-n[2]}).forEach(r?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),r?J(o):a(t)?Z(o):V(o)}function Je(t,e,n){if(e||(e=nn),n){var r=t.toSeq().map(function(e,r){return[e,n(e,r,t)]}).reduce(function(t,n){return Ze(e,t[1],n[1])?n:t});return r&&r[0]}return t.reduce(function(t,n){return Ze(e,t,n)?n:t})}function Ze(t,e,n){var r=t(n,e);return 0===r&&n!==e&&(null==n||n!=n)||r>0}function Ve(t,e,r){var i=tn(t);return i.size=new tt(r).map(function(t){return t.size}).min(),i.__iterate=function(t,e){for(var n,r=this.__iterator(A,e),i=0;!(n=r.next()).done&&!1!==t(n.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map(function(t){return t=n(t),B(i?t.reverse():t)}),u=0,s=!1;return new U(function(){var n;return s||(n=o.map(function(t){return t.next()}),s=n.some(function(t){return t.done})),s?{value:void 0,done:!0}:P(t,u++,e.apply(null,n.map(function(t){return t.value})))})},i}function Xe(t,e){return it(t)?e:t.constructor(e)}function He(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Ke(t){return Yt(t.size),x(t)}function $e(t){return s(t)?r:a(t)?i:o}function tn(t){return Object.create((s(t)?J:a(t)?Z:V).prototype)}function en(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):q.prototype.cacheResult.call(this)}function nn(t,e){return t>e?1:t<e?-1:0}function rn(t){var e=B(t);if(!e){if(!W(t))throw new TypeError("Expected iterable or array-like: "+t);e=B(n(t))}return e}function on(t,e){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var u=Object.keys(t);!function(t,e){try{e.forEach(function(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){vt(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}.bind(void 0,t))}catch(t){}}(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=Ut(o)},i=r.prototype=Object.create(un);return i.constructor=r,r}e(Ie,Ut),Ie.of=function(){return this(arguments)},Ie.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ie.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},Ie.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Te()},Ie.prototype.set=function(t,e){return Ae(this,t,e)},Ie.prototype.remove=function(t){return Ae(this,t,g)},Ie.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ie.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],n)},e)},Ie.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Ie.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?Ce(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},Ie.isOrderedMap=Ee,Ie.prototype[d]=!0,Ie.prototype.delete=Ie.prototype.remove,e(Oe,J),Oe.prototype.get=function(t,e){return this._iter.get(t,e)},Oe.prototype.has=function(t){return this._iter.has(t)},Oe.prototype.valueSeq=function(){return this._iter.valueSeq()},Oe.prototype.reverse=function(){var t=this,e=Re(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},Oe.prototype.map=function(t,e){var n=this,r=Pe(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},Oe.prototype.__iterate=function(t,e){var n,r=this;return this._iter.__iterate(this._useKeys?function(e,n){return t(e,n,r)}:(n=e?Ke(this):0,function(i){return t(i,e?--n:n++,r)}),e)},Oe.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var n=this._iter.__iterator(A,e),r=e?Ke(this):0;return new U(function(){var i=n.next();return i.done?i:P(t,e?--r:r++,i.value,i)})},Oe.prototype[d]=!0,e(ze,Z),ze.prototype.includes=function(t){return this._iter.includes(t)},ze.prototype.__iterate=function(t,e){var n=this,r=0;return this._iter.__iterate(function(e){return t(e,r++,n)},e)},ze.prototype.__iterator=function(t,e){var n=this._iter.__iterator(A,e),r=0;return new U(function(){var e=n.next();return e.done?e:P(t,r++,e.value,e)})},e(ke,V),ke.prototype.has=function(t){return this._iter.includes(t)},ke.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},ke.prototype.__iterator=function(t,e){var n=this._iter.__iterator(A,e);return new U(function(){var e=n.next();return e.done?e:P(t,e.value,e.value,e)})},e(Ye,J),Ye.prototype.entrySeq=function(){return this._iter.toSeq()},Ye.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){He(e);var r=u(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},Ye.prototype.__iterator=function(t,e){var n=this._iter.__iterator(A,e);return new U(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){He(r);var i=u(r);return P(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},ze.prototype.cacheResult=Oe.prototype.cacheResult=ke.prototype.cacheResult=Ye.prototype.cacheResult=en,e(on,_t),on.prototype.toString=function(){return this.__toString(an(this)+" {","}")},on.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},on.prototype.get=function(t,e){if(!this.has(t))return e;var n=this._defaultValues[t];return this._map?this._map.get(t,n):n},on.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=sn(this,Kt()))},on.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+an(this));if(this._map&&!this._map.has(t)&&e===this._defaultValues[t])return this;var n=this._map&&this._map.set(t,e);return this.__ownerID||n===this._map?this:sn(this,n)},on.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:sn(this,e)},on.prototype.wasAltered=function(){return this._map.wasAltered()},on.prototype.__iterator=function(t,e){var n=this;return r(this._defaultValues).map(function(t,e){return n.get(e)}).__iterator(t,e)},on.prototype.__iterate=function(t,e){var n=this;return r(this._defaultValues).map(function(t,e){return n.get(e)}).__iterate(t,e)},on.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?sn(this,e,t):(this.__ownerID=t,this._map=e,this)};var un=on.prototype;function sn(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function an(t){return t._name||t.constructor.name||"Record"}function cn(t){return null==t?wn():fn(t)&&!f(t)?t:wn().withMutations(function(e){var n=o(t);Yt(n.size),n.forEach(function(t){return e.add(t)})})}function fn(t){return!(!t||!t[hn])}un.delete=un.remove,un.deleteIn=un.removeIn=Ft.removeIn,un.merge=Ft.merge,un.mergeWith=Ft.mergeWith,un.mergeIn=Ft.mergeIn,un.mergeDeep=Ft.mergeDeep,un.mergeDeepWith=Ft.mergeDeepWith,un.mergeDeepIn=Ft.mergeDeepIn,un.setIn=Ft.setIn,un.update=Ft.update,un.updateIn=Ft.updateIn,un.withMutations=Ft.withMutations,un.asMutable=Ft.asMutable,un.asImmutable=Ft.asImmutable,e(cn,Lt),cn.of=function(){return this(arguments)},cn.fromKeys=function(t){return this(r(t).keySeq())},cn.prototype.toString=function(){return this.__toString("Set {","}")},cn.prototype.has=function(t){return this._map.has(t)},cn.prototype.add=function(t){return dn(this,this._map.set(t,!0))},cn.prototype.remove=function(t){return dn(this,this._map.remove(t))},cn.prototype.clear=function(){return dn(this,this._map.clear())},cn.prototype.union=function(){var e=t.call(arguments,0);return 0===(e=e.filter(function(t){return 0!==t.size})).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n<e.length;n++)o(e[n]).forEach(function(e){return t.add(e)})}):this.constructor(e[0])},cn.prototype.intersect=function(){var e=t.call(arguments,0);if(0===e.length)return this;e=e.map(function(t){return o(t)});var n=this;return this.withMutations(function(t){n.forEach(function(n){e.every(function(t){return t.includes(n)})||t.remove(n)})})},cn.prototype.subtract=function(){var e=t.call(arguments,0);if(0===e.length)return this;e=e.map(function(t){return o(t)});var n=this;return this.withMutations(function(t){n.forEach(function(n){e.some(function(t){return t.includes(n)})&&t.remove(n)})})},cn.prototype.merge=function(){return this.union.apply(this,arguments)},cn.prototype.mergeWith=function(e){var n=t.call(arguments,1);return this.union.apply(this,n)},cn.prototype.sort=function(t){return vn(qe(this,t))},cn.prototype.sortBy=function(t,e){return vn(qe(this,e,t))},cn.prototype.wasAltered=function(){return this._map.wasAltered()},cn.prototype.__iterate=function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},cn.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},cn.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},cn.isSet=fn;var ln,hn="@@__IMMUTABLE_SET__@@",pn=cn.prototype;function dn(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function yn(t,e){var n=Object.create(pn);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function wn(){return ln||(ln=yn(Kt()))}function vn(t){return null==t?Ln():gn(t)?t:Ln().withMutations(function(e){var n=o(t);Yt(n.size),n.forEach(function(t){return e.add(t)})})}function gn(t){return fn(t)&&f(t)}pn[hn]=!0,pn.delete=pn.remove,pn.mergeDeep=pn.merge,pn.mergeDeepWith=pn.mergeWith,pn.withMutations=Ft.withMutations,pn.asMutable=Ft.asMutable,pn.asImmutable=Ft.asImmutable,pn.__empty=wn,pn.__make=yn,e(vn,cn),vn.of=function(){return this(arguments)},vn.fromKeys=function(t){return this(r(t).keySeq())},vn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},vn.isOrderedSet=gn;var Mn,_n=vn.prototype;function mn(t,e){var n=Object.create(_n);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function Ln(){return Mn||(Mn=mn(Te()))}function bn(t){return null==t?In():jn(t)?t:In().unshiftAll(t)}function jn(t){return!(!t||!t[Nn])}_n[d]=!0,_n.__empty=Ln,_n.__make=mn,e(bn,mt),bn.of=function(){return this(arguments)},bn.prototype.toString=function(){return this.__toString("Stack [","]")},bn.prototype.get=function(t,e){var n=this._head;for(t=N(this,t);n&&t--;)n=n.next;return n?n.value:e},bn.prototype.peek=function(){return this._head&&this._head.value},bn.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,n=arguments.length-1;n>=0;n--)e={value:arguments[n],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):Dn(t,e)},bn.prototype.pushAll=function(t){if(0===(t=i(t)).size)return this;Yt(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):Dn(e,n)},bn.prototype.pop=function(){return this.slice(1)},bn.prototype.unshift=function(){return this.push.apply(this,arguments)},bn.prototype.unshiftAll=function(t){return this.pushAll(t)},bn.prototype.shift=function(){return this.pop.apply(this,arguments)},bn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):In()},bn.prototype.slice=function(t,e){if(D(t,e,this.size))return this;var n=I(t,this.size);if(E(e,this.size)!==this.size)return mt.prototype.slice.call(this,t,e);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Dn(r,i)},bn.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Dn(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},bn.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var n=0,r=this._head;r&&!1!==t(r.value,n++,this);)r=r.next;return n},bn.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var n=0,r=this._head;return new U(function(){if(r){var e=r.value;return r=r.next,P(t,n++,e)}return{value:void 0,done:!0}})},bn.isStack=jn;var xn,Nn="@@__IMMUTABLE_STACK__@@",Sn=bn.prototype;function Dn(t,e,n,r){var i=Object.create(Sn);return i.size=t,i._head=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function In(){return xn||(xn=Dn(0))}function En(t,e){var n=function(n){t.prototype[n]=e[n]};return Object.keys(e).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(n),t}Sn[Nn]=!0,Sn.withMutations=Ft.withMutations,Sn.asMutable=Ft.asMutable,Sn.asImmutable=Ft.asImmutable,Sn.wasAltered=Ft.wasAltered,n.Iterator=U,En(n,{toArray:function(){Yt(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate(function(e,n){t[n]=e}),t},toIndexedSeq:function(){return new ze(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new Oe(this,!0)},toMap:function(){return Ut(this.toKeyedSeq())},toObject:function(){Yt(this.size);var t={};return this.__iterate(function(e,n){t[n]=e}),t},toOrderedMap:function(){return Ie(this.toKeyedSeq())},toOrderedSet:function(){return vn(s(this)?this.valueSeq():this)},toSet:function(){return cn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new ke(this)},toSeq:function(){return a(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return bn(s(this)?this.valueSeq():this)},toList:function(){return he(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){var e=t.call(arguments,0);return Xe(this,Ge(this,e))},includes:function(t){return this.some(function(e){return dt(e,t)})},entries:function(){return this.__iterator(O)},every:function(t,e){Yt(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!t.call(e,r,i,o))return n=!1,!1}),n},filter:function(t,e){return Xe(this,Qe(this,t,e,!0))},find:function(t,e,n){var r=this.findEntry(t,e);return r?r[1]:n},forEach:function(t,e){return Yt(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){Yt(this.size),t=void 0!==t?""+t:",";var e="",n=!0;return this.__iterate(function(r){n?n=!1:e+=t,e+=null!=r?r.toString():""}),e},keys:function(){return this.__iterator(T)},map:function(t,e){return Xe(this,Pe(this,t,e))},reduce:function(t,e,n){var r,i;return Yt(this.size),arguments.length<2?i=!0:r=e,this.__iterate(function(e,o,u){i?(i=!1,r=e):r=t.call(n,r,e,o,u)}),r},reduceRight:function(t,e,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Xe(this,Re(this,!0))},slice:function(t,e){return Xe(this,Fe(this,t,e,!0))},some:function(t,e){return!this.every(zn(t),e)},sort:function(t){return Xe(this,qe(this,t))},values:function(){return this.__iterator(A)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return x(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return function(t,e,n){var r=Ut().asMutable();return t.__iterate(function(i,o){r.update(e.call(n,i,o,t),0,function(t){return t+1})}),r.asImmutable()}(this,t,e)},equals:function(t){return yt(this,t)},entrySeq:function(){var t=this;if(t._cache)return new tt(t._cache);var e=t.toSeq().map(On).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(zn(t),e)},findEntry:function(t,e,n){var r=n;return this.__iterate(function(n,i,o){if(t.call(e,n,i,o))return r=[i,n],!1}),r},findKey:function(t,e){var n=this.findEntry(t,e);return n&&n[0]},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},findLastEntry:function(t,e,n){return this.toKeyedSeq().reverse().findEntry(t,e,n)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(S)},flatMap:function(t,e){return Xe(this,function(t,e,n){var r=$e(t);return t.toSeq().map(function(i,o){return r(e.call(n,i,o,t))}).flatten(!0)}(this,t,e))},flatten:function(t){return Xe(this,We(this,t,!0))},fromEntrySeq:function(){return new Ye(this)},get:function(t,e){return this.find(function(e,n){return dt(n,t)},void 0,e)},getIn:function(t,e){for(var n,r=this,i=rn(t);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,g):g)===g)return e}return r},groupBy:function(t,e){return function(t,e,n){var r=s(t),i=(f(t)?Ie():Ut()).asMutable();t.__iterate(function(o,u){i.update(e.call(n,o,u,t),function(t){return(t=t||[]).push(r?[u,o]:o),t})});var o=$e(t);return i.map(function(e){return Xe(t,o(e))})}(this,t,e)},has:function(t){return this.get(t,g)!==g},hasIn:function(t){return this.getIn(t,g)!==g},isSubset:function(t){return t="function"==typeof t.includes?t:n(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:n(t)).isSubset(this)},keyOf:function(t){return this.findKey(function(e){return dt(e,t)})},keySeq:function(){return this.toSeq().map(An).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Je(this,t)},maxBy:function(t,e){return Je(this,e,t)},min:function(t){return Je(this,t?kn(t):Pn)},minBy:function(t,e){return Je(this,e?kn(e):Pn,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return Xe(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return Xe(this,Be(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(zn(t),e)},sortBy:function(t,e){return Xe(this,qe(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return Xe(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return Xe(this,function(t,e,n){var r=tn(t);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var u=0;return t.__iterate(function(t,i,s){return e.call(n,t,i,s)&&++u&&r(t,i,o)}),u},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var u=t.__iterator(O,i),s=!0;return new U(function(){if(!s)return{value:void 0,done:!0};var t=u.next();if(t.done)return t;var i=t.value,a=i[0],c=i[1];return e.call(n,c,a,o)?r===O?t:P(r,a,c,t):(s=!1,{value:void 0,done:!0})})},r}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(zn(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=f(t),n=s(t),r=e?1:0;return function(t,e){return e=bt(e,3432918353),e=bt(e<<15|e>>>-15,461845907),e=bt(e<<13|e>>>-13,5),e=bt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=jt((e=bt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(n?e?function(t,e){r=31*r+Rn(xt(t),xt(e))|0}:function(t,e){r=r+Rn(xt(t),xt(e))|0}:e?function(t){r=31*r+xt(t)|0}:function(t){r=r+xt(t)|0}),r)}(this))}});var Cn=n.prototype;Cn[l]=!0,Cn[Y]=Cn.values,Cn.__toJS=Cn.toArray,Cn.__toStringMapper=Yn,Cn.inspect=Cn.toSource=function(){return this.toString()},Cn.chain=Cn.flatMap,Cn.contains=Cn.includes,En(r,{flip:function(){return Xe(this,Ue(this))},mapEntries:function(t,e){var n=this,r=0;return Xe(this,this.toSeq().map(function(i,o){return t.call(e,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(t,e){var n=this;return Xe(this,this.toSeq().flip().map(function(r,i){return t.call(e,r,i,n)}).flip())}});var Tn=r.prototype;function An(t,e){return e}function On(t,e){return[e,t]}function zn(t){return function(){return!t.apply(this,arguments)}}function kn(t){return function(){return-t.apply(this,arguments)}}function Yn(t){return"string"==typeof t?JSON.stringify(t):String(t)}function Un(){return j(arguments)}function Pn(t,e){return t<e?1:t>e?-1:0}function Rn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}return Tn[h]=!0,Tn[Y]=Cn.entries,Tn.__toJS=Cn.toObject,Tn.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+Yn(t)},En(i,{toKeyedSeq:function(){return new Oe(this,!1)},filter:function(t,e){return Xe(this,Qe(this,t,e,!1))},findIndex:function(t,e){var n=this.findEntry(t,e);return n?n[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Xe(this,Re(this,!1))},slice:function(t,e){return Xe(this,Fe(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=I(t,t<0?this.count():this.size);var r=this.slice(0,t);return Xe(this,1===n?r:r.concat(j(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var n=this.findLastEntry(t,e);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(t){return Xe(this,We(this,t,!1))},get:function(t,e){return(t=N(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,n){return n===t},void 0,e)},has:function(t){return(t=N(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return Xe(this,function(t,e){var n=tn(t);return n.size=t.size&&2*t.size-1,n.__iterateUncached=function(n,r){var i=this,o=0;return t.__iterate(function(t,r){return(!o||!1!==n(e,o++,i))&&!1!==n(t,o++,i)},r),o},n.__iteratorUncached=function(n,r){var i,o=t.__iterator(A,r),u=0;return new U(function(){return(!i||u%2)&&(i=o.next()).done?i:u%2?P(n,u++,e):P(n,u++,i.value,i)})},n}(this,t))},interleave:function(){var t=[this].concat(j(arguments)),e=Ve(this.toSeq(),Z.of,t),n=e.flatten(!0);return e.size&&(n.size=e.size*t.length),Xe(this,n)},keySeq:function(){return gt(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(t,e){return Xe(this,Be(this,t,e,!1))},zip:function(){var t=[this].concat(j(arguments));return Xe(this,Ve(this,Un,t))},zipWith:function(t){var e=j(arguments);return e[0]=this,Xe(this,Ve(this,t,e))}}),i.prototype[p]=!0,i.prototype[d]=!0,En(o,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),o.prototype.has=Cn.includes,o.prototype.contains=o.prototype.includes,En(J,r.prototype),En(Z,i.prototype),En(V,o.prototype),En(_t,r.prototype),En(mt,i.prototype),En(Lt,o.prototype),{Iterable:n,Seq:q,Collection:Mt,Map:Ut,OrderedMap:Ie,List:he,Stack:bn,Set:cn,OrderedSet:vn,Record:on,Range:gt,Repeat:wt,is:dt,fromJS:lt}}()},function(t,e,n){"use strict";t.exports=n(218)},function(t,e,n){t.exports=n(241)},function(t,e,n){"use strict";var r=n(47),i=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];t.exports=function(t,e){var n,u;if(e=e||{},Object.keys(e).forEach(function(e){if(-1===i.indexOf(e))throw new r('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(n=e.styleAliases||null,u={},null!==n&&Object.keys(n).forEach(function(t){n[t].forEach(function(e){u[String(e)]=t})}),u),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},function(t,e){var n=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(110);t.exports=function(t,e,n){return e in t?r(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";(function(t){n.d(e,"d",function(){return g}),n.d(e,"c",function(){return M}),n.d(e,"b",function(){return m}),n.d(e,"e",function(){return L}),n.d(e,"f",function(){return b}),n.d(e,"a",function(){return j});n(106),n(171),n(103);var r=n(107),i=n.n(r),o=n(14),u=n.n(o),s=n(2),a=n.n(s),c=n(9),f=n.n(c),l=n(0),h=n.n(l),p=(n(172),n(173),n(104),n(105)),d=n.n(p),y=(n(174),n(175),n(38),n(108),n(49)),w=n.n(y),v=(n(178),n(179),n(180),n(181),function(t){return h.a.Iterable.isIterable(t)});function g(t){return _(t)?v(t)?t.toJS():t:{}}function M(t){return a()(t)?t:[t]}function _(t){return!!t&&"object"===f()(t)}function m(t){return"function"==typeof t}d.a;var L=function(){var t={},e=w.a.location.search;if(!e)return{};if(""!=e){var n=e.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),t[decodeURIComponent(r[0])]=r[1]&&decodeURIComponent(r[1])||"")}return t},b=function(t){return u()(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")};function j(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==f()(t)||a()(t)||null===t||!e)return t;var r=i()({},t);return u()(r).forEach(function(t){t===e&&n(r[t],t)?delete r[t]:r[t]=j(r[t],e,n)}),r}}).call(this,n(57).Buffer)},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){var r=n(57),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function u(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=u),o(i,u),u.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},u.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},u.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},u.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,n){var r=n(187),i=n(199);function o(t){return(o="function"==typeof i&&"symbol"==typeof r?function(t){return typeof t}:function(t){return t&&"function"==typeof i&&t.constructor===i&&t!==i.prototype?"symbol":typeof t})(t)}function u(e){return"function"==typeof i&&"symbol"===o(r)?t.exports=u=function(t){return o(t)}:t.exports=u=function(t){return t&&"function"==typeof i&&t.constructor===i&&t!==i.prototype?"symbol":o(t)},u(e)}t.exports=u},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(136),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){t.exports=n(252)},function(t,e,n){var r=n(16),i=n(4),o=n(111),u=n(27),s=n(21),a=function(t,e,n){var c,f,l,h=t&a.F,p=t&a.G,d=t&a.S,y=t&a.P,w=t&a.B,v=t&a.W,g=p?i:i[e]||(i[e]={}),M=g.prototype,_=p?r:d?r[e]:(r[e]||{}).prototype;for(c in p&&(n=e),n)(f=!h&&_&&void 0!==_[c])&&s(g,c)||(l=f?_[c]:n[c],g[c]=p&&"function"!=typeof _[c]?n[c]:w&&f?o(l,r):v&&_[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):y&&"function"==typeof l?o(Function.call,l):l,y&&((g.virtual||(g.virtual={}))[c]=l,t&a.R&&M&&!M[c]&&u(M,c,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(82)("wks"),i=n(53),o=n(16).Symbol,u="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=r},function(t,e,n){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,n){var r=n(28),i=n(112),o=n(76),u=Object.defineProperty;e.f=n(20)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(30)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var a,c=[],f=!1,l=-1;function h(){f&&a&&(f=!1,a.length?c=a.concat(c):l=-1,c.length&&p())}function p(){if(!f){var t=s(h);f=!0;for(var e=c.length;e;){for(a=c,c=[];++l<e;)a&&a[l].run();l=-1,e=c.length}a=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||f||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(67),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=l;var o=n(46);o.inherits=n(7);var u=n(152),s=n(97);o.inherits(l,u);for(var a=i(s.prototype),c=0;c<a.length;c++){var f=a[c];l.prototype[f]||(l.prototype[f]=s.prototype[f])}function l(t){if(!(this instanceof l))return new l(t);u.call(this,t),s.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||r.nextTick(p,this)}function p(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),l.prototype._destroy=function(t,e){this.push(null),this.end(),r.nextTick(e,t)}},function(t,e,n){"use strict";var r=n(159)();t.exports=function(t){return t!==r&&null!==t}},function(t,e,n){"use strict";var r=n(371),i=Math.max;t.exports=function(t){return i(0,r(t))}},function(t,e,n){},function(t,e,n){var r=n(19),i=n(50);t.exports=n(20)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(29);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(118),i=n(78);t.exports=function(t){return r(i(t))}},function(t,e,n){"use strict";var r=n(40),i=n(131),o=(n(88),n(129),Object.prototype.hasOwnProperty),u=n(132),s={key:!0,ref:!0,__self:!0,__source:!0};function a(t){return void 0!==t.ref}function c(t){return void 0!==t.key}var f=function(t,e,n,r,i,o,s){return{$$typeof:u,type:t,key:e,ref:n,props:s,_owner:o}};f.createElement=function(t,e,n){var r,u={},l=null,h=null;if(null!=e)for(r in a(e)&&(h=e.ref),c(e)&&(l=""+e.key),void 0===e.__self?null:e.__self,void 0===e.__source?null:e.__source,e)o.call(e,r)&&!s.hasOwnProperty(r)&&(u[r]=e[r]);var p=arguments.length-2;if(1===p)u.children=n;else if(p>1){for(var d=Array(p),y=0;y<p;y++)d[y]=arguments[y+2];0,u.children=d}if(t&&t.defaultProps){var w=t.defaultProps;for(r in w)void 0===u[r]&&(u[r]=w[r])}return f(t,l,h,0,0,i.current,u)},f.createFactory=function(t){var e=f.createElement.bind(null,t);return e.type=t,e},f.cloneAndReplaceKey=function(t,e){return f(t.type,e,t.ref,t._self,t._source,t._owner,t.props)},f.cloneElement=function(t,e,n){var u,l,h=r({},t.props),p=t.key,d=t.ref,y=(t._self,t._source,t._owner);if(null!=e)for(u in a(e)&&(d=e.ref,y=i.current),c(e)&&(p=""+e.key),t.type&&t.type.defaultProps&&(l=t.type.defaultProps),e)o.call(e,u)&&!s.hasOwnProperty(u)&&(void 0===e[u]&&void 0!==l?h[u]=l[u]:h[u]=e[u]);var w=arguments.length-2;if(1===w)h.children=n;else if(w>1){for(var v=Array(w),g=0;g<w;g++)v[g]=arguments[g+2];h.children=v}return f(t.type,p,d,0,0,y,h)},f.isValidElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===u},t.exports=f},function(t,e,n){var r=n(277),i=n(280);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){"use strict";var r=n(24);t.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){var r=n(8).Buffer;function i(t,e){this._block=r.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=r.from(t,e));for(var n=this._block,i=this._blockSize,o=t.length,u=this._len,s=0;s<o;){for(var a=u%i,c=Math.min(o-s,i-a),f=0;f<c;f++)n[a+f]=t[s+f];s+=c,(u+=c)%i==0&&this._update(n)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,n){"use strict";function r(t){return null==t}t.exports.isNothing=r,t.exports.isObject=function(t){return"object"==typeof t&&null!==t},t.exports.toArray=function(t){return Array.isArray(t)?t:r(t)?[]:[t]},t.exports.repeat=function(t,e){var n,r="";for(n=0;n<e;n+=1)r+=t;return r},t.exports.isNegativeZero=function(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t},t.exports.extend=function(t,e){var n,r,i,o;if(e)for(n=0,r=(o=Object.keys(e)).length;n<r;n+=1)t[i=o[n]]=e[i];return t}},function(t,e,n){"use strict";var r=n(36),i=n(47),o=n(3);function u(t,e,n){var r=[];return t.include.forEach(function(t){n=u(t,e,n)}),t[e].forEach(function(t){n.forEach(function(e,n){e.tag===t.tag&&e.kind===t.kind&&r.push(n)}),n.push(t)}),n.filter(function(t,e){return-1===r.indexOf(e)})}function s(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&"scalar"!==t.loadKind)throw new i("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=u(this,"implicit",[]),this.compiledExplicit=u(this,"explicit",[]),this.compiledTypeMap=function(){var t,e,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(t){n[t.kind][t.tag]=n.fallback[t.tag]=t}for(t=0,e=arguments.length;t<e;t+=1)arguments[t].forEach(r);return n}(this.compiledImplicit,this.compiledExplicit)}s.DEFAULT=null,s.create=function(){var t,e;switch(arguments.length){case 1:t=s.DEFAULT,e=arguments[0];break;case 2:t=arguments[0],e=arguments[1];break;default:throw new i("Wrong number of arguments for Schema.create function")}if(t=r.toArray(t),e=r.toArray(e),!t.every(function(t){return t instanceof s}))throw new i("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!e.every(function(t){return t instanceof o}))throw new i("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new s({include:t,explicit:e})},t.exports=s},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(117),i=n(83);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){"use strict"; +/* object-assign (c) Sindre Sorhus @license MIT -*/ -var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,a,u=r(t),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var h in n)o.call(n,h)&&(u[h]=n[h]);if(i){a=i(n);for(var l=0;l<a.length;l++)s.call(n,a[l])&&(u[a[l]]=n[a[l]])}}return u}},function(t,e){t.exports={}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(39);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){"use strict";var r=n(14),i=n(22),o=n(29),s=n(8),a=n(1);t.exports=function(t,e,n){var u=a(t),c=n(s,u,""[t]),h=c[0],l=c[1];o(function(){var e={};return e[u]=function(){return 7},7!=""[t](e)})&&(i(String.prototype,t,h),r(RegExp.prototype,u,2==e?function(t,e){return l.call(t,this,e)}:function(t){return l.call(t,this)}))}},function(t,e,n){var r=n(12),i=n(178),o=n(197),s=Object.defineProperty;e.f=n(28)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(180),i=n(8);t.exports=function(t){return r(i(t))}},function(t,e,n){"use strict";function r(t){return function(){return t}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(t){return t},t.exports=i},function(t,e,n){"use strict";var r=n(45),i=r;t.exports=i},function(t,e,n){"use strict";var r=n(24);t.exports=r.DEFAULT=new r({include:[n(34)],explicit:[n(246),n(245),n(244)]})},function(t,e,n){"use strict";function r(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var i=new Error(n);throw i.name="Invariant Violation",i.framesToPop=1,i}t.exports=r},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){t.exports=!0},function(t,e,n){var r=n(16),i=n(156),o=n(51),s=n(57)("IE_PROTO"),a=function(){},u=function(){var t,e=n(82)("iframe"),r=o.length;for(e.style.display="none",n(150).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[s]=t):n=u(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(89),i=n(51);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(11).f,i=n(10),o=n(7)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(58)("keys"),i=n(38);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(6),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(19);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(6),i=n(5),o=n(52),s=n(62),a=n(11).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,n){e.f=n(7)},function(t,e,n){var r=n(27),i=n(1)("toStringTag"),o="Arguments"==r(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var r=n(21),i=n(4).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){var r=n(1)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){"use strict";function r(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=i(e),this.reject=i(n)}var i=n(39);t.exports.f=function(t){return new r(t)}},function(t,e,n){var r=n(42).f,i=n(30),o=n(1)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(103)("keys"),i=n(70);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(96),i=n(8);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){"use strict";var r=n(24);t.exports=new r({explicit:[n(254),n(252),n(247)]})},function(t,e,n){"use strict";function r(t,e){return{type:a,payload:(0,s.default)({},t,e)}}function i(t){return{type:u,payload:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.TOGGLE_CONFIGS=e.UPDATE_CONFIGS=void 0;var o=n(77),s=function(t){return t&&t.__esModule?t:{default:t}}(o);e.update=r,e.toggle=i;var a=e.UPDATE_CONFIGS="configs_update",u=e.TOGGLE_CONFIGS="configs_toggle"},function(t,e,n){t.exports={default:n(140),__esModule:!0}},function(t,e,n){t.exports={default:n(141),__esModule:!0}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var r=n(73),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},function(t,e,n){"use strict";e.__esModule=!0;var r=n(73),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t,e,n){return e in t?(0,i.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(131),o=r(i),s=n(130),a=r(s),u=n(80),c=r(u);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,c.default)(e)));t.prototype=(0,a.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(o.default?(0,o.default)(t,e):t.__proto__=e)}},function(t,e,n){"use strict";e.__esModule=!0;var r=n(80),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,i.default)(e))&&"function"!=typeof e?t:e}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(133),o=r(i),s=n(132),a=r(s),u="function"==typeof a.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===u(o.default)?function(t){return void 0===t?"undefined":u(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":void 0===t?"undefined":u(t)}},function(t,e,n){var r=n(145);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(19),i=n(6).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){t.exports=!n(9)&&!n(26)(function(){return 7!=Object.defineProperty(n(82)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";var r=n(52),i=n(17),o=n(90),s=n(18),a=n(10),u=n(36),c=n(153),h=n(56),l=n(88),p=n(7)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,m,y,v,x){c(n,e,m);var g,D,E,A=function(t){if(!f&&t in _)return _[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",w="values"==y,C=!1,_=t.prototype,b=_[p]||_["@@iterator"]||y&&_[y],F=!f&&b||A(y),k=y?w?A("entries"):F:void 0,I="Array"==e?_.entries||b:b;if(I&&(E=l(I.call(new t)))!==Object.prototype&&E.next&&(h(E,S,!0),r||a(E,p)||s(E,p,d)),w&&b&&"values"!==b.name&&(C=!0,F=function(){return b.call(this)}),r&&!x||!f&&!C&&_[p]||s(_,p,F),u[e]=F,u[S]=d,y)if(g={values:w?F:A("values"),keys:v?F:A("keys"),entries:k},x)for(D in g)D in _||o(_,D,g[D]);else i(i.P+i.F*(f||C),e,g);return g}},function(t,e,n){var r=n(55),i=n(37),o=n(20),s=n(60),a=n(10),u=n(83),c=Object.getOwnPropertyDescriptor;e.f=n(9)?c:function(t,e){if(t=o(t),e=s(e,!0),u)try{return c(t,e)}catch(t){}if(a(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){var r=n(89),i=n(51).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(10),i=n(91),o=n(57)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){var r=n(10),i=n(20),o=n(147)(!1),s=n(57)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){t.exports=n(18)},function(t,e,n){var r=n(50);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";var r=n(160)(!0);n(84)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){n(165);for(var r=n(6),i=n(18),o=n(36),s=n(7)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<a.length;u++){var c=a[u],h=r[c],l=h&&h.prototype;l&&!l[s]&&i(l,s,c),o[c]=o.Array}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(4).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(21),i=n(27),o=n(1)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){"use strict";var r=n(98),i=n(2),o=n(22),s=n(14),a=n(30),u=n(31),c=n(183),h=n(67),l=n(189),p=n(1)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,m,y,v,x){c(n,e,m);var g,D,E,A=function(t){if(!f&&t in _)return _[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",w="values"==y,C=!1,_=t.prototype,b=_[p]||_["@@iterator"]||y&&_[y],F=!f&&b||A(y),k=y?w?A("entries"):F:void 0,I="Array"==e?_.entries||b:b;if(I&&(E=l(I.call(new t)))!==Object.prototype&&E.next&&(h(E,S,!0),r||a(E,p)||s(E,p,d)),w&&b&&"values"!==b.name&&(C=!0,F=function(){return b.call(this)}),r&&!x||!f&&!C&&_[p]||s(_,p,F),u[e]=F,u[S]=d,y)if(g={values:w?F:A("values"),keys:v?F:A("keys"),entries:k},x)for(D in g)D in _||o(_,D,g[D]);else i(i.P+i.F*(f||C),e,g);return g}},function(t,e){t.exports=!1},function(t,e,n){var r=n(190),i=n(94);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(12),i=n(21),o=n(66);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(4),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,n){var r=n(12),i=n(39),o=n(1)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||void 0==(n=r(s)[o])?e:i(n)}},function(t,e,n){var r=n(43),i=n(8);t.exports=function(t){return function(e,n){var o,s,a=String(i(e)),u=r(n),c=a.length;return u<0||u>=c?t?"":void 0:(o=a.charCodeAt(u),o<55296||o>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):o:t?a.slice(u,u+2):s-56320+(o-55296<<10)+65536)}}},function(t,e,n){var r,i,o,s=n(40),a=n(179),u=n(95),c=n(64),h=n(4),l=h.process,p=h.setImmediate,f=h.clearImmediate,d=h.MessageChannel,m=h.Dispatch,y=0,v={},x=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},g=function(t){x.call(t.data)};p&&f||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return v[++y]=function(){a("function"==typeof t?t:Function(t),e)},r(y),y},f=function(t){delete v[t]},"process"==n(27)(l)?r=function(t){l.nextTick(s(x,t,1))}:m&&m.now?r=function(t){m.now(s(x,t,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=g,r=s(o.postMessage,o,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(r=function(t){h.postMessage(t+"","*")},h.addEventListener("message",g,!1)):r="onreadystatechange"in c("script")?function(t){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),x.call(t)}}:function(t){setTimeout(s(x,t,1),0)}),t.exports={set:p,clear:f}},function(t,e,n){var r=n(43),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},function(t,e,n){"use strict";var r=n(105)(!0);n(97)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r={};t.exports=r},function(t,e,n){"use strict";var r=n(24);t.exports=new r({include:[n(111)]})},function(t,e,n){"use strict";var r=n(24);t.exports=new r({include:[n(71)],implicit:[n(249),n(241),n(243),n(242)]})},function(t,e,n){t.exports=n(258)()},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";function r(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||u}function i(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||u}function o(){}var s=n(48),a=n(35),u=n(117),c=(n(118),n(109));n(15),n(270);r.prototype.isReactComponent={},r.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t&&s("85"),this.updater.enqueueSetState(this,t),e&&this.updater.enqueueCallback(this,e,"setState")},r.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this),t&&this.updater.enqueueCallback(this,t,"forceUpdate")};o.prototype=r.prototype,i.prototype=new o,i.prototype.constructor=i,a(i.prototype,r.prototype),i.prototype.isPureReactComponent=!0,t.exports={Component:r,PureComponent:i}},function(t,e,n){"use strict";var r={current:null};t.exports=r},function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=r},function(t,e,n){"use strict";var r=(n(46),{isMounted:function(t){return!1},enqueueCallback:function(t,e){},enqueueForceUpdate:function(t){},enqueueReplaceState:function(t,e){},enqueueSetState:function(t,e){}});t.exports=r},function(t,e,n){"use strict";var r=!1;t.exports=r},function(t,e,n){"use strict";t.exports=n(263)},function(t,e,n){"use strict";var r=n(125);void 0===function(t){return t&&t.__esModule?t:{default:t}}(r).default.Promise&&n(137),String.prototype.startsWith||n(136)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i=n(128),o=r(i),s=n(126),a=r(s),u=n(122),c=r(u),h=[a.default,c.default,function(){return{components:{StandaloneLayout:o.default}}}];t.exports=h},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function i(t){return t&&t.__esModule?t:{default:t}}function o(){return{statePlugins:{spec:{actions:v,selectors:x},configs:{reducers:m.default,actions:l,selectors:f}}}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var s=n(235),a=i(s),u=n(260),c=i(u),h=n(72),l=r(h),p=n(124),f=r(p),d=n(123),m=i(d),y=function(t,e){try{return a.default.safeLoad(t)}catch(t){return e&&e.errActions.newThrownErr(new Error(t)),{}}},v={downloadConfig:function(t){return function(e){return(0,e.fn.fetch)(t)}},getConfigByUrl:function(t,e){return function(n){function r(n){n instanceof Error||n.status>=400?(i.updateLoadingStatus("failedConfig"),i.updateLoadingStatus("failedConfig"),i.updateUrl(""),console.error(n.statusText+" "+t),e(null)):e(y(n.text))}var i=n.specActions;if(t)return i.downloadConfig(t).then(r,r)}}},x={getLocalConfig:function(){return y(c.default)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(77),o=function(t){return t&&t.__esModule?t:{default:t}}(i),s=n(233),a=n(72);e.default=(r={},(0,o.default)(r,a.UPDATE_CONFIGS,function(t,e){return t.merge((0,s.fromJS)(e.payload))}),(0,o.default)(r,a.TOGGLE_CONFIGS,function(t,e){var n=e.payload,r=t.get(n);return t.set(n,!r)}),r)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.get=function(t,e){return t.getIn(Array.isArray(e)?e:[e])}},function(t,e,n){"use strict";var r=n(129),i=function(t){return t&&t.__esModule?t:{default:t}}(r);t.exports=function(){var t={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return t;try{t=window;var e=["File","Blob","FormData"],n=!0,r=!1,o=void 0;try{for(var s,a=(0,i.default)(e);!(n=(s=a.next()).done);n=!0){var u=s.value;u in window&&(t[u]=window[u])}}catch(t){r=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(r)throw o}}}catch(t){console.error(t)}return t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return{components:{Topbar:i.default}}};var r=n(127),i=function(t){return t&&t.__esModule?t:{default:t}}(r)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(74),o=r(i),s=n(75),a=r(s),u=n(76),c=r(u),h=n(79),l=r(h),p=n(78),f=r(p),d=n(119),m=r(d),y=n(112),v=r(y),x=n(273),g=r(x),D=function(t){function e(t,n){(0,a.default)(this,e);var r=(0,l.default)(this,(e.__proto__||(0,o.default)(e)).call(this,t,n));return r.onUrlChange=function(t){var e=t.target.value;r.setState({url:e})},r.loadSpec=function(t){r.props.specActions.updateUrl(t),r.props.specActions.download(t)},r.onUrlSelect=function(t){var e=t.target.value||t.target.href;r.loadSpec(e),r.setSelectedUrl(e),t.preventDefault()},r.downloadUrl=function(t){r.loadSpec(r.state.url),t.preventDefault()},r.setSelectedUrl=function(t){var e=r.props.getConfigs(),n=e.urls||[];n&&n.length&&t&&n.forEach(function(e,n){e.url===t&&r.setState({selectedIndex:n})})},r.onFilterChange=function(t){var e=t.target.value;r.props.layoutActions.updateFilter(e)},r.state={url:t.specSelectors.url(),selectedIndex:0},r}return(0,f.default)(e,t),(0,c.default)(e,[{key:"componentWillReceiveProps",value:function(t){this.setState({url:t.specSelectors.url()})}},{key:"componentWillMount",value:function(){var t=this,e=this.props.getConfigs(),n=e.urls||[];if(n&&n.length){var r=e["urls.primaryName"];r&&n.forEach(function(e,n){e.name===r&&t.setState({selectedIndex:n})})}}},{key:"componentDidMount",value:function(){var t=this.props.getConfigs().urls||[];t&&t.length&&this.loadSpec(t[this.state.selectedIndex].url)}},{key:"render",value:function(){var t=this.props,e=t.getComponent,n=t.specSelectors,r=t.getConfigs,i=e("Button"),o=e("Link"),s="loading"===n.loadingStatus(),a="failed"===n.loadingStatus(),u={};a&&(u.color="red"),s&&(u.color="#aaa");var c=r(),h=c.urls,l=[],p=null;if(h){var f=[];h.forEach(function(t,e){f.push(m.default.createElement("option",{key:e,value:t.url},t.name))}),l.push(m.default.createElement("label",{className:"select-label",htmlFor:"select"},m.default.createElement("span",null,"Select a spec"),m.default.createElement("select",{id:"select",disabled:s,onChange:this.onUrlSelect,value:h[this.state.selectedIndex].url},f)))}else p=this.downloadUrl,l.push(m.default.createElement("input",{className:"download-url-input",type:"text",onChange:this.onUrlChange,value:this.state.url,disabled:s,style:u})),l.push(m.default.createElement(i,{className:"download-url-button",onClick:this.downloadUrl},"Explore"));return m.default.createElement("div",{className:"topbar"},m.default.createElement("div",{className:"wrapper"},m.default.createElement("div",{className:"topbar-wrapper"},m.default.createElement(o,{href:"#"},m.default.createElement("img",{height:"30",width:"30",src:g.default,alt:"Swagger UI"}),m.default.createElement("span",null,"swagger")),m.default.createElement("form",{className:"download-url-wrapper",onSubmit:p},l.map(function(t,e){return(0,d.cloneElement)(t,{key:e})})))))}}]),e}(m.default.Component);D.propTypes={layoutActions:v.default.object.isRequired},e.default=D,D.propTypes={specSelectors:v.default.object.isRequired,specActions:v.default.object.isRequired,getComponent:v.default.func.isRequired,getConfigs:v.default.func.isRequired}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(74),o=r(i),s=n(75),a=r(s),u=n(76),c=r(u),h=n(79),l=r(h),p=n(78),f=r(p),d=n(119),m=r(d),y=n(112),v=r(y),x=function(t){function e(){return(0,a.default)(this,e),(0,l.default)(this,(e.__proto__||(0,o.default)(e)).apply(this,arguments))}return(0,f.default)(e,t),(0,c.default)(e,[{key:"render",value:function(){var t=this.props,e=t.getComponent,n=t.specSelectors,r=t.errSelectors,i=e("Container"),o=e("Row"),s=e("Col"),a=e("Topbar",!0),u=e("BaseLayout",!0),c=e("onlineValidatorBadge",!0),h=n.loadingStatus(),l=r.lastError(),p=l?l.get("message"):"";return m.default.createElement(i,{className:"swagger-ui"},a?m.default.createElement(a,null):null,"loading"===h&&m.default.createElement("div",{className:"info"},m.default.createElement("div",{className:"loading-container"},m.default.createElement("div",{className:"loading"}))),"failed"===h&&m.default.createElement("div",{className:"info"},m.default.createElement("div",{className:"loading-container"},m.default.createElement("h4",{className:"title"},"Failed to load API definition."),m.default.createElement("p",null,p))),"failedConfig"===h&&m.default.createElement("div",{className:"info",style:{maxWidth:"880px",marginLeft:"auto",marginRight:"auto",textAlign:"center"}},m.default.createElement("div",{className:"loading-container"},m.default.createElement("h4",{className:"title"},"Failed to load remote configuration."),m.default.createElement("p",null,p))),!h||"success"===h&&m.default.createElement(u,null),m.default.createElement(o,null,m.default.createElement(s,null,m.default.createElement(c,null))))}}]),e}(m.default.Component);x.propTypes={errSelectors:v.default.object.isRequired,errActions:v.default.object.isRequired,specActions:v.default.object.isRequired,specSelectors:v.default.object.isRequired,layoutSelectors:v.default.object.isRequired,layoutActions:v.default.object.isRequired,getComponent:v.default.func.isRequired},e.default=x},function(t,e,n){t.exports={default:n(138),__esModule:!0}},function(t,e,n){t.exports={default:n(139),__esModule:!0}},function(t,e,n){t.exports={default:n(142),__esModule:!0}},function(t,e,n){t.exports={default:n(143),__esModule:!0}},function(t,e,n){t.exports={default:n(144),__esModule:!0}},function(t,e,n){"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-r(t)}function o(t){var e,n,i,o,s,a=t.length;o=r(t),s=new l(3*a/4-o),n=o>0?a-4:a;var u=0;for(e=0;e<n;e+=4)i=h[t.charCodeAt(e)]<<18|h[t.charCodeAt(e+1)]<<12|h[t.charCodeAt(e+2)]<<6|h[t.charCodeAt(e+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=h[t.charCodeAt(e)]<<2|h[t.charCodeAt(e+1)]>>4,s[u++]=255&i):1===o&&(i=h[t.charCodeAt(e)]<<10|h[t.charCodeAt(e+1)]<<4|h[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}function s(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function a(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(s(r));return i.join("")}function u(t){for(var e,n=t.length,r=n%3,i="",o=[],s=0,u=n-r;s<u;s+=16383)o.push(a(t,s,s+16383>u?u:s+16383));return 1===r?(e=t[n-1],i+=c[e>>2],i+=c[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=c[e>>10],i+=c[e>>4&63],i+=c[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=i,e.toByteArray=o,e.fromByteArray=u;for(var c=[],h=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=p.length;f<d;++f)c[f]=p[f],h[p.charCodeAt(f)]=f;h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},function(t,e,n){"use strict";(function(t){function r(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t,e){if(r()<e)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=o.prototype):(null===t&&(t=new o(e)),t.length=e),t}function o(t,e,n){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,e,n)}function s(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?p(t,e,n,r):"string"==typeof e?h(t,e,n):f(t,e)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function u(t,e,n,r){return a(e),e<=0?i(t,e):void 0!==n?"string"==typeof r?i(t,e).fill(n,r):i(t,e).fill(n):i(t,e)}function c(t,e){if(a(e),t=i(t,e<0?0:0|d(e)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function h(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|y(e,n);t=i(t,r);var s=t.write(e,n);return s!==r&&(t=t.slice(0,s)),t}function l(t,e){var n=e.length<0?0:0|d(e.length);t=i(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),o.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=o.prototype):t=l(t,e),t}function f(t,e){if(o.isBuffer(e)){var n=0|d(e.length);return t=i(t,n),0===t.length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||H(e.length)?i(t,0):l(t,e);if("Buffer"===e.type&&Z(e.data))return l(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(t){if(t>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function m(t){return+t!=t&&(t=0),o.alloc(+t)}function y(t,e){if(o.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(t).length;default:if(r)return q(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,n);case"utf8":case"utf-8":return F(this,e,n);case"ascii":return I(this,e,n);case"latin1":case"binary":return T(this,e,n);case"base64":return b(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function x(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=o.from(e,r)),o.isBuffer(e))return 0===e.length?-1:D(t,e,n,r,i);if("number"==typeof e)return e&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):D(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function D(t,e,n,r,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}var c;if(i){var h=-1;for(c=n;c<a;c++)if(o(t,c)===o(e,-1===h?0:c-h)){if(-1===h&&(h=c),c-h+1===u)return h*s}else-1!==h&&(c-=c-h),h=-1}else for(n+u>a&&(n=a-u),c=n;c>=0;c--){for(var l=!0,p=0;p<u;p++)if(o(t,c+p)!==o(e,p)){l=!1;break}if(l)return c}return-1}function E(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function A(t,e,n,r){return G(q(e,t.length-n),t,n,r)}function S(t,e,n,r){return G(K(e),t,n,r)}function w(t,e,n,r){return S(t,e,n,r)}function C(t,e,n,r){return G(W(e),t,n,r)}function _(t,e,n,r){return G(Y(e,t.length-n),t,n,r)}function b(t,e,n){return 0===e&&n===t.length?V.fromByteArray(t):V.fromByteArray(t.slice(e,n))}function F(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=n){var u,c,h,l;switch(a){case 1:o<128&&(s=o);break;case 2:u=t[i+1],128==(192&u)&&(l=(31&o)<<6|63&u)>127&&(s=l);break;case 3:u=t[i+1],c=t[i+2],128==(192&u)&&128==(192&c)&&(l=(15&o)<<12|(63&u)<<6|63&c)>2047&&(l<55296||l>57343)&&(s=l);break;case 4:u=t[i+1],c=t[i+2],h=t[i+3],128==(192&u)&&128==(192&c)&&128==(192&h)&&(l=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&h)>65535&&l<1114112&&(s=l)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return k(r)}function k(t){var e=t.length;if(e<=Q)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=Q));return n}function I(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function T(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function B(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=X(t[o]);return i}function M(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function P(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,n,r,i,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function O(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function R(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function U(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(t,e,n,r,i){return i||U(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(t,e,n,r,23,4),n+4}function L(t,e,n,r,i){return i||U(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(t,e,n,r,52,8),n+8}function z(t){if(t=J(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function X(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function K(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}function Y(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function W(t){return V.toByteArray(z(t))}function G(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function H(t){return t!==t}/*! +*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function u(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,s,a=u(t),c=1;c<arguments.length;c++){for(var f in n=Object(arguments[c]))i.call(n,f)&&(a[f]=n[f]);if(r){s=r(n);for(var l=0;l<s.length;l++)o.call(n,s[l])&&(a[s[l]]=n[s[l]])}}return a}},function(t,e,n){"use strict";var r=function(t){};t.exports=function(t,e,n,i,o,u,s,a){if(r(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,i,o,u,s,a],l=0;(c=new Error(e.replace(/%s/g,function(){return f[l++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(t,e,n){var r=n(255);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(58),i=n(257),o=n(258),u="[object Null]",s="[object Undefined]",a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?s:u:a&&a in Object(t)?i(t):o(t)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){(function(t){function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===n(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===n(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===n(t)},e.isError=function(t){return"[object Error]"===n(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,n(57).Buffer)},function(t,e,n){"use strict";function r(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(t){var e=this.name+": ";return e+=this.reason||"(unknown reason)",!t&&this.mark&&(e+=" "+this.mark.toString()),e},t.exports=r},function(t,e,n){"use strict";var r=n(37);t.exports=new r({include:[n(168)],implicit:[n(438),n(439)],explicit:[n(440),n(441),n(442),n(443)]})},function(t,e){t.exports=function(){var t={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return t;try{t=window;for(var e=0,n=["File","Blob","FormData"];e<n.length;e++){var r=n[e];r in window&&(t[r]=window[r])}}catch(t){console.error(t)}return t}()},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports=!0},function(t,e){t.exports={}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(78);t.exports=function(t){return Object(r(t))}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";t.exports=function(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var i=new Error(n);throw i.name="Invariant Violation",i.framesToPop=1,i}},function(t,e,n){"use strict";(function(t){ +/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ -var V=n(134),$=n(232),Z=n(234);e.Buffer=o,e.SlowBuffer=m,e.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=r(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,e,n){return s(null,t,e,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,e,n){return u(null,t,e,n)},o.allocUnsafe=function(t){return c(null,t)},o.allocUnsafeSlow=function(t){return c(null,t)},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,s=Math.min(n,r);i<s;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Z(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=o.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var s=t[n];if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},o.byteLength=y,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)x(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)x(this,e,e+3),x(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)x(this,e,e+7),x(this,e+1,e+6),x(this,e+2,e+5),x(this,e+3,e+4);return this},o.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?F(this,0,t):v.apply(this,arguments)},o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},o.prototype.compare=function(t,e,n,r,i){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var s=i-r,a=n-e,u=Math.min(s,a),c=this.slice(r,i),h=t.slice(e,n),l=0;l<u;++l)if(c[l]!==h[l]){s=c[l],a=h[l];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},o.prototype.indexOf=function(t,e,n){return g(this,t,e,n,!0)},o.prototype.lastIndexOf=function(t,e,n){return g(this,t,e,n,!1)},o.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return E(this,t,e,n);case"utf8":case"utf-8":return A(this,t,e,n);case"ascii":return S(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r;if(o.TYPED_ARRAY_SUPPORT)r=this.subarray(t,e),r.__proto__=o.prototype;else{var i=e-t;r=new o(i,void 0);for(var s=0;s<i;++s)r[s]=this[s+t]}return r},o.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},o.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},o.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},o.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},o.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),$.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),$.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),$.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),$.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){N(this,t,e,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},o.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){N(this,t,e,n,Math.pow(2,8*n)-1,0)}var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},o.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);N(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);N(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,n){return j(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return j(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return L(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return L(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,s=r-n;if(this===t&&n<e&&e<r)for(i=s-1;i>=0;--i)t[i+e]=this[i+n];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),e);return s},o.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var s;if("number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{var a=o.isBuffer(t)?t:q(new o(t,r).toString()),u=a.length;for(s=0;s<n-e;++s)this[s+e]=a[s%u]}return this};var tt=/[^+\/0-9A-Za-z-_]/g}).call(e,n(274))},function(t,e,n){n(215),n(219),n(226),n(108),n(210),n(211),n(216),n(220),n(222),n(206),n(207),n(208),n(209),n(212),n(213),n(214),n(217),n(218),n(221),n(223),n(224),n(225),n(202),n(203),n(204),n(205),t.exports=n(13).String},function(t,e,n){n(200),n(108),n(229),n(201),n(227),n(228),t.exports=n(13).Promise},function(t,e,n){n(93),n(92),t.exports=n(164)},function(t,e,n){n(166);var r=n(5).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){n(167);var r=n(5).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){n(168),t.exports=n(5).Object.getPrototypeOf},function(t,e,n){n(169),t.exports=n(5).Object.setPrototypeOf},function(t,e,n){n(171),n(170),n(172),n(173),t.exports=n(5).Symbol},function(t,e,n){n(92),n(93),t.exports=n(62).f("iterator")},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(20),i=n(162),o=n(161);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=i(u.length),h=o(s,c);if(t&&n!=n){for(;c>h;)if((a=u[h++])!=a)return!0}else for(;c>h;h++)if((t||h in u)&&u[h]===n)return t||h||0;return!t&&-1}}},function(t,e,n){var r=n(49),i=n(7)("toStringTag"),o="Arguments"==r(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var r=n(54),i=n(87),o=n(55);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var s,a=n(t),u=o.f,c=0;a.length>c;)u.call(t,s=a[c++])&&e.push(s);return e}},function(t,e,n){var r=n(6).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(49);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(49);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){"use strict";var r=n(53),i=n(37),o=n(56),s={};n(18)(s,n(7)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var r=n(38)("meta"),i=n(19),o=n(10),s=n(11).f,a=0,u=Object.isExtensible||function(){return!0},c=!n(26)(function(){return u(Object.preventExtensions({}))}),h=function(t){s(t,r,{value:{i:"O"+ ++a,w:{}}})},l=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!u(t))return"F";if(!e)return"E";h(t)}return t[r].i},p=function(t,e){if(!o(t,r)){if(!u(t))return!0;if(!e)return!1;h(t)}return t[r].w},f=function(t){return c&&d.NEED&&u(t)&&!o(t,r)&&h(t),t},d=t.exports={KEY:r,NEED:!1,fastKey:l,getWeak:p,onFreeze:f}},function(t,e,n){var r=n(11),i=n(16),o=n(54);t.exports=n(9)?Object.defineProperties:function(t,e){i(t);for(var n,s=o(e),a=s.length,u=0;a>u;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var r=n(20),i=n(86).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return i(t)}catch(t){return s.slice()}};t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?a(t):i(r(t))}},function(t,e,n){var r=n(17),i=n(5),o=n(26);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],s={};s[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",s)}},function(t,e,n){var r=n(19),i=n(16),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n(81)(Function.call,n(85).f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){var r=n(59),i=n(50);t.exports=function(t){return function(e,n){var o,s,a=String(i(e)),u=r(n),c=a.length;return u<0||u>=c?t?"":void 0:(o=a.charCodeAt(u),o<55296||o>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):o:t?a.slice(u,u+2):s-56320+(o-55296<<10)+65536)}}},function(t,e,n){var r=n(59),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(59),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(148),i=n(7)("iterator"),o=n(36);t.exports=n(5).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(16),i=n(163);t.exports=n(5).getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return r(e.call(t))}},function(t,e,n){"use strict";var r=n(146),i=n(154),o=n(36),s=n(20);t.exports=n(84)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,n):"values"==e?i(0,t[n]):i(0,[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){var r=n(17);r(r.S,"Object",{create:n(53)})},function(t,e,n){var r=n(17);r(r.S+r.F*!n(9),"Object",{defineProperty:n(11).f})},function(t,e,n){var r=n(91),i=n(88);n(158)("getPrototypeOf",function(){return function(t){return i(r(t))}})},function(t,e,n){var r=n(17);r(r.S,"Object",{setPrototypeOf:n(159).set})},function(t,e){},function(t,e,n){"use strict";var r=n(6),i=n(10),o=n(9),s=n(17),a=n(90),u=n(155).KEY,c=n(26),h=n(58),l=n(56),p=n(38),f=n(7),d=n(62),m=n(61),y=n(149),v=n(152),x=n(16),g=n(19),D=n(20),E=n(60),A=n(37),S=n(53),w=n(157),C=n(85),_=n(11),b=n(54),F=C.f,k=_.f,I=w.f,T=r.Symbol,B=r.JSON,M=B&&B.stringify,P=f("_hidden"),N=f("toPrimitive"),O={}.propertyIsEnumerable,R=h("symbol-registry"),U=h("symbols"),j=h("op-symbols"),L=Object.prototype,z="function"==typeof T,J=r.QObject,X=!J||!J.prototype||!J.prototype.findChild,q=o&&c(function(){return 7!=S(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=F(L,e);r&&delete L[e],k(t,e,n),r&&t!==L&&k(L,e,r)}:k,K=function(t){var e=U[t]=S(T.prototype);return e._k=t,e},Y=z&&"symbol"==typeof T.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof T},W=function(t,e,n){return t===L&&W(j,e,n),x(t),e=E(e,!0),x(n),i(U,e)?(n.enumerable?(i(t,P)&&t[P][e]&&(t[P][e]=!1),n=S(n,{enumerable:A(0,!1)})):(i(t,P)||k(t,P,A(1,{})),t[P][e]=!0),q(t,e,n)):k(t,e,n)},G=function(t,e){x(t);for(var n,r=y(e=D(e)),i=0,o=r.length;o>i;)W(t,n=r[i++],e[n]);return t},H=function(t,e){return void 0===e?S(t):G(S(t),e)},V=function(t){var e=O.call(this,t=E(t,!0));return!(this===L&&i(U,t)&&!i(j,t))&&(!(e||!i(this,t)||!i(U,t)||i(this,P)&&this[P][t])||e)},$=function(t,e){if(t=D(t),e=E(e,!0),t!==L||!i(U,e)||i(j,e)){var n=F(t,e);return!n||!i(U,e)||i(t,P)&&t[P][e]||(n.enumerable=!0),n}},Z=function(t){for(var e,n=I(D(t)),r=[],o=0;n.length>o;)i(U,e=n[o++])||e==P||e==u||r.push(e);return r},Q=function(t){for(var e,n=t===L,r=I(n?j:D(t)),o=[],s=0;r.length>s;)!i(U,e=r[s++])||n&&!i(L,e)||o.push(U[e]);return o};z||(T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===L&&e.call(j,n),i(this,P)&&i(this[P],t)&&(this[P][t]=!1),q(this,t,A(1,n))};return o&&X&&q(L,t,{configurable:!0,set:e}),K(t)},a(T.prototype,"toString",function(){return this._k}),C.f=$,_.f=W,n(86).f=w.f=Z,n(55).f=V,n(87).f=Q,o&&!n(52)&&a(L,"propertyIsEnumerable",V,!0),d.f=function(t){return K(f(t))}),s(s.G+s.W+s.F*!z,{Symbol:T});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)f(tt[et++]);for(var nt=b(f.store),rt=0;nt.length>rt;)m(nt[rt++]);s(s.S+s.F*!z,"Symbol",{for:function(t){return i(R,t+="")?R[t]:R[t]=T(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in R)if(R[e]===t)return e},useSetter:function(){X=!0},useSimple:function(){X=!1}}),s(s.S+s.F*!z,"Object",{create:H,defineProperty:W,defineProperties:G,getOwnPropertyDescriptor:$,getOwnPropertyNames:Z,getOwnPropertySymbols:Q}),B&&s(s.S+s.F*(!z||c(function(){var t=T();return"[null]"!=M([t])||"{}"!=M({a:t})||"{}"!=M(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(g(e)||void 0!==t)&&!Y(t))return v(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Y(e))return e}),r[1]=e,M.apply(B,r)}}),T.prototype[N]||n(18)(T.prototype,N,T.prototype.valueOf),l(T,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){n(61)("asyncIterator")},function(t,e,n){n(61)("observable")},function(t,e,n){var r=n(1)("unscopables"),i=Array.prototype;void 0==i[r]&&n(14)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(44),i=n(32),o=n(107);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=i(u.length),h=o(s,c);if(t&&n!=n){for(;c>h;)if((a=u[h++])!=a)return!0}else for(;c>h;h++)if((t||h in u)&&u[h]===n)return t||h||0;return!t&&-1}}},function(t,e,n){var r=n(40),i=n(182),o=n(181),s=n(12),a=n(32),u=n(198),c={},h={},e=t.exports=function(t,e,n,l,p){var f,d,m,y,v=p?function(){return t}:u(t),x=r(n,l,e?2:1),g=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(o(v)){for(f=a(t.length);f>g;g++)if((y=e?x(s(d=t[g])[0],d[1]):x(t[g]))===c||y===h)return y}else for(m=v.call(t);!(d=m.next()).done;)if((y=i(m,x,d.value,e))===c||y===h)return y};e.BREAK=c,e.RETURN=h},function(t,e,n){t.exports=!n(28)&&!n(29)(function(){return 7!=Object.defineProperty(n(64)("div"),"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(27);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(31),i=n(1)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){var r=n(12);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(t,e,n){"use strict";var r=n(187),i=n(102),o=n(67),s={};n(14)(s,n(1)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(1)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},t(o)}catch(t){}return n}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var r=n(4),i=n(106).set,o=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==n(27)(s);t.exports=function(){var t,e,n,c=function(){var r,i;for(u&&(r=s.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(u)n=function(){s.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(a&&a.resolve){var h=a.resolve();n=function(){h.then(c)}}else n=function(){i.call(r,c)};else{var l=!0,p=document.createTextNode("");new o(c).observe(p,{characterData:!0}),n=function(){p.data=l=!l}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},function(t,e,n){var r=n(12),i=n(188),o=n(94),s=n(68)("IE_PROTO"),a=function(){},u=function(){var t,e=n(64)("iframe"),r=o.length;for(e.style.display="none",n(95).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[s]=t):n=u(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(42),i=n(12),o=n(99);t.exports=n(28)?Object.defineProperties:function(t,e){i(t);for(var n,s=o(e),a=s.length,u=0;a>u;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var r=n(30),i=n(196),o=n(68)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){var r=n(30),i=n(44),o=n(176)(!1),s=n(68)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(22);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},function(t,e,n){"use strict";var r=n(4),i=n(42),o=n(28),s=n(1)("species");t.exports=function(t){var e=r[t];o&&e&&!e[s]&&i.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){"use strict";var r=n(43),i=n(8);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e,n){var r=n(2),i=n(8),o=n(29),s=n(195),a="["+s+"]",u="​…",c=RegExp("^"+a+a+"*"),h=RegExp(a+a+"*$"),l=function(t,e,n){var i={},a=o(function(){return!!s[t]()||u[t]()!=u}),c=i[t]=a?e(p):s[t];n&&(i[n]=c),r(r.P+r.F*a,"String",i)},p=l.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(c,"")),2&e&&(t=t.replace(h,"")),t};t.exports=l},function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,e,n){var r=n(8);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(21);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(63),i=n(1)("iterator"),o=n(31);t.exports=n(13).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){"use strict";var r=n(174),i=n(185),o=n(31),s=n(44);t.exports=n(97)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,n):"values"==e?i(0,t[n]):i(0,[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){"use strict";var r=n(63),i={};i[n(1)("toStringTag")]="z",i+""!="[object z]"&&n(22)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(t,e,n){"use strict";var r,i,o,s,a=n(98),u=n(4),c=n(40),h=n(63),l=n(2),p=n(21),f=n(39),d=n(175),m=n(177),y=n(104),v=n(106).set,x=n(186)(),g=n(66),D=n(100),E=n(101),A=u.TypeError,S=u.process,w=u.Promise,C="process"==h(S),_=function(){},b=i=g.f,F=!!function(){try{var t=w.resolve(1),e=(t.constructor={})[n(1)("species")]=function(t){t(_,_)};return(C||"function"==typeof PromiseRejectionEvent)&&t.then(_)instanceof e}catch(t){}}(),k=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},I=function(t,e){if(!t._n){t._n=!0;var n=t._c;x(function(){for(var r=t._v,i=1==t._s,o=0;n.length>o;)!function(e){var n,o,s=i?e.ok:e.fail,a=e.resolve,u=e.reject,c=e.domain;try{s?(i||(2==t._h&&M(t),t._h=1),!0===s?n=r:(c&&c.enter(),n=s(r),c&&c.exit()),n===e.promise?u(A("Promise-chain cycle")):(o=k(n))?o.call(n,a,u):a(n)):u(r)}catch(t){u(t)}}(n[o++]);t._c=[],t._n=!1,e&&!t._h&&T(t)})}},T=function(t){v.call(u,function(){var e,n,r,i=t._v,o=B(t);if(o&&(e=D(function(){C?S.emit("unhandledRejection",i,t):(n=u.onunhandledrejection)?n({promise:t,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)}),t._h=C||B(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},B=function(t){return 1!==t._h&&0===(t._a||t._c).length},M=function(t){v.call(u,function(){var e;C?S.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})})},P=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),I(e,!0))},N=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw A("Promise can't be resolved itself");(e=k(t))?x(function(){var r={_w:n,_d:!1};try{e.call(t,c(N,r,1),c(P,r,1))}catch(t){P.call(r,t)}}):(n._v=t,n._s=1,I(n,!1))}catch(t){P.call({_w:n,_d:!1},t)}}};F||(w=function(t){d(this,w,"Promise","_h"),f(t),r.call(this);try{t(c(N,this,1),c(P,this,1))}catch(t){P.call(this,t)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(191)(w.prototype,{then:function(t,e){var n=b(y(this,w));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=C?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&I(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(N,t,1),this.reject=c(P,t,1)},g.f=b=function(t){return t===w||t===s?new o(t):i(t)}),l(l.G+l.W+l.F*!F,{Promise:w}),n(67)(w,"Promise"),n(192)("Promise"),s=n(13).Promise,l(l.S+l.F*!F,"Promise",{reject:function(t){var e=b(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(a||!F),"Promise",{resolve:function(t){return E(a&&this===s?w:this,t)}}),l(l.S+l.F*!(F&&n(184)(function(t){w.all(t).catch(_)})),"Promise",{all:function(t){var e=this,n=b(e),r=n.resolve,i=n.reject,o=D(function(){var n=[],o=0,s=1;m(t,!1,function(t){var a=o++,u=!1;n.push(void 0),s++,e.resolve(t).then(function(t){u||(u=!0,n[a]=t,--s||r(n))},i)}),--s||r(n)});return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=b(e),r=n.reject,i=D(function(){m(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(t,e,n){n(41)("match",1,function(t,e,n){return[function(n){"use strict";var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},n]})},function(t,e,n){n(41)("replace",2,function(t,e,n){return[function(r,i){"use strict";var o=t(this),s=void 0==r?void 0:r[e];return void 0!==s?s.call(r,o,i):n.call(String(o),r,i)},n]})},function(t,e,n){n(41)("search",1,function(t,e,n){return[function(n){"use strict";var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},n]})},function(t,e,n){n(41)("split",2,function(t,e,r){"use strict";var i=n(96),o=r,s=[].push,a="length";if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[a]||2!="ab".split(/(?:ab)*/)[a]||4!=".".split(/(.?)(.?)/)[a]||".".split(/()()/)[a]>1||"".split(/.?/)[a]){var u=void 0===/()??/.exec("")[1];r=function(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!i(t))return o.call(n,t,e);var r,c,h,l,p,f=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),m=0,y=void 0===e?4294967295:e>>>0,v=new RegExp(t.source,d+"g");for(u||(r=new RegExp("^"+v.source+"$(?!\\s)",d));(c=v.exec(n))&&!((h=c.index+c[0][a])>m&&(f.push(n.slice(m,c.index)),!u&&c[a]>1&&c[0].replace(r,function(){for(p=1;p<arguments[a]-2;p++)void 0===arguments[p]&&(c[p]=void 0)}),c[a]>1&&c.index<n[a]&&s.apply(f,c.slice(1)),l=c[0][a],m=h,f[a]>=y));)v.lastIndex===c.index&&v.lastIndex++;return m===n[a]?!l&&v.test("")||f.push(""):f.push(n.slice(m)),f[a]>y?f.slice(0,y):f}}else"0".split(void 0,0)[a]&&(r=function(t,e){return void 0===t&&0===e?[]:o.call(this,t,e)});return[function(n,i){var o=t(this),s=void 0==n?void 0:n[e];return void 0!==s?s.call(n,o,i):r.call(String(o),n,i)},r]})},function(t,e,n){"use strict";n(3)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(t,e,n){"use strict";n(3)("big",function(t){return function(){return t(this,"big","","")}})},function(t,e,n){"use strict";n(3)("blink",function(t){return function(){return t(this,"blink","","")}})},function(t,e,n){"use strict";n(3)("bold",function(t){return function(){return t(this,"b","","")}})},function(t,e,n){"use strict";var r=n(2),i=n(105)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},function(t,e,n){"use strict";var r=n(2),i=n(32),o=n(69),s="".endsWith;r(r.P+r.F*n(65)("endsWith"),"String",{endsWith:function(t){var e=o(this,t,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),a=void 0===n?r:Math.min(i(n),r),u=String(t);return s?s.call(e,u,a):e.slice(a-u.length,a)===u}})},function(t,e,n){"use strict";n(3)("fixed",function(t){return function(){return t(this,"tt","","")}})},function(t,e,n){"use strict";n(3)("fontcolor",function(t){return function(e){return t(this,"font","color",e)}})},function(t,e,n){"use strict";n(3)("fontsize",function(t){return function(e){return t(this,"font","size",e)}})},function(t,e,n){var r=n(2),i=n(107),o=String.fromCharCode,s=String.fromCodePoint;r(r.S+r.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,s=0;r>s;){if(e=+arguments[s++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){"use strict";var r=n(2),i=n(69);r(r.P+r.F*n(65)("includes"),"String",{includes:function(t){return!!~i(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";n(3)("italics",function(t){return function(){return t(this,"i","","")}})},function(t,e,n){"use strict";n(3)("link",function(t){return function(e){return t(this,"a","href",e)}})},function(t,e,n){var r=n(2),i=n(44),o=n(32);r(r.S,"String",{raw:function(t){for(var e=i(t.raw),n=o(e.length),r=arguments.length,s=[],a=0;n>a;)s.push(String(e[a++])),a<r&&s.push(String(arguments[a]));return s.join("")}})},function(t,e,n){var r=n(2);r(r.P,"String",{repeat:n(193)})},function(t,e,n){"use strict";n(3)("small",function(t){return function(){return t(this,"small","","")}})},function(t,e,n){"use strict";var r=n(2),i=n(32),o=n(69),s="".startsWith;r(r.P+r.F*n(65)("startsWith"),"String",{startsWith:function(t){var e=o(this,t,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return s?s.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){"use strict";n(3)("strike",function(t){return function(){return t(this,"strike","","")}})},function(t,e,n){"use strict";n(3)("sub",function(t){return function(){return t(this,"sub","","")}})},function(t,e,n){"use strict";n(3)("sup",function(t){return function(){return t(this,"sup","","")}})},function(t,e,n){"use strict";n(194)("trim",function(t){return function(){return t(this,3)}})},function(t,e,n){"use strict";var r=n(2),i=n(13),o=n(4),s=n(104),a=n(101);r(r.P+r.R,"Promise",{finally:function(t){var e=s(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return a(e,t()).then(function(){return n})}:t,n?function(n){return a(e,t()).then(function(){throw n})}:t)}})},function(t,e,n){"use strict";var r=n(2),i=n(66),o=n(100);r(r.S,"Promise",{try:function(t){var e=i.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},function(t,e,n){for(var r=n(199),i=n(99),o=n(22),s=n(4),a=n(14),u=n(31),c=n(1),h=c("iterator"),l=c("toStringTag"),p=u.Array,f={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(f),m=0;m<d.length;m++){var y,v=d[m],x=f[v],g=s[v],D=g&&g.prototype;if(D&&(D[h]||a(D,h,p),D[l]||a(D,l,v),u[v]=p,x))for(y in r)D[y]||o(D,y,r[y],!0)}},function(t,e,n){"use strict";function r(t){return t}function i(t,e,n){function i(t,e){var n=x.hasOwnProperty(e)?x[e]:null;A.hasOwnProperty(e)&&a("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&a("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function c(t,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!e(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=t.prototype,o=r.__reactAutoBindPairs;n.hasOwnProperty(u)&&g.mixins(t,n.mixins);for(var s in n)if(n.hasOwnProperty(s)&&s!==u){var c=n[s],h=r.hasOwnProperty(s);if(i(h,s),g.hasOwnProperty(s))g[s](t,c);else{var l=x.hasOwnProperty(s),d="function"==typeof c,m=d&&!l&&!h&&!1!==n.autobind;if(m)o.push(s,c),r[s]=c;else if(h){var y=x[s];a(l&&("DEFINE_MANY_MERGED"===y||"DEFINE_MANY"===y),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",y,s),"DEFINE_MANY_MERGED"===y?r[s]=p(r[s],c):"DEFINE_MANY"===y&&(r[s]=f(r[s],c))}else r[s]=c}}}else;}function h(t,e){if(e)for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){var i=n in g;a(!i,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var o=n in t;a(!o,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),t[n]=r}}}function l(t,e){a(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in e)e.hasOwnProperty(n)&&(a(void 0===t[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),t[n]=e[n]);return t}function p(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var i={};return l(i,n),l(i,r),i}}function f(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function d(t,e){var n=e.bind(t);return n}function m(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t[r]=d(t,i)}}function y(t){var e=r(function(t,r,i){this.__reactAutoBindPairs.length&&m(this),this.props=t,this.context=r,this.refs=s,this.updater=i||n,this.state=null;var o=this.getInitialState?this.getInitialState():null;a("object"==typeof o&&!Array.isArray(o),"%s.getInitialState(): must return an object or null",e.displayName||"ReactCompositeComponent"),this.state=o});e.prototype=new S,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],v.forEach(c.bind(null,e)),c(e,D),c(e,t),c(e,E),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),a(e.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var i in x)e.prototype[i]||(e.prototype[i]=null);return e}var v=[],x={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},g={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)c(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=o({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=o({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=p(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=o({},t.propTypes,e)},statics:function(t,e){h(t,e)},autobind:function(){}},D={componentDidMount:function(){this.__isMounted=!0}},E={componentWillUnmount:function(){this.__isMounted=!1}},A={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e)},isMounted:function(){return!!this.__isMounted}},S=function(){};return o(S.prototype,t.prototype,A),y}var o=n(35),s=n(109),a=n(15),u="mixins";t.exports=i},function(t,e,n){!function(e,n){t.exports=n()}(0,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t,e,n){var r=null,i=function(t,e){n&&n(t,e),r&&r.visit(t,e)},o="function"==typeof n?i:null,s=!1;if(e){s="boolean"==typeof e.comment&&e.comment;var h="boolean"==typeof e.attachComment&&e.attachComment;(s||h)&&(r=new a.CommentHandler,r.attach=h,e.comment=!0,o=i)}var l=!1;e&&"string"==typeof e.sourceType&&(l="module"===e.sourceType);var p;p=e&&"boolean"==typeof e.jsx&&e.jsx?new u.JSXParser(t,e,o):new c.Parser(t,e,o);var f=l?p.parseModule():p.parseScript(),d=f;return s&&r&&(d.comments=r.comments),p.config.tokens&&(d.tokens=p.tokens),p.config.tolerant&&(d.errors=p.errorHandler.errors),d}function i(t,e,n){var i=e||{};return i.sourceType="module",r(t,i,n)}function o(t,e,n){var i=e||{};return i.sourceType="script",r(t,i,n)}function s(t,e,n){var r,i=new h.Tokenizer(t,e);r=[];try{for(;;){var o=i.getNextToken();if(!o)break;n&&(o=n(o)),r.push(o)}}catch(t){i.errorHandler.tolerate(t)}return i.errorHandler.tolerant&&(r.errors=i.errors()),r}Object.defineProperty(e,"__esModule",{value:!0});var a=n(1),u=n(3),c=n(8),h=n(15);e.parse=r,e.parseModule=i,e.parseScript=o,e.tokenize=s;var l=n(2);e.Syntax=l.Syntax,e.version="4.0.0"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=function(){function t(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return t.prototype.insertInnerComments=function(t,e){if(t.type===r.Syntax.BlockStatement&&0===t.body.length){for(var n=[],i=this.leading.length-1;i>=0;--i){var o=this.leading[i];e.end.offset>=o.start&&(n.unshift(o.comment),this.leading.splice(i,1),this.trailing.splice(i,1))}n.length&&(t.innerComments=n)}},t.prototype.findTrailingComments=function(t){var e=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var r=this.trailing[n];r.start>=t.end.offset&&e.unshift(r.comment)}return this.trailing.length=0,e}var i=this.stack[this.stack.length-1];if(i&&i.node.trailingComments){var o=i.node.trailingComments[0];o&&o.range[0]>=t.end.offset&&(e=i.node.trailingComments,delete i.node.trailingComments)}return e},t.prototype.findLeadingComments=function(t){for(var e,n=[];this.stack.length>0;){var r=this.stack[this.stack.length-1];if(!(r&&r.start>=t.start.offset))break;e=r.node,this.stack.pop()}if(e){for(var i=e.leadingComments?e.leadingComments.length:0,o=i-1;o>=0;--o){var s=e.leadingComments[o];s.range[1]<=t.start.offset&&(n.unshift(s),e.leadingComments.splice(o,1))}return e.leadingComments&&0===e.leadingComments.length&&delete e.leadingComments,n}for(var o=this.leading.length-1;o>=0;--o){var r=this.leading[o];r.start<=t.start.offset&&(n.unshift(r.comment),this.leading.splice(o,1))}return n},t.prototype.visitNode=function(t,e){if(!(t.type===r.Syntax.Program&&t.body.length>0)){this.insertInnerComments(t,e);var n=this.findTrailingComments(e),i=this.findLeadingComments(e);i.length>0&&(t.leadingComments=i),n.length>0&&(t.trailingComments=n),this.stack.push({node:t,start:e.start.offset})}},t.prototype.visitComment=function(t,e){var n="L"===t.type[0]?"Line":"Block",r={type:n,value:t.value};if(t.range&&(r.range=t.range),t.loc&&(r.loc=t.loc),this.comments.push(r),this.attach){var i={comment:{type:n,value:t.value,range:[e.start.offset,e.end.offset]},start:e.start.offset};t.loc&&(i.comment.loc=t.loc),t.type=n,this.leading.push(i),this.trailing.push(i)}},t.prototype.visit=function(t,e){"LineComment"===t.type?this.visitComment(t,e):"BlockComment"===t.type?this.visitComment(t,e):this.attach&&this.visitNode(t,e)},t}();e.CommentHandler=i},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(t,e,n){"use strict";function r(t){var e;switch(t.type){case a.JSXSyntax.JSXIdentifier:e=t.name;break;case a.JSXSyntax.JSXNamespacedName:var n=t;e=r(n.namespace)+":"+r(n.name);break;case a.JSXSyntax.JSXMemberExpression:var i=t;e=r(i.object)+"."+r(i.property)}return e}var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(4),s=n(5),a=n(6),u=n(7),c=n(8),h=n(13),l=n(14);h.TokenName[100]="JSXIdentifier",h.TokenName[101]="JSXText";var p=function(t){function e(e,n,r){return t.call(this,e,n,r)||this}return i(e,t),e.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():t.prototype.parsePrimaryExpression.call(this)},e.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},e.prototype.finishJSX=function(){this.nextToken()},e.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},e.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},e.prototype.scanXHTMLEntity=function(t){for(var e="&",n=!0,r=!1,i=!1,s=!1;!this.scanner.eof()&&n&&!r;){var a=this.scanner.source[this.scanner.index];if(a===t)break;if(r=";"===a,e+=a,++this.scanner.index,!r)switch(e.length){case 2:i="#"===a;break;case 3:i&&(s="x"===a,n=s||o.Character.isDecimalDigit(a.charCodeAt(0)),i=i&&!s);break;default:n=n&&!(i&&!o.Character.isDecimalDigit(a.charCodeAt(0))),n=n&&!(s&&!o.Character.isHexDigit(a.charCodeAt(0)))}}if(n&&r&&e.length>2){var u=e.substr(1,e.length-2);i&&u.length>1?e=String.fromCharCode(parseInt(u.substr(1),10)):s&&u.length>2?e=String.fromCharCode(parseInt("0"+u.substr(1),16)):i||s||!l.XHTMLEntities[u]||(e=l.XHTMLEntities[u])}return e},e.prototype.lexJSX=function(){var t=this.scanner.source.charCodeAt(this.scanner.index);if(60===t||62===t||47===t||58===t||61===t||123===t||125===t){var e=this.scanner.source[this.scanner.index++];return{type:7,value:e,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(34===t||39===t){for(var n=this.scanner.index,r=this.scanner.source[this.scanner.index++],i="";!this.scanner.eof();){var s=this.scanner.source[this.scanner.index++];if(s===r)break;i+="&"===s?this.scanXHTMLEntity(r):s}return{type:8,value:i,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(46===t){var a=this.scanner.source.charCodeAt(this.scanner.index+1),u=this.scanner.source.charCodeAt(this.scanner.index+2),e=46===a&&46===u?"...":".",n=this.scanner.index;return this.scanner.index+=e.length,{type:7,value:e,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(96===t)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(o.Character.isIdentifierStart(t)&&92!==t){var n=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var s=this.scanner.source.charCodeAt(this.scanner.index);if(o.Character.isIdentifierPart(s)&&92!==s)++this.scanner.index;else{if(45!==s)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(n,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}return this.scanner.lex()},e.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var t=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(t)),t},e.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var t=this.scanner.index,e="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,e+=n,o.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var r={type:101,value:e,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index};return e.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(r)),r},e.prototype.peekJSXToken=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.lexJSX();return this.scanner.restoreState(t),e},e.prototype.expectJSX=function(t){var e=this.nextJSXToken();7===e.type&&e.value===t||this.throwUnexpectedToken(e)},e.prototype.matchJSX=function(t){var e=this.peekJSXToken();return 7===e.type&&e.value===t},e.prototype.parseJSXIdentifier=function(){var t=this.createJSXNode(),e=this.nextJSXToken();return 100!==e.type&&this.throwUnexpectedToken(e),this.finalize(t,new s.JSXIdentifier(e.value))},e.prototype.parseJSXElementName=function(){var t=this.createJSXNode(),e=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=e;this.expectJSX(":");var r=this.parseJSXIdentifier();e=this.finalize(t,new s.JSXNamespacedName(n,r))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var i=e;this.expectJSX(".");var o=this.parseJSXIdentifier();e=this.finalize(t,new s.JSXMemberExpression(i,o))}return e},e.prototype.parseJSXAttributeName=function(){var t,e=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=n;this.expectJSX(":");var i=this.parseJSXIdentifier();t=this.finalize(e,new s.JSXNamespacedName(r,i))}else t=n;return t},e.prototype.parseJSXStringLiteralAttribute=function(){var t=this.createJSXNode(),e=this.nextJSXToken();8!==e.type&&this.throwUnexpectedToken(e);var n=this.getTokenRaw(e);return this.finalize(t,new u.Literal(e.value,n))},e.prototype.parseJSXExpressionAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new s.JSXExpressionContainer(e))},e.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},e.prototype.parseJSXNameValueAttribute=function(){var t=this.createJSXNode(),e=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(t,new s.JSXAttribute(e,n))},e.prototype.parseJSXSpreadAttribute=function(){var t=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var e=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(t,new s.JSXSpreadAttribute(e))},e.prototype.parseJSXAttributes=function(){for(var t=[];!this.matchJSX("/")&&!this.matchJSX(">");){var e=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();t.push(e)}return t},e.prototype.parseJSXOpeningElement=function(){var t=this.createJSXNode();this.expectJSX("<");var e=this.parseJSXElementName(),n=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new s.JSXOpeningElement(e,r,n))},e.prototype.parseJSXBoundaryElement=function(){var t=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var e=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(t,new s.JSXClosingElement(e))}var n=this.parseJSXElementName(),r=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(t,new s.JSXOpeningElement(n,i,r))},e.prototype.parseJSXEmptyExpression=function(){var t=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(t,new s.JSXEmptyExpression)},e.prototype.parseJSXExpressionContainer=function(){var t=this.createJSXNode();this.expectJSX("{");var e;return this.matchJSX("}")?(e=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),e=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(t,new s.JSXExpressionContainer(e))},e.prototype.parseJSXChildren=function(){for(var t=[];!this.scanner.eof();){var e=this.createJSXChildNode(),n=this.nextJSXText();if(n.start<n.end){var r=this.getTokenRaw(n),i=this.finalize(e,new s.JSXText(n.value,r));t.push(i)}if("{"!==this.scanner.source[this.scanner.index])break;var o=this.parseJSXExpressionContainer();t.push(o)}return t},e.prototype.parseComplexJSXElement=function(t){for(var e=[];!this.scanner.eof();){t.children=t.children.concat(this.parseJSXChildren());var n=this.createJSXChildNode(),i=this.parseJSXBoundaryElement();if(i.type===a.JSXSyntax.JSXOpeningElement){var o=i;if(o.selfClosing){var u=this.finalize(n,new s.JSXElement(o,[],null));t.children.push(u)}else e.push(t),t={node:n,opening:o,closing:null,children:[]}}if(i.type===a.JSXSyntax.JSXClosingElement){t.closing=i;var c=r(t.opening.name);if(c!==r(t.closing.name)&&this.tolerateError("Expected corresponding JSX closing tag for %0",c),!(e.length>0))break;var u=this.finalize(t.node,new s.JSXElement(t.opening,t.children,t.closing));t=e[e.length-1],t.children.push(u),e.pop()}}return t},e.prototype.parseJSXElement=function(){var t=this.createJSXNode(),e=this.parseJSXOpeningElement(),n=[],r=null;if(!e.selfClosing){var i=this.parseComplexJSXElement({node:t,opening:e,closing:r,children:n});n=i.children,r=i.closing}return this.finalize(t,new s.JSXElement(e,n,r))},e.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var t=this.parseJSXElement();return this.finishJSX(),t},e.prototype.isStartOfExpression=function(){return t.prototype.isStartOfExpression.call(this)||this.match("<")},e}(c.Parser);e.JSXParser=p},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};e.Character={fromCodePoint:function(t){return t<65536?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10))+String.fromCharCode(56320+(t-65536&1023))},isWhiteSpace:function(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0},isLineTerminator:function(t){return 10===t||13===t||8232===t||8233===t},isIdentifierStart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&n.NonAsciiIdentifierStart.test(e.Character.fromCodePoint(t))},isIdentifierPart:function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&n.NonAsciiIdentifierPart.test(e.Character.fromCodePoint(t))},isDecimalDigit:function(t){return t>=48&&t<=57},isHexDigit:function(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102},isOctalDigit:function(t){return t>=48&&t<=55}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),i=function(){function t(t){this.type=r.JSXSyntax.JSXClosingElement,this.name=t}return t}();e.JSXClosingElement=i;var o=function(){function t(t,e,n){this.type=r.JSXSyntax.JSXElement,this.openingElement=t,this.children=e,this.closingElement=n}return t}();e.JSXElement=o;var s=function(){function t(){this.type=r.JSXSyntax.JSXEmptyExpression}return t}();e.JSXEmptyExpression=s;var a=function(){function t(t){this.type=r.JSXSyntax.JSXExpressionContainer,this.expression=t}return t}();e.JSXExpressionContainer=a;var u=function(){function t(t){this.type=r.JSXSyntax.JSXIdentifier,this.name=t}return t}();e.JSXIdentifier=u;var c=function(){function t(t,e){this.type=r.JSXSyntax.JSXMemberExpression,this.object=t,this.property=e}return t}();e.JSXMemberExpression=c;var h=function(){function t(t,e){this.type=r.JSXSyntax.JSXAttribute,this.name=t,this.value=e}return t}();e.JSXAttribute=h;var l=function(){function t(t,e){this.type=r.JSXSyntax.JSXNamespacedName,this.namespace=t,this.name=e}return t}();e.JSXNamespacedName=l;var p=function(){function t(t,e,n){this.type=r.JSXSyntax.JSXOpeningElement,this.name=t,this.selfClosing=e,this.attributes=n}return t}();e.JSXOpeningElement=p;var f=function(){function t(t){this.type=r.JSXSyntax.JSXSpreadAttribute,this.argument=t}return t}();e.JSXSpreadAttribute=f;var d=function(){function t(t,e){this.type=r.JSXSyntax.JSXText,this.value=t,this.raw=e}return t}();e.JSXText=d},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=function(){function t(t){this.type=r.Syntax.ArrayExpression,this.elements=t}return t}();e.ArrayExpression=i;var o=function(){function t(t){this.type=r.Syntax.ArrayPattern,this.elements=t}return t}();e.ArrayPattern=o;var s=function(){function t(t,e,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!1}return t}();e.ArrowFunctionExpression=s;var a=function(){function t(t,e,n){this.type=r.Syntax.AssignmentExpression,this.operator=t,this.left=e,this.right=n}return t}();e.AssignmentExpression=a;var u=function(){function t(t,e){this.type=r.Syntax.AssignmentPattern,this.left=t,this.right=e}return t}();e.AssignmentPattern=u;var c=function(){function t(t,e,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=t,this.body=e,this.generator=!1,this.expression=n,this.async=!0}return t}();e.AsyncArrowFunctionExpression=c;var h=function(){function t(t,e,n){this.type=r.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}return t}();e.AsyncFunctionDeclaration=h;var l=function(){function t(t,e,n){this.type=r.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=!1,this.expression=!1,this.async=!0}return t}();e.AsyncFunctionExpression=l;var p=function(){function t(t){this.type=r.Syntax.AwaitExpression,this.argument=t}return t}();e.AwaitExpression=p;var f=function(){function t(t,e,n){var i="||"===t||"&&"===t;this.type=i?r.Syntax.LogicalExpression:r.Syntax.BinaryExpression,this.operator=t,this.left=e,this.right=n}return t}();e.BinaryExpression=f;var d=function(){function t(t){this.type=r.Syntax.BlockStatement,this.body=t}return t}();e.BlockStatement=d;var m=function(){function t(t){this.type=r.Syntax.BreakStatement,this.label=t}return t}();e.BreakStatement=m;var y=function(){function t(t,e){this.type=r.Syntax.CallExpression,this.callee=t,this.arguments=e}return t}();e.CallExpression=y;var v=function(){function t(t,e){this.type=r.Syntax.CatchClause,this.param=t,this.body=e}return t}();e.CatchClause=v;var x=function(){function t(t){this.type=r.Syntax.ClassBody,this.body=t}return t}();e.ClassBody=x;var g=function(){function t(t,e,n){this.type=r.Syntax.ClassDeclaration,this.id=t,this.superClass=e,this.body=n}return t}();e.ClassDeclaration=g;var D=function(){function t(t,e,n){this.type=r.Syntax.ClassExpression,this.id=t,this.superClass=e,this.body=n}return t}();e.ClassExpression=D;var E=function(){function t(t,e){this.type=r.Syntax.MemberExpression,this.computed=!0,this.object=t,this.property=e}return t}();e.ComputedMemberExpression=E;var A=function(){function t(t,e,n){this.type=r.Syntax.ConditionalExpression,this.test=t,this.consequent=e,this.alternate=n}return t}();e.ConditionalExpression=A;var S=function(){function t(t){this.type=r.Syntax.ContinueStatement,this.label=t}return t}();e.ContinueStatement=S;var w=function(){function t(){this.type=r.Syntax.DebuggerStatement}return t}();e.DebuggerStatement=w;var C=function(){function t(t,e){this.type=r.Syntax.ExpressionStatement,this.expression=t,this.directive=e}return t}();e.Directive=C;var _=function(){function t(t,e){this.type=r.Syntax.DoWhileStatement,this.body=t,this.test=e}return t}();e.DoWhileStatement=_;var b=function(){function t(){this.type=r.Syntax.EmptyStatement}return t}();e.EmptyStatement=b;var F=function(){function t(t){this.type=r.Syntax.ExportAllDeclaration,this.source=t}return t}();e.ExportAllDeclaration=F;var k=function(){function t(t){this.type=r.Syntax.ExportDefaultDeclaration,this.declaration=t}return t}();e.ExportDefaultDeclaration=k;var I=function(){function t(t,e,n){this.type=r.Syntax.ExportNamedDeclaration,this.declaration=t,this.specifiers=e,this.source=n}return t}();e.ExportNamedDeclaration=I;var T=function(){function t(t,e){this.type=r.Syntax.ExportSpecifier,this.exported=e,this.local=t}return t}();e.ExportSpecifier=T;var B=function(){function t(t){this.type=r.Syntax.ExpressionStatement,this.expression=t}return t}();e.ExpressionStatement=B;var M=function(){function t(t,e,n){this.type=r.Syntax.ForInStatement,this.left=t,this.right=e,this.body=n,this.each=!1}return t}();e.ForInStatement=M;var P=function(){function t(t,e,n){this.type=r.Syntax.ForOfStatement,this.left=t,this.right=e,this.body=n}return t}();e.ForOfStatement=P;var N=function(){function t(t,e,n,i){this.type=r.Syntax.ForStatement,this.init=t,this.test=e,this.update=n,this.body=i}return t}();e.ForStatement=N;var O=function(){function t(t,e,n,i){this.type=r.Syntax.FunctionDeclaration,this.id=t,this.params=e,this.body=n,this.generator=i,this.expression=!1,this.async=!1}return t}();e.FunctionDeclaration=O;var R=function(){function t(t,e,n,i){this.type=r.Syntax.FunctionExpression,this.id=t,this.params=e,this.body=n,this.generator=i,this.expression=!1,this.async=!1}return t}();e.FunctionExpression=R;var U=function(){function t(t){this.type=r.Syntax.Identifier,this.name=t}return t}();e.Identifier=U;var j=function(){function t(t,e,n){this.type=r.Syntax.IfStatement,this.test=t,this.consequent=e,this.alternate=n}return t}();e.IfStatement=j;var L=function(){function t(t,e){this.type=r.Syntax.ImportDeclaration,this.specifiers=t,this.source=e}return t}();e.ImportDeclaration=L;var z=function(){function t(t){this.type=r.Syntax.ImportDefaultSpecifier,this.local=t}return t}();e.ImportDefaultSpecifier=z;var J=function(){function t(t){this.type=r.Syntax.ImportNamespaceSpecifier,this.local=t}return t}();e.ImportNamespaceSpecifier=J;var X=function(){function t(t,e){this.type=r.Syntax.ImportSpecifier,this.local=t,this.imported=e}return t}();e.ImportSpecifier=X;var q=function(){function t(t,e){this.type=r.Syntax.LabeledStatement,this.label=t,this.body=e}return t}();e.LabeledStatement=q;var K=function(){function t(t,e){this.type=r.Syntax.Literal,this.value=t,this.raw=e}return t}();e.Literal=K;var Y=function(){function t(t,e){this.type=r.Syntax.MetaProperty,this.meta=t,this.property=e}return t}();e.MetaProperty=Y;var W=function(){function t(t,e,n,i,o){this.type=r.Syntax.MethodDefinition,this.key=t,this.computed=e,this.value=n,this.kind=i,this.static=o}return t}();e.MethodDefinition=W;var G=function(){function t(t){this.type=r.Syntax.Program,this.body=t,this.sourceType="module"}return t}();e.Module=G;var H=function(){function t(t,e){this.type=r.Syntax.NewExpression,this.callee=t,this.arguments=e}return t}();e.NewExpression=H;var V=function(){function t(t){this.type=r.Syntax.ObjectExpression,this.properties=t}return t}();e.ObjectExpression=V;var $=function(){function t(t){this.type=r.Syntax.ObjectPattern,this.properties=t}return t}();e.ObjectPattern=$;var Z=function(){function t(t,e,n,i,o,s){this.type=r.Syntax.Property,this.key=e,this.computed=n,this.value=i,this.kind=t,this.method=o,this.shorthand=s}return t}();e.Property=Z;var Q=function(){function t(t,e,n,i){this.type=r.Syntax.Literal,this.value=t,this.raw=e,this.regex={pattern:n,flags:i}}return t}();e.RegexLiteral=Q;var tt=function(){function t(t){this.type=r.Syntax.RestElement,this.argument=t}return t}();e.RestElement=tt;var et=function(){function t(t){this.type=r.Syntax.ReturnStatement,this.argument=t}return t}();e.ReturnStatement=et;var nt=function(){function t(t){this.type=r.Syntax.Program,this.body=t,this.sourceType="script"}return t}();e.Script=nt;var rt=function(){function t(t){this.type=r.Syntax.SequenceExpression,this.expressions=t}return t}();e.SequenceExpression=rt;var it=function(){function t(t){this.type=r.Syntax.SpreadElement,this.argument=t}return t}();e.SpreadElement=it;var ot=function(){function t(t,e){this.type=r.Syntax.MemberExpression,this.computed=!1,this.object=t,this.property=e}return t}();e.StaticMemberExpression=ot;var st=function(){function t(){this.type=r.Syntax.Super}return t}();e.Super=st;var at=function(){function t(t,e){this.type=r.Syntax.SwitchCase,this.test=t,this.consequent=e}return t}();e.SwitchCase=at;var ut=function(){function t(t,e){this.type=r.Syntax.SwitchStatement,this.discriminant=t,this.cases=e}return t}();e.SwitchStatement=ut;var ct=function(){function t(t,e){this.type=r.Syntax.TaggedTemplateExpression,this.tag=t,this.quasi=e}return t}();e.TaggedTemplateExpression=ct;var ht=function(){function t(t,e){this.type=r.Syntax.TemplateElement,this.value=t,this.tail=e}return t}();e.TemplateElement=ht;var lt=function(){function t(t,e){this.type=r.Syntax.TemplateLiteral,this.quasis=t,this.expressions=e}return t}();e.TemplateLiteral=lt;var pt=function(){function t(){this.type=r.Syntax.ThisExpression}return t}();e.ThisExpression=pt;var ft=function(){function t(t){this.type=r.Syntax.ThrowStatement,this.argument=t}return t}();e.ThrowStatement=ft;var dt=function(){function t(t,e,n){this.type=r.Syntax.TryStatement,this.block=t,this.handler=e,this.finalizer=n}return t}();e.TryStatement=dt;var mt=function(){function t(t,e){this.type=r.Syntax.UnaryExpression,this.operator=t,this.argument=e,this.prefix=!0}return t}();e.UnaryExpression=mt;var yt=function(){function t(t,e,n){this.type=r.Syntax.UpdateExpression,this.operator=t,this.argument=e,this.prefix=n}return t}();e.UpdateExpression=yt;var vt=function(){function t(t,e){this.type=r.Syntax.VariableDeclaration,this.declarations=t,this.kind=e}return t}();e.VariableDeclaration=vt;var xt=function(){function t(t,e){this.type=r.Syntax.VariableDeclarator,this.id=t,this.init=e}return t}();e.VariableDeclarator=xt;var gt=function(){function t(t,e){this.type=r.Syntax.WhileStatement,this.test=t,this.body=e}return t}();e.WhileStatement=gt;var Dt=function(){function t(t,e){this.type=r.Syntax.WithStatement,this.object=t,this.body=e}return t}();e.WithStatement=Dt;var Et=function(){function t(t,e){this.type=r.Syntax.YieldExpression,this.argument=t,this.delegate=e}return t}();e.YieldExpression=Et},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),i=n(10),o=n(11),s=n(7),a=n(12),u=n(2),c=n(13),h=function(){function t(t,e,n){void 0===e&&(e={}),this.config={range:"boolean"==typeof e.range&&e.range,loc:"boolean"==typeof e.loc&&e.loc,source:null,tokens:"boolean"==typeof e.tokens&&e.tokens,comment:"boolean"==typeof e.comment&&e.comment,tolerant:"boolean"==typeof e.tolerant&&e.tolerant},this.config.loc&&e.source&&null!==e.source&&(this.config.source=String(e.source)),this.delegate=n,this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new a.Scanner(t,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return t.prototype.throwError=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=Array.prototype.slice.call(arguments,1),o=t.replace(/%(\d)/g,function(t,e){return r.assert(e<i.length,"Message reference must be in range"),i[e]}),s=this.lastMarker.index,a=this.lastMarker.line,u=this.lastMarker.column+1;throw this.errorHandler.createError(s,a,u,o)},t.prototype.tolerateError=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=Array.prototype.slice.call(arguments,1),o=t.replace(/%(\d)/g,function(t,e){return r.assert(e<i.length,"Message reference must be in range"),i[e]}),s=this.lastMarker.index,a=this.scanner.lineNumber,u=this.lastMarker.column+1;this.errorHandler.tolerateError(s,a,u,o)},t.prototype.unexpectedTokenError=function(t,e){var n,r=e||o.Messages.UnexpectedToken;if(t?(e||(r=2===t.type?o.Messages.UnexpectedEOS:3===t.type?o.Messages.UnexpectedIdentifier:6===t.type?o.Messages.UnexpectedNumber:8===t.type?o.Messages.UnexpectedString:10===t.type?o.Messages.UnexpectedTemplate:o.Messages.UnexpectedToken,4===t.type&&(this.scanner.isFutureReservedWord(t.value)?r=o.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(t.value)&&(r=o.Messages.StrictReservedWord))),n=t.value):n="ILLEGAL",r=r.replace("%0",n),t&&"number"==typeof t.lineNumber){var i=t.start,s=t.lineNumber,a=this.lastMarker.index-this.lastMarker.column,u=t.start-a+1;return this.errorHandler.createError(i,s,u,r)}var i=this.lastMarker.index,s=this.lastMarker.line,u=this.lastMarker.column+1;return this.errorHandler.createError(i,s,u,r)},t.prototype.throwUnexpectedToken=function(t,e){throw this.unexpectedTokenError(t,e)},t.prototype.tolerateUnexpectedToken=function(t,e){this.errorHandler.tolerate(this.unexpectedTokenError(t,e))},t.prototype.collectComments=function(){if(this.config.comment){var t=this.scanner.scanComments();if(t.length>0&&this.delegate)for(var e=0;e<t.length;++e){var n=t[e],r=void 0;r={type:n.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(n.slice[0],n.slice[1])},this.config.range&&(r.range=n.range),this.config.loc&&(r.loc=n.loc);var i={start:{line:n.loc.start.line,column:n.loc.start.column,offset:n.range[0]},end:{line:n.loc.end.line,column:n.loc.end.column,offset:n.range[1]}};this.delegate(r,i)}}else this.scanner.scanComments()},t.prototype.getTokenRaw=function(t){return this.scanner.source.slice(t.start,t.end)},t.prototype.convertToken=function(t){var e={type:c.TokenName[t.type],value:this.getTokenRaw(t)};if(this.config.range&&(e.range=[t.start,t.end]),this.config.loc&&(e.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),9===t.type){var n=t.pattern,r=t.flags;e.regex={pattern:n,flags:r}}return e},t.prototype.nextToken=function(){var t=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var e=this.scanner.lex();return this.hasLineTerminator=t.lineNumber!==e.lineNumber,e&&this.context.strict&&3===e.type&&this.scanner.isStrictModeReservedWord(e.value)&&(e.type=4),this.lookahead=e,this.config.tokens&&2!==e.type&&this.tokens.push(this.convertToken(e)),t},t.prototype.nextRegexToken=function(){this.collectComments();var t=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(t))),this.lookahead=t,this.nextToken(),t},t.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},t.prototype.startNode=function(t){return{index:t.start,line:t.lineNumber,column:t.start-t.lineStart}},t.prototype.finalize=function(t,e){if(this.config.range&&(e.range=[t.index,this.lastMarker.index]),this.config.loc&&(e.loc={start:{line:t.line,column:t.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(e.loc.source=this.config.source)),this.delegate){var n={start:{line:t.line,column:t.column,offset:t.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(e,n)}return e},t.prototype.expect=function(t){var e=this.nextToken();7===e.type&&e.value===t||this.throwUnexpectedToken(e)},t.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var t=this.lookahead;7===t.type&&","===t.value?this.nextToken():7===t.type&&";"===t.value?(this.nextToken(),this.tolerateUnexpectedToken(t)):this.tolerateUnexpectedToken(t,o.Messages.UnexpectedToken)}else this.expect(",")},t.prototype.expectKeyword=function(t){var e=this.nextToken();4===e.type&&e.value===t||this.throwUnexpectedToken(e)},t.prototype.match=function(t){return 7===this.lookahead.type&&this.lookahead.value===t},t.prototype.matchKeyword=function(t){return 4===this.lookahead.type&&this.lookahead.value===t},t.prototype.matchContextualKeyword=function(t){return 3===this.lookahead.type&&this.lookahead.value===t},t.prototype.matchAssign=function(){if(7!==this.lookahead.type)return!1;var t=this.lookahead.value;return"="===t||"*="===t||"**="===t||"/="===t||"%="===t||"+="===t||"-="===t||"<<="===t||">>="===t||">>>="===t||"&="===t||"^="===t||"|="===t},t.prototype.isolateCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=t.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=e,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=r,i},t.prototype.inheritCoverGrammar=function(t){var e=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=t.call(this);return this.context.isBindingElement=this.context.isBindingElement&&e,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=r||this.context.firstCoverInitializedNameError,i},t.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},t.prototype.parsePrimaryExpression=function(){var t,e,n,r=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),t=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(r,new s.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,o.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(r,new s.Literal(e.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(r,new s.Literal("true"===e.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,e=this.nextToken(),n=this.getTokenRaw(e),t=this.finalize(r,new s.Literal(null,n));break;case 10:t=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,t=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":t=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":t=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,e=this.nextRegexToken(),n=this.getTokenRaw(e),t=this.finalize(r,new s.RegexLiteral(e.regex,n,e.pattern,e.flags));break;default:t=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?t=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?t=this.finalize(r,new s.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?t=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),t=this.finalize(r,new s.ThisExpression)):t=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:t=this.throwUnexpectedToken(this.nextToken())}return t},t.prototype.parseSpreadElement=function(){var t=this.createNode();this.expect("...");var e=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(t,new s.SpreadElement(e))},t.prototype.parseArrayInitializer=function(){var t=this.createNode(),e=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),e.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),e.push(n)}else e.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(t,new s.ArrayExpression(e))},t.prototype.parsePropertyMethod=function(t){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var e=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=t.simple;var r=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&t.firstRestricted&&this.tolerateUnexpectedToken(t.firstRestricted,t.message),this.context.strict&&t.stricted&&this.tolerateUnexpectedToken(t.stricted,t.message),this.context.strict=e,this.context.allowStrictDirective=n,r},t.prototype.parsePropertyMethodFunction=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters(),r=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new s.FunctionExpression(null,n.params,r,!1))},t.prototype.parsePropertyMethodAsyncFunction=function(){var t=this.createNode(),e=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var r=this.parseFormalParameters(),i=this.parsePropertyMethod(r);return this.context.allowYield=e,this.context.await=n,this.finalize(t,new s.AsyncFunctionExpression(null,r.params,i))},t.prototype.parseObjectPropertyKey=function(){var t,e=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,o.Messages.StrictOctalLiteral);var r=this.getTokenRaw(n);t=this.finalize(e,new s.Literal(n.value,r));break;case 3:case 1:case 5:case 4:t=this.finalize(e,new s.Identifier(n.value));break;case 7:"["===n.value?(t=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):t=this.throwUnexpectedToken(n);break;default:t=this.throwUnexpectedToken(n)}return t},t.prototype.isPropertyKey=function(t,e){return t.type===u.Syntax.Identifier&&t.name===e||t.type===u.Syntax.Literal&&t.value===e},t.prototype.parseObjectProperty=function(t){var e,n=this.createNode(),r=this.lookahead,i=null,a=null,u=!1,c=!1,h=!1,l=!1;if(3===r.type){var p=r.value;this.nextToken(),u=this.match("["),l=!(this.hasLineTerminator||"async"!==p||this.match(":")||this.match("(")||this.match("*")),i=l?this.parseObjectPropertyKey():this.finalize(n,new s.Identifier(p))}else this.match("*")?this.nextToken():(u=this.match("["),i=this.parseObjectPropertyKey());var f=this.qualifiedPropertyName(this.lookahead);if(3===r.type&&!l&&"get"===r.value&&f)e="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod();else if(3===r.type&&!l&&"set"===r.value&&f)e="set",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseSetterMethod();else if(7===r.type&&"*"===r.value&&f)e="init",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0;else if(i||this.throwUnexpectedToken(this.lookahead),e="init",this.match(":")&&!l)!u&&this.isPropertyKey(i,"__proto__")&&(t.value&&this.tolerateError(o.Messages.DuplicateProtoProperty),t.value=!0),this.nextToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))a=l?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0;else if(3===r.type){var p=this.finalize(n,new s.Identifier(r.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),h=!0;var d=this.isolateCoverGrammar(this.parseAssignmentExpression);a=this.finalize(n,new s.AssignmentPattern(p,d))}else h=!0,a=p}else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new s.Property(e,i,u,a,c,h))},t.prototype.parseObjectInitializer=function(){var t=this.createNode();this.expect("{");for(var e=[],n={value:!1};!this.match("}");)e.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(t,new s.ObjectExpression(e))},t.prototype.parseTemplateHead=function(){r.assert(this.lookahead.head,"Template literal must start with a template head");var t=this.createNode(),e=this.nextToken(),n=e.value,i=e.cooked;return this.finalize(t,new s.TemplateElement({raw:n,cooked:i},e.tail))},t.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var t=this.createNode(),e=this.nextToken(),n=e.value,r=e.cooked;return this.finalize(t,new s.TemplateElement({raw:n,cooked:r},e.tail))},t.prototype.parseTemplateLiteral=function(){var t=this.createNode(),e=[],n=[],r=this.parseTemplateHead();for(n.push(r);!r.tail;)e.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize(t,new s.TemplateLiteral(n,e))},t.prototype.reinterpretExpressionAsPattern=function(t){switch(t.type){case u.Syntax.Identifier:case u.Syntax.MemberExpression:case u.Syntax.RestElement:case u.Syntax.AssignmentPattern:break;case u.Syntax.SpreadElement:t.type=u.Syntax.RestElement,this.reinterpretExpressionAsPattern(t.argument);break;case u.Syntax.ArrayExpression:t.type=u.Syntax.ArrayPattern;for(var e=0;e<t.elements.length;e++)null!==t.elements[e]&&this.reinterpretExpressionAsPattern(t.elements[e]);break;case u.Syntax.ObjectExpression:t.type=u.Syntax.ObjectPattern;for(var e=0;e<t.properties.length;e++)this.reinterpretExpressionAsPattern(t.properties[e].value);break;case u.Syntax.AssignmentExpression:t.type=u.Syntax.AssignmentPattern,delete t.operator,this.reinterpretExpressionAsPattern(t.left)}},t.prototype.parseGroupExpression=function(){var t;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),t={type:"ArrowParameterPlaceHolder",params:[],async:!1};else{var e=this.lookahead,n=[];if(this.match("..."))t=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),t={type:"ArrowParameterPlaceHolder",params:[t],async:!1};else{var r=!1;if(this.context.isBindingElement=!0,t=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var i=[];for(this.context.isAssignmentTarget=!1,i.push(t);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var o=0;o<i.length;o++)this.reinterpretExpressionAsPattern(i[o]);r=!0,t={type:"ArrowParameterPlaceHolder",params:i,async:!1}}else if(this.match("...")){this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),i.push(this.parseRestElement(n)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1;for(var o=0;o<i.length;o++)this.reinterpretExpressionAsPattern(i[o]);r=!0,t={type:"ArrowParameterPlaceHolder",params:i,async:!1}}else i.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(r)break}r||(t=this.finalize(this.startNode(e),new s.SequenceExpression(i)))}if(!r){if(this.expect(")"),this.match("=>")&&(t.type===u.Syntax.Identifier&&"yield"===t.name&&(r=!0,t={type:"ArrowParameterPlaceHolder",params:[t],async:!1}),!r)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),t.type===u.Syntax.SequenceExpression)for(var o=0;o<t.expressions.length;o++)this.reinterpretExpressionAsPattern(t.expressions[o]);else this.reinterpretExpressionAsPattern(t);t={type:"ArrowParameterPlaceHolder",params:t.type===u.Syntax.SequenceExpression?t.expressions:[t],async:!1}}this.context.isBindingElement=!1}}}return t},t.prototype.parseArguments=function(){this.expect("(");var t=[];if(!this.match(")"))for(;;){var e=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(t.push(e),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),t},t.prototype.isIdentifierName=function(t){return 3===t.type||4===t.type||1===t.type||5===t.type},t.prototype.parseIdentifierName=function(){var t=this.createNode(),e=this.nextToken();return this.isIdentifierName(e)||this.throwUnexpectedToken(e),this.finalize(t,new s.Identifier(e.value))},t.prototype.parseNewExpression=function(){var t=this.createNode(),e=this.parseIdentifierName();r.assert("new"===e.name,"New expression must start with `new`");var n;if(this.match("."))if(this.nextToken(),3===this.lookahead.type&&this.context.inFunctionBody&&"target"===this.lookahead.value){var i=this.parseIdentifierName();n=new s.MetaProperty(e,i)}else this.throwUnexpectedToken(this.lookahead);else{var o=this.isolateCoverGrammar(this.parseLeftHandSideExpression),a=this.match("(")?this.parseArguments():[];n=new s.NewExpression(o,a),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(t,n)},t.prototype.parseAsyncArgument=function(){var t=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,t},t.prototype.parseAsyncArguments=function(){this.expect("(");var t=[];if(!this.match(")"))for(;;){var e=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(t.push(e),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),t},t.prototype.parseLeftHandSideExpressionAllowCall=function(){var t=this.lookahead,e=this.matchContextualKeyword("async"),n=this.context.allowIn;this.context.allowIn=!0;var r;for(this.matchKeyword("super")&&this.context.inFunctionBody?(r=this.createNode(),this.nextToken(),r=this.finalize(r,new s.Super),this.match("(")||this.match(".")||this.match("[")||this.throwUnexpectedToken(this.lookahead)):r=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var i=this.parseIdentifierName();r=this.finalize(this.startNode(t),new s.StaticMemberExpression(r,i))}else if(this.match("(")){var o=e&&t.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var a=o?this.parseAsyncArguments():this.parseArguments();if(r=this.finalize(this.startNode(t),new s.CallExpression(r,a)),o&&this.match("=>")){for(var u=0;u<a.length;++u)this.reinterpretExpressionAsPattern(a[u]);r={type:"ArrowParameterPlaceHolder",params:a,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var i=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),r=this.finalize(this.startNode(t),new s.ComputedMemberExpression(r,i))}else{if(10!==this.lookahead.type||!this.lookahead.head)break;var c=this.parseTemplateLiteral();r=this.finalize(this.startNode(t),new s.TaggedTemplateExpression(r,c))}return this.context.allowIn=n,r},t.prototype.parseSuper=function(){var t=this.createNode();return this.expectKeyword("super"),this.match("[")||this.match(".")||this.throwUnexpectedToken(this.lookahead),this.finalize(t,new s.Super)},t.prototype.parseLeftHandSideExpression=function(){r.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var t=this.startNode(this.lookahead),e=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var n=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),e=this.finalize(t,new s.ComputedMemberExpression(e,n))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var n=this.parseIdentifierName();e=this.finalize(t,new s.StaticMemberExpression(e,n))}else{if(10!==this.lookahead.type||!this.lookahead.head)break;var i=this.parseTemplateLiteral();e=this.finalize(t,new s.TaggedTemplateExpression(e,i))}return e},t.prototype.parseUpdateExpression=function(){var t,e=this.lookahead;if(this.match("++")||this.match("--")){var n=this.startNode(e),r=this.nextToken();t=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&t.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(t.name)&&this.tolerateError(o.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment);var i=!0;t=this.finalize(n,new s.UpdateExpression(r.value,t,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(t=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&7===this.lookahead.type&&(this.match("++")||this.match("--"))){this.context.strict&&t.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(t.name)&&this.tolerateError(o.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var a=this.nextToken().value,i=!1;t=this.finalize(this.startNode(e),new s.UpdateExpression(a,t,i))}return t},t.prototype.parseAwaitExpression=function(){var t=this.createNode();this.nextToken();var e=this.parseUnaryExpression();return this.finalize(t,new s.AwaitExpression(e))},t.prototype.parseUnaryExpression=function(){var t;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var e=this.startNode(this.lookahead),n=this.nextToken();t=this.inheritCoverGrammar(this.parseUnaryExpression),t=this.finalize(e,new s.UnaryExpression(n.value,t)),this.context.strict&&"delete"===t.operator&&t.argument.type===u.Syntax.Identifier&&this.tolerateError(o.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else t=this.context.await&&this.matchContextualKeyword("await")?this.parseAwaitExpression():this.parseUpdateExpression();return t},t.prototype.parseExponentiationExpression=function(){var t=this.lookahead,e=this.inheritCoverGrammar(this.parseUnaryExpression);if(e.type!==u.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var n=e,r=this.isolateCoverGrammar(this.parseExponentiationExpression);e=this.finalize(this.startNode(t),new s.BinaryExpression("**",n,r))}return e},t.prototype.binaryPrecedence=function(t){var e=t.value;return 7===t.type?this.operatorPrecedence[e]||0:4===t.type&&("instanceof"===e||this.context.allowIn&&"in"===e)?7:0},t.prototype.parseBinaryExpression=function(){var t=this.lookahead,e=this.inheritCoverGrammar(this.parseExponentiationExpression),n=this.lookahead,r=this.binaryPrecedence(n);if(r>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var i=[t,this.lookahead],o=e,a=this.isolateCoverGrammar(this.parseExponentiationExpression),u=[o,n.value,a],c=[r];;){if((r=this.binaryPrecedence(this.lookahead))<=0)break;for(;u.length>2&&r<=c[c.length-1];){a=u.pop();var h=u.pop();c.pop(),o=u.pop(),i.pop();var l=this.startNode(i[i.length-1]);u.push(this.finalize(l,new s.BinaryExpression(h,o,a)))}u.push(this.nextToken().value),c.push(r),i.push(this.lookahead),u.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var p=u.length-1;for(e=u[p],i.pop();p>1;){var l=this.startNode(i.pop()),h=u[p-1];e=this.finalize(l,new s.BinaryExpression(h,u[p-2],e)),p-=2}}return e},t.prototype.parseConditionalExpression=function(){var t=this.lookahead,e=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var r=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var i=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new s.ConditionalExpression(e,r,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return e},t.prototype.checkPatternParam=function(t,e){switch(e.type){case u.Syntax.Identifier:this.validateParam(t,e,e.name);break;case u.Syntax.RestElement:this.checkPatternParam(t,e.argument);break;case u.Syntax.AssignmentPattern:this.checkPatternParam(t,e.left);break;case u.Syntax.ArrayPattern:for(var n=0;n<e.elements.length;n++)null!==e.elements[n]&&this.checkPatternParam(t,e.elements[n]);break;case u.Syntax.ObjectPattern:for(var n=0;n<e.properties.length;n++)this.checkPatternParam(t,e.properties[n].value)}t.simple=t.simple&&e instanceof s.Identifier},t.prototype.reinterpretAsCoverFormalsList=function(t){var e,n=[t],r=!1;switch(t.type){case u.Syntax.Identifier:break;case"ArrowParameterPlaceHolder":n=t.params,r=t.async;break;default:return null}e={simple:!0,paramSet:{}};for(var i=0;i<n.length;++i){var s=n[i];s.type===u.Syntax.AssignmentPattern?s.right.type===u.Syntax.YieldExpression&&(s.right.argument&&this.throwUnexpectedToken(this.lookahead),s.right.type=u.Syntax.Identifier,s.right.name="yield",delete s.right.argument,delete s.right.delegate):r&&s.type===u.Syntax.Identifier&&"await"===s.name&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(e,s),n[i]=s}if(this.context.strict||!this.context.allowYield)for(var i=0;i<n.length;++i){var s=n[i];s.type===u.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(e.message===o.Messages.StrictParamDupe){var a=this.context.strict?e.stricted:e.firstRestricted;this.throwUnexpectedToken(a,e.message)}return{simple:e.simple,params:n,stricted:e.stricted,firstRestricted:e.firstRestricted,message:e.message}},t.prototype.parseAssignmentExpression=function(){var t;if(!this.context.allowYield&&this.matchKeyword("yield"))t=this.parseYieldExpression();else{var e=this.lookahead,n=e;if(t=this.parseConditionalExpression(),3===n.type&&n.lineNumber===this.lookahead.lineNumber&&"async"===n.value&&(3===this.lookahead.type||this.matchKeyword("yield"))){var r=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(r),t={type:"ArrowParameterPlaceHolder",params:[r],async:!0}}if("ArrowParameterPlaceHolder"===t.type||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var i=t.async,a=this.reinterpretAsCoverFormalsList(t);if(a){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var c=this.context.strict,h=this.context.allowStrictDirective;this.context.allowStrictDirective=a.simple;var l=this.context.allowYield,p=this.context.await;this.context.allowYield=!0,this.context.await=i;var f=this.startNode(e);this.expect("=>");var d=void 0;if(this.match("{")){var m=this.context.allowIn;this.context.allowIn=!0,d=this.parseFunctionSourceElements(),this.context.allowIn=m}else d=this.isolateCoverGrammar(this.parseAssignmentExpression);var y=d.type!==u.Syntax.BlockStatement;this.context.strict&&a.firstRestricted&&this.throwUnexpectedToken(a.firstRestricted,a.message),this.context.strict&&a.stricted&&this.tolerateUnexpectedToken(a.stricted,a.message),t=i?this.finalize(f,new s.AsyncArrowFunctionExpression(a.params,d,y)):this.finalize(f,new s.ArrowFunctionExpression(a.params,d,y)),this.context.strict=c,this.context.allowStrictDirective=h,this.context.allowYield=l,this.context.await=p}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(o.Messages.InvalidLHSInAssignment),this.context.strict&&t.type===u.Syntax.Identifier){var v=t;this.scanner.isRestrictedWord(v.name)&&this.tolerateUnexpectedToken(n,o.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(v.name)&&this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(t):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),n=this.nextToken();var x=n.value,g=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new s.AssignmentExpression(x,t,g)),this.context.firstCoverInitializedNameError=null}}return t},t.prototype.parseExpression=function(){var t=this.lookahead,e=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(e);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));e=this.finalize(this.startNode(t),new s.SequenceExpression(n))}return e},t.prototype.parseStatementListItem=function(){var t;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalExportDeclaration),t=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,o.Messages.IllegalImportDeclaration),t=this.parseImportDeclaration();break;case"const":t=this.parseLexicalDeclaration({inFor:!1});break;case"function":t=this.parseFunctionDeclaration();break;case"class":t=this.parseClassDeclaration();break;case"let":t=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:t=this.parseStatement()}else t=this.parseStatement();return t},t.prototype.parseBlock=function(){var t=this.createNode();this.expect("{");for(var e=[];;){if(this.match("}"))break;e.push(this.parseStatementListItem())}return this.expect("}"),this.finalize(t,new s.BlockStatement(e))},t.prototype.parseLexicalBinding=function(t,e){var n=this.createNode(),r=[],i=this.parsePattern(r,t);this.context.strict&&i.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(i.name)&&this.tolerateError(o.Messages.StrictVarName);var a=null;return"const"===t?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),a=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(o.Messages.DeclarationMissingInitializer,"const")):(!e.inFor&&i.type!==u.Syntax.Identifier||this.match("="))&&(this.expect("="),a=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new s.VariableDeclarator(i,a))},t.prototype.parseBindingList=function(t,e){for(var n=[this.parseLexicalBinding(t,e)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(t,e));return n},t.prototype.isLexicalDeclaration=function(){var t=this.scanner.saveState();this.scanner.scanComments();var e=this.scanner.lex();return this.scanner.restoreState(t),3===e.type||7===e.type&&"["===e.value||7===e.type&&"{"===e.value||4===e.type&&"let"===e.value||4===e.type&&"yield"===e.value},t.prototype.parseLexicalDeclaration=function(t){var e=this.createNode(),n=this.nextToken().value;r.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var i=this.parseBindingList(n,t);return this.consumeSemicolon(),this.finalize(e,new s.VariableDeclaration(i,n))},t.prototype.parseBindingRestElement=function(t,e){var n=this.createNode();this.expect("...");var r=this.parsePattern(t,e);return this.finalize(n,new s.RestElement(r))},t.prototype.parseArrayPattern=function(t,e){var n=this.createNode();this.expect("[");for(var r=[];!this.match("]");)if(this.match(","))this.nextToken(),r.push(null);else{if(this.match("...")){r.push(this.parseBindingRestElement(t,e));break}r.push(this.parsePatternWithDefault(t,e)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new s.ArrayPattern(r))},t.prototype.parsePropertyPattern=function(t,e){var n,r,i=this.createNode(),o=!1,a=!1;if(3===this.lookahead.type){var u=this.lookahead;n=this.parseVariableIdentifier();var c=this.finalize(i,new s.Identifier(u.value));if(this.match("=")){t.push(u),a=!0,this.nextToken();var h=this.parseAssignmentExpression();r=this.finalize(this.startNode(u),new s.AssignmentPattern(c,h))}else this.match(":")?(this.expect(":"),r=this.parsePatternWithDefault(t,e)):(t.push(u),a=!0,r=c)}else o=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),r=this.parsePatternWithDefault(t,e);return this.finalize(i,new s.Property("init",n,o,r,!1,a))},t.prototype.parseObjectPattern=function(t,e){var n=this.createNode(),r=[];for(this.expect("{");!this.match("}");)r.push(this.parsePropertyPattern(t,e)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new s.ObjectPattern(r))},t.prototype.parsePattern=function(t,e){var n;return this.match("[")?n=this.parseArrayPattern(t,e):this.match("{")?n=this.parseObjectPattern(t,e):(!this.matchKeyword("let")||"const"!==e&&"let"!==e||this.tolerateUnexpectedToken(this.lookahead,o.Messages.LetInLexicalBinding),t.push(this.lookahead),n=this.parseVariableIdentifier(e)),n},t.prototype.parsePatternWithDefault=function(t,e){var n=this.lookahead,r=this.parsePattern(t,e);if(this.match("=")){this.nextToken();var i=this.context.allowYield;this.context.allowYield=!0;var o=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=i,r=this.finalize(this.startNode(n),new s.AssignmentPattern(r,o))}return r},t.prototype.parseVariableIdentifier=function(t){var e=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,o.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==t)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(e,new s.Identifier(n.value))},t.prototype.parseVariableDeclaration=function(t){var e=this.createNode(),n=[],r=this.parsePattern(n,"var");this.context.strict&&r.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(r.name)&&this.tolerateError(o.Messages.StrictVarName);var i=null;return this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):r.type===u.Syntax.Identifier||t.inFor||this.expect("="),this.finalize(e,new s.VariableDeclarator(r,i))},t.prototype.parseVariableDeclarationList=function(t){var e={inFor:t.inFor},n=[];for(n.push(this.parseVariableDeclaration(e));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(e));return n},t.prototype.parseVariableStatement=function(){var t=this.createNode();this.expectKeyword("var");var e=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(t,new s.VariableDeclaration(e,"var"))},t.prototype.parseEmptyStatement=function(){var t=this.createNode();return this.expect(";"),this.finalize(t,new s.EmptyStatement)},t.prototype.parseExpressionStatement=function(){var t=this.createNode(),e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new s.ExpressionStatement(e))},t.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(o.Messages.StrictFunction),this.parseStatement()},t.prototype.parseIfStatement=function(){var t,e=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new s.EmptyStatement)):(this.expect(")"),t=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(e,new s.IfStatement(r,t,n))},t.prototype.parseDoWhileStatement=function(){var t=this.createNode();this.expectKeyword("do");var e=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=e,this.expectKeyword("while"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(t,new s.DoWhileStatement(n,r))},t.prototype.parseWhileStatement=function(){var t,e=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new s.EmptyStatement);else{this.expect(")");var r=this.context.inIteration;this.context.inIteration=!0,t=this.parseStatement(),this.context.inIteration=r}return this.finalize(e,new s.WhileStatement(n,t))},t.prototype.parseForStatement=function(){var t,e,n=null,r=null,i=null,a=!0,c=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){n=this.createNode(),this.nextToken();var h=this.context.allowIn;this.context.allowIn=!1;var l=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=h,1===l.length&&this.matchKeyword("in")){var p=l[0];p.init&&(p.id.type===u.Syntax.ArrayPattern||p.id.type===u.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(o.Messages.ForInOfLoopInitializer,"for-in"),n=this.finalize(n,new s.VariableDeclaration(l,"var")),this.nextToken(),t=n,e=this.parseExpression(),n=null}else 1===l.length&&null===l[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new s.VariableDeclaration(l,"var")),this.nextToken(),t=n,e=this.parseAssignmentExpression(),n=null,a=!1):(n=this.finalize(n,new s.VariableDeclaration(l,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){n=this.createNode();var f=this.nextToken().value;if(this.context.strict||"in"!==this.lookahead.value){var h=this.context.allowIn;this.context.allowIn=!1;var l=this.parseBindingList(f,{inFor:!0});this.context.allowIn=h,1===l.length&&null===l[0].init&&this.matchKeyword("in")?(n=this.finalize(n,new s.VariableDeclaration(l,f)),this.nextToken(),t=n,e=this.parseExpression(),n=null):1===l.length&&null===l[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new s.VariableDeclaration(l,f)),this.nextToken(),t=n,e=this.parseAssignmentExpression(),n=null,a=!1):(this.consumeSemicolon(),n=this.finalize(n,new s.VariableDeclaration(l,f)))}else n=this.finalize(n,new s.Identifier(f)),this.nextToken(),t=n,e=this.parseExpression(),n=null}else{var d=this.lookahead,h=this.context.allowIn;if(this.context.allowIn=!1,n=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=h,this.matchKeyword("in"))this.context.isAssignmentTarget&&n.type!==u.Syntax.AssignmentExpression||this.tolerateError(o.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(n),t=n,e=this.parseExpression(),n=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&n.type!==u.Syntax.AssignmentExpression||this.tolerateError(o.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(n),t=n,e=this.parseAssignmentExpression(),n=null,a=!1;else{if(this.match(",")){for(var m=[n];this.match(",");)this.nextToken(),m.push(this.isolateCoverGrammar(this.parseAssignmentExpression));n=this.finalize(this.startNode(d),new s.SequenceExpression(m))}this.expect(";")}}void 0===t&&(this.match(";")||(r=this.parseExpression()),this.expect(";"),this.match(")")||(i=this.parseExpression()));var y;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),y=this.finalize(this.createNode(),new s.EmptyStatement);else{this.expect(")");var v=this.context.inIteration;this.context.inIteration=!0,y=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=v}return void 0===t?this.finalize(c,new s.ForStatement(n,r,i,y)):a?this.finalize(c,new s.ForInStatement(t,e,y)):this.finalize(c,new s.ForOfStatement(t,e,y))},t.prototype.parseContinueStatement=function(){var t=this.createNode();this.expectKeyword("continue");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();e=n;var r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(o.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.throwError(o.Messages.IllegalContinue),this.finalize(t,new s.ContinueStatement(e))},t.prototype.parseBreakStatement=function(){var t=this.createNode();this.expectKeyword("break");var e=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier(),r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(o.Messages.UnknownLabel,n.name),e=n}return this.consumeSemicolon(),null!==e||this.context.inIteration||this.context.inSwitch||this.throwError(o.Messages.IllegalBreak),this.finalize(t,new s.BreakStatement(e))},t.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(o.Messages.IllegalReturn);var t=this.createNode();this.expectKeyword("return");var e=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&2!==this.lookahead.type,n=e?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(t,new s.ReturnStatement(n))},t.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(o.Messages.StrictModeWith);var t,e=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),t=this.finalize(this.createNode(),new s.EmptyStatement)):(this.expect(")"),t=this.parseStatement()),this.finalize(e,new s.WithStatement(n,t))},t.prototype.parseSwitchCase=function(){var t,e=this.createNode();this.matchKeyword("default")?(this.nextToken(),t=null):(this.expectKeyword("case"),t=this.parseExpression()),this.expect(":");for(var n=[];;){if(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"))break;n.push(this.parseStatementListItem())}return this.finalize(e,new s.SwitchCase(t,n))},t.prototype.parseSwitchStatement=function(){var t=this.createNode();this.expectKeyword("switch"),this.expect("(");var e=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var r=[],i=!1;for(this.expect("{");;){if(this.match("}"))break;var a=this.parseSwitchCase();null===a.test&&(i&&this.throwError(o.Messages.MultipleDefaultsInSwitch),i=!0),r.push(a)}return this.expect("}"),this.context.inSwitch=n,this.finalize(t,new s.SwitchStatement(e,r))},t.prototype.parseLabelledStatement=function(){var t,e=this.createNode(),n=this.parseExpression();if(n.type===u.Syntax.Identifier&&this.match(":")){this.nextToken();var r=n,i="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,i)&&this.throwError(o.Messages.Redeclaration,"Label",r.name),this.context.labelSet[i]=!0;var a=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),a=this.parseClassDeclaration();else if(this.matchKeyword("function")){var c=this.lookahead,h=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(c,o.Messages.StrictFunction):h.generator&&this.tolerateUnexpectedToken(c,o.Messages.GeneratorInLegacyContext),a=h}else a=this.parseStatement();delete this.context.labelSet[i],t=new s.LabeledStatement(r,a)}else this.consumeSemicolon(),t=new s.ExpressionStatement(n);return this.finalize(e,t)},t.prototype.parseThrowStatement=function(){var t=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(o.Messages.NewlineAfterThrow);var e=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new s.ThrowStatement(e))},t.prototype.parseCatchClause=function(){var t=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var e=[],n=this.parsePattern(e),r={},i=0;i<e.length;i++){var a="$"+e[i].value;Object.prototype.hasOwnProperty.call(r,a)&&this.tolerateError(o.Messages.DuplicateBinding,e[i].value),r[a]=!0}this.context.strict&&n.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(o.Messages.StrictCatchVariable),this.expect(")");var c=this.parseBlock();return this.finalize(t,new s.CatchClause(n,c))},t.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},t.prototype.parseTryStatement=function(){var t=this.createNode();this.expectKeyword("try");var e=this.parseBlock(),n=this.matchKeyword("catch")?this.parseCatchClause():null,r=this.matchKeyword("finally")?this.parseFinallyClause():null;return n||r||this.throwError(o.Messages.NoCatchOrFinally),this.finalize(t,new s.TryStatement(e,n,r))},t.prototype.parseDebuggerStatement=function(){var t=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(t,new s.DebuggerStatement)},t.prototype.parseStatement=function(){var t;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:t=this.parseExpressionStatement();break;case 7:var e=this.lookahead.value;t="{"===e?this.parseBlock():"("===e?this.parseExpressionStatement():";"===e?this.parseEmptyStatement():this.parseExpressionStatement();break;case 3:t=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":t=this.parseBreakStatement();break;case"continue":t=this.parseContinueStatement();break;case"debugger":t=this.parseDebuggerStatement();break;case"do":t=this.parseDoWhileStatement();break;case"for":t=this.parseForStatement();break;case"function":t=this.parseFunctionDeclaration();break;case"if":t=this.parseIfStatement();break;case"return":t=this.parseReturnStatement();break;case"switch":t=this.parseSwitchStatement();break;case"throw":t=this.parseThrowStatement();break;case"try":t=this.parseTryStatement();break;case"var":t=this.parseVariableStatement();break;case"while":t=this.parseWhileStatement();break;case"with":t=this.parseWithStatement();break;default:t=this.parseExpressionStatement()}break;default:t=this.throwUnexpectedToken(this.lookahead)}return t},t.prototype.parseFunctionSourceElements=function(){var t=this.createNode();this.expect("{");var e=this.parseDirectivePrologues(),n=this.context.labelSet,r=this.context.inIteration,i=this.context.inSwitch,o=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;2!==this.lookahead.type&&!this.match("}");)e.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=n,this.context.inIteration=r,this.context.inSwitch=i,this.context.inFunctionBody=o,this.finalize(t,new s.BlockStatement(e))},t.prototype.validateParam=function(t,e,n){var r="$"+n;this.context.strict?(this.scanner.isRestrictedWord(n)&&(t.stricted=e,t.message=o.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(t.paramSet,r)&&(t.stricted=e,t.message=o.Messages.StrictParamDupe)):t.firstRestricted||(this.scanner.isRestrictedWord(n)?(t.firstRestricted=e,t.message=o.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(n)?(t.firstRestricted=e,t.message=o.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(t.paramSet,r)&&(t.stricted=e,t.message=o.Messages.StrictParamDupe)),"function"==typeof Object.defineProperty?Object.defineProperty(t.paramSet,r,{value:!0,enumerable:!0,writable:!0,configurable:!0}):t.paramSet[r]=!0},t.prototype.parseRestElement=function(t){var e=this.createNode();this.expect("...");var n=this.parsePattern(t);return this.match("=")&&this.throwError(o.Messages.DefaultRestParameter),this.match(")")||this.throwError(o.Messages.ParameterAfterRestParameter),this.finalize(e,new s.RestElement(n))},t.prototype.parseFormalParameter=function(t){for(var e=[],n=this.match("...")?this.parseRestElement(e):this.parsePatternWithDefault(e),r=0;r<e.length;r++)this.validateParam(t,e[r],e[r].value);t.simple=t.simple&&n instanceof s.Identifier,t.params.push(n)},t.prototype.parseFormalParameters=function(t){var e;if(e={simple:!0,params:[],firstRestricted:t},this.expect("("),!this.match(")"))for(e.paramSet={};2!==this.lookahead.type&&(this.parseFormalParameter(e),!this.match(")"))&&(this.expect(","),!this.match(")")););return this.expect(")"),{simple:e.simple,params:e.params,stricted:e.stricted,firstRestricted:e.firstRestricted,message:e.message}},t.prototype.matchAsyncFunction=function(){var t=this.matchContextualKeyword("async");if(t){var e=this.scanner.saveState();this.scanner.scanComments();var n=this.scanner.lex();this.scanner.restoreState(e),t=e.lineNumber===n.lineNumber&&4===n.type&&"function"===n.value}return t},t.prototype.parseFunctionDeclaration=function(t){var e=this.createNode(),n=this.matchContextualKeyword("async");n&&this.nextToken(),this.expectKeyword("function");var r=!n&&this.match("*");r&&this.nextToken();var i,a=null,u=null;if(!t||!this.match("(")){var c=this.lookahead;a=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(c.value)&&this.tolerateUnexpectedToken(c,o.Messages.StrictFunctionName):this.scanner.isRestrictedWord(c.value)?(u=c,i=o.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(c.value)&&(u=c,i=o.Messages.StrictReservedWord)}var h=this.context.await,l=this.context.allowYield;this.context.await=n,this.context.allowYield=!r;var p=this.parseFormalParameters(u),f=p.params,d=p.stricted;u=p.firstRestricted,p.message&&(i=p.message);var m=this.context.strict,y=this.context.allowStrictDirective;this.context.allowStrictDirective=p.simple;var v=this.parseFunctionSourceElements();return this.context.strict&&u&&this.throwUnexpectedToken(u,i),this.context.strict&&d&&this.tolerateUnexpectedToken(d,i),this.context.strict=m,this.context.allowStrictDirective=y,this.context.await=h,this.context.allowYield=l,n?this.finalize(e,new s.AsyncFunctionDeclaration(a,f,v)):this.finalize(e,new s.FunctionDeclaration(a,f,v,r))},t.prototype.parseFunctionExpression=function(){var t=this.createNode(),e=this.matchContextualKeyword("async");e&&this.nextToken(),this.expectKeyword("function");var n=!e&&this.match("*");n&&this.nextToken();var r,i,a=null,u=this.context.await,c=this.context.allowYield;if(this.context.await=e,this.context.allowYield=!n,!this.match("(")){var h=this.lookahead;a=this.context.strict||n||!this.matchKeyword("yield")?this.parseVariableIdentifier():this.parseIdentifierName(),this.context.strict?this.scanner.isRestrictedWord(h.value)&&this.tolerateUnexpectedToken(h,o.Messages.StrictFunctionName):this.scanner.isRestrictedWord(h.value)?(i=h,r=o.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(h.value)&&(i=h,r=o.Messages.StrictReservedWord)}var l=this.parseFormalParameters(i),p=l.params,f=l.stricted;i=l.firstRestricted,l.message&&(r=l.message);var d=this.context.strict,m=this.context.allowStrictDirective;this.context.allowStrictDirective=l.simple;var y=this.parseFunctionSourceElements();return this.context.strict&&i&&this.throwUnexpectedToken(i,r),this.context.strict&&f&&this.tolerateUnexpectedToken(f,r),this.context.strict=d,this.context.allowStrictDirective=m,this.context.await=u,this.context.allowYield=c,e?this.finalize(t,new s.AsyncFunctionExpression(a,p,y)):this.finalize(t,new s.FunctionExpression(a,p,y,n))},t.prototype.parseDirective=function(){var t=this.lookahead,e=this.createNode(),n=this.parseExpression(),r=n.type===u.Syntax.Literal?this.getTokenRaw(t).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(e,r?new s.Directive(n,r):new s.ExpressionStatement(n))},t.prototype.parseDirectivePrologues=function(){for(var t=null,e=[];;){var n=this.lookahead;if(8!==n.type)break;var r=this.parseDirective();e.push(r);var i=r.directive;if("string"!=typeof i)break;"use strict"===i?(this.context.strict=!0,t&&this.tolerateUnexpectedToken(t,o.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(n,o.Messages.IllegalLanguageModeDirective)):!t&&n.octal&&(t=n)}return e},t.prototype.qualifiedPropertyName=function(t){switch(t.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return"["===t.value}return!1},t.prototype.parseGetterMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters();n.params.length>0&&this.tolerateError(o.Messages.BadGetterArity);var r=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new s.FunctionExpression(null,n.params,r,!1))},t.prototype.parseSetterMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!1;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(o.Messages.BadSetterArity):n.params[0]instanceof s.RestElement&&this.tolerateError(o.Messages.BadSetterRestParameter);var r=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new s.FunctionExpression(null,n.params,r,!1))},t.prototype.parseGeneratorMethod=function(){var t=this.createNode(),e=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var r=this.parsePropertyMethod(n);return this.context.allowYield=e,this.finalize(t,new s.FunctionExpression(null,n.params,r,!0))},t.prototype.isStartOfExpression=function(){var t=!0,e=this.lookahead.value;switch(this.lookahead.type){case 7:t="["===e||"("===e||"{"===e||"+"===e||"-"===e||"!"===e||"~"===e||"++"===e||"--"===e||"/"===e||"/="===e;break;case 4:t="class"===e||"delete"===e||"function"===e||"let"===e||"new"===e||"super"===e||"this"===e||"typeof"===e||"void"===e||"yield"===e}return t},t.prototype.parseYieldExpression=function(){var t=this.createNode();this.expectKeyword("yield");var e=null,n=!1;if(!this.hasLineTerminator){var r=this.context.allowYield;this.context.allowYield=!1,n=this.match("*"),n?(this.nextToken(),e=this.parseAssignmentExpression()):this.isStartOfExpression()&&(e=this.parseAssignmentExpression()),this.context.allowYield=r}return this.finalize(t,new s.YieldExpression(e,n))},t.prototype.parseClassElement=function(t){var e=this.lookahead,n=this.createNode(),r="",i=null,a=null,u=!1,c=!1,h=!1,l=!1;if(this.match("*"))this.nextToken();else{u=this.match("["),i=this.parseObjectPropertyKey();if("static"===i.name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(e=this.lookahead,h=!0,u=this.match("["),this.match("*")?this.nextToken():i=this.parseObjectPropertyKey()),3===e.type&&!this.hasLineTerminator&&"async"===e.value){var p=this.lookahead.value;":"!==p&&"("!==p&&"*"!==p&&(l=!0,e=this.lookahead,i=this.parseObjectPropertyKey(),3===e.type&&("get"===e.value||"set"===e.value?this.tolerateUnexpectedToken(e):"constructor"===e.value&&this.tolerateUnexpectedToken(e,o.Messages.ConstructorIsAsync)))}}var f=this.qualifiedPropertyName(this.lookahead);return 3===e.type?"get"===e.value&&f?(r="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod()):"set"===e.value&&f&&(r="set",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseSetterMethod()):7===e.type&&"*"===e.value&&f&&(r="init",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0),!r&&i&&this.match("(")&&(r="init",a=l?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0),r||this.throwUnexpectedToken(this.lookahead),"init"===r&&(r="method"),u||(h&&this.isPropertyKey(i,"prototype")&&this.throwUnexpectedToken(e,o.Messages.StaticPrototype),!h&&this.isPropertyKey(i,"constructor")&&(("method"!==r||!c||a&&a.generator)&&this.throwUnexpectedToken(e,o.Messages.ConstructorSpecialMethod),t.value?this.throwUnexpectedToken(e,o.Messages.DuplicateConstructor):t.value=!0,r="constructor")),this.finalize(n,new s.MethodDefinition(i,u,a,r,h))},t.prototype.parseClassElementList=function(){var t=[],e={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():t.push(this.parseClassElement(e));return this.expect("}"),t},t.prototype.parseClassBody=function(){var t=this.createNode(),e=this.parseClassElementList();return this.finalize(t,new s.ClassBody(e))},t.prototype.parseClassDeclaration=function(t){var e=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var r=t&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var o=this.parseClassBody();return this.context.strict=n,this.finalize(e,new s.ClassDeclaration(r,i,o))},t.prototype.parseClassExpression=function(){var t=this.createNode(),e=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var i=this.parseClassBody();return this.context.strict=e,this.finalize(t,new s.ClassExpression(n,r,i))},t.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0;for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new s.Module(e))},t.prototype.parseScript=function(){for(var t=this.createNode(),e=this.parseDirectivePrologues();2!==this.lookahead.type;)e.push(this.parseStatementListItem());return this.finalize(t,new s.Script(e))},t.prototype.parseModuleSpecifier=function(){var t=this.createNode();8!==this.lookahead.type&&this.throwError(o.Messages.InvalidModuleSpecifier);var e=this.nextToken(),n=this.getTokenRaw(e);return this.finalize(t,new s.Literal(e.value,n))},t.prototype.parseImportSpecifier=function(){var t,e,n=this.createNode();return 3===this.lookahead.type?(t=this.parseVariableIdentifier(),e=t,this.matchContextualKeyword("as")&&(this.nextToken(),e=this.parseVariableIdentifier())):(t=this.parseIdentifierName(),e=t,this.matchContextualKeyword("as")?(this.nextToken(),e=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new s.ImportSpecifier(e,t))},t.prototype.parseNamedImports=function(){this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),t},t.prototype.parseImportDefaultSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName();return this.finalize(t,new s.ImportDefaultSpecifier(e))},t.prototype.parseImportNamespaceSpecifier=function(){var t=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(o.Messages.NoAsAfterImportNamespace),this.nextToken();var e=this.parseIdentifierName();return this.finalize(t,new s.ImportNamespaceSpecifier(e))},t.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalImportDeclaration);var t=this.createNode();this.expectKeyword("import");var e,n=[];if(8===this.lookahead.type)e=this.parseModuleSpecifier();else{if(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken(),e=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(t,new s.ImportDeclaration(n,e))},t.prototype.parseExportSpecifier=function(){var t=this.createNode(),e=this.parseIdentifierName(),n=e;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(t,new s.ExportSpecifier(e,n))},t.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(o.Messages.IllegalExportDeclaration);var t=this.createNode();this.expectKeyword("export");var e;if(this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);e=this.finalize(t,new s.ExportDefaultDeclaration(n))}else if(this.matchKeyword("class")){var n=this.parseClassDeclaration(!0);e=this.finalize(t,new s.ExportDefaultDeclaration(n))}else if(this.matchContextualKeyword("async")){var n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();e=this.finalize(t,new s.ExportDefaultDeclaration(n))}else{this.matchContextualKeyword("from")&&this.throwError(o.Messages.UnexpectedToken,this.lookahead.value);var n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),e=this.finalize(t,new s.ExportDefaultDeclaration(n))}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),e=this.finalize(t,new s.ExportAllDeclaration(i))}else if(4===this.lookahead.type){var n=void 0;switch(this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}e=this.finalize(t,new s.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction()){var n=this.parseFunctionDeclaration();e=this.finalize(t,new s.ExportNamedDeclaration(n,[],null))}else{var a=[],u=null,c=!1;for(this.expect("{");!this.match("}");)c=c||this.matchKeyword("default"),a.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),u=this.parseModuleSpecifier(),this.consumeSemicolon();else if(c){var r=this.lookahead.value?o.Messages.UnexpectedToken:o.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}else this.consumeSemicolon();e=this.finalize(t,new s.ExportNamedDeclaration(null,a,u))}return e},t}();e.Parser=h},function(t,e){"use strict";function n(t,e){if(!t)throw new Error("ASSERT: "+e)}Object.defineProperty(e,"__esModule",{value:!0}),e.assert=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this.errors=[],this.tolerant=!1}return t.prototype.recordError=function(t){this.errors.push(t)},t.prototype.tolerate=function(t){if(!this.tolerant)throw t;this.recordError(t)},t.prototype.constructError=function(t,e){var n=new Error(t);try{throw n}catch(t){Object.create&&Object.defineProperty&&(n=Object.create(t),Object.defineProperty(n,"column",{value:e}))}return n},t.prototype.createError=function(t,e,n,r){var i="Line "+e+": "+r,o=this.constructError(i,n);return o.index=t,o.lineNumber=e,o.description=r,o},t.prototype.throwError=function(t,e,n,r){throw this.createError(t,e,n,r)},t.prototype.tolerateError=function(t,e,n,r){var i=this.createError(t,e,n,r);if(!this.tolerant)throw i;this.recordError(i)},t}();e.ErrorHandler=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(t,e,n){"use strict";function r(t){return"0123456789abcdef".indexOf(t.toLowerCase())}function i(t){return"01234567".indexOf(t)}Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),s=n(4),a=n(11),u=function(){function t(t,e){this.source=t,this.errorHandler=e,this.trackComment=!1,this.length=t.length,this.index=0,this.lineNumber=t.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return t.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},t.prototype.restoreState=function(t){this.index=t.index,this.lineNumber=t.lineNumber,this.lineStart=t.lineStart},t.prototype.eof=function(){return this.index>=this.length},t.prototype.throwUnexpectedToken=function(t){return void 0===t&&(t=a.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.tolerateUnexpectedToken=function(t){void 0===t&&(t=a.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,t)},t.prototype.skipSingleLineComment=function(t){var e,n,r=[];for(this.trackComment&&(r=[],e=this.index-t,n={start:{line:this.lineNumber,column:this.index-this.lineStart-t},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(++this.index,s.Character.isLineTerminator(i)){if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};var o={multiLine:!1,slice:[e+t,this.index-1],range:[e,this.index-1],loc:n};r.push(o)}return 13===i&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,r}}if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var o={multiLine:!1,slice:[e+t,this.index],range:[e,this.index],loc:n};r.push(o)}return r},t.prototype.skipMultiLineComment=function(){var t,e,n=[];for(this.trackComment&&(n=[],t=this.index-2,e={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(s.Character.isLineTerminator(r))13===r&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===r){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){e.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:e};n.push(i)}return n}++this.index}else++this.index}if(this.trackComment){e.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:e};n.push(i)}return this.tolerateUnexpectedToken(),n},t.prototype.scanComments=function(){var t;this.trackComment&&(t=[]);for(var e=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(s.Character.isWhiteSpace(n))++this.index;else if(s.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,e=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var r=this.skipSingleLineComment(2);this.trackComment&&(t=t.concat(r)),e=!0}else{if(42!==n)break;this.index+=2;var r=this.skipMultiLineComment();this.trackComment&&(t=t.concat(r))}else if(e&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3;var r=this.skipSingleLineComment(3);this.trackComment&&(t=t.concat(r))}else{if(60!==n)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4;var r=this.skipSingleLineComment(4);this.trackComment&&(t=t.concat(r))}}return t},t.prototype.isFutureReservedWord=function(t){switch(t){case"enum":case"export":case"import":case"super":return!0;default:return!1}},t.prototype.isStrictModeReservedWord=function(t){switch(t){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},t.prototype.isRestrictedWord=function(t){return"eval"===t||"arguments"===t},t.prototype.isKeyword=function(t){switch(t.length){case 2:return"if"===t||"in"===t||"do"===t;case 3:return"var"===t||"for"===t||"new"===t||"try"===t||"let"===t;case 4:return"this"===t||"else"===t||"case"===t||"void"===t||"with"===t||"enum"===t;case 5:return"while"===t||"break"===t||"catch"===t||"throw"===t||"const"===t||"yield"===t||"class"===t||"super"===t;case 6:return"return"===t||"typeof"===t||"delete"===t||"switch"===t||"export"===t||"import"===t;case 7:return"default"===t||"finally"===t||"extends"===t;case 8:return"function"===t||"continue"===t||"debugger"===t;case 10:return"instanceof"===t;default:return!1}},t.prototype.codePointAt=function(t){var e=this.source.charCodeAt(t);if(e>=55296&&e<=56319){var n=this.source.charCodeAt(t+1);if(n>=56320&&n<=57343){e=1024*(e-55296)+n-56320+65536}}return e},t.prototype.scanHexEscape=function(t){for(var e="u"===t?4:2,n=0,i=0;i<e;++i){if(this.eof()||!s.Character.isHexDigit(this.source.charCodeAt(this.index)))return null;n=16*n+r(this.source[this.index++])}return String.fromCharCode(n)},t.prototype.scanUnicodeCodePointEscape=function(){var t=this.source[this.index],e=0;for("}"===t&&this.throwUnexpectedToken();!this.eof()&&(t=this.source[this.index++],s.Character.isHexDigit(t.charCodeAt(0)));)e=16*e+r(t);return(e>1114111||"}"!==t)&&this.throwUnexpectedToken(),s.Character.fromCodePoint(e)},t.prototype.getIdentifier=function(){for(var t=this.index++;!this.eof();){var e=this.source.charCodeAt(this.index);if(92===e)return this.index=t,this.getComplexIdentifier();if(e>=55296&&e<57343)return this.index=t,this.getComplexIdentifier();if(!s.Character.isIdentifierPart(e))break;++this.index}return this.source.slice(t,this.index)},t.prototype.getComplexIdentifier=function(){var t=this.codePointAt(this.index),e=s.Character.fromCodePoint(t);this.index+=e.length;var n;for(92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):null!==(n=this.scanHexEscape("u"))&&"\\"!==n&&s.Character.isIdentifierStart(n.charCodeAt(0))||this.throwUnexpectedToken(),e=n);!this.eof()&&(t=this.codePointAt(this.index),s.Character.isIdentifierPart(t));)n=s.Character.fromCodePoint(t),e+=n,this.index+=n.length,92===t&&(e=e.substr(0,e.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):null!==(n=this.scanHexEscape("u"))&&"\\"!==n&&s.Character.isIdentifierPart(n.charCodeAt(0))||this.throwUnexpectedToken(),e+=n);return e},t.prototype.octalToDecimal=function(t){var e="0"!==t,n=i(t);return!this.eof()&&s.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(e=!0,n=8*n+i(this.source[this.index++]),"0123".indexOf(t)>=0&&!this.eof()&&s.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+i(this.source[this.index++]))),{code:n,octal:e}},t.prototype.scanIdentifier=function(){var t,e=this.index,n=92===this.source.charCodeAt(e)?this.getComplexIdentifier():this.getIdentifier();if(3!==(t=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&e+n.length!==this.index){var r=this.index;this.index=e,this.tolerateUnexpectedToken(a.Messages.InvalidEscapedReservedWord),this.index=r}return{type:t,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.scanPunctuator=function(){var t=this.index,e=this.source[this.index];switch(e){case"(":case"{":"{"===e&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,e="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:e=this.source.substr(this.index,4),">>>="===e?this.index+=4:(e=e.substr(0,3),"==="===e||"!=="===e||">>>"===e||"<<="===e||">>="===e||"**="===e?this.index+=3:(e=e.substr(0,2),"&&"===e||"||"===e||"=="===e||"!="===e||"+="===e||"-="===e||"*="===e||"/="===e||"++"===e||"--"===e||"<<"===e||">>"===e||"&="===e||"|="===e||"^="===e||"%="===e||"<="===e||">="===e||"=>"===e||"**"===e?this.index+=2:(e=this.source[this.index],"<>=!+-*%&|^/".indexOf(e)>=0&&++this.index)))}return this.index===t&&this.throwUnexpectedToken(),{type:7,value:e,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanHexLiteral=function(t){for(var e="";!this.eof()&&s.Character.isHexDigit(this.source.charCodeAt(this.index));)e+=this.source[this.index++];return 0===e.length&&this.throwUnexpectedToken(),s.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+e,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanBinaryLiteral=function(t){for(var e,n="";!this.eof()&&("0"===(e=this.source[this.index])||"1"===e);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(e=this.source.charCodeAt(this.index),(s.Character.isIdentifierStart(e)||s.Character.isDecimalDigit(e))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanOctalLiteral=function(t,e){var n="",r=!1;for(s.Character.isOctalDigit(t.charCodeAt(0))?(r=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&s.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return r||0!==n.length||this.throwUnexpectedToken(),(s.Character.isIdentifierStart(this.source.charCodeAt(this.index))||s.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},t.prototype.isImplicitOctalLiteral=function(){for(var t=this.index+1;t<this.length;++t){var e=this.source[t];if("8"===e||"9"===e)return!1;if(!s.Character.isOctalDigit(e.charCodeAt(0)))return!0}return!0},t.prototype.scanNumericLiteral=function(){var t=this.index,e=this.source[t];o.assert(s.Character.isDecimalDigit(e.charCodeAt(0))||"."===e,"Numeric literal must start with a decimal digit or a decimal point");var n="";if("."!==e){if(n=this.source[this.index++],e=this.source[this.index],"0"===n){if("x"===e||"X"===e)return++this.index,this.scanHexLiteral(t);if("b"===e||"B"===e)return++this.index,this.scanBinaryLiteral(t);if("o"===e||"O"===e)return this.scanOctalLiteral(e,t);if(e&&s.Character.isOctalDigit(e.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(e,t)}for(;s.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];e=this.source[this.index]}if("."===e){for(n+=this.source[this.index++];s.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];e=this.source[this.index]}if("e"===e||"E"===e)if(n+=this.source[this.index++],e=this.source[this.index],"+"!==e&&"-"!==e||(n+=this.source[this.index++]),s.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;s.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];else this.throwUnexpectedToken();return s.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanStringLiteral=function(){var t=this.index,e=this.source[t];o.assert("'"===e||'"'===e,"String literal must starts with a quote"),++this.index;for(var n=!1,r="";!this.eof();){var i=this.source[this.index++];if(i===e){e="";break}if("\\"===i)if((i=this.source[this.index++])&&s.Character.isLineTerminator(i.charCodeAt(0)))++this.lineNumber,"\r"===i&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(i){case"u":if("{"===this.source[this.index])++this.index,r+=this.scanUnicodeCodePointEscape();else{var u=this.scanHexEscape(i);null===u&&this.throwUnexpectedToken(),r+=u}break;case"x":var c=this.scanHexEscape(i);null===c&&this.throwUnexpectedToken(a.Messages.InvalidHexEscapeSequence),r+=c;break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;case"8":case"9":r+=i,this.tolerateUnexpectedToken();break;default:if(i&&s.Character.isOctalDigit(i.charCodeAt(0))){var h=this.octalToDecimal(i);n=h.octal||n,r+=String.fromCharCode(h.code)}else r+=i}else{if(s.Character.isLineTerminator(i.charCodeAt(0)))break;r+=i}}return""!==e&&(this.index=t,this.throwUnexpectedToken()),{type:8,value:r,octal:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.scanTemplate=function(){var t="",e=!1,n=this.index,r="`"===this.source[n],i=!1,o=2;for(++this.index;!this.eof();){var u=this.source[this.index++];if("`"===u){o=1,i=!0,e=!0;break}if("$"===u){if("{"===this.source[this.index]){this.curlyStack.push("${"),++this.index,e=!0;break}t+=u}else if("\\"===u)if(u=this.source[this.index++],s.Character.isLineTerminator(u.charCodeAt(0)))++this.lineNumber,"\r"===u&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(u){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"u":if("{"===this.source[this.index])++this.index,t+=this.scanUnicodeCodePointEscape();else{var c=this.index,h=this.scanHexEscape(u);null!==h?t+=h:(this.index=c,t+=u)}break;case"x":var l=this.scanHexEscape(u);null===l&&this.throwUnexpectedToken(a.Messages.InvalidHexEscapeSequence),t+=l;break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:"0"===u?(s.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(a.Messages.TemplateOctalLiteral),t+="\0"):s.Character.isOctalDigit(u.charCodeAt(0))?this.throwUnexpectedToken(a.Messages.TemplateOctalLiteral):t+=u}else s.Character.isLineTerminator(u.charCodeAt(0))?(++this.lineNumber,"\r"===u&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index,t+="\n"):t+=u}return e||this.throwUnexpectedToken(),r||this.curlyStack.pop(),{type:10,value:this.source.slice(n+1,this.index-o),cooked:t,head:r,tail:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}},t.prototype.testRegExp=function(t,e){var n=t,r=this;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(t,e,n){var i=parseInt(e||n,16);return i>1114111&&r.throwUnexpectedToken(a.Messages.InvalidRegExp),i<=65535?String.fromCharCode(i):"￿"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"￿"));try{RegExp(n)}catch(t){this.throwUnexpectedToken(a.Messages.InvalidRegExp)}try{return new RegExp(t,e)}catch(t){return null}},t.prototype.scanRegExpBody=function(){var t=this.source[this.index];o.assert("/"===t,"Regular expression literal must start with a slash");for(var e=this.source[this.index++],n=!1,r=!1;!this.eof();)if(t=this.source[this.index++],e+=t,"\\"===t)t=this.source[this.index++],s.Character.isLineTerminator(t.charCodeAt(0))&&this.throwUnexpectedToken(a.Messages.UnterminatedRegExp),e+=t;else if(s.Character.isLineTerminator(t.charCodeAt(0)))this.throwUnexpectedToken(a.Messages.UnterminatedRegExp);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||this.throwUnexpectedToken(a.Messages.UnterminatedRegExp),e.substr(1,e.length-2)},t.prototype.scanRegExpFlags=function(){for(var t="",e="";!this.eof();){var n=this.source[this.index];if(!s.Character.isIdentifierPart(n.charCodeAt(0)))break;if(++this.index,"\\"!==n||this.eof())e+=n,t+=n;else if("u"===(n=this.source[this.index])){++this.index;var r=this.index,i=this.scanHexEscape("u");if(null!==i)for(e+=i,t+="\\u";r<this.index;++r)t+=this.source[r];else this.index=r,e+="u",t+="\\u";this.tolerateUnexpectedToken()}else t+="\\",this.tolerateUnexpectedToken()}return e},t.prototype.scanRegExp=function(){var t=this.index,e=this.scanRegExpBody(),n=this.scanRegExpFlags();return{type:9,value:"",pattern:e,flags:n,regex:this.testRegExp(e,n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},t.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var t=this.source.charCodeAt(this.index);return s.Character.isIdentifierStart(t)?this.scanIdentifier():40===t||41===t||59===t?this.scanPunctuator():39===t||34===t?this.scanStringLiteral():46===t?s.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():s.Character.isDecimalDigit(t)?this.scanNumericLiteral():96===t||125===t&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():t>=55296&&t<57343&&s.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},t}();e.Scanner=u},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenName={},e.TokenName[1]="Boolean",e.TokenName[2]="<end>",e.TokenName[3]="Identifier",e.TokenName[4]="Keyword",e.TokenName[5]="Null",e.TokenName[6]="Numeric",e.TokenName[7]="Punctuator",e.TokenName[8]="String",e.TokenName[9]="RegularExpression",e.TokenName[10]="Template"},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),i=n(12),o=n(13),s=function(){function t(){this.values=[],this.curly=this.paren=-1}return t.prototype.beforeFunctionExpression=function(t){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(t)>=0},t.prototype.isRegexStart=function(){var t=this.values[this.values.length-1],e=null!==t;switch(t){case"this":case"]":e=!1;break;case")":var n=this.values[this.paren-1];e="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(e=!1,"function"===this.values[this.curly-3]){var r=this.values[this.curly-4];e=!!r&&!this.beforeFunctionExpression(r)}else if("function"===this.values[this.curly-4]){var r=this.values[this.curly-5];e=!r||!this.beforeFunctionExpression(r)}}return e},t.prototype.push=function(t){7===t.type||4===t.type?("{"===t.value?this.curly=this.values.length:"("===t.value&&(this.paren=this.values.length),this.values.push(t.value)):this.values.push(null)},t}(),a=function(){function t(t,e){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=!!e&&("boolean"==typeof e.tolerant&&e.tolerant),this.scanner=new i.Scanner(t,this.errorHandler),this.scanner.trackComment=!!e&&("boolean"==typeof e.comment&&e.comment),this.trackRange=!!e&&("boolean"==typeof e.range&&e.range),this.trackLoc=!!e&&("boolean"==typeof e.loc&&e.loc),this.buffer=[],this.reader=new s}return t.prototype.errors=function(){return this.errorHandler.errors},t.prototype.getNextToken=function(){if(0===this.buffer.length){var t=this.scanner.scanComments();if(this.scanner.trackComment)for(var e=0;e<t.length;++e){var n=t[e],r=this.scanner.source.slice(n.slice[0],n.slice[1]),i={type:n.multiLine?"BlockComment":"LineComment",value:r};this.trackRange&&(i.range=n.range),this.trackLoc&&(i.loc=n.loc),this.buffer.push(i)}if(!this.scanner.eof()){var s=void 0;this.trackLoc&&(s={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var a="/"===this.scanner.source[this.scanner.index]&&this.reader.isRegexStart(),u=a?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(u);var c={type:o.TokenName[u.type],value:this.scanner.source.slice(u.start,u.end)};if(this.trackRange&&(c.range=[u.start,u.end]),this.trackLoc&&(s.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},c.loc=s),9===u.type){var h=u.pattern,l=u.flags;c.regex={pattern:h,flags:l}}this.buffer.push(c)}}return this.buffer.shift()},t}();e.Tokenizer=a}])})},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,h=-7,l=n?i-1:0,p=n?-1:1,f=t[e+l];for(l+=p,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+t[e+l],l+=p,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+t[e+l],l+=p,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=c}return(f?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,u,c=8*o-i-1,h=(1<<c)-1,l=h>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+l>=1?p/u:p*Math.pow(2,1-l),e*u>=2&&(s++,u/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[n+f]=255&a,f+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[n+f]=255&s,f+=d,s/=256,c-=8);t[n+f-d]|=128*m}},function(t,e,n){!function(e,n){t.exports=n()}(0,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return o(t)?t:k(t)}function n(t){return s(t)?t:I(t)}function r(t){return a(t)?t:T(t)}function i(t){return o(t)&&!u(t)?t:B(t)}function o(t){return!(!t||!t[cn])}function s(t){return!(!t||!t[hn])}function a(t){return!(!t||!t[ln])}function u(t){return s(t)||a(t)}function c(t){return!(!t||!t[pn])}function h(t){return t.value=!1,t}function l(t){t&&(t.value=!0)}function p(){}function f(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;i<n;i++)r[i]=t[i+e];return r}function d(t){return void 0===t.size&&(t.size=t.__iterate(y)),t.size}function m(t,e){if("number"!=typeof e){var n=e>>>0;if(""+n!==e||4294967295===n)return NaN;e=n}return e<0?d(t)+e:e}function y(){return!0}function v(t,e,n){return(0===t||void 0!==n&&t<=-n)&&(void 0===e||void 0!==n&&e>=n)}function x(t,e){return D(t,e,0)}function g(t,e){return D(t,e,e)}function D(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function E(t){this.next=t}function A(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function S(){return{value:void 0,done:!0}}function w(t){return!!b(t)}function C(t){return t&&"function"==typeof t.next}function _(t){var e=b(t);return e&&e.call(t)}function b(t){var e=t&&(An&&t[An]||t[Sn]);if("function"==typeof e)return e}function F(t){return t&&"number"==typeof t.length}function k(t){return null===t||void 0===t?U():o(t)?t.toSeq():z(t)}function I(t){return null===t||void 0===t?U().toKeyedSeq():o(t)?s(t)?t.toSeq():t.fromEntrySeq():j(t)}function T(t){return null===t||void 0===t?U():o(t)?s(t)?t.entrySeq():t.toIndexedSeq():L(t)}function B(t){return(null===t||void 0===t?U():o(t)?s(t)?t.entrySeq():t:L(t)).toSetSeq()}function M(t){this._array=t,this.size=t.length}function P(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function N(t){this._iterable=t,this.size=t.length||t.size}function O(t){this._iterator=t,this._iteratorCache=[]}function R(t){return!(!t||!t[Cn])}function U(){return _n||(_n=new M([]))}function j(t){var e=Array.isArray(t)?new M(t).fromEntrySeq():C(t)?new O(t).fromEntrySeq():w(t)?new N(t).fromEntrySeq():"object"==typeof t?new P(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function L(t){var e=J(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function z(t){var e=J(t)||"object"==typeof t&&new P(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function J(t){return F(t)?new M(t):C(t)?new O(t):w(t)?new N(t):void 0}function X(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,s=0;s<=o;s++){var a=i[n?o-s:s];if(!1===e(a[1],r?a[0]:s,t))return s+1}return s}return t.__iterateUncached(e,n)}function q(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,s=0;return new E(function(){var t=i[n?o-s:s];return s++>o?S():A(e,r?t[0]:s-1,t[1])})}return t.__iteratorUncached(e,n)}function K(t,e){return e?Y(e,t,"",{"":t}):W(t)}function Y(t,e,n,r){return Array.isArray(e)?t.call(r,n,T(e).map(function(n,r){return Y(t,n,r,e)})):G(e)?t.call(r,n,I(e).map(function(n,r){return Y(t,n,r,e)})):e}function W(t){return Array.isArray(t)?T(t).map(W).toList():G(t)?I(t).map(W).toMap():t}function G(t){return t&&(t.constructor===Object||void 0===t.constructor)}function H(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function V(t,e){if(t===e)return!0;if(!o(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||s(t)!==s(e)||a(t)!==a(e)||c(t)!==c(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!u(t);if(c(t)){var r=t.entries();return e.every(function(t,e){var i=r.next().value;return i&&H(i[1],t)&&(n||H(i[0],e))})&&r.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var h=t;t=e,e=h}var l=!0,p=e.__iterate(function(e,r){if(n?!t.has(e):i?!H(e,t.get(r,yn)):!H(t.get(r,yn),e))return l=!1,!1});return l&&t.size===p}function $(t,e){if(!(this instanceof $))return new $(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(bn)return bn;bn=this}}function Z(t,e){if(!t)throw new Error(e)}function Q(t,e,n){if(!(this instanceof Q))return new Q(t,e,n);if(Z(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),n=void 0===n?1:Math.abs(n),e<t&&(n=-n),this._start=t,this._end=e,this._step=n,this.size=Math.max(0,Math.ceil((e-t)/n-1)+1),0===this.size){if(Fn)return Fn;Fn=this}}function tt(){throw TypeError("Abstract")}function et(){}function nt(){}function rt(){}function it(t){return t>>>1&1073741824|3221225471&t}function ot(t){if(!1===t||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(!1===(t=t.valueOf())||null===t||void 0===t))return 0;if(!0===t)return 1;var e=typeof t;if("number"===e){if(t!==t||t===1/0)return 0;var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)t/=4294967295,n^=t;return it(n)}if("string"===e)return t.length>On?st(t):at(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"===e)return ut(t);if("function"==typeof t.toString)return at(t.toString());throw new Error("Value type "+e+" cannot be hashed.")}function st(t){var e=jn[t];return void 0===e&&(e=at(t),Un===Rn&&(Un=0,jn={}),Un++,jn[t]=e),e}function at(t){for(var e=0,n=0;n<t.length;n++)e=31*e+t.charCodeAt(n)|0;return it(e)}function ut(t){var e;if(Mn&&void 0!==(e=kn.get(t)))return e;if(void 0!==(e=t[Nn]))return e;if(!Bn){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Nn]))return e;if(void 0!==(e=ct(t)))return e}if(e=++Pn,1073741824&Pn&&(Pn=0),Mn)kn.set(t,e);else{if(void 0!==Tn&&!1===Tn(t))throw new Error("Non-extensible objects are not allowed as keys.");if(Bn)Object.defineProperty(t,Nn,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Nn]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Nn]=e}}return e}function ct(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ht(t){Z(t!==1/0,"Cannot perform this action with an infinite size.")}function lt(t){return null===t||void 0===t?At():pt(t)&&!c(t)?t:At().withMutations(function(e){var r=n(t);ht(r.size),r.forEach(function(t,n){return e.set(n,t)})})}function pt(t){return!(!t||!t[Ln])}function ft(t,e){this.ownerID=t,this.entries=e}function dt(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n}function mt(t,e,n){this.ownerID=t,this.count=e,this.nodes=n}function yt(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n}function vt(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n}function xt(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&Dt(t._root)}function gt(t,e){return A(t,e[0],e[1])}function Dt(t,e){return{node:t,index:0,__prev:e}}function Et(t,e,n,r){var i=Object.create(zn);return i.size=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function At(){return Jn||(Jn=Et(0))}function St(t,e,n){var r,i;if(t._root){var o=h(vn),s=h(xn);if(r=wt(t._root,t.__ownerID,0,void 0,e,n,o,s),!s.value)return t;i=t.size+(o.value?n===yn?-1:1:0)}else{if(n===yn)return t;i=1,r=new ft(t.__ownerID,[[e,n]])}return t.__ownerID?(t.size=i,t._root=r,t.__hash=void 0,t.__altered=!0,t):r?Et(i,r):At()}function wt(t,e,n,r,i,o,s,a){return t?t.update(e,n,r,i,o,s,a):o===yn?t:(l(a),l(s),new vt(e,r,[i,o]))}function Ct(t){return t.constructor===vt||t.constructor===yt}function _t(t,e,n,r,i){if(t.keyHash===r)return new yt(e,r,[t.entry,i]);var o,s=(0===n?t.keyHash:t.keyHash>>>n)&mn,a=(0===n?r:r>>>n)&mn;return new dt(e,1<<s|1<<a,s===a?[_t(t,e,n+fn,r,i)]:(o=new vt(e,r,i),s<a?[t,o]:[o,t]))}function bt(t,e,n,r){t||(t=new p);for(var i=new vt(t,ot(n),[n,r]),o=0;o<e.length;o++){var s=e[o];i=i.update(t,0,void 0,s[0],s[1])}return i}function Ft(t,e,n,r){for(var i=0,o=0,s=new Array(n),a=0,u=1,c=e.length;a<c;a++,u<<=1){var h=e[a];void 0!==h&&a!==r&&(i|=u,s[o++]=h)}return new dt(t,i,s)}function kt(t,e,n,r,i){for(var o=0,s=new Array(dn),a=0;0!==n;a++,n>>>=1)s[a]=1&n?e[o++]:void 0;return s[r]=i,new mt(t,o+1,s)}function It(t,e,r){for(var i=[],s=0;s<r.length;s++){var a=r[s],u=n(a);o(a)||(u=u.map(function(t){return K(t)})),i.push(u)}return Mt(t,e,i)}function Tt(t,e,n){return t&&t.mergeDeep&&o(e)?t.mergeDeep(e):H(t,e)?t:e}function Bt(t){return function(e,n,r){if(e&&e.mergeDeepWith&&o(n))return e.mergeDeepWith(t,n);var i=t(e,n,r);return H(e,i)?e:i}}function Mt(t,e,n){return n=n.filter(function(t){return 0!==t.size}),0===n.length?t:0!==t.size||t.__ownerID||1!==n.length?t.withMutations(function(t){for(var r=e?function(n,r){t.update(r,yn,function(t){return t===yn?n:e(t,n,r)})}:function(e,n){t.set(n,e)},i=0;i<n.length;i++)n[i].forEach(r)}):t.constructor(n[0])}function Pt(t,e,n,r){var i=t===yn,o=e.next();if(o.done){var s=i?n:t,a=r(s);return a===s?t:a}Z(i||t&&t.set,"invalid keyPath");var u=o.value,c=i?yn:t.get(u,yn),h=Pt(c,e,n,r);return h===c?t:h===yn?t.remove(u):(i?At():t).set(u,h)}function Nt(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function Ot(t,e,n,r){var i=r?t:f(t);return i[e]=n,i}function Rt(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var o=new Array(i),s=0,a=0;a<i;a++)a===e?(o[a]=n,s=-1):o[a]=t[a+s];return o}function Ut(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var i=new Array(r),o=0,s=0;s<r;s++)s===e&&(o=1),i[s]=t[s+o];return i}function jt(t){var e=qt();if(null===t||void 0===t)return e;if(Lt(t))return t;var n=r(t),i=n.size;return 0===i?e:(ht(i),i>0&&i<dn?Xt(0,i,fn,null,new zt(n.toArray())):e.withMutations(function(t){t.setSize(i),n.forEach(function(e,n){return t.set(n,e)})}))}function Lt(t){return!(!t||!t[Yn])}function zt(t,e){this.array=t,this.ownerID=e}function Jt(t,e){function n(t,e,n){return 0===e?r(t,n):i(t,e,n)}function r(t,n){var r=n===a?u&&u.array:t&&t.array,i=n>o?0:o-n,c=s-n;return c>dn&&(c=dn),function(){if(i===c)return Hn;var t=e?--c:i++;return r&&r[t]}}function i(t,r,i){var a,u=t&&t.array,c=i>o?0:o-i>>r,h=1+(s-i>>r);return h>dn&&(h=dn),function(){for(;;){if(a){var t=a();if(t!==Hn)return t;a=null}if(c===h)return Hn;var o=e?--h:c++;a=n(u&&u[o],r-fn,i+(o<<r))}}}var o=t._origin,s=t._capacity,a=$t(s),u=t._tail;return n(t._root,t._level,0)}function Xt(t,e,n,r,i,o,s){var a=Object.create(Wn);return a.size=e-t,a._origin=t,a._capacity=e,a._level=n,a._root=r,a._tail=i,a.__ownerID=o,a.__hash=s,a.__altered=!1,a}function qt(){return Gn||(Gn=Xt(0,0,fn))}function Kt(t,e,n){if((e=m(t,e))!==e)return t;if(e>=t.size||e<0)return t.withMutations(function(t){e<0?Ht(t,e).set(0,n):Ht(t,0,e+1).set(e,n)});e+=t._origin;var r=t._tail,i=t._root,o=h(xn);return e>=$t(t._capacity)?r=Yt(r,t.__ownerID,0,e,n,o):i=Yt(i,t.__ownerID,t._level,e,n,o),o.value?t.__ownerID?(t._root=i,t._tail=r,t.__hash=void 0,t.__altered=!0,t):Xt(t._origin,t._capacity,t._level,i,r):t}function Yt(t,e,n,r,i,o){var s=r>>>n&mn,a=t&&s<t.array.length;if(!a&&void 0===i)return t;var u;if(n>0){var c=t&&t.array[s],h=Yt(c,e,n-fn,r,i,o);return h===c?t:(u=Wt(t,e),u.array[s]=h,u)}return a&&t.array[s]===i?t:(l(o),u=Wt(t,e),void 0===i&&s===u.array.length-1?u.array.pop():u.array[s]=i,u)}function Wt(t,e){return e&&t&&e===t.ownerID?t:new zt(t?t.array.slice():[],e)}function Gt(t,e){if(e>=$t(t._capacity))return t._tail;if(e<1<<t._level+fn){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&mn],r-=fn;return n}}function Ht(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var r=t.__ownerID||new p,i=t._origin,o=t._capacity,s=i+e,a=void 0===n?o:n<0?o+n:i+n;if(s===i&&a===o)return t;if(s>=a)return t.clear();for(var u=t._level,c=t._root,h=0;s+h<0;)c=new zt(c&&c.array.length?[void 0,c]:[],r),u+=fn,h+=1<<u;h&&(s+=h,i+=h,a+=h,o+=h);for(var l=$t(o),f=$t(a);f>=1<<u+fn;)c=new zt(c&&c.array.length?[c]:[],r),u+=fn;var d=t._tail,m=f<l?Gt(t,a-1):f>l?new zt([],r):d;if(d&&f>l&&s<o&&d.array.length){c=Wt(c,r);for(var y=c,v=u;v>fn;v-=fn){var x=l>>>v&mn;y=y.array[x]=Wt(y.array[x],r)}y.array[l>>>fn&mn]=d}if(a<o&&(m=m&&m.removeAfter(r,0,a)),s>=f)s-=f,a-=f,u=fn,c=null,m=m&&m.removeBefore(r,0,s);else if(s>i||f<l){for(h=0;c;){var g=s>>>u&mn;if(g!==f>>>u&mn)break;g&&(h+=(1<<u)*g),u-=fn,c=c.array[g]}c&&s>i&&(c=c.removeBefore(r,u,s-h)),c&&f<l&&(c=c.removeAfter(r,u,f-h)),h&&(s-=h,a-=h)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=u,t._root=c,t._tail=m,t.__hash=void 0,t.__altered=!0,t):Xt(s,a,u,c,m)}function Vt(t,e,n){for(var i=[],s=0,a=0;a<n.length;a++){var u=n[a],c=r(u);c.size>s&&(s=c.size),o(u)||(c=c.map(function(t){return K(t)})),i.push(c)}return s>t.size&&(t=t.setSize(s)),Mt(t,e,i)}function $t(t){return t<dn?0:t-1>>>fn<<fn}function Zt(t){return null===t||void 0===t?ee():Qt(t)?t:ee().withMutations(function(e){var r=n(t);ht(r.size),r.forEach(function(t,n){return e.set(n,t)})})}function Qt(t){return pt(t)&&c(t)}function te(t,e,n,r){var i=Object.create(Zt.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=n,i.__hash=r,i}function ee(){return Vn||(Vn=te(At(),qt()))}function ne(t,e,n){var r,i,o=t._map,s=t._list,a=o.get(e),u=void 0!==a;if(n===yn){if(!u)return t;s.size>=dn&&s.size>=2*o.size?(i=s.filter(function(t,e){return void 0!==t&&a!==e}),r=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(r.__ownerID=i.__ownerID=t.__ownerID)):(r=o.remove(e),i=a===s.size-1?s.pop():s.set(a,void 0))}else if(u){if(n===s.get(a)[1])return t;r=o,i=s.set(a,[e,n])}else r=o.set(e,s.size),i=s.set(s.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=i,t.__hash=void 0,t):te(r,i)}function re(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ie(t){this._iter=t,this.size=t.size}function oe(t){this._iter=t,this.size=t.size}function se(t){this._iter=t,this.size=t.size}function ae(t){var e=Fe(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=ke,e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return!1!==e(n,t,r)},n)},e.__iteratorUncached=function(e,n){if(e===En){var r=t.__iterator(e,n);return new E(function(){var t=r.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===Dn?gn:Dn,n)},e}function ue(t,e,n){var r=Fe(t);return r.size=t.size,r.has=function(e){return t.has(e)},r.get=function(r,i){var o=t.get(r,yn);return o===yn?i:e.call(n,o,r,t)},r.__iterateUncached=function(r,i){var o=this;return t.__iterate(function(t,i,s){return!1!==r(e.call(n,t,i,s),i,o)},i)},r.__iteratorUncached=function(r,i){var o=t.__iterator(En,i);return new E(function(){var i=o.next();if(i.done)return i;var s=i.value,a=s[0];return A(r,a,e.call(n,s[1],a,t),i)})},r}function ce(t,e){var n=Fe(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=ae(t);return e.reverse=function(){return t.flip()},e}),n.get=function(n,r){return t.get(e?n:-1-n,r)},n.has=function(n){return t.has(e?n:-1-n)},n.includes=function(e){return t.includes(e)},n.cacheResult=ke,n.__iterate=function(e,n){var r=this;return t.__iterate(function(t,n){return e(t,n,r)},!n)},n.__iterator=function(e,n){return t.__iterator(e,!n)},n}function he(t,e,n,r){var i=Fe(t);return r&&(i.has=function(r){var i=t.get(r,yn);return i!==yn&&!!e.call(n,i,r,t)},i.get=function(r,i){var o=t.get(r,yn);return o!==yn&&e.call(n,o,r,t)?o:i}),i.__iterateUncached=function(i,o){var s=this,a=0;return t.__iterate(function(t,o,u){if(e.call(n,t,o,u))return a++,i(t,r?o:a-1,s)},o),a},i.__iteratorUncached=function(i,o){var s=t.__iterator(En,o),a=0;return new E(function(){for(;;){var o=s.next();if(o.done)return o;var u=o.value,c=u[0],h=u[1];if(e.call(n,h,c,t))return A(i,r?c:a++,h,o)}})},i}function le(t,e,n){var r=lt().asMutable();return t.__iterate(function(i,o){r.update(e.call(n,i,o,t),0,function(t){return t+1})}),r.asImmutable()}function pe(t,e,n){var r=s(t),i=(c(t)?Zt():lt()).asMutable();t.__iterate(function(o,s){i.update(e.call(n,o,s,t),function(t){return t=t||[],t.push(r?[s,o]:o),t})});var o=be(t);return i.map(function(e){return we(t,o(e))})}function fe(t,e,n,r){var i=t.size;if(void 0!==e&&(e|=0),void 0!==n&&(n===1/0?n=i:n|=0),v(e,n,i))return t;var o=x(e,i),s=g(n,i);if(o!==o||s!==s)return fe(t.toSeq().cacheResult(),e,n,r);var a,u=s-o;u===u&&(a=u<0?0:u);var c=Fe(t);return c.size=0===a?a:t.size&&a||void 0,!r&&R(t)&&a>=0&&(c.get=function(e,n){return e=m(this,e),e>=0&&e<a?t.get(e+o,n):n}),c.__iterateUncached=function(e,n){var i=this;if(0===a)return 0;if(n)return this.cacheResult().__iterate(e,n);var s=0,u=!0,c=0;return t.__iterate(function(t,n){if(!u||!(u=s++<o))return c++,!1!==e(t,r?n:c-1,i)&&c!==a}),c},c.__iteratorUncached=function(e,n){if(0!==a&&n)return this.cacheResult().__iterator(e,n);var i=0!==a&&t.__iterator(e,n),s=0,u=0;return new E(function(){for(;s++<o;)i.next();if(++u>a)return S();var t=i.next();return r||e===Dn?t:e===gn?A(e,u-1,void 0,t):A(e,u-1,t.value[1],t)})},c}function de(t,e,n){var r=Fe(t);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var s=0;return t.__iterate(function(t,i,a){return e.call(n,t,i,a)&&++s&&r(t,i,o)}),s},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var s=t.__iterator(En,i),a=!0;return new E(function(){if(!a)return S();var t=s.next();if(t.done)return t;var i=t.value,u=i[0],c=i[1];return e.call(n,c,u,o)?r===En?t:A(r,u,c,t):(a=!1,S())})},r}function me(t,e,n,r){var i=Fe(t);return i.__iterateUncached=function(i,o){var s=this;if(o)return this.cacheResult().__iterate(i,o);var a=!0,u=0;return t.__iterate(function(t,o,c){if(!a||!(a=e.call(n,t,o,c)))return u++,i(t,r?o:u-1,s)}),u},i.__iteratorUncached=function(i,o){var s=this;if(o)return this.cacheResult().__iterator(i,o);var a=t.__iterator(En,o),u=!0,c=0;return new E(function(){var t,o,h;do{if(t=a.next(),t.done)return r||i===Dn?t:i===gn?A(i,c++,void 0,t):A(i,c++,t.value[1],t);var l=t.value;o=l[0],h=l[1],u&&(u=e.call(n,h,o,s))}while(u);return i===En?t:A(i,o,h,t)})},i}function ye(t,e){var r=s(t),i=[t].concat(e).map(function(t){return o(t)?r&&(t=n(t)):t=r?j(t):L(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===i.length)return t;if(1===i.length){var u=i[0];if(u===t||r&&s(u)||a(t)&&a(u))return u}var c=new M(i);return r?c=c.toKeyedSeq():a(t)||(c=c.toSetSeq()),c=c.flatten(!0),c.size=i.reduce(function(t,e){if(void 0!==t){var n=e.size;if(void 0!==n)return t+n}},0),c}function ve(t,e,n){var r=Fe(t);return r.__iterateUncached=function(r,i){function s(t,c){var h=this;t.__iterate(function(t,i){return(!e||c<e)&&o(t)?s(t,c+1):!1===r(t,n?i:a++,h)&&(u=!0),!u},i)}var a=0,u=!1;return s(t,0),a},r.__iteratorUncached=function(r,i){var s=t.__iterator(r,i),a=[],u=0;return new E(function(){for(;s;){var t=s.next();if(!1===t.done){var c=t.value;if(r===En&&(c=c[1]),e&&!(a.length<e)||!o(c))return n?t:A(r,u++,c,t);a.push(s),s=c.__iterator(r,i)}else s=a.pop()}return S()})},r}function xe(t,e,n){var r=be(t);return t.toSeq().map(function(i,o){return r(e.call(n,i,o,t))}).flatten(!0)}function ge(t,e){var n=Fe(t);return n.size=t.size&&2*t.size-1,n.__iterateUncached=function(n,r){var i=this,o=0;return t.__iterate(function(t,r){return(!o||!1!==n(e,o++,i))&&!1!==n(t,o++,i)},r),o},n.__iteratorUncached=function(n,r){var i,o=t.__iterator(Dn,r),s=0;return new E(function(){return(!i||s%2)&&(i=o.next(),i.done)?i:s%2?A(n,s++,e):A(n,s++,i.value,i)})},n}function De(t,e,n){e||(e=Ie);var r=s(t),i=0,o=t.toSeq().map(function(e,r){return[r,e,i++,n?n(e,r,t):e]}).toArray();return o.sort(function(t,n){return e(t[3],n[3])||t[2]-n[2]}).forEach(r?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),r?I(o):a(t)?T(o):B(o)}function Ee(t,e,n){if(e||(e=Ie),n){var r=t.toSeq().map(function(e,r){return[e,n(e,r,t)]}).reduce(function(t,n){return Ae(e,t[1],n[1])?n:t});return r&&r[0]}return t.reduce(function(t,n){return Ae(e,t,n)?n:t})}function Ae(t,e,n){var r=t(n,e);return 0===r&&n!==e&&(void 0===n||null===n||n!==n)||r>0}function Se(t,n,r){var i=Fe(t);return i.size=new M(r).map(function(t){return t.size}).min(),i.__iterate=function(t,e){for(var n,r=this.__iterator(Dn,e),i=0;!(n=r.next()).done&&!1!==t(n.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map(function(t){return t=e(t),_(i?t.reverse():t)}),s=0,a=!1;return new E(function(){var e;return a||(e=o.map(function(t){return t.next()}),a=e.some(function(t){return t.done})),a?S():A(t,s++,n.apply(null,e.map(function(t){return t.value})))})},i}function we(t,e){return R(t)?e:t.constructor(e)}function Ce(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function _e(t){return ht(t.size),d(t)}function be(t){return s(t)?n:a(t)?r:i}function Fe(t){return Object.create((s(t)?I:a(t)?T:B).prototype)}function ke(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):k.prototype.cacheResult.call(this)}function Ie(t,e){return t>e?1:t<e?-1:0}function Te(t){var n=_(t);if(!n){if(!F(t))throw new TypeError("Expected iterable or array-like: "+t);n=_(e(t))}return n}function Be(t,e){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var s=Object.keys(t);Ne(i,s),i.size=s.length,i._name=e,i._keys=s,i._defaultValues=t}this._map=lt(o)},i=r.prototype=Object.create($n);return i.constructor=r,r}function Me(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function Pe(t){return t._name||t.constructor.name||"Record"}function Ne(t,e){try{e.forEach(Oe.bind(void 0,t))}catch(t){}}function Oe(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){Z(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function Re(t){return null===t||void 0===t?ze():Ue(t)&&!c(t)?t:ze().withMutations(function(e){var n=i(t);ht(n.size),n.forEach(function(t){return e.add(t)})})}function Ue(t){return!(!t||!t[Zn])}function je(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Le(t,e){var n=Object.create(Qn);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function ze(){return tr||(tr=Le(At()))}function Je(t){return null===t||void 0===t?Ke():Xe(t)?t:Ke().withMutations(function(e){var n=i(t);ht(n.size),n.forEach(function(t){return e.add(t)})})}function Xe(t){return Ue(t)&&c(t)}function qe(t,e){var n=Object.create(er);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function Ke(){return nr||(nr=qe(ee()))}function Ye(t){return null===t||void 0===t?He():We(t)?t:He().unshiftAll(t)}function We(t){return!(!t||!t[rr])}function Ge(t,e,n,r){var i=Object.create(ir);return i.size=t,i._head=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function He(){return or||(or=Ge(0))}function Ve(t,e){var n=function(n){t.prototype[n]=e[n]};return Object.keys(e).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(n),t}function $e(t,e){return e}function Ze(t,e){return[e,t]}function Qe(t){return function(){return!t.apply(this,arguments)}}function tn(t){return function(){return-t.apply(this,arguments)}}function en(t){return"string"==typeof t?JSON.stringify(t):String(t)}function nn(){return f(arguments)}function rn(t,e){return t<e?1:t>e?-1:0}function on(t){if(t.size===1/0)return 0;var e=c(t),n=s(t),r=e?1:0;return sn(t.__iterate(n?e?function(t,e){r=31*r+an(ot(t),ot(e))|0}:function(t,e){r=r+an(ot(t),ot(e))|0}:e?function(t){r=31*r+ot(t)|0}:function(t){r=r+ot(t)|0}),r)}function sn(t,e){return e=In(e,3432918353),e=In(e<<15|e>>>-15,461845907),e=In(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=In(e^e>>>16,2246822507),e=In(e^e>>>13,3266489909),e=it(e^e>>>16)}function an(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var un=Array.prototype.slice;t(n,e),t(r,e),t(i,e),e.isIterable=o,e.isKeyed=s,e.isIndexed=a,e.isAssociative=u,e.isOrdered=c,e.Keyed=n,e.Indexed=r,e.Set=i;var cn="@@__IMMUTABLE_ITERABLE__@@",hn="@@__IMMUTABLE_KEYED__@@",ln="@@__IMMUTABLE_INDEXED__@@",pn="@@__IMMUTABLE_ORDERED__@@",fn=5,dn=1<<fn,mn=dn-1,yn={},vn={value:!1},xn={value:!1},gn=0,Dn=1,En=2,An="function"==typeof Symbol&&Symbol.iterator,Sn="@@iterator",wn=An||Sn;E.prototype.toString=function(){return"[Iterator]"},E.KEYS=gn,E.VALUES=Dn,E.ENTRIES=En,E.prototype.inspect=E.prototype.toSource=function(){return this.toString()},E.prototype[wn]=function(){return this},t(k,e),k.of=function(){return k(arguments)},k.prototype.toSeq=function(){return this},k.prototype.toString=function(){return this.__toString("Seq {","}")},k.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},k.prototype.__iterate=function(t,e){return X(this,t,e,!0)},k.prototype.__iterator=function(t,e){return q(this,t,e,!0)},t(I,k),I.prototype.toKeyedSeq=function(){return this},t(T,k),T.of=function(){return T(arguments)},T.prototype.toIndexedSeq=function(){return this},T.prototype.toString=function(){return this.__toString("Seq [","]")},T.prototype.__iterate=function(t,e){return X(this,t,e,!1)},T.prototype.__iterator=function(t,e){return q(this,t,e,!1)},t(B,k),B.of=function(){return B(arguments)},B.prototype.toSetSeq=function(){return this},k.isSeq=R,k.Keyed=I,k.Set=B,k.Indexed=T;var Cn="@@__IMMUTABLE_SEQ__@@";k.prototype[Cn]=!0,t(M,T),M.prototype.get=function(t,e){return this.has(t)?this._array[m(this,t)]:e},M.prototype.__iterate=function(t,e){for(var n=this._array,r=n.length-1,i=0;i<=r;i++)if(!1===t(n[e?r-i:i],i,this))return i+1;return i},M.prototype.__iterator=function(t,e){var n=this._array,r=n.length-1,i=0;return new E(function(){return i>r?S():A(t,i,n[e?r-i++:i++])})},t(P,I),P.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},P.prototype.has=function(t){return this._object.hasOwnProperty(t)},P.prototype.__iterate=function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var s=r[e?i-o:o];if(!1===t(n[s],s,this))return o+1}return o},P.prototype.__iterator=function(t,e){var n=this._object,r=this._keys,i=r.length-1,o=0;return new E(function(){var s=r[e?i-o:o];return o++>i?S():A(t,s,n[s])})},P.prototype[pn]=!0,t(N,T),N.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var n=this._iterable,r=_(n),i=0;if(C(r))for(var o;!(o=r.next()).done&&!1!==t(o.value,i++,this););return i},N.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterable,r=_(n);if(!C(r))return new E(S);var i=0;return new E(function(){var e=r.next();return e.done?e:A(t,i++,e.value)})},t(O,T),O.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var n=this._iterator,r=this._iteratorCache,i=0;i<r.length;)if(!1===t(r[i],i++,this))return i;for(var o;!(o=n.next()).done;){var s=o.value;if(r[i]=s,!1===t(s,i++,this))break}return i},O.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterator,r=this._iteratorCache,i=0;return new E(function(){if(i>=r.length){var e=n.next();if(e.done)return e;r[i]=e.value}return A(t,i,r[i++])})};var _n;t($,T),$.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},$.prototype.get=function(t,e){return this.has(t)?this._value:e},$.prototype.includes=function(t){return H(this._value,t)},$.prototype.slice=function(t,e){var n=this.size;return v(t,e,n)?this:new $(this._value,g(e,n)-x(t,n))},$.prototype.reverse=function(){return this},$.prototype.indexOf=function(t){return H(this._value,t)?0:-1},$.prototype.lastIndexOf=function(t){return H(this._value,t)?this.size:-1},$.prototype.__iterate=function(t,e){for(var n=0;n<this.size;n++)if(!1===t(this._value,n,this))return n+1;return n},$.prototype.__iterator=function(t,e){var n=this,r=0;return new E(function(){return r<n.size?A(t,r++,n._value):S()})},$.prototype.equals=function(t){return t instanceof $?H(this._value,t._value):V(t)};var bn;t(Q,T),Q.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},Q.prototype.get=function(t,e){return this.has(t)?this._start+m(this,t)*this._step:e},Q.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},Q.prototype.slice=function(t,e){return v(t,e,this.size)?this:(t=x(t,this.size),e=g(e,this.size),e<=t?new Q(0,0):new Q(this.get(t,this._end),this.get(e,this._end),this._step))},Q.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var n=e/this._step;if(n>=0&&n<this.size)return n}return-1},Q.prototype.lastIndexOf=function(t){return this.indexOf(t)},Q.prototype.__iterate=function(t,e){for(var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;o<=n;o++){if(!1===t(i,o,this))return o+1;i+=e?-r:r}return o},Q.prototype.__iterator=function(t,e){var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;return new E(function(){var s=i;return i+=e?-r:r,o>n?S():A(t,o++,s)})},Q.prototype.equals=function(t){return t instanceof Q?this._start===t._start&&this._end===t._end&&this._step===t._step:V(this,t)};var Fn;t(tt,e),t(et,tt),t(nt,tt),t(rt,tt),tt.Keyed=et,tt.Indexed=nt,tt.Set=rt;var kn,In="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t|=0,e|=0;var n=65535&t,r=65535&e;return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0},Tn=Object.isExtensible,Bn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),Mn="function"==typeof WeakMap;Mn&&(kn=new WeakMap);var Pn=0,Nn="__immutablehash__";"function"==typeof Symbol&&(Nn=Symbol(Nn));var On=16,Rn=255,Un=0,jn={};t(lt,et),lt.of=function(){var t=un.call(arguments,0);return At().withMutations(function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}})},lt.prototype.toString=function(){return this.__toString("Map {","}")},lt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},lt.prototype.set=function(t,e){return St(this,t,e)},lt.prototype.setIn=function(t,e){return this.updateIn(t,yn,function(){return e})},lt.prototype.remove=function(t){return St(this,t,yn)},lt.prototype.deleteIn=function(t){return this.updateIn(t,function(){return yn})},lt.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},lt.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=Pt(this,Te(t),e,n);return r===yn?void 0:r},lt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):At()},lt.prototype.merge=function(){return It(this,void 0,arguments)},lt.prototype.mergeWith=function(t){return It(this,t,un.call(arguments,1))},lt.prototype.mergeIn=function(t){var e=un.call(arguments,1);return this.updateIn(t,At(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},lt.prototype.mergeDeep=function(){return It(this,Tt,arguments)},lt.prototype.mergeDeepWith=function(t){var e=un.call(arguments,1);return It(this,Bt(t),e)},lt.prototype.mergeDeepIn=function(t){var e=un.call(arguments,1);return this.updateIn(t,At(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},lt.prototype.sort=function(t){return Zt(De(this,t))},lt.prototype.sortBy=function(t,e){return Zt(De(this,e,t))},lt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},lt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new p)},lt.prototype.asImmutable=function(){return this.__ensureOwner()},lt.prototype.wasAltered=function(){return this.__altered},lt.prototype.__iterator=function(t,e){return new xt(this,t,e)},lt.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},lt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Et(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},lt.isMap=pt;var Ln="@@__IMMUTABLE_MAP__@@",zn=lt.prototype;zn[Ln]=!0,zn.delete=zn.remove,zn.removeIn=zn.deleteIn,ft.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,s=i.length;o<s;o++)if(H(n,i[o][0]))return i[o][1];return r},ft.prototype.update=function(t,e,n,r,i,o,s){for(var a=i===yn,u=this.entries,c=0,h=u.length;c<h&&!H(r,u[c][0]);c++);var p=c<h;if(p?u[c][1]===i:a)return this;if(l(s),(a||!p)&&l(o),!a||1!==u.length){if(!p&&!a&&u.length>=Xn)return bt(t,u,r,i);var d=t&&t===this.ownerID,m=d?u:f(u);return p?a?c===h-1?m.pop():m[c]=m.pop():m[c]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new ft(t,m)}},dt.prototype.get=function(t,e,n,r){void 0===e&&(e=ot(n));var i=1<<((0===t?e:e>>>t)&mn),o=this.bitmap;return 0==(o&i)?r:this.nodes[Nt(o&i-1)].get(t+fn,e,n,r)},dt.prototype.update=function(t,e,n,r,i,o,s){void 0===n&&(n=ot(r));var a=(0===e?n:n>>>e)&mn,u=1<<a,c=this.bitmap,h=0!=(c&u);if(!h&&i===yn)return this;var l=Nt(c&u-1),p=this.nodes,f=h?p[l]:void 0,d=wt(f,t,e+fn,n,r,i,o,s);if(d===f)return this;if(!h&&d&&p.length>=qn)return kt(t,p,c,a,d);if(h&&!d&&2===p.length&&Ct(p[1^l]))return p[1^l];if(h&&d&&1===p.length&&Ct(d))return d;var m=t&&t===this.ownerID,y=h?d?c:c^u:c|u,v=h?d?Ot(p,l,d,m):Ut(p,l,m):Rt(p,l,d,m);return m?(this.bitmap=y,this.nodes=v,this):new dt(t,y,v)},mt.prototype.get=function(t,e,n,r){void 0===e&&(e=ot(n));var i=(0===t?e:e>>>t)&mn,o=this.nodes[i];return o?o.get(t+fn,e,n,r):r},mt.prototype.update=function(t,e,n,r,i,o,s){void 0===n&&(n=ot(r));var a=(0===e?n:n>>>e)&mn,u=i===yn,c=this.nodes,h=c[a];if(u&&!h)return this;var l=wt(h,t,e+fn,n,r,i,o,s);if(l===h)return this;var p=this.count;if(h){if(!l&&--p<Kn)return Ft(t,c,p,a)}else p++;var f=t&&t===this.ownerID,d=Ot(c,a,l,f);return f?(this.count=p,this.nodes=d,this):new mt(t,p,d)},yt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,s=i.length;o<s;o++)if(H(n,i[o][0]))return i[o][1];return r},yt.prototype.update=function(t,e,n,r,i,o,s){void 0===n&&(n=ot(r));var a=i===yn;if(n!==this.keyHash)return a?this:(l(s),l(o),_t(this,t,e,n,[r,i]));for(var u=this.entries,c=0,h=u.length;c<h&&!H(r,u[c][0]);c++);var p=c<h;if(p?u[c][1]===i:a)return this;if(l(s),(a||!p)&&l(o),a&&2===h)return new vt(t,this.keyHash,u[1^c]);var d=t&&t===this.ownerID,m=d?u:f(u);return p?a?c===h-1?m.pop():m[c]=m.pop():m[c]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new yt(t,this.keyHash,m)},vt.prototype.get=function(t,e,n,r){return H(n,this.entry[0])?this.entry[1]:r},vt.prototype.update=function(t,e,n,r,i,o,s){var a=i===yn,u=H(r,this.entry[0]);return(u?i===this.entry[1]:a)?this:(l(s),a?void l(o):u?t&&t===this.ownerID?(this.entry[1]=i,this):new vt(t,this.keyHash,[r,i]):(l(o),_t(this,t,e,ot(r),[r,i])))},ft.prototype.iterate=yt.prototype.iterate=function(t,e){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(!1===t(n[e?i-r:r]))return!1},dt.prototype.iterate=mt.prototype.iterate=function(t,e){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[e?i-r:r];if(o&&!1===o.iterate(t,e))return!1}},vt.prototype.iterate=function(t,e){return t(this.entry)},t(xt,E),xt.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return gt(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,i<=n)return gt(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,i<=n){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return gt(t,o.entry);e=this._stack=Dt(o,e)}continue}e=this._stack=this._stack.__prev}return S()};var Jn,Xn=dn/4,qn=dn/2,Kn=dn/4;t(jt,nt),jt.of=function(){return this(arguments)},jt.prototype.toString=function(){return this.__toString("List [","]")},jt.prototype.get=function(t,e){if((t=m(this,t))>=0&&t<this.size){t+=this._origin;var n=Gt(this,t);return n&&n.array[t&mn]}return e},jt.prototype.set=function(t,e){return Kt(this,t,e)},jt.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},jt.prototype.insert=function(t,e){return this.splice(t,0,e)},jt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=fn,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):qt()},jt.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(n){Ht(n,0,e+t.length);for(var r=0;r<t.length;r++)n.set(e+r,t[r])})},jt.prototype.pop=function(){return Ht(this,0,-1)},jt.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){Ht(e,-t.length);for(var n=0;n<t.length;n++)e.set(n,t[n])})},jt.prototype.shift=function(){return Ht(this,1)},jt.prototype.merge=function(){return Vt(this,void 0,arguments)},jt.prototype.mergeWith=function(t){return Vt(this,t,un.call(arguments,1))},jt.prototype.mergeDeep=function(){return Vt(this,Tt,arguments)},jt.prototype.mergeDeepWith=function(t){var e=un.call(arguments,1);return Vt(this,Bt(t),e)},jt.prototype.setSize=function(t){return Ht(this,0,t)},jt.prototype.slice=function(t,e){var n=this.size;return v(t,e,n)?this:Ht(this,x(t,n),g(e,n))},jt.prototype.__iterator=function(t,e){var n=0,r=Jt(this,e);return new E(function(){var e=r();return e===Hn?S():A(t,n++,e)})},jt.prototype.__iterate=function(t,e){for(var n,r=0,i=Jt(this,e);(n=i())!==Hn&&!1!==t(n,r++,this););return r},jt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Xt(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},jt.isList=Lt;var Yn="@@__IMMUTABLE_LIST__@@",Wn=jt.prototype;Wn[Yn]=!0,Wn.delete=Wn.remove,Wn.setIn=zn.setIn,Wn.deleteIn=Wn.removeIn=zn.removeIn,Wn.update=zn.update,Wn.updateIn=zn.updateIn,Wn.mergeIn=zn.mergeIn,Wn.mergeDeepIn=zn.mergeDeepIn,Wn.withMutations=zn.withMutations,Wn.asMutable=zn.asMutable,Wn.asImmutable=zn.asImmutable,Wn.wasAltered=zn.wasAltered,zt.prototype.removeBefore=function(t,e,n){if(n===e?1<<e:0===this.array.length)return this;var r=n>>>e&mn;if(r>=this.array.length)return new zt([],t);var i,o=0===r;if(e>0){var s=this.array[r];if((i=s&&s.removeBefore(t,e-fn,n))===s&&o)return this}if(o&&!i)return this;var a=Wt(this,t);if(!o)for(var u=0;u<r;u++)a.array[u]=void 0;return i&&(a.array[r]=i),a},zt.prototype.removeAfter=function(t,e,n){if(n===(e?1<<e:0)||0===this.array.length)return this;var r=n-1>>>e&mn;if(r>=this.array.length)return this;var i;if(e>0){var o=this.array[r];if((i=o&&o.removeAfter(t,e-fn,n))===o&&r===this.array.length-1)return this}var s=Wt(this,t);return s.array.splice(r+1),i&&(s.array[r]=i),s};var Gn,Hn={};t(Zt,lt),Zt.of=function(){return this(arguments)},Zt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Zt.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},Zt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):ee()},Zt.prototype.set=function(t,e){return ne(this,t,e)},Zt.prototype.remove=function(t){return ne(this,t,yn)},Zt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Zt.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],n)},e)},Zt.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Zt.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?te(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},Zt.isOrderedMap=Qt,Zt.prototype[pn]=!0,Zt.prototype.delete=Zt.prototype.remove;var Vn;t(re,I),re.prototype.get=function(t,e){return this._iter.get(t,e)},re.prototype.has=function(t){return this._iter.has(t)},re.prototype.valueSeq=function(){return this._iter.valueSeq()},re.prototype.reverse=function(){var t=this,e=ce(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},re.prototype.map=function(t,e){var n=this,r=ue(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},re.prototype.__iterate=function(t,e){var n,r=this;return this._iter.__iterate(this._useKeys?function(e,n){return t(e,n,r)}:(n=e?_e(this):0,function(i){return t(i,e?--n:n++,r)}),e)},re.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var n=this._iter.__iterator(Dn,e),r=e?_e(this):0;return new E(function(){var i=n.next();return i.done?i:A(t,e?--r:r++,i.value,i)})},re.prototype[pn]=!0,t(ie,T),ie.prototype.includes=function(t){return this._iter.includes(t)},ie.prototype.__iterate=function(t,e){var n=this,r=0;return this._iter.__iterate(function(e){return t(e,r++,n)},e)},ie.prototype.__iterator=function(t,e){var n=this._iter.__iterator(Dn,e),r=0;return new E(function(){var e=n.next();return e.done?e:A(t,r++,e.value,e)})},t(oe,B),oe.prototype.has=function(t){return this._iter.includes(t)},oe.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},oe.prototype.__iterator=function(t,e){var n=this._iter.__iterator(Dn,e);return new E(function(){var e=n.next();return e.done?e:A(t,e.value,e.value,e)})},t(se,I),se.prototype.entrySeq=function(){return this._iter.toSeq()},se.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){Ce(e);var r=o(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},se.prototype.__iterator=function(t,e){var n=this._iter.__iterator(Dn,e);return new E(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){Ce(r);var i=o(r);return A(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},ie.prototype.cacheResult=re.prototype.cacheResult=oe.prototype.cacheResult=se.prototype.cacheResult=ke,t(Be,et),Be.prototype.toString=function(){return this.__toString(Pe(this)+" {","}")},Be.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},Be.prototype.get=function(t,e){if(!this.has(t))return e;var n=this._defaultValues[t];return this._map?this._map.get(t,n):n},Be.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=Me(this,At()))},Be.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+Pe(this));if(this._map&&!this._map.has(t)){if(e===this._defaultValues[t])return this}var n=this._map&&this._map.set(t,e);return this.__ownerID||n===this._map?this:Me(this,n)},Be.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:Me(this,e)},Be.prototype.wasAltered=function(){return this._map.wasAltered()},Be.prototype.__iterator=function(t,e){var r=this;return n(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},Be.prototype.__iterate=function(t,e){var r=this;return n(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},Be.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?Me(this,e,t):(this.__ownerID=t,this._map=e,this)};var $n=Be.prototype;$n.delete=$n.remove,$n.deleteIn=$n.removeIn=zn.removeIn,$n.merge=zn.merge,$n.mergeWith=zn.mergeWith,$n.mergeIn=zn.mergeIn,$n.mergeDeep=zn.mergeDeep,$n.mergeDeepWith=zn.mergeDeepWith,$n.mergeDeepIn=zn.mergeDeepIn,$n.setIn=zn.setIn,$n.update=zn.update,$n.updateIn=zn.updateIn,$n.withMutations=zn.withMutations,$n.asMutable=zn.asMutable,$n.asImmutable=zn.asImmutable,t(Re,rt),Re.of=function(){return this(arguments)},Re.fromKeys=function(t){return this(n(t).keySeq())},Re.prototype.toString=function(){return this.__toString("Set {","}")},Re.prototype.has=function(t){return this._map.has(t)},Re.prototype.add=function(t){return je(this,this._map.set(t,!0))},Re.prototype.remove=function(t){return je(this,this._map.remove(t))},Re.prototype.clear=function(){return je(this,this._map.clear())},Re.prototype.union=function(){var t=un.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach(function(t){return e.add(t)})}):this.constructor(t[0])},Re.prototype.intersect=function(){var t=un.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return i(t)});var e=this;return this.withMutations(function(n){e.forEach(function(e){t.every(function(t){return t.includes(e)})||n.remove(e)})})},Re.prototype.subtract=function(){var t=un.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return i(t)});var e=this;return this.withMutations(function(n){e.forEach(function(e){t.some(function(t){return t.includes(e)})&&n.remove(e)})})},Re.prototype.merge=function(){return this.union.apply(this,arguments)},Re.prototype.mergeWith=function(t){var e=un.call(arguments,1);return this.union.apply(this,e)},Re.prototype.sort=function(t){return Je(De(this,t))},Re.prototype.sortBy=function(t,e){return Je(De(this,e,t))},Re.prototype.wasAltered=function(){return this._map.wasAltered()},Re.prototype.__iterate=function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},Re.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},Re.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},Re.isSet=Ue;var Zn="@@__IMMUTABLE_SET__@@",Qn=Re.prototype;Qn[Zn]=!0,Qn.delete=Qn.remove,Qn.mergeDeep=Qn.merge,Qn.mergeDeepWith=Qn.mergeWith,Qn.withMutations=zn.withMutations,Qn.asMutable=zn.asMutable,Qn.asImmutable=zn.asImmutable,Qn.__empty=ze,Qn.__make=Le;var tr;t(Je,Re),Je.of=function(){return this(arguments)},Je.fromKeys=function(t){return this(n(t).keySeq())},Je.prototype.toString=function(){return this.__toString("OrderedSet {","}")},Je.isOrderedSet=Xe;var er=Je.prototype;er[pn]=!0,er.__empty=Ke,er.__make=qe;var nr;t(Ye,nt),Ye.of=function(){return this(arguments)},Ye.prototype.toString=function(){return this.__toString("Stack [","]")},Ye.prototype.get=function(t,e){var n=this._head;for(t=m(this,t);n&&t--;)n=n.next;return n?n.value:e},Ye.prototype.peek=function(){return this._head&&this._head.value},Ye.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,n=arguments.length-1;n>=0;n--)e={value:arguments[n],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):Ge(t,e)},Ye.prototype.pushAll=function(t){if(t=r(t),0===t.size)return this;ht(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):Ge(e,n)},Ye.prototype.pop=function(){return this.slice(1)},Ye.prototype.unshift=function(){return this.push.apply(this,arguments)},Ye.prototype.unshiftAll=function(t){return this.pushAll(t)},Ye.prototype.shift=function(){return this.pop.apply(this,arguments)},Ye.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):He()},Ye.prototype.slice=function(t,e){if(v(t,e,this.size))return this;var n=x(t,this.size);if(g(e,this.size)!==this.size)return nt.prototype.slice.call(this,t,e);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Ge(r,i)},Ye.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ge(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ye.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var n=0,r=this._head;r&&!1!==t(r.value,n++,this);)r=r.next;return n},Ye.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var n=0,r=this._head;return new E(function(){if(r){var e=r.value;return r=r.next,A(t,n++,e)}return S()})},Ye.isStack=We;var rr="@@__IMMUTABLE_STACK__@@",ir=Ye.prototype;ir[rr]=!0,ir.withMutations=zn.withMutations,ir.asMutable=zn.asMutable,ir.asImmutable=zn.asImmutable,ir.wasAltered=zn.wasAltered;var or;e.Iterator=E,Ve(e,{toArray:function(){ht(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate(function(e,n){t[n]=e}),t},toIndexedSeq:function(){return new ie(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new re(this,!0)},toMap:function(){return lt(this.toKeyedSeq())},toObject:function(){ht(this.size);var t={};return this.__iterate(function(e,n){t[n]=e}),t},toOrderedMap:function(){return Zt(this.toKeyedSeq())},toOrderedSet:function(){return Je(s(this)?this.valueSeq():this)},toSet:function(){return Re(s(this)?this.valueSeq():this)},toSetSeq:function(){return new oe(this)},toSeq:function(){return a(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Ye(s(this)?this.valueSeq():this)},toList:function(){return jt(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){return we(this,ye(this,un.call(arguments,0)))},includes:function(t){return this.some(function(e){return H(e,t)})},entries:function(){return this.__iterator(En)},every:function(t,e){ht(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!t.call(e,r,i,o))return n=!1,!1}),n},filter:function(t,e){return we(this,he(this,t,e,!0))},find:function(t,e,n){var r=this.findEntry(t,e);return r?r[1]:n},forEach:function(t,e){return ht(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){ht(this.size),t=void 0!==t?""+t:",";var e="",n=!0;return this.__iterate(function(r){n?n=!1:e+=t,e+=null!==r&&void 0!==r?r.toString():""}),e},keys:function(){return this.__iterator(gn)},map:function(t,e){return we(this,ue(this,t,e))},reduce:function(t,e,n){ht(this.size);var r,i;return arguments.length<2?i=!0:r=e,this.__iterate(function(e,o,s){i?(i=!1,r=e):r=t.call(n,r,e,o,s)}),r},reduceRight:function(t,e,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return we(this,ce(this,!0))},slice:function(t,e){return we(this,fe(this,t,e,!0))},some:function(t,e){return!this.every(Qe(t),e)},sort:function(t){return we(this,De(this,t))},values:function(){return this.__iterator(Dn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return d(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return le(this,t,e)},equals:function(t){return V(this,t)},entrySeq:function(){var t=this;if(t._cache)return new M(t._cache);var e=t.toSeq().map(Ze).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Qe(t),e)},findEntry:function(t,e,n){var r=n;return this.__iterate(function(n,i,o){if(t.call(e,n,i,o))return r=[i,n],!1}),r},findKey:function(t,e){var n=this.findEntry(t,e);return n&&n[0]},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},findLastEntry:function(t,e,n){return this.toKeyedSeq().reverse().findEntry(t,e,n)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(y)},flatMap:function(t,e){return we(this,xe(this,t,e))},flatten:function(t){return we(this,ve(this,t,!0))},fromEntrySeq:function(){return new se(this)},get:function(t,e){return this.find(function(e,n){return H(n,t)},void 0,e)},getIn:function(t,e){for(var n,r=this,i=Te(t);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,yn):yn)===yn)return e}return r},groupBy:function(t,e){return pe(this,t,e)},has:function(t){return this.get(t,yn)!==yn},hasIn:function(t){return this.getIn(t,yn)!==yn},isSubset:function(t){return t="function"==typeof t.includes?t:e(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return t="function"==typeof t.isSubset?t:e(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(e){return H(e,t)})},keySeq:function(){return this.toSeq().map($e).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Ee(this,t)},maxBy:function(t,e){return Ee(this,e,t)},min:function(t){return Ee(this,t?tn(t):rn)},minBy:function(t,e){return Ee(this,e?tn(e):rn,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return we(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return we(this,me(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Qe(t),e)},sortBy:function(t,e){return we(this,De(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return we(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return we(this,de(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Qe(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=on(this))}});var sr=e.prototype;sr[cn]=!0,sr[wn]=sr.values,sr.__toJS=sr.toArray,sr.__toStringMapper=en,sr.inspect=sr.toSource=function(){return this.toString()},sr.chain=sr.flatMap,sr.contains=sr.includes,Ve(n,{flip:function(){return we(this,ae(this))},mapEntries:function(t,e){var n=this,r=0;return we(this,this.toSeq().map(function(i,o){return t.call(e,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(t,e){var n=this;return we(this,this.toSeq().flip().map(function(r,i){return t.call(e,r,i,n)}).flip())}});var ar=n.prototype;return ar[hn]=!0,ar[wn]=sr.entries,ar.__toJS=sr.toObject,ar.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+en(t)},Ve(r,{toKeyedSeq:function(){return new re(this,!1)},filter:function(t,e){return we(this,he(this,t,e,!1))},findIndex:function(t,e){var n=this.findEntry(t,e);return n?n[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return we(this,ce(this,!1))},slice:function(t,e){return we(this,fe(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=x(t,t<0?this.count():this.size);var r=this.slice(0,t);return we(this,1===n?r:r.concat(f(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var n=this.findLastEntry(t,e);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(t){return we(this,ve(this,t,!1))},get:function(t,e){return t=m(this,t),t<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,n){return n===t},void 0,e)},has:function(t){return(t=m(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return we(this,ge(this,t))},interleave:function(){var t=[this].concat(f(arguments)),e=Se(this.toSeq(),T.of,t),n=e.flatten(!0);return e.size&&(n.size=e.size*t.length),we(this,n)},keySeq:function(){return Q(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(t,e){return we(this,me(this,t,e,!1))},zip:function(){return we(this,Se(this,nn,[this].concat(f(arguments))))},zipWith:function(t){var e=f(arguments);return e[0]=this,we(this,Se(this,t,e))}}),r.prototype[ln]=!0,r.prototype[pn]=!0,Ve(i,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=sr.includes,i.prototype.contains=i.prototype.includes,Ve(I,n.prototype),Ve(T,r.prototype),Ve(B,i.prototype),Ve(et,n.prototype),Ve(nt,r.prototype),Ve(rt,i.prototype),{Iterable:e,Seq:k,Collection:tt,Map:lt,OrderedMap:Zt,List:jt,Stack:Ye,Set:Re,OrderedSet:Je,Record:Be,Range:Q,Repeat:$,is:H,fromJS:K}})},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";var r=n(236);t.exports=r},function(t,e,n){"use strict";function r(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}var i=n(238),o=n(237);t.exports.Type=n(0),t.exports.Schema=n(24),t.exports.FAILSAFE_SCHEMA=n(71),t.exports.JSON_SCHEMA=n(111),t.exports.CORE_SCHEMA=n(110),t.exports.DEFAULT_SAFE_SCHEMA=n(34),t.exports.DEFAULT_FULL_SCHEMA=n(47),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=o.dump,t.exports.safeDump=o.safeDump,t.exports.YAMLException=n(33),t.exports.MINIMAL_SCHEMA=n(71),t.exports.SAFE_SCHEMA=n(34),t.exports.DEFAULT_SCHEMA=n(47),t.exports.scan=r("scan"),t.exports.parse=r("parse"),t.exports.compose=r("compose"),t.exports.addConstructor=r("addConstructor")},function(t,e,n){"use strict";function r(t,e){var n,r,i,o,s,a,u;if(null===e)return{};for(n={},r=Object.keys(e),i=0,o=r.length;i<o;i+=1)s=r[i],a=String(e[s]),"!!"===s.slice(0,2)&&(s="tag:yaml.org,2002:"+s.slice(2)),u=t.compiledTypeMap.fallback[s],u&&N.call(u.styleAliases,a)&&(a=u.styleAliases[a]),n[s]=a;return n}function i(t){var e,n,r;if(e=t.toString(16).toUpperCase(),t<=255)n="x",r=2;else if(t<=65535)n="u",r=4;else{if(!(t<=4294967295))throw new T("code point within a string may not be greater than 0xFFFFFFFF");n="U",r=8}return"\\"+n+I.repeat("0",r-e.length)+e}function o(t){this.schema=t.schema||B,this.indent=Math.max(1,t.indent||2),this.skipInvalid=t.skipInvalid||!1,this.flowLevel=I.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=r(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function s(t,e){for(var n,r=I.repeat(" ",e),i=0,o=-1,s="",a=t.length;i<a;)o=t.indexOf("\n",i),-1===o?(n=t.slice(i),i=a):(n=t.slice(i,o+1),i=o+1),n.length&&"\n"!==n&&(s+=r),s+=n;return s}function a(t,e){return"\n"+I.repeat(" ",t.indent*e)}function u(t,e){var n,r,i;for(n=0,r=t.implicitTypes.length;n<r;n+=1)if(i=t.implicitTypes[n],i.resolve(e))return!0;return!1}function c(t){return t===U||t===O}function h(t){return 32<=t&&t<=126||161<=t&&t<=55295&&8232!==t&&8233!==t||57344<=t&&t<=65533&&65279!==t||65536<=t&&t<=1114111}function l(t){return h(t)&&65279!==t&&t!==Y&&t!==Z&&t!==Q&&t!==et&&t!==rt&&t!==G&&t!==z}function p(t){return h(t)&&65279!==t&&!c(t)&&t!==W&&t!==V&&t!==G&&t!==Y&&t!==Z&&t!==Q&&t!==et&&t!==rt&&t!==z&&t!==X&&t!==K&&t!==j&&t!==nt&&t!==H&&t!==q&&t!==L&&t!==J&&t!==$&&t!==tt}function f(t,e,n,r,i){var o,s,a=!1,u=!1,f=-1!==r,d=-1,m=p(t.charCodeAt(0))&&!c(t.charCodeAt(t.length-1));if(e)for(o=0;o<t.length;o++){if(s=t.charCodeAt(o),!h(s))return ht;m=m&&l(s)}else{for(o=0;o<t.length;o++){if((s=t.charCodeAt(o))===R)a=!0,f&&(u=u||o-d-1>r&&" "!==t[d+1],d=o);else if(!h(s))return ht;m=m&&l(s)}u=u||f&&o-d-1>r&&" "!==t[d+1]}return a||u?" "===t[0]&&n>9?ht:u?ct:ut:m&&!i(t)?st:at}function d(t,e,n,r){t.dump=function(){function i(e){return u(t,e)}if(0===e.length)return"''";if(!t.noCompatMode&&-1!==ot.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,n),a=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),c=r||t.flowLevel>-1&&n>=t.flowLevel;switch(f(e,c,t.indent,a,i)){case st:return e;case at:return"'"+e.replace(/'/g,"''")+"'";case ut:return"|"+m(e,t.indent)+y(s(e,o));case ct:return">"+m(e,t.indent)+y(s(v(e,a),o));case ht:return'"'+g(e)+'"';default:throw new T("impossible error: invalid scalar style")}}()}function m(t,e){var n=" "===t[0]?String(e):"",r="\n"===t[t.length-1];return n+(!r||"\n"!==t[t.length-2]&&"\n"!==t?r?"":"-":"+")+"\n"}function y(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function v(t,e){for(var n,r,i=/(\n+)([^\n]*)/g,o=function(){var n=t.indexOf("\n");return n=-1!==n?n:t.length,i.lastIndex=n,x(t.slice(0,n),e)}(),s="\n"===t[0]||" "===t[0];r=i.exec(t);){var a=r[1],u=r[2];n=" "===u[0],o+=a+(s||n||""===u?"":"\n")+x(u,e),s=n}return o}function x(t,e){if(""===t||" "===t[0])return t;for(var n,r,i=/ [^ ]/g,o=0,s=0,a=0,u="";n=i.exec(t);)a=n.index,a-o>e&&(r=s>o?s:a,u+="\n"+t.slice(o,r),o=r+1),s=a;return u+="\n",t.length-o>e&&s>o?u+=t.slice(o,s)+"\n"+t.slice(s+1):u+=t.slice(o),u.slice(1)}function g(t){for(var e,n,r,o="",s=0;s<t.length;s++)e=t.charCodeAt(s),e>=55296&&e<=56319&&(n=t.charCodeAt(s+1))>=56320&&n<=57343?(o+=i(1024*(e-55296)+n-56320+65536),s++):(r=it[e],o+=!r&&h(e)?t[s]:r||i(e));return o}function D(t,e,n){var r,i,o="",s=t.tag;for(r=0,i=n.length;r<i;r+=1)C(t,e,n[r],!1,!1)&&(0!==r&&(o+=","+(t.condenseFlow?"":" ")),o+=t.dump);t.tag=s,t.dump="["+o+"]"}function E(t,e,n,r){var i,o,s="",u=t.tag;for(i=0,o=n.length;i<o;i+=1)C(t,e+1,n[i],!0,!0)&&(r&&0===i||(s+=a(t,e)),t.dump&&R===t.dump.charCodeAt(0)?s+="-":s+="- ",s+=t.dump);t.tag=u,t.dump=s||"[]"}function A(t,e,n){var r,i,o,s,a,u="",c=t.tag,h=Object.keys(n);for(r=0,i=h.length;r<i;r+=1)a=t.condenseFlow?'"':"",0!==r&&(a+=", "),o=h[r],s=n[o],C(t,e,o,!1,!1)&&(t.dump.length>1024&&(a+="? "),a+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),C(t,e,s,!1,!1)&&(a+=t.dump,u+=a));t.tag=c,t.dump="{"+u+"}"}function S(t,e,n,r){var i,o,s,u,c,h,l="",p=t.tag,f=Object.keys(n);if(!0===t.sortKeys)f.sort();else if("function"==typeof t.sortKeys)f.sort(t.sortKeys);else if(t.sortKeys)throw new T("sortKeys must be a boolean or a function");for(i=0,o=f.length;i<o;i+=1)h="",r&&0===i||(h+=a(t,e)),s=f[i],u=n[s],C(t,e+1,s,!0,!0,!0)&&(c=null!==t.tag&&"?"!==t.tag||t.dump&&t.dump.length>1024,c&&(t.dump&&R===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,c&&(h+=a(t,e)),C(t,e+1,u,!0,c)&&(t.dump&&R===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,l+=h));t.tag=p,t.dump=l||"{}"}function w(t,e,n){var r,i,o,s,a,u;for(i=n?t.explicitTypes:t.implicitTypes,o=0,s=i.length;o<s;o+=1)if(a=i[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||"object"==typeof e&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(t.tag=n?a.tag:"?",a.represent){if(u=t.styleMap[a.tag]||a.defaultStyle,"[object Function]"===P.call(a.represent))r=a.represent(e,u);else{if(!N.call(a.represent,u))throw new T("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');r=a.represent[u](e,u)}t.dump=r}return!0}return!1}function C(t,e,n,r,i,o){t.tag=null,t.dump=n,w(t,n,!1)||w(t,n,!0);var s=P.call(t.dump);r&&(r=t.flowLevel<0||t.flowLevel>e);var a,u,c="[object Object]"===s||"[object Array]"===s;if(c&&(a=t.duplicates.indexOf(n),u=-1!==a),(null!==t.tag&&"?"!==t.tag||u||2!==t.indent&&e>0)&&(i=!1),u&&t.usedDuplicates[a])t.dump="*ref_"+a;else{if(c&&u&&!t.usedDuplicates[a]&&(t.usedDuplicates[a]=!0),"[object Object]"===s)r&&0!==Object.keys(t.dump).length?(S(t,e,t.dump,i),u&&(t.dump="&ref_"+a+t.dump)):(A(t,e,t.dump),u&&(t.dump="&ref_"+a+" "+t.dump));else if("[object Array]"===s)r&&0!==t.dump.length?(E(t,e,t.dump,i),u&&(t.dump="&ref_"+a+t.dump)):(D(t,e,t.dump),u&&(t.dump="&ref_"+a+" "+t.dump));else{if("[object String]"!==s){if(t.skipInvalid)return!1;throw new T("unacceptable kind of an object to dump "+s)}"?"!==t.tag&&d(t,t.dump,e,o)}null!==t.tag&&"?"!==t.tag&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function _(t,e){var n,r,i=[],o=[];for(b(t,i,o),n=0,r=o.length;n<r;n+=1)e.duplicates.push(i[o[n]]);e.usedDuplicates=new Array(r)}function b(t,e,n){var r,i,o;if(null!==t&&"object"==typeof t)if(-1!==(i=e.indexOf(t)))-1===n.indexOf(i)&&n.push(i);else if(e.push(t),Array.isArray(t))for(i=0,o=t.length;i<o;i+=1)b(t[i],e,n);else for(r=Object.keys(t),i=0,o=r.length;i<o;i+=1)b(t[r[i]],e,n)}function F(t,e){e=e||{};var n=new o(e);return n.noRefs||_(t,n),C(n,0,t,!0,!0)?n.dump+"\n":""}function k(t,e){return F(t,I.extend({schema:M},e))}var I=n(23),T=n(33),B=n(47),M=n(34),P=Object.prototype.toString,N=Object.prototype.hasOwnProperty,O=9,R=10,U=32,j=33,L=34,z=35,J=37,X=38,q=39,K=42,Y=44,W=45,G=58,H=62,V=63,$=64,Z=91,Q=93,tt=96,et=123,nt=124,rt=125,it={};it[0]="\\0",it[7]="\\a",it[8]="\\b",it[9]="\\t",it[10]="\\n",it[11]="\\v",it[12]="\\f",it[13]="\\r",it[27]="\\e",it[34]='\\"',it[92]="\\\\",it[133]="\\N",it[160]="\\_",it[8232]="\\L",it[8233]="\\P";var ot=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],st=1,at=2,ut=3,ct=4,ht=5;t.exports.dump=F,t.exports.safeDump=k},function(t,e,n){"use strict";function r(t){return 10===t||13===t}function i(t){return 9===t||32===t}function o(t){return 9===t||32===t||10===t||13===t}function s(t){return 44===t||91===t||93===t||123===t||125===t}function a(t){var e;return 48<=t&&t<=57?t-48:(e=32|t,97<=e&&e<=102?e-97+10:-1)}function u(t){return 120===t?2:117===t?4:85===t?8:0}function c(t){return 48<=t&&t<=57?t-48:-1}function h(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t?"\t":9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"…":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function l(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}function p(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||q,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function f(t,e){return new z(e,new J(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function d(t,e){throw f(t,e)}function m(t,e){t.onWarning&&t.onWarning.call(null,f(t,e))}function y(t,e,n,r){var i,o,s,a;if(e<n){if(a=t.input.slice(e,n),r)for(i=0,o=a.length;i<o;i+=1)9===(s=a.charCodeAt(i))||32<=s&&s<=1114111||d(t,"expected valid JSON character");else Q.test(a)&&d(t,"the stream contains non-printable characters");t.result+=a}}function v(t,e,n,r){var i,o,s,a;for(L.isObject(n)||d(t,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),s=0,a=i.length;s<a;s+=1)o=i[s],K.call(e,o)||(e[o]=n[o],r[o]=!0)}function x(t,e,n,r,i,o,s,a){var u,c;if(i=String(i),null===e&&(e={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(u=0,c=o.length;u<c;u+=1)v(t,e,o[u],n);else v(t,e,o,n);else t.json||K.call(n,i)||!K.call(e,i)||(t.line=s||t.line,t.position=a||t.position,d(t,"duplicated mapping key")),e[i]=o,delete n[i];return e}function g(t){var e;e=t.input.charCodeAt(t.position),10===e?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):d(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function D(t,e,n){for(var o=0,s=t.input.charCodeAt(t.position);0!==s;){for(;i(s);)s=t.input.charCodeAt(++t.position);if(e&&35===s)do{s=t.input.charCodeAt(++t.position)}while(10!==s&&13!==s&&0!==s);if(!r(s))break;for(g(t),s=t.input.charCodeAt(t.position),o++,t.lineIndent=0;32===s;)t.lineIndent++,s=t.input.charCodeAt(++t.position)}return-1!==n&&0!==o&&t.lineIndent<n&&m(t,"deficient indentation"),o}function E(t){var e,n=t.position;return!(45!==(e=t.input.charCodeAt(n))&&46!==e||e!==t.input.charCodeAt(n+1)||e!==t.input.charCodeAt(n+2)||(n+=3,0!==(e=t.input.charCodeAt(n))&&!o(e)))}function A(t,e){1===e?t.result+=" ":e>1&&(t.result+=L.repeat("\n",e-1))}function S(t,e,n){var a,u,c,h,l,p,f,d,m,v=t.kind,x=t.result;if(m=t.input.charCodeAt(t.position),o(m)||s(m)||35===m||38===m||42===m||33===m||124===m||62===m||39===m||34===m||37===m||64===m||96===m)return!1;if((63===m||45===m)&&(u=t.input.charCodeAt(t.position+1),o(u)||n&&s(u)))return!1;for(t.kind="scalar",t.result="",c=h=t.position,l=!1;0!==m;){if(58===m){if(u=t.input.charCodeAt(t.position+1),o(u)||n&&s(u))break}else if(35===m){if(a=t.input.charCodeAt(t.position-1),o(a))break}else{if(t.position===t.lineStart&&E(t)||n&&s(m))break;if(r(m)){if(p=t.line,f=t.lineStart,d=t.lineIndent,D(t,!1,-1),t.lineIndent>=e){l=!0,m=t.input.charCodeAt(t.position);continue}t.position=h,t.line=p,t.lineStart=f,t.lineIndent=d;break}}l&&(y(t,c,h,!1),A(t,t.line-p),c=h=t.position,l=!1),i(m)||(h=t.position+1),m=t.input.charCodeAt(++t.position)}return y(t,c,h,!1),!!t.result||(t.kind=v,t.result=x,!1)}function w(t,e){var n,i,o;if(39!==(n=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,i=o=t.position;0!==(n=t.input.charCodeAt(t.position));)if(39===n){if(y(t,i,t.position,!0),39!==(n=t.input.charCodeAt(++t.position)))return!0;i=t.position,t.position++,o=t.position}else r(n)?(y(t,i,o,!0),A(t,D(t,!1,e)),i=o=t.position):t.position===t.lineStart&&E(t)?d(t,"unexpected end of the document within a single quoted scalar"):(t.position++,o=t.position);d(t,"unexpected end of the stream within a single quoted scalar")}function C(t,e){var n,i,o,s,c,h;if(34!==(h=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;0!==(h=t.input.charCodeAt(t.position));){if(34===h)return y(t,n,t.position,!0),t.position++,!0;if(92===h){if(y(t,n,t.position,!0),h=t.input.charCodeAt(++t.position),r(h))D(t,!1,e);else if(h<256&&it[h])t.result+=ot[h],t.position++;else if((c=u(h))>0){for(o=c,s=0;o>0;o--)h=t.input.charCodeAt(++t.position),(c=a(h))>=0?s=(s<<4)+c:d(t,"expected hexadecimal character");t.result+=l(s),t.position++}else d(t,"unknown escape sequence");n=i=t.position}else r(h)?(y(t,n,i,!0),A(t,D(t,!1,e)),n=i=t.position):t.position===t.lineStart&&E(t)?d(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}d(t,"unexpected end of the stream within a double quoted scalar")}function _(t,e){var n,r,i,s,a,u,c,h,l,p,f,m=!0,y=t.tag,v=t.anchor,g={};if(91===(f=t.input.charCodeAt(t.position)))s=93,c=!1,r=[];else{if(123!==f)return!1;s=125,c=!0,r={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=r),f=t.input.charCodeAt(++t.position);0!==f;){if(D(t,!0,e),(f=t.input.charCodeAt(t.position))===s)return t.position++,t.tag=y,t.anchor=v,t.kind=c?"mapping":"sequence",t.result=r,!0;m||d(t,"missed comma between flow collection entries"),l=h=p=null,a=u=!1,63===f&&(i=t.input.charCodeAt(t.position+1),o(i)&&(a=u=!0,t.position++,D(t,!0,e))),n=t.line,M(t,e,Y,!1,!0),l=t.tag,h=t.result,D(t,!0,e),f=t.input.charCodeAt(t.position),!u&&t.line!==n||58!==f||(a=!0,f=t.input.charCodeAt(++t.position),D(t,!0,e),M(t,e,Y,!1,!0),p=t.result),c?x(t,r,g,l,h,p):a?r.push(x(t,null,g,l,h,p)):r.push(h),D(t,!0,e),f=t.input.charCodeAt(t.position),44===f?(m=!0,f=t.input.charCodeAt(++t.position)):m=!1}d(t,"unexpected end of the stream within a flow collection")}function b(t,e){var n,o,s,a,u=V,h=!1,l=!1,p=e,f=0,m=!1;if(124===(a=t.input.charCodeAt(t.position)))o=!1;else{if(62!==a)return!1;o=!0}for(t.kind="scalar",t.result="";0!==a;)if(43===(a=t.input.charCodeAt(++t.position))||45===a)V===u?u=43===a?Z:$:d(t,"repeat of a chomping mode identifier");else{if(!((s=c(a))>=0))break;0===s?d(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?d(t,"repeat of an indentation width identifier"):(p=e+s-1,l=!0)}if(i(a)){do{a=t.input.charCodeAt(++t.position)}while(i(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!r(a)&&0!==a)}for(;0!==a;){for(g(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!l||t.lineIndent<p)&&32===a;)t.lineIndent++,a=t.input.charCodeAt(++t.position);if(!l&&t.lineIndent>p&&(p=t.lineIndent),r(a))f++;else{if(t.lineIndent<p){u===Z?t.result+=L.repeat("\n",h?1+f:f):u===V&&h&&(t.result+="\n");break}for(o?i(a)?(m=!0,t.result+=L.repeat("\n",h?1+f:f)):m?(m=!1,t.result+=L.repeat("\n",f+1)):0===f?h&&(t.result+=" "):t.result+=L.repeat("\n",f):t.result+=L.repeat("\n",h?1+f:f),h=!0,l=!0,f=0,n=t.position;!r(a)&&0!==a;)a=t.input.charCodeAt(++t.position);y(t,n,t.position,!1)}}return!0}function F(t,e){var n,r,i,s=t.tag,a=t.anchor,u=[],c=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=u),i=t.input.charCodeAt(t.position);0!==i&&45===i&&(r=t.input.charCodeAt(t.position+1),o(r));)if(c=!0,t.position++,D(t,!0,-1)&&t.lineIndent<=e)u.push(null),i=t.input.charCodeAt(t.position);else if(n=t.line,M(t,e,G,!1,!0),u.push(t.result),D(t,!0,-1),i=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==i)d(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!c&&(t.tag=s,t.anchor=a,t.kind="sequence",t.result=u,!0)}function k(t,e,n){var r,s,a,u,c,h=t.tag,l=t.anchor,p={},f={},m=null,y=null,v=null,g=!1,E=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=p),c=t.input.charCodeAt(t.position);0!==c;){if(r=t.input.charCodeAt(t.position+1),a=t.line,u=t.position,63!==c&&58!==c||!o(r)){if(!M(t,n,W,!1,!0))break;if(t.line===a){for(c=t.input.charCodeAt(t.position);i(c);)c=t.input.charCodeAt(++t.position);if(58===c)c=t.input.charCodeAt(++t.position),o(c)||d(t,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(x(t,p,f,m,y,null),m=y=v=null),E=!0,g=!1,s=!1,m=t.tag,y=t.result;else{if(!E)return t.tag=h,t.anchor=l,!0;d(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!E)return t.tag=h,t.anchor=l,!0;d(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(g&&(x(t,p,f,m,y,null),m=y=v=null),E=!0,g=!0,s=!0):g?(g=!1,s=!0):d(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,c=r;if((t.line===a||t.lineIndent>e)&&(M(t,e,H,!0,s)&&(g?y=t.result:v=t.result),g||(x(t,p,f,m,y,v,a,u),m=y=v=null),D(t,!0,-1),c=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==c)d(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return g&&x(t,p,f,m,y,null),E&&(t.tag=h,t.anchor=l,t.kind="mapping",t.result=p),E}function I(t){var e,n,r,i,s=!1,a=!1;if(33!==(i=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&d(t,"duplication of a tag property"),i=t.input.charCodeAt(++t.position),60===i?(s=!0,i=t.input.charCodeAt(++t.position)):33===i?(a=!0,n="!!",i=t.input.charCodeAt(++t.position)):n="!",e=t.position,s){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&62!==i);t.position<t.length?(r=t.input.slice(e,t.position),i=t.input.charCodeAt(++t.position)):d(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!o(i);)33===i&&(a?d(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),nt.test(n)||d(t,"named tag handle cannot contain such characters"),a=!0,e=t.position+1)),i=t.input.charCodeAt(++t.position);r=t.input.slice(e,t.position),et.test(r)&&d(t,"tag suffix cannot contain flow indicator characters")}return r&&!rt.test(r)&&d(t,"tag name cannot contain such characters: "+r),s?t.tag=r:K.call(t.tagMap,n)?t.tag=t.tagMap[n]+r:"!"===n?t.tag="!"+r:"!!"===n?t.tag="tag:yaml.org,2002:"+r:d(t,'undeclared tag handle "'+n+'"'),!0}function T(t){var e,n;if(38!==(n=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&d(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!o(n)&&!s(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&d(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function B(t){var e,n,r;if(42!==(r=t.input.charCodeAt(t.position)))return!1;for(r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!o(r)&&!s(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&d(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),t.anchorMap.hasOwnProperty(n)||d(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],D(t,!0,-1),!0}function M(t,e,n,r,i){var o,s,a,u,c,h,l,p,f=1,m=!1,y=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,o=s=a=H===n||G===n,r&&D(t,!0,-1)&&(m=!0,t.lineIndent>e?f=1:t.lineIndent===e?f=0:t.lineIndent<e&&(f=-1)),1===f)for(;I(t)||T(t);)D(t,!0,-1)?(m=!0,a=o,t.lineIndent>e?f=1:t.lineIndent===e?f=0:t.lineIndent<e&&(f=-1)):a=!1;if(a&&(a=m||i),1!==f&&H!==n||(l=Y===n||W===n?e:e+1,p=t.position-t.lineStart,1===f?a&&(F(t,p)||k(t,p,l))||_(t,l)?y=!0:(s&&b(t,l)||w(t,l)||C(t,l)?y=!0:B(t)?(y=!0,null===t.tag&&null===t.anchor||d(t,"alias node should not have any properties")):S(t,l,Y===n)&&(y=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===f&&(y=a&&F(t,p))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(u=0,c=t.implicitTypes.length;u<c;u+=1)if(h=t.implicitTypes[u],h.resolve(t.result)){t.result=h.construct(t.result),t.tag=h.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else K.call(t.typeMap[t.kind||"fallback"],t.tag)?(h=t.typeMap[t.kind||"fallback"][t.tag],null!==t.result&&h.kind!==t.kind&&d(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+h.kind+'", not "'+t.kind+'"'),h.resolve(t.result)?(t.result=h.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):d(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):d(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||y}function P(t){var e,n,s,a,u=t.position,c=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(a=t.input.charCodeAt(t.position))&&(D(t,!0,-1),a=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==a));){for(c=!0,a=t.input.charCodeAt(++t.position),e=t.position;0!==a&&!o(a);)a=t.input.charCodeAt(++t.position);for(n=t.input.slice(e,t.position),s=[],n.length<1&&d(t,"directive name must not be less than one character in length");0!==a;){for(;i(a);)a=t.input.charCodeAt(++t.position);if(35===a){do{a=t.input.charCodeAt(++t.position)}while(0!==a&&!r(a));break}if(r(a))break;for(e=t.position;0!==a&&!o(a);)a=t.input.charCodeAt(++t.position);s.push(t.input.slice(e,t.position))}0!==a&&g(t),K.call(at,n)?at[n](t,n,s):m(t,'unknown document directive "'+n+'"')}if(D(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,D(t,!0,-1)):c&&d(t,"directives end mark is expected"),M(t,t.lineIndent-1,H,!1,!0),D(t,!0,-1),t.checkLineBreaks&&tt.test(t.input.slice(u,t.position))&&m(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&E(t))return void(46===t.input.charCodeAt(t.position)&&(t.position+=3,D(t,!0,-1)));t.position<t.length-1&&d(t,"end of the stream or a document separator is expected")}function N(t,e){t=String(t),e=e||{},0!==t.length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var n=new p(t,e);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)P(n);return n.documents}function O(t,e,n){var r,i,o=N(t,n);if("function"!=typeof e)return o;for(r=0,i=o.length;r<i;r+=1)e(o[r])}function R(t,e){var n=N(t,e);if(0!==n.length){if(1===n.length)return n[0];throw new z("expected a single document in the stream, but found more")}}function U(t,e,n){if("function"!=typeof e)return O(t,L.extend({schema:X},n));O(t,e,L.extend({schema:X},n))}function j(t,e){return R(t,L.extend({schema:X},e))}for(var L=n(23),z=n(33),J=n(239),X=n(34),q=n(47),K=Object.prototype.hasOwnProperty,Y=1,W=2,G=3,H=4,V=1,$=2,Z=3,Q=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,tt=/[\x85\u2028\u2029]/,et=/[,\[\]\{\}]/,nt=/^(?:!|!!|![a-z\-]+!)$/i,rt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,it=new Array(256),ot=new Array(256),st=0;st<256;st++)it[st]=h(st)?1:0,ot[st]=h(st);var at={YAML:function(t,e,n){var r,i,o;null!==t.version&&d(t,"duplication of %YAML directive"),1!==n.length&&d(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===r&&d(t,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&d(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=o<2,1!==o&&2!==o&&m(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var r,i;2!==n.length&&d(t,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],nt.test(r)||d(t,"ill-formed tag handle (first argument) of the TAG directive"),K.call(t.tagMap,r)&&d(t,'there is a previously declared suffix for "'+r+'" tag handle'),rt.test(i)||d(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[r]=i}};t.exports.loadAll=O,t.exports.load=R,t.exports.safeLoadAll=U,t.exports.safeLoad=j},function(t,e,n){"use strict";function r(t,e,n,r,i){this.name=t,this.buffer=e,this.position=n,this.line=r,this.column=i}var i=n(23);r.prototype.getSnippet=function(t,e){var n,r,o,s,a;if(!this.buffer)return null;for(t=t||4,e=e||75,n="",r=this.position;r>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>e/2-1){n=" ... ",r+=5;break}for(o="",s=this.position;s<this.buffer.length&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(s));)if((s+=1)-this.position>e/2-1){o=" ... ",s-=5;break}return a=this.buffer.slice(r,s),i.repeat(" ",t)+n+a+o+"\n"+i.repeat(" ",t+this.position-r+n.length)+"^"},r.prototype.toString=function(t){var e,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(n+=":\n"+e),n},t.exports=r},function(t,e,n){"use strict";function r(t){if(null===t)return!1;var e,n,r=0,i=t.length,o=c;for(n=0;n<i;n++)if(!((e=o.indexOf(t.charAt(n)))>64)){if(e<0)return!1;r+=6}return r%8==0}function i(t){var e,n,r=t.replace(/[\r\n=]/g,""),i=r.length,o=c,s=0,u=[];for(e=0;e<i;e++)e%4==0&&e&&(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)),s=s<<6|o.indexOf(r.charAt(e));return n=i%4*6,0===n?(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)):18===n?(u.push(s>>10&255),u.push(s>>2&255)):12===n&&u.push(s>>4&255),a?a.from?a.from(u):new a(u):u}function o(t){var e,n,r="",i=0,o=t.length,s=c;for(e=0;e<o;e++)e%3==0&&e&&(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]),i=(i<<8)+t[e];return n=o%3,0===n?(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]):2===n?(r+=s[i>>10&63],r+=s[i>>4&63],r+=s[i<<2&63],r+=s[64]):1===n&&(r+=s[i>>2&63],r+=s[i<<4&63],r+=s[64],r+=s[64]),r}function s(t){return a&&a.isBuffer(t)}var a;try{a=n(135).Buffer}catch(t){}var u=n(0),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new u("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o})},function(t,e,n){"use strict";function r(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)}function i(t){return"true"===t||"True"===t||"TRUE"===t}function o(t){return"[object Boolean]"===Object.prototype.toString.call(t)}var s=n(0);t.exports=new s("tag:yaml.org,2002:bool",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";function r(t){return null!==t&&!(!c.test(t)||"_"===t[t.length-1])}function i(t){var e,n,r,i;return e=t.replace(/_/g,"").toLowerCase(),n="-"===e[0]?-1:1,i=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(t){i.unshift(parseFloat(t,10))}),e=0,r=1,i.forEach(function(t){e+=t*r,r*=60}),n*e):n*parseFloat(e,10)}function o(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(a.isNegativeZero(t))return"-0.0";return n=t.toString(10),h.test(n)?n.replace("e",".e"):n}function s(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||a.isNegativeZero(t))}var a=n(23),u=n(0),c=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),h=/^[-+]?[0-9]+e/;t.exports=new u("tag:yaml.org,2002:float",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o,defaultStyle:"lowercase"})},function(t,e,n){"use strict";function r(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function i(t){return 48<=t&&t<=55}function o(t){return 48<=t&&t<=57}function s(t){if(null===t)return!1;var e,n=t.length,s=0,a=!1;if(!n)return!1;if(e=t[s],"-"!==e&&"+"!==e||(e=t[++s]),"0"===e){if(s+1===n)return!0;if("b"===(e=t[++s])){for(s++;s<n;s++)if("_"!==(e=t[s])){if("0"!==e&&"1"!==e)return!1;a=!0}return a&&"_"!==e}if("x"===e){for(s++;s<n;s++)if("_"!==(e=t[s])){if(!r(t.charCodeAt(s)))return!1;a=!0}return a&&"_"!==e}for(;s<n;s++)if("_"!==(e=t[s])){if(!i(t.charCodeAt(s)))return!1;a=!0}return a&&"_"!==e}if("_"===e)return!1;for(;s<n;s++)if("_"!==(e=t[s])){if(":"===e)break;if(!o(t.charCodeAt(s)))return!1;a=!0}return!(!a||"_"===e)&&(":"!==e||/^(:[0-5]?[0-9])+$/.test(t.slice(s)))}function a(t){var e,n,r=t,i=1,o=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),e=r[0],"-"!==e&&"+"!==e||("-"===e&&(i=-1),r=r.slice(1),e=r[0]),"0"===r?0:"0"===e?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(t){o.unshift(parseInt(t,10))}),r=0,n=1,o.forEach(function(t){r+=t*n,n*=60}),i*r):i*parseInt(r,10)}function u(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!c.isNegativeZero(t)}var c=n(23),h=n(0);t.exports=new h("tag:yaml.org,2002:int",{kind:"scalar",resolve:s,construct:a,predicate:u,represent:{binary:function(t){return"0b"+t.toString(2)},octal:function(t){return"0"+t.toString(8)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return"0x"+t.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(t,e,n){"use strict";function r(t){if(null===t)return!1;try{var e="("+t+")",n=a.parse(e,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&"FunctionExpression"===n.body[0].expression.type}catch(t){return!1}}function i(t){var e,n="("+t+")",r=a.parse(n,{range:!0}),i=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(t){i.push(t.name)}),e=r.body[0].expression.body.range,new Function(i,n.slice(e[0]+1,e[1]-1))}function o(t){return t.toString()}function s(t){return"[object Function]"===Object.prototype.toString.call(t)}var a;try{a=n(231)}catch(t){"undefined"!=typeof window&&(a=window.esprima)}var u=n(0);t.exports=new u("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o})},function(t,e,n){"use strict";function r(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),r="";if("/"===e[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==e[e.length-r.length-1])return!1}return!0}function i(t){var e=t,n=/\/([gim]*)$/.exec(t),r="";return"/"===e[0]&&(n&&(r=n[1]),e=e.slice(1,e.length-r.length-1)),new RegExp(e,r)}function o(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}function s(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var a=n(0);t.exports=new a("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o})},function(t,e,n){"use strict";function r(){return!0}function i(){}function o(){return""}function s(t){return void 0===t}var a=n(0);t.exports=new a("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}})},function(t,e,n){"use strict";function r(t){return"<<"===t||null===t}var i=n(0);t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:r})},function(t,e,n){"use strict";function r(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)}function i(){return null}function o(t){return null===t}var s=n(0);t.exports=new s("tag:yaml.org,2002:null",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";function r(t){if(null===t)return!0;var e,n,r,i,o,u=[],c=t;for(e=0,n=c.length;e<n;e+=1){if(r=c[e],o=!1,"[object Object]"!==a.call(r))return!1;for(i in r)if(s.call(r,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==u.indexOf(i))return!1;u.push(i)}return!0}function i(t){return null!==t?t:[]}var o=n(0),s=Object.prototype.hasOwnProperty,a=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:i})},function(t,e,n){"use strict";function r(t){if(null===t)return!0;var e,n,r,i,o,a=t;for(o=new Array(a.length),e=0,n=a.length;e<n;e+=1){if(r=a[e],"[object Object]"!==s.call(r))return!1;if(i=Object.keys(r),1!==i.length)return!1;o[e]=[i[0],r[i[0]]]}return!0}function i(t){if(null===t)return[];var e,n,r,i,o,s=t;for(o=new Array(s.length),e=0,n=s.length;e<n;e+=1)r=s[e],i=Object.keys(r),o[e]=[i[0],r[i[0]]];return o}var o=n(0),s=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}})},function(t,e,n){"use strict";function r(t){if(null===t)return!0;var e,n=t;for(e in n)if(s.call(n,e)&&null!==n[e])return!1;return!0}function i(t){return null!==t?t:{}}var o=n(0),s=Object.prototype.hasOwnProperty;t.exports=new o("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i})},function(t,e,n){"use strict";var r=n(0);t.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}})},function(t,e,n){"use strict";function r(t){return null!==t&&(null!==a.exec(t)||null!==u.exec(t))}function i(t){var e,n,r,i,o,s,c,h,l,p,f=0,d=null;if(e=a.exec(t),null===e&&(e=u.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(o=+e[4],s=+e[5],c=+e[6],e[7]){for(f=e[7].slice(0,3);f.length<3;)f+="0";f=+f}return e[9]&&(h=+e[10],l=+(e[11]||0),d=6e4*(60*h+l),"-"===e[9]&&(d=-d)),p=new Date(Date.UTC(n,r,i,o,s,c,f)),d&&p.setTime(p.getTime()-d),p}function o(t){return t.toISOString()}var s=n(0),a=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),u=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");t.exports=new s("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:i,instanceOf:Date,represent:o})},function(t,e,n){"use strict";function r(t,e,n,r,i){}t.exports=r},function(t,e,n){"use strict";var r=n(259);t.exports=function(t){return r(t,!1)}},function(t,e,n){"use strict";var r=n(45),i=n(15),o=n(113);t.exports=function(){function t(t,e,n,r,s,a){a!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";var r=n(45),i=n(15),o=n(46),s=n(35),a=n(113),u=n(256);t.exports=function(t,e){function n(t){var e=t&&(_&&t[_]||t[b]);if("function"==typeof e)return e}function c(t,e){return t===e?0!==t||1/t==1/e:t!==t&&e!==e}function h(t){this.message=t,this.stack=""}function l(t){function n(n,r,o,s,u,c,l){if(s=s||F,c=c||o,l!==a)if(e)i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[o]?n?new h(null===r[o]?"The "+u+" `"+c+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+u+" `"+c+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:t(r,o,s,u,c)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function p(t){function e(e,n,r,i,o,s){var a=e[n];if(A(a)!==t)return new h("Invalid "+i+" `"+o+"` of type `"+S(a)+"` supplied to `"+r+"`, expected `"+t+"`.");return null}return l(e)}function f(t){function e(e,n,r,i,o){if("function"!=typeof t)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=e[n];if(!Array.isArray(s)){return new h("Invalid "+i+" `"+o+"` of type `"+A(s)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<s.length;u++){var c=t(s,u,r,i,o+"["+u+"]",a);if(c instanceof Error)return c}return null}return l(e)}function d(t){function e(e,n,r,i,o){if(!(e[n]instanceof t)){var s=t.name||F;return new h("Invalid "+i+" `"+o+"` of type `"+C(e[n])+"` supplied to `"+r+"`, expected instance of `"+s+"`.")}return null}return l(e)}function m(t){function e(e,n,r,i,o){for(var s=e[n],a=0;a<t.length;a++)if(c(s,t[a]))return null;return new h("Invalid "+i+" `"+o+"` of value `"+s+"` supplied to `"+r+"`, expected one of "+JSON.stringify(t)+".")}return Array.isArray(t)?l(e):r.thatReturnsNull}function y(t){function e(e,n,r,i,o){if("function"!=typeof t)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=e[n],u=A(s);if("object"!==u)return new h("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var c in s)if(s.hasOwnProperty(c)){var l=t(s,c,r,i,o+"."+c,a);if(l instanceof Error)return l}return null}return l(e)}function v(t){function e(e,n,r,i,o){for(var s=0;s<t.length;s++){if(null==(0,t[s])(e,n,r,i,o,a))return null}return new h("Invalid "+i+" `"+o+"` supplied to `"+r+"`.")}if(!Array.isArray(t))return r.thatReturnsNull;for(var n=0;n<t.length;n++){var i=t[n];if("function"!=typeof i)return o(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",w(i),n),r.thatReturnsNull}return l(e)}function x(t){function e(e,n,r,i,o){var s=e[n],u=A(s);if("object"!==u)return new h("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var c in t){var l=t[c];if(l){var p=l(s,c,r,i,o+"."+c,a);if(p)return p}}return null}return l(e)}function g(t){function e(e,n,r,i,o){var u=e[n],c=A(u);if("object"!==c)return new h("Invalid "+i+" `"+o+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var l=s({},e[n],t);for(var p in l){var f=t[p];if(!f)return new h("Invalid "+i+" `"+o+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(e[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var d=f(u,p,r,i,o+"."+p,a);if(d)return d}return null}return l(e)}function D(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(D);if(null===e||t(e))return!0;var r=n(e);if(!r)return!1;var i,o=r.call(e);if(r!==e.entries){for(;!(i=o.next()).done;)if(!D(i.value))return!1}else for(;!(i=o.next()).done;){var s=i.value;if(s&&!D(s[1]))return!1}return!0;default:return!1}}function E(t,e){return"symbol"===t||("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)}function A(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":E(e,t)?"symbol":e}function S(t){if(void 0===t||null===t)return""+t;var e=A(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function w(t){var e=S(t);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}function C(t){return t.constructor&&t.constructor.name?t.constructor.name:F}var _="function"==typeof Symbol&&Symbol.iterator,b="@@iterator",F="<<anonymous>>",k={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:function(){return l(r.thatReturnsNull)}(),arrayOf:f,element:function(){function e(e,n,r,i,o){var s=e[n];if(!t(s)){return new h("Invalid "+i+" `"+o+"` of type `"+A(s)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return l(e)}(),instanceOf:d,node:function(){function t(t,e,n,r,i){return D(t[e])?null:new h("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}return l(t)}(),objectOf:y,oneOf:m,oneOfType:v,shape:x,exact:g};return h.prototype=Error.prototype,k.checkPropTypes=u,k.PropTypes=k,k}},function(t,e){t.exports='---\nurl: "http://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://online.swagger.io/validator"\noauth2RedirectUrl: "http://localhost:3200/oauth2-redirect.html"\n'},function(t,e,n){"use strict";function r(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,function(t){return e[t]})}function i(t){var e=/(=0|=2)/g,n={"=0":"=","=2":":"};return(""+("."===t[0]&&"$"===t[1]?t.substring(2):t.substring(1))).replace(e,function(t){return n[t]})}var o={escape:r,unescape:i};t.exports=o},function(t,e,n){"use strict";var r=n(48),i=(n(15),function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)}),o=function(t,e){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,t,e),r}return new n(t,e)},s=function(t,e,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,t,e,n),i}return new r(t,e,n)},a=function(t,e,n,r){var i=this;if(i.instancePool.length){var o=i.instancePool.pop();return i.call(o,t,e,n,r),o}return new i(t,e,n,r)},u=function(t){var e=this;t instanceof e||r("25"),t.destructor(),e.instancePool.length<e.poolSize&&e.instancePool.push(t)},c=i,h=function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||c,n.poolSize||(n.poolSize=10),n.release=u,n},l={addPoolingTo:h,oneArgumentPooler:i,twoArgumentPooler:o,threeArgumentPooler:s,fourArgumentPooler:a};t.exports=l},function(t,e,n){"use strict";var r=n(35),i=n(114),o=n(264),s=n(265),a=n(25),u=n(266),c=n(267),h=n(268),l=n(271),p=a.createElement,f=a.createFactory,d=a.cloneElement,m=r,y=function(t){return t},v={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:l},Component:i.Component,PureComponent:i.PureComponent,createElement:p,cloneElement:d,isValidElement:a.isValidElement,PropTypes:u,createClass:h,createFactory:f,createMixin:y,DOM:s,version:c,__spread:m};t.exports=v},function(t,e,n){"use strict";function r(t){return(""+t).replace(D,"$&/")}function i(t,e){this.func=t,this.context=e,this.count=0}function o(t,e,n){var r=t.func,i=t.context;r.call(i,e,t.count++)}function s(t,e,n){if(null==t)return t;var r=i.getPooled(e,n);v(t,o,r),i.release(r)}function a(t,e,n,r){this.result=t,this.keyPrefix=e,this.func=n,this.context=r,this.count=0}function u(t,e,n){var i=t.result,o=t.keyPrefix,s=t.func,a=t.context,u=s.call(a,e,t.count++);Array.isArray(u)?c(u,i,n,y.thatReturnsArgument):null!=u&&(m.isValidElement(u)&&(u=m.cloneAndReplaceKey(u,o+(!u.key||e&&e.key===u.key?"":r(u.key)+"/")+n)),i.push(u))}function c(t,e,n,i,o){var s="";null!=n&&(s=r(n)+"/");var c=a.getPooled(e,s,i,o);v(t,u,c),a.release(c)}function h(t,e,n){if(null==t)return t;var r=[];return c(t,r,null,e,n),r}function l(t,e,n){return null}function p(t,e){return v(t,l,null)}function f(t){var e=[];return c(t,e,null,y.thatReturnsArgument),e}var d=n(262),m=n(25),y=n(45),v=n(272),x=d.twoArgumentPooler,g=d.fourArgumentPooler,D=/\/+/g;i.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},d.addPoolingTo(i,x),a.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},d.addPoolingTo(a,g);var E={forEach:s,map:h,mapIntoWithKeyPrefixInternal:c,count:p,toArray:f};t.exports=E},function(t,e,n){"use strict";var r=n(25),i=r.createFactory,o={a:i("a"),abbr:i("abbr"),address:i("address"),area:i("area"),article:i("article"),aside:i("aside"),audio:i("audio"),b:i("b"),base:i("base"),bdi:i("bdi"),bdo:i("bdo"),big:i("big"),blockquote:i("blockquote"),body:i("body"),br:i("br"),button:i("button"),canvas:i("canvas"),caption:i("caption"),cite:i("cite"),code:i("code"),col:i("col"),colgroup:i("colgroup"),data:i("data"),datalist:i("datalist"),dd:i("dd"),del:i("del"),details:i("details"),dfn:i("dfn"),dialog:i("dialog"),div:i("div"),dl:i("dl"),dt:i("dt"),em:i("em"),embed:i("embed"),fieldset:i("fieldset"),figcaption:i("figcaption"),figure:i("figure"),footer:i("footer"),form:i("form"),h1:i("h1"),h2:i("h2"),h3:i("h3"),h4:i("h4"),h5:i("h5"),h6:i("h6"),head:i("head"),header:i("header"),hgroup:i("hgroup"),hr:i("hr"),html:i("html"),i:i("i"),iframe:i("iframe"),img:i("img"),input:i("input"),ins:i("ins"),kbd:i("kbd"),keygen:i("keygen"),label:i("label"),legend:i("legend"),li:i("li"),link:i("link"),main:i("main"),map:i("map"),mark:i("mark"),menu:i("menu"),menuitem:i("menuitem"),meta:i("meta"),meter:i("meter"),nav:i("nav"),noscript:i("noscript"),object:i("object"),ol:i("ol"),optgroup:i("optgroup"),option:i("option"),output:i("output"),p:i("p"),param:i("param"),picture:i("picture"),pre:i("pre"),progress:i("progress"),q:i("q"),rp:i("rp"),rt:i("rt"),ruby:i("ruby"),s:i("s"),samp:i("samp"),script:i("script"),section:i("section"),select:i("select"),small:i("small"),source:i("source"),span:i("span"),strong:i("strong"),style:i("style"),sub:i("sub"),summary:i("summary"),sup:i("sup"),table:i("table"),tbody:i("tbody"),td:i("td"),textarea:i("textarea"),tfoot:i("tfoot"),th:i("th"),thead:i("thead"),time:i("time"),title:i("title"),tr:i("tr"),track:i("track"),u:i("u"),ul:i("ul"),var:i("var"),video:i("video"),wbr:i("wbr"),circle:i("circle"),clipPath:i("clipPath"),defs:i("defs"),ellipse:i("ellipse"),g:i("g"),image:i("image"),line:i("line"),linearGradient:i("linearGradient"),mask:i("mask"),path:i("path"),pattern:i("pattern"),polygon:i("polygon"),polyline:i("polyline"),radialGradient:i("radialGradient"),rect:i("rect"),stop:i("stop"),svg:i("svg"),text:i("text"),tspan:i("tspan")};t.exports=o},function(t,e,n){"use strict";var r=n(25),i=r.isValidElement,o=n(257);t.exports=o(i)},function(t,e,n){"use strict";t.exports="15.6.2"},function(t,e,n){"use strict";var r=n(114),i=r.Component,o=n(25),s=o.isValidElement,a=n(117),u=n(230);t.exports=u(i,s,a)},function(t,e,n){"use strict";function r(t){var e=t&&(i&&t[i]||t[o]);if("function"==typeof e)return e}var i="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";t.exports=r},function(t,e,n){"use strict";var r=function(){};t.exports=r},function(t,e,n){"use strict";function r(t){return o.isValidElement(t)||i("143"),t}var i=n(48),o=n(25);n(15);t.exports=r},function(t,e,n){"use strict";function r(t,e){return t&&"object"==typeof t&&null!=t.key?c.escape(t.key):e.toString(36)}function i(t,e,n,o){var p=typeof t;if("undefined"!==p&&"boolean"!==p||(t=null),null===t||"string"===p||"number"===p||"object"===p&&t.$$typeof===a)return n(o,t,""===e?h+r(t,0):e),1;var f,d,m=0,y=""===e?h:e+l;if(Array.isArray(t))for(var v=0;v<t.length;v++)f=t[v],d=y+r(f,v),m+=i(f,d,n,o);else{var x=u(t);if(x){var g,D=x.call(t);if(x!==t.entries)for(var E=0;!(g=D.next()).done;)f=g.value,d=y+r(f,E++),m+=i(f,d,n,o);else for(;!(g=D.next()).done;){var A=g.value;A&&(f=A[1],d=y+c.escape(A[0])+l+r(f,0),m+=i(f,d,n,o))}}else if("object"===p){var S="",w=String(t);s("31","[object Object]"===w?"object with keys {"+Object.keys(t).join(", ")+"}":w,S)}}return m}function o(t,e,n){return null==t?0:i(t,"",e,n)}var s=n(48),a=(n(115),n(116)),u=n(269),c=(n(15),n(261)),h=(n(46),"."),l=":";t.exports=o},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAAYFBMVEUAAABUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwBUfwB0lzB/n0BfhxBpjyC0x4////+qv4CJp1D09++ft3C/z5/K16/U379UfwDf58/q79+Ur2D2RCk9AAAAHXRSTlMAEEAwn9//z3Agv4/vYID/////////////////UMeji1kAAAD8SURBVHgBlZMFAoQwDATRxbXB7f+vPKnlXAZn6k2cf3A9z/PfOC8IIYni5FmmABM8FMhwT17c9hnhiZL1CwvEL1tmPD0qSKq6gaStW/kMXanVmAVRDUlH1OvuuTINo6k90Sxf8qsOtF6g4ff1osP3OnMcV7d4pzdIUtu1oA4V0DZoKmxmlEYvtDUjjS3tmKmqB+pYy8pD1VPf7jPE0I40HHcaBwnue6fGzgyS5tXIU96PV7rkDWHNLV0DK4FkoKmFpN5oUnvi8KoeA2/JXsmXQuokx0siR1G8tLkN6eB9sLwJp/yymcyaP/TrP+RPmbMMixcJVgTR1aUZ93oGXsgXQAaG6EwAAAAASUVORK5CYII="},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){n(120),t.exports=n(121)}])}); -//# sourceMappingURL=swagger-ui-standalone-preset.js.map +var r=n(237),i=n(238),o=n(135);function u(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(u()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=a.prototype:(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);a.TYPED_ARRAY_SUPPORT?(t=e).__proto__=a.prototype:t=h(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=s(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(a.isBuffer(e)){var n=0|p(e.length);return 0===(t=s(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?s(t,0):h(t,e);if("Buffer"===e.type&&o(e.data))return h(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(f(e),t=s(t,e<0?0:0|p(e)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function h(t,e){var n=e.length<0?0:0|p(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(t).length;default:if(r)return Q(t).length;e=(""+e).toLowerCase(),r=!0}}function y(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,n);case"utf8":case"utf-8":return N(this,e,n);case"ascii":return D(this,e,n);case"latin1":case"binary":return I(this,e,n);case"base64":return x(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function w(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:g(t,e,n,r,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):g(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,n,r,i){var o,u=1,s=t.length,a=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;u=2,s/=2,a/=2,n/=2}function c(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(i){var f=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===a)return f*u}else-1!==f&&(o-=o-f),f=-1}else for(n+a>s&&(n=s-a),o=n;o>=0;o--){for(var l=!0,h=0;h<a;h++)if(c(t,o+h)!==c(e,h)){l=!1;break}if(l)return o}return-1}function M(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var u=0;u<r;++u){var s=parseInt(e.substr(2*u,2),16);if(isNaN(s))return u;t[n+u]=s}return u}function _(t,e,n,r){return B(Q(e,t.length-n),t,n,r)}function m(t,e,n,r){return B(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function L(t,e,n,r){return m(t,e,n,r)}function b(t,e,n,r){return B(F(e),t,n,r)}function j(t,e,n,r){return B(function(t,e){for(var n,r,i,o=[],u=0;u<t.length&&!((e-=2)<0);++u)n=t.charCodeAt(u),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function x(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function N(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,u,s,a,c=t[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(a=(31&c)<<6|63&o)>127&&(f=a);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(a=(15&c)<<12|(63&o)<<6|63&u)>2047&&(a<55296||a>57343)&&(f=a);break;case 4:o=t[i+1],u=t[i+2],s=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&s)&&(a=(15&c)<<18|(63&o)<<12|(63&u)<<6|63&s)>65535&&a<1114112&&(f=a)}null===f?(f=65533,l=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=l}return function(t){var e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=S));return n}(r)}e.Buffer=a,e.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=u(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,n){return c(null,t,e,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,n){return function(t,e,n,r){return f(e),e<=0?s(t,e):void 0!==n?"string"==typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}(null,t,e,n)},a.allocUnsafe=function(t){return l(null,t)},a.allocUnsafeSlow=function(t){return l(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=a.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var u=t[n];if(!a.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(r,i),i+=u.length}return r},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)w(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)w(this,e,e+3),w(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)w(this,e,e+7),w(this,e+1,e+6),w(this,e+2,e+5),w(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?N(this,0,t):y.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,n,r,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),u=(n>>>=0)-(e>>>=0),s=Math.min(o,u),c=this.slice(r,i),f=t.slice(e,n),l=0;l<s;++l)if(c[l]!==f[l]){o=c[l],u=f[l];break}return o<u?-1:u<o?1:0},a.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},a.prototype.indexOf=function(t,e,n){return v(this,t,e,n,!0)},a.prototype.lastIndexOf=function(t,e,n){return v(this,t,e,n,!1)},a.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return M(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return m(this,t,e,n);case"latin1":case"binary":return L(this,t,e,n);case"base64":return b(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function D(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function I(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function E(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=R(t[o]);return i}function C(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function T(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function A(t,e,n,r,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function O(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function z(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function k(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Y(t,e,n,r,o){return o||k(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function U(t,e,n,r,o){return o||k(t,0,n,8),i.write(t,e,n,r,52,8),n+8}a.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),a.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=a.prototype;else{var i=e-t;n=new a(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},a.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},a.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},a.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},a.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||A(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},a.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||A(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},a.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):z(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);A(this,t,e,n,i-1,-i)}var o=0,u=1,s=0;for(this[e]=255&t;++o<n&&(u*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/u>>0)-s&255;return e+n},a.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);A(this,t,e,n,i-1,-i)}var o=n-1,u=1,s=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/u>>0)-s&255;return e+n},a.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):z(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,n){return Y(this,t,e,!0,n)},a.prototype.writeFloatBE=function(t,e,n){return Y(this,t,e,!1,n)},a.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},a.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},a.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},a.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var u=a.isBuffer(t)?t:Q(new a(t,r).toString()),s=u.length;for(o=0;o<n-e;++o)this[o+e]=u[o%s]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function R(t){return t<16?"0"+t.toString(16):t.toString(16)}function Q(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],u=0;u<r;++u){if((n=t.charCodeAt(u))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function F(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function B(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(10))},function(t,e,n){var r=n(11).Symbol;t.exports=r},function(t,e,n){var r=n(43),i=n(44),o="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||i(t)&&r(t)==o}},function(t,e,n){var r=n(33)(Object,"create");t.exports=r},function(t,e,n){var r=n(285),i=n(286),o=n(287),u=n(288),s=n(289);function a(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=u,a.prototype.set=s,t.exports=a},function(t,e,n){var r=n(38);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(291);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(319),i=n(326),o=n(65);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e,n){var r=n(138),i=n(93);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){var r=n(59),i=1/0;t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e}},function(t,e,n){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,u,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,i)});default:for(o=new Array(s-1),u=0;u<o.length;)o[u++]=arguments[u];return e.nextTick(function(){t.apply(null,o)})}}}:t.exports=e}).call(this,n(22))},function(t,e,n){"use strict";t.exports=n(376)("forEach")},function(t,e,n){"use strict";var r=n(161),i=n(158),o=n(98),u=n(385);(t.exports=function(t,e){var n,o,s,a,c;return arguments.length<2||"string"!=typeof t?(a=e,e=t,t=null):a=arguments[2],null==t?(n=s=!0,o=!1):(n=u.call(t,"c"),o=u.call(t,"e"),s=u.call(t,"w")),c={value:e,configurable:n,enumerable:o,writable:s},a?r(i(a),c):c}).gs=function(t,e,n){var s,a,c,f;return"string"!=typeof t?(c=n,n=e,e=t,t=null):c=arguments[3],null==e?e=void 0:o(e)?null==n?n=void 0:o(n)||(c=n,n=void 0):(c=e,e=n=void 0),null==t?(s=!0,a=!1):(s=u.call(t,"c"),a=u.call(t,"e")),f={get:e,set:n,configurable:s,enumerable:a},c?r(i(c),f):f}},function(t,e,n){"use strict";var r=n(37);t.exports=r.DEFAULT=new r({include:[n(48)],explicit:[n(444),n(445),n(446)]})},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){var r=n(110);function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r(t,i.key,i)}}t.exports=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}},function(t,e,n){var r=n(9),i=n(13);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e}},function(t,e,n){var r=n(208),i=n(125);function o(e){return t.exports=o=i?r:function(t){return t.__proto__||r(t)},o(e)}t.exports=o},function(t,e,n){var r=n(214),i=n(217);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=r(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}},function(t,e,n){var r=n(29);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(28),i=n(191),o=n(83),u=n(81)("IE_PROTO"),s=function(){},a=function(){var t,e=n(113)("iframe"),r=o.length;for(e.style.display="none",n(195).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),a=t.F;r--;)delete a.prototype[o[r]];return a()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[u]=t):n=a(),void 0===e?n:i(n,e)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(82)("keys"),i=n(53);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(4),i=n(16),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(51)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(19).f,i=n(21),o=n(17)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){e.f=n(17)},function(t,e,n){var r=n(16),i=n(4),o=n(51),u=n(85),s=n(19).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:u.f(t)})}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){"use strict";var r=n(128);t.exports=r},function(t,e,n){var r=n(274),i=n(290),o=n(292),u=n(293),s=n(294);function a(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=u,a.prototype.set=s,t.exports=a},function(t,e,n){var r=n(33)(n(11),"Map");t.exports=r},function(t,e,n){var r=n(296),i=n(336),o=n(343),u=n(12),s=n(344);t.exports=function(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?u(t)?i(t[0],t[1]):r(t):s(t)}},function(t,e){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var i=typeof t;return!!(e=null==e?n:e)&&("number"==i||"symbol"!=i&&r.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){var n=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}},function(t,e,n){var r=n(12),i=n(59),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||(u.test(t)||!o.test(t)||null!=e&&t in Object(e))}},function(t,e,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var u=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function f(t,e,n,r){var i,o,u,s;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),u=o[e]),void 0===u)u=o[e]=n,++t._eventsCount;else if("function"==typeof u?u=o[e]=r?[n,u]:[u,n]:r?u.unshift(n):u.push(n),(i=c(t))>0&&u.length>i&&!u.warned){u.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=u.length,s=a,console&&console.warn&&console.warn(s)}return t}function l(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=function(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,o(this.listener,this.target,t))}.bind(r);return i.listener=n,r.wrapFn=i,i}function h(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):d(i,i.length)}function p(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function d(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||u(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||u(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var u;if(e.length>0&&(u=e[0]),u instanceof Error)throw u;var s=new Error("Unhandled error."+(u?" ("+u.message+")":""));throw s.context=u,s}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var c=a.length,f=d(a,c);for(n=0;n<c;++n)o(f[n],this,e)}return!0},s.prototype.addListener=function(t,e){return f(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return f(this,t,e,!0)},s.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.on(t,l(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.prependListener(t,l(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,r,i,o,u;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);if(void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){u=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,u||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return h(this,t,!0)},s.prototype.rawListeners=function(t){return h(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){(e=t.exports=n(152)).Stream=e,e.Readable=e,e.Writable=n(97),e.Duplex=n(23),e.Transform=n(157),e.PassThrough=n(366)},function(t,e,n){"use strict";(function(e,r,i){var o=n(67);function u(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=g;var s,a=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?r:o.nextTick;g.WritableState=v;var c=n(46);c.inherits=n(7);var f={deprecate:n(365)},l=n(153),h=n(8).Buffer,p=i.Uint8Array||function(){};var d,y=n(154);function w(){}function v(t,e){s=s||n(23),t=t||{};var r=e instanceof s;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?(o.nextTick(i,r),o.nextTick(j,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(i(r),t._writableState.errorEmitted=!0,t.emit("error",r),j(t,e))}(t,n,r,e,i);else{var u=L(n);u||n.corked||n.bufferProcessing||!n.bufferedRequest||m(t,n),r?a(_,t,n,u,i):_(t,n,u,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new u(this)}function g(t){if(s=s||n(23),!(d.call(g,this)||this instanceof s))return new g(t);this._writableState=new v(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function M(t,e,n,r,i,o,u){e.writelen=r,e.writecb=u,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function _(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),j(t,e)}function m(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var s=0,a=!0;n;)i[s]=n,n.isBuf||(a=!1),n=n.next,s+=1;i.allBuffers=a,M(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new u(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,f=n.encoding,l=n.callback;if(M(t,e,!1,e.objectMode?1:c.length,c,f,l),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function L(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function b(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),j(t,e)})}function j(t,e){var n=L(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(b,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}c.inherits(g,l),v.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(v.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===g&&(t&&t._writableState instanceof v)}})):d=function(t){return t instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(t,e,n){var r,i=this._writableState,u=!1,s=!i.objectMode&&(r=t,h.isBuffer(r)||r instanceof p);return s&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),"function"==typeof e&&(n=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof n&&(n=w),i.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),o.nextTick(e,n)}(this,n):(s||function(t,e,n,r){var i=!0,u=!1;return null===n?u=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(u=new TypeError("Invalid non-string/buffer chunk")),u&&(t.emit("error",u),o.nextTick(r,u),i=!1),i}(this,i,t,n))&&(i.pendingcb++,u=function(t,e,n,r,i,o){if(!n){var u=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,n));return e}(e,r,i);r!==u&&(n=!0,i="buffer",r=u)}var s=e.objectMode?1:r.length;e.length+=s;var a=e.length<e.highWaterMark;a||(e.needDrain=!0);if(e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else M(t,e,!1,s,r,i,o);return a}(this,i,s,t,e,n)),u},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||m(this,t))},g.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,j(t,e),n&&(e.finished?o.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),g.prototype.destroy=y.destroy,g.prototype._undestroy=y.undestroy,g.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,n(22),n(155).setImmediate,n(10))},function(t,e,n){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e,n){"use strict";t.exports=n(391)()?Array.from:n(392)},function(t,e,n){"use strict";var r=n(405),i=n(25),o=n(34),u=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,a=Math.abs,c=Math.floor;t.exports=function(t){var e,n,f,l;if(!r(t))return u.apply(this,arguments);for(n=i(o(this).length),f=arguments[1],e=f=isNaN(f)?0:f>=0?c(f):i(this.length)-c(a(f));e<n;++e)if(s.call(this,e)&&(l=this[e],r(l)))return e;return-1}},function(t,e,n){"use strict";(function(e,n){var r,i;r=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t},i=function(t){var e,n,i=document.createTextNode(""),o=0;return new t(function(){var t;if(e)n&&(e=n.concat(e));else{if(!n)return;e=n}if(n=e,e=null,"function"==typeof n)return t=n,n=null,void t();for(i.data=o=++o%2;n;)t=n.shift(),n.length||(n=null),t()}).observe(i,{characterData:!0}),function(t){r(t),e?"function"==typeof e?e=[e,t]:e.push(t):(e=t,i.data=o=++o%2)}},t.exports=function(){if("object"==typeof e&&e&&"function"==typeof e.nextTick)return e.nextTick;if("object"==typeof document&&document){if("function"==typeof MutationObserver)return i(MutationObserver);if("function"==typeof WebKitMutationObserver)return i(WebKitMutationObserver)}return"function"==typeof n?function(t){n(r(t))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(t){setTimeout(r(t),0)}:null}()}).call(this,n(22),n(155).setImmediate)},function(t,e,n){"use strict";var r=n(37);t.exports=new r({explicit:[n(431),n(432),n(433)]})},function(t,e,n){t.exports=n(244)},function(t,e,n){var r=n(259)("toUpperCase");t.exports=r},function(t,e,n){var r=n(89),i="Expected a function";function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(i);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var u=t.apply(this,r);return n.cache=o.set(i,u)||o,u};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},function(t,e,n){t.exports=n(239)},function(t,e,n){t.exports=n(249)},function(t,e,n){"use strict";n.d(e,"a",function(){return y}),n.d(e,"b",function(){return w});var r=n(2),i=n.n(r),o=n(6),u=n(176),s=n.n(u),a=n(109),c=n.n(a),f=n(177),l=n.n(f),h={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},string_date:function(){return(new Date).toISOString().substring(0,10)},string_uuid:function(){return"3fa85f64-5717-4562-b3fc-2c963f66afa6"},string_hostname:function(){return"example.com"},string_ipv4:function(){return"198.51.100.42"},string_ipv6:function(){return"2001:0db8:5b96:0000:0000:426f:8e17:642a"},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(t){return"boolean"!=typeof t.default||t.default}},p=function(t){var e=t=Object(o.d)(t),n=e.type,r=e.format,i=h["".concat(n,"_").concat(r)]||h[n];return Object(o.b)(i)?i(t):"Unknown Type: "+t.type},d=function t(e){var n,r,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=l()({},Object(o.d)(e)),a=s.type,c=s.properties,f=s.additionalProperties,h=s.items,d=s.example,y=u.includeReadOnly,w=u.includeWriteOnly,v=s.default,g={},M={},_=e.xml,m=_.name,L=_.prefix,b=_.namespace,j=s.enum;if(!a)if(c||f)a="object";else{if(!h)return;a="array"}if(n=(L?L+":":"")+(m=m||"notagname"),b){var x=L?"xmlns:"+L:"xmlns";M[x]=b}if("array"===a&&h){if(h.xml=h.xml||_||{},h.xml.name=h.xml.name||_.name,_.wrapped)return g[n]=[],i()(d)?d.forEach(function(e){h.example=e,g[n].push(t(h,u))}):i()(v)?v.forEach(function(e){h.default=e,g[n].push(t(h,u))}):g[n]=[t(h,u)],M&&g[n].push({_attr:M}),g;var N=[];return i()(d)?(d.forEach(function(e){h.example=e,N.push(t(h,u))}),N):i()(v)?(v.forEach(function(e){h.default=e,N.push(t(h,u))}),N):t(h,u)}if("object"===a){var S=Object(o.d)(c);for(var D in g[n]=[],d=d||{},S)if(S.hasOwnProperty(D)&&(!S[D].readOnly||y)&&(!S[D].writeOnly||w))if(S[D].xml=S[D].xml||{},S[D].xml.attribute){var I=i()(S[D].enum)&&S[D].enum[0],E=S[D].example,C=S[D].default;M[S[D].xml.name||D]=void 0!==E&&E||void 0!==d[D]&&d[D]||void 0!==C&&C||I||p(S[D])}else{S[D].xml.name=S[D].xml.name||D,void 0===S[D].example&&void 0!==d[D]&&(S[D].example=d[D]);var T=t(S[D]);i()(T)?g[n]=g[n].concat(T):g[n].push(T)}return!0===f?g[n].push({additionalProp:"Anything can be here"}):f&&g[n].push({additionalProp:p(f)}),M&&g[n].push({_attr:M}),g}return r=void 0!==d?d:void 0!==v?v:i()(j)?j[0]:p(e),g[n]=M?[{_attr:M},r]:r,g};var y=c()(function(t,e){var n=d(t,e);if(n)return s()(n,{declaration:!0,indent:"\t"})}),w=c()(function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(o.d)(e),u=r.type,s=r.example,a=r.properties,c=r.additionalProperties,f=r.items,l=n.includeReadOnly,h=n.includeWriteOnly;if(void 0!==s)return Object(o.a)(s,"$$ref",function(t){return"string"==typeof t&&t.indexOf("#")>-1});if(!u)if(a)u="object";else{if(!f)return;u="array"}if("object"===u){var d=Object(o.d)(a),y={};for(var w in d)d[w]&&d[w].deprecated||d[w]&&d[w].readOnly&&!l||d[w]&&d[w].writeOnly&&!h||(y[w]=t(d[w],n));if(!0===c)y.additionalProp1={};else if(c)for(var v=Object(o.d)(c),g=t(v,n),M=1;M<4;M++)y["additionalProp"+M]=g;return y}return"array"===u?i()(f.anyOf)?f.anyOf.map(function(e){return t(e,n)}):i()(f.oneOf)?f.oneOf.map(function(e){return t(e,n)}):[t(f,n)]:e.enum?e.default?e.default:Object(o.c)(e.enum)[0]:"file"!==u?p(e):void 0})},function(t,e,n){"use strict";var r=n(158),i=n(160),o=n(375);t.exports=function(t){var e,u=r(arguments[1]);return u.normalizer||0!==(e=u.length=i(u.length,t.length,u.async))&&(u.primitive?!1===e?u.normalizer=n(402):e>1&&(u.normalizer=n(403)(e)):u.normalizer=!1===e?n(404)():1===e?n(408)():n(409)(e)),u.async&&n(410),u.promise&&n(411),u.dispose&&n(417),u.maxAge&&n(418),u.max&&n(421),u.refCounter&&n(423),o(t,u)}},function(t,e,n){t.exports=n(184)},function(t,e,n){var r=n(186);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){t.exports=!n(20)&&!n(30)(function(){return 7!=Object.defineProperty(n(113)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(29),i=n(16).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){"use strict";var r=n(189)(!0);n(115)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r=n(51),i=n(15),o=n(116),u=n(27),s=n(52),a=n(190),c=n(84),f=n(119),l=n(17)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,d,y,w,v){a(n,e,d);var g,M,_,m=function(t){if(!h&&t in x)return x[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},L=e+" Iterator",b="values"==y,j=!1,x=t.prototype,N=x[l]||x["@@iterator"]||y&&x[y],S=N||m(y),D=y?b?m("entries"):S:void 0,I="Array"==e&&x.entries||N;if(I&&(_=f(I.call(new t)))!==Object.prototype&&_.next&&(c(_,L,!0),r||"function"==typeof _[l]||u(_,l,p)),b&&N&&"values"!==N.name&&(j=!0,S=function(){return N.call(this)}),r&&!v||!h&&!j&&x[l]||u(x,l,S),s[e]=S,s[L]=p,y)if(g={values:b?S:m("values"),keys:w?S:m("keys"),entries:D},v)for(M in g)M in x||o(x,M,g[M]);else i(i.P+i.F*(h||j),e,g);return g}},function(t,e,n){t.exports=n(27)},function(t,e,n){var r=n(21),i=n(31),o=n(192)(!1),u=n(81)("IE_PROTO");t.exports=function(t,e){var n,s=i(t),a=0,c=[];for(n in s)n!=u&&r(s,n)&&c.push(n);for(;e.length>a;)r(s,n=e[a++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(80);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(21),i=n(54),o=n(81)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){n(196);for(var r=n(16),i=n(27),o=n(52),u=n(17)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),a=0;a<s.length;a++){var c=s[a],f=r[c],l=f&&f.prototype;l&&!l[u]&&i(l,u,c),o[c]=o.Array}},function(t,e,n){var r=n(80);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(117),i=n(83).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){var r=n(55),i=n(50),o=n(31),u=n(76),s=n(21),a=n(112),c=Object.getOwnPropertyDescriptor;e.f=n(20)?c:function(t,e){if(t=o(t),e=u(e,!0),a)try{return c(t,e)}catch(t){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){var r=n(15),i=n(4),o=n(30);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],u={};u[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",u)}},function(t,e,n){t.exports=n(211)},function(t,e,n){"use strict";var r=n(56),i=n(40),o=n(127),u=(n(129),n(130));n(41),n(219);function s(t,e,n){this.props=t,this.context=e,this.refs=u,this.updater=n||o}function a(t,e,n){this.props=t,this.context=e,this.refs=u,this.updater=n||o}function c(){}s.prototype.isReactComponent={},s.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t&&r("85"),this.updater.enqueueSetState(this,t),e&&this.updater.enqueueCallback(this,e,"setState")},s.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this),t&&this.updater.enqueueCallback(this,t,"forceUpdate")},c.prototype=s.prototype,a.prototype=new c,a.prototype.constructor=a,i(a.prototype,s.prototype),a.prototype.isPureReactComponent=!0,t.exports={Component:s,PureComponent:a}},function(t,e,n){"use strict";n(88);var r={isMounted:function(t){return!1},enqueueCallback:function(t,e){},enqueueForceUpdate:function(t){},enqueueReplaceState:function(t,e){},enqueueSetState:function(t,e){}};t.exports=r},function(t,e,n){"use strict";function r(t){return function(){return t}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(t){return t},t.exports=i},function(t,e,n){"use strict";t.exports=!1},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";t.exports={current:null}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=r},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){t.exports=n(236)()},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(10))},function(t,e){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return n.test(t)}},function(t,e,n){var r=n(43),i=n(45),o="[object AsyncFunction]",u="[object Function]",s="[object GeneratorFunction]",a="[object Proxy]";t.exports=function(t){if(!i(t))return!1;var e=r(t);return e==u||e==s||e==o||e==a}},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(61),i=n(298),o=n(299),u=n(300),s=n(301),a=n(302);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=u,c.prototype.has=s,c.prototype.set=a,t.exports=c},function(t,e,n){var r=n(303),i=n(44);t.exports=function t(e,n,o,u,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,u,t,s))}},function(t,e,n){var r=n(304),i=n(143),o=n(307),u=1,s=2;t.exports=function(t,e,n,a,c,f){var l=n&u,h=t.length,p=e.length;if(h!=p&&!(l&&p>h))return!1;var d=f.get(t);if(d&&f.get(e))return d==e;var y=-1,w=!0,v=n&s?new r:void 0;for(f.set(t,e),f.set(e,t);++y<h;){var g=t[y],M=e[y];if(a)var _=l?a(M,g,y,e,t,f):a(g,M,y,t,e,f);if(void 0!==_){if(_)continue;w=!1;break}if(v){if(!i(e,function(t,e){if(!o(v,e)&&(g===t||c(g,t,n,a,f)))return v.push(e)})){w=!1;break}}else if(g!==M&&!c(g,M,n,a,f)){w=!1;break}}return f.delete(t),f.delete(e),w}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e,n){var r=n(321),i=n(44),o=Object.prototype,u=o.hasOwnProperty,s=o.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(t){return i(t)&&u.call(t,"callee")&&!s.call(t,"callee")};t.exports=a},function(t,e,n){(function(t){var r=n(11),i=n(322),o=e&&!e.nodeType&&e,u=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=u&&u.exports===o?r.Buffer:void 0,a=(s?s.isBuffer:void 0)||i;t.exports=a}).call(this,n(146)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(323),i=n(324),o=n(325),u=o&&o.isTypedArray,s=u?i(u):r;t.exports=s},function(t,e,n){var r=n(45);t.exports=function(t){return t==t&&!r(t)}},function(t,e){t.exports=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}},function(t,e,n){var r=n(151),i=n(66);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},function(t,e,n){var r=n(12),i=n(94),o=n(338),u=n(42);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(u(t))}},function(t,e,n){"use strict";(function(e,r){var i=n(67);t.exports=M;var o,u=n(135);M.ReadableState=g;n(95).EventEmitter;var s=function(t,e){return t.listeners(e).length},a=n(153),c=n(8).Buffer,f=e.Uint8Array||function(){};var l=n(46);l.inherits=n(7);var h=n(361),p=void 0;p=h&&h.debuglog?h.debuglog("stream"):function(){};var d,y=n(362),w=n(154);l.inherits(M,a);var v=["error","close","destroy","pause","resume"];function g(t,e){t=t||{};var r=e instanceof(o=o||n(23));this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,u=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(u||0===u)?u:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=n(156).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function M(t){if(o=o||n(23),!(this instanceof M))return new M(t);this._readableState=new g(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function _(t,e,n,r,i){var o,u=t._readableState;null===e?(u.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,j(t)}(t,u)):(i||(o=function(t,e){var n;r=e,c.isBuffer(r)||r instanceof f||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(u,e)),o?t.emit("error",o):u.objectMode||e&&e.length>0?("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),r?u.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):m(t,u,e,!0):u.ended?t.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!n?(e=u.decoder.write(e),u.objectMode||0!==e.length?m(t,u,e,!1):N(t,u)):m(t,u,e,!1))):r||(u.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(u)}function m(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&j(t)),N(t,e)}Object.defineProperty(M.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),M.prototype.destroy=w.destroy,M.prototype._undestroy=w.undestroy,M.prototype._destroy=function(t,e){this.push(null),e(t)},M.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=c.from(t,e),e=""),n=!0),_(this,t,e,!1,n)},M.prototype.unshift=function(t){return _(this,t,null,!0,!1)},M.prototype.isPaused=function(){return!1===this._readableState.flowing},M.prototype.setEncoding=function(t){return d||(d=n(156).StringDecoder),this._readableState.decoder=new d(t),this._readableState.encoding=t,this};var L=8388608;function b(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=L?t=L:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function j(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(p("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(x,t):x(t))}function x(t){p("emit readable"),t.emit("readable"),E(t)}function N(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(S,t,e))}function S(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(p("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function D(t){p("readable nexttick read 0"),t.read(0)}function I(t,e){e.reading||(p("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),E(t),e.flowing&&!e.reading&&t.read(0)}function E(t){var e=t._readableState;for(p("flow",e.flowing);e.flowing&&null!==t.read(););}function C(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var r;t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():n?function(t,e){var n=e.head,r=1,i=n.data;t-=i.length;for(;n=n.next;){var o=n.data,u=t>o.length?o.length:t;if(u===o.length?i+=o:i+=o.slice(0,t),0===(t-=u)){u===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(u));break}++r}return e.length-=r,i}(t,e):function(t,e){var n=c.allocUnsafe(t),r=e.head,i=1;r.data.copy(n),t-=r.data.length;for(;r=r.next;){var o=r.data,u=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,u),0===(t-=u)){u===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(u));break}++i}return e.length-=i,n}(t,e);return r}(t,e.buffer,e.decoder),n);var n}function T(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(A,e,t))}function A(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function O(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}M.prototype.read=function(t){p("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return p("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?T(this):j(this),null;if(0===(t=b(t,e))&&e.ended)return 0===e.length&&T(this),null;var r,i=e.needReadable;return p("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&p("length less than watermark",i=!0),e.ended||e.reading?p("reading or ended",i=!1):i&&(p("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=b(n,e))),null===(r=t>0?C(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&T(this)),null!==r&&this.emit("data",r),r},M.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},M.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,e);var a=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?f:M;function c(e,r){p("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",l),t.removeListener("error",w),t.removeListener("unpipe",c),n.removeListener("end",f),n.removeListener("end",M),n.removeListener("data",y),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function f(){p("onend"),t.end()}o.endEmitted?i.nextTick(a):n.once("end",a),t.on("unpipe",c);var l=function(t){return function(){var e=t._readableState;p("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,E(t))}}(n);t.on("drain",l);var h=!1;var d=!1;function y(e){p("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==O(o.pipes,t))&&!h&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function w(e){p("onerror",e),M(),t.removeListener("error",w),0===s(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),M()}function g(){p("onfinish"),t.removeListener("close",v),M()}function M(){p("unpipe"),n.unpipe(t)}return n.on("data",y),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?u(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",w),t.once("close",v),t.once("finish",g),t.emit("pipe",n),o.flowing||(p("pipe resume"),n.resume()),t},M.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var u=O(e.pipes,t);return-1===u?this:(e.pipes.splice(u,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n),this)},M.prototype.on=function(t,e){var n=a.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&j(this):i.nextTick(D,this))}return n},M.prototype.addListener=M.prototype.on,M.prototype.resume=function(){var t=this._readableState;return t.flowing||(p("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(I,t,e))}(this,t)),this},M.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},M.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",function(){if(p("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){(p("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<v.length;o++)t.on(v[o],this.emit.bind(this,v[o]));return this._read=function(e){p("wrapped _read",e),r&&(r=!1,t.resume())},this},Object.defineProperty(M.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),M._fromList=C}).call(this,n(10),n(22))},function(t,e,n){t.exports=n(95).EventEmitter},function(t,e,n){"use strict";var r=n(67);function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,o=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return o||u?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(r.nextTick(i,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(364),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(10))},function(t,e,n){"use strict";var r=n(8).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=a,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function u(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function a(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function f(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var i=u(e[r]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=u(e[r]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=u(e[r]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";t.exports=u;var r=n(23),i=n(46);function o(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);r.call(this,t),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",s)}function s(){var t=this;"function"==typeof this._flush?this._flush(function(e,n){a(t,e,n)}):a(this,null,null)}function a(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=n(7),i.inherits(u,r),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,r.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,n){throw new Error("_transform() is not implemented")},u.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},u.prototype._destroy=function(t,e){var n=this;r.prototype._destroy.call(this,t,function(t){e(t),n.emit("close")})}},function(t,e,n){"use strict";var r=n(24),i=Array.prototype.forEach,o=Object.create,u=function(t,e){var n;for(n in t)e[n]=t[n]};t.exports=function(t){var e=o(null);return i.call(arguments,function(t){r(t)&&u(Object(t),e)}),e}},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";var r=n(25);t.exports=function(t,e,n){var i;return isNaN(t)?(i=e)>=0?n&&i?i-1:i:1:!1!==t&&r(t)}},function(t,e,n){"use strict";t.exports=n(379)()?Object.assign:n(380)},function(t,e,n){"use strict";var r,i,o,u,s,a=n(25),c=function(t,e){return e};try{Object.defineProperty(c,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(t){}1===c.length?(r={configurable:!0,writable:!1,enumerable:!1},i=Object.defineProperty,t.exports=function(t,e){return e=a(e),t.length===e?t:(r.value=e,i(t,"length",r))}):(u=n(163),s=[],o=function(t){var e,n=0;if(s[t])return s[t];for(e=[];t--;)e.push("a"+(++n).toString(36));return new Function("fn","return function ("+e.join(", ")+") { return fn.apply(this, arguments); };")},t.exports=function(t,e){var n;if(e=a(e),t.length===e)return t;n=o(e)(t);try{u(n,t)}catch(t){}return n})},function(t,e,n){"use strict";var r=n(34),i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;t.exports=function(t,e){var n,a=Object(r(e));if(t=Object(r(t)),u(a).forEach(function(r){try{i(t,r,o(e,r))}catch(t){n=t}}),"function"==typeof s&&s(a).forEach(function(r){try{i(t,r,o(e,r))}catch(t){n=t}}),void 0!==n)throw n;return t}},function(t,e,n){"use strict";var r=n(18),i=n(68),o=Function.prototype.call;t.exports=function(t,e){var n={},u=arguments[2];return r(e),i(t,function(t,r,i,s){n[r]=o.call(e,u,t,r,i,s)}),n}},function(t,e){t.exports=function(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}},function(t,e,n){var r=n(7),i=n(35),o=n(8).Buffer,u=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function a(){this.init(),this._w=s,i.call(this,64,56)}function c(t,e,n){return n^t&(e^n)}function f(t,e,n){return t&e|n&(t|e)}function l(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function h(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function p(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}r(a,i),a.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},a.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,d=0|this._f,y=0|this._g,w=0|this._h,v=0;v<16;++v)n[v]=t.readInt32BE(4*v);for(;v<64;++v)n[v]=0|(((e=n[v-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+n[v-7]+p(n[v-15])+n[v-16];for(var g=0;g<64;++g){var M=w+h(a)+c(a,d,y)+u[g]+n[g]|0,_=l(r)+f(r,i,o)|0;w=y,y=d,d=a,a=s+M|0,s=o,o=i,i=r,r=M+_|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=d+this._f|0,this._g=y+this._g|0,this._h=w+this._h|0},a.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=a},function(t,e,n){var r=n(7),i=n(35),o=n(8).Buffer,u=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function a(){this.init(),this._w=s,i.call(this,128,112)}function c(t,e,n){return n^t&(e^n)}function f(t,e,n){return t&e|n&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function h(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function w(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function v(t,e){return t>>>0<e>>>0?1:0}r(a,i),a.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},a.prototype._update=function(t){for(var e=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,g=0|this._gh,M=0|this._hh,_=0|this._al,m=0|this._bl,L=0|this._cl,b=0|this._dl,j=0|this._el,x=0|this._fl,N=0|this._gl,S=0|this._hl,D=0;D<32;D+=2)e[D]=t.readInt32BE(4*D),e[D+1]=t.readInt32BE(4*D+4);for(;D<160;D+=2){var I=e[D-30],E=e[D-30+1],C=p(I,E),T=d(E,I),A=y(I=e[D-4],E=e[D-4+1]),O=w(E,I),z=e[D-14],k=e[D-14+1],Y=e[D-32],U=e[D-32+1],P=T+k|0,R=C+z+v(P,T)|0;R=(R=R+A+v(P=P+O|0,O)|0)+Y+v(P=P+U|0,U)|0,e[D]=R,e[D+1]=P}for(var Q=0;Q<160;Q+=2){R=e[Q],P=e[Q+1];var F=f(n,r,i),B=f(_,m,L),G=l(n,_),W=l(_,n),q=h(s,j),J=h(j,s),Z=u[Q],V=u[Q+1],X=c(s,a,g),H=c(j,x,N),K=S+J|0,$=M+q+v(K,S)|0;$=($=($=$+X+v(K=K+H|0,H)|0)+Z+v(K=K+V|0,V)|0)+R+v(K=K+P|0,P)|0;var tt=W+B|0,et=G+F+v(tt,W)|0;M=g,S=N,g=a,N=x,a=s,x=j,s=o+$+v(j=b+K|0,b)|0,o=i,b=L,i=r,L=m,r=n,m=_,n=$+et+v(_=K+tt|0,K)|0}this._al=this._al+_|0,this._bl=this._bl+m|0,this._cl=this._cl+L|0,this._dl=this._dl+b|0,this._el=this._el+j|0,this._fl=this._fl+x|0,this._gl=this._gl+N|0,this._hl=this._hl+S|0,this._ah=this._ah+n+v(this._al,_)|0,this._bh=this._bh+r+v(this._bl,m)|0,this._ch=this._ch+i+v(this._cl,L)|0,this._dh=this._dh+o+v(this._dl,b)|0,this._eh=this._eh+s+v(this._el,j)|0,this._fh=this._fh+a+v(this._fl,x)|0,this._gh=this._gh+g+v(this._gl,N)|0,this._hh=this._hh+M+v(this._hl,S)|0},a.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=a},function(t,e,n){"use strict";var r=n(37);t.exports=new r({include:[n(169)]})},function(t,e,n){"use strict";var r=n(37);t.exports=new r({include:[n(102)],implicit:[n(434),n(435),n(436),n(437)]})},function(t,e){t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNDA3IDExNiI+DQogIDxkZWZzPg0KICAgIDxzdHlsZT4NCiAgICAgIC5jbHMtMSB7DQogICAgICAgIGNsaXAtcGF0aDogdXJsKCNjbGlwLVNXX1RNLWxvZ28tb24tZGFyayk7DQogICAgICB9DQoNCiAgICAgIC5jbHMtMiB7DQogICAgICAgIGZpbGw6ICNmZmY7DQogICAgICB9DQoNCiAgICAgIC5jbHMtMyB7DQogICAgICAgIGZpbGw6ICM4NWVhMmQ7DQogICAgICB9DQoNCiAgICAgIC5jbHMtNCB7DQogICAgICAgIGZpbGw6ICMxNzM2NDc7DQogICAgICB9DQogICAgPC9zdHlsZT4NCiAgICA8Y2xpcFBhdGggaWQ9ImNsaXAtU1dfVE0tbG9nby1vbi1kYXJrIj4NCiAgICAgIDxyZWN0IHdpZHRoPSI0MDciIGhlaWdodD0iMTE2Ii8+DQogICAgPC9jbGlwUGF0aD4NCiAgPC9kZWZzPg0KICA8ZyBpZD0iU1dfVE0tbG9nby1vbi1kYXJrIiBjbGFzcz0iY2xzLTEiPg0KICAgIDxnIGlkPSJTV19Jbi1Qcm9kdWN0IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC4zMDEpIj4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzYiIGRhdGEtbmFtZT0iUGF0aCAyOTM2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNTkuMTUsNzAuNjc0aC0uN1Y2Ni45OTJoLTEuMjZ2LS42aDMuMjE5di42SDM1OS4xNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzciIGRhdGEtbmFtZT0iUGF0aCAyOTM3IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNjMuMjE3LDcwLjY3NCwzNjEuOTc1LDY3LjFoLS4wMjNxLjA1LjguMDUsMS40OTR2Mi4wODNoLS42MzZWNjYuMzkxaC45ODdsMS4xOSwzLjQwN2guMDE3bDEuMjI1LTMuNDA3aC45OXY0LjI4M0gzNjUuMVY2OC41NTZjMC0uMjEzLjAwNi0uNDkuMDE2LS44MzJzLjAyLS41NDkuMDI4LS42MjFoLS4wMjNsLTEuMjg2LDMuNTcxWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjkzOCIgZGF0YS1uYW1lPSJQYXRoIDI5MzgiIGNsYXNzPSJjbHMtMyIgZD0iTTUwLjMyOCw5Ny42NjlBNDcuNjQyLDQ3LjY0MiwwLDEsMSw5Ny45NzEsNTAuMDI3LDQ3LjY0Miw0Ny42NDIsMCwwLDEsNTAuMzI4LDk3LjY2OVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5MzkiIGRhdGEtbmFtZT0iUGF0aCAyOTM5IiBjbGFzcz0iY2xzLTMiIGQ9Ik01MC4zMjgsNC43NjlBNDUuMjU4LDQ1LjI1OCwwLDEsMSw1LjA3LDUwLjAyNyw0NS4yNTgsNDUuMjU4LDAsMCwxLDUwLjMyOCw0Ljc2OW0wLTQuNzY5YTUwLjAyNyw1MC4wMjcsMCwxLDAsNTAuMDI3LDUwLjAyN0E1MC4wMjcsNTAuMDI3LDAsMCwwLDUwLjMyOCwwWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk0MCIgZGF0YS1uYW1lPSJQYXRoIDI5NDAiIGNsYXNzPSJjbHMtNCIgZD0iTTMxLjgsMzMuODU0Yy0uMTU0LDEuNzEyLjA1OCwzLjQ4Mi0uMDU3LDUuMjEzYTQyLjY2NSw0Mi42NjUsMCwwLDEtLjY5Myw1LjE1Niw5LjUzLDkuNTMsMCwwLDEtNC4xLDUuODI5YzQuMDc5LDIuNjU0LDQuNTQsNi43NzEsNC44MSwxMC45NDYuMTM1LDIuMjUuMDc3LDQuNTIuMzA4LDYuNzUyLjE3MywxLjczMS44NDYsMi4xNzQsMi42MzYsMi4yMzEuNzMuMDIsMS40OCwwLDIuMzI3LDBWNzUuMzNjLTUuMjkuOS05LjY1Ny0uNi0xMC43MzQtNS4wNzlhMzAuNzYsMzAuNzYsMCwwLDEtLjY1NC01Yy0uMTE3LTEuNzg5LjA3Ni0zLjU3OC0uMDU4LTUuMzY3LS4zODYtNC45MDYtMS4wMi02LjU2LTUuNzEzLTYuNzkxdi02LjFBOS4xOTEsOS4xOTEsMCwwLDEsMjAuOSw0Ni44MmMyLjU3Ny0uMTM1LDMuNjc0LS45MjQsNC4yMzEtMy40NjNhMjkuMywyOS4zLDAsMCwwLC40ODEtNC4zMjksODIuMSw4Mi4xLDAsMCwxLC42LTguNDA2Yy42NzMtMy45ODIsMy4xMzYtNS45MDYsNy4yMzQtNi4xMzcsMS4xNTQtLjA1NywyLjMyNywwLDMuNjU1LDB2NS40NjRjLS41NTguMDM4LTEuMDM5LjExNS0xLjUzOS4xMTVDMzIuMjI2LDI5Ljk0OSwzMi4wNTIsMzEuMDg0LDMxLjgsMzMuODU0Wm02LjQwNiwxMi42NThoLS4wNzdhMy41MTUsMy41MTUsMCwxLDAtLjM0Niw3LjAyMWguMjMxYTMuNDYxLDMuNDYxLDAsMCwwLDMuNjU1LTMuMjUxVjUwLjA5YTMuNTIzLDMuNTIzLDAsMCwwLTMuNDYxLTMuNTc4Wm0xMi4wNjIsMGEzLjM3MywzLjM3MywwLDAsMC0zLjQ4MiwzLjI1MSwxLjc5LDEuNzksMCwwLDAsLjAyLjMyNywzLjMsMy4zLDAsMCwwLDMuNTc4LDMuNDQzLDMuMjYzLDMuMjYzLDAsMCwwLDMuNDQzLTMuNTU4LDMuMzA4LDMuMzA4LDAsMCwwLTMuNTU3LTMuNDYzWm0xMi4zNTEsMGEzLjU5MiwzLjU5MiwwLDAsMC0zLjY1NSwzLjQ4MkEzLjUyOSwzLjUyOSwwLDAsMCw2Mi41LDUzLjUzM2guMDM5YzEuNzY5LjMwOSwzLjU1OS0xLjQsMy42NzQtMy40NjJhMy41NzEsMy41NzEsMCwwLDAtMy42LTMuNTU5Wm0xNi45NDguMjg4Yy0yLjIzMi0uMS0zLjM0OC0uODQ2LTMuOS0yLjk2MmEyMS40NDcsMjEuNDQ3LDAsMCwxLS42MzUtNC4xMzZjLS4xNTQtMi41NzgtLjEzNS01LjE3NS0uMzA4LTcuNzUzLS40LTYuMTE3LTQuODI4LTguMjUyLTExLjI1NC03LjE5NXY1LjMxYzEuMDE5LDAsMS44MDgsMCwyLjYuMDE5LDEuMzY2LjAxOSwyLjQuNTM5LDIuNTM5LDIuMDU5LjEzNSwxLjM4NS4xMzUsMi43ODkuMjcsNC4xOTMuMjY5LDIuNzkuNDIyLDUuNjE4LjksOC4zNjlBOC43MTUsOC43MTUsMCwwLDAsNzMuNyw1MC4wNTJjLTMuNCwyLjI4OS00LjQwNiw1LjU1OS00LjU3OCw5LjIzNC0uMSwyLjUyLS4xNTQsNS4wNTktLjI4OSw3LjYtLjExNSwyLjMwOC0uOTIzLDMuMDU4LTMuMjUxLDMuMTE2LS42NTQuMDE5LTEuMjg5LjA3Ny0yLjAxOS4xMTV2NS40NDVjMS4zNjUsMCwyLjYxNi4wNzcsMy44NjYsMCwzLjg4Ni0uMjMxLDYuMjMzLTIuMTE3LDctNS44ODdBNDkuMDc5LDQ5LjA3OSwwLDAsMCw3NSw2My40Yy4xMzUtMS45MjMuMTE2LTMuODY2LjMwOC01Ljc3MS4yODktMi45ODIsMS42NTUtNC4yMTMsNC42MzYtNC40YTQuMDM3LDQuMDM3LDAsMCwwLC44MjgtLjE5MnYtNi4xYy0uNS0uMDU4LS44NDMtLjExNS0xLjIwOC0uMTM1WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk0MSIgZGF0YS1uYW1lPSJQYXRoIDI5NDEiIGNsYXNzPSJjbHMtMiIgZD0iTTE1Mi4yNzMsNTguMTIyYTExLjIyOCwxMS4yMjgsMCwwLDEtNC4zODQsOS40MjRxLTQuMzgzLDMuMzgyLTExLjksMy4zODItOC4xNCwwLTEyLjUyNC0yLjFWNjMuN2EzMi45LDMyLjksMCwwLDAsNi4xMzcsMS44NzksMzIuMywzMi4zLDAsMCwwLDYuNTc1LjY4OXE1LjMyMiwwLDguMDE1LTIuMDJhNi42MjYsNi42MjYsMCwwLDAsMi42OTItNS42Miw3LjIyMiw3LjIyMiwwLDAsMC0uOTU0LTMuOSw4Ljg4NSw4Ljg4NSwwLDAsMC0zLjE5NC0yLjgsNDQuNjM0LDQ0LjYzNCwwLDAsMC02LjgxLTIuOTExcS02LjM4Ny0yLjI4Ni05LjEyNi01LjQxN2ExMS45NTUsMTEuOTU1LDAsMCwxLTIuNzQtOC4xNzJBMTAuMTY0LDEwLjE2NCwwLDAsMSwxMjguMDM5LDI3cTMuOTc3LTMuMTMxLDEwLjUyLTMuMTMxYTMxLDMxLDAsMCwxLDEyLjU1NSwyLjVMMTQ5LjQ1NSwzMWEyOC4zODIsMjguMzgyLDAsMCwwLTExLjAyMS0yLjM4LDEwLjY2OCwxMC42NjgsMCwwLDAtNi42MDYsMS44MTYsNS45ODQsNS45ODQsMCwwLDAtMi4zOCw1LjA0MSw3LjcyMiw3LjcyMiwwLDAsMCwuODc3LDMuOSw4LjI0Miw4LjI0MiwwLDAsMCwyLjk1OSwyLjc4NiwzNi43LDM2LjcsMCwwLDAsNi4zNzEsMi44cTcuMiwyLjU2Niw5LjkxLDUuNTFBMTAuODQsMTAuODQsMCwwLDEsMTUyLjI3Myw1OC4xMjJaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQyIiBkYXRhLW5hbWU9IlBhdGggMjk0MiIgY2xhc3M9ImNscy0yIiBkPSJNMTg1LjI4OCw3MC4zLDE3OSw1MC4xN3EtLjU5NC0xLjg0OC0yLjIyMi04LjM5MWgtLjI1MXEtMS4yNTIsNS40NzktMi4xOTIsOC40NTNMMTY3Ljg0OSw3MC4zaC02LjAxMWwtOS4zNjEtMzQuMzE1aDUuNDQ3cTMuMzE4LDEyLjkzMSw1LjA1NywxOS42OTNhODAuMTEyLDgwLjExMiwwLDAsMSwxLjk4OCw5LjExMWguMjVxLjM0NS0xLjc4NSwxLjExMi00LjYxOHQxLjMzLTQuNDkzbDYuMjk0LTE5LjY5M2g1LjYzNWw2LjEzNywxOS42OTNhNjYuMzY5LDY2LjM2OSwwLDAsMSwyLjM3OSw5LjA0OGguMjUxYTMzLjE2MywzMy4xNjMsMCwwLDEsLjY3My0zLjQ3NXEuNTQ4LTIuMzQ3LDYuNTI4LTI1LjI2Nmg1LjM4NUwxOTEuNDU2LDcwLjNaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQzIiBkYXRhLW5hbWU9IlBhdGggMjk0MyIgY2xhc3M9ImNscy0yIiBkPSJNMjI1LjExNSw3MC4zbC0xLjAzMy00Ljg4NWgtLjI1YTE0LjQ0NiwxNC40NDYsMCwwLDEtNS4xMTksNC4zNjgsMTUuNjA4LDE1LjYwOCwwLDAsMS02LjM3MiwxLjE0M3EtNS4xLDAtOC0yLjYzdC0yLjktNy40ODNxMC0xMC40LDE2LjYyNi0xMC45bDUuODIzLS4xODhWNDcuNnEwLTQuMDM4LTEuNzM4LTUuOTY0VDIxNi42LDM5LjcxM2EyMi42MzMsMjIuNjMzLDAsMCwwLTkuNzA2LDIuNjNsLTEuNi0zLjk3N2EyNC40MzcsMjQuNDM3LDAsMCwxLDUuNTU3LTIuMTYsMjQuMDU2LDI0LjA1NiwwLDAsMSw2LjA1OC0uNzgzcTYuMTM2LDAsOS4xLDIuNzI0dDIuOTU5LDguNzM1VjcwLjNabS0xMS43NDEtMy42NjNBMTAuNTQ5LDEwLjU0OSwwLDAsMCwyMjEsNjMuOTc3YTkuODQ1LDkuODQ1LDAsMCwwLDIuNzcxLTcuNDUxdi0zLjFsLTUuMi4yMTlxLTYuMi4yMTktOC45MzksMS45MjZhNS44LDUuOCwwLDAsMC0yLjc0LDUuMzA2LDUuMzU0LDUuMzU0LDAsMCwwLDEuNzA3LDQuMjksNy4wODEsNy4wODEsMCwwLDAsNC43NzUsMS40NzJaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ0IiBkYXRhLW5hbWU9IlBhdGggMjk0NCIgY2xhc3M9ImNscy0yIiBkPSJNMjY0LjYsMzUuOTg3djMuMjg3bC02LjM1Ni43NTJhMTEuMTYsMTEuMTYsMCwwLDEsMi4yNTUsNi44NTYsMTAuMTQ4LDEwLjE0OCwwLDAsMS0zLjQ0NCw4LjA0N3EtMy40NDQsMy05LjQ1NiwzYTE1LjczNCwxNS43MzQsMCwwLDEtMi44OC0uMjVRMjQxLjQsNTkuNDM4LDI0MS40LDYyLjFhMi4yNDIsMi4yNDIsMCwwLDAsMS4xNTksMi4wODIsOC40NTYsOC40NTYsMCwwLDAsMy45NzYuNjczaDYuMDc0cTUuNTczLDAsOC41NjMsMi4zNDhhOC4xNTgsOC4xNTgsMCwwLDEsMi45OSw2LjgyNSw5Ljc0Myw5Ljc0MywwLDAsMS00LjU3MSw4LjY4OHEtNC41NzIsMi45ODktMTMuMzM4LDIuOTktNi43MzIsMC0xMC4zNzktMi41YTguMDg3LDguMDg3LDAsMCwxLTMuNjQ3LTcuMDc2LDcuOTQ2LDcuOTQ2LDAsMCwxLDItNS40MTcsMTAuMjExLDEwLjIxMSwwLDAsMSw1LjYzNi0zLjEsNS40MjksNS40MjksMCwwLDEtMi4yMDctMS44NDcsNC44OSw0Ljg5LDAsMCwxLS44OTMtMi45MTIsNS41Myw1LjUzLDAsMCwxLDEtMy4yODgsMTAuNTI5LDEwLjUyOSwwLDAsMSwzLjE2Mi0yLjcyMyw5LjI3NSw5LjI3NSwwLDAsMS00LjMzNi0zLjcyNiwxMC45NDUsMTAuOTQ1LDAsMCwxLTEuNjc1LTYuMDEycTAtNS42MzQsMy4zODItOC42ODh0OS41OC0zLjA1MmExNy40MzksMTcuNDM5LDAsMCwxLDQuODUzLjYyNlpNMjM3LjIzMyw3Ni4wNjJhNC42Niw0LjY2LDAsMCwwLDIuMzQ4LDQuMjI3LDEyLjk3MywxMi45NzMsMCwwLDAsNi43MzIsMS40NHE2LjU0MywwLDkuNjktMS45NTZhNS45OTIsNS45OTIsMCwwLDAsMy4xNDctNS4zMDdxMC0yLjc4Ny0xLjcyMy0zLjg2N3QtNi40ODEtMS4wOGgtNi4yM2E4LjIwNSw4LjIwNSwwLDAsMC01LjUxLDEuNjksNi4wNDMsNi4wNDMsMCwwLDAtMS45NzMsNC44NTNabTIuODE4LTI5LjA4NmE2Ljk4NCw2Ljk4NCwwLDAsMCwyLjAzNSw1LjQ0OCw4LjEyMyw4LjEyMywwLDAsMCw1LjY2NywxLjg0N3E3LjYwOCwwLDcuNjA4LTcuMzg5LDAtNy43MzMtNy43LTcuNzMzYTcuNjI4LDcuNjI4LDAsMCwwLTUuNjM1LDEuOTcycS0xLjk3NiwxLjk3My0xLjk3NSw1Ljg1NVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDUiIGRhdGEtbmFtZT0iUGF0aCAyOTQ1IiBjbGFzcz0iY2xzLTIiIGQ9Ik0yOTkuMTM2LDM1Ljk4N3YzLjI4N2wtNi4zNTYuNzUyYTExLjE2OCwxMS4xNjgsMCwwLDEsMi4yNTQsNi44NTYsMTAuMTQ1LDEwLjE0NSwwLDAsMS0zLjQ0NCw4LjA0N3EtMy40NDQsMy05LjQ1NSwzYTE1LjczNCwxNS43MzQsMCwwLDEtMi44OC0uMjVxLTMuMzIsMS43NTQtMy4zMTksNC40MTVhMi4yNDMsMi4yNDMsMCwwLDAsMS4xNTgsMi4wODIsOC40NTksOC40NTksMCwwLDAsMy45NzYuNjczaDYuMDc0cTUuNTc0LDAsOC41NjMsMi4zNDhhOC4xNTgsOC4xNTgsMCwwLDEsMi45OSw2LjgyNSw5Ljc0Myw5Ljc0MywwLDAsMS00LjU3MSw4LjY4OHEtNC41NywyLjk4OS0xMy4zMzcsMi45OS02LjczMiwwLTEwLjM3OS0yLjVhOC4wODgsOC4wODgsMCwwLDEtMy42NDgtNy4wNzYsNy45NDcsNy45NDcsMCwwLDEsMi01LjQxNywxMC4yMDcsMTAuMjA3LDAsMCwxLDUuNjM2LTMuMSw1LjQzMiw1LjQzMiwwLDAsMS0yLjIwOC0xLjg0Nyw0Ljg4OSw0Ljg4OSwwLDAsMS0uODkyLTIuOTEyLDUuNTMsNS41MywwLDAsMSwxLTMuMjg4LDEwLjUyOSwxMC41MjksMCwwLDEsMy4xNjItMi43MjMsOS4yNzEsOS4yNzEsMCwwLDEtNC4zMzYtMy43MjYsMTAuOTQ1LDEwLjk0NSwwLDAsMS0xLjY3NS02LjAxMnEwLTUuNjM0LDMuMzgxLTguNjg4dDkuNTgxLTMuMDUyYTE3LjQ0NCwxNy40NDQsMCwwLDEsNC44NTMuNjI2Wk0yNzEuNzcyLDc2LjA2MmE0LjY1OCw0LjY1OCwwLDAsMCwyLjM0OCw0LjIyNywxMi45NjksMTIuOTY5LDAsMCwwLDYuNzMxLDEuNDRxNi41NDQsMCw5LjY5MS0xLjk1NmE1Ljk5Myw1Ljk5MywwLDAsMCwzLjE0Ni01LjMwN3EwLTIuNzg3LTEuNzIyLTMuODY3dC02LjQ4MS0xLjA4aC02LjIzYTguMjA4LDguMjA4LDAsMCwwLTUuNTExLDEuNjlBNi4wNDIsNi4wNDIsMCwwLDAsMjcxLjc3Miw3Ni4wNjJabTIuODE4LTI5LjA4NmE2Ljk4NCw2Ljk4NCwwLDAsMCwyLjAzNSw1LjQ0OCw4LjEyMSw4LjEyMSwwLDAsMCw1LjY2NywxLjg0N3E3LjYwNywwLDcuNjA4LTcuMzg5LDAtNy43MzMtNy43LTcuNzMzYTcuNjI5LDcuNjI5LDAsMCwwLTUuNjM1LDEuOTcycS0xLjk3NSwxLjk3My0xLjk3NSw1Ljg1NVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDYiIGRhdGEtbmFtZT0iUGF0aCAyOTQ2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zMTYuNzc4LDcwLjkyOHEtNy42MDgsMC0xMi4wMDctNC42MzR0LTQuNC0xMi44NjhxMC04LjMsNC4wODYtMTMuMTgxYTEzLjU3MywxMy41NzMsMCwwLDEsMTAuOTc0LTQuODg0QTEyLjkzOCwxMi45MzgsMCwwLDEsMzI1LjYzOCwzOS42cTMuNzYyLDQuMjQ3LDMuNzYyLDExLjJ2My4yODdIMzA1Ljc1N3EuMTU2LDYuMDQ0LDMuMDUzLDkuMTc0dDguMTU2LDMuMTMxYTI3LjYzMywyNy42MzMsMCwwLDAsMTAuOTU4LTIuMzE3djQuNjM0YTI3LjUsMjcuNSwwLDAsMS01LjIxMywxLjcwNiwyOS4yNTEsMjkuMjUxLDAsMCwxLTUuOTMzLjUxM1ptLTEuNDA5LTMxLjIxNWE4LjQ4OSw4LjQ4OSwwLDAsMC02LjU5MSwyLjY5MiwxMi40MTYsMTIuNDE2LDAsMCwwLTIuOSw3LjQ1MmgxNy45NHEwLTQuOTE2LTIuMTkxLTcuNTNhNy43MTQsNy43MTQsMCwwLDAtNi4yNTgtMi42MTRaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ3IiBkYXRhLW5hbWU9IlBhdGggMjk0NyIgY2xhc3M9ImNscy0yIiBkPSJNMzUwLjksMzUuMzYxYTIwLjM4LDIwLjM4LDAsMCwxLDQuMS4zNzVsLS43MjEsNC44MjJhMTcuNzEyLDE3LjcxMiwwLDAsMC0zLjc1Ny0uNDdBOS4xNDIsOS4xNDIsMCwwLDAsMzQzLjQsNDMuNDdhMTIuMzI3LDEyLjMyNywwLDAsMC0yLjk1OSw4LjQyMlY3MC4zaC01LjJWMzUuOTg3aDQuMjlsLjYsNi4zNTZoLjI1YTE1LjA3MiwxNS4wNzIsMCwwLDEsNC42LTUuMTY2LDEwLjM1NiwxMC4zNTYsMCwwLDEsNS45MTktMS44MTZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTQ4IiBkYXRhLW5hbWU9IlBhdGggMjk0OCIgY2xhc3M9ImNscy0yIiBkPSJNMjU1Ljg1Nyw5Ni42MzhzLTMuNDMtLjM5MS00Ljg1LS4zOTFjLTIuMDU4LDAtMy4xMTEuNzM1LTMuMTExLDIuMTgsMCwxLjU2OC44ODIsMS45MzUsMy43NDgsMi43MTksMy41MjcuOTgsNC44LDEuOTExLDQuOCw0Ljc3NywwLDMuNjc1LTIuMyw1LjI2Ny01LjYxLDUuMjY3YTM1LjY4NywzNS42ODcsMCwwLDEtNS40ODctLjY2MmwuMjctMi4xOHMzLjMwNi40NDEsNS4wNDYuNDQxYzIuMDgyLDAsMy4wMzctLjkzMSwzLjAzNy0yLjcsMC0xLjQyMS0uNzU5LTEuOTEtMy4zMzEtMi41MjMtMy42MjYtLjkzLTUuMTkzLTIuMDMzLTUuMTkzLTQuOTQ4LDAtMy4zODEsMi4yMjktNC43NzYsNS41ODUtNC43NzZhMzcuMiwzNy4yLDAsMCwxLDUuMzE1LjU4N1oiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NDkiIGRhdGEtbmFtZT0iUGF0aCAyOTQ5IiBjbGFzcz0iY2xzLTIiIGQ9Ik0yNjIuOTY3LDk0LjE0SDI2Ny43bDMuNzQ4LDEzLjEwNkwyNzUuMiw5NC4xNGg0Ljc1MnYxNi43OEgyNzcuMlY5Ni40MmgtLjE0NWwtNC4xOTEsMTMuODE2aC0yLjg0MkwyNjUuODMxLDk2LjQyaC0uMTQ1djE0LjVoLTIuNzE5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1MCIgZGF0YS1uYW1lPSJQYXRoIDI5NTAiIGNsYXNzPSJjbHMtMiIgZD0iTTMyMi4wNTcsOTQuMTRIMzM0LjN2Mi40MjVoLTQuNzI4VjExMC45MmgtMi43NDNWOTYuNTY1aC00Ljc3N1oiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTEiIGRhdGEtbmFtZT0iUGF0aCAyOTUxIiBjbGFzcz0iY2xzLTIiIGQ9Ik0zNDYuMTM3LDk0LjE0YzMuMzMyLDAsNS4xMiwxLjI0OSw1LjEyLDQuMzYxLDAsMi4wMzMtLjYzNywzLjAzNy0xLjk4NCwzLjc3MiwxLjQ0NS41NjMsMi40LDEuNTkyLDIuNCwzLjksMCwzLjQzLTIuMDgxLDQuNzUyLTUuMzM5LDQuNzUyaC02LjU2NlY5NC4xNFptLTMuNjUsMi4zNTJ2NC44aDMuNmMxLjY2NiwwLDIuNC0uODMyLDIuNC0yLjQ3NCwwLTEuNjE3LS44MzMtMi4zMjctMi41LTIuMzI3Wm0wLDcuMXY0Ljk3M2gzLjdjMS42ODksMCwyLjY5NC0uNTM5LDIuNjk0LTIuNTQ4LDAtMS45MTEtMS40MjEtMi40MjUtMi43NDQtMi40MjVaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTUyIiBkYXRhLW5hbWU9IlBhdGggMjk1MiIgY2xhc3M9ImNscy0yIiBkPSJNMzU4LjQxNCw5NC4xNEgzNjl2Mi4zNzdoLTcuODY0djQuNzUxaDYuMzk0VjEwMy42aC02LjM5NHY0LjkyNEgzNjl2Mi40SDM1OC40MTRaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTUzIiBkYXRhLW5hbWU9IlBhdGggMjk1MyIgY2xhc3M9ImNscy0yIiBkPSJNMzc4Ljc0Nyw5NC4xNGg1LjQxNGw0LjE2NCwxNi43OGgtMi43NDRMMzg0LjM0MiwxMDZoLTUuNzc3bC0xLjIzOSw0LjkyM2gtMi43MTlabS4zNjEsOS40NTZoNC43MDhsLTEuNzM3LTcuMTc4aC0xLjIyNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTQiIGRhdGEtbmFtZT0iUGF0aCAyOTU0IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zOTcuMSwxMDUuOTQ3djQuOTczaC0yLjcxOVY5NC4xNGg2LjM3YzMuNywwLDUuNjgzLDIuMTIsNS42ODMsNS44NDMsMCwyLjM3Ni0uOTU2LDQuNTE5LTIuNzQ0LDUuMzUybDIuNzY5LDUuNTg1SDQwMy40N2wtMi40MjYtNC45NzNabTMuNjUxLTkuNDU1SDM5Ny4xdjcuMWgzLjdjMi4wNTcsMCwyLjg0MS0xLjg1LDIuODQxLTMuNTg5LDAtMS45LS45MzQtMy41MTEtMi44OTQtMy41MTFaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTU1IiBkYXRhLW5hbWU9IlBhdGggMjk1NSIgY2xhc3M9ImNscy0yIiBkPSJNMjkwLjAxMyw5NC4xNGg1LjQxM2w0LjE2NCwxNi43OGgtMi43NDNMMjk1LjYwOCwxMDZoLTUuNzc3bC0xLjIzOSw0LjkyM2gtMi43MTlabS4zNjEsOS40NTZoNC43MDdsLTEuNzM3LTcuMTc4aC0xLjIyNVoiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTYiIGRhdGEtbmFtZT0iUGF0aCAyOTU2IiBjbGFzcz0iY2xzLTIiIGQ9Ik0zMDguMzYyLDEwNS45NDd2NC45NzNoLTIuNzE5Vjk0LjE0aDYuMzY5YzMuNywwLDUuNjgzLDIuMTIsNS42ODMsNS44NDMsMCwyLjM3Ni0uOTU1LDQuNTE5LTIuNzQzLDUuMzUybDIuNzY4LDUuNTg1aC0yLjk4OWwtMi40MjUtNC45NzNabTMuNjUtOS40NTVoLTMuNjV2Ny4xaDMuN2MyLjA1OCwwLDIuODQxLTEuODUsMi44NDEtMy41ODlDMzE0LjksOTguMSwzMTMuOTcyLDk2LjQ5MiwzMTIuMDEyLDk2LjQ5MloiLz4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzI5NTciIGRhdGEtbmFtZT0iUGF0aCAyOTU3IiBjbGFzcz0iY2xzLTIiIGQ9Ik0xMzAuNjA2LDEwNy42NDNhMy4wMiwzLjAyLDAsMCwxLTEuMTgsMi41MzcsNS4xMTMsNS4xMTMsMCwwLDEtMy4yLjkxLDguMDMsOC4wMywwLDAsMS0zLjM3MS0uNTY0di0xLjM4M2E4Ljc5Myw4Ljc5MywwLDAsMCwxLjY1Mi41MDYsOC42NzIsOC42NzIsMCwwLDAsMS43Ny4xODYsMy41NjUsMy41NjUsMCwwLDAsMi4xNTctLjU0NCwxLjc4MywxLjc4MywwLDAsMCwuNzI1LTEuNTEyLDEuOTQ3LDEuOTQ3LDAsMCwwLS4yNTctMS4wNSwyLjM5MywyLjM5MywwLDAsMC0uODYtLjc1NCwxMi4xNzEsMTIuMTcxLDAsMCwwLTEuODMzLS43ODQsNS44NDIsNS44NDIsMCwwLDEtMi40NTYtMS40NTgsMy4yMTMsMy4yMTMsMCwwLDEtLjczOC0yLjIsMi43MzYsMi43MzYsMCwwLDEsMS4wNzEtMi4yNjcsNC40NDQsNC40NDQsMCwwLDEsMi44MzEtLjg0Myw4LjM0MSw4LjM0MSwwLDAsMSwzLjM4LjY3NWwtLjQ0NywxLjI0N2E3LjYzOSw3LjYzOSwwLDAsMC0yLjk2Ni0uNjQxLDIuODc4LDIuODc4LDAsMCwwLTEuNzc5LjQ4OSwxLjYxMiwxLjYxMiwwLDAsMC0uNjQsMS4zNTcsMi4wODEsMi4wODEsMCwwLDAsLjIzNiwxLjA0OSwyLjIzMSwyLjIzMSwwLDAsMCwuOC43NSw5Ljg3OCw5Ljg3OCwwLDAsMCwxLjcxNS43NTQsNi44LDYuOCwwLDAsMSwyLjY2NywxLjQ4MywyLjkxOSwyLjkxOSwwLDAsMSwuNzIzLDIuMDU3WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1OCIgZGF0YS1uYW1lPSJQYXRoIDI5NTgiIGNsYXNzPSJjbHMtMiIgZD0iTTEzNC40NDcsMTAxLjY4NnY1Ljk5MWEyLjQxMSwyLjQxMSwwLDAsMCwuNTE1LDEuNjg2LDIuMDksMi4wOSwwLDAsMCwxLjYwOS41NTYsMi42MjksMi42MjksMCwwLDAsMi4xMi0uNzkyLDQsNCwwLDAsMCwuNjctMi41ODd2LTQuODU0aDEuNHY5LjIzNkgxMzkuNmwtLjItMS4yMzloLS4wNzVhMi43OTMsMi43OTMsMCwwLDEtMS4xOTMsMS4wNDUsNCw0LDAsMCwxLTEuNzQuMzYyLDMuNTI5LDMuNTI5LDAsMCwxLTIuNTI0LS44LDMuNDA5LDMuNDA5LDAsMCwxLS44MzktMi41NjJ2LTYuMDQyWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk1OSIgZGF0YS1uYW1lPSJQYXRoIDI5NTkiIGNsYXNzPSJjbHMtMiIgZD0iTTE0OC4yMDYsMTExLjA5YTMuOTkzLDMuOTkzLDAsMCwxLTEuNjQ3LS4zMzMsMy4xLDMuMSwwLDAsMS0xLjI1Mi0xLjAyM2gtLjFhMTIuMjY1LDEyLjI2NSwwLDAsMSwuMSwxLjUzM3YzLjhoLTEuNFYxMDEuNjg2aDEuMTM3bC4xOTQsMS4yNjRoLjA2N2EzLjI1NywzLjI1NywwLDAsMSwxLjI1Ni0xLjEsMy44MzEsMy44MzEsMCwwLDEsMS42NDMtLjMzNywzLjQxMywzLjQxMywwLDAsMSwyLjgzNiwxLjI1Niw2LjY4Myw2LjY4MywwLDAsMS0uMDE3LDcuMDU3LDMuNDIsMy40MiwwLDAsMS0yLjgxNywxLjI2NFptLS4yLTguMzg1YTIuNDgyLDIuNDgyLDAsMCwwLTIuMDQ4Ljc4NCw0LjA0MSw0LjA0MSwwLDAsMC0uNjQ5LDIuNDk0di4zMTJhNC42MjUsNC42MjUsMCwwLDAsLjY0OSwyLjc4NSwyLjQ2NywyLjQ2NywwLDAsMCwyLjA4Mi44MzksMi4xNjQsMi4xNjQsMCwwLDAsMS44NzUtLjk2OSw0LjYsNC42LDAsMCwwLC42NzgtMi42NzEsNC40MjgsNC40MjgsMCwwLDAtLjY3OC0yLjY1MSwyLjIzMiwyLjIzMiwwLDAsMC0xLjkxNS0uOTIzWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MCIgZGF0YS1uYW1lPSJQYXRoIDI5NjAiIGNsYXNzPSJjbHMtMiIgZD0iTTE1OS4wMzksMTExLjA5YTMuOTkzLDMuOTkzLDAsMCwxLTEuNjQ3LS4zMzMsMy4xLDMuMSwwLDAsMS0xLjI1Mi0xLjAyM2gtLjFhMTIuMjY1LDEyLjI2NSwwLDAsMSwuMSwxLjUzM3YzLjhoLTEuNFYxMDEuNjg2aDEuMTM3bC4xOTQsMS4yNjRoLjA2N2EzLjI1NywzLjI1NywwLDAsMSwxLjI1Ni0xLjEsMy44MzEsMy44MzEsMCwwLDEsMS42NDMtLjMzNywzLjQxMywzLjQxMywwLDAsMSwyLjgzNiwxLjI1Niw2LjY4Myw2LjY4MywwLDAsMS0uMDE3LDcuMDU3LDMuNDIsMy40MiwwLDAsMS0yLjgxNywxLjI2NFptLS4yLTguMzg1YTIuNDgyLDIuNDgyLDAsMCwwLTIuMDQ4Ljc4NCw0LjA0MSw0LjA0MSwwLDAsMC0uNjQ5LDIuNDk0di4zMTJhNC42MjUsNC42MjUsMCwwLDAsLjY0OSwyLjc4NSwyLjQ2NywyLjQ2NywwLDAsMCwyLjA4Mi44MzksMi4xNjQsMi4xNjQsMCwwLDAsMS44NzUtLjk2OSw0LjYsNC42LDAsMCwwLC42NzgtMi42NzEsNC40MjgsNC40MjgsMCwwLDAtLjY3OC0yLjY1MSwyLjIzMiwyLjIzMiwwLDAsMC0xLjkxMS0uOTIzWiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MSIgZGF0YS1uYW1lPSJQYXRoIDI5NjEiIGNsYXNzPSJjbHMtMiIgZD0iTTE3My42MTIsMTA2LjNhNS4wOTMsNS4wOTMsMCwwLDEtMS4xMzcsMy41MjcsNC4wMDUsNC4wMDUsMCwwLDEtMy4xNDMsMS4yNjgsNC4xNzIsNC4xNzIsMCwwLDEtMi4yLS41ODEsMy44NCwzLjg0LDAsMCwxLTEuNDgzLTEuNjY5LDUuOCw1LjgsMCwwLDEtLjUyMi0yLjU0NSw1LjA4Nyw1LjA4NywwLDAsMSwxLjEyOS0zLjUxOCwzLjk5MSwzLjk5MSwwLDAsMSwzLjEzNS0xLjI2LDMuOTA3LDMuOTA3LDAsMCwxLDMuMDgsMS4yOSw1LjA3MSw1LjA3MSwwLDAsMSwxLjE0MSwzLjQ4OFptLTcuMDM2LDBhNC4zODQsNC4zODQsMCwwLDAsLjcwOCwyLjcsMi44MDksMi44MDksMCwwLDAsNC4xNjcsMCw0LjM2NSw0LjM2NSwwLDAsMCwuNzEyLTIuNyw0LjI5Myw0LjI5MywwLDAsMC0uNzEyLTIuNjc1LDIuNSwyLjUsMCwwLDAtMi4xLS45MTUsMi40NjEsMi40NjEsMCwwLDAtMi4wNzIuOSw0LjMzNCw0LjMzNCwwLDAsMC0uNywyLjY5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MiIgZGF0YS1uYW1lPSJQYXRoIDI5NjIiIGNsYXNzPSJjbHMtMiIgZD0iTTE4MC41MjUsMTAxLjUxN2E1LjUwNiw1LjUwNiwwLDAsMSwxLjEuMWwtLjE5NCwxLjNhNC43ODYsNC43ODYsMCwwLDAtMS4wMTEtLjEyNywyLjQ2LDIuNDYsMCwwLDAtMS45MTcuOTExLDMuMzE4LDMuMzE4LDAsMCwwLS44LDIuMjY3djQuOTU1aC0xLjR2LTkuMjM2aDEuMTU0bC4xNiwxLjcxaC4wNjhhNC4wNTQsNC4wNTQsMCwwLDEsMS4yMzgtMS4zOSwyLjc4NywyLjc4NywwLDAsMSwxLjYtLjQ5WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2MyIgZGF0YS1uYW1lPSJQYXRoIDI5NjMiIGNsYXNzPSJjbHMtMiIgZD0iTTE4Ny4zNjMsMTA5LjkzNmE0LjUwNiw0LjUwNiwwLDAsMCwuNzE2LS4wNTUsNC4zODcsNC4zODcsMCwwLDAsLjU0OC0uMTE0djEuMDdhMi41LDIuNSwwLDAsMS0uNjcuMTgxLDUsNSwwLDAsMS0uOC4wNzJxLTIuNjgsMC0yLjY4LTIuODIzdi01LjQ5NGgtMS4zMjNWMTAyLjFsMS4zMjMtLjU4Mi41OS0xLjk3MmguODA5djIuMTQxaDIuNjh2MS4wODdoLTIuNjh2NS40MzVhMS44NjksMS44NjksMCwwLDAsLjQsMS4yODFBMS4zNzcsMS4zNzcsMCwwLDAsMTg3LjM2MywxMDkuOTM2WiIvPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfMjk2NCIgZGF0YS1uYW1lPSJQYXRoIDI5NjQiIGNsYXNzPSJjbHMtMiIgZD0iTTE5NC41MzgsMTExLjA5YTQuMjM5LDQuMjM5LDAsMCwxLTMuMjMxLTEuMjQ3LDQuODI0LDQuODI0LDAsMCwxLTEuMTg0LTMuNDYzLDUuMzU1LDUuMzU1LDAsMCwxLDEuMS0zLjU0OCwzLjY1MiwzLjY1MiwwLDAsMSwyLjk1NC0xLjMxNSwzLjQ4NCwzLjQ4NCwwLDAsMSwyLjc0NywxLjE0Miw0LjM3OCw0LjM3OCwwLDAsMSwxLjAxMSwzLjAxM3YuODg1aC02LjM2MmEzLjY2LDMuNjYsMCwwLDAsLjgyMiwyLjQ2OSwyLjg0MywyLjg0MywwLDAsMCwyLjIuODQzLDcuNDMxLDcuNDMxLDAsMCwwLDIuOTQ5LS42MjR2MS4yNDdhNy4zNzcsNy4zNzcsMCwwLDEtMS40LjQ1OSw3Ljg2Myw3Ljg2MywwLDAsMS0xLjYuMTM5Wm0tLjM3OS04LjRhMi4yODYsMi4yODYsMCwwLDAtMS43NzQuNzI1LDMuMzM3LDMuMzM3LDAsMCwwLS43NzksMi4wMDZoNC44MjhhMy4wNzIsMy4wNzIsMCwwLDAtLjU5LTIuMDI3LDIuMDc2LDIuMDc2LDAsMCwwLTEuNjg1LS43MDZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY1IiBkYXRhLW5hbWU9IlBhdGggMjk2NSIgY2xhc3M9ImNscy0yIiBkPSJNMjA2Ljk1MSwxMDkuNjgzaC0uMDc2YTMuMjg3LDMuMjg3LDAsMCwxLTIuOSwxLjQwNywzLjQyNywzLjQyNywwLDAsMS0yLjgxOS0xLjIzOSw1LjQ1Miw1LjQ1MiwwLDAsMS0xLjAwNi0zLjUyMiw1LjU0Miw1LjU0MiwwLDAsMSwxLjAxMS0zLjU0OCwzLjQsMy40LDAsMCwxLDIuODE0LTEuMjY0LDMuMzYxLDMuMzYxLDAsMCwxLDIuODgzLDEuMzY1aC4xMDlsLS4wNTktLjY2NS0uMDM0LS42NDlWOTcuODA5aDEuNHYxMy4xMTNoLTEuMTM4Wm0tMi44LjIzNmEyLjU1MSwyLjU1MSwwLDAsMCwyLjA3OC0uNzc5LDMuOTQ3LDMuOTQ3LDAsMCwwLC42NDQtMi41MTZ2LS4zYTQuNjM4LDQuNjM4LDAsMCwwLS42NTMtMi44LDIuNDgxLDIuNDgxLDAsMCwwLTIuMDg2LS44MzksMi4xNCwyLjE0LDAsMCwwLTEuODgzLjk1Nyw0Ljc2LDQuNzYsMCwwLDAtLjY1MywyLjcsNC41NTQsNC41NTQsMCwwLDAsLjY0OSwyLjY3MSwyLjE5NCwyLjE5NCwwLDAsMCwxLjkwNi45MDZaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY2IiBkYXRhLW5hbWU9IlBhdGggMjk2NiIgY2xhc3M9ImNscy0yIiBkPSJNMjIwLjcxMiwxMDEuNTM0YTMuNDM1LDMuNDM1LDAsMCwxLDIuODI3LDEuMjQzLDYuNjUzLDYuNjUzLDAsMCwxLS4wMDksNy4wNTMsMy40MTcsMy40MTcsMCwwLDEtMi44MTgsMS4yNiw0LDQsMCwwLDEtMS42NDgtLjMzMywzLjA5NCwzLjA5NCwwLDAsMS0xLjI1MS0xLjAyM2gtLjFsLS4yOTUsMS4xODhoLTFWOTcuODA5aDEuNFYxMDFxMCwxLjA2OS0uMDY4LDEuOTIxaC4wNjhhMy4zMjIsMy4zMjIsMCwwLDEsMi44OTQtMS4zODdabS0uMiwxLjE3MWEyLjQ0LDIuNDQsMCwwLDAtMi4wNjQuODIyLDYuMzM4LDYuMzM4LDAsMCwwLC4wMTcsNS41NTMsMi40NjQsMi40NjQsMCwwLDAsMi4wODEuODM5LDIuMTU4LDIuMTU4LDAsMCwwLDEuOTIyLS45NCw0LjgyOCw0LjgyOCwwLDAsMCwuNjMyLTIuNyw0LjY0NSw0LjY0NSwwLDAsMC0uNjMyLTIuNjg5LDIuMjQyLDIuMjQyLDAsMCwwLTEuOTU5LS44ODVaIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF8yOTY3IiBkYXRhLW5hbWU9IlBhdGggMjk2NyIgY2xhc3M9ImNscy0yIiBkPSJNMjI1Ljc1OCwxMDEuNjg2aDEuNWwyLjAyMyw1LjI2N2EyMC4xODgsMjAuMTg4LDAsMCwxLC44MjYsMi42aC4wNjdxLjEwOS0uNDMxLjQ1OS0xLjQ3MXQyLjI4OC02LjRoMS41TDIzMC40NTIsMTEyLjJhNS4yNTMsNS4yNTMsMCwwLDEtMS4zNzgsMi4yMTIsMi45MzIsMi45MzIsMCwwLDEtMS45MzQuNjUzLDUuNjU5LDUuNjU5LDAsMCwxLTEuMjY0LS4xNDNWMTEzLjhhNC45LDQuOSwwLDAsMCwxLjAzNy4xLDIuMTM2LDIuMTM2LDAsMCwwLDIuMDU2LTEuNjE4bC41MTQtMS4zMTRaIi8+DQogICAgPC9nPg0KICA8L2c+DQo8L3N2Zz4NCg=="},function(t,e,n){var r=n(240),i=n(243),o=n(248);t.exports=function(t,e){return r(t)||i(t,e)||o()}},function(t,e,n){"use strict";var r=/^(%20|\s)*(javascript|data)/im,i=/[^\x20-\x7E]/gim,o=/^([^:]+):/gm,u=[".","/"];t.exports={sanitizeUrl:function(t){if(!t)return"about:blank";var e,n,s=t.replace(i,"").trim();return function(t){return u.indexOf(t[0])>-1}(s)?s:(n=s.match(o))?(e=n[0],r.test(e)?"about:blank":s):"about:blank"}}},function(t,e,n){var r=n(254),i=n(265)(function(t,e,n){return e=e.toLowerCase(),t+(n?r(e):e)});t.exports=i},function(t,e,n){var r=n(295)(n(347));t.exports=r},function(t,e,n){var r=n(143),i=n(91),o=n(352),u=n(12),s=n(358);t.exports=function(t,e,n){var a=u(t)?r:o;return n&&s(t,e,n)&&(e=void 0),a(t,i(e,3))}},function(t,e,n){(function(e){var r=n(359),i=n(360).Stream,o=" ";function u(t,e,n){n=n||0;var i,o,s=(i=e,new Array(n||0).join(i||"")),a=t;if("object"==typeof t&&((a=t[o=Object.keys(t)[0]])&&a._elem))return a._elem.name=o,a._elem.icount=n,a._elem.indent=e,a._elem.indents=s,a._elem.interrupt=a,a._elem;var c,f=[],l=[];function h(t){Object.keys(t).forEach(function(e){f.push(function(t,e){return t+'="'+r(e)+'"'}(e,t[e]))})}switch(typeof a){case"object":if(null===a)break;a._attr&&h(a._attr),a._cdata&&l.push(("<![CDATA["+a._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),a.forEach&&(c=!1,l.push(""),a.forEach(function(t){"object"==typeof t?"_attr"==Object.keys(t)[0]?h(t._attr):l.push(u(t,e,n+1)):(l.pop(),c=!0,l.push(r(t)))}),c||l.push(""));break;default:l.push(r(a))}return{name:o,interrupt:!1,attributes:f,content:l,icount:n,indents:s,indent:e}}function s(t,e,n){if("object"!=typeof e)return t(!1,e);var r=e.interrupt?1:e.content.length;function i(){for(;e.content.length;){var i=e.content.shift();if(void 0!==i){if(o(i))return;s(t,i)}}t(!1,(r>1?e.indents:"")+(e.name?"</"+e.name+">":"")+(e.indent&&!n?"\n":"")),n&&n()}function o(e){return!!e.interrupt&&(e.interrupt.append=t,e.interrupt.end=i,e.interrupt=!1,t(!0),!0)}if(t(!1,e.indents+(e.name?"<"+e.name:"")+(e.attributes.length?" "+e.attributes.join(" "):"")+(r?e.name?">":"":e.name?"/>":"")+(e.indent&&r>1?"\n":"")),!r)return t(!1,e.indent?"\n":"");o(e)||i()}t.exports=function(t,n){"object"!=typeof n&&(n={indent:n});var r,a,c=n.stream?new i:null,f="",l=!1,h=n.indent?!0===n.indent?o:n.indent:"",p=!0;function d(t){p?e.nextTick(t):t()}function y(t,e){if(void 0!==e&&(f+=e),t&&!l&&(c=c||new i,l=!0),t&&l){var n=f;d(function(){c.emit("data",n)}),f=""}}function w(t,e){s(y,u(t,h,h?1:0),e)}function v(){if(c){var t=f;d(function(){c.emit("data",t),c.emit("end"),c.readable=!1,c.emit("close")})}}return d(function(){p=!1}),n.declaration&&(r=n.declaration,a={version:"1.0",encoding:r.encoding||"UTF-8"},r.standalone&&(a.standalone=r.standalone),w({"?xml":{_attr:a}}),f=f.replace("/>","?>")),t&&t.forEach?t.forEach(function(e,n){var r;n+1===t.length&&(r=v),w(e,r)}):w(t,v),c?(c.readable=!0,c):f},t.exports.element=t.exports.Element=function(){var t={_elem:u(Array.prototype.slice.call(arguments)),push:function(t){if(!this.append)throw new Error("not assigned to a parent!");var e=this,n=this._elem.indent;s(this.append,u(t,n,this._elem.icount+(n?1:0)),function(){e.append(!0)})},close:function(t){void 0!==t&&this.push(t),this.end&&this.end()}};return t}}).call(this,n(22))},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function i(t){return null===t?"null":void 0===t?"undefined":"object"===(void 0===t?"undefined":r(t))?Array.isArray(t)?"array":"object":void 0===t?"undefined":r(t)}function o(t){return"object"===i(t)?s(t):"array"===i(t)?u(t):t}function u(t){return t.map(o)}function s(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=o(t[n]));return e}function a(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={arrayBehaviour:(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).arrayBehaviour||"replace"},r=e.map(function(t){return t||{}}),o=t||{},c=0;c<r.length;c++)for(var f=r[c],l=Object.keys(f),h=0;h<l.length;h++){var p=l[h],d=f[p],y=i(d),w=i(o[p]);if("object"===y)if("undefined"!==w){var v="object"===w?o[p]:{};o[p]=a({},[v,s(d)],n)}else o[p]=s(d);else if("array"===y)if("array"===w){var g=u(d);o[p]="merge"===n.arrayBehaviour?o[p].concat(g):g}else o[p]=u(d);else o[p]=d}return o}t.exports=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return a(t,n)},t.exports.noMutate=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return a({},e)},t.exports.withOptions=function(t,e,n){return a(t,e,n)}},function(t,e,n){(function(e){var n;n=void 0!==e?e:this,t.exports=function(t){if(t.CSS&&t.CSS.escape)return t.CSS.escape;var e=function(t){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var e,n=String(t),r=n.length,i=-1,o="",u=n.charCodeAt(0);++i<r;)0!=(e=n.charCodeAt(i))?o+=e>=1&&e<=31||127==e||0==i&&e>=48&&e<=57||1==i&&e>=48&&e<=57&&45==u?"\\"+e.toString(16)+" ":0==i&&1==r&&45==e||!(e>=128||45==e||95==e||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)?"\\"+n.charAt(i):n.charAt(i):o+="�";return o};return t.CSS||(t.CSS={}),t.CSS.escape=e,e}(n)}).call(this,n(10))},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(0),i=n.n(r),o=i.a.Set.of("type","format","items","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf");function u(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isOAS3;if(!i.a.Map.isMap(t))return{schema:i.a.Map(),parameterContentMediaType:null};if(!e)return"body"===t.get("in")?{schema:t.get("schema",i.a.Map()),parameterContentMediaType:null}:{schema:t.filter(function(t,e){return o.includes(e)}),parameterContentMediaType:null};if(t.get("content")){var n=t.get("content",i.a.Map({})).keySeq().first();return{schema:t.getIn(["content",n,"schema"],i.a.Map()),parameterContentMediaType:n}}return{schema:t.get("schema",i.a.Map()),parameterContentMediaType:null}}},function(t,e,n){"use strict";(function(e,r){var i=65536,o=4294967295;var u=n(8).Buffer,s=e.crypto||e.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>o)throw new RangeError("requested too many random bytes");var n=u.allocUnsafe(t);if(t>0)if(t>i)for(var a=0;a<t;a+=i)s.getRandomValues(n.slice(a,a+i));else s.getRandomValues(n);if("function"==typeof e)return r.nextTick(function(){e(null,n)});return n}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,n(10),n(22))},function(t,e,n){(e=t.exports=function(t){t=t.toLowerCase();var n=e[t];if(!n)throw new Error(t+" is not supported (we accept pull requests)");return new n}).sha=n(424),e.sha1=n(425),e.sha224=n(426),e.sha256=n(166),e.sha384=n(427),e.sha512=n(167)},function(t,e,n){"use strict";var r=n(428);t.exports=r},function(t,e,n){t.exports=n(449)},function(t,e,n){n(185);var r=n(4).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},function(t,e,n){var r=n(15);r(r.S+r.F*!n(20),"Object",{defineProperty:n(19).f})},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){t.exports=n(188)},function(t,e,n){n(114),n(120),t.exports=n(85).f("iterator")},function(t,e,n){var r=n(77),i=n(78);t.exports=function(t){return function(e,n){var o,u,s=String(i(e)),a=r(n),c=s.length;return a<0||a>=c?t?"":void 0:(o=s.charCodeAt(a))<55296||o>56319||a+1===c||(u=s.charCodeAt(a+1))<56320||u>57343?t?s.charAt(a):o:t?s.slice(a,a+2):u-56320+(o-55296<<10)+65536}}},function(t,e,n){"use strict";var r=n(79),i=n(50),o=n(84),u={};n(27)(u,n(17)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(19),i=n(28),o=n(39);t.exports=n(20)?Object.defineProperties:function(t,e){i(t);for(var n,u=o(e),s=u.length,a=0;s>a;)r.f(t,n=u[a++],e[n]);return t}},function(t,e,n){var r=n(31),i=n(193),o=n(194);t.exports=function(t){return function(e,n,u){var s,a=r(e),c=i(a.length),f=o(u,c);if(t&&n!=n){for(;c>f;)if((s=a[f++])!=s)return!0}else for(;c>f;f++)if((t||f in a)&&a[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(77),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(77),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(16).document;t.exports=r&&r.documentElement},function(t,e,n){"use strict";var r=n(197),i=n(198),o=n(52),u=n(31);t.exports=n(115)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){t.exports=n(200)},function(t,e,n){n(201),n(205),n(206),n(207),t.exports=n(4).Symbol},function(t,e,n){"use strict";var r=n(16),i=n(21),o=n(20),u=n(15),s=n(116),a=n(202).KEY,c=n(30),f=n(82),l=n(84),h=n(53),p=n(17),d=n(85),y=n(86),w=n(203),v=n(121),g=n(28),M=n(29),_=n(31),m=n(76),L=n(50),b=n(79),j=n(204),x=n(123),N=n(19),S=n(39),D=x.f,I=N.f,E=j.f,C=r.Symbol,T=r.JSON,A=T&&T.stringify,O=p("_hidden"),z=p("toPrimitive"),k={}.propertyIsEnumerable,Y=f("symbol-registry"),U=f("symbols"),P=f("op-symbols"),R=Object.prototype,Q="function"==typeof C,F=r.QObject,B=!F||!F.prototype||!F.prototype.findChild,G=o&&c(function(){return 7!=b(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=D(R,e);r&&delete R[e],I(t,e,n),r&&t!==R&&I(R,e,r)}:I,W=function(t){var e=U[t]=b(C.prototype);return e._k=t,e},q=Q&&"symbol"==typeof C.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof C},J=function(t,e,n){return t===R&&J(P,e,n),g(t),e=m(e,!0),g(n),i(U,e)?(n.enumerable?(i(t,O)&&t[O][e]&&(t[O][e]=!1),n=b(n,{enumerable:L(0,!1)})):(i(t,O)||I(t,O,L(1,{})),t[O][e]=!0),G(t,e,n)):I(t,e,n)},Z=function(t,e){g(t);for(var n,r=w(e=_(e)),i=0,o=r.length;o>i;)J(t,n=r[i++],e[n]);return t},V=function(t){var e=k.call(this,t=m(t,!0));return!(this===R&&i(U,t)&&!i(P,t))&&(!(e||!i(this,t)||!i(U,t)||i(this,O)&&this[O][t])||e)},X=function(t,e){if(t=_(t),e=m(e,!0),t!==R||!i(U,e)||i(P,e)){var n=D(t,e);return!n||!i(U,e)||i(t,O)&&t[O][e]||(n.enumerable=!0),n}},H=function(t){for(var e,n=E(_(t)),r=[],o=0;n.length>o;)i(U,e=n[o++])||e==O||e==a||r.push(e);return r},K=function(t){for(var e,n=t===R,r=E(n?P:_(t)),o=[],u=0;r.length>u;)!i(U,e=r[u++])||n&&!i(R,e)||o.push(U[e]);return o};Q||(s((C=function(){if(this instanceof C)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),e=function(n){this===R&&e.call(P,n),i(this,O)&&i(this[O],t)&&(this[O][t]=!1),G(this,t,L(1,n))};return o&&B&&G(R,t,{configurable:!0,set:e}),W(t)}).prototype,"toString",function(){return this._k}),x.f=X,N.f=J,n(122).f=j.f=H,n(55).f=V,n(87).f=K,o&&!n(51)&&s(R,"propertyIsEnumerable",V,!0),d.f=function(t){return W(p(t))}),u(u.G+u.W+u.F*!Q,{Symbol:C});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;$.length>tt;)p($[tt++]);for(var et=S(p.store),nt=0;et.length>nt;)y(et[nt++]);u(u.S+u.F*!Q,"Symbol",{for:function(t){return i(Y,t+="")?Y[t]:Y[t]=C(t)},keyFor:function(t){if(!q(t))throw TypeError(t+" is not a symbol!");for(var e in Y)if(Y[e]===t)return e},useSetter:function(){B=!0},useSimple:function(){B=!1}}),u(u.S+u.F*!Q,"Object",{create:function(t,e){return void 0===e?b(t):Z(b(t),e)},defineProperty:J,defineProperties:Z,getOwnPropertyDescriptor:X,getOwnPropertyNames:H,getOwnPropertySymbols:K}),T&&u(u.S+u.F*(!Q||c(function(){var t=C();return"[null]"!=A([t])||"{}"!=A({a:t})||"{}"!=A(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(M(e)||void 0!==t)&&!q(t))return v(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!q(e))return e}),r[1]=e,A.apply(T,r)}}),C.prototype[z]||n(27)(C.prototype,z,C.prototype.valueOf),l(C,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){var r=n(53)("meta"),i=n(29),o=n(21),u=n(19).f,s=0,a=Object.isExtensible||function(){return!0},c=!n(30)(function(){return a(Object.preventExtensions({}))}),f=function(t){u(t,r,{value:{i:"O"+ ++s,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!a(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!a(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&a(t)&&!o(t,r)&&f(t),t}}},function(t,e,n){var r=n(39),i=n(87),o=n(55);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var u,s=n(t),a=o.f,c=0;s.length>c;)a.call(t,u=s[c++])&&e.push(u);return e}},function(t,e,n){var r=n(31),i=n(122).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return u.slice()}}(t):i(r(t))}},function(t,e){},function(t,e,n){n(86)("asyncIterator")},function(t,e,n){n(86)("observable")},function(t,e,n){t.exports=n(209)},function(t,e,n){n(210),t.exports=n(4).Object.getPrototypeOf},function(t,e,n){var r=n(54),i=n(119);n(124)("getPrototypeOf",function(){return function(t){return i(r(t))}})},function(t,e,n){n(212),t.exports=n(4).Object.setPrototypeOf},function(t,e,n){var r=n(15);r(r.S,"Object",{setPrototypeOf:n(213).set})},function(t,e,n){var r=n(29),i=n(28),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(111)(Function.call,n(123).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){t.exports=n(215)},function(t,e,n){n(216);var r=n(4).Object;t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){var r=n(15);r(r.S,"Object",{create:n(79)})},function(t,e,n){var r=n(125);function i(e,n){return t.exports=i=r||function(t,e){return t.__proto__=e,t},i(e,n)}t.exports=i},function(t,e,n){"use strict";var r=n(40),i=n(126),o=n(220),u=n(225),s=n(32),a=n(226),c=n(232),f=n(233),l=n(235),h=s.createElement,p=s.createFactory,d=s.cloneElement,y=r,w={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:l},Component:i.Component,PureComponent:i.PureComponent,createElement:h,cloneElement:d,isValidElement:s.isValidElement,PropTypes:a,createClass:f,createFactory:p,createMixin:function(t){return t},DOM:u,version:c,__spread:y};t.exports=w},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";var r=n(221),i=n(32),o=n(128),u=n(222),s=r.twoArgumentPooler,a=r.fourArgumentPooler,c=/\/+/g;function f(t){return(""+t).replace(c,"$&/")}function l(t,e){this.func=t,this.context=e,this.count=0}function h(t,e,n){var r=t.func,i=t.context;r.call(i,e,t.count++)}function p(t,e,n,r){this.result=t,this.keyPrefix=e,this.func=n,this.context=r,this.count=0}function d(t,e,n){var r=t.result,u=t.keyPrefix,s=t.func,a=t.context,c=s.call(a,e,t.count++);Array.isArray(c)?y(c,r,n,o.thatReturnsArgument):null!=c&&(i.isValidElement(c)&&(c=i.cloneAndReplaceKey(c,u+(!c.key||e&&e.key===c.key?"":f(c.key)+"/")+n)),r.push(c))}function y(t,e,n,r,i){var o="";null!=n&&(o=f(n)+"/");var s=p.getPooled(e,o,r,i);u(t,d,s),p.release(s)}function w(t,e,n){return null}l.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},r.addPoolingTo(l,s),p.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},r.addPoolingTo(p,a);var v={forEach:function(t,e,n){if(null==t)return t;var r=l.getPooled(e,n);u(t,h,r),l.release(r)},map:function(t,e,n){if(null==t)return t;var r=[];return y(t,r,null,e,n),r},mapIntoWithKeyPrefixInternal:y,count:function(t,e){return u(t,w,null)},toArray:function(t){var e=[];return y(t,e,null,o.thatReturnsArgument),e}};t.exports=v},function(t,e,n){"use strict";var r=n(56),i=(n(41),function(t){if(this.instancePool.length){var e=this.instancePool.pop();return this.call(e,t),e}return new this(t)}),o=function(t){t instanceof this||r("25"),t.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(t)},u=i,s={addPoolingTo:function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||u,n.poolSize||(n.poolSize=10),n.release=o,n},oneArgumentPooler:i,twoArgumentPooler:function(t,e){if(this.instancePool.length){var n=this.instancePool.pop();return this.call(n,t,e),n}return new this(t,e)},threeArgumentPooler:function(t,e,n){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,t,e,n),r}return new this(t,e,n)},fourArgumentPooler:function(t,e,n,r){if(this.instancePool.length){var i=this.instancePool.pop();return this.call(i,t,e,n,r),i}return new this(t,e,n,r)}};t.exports=s},function(t,e,n){"use strict";var r=n(56),i=(n(131),n(132)),o=n(223),u=(n(41),n(224)),s=(n(88),"."),a=":";function c(t,e){return t&&"object"==typeof t&&null!=t.key?u.escape(t.key):e.toString(36)}t.exports=function(t,e,n){return null==t?0:function t(e,n,f,l){var h,p=typeof e;if("undefined"!==p&&"boolean"!==p||(e=null),null===e||"string"===p||"number"===p||"object"===p&&e.$$typeof===i)return f(l,e,""===n?s+c(e,0):n),1;var d=0,y=""===n?s:n+a;if(Array.isArray(e))for(var w=0;w<e.length;w++)d+=t(h=e[w],y+c(h,w),f,l);else{var v=o(e);if(v){var g,M=v.call(e);if(v!==e.entries)for(var _=0;!(g=M.next()).done;)d+=t(h=g.value,y+c(h,_++),f,l);else for(;!(g=M.next()).done;){var m=g.value;m&&(d+=t(h=m[1],y+u.escape(m[0])+a+c(h,0),f,l))}}else if("object"===p){var L=String(e);r("31","[object Object]"===L?"object with keys {"+Object.keys(e).join(", ")+"}":L,"")}}return d}(t,"",e,n)}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";t.exports=function(t){var e=t&&(r&&t[r]||t[i]);if("function"==typeof e)return e}},function(t,e,n){"use strict";var r={escape:function(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,function(t){return e[t]})},unescape:function(t){var e={"=0":"=","=2":":"};return(""+("."===t[0]&&"$"===t[1]?t.substring(2):t.substring(1))).replace(/(=0|=2)/g,function(t){return e[t]})}};t.exports=r},function(t,e,n){"use strict";var r=n(32).createFactory,i={a:r("a"),abbr:r("abbr"),address:r("address"),area:r("area"),article:r("article"),aside:r("aside"),audio:r("audio"),b:r("b"),base:r("base"),bdi:r("bdi"),bdo:r("bdo"),big:r("big"),blockquote:r("blockquote"),body:r("body"),br:r("br"),button:r("button"),canvas:r("canvas"),caption:r("caption"),cite:r("cite"),code:r("code"),col:r("col"),colgroup:r("colgroup"),data:r("data"),datalist:r("datalist"),dd:r("dd"),del:r("del"),details:r("details"),dfn:r("dfn"),dialog:r("dialog"),div:r("div"),dl:r("dl"),dt:r("dt"),em:r("em"),embed:r("embed"),fieldset:r("fieldset"),figcaption:r("figcaption"),figure:r("figure"),footer:r("footer"),form:r("form"),h1:r("h1"),h2:r("h2"),h3:r("h3"),h4:r("h4"),h5:r("h5"),h6:r("h6"),head:r("head"),header:r("header"),hgroup:r("hgroup"),hr:r("hr"),html:r("html"),i:r("i"),iframe:r("iframe"),img:r("img"),input:r("input"),ins:r("ins"),kbd:r("kbd"),keygen:r("keygen"),label:r("label"),legend:r("legend"),li:r("li"),link:r("link"),main:r("main"),map:r("map"),mark:r("mark"),menu:r("menu"),menuitem:r("menuitem"),meta:r("meta"),meter:r("meter"),nav:r("nav"),noscript:r("noscript"),object:r("object"),ol:r("ol"),optgroup:r("optgroup"),option:r("option"),output:r("output"),p:r("p"),param:r("param"),picture:r("picture"),pre:r("pre"),progress:r("progress"),q:r("q"),rp:r("rp"),rt:r("rt"),ruby:r("ruby"),s:r("s"),samp:r("samp"),script:r("script"),section:r("section"),select:r("select"),small:r("small"),source:r("source"),span:r("span"),strong:r("strong"),style:r("style"),sub:r("sub"),summary:r("summary"),sup:r("sup"),table:r("table"),tbody:r("tbody"),td:r("td"),textarea:r("textarea"),tfoot:r("tfoot"),th:r("th"),thead:r("thead"),time:r("time"),title:r("title"),tr:r("tr"),track:r("track"),u:r("u"),ul:r("ul"),var:r("var"),video:r("video"),wbr:r("wbr"),circle:r("circle"),clipPath:r("clipPath"),defs:r("defs"),ellipse:r("ellipse"),g:r("g"),image:r("image"),line:r("line"),linearGradient:r("linearGradient"),mask:r("mask"),path:r("path"),pattern:r("pattern"),polygon:r("polygon"),polyline:r("polyline"),radialGradient:r("radialGradient"),rect:r("rect"),stop:r("stop"),svg:r("svg"),text:r("text"),tspan:r("tspan")};t.exports=i},function(t,e,n){"use strict";var r=n(32).isValidElement,i=n(227);t.exports=i(r)},function(t,e,n){"use strict";var r=n(228);t.exports=function(t){return r(t,!1)}},function(t,e,n){"use strict";var r=n(229),i=n(40),o=n(133),u=n(231),s=Function.call.bind(Object.prototype.hasOwnProperty),a=function(){};function c(){return null}t.exports=function(t,e){var n="function"==typeof Symbol&&Symbol.iterator,f="@@iterator";var l="<<anonymous>>",h={array:w("array"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:y(c),arrayOf:function(t){return y(function(e,n,r,i,u){if("function"!=typeof t)return new d("Property `"+u+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=e[n];if(!Array.isArray(s))return new d("Invalid "+i+" `"+u+"` of type `"+g(s)+"` supplied to `"+r+"`, expected an array.");for(var a=0;a<s.length;a++){var c=t(s,a,r,i,u+"["+a+"]",o);if(c instanceof Error)return c}return null})},element:y(function(e,n,r,i,o){var u=e[n];return t(u)?null:new d("Invalid "+i+" `"+o+"` of type `"+g(u)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:y(function(t,e,n,i,o){var u=t[e];return r.isValidElementType(u)?null:new d("Invalid "+i+" `"+o+"` of type `"+g(u)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(t){return y(function(e,n,r,i,o){if(!(e[n]instanceof t)){var u=t.name||l;return new d("Invalid "+i+" `"+o+"` of type `"+function(t){if(!t.constructor||!t.constructor.name)return l;return t.constructor.name}(e[n])+"` supplied to `"+r+"`, expected instance of `"+u+"`.")}return null})},node:y(function(t,e,n,r,i){return v(t[e])?null:new d("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(t){return y(function(e,n,r,i,u){if("function"!=typeof t)return new d("Property `"+u+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=e[n],c=g(a);if("object"!==c)return new d("Invalid "+i+" `"+u+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var f in a)if(s(a,f)){var l=t(a,f,r,i,u+"."+f,o);if(l instanceof Error)return l}return null})},oneOf:function(t){if(!Array.isArray(t))return c;return y(function(e,n,r,i,o){for(var u=e[n],s=0;s<t.length;s++)if(p(u,t[s]))return null;var a=JSON.stringify(t,function(t,e){return"symbol"===M(e)?String(e):e});return new d("Invalid "+i+" `"+o+"` of value `"+String(u)+"` supplied to `"+r+"`, expected one of "+a+".")})},oneOfType:function(t){if(!Array.isArray(t))return c;for(var e=0;e<t.length;e++){var n=t[e];if("function"!=typeof n)return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_(n)+" at index "+e+"."),c}return y(function(e,n,r,i,u){for(var s=0;s<t.length;s++){if(null==(0,t[s])(e,n,r,i,u,o))return null}return new d("Invalid "+i+" `"+u+"` supplied to `"+r+"`.")})},shape:function(t){return y(function(e,n,r,i,u){var s=e[n],a=g(s);if("object"!==a)return new d("Invalid "+i+" `"+u+"` of type `"+a+"` supplied to `"+r+"`, expected `object`.");for(var c in t){var f=t[c];if(f){var l=f(s,c,r,i,u+"."+c,o);if(l)return l}}return null})},exact:function(t){return y(function(e,n,r,u,s){var a=e[n],c=g(a);if("object"!==c)return new d("Invalid "+u+" `"+s+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var f=i({},e[n],t);for(var l in f){var h=t[l];if(!h)return new d("Invalid "+u+" `"+s+"` key `"+l+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(e[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var p=h(a,l,r,u,s+"."+l,o);if(p)return p}return null})}};function p(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function d(t){this.message=t,this.stack=""}function y(t){function n(n,r,i,u,s,a,c){if((u=u||l,a=a||i,c!==o)&&e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}return null==r[i]?n?null===r[i]?new d("The "+s+" `"+a+"` is marked as required in `"+u+"`, but its value is `null`."):new d("The "+s+" `"+a+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:t(r,i,u,s,a)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function w(t){return y(function(e,n,r,i,o,u){var s=e[n];return g(s)!==t?new d("Invalid "+i+" `"+o+"` of type `"+M(s)+"` supplied to `"+r+"`, expected `"+t+"`."):null})}function v(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(v);if(null===e||t(e))return!0;var r=function(t){var e=t&&(n&&t[n]||t[f]);if("function"==typeof e)return e}(e);if(!r)return!1;var i,o=r.call(e);if(r!==e.entries){for(;!(i=o.next()).done;)if(!v(i.value))return!1}else for(;!(i=o.next()).done;){var u=i.value;if(u&&!v(u[1]))return!1}return!0;default:return!1}}function g(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":function(t,e){return"symbol"===t||!!e&&("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)}(e,t)?"symbol":e}function M(t){if(null==t)return""+t;var e=g(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function _(t){var e=M(t);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}return d.prototype=Error.prototype,h.checkPropTypes=u,h.resetWarningCache=u.resetWarningCache,h.PropTypes=h,h}},function(t,e,n){"use strict";t.exports=n(230)},function(t,e,n){"use strict"; +/** @license React v16.8.6 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,u=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,f=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.memo"):60115,w=r?Symbol.for("react.lazy"):60116;function v(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case i:switch(t=t.type){case l:case h:case u:case a:case s:case d:return t;default:switch(t=t&&t.$$typeof){case f:case p:case c:return t;default:return e}}case w:case y:case o:return e}}}function g(t){return v(t)===h}e.typeOf=v,e.AsyncMode=l,e.ConcurrentMode=h,e.ContextConsumer=f,e.ContextProvider=c,e.Element=i,e.ForwardRef=p,e.Fragment=u,e.Lazy=w,e.Memo=y,e.Portal=o,e.Profiler=a,e.StrictMode=s,e.Suspense=d,e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===u||t===h||t===a||t===s||t===d||"object"==typeof t&&null!==t&&(t.$$typeof===w||t.$$typeof===y||t.$$typeof===c||t.$$typeof===f||t.$$typeof===p)},e.isAsyncMode=function(t){return g(t)||v(t)===l},e.isConcurrentMode=g,e.isContextConsumer=function(t){return v(t)===f},e.isContextProvider=function(t){return v(t)===c},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===i},e.isForwardRef=function(t){return v(t)===p},e.isFragment=function(t){return v(t)===u},e.isLazy=function(t){return v(t)===w},e.isMemo=function(t){return v(t)===y},e.isPortal=function(t){return v(t)===o},e.isProfiler=function(t){return v(t)===a},e.isStrictMode=function(t){return v(t)===s},e.isSuspense=function(t){return v(t)===d}},function(t,e,n){"use strict";function r(t,e,n,r,i){}r.resetWarningCache=function(){0},t.exports=r},function(t,e,n){"use strict";t.exports="15.6.2"},function(t,e,n){"use strict";var r=n(126).Component,i=n(32).isValidElement,o=n(127),u=n(234);t.exports=u(r,i,o)},function(t,e,n){"use strict";var r=n(40),i=n(130),o=n(41),u="mixins";t.exports=function(t,e,n){var s=[],a={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},c={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},f={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)h(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=r({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=r({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=d(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=r({},t.propTypes,e)},statics:function(t,e){!function(t,e){if(!e)return;for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){if(o(!(n in f),'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n),n in t){var i=c.hasOwnProperty(n)?c[n]:null;return o("DEFINE_MANY_MERGED"===i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),void(t[n]=d(t[n],r))}t[n]=r}}}(t,e)},autobind:function(){}};function l(t,e){var n=a.hasOwnProperty(e)?a[e]:null;M.hasOwnProperty(e)&&o("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&o("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function h(t,n){if(n){o("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),o(!e(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=t.prototype,i=r.__reactAutoBindPairs;for(var s in n.hasOwnProperty(u)&&f.mixins(t,n.mixins),n)if(n.hasOwnProperty(s)&&s!==u){var c=n[s],h=r.hasOwnProperty(s);if(l(h,s),f.hasOwnProperty(s))f[s](t,c);else{var p=a.hasOwnProperty(s);if("function"==typeof c&&!p&&!h&&!1!==n.autobind)i.push(s,c),r[s]=c;else if(h){var w=a[s];o(p&&("DEFINE_MANY_MERGED"===w||"DEFINE_MANY"===w),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",w,s),"DEFINE_MANY_MERGED"===w?r[s]=d(r[s],c):"DEFINE_MANY"===w&&(r[s]=y(r[s],c))}else r[s]=c}}}else;}function p(t,e){for(var n in o(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."),e)e.hasOwnProperty(n)&&(o(void 0===t[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),t[n]=e[n]);return t}function d(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var i={};return p(i,n),p(i,r),i}}function y(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function w(t,e){return e.bind(t)}var v={componentDidMount:function(){this.__isMounted=!0}},g={componentWillUnmount:function(){this.__isMounted=!1}},M={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e)},isMounted:function(){return!!this.__isMounted}},_=function(){};return r(_.prototype,t.prototype,M),function(t){var e=function(t,r,u){this.__reactAutoBindPairs.length&&function(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t[r]=w(t,i)}}(this),this.props=t,this.context=r,this.refs=i,this.updater=u||n,this.state=null;var s=this.getInitialState?this.getInitialState():null;o("object"==typeof s&&!Array.isArray(s),"%s.getInitialState(): must return an object or null",e.displayName||"ReactCompositeComponent"),this.state=s};for(var r in e.prototype=new _,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],s.forEach(h.bind(null,e)),h(e,v),h(e,t),h(e,g),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),o(e.prototype.render,"createClass(...): Class specification must implement a `render` method."),a)e.prototype[r]||(e.prototype[r]=null);return e}}},function(t,e,n){"use strict";var r=n(56),i=n(32);n(41);t.exports=function(t){return i.isValidElement(t)||r("143"),t}},function(t,e,n){"use strict";var r=n(133);function i(){}function o(){}o.resetWarningCache=i,t.exports=function(){function t(t,e,n,i,o,u){if(u!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){for(var e,n=c(t),r=n[0],u=n[1],s=new o(function(t,e,n){return 3*(e+n)/4-n}(0,r,u)),a=0,f=u>0?r-4:r,l=0;l<f;l+=4)e=i[t.charCodeAt(l)]<<18|i[t.charCodeAt(l+1)]<<12|i[t.charCodeAt(l+2)]<<6|i[t.charCodeAt(l+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;2===u&&(e=i[t.charCodeAt(l)]<<2|i[t.charCodeAt(l+1)]>>4,s[a++]=255&e);1===u&&(e=i[t.charCodeAt(l)]<<10|i[t.charCodeAt(l+1)]<<4|i[t.charCodeAt(l+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e);return s},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],u=0,s=n-i;u<s;u+=16383)o.push(f(t,u,u+16383>s?s:u+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=u.length;s<a;++s)r[s]=u[s],i[u.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function f(t,e,n){for(var i,o,u=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),u.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return u.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,u,s=8*i-r-1,a=(1<<s)-1,c=a>>1,f=-7,l=n?i-1:0,h=n?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=h,f-=8);for(u=o&(1<<-f)-1,o>>=-f,f+=r;f>0;u=256*u+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===a)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,r),o-=c}return(p?-1:1)*u*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var u,s,a,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,u=f):(u=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-u))<1&&(u--,a*=2),(e+=u+l>=1?h/a:h*Math.pow(2,1-l))*a>=2&&(u++,a/=2),u+l>=f?(s=0,u=f):u+l>=1?(s=(e*a-1)*Math.pow(2,i),u+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),u=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(u=u<<i|s,c+=i;c>0;t[n+p]=255&u,p+=d,u/=256,c-=8);t[n+p-d]|=128*y}},function(t,e,n){var r=n(4),i=r.JSON||(r.JSON={stringify:JSON.stringify});t.exports=function(t){return i.stringify.apply(i,arguments)}},function(t,e,n){var r=n(2);t.exports=function(t){if(r(t))return t}},function(t,e,n){n(242),t.exports=n(4).Array.isArray},function(t,e,n){var r=n(15);r(r.S,"Array",{isArray:n(121)})},function(t,e,n){var r=n(103);t.exports=function(t,e){var n=[],i=!0,o=!1,u=void 0;try{for(var s,a=r(t);!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,u=t}finally{try{i||null==a.return||a.return()}finally{if(o)throw u}}return n}},function(t,e,n){n(120),n(114),t.exports=n(245)},function(t,e,n){var r=n(28),i=n(246);t.exports=n(4).getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return r(e.call(t))}},function(t,e,n){var r=n(247),i=n(17)("iterator"),o=n(52);t.exports=n(4).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(80),i=n(17)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(u=r(e))&&"function"==typeof e.callee?"Arguments":u}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,n){n(250),t.exports=n(4).Object.assign},function(t,e,n){var r=n(15);r(r.S+r.F,"Object",{assign:n(251)})},function(t,e,n){"use strict";var r=n(39),i=n(87),o=n(55),u=n(54),s=n(118),a=Object.assign;t.exports=!a||n(30)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=a({},t)[n]||Object.keys(a({},e)).join("")!=r})?function(t,e){for(var n=u(t),a=arguments.length,c=1,f=i.f,l=o.f;a>c;)for(var h,p=s(arguments[c++]),d=f?r(p).concat(f(p)):r(p),y=d.length,w=0;y>w;)l.call(p,h=d[w++])&&(n[h]=p[h]);return n}:a},function(t,e,n){n(253),t.exports=n(4).Object.keys},function(t,e,n){var r=n(54),i=n(39);n(124)("keys",function(){return function(t){return i(r(t))}})},function(t,e,n){var r=n(42),i=n(104);t.exports=function(t){return i(r(t).toLowerCase())}},function(t,e,n){var r=n(58),i=n(256),o=n(12),u=n(59),s=1/0,a=r?r.prototype:void 0,c=a?a.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(u(e))return c?c.call(e):"";var n=e+"";return"0"==n&&1/e==-s?"-0":n}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},function(t,e,n){var r=n(58),i=Object.prototype,o=i.hasOwnProperty,u=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=u.call(t);return r&&(e?t[s]=n:delete t[s]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r=n(260),i=n(137),o=n(262),u=n(42);t.exports=function(t){return function(e){e=u(e);var n=i(e)?o(e):void 0,s=n?n[0]:e.charAt(0),a=n?r(n,1).join(""):e.slice(1);return s[t]()+a}}},function(t,e,n){var r=n(261);t.exports=function(t,e,n){var i=t.length;return n=void 0===n?i:n,!e&&n>=i?t:r(t,e,n)}},function(t,e){t.exports=function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}},function(t,e,n){var r=n(263),i=n(137),o=n(264);t.exports=function(t){return i(t)?o(t):r(t)}},function(t,e){t.exports=function(t){return t.split("")}},function(t,e){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+r+"|"+i+")"+"?",c="[\\ufe0e\\ufe0f]?"+a+("(?:\\u200d(?:"+[o,u,s].join("|")+")[\\ufe0e\\ufe0f]?"+a+")*"),f="(?:"+[o+r+"?",r,u,s,n].join("|")+")",l=RegExp(i+"(?="+i+")|"+f+c,"g");t.exports=function(t){return t.match(l)||[]}},function(t,e,n){var r=n(266),i=n(267),o=n(270),u=RegExp("['’]","g");t.exports=function(t){return function(e){return r(o(i(e).replace(u,"")),t,"")}}},function(t,e){t.exports=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}},function(t,e,n){var r=n(268),i=n(42),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,u=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");t.exports=function(t){return(t=i(t))&&t.replace(o,r).replace(u,"")}},function(t,e,n){var r=n(269)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});t.exports=r},function(t,e){t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},function(t,e,n){var r=n(271),i=n(272),o=n(42),u=n(273);t.exports=function(t,e,n){return t=o(t),void 0===(e=n?void 0:e)?i(t)?u(t):r(t):t.match(e)||[]}},function(t,e){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;t.exports=function(t){return t.match(n)||[]}},function(t,e){var n=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;t.exports=function(t){return n.test(t)}},function(t,e){var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",r="["+n+"]",i="\\d+",o="[\\u2700-\\u27bf]",u="[a-z\\xdf-\\xf6\\xf8-\\xff]",s="[^\\ud800-\\udfff"+n+i+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]",f="[A-Z\\xc0-\\xd6\\xd8-\\xde]",l="(?:"+u+"|"+s+")",h="(?:"+f+"|"+s+")",p="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",d="[\\ufe0e\\ufe0f]?"+p+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",a,c].join("|")+")[\\ufe0e\\ufe0f]?"+p+")*"),y="(?:"+[o,a,c].join("|")+")"+d,w=RegExp([f+"?"+u+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[r,f,"$"].join("|")+")",h+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[r,f+l,"$"].join("|")+")",f+"?"+l+"+(?:['’](?:d|ll|m|re|s|t|ve))?",f+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",i,y].join("|"),"g");t.exports=function(t){return t.match(w)||[]}},function(t,e,n){var r=n(275),i=n(61),o=n(90);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(276),i=n(281),o=n(282),u=n(283),s=n(284);function a(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=u,a.prototype.set=s,t.exports=a},function(t,e,n){var r=n(60);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e,n){var r=n(138),i=n(278),o=n(45),u=n(139),s=/^\[object .+?Constructor\]$/,a=Function.prototype,c=Object.prototype,f=a.toString,l=c.hasOwnProperty,h=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?h:s).test(u(t))}},function(t,e,n){var r,i=n(279),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},function(t,e,n){var r=n(11)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(60),i="__lodash_hash_undefined__",o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return n===i?void 0:n}return o.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(60),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},function(t,e,n){var r=n(60),i="__lodash_hash_undefined__";t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?i:e,this}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(62),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(62);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(62);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(62);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(63);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(63);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(63);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(63);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},function(t,e,n){var r=n(91),i=n(65),o=n(64);t.exports=function(t){return function(e,n,u){var s=Object(e);if(!i(e)){var a=r(n,3);e=o(e),n=function(t){return a(s[t],t,s)}}var c=t(e,n,u);return c>-1?s[a?e[c]:c]:void 0}}},function(t,e,n){var r=n(297),i=n(335),o=n(149);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(140),i=n(141),o=1,u=2;t.exports=function(t,e,n,s){var a=n.length,c=a,f=!s;if(null==t)return!c;for(t=Object(t);a--;){var l=n[a];if(f&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++a<c;){var h=(l=n[a])[0],p=t[h],d=l[1];if(f&&l[2]){if(void 0===p&&!(h in t))return!1}else{var y=new r;if(s)var w=s(p,d,h,t,e,y);if(!(void 0===w?i(d,p,o|u,s,y):w))return!1}}return!0}},function(t,e,n){var r=n(61);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(61),i=n(90),o=n(89),u=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<u-1)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(140),i=n(142),o=n(308),u=n(312),s=n(330),a=n(12),c=n(145),f=n(147),l=1,h="[object Arguments]",p="[object Array]",d="[object Object]",y=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,w,v,g){var M=a(t),_=a(e),m=M?p:s(t),L=_?p:s(e),b=(m=m==h?d:m)==d,j=(L=L==h?d:L)==d,x=m==L;if(x&&c(t)){if(!c(e))return!1;M=!0,b=!1}if(x&&!b)return g||(g=new r),M||f(t)?i(t,e,n,w,v,g):o(t,e,m,n,w,v,g);if(!(n&l)){var N=b&&y.call(t,"__wrapped__"),S=j&&y.call(e,"__wrapped__");if(N||S){var D=N?t.value():t,I=S?e.value():e;return g||(g=new r),v(D,I,n,w,g)}}return!!x&&(g||(g=new r),u(t,e,n,w,v,g))}},function(t,e,n){var r=n(89),i=n(305),o=n(306);function u(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}u.prototype.add=u.prototype.push=i,u.prototype.has=o,t.exports=u},function(t,e){var n="__lodash_hash_undefined__";t.exports=function(t){return this.__data__.set(t,n),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(58),i=n(309),o=n(38),u=n(142),s=n(310),a=n(311),c=1,f=2,l="[object Boolean]",h="[object Date]",p="[object Error]",d="[object Map]",y="[object Number]",w="[object RegExp]",v="[object Set]",g="[object String]",M="[object Symbol]",_="[object ArrayBuffer]",m="[object DataView]",L=r?r.prototype:void 0,b=L?L.valueOf:void 0;t.exports=function(t,e,n,r,L,j,x){switch(n){case m:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case _:return!(t.byteLength!=e.byteLength||!j(new i(t),new i(e)));case l:case h:case y:return o(+t,+e);case p:return t.name==e.name&&t.message==e.message;case w:case g:return t==e+"";case d:var N=s;case v:var S=r&c;if(N||(N=a),t.size!=e.size&&!S)return!1;var D=x.get(t);if(D)return D==e;r|=f,x.set(t,e);var I=u(N(t),N(e),r,L,j,x);return x.delete(t),I;case M:if(b)return b.call(t)==b.call(e)}return!1}},function(t,e,n){var r=n(11).Uint8Array;t.exports=r},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}},function(t,e,n){var r=n(313),i=1,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,u,s,a){var c=n&i,f=r(t),l=f.length;if(l!=r(e).length&&!c)return!1;for(var h=l;h--;){var p=f[h];if(!(c?p in e:o.call(e,p)))return!1}var d=a.get(t);if(d&&a.get(e))return d==e;var y=!0;a.set(t,e),a.set(e,t);for(var w=c;++h<l;){var v=t[p=f[h]],g=e[p];if(u)var M=c?u(g,v,p,e,t,a):u(v,g,p,t,e,a);if(!(void 0===M?v===g||s(v,g,n,u,a):M)){y=!1;break}w||(w="constructor"==p)}if(y&&!w){var _=t.constructor,m=e.constructor;_!=m&&"constructor"in t&&"constructor"in e&&!("function"==typeof _&&_ instanceof _&&"function"==typeof m&&m instanceof m)&&(y=!1)}return a.delete(t),a.delete(e),y}},function(t,e,n){var r=n(314),i=n(316),o=n(64);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(315),i=n(12);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},function(t,e,n){var r=n(317),i=n(318),o=Object.prototype.propertyIsEnumerable,u=Object.getOwnPropertySymbols,s=u?function(t){return null==t?[]:(t=Object(t),r(u(t),function(e){return o.call(t,e)}))}:i;t.exports=s},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var u=t[n];e(u,n,t)&&(o[i++]=u)}return o}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(320),i=n(144),o=n(12),u=n(145),s=n(92),a=n(147),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),f=!n&&i(t),l=!n&&!f&&u(t),h=!n&&!f&&!l&&a(t),p=n||f||l||h,d=p?r(t.length,String):[],y=d.length;for(var w in t)!e&&!c.call(t,w)||p&&("length"==w||l&&("offset"==w||"parent"==w)||h&&("buffer"==w||"byteLength"==w||"byteOffset"==w)||s(w,y))||d.push(w);return d}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(43),i=n(44),o="[object Arguments]";t.exports=function(t){return i(t)&&r(t)==o}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(43),i=n(93),o=n(44),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!u[r(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){(function(t){var r=n(136),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,u=o&&o.exports===i&&r.process,s=function(){try{var t=o&&o.require&&o.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}();t.exports=s}).call(this,n(146)(t))},function(t,e,n){var r=n(327),i=n(328),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(329)(Object.keys,Object);t.exports=r},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(331),i=n(90),o=n(332),u=n(333),s=n(334),a=n(43),c=n(139),f=c(r),l=c(i),h=c(o),p=c(u),d=c(s),y=a;(r&&"[object DataView]"!=y(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=y(new i)||o&&"[object Promise]"!=y(o.resolve())||u&&"[object Set]"!=y(new u)||s&&"[object WeakMap]"!=y(new s))&&(y=function(t){var e=a(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case f:return"[object DataView]";case l:return"[object Map]";case h:return"[object Promise]";case p:return"[object Set]";case d:return"[object WeakMap]"}return e}),t.exports=y},function(t,e,n){var r=n(33)(n(11),"DataView");t.exports=r},function(t,e,n){var r=n(33)(n(11),"Promise");t.exports=r},function(t,e,n){var r=n(33)(n(11),"Set");t.exports=r},function(t,e,n){var r=n(33)(n(11),"WeakMap");t.exports=r},function(t,e,n){var r=n(148),i=n(64);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],u=t[o];e[n]=[o,u,r(u)]}return e}},function(t,e,n){var r=n(141),i=n(337),o=n(340),u=n(94),s=n(148),a=n(149),c=n(66),f=1,l=2;t.exports=function(t,e){return u(t)&&s(e)?a(c(t),e):function(n){var u=i(n,t);return void 0===u&&u===e?o(n,t):r(e,u,f|l)}}},function(t,e,n){var r=n(150);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},function(t,e,n){var r=n(339),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,u=r(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)}),e});t.exports=u},function(t,e,n){var r=n(105),i=500;t.exports=function(t){var e=r(t,function(t){return n.size===i&&n.clear(),t}),n=e.cache;return e}},function(t,e,n){var r=n(341),i=n(342);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(151),i=n(144),o=n(12),u=n(92),s=n(93),a=n(66);t.exports=function(t,e,n){for(var c=-1,f=(e=r(e,t)).length,l=!1;++c<f;){var h=a(e[c]);if(!(l=null!=t&&n(t,h)))break;t=t[h]}return l||++c!=f?l:!!(f=null==t?0:t.length)&&s(f)&&u(h,f)&&(o(t)||i(t))}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(345),i=n(346),o=n(94),u=n(66);t.exports=function(t){return o(t)?r(u(t)):i(t)}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(150);t.exports=function(t){return function(e){return r(e,t)}}},function(t,e,n){var r=n(348),i=n(91),o=n(349),u=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var a=null==n?0:o(n);return a<0&&(a=u(s+a,0)),r(t,i(e,3),a)}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},function(t,e,n){var r=n(350);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(351),i=1/0,o=17976931348623157e292;t.exports=function(t){return t?(t=r(t))===i||t===-i?(t<0?-1:1)*o:t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(45),i=n(59),o=NaN,u=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return o;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(u,"");var n=a.test(t);return n||c.test(t)?f(t.slice(2),n?2:8):s.test(t)?o:+t}},function(t,e,n){var r=n(353);t.exports=function(t,e){var n;return r(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}},function(t,e,n){var r=n(354),i=n(357)(r);t.exports=i},function(t,e,n){var r=n(355),i=n(64);t.exports=function(t,e){return t&&r(t,e,i)}},function(t,e,n){var r=n(356)();t.exports=r},function(t,e){t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),u=r(e),s=u.length;s--;){var a=u[t?s:++i];if(!1===n(o[a],a,o))break}return e}}},function(t,e,n){var r=n(65);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,u=e?o:-1,s=Object(n);(e?u--:++u<o)&&!1!==i(s[u],u,s););return n}}},function(t,e,n){var r=n(38),i=n(65),o=n(92),u=n(45);t.exports=function(t,e,n){if(!u(n))return!1;var s=typeof e;return!!("number"==s?i(n)&&o(e,n.length):"string"==s&&e in n)&&r(n[e],t)}},function(t,e){var n={"&":"&",'"':""","'":"'","<":"<",">":">"};t.exports=function(t){return t&&t.replace?t.replace(/([&"<>'])/g,function(t,e){return n[e]}):t}},function(t,e,n){t.exports=i;var r=n(95).EventEmitter;function i(){r.call(this)}n(7)(i,r),i.Readable=n(96),i.Writable=n(367),i.Duplex=n(368),i.Transform=n(369),i.PassThrough=n(370),i.Stream=i,i.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(n.on("end",s),n.on("close",a));var u=!1;function s(){u||(u=!0,t.end())}function a(){u||(u=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(f(),0===r.listenerCount(this,"error"))throw t}function f(){n.removeListener("data",i),t.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",a),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",f),n.removeListener("close",f),t.removeListener("close",f)}return n.on("error",c),t.on("error",c),n.on("end",f),n.on("close",f),t.on("close",f),t.emit("pipe",n),t}},function(t,e){},function(t,e,n){"use strict";var r=n(8).Buffer,i=n(363);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e,n,i,o=r.allocUnsafe(t>>>0),u=this.head,s=0;u;)e=u.data,n=o,i=s,e.copy(n,i),s+=u.data.length,u=u.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,u,s,a=1,c={},f=!1,l=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){d(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},r=function(t){o.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,r=function(t){var e=l.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(d,0,t)}:(u="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(u)&&d(+e.data.slice(u.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(u+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var i={callback:t,args:e};return c[a]=i,r(a),a++},h.clearImmediate=p}function p(t){delete c[t]}function d(t){if(f)setTimeout(d,0,t);else{var e=c[t];if(e){f=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}(e)}finally{p(t),f=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(10),n(22))},function(t,e,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}}).call(this,n(10))},function(t,e,n){"use strict";t.exports=o;var r=n(157),i=n(46);function o(t){if(!(this instanceof o))return new o(t);r.call(this,t)}i.inherits=n(7),i.inherits(o,r),o.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){t.exports=n(97)},function(t,e,n){t.exports=n(23)},function(t,e,n){t.exports=n(96).Transform},function(t,e,n){t.exports=n(96).PassThrough},function(t,e,n){"use strict";var r=n(372),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?r(t)*o(i(t)):t}},function(t,e,n){"use strict";t.exports=n(373)()?Math.sign:n(374)},function(t,e,n){"use strict";t.exports=function(){var t=Math.sign;return"function"==typeof t&&(1===t(10)&&-1===t(-20))}},function(t,e,n){"use strict";t.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},function(t,e,n){"use strict";var r=n(18),i=n(68),o=n(26),u=n(377),s=n(160);t.exports=function t(e){var n,a,c;if(r(e),(n=Object(arguments[1])).async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(e,"__memoized__")&&!n.force?e:(a=s(n.length,e.length,n.async&&o.async),c=u(e,a,n),i(o,function(t,e){n[e]&&t(n[e],c,n)}),t.__profiler__&&t.__profiler__(c),c.updateEnv(),c.memoized)}},function(t,e,n){"use strict";var r=n(18),i=n(34),o=Function.prototype.bind,u=Function.prototype.call,s=Object.keys,a=Object.prototype.propertyIsEnumerable;t.exports=function(t,e){return function(n,c){var f,l=arguments[2],h=arguments[3];return n=Object(i(n)),r(c),f=s(n),h&&f.sort("function"==typeof h?o.call(h,n):void 0),"function"!=typeof t&&(t=f[t]),u.call(t,f,function(t,r){return a.call(n,t)?u.call(c,l,n[t],t,n,r):e})}}},function(t,e,n){"use strict";var r=n(378),i=n(162),o=n(69),u=n(388).methods,s=n(389),a=n(401),c=Function.prototype.apply,f=Function.prototype.call,l=Object.create,h=Object.defineProperties,p=u.on,d=u.emit;t.exports=function(t,e,n){var u,y,w,v,g,M,_,m,L,b,j,x,N,S,D,I=l(null);return y=!1!==e?e:isNaN(t.length)?1:t.length,n.normalizer&&(b=a(n.normalizer),w=b.get,v=b.set,g=b.delete,M=b.clear),null!=n.resolvers&&(D=s(n.resolvers)),S=w?i(function(e){var n,i,o=arguments;if(D&&(o=D(o)),null!==(n=w(o))&&hasOwnProperty.call(I,n))return j&&u.emit("get",n,o,this),I[n];if(i=1===o.length?f.call(t,this,o[0]):c.call(t,this,o),null===n){if(null!==(n=w(o)))throw r("Circular invocation","CIRCULAR_INVOCATION");n=v(o)}else if(hasOwnProperty.call(I,n))throw r("Circular invocation","CIRCULAR_INVOCATION");return I[n]=i,x&&u.emit("set",n,null,i),i},y):0===e?function(){var e;if(hasOwnProperty.call(I,"data"))return j&&u.emit("get","data",arguments,this),I.data;if(e=arguments.length?c.call(t,this,arguments):f.call(t,this),hasOwnProperty.call(I,"data"))throw r("Circular invocation","CIRCULAR_INVOCATION");return I.data=e,x&&u.emit("set","data",null,e),e}:function(e){var n,i,o=arguments;if(D&&(o=D(arguments)),i=String(o[0]),hasOwnProperty.call(I,i))return j&&u.emit("get",i,o,this),I[i];if(n=1===o.length?f.call(t,this,o[0]):c.call(t,this,o),hasOwnProperty.call(I,i))throw r("Circular invocation","CIRCULAR_INVOCATION");return I[i]=n,x&&u.emit("set",i,null,n),n},u={original:t,memoized:S,profileName:n.profileName,get:function(t){return D&&(t=D(t)),w?w(t):String(t[0])},has:function(t){return hasOwnProperty.call(I,t)},delete:function(t){var e;hasOwnProperty.call(I,t)&&(g&&g(t),e=I[t],delete I[t],N&&u.emit("delete",t,e))},clear:function(){var t=I;M&&M(),I=l(null),u.emit("clear",t)},on:function(t,e){return"get"===t?j=!0:"set"===t?x=!0:"delete"===t&&(N=!0),p.call(this,t,e)},emit:d,updateEnv:function(){t=u.original}},_=w?i(function(t){var e,n=arguments;D&&(n=D(n)),null!==(e=w(n))&&u.delete(e)},y):0===e?function(){return u.delete("data")}:function(t){return D&&(t=D(arguments)[0]),u.delete(t)},m=i(function(){var t,n=arguments;return 0===e?I.data:(D&&(n=D(n)),t=w?w(n):String(n[0]),I[t])}),L=i(function(){var t,n=arguments;return 0===e?u.has("data"):(D&&(n=D(n)),null!==(t=w?w(n):String(n[0]))&&u.has(t))}),h(S,{__memoized__:o(!0),delete:o(_),clear:o(u.clear),_get:o(m),_has:o(L)}),u}},function(t,e,n){"use strict";var r=n(161),i=n(384),o=n(24),u=Error.captureStackTrace;e=t.exports=function(t){var n=new Error(t),s=arguments[1],a=arguments[2];return o(a)||i(s)&&(a=s,s=null),o(a)&&r(n,a),o(s)&&(n.code=s),u&&u(n,e),n}},function(t,e,n){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";var r=n(381),i=n(34),o=Math.max;t.exports=function(t,e){var n,u,s,a=o(arguments.length,2);for(t=Object(i(t)),s=function(r){try{t[r]=e[r]}catch(t){n||(n=t)}},u=1;u<a;++u)e=arguments[u],r(e).forEach(s);if(void 0!==n)throw n;return t}},function(t,e,n){"use strict";t.exports=n(382)()?Object.keys:n(383)},function(t,e,n){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,n){"use strict";var r=n(24),i=Object.keys;t.exports=function(t){return i(r(t)?Object(t):t)}},function(t,e,n){"use strict";var r=n(24),i={function:!0,object:!0};t.exports=function(t){return r(t)&&i[typeof t]||!1}},function(t,e,n){"use strict";t.exports=n(386)()?String.prototype.contains:n(387)},function(t,e,n){"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(t,e,n){"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},function(t,e,n){"use strict";var r,i,o,u,s,a,c,f=n(69),l=n(18),h=Function.prototype.apply,p=Function.prototype.call,d=Object.create,y=Object.defineProperty,w=Object.defineProperties,v=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};i=function(t,e){var n,i;return l(e),i=this,r.call(this,t,n=function(){o.call(i,t,n),h.call(e,this,arguments)}),n.__eeOnceListener__=e,this},s={on:r=function(t,e){var n;return l(e),v.call(this,"__ee__")?n=this.__ee__:(n=g.value=d(null),y(this,"__ee__",g),g.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:i,off:o=function(t,e){var n,r,i,o;if(l(e),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:u=function(t){var e,n,r,i,o;if(v.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;r=i[e];++e)h.call(r,this,o)}else switch(arguments.length){case 1:p.call(i,this);break;case 2:p.call(i,this,arguments[1]);break;case 3:p.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];h.call(i,this,o)}}},a={on:f(r),once:f(i),off:f(o),emit:f(u)},c=w({},a),t.exports=e=function(t){return null==t?d(c):w(Object(t),a)},e.methods=s},function(t,e,n){"use strict";var r,i=n(390),o=n(24),u=n(18),s=Array.prototype.slice;r=function(t){return this.map(function(e,n){return e?e(t[n]):t[n]}).concat(s.call(t,this.length))},t.exports=function(t){return(t=i(t)).forEach(function(t){o(t)&&u(t)}),r.bind(t)}},function(t,e,n){"use strict";var r=n(99),i=Array.isArray;t.exports=function(t){return i(t)?t:r(t)}},function(t,e,n){"use strict";t.exports=function(){var t,e,n=Array.from;return"function"==typeof n&&(e=n(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},function(t,e,n){"use strict";var r=n(393).iterator,i=n(398),o=n(399),u=n(25),s=n(18),a=n(34),c=n(24),f=n(400),l=Array.isArray,h=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;t.exports=function(t){var e,n,y,w,v,g,M,_,m,L,b=arguments[1],j=arguments[2];if(t=Object(a(t)),c(b)&&s(b),this&&this!==Array&&o(this))e=this;else{if(!b){if(i(t))return 1!==(v=t.length)?Array.apply(null,t):((w=new Array(1))[0]=t[0],w);if(l(t)){for(w=new Array(v=t.length),n=0;n<v;++n)w[n]=t[n];return w}}w=[]}if(!l(t))if(void 0!==(m=t[r])){for(M=s(m).call(t),e&&(w=new e),_=M.next(),n=0;!_.done;)L=b?h.call(b,j,_.value,n):_.value,e?(p.value=L,d(w,n,p)):w[n]=L,_=M.next(),++n;v=n}else if(f(t)){for(v=t.length,e&&(w=new e),n=0,y=0;n<v;++n)L=t[n],n+1<v&&(g=L.charCodeAt(0))>=55296&&g<=56319&&(L+=t[++n]),L=b?h.call(b,j,L,y):L,e?(p.value=L,d(w,y,p)):w[y]=L,++y;v=y}if(void 0===v)for(v=u(t.length),e&&(w=new e(v)),n=0;n<v;++n)L=b?h.call(b,j,t[n],n):t[n],e?(p.value=L,d(w,n,p)):w[n]=L;return e&&(p.value=null,w.length=v),w}},function(t,e,n){"use strict";t.exports=n(394)()?Symbol:n(395)},function(t,e,n){"use strict";var r={object:!0,symbol:!0};t.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!r[typeof Symbol.iterator]&&(!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag])}},function(t,e,n){"use strict";var r,i,o,u,s=n(69),a=n(396),c=Object.create,f=Object.defineProperties,l=Object.defineProperty,h=Object.prototype,p=c(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),u=!0}catch(t){}}var d,y=(d=c(null),function(t){for(var e,n,r=0;d[t+(r||"")];)++r;return d[t+=r||""]=!0,l(h,e="@@"+t,s.gs(null,function(t){n||(n=!0,l(this,e,s(t)),n=!1)})),e});o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(t)},t.exports=i=function t(e){var n;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return u?r(e):(n=c(o.prototype),e=void 0===e?"":String(e),f(n,{__description__:s("",e),__name__:s("",y(e))}))},f(i,{for:s(function(t){return p[t]?p[t]:p[t]=i(String(t))}),keyFor:s(function(t){var e;for(e in a(t),p)if(p[e]===t)return e}),hasInstance:s("",r&&r.hasInstance||i("hasInstance")),isConcatSpreadable:s("",r&&r.isConcatSpreadable||i("isConcatSpreadable")),iterator:s("",r&&r.iterator||i("iterator")),match:s("",r&&r.match||i("match")),replace:s("",r&&r.replace||i("replace")),search:s("",r&&r.search||i("search")),species:s("",r&&r.species||i("species")),split:s("",r&&r.split||i("split")),toPrimitive:s("",r&&r.toPrimitive||i("toPrimitive")),toStringTag:s("",r&&r.toStringTag||i("toStringTag")),unscopables:s("",r&&r.unscopables||i("unscopables"))}),f(o.prototype,{constructor:s(i),toString:s("",function(){return this.__name__})}),f(i.prototype,{toString:s(function(){return"Symbol ("+a(this).__description__+")"}),valueOf:s(function(){return a(this)})}),l(i.prototype,i.toPrimitive,s("",function(){var t=a(this);return"symbol"==typeof t?t:t.toString()})),l(i.prototype,i.toStringTag,s("c","Symbol")),l(o.prototype,i.toStringTag,s("c",i.prototype[i.toStringTag])),l(o.prototype,i.toPrimitive,s("c",i.prototype[i.toPrimitive]))},function(t,e,n){"use strict";var r=n(397);t.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,n){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());t.exports=function(t){return r.call(t)===i}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call(n(159));t.exports=function(t){return"function"==typeof t&&r.call(t)===i}},function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||r.call(t)===i)||!1}},function(t,e,n){"use strict";var r=n(18);t.exports=function(t){var e;return"function"==typeof t?{set:t,get:t}:(e={get:r(t.get)},void 0!==t.set?(e.set=r(t.set),t.delete&&(e.delete=r(t.delete)),t.clear&&(e.clear=r(t.clear)),e):(e.set=e.get,e))}},function(t,e,n){"use strict";t.exports=function(t){var e,n,r=t.length;if(!r)return"";for(e=String(t[n=0]);--r;)e+=""+t[++n];return e}},function(t,e,n){"use strict";t.exports=function(t){return t?function(e){for(var n=String(e[0]),r=0,i=t;--i;)n+=""+e[++r];return n}:function(){return""}}},function(t,e,n){"use strict";var r=n(100),i=Object.create;t.exports=function(){var t=0,e=[],n=i(null);return{get:function(t){var n,i=0,o=e,u=t.length;if(0===u)return o[u]||null;if(o=o[u]){for(;i<u-1;){if(-1===(n=r.call(o[0],t[i])))return null;o=o[1][n],++i}return-1===(n=r.call(o[0],t[i]))?null:o[1][n]||null}return null},set:function(i){var o,u=0,s=e,a=i.length;if(0===a)s[a]=++t;else{for(s[a]||(s[a]=[[],[]]),s=s[a];u<a-1;)-1===(o=r.call(s[0],i[u]))&&(o=s[0].push(i[u])-1,s[1].push([[],[]])),s=s[1][o],++u;-1===(o=r.call(s[0],i[u]))&&(o=s[0].push(i[u])-1),s[1][o]=++t}return n[t]=i,t},delete:function(t){var i,o=0,u=e,s=n[t],a=s.length,c=[];if(0===a)delete u[a];else if(u=u[a]){for(;o<a-1;){if(-1===(i=r.call(u[0],s[o])))return;c.push(u,i),u=u[1][i],++o}if(-1===(i=r.call(u[0],s[o])))return;for(t=u[1][i],u[0].splice(i,1),u[1].splice(i,1);!u[0].length&&c.length;)i=c.pop(),(u=c.pop())[0].splice(i,1),u[1].splice(i,1)}delete n[t]},clear:function(){e=[],n=i(null)}}}},function(t,e,n){"use strict";t.exports=n(406)()?Number.isNaN:n(407)},function(t,e,n){"use strict";t.exports=function(){var t=Number.isNaN;return"function"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},function(t,e,n){"use strict";t.exports=function(t){return t!=t}},function(t,e,n){"use strict";var r=n(100);t.exports=function(){var t=0,e=[],n=[];return{get:function(t){var i=r.call(e,t[0]);return-1===i?null:n[i]},set:function(r){return e.push(r[0]),n.push(++t),t},delete:function(t){var i=r.call(n,t);-1!==i&&(e.splice(i,1),n.splice(i,1))},clear:function(){e=[],n=[]}}}},function(t,e,n){"use strict";var r=n(100),i=Object.create;t.exports=function(t){var e=0,n=[[],[]],o=i(null);return{get:function(e){for(var i,o=0,u=n;o<t-1;){if(-1===(i=r.call(u[0],e[o])))return null;u=u[1][i],++o}return-1===(i=r.call(u[0],e[o]))?null:u[1][i]||null},set:function(i){for(var u,s=0,a=n;s<t-1;)-1===(u=r.call(a[0],i[s]))&&(u=a[0].push(i[s])-1,a[1].push([[],[]])),a=a[1][u],++s;return-1===(u=r.call(a[0],i[s]))&&(u=a[0].push(i[s])-1),a[1][u]=++e,o[e]=i,e},delete:function(e){for(var i,u=0,s=n,a=[],c=o[e];u<t-1;){if(-1===(i=r.call(s[0],c[u])))return;a.push(s,i),s=s[1][i],++u}if(-1!==(i=r.call(s[0],c[u]))){for(e=s[1][i],s[0].splice(i,1),s[1].splice(i,1);!s[0].length&&a.length;)i=a.pop(),(s=a.pop())[0].splice(i,1),s[1].splice(i,1);delete o[e]}},clear:function(){n=[[],[]],o=i(null)}}}},function(t,e,n){"use strict";var r=n(99),i=n(164),o=n(163),u=n(162),s=n(101),a=Array.prototype.slice,c=Function.prototype.apply,f=Object.create;n(26).async=function(t,e){var n,l,h,p=f(null),d=f(null),y=e.memoized,w=e.original;e.memoized=u(function(t){var e=arguments,r=e[e.length-1];return"function"==typeof r&&(n=r,e=a.call(e,0,-1)),y.apply(l=this,h=e)},y);try{o(e.memoized,y)}catch(t){}e.on("get",function(t){var r,i,o;if(n){if(p[t])return"function"==typeof p[t]?p[t]=[p[t],n]:p[t].push(n),void(n=null);r=n,i=l,o=h,n=l=h=null,s(function(){var u;hasOwnProperty.call(d,t)?(u=d[t],e.emit("getasync",t,o,i),c.call(r,u.context,u.args)):(n=r,l=i,h=o,y.apply(i,o))})}}),e.original=function(){var t,i,o,u;return n?(t=r(arguments),i=function t(n){var i,o,a=t.id;if(null!=a){if(delete t.id,i=p[a],delete p[a],i)return o=r(arguments),e.has(a)&&(n?e.delete(a):(d[a]={context:this,args:o},e.emit("setasync",a,"function"==typeof i?1:i.length))),"function"==typeof i?u=c.call(i,this,o):i.forEach(function(t){u=c.call(t,this,o)},this),u}else s(c.bind(t,this,arguments))},o=n,n=l=h=null,t.push(i),u=c.call(w,this,t),i.cb=o,n=i,u):c.call(w,this,arguments)},e.on("set",function(t){n?(p[t]?"function"==typeof p[t]?p[t]=[p[t],n.cb]:p[t].push(n.cb):p[t]=n.cb,delete n.cb,n.id=t,n=null):e.delete(t)}),e.on("delete",function(t){var n;hasOwnProperty.call(p,t)||d[t]&&(n=d[t],delete d[t],e.emit("deleteasync",t,a.call(n.args,1)))}),e.on("clear",function(){var t=d;d=f(null),e.emit("clearasync",i(t,function(t){return a.call(t.args,1)}))})}},function(t,e,n){"use strict";var r=n(164),i=n(412),o=n(413),u=n(415),s=n(165),a=n(101),c=Object.create,f=i("then","then:finally","done","done:finally");n(26).promise=function(t,e){var n=c(null),i=c(null),l=c(null);if(!0===t)t=null;else if(t=o(t),!f[t])throw new TypeError("'"+u(t)+"' is not valid promise mode");e.on("set",function(r,o,u){var c=!1;if(!s(u))return i[r]=u,void e.emit("setasync",r,1);n[r]=1,l[r]=u;var f=function(t){var o=n[r];if(c)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");o&&(delete n[r],i[r]=t,e.emit("setasync",r,o))},h=function(){c=!0,n[r]&&(delete n[r],delete l[r],e.delete(r))},p=t;if(p||(p="then"),"then"===p){var d=function(){a(h)};"function"==typeof(u=u.then(function(t){a(f.bind(this,t))},d)).finally&&u.finally(d)}else if("done"===p){if("function"!=typeof u.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");u.done(f,h)}else if("done:finally"===p){if("function"!=typeof u.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof u.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");u.done(f),u.finally(h)}}),e.on("get",function(t,r,i){var o;if(n[t])++n[t];else{o=l[t];var u=function(){e.emit("getasync",t,r,i)};s(o)?"function"==typeof o.done?o.done(u):o.then(function(){a(u)}):u()}}),e.on("delete",function(t){if(delete l[t],n[t])delete n[t];else if(hasOwnProperty.call(i,t)){var r=i[t];delete i[t],e.emit("deleteasync",t,[r])}}),e.on("clear",function(){var t=i;i=c(null),n=c(null),l=c(null),e.emit("clearasync",r(t,function(t){return[t]}))})}},function(t,e,n){"use strict";var r=Array.prototype.forEach,i=Object.create;t.exports=function(t){var e=i(null);return r.call(arguments,function(t){e[t]=!0}),e}},function(t,e,n){"use strict";var r=n(34),i=n(414);t.exports=function(t){return i(r(t))}},function(t,e,n){"use strict";var r=n(98);t.exports=function(t){try{return t&&r(t.toString)?t.toString():String(t)}catch(t){throw new TypeError("Passed argument cannot be stringifed")}}},function(t,e,n){"use strict";var r=n(416),i=/[\n\r\u2028\u2029]/g;t.exports=function(t){var e=r(t);return e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(i,function(t){return JSON.stringify(t).slice(1,-1)})}},function(t,e,n){"use strict";var r=n(98);t.exports=function(t){try{return t&&r(t.toString)?t.toString():String(t)}catch(t){return"<Non-coercible to string value>"}}},function(t,e,n){"use strict";var r=n(18),i=n(68),o=n(26),u=Function.prototype.apply;o.dispose=function(t,e,n){var s;if(r(t),n.async&&o.async||n.promise&&o.promise)return e.on("deleteasync",s=function(e,n){u.call(t,null,n)}),void e.on("clearasync",function(t){i(t,function(t,e){s(e,t)})});e.on("delete",s=function(e,n){t(n)}),e.on("clear",function(t){i(t,function(t,e){s(e,t)})})}},function(t,e,n){"use strict";var r=n(99),i=n(68),o=n(101),u=n(165),s=n(419),a=n(26),c=Function.prototype,f=Math.max,l=Math.min,h=Object.create;a.maxAge=function(t,e,n){var p,d,y,w;(t=s(t))&&(p=h(null),d=n.async&&a.async||n.promise&&a.promise?"async":"",e.on("set"+d,function(n){p[n]=setTimeout(function(){e.delete(n)},t),"function"==typeof p[n].unref&&p[n].unref(),w&&(w[n]&&"nextTick"!==w[n]&&clearTimeout(w[n]),w[n]=setTimeout(function(){delete w[n]},y),"function"==typeof w[n].unref&&w[n].unref())}),e.on("delete"+d,function(t){clearTimeout(p[t]),delete p[t],w&&("nextTick"!==w[t]&&clearTimeout(w[t]),delete w[t])}),n.preFetch&&(y=!0===n.preFetch||isNaN(n.preFetch)?.333:f(l(Number(n.preFetch),1),0))&&(w={},y=(1-y)*t,e.on("get"+d,function(t,i,s){w[t]||(w[t]="nextTick",o(function(){var o;"nextTick"===w[t]&&(delete w[t],e.delete(t),n.async&&(i=r(i)).push(c),o=e.memoized.apply(s,i),n.promise&&u(o)&&("function"==typeof o.done?o.done(c,c):o.then(c,c)))}))})),e.on("clear"+d,function(){i(p,function(t){clearTimeout(t)}),p={},w&&(i(w,function(t){"nextTick"!==t&&clearTimeout(t)}),w={})}))}},function(t,e,n){"use strict";var r=n(25),i=n(420);t.exports=function(t){if((t=r(t))>i)throw new TypeError(t+" exceeds maximum possible timeout");return t}},function(t,e,n){"use strict";t.exports=2147483647},function(t,e,n){"use strict";var r=n(25),i=n(422),o=n(26);o.max=function(t,e,n){var u,s,a;(t=r(t))&&(s=i(t),u=n.async&&o.async||n.promise&&o.promise?"async":"",e.on("set"+u,a=function(t){void 0!==(t=s.hit(t))&&e.delete(t)}),e.on("get"+u,a),e.on("delete"+u,s.delete),e.on("clear"+u,s.clear))}},function(t,e,n){"use strict";var r=n(25),i=Object.create,o=Object.prototype.hasOwnProperty;t.exports=function(t){var e,n=0,u=1,s=i(null),a=i(null),c=0;return t=r(t),{hit:function(r){var i=a[r],f=++c;if(s[f]=r,a[r]=f,!i){if(++n<=t)return;return r=s[u],e(r),r}if(delete s[i],u===i)for(;!o.call(s,++u);)continue},delete:e=function(t){var e=a[t];if(e&&(delete s[e],delete a[t],--n,u===e)){if(!n)return c=0,void(u=1);for(;!o.call(s,++u);)continue}},clear:function(){n=0,u=1,s=i(null),a=i(null),c=0}}}},function(t,e,n){"use strict";var r=n(69),i=n(26),o=Object.create,u=Object.defineProperties;i.refCounter=function(t,e,n){var s,a;s=o(null),a=n.async&&i.async||n.promise&&i.promise?"async":"",e.on("set"+a,function(t,e){s[t]=e||1}),e.on("get"+a,function(t){++s[t]}),e.on("delete"+a,function(t){delete s[t]}),e.on("clear"+a,function(){s={}}),u(e.memoized,{deleteRef:r(function(){var t=e.get(arguments);return null===t?null:s[t]?!--s[t]&&(e.delete(t),!0):null}),getRefCount:r(function(){var t=e.get(arguments);return null===t?0:s[t]?s[t]:0})})}},function(t,e,n){var r=n(7),i=n(35),o=n(8).Buffer,u=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,i.call(this,64,56)}function c(t){return t<<30|t>>>2}function f(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}r(a,i),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,l=0;l<16;++l)n[l]=t.readInt32BE(4*l);for(;l<80;++l)n[l]=n[l-3]^n[l-8]^n[l-14]^n[l-16];for(var h=0;h<80;++h){var p=~~(h/20),d=0|((e=r)<<5|e>>>27)+f(p,i,o,s)+a+n[h]+u[p];a=s,s=o,o=c(i),i=r,r=d}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},a.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=a},function(t,e,n){var r=n(7),i=n(35),o=n(8).Buffer,u=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,i.call(this,64,56)}function c(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function l(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}r(a,i),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,h=0;h<16;++h)n[h]=t.readInt32BE(4*h);for(;h<80;++h)n[h]=(e=n[h-3]^n[h-8]^n[h-14]^n[h-16])<<1|e>>>31;for(var p=0;p<80;++p){var d=~~(p/20),y=c(r)+l(d,i,o,s)+a+n[p]+u[d]|0;a=s,s=o,o=f(i),i=r,r=y}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},a.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=a},function(t,e,n){var r=n(7),i=n(166),o=n(35),u=n(8).Buffer,s=new Array(64);function a(){this.init(),this._w=s,o.call(this,64,56)}r(a,i),a.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},a.prototype._hash=function(){var t=u.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=a},function(t,e,n){var r=n(7),i=n(167),o=n(35),u=n(8).Buffer,s=new Array(160);function a(){this.init(),this._w=s,o.call(this,128,112)}r(a,i),a.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},a.prototype._hash=function(){var t=u.allocUnsafe(48);function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=a},function(t,e,n){"use strict";var r=n(429),i=n(448);function o(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}t.exports.Type=n(3),t.exports.Schema=n(37),t.exports.FAILSAFE_SCHEMA=n(102),t.exports.JSON_SCHEMA=n(169),t.exports.CORE_SCHEMA=n(168),t.exports.DEFAULT_SAFE_SCHEMA=n(48),t.exports.DEFAULT_FULL_SCHEMA=n(70),t.exports.load=r.load,t.exports.loadAll=r.loadAll,t.exports.safeLoad=r.safeLoad,t.exports.safeLoadAll=r.safeLoadAll,t.exports.dump=i.dump,t.exports.safeDump=i.safeDump,t.exports.YAMLException=n(47),t.exports.MINIMAL_SCHEMA=n(102),t.exports.SAFE_SCHEMA=n(48),t.exports.DEFAULT_SCHEMA=n(70),t.exports.scan=o("scan"),t.exports.parse=o("parse"),t.exports.compose=o("compose"),t.exports.addConstructor=o("addConstructor")},function(t,e,n){"use strict";var r=n(36),i=n(47),o=n(430),u=n(48),s=n(70),a=Object.prototype.hasOwnProperty,c=1,f=2,l=3,h=4,p=1,d=2,y=3,w=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v=/[\x85\u2028\u2029]/,g=/[,\[\]\{\}]/,M=/^(?:!|!!|![a-z\-]+!)$/i,_=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function m(t){return Object.prototype.toString.call(t)}function L(t){return 10===t||13===t}function b(t){return 9===t||32===t}function j(t){return 9===t||32===t||10===t||13===t}function x(t){return 44===t||91===t||93===t||123===t||125===t}function N(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function S(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t?"\t":9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"…":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function D(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var I=new Array(256),E=new Array(256),C=0;C<256;C++)I[C]=S(C)?1:0,E[C]=S(C);function T(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||s,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function A(t,e){return new i(e,new o(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function O(t,e){throw A(t,e)}function z(t,e){t.onWarning&&t.onWarning.call(null,A(t,e))}var k={YAML:function(t,e,n){var r,i,o;null!==t.version&&O(t,"duplication of %YAML directive"),1!==n.length&&O(t,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&O(t,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&O(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=o<2,1!==o&&2!==o&&z(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var r,i;2!==n.length&&O(t,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],M.test(r)||O(t,"ill-formed tag handle (first argument) of the TAG directive"),a.call(t.tagMap,r)&&O(t,'there is a previously declared suffix for "'+r+'" tag handle'),_.test(i)||O(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[r]=i}};function Y(t,e,n,r){var i,o,u,s;if(e<n){if(s=t.input.slice(e,n),r)for(i=0,o=s.length;i<o;i+=1)9===(u=s.charCodeAt(i))||32<=u&&u<=1114111||O(t,"expected valid JSON character");else w.test(s)&&O(t,"the stream contains non-printable characters");t.result+=s}}function U(t,e,n,i){var o,u,s,c;for(r.isObject(n)||O(t,"cannot merge mappings; the provided source object is unacceptable"),s=0,c=(o=Object.keys(n)).length;s<c;s+=1)u=o[s],a.call(e,u)||(e[u]=n[u],i[u]=!0)}function P(t,e,n,r,i,o,u,s){var c,f;if(Array.isArray(i))for(c=0,f=(i=Array.prototype.slice.call(i)).length;c<f;c+=1)Array.isArray(i[c])&&O(t,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===m(i[c])&&(i[c]="[object Object]");if("object"==typeof i&&"[object Object]"===m(i)&&(i="[object Object]"),i=String(i),null===e&&(e={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(c=0,f=o.length;c<f;c+=1)U(t,e,o[c],n);else U(t,e,o,n);else t.json||a.call(n,i)||!a.call(e,i)||(t.line=u||t.line,t.position=s||t.position,O(t,"duplicated mapping key")),e[i]=o,delete n[i];return e}function R(t){var e;10===(e=t.input.charCodeAt(t.position))?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):O(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function Q(t,e,n){for(var r=0,i=t.input.charCodeAt(t.position);0!==i;){for(;b(i);)i=t.input.charCodeAt(++t.position);if(e&&35===i)do{i=t.input.charCodeAt(++t.position)}while(10!==i&&13!==i&&0!==i);if(!L(i))break;for(R(t),i=t.input.charCodeAt(t.position),r++,t.lineIndent=0;32===i;)t.lineIndent++,i=t.input.charCodeAt(++t.position)}return-1!==n&&0!==r&&t.lineIndent<n&&z(t,"deficient indentation"),r}function F(t){var e,n=t.position;return!(45!==(e=t.input.charCodeAt(n))&&46!==e||e!==t.input.charCodeAt(n+1)||e!==t.input.charCodeAt(n+2)||(n+=3,0!==(e=t.input.charCodeAt(n))&&!j(e)))}function B(t,e){1===e?t.result+=" ":e>1&&(t.result+=r.repeat("\n",e-1))}function G(t,e){var n,r,i=t.tag,o=t.anchor,u=[],s=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=u),r=t.input.charCodeAt(t.position);0!==r&&45===r&&j(t.input.charCodeAt(t.position+1));)if(s=!0,t.position++,Q(t,!0,-1)&&t.lineIndent<=e)u.push(null),r=t.input.charCodeAt(t.position);else if(n=t.line,J(t,e,l,!1,!0),u.push(t.result),Q(t,!0,-1),r=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==r)O(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!s&&(t.tag=i,t.anchor=o,t.kind="sequence",t.result=u,!0)}function W(t){var e,n,r,i,o=!1,u=!1;if(33!==(i=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&O(t,"duplication of a tag property"),60===(i=t.input.charCodeAt(++t.position))?(o=!0,i=t.input.charCodeAt(++t.position)):33===i?(u=!0,n="!!",i=t.input.charCodeAt(++t.position)):n="!",e=t.position,o){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&62!==i);t.position<t.length?(r=t.input.slice(e,t.position),i=t.input.charCodeAt(++t.position)):O(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!j(i);)33===i&&(u?O(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),M.test(n)||O(t,"named tag handle cannot contain such characters"),u=!0,e=t.position+1)),i=t.input.charCodeAt(++t.position);r=t.input.slice(e,t.position),g.test(r)&&O(t,"tag suffix cannot contain flow indicator characters")}return r&&!_.test(r)&&O(t,"tag name cannot contain such characters: "+r),o?t.tag=r:a.call(t.tagMap,n)?t.tag=t.tagMap[n]+r:"!"===n?t.tag="!"+r:"!!"===n?t.tag="tag:yaml.org,2002:"+r:O(t,'undeclared tag handle "'+n+'"'),!0}function q(t){var e,n;if(38!==(n=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&O(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!j(n)&&!x(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&O(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function J(t,e,n,i,o){var u,s,w,v,g,M,_,m,S=1,C=!1,T=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,u=s=w=h===n||l===n,i&&Q(t,!0,-1)&&(C=!0,t.lineIndent>e?S=1:t.lineIndent===e?S=0:t.lineIndent<e&&(S=-1)),1===S)for(;W(t)||q(t);)Q(t,!0,-1)?(C=!0,w=u,t.lineIndent>e?S=1:t.lineIndent===e?S=0:t.lineIndent<e&&(S=-1)):w=!1;if(w&&(w=C||o),1!==S&&h!==n||(_=c===n||f===n?e:e+1,m=t.position-t.lineStart,1===S?w&&(G(t,m)||function(t,e,n){var r,i,o,u,s,a=t.tag,c=t.anchor,l={},p={},d=null,y=null,w=null,v=!1,g=!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=l),s=t.input.charCodeAt(t.position);0!==s;){if(r=t.input.charCodeAt(t.position+1),o=t.line,u=t.position,63!==s&&58!==s||!j(r)){if(!J(t,n,f,!1,!0))break;if(t.line===o){for(s=t.input.charCodeAt(t.position);b(s);)s=t.input.charCodeAt(++t.position);if(58===s)j(s=t.input.charCodeAt(++t.position))||O(t,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(P(t,l,p,d,y,null),d=y=w=null),g=!0,v=!1,i=!1,d=t.tag,y=t.result;else{if(!g)return t.tag=a,t.anchor=c,!0;O(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!g)return t.tag=a,t.anchor=c,!0;O(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(v&&(P(t,l,p,d,y,null),d=y=w=null),g=!0,v=!0,i=!0):v?(v=!1,i=!0):O(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,s=r;if((t.line===o||t.lineIndent>e)&&(J(t,e,h,!0,i)&&(v?y=t.result:w=t.result),v||(P(t,l,p,d,y,w,o,u),d=y=w=null),Q(t,!0,-1),s=t.input.charCodeAt(t.position)),t.lineIndent>e&&0!==s)O(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return v&&P(t,l,p,d,y,null),g&&(t.tag=a,t.anchor=c,t.kind="mapping",t.result=l),g}(t,m,_))||function(t,e){var n,r,i,o,u,s,a,f,l,h,p=!0,d=t.tag,y=t.anchor,w={};if(91===(h=t.input.charCodeAt(t.position)))i=93,s=!1,r=[];else{if(123!==h)return!1;i=125,s=!0,r={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=r),h=t.input.charCodeAt(++t.position);0!==h;){if(Q(t,!0,e),(h=t.input.charCodeAt(t.position))===i)return t.position++,t.tag=d,t.anchor=y,t.kind=s?"mapping":"sequence",t.result=r,!0;p||O(t,"missed comma between flow collection entries"),l=null,o=u=!1,63===h&&j(t.input.charCodeAt(t.position+1))&&(o=u=!0,t.position++,Q(t,!0,e)),n=t.line,J(t,e,c,!1,!0),f=t.tag,a=t.result,Q(t,!0,e),h=t.input.charCodeAt(t.position),!u&&t.line!==n||58!==h||(o=!0,h=t.input.charCodeAt(++t.position),Q(t,!0,e),J(t,e,c,!1,!0),l=t.result),s?P(t,r,w,f,a,l):o?r.push(P(t,null,w,f,a,l)):r.push(a),Q(t,!0,e),44===(h=t.input.charCodeAt(t.position))?(p=!0,h=t.input.charCodeAt(++t.position)):p=!1}O(t,"unexpected end of the stream within a flow collection")}(t,_)?T=!0:(s&&function(t,e){var n,i,o,u,s,a=p,c=!1,f=!1,l=e,h=0,w=!1;if(124===(u=t.input.charCodeAt(t.position)))i=!1;else{if(62!==u)return!1;i=!0}for(t.kind="scalar",t.result="";0!==u;)if(43===(u=t.input.charCodeAt(++t.position))||45===u)p===a?a=43===u?y:d:O(t,"repeat of a chomping mode identifier");else{if(!((o=48<=(s=u)&&s<=57?s-48:-1)>=0))break;0===o?O(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):f?O(t,"repeat of an indentation width identifier"):(l=e+o-1,f=!0)}if(b(u)){do{u=t.input.charCodeAt(++t.position)}while(b(u));if(35===u)do{u=t.input.charCodeAt(++t.position)}while(!L(u)&&0!==u)}for(;0!==u;){for(R(t),t.lineIndent=0,u=t.input.charCodeAt(t.position);(!f||t.lineIndent<l)&&32===u;)t.lineIndent++,u=t.input.charCodeAt(++t.position);if(!f&&t.lineIndent>l&&(l=t.lineIndent),L(u))h++;else{if(t.lineIndent<l){a===y?t.result+=r.repeat("\n",c?1+h:h):a===p&&c&&(t.result+="\n");break}for(i?b(u)?(w=!0,t.result+=r.repeat("\n",c?1+h:h)):w?(w=!1,t.result+=r.repeat("\n",h+1)):0===h?c&&(t.result+=" "):t.result+=r.repeat("\n",h):t.result+=r.repeat("\n",c?1+h:h),c=!0,f=!0,h=0,n=t.position;!L(u)&&0!==u;)u=t.input.charCodeAt(++t.position);Y(t,n,t.position,!1)}}return!0}(t,_)||function(t,e){var n,r,i;if(39!==(n=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;0!==(n=t.input.charCodeAt(t.position));)if(39===n){if(Y(t,r,t.position,!0),39!==(n=t.input.charCodeAt(++t.position)))return!0;r=t.position,t.position++,i=t.position}else L(n)?(Y(t,r,i,!0),B(t,Q(t,!1,e)),r=i=t.position):t.position===t.lineStart&&F(t)?O(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);O(t,"unexpected end of the stream within a single quoted scalar")}(t,_)||function(t,e){var n,r,i,o,u,s,a;if(34!==(s=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;0!==(s=t.input.charCodeAt(t.position));){if(34===s)return Y(t,n,t.position,!0),t.position++,!0;if(92===s){if(Y(t,n,t.position,!0),L(s=t.input.charCodeAt(++t.position)))Q(t,!1,e);else if(s<256&&I[s])t.result+=E[s],t.position++;else if((u=120===(a=s)?2:117===a?4:85===a?8:0)>0){for(i=u,o=0;i>0;i--)(u=N(s=t.input.charCodeAt(++t.position)))>=0?o=(o<<4)+u:O(t,"expected hexadecimal character");t.result+=D(o),t.position++}else O(t,"unknown escape sequence");n=r=t.position}else L(s)?(Y(t,n,r,!0),B(t,Q(t,!1,e)),n=r=t.position):t.position===t.lineStart&&F(t)?O(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}O(t,"unexpected end of the stream within a double quoted scalar")}(t,_)?T=!0:!function(t){var e,n,r;if(42!==(r=t.input.charCodeAt(t.position)))return!1;for(r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!j(r)&&!x(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&O(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),t.anchorMap.hasOwnProperty(n)||O(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Q(t,!0,-1),!0}(t)?function(t,e,n){var r,i,o,u,s,a,c,f,l=t.kind,h=t.result;if(j(f=t.input.charCodeAt(t.position))||x(f)||35===f||38===f||42===f||33===f||124===f||62===f||39===f||34===f||37===f||64===f||96===f)return!1;if((63===f||45===f)&&(j(r=t.input.charCodeAt(t.position+1))||n&&x(r)))return!1;for(t.kind="scalar",t.result="",i=o=t.position,u=!1;0!==f;){if(58===f){if(j(r=t.input.charCodeAt(t.position+1))||n&&x(r))break}else if(35===f){if(j(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&F(t)||n&&x(f))break;if(L(f)){if(s=t.line,a=t.lineStart,c=t.lineIndent,Q(t,!1,-1),t.lineIndent>=e){u=!0,f=t.input.charCodeAt(t.position);continue}t.position=o,t.line=s,t.lineStart=a,t.lineIndent=c;break}}u&&(Y(t,i,o,!1),B(t,t.line-s),i=o=t.position,u=!1),b(f)||(o=t.position+1),f=t.input.charCodeAt(++t.position)}return Y(t,i,o,!1),!!t.result||(t.kind=l,t.result=h,!1)}(t,_,c===n)&&(T=!0,null===t.tag&&(t.tag="?")):(T=!0,null===t.tag&&null===t.anchor||O(t,"alias node should not have any properties")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===S&&(T=w&&G(t,m))),null!==t.tag&&"!"!==t.tag)if("?"===t.tag){for(v=0,g=t.implicitTypes.length;v<g;v+=1)if((M=t.implicitTypes[v]).resolve(t.result)){t.result=M.construct(t.result),t.tag=M.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else a.call(t.typeMap[t.kind||"fallback"],t.tag)?(M=t.typeMap[t.kind||"fallback"][t.tag],null!==t.result&&M.kind!==t.kind&&O(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+M.kind+'", not "'+t.kind+'"'),M.resolve(t.result)?(t.result=M.construct(t.result),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):O(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):O(t,"unknown tag !<"+t.tag+">");return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||T}function Z(t){var e,n,r,i,o=t.position,u=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};0!==(i=t.input.charCodeAt(t.position))&&(Q(t,!0,-1),i=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==i));){for(u=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!j(i);)i=t.input.charCodeAt(++t.position);for(r=[],(n=t.input.slice(e,t.position)).length<1&&O(t,"directive name must not be less than one character in length");0!==i;){for(;b(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!L(i));break}if(L(i))break;for(e=t.position;0!==i&&!j(i);)i=t.input.charCodeAt(++t.position);r.push(t.input.slice(e,t.position))}0!==i&&R(t),a.call(k,n)?k[n](t,n,r):z(t,'unknown document directive "'+n+'"')}Q(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,Q(t,!0,-1)):u&&O(t,"directives end mark is expected"),J(t,t.lineIndent-1,h,!1,!0),Q(t,!0,-1),t.checkLineBreaks&&v.test(t.input.slice(o,t.position))&&z(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&F(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,Q(t,!0,-1)):t.position<t.length-1&&O(t,"end of the stream or a document separator is expected")}function V(t,e){e=e||{},0!==(t=String(t)).length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var n=new T(t,e);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Z(n);return n.documents}function X(t,e,n){var r,i,o=V(t,n);if("function"!=typeof e)return o;for(r=0,i=o.length;r<i;r+=1)e(o[r])}function H(t,e){var n=V(t,e);if(0!==n.length){if(1===n.length)return n[0];throw new i("expected a single document in the stream, but found more")}}t.exports.loadAll=X,t.exports.load=H,t.exports.safeLoadAll=function(t,e,n){if("function"!=typeof e)return X(t,r.extend({schema:u},n));X(t,e,r.extend({schema:u},n))},t.exports.safeLoad=function(t,e){return H(t,r.extend({schema:u},e))}},function(t,e,n){"use strict";var r=n(36);function i(t,e,n,r,i){this.name=t,this.buffer=e,this.position=n,this.line=r,this.column=i}i.prototype.getSnippet=function(t,e){var n,i,o,u,s;if(!this.buffer)return null;for(t=t||4,e=e||75,n="",i=this.position;i>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(i-1));)if(i-=1,this.position-i>e/2-1){n=" ... ",i+=5;break}for(o="",u=this.position;u<this.buffer.length&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(u));)if((u+=1)-this.position>e/2-1){o=" ... ",u-=5;break}return s=this.buffer.slice(i,u),r.repeat(" ",t)+n+s+o+"\n"+r.repeat(" ",t+this.position-i+n.length)+"^"},i.prototype.toString=function(t){var e,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),t||(e=this.getSnippet())&&(n+=":\n"+e),n},t.exports=i},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)},construct:function(t){return"true"===t||"True"===t||"TRUE"===t},predicate:function(t){return"[object Boolean]"===Object.prototype.toString.call(t)},represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(36),i=n(3);function o(t){return 48<=t&&t<=55}function u(t){return 48<=t&&t<=57}t.exports=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,r=t.length,i=0,s=!1;if(!r)return!1;if("-"!==(e=t[i])&&"+"!==e||(e=t[++i]),"0"===e){if(i+1===r)return!0;if("b"===(e=t[++i])){for(i++;i<r;i++)if("_"!==(e=t[i])){if("0"!==e&&"1"!==e)return!1;s=!0}return s&&"_"!==e}if("x"===e){for(i++;i<r;i++)if("_"!==(e=t[i])){if(!(48<=(n=t.charCodeAt(i))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==e}for(;i<r;i++)if("_"!==(e=t[i])){if(!o(t.charCodeAt(i)))return!1;s=!0}return s&&"_"!==e}if("_"===e)return!1;for(;i<r;i++)if("_"!==(e=t[i])){if(":"===e)break;if(!u(t.charCodeAt(i)))return!1;s=!0}return!(!s||"_"===e)&&(":"!==e||/^(:[0-5]?[0-9])+$/.test(t.slice(i)))},construct:function(t){var e,n,r=t,i=1,o=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(e=r[0])&&"+"!==e||("-"===e&&(i=-1),e=(r=r.slice(1))[0]),"0"===r?0:"0"===e?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(t){o.unshift(parseInt(t,10))}),r=0,n=1,o.forEach(function(t){r+=t*n,n*=60}),i*r):i*parseInt(r,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!r.isNegativeZero(t)},represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(t,e,n){"use strict";var r=n(36),i=n(3),o=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var u=/^[-+]?[0-9]+e/;t.exports=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!o.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n,r,i;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,i=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(t){i.unshift(parseFloat(t,10))}),e=0,r=1,i.forEach(function(t){e+=t*r,r*=60}),n*e):n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||r.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(t))return"-0.0";return n=t.toString(10),u.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},function(t,e,n){"use strict";var r=n(3),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");t.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==i.exec(t)||null!==o.exec(t))},construct:function(t){var e,n,r,u,s,a,c,f,l=0,h=null;if(null===(e=i.exec(t))&&(e=o.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,u=+e[3],!e[4])return new Date(Date.UTC(n,r,u));if(s=+e[4],a=+e[5],c=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(h=-h)),f=new Date(Date.UTC(n,r,u,s,a,c,l)),h&&f.setTime(f.getTime()-h),f},instanceOf:Date,represent:function(t){return t.toISOString()}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}})},function(t,e,n){"use strict";var r;try{r=n(57).Buffer}catch(t){}var i=n(3),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,r=0,i=t.length,u=o;for(n=0;n<i;n++)if(!((e=u.indexOf(t.charAt(n)))>64)){if(e<0)return!1;r+=6}return r%8==0},construct:function(t){var e,n,i=t.replace(/[\r\n=]/g,""),u=i.length,s=o,a=0,c=[];for(e=0;e<u;e++)e%4==0&&e&&(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)),a=a<<6|s.indexOf(i.charAt(e));return 0===(n=u%4*6)?(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)):18===n?(c.push(a>>10&255),c.push(a>>2&255)):12===n&&c.push(a>>4&255),r?r.from?r.from(c):new r(c):c},predicate:function(t){return r&&r.isBuffer(t)},represent:function(t){var e,n,r="",i=0,u=t.length,s=o;for(e=0;e<u;e++)e%3==0&&e&&(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]),i=(i<<8)+t[e];return 0===(n=u%3)?(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]):2===n?(r+=s[i>>10&63],r+=s[i>>4&63],r+=s[i<<2&63],r+=s[64]):1===n&&(r+=s[i>>2&63],r+=s[i<<4&63],r+=s[64],r+=s[64]),r}})},function(t,e,n){"use strict";var r=n(3),i=Object.prototype.hasOwnProperty,o=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,r,u,s,a=[],c=t;for(e=0,n=c.length;e<n;e+=1){if(r=c[e],s=!1,"[object Object]"!==o.call(r))return!1;for(u in r)if(i.call(r,u)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==a.indexOf(u))return!1;a.push(u)}return!0},construct:function(t){return null!==t?t:[]}})},function(t,e,n){"use strict";var r=n(3),i=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,r,o,u,s=t;for(u=new Array(s.length),e=0,n=s.length;e<n;e+=1){if(r=s[e],"[object Object]"!==i.call(r))return!1;if(1!==(o=Object.keys(r)).length)return!1;u[e]=[o[0],r[o[0]]]}return!0},construct:function(t){if(null===t)return[];var e,n,r,i,o,u=t;for(o=new Array(u.length),e=0,n=u.length;e<n;e+=1)r=u[e],i=Object.keys(r),o[e]=[i[0],r[i[0]]];return o}})},function(t,e,n){"use strict";var r=n(3),i=Object.prototype.hasOwnProperty;t.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(t){if(null===t)return!0;var e,n=t;for(e in n)if(i.call(n,e)&&null!==n[e])return!1;return!0},construct:function(t){return null!==t?t:{}}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(t){return void 0===t},represent:function(){return""}})},function(t,e,n){"use strict";var r=n(3);t.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(t){if(null===t)return!1;if(0===t.length)return!1;var e=t,n=/\/([gim]*)$/.exec(t),r="";if("/"===e[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==e[e.length-r.length-1])return!1}return!0},construct:function(t){var e=t,n=/\/([gim]*)$/.exec(t),r="";return"/"===e[0]&&(n&&(r=n[1]),e=e.slice(1,e.length-r.length-1)),new RegExp(e,r)},predicate:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},represent:function(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}})},function(t,e,n){"use strict";var r;try{r=n(447)}catch(t){"undefined"!=typeof window&&(r=window.esprima)}var i=n(3);t.exports=new i("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(t){if(null===t)return!1;try{var e="("+t+")",n=r.parse(e,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(t){return!1}},construct:function(t){var e,n="("+t+")",i=r.parse(n,{range:!0}),o=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"ArrowFunctionExpression"!==i.body[0].expression.type&&"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach(function(t){o.push(t.name)}),e=i.body[0].expression.body.range,"BlockStatement"===i.body[0].expression.body.type?new Function(o,n.slice(e[0]+1,e[1]-1)):new Function(o,"return "+n.slice(e[0],e[1]))},predicate:function(t){return"[object Function]"===Object.prototype.toString.call(t)},represent:function(t){return t.toString()}})},function(e,n){if(void 0===t){var r=new Error("Cannot find module 'esprima'");throw r.code="MODULE_NOT_FOUND",r}e.exports=t},function(t,e,n){"use strict";var r=n(36),i=n(47),o=n(70),u=n(48),s=Object.prototype.toString,a=Object.prototype.hasOwnProperty,c=9,f=10,l=32,h=33,p=34,d=35,y=37,w=38,v=39,g=42,M=44,_=45,m=58,L=62,b=63,j=64,x=91,N=93,S=96,D=123,I=124,E=125,C={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},T=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function A(t){var e,n,o;if(e=t.toString(16).toUpperCase(),t<=255)n="x",o=2;else if(t<=65535)n="u",o=4;else{if(!(t<=4294967295))throw new i("code point within a string may not be greater than 0xFFFFFFFF");n="U",o=8}return"\\"+n+r.repeat("0",o-e.length)+e}function O(t){this.schema=t.schema||o,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=r.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=function(t,e){var n,r,i,o,u,s,c;if(null===e)return{};for(n={},i=0,o=(r=Object.keys(e)).length;i<o;i+=1)u=r[i],s=String(e[u]),"!!"===u.slice(0,2)&&(u="tag:yaml.org,2002:"+u.slice(2)),(c=t.compiledTypeMap.fallback[u])&&a.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[u]=s;return n}(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function z(t,e){for(var n,i=r.repeat(" ",e),o=0,u=-1,s="",a=t.length;o<a;)-1===(u=t.indexOf("\n",o))?(n=t.slice(o),o=a):(n=t.slice(o,u+1),o=u+1),n.length&&"\n"!==n&&(s+=i),s+=n;return s}function k(t,e){return"\n"+r.repeat(" ",t.indent*e)}function Y(t){return t===l||t===c}function U(t){return 32<=t&&t<=126||161<=t&&t<=55295&&8232!==t&&8233!==t||57344<=t&&t<=65533&&65279!==t||65536<=t&&t<=1114111}function P(t){return U(t)&&65279!==t&&t!==M&&t!==x&&t!==N&&t!==D&&t!==E&&t!==m&&t!==d}function R(t){return/^\n* /.test(t)}var Q=1,F=2,B=3,G=4,W=5;function q(t,e,n,r,i){var o,u,s,a=!1,c=!1,l=-1!==r,C=-1,T=U(s=t.charCodeAt(0))&&65279!==s&&!Y(s)&&s!==_&&s!==b&&s!==m&&s!==M&&s!==x&&s!==N&&s!==D&&s!==E&&s!==d&&s!==w&&s!==g&&s!==h&&s!==I&&s!==L&&s!==v&&s!==p&&s!==y&&s!==j&&s!==S&&!Y(t.charCodeAt(t.length-1));if(e)for(o=0;o<t.length;o++){if(!U(u=t.charCodeAt(o)))return W;T=T&&P(u)}else{for(o=0;o<t.length;o++){if((u=t.charCodeAt(o))===f)a=!0,l&&(c=c||o-C-1>r&&" "!==t[C+1],C=o);else if(!U(u))return W;T=T&&P(u)}c=c||l&&o-C-1>r&&" "!==t[C+1]}return a||c?n>9&&R(t)?W:c?G:B:T&&!i(t)?Q:F}function J(t,e,n,r){t.dump=function(){if(0===e.length)return"''";if(!t.noCompatMode&&-1!==T.indexOf(e))return"'"+e+"'";var o=t.indent*Math.max(1,n),u=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),s=r||t.flowLevel>-1&&n>=t.flowLevel;switch(q(e,s,t.indent,u,function(e){return function(t,e){var n,r;for(n=0,r=t.implicitTypes.length;n<r;n+=1)if(t.implicitTypes[n].resolve(e))return!0;return!1}(t,e)})){case Q:return e;case F:return"'"+e.replace(/'/g,"''")+"'";case B:return"|"+Z(e,t.indent)+V(z(e,o));case G:return">"+Z(e,t.indent)+V(z(function(t,e){var n,r,i=/(\n+)([^\n]*)/g,o=(s=t.indexOf("\n"),s=-1!==s?s:t.length,i.lastIndex=s,X(t.slice(0,s),e)),u="\n"===t[0]||" "===t[0];var s;for(;r=i.exec(t);){var a=r[1],c=r[2];n=" "===c[0],o+=a+(u||n||""===c?"":"\n")+X(c,e),u=n}return o}(e,u),o));case W:return'"'+function(t){for(var e,n,r,i="",o=0;o<t.length;o++)(e=t.charCodeAt(o))>=55296&&e<=56319&&(n=t.charCodeAt(o+1))>=56320&&n<=57343?(i+=A(1024*(e-55296)+n-56320+65536),o++):(r=C[e],i+=!r&&U(e)?t[o]:r||A(e));return i}(e)+'"';default:throw new i("impossible error: invalid scalar style")}}()}function Z(t,e){var n=R(t)?String(e):"",r="\n"===t[t.length-1];return n+(r&&("\n"===t[t.length-2]||"\n"===t)?"+":r?"":"-")+"\n"}function V(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function X(t,e){if(""===t||" "===t[0])return t;for(var n,r,i=/ [^ ]/g,o=0,u=0,s=0,a="";n=i.exec(t);)(s=n.index)-o>e&&(r=u>o?u:s,a+="\n"+t.slice(o,r),o=r+1),u=s;return a+="\n",t.length-o>e&&u>o?a+=t.slice(o,u)+"\n"+t.slice(u+1):a+=t.slice(o),a.slice(1)}function H(t,e,n){var r,o,u,c,f,l;for(u=0,c=(o=n?t.explicitTypes:t.implicitTypes).length;u<c;u+=1)if(((f=o[u]).instanceOf||f.predicate)&&(!f.instanceOf||"object"==typeof e&&e instanceof f.instanceOf)&&(!f.predicate||f.predicate(e))){if(t.tag=n?f.tag:"?",f.represent){if(l=t.styleMap[f.tag]||f.defaultStyle,"[object Function]"===s.call(f.represent))r=f.represent(e,l);else{if(!a.call(f.represent,l))throw new i("!<"+f.tag+'> tag resolver accepts not "'+l+'" style');r=f.represent[l](e,l)}t.dump=r}return!0}return!1}function K(t,e,n,r,o,u){t.tag=null,t.dump=n,H(t,n,!1)||H(t,n,!0);var a=s.call(t.dump);r&&(r=t.flowLevel<0||t.flowLevel>e);var c,l,h="[object Object]"===a||"[object Array]"===a;if(h&&(l=-1!==(c=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||l||2!==t.indent&&e>0)&&(o=!1),l&&t.usedDuplicates[c])t.dump="*ref_"+c;else{if(h&&l&&!t.usedDuplicates[c]&&(t.usedDuplicates[c]=!0),"[object Object]"===a)r&&0!==Object.keys(t.dump).length?(!function(t,e,n,r){var o,u,s,a,c,l,h="",p=t.tag,d=Object.keys(n);if(!0===t.sortKeys)d.sort();else if("function"==typeof t.sortKeys)d.sort(t.sortKeys);else if(t.sortKeys)throw new i("sortKeys must be a boolean or a function");for(o=0,u=d.length;o<u;o+=1)l="",r&&0===o||(l+=k(t,e)),a=n[s=d[o]],K(t,e+1,s,!0,!0,!0)&&((c=null!==t.tag&&"?"!==t.tag||t.dump&&t.dump.length>1024)&&(t.dump&&f===t.dump.charCodeAt(0)?l+="?":l+="? "),l+=t.dump,c&&(l+=k(t,e)),K(t,e+1,a,!0,c)&&(t.dump&&f===t.dump.charCodeAt(0)?l+=":":l+=": ",h+=l+=t.dump));t.tag=p,t.dump=h||"{}"}(t,e,t.dump,o),l&&(t.dump="&ref_"+c+t.dump)):(!function(t,e,n){var r,i,o,u,s,a="",c=t.tag,f=Object.keys(n);for(r=0,i=f.length;r<i;r+=1)s=t.condenseFlow?'"':"",0!==r&&(s+=", "),u=n[o=f[r]],K(t,e,o,!1,!1)&&(t.dump.length>1024&&(s+="? "),s+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),K(t,e,u,!1,!1)&&(a+=s+=t.dump));t.tag=c,t.dump="{"+a+"}"}(t,e,t.dump),l&&(t.dump="&ref_"+c+" "+t.dump));else if("[object Array]"===a){var p=t.noArrayIndent&&e>0?e-1:e;r&&0!==t.dump.length?(!function(t,e,n,r){var i,o,u="",s=t.tag;for(i=0,o=n.length;i<o;i+=1)K(t,e+1,n[i],!0,!0)&&(r&&0===i||(u+=k(t,e)),t.dump&&f===t.dump.charCodeAt(0)?u+="-":u+="- ",u+=t.dump);t.tag=s,t.dump=u||"[]"}(t,p,t.dump,o),l&&(t.dump="&ref_"+c+t.dump)):(!function(t,e,n){var r,i,o="",u=t.tag;for(r=0,i=n.length;r<i;r+=1)K(t,e,n[r],!1,!1)&&(0!==r&&(o+=","+(t.condenseFlow?"":" ")),o+=t.dump);t.tag=u,t.dump="["+o+"]"}(t,p,t.dump),l&&(t.dump="&ref_"+c+" "+t.dump))}else{if("[object String]"!==a){if(t.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+a)}"?"!==t.tag&&J(t,t.dump,e,u)}null!==t.tag&&"?"!==t.tag&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function $(t,e){var n,r,i=[],o=[];for(function t(e,n,r){var i,o,u;if(null!==e&&"object"==typeof e)if(-1!==(o=n.indexOf(e)))-1===r.indexOf(o)&&r.push(o);else if(n.push(e),Array.isArray(e))for(o=0,u=e.length;o<u;o+=1)t(e[o],n,r);else for(i=Object.keys(e),o=0,u=i.length;o<u;o+=1)t(e[i[o]],n,r)}(t,i,o),n=0,r=o.length;n<r;n+=1)e.duplicates.push(i[o[n]]);e.usedDuplicates=new Array(r)}function tt(t,e){var n=new O(e=e||{});return n.noRefs||$(t,n),K(n,0,t,!0,!0)?n.dump+"\n":""}t.exports.dump=tt,t.exports.safeDump=function(t,e){return tt(t,r.extend({schema:u},e))}},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"UPDATE_CONFIGS",function(){return E}),n.d(r,"TOGGLE_CONFIGS",function(){return C}),n.d(r,"update",function(){return T}),n.d(r,"toggle",function(){return A}),n.d(r,"loaded",function(){return z});var i={};n.r(i),n.d(i,"downloadConfig",function(){return k}),n.d(i,"getConfigByUrl",function(){return Y});var o={};n.r(o),n.d(o,"get",function(){return R});var u=n(71),s=n.n(u),a=n(72),c=n.n(a),f=n(73),l=n.n(f),h=n(74),p=n.n(h),d=n(75),y=n.n(d),w=n(1),v=n.n(w),g=(n(134),function(t){function e(){return s()(this,e),l()(this,p()(e).apply(this,arguments))}return y()(e,t),c()(e,[{key:"render",value:function(){var t=this.props.getComponent,e=t("Container"),n=t("Row"),r=t("Col"),i=t("Topbar",!0),o=t("BaseLayout",!0),u=t("onlineValidatorBadge",!0);return v.a.createElement(e,{className:"swagger-ui"},i?v.a.createElement(i,null):null,v.a.createElement(o,null),v.a.createElement(n,null,v.a.createElement(r,null,v.a.createElement(u,null))))}}]),e}(v.a.Component)),M=n(13),_=n.n(M),m=n(5),L=n.n(m),b=n(170),j=n.n(b),x=n(6),N=function(t){function e(t,n){var r;return s()(this,e),r=l()(this,p()(e).call(this,t,n)),L()(_()(r),"onUrlChange",function(t){var e=t.target.value;r.setState({url:e})}),L()(_()(r),"loadSpec",function(t){r.props.specActions.updateUrl(t),r.props.specActions.download(t)}),L()(_()(r),"onUrlSelect",function(t){var e=t.target.value||t.target.href;r.loadSpec(e),r.setSelectedUrl(e),t.preventDefault()}),L()(_()(r),"downloadUrl",function(t){r.loadSpec(r.state.url),t.preventDefault()}),L()(_()(r),"setSearch",function(t){var e=Object(x.e)();e["urls.primaryName"]=t.name;var n="".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname);window&&window.history&&window.history.pushState&&window.history.replaceState(null,"","".concat(n,"?").concat(Object(x.f)(e)))}),L()(_()(r),"setSelectedUrl",function(t){var e=r.props.getConfigs().urls||[];e&&e.length&&t&&e.forEach(function(e,n){e.url===t&&(r.setState({selectedIndex:n}),r.setSearch(e))})}),L()(_()(r),"onFilterChange",function(t){var e=t.target.value;r.props.layoutActions.updateFilter(e)}),r.state={url:t.specSelectors.url(),selectedIndex:0},r}return y()(e,t),c()(e,[{key:"componentWillReceiveProps",value:function(t){this.setState({url:t.specSelectors.url()})}},{key:"componentDidMount",value:function(){var t=this,e=this.props.getConfigs(),n=e.urls||[];if(n&&n.length){var r=this.state.selectedIndex,i=e["urls.primaryName"];i&&n.forEach(function(e,n){e.name===i&&(t.setState({selectedIndex:n}),r=n)}),this.loadSpec(n[r].url)}}},{key:"render",value:function(){var t=this.props,e=t.getComponent,n=t.specSelectors,r=t.getConfigs,i=e("Button"),o=e("Link"),u="loading"===n.loadingStatus(),s={};"failed"===n.loadingStatus()&&(s.color="red"),u&&(s.color="#aaa");var a=r().urls,c=[],f=null;if(a){var l=[];a.forEach(function(t,e){l.push(v.a.createElement("option",{key:e,value:t.url},t.name))}),c.push(v.a.createElement("label",{className:"select-label",htmlFor:"select"},v.a.createElement("span",null,"Select a definition"),v.a.createElement("select",{id:"select",disabled:u,onChange:this.onUrlSelect,value:a[this.state.selectedIndex].url},l)))}else f=this.downloadUrl,c.push(v.a.createElement("input",{className:"download-url-input",type:"text",onChange:this.onUrlChange,value:this.state.url,disabled:u,style:s})),c.push(v.a.createElement(i,{className:"download-url-button",onClick:this.downloadUrl},"Explore"));return v.a.createElement("div",{className:"topbar"},v.a.createElement("div",{className:"wrapper"},v.a.createElement("div",{className:"topbar-wrapper"},v.a.createElement(o,null,v.a.createElement("img",{height:"40",src:j.a,alt:"Swagger UI"})),v.a.createElement("form",{className:"download-url-wrapper",onSubmit:f},c.map(function(t,e){return Object(w.cloneElement)(t,{key:e})})))))}}]),e}(v.a.Component),S=n(182),D=n.n(S),I=function(t,e){try{return D.a.safeLoad(t)}catch(t){return e&&e.errActions.newThrownErr(new Error(t)),{}}},E="configs_update",C="configs_toggle";function T(t,e){return{type:E,payload:L()({},t,e)}}function A(t){return{type:C,payload:t}}var O,z=function(){return function(){}},k=function(t){return function(e){return(0,e.fn.fetch)(t)}},Y=function(t,e){return function(n){var r=n.specActions;if(t)return r.downloadConfig(t).then(i,i);function i(n){n instanceof Error||n.status>=400?(r.updateLoadingStatus("failedConfig"),r.updateLoadingStatus("failedConfig"),r.updateUrl(""),console.error(n.statusText+" "+t.url),e(null)):e(I(n.text))}}},U=n(2),P=n.n(U),R=function(t,e){return t.getIn(P()(e)?e:[e])},Q=n(0),F=(O={},L()(O,E,function(t,e){return t.merge(Object(Q.fromJS)(e.payload))}),L()(O,C,function(t,e){var n=e.payload,r=t.get(n);return t.set(n,!r)}),O),B={getLocalConfig:function(){return I('---\nurl: "https://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://validator.swagger.io/validator"\n')}};e.default=[function(){return{components:{Topbar:N}}},function(){return{statePlugins:{spec:{actions:i,selectors:B},configs:{reducers:F,actions:r,selectors:o}}}},function(){return{components:{StandaloneLayout:g}}}]}]).default}); +//# sourceMappingURL=swagger-ui-standalone-preset.js.map \ No newline at end of file diff --git a/app/code/Magento/Swatches/Controller/Ajax/Media.php b/app/code/Magento/Swatches/Controller/Ajax/Media.php index 2d20b9a9a4b7e..93ee106139dcf 100644 --- a/app/code/Magento/Swatches/Controller/Ajax/Media.php +++ b/app/code/Magento/Swatches/Controller/Ajax/Media.php @@ -6,13 +6,19 @@ */ namespace Magento\Swatches\Controller\Ajax; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\ProductFactory; +use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\Controller\ResultFactory; +use Magento\PageCache\Model\Config; +use Magento\Swatches\Helper\Data; /** - * Class Media + * Provide product media data. */ -class Media extends \Magento\Framework\App\Action\Action implements \Magento\Framework\App\Action\HttpGetActionInterface +class Media extends Action implements HttpGetActionInterface { /** * @var \Magento\Catalog\Model\Product Factory @@ -37,9 +43,9 @@ class Media extends \Magento\Framework\App\Action\Action implements \Magento\Fra */ public function __construct( Context $context, - \Magento\Catalog\Model\ProductFactory $productModelFactory, - \Magento\Swatches\Helper\Data $swatchHelper, - \Magento\PageCache\Model\Config $config + ProductFactory $productModelFactory, + Data $swatchHelper, + Config $config ) { $this->productModelFactory = $productModelFactory; $this->swatchHelper = $swatchHelper; @@ -65,16 +71,18 @@ public function execute() $response = $this->getResponse(); if ($productId = (int)$this->getRequest()->getParam('product_id')) { + /** @var \Magento\Catalog\Api\Data\ProductInterface $product */ $product = $this->productModelFactory->create()->load($productId); - $productMedia = $this->swatchHelper->getProductMediaGallery( - $product - ); + $productMedia = []; + if ($product->getId() && $product->getStatus() == Status::STATUS_ENABLED) { + $productMedia = $this->swatchHelper->getProductMediaGallery($product); + } $resultJson->setHeader('X-Magento-Tags', implode(',', $product->getIdentities())); $response->setPublicHeaders($this->config->getTtl()); } - $resultJson->setData($productMedia); + return $resultJson; } } diff --git a/app/code/Magento/Swatches/Helper/Media.php b/app/code/Magento/Swatches/Helper/Media.php index 6787fba534893..2ea81f29e3a9f 100644 --- a/app/code/Magento/Swatches/Helper/Media.php +++ b/app/code/Magento/Swatches/Helper/Media.php @@ -176,7 +176,9 @@ public function moveImageFromTmp($file) } else { $this->mediaDirectory->renameFile( $this->mediaConfig->getTmpMediaPath($file), - $this->getAttributeSwatchPath($destinationFile) + $this->mediaDirectory->getDriver()->getRealPathSafety( + $this->getAttributeSwatchPath($destinationFile) + ) ); } @@ -197,7 +199,7 @@ protected function getUniqueFileName($file) $file ); } else { - $destFile = rtrim(dirname($file), '/.') . '/' . \Magento\MediaStorage\Model\File\Uploader::getNewFileName( + $destFile = dirname($file) . '/' . \Magento\MediaStorage\Model\File\Uploader::getNewFileName( $this->getOriginalFilePath($file) ); } diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml index 7647d3ec87a02..5b8691e55b3ae 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml @@ -43,9 +43,7 @@ <!-- Enable swatch tooltips --> <magentoCLI command="config:set catalog/frontend/show_swatch_tooltip 1" stepKey="disableTooltips"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterEnabling"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterEnabling"/> </after> <!-- Go to the edit page for the "color" attribute --> @@ -150,7 +148,7 @@ <!-- Disable swatch tooltips --> <magentoCLI command="config:set catalog/frontend/show_swatch_tooltip 0" stepKey="disableTooltips"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterDisabling"> - <argument name="tags" value=""/> + <argument name="tags" value="config full_page"/> </actionGroup> <!-- Verify swatch tooltips are not visible --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceCategoryPageTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceCategoryPageTest.xml index 576faed573fab..e5f9b70f1af69 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceCategoryPageTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceCategoryPageTest.xml @@ -19,7 +19,7 @@ </annotations> <!--Go to category page--> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="amOnConfigurableProductPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="amOnConfigurableProductPage"/> <waitForPageLoad stepKey="waitForConfigurableProductPage"/> <!--Verify that the minimum price is 10--> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml index b661ecb338bde..baa2bcb14759f 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml @@ -29,16 +29,13 @@ <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('3')}}" userInput="123456789012345678901" stepKey="fillSwatch3" after="clickAddSwatch3"/> <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('3')}}" userInput="123456789012345678901BrownD" stepKey="fillDescription3" after="fillSwatch3"/> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <see selector="{{StorefrontCategorySidebarSection.attributeNthOption(ProductAttributeFrontendLabel.label, '3')}}" userInput="123456789012345678901" stepKey="seeGreen" after="seeBlue"/> <see selector="{{StorefrontCategorySidebarSection.attributeNthOption(ProductAttributeFrontendLabel.label, '4')}}" userInput="123456789012345678901" stepKey="seeBrown" after="seeGreen"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage2"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage2"/> <waitForPageLoad stepKey="waitForCategoryPage2"/> <!-- Verify swatch2 is present and shown in full display text characters on storefront in the layered navigation --> @@ -47,7 +44,7 @@ <click selector="{{StorefrontCategorySidebarSection.attributeNthOption(ProductAttributeFrontendLabel.label, '2')}}" stepKey="filterBySwatch2"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage3"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage3"/> <waitForPageLoad stepKey="waitForCategoryPage3"/> <!-- Verify swatch3 is present and shown in full display text characters on storefront in the layered navigation --> @@ -56,7 +53,7 @@ <click selector="{{StorefrontCategorySidebarSection.attributeNthOption(ProductAttributeFrontendLabel.label, '3')}}" stepKey="filterBySwatch3"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage4"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage4"/> <waitForPageLoad stepKey="waitForCategoryPage4"/> <!-- Verify swatch4 is present and shown in full display text characters on storefront in the layered navigation --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml index 4ed8824d9e39b..201cd7d59104a 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml @@ -103,13 +103,10 @@ <argument name="image" value="TestImageAdobe"/> </actionGroup> - <!-- Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPage"/> <!-- Verify swatches are present in the layered navigation --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml index 4a78b4380fb68..0d28be1b94638 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml @@ -80,13 +80,10 @@ <argument name="attributeCode" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPage"/> <!-- Verify swatches are present in the layered navigation --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml index 2a986463a3d14..262d9fd7c4c4a 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml @@ -92,13 +92,10 @@ <argument name="attributeCode" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> - <!-- Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Go to the category page --> - <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPage"/> <!-- Verify swatches are present in the layered navigation --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml index 734294ba977ba..66b98a2660332 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml @@ -70,16 +70,11 @@ <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnGenerateProductsButton"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Select any option in the Layered navigation and verify product image--> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> <actionGroup ref="SelectStorefrontSideBarAttributeOption" stepKey="selectStorefrontProductAttributeOption"> <argument name="categoryName" value="$$createCategory.name$$"/> <argument name="attributeDefaultLabel" value="{{visualSwatchAttribute.default_label}}"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributeDisplayedInWidgetCMSTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributeDisplayedInWidgetCMSTest.xml new file mode 100644 index 0000000000000..897f7352a504c --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributeDisplayedInWidgetCMSTest.xml @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontSwatchAttributeDisplayedInWidgetCMSTest"> + <annotations> + <features value="Swatches"/> + <stories value="Swatches in CMS Widget"/> + <title value="Swatch Attribute is displayed in the Widget CMS"/> + <description value="Swatch Attribute is displayed in the Widget CMS"/> + <severity value="MAJOR"/> + <testCaseId value="MC-28607"/> + <group value="configurableProduct"/> + <group value="cms"/> + <group value="widget"/> + <group value="swatch"/> + <group value="WYSIWYGDisabled"/> + </annotations> + <before> + <!-- Create Configurable product --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!-- Create product swatch attribute with 1 variations --> + <createData entity="VisualSwatchProductAttributeForm" stepKey="createVisualSwatchAttribute"/> + <createData entity="SwatchProductAttributeOption1" stepKey="swatchAttributeOption"> + <requiredEntity createDataKey="createVisualSwatchAttribute"/> + </createData> + + <!-- Create CMS Page --> + <createData entity="_defaultCmsPage" stepKey="createCmsPage"/> + + <!-- Login to Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <!-- Open configurable product edit page --> + <amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct.id$)}}" stepKey="goToConfigurableProduct"/> + + <!-- Add attributes to configurable product--> + <conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.createConfigurations}}" visible="false" stepKey="openConfigurationSection"/> + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="openConfigurationPanel"/> + + <!-- Find Swatch attribute in grid and select it --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearAttributeGridFiltersToFindSwatchAttribute"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openFiltersPaneForSwatchAttribute"/> + <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="$createVisualSwatchAttribute.attribute_code$" stepKey="fillAttributeCodeFilterFieldForSwatchAttribute"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButtonForSwatchAttribute"/> + <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="selectSwatchAttribute"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToSelectOptions"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute($createVisualSwatchAttribute.frontend_label[0]$)}}" stepKey="selectAllSwatchAttributeOptions"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToApplyQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextToProceedToSummary"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickGenerateProductsButton"/> + + <!-- Save Product --> + <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> + + <!-- Reindex invalidated indices after product attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + + <!-- Open edit CMS Page --> + <actionGroup ref="AdminOpenCmsPageActionGroup" stepKey="openEditCmsPage"> + <argument name="page_id" value="$createCmsPage.id$"/> + </actionGroup> + + <conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CmsNewPagePageActionsSection.showHideEditor}}" visible="false" stepKey="expandContentSectionIfNotVisible"/> + <waitForPageLoad stepKey="waitForPageLoadContentSection"/> + <conditionalClick selector="{{CmsNewPagePageActionsSection.showHideEditor}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickNextShowHideEditorIfVisible"/> + + <!-- Insert Widget --> + <actionGroup ref="AdminInsertWidgetToCmsPageContentActionGroup" stepKey="insertWidgetToCmsPageContent"> + <argument name="widgetType" value="Catalog Products List"/> + </actionGroup> + <actionGroup ref="AdminFillCatalogProductsListWidgetCategoryActionGroup" stepKey="fillCatalogProductsListWidgetOptions"> + <argument name="categoryName" value="$createCategory.name$"/> + </actionGroup> + <actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidgetButton"/> + + <!-- Save CMS Page --> + <actionGroup ref="AdminSaveAndContinueEditCmsPageActionGroup" stepKey="saveCmsPage"/> + </before> + + <after> + <!-- Delete Category --> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <!-- Delete Configurable Product --> + <deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/> + <!-- Delete Attribute --> + <deleteData createDataKey="createVisualSwatchAttribute" stepKey="deleteVisualSwatchAttribute"/> + <!-- Delete CMS Page --> + <deleteData createDataKey="createCmsPage" stepKey="deleteCmsPage"/> + <!-- Reindex invalidated indices after product attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + <!-- Logout from Admin --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <conditionalClick selector="{{CmsNewPagePageSeoSection.header}}" dependentSelector="{{CmsNewPagePageSeoSection.urlKey}}" visible="false" stepKey="clickToExpandSeoSection"/> + <scrollTo selector="{{CmsNewPagePageSeoSection.urlKey}}" stepKey="scrollToUrlKey"/> + <grabValueFrom selector="{{CmsNewPagePageSeoSection.urlKey}}" stepKey="grabTextFromUrlKey"/> + + <!-- Open Storefront CMS page --> + <amOnPage url="{{StorefrontHomePage.url}}$grabTextFromUrlKey" stepKey="gotToCreatedCmsPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{StorefrontProductInfoMainSection.productSwatch($swatchAttributeOption.option[store_labels][0][label]$)}}" stepKey="seeAddedWidget"/> + </test> +</tests> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml index 77a16e639c8a4..05120d30f2db5 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml @@ -8,18 +8,18 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="StorefrontSwatchAttributesDisplayInWidgetCMSTest"> + <test name="StorefrontSwatchAttributesDisplayInWidgetCMSTest" deprecated="Use StorefrontSwatchAttributeDisplayedInWidgetCMSTest instead"> <annotations> <features value="ConfigurableProduct"/> <stories value="Swatches"/> - <title value="Swatch Attribute is not displayed in the Widget CMS"/> - <description value="Swatch Attribute is not displayed in the Widget CMS"/> + <title value="Deprecated. Swatch Attribute is not displayed in the Widget CMS"/> + <description value="Deprecated. Swatch Attribute is not displayed in the Widget CMS"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-96469"/> <useCaseId value="MAGETWO-96406"/> <group value="ConfigurableProduct"/> <skip> - <issueId value="MQE-1424" /> + <issueId value="DEPRECATED">Use StorefrontSwatchAttributeDisplayedInWidgetCMSTest instead</issueId> </skip> </annotations> diff --git a/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php b/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php index 6808b584b2a80..1dde78130d9b2 100644 --- a/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php @@ -9,6 +9,7 @@ namespace Magento\Swatches\Test\Unit\Controller\Ajax; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\Catalog\Model\ProductFactory; use Magento\Framework\App\Action\Context; use Magento\Framework\App\RequestInterface; @@ -60,6 +61,12 @@ class MediaTest extends TestCase /** @var ObjectManager|Media */ private $controller; + /** @var int */ + private $productId = 23; + + /** + * @inheridoc + */ protected function setUp(): void { $this->mediaGallery = [ @@ -107,23 +114,49 @@ protected function setUp(): void ); } - public function testExecute() + /** + * Prepare product mock for test execution. + * + * @return void + */ + private function prepareProductMock(): void { - $this->requestMock->expects($this->any())->method('getParam')->with('product_id')->willReturn(59); + $this->requestMock + ->expects($this->once()) + ->method('getParam') + ->with('product_id') + ->willReturn($this->productId); + $this->productModelFactoryMock + ->expects($this->once()) + ->method('create') + ->willReturn($this->productMock); $this->productMock ->expects($this->once()) ->method('load') - ->with(59) + ->with($this->productId) ->willReturn($this->productMock); $this->productMock ->expects($this->once()) ->method('getIdentities') ->willReturn(['tags']); + } - $this->productModelFactoryMock + /** + * Check that controller return media gallery for the product. + * + * @return void + */ + public function testExecute() + { + $this->prepareProductMock(); + $this->productMock ->expects($this->once()) - ->method('create') - ->willReturn($this->productMock); + ->method('getId') + ->willReturn($this->productId); + $this->productMock + ->expects($this->once()) + ->method('getStatus') + ->willReturn(Status::STATUS_ENABLED); $this->swatchHelperMock ->expects($this->once()) @@ -140,4 +173,55 @@ public function testExecute() $this->assertInstanceOf(Json::class, $result); } + + /** + * Check that controller does not crash while taking the non-existing product. + * + * @return void + */ + public function testExecuteNonExistingProduct() + { + $this->prepareProductMock(); + $this->productMock + ->expects($this->once()) + ->method('getId') + ->willReturn(null); + + $this->jsonMock + ->expects($this->once()) + ->method('setData') + ->with([])->willReturnSelf(); + + $result = $this->controller->execute(); + + $this->assertInstanceOf(Json::class, $result); + } + + /** + * Check that controller does not return media gallery for disabled product. + * + * @return void + */ + public function testExecuteDisabledProduct() + { + $this->prepareProductMock(); + $this->productMock + ->expects($this->once()) + ->method('getId') + ->willReturn($this->productId); + + $this->productMock + ->expects($this->once()) + ->method('getStatus') + ->willReturn(Status::STATUS_DISABLED); + + $this->jsonMock + ->expects($this->once()) + ->method('setData') + ->with([])->willReturnSelf(); + + $result = $this->controller->execute(); + + $this->assertInstanceOf(Json::class, $result); + } } diff --git a/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php b/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php index 9e9978b499150..da2454f35ff17 100644 --- a/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php @@ -14,6 +14,7 @@ use Magento\Framework\Filesystem\Directory\ReadInterface; use Magento\Framework\Filesystem\Directory\Write; use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Framework\Filesystem\DriverInterface; use Magento\Framework\Image; use Magento\Framework\Image\Factory; use Magento\Framework\ObjectManagerInterface; @@ -174,11 +175,20 @@ public function testMoveImageFromTmp() public function testMoveImageFromTmpNoDb() { $this->fileStorageDbMock->method('checkDbUsage')->willReturn(false); - $this->fileStorageDbMock->method('renameFile')->willReturnSelf(); $this->mediaDirectoryMock ->expects($this->atLeastOnce()) ->method('getAbsolutePath') ->willReturn('attribute/swatch/f/i/file.tmp'); + $this->mediaDirectoryMock + ->expects($this->atLeastOnce()) + ->method('renameFile') + ->willReturnSelf(); + $driver = $this->getMockBuilder(DriverInterface::class) + ->getMockForAbstractClass(); + $driver->method('getAbsolutePath')->willReturn('file'); + $this->mediaDirectoryMock + ->method('getDriver') + ->willReturn($driver); $result = $this->mediaHelperObject->moveImageFromTmp('file.tmp'); $this->assertNotNull($result); } diff --git a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml index d436dc8d1ef3a..2841b1861f849 100644 --- a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml +++ b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Text */ $stores = $block->getStoresSortedBySortOrder(); diff --git a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml index b7b1ab5fc5323..ef9659de7ff6b 100644 --- a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml +++ b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual */ $stores = $block->getStoresSortedBySortOrder(); diff --git a/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml b/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml index c8159f1a43fe3..5e70641e76876 100644 --- a/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml +++ b/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml @@ -15,6 +15,7 @@ <arguments> <argument name="configurable_view_model" xsi:type="object">Magento\Swatches\ViewModel\Product\Renderer\Configurable</argument> + <argument name="cache_lifetime" xsi:type="boolean">false</argument> </arguments> </block> </referenceBlock> diff --git a/app/code/Magento/SwatchesGraphQl/composer.json b/app/code/Magento/SwatchesGraphQl/composer.json index 1b98b4044a2ff..959f0f201d2b3 100644 --- a/app/code/Magento/SwatchesGraphQl/composer.json +++ b/app/code/Magento/SwatchesGraphQl/composer.json @@ -9,6 +9,9 @@ "magento/module-catalog": "*", "magento/module-catalog-graph-ql": "*" }, + "suggest": { + "magento/module-configurable-product-graph-ql": "*" + }, "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SwatchesGraphQl/etc/module.xml b/app/code/Magento/SwatchesGraphQl/etc/module.xml index 6689f13db754e..71c336a8cd257 100644 --- a/app/code/Magento/SwatchesGraphQl/etc/module.xml +++ b/app/code/Magento/SwatchesGraphQl/etc/module.xml @@ -10,6 +10,7 @@ <sequence> <module name="Magento_Catalog"/> <module name="Magento_Swatches"/> + <module name="Magento_ConfigurableProductGraphQl"/> </sequence> </module> </config> diff --git a/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls b/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls index c51468ccd2856..3491568108daf 100644 --- a/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls +++ b/app/code/Magento/SwatchesGraphQl/etc/schema.graphqls @@ -47,3 +47,7 @@ type TextSwatchData implements SwatchDataInterface { type ColorSwatchData implements SwatchDataInterface { } + +type ConfigurableProductOptionValue { + swatch: SwatchDataInterface @resolver(class: "Magento\\SwatchesGraphQl\\Model\\Resolver\\Product\\Options\\SwatchData") +} diff --git a/app/code/Magento/Tax/Model/TaxClass/Source/Product.php b/app/code/Magento/Tax/Model/TaxClass/Source/Product.php index 9cd08d1ee69d6..8dc6929a7b08e 100644 --- a/app/code/Magento/Tax/Model/TaxClass/Source/Product.php +++ b/app/code/Magento/Tax/Model/TaxClass/Source/Product.php @@ -36,8 +36,11 @@ class Product extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource protected $_optionFactory; /** - * Initialize dependencies. - * + * @var \Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory + */ + private $_classesFactory; + + /** * @param \Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory $classesFactory * @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\OptionFactory $optionFactory * @param \Magento\Tax\Api\TaxClassRepositoryInterface $taxClassRepository diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminAssertTaxRateInGridActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminAssertTaxRateInGridActionGroup.xml new file mode 100644 index 0000000000000..a8f11a7b5f642 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminAssertTaxRateInGridActionGroup.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertTaxRateInGridActionGroup"> + <annotations> + <description>Verifies the specified data is in the specified row on the the admin Tax Zones and Rates page.</description> + </annotations> + <arguments> + <argument name="taxIdentifier" defaultValue="{{US_CA_Rate_1.code}}" type="string"/> + <argument name="country" defaultValue="{{US_CA_Rate_1.tax_country}}" type="string"/> + <argument name="region" defaultValue="{{US_CA_Rate_1.tax_region}}" type="string"/> + <argument name="zip" defaultValue="{{US_CA_Rate_1.tax_postcode}}" type="string"/> + <argument name="rate" defaultValue="{{US_CA_Rate_1.rate}}" type="string"/> + <argument name="rowIndex" defaultValue="1" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminTaxRateGridSection.nthRow(rowIndex)}}" stepKey="waitForRow"/> + <see userInput="{{taxIdentifier}}" selector="{{AdminTaxRateGridSection.taxIdentifierByRow(rowIndex)}}" stepKey="seeTaxIdentifier"/> + <see userInput="{{country}}" selector="{{AdminTaxRateGridSection.countryByRow(rowIndex)}}" stepKey="seeCountry"/> + <see userInput="{{region}}" selector="{{AdminTaxRateGridSection.regionByRow(rowIndex)}}" stepKey="seeRegion"/> + <see userInput="{{zip}}" selector="{{AdminTaxRateGridSection.zipByRow(rowIndex)}}" stepKey="seeZip"/> + <see userInput="{{rate}}" selector="{{AdminTaxRateGridSection.rateByRow(rowIndex)}}" stepKey="seeRate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminDeleteMultipleTaxRatesActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminDeleteMultipleTaxRatesActionGroup.xml new file mode 100644 index 0000000000000..f472b5c1b9407 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminDeleteMultipleTaxRatesActionGroup.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminDeleteMultipleTaxRatesActionGroup"> + <annotations> + <description>Navigates to the 'Tax Zones and Rates' page and deletes all specified rows one by one. Defaults + to delete all rows except the defaults of 'US-CA-*-Rate 1' and 'US-NY-*-Rate 1'.</description> + </annotations> + <arguments> + <argument name="rowsToDelete" defaultValue="{{AdminTaxRateGridSection.allNonDefaultTaxRates}}" type="string"/> + <argument name="expectedRemainingRows" defaultValue="2" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="waitForResetFilter"/> + <click selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="clickResetFilter"/> + <waitForPageLoad stepKey="waitForGridReset"/> + <helper class="Magento\Tax\Test\Mftf\Helper\TaxHelpers" method="deleteAllSpecifiedTaxRuleRows" stepKey="deleteAllSpecifiedTaxRules"> + <argument name="rowsToDelete">{{rowsToDelete}}</argument> + <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> + <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> + <argument name="successMessage">You deleted the tax rate.</argument> + <argument name="successMessageContainer">{{AdminMessagesSection.success}}</argument> + </helper> + <waitForPageLoad stepKey="waitForGridLoad"/> + <seeNumberOfElements userInput="{{expectedRemainingRows}}" selector="{{AdminTaxRateGridSection.allRows}}" stepKey="seeExpectedFinalTotalRows"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup.xml new file mode 100644 index 0000000000000..1c2c72a661ce1 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup"> + <annotations> + <description>Fill the Filter By Tax Identifier field with taxRateCode.</description> + </annotations> + <arguments> + <argument name="taxRateCode" type="string"/> + </arguments> + + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCode}}" stepKey="fillNameFilter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml index cd416adbe3fff..bc6099790431f 100644 --- a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml +++ b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml @@ -7,30 +7,39 @@ --> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="SimpleTaxRate" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - </entity> - <entity name="defaultTaxRate" type="taxRate"> - <data key="code" unique="suffix">Tax Rate </data> - <data key="tax_country_id">US</data> - <data key="tax_region_id">12</data> - <data key="tax_postcode">*</data> - <data key="zip_is_range">0</data> - <data key="rate">10</data> - </entity> + <!-- These Tax Rates Are Installed by Default with Magento --> <entity name="US_CA_Rate_1" type="taxRate"> <data key="id">1</data> <data key="code">US-CA-*-Rate 1</data> <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> + <data key="tax_region_id">12</data> + <data key="tax_region">CA</data> <data key="tax_postcode">*</data> <data key="rate">8.2500</data> </entity> <entity name="US_NY_Rate_1" type="taxRate"> + <data key="id">2</data> <data key="code">US-NY-*-Rate 1</data> <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> + <data key="tax_region_id">43</data> + <data key="tax_region">NY</data> <data key="tax_postcode">*</data> <data key="rate">8.3750</data> - <data key="id">2</data> + </entity> + + <!-- Test Tax Rates --> + <entity name="SimpleTaxRate" type="taxRate"> + <data key="code" unique="suffix">TaxRate</data> + </entity> + <entity name="defaultTaxRate" type="taxRate"> + <data key="code" unique="suffix">Tax Rate </data> + <data key="tax_country_id">US</data> + <data key="tax_region_id">12</data> + <data key="tax_postcode">*</data> + <data key="zip_is_range">0</data> + <data key="rate">10</data> </entity> <entity name="taxRate_US_NY_8_1" type="taxRate"> <data key="code" unique="suffix">US-NY-*-</data> diff --git a/app/code/Magento/Tax/Test/Mftf/Helper/TaxHelpers.php b/app/code/Magento/Tax/Test/Mftf/Helper/TaxHelpers.php new file mode 100644 index 0000000000000..266da220da392 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Helper/TaxHelpers.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Tax\Test\Mftf\Helper; + +use Facebook\WebDriver\Remote\RemoteWebDriver as FacebookWebDriver; +use Facebook\WebDriver\WebDriverBy; +use Magento\FunctionalTestingFramework\Helper\Helper; +use Magento\FunctionalTestingFramework\Module\MagentoWebDriver; + +/** + * Class for MFTF helpers for Tax module. + */ +class TaxHelpers extends Helper +{ + /** + * Delete all specified Tax Rules one by one from the Tax Zones and Rates page. + * + * @param string $rowsToDelete + * @param string $deleteButton + * @param string $modalAcceptButton + * @param string $successMessage + * @param string $successMessageContainer + * + * @return void + */ + public function deleteAllSpecifiedTaxRuleRows( + string $rowsToDelete, + string $deleteButton, + string $modalAcceptButton, + string $successMessage, + string $successMessageContainer + ): void { + try { + /** @var MagentoWebDriver $webDriver */ + $magentoWebDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); + /** @var FacebookWebDriver $webDriver */ + $webDriver = $magentoWebDriver->webDriver; + + $magentoWebDriver->waitForPageLoad(30); + $rows = $webDriver->findElements(WebDriverBy::xpath($rowsToDelete)); + while (!empty($rows)) { + $rows[0]->click(); + $magentoWebDriver->waitForPageLoad(30); + $magentoWebDriver->waitForElementVisible($deleteButton, 10); + $magentoWebDriver->click($deleteButton); + $magentoWebDriver->waitForPageLoad(30); + $magentoWebDriver->waitForElementVisible($modalAcceptButton, 10); + $magentoWebDriver->click($modalAcceptButton); + $magentoWebDriver->waitForPageLoad(60); + $magentoWebDriver->waitForText($successMessage, 10, $successMessageContainer); + $rows = $webDriver->findElements(WebDriverBy::xpath($rowsToDelete)); + } + } catch (\Exception $exception) { + $this->fail($exception->getMessage()); + } + } +} diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml index ba9da182d735e..31316d4cc1a1a 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml @@ -15,7 +15,14 @@ <element name="filterByTaxIdentifier" type="input" selector="#tax_rate_grid_filter_code"/> <element name="filterByCountry" type="input" selector="#tax_rate_grid_filter_tax_country_id"/> <element name="filterByPostCode" type="input" selector="#tax_rate_grid_filter_tax_postcode"/> - <element name="nthRow" type="block" selector="tr[data-role='row']:nth-of-type({{var}})" parameterized="true" timeout="30"/> + <element name="allRows" type="block" selector="#tax_rate_grid_table tbody tr"/> + <element name="nthRow" type="block" parameterized="true" timeout="30" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}})"/> + <element name="taxIdentifierByRow" type="text" parameterized="true" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=code]"/> + <element name="countryByRow" type="text" parameterized="true" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=tax_country_id]"/> + <element name="regionByRow" type="text" parameterized="true" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=region_name]"/> + <element name="zipByRow" type="text" parameterized="true" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=tax_postcode]"/> + <element name="rateByRow" type="text" parameterized="true" selector="#tax_rate_grid_table tbody tr:nth-of-type({{rowIndex}}) [data-column=rate]"/> + <element name="allNonDefaultTaxRates" type="block" selector="//table[@id='tax_rate_grid_table']//tbody//tr//td[@data-column='code' and not(contains(.,'US-CA-*-Rate 1')) and not(contains(.,'US-NY-*-Rate 1'))]"/> <element name="emptyText" type="text" selector=".empty-text"/> </section> -</sections> \ No newline at end of file +</sections> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml index 7fa1daeb063ca..0ede3caacd867 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml @@ -44,7 +44,9 @@ <!-- Verify the tax rate grid page shows the tax rate we just created --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillNameFilter"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="Australia" stepKey="fillCountryFilter"/> <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="*" stepKey="fillPostCodeFilter"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> @@ -55,7 +57,9 @@ <!-- Go to the tax rate edit page for our new tax rate --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex3"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillNameFilter2"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml index e189e45483197..cb597273e36b6 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml @@ -46,7 +46,9 @@ <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <!-- Create a tax rate for large postcodes and verify we see expected values on the tax rate grid page --> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField2"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="France" stepKey="selectCountry2" /> <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="*" stepKey="seeTaxPostCode1"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml index 9a5566c2db881..46d3582681c56 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml @@ -46,7 +46,9 @@ <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <!-- Verify the tax rate grid page shows the specific postcode we just created --> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField2"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="Canada" stepKey="fillCountryFilter"/> <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="180" stepKey="fillPostCodeFilter"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml index 48217628b927a..f428aabddcf9a 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml @@ -46,7 +46,9 @@ <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <!-- Create a tax rate for zipCodeRange and verify we see expected values on the tax rate grid page --> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField2"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="United Kingdom" stepKey="selectCountry2" /> <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="1-7800935" stepKey="seeTaxPostCode1"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml index d237e52a60472..0e541b8939053 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml @@ -47,7 +47,9 @@ <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <!-- Create a tax rate for zipCodeRange and verify we see expected values on the tax rate grid page --> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField2"> + <argument name="taxRateCode" value="{{SimpleTaxRate.code}}"/> + </actionGroup> <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="United States" stepKey="selectCountry2" /> <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="90001-96162" stepKey="seeTaxPostCode1"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml index 3abdb45faf95a..5f288d55b5d05 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml @@ -37,7 +37,9 @@ <!-- Confirm Deleted TaxIdentifier(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{defaultTaxRate.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{defaultTaxRate.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <see selector="{{AdminTaxRateGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeSuccess"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml index f7d23baa534fb..5fc9b7c16294b 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml @@ -72,7 +72,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$simpleProduct1.sku$$.html" stepKey="goToSimpleProductPage"/> + <amOnPage url="$$simpleProduct1.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPage"/> <click stepKey="addSimpleProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml index e08d366a37cd8..73fd5c144d45a 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml @@ -72,7 +72,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$virtualProduct1.sku$$.html" stepKey="goToVirtualProductPage"/> + <amOnPage url="$$virtualProduct1.custom_attributes[url_key]$$.html" stepKey="goToVirtualProductPage"/> <waitForPageLoad stepKey="waitForVirtualProductPage"/> <click stepKey="addVirtualProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml index bab6b7c45ff60..20c7833c96015 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml @@ -86,7 +86,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$simpleProduct1.sku$$.html" stepKey="goToSimpleProductPage"/> + <amOnPage url="$$simpleProduct1.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPage"/> <click stepKey="addSimpleProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml index b29b1a127189e..4ce4d3920b16b 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml @@ -85,7 +85,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$virtualProduct1.sku$$.html" stepKey="goToVirtualProductPage"/> + <amOnPage url="$$virtualProduct1.custom_attributes[url_key]$$.html" stepKey="goToVirtualProductPage"/> <waitForPageLoad stepKey="waitForVirtualProductPage"/> <click stepKey="addVirtualProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml index d2f1b1aa44393..8c28fb36eb34e 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml @@ -72,7 +72,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$simpleProduct1.sku$$.html" stepKey="goToSimpleProductPage"/> + <amOnPage url="$$simpleProduct1.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPage"/> <click stepKey="addSimpleProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml index 5441664d7c530..ac012f36f74f9 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml @@ -72,7 +72,7 @@ </after> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$virtualProduct1.sku$$.html" stepKey="goToVirtualProductPage"/> + <amOnPage url="$$virtualProduct1.custom_attributes[url_key]$$.html" stepKey="goToVirtualProductPage"/> <waitForPageLoad stepKey="waitForVirtualProductPage"/> <click stepKey="addVirtualProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml index 03dafb07b6fd8..de7c346fa2b10 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml @@ -87,7 +87,7 @@ </actionGroup> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$simpleProduct1.sku$$.html" stepKey="goToSimpleProductPage"/> + <amOnPage url="$$simpleProduct1.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPage"/> <click stepKey="addSimpleProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml index c98765976f36f..a0a881f32a902 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml @@ -87,7 +87,7 @@ </actionGroup> <!-- Go to the created product page and add it to the cart --> - <amOnPage url="$$virtualProduct1.sku$$.html" stepKey="goToVirtualProductPage"/> + <amOnPage url="$$virtualProduct1.custom_attributes[url_key]$$.html" stepKey="goToVirtualProductPage"/> <waitForPageLoad stepKey="waitForVirtualProductPage"/> <click stepKey="addVirtualProductToCart" selector="{{StorefrontProductActionSection.addToCart}}"/> <waitForPageLoad stepKey="waitForProductAdded"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml index b102b4d945019..6f7ef59788f68 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml @@ -29,7 +29,9 @@ <!-- Search the tax rate on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -46,7 +48,9 @@ <!-- Verify we see updated 0.1 tax rate(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex4"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateFrance.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{taxRateCustomRateFrance.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated 0.1 tax rate on the tax rate form page --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml index 115a1df4631e5..c7663acf97a14 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml @@ -29,7 +29,9 @@ <!-- Search the tax rate on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -45,7 +47,9 @@ <!-- Verify we see updated TaxIdentifier(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex4"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateUS.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{taxRateCustomRateUS.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated values on the tax rate form page --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml index 5594cf58e7b21..5776925354e80 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml @@ -29,7 +29,9 @@ <!-- Search the tax identifier on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode1"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode1"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -46,7 +48,9 @@ <!-- Verify we see updated tax rate(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateUK.code}}" stepKey="fillTaxIdentifierField2"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField2"> + <argument name="taxRateCode" value="{{taxRateCustomRateUK.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated tax rate on the tax rate form page --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml index da531ea373aa1..c4449e5d6e5ad 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml @@ -29,7 +29,10 @@ <!-- Search the tax rate on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -45,7 +48,9 @@ <!-- Verify we see updated any region tax rate(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateCanada.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{taxRateCustomRateCanada.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated any region tax rate on the tax rate form page --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml index 717d9b9428267..2bac4ca2115c0 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml @@ -29,7 +29,9 @@ <!-- Search the tax rate on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -47,7 +49,9 @@ <!-- Verify we see updated tax rate(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex2"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{defaultTaxRateWithZipRange.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{defaultTaxRateWithZipRange.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated tax rate on the tax rate form page --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml index b664d334162ed..c808de2d7f10d 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml @@ -29,7 +29,10 @@ <!-- Search the tax rate on tax grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex1"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillCode"> + <argument name="taxRateCode" value="$$initialTaxRate.code$$"/> + </actionGroup> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> @@ -44,7 +47,9 @@ <!-- Verify we see updated large tax rate(from the above step) on the tax rate grid page --> <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRateIndex4"/> <actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{defaultTaxRateWithLargeRate.code}}" stepKey="fillTaxIdentifierField3"/> + <actionGroup ref="AdminFillTaxIdentifierFilterOnTaxRateGridActionGroup" stepKey="fillTaxIdentifierField3"> + <argument name="taxRateCode" value="{{defaultTaxRateWithLargeRate.code}}"/> + </actionGroup> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated large tax rate on the tax rate form page --> diff --git a/app/code/Magento/Tax/etc/config.xml b/app/code/Magento/Tax/etc/config.xml index afe7bd7861168..3c8206c63d50b 100644 --- a/app/code/Magento/Tax/etc/config.xml +++ b/app/code/Magento/Tax/etc/config.xml @@ -49,7 +49,7 @@ <zero_tax>0</zero_tax> </sales_display> <notification> - <info_url>https://docs.magento.com/m2/ce/user_guide/tax/warning-messages.html</info_url> + <info_url>https://docs.magento.com/user-guide/tax/warning-messages.html</info_url> </notification> </tax> </default> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesActionGroup.xml b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesActionGroup.xml new file mode 100644 index 0000000000000..36d0313ee5c88 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickExportTaxRatesActionGroup"> + <annotations> + <description>Clicks the 'Export Tax Rates' button.</description> + </annotations> + <waitForElementVisible selector="{{AdminImportExportTaxRatesSection.exportTaxRatesButton}}" stepKey="waitForExportTaxRates"/> + <click selector="{{AdminImportExportTaxRatesSection.exportTaxRatesButton}}" stepKey="clickExportTaxRates"/> + <waitForPageLoad stepKey="waitForExport"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesFromGridActionGroup.xml b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesFromGridActionGroup.xml new file mode 100644 index 0000000000000..68548d2f8b328 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminExportTaxRatesFromGridActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminExportTaxRatesFromGridActionGroup"> + <annotations> + <description>Selects the export file type and clicks the 'Export' button from the Tax Zones and Rates admin page.</description> + </annotations> + <arguments> + <argument name="fileType" defaultValue="CSV" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminTaxRateGridSection.exportFileType}}" stepKey="waitForExportFileTypeDropDown"/> + <selectOption userInput="{{fileType}}" selector="{{AdminTaxRateGridSection.exportFileType}}" stepKey="selectFileType"/> + <click selector="{{AdminTaxRateGridSection.exportButton}}" stepKey="clickExportButton"/> + <waitForPageLoad stepKey="waitForExport"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminImportTaxRatesActionGroup.xml b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminImportTaxRatesActionGroup.xml new file mode 100644 index 0000000000000..91cc0eea738e1 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminImportTaxRatesActionGroup.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminImportTaxRatesActionGroup"> + <annotations> + <description>Uploads the specified file and clicks the 'Import Tax Rates' button on the Import and Export Tax Rates page.</description> + </annotations> + <arguments> + <argument name="file" defaultValue="" type="string"/> + <argument name="resultMessageType" defaultValue="success" type="string"/> + <argument name="resultMessage" defaultValue="The tax rate has been imported." type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminImportExportTaxRatesSection.uploadFile}}" stepKey="waitForUploadFile"/> + <attachFile userInput="{{file}}" selector="{{AdminImportExportTaxRatesSection.uploadFile}}" stepKey="uploadFile"/> + <click selector="{{AdminImportExportTaxRatesSection.importTaxRatesButton}}" stepKey="clickImportTaxRates"/> + <waitForPageLoad stepKey="waitForImport"/> + <waitForText userInput="{{resultMessage}}" selector="{{AdminMessagesSection.messageByType(resultMessageType)}}" stepKey="waitForMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminNavigateImportExportTaxRatesActionGroup.xml b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminNavigateImportExportTaxRatesActionGroup.xml new file mode 100644 index 0000000000000..a5461dde000b9 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/ActionGroup/AdminNavigateImportExportTaxRatesActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminNavigateImportExportTaxRatesActionGroup"> + <annotations> + <description>Navigates to the admin System > Data Transfer > Import/Export Tax Rates page.</description> + </annotations> + <amOnPage url="{{AdminImportExportTaxRatesPage.url}}" stepKey="navigateToImportExportTaxRatesPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Data/ImportData.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Data/ImportData.xml new file mode 100644 index 0000000000000..04647b3737560 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Data/ImportData.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <!-- Tax Import Files --> + <entity name="import_tax_rates" type="taxImport"> + <data key="filename">import_tax_rates.csv</data> + </entity> + + <!-- Tax Rates --> + <entity name="import_rate_1" type="taxRate"> + <data key="code">import-rate-1</data> + <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> + <data key="tax_region_id">57</data> + <data key="tax_region">TX</data> + <data key="tax_postcode">78758</data> + <data key="zip_is_range">0</data> + <data key="rate">5.25</data> + </entity> + <entity name="import_rate_2" type="taxRate"> + <data key="code">import-rate-2</data> + <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> + <data key="tax_region_id">2</data> + <data key="tax_region">AK</data> + <data key="tax_postcode">12345-12346</data> + <data key="zip_is_range">1</data> + <data key="rate">7.75</data> + </entity> +</entities> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Page/AdminImportExportTaxRatesPage.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Page/AdminImportExportTaxRatesPage.xml new file mode 100644 index 0000000000000..340d8477b06ed --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Page/AdminImportExportTaxRatesPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminImportExportTaxRatesPage" url="tax/rate/importExport/" area="admin" module="Magento_TaxImportExport"> + <section name="AdminImportExportTaxRatesSection"/> + </page> +</pages> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminImportExportTaxRatesSection.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminImportExportTaxRatesSection.xml new file mode 100644 index 0000000000000..148b8cec3903a --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminImportExportTaxRatesSection.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminImportExportTaxRatesSection"> + <element name="uploadFile" type="input" selector="#import_rates_file"/> + <element name="importTaxRatesButton" type="button" selector="[title='Import Tax Rates']"/> + <element name="exportTaxRatesButtonForm" type="block" selector="#export_form"/> + <element name="exportTaxRatesButton" type="button" selector="#export_form [title='Export Tax Rates']"/> + </section> +</sections> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminTaxRateGridSection.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminTaxRateGridSection.xml new file mode 100644 index 0000000000000..174b610a00cd1 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Section/AdminTaxRateGridSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminTaxRateGridSection"> + <element name="exportFileType" type="select" selector="#tax_rate_grid_export"/> + <element name="exportFileTypeOption" type="select" parameterized="true" selector="//select[@id='tax_rate_grid_export']//option[.='{{option}}']"/> + <element name="exportButton" type="button" selector="#tax_rate_grid [title='Export']"/> + </section> +</sections> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminExportTaxRatesTest.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminExportTaxRatesTest.xml new file mode 100644 index 0000000000000..b83fe02f897a1 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminExportTaxRatesTest.xml @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminExportTaxRatesTest"> + <annotations> + <features value="TaxImportExport"/> + <stories value="Export"/> + <title value="Export Tax Rates"/> + <description value="Exports tax rates from the System > Data Transfer > Import/Export Tax Rates page, from + the Tax Rule page, from the Tax Rates grid page as a .csv, and from the Tax Rates grid page as an .xml. + Validates contents in downloaded file for each export area. Note that MFTF cannot simply click export and + have access to the file that is downloaded in the browser due to the test not having access to the server + that is running the test browser. Therefore, this test verifies that the Export button can be successfully + clicked, grabs the request URL from the Export button's form, executes the request on the magento machine + via a curl request, and verifies the contents of the exported file."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38621"/> + <group value="importExport"/> + <group value="tax"/> + </annotations> + + <before> + <!-- Create/Revert Seed Data --> + <createData entity="US_CA_Rate_1" stepKey="revertInitialTaxRateCA"/> + <createData entity="US_NY_Rate_1" stepKey="revertInitialTaxRateNY"/> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Logout --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Export Tax Rates & Validate Export from System > Data Transfer --> + <actionGroup ref="AdminNavigateImportExportTaxRatesActionGroup" stepKey="navigateToImportExportTaxRatesPage"/> + <actionGroup ref="AdminClickExportTaxRatesActionGroup" stepKey="exportTaxRates"/> + <grabAttributeFrom userInput="action" selector="{{AdminImportExportTaxRatesSection.exportTaxRatesButtonForm}}" stepKey="grabExportUrl"/> + <executeJS function="return window.FORM_KEY" stepKey="grabFormKey"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsCATaxRate"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey}"}</argument> + <argument name="expectedString">{{US_CA_Rate_1.code}}</argument> + </helper> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsNYTaxRate"> + <argument name="url">{$grabExportUrl}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey}"}</argument> + <argument name="expectedString">{{US_NY_Rate_1.code}}</argument> + </helper> + + <!-- Export Tax Rates & Validate Export from Tax Rule Page --> + <actionGroup ref="AdminGoToNewTaxRulePageActionGroup" stepKey="navigateToTaxRulePage"/> + <actionGroup ref="AdminClickExportTaxRatesActionGroup" stepKey="exportTaxRates2"/> + <grabAttributeFrom userInput="action" selector="{{AdminImportExportTaxRatesSection.exportTaxRatesButtonForm}}" stepKey="grabExportUrl2"/> + <executeJS function="return window.FORM_KEY" stepKey="grabFormKey2"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsCATaxRate2"> + <argument name="url">{$grabExportUrl2}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey2}"}</argument> + <argument name="expectedString">{{US_CA_Rate_1.code}}</argument> + </helper> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsNYTaxRate2"> + <argument name="url">{$grabExportUrl2}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey2}"}</argument> + <argument name="expectedString">{{US_NY_Rate_1.code}}</argument> + </helper> + + <!-- Export Tax Rates & Validate Export from Tax Rates Grid Page as CSV --> + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesGridPage"/> + <actionGroup ref="AdminExportTaxRatesFromGridActionGroup" stepKey="exportTaxRatesCSV"/> + <grabAttributeFrom userInput="value" selector="{{AdminTaxRateGridSection.exportFileTypeOption('CSV')}}" stepKey="grabExportUrl3"/> + <executeJS function="return window.FORM_KEY" stepKey="grabFormKey3"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsCATaxRate3"> + <argument name="url">{$grabExportUrl3}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey3}"}</argument> + <argument name="expectedString">{{US_CA_Rate_1.code}}</argument> + </helper> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsNYTaxRate3"> + <argument name="url">{$grabExportUrl3}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey3}"}</argument> + <argument name="expectedString">{{US_NY_Rate_1.code}}</argument> + </helper> + + <!-- Export Tax Rates & Validate Export from Tax Rates Grid Page as XML --> + <actionGroup ref="AdminExportTaxRatesFromGridActionGroup" stepKey="exportTaxRatesXML"> + <argument name="fileType" value="Excel XML"/> + </actionGroup> + <grabAttributeFrom userInput="value" selector="{{AdminTaxRateGridSection.exportFileTypeOption('Excel XML')}}" stepKey="grabExportUrl4"/> + <executeJS function="return window.FORM_KEY" stepKey="grabFormKey4"/> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsCATaxRate4"> + <argument name="url">{$grabExportUrl4}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey4}"}</argument> + <argument name="expectedString">{{US_CA_Rate_1.code}}</argument> + </helper> + <helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertExportedFileContainsNYTaxRate4"> + <argument name="url">{$grabExportUrl4}</argument> + <argument name="postBody">{"form_key": "{$grabFormKey4}"}</argument> + <argument name="expectedString">{{US_NY_Rate_1.code}}</argument> + </helper> + </test> +</tests> diff --git a/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminImportTaxRatesTest.xml b/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminImportTaxRatesTest.xml new file mode 100644 index 0000000000000..075b7a5d06625 --- /dev/null +++ b/app/code/Magento/TaxImportExport/Test/Mftf/Test/AdminImportTaxRatesTest.xml @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminImportTaxRatesTest"> + <annotations> + <features value="TaxImportExport"/> + <stories value="Import"/> + <title value="Import and Update Tax Rates"/> + <description value="Imports tax rates from the System > Data Transfer > Import/Export Tax Rates page and + from the Tax Rule page, to create new tax rates and update existing tax rates. Verifies results on the Tax + Rates grid page."/> + <severity value="MAJOR"/> + <testCaseId value="MC-38621"/> + <group value="importExport"/> + <group value="tax"/> + </annotations> + + <before> + <!-- Create/Revert Seed Data --> + <createData entity="US_CA_Rate_1" stepKey="revertInitialTaxRateCA"/> + <createData entity="US_NY_Rate_1" stepKey="revertInitialTaxRateNY"/> + + <!-- Login as Admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <!-- Delete/Revert Data --> + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesPage"/> + <createData entity="US_CA_Rate_1" stepKey="revertInitialTaxRateCA"/> + <createData entity="US_NY_Rate_1" stepKey="revertInitialTaxRateNY"/> + <actionGroup ref="AdminDeleteMultipleTaxRatesActionGroup" stepKey="deleteAllNonDefaultTaxRates"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Import Tax Rates from System > Data Transfer --> + <actionGroup ref="AdminNavigateImportExportTaxRatesActionGroup" stepKey="navigateToImportExportTaxRatesPage"/> + <actionGroup ref="AdminImportTaxRatesActionGroup" stepKey="importTaxRates"> + <argument name="file" value="{{import_tax_rates.filename}}"/> + </actionGroup> + + <!-- Verify Imported Tax Rates --> + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesPage"/> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridCA"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{US_CA_Rate_1.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowCA"> + <argument name="taxIdentifier" value="{{US_CA_Rate_1.code}}"/> + <argument name="country" value="{{US_CA_Rate_1.tax_country}}"/> + <argument name="region" value="{{US_CA_Rate_1.tax_region}}"/> + <argument name="zip" value="{{US_CA_Rate_1.tax_postcode}}"/> + <argument name="rate" value="10.25"/> + </actionGroup> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridImport1"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{import_rate_1.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowImport1"> + <argument name="taxIdentifier" value="{{import_rate_1.code}}"/> + <argument name="country" value="{{import_rate_1.tax_country}}"/> + <argument name="region" value="{{import_rate_1.tax_region}}"/> + <argument name="zip" value="{{import_rate_1.tax_postcode}}"/> + <argument name="rate" value="{{import_rate_1.rate}}"/> + </actionGroup> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridImport2"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{import_rate_2.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowImport2"> + <argument name="taxIdentifier" value="{{import_rate_2.code}}"/> + <argument name="country" value="{{import_rate_2.tax_country}}"/> + <argument name="region" value="{{import_rate_2.tax_region}}"/> + <argument name="zip" value="{{import_rate_2.tax_postcode}}"/> + <argument name="rate" value="{{import_rate_2.rate}}"/> + </actionGroup> + + <!-- Delete/Revert Data --> + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesPage2"/> + <createData entity="US_CA_Rate_1" stepKey="revertInitialTaxRateCA"/> + <createData entity="US_NY_Rate_1" stepKey="revertInitialTaxRateNY"/> + <actionGroup ref="AdminDeleteMultipleTaxRatesActionGroup" stepKey="deleteAllNonDefaultTaxRates"/> + + <!-- Import Tax Rates from Tax Rule Page --> + <actionGroup ref="AdminGoToNewTaxRulePageActionGroup" stepKey="navigateToTaxRulePage"/> + <actionGroup ref="AdminImportTaxRatesActionGroup" stepKey="importTaxRates2"> + <argument name="file" value="{{import_tax_rates.filename}}"/> + </actionGroup> + + <!-- Verify Imported Tax Rates --> + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="navigateToTaxRatesPage3"/> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridCA2"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{US_CA_Rate_1.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowCA2"> + <argument name="taxIdentifier" value="{{US_CA_Rate_1.code}}"/> + <argument name="country" value="{{US_CA_Rate_1.tax_country}}"/> + <argument name="region" value="{{US_CA_Rate_1.tax_region}}"/> + <argument name="zip" value="{{US_CA_Rate_1.tax_postcode}}"/> + <argument name="rate" value="10.25"/> + </actionGroup> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridImport3"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{import_rate_1.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowImport3"> + <argument name="taxIdentifier" value="{{import_rate_1.code}}"/> + <argument name="country" value="{{import_rate_1.tax_country}}"/> + <argument name="region" value="{{import_rate_1.tax_region}}"/> + <argument name="zip" value="{{import_rate_1.tax_postcode}}"/> + <argument name="rate" value="{{import_rate_1.rate}}"/> + </actionGroup> + <actionGroup ref="AdminFilterLegacyGridActionGroup" stepKey="filterGridImport4"> + <argument name="field" value="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('code')}}"/> + <argument name="value" value="{{import_rate_2.code}}"/> + </actionGroup> + <actionGroup ref="AdminAssertTaxRateInGridActionGroup" stepKey="verifyTaxRateRowImport4"> + <argument name="taxIdentifier" value="{{import_rate_2.code}}"/> + <argument name="country" value="{{import_rate_2.tax_country}}"/> + <argument name="region" value="{{import_rate_2.tax_region}}"/> + <argument name="zip" value="{{import_rate_2.tax_postcode}}"/> + <argument name="rate" value="{{import_rate_2.rate}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php index 40bbc8f51d20f..fd8b2f91e164f 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php @@ -6,15 +6,54 @@ */ namespace Magento\Theme\Controller\Adminhtml\System\Design\Theme; +use Magento\Backend\App\Action\Context; +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\App\Response\Http\FileFactory; use Magento\Framework\App\ResponseInterface; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Escaper; +use Magento\Framework\Filesystem; +use Magento\Framework\Registry; +use Magento\Framework\Url\DecoderInterface; +use Magento\Framework\View\Asset\Repository; +use Magento\Framework\View\Design\ThemeInterface; +use Magento\Theme\Controller\Adminhtml\System\Design\Theme; +use Psr\Log\LoggerInterface; /** - * Class DownloadCss + * Class for Download Css. * @deprecated 100.2.0 + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.Superglobals) */ -class DownloadCss extends \Magento\Theme\Controller\Adminhtml\System\Design\Theme +class DownloadCss extends Theme implements HttpGetActionInterface { + /** + * @var Escaper + */ + private $escaper; + + /** + * DownloadCss constructor. + * @param Context $context + * @param Registry $coreRegistry + * @param FileFactory $fileFactory + * @param Repository $assetRepo + * @param Filesystem $appFileSystem + * @param Escaper|null $escaper + */ + public function __construct( + Context $context, + Registry $coreRegistry, + FileFactory $fileFactory, + Repository $assetRepo, + Filesystem $appFileSystem, + Escaper $escaper = null + ) { + $this->escaper = $escaper ?? $context->getObjectManager()->get(Escaper::class); + parent::__construct($context, $coreRegistry, $fileFactory, $assetRepo, $appFileSystem); + } + /** * Download css file * @@ -25,20 +64,19 @@ public function execute() $themeId = $this->getRequest()->getParam('theme_id'); $file = $this->getRequest()->getParam('file'); - /** @var $urlDecoder \Magento\Framework\Url\DecoderInterface */ - $urlDecoder = $this->_objectManager->get(\Magento\Framework\Url\DecoderInterface::class); + /** @var $urlDecoder DecoderInterface */ + $urlDecoder = $this->_objectManager->get(DecoderInterface::class); $fileId = $urlDecoder->decode($file); try { - /** @var $theme \Magento\Framework\View\Design\ThemeInterface */ - $theme = $this->_objectManager->create( - \Magento\Framework\View\Design\ThemeInterface::class - )->load($themeId); + /** @var $theme ThemeInterface */ + $theme = $this->_objectManager->create(ThemeInterface::class)->load($themeId); if (!$theme->getId()) { - throw new \InvalidArgumentException(sprintf('Theme not found: "%1".', $themeId)); + throw new \InvalidArgumentException(sprintf('Theme not found: "%d".', $themeId)); } $asset = $this->_assetRepo->createAsset($fileId, ['themeModel' => $theme]); $relPath = $this->_appFileSystem->getDirectoryRead(DirectoryList::ROOT) ->getRelativePath($asset->getSourceFile()); + return $this->_fileFactory->create( $relPath, [ @@ -47,10 +85,14 @@ public function execute() ], DirectoryList::ROOT ); + } catch (\InvalidArgumentException $e) { + $this->messageManager->addException($e, __('Theme not found: "%1".', $this->escaper->escapeHtml($themeId))); + $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); + $this->_objectManager->get(LoggerInterface::class)->critical($e); } catch (\Exception $e) { - $this->messageManager->addException($e, __('File not found: "%1".', $fileId)); + $this->messageManager->addException($e, __('File not found: "%1".', $this->escaper->escapeHtml($fileId))); $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); - $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + $this->_objectManager->get(LoggerInterface::class)->critical($e); } } } diff --git a/app/code/Magento/Theme/Controller/Result/MessagePlugin.php b/app/code/Magento/Theme/Controller/Result/MessagePlugin.php index 10cba6e869030..e8b50d9cfc5dd 100644 --- a/app/code/Magento/Theme/Controller/Result/MessagePlugin.php +++ b/app/code/Magento/Theme/Controller/Result/MessagePlugin.php @@ -134,6 +134,7 @@ private function setCookie(array $messages) $publicCookieMetadata->setDurationOneYear(); $publicCookieMetadata->setPath('/'); $publicCookieMetadata->setHttpOnly(false); + $publicCookieMetadata->setSameSite('Strict'); $this->cookieManager->setPublicCookie( self::MESSAGES_COOKIES_NAME, diff --git a/app/code/Magento/Theme/Model/Design.php b/app/code/Magento/Theme/Model/Design.php index ddd4894f4e875..11cef8a3938e0 100644 --- a/app/code/Magento/Theme/Model/Design.php +++ b/app/code/Magento/Theme/Model/Design.php @@ -111,6 +111,8 @@ public function loadChange($storeId, $date = null) $date = $this->_dateTime->formatDate($this->_localeDate->scopeTimeStamp($storeId), false); } + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $changeCacheId = 'design_change_' . md5($storeId . $date); $result = $this->_cacheManager->load($changeCacheId); if ($result === false) { diff --git a/app/code/Magento/Theme/Model/Indexer/Design/Config.php b/app/code/Magento/Theme/Model/Indexer/Design/Config.php index 43b58257b343c..94aa948a9122d 100644 --- a/app/code/Magento/Theme/Model/Indexer/Design/Config.php +++ b/app/code/Magento/Theme/Model/Indexer/Design/Config.php @@ -56,6 +56,11 @@ class Config implements ActionInterface */ protected $handlerPool; + /** + * @var array + */ + private $data = []; + /** * Config constructor * diff --git a/app/code/Magento/Theme/Model/View/Design.php b/app/code/Magento/Theme/Model/View/Design.php index 98f7665400dd8..f45b6b233a6a5 100644 --- a/app/code/Magento/Theme/Model/View/Design.php +++ b/app/code/Magento/Theme/Model/View/Design.php @@ -73,6 +73,11 @@ class Design implements \Magento\Framework\View\DesignInterface */ protected $_appState; + /** + * @var array + */ + private $_themes; + /** * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\View\Design\Theme\FlyweightFactory $flyweightFactory diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml index fbe1d5ac936d7..6895e167e206a 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml @@ -10,15 +10,12 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminWatermarkUploadTest"> <annotations> - <features value="Watermark"/> + <features value="Theme"/> <stories value="Watermark"/> - <title value="MAGETWO-95934: Can't upload Watermark Image"/> + <title value="Can't upload Watermark Image"/> <description value="Watermark images should be able to be uploaded in the admin"/> <severity value="MAJOR"/> - <testCaseId value="MC-5796"/> - <skip> - <issueId value="MC-18496"/> - </skip> + <testCaseId value="MC-25636"/> <group value="Watermark"/> </annotations> <before> diff --git a/app/code/Magento/Theme/Test/Unit/Block/Adminhtml/Design/Config/Edit/SaveButtonTest.php b/app/code/Magento/Theme/Test/Unit/Block/Adminhtml/Design/Config/Edit/SaveButtonTest.php index b7f2def1c0fbd..2a92be231cbf9 100644 --- a/app/code/Magento/Theme/Test/Unit/Block/Adminhtml/Design/Config/Edit/SaveButtonTest.php +++ b/app/code/Magento/Theme/Test/Unit/Block/Adminhtml/Design/Config/Edit/SaveButtonTest.php @@ -17,6 +17,9 @@ class SaveButtonTest extends TestCase */ protected $block; + /** + * @inheritDoc + */ protected function setUp(): void { $this->block = new SaveButton(); diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php index b3dc485293e94..fadaa1a69278d 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php @@ -14,6 +14,7 @@ use Magento\Framework\App\Response\RedirectInterface; use Magento\Framework\App\ResponseInterface; use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\Escaper; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\ReadInterface; use Magento\Framework\Message\ManagerInterface; @@ -88,6 +89,11 @@ class DownloadCssTest extends TestCase */ protected $controller; + /** + * @var Escaper|MockObject + */ + private $escaperMock; + protected function setUp(): void { $context = $this->getMockBuilder(Context::class) @@ -139,6 +145,9 @@ protected function setUp(): void $this->filesystem = $this->getMockBuilder(Filesystem::class) ->disableOriginalConstructor() ->getMock(); + $this->escaperMock = $this->getMockBuilder(Escaper::class) + ->disableOriginalConstructor() + ->getMock(); /** @var Context $context */ $this->controller = new DownloadCss( @@ -146,7 +155,8 @@ protected function setUp(): void $this->registry, $this->fileFactory, $this->repository, - $this->filesystem + $this->filesystem, + $this->escaperMock ); } @@ -274,6 +284,7 @@ public function testExecuteInvalidArgument() $this->response->expects($this->once()) ->method('setRedirect') ->with($refererUrl); + $this->escaperMock->expects($this->once())->method('escapeHtml')->with($themeId)->willReturn($themeId); $this->controller->execute(); } diff --git a/app/code/Magento/Theme/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Theme/Test/Unit/Model/ConfigTest.php index c3c3c5d771604..95032a40877a1 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/ConfigTest.php @@ -100,7 +100,6 @@ protected function tearDown(): void { $this->_themeMock = null; $this->_configData = null; - $this->_themeFactoryMock = null; $this->_configCacheMock = null; $this->_layoutCacheMock = null; $this->_model = null; diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/DataTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/DataTest.php index fa6e51ecdf27f..9f20fb77d7b71 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/DataTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/DataTest.php @@ -17,6 +17,7 @@ use Magento\Theme\Model\Config\Customization; use Magento\Theme\Model\ResourceModel\Theme\Collection; use Magento\Theme\Model\Theme\Data; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; /** @@ -29,43 +30,46 @@ class DataTest extends TestCase */ protected $model; + /** + * @inheritDoc + */ protected function setUp(): void { $customizationConfig = $this->createMock(Customization::class); - $this->customizationFactory = $this->createPartialMock( + $customizationFactory = $this->createPartialMock( \Magento\Framework\View\Design\Theme\CustomizationFactory::class, ['create'] ); - $this->resourceCollection = $this->createMock(Collection::class); - $this->_imageFactory = $this->createPartialMock( + $resourceCollection = $this->createMock(Collection::class); + $imageFactory = $this->createPartialMock( ImageFactory::class, ['create'] ); - $this->themeFactory = $this->createPartialMock( + $themeFactory = $this->createPartialMock( FlyweightFactory::class, ['create'] ); - $this->domainFactory = $this->createPartialMock( + $domainFactory = $this->createPartialMock( Factory::class, ['create'] ); - $this->themeModelFactory = $this->createPartialMock(\Magento\Theme\Model\ThemeFactory::class, ['create']); - $this->validator = $this->createMock(Validator::class); - $this->appState = $this->createMock(State::class); + $themeModelFactory = $this->createPartialMock(\Magento\Theme\Model\ThemeFactory::class, ['create']); + $validator = $this->createMock(Validator::class); + $appState = $this->createMock(State::class); $objectManagerHelper = new ObjectManager($this); $arguments = $objectManagerHelper->getConstructArguments( Data::class, [ - 'customizationFactory' => $this->customizationFactory, + 'customizationFactory' => $customizationFactory, 'customizationConfig' => $customizationConfig, - 'imageFactory' => $this->_imageFactory, - 'resourceCollection' => $this->resourceCollection, - 'themeFactory' => $this->themeFactory, - 'domainFactory' => $this->domainFactory, - 'validator' => $this->validator, - 'appState' => $this->appState, - 'themeModelFactory' => $this->themeModelFactory + 'imageFactory' => $imageFactory, + 'resourceCollection' => $resourceCollection, + 'themeFactory' => $themeFactory, + 'domainFactory' => $domainFactory, + 'validator' => $validator, + 'appState' => $appState, + 'themeModelFactory' => $themeModelFactory ] ); diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/Image/PathTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/Image/PathTest.php index c06bb6a4f4a3d..79e7a1139511b 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/Image/PathTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/Image/PathTest.php @@ -50,6 +50,9 @@ class PathTest extends TestCase */ protected $mediaDirectory; + /** + * @inheritDoc + */ protected function setUp(): void { $this->filesystem = $this->createMock(Filesystem::class); @@ -71,8 +74,6 @@ protected function setUp(): void $this->_assetRepo, $this->_storeManager ); - - $this->_model = new Path($this->filesystem, $this->_assetRepo, $this->_storeManager); } public function testGetPreviewImageUrl() diff --git a/app/code/Magento/Theme/Test/Unit/ViewModel/Block/Html/Header/LogoSizeResolverTest.php b/app/code/Magento/Theme/Test/Unit/ViewModel/Block/Html/Header/LogoSizeResolverTest.php new file mode 100644 index 0000000000000..9f6d5b08a7b91 --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/ViewModel/Block/Html/Header/LogoSizeResolverTest.php @@ -0,0 +1,81 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Theme\Test\Unit\ViewModel\Block\Html\Header; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Theme\ViewModel\Block\Html\Header\LogoSizeResolver; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test logo size resolver view model + */ +class LogoSizeResolverTest extends TestCase +{ + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfig; + + /** + * @var LogoSizeResolver + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->scopeConfig = $this->createMock(ScopeConfigInterface::class); + $this->model = new LogoSizeResolver($this->scopeConfig); + } + + /** + * @param string|null $configValue + * @param int|null $expectedValue + * @dataProvider configValueDataProvider + */ + public function testGetWidth(?string $configValue, ?int $expectedValue): void + { + $storeId = 1; + $this->scopeConfig->method('getValue') + ->with('design/header/logo_width', ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($configValue); + $this->assertEquals($expectedValue, $this->model->getWidth($storeId)); + } + + /** + * @param string|null $configValue + * @param int|null $expectedValue + * @dataProvider configValueDataProvider + */ + public function testGetHeight(?string $configValue, ?int $expectedValue): void + { + $storeId = 1; + $this->scopeConfig->method('getValue') + ->with('design/header/logo_height', ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($configValue); + $this->assertEquals($expectedValue, $this->model->getHeight($storeId)); + } + + /** + * @return array + */ + public function configValueDataProvider(): array + { + return [ + [null, null], + ['', null], + ['0', 0], + ['180', 180], + ]; + } +} diff --git a/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolver.php b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolver.php new file mode 100644 index 0000000000000..24d7fa3f7ab95 --- /dev/null +++ b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolver.php @@ -0,0 +1,75 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Theme\ViewModel\Block\Html\Header; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\View\Element\Block\ArgumentInterface; +use Magento\Store\Model\ScopeInterface; + +/** + * Logo size resolver view model + */ +class LogoSizeResolver implements LogoSizeResolverInterface, ArgumentInterface +{ + /** + * Logo width config path + */ + private const XML_PATH_DESIGN_HEADER_LOGO_WIDTH = 'design/header/logo_width'; + + /** + * Logo height config path + */ + private const XML_PATH_DESIGN_HEADER_LOGO_HEIGHT = 'design/header/logo_height'; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @param ScopeConfigInterface $scopeConfig + */ + public function __construct( + ScopeConfigInterface $scopeConfig + ) { + $this->scopeConfig = $scopeConfig; + } + + /** + * @inheritdoc + */ + public function getWidth(?int $storeId = null): ?int + { + return $this->getConfig(self::XML_PATH_DESIGN_HEADER_LOGO_WIDTH, $storeId); + } + + /** + * @inheritdoc + */ + public function getHeight(?int $storeId = null): ?int + { + return $this->getConfig(self::XML_PATH_DESIGN_HEADER_LOGO_HEIGHT, $storeId); + } + + /** + * Get config value + * + * @param string $path + * @param int|null $storeId + * @return int|null + */ + private function getConfig(string $path, ?int $storeId = null): ?int + { + $value = $this->scopeConfig->getValue( + $path, + ScopeInterface::SCOPE_STORE, + $storeId + ); + return $value === null ? null : (int) $value; + } +} diff --git a/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolverInterface.php b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolverInterface.php new file mode 100644 index 0000000000000..4889aff74fd9b --- /dev/null +++ b/app/code/Magento/Theme/ViewModel/Block/Html/Header/LogoSizeResolverInterface.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Theme\ViewModel\Block\Html\Header; + +/** + * Interface for resolving logo size + */ +interface LogoSizeResolverInterface +{ + /** + * Return configured logo width + * + * @param int|null $storeId + * @return null|int + */ + public function getWidth(?int $storeId = null): ?int; + + /** + * Return configured logo height + * + * @param int|null $storeId + * @return null|int + */ + public function getHeight(?int $storeId = null): ?int; +} diff --git a/app/code/Magento/Theme/etc/frontend/di.xml b/app/code/Magento/Theme/etc/frontend/di.xml index 35eb9d4f8b53c..f0b7f19911e12 100644 --- a/app/code/Magento/Theme/etc/frontend/di.xml +++ b/app/code/Magento/Theme/etc/frontend/di.xml @@ -27,7 +27,7 @@ <plugin name="result-messages" type="Magento\Theme\Controller\Result\MessagePlugin"/> </type> <type name="Magento\Framework\View\Result\Layout"> - <plugin name="asyncCssLoad" type="Magento\Theme\Controller\Result\AsyncCssPlugin" /> + <plugin name="asyncCssLoad" type="Magento\Theme\Controller\Result\AsyncCssPlugin" sortOrder="-20" /> <plugin name="deferJsToFooter" type="Magento\Theme\Controller\Result\JsFooterPlugin" sortOrder="-10" /> </type> <type name="Magento\Theme\Block\Html\Header\CriticalCss"> diff --git a/app/code/Magento/Theme/view/adminhtml/templates/browser/content/uploader.phtml b/app/code/Magento/Theme/view/adminhtml/templates/browser/content/uploader.phtml index 66456ae403818..1e23c7aadc46a 100644 --- a/app/code/Magento/Theme/view/adminhtml/templates/browser/content/uploader.phtml +++ b/app/code/Magento/Theme/view/adminhtml/templates/browser/content/uploader.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var $block \Magento\Theme\Block\Adminhtml\Wysiwyg\Files\Content\Uploader */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> diff --git a/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml b/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml index e15ac4a088e03..1d2948398e7ce 100644 --- a/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml +++ b/app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** * @var $block \Magento\Backend\Block\Widget\Form\Renderer\Fieldset * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer diff --git a/app/code/Magento/Theme/view/frontend/layout/default.xml b/app/code/Magento/Theme/view/frontend/layout/default.xml index f3e57b12150c9..933d4e588787c 100644 --- a/app/code/Magento/Theme/view/frontend/layout/default.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default.xml @@ -54,6 +54,7 @@ <block class="Magento\Theme\Block\Html\Header\Logo" name="logo"> <arguments> <argument name="logoPathResolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolver</argument> + <argument name="logo_size_resolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoSizeResolver</argument> </arguments> </block> </container> diff --git a/app/code/Magento/Theme/view/frontend/templates/html/header.phtml b/app/code/Magento/Theme/view/frontend/templates/html/header.phtml index cbefb82f23e33..c59ca42f50602 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/header.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/header.phtml @@ -6,6 +6,7 @@ /** * @var \Magento\Theme\Block\Html\Header $block + * @var \Magento\Framework\Escaper $escaper */ $welcomeMessage = $block->getWelcome(); ?> @@ -13,12 +14,12 @@ $welcomeMessage = $block->getWelcome(); <li class="greet welcome" data-bind="scope: 'customer'"> <!-- ko if: customer().fullname --> <span class="logged-in" - data-bind="text: new String('<?= $block->escapeHtml(__('Welcome, %1!', '%1')) ?>').replace('%1', customer().fullname)"> + data-bind="text: new String('<?= $escaper->escapeHtml(__('Welcome, %1!', '%1')) ?>').replace('%1', customer().fullname)"> </span> <!-- /ko --> <!-- ko ifnot: customer().fullname --> <span class="not-logged-in" - data-bind='html:"<?= $block->escapeHtml($welcomeMessage) ?>"'></span> + data-bind="html: '<?= $escaper->escapeHtmlAttr($welcomeMessage) ?>'"></span> <?= $block->getBlockHtml('header.additional') ?> <!-- /ko --> </li> diff --git a/app/code/Magento/Theme/view/frontend/templates/html/header/logo.phtml b/app/code/Magento/Theme/view/frontend/templates/html/header/logo.phtml index 99beea5681f2f..165f12021bb01 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/header/logo.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/header/logo.phtml @@ -7,7 +7,17 @@ /** * @var \Magento\Theme\Block\Html\Header\Logo $block */ -$storeName = $block->getThemeName() ? $block->getThemeName() : $block->getLogoAlt() +$storeName = $block->getThemeName() ? $block->getThemeName() : $block->getLogoAlt(); +/** + * @var \Magento\Theme\ViewModel\Block\Html\Header\LogoSizeResolverInterface|null $logoSizeResolver + */ +$logoSizeResolver = $block->getLogoSizeResolver(); +$logoWidth = $logoSizeResolver !== null && $logoSizeResolver->getWidth() + ? $logoSizeResolver->getWidth() + : $block->getLogoWidth(); +$logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight() + ? $logoSizeResolver->getHeight() + : $block->getLogoHeight(); ?> <span data-action="toggle-nav" class="action nav-toggle"><span><?= $block->escapeHtml(__('Toggle Nav')) ?></span></span> <a @@ -18,7 +28,7 @@ $storeName = $block->getThemeName() ? $block->getThemeName() : $block->getLogoAl <img src="<?= $block->escapeUrl($block->getLogoSrc()) ?>" title="<?= $block->escapeHtmlAttr($block->getLogoAlt()) ?>" alt="<?= $block->escapeHtmlAttr($block->getLogoAlt()) ?>" - <?= $block->getLogoWidth() ? 'width="' . $block->escapeHtmlAttr($block->getLogoWidth()) . '"' : '' ?> - <?= $block->getLogoHeight() ? 'height="' . $block->escapeHtmlAttr($block->getLogoHeight()) . '"' : '' ?> + <?= $logoWidth ? 'width="' . $block->escapeHtmlAttr($logoWidth) . '"' : '' ?> + <?= $logoHeight ? 'height="' . $block->escapeHtmlAttr($logoHeight) . '"' : '' ?> /> </a> diff --git a/app/code/Magento/Theme/view/frontend/templates/js/cookie_status.phtml b/app/code/Magento/Theme/view/frontend/templates/js/cookie_status.phtml index 7d43ffcbb8063..7e354ee52b4ef 100644 --- a/app/code/Magento/Theme/view/frontend/templates/js/cookie_status.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/js/cookie_status.phtml @@ -3,18 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - -/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ +/** + * @var Magento\Framework\View\Element\Template $block + */ ?> -<div id="cookie-status"> +<div class="cookie-status-message" id="cookie-status"> <?= $block->escapeHtml(__('The store will not work correctly in the case when cookies are disabled.')); ?> </div> -<?php -$script = 'document.querySelector("#cookie-status").style.display = "none";'; -?> -<?= /* @noEscape */ $secureRenderer->renderTag('script', ['type' => 'text/javascript'], $script, false); ?> - <script type="text/x-magento-init"> { "*": { diff --git a/app/code/Magento/Theme/view/frontend/web/js/view/messages.js b/app/code/Magento/Theme/view/frontend/web/js/view/messages.js index 8d2ffed2d3bac..388166b2b1663 100644 --- a/app/code/Magento/Theme/view/frontend/web/js/view/messages.js +++ b/app/code/Magento/Theme/view/frontend/web/js/view/messages.js @@ -39,7 +39,10 @@ define([ customerData.set('messages', {}); } - $.cookieStorage.set('mage-messages', ''); + $.mage.cookies.set('mage-messages', '', { + samesite: 'strict', + domain: '' + }); }, /** diff --git a/app/code/Magento/ThemeGraphQl/etc/graphql/di.xml b/app/code/Magento/ThemeGraphQl/etc/graphql/di.xml index 9f55e522bf5a1..6ce3b7ec6af2e 100644 --- a/app/code/Magento/ThemeGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/ThemeGraphQl/etc/graphql/di.xml @@ -27,4 +27,7 @@ </argument> </arguments> </type> + <type name="Magento\Framework\Data\Collection"> + <plugin name="currentPageDetection" disabled="true"/> + </type> </config> diff --git a/app/code/Magento/Translation/Model/Inline/Parser.php b/app/code/Magento/Translation/Model/Inline/Parser.php index 9c0c8dc696c1b..27db358ecb403 100644 --- a/app/code/Magento/Translation/Model/Inline/Parser.php +++ b/app/code/Magento/Translation/Model/Inline/Parser.php @@ -475,7 +475,7 @@ private function _prepareTagAttributesForContent(&$content) } else { $trAttr = ' ' . $this->_getHtmlAttribute( self::DATA_TRANSLATE, - '[' . str_replace("\"", "'", join(',', $trArr)) . ']' + '[' . str_replace("\"", """, join(',', $trArr)) . ']' ); } $trAttr = $this->_addTranslateAttribute($trAttr); diff --git a/app/code/Magento/Translation/Test/Mftf/Data/TranslationData.xml b/app/code/Magento/Translation/Test/Mftf/Data/TranslationData.xml index 4f787a52ba093..0b356cf9a73cb 100644 --- a/app/code/Magento/Translation/Test/Mftf/Data/TranslationData.xml +++ b/app/code/Magento/Translation/Test/Mftf/Data/TranslationData.xml @@ -171,4 +171,11 @@ <data key="original">Shipping Method:</data> <data key="custom">Shipping Method:</data> </entity> + <entity name="RevertWelcomeMessageTranslate" extends="CustomTranslationData"> + <requiredEntity type="translation_operation_translate">RevertWelcomeMessageTranslateData</requiredEntity> + </entity> + <entity name="RevertWelcomeMessageTranslateData" type="translation_operation_translate"> + <data key="original">Default welcome msg!</data> + <data key="custom">Default welcome msg!</data> + </entity> </entities> diff --git a/app/code/Magento/Translation/Test/Mftf/Section/StorefrontPanelHeaderTranslationSection.xml b/app/code/Magento/Translation/Test/Mftf/Section/StorefrontPanelHeaderTranslationSection.xml new file mode 100644 index 0000000000000..f58d24dfa1af7 --- /dev/null +++ b/app/code/Magento/Translation/Test/Mftf/Section/StorefrontPanelHeaderTranslationSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontPanelHeaderTranslationSection"> + <element name="welcomeMessage" type="text" selector="header>.panel .greet.welcome span" /> + </section> +</sections> diff --git a/app/code/Magento/Translation/Test/Mftf/Test/StorefrontInlineTranslationOnCheckoutTest.xml b/app/code/Magento/Translation/Test/Mftf/Test/StorefrontInlineTranslationOnCheckoutTest.xml index 4eff032ce160e..952918926a63c 100644 --- a/app/code/Magento/Translation/Test/Mftf/Test/StorefrontInlineTranslationOnCheckoutTest.xml +++ b/app/code/Magento/Translation/Test/Mftf/Test/StorefrontInlineTranslationOnCheckoutTest.xml @@ -116,7 +116,7 @@ <!-- 2. Refresh magento cache --> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterTranslateEnabled"> - <argument name="tags" value=""/> + <argument name="tags" value="translate full_page"/> </actionGroup> <!-- 3. Go to storefront and click on cart button on the top --> @@ -479,7 +479,7 @@ <magentoCLI command="config:set {{DisableTranslateInlineForStorefront.path}} {{DisableTranslateInlineForStorefront.value}}" stepKey="disableTranslateInlineForStorefront"/> <!-- 8. Clear magento cache --> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterTranslateDisabled"> - <argument name="tags" value=""/> + <argument name="tags" value="translate full_page"/> </actionGroup> <magentoCLI command="setup:static-content:deploy -f" stepKey="deployStaticContent"/> diff --git a/app/code/Magento/Translation/Test/Mftf/Test/StorefrontInlineTranslationWithQuoteSymbolsTest.xml b/app/code/Magento/Translation/Test/Mftf/Test/StorefrontInlineTranslationWithQuoteSymbolsTest.xml new file mode 100644 index 0000000000000..b24917c7fe818 --- /dev/null +++ b/app/code/Magento/Translation/Test/Mftf/Test/StorefrontInlineTranslationWithQuoteSymbolsTest.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontInlineTranslationWithQuoteSymbolsTest"> + <annotations> + <features value="Translation"/> + <stories value="Inline Translation"/> + <title value="Inline translation with quote symbols"/> + <description value="As merchant I want to be able to rename text labels using quote symbols in it"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-41175"/> + <useCaseId value="MC-23989"/> + <group value="translation"/> + <group value="developer_mode_only"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> + <magentoCLI command="config:set {{EnableTranslateInlineForStorefront.path}} {{EnableTranslateInlineForStorefront.value}}" stepKey="enableTranslateInlineStorefront"/> + <createData entity="RevertWelcomeMessageTranslate" stepKey="revertWelcomeMessageTranslation"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <createData entity="SimpleProduct2" stepKey="createProductSecond"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheAfterTranslateEnabled"> + <argument name="tags" value=""/> + </actionGroup> + </before> + + <after> + <magentoCLI command="config:set {{EnableTranslateInlineForStorefront.path}} {{EnableTranslateInlineForStorefront.value}}" stepKey="enableTranslateInlineStorefront"/> + <createData entity="RevertWelcomeMessageTranslate" stepKey="revertWelcomeMessageTranslation"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <magentoCLI command="config:set {{DisableTranslateInlineForStorefront.path}} {{DisableTranslateInlineForStorefront.value}}" stepKey="disableTranslateInlineForStorefront"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createProductSecond" stepKey="deleteProductSecond"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheAfterTranslateDisabled"> + <argument name="tags" value=""/> + </actionGroup> + </after> + + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontDefaultWelcomeMessageActionGroup" stepKey="assertDefaultWelcomeMessage"/> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> + <argument name="productName" value="$createProduct.name$"/> + </actionGroup> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCart"> + <argument name="productName" value="$createProduct.name$"/> + </actionGroup> + + <actionGroup ref="AssertElementInTranslateInlineModeActionGroup" stepKey="assertWelcomeMessageInInlineTranslateMode"> + <argument name="elementSelector" value="{{StorefrontPanelHeaderTranslationSection.welcomeMessage}}"/> + </actionGroup> + <actionGroup ref="StorefrontOpenInlineTranslationPopupActionGroup" stepKey="openWelcomeMessageInlineTranslatePopup"> + <argument name="elementSelector" value="{{StorefrontPanelHeaderTranslationSection.welcomeMessage}}"/> + </actionGroup> + <actionGroup ref="StorefrontFillCustomTranslationFieldActionGroup" stepKey="fillInlineTranslateNewValue"> + <argument name="translateText" value="Welcome to "Food & Drinks" store"/> + </actionGroup> + <actionGroup ref="StorefrontSubmitInlineTranslationFormActionGroup" stepKey="saveInlineTranslateNewValue"/> + + <magentoCLI command="config:set {{DisableTranslateInlineForStorefront.path}} {{DisableTranslateInlineForStorefront.value}}" stepKey="disableTranslateInlineForStorefront"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheAfterTranslateDisabled"> + <argument name="tags" value=""/> + </actionGroup> + + <actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/> + <actionGroup ref="AssertStorefrontCustomWelcomeMessageActionGroup" stepKey="verifyTranslatedWelcomeMessage"/> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCartAgain"> + <argument name="productName" value="$createProduct.name$"/> + </actionGroup> + + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openSecondProductPage"> + <argument name="productUrl" value="$createProductSecond.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontCustomWelcomeMessageActionGroup" stepKey="verifyTranslatedWelcomeMessageForSecondProduct"/> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addSecondProductToCart"> + <argument name="productName" value="$createProductSecond.name$"/> + </actionGroup> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeSecondProductInMiniCart"> + <argument name="productName" value="$createProductSecond.name$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php b/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php index 111c7c3ccf08e..24ac8a4929f12 100644 --- a/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php +++ b/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php @@ -147,12 +147,12 @@ public function testProcessResponseBodyStringProcessingAttributesCorrectly() { $testContent = file_get_contents(__DIR__ . '/_files/datatranslate_fixture.html'); $processedAttributes = [ - "data-translate=\"[{'shown':'* Required Fields','translated':'* Required Fields'," - . "'original':'* Required Fields','location':'Tag attribute (ALT, TITLE, etc.)'}]\"", - "data-translate=\"[{'shown':'Email','translated':'Email','original':'Email'," - . "'location':'Tag attribute (ALT, TITLE, etc.)'}]\"", - "data-translate=\"[{'shown':'Password','translated':'Password','original':'Password'," - . "'location':'Tag attribute (ALT, TITLE, etc.)'}]\"" + "data-translate=\"[{"shown":"* Required Fields","translated":"* Required Fields"," + . ""original":"* Required Fields","location":"Tag attribute (ALT, TITLE, etc.)"}]\"", + "data-translate=\"[{"shown":"Email","translated":"Email","original":"Email"," + . ""location":"Tag attribute (ALT, TITLE, etc.)"}]\"", + "data-translate=\"[{"shown":"Password","translated":"Password","original":"Password"," + . ""location":"Tag attribute (ALT, TITLE, etc.)"}]\"" ]; $this->translateInlineMock->method('getAdditionalHtmlAttribute')->willReturn(null); diff --git a/app/code/Magento/Translation/view/adminhtml/templates/translate_inline.phtml b/app/code/Magento/Translation/view/adminhtml/templates/translate_inline.phtml index 67dd55d3d6372..d5ffe69a8c388 100644 --- a/app/code/Magento/Translation/view/adminhtml/templates/translate_inline.phtml +++ b/app/code/Magento/Translation/view/adminhtml/templates/translate_inline.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** * @var \Magento\Framework\View\Element\Template $block * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer diff --git a/app/code/Magento/Translation/view/frontend/templates/translate_inline.phtml b/app/code/Magento/Translation/view/frontend/templates/translate_inline.phtml index bec7dca9359c0..45884a4e0912d 100644 --- a/app/code/Magento/Translation/view/frontend/templates/translate_inline.phtml +++ b/app/code/Magento/Translation/view/frontend/templates/translate_inline.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var \Magento\Framework\View\Element\Template $block */ ?> <link rel="stylesheet" type="text/css" href="<?= $block->escapeUrl($block->getViewFileUrl('prototype/windows/themes/default.css')) ?>"/> diff --git a/app/code/Magento/Ui/Component/Filters.php b/app/code/Magento/Ui/Component/Filters.php index 5bf89ae7936e9..aa418a4522044 100644 --- a/app/code/Magento/Ui/Component/Filters.php +++ b/app/code/Magento/Ui/Component/Filters.php @@ -5,6 +5,8 @@ */ namespace Magento\Ui\Component; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Framework\View\Element\UiComponent\ObserverInterface; use Magento\Framework\View\Element\UiComponentFactory; @@ -47,16 +49,42 @@ class Filters extends AbstractComponent implements ObserverInterface protected $uiComponentFactory; /** - * @inheritDoc + * @var TimezoneInterface + */ + private $localeDate; + + /** + * Filters constructor. + * + * @param ContextInterface $context + * @param UiComponentFactory $uiComponentFactory + * @param array $components + * @param array $data + * @param TimezoneInterface|null $localeDate */ public function __construct( ContextInterface $context, UiComponentFactory $uiComponentFactory, array $components = [], - array $data = [] + array $data = [], + ?TimezoneInterface $localeDate = null ) { parent::__construct($context, $components, $data); $this->uiComponentFactory = $uiComponentFactory; + $this->localeDate = $localeDate ?? ObjectManager::getInstance()->get(TimezoneInterface::class); + } + + /** + * @inheritDoc + */ + public function prepare() + { + $config = $this->getData('config'); + // Set date format pattern by current locale + $localeDateFormat = $this->localeDate->getDateFormat(); + $config['options']['dateFormat'] = $localeDateFormat; + $this->setData('config', $config); + parent::prepare(); } /** diff --git a/app/code/Magento/Ui/Model/Export/ConvertToCsv.php b/app/code/Magento/Ui/Model/Export/ConvertToCsv.php index eb811bfae788f..44aacd0cfa44c 100644 --- a/app/code/Magento/Ui/Model/Export/ConvertToCsv.php +++ b/app/code/Magento/Ui/Model/Export/ConvertToCsv.php @@ -65,6 +65,8 @@ public function getCsvFile() { $component = $this->filter->getComponent(); + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $name = md5(microtime()); $file = 'export/'. $component->getName() . $name . '.csv'; diff --git a/app/code/Magento/Ui/Model/Export/ConvertToXml.php b/app/code/Magento/Ui/Model/Export/ConvertToXml.php index 19eb651113fcf..224feabcab2c9 100644 --- a/app/code/Magento/Ui/Model/Export/ConvertToXml.php +++ b/app/code/Magento/Ui/Model/Export/ConvertToXml.php @@ -127,6 +127,8 @@ public function getXmlFile() { $component = $this->filter->getComponent(); + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $name = md5(microtime()); $file = 'export/'. $component->getName() . $name . '.xml'; diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminAssertGridRecodrsPerPageNumberActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminAssertGridRecodrsPerPageNumberActionGroup.xml new file mode 100644 index 0000000000000..c9a337d3f09cd --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminAssertGridRecodrsPerPageNumberActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertGridRecordsPerPageNumberActionGroup"> + <annotations> + <description>Validates that the number of records per page on the Ui grid page is correct.</description> + </annotations> + <arguments> + <argument name="number" type="string" defaultValue="{{GridCountPerPageData.defaultCountPerPage}}"/> + </arguments> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageDropDownValue}}" stepKey="waitForDropdownVisible"/> + <seeInField selector="{{AdminDataGridPaginationSection.perPageDropDownValue}}" userInput="{{number}}" stepKey="seePerPageValueInDropDown"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridFilterFillSelectFieldActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridFilterFillSelectFieldActionGroup.xml new file mode 100644 index 0000000000000..3738265b3420a --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridFilterFillSelectFieldActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminGridFilterFillSelectFieldActionGroup"> + <annotations> + <description>Selects the provided Filter Value for the provided Filter Name.</description> + </annotations> + <arguments> + <argument name="filterName" type="string"/> + <argument name="filterValue" type="string"/> + </arguments> + <selectOption userInput="{{filterValue}}" selector="{{AdminDataGridFilterSection.filterSelectFieldByName(filterName)}}" stepKey="selectOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridGoToCustomPageNumberActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridGoToCustomPageNumberActionGroup.xml new file mode 100644 index 0000000000000..6eee83f60693d --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminGridGoToCustomPageNumberActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminGridGoToCustomPageNumberActionGroup"> + <annotations> + <description>Go to custom page of the admin grid.</description> + </annotations> + <arguments> + <argument name="pageNumber" defaultValue="15"/> + </arguments> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.currentPage}}" stepKey="waitForInputVisible"/> + <clearField selector="{{AdminDataGridPaginationSection.currentPage}}" stepKey="clearInput"/> + <fillField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="{{pageNumber}}" stepKey="fillPageNumber"/> + <pressKey selector="{{AdminDataGridPaginationSection.currentPage}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::TAB]" stepKey="unFocusField"/> + <waitForPageLoad stepKey="waitForPageLoad" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.xml index a07e3c80623de..2c382c07f2a09 100644 --- a/app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.xml +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.xml @@ -13,6 +13,7 @@ <description>Resets an Admin Grid page to the 'Default View'.</description> </annotations> + <waitForElementVisible selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" stepKey="waitForViewBookmarks"/> <click selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" stepKey="openViewBookmarks"/> <click selector="{{AdminDataGridHeaderSection.bookmarkOption('Default View')}}" stepKey="selectDefaultGridView"/> <see selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> diff --git a/app/code/Magento/Ui/Test/Mftf/Data/GridCountPerPageData.xml b/app/code/Magento/Ui/Test/Mftf/Data/GridCountPerPageData.xml new file mode 100644 index 0000000000000..44efacfa77222 --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/Data/GridCountPerPageData.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="GridCountPerPageData"> + <data key="customCountPerPage">1</data> + <data key="defaultCountPerPage">32</data> + </entity> +</entities> diff --git a/app/code/Magento/Ui/Test/Mftf/Data/GridPageNumberData.xml b/app/code/Magento/Ui/Test/Mftf/Data/GridPageNumberData.xml new file mode 100644 index 0000000000000..1295deeaa6b3e --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/Data/GridPageNumberData.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="GridPageNumberData"> + <data key="page2">2</data> + <data key="page4">4</data> + </entity> +</entities> diff --git a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js index 45dfaa40f87df..553f24311f602 100644 --- a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js +++ b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js @@ -13,8 +13,9 @@ define([ 'uiLayout', 'uiCollection', 'uiRegistry', - 'mage/translate' -], function (ko, utils, _, layout, uiCollection, registry, $t) { + 'mage/translate', + 'jquery' +], function (ko, utils, _, layout, uiCollection, registry, $t, $) { 'use strict'; /** @@ -975,6 +976,18 @@ define([ this._reducePages(); }, + /** + * Update page size based on select change event. + * The value needs to be retrieved from select as ko value handler is executed after the event handler. + * + * @param {Object} component + * @param {jQuery.Event} event + */ + updatePageSize: function (component, event) { + this.pageSize = $(event.target).val(); + this.reload(); + }, + /** * Destroy all dynamic-rows elems * diff --git a/app/code/Magento/Ui/view/base/web/js/grid/cells/sanitizedHtml.js b/app/code/Magento/Ui/view/base/web/js/grid/cells/sanitizedHtml.js new file mode 100644 index 0000000000000..6c46db6ab65d8 --- /dev/null +++ b/app/code/Magento/Ui/view/base/web/js/grid/cells/sanitizedHtml.js @@ -0,0 +1,27 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'Magento_Ui/js/grid/columns/column', + 'escaper' +], function (Column, escaper) { + 'use strict'; + + return Column.extend({ + defaults: { + allowedTags: ['div', 'span', 'b', 'strong', 'i', 'em', 'u', 'a'] + }, + + /** + * Name column. + * + * @param {String} label + * @returns {String} + */ + getSafeHtml: function (label) { + return escaper.escapeHtml(label, this.allowedTags); + } + }); +}); diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js index 848ad60219a2b..9377d25b82e2e 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js @@ -124,7 +124,10 @@ define([ * * @returns {Filters} Chainable. */ - initialize: function () { + initialize: function (config) { + if (typeof config.options !== 'undefined' && config.options.dateFormat) { + this.constructor.defaults.templates.filters.dateRange.dateFormat = config.options.dateFormat; + } _.bindAll(this, 'updateActive'); this._super() diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js index 1949234c89324..39f2da98b3cba 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js @@ -59,7 +59,10 @@ define([ * * @returns {Range} Chainable. */ - initialize: function () { + initialize: function (config) { + if (config.dateFormat) { + this.constructor.defaults.templates.date.pickerDefaultDateFormat = config.dateFormat; + } this._super() .initChildren(); diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js index ab806e89385b6..2ae4e24b50ec6 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js @@ -19,7 +19,6 @@ define([ ko.bindingHandlers.optgroup = { /** * @param {*} element - * @returns {Object} */ init: function (element) { if (ko.utils.tagNameLower(element) !== 'select') { @@ -30,11 +29,6 @@ define([ while (element.length > 0) { element.remove(0); } - - // Ensures that the binding processor doesn't try to bind the options - return { - 'controlsDescendantBindings': true - }; }, /** @@ -333,5 +327,4 @@ define([ } } }; - ko.bindingHandlers.selectedOptions.after.push('optgroup'); }); diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/scope.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/scope.js index ca46fb25a8918..59e82eb88a299 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/scope.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/scope.js @@ -29,7 +29,7 @@ define([ $t: $t }); - ko.utils.arrayForEach(el.childNodes, ko.cleanNode); + ko.utils.arrayForEach(ko.virtualElements.childNodes(el), ko.cleanNode); ko.applyBindingsToDescendants(component, el); } diff --git a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js index f9778ad8d688c..474a526d998d5 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js @@ -836,23 +836,47 @@ define([ ], 'less-than-equals-to': [ function (value, params) { - if ($.isNumeric(params) && $.isNumeric(value)) { - return parseFloat(value) <= parseFloat(params); + value = utils.parseNumber(value); + + if (isNaN(parseFloat(params))) { + params = $(params).val(); + } + + params = utils.parseNumber(params); + + if (!isNaN(params) && !isNaN(value)) { + this.lteToVal = params; + + return value <= params; } return true; }, - $.mage.__('Please enter a value less than or equal to {0}.') + function () { + return $.mage.__('Please enter a value less than or equal to %s.').replace('%s', this.lteToVal); + } ], 'greater-than-equals-to': [ function (value, params) { - if ($.isNumeric(params) && $.isNumeric(value)) { - return parseFloat(value) >= parseFloat(params); + value = utils.parseNumber(value); + + if (isNaN(parseFloat(params))) { + params = $(params).val(); + } + + params = utils.parseNumber(params); + + if (!isNaN(params) && !isNaN(value)) { + this.gteToVal = params; + + return value >= params; } return true; }, - $.mage.__('Please enter a value greater than or equal to {0}.') + function () { + return $.mage.__('Please enter a value greater than or equal to %s.').replace('%s', this.gteToVal); + } ], 'validate-emails': [ function (value) { diff --git a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/default.html b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/default.html index 6da4f82fa8b9e..05dfefb193d1e 100644 --- a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/default.html +++ b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/default.html @@ -48,7 +48,7 @@ </tr> </tbody> - <tfoot visible="element.addButton || (!!element.getRecordCount() && (element.pages() > 1))"> + <tfoot visible="element.addButton || (!!element.getRecordCount() && pages() > 1)"> <tr> <td attr="{'colspan': element.getColumnsCount()}" visible="element.addButton || pages() > 1"> @@ -59,7 +59,7 @@ <span translate="addButtonLabel"/> </button> - <div class="admin__control-table-pagination" visible="!!element.getRecordCount() && element.pages() > 1"> + <div class="admin__control-table-pagination" visible="!!element.getRecordCount() && pages() > 1"> <div class="admin__data-grid-pager"> <button class="action-previous" type="button" data-bind="attr: {title: $t('Previous Page')}, click: previousPage, disable: isFirst()"></button> <input class="admin__control-text" type="number" data-bind="attr: {id: ++ko.uid}, value: currentPage"> diff --git a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html index b214d974e0d53..851a45da76512 100644 --- a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html +++ b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html @@ -17,7 +17,7 @@ <div class="admin__field-control" data-role="grid-wrapper"> <div class="admin__control-table-pagination" visible="!!$data.getRecordCount()"> <div class="admin__data-grid-pager-wrap"> - <select class="admin__control-select" data-bind="value:pageSize, event:{change: reload}"> + <select class="admin__control-select" data-bind="value:pageSize, event:{change: updatePageSize}"> <option value="5">5</option> <option value="20" selected="selected">20</option> <option value="30">30</option> diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/sanitizedHtml.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/sanitizedHtml.html new file mode 100644 index 0000000000000..9050508eed0d9 --- /dev/null +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/sanitizedHtml.html @@ -0,0 +1,7 @@ +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<div class="data-grid-cell-content" html="getSafeHtml($col.getLabel($row()))"/> diff --git a/app/code/Magento/Ui/view/frontend/web/templates/form/field.html b/app/code/Magento/Ui/view/frontend/web/templates/form/field.html index 8ef49e307747b..92b27d5fe21a4 100644 --- a/app/code/Magento/Ui/view/frontend/web/templates/form/field.html +++ b/app/code/Magento/Ui/view/frontend/web/templates/form/field.html @@ -50,4 +50,3 @@ <!-- /ko --> </div> </div> -<!-- /ko --> diff --git a/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php index daff459d7ba3f..07da63fa8476e 100644 --- a/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Ups/Test/Unit/Model/CarrierTest.php @@ -226,7 +226,7 @@ public function testGetMethodPrice( ->willReturn($freeShippingEnabled); $request = new RateRequest(); - $request->setBaseSubtotalInclTax($requestSubtotal); + $request->setValueWithDiscount($requestSubtotal); $this->model->setRawRequest($request); $price = $this->model->getMethodPrice($cost, $shippingMethod); $this->assertEquals($expectedPrice, $price); diff --git a/app/code/Magento/UrlRewrite/Helper/UrlRewrite.php b/app/code/Magento/UrlRewrite/Helper/UrlRewrite.php index 86a75f06f4c5c..b2164e20b8885 100644 --- a/app/code/Magento/UrlRewrite/Helper/UrlRewrite.php +++ b/app/code/Magento/UrlRewrite/Helper/UrlRewrite.php @@ -5,6 +5,10 @@ */ namespace Magento\UrlRewrite\Helper; +use Magento\Framework\App\ObjectManager; +use Magento\Backend\Model\Validator\UrlKey\CompositeUrlKey; +use Magento\Framework\Exception\LocalizedException; + class UrlRewrite extends \Magento\Framework\App\Helper\AbstractHelper { /** @@ -17,6 +21,21 @@ class UrlRewrite extends \Magento\Framework\App\Helper\AbstractHelper // Anchor is not supported in request path, e.g. 'foo#bar' + /** + * @var CompositeUrlKey + */ + private $compositeUrlValidator; + + /** + * @param CompositeUrlKey|null $compositeUrlValidator + */ + public function __construct( + CompositeUrlKey $compositeUrlValidator = null + ) { + $this->compositeUrlValidator = $compositeUrlValidator + ?? ObjectManager::getInstance()->get(CompositeUrlKey::class); + } + /** * Core func to validate request path * If something is wrong with a path it throws localized error message and error code, @@ -37,11 +56,19 @@ protected function _validateRequestPath($requestPath) if (strpos($requestPath, '#') !== false) { throw new \Exception(__('Anchor symbol (#) is not supported in request path.'), self::VERR_ANCHOR); } + $requestPathArray = explode('/', $requestPath); + foreach ($requestPathArray as $requestPathPart) { + $errors = $this->compositeUrlValidator->validate($requestPathPart); + if (!empty($errors)) { + throw new LocalizedException($errors[0]); + } + } return true; } /** * Validates request path + * * Either returns TRUE (success) or throws error (validation failed) * * @param string $requestPath @@ -53,14 +80,14 @@ public function validateRequestPath($requestPath) try { $this->_validateRequestPath($requestPath); } catch (\Exception $e) { - throw new \Magento\Framework\Exception\LocalizedException(__($e->getMessage())); + throw new LocalizedException(__($e->getMessage())); } return true; } /** - * Validates suffix for url rewrites to inform user about errors in it - * Either returns TRUE (success) or throws error (validation failed) + * Validates suffix for url rewrites to inform user about errors in it either returns TRUE + * (success) or throws error (validation failed) * * @param string $suffix * @throws \Magento\Framework\Exception\LocalizedException diff --git a/app/code/Magento/UrlRewrite/Model/ResourceModel/UrlRewriteCollection.php b/app/code/Magento/UrlRewrite/Model/ResourceModel/UrlRewriteCollection.php index a33d4563e7160..37b50693e6724 100644 --- a/app/code/Magento/UrlRewrite/Model/ResourceModel/UrlRewriteCollection.php +++ b/app/code/Magento/UrlRewrite/Model/ResourceModel/UrlRewriteCollection.php @@ -68,7 +68,7 @@ public function addStoreFilter($store, $withAdmin = true) $store[] = 0; } - $this->addFieldToFilter('store_id', ['in' => $store]); + $this->addFieldToFilter('main_table.store_id', ['in' => $store]); return $this; } diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml index d43a6b69165a5..795a3e956cf82 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml @@ -53,7 +53,7 @@ <!-- Assert Redirect path, Target Path and Redirect type in grid --> <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> - <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> + <argument name="redirectPath" value="$$createSimpleProduct.custom_attributes[url_key]$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> @@ -62,12 +62,12 @@ <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="Temporary (302)"/> - <argument name="targetPath" value="$$createSimpleProduct.name$$.html"/> + <argument name="targetPath" value="$$createSimpleProduct.custom_attributes[url_key]$$.html"/> </actionGroup> <!--Assert Category Url Redirect is not present --> <actionGroup ref="AdminSearchDeletedUrlRewriteActionGroup" stepKey="searchDeletedCategory"> - <argument name="requestPath" value="$$createCategory.name$$.html"/> + <argument name="requestPath" value="$$createCategory.custom_attributes[url_key]$$.html"/> </actionGroup> </test> </tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminUrlRewriteMultipleStoreviewsProductImportWithConfigTurnedOffTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminUrlRewriteMultipleStoreviewsProductImportWithConfigTurnedOffTest.xml index 6f7bb6ccb2b84..4833ce686a4e9 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminUrlRewriteMultipleStoreviewsProductImportWithConfigTurnedOffTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminUrlRewriteMultipleStoreviewsProductImportWithConfigTurnedOffTest.xml @@ -21,10 +21,7 @@ <!-- Set the configuration for Generate "category/product" URL Rewrites to Yes (default)--> <comment userInput="Enable SEO configuration setting to generate category/product URL Rewrites" stepKey="commentEnableUrlRewriteConfig"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterEnableConfig"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterEnableConfig"/> <createData entity="ApiCategory" stepKey="createCategory"> <field key="name">category-admin</field> </createData> @@ -40,10 +37,7 @@ <!-- Set the configuration for Generate "category/product" URL Rewrites to No--> <comment userInput="Disable SEO configuration setting to generate category/product URL Rewrites" stepKey="commentDisableUrlRewriteConfig"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 0" stepKey="disableGenerateUrlRewrite"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterDisableConfig"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterDisableConfig"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> @@ -61,10 +55,7 @@ <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFiltersIfSet"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="resetConfigurationSetting"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchToStoreViewEn"> <argument name="Store" value="customStoreENNotUnique.name"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategory2Test.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategory2Test.xml index fee13adcb433c..0b3843b777528 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategory2Test.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategory2Test.xml @@ -36,7 +36,7 @@ <!--Create additional Store View in Main Website Store --> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAll"> - <argument name="indices" value=""/> + <argument name="indices" value="catalog_category_product"/> </actionGroup> </before> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml index 1cd4a4747aa4a..bec16ec89ed25 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml @@ -47,7 +47,7 @@ <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{FirstLevelSubCat.name_lwr}}/{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="Temporary (302)" /> - <argument name="targetPath" value="$$createSimpleProduct.name$$.html"/> + <argument name="targetPath" value="$$createSimpleProduct.custom_attributes[url_key]$$.html"/> </actionGroup> <!--Filter Product in product page and get the Product ID --> @@ -58,7 +58,7 @@ <!-- Assert Redirect path, Target Path and Redirect type in grid --> <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> - <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> + <argument name="redirectPath" value="$$createSimpleProduct.custom_attributes[url_key]$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminGenerateUrlRewritesForProductInCategoriesSwitchOffTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminGenerateUrlRewritesForProductInCategoriesSwitchOffTest.xml index 10b377eebd313..575083dc1d76d 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminGenerateUrlRewritesForProductInCategoriesSwitchOffTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminGenerateUrlRewritesForProductInCategoriesSwitchOffTest.xml @@ -21,10 +21,7 @@ <!-- Set the configuration for Generate "category/product" URL Rewrites--> <comment userInput="Enable config to generate category/product URL Rewrites" stepKey="commentEnableConfig" /> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="SimpleSubCategory" stepKey="createCategory"/> @@ -39,10 +36,7 @@ <!-- Set the configuration for Generate "category/product" URL Rewrites--> <comment userInput="Enable config to generate category/product URL Rewrites" stepKey="commentEnableConfig" /> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> @@ -62,9 +56,7 @@ <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 0" stepKey="disableGenerateUrlRewrite"/> <!-- 3. Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- 4. Open Marketing - SEO & Search - URL Rewrites --> <actionGroup ref="AdminSearchUrlRewriteByRequestPathActionGroup" stepKey="searchingUrlRewriteAfterDisablingTheConfig"> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml index d102286bd9e6d..bd74d480a8d66 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml @@ -32,7 +32,7 @@ <argument name="customStore" value="customStore"/> </actionGroup> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="runReindex"> - <argument name="indices" value=""/> + <argument name="indices" value="catalog_category_product"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTestWithConfigurationTurnedOffTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTestWithConfigurationTurnedOffTest.xml index 78bd397c69289..06d54b10c1402 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTestWithConfigurationTurnedOffTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTestWithConfigurationTurnedOffTest.xml @@ -24,10 +24,7 @@ <!-- Set the configuration for Generate "category/product" URL Rewrites to Yes (default)--> <comment userInput="Enable SEO configuration setting to generate category/product URL Rewrites" stepKey="commentEnableUrlRewriteConfig"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterEnableConfig"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterEnableConfig"/> <createData entity="SimpleSubCategory" stepKey="simpleSubCategory1"/> <createData entity="SubCategoryWithParent" stepKey="simpleSubCategory2"> @@ -43,20 +40,14 @@ <!-- Set the configuration for Generate "category/product" URL Rewrites to No--> <comment userInput="Disable SEO configuration setting to generate category/product URL Rewrites" stepKey="commentDisableUrlRewriteConfig"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 0" stepKey="disableGenerateUrlRewrite"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="simpleSubCategory1" stepKey="deletesimpleSubCategory1"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="resetConfigurationSetting"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterDisableConfig"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterDisableConfig"/> </after> <!-- Steps --> <!-- 1. Log in to Admin --> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductsWithConfigurationTurnedOffTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductsWithConfigurationTurnedOffTest.xml index bfe8a28064496..fc380f433bfbc 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductsWithConfigurationTurnedOffTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductsWithConfigurationTurnedOffTest.xml @@ -21,10 +21,7 @@ <!-- Set the configuration for Generate "category/product" URL Rewrites to Yes (default)--> <comment userInput="Enable SEO configuration setting to generate category/product URL Rewrites" stepKey="commentEnableUrlRewriteConfig"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterEnableConfig"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterEnableConfig"/> <createData entity="SimpleSubCategory" stepKey="simpleSubCategory1"/> <!-- Create Simple product 1 and assign it to Category 1 --> <createData entity="ApiSimpleProduct" stepKey="createSimpleProduct"> @@ -33,19 +30,13 @@ <!-- Set the configuration for Generate "category/product" URL Rewrites to No--> <comment userInput="Disable SEO configuration setting to generate category/product URL Rewrites" stepKey="commentDisableUrlRewriteConfig"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 0" stepKey="disableGenerateUrlRewrite"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterDisableConfig"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCacheAfterDisableConfig"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="simpleSubCategory1" stepKey="deletesimpleSubCategory1"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="resetConfigurationSetting"/> - <!--Flush cache--> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <!-- 1. Log in to Admin --> diff --git a/app/code/Magento/UrlRewrite/Test/Unit/Model/ResourceModel/UrlRewriteCollectionTest.php b/app/code/Magento/UrlRewrite/Test/Unit/Model/ResourceModel/UrlRewriteCollectionTest.php index ddbe1d3a71ba7..62a7c1787be41 100644 --- a/app/code/Magento/UrlRewrite/Test/Unit/Model/ResourceModel/UrlRewriteCollectionTest.php +++ b/app/code/Magento/UrlRewrite/Test/Unit/Model/ResourceModel/UrlRewriteCollectionTest.php @@ -107,7 +107,7 @@ public function testAddStoreFilterIfStoreIsArray($storeId, $withAdmin, $conditio { $this->connectionMock->expects($this->once()) ->method('prepareSqlCondition') - ->with('store_id', ['in' => $condition]); + ->with('main_table.store_id', ['in' => $condition]); $this->collection->addStoreFilter($storeId, $withAdmin); } @@ -138,7 +138,7 @@ public function testAddStoreFilterIfStoreIsInt($storeId, $withAdmin, $condition) $this->connectionMock->expects($this->once()) ->method('prepareSqlCondition') - ->with('store_id', ['in' => $condition]); + ->with('main_table.store_id', ['in' => $condition]); $this->collection->addStoreFilter($storeId, $withAdmin); } diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/DataProvider/EntityDataProviderComposite.php b/app/code/Magento/UrlRewriteGraphQl/Model/DataProvider/EntityDataProviderComposite.php new file mode 100644 index 0000000000000..18a57c8070dca --- /dev/null +++ b/app/code/Magento/UrlRewriteGraphQl/Model/DataProvider/EntityDataProviderComposite.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\UrlRewriteGraphQl\Model\DataProvider; + +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; + +/** + * Composite class for entity data provider + */ +class EntityDataProviderComposite implements EntityDataProviderInterface +{ + /** + * @var EntityDataProviderInterface[] + */ + private $dataProviders; + + /** + * @param EntityDataProviderInterface[] $dataProviders + */ + public function __construct(array $dataProviders = []) + { + $this->dataProviders = $dataProviders; + } + + /** + * Get data from provider + * + * @param string $entity_type + * @param int $id + * @param ResolveInfo|null $info + * @param int|null $storeId + * @return array + */ + public function getData( + string $entity_type, + int $id, + ResolveInfo $info = null, + int $storeId = null + ): array { + return $this->dataProviders[strtolower($entity_type)]->getData( + $entity_type, + $id, + $info, + $storeId + ); + } +} diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/DataProvider/EntityDataProviderInterface.php b/app/code/Magento/UrlRewriteGraphQl/Model/DataProvider/EntityDataProviderInterface.php new file mode 100644 index 0000000000000..4665073c33c24 --- /dev/null +++ b/app/code/Magento/UrlRewriteGraphQl/Model/DataProvider/EntityDataProviderInterface.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\UrlRewriteGraphQl\Model\DataProvider; + +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; + +interface EntityDataProviderInterface +{ + /** + * Get data for url rewrite entity + * + * @param string $entity_type + * @param int $id + * @param ResolveInfo|null $info + * @param int|null $storeId + * @return array + */ + public function getData( + string $entity_type, + int $id, + ResolveInfo $info = null, + int $storeId = null + ): array; +} diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/AbstractEntityUrl.php b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/AbstractEntityUrl.php new file mode 100755 index 0000000000000..94c6a89cd01ae --- /dev/null +++ b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/AbstractEntityUrl.php @@ -0,0 +1,207 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\UrlRewriteGraphQl\Model\Resolver; + +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; +use Magento\UrlRewrite\Model\UrlFinderInterface; +use Magento\UrlRewriteGraphQl\Model\Resolver\UrlRewrite\CustomUrlLocatorInterface; +use Magento\Framework\GraphQl\Query\Uid; + +abstract class AbstractEntityUrl implements ResolverInterface +{ + /** + * @var UrlFinderInterface + */ + private $urlFinder; + + /** + * @var CustomUrlLocatorInterface + */ + private $customUrlLocator; + + /** + * @var int + */ + private $redirectType; + + /** + * @var Uid + */ + private $idEncoder; + + /** + * @param UrlFinderInterface $urlFinder + * @param CustomUrlLocatorInterface $customUrlLocator + * @param Uid $idEncoder + */ + public function __construct( + UrlFinderInterface $urlFinder, + CustomUrlLocatorInterface $customUrlLocator, + Uid $idEncoder + ) { + $this->urlFinder = $urlFinder; + $this->customUrlLocator = $customUrlLocator; + $this->idEncoder = $idEncoder; + } + + /** + * @inheritdoc + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + if (!isset($args['url']) || empty(trim($args['url']))) { + throw new GraphQlInputException(__('"url" argument should be specified and not empty')); + } + + $storeId = (int)$context->getExtensionAttributes()->getStore()->getId(); + $result = null; + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $urlParts = parse_url($args['url']); + $url = $urlParts['path'] ?? $args['url']; + if (substr($url, 0, 1) === '/' && $url !== '/') { + $url = ltrim($url, '/'); + } + $this->redirectType = 0; + $customUrl = $this->customUrlLocator->locateUrl($url); + $url = $customUrl ?: $url; + $finalUrlRewrite = $this->findFinalUrl($url, $storeId); + if ($finalUrlRewrite) { + $relativeUrl = $finalUrlRewrite->getRequestPath(); + $resultArray = $this->rewriteCustomUrls($finalUrlRewrite, $storeId) ?? [ + 'id' => $finalUrlRewrite->getEntityId(), + 'entity_uid' => $this->idEncoder->encode((string)$finalUrlRewrite->getEntityId()), + 'canonical_url' => $relativeUrl, + 'relative_url' => $relativeUrl, + 'redirectCode' => $this->redirectType, + 'redirect_code' => $this->redirectType, + 'type' => $this->sanitizeType($finalUrlRewrite->getEntityType()) + ]; + if (!empty($urlParts['query'])) { + $resultArray['relative_url'] .= '?' . $urlParts['query']; + } + + if (empty($resultArray['id'])) { + throw new GraphQlNoSuchEntityException( + __('No such entity found with matching URL key: %url', ['url' => $url]) + ); + } + + $result = $resultArray; + } + return $result; + } + + /** + * Handle custom urls with and without redirects + * + * @param UrlRewrite $finalUrlRewrite + * @param int $storeId + * @return array|null + */ + private function rewriteCustomUrls(UrlRewrite $finalUrlRewrite, int $storeId): ?array + { + if ($finalUrlRewrite->getEntityType() === 'custom' || !($finalUrlRewrite->getEntityId() > 0)) { + $finalCustomUrlRewrite = clone $finalUrlRewrite; + $finalUrlRewrite = $this->findFinalUrl($finalCustomUrlRewrite->getTargetPath(), $storeId, true); + $relativeUrl = + $finalCustomUrlRewrite->getRedirectType() == 0 + ? $finalCustomUrlRewrite->getRequestPath() : $finalUrlRewrite->getRequestPath(); + return [ + 'id' => $finalUrlRewrite->getEntityId(), + 'entity_uid' => $this->idEncoder->encode((string)$finalUrlRewrite->getEntityId()), + 'canonical_url' => $relativeUrl, + 'relative_url' => $relativeUrl, + 'redirectCode' => $finalCustomUrlRewrite->getRedirectType(), + 'redirect_code' => $finalCustomUrlRewrite->getRedirectType(), + 'type' => $this->sanitizeType($finalUrlRewrite->getEntityType()) + ]; + } + return null; + } + + /** + * Find the final url passing through all redirects if any + * + * @param string $requestPath + * @param int $storeId + * @param bool $findCustom + * @return UrlRewrite|null + */ + private function findFinalUrl(string $requestPath, int $storeId, bool $findCustom = false): ?UrlRewrite + { + $urlRewrite = $this->findUrlFromRequestPath($requestPath, $storeId); + if ($urlRewrite) { + $this->redirectType = $urlRewrite->getRedirectType(); + while ($urlRewrite && $urlRewrite->getRedirectType() > 0) { + $urlRewrite = $this->findUrlFromRequestPath($urlRewrite->getTargetPath(), $storeId); + } + } else { + $urlRewrite = $this->findUrlFromTargetPath($requestPath, $storeId); + } + if ($urlRewrite && ($findCustom && !$urlRewrite->getEntityId() && !$urlRewrite->getIsAutogenerated())) { + $urlRewrite = $this->findUrlFromTargetPath($urlRewrite->getTargetPath(), $storeId); + } + + return $urlRewrite; + } + + /** + * Find a url from a request url on the current store + * + * @param string $requestPath + * @param int $storeId + * @return UrlRewrite|null + */ + private function findUrlFromRequestPath(string $requestPath, int $storeId): ?UrlRewrite + { + return $this->urlFinder->findOneByData( + [ + 'request_path' => $requestPath, + 'store_id' => $storeId + ] + ); + } + + /** + * Find a url from a target url on the current store + * + * @param string $targetPath + * @param int $storeId + * @return UrlRewrite|null + */ + private function findUrlFromTargetPath(string $targetPath, int $storeId): ?UrlRewrite + { + return $this->urlFinder->findOneByData( + [ + 'target_path' => $targetPath, + 'store_id' => $storeId + ] + ); + } + + /** + * Sanitize the type to fit schema specifications + * + * @param string $type + * @return string + */ + private function sanitizeType(string $type) : string + { + return strtoupper(str_replace('-', '_', $type)); + } +} diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php index 0b372555fe4c2..132e075e6e3e4 100644 --- a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php +++ b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/EntityUrl.php @@ -7,202 +7,11 @@ namespace Magento\UrlRewriteGraphQl\Model\Resolver; -use Magento\Framework\GraphQl\Exception\GraphQlInputException; -use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; -use Magento\Framework\GraphQl\Query\Uid; -use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\ResolverInterface; -use Magento\UrlRewrite\Model\UrlFinderInterface; -use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; -use Magento\UrlRewriteGraphQl\Model\Resolver\UrlRewrite\CustomUrlLocatorInterface; /** * UrlRewrite field resolver, used for GraphQL request processing. */ -class EntityUrl implements ResolverInterface +class EntityUrl extends AbstractEntityUrl implements ResolverInterface { - /** - * @var UrlFinderInterface - */ - private $urlFinder; - - /** - * @var CustomUrlLocatorInterface - */ - private $customUrlLocator; - - /** - * @var int - */ - private $redirectType; - - /** - * @var Uid - */ - private $idEncoder; - - /** - * @param UrlFinderInterface $urlFinder - * @param CustomUrlLocatorInterface $customUrlLocator - * @param Uid $idEncoder - */ - public function __construct( - UrlFinderInterface $urlFinder, - CustomUrlLocatorInterface $customUrlLocator, - Uid $idEncoder - ) { - $this->urlFinder = $urlFinder; - $this->customUrlLocator = $customUrlLocator; - $this->idEncoder = $idEncoder; - } - - /** - * @inheritdoc - */ - public function resolve( - Field $field, - $context, - ResolveInfo $info, - array $value = null, - array $args = null - ) { - if (!isset($args['url']) || empty(trim($args['url']))) { - throw new GraphQlInputException(__('"url" argument should be specified and not empty')); - } - - $storeId = (int)$context->getExtensionAttributes()->getStore()->getId(); - $result = null; - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $urlParts = parse_url($args['url']); - $url = $urlParts['path'] ?? $args['url']; - if (substr($url, 0, 1) === '/' && $url !== '/') { - $url = ltrim($url, '/'); - } - $this->redirectType = 0; - $customUrl = $this->customUrlLocator->locateUrl($url); - $url = $customUrl ?: $url; - $finalUrlRewrite = $this->findFinalUrl($url, $storeId); - if ($finalUrlRewrite) { - $relativeUrl = $finalUrlRewrite->getRequestPath(); - $resultArray = $this->rewriteCustomUrls($finalUrlRewrite, $storeId) ?? [ - 'id' => $finalUrlRewrite->getEntityId(), - 'entity_uid' => $this->idEncoder->encode((string)$finalUrlRewrite->getEntityId()), - 'canonical_url' => $relativeUrl, - 'relative_url' => $relativeUrl, - 'redirectCode' => $this->redirectType, - 'type' => $this->sanitizeType($finalUrlRewrite->getEntityType()) - ]; - if (!empty($urlParts['query'])) { - $resultArray['relative_url'] .= '?' . $urlParts['query']; - } - - if (empty($resultArray['id'])) { - throw new GraphQlNoSuchEntityException( - __('No such entity found with matching URL key: %url', ['url' => $url]) - ); - } - - $result = $resultArray; - } - return $result; - } - - /** - * Handle custom urls with and without redirects - * - * @param UrlRewrite $finalUrlRewrite - * @param int $storeId - * @return array|null - */ - private function rewriteCustomUrls(UrlRewrite $finalUrlRewrite, int $storeId): ?array - { - if ($finalUrlRewrite->getEntityType() === 'custom' || !($finalUrlRewrite->getEntityId() > 0)) { - $finalCustomUrlRewrite = clone $finalUrlRewrite; - $finalUrlRewrite = $this->findFinalUrl($finalCustomUrlRewrite->getTargetPath(), $storeId, true); - $relativeUrl = - $finalCustomUrlRewrite->getRedirectType() == 0 - ? $finalCustomUrlRewrite->getRequestPath() : $finalUrlRewrite->getRequestPath(); - return [ - 'id' => $finalUrlRewrite->getEntityId(), - 'entity_uid' => $this->idEncoder->encode((string)$finalUrlRewrite->getEntityId()), - 'canonical_url' => $relativeUrl, - 'relative_url' => $relativeUrl, - 'redirectCode' => $finalCustomUrlRewrite->getRedirectType(), - 'type' => $this->sanitizeType($finalUrlRewrite->getEntityType()) - ]; - } - return null; - } - - /** - * Find the final url passing through all redirects if any - * - * @param string $requestPath - * @param int $storeId - * @param bool $findCustom - * @return UrlRewrite|null - */ - private function findFinalUrl(string $requestPath, int $storeId, bool $findCustom = false): ?UrlRewrite - { - $urlRewrite = $this->findUrlFromRequestPath($requestPath, $storeId); - if ($urlRewrite) { - $this->redirectType = $urlRewrite->getRedirectType(); - while ($urlRewrite && $urlRewrite->getRedirectType() > 0) { - $urlRewrite = $this->findUrlFromRequestPath($urlRewrite->getTargetPath(), $storeId); - } - } else { - $urlRewrite = $this->findUrlFromTargetPath($requestPath, $storeId); - } - if ($urlRewrite && ($findCustom && !$urlRewrite->getEntityId() && !$urlRewrite->getIsAutogenerated())) { - $urlRewrite = $this->findUrlFromTargetPath($urlRewrite->getTargetPath(), $storeId); - } - - return $urlRewrite; - } - - /** - * Find a url from a request url on the current store - * - * @param string $requestPath - * @param int $storeId - * @return UrlRewrite|null - */ - private function findUrlFromRequestPath(string $requestPath, int $storeId): ?UrlRewrite - { - return $this->urlFinder->findOneByData( - [ - 'request_path' => $requestPath, - 'store_id' => $storeId - ] - ); - } - - /** - * Find a url from a target url on the current store - * - * @param string $targetPath - * @param int $storeId - * @return UrlRewrite|null - */ - private function findUrlFromTargetPath(string $targetPath, int $storeId): ?UrlRewrite - { - return $this->urlFinder->findOneByData( - [ - 'target_path' => $targetPath, - 'store_id' => $storeId - ] - ); - } - - /** - * Sanitize the type to fit schema specifications - * - * @param string $type - * @return string - */ - private function sanitizeType(string $type) : string - { - return strtoupper(str_replace('-', '_', $type)); - } } diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/Route.php b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/Route.php new file mode 100755 index 0000000000000..c8602b32b1bbf --- /dev/null +++ b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/Route.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\UrlRewriteGraphQl\Model\Resolver; + +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Query\Uid; +use Magento\UrlRewrite\Model\UrlFinderInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\UrlRewriteGraphQl\Model\Resolver\UrlRewrite\CustomUrlLocatorInterface; +use Magento\UrlRewriteGraphQl\Model\DataProvider\EntityDataProviderComposite; + +class Route extends AbstractEntityUrl implements ResolverInterface +{ + /** + * @var EntityDataProviderComposite + */ + private $entityDataProviderComposite; + + /** + * @param UrlFinderInterface $urlFinder + * @param CustomUrlLocatorInterface $customUrlLocator + * @param EntityDataProviderComposite $entityDataProviderComposite + * @param Uid $idEncoder + */ + public function __construct( + UrlFinderInterface $urlFinder, + CustomUrlLocatorInterface $customUrlLocator, + EntityDataProviderComposite $entityDataProviderComposite, + Uid $idEncoder + ) { + parent::__construct($urlFinder, $customUrlLocator, $idEncoder); + $this->entityDataProviderComposite = $entityDataProviderComposite; + } + + /** + * @inheritdoc + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + $result = null; + $resultArray = parent::resolve( + $field, + $context, + $info, + $value, + $args + ); + $storeId = (int)$context->getExtensionAttributes()->getStore()->getId(); + if ($resultArray) { + $result = $this->entityDataProviderComposite->getData( + $resultArray['type'], + (int)$resultArray['id'], + $info, + $storeId + ); + $result['redirect_code'] = $resultArray['redirect_code']; + $result['relative_url'] = $resultArray['relative_url']; + $result['type'] = $resultArray['type']; + return $result; + } + return null; + } +} diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/RoutableInterfaceTypeResolver.php b/app/code/Magento/UrlRewriteGraphQl/Model/RoutableInterfaceTypeResolver.php new file mode 100755 index 0000000000000..acd027c4c6778 --- /dev/null +++ b/app/code/Magento/UrlRewriteGraphQl/Model/RoutableInterfaceTypeResolver.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\UrlRewriteGraphQl\Model; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use \Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface; + +/** + * Resolver for Media Gallery type. + */ +class RoutableInterfaceTypeResolver implements TypeResolverInterface +{ + /** + * TypeResolverInterface[] + */ + private $productTypeNameResolvers = []; + + /** + * @param TypeResolverInterface[] $productTypeNameResolvers + */ + public function __construct(array $productTypeNameResolvers = []) + { + $this->productTypeNameResolvers = $productTypeNameResolvers; + } + + /** + * @inheritdoc + * + * @param array $data + * @return string + */ + public function resolveType(array $data) : string + { + $resolvedType = null; + + foreach ($this->productTypeNameResolvers as $productTypeNameResolver) { + if (!isset($data['type_id'])) { + throw new GraphQlInputException( + __('Missing key %1 in product data', ['type_id']) + ); + } + $resolvedType = $productTypeNameResolver->resolveType($data); + if (!empty($resolvedType)) { + return $resolvedType; + } + } + + throw new GraphQlInputException( + __('Concrete type for %1 not implemented', ['ProductInterface']) + ); + } +} diff --git a/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls b/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls index 7000f52d7d683..79e9a1dd5fe5b 100644 --- a/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/UrlRewriteGraphQl/etc/schema.graphqls @@ -2,7 +2,8 @@ # See COPYING.txt for license details. type Query { - urlResolver(url: String!): EntityUrl @resolver(class: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\EntityUrl") @doc(description: "The urlResolver query returns the relative URL for a specified product, category or CMS page, using as input a url_key appended by the url_suffix, if one exists") @cache(cacheIdentity: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\UrlRewrite\\UrlResolverIdentity") + urlResolver(url: String!): EntityUrl @resolver(class: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\EntityUrl") @doc(description: "The urlResolver query returns the relative URL for a specified product, category or CMS page, using as input a url_key appended by the url_suffix, if one exists") @deprecated(reason: "Use the 'route' query instead") @cache(cacheIdentity: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\UrlRewrite\\UrlResolverIdentity") + route(url: String!): RoutableInterface @resolver(class: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\Route") @doc(description: "Return the full details for a specified product, category, or CMS page given the specified url_key, appended by the url_suffix, if one exists") @cache(cacheIdentity: "Magento\\UrlRewriteGraphQl\\Model\\Resolver\\UrlRewrite\\UrlResolverIdentity") } type EntityUrl @doc(description: "EntityUrl is an output object containing the `id`, `relative_url`, and `type` attributes") { @@ -26,3 +27,9 @@ type HttpQueryParameter @doc(description: "The object details of target path par name: String @doc(description: "Parameter name") value: String @doc(description: "Parameter value") } + +interface RoutableInterface @typeResolver(class: "Magento\\UrlRewriteGraphQl\\Model\\RoutableInterfaceTypeResolver") @doc(description: "Routable entities serve as the model for a rendered page") { + relative_url: String @doc(description: "The internal relative URL. If the specified URL is a redirect, the query returns the redirected URL, not the original") + redirect_code: Int! @doc(description: "Contains 0 when there is no redirect error. A value of 301 indicates the URL of the requested resource has been changed permanently, while a value of 302 indicates a temporary redirect") + type: UrlRewriteEntityTypeEnum @doc(description: "One of PRODUCT, CATEGORY, or CMS_PAGE.") +} diff --git a/app/code/Magento/User/Model/ResourceModel/User/Collection.php b/app/code/Magento/User/Model/ResourceModel/User/Collection.php index 422afb47f0a0e..b9b2c5369eb02 100644 --- a/app/code/Magento/User/Model/ResourceModel/User/Collection.php +++ b/app/code/Magento/User/Model/ResourceModel/User/Collection.php @@ -41,5 +41,6 @@ protected function _initSelect() 'user_role.parent_id = detail_role.role_id', ['role_name'] ); + $this->addFilterToMap('user_id', 'main_table.user_id'); } } diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleAndSetLocaleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleAndSetLocaleActionGroup.xml new file mode 100644 index 0000000000000..d9fc4e488f2c8 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleAndSetLocaleActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <!-- Create new user with role and locale setting--> + <actionGroup name="AdminCreateUserWithRoleAndLocaleActionGroup" extends="AdminCreateUserWithRoleActionGroup"> + <arguments> + <argument name="interfaceLocale" defaultValue="en_US" type="string"/> + </arguments> + + <selectOption selector="{{AdminNewUserFormSection.interfaceLocale}}" userInput="{{interfaceLocale}}" stepKey="setInterfaceLocate" after="confirmPassword"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUnlockAdminUserEntityViaCLIActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUnlockAdminUserEntityViaCLIActionGroup.xml new file mode 100644 index 0000000000000..06d8e9c800d6b --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUnlockAdminUserEntityViaCLIActionGroup.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminUnlockAdminUserEntityViaCLIActionGroup"> + <arguments> + <argument name="username" type="entity"/> + </arguments> + <magentoCLI command="admin:user:unlock {{username}}" stepKey="unlockUserCLI"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminUnlockAdminUserEntityViaCLITest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminUnlockAdminUserEntityViaCLITest.xml new file mode 100644 index 0000000000000..32b7b9cbf2c8e --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Test/AdminUnlockAdminUserEntityViaCLITest.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminUnlockAdminUserEntityViaCLITest"> + <annotations> + <features value="User"/> + <stories value="Unlock admin user, locked during login via CLI"/> + <title value="Unlock admin when the user was locked after entering incorrect password specified number of times"/> + <description value="Unlocked user should be able login into admin panel"/> + <severity value="MAJOR"/> + <group value="user"/> + </annotations> + <before> + <magentoCLI command="config:set admin/captcha/enable 0" stepKey="disableAdminCaptcha"/> + <magentoCLI command="config:set admin/security/lockout_failures 2" stepKey="setDefaultMaximumLoginFailures"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + </before> + <after> + <magentoCLI command="config:set admin/captcha/enable 1" stepKey="enableAdminCaptcha"/> + <magentoCLI command="config:set admin/security/lockout_failures 6" stepKey="setDefaultMaximumLoginFailures"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCachesAfterTestExecution"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdmin"/> + <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteCreatedUser"> + <argument name="user" value="adminUserCorrectPassword"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + </after> + + <actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="goToNewUserPage"/> + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillNewUserForm"> + <argument name="user" value="adminUserCorrectPassword"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="saveNewUser"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsDefaultUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsCreatedUserWithIncorrectCredentials"> + <argument name="username" value="{{adminUserIncorrectPassword.username}}"/> + <argument name="password" value="{{adminUserIncorrectPassword.password}}"/> + </actionGroup> + <actionGroup ref="AdminLoginActionGroup" stepKey="lockNewlyCreatedUser"> + <argument name="username" value="{{adminUserIncorrectPassword.username}}"/> + <argument name="password" value="{{adminUserIncorrectPassword.password}}"/> + </actionGroup> + <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="assertErrorMessage"/> + + <actionGroup ref="AdminUnlockAdminUserEntityViaCLIActionGroup" stepKey="runUnlockCLI"> + <argument name="username" value="adminUserCorrectPassword.username"/> + </actionGroup> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsUnlockedUser"> + <argument name="username" value="{{adminUserCorrectPassword.username}}"/> + <argument name="password" value="{{adminUserCorrectPassword.password}}"/> + </actionGroup> + <actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="seeDashboardPage"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsUnlockedAdminUser"/> + </test> +</tests> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminUpdateUserRoleTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminUpdateUserRoleTest.xml new file mode 100644 index 0000000000000..21b88fbcff0b3 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Test/AdminUpdateUserRoleTest.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminUpdateUserRoleTest"> + <annotations> + <features value="User"/> + <stories value="Update User"/> + <title value="Update admin user entity by changing user role"/> + <description value="Change full access role for admin user to custom one with restricted permission (Sales)"/> + <severity value="MAJOR"/> + <testCaseId value="MC-27895"/> + <group value="user"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!--Create New User--> + <actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="goToNewUserPage"/> + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillNewUserForm"/> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="saveNewUser"/> + <!--Create New Role--> + <actionGroup ref="AdminStartCreateUserRoleActionGroup" stepKey="startCreateUserRole"> + <argument name="roleName" value="{{roleSales.name}}"/> + </actionGroup> + <actionGroup ref="AdminSaveUserRoleActionGroup" stepKey="saveNewRole"/> + </before> + <after> + <!--Delete new User--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsSaleRoleUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdmin"/> + <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> + <argument name="user" value="AdminUserWithUpdatedUserRoleToSales"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearUsersGridFilter"/> + <!--Delete new Role--> + <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteCustomRole"> + <argument name="roleName" value="{{roleSales.rolename}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearRolesGridFilter"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsDefaultAdmin"/> + </after> + <!--Assign new role--> + <actionGroup ref="AdminOpenUserEditPageActionGroup" stepKey="openUserEditPage"> + <argument name="user" value="NewAdminUser"/> + </actionGroup> + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillUserForm"> + <argument name="user" value="AdminUserWithUpdatedUserRoleToSales"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="saveUser"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You saved the user."/> + </actionGroup> + <actionGroup ref="AssertAdminUserIsInGridActionGroup" stepKey="seeUserInGrid"> + <argument name="user" value="AdminUserWithUpdatedUserRoleToSales"/> + </actionGroup> + <!--Login as restricted user--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsSaleRoleUser"> + <argument name="username" value="{{AdminUserWithUpdatedUserRoleToSales.username}}"/> + <argument name="password" value="{{AdminUserWithUpdatedUserRoleToSales.password}}"/> + </actionGroup> + <actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="seeSuccessLoginMessage"/> + <actionGroup ref="AdminOpenAdminUsersPageActionGroup" stepKey="navigateToAdminUsersPage"/> + <actionGroup ref="AssertUserRoleRestrictedAccessActionGroup" stepKey="seeErrorMessage"/> + </test> +</tests> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminUpdateUserTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminUpdateUserTest.xml index 0943b33e8a711..c94d1bee3335d 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminUpdateUserTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminUpdateUserTest.xml @@ -8,18 +8,18 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminUpdateUserTest"> + <test name="AdminUpdateUserTest" deprecated="Use AdminUpdateUserRoleTest instead."> <annotations> <features value="User"/> - <title value="Update admin user entity by changing user role"/> + <title value="DEPRECATED. Update admin user entity by changing user role"/> <stories value="Update User"/> <testCaseId value="MC-14264"/> <severity value="MAJOR"/> - <description value="Change full access role for admin user to custom one with restricted permission (Sales)"/> + <description value="DEPRECATED. Change full access role for admin user to custom one with restricted permission (Sales)"/> <group value="user"/> <group value="mtf_migrated"/> <skip> - <issueId value="MQE-1964"/> + <issueId value="DEPRECATED">Use AdminUpdateUserRoleTest instead</issueId> </skip> </annotations> diff --git a/app/code/Magento/User/etc/db_schema.xml b/app/code/Magento/User/etc/db_schema.xml index 40b5fc16848b8..e949125fca310 100644 --- a/app/code/Magento/User/etc/db_schema.xml +++ b/app/code/Magento/User/etc/db_schema.xml @@ -49,7 +49,7 @@ comment="Password ID"/> <column xsi:type="int" name="user_id" unsigned="true" nullable="false" identity="false" default="0" comment="User ID"/> - <column xsi:type="varchar" name="password_hash" nullable="true" length="100" comment="Password Hash"/> + <column xsi:type="varchar" name="password_hash" nullable="true" length="255" comment="Password Hash"/> <column xsi:type="int" name="expires" unsigned="true" nullable="false" identity="false" default="0" comment="Deprecated"/> <column xsi:type="int" name="last_updated" unsigned="true" nullable="false" identity="false" diff --git a/app/code/Magento/User/view/adminhtml/email/password_reset_confirmation.html b/app/code/Magento/User/view/adminhtml/email/password_reset_confirmation.html index 42240bff3b8db..374713cad91d6 100644 --- a/app/code/Magento/User/view/adminhtml/email/password_reset_confirmation.html +++ b/app/code/Magento/User/view/adminhtml/email/password_reset_confirmation.html @@ -7,10 +7,10 @@ <!--@subject {{trans "Password Reset Confirmation for %name" name=$username}} @--> <!--@vars { "var store.frontend_name":"Store Name", -"var user.id":"Account Holder Id", +"var user.user_id":"Account Holder Id", "var user.rp_token":"Reset Password Token", "var user.name":"Account Holder Name", -"store url=\"admin\/auth\/resetpassword\/\" _query_id=$user.id _query_token=$user.rp_token":"Reset Password URL", +"store url=\"admin\/auth\/resetpassword\/\" _query_id=$user.user_id _query_token=$user.rp_token":"Reset Password URL", "var username":"Account Holder Name" } @--> @@ -20,7 +20,7 @@ {{trans "If you requested this change, reset your password here:"}} -{{store url="admin/auth/resetpassword/" _query_id=$user.id _query_token=$user.rp_token _nosid=1}} +{{store url="admin/auth/resetpassword/" _query_id=$user.user_id _query_token=$user.rp_token _nosid=1}} {{trans "If you did not make this request, you can ignore this email and your password will remain the same."}} diff --git a/app/code/Magento/Usps/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Usps/Test/Unit/Model/CarrierTest.php index f21ee2482bee8..52235aaa58076 100644 --- a/app/code/Magento/Usps/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Usps/Test/Unit/Model/CarrierTest.php @@ -13,6 +13,7 @@ use Magento\Framework\HTTP\ZendClient; use Magento\Framework\HTTP\ZendClientFactory; use Magento\Framework\Locale\ResolverInterface; +use Magento\Framework\Pricing\PriceCurrencyInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\Xml\Security; use Magento\Quote\Model\Quote\Address\RateRequest; @@ -22,6 +23,7 @@ use Magento\Quote\Model\Quote\Address\RateResult\MethodFactory; use Magento\Shipping\Helper\Carrier as CarrierHelper; use Magento\Shipping\Model\Rate\Result; +use Magento\Shipping\Model\Rate\Result\ProxyDeferredFactory; use Magento\Shipping\Model\Rate\ResultFactory; use Magento\Shipping\Model\Shipment\ReturnShipment; use Magento\Shipping\Model\Simplexml\Element; @@ -76,6 +78,24 @@ class CarrierTest extends TestCase */ private $httpClient; + /** + * @var MockObject + */ + private $proxyDeferredFactory; + + /** + * @var array + */ + private $config = [ + 'carriers/usps/allowed_methods' => '0_FCLE,0_FCL,0_FCP,1,2,3,4,6,7,13,16,17,22,23,25,27,28,33,' . + '34,35,36,37,42,43,53,55,56,57,61,INT_1,INT_2,INT_4,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,' . + 'INT_12,INT_13,INT_14,INT_15,INT_16,INT_20,INT_26', + 'carriers/usps/showmethod' => 1, + 'carriers/usps/debug' => 1, + 'carriers/usps/userid' => 'test', + 'carriers/usps/mode' => 0, + ]; + /** * @inheritdoc */ @@ -88,7 +108,10 @@ protected function setUp(): void ->getMockForAbstractClass(); $this->scope->method('getValue') - ->willReturnCallback([$this, 'scopeConfiggetValue']); + ->willReturnCallback([$this, 'scopeConfigGetValue']); + + $this->scope->method('isSetFlag') + ->willReturnCallback([$this, 'scopeIsSetFlag']); $xmlElFactory = $this->getXmlFactory(); $rateFactory = $this->getRateFactory(); @@ -110,7 +133,7 @@ protected function setUp(): void $carrierHelper = $this->getCarrierHelper(); $productCollectionFactory = $this->getProductCollectionFactory(); - + $this->proxyDeferredFactory = $this->createMock(ProxyDeferredFactory::class); $arguments = [ 'scopeConfig' => $this->scope, 'xmlSecurity' => new Security(), @@ -123,6 +146,7 @@ protected function setUp(): void 'carrierHelper' => $carrierHelper, 'productCollectionFactory' => $productCollectionFactory, 'dataHelper' => $this->dataHelper, + 'proxyDeferredFactory' => $this->proxyDeferredFactory ]; $this->dataHelper = $this->getMockBuilder(DataHelper::class) @@ -197,17 +221,16 @@ public function testFormattingFloatValuesForIntlShipmentRequest() */ public function scopeConfigGetValue($path) { - $pathMap = [ - 'carriers/usps/allowed_methods' => '0_FCLE,0_FCL,0_FCP,1,2,3,4,6,7,13,16,17,22,23,25,27,28,33,' . - '34,35,36,37,42,43,53,55,56,57,61,INT_1,INT_2,INT_4,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,' . - 'INT_12,INT_13,INT_14,INT_15,INT_16,INT_20,INT_26', - 'carriers/usps/showmethod' => 1, - 'carriers/usps/debug' => 1, - 'carriers/usps/userid' => 'test', - 'carriers/usps/mode' => 0, - ]; + return $this->config[$path] ?? null; + } - return $pathMap[$path] ?? null; + /** + * @param $path + * @return bool + */ + public function scopeIsSetFlag($path): bool + { + return !!$this->scopeConfigGetValue($path); } /** @@ -307,6 +330,160 @@ public function isGirthAllowedDataProvider() ]; } + /** + * @param array $requestData + * @param array $result1 + * @param array $result2 + * @param array $expected + * @throws \ReflectionException + * @dataProvider updateFreeMethodQuoteDataProvider + */ + public function testUpdateFreeMethodQuote(array $requestData, array $result1, array $result2, array $expected) + { + $this->config = array_merge( + $this->config, + [ + 'carriers/usps/free_method' => 3 + ] + ); + $requestData = array_merge( + [ + 'orig_country_id' => 'US', + 'dest_country_id' => 'US' + ], + $requestData + ); + $this->proxyDeferredFactory + ->method('create') + ->willReturnOnConsecutiveCalls( + $this->createResultMock($result1), + $this->createResultMock($result2), + ); + + $request = new RateRequest($requestData); + $this->carrier->setRequest($request); + $result = $this->invokeModelMethod('_getQuotes', [$request]); + $this->setModelProperty('_result', $result); + $this->invokeModelMethod('_updateFreeMethodQuote', [$request]); + $rates = []; + foreach ($this->carrier->getResult()->getAllRates() as $rate) { + $rates[$rate->getMethod()] = $rate->getPrice(); + } + $this->assertEquals($expected, $rates); + } + + public function updateFreeMethodQuoteDataProvider(): array + { + $result1 = [ + ['method' => '1', 'method_title' => 'Priority Mail 3-Day', 'cost' => 70, 'price' => 70], + ['method' => '2', 'method_title' => 'Priority Mail 5-Day', 'cost' => 50, 'price' => 50], + ['method' => '3', 'method_title' => 'Priority Mail 7-Day', 'cost' => 30, 'price' => 30], + ]; + $result2 = [ + ['method' => '1', 'method_title' => 'Priority Mail 3-Day', 'cost' => 70, 'price' => 35], + ['method' => '2', 'method_title' => 'Priority Mail 5-Day', 'cost' => 50, 'price' => 25], + ['method' => '3', 'method_title' => 'Priority Mail 7-Day', 'cost' => 30, 'price' => 15], + ]; + + return [ + [ + [ + 'free_method_weight' => 10, + 'package_weight' => 10, + 'free_shipping' => false, + ], + $result1, + $result2, + [ + '1' => 70, + '2' => 50, + '3' => 30, + ] + ], + [ + [ + 'free_method_weight' => 10, + 'package_weight' => 20, + 'free_shipping' => false, + ], + $result1, + $result2, + [ + '1' => 70, + '2' => 50, + '3' => 15, + ] + ], + [ + [ + 'free_method_weight' => 0, + 'package_weight' => 10, + 'free_shipping' => true, + ], + $result1, + $result2, + [ + '1' => 70, + '2' => 50, + '3' => 0, + ] + ] + ]; + } + + /** + * @param string $method + * @param array $parameters + * @return mixed + * @throws \ReflectionException + */ + private function invokeModelMethod(string $method, array $parameters = []) + { + $reflection = new \ReflectionClass($this->carrier); + $method = $reflection->getMethod($method); + $method->setAccessible(true); + + return $method->invokeArgs($this->carrier, $parameters); + } + + /** + * @param string $property + * @param mixed $value + * @return void + * @throws \ReflectionException + */ + private function setModelProperty(string $property, $value): void + { + $reflection = new \ReflectionClass($this->carrier); + $property = $reflection->getProperty($property); + $property->setAccessible(true); + $property->setValue($this->carrier, $value); + } + + /** + * @param array $rates + * @return Result + */ + private function createResultMock(array $rates): Result + { + $result = $this->getMockBuilder(Result::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + foreach ($rates as $rateData) { + $price = $this->createMock(PriceCurrencyInterface::class); + $price->method('round') + ->willReturnArgument(0); + $rate = new Method( + $price, + $rateData + ['carrier' => 'usps', 'carrier_title' => 'USPS'] + ); + $result->append($rate); + } + + return $result; + } + /** * @return MockObject */ diff --git a/app/code/Magento/Vault/Test/Mftf/Test/StorefrontVerifySecureURLRedirectVaultTest.xml b/app/code/Magento/Vault/Test/Mftf/Test/StorefrontVerifySecureURLRedirectVaultTest.xml index a43d6578925b2..d32525a394d5b 100644 --- a/app/code/Magento/Vault/Test/Mftf/Test/StorefrontVerifySecureURLRedirectVaultTest.xml +++ b/app/code/Magento/Vault/Test/Mftf/Test/StorefrontVerifySecureURLRedirectVaultTest.xml @@ -28,15 +28,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> </after> <executeJS function="return window.location.host" stepKey="hostname"/> diff --git a/app/code/Magento/Weee/Model/Config.php b/app/code/Magento/Weee/Model/Config.php index 1d3e25eebdcf4..49a2c6e5e2052 100644 --- a/app/code/Magento/Weee/Model/Config.php +++ b/app/code/Magento/Weee/Model/Config.php @@ -38,6 +38,11 @@ class Config */ protected $scopeConfig; + /** + * @var \Magento\Tax\Helper\Data + */ + private $taxHelper; + /** * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig diff --git a/app/code/Magento/Weee/Plugin/Catalog/Ui/Component/Listing/Columns.php b/app/code/Magento/Weee/Plugin/Catalog/Ui/Component/Listing/Columns.php new file mode 100644 index 0000000000000..8716884b6a5ea --- /dev/null +++ b/app/code/Magento/Weee/Plugin/Catalog/Ui/Component/Listing/Columns.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Weee\Plugin\Catalog\Ui\Component\Listing; + +use Magento\Catalog\Ui\Component\Listing\Attribute\Repository; +use Magento\Catalog\Ui\Component\Listing\Columns as DefaultColumns; +use Magento\Weee\Model\Attribute\Backend\Weee\Tax; + +/** + * Class Columns + */ +class Columns +{ + /** + * @var Repository + */ + private $attributeRepository; + + /** + * @param Repository $attributeRepository + */ + public function __construct( + Repository $attributeRepository + ) { + $this->attributeRepository = $attributeRepository; + } + + /** + * Makes column for FPT attribute in grid not sortable + * + * @param DefaultColumns $subject + */ + public function afterPrepare(DefaultColumns $subject) : void + { + foreach ($this->attributeRepository->getList() as $attribute) { + if ($attribute->getBackendModel() === Tax::class) { + $column = $subject->getComponent($attribute->getAttributeCode()); + $columnConfig = $column->getData('config'); + $columnConfig['sortable'] = false; + $column->setData('config', $columnConfig); + } + } + } +} diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml index ccbd431848dbc..be4050a010f58 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml @@ -51,12 +51,8 @@ <!--Set catalog price scope to Global--> <comment userInput="Set catalog price scope to Global" stepKey="commentSetPriceScope"/> <magentoCLI command="config:set catalog/price/scope 0" stepKey="setPriceScopeGlobal"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="catalog_product_price"/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!--Set catalog price scope to Global--> @@ -101,12 +97,8 @@ <!--Set catalog price scope to Website--> <comment userInput="Set catalog price scope to Website" stepKey="commentSetPriceScope"/> <magentoCLI command="config:set catalog/price/scope 1" stepKey="setPriceScopeWebsite"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="catalog_product_price"/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--See available websites only 'All Websites'--> <comment userInput="See available websites 'All Websites', 'Main Website' and Second website" stepKey="commentCheckWebsitesInProductPage"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductPageSecondTime"> diff --git a/app/code/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Manager/Website.php b/app/code/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Manager/Website.php index 476e20bd9861d..2a8a8ef91db5b 100644 --- a/app/code/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Manager/Website.php +++ b/app/code/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Manager/Website.php @@ -27,6 +27,21 @@ class Website */ private $websites; + /** + * @var LocatorInterface + */ + private $locator; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var DirectoryHelper + */ + private $directoryHelper; + /** * @var Data */ diff --git a/app/code/Magento/Weee/etc/di.xml b/app/code/Magento/Weee/etc/di.xml index ccc849f4d8493..fa3fafc5a914a 100644 --- a/app/code/Magento/Weee/etc/di.xml +++ b/app/code/Magento/Weee/etc/di.xml @@ -84,4 +84,7 @@ <type name="Magento\Catalog\Model\ResourceModel\Attribute\RemoveProductAttributeData"> <plugin name="removeWeeAttributesData" type="Magento\Weee\Plugin\Catalog\ResourceModel\Attribute\RemoveProductWeeData" /> </type> + <type name="Magento\Catalog\Ui\Component\Listing\Columns"> + <plugin name="changeWeeColumnConfig" type="Magento\Weee\Plugin\Catalog\Ui\Component\Listing\Columns"/> + </type> </config> diff --git a/app/code/Magento/Weee/view/adminhtml/templates/renderer/tax.phtml b/app/code/Magento/Weee/view/adminhtml/templates/renderer/tax.phtml index 1eff06bb4b985..d50fb0c454011 100644 --- a/app/code/Magento/Weee/view/adminhtml/templates/renderer/tax.phtml +++ b/app/code/Magento/Weee/view/adminhtml/templates/renderer/tax.phtml @@ -4,8 +4,7 @@ * See COPYING.txt for license details. */ -?> -<?php +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** * @var $block \Magento\Weee\Block\Renderer\Weee\Tax * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer diff --git a/app/code/Magento/WeeeGraphQl/Model/Resolver/Quote/FixedProductTax.php b/app/code/Magento/WeeeGraphQl/Model/Resolver/Quote/FixedProductTax.php new file mode 100644 index 0000000000000..3200887bf595d --- /dev/null +++ b/app/code/Magento/WeeeGraphQl/Model/Resolver/Quote/FixedProductTax.php @@ -0,0 +1,84 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\WeeeGraphQl\Model\Resolver\Quote; + +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Tax\Helper\Data as TaxHelper; +use Magento\Tax\Model\Config; +use Magento\Weee\Helper\Data; + +/** + * Resolver for FixedProductTax object that retrieves an array of FPT applied to a cart item + */ +class FixedProductTax implements ResolverInterface +{ + /** + * @var Data + */ + private $weeeHelper; + + /** + * @var TaxHelper + */ + private $taxHelper; + + /** + * @param Data $weeeHelper + * @param TaxHelper $taxHelper + */ + public function __construct(Data $weeeHelper, TaxHelper $taxHelper) + { + $this->weeeHelper = $weeeHelper; + $this->taxHelper = $taxHelper; + } + + /** + * @inheritdoc + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + if (!isset($value['model'])) { + throw new LocalizedException(__('"model" value should be specified')); + } + + $fptArray = []; + $cartItem = $value['model']; + + /** @var StoreInterface $store */ + $store = $context->getExtensionAttributes()->getStore(); + + if ($this->weeeHelper->isEnabled($store)) { + $taxes = $this->weeeHelper->getApplied($cartItem); + $displayInclTaxes = $this->taxHelper->getPriceDisplayType($store); + foreach ($taxes as $tax) { + $amount = $tax['amount']; + if ($displayInclTaxes === Config::DISPLAY_TYPE_INCLUDING_TAX) { + $amount = $tax['amount_incl_tax']; + } + $fptArray[] = [ + 'amount' => [ + 'value' => $amount, + 'currency' => $value['price']['currency'], + ], + 'label' => $tax['title'] + ]; + } + } + + return $fptArray; + } +} diff --git a/app/code/Magento/WeeeGraphQl/Test/Unit/Model/Resolver/FixedProductTaxResolverTest.php b/app/code/Magento/WeeeGraphQl/Test/Unit/Model/Resolver/FixedProductTaxResolverTest.php new file mode 100644 index 0000000000000..15edec0dd6145 --- /dev/null +++ b/app/code/Magento/WeeeGraphQl/Test/Unit/Model/Resolver/FixedProductTaxResolverTest.php @@ -0,0 +1,284 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\WeeeGraphQl\Test\Unit\Model\Resolver; + +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\GraphQl\Model\Query\ContextExtensionInterface; +use Magento\Quote\Api\Data\CartItemInterface; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Tax\Helper\Data as TaxHelper; +use Magento\Weee\Helper\Data as WeeeHelper; +use Magento\WeeeGraphQl\Model\Resolver\Quote\FixedProductTax; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test FPT resolver for cart item + */ +class FixedProductTaxResolverTest extends TestCase +{ + /** + * @var MockObject|ContextInterface + */ + private $context; + + /** + * @var MockObject|WeeeHelper + */ + private $weeeHelper; + + /** + * @var TaxHelper|MockObject + */ + private $taxHelper; + + /** + * @var FixedProductTax + */ + private $resolver; + + /** + * @var array[] + */ + private $fpts = [ + [ + "title" => "FPT 2", + "base_amount" => "0.5000", + "amount" => 0.5, + "row_amount" => 1.0, + "base_row_amount" => 1.0, + "base_amount_incl_tax" => "0.5500", + "amount_incl_tax" => 0.55, + "row_amount_incl_tax" => 1.1, + "base_row_amount_incl_tax" => 1.1 + ], + [ + "title" => "FPT 1", + "base_amount" => "1.0000", + "amount" => 1, + "row_amount" => 2, + "base_row_amount" => 2, + "base_amount_incl_tax" => "1.1000", + "amount_incl_tax" => 1.1, + "row_amount_incl_tax" => 2.2, + "base_row_amount_incl_tax" => 2.2 + ], + [ + "title" => "FPT 2", + "base_amount" => "1.5000", + "amount" => 1.5, + "row_amount" => 3.0, + "base_row_amount" => 3.0, + "base_amount_incl_tax" => "1.6500", + "amount_incl_tax" => 1.65, + "row_amount_incl_tax" => 3.30, + "base_row_amount_incl_tax" => 3.30 + ] + ]; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->context = $this->getMockBuilder(ContextInterface::class) + ->setMethods(['getExtensionAttributes']) + ->getMockForAbstractClass(); + + $this->weeeHelper = $this->getMockBuilder(WeeeHelper::class) + ->disableOriginalConstructor() + ->onlyMethods(['isEnabled', 'getApplied']) + ->getMock(); + $this->taxHelper = $this->getMockBuilder(TaxHelper::class) + ->disableOriginalConstructor() + ->onlyMethods(['getPriceDisplayType']) + ->getMock(); + + $this->resolver = new FixedProductTax( + $this->weeeHelper, + $this->taxHelper, + ); + } + + /** + * Verifies that exception is thrown if model is not specified + */ + public function testShouldThrowException(): void + { + $this->expectException(LocalizedException::class); + $this->expectExceptionMessageMatches('/value should be specified/'); + + $this->resolver->resolve( + $this->getFieldStub(), + null, + $this->getResolveInfoStub() + ); + } + + /** + * Verifies that result is empty if FPT config is disabled + */ + public function testShouldReturnEmptyResult(): void + { + $store = $this->createMock(StoreInterface::class); + $cartItem = $this->createMock(CartItemInterface::class); + $contextExtensionAttributes = $this->createMock(ContextExtensionInterface::class); + $contextExtensionAttributes->method('getStore') + ->willreturn($store); + $this->context->method('getExtensionAttributes') + ->willReturn($contextExtensionAttributes); + + $this->weeeHelper->method('isEnabled') + ->with($store) + ->willReturn(false); + + $this->weeeHelper->expects($this->never()) + ->method('getApplied'); + + $this->assertEquals( + [], + $this->resolver->resolve( + $this->getFieldStub(), + $this->context, + $this->getResolveInfoStub(), + ['model' => $cartItem] + ) + ); + } + + /** + * @dataProvider shouldReturnResultDataProvider + * @param int $displayType + * @param array $expected + */ + public function testShouldReturnResult(int $displayType, array $expected): void + { + $store = $this->createMock(StoreInterface::class); + $cartItem = $this->createMock(CartItemInterface::class); + $contextExtensionAttributes = $this->createMock(ContextExtensionInterface::class); + $contextExtensionAttributes->method('getStore') + ->willreturn($store); + $this->context->method('getExtensionAttributes') + ->willReturn($contextExtensionAttributes); + + $this->weeeHelper->method('isEnabled') + ->with($store) + ->willReturn(true); + + $this->weeeHelper->expects($this->once()) + ->method('getApplied') + ->willReturn($this->fpts); + + $this->taxHelper->expects($this->once()) + ->method('getPriceDisplayType') + ->willReturn($displayType); + + $this->assertEquals( + $expected, + $this->resolver->resolve( + $this->getFieldStub(), + $this->context, + $this->getResolveInfoStub(), + [ + 'model' => $cartItem, + 'price' => [ + 'currency' => 'USD' + ] + ] + ) + ); + } + + /** + * @return array + */ + public function shouldReturnResultDataProvider(): array + { + return [ + [ + 1, + [ + [ + 'label' => 'FPT 2', + 'amount' => [ + 'value' => 0.5, + 'currency' => 'USD' + ] + ], + [ + 'label' => 'FPT 1', + 'amount' => [ + 'value' => 1, + 'currency' => 'USD' + ] + ], + [ + 'label' => 'FPT 2', + 'amount' => [ + 'value' => 1.5, + 'currency' => 'USD' + ] + ] + ] + ], + [ + 2, + [ + [ + 'label' => 'FPT 2', + 'amount' => [ + 'value' => 0.55, + 'currency' => 'USD' + ] + ], + [ + 'label' => 'FPT 1', + 'amount' => [ + 'value' => 1.1, + 'currency' => 'USD' + ] + ], + [ + 'label' => 'FPT 2', + 'amount' => [ + 'value' => 1.65, + 'currency' => 'USD' + ] + ] + ] + ] + ]; + } + + /** + * @return MockObject|Field + */ + private function getFieldStub(): Field + { + /** @var MockObject|Field $fieldMock */ + $fieldMock = $this->getMockBuilder(Field::class) + ->disableOriginalConstructor() + ->getMock(); + return $fieldMock; + } + + /** + * @return MockObject|ResolveInfo + */ + private function getResolveInfoStub(): ResolveInfo + { + /** @var MockObject|ResolveInfo $resolveInfoMock */ + $resolveInfoMock = $this->getMockBuilder(ResolveInfo::class) + ->disableOriginalConstructor() + ->getMock(); + return $resolveInfoMock; + } +} diff --git a/app/code/Magento/WeeeGraphQl/etc/schema.graphqls b/app/code/Magento/WeeeGraphQl/etc/schema.graphqls index 18b0e7c1823e8..6d212f25618e2 100644 --- a/app/code/Magento/WeeeGraphQl/etc/schema.graphqls +++ b/app/code/Magento/WeeeGraphQl/etc/schema.graphqls @@ -10,6 +10,10 @@ type ProductPrice { fixed_product_taxes: [FixedProductTax] @doc(description: "The multiple FPTs that can be applied to a product price.") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\FixedProductTax") } +type CartItemPrices { + fixed_product_taxes: [FixedProductTax] @doc(description: "Applied FPT to the cart item.") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\Quote\\FixedProductTax") +} + type FixedProductTax @doc(description: "A single FPT that can be applied to a product price.") { amount: Money @doc(description: "Amount of the FPT as a money object.") label: String @doc(description: "The label assigned to the FPT to be displayed on the frontend.") diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php index 068da79dc196c..cdc56b6c9ccf9 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php @@ -3,8 +3,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\View\Element\Context; +use Magento\Framework\View\Element\Html\Select; +use Magento\Framework\View\Layout\ProcessorFactory; +use Magento\Framework\View\Model\PageLayout\Config\BuilderInterface as PageLayoutConfigBuilder; +use Magento\Theme\Model\ResourceModel\Theme\CollectionFactory; + /** * A chooser for container for widget instances * @@ -13,10 +22,12 @@ * @method \Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\Container setTheme($theme) * @method \Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\Container setArea($area) */ -class Container extends \Magento\Framework\View\Element\Html\Select +class Container extends Select { /**#@+ * Frontend page layouts + * @deprecated hardcoded list was replaced with checking actual existing layouts + * @see \Magento\Framework\View\Model\PageLayout\Config\BuilderInterface::getPageLayoutsConfig */ const PAGE_LAYOUT_1COLUMN = '1column-center'; const PAGE_LAYOUT_2COLUMNS_LEFT = '2columns-left'; @@ -24,29 +35,40 @@ class Container extends \Magento\Framework\View\Element\Html\Select const PAGE_LAYOUT_3COLUMNS = '3columns'; /**#@-*/ - /**#@-*/ + /** + * @var ProcessorFactory + */ protected $_layoutProcessorFactory; /** - * @var \Magento\Theme\Model\ResourceModel\Theme\CollectionFactory + * @var CollectionFactory */ protected $_themesFactory; /** - * @param \Magento\Framework\View\Element\Context $context - * @param \Magento\Framework\View\Layout\ProcessorFactory $layoutProcessorFactory - * @param \Magento\Theme\Model\ResourceModel\Theme\CollectionFactory $themesFactory + * @var PageLayoutConfigBuilder + */ + private $pageLayoutConfigBuilder; + + /** + * @param Context $context + * @param ProcessorFactory $layoutProcessorFactory + * @param CollectionFactory $themesFactory * @param array $data + * @param PageLayoutConfigBuilder|null $pageLayoutConfigBuilder */ public function __construct( - \Magento\Framework\View\Element\Context $context, - \Magento\Framework\View\Layout\ProcessorFactory $layoutProcessorFactory, - \Magento\Theme\Model\ResourceModel\Theme\CollectionFactory $themesFactory, - array $data = [] + Context $context, + ProcessorFactory $layoutProcessorFactory, + CollectionFactory $themesFactory, + array $data = [], + PageLayoutConfigBuilder $pageLayoutConfigBuilder = null ) { + parent::__construct($context, $data); $this->_layoutProcessorFactory = $layoutProcessorFactory; $this->_themesFactory = $themesFactory; - parent::__construct($context, $data); + $this->pageLayoutConfigBuilder = $pageLayoutConfigBuilder + ?? ObjectManager::getInstance()->get(PageLayoutConfigBuilder::class); } /** @@ -101,6 +123,7 @@ protected function _beforeToHtml() $this->addOption($containerName, $containerLabel); } } + return parent::_beforeToHtml(); } @@ -108,12 +131,14 @@ protected function _beforeToHtml() * Retrieve theme instance by its identifier * * @param int $themeId + * * @return \Magento\Theme\Model\Theme|null */ protected function _getThemeInstance($themeId) { /** @var \Magento\Theme\Model\ResourceModel\Theme\Collection $themeCollection */ $themeCollection = $this->_themesFactory->create(); + return $themeCollection->getItemById($themeId); } @@ -124,11 +149,8 @@ protected function _getThemeInstance($themeId) */ protected function getPageLayouts() { - return [ - self::PAGE_LAYOUT_1COLUMN, - self::PAGE_LAYOUT_2COLUMNS_LEFT, - self::PAGE_LAYOUT_2COLUMNS_RIGHT, - self::PAGE_LAYOUT_3COLUMNS, - ]; + $pageLayoutsConfig = $this->pageLayoutConfigBuilder->getPageLayoutsConfig(); + + return array_keys($pageLayoutsConfig->getPageLayouts()); } } diff --git a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Template.php b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Template.php index 14270cfc1542f..af7005d2cf72f 100644 --- a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Template.php +++ b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Template.php @@ -6,7 +6,9 @@ */ namespace Magento\Widget\Controller\Adminhtml\Widget\Instance; -class Template extends \Magento\Widget\Controller\Adminhtml\Widget\Instance +use Magento\Framework\App\Action\HttpPostActionInterface; + +class Template extends \Magento\Widget\Controller\Adminhtml\Widget\Instance implements HttpPostActionInterface { /** * Templates Chooser Action (Ajax request) @@ -17,7 +19,7 @@ public function execute() { /* @var $widgetInstance \Magento\Widget\Model\Widget\Instance */ $widgetInstance = $this->_initWidgetInstance(); - $block = $this->getRequest()->getParam('block'); + $block = $this->getRequest()->getParam('block', ''); $selected = $this->getRequest()->getParam('selected', null); $templateChooser = $this->_view->getLayout()->createBlock( \Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\Template::class diff --git a/app/code/Magento/Widget/Model/Template/Filter.php b/app/code/Magento/Widget/Model/Template/Filter.php index c79334f67a9c3..5f412018ba87a 100644 --- a/app/code/Magento/Widget/Model/Template/Filter.php +++ b/app/code/Magento/Widget/Model/Template/Filter.php @@ -5,6 +5,25 @@ */ namespace Magento\Widget\Model\Template; +use Magento\Email\Model\Template\Css; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\State; +use Magento\Framework\Css\PreProcessor\Adapter\CssInliner; +use Magento\Framework\Escaper; +use Magento\Framework\Filesystem; +use Magento\Framework\Filter\VariableResolverInterface; +use Magento\Framework\Stdlib\StringUtils; +use Magento\Framework\UrlInterface; +use Magento\Framework\View\Asset\Repository; +use Magento\Framework\View\LayoutFactory; +use Magento\Framework\View\LayoutInterface; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Variable\Model\Source\Variables; +use Magento\Variable\Model\VariableFactory; +use Magento\Widget\Block\BlockInterface; +use Magento\Widget\Model\Widget; +use Psr\Log\LoggerInterface; + /** * Template Filter Model * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -17,44 +36,55 @@ class Filter extends \Magento\Cms\Model\Template\Filter protected $_widgetResource; /** - * @var \Magento\Widget\Model\Widget + * @var Widget */ protected $_widget; /** - * @param \Magento\Framework\Stdlib\StringUtils $string - * @param \Psr\Log\LoggerInterface $logger - * @param \Magento\Framework\Escaper $escaper - * @param \Magento\Framework\View\Asset\Repository $assetRepo - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Variable\Model\VariableFactory $coreVariableFactory - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\View\LayoutInterface $layout - * @param \Magento\Framework\View\LayoutFactory $layoutFactory - * @param \Magento\Framework\App\State $appState - * @param \Magento\Framework\UrlInterface $urlModel - * @param \Pelago\Emogrifier $emogrifier - * @param \Magento\Variable\Model\Source\Variables $configVariables + * Filter constructor. + * @param StringUtils $string + * @param LoggerInterface $logger + * @param Escaper $escaper + * @param Repository $assetRepo + * @param ScopeConfigInterface $scopeConfig + * @param VariableFactory $coreVariableFactory + * @param StoreManagerInterface $storeManager + * @param LayoutInterface $layout + * @param LayoutFactory $layoutFactory + * @param State $appState + * @param UrlInterface $urlModel + * @param Variables $configVariables + * @param VariableResolverInterface $variableResolver + * @param Css\Processor $cssProcessor + * @param Filesystem $pubDirectory + * @param CssInliner $cssInliner * @param \Magento\Widget\Model\ResourceModel\Widget $widgetResource - * @param \Magento\Widget\Model\Widget $widget + * @param Widget $widget + * @param array $variables + * @param array $directiveProcessors * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\Stdlib\StringUtils $string, - \Psr\Log\LoggerInterface $logger, - \Magento\Framework\Escaper $escaper, - \Magento\Framework\View\Asset\Repository $assetRepo, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Variable\Model\VariableFactory $coreVariableFactory, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\View\LayoutInterface $layout, - \Magento\Framework\View\LayoutFactory $layoutFactory, - \Magento\Framework\App\State $appState, - \Magento\Framework\UrlInterface $urlModel, - \Pelago\Emogrifier $emogrifier, - \Magento\Variable\Model\Source\Variables $configVariables, + StringUtils $string, + LoggerInterface $logger, + Escaper $escaper, + Repository $assetRepo, + ScopeConfigInterface $scopeConfig, + VariableFactory $coreVariableFactory, + StoreManagerInterface $storeManager, + LayoutInterface $layout, + LayoutFactory $layoutFactory, + State $appState, + UrlInterface $urlModel, + Variables $configVariables, + VariableResolverInterface $variableResolver, + Css\Processor $cssProcessor, + Filesystem $pubDirectory, + CssInliner $cssInliner, \Magento\Widget\Model\ResourceModel\Widget $widgetResource, - \Magento\Widget\Model\Widget $widget + Widget $widget, + $variables = [], + array $directiveProcessors = [] ) { $this->_widgetResource = $widgetResource; $this->_widget = $widget; @@ -70,8 +100,13 @@ public function __construct( $layoutFactory, $appState, $urlModel, - $emogrifier, - $configVariables + $configVariables, + $variableResolver, + $cssProcessor, + $pubDirectory, + $cssInliner, + $variables, + $directiveProcessors ); } @@ -114,7 +149,7 @@ public function generateWidget($construction) // define widget block and check the type is instance of Widget Interface $widget = $this->_layout->createBlock($type, $name, ['data' => $params]); - if (!$widget instanceof \Magento\Widget\Block\BlockInterface) { + if (!$widget instanceof BlockInterface) { return ''; } @@ -140,8 +175,9 @@ public function widgetDirective($construction) */ public function mediaDirective($construction) { + // phpcs:disable Magento2.Functions.DiscouragedFunction $params = $this->getParameters(html_entity_decode($construction[2], ENT_QUOTES)); return $this->_storeManager->getStore() - ->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . $params['url']; + ->getBaseUrl(UrlInterface::URL_TYPE_MEDIA) . $params['url']; } } diff --git a/app/code/Magento/Widget/Model/Widget/Instance.php b/app/code/Magento/Widget/Model/Widget/Instance.php index 7f4e3ae8610ba..f65c94abfd194 100644 --- a/app/code/Magento/Widget/Model/Widget/Instance.php +++ b/app/code/Magento/Widget/Model/Widget/Instance.php @@ -6,7 +6,13 @@ namespace Magento\Widget\Model\Widget; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Config\Dom\ValidationException; +use Magento\Framework\Config\Dom\ValidationSchemaException; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Serialize\Serializer\Json; +use Magento\Framework\Simplexml\Element; +use Magento\Framework\View\Model\Layout\Update\ValidatorFactory; /** * Widget Instance Model @@ -39,7 +45,7 @@ class Instance extends \Magento\Framework\Model\AbstractModel * @deprecated see self::SINGLE_PRODUCT_LAYOUT_HANDLE */ const SINGLE_PRODUCT_LAYOUT_HANLDE = self::SINGLE_PRODUCT_LAYOUT_HANDLE; - + const SINGLE_PRODUCT_LAYOUT_HANDLE = 'catalog_product_view_id_{{ID}}'; const PRODUCT_TYPE_LAYOUT_HANDLE = 'catalog_product_view_type_{{TYPE}}'; @@ -61,7 +67,7 @@ class Instance extends \Magento\Framework\Model\AbstractModel protected $_specificEntitiesLayoutHandles = []; /** - * @var \Magento\Framework\Simplexml\Element + * @var Element */ protected $_widgetConfigXml = null; @@ -134,6 +140,11 @@ class Instance extends \Magento\Framework\Model\AbstractModel */ private $serializer; + /** + * @var ValidatorFactory + */ + private $xmlValidatorFactory; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -152,6 +163,7 @@ class Instance extends \Magento\Framework\Model\AbstractModel * @param array $relatedCacheTypes * @param array $data * @param \Magento\Framework\Serialize\Serializer\Json $serializer + * @param ValidatorFactory|null $xmlValidatorFactory * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -171,7 +183,8 @@ public function __construct( \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $relatedCacheTypes = [], array $data = [], - Json $serializer = null + Json $serializer = null, + ValidatorFactory $xmlValidatorFactory = null ) { $this->_escaper = $escaper; $this->_viewFileSystem = $viewFileSystem; @@ -184,7 +197,8 @@ public function __construct( $this->conditionsHelper = $conditionsHelper; $this->_directory = $filesystem->getDirectoryRead(DirectoryList::ROOT); $this->_namespaceResolver = $namespaceResolver; - $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()->get(Json::class); + $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class); + $this->xmlValidatorFactory = $xmlValidatorFactory ?? ObjectManager::getInstance()->get(ValidatorFactory::class); parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -477,26 +491,38 @@ public function getWidgetConfigAsArray() $isReadable = $configFile && $this->_directory->isReadable($this->_directory->getRelativePath($configFile)); if ($isReadable) { - $config = $this->_reader->readFile($configFile); - $widgetName = isset($this->_widgetConfigXml['name']) ? $this->_widgetConfigXml['name'] : null; - $themeWidgetConfig = null; - if ($widgetName !== null) { - foreach ($config as $widget) { - if (isset($widget['name']) && $widgetName === $widget['name']) { - $themeWidgetConfig = $widget; - break; - } - } - } - if ($themeWidgetConfig) { - $this->_widgetConfigXml = array_replace_recursive($this->_widgetConfigXml, $themeWidgetConfig); - } + $this->addThemeWidgetConfig($configFile); } } } return $this->_widgetConfigXml; } + /** + * Add config data from theme config xml. + * + * @param string $configFile + */ + private function addThemeWidgetConfig(string $configFile): void + { + $config = $this->_reader->readFile($configFile); + $widgetName = isset($this->_widgetConfigXml['name']) ? $this->_widgetConfigXml['name'] : null; + $themeWidgetConfig = null; + + if ($widgetName !== null) { + foreach ($config as $widget) { + if (isset($widget['name']) && $widgetName === $widget['name']) { + $themeWidgetConfig = $widget; + break; + } + } + } + + if ($themeWidgetConfig) { + $this->_widgetConfigXml = array_replace_recursive($this->_widgetConfigXml, $themeWidgetConfig); + } + } + /** * Retrieve widget available templates * @@ -548,29 +574,49 @@ public function getWidgetSupportedContainers() */ public function getWidgetSupportedTemplatesByContainer($containerName) { - $templates = []; $widgetTemplates = $this->getWidgetTemplates(); $widgetConfig = $this->getWidgetConfigAsArray(); if (isset($widgetConfig)) { - if (!isset($widgetConfig['supported_containers'])) { - return $widgetTemplates; - } - $configNodes = $widgetConfig['supported_containers']; - foreach ($configNodes as $node) { - if (isset($node['container_name']) && (string)$node['container_name'] == $containerName) { - if (isset($node['template'])) { - $templateChildren = $node['template']; - foreach ($templateChildren as $template) { - if (isset($widgetTemplates[(string)$template])) { - $templates[] = $widgetTemplates[(string)$template]; - } + return $this->getWidgetTemplatesFromConfig($widgetConfig, $widgetTemplates, $containerName); + } else { + return $widgetTemplates; + } + } + + /** + * Return widget templates from widget config. + * + * @param array $widgetConfig + * @param array $widgetTemplates + * @param string $containerName + * @return array + */ + private function getWidgetTemplatesFromConfig( + array $widgetConfig, + array $widgetTemplates, + string $containerName + ): array { + $templates = []; + + if (!isset($widgetConfig['supported_containers'])) { + return $widgetTemplates; + } + + $configNodes = $widgetConfig['supported_containers']; + + foreach ($configNodes as $node) { + if (isset($node['container_name']) && (string)$node['container_name'] == $containerName) { + if (isset($node['template'])) { + $templateChildren = $node['template']; + foreach ($templateChildren as $template) { + if (isset($widgetTemplates[(string)$template])) { + $templates[] = $widgetTemplates[(string)$template]; } } } } - } else { - return $widgetTemplates; } + return $templates; } @@ -593,6 +639,7 @@ public function generateLayoutUpdateXml($container, $templatePath = '') 'module' => \Magento\Framework\View\Element\AbstractBlock::extractModuleName($this->getType()) ] ); + // phpcs:ignore Magento2.Functions.DiscouragedFunction if (!$this->getId() && !$this->isCompleteToCreate() || $templatePath && !is_readable($templateFilename)) { return ''; } @@ -616,6 +663,7 @@ public function generateLayoutUpdateXml($container, $templatePath = '') $value = implode(',', $value); } if ($name && strlen((string)$value)) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction $value = html_entity_decode($value); $xml .= '<action method="setData">' . '<argument name="name" xsi:type="string">' . @@ -629,9 +677,31 @@ public function generateLayoutUpdateXml($container, $templatePath = '') } $xml .= '</block></referenceContainer></body>'; + $this->validateLayoutUpdateXml($xml); + return $xml; } + /** + * Check if generated layout update xml is valid. + * + * @param string $xml + * @return void + * @throws LocalizedException + */ + private function validateLayoutUpdateXml(string $xml): void + { + $xmlValidator = $this->xmlValidatorFactory->create(); + + try { + if (!$xmlValidator->isValid($xml)) { + throw new LocalizedException(__('Layout update is invalid')); + } + } catch (ValidationException|ValidationSchemaException $e) { + throw new LocalizedException(__('Layout update is invalid')); + } + } + /** * Invalidate related cache types * diff --git a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml index dea2f6d1f80d6..c37e23d56825b 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml @@ -31,9 +31,8 @@ </after> <!-- Create a CMS page containing the New Products widget --> - - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnCmsList"/> - <waitForPageLoad stepKey="waitForCmsList"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnCmsList"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsList"/> <actionGroup ref="AdminClickAddNewPageOnPagesGridActionGroup" stepKey="clickAddNewPageButton"/> <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_newDefaultCmsPage.title}}" stepKey="fillPageTitle"/> <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="expandContentSection"/> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml index d1c0626689a40..f371b2ab471ac 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml @@ -32,8 +32,8 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> </after> <!-- Create a CMS page containing the Products List widget --> - <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnCmsList"/> - <waitForPageLoad stepKey="waitForCmsList"/> + <actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="amOnCmsList"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCmsList"/> <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> <actionGroup ref="AdminClickAddNewPageOnPagesGridActionGroup" stepKey="clickAddNewPageButton"/> <fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_newDefaultCmsPage.title}}" stepKey="fillPageTitle"/> diff --git a/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/AbstractContainerTest.php b/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/AbstractContainerTest.php index 821400183ed33..3ef1d96d45b70 100644 --- a/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/AbstractContainerTest.php +++ b/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/AbstractContainerTest.php @@ -12,15 +12,19 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Escaper; use Magento\Framework\Event\Manager; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\Framework\View\Layout\ProcessorFactory; use Magento\Framework\View\Model\Layout\Merge; +use Magento\Framework\View\Model\PageLayout\Config\BuilderInterface as PageLayoutConfigBuilder; +use Magento\Framework\View\PageLayout\Config as PageLayoutConfig; use Magento\Theme\Model\ResourceModel\Theme\Collection; use Magento\Theme\Model\ResourceModel\Theme\CollectionFactory; use Magento\Theme\Model\Theme; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ abstract class AbstractContainerTest extends TestCase { /** @@ -69,17 +73,15 @@ abstract class AbstractContainerTest extends TestCase protected $escaperMock; /** - * @var ObjectManagerHelper + * @var PageLayoutConfigBuilder|MockObject */ - protected $objectManagerHelper; + protected $pageLayoutConfigBuilderMock; /** * @return void */ protected function setUp(): void { - $this->objectManagerHelper = new ObjectManagerHelper($this); - $this->eventManagerMock = $this->getMockBuilder(Manager::class) ->setMethods(['dispatch']) ->disableOriginalConstructor() @@ -116,7 +118,7 @@ protected function setUp(): void Escaper::class, ['escapeHtml', 'escapeHtmlAttr'] ); - $this->escaperMock->expects($this->any())->method('escapeHtmlAttr')->willReturnArgument(0); + $this->escaperMock->method('escapeHtmlAttr')->willReturnArgument(0); $this->contextMock = $this->getMockBuilder(Context::class) ->setMethods(['getEventManager', 'getScopeConfig', 'getEscaper']) @@ -125,5 +127,16 @@ protected function setUp(): void $this->contextMock->expects($this->once())->method('getEventManager')->willReturn($this->eventManagerMock); $this->contextMock->expects($this->once())->method('getScopeConfig')->willReturn($this->scopeConfigMock); $this->contextMock->expects($this->once())->method('getEscaper')->willReturn($this->escaperMock); + + $this->pageLayoutConfigBuilderMock = $this->getMockBuilder(PageLayoutConfigBuilder::class) + ->getMockForAbstractClass(); + $pageLayoutConfigMock = $this->getMockBuilder(PageLayoutConfig::class) + ->onlyMethods(['getPageLayouts']) + ->disableOriginalConstructor() + ->getMock(); + $pageLayoutConfigMock->method('getPageLayouts') + ->willReturn(['empty' => 'Empty']); + $this->pageLayoutConfigBuilderMock->method('getPageLayoutsConfig') + ->willReturn($pageLayoutConfigMock); } } diff --git a/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php b/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php index 531ca121d7cfd..8eba9595ef20a 100644 --- a/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php +++ b/app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php @@ -23,13 +23,12 @@ protected function setUp(): void { parent::setUp(); - $this->containerBlock = $this->objectManagerHelper->getObject( - Container::class, - [ - 'context' => $this->contextMock, - 'themesFactory' => $this->themeCollectionFactoryMock, - 'layoutProcessorFactory' => $this->layoutProcessorFactoryMock - ] + $this->containerBlock = new Container( + $this->contextMock, + $this->layoutProcessorFactoryMock, + $this->themeCollectionFactoryMock, + [], + $this->pageLayoutConfigBuilderMock ); } diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index 2cf8429095ce7..3014c99a35a14 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -10,6 +10,7 @@ "magento/module-backend": "*", "magento/module-catalog": "*", "magento/module-cms": "*", + "magento/module-email": "*", "magento/module-store": "*", "magento/module-theme": "*", "magento/module-variable": "*", diff --git a/app/code/Magento/Widget/etc/db_schema.xml b/app/code/Magento/Widget/etc/db_schema.xml index 565866bcded06..238fe1c584531 100644 --- a/app/code/Magento/Widget/etc/db_schema.xml +++ b/app/code/Magento/Widget/etc/db_schema.xml @@ -70,7 +70,7 @@ <constraint xsi:type="foreign" referenceId="WIDGET_INSTANCE_PAGE_LYT_LYT_UPDATE_ID_LYT_UPDATE_LYT_UPDATE_ID" table="widget_instance_page_layout" column="layout_update_id" referenceTable="layout_update" referenceColumn="layout_update_id" onDelete="CASCADE"/> - <constraint xsi:type="unique" referenceId="WIDGET_INSTANCE_PAGE_LAYOUT_LAYOUT_UPDATE_ID_PAGE_ID"> + <constraint xsi:type="primary" referenceId="WIDGET_INSTANCE_PAGE_LAYOUT_LAYOUT_UPDATE_ID_PAGE_ID"> <column name="layout_update_id"/> <column name="page_id"/> </constraint> diff --git a/app/code/Magento/Widget/etc/db_schema_whitelist.json b/app/code/Magento/Widget/etc/db_schema_whitelist.json index a42646a355045..36f9d305a54d6 100644 --- a/app/code/Magento/Widget/etc/db_schema_whitelist.json +++ b/app/code/Magento/Widget/etc/db_schema_whitelist.json @@ -56,6 +56,7 @@ "WIDGET_INSTANCE_PAGE_LAYOUT_PAGE_ID": true }, "constraint": { + "PRIMARY": true, "WIDGET_INSTANCE_PAGE_LAYOUT_PAGE_ID_WIDGET_INSTANCE_PAGE_PAGE_ID": true, "WIDGET_INSTANCE_PAGE_LYT_LYT_UPDATE_ID_LYT_UPDATE_LYT_UPDATE_ID": true, "WIDGET_INSTANCE_PAGE_LAYOUT_LAYOUT_UPDATE_ID_PAGE_ID": true @@ -95,4 +96,4 @@ "LAYOUT_LINK_THEME_ID_THEME_THEME_ID": true } } -} \ No newline at end of file +} diff --git a/app/code/Magento/Widget/etc/di.xml b/app/code/Magento/Widget/etc/di.xml index 2da5a351aa6ac..558860320c680 100644 --- a/app/code/Magento/Widget/etc/di.xml +++ b/app/code/Magento/Widget/etc/di.xml @@ -34,4 +34,24 @@ <plugin name="widget-layout-update-plugin" type="Magento\Widget\Model\ResourceModel\Layout\Plugin" sortOrder="10"/> </type> + <virtualType name="WidgetValidationState" type="\Magento\Framework\Config\ValidationState\Configurable"> + <arguments> + <argument name="required" xsi:type="boolean">true</argument> + </arguments> + </virtualType> + <virtualType name="WidgetXmlValidator" type="\Magento\Framework\View\Model\Layout\Update\Validator"> + <arguments> + <argument name="validationState" xsi:type="object">WidgetValidationState</argument> + </arguments> + </virtualType> + <virtualType name="WidgetXmlValidatorFactory" type="Magento\Framework\View\Model\Layout\Update\ValidatorFactory"> + <arguments> + <argument name="instanceName" xsi:type="string">WidgetXmlValidator</argument> + </arguments> + </virtualType> + <type name="Magento\Widget\Model\Widget\Instance"> + <arguments> + <argument name="xmlValidatorFactory" xsi:type="object">WidgetXmlValidatorFactory</argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Wishlist/Controller/Index/Add.php b/app/code/Magento/Wishlist/Controller/Index/Add.php index 3ed152cb84125..1050ec9b1606d 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Add.php +++ b/app/code/Magento/Wishlist/Controller/Index/Add.php @@ -6,12 +6,20 @@ namespace Magento\Wishlist\Controller\Index; use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Framework\App\Action; +use Magento\Customer\Model\Session; +use Magento\Framework\App\Action\Context; use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\Controller\Result\Redirect; use Magento\Framework\Data\Form\FormKey\Validator; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\UrlInterface; +use Magento\Framework\App\Response\RedirectInterface; +use Magento\Framework\Controller\ResultInterface; +use Magento\Wishlist\Controller\WishlistProviderInterface; /** * Wish list Add controller @@ -21,12 +29,12 @@ class Add extends \Magento\Wishlist\Controller\AbstractIndex implements HttpPostActionInterface { /** - * @var \Magento\Wishlist\Controller\WishlistProviderInterface + * @var WishlistProviderInterface */ protected $wishlistProvider; /** - * @var \Magento\Customer\Model\Session + * @var Session */ protected $_customerSession; @@ -41,30 +49,46 @@ class Add extends \Magento\Wishlist\Controller\AbstractIndex implements HttpPost protected $formKeyValidator; /** - * @param Action\Context $context - * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider + * @var RedirectInterface + */ + private $redirect; + + /** + * @var UrlInterface + */ + private $urlBuilder; + + /** + * @param Context $context + * @param Session $customerSession + * @param WishlistProviderInterface $wishlistProvider * @param ProductRepositoryInterface $productRepository * @param Validator $formKeyValidator + * @param RedirectInterface|null $redirect + * @param UrlInterface|null $urlBuilder */ public function __construct( - Action\Context $context, - \Magento\Customer\Model\Session $customerSession, - \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider, + Context $context, + Session $customerSession, + WishlistProviderInterface $wishlistProvider, ProductRepositoryInterface $productRepository, - Validator $formKeyValidator + Validator $formKeyValidator, + RedirectInterface $redirect = null, + UrlInterface $urlBuilder = null ) { $this->_customerSession = $customerSession; $this->wishlistProvider = $wishlistProvider; $this->productRepository = $productRepository; $this->formKeyValidator = $formKeyValidator; + $this->redirect = $redirect ?: ObjectManager::getInstance()->get(RedirectInterface::class); + $this->urlBuilder = $urlBuilder ?: ObjectManager::getInstance()->get(UrlInterface::class); parent::__construct($context); } /** * Adding new item * - * @return \Magento\Framework\Controller\Result\Redirect + * @return ResultInterface * @throws NotFoundException * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -72,7 +96,7 @@ public function __construct( */ public function execute() { - /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */ + /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); if (!$this->formKeyValidator->validate($this->getRequest())) { return $resultRedirect->setPath('*/'); @@ -115,7 +139,7 @@ public function execute() $result = $wishlist->addNewItem($product, $buyRequest); if (is_string($result)) { - throw new \Magento\Framework\Exception\LocalizedException(__($result)); + throw new LocalizedException(__($result)); } if ($wishlist->isObjectNew()) { $wishlist->save(); @@ -142,7 +166,7 @@ public function execute() ] ); // phpcs:disable Magento2.Exceptions.ThrowCatch - } catch (\Magento\Framework\Exception\LocalizedException $e) { + } catch (LocalizedException $e) { $this->messageManager->addErrorMessage( __('We can\'t add the item to Wish List right now: %1.', $e->getMessage()) ); @@ -153,7 +177,16 @@ public function execute() ); } + if ($this->getRequest()->isAjax()) { + $url = $this->urlBuilder->getUrl('*', $this->redirect->updatePathParams(['wishlist_id' => $wishlist->getId()])); + /** @var Json $resultJson */ + $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON); + $resultJson->setData(['backUrl' => $url]); + + return $resultJson; + } $resultRedirect->setPath('*', ['wishlist_id' => $wishlist->getId()]); + return $resultRedirect; } } diff --git a/app/code/Magento/Wishlist/Controller/Index/Cart.php b/app/code/Magento/Wishlist/Controller/Index/Cart.php index 7e47a6b9d7d8a..8bf42514997d4 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Cart.php +++ b/app/code/Magento/Wishlist/Controller/Index/Cart.php @@ -216,6 +216,12 @@ public function execute() $item->mergeBuyRequest($buyRequest); $item->addToCart($this->cart, true); + + $related = $this->getRequest()->getParam('related_product'); + if (!empty($related)) { + $this->cart->addProductsByIds(explode(',', $related)); + } + $this->cart->save()->getQuote()->collectTotals(); $wishlist->save(); @@ -240,7 +246,8 @@ public function execute() $publicCookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata() ->setDuration(3600) ->setPath('/') - ->setHttpOnly(false); + ->setHttpOnly(false) + ->setSameSite('Strict'); $this->cookieManager->setPublicCookie( 'add_to_cart', diff --git a/app/code/Magento/Wishlist/Model/Config.php b/app/code/Magento/Wishlist/Model/Config.php index 1620c61d79da8..e77eb65e5ae89 100644 --- a/app/code/Magento/Wishlist/Model/Config.php +++ b/app/code/Magento/Wishlist/Model/Config.php @@ -36,6 +36,11 @@ class Config */ private $sharingEmailLimit; + /** + * @var int + */ + private $sharignTextLimit; + /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Config $catalogConfig @@ -55,7 +60,7 @@ public function __construct( \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); $this->sharingEmailLimit = $emailLimitInConfig ?: self::SHARING_EMAIL_LIMIT; - $this->_sharignTextLimit = $textLimitInConfig ?: self::SHARING_TEXT_LIMIT; + $this->sharignTextLimit = $textLimitInConfig ?: self::SHARING_TEXT_LIMIT; $this->catalogConfig = $catalogConfig; $this->attributeConfig = $attributeConfig; } @@ -89,6 +94,6 @@ public function getSharingEmailLimit() */ public function getSharingTextLimit() { - return $this->_sharignTextLimit; + return $this->sharignTextLimit; } } diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerUpdateProductInWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerUpdateProductInWishlistActionGroup.xml new file mode 100644 index 0000000000000..0842c29b5b33c --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerUpdateProductInWishlistActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCustomerUpdateProductInWishlistActionGroup" extends="StorefrontCustomerAddProductToWishlistActionGroup"> + <annotations> + <description>Updates the provided Product to the Wish List from the Storefront Product page. Validates that the Success Message is present and correct.</description> + </annotations> + <see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been updated in your Wish List." stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerUpdateWishlistItemActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerUpdateWishlistItemActionGroup.xml new file mode 100644 index 0000000000000..b5ebce5195efd --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerUpdateWishlistItemActionGroup.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCustomerUpdateWishlistItemActionGroup"> + <annotations> + <description>Navigates to the 'Update Wishlist Item' page by the provided Product name.</description> + </annotations> + <arguments> + <argument name="productName" type="string" defaultValue="{{_defaultProduct.name}}"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="waitForProductInfo"/> + <scrollTo selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="scrollToProduct"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="mouseOverOnProduct"/> + <click selector="{{StorefrontCustomerWishlistProductSection.editProduct}}" stepKey="clickEditButton"/> + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="waitForProductPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml b/app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml index e75b29944117b..484bd48f5b3cc 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml @@ -25,6 +25,7 @@ <element name="pager" type="block" selector=".toolbar .pager"/> <element name="wishlistEmpty" type="block" selector=".form-wishlist-items .message.info.empty"/> <element name="removeProduct" type="button" selector=".products-grid a.btn-remove" timeout="30"/> + <element name="editProduct" type="button" selector=".products-grid a.action.edit" timeout="30"/> <element name="productSeeDetailsByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]" parameterized="true"/> <element name="productSeeDetailsLabelByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dt[@class='label']" parameterized="true"/> <element name="productSeeDetailsValueByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dd[@class='values']" parameterized="true"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/AdminConfigureCustomerWishListItemTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/AdminConfigureCustomerWishListItemTest.xml new file mode 100644 index 0000000000000..6c4ddf2bfd006 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/AdminConfigureCustomerWishListItemTest.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminConfigureCustomerWishListItemTest"> + <annotations> + <features value="Wishlist"/> + <stories value="Wishlist item configuration"/> + <title value="Admin can configure a customer wishlist item"/> + <description value="Admin should be able to configure items from customer wishlist"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40455"/> + <useCaseId value="MC-37418"/> + <group value="wishlist"/> + </annotations> + <before> + <!-- Create the configurable product based on the data in the /data folder --> + <createData entity="ApiConfigurableProductWithOutCategory" stepKey="createConfigProduct"/> + + <!-- Make the configurable product have two options, that are children of the default attribute set --> + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + + <!-- Create the 2 children that will be a part of the configurable product --> + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + </createData> + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + </createData> + + <!-- Assign the two products to the configurable product --> + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + </createData> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct1"/> + </createData> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct2"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <magentoCron groups="index" stepKey="reindexBrokenIndices"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logout"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> + <magentoCron groups="index" stepKey="reindexBrokenIndices"/> + </after> + + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$createCustomer$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$createConfigProduct.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addToWishlistProduct"> + <argument name="productVar" value="$createConfigProduct$"/> + </actionGroup> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="navigateToCustomerEditPage"> + <argument name="customer" value="$createCustomer$"/> + </actionGroup> + <actionGroup ref="AdminNavigateCustomerWishlistTabActionGroup" stepKey="navigateToWishlistTab"/> + <actionGroup ref="AdminCustomerWishlistConfigureItemActionGroup" stepKey="editItem"> + <argument name="title" value="$createConfigProductAttribute.attribute[frontend_labels][0][label]$"/> + <argument name="option" value="$getConfigAttributeOption1.label$"/> + <argument name="quantity" value="2"/> + <argument name="productName" value="$createConfigProduct.name$"/> + </actionGroup> + <click selector="{{AdminMainActionsSection.save}}" stepKey="saveCustomer"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <seeElement selector="{{AdminMessagesSection.success}}" stepKey="assertSuccessMessage"/> + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="navigateToCustomerEditPage2"> + <argument name="customer" value="$createCustomer$"/> + </actionGroup> + <actionGroup ref="AdminNavigateCustomerWishlistTabActionGroup" stepKey="navigateToWishlistTabAgain"/> + <waitForElementVisible selector="{{AdminCustomerWishlistSection.productQty}}" stepKey="waitForProductQuantityVisible"/> + <see selector="{{AdminCustomerWishlistSection.productQty}}" userInput="2" stepKey="assertProductQuantity"/> + </test> +</tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml index fbda4b97f6e5c..87021cfbbbce1 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml @@ -36,8 +36,16 @@ <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" - dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clickClearFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml index 6a0603fcee502..8983bb4cc9b76 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml @@ -31,6 +31,30 @@ </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersConfigurable"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterConfigurable"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterFillSelectFieldActionGroup" stepKey="addTypeFilterConfigurable"> + <argument name="filterName" value="type_id"/> + <argument name="filterValue" value="Configurable Product"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterConfigurable"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteConfigurableProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersVirtual"/> + <actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="addSkuFilterVirtual"> + <argument name="filterInputName" value="sku"/> + <argument name="filterValue" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyGridFilterVirtual"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteVirtualProducts"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddBundleProductToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddBundleProductToWishlistTest.xml new file mode 100644 index 0000000000000..86cb3ad9ea851 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddBundleProductToWishlistTest.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontAddBundleProductToWishlistTest"> + <annotations> + <stories value="Wishlist"/> + <title value="Add bundle product to wishlist"/> + <description value="Add Bundle Product to Wishlist and verify Bundle Options are preserved"/> + <severity value="CRITICAL"/> + <group value="wishlist"/> + </annotations> + <before> + <!-- Create Data --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">100.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">20.00</field> + </createData> + <!--Create Bundle product--> + <createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="DropDownBundleOption" stepKey="createBundleOption1_1"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + + <magentoCLI stepKey="runCronIndex" command="cron:run --group=index"/> + </before> + <after> + <!-- Delete data --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- 1. Login as a customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- Open Product page --> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> + <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeButton"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts($$createBundleOption1_1.title$$)}}" userInput="$$simpleProduct1.name$$ +$100.00" stepKey="selectOption0Product0"/> + <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/> + + <!-- Add product to the wishlist --> + <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> + <argument name="productVar" value="$$createBundleProduct$$"/> + </actionGroup> + + <!-- Assert product is present in wishlist --> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + <argument name="productPrice" value="$100.00"/> + </actionGroup> + + <!-- Assert product details in wishlist --> + <actionGroup ref="AssertProductDetailsInWishlistActionGroup" stepKey="assertProductDetails"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + <argument name="label" value="$$createBundleOption1_1.title$$"/> + <argument name="labelValue" value="$$simpleProduct1.name$$ $100.00"/> + </actionGroup> + + <!-- Assert product cart is empty --> + <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> + </test> +</tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddBundleProductWithOptionToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddBundleProductWithOptionToWishlistTest.xml new file mode 100644 index 0000000000000..832a2321cd90a --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddBundleProductWithOptionToWishlistTest.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontAddBundleProductWithOptionToWishlistTest"> + <annotations> + <stories value="Wishlist"/> + <title value="Add Dynamic Bundle Product with selected option to Wishlist"/> + <description value="Add Dynamic Bundle Product with selected option to Wishlist on Frontend"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40586"/> + <group value="wishlist"/> + </annotations> + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">100.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">20.00</field> + </createData> + <createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="DropDownBundleOption" stepKey="createBundleOption"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> + </after> + + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> + <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeButton"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts($$createBundleOption.title$$)}}" userInput="$$simpleProduct1.name$$ +$100.00" stepKey="selectOption"/> + <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addBundleProductWithOptionToWishlist"> + <argument name="productVar" value="$$createBundleProduct$$"/> + </actionGroup> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductWithOptionInWishList"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + <argument name="productPrice" value="$100"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml index c279adbfe876c..fce2116542557 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml @@ -26,24 +26,16 @@ <requiredEntity createDataKey="categorySecond"/> </createData> <createData entity="Simple_US_Customer" stepKey="customer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <deleteData createDataKey="categoryFirst" stepKey="deleteCategoryFirst"/> <deleteData createDataKey="categorySecond" stepKey="deleteCategorySecond"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> </after> <!-- Sign in as customer --> @@ -51,7 +43,7 @@ <argument name="Customer" value="$$customer$$"/> </actionGroup> <!-- Add product from first category to the wishlist --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryFirst.name$$)}}" stepKey="navigateToCategoryFirstPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryFirst.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryFirstPage"/> <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> @@ -59,7 +51,7 @@ <argument name="productVar" value="$$simpleProduct1$$"/> </actionGroup> <!--Add product to the cart from the Wishlist using the sidebar from the second category page--> - <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.name$$)}}" stepKey="navigateToCategorySecondPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.custom_attributes[url_key]$$)}}" stepKey="navigateToCategorySecondPage"/> <actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchCategoryViewToListMode"/> <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$simpleProduct1$$"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddSimpleProductWithCustomizableFileOptionToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddSimpleProductWithCustomizableFileOptionToWishlistTest.xml new file mode 100644 index 0000000000000..83f0bfb8ffb26 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddSimpleProductWithCustomizableFileOptionToWishlistTest.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontAddSimpleProductWithCustomizableFileOptionToWishlistTest"> + <annotations> + <features value="Wishlist"/> + <stories value="Add product to wishlist"/> + <title value="Add simple product with customizable file option to wishlist"/> + <description value="Add simple Product with customizable file option to Wishlist and verify customizable options are preserved"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-41040"/> + <useCaseId value="MC-40417"/> + <group value="wishlist"/> + </annotations> + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="SimpleProduct2" stepKey="createProduct"> + <field key="price">100.00</field> + </createData> + <updateData entity="productWithFileOption" createDataKey="createProduct" stepKey="updateProductWithOptions"> + <requiredEntity createDataKey="createProduct"/> + </updateData> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct1"/> + </after> + + <!-- Login as a customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$createCustomer$"/> + </actionGroup> + + <!-- Open Product page --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> + </actionGroup> + <attachFile userInput="adobe-base.jpg" selector="{{StorefrontProductInfoMainSection.addLinkFileUploadFile(ProductOptionFile.title)}}" stepKey="fillUploadFile"/> + + <!-- Add product to the wishlist --> + <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductWithOptionToWishlist"> + <argument name="productVar" value="$createProduct$"/> + </actionGroup> + + <!-- Assert product is present in wishlist --> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent"> + <argument name="productName" value="$createProduct.name$"/> + <argument name="productPrice" value="$109.99"/> + </actionGroup> + + <!-- Edit wishlist product --> + <actionGroup ref="StorefrontCustomerUpdateWishlistItemActionGroup" stepKey="clickEditWishlistItem"> + <argument name="productName" value="$createProduct.name$"/> + </actionGroup> + + <!-- Update product in wishlist from product page --> + <actionGroup ref="StorefrontCustomerUpdateProductInWishlistActionGroup" stepKey="updateProductWithOptionInWishlist"> + <argument name="productVar" value="$createProduct$"/> + </actionGroup> + + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent2"> + <argument name="productName" value="$createProduct.name$"/> + <argument name="productPrice" value="$109.99"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontCheckOptionsConfigurableProductInWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontCheckOptionsConfigurableProductInWishlistTest.xml index 638c8f4986a77..dde41af378f25 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontCheckOptionsConfigurableProductInWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontCheckOptionsConfigurableProductInWishlistTest.xml @@ -26,12 +26,8 @@ <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer" stepKey="customer"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> @@ -47,12 +43,8 @@ <argument name="productAttributeLabel" value="{{visualSwatchAttribute.default_label}}"/> </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </after> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="navigateToFirstConfigProductPage"> <argument name="productId" value="$$createFirstConfigProduct.id$$"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml index 31bc9f6a31de7..6b850cd1d24fa 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml @@ -46,11 +46,9 @@ <requiredEntity createDataKey="simpleProduct2"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete data --> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml index da2cec8284c46..1e423643ee66d 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml @@ -105,12 +105,8 @@ <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct3"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete data --> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml index 05a42314ddb71..4aff7d3033a2b 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml @@ -107,12 +107,8 @@ <requiredEntity createDataKey="createConfigChildProduct3"/> </createData> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <!-- Delete data --> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml index 6932d56b2f56a..1c99c895765f4 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml @@ -75,7 +75,7 @@ <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeButton"/> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts($$createBundleOption1_1.title$$)}}" userInput="$$simpleProduct1.sku$$ +$100.00" stepKey="selectOption0Product0"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts($$createBundleOption1_1.title$$)}}" userInput="$$simpleProduct1.name$$ +$100.00" stepKey="selectOption0Product0"/> <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/> <!-- Add product to the cart and Assert add product to cart success message--> @@ -101,7 +101,7 @@ <actionGroup ref="AssertProductDetailsInWishlistActionGroup" stepKey="assertProductDetails"> <argument name="productName" value="$$createBundleProduct.name$$"/> <argument name="label" value="$$createBundleOption1_1.title$$"/> - <argument name="labelValue" value="$$simpleProduct1.sku$$ $100.00"/> + <argument name="labelValue" value="$$simpleProduct1.name$$ $100.00"/> </actionGroup> <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml index 8b94c42106a6a..7bbfedc58c818 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml @@ -66,7 +66,7 @@ <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeButton"/> - <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts($$createBundleOption1_1.title$$)}}" userInput="$$simpleProduct1.sku$$ +$100.00" stepKey="selectOption0Product0"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts($$createBundleOption1_1.title$$)}}" userInput="$$simpleProduct1.name$$ +$100.00" stepKey="selectOption0Product0"/> <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/> <!-- Add product to the cart and Assert add product to cart success message--> @@ -92,7 +92,7 @@ <actionGroup ref="AssertProductDetailsInWishlistActionGroup" stepKey="assertProductDetails"> <argument name="productName" value="$$createBundleProduct.name$$"/> <argument name="label" value="$$createBundleOption1_1.title$$"/> - <argument name="labelValue" value="$$simpleProduct1.sku$$ $100.00"/> + <argument name="labelValue" value="$$simpleProduct1.name$$ $100.00"/> </actionGroup> <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml index b2364b72f7db8..db467e0e2a83c 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml @@ -35,20 +35,15 @@ <deleteData createDataKey="customer" stepKey="deleteCustomer"/> </after> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!-- Sign in as customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> <argument name="Customer" value="$$customer$$"/> </actionGroup> <!-- Add product from first category to the wishlist --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryFirst.name$$)}}" stepKey="navigateToCategoryFirstPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryFirst.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryFirstPage"/> <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> @@ -56,7 +51,7 @@ <argument name="productVar" value="$$simpleProduct1$$"/> </actionGroup> <!--Remove product from the Wishlist using the sidebar from the second category page--> - <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.name$$)}}" stepKey="navigateToCategorySecondPage"/> + <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.custom_attributes[url_key]$$)}}" stepKey="navigateToCategorySecondPage"/> <actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchCategoryViewToListMode"/> <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$simpleProduct1$$"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateConfigurableProductAttributeOptionFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateConfigurableProductAttributeOptionFromWishlistTest.xml new file mode 100644 index 0000000000000..5d53f58afc3a7 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateConfigurableProductAttributeOptionFromWishlistTest.xml @@ -0,0 +1,147 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontUpdateConfigurableProductAttributeOptionFromWishlistTest"> + <annotations> + <features value="Wishlist"/> + <stories value="Update from Wishlist"/> + <title value="Update Configurable Product Option from Wishlist"/> + <description value="Verify that Configurable Product Option has correct value after navigating to Wishlist Item editing page"/> + <severity value="MAJOR"/> + <testCaseId value="MC-40881"/> + <useCaseId value="MC-40651"/> + <group value="catalog"/> + <group value="configurableProduct"/> + <group value="wishlist"/> + </annotations> + <before> + <!-- Create Customer --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Create Product Attribute with two Options --> + <createData entity="productDropDownAttribute" stepKey="createConfigurableProductAttribute"/> + <createData entity="productAttributeOption1" stepKey="createAttributeFirstOption"> + <requiredEntity createDataKey="createConfigurableProductAttribute"/> + </createData> + <createData entity="productAttributeOption2" stepKey="createAttributeSecondOption"> + <requiredEntity createDataKey="createConfigurableProductAttribute"/> + </createData> + + <!-- Add attribute to Default Attribute Set --> + <createData entity="AddToDefaultSet" stepKey="addAttributeToDefaultSet"> + <requiredEntity createDataKey="createConfigurableProductAttribute"/> + </createData> + + <!-- Get Options of created Attribute --> + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigurableAttributeFirstOption"> + <requiredEntity createDataKey="createConfigurableProductAttribute"/> + </getData> + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigurableAttributeSecondOption"> + <requiredEntity createDataKey="createConfigurableProductAttribute"/> + </getData> + + <!-- Create Configurable Product --> + <createData entity="ApiConfigurableProductWithOutCategory" stepKey="createConfigurableProduct"/> + + <!-- Create first Simple Product and assign Attribute with Option to it --> + <createData entity="ApiSimpleOne" stepKey="createFirstChildProduct"> + <requiredEntity createDataKey="createConfigurableProductAttribute"/> + <requiredEntity createDataKey="getConfigurableAttributeFirstOption"/> + </createData> + + <!-- Create second Simple Product and assign Attribute with Option to it --> + <createData entity="ApiSimpleOne" stepKey="createSecondChildProduct"> + <requiredEntity createDataKey="createConfigurableProductAttribute"/> + <requiredEntity createDataKey="getConfigurableAttributeSecondOption"/> + </createData> + + <!-- Create Configurable Product Options --> + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigurableProductOptions"> + <requiredEntity createDataKey="createConfigurableProduct"/> + <requiredEntity createDataKey="createConfigurableProductAttribute"/> + <requiredEntity createDataKey="getConfigurableAttributeFirstOption"/> + <requiredEntity createDataKey="getConfigurableAttributeSecondOption"/> + </createData> + + <!-- Assign Simple Products to Configurable Product --> + <createData entity="ConfigurableProductAddChild" stepKey="addConfigurableProductFirstChild"> + <requiredEntity createDataKey="createConfigurableProduct"/> + <requiredEntity createDataKey="createFirstChildProduct"/> + </createData> + <createData entity="ConfigurableProductAddChild" stepKey="addConfigurableProductSecondChild"> + <requiredEntity createDataKey="createConfigurableProduct"/> + <requiredEntity createDataKey="createSecondChildProduct"/> + </createData> + + <!-- Reindex invalidated indices after Product Attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + </before> + <after> + <!-- Delete Configurable Product data --> + <deleteData createDataKey="createFirstChildProduct" stepKey="deleteFirstChildProduct"/> + <deleteData createDataKey="createSecondChildProduct" stepKey="deleteSecondChildProduct"/> + <deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/> + <deleteData createDataKey="createConfigurableProductAttribute" stepKey="deleteProductAttribute"/> + + <!-- Logout from Customer account --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromStorefront"/> + + <!-- Delete Customer --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + + <!-- Reindex invalidated indices after Product Attribute has been created/deleted --> + <magentoCron groups="index" stepKey="reindexInvalidatedIndicesAfterDelete"/> + </after> + + <!-- Login as Customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$createCustomer$"/> + </actionGroup> + + <!-- Open Product details page --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$createConfigurableProduct.custom_attributes[url_key]$"/> + </actionGroup> + + <!-- Select first Drop-down Attribute Option and click 'Add to Wish List' button --> + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectFirstOption"> + <argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/> + <argument name="optionLabel" value="$getConfigurableAttributeFirstOption.label$"/> + </actionGroup> + <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> + <argument name="productVar" value="$createConfigurableProduct$"/> + </actionGroup> + + <!-- Click 'Edit Item' button from Wishlist page and assert first Option in Drop-down Attribute --> + <actionGroup ref="StorefrontCustomerUpdateWishlistItemActionGroup" stepKey="clickEditWishlistItem"> + <argument name="productName" value="$createConfigurableProduct.name$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductDropDownOptionValueActionGroup" stepKey="assertAttributeFirstOption"> + <argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/> + <argument name="optionLabel" value="$getConfigurableAttributeFirstOption.label$"/> + </actionGroup> + + <!-- Select second Drop-down Option and click 'Update Wish List' button --> + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectSecondOption"> + <argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/> + <argument name="optionLabel" value="$getConfigurableAttributeSecondOption.label$"/> + </actionGroup> + <click selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="clickUpdateWishlist"/> + + <!-- Click 'Edit Item' button again and assert second Option in Drop-down Attribute --> + <actionGroup ref="StorefrontCustomerUpdateWishlistItemActionGroup" stepKey="clickEditWishlistItemAgain"> + <argument name="productName" value="$createConfigurableProduct.name$"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductDropDownOptionValueActionGroup" stepKey="assertAttributeSecondOption"> + <argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/> + <argument name="optionLabel" value="$getConfigurableAttributeSecondOption.label$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontVerifySecureURLRedirectWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontVerifySecureURLRedirectWishlistTest.xml index f5958f5efd414..57865f10b305e 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontVerifySecureURLRedirectWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontVerifySecureURLRedirectWishlistTest.xml @@ -28,15 +28,11 @@ <executeJS function="return window.location.host" stepKey="hostname"/> <magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> <magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> - <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> </after> <executeJS function="return window.location.host" stepKey="hostname"/> diff --git a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/CartTest.php b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/CartTest.php index 47bb930cde3b9..2634e0771290f 100644 --- a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/CartTest.php +++ b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/CartTest.php @@ -25,6 +25,7 @@ use Magento\Framework\Message\ManagerInterface; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory; +use Magento\Framework\Stdlib\Cookie\PublicCookieMetadata; use Magento\Framework\Stdlib\CookieManagerInterface; use Magento\Framework\UrlInterface; use Magento\Quote\Model\Quote; @@ -270,19 +271,29 @@ protected function setUp(): void $this->cookieManagerMock = $this->getMockForAbstractClass(CookieManagerInterface::class); + $cookieMetadataMock = $this->getMockBuilder(PublicCookieMetadata::class) + ->disableOriginalConstructor() + ->getMock(); + $this->cookieMetadataFactoryMock = $this->getMockBuilder(CookieMetadataFactory::class) ->disableOriginalConstructor() - ->setMethods(['createPublicCookieMetadata', 'setDuration', 'setPath', 'setHttpOnly']) + ->setMethods(['createPublicCookieMetadata']) ->getMock(); $this->cookieMetadataFactoryMock->expects($this->any()) ->method('createPublicCookieMetadata') - ->willReturnSelf(); - $this->cookieMetadataFactoryMock->expects($this->any()) + ->willReturn($cookieMetadataMock); + $cookieMetadataMock->expects($this->any()) ->method('setDuration') ->willReturnSelf(); - $this->cookieMetadataFactoryMock->expects($this->any()) + $cookieMetadataMock->expects($this->any()) ->method('setPath') ->willReturnSelf(); + $cookieMetadataMock->expects($this->any()) + ->method('setSameSite') + ->willReturnSelf(); + $cookieMetadataMock->expects($this->any()) + ->method('setHttpOnly') + ->willReturnSelf(); $this->model = new Cart( $this->contextMock, diff --git a/app/code/Magento/Wishlist/ViewModel/WishlistData.php b/app/code/Magento/Wishlist/ViewModel/WishlistData.php new file mode 100644 index 0000000000000..d34cb545ef48e --- /dev/null +++ b/app/code/Magento/Wishlist/ViewModel/WishlistData.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Wishlist\ViewModel; + +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\View\Element\Block\ArgumentInterface; +use Magento\Wishlist\Helper\Data as HelperData; + +/** + * ViewModel for Wishlist Sidebar Block + */ +class WishlistData implements ArgumentInterface +{ + /** + * Object manager + * + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @var HelperData + */ + private $helperData; + + /** + * @param ObjectManagerInterface $objectManager + * @param HelperData $helperData + */ + public function __construct( + ObjectManagerInterface $objectManager, + HelperData $helperData + ) { + $this->objectManager = $objectManager; + $this->helperData = $helperData ?: $this->objectManager->get(HelperData::class); + } + + /** + * Retrieve customer wishlist url + * + * @param int $wishlistId + * @return string + */ + public function getListUrl($wishlistId = null): string + { + return $this->helperData->getListUrl($wishlistId); + } + + /** + * Check is allow wishlist module + * + * @return bool + */ + public function isAllow(): bool + { + return $this->helperData->isAllow(); + } +} diff --git a/app/code/Magento/Wishlist/view/frontend/layout/default.xml b/app/code/Magento/Wishlist/view/frontend/layout/default.xml index c4f0d01707b20..2d0b4f3a526e3 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/default.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/default.xml @@ -18,7 +18,11 @@ </block> </referenceBlock> <referenceContainer name="sidebar.additional"> - <block class="Magento\Wishlist\Block\Customer\Sidebar" name="wishlist_sidebar" as="wishlist" template="Magento_Wishlist::sidebar.phtml" ifconfig="wishlist/general/show_in_sidebar"/> + <block class="Magento\Wishlist\Block\Customer\Sidebar" name="wishlist_sidebar" as="wishlist" template="Magento_Wishlist::sidebar.phtml" ifconfig="wishlist/general/show_in_sidebar"> + <arguments> + <argument name="wishlistDataViewModel" xsi:type="object">Magento\Wishlist\ViewModel\WishlistData</argument> + </arguments> + </block> </referenceContainer> </body> </page> diff --git a/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml b/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml index 6e678a8916372..51515950d520b 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml @@ -7,9 +7,9 @@ /** @var \Magento\Wishlist\Block\Customer\Sidebar $block */ ?> <?php -$wishlistHelper = $this->helper(\Magento\Wishlist\Helper\Data::class); +$wishlstViewModel = $block->getData('wishlistDataViewModel'); ?> -<?php if ($wishlistHelper->isAllow()) : ?> +<?php if ($wishlstViewModel->isAllow()): ?> <div class="block block-wishlist" data-bind="scope: 'wishlist'"> <div class="block-title"> <strong role="heading" aria-level="2"><?= $block->escapeHtml($block->getTitle()) ?></strong> @@ -20,7 +20,9 @@ $wishlistHelper = $this->helper(\Magento\Wishlist\Helper\Data::class); <div class="block-content"> <strong class="subtitle"><?= $block->escapeHtml(__('Last Added Items')) ?></strong> <!-- ko if: wishlist().counter --> - <ol class="product-items no-display" id="wishlist-sidebar" data-bind="foreach: wishlist().items, css: {'no-display': null}"> + <ol class="product-items no-display" + id="wishlist-sidebar" + data-bind="foreach: wishlist().items, css: {'no-display': null}"> <li class="product-item"> <div class="product-item-info"> <a class="product-item-photo" data-bind="attr: { href: product_url, title: product_name }"> @@ -29,7 +31,7 @@ $wishlistHelper = $this->helper(\Magento\Wishlist\Helper\Data::class); <div class="product-item-details"> <strong class="product-item-name"> <a data-bind="attr: { href: product_url }" class="product-item-link"> - <span data-bind="html: product_name"></span> + <span data-bind="text: product_name"></span> </a> </strong> <div data-bind="html: product_price"></div> @@ -37,10 +39,18 @@ $wishlistHelper = $this->helper(\Magento\Wishlist\Helper\Data::class); <!-- ko if: product_is_saleable_and_visible --> <div class="actions-primary"> <!-- ko if: product_has_required_options --> - <a href="#" data-bind="attr: {'data-post': add_to_cart_params}" class="action tocart primary"><span><?= $block->escapeHtml(__('Add to Cart')) ?></span></a> + <a href="#" + data-bind="attr: {'data-post': add_to_cart_params}" + class="action tocart primary"> + <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> + </a> <!-- /ko --> <!-- ko ifnot: product_has_required_options --> - <button type="button" class="action tocart primary" data-bind="attr: {'data-post': add_to_cart_params}"><span><?= $block->escapeHtml(__('Add to Cart')) ?></span></button> + <button type="button" + class="action tocart primary" + data-bind="attr: {'data-post': add_to_cart_params}"> + <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> + </button> <!-- /ko --> </div> <!-- /ko --> @@ -59,8 +69,10 @@ $wishlistHelper = $this->helper(\Magento\Wishlist\Helper\Data::class); <div class="actions-toolbar no-display" data-bind="css: {'no-display': null}"> <div class="primary"> <a class="action details" - href="<?= $block->escapeUrl($this->helper(\Magento\Wishlist\Helper\Data::class)->getListUrl()) ?>" - title="<?= $block->escapeHtmlAttr(__('Go to Wish List')) ?>"><span><?= $block->escapeHtml(__('Go to Wish List')) ?></span></a> + href="<?= $block->escapeUrl($wishlstViewModel->getListUrl()) ?>" + title="<?= $block->escapeHtmlAttr(__('Go to Wish List')) ?>"> + <span><?= $block->escapeHtml(__('Go to Wish List')) ?></span> + </a> </div> </div> <!-- /ko --> diff --git a/app/code/Magento/Wishlist/view/frontend/templates/view.phtml b/app/code/Magento/Wishlist/view/frontend/templates/view.phtml index 81bb5bd195091..84276628702a3 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/view.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/view.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ +// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound /** @var \Magento\Wishlist\Block\Customer\Wishlist $block */ ?> diff --git a/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js b/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js index 62756f7211cee..47beb6d07e2de 100644 --- a/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js +++ b/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js @@ -118,12 +118,22 @@ define([ buttons = this._getAddToWishlistButton(event); buttons.each(function (index, element) { - var params = $(element).data('post'); + var params = $(element).data('post'), + currentTarget = event.currentTarget, + targetElement, + targetValue; if (!params) { params = { 'data': {} }; + } else if ($(currentTarget).data('selector') || $(currentTarget).attr('name')) { + targetElement = self._getElementData(currentTarget); + targetValue = Object.keys(targetElement)[0]; + + if (params.data.hasOwnProperty(targetValue) && !dataToAdd.hasOwnProperty(targetValue)) { + delete params.data[targetValue]; + } } params.data = $.extend({}, params.data, dataToAdd, { @@ -144,7 +154,7 @@ define([ return productListWrapper.find(this.options.actionElement); } - return $(event.currentTarget).closest(this.options.productPageWrapper).find(this.options.actionElement); + return $(this.options.actionElement); }, /** diff --git a/app/code/Magento/WishlistGraphQl/Mapper/WishlistDataMapper.php b/app/code/Magento/WishlistGraphQl/Mapper/WishlistDataMapper.php index 96e39b6566d5d..b303c5de197ba 100644 --- a/app/code/Magento/WishlistGraphQl/Mapper/WishlistDataMapper.php +++ b/app/code/Magento/WishlistGraphQl/Mapper/WishlistDataMapper.php @@ -66,4 +66,4 @@ private function getMappedVisibility(int $visibility): ?string return isset($visibilityEnums[$visibility]) ? strtoupper($visibilityEnums[$visibility]) : null; } -} +} \ No newline at end of file diff --git a/app/code/Magento/WishlistGraphQl/Model/CartItems/BundleDataProvider.php b/app/code/Magento/WishlistGraphQl/Model/CartItems/BundleDataProvider.php new file mode 100755 index 0000000000000..f11da3c63a2f1 --- /dev/null +++ b/app/code/Magento/WishlistGraphQl/Model/CartItems/BundleDataProvider.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare (strict_types = 1); + +namespace Magento\WishlistGraphQl\Model\CartItems; + +use Magento\Wishlist\Model\Item; +use Magento\Framework\GraphQl\Query\Uid; + +/** + * Data provider for bundlue product cart item request + */ +class BundleDataProvider implements CartItemsRequestDataProviderInterface +{ + /** + * @var Uid + */ + private $uidEncoder; + + /** + * @param Uid $uidEncoder + */ + public function __construct( + Uid $uidEncoder + ) { + $this->uidEncoder = $uidEncoder; + } + + /** + * @inheritdoc + */ + public function execute(Item $wishlistItem, ?string $sku): array + { + $buyRequest = $wishlistItem->getBuyRequest(); + $selected_options = []; + if (isset($buyRequest['bundle_option'])) { + $bundleOptions = $buyRequest['bundle_option']; + $bundleOptionQty = $buyRequest['bundle_option_qty']; + foreach ($bundleOptions as $option => $value) { + $qty = $bundleOptionQty[$option]; + $selected_options[] = $this->uidEncoder->encode("bundle/$option/$value/$qty"); + } + } + + $cartItems['selected_options'] = $selected_options; + return $cartItems; + } +} diff --git a/app/code/Magento/WishlistGraphQl/Model/CartItems/CartItemsRequestBuilder.php b/app/code/Magento/WishlistGraphQl/Model/CartItems/CartItemsRequestBuilder.php new file mode 100755 index 0000000000000..89551dbf969fe --- /dev/null +++ b/app/code/Magento/WishlistGraphQl/Model/CartItems/CartItemsRequestBuilder.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare (strict_types = 1); + +namespace Magento\WishlistGraphQl\Model\CartItems; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Wishlist\Model\Item; + +/** + * Building cart items request for add to cart form wishlist buy request + */ +class CartItemsRequestBuilder +{ + /** + * @var CartItemsRequestDataProviderInterface[] + */ + private $providers; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @param ProductRepositoryInterface $productRepository + * @param array $providers + */ + public function __construct( + ProductRepositoryInterface $productRepository, + array $providers = [] + ) { + $this->productRepository = $productRepository; + $this->providers = $providers; + } + + /** + * Build wishlist cart item request for adding to cart + * + * @param Item $wishlistItem + * @return array + */ + public function build(Item $wishlistItem): array + { + $product = $this->productRepository->getById($wishlistItem->getProductId()); + $parentsku = $product->getSku(); + $cartItems['quantity'] = floatval($wishlistItem->getQty()); + $cartItems['sku'] = $parentsku; + + foreach ($this->providers as $provider) { + $cartItems = array_merge_recursive($cartItems, $provider->execute($wishlistItem, $parentsku)); + } + return $cartItems; + } +} diff --git a/app/code/Magento/WishlistGraphQl/Model/CartItems/CartItemsRequestDataProviderInterface.php b/app/code/Magento/WishlistGraphQl/Model/CartItems/CartItemsRequestDataProviderInterface.php new file mode 100755 index 0000000000000..0e1e591f98a06 --- /dev/null +++ b/app/code/Magento/WishlistGraphQl/Model/CartItems/CartItemsRequestDataProviderInterface.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare (strict_types = 1); + +namespace Magento\WishlistGraphQl\Model\CartItems; + +use Magento\Wishlist\Model\Item; + +/** + * Build cart item request for adding products to cart + */ +interface CartItemsRequestDataProviderInterface +{ + /** + * Provide cart item request from buy request to add wishlist items to cart + * + * @param Item $wishlistItem + * @param string $sku + * + * @return array + */ + public function execute(Item $wishlistItem, ?string $sku): array; +} diff --git a/app/code/Magento/WishlistGraphQl/Model/CartItems/ConfigurableDataProvider.php b/app/code/Magento/WishlistGraphQl/Model/CartItems/ConfigurableDataProvider.php new file mode 100755 index 0000000000000..4636bd263f413 --- /dev/null +++ b/app/code/Magento/WishlistGraphQl/Model/CartItems/ConfigurableDataProvider.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare (strict_types = 1); + +namespace Magento\WishlistGraphQl\Model\CartItems; + +use Magento\Wishlist\Model\Item; +use Magento\Framework\GraphQl\Query\Uid; + +/** + * Data provider for configurable product cart item request + */ +class ConfigurableDataProvider implements CartItemsRequestDataProviderInterface +{ + /** + * @var Uid + */ + private $uidEncoder; + + /** + * @param Uid $uidEncoder + */ + public function __construct( + Uid $uidEncoder + ) { + $this->uidEncoder = $uidEncoder; + } + + /** + * @inheritdoc + */ + public function execute(Item $wishlistItem, ?string $sku): array + { + $buyRequest = $wishlistItem->getBuyRequest(); + $selected_options = []; + if (isset($buyRequest['super_attribute'])) { + $superAttributes = $buyRequest['super_attribute']; + foreach ($superAttributes as $attributeId => $value) { + $selected_options[] = $this->uidEncoder->encode("configurable/$attributeId/$value"); + } + } + $cartItems['selected_options'] = $selected_options; + return $cartItems; + } +} diff --git a/app/code/Magento/WishlistGraphQl/Model/CartItems/CustomizableOptionDataProvider.php b/app/code/Magento/WishlistGraphQl/Model/CartItems/CustomizableOptionDataProvider.php new file mode 100755 index 0000000000000..1e53746b3e44b --- /dev/null +++ b/app/code/Magento/WishlistGraphQl/Model/CartItems/CustomizableOptionDataProvider.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare (strict_types = 1); + +namespace Magento\WishlistGraphQl\Model\CartItems; + +use Magento\Catalog\Api\ProductCustomOptionRepositoryInterface; +use Magento\Wishlist\Model\Item; +use Magento\Framework\GraphQl\Query\Uid; + +/** + * Data provider for custom options for cart item request + */ +class CustomizableOptionDataProvider implements CartItemsRequestDataProviderInterface +{ + /** + * @var ProductCustomOptionRepositoryInterface + */ + private $productCustomOptionRepository; + + /** + * @var Uid + */ + private $uidEncoder; + + /** + * @param ProductCustomOptionRepositoryInterface $productCustomOptionRepository + * @param Uid $uidEncoder + */ + public function __construct( + ProductCustomOptionRepositoryInterface $productCustomOptionRepository, + Uid $uidEncoder + ) { + $this->productCustomOptionRepository = $productCustomOptionRepository; + $this->uidEncoder = $uidEncoder; + } + + /** + * @inheritdoc + */ + public function execute(Item $wishlistItem, ?string $sku): array + { + $buyRequest = $wishlistItem->getBuyRequest(); + $options = isset($buyRequest['options'])?$buyRequest['options']:[]; + $customOptions = $this->productCustomOptionRepository->getList($sku); + $selectedOptions = []; + $enteredOptions = []; + foreach ($customOptions as $customOption) { + $optionId = $customOption->getOptionId(); + + if (isset($options[$optionId])) { + $optionType = $customOption->getType(); + if ($optionType === 'field' || $optionType === 'area' || $optionType === 'date') { + $enteredOptions[] = [ + 'uid' => $this->uidEncoder->encode("custom-option/$optionId"), + 'value' => $options[$optionId], + ]; + } elseif ($optionType === 'drop_down') { + $optionSelectValues = $customOption->getValues(); + $selectedOptions[] = $this->encodeSelectedOption( + (int) $customOption->getOptionId(), + (int) $options[$optionId] + ); + + } elseif ($optionType === 'multiple') { + foreach ($options[$optionId] as $multipleOption) { + $selectedOptions[] = $this->encodeSelectedOption( + (int) $customOption->getOptionId(), + (int) $multipleOption + ); + } + } + } + } + + $cartItems['selected_options'] = $selectedOptions; + $cartItems['entered_options'] = $enteredOptions; + return $cartItems; + } + + /** + * Returns uid of the selected custom option + * + * @param int $optionId + * @param int $optionValueId + * + * @return string + */ + private function encodeSelectedOption(int $optionId, int $optionValueId): string + { + return $this->uidEncoder->encode("custom-option/$optionId/$optionValueId"); + } +} diff --git a/app/code/Magento/WishlistGraphQl/Model/CartItems/DownloadableLinkDataProvider.php b/app/code/Magento/WishlistGraphQl/Model/CartItems/DownloadableLinkDataProvider.php new file mode 100755 index 0000000000000..8062e8bae23f2 --- /dev/null +++ b/app/code/Magento/WishlistGraphQl/Model/CartItems/DownloadableLinkDataProvider.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare (strict_types = 1); + +namespace Magento\WishlistGraphQl\Model\CartItems; + +use Magento\Wishlist\Model\Item; +use Magento\Framework\GraphQl\Query\Uid; + +/** + * Data provider for downloadable product links cart item request + */ +class DownloadableLinkDataProvider implements CartItemsRequestDataProviderInterface +{ + /** + * @var Uid + */ + private $uidEncoder; + + /** + * @param Uid $uidEncoder + */ + public function __construct( + Uid $uidEncoder + ) { + $this->uidEncoder = $uidEncoder; + } + + /** + * @inheritdoc + */ + public function execute(Item $wishlistItem, ?string $sku): array + { + $buyRequest = $wishlistItem->getBuyRequest(); + $links = isset($buyRequest['links']) ? $buyRequest['links'] : []; + $selectedOptions = []; + $cartItems = []; + foreach ($links as $linkId) { + $selectedOptions[] = $this->uidEncoder->encode("downloadable/$linkId"); + } + $cartItems['selected_options'] = $selectedOptions; + return $cartItems; + } +} diff --git a/app/code/Magento/WishlistGraphQl/Model/Resolver/UpdateProductsInWishlist.php b/app/code/Magento/WishlistGraphQl/Model/Resolver/UpdateProductsInWishlist.php index 465ab33744984..edd41f93fb082 100644 --- a/app/code/Magento/WishlistGraphQl/Model/Resolver/UpdateProductsInWishlist.php +++ b/app/code/Magento/WishlistGraphQl/Model/Resolver/UpdateProductsInWishlist.php @@ -10,6 +10,7 @@ use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Wishlist\Model\ResourceModel\Wishlist as WishlistResourceModel; @@ -17,9 +18,9 @@ use Magento\Wishlist\Model\Wishlist\Config as WishlistConfig; use Magento\Wishlist\Model\Wishlist\Data\Error; use Magento\Wishlist\Model\Wishlist\Data\WishlistItemFactory; -use Magento\Wishlist\Model\Wishlist\UpdateProductsInWishlist as UpdateProductsInWishlistModel; use Magento\Wishlist\Model\WishlistFactory; use Magento\WishlistGraphQl\Mapper\WishlistDataMapper; +use Magento\WishlistGraphQl\Model\UpdateWishlistItem; /** * Update wishlist items resolver @@ -27,9 +28,9 @@ class UpdateProductsInWishlist implements ResolverInterface { /** - * @var UpdateProductsInWishlistModel + * @var UpdateWishlistItem */ - private $updateProductsInWishlist; + private $updateWishlistItem; /** * @var WishlistDataMapper @@ -55,20 +56,20 @@ class UpdateProductsInWishlist implements ResolverInterface * @param WishlistResourceModel $wishlistResource * @param WishlistFactory $wishlistFactory * @param WishlistConfig $wishlistConfig - * @param UpdateProductsInWishlistModel $updateProductsInWishlist + * @param UpdateWishlistItem $updateWishlistItem * @param WishlistDataMapper $wishlistDataMapper */ public function __construct( WishlistResourceModel $wishlistResource, WishlistFactory $wishlistFactory, WishlistConfig $wishlistConfig, - UpdateProductsInWishlistModel $updateProductsInWishlist, + UpdateWishlistItem $updateWishlistItem, WishlistDataMapper $wishlistDataMapper ) { $this->wishlistResource = $wishlistResource; $this->wishlistFactory = $wishlistFactory; $this->wishlistConfig = $wishlistConfig; - $this->updateProductsInWishlist = $updateProductsInWishlist; + $this->updateWishlistItem = $updateWishlistItem; $this->wishlistDataMapper = $wishlistDataMapper; } @@ -83,34 +84,32 @@ public function resolve( array $args = null ) { if (!$this->wishlistConfig->isEnabled()) { - throw new GraphQlInputException(__('The wishlist configuration is currently disabled.')); + throw new GraphQlInputException(__('The wishlist configuration is currently disabled')); } $customerId = $context->getUserId(); - /* Guest checking */ if (null === $customerId || $customerId === 0) { throw new GraphQlAuthorizationException(__('The current user cannot perform operations on wishlist')); } - $wishlistId = ((int) $args['wishlistId']) ?: null; - $wishlist = $this->getWishlist($wishlistId, $customerId); + $wishlist = $this->getWishlist((int) $args['wishlistId'], $customerId); if (null === $wishlist->getId() || $customerId !== (int) $wishlist->getCustomerId()) { - throw new GraphQlInputException(__('The wishlist was not found.')); + throw new GraphQlInputException(__('Could not find the specified wishlist')); } - $wishlistItems = $args['wishlistItems']; - $wishlistItems = $this->getWishlistItems($wishlistItems, $wishlist); - $wishlistOutput = $this->updateProductsInWishlist->execute($wishlist, $wishlistItems); + $wishlistItems = $this->getWishlistItems($args['wishlistItems'], $wishlist); - if (count($wishlistOutput->getErrors()) !== count($wishlistItems)) { - $this->wishlistResource->save($wishlist); + foreach ($wishlistItems as $wishlistItem) { + $this->updateWishlistItem->execute($wishlistItem, $wishlist); } + $wishlistOutput = $this->updateWishlistItem->prepareOutput($wishlist); + return [ 'wishlist' => $this->wishlistDataMapper->map($wishlistOutput->getWishlist()), - 'user_errors' => \array_map( + 'user_errors' => array_map( function (Error $error) { return [ 'code' => $error->getCode(), @@ -133,7 +132,6 @@ function (Error $error) { private function getWishlistItems(array $wishlistItemsData, Wishlist $wishlist): array { $wishlistItems = []; - foreach ($wishlistItemsData as $wishlistItemData) { if (!isset($wishlistItemData['quantity'])) { $wishlistItem = $wishlist->getItem($wishlistItemData['wishlist_item_id']); @@ -149,7 +147,6 @@ private function getWishlistItems(array $wishlistItemsData, Wishlist $wishlist): } $wishlistItems[] = (new WishlistItemFactory())->create($wishlistItemData); } - return $wishlistItems; } diff --git a/app/code/Magento/WishlistGraphQl/Model/Resolver/Wishlist/AddToCart.php b/app/code/Magento/WishlistGraphQl/Model/Resolver/Wishlist/AddToCart.php new file mode 100755 index 0000000000000..02ef14f6f0646 --- /dev/null +++ b/app/code/Magento/WishlistGraphQl/Model/Resolver/Wishlist/AddToCart.php @@ -0,0 +1,236 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare (strict_types = 1); + +namespace Magento\WishlistGraphQl\Model\Resolver\Wishlist; + +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\QuoteGraphQl\Model\Cart\CreateEmptyCartForCustomer; +use Magento\Quote\Model\Cart\AddProductsToCart as AddProductsToCartService; +use Magento\Quote\Model\Cart\Data\CartItemFactory; +use Magento\Quote\Model\Cart\Data\Error; +use Magento\WishlistGraphQl\Mapper\WishlistDataMapper; +use Magento\WishlistGraphQl\Model\CartItems\CartItemsRequestBuilder; +use Magento\Wishlist\Model\LocaleQuantityProcessor; +use Magento\Wishlist\Model\ResourceModel\Item\Collection as WishlistItemsCollection; +use Magento\Wishlist\Model\ResourceModel\Wishlist as WishlistResourceModel; +use Magento\Wishlist\Model\Wishlist; +use Magento\Wishlist\Model\WishlistFactory; +use Magento\Wishlist\Model\Wishlist\AddProductsToWishlist as AddProductsToWishlistModel; +use Magento\Wishlist\Model\Wishlist\Config as WishlistConfig; + +/** + * Adding products to wishlist resolver + */ +class AddToCart implements ResolverInterface +{ + /** + * @var AddProductsToWishlistModel + */ + private $addProductsToWishlist; + + /** + * @var WishlistDataMapper + */ + private $wishlistDataMapper; + + /** + * @var WishlistConfig + */ + private $wishlistConfig; + + /** + * @var WishlistResourceModel + */ + private $wishlistResource; + + /** + * @var WishlistFactory + */ + private $wishlistFactory; + + /** + * @var LocaleQuantityProcessor + */ + private $quantityProcessor; + + /** + * @var CreateEmptyCartForCustomer + */ + private $createEmptyCartForCustomer; + + /** + * @var AddProductsToCartService + */ + private $addProductsToCartService; + + /** + * @var CartItemsRequestBuilder + */ + private $cartItemsRequestBuilder; + + /** + * @param WishlistResourceModel $wishlistResource + * @param WishlistFactory $wishlistFactory + * @param WishlistConfig $wishlistConfig + * @param AddProductsToWishlistModel $addProductsToWishlist + * @param WishlistDataMapper $wishlistDataMapper + * @param LocaleQuantityProcessor $quantityProcessor + * @param CreateEmptyCartForCustomer $createEmptyCartForCustomer + * @param AddProductsToCartService $addProductsToCart + * @param CartItemsRequestBuilder $cartItemsRequestBuilder + */ + public function __construct( + WishlistResourceModel $wishlistResource, + WishlistFactory $wishlistFactory, + WishlistConfig $wishlistConfig, + AddProductsToWishlistModel $addProductsToWishlist, + WishlistDataMapper $wishlistDataMapper, + LocaleQuantityProcessor $quantityProcessor, + CreateEmptyCartForCustomer $createEmptyCartForCustomer, + AddProductsToCartService $addProductsToCart, + CartItemsRequestBuilder $cartItemsRequestBuilder + ) { + $this->wishlistResource = $wishlistResource; + $this->wishlistFactory = $wishlistFactory; + $this->wishlistConfig = $wishlistConfig; + $this->addProductsToWishlist = $addProductsToWishlist; + $this->wishlistDataMapper = $wishlistDataMapper; + $this->quantityProcessor = $quantityProcessor; + $this->createEmptyCartForCustomer = $createEmptyCartForCustomer; + $this->addProductsToCartService = $addProductsToCart; + $this->cartItemsRequestBuilder = $cartItemsRequestBuilder; + } + + /** + * @inheritdoc + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + if (!$this->wishlistConfig->isEnabled()) { + throw new GraphQlInputException(__('The wishlist configuration is currently disabled.')); + } + + $customerId = $context->getUserId(); + + /* Guest checking */ + if (null === $customerId || 0 === $customerId) { + throw new GraphQlAuthorizationException(__('The current user cannot perform operations on wishlist')); + } + + if (empty($args['wishlistId'])) { + throw new GraphQlInputException(__('"wishlistId" value should be specified')); + } + $wishlistId = (int) $args['wishlistId']; + $wishlist = $this->getWishlist($wishlistId, $customerId); + $isOwner = $wishlist->isOwner($customerId); + + if (null === $wishlist->getId() || $customerId !== (int) $wishlist->getCustomerId()) { + throw new GraphQlInputException(__('The wishlist was not found.')); + } + + $itemIds = []; + if (isset($args['wishlistItemIds'])) { + $itemIds = $args['wishlistItemIds']; + } + + $collection = $this->getWishlistItems($wishlist, $itemIds); + + if (!empty($itemIds)) { + $unknownItemIds = array_diff($itemIds, array_keys($collection->getItems())); + if (!empty($unknownItemIds)) { + throw new GraphQlInputException(__('The wishlist item ids "'.implode(',', $unknownItemIds).'" were not found.')); + } + } + $maskedCartId = $this->createEmptyCartForCustomer->execute($customerId); + + $cartErrors = []; + $addedProducts = []; + $errors = []; + foreach ($collection as $item) { + $disableAddToCart = $item->getProduct()->getDisableAddToCart(); + $item->getProduct()->setDisableAddToCart($disableAddToCart); + + $cartItemData = $this->cartItemsRequestBuilder->build($item); + $cartItem = (new CartItemFactory())->create($cartItemData); + + /** @var AddProductsToCartOutput $addProductsToCartOutput */ + $addProductsToCartOutput = $this->addProductsToCartService->execute($maskedCartId, [$cartItem]); + $errors = array_map( + function (Error $error) use ($item, $wishlist) { + return [ + 'wishlistItemId' => $item->getID(), + 'wishlistId' => $wishlist->getId(), + 'code' => $error->getCode(), + 'message' => $error->getMessage(), + ]; + }, + $addProductsToCartOutput->getErrors() + ); + if ($isOwner && empty($errors)) { + $item->delete(); + $addedProducts[] = $item->getProductId(); + } + $cartErrors = array_merge($cartErrors, $errors); + } + if (!empty($addedProducts)) { + $wishlist->save(); + } + return [ + 'wishlist' => $this->wishlistDataMapper->map($wishlist), + 'status' => empty($cartErrors) ? true : false, + 'add_wishlist_items_to_cart_user_errors' => $cartErrors, + ]; + } + + /** + * Get customer wishlist + * + * @param int|null $wishlistId + * @param int|null $customerId + * + * @return Wishlist + */ + private function getWishlist(?int $wishlistId, ?int $customerId): Wishlist + { + $wishlist = $this->wishlistFactory->create(); + + if ($wishlistId !== null && $wishlistId > 0) { + $this->wishlistResource->load($wishlist, $wishlistId); + } elseif ($customerId !== null) { + $wishlist->loadByCustomerId($customerId, true); + } + + return $wishlist; + } + + /** + * Get customer wishlist items + * + * @param array $itemIds + * + * @return WishlistItemsCollection + */ + private function getWishlistItems(Wishlist $wishlist, array $itemIds): WishlistItemsCollection + { + if (!empty($itemIds)) { + $collection = $wishlist->getItemCollection()->addFieldToFilter('wishlist_item_id', $itemIds) + ->setVisibilityFilter(); + } else { + $collection = $wishlist->getItemCollection()->setVisibilityFilter(); + } + return $collection; + } +} diff --git a/app/code/Magento/WishlistGraphQl/Model/Resolver/WishlistItems.php b/app/code/Magento/WishlistGraphQl/Model/Resolver/WishlistItems.php index bf9fe1875c228..f3a611b94a9ef 100644 --- a/app/code/Magento/WishlistGraphQl/Model/Resolver/WishlistItems.php +++ b/app/code/Magento/WishlistGraphQl/Model/Resolver/WishlistItems.php @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -declare(strict_types=1); +declare (strict_types = 1); namespace Magento\WishlistGraphQl\Model\Resolver; @@ -13,9 +13,9 @@ use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Store\Api\Data\StoreInterface; use Magento\Store\Model\StoreManagerInterface; +use Magento\Wishlist\Model\Item; use Magento\Wishlist\Model\ResourceModel\Item\Collection as WishlistItemCollection; use Magento\Wishlist\Model\ResourceModel\Item\CollectionFactory as WishlistItemCollectionFactory; -use Magento\Wishlist\Model\Item; use Magento\Wishlist\Model\Wishlist; /** @@ -81,8 +81,8 @@ public function resolve( 'page_info' => [ 'current_page' => $wishlistItemsCollection->getCurPage(), 'page_size' => $wishlistItemsCollection->getPageSize(), - 'total_pages' => $wishlistItemsCollection->getLastPageNumber() - ] + 'total_pages' => $wishlistItemsCollection->getLastPageNumber(), + ], ]; } @@ -115,4 +115,4 @@ private function getWishListItems(Wishlist $wishlist, array $args): WishlistItem } return $wishlistItemCollection; } -} +} \ No newline at end of file diff --git a/app/code/Magento/WishlistGraphQl/Model/UpdateWishlistItem.php b/app/code/Magento/WishlistGraphQl/Model/UpdateWishlistItem.php new file mode 100644 index 0000000000000..35c623c8eb912 --- /dev/null +++ b/app/code/Magento/WishlistGraphQl/Model/UpdateWishlistItem.php @@ -0,0 +1,173 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\WishlistGraphQl\Model; + +use Magento\Framework\Exception\AlreadyExistsException; +use Magento\Framework\Exception\LocalizedException; +use Magento\Wishlist\Model\Item; +use Magento\Wishlist\Model\ResourceModel\Wishlist as WishlistResourceModel; +use Magento\Wishlist\Model\Wishlist; +use Magento\Wishlist\Model\Wishlist\BuyRequest\BuyRequestBuilder; +use Magento\Wishlist\Model\Wishlist\Data\Error as WishlistError; +use Magento\Wishlist\Model\Wishlist\Data\WishlistItem as WishlistItemData; +use Magento\Wishlist\Model\Wishlist\Data\WishlistOutput; + +/** + * Update wishlist items helper + */ +class UpdateWishlistItem +{ + private const ERROR_UNDEFINED = 'UNDEFINED'; + + /** + * @var WishlistResourceModel + */ + private $wishlistResource; + + /** + * @var BuyRequestBuilder + */ + private $buyRequestBuilder; + + /** + * @var array + */ + private $errors = []; + + /** + * @param WishlistResourceModel $wishlistResource + * @param BuyRequestBuilder $buyRequestBuilder + */ + public function __construct( + WishlistResourceModel $wishlistResource, + BuyRequestBuilder $buyRequestBuilder + ) { + $this->wishlistResource = $wishlistResource; + $this->buyRequestBuilder = $buyRequestBuilder; + } + + /** + * Update wishlist item and set data from request + * + * @param WishlistItemData $wishlistItemData + * @param Wishlist $wishlist + * + * @throws LocalizedException + * @throws AlreadyExistsException + */ + public function execute(WishlistItemData $wishlistItemData, Wishlist $wishlist) + { + $wishlistItemId = (int) $wishlistItemData->getId(); + $wishlistItemToUpdate = $wishlist->getItem($wishlistItemId); + + if (!$wishlistItemToUpdate) { + $this->addError( + __('The wishlist item with ID "%1" does not belong to the wishlist', $wishlistItemId)->render() + ); + } elseif ((int) $wishlistItemData->getQuantity() === 0) { + $this->addError( + __('The quantity of a wishlist item cannot be 0')->render() + ); + } else { + $updatedOptions = $this->getUpdatedOptions($wishlistItemData, $wishlistItemToUpdate); + + $wishlistItemToUpdate->setOptions($updatedOptions); + $wishlistItemToUpdate->setQty($wishlistItemData->getQuantity()); + if ($wishlistItemData->getDescription()) { + $wishlistItemToUpdate->setDescription($wishlistItemData->getDescription()); + } + + $this->wishlistResource->save($wishlist); + } + } + + /** + * Build the updated options for the specified wishlist item. + * + * @param WishlistItemData $wishlistItemData + * @param Item $wishlistItemToUpdate + * @return array + * @throws LocalizedException + */ + private function getUpdatedOptions(WishlistItemData $wishlistItemData, Item $wishlistItemToUpdate) + { + $wishlistItemId = $wishlistItemToUpdate->getId(); + $wishlistItemProduct = $wishlistItemToUpdate->getProduct(); + + if (!$wishlistItemProduct->getId()) { + throw new LocalizedException( + __('Could not find product for the wishlist item with ID "%1"', $wishlistItemId) + ); + } + + // Update the buy request using the wishlist item data. Use existing values for unspecified options. + $newBuyRequest = $this->buyRequestBuilder + ->build($wishlistItemData) + ->setData('action', 'updateItem'); + $updatedBuyRequest = $wishlistItemToUpdate->getBuyRequest()->addData($newBuyRequest->toArray()); + + // Get potential products to add to the cart for the product type using the updated buy request + $wishlistItemProduct->setWishlistStoreId($wishlistItemToUpdate->getStoreId()); + $cartCandidates = $wishlistItemProduct->getTypeInstance()->processConfiguration( + $updatedBuyRequest, + clone $wishlistItemProduct + ); + + if (is_string($cartCandidates)) { + throw new LocalizedException( + __('Could not prepare product for the wishlist item with ID %1', $wishlistItemId) + ); + } + + // Of the cart candidates, find the parent product and get its options + if (!is_array($cartCandidates)) { + $cartCandidates = [$cartCandidates]; + } + $updatedOptions = []; + foreach ($cartCandidates as $candidate) { + if ($candidate->getParentProductId() === null) { + $candidate->setWishlistStoreId($wishlistItemToUpdate->getStoreId()); + $updatedOptions = $candidate->getCustomOptions(); + break; + } + } + + return $updatedOptions; + } + + /** + * Add wishlist line item error + * + * @param string $message + * @param string|null $code + * + * @return void + */ + private function addError(string $message, string $code = null): void + { + $this->errors[] = new WishlistError( + $message, + $code ?? self::ERROR_UNDEFINED + ); + } + + /** + * Prepare output + * + * @param Wishlist $wishlist + * + * @return WishlistOutput + */ + public function prepareOutput(Wishlist $wishlist): WishlistOutput + { + $output = new WishlistOutput($wishlist, $this->errors); + $this->errors = []; + + return $output; + } +} diff --git a/app/code/Magento/WishlistGraphQl/composer.json b/app/code/Magento/WishlistGraphQl/composer.json old mode 100644 new mode 100755 index 58bc738bd24d6..40b9377d716e7 --- a/app/code/Magento/WishlistGraphQl/composer.json +++ b/app/code/Magento/WishlistGraphQl/composer.json @@ -5,10 +5,12 @@ "require": { "php": "~7.3.0||~7.4.0", "magento/framework": "*", - "magento/module-catalog": "*", - "magento/module-catalog-graph-ql": "*", "magento/module-wishlist": "*", - "magento/module-store": "*" + "magento/module-store": "*", + "magento/module-quote-graph-ql": "*", + "magento/module-quote": "*", + "magento/module-catalog": "*", + "magento/module-catalog-graph-ql": "*" }, "license": [ "OSL-3.0", diff --git a/app/code/Magento/WishlistGraphQl/etc/graphql/di.xml b/app/code/Magento/WishlistGraphQl/etc/graphql/di.xml index 4d4ce9458fb6c..864a5088f500a 100644 --- a/app/code/Magento/WishlistGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/WishlistGraphQl/etc/graphql/di.xml @@ -14,4 +14,14 @@ </argument> </arguments> </type> + <type name="Magento\WishlistGraphQl\Model\CartItems\CartItemsRequestBuilder"> + <arguments> + <argument name="providers" xsi:type="array"> + <item name="customizable_option" xsi:type="object">Magento\WishlistGraphQl\Model\CartItems\CustomizableOptionDataProvider</item> + <item name="downloadable" xsi:type="object">Magento\WishlistGraphQl\Model\CartItems\DownloadableLinkDataProvider</item> + <item name="bundle" xsi:type="object">Magento\WishlistGraphQl\Model\CartItems\BundleDataProvider</item> + <item name="configurable" xsi:type="object">Magento\WishlistGraphQl\Model\CartItems\ConfigurableDataProvider</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/WishlistGraphQl/etc/module.xml b/app/code/Magento/WishlistGraphQl/etc/module.xml old mode 100644 new mode 100755 diff --git a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls index 5a44facb606ac..ab5ccbd2e18c3 100644 --- a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls +++ b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls @@ -35,12 +35,12 @@ type Wishlist { } interface WishlistItemInterface @typeResolver(class: "Magento\\WishlistGraphQl\\Model\\Resolver\\Type\\WishlistItemType") { - id: ID! @doc(description: "The unique ID for a `WishlistItemInterface` object") + id: ID! @doc(description: "The unique ID for a `WishlistItemInterface` object") quantity: Float! @doc(description: "The quantity of this wish list item") description: String @doc(description: "The description of the item") added_at: String! @doc(description: "The date and time the item was added to the wish list") product: ProductInterface @doc(description: "Product details of the wish list item") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\ProductResolver") - customizable_options: [SelectedCustomizableOption] @doc(description: "Custom options selected for the wish list item") + customizable_options: [SelectedCustomizableOption]! @doc(description: "Custom options selected for the wish list item") } type WishlistItems { @@ -60,6 +60,30 @@ type Mutation { addProductsToWishlist(wishlistId: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput @doc(description: "Adds one or more products to the specified wish list. This mutation supports all product types") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\AddProductsToWishlist") removeProductsFromWishlist(wishlistId: ID!, wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput @doc(description: "Removes one or more products from the specified wish list") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\RemoveProductsFromWishlist") updateProductsInWishlist(wishlistId: ID!, wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput @doc(description: "Updates one or more products in the specified wish list") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\UpdateProductsInWishlist") + addWishlistItemsToCart( + wishlistId: ID!, @doc(description: "The unique ID of the wish list") + wishlistItemIds: [ID!] @doc(description: "An array of IDs representing products to be added to the cart. If no IDs are specified, all items in the wishlist will be added to the cart") + ): AddWishlistItemsToCartOutput @resolver(class: "Magento\\WishlistGraphQl\\Model\\Resolver\\Wishlist\\AddToCart") @doc(description: "Add items in the specified wishlist to the customer's cart") +} + +type AddWishlistItemsToCartOutput { + wishlist: Wishlist! @doc(description: "Contains the wish list with all items that were successfully added") + status: Boolean! @doc(description: "Indicates whether the attempt to add items to the customer's cart was successful") + add_wishlist_items_to_cart_user_errors: [WishlistCartUserInputError!]! @doc(description: "An array of errors encountered while adding products to the customer's cart") +} + +type WishlistCartUserInputError { + message: String! @doc(description: "A localized error message") + code: WishlistCartUserInputErrorType! @doc(description: "An error code that describes the error encountered") + wishlistId: ID! @doc(description: "The unique ID of the `Wishlist` object containing an error") + wishlistItemId: ID! @doc(description: "The unique ID of the wish list item containing an error") +} + +enum WishlistCartUserInputErrorType { + PRODUCT_NOT_FOUND + NOT_SALABLE + INSUFFICIENT_STOCK + UNDEFINED } input WishlistItemInput @doc(description: "Defines the items to add to a wish list") { diff --git a/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less index 650fe6177d04b..0bd7264a23835 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less @@ -99,6 +99,13 @@ .admin__field + .admin__field { margin-left: @indent__s; margin-top: 0; + .admin__field-control { + .admin__control-addon { + .admin__control-text { + min-width: 6rem; + } + } + } } } } diff --git a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less index 3e9f2d4401b05..d88260e01b25d 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less +++ b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less @@ -66,6 +66,10 @@ display: inline-block; overflow: hidden; width: 100%; + + &.white-space-preserved { + white-space: pre; + } } body._in-resize { diff --git a/app/design/frontend/Magento/blank/Magento_ProductVideo/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_ProductVideo/web/css/source/_module.less index 023c531545963..25d1e49d4ef98 100644 --- a/app/design/frontend/Magento/blank/Magento_ProductVideo/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_ProductVideo/web/css/source/_module.less @@ -10,7 +10,7 @@ & when (@media-common = true) { .fotorama-video-container { &:after { - background: url(../Magento_ProductVideo/img/gallery-sprite.png) bottom right; + background: url('../Magento_ProductVideo/img/gallery-sprite.png') bottom right; bottom: 0; content: ''; height: 100px; @@ -40,7 +40,7 @@ } .video-thumb-icon:after { - background: url(../Magento_ProductVideo/img/gallery-sprite.png) bottom left; + background: url('../Magento_ProductVideo/img/gallery-sprite.png') bottom left; bottom: 0; content: ''; height: 40px; diff --git a/app/design/frontend/Magento/blank/Magento_Theme/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Theme/web/css/source/_module.less index 8f99550271967..e426161dbe4b0 100644 --- a/app/design/frontend/Magento/blank/Magento_Theme/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_Theme/web/css/source/_module.less @@ -285,6 +285,10 @@ padding: 0; } } + + .cookie-status-message { + display: none; + } } // diff --git a/app/design/frontend/Magento/blank/Magento_Theme/web/js/theme.js b/app/design/frontend/Magento/blank/Magento_Theme/web/js/theme.js index 87aceb0b00036..cd622117ecb78 100644 --- a/app/design/frontend/Magento/blank/Magento_Theme/web/js/theme.js +++ b/app/design/frontend/Magento/blank/Magento_Theme/web/js/theme.js @@ -17,6 +17,13 @@ define([ }); $('.panel.header > .header.links').clone().appendTo('#store\\.links'); + $('#store\\.links li a').each(function () { + var id = $(this).attr('id'); + + if (id !== undefined) { + $(this).attr('id', id + '_mobile'); + } + }); keyboardHandler.apply(); }); diff --git a/app/design/frontend/Magento/blank/web/css/source/_actions-toolbar.less b/app/design/frontend/Magento/blank/web/css/source/_actions-toolbar.less index cfb4f01bca69d..1e5d20a8b5901 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_actions-toolbar.less +++ b/app/design/frontend/Magento/blank/web/css/source/_actions-toolbar.less @@ -27,6 +27,12 @@ margin-bottom: 0; } } + + > .secondary { + .action.back { + display: none; + } + } } } diff --git a/app/design/frontend/Magento/blank/web/css/source/_sources.less b/app/design/frontend/Magento/blank/web/css/source/_sources.less index af7eda617217a..0e8c4b356a927 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_sources.less +++ b/app/design/frontend/Magento/blank/web/css/source/_sources.less @@ -4,7 +4,7 @@ // */ @import '_variables.less'; -@import (reference) '_extends.less'; +@import '_extends.less'; @import '_typography.less'; @import '_layout.less'; @import '_tables.less'; diff --git a/app/design/frontend/Magento/blank/web/css/source/_theme.less b/app/design/frontend/Magento/blank/web/css/source/_theme.less index e061a30d0dd51..e7bc34573cd4e 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_theme.less +++ b/app/design/frontend/Magento/blank/web/css/source/_theme.less @@ -10,3 +10,6 @@ // Theme file should contain declarations (overrides) ONLY OF EXISTING variables // Otherwise this theme won't be available for parent nesting // All new variables should be placed in local theme lib or local theme files + +// Form field note icon +@form-field-note-icon-font__content: false; diff --git a/app/design/frontend/Magento/blank/web/css/styles-l.less b/app/design/frontend/Magento/blank/web/css/styles-l.less index 9cc7f3c134d6b..3a432ce1b2081 100644 --- a/app/design/frontend/Magento/blank/web/css/styles-l.less +++ b/app/design/frontend/Magento/blank/web/css/styles-l.less @@ -14,7 +14,6 @@ // --------------------------------------------- @import '_styles.less'; -@import (reference) 'source/_extends.less'; // // Magento Import instructions diff --git a/app/design/frontend/Magento/blank/web/css/styles-m.less b/app/design/frontend/Magento/blank/web/css/styles-m.less index 86907aef3cfc3..c1cd85ef570dd 100644 --- a/app/design/frontend/Magento/blank/web/css/styles-m.less +++ b/app/design/frontend/Magento/blank/web/css/styles-m.less @@ -15,7 +15,6 @@ @import 'source/_reset.less'; @import '_styles.less'; -@import (reference) 'source/_extends.less'; // // Magento Import instructions diff --git a/app/design/frontend/Magento/luma/Magento_Review/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Review/web/css/source/_module.less index 4b5e03f8013b0..68d59d047ceec 100644 --- a/app/design/frontend/Magento/luma/Magento_Review/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Review/web/css/source/_module.less @@ -224,12 +224,12 @@ &-ratings { float: left; margin-bottom: 0; - max-width: @review-ratings-left - @indent__xl; + min-width: @review-ratings-left - @indent__xl; + padding-right: @indent__xl; } - &-ratings ~ &-content, - &-ratings ~ &-details { - margin-left: @review-ratings-left; + &-ratings ~ &-content-container { + overflow: hidden; } } @@ -419,7 +419,7 @@ .product-details { &:extend(.abs-add-clearfix all); &:extend(.abs-margin-for-blocks-and-widgets all); - + .rating-average-label { &:extend(.abs-visually-hidden all); } @@ -441,7 +441,7 @@ .customer-review-rating { margin-bottom: @indent__base; - + .item { margin-bottom: @indent__s; diff --git a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less index ac2a2f249ac11..178bf8b115b19 100644 --- a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less @@ -393,6 +393,10 @@ border: @tooltip__border-width solid @tooltip__border-color; padding: 10px; } + + .cookie-status-message { + display: none; + } } // diff --git a/app/etc/di.xml b/app/etc/di.xml index b1d81ed70f6b4..f0f27ea0e7d83 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -1876,6 +1876,10 @@ <item name="hr" xsi:type="string">hr</item> <item name="figure" xsi:type="string">figure</item> <item name="button" xsi:type="string">button</item> + <item name="i" xsi:type="string">i</item> + <item name="u" xsi:type="string">u</item> + <item name="br" xsi:type="string">br</item> + <item name="b" xsi:type="string">b</item> </argument> <argument name="allowedAttributes" xsi:type="array"> <item name="class" xsi:type="string">class</item> @@ -1912,4 +1916,15 @@ </argument> </arguments> </type> + <type name="Magento\Framework\Validator\UrlKey"> + <arguments> + <argument name="restrictedValues" xsi:type="array"> + <item name="0" xsi:type="string">admin</item> + <item name="1" xsi:type="string">soap</item> + <item name="2" xsi:type="string">rest</item> + <item name="3" xsi:type="string">graphql</item> + <item name="4" xsi:type="string">standard</item> + </argument> + </arguments> + </type> </config> diff --git a/bin/magento b/bin/magento index 77902ff78e179..564d95d38c048 100755 --- a/bin/magento +++ b/bin/magento @@ -21,7 +21,7 @@ try { set_error_handler([$handler, 'handler']); $application = new Magento\Framework\Console\Cli('Magento CLI'); $application->run(); -} catch (\Exception $e) { +} catch (\Throwable $e) { while ($e) { echo $e->getMessage(); echo $e->getTraceAsString(); diff --git a/composer.json b/composer.json index 6aa9355cec7b1..bcd30dc5bdc95 100644 --- a/composer.json +++ b/composer.json @@ -32,73 +32,70 @@ "colinmollenhour/cache-backend-redis": "1.11.0", "colinmollenhour/credis": "1.11.1", "colinmollenhour/php-redis-session-abstract": "~1.4.0", - "composer/composer": "^1.9", - "elasticsearch/elasticsearch": "~7.7.0", + "composer/composer": "^1.9 || ^2.0", + "elasticsearch/elasticsearch": "~7.11.0", "guzzlehttp/guzzle": "^6.3.3", - "laminas/laminas-captcha": "^2.7.1", - "laminas/laminas-code": "~3.4.1", - "laminas/laminas-config": "^2.6.0", - "laminas/laminas-console": "^2.6.0", - "laminas/laminas-crypt": "^2.6.0", - "laminas/laminas-db": "^2.8.2", - "laminas/laminas-dependency-plugin": "^1.0", - "laminas/laminas-di": "^2.6.1", + "laminas/laminas-captcha": "^2.10", + "laminas/laminas-code": "^3.5.1", + "laminas/laminas-crypt": "^3.4.0", + "laminas/laminas-db": "^2.12.0", + "laminas/laminas-dependency-plugin": "^2.1.0", + "laminas/laminas-di": "^3.2.0", "laminas/laminas-eventmanager": "^3.0.0", - "laminas/laminas-feed": "^2.9.0", - "laminas/laminas-form": "^2.10.0", + "laminas/laminas-feed": "^2.13.0", + "laminas/laminas-filter": "^2.11", "laminas/laminas-http": "^2.6.0", "laminas/laminas-i18n": "^2.7.3", - "laminas/laminas-json": "^2.6.1", - "laminas/laminas-log": "^2.9.1", + "laminas/laminas-json": "^3.2.0", "laminas/laminas-mail": "^2.9.0", - "laminas/laminas-mime": "^2.5.0", + "laminas/laminas-mime": "^2.8.0", "laminas/laminas-modulemanager": "^2.7", - "laminas/laminas-mvc": "~2.7.0", - "laminas/laminas-serializer": "^2.7.2", + "laminas/laminas-mvc": "^3.2.0", "laminas/laminas-server": "^2.6.1", - "laminas/laminas-servicemanager": "^2.7.8", - "laminas/laminas-session": "^2.7.3", - "laminas/laminas-soap": "^2.7.0", + "laminas/laminas-servicemanager": "^3.6.0", + "laminas/laminas-session": "^2.10", + "laminas/laminas-soap": "^2.9.0", "laminas/laminas-stdlib": "^3.2.1", "laminas/laminas-text": "^2.6.0", "laminas/laminas-uri": "^2.5.1", "laminas/laminas-validator": "^2.6.0", - "laminas/laminas-view": "~2.11.2", + "laminas/laminas-view": "~2.12.0", + "league/flysystem": "^2.0", + "league/flysystem-aws-s3-v3": "^2.0", "magento/composer": "1.6.0", "magento/magento-composer-installer": ">=0.1.11", "magento/zendframework1": "~1.14.2", "monolog/monolog": "^1.17", "paragonie/sodium_compat": "^1.6", - "pelago/emogrifier": "^3.1.0", + "pelago/emogrifier": "^5.0.0", "php-amqplib/php-amqplib": "~2.10.0", "phpseclib/mcrypt_compat": "1.0.8", "phpseclib/phpseclib": "2.0.*", - "ramsey/uuid": "~3.8.0", + "ramsey/uuid": "~4.1.0", "symfony/console": "~4.4.0", "symfony/event-dispatcher": "~4.4.0", "symfony/process": "~4.4.0", - "tedivm/jshrink": "~1.3.0", + "tedivm/jshrink": "~1.4.0", "tubalmartin/cssmin": "4.1.1", "webonyx/graphql-php": "^0.13.8", - "wikimedia/less.php": "~1.8.0", - "league/flysystem": "^1.0", - "league/flysystem-aws-s3-v3": "^1.0", - "league/flysystem-cached-adapter": "^1.0" + "wikimedia/less.php": "^3.0.0", + "web-token/jwt-framework": "^v2.2.7" }, "require-dev": { - "allure-framework/allure-phpunit": "~1.2.0", - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", - "friendsofphp/php-cs-fixer": "~2.16.0", + "allure-framework/allure-phpunit": "~1.4", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "friendsofphp/php-cs-fixer": "~2.18.1", "lusitanian/oauth": "~0.8.10", "magento/magento-coding-standard": "*", "magento/magento2-functional-testing-framework": "^3.0", "pdepend/pdepend": "~2.7.1", "phpcompatibility/php-compatibility": "^9.3", "phpmd/phpmd": "^2.8.0", - "phpstan/phpstan": ">=0.12.3 <=0.12.23", + "phpstan/phpstan": "^0.12.77", "phpunit/phpunit": "^9", - "sebastian/phpcpd": "~5.0.0", - "squizlabs/php_codesniffer": "~3.5.4" + "sebastian/phpcpd": "^6.0.3", + "squizlabs/php_codesniffer": "~3.5.4", + "symfony/finder": "^5.2" }, "suggest": { "ext-pcntl": "Need for run processes in parallel mode" @@ -330,7 +327,8 @@ "magento/module-tinymce-3": "*", "magento/module-csp": "*", "magento/module-aws-s3": "*", - "magento/module-remote-storage": "*" + "magento/module-remote-storage": "*", + "magento/module-jwt-framework-adapter": "*" }, "conflict": { "gene/bluefoot": "*" @@ -357,8 +355,7 @@ "psr-4": { "Magento\\Framework\\": "lib/internal/Magento/Framework/", "Magento\\Setup\\": "setup/src/Magento/Setup/", - "Magento\\": "app/code/Magento/", - "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/" + "Magento\\": "app/code/Magento/" }, "psr-0": { "": [ diff --git a/composer.lock b/composer.lock index b0b15f4e13f6c..080349b2e29a3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ac6fc13ba98a815bce589d300d28012c", + "content-hash": "cc9ee01fc7b014d6cb128a000a244a6b", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.158.19", + "version": "3.178.4", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "b1c3c763e227e518768f0416cbd2b29c11f79561" + "reference": "fc3667c6054c941ae8cd8b8750f7c5c892d5a87b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b1c3c763e227e518768f0416cbd2b29c11f79561", - "reference": "b1c3c763e227e518768f0416cbd2b29c11f79561", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/fc3667c6054c941ae8cd8b8750f7c5c892d5a87b", + "reference": "fc3667c6054c941ae8cd8b8750f7c5c892d5a87b", "shasum": "" }, "require": { @@ -25,9 +25,9 @@ "ext-pcre": "*", "ext-simplexml": "*", "guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4.1", - "mtdowling/jmespath.php": "^2.5", + "guzzlehttp/promises": "^1.4.0", + "guzzlehttp/psr7": "^1.7.0", + "mtdowling/jmespath.php": "^2.6", "php": ">=5.5" }, "require-dev": { @@ -89,7 +89,98 @@ "s3", "sdk" ], - "time": "2020-11-02T19:49:21+00:00" + "time": "2021-04-14T18:16:00+00:00" + }, + { + "name": "brick/math", + "version": "0.9.2", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "dff976c2f3487d42c1db75a3b180e2b9f0e72ce0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/dff976c2f3487d42c1db75a3b180e2b9f0e72ce0", + "reference": "dff976c2f3487d42c1db75a3b180e2b9f0e72ce0", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0", + "vimeo/psalm": "4.3.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "brick", + "math" + ], + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/brick/math", + "type": "tidelift" + } + ], + "time": "2021-01-20T22:51:39+00:00" + }, + { + "name": "brick/varexporter", + "version": "0.3.5", + "source": { + "type": "git", + "url": "https://github.com/brick/varexporter.git", + "reference": "05241f28dfcba2b51b11e2d750e296316ebbe518" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/varexporter/zipball/05241f28dfcba2b51b11e2d750e296316ebbe518", + "reference": "05241f28dfcba2b51b11e2d750e296316ebbe518", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.0", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^8.5 || ^9.0", + "vimeo/psalm": "4.4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\VarExporter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A powerful alternative to var_export(), which can export closures and objects without __set_state()", + "keywords": [ + "var_export" + ], + "time": "2021-02-10T13:53:07+00:00" }, { "name": "colinmollenhour/cache-backend-file", @@ -202,21 +293,24 @@ }, { "name": "colinmollenhour/php-redis-session-abstract", - "version": "v1.4.3", + "version": "v1.4.4", "source": { "type": "git", "url": "https://github.com/colinmollenhour/php-redis-session-abstract.git", - "reference": "39ca38da5e0a981bc1a7e39a86693c128784a513" + "reference": "8d684bbacac99450f2a9ddf6f56be296997e2959" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/colinmollenhour/php-redis-session-abstract/zipball/39ca38da5e0a981bc1a7e39a86693c128784a513", - "reference": "39ca38da5e0a981bc1a7e39a86693c128784a513", + "url": "https://api.github.com/repos/colinmollenhour/php-redis-session-abstract/zipball/8d684bbacac99450f2a9ddf6f56be296997e2959", + "reference": "8d684bbacac99450f2a9ddf6f56be296997e2959", "shasum": "" }, "require": { "colinmollenhour/credis": "~1.6", - "php": "^5.5 || ^7.0|| ^7.1 || ^7.2" + "php": "^5.5 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9" }, "type": "library", "autoload": { @@ -235,20 +329,20 @@ ], "description": "A Redis-based session handler with optimistic locking", "homepage": "https://github.com/colinmollenhour/php-redis-session-abstract", - "time": "2020-10-07T09:47:22+00:00" + "time": "2021-04-07T21:51:17+00:00" }, { "name": "composer/ca-bundle", - "version": "1.2.8", + "version": "1.2.9", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "8a7ecad675253e4654ea05505233285377405215" + "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8a7ecad675253e4654ea05505233285377405215", - "reference": "8a7ecad675253e4654ea05505233285377405215", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/78a0e288fdcebf92aa2318a8d3656168da6ac1a5", + "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5", "shasum": "" }, "require": { @@ -257,14 +351,15 @@ "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "phpstan/phpstan": "^0.12.55", "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -305,20 +400,20 @@ "type": "tidelift" } ], - "time": "2020-08-23T12:54:47+00:00" + "time": "2021-01-12T12:10:35+00:00" }, { "name": "composer/composer", - "version": "1.10.17", + "version": "1.10.21", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "09d42e18394d8594be24e37923031c4b7442a1cb" + "reference": "04021432f4a9cbd9351dd166b8c193f42c36a39c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/09d42e18394d8594be24e37923031c4b7442a1cb", - "reference": "09d42e18394d8594be24e37923031c4b7442a1cb", + "url": "https://api.github.com/repos/composer/composer/zipball/04021432f4a9cbd9351dd166b8c193f42c36a39c", + "reference": "04021432f4a9cbd9351dd166b8c193f42c36a39c", "shasum": "" }, "require": { @@ -327,7 +422,7 @@ "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^1.1", "justinrainbow/json-schema": "^5.2.10", - "php": "^5.3.2 || ^7.0", + "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", @@ -399,24 +494,24 @@ "type": "tidelift" } ], - "time": "2020-10-30T21:31:58+00:00" + "time": "2021-04-01T07:16:35+00:00" }, { "name": "composer/semver", - "version": "1.7.1", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "38276325bd896f90dfcfe30029aa5db40df387a7" + "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/38276325bd896f90dfcfe30029aa5db40df387a7", - "reference": "38276325bd896f90dfcfe30029aa5db40df387a7", + "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a", + "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^4.5 || ^5.0.5" @@ -474,20 +569,20 @@ "type": "tidelift" } ], - "time": "2020-09-27T13:13:07+00:00" + "time": "2020-12-03T15:47:16+00:00" }, { "name": "composer/spdx-licenses", - "version": "1.5.4", + "version": "1.5.5", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223" + "reference": "de30328a7af8680efdc03e396aad24befd513200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/6946f785871e2314c60b4524851f3702ea4f2223", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/de30328a7af8680efdc03e396aad24befd513200", + "reference": "de30328a7af8680efdc03e396aad24befd513200", "shasum": "" }, "require": { @@ -499,7 +594,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -548,20 +643,20 @@ "type": "tidelift" } ], - "time": "2020-07-15T15:35:07+00:00" + "time": "2020-12-03T16:04:16+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.4", + "version": "1.4.6", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" + "reference": "f27e06cd9675801df441b3656569b328e04aa37c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", + "reference": "f27e06cd9675801df441b3656569b328e04aa37c", "shasum": "" }, "require": { @@ -569,7 +664,8 @@ "psr/log": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "autoload": { @@ -606,7 +702,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:39:10+00:00" + "time": "2021-03-25T17:01:18+00:00" }, { "name": "container-interop/container-interop", @@ -642,30 +738,32 @@ }, { "name": "elasticsearch/elasticsearch", - "version": "v7.7.0", + "version": "v7.11.0", "source": { "type": "git", "url": "https://github.com/elastic/elasticsearch-php.git", - "reference": "1d90a7ff4fb1936dc4376f09d723af75714f6f05" + "reference": "277cd5e182827c59c23e146a836a30470c0f879d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/1d90a7ff4fb1936dc4376f09d723af75714f6f05", - "reference": "1d90a7ff4fb1936dc4376f09d723af75714f6f05", + "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/277cd5e182827c59c23e146a836a30470c0f879d", + "reference": "277cd5e182827c59c23e146a836a30470c0f879d", "shasum": "" }, "require": { "ext-json": ">=1.3.7", "ezimuel/ringphp": "^1.1.2", - "php": "^7.1", + "php": "^7.1 || ^8.0", "psr/log": "~1.0" }, "require-dev": { - "cpliakas/git-wrapper": "~2.0", + "cpliakas/git-wrapper": "~2.0 || ~3.0", "doctrine/inflector": "^1.3", + "ext-yaml": "*", + "ext-zip": "*", "mockery/mockery": "^1.2", "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", "squizlabs/php_codesniffer": "^3.4", "symfony/finder": "~4.0", "symfony/yaml": "~4.0" @@ -701,7 +799,7 @@ "elasticsearch", "search" ], - "time": "2020-05-13T15:19:26+00:00" + "time": "2021-02-11T11:04:51+00:00" }, { "name": "ezimuel/guzzlestreams", @@ -804,6 +902,77 @@ "description": "Fork of guzzle/RingPHP (abandoned) to be used with elasticsearch-php", "time": "2020-02-14T23:51:21+00:00" }, + { + "name": "fgrosse/phpasn1", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/fgrosse/PHPASN1.git", + "reference": "d1978f7abd580f3fc33561e7f71d4c12c7531fad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/d1978f7abd580f3fc33561e7f71d4c12c7531fad", + "reference": "d1978f7abd580f3fc33561e7f71d4c12c7531fad", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.3", + "satooshi/php-coveralls": "~2.0" + }, + "suggest": { + "ext-bcmath": "BCmath is the fallback extension for big integer calculations", + "ext-curl": "For loading OID information from the web if they have not bee defined statically", + "ext-gmp": "GMP is the preferred extension for big integer calculations", + "phpseclib/bcmath_compat": "BCmath polyfill for servers where neither GMP nor BCmath is available" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "FG\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Friedrich Große", + "email": "friedrich.grosse@gmail.com", + "homepage": "https://github.com/FGrosse", + "role": "Author" + }, + { + "name": "All contributors", + "homepage": "https://github.com/FGrosse/PHPASN1/contributors" + } + ], + "description": "A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.", + "homepage": "https://github.com/FGrosse/PHPASN1", + "keywords": [ + "DER", + "asn.1", + "asn1", + "ber", + "binary", + "decoding", + "encoding", + "x.509", + "x.690", + "x509", + "x690" + ], + "time": "2020-10-11T16:28:18+00:00" + }, { "name": "guzzlehttp/guzzle", "version": "6.5.5", @@ -873,16 +1042,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "60d379c243457e073cff02bc323a2a86cb355631" + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", - "reference": "60d379c243457e073cff02bc323a2a86cb355631", + "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", "shasum": "" }, "require": { @@ -920,20 +1089,20 @@ "keywords": [ "promise" ], - "time": "2020-09-30T07:37:28+00:00" + "time": "2021-03-07T09:25:29+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" + "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1", + "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1", "shasum": "" }, "require": { @@ -991,7 +1160,7 @@ "uri", "url" ], - "time": "2020-09-30T07:37:11+00:00" + "time": "2021-03-21T16:25:00+00:00" }, { "name": "justinrainbow/json-schema", @@ -1061,34 +1230,36 @@ }, { "name": "laminas/laminas-captcha", - "version": "2.9.0", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-captcha.git", - "reference": "b88f650f3adf2d902ef56f6377cceb5cd87b9876" + "reference": "9a0134e434cd792934ecca42cb66f316be7bba50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-captcha/zipball/b88f650f3adf2d902ef56f6377cceb5cd87b9876", - "reference": "b88f650f3adf2d902ef56f6377cceb5cd87b9876", + "url": "https://api.github.com/repos/laminas/laminas-captcha/zipball/9a0134e434cd792934ecca42cb66f316be7bba50", + "reference": "9a0134e434cd792934ecca42cb66f316be7bba50", "shasum": "" }, "require": { "laminas/laminas-math": "^2.7 || ^3.0", - "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "laminas/laminas-stdlib": "^3.3", + "laminas/laminas-zendframework-bridge": "^1.1", + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-captcha": "self.version" + "zendframework/zend-captcha": "^2.9.0" }, "require-dev": { - "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-coding-standard": "~2.1.4", "laminas/laminas-recaptcha": "^3.0", - "laminas/laminas-session": "^2.8", - "laminas/laminas-text": "^2.6", - "laminas/laminas-validator": "^2.10.1", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2" + "laminas/laminas-session": "^2.10", + "laminas/laminas-text": "^2.8", + "laminas/laminas-validator": "^2.14", + "phpunit/phpunit": "^9.4.3", + "psalm/plugin-phpunit": "^0.15.1", + "vimeo/psalm": "^4.6" }, "suggest": { "laminas/laminas-i18n-resources": "Translations of captcha messages", @@ -1098,12 +1269,6 @@ "laminas/laminas-validator": "Laminas\\Validator component" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.9.x-dev", - "dev-develop": "2.10.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Captcha\\": "src/" @@ -1119,52 +1284,51 @@ "captcha", "laminas" ], - "time": "2019-12-31T16:24:14+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-03-17T16:42:11+00:00" }, { "name": "laminas/laminas-code", - "version": "3.4.1", + "version": "3.5.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-code.git", - "reference": "1cb8f203389ab1482bf89c0e70a04849bacd7766" + "reference": "b549b70c0bb6e935d497f84f750c82653326ac77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-code/zipball/1cb8f203389ab1482bf89c0e70a04849bacd7766", - "reference": "1cb8f203389ab1482bf89c0e70a04849bacd7766", + "url": "https://api.github.com/repos/laminas/laminas-code/zipball/b549b70c0bb6e935d497f84f750c82653326ac77", + "reference": "b549b70c0bb6e935d497f84f750c82653326ac77", "shasum": "" }, "require": { - "laminas/laminas-eventmanager": "^2.6 || ^3.0", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.1" + "laminas/laminas-eventmanager": "^3.3", + "laminas/laminas-zendframework-bridge": "^1.1", + "php": "^7.3 || ~8.0.0" }, "conflict": { "phpspec/prophecy": "<1.9.0" }, "replace": { - "zendframework/zend-code": "self.version" + "zendframework/zend-code": "^3.4.1" }, "require-dev": { - "doctrine/annotations": "^1.7", + "doctrine/annotations": "^1.10.4", "ext-phar": "*", - "laminas/laminas-coding-standard": "^1.0", - "laminas/laminas-stdlib": "^2.7 || ^3.0", - "phpunit/phpunit": "^7.5.16 || ^8.4" + "laminas/laminas-coding-standard": "^1.0.0", + "laminas/laminas-stdlib": "^3.3.0", + "phpunit/phpunit": "^9.4.2" }, "suggest": { "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", "laminas/laminas-stdlib": "Laminas\\Stdlib component" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4.x-dev", - "dev-develop": "3.5.x-dev", - "dev-dev-4.0": "4.0.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Code\\": "src/" @@ -1180,51 +1344,55 @@ "code", "laminas" ], - "time": "2019-12-31T16:28:24+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2020-11-30T20:16:31+00:00" }, { "name": "laminas/laminas-config", - "version": "2.6.0", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-config.git", - "reference": "71ba6d5dd703196ce66b25abc4d772edb094dae1" + "reference": "f91cd6fe79e82cbbcaa36485108a04e8ef1e679b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-config/zipball/71ba6d5dd703196ce66b25abc4d772edb094dae1", - "reference": "71ba6d5dd703196ce66b25abc4d772edb094dae1", + "url": "https://api.github.com/repos/laminas/laminas-config/zipball/f91cd6fe79e82cbbcaa36485108a04e8ef1e679b", + "reference": "f91cd6fe79e82cbbcaa36485108a04e8ef1e679b", "shasum": "" }, "require": { - "laminas/laminas-stdlib": "^2.7 || ^3.0", + "ext-json": "*", + "laminas/laminas-stdlib": "^2.7.7 || ^3.1", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.5 || ^7.0" + "php": "^7.3 || ~8.0.0", + "psr/container": "^1.0" + }, + "conflict": { + "container-interop/container-interop": "<1.2.0" }, "replace": { - "zendframework/zend-config": "self.version" + "zendframework/zend-config": "^3.3.0" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "laminas/laminas-filter": "^2.6", - "laminas/laminas-i18n": "^2.5", - "laminas/laminas-json": "^2.6.1", - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3", - "phpunit/phpunit": "~4.0" + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-filter": "^2.7.2", + "laminas/laminas-i18n": "^2.10.3", + "laminas/laminas-servicemanager": "^3.4.1", + "malukenho/docheader": "^0.1.6", + "phpunit/phpunit": "^8.5.8" }, "suggest": { - "laminas/laminas-filter": "Laminas\\Filter component", - "laminas/laminas-i18n": "Laminas\\I18n component", - "laminas/laminas-json": "Laminas\\Json to use the Json reader or writer classes", - "laminas/laminas-servicemanager": "Laminas\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" + "laminas/laminas-filter": "^2.7.2; install if you want to use the Filter processor", + "laminas/laminas-i18n": "^2.7.4; install if you want to use the Translator processor", + "laminas/laminas-servicemanager": "^2.7.8 || ^3.3; if you need an extensible plugin manager for use with the Config Factory" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev", - "dev-develop": "2.7-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Config\\": "src/" @@ -1240,103 +1408,47 @@ "config", "laminas" ], - "time": "2019-12-31T16:30:04+00:00" - }, - { - "name": "laminas/laminas-console", - "version": "2.8.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-console.git", - "reference": "478a6ceac3e31fb38d6314088abda8b239ee23a5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-console/zipball/478a6ceac3e31fb38d6314088abda8b239ee23a5", - "reference": "478a6ceac3e31fb38d6314088abda8b239ee23a5", - "shasum": "" - }, - "require": { - "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" - }, - "replace": { - "zendframework/zend-console": "self.version" - }, - "require-dev": { - "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-filter": "^2.7.2", - "laminas/laminas-json": "^2.6 || ^3.0", - "laminas/laminas-validator": "^2.10.1", - "phpunit/phpunit": "^5.7.23 || ^6.4.3" - }, - "suggest": { - "laminas/laminas-filter": "To support DefaultRouteMatcher usage", - "laminas/laminas-validator": "To support DefaultRouteMatcher usage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8.x-dev", - "dev-develop": "2.9.x-dev" - } - }, - "autoload": { - "psr-4": { - "Laminas\\Console\\": "src/" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Build console applications using getopt syntax or routing, complete with prompts", - "homepage": "https://laminas.dev", - "keywords": [ - "console", - "laminas" ], - "time": "2019-12-31T16:31:45+00:00" + "time": "2021-02-11T15:06:51+00:00" }, { "name": "laminas/laminas-crypt", - "version": "2.6.0", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-crypt.git", - "reference": "6f291fe90c84c74d737c9dc9b8f0ad2b55dc0567" + "reference": "a058eeb2fe57824b958ac56753faff790a649e18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-crypt/zipball/6f291fe90c84c74d737c9dc9b8f0ad2b55dc0567", - "reference": "6f291fe90c84c74d737c9dc9b8f0ad2b55dc0567", + "url": "https://api.github.com/repos/laminas/laminas-crypt/zipball/a058eeb2fe57824b958ac56753faff790a649e18", + "reference": "a058eeb2fe57824b958ac56753faff790a649e18", "shasum": "" }, "require": { - "container-interop/container-interop": "~1.0", - "laminas/laminas-math": "^2.6", - "laminas/laminas-stdlib": "^2.7 || ^3.0", + "container-interop/container-interop": "^1.2", + "ext-mbstring": "*", + "laminas/laminas-math": "^3.0", + "laminas/laminas-stdlib": "^2.7.7 || ^3.1", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.5 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-crypt": "self.version" + "zendframework/zend-crypt": "^3.3.1" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" + "laminas/laminas-coding-standard": "~1.0.0", + "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-mcrypt": "Required for most features of Laminas\\Crypt" + "ext-openssl": "Required for most features of Laminas\\Crypt" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev", - "dev-develop": "2.7-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Crypt\\": "src/" @@ -1346,53 +1458,57 @@ "license": [ "BSD-3-Clause" ], + "description": "Strong cryptography tools and password hashing", "homepage": "https://laminas.dev", "keywords": [ "crypt", "laminas" ], - "time": "2019-12-31T16:33:11+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-02-11T19:40:03+00:00" }, { "name": "laminas/laminas-db", - "version": "2.11.3", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-db.git", - "reference": "6c4238918b9204db1eb8cafae2c1940d40f4c007" + "reference": "80cbba4e749f9eb7d8036172acb9ad41e8b6923f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-db/zipball/6c4238918b9204db1eb8cafae2c1940d40f4c007", - "reference": "6c4238918b9204db1eb8cafae2c1940d40f4c007", + "url": "https://api.github.com/repos/laminas/laminas-db/zipball/80cbba4e749f9eb7d8036172acb9ad41e8b6923f", + "reference": "80cbba4e749f9eb7d8036172acb9ad41e8b6923f", "shasum": "" }, "require": { - "laminas/laminas-stdlib": "^2.7 || ^3.0", + "laminas/laminas-stdlib": "^3.3", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { "zendframework/zend-db": "^2.11.0" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-eventmanager": "^2.6.2 || ^3.0", - "laminas/laminas-hydrator": "^1.1 || ^2.1 || ^3.0", - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3", - "phpunit/phpunit": "^5.7.27 || ^6.5.14" + "laminas/laminas-eventmanager": "^3.3", + "laminas/laminas-hydrator": "^3.2 || ^4.0", + "laminas/laminas-servicemanager": "^3.3", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.3" }, "suggest": { "laminas/laminas-eventmanager": "Laminas\\EventManager component", - "laminas/laminas-hydrator": "Laminas\\Hydrator component for using HydratingResultSets", + "laminas/laminas-hydrator": "(^3.2 || ^4.0) Laminas\\Hydrator component for using HydratingResultSets", "laminas/laminas-servicemanager": "Laminas\\ServiceManager component" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.11.x-dev", - "dev-develop": "2.12.x-dev" - }, "laminas": { "component": "Laminas\\Db", "config-provider": "Laminas\\Db\\ConfigProvider" @@ -1413,41 +1529,40 @@ "db", "laminas" ], - "time": "2020-03-29T12:08:51+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-02-22T22:27:56+00:00" }, { "name": "laminas/laminas-dependency-plugin", - "version": "1.0.4", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/laminas/laminas-dependency-plugin.git", - "reference": "38bf91861f5b4d49f9a1c530327c997f7a7fb2db" + "reference": "c5b4bf87729d6f38c73ca8ed22a5d62ec641d075" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-dependency-plugin/zipball/38bf91861f5b4d49f9a1c530327c997f7a7fb2db", - "reference": "38bf91861f5b4d49f9a1c530327c997f7a7fb2db", + "url": "https://api.github.com/repos/laminas/laminas-dependency-plugin/zipball/c5b4bf87729d6f38c73ca8ed22a5d62ec641d075", + "reference": "c5b4bf87729d6f38c73ca8ed22a5d62ec641d075", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1", - "php": "^5.6 || ^7.0" + "composer-plugin-api": "^1.1 || ^2.0", + "php": "^7.3 || ~8.0.0" }, "require-dev": { - "composer/composer": "^1.9", - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", - "phpcompatibility/php-compatibility": "^9.3", - "phpunit/phpunit": "^8.4", - "roave/security-advisories": "dev-master", - "webimpress/coding-standard": "^1.0" + "composer/composer": "^1.9 || ^2.0", + "mikey179/vfsstream": "^1.6", + "roave/security-advisories": "dev-master" }, "type": "composer-plugin", "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev", - "dev-develop": "1.1.x-dev" - }, - "class": "Laminas\\DependencyPlugin\\DependencyRewriterPlugin" + "class": "Laminas\\DependencyPlugin\\DependencyRewriterPluginDelegator" }, "autoload": { "psr-4": { @@ -1459,41 +1574,59 @@ "BSD-3-Clause" ], "description": "Replace zendframework and zfcampus packages with their Laminas Project equivalents.", - "time": "2020-05-20T13:45:39+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-02-15T16:44:31+00:00" }, { "name": "laminas/laminas-di", - "version": "2.6.1", + "version": "3.2.2", "source": { "type": "git", "url": "https://github.com/laminas/laminas-di.git", - "reference": "239b22408a1f8eacda6fc2b838b5065c4cf1d88e" + "reference": "ed38ab3b066c0a1f1b087e0a664caadf1d4f8f04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-di/zipball/239b22408a1f8eacda6fc2b838b5065c4cf1d88e", - "reference": "239b22408a1f8eacda6fc2b838b5065c4cf1d88e", + "url": "https://api.github.com/repos/laminas/laminas-di/zipball/ed38ab3b066c0a1f1b087e0a664caadf1d4f8f04", + "reference": "ed38ab3b066c0a1f1b087e0a664caadf1d4f8f04", "shasum": "" }, "require": { - "container-interop/container-interop": "^1.1", - "laminas/laminas-code": "^2.6 || ^3.0", - "laminas/laminas-stdlib": "^2.7 || ^3.0", + "laminas/laminas-stdlib": "^3.3", "laminas/laminas-zendframework-bridge": "^0.4.5 || ^1.0", - "php": "^5.5 || ^7.0" + "php": "^7.3 || ~8.0.0", + "psr/container": "^1.0", + "psr/log": "^1.0" + }, + "conflict": { + "laminas/laminas-servicemanager-di": "*", + "phpspec/prophecy": "<1.9.0" }, "replace": { - "zendframework/zend-di": "self.version" + "zendframework/zend-di": "^3.1.2" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" + "container-interop/container-interop": "^1.2.0", + "laminas/laminas-coding-standard": "^2", + "laminas/laminas-servicemanager": "^3.4", + "mikey179/vfsstream": "^1.6.7", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/phpstan": "^0.12.64", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "laminas/laminas-servicemanager": "An IoC container without auto wiring capabilities" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.6-dev", - "dev-develop": "2.7-dev" + "laminas": { + "component": "Laminas\\Di", + "config-provider": "Laminas\\Di\\ConfigProvider" } }, "autoload": { @@ -1505,120 +1638,53 @@ "license": [ "BSD-3-Clause" ], + "description": "Automated dependency injection for PSR-11 containers", "homepage": "https://laminas.dev", "keywords": [ + "PSR-11", "di", "laminas" ], - "time": "2019-12-31T15:17:33+00:00" - }, - { - "name": "laminas/laminas-diactoros", - "version": "1.8.7p2", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "6991c1af7c8d2c8efee81b22ba97024781824aaa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/6991c1af7c8d2c8efee81b22ba97024781824aaa", - "reference": "6991c1af7c8d2c8efee81b22ba97024781824aaa", - "shasum": "" - }, - "require": { - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0", - "psr/http-message": "^1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "replace": { - "zendframework/zend-diactoros": "~1.8.7.0" - }, - "require-dev": { - "ext-dom": "*", - "ext-libxml": "*", - "laminas/laminas-coding-standard": "~1.0", - "php-http/psr7-integration-tests": "dev-master", - "phpunit/phpunit": "^5.7.16 || ^6.0.8 || ^7.2.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-release-1.8": "1.8.x-dev" - } - }, - "autoload": { - "files": [ - "src/functions/create_uploaded_file.php", - "src/functions/marshal_headers_from_sapi.php", - "src/functions/marshal_method_from_sapi.php", - "src/functions/marshal_protocol_version_from_sapi.php", - "src/functions/marshal_uri_from_sapi.php", - "src/functions/normalize_server.php", - "src/functions/normalize_uploaded_files.php", - "src/functions/parse_cookie_header.php", - "src/functions/create_uploaded_file.legacy.php", - "src/functions/marshal_headers_from_sapi.legacy.php", - "src/functions/marshal_method_from_sapi.legacy.php", - "src/functions/marshal_protocol_version_from_sapi.legacy.php", - "src/functions/marshal_uri_from_sapi.legacy.php", - "src/functions/normalize_server.legacy.php", - "src/functions/normalize_uploaded_files.legacy.php", - "src/functions/parse_cookie_header.legacy.php" - ], - "psr-4": { - "Laminas\\Diactoros\\": "src/" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "PSR HTTP Message implementations", - "homepage": "https://laminas.dev", - "keywords": [ - "http", - "laminas", - "psr", - "psr-7" ], - "time": "2020-03-23T15:28:28+00:00" + "time": "2021-04-13T19:22:31+00:00" }, { "name": "laminas/laminas-escaper", - "version": "2.6.1", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "25f2a053eadfa92ddacb609dcbbc39362610da70" + "reference": "5e04bc5ae5990b17159d79d331055e2c645e5cc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/25f2a053eadfa92ddacb609dcbbc39362610da70", - "reference": "25f2a053eadfa92ddacb609dcbbc39362610da70", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/5e04bc5ae5990b17159d79d331055e2c645e5cc5", + "reference": "5e04bc5ae5990b17159d79d331055e2c645e5cc5", "shasum": "" }, "require": { "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-escaper": "self.version" + "zendframework/zend-escaper": "^2.6.1" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2" + "phpunit/phpunit": "^9.3", + "psalm/plugin-phpunit": "^0.12.2", + "vimeo/psalm": "^3.16" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6.x-dev", - "dev-develop": "2.7.x-dev" - } + "suggest": { + "ext-iconv": "*", + "ext-mbstring": "*" }, + "type": "library", "autoload": { "psr-4": { "Laminas\\Escaper\\": "src/" @@ -1634,20 +1700,26 @@ "escaper", "laminas" ], - "time": "2019-12-31T16:43:30+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2020-11-17T21:26:43+00:00" }, { "name": "laminas/laminas-eventmanager", - "version": "3.3.0", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-eventmanager.git", - "reference": "1940ccf30e058b2fd66f5a9d696f1b5e0027b082" + "reference": "966c859b67867b179fde1eff0cd38df51472ce4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-eventmanager/zipball/1940ccf30e058b2fd66f5a9d696f1b5e0027b082", - "reference": "1940ccf30e058b2fd66f5a9d696f1b5e0027b082", + "url": "https://api.github.com/repos/laminas/laminas-eventmanager/zipball/966c859b67867b179fde1eff0cd38df51472ce4a", + "reference": "966c859b67867b179fde1eff0cd38df51472ce4a", "shasum": "" }, "require": { @@ -1669,12 +1741,6 @@ "laminas/laminas-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3.x-dev", - "dev-develop": "3.4.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\EventManager\\": "src/" @@ -1698,20 +1764,20 @@ "type": "community_bridge" } ], - "time": "2020-08-25T11:10:44+00:00" + "time": "2021-03-08T15:24:29+00:00" }, { "name": "laminas/laminas-feed", - "version": "2.12.3", + "version": "2.14.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-feed.git", - "reference": "3c91415633cb1be6f9d78683d69b7dcbfe6b4012" + "reference": "463fdae515fba30633906098c258d3b2c733c15c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-feed/zipball/3c91415633cb1be6f9d78683d69b7dcbfe6b4012", - "reference": "3c91415633cb1be6f9d78683d69b7dcbfe6b4012", + "url": "https://api.github.com/repos/laminas/laminas-feed/zipball/463fdae515fba30633906098c258d3b2c733c15c", + "reference": "463fdae515fba30633906098c258d3b2c733c15c", "shasum": "" }, "require": { @@ -1720,7 +1786,10 @@ "laminas/laminas-escaper": "^2.5.2", "laminas/laminas-stdlib": "^3.2.1", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" + }, + "conflict": { + "laminas/laminas-servicemanager": "<3.3" }, "replace": { "zendframework/zend-feed": "^2.12.0" @@ -1730,10 +1799,12 @@ "laminas/laminas-coding-standard": "~1.0.0", "laminas/laminas-db": "^2.8.2", "laminas/laminas-http": "^2.7", - "laminas/laminas-servicemanager": "^2.7.8 || ^3.3", + "laminas/laminas-servicemanager": "^3.3", "laminas/laminas-validator": "^2.10.1", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20", - "psr/http-message": "^1.0.1" + "phpunit/phpunit": "^9.3", + "psalm/plugin-phpunit": "^0.13.0", + "psr/http-message": "^1.0.1", + "vimeo/psalm": "^4.1" }, "suggest": { "laminas/laminas-cache": "Laminas\\Cache component, for optionally caching feeds between requests", @@ -1744,12 +1815,6 @@ "psr/http-message": "PSR-7 ^1.0.1, if you wish to use Laminas\\Feed\\Reader\\Http\\Psr7ResponseDecorator" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.12.x-dev", - "dev-develop": "2.13.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Feed\\": "src/" @@ -1771,26 +1836,26 @@ "type": "community_bridge" } ], - "time": "2020-08-18T13:45:04+00:00" + "time": "2021-04-01T19:26:09+00:00" }, { "name": "laminas/laminas-filter", - "version": "2.9.4", + "version": "2.11.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-filter.git", - "reference": "3c4476e772a062cef7531c6793377ae585d89c82" + "reference": "dd295a15f5c13d0c13d69ca0107190b1f2083d91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-filter/zipball/3c4476e772a062cef7531c6793377ae585d89c82", - "reference": "3c4476e772a062cef7531c6793377ae585d89c82", + "url": "https://api.github.com/repos/laminas/laminas-filter/zipball/dd295a15f5c13d0c13d69ca0107190b1f2083d91", + "reference": "dd295a15f5c13d0c13d69ca0107190b1f2083d91", "shasum": "" }, "require": { - "laminas/laminas-stdlib": "^2.7.7 || ^3.1", + "laminas/laminas-stdlib": "^3.3", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "conflict": { "laminas/laminas-validator": "<2.10.1" @@ -1801,11 +1866,14 @@ "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", "laminas/laminas-crypt": "^3.2.1", - "laminas/laminas-servicemanager": "^2.7.8 || ^3.3", + "laminas/laminas-servicemanager": "^3.3", "laminas/laminas-uri": "^2.6", "pear/archive_tar": "^1.4.3", - "phpunit/phpunit": "^5.7.23 || ^6.4.3", - "psr/http-factory": "^1.0" + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.3", + "psalm/plugin-phpunit": "^0.15.1", + "psr/http-factory": "^1.0", + "vimeo/psalm": "^4.6" }, "suggest": { "laminas/laminas-crypt": "Laminas\\Crypt component, for encryption filters", @@ -1816,10 +1884,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.9.x-dev", - "dev-develop": "2.10.x-dev" - }, "laminas": { "component": "Laminas\\Filter", "config-provider": "Laminas\\Filter\\ConfigProvider" @@ -1840,108 +1904,26 @@ "filter", "laminas" ], - "time": "2020-03-29T12:41:29+00:00" - }, - { - "name": "laminas/laminas-form", - "version": "2.15.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-form.git", - "reference": "359cd372c565e18a17f32ccfeacdf21bba091ce2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-form/zipball/359cd372c565e18a17f32ccfeacdf21bba091ce2", - "reference": "359cd372c565e18a17f32ccfeacdf21bba091ce2", - "shasum": "" - }, - "require": { - "laminas/laminas-hydrator": "^1.1 || ^2.1 || ^3.0", - "laminas/laminas-inputfilter": "^2.8", - "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" - }, - "replace": { - "zendframework/zend-form": "^2.14.3" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "laminas/laminas-cache": "^2.6.1", - "laminas/laminas-captcha": "^2.7.1", - "laminas/laminas-code": "^2.6 || ^3.0", - "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-escaper": "^2.5", - "laminas/laminas-eventmanager": "^2.6.2 || ^3.0", - "laminas/laminas-filter": "^2.6", - "laminas/laminas-i18n": "^2.6", - "laminas/laminas-recaptcha": "^3.0.0", - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3", - "laminas/laminas-session": "^2.8.1", - "laminas/laminas-text": "^2.6", - "laminas/laminas-validator": "^2.6", - "laminas/laminas-view": "^2.6.2", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20" - }, - "suggest": { - "laminas/laminas-captcha": "^2.7.1, required for using CAPTCHA form elements", - "laminas/laminas-code": "^2.6 || ^3.0, required to use laminas-form annotations support", - "laminas/laminas-eventmanager": "^2.6.2 || ^3.0, reuired for laminas-form annotations support", - "laminas/laminas-i18n": "^2.6, required when using laminas-form view helpers", - "laminas/laminas-recaptcha": "in order to use the ReCaptcha form element", - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3, required to use the form factories or provide services", - "laminas/laminas-view": "^2.6.2, required for using the laminas-form view helpers" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.15.x-dev", - "dev-develop": "2.16.x-dev" - }, - "laminas": { - "component": "Laminas\\Form", - "config-provider": "Laminas\\Form\\ConfigProvider" - } - }, - "autoload": { - "psr-4": { - "Laminas\\Form\\": "src/" - }, - "files": [ - "autoload/formElementManagerPolyfill.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Validate and display simple and complex forms, casting forms to business objects and vice versa", - "homepage": "https://laminas.dev", - "keywords": [ - "form", - "laminas" - ], "funding": [ { "url": "https://funding.communitybridge.org/projects/laminas-project", "type": "community_bridge" } ], - "time": "2020-07-14T13:53:27+00:00" + "time": "2021-03-16T14:37:02+00:00" }, { "name": "laminas/laminas-http", - "version": "2.13.0", + "version": "2.14.3", "source": { "type": "git", "url": "https://github.com/laminas/laminas-http.git", - "reference": "33b7942f51ce905ce9bfc8bf28badc501d3904b5" + "reference": "bfaab8093e382274efed7fdc3ceb15f09ba352bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-http/zipball/33b7942f51ce905ce9bfc8bf28badc501d3904b5", - "reference": "33b7942f51ce905ce9bfc8bf28badc501d3904b5", + "url": "https://api.github.com/repos/laminas/laminas-http/zipball/bfaab8093e382274efed7fdc3ceb15f09ba352bb", + "reference": "bfaab8093e382274efed7fdc3ceb15f09ba352bb", "shasum": "" }, "require": { @@ -1950,7 +1932,7 @@ "laminas/laminas-uri": "^2.5.2", "laminas/laminas-validator": "^2.10.1", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { "zendframework/zend-http": "^2.11.2" @@ -1958,7 +1940,7 @@ "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", "laminas/laminas-config": "^3.1 || ^2.6", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.3" + "phpunit/phpunit": "^9.3" }, "suggest": { "paragonie/certainty": "For automated management of cacert.pem" @@ -1986,84 +1968,20 @@ "type": "community_bridge" } ], - "time": "2020-08-18T17:11:58+00:00" - }, - { - "name": "laminas/laminas-hydrator", - "version": "2.4.2", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-hydrator.git", - "reference": "4a0e81cf05f32edcace817f1f48cb4055f689d85" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-hydrator/zipball/4a0e81cf05f32edcace817f1f48cb4055f689d85", - "reference": "4a0e81cf05f32edcace817f1f48cb4055f689d85", - "shasum": "" - }, - "require": { - "laminas/laminas-stdlib": "^3.0", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" - }, - "replace": { - "zendframework/zend-hydrator": "self.version" - }, - "require-dev": { - "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-eventmanager": "^2.6.2 || ^3.0", - "laminas/laminas-filter": "^2.6", - "laminas/laminas-inputfilter": "^2.6", - "laminas/laminas-serializer": "^2.6.1", - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2" - }, - "suggest": { - "laminas/laminas-eventmanager": "^2.6.2 || ^3.0, to support aggregate hydrator usage", - "laminas/laminas-filter": "^2.6, to support naming strategy hydrator usage", - "laminas/laminas-serializer": "^2.6.1, to use the SerializableStrategy", - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3, to support hydrator plugin manager usage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-release-2.4": "2.4.x-dev" - }, - "laminas": { - "component": "Laminas\\Hydrator", - "config-provider": "Laminas\\Hydrator\\ConfigProvider" - } - }, - "autoload": { - "psr-4": { - "Laminas\\Hydrator\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Serialize objects to arrays, and vice versa", - "homepage": "https://laminas.dev", - "keywords": [ - "hydrator", - "laminas" - ], - "time": "2019-12-31T17:06:38+00:00" + "time": "2021-02-18T21:58:11+00:00" }, { "name": "laminas/laminas-i18n", - "version": "2.11.0", + "version": "2.11.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-i18n.git", - "reference": "85678f444b6dcb48e8a04591779e11c24e5bb901" + "reference": "5e85a8facc5534e856cc7f5b4326533eede84b8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-i18n/zipball/85678f444b6dcb48e8a04591779e11c24e5bb901", - "reference": "85678f444b6dcb48e8a04591779e11c24e5bb901", + "url": "https://api.github.com/repos/laminas/laminas-i18n/zipball/5e85a8facc5534e856cc7f5b4326533eede84b8a", + "reference": "5e85a8facc5534e856cc7f5b4326533eede84b8a", "shasum": "" }, "require": { @@ -2127,273 +2045,134 @@ "type": "community_bridge" } ], - "time": "2020-10-24T13:14:32+00:00" + "time": "2021-04-07T21:10:50+00:00" }, { - "name": "laminas/laminas-inputfilter", - "version": "2.10.1", + "name": "laminas/laminas-json", + "version": "3.2.0", "source": { "type": "git", - "url": "git@github.com:laminas/laminas-inputfilter.git", - "reference": "b29ce8f512c966468eee37ea4873ae5fb545d00a" + "url": "https://github.com/laminas/laminas-json.git", + "reference": "1e3b64d3b21dac0511e628ae8debc81002d14e3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-inputfilter/zipball/b29ce8f512c966468eee37ea4873ae5fb545d00a", - "reference": "b29ce8f512c966468eee37ea4873ae5fb545d00a", + "url": "https://api.github.com/repos/laminas/laminas-json/zipball/1e3b64d3b21dac0511e628ae8debc81002d14e3c", + "reference": "1e3b64d3b21dac0511e628ae8debc81002d14e3c", "shasum": "" }, "require": { - "laminas/laminas-filter": "^2.9.1", - "laminas/laminas-servicemanager": "^2.7.10 || ^3.3.1", - "laminas/laminas-stdlib": "^2.7 || ^3.0", - "laminas/laminas-validator": "^2.11", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-inputfilter": "self.version" + "zendframework/zend-json": "^3.1.2" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.15", - "psr/http-message": "^1.0" + "laminas/laminas-stdlib": "^2.7.7 || ^3.1", + "phpunit/phpunit": "^9.3" }, "suggest": { - "psr/http-message-implementation": "PSR-7 is required if you wish to validate PSR-7 UploadedFileInterface payloads" + "laminas/laminas-json-server": "For implementing JSON-RPC servers", + "laminas/laminas-xml2json": "For converting XML documents to JSON" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.10.x-dev", - "dev-develop": "2.11.x-dev" - }, - "laminas": { - "component": "Laminas\\InputFilter", - "config-provider": "Laminas\\InputFilter\\ConfigProvider" - } - }, "autoload": { "psr-4": { - "Laminas\\InputFilter\\": "src/" + "Laminas\\Json\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "Normalize and validate input sets from the web, APIs, the CLI, and more, including files", + "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", "homepage": "https://laminas.dev", "keywords": [ - "inputfilter", + "json", "laminas" ], - "time": "2019-12-31T17:11:54+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-02-12T15:38:10+00:00" }, { - "name": "laminas/laminas-json", - "version": "2.6.1", + "name": "laminas/laminas-loader", + "version": "2.7.0", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-json.git", - "reference": "db58425b7f0eba44a7539450cc926af80915951a" + "url": "https://github.com/laminas/laminas-loader.git", + "reference": "bcf8a566cb9925a2e7cc41a16db09235ec9fb616" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-json/zipball/db58425b7f0eba44a7539450cc926af80915951a", - "reference": "db58425b7f0eba44a7539450cc926af80915951a", + "url": "https://api.github.com/repos/laminas/laminas-loader/zipball/bcf8a566cb9925a2e7cc41a16db09235ec9fb616", + "reference": "bcf8a566cb9925a2e7cc41a16db09235ec9fb616", "shasum": "" }, "require": { "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.5 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-json": "self.version" + "zendframework/zend-loader": "^2.6.1" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "laminas/laminas-http": "^2.5.4", - "laminas/laminas-server": "^2.6.1", - "laminas/laminas-stdlib": "^2.5 || ^3.0", - "laminas/laminas-xml": "^1.0.2", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "laminas/laminas-http": "Laminas\\Http component, required to use Laminas\\Json\\Server", - "laminas/laminas-server": "Laminas\\Server component, required to use Laminas\\Json\\Server", - "laminas/laminas-stdlib": "Laminas\\Stdlib component, for use with caching Laminas\\Json\\Server responses", - "laminas/laminas-xml": "To support Laminas\\Json\\Json::fromXml() usage" + "laminas/laminas-coding-standard": "~1.0.0", + "phpunit/phpunit": "^9.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev", - "dev-develop": "2.7-dev" - } - }, "autoload": { "psr-4": { - "Laminas\\Json\\": "src/" + "Laminas\\Loader\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", + "description": "Autoloading and plugin loading strategies", "homepage": "https://laminas.dev", "keywords": [ - "json", - "laminas" + "laminas", + "loader" ], - "time": "2019-12-31T17:15:00+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-02-12T16:08:18+00:00" }, { - "name": "laminas/laminas-loader", - "version": "2.6.1", + "name": "laminas/laminas-mail", + "version": "2.14.0", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-loader.git", - "reference": "5d01c2c237ae9e68bec262f339947e2ea18979bc" + "url": "https://github.com/laminas/laminas-mail.git", + "reference": "542686aebf480c6902ad7f08b52498e94818bc0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-loader/zipball/5d01c2c237ae9e68bec262f339947e2ea18979bc", - "reference": "5d01c2c237ae9e68bec262f339947e2ea18979bc", + "url": "https://api.github.com/repos/laminas/laminas-mail/zipball/542686aebf480c6902ad7f08b52498e94818bc0a", + "reference": "542686aebf480c6902ad7f08b52498e94818bc0a", "shasum": "" }, "require": { + "ext-iconv": "*", + "laminas/laminas-loader": "^2.5", + "laminas/laminas-mime": "^2.5", + "laminas/laminas-stdlib": "^2.7 || ^3.0", + "laminas/laminas-validator": "^2.10.2", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" - }, - "replace": { - "zendframework/zend-loader": "self.version" - }, - "require-dev": { - "laminas/laminas-coding-standard": "~1.0.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6.x-dev", - "dev-develop": "2.7.x-dev" - } - }, - "autoload": { - "psr-4": { - "Laminas\\Loader\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Autoloading and plugin loading strategies", - "homepage": "https://laminas.dev", - "keywords": [ - "laminas", - "loader" - ], - "time": "2019-12-31T17:18:27+00:00" - }, - { - "name": "laminas/laminas-log", - "version": "2.12.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-log.git", - "reference": "4e92d841b48868714a070b10866e94be80fc92ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-log/zipball/4e92d841b48868714a070b10866e94be80fc92ff", - "reference": "4e92d841b48868714a070b10866e94be80fc92ff", - "shasum": "" - }, - "require": { - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3", - "laminas/laminas-stdlib": "^2.7 || ^3.0", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0", - "psr/log": "^1.1.2" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "replace": { - "zendframework/zend-log": "self.version" - }, - "require-dev": { - "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-db": "^2.6", - "laminas/laminas-escaper": "^2.5", - "laminas/laminas-filter": "^2.5", - "laminas/laminas-mail": "^2.6.1", - "laminas/laminas-validator": "^2.10.1", - "mikey179/vfsstream": "^1.6.7", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.15" - }, - "suggest": { - "ext-mongo": "mongo extension to use Mongo writer", - "ext-mongodb": "mongodb extension to use MongoDB writer", - "laminas/laminas-db": "Laminas\\Db component to use the database log writer", - "laminas/laminas-escaper": "Laminas\\Escaper component, for use in the XML log formatter", - "laminas/laminas-mail": "Laminas\\Mail component to use the email log writer", - "laminas/laminas-validator": "Laminas\\Validator component to block invalid log messages" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.12.x-dev", - "dev-develop": "2.13.x-dev" - }, - "laminas": { - "component": "Laminas\\Log", - "config-provider": "Laminas\\Log\\ConfigProvider" - } - }, - "autoload": { - "psr-4": { - "Laminas\\Log\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Robust, composite logger with filtering, formatting, and PSR-3 support", - "homepage": "https://laminas.dev", - "keywords": [ - "laminas", - "log", - "logging" - ], - "time": "2019-12-31T17:18:59+00:00" - }, - { - "name": "laminas/laminas-mail", - "version": "2.12.3", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-mail.git", - "reference": "c154a733b122539ac2c894561996c770db289f70" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-mail/zipball/c154a733b122539ac2c894561996c770db289f70", - "reference": "c154a733b122539ac2c894561996c770db289f70", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "laminas/laminas-loader": "^2.5", - "laminas/laminas-mime": "^2.5", - "laminas/laminas-stdlib": "^2.7 || ^3.0", - "laminas/laminas-validator": "^2.10.2", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.1", + "php": "^7.3 || ~8.0.0", + "symfony/polyfill-mbstring": "^1.12.0", "true/punycode": "^2.1" }, "replace": { @@ -2401,10 +2180,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-config": "^2.6", + "laminas/laminas-config": "^3.4", "laminas/laminas-crypt": "^2.6 || ^3.0", "laminas/laminas-servicemanager": "^3.2.1", - "phpunit/phpunit": "^7.5.20" + "phpunit/phpunit": "^9.3" }, "suggest": { "laminas/laminas-crypt": "Crammd5 support in SMTP Auth", @@ -2438,44 +2217,43 @@ "type": "community_bridge" } ], - "time": "2020-08-12T14:51:33+00:00" + "time": "2021-03-17T12:41:50+00:00" }, { "name": "laminas/laminas-math", - "version": "2.7.1", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/laminas/laminas-math.git", - "reference": "8027b37e00accc43f28605c7d8fd081baed1f475" + "reference": "188456530923a449470963837c25560f1fdd8a60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-math/zipball/8027b37e00accc43f28605c7d8fd081baed1f475", - "reference": "8027b37e00accc43f28605c7d8fd081baed1f475", + "url": "https://api.github.com/repos/laminas/laminas-math/zipball/188456530923a449470963837c25560f1fdd8a60", + "reference": "188456530923a449470963837c25560f1fdd8a60", "shasum": "" }, "require": { + "ext-mbstring": "*", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.5 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-math": "self.version" + "zendframework/zend-math": "^3.2.0" }, "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "ircmaxell/random-lib": "~1.1", - "phpunit/phpunit": "~4.0" + "laminas/laminas-coding-standard": "~1.0.0", + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-bcmath": "If using the bcmath functionality", - "ext-gmp": "If using the gmp functionality", - "ircmaxell/random-lib": "Fallback random byte generator for Laminas\\Math\\Rand if Mcrypt extensions is unavailable" + "ext-gmp": "If using the gmp functionality" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "2.8-dev" + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" } }, "autoload": { @@ -2487,31 +2265,38 @@ "license": [ "BSD-3-Clause" ], + "description": "Create cryptographically secure pseudo-random numbers, and manage big integers", "homepage": "https://laminas.dev", "keywords": [ "laminas", "math" ], - "time": "2019-12-31T17:24:15+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-02-16T15:46:01+00:00" }, { "name": "laminas/laminas-mime", - "version": "2.7.4", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-mime.git", - "reference": "e45a7d856bf7b4a7b5bd00d6371f9961dc233add" + "reference": "9a59704f33106427a384d0ae421f96043174093a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-mime/zipball/e45a7d856bf7b4a7b5bd00d6371f9961dc233add", - "reference": "e45a7d856bf7b4a7b5bd00d6371f9961dc233add", + "url": "https://api.github.com/repos/laminas/laminas-mime/zipball/9a59704f33106427a384d0ae421f96043174093a", + "reference": "9a59704f33106427a384d0ae421f96043174093a", "shasum": "" }, "require": { "laminas/laminas-stdlib": "^2.7 || ^3.0", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { "zendframework/zend-mime": "^2.7.2" @@ -2519,18 +2304,12 @@ "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", "laminas/laminas-mail": "^2.6", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20" + "phpunit/phpunit": "^9.3" }, "suggest": { "laminas/laminas-mail": "Laminas\\Mail component" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7.x-dev", - "dev-develop": "2.8.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Mime\\": "src/" @@ -2546,28 +2325,35 @@ "laminas", "mime" ], - "time": "2020-03-29T13:12:07+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-02-16T17:40:06+00:00" }, { "name": "laminas/laminas-modulemanager", - "version": "2.9.0", + "version": "2.10.2", "source": { "type": "git", "url": "https://github.com/laminas/laminas-modulemanager.git", - "reference": "789bbd4ab391da9221f265f6bb2d594f8f11855b" + "reference": "2068e0b300e87e139112016a6025be341ceaaf33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-modulemanager/zipball/789bbd4ab391da9221f265f6bb2d594f8f11855b", - "reference": "789bbd4ab391da9221f265f6bb2d594f8f11855b", + "url": "https://api.github.com/repos/laminas/laminas-modulemanager/zipball/2068e0b300e87e139112016a6025be341ceaaf33", + "reference": "2068e0b300e87e139112016a6025be341ceaaf33", "shasum": "" }, "require": { - "laminas/laminas-config": "^3.1 || ^2.6", - "laminas/laminas-eventmanager": "^3.2 || ^2.6.3", - "laminas/laminas-stdlib": "^3.1 || ^2.7", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0", + "brick/varexporter": "^0.3.2", + "laminas/laminas-config": "^3.4", + "laminas/laminas-eventmanager": "^3.3", + "laminas/laminas-stdlib": "^3.3", + "laminas/laminas-zendframework-bridge": "^1.1", + "php": "^7.3 || ^8.0", "webimpress/safe-writer": "^1.0.2 || ^2.1" }, "replace": { @@ -2575,12 +2361,12 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-console": "^2.6", - "laminas/laminas-di": "^2.6", - "laminas/laminas-loader": "^2.5", - "laminas/laminas-mvc": "^3.0 || ^2.7", - "laminas/laminas-servicemanager": "^3.0.3 || ^2.7.5", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.16" + "laminas/laminas-console": "^2.8", + "laminas/laminas-di": "^2.6.1", + "laminas/laminas-loader": "^2.6.1", + "laminas/laminas-mvc": "^3.1.1", + "laminas/laminas-servicemanager": "^3.4.1", + "phpunit/phpunit": "^9.3.7" }, "suggest": { "laminas/laminas-console": "Laminas\\Console component", @@ -2589,12 +2375,6 @@ "laminas/laminas-servicemanager": "Laminas\\ServiceManager component" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.9.x-dev", - "dev-develop": "2.10.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\ModuleManager\\": "src/" @@ -2616,89 +2396,61 @@ "type": "community_bridge" } ], - "time": "2020-08-25T09:29:22+00:00" + "time": "2021-04-13T20:11:28+00:00" }, { "name": "laminas/laminas-mvc", - "version": "2.7.15", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-mvc.git", - "reference": "7e7198b03556a57fb5fd3ed919d9e1cf71500642" + "reference": "88da7200cf8f5a970c35d91717a5c4db94981e5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-mvc/zipball/7e7198b03556a57fb5fd3ed919d9e1cf71500642", - "reference": "7e7198b03556a57fb5fd3ed919d9e1cf71500642", + "url": "https://api.github.com/repos/laminas/laminas-mvc/zipball/88da7200cf8f5a970c35d91717a5c4db94981e5e", + "reference": "88da7200cf8f5a970c35d91717a5c4db94981e5e", "shasum": "" }, "require": { - "container-interop/container-interop": "^1.1", - "laminas/laminas-console": "^2.7", - "laminas/laminas-eventmanager": "^2.6.4 || ^3.0", - "laminas/laminas-form": "^2.11", - "laminas/laminas-hydrator": "^1.1 || ^2.4", - "laminas/laminas-psr7bridge": "^0.2", - "laminas/laminas-servicemanager": "^2.7.10 || ^3.0.3", - "laminas/laminas-stdlib": "^2.7.5 || ^3.0", + "container-interop/container-interop": "^1.2", + "laminas/laminas-eventmanager": "^3.2", + "laminas/laminas-http": "^2.7", + "laminas/laminas-modulemanager": "^2.8", + "laminas/laminas-router": "^3.0.2", + "laminas/laminas-servicemanager": "^3.3", + "laminas/laminas-stdlib": "^3.2.1", + "laminas/laminas-view": "^2.11.3", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.5 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-mvc": "self.version" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "1.7.*", - "laminas/laminas-authentication": "^2.6", - "laminas/laminas-cache": "^2.8", - "laminas/laminas-di": "^2.6", - "laminas/laminas-filter": "^2.8", - "laminas/laminas-http": "^2.8", - "laminas/laminas-i18n": "^2.8", - "laminas/laminas-inputfilter": "^2.8", - "laminas/laminas-json": "^2.6.1", - "laminas/laminas-log": "^2.9.3", - "laminas/laminas-modulemanager": "^2.8", - "laminas/laminas-serializer": "^2.8", - "laminas/laminas-session": "^2.8.1", - "laminas/laminas-text": "^2.7", - "laminas/laminas-uri": "^2.6", - "laminas/laminas-validator": "^2.10", - "laminas/laminas-view": "^2.9", - "phpunit/phpunit": "^4.8.36", - "sebastian/comparator": "^1.2.4", - "sebastian/version": "^1.0.4" + "zendframework/zend-mvc": "^3.1.1" + }, + "require-dev": { + "http-interop/http-middleware": "^0.4.1", + "laminas/laminas-coding-standard": "^1.0.0", + "laminas/laminas-json": "^2.6.1 || ^3.0", + "laminas/laminas-psr7bridge": "^1.0", + "laminas/laminas-stratigility": ">=2.0.1 <2.2", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.4.2" }, "suggest": { - "laminas/laminas-authentication": "Laminas\\Authentication component for Identity plugin", - "laminas/laminas-config": "Laminas\\Config component", - "laminas/laminas-di": "Laminas\\Di component", - "laminas/laminas-filter": "Laminas\\Filter component", - "laminas/laminas-http": "Laminas\\Http component", - "laminas/laminas-i18n": "Laminas\\I18n component for translatable segments", - "laminas/laminas-inputfilter": "Laminas\\Inputfilter component", - "laminas/laminas-json": "Laminas\\Json component", - "laminas/laminas-log": "Laminas\\Log component", - "laminas/laminas-modulemanager": "Laminas\\ModuleManager component", - "laminas/laminas-serializer": "Laminas\\Serializer component", - "laminas/laminas-servicemanager-di": "^1.0.1, if using laminas-servicemanager v3 and requiring the laminas-di integration", - "laminas/laminas-session": "Laminas\\Session component for FlashMessenger, PRG, and FPRG plugins", - "laminas/laminas-text": "Laminas\\Text component", - "laminas/laminas-uri": "Laminas\\Uri component", - "laminas/laminas-validator": "Laminas\\Validator component", - "laminas/laminas-view": "Laminas\\View component" + "laminas/laminas-json": "(^2.6.1 || ^3.0) To auto-deserialize JSON body content in AbstractRestfulController extensions, when json_decode is unavailable", + "laminas/laminas-log": "^2.9.1 To provide log functionality via LogFilterManager, LogFormatterManager, and LogProcessorManager", + "laminas/laminas-mvc-console": "laminas-mvc-console provides the ability to expose laminas-mvc as a console application", + "laminas/laminas-mvc-i18n": "laminas-mvc-i18n provides integration with laminas-i18n, including a translation bridge and translatable route segments", + "laminas/laminas-mvc-middleware": "To dispatch middleware in your laminas-mvc application", + "laminas/laminas-mvc-plugin-fileprg": "To provide Post/Redirect/Get functionality around forms that container file uploads", + "laminas/laminas-mvc-plugin-flashmessenger": "To provide flash messaging capabilities between requests", + "laminas/laminas-mvc-plugin-identity": "To access the authenticated identity (per laminas-authentication) in controllers", + "laminas/laminas-mvc-plugin-prg": "To provide Post/Redirect/Get functionality within controllers", + "laminas/laminas-paginator": "^2.7 To provide pagination functionality via PaginatorPluginManager", + "laminas/laminas-servicemanager-di": "laminas-servicemanager-di provides utilities for integrating laminas-di and laminas-servicemanager in your laminas-mvc application" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "3.0-dev" - } - }, "autoload": { - "files": [ - "src/autoload.php" - ], "psr-4": { "Laminas\\Mvc\\": "src/" } @@ -2707,162 +2459,113 @@ "license": [ "BSD-3-Clause" ], + "description": "Laminas's event-driven MVC layer, including MVC Applications, Controllers, and Plugins", "homepage": "https://laminas.dev", "keywords": [ "laminas", "mvc" ], - "time": "2019-12-31T17:32:15+00:00" - }, - { - "name": "laminas/laminas-psr7bridge", - "version": "0.2.2", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-psr7bridge.git", - "reference": "14780ef1d40effd59d77ab29c6d439b2af42cdfa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-psr7bridge/zipball/14780ef1d40effd59d77ab29c6d439b2af42cdfa", - "reference": "14780ef1d40effd59d77ab29c6d439b2af42cdfa", - "shasum": "" - }, - "require": { - "laminas/laminas-diactoros": "^1.1", - "laminas/laminas-http": "^2.5", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": ">=5.5", - "psr/http-message": "^1.0" - }, - "replace": { - "zendframework/zend-psr7bridge": "self.version" - }, - "require-dev": { - "phpunit/phpunit": "^4.7", - "squizlabs/php_codesniffer": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev", - "dev-develop": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Laminas\\Psr7Bridge\\": "src/" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "PSR-7 <-> Laminas\\Http bridge", - "homepage": "https://laminas.dev", - "keywords": [ - "http", - "laminas", - "psr", - "psr-7" ], - "time": "2019-12-31T17:38:47+00:00" + "time": "2020-12-14T21:54:40+00:00" }, { - "name": "laminas/laminas-serializer", - "version": "2.9.1", + "name": "laminas/laminas-router", + "version": "3.4.4", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-serializer.git", - "reference": "c1c9361f114271b0736db74e0083a919081af5e0" + "url": "https://github.com/laminas/laminas-router.git", + "reference": "2a7068508af4de67d80ea292e0cc7c37563a33c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-serializer/zipball/c1c9361f114271b0736db74e0083a919081af5e0", - "reference": "c1c9361f114271b0736db74e0083a919081af5e0", + "url": "https://api.github.com/repos/laminas/laminas-router/zipball/2a7068508af4de67d80ea292e0cc7c37563a33c6", + "reference": "2a7068508af4de67d80ea292e0cc7c37563a33c6", "shasum": "" }, "require": { - "laminas/laminas-json": "^2.5 || ^3.0", - "laminas/laminas-stdlib": "^2.7 || ^3.0", + "container-interop/container-interop": "^1.2", + "laminas/laminas-http": "^2.8.1", + "laminas/laminas-servicemanager": "^2.7.8 || ^3.3", + "laminas/laminas-stdlib": "^3.3", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-serializer": "self.version" + "zendframework/zend-router": "^3.3.0" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-math": "^2.6 || ^3.0", - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.16" + "laminas/laminas-i18n": "^2.7.4", + "phpunit/phpunit": "^9.4" }, "suggest": { - "laminas/laminas-math": "(^2.6 || ^3.0) To support Python Pickle serialization", - "laminas/laminas-servicemanager": "(^2.7.5 || ^3.0.3) To support plugin manager support" + "laminas/laminas-i18n": "^2.7.4, if defining translatable HTTP path segments" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.9.x-dev", - "dev-develop": "2.10.x-dev" - }, "laminas": { - "component": "Laminas\\Serializer", - "config-provider": "Laminas\\Serializer\\ConfigProvider" + "component": "Laminas\\Router", + "config-provider": "Laminas\\Router\\ConfigProvider" } }, "autoload": { "psr-4": { - "Laminas\\Serializer\\": "src/" + "Laminas\\Router\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "Serialize and deserialize PHP structures to a variety of representations", + "description": "Flexible routing system for HTTP and console applications", "homepage": "https://laminas.dev", "keywords": [ "laminas", - "serializer" + "routing" + ], + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } ], - "time": "2019-12-31T17:42:11+00:00" + "time": "2020-12-16T22:10:51+00:00" }, { "name": "laminas/laminas-server", - "version": "2.8.1", + "version": "2.9.2", "source": { "type": "git", "url": "https://github.com/laminas/laminas-server.git", - "reference": "4aaca9174c40a2fab2e2aa77999da99f71bdd88e" + "reference": "b91fd8aed71a6b45addc55eda4bb4c3adb21b698" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-server/zipball/4aaca9174c40a2fab2e2aa77999da99f71bdd88e", - "reference": "4aaca9174c40a2fab2e2aa77999da99f71bdd88e", + "url": "https://api.github.com/repos/laminas/laminas-server/zipball/b91fd8aed71a6b45addc55eda4bb4c3adb21b698", + "reference": "b91fd8aed71a6b45addc55eda4bb4c3adb21b698", "shasum": "" }, "require": { "laminas/laminas-code": "^2.5 || ^3.0", "laminas/laminas-stdlib": "^2.5 || ^3.0", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-server": "self.version" + "zendframework/zend-server": "^2.8.1" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4" + "phpunit/phpunit": "^9.3", + "psalm/plugin-phpunit": "^0.13.0", + "vimeo/psalm": "^4.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8.x-dev", - "dev-develop": "2.9.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Server\\": "src/" @@ -2878,48 +2581,65 @@ "laminas", "server" ], - "time": "2019-12-31T17:43:03+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-04-08T13:10:08+00:00" }, { "name": "laminas/laminas-servicemanager", - "version": "2.7.11", + "version": "3.6.4", "source": { "type": "git", "url": "https://github.com/laminas/laminas-servicemanager.git", - "reference": "841abb656c6018afebeec1f355be438426d6a3dd" + "reference": "b1445e1a7077c21b0fad0974a1b7a11b9dbe0828" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/841abb656c6018afebeec1f355be438426d6a3dd", - "reference": "841abb656c6018afebeec1f355be438426d6a3dd", + "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/b1445e1a7077c21b0fad0974a1b7a11b9dbe0828", + "reference": "b1445e1a7077c21b0fad0974a1b7a11b9dbe0828", "shasum": "" }, "require": { - "container-interop/container-interop": "~1.0", + "container-interop/container-interop": "^1.2", + "laminas/laminas-stdlib": "^3.2.1", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.5 || ^7.0" + "php": "^7.3 || ~8.0.0", + "psr/container": "^1.0" + }, + "conflict": { + "laminas/laminas-code": "<3.3.1", + "zendframework/zend-code": "<3.3.1" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" }, "replace": { - "zendframework/zend-servicemanager": "self.version" + "zendframework/zend-servicemanager": "^3.4.0" }, "require-dev": { - "athletic/athletic": "dev-master", - "fabpot/php-cs-fixer": "1.7.*", - "laminas/laminas-di": "~2.5", - "laminas/laminas-mvc": "~2.5", - "phpunit/phpunit": "~4.0" + "composer/package-versions-deprecated": "^1.0", + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-container-config-test": "^0.3", + "laminas/laminas-dependency-plugin": "^2.1", + "mikey179/vfsstream": "^1.6.8", + "ocramius/proxy-manager": "^2.2.3", + "phpbench/phpbench": "^1.0.0-alpha3", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.4" }, "suggest": { - "laminas/laminas-di": "Laminas\\Di component", - "ocramius/proxy-manager": "ProxyManager 0.5.* to handle lazy initialization of services" + "ocramius/proxy-manager": "ProxyManager ^2.1.1 to handle lazy initialization of services" }, + "bin": [ + "bin/generate-deps-for-config-factory", + "bin/generate-factory-for-class" + ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "3.0-dev" - } - }, "autoload": { "psr-4": { "Laminas\\ServiceManager\\": "src/" @@ -2929,12 +2649,24 @@ "license": [ "BSD-3-Clause" ], + "description": "Factory-Driven Dependency Injection Container", "homepage": "https://laminas.dev", "keywords": [ + "PSR-11", + "dependency-injection", + "di", + "dic", "laminas", + "service-manager", "servicemanager" ], - "time": "2019-12-31T17:44:16+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-02-03T08:44:41+00:00" }, { "name": "laminas/laminas-session", @@ -3012,45 +2744,42 @@ }, { "name": "laminas/laminas-soap", - "version": "2.8.0", + "version": "2.9.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-soap.git", - "reference": "34f91d5c4c0a78bc5689cca2d1eaf829b27edd72" + "reference": "11672a79e9074fd8e4e7aedd75849902e7b45e23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-soap/zipball/34f91d5c4c0a78bc5689cca2d1eaf829b27edd72", - "reference": "34f91d5c4c0a78bc5689cca2d1eaf829b27edd72", + "url": "https://api.github.com/repos/laminas/laminas-soap/zipball/11672a79e9074fd8e4e7aedd75849902e7b45e23", + "reference": "11672a79e9074fd8e4e7aedd75849902e7b45e23", "shasum": "" }, "require": { + "ext-dom": "*", "ext-soap": "*", - "laminas/laminas-server": "^2.6.1", - "laminas/laminas-stdlib": "^2.7 || ^3.0", - "laminas/laminas-uri": "^2.5.2", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "laminas/laminas-server": "^2.9", + "laminas/laminas-stdlib": "^3.3", + "laminas/laminas-uri": "^2.8", + "laminas/laminas-zendframework-bridge": "^1.1.0", + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-soap": "self.version" + "zendframework/zend-soap": "^2.8.0" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-config": "^2.6", - "laminas/laminas-http": "^2.5.4", - "phpunit/phpunit": "^5.7.21 || ^6.3" + "laminas/laminas-config": "^3.4", + "laminas/laminas-http": "^2.14", + "phpspec/prophecy-phpunit": "^2.0.1", + "phpunit/phpunit": "^9.4.3" }, "suggest": { + "ext-curl": "Curl is required when .NET compatibility is required", "laminas/laminas-http": "Laminas\\Http component" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7.x-dev", - "dev-develop": "2.8.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Soap\\": "src/" @@ -3065,20 +2794,26 @@ "laminas", "soap" ], - "time": "2019-12-31T17:48:49+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-02-17T18:59:03+00:00" }, { "name": "laminas/laminas-stdlib", - "version": "3.3.0", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "b9d84eaa39fde733356ea948cdef36c631f202b6" + "reference": "d81c7ffe602ed0e6ecb18691019111c0f4bf1efe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/b9d84eaa39fde733356ea948cdef36c631f202b6", - "reference": "b9d84eaa39fde733356ea948cdef36c631f202b6", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/d81c7ffe602ed0e6ecb18691019111c0f4bf1efe", + "reference": "d81c7ffe602ed0e6ecb18691019111c0f4bf1efe", "shasum": "" }, "require": { @@ -3091,15 +2826,9 @@ "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", "phpbench/phpbench": "^0.17.1", - "phpunit/phpunit": "^9.3.7" + "phpunit/phpunit": "~9.3.7" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3.x-dev", - "dev-develop": "3.4.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Stdlib\\": "src/" @@ -3121,43 +2850,37 @@ "type": "community_bridge" } ], - "time": "2020-08-25T09:08:16+00:00" + "time": "2020-11-19T20:18:59+00:00" }, { "name": "laminas/laminas-text", - "version": "2.7.1", + "version": "2.8.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-text.git", - "reference": "3601b5eacb06ed0a12f658df860cc0f9613cf4db" + "reference": "d696fa1fb3880b9b8f02c08be58685013b421608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-text/zipball/3601b5eacb06ed0a12f658df860cc0f9613cf4db", - "reference": "3601b5eacb06ed0a12f658df860cc0f9613cf4db", + "url": "https://api.github.com/repos/laminas/laminas-text/zipball/d696fa1fb3880b9b8f02c08be58685013b421608", + "reference": "d696fa1fb3880b9b8f02c08be58685013b421608", "shasum": "" }, "require": { - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3", - "laminas/laminas-stdlib": "^2.7 || ^3.0", + "laminas/laminas-servicemanager": "^3.4", + "laminas/laminas-stdlib": "^3.1", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "replace": { - "zendframework/zend-text": "self.version" + "zendframework/zend-text": "^2.7.1" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-config": "^2.6", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4" + "laminas/laminas-config": "^3.4", + "phpunit/phpunit": "^9.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7.x-dev", - "dev-develop": "2.8.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Text\\": "src/" @@ -3173,20 +2896,26 @@ "laminas", "text" ], - "time": "2019-12-31T17:54:52+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-02-17T21:24:58+00:00" }, { "name": "laminas/laminas-uri", - "version": "2.8.0", + "version": "2.8.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-uri.git", - "reference": "8651611b6285529f25a4cb9a466c686d9b31468e" + "reference": "79bd4c614c8cf9a6ba715a49fca8061e84933d87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-uri/zipball/8651611b6285529f25a4cb9a466c686d9b31468e", - "reference": "8651611b6285529f25a4cb9a466c686d9b31468e", + "url": "https://api.github.com/repos/laminas/laminas-uri/zipball/79bd4c614c8cf9a6ba715a49fca8061e84933d87", + "reference": "79bd4c614c8cf9a6ba715a49fca8061e84933d87", "shasum": "" }, "require": { @@ -3224,27 +2953,27 @@ "type": "community_bridge" } ], - "time": "2020-10-31T20:20:07+00:00" + "time": "2021-02-17T21:53:05+00:00" }, { "name": "laminas/laminas-validator", - "version": "2.13.4", + "version": "2.14.4", "source": { "type": "git", "url": "https://github.com/laminas/laminas-validator.git", - "reference": "93593684e70b8ed1e870cacd34ca32b0c0ace185" + "reference": "e370c4695db1c81e6dfad38d8c4dbdb37b23d776" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/93593684e70b8ed1e870cacd34ca32b0c0ace185", - "reference": "93593684e70b8ed1e870cacd34ca32b0c0ace185", + "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/e370c4695db1c81e6dfad38d8c4dbdb37b23d776", + "reference": "e370c4695db1c81e6dfad38d8c4dbdb37b23d776", "shasum": "" }, "require": { "container-interop/container-interop": "^1.1", - "laminas/laminas-stdlib": "^3.2.1", + "laminas/laminas-stdlib": "^3.3", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.1" + "php": "^7.3 || ~8.0.0" }, "replace": { "zendframework/zend-validator": "^2.13.0" @@ -3255,16 +2984,19 @@ "laminas/laminas-config": "^2.6", "laminas/laminas-db": "^2.7", "laminas/laminas-filter": "^2.6", - "laminas/laminas-http": "^2.5.4", + "laminas/laminas-http": "^2.14.2", "laminas/laminas-i18n": "^2.6", "laminas/laminas-math": "^2.6", - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3", + "laminas/laminas-servicemanager": "^2.7.11 || ^3.0.3", "laminas/laminas-session": "^2.8", - "laminas/laminas-uri": "^2.5", - "phpunit/phpunit": "^7.5.20 || ^8.5.2", + "laminas/laminas-uri": "^2.7", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.3", + "psalm/plugin-phpunit": "^0.15.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0", + "vimeo/psalm": "^4.3" }, "suggest": { "laminas/laminas-db": "Laminas\\Db component, required by the (No)RecordExists validator", @@ -3279,10 +3011,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.13.x-dev", - "dev-develop": "2.14.x-dev" - }, "laminas": { "component": "Laminas\\Validator", "config-provider": "Laminas\\Validator\\ConfigProvider" @@ -3303,32 +3031,41 @@ "laminas", "validator" ], - "time": "2020-03-31T18:57:01+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-01-24T20:45:49+00:00" }, { "name": "laminas/laminas-view", - "version": "2.11.4", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-view.git", - "reference": "3bbb2e94287383604c898284a18d2d06cf17301e" + "reference": "3ef103da6887809f08ecf52f42c31a76c9bf08b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-view/zipball/3bbb2e94287383604c898284a18d2d06cf17301e", - "reference": "3bbb2e94287383604c898284a18d2d06cf17301e", + "url": "https://api.github.com/repos/laminas/laminas-view/zipball/3ef103da6887809f08ecf52f42c31a76c9bf08b1", + "reference": "3ef103da6887809f08ecf52f42c31a76c9bf08b1", "shasum": "" }, "require": { - "laminas/laminas-eventmanager": "^2.6.2 || ^3.0", + "laminas/laminas-eventmanager": "^3.0", "laminas/laminas-json": "^2.6.1 || ^3.0", "laminas/laminas-loader": "^2.5", - "laminas/laminas-stdlib": "^2.7 || ^3.0", + "laminas/laminas-stdlib": "^3.2.1", "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" + }, + "conflict": { + "laminas/laminas-servicemanager": "<3.3" }, "replace": { - "zendframework/zend-view": "self.version" + "zendframework/zend-view": "^2.11.4" }, "require-dev": { "laminas/laminas-authentication": "^2.5", @@ -3349,10 +3086,12 @@ "laminas/laminas-permissions-acl": "^2.6", "laminas/laminas-router": "^3.0.1", "laminas/laminas-serializer": "^2.6.1", - "laminas/laminas-servicemanager": "^2.7.5 || ^3.0.3", + "laminas/laminas-servicemanager": "^3.3", "laminas/laminas-session": "^2.8.1", "laminas/laminas-uri": "^2.5", - "phpunit/phpunit": "^5.7.15 || ^6.0.8" + "phpspec/prophecy": "^1.12", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.3" }, "suggest": { "laminas/laminas-authentication": "Laminas\\Authentication component", @@ -3373,12 +3112,6 @@ "bin/templatemap_generator.php" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.11.x-dev", - "dev-develop": "2.12.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\View\\": "src/" @@ -3394,28 +3127,36 @@ "laminas", "view" ], - "time": "2019-12-31T18:03:30+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-01-01T14:07:41+00:00" }, { "name": "laminas/laminas-zendframework-bridge", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-zendframework-bridge.git", - "reference": "6ede70583e101030bcace4dcddd648f760ddf642" + "reference": "6cccbddfcfc742eb02158d6137ca5687d92cee32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6ede70583e101030bcace4dcddd648f760ddf642", - "reference": "6ede70583e101030bcace4dcddd648f760ddf642", + "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6cccbddfcfc742eb02158d6137ca5687d92cee32", + "reference": "6cccbddfcfc742eb02158d6137ca5687d92cee32", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0 || ^8.0" + "php": "^7.3 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3", - "squizlabs/php_codesniffer": "^3.5" + "psalm/plugin-phpunit": "^0.15.1", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.6" }, "type": "library", "extra": { @@ -3448,59 +3189,46 @@ "type": "community_bridge" } ], - "time": "2020-09-14T14:23:00+00:00" + "time": "2021-02-25T21:54:58+00:00" }, { "name": "league/flysystem", - "version": "1.1.3", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" + "reference": "27ea64cc9d61ae7b6a5f04bebf062d89dd18e8f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/27ea64cc9d61ae7b6a5f04bebf062d89dd18e8f7", + "reference": "27ea64cc9d61ae7b6a5f04bebf062d89dd18e8f7", "shasum": "" }, "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" + "ext-json": "*", + "league/mime-type-detection": "^1.0.0", + "php": "^7.2 || ^8.0" }, "conflict": { - "league/flysystem-sftp": "<1.0.6" + "guzzlehttp/ringphp": "<1.1.1" }, "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "suggest": { - "ext-fileinfo": "Required for MimeType", - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + "async-aws/s3": "^1.5", + "async-aws/simple-s3": "^1.0", + "aws/aws-sdk-php": "^3.132.4", + "composer/semver": "^3.0", + "ext-fileinfo": "*", + "friendsofphp/php-cs-fixer": "^2.16", + "google/cloud-storage": "^1.23", + "phpseclib/phpseclib": "^2.0", + "phpstan/phpstan": "^0.12.26", + "phpunit/phpunit": "^8.5 || ^9.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { "psr-4": { - "League\\Flysystem\\": "src/" + "League\\Flysystem\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3510,69 +3238,52 @@ "authors": [ { "name": "Frank de Jonge", - "email": "info@frenky.net" + "email": "info@frankdejonge.nl" } ], - "description": "Filesystem abstraction: Many filesystems, one API.", + "description": "File storage abstraction for PHP", "keywords": [ - "Cloud Files", "WebDAV", - "abstraction", "aws", "cloud", - "copy.com", - "dropbox", - "file systems", + "file", "files", "filesystem", "filesystems", "ftp", - "rackspace", - "remote", "s3", "sftp", "storage" ], - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], - "time": "2020-08-23T07:39:11+00:00" + "time": "2021-04-11T15:03:35+00:00" }, { "name": "league/flysystem-aws-s3-v3", - "version": "1.0.29", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git", - "reference": "4e25cc0582a36a786c31115e419c6e40498f6972" + "reference": "43b4cea4fc0d80378d947c306df96a749cdded35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/4e25cc0582a36a786c31115e419c6e40498f6972", - "reference": "4e25cc0582a36a786c31115e419c6e40498f6972", + "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/43b4cea4fc0d80378d947c306df96a749cdded35", + "reference": "43b4cea4fc0d80378d947c306df96a749cdded35", "shasum": "" }, "require": { - "aws/aws-sdk-php": "^3.20.0", - "league/flysystem": "^1.0.40", - "php": ">=5.5.0" + "aws/aws-sdk-php": "^3.132.4", + "league/flysystem": "^2.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^7.2 || ^8.0" }, - "require-dev": { - "henrikbjorn/phpspec-code-coverage": "~1.0.1", - "phpspec/phpspec": "^2.0.0" + "conflict": { + "guzzlehttp/ringphp": "<1.1.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "psr-4": { - "League\\Flysystem\\AwsS3v3\\": "src/" + "League\\Flysystem\\AwsS3V3\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -3582,71 +3293,33 @@ "authors": [ { "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "description": "Flysystem adapter for the AWS S3 SDK v3.x", - "time": "2020-10-08T18:58:37+00:00" - }, - { - "name": "league/flysystem-cached-adapter", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem-cached-adapter.git", - "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff", - "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff", - "shasum": "" - }, - "require": { - "league/flysystem": "~1.0", - "psr/cache": "^1.0.0" - }, - "require-dev": { - "mockery/mockery": "~0.9", - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7", - "predis/predis": "~1.0", - "tedivm/stash": "~0.12" - }, - "suggest": { - "ext-phpredis": "Pure C implemented extension for PHP" - }, - "type": "library", - "autoload": { - "psr-4": { - "League\\Flysystem\\Cached\\": "src/" + "email": "info@frankdejonge.nl" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" ], - "authors": [ - { - "name": "frankdejonge", - "email": "info@frenky.net" - } + "description": "AWS S3 filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "aws", + "file", + "files", + "filesystem", + "s3", + "storage" ], - "description": "An adapter decorator to enable meta-data caching.", - "time": "2020-07-25T15:56:04+00:00" + "time": "2021-04-11T09:05:38+00:00" }, { "name": "league/mime-type-detection", - "version": "1.5.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa" + "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/353f66d7555d8a90781f6f5e7091932f9a4250aa", - "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", "shasum": "" }, "require": { @@ -3654,8 +3327,9 @@ "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.36", - "phpunit/phpunit": "^8.5.8" + "friendsofphp/php-cs-fixer": "^2.18", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3" }, "type": "library", "autoload": { @@ -3684,7 +3358,7 @@ "type": "tidelift" } ], - "time": "2020-10-18T11:50:25+00:00" + "time": "2021-01-18T20:58:21+00:00" }, { "name": "magento/composer", @@ -3722,27 +3396,27 @@ }, { "name": "magento/magento-composer-installer", - "version": "0.1.13", + "version": "0.2.1", "source": { "type": "git", "url": "https://github.com/magento/magento-composer-installer.git", - "reference": "8b6c32f53b4944a5d6656e86344cd0f9784709a1" + "reference": "b9f929f718ef93ed61b6410bad85d40c37fd5ed3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-composer-installer/zipball/8b6c32f53b4944a5d6656e86344cd0f9784709a1", - "reference": "8b6c32f53b4944a5d6656e86344cd0f9784709a1", + "url": "https://api.github.com/repos/magento/magento-composer-installer/zipball/b9f929f718ef93ed61b6410bad85d40c37fd5ed3", + "reference": "b9f929f718ef93ed61b6410bad85d40c37fd5ed3", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0" + "composer-plugin-api": "^1.1 || ^2.0", + "composer/composer": "^1.9 || ^2.0" }, "replace": { "magento-hackathon/magento-composer-installer": "*" }, "require-dev": { - "composer/composer": "*@dev", - "firegento/phpcs": "dev-patch-1", + "firegento/phpcs": "~1.1.0", "mikey179/vfsstream": "*", "phpunit/phpunit": "*", "phpunit/phpunit-mock-objects": "dev-master", @@ -3766,10 +3440,6 @@ "OSL-3.0" ], "authors": [ - { - "name": "Vinai Kopp", - "email": "vinai@netzarbeiter.com" - }, { "name": "Daniel Fahlke aka Flyingmana", "email": "flyingmana@googlemail.com" @@ -3789,6 +3459,10 @@ { "name": "David Fuhr", "email": "fuhr@flagbit.de" + }, + { + "name": "Vinai Kopp", + "email": "vinai@netzarbeiter.com" } ], "description": "Composer installer for Magento modules", @@ -3797,20 +3471,20 @@ "composer-installer", "magento" ], - "time": "2017-12-29T16:45:24+00:00" + "time": "2021-03-04T20:05:10+00:00" }, { "name": "magento/zendframework1", - "version": "1.14.4", + "version": "1.14.5", "source": { "type": "git", "url": "https://github.com/magento/zf1.git", - "reference": "250f35c0e80b5e6fa1a1598c144cba2fff36b565" + "reference": "6ad81500d33f085ca2391f2b59e37bd34203b29b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/zf1/zipball/250f35c0e80b5e6fa1a1598c144cba2fff36b565", - "reference": "250f35c0e80b5e6fa1a1598c144cba2fff36b565", + "url": "https://api.github.com/repos/magento/zf1/zipball/6ad81500d33f085ca2391f2b59e37bd34203b29b", + "reference": "6ad81500d33f085ca2391f2b59e37bd34203b29b", "shasum": "" }, "require": { @@ -3844,20 +3518,20 @@ "ZF1", "framework" ], - "time": "2020-05-19T23:25:07+00:00" + "time": "2020-12-02T21:12:59+00:00" }, { "name": "monolog/monolog", - "version": "1.25.5", + "version": "1.26.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0" + "reference": "2209ddd84e7ef1256b7af205d0717fb62cfc9c33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1817faadd1846cd08be9a49e905dc68823bc38c0", - "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/2209ddd84e7ef1256b7af205d0717fb62cfc9c33", + "reference": "2209ddd84e7ef1256b7af205d0717fb62cfc9c33", "shasum": "" }, "require": { @@ -3873,7 +3547,7 @@ "graylog2/gelf-php": "~1.0", "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", - "php-parallel-lint/php-parallel-lint": "^1.0", + "phpstan/phpstan": "^0.12.59", "phpunit/phpunit": "~4.5", "ruflin/elastica": ">=0.90 <3.0", "sentry/sentry": "^0.13", @@ -3893,11 +3567,6 @@ "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "Monolog\\": "src/Monolog" @@ -3931,7 +3600,7 @@ "type": "tidelift" } ], - "time": "2020-07-23T08:35:51+00:00" + "time": "2020-12-14T12:56:38+00:00" }, { "name": "mtdowling/jmespath.php", @@ -3990,6 +3659,58 @@ ], "time": "2020-07-31T21:01:56+00:00" }, + { + "name": "nikic/php-parser", + "version": "v4.4.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", + "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "0.0.5", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2020-04-10T16:34:50+00:00" + }, { "name": "paragonie/random_compat", "version": "v9.99.99", @@ -4037,16 +3758,16 @@ }, { "name": "paragonie/sodium_compat", - "version": "v1.13.0", + "version": "v1.15.3", "source": { "type": "git", "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "bbade402cbe84c69b718120911506a3aa2bae653" + "reference": "69ac8357b0b5916e997226143a401ce2c09f5585" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/bbade402cbe84c69b718120911506a3aa2bae653", - "reference": "bbade402cbe84c69b718120911506a3aa2bae653", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/69ac8357b0b5916e997226143a401ce2c09f5585", + "reference": "69ac8357b0b5916e997226143a401ce2c09f5585", "shasum": "" }, "require": { @@ -4054,7 +3775,7 @@ "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" }, "require-dev": { - "phpunit/phpunit": "^3|^4|^5|^6|^7" + "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" }, "suggest": { "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", @@ -4115,43 +3836,43 @@ "secret-key cryptography", "side-channel resistant" ], - "time": "2020-03-20T21:48:09+00:00" + "time": "2021-04-14T21:40:16+00:00" }, { "name": "pelago/emogrifier", - "version": "v3.1.0", + "version": "v5.0.1", "source": { "type": "git", "url": "https://github.com/MyIntervals/emogrifier.git", - "reference": "f6a5c7d44612d86c3901c93f1592f5440e6b2cd8" + "reference": "37595a9bb62c3c25969bdd9e8d7dd24c3ac62bc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MyIntervals/emogrifier/zipball/f6a5c7d44612d86c3901c93f1592f5440e6b2cd8", - "reference": "f6a5c7d44612d86c3901c93f1592f5440e6b2cd8", + "url": "https://api.github.com/repos/MyIntervals/emogrifier/zipball/37595a9bb62c3c25969bdd9e8d7dd24c3ac62bc9", + "reference": "37595a9bb62c3c25969bdd9e8d7dd24c3ac62bc9", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", - "php": "^5.6 || ~7.0 || ~7.1 || ~7.2 || ~7.3 || ~7.4", - "symfony/css-selector": "^2.8 || ^3.0 || ^4.0 || ^5.0" + "php": "~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0", + "symfony/css-selector": "^3.4.32 || ^4.4 || ^5.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.15.3", - "phpmd/phpmd": "^2.7.0", - "phpunit/phpunit": "^5.7.27", - "squizlabs/php_codesniffer": "^3.5.0" + "php-parallel-lint/php-parallel-lint": "^1.2.0", + "rawr/cross-data-providers": "^2.3.0", + "slevomat/coding-standard": "^6.4.1", + "squizlabs/php_codesniffer": "^3.5.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-main": "6.0.x-dev" } }, "autoload": { "psr-4": { - "Pelago\\": "src/" + "Pelago\\Emogrifier\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4189,7 +3910,7 @@ "email", "pre-processing" ], - "time": "2019-12-26T19:37:31+00:00" + "time": "2021-04-06T08:18:22+00:00" }, { "name": "php-amqplib/php-amqplib", @@ -4315,16 +4036,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.29", + "version": "2.0.31", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "497856a8d997f640b4a516062f84228a772a48a8" + "reference": "233a920cb38636a43b18d428f9a8db1f0a1a08f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/497856a8d997f640b4a516062f84228a772a48a8", - "reference": "497856a8d997f640b4a516062f84228a772a48a8", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/233a920cb38636a43b18d428f9a8db1f0a1a08f4", + "reference": "233a920cb38636a43b18d428f9a8db1f0a1a08f4", "shasum": "" }, "require": { @@ -4332,7 +4053,7 @@ }, "require-dev": { "phing/phing": "~2.7", - "phpunit/phpunit": "^4.8.35|^5.7|^6.0", + "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4", "squizlabs/php_codesniffer": "~2.0" }, "suggest": { @@ -4416,34 +4137,29 @@ "type": "tidelift" } ], - "time": "2020-09-08T04:24:43+00:00" + "time": "2021-04-06T13:56:45+00:00" }, { - "name": "psr/cache", - "version": "1.0.1", + "name": "psr/container", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.2.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { - "Psr\\Cache\\": "src/" + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4453,33 +4169,36 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], - "description": "Common interface for caching libraries", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "cache", - "psr", - "psr-6" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], - "time": "2016-08-06T20:24:11+00:00" + "time": "2021-03-05T17:36:06+00:00" }, { - "name": "psr/container", + "name": "psr/event-dispatcher", "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.2.0" }, "type": "library", "extra": { @@ -4489,7 +4208,7 @@ }, "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "Psr\\EventDispatcher\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4502,33 +4221,31 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "Standard interfaces for event handling.", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "events", + "psr", + "psr-14" ], - "time": "2017-02-14T16:28:37+00:00" + "time": "2019-01-08T18:20:26+00:00" }, { - "name": "psr/http-message", + "name": "psr/http-client", "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" }, "type": "library", "extra": { @@ -4538,7 +4255,7 @@ }, "autoload": { "psr-4": { - "Psr\\Http\\Message\\": "src/" + "Psr\\Http\\Client\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4551,25 +4268,125 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", "keywords": [ "http", - "http-message", + "http-client", "psr", - "psr-7", - "request", - "response" + "psr-18" ], - "time": "2016-08-06T14:39:51+00:00" + "time": "2020-06-29T06:28:15+00:00" }, { - "name": "psr/log", - "version": "1.1.3", + "name": "psr/http-factory", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "time": "2019-04-30T12:38:16+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", @@ -4650,87 +4467,174 @@ "description": "A polyfill for getallheaders.", "time": "2019-03-08T08:55:37+00:00" }, + { + "name": "ramsey/collection", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1", + "reference": "28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8" + }, + "require-dev": { + "captainhook/captainhook": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "ergebnis/composer-normalize": "^2.6", + "fakerphp/faker": "^1.5", + "hamcrest/hamcrest-php": "^2", + "jangregor/phpstan-prophecy": "^0.8", + "mockery/mockery": "^1.3", + "phpstan/extension-installer": "^1", + "phpstan/phpstan": "^0.12.32", + "phpstan/phpstan-mockery": "^0.12.5", + "phpstan/phpstan-phpunit": "^0.12.11", + "phpunit/phpunit": "^8.5 || ^9", + "psy/psysh": "^0.10.4", + "slevomat/coding-standard": "^6.3", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP 7.2+ library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/1.1.3" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2021-01-21T17:40:04+00:00" + }, { "name": "ramsey/uuid", - "version": "3.8.0", + "version": "4.1.1", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3" + "reference": "cd4032040a750077205918c86049aa0f43d22947" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/d09ea80159c1929d75b3f9c60504d613aeb4a1e3", - "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/cd4032040a750077205918c86049aa0f43d22947", + "reference": "cd4032040a750077205918c86049aa0f43d22947", "shasum": "" }, "require": { - "paragonie/random_compat": "^1.0|^2.0|9.99.99", - "php": "^5.4 || ^7.0", + "brick/math": "^0.8 || ^0.9", + "ext-json": "*", + "php": "^7.2 || ^8", + "ramsey/collection": "^1.0", "symfony/polyfill-ctype": "^1.8" }, "replace": { "rhumsaa/uuid": "self.version" }, "require-dev": { - "codeception/aspect-mock": "^1.0 | ~2.0.0", - "doctrine/annotations": "~1.2.0", - "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ~2.1.0", - "ircmaxell/random-lib": "^1.1", - "jakub-onderka/php-parallel-lint": "^0.9.0", - "mockery/mockery": "^0.9.9", + "codeception/aspect-mock": "^3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7.0", + "doctrine/annotations": "^1.8", + "goaop/framework": "^2", + "mockery/mockery": "^1.3", "moontoast/math": "^1.1", - "php-mock/php-mock-phpunit": "^0.3|^1.1", - "phpunit/phpunit": "^4.7|^5.0|^6.5", - "squizlabs/php_codesniffer": "^2.3" + "paragonie/random-lib": "^2", + "php-mock/php-mock-mockery": "^1.3", + "php-mock/php-mock-phpunit": "^2.5", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^0.17.1", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-mockery": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^8.5", + "psy/psysh": "^0.10.0", + "slevomat/coding-standard": "^6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "3.9.4" }, "suggest": { - "ext-ctype": "Provides support for PHP Ctype functions", - "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", - "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", - "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", - "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid", + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-ctype": "Enables faster processing of character classification using ctype functions.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "4.x-dev" } }, "autoload": { "psr-4": { "Ramsey\\Uuid\\": "src/" - } + }, + "files": [ + "src/functions.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - }, - { - "name": "Marijn Huizendveld", - "email": "marijn.huizendveld@gmail.com" - }, - { - "name": "Thibaud Fabre", - "email": "thibaud@aztech.io" - } - ], - "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", "homepage": "https://github.com/ramsey/uuid", "keywords": [ "guid", "identifier", "uuid" ], - "time": "2018-07-19T23:38:55+00:00" + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "rss": "https://github.com/ramsey/uuid/releases.atom", + "source": "https://github.com/ramsey/uuid" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + } + ], + "time": "2020-08-18T17:17:46+00:00" }, { "name": "react/promise", @@ -4780,16 +4684,16 @@ }, { "name": "seld/jsonlint", - "version": "1.8.2", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337" + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/590cfec960b77fd55e39b7d9246659e95dd6d337", - "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", "shasum": "" }, "require": { @@ -4835,7 +4739,7 @@ "type": "tidelift" } ], - "time": "2020-08-25T06:56:57+00:00" + "time": "2020-11-11T09:19:24+00:00" }, { "name": "seld/phar-utils", @@ -4882,58 +4786,45 @@ "time": "2020-07-07T18:42:57+00:00" }, { - "name": "symfony/console", - "version": "v4.4.16", + "name": "spomky-labs/aes-key-wrap", + "version": "v6.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5" + "url": "https://github.com/Spomky-Labs/aes-key-wrap.git", + "reference": "97388255a37ad6fb1ed332d07e61fa2b7bb62e0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/20f73dd143a5815d475e0838ff867bce1eebd9d5", - "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5", + "url": "https://api.github.com/repos/Spomky-Labs/aes-key-wrap/zipball/97388255a37ad6fb1ed332d07e61fa2b7bb62e0d", + "reference": "97388255a37ad6fb1ed332d07e61fa2b7bb62e0d", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3|>=5", - "symfony/lock": "<4.4", - "symfony/process": "<3.3" - }, - "provide": { - "psr/log-implementation": "1.0" + "ext-mbstring": "*", + "lib-openssl": "*", + "php": ">=7.2", + "thecodingmachine/safe": "^1.1" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/event-dispatcher": "^4.3", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^3.4|^4.0|^5.0", - "symfony/var-dumper": "^4.3|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "php-coveralls/php-coveralls": "^2.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-beberlei-assert": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0|^8.0|^9.0", + "thecodingmachine/phpstan-safe-rule": "^1.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "AESKW\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4941,57 +4832,55 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky-Labs/aes-key-wrap/contributors" } ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } + "description": "AES Key Wrap for PHP.", + "homepage": "https://github.com/Spomky-Labs/aes-key-wrap", + "keywords": [ + "A128KW", + "A192KW", + "A256KW", + "RFC3394", + "RFC5649", + "aes", + "key", + "padding", + "wrap" ], - "time": "2020-10-24T11:50:19+00:00" + "time": "2020-08-01T14:07:55+00:00" }, { - "name": "symfony/css-selector", - "version": "v5.1.8", + "name": "spomky-labs/base64url", + "version": "v2.0.4", "source": { "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0" + "url": "https://github.com/Spomky-Labs/base64url.git", + "reference": "7752ce931ec285da4ed1f4c5aa27e45e097be61d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", - "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", + "url": "https://api.github.com/repos/Spomky-Labs/base64url/zipball/7752ce931ec285da4ed1f4c5aa27e45e097be61d", + "reference": "7752ce931ec285da4ed1f4c5aa27e45e097be61d", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.1" + }, + "require-dev": { + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.11|^0.12", + "phpstan/phpstan-beberlei-assert": "^0.11|^0.12", + "phpstan/phpstan-deprecation-rules": "^0.11|^0.12", + "phpstan/phpstan-phpunit": "^0.11|^0.12", + "phpstan/phpstan-strict-rules": "^0.11|^0.12" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Base64Url\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4999,79 +4888,68 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky-Labs/base64url/contributors" } ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", + "description": "Base 64 URL Safe Encoding/Decoding PHP Library", + "homepage": "https://github.com/Spomky-Labs/base64url", + "keywords": [ + "base64", + "rfc4648", + "safe", + "url" + ], "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/Spomky", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" + "url": "https://www.patreon.com/FlorentMorselli", + "type": "patreon" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-03T09:10:25+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v4.4.16", + "name": "symfony/config", + "version": "v5.2.4", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "4204f13d2d0b7ad09454f221bb2195fccdf1fe98" + "url": "https://github.com/symfony/config.git", + "reference": "212d54675bf203ff8aef7d8cee8eecfb72f4a263" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4204f13d2d0b7ad09454f221bb2195fccdf1fe98", - "reference": "4204f13d2d0b7ad09454f221bb2195fccdf1fe98", + "url": "https://api.github.com/repos/symfony/config/zipball/212d54675bf203ff8aef7d8cee8eecfb72f4a263", + "reference": "212d54675bf203ff8aef7d8cee8eecfb72f4a263", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/event-dispatcher-contracts": "^1.1" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/filesystem": "^4.4|^5.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.15" }, "conflict": { - "symfony/dependency-injection": "<3.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "1.1" + "symfony/finder": "<4.4" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/error-handler": "~3.4|~4.4", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/finder": "^4.4|^5.0", + "symfony/messenger": "^4.4|^5.0", "symfony/service-contracts": "^1.1|^2", - "symfony/stopwatch": "^3.4|^4.0|^5.0" + "symfony/yaml": "^4.4|^5.0" }, "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "symfony/yaml": "To use the yaml reference dumper" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" + "Symfony\\Component\\Config\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5091,7 +4969,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony EventDispatcher Component", + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "funding": [ { @@ -5107,43 +4985,61 @@ "type": "tidelift" } ], - "time": "2020-10-24T11:50:19+00:00" + "time": "2021-02-23T23:58:19+00:00" }, { - "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.9", + "name": "symfony/console", + "version": "v4.4.21", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7" + "url": "https://github.com/symfony/console.git", + "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/84e23fdcd2517bf37aecbd16967e83f0caee25a7", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7", + "url": "https://api.github.com/repos/symfony/console/zipball/1ba4560dbbb9fcf5ae28b61f71f49c678086cf23", + "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<4.3|>=5", + "symfony/lock": "<4.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/event-dispatcher": "^4.3", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/var-dumper": "^4.3|^5.0" }, "suggest": { - "psr/event-dispatcher": "", - "symfony/event-dispatcher-implementation": "" + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, "autoload": { "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5151,24 +5047,16 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to dispatching event", + "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -5183,30 +5071,29 @@ "type": "tidelift" } ], - "time": "2020-07-06T13:19:58+00:00" + "time": "2021-03-26T09:23:24+00:00" }, { - "name": "symfony/filesystem", - "version": "v5.1.8", + "name": "symfony/css-selector", + "version": "v5.2.4", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "df08650ea7aee2d925380069c131a66124d79177" + "url": "https://github.com/symfony/css-selector.git", + "reference": "f65f217b3314504a1ec99c2d6ef69016bb13490f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/df08650ea7aee2d925380069c131a66124d79177", - "reference": "df08650ea7aee2d925380069c131a66124d79177", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/f65f217b3314504a1ec99c2d6ef69016bb13490f", + "reference": "f65f217b3314504a1ec99c2d6ef69016bb13490f", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8" + "php": ">=7.2.5" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Filesystem\\": "" + "Symfony\\Component\\CssSelector\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5221,12 +5108,16 @@ "name": "Fabien Potencier", "email": "fabien@symfony.com" }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Filesystem Component", + "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "funding": [ { @@ -5242,29 +5133,37 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2021-01-27T10:01:46+00:00" }, { - "name": "symfony/finder", - "version": "v5.1.8", + "name": "symfony/debug", + "version": "v4.4.20", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0" + "url": "https://github.com/symfony/debug.git", + "reference": "157bbec4fd773bae53c5483c50951a5530a2cc16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", + "url": "https://api.github.com/repos/symfony/debug/zipball/157bbec4fd773bae53c5483c50951a5530a2cc16", + "reference": "157bbec4fd773bae53c5483c50951a5530a2cc16", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.1.3", + "psr/log": "~1.0", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "symfony/http-kernel": "<3.4" + }, + "require-dev": { + "symfony/http-kernel": "^3.4|^4.0|^5.0" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Component\\Debug\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5284,7 +5183,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Provides tools to ease debugging PHP code", "homepage": "https://symfony.com", "funding": [ { @@ -5300,44 +5199,58 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2021-01-28T16:54:48+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.20.0", + "name": "symfony/dependency-injection", + "version": "v5.2.6", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "1e66194bed2a69fa395d26bf1067e5e34483afac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1e66194bed2a69fa395d26bf1067e5e34483afac", + "reference": "1e66194bed2a69fa395d26bf1067e5e34483afac", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2.5", + "psr/container": "^1.0", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1.6|^2" + }, + "conflict": { + "symfony/config": "<5.1", + "symfony/finder": "<4.4", + "symfony/proxy-manager-bridge": "<4.4", + "symfony/yaml": "<4.4" + }, + "provide": { + "psr/container-implementation": "1.0", + "symfony/service-implementation": "1.0|2.0" + }, + "require-dev": { + "symfony/config": "^5.1", + "symfony/expression-language": "^4.4|^5.0", + "symfony/yaml": "^4.4|^5.0" }, "suggest": { - "ext-ctype": "For best performance" + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Component\\DependencyInjection\\": "" }, - "files": [ - "bootstrap.php" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5346,22 +5259,16 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -5376,46 +5283,38 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-03-22T11:10:24+00:00" }, { - "name": "symfony/polyfill-intl-idn", - "version": "v1.20.0", + "name": "symfony/deprecation-contracts", + "version": "v2.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "3b75acd829741c768bc8b1f84eb33265e7cc5117" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3b75acd829741c768bc8b1f84eb33265e7cc5117", - "reference": "3b75acd829741c768bc8b1f84eb33265e7cc5117", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-master": "2.2-dev" }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, "files": [ - "bootstrap.php" + "function.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5424,28 +5323,16 @@ ], "authors": [ { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -5460,47 +5347,40 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2020-09-07T11:33:47+00:00" }, { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.20.0", + "name": "symfony/error-handler", + "version": "v4.4.21", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "727d1096295d807c309fb01a851577302394c897" + "url": "https://github.com/symfony/error-handler.git", + "reference": "48e81a375525872e788c2418430f54150d935810" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/727d1096295d807c309fb01a851577302394c897", - "reference": "727d1096295d807c309fb01a851577302394c897", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/48e81a375525872e788c2418430f54150d935810", + "reference": "48e81a375525872e788c2418430f54150d935810", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.1.3", + "psr/log": "~1.0", + "symfony/debug": "^4.4.5", + "symfony/polyfill-php80": "^1.15", + "symfony/var-dumper": "^4.4|^5.0" }, - "suggest": { - "ext-intl": "For best performance" + "require-dev": { + "symfony/http-kernel": "^4.4|^5.0", + "symfony/serializer": "^4.4|^5.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + "Symfony\\Component\\ErrorHandler\\": "" }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5509,24 +5389,16 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", + "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -5541,44 +5413,54 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-03-08T10:28:40+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.20.0", + "name": "symfony/event-dispatcher", + "version": "v4.4.20", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "c352647244bd376bf7d31efbd5401f13f50dad0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c352647244bd376bf7d31efbd5401f13f50dad0c", + "reference": "c352647244bd376bf7d31efbd5401f13f50dad0c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.1.3", + "symfony/event-dispatcher-contracts": "^1.1" + }, + "conflict": { + "symfony/dependency-injection": "<3.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "1.1" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/error-handler": "~3.4|~4.4", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/stopwatch": "^3.4|^4.0|^5.0" }, "suggest": { - "ext-mbstring": "For best performance" + "symfony/dependency-injection": "", + "symfony/http-kernel": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Component\\EventDispatcher\\": "" }, - "files": [ - "bootstrap.php" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5587,23 +5469,16 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -5618,42 +5493,43 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-01-27T09:09:26+00:00" }, { - "name": "symfony/polyfill-php72", - "version": "v1.20.0", + "name": "symfony/event-dispatcher-contracts", + "version": "v1.1.9", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cede45fcdfabdd6043b3592e83678e42ec69e930" + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cede45fcdfabdd6043b3592e83678e42ec69e930", - "reference": "cede45fcdfabdd6043b3592e83678e42ec69e930", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/84e23fdcd2517bf37aecbd16967e83f0caee25a7", + "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.1.3" + }, + "suggest": { + "psr/event-dispatcher": "", + "symfony/event-dispatcher-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-master": "1.1-dev" }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] + "Symfony\\Contracts\\EventDispatcher\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5669,13 +5545,15 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "Generic abstractions related to dispatching event", "homepage": "https://symfony.com", "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "funding": [ { @@ -5691,44 +5569,33 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2020-07-06T13:19:58+00:00" }, { - "name": "symfony/polyfill-php73", - "version": "v1.20.0", + "name": "symfony/filesystem", + "version": "v5.2.6", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed" + "url": "https://github.com/symfony/filesystem.git", + "reference": "8c86a82f51658188119e62cff0a050a12d09836f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/8ff431c517be11c78c48a39a66d37431e26a6bed", - "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/8c86a82f51658188119e62cff0a050a12d09836f", + "reference": "8c86a82f51658188119e62cff0a050a12d09836f", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" + "Symfony\\Component\\Filesystem\\": "" }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5737,22 +5604,16 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -5767,44 +5628,32 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-03-28T14:30:26+00:00" }, { - "name": "symfony/polyfill-php80", - "version": "v1.20.0", + "name": "symfony/finder", + "version": "v5.2.4", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de" + "url": "https://github.com/symfony/finder.git", + "reference": "0d639a0943822626290d169965804f79400e6a04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de", - "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de", + "url": "https://api.github.com/repos/symfony/finder/zipball/0d639a0943822626290d169965804f79400e6a04", + "reference": "0d639a0943822626290d169965804f79400e6a04", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" + "Symfony\\Component\\Finder\\": "" }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5813,26 +5662,16 @@ ], "authors": [ { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -5847,33 +5686,43 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-02-15T18:55:04+00:00" }, { - "name": "symfony/process", - "version": "v4.4.16", + "name": "symfony/http-client-contracts", + "version": "v2.3.1", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "2f4b049fb80ca5e9874615a2a85dc2a502090f05" + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "41db680a15018f9c1d4b23516059633ce280ca33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2f4b049fb80ca5e9874615a2a85dc2a502090f05", - "reference": "2f4b049fb80ca5e9874615a2a85dc2a502090f05", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/41db680a15018f9c1d4b23516059633ce280ca33", + "reference": "41db680a15018f9c1d4b23516059633ce280ca33", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.2.5" + }, + "suggest": { + "symfony/http-client-implementation": "" }, "type": "library", + "extra": { + "branch-version": "2.3", + "branch-alias": { + "dev-main": "2.3-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Contracts\\HttpClient\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5881,16 +5730,24 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Generic abstractions related to HTTP clients", "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -5905,43 +5762,45 @@ "type": "tidelift" } ], - "time": "2020-10-24T11:50:19+00:00" + "time": "2020-10-14T17:08:19+00:00" }, { - "name": "symfony/service-contracts", - "version": "v2.2.0", + "name": "symfony/http-foundation", + "version": "v5.2.4", "source": { "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + "url": "https://github.com/symfony/http-foundation.git", + "reference": "54499baea7f7418bce7b5ec92770fd0799e8e9bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/54499baea7f7418bce7b5ec92770fd0799e8e9bf", + "reference": "54499baea7f7418bce7b5ec92770fd0799e8e9bf", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/container": "^1.0" + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.15" + }, + "require-dev": { + "predis/predis": "~1.0", + "symfony/cache": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/mime": "^4.4|^5.0" }, "suggest": { - "symfony/service-implementation": "" + "symfony/mime": "To use the file extension guesser" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, "autoload": { "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5949,24 +5808,16 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to writing services", + "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -5981,81 +5832,146 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-02-25T17:16:57+00:00" }, { - "name": "tedivm/jshrink", - "version": "v1.3.3", + "name": "symfony/http-kernel", + "version": "v4.4.21", "source": { "type": "git", - "url": "https://github.com/tedious/JShrink.git", - "reference": "566e0c731ba4e372be2de429ef7d54f4faf4477a" + "url": "https://github.com/symfony/http-kernel.git", + "reference": "0248214120d00c5f44f1cd5d9ad65f0b38459333" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tedious/JShrink/zipball/566e0c731ba4e372be2de429ef7d54f4faf4477a", - "reference": "566e0c731ba4e372be2de429ef7d54f4faf4477a", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/0248214120d00c5f44f1cd5d9ad65f0b38459333", + "reference": "0248214120d00c5f44f1cd5d9ad65f0b38459333", "shasum": "" }, "require": { - "php": "^5.6|^7.0" + "php": ">=7.1.3", + "psr/log": "~1.0", + "symfony/error-handler": "^4.4", + "symfony/event-dispatcher": "^4.4", + "symfony/http-client-contracts": "^1.1|^2", + "symfony/http-foundation": "^4.4|^5.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "symfony/browser-kit": "<4.3", + "symfony/config": "<3.4", + "symfony/console": ">=5", + "symfony/dependency-injection": "<4.3", + "symfony/translation": "<4.2", + "twig/twig": "<1.43|<2.13,>=2" + }, + "provide": { + "psr/log-implementation": "1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.8", - "php-coveralls/php-coveralls": "^1.1.0", - "phpunit/phpunit": "^6" + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/browser-kit": "^4.3|^5.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/console": "^3.4|^4.0", + "symfony/css-selector": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^4.3|^5.0", + "symfony/dom-crawler": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/finder": "^3.4|^4.0|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/routing": "^3.4|^4.0|^5.0", + "symfony/stopwatch": "^3.4|^4.0|^5.0", + "symfony/templating": "^3.4|^4.0|^5.0", + "symfony/translation": "^4.2|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "twig/twig": "^1.43|^2.13|^3.0.4" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "" }, "type": "library", "autoload": { - "psr-0": { - "JShrink": "src/" - } + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Robert Hafner", - "email": "tedivm@tedivm.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Javascript Minifier built in PHP", - "homepage": "http://github.com/tedious/JShrink", - "keywords": [ - "javascript", - "minifier" + "description": "Provides a structured process for converting a Request into a Response", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ], - "time": "2019-06-28T18:11:46+00:00" + "time": "2021-03-29T05:11:04+00:00" }, { - "name": "true/punycode", - "version": "v2.1.1", + "name": "symfony/polyfill-ctype", + "version": "v1.22.1", "source": { "type": "git", - "url": "https://github.com/true/php-punycode.git", - "reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/true/php-punycode/zipball/a4d0c11a36dd7f4e7cd7096076cab6d3378a071e", - "reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", + "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", "shasum": "" }, "require": { - "php": ">=5.3.0", - "symfony/polyfill-mbstring": "^1.3" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "~4.7", - "squizlabs/php_codesniffer": "~2.0" + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, "autoload": { "psr-4": { - "TrueBV\\": "src/" - } + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6063,91 +5979,1207 @@ ], "authors": [ { - "name": "Renan Gonçalves", - "email": "renan.saddam@gmail.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)", - "homepage": "https://github.com/true/php-punycode", + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", "keywords": [ - "idna", - "punycode" + "compatibility", + "ctype", + "polyfill", + "portable" ], - "time": "2016-11-16T10:37:54+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" }, { - "name": "tubalmartin/cssmin", - "version": "v4.1.1", + "name": "symfony/polyfill-intl-idn", + "version": "v1.22.1", "source": { "type": "git", - "url": "https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port.git", - "reference": "3cbf557f4079d83a06f9c3ff9b957c022d7805cf" + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "2d63434d922daf7da8dd863e7907e67ee3031483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tubalmartin/YUI-CSS-compressor-PHP-port/zipball/3cbf557f4079d83a06f9c3ff9b957c022d7805cf", - "reference": "3cbf557f4079d83a06f9c3ff9b957c022d7805cf", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/2d63434d922daf7da8dd863e7907e67ee3031483", + "reference": "2d63434d922daf7da8dd863e7907e67ee3031483", "shasum": "" }, "require": { - "ext-pcre": "*", - "php": ">=5.3.2" + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" }, - "require-dev": { - "cogpowered/finediff": "0.3.*", - "phpunit/phpunit": "4.8.*" + "suggest": { + "ext-intl": "For best performance" }, - "bin": [ - "cssmin" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, "autoload": { "psr-4": { - "tubalmartin\\CssMin\\": "src" - } + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Túbal Martín", - "homepage": "http://tubalmartin.me/" + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A PHP port of the YUI CSS compressor", - "homepage": "https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port", + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", "keywords": [ - "compress", - "compressor", - "css", - "cssmin", - "minify", - "yui" + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" ], - "time": "2018-01-15T15:26:51+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" }, { - "name": "webimpress/safe-writer", - "version": "2.1.0", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.22.1", "source": { "type": "git", - "url": "https://github.com/webimpress/safe-writer.git", - "reference": "5cfafdec5873c389036f14bf832a5efc9390dcdd" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webimpress/safe-writer/zipball/5cfafdec5873c389036f14bf832a5efc9390dcdd", - "reference": "5cfafdec5873c389036f14bf832a5efc9390dcdd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", + "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "^8.5.8 || ^9.3.7", - "vimeo/psalm": "^3.14.2", + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", + "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/process", + "version": "v4.4.20", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "7e950b6366d4da90292c2e7fa820b3c1842b965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/7e950b6366d4da90292c2e7fa820b3c1842b965a", + "reference": "7e950b6366d4da90292c2e7fa820b3c1842b965a", + "shasum": "" + }, + "require": { + "php": ">=7.1.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-27T09:09:26+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v5.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "89412a68ea2e675b4e44f260a5666729f77f668e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/89412a68ea2e675b4e44f260a5666729f77f668e", + "reference": "89412a68ea2e675b4e44f260a5666729f77f668e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "phpunit/phpunit": "<5.4.3", + "symfony/console": "<4.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^2.13|^3.0.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-28T09:42:18+00:00" + }, + { + "name": "tedivm/jshrink", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/tedious/JShrink.git", + "reference": "0513ba1407b1f235518a939455855e6952a48bbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tedious/JShrink/zipball/0513ba1407b1f235518a939455855e6952a48bbc", + "reference": "0513ba1407b1f235518a939455855e6952a48bbc", + "shasum": "" + }, + "require": { + "php": "^5.6|^7.0|^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.8", + "php-coveralls/php-coveralls": "^1.1.0", + "phpunit/phpunit": "^6" + }, + "type": "library", + "autoload": { + "psr-0": { + "JShrink": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Robert Hafner", + "email": "tedivm@tedivm.com" + } + ], + "description": "Javascript Minifier built in PHP", + "homepage": "http://github.com/tedious/JShrink", + "keywords": [ + "javascript", + "minifier" + ], + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/tedivm/jshrink", + "type": "tidelift" + } + ], + "time": "2020-11-30T18:10:21+00:00" + }, + { + "name": "thecodingmachine/safe", + "version": "v1.3.3", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/safe.git", + "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/a8ab0876305a4cdaef31b2350fcb9811b5608dbc", + "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "phpstan/phpstan": "^0.12", + "squizlabs/php_codesniffer": "^3.2", + "thecodingmachine/phpstan-strict-rules": "^0.12" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "autoload": { + "psr-4": { + "Safe\\": [ + "lib/", + "deprecated/", + "generated/" + ] + }, + "files": [ + "deprecated/apc.php", + "deprecated/libevent.php", + "deprecated/mssql.php", + "deprecated/stats.php", + "lib/special_cases.php", + "generated/apache.php", + "generated/apcu.php", + "generated/array.php", + "generated/bzip2.php", + "generated/calendar.php", + "generated/classobj.php", + "generated/com.php", + "generated/cubrid.php", + "generated/curl.php", + "generated/datetime.php", + "generated/dir.php", + "generated/eio.php", + "generated/errorfunc.php", + "generated/exec.php", + "generated/fileinfo.php", + "generated/filesystem.php", + "generated/filter.php", + "generated/fpm.php", + "generated/ftp.php", + "generated/funchand.php", + "generated/gmp.php", + "generated/gnupg.php", + "generated/hash.php", + "generated/ibase.php", + "generated/ibmDb2.php", + "generated/iconv.php", + "generated/image.php", + "generated/imap.php", + "generated/info.php", + "generated/ingres-ii.php", + "generated/inotify.php", + "generated/json.php", + "generated/ldap.php", + "generated/libxml.php", + "generated/lzf.php", + "generated/mailparse.php", + "generated/mbstring.php", + "generated/misc.php", + "generated/msql.php", + "generated/mysql.php", + "generated/mysqli.php", + "generated/mysqlndMs.php", + "generated/mysqlndQc.php", + "generated/network.php", + "generated/oci8.php", + "generated/opcache.php", + "generated/openssl.php", + "generated/outcontrol.php", + "generated/password.php", + "generated/pcntl.php", + "generated/pcre.php", + "generated/pdf.php", + "generated/pgsql.php", + "generated/posix.php", + "generated/ps.php", + "generated/pspell.php", + "generated/readline.php", + "generated/rpminfo.php", + "generated/rrd.php", + "generated/sem.php", + "generated/session.php", + "generated/shmop.php", + "generated/simplexml.php", + "generated/sockets.php", + "generated/sodium.php", + "generated/solr.php", + "generated/spl.php", + "generated/sqlsrv.php", + "generated/ssdeep.php", + "generated/ssh2.php", + "generated/stream.php", + "generated/strings.php", + "generated/swoole.php", + "generated/uodbc.php", + "generated/uopz.php", + "generated/url.php", + "generated/var.php", + "generated/xdiff.php", + "generated/xml.php", + "generated/xmlrpc.php", + "generated/yaml.php", + "generated/yaz.php", + "generated/zip.php", + "generated/zlib.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP core functions that throw exceptions instead of returning FALSE on error", + "time": "2020-10-28T17:51:34+00:00" + }, + { + "name": "true/punycode", + "version": "v2.1.1", + "source": { + "type": "git", + "url": "https://github.com/true/php-punycode.git", + "reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/true/php-punycode/zipball/a4d0c11a36dd7f4e7cd7096076cab6d3378a071e", + "reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "symfony/polyfill-mbstring": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.7", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "TrueBV\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Renan Gonçalves", + "email": "renan.saddam@gmail.com" + } + ], + "description": "A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)", + "homepage": "https://github.com/true/php-punycode", + "keywords": [ + "idna", + "punycode" + ], + "time": "2016-11-16T10:37:54+00:00" + }, + { + "name": "tubalmartin/cssmin", + "version": "v4.1.1", + "source": { + "type": "git", + "url": "https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port.git", + "reference": "3cbf557f4079d83a06f9c3ff9b957c022d7805cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tubalmartin/YUI-CSS-compressor-PHP-port/zipball/3cbf557f4079d83a06f9c3ff9b957c022d7805cf", + "reference": "3cbf557f4079d83a06f9c3ff9b957c022d7805cf", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "php": ">=5.3.2" + }, + "require-dev": { + "cogpowered/finediff": "0.3.*", + "phpunit/phpunit": "4.8.*" + }, + "bin": [ + "cssmin" + ], + "type": "library", + "autoload": { + "psr-4": { + "tubalmartin\\CssMin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Túbal Martín", + "homepage": "http://tubalmartin.me/" + } + ], + "description": "A PHP port of the YUI CSS compressor", + "homepage": "https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port", + "keywords": [ + "compress", + "compressor", + "css", + "cssmin", + "minify", + "yui" + ], + "time": "2018-01-15T15:26:51+00:00" + }, + { + "name": "web-token/jwt-framework", + "version": "v2.2.10", + "source": { + "type": "git", + "url": "https://github.com/web-token/jwt-framework.git", + "reference": "49e48633d8cdd7da993c4a94f66dd3ebceda16a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web-token/jwt-framework/zipball/49e48633d8cdd7da993c4a94f66dd3ebceda16a5", + "reference": "49e48633d8cdd7da993c4a94f66dd3ebceda16a5", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.17|^0.9", + "ext-json": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-sodium": "*", + "fgrosse/phpasn1": "^2.0", + "php": ">=7.2", + "psr/event-dispatcher": "^1.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "spomky-labs/aes-key-wrap": "^5.0|^6.0", + "spomky-labs/base64url": "^1.0|^2.0", + "symfony/config": "^4.2|^5.0", + "symfony/console": "^4.2|^5.0", + "symfony/dependency-injection": "^4.2|^5.0", + "symfony/event-dispatcher": "^4.2|^5.0", + "symfony/http-kernel": "^4.2|^5.0", + "symfony/polyfill-mbstring": "^1.12" + }, + "conflict": { + "spomky-labs/jose": "*" + }, + "replace": { + "web-token/encryption-pack": "self.version", + "web-token/jwt-bundle": "self.version", + "web-token/jwt-checker": "self.version", + "web-token/jwt-console": "self.version", + "web-token/jwt-core": "self.version", + "web-token/jwt-easy": "self.version", + "web-token/jwt-encryption": "self.version", + "web-token/jwt-encryption-algorithm-aescbc": "self.version", + "web-token/jwt-encryption-algorithm-aesgcm": "self.version", + "web-token/jwt-encryption-algorithm-aesgcmkw": "self.version", + "web-token/jwt-encryption-algorithm-aeskw": "self.version", + "web-token/jwt-encryption-algorithm-dir": "self.version", + "web-token/jwt-encryption-algorithm-ecdh-es": "self.version", + "web-token/jwt-encryption-algorithm-experimental": "self.version", + "web-token/jwt-encryption-algorithm-pbes2": "self.version", + "web-token/jwt-encryption-algorithm-rsa": "self.version", + "web-token/jwt-key-mgmt": "self.version", + "web-token/jwt-nested-token": "self.version", + "web-token/jwt-signature": "self.version", + "web-token/jwt-signature-algorithm-ecdsa": "self.version", + "web-token/jwt-signature-algorithm-eddsa": "self.version", + "web-token/jwt-signature-algorithm-experimental": "self.version", + "web-token/jwt-signature-algorithm-hmac": "self.version", + "web-token/jwt-signature-algorithm-none": "self.version", + "web-token/jwt-signature-algorithm-rsa": "self.version", + "web-token/jwt-util-ecc": "self.version", + "web-token/signature-pack": "self.version" + }, + "require-dev": { + "bjeavons/zxcvbn-php": "^1.0", + "blackfire/php-sdk": "^1.14", + "ext-curl": "*", + "ext-gmp": "*", + "friendsofphp/php-cs-fixer": "^2.16", + "infection/infection": "^0.15|^0.16|^0.17|^0.18|^0.19|^0.20", + "matthiasnoback/symfony-config-test": "^3.1|^4.0", + "nyholm/psr7": "^1.3", + "php-coveralls/php-coveralls": "^2.0", + "php-http/mock-client": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^8.0|^9.0", + "symfony/browser-kit": "^4.2|^5.0", + "symfony/finder": "^4.2|^5.0", + "symfony/framework-bundle": "^4.2|^5.0", + "symfony/http-client": "^5.2", + "symfony/phpunit-bridge": "^4.2|^5.0", + "symfony/serializer": "^4.2|^5.0", + "symfony/var-dumper": "^4.2|^5.0" + }, + "suggest": { + "bjeavons/zxcvbn-php": "Adds key quality check for oct keys.", + "ext-sodium": "Sodium is required for OKP key creation, EdDSA signature algorithm and ECDH-ES key encryption with OKP keys", + "php-http/httplug": "To enable JKU/X5U support.", + "php-http/httplug-bundle": "To enable JKU/X5U support.", + "php-http/message-factory": "To enable JKU/X5U support.", + "symfony/serializer": "Use the Symfony serializer to serialize/unserialize JWS and JWE tokens.", + "symfony/var-dumper": "Used to show data on the debug toolbar." + }, + "type": "symfony-bundle", + "autoload": { + "psr-4": { + "Jose\\": "src/", + "Jose\\Component\\Signature\\Algorithm\\": [ + "src/SignatureAlgorithm/ECDSA", + "src/SignatureAlgorithm/EdDSA", + "src/SignatureAlgorithm/HMAC", + "src/SignatureAlgorithm/None", + "src/SignatureAlgorithm/RSA", + "src/SignatureAlgorithm/Experimental" + ], + "Jose\\Component\\Core\\Util\\Ecc\\": [ + "src/Ecc" + ], + "Jose\\Component\\Encryption\\Algorithm\\": [ + "src/EncryptionAlgorithm/Experimental" + ], + "Jose\\Component\\Encryption\\Algorithm\\KeyEncryption\\": [ + "src/EncryptionAlgorithm/KeyEncryption/AESGCMKW", + "src/EncryptionAlgorithm/KeyEncryption/AESKW", + "src/EncryptionAlgorithm/KeyEncryption/Direct", + "src/EncryptionAlgorithm/KeyEncryption/ECDHES", + "src/EncryptionAlgorithm/KeyEncryption/PBES2", + "src/EncryptionAlgorithm/KeyEncryption/RSA" + ], + "Jose\\Component\\Encryption\\Algorithm\\ContentEncryption\\": [ + "src/EncryptionAlgorithm/ContentEncryption/AESGCM", + "src/EncryptionAlgorithm/ContentEncryption/AESCBC" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" + }, + { + "name": "All contributors", + "homepage": "https://github.com/web-token/jwt-framework/contributors" + } + ], + "description": "JSON Object Signing and Encryption library for PHP and Symfony Bundle.", + "homepage": "https://github.com/web-token/jwt-framework", + "keywords": [ + "JOSE", + "JWE", + "JWK", + "JWKSet", + "JWS", + "Jot", + "RFC7515", + "RFC7516", + "RFC7517", + "RFC7518", + "RFC7519", + "RFC7520", + "bundle", + "jwa", + "jwt", + "symfony" + ], + "funding": [ + { + "url": "https://github.com/Spomky", + "type": "github" + } + ], + "time": "2021-03-24T14:00:05+00:00" + }, + { + "name": "webimpress/safe-writer", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/webimpress/safe-writer.git", + "reference": "5cfafdec5873c389036f14bf832a5efc9390dcdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webimpress/safe-writer/zipball/5cfafdec5873c389036f14bf832a5efc9390dcdd", + "reference": "5cfafdec5873c389036f14bf832a5efc9390dcdd", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.8 || ^9.3.7", + "vimeo/psalm": "^3.14.2", "webimpress/coding-standard": "^1.1.5" }, "type": "library", @@ -6243,23 +7275,27 @@ }, { "name": "wikimedia/less.php", - "version": "1.8.2", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/wikimedia/less.php.git", - "reference": "e238ad228d74b6ffd38209c799b34e9826909266" + "reference": "a486d78b9bd16b72f237fc6093aa56d69ce8bd13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/less.php/zipball/e238ad228d74b6ffd38209c799b34e9826909266", - "reference": "e238ad228d74b6ffd38209c799b34e9826909266", + "url": "https://api.github.com/repos/wikimedia/less.php/zipball/a486d78b9bd16b72f237fc6093aa56d69ce8bd13", + "reference": "a486d78b9bd16b72f237fc6093aa56d69ce8bd13", "shasum": "" }, "require": { "php": ">=7.2.9" }, "require-dev": { - "phpunit/phpunit": "7.5.14" + "mediawiki/mediawiki-codesniffer": "34.0.0", + "mediawiki/minus-x": "1.0.0", + "php-parallel-lint/php-console-highlighter": "0.5.0", + "php-parallel-lint/php-parallel-lint": "1.2.0", + "phpunit/phpunit": "^8.5" }, "bin": [ "bin/lessc" @@ -6300,30 +7336,35 @@ "php", "stylesheet" ], - "time": "2019-11-06T18:30:11+00:00" + "time": "2020-12-11T19:33:31+00:00" } ], "packages-dev": [ { "name": "allure-framework/allure-codeception", - "version": "1.4.4", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/allure-framework/allure-codeception.git", - "reference": "a69800eeef83007ced9502a3349ff72f5fb6b4e2" + "reference": "5ccfa4cdc826ef43ddba42b817dab4c0a8be7de2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/allure-framework/allure-codeception/zipball/a69800eeef83007ced9502a3349ff72f5fb6b4e2", - "reference": "a69800eeef83007ced9502a3349ff72f5fb6b4e2", + "url": "https://api.github.com/repos/allure-framework/allure-codeception/zipball/5ccfa4cdc826ef43ddba42b817dab4c0a8be7de2", + "reference": "5ccfa4cdc826ef43ddba42b817dab4c0a8be7de2", "shasum": "" }, "require": { - "allure-framework/allure-php-api": "~1.1.8", - "codeception/codeception": "^2.3|^3.0|^4.0", - "php": ">=5.6", - "symfony/filesystem": ">=2.6", - "symfony/finder": ">=2.6" + "allure-framework/allure-php-api": "^1.3", + "codeception/codeception": "^2.5 | ^3 | ^4", + "ext-json": "*", + "php": ">=7.1.3", + "symfony/filesystem": "^2.7 | ^3 | ^4 | ^5", + "symfony/finder": "^2.7 | ^3 | ^4 | ^5" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^7.2 | ^8 | ^9" }, "type": "library", "autoload": { @@ -6338,11 +7379,11 @@ "authors": [ { "name": "Ivan Krutov", - "email": "vania-pooh@yandex-team.ru", + "email": "vania-pooh@aerokube.com", "role": "Developer" } ], - "description": "A Codeception adapter for Allure report.", + "description": "Allure Codeception integration", "homepage": "http://allure.qatools.ru/", "keywords": [ "allure", @@ -6353,30 +7394,35 @@ "steps", "testing" ], - "time": "2020-09-09T10:51:33+00:00" + "support": { + "email": "allure@qameta.io", + "issues": "https://github.com/allure-framework/allure-codeception/issues", + "source": "https://github.com/allure-framework/allure-codeception" + }, + "time": "2021-03-26T16:11:53+00:00" }, { "name": "allure-framework/allure-php-api", - "version": "1.1.8", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/allure-framework/allure-php-commons.git", - "reference": "5ae2deac1c7e1b992cfa572167370de45bdd346d" + "reference": "f64b69afeff472c564a4e2379efb2b69c430ec5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/allure-framework/allure-php-commons/zipball/5ae2deac1c7e1b992cfa572167370de45bdd346d", - "reference": "5ae2deac1c7e1b992cfa572167370de45bdd346d", + "url": "https://api.github.com/repos/allure-framework/allure-php-commons/zipball/f64b69afeff472c564a4e2379efb2b69c430ec5a", + "reference": "f64b69afeff472c564a4e2379efb2b69c430ec5a", "shasum": "" }, "require": { - "jms/serializer": "^0.16 || ^1.0", - "php": ">=5.4.0", - "ramsey/uuid": "^3.0", - "symfony/http-foundation": "^2.0 || ^3.0 || ^4.0 || ^5.0" + "jms/serializer": "^1 | ^2 | ^3", + "php": ">=7.1.3", + "ramsey/uuid": "^3 | ^4", + "symfony/mime": "^4.3 | ^5" }, "require-dev": { - "phpunit/phpunit": "^4.0.0" + "phpunit/phpunit": "^7 | ^8 | ^9" }, "type": "library", "autoload": { @@ -6406,27 +7452,35 @@ "php", "report" ], - "time": "2020-03-13T10:47:35+00:00" + "support": { + "email": "allure@yandex-team.ru", + "issues": "https://github.com/allure-framework/allure-php-commons/issues", + "source": "https://github.com/allure-framework/allure-php-api" + }, + "time": "2021-03-26T14:32:27+00:00" }, { "name": "allure-framework/allure-phpunit", - "version": "1.2.4", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/allure-framework/allure-phpunit.git", - "reference": "9399629c6eed79da4be18fd22adf83ef36c2d2e0" + "reference": "56c65ae482c40411b74a65f97629d16b0e7662ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/allure-framework/allure-phpunit/zipball/9399629c6eed79da4be18fd22adf83ef36c2d2e0", - "reference": "9399629c6eed79da4be18fd22adf83ef36c2d2e0", + "url": "https://api.github.com/repos/allure-framework/allure-phpunit/zipball/56c65ae482c40411b74a65f97629d16b0e7662ee", + "reference": "56c65ae482c40411b74a65f97629d16b0e7662ee", "shasum": "" }, "require": { - "allure-framework/allure-php-api": "~1.1.0", - "mikey179/vfsstream": "1.*", - "php": ">=7.1.0", - "phpunit/phpunit": ">=7.0.0" + "allure-framework/allure-php-api": "^1.3", + "php": ">=7.1", + "phpunit/phpunit": "^7.2 | ^8 | ^9" + }, + "require-dev": { + "ext-dom": "*", + "mikey179/vfsstream": "^1" }, "type": "library", "autoload": { @@ -6445,7 +7499,7 @@ "role": "Developer" } ], - "description": "A PHPUnit adapter for Allure report.", + "description": "Allure PHPUNit integration", "homepage": "http://allure.qatools.ru/", "keywords": [ "allure", @@ -6456,36 +7510,40 @@ "steps", "testing" ], - "time": "2018-10-25T12:03:54+00:00" + "support": { + "email": "allure@qameta.io", + "issues": "https://github.com/allure-framework/allure-phpunit/issues", + "source": "https://github.com/allure-framework/allure-phpunit" + }, + "time": "2021-03-26T15:43:03+00:00" }, { "name": "beberlei/assert", - "version": "v3.2.7", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf" + "reference": "5367e3895976b49704ae671f75bc5f0ba1b986ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/d63a6943fc4fd1a2aedb65994e3548715105abcf", - "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf", + "url": "https://api.github.com/repos/beberlei/assert/zipball/5367e3895976b49704ae671f75bc5f0ba1b986ab", + "reference": "5367e3895976b49704ae671f75bc5f0ba1b986ab", "shasum": "" }, "require": { "ext-ctype": "*", + "ext-intl": "*", "ext-json": "*", "ext-mbstring": "*", "ext-simplexml": "*", - "php": "^7" + "php": "^7.0 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", - "phpstan/phpstan-shim": "*", - "phpunit/phpunit": ">=6.0.0 <8" - }, - "suggest": { - "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" + "phpstan/phpstan": "*", + "phpunit/phpunit": ">=6.0.0", + "yoast/phpunit-polyfills": "^0.1.0" }, "type": "library", "autoload": { @@ -6518,29 +7576,30 @@ "assertion", "validation" ], - "time": "2019-12-19T17:51:41+00:00" + "time": "2020-11-13T20:02:54+00:00" }, { "name": "behat/gherkin", - "version": "v4.6.2", + "version": "v4.8.0", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31" + "reference": "2391482cd003dfdc36b679b27e9f5326bd656acd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/51ac4500c4dc30cbaaabcd2f25694299df666a31", - "reference": "51ac4500c4dc30cbaaabcd2f25694299df666a31", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/2391482cd003dfdc36b679b27e9f5326bd656acd", + "reference": "2391482cd003dfdc36b679b27e9f5326bd656acd", "shasum": "" }, "require": { - "php": ">=5.3.1" + "php": "~7.2|~8.0" }, "require-dev": { - "phpunit/phpunit": "~4.5|~5", - "symfony/phpunit-bridge": "~2.7|~3|~4", - "symfony/yaml": "~2.3|~3|~4" + "cucumber/cucumber": "dev-gherkin-16.0.0", + "phpunit/phpunit": "~8|~9", + "symfony/phpunit-bridge": "~3|~4|~5", + "symfony/yaml": "~3|~4|~5" }, "suggest": { "symfony/yaml": "If you want to parse features, represented in YAML files" @@ -6567,7 +7626,7 @@ "homepage": "http://everzet.com" } ], - "description": "Gherkin DSL parser for PHP 5.3", + "description": "Gherkin DSL parser for PHP", "homepage": "http://behat.org/", "keywords": [ "BDD", @@ -6577,113 +7636,20 @@ "gherkin", "parser" ], - "time": "2020-03-17T14:03:26+00:00" - }, - { - "name": "cache/cache", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/php-cache/cache.git", - "reference": "902b2e5b54ea57e3a801437748652228c4c58604" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-cache/cache/zipball/902b2e5b54ea57e3a801437748652228c4c58604", - "reference": "902b2e5b54ea57e3a801437748652228c4c58604", - "shasum": "" - }, - "require": { - "doctrine/cache": "^1.3", - "league/flysystem": "^1.0", - "php": "^5.6 || ^7.0", - "psr/cache": "^1.0", - "psr/log": "^1.0", - "psr/simple-cache": "^1.0" - }, - "conflict": { - "cache/adapter-common": "*", - "cache/apc-adapter": "*", - "cache/apcu-adapter": "*", - "cache/array-adapter": "*", - "cache/chain-adapter": "*", - "cache/doctrine-adapter": "*", - "cache/filesystem-adapter": "*", - "cache/hierarchical-cache": "*", - "cache/illuminate-adapter": "*", - "cache/memcache-adapter": "*", - "cache/memcached-adapter": "*", - "cache/mongodb-adapter": "*", - "cache/predis-adapter": "*", - "cache/psr-6-doctrine-bridge": "*", - "cache/redis-adapter": "*", - "cache/session-handler": "*", - "cache/taggable-cache": "*", - "cache/void-adapter": "*" - }, - "require-dev": { - "cache/integration-tests": "^0.16", - "defuse/php-encryption": "^2.0", - "illuminate/cache": "^5.4", - "mockery/mockery": "^0.9", - "phpunit/phpunit": "^4.0 || ^5.1", - "predis/predis": "^1.0", - "symfony/cache": "dev-master" - }, - "suggest": { - "ext-apc": "APC extension is required to use the APC Adapter", - "ext-apcu": "APCu extension is required to use the APCu Adapter", - "ext-memcache": "Memcache extension is required to use the Memcache Adapter", - "ext-memcached": "Memcached extension is required to use the Memcached Adapter", - "ext-mongodb": "Mongodb extension required to use the Mongodb adapter", - "ext-redis": "Redis extension is required to use the Redis adapter", - "mongodb/mongodb": "Mongodb lib required to use the Mongodb adapter" - }, - "type": "library", - "autoload": { - "psr-4": { - "Cache\\": "src/" - }, - "exclude-from-classmap": [ - "**/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Scherer", - "email": "aequasi@gmail.com", - "homepage": "https://github.com/aequasi" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - } - ], - "description": "Library of all the php-cache adapters", - "homepage": "http://www.php-cache.com/en/latest/", - "keywords": [ - "cache", - "psr6" - ], - "time": "2017-03-28T16:08:48+00:00" + "time": "2021-02-04T12:44:21+00:00" }, { "name": "codeception/codeception", - "version": "4.1.11", + "version": "4.1.20", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "bf2b548a358750a5ecb3d1aa2b32ebfb82a46061" + "reference": "d8b16e13e1781dbc3a7ae8292117d520c89a9c5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/bf2b548a358750a5ecb3d1aa2b32ebfb82a46061", - "reference": "bf2b548a358750a5ecb3d1aa2b32ebfb82a46061", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/d8b16e13e1781dbc3a7ae8292117d520c89a9c5a", + "reference": "d8b16e13e1781dbc3a7ae8292117d520c89a9c5a", "shasum": "" }, "require": { @@ -6761,7 +7727,7 @@ "type": "open_collective" } ], - "time": "2020-11-03T17:34:51+00:00" + "time": "2021-04-02T16:41:51+00:00" }, { "name": "codeception/lib-asserts", @@ -6908,22 +7874,22 @@ }, { "name": "codeception/module-webdriver", - "version": "1.1.3", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/Codeception/module-webdriver.git", - "reference": "b7dc227f91730e7abb520439decc9ad0677b8a55" + "reference": "63ea08880a44df809bdfbca08597e1b68cee9f87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/b7dc227f91730e7abb520439decc9ad0677b8a55", - "reference": "b7dc227f91730e7abb520439decc9ad0677b8a55", + "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/63ea08880a44df809bdfbca08597e1b68cee9f87", + "reference": "63ea08880a44df809bdfbca08597e1b68cee9f87", "shasum": "" }, "require": { "codeception/codeception": "^4.0", "php": ">=5.6.0 <9.0", - "php-webdriver/webdriver": "^1.6.0" + "php-webdriver/webdriver": "^1.8.0" }, "suggest": { "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests" @@ -6956,20 +7922,20 @@ "browser-testing", "codeception" ], - "time": "2020-10-24T15:41:19+00:00" + "time": "2021-01-17T19:23:20+00:00" }, { "name": "codeception/phpunit-wrapper", - "version": "9.0.5", + "version": "9.0.6", "source": { "type": "git", "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "72bac7770866799e23a7dda1ac6bec2f8baccf45" + "reference": "b0c06abb3181eedca690170f7ed0fd26a70bfacc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/72bac7770866799e23a7dda1ac6bec2f8baccf45", - "reference": "72bac7770866799e23a7dda1ac6bec2f8baccf45", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/b0c06abb3181eedca690170f7ed0fd26a70bfacc", + "reference": "b0c06abb3181eedca690170f7ed0fd26a70bfacc", "shasum": "" }, "require": { @@ -6978,6 +7944,7 @@ }, "require-dev": { "codeception/specify": "*", + "consolidation/robo": "^3.0.0-alpha3", "vlucas/phpdotenv": "^3.0" }, "type": "library", @@ -7000,7 +7967,7 @@ } ], "description": "PHPUnit classes used by Codeception", - "time": "2020-10-11T18:14:42+00:00" + "time": "2020-12-28T13:59:47+00:00" }, { "name": "codeception/stub", @@ -7034,32 +8001,36 @@ }, { "name": "csharpru/vault-php", - "version": "3.5.3", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/CSharpRU/vault-php.git", - "reference": "04be9776310fe7d1afb97795645f95c21e6b4fcf" + "reference": "de812a9667a1111c4f4d4080b2c9166692ee9efe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CSharpRU/vault-php/zipball/04be9776310fe7d1afb97795645f95c21e6b4fcf", - "reference": "04be9776310fe7d1afb97795645f95c21e6b4fcf", + "url": "https://api.github.com/repos/CSharpRU/vault-php/zipball/de812a9667a1111c4f4d4080b2c9166692ee9efe", + "reference": "de812a9667a1111c4f4d4080b2c9166692ee9efe", "shasum": "" }, "require": { - "cache/cache": "^0.4.0", - "doctrine/inflector": "~1.1.0", - "guzzlehttp/promises": "^1.3", - "guzzlehttp/psr7": "^1.4", + "ext-json": "*", + "php": "^7.2", "psr/cache": "^1.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", "psr/log": "^1.0", "weew/helpers-array": "^1.3" }, "require-dev": { - "codacy/coverage": "^1.1", + "alextartan/guzzle-psr18-adapter": "^1.2", + "cache/array-adapter": "^1.0", "codeception/codeception": "^2.2", - "csharpru/vault-php-guzzle6-transport": "~2.0", - "php-vcr/php-vcr": "^1.3" + "laminas/laminas-diactoros": "^2.3", + "php-vcr/php-vcr": "dev-issues/289 as 1.4.5" + }, + "suggest": { + "cache/array-adapter": "For usage with CachedClient class" }, "type": "library", "autoload": { @@ -7078,7 +8049,7 @@ } ], "description": "Best Vault client for PHP that you can find", - "time": "2018-04-28T04:52:17+00:00" + "time": "2020-11-27T09:07:28+00:00" }, { "name": "csharpru/vault-php-guzzle6-transport", @@ -7120,266 +8091,99 @@ }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.5.0", + "version": "v0.7.1", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "e749410375ff6fb7a040a68878c656c2e610b132" + "reference": "fe390591e0241955f22eb9ba327d137e501c771c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", - "reference": "e749410375ff6fb7a040a68878c656c2e610b132", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c", + "reference": "fe390591e0241955f22eb9ba327d137e501c771c", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0", - "php": "^5.3|^7", - "squizlabs/php_codesniffer": "^2|^3" + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0" }, "require-dev": { "composer/composer": "*", "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" - }, - "autoload": { - "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "time": "2018-10-26T13:21:45+00:00" - }, - { - "name": "doctrine/annotations", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/ce77a7ba1770462cd705a91a151b6c3746f9c6ad", - "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/cache": "1.*", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^9.1.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "time": "2020-10-26T10:28:16+00:00" - }, - { - "name": "doctrine/cache", - "version": "1.10.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "13e3381b25847283a91948d04640543941309727" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727", - "reference": "13e3381b25847283a91948d04640543941309727", - "shasum": "" - }, - "require": { - "php": "~7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "alcaeus/mongo-php-adapter": "^1.1", - "doctrine/coding-standard": "^6.0", - "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.0", - "predis/predis": "~1.0" - }, - "suggest": { - "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "sensiolabs/security-checker": "^4.1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" ], - "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", - "homepage": "https://www.doctrine-project.org/projects/cache.html", - "keywords": [ - "abstraction", - "apcu", - "cache", - "caching", - "couchdb", - "memcached", - "php", - "redis", - "xcache" - ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, + "authors": [ { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", - "type": "tidelift" + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" } ], - "time": "2020-07-07T18:54:01+00:00" + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "time": "2020-12-07T18:04:37+00:00" }, { - "name": "doctrine/inflector", - "version": "v1.1.0", + "name": "doctrine/annotations", + "version": "1.12.1", "source": { "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" + "url": "https://github.com/doctrine/annotations.git", + "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/b17c5014ef81d212ac539f07a1001832df1b6d3b", + "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b", "shasum": "" }, "require": { - "php": ">=5.3.2" + "doctrine/lexer": "1.*", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "4.*" + "doctrine/cache": "1.*", + "doctrine/coding-standard": "^6.0 || ^8.1", + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^9.1.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" } }, "notification-url": "https://packagist.org/downloads/", @@ -7387,6 +8191,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -7395,10 +8203,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -7408,48 +8212,42 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" + "annotations", + "docblock", + "parser" ], - "time": "2015-11-06T14:35:42+00:00" + "time": "2021-02-21T21:00:45+00:00" }, { "name": "doctrine/instantiator", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", + "doctrine/coding-standard": "^8.0", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -7463,7 +8261,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", @@ -7486,7 +8284,7 @@ "type": "tidelift" } ], - "time": "2020-05-29T17:27:14+00:00" + "time": "2020-11-10T18:47:58+00:00" }, { "name": "doctrine/lexer", @@ -7552,16 +8350,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.16.7", + "version": "v2.18.5", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "4e35806a6d7d8510d6842ae932e8832363d22c87" + "reference": "e0f6d05c8b157f50029ca6c65c19ed2694f475bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/4e35806a6d7d8510d6842ae932e8832363d22c87", - "reference": "4e35806a6d7d8510d6842ae932e8832363d22c87", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/e0f6d05c8b157f50029ca6c65c19ed2694f475bf", + "reference": "e0f6d05c8b157f50029ca6c65c19ed2694f475bf", "shasum": "" }, "require": { @@ -7570,7 +8368,7 @@ "doctrine/annotations": "^1.2", "ext-json": "*", "ext-tokenizer": "*", - "php": "^7.1", + "php": "^5.6 || ^7.0 || ^8.0", "php-cs-fixer/diff": "^1.3", "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", @@ -7583,17 +8381,19 @@ "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" }, "require-dev": { - "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", "justinrainbow/json-schema": "^5.0", "keradus/cli-executor": "^1.4", "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.1", + "php-coveralls/php-coveralls": "^2.4.2", "php-cs-fixer/accessible-object": "^1.0", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1", + "phpspec/prophecy-phpunit": "^1.1 || ^2.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", + "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", - "symfony/phpunit-bridge": "^5.1", + "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", + "symfony/phpunit-bridge": "^5.2.1", "symfony/yaml": "^3.0 || ^4.0 || ^5.0" }, "suggest": { @@ -7621,6 +8421,7 @@ "tests/Test/IntegrationCaseFactoryInterface.php", "tests/Test/InternalIntegrationCaseFactory.php", "tests/Test/IsIdenticalConstraint.php", + "tests/Test/TokensWithObservedTransformers.php", "tests/TestCase.php" ] }, @@ -7645,7 +8446,7 @@ "type": "github" } ], - "time": "2020-10-27T22:44:27+00:00" + "time": "2021-04-06T18:37:33+00:00" }, { "name": "hoa/consistency", @@ -8478,27 +9279,27 @@ }, { "name": "magento/magento2-functional-testing-framework", - "version": "3.2.0", + "version": "3.5.1", "source": { "type": "git", "url": "https://github.com/magento/magento2-functional-testing-framework.git", - "reference": "0ec0c87335af996cbf3c0aace375d4e659e7a6dc" + "reference": "5a6bdf511182151a6c357b788eb0c3f2fd89954a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/0ec0c87335af996cbf3c0aace375d4e659e7a6dc", - "reference": "0ec0c87335af996cbf3c0aace375d4e659e7a6dc", + "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/5a6bdf511182151a6c357b788eb0c3f2fd89954a", + "reference": "5a6bdf511182151a6c357b788eb0c3f2fd89954a", "shasum": "" }, "require": { - "allure-framework/allure-codeception": "~1.4.0", + "allure-framework/allure-codeception": "~1.4.0||~1.5.0", "aws/aws-sdk-php": "^3.132", "codeception/codeception": "~4.1.4", "codeception/module-asserts": "^1.1", "codeception/module-sequence": "^1.0", "codeception/module-webdriver": "^1.0", - "composer/composer": "^1.9", - "csharpru/vault-php": "~3.5.3", + "composer/composer": "^1.9||^2.0", + "csharpru/vault-php": "^4.1.0", "csharpru/vault-php-guzzle6-transport": "^2.0", "ext-curl": "*", "ext-dom": "*", @@ -8508,6 +9309,7 @@ "hoa/console": "~3.0", "monolog/monolog": "^1.17", "mustache/mustache": "~2.5", + "nikic/php-parser": "~4.4.0", "php": "^7.3", "php-webdriver/webdriver": "^1.8.0", "spomky-labs/otphp": "^10.0", @@ -8532,7 +9334,7 @@ "phpmd/phpmd": "^2.8.0", "phpunit/phpunit": "^9.0", "rregeer/phpunit-coverage-check": "^0.1.4", - "sebastian/phpcpd": "~5.0.0", + "sebastian/phpcpd": "~6.0.0", "squizlabs/php_codesniffer": "~3.5.4", "symfony/stopwatch": "~3.4.6" }, @@ -8565,53 +9367,11 @@ "magento", "testing" ], - "time": "2020-11-05T15:57:52+00:00" - }, - { - "name": "mikey179/vfsstream", - "version": "v1.6.8", - "source": { - "type": "git", - "url": "https://github.com/bovigo/vfsStream.git", - "reference": "231c73783ebb7dd9ec77916c10037eff5a2b6efe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/231c73783ebb7dd9ec77916c10037eff5a2b6efe", - "reference": "231c73783ebb7dd9ec77916c10037eff5a2b6efe", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "autoload": { - "psr-0": { - "org\\bovigo\\vfs\\": "src/main/php" - } + "support": { + "issues": "https://github.com/magento/magento2-functional-testing-framework/issues", + "source": "https://github.com/magento/magento2-functional-testing-framework/tree/3.5.1" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Frank Kleine", - "homepage": "http://frankkleine.de/", - "role": "Developer" - } - ], - "description": "Virtual file system to mock the real file system in unit tests.", - "homepage": "http://vfs.bovigo.org/", - "time": "2019-10-30T15:31:00+00:00" + "time": "2021-05-05T15:01:30+00:00" }, { "name": "mustache/mustache", @@ -8661,16 +9421,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.10.1", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "shasum": "" }, "require": { @@ -8711,28 +9471,28 @@ "type": "tidelift" } ], - "time": "2020-06-29T13:22:24+00:00" + "time": "2020-11-13T09:40:50+00:00" }, { "name": "paragonie/constant_time_encoding", - "version": "v2.3.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2" + "reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2", - "reference": "47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c", + "reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c", "shasum": "" }, "require": { "php": "^7|^8" }, "require-dev": { - "phpunit/phpunit": "^6|^7", - "vimeo/psalm": "^1|^2|^3" + "phpunit/phpunit": "^6|^7|^8|^9", + "vimeo/psalm": "^1|^2|^3|^4" }, "type": "library", "autoload": { @@ -8773,7 +9533,7 @@ "hex2bin", "rfc4648" ], - "time": "2019-11-06T19:20:29+00:00" + "time": "2020-12-06T15:14:20+00:00" }, { "name": "pdepend/pdepend", @@ -9437,16 +10197,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.12.1", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d" + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8ce87516be71aae9b956f81906aaf0338e0d8a2d", - "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", "shasum": "" }, "require": { @@ -9458,7 +10218,7 @@ }, "require-dev": { "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0 || ^9.0 <9.3" + "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { @@ -9496,24 +10256,24 @@ "spy", "stub" ], - "time": "2020-09-29T09:10:42+00:00" + "time": "2021-03-17T13:42:18+00:00" }, { "name": "phpstan/phpstan", - "version": "0.12.23", + "version": "0.12.83", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "71e529efced79e055fa8318b692e7f7d03ea4e75" + "reference": "4a967cec6efb46b500dd6d768657336a3ffe699f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/71e529efced79e055fa8318b692e7f7d03ea4e75", - "reference": "71e529efced79e055fa8318b692e7f7d03ea4e75", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/4a967cec6efb46b500dd6d768657336a3ffe699f", + "reference": "4a967cec6efb46b500dd6d768657336a3ffe699f", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -9538,7 +10298,21 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "time": "2020-05-05T12:55:44+00:00" + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpstan", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2021-04-03T15:35:45+00:00" }, { "name": "phpunit/php-code-coverage", @@ -9782,28 +10556,28 @@ }, { "name": "phpunit/php-timer", - "version": "3.1.4", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "dc9368fae6ef2ffa57eba80a7410bcef81df6258" + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/dc9368fae6ef2ffa57eba80a7410bcef81df6258", - "reference": "dc9368fae6ef2ffa57eba80a7410bcef81df6258", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "php": "^7.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -9827,7 +10601,13 @@ "keywords": [ "timer" ], - "time": "2020-04-20T06:00:37+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" }, { "name": "phpunit/php-token-stream", @@ -9887,46 +10667,46 @@ }, { "name": "phpunit/phpunit", - "version": "9.1.5", + "version": "9.2.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "1b570cd7edbe136055bf5f651857dc8af6b829d2" + "reference": "1c6a9e4312e209e659f1fce3ce88dd197c2448f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1b570cd7edbe136055bf5f651857dc8af6b829d2", - "reference": "1b570cd7edbe136055bf5f651857dc8af6b829d2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1c6a9e4312e209e659f1fce3ce88dd197c2448f6", + "reference": "1c6a9e4312e209e659f1fce3ce88dd197c2448f6", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2.0", + "doctrine/instantiator": "^1.3.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.9.1", + "myclabs/deep-copy": "^1.9.5", "phar-io/manifest": "^1.0.3", "phar-io/version": "^2.0.1", "php": "^7.3", - "phpspec/prophecy": "^1.8.1", - "phpunit/php-code-coverage": "^8.0.1", - "phpunit/php-file-iterator": "^3.0", - "phpunit/php-invoker": "^3.0", - "phpunit/php-text-template": "^2.0", - "phpunit/php-timer": "^3.1.4", - "sebastian/code-unit": "^1.0.2", - "sebastian/comparator": "^4.0", - "sebastian/diff": "^4.0", - "sebastian/environment": "^5.0.1", - "sebastian/exporter": "^4.0", + "phpspec/prophecy": "^1.10.3", + "phpunit/php-code-coverage": "^8.0.2", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-invoker": "^3.0.2", + "phpunit/php-text-template": "^2.0.2", + "phpunit/php-timer": "^5.0.1", + "sebastian/code-unit": "^1.0.5", + "sebastian/comparator": "^4.0.3", + "sebastian/diff": "^4.0.1", + "sebastian/environment": "^5.1.2", + "sebastian/exporter": "^4.0.2", "sebastian/global-state": "^4.0", - "sebastian/object-enumerator": "^4.0", - "sebastian/resource-operations": "^3.0", - "sebastian/type": "^2.0", - "sebastian/version": "^3.0" + "sebastian/object-enumerator": "^4.0.2", + "sebastian/resource-operations": "^3.0.2", + "sebastian/type": "^2.1.1", + "sebastian/version": "^3.0.1" }, "require-dev": { "ext-pdo": "*", @@ -9942,7 +10722,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.1-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -9971,20 +10751,30 @@ "testing", "xunit" ], - "time": "2020-05-22T13:54:05+00:00" + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-07-13T17:55:55+00:00" }, { - "name": "psr/simple-cache", + "name": "psr/cache", "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", "shasum": "" }, "require": { @@ -9998,7 +10788,7 @@ }, "autoload": { "psr-4": { - "Psr\\SimpleCache\\": "src/" + "Psr\\Cache\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -10011,15 +10801,65 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Common interfaces for simple caching", + "description": "Common interface for caching libraries", "keywords": [ "cache", - "caching", "psr", - "psr-16", - "simple-cache" + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2017-10-23T01:57:42+00:00" + "time": "2020-09-28T06:08:49+00:00" }, { "name": "sebastian/code-unit", @@ -10374,66 +11214,19 @@ "email": "bschussek@gmail.com" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:24:23+00:00" - }, - { - "name": "sebastian/finder-facade", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/finder-facade.git", - "reference": "9d3e74b845a2ce50e19b25b5f0c2718e153bee6c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/9d3e74b845a2ce50e19b25b5f0c2718e153bee6c", - "reference": "9d3e74b845a2ce50e19b25b5f0c2718e153bee6c", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.3", - "symfony/finder": "^4.1|^5.0", - "theseer/fdomdocument": "^1.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" ], - "authors": [ + "funding": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", - "homepage": "https://github.com/sebastianbergmann/finder-facade", - "abandoned": true, - "time": "2020-02-08T06:07:58+00:00" + "time": "2020-09-28T05:24:23+00:00" }, { "name": "sebastian/global-state", @@ -10595,25 +11388,25 @@ }, { "name": "sebastian/phpcpd", - "version": "5.0.2", + "version": "6.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpcpd.git", - "reference": "8724382966b1861df4e12db915eaed2165e10bf3" + "reference": "f3683aa0db2e8e09287c2bb33a595b2873ea9176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/8724382966b1861df4e12db915eaed2165e10bf3", - "reference": "8724382966b1861df4e12db915eaed2165e10bf3", + "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/f3683aa0db2e8e09287c2bb33a595b2873ea9176", + "reference": "f3683aa0db2e8e09287c2bb33a595b2873ea9176", "shasum": "" }, "require": { "ext-dom": "*", - "php": "^7.3", - "phpunit/php-timer": "^3.0", - "sebastian/finder-facade": "^2.0", - "sebastian/version": "^3.0", - "symfony/console": "^4.0|^5.0" + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0", + "phpunit/php-timer": "^5.0", + "sebastian/cli-parser": "^1.0", + "sebastian/version": "^3.0" }, "bin": [ "phpcpd" @@ -10621,7 +11414,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "6.0-dev" } }, "autoload": { @@ -10642,7 +11435,13 @@ ], "description": "Copy/Paste Detector (CPD) for PHP code.", "homepage": "https://github.com/sebastianbergmann/phpcpd", - "time": "2020-02-22T06:03:17+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-12-07T05:39:23+00:00" }, { "name": "sebastian/recursion-context", @@ -10693,480 +11492,211 @@ "email": "aharvey@php.net" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:17:30+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" - }, - { - "name": "sebastian/type", - "version": "2.3.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:18:59+00:00" - }, - { - "name": "sebastian/version", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:39:44+00:00" - }, - { - "name": "spomky-labs/otphp", - "version": "v10.0.1", - "source": { - "type": "git", - "url": "https://github.com/Spomky-Labs/otphp.git", - "reference": "f44cce5a9db4b8da410215d992110482c931232f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Spomky-Labs/otphp/zipball/f44cce5a9db4b8da410215d992110482c931232f", - "reference": "f44cce5a9db4b8da410215d992110482c931232f", - "shasum": "" - }, - "require": { - "beberlei/assert": "^3.0", - "ext-mbstring": "*", - "paragonie/constant_time_encoding": "^2.0", - "php": "^7.2|^8.0", - "thecodingmachine/safe": "^0.1.14|^1.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-beberlei-assert": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^8.0", - "thecodingmachine/phpstan-safe-rule": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "v10.0": "10.0.x-dev", - "v9.0": "9.0.x-dev", - "v8.3": "8.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "OTPHP\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Florent Morselli", - "homepage": "https://github.com/Spomky" - }, - { - "name": "All contributors", - "homepage": "https://github.com/Spomky-Labs/otphp/contributors" - } - ], - "description": "A PHP library for generating one time passwords according to RFC 4226 (HOTP Algorithm) and the RFC 6238 (TOTP Algorithm) and compatible with Google Authenticator", - "homepage": "https://github.com/Spomky-Labs/otphp", - "keywords": [ - "FreeOTP", - "RFC 4226", - "RFC 6238", - "google authenticator", - "hotp", - "otp", - "totp" + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2020-01-28T09:24:19+00:00" + "time": "2020-10-26T13:17:30+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.5.8", + "name": "sebastian/resource-operations", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^9.0" }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "3.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { - "name": "Greg Sherwood", - "role": "lead" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2020-10-23T02:01:07+00:00" + "time": "2020-09-28T06:45:17+00:00" }, { - "name": "symfony/config", - "version": "v5.1.8", + "name": "sebastian/type", + "version": "2.3.1", "source": { "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "11baeefa4c179d6908655a7b6be728f62367c193" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/11baeefa4c179d6908655a7b6be728f62367c193", - "reference": "11baeefa4c179d6908655a7b6be728f62367c193", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/filesystem": "^4.4|^5.0", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.15" - }, - "conflict": { - "symfony/finder": "<4.4" + "php": ">=7.3" }, "require-dev": { - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/finder": "^4.4|^5.0", - "symfony/messenger": "^4.4|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/yaml": "^4.4|^5.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Symfony Config Component", - "homepage": "https://symfony.com", + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-26T13:18:59+00:00" }, { - "name": "symfony/dependency-injection", - "version": "v5.1.8", + "name": "sebastian/version", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "829ca6bceaf68036a123a13a979f3c89289eae78" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/829ca6bceaf68036a123a13a979f3c89289eae78", - "reference": "829ca6bceaf68036a123a13a979f3c89289eae78", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.0", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-php80": "^1.15", - "symfony/service-contracts": "^1.1.6|^2" - }, - "conflict": { - "symfony/config": "<5.1", - "symfony/finder": "<4.4", - "symfony/proxy-manager-bridge": "<4.4", - "symfony/yaml": "<4.4" - }, - "provide": { - "psr/container-implementation": "1.0", - "symfony/service-implementation": "1.0" - }, - "require-dev": { - "symfony/config": "^5.1", - "symfony/expression-language": "^4.4|^5.0", - "symfony/yaml": "^4.4|^5.0" - }, - "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" + "php": ">=7.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Symfony DependencyInjection Component", - "homepage": "https://symfony.com", + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2020-10-27T10:11:13+00:00" + "time": "2020-09-28T06:39:44+00:00" }, { - "name": "symfony/deprecation-contracts", - "version": "v2.2.0", + "name": "spomky-labs/otphp", + "version": "v10.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" + "url": "https://github.com/Spomky-Labs/otphp.git", + "reference": "f44cce5a9db4b8da410215d992110482c931232f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "url": "https://api.github.com/repos/Spomky-Labs/otphp/zipball/f44cce5a9db4b8da410215d992110482c931232f", + "reference": "f44cce5a9db4b8da410215d992110482c931232f", "shasum": "" }, "require": { - "php": ">=7.1" + "beberlei/assert": "^3.0", + "ext-mbstring": "*", + "paragonie/constant_time_encoding": "^2.0", + "php": "^7.2|^8.0", + "thecodingmachine/safe": "^0.1.14|^1.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-beberlei-assert": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^8.0", + "thecodingmachine/phpstan-safe-rule": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "v10.0": "10.0.x-dev", + "v9.0": "9.0.x-dev", + "v8.3": "8.3.x-dev" } }, "autoload": { - "files": [ - "function.php" - ] + "psr-4": { + "OTPHP\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -11174,128 +11704,112 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" + "name": "Florent Morselli", + "homepage": "https://github.com/Spomky" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" + "name": "All contributors", + "homepage": "https://github.com/Spomky-Labs/otphp/contributors" } ], - "time": "2020-09-07T11:33:47+00:00" + "description": "A PHP library for generating one time passwords according to RFC 4226 (HOTP Algorithm) and the RFC 6238 (TOTP Algorithm) and compatible with Google Authenticator", + "homepage": "https://github.com/Spomky-Labs/otphp", + "keywords": [ + "FreeOTP", + "RFC 4226", + "RFC 6238", + "google authenticator", + "hotp", + "otp", + "totp" + ], + "time": "2020-01-28T09:24:19+00:00" }, { - "name": "symfony/http-foundation", - "version": "v5.1.8", + "name": "squizlabs/php_codesniffer", + "version": "3.5.8", "source": { "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f" + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a2860ec970404b0233ab1e59e0568d3277d32b6f", - "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php80": "^1.15" + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" }, "require-dev": { - "predis/predis": "~1.0", - "symfony/cache": "^4.4|^5.0", - "symfony/expression-language": "^4.4|^5.0", - "symfony/mime": "^4.4|^5.0" - }, - "suggest": { - "symfony/mime": "To use the file extension guesser" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Greg Sherwood", + "role": "lead" } ], - "description": "Symfony HttpFoundation Component", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-23T02:01:07+00:00" }, { "name": "symfony/mime", - "version": "v5.1.8", + "version": "v5.2.6", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b" + "reference": "1b2092244374cbe48ae733673f2ca0818b37197b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/f5485a92c24d4bcfc2f3fc648744fb398482ff1b", - "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b", + "url": "https://api.github.com/repos/symfony/mime/zipball/1b2092244374cbe48ae733673f2ca0818b37197b", + "reference": "1b2092244374cbe48ae733673f2ca0818b37197b", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.15" }, "conflict": { + "egulias/email-validator": "~3.0.0", + "phpdocumentor/reflection-docblock": "<3.2.2", + "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<4.4" }, "require-dev": { - "egulias/email-validator": "^2.1.10", - "symfony/dependency-injection": "^4.4|^5.0" + "egulias/email-validator": "^2.1.10|^3.1", + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/property-access": "^4.4|^5.1", + "symfony/property-info": "^4.4|^5.1", + "symfony/serializer": "^5.2" }, "type": "library", "autoload": { @@ -11320,7 +11834,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "A library to manipulate MIME messages", + "description": "Allows manipulating MIME messages", "homepage": "https://symfony.com", "keywords": [ "mime", @@ -11340,25 +11854,26 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2021-03-12T13:18:39+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.1.8", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "c6a02905e4ffc7a1498e8ee019db2b477cd1cc02" + "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/c6a02905e4ffc7a1498e8ee019db2b477cd1cc02", - "reference": "c6a02905e4ffc7a1498e8ee019db2b477cd1cc02", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", + "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php73": "~1.0", "symfony/polyfill-php80": "^1.15" }, "type": "library", @@ -11384,7 +11899,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony OptionsResolver Component", + "description": "Provides an improved replacement for the array_replace PHP function", "homepage": "https://symfony.com", "keywords": [ "config", @@ -11405,7 +11920,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2021-01-27T12:56:27+00:00" }, { "name": "symfony/polyfill-php70", @@ -11474,16 +11989,16 @@ }, { "name": "symfony/stopwatch", - "version": "v5.1.8", + "version": "v5.2.4", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "3d9f57c89011f0266e6b1d469e5c0110513859d5" + "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/3d9f57c89011f0266e6b1d469e5c0110513859d5", - "reference": "3d9f57c89011f0266e6b1d469e5c0110513859d5", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b12274acfab9d9850c52583d136a24398cdf1a0c", + "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c", "shasum": "" }, "require": { @@ -11513,7 +12028,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Stopwatch Component", + "description": "Provides a way to profile code", "homepage": "https://symfony.com", "funding": [ { @@ -11529,20 +12044,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2021-01-27T10:15:41+00:00" }, { "name": "symfony/yaml", - "version": "v5.1.8", + "version": "v5.2.5", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "f284e032c3cefefb9943792132251b79a6127ca6" + "reference": "298a08ddda623485208506fcee08817807a251dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/f284e032c3cefefb9943792132251b79a6127ca6", - "reference": "f284e032c3cefefb9943792132251b79a6127ca6", + "url": "https://api.github.com/repos/symfony/yaml/zipball/298a08ddda623485208506fcee08817807a251dd", + "reference": "298a08ddda623485208506fcee08817807a251dd", "shasum": "" }, "require": { @@ -11585,7 +12100,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Yaml Component", + "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "funding": [ { @@ -11601,182 +12116,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:03:25+00:00" - }, - { - "name": "thecodingmachine/safe", - "version": "v1.3.3", - "source": { - "type": "git", - "url": "https://github.com/thecodingmachine/safe.git", - "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/a8ab0876305a4cdaef31b2350fcb9811b5608dbc", - "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "phpstan/phpstan": "^0.12", - "squizlabs/php_codesniffer": "^3.2", - "thecodingmachine/phpstan-strict-rules": "^0.12" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.1-dev" - } - }, - "autoload": { - "psr-4": { - "Safe\\": [ - "lib/", - "deprecated/", - "generated/" - ] - }, - "files": [ - "deprecated/apc.php", - "deprecated/libevent.php", - "deprecated/mssql.php", - "deprecated/stats.php", - "lib/special_cases.php", - "generated/apache.php", - "generated/apcu.php", - "generated/array.php", - "generated/bzip2.php", - "generated/calendar.php", - "generated/classobj.php", - "generated/com.php", - "generated/cubrid.php", - "generated/curl.php", - "generated/datetime.php", - "generated/dir.php", - "generated/eio.php", - "generated/errorfunc.php", - "generated/exec.php", - "generated/fileinfo.php", - "generated/filesystem.php", - "generated/filter.php", - "generated/fpm.php", - "generated/ftp.php", - "generated/funchand.php", - "generated/gmp.php", - "generated/gnupg.php", - "generated/hash.php", - "generated/ibase.php", - "generated/ibmDb2.php", - "generated/iconv.php", - "generated/image.php", - "generated/imap.php", - "generated/info.php", - "generated/ingres-ii.php", - "generated/inotify.php", - "generated/json.php", - "generated/ldap.php", - "generated/libxml.php", - "generated/lzf.php", - "generated/mailparse.php", - "generated/mbstring.php", - "generated/misc.php", - "generated/msql.php", - "generated/mysql.php", - "generated/mysqli.php", - "generated/mysqlndMs.php", - "generated/mysqlndQc.php", - "generated/network.php", - "generated/oci8.php", - "generated/opcache.php", - "generated/openssl.php", - "generated/outcontrol.php", - "generated/password.php", - "generated/pcntl.php", - "generated/pcre.php", - "generated/pdf.php", - "generated/pgsql.php", - "generated/posix.php", - "generated/ps.php", - "generated/pspell.php", - "generated/readline.php", - "generated/rpminfo.php", - "generated/rrd.php", - "generated/sem.php", - "generated/session.php", - "generated/shmop.php", - "generated/simplexml.php", - "generated/sockets.php", - "generated/sodium.php", - "generated/solr.php", - "generated/spl.php", - "generated/sqlsrv.php", - "generated/ssdeep.php", - "generated/ssh2.php", - "generated/stream.php", - "generated/strings.php", - "generated/swoole.php", - "generated/uodbc.php", - "generated/uopz.php", - "generated/url.php", - "generated/var.php", - "generated/xdiff.php", - "generated/xml.php", - "generated/xmlrpc.php", - "generated/yaml.php", - "generated/yaz.php", - "generated/zip.php", - "generated/zlib.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHP core functions that throw exceptions instead of returning FALSE on error", - "time": "2020-10-28T17:51:34+00:00" - }, - { - "name": "theseer/fdomdocument", - "version": "1.6.6", - "source": { - "type": "git", - "url": "https://github.com/theseer/fDOMDocument.git", - "reference": "6e8203e40a32a9c770bcb62fe37e68b948da6dca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/6e8203e40a32a9c770bcb62fe37e68b948da6dca", - "reference": "6e8203e40a32a9c770bcb62fe37e68b948da6dca", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "lib-libxml": "*", - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "lead" - } - ], - "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", - "homepage": "https://github.com/theseer/fDOMDocument", - "time": "2017-06-30T11:53:12+00:00" + "time": "2021-03-06T07:59:01+00:00" }, { "name": "theseer/tokenizer", @@ -11826,16 +12166,16 @@ }, { "name": "vlucas/phpdotenv", - "version": "v2.6.6", + "version": "v2.6.7", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "e1d57f62db3db00d9139078cbedf262280701479" + "reference": "b786088918a884258c9e3e27405c6a4cf2ee246e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/e1d57f62db3db00d9139078cbedf262280701479", - "reference": "e1d57f62db3db00d9139078cbedf262280701479", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b786088918a884258c9e3e27405c6a4cf2ee246e", + "reference": "b786088918a884258c9e3e27405c6a4cf2ee246e", "shasum": "" }, "require": { @@ -11845,7 +12185,7 @@ "require-dev": { "ext-filter": "*", "ext-pcre": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7.27" + "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20" }, "suggest": { "ext-filter": "Required to use the boolean validator.", @@ -11894,34 +12234,39 @@ "type": "tidelift" } ], - "time": "2020-07-14T17:54:18+00:00" + "time": "2021-01-20T14:39:13+00:00" }, { "name": "webmozart/assert", - "version": "1.9.1", + "version": "1.10.0", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", + "php": "^7.2 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -11943,7 +12288,7 @@ "check", "validate" ], - "time": "2020-07-08T17:02:28+00:00" + "time": "2021-03-09T10:59:23+00:00" }, { "name": "weew/helpers-array", @@ -12008,5 +12353,5 @@ "lib-libxml": "*" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/dev/tests/acceptance/tests/_data/import_bundle_product.csv b/dev/tests/acceptance/tests/_data/import_bundle_product.csv new file mode 100644 index 0000000000000..396053d148cdd --- /dev/null +++ b/dev/tests/acceptance/tests/_data/import_bundle_product.csv @@ -0,0 +1,5 @@ +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,deferred_stock_update,use_config_deferred_stock_update,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 +import-product-simple1-bundle,,Default,simple,Default Category/import-category-bundle,base,import-product-simple1-bundle,,,1,1,Taxable Goods,"Catalog, Search",10,,,,import-product-simple1-bundle,,,,magento-logo.png,Magento Logo,magento-logo.png,Magento Logo,magento-logo.png,Magento Logo,,,"10/12/20, 5:33 PM","10/13/20, 9:29 PM",,,Block after Info Column,,,,Use config,,,,,,,Use config,,gift_wrapping_available=Use config,101,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,,, +import-product-simple2-bundle,,Default,simple,Default Category/import-category-bundle,base,import-product-simple2-bundle,,,2,1,Taxable Goods,"Catalog, Search",20,,,,import-product-simple2-bundle,,,,m-logo.gif,M Logo,m-logo.gif,M Logo,m-logo.gif,M Logo,,,"10/12/20, 5:34 PM","10/13/20, 9:30 PM",,,Block after Info Column,,,,Use config,,,,,,,Use config,,gift_wrapping_available=Use config,102,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,,, +import-product-simple3-bundle,,Default,simple,Default Category/import-category-bundle,base,import-product-simple3-bundle,,,3,1,Taxable Goods,"Catalog, Search",30,,,,import-product-simple3-bundle,,,,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,,,"10/12/20, 5:34 PM","10/13/20, 9:30 PM",,,Block after Info Column,,,,Use config,,,,,,,Use config,,gift_wrapping_available=Use config,103,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,,, +import-product-bundle,,Default,bundle,Default Category/import-category-bundle,base,import-product-bundle,,,,1,Taxable Goods,"Catalog, Search",,,,,import-product-bundle,,,,magento-logo.png,Magento Logo,m-logo.gif,M Logo,adobe-base.jpg,Adobe Base,,,"10/13/20, 10:01 PM","10/13/20, 10:05 PM",,,Block after Info Column,,,,Use config,,,,,,,Use config,,gift_wrapping_available=Use config,,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,dynamic,dynamic,Price range,dynamic,"name=Bundle Option A,type=radio,required=1,sku=import-product-simple1-bundle,default=0,default_qty=2.0000,price_type=fixed,can_change_qty=1|name=Bundle Option A,type=radio,required=1,sku=import-product-simple2-bundle,default=1,default_qty=4.0000,price_type=fixed,can_change_qty=0|name=Bundle Option B,type=checkbox,required=0,sku=import-product-simple3-bundle,default=0,default_qty=3.0000,price_type=fixed",together,,,,, \ No newline at end of file diff --git a/dev/tests/acceptance/tests/_data/import_configurable_product.csv b/dev/tests/acceptance/tests/_data/import_configurable_product.csv index 880e0bfb64c2e..5fb229c7a3ea1 100644 --- a/dev/tests/acceptance/tests/_data/import_configurable_product.csv +++ b/dev/tests/acceptance/tests/_data/import_configurable_product.csv @@ -1,5 +1,5 @@ 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,deferred_stock_update,use_config_deferred_stock_update,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 -import-simple1,,Default,simple,Default Category/Import1,base,import-simple1,,,12,1,Taxable Goods,Not Visible Individually,12,,,,import-simple1,Conf11,Conf11,Conf11 ,/m/a/magento-logo.png,Magento Logo,/m/a/magento-logo.png,Magento Logo,/m/a/magento-logo.png,Magento Logo,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,No,,,,,,,,,"import_attribute1=option1,gift_wrapping_available=Yes",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,/m/a/magento-logo.png,Magento Logo,,,,,,,,,,,,, -import-simple2,,Default,simple,Default Category/Import1,base,import-simple2,,,12,1,Taxable Goods,Not Visible Individually,15,,,,import-simple2,Conf11,Conf11,Conf11 ,/t/e/test_image.jpg,Test Image,/t/e/test_image.jpg,Test Image,/t/e/test_image.jpg,Test Image,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,No,,,,,,,,,"import_attribute1=option2,gift_wrapping_available=Yes",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,/t/e/test_image.jpg,Test Image,,,,,,,,,,,,, -import-simple3,,Default,simple,Default Category/Import1,base,import-simple3,,,12,1,Taxable Goods,Not Visible Individually,10,,,,import-simple3,Conf11,Conf11,Conf11 ,,,,,,,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,No,,,,,,,,,"import_attribute1=option3,gift_wrapping_available=Yes",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,,, -import-configurable,,Default,configurable,Default Category/Import1,base,import-configurable,,,12,1,Taxable Goods,"Catalog, Search",,,,,import-configurable,Conf11,Conf11,Conf11 ,,,,,,,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,Use config,,,,,,,Use config,,gift_wrapping_available=Use config,0,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,",,",,,,,,,,,,,,"sku=import-simple1,import_attribute1=option1|sku=import-simple2,import_attribute1=option2|sku=import-simple3,import_attribute1=option3",import_attribute1=import_attribute1 \ No newline at end of file +import-product-simple1-configurable,,Default,simple,Default Category/import-category-configurable,base,import-product-simple1-configurable,,,1,1,Taxable Goods,Not Visible Individually,11,,,,import-product-simple1-configurable,,,,magento-logo.png,Magento Logo,magento-logo.png,Magento Logo,magento-logo.png,Magento Logo,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,No,,,,,,,,,"import_attribute1=option1,gift_wrapping_available=Yes",101,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,,, +import-product-simple2-configurable,,Default,simple,Default Category/import-category-configurable,base,import-product-simple2-configurable,,,2,1,Taxable Goods,Not Visible Individually,12,,,,import-product-simple2-configurable,,,,m-logo.gif,M Logo,m-logo.gif,M Logo,m-logo.gif,M Logo,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,No,,,,,,,,,"import_attribute1=option2,gift_wrapping_available=Yes",102,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,,, +import-product-simple3-configurable,,Default,simple,Default Category/import-category-configurable,base,import-product-simple3-configurable,,,3,1,Taxable Goods,Not Visible Individually,13,,,,import-product-simple3-configurable,,,,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,No,,,,,,,,,"import_attribute1=option3,gift_wrapping_available=Yes",103,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,,, +import-product-configurable,,Default,configurable,Default Category/import-category-configurable,base,import-product-configurable,,,,1,Taxable Goods,"Catalog, Search",,,,,import-product-configurable,,,,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,,,"10/5/20, 4:58 PM","10/5/20, 4:58 PM",,,Block after Info Column,,,,Use config,,,,,,,Use config,,gift_wrapping_available=Use config,,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,,"sku=import-product-simple1-configurable,import_attribute1=option1|sku=import-product-simple2-configurable,import_attribute1=option2|sku=import-product-simple3-configurable,import_attribute1=option3",import_attribute1=import_attribute1 \ No newline at end of file diff --git a/dev/tests/acceptance/tests/_data/import_downloadable_product_file_links.csv b/dev/tests/acceptance/tests/_data/import_downloadable_product_file_links.csv new file mode 100644 index 0000000000000..45332bb03bc7d --- /dev/null +++ b/dev/tests/acceptance/tests/_data/import_downloadable_product_file_links.csv @@ -0,0 +1,2 @@ +sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_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,deferred_stock_update,use_config_deferred_stock_update,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 +import-product-downloadable-file-links,,Default,downloadable,Default Category/import-category-downloadable-file-links,base,import-product-downloadable-file-links,,,,1,Taxable Goods,"Catalog, Search",100,,,,import-product-downloadable-file-links,,,,magento-logo.png,Magento Logo,m-logo.gif,M Logo,adobe-base.jpg,Adobe Base,,,"10/6/20, 10:10 PM","10/6/20, 10:10 PM",,,Block after Info Column,,,,Use config,,,,,,,Use config,,"links_purchased_separately=0,links_title=Links,samples_title=Samples",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,"link_id=3,id=3,title=Link1,sort_order=1,sample_type=file,sample_file=import-product-downloadable-file-links/magento-logo.png,price=3.000000,is_shareable=0,link_type=file,link_file=import-product-downloadable-file-links/m-logo.gif,group_title=Links","sample_id=3,id=3,title=Sample1,sort_order=1,sample_type=file,sample_file=import-product-downloadable-file-links/adobe-base.jpg,group_title=Samples",, \ No newline at end of file diff --git a/dev/tests/acceptance/tests/_data/import_downloadable_product_url_links.csv b/dev/tests/acceptance/tests/_data/import_downloadable_product_url_links.csv new file mode 100644 index 0000000000000..30025f5fbe934 --- /dev/null +++ b/dev/tests/acceptance/tests/_data/import_downloadable_product_url_links.csv @@ -0,0 +1,2 @@ +sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_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,deferred_stock_update,use_config_deferred_stock_update,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 +import-product-downloadable-url-links,,Default,downloadable,Default Category/import-category-downloadable-url-links,base,import-product-downloadable-url-links,,,,1,Taxable Goods,"Catalog, Search",99,,,,import-product-downloadable-url-links,,,,magento-logo.png,Magento Logo,m-logo.gif,M Logo,adobe-base.jpg,Adobe Base,,,"10/6/20, 10:10 PM","10/6/20, 10:10 PM",,,Block after Info Column,,,,Use config,,,,,,,Use config,,"links_purchased_separately=0,links_title=Links,samples_title=Samples",100,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,"link_id=4,id=4,title=Link1,sort_order=1,sample_type=url,sample_url=https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg,price=2.000000,is_shareable=1,link_type=url,link_url=https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg,group_title=Links","sample_id=4,id=4,title=Sample1,sort_order=1,sample_type=url,sample_url=https://static.magento.com/sites/all/themes/mag_redesign/images/magento-logo.svg,group_title=Samples",, \ No newline at end of file diff --git a/dev/tests/acceptance/tests/_data/import_grouped_product.csv b/dev/tests/acceptance/tests/_data/import_grouped_product.csv new file mode 100644 index 0000000000000..d5463ddfac9f5 --- /dev/null +++ b/dev/tests/acceptance/tests/_data/import_grouped_product.csv @@ -0,0 +1,5 @@ +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,deferred_stock_update,use_config_deferred_stock_update,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 +import-product-simple1-grouped,,Default,simple,Default Category/import-category-grouped,base,import-product-simple1-grouped,,,1,1,Taxable Goods,"Catalog, Search",11,,,,import-product-simple1-grouped,,,,magento-logo.png,Magento Logo,magento-logo.png,Magento Logo,magento-logo.png,Magento Logo,magento-logo.png,Magento Logo,"10/12/20, 5:33 PM","10/12/20, 5:33 PM",,,Block after Info Column,,,,Use config,,,,,,,Use config,,gift_wrapping_available=Use config,101,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,,, +import-product-simple2-grouped,,Default,simple,Default Category/import-category-grouped,base,import-product-simple2-grouped,,,2,1,Taxable Goods,"Catalog, Search",12,,,,import-product-simple2-grouped,,,,m-logo.gif,M Logo,m-logo.gif,M Logo,m-logo.gif,M Logo,m-logo.gif,M Logo,"10/12/20, 5:34 PM","10/12/20, 5:34 PM",,,Block after Info Column,,,,Use config,,,,,,,Use config,,gift_wrapping_available=Use config,102,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,,, +import-product-simple3-grouped,,Default,simple,Default Category/import-category-grouped,base,import-product-simple3-grouped,,,3,1,Taxable Goods,"Catalog, Search",13,,,,import-product-simple3-grouped,,,,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,adobe-base.jpg,Adobe Base,"10/12/20, 5:34 PM","10/12/20, 5:34 PM",,,Block after Info Column,,,,Use config,,,,,,,Use config,,gift_wrapping_available=Use config,103,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,,,,, +import-product-grouped,,Default,grouped,Default Category/import-category-grouped,base,import-product-grouped,,,,1,,"Catalog, Search",,,,,import-product-grouped,,,,magento-logo.png,Magento Logo,m-logo.gif,M Logo,adobe-base.jpg,Adobe Base,,,"10/12/20, 5:35 PM","10/12/20, 5:36 PM",,,Block after Info Column,,,,Use config,,,,,,,,,,0,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,0,0,1,,,,,,,,,,,,,,,,,"import-product-simple2-grouped=2.000000,import-product-simple1-grouped=3.000000,import-product-simple3-grouped=1.000000",,,, \ No newline at end of file diff --git a/dev/tests/acceptance/tests/_data/import_tax_rates.csv b/dev/tests/acceptance/tests/_data/import_tax_rates.csv new file mode 100644 index 0000000000000..ac83d6b4eccf9 --- /dev/null +++ b/dev/tests/acceptance/tests/_data/import_tax_rates.csv @@ -0,0 +1,4 @@ +Code,Country,State,Zip/Post Code,Rate,Zip/Post is Range,Range From,Range To +US-CA-*-Rate 1,US,CA,*,10.25,,, +import-rate-1,US,TX,78758,5.25,,, +import-rate-2,US,AK,12345-12346,7.75,1,12345,12346 \ No newline at end of file diff --git a/dev/tests/api-functional/isolate_gql.txt b/dev/tests/api-functional/isolate_gql.txt new file mode 100644 index 0000000000000..d742b1523c59b --- /dev/null +++ b/dev/tests/api-functional/isolate_gql.txt @@ -0,0 +1,3 @@ +# Optional configuration file for dev/tests/utils/phpunitGroupConfig.php +# List graphql phpunit tests that have to be isolated in their own groups, e.g. long running test, special environments, etc +# One per line by class name diff --git a/dev/tests/api-functional/isolate_rest.txt b/dev/tests/api-functional/isolate_rest.txt new file mode 100644 index 0000000000000..78a0b5cd0be90 --- /dev/null +++ b/dev/tests/api-functional/isolate_rest.txt @@ -0,0 +1,3 @@ +# Optional configuration file for dev/tests/utils/phpunitGroupConfig.php +# List rest phpunit tests that have to be isolated in their own groups, e.g. long running test, special environments, etc +# One per line by class name diff --git a/dev/tests/api-functional/phpunit_graphql.xml.dist b/dev/tests/api-functional/phpunit_graphql.xml.dist index e63008a10ee51..969448b3a9c00 100644 --- a/dev/tests/api-functional/phpunit_graphql.xml.dist +++ b/dev/tests/api-functional/phpunit_graphql.xml.dist @@ -58,7 +58,7 @@ <!-- Test listeners --> <listeners> <listener class="Magento\TestFramework\Event\PhpUnit"/> - <listener class="Yandex\Allure\Adapter\AllureAdapter"> + <listener class="Yandex\Allure\PhpUnit\AllurePhpUnit"> <arguments> <string>var/allure-results</string> <!-- XML files output folder --> <boolean>true</boolean> <!-- Whether to delete previous results on rerun --> diff --git a/dev/tests/api-functional/phpunit_rest.xml.dist b/dev/tests/api-functional/phpunit_rest.xml.dist index b949e6c6cffe2..a799488488cd5 100644 --- a/dev/tests/api-functional/phpunit_rest.xml.dist +++ b/dev/tests/api-functional/phpunit_rest.xml.dist @@ -64,7 +64,7 @@ <!-- Test listeners --> <listeners> <listener class="Magento\TestFramework\Event\PhpUnit"/> - <listener class="Yandex\Allure\Adapter\AllureAdapter"> + <listener class="Yandex\Allure\PhpUnit\AllurePhpUnit"> <arguments> <string>var/allure-results</string> <!-- XML files output folder --> <boolean>true</boolean> <!-- Whether to delete previous results on rerun --> diff --git a/dev/tests/api-functional/phpunit_soap.xml.dist b/dev/tests/api-functional/phpunit_soap.xml.dist index 8fc7ad8cebdc4..cba4e4daa257c 100644 --- a/dev/tests/api-functional/phpunit_soap.xml.dist +++ b/dev/tests/api-functional/phpunit_soap.xml.dist @@ -63,7 +63,7 @@ <!-- Test listeners --> <listeners> <listener class="Magento\TestFramework\Event\PhpUnit"/> - <listener class="Yandex\Allure\Adapter\AllureAdapter"> + <listener class="Yandex\Allure\PhpUnit\AllurePhpUnit"> <arguments> <string>var/allure-results</string> <!-- XML files output folder --> <boolean>true</boolean> <!-- Whether to delete previous results on rerun --> diff --git a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductLinkManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductLinkManagementTest.php index 16ba6385ffb23..853616f5afc57 100644 --- a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductLinkManagementTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductLinkManagementTest.php @@ -4,11 +4,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Bundle\Api; +use Magento\Framework\Webapi\Rest\Request; use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\WebapiAbstract; -class ProductLinkManagementTest extends \Magento\TestFramework\TestCase\WebapiAbstract +class ProductLinkManagementTest extends WebapiAbstract { const SERVICE_NAME = 'bundleProductLinkManagementV1'; const SERVICE_VERSION = 'V1'; @@ -84,6 +87,59 @@ public function testAddChild() $this->assertGreaterThan(0, $childId); } + /** + * Verify empty out of stock bundle product is in stock after child has been added. + * + * @magentoApiDataFixture Magento/Bundle/_files/empty_bundle_product.php + * @magentoApiDataFixture Magento/Catalog/_files/product_virtual.php + * + * @return void + */ + public function testBundleProductIsInStockAfterAddChild(): void + { + $productSku = 'bundle-product'; + $option = [ + 'required' => 1, + 'position' => 0, + 'type' => 'select', + 'title' => 'option 1', + 'sku' => $productSku, + ]; + self::assertFalse($this->isProductInStock($productSku)); + $optionId = $this->addOption($option); + $linkedProduct = [ + 'sku' => 'virtual-product', + 'option_id' => $optionId, + 'position' => '1', + 'is_default' => 1, + 'priceType' => 2, + 'price' => 151.34, + 'qty' => 8, + 'can_change_quantity' => 1, + ]; + + $this->addChild($productSku, $optionId, $linkedProduct); + self::assertTrue($this->isProductInStock($productSku)); + } + + /** + * Verify in stock bundle product is out stock after child has been removed. + * + * @magentoApiDataFixture Magento/Bundle/_files/product.php + * + * @return void + */ + public function testBundleProductIsOutOfStockAfterRemoveChild(): void + { + $productSku = 'bundle-product'; + $childSku = 'simple'; + $optionIds = $this->getProductOptions(3); + $optionId = array_shift($optionIds); + self::assertTrue($this->isProductInStock($productSku)); + $this->removeChild($productSku, $optionId, $childSku); + self::assertFalse($this->isProductInStock($productSku)); + } + /** * @magentoApiDataFixture Magento/Bundle/_files/product.php * @magentoApiDataFixture Magento/Catalog/_files/product_virtual.php @@ -119,7 +175,7 @@ private function saveChild($productSku, $linkedProduct) [$productSku, $linkedProduct['id']], $resourcePath ), - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_PUT, + 'httpMethod' => Request::HTTP_METHOD_PUT, ], 'soap' => [ 'service' => self::SERVICE_NAME, @@ -149,7 +205,7 @@ private function addChild($productSku, $optionId, $linkedProduct) [$productSku, $optionId], $resourcePath ), - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST, + 'httpMethod' => Request::HTTP_METHOD_POST, ], 'soap' => [ 'service' => self::SERVICE_NAME, @@ -179,7 +235,7 @@ protected function removeChild($productSku, $optionId, $childSku) $serviceInfo = [ 'rest' => [ 'resourcePath' => sprintf($resourcePath, $productSku, $optionId, $childSku), - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_DELETE, + 'httpMethod' => Request::HTTP_METHOD_DELETE, ], 'soap' => [ 'service' => self::SERVICE_NAME, @@ -200,7 +256,7 @@ protected function getChildren($productSku) $serviceInfo = [ 'rest' => [ 'resourcePath' => self::RESOURCE_PATH . '/' . $productSku . '/children', - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET, + 'httpMethod' => Request::HTTP_METHOD_GET, ], 'soap' => [ 'service' => self::SERVICE_NAME, @@ -210,4 +266,50 @@ protected function getChildren($productSku) ]; return $this->_webApiCall($serviceInfo, ['productSku' => $productSku]); } + + /** + * Check product stock status. + * + * @param string $productSku + * @return bool + */ + private function isProductInStock(string $productSku): bool + { + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => '/V1/stockStatuses/' . $productSku, + 'httpMethod' => Request::HTTP_METHOD_GET, + ], + 'soap' => [ + 'service' => 'catalogInventoryStockRegistryV1', + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => 'catalogInventoryStockRegistryV1getStockStatusBySku', + ], + ]; + $result = $this->_webApiCall($serviceInfo, ['productSku' => $productSku]); + + return (bool)$result['stock_status']; + } + + /** + * Add option to bundle product. + * + * @param array $option + * @return int + */ + private function addOption(array $option): int + { + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => '/V1/bundle-products/options/add', + 'httpMethod' => Request::HTTP_METHOD_POST, + ], + 'soap' => [ + 'service' => 'bundleProductOptionManagementV1', + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => 'bundleProductOptionManagementV1Save', + ], + ]; + return $this->_webApiCall($serviceInfo, ['option' => $option]); + } } diff --git a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductServiceTest.php b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductServiceTest.php index 538c0b0ee5fac..ccfebef96223c 100644 --- a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductServiceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductServiceTest.php @@ -225,8 +225,6 @@ public function testUpdateBundleAddSelection() public function testUpdateBundleAddAndDeleteOption() { $bundleProduct = $this->createDynamicBundleProduct(); - $linkedProductPrice = 20; - $bundleProductOptions = $this->getBundleProductOptions($bundleProduct); $oldOptionId = $bundleProductOptions[0]['option_id']; @@ -239,7 +237,7 @@ public function testUpdateBundleAddAndDeleteOption() [ 'sku' => 'simple2', 'qty' => 2, - "price" => $linkedProductPrice, + "price" => 20, "price_type" => 1, "is_default" => false, ], @@ -250,6 +248,7 @@ public function testUpdateBundleAddAndDeleteOption() $updatedProduct = $this->getProduct(self::BUNDLE_PRODUCT_ID); $bundleOptions = $this->getBundleProductOptions($updatedProduct); + $simpleProduct = $this->getProduct('simple2'); $this->assertEquals('new option', $bundleOptions[0]['title']); $this->assertTrue($bundleOptions[0]['required']); $this->assertEquals('select', $bundleOptions[0]['type']); @@ -257,7 +256,43 @@ public function testUpdateBundleAddAndDeleteOption() $this->assertFalse(isset($bundleOptions[1])); $this->assertEquals('simple2', $bundleOptions[0]['product_links'][0]['sku']); $this->assertEquals(2, $bundleOptions[0]['product_links'][0]['qty']); - $this->assertEquals($linkedProductPrice, $bundleOptions[0]['product_links'][0]['price']); + $this->assertEquals($simpleProduct['price'], $bundleOptions[0]['product_links'][0]['price']); + } + + /** + * @magentoApiDataFixture Magento/Catalog/_files/products_new.php + * @magentoApiDataFixture Magento/Catalog/_files/second_product_simple.php + */ + public function testUpdateFixedPriceBundleProductOptionSelectionPrice() + { + $optionPrice = 20; + $bundleProduct = $this->createFixedPriceBundleProduct(); + $bundleProductOptions = $this->getBundleProductOptions($bundleProduct); + + $oldOptionId = $bundleProductOptions[0]['option_id']; + //replace current option with a new option + $bundleProductOptions[0] = [ + 'title' => 'new option', + 'required' => true, + 'type' => 'select', + 'product_links' => [ + [ + 'sku' => 'simple2', + 'qty' => 2, + "price" => $optionPrice, + "price_type" => 1, + "is_default" => false, + ], + ], + ]; + $this->setBundleProductOptions($bundleProduct, $bundleProductOptions); + $this->saveProduct($bundleProduct); + + $updatedProduct = $this->getProduct(self::BUNDLE_PRODUCT_ID); + $bundleOptions = $this->getBundleProductOptions($updatedProduct); + $this->assertEquals('simple2', $bundleOptions[0]['product_links'][0]['sku']); + $this->assertEquals(2, $bundleOptions[0]['product_links'][0]['qty']); + $this->assertEquals($optionPrice, $bundleOptions[0]['product_links'][0]['price']); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php index e431d3f912288..0828b2e74e782 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php @@ -301,13 +301,15 @@ public function testUpdate() /** * @param string $optionType - * + * @param bool $includedExisting + * @param int $expectedOptionValuesCount + * @throws \Magento\Framework\Exception\NoSuchEntityException * @magentoApiDataFixture Magento/Catalog/_files/product_with_options.php * @magentoAppIsolation enabled * @dataProvider validOptionDataProvider * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ - public function testUpdateOptionAddingNewValue($optionType) + public function testUpdateOptionAddingNewValue($optionType, $includedExisting, $expectedOptionValuesCount) { $fixtureOption = null; $valueData = [ @@ -334,17 +336,21 @@ public function testUpdateOptionAddingNewValue($optionType) } $values = []; - foreach ($option->getValues() as $key => $value) { - $values[] = - [ - 'price' => $value->getPrice(), - 'price_type' => $value->getPriceType(), - 'sku' => $value->getSku(), - 'title' => $value->getTitle(), - 'sort_order' => $value->getSortOrder(), - ]; - } $values[] = $valueData; + // Keeps the existing Option Values when adding a new Option Value + if ($includedExisting) { + foreach ($option->getValues() as $key => $value) { + $values[] = + [ + 'price' => $value->getPrice(), + 'price_type' => $value->getPriceType(), + 'sku' => $value->getSku(), + 'title' => $value->getTitle(), + 'sort_order' => $value->getSortOrder(), + ]; + } + } + $data = [ 'product_sku' => $option->getProductSku(), 'title' => $option->getTitle(), @@ -375,21 +381,31 @@ public function testUpdateOptionAddingNewValue($optionType) $valueObject = $this->_webApiCall($serviceInfo, ['option' => $data]); } - $values = end($valueObject['values']); + $values = reset($valueObject['values']); $this->assertEquals($valueData['price'], $values['price']); $this->assertEquals($valueData['price_type'], $values['price_type']); $this->assertEquals($valueData['sku'], $values['sku']); $this->assertEquals('New Option Title', $values['title']); $this->assertEquals(100, $values['sort_order']); + + $product = $productRepository->get('simple', false, null, true); + // Assert correct number of Option Values after Option is updated + foreach ($product->getOptions() as $option) { + if ($option->getId() === $fixtureOption->getId()) { + $this->assertEquals($expectedOptionValuesCount, count($option->getValues())); + } + } } public function validOptionDataProvider() { return [ - 'drop_down' => ['drop_down'], - 'checkbox' => ['checkbox'], - 'radio' => ['radio'], - 'multiple' => ['multiple'] + 'drop_down including previous values' => ['drop_down', true, 3], + 'drop_down with new value only' => ['drop_down', false, 1], + 'checkbox including previous values' => ['checkbox', true, 3], + 'checkbox with new value only' => ['checkbox', false, 1], + 'radio including previous values' => ['radio', true, 3], + 'multiple with new value only' => ['multiple', false, 1], ]; } diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkRepositoryInterfaceTest.php index 94c2b74e8ea96..b10018aa07332 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkRepositoryInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkRepositoryInterfaceTest.php @@ -4,100 +4,175 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Catalog\Api; +use Magento\Catalog\Model\ProductLink\Link; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Webapi\Rest\Request; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\WebapiAbstract; +/** + * Class checks product relations functionality + * + * @see \Magento\Catalog\Api\ProductLinkRepositoryInterface + */ class ProductLinkRepositoryInterfaceTest extends WebapiAbstract { + /** + * @var string + */ const SERVICE_NAME = 'catalogProductLinkRepositoryV1'; + + /** + * @var string + */ const SERVICE_VERSION = 'V1'; + + /** + * @var string + */ const RESOURCE_PATH = '/V1/products/'; /** - * @var \Magento\Framework\ObjectManagerInterface + * @var ObjectManagerInterface */ - protected $objectManager; + private $objectManager; + /** + * @var ProductLinkManagementInterface + */ + private $linkManagement; + + /** + * @inheritdoc + */ protected function setUp(): void { + parent::setUp(); + $this->objectManager = Bootstrap::getObjectManager(); + $this->linkManagement = $this->objectManager->get(ProductLinkManagementInterface::class); } /** * @magentoApiDataFixture Magento/Catalog/_files/products_related_multiple.php - * @magentoAppIsolation enabled + * + * @return void */ - public function testDelete() + public function testDelete(): void { $productSku = 'simple_with_cross'; - $linkedSku = 'simple'; $linkType = 'related'; - $this->_webApiCall( - [ - 'rest' => [ - 'resourcePath' => self::RESOURCE_PATH . $productSku . '/links/' . $linkType . '/' . $linkedSku, - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_DELETE, - ], - 'soap' => [ - 'service' => self::SERVICE_NAME, - 'serviceVersion' => self::SERVICE_VERSION, - 'operation' => self::SERVICE_NAME . 'DeleteById', - ], - ], - [ - 'sku' => $productSku, - 'type' => $linkType, - 'linkedProductSku' => $linkedSku - ] - ); - /** @var \Magento\Catalog\Model\ProductLink\Management $linkManagement */ - $linkManagement = $this->objectManager->create(\Magento\Catalog\Api\ProductLinkManagementInterface::class); - $linkedProducts = $linkManagement->getLinkedItemsByType($productSku, $linkType); + $this->deleteApiCall($productSku, $linkType, 'simple'); + $linkedProducts = $this->linkManagement->getLinkedItemsByType($productSku, $linkType); $this->assertCount(1, $linkedProducts); - /** @var \Magento\Catalog\Api\Data\ProductLinkInterface $product */ $product = current($linkedProducts); - $this->assertEquals($product->getLinkedProductSku(), 'simple_with_cross_two'); + $this->assertEquals('simple_with_cross_two', $product->getLinkedProductSku()); + } + + /** + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + * + * @return void + */ + public function testDeleteNotExistedProductLink(): void + { + $this->expectException(\Exception::class); + $this->expectExceptionMessage((string)__("Product %1 doesn't have linked %2 as %3")); + $this->deleteApiCall('simple', 'related', 'not_exists_product'); } /** * @magentoApiDataFixture Magento/Catalog/_files/products_related.php + * + * @return void */ - public function testSave() + public function testSave(): void { $productSku = 'simple_with_cross'; $linkType = 'related'; + $data = [ + 'entity' => [ + Link::KEY_SKU => 'simple_with_cross', + Link::KEY_LINK_TYPE => 'related', + Link::KEY_LINKED_PRODUCT_SKU => 'simple', + Link::KEY_LINKED_PRODUCT_TYPE => 'simple', + Link::KEY_POSITION => 1000, + ], + ]; + $this->saveApiCall($productSku, $data); + $actual = $this->linkManagement->getLinkedItemsByType($productSku, $linkType); + $this->assertCount(1, $actual, 'Invalid actual linked products count'); + $this->assertEquals(1000, $actual[0]->getPosition(), 'Product position is not updated'); + } - $serviceInfo = [ + /** + * Get service info for api call + * + * @param string $resourcePath + * @param string $httpMethod + * @param string $operation + * @return array + */ + private function getServiceInfo(string $resourcePath, string $httpMethod, string $operation): array + { + return [ 'rest' => [ - 'resourcePath' => self::RESOURCE_PATH . $productSku . '/links', - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_PUT, + 'resourcePath' => self::RESOURCE_PATH . $resourcePath, + 'httpMethod' => $httpMethod, ], 'soap' => [ 'service' => self::SERVICE_NAME, 'serviceVersion' => self::SERVICE_VERSION, - 'operation' => self::SERVICE_NAME . 'Save', + 'operation' => self::SERVICE_NAME . $operation, ], ]; + } - $this->_webApiCall( + /** + * Make api call to delete product link + * + * @param string $productSku + * @param string $linkType + * @param string $linkedSku + * @return array|int|string|float|bool + */ + private function deleteApiCall(string $productSku, string $linkType, string $linkedSku) + { + $serviceInfo = $this->getServiceInfo( + $productSku . '/links/' . $linkType . '/' . $linkedSku, + Request::HTTP_METHOD_DELETE, + 'DeleteById' + ); + + return $this->_webApiCall( $serviceInfo, [ - 'entity' => [ - 'sku' => 'simple_with_cross', - 'link_type' => 'related', - 'linked_product_sku' => 'simple', - 'linked_product_type' => 'simple', - 'position' => 1000, - ] + 'sku' => $productSku, + 'type' => $linkType, + 'linkedProductSku' => $linkedSku, ] ); + } - /** @var \Magento\Catalog\Model\ProductLink\Management $linkManagement */ - $linkManagement = $this->objectManager->get(\Magento\Catalog\Api\ProductLinkManagementInterface::class); - $actual = $linkManagement->getLinkedItemsByType($productSku, $linkType); - $this->assertCount(1, $actual, 'Invalid actual linked products count'); - $this->assertEquals(1000, $actual[0]->getPosition(), 'Product position is not updated'); + /** + * Make api call to save product link + * + * @param string $productSku + * @param array $data + * @return array|bool|float|int|string + */ + private function saveApiCall(string $productSku, array $data) + { + $serviceInfo = $this->getServiceInfo( + $productSku . '/links', + Request::HTTP_METHOD_PUT, + 'Save' + ); + + return $this->_webApiCall($serviceInfo, $data); } } diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php index 0f12a7aad9cfc..db11048716742 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php @@ -11,6 +11,7 @@ use Magento\Authorization\Model\Role; use Magento\Authorization\Model\RoleFactory; use Magento\Authorization\Model\Rules; +use Magento\UrlRewrite\Model\ResourceModel\UrlRewriteCollectionFactory; use Magento\Authorization\Model\RulesFactory; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Model\ResourceModel\Product\Gallery; @@ -34,6 +35,7 @@ use Magento\Store\Model\WebsiteRepository; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\WebapiAbstract; +use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; /** * Test for \Magento\Catalog\Api\ProductRepositoryInterface @@ -84,11 +86,17 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract * @var AdminTokenServiceInterface */ private $adminTokens; + /** * @var array */ private $fixtureProducts = []; + /** + * @var UrlRewriteCollectionFactory + */ + private $urlRewriteCollectionFactory; + /** * @inheritDoc */ @@ -96,11 +104,13 @@ protected function setUp(): void { parent::setUp(); - $this->roleFactory = Bootstrap::getObjectManager()->get(RoleFactory::class); - $this->rulesFactory = Bootstrap::getObjectManager()->get(RulesFactory::class); - $this->adminTokens = Bootstrap::getObjectManager()->get(AdminTokenServiceInterface::class); + $objectManager = Bootstrap::getObjectManager(); + $this->roleFactory = $objectManager->get(RoleFactory::class); + $this->rulesFactory = $objectManager->get(RulesFactory::class); + $this->adminTokens = $objectManager->get(AdminTokenServiceInterface::class); + $this->urlRewriteCollectionFactory = $objectManager->get(UrlRewriteCollectionFactory::class); /** @var DomainManagerInterface $domainManager */ - $domainManager = Bootstrap::getObjectManager()->get(DomainManagerInterface::class); + $domainManager = $objectManager->get(DomainManagerInterface::class); $domainManager->addDomains(['example.com']); } @@ -2156,6 +2166,32 @@ public function testUpdateProductWithMediaGallery(): void $this->assertEquals($img2, $imageRolesPerStore[$defaultScope]['thumbnail']); } + /** + * Update url_key attribute and check it in url_rewrite collection + * + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + * @magentoConfigFixture default_store general/single_store_mode/enabled 1 + * + * @return void + */ + public function testUpdateUrlKeyAttribute(): void + { + $newUrlKey = 'my-new-url'; + + $productData = [ + ProductInterface::SKU => 'simple', + 'custom_attributes' => [['attribute_code' => 'url_key', 'value' => $newUrlKey]], + ]; + + $this->updateProduct($productData); + + $urlRewriteCollection = $this->urlRewriteCollectionFactory->create(); + $urlRewriteCollection->addFieldToFilter(UrlRewrite::ENTITY_TYPE, 'product') + ->addFieldToFilter('request_path', $newUrlKey . '.html'); + + $this->assertCount(1, $urlRewriteCollection); + } + /** * @return string */ diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryMultiWebsiteTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryMultiWebsiteTest.php index 9c8ca40a0c8f3..fdc81cf5e3ee2 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryMultiWebsiteTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryMultiWebsiteTest.php @@ -8,6 +8,7 @@ namespace Magento\Catalog\Api; use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface; use Magento\Store\Model\Store; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\WebapiAbstract; @@ -193,4 +194,191 @@ public function testProductDefaultValuesWithTwoWebsites(): void $storeId )); } + + /** + * @magentoApiDataFixture Magento/Store/_files/second_website_with_two_stores.php + * @magentoApiDataFixture Magento/Catalog/_files/product_text_attribute.php + * @magentoApiDataFixture Magento/Catalog/_files/product_varchar_attribute.php + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testPartialUpdate(): void + { + $this->_markTestAsRestOnly( + 'Test skipped due to known issue with SOAP. NULL value is cast to corresponding attribute type.' + ); + $sku = 'api_test_update_product'; + $store = $this->objectManager->get(Store::class); + $storeId = (int) $store->load('fixture_third_store', 'code')->getId(); + $this->updateAttribute('varchar_attribute', ['is_global' => ScopedAttributeInterface::SCOPE_STORE]); + $this->updateAttribute('text_attribute', ['is_global' => ScopedAttributeInterface::SCOPE_STORE]); + $request1 = [ + ProductInterface::SKU => $sku, + ProductInterface::NAME => 'Test 1', + ProductInterface::ATTRIBUTE_SET_ID => 4, + ProductInterface::PRICE => 10, + ProductInterface::STATUS => 1, + ProductInterface::VISIBILITY => 4, + ProductInterface::TYPE_ID => 'simple', + ProductInterface::WEIGHT => 100, + ProductInterface::CUSTOM_ATTRIBUTES => [ + [ + 'attribute_code' => 'varchar_attribute', + 'value' => 'api_test_value_varchar', + ], + [ + 'attribute_code' => 'text_attribute', + 'value' => 'api_test_value_text', + ] + ], + ]; + $response = $this->saveProduct($request1, 'all'); + $this->assertResponse($request1, $response); + $this->fixtureProducts[] = $sku; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($sku); + $request2 = [ + ProductInterface::SKU => $sku, + ProductInterface::CUSTOM_ATTRIBUTES => [ + [ + 'attribute_code' => 'varchar_attribute', + 'value' => 'api_test_value_varchar_changed', + ] + ], + ]; + $response2 = $this->saveProduct($request2, 'fixture_third_store'); + $expected = [ + 'varchar_attribute' => 'api_test_value_varchar_changed', + 'text_attribute' => 'api_test_value_text' + ]; + $this->assertResponse( + array_merge($request1, $expected), + $response2 + ); + $this->assertOverriddenValues( + [ + 'visibility' => false, + 'tax_class_id' => false, + 'status' => false, + 'name' => false, + 'varchar_attribute' => true, + 'text_attribute' => false, + ], + $product, + $storeId + ); + $request3 = [ + ProductInterface::SKU => $sku, + ProductInterface::CUSTOM_ATTRIBUTES => [ + [ + 'attribute_code' => 'text_attribute', + 'value' => 'api_test_value_text_changed', + ] + ], + ]; + $response3 = $this->saveProduct($request3, 'fixture_third_store'); + $expected = [ + 'varchar_attribute' => 'api_test_value_varchar_changed', + 'text_attribute' => 'api_test_value_text_changed' + ]; + $this->assertResponse( + array_merge($request1, $expected), + $response3 + ); + $this->assertOverriddenValues( + [ + 'visibility' => false, + 'tax_class_id' => false, + 'status' => false, + 'name' => false, + 'varchar_attribute' => true, + 'text_attribute' => true, + ], + $product, + $storeId + ); + $request4 = [ + ProductInterface::SKU => $sku, + ProductInterface::CUSTOM_ATTRIBUTES => [ + [ + 'attribute_code' => 'text_attribute', + 'value' => null, + ] + ], + ]; + $response4 = $this->saveProduct($request4, 'fixture_third_store'); + $expected = [ + 'varchar_attribute' => 'api_test_value_varchar_changed', + 'text_attribute' => 'api_test_value_text' + ]; + $this->assertResponse( + array_merge($request1, $expected), + $response4 + ); + $this->assertOverriddenValues( + [ + 'visibility' => false, + 'tax_class_id' => false, + 'status' => false, + 'name' => false, + 'varchar_attribute' => true, + 'text_attribute' => false, + ], + $product, + $storeId + ); + } + + /** + * @param array $expected + * @param array $actual + */ + private function assertResponse(array $expected, array $actual): void + { + $customAttributes = $expected[ProductInterface::CUSTOM_ATTRIBUTES] ?? []; + unset($expected[ProductInterface::CUSTOM_ATTRIBUTES]); + $expected = array_merge(array_column($customAttributes, 'value', 'attribute_code'), $expected); + + $customAttributes = $actual[ProductInterface::CUSTOM_ATTRIBUTES] ?? []; + unset($actual[ProductInterface::CUSTOM_ATTRIBUTES]); + $actual = array_merge(array_column($customAttributes, 'value', 'attribute_code'), $actual); + + $this->assertEquals($expected, array_intersect_key($actual, $expected)); + } + + /** + * @param Product $product + * @param array $expected + * @param int $storeId + */ + private function assertOverriddenValues(array $expected, Product $product, int $storeId): void + { + /** @var ScopeOverriddenValue $scopeOverriddenValue */ + $scopeOverriddenValue = $this->objectManager->create(ScopeOverriddenValue::class); + $actual = []; + foreach (array_keys($expected) as $attribute) { + $actual[$attribute] = $scopeOverriddenValue->containsValue( + ProductInterface::class, + $product, + $attribute, + $storeId + ); + } + $this->assertEquals($expected, $actual); + } + + /** + * Update attribute + * + * @param string $code + * @param array $data + * @return void + */ + private function updateAttribute(string $code, array $data): void + { + $attributeRepository = $this->objectManager->create(ProductAttributeRepositoryInterface::class); + $attribute = $attributeRepository->get($code); + $attribute->addData($data); + $attributeRepository->save($attribute); + } } diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/SpecialPriceStorageTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/SpecialPriceStorageTest.php index 90fe075f91e30..a1e338fc304db 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/SpecialPriceStorageTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/SpecialPriceStorageTest.php @@ -6,17 +6,20 @@ namespace Magento\Catalog\Api; use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\ResourceModel\Product as ProductResource; use Magento\Framework\Exception\CouldNotSaveException; use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Exception\StateException; use Magento\Framework\Webapi\Rest\Request; +use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\WebapiAbstract; /** * SpecialPriceStorage API operations test + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class SpecialPriceStorageTest extends WebapiAbstract { @@ -24,6 +27,7 @@ class SpecialPriceStorageTest extends WebapiAbstract const SERVICE_VERSION = 'V1'; const SIMPLE_PRODUCT_SKU = 'simple'; const VIRTUAL_PRODUCT_SKU = 'virtual-product'; + private const PRODUCT_SKU_TWO_WEBSITES = 'simple-on-two-websites'; /** * @var ObjectManager @@ -31,11 +35,23 @@ class SpecialPriceStorageTest extends WebapiAbstract private $objectManager; /** - * Set up. + * @var ProductResource + */ + private $productResource; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @ingeritdoc */ protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); + $this->productResource = $this->objectManager->get(ProductResource::class); + $this->storeManager = $this->objectManager->get(StoreManagerInterface::class); } /** @@ -128,6 +144,49 @@ public function testUpdate(array $data) $this->assertEmpty($response); } + /** + * Delete special price for specified store when price scope is global + * + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + * + * @return void + */ + public function testDeleteWhenPriceIsGlobal(): void + { + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => '/V1/products/special-price-delete', + 'httpMethod' => Request::HTTP_METHOD_POST + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Delete', + ], + ]; + + $response = $this->_webApiCall( + $serviceInfo, + [ + 'prices' => [ + [ + 'price' => 777, + 'store_id' => 1, + 'sku' => self::SIMPLE_PRODUCT_SKU, + 'price_from' => '2037-01-19 03:14:07', + 'price_to' => '2038-01-19 03:14:07' + ] + ] + ] + ); + + $errorMessage = current(array_column($response, 'message')); + $this->assertStringContainsString( + 'Could not change non global Price when price scope is global.', + $errorMessage + ); + } + /** * Test delete method. * @@ -241,4 +300,60 @@ public function deleteData(): array ], ]; } + + /** + * Test delete method for specific store. + * + * @magentoApiDataFixture Magento/Catalog/_files/product_two_websites.php + * @magentoConfigFixture default_store catalog/price/scope 1 + * @return void + */ + public function testDeleteDataForSpecificStore(): void + { + $secondStoreViewId = $this->storeManager->getStore('fixture_second_store') + ->getId(); + + $data = [ + 'price' => 777, + 'store_id' => $secondStoreViewId, + 'sku' => self::PRODUCT_SKU_TWO_WEBSITES, + 'price_from' => '1970-01-01 00:00:01', + 'price_to' => false + ]; + + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $product = $productRepository->get($data['sku'], true, 1, true); + $product->setData('special_price', $data['price']); + $product->setData('special_from_date', $data['price_from']); + + $this->productResource->saveAttribute($product, 'special_price'); + $this->productResource->saveAttribute($product, 'special_from_date'); + $this->productResource->saveAttribute($product, 'special_to_date'); + + $product->setData('store_id', $secondStoreViewId); + $this->productResource->saveAttribute($product, 'special_price'); + $this->productResource->saveAttribute($product, 'special_from_date'); + $this->productResource->saveAttribute($product, 'special_to_date'); + + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => '/V1/products/special-price-delete', + 'httpMethod' => Request::HTTP_METHOD_POST + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Delete', + ], + ]; + + $this->_webApiCall($serviceInfo, ['prices' => [$data]]); + + $product = $productRepository->get($data['sku'], false, 1, true); + $this->assertNotNull($product->getSpecialPrice()); + + $product = $productRepository->get($data['sku'], false, $secondStoreViewId, true); + $this->assertNull($product->getSpecialPrice()); + } } diff --git a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php index e2105166a4634..fae2e4c505869 100644 --- a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php +++ b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php @@ -4,6 +4,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\ConfigurableProduct\Api; use Magento\Catalog\Model\ResourceModel\Eav\Attribute; @@ -43,8 +45,10 @@ protected function setUp(): void /** * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * + * @return void */ - public function testGetChildren() + public function testGetChildren(): void { $productSku = 'configurable'; @@ -72,8 +76,10 @@ public function testGetChildren() * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_simple_77.php * @magentoApiDataFixture Magento/ConfigurableProduct/_files/delete_association.php + * + * @return void */ - public function testAddChild() + public function testAddChild(): void { $productSku = 'configurable'; $childSku = 'simple_77'; @@ -85,8 +91,10 @@ public function testAddChild() * Test the full flow of creating a configurable product and adding a child via REST * * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_attribute.php + * + * @return void */ - public function testAddChildFullRestCreation() + public function testAddChildFullRestCreation(): void { $productSku = 'configurable-product-sku'; $childSku = 'simple-product-sku'; @@ -96,7 +104,7 @@ public function testAddChildFullRestCreation() $this->addOptionToConfigurableProduct( $productSku, - $attribute->getAttributeId(), + (int)$attribute->getAttributeId(), [ [ 'value_index' => $attribute->getOptions()[1]->getValue() @@ -139,8 +147,10 @@ public function testAddChildFullRestCreation() * configurable product. * * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_attributes_for_position_test.php + * + * @return void */ - public function testConfigurableOptionPositionPreservation() + public function testConfigurableOptionPositionPreservation(): void { $productSku = 'configurable-product-sku'; $childProductSkus = [ @@ -160,7 +170,7 @@ public function testConfigurableOptionPositionPreservation() /** @var Attribute $attribute */ $attribute = $this->attributeRepository->get('catalog_product', $attributeToAdd); - /** @var Option $options[] */ + /** @var Option $options [] */ $options = $attribute->getOptions(); array_shift($options); @@ -168,11 +178,11 @@ public function testConfigurableOptionPositionPreservation() $valueIndexesData = []; foreach ($options as $option) { - $valueIndexesData []['value_index']= $option->getValue(); + $valueIndexesData[]['value_index'] = $option->getValue(); } $this->addOptionToConfigurableProduct( $productSku, - $attribute->getAttributeId(), + (int)$attribute->getAttributeId(), $valueIndexesData, $position ); @@ -284,7 +294,14 @@ protected function getConfigurableAttribute(string $productSku): array return $this->_webApiCall($serviceInfo, ['sku' => $productSku]); } - private function addChild($productSku, $childSku) + /** + * Perform add child product Api call + * + * @param string $productSku + * @param string $childSku + * @return array|int|string|float|bool + */ + private function addChild(string $productSku, string $childSku) { $serviceInfo = [ 'rest' => [ @@ -300,7 +317,13 @@ private function addChild($productSku, $childSku) return $this->_webApiCall($serviceInfo, ['sku' => $productSku, 'childSku' => $childSku]); } - protected function createConfigurableProduct($productSku) + /** + * Perform create configurable product api call + * + * @param string $productSku + * @return array|bool|float|int|string + */ + protected function createConfigurableProduct(string $productSku) { $requestData = [ 'product' => [ @@ -325,8 +348,21 @@ protected function createConfigurableProduct($productSku) return $this->_webApiCall($serviceInfo, $requestData); } - protected function addOptionToConfigurableProduct($productSku, $attributeId, $attributeValues, $position = 0) - { + /** + * Add option to configurable product + * + * @param string $productSku + * @param int $attributeId + * @param array $attributeValues + * @param int $position + * @return array|bool|float|int|string + */ + protected function addOptionToConfigurableProduct( + string $productSku, + int $attributeId, + array $attributeValues, + int $position = 0 + ) { $requestData = [ 'sku' => $productSku, 'option' => [ @@ -339,7 +375,7 @@ protected function addOptionToConfigurableProduct($productSku, $attributeId, $at ]; $serviceInfo = [ 'rest' => [ - 'resourcePath' => '/V1/configurable-products/'. $productSku .'/options', + 'resourcePath' => '/V1/configurable-products/' . $productSku . '/options', 'httpMethod' => Request::HTTP_METHOD_POST, ], 'soap' => [ @@ -381,15 +417,67 @@ protected function createSimpleProduct($sku, $customAttributes) /** * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * + * @return void */ - public function testRemoveChild() + public function testRemoveChild(): void { $productSku = 'configurable'; $childSku = 'simple_10'; $this->assertTrue($this->removeChild($productSku, $childSku)); } - protected function removeChild($productSku, $childSku) + /** + * @dataProvider errorsDataProvider + * + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * @magentoApiDataFixture Magento/Catalog/_files/second_product_simple.php + * + * @param string $parentSku + * @param string $childSku + * @param string $errorMessage + * @return void + */ + public function testAddChildWithError(string $parentSku, string $childSku, string $errorMessage): void + { + $this->expectException(\Exception::class); + $this->expectExceptionMessage($errorMessage); + $this->addChild($parentSku, $childSku); + } + + /** + * @return array + */ + public function errorsDataProvider(): array + { + return [ + 'simple_instead_of_configurable' => [ + 'parent_sku' => 'simple2', + 'child_sku' => 'configurable', + 'error_message' => (string)__("The parent product doesn't have configurable product options."), + ], + 'simple_with_empty_configurable_attribute_value' => [ + 'parent_sku' => 'configurable', + 'child_sku' => 'simple2', + 'error_message' => TESTS_WEB_API_ADAPTER === self::ADAPTER_SOAP + ? (string)__( + 'The child product doesn\'t have the "%1" attribute value. Verify the value and try again.' + ) + : (string)__( + 'The child product doesn\'t have the \\"%1\\" attribute value. Verify the value and try again.' + ), + ], + ]; + } + + /** + * Remove child product + * + * @param string $productSku + * @param string $childSku + * @return array|bool|float|int|string + */ + protected function removeChild(string $productSku, string $childSku) { $resourcePath = self::RESOURCE_PATH . '/%s/children/%s'; $serviceInfo = [ @@ -408,14 +496,16 @@ protected function removeChild($productSku, $childSku) } /** + * Get child products + * * @param string $productSku * @return string[] */ - protected function getChildren($productSku) + protected function getChildren(string $productSku) { $serviceInfo = [ 'rest' => [ - 'resourcePath' => self::RESOURCE_PATH . '/' . $productSku . '/children', + 'resourcePath' => self::RESOURCE_PATH . '/' . $productSku . '/children', 'httpMethod' => Request::HTTP_METHOD_GET ], 'soap' => [ diff --git a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php index e2ed80edd0415..43cc4ca8b1441 100644 --- a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php @@ -4,6 +4,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\ConfigurableProduct\Api; @@ -21,8 +22,10 @@ class OptionRepositoryTest extends \Magento\TestFramework\TestCase\WebapiAbstrac /** * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * + * @return void */ - public function testGet() + public function testGet(): void { $productSku = 'configurable'; @@ -54,8 +57,10 @@ public function testGet() /** * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * + * @return void */ - public function testGetList() + public function testGetList(): void { $productSku = 'configurable'; @@ -90,8 +95,9 @@ public function testGetList() } /** + * @return void */ - public function testGetUndefinedProduct() + public function testGetUndefinedProduct(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage( @@ -104,8 +110,10 @@ public function testGetUndefinedProduct() /** * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * + * @return void */ - public function testGetUndefinedOption() + public function testGetUndefinedOption(): void { $expectedMessage = 'The "%1" entity that was requested doesn\'t exist. Verify the entity and try again.'; $productSku = 'configurable'; @@ -127,8 +135,10 @@ public function testGetUndefinedOption() /** * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * + * @return void */ - public function testDelete() + public function testDelete(): void { $productSku = 'configurable'; @@ -144,8 +154,10 @@ public function testDelete() /** * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_attribute.php + * + * @return void */ - public function testAdd() + public function testAdd(): void { /** @var AttributeRepositoryInterface $attributeRepository */ $attributeRepository = Bootstrap::getObjectManager()->create(AttributeRepositoryInterface::class); @@ -181,8 +193,10 @@ public function testAdd() /** * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * + * @return void */ - public function testUpdate() + public function testUpdate(): void { $productSku = 'configurable'; $configurableAttribute = $this->getConfigurableAttribute($productSku); @@ -218,8 +232,10 @@ public function testUpdate() /** * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * + * @return void */ - public function testUpdateWithoutOptionId() + public function testUpdateWithoutOptionId(): void { $productSku = 'configurable'; /** @var AttributeRepositoryInterface $attributeRepository */ @@ -257,6 +273,19 @@ public function testUpdateWithoutOptionId() $this->assertEquals($option['label'], $configurableAttribute[0]['label']); } + /** + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * + * @return void + */ + public function testDeleteNotExistsOption(): void + { + $message = (string)__('The option that was requested doesn\'t exist. Verify the entity and try again.'); + $this->expectExceptionMessage($message); + $this->expectException(\Exception::class); + $this->delete('configurable', 555); + } + /** * @param string $productSku * @return array diff --git a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/ProductRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/ProductRepositoryTest.php index 069944c8c35a9..e1fdf4a1a42f6 100644 --- a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/ProductRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/ProductRepositoryTest.php @@ -3,18 +3,19 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\ConfigurableProduct\Api; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Entity\Attribute; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable; use Magento\Eav\Model\Config; use Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection; use Magento\Framework\Api\ExtensibleDataInterface; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Webapi\Rest\Request; use Magento\TestFramework\Helper\Bootstrap; -use Magento\ConfigurableProduct\Model\Product\Type\Configurable; use Magento\TestFramework\TestCase\WebapiAbstract; /** @@ -102,18 +103,18 @@ protected function createConfigurableProduct() $configurableProductOptions = [ [ - "attribute_id" => $this->configurableAttribute->getId(), + "attribute_id" => $this->configurableAttribute->getId(), "label" => $label, "position" => 0, "values" => [ [ - "value_index" => $options[0]['option_id'], + "value_index" => $options[0]['option_id'], ], [ - "value_index" => $options[1]['option_id'], - ] + "value_index" => $options[1]['option_id'], + ], ], - ] + ], ]; $product = [ @@ -173,6 +174,20 @@ public function testCreateConfigurableProduct() $this->assertEquals([$productId1, $productId2], $resultConfigurableProductLinks); } + /** + * Verify configurable product creation passes validation with required attribute not specified in product itself. + * + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + */ + public function testCreateConfigurableProductWithRequiredAttribute(): void + { + $configurableAttribute = $this->eavConfig->getAttribute('catalog_product', 'test_configurable'); + $configurableAttribute->setIsRequired(true); + $configurableAttribute->save(); + $response = $this->createConfigurableProductWithRequiredAttribute(); + $this->assertEquals(self::CONFIGURABLE_PRODUCT_SKU, $response[ProductInterface::SKU]); + } + /** * Create configurable with simple which has zero attribute value * @@ -340,10 +355,10 @@ public function testUpdateConfigurableProductLinks() = [$productId1, $productId2]; //set the value for required attribute $response["custom_attributes"][] = - [ - "attribute_code" => $this->configurableAttribute->getAttributeCode(), - "value" => $resultConfigurableProductOptions[0]['values'][0]['value_index'], - ]; + [ + "attribute_code" => $this->configurableAttribute->getAttributeCode(), + "value" => $resultConfigurableProductOptions[0]['values'][0]['value_index'], + ]; $response = $this->saveProduct($response); @@ -364,7 +379,8 @@ public function testUpdateConfigurableProductLinksWithNonExistingProduct() //leave existing option untouched unset($response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]['configurable_product_options']); $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]['configurable_product_links'] = [ - $productId1, $nonExistingId + $productId1, + $nonExistingId, ]; $expectedMessage = 'The product that was requested doesn\'t exist. Verify the product and try again.'; @@ -400,14 +416,15 @@ public function testUpdateConfigurableProductLinksWithDuplicateAttributes() [ 'attribute_code' => 'test_configurable', 'value' => $optionValue1, - ] + ], ]; $this->saveProduct($product2); //leave existing option untouched unset($response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]['configurable_product_options']); $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]['configurable_product_links'] = [ - $productId1, $productId2 + $productId1, + $productId2, ]; $expectedMessage = 'Products "%1" and "%2" have the same set of attribute values.'; @@ -440,7 +457,8 @@ public function testUpdateConfigurableProductLinksWithWithoutVariationAttributes /** delete all variation attribute */ $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]['configurable_product_options'] = []; $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]['configurable_product_links'] = [ - $productId1, $productId2 + $productId1, + $productId2, ]; $expectedMessage = 'The product that was requested doesn\'t exist. Verify the product and try again.'; @@ -496,7 +514,7 @@ protected function createProduct($product) $serviceInfo = [ 'rest' => [ 'resourcePath' => self::RESOURCE_PATH, - 'httpMethod' => Request::HTTP_METHOD_POST + 'httpMethod' => Request::HTTP_METHOD_POST, ], 'soap' => [ 'service' => self::SERVICE_NAME, @@ -521,7 +539,7 @@ protected function deleteProductBySku($productSku) $serviceInfo = [ 'rest' => [ 'resourcePath' => $resourcePath, - 'httpMethod' => Request::HTTP_METHOD_DELETE + 'httpMethod' => Request::HTTP_METHOD_DELETE, ], 'soap' => [ 'service' => self::SERVICE_NAME, @@ -544,7 +562,7 @@ protected function saveProduct($product) { if (isset($product['custom_attributes'])) { $count = count($product['custom_attributes']); - for ($i=0; $i < $count; $i++) { + for ($i = 0; $i < $count; $i++) { if ($product['custom_attributes'][$i]['attribute_code'] == 'category_ids' && !is_array($product['custom_attributes'][$i]['value']) ) { @@ -556,7 +574,7 @@ protected function saveProduct($product) $serviceInfo = [ 'rest' => [ 'resourcePath' => $resourcePath, - 'httpMethod' => Request::HTTP_METHOD_PUT + 'httpMethod' => Request::HTTP_METHOD_PUT, ], 'soap' => [ 'service' => self::SERVICE_NAME, @@ -568,4 +586,43 @@ protected function saveProduct($product) $response = $this->_webApiCall($serviceInfo, $requestData); return $response; } + + /** + * Create configurable product with required attribute by web api. + * + * @return array + */ + private function createConfigurableProductWithRequiredAttribute(): array + { + $this->configurableAttribute = $this->eavConfig->getAttribute('catalog_product', 'test_configurable'); + $options = $this->getConfigurableAttributeOptions(); + $configurableProductOptions = [ + [ + "attribute_id" => $this->configurableAttribute->getId(), + "label" => 'color', + "position" => 0, + "values" => [ + [ + "value_index" => $options[0]['option_id'], + ], + [ + "value_index" => $options[1]['option_id'], + ], + ], + ], + ]; + $product = [ + "sku" => self::CONFIGURABLE_PRODUCT_SKU, + "name" => self::CONFIGURABLE_PRODUCT_SKU, + "type_id" => "configurable", + "price" => 50, + 'attribute_set_id' => 4, + "extension_attributes" => [ + "configurable_product_options" => $configurableProductOptions, + "configurable_product_links" => [10, 20], + ], + ]; + + return $this->createProduct($product); + } } diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php index 85ff80003f6ea..796285cc174ba 100644 --- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php @@ -14,6 +14,7 @@ use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Framework\Api\SortOrder; use Magento\Framework\Api\SortOrderBuilder; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\WebapiAbstract; @@ -44,6 +45,11 @@ class GroupRepositoryTest extends WebapiAbstract */ private $customerGroupFactory; + /** + * @var \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory + */ + private $groupExtensionInterfaceFactory; + /** * Execute per test initialization. */ @@ -53,6 +59,9 @@ protected function setUp(): void $this->groupRegistry = $objectManager->get(\Magento\Customer\Model\GroupRegistry::class); $this->groupRepository = $objectManager->get(\Magento\Customer\Model\ResourceModel\GroupRepository::class); $this->customerGroupFactory = $objectManager->create(\Magento\Customer\Api\Data\GroupInterfaceFactory::class); + $this->groupExtensionInterfaceFactory = $objectManager->create( + \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory::class + ); } /** @@ -159,6 +168,69 @@ public function testCreateGroupRest() ); } + /** + * Verify that creating a new group with excluded website as extension attributes works via REST. + * + * @dataProvider testExcludedWebsitesRestDataProvider + * @param string $code + * @param null|array $excludeWebsitesIds + * @param null|array $result + * @throws NoSuchEntityException + * @throws LocalizedException + */ + public function testCreateGroupWithExcludedWebsiteRest( + string $code, + array $excludeWebsitesIds, + ?array $result + ): void { + $this->_markTestAsRestOnly(); + + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH, + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST, + ], + ]; + + $groupData = [ + CustomerGroup::ID => null, + CustomerGroup::CODE => $code, + CustomerGroup::TAX_CLASS_ID => 3, + 'extension_attributes' => ['exclude_website_ids' => $excludeWebsitesIds] + ]; + $requestData = ['group' => $groupData]; + + $groupId = $this->_webApiCall($serviceInfo, $requestData)[CustomerGroup::ID]; + self::assertNotNull($groupId); + + $newGroup = $this->groupRepository->getById($groupId); + self::assertEquals($groupId, $newGroup->getId(), 'The group id does not match.'); + self::assertEquals($groupData[CustomerGroup::CODE], $newGroup->getCode(), 'The group code does not match.'); + self::assertEquals( + $groupData[CustomerGroup::TAX_CLASS_ID], + $newGroup->getTaxClassId(), + 'The group tax class id does not match.' + ); + self::assertEquals( + $result, + $newGroup->getExtensionAttributes()->getExcludeWebsiteIds(), + 'The group extension attributes do not match.' + ); + } + + /** + * Data provider for excluded websites from customer group with REST. + * + * @return array + */ + public function testExcludedWebsitesRestDataProvider(): array + { + return [ + ['Create Group No Excludes REST', [], null], + ['Create Group With Excludes REST', ['1'], ['1']] + ]; + } + /** * Verify that creating a new group with a duplicate group name fails with an error via REST. */ @@ -411,6 +483,49 @@ public function testUpdateGroupRest() ); } + /** + * Verify that updating an existing group with excluded website works via REST. + */ + public function testUpdateGroupWithExcludedWebsiteRest(): void + { + $this->_markTestAsRestOnly(); + $group = $this->customerGroupFactory->create(); + $group->setId(null); + $group->setCode('New Group with Exclude REST'); + $group->setTaxClassId(3); + $groupId = $this->createGroup($group); + + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH . "/$groupId", + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_PUT, + ], + ]; + + $groupData = [ + CustomerGroup::ID => $groupId, + CustomerGroup::CODE => 'Updated Group with Exclude REST', + CustomerGroup::TAX_CLASS_ID => 3, + 'extension_attributes' => ['exclude_website_ids' => ['1']] + ]; + $requestData = ['group' => $groupData]; + + self::assertEquals($groupId, $this->_webApiCall($serviceInfo, $requestData)[CustomerGroup::ID]); + + $group = $this->groupRepository->getById($groupId); + self::assertEquals($groupData[CustomerGroup::CODE], $group->getCode(), 'The group code did not change.'); + self::assertEquals( + $groupData[CustomerGroup::TAX_CLASS_ID], + $group->getTaxClassId(), + 'The group tax class id did not change' + ); + self::assertEquals( + ['1'], + $group->getExtensionAttributes()->getExcludeWebsiteIds(), + 'The group excluded websites do not match.' + ); + } + /** * Verify that updating a non-existing group throws an exception. */ @@ -483,6 +598,70 @@ public function testCreateGroupSoap() ); } + /** + * Verify that creating a new group with excluded website as extension attributes works via SOAP. + * + * @dataProvider testExcludedWebsitesSoapDataProvider + * @param string $code + * @param array $excludeWebsitesIds + * @param array|null $result + * @throws LocalizedException + * @throws NoSuchEntityException + */ + public function testCreateGroupWithExcludedWebsiteSoap( + string $code, + array $excludeWebsitesIds, + ?array $result + ): void { + $this->_markTestAsSoapOnly(); + + $serviceInfo = [ + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => 'customerGroupRepositoryV1Save', + ], + ]; + + $groupData = [ + CustomerGroup::ID => null, + CustomerGroup::CODE => $code, + 'taxClassId' => 3, + 'extension_attributes' => ['exclude_website_ids' => $excludeWebsitesIds] + ]; + $requestData = ['group' => $groupData]; + + $groupId = $this->_webApiCall($serviceInfo, $requestData)[CustomerGroup::ID]; + self::assertNotNull($groupId); + + $newGroup = $this->groupRepository->getById($groupId); + self::assertEquals($groupId, $newGroup->getId(), "The group id does not match."); + self::assertEquals($groupData[CustomerGroup::CODE], $newGroup->getCode(), "The group code does not match."); + self::assertEquals( + $groupData['taxClassId'], + $newGroup->getTaxClassId(), + "The group tax class id does not match." + ); + self::assertEquals( + $result, + $newGroup->getExtensionAttributes()->getExcludeWebsiteIds(), + 'The group extension attributes do not match.' + ); + } + + /** + * Data provider for excluded websites from customer group with SOAP. + * + * @return array + */ + public function testExcludedWebsitesSoapDataProvider(): array + { + return [ + ['Create Group No Excludes SOAP', [], null], + ['Create Group With Excludes SOAP', ['1'], ['1']] + ]; + } + /** * Verify that creating a new group with a duplicate code fails with an error via SOAP. */ @@ -671,6 +850,48 @@ public function testUpdateGroupSoap() ); } + /** + * Verify that updating an existing group with excluded website works via SOAP. + */ + public function testUpdateGroupWithExcludedWebsiteSoap(): void + { + $this->_markTestAsSoapOnly(); + $group = $this->customerGroupFactory->create(); + $group->setId(null); + $group->setCode('New Group with Exclude SOAP'); + $group->setTaxClassId(3); + $groupId = $this->createGroup($group); + + $serviceInfo = [ + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => 'customerGroupRepositoryV1Save', + ], + ]; + + $groupData = [ + CustomerGroup::ID => $groupId, + CustomerGroup::CODE => 'Updated Group with Exclude SOAP', + 'taxClassId' => 3, + 'extension_attributes' => ['exclude_website_ids' => ['1']] + ]; + $this->_webApiCall($serviceInfo, ['group' => $groupData]); + + $group = $this->groupRepository->getById($groupId); + self::assertEquals($groupData[CustomerGroup::CODE], $group->getCode(), 'The group code did not change.'); + self::assertEquals( + $groupData['taxClassId'], + $group->getTaxClassId(), + 'The group tax class id did not change' + ); + self::assertEquals( + ['1'], + $group->getExtensionAttributes()->getExcludeWebsiteIds(), + 'The group excluded websites do not match.' + ); + } + /** * Verify that updating a non-existing group throws an exception via SOAP. */ @@ -748,6 +969,51 @@ public function testDeleteGroupExists() } } + /** + * Verify that deleting an existing group with excluded website works. + */ + public function testDeleteGroupExistsWithExcludedWebsite(): void + { + $group = $this->customerGroupFactory->create(); + $group->setId(null); + $group->setCode('Delete Group with Excludes'); + $group->setTaxClassId(3); + // set excluded website as an extension attribute + $customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create(); + $customerGroupExtensionAttributes->setExcludeWebsiteIds(['1']); + $group->setExtensionAttributes($customerGroupExtensionAttributes); + + $groupId = $this->createGroup($group); + + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH . "/$groupId", + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_DELETE, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => 'customerGroupRepositoryV1DeleteById', + ], + ]; + + $requestData = [CustomerGroup::ID => $groupId]; + $response = $this->_webApiCall($serviceInfo, $requestData); + self::assertTrue($response, 'Expected response should be true.'); + + try { + $this->groupRepository->getById($groupId); + self::fail('An expected NoSuchEntityException was not thrown.'); + } catch (NoSuchEntityException $e) { + $exception = NoSuchEntityException::singleField(CustomerGroup::ID, $groupId); + self::assertEquals( + $exception->getMessage(), + $e->getMessage(), + 'Exception message does not match expected message.' + ); + } + } + /** * Verify that deleting an non-existing group works. */ diff --git a/dev/tests/api-functional/testsuite/Magento/Framework/Stdlib/CookieManagerTest.php b/dev/tests/api-functional/testsuite/Magento/Framework/Stdlib/CookieManagerTest.php index 28433f47362d9..da5cec838729d 100644 --- a/dev/tests/api-functional/testsuite/Magento/Framework/Stdlib/CookieManagerTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Framework/Stdlib/CookieManagerTest.php @@ -24,7 +24,6 @@ class CookieManagerTest extends \Magento\TestFramework\TestCase\WebapiAbstract protected function setUp(): void { $objectManager = Bootstrap::getObjectManager(); - $this->config = $objectManager->get(\Magento\Webapi\Model\Config::class); $this->curlClient = $objectManager->get( \Magento\TestFramework\TestCase\HttpClient\CurlClientWithCookies::class ); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php index 18f21bcbc2ee5..3bad8fdba7a3a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php @@ -613,6 +613,20 @@ public function filterSingleCategoryDataProvider(): array 'position' => '1' ] ], + [ + 'parent_category_uid', + 'eq', + 'NA==', + [ + 'id' => '5', + 'name' => 'Category 1.1.1', + 'url_key' => 'category-1-1-1', + 'url_path' => 'category-1/category-1-1/category-1-1-1', + 'children_count' => '0', + 'path' => '1/2/3/4/5', + 'position' => '1' + ] + ], [ 'name', 'match', @@ -761,6 +775,41 @@ public function filterMultipleCategoriesDataProvider(): array ] ] ], + // Filter by multiple parent UIDs + [ + 'parent_category_uid', + 'in', + '["Mw==", "NA=="]', + [ + [ + 'id' => '4', + 'name' => 'Category 1.1', + 'url_key' => 'category-1-1', + 'url_path' => 'category-1/category-1-1', + 'children_count' => '0', + 'path' => '1/2/3/4', + 'position' => '1' + ], + [ + 'id' => '5', + 'name' => 'Category 1.1.1', + 'url_key' => 'category-1-1-1', + 'url_path' => 'category-1/category-1-1/category-1-1-1', + 'children_count' => '0', + 'path' => '1/2/3/4/5', + 'position' => '1' + ], + [ + 'id' => '13', + 'name' => 'Category 1.2', + 'url_key' => 'category-1-2', + 'url_path' => 'category-1/category-1-2', + 'children_count' => '0', + 'path' => '1/2/3/13', + 'position' => '2' + ] + ] + ], //Filter by multiple url keys [ 'url_key', diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php index a0f184507a9aa..8eb04247dbf3c 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php @@ -52,5 +52,17 @@ function ($a) { $this->assertCount(2, $customAggregation); $this->assertEquals('test_attribute_2', $customAggregation[0]['attribute_code']); $this->assertEquals('test_attribute_1', $customAggregation[1]['attribute_code']); + + /** + * Check sorting options + */ + $optionsAttribute1 = $customAggregation[0]['options']; + $this->assertCount(3, $optionsAttribute1); + $this->assertEquals('Option 1', $optionsAttribute1[0]['label']); + $this->assertEquals('Option 2', $optionsAttribute1[1]['label']); + $this->assertEquals('Option 3', $optionsAttribute1[2]['label']); + $this->assertEquals(1, $optionsAttribute1[0]['count']); + $this->assertEquals(2, $optionsAttribute1[1]['count']); + $this->assertEquals(3, $optionsAttribute1[2]['count']); } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php index 7cb7dacf2b188..12fa87389c476 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php @@ -842,4 +842,49 @@ public function testFilterCategoryNamedFragment() $this->assertEquals($result['categoryList'][0]['uid'], base64_encode('6')); $this->assertEquals($result['categoryList'][0]['url_path'], 'category-2'); } + + /** + * Test when there is recursive category node fragment + * + * @magentoApiDataFixture Magento/Catalog/_files/categories.php + */ + public function testFilterCategoryRecursiveFragment() : void + { + $query = <<<'QUERY' +query GetCategoryTree($filters: CategoryFilterInput!) { + categoryList(filters: $filters) { + ...recursiveCategoryNode + } +} + +fragment recursiveCategoryNode on CategoryTree { + ...categoryNode + children { + ...categoryNode + } +} + +fragment categoryNode on CategoryTree { + id +} +QUERY; + $variables = [ + 'filters' => [ + 'ids' => [ + 'eq' => '2', + ], + ], + ]; + $result = $this->graphQlQuery($query, $variables); + $this->assertArrayNotHasKey('errors', $result); + $this->assertCount(1, $result['categoryList']); + $this->assertCount(2, $result['categoryList'][0]); + $this->assertArrayHasKey('id', $result['categoryList'][0]); + $this->assertArrayHasKey('children', $result['categoryList'][0]); + $this->assertEquals($result['categoryList'][0]['id'], '2'); + $this->assertCount(7, $result['categoryList'][0]['children']); + $this->assertCount(1, $result['categoryList'][0]['children'][0]); + $this->assertArrayHasKey('id', $result['categoryList'][0]['children'][0]); + $this->assertEquals($result['categoryList'][0]['children'][0]['id'], '3'); + } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php index a77eccf5c623f..bb05dac2db0a7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php @@ -689,6 +689,51 @@ public function testBreadCrumbsWithDisabledParentCategory() $this->assertEquals($expectedResponse, $response); } + /** + * Test sorting of categories tree + * + * @magentoApiDataFixture Magento/Catalog/_files/categories_sorted.php + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testCategoriesTreeSorting() + { + $rootCategoryId = 2; + $query = <<<QUERY +{ + category(id: {$rootCategoryId}) { + children { + name + children { + name + } + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + $responseDataObject = new DataObject($response); + self::assertEquals( + 'Category 12', + $responseDataObject->getData('category/children/0/name') + ); + self::assertEquals( + 'Category 1', + $responseDataObject->getData('category/children/1/name') + ); + self::assertEquals( + 'Category 2', + $responseDataObject->getData('category/children/2/name') + ); + self::assertEquals( + 'Category 1.2', + $responseDataObject->getData('category/children/1/children/0/name') + ); + self::assertEquals( + 'Category 1.1', + $responseDataObject->getData('category/children/1/children/1/name') + ); + } + /** * @return array */ diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/Options/CustomizableOptionsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/Options/CustomizableOptionsTest.php new file mode 100644 index 0000000000000..abefd2c272c01 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/Options/CustomizableOptionsTest.php @@ -0,0 +1,134 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\Catalog\Options; + +use Exception; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Helper\CompareArraysRecursively; +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Test for customizable product options. + */ +class CustomizableOptionsTest extends GraphQlAbstract +{ + /** + * @var CompareArraysRecursively + */ + private $compareArraysRecursively; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $objectManager = Bootstrap::getObjectManager(); + $this->compareArraysRecursively = $objectManager->create(CompareArraysRecursively::class); + } + + /** + * @magentoApiDataFixture Magento/Catalog/_files/product_with_options.php + * + * @param array $optionDataProvider + * + * @dataProvider getProductCustomizableOptionsProvider + * @throws Exception + */ + public function testQueryCustomizableOptions(array $optionDataProvider): void + { + $productSku = 'simple'; + $query = $this->getQuery($productSku); + $response = $this->graphQlQuery($query); + $responseProduct = reset($response['products']['items']); + self::assertNotEmpty($responseProduct['options']); + + foreach ($optionDataProvider as $key => $data) { + $this->compareArraysRecursively->execute($data, $responseProduct[$key]); + } + } + + /** + * Get query. + * + * @param string $sku + * + * @return string + */ + private function getQuery(string $sku): string + { + return <<<QUERY +query { + products(filter: { sku: { eq: "$sku" } }) { + items { + ... on CustomizableProductInterface { + options { + option_id + title + ... on CustomizableDateOption { + value { + type + } + } + } + } + } + } +} +QUERY; + } + + /** + * Get product customizable options provider. + * + * @return array + */ + public function getProductCustomizableOptionsProvider(): array + { + return [ + 'products' => [ + 'items' => [ + 'options' => [ + [ + 'title' => 'test_option_code_1' + ], + [ + 'title' => 'area option' + ], + [ + 'title' => 'file option' + ], + [ + 'title' => 'radio option' + ], + [ + 'title' => 'multiple option' + ], + [ + 'title' => 'date option', + 'values' => [ + 'type' => 'DATE' + ] + ], + [ + 'title' => 'date_time option', + 'values' => [ + 'type' => 'DATE_TIME' + ] + ], + [ + 'title' => 'time option', + 'values' => [ + 'type' => 'TIME' + ] + ] + ] + ] + ] + ]; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/PriceTiersTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/PriceTiersTest.php index 767dcc5e0ab5c..071f9a6ea5121 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/PriceTiersTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/PriceTiersTest.php @@ -117,6 +117,41 @@ public function testGetLowestPriceForGuest() $this->assertEquals(round(7.25, 2), $this->getValueForQuantity(8, $itemTiers)); } + /** + * @magentoApiDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoApiDataFixture Magento/Catalog/_files/three_simple_products_with_tier_price.php + */ + public function testProductTierPricesAreCorrectlyReturned() + { + $productSku = 'simple'; + $query = <<<QUERY +{ + products(search: "{$productSku}") { + items { + sku + name + price_tiers { + quantity + final_price { + value + } + } + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + $productsWithTierPrices = ['simple_1','simple_2','simple_3']; + + foreach ($response['products']['items'] as $key => $item) { + if (in_array($item['sku'], $productsWithTierPrices)) { + $this->assertCount(1, $response['products']['items'][$key]['price_tiers']); + } else { + $this->assertCount(0, $response['products']['items'][$key]['price_tiers']); + } + } + } + /** * Get the tier price value for the given product quantity * diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/RouteTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/RouteTest.php new file mode 100644 index 0000000000000..c4bcea60ed11f --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/RouteTest.php @@ -0,0 +1,527 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\CatalogUrlRewrite; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\Uid; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; +use Magento\TestFramework\TestCase\GraphQlAbstract; +use Magento\UrlRewrite\Model\UrlFinderInterface; +use Magento\UrlRewrite\Model\UrlRewrite; + +/** + * Test the GraphQL endpoint's route query to verify URL route information is correctly returned. + */ +class RouteTest extends GraphQlAbstract +{ + /** @var ObjectManager */ + private $objectManager; + + /** @var Uid */ + private $idDecoder; + + /** + * {@inheritdoc} + */ + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->idDecoder = $this->objectManager->get(Uid::class); + } + + /** + * Tests if target_path(relative_url) is resolved for Product entity + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testProductUrlResolver() + { + $productSku = 'p002'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + $storeId = $product->getStoreId(); + + $query + = <<<QUERY +{ + products(filter: {sku: {eq: "{$productSku}"}}) + { + items { + url_key + url_suffix + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + $urlPath = $response['products']['items'][0]['url_key'] . $response['products']['items'][0]['url_suffix']; + + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + $actualUrls = $urlFinder->findOneByData( + [ + 'request_path' => $urlPath, + 'store_id' => $storeId + ] + ); + $relativePath = $actualUrls->getRequestPath(); + $expectedType = $actualUrls->getEntityType(); + $redirectCode = $actualUrls->getRedirectType(); + + $this->queryUrlAndAssertResponse( + (int) $product->getEntityId(), + $urlPath, + $relativePath, + $expectedType, + $redirectCode + ); + } + + /** + * Test the use case where non seo friendly is provided as resolver input in the Query + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testProductUrlWithNonSeoFriendlyUrlInput() + { + $productSku = 'p002'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + $storeId = $product->getStoreId(); + + $query + = <<<QUERY +{ + products(filter: {sku: {eq: "{$productSku}"}}) + { + items { + url_key + url_suffix + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + $urlPath = $response['products']['items'][0]['url_key'] . $response['products']['items'][0]['url_suffix']; + + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + $actualUrls = $urlFinder->findOneByData( + [ + 'request_path' => $urlPath, + 'store_id' => $storeId + ] + ); + // even if non seo friendly path requested, the seo friendly path should be preferred + $relativePath = $actualUrls->getRequestPath(); + $expectedType = $actualUrls->getEntityType(); + $nonSeoFriendlyPath = $actualUrls->getTargetPath(); + $redirectCode = $actualUrls->getRedirectType(); + + $this->queryUrlAndAssertResponse( + (int) $product->getEntityId(), + $nonSeoFriendlyPath, + $relativePath, + $expectedType, + $redirectCode + ); + } + + /** + * Test the use case where non seo friendly is provided as resolver input in the Query + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testRedirectsAndCustomInput() + { + $productSku = 'p002'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + + // generate permanent redirects + $renamedKey = 'p002-ren'; + $product->setUrlKey($renamedKey)->setData('save_rewrites_history', true)->save(); + + $storeId = $product->getStoreId(); + + $query + = <<<QUERY +{ + products(filter: {sku: {eq: "{$productSku}"}}) + { + items { + url_key + url_suffix + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + $urlPath = $response['products']['items'][0]['url_key'] . $response['products']['items'][0]['url_suffix']; + $suffix = $response['products']['items'][0]['url_suffix']; + + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + $actualUrls = $urlFinder->findOneByData( + [ + 'request_path' => $urlPath, + 'store_id' => $storeId + ] + ); + // querying the end redirect gives the same record + $this->queryUrlAndAssertResponse( + (int) $product->getEntityId(), + $renamedKey . $suffix, + $actualUrls->getRequestPath(), + $actualUrls->getEntityType(), + 0 + ); + // querying a url that's a redirect the active redirected final url + $this->queryUrlAndAssertResponse( + (int) $product->getEntityId(), + $productSku . $suffix, + $actualUrls->getRequestPath(), + $actualUrls->getEntityType(), + 301 + ); + // create custom url that doesn't redirect + /** @var UrlRewrite $urlRewriteModel */ + $urlRewriteModel = $this->objectManager->create(UrlRewrite::class); + + $customUrl = 'custom-path'; + $urlRewriteArray = [ + 'entity_type' => 'custom', + 'entity_id' => '0', + 'request_path' => $customUrl, + 'target_path' => 'p002.html', + 'redirect_type' => '0', + 'store_id' => '1', + 'description' => '', + 'is_autogenerated' => '0', + 'metadata' => null, + ]; + foreach ($urlRewriteArray as $key => $value) { + $urlRewriteModel->setData($key, $value); + } + $urlRewriteModel->save(); + // querying a custom url that should return the target entity but relative should be the custom url + $this->queryUrlAndAssertResponse( + (int) $product->getEntityId(), + $customUrl, + $customUrl, + $actualUrls->getEntityType(), + 0 + ); + // change custom url that does redirect + $urlRewriteModel->setRedirectType('301'); + $urlRewriteModel->setId($urlRewriteModel->getId()); + $urlRewriteModel->save(); + //modifying query by adding spaces to avoid getting cached values. + $this->queryUrlAndAssertResponse( + (int) $product->getEntityId(), + $customUrl . ' ', + $actualUrls->getRequestPath(), + strtoupper($actualUrls->getEntityType()), + 301 + ); + $urlRewriteModel->delete(); + } + + /** + * Test for category entity + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testCategoryUrlResolver($categoryUrlPath = null) + { + $productSku = 'p002'; + $categoryUrlPath = $categoryUrlPath ? $categoryUrlPath : 'cat-1.html'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + $storeId = $product->getStoreId(); + + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + $actualUrls = $urlFinder->findOneByData( + [ + 'request_path' => $categoryUrlPath, + 'store_id' => $storeId + ] + ); + $categoryId = $actualUrls->getEntityId(); + $relativePath = $actualUrls->getRequestPath(); + $expectedType = $actualUrls->getEntityType(); + + $query + = <<<QUERY +{ + category(id:{$categoryId}) { + url_key + url_suffix + } +} +QUERY; + $response = $this->graphQlQuery($query); + $urlPath = $response['category']['url_key'] . $response['category']['url_suffix']; + + $this->queryUrlAndAssertResponse( + (int) $categoryId, + $urlPath, + $relativePath, + $expectedType, + 0 + ); + } + + /** + * Test the use case where the url_key of the existing product is changed + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testProductUrlRewriteResolver() + { + $productSku = 'p002'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + $storeId = $product->getStoreId(); + $product->setUrlKey('p002-new')->save(); + + $query + = <<<QUERY +{ + products(filter: {sku: {eq: "{$productSku}"}}) + { + items { + url_key + url_suffix + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + $urlPath = $response['products']['items'][0]['url_key'] . $response['products']['items'][0]['url_suffix']; + + $this->assertEquals($urlPath, 'p002-new' . $response['products']['items'][0]['url_suffix']); + + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + $actualUrls = $urlFinder->findOneByData( + [ + 'request_path' => $urlPath, + 'store_id' => $storeId + ] + ); + $relativePath = $actualUrls->getRequestPath(); + $expectedType = $actualUrls->getEntityType(); + + $this->queryUrlAndAssertResponse( + (int) $product->getEntityId(), + $urlPath, + $relativePath, + $expectedType, + 0 + ); + } + + /** + * Tests if null is returned when an invalid request_path is provided as input to urlResolver + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testInvalidUrlResolverInput() + { + $productSku = 'p002'; + $urlPath = 'p002'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + $storeId = $product->getStoreId(); + + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + $urlFinder->findOneByData( + [ + 'request_path' => $urlPath, + 'store_id' => $storeId + ] + ); + $query + = <<<QUERY +{ + route(url:"{$urlPath}") + { + relative_url + type + redirect_code + } +} +QUERY; + $response = $this->graphQlQuery($query); + $this->assertArrayHasKey('route', $response); + $this->assertNull($response['route']); + } + + /** + * Test for category entity with leading slash + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testCategoryUrlWithLeadingSlash() + { + $productSku = 'p002'; + $categoryUrlPath = 'cat-1.html'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + $storeId = $product->getStoreId(); + + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + $actualUrls = $urlFinder->findOneByData( + [ + 'request_path' => $categoryUrlPath, + 'store_id' => $storeId + ] + ); + $categoryId = $actualUrls->getEntityId(); + $relativePath = $actualUrls->getRequestPath(); + $expectedType = $actualUrls->getEntityType(); + + $query + = <<<QUERY +{ + category(id:{$categoryId}) { + url_key + url_suffix + } +} +QUERY; + $response = $this->graphQlQuery($query); + $urlPath = $response['category']['url_key'] . $response['category']['url_suffix']; + $urlPathWithLeadingSlash = "/{$urlPath}"; + $this->queryUrlAndAssertResponse( + (int) $categoryId, + $urlPathWithLeadingSlash, + $relativePath, + $expectedType, + 0 + ); + } + + /** + * Test for custom type which point to the valid product/category/cms page. + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testGetNonExistentUrlRewrite() + { + $urlPath = 'non-exist-product.html'; + /** @var UrlRewrite $urlRewrite */ + $urlRewrite = $this->objectManager->create(UrlRewrite::class); + $urlRewrite->load($urlPath, 'request_path'); + + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + $actualUrls = $urlFinder->findOneByData( + [ + 'request_path' => $urlPath, + 'store_id' => 1 + ] + ); + $relativePath = $actualUrls->getRequestPath(); + + $query = <<<QUERY +{ + route(url:"{$urlPath}") + { + relative_url + type + redirect_code + } +} +QUERY; + $response = $this->graphQlQuery($query); + $this->assertArrayHasKey('route', $response); + $this->assertEquals('PRODUCT', $response['route']['type']); + $this->assertEquals($relativePath, $response['route']['relative_url']); + $this->assertEquals(0, $response['route']['redirect_code']); + } + + /** + * Test for category entity with empty url suffix + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix.php + */ + public function testCategoryUrlResolverWithEmptyUrlSuffix() + { + $this->testCategoryUrlResolver('cat-1'); + } + + /** + * Tests if target_path(relative_url) is resolved for Product entity with empty url suffix + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category_empty_url_suffix.php + */ + public function testProductUrlResolverWithEmptyUrlSuffix() + { + $this->testProductUrlResolver(); + } + + /** + * Assert response from GraphQl + * + * @param string $productId + * @param string $urlKey + * @param string $relativePath + * @param string $expectedType + * @param int $redirectCode + * @throws GraphQlInputException + */ + private function queryUrlAndAssertResponse( + int $productId, + string $urlKey, + string $relativePath, + string $expectedType, + int $redirectCode + ): void { + $query + = <<<QUERY +{ + route(url:"{$urlKey}") + { + relative_url + type + redirect_code + __typename + ...on SimpleProduct { + uid + } + ...on ConfigurableProduct { + uid + } + ...on CategoryTree { + uid + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + $this->assertArrayHasKey('route', $response); + $this->assertEquals($productId, $this->idDecoder->decode($response['route']['uid'])); + $this->assertEquals($relativePath, $response['route']['relative_url']); + $this->assertEquals(strtoupper($expectedType), $response['route']['type']); + $this->assertEquals($redirectCode, $response['route']['redirect_code']); + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CmsUrlRewrite/RouteTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CmsUrlRewrite/RouteTest.php new file mode 100644 index 0000000000000..2a15950b2c4bc --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CmsUrlRewrite/RouteTest.php @@ -0,0 +1,127 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\CmsUrlRewrite; + +use Magento\Cms\Model\Page; +use Magento\CmsUrlRewrite\Model\CmsPageUrlPathGenerator; +use Magento\CmsUrlRewrite\Model\CmsPageUrlRewriteGenerator; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; +use Magento\TestFramework\TestCase\GraphQlAbstract; +use Magento\Cms\Helper\Page as PageHelper; +use Magento\Store\Model\ScopeInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; + +/** + * Test the GraphQL endpoint's route query to verify URL route information is correctly returned. + */ +class RouteTest extends GraphQlAbstract +{ + /** @var ObjectManager */ + private $objectManager; + + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + } + + /** + * @magentoApiDataFixture Magento/Cms/_files/pages.php + */ + public function testCMSPageUrlResolver() + { + /** @var \Magento\Cms\Model\Page $page */ + $page = $this->objectManager->get(Page::class); + $page->load('page100'); + $requestPath = $page->getIdentifier(); + + /** @var \Magento\CmsUrlRewrite\Model\CmsPageUrlPathGenerator $urlPathGenerator */ + $urlPathGenerator = $this->objectManager->get(CmsPageUrlPathGenerator::class); + + /** @param \Magento\Cms\Api\Data\PageInterface $page */ + $targetPath = $urlPathGenerator->getCanonicalUrlPath($page); + $expectedEntityType = CmsPageUrlRewriteGenerator::ENTITY_TYPE; + + $query = $this->createQuery($requestPath); + $response = $this->graphQlQuery($query); + $this->assertEquals($requestPath, $response['route']['relative_url']); + $this->assertEquals(strtoupper(str_replace('-', '_', $expectedEntityType)), $response['route']['type']); + $this->assertEquals(0, $response['route']['redirect_code']); + $this->assertEquals($page->getIdentifier(), $response['route']['identifier']); + + // querying by non seo friendly url path should return seo friendly relative url + $query = $this->createQuery($targetPath); + $response = $this->graphQlQuery($query); + $this->assertEquals($requestPath, $response['route']['relative_url']); + $this->assertEquals(strtoupper(str_replace('-', '_', $expectedEntityType)), $response['route']['type']); + $this->assertEquals(0, $response['route']['redirect_code']); + $this->assertEquals($page->getIdentifier(), $response['route']['identifier']); + } + + /** + * @magentoApiDataFixture Magento/Cms/_files/pages.php + */ + public function testResolveCMSPageWithQueryParameters() + { + $page = $this->objectManager->create(Page::class); + $page->load('page100'); + $requestPath = $page->getIdentifier(); + $requestPath .= '?key=value'; + + $query = $this->createQuery($requestPath); + $response = $this->graphQlQuery($query); + $this->assertNotEmpty($response['route']); + $this->assertEquals($requestPath, $response['route']['relative_url']); + $this->assertEquals($page->getIdentifier(), $response['route']['identifier']); + } + + /** + * Test resolution of '/' path to home page + */ + public function testResolveSlash() + { + /** @var \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface */ + $scopeConfigInterface = $this->objectManager->get(ScopeConfigInterface::class); + $homePageIdentifier = $scopeConfigInterface->getValue( + PageHelper::XML_PATH_HOME_PAGE, + ScopeInterface::SCOPE_STORE + ); + /** @var \Magento\Cms\Model\Page $page */ + $page = $this->objectManager->get(Page::class); + $page->load($homePageIdentifier); + $query = $this->createQuery('/'); + $response = $this->graphQlQuery($query); + $this->assertArrayHasKey('route', $response); + $this->assertEquals($homePageIdentifier, $response['route']['relative_url']); + $this->assertEquals('CMS_PAGE', $response['route']['type']); + $this->assertEquals(0, $response['route']['redirect_code']); + $this->assertEquals($page->getIdentifier(), $response['route']['identifier']); + } + + /** + * @param string $path + * @return string + */ + private function createQuery(string $path): string + { + return <<<QUERY +{ + route(url:"{$path}") + { + relative_url + type + redirect_code + __typename + ...on CmsPage { + identifier + } + } +} +QUERY; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartSingleMutationTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartSingleMutationTest.php index 5a08692d5dcdd..5811344e4defd 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartSingleMutationTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartSingleMutationTest.php @@ -3,18 +3,20 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + declare(strict_types=1); namespace Magento\GraphQl\ConfigurableProduct; use Exception; +use Magento\CatalogInventory\Model\Configuration; use Magento\Config\Model\ResourceModel\Config; +use Magento\ConfigurableProductGraphQl\Model\Options\SelectionUidFormatter; use Magento\Framework\App\Config\ReinitableConfigInterface; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\GraphQlAbstract; -use Magento\CatalogInventory\Model\Configuration; /** * Add configurable product to cart testcases @@ -41,6 +43,11 @@ class AddConfigurableProductToCartSingleMutationTest extends GraphQlAbstract */ private $reinitConfig; + /** + * @var SelectionUidFormatter + */ + private $selectionUidFormatter; + /** * @inheritdoc */ @@ -51,13 +58,14 @@ protected function setUp(): void $this->resourceConfig = $objectManager->get(Config::class); $this->scopeConfig = $objectManager->get(ScopeConfigInterface::class); $this->reinitConfig = $objectManager->get(ReinitableConfigInterface::class); + $this->selectionUidFormatter = $objectManager->get(SelectionUidFormatter::class); } /** * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php */ - public function testAddConfigurableProductToCart() + public function testAddConfigurableProductToCart(): void { $product = $this->getConfigurableProductInfo(); $quantity = 2; @@ -77,7 +85,8 @@ public function testAddConfigurableProductToCart() ); $response = $this->graphQlMutation($query); - $expectedProductOptionsValueUid = $this->generateConfigurableSelectionUID($attributeId, $valueIndex); + + $expectedProductOptionsValueUid = $this->selectionUidFormatter->encode($attributeId, $valueIndex); $expectedProductOptionsUid = base64_encode("configurable/$productRowId/$attributeId"); $cartItem = current($response['addProductsToCart']['cart']['items']); self::assertEquals($quantity, $cartItem['quantity']); @@ -94,35 +103,11 @@ public function testAddConfigurableProductToCart() self::assertArrayHasKey('value_label', $option); } - /** - * Generates UID configurable product - * - * @param int $attributeId - * @param int $valueIndex - * @return string - */ - private function generateConfigurableSelectionUID(int $attributeId, int $valueIndex): string - { - return base64_encode("configurable/$attributeId/$valueIndex"); - } - - /** - * Generates UID for super configurable product super attributes - * - * @param int $attributeId - * @param int $valueIndex - * @return string - */ - private function generateSuperAttributesUIDQuery(int $attributeId, int $valueIndex): string - { - return 'selected_options: ["' . $this->generateConfigurableSelectionUID($attributeId, $valueIndex) . '"]'; - } - /** * @magentoApiDataFixture Magento/Catalog/_files/configurable_products_with_custom_attribute_layered_navigation.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php */ - public function testAddConfigurableProductWithWrongSuperAttributes() + public function testAddConfigurableProductWithWrongSuperAttributes(): void { $product = $this->getConfigurableProductInfo(); $quantity = 2; @@ -150,7 +135,7 @@ public function testAddConfigurableProductWithWrongSuperAttributes() * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php */ - public function testAddProductIfQuantityIsNotAvailable() + public function testAddProductIfQuantityIsNotAvailable(): void { $product = $this->getConfigurableProductInfo(); $parentSku = $product['sku']; @@ -179,7 +164,7 @@ public function testAddProductIfQuantityIsNotAvailable() * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php */ - public function testAddNonExistentConfigurableProductParentToCart() + public function testAddNonExistentConfigurableProductParentToCart(): void { $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); $parentSku = 'configurable_no_exist'; @@ -203,7 +188,7 @@ public function testAddNonExistentConfigurableProductParentToCart() * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_zero_qty_first_child.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php */ - public function testOutOfStockVariationToCart() + public function testOutOfStockVariationToCart(): void { $showOutOfStock = $this->scopeConfig->getValue(Configuration::XML_PATH_SHOW_OUT_OF_STOCK); @@ -215,7 +200,7 @@ public function testOutOfStockVariationToCart() $attributeId = (int) $product['configurable_options'][0]['attribute_id']; $valueIndex = $product['configurable_options'][0]['values'][0]['value_index']; // Asserting that the first value is the right option we want to add to cart - $this->assertEquals( + self::assertEquals( $product['configurable_options'][0]['values'][0]['label'], 'Option 1' ); @@ -237,7 +222,7 @@ public function testOutOfStockVariationToCart() 'There are no source items with the in stock status', 'This product is out of stock.' ]; - $this->assertContains( + self::assertContains( $response['addProductsToCart']['user_errors'][0]['message'], $expectedErrorMessages ); @@ -312,6 +297,18 @@ private function getConfigurableProductInfo(): array return current($searchResponse['products']['items']); } + /** + * Generates UID for super configurable product super attributes + * + * @param int $attributeId + * @param int $valueIndex + * @return string + */ + private function generateSuperAttributesUIDQuery(int $attributeId, int $valueIndex): string + { + return 'selected_options: ["' . $this->selectionUidFormatter->encode($attributeId, $valueIndex) . '"]'; + } + /** * Returns GraphQl query for fetching configurable product information * @@ -349,15 +346,32 @@ private function getFetchProductQuery(string $term): string value_index } } - configurable_options_selection_metadata { + configurable_product_options_selection { options_available_for_selection { attribute_code option_value_uids } + configurable_options { + uid + attribute_code + label + values { + uid + is_available + is_use_default + label + } + } variant { uid - name - attribute_set_id + sku + url_key + url_path + } + media_gallery { + url + label + disabled } } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php index 5bc543f9f122a..7945196409373 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php @@ -416,6 +416,120 @@ public function testAddConfigurableProductToCartWithCustomOption() $this->assertResponseFields($item['customizable_options'], $expectedOptions['customizable_options']); } + /** + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php + * @magentoApiDataFixture Magento/Store/_files/second_store.php + */ + public function testAddConfigurableProductToCartWithDifferentStoreHeader() + { + $searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable')); + $product = current($searchResponse['products']['items']); + + $quantity = 2; + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); + $parentSku = $product['sku']; + $sku = 'simple_20'; + $attributeId = (int) $product['configurable_options'][0]['attribute_id']; + $optionId = $product['configurable_options'][0]['values'][1]['value_index']; + + $query = $this->getQuery( + $maskedQuoteId, + $parentSku, + $sku, + $quantity + ); + $headerMap = ['Store' => 'fixture_second_store']; + $response = $this->graphQlMutation($query, [], '', $headerMap); + + $cartItem = current($response['addConfigurableProductsToCart']['cart']['items']); + self::assertEquals($quantity, $cartItem['quantity']); + self::assertEquals($parentSku, $cartItem['product']['sku']); + self::assertArrayHasKey('configurable_options', $cartItem); + + $option = current($cartItem['configurable_options']); + self::assertEquals($attributeId, $option['id']); + self::assertEquals($optionId, $option['value_id']); + self::assertArrayHasKey('option_label', $option); + self::assertArrayHasKey('value_label', $option); + } + + /** + * @magentoConfigFixture default_store checkout/cart/configurable_product_image itself + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_product_with_child_products_with_images.php + * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php + */ + public function testAddConfigurableProductWithImageToCartItselfImage(): void + { + $searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable')); + $product = current($searchResponse['products']['items']); + + $quantity = 1; + $parentSku = $product['sku']; + $sku = 'simple_20'; + + $query = $this->graphQlQueryForVariant( + $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'), + $parentSku, + $sku, + $quantity + ); + + $response = $this->graphQlMutation($query); + + $cartItem = current($response['addConfigurableProductsToCart']['cart']['items']); + self::assertEquals($quantity, $cartItem['quantity']); + self::assertEquals($parentSku, $cartItem['product']['sku']); + self::assertArrayHasKey('configured_variant', $cartItem); + + $variant = $cartItem['configured_variant']; + $expectedThumbnailUrl = 'magento_thumbnail.jpg'; + $expectedThumbnailLabel = 'Thumbnail Image'; + $variantImage = basename($variant['thumbnail']['url']); + + self::assertEquals($expectedThumbnailUrl, $variantImage); + self::assertEquals($expectedThumbnailLabel, $variant['thumbnail']['label']); + self::assertEquals($sku, $variant['sku']); + } + + /** + * @magentoConfigFixture default_store checkout/cart/configurable_product_image parent + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_product_with_child_products_with_images.php + * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php + */ + public function testAddConfigurableProductWithImageToCartParentImage(): void + { + $searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable')); + $product = current($searchResponse['products']['items']); + + $quantity = 1; + $parentSku = $product['sku']; + $sku = 'simple_20'; + + $query = $this->graphQlQueryForVariant( + $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'), + $parentSku, + 'simple_20', + $quantity + ); + + $response = $this->graphQlMutation($query); + + $cartItem = current($response['addConfigurableProductsToCart']['cart']['items']); + self::assertEquals($quantity, $cartItem['quantity']); + self::assertEquals($parentSku, $cartItem['product']['sku']); + self::assertArrayHasKey('configured_variant', $cartItem); + + $variant = $cartItem['configured_variant']; + $expectedThumbnailUrl = 'magento_thumbnail.jpg'; + $expectedThumbnailLabel = 'Thumbnail Image'; + $variantImage = basename($variant['thumbnail']['url']); + + self::assertEquals($expectedThumbnailUrl, $variantImage); + self::assertEquals($expectedThumbnailLabel, $variant['thumbnail']['label']); + self::assertEquals($sku, $variant['sku']); + } + /** * @param string $maskedQuoteId * @param string $parentSku @@ -461,6 +575,52 @@ private function getQuery(string $maskedQuoteId, string $parentSku, string $sku, QUERY; } + /** + * @param string $maskedQuoteId + * @param string $parentSku + * @param string $sku + * @param int $quantity + * @return string + */ + private function graphQlQueryForVariant(string $maskedQuoteId, string $parentSku, string $sku, int $quantity): string + { + return <<<QUERY +mutation { + addConfigurableProductsToCart( + input:{ + cart_id:"{$maskedQuoteId}" + cart_items:{ + parent_sku: "{$parentSku}" + data:{ + sku:"{$sku}" + quantity:{$quantity} + } + } + } + ) { + cart { + items { + id + quantity + product { + sku + } + ... on ConfigurableCartItem { + configured_variant { + sku + thumbnail { + label + url + } + } + } + } + } + } +} +QUERY; + } + private function getFetchProductQuery(string $term): string { return <<<QUERY @@ -500,6 +660,7 @@ private function getFetchProductQuery(string $term): string * * @param string $productSku * @return array + * @throws Exception */ private function getAvailableProductCustomOption(string $productSku): array { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableOptionsSelectionMetadataTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableOptionsSelectionMetadataTest.php index f0e4df50794a3..02e3c53a748bd 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableOptionsSelectionMetadataTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableOptionsSelectionMetadataTest.php @@ -63,8 +63,8 @@ public function testWithoutSelectedOption() html } ... on ConfigurableProduct { - configurable_options_selection_metadata( - selectedConfigurableOptionValues: [] + configurable_product_options_selection( + configurableOptionValueUids: [] ) { options_available_for_selection { option_value_uids @@ -78,11 +78,11 @@ public function testWithoutSelectedOption() QUERY; $response = $this->graphQlQuery($query); $this->assertEquals(1, count($response['products']['items'])); - $this->assertEquals(2, count($response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertEquals(2, count($response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'])); - $this->assertEquals(4, count($response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertEquals(4, count($response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'][0]['option_value_uids'])); - $this->assertEquals(4, count($response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertEquals(4, count($response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'][1]['option_value_uids'])); } @@ -112,8 +112,8 @@ public function testSelectedFirstAttributeFirstOption() html } ... on ConfigurableProduct { - configurable_options_selection_metadata( - selectedConfigurableOptionValues: ["{$firstOptionUid}"] + configurable_product_options_selection( + configurableOptionValueUids: ["{$firstOptionUid}"] ) { options_available_for_selection { option_value_uids @@ -128,20 +128,20 @@ public function testSelectedFirstAttributeFirstOption() $response = $this->graphQlQuery($query); $this->assertEquals(1, count($response['products']['items'])); - $this->assertEquals(2, count($response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertEquals(2, count($response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'])); - $this->assertEquals(1, count($response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertEquals(1, count($response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'][0]['option_value_uids'])); $this->assertEquals($firstOptionUid, $response['products']['items'][0] - ['configurable_options_selection_metadata']['options_available_for_selection'][0]['option_value_uids'][0]); - $this->assertEquals(4, count($response['products']['items'][0]['configurable_options_selection_metadata'] + ['configurable_product_options_selection']['options_available_for_selection'][0]['option_value_uids'][0]); + $this->assertEquals(4, count($response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'][1]['option_value_uids'])); $secondAttributeOptions = $this->getSecondConfigurableAttribute()->getOptions(); $this->assertAvailableOptionUids( $this->getSecondConfigurableAttribute()->getAttributeId(), $secondAttributeOptions, - $response['products']['items'][0]['configurable_options_selection_metadata'] + $response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'][1]['option_value_uids'] ); } @@ -172,8 +172,8 @@ public function testSelectedFirstAttributeLastOption() html } ... on ConfigurableProduct { - configurable_options_selection_metadata( - selectedConfigurableOptionValues: ["{$lastOptionUid}"] + configurable_product_options_selection( + configurableOptionValueUids: ["{$lastOptionUid}"] ) { options_available_for_selection { option_value_uids @@ -188,13 +188,13 @@ public function testSelectedFirstAttributeLastOption() $response = $this->graphQlQuery($query); $this->assertEquals(1, count($response['products']['items'])); - $this->assertEquals(2, count($response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertEquals(2, count($response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'])); - $this->assertEquals(1, count($response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertEquals(1, count($response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'][0]['option_value_uids'])); - $this->assertEquals($lastOptionUid, $response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertEquals($lastOptionUid, $response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'][0]['option_value_uids'][0]); - $this->assertEquals(2, count($response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertEquals(2, count($response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'][1]['option_value_uids'])); $secondAttributeOptions = $this->getSecondConfigurableAttribute()->getOptions(); unset($secondAttributeOptions[0]); @@ -203,7 +203,7 @@ public function testSelectedFirstAttributeLastOption() $this->assertAvailableOptionUids( $this->getSecondConfigurableAttribute()->getAttributeId(), $secondAttributeOptions, - $response['products']['items'][0]['configurable_options_selection_metadata'] + $response['products']['items'][0]['configurable_product_options_selection'] ['options_available_for_selection'][1]['option_value_uids'] ); } @@ -240,8 +240,8 @@ public function testSelectedVariant() html } ... on ConfigurableProduct { - configurable_options_selection_metadata( - selectedConfigurableOptionValues: ["{$firstAttributeFirstOptionUid}", "{$secondAttributeFirstOptionUid}"] + configurable_product_options_selection( + configurableOptionValueUids: ["{$firstAttributeFirstOptionUid}", "{$secondAttributeFirstOptionUid}"] ) { options_available_for_selection { option_value_uids @@ -259,11 +259,11 @@ public function testSelectedVariant() QUERY; $response = $this->graphQlQuery($query); $this->assertEquals(1, count($response['products']['items'])); - $this->assertNotNull($response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertNotNull($response['products']['items'][0]['configurable_product_options_selection'] ['variant']); $this->assertEquals( 'simple_' . $firstOptions[1]->getValue() . '_' . $secondOptions[1]->getValue(), - $response['products']['items'][0]['configurable_options_selection_metadata'] + $response['products']['items'][0]['configurable_product_options_selection'] ['variant']['sku'] ); } @@ -288,8 +288,8 @@ public function testMediaGalleryForAll() html } ... on ConfigurableProduct { - configurable_options_selection_metadata( - selectedConfigurableOptionValues: [] + configurable_product_options_selection( + configurableOptionValueUids: [] ) { options_available_for_selection { option_value_uids @@ -306,7 +306,7 @@ public function testMediaGalleryForAll() QUERY; $response = $this->graphQlQuery($query); $this->assertEquals(1, count($response['products']['items'])); - $this->assertEquals(14, count($response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertEquals(14, count($response['products']['items'][0]['configurable_product_options_selection'] ['media_gallery'])); } @@ -336,8 +336,8 @@ public function testMediaGalleryWithSelection() html } ... on ConfigurableProduct { - configurable_options_selection_metadata( - selectedConfigurableOptionValues: ["$lastOptionUid"] + configurable_product_options_selection( + configurableOptionValueUids: ["$lastOptionUid"] ) { options_available_for_selection { option_value_uids @@ -354,7 +354,7 @@ public function testMediaGalleryWithSelection() QUERY; $response = $this->graphQlQuery($query); $this->assertEquals(1, count($response['products']['items'])); - $this->assertEquals(2, count($response['products']['items'][0]['configurable_options_selection_metadata'] + $this->assertEquals(2, count($response['products']['items'][0]['configurable_product_options_selection'] ['media_gallery'])); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableOptionsSelectionTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableOptionsSelectionTest.php new file mode 100644 index 0000000000000..ac252acfcaa2b --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableOptionsSelectionTest.php @@ -0,0 +1,379 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\GraphQl\ConfigurableProduct; + +use Magento\ConfigurableProductGraphQl\Model\Options\SelectionUidFormatter; +use Magento\Eav\Api\Data\AttributeInterface; +use Magento\Eav\Model\AttributeRepository; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\GraphQl\Query\Uid; +use Magento\Indexer\Model\IndexerFactory; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Test configurable product option selection. + */ +class ConfigurableOptionsSelectionTest extends GraphQlAbstract +{ + /** + * @var AttributeRepository + */ + private $attributeRepository; + + /** + * @var SelectionUidFormatter + */ + private $selectionUidFormatter; + + /** + * @var IndexerFactory + */ + private $indexerFactory; + + /** + * @var Uid + */ + private $idEncoder; + + private $firstConfigurableAttribute; + + private $secondConfigurableAttribute; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->attributeRepository = Bootstrap::getObjectManager()->create(AttributeRepository::class); + $this->selectionUidFormatter = Bootstrap::getObjectManager()->create(SelectionUidFormatter::class); + $this->indexerFactory = Bootstrap::getObjectManager()->create(IndexerFactory::class); + $this->idEncoder = Bootstrap::getObjectManager()->create(Uid::class); + } + + /** + * Test the first option of the first attribute selected + * + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products_with_two_attributes_combination.php + */ + public function testSelectedFirstAttributeFirstOption(): void + { + $attribute = $this->getFirstConfigurableAttribute(); + $options = $attribute->getOptions(); + $sku = 'configurable_12345'; + $firstOptionUid = $this->selectionUidFormatter->encode( + (int)$attribute->getAttributeId(), + (int)$options[1]->getValue() + ); + + $this->reindexAll(); + $response = $this->graphQlQuery($this->getQuery($sku, [$firstOptionUid])); + + self::assertNotEmpty($response['products']['items']); + $product = current($response['products']['items']); + self::assertEquals('ConfigurableProduct', $product['__typename']); + self::assertEquals($sku, $product['sku']); + self::assertNotEmpty($product['configurable_product_options_selection']['configurable_options']); + self::assertNull($product['configurable_product_options_selection']['variant']); + self::assertCount(1, $product['configurable_product_options_selection']['configurable_options']); + self::assertCount(4, $product['configurable_product_options_selection']['configurable_options'][0]['values']); + + $secondAttributeOptions = $this->getSecondConfigurableAttribute()->getOptions(); + $this->assertAvailableOptionUids( + $this->getSecondConfigurableAttribute()->getAttributeId(), + $secondAttributeOptions, + $this->getOptionsUids( + $product['configurable_product_options_selection']['configurable_options'][0]['values'] + ) + ); + + $this->assertMediaGallery($product); + } + + /** + * Test selected variant + * + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products_with_two_attributes_combination.php + */ + public function testSelectedVariant(): void + { + $firstAttribute = $this->getFirstConfigurableAttribute(); + $firstOptions = $firstAttribute->getOptions(); + $firstAttributeFirstOptionUid = $this->selectionUidFormatter->encode( + (int)$firstAttribute->getAttributeId(), + (int)$firstOptions[1]->getValue() + ); + $secondAttribute = $this->getSecondConfigurableAttribute(); + $secondOptions = $secondAttribute->getOptions(); + $secondAttributeFirstOptionUid = $this->selectionUidFormatter->encode( + (int)$secondAttribute->getAttributeId(), + (int)$secondOptions[1]->getValue() + ); + + $sku = 'configurable_12345'; + + $this->reindexAll(); + $response = $this->graphQlQuery( + $this->getQuery($sku, [$firstAttributeFirstOptionUid, $secondAttributeFirstOptionUid]) + ); + + self::assertNotEmpty($response['products']['items']); + $product = current($response['products']['items']); + self::assertEquals('ConfigurableProduct', $product['__typename']); + self::assertEquals($sku, $product['sku']); + self::assertEmpty($product['configurable_product_options_selection']['configurable_options']); + self::assertNotNull($product['configurable_product_options_selection']['variant']); + + $variantId = $this->idEncoder->decode($product['configurable_product_options_selection']['variant']['uid']); + self::assertIsNumeric($variantId); + self::assertIsString($product['configurable_product_options_selection']['variant']['sku']); + $urlKey = 'configurable-option-first-option-1-second-option-1'; + self::assertEquals($urlKey, $product['configurable_product_options_selection']['variant']['url_key']); + + $this->assertMediaGallery($product); + } + + /** + * Test without selected options + * + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products_with_two_attributes_combination.php + */ + public function testWithoutSelectedOption(): void + { + $sku = 'configurable_12345'; + $this->reindexAll(); + $response = $this->graphQlQuery($this->getQuery($sku)); + + self::assertNotEmpty($response['products']['items']); + $product = current($response['products']['items']); + self::assertEquals('ConfigurableProduct', $product['__typename']); + self::assertEquals($sku, $product['sku']); + + self::assertNotEmpty($product['configurable_product_options_selection']['configurable_options']); + self::assertNull($product['configurable_product_options_selection']['variant']); + self::assertCount(2, $product['configurable_product_options_selection']['configurable_options']); + self::assertCount(4, $product['configurable_product_options_selection']['configurable_options'][0]['values']); + self::assertCount(4, $product['configurable_product_options_selection']['configurable_options'][1]['values']); + + $firstAttributeOptions = $this->getFirstConfigurableAttribute()->getOptions(); + $this->assertAvailableOptionUids( + $this->getFirstConfigurableAttribute()->getAttributeId(), + $firstAttributeOptions, + $this->getOptionsUids( + $product['configurable_product_options_selection']['configurable_options'][0]['values'] + ) + ); + + $secondAttributeOptions = $this->getSecondConfigurableAttribute()->getOptions(); + $this->assertAvailableOptionUids( + $this->getSecondConfigurableAttribute()->getAttributeId(), + $secondAttributeOptions, + $this->getOptionsUids( + $product['configurable_product_options_selection']['configurable_options'][1]['values'] + ) + ); + + $this->assertMediaGallery($product); + } + + /** + * Test with wrong selected options + * + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products_with_two_attributes_combination.php + */ + public function testWithWrongSelectedOptions(): void + { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('configurableOptionValueUids values are incorrect'); + + $attribute = $this->getFirstConfigurableAttribute(); + $options = $attribute->getOptions(); + $sku = 'configurable_12345'; + $firstOptionUid = $this->selectionUidFormatter->encode( + (int)$attribute->getAttributeId(), + $options[1]->getValue() + 100 + ); + + $this->reindexAll(); + $this->graphQlQuery($this->getQuery($sku, [$firstOptionUid])); + } + + /** + * Get GraphQL query to test configurable product options selection + * + * @param string $productSku + * @param array $optionValueUids + * @param int $pageSize + * @param int $currentPage + * @return string + */ + private function getQuery( + string $productSku, + array $optionValueUids = [], + int $pageSize = 20, + int $currentPage = 1 + ): string { + if (empty($optionValueUids)) { + $configurableOptionValueUids = ''; + } else { + $configurableOptionValueUids = '(configurableOptionValueUids: ['; + foreach ($optionValueUids as $configurableOptionValueUid) { + $configurableOptionValueUids .= '"' . $configurableOptionValueUid . '",'; + } + $configurableOptionValueUids .= '])'; + } + + return <<<QUERY +{ +products(filter:{ + sku: {eq: "{$productSku}"} + }, + pageSize: {$pageSize}, currentPage: {$currentPage} + ) + { + items { + __typename + sku + ... on ConfigurableProduct { + configurable_product_options_selection {$configurableOptionValueUids} { + configurable_options { + uid + attribute_code + label + values { + uid + is_available + is_use_default + label + swatch { + value + } + } + } + variant { + uid + sku + url_key + } + media_gallery { + url + label + disabled + } + } + } + } + } +} +QUERY; + } + + /** + * Get first configurable attribute. + * + * @return AttributeInterface + * @throws NoSuchEntityException + */ + private function getFirstConfigurableAttribute(): AttributeInterface + { + if (!$this->firstConfigurableAttribute) { + $this->firstConfigurableAttribute = $this->attributeRepository->get( + 'catalog_product', + 'test_configurable_first' + ); + } + + return $this->firstConfigurableAttribute; + } + + /** + * Get second configurable attribute. + * + * @return AttributeInterface + * @throws NoSuchEntityException + */ + private function getSecondConfigurableAttribute(): AttributeInterface + { + if (!$this->secondConfigurableAttribute) { + $this->secondConfigurableAttribute = $this->attributeRepository->get( + 'catalog_product', + 'test_configurable_second' + ); + } + + return $this->secondConfigurableAttribute; + } + + /** + * Assert option uid. + * + * @param $attributeId + * @param $expectedOptions + * @param $selectedOptions + */ + private function assertAvailableOptionUids($attributeId, $expectedOptions, $selectedOptions): void + { + unset($expectedOptions[0]); + foreach ($expectedOptions as $option) { + self::assertContains( + $this->selectionUidFormatter->encode((int)$attributeId, (int)$option->getValue()), + $selectedOptions + ); + } + } + + /** + * Make fulltext catalog search reindex + * + * @return void + * @throws \Throwable + */ + private function reindexAll(): void + { + $indexLists = [ + 'catalog_category_product', + 'catalog_product_attribute', + 'cataloginventory_stock', + 'catalogsearch_fulltext', + ]; + + foreach ($indexLists as $indexerId) { + $indexer = $this->indexerFactory->create(); + $indexer->load($indexerId)->reindexAll(); + } + } + + /** + * Retrieve options UIDs + * + * @param array $options + * @return array + */ + private function getOptionsUids(array $options): array + { + $uids = []; + foreach ($options as $option) { + $uids[] = $option['uid']; + } + return $uids; + } + + /** + * Assert media gallery fields + * + * @param array $product + */ + private function assertMediaGallery(array $product): void + { + self::assertNotEmpty($product['configurable_product_options_selection']['media_gallery']); + $image = current($product['configurable_product_options_selection']['media_gallery']); + self::assertIsString($image['url']); + self::assertEquals(false, $image['disabled']); + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetCustomerTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetCustomerTest.php index daae62ce8d535..5fc316c0d46f3 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetCustomerTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetCustomerTest.php @@ -7,13 +7,21 @@ namespace Magento\GraphQl\Customer; +use Exception; +use Magento\Customer\Api\AccountManagementInterface; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Model\CustomerAuthUpdate; use Magento\Customer\Model\CustomerRegistry; +use Magento\Framework\ObjectManagerInterface; +use Magento\Integration\Api\AdminTokenServiceInterface; use Magento\Integration\Api\CustomerTokenServiceInterface; use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Bootstrap as TestBootstrap; use Magento\TestFramework\TestCase\GraphQlAbstract; +/** + * GraphQl tests for @see \Magento\CustomerGraphQl\Model\Customer\GetCustomer. + */ class GetCustomerTest extends GraphQlAbstract { /** @@ -36,14 +44,23 @@ class GetCustomerTest extends GraphQlAbstract */ private $customerRepository; + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @inheridoc + */ protected function setUp(): void { parent::setUp(); - $this->customerTokenService = Bootstrap::getObjectManager()->get(CustomerTokenServiceInterface::class); - $this->customerRegistry = Bootstrap::getObjectManager()->get(CustomerRegistry::class); - $this->customerAuthUpdate = Bootstrap::getObjectManager()->get(CustomerAuthUpdate::class); - $this->customerRepository = Bootstrap::getObjectManager()->get(CustomerRepositoryInterface::class); + $this->objectManager = Bootstrap::getObjectManager(); + $this->customerTokenService = $this->objectManager->get(CustomerTokenServiceInterface::class); + $this->customerRegistry = $this->objectManager->get(CustomerRegistry::class); + $this->customerAuthUpdate = $this->objectManager->get(CustomerAuthUpdate::class); + $this->customerRepository = $this->objectManager->get(CustomerRepositoryInterface::class); } /** @@ -81,7 +98,7 @@ public function testGetCustomer() */ public function testGetCustomerIfUserIsNotAuthorized() { - $this->expectException(\Exception::class); + $this->expectException(Exception::class); $this->expectExceptionMessage('The current customer isn\'t authorized.'); $query = <<<QUERY @@ -97,17 +114,48 @@ public function testGetCustomerIfUserIsNotAuthorized() } /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/User/_files/user_with_role.php + * @return void */ - public function testGetCustomerIfAccountIsLocked() + public function testGetCustomerIfUserHasWrongType(): void { - $this->expectException(\Exception::class); - $this->expectExceptionMessage('The account is locked.'); + /** @var $adminTokenService AdminTokenServiceInterface */ + $adminTokenService = $this->objectManager->get(AdminTokenServiceInterface::class); + $adminToken = $adminTokenService->createAdminAccessToken('adminUser', TestBootstrap::ADMIN_PASSWORD); + + $this->expectException(Exception::class); + $this->expectExceptionMessage('The current customer isn\'t authorized.'); - $this->lockCustomer(1); + $query = <<<QUERY +query { + customer { + firstname + lastname + email + } +} +QUERY; + $this->graphQlQuery( + $query, + [], + '', + ['Authorization' => 'Bearer ' . $adminToken] + ); + } + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + */ + public function testGetCustomerIfAccountIsLocked() + { $currentEmail = 'customer@example.com'; $currentPassword = 'password'; + $customer = $this->customerRepository->get($currentEmail); + + $this->lockCustomer((int)$customer->getId()); + + $this->expectException(Exception::class); + $this->expectExceptionMessage('The account is locked.'); $query = <<<QUERY query { @@ -127,18 +175,19 @@ public function testGetCustomerIfAccountIsLocked() } /** - * @magentoApiDataFixture Magento/Customer/_files/customer_confirmation_config_enable.php + * @magentoConfigFixture customer/create_account/confirm 1 * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @expectedExceptionMessage This account isn't confirmed. Verify and try again. + * */ public function testAccountIsNotConfirmed() { + $this->expectExceptionMessage("This account isn't confirmed. Verify and try again."); $customerEmail = 'customer@example.com'; $currentPassword = 'password'; + $customer = $this->customerRepository->get($customerEmail); $headersMap = $this->getCustomerAuthHeaders($customerEmail, $currentPassword); - $customer = $this->customerRepository->getById(1)->setConfirmation( - \Magento\Customer\Api\AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED - ); + $customer = $this->customerRepository->getById((int)$customer->getId()) + ->setConfirmation(AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED); $this->customerRepository->save($customer); $query = <<<QUERY query { @@ -160,6 +209,7 @@ public function testAccountIsNotConfirmed() private function getCustomerAuthHeaders(string $email, string $password): array { $customerToken = $this->customerTokenService->createCustomerAccessToken($email, $password); + return ['Authorization' => 'Bearer ' . $customerToken]; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php index 67ae07775c1d8..e2e9d809bf8ee 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php @@ -1759,4 +1759,16 @@ private function getPlaceOrderQuery(string $maskedQuoteId): string } QUERY; } + + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoConfigFixture default_store checkout/options/guest_checkout 0 + */ + public function testSetBillingAddressAndPlaceOrderWithGuestCheckoutDisabled() + { + $this->testSetBillingAddressAndPlaceOrder(); + } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php index 08554cbd8fac1..8c58913af41a7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php @@ -1950,4 +1950,17 @@ private function getPlaceOrderQuery(string $maskedQuoteId): string } QUERY; } + + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php + * @magentoConfigFixture default_store checkout/options/guest_checkout 0 + */ + public function testSetNewShippingAddressAndPlaceOrderWithGuestCheckoutDisabled() + { + $this->testSetNewShippingAddressAndPlaceOrder(); + } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php index f31b396a18ba6..934c56355d1e7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php @@ -79,6 +79,8 @@ public function testChangeQuoteItemCustomOptions() self::assertCount(2, $itemOptionsResponse); self::assertEquals('test', $itemOptionsResponse[0]['values'][0]['value']); self::assertEquals('test', $itemOptionsResponse[1]['values'][0]['value']); + self::assertEquals('field', $itemOptionsResponse[0]['type']); + self::assertEquals('area', $itemOptionsResponse[1]['type']); } /** @@ -111,6 +113,7 @@ public function testOptionsSetPersistsOnQtyChange() ... on SimpleCartItem { customizable_options { label + type values { value } @@ -128,6 +131,8 @@ public function testOptionsSetPersistsOnQtyChange() self::assertCount(2, $cartItemResponse['customizable_options']); self::assertEquals('initial value', $cartItemResponse['customizable_options'][0]['values'][0]['value']); self::assertEquals('initial value', $cartItemResponse['customizable_options'][1]['values'][0]['value']); + self::assertEquals('field', $cartItemResponse['customizable_options'][0]['type']); + self::assertEquals('area', $cartItemResponse['customizable_options'][1]['type']); } /** @@ -210,6 +215,7 @@ private function getQuery(string $maskedQuoteId, int $quoteItemId, $customizable ... on SimpleCartItem { customizable_options { label + type customizable_option_uid values { label diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/AvailableStoreConfigTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/AvailableStoreConfigTest.php index d762462729234..e89a9340f6315 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/AvailableStoreConfigTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/AvailableStoreConfigTest.php @@ -72,7 +72,16 @@ public function testDefaultWebsiteAvailableStoreConfigs(): void availableStores { id, code, + store_code, + store_name, + store_sort_order, + is_default_store, + store_group_code, + store_group_name, + is_default_store_group, website_id, + website_code, + website_name, locale, base_currency_code, default_display_currency_code, @@ -112,7 +121,16 @@ public function testNonDefaultWebsiteAvailableStoreConfigs(): void availableStores { id, code, + store_code, + store_name, + store_sort_order, + is_default_store, + store_group_code, + store_group_name, + is_default_store_group, website_id, + website_code, + website_name, locale, base_currency_code, default_display_currency_code, @@ -148,10 +166,26 @@ public function testNonDefaultWebsiteAvailableStoreConfigs(): void */ private function validateStoreConfig(StoreConfigInterface $storeConfig, array $responseConfig): void { + /** @var Store $store */ $store = $this->objectManager->get(Store::class); $this->storeResource->load($store, $storeConfig->getCode(), 'code'); $this->assertEquals($storeConfig->getId(), $responseConfig['id']); $this->assertEquals($storeConfig->getCode(), $responseConfig['code']); + $this->assertEquals($store->getName(), $responseConfig['store_name']); + $this->assertEquals($store->getSortOrder(), $responseConfig['store_sort_order']); + $this->assertEquals( + $store->getGroup()->getDefaultStoreId() == $store->getId(), + $responseConfig['is_default_store'] + ); + $this->assertEquals($store->getGroup()->getCode(), $responseConfig['store_group_code']); + $this->assertEquals($store->getGroup()->getName(), $responseConfig['store_group_name']); + $this->assertEquals( + $store->getWebsite()->getDefaultGroupId() === $store->getGroupId(), + $responseConfig['is_default_store_group'] + ); + $this->assertEquals($store->getWebsite()->getCode(), $responseConfig['website_code']); + $this->assertEquals($store->getWebsite()->getName(), $responseConfig['website_name']); + $this->assertEquals($storeConfig->getCode(), $responseConfig['store_code']); $this->assertEquals($storeConfig->getLocale(), $responseConfig['locale']); $this->assertEquals($storeConfig->getBaseCurrencyCode(), $responseConfig['base_currency_code']); $this->assertEquals( @@ -168,7 +202,6 @@ private function validateStoreConfig(StoreConfigInterface $storeConfig, array $r $this->assertEquals($storeConfig->getSecureBaseLinkUrl(), $responseConfig['secure_base_link_url']); $this->assertEquals($storeConfig->getSecureBaseStaticUrl(), $responseConfig['secure_base_static_url']); $this->assertEquals($storeConfig->getSecureBaseMediaUrl(), $responseConfig['secure_base_media_url']); - $this->assertEquals($store->getName(), $responseConfig['store_name']); $this->assertEquals($store->isUseStoreInUrl(), $responseConfig['use_store_in_url']); } @@ -193,7 +226,16 @@ public function testAllStoreConfigsWithCodeInUrlEnabled(): void availableStores(useCurrentGroup:false) { id, code, + store_code, + store_name, + store_sort_order, + is_default_store, + store_group_code, + store_group_name, + is_default_store_group, website_id, + website_code, + website_name, locale, base_currency_code, default_display_currency_code, @@ -236,7 +278,16 @@ public function testCurrentGroupStoreConfigs(): void availableStores(useCurrentGroup:true) { id, code, + store_code, + store_name, + store_sort_order, + is_default_store, + store_group_code, + store_group_name, + is_default_store_group, website_id, + website_code, + website_name,, locale, base_currency_code, default_display_currency_code, diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php index cc8a60cf0937a..c79bbf0e0a300 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php @@ -12,6 +12,7 @@ use Magento\Store\Api\StoreConfigManagerInterface; use Magento\Store\Api\StoreRepositoryInterface; use Magento\Store\Api\StoreResolverInterface; +use Magento\Store\Model\Store; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\GraphQlAbstract; @@ -55,7 +56,16 @@ public function testGetStoreConfig(): void storeConfig { id, code, + store_code, + store_name, + store_sort_order, + is_default_store, + store_group_code, + store_group_name, + is_default_store_group, website_id, + website_code, + website_name, locale, base_currency_code, default_display_currency_code, @@ -75,7 +85,7 @@ public function testGetStoreConfig(): void QUERY; $response = $this->graphQlQuery($query); $this->assertArrayHasKey('storeConfig', $response); - $this->validateStoreConfig($defaultStoreConfig, $response['storeConfig'], $store->getName()); + $this->validateStoreConfig($defaultStoreConfig, $response['storeConfig'], $store); } /** @@ -83,15 +93,32 @@ public function testGetStoreConfig(): void * * @param StoreConfigInterface $storeConfig * @param array $responseConfig - * @param string $storeName + * @param Store $store */ private function validateStoreConfig( StoreConfigInterface $storeConfig, array $responseConfig, - string $storeName + Store $store ): void { $this->assertEquals($storeConfig->getId(), $responseConfig['id']); $this->assertEquals($storeConfig->getCode(), $responseConfig['code']); + + $this->assertEquals($store->getName(), $responseConfig['store_name']); + $this->assertEquals($store->getSortOrder(), $responseConfig['store_sort_order']); + $this->assertEquals( + $store->getGroup()->getDefaultStoreId() == $store->getId(), + $responseConfig['is_default_store'] + ); + $this->assertEquals($store->getGroup()->getCode(), $responseConfig['store_group_code']); + $this->assertEquals($store->getGroup()->getName(), $responseConfig['store_group_name']); + $this->assertEquals( + $store->getWebsite()->getDefaultGroupId() === $store->getGroupId(), + $responseConfig['is_default_store_group'] + ); + $this->assertEquals($store->getWebsite()->getCode(), $responseConfig['website_code']); + $this->assertEquals($store->getWebsite()->getName(), $responseConfig['website_name']); + $this->assertEquals($storeConfig->getCode(), $responseConfig['store_code']); + $this->assertEquals($storeConfig->getLocale(), $responseConfig['locale']); $this->assertEquals($storeConfig->getBaseCurrencyCode(), $responseConfig['base_currency_code']); $this->assertEquals( @@ -108,6 +135,6 @@ private function validateStoreConfig( $this->assertEquals($storeConfig->getSecureBaseLinkUrl(), $responseConfig['secure_base_link_url']); $this->assertEquals($storeConfig->getSecureBaseStaticUrl(), $responseConfig['secure_base_static_url']); $this->assertEquals($storeConfig->getSecureBaseMediaUrl(), $responseConfig['secure_base_media_url']); - $this->assertEquals($storeName, $responseConfig['store_name']); + $this->assertEquals($store->getName(), $responseConfig['store_name']); } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php index ae34ea31f0d51..713a16a6bfaa9 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php @@ -84,12 +84,12 @@ public function testVisualSwatchDataValues() $color = '#000000'; $query = <<<QUERY { - products(filter: {sku: {eq: "$productSku"}}) { + products(filter: { sku: { eq: "$productSku" } }) { items { - ... on ConfigurableProduct{ - configurable_options{ + ... on ConfigurableProduct { + configurable_options { values { - swatch_data{ + swatch_data { value ... on ImageSwatchData { thumbnail @@ -97,6 +97,19 @@ public function testVisualSwatchDataValues() } } } + configurable_product_options_selection { + configurable_options { + values { + label + swatch { + value + ... on ImageSwatchData { + thumbnail + } + } + } + } + } } } } @@ -123,5 +136,19 @@ public function testVisualSwatchDataValues() $option['values'][1]['swatch_data']['thumbnail'], $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_THUMBNAIL_NAME, $imageName) ); + + $configurableProductOptionsSelection = + $product['configurable_product_options_selection']['configurable_options'][0]; + + $this->assertArrayHasKey('values', $configurableProductOptionsSelection); + $this->assertEquals($color, $configurableProductOptionsSelection['values'][0]['swatch']['value']); + $this->assertStringContainsString( + $configurableProductOptionsSelection['values'][1]['swatch']['value'], + $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_IMAGE_NAME, $imageName) + ); + $this->assertEquals( + $configurableProductOptionsSelection['values'][1]['swatch']['thumbnail'], + $this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_THUMBNAIL_NAME, $imageName) + ); } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/RouteTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/RouteTest.php new file mode 100755 index 0000000000000..e4109cc8f7793 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/RouteTest.php @@ -0,0 +1,506 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\UrlRewrite; + +use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\AlreadyExistsException; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; +use Magento\TestFramework\TestCase\GraphQlAbstract; +use Magento\UrlRewrite\Model\ResourceModel\UrlRewrite as UrlRewriteResourceModel; +use Magento\UrlRewrite\Model\UrlFinderInterface; +use Magento\UrlRewrite\Model\UrlRewrite as UrlRewriteModel; +use Magento\UrlRewrite\Service\V1\Data\UrlRewrite as UrlRewriteService; + +/** + * Test the GraphQL endpoint's Route query to verify url route information is correctly returned. + */ +class RouteTest extends GraphQlAbstract +{ + /** @var ObjectManager */ + private $objectManager; + + /** + * {@inheritdoc} + */ + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + } + + /** + * Tests if target_path(relative_url) is resolved for Product entity + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testProductUrlResolver() + { + $productSku = 'p002'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + + $response = $this->getRouteQueryResponse($this->getProductUrlKey($productSku)); + $this->productTestAssertion($product, $response); + $expectedUrls = $this->getProductUrlRewriteData($productSku); + $this->assertEquals($expectedUrls->getRequestPath(), $response['route']['relative_url']); + $this->assertEquals($expectedUrls->getRedirectType(), $response['route']['redirect_code']); + $this->assertEquals(strtoupper($expectedUrls->getEntityType()), $response['route']['type']); + } + + /** + * Test the use case where non seo friendly is provided as resolver input in the Query + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testProductUrlWithNonSeoFriendlyUrlInput() + { + $productSku = 'p002'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + + $actualUrls = $this->getProductUrlRewriteData($productSku); + $nonSeoFriendlyPath = $actualUrls->getTargetPath(); + + $response = $this->getRouteQueryResponse($nonSeoFriendlyPath); + $this->productTestAssertion($product, $response); + } + + /** + * Test the use case where url_key of the existing product is changed and verify final url is redirected correctly + * + * @magentoApiDataFixture Magento/Catalog/_files/product_with_category.php + */ + public function testProductUrlRewriteResolver() + { + $productSku = 'in-stock-product'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + $initialUrlPath = $this->getProductUrlKey($productSku); + $renamedKey = 'simple-product-in-stock-new'; + $suffix = '.html'; + $product->setUrlKey($renamedKey)->setData('save_rewrites_history', true)->save(); + $newUrlPath = $renamedKey . $suffix; + + $response = $this->getRouteQueryResponse($newUrlPath); + $this->productTestAssertion($product, $response); + + $expectedUrls = $this->getProductUrlRewriteData($productSku); + $this->assertEquals($expectedUrls->getRequestPath(), $response['route']['relative_url']); + $this->assertEquals($expectedUrls->getRedirectType(), $response['route']['redirect_code']); + $this->assertEquals(strtoupper($expectedUrls->getEntityType()), $response['route']['type']); + + // verify that product url is redirected to the final url with the correct redirectType + $response = $this->getRouteQueryResponse($initialUrlPath); + $this->assertEquals('simple-product-in-stock-new.html', $response['route']['relative_url']); + $this->assertEquals(301, $response['route']['redirect_code']); + } + + /** + * Test for custom type which point to the valid product/category/cms page. + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testGetNonExistentUrlRewrite() + { + $productSku = 'p002'; + $urlPath = 'non-exist-product.html'; + + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + + /** @var UrlRewriteModel $urlRewriteModel */ + $urlRewriteModel = $this->objectManager->create(UrlRewriteModel::class); + $urlRewriteModel->load($urlPath, 'request_path'); + + $response = $this->getRouteQueryResponse($urlPath); + $this->assertNotNull($response['route']); + $this->productTestAssertion($product, $response); + $this->assertEquals($urlPath, $response['route']['relative_url']); + $this->assertEquals(0, $response['route']['redirect_code']); + $this->assertEquals('PRODUCT', $response['route']['type']); + } + + /** + * Test for category entity + * + * @magentoApiDataFixture Magento/CatalogUrlRewrite/_files/product_with_category.php + */ + public function testCategoryUrlResolver() + { + $productSku = 'p002'; + $categoryUrlPath = 'cat-1.html'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + $storeId = $product->getStoreId(); + + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + $actualUrls = $urlFinder->findOneByData( + [ + 'request_path' => $categoryUrlPath, + 'store_id' => $storeId + ] + ); + $categoryId = $actualUrls->getEntityId(); + $categoryRepository = $this->objectManager->get(CategoryRepositoryInterface::class); + $category = $categoryRepository->get($categoryId); + + $query + = <<<QUERY +{ + category(id:{$categoryId}) { + url_key + url_suffix + } +} +QUERY; + $response = $this->graphQlQuery($query); + $urlPath = $response['category']['url_key'] . $response['category']['url_suffix']; + $response = $this->getRouteQueryResponse($urlPath); + + $this->assertArrayHasKey('route', $response); + $this->assertEquals($category->getName(), $response['route']['name']); + $this->assertEquals(base64_encode($category->getId()), $response['route']['uid']); + $this->assertEquals($urlPath, $response['route']['relative_url']); + $this->assertEquals(0, $response['route']['redirect_code']); + $this->assertEquals('CATEGORY', $response['route']['type']); + } + + /** + * @magentoApiDataFixture Magento/Cms/_files/pages.php + */ + public function testCMSPageUrlResolver() + { + /** @var \Magento\Cms\Model\Page $page */ + $page = $this->objectManager->get(\Magento\Cms\Model\Page::class); + $page->load('page100'); + $cmsPageData = $page->getData(); + + /** @var \Magento\CmsUrlRewrite\Model\CmsPageUrlPathGenerator $urlPathGenerator */ + $urlPathGenerator = $this->objectManager->get(\Magento\CmsUrlRewrite\Model\CmsPageUrlPathGenerator::class); + + /** @param \Magento\Cms\Api\Data\PageInterface $page */ + $targetPath = $urlPathGenerator->getCanonicalUrlPath($page); + + $response = $this->getRouteQueryResponse($targetPath); + + $urlPath = $urlPathGenerator->getUrlPath($page); + + $this->assertArrayHasKey('route', $response); + $this->assertEquals($cmsPageData['identifier'], $response['route']['url_key']); + $this->assertEquals($cmsPageData['title'], $response['route']['title']); + $this->assertEquals($cmsPageData['content'], $response['route']['content']); + $this->assertEquals($cmsPageData['content_heading'], $response['route']['content_heading']); + $this->assertEquals($cmsPageData['page_layout'], $response['route']['page_layout']); + $this->assertEquals($urlPath, $response['route']['relative_url']); + $this->assertEquals(0, $response['route']['redirect_code']); + $this->assertEquals('CMS_PAGE', $response['route']['type']); + } + + /** + * @param string $urlKey + * @return array + * @throws \Exception + */ + public function getRouteQueryResponse(string $urlKey): array + { + $routeQuery + = <<<QUERY +{ + route(url:"{$urlKey}") + { + __typename + ...on SimpleProduct { + name + sku + relative_url + redirect_code + type + } + ...on CategoryTree { + name + uid + relative_url + redirect_code + type + } + ...on CmsPage { + title + url_key + page_layout + content + content_heading + relative_url + redirect_code + type + } + } +} +QUERY; + return $this->graphQlQuery($routeQuery); + } + + /** + * @param string $productSku + * @return string + * @throws \Exception + */ + public function getProductUrlKey(string $productSku): string + { + $query + = <<<QUERY +{ + products(filter: {sku: {eq: "{$productSku}"}}) + { + items { + url_key + url_suffix + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + return $response['products']['items'][0]['url_key'] . $response['products']['items'][0]['url_suffix']; + } + + /** + * @param ProductInterface $product + * @param array $response + */ + private function productTestAssertion(ProductInterface $product, array $response) + { + $this->assertArrayHasKey('route', $response); + $this->assertEquals($product->getName(), $response['route']['name']); + $this->assertEquals($product->getSku(), $response['route']['sku']); + } + + /** + * @param $productSku + * @return UrlRewriteService + * @throws \Magento\Framework\Exception\NoSuchEntityException + */ + private function getProductUrlRewriteData($productSku): UrlRewriteService + { + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get($productSku, false, null, true); + $storeId = $product->getStoreId(); + + $urlPath = $this->getProductUrlKey($productSku); + + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + /** @var UrlRewriteService $actualUrls */ + $actualUrls = $urlFinder->findOneByData( + [ + 'request_path' => $urlPath, + 'store_id' => $storeId + ] + ); + return $actualUrls; + } + + /** + * Test for custom type which point to the invalid product/category/cms page. + * + * @magentoApiDataFixture Magento/UrlRewrite/_files/url_rewrite_not_existing_entity.php + */ + public function testNonExistentEntityUrlRewrite() + { + $urlPath = 'non-exist-entity.html'; + + $query = <<<QUERY +{ + route(url:"{$urlPath}") + { + relative_url + type + redirect_code + } +} +QUERY; + + $this->expectExceptionMessage( + "No such entity found with matching URL key: " . $urlPath + ); + $this->graphQlQuery($query); + } + + /** + * Test for url rewrite to clean cache on rewrites update + * + * @magentoApiDataFixture Magento/Catalog/_files/product_with_category.php + * @magentoApiDataFixture Magento/Cms/_files/pages.php + * + * @dataProvider urlRewriteEntitiesDataProvider + * @param string $requestPath + * @throws AlreadyExistsException + */ + public function testUrlRewriteCleansCacheOnChange(string $requestPath) + { + + /** @var UrlRewriteResourceModel $urlRewriteResourceModel */ + $urlRewriteResourceModel = $this->objectManager->create(UrlRewriteResourceModel::class); + $storeId = 1; + $query = function ($requestUrl) { + return <<<QUERY +{ + route(url:"{$requestUrl}") + { + relative_url + type + redirect_code + } +} +QUERY; + }; + + // warming up route API response cache for entity and validate proper response + $apiResponse = $this->graphQlQuery($query($requestPath)); + $this->assertEquals($requestPath, $apiResponse['route']['relative_url']); + + $urlRewrite = $this->getUrlRewriteModelByRequestPath($requestPath, $storeId); + + // renaming entity request path and validating that API will not return cached response + $urlRewrite->setRequestPath('test' . $requestPath); + $urlRewriteResourceModel->save($urlRewrite); + $apiResponse = $this->graphQlQuery($query($requestPath)); + $this->assertNull($apiResponse['route']); + + // rolling back changes + $urlRewrite->setRequestPath($requestPath); + $urlRewriteResourceModel->save($urlRewrite); + } + + public function urlRewriteEntitiesDataProvider(): array + { + return [ + [ + 'simple-product-in-stock.html' + ], + [ + 'category-1.html' + ], + [ + 'page100' + ] + ]; + } + + /** + * Test for custom url rewrite to clean cache on update combinations + * + * @magentoApiDataFixture Magento/Catalog/_files/product_with_category.php + * @magentoApiDataFixture Magento/Cms/_files/pages.php + * + * @throws AlreadyExistsException + */ + public function testUrlRewriteCleansCacheForCustomRewrites() + { + + /** @var UrlRewriteResourceModel $urlRewriteResourceModel */ + $urlRewriteResourceModel = $this->objectManager->create(UrlRewriteResourceModel::class); + $storeId = 1; + $query = function ($requestUrl) { + return <<<QUERY +{ + route(url:"{$requestUrl}") + { + relative_url + type + redirect_code + } +} +QUERY; + }; + + $customRequestPath = 'test.html'; + $customSecondRequestPath = 'test2.html'; + $entitiesRequestPaths = [ + 'simple-product-in-stock.html', + 'category-1.html', + 'page100' + ]; + + // create custom url rewrite + $urlRewriteModel = $this->objectManager->create(UrlRewriteModel::class); + $urlRewriteModel->setEntityType('custom') + ->setRedirectType(302) + ->setStoreId($storeId) + ->setDescription(null) + ->setIsAutogenerated(0); + + // create second custom url rewrite and target it to previous one to check + // if proper final target url will be resolved + $secondUrlRewriteModel = $this->objectManager->create(UrlRewriteModel::class); + $secondUrlRewriteModel->setEntityType('custom') + ->setRedirectType(302) + ->setStoreId($storeId) + ->setRequestPath($customSecondRequestPath) + ->setTargetPath($customRequestPath) + ->setDescription(null) + ->setIsAutogenerated(0); + $urlRewriteResourceModel->save($secondUrlRewriteModel); + + foreach ($entitiesRequestPaths as $entityRequestPath) { + // updating custom rewrite for each entity + $urlRewriteModel->setRequestPath($customRequestPath) + ->setTargetPath($entityRequestPath); + $urlRewriteResourceModel->save($urlRewriteModel); + + // confirm that API returns non-cached response for the first custom rewrite + $apiResponse = $this->graphQlQuery($query($customRequestPath)); + $this->assertEquals($entityRequestPath, $apiResponse['route']['relative_url']); + + // confirm that API returns non-cached response for the second custom rewrite + $apiResponse = $this->graphQlQuery($query($customSecondRequestPath)); + $this->assertEquals($entityRequestPath, $apiResponse['route']['relative_url']); + } + + $urlRewriteResourceModel->delete($secondUrlRewriteModel); + + // delete custom rewrite and validate that API will not return cached response + $urlRewriteResourceModel->delete($urlRewriteModel); + $apiResponse = $this->graphQlQuery($query($customRequestPath)); + $this->assertNull($apiResponse['route']); + } + + /** + * Return UrlRewrite model instance by request_path + * + * @param string $requestPath + * @param int $storeId + * @return UrlRewriteModel + */ + private function getUrlRewriteModelByRequestPath(string $requestPath, int $storeId): UrlRewriteModel + { + /** @var UrlFinderInterface $urlFinder */ + $urlFinder = $this->objectManager->get(UrlFinderInterface::class); + + /** @var UrlRewriteService $urlRewriteService */ + $urlRewriteService = $urlFinder->findOneByData( + [ + 'request_path' => $requestPath, + 'store_id' => $storeId + ] + ); + + /** @var UrlRewriteModel $urlRewrite */ + $urlRewrite = $this->objectManager->create(UrlRewriteModel::class); + $urlRewrite->load($urlRewriteService->getUrlRewriteId()); + + return $urlRewrite; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Weee/CartItemPricesWithFPTTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Weee/CartItemPricesWithFPTTest.php new file mode 100644 index 0000000000000..1d53bd03be3d4 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Weee/CartItemPricesWithFPTTest.php @@ -0,0 +1,374 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\Weee; + +use Magento\Framework\App\Config\ReinitableConfigInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Config\Storage\WriterInterface; +use Magento\Framework\ObjectManager\ObjectManager; +use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Test for cart item fixed product tax + * + * @SuppressWarnings(PHPMD.TooManyPublicMethods) + */ +class CartItemPricesWithFPTTest extends GraphQlAbstract +{ + /** + * @var ObjectManager $objectManager + */ + private $objectManager; + + /** + * @var string[] + */ + private $initialConfig; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var GetMaskedQuoteIdByReservedOrderId + */ + private $getMaskedQuoteIdByReservedOrderId; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->scopeConfig = $this->objectManager->get(ScopeConfigInterface::class); + $this->getMaskedQuoteIdByReservedOrderId = $this->objectManager->get(GetMaskedQuoteIdByReservedOrderId::class); + + $currentSettingsArray = [ + 'tax/display/type', + 'tax/weee/enable', + 'tax/weee/display', + 'tax/defaults/region', + 'tax/weee/apply_vat', + 'tax/calculation/price_includes_tax' + ]; + + foreach ($currentSettingsArray as $configPath) { + $this->initialConfig[$configPath] = $this->scopeConfig->getValue( + $configPath + ); + } + /** @var ReinitableConfigInterface $config */ + $config = $this->objectManager->get(ReinitableConfigInterface::class); + $config->reinit(); + } + + /** + * @inheritdoc + */ + protected function tearDown(): void + { + $this->writeConfig($this->initialConfig); + } + + /** + * Write configuration for weee + * + * @param array $settings + * @return void + */ + private function writeConfig(array $settings): void + { + /** @var WriterInterface $configWriter */ + $configWriter = $this->objectManager->get(WriterInterface::class); + + foreach ($settings as $path => $value) { + $configWriter->save($path, $value); + } + $this->scopeConfig->clean(); + } + + /** + * @param array $taxSettings + * @param array $expectedFtps + * @return void + * + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @dataProvider cartItemFixedProductTaxDataProvider + * @magentoApiDataFixture Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php + * @magentoApiDataFixture Magento/Weee/_files/product_with_two_fpt.php + * @magentoApiDataFixture Magento/GraphQl/Weee/_files/add_fpt_for_region_1.php + * @magentoApiDataFixture Magento/GraphQl/Weee/_files/apply_tax_for_simple_product_with_fpt.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Weee/_files/add_simple_product_with_fpt_to_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php + */ + public function testCartItemFixedProductTax(array $taxSettings, array $expectedFtps): void + { + $this->writeConfig($taxSettings); + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + $query = $this->getQuery($maskedQuoteId); + $result = $this->graphQlQuery($query); + $this->assertArrayNotHasKey('errors', $result); + $this->assertNotEmpty($result['cart']['items']); + $actualFtps = $result['cart']['items'][0]['prices']['fixed_product_taxes']; + $this->assertEqualsCanonicalizing($expectedFtps, $actualFtps); + } + + /** + * @return array + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function cartItemFixedProductTaxDataProvider(): array + { + return [ + [ + 'taxSettings' => [ + 'tax/weee/enable' => '1', + 'tax/weee/apply_vat' => '0', + 'tax/calculation/price_includes_tax' => '0', + 'tax/display/type' => '1', + ], + 'expectedFtps' => [ + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 10.0 + ] + ], + [ + 'label' => 'fpt_for_all_front_label', + 'amount' => [ + 'value' => 12.7 + ] + ], + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 5.0 + ] + ], + ] + ], + [ + 'taxSettings' => [ + 'tax/weee/enable' => '1', + 'tax/weee/apply_vat' => '0', + 'tax/calculation/price_includes_tax' => '1', + 'tax/display/type' => '1', + ], + 'expectedFtps' => [ + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 10.0 + ] + ], + [ + 'label' => 'fpt_for_all_front_label', + 'amount' => [ + 'value' => 12.7 + ] + ], + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 5.0 + ] + ], + ] + ], + [ + 'taxSettings' => [ + 'tax/weee/enable' => '1', + 'tax/weee/apply_vat' => '1', + 'tax/calculation/price_includes_tax' => '0', + 'tax/display/type' => '1', + ], + 'expectedFtps' => [ + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 10.0 + ] + ], + [ + 'label' => 'fpt_for_all_front_label', + 'amount' => [ + 'value' => 12.7 + ] + ], + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 5.0 + ] + ], + ] + ], + [ + 'taxSettings' => [ + 'tax/weee/enable' => '1', + 'tax/weee/apply_vat' => '1', + 'tax/calculation/price_includes_tax' => '0', + 'tax/display/type' => '2', + ], + 'expectedFtps' => [ + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 10.75 + ] + ], + [ + 'label' => 'fpt_for_all_front_label', + 'amount' => [ + 'value' => 13.66 + ] + ], + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 5.38 + ] + ], + ] + ], + [ + 'taxSettings' => [ + 'tax/weee/enable' => '1', + 'tax/weee/apply_vat' => '1', + 'tax/calculation/price_includes_tax' => '1', + 'tax/display/type' => '1', + ], + 'expectedFtps' => [ + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 10.0 + ] + ], + [ + 'label' => 'fpt_for_all_front_label', + 'amount' => [ + 'value' => 12.7 + ] + ], + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 5.01 + ] + ], + ] + ], + [ + 'taxSettings' => [ + 'tax/weee/enable' => '1', + 'tax/weee/apply_vat' => '1', + 'tax/calculation/price_includes_tax' => '1', + 'tax/display/type' => '2', + ], + 'expectedFtps' => [ + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 10.75 + ] + ], + [ + 'label' => 'fpt_for_all_front_label', + 'amount' => [ + 'value' => 13.65 + ] + ], + [ + 'label' => 'fixed_product_attribute_front_label', + 'amount' => [ + 'value' => 5.38 + ] + ], + ] + ], + [ + 'taxSettings' => [ + 'tax/weee/enable' => '0', + 'tax/weee/apply_vat' => '1', + 'tax/calculation/price_includes_tax' => '1', + 'tax/display/type' => '1', + ], + 'expectedFtps' => [] + ] + ]; + } + + /** + * Generates GraphQl query for retrieving cart totals + * + * @param string $maskedQuoteId + * @return string + */ + private function getQuery(string $maskedQuoteId): string + { + return <<<QUERY +{ + cart(cart_id: "$maskedQuoteId") { + items { + prices { + price { + value + currency + } + row_total { + value + currency + } + row_total_including_tax { + value + currency + } + fixed_product_taxes { + label + amount { + value + } + } + } + } + prices { + grand_total { + value + currency + } + subtotal_including_tax { + value + currency + } + subtotal_excluding_tax { + value + currency + } + subtotal_with_discount_excluding_tax { + value + currency + } + applied_taxes { + label + amount { + value + currency + } + } + } + } +} +QUERY; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddWishlistItemsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddWishlistItemsToCartTest.php new file mode 100755 index 0000000000000..df4002cf748bd --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/AddWishlistItemsToCartTest.php @@ -0,0 +1,442 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare (strict_types = 1); + +namespace Magento\GraphQl\Wishlist; + +use Exception; +use Magento\Framework\Exception\AuthenticationException; +use Magento\Integration\Api\CustomerTokenServiceInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Test coverage for add requisition list items to cart + */ +class AddWishlistItemsToCartTest extends GraphQlAbstract +{ + /** + * @var CustomerTokenServiceInterface + */ + private $customerTokenService; + + /** + * Set Up + */ + protected function setUp(): void + { + $objectManager = Bootstrap::getObjectManager(); + $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class); + } + + /** + * @magentoConfigFixture default_store wishlist/general/active 1 + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Wishlist/_files/wishlist_with_simple_product.php + */ + public function testAddItemsToCart(): void + { + $wishlist = $this->getWishlist(); + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistId = $customerWishlist['id']; + $wishlistItem = $customerWishlist['items_v2']['items'][0]; + $itemId = $wishlistItem['id']; + + $query = $this->getQuery($wishlistId, $itemId); + $response = $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + + $this->assertArrayHasKey('addWishlistItemsToCart', $response); + $wishlistAfterAddingToCart = $response['addWishlistItemsToCart']['wishlist']; + $wishlistItems = $wishlistAfterAddingToCart['items_v2']['items']; + $this->assertEmpty($wishlistItems); + $this->assertArrayHasKey('status', $response['addWishlistItemsToCart']); + $this->assertEquals($response['addWishlistItemsToCart']['status'], true); + } + + /** + * @magentoConfigFixture default_store wishlist/general/active 1 + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Wishlist/_files/wishlist_with_configurable_product.php + */ + public function testAddIncompleteItemsToCart(): void + { + $wishlist = $this->getWishlist(); + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistId = $customerWishlist['id']; + $wishlistItem = $customerWishlist['items_v2']['items'][0]; + $itemId = $wishlistItem['id']; + + $query = $this->getQuery($wishlistId, $itemId); + $response = $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + + $this->assertArrayHasKey('addWishlistItemsToCart', $response); + $wishlistAfterAddingToCart = $response['addWishlistItemsToCart']['wishlist']; + $userErrors = $response['addWishlistItemsToCart']['add_wishlist_items_to_cart_user_errors']; + $this->assertEquals($userErrors[0]['message'], 'You need to choose options for your item.'); + $this->assertEquals($userErrors[0]['code'], 'UNDEFINED'); + $this->assertEquals($userErrors[0]['wishlistId'], $wishlistId); + $this->assertEquals($userErrors[0]['wishlistItemId'], $itemId); + $wishlistItems = $wishlistAfterAddingToCart['items_v2']['items']; + $this->assertNotEmpty($wishlistItems); + $this->assertArrayHasKey('status', $response['addWishlistItemsToCart']); + $this->assertEquals($response['addWishlistItemsToCart']['status'], false); + } + + /** + * @magentoConfigFixture default_store wishlist/general/active 1 + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Wishlist/_files/wishlist_with_multiple_products.php + */ + public function testAddAllItemsToCart(): void + { + $wishlist = $this->getWishlist(); + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistId = $customerWishlist['id']; + + $query = $this->getAddAllItemsToCartQuery($wishlistId); + $response = $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + + $this->assertArrayHasKey('addWishlistItemsToCart', $response); + $wishlistAfterAddingToCart = $response['addWishlistItemsToCart']['wishlist']; + $wishlistItems = $wishlistAfterAddingToCart['items_v2']['items']; + $this->assertEmpty($wishlistItems); + $this->assertArrayHasKey('status', $response['addWishlistItemsToCart']); + $this->assertEquals($response['addWishlistItemsToCart']['status'], true); + } + + /** + * @magentoConfigFixture default_store wishlist/general/active 1 + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Wishlist/_files/wishlist_with_simple_product.php + */ + public function testAddItemsToCartForInvalidUser(): void + { + $this->expectException(Exception::class); + $this->expectExceptionMessage("The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later."); + + $wishlist = $this->getWishlist(); + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistId = $customerWishlist['id']; + $wishlistItem = $customerWishlist['items_v2']['items'][0]; + $itemId = $wishlistItem['id']; + + $query = $this->getQuery($wishlistId, $itemId); + $this->graphQlMutation($query, [], '', $this->getHeaderMap('customer2@example.com', 'password')); + } + + /** + * @magentoConfigFixture default_store wishlist/general/active 1 + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Wishlist/_files/wishlist_with_simple_product.php + */ + public function testAddItemsToCartForGuestUser(): void + { + $this->expectException(Exception::class); + $this->expectExceptionMessage('The current user cannot perform operations on wishlist'); + + $wishlist = $this->getWishlist(); + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistId = $customerWishlist['id']; + $wishlistItem = $customerWishlist['items_v2']['items'][0]; + $itemId = $wishlistItem['id']; + + $query = $this->getQuery($wishlistId, $itemId); + + $this->graphQlMutation($query, [], '', ['Authorization' => 'Bearer test_token']); + } + + /** + * @magentoConfigFixture default_store wishlist/general/active 1 + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Wishlist/_files/wishlist_with_simple_product.php + */ + public function testAddItemsToCartWithoutId(): void + { + $this->expectException(Exception::class); + $this->expectExceptionMessage('"wishlistId" value should be specified'); + + $wishlistId = ''; + $wishlist = $this->getWishlist(); + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistItem = $customerWishlist['items_v2']['items'][0]; + $itemId = $wishlistItem['id']; + $query = $this->getQuery($wishlistId, $itemId); + $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + } + + /** + * @magentoConfigFixture default_store wishlist/general/active 1 + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Wishlist/_files/wishlist_with_simple_product.php + */ + public function testAddItemsToCartWithInvalidId(): void + { + $wishlistId = '9999'; + + $this->expectException(Exception::class); + $this->expectExceptionMessage('The wishlist was not found.'); + + $wishlist = $this->getWishlist(); + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistItem = $customerWishlist['items_v2']['items'][0]; + $itemId = $wishlistItem['id']; + + $query = $this->getQuery($wishlistId, $itemId); + $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + } + + /** + * @magentoConfigFixture default_store wishlist/general/active 1 + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Wishlist/_files/wishlist_with_simple_product.php + */ + public function testAddItemsToCartWithInvalidItemId(): void + { + $itemId = '9999'; + + $this->expectException(Exception::class); + $this->expectExceptionMessage('The wishlist item ids "9999" were not found.'); + + $wishlist = $this->getWishlist(); + $customerWishlist = $wishlist['customer']['wishlists'][0]; + + $query = $this->getQuery($customerWishlist['id'], $itemId); + $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + } + /** Add all items from customer's wishlist to cart + * + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoConfigFixture wishlist/general/active 1 + * @magentoApiDataFixture Magento/Wishlist/_files/wishlist_with_simple_product.php + */ + public function testAddAllWishlistItemsToCart(): void + { + $wishlist = $this->getWishlist(); + $this->assertNotEmpty($wishlist['customer']['wishlists'], 'No wishlist found'); + $customerWishlist = $wishlist['customer']['wishlists'][0]; + $wishlistId = $customerWishlist['id']; + + $sku2 = 'simple_product'; + $quantity2 = 2; + $addProductsToWishlistQuery = $this->addSecondProductToWishlist($wishlistId, $sku2, $quantity2); + $this->graphQlMutation($addProductsToWishlistQuery, [], '', $this->getHeaderMap()); + $addWishlistToCartQuery = $this->getAddAllItemsToCartQuery($wishlistId); + + $response = $this->graphQlMutation($addWishlistToCartQuery, [], '', $this->getHeaderMap()); + + $this->assertArrayHasKey('addWishlistItemsToCart', $response); + $this->assertArrayHasKey('status', $response['addWishlistItemsToCart']); + $this->assertEquals($response['addWishlistItemsToCart']['status'], true); + $wishlistAfterItemsAddedToCart = $this->getWishlist(); + $this->assertEmpty($wishlistAfterItemsAddedToCart['customer']['wishlists'][0]['items_v2']['items']); + $customerCart = $this->getCustomerCart('customer@example.com'); + $this->assertCount(2, $customerCart['customerCart']['items']); + } + + /** + * Authentication header map + * + * @param string $username + * @param string $password + * + * @return array + * + * @throws AuthenticationException + */ + private function getHeaderMap(string $username = 'customer@example.com', string $password = 'password'): array + { + $customerToken = $this->customerTokenService->createCustomerAccessToken($username, $password); + + return ['Authorization' => 'Bearer ' . $customerToken]; + } + + /** + * Returns GraphQl mutation string + * + * @param string $wishlistId + * @param string $itemId + * @return string + */ + private function getQuery( + string $wishlistId, + string $itemId + ): string { + return <<<MUTATION +mutation { + addWishlistItemsToCart + ( + wishlistId: "{$wishlistId}" + wishlistItemIds: ["{$itemId}"] + ) { + status + wishlist { + items_v2 { + items { + id + } + } + } + add_wishlist_items_to_cart_user_errors{ + message + code + wishlistId + wishlistItemId + } + } +} +MUTATION; + } + + /** + * Returns GraphQl mutation string + * + * @param string $wishlistId + * @param string $itemId + * @return string + */ + private function getAddAllItemsToCartQuery( + string $wishlistId + ): string { + return <<<MUTATION +mutation { + addWishlistItemsToCart + ( + wishlistId: "{$wishlistId}" + ) { + status + wishlist { + items_v2 { + items { + id + } + } + } + add_wishlist_items_to_cart_user_errors{ + message + code + } + } +} +MUTATION; + } + + /** + * Get wishlist result + * + * @param string $username + * @return array + * + * @throws Exception + */ + public function getWishlist(string $username = 'customer@example.com'): array + { + return $this->graphQlQuery($this->getCustomerWishlistQuery(), [], '', $this->getHeaderMap($username)); + } + + public function getCustomerCart(string $username): array + { + return $this->graphQlQuery($this->getCustomerCartQuery(), [], '', $this->getHeaderMap($username)); + } + + /** + * Get customer wishlist query + * + * @return string + */ + private function getCustomerWishlistQuery(): string + { + return <<<QUERY +query { + customer { + wishlists { + id + items_count + sharing_code + updated_at + items_v2 { + items { + id + quantity + description + product { + sku + } + } + } + } + } +} +QUERY; + } + + /** + * Returns the GraphQl mutation string for products added to wishlist + * + * @param string $wishlistId + * @param string $sku2 + * @param int $quantity2 + * @return string + */ + private function addSecondProductToWishlist( + string $wishlistId, + string $sku, + int $quantity + ): string { + return <<<MUTATION +mutation { + addProductsToWishlist( + wishlistId: "{$wishlistId}", + wishlistItems: [ + { + sku: "{$sku}" + quantity: {$quantity} + } + ] +) { + user_errors { + code + message + } + wishlist { + id + items_count + items_v2 { + items { + quantity + id + product {sku name} + } + page_info {current_page page_size total_pages} + } + } + } +} +MUTATION; + } + + /** + * Get customer cart query + * + * @return string + */ + private function getCustomerCartQuery(): string + { + return <<<QUERY +{customerCart { + id + total_quantity + items { + uid + quantity + product{sku} + } + } +} +QUERY; + } + + +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateBundleProductsFromWishlistTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateBundleProductsFromWishlistTest.php new file mode 100755 index 0000000000000..6aab22d36fa51 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateBundleProductsFromWishlistTest.php @@ -0,0 +1,325 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\Wishlist; + +use Exception; +use Magento\Framework\Exception\AuthenticationException; +use Magento\Integration\Api\CustomerTokenServiceInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\GraphQlAbstract; +use Magento\Wishlist\Model\WishlistFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Ui\Component\Form\Element\Select; + +/** + * Test coverage for updating a bundle product from wishlist + */ +class UpdateBundleProductsFromWishlistTest extends GraphQlAbstract +{ + /** + * @var CustomerTokenServiceInterface + */ + private $customerTokenService; + + /** + * @var WishlistFactory + */ + private $wishlistFactory; + + /** + * @var mixed + */ + private $productRepository; + + /** + * Set Up + */ + protected function setUp(): void + { + $objectManager = Bootstrap::getObjectManager(); + $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class); + $this->wishlistFactory = $objectManager->get(WishlistFactory::class); + $this->productRepository = $objectManager->get(ProductRepositoryInterface::class); + } + + /** + * Test that a wishlist item bundle product is properly updated. + * + * This includes the selected options for the bundle product. + * + * @magentoConfigFixture default_store wishlist/general/active 1 + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Bundle/_files/bundle_product_dropdown_options.php + * @throws Exception + */ + public function testUpdateBundleProductWithOptions(): void + { + // Add the fixture bundle product to the fixture customer's wishlist + $wishlist = $this->addProductToWishlist(); + $wishlistId = (int) $wishlist['addProductsToWishlist']['wishlist']['id']; + $wishlistItemId = (int) $wishlist['addProductsToWishlist']['wishlist']['items_v2']['items'][0]['id']; + $previousItemsCount = $wishlist['addProductsToWishlist']['wishlist']['items_count']; + + // Set the new values to update the wishlist item with + $newQuantity = 5; + $newDescription = 'This is a test.'; + $bundleProductOptions = $this->getBundleProductOptions('bundle-product-dropdown-options'); + $newBundleOptionUid = $bundleProductOptions[1]["uid"]; + + // Update the newly added wishlist item as the fixture customer + $query = $this->getUpdateQuery( + $wishlistItemId, + $newQuantity, + $newDescription, + $newBundleOptionUid, + $wishlistId + ); + $response = $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + + // Assert that the response has the expected base properties + self::assertArrayHasKey('updateProductsInWishlist', $response); + self::assertArrayHasKey('wishlist', $response['updateProductsInWishlist']); + + // Assert that the wishlist item count is unchanged + $responseWishlist = $response['updateProductsInWishlist']['wishlist']; + self::assertEquals($previousItemsCount, $responseWishlist['items_count']); + + // Assert that the wishlist item quantity and description are updated + $responseWishlistItem = $responseWishlist['items_v2']['items'][0]; + self::assertEquals($newQuantity, $responseWishlistItem['quantity']); + self::assertEquals($newDescription, $responseWishlistItem['description']); + + // Assert that the bundle option for this wishlist item is accurate + self::assertNotEmpty($responseWishlistItem['bundle_options']); + $responseBundleOption = $responseWishlistItem['bundle_options'][0]; + self::assertEquals('Dropdown Options', $responseBundleOption['label']); + self::assertEquals(Select::NAME, $responseBundleOption['type']); + + // Assert that the selected value for this bundle option is updated + self::assertNotEmpty($responseBundleOption['values']); + $responseOptionSelection = $responseBundleOption['values'][0]; + self::assertEquals($newBundleOptionUid, $responseOptionSelection['uid']); + self::assertEquals('Simple Product2', $responseOptionSelection['label']); + self::assertEquals(1, $responseOptionSelection['quantity']); + self::assertEquals(10, $responseOptionSelection['price']); + } + + /** + * Returns GraphQl mutation string + * + * @param int $wishlistItemId + * @param int $qty + * @param string $description + * @param string $bundleOptions + * @param int $wishlistId + * @return string + */ + private function getUpdateQuery( + int $wishlistItemId, + int $qty, + string $description, + string $bundleOptions, + int $wishlistId = 0 + ): string { + return <<<MUTATION +mutation { + updateProductsInWishlist( + wishlistId: {$wishlistId}, + wishlistItems: [ + { + wishlist_item_id: "{$wishlistItemId}" + quantity: {$qty} + description: "{$description}" + selected_options: [ + "{$bundleOptions}" + ] + } + ] +) { + user_errors { + code + message + } + wishlist { + id + sharing_code + items_count + updated_at + items_v2 { + items{ + id + quantity + description + ... on BundleWishlistItem { + bundle_options { + id + uid + label + type + values { + id + uid + label + quantity + price + } + } + } + } + } + } + } +} +MUTATION; + } + + /** + * Add a product to the to the wishlist. + * + * @return array + * @throws AuthenticationException + */ + private function addProductToWishlist(): array + { + $bundleProductSku = 'bundle-product-dropdown-options'; + $bundleProductOptions = $this->getBundleProductOptions($bundleProductSku); + $initialBundleOptionUid = $bundleProductOptions[0]["uid"]; + $initialQuantity = 2; + + $query = $this->getAddQuery($bundleProductSku, $initialQuantity, $initialBundleOptionUid); + return $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + } + + /** + * Returns the GraphQl mutation for adding an item to the wishlist. + * + * @param string $sku + * @param int $qty + * @param string $bundleOptions + * @param int $wishlistId + * @return string + */ + private function getAddQuery( + string $sku, + int $qty, + string $bundleOptions, + int $wishlistId = 0 + ): string { + return <<<MUTATION +mutation { + addProductsToWishlist( + wishlistId: {$wishlistId}, + wishlistItems: [ + { + sku: "{$sku}" + quantity: {$qty} + selected_options: [ + "{$bundleOptions}" + ] + } + ] +) { + user_errors { + code + message + } + wishlist { + id + sharing_code + items_count + updated_at + items_v2 { + items{ + id + quantity + added_at + ... on BundleWishlistItem { + bundle_options { + id + label + type + values { + id + label + quantity + price + } + } + } + } + } + } + } +} +MUTATION; + } + + /** + * Get the available options for the specified bundle product. + * + * @param string $bundleProductSku + * @return array + */ + private function getBundleProductOptions(string $bundleProductSku) + { + $query = $this->getBundleProductSearchQuery($bundleProductSku); + $response = $this->graphQlQuery($query); + + $bundleProduct = $response["products"]["items"][0]; + $bundleProductOptions = $bundleProduct["items"][0]["options"]; + + return $bundleProductOptions; + } + + /** + * Returns the GraphQl product search query for a bundle product. + * + * @param string $bundleProductSku + * @return string + */ + private function getBundleProductSearchQuery(string $bundleProductSku): string + { + return <<<QUERY +query { + products(search: "{$bundleProductSku}"){ + items { + uid + sku + name + ... on BundleProduct { + items { + uid + title + type + options { + id + uid + } + } + } + } + } +} +QUERY; + } + + /** + * Authentication header map + * + * @param string $username + * @param string $password + * @return array + * @throws AuthenticationException + */ + private function getHeaderMap(string $username = 'customer@example.com', string $password = 'password'): array + { + $customerToken = $this->customerTokenService->createCustomerAccessToken($username, $password); + + return ['Authorization' => 'Bearer ' . $customerToken]; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateProductsFromWishlistTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateProductsFromWishlistTest.php index 51ea9b461edaa..449fa8ae15ea8 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateProductsFromWishlistTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/UpdateProductsFromWishlistTest.php @@ -114,7 +114,7 @@ public function testUpdateProductInWishlistWithZeroQty() self::assertCount(1, $response['updateProductsInWishlist']['wishlist']['items_v2']); self::assertArrayHasKey('user_errors', $response['updateProductsInWishlist']); self::assertCount(1, $response['updateProductsInWishlist']['user_errors']); - $message = 'The quantity of a wish list item cannot be 0'; + $message = 'The quantity of a wishlist item cannot be 0'; self::assertEquals( $message, $response['updateProductsInWishlist']['user_errors'][0]['message'] diff --git a/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php index efa7341c36a40..c6394ad9561f7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php @@ -4,14 +4,18 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\GroupedProduct\Api; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Indexer\Model\Config; +use Magento\Catalog\Api\ProductLinkManagementInterface; use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\Webapi\Rest\Request; +use Magento\Indexer\Model\Config; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\WebapiAbstract; -class ProductLinkRepositoryTest extends \Magento\TestFramework\TestCase\WebapiAbstract +class ProductLinkRepositoryTest extends WebapiAbstract { const SERVICE_NAME = 'catalogProductLinkRepositoryV1'; const SERVICE_VERSION = 'V1'; @@ -55,7 +59,7 @@ public function testSave(): void 'linked_product_sku' => 'simple-1', 'position' => 3, 'extension_attributes' => [ - 'qty' => (float) 300.0000, + 'qty' => (float)300.0000, ], ]; @@ -72,12 +76,15 @@ public function testSave(): void ]; $this->_webApiCall($serviceInfo, ['entity' => $productData]); - /** @var \Magento\Catalog\Api\ProductLinkManagementInterface $linkManagement */ - $linkManagement = $this->objectManager->get(\Magento\Catalog\Api\ProductLinkManagementInterface::class); + /** @var ProductLinkManagementInterface $linkManagement */ + $linkManagement = $this->objectManager->get(ProductLinkManagementInterface::class); $actual = $linkManagement->getLinkedItemsByType($productSku, $linkType); - array_walk($actual, function (&$item) { - $item = $item->__toArray(); - }); + array_walk( + $actual, + function (&$item) { + $item = $item->__toArray(); + } + ); $this->assertEquals($productData, $actual[2]); } @@ -98,7 +105,7 @@ public function testLinkWithScheduledIndex(): void 'linked_product_sku' => $productSimple, 'position' => 3, 'extension_attributes' => [ - 'qty' => (float) 300.0000, + 'qty' => (float)300.0000, ], ]; $serviceInfo = [ @@ -124,6 +131,101 @@ public function testLinkWithScheduledIndex(): void $this->restoreIndexMode(); } + /** + * Verify empty out of stock grouped product is in stock after child has been added. + * + * @return void + * @magentoApiDataFixture Magento/GroupedProduct/_files/empty_grouped_product.php + * @magentoApiDataFixture Magento/Catalog/_files/product_virtual.php + */ + public function testGroupedProductIsInStockAfterAddChild(): void + { + $productSku = 'grouped-product'; + self::assertFalse($this->isProductInStock($productSku)); + $items = [ + 'sku' => $productSku, + 'link_type' => 'associated', + 'linked_product_type' => 'virtual', + 'linked_product_sku' => 'virtual-product', + 'position' => 3, + 'extension_attributes' => [ + 'qty' => 1, + ], + ]; + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH . $productSku . '/links', + 'httpMethod' => Request::HTTP_METHOD_PUT, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Save', + ], + ]; + $this->_webApiCall($serviceInfo, ['entity' => $items]); + self::assertTrue($this->isProductInStock($productSku)); + } + + /** + * Verify in stock grouped product is out stock after children have been removed. + * + * @return void + * @magentoApiDataFixture Magento/GroupedProduct/_files/product_grouped_with_simple.php + */ + public function testGroupedProductIsOutOfStockAfterRemoveChild(): void + { + $productSku = 'grouped'; + $childrenSkus = [ + 'simple_11', + 'simple_22', + ]; + self::assertTrue($this->isProductInStock($productSku)); + + foreach ($childrenSkus as $childSku) { + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH . $productSku . '/links/associated/' . $childSku, + 'httpMethod' => Request::HTTP_METHOD_DELETE, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'DeleteById', + ], + ]; + $requestData = ['sku' => $productSku, 'type' => 'associated', 'linkedProductSku' => $childSku]; + $this->_webApiCall($serviceInfo, $requestData); + } + + self::assertFalse($this->isProductInStock($productSku)); + } + + + /** + * Check product stock status. + * + * @param string $productSku + * @return bool + */ + private function isProductInStock(string $productSku): bool + { + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => '/V1/stockStatuses/' . $productSku, + 'httpMethod' => Request::HTTP_METHOD_GET, + ], + 'soap' => [ + 'service' => 'catalogInventoryStockRegistryV1', + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => 'catalogInventoryStockRegistryV1getStockStatusBySku', + ], + ]; + $result = $this->_webApiCall($serviceInfo, ['productSku' => $productSku]); + + return (bool)$result['stock_status']; + } + /** * @param string $productSku * @return array @@ -139,11 +241,11 @@ private function buildSearchCriteria(string $productSku): array [ 'field' => 'search_term', 'value' => $productSku, - ] - ] - ] - ] - ] + ], + ], + ], + ], + ], ]; } @@ -156,13 +258,13 @@ private function buildSearchServiceInfo(array $searchCriteria): array return [ 'rest' => [ 'resourcePath' => self::RESOURCE_PATH_SEARCH . '?' . http_build_query($searchCriteria), - 'httpMethod' => Request::HTTP_METHOD_GET + 'httpMethod' => Request::HTTP_METHOD_GET, ], 'soap' => [ 'service' => self::SERVICE_NAME_SEARCH, 'serviceVersion' => self::SERVICE_VERSION, - 'operation' => self::SERVICE_NAME_SEARCH . 'Search' - ] + 'operation' => self::SERVICE_NAME_SEARCH . 'Search', + ], ]; } diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php index bb2a4e68212cf..9208fb731bc51 100644 --- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php @@ -10,6 +10,8 @@ use Magento\Catalog\Model\ResourceModel\Product as ProductResource; use Magento\Framework\Webapi\Rest\Request; use Magento\Integration\Api\CustomerTokenServiceInterface; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\QuoteIdMask; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\WebapiAbstract; @@ -29,6 +31,11 @@ class CartAddingItemsTest extends WebapiAbstract */ private $productResource; + /** + * @var array + */ + private $createdQuotes = []; + /** * @inheritDoc */ @@ -38,6 +45,71 @@ protected function setUp(): void $this->productResource = $this->objectManager->get(ProductResource::class); } + protected function tearDown(): void + { + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); + foreach ($this->createdQuotes as $quoteId) { + $quote->load($quoteId); + $quote->delete(); + } + } + + /** + * Test qty for cart after adding grouped product qty specified only for goruped product. + * + * @magentoApiDataFixture Magento/GroupedProduct/_files/product_grouped_with_simple.php + * @magentoApiDataFixture Magento/Customer/_files/customer_one_address.php + * @return void + */ + public function testAddToCartGroupedWithParentQuantity(): void + { + $this->_markTestAsRestOnly(); + + // Get customer ID token + /** @var CustomerTokenServiceInterface $customerTokenService */ + $customerTokenService = $this->objectManager->create(CustomerTokenServiceInterface::class); + $token = $customerTokenService->createCustomerAccessToken( + 'customer_one_address@test.com', + 'password' + ); + + // Creating empty cart for registered customer. + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => '/V1/carts/mine', + 'httpMethod' => Request::HTTP_METHOD_POST, + 'token' => $token + ] + ]; + + $quoteId = $this->_webApiCall($serviceInfo, ['customerId' => 999]); // customerId 999 will get overridden + $this->assertGreaterThan(0, $quoteId); + + /** @var CartRepositoryInterface $cartRepository */ + $cartRepository = $this->objectManager->get(CartRepositoryInterface::class); + $quote = $cartRepository->get($quoteId); + + $quoteItems = $quote->getItemsCollection(); + foreach ($quoteItems as $item) { + $quote->removeItem($item->getId())->save(); + } + + $requestData = [ + 'cartItem' => [ + 'quote_id' => $quoteId, + 'sku' => 'grouped', + 'qty' => 7 + ] + ]; + $this->_webApiCall($this->getServiceInfoAddToCart($token), $requestData); + + foreach ($quote->getAllItems() as $item) { + $this->assertEquals(7, $item->getQty()); + } + $this->createdQuotes[] = $quoteId; + } + /** * Test price for cart after adding product to. * @@ -94,10 +166,11 @@ public function testPriceForCreatingQuoteFromEmptyCart() $paymentInfo = $this->_webApiCall($serviceInfoForGettingPaymentInfo); $this->assertEquals($paymentInfo['totals']['grand_total'], 10); - /** @var \Magento\Quote\Model\Quote $quote */ - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); - $quote->load($quoteId); - $quote->delete(); + $this->createdQuotes[] = $quoteId; +// /** @var \Magento\Quote\Model\Quote $quote */ +// $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); +// $quote->load($quoteId); +// $quote->delete(); } /** @@ -163,6 +236,7 @@ public function testAddToCartGroupedCustomQuantity(): void foreach ($quote->getAllItems() as $item) { $this->assertEquals($qtyData[$item->getProductId()], $item->getQty()); } + $this->createdQuotes[] = $quoteId; } /** @@ -210,6 +284,8 @@ public function testAddToCartGroupedCustomQuantityNotAllParamsSpecified(): void ] ]; + $this->createdQuotes[] = $quoteId; + $this->expectException(\Exception::class); $this->expectExceptionMessage('Please specify id and qty for grouped options.'); diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV2Test.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV2Test.php index acf2f3a95c5ce..89d21fead6088 100644 --- a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV2Test.php +++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV2Test.php @@ -7,11 +7,29 @@ class ServiceVersionV2Test extends \Magento\Webapi\Routing\BaseService { + /** + * @var string + */ + private $version; + + /** + * @var string + */ + private $soapService; + + /** + * @var string + */ + private $restResourcePath; + + /** + * @inheritDoc + */ protected function setUp(): void { - $this->_version = 'V2'; - $this->_soapService = 'testModule1AllSoapAndRestV2'; - $this->_restResourcePath = "/{$this->_version}/testmodule1/"; + $this->version = 'V2'; + $this->soapService = 'testModule1AllSoapAndRestV2'; + $this->restResourcePath = "/{$this->version}/testmodule1/"; } /** @@ -22,10 +40,10 @@ public function testItem() $itemId = 1; $serviceInfo = [ 'rest' => [ - 'resourcePath' => $this->_restResourcePath . $itemId, + 'resourcePath' => $this->restResourcePath . $itemId, 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET, ], - 'soap' => ['service' => $this->_soapService, 'operation' => $this->_soapService . 'Item'], + 'soap' => ['service' => $this->soapService, 'operation' => $this->soapService . 'Item'], ]; $requestData = ['id' => $itemId]; $item = $this->_webApiCall($serviceInfo, $requestData); @@ -44,10 +62,10 @@ public function testItems() ]; $serviceInfo = [ 'rest' => [ - 'resourcePath' => $this->_restResourcePath, + 'resourcePath' => $this->restResourcePath, 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET, ], - 'soap' => ['service' => $this->_soapService, 'operation' => $this->_soapService . 'Items'], + 'soap' => ['service' => $this->soapService, 'operation' => $this->soapService . 'Items'], ]; $item = $this->_webApiCall($serviceInfo); $this->assertEquals($itemArr, $item, 'Items were not retrieved'); @@ -71,12 +89,12 @@ public function testItemsWithFilters($filters, $expectedResult) } $serviceInfo = [ 'rest' => [ - 'resourcePath' => $this->_restResourcePath . $restFilter, + 'resourcePath' => $this->restResourcePath . $restFilter, 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET, ], 'soap' => [ - 'service' => $this->_soapService, - 'operation' => $this->_soapService . 'Items', + 'service' => $this->soapService, + 'operation' => $this->soapService . 'Items', ], ]; $requestData = []; @@ -113,10 +131,10 @@ public function testUpdate() $itemId = 1; $serviceInfo = [ 'rest' => [ - 'resourcePath' => $this->_restResourcePath . $itemId, + 'resourcePath' => $this->restResourcePath . $itemId, 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_PUT, ], - 'soap' => ['service' => $this->_soapService, 'operation' => $this->_soapService . 'Update'], + 'soap' => ['service' => $this->soapService, 'operation' => $this->soapService . 'Update'], ]; $requestData = ['entityItem' => ['id' => $itemId, 'name' => 'testName', 'price' => '4']]; $item = $this->_webApiCall($serviceInfo, $requestData); @@ -131,10 +149,10 @@ public function testDelete() $itemId = 1; $serviceInfo = [ 'rest' => [ - 'resourcePath' => $this->_restResourcePath . $itemId, + 'resourcePath' => $this->restResourcePath . $itemId, 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_DELETE, ], - 'soap' => ['service' => $this->_soapService, 'operation' => $this->_soapService . 'Delete'], + 'soap' => ['service' => $this->soapService, 'operation' => $this->soapService . 'Delete'], ]; $requestData = ['id' => $itemId, 'name' => 'testName']; $item = $this->_webApiCall($serviceInfo, $requestData); diff --git a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncBulkScheduleTest.php b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncBulkScheduleTest.php index 6073a03aba8b8..08ba18552c817 100644 --- a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncBulkScheduleTest.php +++ b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncBulkScheduleTest.php @@ -77,7 +77,7 @@ class AsyncBulkScheduleTest extends WebapiAbstract protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); - $this->logFilePath = TESTS_TEMP_DIR . "/MessageQueueTestLog.txt"; + $logFilePath = TESTS_TEMP_DIR . "/MessageQueueTestLog.txt"; $this->registry = $this->objectManager->get(Registry::class); $params = array_merge_recursive( @@ -88,7 +88,7 @@ protected function setUp(): void /** @var PublisherConsumerController publisherConsumerController */ $this->publisherConsumerController = $this->objectManager->create(PublisherConsumerController::class, [ 'consumers' => $this->consumers, - 'logFilePath' => $this->logFilePath, + 'logFilePath' => $logFilePath, 'appInitParams' => $params, ]); $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); @@ -394,7 +394,6 @@ private function getSimpleProductData($productData = []) ProductInterface::TYPE_ID => 'simple', ProductInterface::PRICE => 3.62, ProductInterface::STATUS => 1, - ProductInterface::TYPE_ID => 'simple', ProductInterface::ATTRIBUTE_SET_ID => 4, 'custom_attributes' => [ ['attribute_code' => 'cost', 'value' => ''], diff --git a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleCustomRouteTest.php b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleCustomRouteTest.php index 08894a1ee8793..35663b3f27bf8 100644 --- a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleCustomRouteTest.php +++ b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleCustomRouteTest.php @@ -72,7 +72,7 @@ class AsyncScheduleCustomRouteTest extends WebapiAbstract protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); - $this->logFilePath = TESTS_TEMP_DIR . "/MessageQueueTestLog.txt"; + $logFilePath = TESTS_TEMP_DIR . "/MessageQueueTestLog.txt"; $this->registry = $this->objectManager->get(Registry::class); $params = array_merge_recursive( @@ -83,7 +83,7 @@ protected function setUp(): void /** @var PublisherConsumerController publisherConsumerController */ $this->publisherConsumerController = $this->objectManager->create(PublisherConsumerController::class, [ 'consumers' => $this->consumers, - 'logFilePath' => $this->logFilePath, + 'logFilePath' => $logFilePath, 'appInitParams' => $params, ]); $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); @@ -219,7 +219,6 @@ private function getSimpleProductData($productData = []) ProductInterface::TYPE_ID => 'simple', ProductInterface::PRICE => 3.62, ProductInterface::STATUS => 1, - ProductInterface::TYPE_ID => 'simple', ProductInterface::ATTRIBUTE_SET_ID => 4, 'custom_attributes' => [ ['attribute_code' => 'cost', 'value' => ''], diff --git a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleTest.php b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleTest.php index 0999992cfc85b..4068b9f8d6e43 100644 --- a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleTest.php +++ b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleTest.php @@ -75,7 +75,7 @@ class AsyncScheduleTest extends WebapiAbstract protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); - $this->logFilePath = TESTS_TEMP_DIR . "/MessageQueueTestLog.txt"; + $logFilePath = TESTS_TEMP_DIR . "/MessageQueueTestLog.txt"; $this->registry = $this->objectManager->get(Registry::class); $params = array_merge_recursive( @@ -86,7 +86,7 @@ protected function setUp(): void /** @var PublisherConsumerController publisherConsumerController */ $this->publisherConsumerController = $this->objectManager->create(PublisherConsumerController::class, [ 'consumers' => $this->consumers, - 'logFilePath' => $this->logFilePath, + 'logFilePath' => $logFilePath, 'appInitParams' => $params, ]); $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); @@ -259,7 +259,6 @@ private function getSimpleProductData($productData = []) ProductInterface::TYPE_ID => 'simple', ProductInterface::PRICE => 3.62, ProductInterface::STATUS => 1, - ProductInterface::TYPE_ID => 'simple', ProductInterface::ATTRIBUTE_SET_ID => 4, 'custom_attributes' => [ ['attribute_code' => 'cost', 'value' => ''], diff --git a/dev/tests/integration/etc/post-install-setup-command-config.php.dist b/dev/tests/integration/etc/post-install-setup-command-config.php.dist new file mode 100644 index 0000000000000..7f451546f6738 --- /dev/null +++ b/dev/tests/integration/etc/post-install-setup-command-config.php.dist @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +// List of bin/magento setup CLI commands to run after setup:install +return [ + /* + [ + 'command' => 'setup:config:set', + 'config' => [ + '--remote-storage-driver' => 'aws-s3', + '--remote-storage-bucket' => 'myBucket', + '--remote-storage-region' => 'us-east-1', + ] + ] + */ +]; diff --git a/dev/tests/integration/framework/Magento/TestFramework/Application.php b/dev/tests/integration/framework/Magento/TestFramework/Application.php index 43bb7852e2441..2708586416daf 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Application.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Application.php @@ -14,6 +14,7 @@ use Magento\Framework\Mail; use Magento\TestFramework; use Psr\Log\LoggerInterface; +use DomainException; /** * Encapsulates application installation, initialization and uninstall. @@ -49,6 +50,13 @@ class Application */ private $installConfigFile; + /** + * Configuration file that contains array of post-installation commands to run through bin/magento CLI tool. + * + * @var string|null + */ + private $postInstallSetupCommandsFile; + /** * The loaded installation parameters. * @@ -56,6 +64,13 @@ class Application */ protected $installConfig; + /** + * The loaded post-installation commands. + * + * @var array + */ + private $postInstallSetupCommands; + /** * Application *.xml configuration files. * @@ -153,12 +168,13 @@ class Application * * @param \Magento\Framework\Shell $shell * @param string $installDir - * @param array $installConfigFile + * @param string $installConfigFile * @param string $globalConfigFile * @param string $globalConfigDir * @param string $appMode * @param AutoloaderInterface $autoloadWrapper * @param bool|null $loadTestExtensionAttributes + * @param string|null $postInstallSetupCommandsFile */ public function __construct( \Magento\Framework\Shell $shell, @@ -168,7 +184,8 @@ public function __construct( $globalConfigDir, $appMode, AutoloaderInterface $autoloadWrapper, - $loadTestExtensionAttributes = false + $loadTestExtensionAttributes = false, + $postInstallSetupCommandsFile = null ) { if (getcwd() != BP . '/dev/tests/integration') { // phpcs:ignore Magento2.Functions.DiscouragedFunction @@ -176,6 +193,7 @@ public function __construct( } $this->_shell = $shell; $this->installConfigFile = $installConfigFile; + $this->postInstallSetupCommandsFile = $postInstallSetupCommandsFile; // phpcs:ignore Magento2.Functions.DiscouragedFunction $this->_globalConfigDir = realpath($globalConfigDir); $this->_appMode = $appMode; @@ -262,6 +280,22 @@ protected function getInstallConfig() return $this->installConfig; } + /** + * Gets post-installation commands. + * + * @return array + */ + protected function getPostInstallSetupCommands() + { + if (null === $this->postInstallSetupCommandsFile) { + $this->postInstallSetupCommands = []; + } elseif (null === $this->postInstallSetupCommands) { + // phpcs:ignore Magento2.Security.IncludeFile + $this->postInstallSetupCommands = include $this->postInstallSetupCommandsFile; + } + return $this->postInstallSetupCommands; + } + /** * Gets deployment configuration path. * @@ -525,6 +559,43 @@ public function install($cleanup) array_merge([BP . '/bin/magento'], array_values($installParams)) ); + // run post-install setup commands + $postInstallSetupCommands = $this->getPostInstallSetupCommands(); + + foreach ($postInstallSetupCommands as $postInstallSetupCommand) { + if (!isset($postInstallSetupCommand['command'])) { + throw new DomainException('"command" must be present in post install setup command arrays'); + } + + $command = $postInstallSetupCommand['command']; + $argumentsAndOptions = $postInstallSetupCommand['config']; + + $argumentsAndOptionsPlaceholders = []; + + foreach (array_keys($argumentsAndOptions) as $key) { + $isArgument = is_numeric($key); + + if ($isArgument) { + $argumentsAndOptionsPlaceholders[] = '%s'; + } else { + $argumentsAndOptionsPlaceholders[] = "$key=%s"; + } + } + + $argumentsAndOptionsPlaceholders[] = "--magento-init-params=%s"; + $argumentsAndOptions[] = $this->getInitParamsQuery(); + + $this->_shell->execute( + PHP_BINARY . ' -f %s %s -vvv ' . implode(' ', array_values($argumentsAndOptionsPlaceholders)), + // phpcs:ignore Magento2.Performance.ForeachArrayMerge + array_merge( + [BP . '/bin/magento'], + [$command], + array_values($argumentsAndOptions) + ), + ); + } + // enable only specified list of caches $initParamsQuery = $this->getInitParamsQuery(); $this->_shell->execute( diff --git a/dev/tests/integration/framework/Magento/TestFramework/Bundle/Model/PrepareBundleLinks.php b/dev/tests/integration/framework/Magento/TestFramework/Bundle/Model/PrepareBundleLinks.php index 6a7d034d5892f..4283b56bfec9d 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Bundle/Model/PrepareBundleLinks.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Bundle/Model/PrepareBundleLinks.php @@ -61,14 +61,15 @@ public function execute( foreach ($product->getBundleOptionsData() as $key => $optionData) { $option = $this->optionLinkFactory->create(['data' => $optionData]); $option->setSku($product->getSku()); - $option->setOptionId(null); + $optionId = $optionData['option_id'] ?? null; + $option->setOptionId($optionId); $links = []; $bundleLinks = $product->getBundleSelectionsData(); foreach ($bundleLinks[$key] as $linkData) { $link = $this->linkFactory->create(['data' => $linkData]); $link->setQty($linkData['selection_qty']); $priceType = $price = null; - if ($product->getPriceType() === Price::PRICE_TYPE_FIXED) { + if ((int)$product->getPriceType() === Price::PRICE_TYPE_FIXED) { $priceType = $linkData['selection_price_type'] ?? null; $price = $linkData['selection_price_value'] ?? null; } diff --git a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php index f569c515821c4..33e297390ac4a 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php @@ -9,6 +9,11 @@ class Listener implements \PHPUnit\Framework\TestListener { + /** + * @var \Magento\TestFramework\ErrorLog\Logger + */ + private $logger; + /** * @inheritDoc * @SuppressWarnings(PHPMD.ShortVariable) diff --git a/dev/tests/integration/framework/Magento/TestFramework/HTTP/AsyncClientInterfaceMock.php b/dev/tests/integration/framework/Magento/TestFramework/HTTP/AsyncClientInterfaceMock.php index 8f2ae2a7b0bdf..bc0ddfd7cb0b9 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/HTTP/AsyncClientInterfaceMock.php +++ b/dev/tests/integration/framework/Magento/TestFramework/HTTP/AsyncClientInterfaceMock.php @@ -97,10 +97,10 @@ public function clearRequests() /** * Next responses will be as given. * - * @param HttpResponseDeferredInterface $mockDeferredResponse + * @param HttpResponseDeferredInterface|null $mockDeferredResponse * @return self */ - public function setDeferredResponseMock(HttpResponseDeferredInterface $mockDeferredResponse): self + public function setDeferredResponseMock(?HttpResponseDeferredInterface $mockDeferredResponse): self { $this->mockDeferredResponse = $mockDeferredResponse; diff --git a/dev/tests/integration/framework/Magento/TestFramework/Helper/Xpath.php b/dev/tests/integration/framework/Magento/TestFramework/Helper/Xpath.php index 62ffbcfe6c4a0..44ac85f790f6c 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Helper/Xpath.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Helper/Xpath.php @@ -5,6 +5,13 @@ */ namespace Magento\TestFramework\Helper; +use DOMDocument; +use DOMNodeList; +use DOMXPath; + +/** + * Xpath query helper + */ class Xpath { /** @@ -16,12 +23,46 @@ class Xpath */ public static function getElementsCountForXpath($xpath, $html) { - $domDocument = new \DOMDocument('1.0', 'UTF-8'); + $nodes = self::getElementsForXpath((string) $xpath, (string) $html); + return $nodes->length; + } + + /** + * Get elements for XPath + * + * @param string $xpath + * @param string $html + * @return DOMNodeList + */ + public static function getElementsForXpath(string $xpath, string $html): DOMNodeList + { + $domXpath = self::getDOMXpath($html); + return $domXpath->query($xpath); + } + + /** + * Get dom document instance + * + * @param string $html + * @return DOMDocument + */ + public static function getDOMDocument(string $html): DOMDocument + { + $domDocument = new DOMDocument('1.0', 'UTF-8'); libxml_use_internal_errors(true); $domDocument->loadHTML($html); libxml_use_internal_errors(false); - $domXpath = new \DOMXPath($domDocument); - $nodes = $domXpath->query($xpath); - return $nodes->length; + return $domDocument; + } + + /** + * Get dom xpath instance + * + * @param string $html + * @return DOMXPath + */ + public static function getDOMXpath(string $html): DOMXPath + { + return new DOMXPath(self::getDOMDocument($html)); } } diff --git a/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php b/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php index 7319575426812..18accca64d0c8 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php @@ -5,10 +5,17 @@ */ namespace Magento\TestFramework\Listener; +use PHPUnit\Framework\Test; +use PHPUnit\Framework\AssertionFailedError; +use PHPUnit\Framework\TestSuite; +use PHPUnit\Framework\Warning; +use PHPUnit\Runner\BaseTestRunner; +use PHPUnit\Util\TestDox\NamePrettifier; + class ExtededTestdox extends \PHPUnit\Util\Printer implements \PHPUnit\Framework\TestListener { /** - * @var \PHPUnit_Util_TestDox_NamePrettifier + * @var NamePrettifier */ protected $prettifier; @@ -32,6 +39,11 @@ class ExtededTestdox extends \PHPUnit\Util\Printer implements \PHPUnit\Framework */ protected $successful = 0; + /** + * @var integer + */ + protected $warning = 0; + /** * @var integer */ @@ -76,7 +88,7 @@ public function __construct($out = null) { parent::__construct($out); - $this->prettifier = new \PHPUnit\Util\TestDox\NamePrettifier(); + $this->prettifier = new NamePrettifier(); $this->startRun(); } @@ -84,7 +96,7 @@ public function __construct($out = null) * Flush buffer and close output. * */ - public function flush() + public function flush(): void { $this->doEndClass(); $this->endRun(); @@ -95,31 +107,47 @@ public function flush() /** * An error occurred. * - * @param \PHPUnit\Framework\Test $test - * @param \Exception $e + * @param Test $test + * @param \Throwable $e * @param float $time * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addError(Test $test, \Throwable $t, float $time): void { if ($test instanceof $this->testTypeOfInterest) { - $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_ERROR; + $this->testStatus = BaseTestRunner::STATUS_ERROR; $this->failed++; } } + /** + * A warning occurred. + * + * @param Test $test + * @param Warning $e + * @param float $time + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function addWarning(Test $test, Warning $e, float $time): void + { + if ($test instanceof $this->testTypeOfInterest) { + $this->testStatus = BaseTestRunner::STATUS_FAILURE; + $this->warning++; + } + } + /** * A failure occurred. * - * @param \PHPUnit\Framework\Test $test + * @param Test $test * @param \PHPUnit\Framework\AssertionFailedError $e * @param float $time * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\AssertionFailedError $e, $time) + public function addFailure(Test $test, AssertionFailedError $e, float $time): void { if ($test instanceof $this->testTypeOfInterest) { - $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_FAILURE; + $this->testStatus = BaseTestRunner::STATUS_FAILURE; $this->failed++; } } @@ -127,15 +155,15 @@ public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Ass /** * Incomplete test. * - * @param \PHPUnit\Framework\Test $test - * @param \Exception $e + * @param Test $test + * @param \Throwable $e * @param float $time * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addIncompleteTest(Test $test, \Throwable $t, float $time): void { if ($test instanceof $this->testTypeOfInterest) { - $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_INCOMPLETE; + $this->testStatus = BaseTestRunner::STATUS_INCOMPLETE; $this->incomplete++; } } @@ -143,16 +171,16 @@ public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, /** * Skipped test. * - * @param \PHPUnit\Framework\Test $test - * @param \Exception $e + * @param Test $test + * @param \Throwable $e * @param float $time * @since Method available since Release 3.0.0 * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addSkippedTest(Test $test, \Throwable $t, float $time): void { if ($test instanceof $this->testTypeOfInterest) { - $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_SKIPPED; + $this->testStatus = BaseTestRunner::STATUS_SKIPPED; $this->skipped++; } } @@ -160,16 +188,16 @@ public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $ti /** * Risky test. * - * @param \PHPUnit\Framework\Test $test - * @param \Exception $e + * @param Test $test + * @param \Throwable $e * @param float $time * @since Method available since Release 4.0.0 * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time) + public function addRiskyTest(Test $test, \Throwable $t, float $time): void { if ($test instanceof $this->testTypeOfInterest) { - $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_RISKY; + $this->testStatus = BaseTestRunner::STATUS_RISKY; $this->risky++; } } @@ -177,31 +205,31 @@ public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time /** * A testsuite started. * - * @param \PHPUnit\Framework\TestSuite $suite + * @param TestSuite $suite * @since Method available since Release 2.2.0 * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function startTestSuite(\PHPUnit\Framework\TestSuite $suite) + public function startTestSuite(TestSuite $suite): void { } /** * A testsuite ended. * - * @param \PHPUnit\Framework\TestSuite $suite + * @param TestSuite $suite * @since Method available since Release 2.2.0 * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function endTestSuite(\PHPUnit\Framework\TestSuite $suite) + public function endTestSuite(TestSuite $suite): void { } /** * A test started. * - * @param \PHPUnit\Framework\Test $test + * @param Test $test */ - public function startTest(\PHPUnit\Framework\Test $test) + public function startTest(Test $test): void { if ($test instanceof $this->testTypeOfInterest) { $class = get_class($test); @@ -220,30 +248,30 @@ public function startTest(\PHPUnit\Framework\Test $test) $this->write('.'); $this->currentTestMethodPrettified = $this->prettifier->prettifyTestMethod($test->getName(false)); - $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_PASSED; + $this->testStatus = BaseTestRunner::STATUS_PASSED; } } /** * A test ended. * - * @param \PHPUnit\Framework\Test $test - * @param float $time + * @param Test $test + * @param float $time */ - public function endTest(\PHPUnit\Framework\Test $test, $time) + public function endTest(Test $test, float $time): void { if ($test instanceof $this->testTypeOfInterest) { if (!isset($this->tests[$this->currentTestMethodPrettified])) { $this->tests[$this->currentTestMethodPrettified] = ['success' => 0, 'failure' => 0, 'time' => 0]; } - if ($this->testStatus == \PHPUnit\Runner\BaseTestRunner::STATUS_PASSED) { + if ($this->testStatus == BaseTestRunner::STATUS_PASSED) { $this->tests[$this->currentTestMethodPrettified]['success']++; } - if ($this->testStatus == \PHPUnit\Runner\BaseTestRunner::STATUS_ERROR) { + if ($this->testStatus == BaseTestRunner::STATUS_ERROR) { $this->tests[$this->currentTestMethodPrettified]['failure']++; } - if ($this->testStatus == \PHPUnit\Runner\BaseTestRunner::STATUS_FAILURE) { + if ($this->testStatus == BaseTestRunner::STATUS_FAILURE) { $this->tests[$this->currentTestMethodPrettified]['failure']++; } $this->tests[$this->currentTestMethodPrettified]['time'] += $time; diff --git a/dev/tests/integration/framework/Magento/TestFramework/MessageQueue/PublisherConsumerController.php b/dev/tests/integration/framework/Magento/TestFramework/MessageQueue/PublisherConsumerController.php index 32240e68ae73e..53ee4470eb9e3 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/MessageQueue/PublisherConsumerController.php +++ b/dev/tests/integration/framework/Magento/TestFramework/MessageQueue/PublisherConsumerController.php @@ -138,6 +138,8 @@ public function stopConsumers() { foreach ($this->consumers as $consumer) { foreach ($this->getConsumerProcessIds($consumer) as $consumerProcessId) { + // exec() have to be here since this is test. + // phpcs:ignore Magento2.Security.InsecureFunction exec("kill {$consumerProcessId}"); } } @@ -165,6 +167,8 @@ public function getConsumersProcessIds() */ private function getConsumerProcessIds($consumer) { + // exec() have to be here since this is test. + // phpcs:ignore Magento2.Security.InsecureFunction exec("ps ax | grep -v grep | grep '{$this->getConsumerStartCommand($consumer)}' | awk '{print $1}'", $output); return $output; } @@ -232,6 +236,8 @@ public function startConsumers(): void { foreach ($this->consumers as $consumer) { if (!$this->getConsumerProcessIds($consumer)) { + // exec() have to be here since this is test. + // phpcs:ignore Magento2.Security.InsecureFunction exec("{$this->getConsumerStartCommand($consumer, true)} > /dev/null &"); } sleep(5); diff --git a/dev/tests/integration/framework/bootstrap.php b/dev/tests/integration/framework/bootstrap.php index acf3056c8d923..114a6de74b5d7 100644 --- a/dev/tests/integration/framework/bootstrap.php +++ b/dev/tests/integration/framework/bootstrap.php @@ -54,6 +54,9 @@ if (!file_exists($installConfigFile)) { $installConfigFile .= '.dist'; } + + $postInstallSetupConfigFile = $settings->getAsConfigFile('TESTS_POST_INSTALL_SETUP_COMMAND_CONFIG_FILE'); + $globalConfigFile = $settings->getAsConfigFile('TESTS_GLOBAL_CONFIG_FILE'); // phpcs:ignore Magento2.Functions.DiscouragedFunction if (!file_exists($globalConfigFile)) { @@ -69,7 +72,8 @@ $settings->get('TESTS_GLOBAL_CONFIG_DIR'), $settings->get('TESTS_MAGENTO_MODE'), AutoloaderRegistry::getAutoloader(), - true + true, + $postInstallSetupConfigFile ); $bootstrap = new \Magento\TestFramework\Bootstrap( diff --git a/dev/tests/integration/framework/tests/unit/phpunit.xml.dist b/dev/tests/integration/framework/tests/unit/phpunit.xml.dist index d15c5f1818784..881f1a862aea5 100644 --- a/dev/tests/integration/framework/tests/unit/phpunit.xml.dist +++ b/dev/tests/integration/framework/tests/unit/phpunit.xml.dist @@ -22,7 +22,7 @@ <ini name="date.timezone" value="America/Los_Angeles"/> </php> <listeners> - <listener class="Yandex\Allure\Adapter\AllureAdapter"> + <listener class="Yandex\Allure\PhpUnit\AllurePhpUnit"> <arguments> <string>var/allure-results</string> <!-- XML files output directory --> <boolean>true</boolean> <!-- Whether to delete previous results on rerun --> diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php index 3dc4182e699a8..e8334217bc58c 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php @@ -6,6 +6,7 @@ namespace Magento\Test; +use DomainException; use Magento\Framework\App\Area; use Magento\Framework\App\AreaList; use Magento\Framework\App\Bootstrap; @@ -16,9 +17,12 @@ use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Shell; use Magento\TestFramework\Application; +use Magento\TestFramework\Helper\Bootstrap as TestFrameworkBootstrap; +use Magento\TestFramework\Db\Mysql; +use ReflectionClass; /** - * Provide tests for \Magento\TestFramework\Application. + * Provides tests for \Magento\TestFramework\Application. */ class ApplicationTest extends \PHPUnit\Framework\TestCase { @@ -34,27 +38,42 @@ class ApplicationTest extends \PHPUnit\Framework\TestCase */ private $tempDir; + /** + * @var Shell|\PHPUnit\Framework\MockObject\MockObject + */ + private $shell; + + /** + * @var ClassLoaderWrapper|\PHPUnit\Framework\MockObject\MockObject + */ + private $autoloadWrapper; + + /** + * @var string + */ + private $appMode; + /** * @inheritdoc */ protected function setUp(): void { - /** @var Shell|\PHPUnit\Framework\MockObject\MockObject $shell */ - $shell = $this->createMock(Shell::class); - /** @var ClassLoaderWrapper|\PHPUnit\Framework\MockObject\MockObject $autoloadWrapper */ - $autoloadWrapper = $this->getMockBuilder(ClassLoaderWrapper::class) + $this->shell = $this->createMock(Shell::class); + + $this->autoloadWrapper = $this->getMockBuilder(ClassLoaderWrapper::class) ->disableOriginalConstructor()->getMock(); + $this->tempDir = '/temp/dir'; - $appMode = \Magento\Framework\App\State::MODE_DEVELOPER; + $this->appMode = \Magento\Framework\App\State::MODE_DEVELOPER; $this->subject = new Application( - $shell, + $this->shell, $this->tempDir, 'config.php', 'global-config.php', '', - $appMode, - $autoloadWrapper + $this->appMode, + $this->autoloadWrapper ); } @@ -82,6 +101,161 @@ public function testConstructor() ); } + /** + * Test installation and post-installation shell commands + * + * @param string $installConfigFilePath + * @param string $globalConfigFilePath + * @param string|null $postInstallSetupCommandsFilePath + * @param array $expectedShellExecutionCalls + * @param bool $isExceptionExpected + * @dataProvider installDataProvider + */ + public function testInstall( + string $installConfigFilePath, + string $globalConfigFilePath, + ?string $postInstallSetupCommandsFilePath, + array $expectedShellExecutionCalls, + bool $isExceptionExpected = false + ) { + $tmpDir = sys_get_temp_dir(); + + $subject = new Application( + $this->shell, + $tmpDir, + $installConfigFilePath, + $globalConfigFilePath, + $tmpDir, + $this->appMode, + $this->autoloadWrapper, + false, + $postInstallSetupCommandsFilePath + ); + + // bypass db dump logic + $dbMock = $this->getMockBuilder(Mysql::class)->disableOriginalConstructor()->getMock(); + + $reflectionSubject = new ReflectionClass($subject); + $dbProperty = $reflectionSubject->getProperty('_db'); + $dbProperty->setAccessible(true); + $dbProperty->setValue($subject, $dbMock); + + $dbMock + ->expects($this->any()) + ->method('isDbDumpExists') + ->willReturnOnConsecutiveCalls( + false, + true + ); + + // Add expected shell execution calls + foreach ($expectedShellExecutionCalls as $index => $expectedShellExecutionArguments) { + $this->shell + ->expects($this->at($index)) + ->method('execute') + ->with(...$expectedShellExecutionArguments); + } + + if ($isExceptionExpected) { + $this->expectException(DomainException::class); + $this->expectExceptionMessage('"command" must be present in post install setup command arrays'); + } else { + $this->shell + ->expects($this->at($index + 1)) + ->method('execute') + ->with( + PHP_BINARY . ' -f %s cache:disable -vvv --bootstrap=%s', + [BP . '/bin/magento', $this->getInitParamsQuery($tmpDir)] + ); + } + + $subject->install(false); + } + + /** + * Data Provider for testInstall + * + * @return array + */ + public function installDataProvider() + { + $installShellCommandExpectation = [ + PHP_BINARY . ' -f %s setup:install -vvv ' . + '--db-host=%s --db-user=%s --db-password=%s --db-name=%s --db-prefix=%s ' . + '--magento-init-params=%s', + [ + BP . '/bin/magento', + '/tmp/mysql.sock', + 'root', + '', + 'magento_integration_tests', + '', + $this->getInitParamsQuery(sys_get_temp_dir()), + ] + ]; + + return [ + 'no post install setup command file' => [ + dirname(__FILE__) . '/_files/install-config-mysql1.php', + dirname(__FILE__) . '/_files/config-global-1.php', + null, + [ + $installShellCommandExpectation + ] + ], + 'valid post install setup command' => [ + dirname(__FILE__) . '/_files/install-config-mysql1.php', + dirname(__FILE__) . '/_files/config-global-1.php', + dirname(__FILE__) . '/_files/post-install-setup-command-config1.php', + [ + $installShellCommandExpectation, + [ + PHP_BINARY . ' -f %s %s -vvv ' . + '--host=%s --dbname=%s --username=%s --password=%s --magento-init-params=%s', + [ + BP . '/bin/magento', + 'setup:db-schema:add-slave', + '/tmp/mysql.sock', + 'magento_replica', + 'root', + 'secret', + $this->getInitParamsQuery(sys_get_temp_dir()), + ] + ] + ] + ], + 'post install setup command with both options and arguments' => [ + dirname(__FILE__) . '/_files/install-config-mysql1.php', + dirname(__FILE__) . '/_files/config-global-1.php', + dirname(__FILE__) . '/_files/post-install-setup-command-config3.php', + [ + $installShellCommandExpectation, + [ + PHP_BINARY . ' -f %s %s -vvv %s %s --option1=%s -option2=%s --magento-init-params=%s', + [ + BP . '/bin/magento', + 'fake:command', + 'foo', + 'bar', + 'baz', + 'qux', + $this->getInitParamsQuery(sys_get_temp_dir()), + ] + ] + ] + ], + 'post install setup command missing required value for "command"' => [ + dirname(__FILE__) . '/_files/install-config-mysql1.php', + dirname(__FILE__) . '/_files/config-global-1.php', + dirname(__FILE__) . '/_files/post-install-setup-command-config4.php', + [ + $installShellCommandExpectation + ], + true + ], + ]; + } + /** * Test \Magento\TestFramework\Application will correctly load specified areas. * @@ -136,7 +310,7 @@ public function testPartialLoadArea(string $areaCode) $areaList ); - \Magento\TestFramework\Helper\Bootstrap::setObjectManager($objectManager); + TestFrameworkBootstrap::setObjectManager($objectManager); $this->subject->loadArea($areaCode); } @@ -166,4 +340,26 @@ public function partialLoadAreaDataProvider() ], ]; } + + /** + * Generate magento-init-params query responsible for dictating application paths to the magento command line + * + * @param string $dir The base application directory + * @return string + */ + private function getInitParamsQuery(string $dir) + { + return str_replace( + '%s', + $dir, + 'MAGE_DIRS[etc][path]=%s/etc&MAGE_DIRS[var][path]=%s/var&' . + 'MAGE_DIRS[var_export][path]=%s/var/export&MAGE_DIRS[media][path]=%s/pub/media&' . + 'MAGE_DIRS[static][path]=%s/pub/static&' . + 'MAGE_DIRS[view_preprocessed][path]=%s/var/view_preprocessed/pub/static&' . + 'MAGE_DIRS[code][path]=%s/generated/code&MAGE_DIRS[cache][path]=%s/var/cache&' . + 'MAGE_DIRS[log][path]=%s/var/log&MAGE_DIRS[session][path]=%s/var/session&' . + 'MAGE_DIRS[tmp][path]=%s/var/tmp&MAGE_DIRS[upload][path]=%s/var/upload&' . + 'MAGE_DIRS[pub][path]=%s/pub&MAGE_DIRS[import_export][path]=%s/var&MAGE_MODE=developer' + ); + } } diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/MemoryTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/MemoryTest.php index 989b247d3ec46..0f91f2bc1a2e1 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/MemoryTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/MemoryTest.php @@ -9,6 +9,8 @@ */ namespace Magento\Test\Bootstrap; +use Magento\TestFramework\MemoryLimit; + class MemoryTest extends \PHPUnit\Framework\TestCase { /** @@ -17,7 +19,7 @@ class MemoryTest extends \PHPUnit\Framework\TestCase protected $_object; /** - * @var \Magento\TestFramework\MemoryLimit|\PHPUnit\Framework\MockObject\MockObject + * @var MemoryLimit|\PHPUnit\Framework\MockObject\MockObject */ protected $_memoryLimit; @@ -28,8 +30,10 @@ class MemoryTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - $this->_memoryLimit = $this->createPartialMock(\Magento\TestFramework\MemoryLimit::class, ['printStats']); - $this->_activationPolicy = $this->createPartialMock(\stdClass::class, ['register_shutdown_function']); + $this->_memoryLimit = $this->createPartialMock(MemoryLimit::class, ['printStats']); + $this->_activationPolicy = $this->getMockBuilder(\stdClass::class) + ->addMethods(['register_shutdown_function']) + ->getMock(); $this->_object = new \Magento\TestFramework\Bootstrap\Memory( $this->_memoryLimit, [$this->_activationPolicy, 'register_shutdown_function'] diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php index 8fa516e478966..0c8032280649e 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php @@ -105,7 +105,6 @@ protected function tearDown(): void $this->_envBootstrap = null; $this->_docBlockBootstrap = null; $this->_profilerBootstrap = null; - $this->_memoryBootstrap = null; $this->_shell = null; } @@ -121,7 +120,7 @@ public function testRunBootstrap() ->with($this->identicalTo($_SERVER)); $this->_envBootstrap->expects($this->once()) ->method('emulateSession') - ->with($this->identicalTo(isset($_SESSION) ? $_SESSION : null)); + ->with($this->identicalTo($_SESSION)); $memUsageLimit = '100B'; $memLeakLimit = '60B'; diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EventManagerTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EventManagerTest.php index 7584912a12b98..f4e2882a2b081 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EventManagerTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EventManagerTest.php @@ -28,8 +28,12 @@ class EventManagerTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - $this->_subscriberOne = $this->createPartialMock(\stdClass::class, ['testEvent']); - $this->_subscriberTwo = $this->createPartialMock(\stdClass::class, ['testEvent']); + $this->_subscriberOne = $this->getMockBuilder(\stdClass::class) + ->addMethods(['testEvent']) + ->getMock(); + $this->_subscriberTwo = $this->getMockBuilder(\stdClass::class) + ->addMethods(['testEvent']) + ->getMock(); $this->_eventManager = new \Magento\TestFramework\EventManager( [$this->_subscriberOne, $this->_subscriberTwo] ); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php index 55a6616d46156..bd6a995816d4d 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php @@ -47,10 +47,11 @@ protected function setUp(): void \Magento\TestFramework\Application::class, ['getTempDir', 'getInitParams', 'reinitialize', 'run'] ); - $this->_bootstrap = $this->createPartialMock( - \Magento\TestFramework\Bootstrap::class, - ['getApplication', 'getDbVendorName'] - ); + $this->_bootstrap = $this->getMockBuilder(\Magento\TestFramework\Bootstrap::class) + ->disableOriginalConstructor() + ->addMethods(['getDbVendorName']) + ->onlyMethods(['getApplication']) + ->getMock(); $this->_bootstrap->expects( $this->any() )->method( diff --git a/setup/config/languages.config.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/config-global-1.php similarity index 81% rename from setup/config/languages.config.php rename to dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/config-global-1.php index dd8d94f2394fa..957abb0fd83ce 100644 --- a/setup/config/languages.config.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/config-global-1.php @@ -5,5 +5,5 @@ */ return [ - 'languages' => [] + 'foo/bar/baz' => true, ]; diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/install-config-mysql1.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/install-config-mysql1.php new file mode 100644 index 0000000000000..0688c04894f7f --- /dev/null +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/install-config-mysql1.php @@ -0,0 +1,13 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +return [ + 'db-host' => '/tmp/mysql.sock', + 'db-user' => 'root', + 'db-password' => '', + 'db-name' => 'magento_integration_tests', + 'db-prefix' => '', +]; diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/post-install-setup-command-config1.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/post-install-setup-command-config1.php new file mode 100644 index 0000000000000..73cc5695ed1db --- /dev/null +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/post-install-setup-command-config1.php @@ -0,0 +1,17 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +return [ + [ + 'command' => 'setup:db-schema:add-slave', + 'config' => [ + '--host' => '/tmp/mysql.sock', + '--dbname' => 'magento_replica', + '--username' => 'root', + '--password' => 'secret', + ] + ], +]; diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/post-install-setup-command-config3.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/post-install-setup-command-config3.php new file mode 100644 index 0000000000000..45feed58e25a6 --- /dev/null +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/post-install-setup-command-config3.php @@ -0,0 +1,20 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +return [ + [ + 'command' => 'fake:command', + 'config' => [ + // arguments + 'foo', + 'bar', + + // options + '--option1' => 'baz', + '-option2' => 'qux', + ] + ], +]; diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/post-install-setup-command-config4.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/post-install-setup-command-config4.php new file mode 100644 index 0000000000000..27c29314e01be --- /dev/null +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/_files/post-install-setup-command-config4.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +return [ + [ + 'no command here', + 'this should raise an exception' => 'yes' + ], +]; diff --git a/dev/tests/integration/isolate.txt b/dev/tests/integration/isolate.txt new file mode 100644 index 0000000000000..c0877c7a50713 --- /dev/null +++ b/dev/tests/integration/isolate.txt @@ -0,0 +1,3 @@ +# Optional configuration file for dev/tests/utils/phpunitGroupConfig.php +# List integration phpunit tests that have to be isolated in their own groups, e.g. long running test, special environments, etc +# One per line by class name diff --git a/dev/tests/integration/phpunit.xml.dist b/dev/tests/integration/phpunit.xml.dist index 92dd1e11f613b..1fe90e447110b 100644 --- a/dev/tests/integration/phpunit.xml.dist +++ b/dev/tests/integration/phpunit.xml.dist @@ -53,6 +53,8 @@ <!-- Local XML configuration file ('.dist' extension will be added, if the specified file doesn't exist) --> <const name="TESTS_INSTALL_CONFIG_FILE" value="etc/install-config-mysql.php"/> <!-- Local XML configuration file ('.dist' extension will be added, if the specified file doesn't exist) --> + <const name="TESTS_POST_INSTALL_SETUP_COMMAND_CONFIG_FILE" value="etc/post-install-setup-command-config.php"/> + <!-- Local XML configuration file ('.dist' extension will be added, if the specified file doesn't exist) --> <const name="TESTS_GLOBAL_CONFIG_FILE" value="etc/config-global.php"/> <!-- Semicolon-separated 'glob' patterns, that match global XML configuration files --> <const name="TESTS_GLOBAL_CONFIG_DIR" value="../../../app/etc"/> @@ -85,7 +87,7 @@ </php> <!-- Test listeners --> <listeners> - <listener class="Yandex\Allure\Adapter\AllureAdapter"> + <listener class="Yandex\Allure\PhpUnit\AllurePhpUnit"> <arguments> <string>var/allure-results</string> <!-- XML files output directory --> <boolean>true</boolean> <!-- Whether to delete previous results on rerun --> diff --git a/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricingTest.php b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricingTest.php index 747b990ce632e..8f469e3dd59b0 100644 --- a/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricingTest.php +++ b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricingTest.php @@ -5,7 +5,16 @@ */ namespace Magento\AdvancedPricingImportExport\Model\Import; +use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; +use Magento\ImportExport\Model\Import; +use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; +use Magento\ImportExport\Model\Import\Source\Csv; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory; +use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory; /** * @magentoAppArea adminhtml @@ -106,27 +115,7 @@ public function testImportAddUpdate() { // import data from CSV file $pathToFile = __DIR__ . '/_files/import_advanced_pricing.csv'; - $filesystem = $this->objectManager->create( - \Magento\Framework\Filesystem::class - ); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - $errors = $this->model->setSource( - $source - )->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'advanced_pricing' - ] - )->validateData(); - + $errors = $this->doImport($pathToFile, DirectoryList::ROOT, Import::BEHAVIOR_APPEND, true); $this->assertEquals(0, $errors->getErrorsCount(), 'Advanced pricing import validation error'); $this->model->importData(); @@ -208,22 +197,7 @@ public function testImportDelete() ); $this->assertNotEmpty($exportModel->export()); - $directory = $this->fileSystem->getDirectoryWrite(DirectoryList::VAR_DIR); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => $csvfile, - 'directory' => $directory - ] - ); - $errors = $this->model->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE, - 'entity' => 'advanced_pricing' - ] - )->setSource( - $source - )->validateData(); + $errors = $this->doImport($csvfile, DirectoryList::VAR_DIR, Import::BEHAVIOR_DELETE, true); $this->assertTrue( $errors->getErrorsCount() == 0, @@ -248,26 +222,7 @@ public function testImportReplace() { // import data from CSV file $pathToFile = __DIR__ . '/_files/import_advanced_pricing.csv'; - $filesystem = $this->objectManager->create( - \Magento\Framework\Filesystem::class - ); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - $errors = $this->model->setSource( - $source - )->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE, - 'entity' => 'advanced_pricing' - ] - )->validateData(); + $errors = $this->doImport($pathToFile, DirectoryList::ROOT, Import::BEHAVIOR_REPLACE, true); $this->assertEquals(0, $errors->getErrorsCount(), 'Advanced pricing import validation error'); $this->model->importData(); @@ -293,4 +248,177 @@ public function testImportReplace() } } } + + /** + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * @magentoConfigFixture current_store catalog/price/scope 1 + * @magentoDataFixture Magento/AdvancedPricingImportExport/_files/create_products.php + * @param array $dbData + * @param array $importData + * @param string $importBehavior + * @param array $invalidRows + * @dataProvider importValidationDuplicateWithSameBaseCurrencyDataProvider + */ + public function testImportValidationDuplicateWithSameBaseCurrency( + array $dbData, + array $importData, + string $importBehavior, + array $invalidRows + ) { + $this->createTierPrices($dbData); + $pathToFile = $this->generateImportFile($importData); + $errors = $this->doImport($pathToFile, DirectoryList::VAR_DIR, $importBehavior); + $rows = $errors->getRowsGroupedByErrorCode(['duplicateTierPrice'], [], false); + $this->assertEquals($invalidRows, $rows['duplicateTierPrice'] ?? []); + } + + /** + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * @magentoConfigFixture current_store catalog/price/scope 1 + * @magentoConfigFixture base_website catalog/price/scope 1 + * @magentoConfigFixture base_website currency/options/base EUR + * @magentoDataFixture Magento/AdvancedPricingImportExport/_files/create_products.php + * @param array $dbData + * @param array $importData + * @param string $importBehavior + * @param array $invalidRows + * @dataProvider importValidationDuplicateWithDifferentBaseCurrencyDataProvider + */ + public function testImportValidationDuplicateWithDifferentBaseCurrency( + array $dbData, + array $importData, + string $importBehavior, + array $invalidRows + ) { + $this->createTierPrices($dbData); + $pathToFile = $this->generateImportFile($importData); + $errors = $this->doImport($pathToFile, DirectoryList::VAR_DIR, $importBehavior); + $rows = $errors->getRowsGroupedByErrorCode(['duplicateTierPrice'], [], false); + $this->assertEquals($invalidRows, $rows['duplicateTierPrice'] ?? []); + } + + /** + * @return array[] + */ + public function importValidationDuplicateWithSameBaseCurrencyDataProvider(): array + { + return require __DIR__ . '/_files/import_validation_duplicate_same_currency_data_provider.php'; + } + + /** + * @return array[] + */ + public function importValidationDuplicateWithDifferentBaseCurrencyDataProvider(): array + { + return require __DIR__ . '/_files/import_validation_duplicate_diff_currency_data_provider.php'; + } + + /** + * @param string $directoryCode + * @param string $file + * @param string $behavior + * @param bool $validateOnly + * @return ProcessingErrorAggregatorInterface + * @throws \Magento\Framework\Exception\FileSystemException + * @throws \Magento\Framework\Exception\LocalizedException + */ + private function doImport( + string $file, + string $directoryCode = DirectoryList::ROOT, + string $behavior = Import::BEHAVIOR_APPEND, + bool $validateOnly = false + ): ProcessingErrorAggregatorInterface { + /** @var Filesystem $filesystem */ + $filesystem = $this->objectManager->create(Filesystem::class); + $directory = $filesystem->getDirectoryWrite($directoryCode); + $source = $this->objectManager->create( + Csv::class, + [ + 'file' => $file, + 'directory' => $directory + ] + ); + $errors = $this->model->setSource($source) + ->setParameters( + [ + 'behavior' => $behavior, + 'entity' => 'advanced_pricing' + ] + ) + ->validateData(); + if (!$validateOnly && !$errors->getAllErrors()) { + $this->model->importData(); + } + + return $errors; + } + + /** + * @param array $tierPrices + */ + private function createTierPrices(array $tierPrices) + { + $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $tierPriceFactory = $this->objectManager->get(ProductTierPriceInterfaceFactory::class); + $tpExtensionAttributesFactory = $this->objectManager->get(ProductTierPriceExtensionFactory::class); + $storeManager = $this->objectManager->get(StoreManagerInterface::class); + $productTierPrices = []; + foreach ($tierPrices as $price) { + $sku = $price['sku']; + $websiteId = 0; + $websiteCode = $price['website_id']; + $percentageValue = $price['percentage_value'] ?? null; + unset($price['sku'], $price['website_id'], $price['percentage_value']); + if ($websiteCode !== 0) { + $websiteId = $storeManager->getWebsite($websiteCode)->getId(); + } + $tierPriceExtensionAttributes = $tpExtensionAttributesFactory->create(); + $tierPriceExtensionAttributes->setWebsiteId($websiteId); + $tierPriceExtensionAttributes->setPercentageValue($percentageValue); + $productTierPrices[$sku][] = $tierPriceFactory->create(['data' => $price]) + ->setExtensionAttributes($tierPriceExtensionAttributes); + } + + foreach ($productTierPrices as $sku => $prices) { + $product = $productRepository->get($sku, true, null, true); + $product->setTierPrices($prices); + $productRepository->save($product); + } + } + + /** + * @param array $data + * @return string + */ + private function generateImportFile(array $data): string + { + $fields = [ + 'sku', + 'tier_price_website', + 'tier_price_customer_group', + 'tier_price_qty', + 'tier_price', + 'tier_price_value_type', + ]; + $objectManager = Bootstrap::getObjectManager(); + /** @var Filesystem $filesystem */ + $filesystem = $objectManager->get(Filesystem::class); + $varDir = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); + $tmpFilename = uniqid('test_import_advanced_pricing_') . '.csv'; + $stream = $varDir->openFile($tmpFilename, 'w+'); + $stream->lock(); + $stream->writeCsv($fields); + $emptyRow = array_fill_keys($fields, ''); + foreach ($data as $row) { + $row = array_replace($emptyRow, $row); + $stream->writeCsv($row); + } + $stream->unlock(); + $stream->close(); + return $varDir->getAbsolutePath($tmpFilename); + } } diff --git a/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/_files/import_validation_duplicate_diff_currency_data_provider.php b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/_files/import_validation_duplicate_diff_currency_data_provider.php new file mode 100644 index 0000000000000..76ff00712c4f6 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/_files/import_validation_duplicate_diff_currency_data_provider.php @@ -0,0 +1,105 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +return [ + [ + [ + ], + [ + [ + 'sku' => 'AdvancedPricingSimple 1', + 'tier_price_website' => 'All Websites [USD]', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '5.0000', + 'tier_price' => '300', + 'tier_price_value_type' => 'Fixed', + ], + [ + 'sku' => 'AdvancedPricingSimple 1', + 'tier_price_website' => 'base', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '5.0000', + 'tier_price' => '25.0000', + 'tier_price_value_type' => 'Discount', + ] + ], + \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + [] + ], + [ + [ + ], + [ + [ + 'sku' => 'AdvancedPricingSimple 2', + 'tier_price_website' => 'base', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '10.0000', + 'tier_price' => '450', + 'tier_price_value_type' => 'Fixed', + ], + [ + 'sku' => 'AdvancedPricingSimple 2', + 'tier_price_website' => 'All Websites [USD]', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '10.0000', + 'tier_price' => '30.0000', + 'tier_price_value_type' => 'Discount', + ] + ], + \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + [] + ], + [ + [ + [ + 'sku' => 'AdvancedPricingSimple 1', + 'website_id' => 0, + 'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL, + 'qty' => 5, + 'value' => 300, + 'percentage_value' => null + ] + ], + [ + [ + 'sku' => 'AdvancedPricingSimple 1', + 'tier_price_website' => 'base', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '5.0000', + 'tier_price' => '25.0000', + 'tier_price_value_type' => 'Discount', + ] + ], + \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + [] + ], + [ + [ + [ + 'sku' => 'AdvancedPricingSimple 2', + 'website_id' => 'base', + 'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL, + 'qty' => 10, + 'value' => 450, + 'percentage_value' => null + ] + ], + [ + [ + 'sku' => 'AdvancedPricingSimple 2', + 'tier_price_website' => 'All Websites [USD]', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '10.0000', + 'tier_price' => '30.0000', + 'tier_price_value_type' => 'Discount', + ] + ], + \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + [] + ] +]; diff --git a/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/_files/import_validation_duplicate_same_currency_data_provider.php b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/_files/import_validation_duplicate_same_currency_data_provider.php new file mode 100644 index 0000000000000..0c6b25d794df6 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/_files/import_validation_duplicate_same_currency_data_provider.php @@ -0,0 +1,153 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +return [ + [ + [ + ], + [ + [ + 'sku' => 'AdvancedPricingSimple 1', + 'tier_price_website' => 'All Websites [USD]', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '5.0000', + 'tier_price' => '300', + 'tier_price_value_type' => 'Fixed', + ], + [ + 'sku' => 'AdvancedPricingSimple 1', + 'tier_price_website' => 'base', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '5.0000', + 'tier_price' => '25.0000', + 'tier_price_value_type' => 'Discount', + ] + ], + \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + [2] + ], + [ + [ + ], + [ + [ + 'sku' => 'AdvancedPricingSimple 2', + 'tier_price_website' => 'base', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '10.0000', + 'tier_price' => '450', + 'tier_price_value_type' => 'Fixed', + ], + [ + 'sku' => 'AdvancedPricingSimple 2', + 'tier_price_website' => 'All Websites [USD]', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '10.0000', + 'tier_price' => '30.0000', + 'tier_price_value_type' => 'Discount', + ] + ], + \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + [2] + ], + [ + [ + [ + 'sku' => 'AdvancedPricingSimple 1', + 'website_id' => 0, + 'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL, + 'qty' => 5, + 'value' => 300, + 'percentage_value' => null + ] + ], + [ + [ + 'sku' => 'AdvancedPricingSimple 1', + 'tier_price_website' => 'base', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '5.0000', + 'tier_price' => '25.0000', + 'tier_price_value_type' => 'Discount', + ] + ], + \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + [1] + ], + [ + [ + [ + 'sku' => 'AdvancedPricingSimple 2', + 'website_id' => 'base', + 'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL, + 'qty' => 10, + 'value' => 450, + 'percentage_value' => null + ] + ], + [ + [ + 'sku' => 'AdvancedPricingSimple 2', + 'tier_price_website' => 'All Websites [USD]', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '10.0000', + 'tier_price' => '30.0000', + 'tier_price_value_type' => 'Discount', + ] + ], + \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + [1] + ], + [ + [ + ], + [ + [ + 'sku' => 'AdvancedPricingSimple 1', + 'tier_price_website' => 'All Websites [USD]', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '5.0000', + 'tier_price' => '300', + 'tier_price_value_type' => 'Fixed', + ], + [ + 'sku' => 'AdvancedPricingSimple 1', + 'tier_price_website' => 'base', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '5.0000', + 'tier_price' => '25.0000', + 'tier_price_value_type' => 'Discount', + ] + ], + \Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE, + [2] + ], + [ + [ + [ + 'sku' => 'AdvancedPricingSimple 2', + 'website_id' => 'base', + 'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL, + 'qty' => 10, + 'value' => 450, + 'percentage_value' => null + ] + ], + [ + [ + 'sku' => 'AdvancedPricingSimple 2', + 'tier_price_website' => 'All Websites [USD]', + 'tier_price_customer_group' => 'ALL GROUPS', + 'tier_price_qty' => '10.0000', + 'tier_price' => '30.0000', + 'tier_price_value_type' => 'Discount', + ] + ], + \Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE, + [] + ], +]; diff --git a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/DynamicBundlePriceCalculatorTest.php b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/DynamicBundlePriceCalculatorTest.php index 1775f09eb58c7..4d7a1a64cd455 100644 --- a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/DynamicBundlePriceCalculatorTest.php +++ b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/DynamicBundlePriceCalculatorTest.php @@ -163,6 +163,8 @@ private function getBundleConfiguration1() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], ] ], @@ -192,14 +194,20 @@ private function getBundleConfiguration2() [ 'sku' => 'simple1', 'qty' => 3, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 2, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple3', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], ] ] @@ -229,14 +237,20 @@ private function getBundleConfiguration3() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple3', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ] ] ] @@ -265,10 +279,14 @@ private function getBundleConfiguration4() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 3, + 'price' => 100, + 'price_type' => 0, ], ] ], @@ -280,10 +298,14 @@ private function getBundleConfiguration4() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 3, + 'price' => 100, + 'price_type' => 0, ], ] ] @@ -312,10 +334,14 @@ private function getBundleConfiguration5() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 3, + 'price' => 100, + 'price_type' => 0, ], ] ], @@ -327,10 +353,14 @@ private function getBundleConfiguration5() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 3, + 'price' => 100, + 'price_type' => 0, ], ] ] diff --git a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/DynamicBundlePriceCalculatorWithDimensionTest.php b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/DynamicBundlePriceCalculatorWithDimensionTest.php index b008fe4003c39..ba451c0fd4620 100644 --- a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/DynamicBundlePriceCalculatorWithDimensionTest.php +++ b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/DynamicBundlePriceCalculatorWithDimensionTest.php @@ -163,6 +163,8 @@ private function getBundleConfiguration1() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], ] ], @@ -192,14 +194,20 @@ private function getBundleConfiguration2() [ 'sku' => 'simple1', 'qty' => 3, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 2, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple3', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], ] ] @@ -229,14 +237,20 @@ private function getBundleConfiguration3() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple3', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ] ] ] @@ -265,10 +279,14 @@ private function getBundleConfiguration4() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 3, + 'price' => 100, + 'price_type' => 0, ], ] ], @@ -280,10 +298,14 @@ private function getBundleConfiguration4() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 3, + 'price' => 100, + 'price_type' => 0, ], ] ] @@ -312,10 +334,14 @@ private function getBundleConfiguration5() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 3, + 'price' => 100, + 'price_type' => 0, ], ] ], @@ -327,10 +353,14 @@ private function getBundleConfiguration5() [ 'sku' => 'simple1', 'qty' => 1, + 'price' => 100, + 'price_type' => 0, ], [ 'sku' => 'simple2', 'qty' => 3, + 'price' => 100, + 'price_type' => 0, ], ] ] diff --git a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/LinksListTest.php b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/LinksListTest.php new file mode 100644 index 0000000000000..2adfcdee77c38 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/LinksListTest.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model\Product; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Test for bundle product linksList model. + * + */ +class LinksListTest extends TestCase +{ + /** + * @var LinksList + */ + private $linksList; + + /** + * @inheridoc + */ + protected function setUp(): void + { + $this->linksList = Bootstrap::getObjectManager()->get(LinksList::class); + } + + /** + * verify get items with zero option selection price. + * + * @magentoDataFixture Magento/Bundle/_files//fixed_bundle_product_zero_price_option_selection.php + * @return void + */ + public function testGetItemsWithZeroPrice(): void + { + $productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); + $product = $productRepository->get('bundle_product'); + $type = Bootstrap::getObjectManager()->get(Type::class); + $optionsIds = $type->getOptionsIds($product); + $links = $this->linksList->getItems($product, current($optionsIds)); + $link = current($links); + self::assertEquals('simple1', $link->getSku()); + self::assertEquals(0, $link->getPrice()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/SaveHandlerTest.php b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/SaveHandlerTest.php index a48a78d324ad5..bdc3ada8dc67b 100644 --- a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/SaveHandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/SaveHandlerTest.php @@ -7,7 +7,16 @@ namespace Magento\Bundle\Model\Product; +use Magento\Bundle\Api\Data\LinkInterface; +use Magento\Bundle\Api\Data\LinkInterfaceFactory; +use Magento\Bundle\Api\Data\OptionInterfaceFactory; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\ObjectManagerInterface; +use Magento\Store\Model\Store; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; /** * Test class for \Magento\Bundle\Model\Product\SaveHandler @@ -18,15 +27,15 @@ * @magentoDbIsolation disabled * @magentoAppIsolation enabled */ -class SaveHandlerTest extends \PHPUnit\Framework\TestCase +class SaveHandlerTest extends TestCase { /** - * @var \Magento\Framework\ObjectManagerInterface + * @var ObjectManagerInterface */ private $objectManager; /** - * @var \Magento\Store\Model\Store + * @var Store */ private $store; @@ -40,21 +49,23 @@ class SaveHandlerTest extends \PHPUnit\Framework\TestCase */ protected function setUp(): void { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->store = $this->objectManager->create(\Magento\Store\Model\Store::class); + $this->objectManager = Bootstrap::getObjectManager(); + $this->store = $this->objectManager->create(Store::class); /** @var ProductRepositoryInterface $productRepository */ $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); } /** + * Test option title on different stores + * * @return void + * @throws LocalizedException + * @throws NoSuchEntityException */ public function testOptionTitlesOnDifferentStores(): void { - /** - * @var \Magento\Bundle\Model\Product\OptionList $optionList - */ - $optionList = $this->objectManager->create(\Magento\Bundle\Model\Product\OptionList::class); + /** @var OptionList $optionList */ + $optionList = $this->objectManager->create(OptionList::class); $secondStoreId = $this->store->load('fixture_second_store')->getId(); $thirdStoreId = $this->store->load('fixture_third_store')->getId(); @@ -86,4 +97,150 @@ public function testOptionTitlesOnDifferentStores(): void $options[0]->getTitle() ); } + + /** + * Test option link of the same product + * + * @return void + * @throws LocalizedException + * @throws NoSuchEntityException + */ + public function testOptionLinksOfSameProduct(): void + { + /** @var OptionList $optionList */ + $optionList = $this->objectManager->create(OptionList::class); + $product = $this->productRepository->get('bundle-product', true); + + //set the first option + $options = $this->setBundleProductOptionData(); + $extension = $product->getExtensionAttributes(); + $extension->setBundleProductOptions($options); + $product->setExtensionAttributes($extension); + $product->save(); + + $product = $this->productRepository->get('bundle-product', true); + $options = $optionList->getItems($product); + $this->assertCount(1, $options); + + //set the second option with same product + $newOption = $this->setBundleProductOptionData(); + array_push($options, current($newOption)); + $extension = $product->getExtensionAttributes(); + $extension->setBundleProductOptions($options); + $product->setExtensionAttributes($extension); + $product->save(); + $this->assertCount(2, $options); + + //remove one option and verify the count + array_pop($options); + $extension = $product->getExtensionAttributes(); + $extension->setBundleProductOptions($options); + $product->setExtensionAttributes($extension); + $product->save(); + + $product = $this->productRepository->get('bundle-product', true); + $options = $optionList->getItems($product); + $this->assertCount(1, $options); + } + + /** + * Set product option link + * + * @param $bundleLinks + * @param $option + * @return array + * @throws NoSuchEntityException + */ + private function setProductLink($bundleLinks, $option): array + { + $links = []; + $options = []; + if (!empty($bundleLinks)) { + foreach ($bundleLinks as $linkData) { + if (!(bool)$linkData['delete']) { + /** @var LinkInterface $link */ + $link = $this->objectManager->create(LinkInterfaceFactory::class) + ->create(['data' => $linkData]); + $linkProduct = $this->productRepository->getById($linkData['product_id']); + $link->setSku($linkProduct->getSku()); + $link->setQty($linkData['selection_qty']); + $link->setPrice($linkData['selection_price_value']); + if (isset($linkData['selection_can_change_qty'])) { + $link->setCanChangeQuantity($linkData['selection_can_change_qty']); + } + $links[] = $link; + } + } + $option->setProductLinks($links); + $options[] = $option; + } + return $options; + } + + /** + * Set product option + * + * @return array + * @throws NoSuchEntityException + */ + private function setProductOption(): array + { + $options = []; + $product = $this->productRepository->get('bundle-product', true); + foreach ($product->getBundleOptionsData() as $optionData) { + if (!(bool)$optionData['delete']) { + $option = $this->objectManager->create(OptionInterfaceFactory::class) + ->create(['data' => $optionData]); + $option->setSku($product->getSku()); + $option->setOptionId(null); + + $bundleLinks = $product->getBundleSelectionsData(); + if (!empty($bundleLinks)) { + $options = $this->setProductLink(current($bundleLinks), $option); + } + } + } + return $options; + } + + /** + * Set bundle product option data + * + * @return array + * @throws NoSuchEntityException + */ + private function setBundleProductOptionData(): array + { + $options = []; + $product = $this->productRepository->get('bundle-product', true); + $simpleProduct = $this->productRepository->get('simple'); + $product->setBundleOptionsData( + [ + [ + 'title' => 'Bundle Product Items', + 'default_title' => 'Bundle Product Items', + 'type' => 'select', 'required' => 1, + 'delete' => '', + ], + ] + ); + $product->setBundleSelectionsData( + [ + [ + [ + 'product_id' => $simpleProduct->getId(), + 'selection_price_value' => 10, + 'selection_qty' => 1, + 'selection_can_change_qty' => 1, + 'delete' => '', + + ], + ], + ] + ); + if ($product->getBundleOptionsData()) { + $options = $this->setProductOption(); + } + return $options; + } } diff --git a/dev/tests/integration/testsuite/Magento/Bundle/Model/QuoteRecollectProcessorTest.php b/dev/tests/integration/testsuite/Magento/Bundle/Model/QuoteRecollectProcessorTest.php new file mode 100644 index 0000000000000..9f14dfd34f374 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/Model/QuoteRecollectProcessorTest.php @@ -0,0 +1,137 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Model; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\TestFramework\Bundle\Model\PrepareBundleLinks; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Quote\Model\GetQuoteByReservedOrderId; +use PHPUnit\Framework\TestCase; + +/** + * Integration tests for \Magento\Bundle\Model\QuoteRecollectProcessor class. + */ +class QuoteRecollectProcessorTest extends TestCase +{ + /** + * @var GetQuoteByReservedOrderId + */ + private $getQuoteByReservedOrderId; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var PrepareBundleLinks + */ + private $prepareBundleLinks; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $objectManager = Bootstrap::getObjectManager(); + $this->getQuoteByReservedOrderId = $objectManager->get(GetQuoteByReservedOrderId::class); + $this->productRepository = $objectManager->get(ProductRepositoryInterface::class); + $this->prepareBundleLinks = $objectManager->get(PrepareBundleLinks::class); + } + + /** + * Tests that quote marked to recollect after bundle product options or selections changed. + * + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/Bundle/_files/quote_with_fixed_bundle_product.php + * @dataProvider getBundleOptionsDataProvider + * @param array $optionsData + * @param array $selectionsData + * @param string $expectedTriggerRecollect + * @return void + */ + public function testMarkQuoteRecollectAfterChangeBundleOptions( + array $optionsData, + array $selectionsData, + string $expectedTriggerRecollect + ): void { + $quote = $this->getQuoteByReservedOrderId->execute('test_cart_with_fixed_bundle'); + $this->assertFalse((bool)$quote->getTriggerRecollect()); + $this->updateBundleProduct('fixed_bundle_product_without_discounts', $optionsData, $selectionsData); + $updatedQuote = $this->getQuoteByReservedOrderId->execute('test_cart_with_fixed_bundle'); + $this->assertEquals($expectedTriggerRecollect, $updatedQuote->getTriggerRecollect()); + } + + /** + * @return array + */ + public function getBundleOptionsDataProvider(): array + { + return [ + 'product option changed' => [ + [ + [ + 'title' => 'Option 1', + 'default_title' => 'Option 1', + 'type' => 'radio', + 'required' => 0, + 'delete' => '', + ], + ], + [ + [ + 'sku' => 'simple1', + 'selection_qty' => 1, + 'selection_price_value' => 10, + 'selection_price_type' => 0, + 'selection_can_change_qty' => 1, + ], + ], + '1', + ], + 'product link changed' => [ + [ + [ + 'title' => 'Option 1', + 'default_title' => 'Option 1', + 'type' => 'radio', + 'required' => 1, + 'delete' => '', + ], + ], + [ + [ + 'sku' => 'simple1', + 'selection_qty' => 2, + 'selection_price_value' => 15, + 'selection_price_type' => 1, + 'selection_can_change_qty' => 0, + ], + ], + '1', + ], + ]; + } + + /** + * Updates bundle product options and selections. + * + * @param string $sku + * @param array $optionsData + * @param array $selectionsData + * @return void + */ + private function updateBundleProduct(string $sku, array $optionsData, array $selectionsData): void + { + $product = $this->productRepository->get($sku); + $option = current($product->getExtensionAttributes()->getBundleProductOptions()); + $optionsData[0]['option_id'] = $option->getId(); + $updatedProduct = $this->prepareBundleLinks->execute($product, $optionsData, [$selectionsData]); + $this->productRepository->save($updatedProduct); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/fixed_bundle_product_zero_price_option_selection.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/fixed_bundle_product_zero_price_option_selection.php new file mode 100644 index 0000000000000..2434e703d5477 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/fixed_bundle_product_zero_price_option_selection.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Bundle\Model\Product\Price; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\Product\Visibility; +use Magento\TestFramework\Bundle\Model\PrepareBundleLinks; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Bundle/_files/multiple_products.php'); + +$objectManager = Bootstrap::getObjectManager(); +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$prepareBundleLinks = $objectManager->get(PrepareBundleLinks::class); +$product = $objectManager->create(Product::class); +$product->setTypeId(Type::TYPE_BUNDLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([1]) + ->setName('Bundle Product') + ->setSku('bundle_product') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->setPriceView(0) + ->setPriceType(Price::PRICE_TYPE_FIXED) + ->setPrice(110.0) + ->setShipmentType(0); + +$optionData = [ + [ + 'title' => 'Test Option', + 'default_title' => 'Test Option', + 'type' => 'radio', + 'required' => 1, + 'delete' => '', + ], +]; +$selectionData = [ + [ + 'sku' => 'simple1', + 'selection_qty' => 1, + 'selection_price_value' => 0, + 'selection_price_type' => 1, + 'selection_can_change_qty' => 1, + ], +]; +$product = $prepareBundleLinks->execute($product, $optionData, [$selectionData]); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/fixed_bundle_product_zero_price_option_selection_rollback.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/fixed_bundle_product_zero_price_option_selection_rollback.php new file mode 100644 index 0000000000000..f00e4e5a1ce9d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/fixed_bundle_product_zero_price_option_selection_rollback.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Bundle/_files/multiple_products_rollback.php'); +$objectManager = Bootstrap::getObjectManager(); +$registry = $objectManager->get(Registry::class); +$productRepository = $objectManager->get(ProductRepositoryInterface::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +try { + $product = $productRepository->get('bundle_product', false, null, true); + $productRepository->delete($product); +} catch (NoSuchEntityException $e) { + //Product already removed +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/quote_with_fixed_bundle_product.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/quote_with_fixed_bundle_product.php new file mode 100644 index 0000000000000..b58d4aaaf003a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/quote_with_fixed_bundle_product.php @@ -0,0 +1,65 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +use Magento\Bundle\Model\Option; +use Magento\Bundle\Model\Product\Type; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Checkout\Model\Cart; +use Magento\Checkout\Model\Session as CheckoutSession; +use Magento\Framework\DataObjectFactory; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Bundle/_files/fixed_bundle_product_without_discounts.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var DataObjectFactory $dataObjectFactory */ +$dataObjectFactory = $objectManager->get(DataObjectFactory::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); + +$product = $productRepository->get('fixed_bundle_product_without_discounts'); +/** @var Type $typeInstance */ +$typeInstance = $product->getTypeInstance(); +$typeInstance->setStoreFilter($product->getStoreId(), $product); +$optionCollection = $typeInstance->getOptionsCollection($product); + +$bundleOptions = []; +$bundleOptionsQty = []; +$optionsData = []; +foreach ($optionCollection as $option) { + /** @var Option $option */ + $selectionsCollection = $typeInstance->getSelectionsCollection([$option->getId()], $product); + if ($option->isMultiSelection()) { + $optionsData[$option->getId()] = array_column($selectionsCollection->toArray(), 'product_id'); + $bundleOptions[$option->getId()] = array_column($selectionsCollection->toArray(), 'selection_id'); + } else { + $bundleOptions[$option->getId()] = $selectionsCollection->getFirstItem()->getSelectionId(); + $optionsData[$option->getId()] = $selectionsCollection->getFirstItem()->getProductId(); + } + $bundleOptionsQty[$option->getId()] = 1; +} + +$requestInfo = $dataObjectFactory->create( + [ + 'data' => [ + 'product' => $product->getId(), + 'bundle_option' => $bundleOptions, + 'bundle_option_qty' => $bundleOptionsQty, + 'qty' => 1, + ], + ] +); + +/** @var Cart $cart */ +$cart = $objectManager->get(Cart::class); +$cart->addProduct($product, $requestInfo); +$cart->getQuote()->setReservedOrderId('test_cart_with_fixed_bundle'); +$cart->save(); + +$objectManager->removeSharedInstance(CheckoutSession::class); diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/quote_with_fixed_bundle_product_rollback.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/quote_with_fixed_bundle_product_rollback.php new file mode 100644 index 0000000000000..fc6d60a2ba7f6 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/quote_with_fixed_bundle_product_rollback.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Bundle/_files/fixed_bundle_product_without_discounts_rollback.php'); +Resolver::getInstance()->requireDataFixture('Magento/Checkout/_files/rollback_quote.php'); diff --git a/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Import/Product/Type/BundleTest.php b/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Import/Product/Type/BundleTest.php index 89fe02f3dbc6c..7228e21f0a026 100644 --- a/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Import/Product/Type/BundleTest.php +++ b/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Import/Product/Type/BundleTest.php @@ -6,7 +6,12 @@ namespace Magento\BundleImportExport\Model\Import\Product\Type; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\Product as ProductResource; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Filesystem; +use Magento\ImportExport\Model\Import; +use Magento\ImportExport\Model\Import\Source\Csv; use Magento\TestFramework\Helper\Bootstrap; use Magento\Framework\App\Filesystem\DirectoryList; @@ -77,12 +82,12 @@ public function testBundleImport() // import data from CSV file $pathToFile = __DIR__ . '/../../_files/import_bundle.csv'; $filesystem = $this->objectManager->create( - \Magento\Framework\Filesystem::class + Filesystem::class ); $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, + Csv::class, [ 'file' => $pathToFile, 'directory' => $directory @@ -92,7 +97,7 @@ public function testBundleImport() $source )->setParameters( [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'behavior' => Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product' ] )->validateData(); @@ -100,11 +105,11 @@ public function testBundleImport() $this->assertTrue($errors->getErrorsCount() == 0); $this->model->importData(); - $resource = $this->objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); + $resource = $this->objectManager->get(ProductResource::class); $productId = $resource->getIdBySku(self::TEST_PRODUCT_NAME); $this->assertIsNumeric($productId); - /** @var \Magento\Catalog\Model\Product $product */ - $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class); + /** @var Product $product */ + $product = $this->objectManager->create(Product::class); $product->load($productId); $this->assertFalse($product->isObjectNew()); @@ -141,6 +146,94 @@ public function testBundleImport() $this->importedProductSkus = ['Simple 1', 'Simple 2', 'Simple 3', 'Bundle 1']; } + /** + * Test that Bundle options are updated correctly by import + * + * @dataProvider valuesDataProvider + * + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * @param array $expectedValues + * @return void + */ + public function testBundleImportUpdateValues(array $expectedValues): void + { + // import data from CSV file + $pathToFile = __DIR__ . '/../../_files/import_bundle.csv'; + $filesystem = $this->objectManager->create( + Filesystem::class + ); + + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + Csv::class, + [ + 'file' => $pathToFile, + 'directory' => $directory + ] + ); + $errors = $this->model->setSource( + $source + )->setParameters( + [ + 'behavior' => Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product' + ] + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->model->importData(); + + // import data from CSV file to update values + $pathToFile2 = __DIR__ . '/../../_files/import_bundle_update_values.csv'; + $source2 = $this->objectManager->create( + Csv::class, + [ + 'file' => $pathToFile2, + 'directory' => $directory + ] + ); + $errors2 = $this->model->setSource( + $source2 + )->setParameters( + [ + 'behavior' => Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product' + ] + )->validateData(); + + $this->assertTrue($errors2->getErrorsCount() == 0); + $this->model->importData(); + + $resource = $this->objectManager->get(ProductResource::class); + $productId = $resource->getIdBySku(self::TEST_PRODUCT_NAME); + $this->assertIsNumeric($productId); + /** @var Product $product */ + $product = $this->objectManager->create(Product::class); + $product->load($productId); + + $this->assertFalse($product->isObjectNew()); + $this->assertEquals(self::TEST_PRODUCT_NAME, $product->getName()); + $this->assertEquals(self::TEST_PRODUCT_TYPE, $product->getTypeId()); + $this->assertEquals(1, $product->getShipmentType()); + + $optionIdList = $resource->getProductsIdsBySkus($this->optionSkuList); + $bundleOptionCollection = $product->getExtensionAttributes()->getBundleProductOptions(); + $this->assertCount(3, $bundleOptionCollection); + foreach ($bundleOptionCollection as $optionKey => $option) { + $this->assertEquals('checkbox', $option->getData('type')); + $this->assertEquals($expectedValues[$optionKey]['title'], $option->getData('title')); + $this->assertEquals(self::TEST_PRODUCT_NAME, $option->getData('sku')); + foreach ($option->getData('product_links') as $linkKey => $productLink) { + $optionSku = $expectedValues[$optionKey]['product_links'][$linkKey]; + $this->assertEquals($optionIdList[$optionSku], $productLink->getData('entity_id')); + $this->assertEquals($optionSku, $productLink->getData('sku')); + } + } + $this->importedProductSkus = ['Simple 1', 'Simple 2', 'Simple 3', 'Bundle 1']; + } + /** * @magentoDataFixture Magento/Store/_files/second_store.php * @magentoDbIsolation disabled @@ -151,10 +244,10 @@ public function testBundleImportWithMultipleStoreViews(): void { // import data from CSV file $pathToFile = __DIR__ . '/../../_files/import_bundle_multiple_store_views.csv'; - $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + $filesystem = $this->objectManager->create(Filesystem::class); $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, + Csv::class, [ 'file' => $pathToFile, 'directory' => $directory, @@ -163,25 +256,25 @@ public function testBundleImportWithMultipleStoreViews(): void $errors = $this->model->setSource($source) ->setParameters( [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'behavior' => Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product', ] )->validateData(); $this->assertTrue($errors->getErrorsCount() == 0); $this->model->importData(); - $resource = $this->objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); + $resource = $this->objectManager->get(ProductResource::class); $productId = $resource->getIdBySku(self::TEST_PRODUCT_NAME); $this->assertIsNumeric($productId); - /** @var \Magento\Catalog\Model\Product $product */ - $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class); + /** @var Product $product */ + $product = $this->objectManager->create(Product::class); $product->load($productId); $this->assertFalse($product->isObjectNew()); $this->assertEquals(self::TEST_PRODUCT_NAME, $product->getName()); $this->assertEquals(self::TEST_PRODUCT_TYPE, $product->getTypeId()); $this->assertEquals(1, $product->getShipmentType()); $optionIdList = $resource->getProductsIdsBySkus($this->optionSkuList); - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ - $productRepository = $this->objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); $i = 0; foreach ($product->getStoreIds() as $storeId) { $bundleOptionCollection = $productRepository->get(self::TEST_PRODUCT_NAME, false, $storeId) @@ -203,6 +296,33 @@ public function testBundleImportWithMultipleStoreViews(): void $this->importedProductSkus = ['Simple 1', 'Simple 2', 'Simple 3', 'Bundle 1']; } + /** + * Provider for testBundleImportUpdateValues + * + * @return array + */ + public function valuesDataProvider(): array + { + return [ + [ + [ + 0 => [ + 'title' => 'Option 1', + 'product_links' => ['Simple 1'], + ], + 1 => [ + 'title' => 'Option 1 new', + 'product_links' => ['Simple 1'], + ], + 2 => [ + 'title' => 'Option 2', + 'product_links' => ['Simple 2', 'Simple 3'], + ], + ], + ], + ]; + } + /** * teardown */ diff --git a/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Import/_files/import_bundle_update_values.csv b/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Import/_files/import_bundle_update_values.csv new file mode 100644 index 0000000000000..406126dad3d15 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Import/_files/import_bundle_update_values.csv @@ -0,0 +1,2 @@ +sku,store_view_code,attribute_set_code,product_type,product_websites,name,product_online,price,additional_attributes,qty,out_of_stock_qty,website_id,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values +Bundle 1,,Default,bundle,base,Bundle 1,1,,shipment_type=separately,0,0,1,dynamic,dynamic,Price range,dynamic,"name=Option 1 new,type=checkbox,required=1,sku=Simple 1,price=0.0000,default=0,default_qty=1.0000,price_type=fixed,can_change_qty=1" diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Category/Checkboxes/TreeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Category/Checkboxes/TreeTest.php index af4b5b1e8336c..5963b74150851 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Category/Checkboxes/TreeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Category/Checkboxes/TreeTest.php @@ -3,26 +3,55 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Catalog\Block\Adminhtml\Category\Checkboxes; +use Magento\Catalog\Helper\DefaultCategory; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\Framework\View\LayoutInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + /** + * Checks category chooser block behaviour + * + * @see \Magento\Catalog\Block\Adminhtml\Category\Checkboxes\Tree + * * @magentoAppArea adminhtml * @magentoDbIsolation enabled * @magentoAppIsolation enabled */ -class TreeTest extends \PHPUnit\Framework\TestCase +class TreeTest extends TestCase { - /** @var \Magento\Catalog\Block\Adminhtml\Category\Checkboxes\Tree */ - protected $block; + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var Tree */ + private $block; + + /** @var SerializerInterface */ + private $json; + /** @var DefaultCategory */ + private $defaultCategoryHelper; + + /** + * @inheritdoc + */ protected function setUp(): void { - $this->block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Block\Adminhtml\Category\Checkboxes\Tree::class - ); + $this->objectManager = Bootstrap::getObjectManager(); + $this->block = $this->objectManager->get(LayoutInterface::class)->createBlock(Tree::class); + $this->json = $this->objectManager->get(SerializerInterface::class); + $this->defaultCategoryHelper = $this->objectManager->get(DefaultCategory::class); } - public function testSetGetCategoryIds() + /** + * @return void + */ + public function testSetGetCategoryIds(): void { $this->block->setCategoryIds([1, 4, 7, 56, 2]); $this->assertEquals([1, 4, 7, 56, 2], $this->block->getCategoryIds()); @@ -30,8 +59,10 @@ public function testSetGetCategoryIds() /** * @magentoDataFixture Magento/Catalog/_files/categories.php + * + * @return void */ - public function testGetTreeJson() + public function testGetTreeJson(): void { $jsonTree = $this->block->getTreeJson(); $this->assertStringContainsString('Default Category (4)', $jsonTree); @@ -45,4 +76,17 @@ public function testGetTreeJson() $this->assertStringContainsString('Category 12 (2)', $jsonTree); $this->assertStringMatchesFormat('%s"path":"1\/2\/%s\/%s\/%s"%s', $jsonTree); } + + /** + * @return void + */ + public function testGetTreeJsonWithSelectedCategory(): void + { + $this->block->setCategoryIds($this->defaultCategoryHelper->getId()); + $result = $this->json->unserialize($this->block->getTreeJson()); + $item = reset($result); + $this->assertNotEmpty($item); + $this->assertStringContainsString('Default Category', $item['text']); + $this->assertTrue($item['checked']); + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/SortingTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/SortingTest.php index b88edc656176c..70d0ddd151241 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/SortingTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/SortingTest.php @@ -399,6 +399,7 @@ public function testProductListOutOfStockSortOrderWithElasticsearch( string $direction, array $expected ): void { + $this->markTestSkipped('MC-40449: ListProduct\SortingTest failure on 2.4-develop'); $this->assertProductListSortOrderWithConfig($sortBy, $direction, $expected); } @@ -420,6 +421,7 @@ public function testProductListOutOfStockSortOrderWithMysql( string $direction, array $expected ): void { + $this->markTestSkipped('MC-40449: ListProduct\SortingTest failure on 2.4-develop'); $this->assertProductListSortOrderWithConfig($sortBy, $direction, $expected); } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/MultiStoreCurrencyTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/MultiStoreCurrencyTest.php index a4785d261fcce..8019681ab8ce1 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/MultiStoreCurrencyTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/MultiStoreCurrencyTest.php @@ -7,6 +7,7 @@ namespace Magento\Catalog\Block\Product\View; +use Magento\Framework\Locale\ResolverInterface; use Magento\Store\Model\StoreManagerInterface; /** @@ -20,6 +21,9 @@ class MultiStoreCurrencyTest extends AbstractCurrencyTest /** @var StoreManagerInterface */ private $storeManager; + /** @var ResolverInterface */ + private $localeResolver; + /** * @inheritdoc */ @@ -27,6 +31,7 @@ protected function setUp(): void { parent::setUp(); + $this->localeResolver = $this->objectManager->get(ResolverInterface::class); $this->storeManager = $this->objectManager->get(StoreManagerInterface::class); } @@ -46,9 +51,12 @@ protected function setUp(): void */ public function testMultiStoreRenderPrice(): void { - $this->assertProductStorePrice('simple2', 'CN¥70.00'); + $this->localeResolver->setLocale('zh_CN'); + $this->assertProductStorePrice('simple2', '¥70.00'); + $this->reloadProductPriceInfo(); - $this->assertProductStorePrice('simple2', '₴240.00', 'fixturestore'); + $this->localeResolver->setLocale('uk_UA'); + $this->assertProductStorePrice('simple2', '240,00 ₴', 'fixturestore'); } /** @@ -67,9 +75,12 @@ public function testMultiStoreRenderPrice(): void */ public function testMultiStoreRenderSpecialPrice(): void { - $this->assertProductStorePrice('simple', 'Special Price CN¥41.93 Regular Price CN¥70.00'); + $this->localeResolver->setLocale('zh_CN'); + $this->assertProductStorePrice('simple', 'Special Price ¥41.93 Regular Price ¥70.00'); + $this->reloadProductPriceInfo(); - $this->assertProductStorePrice('simple', 'Special Price ₴143.76 Regular Price ₴240.00', 'fixturestore'); + $this->localeResolver->setLocale('uk_UA'); + $this->assertProductStorePrice('simple', 'Special Price 143,76 ₴ Regular Price 240,00 ₴', 'fixturestore'); } /** @@ -88,16 +99,19 @@ public function testMultiStoreRenderSpecialPrice(): void */ public function testMultiStoreRenderTierPrice(): void { + $this->localeResolver->setLocale('zh_CN'); $this->assertProductStorePrice( 'simple-product-tax-none', - 'Buy 2 for CN¥280.00 each and save 80%', + 'Buy 2 for ¥280.00 each and save 80%', 'default', self::TIER_PRICE_BLOCK_NAME ); + $this->reloadProductPriceInfo(); + $this->localeResolver->setLocale('uk_UA'); $this->assertProductStorePrice( 'simple-product-tax-none', - 'Buy 2 for ₴960.00 each and save 80%', + 'Buy 2 for 960,00 ₴ each and save 80%', 'fixturestore', self::TIER_PRICE_BLOCK_NAME ); @@ -125,7 +139,7 @@ private function assertProductStorePrice( } $actualData = $this->processPriceView($productSku, $priceBlockName); - $this->assertEquals($expectedData, $actualData); + self::assertEquals($expectedData, $actualData); } finally { if ($currentStore->getCode() !== $storeCode) { $this->storeManager->setCurrentStore($currentStore); @@ -141,7 +155,16 @@ private function assertProductStorePrice( private function reloadProductPriceInfo(): void { $product = $this->registry->registry('product'); - $this->assertNotNull($product); + self::assertNotNull($product); $product->reloadPriceInfo(); } + + /** + * @inheritDoc + */ + protected function tearDown(): void + { + $this->localeResolver->setLocale(\Magento\Setup\Module\I18n\Locale::DEFAULT_SYSTEM_LOCALE); + parent::tearDown(); + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/AddTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/AddTest.php new file mode 100644 index 0000000000000..aaa98f1733061 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/AddTest.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Controller\Adminhtml\Category; + +use Magento\Catalog\Helper\DefaultCategory; +use Magento\TestFramework\TestCase\AbstractBackendController; + +/** + * Tests for catalog category Add controller + * + * @see \Magento\Catalog\Controller\Adminhtml\Category\Add + * + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + */ +class AddTest extends AbstractBackendController +{ + /** + * @var DefaultCategory + */ + private $defaultCategoryHelper; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->defaultCategoryHelper = $this->_objectManager->get(DefaultCategory::class); + } + + /** + * @return void + */ + public function testExecuteWithoutParams(): void + { + $this->dispatch('backend/catalog/category/add'); + $this->assertRedirect($this->stringContains('catalog/category/index')); + } + + /** + * @return void + */ + public function testExecuteAsAjax(): void + { + $this->getRequest()->setQueryValue('isAjax', true); + $this->getRequest()->setParam('parent', $this->defaultCategoryHelper->getId()); + $this->dispatch('backend/catalog/category/add'); + $this->assertJson($this->getResponse()->getBody()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/Image/UploadTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/Image/UploadTest.php new file mode 100644 index 0000000000000..15b625409bcd7 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/Image/UploadTest.php @@ -0,0 +1,97 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Controller\Adminhtml\Category\Image; + +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\TestFramework\TestCase\AbstractBackendController; + +/** + * Test cases related to upload category image. + * + * @see \Magento\Catalog\Controller\Adminhtml\Category\Image\Upload + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + */ +class UploadTest extends AbstractBackendController +{ + /** @var Filesystem */ + private $filesystem; + + /** @var WriteInterface */ + private $tmpDirectory; + + /** @var SerializerInterface */ + private $json; + + /** @var string */ + private $fileToRemove; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->filesystem = $this->_objectManager->get(Filesystem::class); + $this->tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::TMP); + $this->json = $this->_objectManager->get(SerializerInterface::class); + } + + /** + * @inheritdoc + */ + protected function tearDown(): void + { + if (file_exists($this->fileToRemove)) { + unlink($this->fileToRemove); + } + + parent::tearDown(); + } + + /** + * @return void + */ + public function testWithNotAllowedFileExtension(): void + { + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setPostValue('param_name', 'image'); + $this->prepareFile('empty.csv'); + $this->dispatch('backend/catalog/category_image/upload'); + $responseBody = $this->json->unserialize($this->getResponse()->getBody()); + $this->assertNotEmpty($responseBody['error']); + $this->assertStringContainsString((string)__('File validation failed.'), $responseBody['error']); + } + + /** + * Prepare file + * + * @param string $fileName + * @return void + */ + private function prepareFile(string $fileName): void + { + $this->tmpDirectory->create($this->tmpDirectory->getAbsolutePath()); + $filePath = $this->tmpDirectory->getAbsolutePath($fileName); + $this->fileToRemove = $filePath; + $fixtureDir = realpath(__DIR__ . '/../../../../_files'); + $this->tmpDirectory->getDriver()->copy($fixtureDir . DIRECTORY_SEPARATOR . $fileName, $filePath); + $_FILES['image'] = [ + 'name' => $fileName, + 'type' => 'image', + 'tmp_name' => $filePath, + 'error' => 0, + 'size' => 12500, + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/CategoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/CategoryTest.php index cd58cd2ac3819..eba80a0584fd4 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/CategoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/CategoryTest.php @@ -13,6 +13,7 @@ use Magento\Framework\App\ProductMetadata; use Magento\Framework\App\ProductMetadataInterface; use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Message\MessageInterface; use Magento\Framework\Registry; use Magento\TestFramework\Catalog\Model\CategoryLayoutUpdateManager; @@ -99,7 +100,7 @@ protected function setUp(): void * @param array $defaultAttributes * @param array $attributesSaved * @return void - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws NoSuchEntityException */ public function testSaveAction(array $inputData, array $defaultAttributes, array $attributesSaved = []): void { @@ -145,7 +146,7 @@ public function testSaveAction(array $inputData, array $defaultAttributes, array * @magentoDataFixture Magento/CatalogUrlRewrite/_files/categories.php * @return void * @throws \Magento\Framework\Exception\CouldNotSaveException - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws NoSuchEntityException */ public function testDefaultValueForCategoryUrlPath(): void { @@ -237,6 +238,39 @@ public static function categoryCreatedFromProductCreationPageDataProvider(): arr return [[$postData], [$postData + ['return_session_messages_only' => 1]]]; } + /** + * Test save action with different store + * + * @return void + * @throws NoSuchEntityException + * @magentoDbIsolation enabled + */ + public function testSaveActionWithDifferentStore(): void + { + $categoryDetails = + [ + 'id' => '20', + 'entity_id' => '20', + 'path' => '1/2', + 'url_key' => 'test-category', + 'is_anchor' => false, + 'use_default' => + [ + 'name' => 'test-category', + 'is_active' => 1, + 'thumbnail' => 1, + 'description' => 'Test description for test-category' + ] + ]; + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setPostValue($categoryDetails); + $this->getRequest()->setParam('id', $categoryDetails['id']); + + $this->dispatch('backend/catalog/category/save'); + $body = $this->getResponse()->getBody(); + $this->assertEmpty($body); + } + /** * Test SuggestCategories finds any categories. * @@ -911,7 +945,7 @@ public function testSaveWithCustomBackendNameAction(): void $this->equalTo( [ 'URL key "backend" matches a reserved endpoint name ' - . '(admin, soap, rest, graphql, standard, backend). Use another URL key.' + . '(backend). Use another URL key.' ] ), MessageInterface::TYPE_ERROR diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/MassDeleteTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/MassDeleteTest.php index 6384883c56c58..421526a5f8297 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/MassDeleteTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/MassDeleteTest.php @@ -7,10 +7,16 @@ namespace Magento\Catalog\Controller\Adminhtml\Product; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\ObjectManagerInterface; use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Store\Model\Store; +use Magento\Catalog\Model\ResourceModel\Product as ProductResource; use Magento\Framework\Message\MessageInterface; use Magento\TestFramework\TestCase\AbstractBackendController; +use Magento\Catalog\Model\ResourceModel\Product\Gallery; /** * Test for mass product deleting. @@ -21,9 +27,29 @@ */ class MassDeleteTest extends AbstractBackendController { + /** + * @var ObjectManagerInterface + */ + private $objectManager; + /** @var ProductRepositoryInterface */ protected $productRepository; + /** + * @var ProductResource + */ + private $productResource; + + /** + * @var Gallery + */ + private $galleryResource; + + /** + * @var int + */ + private $mediaAttributeId; + /** * @inheritdoc */ @@ -31,7 +57,11 @@ protected function setUp(): void { parent::setUp(); + $this->objectManager = Bootstrap::getObjectManager(); $this->productRepository = $this->_objectManager->get(ProductRepositoryInterface::class); + $this->productResource = $this->objectManager->create(ProductResource::class); + $this->galleryResource = $this->objectManager->create(Gallery::class); + $this->mediaAttributeId = (int)$this->productResource->getAttribute('media_gallery')->getAttributeId(); $this->productRepository->cleanCache(); } @@ -47,6 +77,29 @@ public function testDeleteSimpleProductViaMassAction(): void $this->assertSuccessfulDeleteProducts(count($productIds)); } + /** + * Tests image remove during product delete. + * + * @magentoDataFixture Magento/Catalog/_files/product_with_media_gallery.php + * + * @return void + * @throws NoSuchEntityException + */ + public function testDeleteSimpleProductWithImageViaMassAction(): void + { + $productIds = [812]; + $product = $this->productRepository->get( + 'simple_product_with_media', + false, + Store::DEFAULT_STORE_ID, + true + ); + $this->dispatchMassDeleteAction($productIds); + $this->assertSuccessfulDeleteProducts(count($productIds)); + $productImages = $this->galleryResource->loadProductGalleryByAttributeId($product, $this->mediaAttributeId); + $this->assertCount(0, $productImages); + } + /** * @return void */ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/ValidateTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/ValidateTest.php new file mode 100644 index 0000000000000..b2ca0cec28f83 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/ValidateTest.php @@ -0,0 +1,60 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Controller\Adminhtml\Product; + +use Magento\TestFramework\TestCase\AbstractBackendController; +use Magento\UrlRewrite\Model\Exception\UrlAlreadyExistsException; +use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Catalog\Model\Product\Type; + +/** + * @magentoAppArea adminhtml + */ +class ValidateTest extends AbstractBackendController +{ + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + */ + public function testNotUniqueUrlKey() + { + $this->getRequest() + ->setMethod(HttpRequest::METHOD_POST); + + $postData = [ + 'product' => [ + 'attribute_set_id' => '4', + 'status' => '1', + 'name' => 'Simple product', + 'sku' => 'simple', + 'type_id' => Type::TYPE_SIMPLE, + 'quantity_and_stock_status' => [ + 'qty' => '10', + 'is_in_stock' => '1', + ], + 'website_ids' => [ + 1 => '1', + ], + 'price' => '100', + ], + ]; + + $this->getRequest() + ->setPostValue($postData); + $this->dispatch('backend/catalog/product/validate/'); + $responseBody = $this->getResponse() + ->getBody(); + + $message = __('The value specified in the URL Key field would generate a URL that already exists.'); + $additionalInfo = __('To resolve this conflict, you can either change the value of the URL Key field ' + . '(located in the Search Engine Optimization section) to a unique value, or change the Request Path fields' + . ' in all locations listed below:'); + + $this->assertStringContainsString((string)$message, $responseBody); + $this->assertStringContainsString((string)$additionalInfo, $responseBody); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php index 8b18f89542494..f31a137269408 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php @@ -19,7 +19,11 @@ use Magento\TestFramework\Helper\Bootstrap; use Magento\Catalog\Model\ResourceModel\Product as ProductResource; use Magento\Catalog\Model\Product; -use Magento\TestFramework\Helper\CacheCleaner; +use Magento\TestFramework\TestCase\AbstractBackendController; +use Magento\Catalog\Model\Product\Attribute\LayoutUpdateManager; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Category; /** * Test class for Product adminhtml actions @@ -27,7 +31,7 @@ * @magentoAppArea adminhtml * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class ProductTest extends \Magento\TestFramework\TestCase\AbstractBackendController +class ProductTest extends AbstractBackendController { /** * @var Builder @@ -44,6 +48,11 @@ class ProductTest extends \Magento\TestFramework\TestCase\AbstractBackendControl */ private $resourceModel; + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + /** * @inheritDoc */ @@ -51,8 +60,8 @@ protected function setUp(): void { Bootstrap::getObjectManager()->configure([ 'preferences' => [ - \Magento\Catalog\Model\Product\Attribute\LayoutUpdateManager::class => - \Magento\TestFramework\Catalog\Model\ProductLayoutUpdateManager::class + LayoutUpdateManager::class => + ProductLayoutUpdateManager::class ] ]); parent::setUp(); @@ -60,6 +69,7 @@ protected function setUp(): void $this->aclBuilder = Bootstrap::getObjectManager()->get(Builder::class); $this->repositoryFactory = Bootstrap::getObjectManager()->get(ProductRepositoryFactory::class); $this->resourceModel = Bootstrap::getObjectManager()->get(ProductResource::class); + $this->productRepository = $this->_objectManager->get(ProductRepositoryInterface::class); } /** @@ -437,7 +447,7 @@ public function testSaveDesign(): void 'store' => '0', 'set' => '4', 'back' => 'edit', - 'type_id' => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE, + 'type_id' => Type::TYPE_SIMPLE, 'product' => [], 'is_downloadable' => '0', 'affect_configurable_product_attributes' => '1', @@ -499,7 +509,7 @@ public function testSaveDesignWithDefaults(): void 'set' => '4', 'back' => 'edit', 'product' => [], - 'type_id' => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE, + 'type_id' => Type::TYPE_SIMPLE, 'is_downloadable' => '0', 'affect_configurable_product_attributes' => '1', 'new_variation_attribute_set_id' => '4', @@ -607,4 +617,92 @@ private function assertSaveAndDuplicateAction(Product $product) MessageInterface::TYPE_SUCCESS ); } + + /** + * Provide test data for testSaveActionWithInvalidUrlKey() + * + * @return array + */ + public function saveActionWithInvalidUrlKeyDataProvider() + { + return [ + [ + 'post_data' => [ + 'product' => + [ + 'attribute_set_id' => '4', + 'status' => '1', + 'name' => 'simple_with_invalid_url', + 'url_key' => 'graphql', + 'quantity_and_stock_status' => + [ + 'qty' => '10', + 'is_in_stock' => '1', + ], + 'website_ids' => + [ + 1 => '1', + ], + 'sku' => 'simple_with_invalid_url', + 'price' => '3', + 'tax_class_id' => '2', + 'product_has_weight' => '0', + 'visibility' => '4', + ], + ], + ] + ]; + } + + /** + * Test create product with invalid existing url key. + * + * @dataProvider saveActionWithInvalidUrlKeyDataProvider + * @magentoDbIsolation disabled + * @param array $postData + * @return void + */ + public function testSaveActionWithInvalidUrlKey(array $postData) + { + $identifier = 'graphql'; + $reservedWords = 'admin, soap, rest, graphql, standard'; + $this->getRequest()->setPostValue($postData); + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->dispatch('backend/catalog/product/save'); + /** @var Manager $messageManager */ + $messageManager = $this->_objectManager->get(Manager::class); + $messages = $messageManager->getMessages(); + $errors = $messages->getItemsByType('error'); + $this->assertNotEmpty($errors); + $message = array_shift($errors); + $this->assertSame( + sprintf( + 'URL key "%s" matches a reserved endpoint name (%s). Use another URL key.', + $identifier, + $reservedWords + ), + $message->getText() + ); + $this->assertRedirect($this->stringContains('/backend/catalog/product/new')); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/category_product.php + * @magentoDbIsolation disabled + * @magentoAppArea adminhtml + */ + public function testSaveProductWithDeletedCategory(): void + { + $category = $this->_objectManager->get(Category::class); + $category->load(333); + $category->delete(); + $product = $this->productRepository->get('simple333'); + $this->productRepository->save($product); + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->dispatch('backend/catalog/product/save/id/' . $product->getEntityId()); + $this->assertSessionMessages( + $this->equalTo([(string)__('You saved the product.')]), + MessageInterface::TYPE_SUCCESS + ); + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/CategoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/CategoryTest.php index 00c3133c25439..36bca76b28de1 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/CategoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/CategoryTest.php @@ -8,14 +8,18 @@ namespace Magento\Catalog\Controller; use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Catalog\Api\Data\CategoryInterface; use Magento\Catalog\Model\Category; use Magento\Catalog\Model\Category\Attribute\LayoutUpdateManager; use Magento\Catalog\Model\Product\ProductList\Toolbar as ToolbarModel; +use Magento\Catalog\Model\ResourceModel\Category\Collection; +use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; use Magento\Catalog\Model\Session; use Magento\Framework\App\Http\Context; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Registry; use Magento\Framework\View\LayoutInterface; +use Magento\Store\Model\Store; use Magento\TestFramework\Catalog\Model\CategoryLayoutUpdateManager; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\AbstractController; @@ -53,6 +57,11 @@ class CategoryTest extends AbstractController */ private $httpContext; + /** + * @var CollectionFactory + */ + private $categoryCollectionFactory; + /** * @inheritdoc */ @@ -64,6 +73,8 @@ protected function setUp(): void $this->objectManager->configure([ 'preferences' => [LayoutUpdateManager::class => CategoryLayoutUpdateManager::class] ]); + + $this->categoryCollectionFactory = $this->objectManager->create(CollectionFactory::class); $this->registry = $this->objectManager->get(Registry::class); $this->layout = $this->objectManager->get(LayoutInterface::class); $this->session = $this->objectManager->get(Session::class); @@ -233,4 +244,50 @@ public function testViewWithRememberPaginationAndPreviousValue(): void $this->assertEquals($newPaginationValue, $this->session->getData(ToolbarModel::LIMIT_PARAM_NAME)); $this->assertEquals($newPaginationValue, $this->httpContext->getValue(ToolbarModel::LIMIT_PARAM_NAME)); } + + /** + * Test to generate category page without duplicate html element ids + * + * @magentoDataFixture Magento/Catalog/_files/category_with_three_products.php + * @magentoDataFixture Magento/Catalog/_files/catalog_category_product_reindex_all.php + * @magentoDataFixture Magento/Catalog/_files/catalog_product_category_reindex_all.php + * @magentoDbIsolation disabled + */ + public function testViewWithoutDuplicateHmlElementIds(): void + { + $category = $this->loadCategory('Category 999', Store::DEFAULT_STORE_ID); + $this->dispatch('catalog/category/view/id/' . $category->getId()); + + $responseHtml = $this->getResponse()->getBody(); + $htmlElementIds = ['modes-label', 'mode-list', 'toolbar-amount', 'sorter', 'limiter']; + foreach ($htmlElementIds as $elementId) { + $matches = []; + $idAttribute = "id=\"$elementId\""; + preg_match_all("/$idAttribute/mx", $responseHtml, $matches); + $this->assertCount(1, $matches[0]); + $this->assertEquals($idAttribute, $matches[0][0]); + } + } + + /** + * Loads category by id + * + * @param string $categoryName + * @param int $storeId + * @return CategoryInterface + */ + private function loadCategory(string $categoryName, int $storeId): CategoryInterface + { + /** @var Collection $categoryCollection */ + $categoryCollection = $this->categoryCollectionFactory->create(); + /** @var CategoryInterface $category */ + $category = $categoryCollection->setStoreId($storeId) + ->addAttributeToSelect('display_mode', 'left') + ->addAttributeToFilter(CategoryInterface::KEY_NAME, $categoryName) + ->setPageSize(1) + ->getFirstItem(); + $category->setStoreId($storeId); + + return $category; + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php index 4f046eccbe59f..d55677d239abf 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php @@ -6,44 +6,76 @@ namespace Magento\Catalog\Controller\Product; -use Magento\Framework\Message\MessageInterface; +use Laminas\Stdlib\ParametersFactory; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\ProductRepository; +use Magento\Customer\Model\Session; +use Magento\Customer\Model\Visitor; use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Framework\Data\Form\FormKey; +use Magento\Framework\Message\MessageInterface; +use Magento\Framework\Registry; +use Magento\TestFramework\TestCase\AbstractController; /** - * @magentoDataFixture Magento/Catalog/controllers/_files/products.php + * Test compare product. * + * @magentoDataFixture Magento/Catalog/controllers/_files/products.php * @magentoDbIsolation disabled - * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class CompareTest extends \Magento\TestFramework\TestCase\AbstractController +class CompareTest extends AbstractController { - /** - * @var \Magento\Catalog\Model\ProductRepository - */ + /** @var ProductRepository */ protected $productRepository; - /** - * @var \Magento\Framework\Data\Form\FormKey - */ + /** @var FormKey */ private $formKey; + /** @var Session */ + private $customerSession; + + /** @var Visitor */ + private $visitor; + + /** @var ParametersFactory */ + private $parametersFactory; + + /** @var Registry */ + private $registry; + /** * @inheritDoc */ protected function setUp(): void { parent::setUp(); - $this->formKey = $this->_objectManager->get(\Magento\Framework\Data\Form\FormKey::class); - $this->productRepository = $this->_objectManager->create(\Magento\Catalog\Model\ProductRepository::class); + + $this->formKey = $this->_objectManager->get(FormKey::class); + $this->productRepository = $this->_objectManager->get(ProductRepository::class); + $this->customerSession = $this->_objectManager->get(Session::class); + $this->visitor = $this->_objectManager->get(Visitor::class); + $this->parametersFactory = $this->_objectManager->get(ParametersFactory::class); + $this->registry = $this->_objectManager->get(Registry::class); + } + + /** + * @inheritdoc + */ + protected function tearDown(): void + { + $this->customerSession->logout(); + $this->visitor->setId(null); + + parent::tearDown(); } /** * Test adding product to compare list. * - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return void */ - public function testAddAction() + public function testAddAction(): void { $this->_requireVisitorWithNoProducts(); $product = $this->productRepository->get('simple_product_1'); @@ -59,7 +91,7 @@ public function testAddAction() $this->assertSessionMessages( $this->equalTo( [ - 'You added product Simple Product 1 Name to the '. + 'You added product Simple Product 1 Name to the ' . '<a href="http://localhost/index.php/catalog/product_compare/">comparison list</a>.' ] ), @@ -99,9 +131,9 @@ public function testAddActionForDisabledProduct(): void /** * Test removing a product from compare list. * - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return void */ - public function testRemoveAction() + public function testRemoveAction(): void { $this->_requireVisitorWithTwoProducts(); $product = $this->productRepository->get('simple_product_2'); @@ -139,9 +171,9 @@ public function testRemoveActionForDisabledProduct(): void /** * Test removing a product from compare list of a registered customer. * - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return void */ - public function testRemoveActionWithSession() + public function testRemoveActionWithSession(): void { $this->_requireCustomerWithTwoProducts(); $product = $this->productRepository->get('simple_product_1'); @@ -161,8 +193,10 @@ public function testRemoveActionWithSession() /** * Test getting a list of compared product. + * + * @return void */ - public function testIndexActionDisplay() + public function testIndexActionDisplay(): void { $this->_requireVisitorWithTwoProducts(); @@ -190,8 +224,10 @@ public function testIndexActionDisplay() /** * Test clearing a list of compared products. + * + * @return void */ - public function testClearAction() + public function testClearAction(): void { $this->_requireVisitorWithTwoProducts(); @@ -212,8 +248,9 @@ public function testClearAction() * Test escaping a session message. * * @magentoDataFixture Magento/Catalog/_files/product_simple_xss.php + * @return void */ - public function testRemoveActionProductNameXss() + public function testRemoveActionProductNameXss(): void { $this->_prepareCompareListWithProductNameXss(); $product = $this->productRepository->get('product-with-xss'); @@ -228,6 +265,62 @@ public function testRemoveActionProductNameXss() ); } + /** + * Test removing a product wich does not exist from compare list. + * + * @return void + */ + public function testRemoveActionWithNonExistentProduct(): void + { + $this->_requireVisitorWithTwoProducts(); + $removedProduct = $this->productRepository->get('simple_product_1'); + $redirectUrl = 'http://localhost/index.php/catalog/product_compare/index'; + $this->assertTrue($this->deleteProduct($removedProduct), "The product must be removed."); + + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setParams(['product' => $removedProduct->getId()]); + $server = $this->getRequest()->getServer(); + $server['HTTP_REFERER'] = $redirectUrl; + $this->getRequest()->setServer($server); + $this->dispatch('catalog/product_compare/remove/'); + + $this->assertSessionMessages($this->isEmpty()); + $this->assertRedirect($this->equalTo($redirectUrl)); + $restProduct = $this->productRepository->get('simple_product_2'); + $this->_assertCompareListEquals([$restProduct->getId()]); + } + + /** + * Add not existing product to list of compared. + * + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/Customer/_files/customer.php + * @return void + */ + public function testAddNotExistingProductToCompareList(): void + { + $this->customerSession->loginById(1); + $this->prepareReferer(); + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setParams(['product' => 787586534]); + $this->dispatch('catalog/product_compare/add/'); + $this->assertSessionMessages($this->isEmpty()); + $this->_assertCompareListEquals([]); + $this->assertRedirect($this->stringContains('not_existing')); + } + + /** + * Prepare referer to test. + * + * @return void + */ + private function prepareReferer(): void + { + $parameters = $this->parametersFactory->create(); + $parameters->set('HTTP_REFERER', 'http://localhost/not_existing'); + $this->getRequest()->setServer($parameters); + } + /** * Set product status disabled. * @@ -246,10 +339,9 @@ private function setProductDisabled(string $sku): \Magento\Catalog\Api\Data\Prod /** * Preparing compare list. * - * @throws \Magento\Framework\Exception\LocalizedException - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return void */ - protected function _prepareCompareListWithProductNameXss() + protected function _prepareCompareListWithProductNameXss(): void { /** @var $visitor \Magento\Customer\Model\Visitor */ $visitor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() @@ -275,9 +367,9 @@ protected function _prepareCompareListWithProductNameXss() /** * Preparing compare list. * - * @throws \Magento\Framework\Exception\LocalizedException + * @return void */ - protected function _requireVisitorWithNoProducts() + protected function _requireVisitorWithNoProducts(): void { /** @var $visitor \Magento\Customer\Model\Visitor */ $visitor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() @@ -300,10 +392,9 @@ protected function _requireVisitorWithNoProducts() /** * Preparing compare list. * - * @throws \Magento\Framework\Exception\LocalizedException - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return void */ - protected function _requireVisitorWithTwoProducts() + protected function _requireVisitorWithTwoProducts(): void { /** @var $visitor \Magento\Customer\Model\Visitor */ $visitor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() @@ -339,10 +430,9 @@ protected function _requireVisitorWithTwoProducts() /** * Preparing a compare list. * - * @throws \Magento\Framework\Exception\LocalizedException - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return void */ - protected function _requireCustomerWithTwoProducts() + protected function _requireCustomerWithTwoProducts(): void { $customer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create(\Magento\Customer\Model\Customer::class); @@ -405,8 +495,9 @@ protected function _requireCustomerWithTwoProducts() * Assert that current visitor has exactly expected products in compare list * * @param array $expectedProductIds + * @return void */ - protected function _assertCompareListEquals(array $expectedProductIds) + protected function _assertCompareListEquals(array $expectedProductIds): void { /** @var $compareItems \Magento\Catalog\Model\ResourceModel\Product\Compare\Item\Collection */ $compareItems = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( @@ -426,4 +517,27 @@ protected function _assertCompareListEquals(array $expectedProductIds) } $this->assertEquals($expectedProductIds, $actualProductIds, "Products in current visitor's compare list."); } + + /** + * Delete product in secure area + * + * @param ProductInterface $product + * @return bool + */ + private function deleteProduct(ProductInterface $product): bool + { + $this->registry->unregister('isSecureArea'); + $this->registry->register('isSecureArea', true); + + try { + $result = $this->productRepository->delete($product); + } catch (\Exception $e) { + $result = false; + } + + $this->registry->unregister('isSecureArea'); + $this->registry->register('isSecureArea', false); + + return $result; + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ViewTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ViewTest.php index 0a6bf201538e2..6b3e5f7745d09 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ViewTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ViewTest.php @@ -13,9 +13,14 @@ use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Visibility; use Magento\Eav\Model\Entity\Type; +use Magento\Framework\App\ActionInterface; use Magento\Framework\App\Cache\Manager; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\Http; +use Magento\Framework\App\Request\Http as HttpRequest; use Magento\Framework\Registry; +use Magento\Framework\Url\EncoderInterface; +use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Eav\Model\GetAttributeSetByName; use Magento\TestFramework\Request; @@ -23,7 +28,6 @@ use Psr\Log\LoggerInterface; use Magento\Catalog\Api\Data\ProductAttributeInterface; use Magento\Catalog\Api\ProductAttributeRepositoryInterface; -use Magento\Framework\Logger\Monolog as MagentoMonologLogger; use Magento\TestFramework\Response; use Magento\TestFramework\TestCase\AbstractController; @@ -66,6 +70,12 @@ class ViewTest extends AbstractController /** @var GetAttributeSetByName */ private $getAttributeSetByName; + /** @var EncoderInterface */ + private $urlEncoder; + + /** @var ScopeConfigInterface */ + private $config; + /** * @inheritdoc */ @@ -81,6 +91,8 @@ protected function setUp(): void $this->registry = $this->_objectManager->get(Registry::class); $this->storeManager = $this->_objectManager->get(StoreManagerInterface::class); $this->getAttributeSetByName = $this->_objectManager->get(GetAttributeSetByName::class); + $this->urlEncoder = $this->_objectManager->get(EncoderInterface::class); + $this->config = $this->_objectManager->get(ScopeConfigInterface::class); } /** @@ -294,6 +306,37 @@ public function test404NotFoundPageCacheTags(): void ); } + /** + * @return void + */ + public function testViewUnexistedProduct(): void + { + $url = '/catalog/product/view/id/999/'; + $this->getRequest()->setParams([ + ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlEncoder->encode($url), + ])->setMethod(HttpRequest::METHOD_POST); + $this->dispatch($url); + $this->assert404NotFound(); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * + * @return void + */ + public function testViewWithRedirect(): void + { + $product = $this->productRepository->get('simple2'); + $url = $this->config->getValue(Store::XML_PATH_UNSECURE_BASE_LINK_URL); + $this->getRequest() + ->setParams([ + ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlEncoder->encode($url), + ]) + ->setMethod(HttpRequest::METHOD_POST); + $this->dispatch(sprintf('catalog/product/view/id/%s/', $product->getId())); + $this->assertRedirect($this->stringContains($url)); + } + /** * @param string|ProductInterface $product * @param array $data diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/StartdateTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/StartdateTest.php new file mode 100644 index 0000000000000..d41654dd2a40d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/StartdateTest.php @@ -0,0 +1,75 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Catalog\Model\Attribute\Backend; + +use Magento\Catalog\Api\Data\ProductInterfaceFactory; +use Magento\Catalog\Model\Product; +use Magento\Eav\Model\Config; +use Magento\Eav\Model\Entity\Attribute\Exception; +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Test for Start Date attribute backend model + * + * @see \Magento\Catalog\Model\Attribute\Backend\Startdate + * + * @magentoAppArea adminhtml + */ +class StartdateTest extends TestCase +{ + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var ProductInterfaceFactory */ + private $productFactory; + + /** @var Startdate */ + private $startDate; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->productFactory = $this->objectManager->get(ProductInterfaceFactory::class); + $this->startDate = $this->objectManager->get(Startdate::class); + $attribute = $this->objectManager->get(Config::class)->getAttribute(Product::ENTITY, 'news_from_date'); + $attribute->setMaxValue(new \DateTime('-10 days')); + $this->startDate->setAttribute($attribute); + } + + /** + * @return void + */ + public function testBeforeSave(): void + { + $product = $this->productFactory->create(); + $product->setNewsFromDate(false); + $this->startDate->beforeSave($product); + $this->assertNull($product->getNewsFromDateIsFormated()); + } + + /** + * @return void + */ + public function testValidate(): void + { + $product = $this->productFactory->create(); + $product->setNewsFromDate(new \DateTime()); + $this->expectException(Exception::class); + $msg = __('Make sure the To Date is later than or the same as the From Date.'); + $this->expectExceptionMessage((string)$msg); + $this->startDate->validate($product); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/DesignTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/DesignTest.php index 859acb98adcba..31437ee2b3965 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/DesignTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/DesignTest.php @@ -1,54 +1,159 @@ <?php + /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + +namespace Magento\Catalog\Model; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\TranslateInterface; +use Magento\Framework\View\Design\ThemeInterface; +use Magento\Framework\View\DesignInterface; +use Magento\Framework\View\Result\Page; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Theme\Model\Theme; +use PHPUnit\Framework\TestCase; /** * Test class for \Magento\Catalog\Model\Design. */ -namespace Magento\Catalog\Model; - -class DesignTest extends \PHPUnit\Framework\TestCase +class DesignTest extends TestCase { /** - * @var \Magento\Catalog\Model\Design + * @var Design */ - protected $_model; + private $model; + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @inheriDoc + */ protected function setUp(): void { - $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Design::class - ); + $this->model = Bootstrap::getObjectManager()->create(Design::class); + $this->productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); } /** * @dataProvider getThemeModel + * @param Theme $theme + * @return void */ - public function testApplyCustomDesign($theme) + public function testApplyCustomDesign(Theme $theme): void { - $this->_model->applyCustomDesign($theme); - $design = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - \Magento\Framework\View\DesignInterface::class - ); - $translate = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - \Magento\Framework\TranslateInterface::class - ); + $this->model->applyCustomDesign($theme); + $design = Bootstrap::getObjectManager()->get(DesignInterface::class); + $translate = Bootstrap::getObjectManager()->get(TranslateInterface::class); $this->assertEquals('package', $design->getDesignTheme()->getPackageCode()); $this->assertEquals('theme', $design->getDesignTheme()->getThemeCode()); $this->assertEquals('themepackage/theme', $translate->getTheme()); } /** - * @return \Magento\Theme\Model\Theme + * Verify design product settings will be generated correctly for PDP. + * + * @magentoDataFixture Magento/Catalog/_files/simple_product_with_custom_design.php + * @param array $designSettings + * @param array $expectedSetting + * @dataProvider getDesignSettingsForProductWithScheduleDesignTest + * @return void + */ + public function testGetDesignSettingsForProductWithScheduleDesign( + array $designSettings, + array $expectedSetting + ): void { + $product = $this->productRepository->get('simple_with_custom_design', false, null, true); + $this->applyScheduleDesignUpdate($product, $designSettings); + $settings = $this->model->getDesignSettings($product); + self::assertEquals($expectedSetting['page_layout'], $settings->getData('page_layout')); + self::assertEquals($expectedSetting['custom_design'], $settings->getData('custom_design')); + } + + /** + * @return array[] + */ + public function getDesignSettingsForProductWithScheduleDesignTest(): array + { + $datetime = new \DateTime(); + $datetime->modify('-10 day'); + $fromApplied = $datetime->format('Y-m-d'); + $datetime->modify('+20 day'); + $fromNotApplied = $datetime->format('Y-m-d'); + $datetime->modify('+30 day'); + $to = $datetime->format('Y-m-d'); + + return [ + 'schedule_design_applied' => [ + 'design_settings' => [ + 'custom_layout' => '2columns-left', + 'custom_design' => '2', + 'custom_design_from' => $fromApplied, + 'custom_design_to' => $to, + ], + 'expected_settings' => [ + 'page_layout' => '2columns-left', + 'custom_design' => '2', + ] + ], + 'schedule_design_not_applied' => [ + 'design_settings' => [ + 'custom_layout' => '2columns-left', + 'custom_design' => '2', + 'custom_design_from' => $fromNotApplied, + 'custom_design_to' => $to, + ], + 'expected_settings' => [ + 'page_layout' => '3columns', + 'custom_design' => null, + ] + ], + ]; + } + + /** + * Verify ability to add category inherited page layout handles for product. + * + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + * @return void */ - public function getThemeModel() + public function testAddCategoryPageLayoutHandlesForProduct(): void { - $theme = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Framework\View\Design\ThemeInterface::class + $resultPage = Bootstrap::getObjectManager()->create(Page::class); + $product = $this->productRepository->get('simple'); + $category = $this->getMockBuilder(Category::class) + ->disableOriginalConstructor() + ->onlyMethods(['getParentDesignCategory']) + ->getMock(); + $category->expects(self::once())->method('getParentDesignCategory')->willReturnSelf(); + $category->setId(1); + $category->setCustomLayoutUpdateFile('testFile'); + $category->setCustomApplyToProducts(1); + $product->setCategory($category); + $settings = $this->model->getDesignSettings($product); + $resultPage->addPageLayoutHandles($settings->getPageLayoutHandles()); + $handles = $resultPage->getLayout()->getUpdate()->getHandles(); + self::assertEquals( + 'catalog_category_view_selectable_1_testFile', + $handles[1] ); + } + + /** + * @return array + */ + public function getThemeModel(): array + { + $theme = Bootstrap::getObjectManager()->create(ThemeInterface::class); $theme->setData($this->_getThemeData()); + return [[$theme]]; } @@ -65,7 +170,22 @@ protected function _getThemeData() 'parent_theme' => null, 'is_featured' => true, 'preview_image' => '', - 'theme_directory' => __DIR__ . '_files/design/frontend/default/default' + 'theme_directory' => __DIR__ . '_files/design/frontend/default/default', ]; } + + /** + * Apply provided setting to product scheduled design update. + * + * @param ProductInterface $product + * @param array $designSettings + * @return void + */ + private function applyScheduleDesignUpdate(ProductInterface $product, array $designSettings): void + { + $product->setCustomLayout($designSettings['custom_layout']); + $product->setCustomDesign($designSettings['custom_design']); + $product->setCustomDesignFrom($designSettings['custom_design_from']); + $product->setCustomDesignTo($designSettings['custom_design_to']); + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Entity/Product/Attribute/Design/Options/ContainerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Entity/Product/Attribute/Design/Options/ContainerTest.php new file mode 100644 index 0000000000000..1a68ea12a48be --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Entity/Product/Attribute/Design/Options/ContainerTest.php @@ -0,0 +1,66 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Entity\Product\Attribute\Design\Options; + +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Checks that product design options container return correct options. + * + * @see \Magento\Catalog\Model\Entity\Product\Attribute\Design\Options\Container + */ +class ContainerTest extends TestCase +{ + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var Container */ + private $container; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->container = $this->objectManager->get(Container::class); + } + + /** + * @dataProvider getOptionTextDataProvider + * @param string $value + * @param string|bool $expectedValue + * @return void + */ + public function testGetOptionText(string $value, $expectedValue): void + { + $actualValue = $this->container->getOptionText($value); + $this->assertEquals($expectedValue, $actualValue); + } + + /** + * @return array + */ + public function getOptionTextDataProvider(): array + { + return [ + 'with_value' => [ + 'value' => 'container2', + 'expected_value' => __('Block after Info Column'), + ], + 'with_not_valid_value' => [ + 'value' => 'container3', + 'expected_value' => false, + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ImageUploaderTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ImageUploaderTest.php index 09d08d23cf3e3..3d12f75bdb1fb 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ImageUploaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ImageUploaderTest.php @@ -12,6 +12,9 @@ use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Framework\ObjectManagerInterface; +use Magento\MediaStorage\Model\File\Storage; +use Magento\MediaStorage\Helper\File\Storage\Database; +use Magento\MediaStorage\Model\File\Storage\Directory\DatabaseFactory; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; @@ -58,11 +61,13 @@ protected function setUp(): void $this->filesystem = $this->objectManager->get(Filesystem::class); $this->mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA); $this->tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::SYS_TMP); + $dbStorage = $this->objectManager->create(Database::class); $this->imageUploader = $this->objectManager->create( ImageUploader::class, [ 'baseTmpPath' => self::BASE_TMP_PATH, 'basePath' => self::BASE_PATH, + 'coreFileStorageDatabase' => $dbStorage, 'allowedExtensions' => ['jpg', 'jpeg', 'gif', 'png'], 'allowedMimeTypes' => ['image/jpg', 'image/jpeg', 'image/gif', 'image/png'] ] @@ -129,6 +134,50 @@ public function testMoveFileFromTmp(): void $this->assertFileExists($this->mediaDirectory->getAbsolutePath($expectedFilePath)); } + /** + * Verify image path will be updated in db in case file moved from tmp dir. + * + * @magentoDataFixture Magento/Catalog/_files/catalog_category_image.php + * @magentoDataFixture Magento/Catalog/_files/catalog_tmp_category_image.php + * @magentoConfigFixture default/system/media_storage_configuration/media_storage 1 + * @magentoDbIsolation disabled + * + * @return void + */ + public function testMoveFileFromTmpWithMediaStorageDatabase(): void + { + $fileName = 'magento_small_image.jpg'; + $storage = $this->objectManager->get(Storage::class); + $databaseStorage = $this->objectManager->get(Storage\Database::class); + $directory = $this->objectManager->get(DatabaseFactory::class)->create(); + // Synchronize media. + $storage->synchronize( + [ + 'type' => 1, + 'connection' => 'default_setup' + ] + ); + // Upload file. + $fixtureDir = realpath(__DIR__ . '/../_files'); + $filePath = $this->tmpDirectory->getAbsolutePath($fileName); + copy($fixtureDir . DIRECTORY_SEPARATOR . $fileName, $filePath); + $_FILES['image'] = [ + 'name' => $fileName, + 'type' => 'image/jpeg', + 'tmp_name' => $filePath, + 'error' => 0, + 'size' => 12500, + ]; + $result = $this->imageUploader->saveFileToTmpDir('image'); + // Move file from tmp dir. + $moveResult = $this->imageUploader->moveFileFromTmp($result['name'], true); + // Verify file moved to new dir. + $databaseStorage->loadByFilename($moveResult); + $directory->loadByPath('catalog/category'); + $this->assertEquals('catalog/category', $databaseStorage->getDirectory()); + $this->assertEquals($directory->getId(), $databaseStorage->getDirectoryId()); + } + /** * @return void */ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php index 5cfa07cf5d402..e4740804b414c 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php @@ -184,7 +184,36 @@ public function testCategoryDelete() } } - public function testCategoryCreate() + + /** + * Verify that indexer still valid after deleting inactive category + * + * @magentoAppArea adminhtml + * @magentoDataFixture Magento/Catalog/_files/categories_disabled.php + * + * @return void + */ + public function testDeleteInactiveCategory(): void + { + $this->indexer->reindexAll(); + $isInvalidIndexer = $this->indexer->isInvalid(); + + $this->categoryRepository->deleteByIdentifier(8); + + $state = $this->indexer->getState(); + $state->loadByIndexer($this->indexer->getId()); + $status = $state->getStatus(); + + $this->assertFalse($isInvalidIndexer); + $this->assertEquals(StateInterface::STATUS_VALID, $status); + } + + /** + * Create category + * + * @return void + */ + public function testCategoryCreate(): void { $this->testReindexAll(); $categories = $this->getCategories(4); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/FullTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/FullTest.php index bc96b30d55c04..b5e25540fe149 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/FullTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/FullTest.php @@ -10,6 +10,7 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Block\Product\ListProduct; +use Magento\Catalog\Helper\Product\Flat\Indexer as IndexerHelper; use Magento\Catalog\Model\CategoryFactory; use Magento\Catalog\Model\Indexer\Product\Flat\Processor; use Magento\Catalog\Model\Indexer\Product\Flat\State; @@ -17,6 +18,7 @@ use Magento\Catalog\Model\ResourceModel\Product\Flat as FlatResource; use Magento\CatalogSearch\Model\Indexer\Fulltext; use Magento\Eav\Api\AttributeOptionManagementInterface; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\ObjectManagerInterface; use Magento\Store\Model\StoreManagerInterface; @@ -49,6 +51,9 @@ class FullTest extends TestCase /** @var Full */ private $action; + /** @var IndexerHelper */ + private $productIndexerHelper; + /** * @inheritdoc */ @@ -79,6 +84,7 @@ protected function setUp(): void $this->optionManagement = $this->objectManager->get(AttributeOptionManagementInterface::class); $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); $this->action = $this->objectManager->get(Full::class); + $this->productIndexerHelper = $this->objectManager->get(IndexerHelper::class); } /** @@ -180,6 +186,28 @@ public function testCheckDropdownAttributeInFlat(): void $this->assertFlatColumnValue($attributeCode, $attributeValue); } + /** + * @magentoDbIsolation disabled + * + * @magentoConfigFixture default/catalog/product/flat/max_index_count 1 + * + * @return void + */ + public function testWithTooManyIndexes(): void + { + $indexesNeed = count($this->productIndexerHelper->getFlatIndexes()); + $message = (string)__( + 'The Flat Catalog module has a limit of %2$d filterable and/or sortable attributes.' + . 'Currently there are %1$d of them.' + . 'Please reduce the number of filterable/sortable attributes in order to use this module', + $indexesNeed, + 1 + ); + $this->expectExceptionMessage($message); + $this->expectException(LocalizedException::class); + $this->action->execute(); + } + /** * Assert if column exist and column value in flat table * diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/InvalidateIndexTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/InvalidateIndexTest.php new file mode 100644 index 0000000000000..391d54727fd0d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/InvalidateIndexTest.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Indexer\Product\Price; + +use Magento\Customer\Api\Data\GroupInterfaceFactory; +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Checks that the invalidate price index model is working correctly + * + * @see \Magento\Catalog\Model\Indexer\Product\Price\InvalidateIndex + */ +class InvalidateIndexTest extends TestCase +{ + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var UpdateIndexInterface */ + private $invalidatePriceIndex; + + /** @var Processor */ + private $priceIndexerProcessor; + + /** @var GroupInterfaceFactory */ + private $customerGroupDataFactory; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->invalidatePriceIndex = $this->objectManager->get(InvalidateIndex::class); + $this->priceIndexerProcessor = $this->objectManager->get(Processor::class); + $this->customerGroupDataFactory = $this->objectManager->get(GroupInterfaceFactory::class); + } + + /** + * @magentoDbIsolation disabled + * @return void + */ + public function testUpdate(): void + { + $this->priceIndexerProcessor->reindexAll(); + $this->assertTrue($this->priceIndexerProcessor->getIndexer()->isValid()); + $customerGroupData = $this->customerGroupDataFactory->create(); + $this->invalidatePriceIndex->update($customerGroupData, true); + $this->assertTrue($this->priceIndexerProcessor->getIndexer()->isInvalid()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Category/ItemCollectionProviderTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Category/ItemCollectionProviderTest.php new file mode 100644 index 0000000000000..a533c7805a812 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Category/ItemCollectionProviderTest.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Layer\Category; + +use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Tests for category collection provider. + * + * @see \Magento\Catalog\Model\Layer\Category\ItemCollectionProvider + * @magentoAppArea frontend + */ +class ItemCollectionProviderTest extends TestCase +{ + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var CategoryRepositoryInterface */ + private $categoryRepository; + + /** @var ItemCollectionProvider */ + private $itemCollectionProvider; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->itemCollectionProvider = $this->objectManager->get(ItemCollectionProvider::class); + $this->categoryRepository = $this->objectManager->get(CategoryRepositoryInterface::class); + } + + /** + * @magentoDbIsolation disabled + * @magentoDataFixture Magento/Catalog/_files/category_product.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * + * @return void + */ + public function testGetCollection(): void + { + $category = $this->categoryRepository->get(333); + $categoryProductsCollection = $this->itemCollectionProvider->getCollection($category); + $this->assertCount(1, $categoryProductsCollection); + $this->assertEquals('simple333', $categoryProductsCollection->getFirstItem()->getSku()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/CategoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/CategoryTest.php new file mode 100644 index 0000000000000..de43cad930a45 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/CategoryTest.php @@ -0,0 +1,83 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Layer\Filter\DataProvider; + +use Magento\Catalog\Api\Data\CategoryInterfaceFactory; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Class for test Category Data Provider + * + * @see \Magento\Catalog\Model\Layer\Filter\DataProvider\Category + * + * @magentoAppArea adminhtml + */ +class CategoryTest extends TestCase +{ + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @var Category + */ + private $provider; + + /** + * @var CategoryInterfaceFactory + */ + private $categoryFactory; + + /** + * @var Registry + */ + private $registry; + + /** @var Resolver */ + private $layerResolver; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->categoryFactory = $this->objectManager->get(CategoryInterfaceFactory::class); + $this->layerResolver = $this->objectManager->get(Resolver::class); + $this->provider = $this->objectManager->create(Category::class, ['layer' => $this->layerResolver->get()]); + $this->registry = $this->objectManager->get(Registry::class); + } + + /** + * @return void + */ + public function testValidateCategoryWithoutId(): void + { + $this->registry->register('current_category', $this->categoryFactory->create()); + $this->provider->setCategoryId(375211); + $this->assertFalse($this->provider->isValid()); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/inactive_category.php + * + * @return void + */ + public function testValidateInactiveCategory(): void + { + $this->provider->setCategoryId(111); + $this->assertFalse($this->provider->isValid()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/PriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/PriceTest.php index f7444ca1caaae..321a8b996c32e 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/PriceTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/PriceTest.php @@ -3,32 +3,48 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Catalog\Model\Layer\Filter\DataProvider; +use Magento\Catalog\Model\Layer\Category; +use Magento\Catalog\Model\Layer\Resolver; +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + /** * Test class for \Magento\Catalog\Model\Layer\Filter\DataProvider\Price. - * - * @magentoAppIsolation enabled */ -class PriceTest extends \PHPUnit\Framework\TestCase +class PriceTest extends TestCase { + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var Price */ + private $model; + + /** @var Resolver */ + private $layerResolver; + + /** @var Category */ + private $layer; + + /** @var PriceFactory */ + private $dataProviderPriceFactory; + /** - * @var \Magento\Catalog\Model\Layer\Filter\DataProvider\Price + * @inheritdoc */ - protected $_model; - protected function setUp(): void { - $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Category::class - ); - $category->load(4); - $layer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get(\Magento\Catalog\Model\Layer\Category::class); - $layer->setCurrentCategory($category); - $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Catalog\Model\Layer\Filter\DataProvider\Price::class, ['layer' => $layer]); + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->layerResolver = $this->objectManager->get(Resolver::class); + $this->layer = $this->layerResolver->get(); + $this->dataProviderPriceFactory = $this->objectManager->get(PriceFactory::class); + $this->model = $this->dataProviderPriceFactory->create(['layer' => $this->layer]); } /** @@ -36,10 +52,12 @@ protected function setUp(): void * @magentoAppIsolation enabled * @magentoDbIsolation disabled * @magentoConfigFixture current_store catalog/layered_navigation/price_range_calculation auto + * @return void */ - public function testGetPriceRangeAuto() + public function testGetPriceRangeAuto(): void { - $this->assertEquals(10, $this->_model->getPriceRange()); + $this->layer->setCurrentCategory(4); + $this->assertEquals(10, $this->model->getPriceRange()); } /** @@ -48,45 +66,108 @@ public function testGetPriceRangeAuto() * @magentoDbIsolation disabled * @magentoConfigFixture current_store catalog/layered_navigation/price_range_calculation manual * @magentoConfigFixture current_store catalog/layered_navigation/price_range_step 1.5 + * @return void */ - public function testGetPriceRangeManual() + public function testGetPriceRangeManual(): void { // what you set is what you get - $this->assertEquals(1.5, $this->_model->getPriceRange()); + $this->layer->setCurrentCategory(4); + $this->assertEquals(1.5, $this->model->getPriceRange()); } /** * @magentoDataFixture Magento/Catalog/_files/categories.php * @magentoAppIsolation enabled * @magentoDbIsolation disabled + * @return void */ - public function testGetMaxPriceInt() + public function testGetMaxPriceInt(): void { - $this->assertEquals(45.00, $this->_model->getMaxPrice()); + $this->layer->setCurrentCategory(4); + $this->assertEquals(45.00, $this->model->getMaxPrice()); } /** * @return array */ - public function getRangeItemCountsDataProvider() + public function getRangeItemCountsDataProvider(): array { return [ // These are $inputRange, [$expectedItemCounts] values [1, [11 => 2, 46 => 1, 16 => '1']], [10, [2 => 3, 5 => 1]], [20, [1 => 3, 3 => 1]], - [50, [1 => 4]] + [50, [1 => 4]], ]; } /** + * @dataProvider getRangeItemCountsDataProvider * @magentoDataFixture Magento/Catalog/_files/categories.php + * @magentoAppIsolation enabled * @magentoDbIsolation disabled - * @dataProvider getRangeItemCountsDataProvider + * @param int $inputRange + * @param array $expectedItemCounts + * @return void + */ + public function testGetRangeItemCounts(int $inputRange, array $expectedItemCounts): void + { + $this->layer->setCurrentCategory(4); + $actualItemCounts = $this->model->getRangeItemCounts($inputRange); + $this->assertEquals($expectedItemCounts, $actualItemCounts); + } + + /** + * @magentoConfigFixture current_store catalog/layered_navigation/price_range_max_intervals 3 + * @magentoConfigFixture current_store catalog/layered_navigation/price_range_calculation manual + * @magentoDataFixture Magento/Catalog/_files/products_for_search.php + * @return void */ - public function testGetRangeItemCounts($inputRange, $expectedItemCounts) + public function testGetRangeItemCountsManualCalculation(): void { - $actualItemCounts = $this->_model->getRangeItemCounts($inputRange); + $expectedItemCounts = [11 => '2', 21 => '1', 31 => 2]; + $this->layer->setCurrentCategory(333); + $actualItemCounts = $this->model->getRangeItemCounts(1); $this->assertEquals($expectedItemCounts, $actualItemCounts); } + + /** + * @dataProvider getAdditionalRequestDataDataProvider + * @param array $priceFilters + * @param string $expectedRequest + * @return void + */ + public function testGetAdditionalRequestData(array $priceFilters, string $expectedRequest): void + { + $filter = explode('-', $priceFilters[0]); + $this->model->setInterval($filter); + $priorFilters = $this->model->getPriorFilters($priceFilters); + if (!empty($priorFilters)) { + $this->model->setPriorIntervals($priorFilters); + } + + $actualRequest = $this->model->getAdditionalRequestData(); + $this->assertEquals($expectedRequest, $actualRequest); + } + + /** + * @return array + */ + public function getAdditionalRequestDataDataProvider(): array + { + return [ + 'with_prior_filters' => [ + 'price_filters' => ['10-11', '20-21', '30-31'], + 'expected_request' => ',10-11,20-21,30-31', + ], + 'without_prior_filters' => [ + 'price_filters' => ['10-11'], + 'expected_request' => ',10-11', + ], + 'not_valid_prior_filters' => [ + 'price_filters' => ['10-11', '20-21', '31', '40-41'], + 'expected_request' => ',10-11', + ], + ]; + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Locator/RegistryLocatorTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Locator/RegistryLocatorTest.php new file mode 100644 index 0000000000000..a8b61fae22932 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Locator/RegistryLocatorTest.php @@ -0,0 +1,116 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Locator; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Registry; +use Magento\Store\Api\Data\StoreInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; +use Magento\Store\Model\StoreManagerInterface; + +/** + * Test registry locator + * + * @see \Magento\Catalog\Model\Locator\RegistryLocator + * @magentoAppArea frontend + */ +class RegistryLocatorTest extends TestCase +{ + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var StoreManagerInterface */ + private $storeManager; + + /** @var RegistryLocator */ + private $registryLocator; + + /** @var Registry */ + private $registry; + + /** @var ProductRepositoryInterface */ + private $productRepository; + + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->storeManager = $this->objectManager->get(StoreManagerInterface::class); + $this->registryLocator = $this->objectManager->get(RegistryLocator::class); + $this->registry = $this->objectManager->get(Registry::class); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $this->productRepository->cleanCache(); + } + + /** + * @inheritdoc + */ + protected function tearDown(): void + { + $this->registry->unregister('current_product'); + $this->registry->unregister('current_store'); + + parent::tearDown(); + } + + + /** + * @magentoDbIsolation disabled + * @magentoDataFixture Magento/Catalog/_files/product_two_websites.php + * + * @return void + */ + public function testGetWebsiteIds(): void + { + $product = $this->productRepository->get('simple-on-two-websites'); + $this->registerProduct($product); + $this->assertEquals($product->getExtensionAttributes()->getWebsiteIds(), $this->registryLocator->getWebsiteIds()); + } + + /** + * @return void + */ + public function testGetBaseCurrencyCode(): void + { + $store = $this->storeManager->getStore(); + $this->registerStore($store); + $this->assertEquals($store->getBaseCurrencyCode(), $this->registryLocator->getBaseCurrencyCode()); + } + + /** + * Register the product + * + * @param ProductInterface $product + * @return void + */ + private function registerProduct(ProductInterface $product): void + { + $this->registry->unregister('current_product'); + $this->registry->register('current_product', $product); + } + + /** + * Register the store + * + * @param StoreInterface $store + * @return void + */ + private function registerStore(StoreInterface $store): void + { + $this->registry->unregister('current_store'); + $this->registry->register('current_store', $store); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/AuthorizationTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/AuthorizationTest.php index e2b80a975502f..9d388dfac3a9e 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/AuthorizationTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/AuthorizationTest.php @@ -58,7 +58,7 @@ protected function setUp(): void /** * Verify AuthorizedSavingOf * - * @magentoDataFixture Magento/Catalog/_files/product_simple.php + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_design_attributes.php * @param array $data * * @dataProvider postRequestData @@ -68,7 +68,7 @@ public function testAuthorizedSavingOf(array $data): void $this->request->setPost(new Parameters($data)); /** @var Product $product */ - $product = $this->productRepository->get('simple'); + $product = $this->productRepository->get('simple_design_attribute'); $product = $this->initializationHelper->initialize($product); $this->assertEquals('simple_new', $product->getName()); @@ -88,12 +88,12 @@ public function postRequestData(): array [ 'product' => [ 'name' => 'simple_new', - 'custom_design' => '', - 'page_layout' => '', + 'custom_design' => '3', + 'page_layout' => '1column', 'options_container' => 'container2', 'custom_layout_update' => '', - 'custom_design_from' => '', - 'custom_design_to' => '', + 'custom_design_from' => '2021-02-19 00:00:00', + 'custom_design_to' => '2021-02-09 00:00:00', 'custom_layout_update_file' => '', ], 'use_default' => [ @@ -114,8 +114,8 @@ public function postRequestData(): array 'page_layout' => '', 'options_container' => 'container2', 'custom_design' => '', - 'custom_design_from' => '', - 'custom_design_to' => '', + 'custom_design_from' => '2020-01-02', + 'custom_design_to' => '2020-01-03', 'custom_layout' => '', 'custom_layout_update_file' => '__no_update__', ], diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Compare/ListCompareTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Compare/ListCompareTest.php index 7ce6b8cfff7a0..276df094b4462 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Compare/ListCompareTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Compare/ListCompareTest.php @@ -28,6 +28,8 @@ protected function setUp(): void ->get(\Magento\Customer\Model\Session::class); $this->_visitor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create(\Magento\Customer\Model\Visitor::class); + // md5() used for generate unique session identifier for test purposes. + // phpcs:ignore Magento2.Security.InsecureFunction $this->_visitor->setSessionId(md5(time()) . md5(microtime())) ->setLastVisitAt((new \DateTime())->format(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT)) ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php index d20bf2907c780..2c6e24ad42f62 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php @@ -16,6 +16,7 @@ use Magento\Catalog\Model\ResourceModel\Product as ProductResource; use Magento\Catalog\Model\ResourceModel\Product\Gallery; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\ValidatorException; use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\WriteInterface; @@ -135,6 +136,7 @@ protected function setUp(): void */ public function testExecuteWithIllegalFilename(): void { + $this->expectException(ValidatorException::class); $product = $this->getProduct(); $product->setData( 'media_gallery', @@ -142,7 +144,7 @@ public function testExecuteWithIllegalFilename(): void 'images' => [ 'image' => [ 'value_id' => '100', - 'file' => '/../..' . DIRECTORY_SEPARATOR . $this->fileName, + 'file' => '/../../..' . DIRECTORY_SEPARATOR . $this->fileName, 'label' => 'New image', 'removed' => 1, ], diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php index 0718e3f3b9d64..587adb831dab8 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php @@ -182,7 +182,7 @@ protected function getOptionValue() 'title' => 'test.jpg', 'quote_path' => $file, 'order_path' => $file, - 'secret_key' => substr(md5(file_get_contents($filePath)), 0, 20), + 'secret_key' => substr(hash('sha256', file_get_contents($filePath)), 0, 20), ]; } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php index 4cd9d74e58418..09862d3802555 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php @@ -14,16 +14,23 @@ use Magento\Catalog\Model\ProductRepository; use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Eav\Model\Config; +use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\DataObject; use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\File\Uploader; +use Magento\Framework\File\UploaderFactory; use Magento\Framework\Filesystem; +use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Registry; use Magento\Framework\Serialize\Serializer\Json; use Magento\MediaStorage\Helper\File\Storage\Database; use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; +use ReflectionMethod; +use StdClass; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -35,35 +42,41 @@ class AbstractTypeTest extends TestCase */ protected $_model; + /** @var ObjectManager */ + private $objectManager; + + /** @var ProductRepositoryInterface */ + private $productRepository; + + /** + * @inheritdoc + */ protected function setUp(): void { - $productRepository = Bootstrap::getObjectManager()->get( - ProductRepositoryInterface::class - ); - $catalogProductOption = Bootstrap::getObjectManager()->get( - Option::class - ); + $this->objectManager = Bootstrap::getObjectManager(); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $catalogProductOption = $this->objectManager->get(Option::class); $catalogProductType = $this->createMock(Type::class); $eventManager = $this->createPartialMock(ManagerInterface::class, ['dispatch']); $fileStorageDb = $this->createMock(Database::class); $filesystem = $this->createMock(Filesystem::class); $registry = $this->createMock(Registry::class); $logger = $this->createMock(LoggerInterface::class); - $serializer = Bootstrap::getObjectManager()->get( + $serializer = $this->objectManager->get( Json::class ); $this->_model = $this->getMockForAbstractClass( AbstractType::class, [ $catalogProductOption, - Bootstrap::getObjectManager()->get(Config::class), + $this->objectManager->get(Config::class), $catalogProductType, $eventManager, $fileStorageDb, $filesystem, $registry, $logger, - $productRepository, + $this->productRepository, $serializer ] ); @@ -384,7 +397,7 @@ public function testGetSetStoreFilter() { $product = new DataObject(); $this->assertNull($this->_model->getStoreFilter($product)); - $store = new \StdClass(); + $store = new StdClass(); $this->_model->setStoreFilter($store, $product); $this->assertSame($store, $this->_model->getStoreFilter($product)); } @@ -473,7 +486,7 @@ public function testGetSearchableData() public function testGetProductsToPurchaseByReqGroups() { - $product = new \StdClass(); + $product = new StdClass(); $this->assertSame([[$product]], $this->_model->getProductsToPurchaseByReqGroups($product)); $this->_model->setConfig(['composite' => 1]); $this->assertEquals([], $this->_model->getProductsToPurchaseByReqGroups($product)); @@ -509,7 +522,7 @@ public function testPrepareOptions(): void ); $product->load(1); $buyRequest = new DataObject(['product' => 1]); - $method = new \ReflectionMethod( + $method = new ReflectionMethod( AbstractType::class, '_prepareOptions' ); @@ -523,4 +536,150 @@ public function testPrepareOptions(): void } $this->assertTrue($exceptionIsThrown); } + + /** + * Test if product can be prepared for cart with more than one custom file option + * + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_two_custom_file_options.php + * @return void + */ + public function testPrepareForCartAdvancedWithMultipleCustomFileOptions(): void + { + /** @var $product Product */ + $product = $this->productRepository->get('simple_with_custom_file_option'); + $optionIds = array_reduce($product->getOptions(), function ($result, $item) { + $result[] = $item->getOptionId(); + return $result; + }, []); + $this->prepareEnv($optionIds); + + $buyRequest = new DataObject( + [ + 'qty' => 5, + 'options' => ['files_prefix' => 'item_simple_with_custom_file_option_'], + ] + ); + $model = $this->objectManager->create(Simple::class); + $product->setTypeInstance($model); + $result = $model->prepareForCartAdvanced($buyRequest, $product); + + //result is exception string value in case if exception occurs + self::assertTrue(is_array($result)); + $product = reset($result); + $options = $product->getOptions(); + self::assertCount(2, $options); + } + + /** + * Test if exception occurs in case if file is not uploaded + * + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_two_custom_file_options.php + * @return void + */ + public function testPrepareForCartAdvancedFileOptionFailedToUpload(): void + { + /** @var $product Product */ + $product = $this->productRepository->get('simple_with_custom_file_option'); + $optionIds = array_reduce($product->getOptions(), function ($result, $item) { + $result[] = $item->getOptionId(); + return $result; + }, []); + $this->prepareEnv($optionIds); + + $uploaderFactory = $this->createPartialMock(UploaderFactory::class, ['create']); + $uploader = $this->createPartialMock(Uploader::class, ['save']); + $uploaderFactory->method('create')->willReturn($uploader); + $this->objectManager->addSharedInstance($uploaderFactory, UploaderFactory::class); + + $buyRequest = new DataObject( + [ + 'qty' => 5, + 'options' => ['files_prefix' => 'item_simple_with_custom_file_option_'], + ] + ); + $model = $this->objectManager->create(Simple::class); + $product->setTypeInstance($model); + $this->expectException(LocalizedException::class); + $model->prepareForCartAdvanced($buyRequest, $product); + } + + /** + * Prepare file upload environment + * + * @param array $optionIds + * @return void + */ + private function prepareEnv(array $optionIds): void + { + $file = 'magento_thumbnail.jpg'; + $fixtureDir = realpath(__DIR__ . '/../../../_files/'); + + /** @var Filesystem $filesystem */ + $filesystem = $this->objectManager->get(Filesystem::class); + $tmpDirectory = $filesystem->getDirectoryWrite(DirectoryList::SYS_TMP); + $filePath = $tmpDirectory->getAbsolutePath($file); + copy($fixtureDir . DIRECTORY_SEPARATOR . $file, $filePath); + copy($fixtureDir . DIRECTORY_SEPARATOR . $file, $filePath . '_1'); + + $_FILES["item_simple_with_custom_file_option_options_$optionIds[0]_file"] = [ + 'name' => 'test.jpg', + 'type' => 'image/jpeg', + 'tmp_name' => $filePath, + 'error' => 0, + 'size' => '3046', + ]; + $_FILES["item_simple_with_custom_file_option_options_$optionIds[1]_file"] = [ + 'name' => 'test.jpg', + 'type' => 'image/jpeg', + 'tmp_name' => $filePath . '_1', + 'error' => 0, + 'size' => '3046', + ]; + $this->prepareUploaderFactoryMock(); + } + + /** + * Prepare file upload validator mock + * + * @return void + */ + private function prepareUploaderFactoryMock(): void + { + $uploaderMock = $this->getPreparedUploader(); + /** @var FileTransferFactory $httpFactory */ + $httpFactoryMock = $this->createPartialMock(FileTransferFactory::class, ['create']); + $httpFactoryMock->expects($this->at(0)) + ->method('create') + ->willReturn($uploaderMock); + $httpFactoryMock->expects($this->at(1)) + ->method('create') + ->willReturn(clone $uploaderMock); + $this->objectManager->addSharedInstance($httpFactoryMock, FileTransferFactory::class); + } + + /** + * Create prepared uploader instance for test + * + * @return \Zend_File_Transfer_Adapter_Http + * @SuppressWarnings(PHPMD.UnusedLocalVariable) + */ + private function getPreparedUploader(): \Zend_File_Transfer_Adapter_Http + { + $uploader = new \Zend_File_Transfer_Adapter_Http(); + $refObject = new \ReflectionObject($uploader); + $validators = $refObject->getProperty('_validators'); + $validators->setAccessible(true); + $validators->setValue($uploader, []); + $files = $refObject->getProperty('_files'); + $files->setAccessible(true); + $filesValues = $files->getValue($uploader); + foreach (array_keys($filesValues) as $value) { + $filesValues[$value]['validators'] = []; + } + $files->setValue($uploader, $filesValues); + + return $uploader; + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceTest.php index fe7207d310345..2ebdaa67d4b37 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceTest.php @@ -222,4 +222,17 @@ private function prepareBuyRequest(Product $product): DataObject return $this->objectManager->create(DataObject::class, ['data' => ['qty' => 1, 'options' => $options]]); } + + /** + * Assert price for different product with decimal qty. + * + * @magentoDataFixture Magento/Catalog/_files/simple_product_with_tier_price_and_decimal_qty.php + * @magentoAppIsolation enabled + * @return void + */ + public function testTierPriceWithDecimalInventory(): void + { + $product = $this->productRepository->get('simple'); + $this->assertEquals(2.99, $this->productPrice->getFinalPrice(0.5, $product)); + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php index 8acb243a706c2..ceb3a2c7a94b2 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php @@ -814,4 +814,16 @@ public function testConstructionWithCustomAttributesArrayInData() $this->assertSame($product->getCustomAttribute('tax_class_id')->getValue(), '3'); $this->assertSame($product->getCustomAttribute('category_ids')->getValue(), '1,2'); } + + public function testSetPriceWithoutTypeId() + { + $this->_model->setAttributeSetId(4); + $this->_model->setName('Some name'); + $this->_model->setSku('some_sku'); + $this->_model->setPrice(9.95); + $this->productRepository->save($this->_model); + + $product = $this->productRepository->get('some_sku', false, null, true); + $this->assertEquals(9.95, $product->getPrice()); + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/GalleryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/GalleryTest.php new file mode 100644 index 0000000000000..e7d78a73d79c5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/GalleryTest.php @@ -0,0 +1,93 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\ResourceModel\Product; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Gallery\ReadHandler; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; +use Magento\Framework\App\ResourceConnection; + +/** + * Test for \Magento\Catalog\Model\ResourceModel\Product\Gallery. + * + * @magentoAppArea adminhtml + */ +class GalleryTest extends TestCase +{ + /** + * @var Gallery + */ + private $galleryResource; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var ResourceConnection + */ + private $resource; + + /** + * @var ReadHandler + */ + private $readHandler; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $objectManager = Bootstrap::getObjectManager(); + + $this->productRepository = $objectManager->create(ProductRepositoryInterface::class); + $this->galleryResource = $objectManager->create(Gallery::class); + $this->resource = $objectManager->create(ResourceConnection::class); + $this->readHandler = $objectManager->create(ReadHandler::class); + } + + /** + * Verify catalog_product_entity_media_gallery table will not have data after deleting the product + * + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + * @magentoDbIsolation disabled + * + * @return void + */ + public function testDeleteProductWithImage(): void + { + $product = $this->productRepository->get('simple'); + + $attributeId = $this->readHandler->getAttribute()->getAttributeId(); + $mediaGalleryData = $this->galleryResource->loadProductGalleryByAttributeId($product, $attributeId); + $values = array_column($mediaGalleryData, 'value_id'); + $this->assertNotEmpty($this->getMediaGalleryDataByValues($values)); + + $this->productRepository->delete($product); + + $this->assertEmpty($this->getMediaGalleryDataByValues($values)); + } + + /** + * Return data from catalog_product_entity_media_gallery_values table + * + * @param array $values + * @return array + */ + private function getMediaGalleryDataByValues(array $values): array + { + $connection = $this->resource->getConnection(); + $select = $connection->select() + ->from($this->resource->getTableName(Gallery::GALLERY_TABLE)) + ->where('value_id IN (?)', $values); + + return $connection->fetchAll($select); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Related/AbstractRelationsDataProviderTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Related/AbstractRelationsDataProviderTest.php new file mode 100644 index 0000000000000..1254468ada10f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Related/AbstractRelationsDataProviderTest.php @@ -0,0 +1,125 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Ui\DataProvider\Product\Related; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\View\Element\UiComponentFactory; +use Magento\Framework\View\Element\UiComponentInterface; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\TestCase; +use Magento\TestFramework\Helper\Bootstrap; + +/** + * Base logic for relations data providers checks + */ +abstract class AbstractRelationsDataProviderTest extends TestCase +{ + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var UiComponentFactory */ + private $componentFactory; + + /** @var RequestInterface */ + private $request; + + /** @var ProductRepositoryInterface */ + private $productRepository; + + /** @var StoreManagerInterface */ + private $storeManager; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->request = $this->objectManager->get(RequestInterface::class); + $this->componentFactory = $this->objectManager->get(UiComponentFactory::class); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $this->storeManager = $this->objectManager->get(StoreManagerInterface::class); + } + + /** + * Assert grid result data + * + * @param int $expectedCount + * @param array $expectedData + * @param array $actualResult + * @return void + */ + protected function assertResult(int $expectedCount, array $expectedData, array $actualResult): void + { + $this->assertCount($expectedCount, $actualResult); + $item = reset($actualResult); + foreach ($expectedData as $key => $data) { + $this->assertEquals($item[$key], $data); + } + } + + /** + * Get component provided data + * + * @param string $namespace + * @return array + */ + protected function getComponentProvidedData(string $namespace): array + { + $component = $this->componentFactory->create($namespace); + $this->prepareChildComponents($component); + + return $component->getContext()->getDataProvider()->getData(); + } + + /** + * Prepare request + * + * @param string $productSku + * @param string $relatedProductSku + * @param string $storeCode + * @return void + */ + protected function prepareRequest(string $productSku, string $relatedProductSku, string $storeCode): void + { + $storeId = (int)$this->storeManager->getStore($storeCode)->getId(); + $productId = (int)$this->productRepository->get($productSku)->getId(); + $relatedProductId = (int)$this->productRepository->get($relatedProductSku)->getId(); + $params = [ + 'current_product_id' => $productId, + 'current_store_id' => $storeId, + 'filters_modifier' => [ + 'entity_id' => [ + 'condition_type' => 'nin', + 'value' => [$relatedProductId], + ], + ], + ]; + + $this->request->setParams($params); + } + + /** + * Call prepare method in the child components + * + * @param UiComponentInterface $component + * @return void + */ + private function prepareChildComponents(UiComponentInterface $component): void + { + foreach ($component->getChildComponents() as $child) { + $this->prepareChildComponents($child); + } + + $component->prepare(); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Related/CrossSellDataProviderTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Related/CrossSellDataProviderTest.php new file mode 100644 index 0000000000000..43662b6bb15f2 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Related/CrossSellDataProviderTest.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Ui\DataProvider\Product\Related; + +/** + * Checks cross-sell products data provider + * + * @see \Magento\Catalog\Ui\DataProvider\Product\Related\CrossSellDataProvider + * + * @magentoAppArea adminhtml + * @magentoDbIsolation disabled + */ +class CrossSellDataProviderTest extends AbstractRelationsDataProviderTest +{ + /** + * @dataProvider productDataProvider + * + * @magentoDataFixture Magento/Catalog/_files/products_crosssell.php + * @magentoDataFixture Magento/Catalog/_files/product_with_price_on_second_website.php + * + * @param string $storeCode + * @param float $price + * @return void + */ + public function testGetData(string $storeCode, float $price): void + { + $this->prepareRequest('simple_with_cross', 'simple', $storeCode); + $result = $this->getComponentProvidedData('crosssell_product_listing')['items']; + $this->assertResult(1, ['sku' => 'second-website-price-product', 'price' => $price], $result); + } + + /** + * @return array + */ + public function productDataProvider(): array + { + return [ + 'without_store_code' => [ + 'store_code' => 'default', + 'product_price' => 20, + ], + 'with_store_code' => [ + 'store_code' => 'fixture_second_store', + 'product_price' => 10, + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Related/UpSellDataProviderTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Related/UpSellDataProviderTest.php new file mode 100644 index 0000000000000..268ae8becccf1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Related/UpSellDataProviderTest.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Ui\DataProvider\Product\Related; + +/** + * Checks up-sell products data provider + * + * @see \Magento\Catalog\Ui\DataProvider\Product\Related\UpSellDataProvider + * + * @magentoAppArea adminhtml + * @magentoDbIsolation disabled + */ +class UpSellDataProviderTest extends AbstractRelationsDataProviderTest +{ + /** + * @dataProvider productDataProvider + * + * @magentoDataFixture Magento/Catalog/_files/products_upsell.php + * @magentoDataFixture Magento/Catalog/_files/product_with_price_on_second_website.php + * + * @param string $storeCode + * @param float $price + * @return void + */ + public function testGetData(string $storeCode, float $price): void + { + $this->prepareRequest('simple_with_upsell', 'simple', $storeCode); + $result = $this->getComponentProvidedData('upsell_product_listing')['items']; + $this->assertResult(1, ['sku' => 'second-website-price-product', 'price' => $price], $result); + } + + /** + * @return array + */ + public function productDataProvider(): array + { + return [ + 'without_store_code' => [ + 'store_code' => 'default', + 'product_price' => 20, + ], + 'with_store_code' => [ + 'store_code' => 'fixture_second_store', + 'product_price' => 10, + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_sorted.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_sorted.php new file mode 100644 index 0000000000000..6d2febbb24d88 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_sorted.php @@ -0,0 +1,124 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Catalog\Api\CategoryLinkManagementInterface; +use Magento\Catalog\Api\CategoryLinkRepositoryInterface; +use Magento\Catalog\Api\Data\CategoryInterfaceFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Eav\Model\Config; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); + +/** @var WebsiteRepositoryInterface $websiteRepository */ +$websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); +$baseWebsite = $websiteRepository->get('base'); +$rootCategoryId = $baseWebsite->getDefaultStore()->getRootCategoryId(); + +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); + +$defaultAttributeSet = $objectManager->get(Config::class)->getEntityType(Product::ENTITY)->getDefaultAttributeSetId(); +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$categoryFactory = $objectManager->get(CategoryInterfaceFactory::class); + +$categoryLinkRepository = $objectManager->create( + CategoryLinkRepositoryInterface::class, + [ + 'productRepository' => $productRepository, + ] +); + +/** @var Magento\Catalog\Api\CategoryLinkManagementInterface $categoryLinkManagement */ +$categoryLinkManagement = $objectManager->get(CategoryLinkManagementInterface::class); +$reflectionClass = new \ReflectionClass(get_class($categoryLinkManagement)); +$properties = [ + 'productRepository' => $productRepository, + 'categoryLinkRepository' => $categoryLinkRepository, +]; +foreach ($properties as $key => $value) { + if ($reflectionClass->hasProperty($key)) { + $reflectionProperty = $reflectionClass->getProperty($key); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue($categoryLinkManagement, $value); + } +} + +/** + * After installation system has two categories: root one with ID:1 and Default category with ID:2 + */ +/** @var $category \Magento\Catalog\Model\Category */ +$category = $categoryFactory->create(); +$category->isObjectNew(true); +$category->setId(3) + ->setName('Category 1') + ->setParentId(2) + ->setPath('1/2/3') + ->setLevel(2) + ->setAvailableSortBy('name') + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setPosition(2) + ->save(); + +$category = $categoryFactory->create(); +$category->isObjectNew(true); +$category->setId(4) + ->setName('Category 1.1') + ->setParentId(3) + ->setPath('1/2/3/4') + ->setLevel(3) + ->setAvailableSortBy('name') + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setIsAnchor(true) + ->setPosition(2) + ->setDescription('Category 1.1 description.') + ->save(); + +$category = $categoryFactory->create(); +$category->isObjectNew(true); +$category->setId(6) + ->setName('Category 2') + ->setParentId(2) + ->setPath('1/2/6') + ->setLevel(2) + ->setAvailableSortBy('name') + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setPosition(3) + ->save(); + +$category = $categoryFactory->create(); +$category->isObjectNew(true); +$category->setId(12) + ->setName('Category 12') + ->setParentId(2) + ->setPath('1/2/12') + ->setLevel(2) + ->setAvailableSortBy('name') + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setPosition(1) + ->save(); + +$category = $categoryFactory->create(); +$category->isObjectNew(true); +$category->setId(13) + ->setName('Category 1.2') + ->setParentId(3) + ->setPath('1/2/3/13') + ->setLevel(3) + ->setDescription('Its a description of Test Category 1.2') + ->setAvailableSortBy('name') + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setIsAnchor(true) + ->setPosition(1) + ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_sorted_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_sorted_rollback.php new file mode 100644 index 0000000000000..cc2c7b3aa6383 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_sorted_rollback.php @@ -0,0 +1,23 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +/** @var \Magento\Framework\Registry $registry */ +$registry = $objectManager->get(\Magento\Framework\Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +//Remove categories +/** @var Magento\Catalog\Model\ResourceModel\Category\Collection $collection */ +$collection = $objectManager->create(\Magento\Catalog\Model\ResourceModel\Category\Collection::class); +foreach ($collection->addAttributeToFilter('level', ['in' => [2, 3, 4, 6, 12, 13]]) as $category) { + /** @var \Magento\Catalog\Model\Category $category */ + $category->delete(); +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/empty.csv b/dev/tests/integration/testsuite/Magento/Catalog/_files/empty.csv new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_design_attributes.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_design_attributes.php new file mode 100644 index 0000000000000..196d61b9df2e3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_design_attributes.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Catalog\Model\ProductFactory; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductFactory $productFactory */ +$productFactory = $objectManager->get(ProductFactory::class); +/** @var WebsiteRepositoryInterface $websiteRepository */ +$websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); +$defaultWebsiteId = $websiteRepository->get('base')->getId(); +$product = $productFactory->create(); +$product->isObjectNew(true); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([$defaultWebsiteId]) + ->setName('Simple with design attribute') + ->setSku('simple_design_attribute') + ->setPrice(10) + ->setWeight(1) + ->setShortDescription('Short description') + ->setTaxClassId(0) + ->setDescription('Description with <b>html tag</b>') + ->setMetaTitle('meta title') + ->setMetaKeyword('meta keyword') + ->setMetaDescription('meta description') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 0]) + ->setCanSaveCustomOptions(true) + ->setCustomDesignFrom('2020-01-02') + ->setCustomDesignTo('2020-01-03') + ->setHasOptions(true); +/** @var ProductRepositoryInterface $productRepositoryFactory */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_design_attributes_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_design_attributes_rollback.php new file mode 100644 index 0000000000000..4007ff713a699 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_design_attributes_rollback.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Exception\NoSuchEntityException; + +\Magento\TestFramework\Helper\Bootstrap::getInstance()->getInstance()->reinitialize(); + +/** @var \Magento\Framework\Registry $registry */ +$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ +$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); +try { + $product = $productRepository->get('simple_design_attribute', false, null, true); + $productRepository->delete($product); +} catch (NoSuchEntityException $e) { +} +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_media.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_media.php new file mode 100644 index 0000000000000..3542e372dc0dc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_media.php @@ -0,0 +1,222 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\CategoryLinkManagementInterface; +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory; +use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory; +use Magento\Catalog\Api\Data\ProductExtensionInterfaceFactory; +use Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Customer\Model\Group; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; + +Bootstrap::getInstance()->reinitialize(); + +/** @var \Magento\TestFramework\ObjectManager $objectManager */ +$objectManager = Bootstrap::getObjectManager(); + +/** @var CategoryLinkManagementInterface $categoryLinkManagement */ +$categoryLinkManagement = $objectManager->get(CategoryLinkManagementInterface::class); + +$tierPrices = []; +/** @var ProductTierPriceInterfaceFactory $tierPriceFactory */ +$tierPriceFactory = $objectManager->get(ProductTierPriceInterfaceFactory::class); +/** @var $tpExtensionAttributes */ +$tpExtensionAttributesFactory = $objectManager->get(ProductTierPriceExtensionFactory::class); +/** @var $productExtensionAttributes */ +$productExtensionAttributesFactory = $objectManager->get(ProductExtensionInterfaceFactory::class); + +$adminWebsite = $objectManager->get(WebsiteRepositoryInterface::class)->get('admin'); +$tierPriceExtensionAttributes1 = $tpExtensionAttributesFactory->create() + ->setWebsiteId($adminWebsite->getId()); +$productExtensionAttributesWebsiteIds = $productExtensionAttributesFactory->create( + ['website_ids' => $adminWebsite->getId()] +); + +$tierPrices[] = $tierPriceFactory->create( + [ + 'data' => [ + 'customer_group_id' => Group::CUST_GROUP_ALL, + 'qty' => 2, + 'value' => 8 + ] + ] +)->setExtensionAttributes($tierPriceExtensionAttributes1); + +$tierPrices[] = $tierPriceFactory->create( + [ + 'data' => [ + 'customer_group_id' => Group::CUST_GROUP_ALL, + 'qty' => 5, + 'value' => 5 + ] + ] +)->setExtensionAttributes($tierPriceExtensionAttributes1); + +$tierPrices[] = $tierPriceFactory->create( + [ + 'data' => [ + 'customer_group_id' => Group::NOT_LOGGED_IN_ID, + 'qty' => 3, + 'value' => 5 + ] + ] +)->setExtensionAttributes($tierPriceExtensionAttributes1); + +$tierPrices[] = $tierPriceFactory->create( + [ + 'data' => [ + 'customer_group_id' => Group::NOT_LOGGED_IN_ID, + 'qty' => 3.2, + 'value' => 6, + ] + ] +)->setExtensionAttributes($tierPriceExtensionAttributes1); + +$tierPriceExtensionAttributes2 = $tpExtensionAttributesFactory->create() + ->setWebsiteId($adminWebsite->getId()) + ->setPercentageValue(50); + +$tierPrices[] = $tierPriceFactory->create( + [ + 'data' => [ + 'customer_group_id' => Group::NOT_LOGGED_IN_ID, + 'qty' => 10 + ] + ] +)->setExtensionAttributes($tierPriceExtensionAttributes2); + +/** @var $product Product */ +$product = $objectManager->create(Product::class); +$product->isObjectNew(true); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setId(812) + ->setAttributeSetId(4) + ->setWebsiteIds([1]) + ->setName('Simple Product With Media') + ->setSku('simple_product_with_media') + ->setPrice(10) + ->setWeight(1) + ->setShortDescription("Short description") + ->setTaxClassId(2) + ->setTierPrices($tierPrices) + ->setDescription('Description with <b>html tag</b>') + ->setExtensionAttributes($productExtensionAttributesWebsiteIds) + ->setMetaTitle('meta title') + ->setMetaKeyword('meta keyword') + ->setMetaDescription('meta description') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_qty_decimal' => 0, + 'is_in_stock' => 1, + ] + )->setCanSaveCustomOptions(true) + ->setHasOptions(true); + +$oldOptions = [ + [ + 'previous_group' => 'text', + 'title' => 'Test Field', + 'type' => 'field', + 'is_require' => 1, + 'sort_order' => 0, + 'price' => 1, + 'price_type' => 'fixed', + 'sku' => '1-text', + 'max_characters' => 100, + ], + [ + 'previous_group' => 'date', + 'title' => 'Test Date and Time', + 'type' => 'date_time', + 'is_require' => 1, + 'sort_order' => 0, + 'price' => 2, + 'price_type' => 'fixed', + 'sku' => '2-date', + ], + [ + 'previous_group' => 'select', + 'title' => 'Test Select', + 'type' => 'drop_down', + 'is_require' => 1, + 'sort_order' => 0, + 'values' => [ + [ + 'option_type_id' => null, + 'title' => 'Option 1', + 'price' => 3, + 'price_type' => 'fixed', + 'sku' => '3-1-select', + ], + [ + 'option_type_id' => null, + 'title' => 'Option 2', + 'price' => 3, + 'price_type' => 'fixed', + 'sku' => '3-2-select', + ], + ] + ], + [ + 'previous_group' => 'select', + 'title' => 'Test Radio', + 'type' => 'radio', + 'is_require' => 1, + 'sort_order' => 0, + 'values' => [ + [ + 'option_type_id' => null, + 'title' => 'Option 1', + 'price' => 3, + 'price_type' => 'fixed', + 'sku' => '4-1-radio', + ], + [ + 'option_type_id' => null, + 'title' => 'Option 2', + 'price' => 3, + 'price_type' => 'fixed', + 'sku' => '4-2-radio', + ], + ] + ] +]; + +$options = []; + +/** @var ProductCustomOptionInterfaceFactory $customOptionFactory */ +$customOptionFactory = $objectManager->create(ProductCustomOptionInterfaceFactory::class); + +foreach ($oldOptions as $option) { + /** @var ProductCustomOptionInterface $option */ + $option = $customOptionFactory->create(['data' => $option]); + $option->setProductSku($product->getSku()); + + $options[] = $option; +} + +$product->setOptions($options); + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +$productRepository->save($product); + +$categoryLinkManagement->assignProductToCategories( + $product->getSku(), + [2] +); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_media_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_media_rollback.php new file mode 100644 index 0000000000000..cd29cd031f31a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_media_rollback.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +Bootstrap::getInstance()->getInstance()->reinitialize(); + +/** @var Registry $registry */ +$registry = Bootstrap::getObjectManager()->get(Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = Bootstrap::getObjectManager() + ->get(ProductRepositoryInterface::class); +try { + $product = $productRepository->get('simple_product_with_media', false, null, true); + $productRepository->delete($product); +} catch (NoSuchEntityException $e) { +} +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_two_custom_file_options.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_two_custom_file_options.php new file mode 100644 index 0000000000000..af8c8d5eb0ce1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_two_custom_file_options.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +/** @var ObjectManager $objectManager */ +$objectManager = Bootstrap::getObjectManager(); +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_with_custom_file_option.php'); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$productRepository->cleanCache(); +$product = $productRepository->get('simple_with_custom_file_option'); +$option = [ + 'title' => 'file option 2', + 'type' => 'file', + 'is_require' => true, + 'sort_order' => 1, + 'price' => 20.0, + 'price_type' => 'percent', + 'sku' => 'sku4', + 'file_extension' => 'jpg, png, gif', + 'image_size_x' => 1000, + 'image_size_y' => 1000, +]; +$customOptions = $product->getOptions(); +/** @var ProductCustomOptionInterfaceFactory $customOptionFactory */ +$customOptionFactory = $objectManager->create(ProductCustomOptionInterfaceFactory::class); +/** @var ProductCustomOptionInterface $customOption */ +$customOption = $customOptionFactory->create(['data' => $option]); +$customOption->setProductSku($product->getSku()); +$customOptions[] = $customOption; +$product->setOptions($customOptions); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_two_custom_file_options_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_two_custom_file_options_rollback.php new file mode 100644 index 0000000000000..a2f2dd8be1069 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_two_custom_file_options_rollback.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture( + 'Magento/Catalog/_files/product_simple_with_custom_file_option_rollback.php' +); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_disabled_image.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_disabled_image.php new file mode 100644 index 0000000000000..fac0144dd1332 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_disabled_image.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface; +use Magento\Catalog\Api\Data\ProductInterfaceFactory; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Catalog\Model\ResourceModel\Product as ProductResource; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\Store\Model\Store; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_image.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductResource $productResource */ +$productResource = $objectManager->get(ProductResource::class); +/** @var ProductInterfaceFactory $productFactory */ +$productFactory = $objectManager->get(ProductInterfaceFactory::class); +/** @var WebsiteRepositoryInterface $websiteRepository */ +$websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); +$baseWebsiteId = (int)$websiteRepository->get('base')->getId(); +$product = $productFactory->create(); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([$baseWebsiteId]) + ->setName('Simple product with disabled image') + ->setSku('simple_with_disabled_img') + ->setPrice(10) + ->setMetaTitle('meta title2') + ->setMetaKeyword('meta keyword2') + ->setMetaDescription('meta description2') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 0]) + ->setStoreId(Store::DEFAULT_STORE_ID) + ->setImage('/m/a/magento_image.jpg') + ->setSmallImage('/m/a/magento_image.jpg') + ->setThumbnail('/m/a/magento_image.jpg') + ->setData( + 'media_gallery', + [ + 'images' => [ + [ + ProductAttributeMediaGalleryEntryInterface::FILE => '/m/a/magento_image.jpg', + ProductAttributeMediaGalleryEntryInterface::POSITION => 1, + ProductAttributeMediaGalleryEntryInterface::LABEL => 'Image Alt Text', + ProductAttributeMediaGalleryEntryInterface::DISABLED => 1, + ProductAttributeMediaGalleryEntryInterface::MEDIA_TYPE => 'image', + ], + ], + ] + ) + ->setCanSaveCustomOptions(true); + +$productResource->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_disabled_image_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_disabled_image_rollback.php new file mode 100644 index 0000000000000..a6d78e7ffb40f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_disabled_image_rollback.php @@ -0,0 +1,32 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +try { + $productRepository->deleteById('simple_with_disabled_img'); +} catch (NoSuchEntityException $e) { + //already deleted +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_image_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_media_gallery.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_media_gallery.php new file mode 100644 index 0000000000000..eef2a371ce685 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_media_gallery.php @@ -0,0 +1,35 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_image.php'); +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_with_media.php'); + +$objectManager = Bootstrap::getObjectManager(); +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +$product = $productRepository->get('simple_product_with_media'); + +/** @var $product Product */ +$product->setStoreId(0) + ->setImage('/m/a/magento_image.jpg') + ->setSmallImage('/m/a/magento_image.jpg') + ->setThumbnail('/m/a/magento_image.jpg') + ->setData('media_gallery', ['images' => [ + [ + 'file' => '/m/a/magento_image.jpg', + 'position' => 1, + 'label' => 'Image Alt Text', + 'disabled' => 0, + 'media_type' => 'image' + ], + ]]) + ->setCanSaveCustomOptions(true) + ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_media_gallery_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_media_gallery_rollback.php new file mode 100644 index 0000000000000..9b941d7359d47 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_media_gallery_rollback.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_with_media_rollback.php'); +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_image_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php index 8764e12916d8b..23c2d298df4e7 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php @@ -6,6 +6,7 @@ declare(strict_types=1); use Magento\Catalog\Api\Data\CategoryInterfaceFactory; +use Magento\Catalog\Api\Data\ProductAttributeInterface; use Magento\Catalog\Api\Data\ProductAttributeInterfaceFactory; use Magento\Catalog\Api\Data\ProductInterfaceFactory; use Magento\Catalog\Api\ProductAttributeRepositoryInterface; @@ -18,7 +19,6 @@ use Magento\Eav\Setup\EavSetup; use Magento\Indexer\Model\Indexer; use Magento\Indexer\Model\Indexer\Collection; -use Magento\Msrp\Model\Product\Attribute\Source\Type as SourceType; use Magento\Store\Api\WebsiteRepositoryInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\Helper\CacheCleaner; @@ -27,7 +27,6 @@ /** @var Config $eavConfig */ $eavConfig = $objectManager->get(Config::class); - /** @var ProductAttributeRepositoryInterface $attributeRepository */ $attributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); /** @var ProductAttributeInterfaceFactory $attributeFactory */ @@ -42,11 +41,13 @@ $websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); $baseWebsite = $websiteRepository->get('base'); +$attributes = []; for ($i = 1; $i <= 2; $i++) { + $attributeCode = 'test_attribute_' . $i; $attributeModel = $attributeFactory->create(); $attributeModel->setData( [ - 'attribute_code' => 'test_attribute_' . $i, + 'attribute_code' => $attributeCode, 'entity_type_id' => $installer->getEntityTypeId(Product::ENTITY), 'is_global' => 1, 'is_user_defined' => 1, @@ -66,96 +67,76 @@ 'frontend_label' => ['Test Attribute ' . $i], 'backend_type' => 'int', 'option' => [ - 'value' => ['option_0' => ['Option 1'], 'option_1' => ['Option 2']], - 'order' => ['option_0' => 1, 'option_1' => 2], + 'value' => ['option_1' => ['Option 1'], 'option_2' => ['Option 2'], 'option_3' => ['Option 3']], + 'order' => ['option_1' => 1, 'option_2' => 2, 'option_3' => 3], ], - 'default' => ['option_0'], 'position' => 3 - $i ] ); $attribute = $attributeRepository->save($attributeModel); $installer->addAttributeToGroup(Product::ENTITY, $attributeSetId, $groupId, $attribute->getId()); + $attributes[$attributeCode] = $attribute; } +/** @var ProductAttributeInterface $attribute1 */ +$attribute1 = $attributes['test_attribute_1']; +/** @var ProductAttributeInterface $attribute2 */ +$attribute2 = $attributes['test_attribute_2']; + CacheCleaner::cleanAll(); $eavConfig->clear(); -/** @var ProductRepositoryInterface $productRepository */ -$productRepository = $objectManager->get(ProductRepositoryInterface::class); -/** @var ProductInterfaceFactory $productInterfaceFactory */ -$productInterfaceFactory = $objectManager->get(ProductInterfaceFactory::class); - -/** @var Product $product */ -$product = $productInterfaceFactory->create(); -$product->setTypeId(Type::TYPE_SIMPLE) - ->setAttributeSetId($product->getDefaultAttributeSetId()) - ->setName('Simple Product1') - ->setSku('simple1') - ->setTaxClassId('none') - ->setDescription('description') - ->setShortDescription('short description') - ->setOptionsContainer('container1') - ->setMsrpDisplayActualPriceType(SourceType::TYPE_IN_CART) - ->setPrice(10) - ->setWeight(1) - ->setMetaTitle('meta title') - ->setMetaKeyword('meta keyword') - ->setMetaDescription('meta description') - ->setVisibility(Visibility::VISIBILITY_BOTH) - ->setStatus(Status::STATUS_ENABLED) - ->setWebsiteIds([$baseWebsite->getId()]) - ->setCategoryIds([]) - ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) - ->setSpecialPrice('5.99'); -$simple1 = $productRepository->save($product); - -/** @var Product $product */ -$product = $productInterfaceFactory->create(); -$product->setTypeId(Type::TYPE_SIMPLE) - ->setAttributeSetId($product->getDefaultAttributeSetId()) - ->setName('Simple Product2') - ->setSku('simple2') - ->setTaxClassId('none') - ->setDescription('description') - ->setShortDescription('short description') - ->setOptionsContainer('container1') - ->setMsrpDisplayActualPriceType(SourceType::TYPE_ON_GESTURE) - ->setPrice(20) - ->setWeight(1) - ->setMetaTitle('meta title') - ->setMetaKeyword('meta keyword') - ->setMetaDescription('meta description') - ->setVisibility(Visibility::VISIBILITY_BOTH) - ->setStatus(Status::STATUS_ENABLED) - ->setWebsiteIds([$baseWebsite->getId()]) - ->setCategoryIds([]) - ->setStockData(['use_config_manage_stock' => 1, 'qty' => 50, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) - ->setSpecialPrice('15.99'); -$simple2 = $productRepository->save($product); - /** @var CategoryInterfaceFactory $categoryInterfaceFactory */ $categoryInterfaceFactory = $objectManager->get(CategoryInterfaceFactory::class); +/** @var Magento\Catalog\Model\Category $category */ $category = $categoryInterfaceFactory->create(); $category->isObjectNew(true); $category->setId(3334) - ->setCreatedAt('2014-06-23 09:50:07') ->setName('Category 1') ->setParentId(2) - ->setPath('1/2/333') + ->setPath('1/2/3334') ->setLevel(2) ->setAvailableSortBy(['position', 'name']) ->setDefaultSortBy('name') ->setIsActive(true) - ->setPosition(1) - ->setPostedProducts( - [ - $simple1->getId() => 10, - $simple2->getId() => 11 - ] - ); + ->setPosition(1); $category->save(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var ProductInterfaceFactory $productInterfaceFactory */ +$productInterfaceFactory = $objectManager->get(ProductInterfaceFactory::class); +$products = []; +for ($i = 1; $i <= 6; $i++) { + $sku = 'simple' . $i; + /** @var Product $product */ + $product = $productInterfaceFactory->create(); + $product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setName('Simple Product ' . $i) + ->setSku($sku) + ->setUrlKey('simple-product-' . $i) + ->setTaxClassId('none') + ->setDescription('description') + ->setShortDescription('short description') + ->setPrice($i * 10) + ->setWeight(1) + ->setMetaTitle('meta title') + ->setMetaKeyword('meta keyword') + ->setMetaDescription('meta description') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setWebsiteIds([$baseWebsite->getId()]) + ->setCategoryIds([$category->getId()]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 50, 'is_qty_decimal' => 0, 'is_in_stock' => 1]); + $product->setData($attribute1->getAttributeCode(), getAttributeOptionValue($attribute1, 'Option 1')); + $optionForSecondAttribute = 'Option ' . ($i === 1 ? 1 : ($i <= 3 ? 2 : 3)); + $product->setData($attribute2->getAttributeCode(), getAttributeOptionValue($attribute2, $optionForSecondAttribute)); + + $products[$sku] = $productRepository->save($product); +} + /** @var Collection $indexerCollection */ $indexerCollection = $objectManager->get(Collection::class); $indexerCollection->load(); @@ -163,3 +144,18 @@ foreach ($indexerCollection->getItems() as $indexer) { $indexer->reindexAll(); } + +/** + * @param ProductAttributeInterface $attribute + * @param string $label + * @return int|null + */ +function getAttributeOptionValue(ProductAttributeInterface $attribute, string $label): ?int +{ + foreach ($attribute->getOptions() as $option) { + if ($option->getLabel() === $label) { + return (int)$option->getValue(); + } + } + return null; +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php index 49e2b549552e6..fbac199c843ca 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php @@ -22,8 +22,8 @@ /** @var ProductRepositoryInterface $productRepository */ $productRepository = $objectManager->get(ProductRepositoryInterface::class); - -foreach (['simple1', 'simple2'] as $sku) { +for ($i = 1; $i <= 6; $i++) { + $sku = 'simple' . $i; try { $product = $productRepository->get($sku, false, null, true); $productRepository->delete($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_custom_design.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_custom_design.php new file mode 100644 index 0000000000000..bb11ee214c802 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_custom_design.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Catalog\Model\ProductFactory; +use Magento\TestFramework\Helper\Bootstrap; + +$product = Bootstrap::getObjectManager()->create(ProductFactory::class)->create(); +$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); +$product->setTypeId('simple') + ->setPageLayout('3columns') + ->setAttributeSetId(4) + ->setWebsiteIds([1]) + ->setName('Simple Product With Custom Design') + ->setSku('simple_with_custom_design') + ->setPrice(10) + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_in_stock' => 1]); + +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_custom_design_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_custom_design_rollback.php new file mode 100644 index 0000000000000..813cf0a047332 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_custom_design_rollback.php @@ -0,0 +1,28 @@ +<?php + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +$registry = $objectManager->get(Registry::class); +$productRepository = $objectManager->get(ProductRepositoryInterface::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +try { + $productRepository->deleteById('simple_with_custom_design'); +} catch (NoSuchEntityException $e) { + //product already deleted. +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_and_decimal_qty.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_and_decimal_qty.php new file mode 100644 index 0000000000000..97f743f14a78f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_and_decimal_qty.php @@ -0,0 +1,40 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory; +use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var ProductTierPriceInterfaceFactory $tierPriceFactory */ +$tierPriceFactory = $objectManager->get(ProductTierPriceInterfaceFactory::class); +/** @var ProductTierPriceExtensionFactory $tierPriceExtensionAttributesFactory */ +$tierPriceExtensionAttributesFactory = $objectManager->get(ProductTierPriceExtensionFactory::class); +$product = $productRepository->get('simple', false, null, true); +$product->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 1, 'is_in_stock' => 1, 'min_sale_qty' => 0.5]); +$adminWebsite = $objectManager->get(WebsiteRepositoryInterface::class)->get('admin'); +$tierPrices = $product->getTierPrices() ?? []; +$product->setPrice(3.99); +$tierPriceExtensionAttributes = $tierPriceExtensionAttributesFactory->create()->setWebsiteId($adminWebsite->getId()); +$tierPrices[] = $tierPriceFactory->create( + [ + 'data' => [ + 'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL, + 'qty' => 0.5, + 'value' => 2.99 + ] + ] +)->setExtensionAttributes($tierPriceExtensionAttributes); +$product->setTierPrices($tierPrices); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_and_decimal_qty_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_and_decimal_qty_rollback.php new file mode 100644 index 0000000000000..328c1e229da5c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_and_decimal_qty_rollback.php @@ -0,0 +1,10 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php index 4d844a7c6f229..5caaf9742aed2 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php @@ -691,6 +691,26 @@ public function filterByQuantityAndStockStatusDataProvider(): array ]; } + /** + * Test that Product Export takes into account filtering by Website + * + * Fixtures provide two products, one assigned to default website only, + * and the other is assigned to to default and custom websites. Only product assigned custom website is exported + * + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_options.php + * @magentoDataFixture Magento/Catalog/_files/product_with_two_websites.php + */ + public function testExportProductWithRestrictedWebsite(): void + { + $websiteRepository = $this->objectManager->get(\Magento\Store\Api\WebsiteRepositoryInterface::class); + $website = $websiteRepository->get('second_website'); + + $exportData = $this->doExport(['website_id' => $website->getId()]); + + $this->assertStringContainsString('"Simple Product"', $exportData); + $this->assertStringNotContainsString('"Virtual Product With Custom Options"', $exportData); + } + /** * Perform export * diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ImportWithNotExistImagesTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ImportWithNotExistImagesTest.php new file mode 100644 index 0000000000000..e317ee119b180 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ImportWithNotExistImagesTest.php @@ -0,0 +1,225 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Import; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface; +use Magento\CatalogImportExport\Model\Import\ProductImport; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\File\Csv; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\Write; +use Magento\Framework\MessageQueue\MessageEncoder; +use Magento\Framework\ObjectManagerInterface; +use Magento\ImportExport\Model\Export\Consumer; +use Magento\ImportExport\Model\Import as ImportModel; +use Magento\ImportExport\Model\Import\Source\Csv as CsvSource; +use Magento\ImportExport\Model\Import\Source\CsvFactory; +use Magento\MysqlMq\Model\Driver\Queue; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\MysqlMq\DeleteTopicRelatedMessages; +use PHPUnit\Framework\TestCase; + +/** + * Checks import behaviour if specified images do not exist + * + * @see \Magento\CatalogImportExport\Model\Import\Product + * + * @magentoAppArea adminhtml + */ +class ImportWithNotExistImagesTest extends TestCase +{ + /** @var string */ + private const TOPIC = 'import_export.export'; + + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var MessageEncoder */ + private $messageEncoder; + + /** @var Consumer */ + private $consumer; + + /** @var Queue */ + private $queue; + + /** @var Csv */ + private $csvReader; + + /** @var Write */ + private $directory; + + /** @var string */ + private $filePath; + + /** @var ProductImport */ + private $import; + + /** @var CsvFactory */ + private $csvFactory; + + /** @var Filesystem */ + private $fileSystem; + + /** @var ProductRepositoryInterface */ + private $productRepository; + + /** + * @inheritdoc + */ + public static function setUpBeforeClass(): void + { + parent::setUpBeforeClass(); + + $objectManager = Bootstrap::getObjectManager(); + /** @var DeleteTopicRelatedMessages $deleteMessages */ + $deleteMessages = $objectManager->get(DeleteTopicRelatedMessages::class); + $deleteMessages->execute(self::TOPIC); + } + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->queue = $this->objectManager->create(Queue::class, ['queueName' => 'export']); + $this->messageEncoder = $this->objectManager->get(MessageEncoder::class); + $this->consumer = $this->objectManager->get(Consumer::class); + $this->directory = $this->objectManager->get(Filesystem::class)->getDirectoryWrite(DirectoryList::VAR_DIR); + $this->csvReader = $this->objectManager->get(Csv::class); + $this->import = $this->objectManager->get(ProductFactory::class)->create(); + $this->csvFactory = $this->objectManager->get(CsvFactory::class); + $this->fileSystem = $this->objectManager->get(Filesystem::class); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $this->productRepository->cleanCache(); + } + + /** + * @inheritdoc + */ + protected function tearDown(): void + { + if ($this->filePath && $this->directory->isExist($this->filePath)) { + $this->directory->delete($this->filePath); + } + + parent::tearDown(); + } + + /** + * @magentoDataFixture Magento/CatalogImportExport/_files/export_queue_product_with_images.php + * + * @return void + */ + public function testImportWithUnexistingImages(): void + { + $this->exportProducts(); + $this->assertTrue($this->directory->isExist($this->filePath), 'Products were not imported to file'); + $fileContent = $this->csvReader->getData($this->directory->getAbsolutePath($this->filePath)); + $this->assertCount(2, $fileContent); + $this->updateFileImagesToInvalidValues(); + $this->import->setParameters([ + 'entity' => Product::ENTITY, + 'behavior' => ImportModel::BEHAVIOR_ADD_UPDATE, + ]); + $this->assertImportErrors(); + $this->assertProductImages('/m/a/magento_image.jpg', 'simple'); + } + + /** + * Export products from queue to csv file + * + * @return void + */ + private function exportProducts(): void + { + $envelope = $this->queue->dequeue(); + $decodedMessage = $this->messageEncoder->decode(self::TOPIC, $envelope->getBody()); + $this->consumer->process($decodedMessage); + $this->filePath = 'export/' . $decodedMessage->getFileName(); + } + + /** + * Change image names in an export file + * + * @return void + */ + private function updateFileImagesToInvalidValues(): void + { + $absolutePath = $this->directory->getAbsolutePath($this->filePath); + $csv = $this->csvReader->getData($absolutePath); + $imagesKeys = ['base_image', 'small_image', 'thumbnail_image']; + $imagesPositions = []; + foreach ($imagesKeys as $key) { + $imagesPositions[] = array_search($key, $csv[0]); + } + + foreach ($imagesPositions as $imagesPosition) { + $csv[1][$imagesPosition] = '/m/a/invalid_image.jpg'; + } + + $this->csvReader->appendData($absolutePath, $csv); + } + + /** + * Get export csv file + * + * @param string $file + * @return CsvSource + */ + private function prepareFile(string $file): CsvSource + { + return $this->csvFactory->create([ + 'file' => $file, + 'directory' => $this->fileSystem->getDirectoryWrite(DirectoryList::VAR_DIR), + ]); + } + + /** + * Assert import errors + * + * @return void + */ + private function assertImportErrors(): void + { + $validationErrors = $this->import->setSource($this->prepareFile($this->filePath))->validateData(); + $this->assertEmpty($validationErrors->getAllErrors()); + $this->import->getErrorAggregator()->clear(); + $this->import->importData(); + $importErrors = $this->import->getErrorAggregator()->getAllErrors(); + $this->assertCount(1, $importErrors); + $importError = reset($importErrors); + $this->assertEquals( + RowValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE, + $importError->getErrorCode() + ); + $errorMsg = (string)__('Imported resource (image) could not be downloaded ' . + 'from external resource due to timeout or access permissions'); + $this->assertEquals($errorMsg, $importError->getErrorMessage()); + } + + /** + * Assert product images were not changed after import + * + * @param string $imageName + * @param string $productSku + * @return void + */ + private function assertProductImages(string $imageName, string $productSku): void + { + $product = $this->productRepository->get($productSku); + $this->assertEquals($imageName, $product->getImage()); + $this->assertEquals($imageName, $product->getSmallImage()); + $this->assertEquals($imageName, $product->getThumbnail()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php deleted file mode 100644 index ceb07e3445c0e..0000000000000 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php +++ /dev/null @@ -1,3529 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\CatalogImportExport\Model\Import; - -use Magento\Catalog\Api\Data\ProductInterface; -use Magento\Catalog\Api\ProductCustomOptionRepositoryInterface; -use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Catalog\Model\Category; -use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\ResourceModel\Product as ProductResource; -use Magento\CatalogImportExport\Model\Import\Product as ImportProduct; -use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface; -use Magento\CatalogInventory\Model\Stock; -use Magento\CatalogInventory\Model\StockRegistry; -use Magento\CatalogInventory\Model\StockRegistryStorage; -use Magento\Framework\Api\SearchCriteria; -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\App\Bootstrap; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\App\ObjectManager; -use Magento\Framework\DataObject; -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\Filesystem; -use Magento\Framework\Registry; -use Magento\ImportExport\Helper\Data; -use Magento\ImportExport\Model\Import; -use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; -use Magento\ImportExport\Model\Import\Source\Csv; -use Magento\Store\Model\Store; -use Magento\Store\Model\StoreManagerInterface; -use Magento\TestFramework\Helper\Bootstrap as BootstrapHelper; -use Magento\TestFramework\Indexer\TestCase; -use Magento\UrlRewrite\Model\ResourceModel\UrlRewriteCollection; -use Psr\Log\LoggerInterface; - -/** - * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. - * - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - * @magentoAppArea adminhtml - * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php - * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) - * @SuppressWarnings(PHPMD.ExcessivePublicCount) - * phpcs:disable Generic.PHP.NoSilencedErrors, Generic.Metrics.NestingLevel, Magento2.Functions.StaticFunction - */ -class ProductTest extends TestCase -{ - private const LONG_FILE_NAME_IMAGE = 'magento_long_image_name_magento_long_image_name_magento_long_image_name.jpg'; - - /** - * @var \Magento\CatalogImportExport\Model\Import\Product - */ - protected $_model; - - /** - * @var \Magento\CatalogImportExport\Model\Import\Uploader - */ - protected $_uploader; - - /** - * @var \Magento\CatalogImportExport\Model\Import\UploaderFactory - */ - protected $_uploaderFactory; - - /** - * @var \Magento\CatalogInventory\Model\Spi\StockStateProviderInterface|\PHPUnit\Framework\MockObject\MockObject - */ - protected $_stockStateProvider; - - /** - * @var \Magento\Framework\ObjectManagerInterface - */ - protected $objectManager; - - /** - * @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject - */ - private $logger; - - /** - * @var SearchCriteriaBuilder - */ - private $searchCriteriaBuilder; - - /** - * @var ProductRepositoryInterface - */ - private $productRepository; - - /** - * @inheritdoc - */ - protected function setUp(): void - { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\CatalogImportExport\Model\Import\Product::class, - ['logger' => $this->logger] - ); - $this->importedProducts = []; - $this->searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class); - $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); - - parent::setUp(); - } - - protected function tearDown(): void - { - /* We rollback here the products created during the Import because they were - created during test execution and we do not have the rollback for them */ - /** @var ProductRepositoryInterface $productRepository */ - $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); - foreach ($this->importedProducts as $productSku) { - try { - $product = $productRepository->get($productSku, false, null, true); - $productRepository->delete($product); - // phpcs:disable Magento2.CodeAnalysis.EmptyBlock.DetectedCatch - } catch (NoSuchEntityException $e) { - // nothing to delete - } - } - } - - /** - * @var array - */ - private $importedProducts; - - /** - * Options for assertion - * - * @var array - */ - protected $_assertOptions = [ - 'is_require' => 'required', - 'price' => 'price', - 'sku' => 'sku', - 'sort_order' => 'order', - 'max_characters' => 'max_characters', - ]; - - /** - * Option values for assertion - * - * @var array - */ - protected $_assertOptionValues = [ - 'title' => 'option_title', - 'price' => 'price', - 'sku' => 'sku', - ]; - - /** - * List of specific custom option types - * - * @var array - */ - private $specificTypes = [ - 'drop_down', - 'radio', - 'checkbox', - 'multiple', - ]; - - /** - * Test if visibility properly saved after import - * - * @magentoDataFixture Magento/Catalog/_files/multiple_products.php - * @magentoAppIsolation enabled - */ - public function testSaveProductsVisibility() - { - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Api\ProductRepositoryInterface::class - ); - $id1 = $productRepository->get('simple1')->getId(); - $id2 = $productRepository->get('simple2')->getId(); - $id3 = $productRepository->get('simple3')->getId(); - $existingProductIds = [$id1, $id2, $id3]; - $productsBeforeImport = []; - foreach ($existingProductIds as $productId) { - $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Product::class - ); - $product->load($productId); - $productsBeforeImport[] = $product; - } - - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - - /** @var $productBeforeImport \Magento\Catalog\Model\Product */ - foreach ($productsBeforeImport as $productBeforeImport) { - /** @var $productAfterImport \Magento\Catalog\Model\Product */ - $productAfterImport = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Product::class - ); - $productAfterImport->load($productBeforeImport->getId()); - - $this->assertEquals($productBeforeImport->getVisibility(), $productAfterImport->getVisibility()); - unset($productAfterImport); - } - - unset($productsBeforeImport, $product); - } - - /** - * Test if stock item quantity properly saved after import - * - * @magentoDataFixture Magento/Catalog/_files/multiple_products.php - * @magentoAppIsolation enabled - */ - public function testSaveStockItemQty() - { - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Api\ProductRepositoryInterface::class - ); - $id1 = $productRepository->get('simple1')->getId(); - $id2 = $productRepository->get('simple2')->getId(); - $id3 = $productRepository->get('simple3')->getId(); - $existingProductIds = [$id1, $id2, $id3]; - $stockItems = []; - foreach ($existingProductIds as $productId) { - /** @var $stockRegistry StockRegistry */ - $stockRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - StockRegistry::class - ); - - $stockItem = $stockRegistry->getStockItem($productId, 1); - $stockItems[$productId] = $stockItem; - } - - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - - /** @var $stockItmBeforeImport \Magento\CatalogInventory\Model\Stock\Item */ - foreach ($stockItems as $productId => $stockItmBeforeImport) { - /** @var $stockRegistry StockRegistry */ - $stockRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - StockRegistry::class - ); - - $stockItemAfterImport = $stockRegistry->getStockItem($productId, 1); - - $this->assertEquals($stockItmBeforeImport->getQty(), $stockItemAfterImport->getQty()); - $this->assertEquals(1, $stockItemAfterImport->getIsInStock()); - unset($stockItemAfterImport); - } - - unset($stockItems, $stockItem); - } - - /** - * Test that is_in_stock set to 0 when item quantity is 0 - * - * @magentoDataFixture Magento/Catalog/_files/multiple_products.php - * @magentoAppIsolation enabled - * - * @return void - */ - public function testSaveIsInStockByZeroQty(): void - { - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Api\ProductRepositoryInterface::class - ); - $id1 = $productRepository->get('simple1')->getId(); - $id2 = $productRepository->get('simple2')->getId(); - $id3 = $productRepository->get('simple3')->getId(); - $existingProductIds = [$id1, $id2, $id3]; - - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_zero_qty.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - - /** @var $stockItmBeforeImport \Magento\CatalogInventory\Model\Stock\Item */ - foreach ($existingProductIds as $productId) { - /** @var $stockRegistry StockRegistry */ - $stockRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - StockRegistry::class - ); - - $stockItemAfterImport = $stockRegistry->getStockItem($productId, 1); - - $this->assertEquals(0, $stockItemAfterImport->getIsInStock()); - unset($stockItemAfterImport); - } - } - - /** - * Test if stock state properly changed after import - * - * @magentoDataFixture Magento/Catalog/_files/multiple_products.php - * @magentoAppIsolation enabled - */ - public function testStockState() - { - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_qty.csv', - 'directory' => $directory - ] - ); - - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - } - - /** - * Tests adding of custom options with existing and new product. - * - * @magentoDataFixture Magento/Catalog/_files/product_simple.php - * @dataProvider getBehaviorDataProvider - * @param string $importFile - * @param string $sku - * @param int $expectedOptionsQty - * @throws \Magento\Framework\Exception\LocalizedException - * @throws \Magento\Framework\Exception\NoSuchEntityException - * @magentoAppIsolation enabled - * - * @return void - */ - public function testSaveCustomOptions(string $importFile, string $sku, int $expectedOptionsQty): void - { - $pathToFile = __DIR__ . '/_files/' . $importFile; - $importModel = $this->createImportModel($pathToFile); - $errors = $importModel->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $importModel->importData(); - - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Api\ProductRepositoryInterface::class - ); - $product = $productRepository->get($sku); - - $this->assertInstanceOf(\Magento\Catalog\Model\Product::class, $product); - $options = $product->getOptionInstance()->getProductOptions($product); - - $expectedData = $this->getExpectedOptionsData($pathToFile); - $expectedData = $this->mergeWithExistingData($expectedData, $options); - $actualData = $this->getActualOptionsData($options); - - // assert of equal type+titles - $expectedOptions = $expectedData['options']; - // we need to save key values - $actualOptions = $actualData['options']; - sort($expectedOptions); - sort($actualOptions); - $this->assertSame($expectedOptions, $actualOptions); - - // assert of options data - $this->assertCount(count($expectedData['data']), $actualData['data']); - $this->assertCount(count($expectedData['values']), $actualData['values']); - $this->assertCount($expectedOptionsQty, $actualData['options']); - foreach ($expectedData['options'] as $expectedId => $expectedOption) { - $elementExist = false; - // find value in actual options and values - foreach ($actualData['options'] as $actualId => $actualOption) { - if ($actualOption == $expectedOption) { - $elementExist = true; - $this->assertEquals($expectedData['data'][$expectedId], $actualData['data'][$actualId]); - if (array_key_exists($expectedId, $expectedData['values'])) { - $this->assertEquals($expectedData['values'][$expectedId], $actualData['values'][$actualId]); - } - unset($actualData['options'][$actualId]); - // remove value in case of duplicating key values - break; - } - } - $this->assertTrue($elementExist, 'Element must exist.'); - } - - // Make sure that after importing existing options again, option IDs and option value IDs are not changed - $customOptionValues = $this->getCustomOptionValues($sku); - $this->createImportModel($pathToFile)->importData(); - $this->assertEquals($customOptionValues, $this->getCustomOptionValues($sku)); - } - - /** - * Tests adding of custom options with multiple store views - * - * @magentoConfigFixture current_store catalog/price/scope 1 - * @magentoDataFixture Magento/Store/_files/core_second_third_fixturestore.php - * @magentoAppIsolation enabled - */ - public function testSaveCustomOptionsWithMultipleStoreViews() - { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var StoreManagerInterface $storeManager */ - $storeManager = $objectManager->get(StoreManagerInterface::class); - $storeCodes = [ - 'admin', - 'default', - 'secondstore', - ]; - /** @var StoreManagerInterface $storeManager */ - $importFile = 'product_with_custom_options_and_multiple_store_views.csv'; - $sku = 'simple'; - $pathToFile = __DIR__ . '/_files/' . $importFile; - $importModel = $this->createImportModel($pathToFile); - $errors = $importModel->validateData(); - $this->assertTrue($errors->getErrorsCount() == 0, 'Import File Validation Failed'); - $importModel->importData(); - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Api\ProductRepositoryInterface::class - ); - foreach ($storeCodes as $storeCode) { - $storeManager->setCurrentStore($storeCode); - $product = $productRepository->get($sku); - $options = $product->getOptionInstance()->getProductOptions($product); - $expectedData = $this->getExpectedOptionsData($pathToFile, $storeCode); - $expectedData = $this->mergeWithExistingData($expectedData, $options); - $actualData = $this->getActualOptionsData($options); - // assert of equal type+titles - $expectedOptions = $expectedData['options']; - // we need to save key values - $actualOptions = $actualData['options']; - sort($expectedOptions); - sort($actualOptions); - $this->assertEquals( - $expectedOptions, - $actualOptions, - 'Expected and actual options arrays does not match' - ); - - // assert of options data - $this->assertCount( - count($expectedData['data']), - $actualData['data'], - 'Expected and actual data count does not match' - ); - $this->assertCount( - count($expectedData['values']), - $actualData['values'], - 'Expected and actual values count does not match' - ); - - foreach ($expectedData['options'] as $expectedId => $expectedOption) { - $elementExist = false; - // find value in actual options and values - foreach ($actualData['options'] as $actualId => $actualOption) { - if ($actualOption == $expectedOption) { - $elementExist = true; - $this->assertEquals( - $expectedData['data'][$expectedId], - $actualData['data'][$actualId], - 'Expected data does not match actual data' - ); - if (array_key_exists($expectedId, $expectedData['values'])) { - $this->assertEquals( - $expectedData['values'][$expectedId], - $actualData['values'][$actualId], - 'Expected values does not match actual data' - ); - } - unset($actualData['options'][$actualId]); - // remove value in case of duplicating key values - break; - } - } - $this->assertTrue($elementExist, 'Element must exist.'); - } - - // Make sure that after importing existing options again, option IDs and option value IDs are not changed - $customOptionValues = $this->getCustomOptionValues($sku); - $this->createImportModel($pathToFile)->importData(); - $this->assertEquals( - $customOptionValues, - $this->getCustomOptionValues($sku), - 'Option IDs changed after second import' - ); - } - } - - /** - * @return array - */ - public function getBehaviorDataProvider(): array - { - return [ - 'Append behavior with existing product' => [ - 'importFile' => 'product_with_custom_options.csv', - 'sku' => 'simple', - 'expectedOptionsQty' => 6, - ], - 'Append behavior with existing product and without options in import file' => [ - 'importFile' => 'product_without_custom_options.csv', - 'sku' => 'simple', - 'expectedOptionsQty' => 0, - ], - 'Append behavior with new product' => [ - 'importFile' => 'product_with_custom_options_new.csv', - 'sku' => 'simple_new', - 'expectedOptionsQty' => 5, - ], - ]; - } - - /** - * @param string $pathToFile - * @param string $behavior - * @return \Magento\CatalogImportExport\Model\Import\Product - */ - private function createImportModel($pathToFile, $behavior = \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND) - { - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - - /** @var \Magento\ImportExport\Model\Import\Source\Csv $source */ - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - - /** @var \Magento\CatalogImportExport\Model\Import\Product $importModel */ - $importModel = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\CatalogImportExport\Model\Import\Product::class - ); - $importModel->setParameters(['behavior' => $behavior, 'entity' => 'catalog_product'])->setSource($source); - - return $importModel; - } - - /** - * @param string $productSku - * @return array ['optionId' => ['optionValueId' => 'optionValueTitle', ...], ...] - */ - private function getCustomOptionValues($productSku) - { - /** @var ProductRepositoryInterface $productRepository */ - $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); - /** @var ProductCustomOptionRepositoryInterface $customOptionRepository */ - $customOptionRepository = $this->objectManager->get(ProductCustomOptionRepositoryInterface::class); - $simpleProduct = $productRepository->get($productSku, false, null, true); - $originalProductOptions = $customOptionRepository->getProductOptions($simpleProduct); - $optionValues = []; - foreach ($originalProductOptions as $productOption) { - foreach ((array)$productOption->getValues() as $optionValue) { - $optionValues[$productOption->getOptionId()][$optionValue->getOptionTypeId()] - = $optionValue->getTitle(); - } - } - return $optionValues; - } - - /** - * Test if datetime properly saved after import - * - * @magentoDataFixture Magento/Catalog/_files/multiple_products.php - * @magentoAppIsolation enabled - */ - public function testSaveDatetimeAttribute() - { - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Api\ProductRepositoryInterface::class - ); - $id1 = $productRepository->get('simple1')->getId(); - $id2 = $productRepository->get('simple2')->getId(); - $id3 = $productRepository->get('simple3')->getId(); - $existingProductIds = [$id1, $id2, $id3]; - $productsBeforeImport = []; - foreach ($existingProductIds as $productId) { - $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Product::class - ); - $product->load($productId); - $productsBeforeImport[$product->getSku()] = $product; - } - - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_datetime.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - - $source->rewind(); - foreach ($source as $row) { - /** @var $productAfterImport \Magento\Catalog\Model\Product */ - $productBeforeImport = $productsBeforeImport[$row['sku']]; - - /** @var $productAfterImport \Magento\Catalog\Model\Product */ - $productAfterImport = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Product::class - ); - $productAfterImport->load($productBeforeImport->getId()); - $this->assertEquals( - @strtotime(date('m/d/Y', @strtotime($row['news_from_date']))), - @strtotime($productAfterImport->getNewsFromDate()) - ); - $this->assertEquals( - @strtotime($row['news_to_date']), - @strtotime($productAfterImport->getNewsToDate()) - ); - unset($productAfterImport); - } - unset($productsBeforeImport, $product); - } - - /** - * Returns expected product data: current id, options, options data and option values - * - * @param string $pathToFile - * @param string $storeCode - * @return array - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function getExpectedOptionsData(string $pathToFile, string $storeCode = ''): array - { - // phpcs:disable Magento2.Functions.DiscouragedFunction - $productData = $this->csvToArray(file_get_contents($pathToFile)); - $expectedOptionId = 0; - $expectedOptions = []; - // array of type and title types, key is element ID - $expectedData = []; - // array of option data - $expectedValues = []; - $storeRowId = null; - foreach ($productData['data'] as $rowId => $rowData) { - $storeCode = ($storeCode == 'admin') ? '' : $storeCode; - if ($rowData['store_view_code'] == $storeCode) { - $storeRowId = $rowId; - break; - } - } - if (!empty($productData['data'][$storeRowId]['custom_options'])) { - foreach (explode('|', $productData['data'][$storeRowId]['custom_options']) as $optionData) { - $option = array_values( - array_map( - function ($input) { - $data = explode('=', $input); - return [$data[0] => $data[1]]; - }, - explode(',', $optionData) - ) - ); - // phpcs:ignore Magento2.Performance.ForeachArrayMerge - $option = array_merge([], ...$option); - - if (!empty($option['type']) && !empty($option['name'])) { - $lastOptionKey = $option['type'] . '|' . $option['name']; - if (!isset($expectedOptions[$expectedOptionId]) - || $expectedOptions[$expectedOptionId] != $lastOptionKey) { - $expectedOptionId++; - $expectedOptions[$expectedOptionId] = $lastOptionKey; - $expectedData[$expectedOptionId] = []; - foreach ($this->_assertOptions as $assertKey => $assertFieldName) { - if (array_key_exists($assertFieldName, $option) - && !(($assertFieldName == 'price' || $assertFieldName == 'sku') - && in_array($option['type'], $this->specificTypes)) - ) { - $expectedData[$expectedOptionId][$assertKey] = $option[$assertFieldName]; - } - } - } - } - $optionValue = []; - if (!empty($option['name']) && !empty($option['option_title'])) { - foreach ($this->_assertOptionValues as $assertKey => $assertFieldName) { - if (isset($option[$assertFieldName])) { - $optionValue[$assertKey] = $option[$assertFieldName]; - } - } - $expectedValues[$expectedOptionId][] = $optionValue; - } - } - } - - return [ - 'id' => $expectedOptionId, - 'options' => $expectedOptions, - 'data' => $expectedData, - 'values' => $expectedValues, - ]; - } - - /** - * Updates expected options data array with existing unique options data - * - * @param array $expected - * @param \Magento\Catalog\Model\ResourceModel\Product\Option\Collection $options - * @return array - */ - protected function mergeWithExistingData( - array $expected, - $options - ) { - $expectedOptionId = $expected['id']; - $expectedOptions = $expected['options']; - $expectedData = $expected['data']; - $expectedValues = $expected['values']; - foreach ($options as $option) { - $optionKey = $option->getType() . '|' . $option->getTitle(); - $optionValues = $this->getOptionValues($option); - if (!in_array($optionKey, $expectedOptions)) { - $expectedOptionId++; - $expectedOptions[$expectedOptionId] = $optionKey; - $expectedData[$expectedOptionId] = $this->getOptionData($option); - if ($optionValues) { - $expectedValues[$expectedOptionId] = $optionValues; - } - } else { - $existingOptionId = array_search($optionKey, $expectedOptions); - // phpcs:ignore Magento2.Performance.ForeachArrayMerge - $expectedData[$existingOptionId] = array_merge( - $this->getOptionData($option), - $expectedData[$existingOptionId] - ); - if ($optionValues) { - foreach ($optionValues as $optionKey => $optionValue) { - // phpcs:ignore Magento2.Performance.ForeachArrayMerge - $expectedValues[$existingOptionId][$optionKey] = array_merge( - $optionValue, - $expectedValues[$existingOptionId][$optionKey] - ); - } - } - } - } - - return [ - 'id' => $expectedOptionId, - 'options' => $expectedOptions, - 'data' => $expectedData, - 'values' => $expectedValues - ]; - } - - /** - * Returns actual product data: current id, options, options data and option values - * - * @param \Magento\Catalog\Model\ResourceModel\Product\Option\Collection $options - * @return array - */ - protected function getActualOptionsData($options) - { - $actualOptionId = 0; - $actualOptions = []; - // array of type and title types, key is element ID - $actualData = []; - // array of option data - $actualValues = []; - // array of option values data - /** @var $option \Magento\Catalog\Model\Product\Option */ - foreach ($options as $option) { - $lastOptionKey = $option->getType() . '|' . $option->getTitle(); - $actualOptionId++; - if (!in_array($lastOptionKey, $actualOptions)) { - $actualOptions[$actualOptionId] = $lastOptionKey; - $actualData[$actualOptionId] = $this->getOptionData($option); - if ($optionValues = $this->getOptionValues($option)) { - $actualValues[$actualOptionId] = $optionValues; - } - } - } - return [ - 'id' => $actualOptionId, - 'options' => $actualOptions, - 'data' => $actualData, - 'values' => $actualValues - ]; - } - - /** - * Retrieve option data - * - * @param \Magento\Catalog\Model\Product\Option $option - * @return array - */ - protected function getOptionData(\Magento\Catalog\Model\Product\Option $option) - { - $result = []; - foreach (array_keys($this->_assertOptions) as $assertKey) { - $result[$assertKey] = $option->getData($assertKey); - } - return $result; - } - - /** - * Retrieve option values or false for options which has no values - * - * @param \Magento\Catalog\Model\Product\Option $option - * @return array|bool - */ - protected function getOptionValues(\Magento\Catalog\Model\Product\Option $option) - { - $values = $option->getValues(); - if (!empty($values)) { - $result = []; - /** @var $value \Magento\Catalog\Model\Product\Option\Value */ - foreach ($values as $value) { - $optionData = []; - foreach (array_keys($this->_assertOptionValues) as $assertKey) { - if ($value->hasData($assertKey)) { - $optionData[$assertKey] = $value->getData($assertKey); - } - } - $result[] = $optionData; - } - return $result; - } - - return false; - } - - /** - * Test that product import with images works properly - * - * @magentoDataFixture mediaImportImageFixture - * @magentoAppIsolation enabled - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function testSaveMediaImage() - { - $this->importDataForMediaTest('import_media.csv'); - - $product = $this->getProductBySku('simple_new'); - - $this->assertEquals('/m/a/magento_image.jpg', $product->getData('image')); - $this->assertEquals('/m/a/magento_small_image.jpg', $product->getData('small_image')); - $this->assertEquals('/m/a/magento_thumbnail.jpg', $product->getData('thumbnail')); - $this->assertEquals('/m/a/magento_image.jpg', $product->getData('swatch_image')); - - $gallery = $product->getMediaGalleryImages(); - $this->assertInstanceOf(\Magento\Framework\Data\Collection::class, $gallery); - - $items = $gallery->getItems(); - $this->assertCount(5, $items); - - $imageItem = array_shift($items); - $this->assertInstanceOf(\Magento\Framework\DataObject::class, $imageItem); - $this->assertEquals('/m/a/magento_image.jpg', $imageItem->getFile()); - $this->assertEquals('Image Label', $imageItem->getLabel()); - - $smallImageItem = array_shift($items); - $this->assertInstanceOf(\Magento\Framework\DataObject::class, $smallImageItem); - $this->assertEquals('/m/a/magento_small_image.jpg', $smallImageItem->getFile()); - $this->assertEquals('Small Image Label', $smallImageItem->getLabel()); - - $thumbnailItem = array_shift($items); - $this->assertInstanceOf(\Magento\Framework\DataObject::class, $thumbnailItem); - $this->assertEquals('/m/a/magento_thumbnail.jpg', $thumbnailItem->getFile()); - $this->assertEquals('Thumbnail Label', $thumbnailItem->getLabel()); - - $additionalImageOneItem = array_shift($items); - $this->assertInstanceOf(\Magento\Framework\DataObject::class, $additionalImageOneItem); - $this->assertEquals('/m/a/magento_additional_image_one.jpg', $additionalImageOneItem->getFile()); - $this->assertEquals('Additional Image Label One', $additionalImageOneItem->getLabel()); - - $additionalImageTwoItem = array_shift($items); - $this->assertInstanceOf(\Magento\Framework\DataObject::class, $additionalImageTwoItem); - $this->assertEquals('/m/a/magento_additional_image_two.jpg', $additionalImageTwoItem->getFile()); - $this->assertEquals('Additional Image Label Two', $additionalImageTwoItem->getLabel()); - } - - /** - * Tests that "hide_from_product_page" attribute is hidden after importing product images. - * - * @magentoDataFixture mediaImportImageFixture - * @magentoAppIsolation enabled - */ - public function testSaveHiddenImages() - { - $this->importDataForMediaTest('import_media_hidden_images.csv'); - $product = $this->getProductBySku('simple_new'); - $images = $product->getMediaGalleryEntries(); - - $hiddenImages = array_filter( - $images, - static function (DataObject $image) { - return (int)$image->getDisabled() === 1; - } - ); - - $this->assertCount(3, $hiddenImages); - - $imageItem = array_shift($hiddenImages); - $this->assertEquals('/m/a/magento_image.jpg', $imageItem->getFile()); - - $imageItem = array_shift($hiddenImages); - $this->assertEquals('/m/a/magento_thumbnail.jpg', $imageItem->getFile()); - - $imageItem = array_shift($hiddenImages); - $this->assertEquals('/m/a/magento_additional_image_two.jpg', $imageItem->getFile()); - } - - /** - * Tests importing product images with "no_selection" attribute. - * - * @magentoDataFixture mediaImportImageFixture - * @magentoAppIsolation enabled - */ - public function testSaveImagesNoSelection() - { - $this->importDataForMediaTest('import_media_with_no_selection.csv'); - $product = $this->getProductBySku('simple_new'); - - $this->assertEquals('/m/a/magento_image.jpg', $product->getData('image')); - $this->assertNull($product->getData('small_image')); - $this->assertNull($product->getData('thumbnail')); - $this->assertNull($product->getData('swatch_image')); - } - - /** - * Test that new images should be added after the existing ones. - * - * @magentoDataFixture mediaImportImageFixture - * @magentoAppIsolation enabled - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function testNewImagesShouldBeAddedAfterExistingOnes() - { - $this->importDataForMediaTest('import_media.csv'); - - $product = $this->getProductBySku('simple_new'); - - $items = array_values($product->getMediaGalleryImages()->getItems()); - - $images = [ - ['file' => '/m/a/magento_image.jpg', 'label' => 'Image Label'], - ['file' => '/m/a/magento_small_image.jpg', 'label' => 'Small Image Label'], - ['file' => '/m/a/magento_thumbnail.jpg', 'label' => 'Thumbnail Label'], - ['file' => '/m/a/magento_additional_image_one.jpg', 'label' => 'Additional Image Label One'], - ['file' => '/m/a/magento_additional_image_two.jpg', 'label' => 'Additional Image Label Two'], - ]; - - $this->assertCount(5, $items); - $this->assertEquals( - $images, - array_map( - function (\Magento\Framework\DataObject $item) { - return $item->toArray(['file', 'label']); - }, - $items - ) - ); - - $this->importDataForMediaTest('import_media_additional_long_name_image.csv'); - $product->cleanModelCache(); - $product = $this->getProductBySku('simple_new'); - $items = array_values($product->getMediaGalleryImages()->getItems()); - $images[] = ['file' => '/m/a/' . self::LONG_FILE_NAME_IMAGE, 'label' => '']; - $this->assertCount(6, $items); - $this->assertEquals( - $images, - array_map( - function (\Magento\Framework\DataObject $item) { - return $item->toArray(['file', 'label']); - }, - $items - ) - ); - } - - /** - * Test import twice and check that image will not be duplicate - * - * @magentoDataFixture mediaImportImageFixture - * @return void - */ - public function testSaveMediaImageDuplicateImages(): void - { - $this->importDataForMediaTest('import_media.csv'); - $imagesCount = count($this->getProductBySku('simple_new')->getMediaGalleryImages()->getItems()); - - // import the same file again - $this->importDataForMediaTest('import_media.csv'); - - $this->assertCount($imagesCount, $this->getProductBySku('simple_new')->getMediaGalleryImages()->getItems()); - } - - /** - * Test that errors occurred during importing images are logged. - * - * @magentoAppIsolation enabled - * @magentoDataFixture mediaImportImageFixture - * @magentoDataFixture mediaImportImageFixtureError - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function testSaveMediaImageError() - { - $this->logger->expects(self::once())->method('critical'); - $this->importDataForMediaTest('import_media.csv', 1); - } - - /** - * Copy fixture images into media import directory - */ - public static function mediaImportImageFixture() - { - /** @var \Magento\Framework\Filesystem\Directory\Write $varDirectory */ - $varDirectory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - \Magento\Framework\Filesystem::class - )->getDirectoryWrite( - DirectoryList::VAR_DIR - ); - - $varDirectory->create('import' . DIRECTORY_SEPARATOR . 'images'); - $dirPath = $varDirectory->getAbsolutePath('import' . DIRECTORY_SEPARATOR . 'images'); - - $items = [ - [ - 'source' => __DIR__ . '/../../../../Magento/Catalog/_files/magento_image.jpg', - 'dest' => $dirPath . '/magento_image.jpg', - ], - [ - 'source' => __DIR__ . '/../../../../Magento/Catalog/_files/magento_small_image.jpg', - 'dest' => $dirPath . '/magento_small_image.jpg', - ], - [ - 'source' => __DIR__ . '/../../../../Magento/Catalog/_files/magento_thumbnail.jpg', - 'dest' => $dirPath . '/magento_thumbnail.jpg', - ], - [ - 'source' => __DIR__ . '/../../../../Magento/Catalog/_files/' . self::LONG_FILE_NAME_IMAGE, - 'dest' => $dirPath . '/' . self::LONG_FILE_NAME_IMAGE, - ], - [ - 'source' => __DIR__ . '/_files/magento_additional_image_one.jpg', - 'dest' => $dirPath . '/magento_additional_image_one.jpg', - ], - [ - 'source' => __DIR__ . '/_files/magento_additional_image_two.jpg', - 'dest' => $dirPath . '/magento_additional_image_two.jpg', - ], - [ - 'source' => __DIR__ . '/_files/magento_additional_image_three.jpg', - 'dest' => $dirPath . '/magento_additional_image_three.jpg', - ], - [ - 'source' => __DIR__ . '/_files/magento_additional_image_four.jpg', - 'dest' => $dirPath . '/magento_additional_image_four.jpg', - ], - ]; - - foreach ($items as $item) { - copy($item['source'], $item['dest']); - } - } - - /** - * Cleanup media import and catalog directories - */ - public static function mediaImportImageFixtureRollback() - { - $fileSystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - \Magento\Framework\Filesystem::class - ); - /** @var \Magento\Framework\Filesystem\Directory\Write $mediaDirectory */ - $mediaDirectory = $fileSystem->getDirectoryWrite(DirectoryList::MEDIA); - - /** @var \Magento\Framework\Filesystem\Directory\Write $varDirectory */ - $varDirectory = $fileSystem->getDirectoryWrite(DirectoryList::VAR_DIR); - $varDirectory->delete('import'); - $mediaDirectory->delete('catalog'); - } - - /** - * Copy incorrect fixture image into media import directory. - */ - public static function mediaImportImageFixtureError() - { - /** @var \Magento\Framework\Filesystem\Directory\Write $varDirectory */ - $varDirectory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - \Magento\Framework\Filesystem::class - )->getDirectoryWrite( - DirectoryList::VAR_DIR - ); - $dirPath = $varDirectory->getAbsolutePath('import' . DIRECTORY_SEPARATOR . 'images'); - $items = [ - [ - 'source' => __DIR__ . '/_files/magento_additional_image_error.jpg', - 'dest' => $dirPath . '/magento_additional_image_two.jpg', - ], - ]; - foreach ($items as $item) { - copy($item['source'], $item['dest']); - } - } - - /** - * Export CSV string to array - * - * @param string $content - * @param mixed $entityId - * @return array - */ - protected function csvToArray($content, $entityId = null) - { - $data = ['header' => [], 'data' => []]; - - $lines = str_getcsv($content, "\n"); - foreach ($lines as $index => $line) { - if ($index == 0) { - $data['header'] = str_getcsv($line); - } else { - $row = array_combine($data['header'], str_getcsv($line)); - if ($entityId !== null && !empty($row[$entityId])) { - $data['data'][$row[$entityId]] = $row; - } else { - $data['data'][] = $row; - } - } - } - return $data; - } - - /** - * Tests that no products imported if source file contains errors - * - * In this case, the second product data has an invalid attribute set. - * - * @magentoDbIsolation enabled - */ - public function testInvalidSkuLink() - { - // import data from CSV file - $pathToFile = __DIR__ . '/_files/products_to_import_invalid_attribute_set.csv'; - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Framework\Filesystem::class - ); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - Import::FIELD_NAME_VALIDATION_STRATEGY => null, - 'entity' => 'catalog_product' - ] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 1); - $this->assertEquals( - 'Invalid value for Attribute Set column (set doesn\'t exist?)', - $errors->getErrorByRowNumber(1)[0]->getErrorMessage() - ); - $this->_model->importData(); - - $productCollection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\ResourceModel\Product\Collection::class - ); - - $products = []; - /** @var $product \Magento\Catalog\Model\Product */ - foreach ($productCollection as $product) { - $products[$product->getSku()] = $product; - } - $this->assertArrayNotHasKey("simple1", $products, "Simple Product should not have been imported"); - $this->assertArrayNotHasKey("simple3", $products, "Simple Product 3 should not have been imported"); - $this->assertArrayNotHasKey("simple2", $products, "Simple Product2 should not have been imported"); - } - - /** - * @magentoDataFixture Magento/Catalog/_files/products_with_multiselect_attribute.php - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - */ - public function testValidateInvalidMultiselectValues() - { - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Framework\Filesystem::class - ); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_with_invalid_multiselect_values.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 1); - $this->assertEquals( - "Value for 'multiselect_attribute' attribute contains incorrect value, " - . "see acceptable values on settings specified for Admin", - $errors->getErrorByRowNumber(1)[0]->getErrorMessage() - ); - } - - /** - * @magentoDataFixture Magento/Catalog/_files/categories.php - * @magentoDataFixture Magento/Store/_files/website.php - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Catalog/Model/Layer/Filter/_files/attribute_with_option.php - * @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_attribute.php - * @magentoDbIsolation disabled - * @magentoAppIsolation enabled - */ - public function testProductsWithMultipleStores() - { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - - $filesystem = $objectManager->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_multiple_stores.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - - /** @var \Magento\Catalog\Model\Product $product */ - $product = $objectManager->create(\Magento\Catalog\Model\Product::class); - $id = $product->getIdBySku('Configurable 03'); - $product->load($id); - $this->assertEquals('1', $product->getHasOptions()); - - $objectManager->get(StoreManagerInterface::class)->setCurrentStore('fixturestore'); - - /** @var \Magento\Catalog\Model\Product $simpleProduct */ - $simpleProduct = $objectManager->create(\Magento\Catalog\Model\Product::class); - $id = $simpleProduct->getIdBySku('Configurable 03-Option 1'); - $simpleProduct->load($id); - $this->assertTrue(count($simpleProduct->getWebsiteIds()) == 2); - $this->assertEquals('Option Label', $simpleProduct->getAttributeText('attribute_with_option')); - } - - /** - * Test url keys properly generated in multistores environment. - * - * @magentoConfigFixture current_store catalog/seo/product_use_categories 1 - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Catalog/_files/category_with_two_stores.php - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - */ - public function testGenerateUrlsWithMultipleStores() - { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - - $filesystem = $objectManager->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_two_stores.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - $this->assertProductRequestPath('default', 'category-defaultstore/product-default.html'); - $this->assertProductRequestPath('fixturestore', 'category-fixturestore/product-fixture.html'); - } - - /** - * Check product request path considering store scope. - * - * @param string $storeCode - * @param string $expected - * @return void - */ - private function assertProductRequestPath($storeCode, $expected) - { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var Store $storeCode */ - $store = $objectManager->get(Store::class); - $storeId = $store->load($storeCode)->getId(); - - /** @var Category $category */ - $category = $objectManager->get(Category::class); - $category->setStoreId($storeId); - $category->load(555); - - /** @var Registry $registry */ - $registry = $objectManager->get(Registry::class); - $registry->register('current_category', $category); - - /** @var \Magento\Catalog\Model\Product $product */ - $product = $objectManager->create(\Magento\Catalog\Model\Product::class); - $id = $product->getIdBySku('product'); - $product->setStoreId($storeId); - $product->load($id); - $product->getProductUrl(); - self::assertEquals($expected, $product->getRequestPath()); - $registry->unregister('current_category'); - } - - /** - * @magentoDbIsolation enabled - */ - public function testProductWithInvalidWeight() - { - // import data from CSV file - $pathToFile = __DIR__ . '/_files/product_to_import_invalid_weight.csv'; - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Framework\Filesystem::class - ); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - $errors = $this->_model->setSource( - $source - )->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND] - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 1); - $this->assertEquals( - "Value for 'weight' attribute contains incorrect value", - $errors->getErrorByRowNumber(1)[0]->getErrorMessage() - ); - } - - /** - * @magentoAppArea adminhtml - * @dataProvider categoryTestDataProvider - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - */ - public function testProductCategories($fixture, $separator) - { - // import data from CSV file - $pathToFile = __DIR__ . '/_files/' . $fixture; - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Framework\Filesystem::class - ); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - $errors = $this->_model->setSource( - $source - )->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product', - Import::FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR => $separator - ] - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $resource = $objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); - $productId = $resource->getIdBySku('simple1'); - $this->assertIsNumeric($productId); - /** @var \Magento\Catalog\Model\Product $product */ - $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Product::class - ); - $product->load($productId); - $this->assertFalse($product->isObjectNew()); - $categories = $product->getCategoryIds(); - $this->assertTrue(count($categories) == 2); - } - - /** - * @magentoAppArea adminhtml - * @magentoDbIsolation disabled - * @magentoAppIsolation enabled - * @magentoDataFixture Magento/Catalog/_files/multiple_products.php - * @magentoDataFixture Magento/Catalog/_files/category.php - */ - public function testProductPositionInCategory() - { - /* @var \Magento\Catalog\Model\ResourceModel\Category\Collection $collection */ - $collection = $this->objectManager->create(\Magento\Catalog\Model\ResourceModel\Category\Collection::class); - $collection->addNameToResult()->load(); - /** @var Category $category */ - $category = $collection->getItemByColumnValue('name', 'Category 1'); - - /** @var ProductRepositoryInterface $productRepository */ - $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); - - $categoryProducts = []; - $i = 51; - foreach (['simple1', 'simple2', 'simple3'] as $sku) { - $categoryProducts[$productRepository->get($sku)->getId()] = $i++; - } - $category->setPostedProducts($categoryProducts); - $category->save(); - - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Framework\Filesystem::class - ); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setSource( - $source - )->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product' - ] - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - - /** @var \Magento\Framework\App\ResourceConnection $resourceConnection */ - $resourceConnection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - \Magento\Framework\App\ResourceConnection::class - ); - $tableName = $resourceConnection->getTableName('catalog_category_product'); - $select = $resourceConnection->getConnection()->select()->from($tableName) - ->where('category_id = ?', $category->getId()); - $items = $resourceConnection->getConnection()->fetchAll($select); - $this->assertCount(3, $items); - foreach ($items as $item) { - $this->assertGreaterThan(50, $item['position']); - } - } - - /** - * @return array - */ - public function categoryTestDataProvider() - { - return [ - ['import_new_categories_default_separator.csv', ','], - ['import_new_categories_custom_separator.csv', '|'] - ]; - } - - /** - * @magentoAppArea adminhtml - * @magentoDbIsolation disabled - * @magentoAppIsolation enabled - * @magentoDataFixture Magento/CatalogImportExport/_files/update_category_duplicates.php - */ - public function testProductDuplicateCategories() - { - $csvFixture = 'products_duplicate_category.csv'; - // import data from CSV file - $pathToFile = __DIR__ . '/_files/' . $csvFixture; - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Framework\Filesystem::class - ); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - $errors = $this->_model->setSource($source)->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product' - ] - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() === 0); - - $this->_model->importData(); - - $errorProcessor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - \Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregator::class - ); - $errorCount = count($errorProcessor->getAllErrors()); - $this->assertTrue($errorCount === 1, 'Error expected'); - - $errorMessage = $errorProcessor->getAllErrors()[0]->getErrorMessage(); - $this->assertStringContainsString('URL key for specified store already exists', $errorMessage); - $this->assertStringContainsString('Default Category/Category 2', $errorMessage); - - $categoryAfter = $this->loadCategoryByName('Category 2'); - $this->assertTrue($categoryAfter === null); - - /** @var \Magento\Catalog\Model\Product $product */ - $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Product::class - ); - $product->load(1); - $categories = $product->getCategoryIds(); - $this->assertTrue(count($categories) == 1); - } - - protected function loadCategoryByName($categoryName) - { - /* @var \Magento\Catalog\Model\ResourceModel\Category\Collection $collection */ - $collection = $this->objectManager->create(\Magento\Catalog\Model\ResourceModel\Category\Collection::class); - $collection->addNameToResult()->load(); - return $collection->getItemByColumnValue('name', $categoryName); - } - - /** - * @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php - * @magentoAppIsolation enabled - * @dataProvider validateUrlKeysDataProvider - * @param $importFile string - * @param $expectedErrors array - * @throws \Magento\Framework\Exception\LocalizedException - */ - public function testValidateUrlKeys($importFile, $expectedErrors) - { - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Framework\Filesystem::class - ); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/' . $importFile, - 'directory' => $directory - ] - ); - /** @var \Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface $errors */ - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - $this->assertEquals( - $expectedErrors[RowValidatorInterface::ERROR_DUPLICATE_URL_KEY], - count($errors->getErrorsByCode([RowValidatorInterface::ERROR_DUPLICATE_URL_KEY])) - ); - } - - /** - * @return array - */ - public function validateUrlKeysDataProvider() - { - return [ - [ - 'products_to_check_valid_url_keys.csv', - [ - RowValidatorInterface::ERROR_DUPLICATE_URL_KEY => 0 - ] - ], - [ - 'products_to_check_valid_url_keys_with_different_language.csv', - [ - RowValidatorInterface::ERROR_DUPLICATE_URL_KEY => 0 - ] - ], - [ - 'products_to_check_duplicated_url_keys.csv', - [ - RowValidatorInterface::ERROR_DUPLICATE_URL_KEY => 2 - ] - ], - [ - 'products_to_check_duplicated_names.csv' , - [ - RowValidatorInterface::ERROR_DUPLICATE_URL_KEY => 1 - ] - ] - ]; - } - - /** - * @magentoDataFixture Magento/Store/_files/website.php - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - */ - public function testValidateUrlKeysMultipleStores() - { - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Framework\Filesystem::class - ); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_check_valid_url_keys_multiple_stores.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - } - - /** - * Test import product with product links and empty value - * - * @param string $pathToFile - * @param bool $expectedResultCrossell - * @param bool $expectedResultUpsell - * - * @magentoDataFixture Magento/CatalogImportExport/_files/product_export_with_product_links_data.php - * @magentoAppArea adminhtml - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - * @dataProvider getEmptyLinkedData - */ - public function testProductLinksWithEmptyValue( - string $pathToFile, - bool $expectedResultCrossell, - bool $expectedResultUpsell - ): void { - $filesystem = BootstrapHelper::getObjectManager()->create(Filesystem::class); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - $errors = $this->_model->setSource( - $source - )->setParameters( - [ - 'behavior' => Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product' - ] - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - - $objectManager = BootstrapHelper::getObjectManager(); - $resource = $objectManager->get(ProductResource::class); - $productId = $resource->getIdBySku('simple'); - /** @var \Magento\Catalog\Model\Product $product */ - $product = BootstrapHelper::getObjectManager()->create(Product::class); - $product->load($productId); - - $this->assertEquals(empty($product->getCrossSellProducts()), $expectedResultCrossell); - $this->assertEquals(empty($product->getUpSellProducts()), $expectedResultUpsell); - } - - /** - * Get data for empty linked product - * - * @return array[] - */ - public function getEmptyLinkedData(): array - { - return [ - [ - __DIR__ . '/_files/products_to_import_with_product_links_with_empty_value.csv', - true, - true, - ], - [ - __DIR__ . '/_files/products_to_import_with_product_links_with_empty_data.csv', - false, - true, - ], - ]; - } - - /** - * @magentoAppArea adminhtml - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - */ - public function testProductWithLinks() - { - $linksData = [ - 'upsell' => [ - 'simple1' => '3', - 'simple3' => '1' - ], - 'crosssell' => [ - 'simple2' => '1', - 'simple3' => '2' - ], - 'related' => [ - 'simple1' => '2', - 'simple2' => '1' - ] - ]; - // import data from CSV file - $pathToFile = __DIR__ . '/_files/products_to_import_with_product_links.csv'; - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Framework\Filesystem::class - ); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - $errors = $this->_model->setSource( - $source - )->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product' - ] - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $resource = $objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); - $productId = $resource->getIdBySku('simple4'); - /** @var \Magento\Catalog\Model\Product $product */ - $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Product::class - ); - $product->load($productId); - $productLinks = [ - 'upsell' => $product->getUpSellProducts(), - 'crosssell' => $product->getCrossSellProducts(), - 'related' => $product->getRelatedProducts() - ]; - $importedProductLinks = []; - foreach ($productLinks as $linkType => $linkedProducts) { - foreach ($linkedProducts as $linkedProductData) { - $importedProductLinks[$linkType][$linkedProductData->getSku()] = $linkedProductData->getPosition(); - } - } - $this->assertEquals($linksData, $importedProductLinks); - } - - /** - * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php - * @magentoDbIsolation disabled - * @magentoAppIsolation enabled - */ - public function testExistingProductWithUrlKeys() - { - $products = [ - 'simple1' => 'url-key1', - 'simple2' => 'url-key2', - 'simple3' => 'url-key3' - ]; - // added by _files/products_to_import_with_valid_url_keys.csv - $this->importedProducts[] = 'simple3'; - - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_valid_url_keys.csv', - 'directory' => $directory - ] - ); - - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Api\ProductRepositoryInterface::class - ); - foreach ($products as $productSku => $productUrlKey) { - $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); - } - } - - /** - * @magentoDataFixture Magento/Catalog/_files/product_simple_with_wrong_url_key.php - * @magentoDbIsolation disabled - * @magentoAppIsolation enabled - */ - public function testAddUpdateProductWithInvalidUrlKeys() : void - { - $products = [ - 'simple1' => 'cuvée merlot-cabernet igp pays d\'oc frankrijk', - 'simple2' => 'normal-url', - 'simple3' => 'some!wrong\'url' - ]; - // added by _files/products_to_import_with_invalid_url_keys.csv - $this->importedProducts[] = 'simple3'; - - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_invalid_url_keys.csv', - 'directory' => $directory - ] - ); - - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Api\ProductRepositoryInterface::class - ); - foreach ($products as $productSku => $productUrlKey) { - $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); - } - } - - /** - * Make sure the non existing image in the csv file won't erase the qty key of the existing products. - * - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - */ - public function testImportWithNonExistingImage() - { - $products = [ - 'simple_new' => 100, - ]; - - $this->importFile('products_to_import_with_non_existing_image.csv'); - - $productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); - foreach ($products as $productSku => $productQty) { - $product = $productRepository->get($productSku); - $stockItem = $product->getExtensionAttributes()->getStockItem(); - $this->assertEquals($productQty, $stockItem->getQty()); - } - } - - /** - * @magentoDataFixture Magento/Catalog/_files/product_without_options.php - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - */ - public function testUpdateUrlRewritesOnImport() - { - $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_category.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => \Magento\Catalog\Model\Product::ENTITY - ] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - - /** @var \Magento\Catalog\Model\Product $product */ - $product = $this->objectManager->create(\Magento\Catalog\Model\ProductRepository::class)->get('simple'); - $listOfProductUrlKeys = [ - sprintf('%s.html', $product->getUrlKey()), - sprintf('men/tops/%s.html', $product->getUrlKey()), - sprintf('men/%s.html', $product->getUrlKey()) - ]; - $repUrlRewriteCol = $this->objectManager->create( - UrlRewriteCollection::class - ); - - /** @var UrlRewriteCollection $collUrlRewrite */ - $collUrlRewrite = $repUrlRewriteCol->addFieldToSelect(['request_path']) - ->addFieldToFilter('entity_id', ['eq'=> $product->getEntityId()]) - ->addFieldToFilter('entity_type', ['eq'=> 'product']) - ->load(); - $listOfUrlRewriteIds = $collUrlRewrite->getAllIds(); - $this->assertCount(3, $collUrlRewrite); - - foreach ($listOfUrlRewriteIds as $key => $id) { - $this->assertEquals( - $listOfProductUrlKeys[$key], - $collUrlRewrite->getItemById($id)->getRequestPath() - ); - } - } - - /** - * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - */ - public function testImportWithoutChangingUrlKeys() - { - $filesystem = $this->objectManager->create(Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_without_url_key_column.csv', - 'directory' => $directory - ] - ); - - $errors = $this->_model->setParameters( - ['behavior' => Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - ) - ->setSource($source) - ->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); - $this->assertEquals('url-key', $productRepository->get('simple1')->getUrlKey()); - } - - /** - * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php - * @magentoDbIsolation disabled - * @magentoAppIsolation enabled - */ - public function testImportWithoutUrlKeys() - { - $products = [ - 'simple1' => 'simple-1', - 'simple2' => 'simple-2', - 'simple3' => 'simple-3' - ]; - // added by _files/products_to_import_without_url_keys.csv - $this->importedProducts[] = 'simple3'; - - $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_without_url_keys.csv', - 'directory' => $directory - ] - ); - - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - ) - ->setSource($source) - ->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - - $productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); - foreach ($products as $productSku => $productUrlKey) { - $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); - } - } - - /** - * @magentoDataFixture Magento/Catalog/_files/product_simple_with_non_latin_url_key.php - * @magentoDbIsolation disabled - * @magentoAppIsolation enabled - * @return void - * @throws \Magento\Framework\Exception\LocalizedException - */ - public function testImportWithNonLatinUrlKeys() - { - $productsCreatedByFixture = [ - 'ukrainian-with-url-key' => 'nove-im-ja-pislja-importu-scho-stane-url-key', - 'ukrainian-without-url-key' => 'новий url key після імпорту', - ]; - $productsImportedByCsv = [ - 'imported-ukrainian-with-url-key' => 'імпортований продукт', - 'imported-ukrainian-without-url-key' => 'importovanij-produkt-bez-url-key', - ]; - $productSkuMap = array_merge($productsCreatedByFixture, $productsImportedByCsv); - $this->importedProducts = array_keys($productsImportedByCsv); - - $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_non_latin_url_keys.csv', - 'directory' => $directory, - ] - ); - - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, 'entity' => 'catalog_product'] - ) - ->setSource($source) - ->validateData(); - - $this->assertEquals($errors->getErrorsCount(), 0); - $this->_model->importData(); - - /** @var ProductRepositoryInterface $productRepository */ - $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); - foreach ($productSkuMap as $productSku => $productUrlKey) { - $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); - } - } - - /** - * Make sure the absence of a url_key column in the csv file won't erase the url key of the existing products. - * To reach the goal we need to not send the name column, as the url key is generated from it. - * - * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php - * @magentoDbIsolation disabled - * @magentoAppIsolation enabled - */ - public function testImportWithoutUrlKeysAndName() - { - $products = [ - 'simple1' => 'url-key', - 'simple2' => 'url-key2', - ]; - $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_without_url_keys_and_name.csv', - 'directory' => $directory - ] - ); - - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - ) - ->setSource($source) - ->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - - $productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); - foreach ($products as $productSku => $productUrlKey) { - $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); - } - } - - /** - * @magentoAppIsolation enabled - */ - public function testProductWithUseConfigSettings() - { - $products = [ - 'simple1' => true, - 'simple2' => true, - 'simple3' => false - ]; - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_use_config_settings.csv', - 'directory' => $directory - ] - ); - - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - - foreach ($products as $sku => $manageStockUseConfig) { - /** @var StockRegistry $stockRegistry */ - $stockRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - StockRegistry::class - ); - $stockItem = $stockRegistry->getStockItemBySku($sku); - $this->assertEquals($manageStockUseConfig, $stockItem->getUseConfigManageStock()); - } - } - - /** - * @magentoDataFixture Magento/Store/_files/website.php - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDbIsolation disabled - * @magentoAppIsolation enabled - */ - public function testProductWithMultipleStoresInDifferentBunches() - { - $products = [ - 'simple1', - 'simple2', - 'simple3' - ]; - - $importExportData = $this->getMockBuilder(\Magento\ImportExport\Helper\Data::class) - ->disableOriginalConstructor() - ->getMock(); - $importExportData->expects($this->atLeastOnce()) - ->method('getBunchSize') - ->willReturn(1); - $this->_model = $this->objectManager->create( - \Magento\CatalogImportExport\Model\Import\Product::class, - ['importExportData' => $importExportData] - ); - - $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_multiple_store.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - $productCollection = $this->objectManager - ->create(\Magento\Catalog\Model\ResourceModel\Product\Collection::class); - $this->assertCount(3, $productCollection->getItems()); - $actualProductSkus = array_map( - function (ProductInterface $item) { - return $item->getSku(); - }, - $productCollection->getItems() - ); - sort($products); - $result = array_values($actualProductSkus); - sort($result); - $this->assertEquals( - $products, - $result - ); - - /** @var \Magento\Framework\Registry $registry */ - $registry = $this->objectManager->get(\Magento\Framework\Registry::class); - - $registry->unregister('isSecureArea'); - $registry->register('isSecureArea', true); - - $productSkuList = ['simple1', 'simple2', 'simple3']; - $categoryIds = []; - foreach ($productSkuList as $sku) { - try { - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); - /** @var \Magento\Catalog\Model\Product $product */ - $product = $productRepository->get($sku, true); - $categoryIds[] = $product->getCategoryIds(); - if ($product->getId()) { - $productRepository->delete($product); - } - // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock - } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { - //Product already removed - } - } - - /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */ - $collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Catalog\Model\ResourceModel\Category\Collection::class); - $collection - ->addAttributeToFilter('entity_id', ['in' => \array_unique(\array_merge([], ...$categoryIds))]) - ->load() - ->delete(); - - $registry->unregister('isSecureArea'); - $registry->register('isSecureArea', false); - } - - /** - * @magentoDataFixture Magento/Catalog/_files/multiselect_attribute_with_incorrect_values.php - * @magentoDataFixture Magento/Catalog/_files/product_text_attribute.php - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - */ - public function testProductWithWrappedAdditionalAttributes() - { - $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_additional_attributes.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product', - \Magento\ImportExport\Model\Import::FIELDS_ENCLOSURE => 1 - ] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Api\ProductRepositoryInterface::class - ); - - /** @var \Magento\Eav\Api\AttributeOptionManagementInterface $multiselectOptions */ - $multiselectOptions = $this->objectManager->get(\Magento\Eav\Api\AttributeOptionManagementInterface::class) - ->getItems(\Magento\Catalog\Model\Product::ENTITY, 'multiselect_attribute'); - - $product1 = $productRepository->get('simple1'); - $this->assertEquals('\'", =|', $product1->getData('text_attribute')); - $this->assertEquals( - implode(',', [$multiselectOptions[3]->getValue(), $multiselectOptions[2]->getValue()]), - $product1->getData('multiselect_attribute') - ); - - $product2 = $productRepository->get('simple2'); - $this->assertEquals('', $product2->getData('text_attribute')); - $this->assertEquals( - implode(',', [$multiselectOptions[1]->getValue(), $multiselectOptions[2]->getValue()]), - $product2->getData('multiselect_attribute') - ); - } - - /** - * @magentoDataFixture Magento/Catalog/_files/product_text_attribute.php - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - * @dataProvider importWithJsonAndMarkupTextAttributeDataProvider - * @param string $productSku - * @param string $expectedResult - * @return void - */ - public function testImportWithJsonAndMarkupTextAttribute(string $productSku, string $expectedResult): void - { - // added by _files/product_import_with_json_and_markup_attributes.csv - $this->importedProducts = [ - 'SkuProductWithJson', - 'SkuProductWithMarkup', - ]; - - $importParameters =[ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product', - \Magento\ImportExport\Model\Import::FIELDS_ENCLOSURE => 0 - ]; - $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_json_and_markup_attributes.csv', - 'directory' => $directory - ] - ); - $this->_model->setParameters($importParameters); - $this->_model->setSource($source); - $errors = $this->_model->validateData(); - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Api\ProductRepositoryInterface::class - ); - $product = $productRepository->get($productSku); - $this->assertEquals($expectedResult, $product->getData('text_attribute')); - } - - /** - * @return array - */ - public function importWithJsonAndMarkupTextAttributeDataProvider(): array - { - return [ - 'import of attribute with json' => [ - 'SkuProductWithJson', - '{"type": "basic", "unit": "inch", "sign": "(\")", "size": "1.5\""}' - ], - 'import of attribute with markup' => [ - 'SkuProductWithMarkup', - '<div data-content>Element type is basic, measured in inches ' . - '(marked with sign (\")) with size 1.5\", mid-price range</div>' - ], - ]; - } - - /** - * Import and check data from file. - * - * @param string $fileName - * @param int $expectedErrors - * @return void - */ - private function importDataForMediaTest(string $fileName, int $expectedErrors = 0) - { - $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/' . $fileName, - 'directory' => $directory - ] - ); - $this->_model->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product', - 'import_images_file_dir' => 'pub/media/import' - ] - ); - $appParams = \Magento\TestFramework\Helper\Bootstrap::getInstance() - ->getBootstrap() - ->getApplication() - ->getInitParams()[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS]; - $uploader = $this->_model->getUploader(); - - $mediaPath = $appParams[DirectoryList::MEDIA][DirectoryList::PATH]; - $varPath = $appParams[DirectoryList::VAR_DIR][DirectoryList::PATH]; - $destDir = $directory->getRelativePath( - $mediaPath . DIRECTORY_SEPARATOR . 'catalog' . DIRECTORY_SEPARATOR . 'product' - ); - $tmpDir = $directory->getRelativePath( - $varPath . DIRECTORY_SEPARATOR . 'import' . DIRECTORY_SEPARATOR . 'images' - ); - - $directory->create($destDir); - $this->assertTrue($uploader->setDestDir($destDir)); - $this->assertTrue($uploader->setTmpDir($tmpDir)); - $errors = $this->_model->setSource( - $source - )->validateData(); - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - $this->assertEquals( - $expectedErrors, - $this->_model->getErrorAggregator()->getErrorsCount(), - array_reduce( - $this->_model->getErrorAggregator()->getAllErrors(), - function ($output, $error) { - return "$output\n{$error->getErrorMessage()}"; - }, - '' - ) - ); - } - - /** - * Load product by given product sku - * - * @param string $sku - * @param mixed $store - * @return \Magento\Catalog\Model\Product - */ - private function getProductBySku($sku, $store = null) - { - $resource = $this->objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); - $productId = $resource->getIdBySku($sku); - $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class); - if ($store) { - /** @var StoreManagerInterface $storeManager */ - $storeManager = $this->objectManager->get(StoreManagerInterface::class); - $store = $storeManager->getStore($store); - $product->setStoreId($store->getId()); - } - $product->load($productId); - - return $product; - } - - /** - * @param array $row - * @param string|null $behavior - * @param bool $expectedResult - * @magentoAppArea adminhtml - * @magentoAppIsolation enabled - * @magentoDbIsolation enabled - * @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php - * @dataProvider validateRowDataProvider - */ - public function testValidateRow(array $row, $behavior, $expectedResult) - { - $this->_model->setParameters(['behavior' => $behavior, 'entity' => 'catalog_product']); - $this->assertSame($expectedResult, $this->_model->validateRow($row, 1)); - } - - /** - * @return array - */ - public function validateRowDataProvider() - { - return [ - [ - 'row' => ['sku' => 'simple products'], - 'behavior' => null, - 'expectedResult' => true, - ], - [ - 'row' => ['sku' => 'simple products absent'], - 'behavior' => null, - 'expectedResult' => false, - ], - [ - 'row' => [ - 'sku' => 'simple products absent', - 'name' => 'Test', - 'product_type' => 'simple', - '_attribute_set' => 'Default', - 'price' => 10.20, - ], - 'behavior' => null, - 'expectedResult' => true, - ], - [ - 'row' => ['sku' => 'simple products'], - 'behavior' => Import::BEHAVIOR_ADD_UPDATE, - 'expectedResult' => true, - ], - [ - 'row' => ['sku' => 'simple products absent'], - 'behavior' => Import::BEHAVIOR_ADD_UPDATE, - 'expectedResult' => false, - ], - [ - 'row' => [ - 'sku' => 'simple products absent', - 'name' => 'Test', - 'product_type' => 'simple', - '_attribute_set' => 'Default', - 'price' => 10.20, - ], - 'behavior' => Import::BEHAVIOR_ADD_UPDATE, - 'expectedResult' => true, - ], - [ - 'row' => ['sku' => 'simple products'], - 'behavior' => Import::BEHAVIOR_DELETE, - 'expectedResult' => true, - ], - [ - 'row' => ['sku' => 'simple products absent'], - 'behavior' => Import::BEHAVIOR_DELETE, - 'expectedResult' => false, - ], - [ - 'row' => ['sku' => 'simple products'], - 'behavior' => Import::BEHAVIOR_REPLACE, - 'expectedResult' => false, - ], - [ - 'row' => ['sku' => 'simple products absent'], - 'behavior' => Import::BEHAVIOR_REPLACE, - 'expectedResult' => false, - ], - [ - 'row' => [ - 'sku' => 'simple products absent', - 'name' => 'Test', - 'product_type' => 'simple', - '_attribute_set' => 'Default', - 'price' => 10.20, - ], - 'behavior' => Import::BEHAVIOR_REPLACE, - 'expectedResult' => false, - ], - [ - 'row' => [ - 'sku' => 'simple products', - 'name' => 'Test', - 'product_type' => 'simple', - '_attribute_set' => 'Default', - 'price' => 10.20, - ], - 'behavior' => Import::BEHAVIOR_REPLACE, - 'expectedResult' => true, - ], - [ - 'row' => ['sku' => 'sku with whitespace ', - 'name' => 'Test', - 'product_type' => 'simple', - '_attribute_set' => 'Default', - 'price' => 10.20, - ], - 'behavior' => Import::BEHAVIOR_ADD_UPDATE, - 'expectedResult' => false, - ], - ]; - } - - /** - * @covers \Magento\ImportExport\Model\Import\Entity\AbstractEntity::_saveValidatedBunches - */ - public function testValidateData() - { - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import.csv', - 'directory' => $directory - ] - ); - - $errors = $this->_model->setParameters( - ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] - )->setSource($source)->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - } - - /** - * Tests situation when images for importing products are already present in filesystem. - * - * @magentoDataFixture Magento/CatalogImportExport/Model/Import/_files/import_with_filesystem_images.php - * @magentoAppIsolation enabled - */ - public function testImportWithFilesystemImages() - { - /** @var Filesystem $filesystem */ - $filesystem = ObjectManager::getInstance()->get(Filesystem::class); - /** @var \Magento\Framework\Filesystem\Directory\WriteInterface $writeAdapter */ - $writeAdapter = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); - - if (!$writeAdapter->isWritable()) { - $this->markTestSkipped('Due to unwritable media directory'); - } - - $this->importDataForMediaTest('import_media_existing_images.csv'); - } - - /** - * Test if we can change attribute set for product via import. - * - * @magentoDataFixture Magento/Catalog/_files/attribute_set_with_renamed_group.php - * @magentoDataFixture Magento/Catalog/_files/product_without_options.php - * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php - * @magentoDbIsolation enabled - */ - public function testImportDataChangeAttributeSet() - { - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_new_attribute_set.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => \Magento\Catalog\Model\Product::ENTITY - ] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - - /** @var \Magento\Catalog\Model\Product[] $products */ - $products[] = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Catalog\Model\ProductRepository::class)->get('simple'); - $products[] = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Catalog\Model\ProductRepository::class)->get('simple2'); - - /** @var \Magento\Catalog\Model\Config $catalogConfig */ - $catalogConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Catalog\Model\Config::class); - - /** @var \Magento\Eav\Model\Config $eavConfig */ - $eavConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Eav\Model\Config::class); - - $entityTypeId = (int)$eavConfig->getEntityType(\Magento\Catalog\Model\Product::ENTITY) - ->getId(); - - foreach ($products as $product) { - $attributeSetName = $catalogConfig->getAttributeSetName($entityTypeId, $product->getAttributeSetId()); - $this->assertEquals('attribute_set_test', $attributeSetName); - } - } - - /** - * Test importing products with changed SKU letter case. - */ - public function testImportWithDifferentSkuCase() - { - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ - $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Api\ProductRepositoryInterface::class - ); - /** @var \Magento\Framework\Api\SearchCriteria $searchCriteria */ - $searchCriteria = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Api\SearchCriteria::class); - - $importedPrices = [ - 'simple1' => 25, - 'simple2' => 34, - 'simple3' => 58, - ]; - $updatedPrices = [ - 'simple1' => 111, - 'simple2' => 222, - 'simple3' => 333, - ]; - - $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Framework\Filesystem::class); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, - 'entity' => \Magento\Catalog\Model\Product::ENTITY - ] - )->setSource($source)->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - - $this->assertCount( - 3, - $productRepository->getList($searchCriteria)->getItems() - ); - foreach ($importedPrices as $sku => $expectedPrice) { - $this->assertEquals($expectedPrice, $productRepository->get($sku)->getPrice()); - } - - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/products_to_import_with_changed_sku_case.csv', - 'directory' => $directory - ] - ); - $errors = $this->_model->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, - 'entity' => \Magento\Catalog\Model\Product::ENTITY - ] - )->setSource($source)->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - - $this->_model->importData(); - - $this->assertCount( - 3, - $productRepository->getList($searchCriteria)->getItems(), - 'Ensures that new products were not created' - ); - foreach ($updatedPrices as $sku => $expectedPrice) { - $this->assertEquals( - $expectedPrice, - $productRepository->get($sku, false, null, true)->getPrice(), - 'Check that all products were updated' - ); - } - } - - /** - * Test that product import with images for non-default store works properly. - * - * @magentoDataFixture mediaImportImageFixture - * @magentoAppIsolation enabled - */ - public function testImportImageForNonDefaultStore() - { - $this->importDataForMediaTest('import_media_two_stores.csv'); - $product = $this->getProductBySku('simple_with_images'); - $mediaGallery = $product->getData('media_gallery'); - foreach ($mediaGallery['images'] as $image) { - $image['file'] === '/m/a/magento_image.jpg' - ? self::assertSame('1', $image['disabled']) - : self::assertSame('0', $image['disabled']); - } - } - - /** - * Test import product into multistore system when media is disabled. - * - * @magentoDataFixture Magento/CatalogImportExport/Model/Import/_files/custom_category_store_media_disabled.php - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - * @return void - */ - public function testProductsWithMultipleStoresWhenMediaIsDisabled(): void - { - $this->loginAdminUserWithUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); - - $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/_files/product_with_custom_store_media_disabled.csv', - 'directory' => $directory, - ] - ); - $errors = $this->_model->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product', - ] - )->setSource( - $source - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() === 0); - $this->assertTrue($this->_model->importData()); - } - - /** - * Test that imported product stock status with backorders functionality enabled can be set to 'out of stock'. - * - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - * - * @return void - */ - public function testImportWithBackordersEnabled(): void - { - $this->importFile('products_to_import_with_backorders_enabled_and_0_qty.csv'); - $product = $this->getProductBySku('simple_new'); - $this->assertFalse($product->getDataByKey('quantity_and_stock_status')['is_in_stock']); - } - - /** - * Test that imported product stock status with stock quantity > 0 and backorders functionality disabled - * can be set to 'out of stock'. - * - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - */ - public function testImportWithBackordersDisabled(): void - { - $this->importFile('products_to_import_with_backorders_disabled_and_not_0_qty.csv'); - $product = $this->getProductBySku('simple_new'); - $this->assertFalse($product->getDataByKey('quantity_and_stock_status')['is_in_stock']); - } - - /** - * Import file by providing import filename and bunch size. - * - * @param string $fileName - * @param int $bunchSize - * @return bool - */ - private function importFile(string $fileName, int $bunchSize = 100): bool - { - $importExportData = $this->getMockBuilder(Data::class) - ->disableOriginalConstructor() - ->getMock(); - $importExportData->expects($this->atLeastOnce()) - ->method('getBunchSize') - ->willReturn($bunchSize); - $this->_model = $this->objectManager->create( - ImportProduct::class, - ['importExportData' => $importExportData] - ); - $filesystem = $this->objectManager->create(Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - Csv::class, - [ - 'file' => __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . $fileName, - 'directory' => $directory, - ] - ); - $errors = $this->_model->setParameters( - [ - 'behavior' => Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product', - Import::FIELDS_ENCLOSURE => 1, - ] - ) - ->setSource($source) - ->validateData(); - - $this->assertTrue($errors->getErrorsCount() === 0); - - return $this->_model->importData(); - } - - /** - * Hide product images via hide_from_product_page attribute during import CSV. - * - * @magentoDataFixture mediaImportImageFixture - * @magentoDataFixture Magento/Catalog/_files/product_with_image.php - * - * @return void - */ - public function testImagesAreHiddenAfterImport(): void - { - $expectedActiveImages = [ - [ - 'file' => '/m/a/magento_additional_image_one.jpg', - 'label' => 'Additional Image Label One', - 'disabled' => '0', - ], - [ - 'file' => '/m/a/magento_additional_image_two.jpg', - 'label' => 'Additional Image Label Two', - 'disabled' => '0', - ], - ]; - - $expectedHiddenImage = [ - 'file' => '/m/a/magento_image.jpg', - 'label' => 'Image Alt Text', - 'disabled' => '1', - ]; - $expectedAllProductImages = array_merge( - [$expectedHiddenImage], - $expectedActiveImages - ); - - $this->importDataForMediaTest('hide_from_product_page_images.csv'); - $actualAllProductImages = []; - $product = $this->getProductBySku('simple'); - - // Check that new images were imported and existing image is disabled after import - $productMediaData = $product->getData('media_gallery'); - - $this->assertNotEmpty($productMediaData['images']); - $allProductImages = $productMediaData['images']; - $this->assertCount(3, $allProductImages, 'Images were imported incorrectly'); - - foreach ($allProductImages as $image) { - $actualAllProductImages[] = [ - 'file' => $image['file'], - 'label' => $image['label'], - 'disabled' => $image['disabled'], - ]; - } - - $this->assertEquals( - $expectedAllProductImages, - $actualAllProductImages, - 'Images are incorrect after import' - ); - - // Check that on storefront only enabled images are shown - $actualActiveImages = $product->getMediaGalleryImages(); - $this->assertSame( - $expectedActiveImages, - $actualActiveImages->toArray(['file', 'label', 'disabled'])['items'], - 'Hidden image is present on frontend after import' - ); - } - - /** - * Set the current admin session user based on a username - * - * @param string $username - */ - private function loginAdminUserWithUsername(string $username) - { - $user = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\User\Model\User::class - )->loadByUsername($username); - - /** @var $session \Magento\Backend\Model\Auth\Session */ - $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - \Magento\Backend\Model\Auth\Session::class - ); - $session->setUser($user); - } - - /** - * Checking product images after Add/Update import failure - * - * @magentoDataFixture mediaImportImageFixture - * @magentoDataFixture Magento/CatalogImportExport/Model/Import/_files/import_with_filesystem_images.php - * @magentoDbIsolation enabled - * @magentoAppIsolation enabled - * - * @return void - */ - public function testProductBaseImageAfterImport() - { - $this->importDataForMediaTest('import_media.csv'); - - $this->testImportWithNonExistingImage(); - - /** @var $productAfterImport \Magento\Catalog\Model\Product */ - $productAfterImport = $this->getProductBySku('simple_new'); - $this->assertNotEquals('/no/exists/image/magento_image.jpg', $productAfterImport->getData('image')); - } - - /** - * Tests that images are hidden only for a store view in "store_view_code". - * - * @magentoDataFixture mediaImportImageFixture - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Catalog/_files/product_with_image.php - */ - public function testHideImageForStoreView() - { - $expectedImageFile = '/m/a/magento_image.jpg'; - $secondStoreCode = 'fixturestore'; - $productSku = 'simple'; - $this->importDataForMediaTest('import_hide_image_for_storeview.csv'); - $product = $this->getProductBySku($productSku); - $imageItems = $product->getMediaGalleryImages()->getItems(); - $this->assertCount(1, $imageItems); - $imageItem = array_shift($imageItems); - $this->assertEquals($expectedImageFile, $imageItem->getFile()); - $product = $this->getProductBySku($productSku, $secondStoreCode); - $imageItems = $product->getMediaGalleryImages()->getItems(); - $this->assertCount(0, $imageItems); - } - - /** - * Test that images labels are updated only for a store view in "store_view_code". - * - * @magentoDataFixture mediaImportImageFixture - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Catalog/_files/product_with_image.php - */ - public function testChangeImageLabelForStoreView() - { - $expectedImageFile = '/m/a/magento_image.jpg'; - $expectedLabelForDefaultStoreView = 'Image Alt Text'; - $expectedLabelForSecondStoreView = 'Magento Logo'; - $secondStoreCode = 'fixturestore'; - $productSku = 'simple'; - $this->importDataForMediaTest('import_change_image_label_for_storeview.csv'); - $product = $this->getProductBySku($productSku); - $imageItems = $product->getMediaGalleryImages()->getItems(); - $this->assertCount(1, $imageItems); - $imageItem = array_shift($imageItems); - $this->assertEquals($expectedImageFile, $imageItem->getFile()); - $this->assertEquals($expectedLabelForDefaultStoreView, $imageItem->getLabel()); - $product = $this->getProductBySku($productSku, $secondStoreCode); - $imageItems = $product->getMediaGalleryImages()->getItems(); - $this->assertCount(1, $imageItems); - $imageItem = array_shift($imageItems); - $this->assertEquals($expectedImageFile, $imageItem->getFile()); - $this->assertEquals($expectedLabelForSecondStoreView, $imageItem->getLabel()); - } - - /** - * Test that configurable product images are imported correctly. - * - * @magentoDataFixture mediaImportImageFixture - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_attribute.php - */ - public function testImportConfigurableProductImages() - { - $this->importDataForMediaTest('import_configurable_product_multistore.csv'); - $expected = [ - 'import-configurable-option-1' => [ - [ - 'file' => '/m/a/magento_image.jpg', - 'label' => 'Base Image Label - Option 1', - ], - [ - 'file' => '/m/a/magento_small_image.jpg', - 'label' => 'Small Image Label - Option 1', - ], - [ - 'file' => '/m/a/magento_thumbnail.jpg', - 'label' => 'Thumbnail Image Label - Option 1', - ], - [ - 'file' => '/m/a/magento_additional_image_one.jpg', - 'label' => '', - ], - ], - 'import-configurable-option-2' => [ - [ - 'file' => '/m/a/magento_image.jpg', - 'label' => 'Base Image Label - Option 2', - ], - [ - 'file' => '/m/a/magento_small_image.jpg', - 'label' => 'Small Image Label - Option 2', - ], - [ - 'file' => '/m/a/magento_thumbnail.jpg', - 'label' => 'Thumbnail Image Label - Option 2', - ], - [ - 'file' => '/m/a/magento_additional_image_two.jpg', - 'label' => '', - ], - ], - 'import-configurable' => [ - [ - 'file' => '/m/a/magento_image.jpg', - 'label' => 'Base Image Label - Configurable', - ], - [ - 'file' => '/m/a/magento_small_image.jpg', - 'label' => 'Small Image Label - Configurable', - ], - [ - 'file' => '/m/a/magento_thumbnail.jpg', - 'label' => 'Thumbnail Image Label - Configurable', - ], - [ - 'file' => '/m/a/magento_additional_image_three.jpg', - 'label' => '', - ], - ] - ]; - $actual = []; - $products = ['import-configurable-option-1', 'import-configurable-option-2', 'import-configurable']; - foreach ($products as $sku) { - $product = $this->getProductBySku($sku); - $gallery = $product->getMediaGalleryImages(); - foreach ($gallery->getItems() as $item) { - $actual[$sku][] = $item->toArray(['file', 'label']); - } - } - $this->assertEquals($expected, $actual); - - $expected['import-configurable'] = [ - [ - 'file' => '/m/a/magento_image.jpg', - 'label' => 'Base Image Label - Configurable (fixturestore)', - ], - [ - 'file' => '/m/a/magento_small_image.jpg', - 'label' => 'Small Image Label - Configurable (fixturestore)', - ], - [ - 'file' => '/m/a/magento_thumbnail.jpg', - 'label' => 'Thumbnail Image Label - Configurable (fixturestore)', - ], - [ - 'file' => '/m/a/magento_additional_image_three.jpg', - 'label' => '', - ], - ]; - - $actual = []; - foreach ($products as $sku) { - $product = $this->getProductBySku($sku, 'fixturestore'); - $gallery = $product->getMediaGalleryImages(); - foreach ($gallery->getItems() as $item) { - $actual[$sku][] = $item->toArray(['file', 'label']); - } - } - $this->assertEquals($expected, $actual); - } - - /** - * Test that product stock status is updated after import - * - * @magentoDataFixture mediaImportImageFixture - * @magentoDataFixture Magento/Catalog/_files/product_simple.php - */ - public function testProductStockStatusShouldBeUpdated() - { - /** @var $stockRegistry StockRegistry */ - $stockRegistry = $this->objectManager->create(StockRegistry::class); - /** @var StockRegistryStorage $stockRegistryStorage */ - $stockRegistryStorage = $this->objectManager->get(StockRegistryStorage::class); - $status = $stockRegistry->getStockStatusBySku('simple'); - $this->assertEquals(Stock::STOCK_IN_STOCK, $status->getStockStatus()); - $this->importDataForMediaTest('disable_product.csv'); - $stockRegistryStorage->clean(); - $status = $stockRegistry->getStockStatusBySku('simple'); - $this->assertEquals(Stock::STOCK_OUT_OF_STOCK, $status->getStockStatus()); - $this->importDataForMediaTest('enable_product.csv'); - $stockRegistryStorage->clean(); - $status = $stockRegistry->getStockStatusBySku('simple'); - $this->assertEquals(Stock::STOCK_IN_STOCK, $status->getStockStatus()); - } - - /** - * Test that product stock status is updated after import on schedule - * - * @magentoDataFixture mediaImportImageFixture - * @magentoDataFixture Magento/Catalog/_files/product_simple.php - * @magentoDataFixture Magento/CatalogImportExport/_files/cataloginventory_stock_item_update_by_schedule.php - * @magentoDbIsolation disabled - */ - public function testProductStockStatusShouldBeUpdatedOnSchedule() - { - /** * @var $indexProcessor \Magento\Indexer\Model\Processor */ - $indexProcessor = $this->objectManager->create(\Magento\Indexer\Model\Processor::class); - /** @var $stockRegistry StockRegistry */ - $stockRegistry = $this->objectManager->create(StockRegistry::class); - /** @var StockRegistryStorage $stockRegistryStorage */ - $stockRegistryStorage = $this->objectManager->get(StockRegistryStorage::class); - $status = $stockRegistry->getStockStatusBySku('simple'); - $this->assertEquals(Stock::STOCK_IN_STOCK, $status->getStockStatus()); - $this->importDataForMediaTest('disable_product.csv'); - $indexProcessor->updateMview(); - $stockRegistryStorage->clean(); - $status = $stockRegistry->getStockStatusBySku('simple'); - $this->assertEquals(Stock::STOCK_OUT_OF_STOCK, $status->getStockStatus()); - $this->importDataForMediaTest('enable_product.csv'); - $indexProcessor->updateMview(); - $stockRegistryStorage->clean(); - $status = $stockRegistry->getStockStatusBySku('simple'); - $this->assertEquals(Stock::STOCK_IN_STOCK, $status->getStockStatus()); - } - - /** - * Tests that empty attribute value in the CSV file will be ignored after update a product by the import. - * - * @magentoDataFixture Magento/Catalog/_files/product_with_varchar_attribute.php - */ - public function testEmptyAttributeValueShouldBeIgnoredAfterUpdateProductByImport() - { - $pathToFile = __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR - . 'import_product_with_empty_attribute_value.csv'; - /** @var ImportProduct $importModel */ - $importModel = $this->createImportModel($pathToFile); - /** @var ProcessingErrorAggregatorInterface $errors */ - $errors = $importModel->validateData(); - $this->assertTrue($errors->getErrorsCount() === 0, 'Import file validation failed.'); - $importModel->importData(); - - $simpleProduct = $this->productRepository->get('simple', false, null, true); - $this->assertEquals('Varchar default value', $simpleProduct->getData('varchar_attribute')); - $this->assertEquals('Short description', $simpleProduct->getData('short_description')); - } - - /** - * Checks possibility to double importing products using the same import file. - * - * Bunch size is using to test importing the same product that will be chunk to different bunches. - * Example: - * - first bunch - * product-sku,default-store - * product-sku,second-store - * - second bunch - * product-sku,third-store - * - * @magentoDbIsolation disabled - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Store/_files/second_store.php - */ - public function testCheckDoubleImportOfProducts() - { - $this->importedProducts = [ - 'simple1', - 'simple2', - 'simple3', - ]; - - /** @var SearchCriteria $searchCriteria */ - $searchCriteria = $this->searchCriteriaBuilder->create(); - - $this->assertTrue($this->importFile('products_with_two_store_views.csv', 2)); - $productsAfterFirstImport = $this->productRepository->getList($searchCriteria)->getItems(); - $this->assertCount(3, $productsAfterFirstImport); - - $this->assertTrue($this->importFile('products_with_two_store_views.csv', 2)); - $productsAfterSecondImport = $this->productRepository->getList($searchCriteria)->getItems(); - $this->assertCount(3, $productsAfterSecondImport); - } - - /** - * Checks that product related links added for all bunches properly after products import - */ - public function testImportProductsWithLinksInDifferentBunches() - { - $this->importedProducts = [ - 'simple1', - 'simple2', - 'simple3', - 'simple4', - 'simple5', - 'simple6', - ]; - $importExportData = $this->getMockBuilder(Data::class) - ->disableOriginalConstructor() - ->getMock(); - $importExportData->expects($this->atLeastOnce()) - ->method('getBunchSize') - ->willReturn(5); - $this->_model = $this->objectManager->create( - \Magento\CatalogImportExport\Model\Import\Product::class, - ['importExportData' => $importExportData] - ); - $linksData = [ - 'related' => [ - 'simple1' => '2', - 'simple2' => '1' - ] - ]; - $pathToFile = __DIR__ . '/_files/products_to_import_with_related.csv'; - $filesystem = $this->objectManager->create(Filesystem::class); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - $errors = $this->_model->setSource($source) - ->setParameters( - [ - 'behavior' => Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product' - ] - ) - ->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->_model->importData(); - - $resource = $this->objectManager->get(ProductResource::class); - $productId = $resource->getIdBySku('simple6'); - /** @var Product $product */ - $product = $this->objectManager->create(Product::class); - $product->load($productId); - $productLinks = [ - 'related' => $product->getRelatedProducts() - ]; - $importedProductLinks = []; - foreach ($productLinks as $linkType => $linkedProducts) { - foreach ($linkedProducts as $linkedProductData) { - $importedProductLinks[$linkType][$linkedProductData->getSku()] = $linkedProductData->getPosition(); - } - } - $this->assertEquals($linksData, $importedProductLinks); - } - - /** - * Tests that image name does not have to be prefixed by slash - * - * @magentoDataFixture mediaImportImageFixture - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Catalog/_files/product_with_image.php - */ - public function testUpdateImageByNameNotPrefixedWithSlash() - { - $expectedLabelForDefaultStoreView = 'image label updated'; - $expectedImageFile = '/m/a/magento_image.jpg'; - $secondStoreCode = 'fixturestore'; - $productSku = 'simple'; - $this->importDataForMediaTest('import_image_name_without_slash.csv'); - $product = $this->getProductBySku($productSku); - $imageItems = $product->getMediaGalleryImages()->getItems(); - $this->assertCount(1, $imageItems); - $imageItem = array_shift($imageItems); - $this->assertEquals($expectedImageFile, $imageItem->getFile()); - $this->assertEquals($expectedLabelForDefaultStoreView, $imageItem->getLabel()); - $product = $this->getProductBySku($productSku, $secondStoreCode); - $imageItems = $product->getMediaGalleryImages()->getItems(); - $this->assertCount(0, $imageItems); - } - - /** - * Tests that images are imported correctly - * - * @magentoDataFixture mediaImportImageFixture - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDataFixture Magento/Catalog/_files/product_with_image.php - * @dataProvider importImagesDataProvider - * @magentoAppIsolation enabled - * @param string $importFile - * @param string $productSku - * @param string $storeCode - * @param array $expectedImages - * @param array $select - */ - public function testImportImages( - string $importFile, - string $productSku, - string $storeCode, - array $expectedImages, - array $select = ['file', 'label', 'position'] - ): void { - $this->importDataForMediaTest($importFile); - $product = $this->getProductBySku($productSku, $storeCode); - $actualImages = array_map( - function (\Magento\Framework\DataObject $item) use ($select) { - return $item->toArray($select); - }, - $product->getMediaGalleryImages()->getItems() - ); - $this->assertEquals($expectedImages, array_values($actualImages)); - } - - /** - * @return array[] - */ - public function importImagesDataProvider(): array - { - return [ - [ - 'import_media_additional_images_storeview.csv', - 'simple', - 'default', - [ - [ - 'file' => '/m/a/magento_image.jpg', - 'label' => 'Image Alt Text', - 'position' => 1 - ], - [ - 'file' => '/m/a/magento_additional_image_one.jpg', - 'label' => null, - 'position' => 2 - ], - [ - 'file' => '/m/a/magento_additional_image_two.jpg', - 'label' => null, - 'position' => 3 - ], - ] - ], - [ - 'import_media_additional_images_storeview.csv', - 'simple', - 'fixturestore', - [ - [ - 'file' => '/m/a/magento_image.jpg', - 'label' => 'Image Alt Text', - 'position' => 1 - ], - [ - 'file' => '/m/a/magento_additional_image_one.jpg', - 'label' => 'Additional Image Label One', - 'position' => 2 - ], - [ - 'file' => '/m/a/magento_additional_image_two.jpg', - 'label' => 'Additional Image Label Two', - 'position' => 3 - ], - ] - ] - ]; - } - - /** - * Verify additional images url validation during import. - * - * @magentoDbIsolation enabled - * @return void - */ - public function testImportInvalidAdditionalImages(): void - { - $pathToFile = __DIR__ . '/_files/import_media_additional_images_with_wrong_url.csv'; - $filesystem = BootstrapHelper::getObjectManager()->create(Filesystem::class); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create(Csv::class, ['file' => $pathToFile, 'directory' => $directory]); - $errors = $this->_model->setSource($source)->setParameters(['behavior' => Import::BEHAVIOR_APPEND]) - ->validateData(); - $this->assertEquals($errors->getErrorsCount(), 1); - $this->assertEquals( - "Wrong URL/path used for attribute additional_images", - $errors->getErrorByRowNumber(0)[0]->getErrorMessage() - ); - } -} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductCategoriesTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductCategoriesTest.php new file mode 100644 index 0000000000000..2814d75de1a4a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductCategoriesTest.php @@ -0,0 +1,214 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Import\ProductTest; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Category; +use Magento\CatalogImportExport\Model\Import\ProductTestBase; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\ImportExport\Model\Import; + +/** + * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. + * + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @magentoAppArea adminhtml + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php + */ +class ProductCategoriesTest extends ProductTestBase +{ + /** + * @magentoAppArea adminhtml + * @dataProvider categoryTestDataProvider + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + */ + public function testProductCategories($fixture, $separator) + { + // import data from CSV file + $pathToFile = __DIR__ . '/../_files/' . $fixture; + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Framework\Filesystem::class + ); + + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => $pathToFile, + 'directory' => $directory + ] + ); + $errors = $this->_model->setSource( + $source + )->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product', + Import::FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR => $separator + ] + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $resource = $objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); + $productId = $resource->getIdBySku('simple1'); + $this->assertIsNumeric($productId); + /** @var \Magento\Catalog\Model\Product $product */ + $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Model\Product::class + ); + $product->load($productId); + $this->assertFalse($product->isObjectNew()); + $categories = $product->getCategoryIds(); + $this->assertTrue(count($categories) == 2); + } + + /** + * @magentoAppArea adminhtml + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/multiple_products.php + * @magentoDataFixture Magento/Catalog/_files/category.php + */ + public function testProductPositionInCategory() + { + /* @var \Magento\Catalog\Model\ResourceModel\Category\Collection $collection */ + $collection = $this->objectManager->create(\Magento\Catalog\Model\ResourceModel\Category\Collection::class); + $collection->addNameToResult()->load(); + /** @var Category $category */ + $category = $collection->getItemByColumnValue('name', 'Category 1'); + + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + + $categoryProducts = []; + $i = 51; + foreach (['simple1', 'simple2', 'simple3'] as $sku) { + $categoryProducts[$productRepository->get($sku)->getId()] = $i++; + } + $category->setPostedProducts($categoryProducts); + $category->save(); + + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Framework\Filesystem::class + ); + + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setSource( + $source + )->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product' + ] + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + /** @var \Magento\Framework\App\ResourceConnection $resourceConnection */ + $resourceConnection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + \Magento\Framework\App\ResourceConnection::class + ); + $tableName = $resourceConnection->getTableName('catalog_category_product'); + $select = $resourceConnection->getConnection()->select()->from($tableName) + ->where('category_id = ?', $category->getId()); + $items = $resourceConnection->getConnection()->fetchAll($select); + $this->assertCount(3, $items); + foreach ($items as $item) { + $this->assertGreaterThan(50, $item['position']); + } + } + + /** + * @return array + */ + public function categoryTestDataProvider() + { + return [ + ['import_new_categories_default_separator.csv', ','], + ['import_new_categories_custom_separator.csv', '|'] + ]; + } + + /** + * @magentoAppArea adminhtml + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/CatalogImportExport/_files/update_category_duplicates.php + */ + public function testProductDuplicateCategories() + { + $csvFixture = 'products_duplicate_category.csv'; + // import data from CSV file + $pathToFile = __DIR__ . '/../_files/' . $csvFixture; + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Framework\Filesystem::class + ); + + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => $pathToFile, + 'directory' => $directory + ] + ); + $errors = $this->_model->setSource($source)->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product' + ] + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() === 0); + + $this->_model->importData(); + + $errorProcessor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + \Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregator::class + ); + $errorCount = count($errorProcessor->getAllErrors()); + $this->assertTrue($errorCount === 1, 'Error expected'); + + $errorMessage = $errorProcessor->getAllErrors()[0]->getErrorMessage(); + $this->assertStringContainsString('URL key for specified store already exists', $errorMessage); + $this->assertStringContainsString('Default Category/Category 2', $errorMessage); + + $categoryAfter = $this->loadCategoryByName('Category 2'); + $this->assertTrue($categoryAfter === null); + + /** @var \Magento\Catalog\Model\Product $product */ + $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Model\Product::class + ); + $product->load(1); + $categories = $product->getCategoryIds(); + $this->assertTrue(count($categories) == 1); + } + + protected function loadCategoryByName($categoryName) + { + /* @var \Magento\Catalog\Model\ResourceModel\Category\Collection $collection */ + $collection = $this->objectManager->create(\Magento\Catalog\Model\ResourceModel\Category\Collection::class); + $collection->addNameToResult()->load(); + return $collection->getItemByColumnValue('name', $categoryName); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductImagesTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductImagesTest.php new file mode 100644 index 0000000000000..284872d62c84d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductImagesTest.php @@ -0,0 +1,647 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Import\ProductTest; + +use Magento\CatalogImportExport\Model\Import\ProductTestBase; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\DataObject; +use Magento\Framework\Filesystem; +use Magento\ImportExport\Model\Import; +use Magento\ImportExport\Model\Import\Source\Csv; +use Magento\TestFramework\Helper\Bootstrap as BootstrapHelper; + +/** + * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. + * + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @magentoAppArea adminhtml + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php + */ +class ProductImagesTest extends ProductTestBase +{ + /** + * Tests that images are imported correctly + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + * @dataProvider importImagesDataProvider + * @magentoAppIsolation enabled + * @param string $importFile + * @param string $productSku + * @param string $storeCode + * @param array $expectedImages + * @param array $select + */ + public function testImportImages( + string $importFile, + string $productSku, + string $storeCode, + array $expectedImages, + array $select = ['file', 'label', 'position'] + ): void { + $this->importDataForMediaTest($importFile); + $product = $this->getProductBySku($productSku, $storeCode); + $actualImages = array_map( + function (\Magento\Framework\DataObject $item) use ($select) { + return $item->toArray($select); + }, + $product->getMediaGalleryImages()->getItems() + ); + $this->assertEquals($expectedImages, array_values($actualImages)); + } + + /** + * @return array[] + */ + public function importImagesDataProvider(): array + { + return [ + [ + 'import_media_additional_images_storeview.csv', + 'simple', + 'default', + [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Image Alt Text', + 'position' => 1 + ], + [ + 'file' => '/m/a/magento_additional_image_one.jpg', + 'label' => null, + 'position' => 2 + ], + [ + 'file' => '/m/a/magento_additional_image_two.jpg', + 'label' => null, + 'position' => 3 + ], + ] + ], + [ + 'import_media_additional_images_storeview.csv', + 'simple', + 'fixturestore', + [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Image Alt Text', + 'position' => 1 + ], + [ + 'file' => '/m/a/magento_additional_image_one.jpg', + 'label' => 'Additional Image Label One', + 'position' => 2 + ], + [ + 'file' => '/m/a/magento_additional_image_two.jpg', + 'label' => 'Additional Image Label Two', + 'position' => 3 + ], + ] + ] + ]; + } + + /** + * Test that product import with images works properly + * + * @magentoDataFixture mediaImportImageFixture + * @magentoAppIsolation enabled + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testSaveMediaImage() + { + $this->importDataForMediaTest('import_media.csv'); + + $product = $this->getProductBySku('simple_new'); + + $this->assertEquals('/m/a/magento_image.jpg', $product->getData('image')); + $this->assertEquals('/m/a/magento_small_image.jpg', $product->getData('small_image')); + $this->assertEquals('/m/a/magento_thumbnail.jpg', $product->getData('thumbnail')); + $this->assertEquals('/m/a/magento_image.jpg', $product->getData('swatch_image')); + + $gallery = $product->getMediaGalleryImages(); + $this->assertInstanceOf(\Magento\Framework\Data\Collection::class, $gallery); + + $items = $gallery->getItems(); + $this->assertCount(5, $items); + + $imageItem = array_shift($items); + $this->assertInstanceOf(\Magento\Framework\DataObject::class, $imageItem); + $this->assertEquals('/m/a/magento_image.jpg', $imageItem->getFile()); + $this->assertEquals('Image Label', $imageItem->getLabel()); + + $smallImageItem = array_shift($items); + $this->assertInstanceOf(\Magento\Framework\DataObject::class, $smallImageItem); + $this->assertEquals('/m/a/magento_small_image.jpg', $smallImageItem->getFile()); + $this->assertEquals('Small Image Label', $smallImageItem->getLabel()); + + $thumbnailItem = array_shift($items); + $this->assertInstanceOf(\Magento\Framework\DataObject::class, $thumbnailItem); + $this->assertEquals('/m/a/magento_thumbnail.jpg', $thumbnailItem->getFile()); + $this->assertEquals('Thumbnail Label', $thumbnailItem->getLabel()); + + $additionalImageOneItem = array_shift($items); + $this->assertInstanceOf(\Magento\Framework\DataObject::class, $additionalImageOneItem); + $this->assertEquals('/m/a/magento_additional_image_one.jpg', $additionalImageOneItem->getFile()); + $this->assertEquals('Additional Image Label One', $additionalImageOneItem->getLabel()); + + $additionalImageTwoItem = array_shift($items); + $this->assertInstanceOf(\Magento\Framework\DataObject::class, $additionalImageTwoItem); + $this->assertEquals('/m/a/magento_additional_image_two.jpg', $additionalImageTwoItem->getFile()); + $this->assertEquals('Additional Image Label Two', $additionalImageTwoItem->getLabel()); + } + + /** + * Tests that "hide_from_product_page" attribute is hidden after importing product images. + * + * @magentoDataFixture mediaImportImageFixture + * @magentoAppIsolation enabled + */ + public function testSaveHiddenImages() + { + $this->importDataForMediaTest('import_media_hidden_images.csv'); + $product = $this->getProductBySku('simple_new'); + $images = $product->getMediaGalleryEntries(); + + $hiddenImages = array_filter( + $images, + static function (DataObject $image) { + return (int)$image->getDisabled() === 1; + } + ); + + $this->assertCount(3, $hiddenImages); + + $imageItem = array_shift($hiddenImages); + $this->assertEquals('/m/a/magento_image.jpg', $imageItem->getFile()); + + $imageItem = array_shift($hiddenImages); + $this->assertEquals('/m/a/magento_thumbnail.jpg', $imageItem->getFile()); + + $imageItem = array_shift($hiddenImages); + $this->assertEquals('/m/a/magento_additional_image_two.jpg', $imageItem->getFile()); + } + + /** + * Tests importing product images with "no_selection" attribute. + * + * @magentoDataFixture mediaImportImageFixture + * @magentoAppIsolation enabled + */ + public function testSaveImagesNoSelection() + { + $this->importDataForMediaTest('import_media_with_no_selection.csv'); + $product = $this->getProductBySku('simple_new'); + + $this->assertEquals('/m/a/magento_image.jpg', $product->getData('image')); + $this->assertNull($product->getData('small_image')); + $this->assertNull($product->getData('thumbnail')); + $this->assertNull($product->getData('swatch_image')); + } + + /** + * Test that new images should be added after the existing ones. + * + * @magentoDataFixture mediaImportImageFixture + * @magentoAppIsolation enabled + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testNewImagesShouldBeAddedAfterExistingOnes() + { + $this->importDataForMediaTest('import_media.csv'); + + $product = $this->getProductBySku('simple_new'); + + $items = array_values($product->getMediaGalleryImages()->getItems()); + + $images = [ + ['file' => '/m/a/magento_image.jpg', 'label' => 'Image Label'], + ['file' => '/m/a/magento_small_image.jpg', 'label' => 'Small Image Label'], + ['file' => '/m/a/magento_thumbnail.jpg', 'label' => 'Thumbnail Label'], + ['file' => '/m/a/magento_additional_image_one.jpg', 'label' => 'Additional Image Label One'], + ['file' => '/m/a/magento_additional_image_two.jpg', 'label' => 'Additional Image Label Two'], + ]; + + $this->assertCount(5, $items); + $this->assertEquals( + $images, + array_map( + function (\Magento\Framework\DataObject $item) { + return $item->toArray(['file', 'label']); + }, + $items + ) + ); + + $this->importDataForMediaTest('import_media_additional_long_name_image.csv'); + $product->cleanModelCache(); + $product = $this->getProductBySku('simple_new'); + $items = array_values($product->getMediaGalleryImages()->getItems()); + $images[] = ['file' => '/m/a/' . self::LONG_FILE_NAME_IMAGE, 'label' => '']; + $this->assertCount(6, $items); + $this->assertEquals( + $images, + array_map( + function (\Magento\Framework\DataObject $item) { + return $item->toArray(['file', 'label']); + }, + $items + ) + ); + } + + /** + * Test import twice and check that image will not be duplicate + * + * @magentoDataFixture mediaImportImageFixture + * @return void + */ + public function testSaveMediaImageDuplicateImages(): void + { + $this->importDataForMediaTest('import_media.csv'); + $imagesCount = count($this->getProductBySku('simple_new')->getMediaGalleryImages()->getItems()); + + // import the same file again + $this->importDataForMediaTest('import_media.csv'); + + $this->assertCount($imagesCount, $this->getProductBySku('simple_new')->getMediaGalleryImages()->getItems()); + } + + /** + * Test that errors occurred during importing images are logged. + * + * @magentoAppIsolation enabled + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture mediaImportImageFixtureError + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testSaveMediaImageError() + { + $this->logger->expects(self::once())->method('critical'); + $this->importDataForMediaTest('import_media.csv', 1); + } + + /** + * Make sure the non existing image in the csv file won't erase the qty key of the existing products. + * + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + */ + public function testImportWithNonExistingImage() + { + $products = [ + 'simple_new' => 100, + ]; + + $this->importFile('products_to_import_with_non_existing_image.csv'); + + $productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); + foreach ($products as $productSku => $productQty) { + $product = $productRepository->get($productSku); + $stockItem = $product->getExtensionAttributes()->getStockItem(); + $this->assertEquals($productQty, $stockItem->getQty()); + } + } + + /** + * Tests situation when images for importing products are already present in filesystem. + * + * @magentoDataFixture Magento/CatalogImportExport/Model/Import/_files/import_with_filesystem_images.php + * @magentoAppIsolation enabled + */ + public function testImportWithFilesystemImages() + { + /** @var Filesystem $filesystem */ + $filesystem = ObjectManager::getInstance()->get(Filesystem::class); + /** @var \Magento\Framework\Filesystem\Directory\WriteInterface $writeAdapter */ + $writeAdapter = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); + + if (!$writeAdapter->isWritable()) { + $this->markTestSkipped('Due to unwritable media directory'); + } + + $this->importDataForMediaTest('import_media_existing_images.csv'); + } + + /** + * Test that product import with images for non-default store works properly. + * + * @magentoDataFixture mediaImportImageFixture + * @magentoAppIsolation enabled + */ + public function testImportImageForNonDefaultStore() + { + $this->importDataForMediaTest('import_media_two_stores.csv'); + $product = $this->getProductBySku('simple_with_images'); + $mediaGallery = $product->getData('media_gallery'); + foreach ($mediaGallery['images'] as $image) { + $image['file'] === '/m/a/magento_image.jpg' + ? self::assertSame('1', $image['disabled']) + : self::assertSame('0', $image['disabled']); + } + } + + /** + * Hide product images via hide_from_product_page attribute during import CSV. + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + * + * @return void + */ + public function testImagesAreHiddenAfterImport(): void + { + $expectedActiveImages = [ + [ + 'file' => '/m/a/magento_additional_image_one.jpg', + 'label' => 'Additional Image Label One', + 'disabled' => '0', + ], + [ + 'file' => '/m/a/magento_additional_image_two.jpg', + 'label' => 'Additional Image Label Two', + 'disabled' => '0', + ], + ]; + + $expectedHiddenImage = [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Image Alt Text', + 'disabled' => '1', + ]; + $expectedAllProductImages = array_merge( + [$expectedHiddenImage], + $expectedActiveImages + ); + + $this->importDataForMediaTest('hide_from_product_page_images.csv'); + $actualAllProductImages = []; + $product = $this->getProductBySku('simple'); + + // Check that new images were imported and existing image is disabled after import + $productMediaData = $product->getData('media_gallery'); + + $this->assertNotEmpty($productMediaData['images']); + $allProductImages = $productMediaData['images']; + $this->assertCount(3, $allProductImages, 'Images were imported incorrectly'); + + foreach ($allProductImages as $image) { + $actualAllProductImages[] = [ + 'file' => $image['file'], + 'label' => $image['label'], + 'disabled' => $image['disabled'], + ]; + } + + $this->assertEquals( + $expectedAllProductImages, + $actualAllProductImages, + 'Images are incorrect after import' + ); + + // Check that on storefront only enabled images are shown + $actualActiveImages = $product->getMediaGalleryImages(); + $this->assertSame( + $expectedActiveImages, + $actualActiveImages->toArray(['file', 'label', 'disabled'])['items'], + 'Hidden image is present on frontend after import' + ); + } + + /** + * Checking product images after Add/Update import failure + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/CatalogImportExport/Model/Import/_files/import_with_filesystem_images.php + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * + * @return void + */ + public function testProductBaseImageAfterImport() + { + $this->importDataForMediaTest('import_media.csv'); + + $this->testImportWithNonExistingImage(); + + /** @var $productAfterImport \Magento\Catalog\Model\Product */ + $productAfterImport = $this->getProductBySku('simple_new'); + $this->assertNotEquals('/no/exists/image/magento_image.jpg', $productAfterImport->getData('image')); + } + + /** + * Tests that images are hidden only for a store view in "store_view_code". + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + */ + public function testHideImageForStoreView() + { + $expectedImageFile = '/m/a/magento_image.jpg'; + $secondStoreCode = 'fixturestore'; + $productSku = 'simple'; + $this->importDataForMediaTest('import_hide_image_for_storeview.csv'); + $product = $this->getProductBySku($productSku); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(1, $imageItems); + $imageItem = array_shift($imageItems); + $this->assertEquals($expectedImageFile, $imageItem->getFile()); + $product = $this->getProductBySku($productSku, $secondStoreCode); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(0, $imageItems); + } + + /** + * Test that images labels are updated only for a store view in "store_view_code". + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + */ + public function testChangeImageLabelForStoreView() + { + $expectedImageFile = '/m/a/magento_image.jpg'; + $expectedLabelForDefaultStoreView = 'Image Alt Text'; + $expectedLabelForSecondStoreView = 'Magento Logo'; + $secondStoreCode = 'fixturestore'; + $productSku = 'simple'; + $this->importDataForMediaTest('import_change_image_label_for_storeview.csv'); + $product = $this->getProductBySku($productSku); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(1, $imageItems); + $imageItem = array_shift($imageItems); + $this->assertEquals($expectedImageFile, $imageItem->getFile()); + $this->assertEquals($expectedLabelForDefaultStoreView, $imageItem->getLabel()); + $product = $this->getProductBySku($productSku, $secondStoreCode); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(1, $imageItems); + $imageItem = array_shift($imageItems); + $this->assertEquals($expectedImageFile, $imageItem->getFile()); + $this->assertEquals($expectedLabelForSecondStoreView, $imageItem->getLabel()); + } + + /** + * Test that configurable product images are imported correctly. + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_attribute.php + */ + public function testImportConfigurableProductImages() + { + $this->importDataForMediaTest('import_configurable_product_multistore.csv'); + $expected = [ + 'import-configurable-option-1' => [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Base Image Label - Option 1', + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => 'Small Image Label - Option 1', + ], + [ + 'file' => '/m/a/magento_thumbnail.jpg', + 'label' => 'Thumbnail Image Label - Option 1', + ], + [ + 'file' => '/m/a/magento_additional_image_one.jpg', + 'label' => '', + ], + ], + 'import-configurable-option-2' => [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Base Image Label - Option 2', + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => 'Small Image Label - Option 2', + ], + [ + 'file' => '/m/a/magento_thumbnail.jpg', + 'label' => 'Thumbnail Image Label - Option 2', + ], + [ + 'file' => '/m/a/magento_additional_image_two.jpg', + 'label' => '', + ], + ], + 'import-configurable' => [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Base Image Label - Configurable', + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => 'Small Image Label - Configurable', + ], + [ + 'file' => '/m/a/magento_thumbnail.jpg', + 'label' => 'Thumbnail Image Label - Configurable', + ], + [ + 'file' => '/m/a/magento_additional_image_three.jpg', + 'label' => '', + ], + ] + ]; + $actual = []; + $products = ['import-configurable-option-1', 'import-configurable-option-2', 'import-configurable']; + foreach ($products as $sku) { + $product = $this->getProductBySku($sku); + $gallery = $product->getMediaGalleryImages(); + foreach ($gallery->getItems() as $item) { + $actual[$sku][] = $item->toArray(['file', 'label']); + } + } + $this->assertEquals($expected, $actual); + + $expected['import-configurable'] = [ + [ + 'file' => '/m/a/magento_image.jpg', + 'label' => 'Base Image Label - Configurable (fixturestore)', + ], + [ + 'file' => '/m/a/magento_small_image.jpg', + 'label' => 'Small Image Label - Configurable (fixturestore)', + ], + [ + 'file' => '/m/a/magento_thumbnail.jpg', + 'label' => 'Thumbnail Image Label - Configurable (fixturestore)', + ], + [ + 'file' => '/m/a/magento_additional_image_three.jpg', + 'label' => '', + ], + ]; + + $actual = []; + foreach ($products as $sku) { + $product = $this->getProductBySku($sku, 'fixturestore'); + $gallery = $product->getMediaGalleryImages(); + foreach ($gallery->getItems() as $item) { + $actual[$sku][] = $item->toArray(['file', 'label']); + } + } + $this->assertEquals($expected, $actual); + } + + /** + * Tests that image name does not have to be prefixed by slash + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + */ + public function testUpdateImageByNameNotPrefixedWithSlash() + { + $expectedLabelForDefaultStoreView = 'image label updated'; + $expectedImageFile = '/m/a/magento_image.jpg'; + $secondStoreCode = 'fixturestore'; + $productSku = 'simple'; + $this->importDataForMediaTest('import_image_name_without_slash.csv'); + $product = $this->getProductBySku($productSku); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(1, $imageItems); + $imageItem = array_shift($imageItems); + $this->assertEquals($expectedImageFile, $imageItem->getFile()); + $this->assertEquals($expectedLabelForDefaultStoreView, $imageItem->getLabel()); + $product = $this->getProductBySku($productSku, $secondStoreCode); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(0, $imageItems); + } + + /** + * Verify additional images url validation during import. + * + * @magentoDbIsolation enabled + * @return void + */ + public function testImportInvalidAdditionalImages(): void + { + $pathToFile = __DIR__ . '/../_files/import_media_additional_images_with_wrong_url.csv'; + $filesystem = BootstrapHelper::getObjectManager()->create(Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create(Csv::class, ['file' => $pathToFile, 'directory' => $directory]); + $errors = $this->_model->setSource($source)->setParameters(['behavior' => Import::BEHAVIOR_APPEND]) + ->validateData(); + $this->assertEquals($errors->getErrorsCount(), 1); + $this->assertEquals( + "Wrong URL/path used for attribute additional_images", + $errors->getErrorByRowNumber(0)[0]->getErrorMessage() + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductMultipleStoresTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductMultipleStoresTest.php new file mode 100644 index 0000000000000..dd50e731a8fbb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductMultipleStoresTest.php @@ -0,0 +1,246 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Import\ProductTest; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\CatalogImportExport\Model\Import\ProductTestBase; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Store\Model\StoreManagerInterface; + +/** + * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. + * + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @magentoAppArea adminhtml + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php + */ +class ProductMultipleStoresTest extends ProductTestBase +{ + /** + * @magentoDataFixture Magento/Store/_files/website.php + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + */ + public function testProductWithMultipleStoresInDifferentBunches() + { + $products = [ + 'simple1', + 'simple2', + 'simple3' + ]; + + $importExportData = $this->getMockBuilder(\Magento\ImportExport\Helper\Data::class) + ->disableOriginalConstructor() + ->getMock(); + $importExportData->expects($this->atLeastOnce()) + ->method('getBunchSize') + ->willReturn(1); + $this->_model = $this->objectManager->create( + \Magento\CatalogImportExport\Model\Import\Product::class, + ['importExportData' => $importExportData] + ); + + $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_multiple_store.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + $productCollection = $this->objectManager + ->create(\Magento\Catalog\Model\ResourceModel\Product\Collection::class); + $this->assertCount(3, $productCollection->getItems()); + $actualProductSkus = array_map( + function (ProductInterface $item) { + return $item->getSku(); + }, + $productCollection->getItems() + ); + sort($products); + $result = array_values($actualProductSkus); + sort($result); + $this->assertEquals( + $products, + $result + ); + + /** @var \Magento\Framework\Registry $registry */ + $registry = $this->objectManager->get(\Magento\Framework\Registry::class); + + $registry->unregister('isSecureArea'); + $registry->register('isSecureArea', true); + + $productSkuList = ['simple1', 'simple2', 'simple3']; + $categoryIds = []; + foreach ($productSkuList as $sku) { + try { + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); + /** @var \Magento\Catalog\Model\Product $product */ + $product = $productRepository->get($sku, true); + $categoryIds[] = $product->getCategoryIds(); + if ($product->getId()) { + $productRepository->delete($product); + } + // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock + } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { + //Product already removed + } + } + + /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */ + $collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Catalog\Model\ResourceModel\Category\Collection::class); + $collection + ->addAttributeToFilter('entity_id', ['in' => \array_unique(\array_merge([], ...$categoryIds))]) + ->load() + ->delete(); + + $registry->unregister('isSecureArea'); + $registry->register('isSecureArea', false); + } + + /** + * Test import product into multistore system when media is disabled. + * + * @magentoDataFixture Magento/CatalogImportExport/Model/Import/_files/custom_category_store_media_disabled.php + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * @return void + */ + public function testProductsWithMultipleStoresWhenMediaIsDisabled(): void + { + $this->loginAdminUserWithUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); + + $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/product_with_custom_store_media_disabled.csv', + 'directory' => $directory, + ] + ); + $errors = $this->_model->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product', + ] + )->setSource( + $source + )->validateData(); + + $errorMessages = array_map( + function ($value) { + /** @var \Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError $value */ + return $value->getErrorMessage(); + }, + $errors->getAllErrors() + ); + $this->assertTrue($errors->getErrorsCount() === 0, "Error messages:\n" . implode("\n", $errorMessages)); + $this->assertTrue($this->_model->importData()); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/categories.php + * @magentoDataFixture Magento/Store/_files/website.php + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/Model/Layer/Filter/_files/attribute_with_option.php + * @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_attribute.php + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + */ + public function testProductsWithMultipleStores() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + $filesystem = $objectManager->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_multiple_stores.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + + /** @var \Magento\Catalog\Model\Product $product */ + $product = $objectManager->create(\Magento\Catalog\Model\Product::class); + $id = $product->getIdBySku('Configurable 03'); + $product->load($id); + $this->assertEquals('1', $product->getHasOptions()); + + $objectManager->get(StoreManagerInterface::class)->setCurrentStore('fixturestore'); + + /** @var \Magento\Catalog\Model\Product $simpleProduct */ + $simpleProduct = $objectManager->create(\Magento\Catalog\Model\Product::class); + $id = $simpleProduct->getIdBySku('Configurable 03-Option 1'); + $simpleProduct->load($id); + $this->assertTrue(count($simpleProduct->getWebsiteIds()) == 2); + $this->assertEquals('Option Label', $simpleProduct->getAttributeText('attribute_with_option')); + } + + /** + * Test url keys properly generated in multistores environment. + * + * @magentoConfigFixture current_store catalog/seo/product_use_categories 1 + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/category_with_two_stores.php + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + */ + public function testGenerateUrlsWithMultipleStores() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + $filesystem = $objectManager->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_two_stores.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + $this->assertProductRequestPath('default', 'category-defaultstore/product-default.html'); + $this->assertProductRequestPath('fixturestore', 'category-fixturestore/product-fixture.html'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductOptionsTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductOptionsTest.php new file mode 100644 index 0000000000000..7b4b5d96b719f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductOptionsTest.php @@ -0,0 +1,482 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Import\ProductTest; + +use Magento\Catalog\Api\ProductCustomOptionRepositoryInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\CatalogImportExport\Model\Import\ProductTestBase; +use Magento\Store\Model\StoreManagerInterface; + +/** + * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @magentoAppArea adminhtml + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php + */ +class ProductOptionsTest extends ProductTestBase +{ + /** + * Options for assertion + * + * @var array + */ + protected $_assertOptions = [ + 'is_require' => 'required', + 'price' => 'price', + 'sku' => 'sku', + 'sort_order' => 'order', + 'max_characters' => 'max_characters', + ]; + + /** + * Option values for assertion + * + * @var array + */ + protected $_assertOptionValues = [ + 'title' => 'option_title', + 'price' => 'price', + 'sku' => 'sku', + ]; + + /** + * List of specific custom option types + * + * @var array + */ + protected $specificTypes = [ + 'drop_down', + 'radio', + 'checkbox', + 'multiple', + ]; + + /** + * Tests adding of custom options with existing and new product. + * + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + * @dataProvider getBehaviorDataProvider + * @param string $importFile + * @param string $sku + * @param int $expectedOptionsQty + * @throws \Magento\Framework\Exception\LocalizedException + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @magentoAppIsolation enabled + * + * @return void + */ + public function testSaveCustomOptions(string $importFile, string $sku, int $expectedOptionsQty): void + { + $pathToFile = __DIR__ . '/../_files/' . $importFile; + $importModel = $this->createImportModel($pathToFile); + $errors = $importModel->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $importModel->importData(); + + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + $product = $productRepository->get($sku); + + $this->assertInstanceOf(\Magento\Catalog\Model\Product::class, $product); + $options = $product->getOptionInstance()->getProductOptions($product); + + $expectedData = $this->getExpectedOptionsData($pathToFile); + $expectedData = $this->mergeWithExistingData($expectedData, $options); + $actualData = $this->getActualOptionsData($options); + + // assert of equal type+titles + $expectedOptions = $expectedData['options']; + // we need to save key values + $actualOptions = $actualData['options']; + sort($expectedOptions); + sort($actualOptions); + $this->assertSame($expectedOptions, $actualOptions); + + // assert of options data + $this->assertCount(count($expectedData['data']), $actualData['data']); + $this->assertCount(count($expectedData['values']), $actualData['values']); + $this->assertCount($expectedOptionsQty, $actualData['options']); + foreach ($expectedData['options'] as $expectedId => $expectedOption) { + $elementExist = false; + // find value in actual options and values + foreach ($actualData['options'] as $actualId => $actualOption) { + if ($actualOption == $expectedOption) { + $elementExist = true; + $this->assertEquals($expectedData['data'][$expectedId], $actualData['data'][$actualId]); + if (array_key_exists($expectedId, $expectedData['values'])) { + $this->assertEquals($expectedData['values'][$expectedId], $actualData['values'][$actualId]); + } + unset($actualData['options'][$actualId]); + // remove value in case of duplicating key values + break; + } + } + $this->assertTrue($elementExist, 'Element must exist.'); + } + + // Make sure that after importing existing options again, option IDs and option value IDs are not changed + $customOptionValues = $this->getCustomOptionValues($sku); + $this->createImportModel($pathToFile)->importData(); + $this->assertEquals($customOptionValues, $this->getCustomOptionValues($sku)); + } + + /** + * Tests adding of custom options with multiple store views + * + * @magentoConfigFixture current_store catalog/price/scope 1 + * @magentoDataFixture Magento/Store/_files/core_second_third_fixturestore.php + * @magentoAppIsolation enabled + */ + public function testSaveCustomOptionsWithMultipleStoreViews() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var StoreManagerInterface $storeManager */ + $storeManager = $objectManager->get(StoreManagerInterface::class); + $storeCodes = [ + 'admin', + 'default', + 'secondstore', + ]; + /** @var StoreManagerInterface $storeManager */ + $importFile = 'product_with_custom_options_and_multiple_store_views.csv'; + $sku = 'simple'; + $pathToFile = __DIR__ . '/../_files/' . $importFile; + $importModel = $this->createImportModel($pathToFile); + $errors = $importModel->validateData(); + $this->assertTrue($errors->getErrorsCount() == 0, 'Import File Validation Failed'); + $importModel->importData(); + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + foreach ($storeCodes as $storeCode) { + $storeManager->setCurrentStore($storeCode); + $product = $productRepository->get($sku); + $options = $product->getOptionInstance()->getProductOptions($product); + $expectedData = $this->getExpectedOptionsData($pathToFile, $storeCode); + $expectedData = $this->mergeWithExistingData($expectedData, $options); + $actualData = $this->getActualOptionsData($options); + // assert of equal type+titles + $expectedOptions = $expectedData['options']; + // we need to save key values + $actualOptions = $actualData['options']; + sort($expectedOptions); + sort($actualOptions); + $this->assertEquals( + $expectedOptions, + $actualOptions, + 'Expected and actual options arrays does not match' + ); + + // assert of options data + $this->assertCount( + count($expectedData['data']), + $actualData['data'], + 'Expected and actual data count does not match' + ); + $this->assertCount( + count($expectedData['values']), + $actualData['values'], + 'Expected and actual values count does not match' + ); + + foreach ($expectedData['options'] as $expectedId => $expectedOption) { + $elementExist = false; + // find value in actual options and values + foreach ($actualData['options'] as $actualId => $actualOption) { + if ($actualOption == $expectedOption) { + $elementExist = true; + $this->assertEquals( + $expectedData['data'][$expectedId], + $actualData['data'][$actualId], + 'Expected data does not match actual data' + ); + if (array_key_exists($expectedId, $expectedData['values'])) { + $this->assertEquals( + $expectedData['values'][$expectedId], + $actualData['values'][$actualId], + 'Expected values does not match actual data' + ); + } + unset($actualData['options'][$actualId]); + // remove value in case of duplicating key values + break; + } + } + $this->assertTrue($elementExist, 'Element must exist.'); + } + + // Make sure that after importing existing options again, option IDs and option value IDs are not changed + $customOptionValues = $this->getCustomOptionValues($sku); + $this->createImportModel($pathToFile)->importData(); + $this->assertEquals( + $customOptionValues, + $this->getCustomOptionValues($sku), + 'Option IDs changed after second import' + ); + } + } + + /** + * @return array + */ + public function getBehaviorDataProvider(): array + { + return [ + 'Append behavior with existing product' => [ + 'importFile' => 'product_with_custom_options.csv', + 'sku' => 'simple', + 'expectedOptionsQty' => 6, + ], + 'Append behavior with existing product and without options in import file' => [ + 'importFile' => 'product_without_custom_options.csv', + 'sku' => 'simple', + 'expectedOptionsQty' => 0, + ], + 'Append behavior with new product' => [ + 'importFile' => 'product_with_custom_options_new.csv', + 'sku' => 'simple_new', + 'expectedOptionsQty' => 5, + ], + ]; + } + + /** + * @param string $productSku + * @return array ['optionId' => ['optionValueId' => 'optionValueTitle', ...], ...] + */ + protected function getCustomOptionValues($productSku) + { + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + /** @var ProductCustomOptionRepositoryInterface $customOptionRepository */ + $customOptionRepository = $this->objectManager->get(ProductCustomOptionRepositoryInterface::class); + $simpleProduct = $productRepository->get($productSku, false, null, true); + $originalProductOptions = $customOptionRepository->getProductOptions($simpleProduct); + $optionValues = []; + foreach ($originalProductOptions as $productOption) { + foreach ((array)$productOption->getValues() as $optionValue) { + $optionValues[$productOption->getOptionId()][$optionValue->getOptionTypeId()] + = $optionValue->getTitle(); + } + } + return $optionValues; + } + + /** + * Returns expected product data: current id, options, options data and option values + * + * @param string $pathToFile + * @param string $storeCode + * @return array + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + protected function getExpectedOptionsData(string $pathToFile, string $storeCode = ''): array + { + // phpcs:disable Magento2.Functions.DiscouragedFunction + $productData = $this->csvToArray(file_get_contents($pathToFile)); + $expectedOptionId = 0; + $expectedOptions = []; + // array of type and title types, key is element ID + $expectedData = []; + // array of option data + $expectedValues = []; + $storeRowId = null; + foreach ($productData['data'] as $rowId => $rowData) { + $storeCode = ($storeCode == 'admin') ? '' : $storeCode; + if ($rowData['store_view_code'] == $storeCode) { + $storeRowId = $rowId; + break; + } + } + if (!empty($productData['data'][$storeRowId]['custom_options'])) { + foreach (explode('|', $productData['data'][$storeRowId]['custom_options']) as $optionData) { + $option = array_values( + array_map( + function ($input) { + $data = explode('=', $input); + return [$data[0] => $data[1]]; + }, + explode(',', $optionData) + ) + ); + // phpcs:ignore Magento2.Performance.ForeachArrayMerge + $option = array_merge([], ...$option); + + if (!empty($option['type']) && !empty($option['name'])) { + $lastOptionKey = $option['type'] . '|' . $option['name']; + if (!isset($expectedOptions[$expectedOptionId]) + || $expectedOptions[$expectedOptionId] != $lastOptionKey) { + $expectedOptionId++; + $expectedOptions[$expectedOptionId] = $lastOptionKey; + $expectedData[$expectedOptionId] = []; + foreach ($this->_assertOptions as $assertKey => $assertFieldName) { + if (array_key_exists($assertFieldName, $option) + && !(($assertFieldName == 'price' || $assertFieldName == 'sku') + && in_array($option['type'], $this->specificTypes)) + ) { + $expectedData[$expectedOptionId][$assertKey] = $option[$assertFieldName]; + } + } + } + } + $optionValue = []; + if (!empty($option['name']) && !empty($option['option_title'])) { + foreach ($this->_assertOptionValues as $assertKey => $assertFieldName) { + if (isset($option[$assertFieldName])) { + $optionValue[$assertKey] = $option[$assertFieldName]; + } + } + $expectedValues[$expectedOptionId][] = $optionValue; + } + } + } + + return [ + 'id' => $expectedOptionId, + 'options' => $expectedOptions, + 'data' => $expectedData, + 'values' => $expectedValues, + ]; + } + + /** + * Updates expected options data array with existing unique options data + * + * @param array $expected + * @param \Magento\Catalog\Model\ResourceModel\Product\Option\Collection $options + * @return array + */ + protected function mergeWithExistingData( + array $expected, + $options + ) { + $expectedOptionId = $expected['id']; + $expectedOptions = $expected['options']; + $expectedData = $expected['data']; + $expectedValues = $expected['values']; + foreach ($options as $option) { + $optionKey = $option->getType() . '|' . $option->getTitle(); + $optionValues = $this->getOptionValues($option); + if (!in_array($optionKey, $expectedOptions)) { + $expectedOptionId++; + $expectedOptions[$expectedOptionId] = $optionKey; + $expectedData[$expectedOptionId] = $this->getOptionData($option); + if ($optionValues) { + $expectedValues[$expectedOptionId] = $optionValues; + } + } else { + $existingOptionId = array_search($optionKey, $expectedOptions); + // phpcs:ignore Magento2.Performance.ForeachArrayMerge + $expectedData[$existingOptionId] = array_merge( + $this->getOptionData($option), + $expectedData[$existingOptionId] + ); + if ($optionValues) { + foreach ($optionValues as $optionKey => $optionValue) { + // phpcs:ignore Magento2.Performance.ForeachArrayMerge + $expectedValues[$existingOptionId][$optionKey] = array_merge( + $optionValue, + $expectedValues[$existingOptionId][$optionKey] + ); + } + } + } + } + + return [ + 'id' => $expectedOptionId, + 'options' => $expectedOptions, + 'data' => $expectedData, + 'values' => $expectedValues + ]; + } + + /** + * Returns actual product data: current id, options, options data and option values + * + * @param \Magento\Catalog\Model\ResourceModel\Product\Option\Collection $options + * @return array + */ + protected function getActualOptionsData($options) + { + $actualOptionId = 0; + $actualOptions = []; + // array of type and title types, key is element ID + $actualData = []; + // array of option data + $actualValues = []; + // array of option values data + /** @var $option \Magento\Catalog\Model\Product\Option */ + foreach ($options as $option) { + $lastOptionKey = $option->getType() . '|' . $option->getTitle(); + $actualOptionId++; + if (!in_array($lastOptionKey, $actualOptions)) { + $actualOptions[$actualOptionId] = $lastOptionKey; + $actualData[$actualOptionId] = $this->getOptionData($option); + if ($optionValues = $this->getOptionValues($option)) { + $actualValues[$actualOptionId] = $optionValues; + } + } + } + return [ + 'id' => $actualOptionId, + 'options' => $actualOptions, + 'data' => $actualData, + 'values' => $actualValues + ]; + } + + /** + * Retrieve option data + * + * @param \Magento\Catalog\Model\Product\Option $option + * @return array + */ + protected function getOptionData(\Magento\Catalog\Model\Product\Option $option) + { + $result = []; + foreach (array_keys($this->_assertOptions) as $assertKey) { + $result[$assertKey] = $option->getData($assertKey); + } + return $result; + } + + /** + * Retrieve option values or false for options which has no values + * + * @param \Magento\Catalog\Model\Product\Option $option + * @return array|bool + */ + protected function getOptionValues(\Magento\Catalog\Model\Product\Option $option) + { + $values = $option->getValues(); + if (!empty($values)) { + $result = []; + /** @var $value \Magento\Catalog\Model\Product\Option\Value */ + foreach ($values as $value) { + $optionData = []; + foreach (array_keys($this->_assertOptionValues) as $assertKey) { + if ($value->hasData($assertKey)) { + $optionData[$assertKey] = $value->getData($assertKey); + } + } + $result[] = $optionData; + } + return $result; + } + + return false; + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductOtherTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductOtherTest.php new file mode 100644 index 0000000000000..6ee256bcbc587 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductOtherTest.php @@ -0,0 +1,738 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Import\ProductTest; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\Product as ProductResource; +use Magento\CatalogImportExport\Model\Import\ProductTestBase; +use Magento\CatalogInventory\Model\StockRegistry; +use Magento\Framework\Api\SearchCriteria; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; +use Magento\ImportExport\Helper\Data; +use Magento\ImportExport\Model\Import; +use Magento\ImportExport\Model\Import\Source\Csv; +use Magento\UrlRewrite\Model\ResourceModel\UrlRewriteCollection; + +/** + * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @magentoAppArea adminhtml + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php + */ +class ProductOtherTest extends ProductTestBase +{ + /** + * Test if visibility properly saved after import + * + * @magentoDataFixture Magento/Catalog/_files/multiple_products.php + * @magentoAppIsolation enabled + */ + public function testSaveProductsVisibility() + { + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + $id1 = $productRepository->get('simple1')->getId(); + $id2 = $productRepository->get('simple2')->getId(); + $id3 = $productRepository->get('simple3')->getId(); + $existingProductIds = [$id1, $id2, $id3]; + $productsBeforeImport = []; + foreach ($existingProductIds as $productId) { + $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Model\Product::class + ); + $product->load($productId); + $productsBeforeImport[] = $product; + } + + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + + /** @var $productBeforeImport \Magento\Catalog\Model\Product */ + foreach ($productsBeforeImport as $productBeforeImport) { + /** @var $productAfterImport \Magento\Catalog\Model\Product */ + $productAfterImport = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Model\Product::class + ); + $productAfterImport->load($productBeforeImport->getId()); + + $this->assertEquals($productBeforeImport->getVisibility(), $productAfterImport->getVisibility()); + unset($productAfterImport); + } + + unset($productsBeforeImport, $product); + } + + /** + * Test if datetime properly saved after import + * + * @magentoDataFixture Magento/Catalog/_files/multiple_products.php + * @magentoAppIsolation enabled + */ + public function testSaveDatetimeAttribute() + { + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + $id1 = $productRepository->get('simple1')->getId(); + $id2 = $productRepository->get('simple2')->getId(); + $id3 = $productRepository->get('simple3')->getId(); + $existingProductIds = [$id1, $id2, $id3]; + $productsBeforeImport = []; + foreach ($existingProductIds as $productId) { + $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Model\Product::class + ); + $product->load($productId); + $productsBeforeImport[$product->getSku()] = $product; + } + + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_datetime.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + + $source->rewind(); + foreach ($source as $row) { + /** @var $productAfterImport \Magento\Catalog\Model\Product */ + $productBeforeImport = $productsBeforeImport[$row['sku']]; + + /** @var $productAfterImport \Magento\Catalog\Model\Product */ + $productAfterImport = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Model\Product::class + ); + $productAfterImport->load($productBeforeImport->getId()); + $this->assertEquals( + @strtotime(date('m/d/Y', @strtotime($row['news_from_date']))), + @strtotime($productAfterImport->getNewsFromDate()) + ); + $this->assertEquals( + @strtotime($row['news_to_date']), + @strtotime($productAfterImport->getNewsToDate()) + ); + unset($productAfterImport); + } + unset($productsBeforeImport, $product); + } + + + + + + + + + + + + + + + + + /** + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + */ + public function testProductWithLinks() + { + $linksData = [ + 'upsell' => [ + 'simple1' => '3', + 'simple3' => '1' + ], + 'crosssell' => [ + 'simple2' => '1', + 'simple3' => '2' + ], + 'related' => [ + 'simple1' => '2', + 'simple2' => '1' + ] + ]; + // import data from CSV file + $pathToFile = __DIR__ . '/../_files/products_to_import_with_product_links.csv'; + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Framework\Filesystem::class + ); + + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => $pathToFile, + 'directory' => $directory + ] + ); + $errors = $this->_model->setSource( + $source + )->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product' + ] + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $resource = $objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); + $productId = $resource->getIdBySku('simple4'); + /** @var \Magento\Catalog\Model\Product $product */ + $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Model\Product::class + ); + $product->load($productId); + $productLinks = [ + 'upsell' => $product->getUpSellProducts(), + 'crosssell' => $product->getCrossSellProducts(), + 'related' => $product->getRelatedProducts() + ]; + $importedProductLinks = []; + foreach ($productLinks as $linkType => $linkedProducts) { + foreach ($linkedProducts as $linkedProductData) { + $importedProductLinks[$linkType][$linkedProductData->getSku()] = $linkedProductData->getPosition(); + } + } + $this->assertEquals($linksData, $importedProductLinks); + } + + + + /** + * @magentoDataFixture Magento/Catalog/_files/product_without_options.php + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + */ + public function testUpdateUrlRewritesOnImport() + { + $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_category.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'entity' => \Magento\Catalog\Model\Product::ENTITY + ] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + + /** @var \Magento\Catalog\Model\Product $product */ + $product = $this->objectManager->create(\Magento\Catalog\Model\ProductRepository::class)->get('simple'); + $listOfProductUrlKeys = [ + sprintf('%s.html', $product->getUrlKey()), + sprintf('men/tops/%s.html', $product->getUrlKey()), + sprintf('men/%s.html', $product->getUrlKey()) + ]; + $repUrlRewriteCol = $this->objectManager->create( + UrlRewriteCollection::class + ); + + /** @var UrlRewriteCollection $collUrlRewrite */ + $collUrlRewrite = $repUrlRewriteCol->addFieldToSelect(['request_path']) + ->addFieldToFilter('entity_id', ['eq'=> $product->getEntityId()]) + ->addFieldToFilter('entity_type', ['eq'=> 'product']) + ->load(); + $listOfUrlRewriteIds = $collUrlRewrite->getAllIds(); + $this->assertCount(3, $collUrlRewrite); + + foreach ($listOfUrlRewriteIds as $key => $id) { + $this->assertEquals( + $listOfProductUrlKeys[$key], + $collUrlRewrite->getItemById($id)->getRequestPath() + ); + } + } + + + + + /** + * @magentoAppIsolation enabled + */ + public function testProductWithUseConfigSettings() + { + $products = [ + 'simple1' => true, + 'simple2' => true, + 'simple3' => false + ]; + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_use_config_settings.csv', + 'directory' => $directory + ] + ); + + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + foreach ($products as $sku => $manageStockUseConfig) { + /** @var StockRegistry $stockRegistry */ + $stockRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + StockRegistry::class + ); + $stockItem = $stockRegistry->getStockItemBySku($sku); + $this->assertEquals($manageStockUseConfig, $stockItem->getUseConfigManageStock()); + } + } + + + + /** + * @magentoDataFixture Magento/Catalog/_files/multiselect_attribute_with_incorrect_values.php + * @magentoDataFixture Magento/Catalog/_files/product_text_attribute.php + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + */ + public function testProductWithWrappedAdditionalAttributes() + { + $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_additional_attributes.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product', + \Magento\ImportExport\Model\Import::FIELDS_ENCLOSURE => 1 + ] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + + /** @var \Magento\Eav\Api\AttributeOptionManagementInterface $multiselectOptions */ + $multiselectOptions = $this->objectManager->get(\Magento\Eav\Api\AttributeOptionManagementInterface::class) + ->getItems(\Magento\Catalog\Model\Product::ENTITY, 'multiselect_attribute'); + + $product1 = $productRepository->get('simple1'); + $this->assertEquals('\'", =|', $product1->getData('text_attribute')); + $this->assertEquals( + implode(',', [$multiselectOptions[3]->getValue(), $multiselectOptions[2]->getValue()]), + $product1->getData('multiselect_attribute') + ); + + $product2 = $productRepository->get('simple2'); + $this->assertEquals('', $product2->getData('text_attribute')); + $this->assertEquals( + implode(',', [$multiselectOptions[1]->getValue(), $multiselectOptions[2]->getValue()]), + $product2->getData('multiselect_attribute') + ); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_text_attribute.php + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @dataProvider importWithJsonAndMarkupTextAttributeDataProvider + * @param string $productSku + * @param string $expectedResult + * @return void + */ + public function testImportWithJsonAndMarkupTextAttribute(string $productSku, string $expectedResult): void + { + // added by _files/product_import_with_json_and_markup_attributes.csv + $this->importedProducts = [ + 'SkuProductWithJson', + 'SkuProductWithMarkup', + ]; + + $importParameters =[ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product', + \Magento\ImportExport\Model\Import::FIELDS_ENCLOSURE => 0 + ]; + $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_json_and_markup_attributes.csv', + 'directory' => $directory + ] + ); + $this->_model->setParameters($importParameters); + $this->_model->setSource($source); + $errors = $this->_model->validateData(); + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + $product = $productRepository->get($productSku); + $this->assertEquals($expectedResult, $product->getData('text_attribute')); + } + + /** + * @return array + */ + public function importWithJsonAndMarkupTextAttributeDataProvider(): array + { + return [ + 'import of attribute with json' => [ + 'SkuProductWithJson', + '{"type": "basic", "unit": "inch", "sign": "(\")", "size": "1.5\""}' + ], + 'import of attribute with markup' => [ + 'SkuProductWithMarkup', + '<div data-content>Element type is basic, measured in inches ' . + '(marked with sign (\")) with size 1.5\", mid-price range</div>' + ], + ]; + } + + /** + * Test if we can change attribute set for product via import. + * + * @magentoDataFixture Magento/Catalog/_files/attribute_set_with_renamed_group.php + * @magentoDataFixture Magento/Catalog/_files/product_without_options.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDbIsolation enabled + */ + public function testImportDataChangeAttributeSet() + { + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_new_attribute_set.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'entity' => \Magento\Catalog\Model\Product::ENTITY + ] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + + /** @var \Magento\Catalog\Model\Product[] $products */ + $products[] = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Catalog\Model\ProductRepository::class)->get('simple'); + $products[] = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Catalog\Model\ProductRepository::class)->get('simple2'); + + /** @var \Magento\Catalog\Model\Config $catalogConfig */ + $catalogConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Catalog\Model\Config::class); + + /** @var \Magento\Eav\Model\Config $eavConfig */ + $eavConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Eav\Model\Config::class); + + $entityTypeId = (int)$eavConfig->getEntityType(\Magento\Catalog\Model\Product::ENTITY) + ->getId(); + + foreach ($products as $product) { + $attributeSetName = $catalogConfig->getAttributeSetName($entityTypeId, $product->getAttributeSetId()); + $this->assertEquals('attribute_set_test', $attributeSetName); + } + } + + /** + * Test importing products with changed SKU letter case. + */ + public function testImportWithDifferentSkuCase() + { + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + /** @var \Magento\Framework\Api\SearchCriteria $searchCriteria */ + $searchCriteria = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Api\SearchCriteria::class); + + $importedPrices = [ + 'simple1' => 25, + 'simple2' => 34, + 'simple3' => 58, + ]; + $updatedPrices = [ + 'simple1' => 111, + 'simple2' => 222, + 'simple3' => 333, + ]; + + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, + 'entity' => \Magento\Catalog\Model\Product::ENTITY + ] + )->setSource($source)->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + + $this->assertCount( + 3, + $productRepository->getList($searchCriteria)->getItems() + ); + foreach ($importedPrices as $sku => $expectedPrice) { + $this->assertEquals($expectedPrice, $productRepository->get($sku)->getPrice()); + } + + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_changed_sku_case.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, + 'entity' => \Magento\Catalog\Model\Product::ENTITY + ] + )->setSource($source)->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + + $this->assertCount( + 3, + $productRepository->getList($searchCriteria)->getItems(), + 'Ensures that new products were not created' + ); + foreach ($updatedPrices as $sku => $expectedPrice) { + $this->assertEquals( + $expectedPrice, + $productRepository->get($sku, false, null, true)->getPrice(), + 'Check that all products were updated' + ); + } + } + + + + + + /** + * Checks possibility to double importing products using the same import file. + * + * Bunch size is using to test importing the same product that will be chunk to different bunches. + * Example: + * - first bunch + * product-sku,default-store + * product-sku,second-store + * - second bunch + * product-sku,third-store + * + * @magentoDbIsolation disabled + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Store/_files/second_store.php + */ + public function testCheckDoubleImportOfProducts() + { + $this->importedProducts = [ + 'simple1', + 'simple2', + 'simple3', + ]; + + /** @var SearchCriteria $searchCriteria */ + $searchCriteria = $this->searchCriteriaBuilder->create(); + + $this->assertTrue($this->importFile('products_with_two_store_views.csv', 2)); + $productsAfterFirstImport = $this->productRepository->getList($searchCriteria)->getItems(); + $this->assertCount(3, $productsAfterFirstImport); + + $this->assertTrue($this->importFile('products_with_two_store_views.csv', 2)); + $productsAfterSecondImport = $this->productRepository->getList($searchCriteria)->getItems(); + $this->assertCount(3, $productsAfterSecondImport); + } + + /** + * Checks that product related links added for all bunches properly after products import + */ + public function testImportProductsWithLinksInDifferentBunches() + { + $this->importedProducts = [ + 'simple1', + 'simple2', + 'simple3', + 'simple4', + 'simple5', + 'simple6', + ]; + $importExportData = $this->getMockBuilder(Data::class) + ->disableOriginalConstructor() + ->getMock(); + $importExportData->expects($this->atLeastOnce()) + ->method('getBunchSize') + ->willReturn(5); + $this->_model = $this->objectManager->create( + \Magento\CatalogImportExport\Model\Import\Product::class, + ['importExportData' => $importExportData] + ); + $linksData = [ + 'related' => [ + 'simple1' => '2', + 'simple2' => '1' + ] + ]; + $pathToFile = __DIR__ . '/../_files/products_to_import_with_related.csv'; + $filesystem = $this->objectManager->create(Filesystem::class); + + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + Csv::class, + [ + 'file' => $pathToFile, + 'directory' => $directory + ] + ); + $errors = $this->_model->setSource($source) + ->setParameters( + [ + 'behavior' => Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product' + ] + ) + ->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + $resource = $this->objectManager->get(ProductResource::class); + $productId = $resource->getIdBySku('simple6'); + /** @var Product $product */ + $product = $this->objectManager->create(Product::class); + $product->load($productId); + $productLinks = [ + 'related' => $product->getRelatedProducts() + ]; + $importedProductLinks = []; + foreach ($productLinks as $linkType => $linkedProducts) { + foreach ($linkedProducts as $linkedProductData) { + $importedProductLinks[$linkType][$linkedProductData->getSku()] = $linkedProductData->getPosition(); + } + } + $this->assertEquals($linksData, $importedProductLinks); + } + + /** + * Test that product tax classes "none", "0" are imported correctly + * + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoAppIsolation enabled + */ + public function testImportProductWithTaxClassNone(): void + { + $pathToFile = __DIR__ . '/../_files/product_tax_class_none_import.csv'; + $importModel = $this->createImportModel($pathToFile); + $this->assertErrorsCount(0, $importModel->validateData()); + $importModel->importData(); + $simpleProduct = $this->getProductBySku('simple'); + $this->assertSame('0', (string) $simpleProduct->getTaxClassId()); + $simpleProduct = $this->getProductBySku('simple2'); + $this->assertSame('0', (string) $simpleProduct->getTaxClassId()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductStockTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductStockTest.php new file mode 100644 index 0000000000000..a151241d46d13 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductStockTest.php @@ -0,0 +1,255 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Import\ProductTest; + +use Magento\CatalogImportExport\Model\Import\ProductTestBase; +use Magento\CatalogInventory\Model\Stock; +use Magento\CatalogInventory\Model\StockRegistry; +use Magento\CatalogInventory\Model\StockRegistryStorage; +use Magento\Framework\App\Filesystem\DirectoryList; + +/** + * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. + * + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @magentoAppArea adminhtml + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php + */ +class ProductStockTest extends ProductTestBase +{ + /** + * Test if stock item quantity properly saved after import + * + * @magentoDataFixture Magento/Catalog/_files/multiple_products.php + * @magentoAppIsolation enabled + */ + public function testSaveStockItemQty() + { + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + $id1 = $productRepository->get('simple1')->getId(); + $id2 = $productRepository->get('simple2')->getId(); + $id3 = $productRepository->get('simple3')->getId(); + $existingProductIds = [$id1, $id2, $id3]; + $stockItems = []; + foreach ($existingProductIds as $productId) { + /** @var $stockRegistry StockRegistry */ + $stockRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + StockRegistry::class + ); + + $stockItem = $stockRegistry->getStockItem($productId, 1); + $stockItems[$productId] = $stockItem; + } + + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + + /** @var $stockItmBeforeImport \Magento\CatalogInventory\Model\Stock\Item */ + foreach ($stockItems as $productId => $stockItmBeforeImport) { + /** @var $stockRegistry StockRegistry */ + $stockRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + StockRegistry::class + ); + + $stockItemAfterImport = $stockRegistry->getStockItem($productId, 1); + + $this->assertEquals($stockItmBeforeImport->getQty(), $stockItemAfterImport->getQty()); + $this->assertEquals(1, $stockItemAfterImport->getIsInStock()); + unset($stockItemAfterImport); + } + + unset($stockItems, $stockItem); + } + + /** + * Test that is_in_stock set to 0 when item quantity is 0 + * + * @magentoDataFixture Magento/Catalog/_files/multiple_products.php + * @magentoAppIsolation enabled + * + * @return void + */ + public function testSaveIsInStockByZeroQty(): void + { + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + $id1 = $productRepository->get('simple1')->getId(); + $id2 = $productRepository->get('simple2')->getId(); + $id3 = $productRepository->get('simple3')->getId(); + $existingProductIds = [$id1, $id2, $id3]; + + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_zero_qty.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + + /** @var $stockItmBeforeImport \Magento\CatalogInventory\Model\Stock\Item */ + foreach ($existingProductIds as $productId) { + /** @var $stockRegistry StockRegistry */ + $stockRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + StockRegistry::class + ); + + $stockItemAfterImport = $stockRegistry->getStockItem($productId, 1); + + $this->assertEquals(0, $stockItemAfterImport->getIsInStock()); + unset($stockItemAfterImport); + } + } + + /** + * Test if stock state properly changed after import + * + * @magentoDataFixture Magento/Catalog/_files/multiple_products.php + * @magentoAppIsolation enabled + */ + public function testStockState() + { + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_qty.csv', + 'directory' => $directory + ] + ); + + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + } + + /** + * Test that imported product stock status with backorders functionality enabled can be set to 'out of stock'. + * + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * + * @return void + */ + public function testImportWithBackordersEnabled(): void + { + $this->importFile('products_to_import_with_backorders_enabled_and_0_qty.csv'); + $product = $this->getProductBySku('simple_new'); + $this->assertFalse($product->getDataByKey('quantity_and_stock_status')['is_in_stock']); + } + + /** + * Test that imported product stock status with stock quantity > 0 and backorders functionality disabled + * can be set to 'out of stock'. + * + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + */ + public function testImportWithBackordersDisabled(): void + { + $this->importFile('products_to_import_with_backorders_disabled_and_not_0_qty.csv'); + $product = $this->getProductBySku('simple_new'); + $this->assertFalse($product->getDataByKey('quantity_and_stock_status')['is_in_stock']); + } + + /** + * Test that product stock status is updated after import + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + */ + public function testProductStockStatusShouldBeUpdated() + { + /** @var $stockRegistry StockRegistry */ + $stockRegistry = $this->objectManager->create(StockRegistry::class); + /** @var StockRegistryStorage $stockRegistryStorage */ + $stockRegistryStorage = $this->objectManager->get(StockRegistryStorage::class); + $status = $stockRegistry->getStockStatusBySku('simple'); + $this->assertEquals(Stock::STOCK_IN_STOCK, $status->getStockStatus()); + $this->importDataForMediaTest('disable_product.csv'); + $stockRegistryStorage->clean(); + $status = $stockRegistry->getStockStatusBySku('simple'); + $this->assertEquals(Stock::STOCK_OUT_OF_STOCK, $status->getStockStatus()); + $this->importDataForMediaTest('enable_product.csv'); + $stockRegistryStorage->clean(); + $status = $stockRegistry->getStockStatusBySku('simple'); + $this->assertEquals(Stock::STOCK_IN_STOCK, $status->getStockStatus()); + } + + /** + * Test that product stock status is updated after import on schedule + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + * @magentoDataFixture Magento/CatalogImportExport/_files/cataloginventory_stock_item_update_by_schedule.php + * @magentoDbIsolation disabled + */ + public function testProductStockStatusShouldBeUpdatedOnSchedule() + { + /** * @var $indexProcessor \Magento\Indexer\Model\Processor */ + $indexProcessor = $this->objectManager->create(\Magento\Indexer\Model\Processor::class); + /** @var $stockRegistry StockRegistry */ + $stockRegistry = $this->objectManager->create(StockRegistry::class); + /** @var StockRegistryStorage $stockRegistryStorage */ + $stockRegistryStorage = $this->objectManager->get(StockRegistryStorage::class); + $status = $stockRegistry->getStockStatusBySku('simple'); + $this->assertEquals(Stock::STOCK_IN_STOCK, $status->getStockStatus()); + $this->importDataForMediaTest('disable_product.csv'); + $indexProcessor->updateMview(); + $stockRegistryStorage->clean(); + $status = $stockRegistry->getStockStatusBySku('simple'); + $this->assertEquals(Stock::STOCK_OUT_OF_STOCK, $status->getStockStatus()); + $this->importDataForMediaTest('enable_product.csv'); + $indexProcessor->updateMview(); + $stockRegistryStorage->clean(); + $status = $stockRegistry->getStockStatusBySku('simple'); + $this->assertEquals(Stock::STOCK_IN_STOCK, $status->getStockStatus()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductUrlKeyTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductUrlKeyTest.php new file mode 100644 index 0000000000000..9e499cfb3a400 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductUrlKeyTest.php @@ -0,0 +1,365 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Import\ProductTest; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface; +use Magento\CatalogImportExport\Model\Import\ProductTestBase; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; +use Magento\ImportExport\Model\Import; +use Magento\ImportExport\Model\Import\Source\Csv; + +/** + * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. + * + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @magentoAppArea adminhtml + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php + */ +class ProductUrlKeyTest extends ProductTestBase +{ + /** + * Make sure the absence of a url_key column in the csv file won't erase the url key of the existing products. + * To reach the goal we need to not send the name column, as the url key is generated from it. + * + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + */ + public function testImportWithoutUrlKeysAndName() + { + $products = [ + 'simple1' => 'url-key', + 'simple2' => 'url-key2', + ]; + $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_without_url_keys_and_name.csv', + 'directory' => $directory + ] + ); + + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + ) + ->setSource($source) + ->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + $productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); + foreach ($products as $productSku => $productUrlKey) { + $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); + } + } + + /** + * @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php + * @magentoAppIsolation enabled + * @dataProvider validateUrlKeysDataProvider + * @param $importFile string + * @param $expectedErrors array + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function testValidateUrlKeys($importFile, $expectedErrors) + { + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Framework\Filesystem::class + ); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/' . $importFile, + 'directory' => $directory + ] + ); + /** @var \Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface $errors */ + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + $this->assertEquals( + $expectedErrors[RowValidatorInterface::ERROR_DUPLICATE_URL_KEY], + count($errors->getErrorsByCode([RowValidatorInterface::ERROR_DUPLICATE_URL_KEY])) + ); + } + + /** + * @return array + */ + public function validateUrlKeysDataProvider() + { + return [ + [ + 'products_to_check_valid_url_keys.csv', + [ + RowValidatorInterface::ERROR_DUPLICATE_URL_KEY => 0 + ] + ], + [ + 'products_to_check_valid_url_keys_with_different_language.csv', + [ + RowValidatorInterface::ERROR_DUPLICATE_URL_KEY => 0 + ] + ], + [ + 'products_to_check_duplicated_url_keys.csv', + [ + RowValidatorInterface::ERROR_DUPLICATE_URL_KEY => 2 + ] + ], + [ + 'products_to_check_duplicated_names.csv' , + [ + RowValidatorInterface::ERROR_DUPLICATE_URL_KEY => 1 + ] + ] + ]; + } + + /** + * @magentoDataFixture Magento/Store/_files/website.php + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + */ + public function testValidateUrlKeysMultipleStores() + { + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Framework\Filesystem::class + ); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_check_valid_url_keys_multiple_stores.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + */ + public function testExistingProductWithUrlKeys() + { + $products = [ + 'simple1' => 'url-key1', + 'simple2' => 'url-key2', + 'simple3' => 'url-key3' + ]; + // added by _files/products_to_import_with_valid_url_keys.csv + $this->importedProducts[] = 'simple3'; + + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_valid_url_keys.csv', + 'directory' => $directory + ] + ); + + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + foreach ($products as $productSku => $productUrlKey) { + $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); + } + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_wrong_url_key.php + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + */ + public function testAddUpdateProductWithInvalidUrlKeys() : void + { + $products = [ + 'simple1' => 'cuvée merlot-cabernet igp pays d\'oc frankrijk', + 'simple2' => 'normal-url', + 'simple3' => 'some!wrong\'url' + ]; + // added by _files/products_to_import_with_invalid_url_keys.csv + $this->importedProducts[] = 'simple3'; + + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_invalid_url_keys.csv', + 'directory' => $directory + ] + ); + + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + foreach ($products as $productSku => $productUrlKey) { + $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); + } + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + */ + public function testImportWithoutChangingUrlKeys() + { + $filesystem = $this->objectManager->create(Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_without_url_key_column.csv', + 'directory' => $directory + ] + ); + + $errors = $this->_model->setParameters( + ['behavior' => Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + ) + ->setSource($source) + ->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $this->assertEquals('url-key', $productRepository->get('simple1')->getUrlKey()); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + */ + public function testImportWithoutUrlKeys() + { + $products = [ + 'simple1' => 'simple-1', + 'simple2' => 'simple-2', + 'simple3' => 'simple-3' + ]; + // added by _files/products_to_import_without_url_keys.csv + $this->importedProducts[] = 'simple3'; + + $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_without_url_keys.csv', + 'directory' => $directory + ] + ); + + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + ) + ->setSource($source) + ->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + $productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); + foreach ($products as $productSku => $productUrlKey) { + $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); + } + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_non_latin_url_key.php + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + * @return void + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function testImportWithNonLatinUrlKeys() + { + $productsCreatedByFixture = [ + 'ukrainian-with-url-key' => 'nove-im-ja-pislja-importu-scho-stane-url-key', + 'ukrainian-without-url-key' => 'новий url key після імпорту', + ]; + $productsImportedByCsv = [ + 'imported-ukrainian-with-url-key' => 'імпортований продукт', + 'imported-ukrainian-without-url-key' => 'importovanij-produkt-bez-url-key', + ]; + $productSkuMap = array_merge($productsCreatedByFixture, $productsImportedByCsv); + $this->importedProducts = array_keys($productsImportedByCsv); + + $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import_with_non_latin_url_keys.csv', + 'directory' => $directory, + ] + ); + + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE, 'entity' => 'catalog_product'] + ) + ->setSource($source) + ->validateData(); + + $this->assertEquals($errors->getErrorsCount(), 0); + $this->_model->importData(); + + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + foreach ($productSkuMap as $productSku => $productUrlKey) { + $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); + } + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductValidationTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductValidationTest.php new file mode 100644 index 0000000000000..8b3363de307d8 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductValidationTest.php @@ -0,0 +1,384 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Import\ProductTest; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\Product as ProductResource; +use Magento\CatalogImportExport\Model\Import\Product as ImportProduct; +use Magento\CatalogImportExport\Model\Import\ProductTestBase; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; +use Magento\ImportExport\Model\Import; +use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; +use Magento\ImportExport\Model\Import\Source\Csv; +use Magento\TestFramework\Helper\Bootstrap as BootstrapHelper; + +/** + * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. + * + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @magentoAppArea adminhtml + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php + */ +class ProductValidationTest extends ProductTestBase +{ + /** + * @magentoDataFixture Magento/Catalog/_files/products_with_multiselect_attribute.php + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + */ + public function testValidateInvalidMultiselectValues() + { + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Framework\Filesystem::class + ); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_with_invalid_multiselect_values.csv', + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 1); + $this->assertEquals( + "Value for 'multiselect_attribute' attribute contains incorrect value, " + . "see acceptable values on settings specified for Admin", + $errors->getErrorByRowNumber(1)[0]->getErrorMessage() + ); + } + + /** + * @param array $row + * @param string|null $behavior + * @param bool $expectedResult + * @magentoAppArea adminhtml + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/Model/ResourceModel/_files/product_simple.php + * @dataProvider validateRowDataProvider + */ + public function testValidateRow(array $row, $behavior, $expectedResult) + { + $this->_model->setParameters(['behavior' => $behavior, 'entity' => 'catalog_product']); + $this->assertSame($expectedResult, $this->_model->validateRow($row, 1)); + } + + /** + * @return array + */ + public function validateRowDataProvider() + { + return [ + [ + 'row' => ['sku' => 'simple products'], + 'behavior' => null, + 'expectedResult' => true, + ], + [ + 'row' => ['sku' => 'simple products absent'], + 'behavior' => null, + 'expectedResult' => false, + ], + [ + 'row' => [ + 'sku' => 'simple products absent', + 'name' => 'Test', + 'product_type' => 'simple', + '_attribute_set' => 'Default', + 'price' => 10.20, + ], + 'behavior' => null, + 'expectedResult' => true, + ], + [ + 'row' => ['sku' => 'simple products'], + 'behavior' => Import::BEHAVIOR_ADD_UPDATE, + 'expectedResult' => true, + ], + [ + 'row' => ['sku' => 'simple products absent'], + 'behavior' => Import::BEHAVIOR_ADD_UPDATE, + 'expectedResult' => false, + ], + [ + 'row' => [ + 'sku' => 'simple products absent', + 'name' => 'Test', + 'product_type' => 'simple', + '_attribute_set' => 'Default', + 'price' => 10.20, + ], + 'behavior' => Import::BEHAVIOR_ADD_UPDATE, + 'expectedResult' => true, + ], + [ + 'row' => ['sku' => 'simple products'], + 'behavior' => Import::BEHAVIOR_DELETE, + 'expectedResult' => true, + ], + [ + 'row' => ['sku' => 'simple products absent'], + 'behavior' => Import::BEHAVIOR_DELETE, + 'expectedResult' => false, + ], + [ + 'row' => ['sku' => 'simple products'], + 'behavior' => Import::BEHAVIOR_REPLACE, + 'expectedResult' => false, + ], + [ + 'row' => ['sku' => 'simple products absent'], + 'behavior' => Import::BEHAVIOR_REPLACE, + 'expectedResult' => false, + ], + [ + 'row' => [ + 'sku' => 'simple products absent', + 'name' => 'Test', + 'product_type' => 'simple', + '_attribute_set' => 'Default', + 'price' => 10.20, + ], + 'behavior' => Import::BEHAVIOR_REPLACE, + 'expectedResult' => false, + ], + [ + 'row' => [ + 'sku' => 'simple products', + 'name' => 'Test', + 'product_type' => 'simple', + '_attribute_set' => 'Default', + 'price' => 10.20, + ], + 'behavior' => Import::BEHAVIOR_REPLACE, + 'expectedResult' => true, + ], + [ + 'row' => ['sku' => 'sku with whitespace ', + 'name' => 'Test', + 'product_type' => 'simple', + '_attribute_set' => 'Default', + 'price' => 10.20, + ], + 'behavior' => Import::BEHAVIOR_ADD_UPDATE, + 'expectedResult' => false, + ], + ]; + } + + /** + * @covers \Magento\ImportExport\Model\Import\Entity\AbstractEntity::_saveValidatedBunches + */ + public function testValidateData() + { + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/../_files/products_to_import.csv', + 'directory' => $directory + ] + ); + + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + )->setSource($source)->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + } + + /** + * Test import product with product links and empty value + * + * @param string $pathToFile + * @param bool $expectedResultCrossell + * @param bool $expectedResultUpsell + * + * @magentoDataFixture Magento/CatalogImportExport/_files/product_export_with_product_links_data.php + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + * @magentoAppIsolation enabled + * @dataProvider getEmptyLinkedData + */ + public function testProductLinksWithEmptyValue( + string $pathToFile, + bool $expectedResultCrossell, + bool $expectedResultUpsell + ): void { + $filesystem = BootstrapHelper::getObjectManager()->create(Filesystem::class); + + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + Csv::class, + [ + 'file' => $pathToFile, + 'directory' => $directory + ] + ); + $errors = $this->_model->setSource( + $source + )->setParameters( + [ + 'behavior' => Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product' + ] + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + $objectManager = BootstrapHelper::getObjectManager(); + $resource = $objectManager->get(ProductResource::class); + $productId = $resource->getIdBySku('simple'); + /** @var \Magento\Catalog\Model\Product $product */ + $product = BootstrapHelper::getObjectManager()->create(Product::class); + $product->load($productId); + + $this->assertEquals(empty($product->getCrossSellProducts()), $expectedResultCrossell); + $this->assertEquals(empty($product->getUpSellProducts()), $expectedResultUpsell); + } + + /** + * Get data for empty linked product + * + * @return array[] + */ + public function getEmptyLinkedData(): array + { + return [ + [ + __DIR__ . '/../_files/products_to_import_with_product_links_with_empty_value.csv', + true, + true, + ], + [ + __DIR__ . '/../_files/products_to_import_with_product_links_with_empty_data.csv', + false, + true, + ], + ]; + } + + /** + * Tests that empty attribute value in the CSV file will be ignored after update a product by the import. + * + * @magentoDataFixture Magento/Catalog/_files/product_with_varchar_attribute.php + */ + public function testEmptyAttributeValueShouldBeIgnoredAfterUpdateProductByImport() + { + $pathToFile = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR + . 'import_product_with_empty_attribute_value.csv'; + /** @var ImportProduct $importModel */ + $importModel = $this->createImportModel($pathToFile); + /** @var ProcessingErrorAggregatorInterface $errors */ + $errors = $importModel->validateData(); + $this->assertTrue($errors->getErrorsCount() === 0, 'Import file validation failed.'); + $importModel->importData(); + + $simpleProduct = $this->productRepository->get('simple', false, null, true); + $this->assertEquals('Varchar default value', $simpleProduct->getData('varchar_attribute')); + $this->assertEquals('Short description', $simpleProduct->getData('short_description')); + } + + /** + * Tests that no products imported if source file contains errors + * + * In this case, the second product data has an invalid attribute set. + * + * @magentoDbIsolation enabled + */ + public function testInvalidSkuLink() + { + // import data from CSV file + $pathToFile = __DIR__ . '/../_files/products_to_import_invalid_attribute_set.csv'; + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Framework\Filesystem::class + ); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => $pathToFile, + 'directory' => $directory + ] + ); + $errors = $this->_model->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + Import::FIELD_NAME_VALIDATION_STRATEGY => null, + 'entity' => 'catalog_product' + ] + )->setSource( + $source + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 1); + $this->assertEquals( + 'Invalid value for Attribute Set column (set doesn\'t exist?)', + $errors->getErrorByRowNumber(1)[0]->getErrorMessage() + ); + $this->_model->importData(); + + $productCollection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Model\ResourceModel\Product\Collection::class + ); + + $products = []; + /** @var $product \Magento\Catalog\Model\Product */ + foreach ($productCollection as $product) { + $products[$product->getSku()] = $product; + } + $this->assertArrayNotHasKey("simple1", $products, "Simple Product should not have been imported"); + $this->assertArrayNotHasKey("simple3", $products, "Simple Product 3 should not have been imported"); + $this->assertArrayNotHasKey("simple2", $products, "Simple Product2 should not have been imported"); + } + + /** + * @magentoDbIsolation enabled + */ + public function testProductWithInvalidWeight() + { + // import data from CSV file + $pathToFile = __DIR__ . '/../_files/product_to_import_invalid_weight.csv'; + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Framework\Filesystem::class + ); + + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => $pathToFile, + 'directory' => $directory + ] + ); + $errors = $this->_model->setSource( + $source + )->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND] + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 1); + $this->assertEquals( + "Value for 'weight' attribute contains incorrect value", + $errors->getErrorByRowNumber(1)[0]->getErrorMessage() + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTestBase.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTestBase.php new file mode 100644 index 0000000000000..d978c913cd483 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTestBase.php @@ -0,0 +1,463 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogImportExport\Model\Import; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Category; +use Magento\CatalogImportExport\Model\Import\Product as ImportProduct; +use Magento\Framework\Api\SearchCriteriaBuilder; +use Magento\Framework\App\Bootstrap; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Filesystem; +use Magento\Framework\Registry; +use Magento\ImportExport\Helper\Data; +use Magento\ImportExport\Model\Import; +use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; +use Magento\ImportExport\Model\Import\Source\Csv; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Indexer\TestCase; +use Psr\Log\LoggerInterface; + +/** + * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. + * + * @magentoAppIsolation enabled + * @magentoDbIsolation enabled + * @magentoAppArea adminhtml + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php + * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) + * @SuppressWarnings(PHPMD.ExcessivePublicCount) + * phpcs:disable Generic.PHP.NoSilencedErrors, Generic.Metrics.NestingLevel, Magento2.Functions.StaticFunction + */ +class ProductTestBase extends TestCase +{ + protected const LONG_FILE_NAME_IMAGE = 'magento_long_image_name_magento_long_image_name_magento_long_image_name.jpg'; + + /** + * @var array + */ + protected $importedProducts; + + /** + * @var \Magento\CatalogImportExport\Model\Import\Product + */ + protected $_model; + + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + protected $objectManager; + + /** + * @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject + */ + protected $logger; + + /** + * @var SearchCriteriaBuilder + */ + protected $searchCriteriaBuilder; + + /** + * @var ProductRepositoryInterface + */ + protected $productRepository; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->logger = $this->getMockBuilder(LoggerInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\CatalogImportExport\Model\Import\Product::class, + ['logger' => $this->logger] + ); + $this->importedProducts = []; + $this->searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + + parent::setUp(); + } + + /** + * @inheriDoc + */ + protected function tearDown(): void + { + /* We rollback here the products created during the Import because they were + created during test execution and we do not have the rollback for them */ + foreach ($this->importedProducts as $productSku) { + try { + $product = $this->productRepository->get($productSku, false, null, true); + $this->productRepository->delete($product); + // phpcs:disable Magento2.CodeAnalysis.EmptyBlock.DetectedCatch + } catch (NoSuchEntityException $e) { + // nothing to delete + } + } + } + + + /** + * @param string $pathToFile + * @param string $behavior + * @return \Magento\CatalogImportExport\Model\Import\Product + */ + protected function createImportModel($pathToFile, $behavior = \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND) + { + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + + /** @var \Magento\ImportExport\Model\Import\Source\Csv $source */ + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => $pathToFile, + 'directory' => $directory + ] + ); + + /** @var \Magento\CatalogImportExport\Model\Import\Product $importModel */ + $importModel = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\CatalogImportExport\Model\Import\Product::class + ); + $importModel->setParameters(['behavior' => $behavior, 'entity' => 'catalog_product'])->setSource($source); + + return $importModel; + } + + /** + * Copy fixture images into media import directory + */ + public static function mediaImportImageFixture() + { + /** @var \Magento\Framework\Filesystem\Directory\Write $varDirectory */ + $varDirectory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + \Magento\Framework\Filesystem::class + )->getDirectoryWrite( + DirectoryList::VAR_DIR + ); + + $varDirectory->create('import' . DIRECTORY_SEPARATOR . 'images'); + $dirPath = $varDirectory->getAbsolutePath('import' . DIRECTORY_SEPARATOR . 'images'); + + $items = [ + [ + 'source' => __DIR__ . '/../../../../Magento/Catalog/_files/magento_image.jpg', + 'dest' => $dirPath . '/magento_image.jpg', + ], + [ + 'source' => __DIR__ . '/../../../../Magento/Catalog/_files/magento_small_image.jpg', + 'dest' => $dirPath . '/magento_small_image.jpg', + ], + [ + 'source' => __DIR__ . '/../../../../Magento/Catalog/_files/magento_thumbnail.jpg', + 'dest' => $dirPath . '/magento_thumbnail.jpg', + ], + [ + 'source' => __DIR__ . '/../../../../Magento/Catalog/_files/' . self::LONG_FILE_NAME_IMAGE, + 'dest' => $dirPath . '/' . self::LONG_FILE_NAME_IMAGE, + ], + [ + 'source' => __DIR__ . '/_files/magento_additional_image_one.jpg', + 'dest' => $dirPath . '/magento_additional_image_one.jpg', + ], + [ + 'source' => __DIR__ . '/_files/magento_additional_image_two.jpg', + 'dest' => $dirPath . '/magento_additional_image_two.jpg', + ], + [ + 'source' => __DIR__ . '/_files/magento_additional_image_three.jpg', + 'dest' => $dirPath . '/magento_additional_image_three.jpg', + ], + [ + 'source' => __DIR__ . '/_files/magento_additional_image_four.jpg', + 'dest' => $dirPath . '/magento_additional_image_four.jpg', + ], + ]; + + foreach ($items as $item) { + copy($item['source'], $item['dest']); + } + } + + /** + * Cleanup media import and catalog directories + */ + public static function mediaImportImageFixtureRollback() + { + $fileSystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + \Magento\Framework\Filesystem::class + ); + /** @var \Magento\Framework\Filesystem\Directory\Write $mediaDirectory */ + $mediaDirectory = $fileSystem->getDirectoryWrite(DirectoryList::MEDIA); + + /** @var \Magento\Framework\Filesystem\Directory\Write $varDirectory */ + $varDirectory = $fileSystem->getDirectoryWrite(DirectoryList::VAR_DIR); + $varDirectory->delete('import'); + $mediaDirectory->delete('catalog'); + } + + /** + * Copy incorrect fixture image into media import directory. + */ + public static function mediaImportImageFixtureError() + { + /** @var \Magento\Framework\Filesystem\Directory\Write $varDirectory */ + $varDirectory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + \Magento\Framework\Filesystem::class + )->getDirectoryWrite( + DirectoryList::VAR_DIR + ); + $dirPath = $varDirectory->getAbsolutePath('import' . DIRECTORY_SEPARATOR . 'images'); + $items = [ + [ + 'source' => __DIR__ . '/_files/magento_additional_image_error.jpg', + 'dest' => $dirPath . '/magento_additional_image_two.jpg', + ], + ]; + foreach ($items as $item) { + copy($item['source'], $item['dest']); + } + } + + /** + * Export CSV string to array + * + * @param string $content + * @param mixed $entityId + * @return array + */ + protected function csvToArray($content, $entityId = null) + { + $data = ['header' => [], 'data' => []]; + + $lines = str_getcsv($content, "\n"); + foreach ($lines as $index => $line) { + if ($index == 0) { + $data['header'] = str_getcsv($line); + } else { + $row = array_combine($data['header'], str_getcsv($line)); + if ($entityId !== null && !empty($row[$entityId])) { + $data['data'][$row[$entityId]] = $row; + } else { + $data['data'][] = $row; + } + } + } + return $data; + } + + /** + * Import and check data from file. + * + * @param string $fileName + * @param int $expectedErrors + * @return void + */ + protected function importDataForMediaTest(string $fileName, int $expectedErrors = 0) + { + $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/_files/' . $fileName, + 'directory' => $directory + ] + ); + $this->_model->setParameters( + [ + 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product', + 'import_images_file_dir' => 'pub/media/import' + ] + ); + $appParams = \Magento\TestFramework\Helper\Bootstrap::getInstance() + ->getBootstrap() + ->getApplication() + ->getInitParams()[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS]; + $uploader = $this->_model->getUploader(); + + $mediaPath = $appParams[DirectoryList::MEDIA][DirectoryList::PATH]; + $varPath = $appParams[DirectoryList::VAR_DIR][DirectoryList::PATH]; + $destDir = $directory->getRelativePath( + $mediaPath . DIRECTORY_SEPARATOR . 'catalog' . DIRECTORY_SEPARATOR . 'product' + ); + $tmpDir = $directory->getRelativePath( + $varPath . DIRECTORY_SEPARATOR . 'import' . DIRECTORY_SEPARATOR . 'images' + ); + + $directory->create($destDir); + $this->assertTrue($uploader->setDestDir($destDir)); + $this->assertTrue($uploader->setTmpDir($tmpDir)); + $errors = $this->_model->setSource( + $source + )->validateData(); + $this->assertTrue($errors->getErrorsCount() == 0); + + $this->_model->importData(); + $this->assertEquals( + $expectedErrors, + $this->_model->getErrorAggregator()->getErrorsCount(), + array_reduce( + $this->_model->getErrorAggregator()->getAllErrors(), + function ($output, $error) { + return "$output\n{$error->getErrorMessage()}"; + }, + '' + ) + ); + } + + /** + * Load product by given product sku + * + * @param string $sku + * @param mixed $store + * @return \Magento\Catalog\Model\Product + */ + protected function getProductBySku($sku, $store = null) + { + $resource = $this->objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); + $productId = $resource->getIdBySku($sku); + $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class); + if ($store) { + /** @var StoreManagerInterface $storeManager */ + $storeManager = $this->objectManager->get(StoreManagerInterface::class); + $store = $storeManager->getStore($store); + $product->setStoreId($store->getId()); + } + $product->load($productId); + + return $product; + } + + /** + * Import file by providing import filename and bunch size. + * + * @param string $fileName + * @param int $bunchSize + * @return bool + */ + protected function importFile(string $fileName, int $bunchSize = 100): bool + { + $importExportData = $this->getMockBuilder(Data::class) + ->disableOriginalConstructor() + ->getMock(); + $importExportData->expects($this->atLeastOnce()) + ->method('getBunchSize') + ->willReturn($bunchSize); + $this->_model = $this->objectManager->create( + ImportProduct::class, + ['importExportData' => $importExportData] + ); + $filesystem = $this->objectManager->create(Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + Csv::class, + [ + 'file' => __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . $fileName, + 'directory' => $directory, + ] + ); + $errors = $this->_model->setParameters( + [ + 'behavior' => Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product', + Import::FIELDS_ENCLOSURE => 1, + ] + ) + ->setSource($source) + ->validateData(); + + $this->assertTrue($errors->getErrorsCount() === 0); + + return $this->_model->importData(); + } + + /** + * Set the current admin session user based on a username + * + * @param string $username + */ + protected function loginAdminUserWithUsername(string $username) + { + $user = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\User\Model\User::class + )->loadByUsername($username); + + /** @var $session \Magento\Backend\Model\Auth\Session */ + $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + \Magento\Backend\Model\Auth\Session::class + ); + $session->setUser($user); + } + + /** + * Check product request path considering store scope. + * + * @param string $storeCode + * @param string $expected + * @return void + */ + protected function assertProductRequestPath($storeCode, $expected) + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var Store $storeCode */ + $store = $objectManager->get(Store::class); + $storeId = $store->load($storeCode)->getId(); + + /** @var Category $category */ + $category = $objectManager->get(Category::class); + $category->setStoreId($storeId); + $category->load(555); + + /** @var Registry $registry */ + $registry = $objectManager->get(Registry::class); + $registry->register('current_category', $category); + + /** @var \Magento\Catalog\Model\Product $product */ + $product = $objectManager->create(\Magento\Catalog\Model\Product::class); + $id = $product->getIdBySku('product'); + $product->setStoreId($storeId); + $product->load($id); + $product->getProductUrl(); + self::assertEquals($expected, $product->getRequestPath()); + $registry->unregister('current_category'); + } + + /** + * @param int $count + * @param ProcessingErrorAggregatorInterface $errors + */ + protected function assertErrorsCount(int $count, ProcessingErrorAggregatorInterface $errors): void + { + $this->assertEquals( + $count, + $errors->getErrorsCount(), + array_reduce( + $errors->getAllErrors(), + function ($output, $error) { + return "$output\n{$error->getErrorMessage()}"; + }, + '' + ) + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_tax_class_none_import.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_tax_class_none_import.csv new file mode 100644 index 0000000000000..a53a9ef043ba2 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_tax_class_none_import.csv @@ -0,0 +1,3 @@ +"sku","tax_class_name" +"simple","none" +"simple2","0" diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/export_queue_product_with_images.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/export_queue_product_with_images.php new file mode 100644 index 0000000000000..24e24b6aa4542 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/export_queue_product_with_images.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Framework\MessageQueue\PublisherInterface; +use Magento\ImportExport\Model\Export\Entity\ExportInfoFactory; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_with_image.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var ExportInfoFactory $exportInfoFactory */ +$exportInfoFactory = $objectManager->get(ExportInfoFactory::class); +/** @var PublisherInterface $messagePublisher */ +$messagePublisher = $objectManager->get(PublisherInterface::class); +$dataObject = $exportInfoFactory->create( + 'csv', + ProductAttributeInterface::ENTITY_TYPE_CODE, + [ProductInterface::SKU => 'simple'], + [] +); +$messagePublisher->publish('import_export.export', $dataObject); diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/export_queue_product_with_images_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/export_queue_product_with_images_rollback.php new file mode 100644 index 0000000000000..07bab53b7015b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/export_queue_product_with_images_rollback.php @@ -0,0 +1,17 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\MysqlMq\DeleteTopicRelatedMessages; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +$objectManager = Bootstrap::getObjectManager(); +/** @var DeleteTopicRelatedMessages $deleteTopicRelatedMessages */ +$deleteTopicRelatedMessages = $objectManager->get(DeleteTopicRelatedMessages::class); +$deleteTopicRelatedMessages->execute('import_export.export'); + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_with_image_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/CatalogRuleRepositoryTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/CatalogRuleRepositoryTest.php new file mode 100644 index 0000000000000..59cd0a281d705 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/CatalogRuleRepositoryTest.php @@ -0,0 +1,77 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogRule\Model; + +use Magento\CatalogRule\Api\CatalogRuleRepositoryInterface; +use Magento\CatalogRule\Api\Data\RuleInterface; +use Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor; +use Magento\CatalogRule\Model\ResourceModel\RuleFactory as ResourceRuleFactory; +use Magento\Framework\Indexer\StateInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Covers with test catalog rule repository functionality. + */ +class CatalogRuleRepositoryTest extends TestCase +{ + /** + * @var CatalogRuleRepositoryInterface + */ + private $catalogRuleRepository; + + /** + * @inheridoc + */ + protected function setUp(): void + { + $this->catalogRuleRepository = Bootstrap::getObjectManager()->get(CatalogRuleRepositoryInterface::class); + } + + /** + * Verify index become invalid in case rule become inactive and stays active in case inactive rule has been saved. + * + * @magentoDataFixture Magento/CatalogRule/_files/catalog_rule_25_customer_group_all.php + * @magentoDbIsolation disabled + * + * @return void + */ + public function testIndexInvalidationAfterInactiveRuleSave(): void + { + $ruleProductProcessor = Bootstrap::getObjectManager()->get(RuleProductProcessor::class); + $state = $ruleProductProcessor->getIndexer()->getState(); + $state->setStatus(StateInterface::STATUS_VALID); + $ruleProductProcessor->getIndexer()->setState($state); + $rule = $this->getRuleByName('Test Catalog Rule With 25 Percent Off'); + $rule->setIsActive(0); + $this->catalogRuleRepository->save($rule); + self::assertEquals(StateInterface::STATUS_INVALID, $ruleProductProcessor->getIndexer()->getStatus()); + $state = $ruleProductProcessor->getIndexer()->getState(); + $state->setStatus(StateInterface::STATUS_VALID); + $ruleProductProcessor->getIndexer()->setState($state); + $this->catalogRuleRepository->save($rule); + self::assertEquals(StateInterface::STATUS_VALID, $ruleProductProcessor->getIndexer()->getStatus()); + } + + /** + * Retrieve catalog rule by name from db. + * + * @param string $name + * @return RuleInterface + */ + private function getRuleByName(string $name): RuleInterface + { + $catalogRuleResource = Bootstrap::getObjectManager()->get(ResourceRuleFactory::class)->create(); + $select = $catalogRuleResource->getConnection()->select(); + $select->from($catalogRuleResource->getMainTable(), RuleInterface::RULE_ID); + $select->where(RuleInterface::NAME . ' = ?', $name); + $ruleId = $catalogRuleResource->getConnection()->fetchOne($select); + + return $this->catalogRuleRepository->get((int)$ruleId); + } +} diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php index 313ceca053591..b51284c42ce90 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php @@ -5,6 +5,8 @@ */ namespace Magento\CatalogRule\Model\Indexer; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Helper\Bootstrap; class IndexerBuilderTest extends \PHPUnit\Framework\TestCase @@ -34,6 +36,16 @@ class IndexerBuilderTest extends \PHPUnit\Framework\TestCase */ protected $productThird; + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + protected function setUp(): void { $this->indexerBuilder = Bootstrap::getObjectManager()->get( @@ -41,6 +53,8 @@ protected function setUp(): void ); $this->resourceRule = Bootstrap::getObjectManager()->get(\Magento\CatalogRule\Model\ResourceModel\Rule::class); $this->product = Bootstrap::getObjectManager()->get(\Magento\Catalog\Model\Product::class); + $this->storeManager = Bootstrap::getObjectManager()->get(StoreManagerInterface::class); + $this->productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); } protected function tearDown(): void @@ -82,6 +96,34 @@ public function testReindexById() $this->assertEquals(9.8, $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $product->getId())); } + /** + * @magentoDbIsolation disabled + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/CatalogRule/_files/simple_product_with_catalog_rule_50_percent_off_tomorrow.php + * @magentoConfigFixture base_website general/locale/timezone Europe/Amsterdam + * @magentoConfigFixture general/locale/timezone America/Chicago + */ + public function testReindexByIdDifferentTimezones() + { + $productId = $this->productRepository->get('simple')->getId(); + $this->indexerBuilder->reindexById($productId); + + $mainWebsiteId = $this->storeManager->getWebsite('base')->getId(); + $secondWebsiteId = $this->storeManager->getWebsite('test')->getId(); + $rawTimestamp = (new \DateTime('+1 day'))->getTimestamp(); + $timestamp = $rawTimestamp - ($rawTimestamp % (60 * 60 * 24)); + $mainWebsiteActiveRules = + $this->resourceRule->getRulesFromProduct($timestamp, $mainWebsiteId, 1, $productId); + $secondWebsiteActiveRules = + $this->resourceRule->getRulesFromProduct($timestamp, $secondWebsiteId, 1, $productId); + + $this->assertCount(1, $mainWebsiteActiveRules); + // Avoid failure when staging is enabled as it removes catalog rule timestamp. + if ((int)$mainWebsiteActiveRules[0]['from_time'] !== 0) { + $this->assertCount(0, $secondWebsiteActiveRules); + } + } + /** * @magentoDbIsolation disabled * @magentoAppIsolation enabled diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php index 2b18b1569aaeb..716f8d6260c4a 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php @@ -21,6 +21,7 @@ class PriceTest extends \PHPUnit\Framework\TestCase * @var \Magento\Framework\ObjectManagerInterface */ private $objectManager; + /** * @var Rule */ @@ -102,8 +103,8 @@ public function testPriceForSecondStore():void ); $this->indexerBuilder->reindexById($simpleProduct->getId()); $this->assertEquals( - $this->resourceRule->getRulePrice(new \DateTime(), $websiteId, 1, $simpleProduct->getId()), - 25 + 25, + $this->resourceRule->getRulePrice(new \DateTime(), $websiteId, 1, $simpleProduct->getId()) ); } diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_product_with_catalog_rule_50_percent_off_tomorrow.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_product_with_catalog_rule_50_percent_off_tomorrow.php new file mode 100644 index 0000000000000..0b7e3e0b4e666 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_product_with_catalog_rule_50_percent_off_tomorrow.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductInterfaceFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Visibility; +use Magento\CatalogRule\Api\CatalogRuleRepositoryInterface; +use Magento\CatalogRule\Model\Indexer\IndexBuilder; +use Magento\CatalogRule\Model\Rule; +use Magento\CatalogRule\Model\RuleFactory; +use Magento\Customer\Model\Group; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Store/_files/second_website_with_two_stores.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var WebsiteRepositoryInterface $websiteRepository */ +$websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); +/** @var IndexBuilder $indexBuilder */ +$indexBuilder = $objectManager->get(IndexBuilder::class); +/** @var CatalogRuleRepositoryInterface $catalogRuleRepository */ +$catalogRuleRepository = $objectManager->get(CatalogRuleRepositoryInterface::class); +/** @var ProductInterfaceFactory $productFactory */ +$productFactory = $objectManager->get(ProductInterfaceFactory::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var RuleFactory $ruleFactory */ +$ruleFactory = $objectManager->get(RuleFactory::class); + +$secondWebsite = $websiteRepository->get('test'); +$product = $productFactory->create(); +$product->setTypeId('simple') + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([1, $secondWebsite->getId()]) + ->setName('Simple Product') + ->setSku('simple') + ->setPrice(50) + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_qty_decimal' => 0, + 'is_in_stock' => 1, + ] + ); +$productRepository->save($product); +/** @var Rule $rule */ +$catalogRule = $ruleFactory->create(); +$catalogRule->loadPost( + [ + 'name' => 'Test Catalog Rule 50% off tomorrow', + 'is_active' => '1', + 'stop_rules_processing' => 0, + 'website_ids' => [1, $secondWebsite->getId()], + 'customer_group_ids' => [Group::NOT_LOGGED_IN_ID, 1], + 'discount_amount' => 50, + 'simple_action' => 'by_percent', + 'from_date' => (new \DateTime('+1 day'))->format('m/d/Y'), + 'to_date' => '', + 'sort_order' => 0, + 'sub_is_enable' => 0, + 'sub_discount_amount' => 0, + 'conditions' => [], + ] +); +$catalogRuleRepository->save($catalogRule); +$indexBuilder->reindexFull(); diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_product_with_catalog_rule_50_percent_off_tomorrow_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_product_with_catalog_rule_50_percent_off_tomorrow_rollback.php new file mode 100644 index 0000000000000..4745fc4d6772f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/_files/simple_product_with_catalog_rule_50_percent_off_tomorrow_rollback.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\CatalogRule\Api\CatalogRuleRepositoryInterface; +use Magento\CatalogRule\Model\Indexer\IndexBuilder; +use Magento\CatalogRule\Model\ResourceModel\Rule; +use Magento\Framework\Exception\CouldNotDeleteException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +/** @var CatalogRuleRepositoryInterface $ruleRepository */ +$ruleRepository = $objectManager->get(CatalogRuleRepositoryInterface::class); +/** @var IndexBuilder $indexBuilder */ +$indexBuilder = $objectManager->get(IndexBuilder::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); +try { + $productRepository->deleteById('simple'); +} catch (NoSuchEntityException $e) { + //already removed +} +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); + +/** @var Rule $catalogRuleResource */ +$catalogRuleResource = $objectManager->create(Rule::class); +//Retrieve rule by name +$select = $catalogRuleResource->getConnection() + ->select() + ->from($catalogRuleResource->getMainTable(), 'rule_id') + ->where('name = ?', 'Test Catalog Rule 50% off tomorrow'); +$ruleId = $catalogRuleResource->getConnection()->fetchOne($select); + +try { + $ruleRepository->deleteById($ruleId); +} catch (CouldNotDeleteException $ex) { + //Nothing to remove +} + +$indexBuilder->reindexFull(); + +Resolver::getInstance()->requireDataFixture('Magento/Store/_files/second_website_with_two_stores_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php index 33fac8e670f3d..b5b534159e5ed 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php @@ -101,6 +101,39 @@ public function testExecuteSkuWithHyphen(): void $this->assertStringContainsString('Simple product name', $responseBody); } + /** + * Advanced search with an underscore in product attributes. + * + * @magentoAppArea frontend + * @magentoDataFixture Magento/CatalogSearch/_files/product_for_search_with_underscore.php + * @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php + * + * @return void + */ + public function testExecuteWithUnderscore(): void + { + $this->getRequest()->setQuery( + $this->_objectManager->create( + Parameters::class, + [ + 'values' => [ + 'name' => 'name', + 'sku' => 'sku', + 'description' => 'description', + 'short_description' => 'short', + 'price' => [ + 'from' => '', + 'to' => '', + ], + ], + ] + ) + ); + $this->dispatch('catalogsearch/advanced/result'); + $responseBody = $this->getResponse()->getBody(); + $this->assertStringContainsString('name_simple_product', $responseBody); + } + /** * Data provider with strings for quick search. * diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/CategoryTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/CategoryTest.php index b3a8a067d877b..85916cd172cda 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/CategoryTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/CategoryTest.php @@ -9,10 +9,16 @@ use Magento\Catalog\Api\CategoryRepositoryInterface; use Magento\Catalog\Model\Category; +use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory as CategoryCollectionFactory; use Magento\CatalogSearch\Model\Indexer\Fulltext\Processor; +use Magento\Framework\Indexer\StateInterface; use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; -class CategoryTest extends \PHPUnit\Framework\TestCase +/** + * Test for category repository plugin + */ +class CategoryTest extends TestCase { /** * @var Processor @@ -24,10 +30,19 @@ class CategoryTest extends \PHPUnit\Framework\TestCase */ private $categoryRepository; + /** + * @var CategoryCollectionFactory + */ + private $categoryCollectionFactory; + + /** + * @inheritDoc + */ protected function setUp(): void { $this->indexerProcessor = Bootstrap::getObjectManager()->create(Processor::class); $this->categoryRepository = Bootstrap::getObjectManager()->create(CategoryRepositoryInterface::class); + $this->categoryCollectionFactory = Bootstrap::getObjectManager()->create(CategoryCollectionFactory::class); } /** @@ -47,22 +62,22 @@ public function testIndexerInvalidatedAfterCategoryDelete() $status = $state->getStatus(); $this->assertTrue($isIndexerValid); - $this->assertEquals(\Magento\Framework\Indexer\StateInterface::STATUS_INVALID, $status); + $this->assertEquals(StateInterface::STATUS_INVALID, $status); } /** + * Returns categories + * * @param int $count * @return Category[] */ - private function getCategories($count) + private function getCategories(int $count): array { - /** @var Category $category */ - $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Category::class - ); - - $result = $category->getCollection()->addAttributeToSelect('name')->getItems(); - $result = array_slice($result, 2); + $collection = $this->categoryCollectionFactory->create() + ->addAttributeToSelect('name') + ->addAttributeToSelect('is_active') + ->getItems(); + $result = array_slice($collection, 2); return array_slice($result, 0, $count); } diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search_with_underscore.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search_with_underscore.php new file mode 100644 index 0000000000000..34e5b102b309c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search_with_underscore.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductInterfaceFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var WebsiteRepositoryInterface $websiteRepository */ +$websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); +$baseWebsite = $websiteRepository->get('base'); +/** @var ProductInterfaceFactory $productFactory */ +$productFactory = $objectManager->get(ProductInterfaceFactory::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); + +$product = $productFactory->create(); +$product->isObjectNew(true); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([$baseWebsite->getId()]) + ->setName('name_simple_product') + ->setSku('sku_simple_product') + ->setShortDescription('short_description_simple_product') + ->setDescription('description_simple_product') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setPrice(100) + ->setWeight(1) + ->setTaxClassId(0) + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_qty_decimal' => 0, + 'is_in_stock' => 1, + ] + ); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search_with_underscore_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search_with_underscore_rollback.php new file mode 100644 index 0000000000000..e32cb481ce12d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/product_for_search_with_underscore_rollback.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +try { + $product = $productRepository->get('sku_simple_product', false, null, true); + $productRepository->delete($product); +} catch (NoSuchEntityException $e) { + //product already deleted. +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewritesTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewritesTest.php index f958027f413e3..08243a9129c90 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewritesTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Model/Product/UpdateProductWebsiteUrlRewritesTest.php @@ -8,6 +8,7 @@ namespace Magento\CatalogUrlRewrite\Plugin\Catalog\Model\Product; use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection; use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Product\Action; use Magento\Store\Api\StoreWebsiteRelationInterface; @@ -69,4 +70,49 @@ public function testUpdateUrlRewrites() $url ); } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php + * @magentoDataFixture Magento/Store/_files/second_website_with_store_group_and_store.php + */ + public function testUpdateUrlRewritesForSecondProduct() + { + /** @var Website $website */ + $websiteRepository = Bootstrap::getObjectManager()->get(WebsiteRepository::class); + $website = $websiteRepository->get('test'); + $productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); + // test the first product + $product = $productRepository->get('simple1', false, null, true); + // store filter condition about the first product in collection + $productCollection = Bootstrap::getObjectManager()->get(ProductCollection::class); + $productCollection->addFieldToFilter('entity_id', $product->getId()); + $this->action->updateWebsites([$product->getId()], [$website->getId()], 'add'); + $storeIds = $this->storeWebsiteRelation->getStoreByWebsiteId($website->getId()); + $this->assertStringContainsString( + $product->getUrlKey() . '.html', + $product->setStoreId(reset($storeIds))->getProductUrl() + ); + $this->action->updateWebsites([$product->getId()], [$website->getId()], 'remove'); + $product->setRequestPath(''); + $url = $product->setStoreId(reset($storeIds))->getProductUrl(); + $this->assertStringNotContainsString( + $product->getUrlKey() . '.htmll', + $url + ); + // test the second product + $product = $productRepository->get('simple2', false, null, true); + $this->action->updateWebsites([$product->getId()], [$website->getId()], 'add'); + $storeIds = $this->storeWebsiteRelation->getStoreByWebsiteId($website->getId()); + $this->assertStringContainsString( + $product->getUrlKey() . '.html', + $product->setStoreId(reset($storeIds))->getProductUrl() + ); + $this->action->updateWebsites([$product->getId()], [$website->getId()], 'remove'); + $product->setRequestPath(''); + $url = $product->setStoreId(reset($storeIds))->getProductUrl(); + $this->assertStringNotContainsString( + $product->getUrlKey() . '.html', + $url + ); + } } diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemOptionsTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemOptionsTest.php new file mode 100644 index 0000000000000..c7765b2d663f9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemOptionsTest.php @@ -0,0 +1,127 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Checkout\Controller\Cart; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Checkout\Model\Session as CheckoutSession; +use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Framework\Data\Form\FormKey; +use Magento\Framework\Message\MessageInterface; +use Magento\Quote\Model\Quote\Item as QuoteItem; +use Magento\TestFramework\TestCase\AbstractController; + +/** + * Integration tests for \Magento\Checkout\Controller\Cart\UpdateItemOptions class. + */ +class UpdateItemOptionsTest extends AbstractController +{ + /** + * @var FormKey + */ + private $formKey; + + /** + * @var CheckoutSession + */ + private $checkoutSession; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->formKey = $this->_objectManager->get(FormKey::class); + $this->checkoutSession = $this->_objectManager->get(CheckoutSession::class); + $this->productRepository = $this->_objectManager->get(ProductRepositoryInterface::class); + } + + /** + * Tests that product is successfully updated in the shopping cart. + * + * @magentoAppArea frontend + * @magentoDataFixture Magento/Checkout/_files/quote_with_simple_product.php + */ + public function testUpdateProductOptionsInQuote() + { + $product = $this->productRepository->get('simple'); + $quoteItem = $this->checkoutSession->getQuote()->getItemByProduct($product); + $postData = $this->preparePostData($product, $quoteItem); + $this->dispatchUpdateItemOptionsRequest($postData); + $this->assertTrue($this->getResponse()->isRedirect()); + $this->assertRedirect($this->stringContains('/checkout/cart/')); + $message = (string)__( + '%1 was updated in your shopping cart.', + $product->getName() + ); + $this->assertSessionMessages( + $this->containsEqual($message), + MessageInterface::TYPE_SUCCESS + ); + } + + /** + * Tests that product can't be updated with an empty shopping cart. + * + * @magentoAppArea frontend + * @magentoDataFixture Magento/Checkout/_files/quote_with_simple_product.php + */ + public function testUpdateProductOptionsWithEmptyQuote() + { + $product = $this->productRepository->get('simple'); + $quoteItem = $this->checkoutSession->getQuote()->getItemByProduct($product); + $postData = $this->preparePostData($product, $quoteItem); + $this->checkoutSession->clearQuote(); + $this->dispatchUpdateItemOptionsRequest($postData); + $this->assertTrue($this->getResponse()->isRedirect()); + $this->assertRedirect($this->stringContains('/checkout/cart/')); + $message = (string)__('The quote item isn't found. Verify the item and try again.'); + $this->assertSessionMessages( + $this->containsEqual($message), + MessageInterface::TYPE_ERROR + ); + } + + /** + * Prepare post data for the request. + * + * @param ProductInterface $product + * @param QuoteItem|bool $quoteItem + * @return array + */ + private function preparePostData(ProductInterface $product, $quoteItem): array + { + return [ + 'product' => $product->getId(), + 'selected_configurable_option' => '', + 'related_product' => '', + 'item' => $quoteItem->getId(), + 'form_key' => $this->formKey->getFormKey(), + 'qty' => '2', + ]; + } + + /** + * Perform request for updating product options in a quote item. + * + * @param array $postData + * @return void + */ + private function dispatchUpdateItemOptionsRequest(array $postData): void + { + $this->getRequest()->setPostValue($postData); + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->dispatch('checkout/cart/updateItemOptions/id/' . $postData['item']); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Model/CaptchaPaymentProcessingRateLimiterTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Model/CaptchaRateLimiterTest.php similarity index 90% rename from dev/tests/integration/testsuite/Magento/Checkout/Model/CaptchaPaymentProcessingRateLimiterTest.php rename to dev/tests/integration/testsuite/Magento/Checkout/Model/CaptchaRateLimiterTest.php index 2a7b3c29223be..1f858a4d474ad 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Model/CaptchaPaymentProcessingRateLimiterTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Model/CaptchaRateLimiterTest.php @@ -9,9 +9,9 @@ namespace Magento\Checkout\Model; use Magento\Captcha\Model\DefaultModel; -use Magento\Checkout\Api\Exception\PaymentProcessingRateLimitExceededException; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Framework\App\RequestInterface; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\HTTP\PhpEnvironment\RemoteAddress; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; @@ -27,10 +27,10 @@ * @magentoAppIsolation enabled * @magentoAppArea frontend */ -class CaptchaPaymentProcessingRateLimiterTest extends TestCase +class CaptchaRateLimiterTest extends TestCase { /** - * @var CaptchaPaymentProcessingRateLimiter + * @var CaptchaRateLimiter */ private $model; @@ -69,7 +69,10 @@ protected function setUp(): void $this->captchaHelper = $objectManager->get(CaptchaHelper::class); $this->customerSession = $objectManager->get(CustomerSession::class); $this->customerRepo = $objectManager->get(CustomerRepositoryInterface::class); - $this->model = $objectManager->get(CaptchaPaymentProcessingRateLimiter::class); + $this->model = $objectManager->create( + CaptchaRateLimiter::class, + ['captchaId' => 'payment_processing_request'] + ); } /** @@ -95,7 +98,7 @@ public function testLoggedInLimits(): void try { $this->model->limit(); $limited = false; - } catch (PaymentProcessingRateLimitExceededException $exception) { + } catch (LocalizedException $exception) { $limited = true; } $this->assertTrue($limited); @@ -118,7 +121,7 @@ public function testGuestLimits(): void try { $this->model->limit(); $limited = false; - } catch (PaymentProcessingRateLimitExceededException $exception) { + } catch (LocalizedException $exception) { $limited = true; } $this->assertTrue($limited); @@ -141,7 +144,7 @@ public function testCaptchaValidation(): void try { $this->model->limit(); $limited = false; - } catch (PaymentProcessingRateLimitExceededException $exception) { + } catch (LocalizedException $exception) { $limited = true; } //CAPTCHA is required @@ -176,7 +179,7 @@ public function testCaptchaValidation(): void try { $this->model->limit(); $limited = false; - } catch (PaymentProcessingRateLimitExceededException $exception) { + } catch (LocalizedException $exception) { $limited = true; } //CAPTCHA was validated diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Block/CreateTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Block/CreateTest.php new file mode 100644 index 0000000000000..6b4fbff4ce61a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Block/CreateTest.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Cms\Controller\Adminhtml\Block; + +use Magento\Framework\App\Request\Http; +use Magento\Framework\Message\MessageInterface; +use Magento\TestFramework\TestCase\AbstractBackendController; + +/** + * @magentoAppArea adminhtml + */ +class CreateTest extends AbstractBackendController +{ + /** + * Test create CMS block with invalid URL + * + * @return void + */ + public function testCreateBlockWithInvalidUrl(): void + { + $identifier = 'admin'; + $reservedWords = 'admin, soap, rest, graphql, standard'; + $sessionMessages = [sprintf( + 'URL key "%s" matches a reserved endpoint name (%s). Use another URL key.', + $identifier, + $reservedWords + )]; + $requestData = [ + 'title' => 'block title', + 'identifier' => $identifier, + 'content' => '', + 'is_active' => 1, + ]; + + $this->getRequest()->setMethod(Http::METHOD_POST); + $this->getRequest()->setPostValue($requestData); + $this->dispatch('backend/cms/block/save'); + $this->assertSessionMessages( + self::equalTo($sessionMessages), + MessageInterface::TYPE_ERROR + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/PageDesignTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/PageDesignTest.php index 9f8a620b8d2a5..877f9d4fdb75a 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/PageDesignTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/PageDesignTest.php @@ -71,8 +71,8 @@ protected function setUp(): void { Bootstrap::getObjectManager()->configure([ 'preferences' => [ - \Magento\Cms\Model\Page\CustomLayoutManagerInterface::class => - \Magento\TestFramework\Cms\Model\CustomLayoutManager::class + CustomLayoutManagerInterface::class => + CustomLayoutManager::class ] ]); parent::setUp(); @@ -108,7 +108,7 @@ private function removeUrlRewrites(): void { if (!empty($this->pagesToDelete)) { /** @var UrlRewriteCollectionFactory $urlRewriteCollectionFactory */ - $urlRewriteCollectionFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + $urlRewriteCollectionFactory = Bootstrap::getObjectManager()->get( UrlRewriteCollectionFactory::class ); /** @var UrlRewriteCollection $urlRewriteCollection */ @@ -264,4 +264,35 @@ public function testSaveLayoutXml(): void $this->assertEmpty($updated->getLayoutUpdateXml()); $this->pagesToDelete = ['test_custom_layout_page_1']; } + + /** + * Test create CMS page with invalid URL + * + * @return void + */ + public function testSaveWithInlavidIdentifier(): void + { + $identifier = 'admin'; + $reservedWords = 'admin, soap, rest, graphql, standard'; + //Expected list of sessions messages collected throughout the controller calls. + $sessionMessages = [sprintf( + 'URL key "%s" matches a reserved endpoint name (%s). Use another URL key.', + $identifier, + $reservedWords + )]; + $requestData = [ + PageInterface::IDENTIFIER => $identifier, + PageInterface::TITLE => 'page title', + PageInterface::CUSTOM_THEME => '1', + PageInterface::PAGE_LAYOUT => 'empty', + ]; + + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setPostValue($requestData); + $this->dispatch($this->uri); + $this->assertSessionMessages( + self::equalTo($sessionMessages), + MessageInterface::TYPE_ERROR + ); + } } diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/Page/DataProviderTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/Page/DataProviderTest.php index 5197daa759e04..247a9ab34eb36 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Model/Page/DataProviderTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Model/Page/DataProviderTest.php @@ -9,11 +9,12 @@ namespace Magento\Cms\Model\Page; use Magento\Cms\Api\GetPageByIdentifierInterface; +use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\ObjectManagerInterface; use Magento\TestFramework\Cms\Model\CustomLayoutManager; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; -use Magento\Cms\Model\Page as PageModel; -use Magento\Framework\App\Request\Http as HttpRequest; /** * Test pages data provider. @@ -22,6 +23,12 @@ */ class DataProviderTest extends TestCase { + private $providerData = [ + 'name' => 'test', + 'primaryFieldName' => 'page_id', + 'requestFieldName' => 'page_id', + ]; + /** * @var DataProvider */ @@ -42,29 +49,26 @@ class DataProviderTest extends TestCase */ private $request; + /** + * @var ObjectManagerInterface + */ + private $objectManager; + /** * @inheritDoc */ protected function setUp(): void { - $objectManager = Bootstrap::getObjectManager(); - $objectManager->configure([ - 'preferences' => [ - \Magento\Cms\Model\Page\CustomLayoutManagerInterface::class => - \Magento\TestFramework\Cms\Model\CustomLayoutManager::class - ] + $this->objectManager = Bootstrap::getObjectManager(); + $this->objectManager->configure([ + 'preferences' => [CustomLayoutManagerInterface::class => CustomLayoutManager::class] ]); - $this->repo = $objectManager->get(GetPageByIdentifierInterface::class); - $this->filesFaker = $objectManager->get(CustomLayoutManager::class); - $this->request = $objectManager->get(HttpRequest::class); - $this->provider = $objectManager->create( + $this->repo = $this->objectManager->get(GetPageByIdentifierInterface::class); + $this->filesFaker = $this->objectManager->get(CustomLayoutManager::class); + $this->request = $this->objectManager->get(HttpRequest::class); + $this->provider = $this->objectManager->create( DataProvider::class, - [ - 'name' => 'test', - 'primaryFieldName' => 'page_id', - 'requestFieldName' => 'page_id', - 'customLayoutManager' => $this->filesFaker - ] + array_merge($this->providerData, ['customLayoutManager' => $this->filesFaker]) ); } @@ -72,29 +76,42 @@ protected function setUp(): void * Check that custom layout date is handled properly. * * @magentoDataFixture Magento/Cms/_files/pages_with_layout_xml.php - * @throws \Throwable + * @dataProvider customLayoutDataProvider + * + * @param string $identifier + * @param string|null $layoutUpdateSelected * @return void */ - public function testCustomLayoutData(): void + public function testCustomLayoutData(string $identifier, ?string $layoutUpdateSelected): void { - $data = $this->provider->getData(); - $page1Data = null; - $page2Data = null; - $page3Data = null; - foreach ($data as $pageData) { - if ($pageData[PageModel::IDENTIFIER] === 'test_custom_layout_page_1') { - $page1Data = $pageData; - } elseif ($pageData[PageModel::IDENTIFIER] === 'test_custom_layout_page_2') { - $page2Data = $pageData; - } elseif ($pageData[PageModel::IDENTIFIER] === 'test_custom_layout_page_3') { - $page3Data = $pageData; - } - } - $this->assertNotEmpty($page1Data); - $this->assertNotEmpty($page2Data); - $this->assertEquals('_existing_', $page1Data['layout_update_selected']); - $this->assertNull($page2Data['layout_update_selected']); - $this->assertEquals('test_selected', $page3Data['layout_update_selected']); + $page = $this->repo->execute($identifier, 0); + + $request = $this->objectManager->create(RequestInterface::class); + $request->setParam('page_id', $page->getId()); + + $provider = $this->objectManager->create( + DataProvider::class, + array_merge($this->providerData, ['request' => $request]) + ); + + $data = $provider->getData(); + $pageData = $data[$page->getId()]; + + $this->assertEquals($layoutUpdateSelected, $pageData['layout_update_selected']); + } + + /** + * DataProvider for testCustomLayoutData + * + * @return array + */ + public function customLayoutDataProvider(): array + { + return [ + ['test_custom_layout_page_1', '_existing_'], + ['test_custom_layout_page_2', null], + ['test_custom_layout_page_3', 'test_selected'], + ]; } /** diff --git a/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormStub.php b/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormStub.php index 35afc60b042d7..96a557f405504 100644 --- a/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormStub.php +++ b/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormStub.php @@ -52,15 +52,14 @@ public function setStubConfigRoot(array $configRoot = []) */ protected function _initObjects() { - parent::_initObjects(); + $result = parent::_initObjects(); $this->_configData = $this->_configDataStub; - if ($this->_configRootStub) { - $this->_configRoot = $this->_configRootStub; - } $this->_fieldRenderer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( \Magento\Framework\View\LayoutInterface::class )->createBlock( \Magento\Config\Block\System\Config\Form\Field::class ); + + return $result; } } diff --git a/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigSetCommandTest.php b/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigSetCommandTest.php index fb9b165847c00..79e583bb08a91 100644 --- a/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigSetCommandTest.php +++ b/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigSetCommandTest.php @@ -7,6 +7,7 @@ namespace Magento\Config\Console\Command; use Magento\Config\Model\Config\Backend\Admin\Custom; +use Magento\Config\Model\Config\PathValidator; use Magento\Config\Model\Config\Structure\Converter; use Magento\Config\Model\Config\Structure\Data as StructureData; use Magento\Directory\Model\Currency; @@ -444,6 +445,15 @@ public function configSetValidDataProvider() ]; } + /** + * Test validate path when field has custom config_path + */ + public function testValidatePathWithCustomConfigPath(): void + { + $pathValidator = $this->objectManager->get(PathValidator::class); + $this->assertTrue($pathValidator->validate('general/group/subgroup/second_field')); + } + /** * Set configuration and check this value from DB with success message this command should display * diff --git a/dev/tests/integration/testsuite/Magento/Config/Controller/Adminhtml/System/Config/SaveTest.php b/dev/tests/integration/testsuite/Magento/Config/Controller/Adminhtml/System/Config/SaveTest.php new file mode 100644 index 0000000000000..adf91b0b6b051 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Config/Controller/Adminhtml/System/Config/SaveTest.php @@ -0,0 +1,179 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Config\Controller\Adminhtml\System\Config; + +use Magento\Config\Model\Config\Loader; +use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Framework\App\ScopeInterface; +use Magento\Framework\App\ScopeResolverPool; +use Magento\Framework\Message\MessageInterface; +use Magento\TestFramework\TestCase\AbstractBackendController; + +/** + * Checks saving and updating of configuration data + * + * @see \Magento\Config\Controller\Adminhtml\System\Config\Save + * @magentoAppArea adminhtml + */ +class SaveTest extends AbstractBackendController +{ + /** @var Loader */ + private $configLoader; + + /** @var ScopeResolverPool */ + private $scopeResolverPool; + + /** + * @inheritdoc + */ + public function setUp(): void + { + parent::setUp(); + + $this->configLoader = $this->_objectManager->get(Loader::class); + $this->scopeResolverPool = $this->_objectManager->get(ScopeResolverPool::class); + } + + /** + * @dataProvider saveConfigDataProvider + * @magentoDbIsolation enabled + * @param array $params + * @param array $post + * @return void + */ + public function testSaveConfig(array $params, array $post): void + { + $expectedPathValue = $this->prepareExpectedPathValue($params['section'], $post['groups']); + $this->dispatchWithParams($params, $post); + $this->assertSessionMessages( + $this->containsEqual((string)__('You saved the configuration.')), + MessageInterface::TYPE_SUCCESS + ); + $this->assertPathValue($expectedPathValue); + } + + /** + * @return array + */ + public function saveConfigDataProvider(): array + { + return [ + 'configure_shipping_origin' => [ + 'params' => ['section' => 'shipping'], + 'post' => [ + 'groups' => [ + 'origin' => [ + 'fields' => [ + 'country_id' => ['value' => 'CH'], + 'region_id' => ['value' => '107'], + 'postcode' => ['value' => '3005'], + 'city' => ['value' => 'Bern'], + 'street_line1' => ['value' => 'Weinbergstrasse 4'], + 'street_line2' => ['value' => 'Suite 1'], + ], + ], + ], + ], + ], + 'configure_multi_shipping_options' => [ + 'params' => ['section' => 'multishipping'], + 'post' => [ + 'groups' => [ + 'options' => [ + 'fields' => [ + 'checkout_multiple' => ['value' => '1'], + 'checkout_multiple_maximum_qty' => ['value' => '99'], + ], + ], + ], + ], + ], + 'configure_flat_rate_shipping_method' => [ + 'params' => ['section' => 'carriers'], + 'post' => [ + 'groups' => [ + 'flatrate' => [ + 'fields' => [ + 'active' => ['value' => '1'], + 'type' => ['value' => 'I'], + 'price' => ['value' => '5.00'], + 'sallowspecific' => ['value' => '0'], + ], + ], + ], + ], + ], + ]; + } + + /** + * Prepare expected path value array. + * + * @param string $section + * @param array $groups + * @return array + */ + private function prepareExpectedPathValue(string $section, array $groups): array + { + foreach ($groups as $groupId => $groupData) { + $groupPath = $section . '/' . $groupId; + foreach ($groupData['fields'] as $fieldId => $fieldData) { + $path = $groupPath . '/' . $fieldId; + $expectedData[$groupPath][$path] = $fieldData['value']; + } + } + + return $expectedData ?? []; + } + + /** + * Check that the values for the paths in the config data were saved successfully. + * + * @param array $expectedPathValue + * @return void + */ + private function assertPathValue(array $expectedPathValue): void + { + $scope = $this->scopeResolverPool->get(ScopeInterface::SCOPE_DEFAULT)->getScope(); + foreach ($expectedPathValue as $groupPath => $groupData) { + $actualPathValue = $this->configLoader->getConfigByPath( + $groupPath, + $scope->getScopeType(), + $scope->getId(), + false + ); + foreach ($groupData as $fieldPath => $fieldValue) { + $this->assertArrayHasKey( + $fieldPath, + $actualPathValue, + sprintf('The expected config setting was not saved in the database. Path: %s', $fieldPath) + ); + $this->assertEquals( + $fieldValue, + $actualPathValue[$fieldPath], + sprintf('The expected value of the config setting is not correct. Path: %s', $fieldPath) + ); + } + } + } + + /** + * Dispatch request with params + * + * @param array $params + * @param array $postParams + * @return void + */ + private function dispatchWithParams(array $params = [], array $postParams = []): void + { + $this->getRequest()->setMethod(HttpRequest::METHOD_POST) + ->setParams($params) + ->setPostValue($postParams); + $this->dispatch('backend/admin/system_config/save'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Structure/Reader/_files/config.xml b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Structure/Reader/_files/config.xml index 5b482e2a61ed0..0c0bd756ab54a 100644 --- a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Structure/Reader/_files/config.xml +++ b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Structure/Reader/_files/config.xml @@ -74,7 +74,7 @@ <label>Payments Pro</label> <attribute type="activity_path">payment/paypal_payment_pro/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-pro.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-pro.html</comment> </group> <group id="paypal_payflow_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> <field id="enable_paypal_payflow"> @@ -94,7 +94,7 @@ <comment>Accept credit card and PayPal payments securely.</comment> <attribute type="activity_path">payment/wps_express/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-standard.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-standard.html</comment> </group> <group id="express_checkout_required"> <group id="express_checkout_required_express_checkout"> @@ -162,7 +162,7 @@ <comment>Accept credit card and PayPal payments securely.</comment> <attribute type="activity_path">payment/wps_express/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-standard.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-standard.html</comment> </group> <group id="express_checkout_required"> <group id="express_checkout_required_express_checkout"> @@ -233,7 +233,7 @@ <comment>Accept credit card and PayPal payments securely.</comment> <attribute type="activity_path">payment/wps_express/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-standard.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-standard.html</comment> </group> <group id="express_checkout_required"> <group id="express_checkout_required_express_checkout"> @@ -278,7 +278,7 @@ <label>Website Payments Pro</label> <attribute type="activity_path">payment/paypal_payment_pro/active</attribute> <group id="configuration_details"> - <comment>https://docs.magento.com/m2/ce/user_guide/payment/paypal-payments-pro.html</comment> + <comment>https://docs.magento.com/user-guide/payment/paypal-payments-pro.html</comment> </group> <group id="paypal_payflow_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10"> <group id="paypal_payflow_api_settings"> diff --git a/dev/tests/integration/testsuite/Magento/Config/_files/system.xml b/dev/tests/integration/testsuite/Magento/Config/_files/system.xml index f0063a3c0bf7f..3440b554ecd0a 100644 --- a/dev/tests/integration/testsuite/Magento/Config/_files/system.xml +++ b/dev/tests/integration/testsuite/Magento/Config/_files/system.xml @@ -13,6 +13,10 @@ <field id="field" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Label</label> </field> + <field id="second_field" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0"> + <label>Label Second</label> + <config_path>custom/config_path/second_field</config_path> + </field> </group> </group> </section> diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/Product/Type/ConfigurableTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/Product/Type/ConfigurableTest.php index a58809fe5e85e..8b5cb8e6f9c3d 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/Product/Type/ConfigurableTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/Product/Type/ConfigurableTest.php @@ -5,14 +5,30 @@ */ namespace Magento\ConfigurableImportExport\Model\Import\Product\Type; +use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\CatalogInventory\Api\Data\StockItemInterface; +use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\CatalogInventory\Api\StockItemRepositoryInterface; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\EntityManager\EntityMetadata; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\Filesystem; +use Magento\Framework\ObjectManagerInterface; +use Magento\ImportExport\Model\Import; +use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; +use Magento\ImportExport\Model\Import\Adapter as ImportAdapter; +use Magento\CatalogInventory\Api\StockItemCriteriaInterfaceFactory; +use Magento\Store\Model\Store; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; /** * @magentoAppArea adminhtml * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class ConfigurableTest extends \PHPUnit\Framework\TestCase +class ConfigurableTest extends TestCase { /** * Configurable product test Type @@ -25,22 +41,22 @@ class ConfigurableTest extends \PHPUnit\Framework\TestCase protected $model; /** - * @var \Magento\Framework\ObjectManagerInterface + * @var ObjectManagerInterface */ protected $objectManager; /** - * @var \Magento\Framework\EntityManager\EntityMetadata + * @var EntityMetadata */ protected $productMetadata; protected function setUp(): void { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->objectManager = Bootstrap::getObjectManager(); $this->model = $this->objectManager->create(\Magento\CatalogImportExport\Model\Import\Product::class); - /** @var \Magento\Framework\EntityManager\MetadataPool $metadataPool */ - $metadataPool = $this->objectManager->get(\Magento\Framework\EntityManager\MetadataPool::class); - $this->productMetadata = $metadataPool->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class); + /** @var MetadataPool $metadataPool */ + $metadataPool = $this->objectManager->get(MetadataPool::class); + $this->productMetadata = $metadataPool->getMetadata(ProductInterface::class); } public function configurableImportDataProvider() @@ -60,9 +76,9 @@ public function configurableImportDataProvider() } /** - * @param $pathToFile Path to import file - * @param $productName Name/sku of configurable product - * @param $optionSkuList Name of variations for configurable product + * @param string $pathToFile Path to import file + * @param string $productName Name/sku of configurable product + * @param array $optionSkuList Name of variations for configurable product * @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_attribute.php * @magentoAppArea adminhtml * @magentoAppIsolation enabled @@ -70,26 +86,7 @@ public function configurableImportDataProvider() */ public function testConfigurableImport($pathToFile, $productName, $optionSkuList) { - $filesystem = $this->objectManager->create( - \Magento\Framework\Filesystem::class - ); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - $errors = $this->model->setSource( - $source - )->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product' - ] - )->validateData(); + $errors = $this->doImport($pathToFile, Import::BEHAVIOR_APPEND); $this->assertTrue($errors->getErrorsCount() == 0); $this->model->importData(); @@ -98,7 +95,7 @@ public function testConfigurableImport($pathToFile, $productName, $optionSkuList $resource = $this->objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); $productId = $resource->getIdBySku($productName); $this->assertIsNumeric($productId); - /** @var \Magento\Catalog\Model\Product $product */ + /** @var Product $product */ $product = $this->objectManager->get(ProductRepositoryInterface::class)->getById($productId); $this->assertFalse($product->isObjectNew()); @@ -166,36 +163,18 @@ public function testConfigurableImportWithMultipleStores() 'default' => 'Configurable 1', 'fixture_second_store' => 'Configurable 1 Second Store' ]; - $filesystem = $this->objectManager->create( - \Magento\Framework\Filesystem::class - ); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/../../_files/import_configurable_for_multiple_store_views.csv', - 'directory' => $directory - ] - ); - $errors = $this->model->setSource( - $source - )->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product' - ] - )->validateData(); + $pathToFile = __DIR__ . '/../../_files/import_configurable_for_multiple_store_views.csv'; + $errors = $this->doImport($pathToFile, Import::BEHAVIOR_APPEND); $this->assertTrue($errors->getErrorsCount() == 0); $this->model->importData(); foreach ($products as $storeCode => $productName) { - $store = $this->objectManager->create(\Magento\Store\Model\Store::class); + $store = $this->objectManager->create(Store::class); $store->load($storeCode, 'code'); - /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ - $productRepository = $this->objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); - /** @var \Magento\Catalog\Api\Data\ProductInterface $product */ + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + /** @var ProductInterface $product */ $product = $productRepository->get($productSku, 0, $store->getId()); $this->assertFalse($product->isObjectNew()); $this->assertEquals($productName, $product->getName()); @@ -215,29 +194,86 @@ public function testConfigurableImportWithStoreSpecifiedMainItem() { $expectedErrorMessage = 'Product with assigned super attributes should not have specified "store_view_code"' . ' value'; - $filesystem = $this->objectManager->create( - \Magento\Framework\Filesystem::class - ); - - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => __DIR__ . '/../../_files/import_configurable_for_multiple_store_views_error.csv', - 'directory' => $directory - ] - ); - $errors = $this->model->setSource( - $source - )->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product' - ] - )->validateData(); + $pathToFile = __DIR__ . '/../../_files/import_configurable_for_multiple_store_views_error.csv'; + $errors = $this->doImport($pathToFile, Import::BEHAVIOR_APPEND); $this->assertTrue($errors->getErrorsCount() == 1); $this->assertEquals($expectedErrorMessage, $errors->getAllErrors()[0]->getErrorMessage()); } } + + /** + * @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_products.php + */ + public function testShouldUpdateConfigurableStockStatusIfChildProductsStockStatusChanged(): void + { + $sku = 'configurable'; + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + /** @var ProductInterface $product */ + $product = $productRepository->get($sku, true, null, true); + $stockItem = $this->getStockItem((int) $product->getId()); + $this->assertNotNull($stockItem); + $this->assertTrue($stockItem->getIsInStock()); + + // Set all child product out of stock + $pathToFile = __DIR__ . '/../../_files/import_configurable_child_products_stock_item_status_out_of_stock.csv'; + $errors = $this->doImport($pathToFile); + $this->assertEquals(0, $errors->getErrorsCount()); + + $stockItem = $this->getStockItem((int) $product->getId()); + $this->assertNotNull($stockItem); + $this->assertFalse($stockItem->getIsInStock()); + + // Set some child product in stock + $pathToFile = __DIR__ . '/../../_files/import_configurable_child_products_stock_item_status_in_stock.csv'; + $errors = $this->doImport($pathToFile); + $this->assertEquals(0, $errors->getErrorsCount()); + + $stockItem = $this->getStockItem((int) $product->getId()); + $this->assertNotNull($stockItem); + $this->assertTrue($stockItem->getIsInStock()); + } + + /** + * @param int $productId + * @return StockItemInterface|null + */ + private function getStockItem(int $productId): ?StockItemInterface + { + $criteriaFactory = $this->objectManager->create(StockItemCriteriaInterfaceFactory::class); + $stockItemRepository = $this->objectManager->create(StockItemRepositoryInterface::class); + $stockConfiguration = $this->objectManager->create(StockConfigurationInterface::class); + $criteria = $criteriaFactory->create(); + $criteria->setScopeFilter($stockConfiguration->getDefaultScopeId()); + $criteria->setProductsFilter($productId); + $stockItemCollection = $stockItemRepository->getList($criteria); + $stockItems = $stockItemCollection->getItems(); + return reset($stockItems); + } + + /** + * @param string $file + * @param string $behavior + * @param bool $validateOnly + * @return ProcessingErrorAggregatorInterface + */ + private function doImport( + string $file, + string $behavior = Import::BEHAVIOR_ADD_UPDATE, + bool $validateOnly = false + ): ProcessingErrorAggregatorInterface { + /** @var Filesystem $filesystem */ + $filesystem =$this->objectManager->create(Filesystem::class); + $directoryWrite = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = ImportAdapter::findAdapterFor($file, $directoryWrite); + $errors = $this->model + ->setParameters(['behavior' => $behavior, 'entity' => 'catalog_product']) + ->setSource($source) + ->validateData(); + if (!$validateOnly && !$errors->getAllErrors()) { + $this->model->importData(); + } + return $errors; + } } diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/_files/import_configurable_child_products_stock_item_status_in_stock.csv b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/_files/import_configurable_child_products_stock_item_status_in_stock.csv new file mode 100644 index 0000000000000..2381d20a07c57 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/_files/import_configurable_child_products_stock_item_status_in_stock.csv @@ -0,0 +1,3 @@ +"sku","qty","is_in_stock" +"simple_10","0","0" +"simple_20","100","1" diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/_files/import_configurable_child_products_stock_item_status_out_of_stock.csv b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/_files/import_configurable_child_products_stock_item_status_out_of_stock.csv new file mode 100644 index 0000000000000..c247844418d16 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/_files/import_configurable_child_products_stock_item_status_out_of_stock.csv @@ -0,0 +1,3 @@ +"sku","qty","is_in_stock" +"simple_10","0","0" +"simple_20","0","0" diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/CreateOptionsTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/CreateOptionsTest.php new file mode 100644 index 0000000000000..8c6f3b3b5977d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Attribute/CreateOptionsTest.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProduct\Controller\Adminhtml\Product\Attribute; + +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\TestFramework\TestCase\AbstractBackendController; + +/** + * Checks creating attribute options process. + * + * @see \Magento\ConfigurableProduct\Controller\Adminhtml\Product\Attribute\CreateOptions + * @magentoAppArea adminhtml + * @magentoDbIsolation enabled + */ +class CreateOptionsTest extends AbstractBackendController +{ + /** @var ProductRepositoryInterface */ + private $productRepository; + + /** @var SerializerInterface */ + private $json; + + /** @var ProductAttributeRepositoryInterface */ + private $attributeRepository; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->productRepository = $this->_objectManager->get(ProductRepositoryInterface::class); + $this->productRepository->cleanCache(); + $this->json = $this->_objectManager->get(SerializerInterface::class); + $this->attributeRepository = $this->_objectManager->get(ProductAttributeRepositoryInterface::class); + } + + /** + * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * + * @return void + */ + public function testAddAlreadyAddedOption(): void + { + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $attribute = $this->attributeRepository->get('test_configurable'); + $this->getRequest()->setParams([ + 'options' => [ + [ + 'label' => 'Option 1', + 'is_new' => true, + 'attribute_id' => (int)$attribute->getAttributeId(), + ], + ], + ]); + $this->dispatch('backend/catalog/product_attribute/createOptions'); + $responseBody = $this->json->unserialize($this->getResponse()->getBody()); + $this->assertNotEmpty($responseBody); + $this->assertStringContainsString( + (string)__('The value of attribute ""%1"" must be unique', $attribute->getAttributeCode()), + $responseBody['message'] + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php index 108230e0d4908..4b6fac496df0d 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php @@ -12,13 +12,15 @@ use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Product; use Magento\TestFramework\Helper\Bootstrap; +use Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory; +use PHPUnit\Framework\TestCase; /** * Class ConfigurableTest * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class ConfigurableTest extends \PHPUnit\Framework\TestCase +class ConfigurableTest extends TestCase { /** * Object under test @@ -645,4 +647,30 @@ protected function getUsedProducts() $product->load(1); return $this->model->getUsedProducts($product); } + + /** + * Unable to save product required option to product which is a part of configurable product + * + * @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_product_with_two_child_products.php + * @return void + */ + public function testAddCustomOptionToConfigurableChildProduct(): void + { + $this->expectErrorMessage( + 'Required custom options cannot be added to a simple product that is a part of a composite product.' + ); + + $sku = 'Simple option 1'; + $product = $this->productRepository->get($sku); + $optionRepository = Bootstrap::getObjectManager()->get(ProductCustomOptionInterfaceFactory::class); + $createdOption = $optionRepository->create( + ['data' => ['title' => 'drop_down option', 'type' => 'drop_down', 'sort_order' => 4, 'is_require' => 1]] + ); + $createdOption->setProductSku($product->getSku()); + $product->setOptions([$createdOption]); + $this->productRepository->save($product); + + $product = $this->productRepository->get($sku); + $this->assertEmpty($product->getOptions()); + } } diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/ConfigurableTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/ConfigurableTest.php index 28cbf80703d51..5af199ae26f26 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/ConfigurableTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/ConfigurableTest.php @@ -125,6 +125,7 @@ public function testGetProductFinalPriceIfOneOfChildIsDisabledPerStore(): void */ public function testGetProductMinimalPriceIfOneOfChildIsOutOfStock(): void { + $this->markTestSkipped('MC-40451: Indexer\Price\ConfigurableTest failure on 2.4-develop'); $configurableProduct = $this->getConfigurableProductFromCollection(1); $this->assertEquals(10, $configurableProduct->getMinimalPrice()); @@ -171,6 +172,7 @@ public function testReindexWithCorrectPriority() */ public function testReindexIfAllChildrenIsOutOfStock(): void { + $this->markTestSkipped('MC-40451: Indexer\Price\ConfigurableTest failure on 2.4-develop'); $configurableProduct = $this->getConfigurableProductFromCollection(1); $this->assertEquals(10, $configurableProduct->getMinimalPrice()); diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_products_with_two_attributes_combination.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_products_with_two_attributes_combination.php index 24e6010275bac..f26e39ca8e2a2 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_products_with_two_attributes_combination.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_products_with_two_attributes_combination.php @@ -3,10 +3,12 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Indexer\Product\Price\Processor as PriceIndexerProcessor; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Media\Config; use Magento\Catalog\Model\Product\Type; use Magento\Catalog\Model\Product\Visibility; use Magento\Catalog\Setup\CategorySetup; @@ -15,8 +17,11 @@ use Magento\ConfigurableProduct\Model\Product\Type\Configurable; use Magento\Eav\Api\Data\AttributeOptionInterface; use Magento\Framework\Api\Data\ImageContentInterface; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\Workaround\Override\Fixture\Resolver; +use Magento\Framework\App\Filesystem\DirectoryList; Resolver::getInstance()->requireDataFixture( 'Magento/ConfigurableProduct/_files/configurable_attribute_first.php' @@ -25,18 +30,31 @@ 'Magento/ConfigurableProduct/_files/configurable_attribute_second.php' ); +$objectManager = Bootstrap::getObjectManager(); + /** @var ProductRepositoryInterface $productRepository */ -$productRepository = Bootstrap::getObjectManager() - ->get(ProductRepositoryInterface::class); +$productRepository = $objectManager->get(ProductRepositoryInterface::class); /** @var $installer CategorySetup */ -$installer = Bootstrap::getObjectManager()->create(CategorySetup::class); +$installer = $objectManager->create(CategorySetup::class); /** @var \Magento\Eav\Model\Config $eavConfig */ -$eavConfig = Bootstrap::getObjectManager()->get(\Magento\Eav\Model\Config::class); +$eavConfig = $objectManager->get(\Magento\Eav\Model\Config::class); $firstAttribute = $eavConfig->getAttribute(Product::ENTITY, 'test_configurable_first'); $secondAttribute = $eavConfig->getAttribute(Product::ENTITY, 'test_configurable_second'); +/** @var Config $config */ +$config = $objectManager->get(Config::class); + +/** @var Filesystem $filesystem */ +$filesystem = $objectManager->get(Filesystem::class); + +/** @var WriteInterface $mediaDirectory */ +$mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); +$mediaPath = $mediaDirectory->getAbsolutePath(); +$baseTmpMediaPath = $config->getBaseTmpMediaPath(); +$mediaDirectory->create($baseTmpMediaPath); + /* Create simple products per each option value*/ /** @var AttributeOptionInterface[] $firstAttributeOptions */ $firstAttributeOptions = $firstAttribute->getOptions(); @@ -48,6 +66,8 @@ $firstAttributeValues = []; $secondAttributeValues = []; $testImagePath = __DIR__ . '/magento_image.jpg'; +$mediaImage = $mediaPath . '/' . $baseTmpMediaPath . '/magento_image.jpg'; +copy($testImagePath, $mediaImage); array_shift($firstAttributeOptions); array_shift($secondAttributeOptions); @@ -65,7 +85,10 @@ $qty = 100; $isInStock = 1; } - $product = Bootstrap::getObjectManager()->create(Product::class); + + $image = '/m/a/magento_image.jpg'; + + $product = $objectManager->create(Product::class); $product->setTypeId(Type::TYPE_SIMPLE) ->setAttributeSetId($attributeSetId) ->setWebsiteIds([1]) @@ -79,15 +102,15 @@ ->setStockData( ['use_config_manage_stock' => 1, 'qty' => $qty, 'is_qty_decimal' => 0, 'is_in_stock' => $isInStock] ) - ->setImage('/m/a/magento_image.jpg') - ->setSmallImage('/m/a/magento_image.jpg') - ->setThumbnail('/m/a/magento_image.jpg') + ->setImage($image) + ->setSmallImage($image) + ->setThumbnail($image) ->setData( 'media_gallery', [ 'images' => [ [ - 'file' => '/m/a/magento_image.jpg', + 'file' => $image, 'position' => 1, 'label' => 'Image Alt Text', 'disabled' => 0, @@ -113,11 +136,12 @@ foreach ($customAttributes as $attributeCode => $attributeValue) { $product->setCustomAttributes($customAttributes); } + $product = $productRepository->save($product); $associatedProductIds[] = $product->getId(); - /** @var \Magento\CatalogInventory\Model\Stock\Item $stockItem */ - $stockItem = Bootstrap::getObjectManager()->create(Item::class); + /** @var Item $stockItem */ + $stockItem = $objectManager->create(Item::class); $stockItem->load($product->getId(), 'product_id'); if (!$stockItem->getProductId()) { @@ -135,17 +159,16 @@ 'value_index' => $secondAttributeOption->getValue(), ]; } - } -$indexerProcessor = Bootstrap::getObjectManager()->get(PriceIndexerProcessor::class); +$indexerProcessor = $objectManager->get(PriceIndexerProcessor::class); $indexerProcessor->reindexList($associatedProductIds, true); /** @var $product Product */ -$product = Bootstrap::getObjectManager()->create(Product::class); +$product = $objectManager->create(Product::class); /** @var Factory $optionsFactory */ -$optionsFactory = Bootstrap::getObjectManager()->create(Factory::class); +$optionsFactory = $objectManager->create(Factory::class); $configurableAttributesData = [ [ @@ -180,9 +203,15 @@ ->setSku('configurable_12345') ->setVisibility(Visibility::VISIBILITY_BOTH) ->setStatus(Status::STATUS_ENABLED) - ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]); + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->addImageToMediaGallery( + $mediaImage, + ['image', 'small_image', 'thumbnail'], + false, + false + ); $productRepository->cleanCache(); $product = $productRepository->save($product); -$indexerProcessor = Bootstrap::getObjectManager()->get(PriceIndexerProcessor::class); +$indexerProcessor = $objectManager->get(PriceIndexerProcessor::class); $indexerProcessor->reindexRow($product->getId(), true); diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php index 253eaea3f0686..8dcdbb3c1614b 100644 --- a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php +++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php @@ -63,7 +63,10 @@ public function testCollecting(): void $objectSrcChecked = true; } elseif ($policy->getId() === 'media-src') { $this->assertInstanceOf(FetchPolicy::class, $policy); - $this->assertEquals(['https://magento.com', 'https://devdocs.magento.com'], $policy->getHostSources()); + $this->assertEquals( + ['*.adobe.com', 'https://magento.com', 'https://devdocs.magento.com'], + $policy->getHostSources() + ); $this->assertEmpty($policy->getHashes()); $mediaSrcChecked = true; } @@ -116,6 +119,7 @@ public function testCollectingForAdminhtmlArea(): void $this->assertInstanceOf(FetchPolicy::class, $policy); $this->assertEquals( [ + '*.adobe.com', 'https://admin.magento.com', 'https://devdocs.magento.com', 'example.magento.com' diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php index 12585992d084c..00c7eacf71389 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php @@ -16,13 +16,18 @@ use Magento\Framework\View\Result\PageFactory; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\Helper\Xpath; +use Magento\TestFramework\Store\ExecuteInStoreContext; use PHPUnit\Framework\TestCase; /** * Tests Address Edit Block * + * @see \Magento\Customer\Block\Address\Edit + * * @magentoAppArea frontend * @magentoAppIsolation enabled + * + * @magentoDataFixture Magento/Customer/_files/customer.php */ class EditTest extends TestCase { @@ -41,9 +46,12 @@ class EditTest extends TestCase /** @var CustomerRegistry */ private $customerRegistry; - /** @var RequestInterface */ + /** @var RequestInterface */ private $request; + /** @var ExecuteInStoreContext */ + private $executeInStoreContext; + /** * @inheritdoc */ @@ -62,6 +70,7 @@ protected function setUp(): void $this->block = $page->getLayout()->getBlock('customer_address_edit'); $this->addressRegistry = $this->objectManager->get(AddressRegistry::class); $this->customerRegistry = $this->objectManager->get(CustomerRegistry::class); + $this->executeInStoreContext = $this->objectManager->get(ExecuteInStoreContext::class); } /** @@ -174,4 +183,39 @@ public function testVatIdFieldNotVisible(): void $inputXpath = "//div[contains(@class, 'taxvat')]//div/input[contains(@id,'vat_id') and @type='text']"; $this->assertEquals(0, Xpath::getElementsCountForXpath($inputXpath, $html)); } + + /** + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Customer/_files/attribute_postcode_store_label_address.php + * + * @return void + */ + public function testCheckPostCodeLabels(): void + { + $html = $this->executeInStoreContext->execute('default', [$this->block, 'toHtml']); + $this->assertEquals( + 1, + Xpath::getElementsCountForXpath( + sprintf( + "//form[contains(@class, 'form-address-edit')]//label[@for='zip']/span[contains(text(), '%s')]", + 'default store postcode label' + ), + $html + ) + ); + } + + /** + * Check that submit button is disabled + * + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Customer/_files/customer_address.php + * @return void + */ + public function testSubmitButtonIsDisabled(): void + { + $html = $this->block->toHtml(); + $buttonXpath = "//form[contains(@class, 'form-address-edit')]//button[@type='submit' and @disabled='disabled']"; + $this->assertEquals(1, Xpath::getElementsCountForXpath($buttonXpath, $html)); + } } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommandTest.php b/dev/tests/integration/testsuite/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommandTest.php new file mode 100644 index 0000000000000..65e0ab927e536 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommandTest.php @@ -0,0 +1,115 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Customer\Console\Command; + +use Magento\Framework\Encryption\Encryptor; +use Magento\Framework\Encryption\EncryptorInterface; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; +use Magento\Customer\Model\CustomerFactory; +use Magento\Customer\Model\Customer; +use Magento\Customer\Model\CustomerRegistry; +use Symfony\Component\Console\Tester\CommandTester; +use Magento\Customer\Model\AuthenticationInterface; + +/** + * Test password hash upgrade command. + * + * @magentoAppArea frontend + */ +class UpgradeHashAlgorithmCommandTest extends TestCase +{ + /** + * @var UpgradeHashAlgorithmCommand + */ + private $command; + + /** + * @var CustomerFactory + */ + private $customerFactory; + + /** + * @var Encryptor + */ + private $encryptor; + + /** + * @var CustomerRegistry + */ + private $registry; + + /** + * @var AuthenticationInterface + */ + private $authentication; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @inheirtDoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->command = Bootstrap::getObjectManager()->get(UpgradeHashAlgorithmCommand::class); + $this->customerFactory = Bootstrap::getObjectManager()->get(CustomerFactory::class); + $this->encryptor = Bootstrap::getObjectManager()->get(EncryptorInterface::class); + $this->registry = Bootstrap::getObjectManager()->get(CustomerRegistry::class); + $this->authentication = Bootstrap::getObjectManager()->get(AuthenticationInterface::class); + $this->storeManager = Bootstrap::getObjectManager()->get(StoreManagerInterface::class); + } + + /** + * Test upgrading a customer's password hash. + * + * @return void + * + * @magentoDataFixture Magento/Customer/_files/customer.php + */ + public function testUpgrades(): void + { + $latestVersion = $this->encryptor->getLatestHashVersion(); + $original = 'password'; + //Hash the customer's password with the oldest algorithm. + /** @var Customer $customer */ + $customer = $this->customerFactory->create(); + $customer->setWebsiteId($this->storeManager->getWebsite()->getId()); + $customer->loadByEmail('customer@example.com'); + $customer->setPasswordHash($this->encryptor->getHash($original, true, Encryptor::HASH_VERSION_MD5)); + $customer->save(); + $this->registry->remove($customer->getId()); + + //Upgrading customers' password hashes 1 more times than there are algorithms to be sure + //that running the command won't break anything + $tester = new CommandTester($this->command); + for ($cycle = 0; $cycle < $latestVersion; $cycle++) { + $tester->execute([]); + } + + /** @var Customer $updated */ + $updated = $this->customerFactory->create(); + $updated->setWebsiteId($this->storeManager->getWebsite()->getId()); + $updated->loadByEmail('customer@example.com'); + + //Using the latest algorithm + $this->assertMatchesRegularExpression( + '/\:' .$this->encryptor->getLatestHashVersion() .'[^\:]*?$/', + $updated->getPasswordHash() + ); + + //Able to log in + $this->assertTrue($this->authentication->authenticate($updated->getId(), $original)); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Account/LoginPostTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Account/LoginPostTest.php index a21988d84a02f..37c2da8ebf51c 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Account/LoginPostTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Account/LoginPostTest.php @@ -144,6 +144,24 @@ public function testLoginWithRedirectToDashboardDisabled(): void $this->assertRedirect($this->stringContains('test_redirect')); } + /** + * @magentoConfigFixture current_store customer/startup/redirect_dashboard 0 + * @magentoConfigFixture current_store customer/captcha/enable 0 + * + * @magentoDataFixture Magento/Customer/_files/customer.php + * + * @return void + */ + public function testLoginToDashboardWithIncorrectReferrer(): void + { + $redirectUrl = 'https:support.magento.com'; + $this->prepareRequest('customer@example.com', 'password'); + $this->getRequest()->setParam(Url::REFERER_QUERY_PARAM_NAME, $this->urlEncoder->encode($redirectUrl)); + $this->dispatch('customer/account/loginPost'); + $this->assertTrue($this->session->isLoggedIn()); + $this->assertRedirect($this->stringContains('customer/account/')); + } + /** * @magentoConfigFixture current_store customer/startup/redirect_dashboard 1 * @magentoConfigFixture current_store customer/captcha/enable 0 diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Cart/Product/Composite/Cart/UpdateTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Cart/Product/Composite/Cart/UpdateTest.php index fd0e7a8d95833..b7e93d4a33b01 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Cart/Product/Composite/Cart/UpdateTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Cart/Product/Composite/Cart/UpdateTest.php @@ -8,7 +8,9 @@ namespace Magento\Customer\Controller\Adminhtml\Cart\Product\Composite\Cart; use Magento\Backend\Model\Session; +use Magento\Bundle\Model\Product\OptionList; use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Product\Option as ProductOption; use Magento\Catalog\Model\Product\Option\Type\File\ValidatorInfo; use Magento\Customer\Api\CustomerRepositoryInterface; @@ -20,6 +22,7 @@ use Magento\Quote\Model\Quote\Item as QuoteItem; use Magento\Quote\Model\ResourceModel\Quote\Item\CollectionFactory; use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Quote\Model\GetQuoteByReservedOrderId; use Magento\TestFramework\TestCase\AbstractBackendController; use PHPUnit\Framework\MockObject\MockObject; @@ -201,6 +204,85 @@ public function testUpdateSimpleProductOption(): void $this->assertRedirect($this->stringContains('catalog/product/showUpdateResult')); } + /** + * Tests updating bundle item quantity in the customer's shopping cart. + * + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Checkout/_files/quote_with_bundle_product.php + * @dataProvider bundleOptionQuantityProvider + * @param string $quantity + * @param string|null $message + * @return void + */ + public function testUpdateBundleOptionQuantity(string $quantity, ?string $message): void + { + $productRepository = $this->_objectManager->get(ProductRepositoryInterface::class); + $bundleOptionList = $this->_objectManager->get(OptionList::class); + $getQuoteByReservedOrderId = $this->_objectManager->get(GetQuoteByReservedOrderId::class); + + $bundleProduct = $productRepository->get('bundle-product'); + $bundleOptions = $bundleOptionList->getItems($bundleProduct); + $option = reset($bundleOptions); + $productLinks = $option->getProductLinks(); + $this->assertNotNull($productLinks[0]); + + $customer = $this->customerRepository->get('customer@example.com'); + $quote = $getQuoteByReservedOrderId->execute('test_cart_with_bundle'); + $quote->assignCustomer($customer); + $this->quoteRepository->save($quote); + $quoteItem = $quote->getItemsCollection()->getFirstItem(); + $this->assertNotEmpty($quoteItem->getId()); + + $postValue = [ + 'bundle_option' => [ + $option->getOptionId() => $productLinks[0]->getId(), + ], + 'qty' => $quantity, + 'id' => $quoteItem->getId(), + 'as_js_varname' => 'iFrameResponse', + ]; + + $this->dispatchCompositeCartUpdate( + [ + 'customer_id' => $customer->getId(), + 'website_id' => $customer->getWebsiteId(), + ], + $postValue + ); + + $updateResult = $this->session->getCompositeProductResult(); + $this->assertEquals($message, $updateResult->getMessage()); + } + + /** + * @return array + */ + public function bundleOptionQuantityProvider(): array + { + return [ + 'Quantity, less than allowed in the Shopping Cart' => [ + '0.1', + 'The fewest you may purchase is 1.', + ], + 'Decimal quantity not allowed' => [ + '1.1', + 'You cannot use decimal quantity for this product.', + ], + 'Quantity, greater than available' => [ + '1000', + 'The requested qty is not available', + ], + 'Quantity, greater than allowed in the Shopping Cart' => [ + '100000', + 'The requested qty exceeds the maximum qty allowed in shopping cart', + ], + 'Allowed quantity' => [ + '2', + null, + ], + ]; + } + /** * Prepare quote item options and sku for update. * diff --git a/dev/tests/integration/testsuite/Magento/Customer/Helper/ViewTest.php b/dev/tests/integration/testsuite/Magento/Customer/Helper/ViewTest.php index a896bdfd4034a..10a93f919c4f6 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Helper/ViewTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Helper/ViewTest.php @@ -52,13 +52,11 @@ public function testGetCustomerName( )->method( 'getAttributeMetadata' )->willReturnMap( - - [ - ['prefix', $isPrefixAllowed ? $visibleAttribute : $invisibleAttribute], - ['middlename', $isMiddleNameAllowed ? $visibleAttribute : $invisibleAttribute], - ['suffix', $isSuffixAllowed ? $visibleAttribute : $invisibleAttribute], - ] - + [ + ['prefix', $isPrefixAllowed ? $visibleAttribute : $invisibleAttribute], + ['middlename', $isMiddleNameAllowed ? $visibleAttribute : $invisibleAttribute], + ['suffix', $isSuffixAllowed ? $visibleAttribute : $invisibleAttribute], + ] ); $this->assertEquals( @@ -125,7 +123,17 @@ public function getCustomerNameDataProvider() true, // $isPrefixAllowed true, // $isMiddleNameAllowed true, //$isSuffixAllowed - ] + ], + 'With html entities' => [ + $customerFactory->create()->setPrefix( + 'prefix' + )->setFirstname( + '<h1>FirstName</h1>' + )->setLastname( + '<strong>LastName</strong>' + ), + '<h1>FirstName</h1> <strong>LastName</strong>', + ], ]; } } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/GroupExcludedWebsiteTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/GroupExcludedWebsiteTest.php new file mode 100644 index 0000000000000..b8d66f74cf1ad --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/GroupExcludedWebsiteTest.php @@ -0,0 +1,455 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Indexer\Product\Price\Processor; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Attribute\Source\Status as AttributeStatus; +use Magento\CatalogRule\Model\Indexer\Product\ProductRuleProcessor; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Api\Data\CustomerInterfaceFactory; +use Magento\Customer\Api\Data\GroupInterfaceFactory; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Catalog\Model\ResourceModel\Layer\Filter\Price; +use Magento\CatalogRule\Model\Rule; +use Magento\Framework\Api\SearchCriteriaBuilder; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Indexer\IndexerRegistry; +use Magento\Indexer\Model\Indexer; +use Magento\Store\Api\StoreRepositoryInterface; +use Magento\Framework\App\ResourceConnection; +use Magento\CatalogRule\Model\ResourceModel\Rule as RuleResourceModel; +use Magento\Framework\ObjectManagerInterface; +use Magento\Store\Model\Group; +use Magento\Store\Model\ResourceModel\Group as StoreGroupResourceModel; +use Magento\Store\Model\ResourceModel\Store as StoreResourceModel; +use Magento\Store\Model\ResourceModel\Website as WebsiteResourceModel; +use Magento\Store\Model\Store; +use Magento\Store\Model\Website; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\Registry; +use Magento\CatalogRule\Api\CatalogRuleRepositoryInterface; +use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\Indexer\Model\Indexer\Collection as IndexerCollection; + +/** + * Checks excluding websites from customer group functionality that affects price and catalog rule indexes. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class GroupExcludedWebsiteTest extends \PHPUnit\Framework\TestCase +{ + private const GROUP_CODE = 'Aliens'; + private const STORE_WEBSITE_CODE = 'customwebsite1'; + private const STORE_GROUP_CODE = 'customstoregroup1'; + private const STORE_CODE = 'customstoreview1'; + private const PRODUCT_ID = 333; + private const CATEGORY_ID = 444; + private const CUSTOMER_EMAIL = 'first_last@example.com'; + private const SKU = 'simplecustomproduct'; + + /** @var CustomerRepositoryInterface */ + private $customerRepository; + + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var CustomerInterfaceFactory */ + private $customerFactory; + + /** @var GroupRepositoryInterface */ + private $groupRepository; + + /** @var GroupInterfaceFactory */ + private $groupFactory; + + /** @var WebsiteResourceModel */ + private $websiteResourceModel; + + /** @var StoreGroupResourceModel */ + private $storeGroupResourceModel; + + /** @var StoreResourceModel */ + private $storeResourceModel; + + /** @var ProductRepositoryInterface */ + private $productRepository; + + /** @var ResourceConnection */ + private $resourceConnection; + + /** @var \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory */ + private $groupExtensionInterfaceFactory; + + /** @var IndexerRegistry */ + private $indexRegistry; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->customerRepository = $this->objectManager->create(CustomerRepositoryInterface::class); + $this->customerFactory = $this->objectManager->create(CustomerInterfaceFactory::class); + $this->groupRepository = $this->objectManager->create(GroupRepositoryInterface::class); + $this->groupFactory = $this->objectManager->create(GroupInterfaceFactory::class); + $this->websiteResourceModel = $this->objectManager->get(WebsiteResourceModel::class); + $this->storeGroupResourceModel = $this->objectManager->get(StoreGroupResourceModel::class); + $this->storeResourceModel = $this->objectManager->get(StoreResourceModel::class); + $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $this->resourceConnection = $this->objectManager->get(ResourceConnection::class); + $this->groupExtensionInterfaceFactory = $this->objectManager + ->get(\Magento\Customer\Api\Data\GroupExtensionInterfaceFactory::class); + $this->indexRegistry = $this->objectManager->create(IndexerRegistry::class); + } + + /** + * @inheritdoc + */ + protected function tearDown(): void + { + $registry = $this->objectManager->get(Registry::class); + /** Marks area as secure so Product repository would allow product removal */ + $isSecuredAreaSystemState = $registry->registry('isSecuredArea'); + $registry->unregister('isSecureArea'); + $registry->register('isSecureArea', true); + + $storeRepository = $this->objectManager->get(StoreRepositoryInterface::class); + /** @var AdapterInterface $connection */ + $connection = $this->resourceConnection->getConnection(); + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + + /** @var \Magento\Store\Model\Store $store */ + $store = $storeRepository->get(self::STORE_CODE); + $storeGroupId = $store->getStoreGroupId(); + $websiteId = $store->getWebsiteId(); + + /** Remove product */ + $product = $productRepository->getById(self::PRODUCT_ID); + if ($product->getId()) { + $productRepository->delete($product); + } + + /** Remove customer */ + /** @var CustomerInterface $customer */ + $customer = $this->customerRepository->get(self::CUSTOMER_EMAIL, $websiteId); + $this->customerRepository->delete($customer); + + /** Remove customer group */ + $groupId = $this->findGroupIdWithCode(self::GROUP_CODE); + $group = $this->groupRepository->getById($groupId); + $this->groupRepository->delete($group); + + /** Remove category */ + /** @var $category \Magento\Catalog\Model\Category */ + $category = $this->objectManager->create(\Magento\Catalog\Model\Category::class); + $category->load(self::CATEGORY_ID); + if ($category->getId()) { + $category->delete(); + } + + /** Remove store by code */ + $storeCodes = [self::STORE_CODE]; + $connection->delete( + $this->resourceConnection->getTableName('store'), + ['code IN (?)' => $storeCodes] + ); + + /** Remove store group by id*/ + $connection->delete( + $this->resourceConnection->getTableName('store_group'), + ['group_id = ?' => $storeGroupId] + ); + + /** Remove website by id */ + /** @var \Magento\Store\Model\Website $website */ + $website = $this->objectManager->create(\Magento\Store\Model\Website::class); + $website->load((int)$websiteId); + $website->delete(); + + /** Remove catalog rule */ + /** @var RuleResourceModel $catalogRuleResource */ + $catalogRuleResource = $this->objectManager->create(RuleResourceModel::class); + $select = $connection->select(); + $select->from($catalogRuleResource->getMainTable(), 'rule_id'); + $select->where('name = ?', 'Test Catalog Rule With 50 Percent Off'); + $ruleId = $connection->fetchOne($select); + /** @var CatalogRuleRepositoryInterface $ruleRepository */ + $ruleRepository = $this->objectManager->create(CatalogRuleRepositoryInterface::class); + $ruleRepository->deleteById($ruleId); + + /** @var IndexerCollection $indexerCollection */ + $indexerCollection = $this->objectManager->get(IndexerCollection::class); + $indexerCollection->load(); + foreach ($indexerCollection->getItems() as $indexer) { + /** @var Indexer $indexer */ + $indexer->reindexAll(); + } + + /** Revert mark area secured */ + $registry->unregister('isSecuredArea'); + $registry->register('isSecuredArea', $isSecuredAreaSystemState); + } + + /** + * Test excluding website from customer group + * + * @magentoDbIsolation disabled + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function testCustomerGroupExcludeWebsite(): void + { + /** Create website */ + /** @var Website $website */ + $website = $this->objectManager->create(Website::class); + $website->setName('custom website for customer group limitations test') + ->setCode(self::STORE_WEBSITE_CODE); + $website->isObjectNew(true); + $this->websiteResourceModel->save($website); + + /** Create store group */ + /** @var Group $storeGroup */ + $storeGroup = $this->objectManager->create(Group::class); + $storeGroup->setCode(self::STORE_GROUP_CODE) + ->setName('custom store group for customer group limitations test') + ->setWebsite($website); + $this->storeGroupResourceModel->save($storeGroup); + + $website->setDefaultGroupId($storeGroup->getId()); + $this->websiteResourceModel->save($website); + + /** Create store */ + /** @var Store $store */ + $store = $this->objectManager->create(Store::class); + $store->setName('custom store for customer group limitations test') + ->setCode(self::STORE_CODE) + ->setGroup($storeGroup); + $store->setWebsite($website); + $this->storeResourceModel->save($store); + + $storeId = $store->getId(); + $storeGroup->setDefaultStoreId($storeId); + $websiteId = $store->getWebsiteId(); + $this->storeGroupResourceModel->save($storeGroup); + + /** Create a new customer group */ + $group = $this->groupFactory->create() + ->setId(null) + ->setCode(self::GROUP_CODE) + ->setTaxClassId(3); + $groupId = $this->groupRepository->save($group)->getId(); + self::assertNotNull($groupId); + + /** Create a new customer */ + $firstname = 'First'; + $lastname = 'Last'; + $newCustomerEntity = $this->customerFactory->create() + ->setGroupId($groupId) + ->setStoreId($storeId) + ->setEmail(self::CUSTOMER_EMAIL) + ->setFirstname($firstname) + ->setLastname($lastname) + ->setWebsiteId($websiteId); + $this->customerRepository->save($newCustomerEntity); + + /** Create new category */ + /** @var \Magento\Catalog\Model\Category $category */ + $category = $this->objectManager->create(\Magento\Catalog\Model\Category::class); + $category->isObjectNew(true); + $category->setId(self::CATEGORY_ID) + ->setCreatedAt('2020-06-23 09:50:07') + ->setName('Misc') + ->setParentId(2) + ->setPath('1/2/444') + ->setLevel(2) + ->setAvailableSortBy(['position', 'name']) + ->setIsActive(true) + ->setPosition(1) + ->setStoreId($storeId) + ->save(); + + /** Create product */ + /** @var $product Product */ + $product = $this->objectManager->create(Product::class); + $product->isObjectNew(true); + $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) + ->setId(self::PRODUCT_ID) + ->setAttributeSetId(4) + ->setName('Simple Product custom') + ->setSku(self::SKU) + ->setTaxClassId('none') + ->setDescription('description') + ->setShortDescription('short description') + ->setOptionsContainer('container1') + ->setMsrpDisplayActualPriceType(\Magento\Msrp\Model\Product\Attribute\Source\Type::TYPE_IN_CART) + ->setPrice(10) + ->setWeight(1) + ->setMetaTitle('meta title') + ->setMetaKeyword('meta keyword') + ->setMetaDescription('meta description') + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setStatus(AttributeStatus::STATUS_ENABLED) + ->setWebsiteIds([$websiteId]) + ->setCategoryIds([self::CATEGORY_ID]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]); + + $this->productRepository->save($product); + $product = $this->productRepository->get(self::SKU); + $productId = $product->getId(); + + /** Create catalog rule */ + $catalogRule = $this->objectManager->create(Rule::class); + $catalogRule + ->setIsActive(1) + ->setName('Test Catalog Rule With 50 Percent Off') + ->setCustomerGroupIds($groupId) + ->setDiscountAmount(50) + ->setWebsiteIds([$websiteId]) + ->setSimpleAction('by_percent') + ->setStopRulesProcessing(false) + ->setSortOrder(0) + ->setSubIsEnable(0) + ->setSubDiscountAmount(0) + ->save(); + $this->reindexPriceAndCatalogRule(); + + /** Check that there is no customer group excluded website in price or catalog rule indexes */ + $this->checkNoExcludedWebsite((int)$websiteId, (int)$groupId, (int)$productId); + + /** Exclude website from customer group */ + $group = $this->groupRepository->getById($groupId); + $customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create(); + $customerGroupExtensionAttributes->setExcludeWebsiteIds([$websiteId]); + $group->setExtensionAttributes($customerGroupExtensionAttributes); + $this->groupRepository->save($group); + + $this->reindexPriceAndCatalogRule(); + + /** Check that excluding website from customer group affects catalog rule */ + $resource = $resource = $this->objectManager->get(RuleResourceModel::class); + $date = $this->objectManager->get(DateTime::class); + $rules = $resource->getRulesFromProduct($date->gmtDate(), $websiteId, $groupId, $productId); + self::assertCount(0, $rules); + // check that excluded website is eliminated from catalogrule_group_website table + $connection = $this->resourceConnection->getConnection(); + $selectCatalogRuleGroupWebsite = $connection->select(); + $selectCatalogRuleGroupWebsite->from('catalogrule_group_website') + ->where('customer_group_id = ?', $groupId); + $catalogRuleGroupWebsites = $connection->fetchAll($selectCatalogRuleGroupWebsite); + self::assertCount(0, $catalogRuleGroupWebsites); + + /** Check that excluding website from customer group affects price index */ + /** @var Price $catalogProductIndexPriceResource */ + $catalogProductIndexPriceResource = $this->objectManager->create(Price::class); + $select = $connection->select(); + $select->from($catalogProductIndexPriceResource->getMainTable()); + $select->where('customer_group_id = ?', $groupId); + $prices = $connection->fetchAll($select); + self::assertCount(0, $prices); + + /** Delete excluded website from customer group */ + $group = $this->groupRepository->getById($groupId); + $customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create(); + $customerGroupExtensionAttributes->setExcludeWebsiteIds([]); + $group->setExtensionAttributes($customerGroupExtensionAttributes); + $this->groupRepository->save($group); + + $this->reindexPriceAndCatalogRule(); + + /** Check that there is no excluded website from customer group in price or catalog rule indexes */ + $this->checkNoExcludedWebsite((int)$websiteId, (int)$groupId, (int)$productId); + } + + /** + * Find the customer group with a given code. + * + * @param string $code + * @return int + * @throws LocalizedException + */ + private function findGroupIdWithCode(string $code): int + { + /** @var GroupRepositoryInterface $groupRepository */ + $groupRepository = $this->objectManager->create(GroupRepositoryInterface::class); + /** @var SearchCriteriaBuilder $searchBuilder */ + $searchBuilder = $this->objectManager->create(SearchCriteriaBuilder::class); + + foreach ($groupRepository->getList($searchBuilder->create())->getItems() as $group) { + if ($group->getCode() === $code) { + return (int)$group->getId(); + } + } + + return -1; + } + + /** + * Reindex product price and catalog rule indexes. + * + * @throws \Exception + */ + private function reindexPriceAndCatalogRule(): void + { + $priceIndexer = $this->indexRegistry->get(Processor::INDEXER_ID); + $priceIndexer->reindexAll(); + $catalogRuleIndexer = $this->indexRegistry->get(ProductRuleProcessor::INDEXER_ID); + $catalogRuleIndexer->reindexAll(); + } + + /** + * Check that there is no customer group excluded website in price or catalog rule indexes. + * + * @param int $websiteId + * @param int $groupId + * @param int $productId + * @return void + * @throws LocalizedException + */ + private function checkNoExcludedWebsite(int $websiteId, int $groupId, int $productId): void + { + /** Check catalog rule */ + $date = $this->objectManager->create(DateTime::class); + $dateTs = $date->gmtDate(); + /** @var RuleResourceModel $resource */ + $resource = $this->objectManager->create(RuleResourceModel::class); + $rules = $resource->getRulesFromProduct($dateTs, $websiteId, $groupId, $productId); + self::assertCount(1, $rules); + foreach ($rules as $rule) { + self::assertEquals($groupId, $rule['customer_group_id']); + self::assertEquals($websiteId, $rule['website_id']); + } + + $connection = $this->resourceConnection->getConnection(); + $selectCatalogRuleGroupWebsite = $connection->select(); + $selectCatalogRuleGroupWebsite->from('catalogrule_group_website') + ->where('customer_group_id = ?', $groupId); + $catalogRuleGroupWebsites = $connection->fetchAll($selectCatalogRuleGroupWebsite); + self::assertCount(1, $catalogRuleGroupWebsites); + foreach ($catalogRuleGroupWebsites as $catalogRuleGroupWebsite) { + self::assertEquals($groupId, $catalogRuleGroupWebsite['customer_group_id']); + self::assertEquals($websiteId, $catalogRuleGroupWebsite['website_id']); + } + + /** Check price index */ + /** @var Price $catalogProductIndexPriceResource */ + $catalogProductIndexPriceResource = $this->objectManager->create(Price::class); + $select = $connection->select(); + $select->from($catalogProductIndexPriceResource->getMainTable()); + $select->where('customer_group_id = ?', $groupId); + $prices = $connection->fetchAll($select); + self::assertCount(1, $prices); + foreach ($prices as $price) { + self::assertEquals($groupId, $price['customer_group_id']); + self::assertEquals($websiteId, $price['website_id']); + } + } +} diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/Form/ImageTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/Form/ImageTest.php index 48e45126d124b..9b8ad360ef399 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/Form/ImageTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/Metadata/Form/ImageTest.php @@ -107,7 +107,7 @@ public function testProcessCustomerAddressValue() $actual = $processCustomerAddressValueMethod->invoke($image, $imageFile); $this->assertEquals($this->expectedFileName, $actual); $this->assertFileExists($expectedPath); - $this->assertFileNotExists($tmpFilePath); + $this->assertFileDoesNotExist($tmpFilePath); } /** @@ -150,7 +150,7 @@ public function testProcessCustomerValue() $processCustomerAddressValueMethod->setAccessible(true); $result = $processCustomerAddressValueMethod->invoke($image, $imageFile); $this->assertInstanceOf('Magento\Framework\Api\ImageContent', $result); - $this->assertFileNotExists($tmpFilePath); + $this->assertFileDoesNotExist($tmpFilePath); } /** diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/Plugin/DeleteCustomerGroupExcludedWebsiteTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/Plugin/DeleteCustomerGroupExcludedWebsiteTest.php new file mode 100644 index 0000000000000..3f2bb7ee6b216 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/Plugin/DeleteCustomerGroupExcludedWebsiteTest.php @@ -0,0 +1,179 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Model\Plugin; + +use Magento\Customer\Api\Data\GroupInterfaceFactory; +use Magento\Customer\Api\GroupRepositoryInterface; +use Magento\Customer\Model\ResourceModel\GroupExcludedWebsite; +use Magento\Framework\Api\SearchCriteriaBuilder; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\ObjectManagerInterface; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\Store\Model\ResourceModel\Website as WebsiteResourceModel; +use Magento\Store\Model\Website; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\Registry; + +/** + * Checks that removal of website also deletes it from the customer group excluded website table. + * @magentoAppArea adminhtml + */ +class DeleteCustomerGroupExcludedWebsiteTest extends \PHPUnit\Framework\TestCase +{ + private const GROUP_CODE = 'Humans'; + private const STORE_WEBSITE_CODE = 'custom_website'; + + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var GroupRepositoryInterface */ + private $groupRepository; + + /** @var GroupInterfaceFactory */ + private $groupFactory; + + /** @var WebsiteResourceModel */ + private $websiteResourceModel; + + /** @var ResourceConnection */ + private $resourceConnection; + + /** @var \Magento\Customer\Api\Data\GroupExtensionInterfaceFactory */ + private $groupExtensionInterfaceFactory; + + /** @var WebsiteRepositoryInterface */ + private $websiteRepository; + + /** @var Registry */ + private $registry; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->groupRepository = $this->objectManager->create(GroupRepositoryInterface::class); + $this->groupFactory = $this->objectManager->create(GroupInterfaceFactory::class); + $this->websiteResourceModel = $this->objectManager->get(WebsiteResourceModel::class); + $this->resourceConnection = $this->objectManager->get(ResourceConnection::class); + $this->groupExtensionInterfaceFactory = $this->objectManager + ->get(\Magento\Customer\Api\Data\GroupExtensionInterfaceFactory::class); + $this->websiteRepository = $this->objectManager->create(WebsiteRepositoryInterface::class); + $this->registry = $this->objectManager->create(Registry::class); + } + + /** + * @inheritdoc + */ + protected function tearDown(): void + { + /** Marks area as secure so Product repository would allow group removal */ + $isSecuredAreaSystemState = $this->registry->registry('isSecuredArea'); + $this->registry->unregister('isSecureArea'); + $this->registry->register('isSecureArea', true); + + /** Remove customer group */ + $groupId = $this->findGroupIdWithCode(self::GROUP_CODE); + $group = $this->groupRepository->getById($groupId); + $this->groupRepository->delete($group); + + /** Revert mark area secured */ + $this->registry->unregister('isSecuredArea'); + $this->registry->register('isSecuredArea', $isSecuredAreaSystemState); + } + + /** + * Test that deletion of website also deletes this website from customer group excluded websites. + * @magentoDbIsolation disabled + */ + public function testDeleteExcludedWebsiteAfterWebsiteDelete(): void + { + /** Create website */ + /** @var Website $website */ + $website = $this->objectManager->create(Website::class); + $website->setName('custom website for delete excluded website test') + ->setCode(self::STORE_WEBSITE_CODE); + $website->isObjectNew(true); + $this->websiteResourceModel->save($website); + $websiteId = $this->websiteRepository->get(self::STORE_WEBSITE_CODE)->getId(); + + /** Create a new customer group */ + $group = $this->groupFactory->create() + ->setId(null) + ->setCode(self::GROUP_CODE) + ->setTaxClassId(3); + $groupId = $this->groupRepository->save($group)->getId(); + self::assertNotNull($groupId); + + /** Exclude website from customer group */ + $group = $this->groupRepository->getById($groupId); + $customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create(); + $customerGroupExtensionAttributes->setExcludeWebsiteIds([$websiteId]); + $group->setExtensionAttributes($customerGroupExtensionAttributes); + $this->groupRepository->save($group); + + /** Check that excluded website is in customer group excluded website table */ + $connection = $this->resourceConnection->getConnection(); + $selectExcludedWebsite = $connection->select(); + /** @var GroupExcludedWebsite $groupExcludedWebsiteResource */ + $groupExcludedWebsiteResource = $this->objectManager->create(GroupExcludedWebsite::class); + $selectExcludedWebsite->from($groupExcludedWebsiteResource->getMainTable()) + ->where('website_id = ?', $websiteId); + $excludedWebsites = $connection->fetchAll($selectExcludedWebsite); + self::assertCount(1, $excludedWebsites); + + /** Marks area as secure so Product repository would allow website removal */ + $registry = $this->objectManager->get(Registry::class); + $isSecuredAreaSystemState = $registry->registry('isSecuredArea'); + $registry->unregister('isSecureArea'); + $registry->register('isSecureArea', true); + /** Remove website by id */ + /** @var \Magento\Store\Model\Website $website */ + $website = $this->objectManager->create(\Magento\Store\Model\Website::class); + $website->load((int)$websiteId); + $website->delete(); + + /** Revert mark area secured */ + $registry->unregister('isSecuredArea'); + $registry->register('isSecuredArea', $isSecuredAreaSystemState); + + /** Check that excluded website is no longer in customer group excluded website table */ + $selectExcludedWebsite = $connection->select(); + /** @var GroupExcludedWebsite $groupExcludedWebsiteResource */ + $groupExcludedWebsiteResource = $this->objectManager->create(GroupExcludedWebsite::class); + $selectExcludedWebsite->from($groupExcludedWebsiteResource->getMainTable()) + ->where('website_id = ?', $websiteId); + $excludedWebsites = $connection->fetchAll($selectExcludedWebsite); + self::assertCount(0, $excludedWebsites); + } + + /** + * Find the customer group with a given code. + * + * @param string $code + * @return int + * @throws LocalizedException + */ + private function findGroupIdWithCode(string $code): int + { + /** @var GroupRepositoryInterface $groupRepository */ + $groupRepository = $this->objectManager->create(GroupRepositoryInterface::class); + /** @var SearchCriteriaBuilder $searchBuilder */ + $searchBuilder = $this->objectManager->create(SearchCriteriaBuilder::class); + + foreach ($groupRepository->getList($searchBuilder->create())->getItems() as $group) { + if ($group->getCode() === $code) { + return (int)$group->getId(); + } + } + + return -1; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/Grid/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/Grid/CollectionTest.php index 321cb24a7fee5..1525065dcf4d3 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/Grid/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/Grid/CollectionTest.php @@ -8,16 +8,19 @@ use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Indexer\TestCase; /** * Customer grid collection tests. */ -class CollectionTest extends \Magento\TestFramework\Indexer\TestCase +class CollectionTest extends TestCase { public static function setUpBeforeClass(): void { - $db = Bootstrap::getInstance()->getBootstrap() + $db = Bootstrap::getInstance() + ->getBootstrap() ->getApplication() ->getDbInstance(); if (!$db->isDbDumpExists()) { @@ -42,12 +45,10 @@ public static function setUpBeforeClass(): void */ public function testGetItemByIdForUpdateOnSchedule() { - $targetObject = Bootstrap::getObjectManager()->create( - \Magento\Customer\Model\ResourceModel\Grid\Collection::class - ); - $customerRepository = Bootstrap::getObjectManager()->create( - CustomerRepositoryInterface::class - ); + $targetObject = Bootstrap::getObjectManager() + ->create(Collection::class); + $customerRepository = Bootstrap::getObjectManager() + ->create(CustomerRepositoryInterface::class); /** Verify after first save */ /** @var CustomerInterface $newCustomer */ @@ -68,7 +69,28 @@ public function testGetItemByIdForUpdateOnSchedule() } /** - * teardown + * Verifies that filter condition date is being converted to config timezone before select sql query + * + * @return void + */ + public function testAddFieldToFilter(): void + { + $filterDate = "2021-01-26 00:00:00"; + /** @var TimezoneInterface $timeZone */ + $timeZone = Bootstrap::getObjectManager() + ->get(TimezoneInterface::class); + /** @var Collection $gridCollection */ + $gridCollection = Bootstrap::getObjectManager() + ->get(Collection::class); + $convertedDate = $timeZone->convertConfigTimeToUtc($filterDate); + $collection = $gridCollection->addFieldToFilter('created_at', ['qteq' => $filterDate]); + $expectedSelect = "WHERE (((`main_table`.`created_at` = '{$convertedDate}')))"; + + $this->assertStringContainsString($expectedSelect, $collection->getSelectSql(true)); + } + + /** + * @inheritDoc */ protected function tearDown(): void { diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/attribute_postcode_store_label_address.php b/dev/tests/integration/testsuite/Magento/Customer/_files/attribute_postcode_store_label_address.php new file mode 100644 index 0000000000000..769e64491eab9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/attribute_postcode_store_label_address.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Customer\Api\AddressMetadataInterface; +use Magento\Customer\Api\Data\AddressInterface; +use Magento\Eav\Api\AttributeRepositoryInterface; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var AttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->get(AttributeRepositoryInterface::class); +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); +$attribute = $attributeRepository->get(AddressMetadataInterface::ENTITY_TYPE_ADDRESS, AddressInterface::POSTCODE); +$storeLabels = $attribute->getStoreLabels(); +$stores = $storeManager->getStores(); +foreach ($stores as $store) { + $storeLabels[$store->getId()] = $store->getCode() . ' store postcode label'; +} +$attribute->setStoreLabels($storeLabels); +$attributeRepository->save($attribute); diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/attribute_postcode_store_label_address_rollback.php b/dev/tests/integration/testsuite/Magento/Customer/_files/attribute_postcode_store_label_address_rollback.php new file mode 100644 index 0000000000000..60cb5bb671d21 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/attribute_postcode_store_label_address_rollback.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Customer\Api\AddressMetadataInterface; +use Magento\Customer\Api\Data\AddressInterface; +use Magento\Eav\Api\AttributeRepositoryInterface; +use Magento\Framework\Registry; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +$registry = $objectManager->get(Registry::class); +/** @var AttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->get(AttributeRepositoryInterface::class); +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +$attribute = $attributeRepository->get(AddressMetadataInterface::ENTITY_TYPE_ADDRESS, AddressInterface::POSTCODE); +$attribute->setStoreLabels([]); +$attributeRepository->save($attribute); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_one_address_rollback.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_one_address_rollback.php index 441700389840d..3e39a87d12e38 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_one_address_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_one_address_rollback.php @@ -18,17 +18,22 @@ $registry->register('isSecureArea', true); /** @var CustomerRepositoryInterface $customerRepo */ $customerRepo = $objectManager->get(CustomerRepositoryInterface::class); -try { - $customer = $customerRepo->get('customer_with_addresses@test.com'); - /** @var AddressRepositoryInterface $addressRepo */ - $addressRepo = $objectManager->get(AddressRepositoryInterface::class); - foreach ($customer->getAddresses() as $address) { - $addressRepo->delete($address); +$customersEmails = [ + 'customer_one_address@test.com', + 'customer_with_addresses@test.com', +]; +$addressRepo = $objectManager->get(AddressRepositoryInterface::class); +foreach ($customersEmails as $customerEmail) { + try { + $customer = $customerRepo->get($customerEmail); + foreach ($customer->getAddresses() as $address) { + $addressRepo->delete($address); + } + $customerRepo->delete($customer); + // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock + } catch (NoSuchEntityException $exception) { + //Already deleted } - $customerRepo->delete($customer); -// phpcs:ignore Magento2.CodeAnalysis.EmptyBlock -} catch (NoSuchEntityException $exception) { - //Already deleted } $registry->unregister('isSecureArea'); $registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/CustomerImportExport/Model/Import/AddressTest.php b/dev/tests/integration/testsuite/Magento/CustomerImportExport/Model/Import/AddressTest.php index 6aa5589ba7799..afc432c8dd108 100644 --- a/dev/tests/integration/testsuite/Magento/CustomerImportExport/Model/Import/AddressTest.php +++ b/dev/tests/integration/testsuite/Magento/CustomerImportExport/Model/Import/AddressTest.php @@ -80,7 +80,7 @@ class AddressTest extends TestCase 'remove' => [ // this data is not set in CSV file '19107' => [ 'city' => 'Philadelphia', - 'region' => 'Pennsylvania', + 'region' => null, ], ], 'default' => [ // new default billing/shipping addresses @@ -568,9 +568,10 @@ public function testUpdateFirstAndLastName() $this->assertEquals($address->getStreet(), $updatedAddress->getStreet()); $this->assertEquals($address->getCity(), $updatedAddress->getCity()); $this->assertEquals($address->getCountryId(), $updatedAddress->getCountryId()); - $this->assertEquals($address->getPostcode(), $updatedAddress->getPostcode()); $this->assertEquals($address->getTelephone(), $updatedAddress->getTelephone()); $this->assertEquals($address->getRegionId(), $updatedAddress->getRegionId()); + //assert empty non-required values changed + $this->assertEquals(null, $updatedAddress->getPostcode()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php b/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php index 552040489e253..57c6042ca25c9 100644 --- a/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php +++ b/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php @@ -442,17 +442,8 @@ private function getExpectedLabelRequestXml( */ public function testCollectRates() { - $requestData = $this->getRequestData(); - //phpcs:disable Magento2.Functions.DiscouragedFunction - $response = new Response( - 200, - [], - file_get_contents(__DIR__ . '/../_files/dhl_quote_response.xml') - ); - //phpcs:enable Magento2.Functions.DiscouragedFunction - $this->httpClient->nextResponses(array_fill(0, Carrier::UNAVAILABLE_DATE_LOOK_FORWARD + 1, $response)); - /** @var RateRequest $request */ - $request = Bootstrap::getObjectManager()->create(RateRequest::class, $requestData); + $this->setNextResponse(__DIR__ . '/../_files/dhl_quote_response.xml'); + $request = $this->createRequest(); $expectedRates = [ ['carrier' => 'dhl', 'carrier_title' => 'DHL Title', 'cost' => 45.85, 'method' => 'E', 'price' => 45.85], ['carrier' => 'dhl', 'carrier_title' => 'DHL Title', 'cost' => 35.26, 'method' => 'Q', 'price' => 35.26], @@ -487,11 +478,9 @@ public function testCollectRates() */ public function testCollectRatesWithoutDimensions(?string $size, ?string $height, ?string $width, ?string $depth) { - $requestData = $this->getRequestData(); $this->setDhlConfig(['size' => $size, 'height' => $height, 'width' => $width, 'depth' => $depth]); - /** @var RateRequest $request */ - $request = Bootstrap::getObjectManager()->create(RateRequest::class, $requestData); + $request = $this->createRequest(); $this->dhlCarrier = Bootstrap::getObjectManager()->create(Carrier::class); $this->dhlCarrier->collectRates($request)->getAllRates(); @@ -511,15 +500,13 @@ public function testCollectRatesWithoutDimensions(?string $size, ?string $height public function testGetRatesWithHttpException(): void { $this->setDhlConfig(['showmethod' => 1]); - $requestData = $this->getRequestData(); $deferredResponse = $this->getMockBuilder(HttpResponseDeferredInterface::class) ->onlyMethods(['get']) ->getMockForAbstractClass(); $exception = new HttpException('Exception message'); $deferredResponse->method('get')->willThrowException($exception); $this->httpClient->setDeferredResponseMock($deferredResponse); - /** @var RateRequest $request */ - $request = Bootstrap::getObjectManager()->create(RateRequest::class, $requestData); + $request = $this->createRequest(); $this->dhlCarrier = Bootstrap::getObjectManager()->create(Carrier::class); $resultRate = $this->dhlCarrier->collectRates($request)->getAllRates()[0]; $error = Bootstrap::getObjectManager()->get(Error::class); @@ -563,6 +550,77 @@ private function setDhlConfig(array $params) } } + /** + * Tests that the free rate is returned when sending a quotes request + * + * @param array $addRequestData + * @param bool $freeShippingExpects + * @magentoConfigFixture default_store carriers/dhl/active 1 + * @magentoConfigFixture default_store carriers/dhl/id some ID + * @magentoConfigFixture default_store carriers/dhl/shipment_days Mon,Tue,Wed,Thu,Fri,Sat + * @magentoConfigFixture default_store carriers/dhl/intl_shipment_days Mon,Tue,Wed,Thu,Fri,Sat + * @magentoConfigFixture default_store carriers/dhl/allowed_methods IE + * @magentoConfigFixture default_store carriers/dhl/international_service IE + * @magentoConfigFixture default_store carriers/dhl/gateway_url https://xmlpi-ea.dhl.com/XMLShippingServlet + * @magentoConfigFixture default_store carriers/dhl/id some ID + * @magentoConfigFixture default_store carriers/dhl/password some password + * @magentoConfigFixture default_store carriers/dhl/content_type N + * @magentoConfigFixture default_store carriers/dhl/nondoc_methods 1,3,4,8,P,Q,E,F,H,J,M,V,Y + * @magentoConfigFixture default_store carriers/dhl/showmethod' => 1, + * @magentoConfigFixture default_store carriers/dhl/title DHL Title + * @magentoConfigFixture default_store carriers/dhl/specificerrmsg dhl error message + * @magentoConfigFixture default_store carriers/dhl/unit_of_measure K + * @magentoConfigFixture default_store carriers/dhl/size 1 + * @magentoConfigFixture default_store carriers/dhl/height 1.6 + * @magentoConfigFixture default_store carriers/dhl/width 1.6 + * @magentoConfigFixture default_store carriers/dhl/depth 1.6 + * @magentoConfigFixture default_store carriers/dhl/debug 1 + * @magentoConfigFixture default_store carriers/dhl/free_method_nondoc P + * @magentoConfigFixture default_store carriers/dhl/free_shipping_enable 1 + * @magentoConfigFixture default_store carriers/dhl/free_shipping_subtotal 25 + * @magentoConfigFixture default_store shipping/origin/country_id GB + * @magentoAppIsolation enabled + * @dataProvider collectRatesWithFreeShippingDataProvider + */ + public function testCollectRatesWithFreeShipping(array $addRequestData, bool $freeShippingExpects): void + { + $this->setNextResponse(__DIR__ . '/../_files/dhl_quote_response.xml'); + $request = $this->createRequest($addRequestData); + + $actualRates = $this->dhlCarrier->collectRates($request)->getAllRates(); + $freeRateExists = false; + foreach ($actualRates as $actualRate) { + $actualRate = $actualRate->getData(); + if ($actualRate['method'] === 'P' && (float)$actualRate['price'] === 0.0) { + $freeRateExists = true; + break; + } + } + + self::assertEquals($freeShippingExpects, $freeRateExists); + } + + /** + * @return array + */ + public function collectRatesWithFreeShippingDataProvider(): array + { + return [ + [ + ['package_value' => 25, 'package_value_with_discount' => 22], + false + ], + [ + ['package_value' => 25, 'package_value_with_discount' => 25], + true + ], + [ + ['package_value' => 28, 'package_value_with_discount' => 25], + true + ], + ]; + } + /** * Returns request data. * @@ -571,47 +629,80 @@ private function setDhlConfig(array $params) private function getRequestData(): array { return [ - 'data' => [ - 'dest_country_id' => 'DE', - 'dest_region_id' => '82', - 'dest_region_code' => 'BER', - 'dest_street' => 'Turmstraße 17', - 'dest_city' => 'Berlin', - 'dest_postcode' => '10559', - 'dest_postal' => '10559', - 'package_value' => '5', - 'package_value_with_discount' => '5', - 'package_weight' => '8.2657', - 'package_qty' => '1', - 'package_physical_value' => '5', - 'free_method_weight' => '5', - 'store_id' => '1', - 'website_id' => '1', - 'free_shipping' => '0', - 'limit_carrier' => null, - 'base_subtotal_incl_tax' => '5', - 'orig_country_id' => 'US', - 'orig_region_id' => '12', - 'orig_city' => 'Fremont', - 'orig_postcode' => '94538', - 'dhl_id' => 'MAGEN_8501', - 'dhl_password' => 'QR2GO1U74X', - 'dhl_account' => '799909537', - 'dhl_shipping_intl_key' => '54233F2B2C4E5C4B4C5E5A59565530554B405641475D5659', - 'girth' => null, - 'height' => null, - 'length' => null, - 'width' => null, - 'weight' => 1, - 'dhl_shipment_type' => 'P', - 'dhl_duitable' => 0, - 'dhl_duty_payment_type' => 'R', - 'dhl_content_desc' => 'Big Box', - 'limit_method' => 'IE', - 'ship_date' => '2014-01-09', - 'action' => 'RateEstimate', - 'all_items' => [], - ] + 'dest_country_id' => 'DE', + 'dest_region_id' => '82', + 'dest_region_code' => 'BER', + 'dest_street' => 'Turmstraße 17', + 'dest_city' => 'Berlin', + 'dest_postcode' => '10559', + 'dest_postal' => '10559', + 'package_value' => '5', + 'package_value_with_discount' => '5', + 'package_weight' => '8.2657', + 'package_qty' => '1', + 'package_physical_value' => '5', + 'free_method_weight' => '5', + 'store_id' => '1', + 'website_id' => '1', + 'free_shipping' => '0', + 'limit_carrier' => null, + 'base_subtotal_incl_tax' => '5', + 'orig_country_id' => 'US', + 'orig_region_id' => '12', + 'orig_city' => 'Fremont', + 'orig_postcode' => '94538', + 'dhl_id' => 'MAGEN_8501', + 'dhl_password' => 'QR2GO1U74X', + 'dhl_account' => '799909537', + 'dhl_shipping_intl_key' => '54233F2B2C4E5C4B4C5E5A59565530554B405641475D5659', + 'girth' => null, + 'height' => null, + 'length' => null, + 'width' => null, + 'weight' => 1, + 'dhl_shipment_type' => 'P', + 'dhl_duitable' => 0, + 'dhl_duty_payment_type' => 'R', + 'dhl_content_desc' => 'Big Box', + 'limit_method' => 'IE', + 'ship_date' => '2014-01-09', + 'action' => 'RateEstimate', + 'all_items' => [], ]; } + + /** + * Set next response content from file + * + * @param string $file + */ + private function setNextResponse(string $file): void + { + //phpcs:disable Magento2.Functions.DiscouragedFunction + $response = new Response( + 200, + [], + file_get_contents($file) + ); + //phpcs:enable Magento2.Functions.DiscouragedFunction + $this->httpClient->nextResponses( + array_fill(0, Carrier::UNAVAILABLE_DATE_LOOK_FORWARD + 1, $response) + ); + } + + /** + * Create Rate Request + * + * @param array $addRequestData + * @return RateRequest + */ + private function createRequest(array $addRequestData = []): RateRequest + { + $requestData = $this->getRequestData(); + if (!empty($addRequestData)) { + $requestData = array_merge($requestData, $addRequestData); + } + + return Bootstrap::getObjectManager()->create(RateRequest::class, ['data' => $requestData]); + } } diff --git a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php index 2a4efd766b7c6..0f3a4a20fec09 100644 --- a/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php +++ b/dev/tests/integration/testsuite/Magento/Directory/Model/Country/Postcode/ValidatorTest.php @@ -80,8 +80,10 @@ public function getCanadaValidPostCodes() return [ ['countryId' => 'CA', 'postcode' => 'A1B2C3'], ['countryId' => 'CA', 'postcode' => 'A1B 2C3'], + ['countryId' => 'CA', 'postcode' => 'A1B'], ['countryId' => 'CA', 'postcode' => 'Z9Y 8X7'], ['countryId' => 'CA', 'postcode' => 'Z9Y8X7'], + ['countryId' => 'CA', 'postcode' => 'Z9Y'], ]; } @@ -92,112 +94,183 @@ public function getCanadaValidPostCodes() public function getPostcodesDataProvider() { return [ - ['countryId' => 'DZ', 'postcode' => '12345'], - ['countryId' => 'AS', 'postcode' => '12345'], - ['countryId' => 'AR', 'postcode' => '1234'], + ['countryId' => 'AD', 'postcode' => 'AD100'], ['countryId' => 'AM', 'postcode' => '123456'], - ['countryId' => 'AU', 'postcode' => '1234'], + ['countryId' => 'AR', 'postcode' => '1234'], + ['countryId' => 'AS', 'postcode' => '12345'], ['countryId' => 'AT', 'postcode' => '1234'], + ['countryId' => 'AU', 'postcode' => '1234'], + ['countryId' => 'AX', 'postcode' => '22101'], ['countryId' => 'AZ', 'postcode' => '1234'], ['countryId' => 'AZ', 'postcode' => '123456'], + ['countryId' => 'BA', 'postcode' => '12345'], + ['countryId' => 'BB', 'postcode' => 'BB10900'], ['countryId' => 'BD', 'postcode' => '1234'], - ['countryId' => 'BY', 'postcode' => '123456'], ['countryId' => 'BE', 'postcode' => '1234'], - ['countryId' => 'BA', 'postcode' => '12345'], + ['countryId' => 'BG', 'postcode' => '1234'], + ['countryId' => 'BH', 'postcode' => '323'], + ['countryId' => 'BH', 'postcode' => '1209'], + ['countryId' => 'BM', 'postcode' => 'MA 02'], + ['countryId' => 'BN', 'postcode' => 'PS1234'], ['countryId' => 'BR', 'postcode' => '12345678'], ['countryId' => 'BR', 'postcode' => '12345-678'], - ['countryId' => 'BN', 'postcode' => 'PS1234'], - ['countryId' => 'BG', 'postcode' => '1234'], + ['countryId' => 'BY', 'postcode' => '123456'], ['countryId' => 'CA', 'postcode' => 'P9M 3T6'], - ['countryId' => 'IC', 'postcode' => '12345'], + ['countryId' => 'CC', 'postcode' => '6799'], + ['countryId' => 'CH', 'postcode' => '1234'], + ['countryId' => 'CK', 'postcode' => '1234'], + ['countryId' => 'CL', 'postcode' => '1234567'], ['countryId' => 'CN', 'postcode' => '123456'], - ['countryId' => 'HR', 'postcode' => '12345'], + ['countryId' => 'CR', 'postcode' => '12345'], + ['countryId' => 'CS', 'postcode' => '12345'], ['countryId' => 'CU', 'postcode' => '12345'], + ['countryId' => 'CV', 'postcode' => '1234'], + ['countryId' => 'CX', 'postcode' => '6798'], ['countryId' => 'CY', 'postcode' => '1234'], ['countryId' => 'CZ', 'postcode' => '123 45'], + ['countryId' => 'DE', 'postcode' => '12345'], ['countryId' => 'DK', 'postcode' => '1234'], + ['countryId' => 'DO', 'postcode' => '12345'], + ['countryId' => 'DZ', 'postcode' => '12345'], + ['countryId' => 'EC', 'postcode' => 'A1234B'], + ['countryId' => 'EC', 'postcode' => 'AB123456'], + ['countryId' => 'EC', 'postcode' => '123456'], ['countryId' => 'EE', 'postcode' => '12345'], + ['countryId' => 'EG', 'postcode' => '12345'], + ['countryId' => 'ES', 'postcode' => '12345'], + ['countryId' => 'ET', 'postcode' => '1234'], ['countryId' => 'FI', 'postcode' => '12345'], + ['countryId' => 'FK', 'postcode' => 'FIQQ 1ZZ'], + ['countryId' => 'FM', 'postcode' => '96941'], + ['countryId' => 'FO', 'postcode' => '123'], ['countryId' => 'FR', 'postcode' => '12345'], - ['countryId' => 'GF', 'postcode' => '12345'], + ['countryId' => 'GB', 'postcode' => 'PL12 3RT'], + ['countryId' => 'GB', 'postcode' => 'P1L 2RT'], + ['countryId' => 'GB', 'postcode' => 'QW1 2RT'], + ['countryId' => 'GB', 'postcode' => 'QW1R 2TG'], + ['countryId' => 'GB', 'postcode' => 'L12 3PL'], + ['countryId' => 'GB', 'postcode' => 'Q1 2PL'], ['countryId' => 'GE', 'postcode' => '1234'], - ['countryId' => 'DE', 'postcode' => '12345'], - ['countryId' => 'GR', 'postcode' => '123 45'], + ['countryId' => 'GF', 'postcode' => '12345'], + ['countryId' => 'GG', 'postcode' => 'PL5 7TH'], ['countryId' => 'GL', 'postcode' => '1234'], + ['countryId' => 'GH', 'postcode' => 'GA18400'], + ['countryId' => 'GN', 'postcode' => '123'], ['countryId' => 'GP', 'postcode' => '12345'], + ['countryId' => 'GR', 'postcode' => '123 45'], + ['countryId' => 'GS', 'postcode' => 'SIQQ 1ZZ'], + ['countryId' => 'GT', 'postcode' => '12345'], ['countryId' => 'GU', 'postcode' => '12345'], - ['countryId' => 'GG', 'postcode' => 'PL5 7TH'], + ['countryId' => 'GW', 'postcode' => '1234'], + ['countryId' => 'HM', 'postcode' => '1234'], + ['countryId' => 'HN', 'postcode' => '12345'], + ['countryId' => 'HR', 'postcode' => '12345'], + ['countryId' => 'HT', 'postcode' => '1234'], ['countryId' => 'HU', 'postcode' => '1234'], - ['countryId' => 'IS', 'postcode' => '123'], - ['countryId' => 'IN', 'postcode' => '123456'], + ['countryId' => 'IC', 'postcode' => '12345'], ['countryId' => 'ID', 'postcode' => '12345'], ['countryId' => 'IL', 'postcode' => '1234567'], + ['countryId' => 'IM', 'postcode' => 'IM1 1AD'], + ['countryId' => 'IN', 'postcode' => '123456'], + ['countryId' => 'IS', 'postcode' => '123'], ['countryId' => 'IT', 'postcode' => '12345'], + ['countryId' => 'JE', 'postcode' => 'TY8 9PL'], + ['countryId' => 'JO', 'postcode' => '12345'], ['countryId' => 'JP', 'postcode' => '123-4567'], ['countryId' => 'JP', 'postcode' => '1234567'], - ['countryId' => 'JE', 'postcode' => 'TY8 9PL'], - ['countryId' => 'KZ', 'postcode' => '123456'], ['countryId' => 'KE', 'postcode' => '12345'], - ['countryId' => 'KR', 'postcode' => '123-456'], ['countryId' => 'KG', 'postcode' => '123456'], - ['countryId' => 'LV', 'postcode' => '1234'], + ['countryId' => 'KH', 'postcode' => '12345'], + ['countryId' => 'KR', 'postcode' => '123-456'], + ['countryId' => 'KW', 'postcode' => '12345'], + ['countryId' => 'KZ', 'postcode' => '123456'], + ['countryId' => 'LA', 'postcode' => '12345'], + ['countryId' => 'LB', 'postcode' => '1234 5678'], ['countryId' => 'LI', 'postcode' => '1234'], + ['countryId' => 'LK', 'postcode' => '12345'], ['countryId' => 'LT', 'postcode' => '12345'], ['countryId' => 'LU', 'postcode' => '1234'], - ['countryId' => 'MK', 'postcode' => '1234'], + ['countryId' => 'LV', 'postcode' => '1234'], + ['countryId' => 'MA', 'postcode' => '12345'], + ['countryId' => 'MC', 'postcode' => '12345'], + ['countryId' => 'ME', 'postcode' => '81101'], + ['countryId' => 'MD', 'postcode' => '1234'], ['countryId' => 'MG', 'postcode' => '123'], - ['countryId' => 'MY', 'postcode' => '12345'], - ['countryId' => 'MV', 'postcode' => '12345'], - ['countryId' => 'MV', 'postcode' => '1234'], - ['countryId' => 'MT', 'postcode' => 'WRT 123'], - ['countryId' => 'MT', 'postcode' => 'WRT 45'], ['countryId' => 'MH', 'postcode' => '12345'], + ['countryId' => 'MK', 'postcode' => '1234'], + ['countryId' => 'MN', 'postcode' => '123456'], + ['countryId' => 'MP', 'postcode' => '12345'], ['countryId' => 'MQ', 'postcode' => '12345'], + ['countryId' => 'MS', 'postcode' => 'MSR1250'], + ['countryId' => 'MT', 'postcode' => 'WRT 123'], + ['countryId' => 'MT', 'postcode' => 'WRT 45'], + ['countryId' => 'MU', 'postcode' => 'A1201'], + ['countryId' => 'MU', 'postcode' => '80110'], + ['countryId' => 'MV', 'postcode' => '12345'], + ['countryId' => 'MV', 'postcode' => '1234'], ['countryId' => 'MX', 'postcode' => '12345'], - ['countryId' => 'MD', 'postcode' => '1234'], - ['countryId' => 'MC', 'postcode' => '12345'], - ['countryId' => 'MN', 'postcode' => '123456'], - ['countryId' => 'MA', 'postcode' => '12345'], + ['countryId' => 'MY', 'postcode' => '12345'], + ['countryId' => 'NC', 'postcode' => '98800'], + ['countryId' => 'NE', 'postcode' => '1234'], + ['countryId' => 'NF', 'postcode' => '2899'], + ['countryId' => 'NG', 'postcode' => '123456'], + ['countryId' => 'NI', 'postcode' => '22500'], ['countryId' => 'NL', 'postcode' => '1234 TR'], ['countryId' => 'NO', 'postcode' => '1234'], - ['countryId' => 'PK', 'postcode' => '12345'], + ['countryId' => 'NP', 'postcode' => '12345'], + ['countryId' => 'NZ', 'postcode' => '1234'], + ['countryId' => 'OM', 'postcode' => 'PC 123'], + ['countryId' => 'PA', 'postcode' => '1234'], + ['countryId' => 'PF', 'postcode' => '98701'], + ['countryId' => 'PG', 'postcode' => '123'], ['countryId' => 'PH', 'postcode' => '1234'], + ['countryId' => 'PK', 'postcode' => '12345'], ['countryId' => 'PL', 'postcode' => '12-345'], + ['countryId' => 'PM', 'postcode' => '97500'], + ['countryId' => 'PN', 'postcode' => 'PCRN 1ZZ'], + ['countryId' => 'PR', 'postcode' => '12345'], ['countryId' => 'PT', 'postcode' => '1234'], ['countryId' => 'PT', 'postcode' => '1234-567'], - ['countryId' => 'PR', 'postcode' => '12345'], + ['countryId' => 'PW', 'postcode' => '96939'], + ['countryId' => 'PW', 'postcode' => '96940'], + ['countryId' => 'PY', 'postcode' => '1234'], ['countryId' => 'RE', 'postcode' => '12345'], ['countryId' => 'RO', 'postcode' => '123456'], ['countryId' => 'RU', 'postcode' => '123456'], - ['countryId' => 'MP', 'postcode' => '12345'], - ['countryId' => 'CS', 'postcode' => '12345'], + ['countryId' => 'SA', 'postcode' => '12345'], + ['countryId' => 'SE', 'postcode' => '123 45'], ['countryId' => 'SG', 'postcode' => '123456'], - ['countryId' => 'SK', 'postcode' => '123 45'], + ['countryId' => 'SH', 'postcode' => 'ASCN 1ZZ'], ['countryId' => 'SI', 'postcode' => '1234'], - ['countryId' => 'ZA', 'postcode' => '1234'], - ['countryId' => 'ES', 'postcode' => '12345'], - ['countryId' => 'XY', 'postcode' => '12345'], + ['countryId' => 'SJ', 'postcode' => '1234'], + ['countryId' => 'SK', 'postcode' => '123 45'], + ['countryId' => 'SM', 'postcode' => '47890'], + ['countryId' => 'SN', 'postcode' => '12345'], + ['countryId' => 'SO', 'postcode' => '12345'], ['countryId' => 'SZ', 'postcode' => 'R123'], - ['countryId' => 'SE', 'postcode' => '123 45'], - ['countryId' => 'CH', 'postcode' => '1234'], - ['countryId' => 'TW', 'postcode' => '123'], - ['countryId' => 'TW', 'postcode' => '12345'], - ['countryId' => 'TJ', 'postcode' => '123456'], + ['countryId' => 'TC', 'postcode' => 'TKCA 1ZZ'], ['countryId' => 'TH', 'postcode' => '12345'], - ['countryId' => 'TR', 'postcode' => '12345'], + ['countryId' => 'TJ', 'postcode' => '123456'], ['countryId' => 'TM', 'postcode' => '123456'], - ['countryId' => 'UA', 'postcode' => '12345'], - ['countryId' => 'GB', 'postcode' => 'PL12 3RT'], - ['countryId' => 'GB', 'postcode' => 'P1L 2RT'], - ['countryId' => 'GB', 'postcode' => 'QW1 2RT'], - ['countryId' => 'GB', 'postcode' => 'QW1R 2TG'], - ['countryId' => 'GB', 'postcode' => 'L12 3PL'], - ['countryId' => 'GB', 'postcode' => 'Q1 2PL'], + ['countryId' => 'TN', 'postcode' => '1234'], + ['countryId' => 'TR', 'postcode' => '12345'], + ['countryId' => 'TT', 'postcode' => '120110'], + ['countryId' => 'TW', 'postcode' => '123'], + ['countryId' => 'TW', 'postcode' => '12345'], + ['countryId' => 'UA', 'postcode' => '02232'], ['countryId' => 'US', 'postcode' => '12345-6789'], ['countryId' => 'US', 'postcode' => '12345'], ['countryId' => 'UY', 'postcode' => '12345'], ['countryId' => 'UZ', 'postcode' => '123456'], + ['countryId' => 'VA', 'postcode' => '00120'], + ['countryId' => 'VE', 'postcode' => '1234'], ['countryId' => 'VI', 'postcode' => '12345'], + ['countryId' => 'WF', 'postcode' => '98601'], + ['countryId' => 'XK', 'postcode' => '12345'], + ['countryId' => 'XY', 'postcode' => '12345'], + ['countryId' => 'YT', 'postcode' => '97601'], + ['countryId' => 'ZA', 'postcode' => '1234'], + ['countryId' => 'ZM', 'postcode' => '12345'], ]; } } diff --git a/dev/tests/integration/testsuite/Magento/Directory/Model/RegionTest.php b/dev/tests/integration/testsuite/Magento/Directory/Model/RegionTest.php index 44c8377f1eaf7..d90131948d9bb 100644 --- a/dev/tests/integration/testsuite/Magento/Directory/Model/RegionTest.php +++ b/dev/tests/integration/testsuite/Magento/Directory/Model/RegionTest.php @@ -58,6 +58,15 @@ public function getCountryIdDataProvider():array ['countryId' => 'PL'], ['countryId' => 'IT'], ['countryId' => 'BG'], + ['countryId' => 'AR'], + ['countryId' => 'BO'], + ['countryId' => 'CL'], + ['countryId' => 'EC'], + ['countryId' => 'GY'], + ['countryId' => 'PY'], + ['countryId' => 'PE'], + ['countryId' => 'SR'], + ['countryId' => 'VE'], ['countryId' => 'PT'], ['countryId' => 'IS'], ['countryId' => 'SE'], diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/DownloadableTest.php b/dev/tests/integration/testsuite/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/DownloadableTest.php new file mode 100644 index 0000000000000..f208ded746150 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/DownloadableTest.php @@ -0,0 +1,83 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Downloadable\Block\Sales\Order\Email\Items\Order; + +use Magento\Checkout\Model\Session as CheckoutSession; +use Magento\Framework\ObjectManagerInterface; +use Magento\Quote\Api\GuestCartManagementInterface; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\QuoteIdMask; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Mail\Template\TransportBuilderMock; +use PHPUnit\Framework\TestCase; +use Magento\Quote\Model\QuoteIdMaskFactory; + +/** + * Test order confirmation email for downloadable product. + * + * @magentoDbIsolation enabled + * @magentoAppArea frontend + */ +class DownloadableTest extends TestCase +{ + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @var TransportBuilderMock + */ + private $transportBuilder; + + /** + * @var QuoteIdMaskFactory + */ + private $quoteIdMaskFactory; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $this->objectManager = Bootstrap::getObjectManager(); + $this->transportBuilder = $this->objectManager->get(TransportBuilderMock::class); + $this->quoteIdMaskFactory = $this->objectManager->get(QuoteIdMaskFactory::class); + } + + /** + * @magentoDataFixture Magento/Downloadable/_files/quote_with_configurable_downloadable_product.php + * @return void + */ + public function testShouldSendDownloadableLinksInTheEmail(): void + { + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); + $quote->load('reserved_order_configurable_downloadable', 'reserved_order_id'); + + $checkoutSession = $this->objectManager->get(CheckoutSession::class); + $checkoutSession->setQuoteId($quote->getId()); + + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = $this->quoteIdMaskFactory->create(); + $quoteIdMask->load($quote->getId(), 'quote_id'); + $cartId = $quoteIdMask->getMaskedId(); + + /** @var GuestCartManagementInterface $cartManagement */ + $cartManagement = $this->objectManager->get(GuestCartManagementInterface::class); + $cartManagement->placeOrder($cartId); + + $message = $this->transportBuilder->getSentMessage(); + $rawMessage = $message->getBody()->getParts()[0]->getRawContent(); + $this->assertStringContainsString('Configurable Downloadable Product', $rawMessage); + $this->assertStringContainsString('SKU: downloadable-product', $rawMessage); + $this->assertStringContainsString('Downloadable Product Link', $rawMessage); + $this->assertStringContainsString('/downloadable/download/link/id/', $rawMessage); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_configurable_downloadable.php b/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_configurable_downloadable.php new file mode 100644 index 0000000000000..83b15848cd292 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_configurable_downloadable.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductExtensionInterfaceFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Catalog\Model\ProductFactory; +use Magento\ConfigurableProduct\Helper\Product\Options\Factory; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable; +use Magento\Eav\Model\Config; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/ConfigurableProduct/_files/configurable_attribute.php'); +Resolver::getInstance()->requireDataFixture('Magento/Downloadable/_files/product_downloadable.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var ProductFactory $productFactory */ +$productFactory = $objectManager->get(ProductFactory::class); +/** @var Factory $optionsFactory */ +$optionsFactory = $objectManager->get(Factory::class); +/** @var ProductExtensionInterfaceFactory $productExtensionAttributes */ +$productExtensionAttributesFactory = $objectManager->get(ProductExtensionInterfaceFactory::class); +/** @var WebsiteRepositoryInterface $websiteRepository */ +$websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); +$defaultWebsiteId = $websiteRepository->get('base')->getId(); +/** @var Config $eavConfig */ +$eavConfig = $objectManager->get(Config::class); +$attribute = $eavConfig->getAttribute(Product::ENTITY, 'test_configurable'); +$option = $attribute->getSource()->getOptionId('Option 1'); +$downloadableProduct = $productRepository->get('downloadable-product'); +$downloadableProduct->setTestConfigurable($option); +$productRepository->save($downloadableProduct); + +$configurableOptions = $optionsFactory->create( + [ + [ + 'attribute_id' => $attribute->getId(), + 'code' => $attribute->getAttributeCode(), + 'label' => $attribute->getStoreLabel(), + 'position' => '0', + 'values' => [['label' => 'test', 'attribute_id' => $attribute->getId(), 'value_index' => $option]], + ], + ] +); +$extensionConfigurableAttributes = $downloadableProduct->getExtensionAttributes() + ?: $productExtensionAttributesFactory->create(); +$extensionConfigurableAttributes->setConfigurableProductOptions($configurableOptions); +$extensionConfigurableAttributes->setConfigurableProductLinks([$downloadableProduct->getId()]); + +$configurableProduct = $productFactory->create(); +$configurableProduct->setExtensionAttributes($extensionConfigurableAttributes); +$configurableProduct->setTypeId(Configurable::TYPE_CODE) + ->setAttributeSetId($configurableProduct->getDefaultAttributeSetId()) + ->setWebsiteIds([$defaultWebsiteId]) + ->setName('Configurable Downloadable Product') + ->setSku('configurable_downloadable') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 1, 'is_in_stock' => 1]); +$productRepository->save($configurableProduct); diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_configurable_downloadable_rollback.php b/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_configurable_downloadable_rollback.php new file mode 100644 index 0000000000000..3fd6af0e6b89b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_configurable_downloadable_rollback.php @@ -0,0 +1,32 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +try { + $product = $productRepository->get('configurable_downloadable'); + $productRepository->delete($product); +} catch (NoSuchEntityException $e) { + //Product already removed +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); +Resolver::getInstance()->requireDataFixture('Magento/Downloadable/_files/product_downloadable_rollback.php'); +Resolver::getInstance()->requireDataFixture('Magento/ConfigurableProduct/_files/configurable_attribute_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/_files/quote_with_configurable_downloadable_product.php b/dev/tests/integration/testsuite/Magento/Downloadable/_files/quote_with_configurable_downloadable_product.php new file mode 100644 index 0000000000000..bb17a119f0d6d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Downloadable/_files/quote_with_configurable_downloadable_product.php @@ -0,0 +1,87 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Eav\Model\Config; +use Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection; +use Magento\Framework\DataObject; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Address; +use Magento\Quote\Model\QuoteIdMask; +use Magento\Quote\Model\QuoteIdMaskFactory; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Downloadable/_files/product_configurable_downloadable.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +$downloadableProduct = $productRepository->get('downloadable-product'); +$configurableProduct = $productRepository->get('configurable_downloadable'); +/** @var $options Collection */ +$options = $objectManager->create(Collection::class); +/** @var Config $eavConfig */ +$eavConfig = $objectManager->get(Config::class); +$attribute = $eavConfig->getAttribute(Product::ENTITY, 'test_configurable'); +$option = $options->setAttributeFilter($attribute->getId())->getFirstItem(); +$requestInfo = new DataObject( + [ + 'product_id' => $configurableProduct->getId(), + 'selected_configurable_option' => $downloadableProduct->getId(), + 'qty' => 1, + 'super_attribute' => [ + $attribute->getId() => $option->getId() + ], + 'links' => array_keys($downloadableProduct->getDownloadableLinks()) + ] +); +$addressData = [ + 'telephone' => 3234676, + 'postcode' => 47676, + 'country_id' => 'DE', + 'city' => 'CityX', + 'street' => ['Black str, 48'], + 'lastname' => 'Smith', + 'firstname' => 'John', + 'vat_id' => 12345, + 'address_type' => 'shipping', + 'email' => 'some_email@mail.com', +]; + +$billingAddress = $objectManager->create( + Address::class, + ['data' => $addressData] +); +$billingAddress->setAddressType('billing'); +$shippingAddress = clone $billingAddress; +$shippingAddress->setId(null)->setAddressType('shipping'); + +/** @var Quote $quote */ +$quote = $objectManager->create(Quote::class); +$quote->setCustomerIsGuest(true) + ->setStoreId($objectManager->get(StoreManagerInterface::class)->getStore()->getId()) + ->setReservedOrderId('reserved_order_configurable_downloadable') + ->setIsMultiShipping(false) + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress) + ->addProduct($configurableProduct, $requestInfo); + +$quote->getPayment()->setMethod('checkmo'); +$quote->getShippingAddress()->setShippingMethod('flatrate_flatrate')->setCollectShippingRates(true); +$quote->collectTotals(); +$quote->save(); + +/** @var QuoteIdMask $quoteIdMask */ +$quoteIdMask = $objectManager + ->create(QuoteIdMaskFactory::class) + ->create(); +$quoteIdMask->setQuoteId($quote->getId()); +$quoteIdMask->setDataChanges(true); +$quoteIdMask->save(); diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/_files/quote_with_configurable_downloadable_product_rollback.php b/dev/tests/integration/testsuite/Magento/Downloadable/_files/quote_with_configurable_downloadable_product_rollback.php new file mode 100644 index 0000000000000..46fecf75bb587 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Downloadable/_files/quote_with_configurable_downloadable_product_rollback.php @@ -0,0 +1,21 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +/** @var $objectManager \Magento\TestFramework\ObjectManager */ +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +$quote = $objectManager->create(\Magento\Quote\Model\Quote::class); +$quote->load('reserved_order_configurable_downloadable', 'reserved_order_id')->delete(); + +/** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */ +$quoteIdMask = $objectManager->create(\Magento\Quote\Model\QuoteIdMask::class); +$quoteIdMask->delete($quote->getId()); + +Resolver::getInstance()->requireDataFixture( + 'Magento/Downloadable/_files/product_configurable_downloadable_rollback.php' +); diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DatetimeTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DatetimeTest.php new file mode 100644 index 0000000000000..38c4c72e9ed86 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DatetimeTest.php @@ -0,0 +1,104 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Eav\Model\Entity\Attribute\Frontend; + +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Store\ExecuteInStoreContext; +use PHPUnit\Framework\TestCase; + +/** + * Checks Datetime attribute's frontend model + * + * @magentoAppArea frontend + * + * @see \Magento\Eav\Model\Entity\Attribute\Frontend\Datetime + */ +class DatetimeTest extends TestCase +{ + /** + * @var int + */ + private const ONE_HOUR_IN_MILLISECONDS = 3600; + + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @var ProductAttributeRepositoryInterface + */ + private $attributeRepository; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var DateTime + */ + private $dateTime; + + /** + * @var ExecuteInStoreContext + */ + private $executeInStoreContext; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->attributeRepository = $this->objectManager->get(ProductAttributeRepositoryInterface::class); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $this->productRepository->cleanCache(); + $this->dateTime = $this->objectManager->create(DateTime::class); + $this->executeInStoreContext = $this->objectManager->get(ExecuteInStoreContext::class); + } + + /** + * @magentoDbIsolation disabled + * + * @magentoDataFixture Magento/Catalog/_files/product_two_websites.php + * @magentoDataFixture Magento/Catalog/_files/product_datetime_attribute.php + * + * @magentoConfigFixture default_store general/locale/timezone Asia/Tokyo + * @magentoConfigFixture fixture_second_store_store general/locale/timezone Asia/Shanghai + * + * @return void + */ + public function testFrontendValueOnDifferentWebsites(): void + { + $attribute = $this->attributeRepository->get('datetime_attribute'); + $product = $this->productRepository->get('simple-on-two-websites'); + $product->setDatetimeAttribute($this->dateTime->date('Y-m-d H:i:s')); + $firstWebsiteValue = $this->executeInStoreContext->execute( + 'default', + [$attribute->getFrontend(), 'getValue'], + $product + ); + $secondWebsiteValue = $this->executeInStoreContext->execute( + 'fixture_second_store', + [$attribute->getFrontend(), 'getValue'], + $product + ); + $this->assertEquals( + self::ONE_HOUR_IN_MILLISECONDS, + $this->dateTime->gmtTimestamp($firstWebsiteValue) - $this->dateTime->gmtTimestamp($secondWebsiteValue), + 'The difference between values per different timezones is incorrect' + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template_reset_password_user_notification.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template_reset_password_user_notification.php new file mode 100644 index 0000000000000..7b43b6b4b411f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template_reset_password_user_notification.php @@ -0,0 +1,15 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +$origTemplateCode = 'admin_emails_forgot_email_template'; +/** @var \Magento\Email\Model\Template $template */ +$template = $objectManager->create(\Magento\Email\Model\Template::class); +$template->loadDefault($origTemplateCode); +$template->setTemplateCode('Reset Password User Notification Custom Code'); +$template->setOrigTemplateCode('admin_emails_forgot_email_template'); +$template->setId(null); +$template->save(); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Cache/Frontend/FactoryTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Cache/Frontend/FactoryTest.php index da17cc4c36e5f..c8f8b36ccc6e8 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Cache/Frontend/FactoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Cache/Frontend/FactoryTest.php @@ -3,36 +3,43 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Framework\App\Cache\Frontend; +use Magento\Framework\App\Area; +use Magento\Framework\Cache\Backend\Redis; +use Magento\Framework\Cache\FrontendInterface; +use Magento\Framework\ObjectManagerInterface; use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; -class FactoryTest extends \PHPUnit\Framework\TestCase +class FactoryTest extends TestCase { /** * Object Manager * - * @var \Magento\Framework\ObjectManagerInterface + * @var ObjectManagerInterface */ private $objectManager; /** - * @var \Magento\Framework\App\Cache\Frontend\Factory + * @var Factory */ private $factory; /** - * @var \Magento\Framework\App\Area + * @var Area */ private $model; + /** + * @ingeritdoc + */ protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); - $this->factory = $this->objectManager->create( - \Magento\Framework\App\Cache\Frontend\Factory::class - ); + $this->factory = $this->objectManager->create(Factory::class); } /** @@ -75,4 +82,22 @@ public function testRemoteSynchronizedCache() $this->assertEquals($this->model->load($identifier), $data); $this->assertEquals($this->model->load($secondIdentifier), $secondData); } + + /** + * Verify factory will create cache frontend instance with default options in case Redis is not available. + * + * @return void + */ + public function testCreateCacheFrontedInstanceWithFallbackToDefaultOptions(): void + { + $options = [ + 'backend_options' => [ + 'server' => null, + ], + 'id_prefix' => 'test_prefix', + 'backend' => Redis::class, + ]; + + self::assertInstanceOf(FrontendInterface::class, $this->factory->create($options)); + } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/ControllerActionTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/ControllerActionTest.php deleted file mode 100644 index 12be7607e1872..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Framework/App/ControllerActionTest.php +++ /dev/null @@ -1,207 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -declare(strict_types=1); - -namespace Magento\Framework\App; - -use Magento\Backend\Model\Auth as BackendAuth; -use Magento\Backend\Model\UrlInterface as BackendUrl; -use Magento\Framework\App\TestStubs\InheritanceBasedBackendAction; -use Magento\Framework\App\TestStubs\InheritanceBasedFrontendAction; -use Magento\Framework\App\TestStubs\InterfaceOnlyBackendAction; -use Magento\Framework\App\TestStubs\InterfaceOnlyFrontendAction; -use Magento\Framework\Event; -use Magento\TestFramework\Bootstrap as TestFramework; -use Magento\TestFramework\ObjectManager; -use Magento\TestFramework\Request as TestHttpRequest; -use PHPUnit\Framework\TestCase; - -/** - * @magentoAppIsolation enabled - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @SuppressWarnings(PHPMD.UnusedLocalVariable) - * @SuppressWarnings(PHPMD.StaticAccess) - */ -class ControllerActionTest extends TestCase -{ - public function setupEventManagerSpy() - { - /** @var ObjectManager $objectManager */ - $objectManager = ObjectManager::getInstance(); - - $originalEventManager = $objectManager->create(Event\ManagerInterface::class); - $eventManagerSpy = new class($originalEventManager) implements Event\ManagerInterface { - /** - * @var Event\ManagerInterface - */ - private $delegate; - - /** - * @var array[]; - */ - private $dispatchedEvents = []; - - public function __construct(Event\ManagerInterface $delegate) - { - $this->delegate = $delegate; - } - - public function dispatch($eventName, array $data = []) - { - $this->dispatchedEvents[$eventName][] = [$eventName, $data]; - $this->delegate->dispatch($eventName, $data); - } - - public function spyOnDispatchedEvent(string $eventName): array - { - return $this->dispatchedEvents[$eventName] ?? []; - } - }; - - $objectManager->addSharedInstance($eventManagerSpy, get_class($originalEventManager)); - } - - private function assertEventDispatchCount($eventName, $expectedCount) - { - $message = sprintf('Event %s was expected to be dispatched %d time(s).', $eventName, $expectedCount); - $this->assertCount($expectedCount, $this->getEventManager()->spyOnDispatchedEvent($eventName), $message); - } - - /** - * @return TestHttpRequest - */ - private function getRequest(): RequestInterface - { - return ObjectManager::getInstance()->get(TestHttpRequest::class); - } - - private function fakeAuthenticatedBackendRequest() - { - $objectManager = ObjectManager::getInstance(); - $objectManager->get(BackendUrl::class)->turnOffSecretKey(); - - $auth = $objectManager->get(BackendAuth::class); - $auth->login(TestFramework::ADMIN_NAME, TestFramework::ADMIN_PASSWORD); - } - - private function configureRequestForAction(string $route, string $actionPath, string $actionName) - { - $request = $this->getRequest(); - - $request->setRouteName($route); - $request->setControllerName($actionPath); - $request->setActionName($actionName); - $request->setDispatched(); - } - - private function getEventManager(): Event\ManagerInterface - { - return ObjectManager::getInstance()->get(Event\ManagerInterface::class); - } - - private function assertPreAndPostDispatchEventsAreDispatched() - { - $this->assertEventDispatchCount('controller_action_predispatch', 1); - $this->assertEventDispatchCount('controller_action_predispatch_testroute', 1); - $this->assertEventDispatchCount('controller_action_predispatch_testroute_actionpath_actionname', 1); - $this->assertEventDispatchCount('controller_action_postdispatch_testroute_actionpath_actionname', 1); - $this->assertEventDispatchCount('controller_action_postdispatch_testroute', 1); - $this->assertEventDispatchCount('controller_action_postdispatch', 1); - } - - /** - * @magentoAppArea frontend - */ - public function testInheritanceBasedFrontendActionDispatchesEvents() - { - $this->setupEventManagerSpy(); - - /** @var InheritanceBasedFrontendAction $action */ - $action = ObjectManager::getInstance()->create(InheritanceBasedFrontendAction::class); - $this->configureRequestForAction('testroute', 'actionpath', 'actionname'); - - $action->dispatch($this->getRequest()); - - $this->assertPreAndPostDispatchEventsAreDispatched(); - } - - /** - * @magentoAppArea frontend - */ - public function testInterfaceOnlyFrontendActionDispatchesEvents() - { - $this->setupEventManagerSpy(); - - /** @var InterfaceOnlyFrontendAction $action */ - $action = ObjectManager::getInstance()->create(InterfaceOnlyFrontendAction::class); - $this->configureRequestForAction('testroute', 'actionpath', 'actionname'); - - $action->execute(); - - $this->assertPreAndPostDispatchEventsAreDispatched(); - } - - /** - * @magentoAppArea adminhtml - */ - public function testInheritanceBasedAdminhtmlActionDispatchesEvents() - { - $this->fakeAuthenticatedBackendRequest(); - - $this->setupEventManagerSpy(); - - /** @var InheritanceBasedBackendAction $action */ - $action = ObjectManager::getInstance()->create(InheritanceBasedBackendAction::class); - $this->configureRequestForAction('testroute', 'actionpath', 'actionname'); - - $action->dispatch($this->getRequest()); - - $this->assertPreAndPostDispatchEventsAreDispatched(); - } - - /** - * @magentoAppArea adminhtml - */ - public function testInterfaceOnlyAdminhtmlActionDispatchesEvents() - { - $this->setupEventManagerSpy(); - - /** @var InterfaceOnlyBackendAction $action */ - $action = ObjectManager::getInstance()->create(InterfaceOnlyBackendAction::class); - $this->configureRequestForAction('testroute', 'actionpath', 'actionname'); - - $action->execute(); - - $this->assertPreAndPostDispatchEventsAreDispatched(); - } - - /** - * @magentoAppArea frontend - */ - public function testSettingTheNoDispatchActionFlagProhibitsExecuteAndPostdispatchEvents() - { - $this->setupEventManagerSpy(); - - /** @var InterfaceOnlyFrontendAction $action */ - $action = ObjectManager::getInstance()->create(InterfaceOnlyFrontendAction::class); - $this->configureRequestForAction('testroute', 'actionpath', 'actionname'); - - /** @var ActionFlag $actionFlag */ - $actionFlag = ObjectManager::getInstance()->get(ActionFlag::class); - $actionFlag->set('', ActionInterface::FLAG_NO_DISPATCH, true); - - $action->execute(); - - $this->assertFalse($action->isExecuted(), 'The controller execute() method was not expected to be called.'); - $this->assertEventDispatchCount('controller_action_predispatch', 1); - $this->assertEventDispatchCount('controller_action_predispatch_testroute', 1); - $this->assertEventDispatchCount('controller_action_predispatch_testroute_actionpath_actionname', 1); - $this->assertEventDispatchCount('controller_action_postdispatch_testroute_actionpath_actionname', 0); - $this->assertEventDispatchCount('controller_action_postdispatch_testroute', 0); - $this->assertEventDispatchCount('controller_action_postdispatch', 0); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/FrontControllerEventsTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/FrontControllerEventsTest.php new file mode 100644 index 0000000000000..3a40833155d26 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/FrontControllerEventsTest.php @@ -0,0 +1,195 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\App; + +use Magento\Framework\Event\ManagerInterface; +use Magento\TestFramework\ObjectManager; +use Magento\TestFramework\Request as TestHttpRequest; +use Magento\TestFramework\Response; +use PHPUnit\Framework\TestCase; + +/** + * @magentoAppIsolation enabled + */ +class FrontControllerEventsTest extends TestCase +{ + /** + * @var ManagerInterface + */ + private $eventManager; + + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * @var TestHttpRequest + */ + private $request; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->objectManager = ObjectManager::getInstance(); + $this->setupEventManagerSpy(); + $this->eventManager = $this->objectManager->get(ManagerInterface::class); + $this->request = $this->objectManager->get(TestHttpRequest::class); + } + + /** + * Test if frontend controller dispatches events + * + * @magentoAppArea frontend + * + * @return void + */ + public function testFrontendControllerDispatchesEvents(): void + { + $this->setupEventManagerSpy(); + + /** @var FrontControllerInterface $frontController */ + $frontController = ObjectManager::getInstance()->create(FrontControllerInterface::class); + $this->configureRequestForAction('cms', 'index', 'index'); + $frontController->dispatch($this->request); + + $this->assertPreAndPostDispatchEventsAreDispatched(); + } + + /** + * Test if no dispatch flag prevents dispatching action + * + * @magentoAppArea frontend + * + * @return void + */ + public function testSettingTheNoDispatchActionFlagProhibitsExecuteAndPostdispatchEvents(): void + { + $this->setupEventManagerSpy(); + + /** @var FrontControllerInterface $frontController */ + $frontController = ObjectManager::getInstance()->create(FrontControllerInterface::class); + $this->configureRequestForAction('cms', 'index', 'index'); + + /** @var ActionFlag $actionFlag */ + $actionFlag = ObjectManager::getInstance()->get(ActionFlag::class); + $actionFlag->set('', ActionInterface::FLAG_NO_DISPATCH, true); + + $result1 = $frontController->dispatch($this->request); + $this->assertTrue($result1 instanceof Response, 'Action was dispatched!'); + $this->assertPreDispatchEventsAreDispatched(); + } + + /** + * Prepare spy on event manager + * + * @return void + */ + public function setupEventManagerSpy(): void + { + $eventManager = $this->objectManager->get(ManagerInterface::class); + $eventManagerSpy = new class($eventManager) implements ManagerInterface { + /** + * @var ManagerInterface + */ + private $delegate; + + /** + * @var array[]; + */ + private $dispatchedEvents; + + /** + * @param ManagerInterface $delegate + */ + public function __construct(ManagerInterface $delegate) + { + $this->delegate = $delegate; + } + + public function dispatch($eventName, array $data = []) + { + $this->dispatchedEvents[$eventName][] = [$eventName, $data]; + $this->delegate->dispatch($eventName, $data); + } + + public function spyOnDispatchedEvent(string $eventName): array + { + return $this->dispatchedEvents[$eventName] ?? []; + } + }; + + $this->objectManager->addSharedInstance($eventManagerSpy, get_class($eventManager)); + } + + /** + * Check if event was dispatched exactly as many times as expected + * + * @param string $eventName + * @param int $expectedCount + * + * @return void + */ + private function assertEventDispatchCount(string $eventName, int $expectedCount): void + { + $message = sprintf('Event %s was expected to be dispatched %d time(s).', $eventName, $expectedCount); + $this->assertCount($expectedCount, $this->eventManager->spyOnDispatchedEvent($eventName), $message); + } + + /** + * Prepare request for test action + * + * @param string $route + * @param string $actionPath + * @param string $actionName + * + * @return void + */ + private function configureRequestForAction(string $route, string $actionPath, string $actionName): void + { + $request = $this->request; + + $request->setRouteName($route); + $request->setControllerName($actionPath); + $request->setActionName($actionName); + $request->setDispatched(); + $request->setRequestUri("$route/$actionPath/$actionName"); + } + + /** + * Check events dispatched before and after execute + * + * @return void + */ + private function assertPreAndPostDispatchEventsAreDispatched(): void + { + $this->assertEventDispatchCount('controller_action_predispatch', 1); + $this->assertEventDispatchCount('controller_action_predispatch_cms', 1); + $this->assertEventDispatchCount('controller_action_predispatch_cms_index_index', 1); + $this->assertEventDispatchCount('controller_action_postdispatch_cms_index_index', 1); + $this->assertEventDispatchCount('controller_action_postdispatch_cms', 1); + $this->assertEventDispatchCount('controller_action_postdispatch', 1); + } + + /** + * Check events are dispatched only before execute + * + * @return void + */ + private function assertPreDispatchEventsAreDispatched(): void + { + $this->assertEventDispatchCount('controller_action_predispatch', 1); + $this->assertEventDispatchCount('controller_action_predispatch_cms', 1); + $this->assertEventDispatchCount('controller_action_predispatch_cms_index_index', 1); + $this->assertEventDispatchCount('controller_action_postdispatch_cms_index_index', 0); + $this->assertEventDispatchCount('controller_action_postdispatch_cms', 0); + $this->assertEventDispatchCount('controller_action_postdispatch', 0); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/ComposerInformationTest.php b/dev/tests/integration/testsuite/Magento/Framework/Composer/ComposerInformationTest.php index 8f7e29d90290d..e35fdf8f1de07 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Composer/ComposerInformationTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/ComposerInformationTest.php @@ -34,6 +34,9 @@ class ComposerInformationTest extends \PHPUnit\Framework\TestCase */ private $composerFactory; + /** + * @inheritDoc + */ protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); @@ -57,11 +60,6 @@ private function setupDirectory($composerDir) ['root' => __DIR__ . '/_files/' . $composerDir, 'config' => $directories] ); - $this->filesystem = $this->objectManager->create( - \Magento\Framework\Filesystem::class, - ['directoryList' => $this->directoryList] - ); - $this->composerJsonFinder = new ComposerJsonFinder($this->directoryList); $this->composerFactory = new ComposerFactory($this->directoryList, $this->composerJsonFinder); } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/CssInlinerTest.php b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/CssInlinerTest.php index 5ee8e3de6e6e9..9e470a1e538c3 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/CssInlinerTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Css/PreProcessor/Adapter/CssInlinerTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Framework\Css\PreProcessor\Adapter; +use Pelago\Emogrifier\CssInliner as EmogrifierCssInliner; + class CssInlinerTest extends \PHPUnit\Framework\TestCase { /** @@ -34,8 +36,8 @@ public function testGetFiles($htmlFilePath, $cssFilePath, $cssExpected) { $html = file_get_contents($htmlFilePath); $css = file_get_contents($cssFilePath); - $this->model->setCss($css); $this->model->setHtml($html); + $this->model->setCss($css); $result = $this->model->process(); $this->assertStringContainsString($cssExpected, $result); } @@ -68,13 +70,9 @@ public function getFilesDataProvider() */ public function testGetFilesEmogrifier($htmlFilePath, $cssFilePath, $cssExpected) { - $emogrifier = new \Pelago\Emogrifier; - $html = file_get_contents($htmlFilePath); $css = file_get_contents($cssFilePath); - $emogrifier->setCss($css); - $emogrifier->setHtml($html); - $result = $emogrifier->emogrify(); + $result = EmogrifierCssInliner::fromHtml($html)->inlineCss($css)->render(); /** * This test was implemented for the issue which existed in the older version of Emogrifier. diff --git a/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php b/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php index a93e8c198336e..432a5e5e0d45f 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php @@ -207,4 +207,66 @@ public function testCreateTableColumnWithExpressionAsColumnDefaultValue() $this->assertEquals('varchar', $stringColumn['DATA_TYPE'], 'Incorrect column type'); $this->assertEquals('default test text', $stringColumn['DEFAULT'], 'Incorrect column default string value'); } + + /** + * Test get auto increment field + * + * @param array $options + * @param string|bool $expected + * @throws \Zend_Db_Exception + * @dataProvider getAutoIncrementFieldDataProvider + */ + public function testGetAutoIncrementField(array $options, $expected) + { + $adapter = $this->getDbAdapter(); + $tableName = 'table_auto_increment_field'; + + $table = $adapter + ->newTable($tableName) + ->addColumn( + 'row_id', + Table::TYPE_INTEGER, + null, + $options, + 'Row Id' + ) + ->addColumn( + 'created_at', + Table::TYPE_DATETIME, + null, + ['default' => new \Zend_Db_Expr('CURRENT_TIMESTAMP')] + ) + ->addColumn( + 'integer_column', + Table::TYPE_INTEGER, + 11, + ['default' => 123456] + )->addColumn( + 'string_column', + Table::TYPE_TEXT, + 255, + ['default' => 'default test text'] + ) + ->setComment('Test table with auto increment column'); + $adapter->createTable($table); + $autoIncrementField = $adapter->getAutoIncrementField($tableName); + $this->assertEquals($expected, $autoIncrementField); + + //clean up database from test table + $adapter->dropTable($tableName); + } + + public function getAutoIncrementFieldDataProvider() + { + return [ + 'auto increment field' => [ + 'field options' => ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'expected result' => 'row_id', + ], + 'non auto increment field' => [ + 'field options' => ['unsigned' => true, 'nullable' => false,], + 'expected result' => false, + ] + ]; + } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Encryption/ModelTest.php b/dev/tests/integration/testsuite/Magento/Framework/Encryption/ModelTest.php index 95f312df1e53a..673d3f953947d 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Encryption/ModelTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Encryption/ModelTest.php @@ -33,6 +33,8 @@ public function testEncryptDecrypt2() { $encryptor = $this->_model; + // md5() here is not for cryptographic use just generate random string. + // phpcs:ignore Magento2.Security.InsecureFunction $initial = md5(uniqid()); $encrypted = $encryptor->encrypt($initial); $this->assertNotEquals($initial, $encrypted); @@ -41,6 +43,8 @@ public function testEncryptDecrypt2() public function testValidateKey() { + // md5() have to be use here. + // phpcs:ignore Magento2.Security.InsecureFunction $validKey = md5(uniqid()); $this->_model->validateKey($validKey); } diff --git a/dev/tests/integration/testsuite/Magento/Framework/File/UploaderTest.php b/dev/tests/integration/testsuite/Magento/Framework/File/UploaderTest.php index 293831f3850b3..9ce390d2871d4 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/File/UploaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/File/UploaderTest.php @@ -7,6 +7,7 @@ namespace Magento\Framework\File; +use Magento\Customer\Model\FileProcessor; use Magento\Framework\App\Filesystem\DirectoryList; /** @@ -42,27 +43,15 @@ protected function setUp(): void public function testUploadFileFromAllowedFolder(): void { $mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA); - $tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::SYS_TMP); - $fileName = 'text.txt'; - $tmpDir = 'tmp'; - $filePath = $tmpDirectory->getAbsolutePath($fileName); - - $tmpDirectory->writeFile($fileName, 'just a text'); - - $type = [ - 'tmp_name' => $filePath, - 'name' => $fileName, - ]; + $uploader = $this->createUploader($fileName); - $uploader = $this->uploaderFactory->create(['fileId' => $type]); - $uploader->save($mediaDirectory->getAbsolutePath($tmpDir)); + $uploader->save($mediaDirectory->getAbsolutePath(FileProcessor::TMP_DIR)); - $this->assertTrue($mediaDirectory->isFile($tmpDir . DIRECTORY_SEPARATOR . $fileName)); + $this->assertTrue($mediaDirectory->isFile(FileProcessor::TMP_DIR . DIRECTORY_SEPARATOR . $fileName)); } /** - * * @return void */ public function testUploadFileFromNotAllowedFolder(): void @@ -85,6 +74,21 @@ public function testUploadFileFromNotAllowedFolder(): void $this->uploaderFactory->create(['fileId' => $type]); } + /** + * @return void + */ + public function testUploadFileWithExcessiveFolderName(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Destination folder path is too long; must be 255 characters or less'); + + $uploader = $this->createUploader('text.txt'); + $longStringFilePath = __DIR__ . '/_files/fixture_with_long_string.txt'; + $longDirectoryFolderName = file_get_contents($longStringFilePath); + + $uploader->save($longDirectoryFolderName); + } + /** * Upload file test when `Old Media Gallery` is disabled * @@ -144,4 +148,27 @@ protected function tearDown(): void $logDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::LOG); $logDirectory->delete($tmpDir); } + + /** + * Create uploader instance for testing purposes. + * + * @param string $fileName + * + * @return Uploader + */ + private function createUploader(string $fileName): Uploader + { + $tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::SYS_TMP); + + $filePath = $tmpDirectory->getAbsolutePath($fileName); + + $tmpDirectory->writeFile($fileName, 'just a text'); + + $type = [ + 'tmp_name' => $filePath, + 'name' => $fileName, + ]; + + return $this->uploaderFactory->create(['fileId' => $type]); + } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/File/_files/fixture_with_long_string.txt b/dev/tests/integration/testsuite/Magento/Framework/File/_files/fixture_with_long_string.txt new file mode 100644 index 0000000000000..622689d117b34 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/File/_files/fixture_with_long_string.txt @@ -0,0 +1 @@ +Sr2P3cdxfaP54hNgR6D25JuT3elyye4PiuJIjBQYbqWUVDLGoyJ4k3kHYjyJ6ogTBfE6Oqy4H4dJnrORTdgZ7EiQDki2sBCmXiYyzyY0d1uFP5n019WrySrZ4xalNIdbMtukAQ7D4Oi4VkECopVgcCMbVGH91L6ra8Ev8TFK7x4togk12Np77vG4j08787YDCliBvkl7GmL7RbX1RoxQYIOmBImYv0rbbu0ytEYo7k9OfgypWiSLZWaG5egWibmgWzBzUIksgSzz1LCWs2bxfMOI7iv1vP2FX4GrWvSvRnqO9bPsr9YMIW5PCBWBxHsAKjyhnuFydbbV9QfreeuT0SzXx5QzhVpvykNzy87Nq8Pwd8FaKkjsnRYnHOlGpR6LfPj9891fHV4MjcmQ6QoFP7jGI9smkHdJVwWDThGCwaC9BPeXG0vSr5UOqcDL3JOdSqjnJOONYoeH18hOp36pPpzQbEAKnvtwzSe9Wq9kxf3VKeDgyPmnweWUD56vz8LtGgszAHMkUALefaLHbe46AsRDkRPU4tXCIgXXp7uK5e085jxt7Hu8JYX4q5f8RxDFJmTg8jtb85lvFKsYxKEDsXfSv4jPgxDf9yqgVZLZfw36zDaEvCTBlfUK5YDSBpjcQTaRc884ZFg89gaqXWvYSEBXx7n5hRpBMGJTAvPTc323qnt2ggfQkWXeoUt6EkGFGU4qs3VpBFUkzmpjlU27tJtRr8vLRplHPIeEo29UmStHAGQkFisXjdiDrgA33TMuZazRCFAX3w2EN7UaKNlm29APEVZiNo76Bx6ZG8VkwonpPAcHQ3XtDeE6R7J4gihO4DNzjQ8LGVZfMlTIUwOASaQNul2F5HE4zvJk5aff2Rk2VHzdMi8PSphgVbULYRHH3ckylcITYUk5FNKFFxd2HOXLEPPbmb8QRuGoRFARQl66bGcaTsfvuojTXJFf13VS53IMDkW22O7z8j30zgmJqFUKr4YhPPzGPgyW41lYOCOwrCknA4acocKc4Hza6jjxeWHJsqwBfOu39UWFLLepYnGva5IkXXGkdmS3rCHSko3w4uJiLQfhFCbGovtWRCnO9W10ydHBaE2EgVb6gJZ2FQYC0OVqi3nZlJCDhy1IThlzuc055MdgZh6XOpnf9QbvaCm3UiirlZH0YAcyRtYs8zqrZPV3AVE30KYqrNpeOMMK5P694gxbYTq8o8SS44GFW7ohPRxjtq7nzSy5rUcQ4SudYDRvkvnc2o6wivqOj01KYYb4cWBysXMapSgZjHIQ6bgLpHAIMveoRJKGALgSNW60up2UpUrPARHTnYvFTBtYjcGTGe2iQlAD5LlE2ijSKtxIH569SDZGFp2mNkp7dPyu1VUGquCOHqt6vUabu93YfPJ5JVbSSkRdL8TLHH0JaB2RDxZA6uKoPUJ7vSaxenuNDSdjtSUsKE4dALmhLWIZScQPu7he1RObrFJnpX37rp3ac2Zs6Z0ETrtJ8Z0hs8VFBm8AmcItE4cZPErlYypmgmxVgBgnBKWYROR5GChMWiinctHb3yJSRw93Mgu6VqIDOEQro9qZTnNfkiJJFGCQ3MUR119xy32C4ONr5u5JIquOhHEeSx8Bjrn7I5heiYFGd1c3GxN771G30W1mVFsLIDrE4z3PRajbKbPd3mMCUFcNukW7pzi04RflOyW5ez89wkkinxA2QDLFXG0WjPfmSt3MI5NlziW9mJv8JlbCo2fHA0IATabMi1v3ZL5RyN8jmhU42XCr3sy75c2achFGppb85MOTcuVl0ywMyO9QoMn34hYVBBpF2H2PbgDedheMdNWe1AEskRBKfSr3VZ8nJPd2PnzesVjmpMPApKcU8sVpSKvtFW9G7cBfiVf2yMW5fUrSWEZORe6r8BFWKl7LSbD1RumYbzeeuCMHRq867i3E1Q2ag10Bn3IWYj5bZ5xB5Ej9yukxsIyaFJscWD0I8E3vmmir21rzrQHsR9YOuAiBE5MNz8XizvT3hdwW8Steeb1lu65beMvsS0SSO4f8Jp8SQ64BdqQiSiMYS99DZZli33OKyIWY9vYItgVCcJVbakpEOwUgT0l5mTqAnLowCvh5kTZfWTqxYfMGnJEyi30z9h34RiOTO1OZoVGN9TgP1zHlfPsXhdkiWleLfsDb5WymXP2Xjr34E5ILgd3buUglSyjexBZ3FbU4RNRxbZHSginEOerMqZfpSYA75hnJxF6gx94dx8BDWWHbYov6V5551vj7IhMIQUjzg5FV0p20ipOeUDULPPzf79lIMJbYlDrJd1GhFXpWofX1VWCM4uJLSfCrmBc1iLBlgHAD50Eq45OVnnUNmrkdtOq5ay5CPCLwcl0WqWT7ZqHXOjajufgD1x5LZlzlMNvorgLDfO6PgoMDkT7KBWWenR1YjaRnSdRjOolgSDCqwwQfqhWotZI77ViWigqtuZVTww31F929tOSrVysIzMpguUiO0ENG029VwMjVp4Mkmf217m3h78xZIiJzx4Lcfj136l0mLUUy3QXmMYxmc3Py0PjJKJr9k9GmBh1wQmm2oqq7O2qJcM6lhB0i5jKmfuA8sqh2Podb9inF1vCqJKi94RWG6ruekTjleruX4yCNC8susyRU4rWsVyNUXC31L3KFWOlYjvDFLkDzavGYja5MC7SrA50JSxWqVYgDmqv2byDYKkpUgP80GHc9veVS8axH381hgvJfYhAyAmj5SmrXAhhZBsrXJBQWmVtLKyeobbrvZdXYG7NiKwbLTAjzKoYXNLWT2DvzbdTPRG0eT42g0XKUdfIElkAM0tb3XtUGLksk1KJyam3cjMEtjvgt67kV8PdUwmZ6qItkAUjqWW7gy8VK82hlc3iK8tdwibKeQRuR8MUglOKhcYs0GkE0BtMEXvfQ9mG2i5cyyOqVdayF9Z3UVRXZl1z3LVRehWmM94tQCqEHOfe8PpqtNKUphNGxsEjPwBCSgXCMPqKsYXHms9oo0k3qfeAw0ONn1gYLl9fqo5ylbRMnSSJolza9NghlfWfshW5XtzTnHKkGZio761uuZiBLg447CgTTuYbq8VfgHIsL1LNcOUMzeDIm4WqN9mPvX4auir7P1wNE71JtQLuAtytkrlWhdukBw9Qp9ZocXJZQbFBSF81VP4rjjyONMkHclttVs0eXyyjGGi0w8i0BiL3wCu9QPe5avDDdAJHODWiXsxDc0T5lWLOotleOV3QwonYaMHpjKyqQUkImhiwdYRz9R57SrTNJj2qe2DNb9Jc38UEIFQOv49JiBF93lC2dRnRTJ5fpHI569vDkpxfEWY4a9PLPcsTnV39hx5Zz4bR2QFKBsROTpNWkCdgjSpSGdnTMd8bLfr3e0WvsHww7iHz9uKnRkQx6P4tQnC1fcQF1HhE0eCJTnBVtHHmlONm767WCmXjfqrBqC9ZznOWfCj96dihIcZuNrFWMa93l42im55J66Nq8jYyZFFuwzuV003YBpxznsSLCUC1fY2RrjcYqqiVoCdn3UY6vXFWoLstw9trsFKPJpCQOFws48aVxYKlLHUxG3iaA3lklBBEdb7srLu1gL14duXyDrOe7sTNQY8g2laMAmufXIVXkV6pYYg3UVa56rcoLRk0U2G4yfFFLuU1wxsgSNUDDR9skJy8T3fVYeqBcHD7DR8UcQdSrMcZHNGcODkKrSpzPOj41kFT9si17R5U202hhUvFqJTRNSPBCaOqkEDjBfPV6i26dSgjVyI9gjegghoF7buRaNPH4RPdtkoRx88ouWumEGvcKXJBxKUUOQH7GuFPIXLg6xIZvGyOIIIrO45gW0WL29b1fzzEZns3J1cQZH4QhpmsP3fi9HdMSWfNNVgzZsf5fMcKCSJTY1GQhbhCLBEh6Ldxk8GjEV2zCfecuwp6bYvRHFtI7Lc8x3flb6Up8cakcjsZEG0ocgznnQYGvoV8Ttpgj3frbWqZ3fuPSBl3Fzz3lqD22jslcNJPBpr9wD0nvmvj1FjeYunkngP1foTbE6VDQvHyajW5Id4PGE0WGnlXsXELrnyA5dlktNqvErW99O3ncXU0tutsJ6qPS2LHaZUIF5qXytzWZC58dxG32GUM91 diff --git a/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Directory/ReadTest.php b/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Directory/ReadTest.php index 1ab7bcf233862..c6deeafb7ee9b 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Directory/ReadTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Directory/ReadTest.php @@ -224,10 +224,10 @@ public function existsProvider() { return [ ['foo', 'bar', true], - ['foo', 'bar/baz/', true], + ['foo', 'bar/baz', true], ['foo', 'bar/notexists', false], - ['foo', 'foo/../bar/', true], - ['foo', 'foo/../notexists/', false] + ['foo', 'foo/../bar', true], + ['foo', 'foo/../notexists', false] ]; } diff --git a/dev/tests/integration/testsuite/Magento/Framework/HTTP/AsyncClientInterfaceTest.php b/dev/tests/integration/testsuite/Magento/Framework/HTTP/AsyncClientInterfaceTest.php index 9815f7014d913..8e4da60f06bfe 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/HTTP/AsyncClientInterfaceTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/HTTP/AsyncClientInterfaceTest.php @@ -35,16 +35,16 @@ protected function setUp(): void */ public function testRequest(): void { - $request = new Request('https://magento.com/home-page', Request::METHOD_GET, [], null); + $request = new Request('https://magento.com', Request::METHOD_GET, [], null); $response1 = $this->client->request($request); $response2 = $this->client->request($request); $this->assertEquals(200, $response2->get()->getStatusCode()); $this->assertEquals(200, $response1->get()->getStatusCode()); - $this->assertStringContainsString('Magento. All Rights Reserved', $response1->get()->getBody()); - $this->assertStringContainsString('Magento. All Rights Reserved', $response2->get()->getBody()); + $this->assertStringContainsString('Magento Commerce', $response1->get()->getBody()); + $this->assertStringContainsString('Magento Commerce', $response2->get()->getBody()); $date1 = new \DateTime($response1->get()->getHeaders()['date']); $date2 = new \DateTime($response2->get()->getHeaders()['date']); - $this->assertLessThanOrEqual(1, abs($date1->format('U') - $date2->format('U'))); + $this->assertLessThanOrEqual(1, abs((int)$date1->format('U') - (int)$date2->format('U'))); } /** diff --git a/dev/tests/integration/testsuite/Magento/Framework/Jwt/JwtManagerTest.php b/dev/tests/integration/testsuite/Magento/Framework/Jwt/JwtManagerTest.php new file mode 100644 index 0000000000000..29c3fd2b6559a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Jwt/JwtManagerTest.php @@ -0,0 +1,1028 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt; + +use Magento\Framework\Jwt\Claim\ExpirationTime; +use Magento\Framework\Jwt\Claim\IssuedAt; +use Magento\Framework\Jwt\Claim\Issuer; +use Magento\Framework\Jwt\Claim\JwtId; +use Magento\Framework\Jwt\Claim\PrivateClaim; +use Magento\Framework\Jwt\Claim\Subject; +use Magento\Framework\Jwt\Header\Critical; +use Magento\Framework\Jwt\Header\KeyId; +use Magento\Framework\Jwt\Header\PrivateHeaderParameter; +use Magento\Framework\Jwt\Header\PublicHeaderParameter; +use Magento\Framework\Jwt\Jwe\Jwe; +use Magento\Framework\Jwt\Jwe\JweEncryptionJwks; +use Magento\Framework\Jwt\Jwe\JweEncryptionSettingsInterface; +use Magento\Framework\Jwt\Jwe\JweHeader; +use Magento\Framework\Jwt\Jwe\JweInterface; +use Magento\Framework\Jwt\Jws\Jws; +use Magento\Framework\Jwt\Jws\JwsHeader; +use Magento\Framework\Jwt\Jws\JwsInterface; +use Magento\Framework\Jwt\Jws\JwsSignatureJwks; +use Magento\Framework\Jwt\Payload\ClaimsPayload; +use Magento\Framework\Jwt\Payload\ClaimsPayloadInterface; +use Magento\Framework\Jwt\Payload\NestedPayloadInterface; +use Magento\Framework\Jwt\Unsecured\NoEncryption; +use Magento\Framework\Jwt\Unsecured\UnsecuredJwt; +use Magento\Framework\Jwt\Unsecured\UnsecuredJwtInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +class JwtManagerTest extends TestCase +{ + /** + * @var JwtManagerInterface + */ + private $manager; + + protected function setUp(): void + { + parent::setUp(); + + $objectManager = Bootstrap::getObjectManager(); + $this->manager = $objectManager->get(JwtManagerInterface::class); + } + + /** + * Verify that the manager is able to create and read token data correctly. + * + * @param JwtInterface $jwt + * @param EncryptionSettingsInterface $encryption + * @param EncryptionSettingsInterface[] $readEncryption + * @return void + * + * @dataProvider getTokenVariants + */ + public function testCreateRead( + JwtInterface $jwt, + EncryptionSettingsInterface $encryption, + array $readEncryption + ): void { + $token = $this->manager->create($jwt, $encryption); + $recreated = $this->manager->read($token, $readEncryption); + + //Verifying header + if ((!$jwt instanceof JwsInterface && !$jwt instanceof JweInterface) + || ($jwt instanceof JwsInterface && count($jwt->getProtectedHeaders()) == 1) + || ($jwt instanceof JweInterface && !$jwt->getPerRecipientUnprotectedHeaders()) + ) { + $this->verifyAgainstHeaders([$jwt->getHeader()], $recreated->getHeader()); + } + //Verifying payload + $this->assertEquals($jwt->getPayload()->getContent(), $recreated->getPayload()->getContent()); + if ($jwt->getPayload() instanceof ClaimsPayloadInterface) { + $this->assertInstanceOf(ClaimsPayloadInterface::class, $recreated->getPayload()); + } + if ($jwt->getPayload() instanceof NestedPayloadInterface) { + $this->assertInstanceOf(NestedPayloadInterface::class, $recreated->getPayload()); + } + + //JWT type specific validation + if ($jwt instanceof JwsInterface) { + $this->assertInstanceOf(JwsInterface::class, $recreated); + /** @var JwsInterface $recreated */ + if (!$jwt->getUnprotectedHeaders()) { + $this->assertNull($recreated->getUnprotectedHeaders()); + } else { + $this->assertTrue(count($recreated->getUnprotectedHeaders()) >= 1); + $this->verifyAgainstHeaders($jwt->getUnprotectedHeaders(), $recreated->getUnprotectedHeaders()[0]); + } + $this->verifyAgainstHeaders($jwt->getProtectedHeaders(), $recreated->getProtectedHeaders()[0]); + } elseif ($jwt instanceof JweInterface) { + $this->assertInstanceOf(JweInterface::class, $recreated); + /** @var JweInterface $recreated */ + if (!$jwt->getPerRecipientUnprotectedHeaders()) { + $this->assertNull($recreated->getPerRecipientUnprotectedHeaders()); + } else { + $this->assertTrue(count($recreated->getPerRecipientUnprotectedHeaders()) >= 1); + $this->verifyAgainstHeaders( + $jwt->getPerRecipientUnprotectedHeaders(), + $recreated->getPerRecipientUnprotectedHeaders()[0] + ); + } + if (!$jwt->getSharedUnprotectedHeader()) { + $this->assertNull($recreated->getSharedUnprotectedHeader()); + } else { + $this->verifyAgainstHeaders( + [$jwt->getSharedUnprotectedHeader()], + $recreated->getSharedUnprotectedHeader() + ); + } + $this->verifyAgainstHeaders([$jwt->getProtectedHeader()], $recreated->getProtectedHeader()); + $payload = $jwt->getPayload(); + if ($payload instanceof ClaimsPayloadInterface) { + foreach ($payload->getClaims() as $claim) { + $header = $recreated->getProtectedHeader()->getParameter($claim->getName()); + if ($claim->isHeaderDuplicated()) { + $this->assertNotNull($header); + $this->assertEquals($claim->getValue(), $header->getValue()); + } else { + $this->assertNull($header); + } + } + } + } + if ($jwt instanceof UnsecuredJwtInterface) { + $this->assertInstanceOf(UnsecuredJwtInterface::class, $recreated); + /** @var UnsecuredJwt $recreated */ + if (!$jwt->getUnprotectedHeaders()) { + $this->assertNull($recreated->getUnprotectedHeaders()); + } else { + $this->assertTrue(count($recreated->getUnprotectedHeaders()) >= 1); + $this->verifyAgainstHeaders($jwt->getUnprotectedHeaders(), $recreated->getUnprotectedHeaders()[0]); + } + $this->verifyAgainstHeaders($jwt->getProtectedHeaders(), $recreated->getProtectedHeaders()[0]); + } + + } + + public function getTokenVariants(): array + { + /** @var JwkFactory $jwkFactory */ + $jwkFactory = Bootstrap::getObjectManager()->get(JwkFactory::class); + + $flatJws = new Jws( + [ + new JwsHeader( + [ + new PrivateHeaderParameter('custom-header', 'value'), + new PrivateHeaderParameter('another-custom-header', 'value2') + ] + ) + ], + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2'), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ), + null + ); + $jwsWithUnprotectedHeader = new Jws( + [ + new JwsHeader( + [ + new PrivateHeaderParameter('custom-header', 'value'), + new Critical(['magento']) + ] + ) + ], + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2'), + new ExpirationTime(new \DateTimeImmutable()) + ] + ), + [ + new JwsHeader( + [ + new PublicHeaderParameter('public-header', 'magento', 'public-value') + ] + ) + ] + ); + $compactJws = new Jws( + [ + new JwsHeader( + [ + new PrivateHeaderParameter('test', true), + new PublicHeaderParameter('test2', 'magento', 'value') + ] + ), + new JwsHeader( + [ + new PrivateHeaderParameter('test3', true), + new PublicHeaderParameter('test4', 'magento', 'value-another') + ] + ) + ], + new ClaimsPayload([ + new Issuer('magento.com'), + new JwtId(), + new Subject('stuff') + ]), + [ + new JwsHeader([new PrivateHeaderParameter('public', 'header1')]), + new JwsHeader([new PrivateHeaderParameter('public2', 'header')]) + ] + ); + $flatJwe = new Jwe( + new JweHeader( + [ + new PrivateHeaderParameter('test', true), + new PublicHeaderParameter('test2', 'magento', 'value') + ] + ), + null, + null, + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2', true), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ) + ); + $jsonFlatSharedHeaderJwe = new Jwe( + new JweHeader( + [ + new PrivateHeaderParameter('test', true), + new PublicHeaderParameter('test2', 'magento', 'value') + ] + ), + new JweHeader( + [ + new PrivateHeaderParameter('mage', 'test') + ] + ), + null, + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2', true), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ) + ); + $jsonFlatJwe = new Jwe( + new JweHeader( + [ + new PrivateHeaderParameter('test', true), + new PublicHeaderParameter('test2', 'magento', 'value') + ] + ), + null, + [ + new JweHeader( + [ + new PrivateHeaderParameter('mage', 'test') + ] + ) + ], + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2', true), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ) + ); + $jsonJwe = new Jwe( + new JweHeader( + [ + new PrivateHeaderParameter('test', true), + new PublicHeaderParameter('test2', 'magento', 'value') + ] + ), + new JweHeader( + [ + new PrivateHeaderParameter('mage', 'test') + ] + ), + [ + new JweHeader([new PrivateHeaderParameter('tst', 2)]), + new JweHeader([new PrivateHeaderParameter('test2', 3)]) + ], + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2', true), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ) + ); + $jsonJweKids = new Jwe( + new JweHeader( + [ + new PrivateHeaderParameter('test', true), + ] + ), + null, + [ + new JweHeader([new PrivateHeaderParameter('tst', 2), new KeyId('1')]), + new JweHeader([new PrivateHeaderParameter('test2', 3), new KeyId('2')]) + ], + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2', true), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ) + ); + $flatUnsecured = new UnsecuredJwt( + [ + new JwsHeader( + [ + new PrivateHeaderParameter('test', true), + new PublicHeaderParameter('test2', 'magento', 'value') + ] + ) + ], + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2', true), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ), + null + ); + + //Keys + [$rsaPrivate, $rsaPublic] = $this->createRsaKeys(); + $ecKeys = $this->createEcKeys(); + $sharedSecret = random_bytes(2048); + + return [ + 'jws-HS256' => [ + $flatJws, + $enc = new JwsSignatureJwks($jwkFactory->createHs256($sharedSecret)), + [$enc] + ], + 'jws-HS384' => [ + $flatJws, + $enc = new JwsSignatureJwks($jwkFactory->createHs384($sharedSecret)), + [$enc] + ], + 'jws-HS512' => [ + $jwsWithUnprotectedHeader, + $enc = new JwsSignatureJwks($jwkFactory->createHs512($sharedSecret)), + [$enc] + ], + 'jws-RS256' => [ + $flatJws, + new JwsSignatureJwks($jwkFactory->createSignRs256($rsaPrivate, 'pass')), + [new JwsSignatureJwks($jwkFactory->createVerifyRs256($rsaPublic))] + ], + 'jws-RS384' => [ + $flatJws, + new JwsSignatureJwks($jwkFactory->createSignRs384($rsaPrivate, 'pass')), + [new JwsSignatureJwks($jwkFactory->createVerifyRs384($rsaPublic))] + ], + 'jws-RS512' => [ + $jwsWithUnprotectedHeader, + new JwsSignatureJwks($jwkFactory->createSignRs512($rsaPrivate, 'pass')), + [new JwsSignatureJwks($jwkFactory->createVerifyRs512($rsaPublic))] + ], + 'jws-json-multiple-signatures' => [ + $compactJws, + new JwsSignatureJwks( + new JwkSet( + [ + $jwkFactory->createHs384($sharedSecret), + $jwkFactory->createSignRs256($rsaPrivate, 'pass') + ] + ) + ), + [ + new JwsSignatureJwks( + new JwkSet( + [$jwkFactory->createHs384($sharedSecret), $jwkFactory->createVerifyRs256($rsaPublic)] + ) + ) + ] + ], + 'jws-json-multiple-signatures-one-read' => [ + $compactJws, + new JwsSignatureJwks( + new JwkSet( + [ + $jwkFactory->createHs384($sharedSecret), + $jwkFactory->createSignRs256($rsaPrivate, 'pass') + ] + ) + ), + [new JwsSignatureJwks($jwkFactory->createVerifyRs256($rsaPublic))] + ], + 'jws-ES256' => [ + $flatJws, + new JwsSignatureJwks($jwkFactory->createSignEs256($ecKeys[256][0], 'pass')), + [new JwsSignatureJwks($jwkFactory->createVerifyEs256($ecKeys[256][1]))] + ], + 'jws-ES384' => [ + $flatJws, + new JwsSignatureJwks($jwkFactory->createSignEs384($ecKeys[384][0], 'pass')), + [new JwsSignatureJwks($jwkFactory->createVerifyEs384($ecKeys[384][1]))] + ], + 'jws-ES512' => [ + $flatJws, + new JwsSignatureJwks($jwkFactory->createSignEs512($ecKeys[512][0], 'pass')), + [new JwsSignatureJwks($jwkFactory->createVerifyEs512($ecKeys[512][1]))] + ], + 'jws-PS256' => [ + $flatJws, + new JwsSignatureJwks($jwkFactory->createSignPs256($rsaPrivate, 'pass')), + [new JwsSignatureJwks($jwkFactory->createVerifyPs256($rsaPublic))] + ], + 'jws-PS384' => [ + $flatJws, + new JwsSignatureJwks($jwkFactory->createSignPs384($rsaPrivate, 'pass')), + [new JwsSignatureJwks($jwkFactory->createVerifyPs384($rsaPublic))] + ], + 'jws-PS512' => [ + $flatJws, + new JwsSignatureJwks($jwkFactory->createSignPs512($rsaPrivate, 'pass')), + [new JwsSignatureJwks($jwkFactory->createVerifyPs512($rsaPublic))] + ], + 'jwe-A128KW' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createA128KW($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ), + [ + new JweEncryptionJwks( + $jwkFactory->createA128KW($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ) + ] + ], + 'jwe-A192KW' => [ + $jsonFlatSharedHeaderJwe, + new JweEncryptionJwks( + $jwkFactory->createA192KW($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ), + [ + new JweEncryptionJwks( + $jwkFactory->createA192KW($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ) + ] + ], + 'jwe-A256KW' => [ + $jsonFlatJwe, + new JweEncryptionJwks( + $jwkFactory->createA256KW($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ), + [ + new JweEncryptionJwks( + $jwkFactory->createA256KW($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ) + ] + ], + 'jwe-multiple-recipients' => [ + $jsonJwe, + new JweEncryptionJwks( + new JwkSet( + [ + $jwkFactory->createA256KW($sharedSecret), + $jwkFactory->createA128KW($sharedSecret) + ] + ), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ), + [ + new JweEncryptionJwks( + new JwkSet( + [ + $jwkFactory->createA256KW($sharedSecret), + ] + ), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ) + ] + ], + 'jwe-rsa-oaep' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createEncryptRsaOaep($rsaPublic), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ), + [ + new JweEncryptionJwks( + $jwkFactory->createDecryptRsaOaep($rsaPrivate, 'pass'), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ) + ] + ], + 'jwe-rsa-oaep-256' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createEncryptRsaOaep256($rsaPublic), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A192GCM + ), + [ + new JweEncryptionJwks( + $jwkFactory->createDecryptRsaOaep256($rsaPrivate, 'pass'), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A192GCM + ) + ] + ], + 'jwe-dir' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createDir( + $sharedSecret, + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A192_HS384 + ), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A192_HS384 + ), + [ + new JweEncryptionJwks( + $jwkFactory->createDir( + $sharedSecret, + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A192_HS384 + ), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A192_HS384 + ) + ] + ], + 'jwe-multiple-recipients-kids' => [ + $jsonJweKids, + new JweEncryptionJwks( + new JwkSet( + [ + $jwkFactory->createEncryptRsaOaep256($rsaPublic, '2'), + $jwkFactory->createA256KW($sharedSecret, '1') + ] + ), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ), + [ + new JweEncryptionJwks( + new JwkSet( + [ + $jwkFactory->createDecryptRsaOaep256($rsaPrivate, 'pass', '2') + ] + ), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ) + ] + ], + 'jwe-ECDH-ES-with-EC' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createEncryptEcdhEsWithEc($ecKeys[256][1]), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ), + [ + new JweEncryptionJwks( + $jwkFactory->createDecryptEcdhEsWithEc($ecKeys[256][0], 'pass'), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ) + ] + ], + 'jwe-ECDH-ES-A128-with-EC' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createEncryptEcdhEsA128kwWithEc($ecKeys[256][1]), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ), + [ + new JweEncryptionJwks( + $jwkFactory->createDecryptEcdhEsA128kwWithEc($ecKeys[256][0], 'pass'), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ) + ] + ], + 'jwe-ECDH-ES-A192-with-EC' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createEncryptEcdhEsA192kwWithEc($ecKeys[256][1]), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ), + [ + new JweEncryptionJwks( + $jwkFactory->createDecryptEcdhEsA192kwWithEc($ecKeys[256][0], 'pass'), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ) + ] + ], + 'jwe-ECDH-ES-A256-with-EC' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createEncryptEcdhEsA256kwWithEc($ecKeys[256][1]), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ), + [ + new JweEncryptionJwks( + $jwkFactory->createDecryptEcdhEsA256kwWithEc($ecKeys[256][0], 'pass'), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128_HS256 + ) + ] + ], + 'jwe-A128GCMKW' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createA128Gcmkw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ), + [ + new JweEncryptionJwks( + $jwkFactory->createA128Gcmkw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ) + ] + ], + 'jwe-A192GCMKW' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createA192Gcmkw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ), + [ + new JweEncryptionJwks( + $jwkFactory->createA192Gcmkw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ) + ] + ], + 'jwe-A256GCMKW' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createA256Gcmkw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ), + [ + new JweEncryptionJwks( + $jwkFactory->createA256Gcmkw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ) + ] + ], + 'jwe-PBES2-HS256+A128KW' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createPbes2Hs256A128kw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ), + [ + new JweEncryptionJwks( + $jwkFactory->createPbes2Hs256A128kw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ) + ] + ], + 'jwe-PBES2-HS384+A192KW' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createPbes2Hs384A192kw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ), + [ + new JweEncryptionJwks( + $jwkFactory->createPbes2Hs384A192kw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ) + ] + ], + 'jwe-PBES2-HS512+A256KW' => [ + $flatJwe, + new JweEncryptionJwks( + $jwkFactory->createPbes2Hs512A256kw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ), + [ + new JweEncryptionJwks( + $jwkFactory->createPbes2Hs512A256kw($sharedSecret), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ) + ] + ], + 'unsecured-jwt' => [ + $flatUnsecured, + new NoEncryption(), + [new NoEncryption()] + ] + ]; + } + + /** + * Test reading headers. + * + * @param JwtInterface $tokenData + * @param EncryptionSettingsInterface $settings + * @return void + * + * @dataProvider getJwtsForHeaders + */ + public function testReadHeaders(JwtInterface $tokenData, EncryptionSettingsInterface $settings): void + { + $token = $this->manager->create($tokenData, $settings); + $headers = $this->manager->readHeaders($token); + /** @var HeaderInterface[] $expectedHeaders */ + $expectedHeaders = []; + if ($tokenData instanceof JwsInterface) { + $expectedHeaders = $tokenData->getProtectedHeaders(); + if ($tokenData->getUnprotectedHeaders()) { + $expectedHeaders = array_merge($expectedHeaders, $tokenData->getUnprotectedHeaders()); + } + } elseif ($tokenData instanceof JweInterface) { + $expectedHeaders[] = $tokenData->getProtectedHeader(); + if ($tokenData->getSharedUnprotectedHeader()) { + $expectedHeaders[] = $tokenData->getSharedUnprotectedHeader(); + } + if ($tokenData->getPerRecipientUnprotectedHeaders()) { + $expectedHeaders = array_merge($expectedHeaders, $tokenData->getPerRecipientUnprotectedHeaders()); + } + } elseif ($tokenData instanceof UnsecuredJwtInterface) { + $expectedHeaders = $tokenData->getProtectedHeaders(); + if ($tokenData->getUnprotectedHeaders()) { + $expectedHeaders = array_merge($expectedHeaders, $tokenData->getUnprotectedHeaders()); + } + } + + foreach ($headers as $header) { + $this->verifyAgainstHeaders($expectedHeaders, $header); + } + } + + public function getJwtsForHeaders(): array + { + + /** @var JwkFactory $jwkFactory */ + $jwkFactory = Bootstrap::getObjectManager()->get(JwkFactory::class); + + $flatJws = new Jws( + [ + new JwsHeader( + [ + new PrivateHeaderParameter('custom-header', 'value'), + new PrivateHeaderParameter('another-custom-header', 'value2') + ] + ) + ], + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2'), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ), + null + ); + $flatJsonJws = new Jws( + [ + new JwsHeader( + [ + new PrivateHeaderParameter('custom-header', 'value'), + new Critical(['magento']) + ] + ) + ], + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2'), + new ExpirationTime(new \DateTimeImmutable()) + ] + ), + [ + new JwsHeader( + [ + new PublicHeaderParameter('public-header', 'magento', 'public-value') + ] + ) + ] + ); + $jsonJws = new Jws( + [ + new JwsHeader( + [ + new PrivateHeaderParameter('test', true), + new PublicHeaderParameter('test2', 'magento', 'value') + ] + ), + new JwsHeader( + [ + new PrivateHeaderParameter('test3', true), + new PublicHeaderParameter('test4', 'magento', 'value-another') + ] + ) + ], + new ClaimsPayload([ + new Issuer('magento.com'), + new JwtId(), + new Subject('stuff') + ]), + [ + new JwsHeader([new PrivateHeaderParameter('public', 'header1')]), + new JwsHeader([new PrivateHeaderParameter('public2', 'header')]) + ] + ); + $flatJwe = new Jwe( + new JweHeader( + [ + new PrivateHeaderParameter('test', true), + new PublicHeaderParameter('test2', 'magento', 'value') + ] + ), + null, + null, + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2', true), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ) + ); + $jsonFlatJwe = new Jwe( + new JweHeader( + [ + new PrivateHeaderParameter('test', true), + new PublicHeaderParameter('test2', 'magento', 'value') + ] + ), + null, + [ + new JweHeader( + [ + new PrivateHeaderParameter('mage', 'test') + ] + ) + ], + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2', true), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ) + ); + $jsonJwe = new Jwe( + new JweHeader( + [ + new PrivateHeaderParameter('test', true), + new PublicHeaderParameter('test2', 'magento', 'value') + ] + ), + new JweHeader( + [ + new PrivateHeaderParameter('mage', 'test') + ] + ), + [ + new JweHeader([new PrivateHeaderParameter('tst', 2)]), + new JweHeader([new PrivateHeaderParameter('test2', 3)]) + ], + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2', true), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ) + ); + $flatUnsecured = new UnsecuredJwt( + [ + new JwsHeader( + [ + new PrivateHeaderParameter('test', true), + new PublicHeaderParameter('test2', 'magento', 'value') + ] + ) + ], + new ClaimsPayload( + [ + new PrivateClaim('custom-claim', 'value'), + new PrivateClaim('custom-claim2', 'value2', true), + new PrivateClaim('custom-claim3', 'value3'), + new IssuedAt(new \DateTimeImmutable()), + new Issuer('magento.com') + ] + ), + null + ); + + $sharedSecret = random_bytes(2048); + $jwsJwk = $jwkFactory->createHs256($sharedSecret); + $jweJwk = $jwkFactory->createA128KW($sharedSecret); + $jwsSettings = new JwsSignatureJwks($jwsJwk); + $jsonJwsSettings = new JwsSignatureJwks(new JwkSet([$jwsJwk, $jwsJwk])); + $jweJwkSettings = new JweEncryptionJwks( + $jweJwk, + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ); + $jsonJweSettings = new JweEncryptionJwks( + new JwkSet([$jweJwk, $jweJwk]), + JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM + ); + + return [ + 'jws' => [$flatJws, $jwsSettings], + 'flat-jws' => [$flatJsonJws, $jwsSettings], + 'json-jws' => [$jsonJws, $jsonJwsSettings], + 'jwe' => [$flatJwe, $jweJwkSettings], + 'flat-jwe' => [$jsonFlatJwe, $jweJwkSettings], + 'json-jwe' => [$jsonJwe, $jsonJweSettings], + 'none-jws' => [$flatUnsecured, new NoEncryption()] + ]; + } + + private function validateHeader(HeaderInterface $expected, HeaderInterface $actual): void + { + if (count($expected->getParameters()) > count($actual->getParameters())) { + throw new \InvalidArgumentException('Missing header parameters'); + } + foreach ($expected->getParameters() as $parameter) { + if ($actual->getParameter($parameter->getName()) === null) { + throw new \InvalidArgumentException('Missing header parameters'); + } + if ($actual->getParameter($parameter->getName())->getValue() !== $parameter->getValue()) { + throw new \InvalidArgumentException('Invalid header data'); + } + } + } + + private function verifyAgainstHeaders(array $expected, HeaderInterface $actual): void + { + $oneIsValid = false; + foreach ($expected as $item) { + try { + $this->validateHeader($item, $actual); + $oneIsValid = true; + break; + } catch (\InvalidArgumentException $ex) { + $oneIsValid = false; + } + } + $this->assertTrue($oneIsValid); + } + + /** + * Create RSA key-pair. + * + * @return string[] With 1st element as private key, second - public. + */ + private function createRsaKeys(): array + { + $rsaPrivateResource = openssl_pkey_new(['private_key_bites' => 512, 'private_key_type' => OPENSSL_KEYTYPE_RSA]); + if ($rsaPrivateResource === false) { + throw new \RuntimeException('Failed to create RSA keypair'); + } + $rsaPublic = openssl_pkey_get_details($rsaPrivateResource)['key']; + if (!openssl_pkey_export($rsaPrivateResource, $rsaPrivate, 'pass')) { + throw new \RuntimeException('Failed to read RSA private key'); + } + openssl_free_key($rsaPrivateResource); + + return [$rsaPrivate, $rsaPublic]; + } + + /** + * Create EC key pairs for with different curves. + * + * @return array Keys - bits, values contain 2 elements: 0 => private, 1 => public. + */ + private function createEcKeys(): array + { + $curveNameMap = [ + 256 => 'prime256v1', + 384 => 'secp384r1', + 512 => 'secp521r1' + ]; + $ecKeys = []; + foreach ($curveNameMap as $bits => $curve) { + $privateResource = openssl_pkey_new(['curve_name' => $curve, 'private_key_type' => OPENSSL_KEYTYPE_EC]); + if ($privateResource === false) { + throw new \RuntimeException('Failed to create EC keypair'); + } + $esPublic = openssl_pkey_get_details($privateResource)['key']; + if (!openssl_pkey_export($privateResource, $esPrivate, 'pass')) { + throw new \RuntimeException('Failed to read EC private key'); + } + openssl_free_key($privateResource); + $ecKeys[$bits] = [$esPrivate, $esPublic]; + unset($privateResource, $esPublic, $esPrivate); + } + + return $ecKeys; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/MessageQueue/ConfigGetConsumersTest.php b/dev/tests/integration/testsuite/Magento/Framework/MessageQueue/ConfigGetConsumersTest.php new file mode 100644 index 0000000000000..f2a548890b524 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/MessageQueue/ConfigGetConsumersTest.php @@ -0,0 +1,129 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\MessageQueue; + +use Magento\Framework\App\DeploymentConfig\FileReader; +use Magento\Framework\App\DeploymentConfig\Writer; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Config\File\ConfigFilePool; +use Magento\Framework\Filesystem; +use Magento\Framework\MessageQueue\Config; +use Magento\Framework\MessageQueue\Config\Data; +use Magento\Framework\MessageQueue\Config\Reader\Xml; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +class ConfigGetConsumersTest extends TestCase +{ + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + /** + * @var Config + */ + private $configSubject; + + /** + * @var FileReader + */ + private $fileReader; + /** + * @var array + */ + private $envConfigBackup; + + /** + * @var Writer + */ + private $fileWriter; + + /** + * @var Xml + */ + private $xmlReader; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->fileWriter = $this->objectManager->get(Writer::class); + $this->xmlReader = $this->objectManager->create(Xml::class); + $this->fileReader = $this->objectManager->get(FileReader::class); + + $this->envConfigBackup = $this->fileReader->load(ConfigFilePool::APP_ENV); + $customEnvConfig = $this->buildCustomEnvConfigWithConsumers(); + $this->fileWriter->saveConfig([ConfigFilePool::APP_ENV => $customEnvConfig]); + + /** @var Data data */ + $configData = $this->objectManager->create( + Data::class, + [ + 'cacheId' => uniqid(microtime()) + ] + ); + + $this->configSubject = $this->objectManager->create( + Config::class, + [ + 'queueConfigData' => $configData + ] + ); + } + + public function testGetConsumers(): void + { + $consumers = $this->configSubject->getConsumers(); + + foreach ($consumers as $consumer) { + $this->assertIsString($consumer['name']); + $this->assertIsArray($consumer['handlers']); + } + } + + /** + * @inheritdoc + */ + protected function tearDown(): void + { + $filesystem = $this->objectManager->get(Filesystem::class); + $configFilePool = $this->objectManager->get(ConfigFilePool::class); + $filesystem->getDirectoryWrite(DirectoryList::CONFIG)->writeFile( + $configFilePool->getPath(ConfigFilePool::APP_ENV), + "<?php\n return array();\n" + ); + $this->fileWriter->saveConfig([ConfigFilePool::APP_ENV => $this->envConfigBackup]); + } + + private function buildCustomEnvConfigWithConsumers(): array + { + $data = $this->xmlReader->read(); + $names = array_keys($data['consumers']); + $consumers = []; + foreach ($names as $name) { + $consumers[$name] = ['connection' => 'amqp']; + } + + return [ + 'queue' => [ + 'amqp' => [ + 'host' => 'localhost', + 'port' => '5672', + 'user' => 'guest', + 'password' => 'guest', + 'virtualhost' => '/', + 'ssl' => '' + ], + 'consumers' => $consumers + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes.php b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes.php index 03269b88ee2a1..cd4484cf9db0c 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes.php @@ -90,6 +90,25 @@ /* Assign attribute to attribute set */ $installer->addAttributeToGroup($productEntityTypeId, 'Default', 'General', $dateAttribute->getId()); +$decimalAttribute = Bootstrap::getObjectManager()->create(Attribute::class); +$decimalAttribute->setData( + [ + 'attribute_code' => 'decimal_attribute', + 'entity_type_id' => $productEntityTypeId, + 'is_global' => 1, + 'is_filterable' => 1, + 'is_user_defined' => 1, + 'backend_type' => 'decimal', + 'frontend_input' => 'weight', + 'frontend_label' => 'Test Decimal', + 'is_searchable' => 1, + 'is_filterable_in_search' => 1, + ] +); +$decimalAttribute->save(); +/* Assign attribute to attribute set */ +$installer->addAttributeToGroup($productEntityTypeId, 'Default', 'General', $decimalAttribute->getId()); + $productAttributeSetId = $installer->getAttributeSetId($productEntityTypeId, 'Default'); /* Create simple products per each first attribute option */ foreach ($selectOptions[1] as $option) { @@ -127,6 +146,7 @@ $selectAttributes[1]->getAttributeCode() => $option->getId(), $selectAttributes[2]->getAttributeCode() => $selectOptions[2]->getLastItem()->getId(), $dateAttribute->getAttributeCode() => '10/30/2000', + $decimalAttribute->getAttributeCode() => 1.11, ], $product->getStoreId() ); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes_rollback.php b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes_rollback.php index fd413726b2637..bf3d6b17f6d63 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes_rollback.php @@ -42,5 +42,10 @@ $attribute->delete(); } +$attribute->loadByCode($productEntityTypeId, 'decimal_attribute'); +if ($attribute->getId()) { + $attribute->delete(); +} + $registry->unregister('isSecureArea'); $registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php index 095e70a6d0e1a..a2e56fa51d8ae 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); // @codingStandardsIgnoreStart namespace { $mockPHPFunctions = false; @@ -32,6 +33,7 @@ function ini_get($varName) } elseif ($mockPHPFunctions == 2) { return null; } + //phpcs:ignore PHPCompatibility return call_user_func_array('\ini_get', func_get_args()); } @@ -375,5 +377,18 @@ private function getModel(): \Magento\Framework\Session\Config ['deploymentConfig' => $this->deploymentConfigMock] ); } + + /** + * Test Set SameSite Attribute + * + * @return void + */ + public function testSetCookieInvalidSameSite(): void + { + $model = $this->getModel(); + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('Invalid Samesite attribute.'); + $model->setCookieSameSite('foobar'); + } } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Session/SaveHandler/DbTableTest.php b/dev/tests/integration/testsuite/Magento/Framework/Session/SaveHandler/DbTableTest.php index 28c0bc8e73f7a..c66f8e3894fe8 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Session/SaveHandler/DbTableTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Session/SaveHandler/DbTableTest.php @@ -121,10 +121,14 @@ public function testOpenAndClose() */ public function testWriteReadDestroy() { + // We have to use serialize here. + // phpcs:ignore Magento2.Security.InsecureFunction $data = serialize($this->_sessionData[self::SESSION_NEW]); $this->_model->write(self::SESSION_ID, $data); $this->assertEquals($data, $this->_model->read(self::SESSION_ID)); + // We have to use serialize here. + // phpcs:ignore Magento2.Security.InsecureFunction $data = serialize($this->_sessionData[self::SESSION_EXISTS]); $this->_model->write(self::SESSION_ID, $data); $this->assertEquals($data, $this->_model->read(self::SESSION_ID)); @@ -151,6 +155,8 @@ public function testGc() */ public function testWriteEncoded() { + // We have to use serialize here. + // phpcs:ignore Magento2.Security.InsecureFunction $data = serialize($this->_sessionData[self::SESSION_NEW]); $this->_model->write(self::SESSION_ID, $data); @@ -179,6 +185,7 @@ public function readEncodedDataProvider() { // we can't use object data as a fixture because not encoded serialized object // might cause DB adapter fatal error, so we have to use array as a fixture + // phpcs:ignore Magento2.Security.InsecureFunction $sessionData = serialize($this->_sourceData[self::SESSION_NEW]); return [ 'session_encoded' => ['$sessionData' => base64_encode($sessionData)], @@ -201,6 +208,8 @@ public function testReadEncoded($sessionData) $this->_connection->insertOnDuplicate($this->_sessionTable, $sessionRecord, [self::COLUMN_SESSION_DATA]); $sessionData = $this->_model->read(self::SESSION_ID); + // We have to use unserialize here. + // phpcs:ignore Magento2.Security.InsecureFunction $this->assertEquals($this->_sourceData[self::SESSION_NEW], unserialize($sessionData)); } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/DbSchemaWriterTest.php b/dev/tests/integration/testsuite/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/DbSchemaWriterTest.php new file mode 100644 index 0000000000000..8cc92da3a5709 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/DbSchemaWriterTest.php @@ -0,0 +1,113 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework\Setup\Declaration\Schema\Db\MySQL; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Ddl\Table; +use Magento\TestFramework\Helper\Bootstrap; + +/** + * Test DB schema writer + * + * @magentoDbIsolation disabled + */ +class DbSchemaWriterTest extends \PHPUnit\Framework\TestCase +{ + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @var DbSchemaWriter + */ + private $dbSchemaWriter; + + protected function setUp(): void + { + set_error_handler(null); + $this->resourceConnection = Bootstrap::getObjectManager()->get(ResourceConnection::class); + $this->dbSchemaWriter = Bootstrap::getObjectManager()->get(DbSchemaWriter::class); + } + + protected function tearDown(): void + { + restore_error_handler(); + } + + /** + * Retrieve database adapter instance + * + * @return \Magento\Framework\DB\Adapter\Pdo\Mysql + */ + private function getDbAdapter() + { + return $this->resourceConnection->getConnection(); + } + + /** + * Test reset auto increment + * + * @param array $options + * @param string|bool $expected + * @throws \Zend_Db_Exception + * @dataProvider getAutoIncrementFieldDataProvider + */ + public function testResetAutoIncrement(array $options, $expected) + { + $adapter = $this->getDbAdapter(); + $tableName = 'table_auto_increment_field'; + + $table = $adapter + ->newTable($tableName) + ->addColumn( + 'row_id', + Table::TYPE_INTEGER, + null, + $options, + 'Row Id' + ) + ->addColumn( + 'created_at', + Table::TYPE_DATETIME, + null, + ['default' => new \Zend_Db_Expr('CURRENT_TIMESTAMP')] + ) + ->addColumn( + 'integer_column', + Table::TYPE_INTEGER, + 11, + ['default' => 123456] + )->addColumn( + 'string_column', + Table::TYPE_TEXT, + 255, + ['default' => 'default test text'] + ) + ->setComment('Test table with auto increment column'); + $adapter->createTable($table); + + $dbStatement = $this->dbSchemaWriter->resetAutoIncrement($tableName, 'default'); + $this->assertEquals($expected, $dbStatement->getStatement()); + + //clean up database from test table + $adapter->dropTable($tableName); + } + + public function getAutoIncrementFieldDataProvider() + { + return [ + 'auto increment field' => [ + 'field options' => ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'expected result' => 'AUTO_INCREMENT = 0', + ], + 'non auto increment field' => [ + 'field options' => ['unsigned' => true, 'nullable' => false,], + 'expected result' => 'AUTO_INCREMENT = 1', + ] + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Weee/_files/add_fpt_for_region_1.php b/dev/tests/integration/testsuite/Magento/GraphQl/Weee/_files/add_fpt_for_region_1.php new file mode 100644 index 0000000000000..3492d2464b7b9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Weee/_files/add_fpt_for_region_1.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Quote\Model\QuoteFactory; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); +/** @var $product Product */ +$product = $productRepository->get('simple-with-ftp', true); +if ($product && $product->getId()) { + $product->setFixedProductAttribute( + array_merge( + $product->getFixedProductAttribute() ?? [], + [ + [ + 'website_id' => 0, + 'country' => 'US', + 'state' => 1, + 'price' => 5.00, + 'delete' => '' + ] + ] + ) + ); + $productRepository->save($product); +} diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Weee/_files/add_simple_product_with_fpt_to_cart.php b/dev/tests/integration/testsuite/Magento/GraphQl/Weee/_files/add_simple_product_with_fpt_to_cart.php new file mode 100644 index 0000000000000..ba31fec026d3c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Weee/_files/add_simple_product_with_fpt_to_cart.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\Quote\Model\QuoteFactory; +use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); +/** @var QuoteFactory $quoteFactory */ +$quoteFactory = Bootstrap::getObjectManager()->get(QuoteFactory::class); +/** @var QuoteResource $quoteResource */ +$quoteResource = Bootstrap::getObjectManager()->get(QuoteResource::class); +/** @var CartRepositoryInterface $cartRepository */ +$cartRepository = Bootstrap::getObjectManager()->get(CartRepositoryInterface::class); + +$product = $productRepository->get('simple-with-ftp'); + +$quote = $quoteFactory->create(); +$quoteResource->load($quote, 'test_quote', 'reserved_order_id'); +$quote->addProduct($product, 2); +$cartRepository->save($quote); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Weee/_files/apply_tax_for_simple_product_with_fpt.php b/dev/tests/integration/testsuite/Magento/GraphQl/Weee/_files/apply_tax_for_simple_product_with_fpt.php new file mode 100644 index 0000000000000..fa10c89decf60 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Weee/_files/apply_tax_for_simple_product_with_fpt.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Tax\Model\ClassModel as TaxClassModel; +use Magento\Tax\Model\ResourceModel\TaxClass\CollectionFactory as TaxClassCollectionFactory; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$product = $productRepository->get('simple-with-ftp'); + +/** @var TaxClassCollectionFactory $taxClassCollectionFactory */ +$taxClassCollectionFactory = $objectManager->get(TaxClassCollectionFactory::class); +$taxClassCollection = $taxClassCollectionFactory->create(); + +/** @var TaxClassModel $taxClass */ +$taxClassCollection->addFieldToFilter('class_type', TaxClassModel::TAX_CLASS_TYPE_PRODUCT); +$taxClass = $taxClassCollection->getFirstItem(); + +$product->setCustomAttribute('tax_class_id', $taxClass->getClassId()); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/Import/Product/Type/GroupedTest.php b/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/Import/Product/Type/GroupedTest.php index 7581d73231fd5..e4c8feef2fd8a 100644 --- a/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/Import/Product/Type/GroupedTest.php +++ b/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/Import/Product/Type/GroupedTest.php @@ -3,12 +3,28 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\GroupedImportExport\Model\Import\Product\Type; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\Product as ProductResource; +use Magento\CatalogImportExport\Model\Import\Product as ProductImport; +use Magento\CatalogInventory\Api\Data\StockItemInterface; +use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\CatalogInventory\Api\StockItemCriteriaInterfaceFactory; +use Magento\CatalogInventory\Api\StockItemRepositoryInterface; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Filesystem; +use Magento\Framework\ObjectManagerInterface; use Magento\ImportExport\Model\Import; +use Magento\ImportExport\Model\Import\Source\Csv; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; -class GroupedTest extends \PHPUnit\Framework\TestCase +class GroupedTest extends TestCase { /** * Configurable product test Name @@ -21,26 +37,29 @@ class GroupedTest extends \PHPUnit\Framework\TestCase const TEST_PRODUCT_TYPE = 'grouped'; /** - * @var \Magento\CatalogImportExport\Model\Import\Product + * @var ProductImport */ - protected $model; + private $model; /** - * @var \Magento\Framework\ObjectManagerInterface + * @var ObjectManagerInterface */ - protected $objectManager; + private $objectManager; /** * Grouped product options SKU list * * @var array */ - protected $optionSkuList = ['Simple for Grouped 1', 'Simple for Grouped 2']; + private $optionSkuList = ['Simple for Grouped 1', 'Simple for Grouped 2']; + /** + * @ingeritdoc + */ protected function setUp(): void { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->model = $this->objectManager->create(\Magento\CatalogImportExport\Model\Import\Product::class); + $this->objectManager = Bootstrap::getObjectManager(); + $this->model = $this->objectManager->create(ProductImport::class); } /** @@ -52,33 +71,12 @@ public function testImport() { // Import data from CSV file $pathToFile = __DIR__ . '/../../_files/grouped_product.csv'; - $filesystem = $this->objectManager->create(\Magento\Framework\Filesystem::class); + $this->import($pathToFile); - $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); - $source = $this->objectManager->create( - \Magento\ImportExport\Model\Import\Source\Csv::class, - [ - 'file' => $pathToFile, - 'directory' => $directory - ] - ); - $errors = $this->model->setSource( - $source - )->setParameters( - [ - 'behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, - 'entity' => 'catalog_product' - ] - )->validateData(); - - $this->assertTrue($errors->getErrorsCount() == 0); - $this->model->importData(); - - $resource = $this->objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); + $resource = $this->objectManager->get(ProductResource::class); $productId = $resource->getIdBySku('Test Grouped'); $this->assertIsNumeric($productId); - /** @var \Magento\Catalog\Model\Product $product */ - $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class); + $product = $this->objectManager->create(Product::class); $product->load($productId); $this->assertFalse($product->isObjectNew()); @@ -91,4 +89,71 @@ public function testImport() $this->assertContains($childProduct->getSku(), $this->optionSkuList); } } + + /** + * Verify grouped product stock status updated during import. + * + * @magentoDataFixture Magento/GroupedProduct/_files/product_grouped.php + * @return void + */ + public function testImportUpdateStockStatus(): void + { + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + //Verify grouped product is out of stock after import. + $pathToOutOfStockFile = __DIR__ . '/../../_files/grouped_product_children_out_of_stock.csv'; + $this->import($pathToOutOfStockFile); + $groupedProduct = $productRepository->get('grouped-product', false, null, true); + $stockItem = $this->getStockItem((int)$groupedProduct->getId()); + self::assertFalse($stockItem->getIsInStock()); + //Verify grouped product is in stock after import. + $pathToOutOfStockFile = __DIR__ . '/../../_files/grouped_product_children_in_stock.csv'; + $this->import($pathToOutOfStockFile); + $groupedProduct = $productRepository->get('grouped-product', false, null, true); + $stockItem = $this->getStockItem((int)$groupedProduct->getId()); + self::assertTrue($stockItem->getIsInStock()); + } + + /** + * Retrieve product stock status. + * + * @param int $productId + * @return StockItemInterface|null + */ + private function getStockItem(int $productId): ?StockItemInterface + { + $criteriaFactory = $this->objectManager->create(StockItemCriteriaInterfaceFactory::class); + $stockItemRepository = $this->objectManager->create(StockItemRepositoryInterface::class); + $stockConfiguration = $this->objectManager->create(StockConfigurationInterface::class); + $criteria = $criteriaFactory->create(); + $criteria->setScopeFilter($stockConfiguration->getDefaultScopeId()); + $criteria->setProductsFilter($productId); + $items = $stockItemRepository->getList($criteria)->getItems(); + + return reset($items); + } + + + /** + * Perform products import. + * + * @param string $pathToFile + * @throws LocalizedException + */ + private function import(string $pathToFile): void + { + $filesystem = $this->objectManager->create(Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create(Csv::class, ['file' => $pathToFile, 'directory' => $directory]); + $errors = $this->model->setSource( + $source + )->setParameters( + [ + 'behavior' => Import::BEHAVIOR_APPEND, + 'entity' => 'catalog_product', + ] + )->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->model->importData(); + } } diff --git a/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/Import/_files/grouped_product_children_in_stock.csv b/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/Import/_files/grouped_product_children_in_stock.csv new file mode 100644 index 0000000000000..4b0b657fd1632 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/Import/_files/grouped_product_children_in_stock.csv @@ -0,0 +1,2 @@ +sku,qty,is_in_stock +simple,10,1 diff --git a/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/Import/_files/grouped_product_children_out_of_stock.csv b/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/Import/_files/grouped_product_children_out_of_stock.csv new file mode 100644 index 0000000000000..a073cc709dc7c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/Import/_files/grouped_product_children_out_of_stock.csv @@ -0,0 +1,3 @@ +sku,qty,is_in_stock +simple,0,0 +virtual-product,0,0 diff --git a/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/empty_grouped_product.php b/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/empty_grouped_product.php new file mode 100644 index 0000000000000..d02894866fb33 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/empty_grouped_product.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Visibility; +use Magento\GroupedProduct\Model\Product\Type\Grouped; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$product = Bootstrap::getObjectManager()->create(Product::class); +$product->isObjectNew(true); +$product->setTypeId(Grouped::TYPE_CODE) + ->setAttributeSetId(4) + ->setWebsiteIds([1]) + ->setName('Grouped Product') + ->setSku('grouped-product') + ->setPrice(100) + ->setTaxClassId(0) + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 0, 'is_in_stock' => 1]) + ->save(); diff --git a/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/empty_grouped_product_rollback.php b/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/empty_grouped_product_rollback.php new file mode 100644 index 0000000000000..522579ae5469c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/empty_grouped_product_rollback.php @@ -0,0 +1,23 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +$registry = Bootstrap::getObjectManager()->get(Registry::class); +$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); +try { + $groupedProduct = $productRepository->get('grouped-product', false, null, true); + $groupedProduct->delete(); +} catch (NoSuchEntityException $e) { + //already deleted +} +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ExportTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ExportTest.php index 493528ef7bc4d..8fc3d0a3d2978 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ExportTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/ExportTest.php @@ -5,10 +5,13 @@ */ namespace Magento\ImportExport\Controller\Adminhtml; +use Magento\TestFramework\Helper\Xpath; +use Magento\TestFramework\TestCase\AbstractBackendController; + /** * @magentoAppArea adminhtml */ -class ExportTest extends \Magento\TestFramework\TestCase\AbstractBackendController +class ExportTest extends AbstractBackendController { /** * Set value of $_SERVER['HTTP_X_REQUESTED_WITH'] parameter here @@ -18,20 +21,8 @@ class ExportTest extends \Magento\TestFramework\TestCase\AbstractBackendControll protected $_httpXRequestedWith; /** - * Get possible entity types - * - * @return array + * @inheritdoc */ - public function getEntityTypesDataProvider() - { - return [ - 'products' => ['$entityType' => 'catalog_product'], - 'customers' => ['$entityType' => 'customer'], - // customer entities - 'customers_customer_entities' => ['$entityType' => 'customer', '$customerEntityType' => 'customer'] - ]; - } - protected function setUp(): void { parent::setUp(); @@ -41,6 +32,9 @@ protected function setUp(): void } } + /** + * @inheritdoc + */ protected function tearDown(): void { if ($this->_httpXRequestedWith !== null) { @@ -56,10 +50,14 @@ protected function tearDown(): void * @dataProvider getEntityTypesDataProvider * * @param string $entityType - * @param string $customerEntityType + * @param string|null $customerEntityType + * @param array $expectedAttributes */ - public function testGetFilterAction($entityType, $customerEntityType = null) - { + public function testGetFilterAction( + string $entityType, + string $customerEntityType = null, + array $expectedAttributes = [] + ) { $this->getRequest()->setParam('isAjax', true); // Provide X_REQUESTED_WITH header in response to mark next action as ajax @@ -72,7 +70,35 @@ public function testGetFilterAction($entityType, $customerEntityType = null) } $this->dispatch($url); - $this->assertStringContainsString('<div id="export_filter_grid"', $this->getResponse()->getBody()); + $body = $this->getResponse()->getBody(); + $this->assertStringContainsString('<div id="export_filter_grid"', $body); + foreach ($expectedAttributes as $attribute) { + $this->assertStringContainsString("name=\"export_filter[{$attribute}]\"", $body); + } + } + + /** + * Get possible entity types + * + * @return array + */ + public function getEntityTypesDataProvider() + { + return [ + 'products' => [ + 'entityType' => 'catalog_product', + 'customerEntityType' => null, + 'expectedAttributes' => ['category_ids'] + ], + 'customers' => [ + 'entityType' => 'customer' + ], + // customer entities + 'customers_customer_entities' => [ + 'entityType' => 'customer', + 'customerEntityType' => 'customer' + ] + ]; } /** @@ -86,14 +112,14 @@ public function testIndexAction() $this->assertEquals( 1, - \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath( + Xpath::getElementsCountForXpath( '//fieldset[@id="base_fieldset"]', $body ) ); $this->assertEquals( 3, - \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath( + Xpath::getElementsCountForXpath( '//fieldset[@id="base_fieldset"]/div[contains(@class,"field")]', $body ) diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/AbstractStubEntity.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/AbstractStubEntity.php deleted file mode 100644 index 0a1ec2f29e52e..0000000000000 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/AbstractStubEntity.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * Stub abstract class which provide to change protected property "$_disabledAttrs" and test methods depended on it - */ -namespace Magento\ImportExport\Model\Export; - -abstract class AbstractStubEntity extends \Magento\ImportExport\Model\Export\AbstractEntity -{ - public function __construct( - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\ImportExport\Model\Export\Factory $collectionFactory, - \Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory $resourceColFactory, - array $data = [] - ) { - parent::__construct($scopeConfig, $storeManager, $collectionFactory, $resourceColFactory, $data); - $this->_disabledAttrs = ['default_billing', 'default_shipping']; - } -} diff --git a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/EntityAbstractTest.php b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/EntityAbstractTest.php index d7f8828da976f..fc0afc58b9032 100644 --- a/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/EntityAbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/ImportExport/Model/Export/EntityAbstractTest.php @@ -16,6 +16,9 @@ class EntityAbstractTest extends \PHPUnit\Framework\TestCase */ protected $_model; + /** + * @inheritDoc + */ protected function setUp(): void { parent::setUp(); @@ -100,22 +103,3 @@ public function testFilterAttributeCollection() } } } -/** - * @codingStandardsIgnoreStart - * Stub abstract class which provide to change protected property "$_disabledAttrs" and test methods depended on it - */ -abstract class Stub_Magento_ImportExport_Model_Export_AbstractEntity extends - \Magento\ImportExport\Model\Export\AbstractEntity -{ - public function __construct( - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\ImportExport\Model\Export\Factory $collectionFactory, - \Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory $resourceColFactory, - array $data = [] - ) { - parent::__construct($scopeConfig, $storeManager, $collectionFactory, $resourceColFactory, $data); - $this->_disabledAttrs = ['default_billing', 'default_shipping']; - } -} -// @codingStandardsIgnoreEnd diff --git a/dev/tests/integration/testsuite/Magento/Integration/Controller/Adminhtml/Integration/TokensExchangeTest.php b/dev/tests/integration/testsuite/Magento/Integration/Controller/Adminhtml/Integration/TokensExchangeTest.php new file mode 100644 index 0000000000000..0dfd15c62f3a7 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Integration/Controller/Adminhtml/Integration/TokensExchangeTest.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Integration\Controller\Adminhtml\Integration; + +use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\Integration\Api\IntegrationServiceInterface; +use Magento\TestFramework\TestCase\AbstractBackendController; + +/** + * Test for \Magento\Integration\Controller\Adminhtml\Integration\TokensExchange. + * + * @magentoAppArea adminhtml + */ +class TokensExchangeTest extends AbstractBackendController +{ + private const URL = 'backend/admin/integration/tokensExchange'; + + /** + * @var IntegrationServiceInterface + */ + private $integrationService; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->integrationService = $this->_objectManager->get(IntegrationServiceInterface::class); + } + + /** + * Activate integration + * + * @magentoDataFixture Magento/Integration/_files/integration_all_data.php + * + * @return void + */ + public function testActivate() + { + $integration = $this->integrationService->findByName('Fixture Integration'); + + $this->getRequest()->setMethod(HttpRequest::METHOD_GET); + $this->getRequest()->setParams(['id' => $integration->getId()]); + $this->dispatch(self::URL); + + $this->assertStringContainsString( + 'Please setup or sign in into your 3rd party account to complete setup of this integration.', + $this->getResponse()->getBody() + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Integration/Model/ResourceModel/IntegrationTest.php b/dev/tests/integration/testsuite/Magento/Integration/Model/ResourceModel/IntegrationTest.php index f44008637ac8a..f91ca78bfeafc 100644 --- a/dev/tests/integration/testsuite/Magento/Integration/Model/ResourceModel/IntegrationTest.php +++ b/dev/tests/integration/testsuite/Magento/Integration/Model/ResourceModel/IntegrationTest.php @@ -26,8 +26,11 @@ protected function setUp(): void $this->consumer = $objectManager->create(\Magento\Integration\Model\Oauth\Consumer::class); $this->consumer->setData( [ + // md5() here just to generate unique string + // phpcs:disable Magento2.Security.InsecureFunction 'key' => md5(uniqid()), 'secret' => md5(uniqid()), + // phpcs:enable 'callback_url' => 'http://example.com/callback', 'rejected_callback_url' => 'http://example.com/rejectedCallback' ] diff --git a/dev/tests/integration/testsuite/Magento/Integration/_files/integration_all_data.php b/dev/tests/integration/testsuite/Magento/Integration/_files/integration_all_data.php new file mode 100644 index 0000000000000..2efb5b0cd8873 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Integration/_files/integration_all_data.php @@ -0,0 +1,21 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Integration\Api\IntegrationServiceInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +$integrationService = $objectManager->get(IntegrationServiceInterface::class); + +$data = [ + 'name' => 'Fixture Integration', + 'email' => 'john.doe@example.com', + 'endpoint' => 'https://example.com/endpoint', + 'identity_link_url' => 'https://example.com/link', + 'all_resources' => 0, +]; +$integrationService->create($data); diff --git a/dev/tests/integration/testsuite/Magento/Integration/_files/integration_all_data_rollback.php b/dev/tests/integration/testsuite/Magento/Integration/_files/integration_all_data_rollback.php new file mode 100644 index 0000000000000..d8028691463a3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Integration/_files/integration_all_data_rollback.php @@ -0,0 +1,10 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Integration/_files/integration_all_permissions_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/MediaGallery/Model/Directory/IsExcludedTest.php b/dev/tests/integration/testsuite/Magento/MediaGallery/Model/Directory/IsExcludedTest.php new file mode 100644 index 0000000000000..c9b0f8f1632dc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/MediaGallery/Model/Directory/IsExcludedTest.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + * + */ +declare(strict_types=1); + +namespace Magento\MediaGallery\Model\Directory; + +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Test for @see \Magento\MediaGallery\Model\Directory\IsExcluded. + */ +class IsExcludedTest extends TestCase +{ + /** + * @var IsExcluded + */ + private $model; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->model = Bootstrap::getObjectManager()->get(IsExcluded::class); + } + + /** + * @dataProvider directoriesDataProvider + * @param string $path + * @param bool $expectedResult + * @return void + */ + public function testIsExcluded(string $path, bool $expectedResult): void + { + $actualResult = $this->model->execute($path); + $this->assertEquals($expectedResult, $actualResult); + } + + /** + * @return array + */ + public function directoriesDataProvider(): array + { + return [ + [ + 'catalog', + false + ], + [ + 'customer', + true + ], + [ + 'catalog/../customer', + true + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/MediaGallery/_files/media_asset_loaded_year_ago.php b/dev/tests/integration/testsuite/Magento/MediaGallery/_files/media_asset_loaded_year_ago.php new file mode 100644 index 0000000000000..743392af8cb4a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/MediaGallery/_files/media_asset_loaded_year_ago.php @@ -0,0 +1,32 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\MediaGalleryApi\Api\Data\AssetInterface; +use Magento\MediaGalleryApi\Api\Data\AssetInterfaceFactory; +use Magento\MediaGalleryApi\Api\SaveAssetsInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var AssetInterfaceFactory $mediaAssetFactory */ +$mediaAssetFactory = $objectManager->get(AssetInterfaceFactory::class); +/** @var AssetInterface $mediaAsset */ +$mediaAsset = $mediaAssetFactory->create( + [ + 'path' => 'testDirectory/year_ago_loaded_img.jpg', + 'description' => 'Description of an image', + 'contentType' => 'image', + 'title' => 'Img', + 'source' => 'Local', + 'width' => 420, + 'height' => 240, + 'size' => 12877, + 'createdAt' => (new \DateTime('-1 year'))->format('Y-m-d H:i:s'), + ] +); +/** @var SaveAssetsInterface $mediaSave */ +$mediaSave = $objectManager->get(SaveAssetsInterface::class); +$mediaId = $mediaSave->execute([$mediaAsset]); diff --git a/dev/tests/integration/testsuite/Magento/MediaGallery/_files/media_asset_loaded_year_ago_rollback.php b/dev/tests/integration/testsuite/Magento/MediaGallery/_files/media_asset_loaded_year_ago_rollback.php new file mode 100644 index 0000000000000..dee77fcf805b4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/MediaGallery/_files/media_asset_loaded_year_ago_rollback.php @@ -0,0 +1,20 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\MediaGalleryApi\Api\DeleteAssetsByPathsInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); + +/** @var DeleteAssetsByPathsInterface $mediaSave */ +$mediaAssetDelete = $objectManager->get(DeleteAssetsByPathsInterface::class); + +try { + $mediaAssetDelete->execute(['testDirectory/year_ago_loaded_img.jpg']); +} catch (\Exception $exception) { + // already deleted +} diff --git a/dev/tests/integration/testsuite/Magento/MediaGalleryUi/Model/Listing/DataProviderTest.php b/dev/tests/integration/testsuite/Magento/MediaGalleryUi/Model/Listing/DataProviderTest.php new file mode 100644 index 0000000000000..1c6b90e608299 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/MediaGalleryUi/Model/Listing/DataProviderTest.php @@ -0,0 +1,95 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\MediaGalleryUi\Model\Listing; + +use Magento\Framework\App\RequestInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\View\Element\UiComponentFactory; +use Magento\Framework\View\Element\UiComponentInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Checks standalone media gallery listing data provider behavior + * + * @magentoAppArea adminhtml + */ +class DataProviderTest extends TestCase +{ + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var UiComponentFactory */ + private $componentFactory; + + /** @var RequestInterface */ + private $request; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->request = $this->objectManager->get(RequestInterface::class); + $this->componentFactory = $this->objectManager->get(UiComponentFactory::class); + } + + /** + * @magentoDataFixture Magento/MediaGallery/_files/media_asset.php + * @magentoDataFixture Magento/MediaGallery/_files/media_asset_loaded_year_ago.php + * + * @return void + */ + public function testFilterByDate(): void + { + $filter = [ + 'created_at' => [ + 'from' => (new \DateTime('-1 day'))->format('m/d/Y'), + 'to' => (new \DateTime())->format('m/d/Y'), + ], + ]; + $this->request->setParams(['filters' => $filter]); + $data = $this->getComponentProvidedData('standalone_media_gallery_listing'); + $items = $data['items']; + $this->assertCount(1, $items); + $item = reset($items); + $this->assertEquals('testDirectory/path.jpg', $item['path']); + } + + /** + * Call prepare method in the child components + * + * @param UiComponentInterface $component + * @return void + */ + private function prepareChildComponents(UiComponentInterface $component): void + { + foreach ($component->getChildComponents() as $child) { + $this->prepareChildComponents($child); + } + + $component->prepare(); + } + + /** + * Get component provided data + * + * @param string $namespace + * @return array + */ + private function getComponentProvidedData(string $namespace): array + { + $component = $this->componentFactory->create($namespace); + $this->prepareChildComponents($component); + + return $component->getContext()->getDataProvider()->getData(); + } +} diff --git a/dev/tests/integration/testsuite/Magento/MessageQueue/Model/Plugin/ResourceModel/LockTest.php b/dev/tests/integration/testsuite/Magento/MessageQueue/Model/Plugin/ResourceModel/LockTest.php index 98dd9b34ba8c7..c4cd90868eed1 100644 --- a/dev/tests/integration/testsuite/Magento/MessageQueue/Model/Plugin/ResourceModel/LockTest.php +++ b/dev/tests/integration/testsuite/Magento/MessageQueue/Model/Plugin/ResourceModel/LockTest.php @@ -48,6 +48,8 @@ public function testLockClearedByMaintenanceModeOff() { /** @var $maintenanceMode \Magento\Framework\App\MaintenanceMode */ $maintenanceMode = $this->objectManager->get(\Magento\Framework\App\MaintenanceMode::class); + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $code = md5('consumer.name-1'); $this->lock->setMessageCode($code); $this->writer->saveLock($this->lock); diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Controller/Manage/SaveTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Controller/Manage/SaveTest.php index 5d1619ca9b066..acd87ad5bfa75 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Controller/Manage/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Controller/Manage/SaveTest.php @@ -12,6 +12,7 @@ use Magento\Customer\Model\Session; use Magento\Framework\Data\Form\FormKey; use Magento\Framework\Message\MessageInterface; +use Magento\Newsletter\Model\CustomerSubscriberCache; use Magento\Newsletter\Model\Plugin\CustomerPlugin; use Magento\TestFramework\TestCase\AbstractController; @@ -69,7 +70,6 @@ protected function tearDown(): void public function testSaveAction(bool $isSubscribed, string $expectedMessage): void { $this->loginCustomer('new_customer@example.com'); - $this->_objectManager->removeSharedInstance(CustomerPlugin::class); $this->dispatchSaveAction($isSubscribed); $this->assertSuccessSubscription($expectedMessage); } @@ -112,7 +112,6 @@ public function testSubscribeWithEnabledConfirmation(): void public function testUnsubscribeSubscribedCustomer(): void { $this->loginCustomer('new_customer@example.com'); - $this->_objectManager->removeSharedInstance(CustomerPlugin::class); $this->dispatchSaveAction(false); $this->assertSuccessSubscription('We have removed your newsletter subscription.'); } @@ -126,6 +125,7 @@ public function testUnsubscribeSubscribedCustomer(): void private function dispatchSaveAction(bool $isSubscribed): void { $this->_objectManager->removeSharedInstance(CustomerPlugin::class); + $this->_objectManager->removeSharedInstance(CustomerSubscriberCache::class); $this->getRequest()->setParam('form_key', $this->formKey->getFormKey()) ->setParam('is_subscribed', $isSubscribed); $this->dispatch('newsletter/manage/save'); diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php index 07c3c78df9372..0473d7cfc5ae6 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php @@ -61,6 +61,8 @@ public function testSendPerSubscriber() */ public function testSendPerSubscriberProblem() { + // md5 used here only for random string generation for test purposes. No cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $errorMsg = md5(microtime()); \Magento\TestFramework\Helper\Bootstrap::getInstance() diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php index dbf8bce795548..3cd1eca8f0fa5 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php @@ -8,10 +8,10 @@ namespace Magento\Newsletter\Model; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Framework\Mail\EmailMessage; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Mail\EmailMessage; +use Magento\Newsletter\Model\ResourceModel\Subscriber\CollectionFactory; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\Mail\Template\TransportBuilderMock; use PHPUnit\Framework\TestCase; @@ -26,27 +26,42 @@ class SubscriberTest extends TestCase private const CONFIRMATION_SUBSCRIBE = 'You have been successfully subscribed to our newsletter.'; private const CONFIRMATION_UNSUBSCRIBE = 'You have been unsubscribed from the newsletter.'; - /** @var ObjectManagerInterface */ - private $objectManager; - - /** @var SubscriberFactory */ + /** + * @var SubscriberFactory + */ private $subscriberFactory; - /** @var TransportBuilderMock */ + /** + * @var TransportBuilderMock + */ private $transportBuilder; - /** @var CustomerRepositoryInterface */ + /** + * @var CustomerRepositoryInterface + */ private $customerRepository; + /** + * @var QueueFactory + */ + private $queueFactory; + + /** + * @var CollectionFactory + */ + private $subscriberCollectionFactory; + /** * @inheritdoc */ protected function setUp(): void { - $this->objectManager = Bootstrap::getObjectManager(); - $this->subscriberFactory = $this->objectManager->get(SubscriberFactory::class); - $this->transportBuilder = $this->objectManager->get(TransportBuilderMock::class); - $this->customerRepository = $this->objectManager->get(CustomerRepositoryInterface::class); + $objectManager = Bootstrap::getObjectManager(); + $this->subscriberFactory = $objectManager->get(SubscriberFactory::class); + $this->transportBuilder = $objectManager->get(TransportBuilderMock::class); + $this->customerRepository = $objectManager->get(CustomerRepositoryInterface::class); + $this->queueFactory = $objectManager->get(QueueFactory::class); + $this->subscriberCollectionFactory = $objectManager->get(CollectionFactory::class); } /** @@ -136,6 +151,27 @@ public function testUnsubscribeSubscribeByCustomerId(): void ); } + /** + * Test subscribe and verify customer subscription status + * + * @magentoDataFixture Magento/Customer/_files/customer_sample.php + * + * @return void + */ + public function testSubscribeAndVerifyCustomerSubscriptionStatus(): void + { + $customer = $this->customerRepository->getById(1); + $subscriptionBefore = $customer->getExtensionAttributes() + ->getIsSubscribed(); + $subscriber = $this->subscriberFactory->create(); + $subscriber->subscribeCustomerById($customer->getId()); + + $customer = $this->customerRepository->getById(1); + + $this->assertFalse($subscriptionBefore); + $this->assertTrue($customer->getExtensionAttributes()->getIsSubscribed()); + } + /** * @magentoConfigFixture current_store newsletter/subscription/confirm 1 * @@ -157,6 +193,36 @@ public function testConfirm(): void ); } + /** + * Unsubscribe and check queue + * + * @magentoDataFixture Magento/Newsletter/_files/queue.php + * + * @return void + */ + public function testUnsubscribeCustomer(): void + { + $firstSubscriber = $this->subscriberFactory->create() + ->load('customer@example.com', 'subscriber_email'); + $secondSubscriber = $this->subscriberFactory->create() + ->load('customer_two@example.com', 'subscriber_email'); + + $queue = $this->queueFactory->create() + ->load('CustomerSupport', 'newsletter_sender_name'); + $queue->addSubscribersToQueue([$firstSubscriber->getId(), $secondSubscriber->getId()]); + + $secondSubscriber->unsubscribe(); + + $collection = $this->subscriberCollectionFactory->create() + ->useQueue($queue); + + $this->assertCount(1, $collection); + $this->assertEquals( + 'customer@example.com', + $collection->getFirstItem()->getData('subscriber_email') + ); + } + /** * @magentoDataFixture Magento/Customer/_files/customer_confirmation_config_enable.php * @magentoDataFixture Magento/Newsletter/_files/newsletter_unconfirmed_customer.php diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php index 13fcd53d78186..57446562d527f 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/Express/CheckoutTest.php @@ -190,8 +190,11 @@ public function testPrepareCustomerQuote() * @magentoDataFixture Magento/Paypal/_files/quote_express.php * @magentoAppIsolation enabled * @magentoDbIsolation enabled + * @param string $accountEmail + * @param string $expected + * @dataProvider placeGuestQuoteDataProvider */ - public function testPlaceGuestQuote() + public function testPlaceGuestQuote($accountEmail, $expected) { /** @var Quote $quote */ $quote = $this->getFixtureQuote(); @@ -199,6 +202,11 @@ public function testPlaceGuestQuote() $quote->getShippingAddress()->setSameAsBilling(0); $quote->setReservedOrderId(null); + /* Simulate data returned from PayPal containing email as well + as email entered at checkout step */ + $quote->getBillingAddress()->setEmail('paypal_account@email.com'); + $quote->getBillingAddress()->setOrigData('email', $accountEmail); + $checkout = $this->getCheckout($quote); $checkout->place('token'); @@ -209,6 +217,7 @@ public function testPlaceGuestQuote() $quote->getCustomerGroupId() ); + $this->assertEquals($expected, $quote->getCustomerEmail()); $this->assertNotEmpty($quote->getBillingAddress()); $this->assertNotEmpty($quote->getShippingAddress()); @@ -217,6 +226,17 @@ public function testPlaceGuestQuote() $this->assertNotEmpty($order->getShippingAddress()); } + /** + * @return array + */ + public function placeGuestQuoteDataProvider(): array + { + return [ + 'case with account email absent' => [null, 'paypal_account@email.com'], + 'case with account email present' => ['magento_account@email.com', 'magento_account@email.com'], + ]; + } + /** * Place the order as guest when `Automatic Assignment to Customer Group` is enabled. * diff --git a/dev/tests/integration/testsuite/Magento/Reports/Block/Adminhtml/Shopcart/Product/GridTest.php b/dev/tests/integration/testsuite/Magento/Reports/Block/Adminhtml/Shopcart/Product/GridTest.php index fc0bacf240e1f..65403fd3bf9a6 100644 --- a/dev/tests/integration/testsuite/Magento/Reports/Block/Adminhtml/Shopcart/Product/GridTest.php +++ b/dev/tests/integration/testsuite/Magento/Reports/Block/Adminhtml/Shopcart/Product/GridTest.php @@ -22,6 +22,7 @@ class GridTest extends \Magento\Reports\Block\Adminhtml\Shopcart\GridTestAbstrac */ public function testGridContent() { + $this->markTestSkipped('MC-40448: Product\GridTest failure on 2.4-develop'); /** @var \Magento\Framework\View\LayoutInterface $layout */ $layout = Bootstrap::getObjectManager()->get(\Magento\Framework\View\LayoutInterface::class); /** @var Grid $grid */ diff --git a/dev/tests/integration/testsuite/Magento/Review/Block/Adminhtml/Edit/FormTest.php b/dev/tests/integration/testsuite/Magento/Review/Block/Adminhtml/Edit/FormTest.php index fb9f6b5a198c9..85e5b5b4c7527 100644 --- a/dev/tests/integration/testsuite/Magento/Review/Block/Adminhtml/Edit/FormTest.php +++ b/dev/tests/integration/testsuite/Magento/Review/Block/Adminhtml/Edit/FormTest.php @@ -6,23 +6,26 @@ namespace Magento\Review\Block\Adminhtml\Edit; -class FormTest extends \PHPUnit\Framework\TestCase +use Magento\Customer\Model\Customer; +use Magento\Framework\Escaper; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +class FormTest extends TestCase { /** * @magentoDataFixture Magento/Review/_files/customer_review.php */ public function testCustomerOnForm() { - /** @var \Magento\Customer\Model\Customer $customer */ - $customer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Customer\Model\Customer::class) + /** @var Customer $customer */ + $customer = Bootstrap::getObjectManager()->create(Customer::class) ->setWebsiteId(1) ->loadByEmail('customer@example.com'); - $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Review\Block\Adminhtml\Edit\Form::class); - /** @var \Magento\Framework\Escaper $escaper */ - $escaper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get(\Magento\Framework\Escaper::class); + $block = Bootstrap::getObjectManager()->create(Form::class); + /** @var Escaper $escaper */ + $escaper = Bootstrap::getObjectManager()->get(Escaper::class); $this->assertStringMatchesFormat( '%A' . __( '<a href="%1" onclick="this.target=\'blank\'">%2 %3</a> <a href="mailto:%4">(%4)</a>', @@ -34,4 +37,24 @@ public function testCustomerOnForm() $block->toHtml() ); } + + /** + * Verify review form hidden input will contain all review stores. + * + * @magentoDataFixture Magento/Review/_files/customer_review.php + * @return void + */ + public function testStoresOnForm(): void + { + $registry = Bootstrap::getObjectManager()->get(Registry::class); + $review = $registry->registry('review_data'); + $block = Bootstrap::getObjectManager()->create(Form::class); + foreach ($review->getStores() as $storeId) { + $regex = sprintf('/input id="select_stores" (.*) value="%d" type="hidden"/', $storeId); + $this->assertMatchesRegularExpression( + $regex, + $block->toHtml() + ); + } + } } diff --git a/dev/tests/integration/testsuite/Magento/Review/Block/Customer/ViewTest.php b/dev/tests/integration/testsuite/Magento/Review/Block/Customer/ViewTest.php index 31a342ad8ac54..04a5a37c64555 100644 --- a/dev/tests/integration/testsuite/Magento/Review/Block/Customer/ViewTest.php +++ b/dev/tests/integration/testsuite/Magento/Review/Block/Customer/ViewTest.php @@ -81,13 +81,12 @@ public function testCustomerProductReviewBlock(): void $ratings = $this->block->getRating(); $this->assertCount(2, $ratings); foreach ($ratings as $rating) { + $this->assertNotEmpty($rating->getRatingId()); $this->assertEquals( 1, Xpath::getElementsCountForXpath( sprintf( - "//div[contains(@class, 'rating-summary')]//span[contains(text(), '%s')]" - . "/../..//span[contains(text(), '%s%%')]", - $rating->getRatingCode(), + "//div[contains(@id, 'rating-div-".$rating->getRatingId()."')]//span[contains(text(), '%s')]", $rating->getPercent() ), $blockHtml diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/ItemsTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/ItemsTest.php index 7fdfc79b3fdfe..f1b6ca9c09b34 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/ItemsTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/ItemsTest.php @@ -81,6 +81,22 @@ public function testGetOrderItems(): void $this->assertCount(1, $this->block->getItems()); } + /** + * @magentoDataFixture Magento/Sales/_files/order_configurable_product.php + * + * @return void + */ + public function testGetPagerCountConfigurable(): void + { + $order = $this->orderFactory->create()->loadByIncrementId('100000001'); + $this->registerOrder($order); + $this->prepareBlockWithPager(); + + /** @var Pager $pagerBlock */ + $pagerBlock = $this->block->getChildBlock('sales_order_item_pager'); + $this->assertCount(1, $pagerBlock->getCollection()->getItems()); + } + /** * @magentoConfigFixture default/sales/orders/items_per_page 3 * @magentoDataFixture Magento/Sales/_files/order_item_list.php @@ -91,13 +107,7 @@ public function testPagerIsDisplayed(): void { $order = $this->orderFactory->create()->loadByIncrementId('100000001'); $this->registerOrder($order); - $this->block = $this->layout->createBlock(Items::class, 'items_block'); - $this->layout->addBlock( - $this->objectManager->get(Pager::class), - 'sales_order_item_pager', - 'items_block' - ); - $this->block->setLayout($this->layout); + $this->prepareBlockWithPager(); $this->assertTrue($this->block->isPagerDisplayed()); } @@ -110,13 +120,7 @@ public function testPagerIsNotDisplayed(): void { $order = $this->orderFactory->create()->loadByIncrementId('100000001'); $this->registerOrder($order); - $this->block = $this->layout->createBlock(Items::class, 'items_block'); - $this->layout->addBlock( - $this->objectManager->get(Pager::class), - 'sales_order_item_pager', - 'items_block' - ); - $this->block->setLayout($this->layout); + $this->prepareBlockWithPager(); $this->assertFalse($this->block->isPagerDisplayed()); $this->assertEmpty(preg_replace('/\s+/', '', strip_tags($this->block->getPagerHtml()))); } @@ -131,13 +135,7 @@ public function testGetPagerHtml(): void { $order = $this->orderFactory->create()->loadByIncrementId('100000001'); $this->registerOrder($order); - $this->block = $this->layout->createBlock(Items::class, 'items_block'); - $this->layout->addBlock( - $this->objectManager->get(Pager::class), - 'sales_order_item_pager', - 'items_block' - ); - $this->block->setLayout($this->layout); + $this->prepareBlockWithPager(); $this->assertNotEmpty(preg_replace('/\s+/', '', strip_tags($this->block->getPagerHtml()))); $this->assertTrue($this->block->isPagerDisplayed()); } @@ -227,4 +225,18 @@ private function registerOrder(OrderInterface $order): void $this->registry->unregister('current_order'); $this->registry->register('current_order', $order); } + + /** + * Create items block with pager + */ + private function prepareBlockWithPager(): void + { + $this->block = $this->layout->createBlock(Items::class, 'items_block'); + $this->layout->addBlock( + $this->objectManager->get(Pager::class), + 'sales_order_item_pager', + 'items_block' + ); + $this->block->setLayout($this->layout); + } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php index 027fc3d88ee49..c308305771e98 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php @@ -218,19 +218,21 @@ public function testPartialInvoiceWitConfigurableProduct(): void } /** - * Get order items qty invoiced + * @magentoDataFixture Magento/Sales/_files/order_with_bundle_dynamic_price_no.php * - * @param int $orderId - * @return array + * @return void */ - private function getOrderItemsQtyInvoiced(int $orderId): array + public function testOrderItemsQtyInvoicedForBundleDynamicPriceFalse(): void { - $connection = $this->orderItemResource->getConnection(); - $select = $connection->select() - ->from($this->orderItemResource->getMainTable(), OrderItemInterface::QTY_INVOICED) - ->where(OrderItemInterface::ORDER_ID . ' = ?', $orderId); + $order = $this->getOrder('100000001'); + $entityId = $order->getEntityId(); - return $connection->fetchCol($select); + $this->prepareRequest([], ['order_id' => $entityId]); + $this->dispatch('backend/sales/order_invoice/save'); + + $ordered = $this->getOrderItemsQtyOrdered((int)$entityId); + $invoiced = $this->getOrderItemsQtyInvoiced((int)$entityId); + $this->assertEquals($ordered, $invoiced); } /** @@ -314,4 +316,36 @@ private function checkSuccess( ); $this->assertSessionMessages($this->containsEqual((string)__($message))); } + + /** + * Get order items qty invoiced + * + * @param int $orderId + * @return array + */ + private function getOrderItemsQtyInvoiced(int $orderId): array + { + $connection = $this->orderItemResource->getConnection(); + $select = $connection->select() + ->from($this->orderItemResource->getMainTable(), OrderItemInterface::QTY_INVOICED) + ->where(OrderItemInterface::ORDER_ID . ' = ?', $orderId); + + return $connection->fetchCol($select); + } + + /** + * Get order items qty ordered + * + * @param int $orderId + * @return array + */ + private function getOrderItemsQtyOrdered(int $orderId): array + { + $connection = $this->orderItemResource->getConnection(); + $select = $connection->select() + ->from($this->orderItemResource->getMainTable(), OrderItemInterface::QTY_ORDERED) + ->where(OrderItemInterface::ORDER_ID . ' = ?', $orderId); + + return $connection->fetchCol($select); + } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Address/RendererTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Address/RendererTest.php index 4f1bbaeb920bb..418c0ee061bc9 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Address/RendererTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Address/RendererTest.php @@ -5,16 +5,21 @@ */ namespace Magento\Sales\Model\Order\Address; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Framework\ObjectManagerInterface; -use Magento\Sales\Model\Order\Address\Renderer as OrderAddressRenderer; use Magento\Config\Model\ResourceModel\Config as ConfigResourceModel; use Magento\Framework\App\Config; -use Magento\Store\Model\Store; -use Magento\Sales\Model\Order\Address as OrderAddress; +use Magento\Framework\Locale\TranslatedLists; +use Magento\Framework\ObjectManagerInterface; use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Address as OrderAddress; +use Magento\Sales\Model\Order\Address\Renderer as OrderAddressRenderer; +use Magento\Store\Model\Store; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; -class RendererTest extends \PHPUnit\Framework\TestCase +/** + * Test for \Magento\Sales\Model\Order\Address\Renderer. + */ +class RendererTest extends TestCase { /** * @var ObjectManagerInterface @@ -103,4 +108,30 @@ public function testFormat() $this->assertEquals($addressTemplates['html'], $this->orderAddressRenderer->format($address, 'html')); $this->assertEquals($addressTemplates['pdf'], $this->orderAddressRenderer->format($address, 'pdf')); } + + /** + * Order country will be translated to locale on which was placed an order + * + * @magentoDbIsolation disabled + * @magentoDataFixture Magento/Sales/_files/order_fixture_store.php + * + * @return void + */ + public function testRenderOrderAddressCountry(): void + { + /** @var TranslatedLists $localeResolver */ + $this->objectManager->create(TranslatedLists::class, ['locale' => 'ko_KR']); + + /** @var Order $order */ + $order = $this->objectManager->create(Order::class) + ->loadByIncrementId('100000004'); + + /** @var OrderAddress $address */ + $address = $order->getBillingAddress(); + + $this->assertStringContainsString( + 'United States', + $this->orderAddressRenderer->format($address, 'html') + ); + } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/CreditmemoSenderTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/CreditmemoSenderTest.php index bc51f8acb2f6f..7eea81b543338 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/CreditmemoSenderTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/CreditmemoSenderTest.php @@ -3,15 +3,20 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Sales\Model\Order\Email\Sender; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Model\ResourceModel\CustomerRepository; +use Magento\Framework\App\Area; use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Creditmemo; use Magento\Sales\Model\Order\Email\Container\CreditmemoIdentity; +use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; -class CreditmemoSenderTest extends \PHPUnit\Framework\TestCase +class CreditmemoSenderTest extends TestCase { const NEW_CUSTOMER_EMAIL = 'new.customer@example.com'; const OLD_CUSTOMER_EMAIL = 'customer@null.com'; @@ -27,9 +32,7 @@ class CreditmemoSenderTest extends \PHPUnit\Framework\TestCase */ protected function setUp(): void { - parent::setUp(); - $this->customerRepository = Bootstrap::getObjectManager() - ->get(CustomerRepositoryInterface::class); + $this->customerRepository = Bootstrap::getObjectManager()->get(CustomerRepositoryInterface::class); } /** @@ -37,22 +40,17 @@ protected function setUp(): void */ public function testSend() { - Bootstrap::getInstance() - ->loadArea(\Magento\Framework\App\Area::AREA_FRONTEND); - $order = Bootstrap::getObjectManager() - ->create(\Magento\Sales\Model\Order::class); + Bootstrap::getInstance()->loadArea(Area::AREA_FRONTEND); + $order = Bootstrap::getObjectManager()->create(Order::class); $order->loadByIncrementId('100000001'); $order->setCustomerEmail('customer@example.com'); - $creditmemo = Bootstrap::getObjectManager()->create( - \Magento\Sales\Model\Order\Creditmemo::class - ); + $creditmemo = Bootstrap::getObjectManager()->create(Creditmemo::class); $creditmemo->setOrder($order); $this->assertEmpty($creditmemo->getEmailSent()); - $creditmemoSender = Bootstrap::getObjectManager() - ->create(\Magento\Sales\Model\Order\Email\Sender\CreditmemoSender::class); + $creditmemoSender = Bootstrap::getObjectManager()->create(CreditmemoSender::class); $result = $creditmemoSender->send($creditmemo, true); $this->assertTrue($result); @@ -129,19 +127,41 @@ public function testSendWithoutCustomer() $this->assertNotEmpty($creditmemo->getEmailSent()); } - private function createCreditmemo(Order $order): Order\Creditmemo + /** + * Verify order will be marked send email on non default store in case default store order email sent is disabled. + * + * @magentoDataFixture Magento/Sales/_files/order_fixture_store.php + * @magentoConfigFixture default/sales_email/creditmemo/enabled 0 + * @magentoConfigFixture default/sales_email/general/async_sending 1 + * @magentoConfigFixture fixturestore/sales_email/creditmemo/enabled 1 + * @magentoAppArea adminhtml + * @magentoDbIsolation disabled + */ + public function testSendCreditmemeoEmailFromNonDefaultStore() + { + $storeManager = Bootstrap::getObjectManager()->get(StoreManagerInterface::class); + $store = $storeManager->getStore('fixturestore'); + $order = Bootstrap::getObjectManager()->create(Order::class); + $order->loadByIncrementIdAndStoreId('100000001', $store->getId()); + $order->setCustomerEmail('customer@example.com'); + $creditmemo = Bootstrap::getObjectManager()->create(Creditmemo::class); + $creditmemo->setOrder($order); + $creditmemoSender = Bootstrap::getObjectManager()->create(CreditmemoSender::class); + $result = $creditmemoSender->send($creditmemo); + $this->assertFalse($result); + $this->assertTrue($creditmemo->getSendEmail()); + } + + private function createCreditmemo(Order $order): Creditmemo { - $creditmemo = Bootstrap::getObjectManager()->create( - \Magento\Sales\Model\Order\Creditmemo::class - ); + $creditmemo = Bootstrap::getObjectManager()->create(Creditmemo::class); $creditmemo->setOrder($order); return $creditmemo; } private function createOrder(): Order { - $order = Bootstrap::getObjectManager() - ->create(Order::class); + $order = Bootstrap::getObjectManager()->create(Order::class); $order->loadByIncrementId('100000001'); return $order; @@ -149,9 +169,7 @@ private function createOrder(): Order private function createCreditMemoIdentity(): CreditmemoIdentity { - return Bootstrap::getObjectManager()->create( - CreditmemoIdentity::class - ); + return Bootstrap::getObjectManager()->create(CreditmemoIdentity::class); } private function createCreditMemoSender(CreditmemoIdentity $creditmemoIdentity): CreditmemoSender diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/InvoiceSenderTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/InvoiceSenderTest.php index 672709cbcd44b..6acd995d82270 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/InvoiceSenderTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/InvoiceSenderTest.php @@ -13,6 +13,7 @@ use Magento\Sales\Api\Data\InvoiceInterfaceFactory; use Magento\Sales\Api\Data\OrderInterface; use Magento\Sales\Api\Data\OrderInterfaceFactory; +use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\Email\Container\InvoiceIdentity; use Magento\Sales\Model\Order\Invoice; use Magento\TestFramework\Helper\Bootstrap; @@ -178,6 +179,27 @@ public function testSendWithAsyncSendingEnabled(): void ); } + /** + * Verify invoice will be marked send email on non default store in case default store email sent is disabled. + * + * @magentoDataFixture Magento/Sales/_files/order_fixture_store.php + * @magentoConfigFixture sales_email/general/async_sending 1 + * @magentoConfigFixture default_store sales_email/invoice/enabled 0 + * @magentoConfigFixture fixturestore_store sales_email/invoice/enabled 1 + * @magentoAppArea adminhtml + * @magentoDbIsolation disabled + */ + public function testSendInvoiceEmailFromNonDefaultStore() + { + $order = Bootstrap::getObjectManager()->create(Order::class); + $order->loadByIncrementId('100000004'); + $order->setCustomerEmail('customer@example.com'); + $invoice = $this->createInvoice($order); + $result = $this->invoiceSender->send($invoice); + $this->assertFalse($result); + $this->assertTrue($invoice->getSendEmail()); + } + /** * Create invoice and set order * diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/OrderSenderTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/OrderSenderTest.php index a9a62f4595f44..434e7b65cf509 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/OrderSenderTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Email/Sender/OrderSenderTest.php @@ -3,32 +3,65 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Sales\Model\Order\Email\Sender; +use Magento\Framework\App\Area; +use Magento\Sales\Model\Order; use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; -class OrderSenderTest extends \PHPUnit\Framework\TestCase +class OrderSenderTest extends TestCase { + /** + * @var OrderSender + */ + private $orderSender; + + /** + * @inheirtDoc + */ + protected function setUp(): void + { + $this->orderSender = Bootstrap::getObjectManager()->create(OrderSender::class); + } + /** * @magentoDataFixture Magento/Sales/_files/order.php */ public function testSendNewOrderEmail() { - \Magento\TestFramework\Helper\Bootstrap::getInstance() - ->loadArea(\Magento\Framework\App\Area::AREA_FRONTEND); - $order = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Sales\Model\Order::class); + Bootstrap::getInstance()->loadArea(Area::AREA_FRONTEND); + $order = Bootstrap::getObjectManager()->create(Order::class); $order->loadByIncrementId('100000001'); $order->setCustomerEmail('customer@example.com'); $this->assertEmpty($order->getEmailSent()); - $orderSender = Bootstrap::getObjectManager() - ->create(\Magento\Sales\Model\Order\Email\Sender\OrderSender::class); - $result = $orderSender->send($order); + $result = $this->orderSender->send($order); $this->assertTrue($result); $this->assertNotEmpty($order->getEmailSent()); } + + /** + * Verify order will be marked send email on non default store in case default store order email sent is disabled. + * + * @magentoDataFixture Magento/Sales/_files/order_fixture_store.php + * @magentoConfigFixture sales_email/general/async_sending 1 + * @magentoConfigFixture default_store sales_email/order/enabled 0 + * @magentoConfigFixture fixturestore_store sales_email/order/enabled 1 + * @magentoAppArea adminhtml + * @magentoDbIsolation disabled + */ + public function testSendOrderEmailFromNonDefaultStore() + { + $order = Bootstrap::getObjectManager()->create(Order::class); + $order->loadByIncrementId('100000004'); + $order->setCustomerEmail('customer@example.com'); + $result = $this->orderSender->send($order); + $this->assertFalse($result); + $this->assertTrue($order->getSendEmail()); + } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Shipment/Sender/EmailSenderTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Shipment/Sender/EmailSenderTest.php new file mode 100644 index 0000000000000..4d85e435226b0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/Shipment/Sender/EmailSenderTest.php @@ -0,0 +1,54 @@ +<?php + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Sales\Model\Order\Shipment\Sender; + +use Magento\Sales\Model\Order; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Provides tests for shipment email sender. + */ +class EmailSenderTest extends TestCase +{ + /** + * @var EmailSender + */ + private $emailSender; + + /** + * @inheirtDoc + */ + protected function setUp(): void + { + $this->emailSender = Bootstrap::getObjectManager()->create(EmailSender::class); + } + + /** + * Verify shipment will be marked send email on non default store in case default store order email sent is disabled + * + * @magentoDataFixture Magento/Sales/_files/order_fixture_store.php + * @magentoConfigFixture sales_email/general/async_sending 1 + * @magentoConfigFixture default_store sales_email/shipment/enabled 0 + * @magentoConfigFixture fixturestore_store sales_email/shipment/enabled 1 + * @magentoAppArea adminhtml + * @magentoDbIsolation disabled + */ + public function testSendShipmentEmailFromNonDefaultStore() + { + $order = Bootstrap::getObjectManager()->create(Order::class); + $order->loadByIncrementId('100000004'); + $order->setCustomerEmail('customer@example.com'); + $shipment = Bootstrap::getObjectManager()->create(Order\Shipment::class); + $shipment->setOrder($order); + $result = $this->emailSender->send($order, $shipment); + $this->assertFalse($result); + $this->assertTrue($shipment->getSendEmail()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_on_second_website.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_on_second_website.php new file mode 100644 index 0000000000000..0a12811963377 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_on_second_website.php @@ -0,0 +1,35 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Sales\Api\Data\OrderInterfaceFactory; +use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Sales/_files/order.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); +$defaultWebsiteId = (int) $storeManager->getWebsite('base')->getId(); +$websiteId = (int) $storeManager->getWebsite('test')->getId(); +$storeId = (int) $storeManager->getStore('fixture_second_store')->getId(); + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$productRepository->cleanCache(); +$product = $productRepository->get('simple'); +$product->setWebsiteIds([$defaultWebsiteId, $websiteId]); +$productRepository->save($product); + +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->get(OrderRepositoryInterface::class); +$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000001'); +$order->setShippingMethod('flatrate_flatrate')->setStoreId($storeId); +$orderRepository->save($order); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_on_second_website_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_on_second_website_rollback.php new file mode 100644 index 0000000000000..07d468289f5b4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_on_second_website_rollback.php @@ -0,0 +1,10 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Sales/_files/order_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_bundle_dynamic_price_no.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_bundle_dynamic_price_no.php new file mode 100644 index 0000000000000..c9c39e04f6348 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_bundle_dynamic_price_no.php @@ -0,0 +1,90 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Sales\Api\Data\OrderInterfaceFactory; +use Magento\Sales\Api\Data\OrderItemInterface; +use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Item; +use Magento\TestFramework\ObjectManager; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Sales/_files/order.php'); + +$objectManager = ObjectManager::getInstance(); +/** @var Order $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000001'); + +$orderItems = [ + [ + OrderItemInterface::SKU => 'bundle_1', + OrderItemInterface::NAME => 'bundle_1', + OrderItemInterface::PRODUCT_ID => 2, + OrderItemInterface::BASE_PRICE => 100, + OrderItemInterface::ORDER_ID => $order->getId(), + OrderItemInterface::QTY_ORDERED => 2, + OrderItemInterface::PRICE => 100, + OrderItemInterface::ROW_TOTAL => 102, + OrderItemInterface::PRODUCT_TYPE => 'bundle', + 'product_options' => [ + 'product_calculations' => 1, + 'info_buyRequest' => [ + 'bundle_option' => [1 => 1], + 'bundle_option_qty' => 1, + ] + ], + 'children' => [ + [ + OrderItemInterface::SKU => 'bundle_simple_1', + OrderItemInterface::NAME => 'bundle_simple_1', + OrderItemInterface::PRODUCT_ID => 13, + OrderItemInterface::ORDER_ID => $order->getId(), + OrderItemInterface::QTY_ORDERED => 10, + OrderItemInterface::BASE_PRICE => 90, + OrderItemInterface::PRICE => 90, + OrderItemInterface::ROW_TOTAL => 92, + OrderItemInterface::PRODUCT_TYPE => 'simple', + 'product_options' => [ + 'bundle_selection_attributes' => '{"qty":5}', + ], + ], + ], + ], +]; + +if (!function_exists('saveOrderItems')) { + /** + * Save Order Items. + * + * @param array $orderItems + * @param Item|null $parentOrderItem [optional] + * @return void + */ + function saveOrderItems(array $orderItems, Order $order, $parentOrderItem = null) + { + $objectManager = ObjectManager::getInstance(); + + foreach ($orderItems as $orderItemData) { + /** @var Item $orderItem */ + $orderItem = $objectManager->create(Item::class); + if (null !== $parentOrderItem) { + $orderItemData['parent_item'] = $parentOrderItem; + } + $orderItem->setData($orderItemData); + $order->addItem($orderItem); + + if (isset($orderItemData['children'])) { + saveOrderItems($orderItemData['children'], $order, $orderItem); + } + } + } +} + +saveOrderItems($orderItems, $order); +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->get(OrderRepositoryInterface::class); +$order = $orderRepository->save($order); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_bundle_dynamic_price_no_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_bundle_dynamic_price_no_rollback.php new file mode 100644 index 0000000000000..07d468289f5b4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_bundle_dynamic_price_no_rollback.php @@ -0,0 +1,10 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Sales/_files/order_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Model/Quote/Address/Total/ShippingTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Model/Quote/Address/Total/ShippingTest.php index 02e8eba4a6236..2c1811bc9e8c2 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/Model/Quote/Address/Total/ShippingTest.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/Model/Quote/Address/Total/ShippingTest.php @@ -6,28 +6,49 @@ namespace Magento\SalesRule\Model\Quote\Address\Total; -class ShippingTest extends \PHPUnit\Framework\TestCase +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Registry; +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\Quote\Api\Data\AddressInterface; +use Magento\Quote\Api\Data\AddressInterfaceFactory; +use Magento\Quote\Api\Data\CartInterface; +use Magento\Quote\Api\Data\ShippingMethodInterface; +use Magento\Quote\Api\GuestCartItemRepositoryInterface; +use Magento\Quote\Api\GuestCartManagementInterface; +use Magento\Quote\Api\GuestShipmentEstimationInterface; +use Magento\Quote\Model\MaskedQuoteIdToQuoteIdInterface; +use Magento\SalesRule\Model\Rule\Condition\Combine; +use Magento\SalesRule\Model\Rule\Condition\Product; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class ShippingTest extends TestCase { /** - * @var \Magento\Quote\Api\GuestCartManagementInterface + * @var GuestCartManagementInterface */ private $cartManagement; /** - * @var \Magento\Quote\Api\GuestCartItemRepositoryInterface + * @var GuestCartItemRepositoryInterface */ private $itemRepository; /** - * @var \Magento\Framework\ObjectManagerInterface + * @var ObjectManagerInterface */ private $objectManager; protected function setUp(): void { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->cartManagement = $this->objectManager->get(\Magento\Quote\Api\GuestCartManagementInterface::class); - $this->itemRepository = $this->objectManager->get(\Magento\Quote\Api\GuestCartItemRepositoryInterface::class); + $this->objectManager = Bootstrap::getObjectManager(); + $this->cartManagement = $this->objectManager->get(GuestCartManagementInterface::class); + $this->itemRepository = $this->objectManager->get(GuestCartItemRepositoryInterface::class); } /** @@ -37,7 +58,8 @@ protected function setUp(): void */ public function testRuleByProductWeightWithFreeShipping() { - $cartId = $this->prepareQuote(1); + $cartId = $this->cartManagement->createEmptyCart(); + $this->addToCart($cartId, 'simple-99', 1); $methods = $this->estimateShipping($cartId); $this->assertTrue(count($methods) > 0); @@ -52,7 +74,8 @@ public function testRuleByProductWeightWithFreeShipping() */ public function testRuleByProductWeightWithoutFreeShipping() { - $cartId = $this->prepareQuote(5); + $cartId = $this->cartManagement->createEmptyCart(); + $this->addToCart($cartId, 'simple-99', 5); $methods = $this->estimateShipping($cartId); $this->assertTrue(count($methods) > 0); @@ -60,47 +83,122 @@ public function testRuleByProductWeightWithoutFreeShipping() $this->assertEquals(25, $methods[0]->getAmount()); } + /** + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/SalesRule/_files/cart_rule_free_shipping.php + * @magentoDataFixture Magento/Catalog/_files/products_list.php + */ + public function testFreeMethodWeight() + { + $this->setFreeShippingForProduct('simple-249'); + $cartId = $this->cartManagement->createEmptyCart(); + $this->addToCart($cartId, 'simple-249', 3); + $this->addToCart($cartId, 'simple-156', 1); + $this->estimateShipping($cartId); + $quote = $this->getQuote($cartId); + $this->assertEquals(10, $quote->getShippingAddress()->getFreeMethodWeight()); + } + + /** + * @magentoAppIsolation enabled + * @magentoDataFixture Magento/SalesRule/_files/cart_rule_free_shipping.php + * @magentoDataFixture Magento/Catalog/_files/products_list.php + */ + public function testFreeMethodWeightWithMaximumQtyDiscount() + { + $this->setFreeShippingForProduct('simple-249', 2); + $cartId = $this->cartManagement->createEmptyCart(); + $this->addToCart($cartId, 'simple-249', 5); + $this->addToCart($cartId, 'simple-156', 1); + $this->estimateShipping($cartId); + $quote = $this->getQuote($cartId); + $this->assertEquals(40, $quote->getShippingAddress()->getFreeMethodWeight()); + } + /** * Estimate shipment for guest cart * * @param int $cartId - * @return \Magento\Quote\Api\Data\ShippingMethodInterface[] + * @return ShippingMethodInterface[] */ private function estimateShipping($cartId) { - $addressFactory = $this->objectManager->get(\Magento\Quote\Api\Data\AddressInterfaceFactory::class); - /** @var \Magento\Quote\Api\Data\AddressInterface $address */ + $addressFactory = $this->objectManager->get(AddressInterfaceFactory::class); + /** @var AddressInterface $address */ $address = $addressFactory->create(); $address->setCountryId('US'); $address->setRegionId(2); - /** @var \Magento\Quote\Api\GuestShipmentEstimationInterface $estimation */ - $estimation = $this->objectManager->get(\Magento\Quote\Api\GuestShipmentEstimationInterface::class); + /** @var GuestShipmentEstimationInterface $estimation */ + $estimation = $this->objectManager->get(GuestShipmentEstimationInterface::class); return $estimation->estimateByExtendedAddress($cartId, $address); } /** - * Create guest quote with products - * - * @param int $itemQty - * @return int + * @param string $cartMaskId + * @return CartInterface + * @throws NoSuchEntityException */ - private function prepareQuote($itemQty) + private function getQuote(string $cartMaskId): CartInterface { - $cartId = $this->cartManagement->createEmptyCart(); - - /** @var \Magento\Quote\Api\Data\CartItemInterfaceFactory $cartItemFactory */ - $cartItemFactory = $this->objectManager->get(\Magento\Quote\Api\Data\CartItemInterfaceFactory::class); - - /** @var \Magento\Quote\Api\Data\CartItemInterface $cartItem */ - $cartItem = $cartItemFactory->create(); - $cartItem->setQuoteId($cartId); - $cartItem->setQty($itemQty); - $cartItem->setSku('simple-99'); - $cartItem->setProductType(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE); + /** @var CartRepositoryInterface $cartRepository */ + $cartRepository = $this->objectManager->get(CartRepositoryInterface::class); + /** @var MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId */ + $maskedQuoteIdToQuoteId = $this->objectManager->get(MaskedQuoteIdToQuoteIdInterface::class); + $cartId = $maskedQuoteIdToQuoteId->execute($cartMaskId); + return $cartRepository->get($cartId); + } - $this->itemRepository->save($cartItem); + /** + * @param string $cartMaskId + * @param string $sku + * @param int $qty + * @throws NoSuchEntityException + */ + private function addToCart(string $cartMaskId, string $sku, int $qty): void + { + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + /** @var CartRepositoryInterface $cartRepository */ + $cartRepository = $this->objectManager->get(CartRepositoryInterface::class); + $product = $productRepository->get($sku); + $quote = $this->getQuote($cartMaskId); + $quote->addProduct($product, $qty); + $cartRepository->save($quote); + } - return $cartId; + /** + * @param string $sku + * @param int $qty + */ + public function setFreeShippingForProduct(string $sku, int $qty = 0): void + { + /** @var Registry $registry */ + $registry = $this->objectManager->get(Registry::class); + $salesRule = $registry->registry('cart_rule_free_shipping'); + $salesRule->setDiscountQty($qty); + $data = [ + 'actions' => [ + 1 => [ + 'type' => Combine::class, + 'attribute' => null, + 'operator' => null, + 'value' => '1', + 'is_value_processed' => null, + 'aggregator' => 'all', + 'actions' => [ + 1 => [ + 'type' => Product::class, + 'attribute' => 'sku', + 'operator' => '==', + 'value' => $sku, + 'is_value_processed' => false, + ] + ] + ] + ], + ]; + $salesRule->loadPost($data); + $salesRule->save(); } } diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php index eebf5ea638d05..5575b833607ad 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/Plugin/CouponUsagesTest.php @@ -72,7 +72,7 @@ protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); $this->usage = $this->objectManager->get(Usage::class); - $this->couponUsage = $this->objectManager->get(DataObject::class); + $this->couponUsage = $this->objectManager->create(DataObject::class); $this->quoteManagement = $this->objectManager->get(QuoteManagement::class); $this->orderService = $this->objectManager->get(OrderService::class); @@ -118,13 +118,11 @@ public function testSubmitQuoteAndCancelOrder() $couponCode = 'one_usage'; $reservedOrderId = 'test01'; - $this->publisherConsumerController->startConsumers(); - /** @var Coupon $coupon */ - $coupon = $this->objectManager->get(Coupon::class); + $coupon = $this->objectManager->create(Coupon::class); $coupon->loadByCode($couponCode); /** @var Quote $quote */ - $quote = $this->objectManager->get(Quote::class); + $quote = $this->objectManager->create(Quote::class); $quote->load($reservedOrderId, 'reserved_order_id'); // Make sure coupon usages value is incremented then order is placed. diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_40_percent_off_rollback.php b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_40_percent_off_rollback.php index c6e145842f291..964a6248c1c10 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_40_percent_off_rollback.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_40_percent_off_rollback.php @@ -3,13 +3,27 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + declare(strict_types=1); -/** @var Magento\Framework\Registry $registry */ -$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class); +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\SalesRule\Api\RuleRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$bootstrap = Bootstrap::getObjectManager(); + +/** @var Registry $registry */ +$registry = $bootstrap->get(Registry::class); + +/** @var RuleRepositoryInterface $ruleRepository */ +$ruleRepository = $bootstrap->get(RuleRepositoryInterface::class); -/** @var Magento\SalesRule\Model\Rule $rule */ -$rule = $registry->registry('cart_rule_40_percent_off'); -if ($rule) { - $rule->delete(); +$ruleId = $registry->registry('Magento/SalesRule/_files/cart_rule_40_percent_off'); +if ($ruleId) { + try { + $ruleRepository->deleteById($ruleId); + $registry->unregister('Magento/SalesRule/_files/cart_rule_40_percent_off'); + } catch (NoSuchEntityException $e) { + } } diff --git a/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_50_percent_off_rollback.php b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_50_percent_off_rollback.php index d694e9972ec73..65e148f2cdb21 100644 --- a/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_50_percent_off_rollback.php +++ b/dev/tests/integration/testsuite/Magento/SalesRule/_files/cart_rule_50_percent_off_rollback.php @@ -3,13 +3,27 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + declare(strict_types=1); -/** @var Magento\Framework\Registry $registry */ -$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class); +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\SalesRule\Api\RuleRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$bootstrap = Bootstrap::getObjectManager(); + +/** @var Registry $registry */ +$registry = $bootstrap->get(Registry::class); + +/** @var RuleRepositoryInterface $ruleRepository */ +$ruleRepository = $bootstrap->get(RuleRepositoryInterface::class); -/** @var Magento\SalesRule\Model\Rule $rule */ -$rule = $registry->registry('cart_rule_50_percent_off'); -if ($rule) { - $rule->delete(); +$ruleId = $registry->registry('Magento/SalesRule/_files/cart_rule_50_percent_off'); +if ($ruleId) { + try { + $ruleRepository->deleteById($ruleId); + $registry->unregister('Magento/SalesRule/_files/cart_rule_50_percent_off'); + } catch (NoSuchEntityException $e) { + } } diff --git a/dev/tests/integration/testsuite/Magento/Search/Model/SearchEngine/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Search/Model/SearchEngine/ConfigTest.php index 20490bf0e70ec..84434e4e7c1b5 100644 --- a/dev/tests/integration/testsuite/Magento/Search/Model/SearchEngine/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Search/Model/SearchEngine/ConfigTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Search\Model\SearchEngine; +use PHPUnit\Framework\MockObject\MockObject; + /** * Class ConfigTest * @@ -12,6 +14,14 @@ */ class ConfigTest extends \PHPUnit\Framework\TestCase { + /** + * @var \Magento\Search\Model\SearchEngine\Config|MockObject + */ + private $config; + + /** + * @inheritDoc + */ protected function setUp(): void { $xmlPath = __DIR__ . '/../../_files/search_engine.xml'; diff --git a/dev/tests/integration/testsuite/Magento/Shipping/Block/Adminhtml/Order/AddToPackageTest.php b/dev/tests/integration/testsuite/Magento/Shipping/Block/Adminhtml/Order/AddToPackageTest.php index fbbc6ef25cc09..ebda955569e52 100644 --- a/dev/tests/integration/testsuite/Magento/Shipping/Block/Adminhtml/Order/AddToPackageTest.php +++ b/dev/tests/integration/testsuite/Magento/Shipping/Block/Adminhtml/Order/AddToPackageTest.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Shipping\Block\Adminhtml\Order; use Magento\Backend\Block\Template; @@ -28,12 +30,19 @@ class AddToPackageTest extends TestCase */ private $orderRepository; - /** @var ObjectManagerInterface */ + /** + * @var ObjectManagerInterface + */ private $objectManager; - /** @var Registry */ + /** + * @var Registry + */ private $registry; + /** + * @inheritDoc + */ protected function setUp(): void { $this->objectManager = Bootstrap::getObjectManager(); @@ -42,30 +51,45 @@ protected function setUp(): void } /** - * Loads order entity by provided order increment ID. + * Test that Packaging popup renders * - * @param string $incrementId - * @return OrderInterface + * @magentoDataFixture Magento/Shipping/_files/shipping_with_carrier_data.php */ - private function getOrderByIncrementId(string $incrementId) : OrderInterface + public function testGetCommentsHtml(): void { - /** @var SearchCriteria $searchCriteria */ - $searchCriteria = $this->objectManager->get(SearchCriteriaBuilder::class) - ->addFilter('increment_id', $incrementId) - ->create(); - - $items = $this->orderRepository->getList($searchCriteria) - ->getItems(); + $expectedNeedle = "packaging.setItemQtyCallback(function(itemId){ + var item = $$('[name=\"shipment[items]['+itemId+']\"]')[0], + itemTitle = $('order_item_' + itemId + '_title'); + if (!itemTitle && !item) { + return 0; + } + if (item && !isNaN(item.value)) { + return item.value; + } + });"; + $this->assertStringContainsString($expectedNeedle, $this->getHtml()); + } - return array_pop($items); + /** + * Verify currency code on custom value field + * + * @magentoDataFixture Magento/Shipping/_files/shipping_with_carrier_data_different_currency_code.php + */ + public function testGetCurrencyCodeCustomValue () + { + $template = '/<span class="customs-value-currency">\s*?(?<currency>[A-Za-z]+)\s*?<\/span>/'; + $matches = []; + preg_match($template, $this->getHtml(), $matches); + $currency = $matches['currency'] ?? null; + $this->assertEquals('FR',$currency ); } /** - * Test that Packaging popup renders + * Get html for packaging popup * - * @magentoDataFixture Magento/Shipping/_files/shipping_with_carrier_data.php + * @return string */ - public function testGetCommentsHtml() + private function getHtml() { /** @var Template $block */ $block = $this->objectManager->get(Packaging::class); @@ -78,17 +102,26 @@ public function testGetCommentsHtml() $this->registry->register('current_shipment', $shipment); $block->setTemplate('Magento_Shipping::order/packaging/popup.phtml'); - $html = $block->toHtml(); - $expectedNeedle = "packaging.setItemQtyCallback(function(itemId){ - var item = $$('[name=\"shipment[items]['+itemId+']\"]')[0], - itemTitle = $('order_item_' + itemId + '_title'); - if (!itemTitle && !item) { - return 0; - } - if (item && !isNaN(item.value)) { - return item.value; - } - });"; - $this->assertStringContainsString($expectedNeedle, $html); + + return $block->toHtml(); + } + + /** + * Loads order entity by provided order increment ID. + * + * @param string $incrementId + * @return OrderInterface + */ + private function getOrderByIncrementId(string $incrementId) : OrderInterface + { + /** @var SearchCriteria $searchCriteria */ + $searchCriteria = $this->objectManager->get(SearchCriteriaBuilder::class) + ->addFilter('increment_id', $incrementId) + ->create(); + + $items = $this->orderRepository->getList($searchCriteria) + ->getItems(); + + return array_pop($items); } } diff --git a/dev/tests/integration/testsuite/Magento/Shipping/_files/shipping_with_carrier_data_different_currency_code.php b/dev/tests/integration/testsuite/Magento/Shipping/_files/shipping_with_carrier_data_different_currency_code.php new file mode 100644 index 0000000000000..ac54274ba0262 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Shipping/_files/shipping_with_carrier_data_different_currency_code.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Sales\Api\Data\OrderInterfaceFactory; +use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\ShipmentFactory; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; +use Magento\Framework\DB\Transaction; + +Resolver::getInstance()->requireDataFixture('Magento/Sales/_files/order_with_customer.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var Transaction $transaction */ +$transaction = $objectManager->get(Transaction::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$product = $productRepository->get('simple'); +/** @var Order $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000001'); +$order->setShippingDescription('UPS Next Day Air') + ->setShippingMethod('ups_11') + ->setOrderCurrencyCode('FR') + ->setShippingAmount(0) + ->setCouponCode('1234567890') + ->setDiscountDescription('1234567890'); + +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->create(OrderRepositoryInterface::class); +$orderRepository->save($order); + +$shipmentItems = []; +foreach ($order->getItems() as $orderItem) { + $shipmentItems[$orderItem->getId()] = $orderItem->getQtyOrdered(); +} +$tracking = [ + 'carrier_code' => 'ups', + 'title' => 'United Parcel Service', + 'number' => '987654321', +]; + +$shipment = $objectManager->get(ShipmentFactory::class)->create($order, $shipmentItems, [$tracking]); +$shipment->register(); +$transaction->addObject($shipment)->addObject($order)->save(); diff --git a/dev/tests/integration/testsuite/Magento/Shipping/_files/shipping_with_carrier_data_different_currency_code_rollback.php b/dev/tests/integration/testsuite/Magento/Shipping/_files/shipping_with_carrier_data_different_currency_code_rollback.php new file mode 100644 index 0000000000000..bbb90e0326aec --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Shipping/_files/shipping_with_carrier_data_different_currency_code_rollback.php @@ -0,0 +1,9 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Sales/_files/order_with_customer_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Store/App/Request/PathInfoProcessorTest.php b/dev/tests/integration/testsuite/Magento/Store/App/Request/PathInfoProcessorTest.php index be3675a9fb53c..a58cc15b51500 100644 --- a/dev/tests/integration/testsuite/Magento/Store/App/Request/PathInfoProcessorTest.php +++ b/dev/tests/integration/testsuite/Magento/Store/App/Request/PathInfoProcessorTest.php @@ -5,110 +5,72 @@ */ namespace Magento\Store\App\Request; -use \Magento\TestFramework\Helper\Bootstrap; -use \Magento\Store\Model\ScopeInterface; -use \Magento\Store\Model\Store; +use Magento\Framework\App\RequestInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; -class PathInfoProcessorTest extends \PHPUnit\Framework\TestCase +class PathInfoProcessorTest extends TestCase { /** - * @var \Magento\Store\App\Request\PathInfoProcessor + * @var PathInfoProcessor */ private $pathProcessor; protected function setUp(): void { - $this->pathProcessor = Bootstrap::getObjectManager()->create( - \Magento\Store\App\Request\PathInfoProcessor::class - ); + $this->pathProcessor = Bootstrap::getObjectManager()->create(PathInfoProcessor::class); } /** * @covers \Magento\Store\App\Request\PathInfoProcessor::process + * @magentoConfigFixture web/url/use_store 1 * @dataProvider notValidStoreCodeDataProvider + * @param string $pathInfo */ - public function testProcessNotValidStoreCode($pathInfo) + public function testProcessNotValidStoreCode(string $pathInfo) { - /** @var \Magento\Framework\App\RequestInterface $request */ - $request = Bootstrap::getObjectManager()->create(\Magento\Framework\App\RequestInterface::class); - /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */ - $config = Bootstrap::getObjectManager()->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class); - $config->setValue(Store::XML_PATH_STORE_IN_URL, true); + $request = Bootstrap::getObjectManager()->create(RequestInterface::class); $info = $this->pathProcessor->process($request, $pathInfo); $this->assertEquals($pathInfo, $info); } - public function notValidStoreCodeDataProvider() + public function notValidStoreCodeDataProvider(): array { return [ - ['not_valid_store_code_int' => '/100500/m/c/a'], - ['not_valid_store_code_str' => '/test_string/m/c/a'], + ['default store id' => '/0/m/c/a'], + ['main store id' => '/1/m/c/a'], + ['nonexistent store code' => '/test_string/m/c/a'], + ['admin store code' => '/admin/m/c/a'], + ['empty path' => '/'], ]; } /** * @covers \Magento\Store\App\Request\PathInfoProcessor::process * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - */ - public function testProcessValidStoreDisabledStoreUrl() - { - /** @var \Magento\Store\Model\Store $store */ - $store = Bootstrap::getObjectManager()->get(\Magento\Store\Model\Store::class); - $store->load('fixturestore', 'code'); - - /** @var \Magento\Framework\App\RequestInterface $request */ - $request = Bootstrap::getObjectManager()->create(\Magento\Framework\App\RequestInterface::class); - - /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */ - $config = Bootstrap::getObjectManager()->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class); - $config->setValue(Store::XML_PATH_STORE_IN_URL, true); - $config->setValue(Store::XML_PATH_STORE_IN_URL, false, ScopeInterface::SCOPE_STORE, $store->getCode()); - $pathInfo = sprintf('/%s/m/c/a', $store->getCode()); - $this->assertEquals($pathInfo, $this->pathProcessor->process($request, $pathInfo)); - } - - /** - * @covers \Magento\Store\App\Request\PathInfoProcessor::process - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoConfigFixture web/url/use_store 1 */ public function testProcessValidStoreCodeCaseProcessStoreName() { - /** @var \Magento\Store\Model\Store $store */ - $store = Bootstrap::getObjectManager()->get(\Magento\Store\Model\Store::class); - $store->load('fixturestore', 'code'); - - /** @var \Magento\Framework\App\RequestInterface $request */ - $request = Bootstrap::getObjectManager()->create(\Magento\Framework\App\RequestInterface::class); - - /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */ - $config = Bootstrap::getObjectManager()->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class); - $config->setValue(Store::XML_PATH_STORE_IN_URL, true); - $config->setValue(Store::XML_PATH_STORE_IN_URL, true, ScopeInterface::SCOPE_STORE, $store->getCode()); - $pathInfo = sprintf('/%s/m/c/a', $store->getCode()); + $storeCode = 'fixturestore'; + $request = Bootstrap::getObjectManager()->create(RequestInterface::class); + $pathInfo = sprintf('/%s/m/c/a', $storeCode); $this->assertEquals('/m/c/a', $this->pathProcessor->process($request, $pathInfo)); } /** * @covers \Magento\Store\App\Request\PathInfoProcessor::process * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoConfigFixture web/url/use_store 1 */ public function testProcessValidStoreCodeWhenStoreIsDirectFrontNameWithFrontName() { - /** @var \Magento\Store\Model\Store $store */ - $store = Bootstrap::getObjectManager()->get(\Magento\Store\Model\Store::class); - $store->load('fixturestore', 'code'); - - /** @var \Magento\Framework\App\RequestInterface $request */ + $storeCode = 'fixturestore'; $request = Bootstrap::getObjectManager()->create( - \Magento\Framework\App\RequestInterface::class, - ['directFrontNames' => [$store->getCode() => true]] + RequestInterface::class, + ['directFrontNames' => [$storeCode => true]] ); - - /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */ - $config = Bootstrap::getObjectManager()->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class); - $config->setValue(Store::XML_PATH_STORE_IN_URL, true); - $config->setValue(Store::XML_PATH_STORE_IN_URL, true, ScopeInterface::SCOPE_STORE, $store->getCode()); - $pathInfo = sprintf('/%s/m/c/a', $store->getCode()); + $pathInfo = sprintf('/%s/m/c/a', $storeCode); $this->assertEquals($pathInfo, $this->pathProcessor->process($request, $pathInfo)); $this->assertEquals(\Magento\Framework\App\Router\Base::NO_ROUTE, $request->getActionName()); } @@ -116,66 +78,13 @@ public function testProcessValidStoreCodeWhenStoreIsDirectFrontNameWithFrontName /** * @covers \Magento\Store\App\Request\PathInfoProcessor::process * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - */ - public function testProcessValidStoreCodeWhenStoreCodeInUrlIsDisabledWithFrontName() - { - /** @var \Magento\Store\Model\Store $store */ - $store = Bootstrap::getObjectManager()->get(\Magento\Store\Model\Store::class); - $store->load('fixturestore', 'code'); - - /** @var \Magento\Framework\App\RequestInterface $request */ - $request = Bootstrap::getObjectManager()->create( - \Magento\Framework\App\RequestInterface::class, - ['directFrontNames' => ['someFrontName' => true]] - ); - - /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */ - $config = Bootstrap::getObjectManager()->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class); - $config->setValue(Store::XML_PATH_STORE_IN_URL, true); - $config->setValue(Store::XML_PATH_STORE_IN_URL, false, ScopeInterface::SCOPE_STORE, $store->getCode()); - $pathInfo = sprintf('/%s/m/c/a', $store->getCode()); - $this->assertEquals($pathInfo, $this->pathProcessor->process($request, $pathInfo)); - } - - /** - * @covers \Magento\Store\App\Request\PathInfoProcessor::process - * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - */ - public function testProcessValidStoreCodeWhenStoreCodeisAdmin() - { - /** @var \Magento\Store\Model\Store $store */ - $store = Bootstrap::getObjectManager()->get(\Magento\Store\Model\Store::class); - $store->load('fixturestore', 'code'); - - /** @var \Magento\Framework\App\RequestInterface $request */ - $request = Bootstrap::getObjectManager()->create( - \Magento\Framework\App\RequestInterface::class, - ['directFrontNames' => ['someFrontName' => true]] - ); - - /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */ - $config = Bootstrap::getObjectManager()->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class); - $config->setValue(Store::XML_PATH_STORE_IN_URL, true); - $config->setValue(Store::XML_PATH_STORE_IN_URL, false, ScopeInterface::SCOPE_STORE, $store->getCode()); - $pathInfo = sprintf('/%s/m/c/a', 'admin'); - $this->assertEquals($pathInfo, $this->pathProcessor->process($request, $pathInfo)); - } - - /** - * @covers \Magento\Store\App\Request\PathInfoProcessor::process + * @magentoConfigFixture web/url/use_store 0 */ public function testProcessValidStoreCodeWhenUrlConfigIsDisabled() { - /** @var \Magento\Framework\App\RequestInterface $request */ - $request = Bootstrap::getObjectManager()->create( - \Magento\Framework\App\RequestInterface::class, - ['directFrontNames' => ['someFrontName' => true]] - ); - - /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */ - $config = Bootstrap::getObjectManager()->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class); - $config->setValue(Store::XML_PATH_STORE_IN_URL, false); - $pathInfo = sprintf('/%s/m/c/a', 'whatever'); + $storeCode = 'fixturestore'; + $request = Bootstrap::getObjectManager()->create(RequestInterface::class); + $pathInfo = sprintf('/%s/m/c/a', $storeCode); $this->assertEquals($pathInfo, $this->pathProcessor->process($request, $pathInfo)); $this->assertNull($request->getActionName()); } diff --git a/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php b/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php index c20b0ed27bf52..4c37c03618897 100644 --- a/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php +++ b/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php @@ -12,10 +12,12 @@ class StoreResolverTest extends \PHPUnit\Framework\TestCase /** @var \Magento\TestFramework\ObjectManager */ private $objectManager; + /** + * @inheritDoc + */ protected function setUp(): void { $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->block = $this->objectManager->get(\Magento\Directory\Block\Data::class); } public function testGetStoreData() diff --git a/dev/tests/integration/testsuite/Magento/Store/Model/Validation/StoreValidatorTest.php b/dev/tests/integration/testsuite/Magento/Store/Model/Validation/StoreValidatorTest.php new file mode 100644 index 0000000000000..f707ac8cd14c4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Store/Model/Validation/StoreValidatorTest.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\Model\Validation; + +use Magento\Store\Model\Store; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +class StoreValidatorTest extends TestCase +{ + /** + * @var StoreValidator + */ + private $storeValidator; + + protected function setUp(): void + { + $this->storeValidator = Bootstrap::getObjectManager()->create(StoreValidator::class); + } + + /** + * @dataProvider isValidDataProvider + * @param Store $store + * @param bool $isValid + */ + public function testIsValid(Store $store, bool $isValid): void + { + $result = $this->storeValidator->isValid($store); + $this->assertEquals($isValid, $result); + } + + public function isValidDataProvider(): array + { + $validStore = Bootstrap::getObjectManager()->create(Store::class); + $validStore->setName('name'); + $validStore->setCode('code'); + $emptyStore = Bootstrap::getObjectManager()->create(Store::class); + $storeWithEmptyName = Bootstrap::getObjectManager()->create(Store::class); + $storeWithEmptyName->setCode('code'); + $storeWithEmptyCode = Bootstrap::getObjectManager()->create(Store::class); + $storeWithEmptyCode->setName('name'); + $storeWithInvalidCode = Bootstrap::getObjectManager()->create(Store::class); + $storeWithInvalidCode->setName('name'); + $storeWithInvalidCode->setCode('5'); + + return [ + [$validStore, true], + [$emptyStore, false], + [$storeWithEmptyName, false], + [$storeWithEmptyCode, false], + [$storeWithInvalidCode, false], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_four_stores_divided_in_groups.php b/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_four_stores_divided_in_groups.php index 56507bcdd6287..a3d38c896067d 100644 --- a/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_four_stores_divided_in_groups.php +++ b/dev/tests/integration/testsuite/Magento/Store/_files/second_website_with_four_stores_divided_in_groups.php @@ -37,6 +37,22 @@ /* Refresh stores memory cache */ $storeManager->reinitStores(); +$store = $objectManager->create(Store::class); +if (!$store->load('fixture_second_store', 'code')->getId()) { + $store->setGroupId( + $storeGroup->getId() + ); + $store->save(); +} + +$store = $objectManager->create(Store::class); +if (!$store->load('fixture_third_store', 'code')->getId()) { + $store->setGroupId( + $storeGroup->getId() + ); + $store->save(); +} + $store = $objectManager->create(Store::class); if (!$store->load('fixture_fourth_store', 'code')->getId()) { $store->setCode( diff --git a/dev/tests/integration/testsuite/Magento/Swatches/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/Swatches/Helper/DataTest.php index 2e9ea5aba536c..c91155ce15fa5 100644 --- a/dev/tests/integration/testsuite/Magento/Swatches/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/Swatches/Helper/DataTest.php @@ -44,6 +44,7 @@ protected function setUp(): void /** * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * * @return void */ public function testGetSwatchAttributesAsArray(): void @@ -51,4 +52,15 @@ public function testGetSwatchAttributesAsArray(): void $product = $this->productRepository->get('simple2'); $this->assertEmpty($this->helper->getSwatchAttributesAsArray($product)); } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_with_disabled_image.php + * + * @return void + */ + public function testGetProductMediaGalleryWithHiddenImage(): void + { + $result = $this->helper->getProductMediaGallery($this->productRepository->get('simple_with_disabled_img')); + $this->assertEmpty($result); + } } diff --git a/dev/tests/integration/testsuite/Magento/Swatches/Model/Plugin/EavAttributeTest.php b/dev/tests/integration/testsuite/Magento/Swatches/Model/Plugin/EavAttributeTest.php new file mode 100644 index 0000000000000..57c44ba2e48fc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Swatches/Model/Plugin/EavAttributeTest.php @@ -0,0 +1,122 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Swatches\Model\Plugin; + +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; +use Magento\Framework\ObjectManagerInterface; +use Magento\Swatches\Model\ResourceModel\Swatch as SwatchResource; +use Magento\Swatches\Model\Swatch; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Interception\PluginList; +use PHPUnit\Framework\TestCase; + +/** + * Checks swatches attribute save behaviour + * + * @see \Magento\Swatches\Model\Plugin\EavAttribute + * + * @magentoAppArea adminhtml + * @magentoDbIsolation disabled + */ +class EavAttributeTest extends TestCase +{ + /** @var ObjectManagerInterface */ + private $objectManager; + + /** @var ProductAttributeRepositoryInterface */ + private $productAttributeRepository; + + /** @var SwatchResource */ + private $swatchResource; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->productAttributeRepository = $this->objectManager->get(ProductAttributeRepositoryInterface::class); + $this->swatchResource = $this->objectManager->get(SwatchResource::class); + } + + /** + * @return void + */ + public function testEavAttributePluginIsRegistered(): void + { + $pluginInfo = $this->objectManager->get(PluginList::class)->get(Attribute::class); + $this->assertSame(EavAttribute::class, $pluginInfo['save_swatches_option_params']['instance']); + } + + /** + * @magentoDataFixture Magento/Swatches/_files/text_swatch_attribute.php + * + * @return void + */ + public function testChangeAttributeToDropdown(): void + { + $attribute = $this->productAttributeRepository->get('test_configurable'); + $options = $attribute->getOptions(); + unset($options[0]); + $optionsIds = $this->collectOptionsIds($options); + $attribute->addData($this->prepareOptions($options)); + $attribute->setData(Swatch::SWATCH_INPUT_TYPE_KEY, Swatch::SWATCH_INPUT_TYPE_DROPDOWN); + $attribute->beforeSave(); + $this->assertEmpty($this->fetchSwatchOptions($optionsIds), 'Swatch options were not deleted'); + } + + /** + * Prepare options + * + * @param array $options + * @return array + */ + private function prepareOptions(array $options): array + { + foreach ($options as $key => $option) { + $preparedOptions['option']['order'][$option->getValue()] = $key; + $preparedOptions['option']['value'][$option->getValue()] = [$option->getLabel()]; + $preparedOptions['option']['delete'][$option->getValue()] = ''; + } + + return $preparedOptions ?? []; + } + + /** + * Collect options ids + * + * @param array $options + * @return array + */ + private function collectOptionsIds(array $options): array + { + foreach ($options as $option) { + $optionsIds[] = $option->getValue(); + } + + return $optionsIds ?? []; + } + + /** + * Fetch related to provided ids records from eav_attribute_option_swatch table + * + * @param $optionsIds + * @return array + */ + private function fetchSwatchOptions(array $optionsIds): array + { + $connection = $this->swatchResource->getConnection(); + $select = $connection->select()->from(['main_table' => $this->swatchResource->getMainTable()]) + ->where('main_table.option_id IN (?)', $optionsIds); + + return $connection->fetchAll($select); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type.php b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type.php index 77b3e198bd5ab..8d2b427d7f7f3 100644 --- a/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type.php +++ b/dev/tests/integration/testsuite/Magento/Swatches/_files/visual_swatch_attribute_with_different_options_type.php @@ -30,7 +30,7 @@ 'image-height' => 90, 'image-name' => $imageName, ]); -$imagePath = $swatchesMedia->moveImageFromTmp($imageName); +$imagePath = substr($swatchesMedia->moveImageFromTmp($imageName), 1); $swatchesMedia->generateSwatchVariations($imagePath); // Add attribute data diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/DatabaseTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/DatabaseTest.php index bdf32c05ccedc..9452d2ea5be67 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/DatabaseTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/DatabaseTest.php @@ -24,6 +24,8 @@ public function testDuplicateKeys() $command = $checkerPath . ' -d ' . $db->getSchema() . ' h=' . $db->getHost()['db-host'] . ',u=' . $db->getUser() . ',p=' . $db->getPassword(); + // exec() have to be here since this is test. + // phpcs:ignore Magento2.Security.InsecureFunction exec($command, $output, $exitCode); $this->assertEquals(0, $exitCode); $output = implode(PHP_EOL, $output); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Block/Html/Header/LogoTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/Header/LogoTest.php new file mode 100644 index 0000000000000..331fa082afd15 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/Header/LogoTest.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Theme\Block\Html\Header; + +use Magento\Framework\View\LayoutInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Helper\Xpath; +use Magento\Theme\ViewModel\Block\Html\Header\LogoSizeResolver; +use PHPUnit\Framework\TestCase; + +/** + * Test logo page header block + */ +class LogoTest extends TestCase +{ + /** + * @var Logo + */ + private $block; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + parent::setUp(); + $objectManager = Bootstrap::getObjectManager(); + $logoSizeResolver = $objectManager->get(LogoSizeResolver::class); + $this->block = $objectManager->create(LayoutInterface::class) + ->createBlock( + Logo::class, + 'logo', + [ + 'data' => [ + 'logo_size_resolver' => $logoSizeResolver + ] + ] + ); + } + + /** + * @magentoAppArea frontend + * @magentoConfigFixture current_store design/header/logo_width 260 + * @magentoConfigFixture current_store design/header/logo_height 240 + */ + public function testStoreLogoSize() + { + $xpath = '//a[@class="logo"]/img'; + $elements = Xpath::getElementsForXpath($xpath, $this->block->toHtml()); + $this->assertGreaterThan(0, $elements->count(), 'Cannot find element \'' . $xpath . '"\' in the HTML'); + $this->assertEquals(260, $elements->item(0)->getAttribute('width')); + $this->assertEquals(240, $elements->item(0)->getAttribute('height')); + } +} diff --git a/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/Adminhtml/SaveRewriteTest.php b/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/Adminhtml/SaveRewriteTest.php new file mode 100644 index 0000000000000..e483058e2771c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/UrlRewrite/Controller/Adminhtml/SaveRewriteTest.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\UrlRewrite\Controller\Adminhtml; + +use Magento\Framework\App\Request\Http as HttpRequest; + +/** + * @magentoAppArea adminhtml + */ +class SaveRewriteTest extends \Magento\TestFramework\TestCase\AbstractBackendController +{ + /** + * Test create url rewrite with invalid target path + * + * @return void + */ + public function testSaveRewriteWithInvalidRequestPath() : void + { + $requestPath = 'admin'; + $reservedWords = 'admin, soap, rest, graphql, standard'; + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setPostValue( + [ + 'description' => 'Some URL rewrite description', + 'options' => 'R', + 'request_path' => 'admin', + 'target_path' => "target_path", + 'store_id' => 1, + ] + ); + $this->dispatch('backend/admin/url_rewrite/save'); + + $this->assertSessionMessages( + $this->containsEqual(__(sprintf( + 'URL key "%s" matches a reserved endpoint name (%s). Use another URL key.', + $requestPath, + $reservedWords + ))), + \Magento\Framework\Message\MessageInterface::TYPE_ERROR + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/User/CollectionTest.php b/dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/User/CollectionTest.php new file mode 100644 index 0000000000000..07effaef60eab --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/User/Model/ResourceModel/User/CollectionTest.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\User\Model\ResourceModel\User; + +/** + * User collection test + * @magentoAppArea adminhtml + */ +class CollectionTest extends \PHPUnit\Framework\TestCase +{ + /** + * @var \Magento\User\Model\ResourceModel\User\Collection + */ + protected $_collection; + + protected function setUp(): void + { + $this->_collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\User\Model\ResourceModel\User\Collection::class + ); + } + + public function testFilteringCollectionByUserId() + { + $this->assertEquals(1, $this->_collection->addFieldToFilter('user_id', 1)->count()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php b/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php index e20c4a4b60e62..f1e62f4a7fef0 100644 --- a/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php +++ b/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php @@ -373,9 +373,6 @@ public function testBeforeSaveRequiredFieldsValidation() */ public function testBeforeSavePasswordHash() { - $pattern = $this->encryptor->getLatestHashVersion() === Encryptor::HASH_VERSION_ARGON2ID13 ? - '/^[0-9a-f]+:[0-9a-zA-Z]{16}:[0-9]+$/' : - '/^[0-9a-f]+:[0-9a-zA-Z]{32}:[0-9]+$/'; $this->_model->setUsername( 'john.doe' )->setFirstname( @@ -394,7 +391,7 @@ public function testBeforeSavePasswordHash() 'Password is expected to be hashed' ); $this->assertMatchesRegularExpression( - $pattern, + '/^[^\:]+\:[^\:]+\:/i', $this->_model->getPassword(), 'Salt is expected to be saved along with the password' ); @@ -591,7 +588,9 @@ public function testSendNotificationEmailsIfRequired() ->get(MutableScopeConfigInterface::class); $config->setValue( 'admin/emails/new_user_notification_template', - $this->getCustomEmailTemplateIdForNewUserNotification() + $this->getCustomEmailTemplateId( + 'admin_emails_new_user_notification_template' + ) ); $userModel = Bootstrap::getObjectManager() ->create(User::class); @@ -619,17 +618,17 @@ public function testSendNotificationEmailsIfRequired() } /** - * Return email template id for new user notification + * Return email template id by origin template code * + * @param string $origTemplateCode * @return int|null * @throws NotFoundException */ - private function getCustomEmailTemplateIdForNewUserNotification(): ?int + private function getCustomEmailTemplateId(string $origTemplateCode): ?int { $templateId = null; $templateCollection = Bootstrap::getObjectManager() - ->get(TemplateCollection::class); - $origTemplateCode = 'admin_emails_new_user_notification_template'; + ->create(TemplateCollection::class); foreach ($templateCollection as $template) { if ($template->getOrigTemplateCode() == $origTemplateCode) { $templateId = (int) $template->getId(); @@ -643,4 +642,33 @@ private function getCustomEmailTemplateIdForNewUserNotification(): ?int } return $templateId; } + + /** + * Verify custom notification is correctly when reset admin password + * + * @magentoDataFixture Magento/Email/Model/_files/email_template_reset_password_user_notification.php + * @magentoDataFixture Magento/User/_files/user_with_role.php + */ + public function testNotificationEmailsIfResetPassword() + { + /** @var MutableScopeConfigInterface $config */ + $config = Bootstrap::getObjectManager() + ->get(MutableScopeConfigInterface::class); + $config->setValue( + 'admin/emails/forgot_email_template', + $this->getCustomEmailTemplateId( + 'admin_emails_forgot_email_template' + ) + ); + $userModel = $this->_model->loadByUsername('adminUser'); + $notificator = $this->objectManager->get(\Magento\User\Model\Spi\NotificatorInterface::class); + $notificator->sendForgotPassword($userModel); + /** @var TransportBuilderMock $transportBuilderMock */ + $transportBuilderMock = $this->objectManager->get(TransportBuilderMock::class); + $sentMessage = $transportBuilderMock->getSentMessage(); + $this->assertStringContainsString( + 'id='.$userModel->getId(), + quoted_printable_decode($sentMessage->getBodyText()) + ); + } } diff --git a/dev/tests/integration/testsuite/Magento/User/_files/user_with_role_rollback.php b/dev/tests/integration/testsuite/Magento/User/_files/user_with_role_rollback.php new file mode 100644 index 0000000000000..5795c7b92ed12 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/User/_files/user_with_role_rollback.php @@ -0,0 +1,16 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Helper\Bootstrap; +use Magento\User\Model\User; + +/** @var $model \Magento\User\Model\User */ +$model = Bootstrap::getObjectManager()->create(User::class); +$user = $model->loadByUsername('adminUser'); +if ($user->getId()) { + $model->delete(); +} diff --git a/dev/tests/integration/testsuite/Magento/Usps/Model/CarrierTest.php b/dev/tests/integration/testsuite/Magento/Usps/Model/CarrierTest.php index 011381cb5917d..2aa366c63aea5 100644 --- a/dev/tests/integration/testsuite/Magento/Usps/Model/CarrierTest.php +++ b/dev/tests/integration/testsuite/Magento/Usps/Model/CarrierTest.php @@ -7,21 +7,55 @@ namespace Magento\Usps\Model; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\HTTP\AsyncClient\HttpException; +use Magento\Framework\HTTP\AsyncClient\HttpResponseDeferredInterface; +use Magento\Framework\HTTP\AsyncClient\Request; use Magento\Framework\HTTP\AsyncClient\Response; use Magento\Framework\HTTP\AsyncClientInterface; +use Magento\Framework\Registry; +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\Quote\Api\Data\AddressInterface; +use Magento\Quote\Api\Data\AddressInterfaceFactory; +use Magento\Quote\Api\Data\ShippingMethodInterface; +use Magento\Quote\Api\GuestCartManagementInterface; +use Magento\Quote\Api\GuestCouponManagementInterface; +use Magento\Quote\Api\GuestShipmentEstimationInterface; +use Magento\Quote\Model\MaskedQuoteIdToQuoteIdInterface; use Magento\Quote\Model\Quote\Address\RateRequest; +use Magento\Quote\Model\Quote\Address\RateResult\Error; +use Magento\Quote\Model\QuoteFactory; +use Magento\Quote\Model\QuoteIdMask; +use Magento\Quote\Model\QuoteIdMaskFactory; +use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface; +use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; +use Magento\SalesRule\Model\Rule\Condition\Product; +use Magento\SalesRule\Model\Rule\Condition\Product\Combine; +use Magento\Shipping\Model\Simplexml\Element; +use Magento\Shipping\Model\Simplexml\ElementFactory; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\HTTP\AsyncClientInterfaceMock; +use Magento\TestFramework\ObjectManager; +use Magento\TestFramework\Quote\Model\GetQuoteByReservedOrderId; use PHPUnit\Framework\TestCase; -use Magento\Framework\HTTP\AsyncClient\HttpResponseDeferredInterface; -use Magento\Framework\HTTP\AsyncClient\HttpException; -use Magento\Quote\Model\Quote\Address\RateResult\Error; /** * Test for USPS integration. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CarrierTest extends TestCase { + private const RESERVED_ORDER_ID = 'usps_test_quote'; + private const FREE_SHIPPING_COUPON_CODE = 'IMPHBR852R61'; + private const PRODUCT_1 = 'simple-249'; + private const PRODUCT_2 = 'simple-156'; + + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + /** * @var Carrier */ @@ -32,13 +66,32 @@ class CarrierTest extends TestCase */ private $httpClient; + /** + * @var GuestCouponManagementInterface + */ + private $management; + + /** + * @var GetQuoteByReservedOrderId + */ + private $getQuoteByReservedOrderId; + + /** + * @var QuoteIdToMaskedQuoteIdInterface + */ + private $getMaskedIdByQuoteId; + /** * @inheritDoc */ protected function setUp(): void { - $this->carrier = Bootstrap::getObjectManager()->get(Carrier::class); - $this->httpClient = Bootstrap::getObjectManager()->get(AsyncClientInterface::class); + $this->objectManager = Bootstrap::getObjectManager(); + $this->carrier = $this->objectManager->get(Carrier::class); + $this->httpClient = $this->objectManager->get(AsyncClientInterface::class); + $this->management = $this->objectManager->get(GuestCouponManagementInterface::class); + $this->getQuoteByReservedOrderId = $this->objectManager->get(GetQuoteByReservedOrderId::class); + $this->getMaskedIdByQuoteId = $this->objectManager->get(QuoteIdToMaskedQuoteIdInterface::class); } /** @@ -247,4 +300,247 @@ public function testGetRatesWithHttpException(): void $this->assertEquals($error, $resultRate); } + + /** + * Test that the shipping cost from the product in the cart rule should be deducted from the shipping amount + * + * @magentoConfigFixture default_store carriers/usps/active 1 + * @magentoConfigFixture default_store carriers/usps/free_method 1 + * @magentoDataFixture Magento/Catalog/_files/products_list.php + * @magentoDataFixture Magento/Usps/Fixtures/cart_rule_coupon_free_shipping.php + * @magentoDataFixture setFreeShippingForProduct1 + * @magentoDataFixture createEmptyCart + * @magentoDataFixture addProduct1ToCart + * @magentoDataFixture addProduct2ToCart + * @return void + */ + public function testPartialFreeShippingWithCoupon(): void + { + $quote = $this->getQuoteByReservedOrderId->execute(self::RESERVED_ORDER_ID); + $cartId = $this->getMaskedIdByQuoteId->execute((int)$quote->getId()); + + //phpcs:disable + $this->httpClient->setDeferredResponseMock(null) + ->nextResponses( + [ + new Response(200, [], file_get_contents(__DIR__ . '/../Fixtures/success_usps_response_rates.xml')), + new Response(200, [], file_get_contents(__DIR__ . '/../Fixtures/rates_response.xml')) + ] + ); + //phpcs:enable + $requestsCount = count($this->httpClient->getRequests()); + $this->management->set($cartId, self::FREE_SHIPPING_COUPON_CODE); + $methods = $this->estimateShipping($cartId); + $freeMethods = $this->filterFreeShippingMethods($methods); + self::assertEmpty($freeMethods); + $requests = array_slice($this->httpClient->getRequests(), $requestsCount); + self::assertCount(2, $requests); + $firstRequest = $this->getXmlElement($this->getRequestBody($requests[0])); + $secondRequest = $this->getXmlElement($this->getRequestBody($requests[1])); + $this->assertEquals('ALL', $firstRequest->Package->Service); + $this->assertEquals('20', $firstRequest->Package->Pounds); + $this->assertEquals('Priority', $secondRequest->Package->Service); + $this->assertEquals('10', $secondRequest->Package->Pounds); + $price = $this->getShippingMethodAmount($methods, 'usps', '1'); + $this->assertEquals(6.70, $price); + } + + /** + * Get XML request body + * + * @param Request $request + * @return string + */ + private function getRequestBody(Request $request): string + { + //phpcs:disable + $url = $request->getUrl(); + $query = parse_url($url, PHP_URL_QUERY); + parse_str($query, $params); + //phpcs:enable + return urldecode($params['XML']); + } + + /** + * Create XML object for provided string + * + * @param string $xmlString + * @return Element + */ + private function getXmlElement(string $xmlString): Element + { + $xmlElementFactory = $this->objectManager->get(ElementFactory::class); + + return $xmlElementFactory->create( + ['data' => $xmlString] + ); + } + + /** + * Get shipping method amount by carrier code and method code + * + * @param array $methods + * @param string $carrierCode + * @param string $methodCode + * @return float|null + */ + private function getShippingMethodAmount(array $methods, string $carrierCode, string $methodCode): ?float + { + /** @var ShippingMethodInterface $method */ + foreach ($methods as $method) { + if ($method->getCarrierCode() === $carrierCode && (string)$method->getMethodCode() === $methodCode) { + return $method->getAmount(); + } + } + return null; + } + + /** + * Estimates shipment for guest cart. + * + * @param string $cartId + * @return array ShippingMethodInterface[] + */ + private function estimateShipping(string $cartId): array + { + $addressFactory = $this->objectManager->get(AddressInterfaceFactory::class); + /** @var AddressInterface $address */ + $address = $addressFactory->create(); + $address->setCountryId('US'); + $address->setRegionId(12); + $address->setPostcode(90230); + + /** @var GuestShipmentEstimationInterface $estimation */ + $estimation = $this->objectManager->get(GuestShipmentEstimationInterface::class); + return $estimation->estimateByExtendedAddress($cartId, $address); + } + + /** + * Filters free shipping methods. + * + * @param array $methods + * @return array + */ + private function filterFreeShippingMethods(array $methods): array + { + $result = []; + /** @var ShippingMethodInterface $method */ + foreach ($methods as $method) { + if ($method->getAmount() == 0) { + $result[] = $method->getMethodTitle(); + } + } + return $result; + } + + /** + * Add product to cart fixture helper + * + * @param string $sku + */ + private static function addToCart(string $sku): void + { + $objectManager = Bootstrap::getObjectManager(); + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $objectManager->get(ProductRepositoryInterface::class); + /** @var GetQuoteByReservedOrderId $getQuoteByReservedOrderId */ + $getQuoteByReservedOrderId = $objectManager->get(GetQuoteByReservedOrderId::class); + /** @var CartRepositoryInterface $cartRepository */ + $cartRepository = $objectManager->get(CartRepositoryInterface::class); + $product = $productRepository->get($sku); + $quote = $getQuoteByReservedOrderId->execute(self::RESERVED_ORDER_ID); + $quote->addProduct($product, 1); + $cartRepository->save($quote); + } + + /** + * Create empty cart fixture + */ + public static function createEmptyCart(): void + { + $objectManager = Bootstrap::getObjectManager(); + /** @var GuestCartManagementInterface $guestCartManagement */ + $guestCartManagement = $objectManager->get(GuestCartManagementInterface::class); + /** @var CartRepositoryInterface $cartRepository */ + $cartRepository = $objectManager->get(CartRepositoryInterface::class); + /** @var MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId */ + $maskedQuoteIdToQuoteId = $objectManager->get(MaskedQuoteIdToQuoteIdInterface::class); + $cartHash = $guestCartManagement->createEmptyCart(); + $cartId = $maskedQuoteIdToQuoteId->execute($cartHash); + $cart = $cartRepository->get($cartId); + $cart->setReservedOrderId(self::RESERVED_ORDER_ID); + $cartRepository->save($cart); + } + + /** + * Create empty cart fixture rollback + */ + public static function createEmptyCartRollback(): void + { + $objectManager = Bootstrap::getObjectManager(); + /** @var QuoteFactory $quoteFactory */ + $quoteFactory = Bootstrap::getObjectManager()->get(QuoteFactory::class); + /** @var QuoteResource $quoteResource */ + $quoteResource = $objectManager->get(QuoteResource::class); + /** @var QuoteIdMaskFactory $quoteIdMaskFactory */ + $quoteIdMaskFactory = $objectManager->get(QuoteIdMaskFactory::class); + $quote = $quoteFactory->create(); + $quoteResource->load($quote, self::RESERVED_ORDER_ID, 'reserved_order_id'); + $quoteResource->delete($quote); + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = $quoteIdMaskFactory->create(); + $quoteIdMask->setQuoteId($quote->getId()) + ->delete(); + } + + /** + * Set free shipping for product 2 fixture + */ + public static function setFreeShippingForProduct1(): void + { + /** @var ObjectManager $objectManager */ + $objectManager = Bootstrap::getObjectManager(); + /** @var Registry $registry */ + $registry = $objectManager->get(Registry::class); + $salesRule = $registry->registry('cart_rule_free_shipping'); + $data = [ + 'actions' => [ + 1 => [ + 'type' => Combine::class, + 'attribute' => null, + 'operator' => null, + 'value' => '1', + 'is_value_processed' => null, + 'aggregator' => 'all', + 'actions' => [ + 1 => [ + 'type' => Product::class, + 'attribute' => 'sku', + 'operator' => '==', + 'value' => self::PRODUCT_1, + 'is_value_processed' => false, + ] + ] + ] + ], + ]; + $salesRule->loadPost($data); + $salesRule->save(); + } + + /** + * Add product 2 to cart fixture + */ + public static function addProduct1ToCart(): void + { + static::addToCart(self::PRODUCT_1); + } + + /** + * Add product 3 to cart fixture + */ + public static function addProduct2ToCart(): void + { + static::addToCart(self::PRODUCT_2); + } } diff --git a/dev/tests/integration/testsuite/Magento/Weee/Plugin/Catalog/Ui/Component/Listing/ColumnsTest.php b/dev/tests/integration/testsuite/Magento/Weee/Plugin/Catalog/Ui/Component/Listing/ColumnsTest.php new file mode 100644 index 0000000000000..31746a7e381c0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Weee/Plugin/Catalog/Ui/Component/Listing/ColumnsTest.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Weee\Plugin\Catalog\Ui\Component\Listing; + +use Magento\Catalog\Ui\Component\Listing\Attribute\Repository; +use Magento\Catalog\Ui\Component\Listing\Columns; +use Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider; +use Magento\Framework\View\Element\UiComponent\ContextInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Class ColumnsTest + * Check if FPT attribute column in product grid won't be sortable + */ +class ColumnsTest extends TestCase +{ + /** + * @var Columns + */ + private $columns; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $objectManager = Bootstrap::getObjectManager(); + $attributeRepository = $objectManager->get(Repository::class); + $dataProvider = $objectManager->create( + ProductDataProvider::class, + [ + 'name' => "product_listing_data_source", + 'primaryFieldName' => "entity_id", + 'requestFieldName' => "id", + ] + ); + $context = $objectManager->create(ContextInterface::class); + $context->setDataProvider($dataProvider); + $this->columns = $objectManager->create( + Columns::class, + ['attributeRepository' => $attributeRepository, 'context' => $context] + ); + } + + /** + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Weee/_files/fixed_product_attribute.php + */ + public function testGetProductWeeeAttributesConfig() + { + $this->columns->prepare(); + $column = $this->columns->getComponent('fixed_product_attribute'); + $columnConfig = $column->getData('config'); + $this->assertArrayHasKey('sortable', $columnConfig); + $this->assertFalse($columnConfig['sortable']); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute.php b/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute.php index a74305d7db424..f75a10a07979f 100644 --- a/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute.php +++ b/dev/tests/integration/testsuite/Magento/Weee/_files/fixed_product_attribute.php @@ -6,6 +6,9 @@ declare(strict_types=1); +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; +Resolver::getInstance()->requireDataFixture('Magento/Weee/_files/fixed_product_attribute_rollback.php'); + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** @var \Magento\Eav\Model\Entity\Attribute\Set $attributeSet */ @@ -27,6 +30,7 @@ 'attribute_group_id' => $attributeGroupId, 'frontend_input' => 'weee', 'frontend_label' => 'fixed product tax', + 'is_used_in_grid' => '1', ]; /** @var \Magento\Catalog\Model\Entity\Attribute $attribute */ diff --git a/dev/tests/integration/testsuite/Magento/Widget/Controller/Adminhtml/Widget/InstanceTest.php b/dev/tests/integration/testsuite/Magento/Widget/Controller/Adminhtml/Widget/InstanceTest.php index 5d3d8b2a090c9..e83b50762836f 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Controller/Adminhtml/Widget/InstanceTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Controller/Adminhtml/Widget/InstanceTest.php @@ -54,6 +54,7 @@ public function testBlocksAction() public function testTemplateAction() { + $this->getRequest()->setMethod('POST'); $this->dispatch('backend/admin/widget_instance/template'); $this->assertStringStartsWith('<select name="template" id=""', $this->getResponse()->getBody()); } diff --git a/dev/tests/integration/testsuite/Magento/Widget/_files/cms_page_link_widget.php b/dev/tests/integration/testsuite/Magento/Widget/_files/cms_page_link_widget.php new file mode 100644 index 0000000000000..54ecd9f03e26c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Widget/_files/cms_page_link_widget.php @@ -0,0 +1,43 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\View\Design\ThemeInterfaceFactory; +use Magento\Framework\View\Design\ThemeInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Widget\Model\Widget\InstanceFactory; +use Magento\Widget\Model\Widget\Instance; + +$objectManager = Bootstrap::getObjectManager(); +/** @var InstanceFactory $widgetModelFactory */ +$widgetModelFactory = $objectManager->get(InstanceFactory::class); +/** @var Instance $widgetModel */ +$widgetModel = $widgetModelFactory->create(); + +/** @var ThemeInterfaceFactory $themeFactory */ +$themeFactory = $objectManager->get(ThemeInterfaceFactory::class); +/** @var ThemeInterface $theme */ +$theme = $themeFactory->create(); +$theme->load('Magento/luma', 'theme_path'); + +$widgetModel->setData( + [ + 'instance_type' => \Magento\Cms\Block\Widget\Page\Link::class, + 'theme_id' => $theme->getId(), + 'title' => 'Test Widget', + 'store_ids' => [ + 0 => '0', + ], + 'widget_parameters' => [ + 'block_id' => '2', + ], + 'sort_order' => '0', + 'page_groups' => [], + 'instance_code' => 'cms_page_link', + ] +); + +$widgetModel->save(); diff --git a/dev/tests/integration/testsuite/Magento/Widget/_files/cms_page_link_widget_rollback.php b/dev/tests/integration/testsuite/Magento/Widget/_files/cms_page_link_widget_rollback.php new file mode 100644 index 0000000000000..46cebd4eee8c9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Widget/_files/cms_page_link_widget_rollback.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Widget\Model\Widget\InstanceFactory; +use Magento\Widget\Model\Widget\Instance; + +$objectManager = Bootstrap::getObjectManager(); + +/** @var InstanceFactory $widgetModelFactory */ +$widgetModelFactory = $objectManager->get(InstanceFactory::class); +/** @var Instance $widgetModel */ +$widgetModel = $widgetModelFactory->create(); +$widgetModel->load('Test Widget', 'title'); + +if ($widgetModel->getId()) { + $widgetModel->delete(); +} diff --git a/dev/tests/integration/testsuite/Magento/Wishlist/Controller/Index/CartTest.php b/dev/tests/integration/testsuite/Magento/Wishlist/Controller/Index/CartTest.php index a7ab5115043f7..788dfb15894e0 100644 --- a/dev/tests/integration/testsuite/Magento/Wishlist/Controller/Index/CartTest.php +++ b/dev/tests/integration/testsuite/Magento/Wishlist/Controller/Index/CartTest.php @@ -7,6 +7,7 @@ namespace Magento\Wishlist\Controller\Index; +use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Checkout\Model\CartFactory; use Magento\Customer\Model\Session; use Magento\Framework\App\Request\Http as HttpRequest; @@ -35,6 +36,9 @@ class CartTest extends AbstractController /** @var Escaper */ private $escaper; + /** @var ProductRepositoryInterface */ + private $productRepository; + /** * @inheritdoc */ @@ -46,6 +50,7 @@ protected function setUp(): void $this->getWishlistByCustomerId = $this->_objectManager->get(GetWishlistByCustomerId::class); $this->cartFactory = $this->_objectManager->get(CartFactory::class); $this->escaper = $this->_objectManager->get(Escaper::class); + $this->productRepository = $this->_objectManager->get(ProductRepositoryInterface::class); } /** @@ -107,6 +112,38 @@ public function testAddNotExistingItemToCart(): void $this->assertRedirect($this->stringContains('wishlist/index/')); } + /** + * Add wishlist item with related Products to Cart. + * + * @return void + * @magentoDataFixture Magento/Wishlist/_files/wishlist_with_simple_product.php + * @magentoDataFixture Magento/Catalog/_files/products.php + */ + public function testAddItemWithRelatedProducts(): void + { + $firstProductId = $this->productRepository->get('simple')->getId(); + $secondProductID = $this->productRepository->get('custom-design-simple-product')->getId(); + $relatedIds = $expectedAddedIds = [$firstProductId, $secondProductID]; + + $this->customerSession->setCustomerId(1); + $item = $this->getWishlistByCustomerId->getItemBySku(1, 'simple-1'); + $this->assertNotNull($item); + + $this->performAddToCartRequest([ + 'item' => $item->getId(), + 'qty' => 1, + 'related_product' => implode(',', $relatedIds), + ]); + + $this->assertCount(0, $this->getWishlistByCustomerId->execute(1)->getItemCollection()); + $cart = $this->cartFactory->create(); + $this->assertEquals(3, $cart->getItemsCount()); + $expectedAddedIds[] = $item->getProductId(); + foreach ($expectedAddedIds as $addedId) { + $this->assertContains($addedId, $cart->getProductIds()); + } + } + /** * Perform request add to cart from wish list. * diff --git a/dev/tests/integration/testsuite/Magento/Wishlist/_files/wishlist_with_multiple_products.php b/dev/tests/integration/testsuite/Magento/Wishlist/_files/wishlist_with_multiple_products.php new file mode 100644 index 0000000000000..f1f08d0742d5c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Wishlist/_files/wishlist_with_multiple_products.php @@ -0,0 +1,35 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Customer\Model\CustomerRegistry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Wishlist\Model\WishlistFactory; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Customer/_files/customer.php'); +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/multiple_products.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var CustomerRegistry $customerRegistry */ +$customerRegistry = Bootstrap::getObjectManager()->create(CustomerRegistry::class); +$customer = $customerRegistry->retrieve(1); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); +$product = $productRepository->get('simple1'); +$product2 = $productRepository->get('simple2'); + +$wishlistFactory = $objectManager->get(WishlistFactory::class); +$wishlist = $wishlistFactory->create(); +$wishlist->loadByCustomerId($customer->getId(), true); +/** @var \Magento\Catalog\Helper\Product $productHelper */ +$productHelper = $objectManager->get(\Magento\Catalog\Helper\Product::class); +$isSkipSaleableCheck = $productHelper->getSkipSaleableCheck(); +$productHelper->setSkipSaleableCheck(true); +$wishlist->addNewItem($product); +$wishlist->addNewItem($product2); +$productHelper->setSkipSaleableCheck($isSkipSaleableCheck); diff --git a/dev/tests/integration/testsuite/Magento/Wishlist/_files/wishlist_with_multiple_products_rollback.php b/dev/tests/integration/testsuite/Magento/Wishlist/_files/wishlist_with_multiple_products_rollback.php new file mode 100644 index 0000000000000..2d13ac3637b6e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Wishlist/_files/wishlist_with_multiple_products_rollback.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Customer/_files/customer_rollback.php'); +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/multiple_products_rollback.php'); diff --git a/dev/tests/js/jasmine/assets/lib/web/mage/account_menu.html b/dev/tests/js/jasmine/assets/lib/web/mage/account_menu.html new file mode 100644 index 0000000000000..3e437a46d6ac2 --- /dev/null +++ b/dev/tests/js/jasmine/assets/lib/web/mage/account_menu.html @@ -0,0 +1,56 @@ +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<div class="panel header"> + <!-- This markup portion is the source for Mobile View Navigation Menu --> + <ul class="header links"> + <li class="greet welcome" data-bind="scope: 'customer'"> + <span class="logged-in">Welcome, John Doe!</span> + </li> + + <li class="customer-welcome active"> + <span class="customer-name active" role="button"> + <button type="button" class="action switch" data-action="customer-menu-toggle"> + <span>Change</span> + </button> + </span> + <!-- Markup portion for Logged in customer --> + <div class="customer-menu" data-target="dropdown" aria-hidden="false"> + <ul class="header links"> + <li> + <a href="http://magento.store/account/" id="my-account">My Account</a> + </li> + <li class="link wishlist" data-bind="scope: 'wishlist'"> + <a href="http://magento.store/wishlist/" id="my-wishlist">My WishList</a> + </li> + <li> + <a href="http://magento.store/orders/" id="my-orders">My Orders</a> + </li> + <li> + <a href="http://magento.store/addresses/" id="my-addresses">My Addresses</a> + </li> + <li class="link authorization-link" data-label="or"> + <a href="http://magento.store/customer/account/logout/">Sign Out</a> + </li> + </ul> + </div> + <li class="link authorization-link" data-label="or"> + <a href="http://magento.store/customer/account/logout/">Sign Out</a> + </li> + </li> + <!-- Markup portion for Logged out customer --> + <li class="link authorization-link" data-label="or"> + <a href="http://magento.store/customer/account/login/">Sign In</a> + </li> + <li> + <a href="http://magento.store/customer/account/create/" id="create-account">Create an Account</a> + </li> + </ul> +</div> + +<div id="store.links"> + <!-- Navigation Menu for Mobile View will be cloned here from the source --> +</div> diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/checkout-data-resolver.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/checkout-data-resolver.test.js new file mode 100644 index 0000000000000..6d76525199bed --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/checkout-data-resolver.test.js @@ -0,0 +1,96 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/*eslint-disable max-nested-callbacks*/ +/*jscs:disable jsDoc*/ +define([ + 'squire', + 'ko' +], function (Squire, ko) { + 'use strict'; + + describe('Magento_Checkout/js/model/checkout-data-resolver', function () { + var injector = new Squire(), + checkoutDataResolver = null, + checkoutData = null, + quote = null; + + beforeEach(function (done) { + var mocks = { + 'Magento_Customer/js/model/address-list': ko.observableArray(), + 'Magento_Checkout/js/model/quote': { + shippingAddress: ko.observable(null), + isVirtual: jasmine.createSpy().and.returnValue(false), + billingAddress: ko.observable(null), + shippingMethod: ko.observable(null) + }, + 'Magento_Checkout/js/checkout-data': { + getSelectedBillingAddress: jasmine.createSpy(), + getBillingAddressFromData: jasmine.createSpy(), + getNewCustomerBillingAddress: jasmine.createSpy(), + setBillingAddressFromData: jasmine.createSpy() + }, + 'Magento_Checkout/js/action/create-shipping-address': {}, + 'Magento_Checkout/js/action/select-shipping-address': {}, + 'Magento_Checkout/js/action/select-shipping-method': {}, + 'Magento_Checkout/js/model/payment-service': {}, + 'Magento_Checkout/js/action/select-payment-method': {} + }; + + injector.mock(mocks); + injector.require(['Magento_Checkout/js/model/checkout-data-resolver'], function (instance) { + checkoutDataResolver = instance; + quote = mocks['Magento_Checkout/js/model/quote']; + checkoutData = mocks['Magento_Checkout/js/checkout-data']; + done(); + }); + window.checkoutConfig = window.checkoutConfig || {}; + }); + + afterEach(function () { + try { + injector.clean(); + injector.remove(); + } catch (e) { + } + delete window.checkoutConfig.billingAddressFromData; + delete window.checkoutConfig.isBillingAddressFromDataValid; + }); + + describe('resolveBillingAddress()', function () { + describe( + 'billing address is resolved from checkoutConfig if it cannot be resolved from local storage', + function () { + it('billing address is selected if is valid', function () { + var billingAddressFromData = { + firstname: 'John', + lastname: 'Doe' + }; + + window.checkoutConfig.isBillingAddressFromDataValid = true; + window.checkoutConfig.billingAddressFromData = billingAddressFromData; + checkoutDataResolver.resolveBillingAddress(); + expect(checkoutData.setBillingAddressFromData).not.toHaveBeenCalledWith(); + expect(quote.billingAddress().firstname).toEqual(billingAddressFromData.firstname); + expect(quote.billingAddress().lastname).toEqual(billingAddressFromData.lastname); + }); + + it('billing address is not selected and form is prefilled if it is not valid.', function () { + var billingAddressFromData = { + firstname: 'John', + lastname: 'Doe' + }; + + window.checkoutConfig.isBillingAddressFromDataValid = false; + window.checkoutConfig.billingAddressFromData = billingAddressFromData; + checkoutDataResolver.resolveBillingAddress(); + expect(checkoutData.setBillingAddressFromData).toHaveBeenCalledWith(billingAddressFromData); + expect(quote.billingAddress()).toBeNull(); + }); + } + ); + }); + }); +}); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/new-customer-address.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/new-customer-address.test.js index 80abf804c8b27..84c1b97063322 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/new-customer-address.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/new-customer-address.test.js @@ -71,5 +71,22 @@ define([ expect(JSON.stringify(result)).toEqual(JSON.stringify(expected)); }); + it('Check that extensionAttributes property exists if defined', function () { + var result = newCustomerAddress({ + 'extension_attributes': { + 'attr_code': 'val' + } + }), + expected = { + countryId: 'US', + regionCode: null, + region: null, + extensionAttributes: { + 'attr_code': 'val' + } + }; + + expect(JSON.stringify(result)).toEqual(JSON.stringify(expected)); + }); }); }); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/totals.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/totals.test.js new file mode 100644 index 0000000000000..b411bd457b548 --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/totals.test.js @@ -0,0 +1,86 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/* eslint-disable max-nested-callbacks */ +/*jscs:disable jsDoc*/ +define([ + 'squire', 'jquery', 'ko' +], function (Squire, $, ko) { + 'use strict'; + + var injector = new Squire(), + cartData = { + 'subtotalAmount': 10 + }, + cart = ko.observable(cartData), + cartDataTwo = { + 'subtotalAmount': NaN + }, + cartTwo = ko.observable(cartDataTwo), + mocks = { + 'Magento_Checkout/js/model/quote': { + totals: ko.observable({ + 'subtotal': 4 + }) + }, + 'Magento_Customer/js/customer-data': { + get: function () { + return cart; + }, + reload: jasmine.createSpy(), + getInitCustomerData: function () {} + } + }, + mocksTwo = { + 'Magento_Checkout/js/model/quote': { + totals: ko.observable({ + 'subtotal': 10 + }) + }, + 'Magento_Customer/js/customer-data': { + get: function () { + return cartTwo; + }, + reload: jasmine.createSpy(), + getInitCustomerData: function () {} + } + }; + + afterEach(function () { + try { + injector.clean(); + injector.remove(); + } catch (e) {} + }); + + describe('Test that customer data is reloaded when quote subtotal and cart subtotal are different', function () { + beforeEach(function (done) { + injector.mock(mocks); + injector.require(['Magento_Checkout/js/model/totals'], function () { + done(); + }); + }); + it('Test that customer data is reloaded when quote subtotal and cart subtotal are different', function () { + expect(mocks['Magento_Checkout/js/model/quote'].totals().subtotal).toBe(4); + expect(cart().subtotalAmount).toBe(10); + expect(mocks['Magento_Customer/js/customer-data'].reload).toHaveBeenCalled(); + }); + }); + + describe('Test that customer data is not reloaded when cart subtotal is NaN', function () { + beforeEach(function (done) { + injector.mock(mocksTwo); + injector.require(['Magento_Checkout/js/model/totals'], function () { + done(); + }); + }); + it('Test that customer data is not reloaded when cart subtotal is NaN', function () { + expect(mocksTwo['Magento_Checkout/js/model/quote'].totals().subtotal).toBe(10); + expect(cartTwo().subtotalAmount).toBeNaN(); + expect(mocksTwo['Magento_Customer/js/customer-data'].reload).not.toHaveBeenCalled(); + }); + }); +}); + diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/billing-address.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/billing-address.test.js new file mode 100644 index 0000000000000..724ea9425c3dd --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/billing-address.test.js @@ -0,0 +1,108 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/* eslint max-nested-callbacks: 0 */ +define([ + 'squire', + 'ko' +], function (Squire, ko) { + 'use strict'; + + var injector = new Squire(), + checkoutData = jasmine.createSpyObj('checkoutData', ['setNewCustomerBillingAddress']), + mocks = { + 'Magento_Checkout/js/checkout-data': checkoutData, + 'Magento_Customer/js/customer-data': { + /** Stub */ + get: function () {} + }, + 'Magento_Checkout/js/model/quote': { + /** Stub */ + getQuoteId: function () {}, + + billingAddress: ko.observable(null), + + /** Stub */ + isVirtual: function () { + return false; + }, + + shippingAddress: ko.observable(null), + paymentMethod: ko.observable(null) + } + }, + lastSelectedBillingAddress = { + city: 'Culver City', + company: 'Magento', + country_id: 'US',// jscs:ignore requireCamelCaseOrUpperCaseIdentifiers + firstname: 'John', + lastname: 'Doe', + postcode: '90230', + region: '', + region_id: '12',// jscs:ignore requireCamelCaseOrUpperCaseIdentifiers + street: { + 0: '6161 West Centinela Avenue', + 1: '' + }, + telephone: '+15555555555' + }, + billingAddress; + + beforeEach(function (done) { + window.checkoutConfig = { + quoteData: {}, + storeCode: 'US' + }; + + spyOn(mocks['Magento_Checkout/js/model/quote'], 'billingAddress').and.returnValue(lastSelectedBillingAddress); + + injector.mock(mocks); + injector.require(['Magento_Checkout/js/view/billing-address'], function (Constr) { + billingAddress = new Constr; + + billingAddress.source = { + /** Stub */ + get: function () { + return []; + }, + + /** Stub */ + set: function () {}, + + /** Stub */ + trigger: function () {} + }; + + done(); + }); + }); + + describe('Magento_Checkout/js/view/billing-address', function () { + describe('"needCancelBillingAddressChanges" method', function () { + it('Test negative scenario', function () { + spyOn(billingAddress, 'cancelAddressEdit'); + billingAddress.editAddress(); + billingAddress.updateAddress(); + billingAddress.needCancelBillingAddressChanges(); + expect(billingAddress.cancelAddressEdit).not.toHaveBeenCalled(); + }); + + it('Test that billing address editing was canceled automatically', function () { + spyOn(billingAddress, 'cancelAddressEdit'); + billingAddress.editAddress(); + billingAddress.needCancelBillingAddressChanges(); + expect(billingAddress.cancelAddressEdit).toHaveBeenCalled(); + }); + }); + + describe('"restoreBillingAddress" method', function () { + it('Test that lastSelectedBillingAddress was restored correctly', function () { + billingAddress.editAddress(); + billingAddress.restoreBillingAddress(); + expect(checkoutData.setNewCustomerBillingAddress).toHaveBeenCalledWith(lastSelectedBillingAddress); + }); + }); + }); +}); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/form/element/email.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/form/element/email.test.js index d8c27e1a00c91..f29707d285c9f 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/form/element/email.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/form/element/email.test.js @@ -5,7 +5,7 @@ /* eslint max-nested-callbacks: 0 */ -define(['squire', 'ko'], function (Squire, ko) { +define(['squire', 'ko', 'jquery', 'jquery/validate'], function (Squire, ko, $) { 'use strict'; describe('Magento_Checkout/js/view/form/element/email', function () { @@ -31,12 +31,12 @@ define(['squire', 'ko'], function (Squire, ko) { 'getCheckedEmailValue' ] ), - 'Magento_Checkout/js/model/full-screen-loader': jasmine.createSpy(), - 'mage/validation': jasmine.createSpy() + 'Magento_Checkout/js/model/full-screen-loader': jasmine.createSpy() }, Component; beforeEach(function (done) { + window.checkoutConfig = {}; injector.mock(mocks); injector.require(['Magento_Checkout/js/view/form/element/email'], function (Constr) { Component = new Constr({ @@ -62,5 +62,23 @@ define(['squire', 'ko'], function (Squire, ko) { expect(typeof Component.resolveInitialPasswordVisibility()).toEqual('boolean'); }); }); + + describe('"validateEmail" method', function () { + beforeEach(function () { + $('body').append('<form data-role="email-with-possible-login">' + + '<input type="text" name="username" />' + + '</form>'); + spyOn($.fn, 'validate').and.returnValue(true); + }); + it('Check if login form will be validated in case it is not visible', function () { + var loginFormSelector = 'form[data-role=email-with-possible-login]', + loginForm = $(loginFormSelector); + + loginForm.hide(); + Component.validateEmail(); + expect(loginForm.is(':visible')).toBeFalsy(); + expect(loginForm.validate).not.toHaveBeenCalled(); + }); + }); }); }); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/frontend/js/configurable.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/frontend/js/configurable.test.js index 21492b20b779c..f161437993be2 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/frontend/js/configurable.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/frontend/js/configurable.test.js @@ -3,6 +3,7 @@ * See COPYING.txt for license details. */ +/* eslint-disable max-nested-callbacks */ define([ 'jquery', 'Magento_ConfigurableProduct/js/configurable' @@ -17,37 +18,69 @@ define([ 'class=\'super-attribute-select\'>' + '<option value=\'\'></option>' + '</select>', - selectElement = $(option); + selectElement = $(option); beforeEach(function () { widget = new Configurable(); widget.options = { - spConfig: { - chooseText: 'Chose an Option...', - attributes: + settings: [ { - 'size': { - options: [ - { - id: '2', - value: '2' - }, - { - id: 3, - value: 'red' - + selectedIndex: 0, + options: [ + { + label: 'Chose an Option...' + }, + { + label: 'red', + config: { + id: '4', + label: 'red', + products: [ + '4' + ], + initialLabel: 'red', + allowedProducts: ['4'] } - ] + } + ] + } + ], + priceHolderSelector: 'testSelector', + spConfig: { + chooseText: 'Chose an Option...', + optionPrices: { + 4: { + testPrice1: { + amount: 40 + }, + testPrice2: { + amount: 30 + } } }, + attributes: + { + 'size': { + options: [ + { + id: '2', + value: '2' + }, + { + id: 3, + value: 'red' + + } + ] + } + }, prices: { finalPrice: { amount: 12 } } }, - values: { - } + values: {} }; }); @@ -65,5 +98,30 @@ define([ widget._fillSelect(selectElement[0]); expect(widget.options.values.size).toBe(undefined); }); + + it('check if widget will return correct price values in case option is selected or not.', function () { + var result; + + spyOn($.fn, 'priceBox').and.callFake(function () { + return { + prices: { + testPrice1: { + amount: 10 + }, + testPrice2: { + amount: 20 + } + } + }; + }); + result = widget._getPrices().prices; + expect(result.testPrice1.amount).toBe(0); + expect(result.testPrice2.amount).toBe(0); + + widget.options.settings[0].selectedIndex = 1; + result = widget._getPrices().prices; + expect(result.testPrice1.amount).toBe(30); + expect(result.testPrice2.amount).toBe(10); + }); }); }); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/customer-data.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/customer-data.test.js index ae7c03dfd7792..952ade30969d5 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/customer-data.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/customer-data.test.js @@ -510,6 +510,22 @@ define([ }); }); + describe('"onAjaxComplete" method', function () { + it('Should not trigger reload if sections is empty', function () { + var jsonResponse, settings; + + jsonResponse = jasmine.createSpy(); + spyOn(sectionConfig, 'getAffectedSections').and.returnValue([]); + spyOn(obj, 'reload'); + settings = { + type: 'POST', + url: 'http://test.local' + }; + obj.onAjaxComplete(jsonResponse, settings); + expect(obj.reload).not.toHaveBeenCalled(); + }); + }); + describe('"Magento_Customer/js/customer-data" method', function () { it('Should be defined', function () { expect(obj.hasOwnProperty('Magento_Customer/js/customer-data')).toBeDefined(); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Multishipping/frontend/js/multi-shipping-balance.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Multishipping/frontend/js/multi-shipping-balance.test.js new file mode 100644 index 0000000000000..7b0591792af5a --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Multishipping/frontend/js/multi-shipping-balance.test.js @@ -0,0 +1,67 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define(['squire', 'jquery'], function (Squire, $) { + 'use strict'; + + var injector = new Squire(), + dataPost = { + postData: jasmine.createSpy() + }, + mocks = { + /** Stub */ + 'mage/dataPost': function () { + return dataPost; + } + }, + checkbox, + url = 'example.com', + + /** + * Toggle checkbox and assert that event was triggered. + * + * @param {Integer} value + */ + toggleCheckbox = function (value) { + checkbox.trigger('click'); + expect(dataPost.postData.calls.mostRecent().args[0]).toEqual({ + action: url, + data: { + useBalance: value + } + }); + }; + + beforeEach(function (done) { + checkbox = $('<input type="checkbox" name="use_balance" checked="checked"/>'); + $(document.body).append(checkbox); + + injector.mock(mocks); + injector.require(['multiShippingBalance'], function (balance) { + balance({ + changeUrl: url + }, checkbox); + done(); + }); + }); + + afterEach(function () { + try { + injector.clean(); + injector.remove(); + } catch (e) {} + + checkbox.remove(); + }); + + describe('multiShippingBalance', function () { + it('Check actions after clicking on checkbox.', function () { + toggleCheckbox(0); + toggleCheckbox(1); + toggleCheckbox(0); + expect(dataPost.postData).toHaveBeenCalledTimes(3); + }); + }); +}); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Paypal/frontend/js/view/payment/method-renderer/paypal-express-abstract.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Paypal/frontend/js/view/payment/method-renderer/paypal-express-abstract.test.js index 7bc9a2a0113aa..d73d5eb1c89d5 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Paypal/frontend/js/view/payment/method-renderer/paypal-express-abstract.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Paypal/frontend/js/view/payment/method-renderer/paypal-express-abstract.test.js @@ -73,6 +73,7 @@ define([ ['Magento_Paypal/js/view/payment/method-renderer/paypal-express-abstract'], function (Constr) { paypalExpressAbstract = new Constr({ + isChecked: ko.observable(true), provider: 'provName', name: 'test', index: 'test', diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/ProductVideo/adminhtml/js/get-video-information.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/ProductVideo/adminhtml/js/get-video-information.test.js new file mode 100644 index 0000000000000..6a025b0bdd1a9 --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/ProductVideo/adminhtml/js/get-video-information.test.js @@ -0,0 +1,44 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +define([ + 'jquery', + 'Magento_ProductVideo/js/get-video-information' +], function ($) { + 'use strict'; + + describe('Testing Youtube player Widget', function () { + var wdContainer; + + beforeEach(function () { + wdContainer = $( + '<div>' + + '<div class="video-information uploader"><span></span></div>' + + '<div class="video-player-container">' + + '<div class="product-video"></div>' + + '</div>' + + '</div>'); + }); + + afterEach(function () { + $(wdContainer).remove(); + }); + + it('Widget does not stops player if player is no defined', function () { + var video = wdContainer.find('.video-player-container').find('.product-video'), + widget; + + video.videoYoutube(); + widget = video.data('mageVideoYoutube'); + widget.stop = jasmine.createSpy(); + widget._player = { + destroy: jasmine.createSpy() + }; + widget.destroy(); + expect(widget._player).toBeUndefined(); + widget.destroy(); + expect(widget.stop).toHaveBeenCalledTimes(1); + }); + }); +}); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Theme/view/frontend/web/js/theme.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Theme/view/frontend/web/js/theme.test.js new file mode 100644 index 0000000000000..c7c1e692556bf --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Theme/view/frontend/web/js/theme.test.js @@ -0,0 +1,68 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/* eslint-disable max-nested-callbacks */ +define([ + 'jquery', + 'squire', + 'text!tests/assets/lib/web/mage/account_menu.html' +], function ($, Squire, header) { + 'use strict'; + + describe('Magento_Theme/js/theme', function () { + var injector = new Squire(), + mocks = {}; + + beforeEach(function (done) { + var $menu = $(header); + + $('body').append($menu); + + injector.mock(mocks); + injector.require(['Magento_Theme/js/theme'], function () { + done(); + }); + }); + + afterEach(function () { + try { + injector.clean(); + injector.remove(); + header = null; + } catch (e) {} + }); + + it('should add suffix "_mobile" to the html ID attribute (if exists) ' + + 'for every menu link to make IDs unique after cloning', function () { + var suffix = '_mobile', + menuItems = [ + { + id: '#my-account' + suffix, + link: 'http://magento.store/account/' + }, + { + id: '#my-wishlist' + suffix, + link: 'http://magento.store/wishlist/' + }, + { + id: '#my-orders' + suffix, + link: 'http://magento.store/orders/' + }, + { + id: '#my-addresses' + suffix, + link: 'http://magento.store/addresses/' + }, + { + id: '#create-account' + suffix, + link: 'http://magento.store/customer/account/create/' + } + ]; + + menuItems.forEach(function (item) { + expect($(item.id).attr('href')).toBe(item.link); + }); + }); + }); +}); diff --git a/dev/tests/js/jasmine/tests/lib/mage/misc.test.js b/dev/tests/js/jasmine/tests/lib/mage/misc.test.js index f5dcd166149ef..ceb568b73b879 100644 --- a/dev/tests/js/jasmine/tests/lib/mage/misc.test.js +++ b/dev/tests/js/jasmine/tests/lib/mage/misc.test.js @@ -2,11 +2,12 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - +/* eslint-disable max-nested-callbacks */ define([ 'mageUtils', - 'moment' -], function (utils, moment) { + 'moment', + 'jquery' +], function (utils, moment, $) { 'use strict'; describe('mageUtils', function () { @@ -681,5 +682,23 @@ define([ } } }); + + it('Check ajaxSubmit method', function () { + var options = { + data: {} + }, + config = { + ajaxSaveType: 'default' + }, + d = new $.Deferred(); + + spyOn($, 'ajax').and.callFake(function () { + d.reject(); + + return d.promise(); + }); + utils.ajaxSubmit(options, config); + expect($.ajax).toHaveBeenCalled(); + }); }); }); diff --git a/dev/tests/setup-integration/etc/di/preferences/cli/ce.php b/dev/tests/setup-integration/etc/di/preferences/cli/ce.php index b5605d98206f3..d598648c74447 100644 --- a/dev/tests/setup-integration/etc/di/preferences/cli/ce.php +++ b/dev/tests/setup-integration/etc/di/preferences/cli/ce.php @@ -4,6 +4,10 @@ * See COPYING.txt for license details. */ +use Magento\Framework as MF; +use Magento\TestFramework as TF; + return [ - '\Magento\Framework\Mview\TriggerCleaner' => '\Magento\TestFramework\Mview\DummyTriggerCleaner', + MF\App\AreaList::class => TF\App\AreaList::class, + MF\Mview\TriggerCleaner::class => TF\Mview\DummyTriggerCleaner::class, ]; diff --git a/dev/tests/setup-integration/framework/Magento/TestFramework/App/AreaList.php b/dev/tests/setup-integration/framework/Magento/TestFramework/App/AreaList.php new file mode 100644 index 0000000000000..bfb08c98de5ea --- /dev/null +++ b/dev/tests/setup-integration/framework/Magento/TestFramework/App/AreaList.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\TestFramework\App; + +use Magento\Framework\App\Area\FrontNameResolverFactory; +use Magento\Framework\ObjectManagerInterface; + +/** + * Stub for \Magento\Framework\App\AreaList + */ +class AreaList extends \Magento\Framework\App\AreaList +{ + /** + * @param ObjectManagerInterface $objectManager + * @param FrontNameResolverFactory $resolverFactory + * @param array $areas + * @param string|null $default + */ + public function __construct( + ObjectManagerInterface $objectManager, + FrontNameResolverFactory $resolverFactory, + array $areas = [], + $default = null + ) { + parent::__construct($objectManager, $resolverFactory, $areas, $default); + /** + * Then Magento is installed for setup-integration tests, di.xml files are parsed from all Magento modules, + * causing Magento\Framework\App\AreaList _areas property to be filled with arguments from disabled modules. + */ + $this->_areas = []; + } +} diff --git a/dev/tests/setup-integration/framework/tests/unit/phpunit.xml.dist b/dev/tests/setup-integration/framework/tests/unit/phpunit.xml.dist index d15c5f1818784..881f1a862aea5 100644 --- a/dev/tests/setup-integration/framework/tests/unit/phpunit.xml.dist +++ b/dev/tests/setup-integration/framework/tests/unit/phpunit.xml.dist @@ -22,7 +22,7 @@ <ini name="date.timezone" value="America/Los_Angeles"/> </php> <listeners> - <listener class="Yandex\Allure\Adapter\AllureAdapter"> + <listener class="Yandex\Allure\PhpUnit\AllurePhpUnit"> <arguments> <string>var/allure-results</string> <!-- XML files output directory --> <boolean>true</boolean> <!-- Whether to delete previous results on rerun --> diff --git a/dev/tests/setup-integration/phpunit.xml.dist b/dev/tests/setup-integration/phpunit.xml.dist index 0317d0e39efb1..76031c0f8cc1b 100644 --- a/dev/tests/setup-integration/phpunit.xml.dist +++ b/dev/tests/setup-integration/phpunit.xml.dist @@ -43,7 +43,7 @@ <listeners> <listener class="Magento\TestFramework\Event\PhpUnit"/> <listener class="Magento\TestFramework\ErrorLog\Listener"/> - <listener class="Yandex\Allure\Adapter\AllureAdapter"> + <listener class="Yandex\Allure\PhpUnit\AllurePhpUnit"> <arguments> <string>var/allure-results</string> <!-- XML files output directory --> <boolean>true</boolean> <!-- Whether to delete previous results on rerun --> diff --git a/dev/tests/static/framework/Magento/CodeMessDetector/Rule/Design/CookieAndSessionMisuse.php b/dev/tests/static/framework/Magento/CodeMessDetector/Rule/Design/CookieAndSessionMisuse.php index 1d49d9343a282..d03253bd166dc 100644 --- a/dev/tests/static/framework/Magento/CodeMessDetector/Rule/Design/CookieAndSessionMisuse.php +++ b/dev/tests/static/framework/Magento/CodeMessDetector/Rule/Design/CookieAndSessionMisuse.php @@ -8,11 +8,16 @@ namespace Magento\CodeMessDetector\Rule\Design; +use Magento\Framework\Session\SessionManagerInterface; +use Magento\Framework\Stdlib\Cookie\CookieReaderInterface; use PDepend\Source\AST\ASTClass; use PHPMD\AbstractNode; use PHPMD\AbstractRule; use PHPMD\Node\ClassNode; use PHPMD\Rule\ClassAware; +use ReflectionClass; +use ReflectionException; +use ReflectionParameter; /** * Session and Cookies must be used only in HTML Presentation layer. @@ -105,7 +110,7 @@ private function isControllerPlugin(\ReflectionClass $class): bool foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { if (preg_match('/^(after|around|before).+/i', $method->getName())) { try { - $argument = $method->getParameters()[0]->getClass(); + $argument = $this->getParameterClass($method->getParameters()[0]); } catch (\Throwable $exception) { //Non-existing class (autogenerated perhaps) or doesn't have an argument. continue; @@ -134,7 +139,7 @@ private function isBlockPlugin(\ReflectionClass $class): bool foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { if (preg_match('/^(after|around|before).+/i', $method->getName())) { try { - $argument = $method->getParameters()[0]->getClass(); + $argument = $this->getParameterClass($method->getParameters()[0]); } catch (\Throwable $exception) { //Non-existing class (autogenerated perhaps) or doesn't have an argument. continue; @@ -164,14 +169,16 @@ private function doesUseRestrictedClasses(\ReflectionClass $class): bool if ($constructor) { foreach ($constructor->getParameters() as $argument) { try { - if ($class = $argument->getClass()) { - if ($class->isSubclassOf(\Magento\Framework\Session\SessionManagerInterface::class) - || $class->getName() === \Magento\Framework\Session\SessionManagerInterface::class - || $class->isSubclassOf(\Magento\Framework\Stdlib\Cookie\CookieReaderInterface::class) - || $class->getName() === \Magento\Framework\Stdlib\Cookie\CookieReaderInterface::class - ) { - return true; - } + $class = $this->getParameterClass($argument); + if ($class === null) { + continue; + } + if ($class->isSubclassOf(SessionManagerInterface::class) + || $class->getName() === SessionManagerInterface::class + || $class->isSubclassOf(CookieReaderInterface::class) + || $class->getName() === CookieReaderInterface::class + ) { + return true; } } catch (\ReflectionException $exception) { //Failed to load the argument's class information @@ -183,6 +190,22 @@ private function doesUseRestrictedClasses(\ReflectionClass $class): bool return false; } + /** + * Get class by reflection parameter + * + * @param ReflectionParameter $reflectionParameter + * @return ReflectionClass|null + * @throws ReflectionException + */ + private function getParameterClass(ReflectionParameter $reflectionParameter): ?ReflectionClass + { + $parameterType = $reflectionParameter->getType(); + + return $parameterType && !$parameterType->isBuiltin() + ? new ReflectionClass($parameterType->getName()) + : null; + } + /** * @inheritdoc * diff --git a/dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php b/dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php index 3da08f324d761..dc27b019f4c55 100644 --- a/dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php +++ b/dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php @@ -9,6 +9,7 @@ use PHPStan\Command\AnalysisResult; use PHPStan\Command\ErrorFormatter\TableErrorFormatter; +use PHPStan\Command\ErrorFormatter\ErrorFormatter; use PHPStan\Command\Output; /** @@ -37,37 +38,45 @@ * * @see \Magento\PhpStan\Formatters\Fixtures\ClassWithIgnoreAnnotation */ -class FilteredErrorFormatter extends TableErrorFormatter +class FilteredErrorFormatter implements ErrorFormatter { private const MUTE_ERROR_ANNOTATION = 'phpstan:ignore'; - private const NO_ERRORS = 0; + /** + * @var TableErrorFormatter + */ + private $tableErrorFormatter; + + /** + * @param TableErrorFormatter $tableErrorFormatter + */ + public function __construct(TableErrorFormatter $tableErrorFormatter) + { + $this->tableErrorFormatter = $tableErrorFormatter; + } + /** * @inheritdoc */ public function formatErrors(AnalysisResult $analysisResult, Output $output): int { if (!$analysisResult->hasErrors()) { - $style = $output->getStyle(); - $style->success('No errors'); + $output->getStyle()->success('No errors'); return self::NO_ERRORS; } - $fileSpecificErrorsWithoutIgnoredErrors = $this->clearIgnoredErrors( - $analysisResult->getFileSpecificErrors() - ); - $clearedAnalysisResult = new AnalysisResult( - $fileSpecificErrorsWithoutIgnoredErrors, + $this->clearIgnoredErrors($analysisResult->getFileSpecificErrors()), $analysisResult->getNotFileSpecificErrors(), + $analysisResult->getInternalErrors(), $analysisResult->getWarnings(), $analysisResult->isDefaultLevelUsed(), - $analysisResult->hasInferrablePropertyTypesFromConstructor(), - $analysisResult->getProjectConfigFile() + $analysisResult->getProjectConfigFile(), + $analysisResult->isResultCacheSaved() ); - return parent::formatErrors($clearedAnalysisResult, $output); + return $this->tableErrorFormatter->formatErrors($clearedAnalysisResult, $output); } /** diff --git a/dev/tests/static/framework/Magento/Sniffs/Annotation/MethodArgumentsSniff.php b/dev/tests/static/framework/Magento/Sniffs/Annotation/MethodArgumentsSniff.php index 9bc90ff883a6d..54e101009dc9d 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Annotation/MethodArgumentsSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Annotation/MethodArgumentsSniff.php @@ -611,7 +611,7 @@ public function process(File $phpcsFile, $stackPtr) * * @SuppressWarnings(PHPMD.UnusedLocalVariable) * - * @see https://devdocs.magento.com/guides/v2.3/coding-standards/docblock-standard-general.html#format-consistency + * @see https://devdocs.magento.com/guides/v2.4/coding-standards/docblock-standard-general.html#format-consistency */ private function validateFormattingConsistency( array $paramDefinitions, diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/AvoidIdSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/AvoidIdSniff.php index 72a31504ac79c..bfdeee24bd455 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/AvoidIdSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/AvoidIdSniff.php @@ -13,7 +13,7 @@ * * Ensure that id selector is not used * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#types + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#types */ class AvoidIdSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/BracesFormattingSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/BracesFormattingSniff.php index 1e84b661405f3..3ca941c8fd49d 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/BracesFormattingSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/BracesFormattingSniff.php @@ -15,7 +15,7 @@ * Ensure there is a single blank line after the closing brace of a class definition * * @see Squiz_Sniffs_CSS_ClassDefinitionClosingBraceSpaceSniff - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#braces + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#braces */ class BracesFormattingSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/ClassNamingSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/ClassNamingSniff.php index 7f731f6d593b1..c20c79b453359 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/ClassNamingSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/ClassNamingSniff.php @@ -17,7 +17,7 @@ * - start with a letter (except helper classes); * - words should be separated with dash '-'; * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#standard-classes + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#standard-classes */ class ClassNamingSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/ColonSpacingSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/ColonSpacingSniff.php index 6d42916faf103..31ef0a8e2a950 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/ColonSpacingSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/ColonSpacingSniff.php @@ -14,7 +14,7 @@ * * Ensure that single quotes are used * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#properties-colon-indents + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#properties-colon-indents */ class ColonSpacingSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/ColourDefinitionSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/ColourDefinitionSniff.php index 328cdf406968e..60cea82584852 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/ColourDefinitionSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/ColourDefinitionSniff.php @@ -13,7 +13,7 @@ * * Ensure that hexadecimal values are used for variables not for properties * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#hexadecimal-notation + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#hexadecimal-notation */ class ColourDefinitionSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/CombinatorIndentationSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/CombinatorIndentationSniff.php index 5469497280e48..776e05337ca70 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/CombinatorIndentationSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/CombinatorIndentationSniff.php @@ -13,7 +13,7 @@ * * Ensure that spaces are used before and after combinators * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#combinator-indents + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#combinator-indents */ class CombinatorIndentationSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/CommentLevelsSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/CommentLevelsSniff.php index 2e880395b2000..b53aa81a7d889 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/CommentLevelsSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/CommentLevelsSniff.php @@ -15,7 +15,7 @@ * First, second and third level comments should have two spaces after "//". * Inline comments should have one space after "//". * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#comments + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#comments */ class CommentLevelsSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/ImportantPropertySniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/ImportantPropertySniff.php index b66af2ee70610..17120f7fece52 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/ImportantPropertySniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/ImportantPropertySniff.php @@ -13,7 +13,7 @@ * * Ensure that single quotes are used * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#important-property + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#important-property */ class ImportantPropertySniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/IndentationSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/IndentationSniff.php index 328937800349f..811f877e7163c 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/IndentationSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/IndentationSniff.php @@ -14,7 +14,7 @@ * Ensures styles are indented 4 spaces. * * @see Squiz_Sniffs_CSS_IndentationSniff - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#indentation + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#indentation */ class IndentationSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/PropertiesLineBreakSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/PropertiesLineBreakSniff.php index 6c75280b17f78..98b81f95bd447 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/PropertiesLineBreakSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/PropertiesLineBreakSniff.php @@ -13,7 +13,7 @@ * * Start each property declaration in a new line * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#properties-line-break + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#properties-line-break */ class PropertiesLineBreakSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/PropertiesSortingSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/PropertiesSortingSniff.php index 634c61da9c1de..8757207fce70c 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/PropertiesSortingSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/PropertiesSortingSniff.php @@ -13,7 +13,7 @@ * * Ensure that properties are sorted alphabetically * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#sorting + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#sorting */ class PropertiesSortingSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/QuotesSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/QuotesSniff.php index 1945eb34976c4..d605cc131356e 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/QuotesSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/QuotesSniff.php @@ -13,7 +13,7 @@ * * Ensure that single quotes are used * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#quotes + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#quotes */ class QuotesSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/SelectorDelimiterSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/SelectorDelimiterSniff.php index 57eabaf853791..6318eeab15c95 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/SelectorDelimiterSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/SelectorDelimiterSniff.php @@ -14,7 +14,7 @@ * Ensure that a line break exists after each selector delimiter. * No spaces should be before or after delimiters. * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#selector-delimiters + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#selector-delimiters */ class SelectorDelimiterSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/SemicolonSpacingSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/SemicolonSpacingSniff.php index 885304ae63c3d..16967cf71e3e8 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/SemicolonSpacingSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/SemicolonSpacingSniff.php @@ -13,7 +13,7 @@ * * Property should have a semicolon at the end of line * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#end-of-the-property-line + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#end-of-the-property-line */ class SemicolonSpacingSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/TypeSelectorConcatenationSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/TypeSelectorConcatenationSniff.php index dfbde77a83d4b..8928028ca7a94 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/TypeSelectorConcatenationSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/TypeSelectorConcatenationSniff.php @@ -13,7 +13,7 @@ * * Ensure that selector in one line, concatenation is not used * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#formatting-1 + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#formatting-1 */ class TypeSelectorConcatenationSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/TypeSelectorsSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/TypeSelectorsSniff.php index 0a6a658c0d1ba..95a45b8027448 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/TypeSelectorsSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/TypeSelectorsSniff.php @@ -18,7 +18,7 @@ * - Type selectors must be lowercase * - Write selector in one line, do not use concatenation * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#selectors-naming + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#selectors-naming */ class TypeSelectorsSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/VariablesSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/VariablesSniff.php index c769161f0eb92..ec9f51087200d 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/VariablesSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/VariablesSniff.php @@ -16,8 +16,8 @@ * they should be located in the module file, in the beginning of the general comment. * - All variable names must be lowercase * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#local-variables - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#naming + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#local-variables + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#naming */ class VariablesSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/ZeroUnitsSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/ZeroUnitsSniff.php index f20482fa8609f..7cf3bfb2d7256 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/ZeroUnitsSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/ZeroUnitsSniff.php @@ -14,8 +14,8 @@ * Ensure that units for 0 is not specified * Omit leading "0"s in values, use dot instead * - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#and-units - * @link https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html#floating-values + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#and-units + * @link https://devdocs.magento.com/guides/v2.4/coding-standards/code-standard-less.html#floating-values */ class ZeroUnitsSniff implements Sniff { diff --git a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CopyPasteDetector.php b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CopyPasteDetector.php index 1e1236cd604b5..61cb5a634d292 100644 --- a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CopyPasteDetector.php +++ b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CopyPasteDetector.php @@ -3,18 +3,30 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); -/** - * PHP Copy Paste Detector v1.4.0 tool wrapper - */ namespace Magento\TestFramework\CodingStandard\Tool; use Magento\TestFramework\CodingStandard\ToolInterface; +use SebastianBergmann\FileIterator\Facade; +use SebastianBergmann\PHPCPD\Detector\Detector; +use SebastianBergmann\PHPCPD\Detector\Strategy\DefaultStrategy; +use SebastianBergmann\PHPCPD\Log\PMD; +use SebastianBergmann\PHPCPD\Log\Text; +use Symfony\Component\Finder\Finder; +/** + * PHP Copy Paste Detector tool wrapper + */ class CopyPasteDetector implements ToolInterface, BlacklistInterface { /** - * Report file + * Minimum number of equal lines to identify a copy paste snippet + */ + private const MIN_LINES = 13; + + /** + * Destination file to write inspection report to * * @var string */ @@ -28,19 +40,17 @@ class CopyPasteDetector implements ToolInterface, BlacklistInterface private $blacklist; /** - * Constructor - * - * @param string $reportFile Destination file to write inspection report to + * @param string $reportFile */ - public function __construct($reportFile) + public function __construct(string $reportFile) { $this->reportFile = $reportFile; } /** - * {@inheritdoc} + * @inheritdoc */ - public function setBlackList(array $blackList) + public function setBlackList(array $blackList): void { $this->blacklist = $blackList; } @@ -52,53 +62,113 @@ public function setBlackList(array $blackList) * * @return bool */ - public function canRun() + public function canRun(): bool { - exec($this->getCommand() . ' --version', $output, $exitCode); - return $exitCode === 0; + return class_exists(Detector::class) + && class_exists(Facade::class) + && class_exists(Finder::class); } /** * Run tool for files specified * * @param array $whiteList Files/directories to be inspected - * @return int + * @return bool + */ + public function run(array $whiteList): bool + { + $clones = (new Detector(new DefaultStrategy()))->copyPasteDetection( + (new Facade())->getFilesAsArray( + $whiteList, + '', + '', + $this->getExclude() + ), + self::MIN_LINES + ); + + (new PMD($this->reportFile))->processClones($clones); + (new Text)->printResult($clones, false); + + return count($clones) === 0; + } + + /** + * Get exclude params from blacklist * - * @SuppressWarnings(PHPMD.UnusedLocalVariable) + * @return string[] */ - public function run(array $whiteList) + private function getExclude(): array { + $exclude = []; $blacklistedDirs = []; $blacklistedFileNames = []; + $blacklistedPatterns = []; foreach ($this->blacklist as $file) { - $file = escapeshellarg(trim($file)); + $file = trim($file); if (!$file) { continue; } - $ext = pathinfo($file, PATHINFO_EXTENSION); - if ($ext != '') { - $blacklistedFileNames[] = $file; - } else { - $blacklistedDirs[] = '--exclude ' . $file . ' '; + $realPath = realpath(BP . '/' . $file); + if ($realPath === false) { + $ext = pathinfo($file, PATHINFO_EXTENSION); + if ($ext != '') { + $blacklistedFileNames[] = $file; + } else { + $blacklistedPatterns[] = $file; + } + continue; + } + + $exclude[] = [$realPath]; + $blacklistedDirs[] = $file; + } + + foreach ($blacklistedPatterns as $pattern) { + $files = $this->find($pattern, false, $blacklistedDirs); + if (empty($files)) { + continue; } + $exclude[] = $files; } - $command = $this->getCommand() . ' --log-pmd ' . escapeshellarg($this->reportFile) - . ' --names-exclude ' . join(',', $blacklistedFileNames) . ' --min-lines 13 ' . join(' ', $blacklistedDirs) - . ' ' . implode(' ', $whiteList); - exec($command, $output, $exitCode); - return !(bool)$exitCode; + foreach ($blacklistedFileNames as $fileName) { + $files = $this->find($fileName, true, $blacklistedDirs); + if (empty($files)) { + continue; + } + $exclude[] = $files; + } + + return array_unique(array_merge(...$exclude)); } /** - * Get PHPCPD command + * Find all files by pattern * - * @return string + * @param string $pattern + * @param bool $searchFiles + * @param array $excludePaths + * @return array */ - private function getCommand() + private function find(string $pattern, bool $searchFiles, array $excludePaths): array { - $vendorDir = require BP . '/app/etc/vendor_path.php'; - return 'php ' . BP . '/' . $vendorDir . '/bin/phpcpd'; + $finder = new Finder(); + $finder->in(BP); + $finder->notPath($excludePaths); + if ($searchFiles) { + $finder->files(); + $finder->name($pattern); + } else { + $finder->path($pattern); + } + + $result = []; + foreach ($finder as $file) { + $result[] = $file->getRealPath(); + } + + return $result; } } diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/Injectable.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/Injectable.php index 524a4f7be3616..3a47f4547d4cb 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/Injectable.php +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/Library/Injectable.php @@ -8,6 +8,9 @@ use Laminas\Code\Reflection\ClassReflection; use Laminas\Code\Reflection\FileReflection; use Laminas\Code\Reflection\ParameterReflection; +use ReflectionClass; +use ReflectionException; +use ReflectionParameter; /** * Provide dependencies for the file @@ -39,7 +42,7 @@ public function getDependencies(FileReflection $fileReflection) foreach ($method->getParameters() as $parameter) { try { /** @var ParameterReflection $parameter */ - $dependency = $parameter->getClass(); + $dependency = $this->getParameterClass($parameter); if ($dependency instanceof ClassReflection) { $this->dependencies[] = $dependency->getName(); } @@ -56,4 +59,20 @@ public function getDependencies(FileReflection $fileReflection) return $this->dependencies; } + + /** + * Get class by reflection parameter + * + * @param ReflectionParameter $reflectionParameter + * @return ReflectionClass|null + * @throws ReflectionException + */ + private function getParameterClass(ReflectionParameter $reflectionParameter): ?ReflectionClass + { + $parameterType = $reflectionParameter->getType(); + + return $parameterType && !$parameterType->isBuiltin() + ? new ReflectionClass($parameterType->getName()) + : null; + } } diff --git a/dev/tests/static/framework/tests/unit/phpunit.xml.dist b/dev/tests/static/framework/tests/unit/phpunit.xml.dist index f1cd910f3b02b..0fa8441027f34 100644 --- a/dev/tests/static/framework/tests/unit/phpunit.xml.dist +++ b/dev/tests/static/framework/tests/unit/phpunit.xml.dist @@ -21,7 +21,7 @@ <ini name="date.timezone" value="America/Los_Angeles"/> </php> <listeners> - <listener class="Yandex\Allure\Adapter\AllureAdapter"> + <listener class="Yandex\Allure\PhpUnit\AllurePhpUnit"> <arguments> <string>var/allure-results</string> <!-- XML files output directory --> <boolean>true</boolean> <!-- Whether to delete previous results on rerun --> diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/UsesTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/UsesTest.php index f1ade8d28126a..6033e7e6dee98 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/UsesTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/Test/Integrity/Library/PhpParser/UsesTest.php @@ -27,7 +27,7 @@ protected function setUp(): void /** * Covered hasUses method * - * @dataProvider usesDataProvider + * @dataProvider hasUsesDataProvider * @test * * @param array $tokens @@ -45,7 +45,7 @@ public function testHasUses($tokens) * * @return array */ - public function usesDataProvider() + public function hasUsesDataProvider() { return [ 'simple' => [ diff --git a/dev/tests/static/get_github_changes.php b/dev/tests/static/get_github_changes.php index a619f951dac87..7a6f5aea303a1 100644 --- a/dev/tests/static/get_github_changes.php +++ b/dev/tests/static/get_github_changes.php @@ -485,6 +485,8 @@ private function call($command) escapeshellarg($this->workTree) ); $tmp = sprintf('%s %s', $gitCmd, $command); + // exec() have to be here since this is test. + // phpcs:ignore Magento2.Security.InsecureFunction exec($tmp, $output); return $output; } diff --git a/dev/tests/static/phpunit-all.xml.dist b/dev/tests/static/phpunit-all.xml.dist index 1d1464161da58..6fe05ff189f78 100644 --- a/dev/tests/static/phpunit-all.xml.dist +++ b/dev/tests/static/phpunit-all.xml.dist @@ -24,7 +24,7 @@ <const name="TESTCODESTYLE_IS_FULL_SCAN" value="0"/> </php> <listeners> - <listener class="Yandex\Allure\Adapter\AllureAdapter"> + <listener class="Yandex\Allure\PhpUnit\AllurePhpUnit"> <arguments> <string>var/allure-results</string> <!-- XML files output directory --> <boolean>true</boolean> <!-- Whether to delete previous results on rerun --> diff --git a/dev/tests/static/phpunit.xml.dist b/dev/tests/static/phpunit.xml.dist index 122036be1cfca..bb9d880292e14 100644 --- a/dev/tests/static/phpunit.xml.dist +++ b/dev/tests/static/phpunit.xml.dist @@ -39,7 +39,7 @@ <!--<const name="TESTS_COMPOSER_PATH" value="/usr/local/bin/composer"/>--> </php> <listeners> - <listener class="Yandex\Allure\Adapter\AllureAdapter"> + <listener class="Yandex\Allure\PhpUnit\AllurePhpUnit"> <arguments> <string>var/allure-results</string> <!-- XML files output directory --> <boolean>true</boolean> <!-- Whether to delete previous results on rerun --> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/DBSchema/PrimaryKeyTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/DBSchema/PrimaryKeyTest.php new file mode 100644 index 0000000000000..c2c7053fdd6c3 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/DBSchema/PrimaryKeyTest.php @@ -0,0 +1,138 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Test\Integrity\DBSchema; + +use Magento\Framework\App\Utility\Files; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Setup\Declaration\Schema\Config\Converter; +use PHPUnit\Framework\TestCase; + +/** + * Test for finding database tables missing primary key + */ +class PrimaryKeyTest extends TestCase +{ + /** + * Check missing database tables' primary key + * + * @throws LocalizedException + */ + public function testMissingPrimaryKey() + { + $exemptionList = $this->getExemptionList(); + $tablesSchemaDeclaration = $this->getDbSchemaDeclarations()['table']; + $exemptionList = array_intersect(array_keys($tablesSchemaDeclaration), $exemptionList); + foreach ($exemptionList as $exemptionTableName) { + unset($tablesSchemaDeclaration[$exemptionTableName]); + } + $errorMessage = ''; + $failedTableCtr = 0; + foreach ($tablesSchemaDeclaration as $tableName => $tableSchemaDeclaration) { + if (!$this->hasPrimaryKey($tableSchemaDeclaration)) { + $message = ''; + if (!empty($tableSchemaDeclaration['modules'])) { + $message = "It is declared in the following modules: \n" . implode( + "\t\n", + $tableSchemaDeclaration['modules'] + ); + } + $errorMessage .= 'Table ' . $tableName . ' does not have primary key. ' . $message . "\n"; + $failedTableCtr ++; + } + } + if (!empty($errorMessage)) { + $errorMessage .= "\n\nTotal " . $failedTableCtr . " tables failed"; + $this->fail($errorMessage); + } + } + + /** + * Check table schema and verify if the table has primary key defined. + * + * @param array $tableSchemaDeclaration + * @return bool + */ + private function hasPrimaryKey(array $tableSchemaDeclaration): bool + { + if (isset($tableSchemaDeclaration['constraint'])) { + foreach ($tableSchemaDeclaration['constraint'] as $constraint) { + if ($constraint['type'] == 'primary') { + return true; + } + } + } + return false; + } + + /** + * Get database schema declarations from file. + * + * @param string $filePath + * @return array + */ + private function getDbSchemaDeclarationByFile(string $filePath): array + { + $dom = new \DOMDocument(); + $dom->loadXML(file_get_contents($filePath)); + return (new Converter())->convert($dom); + } + + /** + * Get database schema declarations for whole application + * + * @return array + * @throws LocalizedException + */ + private function getDbSchemaDeclarations(): array + { + $declarations = []; + foreach (Files::init()->getDbSchemaFiles() as $filePath) { + $filePath = reset($filePath); + preg_match('#/(\w+/\w+)/etc/db_schema.xml#', $filePath, $result); + $moduleName = str_replace('/', '_', $result[1]); + $moduleDeclaration = $this->getDbSchemaDeclarationByFile($filePath); + + foreach ($moduleDeclaration['table'] as $tableName => $tableDeclaration) { + if (!isset($tableDeclaration['modules'])) { + $tableDeclaration['modules'] = []; + } + array_push($tableDeclaration['modules'], $moduleName); + $moduleDeclaration = array_replace_recursive( + $moduleDeclaration, + [ + 'table' => [ + $tableName => $tableDeclaration, + ] + ] + ); + } + $declarations = array_merge_recursive($declarations, $moduleDeclaration); + } + return $declarations; + } + + /** + * Return primary key exemption tables list + * + * @return string[] + */ + private function getExemptionList(): array + { + $exemptionListFiles = str_replace( + '\\', + '/', + realpath(__DIR__) . '/_files/primary_key_exemption_list*.txt' + ); + $exemptionList = []; + foreach (glob($exemptionListFiles) as $fileName) { + $exemptionList[] = file($fileName, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + } + return array_merge([], ...$exemptionList); + } +} diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/DBSchema/_files/primary_key_exemption_list.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/DBSchema/_files/primary_key_exemption_list.txt new file mode 100644 index 0000000000000..4e6a987af2aec --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/DBSchema/_files/primary_key_exemption_list.txt @@ -0,0 +1 @@ +queue_poison_pill diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/PublicCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/PublicCodeTest.php index 29ac58f39d89b..b5e61ed2ece8e 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/PublicCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/PublicCodeTest.php @@ -6,6 +6,9 @@ namespace Magento\Test\Integrity; use Magento\Framework\App\Utility\Files; +use ReflectionClass; +use ReflectionException; +use ReflectionParameter; /** * Tests @api annotated code integrity @@ -277,7 +280,7 @@ private function checkParameters($class, \ReflectionMethod $method, array $nonPu && !$parameter->getType()->isBuiltin() && !$this->isGenerated($parameter->getType()->getName()) ) { - $parameterClass = $parameter->getClass(); + $parameterClass = $this->getParameterClass($parameter); /* * We don't want to check integrity of @api coverage of classes * that belong to different vendors, because it is too complicated. @@ -286,7 +289,7 @@ private function checkParameters($class, \ReflectionMethod $method, array $nonPu * we don't want to fail test, because Zend is considered public by default, * and we don't care if Zend classes are @api-annotated */ - if (!$parameterClass->isInternal() + if ($parameterClass && !$parameterClass->isInternal() && $this->areClassesFromSameVendor($parameterClass->getName(), $class) && !$this->isPublished($parameterClass) ) { @@ -296,4 +299,20 @@ private function checkParameters($class, \ReflectionMethod $method, array $nonPu } return $nonPublishedClasses; } + + /** + * Get class by reflection parameter + * + * @param ReflectionParameter $reflectionParameter + * @return ReflectionClass|null + * @throws ReflectionException + */ + private function getParameterClass(ReflectionParameter $reflectionParameter): ?ReflectionClass + { + $parameterType = $reflectionParameter->getType(); + + return $parameterType && !$parameterType->isBuiltin() + ? new ReflectionClass($parameterType->getName()) + : null; + } } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/whitelist/redundant_dependencies_security.php b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/whitelist/redundant_dependencies_security.php new file mode 100644 index 0000000000000..14f7a536361c2 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/whitelist/redundant_dependencies_security.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +return [ + 'Magento\Checkout' => [ + 'Magento\Security' => 'Magento\Security' + ] +]; diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index d6a4053448fc8..892cd5d8e2f62 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -2570,4 +2570,5 @@ ], ['isOrderIncrementIdUsed', 'Magento\Quote\Model\ResourceModel\Quote', 'Magento\Sales\Model\OrderIncrementIdChecker::isIncrementIdUsed'], ['update', 'Magento\Authorization\Model\Rules', 'Magento\Authorization\Model\Rules::update'], + ['update', 'Magento\Authorization\Model\Role', 'Magento\Authorization\Model\Role::update'], ]; diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index 65358cd785066..2df2b27c24fe3 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -359,10 +359,7 @@ public function testCopyPaste() $result = $copyPasteDetector->run([BP]); - $output = ""; - if (file_exists($reportFile)) { - $output = file_get_contents($reportFile); - } + $output = file_exists($reportFile) ? file_get_contents($reportFile) : ''; $this->assertTrue( $result, diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt index fc8c0c17447d8..efc7e669b3605 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt @@ -1,220 +1,111 @@ -Magento/Adminhtml -Magento/Backend -Magento/Bundle -Magento/Catalog/Block/Product/ProductList -Magento/Catalog/Model/Category/Attribute/Source -Magento/Catalog/Model/Category/Indexer -Magento/Catalog/Model/Product -Magento/Core/Model/Resource/Design -Zend +app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php +app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php +app/code/Magento/Backend/Test/Unit/Model/_files/ +app/code/Magento/Bundle +app/code/Magento/Catalog/Model/Product/Visibility.php +app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php +app/code/Magento/Catalog/Model/Category.php +app/code/Magento/Catalog/Model/ResourceModel/Product/Link/SaveHandler.php dev -Mysql -lib/internal/Magento/Framework/DB -sql -data -Magento/Paypal -Magento/Downloadable -Magento/Core/Model/Resource/Helper -Magento/Catalog/Block/Adminhtml -Magento/Catalog/Model/Resource/Collection -Magento/Catalog/Model/Resource/Product/Indexer -Magento/CatalogInventory/Model/Resource/Indexer/Stock -Magento/Sales/Model/Order -Magento/CatalogInventory/Model/Source -Magento/CatalogSearch/Model/Resource/Helper -Magento/CatalogSearch/Model/Resource/Advanced -Magento/CatalogSearch/Model/Resource/Search -Magento/Checkout/Block/Multishipping -Magento/Checkout/Model/Type -Magento/Catalog/Model/Template -Magento/Cms/Model -Magento/GiftMessage/Model -Magento/GroupedProduct/Model/Resource/Product/Type/Grouped -Magento/Sales/Block/Order -Magento/Sales/Controller/Adminhtml/Order -Magento/Sales/Model/Resource/Helper -Magento/Sales/Model/Resource/Order -Magento/Sales/Model/Service/Quote -Magento/Catalog/Block/Product -Magento/Catalog/Model/Resource/Product -Magento/Catalog/Model/Layer -Magento/Eav/Model/Entity/Collection -Magento/CatalogImportExport/Model/Export -Magento/CatalogImportExport/Model/Import -Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab -Magento/Checkout/Block/Onepage -Magento/Checkout/Service/V1/Data/Cart -app/code/Magento/Cms/Api/Data -Magento/Cms/Block/Adminhtml/Page/Edit -Magento/Core/Model/Design/Backend -Magento/Core/Model/Layout/File/Source/Override -Magento/Core/Model/Store -Magento/Store/Model -Magento/Cron/Model/Config/Backend/Product -Magento/Customer/Block/Account/Dashboard -Magento/Customer/Controller/Adminhtml/Index -Magento/Customer/Model/Config/Backend/Show -Magento/Customer/Model/Metadata -Magento/Customer/Model/Resource/Customer -Magento/Directory/Model -Magento/GiftMessage/Block/Adminhtml/Sales/Order -Magento/ImportExport/Model -Magento/Integration/Controller/Adminhtml -Magento/Newsletter/Block/Adminhtml/Template/Preview -Magento/Newsletter/Block/Adminhtml/Queue/Preview -Magento/Payment/Block/Form -Magento/Payment/Model/Method -Magento/Payment/Model/Config -Magento/ProductAlert/Model -Magento/Rating/Model -Magento/Reports/Block/Adminhtml -Magento/Reports/Block/Product/Widget -Magento/Reports/Controller/Adminhtml/Report -Magento/Reports/Model/Resource/Helper -Magento/Reports/Model/Resource -Magento/Review/Block -Magento/Review/Model/Resource/Review/Product -Magento/Rss/Block/Catalog -Magento/Rule -Magento/Sales/Block/Adminhtml/Order -Magento/Shipping/Block/Adminhtml/View -Magento/Sales/Model/Resource -Magento/Quote/Model/Quote/Address/Total -Magento/Sales/Model/Resource/Report/Order -Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab -Magento/Search/Block/Adminhtml/Dashboard -Magento/Shipping/Model/Carrier -Magento/Sitemap/Block/Adminhtml/Edit -Magento/Sitemap/Model/ -Magento/CatalogRule/Model -Magento/Rss/Controller/Adminhtml/Feed -Magento/Tax/Block/Checkout -Magento/Tax/Model/Sales/Pdf -Magento/Tax/Model/Config/Price -Magento/Tax/Api/Data -Magento/Usps/Model -Magento/Webapi/Block/Adminhtml -Magento/Webapi/Model -Magento/Widget/Model/Widget/Instance -Magento/Wishlist/Block -Magento/Wishlist/Model -lib/internal/Magento/Framework/Archive -lib/internal/Magento/Framework/HTTP/Client -lib/internal/Magento/Framework/Acl -lib/internal/Magento/Framework/Convert -lib/internal/Magento/Framework/App/Config -Magento/Cron/Model -Magento/SalesRule/Model/Resource/Report/Rule -Magento/SalesRule/Model/Resource/Rule -Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit -Magento/User/Block/User/Edit +lib/internal/Magento/Framework/DB/Select/RendererProxy.php +lib/internal/Magento/Framework/DB/Query/Generator.php +app/code/Magento/Paypal/Model/Method/Agreement.php +app/code/Magento/Paypal/Test/Unit/Model/_files/additional_info_data.php +app/code/Magento/Downloadable/Model/Link.php +app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php +app/code/Magento/Downloadable/Model/ResourceModel/Link/Collection.php +app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Links.php +app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php +app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php +app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php +app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php +app/code/Magento/Catalog/Block/Adminhtml/Category/Helper/Sortby/Available.php +app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Auto.php +app/code/Magento/Sales/Model/Order/Pdf/ +app/code/Magento/Sales/Model/Order/CreditmemoRepository.php +app/code/Magento/Sales/Model/Order/Email/Container/ +app/code/Magento/Sales/Model/Order/Invoice.php +app/code/Magento/Sales/Model/Order/Invoice/Item.php +app/code/Magento/Sales/Model/Order/Creditmemo/Item.php +app/code/Magento/Sales/Model/Order/ShipmentRepository.php +app/code/Magento/Sales/Model/ResourceModel/Order/Creditmemo/Relation/Refund.php +app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php +app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php +app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php +app/code/Magento/Cms/Model/ResourceModel/Page/Grid/Collection.php +app/code/Magento/Shipping/Block/Order/Shipment.php +app/code/Magento/Sales/Block/Order/Creditmemo.php +app/code/Magento/Sales/Block/Order/Invoice.php +app/code/Magento/Sales/Block/Order/PrintOrder/Creditmemo.php +app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/NewAction.php +app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index/ConfigureQuoteItems.php +app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php +app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php +app/code/Magento/Customer/Controller/Adminhtml/Address/Viewfile.php +app/code/Magento/Customer/Model/Metadata/Form/AbstractData.php +app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/View/Items.php +app/code/Magento/ImportExport/Model/Export/Entity/AbstractEntity.php +app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php +app/code/Magento/Newsletter/Block/Adminhtml/Queue/Preview/Form.php +app/code/Magento/ProductAlert/Model/Observer.php +app/code/Magento/Reports/Block/Adminhtml/Sales/Invoiced/Grid.php +app/code/Magento/Reports/Model/ResourceModel/Customer/Totals/Collection.php +app/code/Magento/Review/Block/Customer/View.php +app/code/Magento/Rule/Test/Mftf/Helper/RuleHelper.php +app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus/Form.php +app/code/Magento/Sales/Model/ResourceModel/Collection/AbstractCollection.php +app/code/Magento/Sales/Model/ResourceModel/Report/ +app/code/Magento/Search/Block/Adminhtml/Dashboard/Last.php +app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php +app/code/Magento/CatalogRule/Model/ResourceModel/SaveHandler.php +lib/internal/Magento/Framework/HTTP/Client/Socket.php +lib/internal/Magento/Framework/App/Config/Scope/Validator.php +app/code/Magento/Cron/Model/Schedule.php generated/code -Magento/Newsletter/Block/Adminhtml/Template/Grid/Renderer -Magento/Newsletter/Model/Template/Filter -Magento/Newsletter/Model/Resource/Subscriber -Magento/Tax/Service/V1/Data -Magento/CatalogInventory/Model/Resource/Stock/Item -lib/internal/Magento/Framework/Filesystem/Driver -Magento/OfflineShipping/Model/Carrier -Magento/Usps/Model/Carrier -Magento/Dhl/Model -Magento/Shipping/Model -Magento/Ui -Magento/Sales/Service/V1 -Magento/Sales/Api -Magento/Eav/Api/Data -Magento/Customer/Api/Data -Magento/Quote/Api/Data -Magento/Catalog/Api/Data -Magento/Sales/Spi -Magento/Shipping/Controller/Adminhtml/Order/Shipment +lib/internal/Magento/Framework/Filesystem/Driver/File/Mime.php +app/code/Magento/Shipping/Model/Rate/PackageResult.php +app/code/Magento/Ui/DataProvider/AbstractDataProvider.php +app/code/Magento/Ui/Config/Converter/Url.php +app/code/Magento/Ui/Config/Converter/Buttons.php +app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php +app/code/Magento/Sales/Api/Data/CreditmemoItemInterface.php vendor -Magento/CatalogSearch/Model/Resource/Fulltext -Magento/CatalogSearch/Model/Indexer -lib/internal/Magento/Framework/Data -lib/internal/Magento/Framework/Service -app/code/Magento/CatalogInventory/Api/Data -app/code/Magento/Sales/Model/Spi -Magento/Catalog/Model/ProductLink -Magento/GroupedProduct/Model/Resource/Product/Type/Grouped -lib/internal/Magento/Framework/Interception/ObjectManager/Config -app/code/Magento/OfflinePayments/Model -Magento/Weee/Model/Resource -Magento/Theme/Model/Design/Backend -Magento/Core/Model/Resource/Layout/Link -Magento/Theme/Model/Resource/Design -Magento/Integration/Block/Adminhtml/Integration/Edit/Tab -Magento/Config/Model/Config/Backend -Magento/Backup/Model/Config/Backend -Magento/Catalog/Setup -Magento/CatalogInventory/Setup -Magento/Checkout/Setup -Magento/Customer/Setup -Magento/Eav/Setup -Magento/Quote/Setup -Magento/Reports/Setup -Magento/Sales/Setup -Magento/SalesRule/Setup -Magento/Eav/Setup +lib/internal/Magento/Framework/DataObject/Copy/Config/Data/Proxy.php +app/code/Magento/Catalog/Setup/Patch/Data/UpgradeWebsiteAttributes.php +app/code/Magento/CatalogUrlRewrite/Setup/Recurring.php +app/code/Magento/Checkout/Setup/Patch/Data/PrepareInitialCheckoutConfiguration.php +app/code/Magento/ConfigurableProduct/Setup/Recurring.php +app/code/Magento/Sales/Setup/SalesSetup.php +app/code/Magento/Weee/Setup/Recurring.php +app/code/Magento/Wishlist/Setup/Recurring.php setup/src/Magento/Setup/Fixtures -Magento/ConfigurableProduct/Setup -Magento/Weee/Setup -Magento/Wishlist/Setup -Magento/CatalogUrlRewrite/Setup -Magento/AdvancedSalesRule/Setup -Magento/VisualMerchandiser/Setup -Magento/Catalog/Model -Magento/Catalog/Ui/Component/Listing -Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Variations/Config -Magento/Payment/Gateway/Data/Order -Magento/ProductAlert/Controller/Unsubscribe -Magento/Reports/Model/ResourceModel/Customer/Orders -Magento/Sales/Model/ResourceModel/Report -Magento/SalesRule/Model -Magento/Search/Ui/Component/Listing/Column/Scope -Magento/Tax/Model/Calculation -Magento/Vault/Model/Ui -Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price -Magento/AdvancedSalesRule/Model/Rule/Condition/Product -Magento/CmsStaging/Controller/Adminhtml/Block/Update -Magento/Customer/Block/Widget -Magento/Persistent/Observer -Magento/Elasticsearch/Model/Adapter/Container -Magento/Elasticsearch/SearchAdapter -Magento/Staging/Model/Entity/DataProvider -Magento/CatalogStaging/Model/Update/Grid -Magento/Eav/Model/Api/SearchCriteria/CollectionProcessor -Magento/Framework/App/AreaList -Magento/Framework/App/Route/ConfigInterface -Magento/Framework/DataObject/Copy/Config/Data -Magento/Framework/Backup/Filesystem/Iterator -Magento/Theme/Model/Indexer/Design -Magento/Framework/EntityManager/Db -Magento/Framework/Mview/Config/Data -Magento/Framework/View/File/Collector/Override -Magento/Framework/MessageQueue/Consumer/Config/ConsumerConfigItem -Magento/Framework/MessageQueue/Publisher/Config/PublisherConfigItem -Magento/Framework/MessageQueue/Topology/Config/ExchangeConfigItem -IntegrationConfig.php +app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php +app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php +app/code/Magento/Catalog/Model/Attribute/Backend/ConsumerWebsiteAssign.php +app/code/Magento/Catalog/Ui/Component/Listing/ +app/code/Magento/Payment/Gateway/Data/Order/AddressAdapter.php +app/code/Magento/SalesRule/Model/CouponRepository.php +app/code/Magento/SalesRule/Test/Unit/Model/Rule/Metadata/_files/MetaData.php +app/code/Magento/Tax/Model/Calculation/UnitBaseCalculator.php +app/code/Magento/Customer/Block/Widget/ +app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php +app/code/Magento/Eav/Model/Api/SearchCriteria/CollectionProcessor/FilterProcessor.php +lib/internal/Magento/Framework/App/AreaList/Proxy.php +lib/internal/Magento/Framework/App/Route/ConfigInterface/Proxy.php +lib/internal/Magento/Framework/Backup/Filesystem/Iterator/Filter.php +app/code/Magento/Theme/Model/Indexer/Design/Config.php +lib/internal/Magento/Framework/Mview/Config/Data/Proxy.php +lib/internal/Magento/Framework/View/File/Collector/Override +lib/internal/Magento/Framework/MessageQueue/Consumer/Config/ConsumerConfigItem/ +lib/internal/Magento/Framework/MessageQueue/Publisher/Config/PublisherConfigItem/Iterator.php +lib/internal/Magento/Framework/MessageQueue/Topology/Config/ExchangeConfigItem/Iterator.php +app/code/Magento/Integration/Model/IntegrationConfig.php *Test.php -setup/performance-toolkit/aggregate-report -Magento/MessageQueue/Setup -Magento/Elasticsearch/Elasticsearch5 Test/_files -Magento/InventoryCatalogAdminUi/Controller/Adminhtml -Magento/InventoryConfigurableProductIndexer/Indexer -Magento/InventoryGroupedProductIndexer/Indexer -Magento/Customer/Model/FileUploaderDataResolver.php -Magento/Customer/Model/Customer/DataProvider.php -Magento/InventoryShippingAdminUi/Ui/DataProvider -Magento/Elasticsearch6/Model/Client -Magento/CatalogSearch/Model/ResourceModel/Fulltext -Magento/Elasticsearch/Model/Layer/Search -Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/FieldName/Resolver -Magento/Elasticsearch6/Model/Client -Magento/Config/App/Config/Type -Magento/InventoryReservationCli/Test/Integration -Magento/InventoryAdminUi/Controller/Adminhtml -Magento/Newsletter/Model/Queue -Magento/Framework/Mail/Template -Magento/CheckoutAgreements/Model/Checkout/Plugin +Test/Unit/_files +Test/Integration/_files +app/code/Magento/Elasticsearch6/Model/Client/Elasticsearch.php +app/code/Magento/Elasticsearch/Elasticsearch5/Model/Adapter/FieldMapper/Product/FieldProvider/FieldType/Resolver/CompositeResolver.php +app/code/Magento/Elasticsearch/Model/Layer/Search/ItemCollectionProvider.php +app/code/Magento/Newsletter/Model/Queue/TransportBuilder.php +app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/attribute/steps/bulk.phtml diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/inventory.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/inventory.txt new file mode 100644 index 0000000000000..0a12e975e097e --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/inventory.txt @@ -0,0 +1,11 @@ +app/code/Magento/InventoryBundleProductIndexer/Indexer/SelectBuilder.php +app/code/Magento/InventoryConfigurableProductIndexer/Indexer/SelectBuilder.php +app/code/Magento/InventoryCatalogAdminUi/Controller/Adminhtml/Source/BulkAssignPost.php +app/code/Magento/InventoryBundleProductIndexer/Indexer/SourceItem/SourceItemIndexer.php +app/code/Magento/InventoryShippingAdminUi/Ui/DataProvider/GetSourcesByOrderIdSkuAndQty.php +app/code/Magento/InventoryBundleProductIndexer/Indexer/SourceItem/SiblingSkuListInStockProvider.php +app/code/Magento/InventoryInStorePickupWebapiExtension/Model/Rest/Swagger/Generator.php +app/code/Magento/InventoryAdminUi/Controller/Adminhtml/Source/MassDisable.php +app/code/Magento/InventoryBundleProductIndexer/Indexer/StockIndexer.php +app/code/Magento/InventoryBundleProductIndexer/Indexer/SelectBuilder.php +app/code/Magento/InventoryConfigurableProductIndexer/Indexer/SourceItem/SiblingSkuListInStockProvider.php diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon index 0bdb5861dbf33..aba7d0b46d297 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon @@ -9,11 +9,11 @@ parameters: - %rootDir%/../../../dev/tests/*/tmp/* - %rootDir%/../../../dev/tests/*/_generated/* - %rootDir%/../../../pub/* - autoload_directories: + scanDirectories: - %rootDir%/../../../dev/tests/static/framework/tests/unit/testsuite/Magento - %rootDir%/../../../dev/tests/integration/framework/tests/unit/testsuite/Magento - %rootDir%/../../../dev/tests/api-functional/_files/Magento - autoload_files: + bootstrapFiles: - %rootDir%/../../../dev/tests/static/framework/autoload.php - %rootDir%/../../../dev/tests/integration/framework/autoload.php - %rootDir%/../../../dev/tests/api-functional/framework/autoload.php @@ -46,7 +46,4 @@ services: errorFormatter.filtered: class: Magento\PhpStan\Formatters\FilteredErrorFormatter arguments: - showTipsOfTheDay: false - checkThisOnly: false - inferPrivatePropertyTypeFromConstructor: true - checkMissingTypehints: %checkMissingTypehints% + tableErrorFormatter: @errorFormatter.table diff --git a/dev/tests/unit/phpunit.xml.dist b/dev/tests/unit/phpunit.xml.dist index 709bb7c1ea95b..c89de486be0e4 100644 --- a/dev/tests/unit/phpunit.xml.dist +++ b/dev/tests/unit/phpunit.xml.dist @@ -45,7 +45,7 @@ </whitelist> </filter> <listeners> - <listener class="Yandex\Allure\Adapter\AllureAdapter"> + <listener class="Yandex\Allure\PhpUnit\AllurePhpUnit"> <arguments> <string>var/allure-results</string> <!-- XML files output directory --> <boolean>true</boolean> <!-- Whether to delete previous results on rerun --> diff --git a/dev/tests/utils/phpunitGroupConfig.php b/dev/tests/utils/phpunitGroupConfig.php new file mode 100644 index 0000000000000..8cc440005381a --- /dev/null +++ b/dev/tests/utils/phpunitGroupConfig.php @@ -0,0 +1,348 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +// @codingStandardsIgnoreStart +/** + * Script to operate on a test suite defined in a phpunit configuration xml or xml.dist file; split the tests + * in the suite into groups by required size; return total number of groups or generate phpunit_<index>.xml file + * that defines a new test suite named group_<index> with tests in group <index> + * + * Common scenario: + * + * 1. Query how many groups in a test suite with a given size --group-size=<size> + * php phpunitGroupConfig.php --get-total --configuration=<path-to-phpunit-xml-dist-file> --test-suite=<name> --group-size=<size> --isolate-tests=<path-to-isolate-tests-file> + * + * 2a. Generate the configuration file for group <index>. <index> must be in range of [1, total number of groups]) + * php phpunitGroupConfig.php --get-group=<index> --configuration=<path-to-phpunit-xml-dist-file> --test-suite=<name> --group-size=<size> --isolate-tests=<path-to-isolate-tests-file> + * + * 2b. Or generate configuration files for all test groups at once + * php phpunitGroupConfig.php --get-group=all --configuration=<path-to-phpunit-xml-dist-file> --test-suite=<name> --group-size=<size> --isolate-tests=<path-to-isolate-tests-file> + * + * 3. PHPUnit command to run tests for group at <index> + * phpunit --configuration <path_to_phpunit_<index>.xml> --testsuite group_<index> + */ + +$scriptName = basename(__FILE__); + +define( + 'USAGE', + <<<USAGE +Usage: +php -f $scriptName + [--get-total] + Option takes no value, when specified, script will return total number of groups for the test suite specified in --test-suite. + It's the default if both --get-total and --get-group are specified or both --get-total and --get-group are not specified. + [--get-group="<positive integer>|all"] + When option takes a positive integer value <i>, script will generate phpunit_<i>.xml file in the same location as the config + file specified in --configuration with a test suite named "group_<i>" which contains the i-th group of tests from the test + suite specified in --test-suite. + When option takes value "all", script will generate config files for all groups at once. + --test-suite="<name>" + Name of test suite to be splitted into groups. + --group-size="<positive integer>" + Number of tests per group. + --configuration="<path>" + Path to phpunit configuration xml or xml.dist file. + [--isolate-tests="<path>"] + Path to a text file containing tests that require group isolation. One test path per line. + +Note: +Script uses getopt() which does not accept " "(space) as a separator for optional values. Use "=" for [--get-group] and [--isolate-tests] instead. +See https://www.php.net/manual/en/function.getopt.php + +USAGE +); +// @codingStandardsIgnoreEnd + +$options = getopt( + '', + [ + 'get-total', + 'get-group::', + 'test-suite:', + 'group-size:', + 'configuration:', + 'isolate-tests::' + ] +); +$requiredOpts = ['test-suite', 'group-size', 'configuration']; + +try { + foreach ($requiredOpts as $opt) { + assertUsage(empty($options[$opt]), "Option --$opt: cannot be empty\n"); + } + + assertUsage(!ctype_digit($options['group-size']), "Option --group-size: must be positive integer\n"); + assertUsage(!realpath($options['configuration']), "Option --configuration: file doesn't exist\n"); + assertUsage( + isset($options['isolate-tests']) && !realpath($options['isolate-tests']), + "Option --isolate-tests: file doesn't exist\n" + ); + $isolateTests = isset($options['isolate-tests']) ? readIsolateTests(realpath($options['isolate-tests'])) : []; + + $generateConfig = null; + $groupIndex = null; + if (isset($options['get-total']) || !isset($options['get-group'])) { + $generateConfig = false; + } else { + assertUsage( + (empty($options['get-group']) || !ctype_digit($options['get-group'])) + && strtolower($options['get-group']) != 'all', + "Option --get-group: must be a positive integer or 'all'\n" + ); + $generateConfig = true; + $groupIndex = strtolower($options['get-group']); + } + + $testSuite = $options['test-suite']; + $groupSize = $options['group-size']; + $configFile = realpath($options['configuration']); + $workingDir = dirname($configFile) . DIRECTORY_SEPARATOR; + + $savedCwd = getcwd(); + chdir($workingDir); + $allTests = getTestList($configFile, $testSuite); + chdir($savedCwd); + list($allRegularTests, $isolateTests) = fuzzyArrayDiff($allTests, $isolateTests); // diff to separate isolated tests + + $totalRegularTests = count($allRegularTests); + if (($totalRegularTests % $groupSize) === 0) { + $totalRegularGroups = $totalRegularTests / $groupSize; + } else { + $totalRegularGroups = (int)($totalRegularTests / $groupSize) + 1; + } + $totalGroups = $totalRegularGroups + count($isolateTests); + assertUsage( + $totalGroups == 0, + "Option --test-suite: no test found for test suite '{$testSuite}'\n" + ); + + if (!$generateConfig) { + print $totalGroups; + exit(0); + } + + if ($groupIndex == 'all') { + $sIndex = 1; + $eIndex = $totalGroups; + } else { + assertUsage( + (int)$groupIndex > $totalGroups, + "Option --get-group: can not be greater than $totalGroups\n" + ); + $sIndex = (int)$groupIndex; + $eIndex = $sIndex; + } + + $successMsg = "PHPUnit configuration files created:\n"; + for ($index = $sIndex; $index < $eIndex + 1; $index++) { + $groupTests = []; + if ($index <= $totalRegularGroups) { + $groupTests = array_chunk($allRegularTests, $groupSize)[$index - 1]; + } else { + $groupTests[] = $isolateTests[$index - $totalRegularGroups - 1]; + } + + $groupConfigFile = $workingDir . 'phpunit_' . $index . '.xml'; + createGroupConfig($configFile, $groupConfigFile, $groupTests, $index); + $successMsg .= "{$groupConfigFile}, group: {$index}, test suite: group_{$index}\n"; + } + print $successMsg; + +} catch (Exception $e) { + print $e->getMessage(); + exit(1); +} + +/** + * Generate a phpunit configuration file for a given group + * + * @param string $in + * @param string $out + * @param array $group + * @param integer $index + * @return void + * @throws Exception + */ +function createGroupConfig($in, $out, $group, $index) +{ + $beforeTestSuites = true; + $afterTestSuites = false; + $outLines = ''; + $inLines = explode("\n", file_get_contents($in)); + foreach ($inLines as $inLine) { + if ($beforeTestSuites) { + // Replacing existing <testsuites> node with new <testsuites> node + preg_match('/<testsuites/', $inLine, $bMatch); + if (isset($bMatch[0])) { + $beforeTestSuites = false; + $outLines .= getFormattedGroup($group, $index); + continue; + } + } + if (!$afterTestSuites) { + preg_match('/<\/\s*testsuites/', $inLine, $aMatch); + if (isset($aMatch[0])) { + $afterTestSuites = true; + continue; + } + } + if ($beforeTestSuites) { + // Adding new <testsuites> node right before </phpunit> if there is no existing <testsuites> node + preg_match('/<\/\s*phpunit/', $inLine, $lMatch); + if (isset($lMatch[0])) { + $outLines .= getFormattedGroup($group, $index); + $outLines .= $inLine . "\n"; + break; + } + } + if ($beforeTestSuites || $afterTestSuites) { + $outLines .= $inLine . "\n"; + } + } + file_put_contents($out, $outLines); +} + +/** + * Format tests in an array into <testsuite> node defined by phpunit xml schema + * + * @param array $group + * @param integer $index + * @return string + */ +function getFormattedGroup($group, $index) +{ + $output = "\t<testsuites>\n"; + $output .= "\t\t<testsuite name=\"group_{$index}\">\n"; + foreach ($group as $ch) { + $output .= "\t\t\t<file>{$ch}</file>\n"; + } + $output .= "\t\t</testsuite>\n"; + $output .= "\t</testsuites>\n"; + return $output; +} + +/** + * Return paths for all tests as an array for a given test suite in a phpunit.xml(.dist) file + * + * @param string $configFile + * @param string $suiteName + * @return array + */ +function getTestList($configFile, $suiteName) +{ + $testCases = []; + $config = simplexml_load_file($configFile); + foreach ($config->xpath('//testsuite') as $testsuite) { + if (strtolower((string)$testsuite['name']) != strtolower($suiteName)) { + continue; + } + foreach ($testsuite->file as $file) { + $testCases[(string)$file] = true; + } + $excludeFiles = []; + foreach ($testsuite->exclude as $excludeFile) { + $excludeFiles[] = (string)$excludeFile; + } + foreach ($testsuite->directory as $directoryPattern) { + foreach (glob($directoryPattern, GLOB_ONLYDIR) as $directory) { + if (!file_exists((string)$directory)) { + continue; + } + $suffix = isset($directory['suffix']) ? (string)$directory['suffix'] : 'Test.php'; + $fileIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator((string)$directory)); + foreach ($fileIterator as $fileInfo) { + $pathToTestCase = (string)$fileInfo; + if (substr_compare($pathToTestCase, $suffix, -strlen($suffix)) === 0 + && !isTestClassAbstract($pathToTestCase) + ) { + $inExclude = false; + foreach ($excludeFiles as $excludeFile) { + if (strpos($pathToTestCase, $excludeFile) !== false) { + $inExclude = true; + break; + } + } + if (!$inExclude) { + $testCases[$pathToTestCase] = true; + } + } + } + } + } + } + $testCases = array_keys($testCases); // automatically avoid file duplications + sort($testCases); + return $testCases; +} + +/** + * Determine if a file contains an abstract class + * + * @param string $testClassPath + * @return bool + */ +function isTestClassAbstract($testClassPath) +{ + return strpos(file_get_contents($testClassPath), "\nabstract class") !== false; +} + +/** + * Return isolation tests as an array by reading from a file + * + * @param string $file + * @return array + */ +function readIsolateTests($file) +{ + $tests = []; + $lines = explode("\n", file_get_contents($file)); + foreach ($lines as $line) { + if (!empty(trim($line)) && substr_compare(trim($line), '#', 0, 1) !== 0) { + $tests[] = trim($line); + } + } + return $tests; +} + +/** + * Array diff based on partial match + * + * @param array $oArray + * @param array $dArray + * @return array + */ +function fuzzyArrayDiff($oArray, $dArray) +{ + $ret1 = []; + $ret2 = []; + foreach ($oArray as $obj) { + $ret1[] = $obj; + foreach ($dArray as $diff) { + if (stripos($obj, $diff) !== false) { + $ret2[] = $obj; + array_pop($ret1); + break; + } + } + } + return [$ret1, $ret2]; +} + +/** + * Assert usage by throwing exception on condition evaluating to true + * + * @param bool $condition + * @param string $error + * @throws Exception + */ +function assertUsage($condition, $error) +{ + if ($condition) { + $error .= "\n" . USAGE; + throw new Exception($error); + } +} diff --git a/lib/internal/Magento/Framework/Api/ImageProcessor.php b/lib/internal/Magento/Framework/Api/ImageProcessor.php index 83390b3853212..fe922735f5a91 100644 --- a/lib/internal/Magento/Framework/Api/ImageProcessor.php +++ b/lib/internal/Magento/Framework/Api/ImageProcessor.php @@ -145,6 +145,8 @@ public function processImageContent($entityType, $imageContent) $fileContent = @base64_decode($imageContent->getBase64EncodedData(), true); $tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::SYS_TMP); $fileName = $this->getFileName($imageContent); + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $tmpFileName = substr(md5(rand()), 0, 7) . '.' . $fileName; $tmpDirectory->writeFile($tmpFileName, $fileContent); diff --git a/lib/internal/Magento/Framework/App/Action/Plugin/ActionFlagNoDispatchPlugin.php b/lib/internal/Magento/Framework/App/Action/Plugin/ActionFlagNoDispatchPlugin.php deleted file mode 100644 index 263e3663513d3..0000000000000 --- a/lib/internal/Magento/Framework/App/Action/Plugin/ActionFlagNoDispatchPlugin.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -declare(strict_types=1); - -namespace Magento\Framework\App\Action\Plugin; - -use Magento\Framework\App\ActionFlag; -use Magento\Framework\App\ActionInterface; -use Magento\Framework\App\ResponseInterface; - -/** - * Do not call Action::execute() if the action flag FLAG_NO_DISPATCH is set. - */ -class ActionFlagNoDispatchPlugin -{ - /** - * @var ActionFlag - */ - private $actionFlag; - - /** - * @var ResponseInterface - */ - private $response; - - /** - * @param ActionFlag $actionFlag - * @param ResponseInterface $response - */ - public function __construct(ActionFlag $actionFlag, ResponseInterface $response) - { - $this->actionFlag = $actionFlag; - $this->response = $response; - } - - /** - * Do not call proceed if the no dispatch action flag is set. - * - * @param ActionInterface $subject - * @param callable $proceed - * @return ResponseInterface - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function aroundExecute(ActionInterface $subject, callable $proceed) - { - return $this->actionFlag->get('', ActionInterface::FLAG_NO_DISPATCH) ? $this->response : $proceed(); - } -} diff --git a/lib/internal/Magento/Framework/App/Action/Plugin/EventDispatchPlugin.php b/lib/internal/Magento/Framework/App/Action/Plugin/EventDispatchPlugin.php deleted file mode 100644 index 7d07d1f4cf457..0000000000000 --- a/lib/internal/Magento/Framework/App/Action/Plugin/EventDispatchPlugin.php +++ /dev/null @@ -1,138 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -declare(strict_types=1); - -namespace Magento\Framework\App\Action\Plugin; - -use Magento\Framework\App\Action\Action; -use Magento\Framework\App\ActionFlag; -use Magento\Framework\App\ActionInterface; -use Magento\Framework\App\Request\Http; -use Magento\Framework\App\RequestInterface; -use Magento\Framework\Controller\ResultInterface; -use Magento\Framework\Event\ManagerInterface; -use Magento\Framework\HTTP\PhpEnvironment\Response; -use Magento\Framework\Profiler; - -/** - * Dispatch the controller_action_predispatch and controller_action_post_dispatch events. - */ -class EventDispatchPlugin -{ - /** - * @var Http|RequestInterface - */ - private $request; - - /** - * @var ManagerInterface - */ - private $eventManager; - - /** - * @var ActionFlag - */ - private $actionFlag; - - /** - * @param RequestInterface $request - * @param ManagerInterface $eventManager - * @param ActionFlag $actionFlag - */ - public function __construct(RequestInterface $request, ManagerInterface $eventManager, ActionFlag $actionFlag) - { - $this->request = $request; - $this->eventManager = $eventManager; - $this->actionFlag = $actionFlag; - } - - /** - * Trigger the controller_action_predispatch events - * - * @param ActionInterface $subject - */ - public function beforeExecute(ActionInterface $subject) - { - $this->dispatchPreDispatchEvents($subject); - } - - /** - * Build the event parameter array - * - * @param ActionInterface $subject - * @return array - */ - private function getEventParameters(ActionInterface $subject): array - { - return ['controller_action' => $subject, 'request' => $this->request]; - } - - /** - * Trigger the controller_action_postdispatch events if the suppressing action flag is not set - * - * @param ActionInterface $subject - * @param ResultInterface|Response|null $result - * @return ResultInterface|Response|null - */ - public function afterExecute(ActionInterface $subject, $result) - { - if (!$this->isSetActionNoPostDispatchFlag()) { - $this->dispatchPostDispatchEvents($subject); - } - - return $result; - } - - /** - * Check if action flags are set that would suppress the post dispatch events. - * - * @return bool - */ - private function isSetActionNoPostDispatchFlag(): bool - { - return $this->actionFlag->get('', Action::FLAG_NO_DISPATCH) || - $this->actionFlag->get('', Action::FLAG_NO_POST_DISPATCH); - } - - /** - * Dispatch the controller_action_predispatch events. - * - * @param ActionInterface $action - */ - private function dispatchPreDispatchEvents(ActionInterface $action) - { - $this->eventManager->dispatch('controller_action_predispatch', $this->getEventParameters($action)); - $this->eventManager->dispatch( - 'controller_action_predispatch_' . $this->request->getRouteName(), - $this->getEventParameters($action) - ); - $this->eventManager->dispatch( - 'controller_action_predispatch_' . $this->request->getFullActionName(), - $this->getEventParameters($action) - ); - } - - /** - * Dispatch the controller_action_postdispatch events. - * - * @param ActionInterface $action - */ - private function dispatchPostDispatchEvents(ActionInterface $action) - { - Profiler::start('postdispatch'); - $this->eventManager->dispatch( - 'controller_action_postdispatch_' . $this->request->getFullActionName(), - $this->getEventParameters($action) - ); - $this->eventManager->dispatch( - 'controller_action_postdispatch_' . $this->request->getRouteName(), - $this->getEventParameters($action) - ); - $this->eventManager->dispatch('controller_action_postdispatch', $this->getEventParameters($action)); - Profiler::stop('postdispatch'); - } -} diff --git a/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php b/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php index f84dd304643da..a11debd80bb40 100644 --- a/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php +++ b/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php @@ -9,8 +9,22 @@ */ namespace Magento\Framework\App\Cache\Frontend; +use Cm_Cache_Backend_File; +use Exception; +use LogicException; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\Cache\Backend\Database; +use Magento\Framework\Cache\Backend\Eaccelerator; +use Magento\Framework\Cache\Backend\RemoteSynchronizedCache; +use Magento\Framework\Cache\Core; +use Magento\Framework\Cache\Frontend\Adapter\Zend; +use Magento\Framework\Cache\FrontendInterface; use Magento\Framework\Filesystem; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Profiler; +use UnexpectedValueException; +use Zend_Cache; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -28,7 +42,7 @@ class Factory const PARAM_CACHE_FORCED_OPTIONS = 'cache_options'; /** - * @var \Magento\Framework\ObjectManagerInterface + * @var ObjectManagerInterface */ private $_objectManager; @@ -75,21 +89,21 @@ class Factory /** * Resource * - * @var \Magento\Framework\App\ResourceConnection + * @var ResourceConnection */ protected $_resource; /** - * @param \Magento\Framework\ObjectManagerInterface $objectManager + * @param ObjectManagerInterface $objectManager * @param Filesystem $filesystem - * @param \Magento\Framework\App\ResourceConnection $resource + * @param ResourceConnection $resource * @param array $enforcedOptions * @param array $decorators */ public function __construct( - \Magento\Framework\ObjectManagerInterface $objectManager, + ObjectManagerInterface $objectManager, Filesystem $filesystem, - \Magento\Framework\App\ResourceConnection $resource, + ResourceConnection $resource, array $enforcedOptions = [], array $decorators = [] ) { @@ -104,7 +118,7 @@ public function __construct( * Return newly created cache frontend instance * * @param array $options - * @return \Magento\Framework\Cache\FrontendInterface + * @return FrontendInterface */ public function create(array $options) { @@ -125,6 +139,8 @@ public function create(array $options) if (empty($idPrefix)) { $configDirPath = $this->_filesystem->getDirectoryRead(DirectoryList::CONFIG)->getAbsolutePath(); $idPrefix = + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction substr(md5($configDirPath), 0, 3) . '_'; } $options['frontend_options']['cache_id_prefix'] = $idPrefix; @@ -139,29 +155,32 @@ public function create(array $options) 'frontend_type' => $frontend['type'], 'backend_type' => $backend['type'], ]; - \Magento\Framework\Profiler::start('cache_frontend_create', $profilerTags); + Profiler::start('cache_frontend_create', $profilerTags); - /** @var $result \Magento\Framework\Cache\Frontend\Adapter\Zend */ - $result = $this->_objectManager->create( - \Magento\Framework\Cache\Frontend\Adapter\Zend::class, - [ - 'frontendFactory' => function () use ($frontend, $backend) { - return \Zend_Cache::factory( - $frontend['type'], - $backend['type'], - $frontend, - $backend['options'], - true, - true, - true - ); - } - ] - ); + try { + $result = $this->_objectManager->create( + Zend::class, + [ + 'frontendFactory' => function () use ($frontend, $backend) { + return Zend_Cache::factory( + $frontend['type'], + $backend['type'], + $frontend, + $backend['options'], + true, + true, + true + ); + }, + ] + ); + } catch (\Exception $e) { + $result = $this->createCacheWithDefaultOptions($options); + } $result = $this->_applyDecorators($result); // stop profiling - \Magento\Framework\Profiler::stop('cache_frontend_create'); + Profiler::stop('cache_frontend_create'); return $result; } @@ -179,24 +198,24 @@ private function _getExpandedOptions(array $options) /** * Apply decorators to a cache frontend instance and return the topmost one * - * @param \Magento\Framework\Cache\FrontendInterface $frontend - * @return \Magento\Framework\Cache\FrontendInterface - * @throws \LogicException - * @throws \UnexpectedValueException + * @param FrontendInterface $frontend + * @return FrontendInterface + * @throws LogicException + * @throws UnexpectedValueException */ - private function _applyDecorators(\Magento\Framework\Cache\FrontendInterface $frontend) + private function _applyDecorators(FrontendInterface $frontend) { foreach ($this->_decorators as $decoratorConfig) { if (!isset($decoratorConfig['class'])) { - throw new \LogicException('Class has to be specified for a cache frontend decorator.'); + throw new LogicException('Class has to be specified for a cache frontend decorator.'); } $decoratorClass = $decoratorConfig['class']; $decoratorParams = isset($decoratorConfig['parameters']) ? $decoratorConfig['parameters'] : []; $decoratorParams['frontend'] = $frontend; // conventionally, 'frontend' argument is a decoration subject $frontend = $this->_objectManager->create($decoratorClass, $decoratorParams); - if (!$frontend instanceof \Magento\Framework\Cache\FrontendInterface) { - throw new \UnexpectedValueException('Decorator has to implement the cache frontend interface.'); + if (!$frontend instanceof FrontendInterface) { + throw new UnexpectedValueException('Decorator has to implement the cache frontend interface.'); } } return $frontend; @@ -258,18 +277,18 @@ protected function _getBackendOptions(array $cacheOptions) case 'varien_cache_backend_eaccelerator': if (extension_loaded('eaccelerator') && ini_get('eaccelerator.enable')) { $enableTwoLevels = true; - $backendType = \Magento\Framework\Cache\Backend\Eaccelerator::class; + $backendType = Eaccelerator::class; } break; case 'database': - $backendType = \Magento\Framework\Cache\Backend\Database::class; + $backendType = Database::class; $options = $this->_getDbAdapterOptions(); break; case 'remote_synchronized_cache': - $backendType = \Magento\Framework\Cache\Backend\RemoteSynchronizedCache::class; - $options['remote_backend'] = \Magento\Framework\Cache\Backend\Database::class; + $backendType = RemoteSynchronizedCache::class; + $options['remote_backend'] = Database::class; $options['remote_backend_options'] = $this->_getDbAdapterOptions(); - $options['local_backend'] = \Cm_Cache_Backend_File::class; + $options['local_backend'] = Cm_Cache_Backend_File::class; $cacheDir = $this->_filesystem->getDirectoryWrite(DirectoryList::CACHE); $options['local_backend_options']['cache_dir'] = $cacheDir->getAbsolutePath(); $cacheDir->create(); @@ -283,7 +302,7 @@ protected function _getBackendOptions(array $cacheOptions) $backendType = $type; } } - } catch (\Exception $e) { + } catch (Exception $e) { } } } @@ -358,7 +377,7 @@ protected function _getTwoLevelsBackendOptions($fastOptions, $cacheOptions) $options['slow_backend_options'] = $this->_backendOptions; } if ($options['slow_backend'] == 'database') { - $options['slow_backend'] = \Magento\Framework\Cache\Backend\Database::class; + $options['slow_backend'] = Database::class; $options['slow_backend_options'] = $this->_getDbAdapterOptions(); if (isset($cacheOptions['slow_backend_store_data'])) { $options['slow_backend_options']['store_data'] = (bool)$cacheOptions['slow_backend_store_data']; @@ -392,8 +411,38 @@ protected function _getFrontendOptions(array $cacheOptions) if (!array_key_exists('automatic_cleaning_factor', $options)) { $options['automatic_cleaning_factor'] = 0; } - $options['type'] = - isset($cacheOptions['frontend']) ? $cacheOptions['frontend'] : \Magento\Framework\Cache\Core::class; + $options['type'] = isset($cacheOptions['frontend']) ? $cacheOptions['frontend'] : Core::class; return $options; } + + /** + * Create frontend cache with default options. + * + * @param array $options + * @return Zend + */ + private function createCacheWithDefaultOptions(array $options): Zend + { + unset($options['backend']); + unset($options['frontend']); + $backend = $this->_getBackendOptions($options); + $frontend = $this->_getFrontendOptions($options); + + return $this->_objectManager->create( + Zend::class, + [ + 'frontendFactory' => function () use ($frontend, $backend) { + return Zend_Cache::factory( + $frontend['type'], + $backend['type'], + $frontend, + $backend['options'], + true, + true, + true + ); + }, + ] + ); + } } diff --git a/lib/internal/Magento/Framework/App/Filesystem/DirectoryResolver.php b/lib/internal/Magento/Framework/App/Filesystem/DirectoryResolver.php index c756fb43cf584..de2deb195cf05 100644 --- a/lib/internal/Magento/Framework/App/Filesystem/DirectoryResolver.php +++ b/lib/internal/Magento/Framework/App/Filesystem/DirectoryResolver.php @@ -52,7 +52,7 @@ public function validatePath($path, $directoryConfig = DirectoryList::MEDIA) { $directory = $this->filesystem->getDirectoryWrite($directoryConfig); $realPath = $directory->getDriver()->getRealPathSafety($path); - $root = $directory->getAbsolutePath(); + $root = rtrim($directory->getAbsolutePath(), DIRECTORY_SEPARATOR); return strpos($realPath, $root) === 0; } diff --git a/lib/internal/Magento/Framework/App/FrontController.php b/lib/internal/Magento/Framework/App/FrontController.php index d72c548be4fba..f80d17c072f94 100644 --- a/lib/internal/Magento/Framework/App/FrontController.php +++ b/lib/internal/Magento/Framework/App/FrontController.php @@ -10,9 +10,11 @@ use Magento\Framework\App\Request\InvalidRequestException; use Magento\Framework\App\Request\ValidatorInterface as RequestValidator; use Magento\Framework\Controller\ResultInterface; +use Magento\Framework\Event\ManagerInterface as EventManagerInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\Message\ManagerInterface as MessageManager; +use Magento\Framework\Profiler; use Psr\Log\LoggerInterface; /** @@ -62,14 +64,32 @@ class FrontController implements FrontControllerInterface */ private $areaList; + /** + * @var ActionFlag + */ + private $actionFlag; + + /** + * @var EventManagerInterface + */ + private $eventManager; + + /** + * @var RequestInterface + */ + private $request; + /** * @param RouterListInterface $routerList * @param ResponseInterface $response * @param RequestValidator|null $requestValidator * @param MessageManager|null $messageManager * @param LoggerInterface|null $logger - * @param State $appState - * @param AreaList $areaList + * @param State|null $appState + * @param AreaList|null $areaList + * @param ActionFlag|null $actionFlag + * @param EventManagerInterface|null $eventManager + * @param RequestInterface|null $request */ public function __construct( RouterListInterface $routerList, @@ -78,7 +98,10 @@ public function __construct( ?MessageManager $messageManager = null, ?LoggerInterface $logger = null, ?State $appState = null, - ?AreaList $areaList = null + ?AreaList $areaList = null, + ?ActionFlag $actionFlag = null, + ?EventManagerInterface $eventManager = null, + ?RequestInterface $request = null ) { $this->_routerList = $routerList; $this->response = $response; @@ -92,6 +115,12 @@ public function __construct( ?? ObjectManager::getInstance()->get(State::class); $this->areaList = $areaList ?? ObjectManager::getInstance()->get(AreaList::class); + $this->actionFlag = $actionFlag + ?? ObjectManager::getInstance()->get(ActionFlag::class); + $this->eventManager = $eventManager + ?? ObjectManager::getInstance()->get(EventManagerInterface::class); + $this->request = $request + ?? ObjectManager::getInstance()->get(RequestInterface::class); } /** @@ -104,7 +133,7 @@ public function __construct( */ public function dispatch(RequestInterface $request) { - \Magento\Framework\Profiler::start('routers_match'); + Profiler::start('routers_match'); $this->validatedRequest = false; $routingCycleCounter = 0; $result = null; @@ -128,7 +157,7 @@ public function dispatch(RequestInterface $request) } } } - \Magento\Framework\Profiler::stop('routers_match'); + Profiler::stop('routers_match'); if ($routingCycleCounter > 100) { throw new \LogicException('Front controller reached 100 router match iterations'); } @@ -138,7 +167,7 @@ public function dispatch(RequestInterface $request) /** * Process (validate and dispatch) the incoming request * - * @param HttpRequest $request + * @param RequestInterface $request * @param ActionInterface $actionInstance * @return ResponseInterface|ResultInterface * @throws LocalizedException @@ -146,7 +175,7 @@ public function dispatch(RequestInterface $request) * @throws NotFoundException */ private function processRequest( - HttpRequest $request, + RequestInterface $request, ActionInterface $actionInstance ) { $request->setDispatched(true); @@ -155,22 +184,19 @@ private function processRequest( //Validating a request only once. if (!$this->validatedRequest) { + $area = $this->areaList->getArea($this->appState->getAreaCode()); + $area->load(Area::PART_DESIGN); + $area->load(Area::PART_TRANSLATE); + try { - $this->requestValidator->validate( - $request, - $actionInstance - ); + $this->requestValidator->validate($request, $actionInstance); } catch (InvalidRequestException $exception) { //Validation failed - processing validation results. $this->logger->debug( - 'Request validation failed for action "' - . get_class($actionInstance) . '"', + sprintf('Request validation failed for action "%s"', get_class($actionInstance)), ["exception" => $exception] ); $result = $exception->getReplaceResult(); - $area = $this->areaList->getArea($this->appState->getAreaCode()); - $area->load(Area::PART_DESIGN); - $area->load(Area::PART_TRANSLATE); if ($messages = $exception->getMessages()) { foreach ($messages as $message) { $this->messages->addErrorMessage($message); @@ -180,12 +206,12 @@ private function processRequest( $this->validatedRequest = true; } - //Validation did not produce a result to replace the action's. + // Validation did not produce a result to replace the action's. if (!$result) { - if ($actionInstance instanceof AbstractAction) { - $result = $actionInstance->dispatch($request); - } else { - $result = $actionInstance->execute(); + $this->dispatchPreDispatchEvents($actionInstance, $request); + $result = $this->getActionResponse($actionInstance, $request); + if (!$this->isSetActionNoPostDispatchFlag()) { + $this->dispatchPostDispatchEvents($actionInstance, $request); } } @@ -195,4 +221,98 @@ private function processRequest( } return $result; } + + /** + * Return the result of processed request + * + * There are 3 ways of handling requests: + * - Result without dispatching event when FLAG_NO_DISPATCH is set, just return ResponseInterface + * - Backwards-compatible way using `AbstractAction::dispatch` which is deprecated + * - Correct way for handling requests with `ActionInterface::execute` + * + * @param ActionInterface $actionInstance + * @param RequestInterface $request + * @return ResponseInterface|ResultInterface + * @throws NotFoundException + */ + private function getActionResponse(ActionInterface $actionInstance, RequestInterface $request) + { + if ($this->actionFlag->get('', ActionInterface::FLAG_NO_DISPATCH)) { + return $this->response; + } + + if ($actionInstance instanceof AbstractAction) { + return $actionInstance->dispatch($request); + } + + return $actionInstance->execute(); + } + + /** + * Check if action flags are set that would suppress the post dispatch events. + * + * @return bool + */ + private function isSetActionNoPostDispatchFlag(): bool + { + return $this->actionFlag->get('', ActionInterface::FLAG_NO_DISPATCH) + || $this->actionFlag->get('', ActionInterface::FLAG_NO_POST_DISPATCH); + } + + /** + * Dispatch the controller_action_predispatch events. + * + * @param ActionInterface $actionInstance + * @param RequestInterface $request + * @return void + */ + private function dispatchPreDispatchEvents(ActionInterface $actionInstance, RequestInterface $request): void + { + $this->eventManager->dispatch('controller_action_predispatch', $this->getEventParameters($actionInstance)); + if ($this->request instanceof HttpRequest) { + $this->eventManager->dispatch( + 'controller_action_predispatch_' . $request->getRouteName(), + $this->getEventParameters($actionInstance) + ); + $this->eventManager->dispatch( + 'controller_action_predispatch_' . $request->getFullActionName(), + $this->getEventParameters($actionInstance) + ); + } + } + + /** + * Dispatch the controller_action_postdispatch events. + * + * @param ActionInterface $actionInstance + * @param RequestInterface $request + * @return void + */ + private function dispatchPostDispatchEvents(ActionInterface $actionInstance, RequestInterface $request): void + { + Profiler::start('postdispatch'); + if ($this->request instanceof HttpRequest) { + $this->eventManager->dispatch( + 'controller_action_postdispatch_' . $request->getFullActionName(), + $this->getEventParameters($actionInstance) + ); + $this->eventManager->dispatch( + 'controller_action_postdispatch_' . $request->getRouteName(), + $this->getEventParameters($actionInstance) + ); + } + $this->eventManager->dispatch('controller_action_postdispatch', $this->getEventParameters($actionInstance)); + Profiler::stop('postdispatch'); + } + + /** + * Build the event parameter array + * + * @param ActionInterface $subject + * @return array + */ + private function getEventParameters(ActionInterface $subject): array + { + return ['controller_action' => $subject, 'request' => $this->request]; + } } diff --git a/lib/internal/Magento/Framework/App/PageCache/Version.php b/lib/internal/Magento/Framework/App/PageCache/Version.php index 71c4a913cea44..55c7d37c56a11 100644 --- a/lib/internal/Magento/Framework/App/PageCache/Version.php +++ b/lib/internal/Magento/Framework/App/PageCache/Version.php @@ -6,8 +6,9 @@ namespace Magento\Framework\App\PageCache; /** - * Class Version + * PageCache Version * + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class Version { @@ -62,6 +63,7 @@ public function __construct( */ protected function generateValue() { + //phpcs:ignore return md5(rand() . time()); } @@ -80,7 +82,8 @@ public function process() ->setDuration(self::COOKIE_PERIOD) ->setPath('/') ->setSecure($this->request->isSecure()) - ->setHttpOnly(false); + ->setHttpOnly(false) + ->setSameSite('Lax'); $this->cookieManager->setPublicCookie(self::COOKIE_NAME, $this->generateValue(), $publicCookieMetadata); } } diff --git a/lib/internal/Magento/Framework/App/Response/Http.php b/lib/internal/Magento/Framework/App/Response/Http.php index a88c6d2f052c4..dbe745b6fb239 100644 --- a/lib/internal/Magento/Framework/App/Response/Http.php +++ b/lib/internal/Magento/Framework/App/Response/Http.php @@ -109,7 +109,9 @@ public function sendVary() if ($varyString) { $cookieLifeTime = $this->sessionConfig->getCookieLifetime(); $sensitiveCookMetadata = $this->cookieMetadataFactory->createSensitiveCookieMetadata( - [CookieMetadata::KEY_DURATION => $cookieLifeTime] + [CookieMetadata::KEY_DURATION => $cookieLifeTime, + CookieMetadata::KEY_SAME_SITE => 'Lax' + ] )->setPath('/'); $this->cookieManager->setSensitiveCookie(self::COOKIE_VARY_STRING, $varyString, $sensitiveCookMetadata); } elseif ($this->request->get(self::COOKIE_VARY_STRING)) { diff --git a/lib/internal/Magento/Framework/App/Router/Base.php b/lib/internal/Magento/Framework/App/Router/Base.php index a0a3f6f8fd4aa..38db2df359c09 100644 --- a/lib/internal/Magento/Framework/App/Router/Base.php +++ b/lib/internal/Magento/Framework/App/Router/Base.php @@ -179,7 +179,7 @@ protected function parseRequest(\Magento\Framework\App\RequestInterface $request $path = trim($request->getPathInfo(), '/'); - $params = explode('/', $path ? $path : $this->pathConfig->getDefaultPath()); + $params = explode('/', strlen($path) ? $path : $this->pathConfig->getDefaultPath()); foreach ($this->_requiredParams as $paramName) { $output[$paramName] = array_shift($params); } @@ -202,15 +202,16 @@ protected function matchModuleFrontName(\Magento\Framework\App\RequestInterface // get module name if ($request->getModuleName()) { $moduleFrontName = $request->getModuleName(); - } elseif (!empty($param)) { + } elseif (strlen((string) $param)) { $moduleFrontName = $param; } else { $moduleFrontName = $this->_defaultPath->getPart('module'); $request->setAlias(\Magento\Framework\Url::REWRITE_REQUEST_PATH_ALIAS, ''); + if (!$moduleFrontName) { + return null; + } } - if (!$moduleFrontName) { - return null; - } + return $moduleFrontName; } @@ -270,7 +271,7 @@ protected function getNotFoundAction($currentModuleName) protected function matchAction(\Magento\Framework\App\RequestInterface $request, array $params) { $moduleFrontName = $this->matchModuleFrontName($request, $params['moduleFrontName']); - if (empty($moduleFrontName)) { + if (!strlen((string) $moduleFrontName)) { return null; } @@ -278,7 +279,6 @@ protected function matchAction(\Magento\Framework\App\RequestInterface $request, * Searching router args by module name from route using it as key */ $modules = $this->_routeConfig->getModulesByFrontName($moduleFrontName); - if (empty($modules) === true) { return null; } diff --git a/lib/internal/Magento/Framework/App/StaticResource.php b/lib/internal/Magento/Framework/App/StaticResource.php index 9befb1e0fa9e5..45eebe3ecbab8 100644 --- a/lib/internal/Magento/Framework/App/StaticResource.php +++ b/lib/internal/Magento/Framework/App/StaticResource.php @@ -11,6 +11,7 @@ use Magento\Framework\Config\ConfigOptionsListConstants; use Psr\Log\LoggerInterface; use Magento\Framework\Debug; +use Magento\Framework\Filesystem\Driver\File; /** * Entry point for retrieving static resources like JS, CSS, images by requested public path @@ -74,6 +75,11 @@ class StaticResource implements \Magento\Framework\AppInterface */ private $logger; + /** + * @var File + */ + private $driver; + /** * @param State $state * @param Response\FileInterface $response @@ -84,6 +90,9 @@ class StaticResource implements \Magento\Framework\AppInterface * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param ConfigLoaderInterface $configLoader * @param DeploymentConfig|null $deploymentConfig + * @param File|null $driver + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( State $state, @@ -94,7 +103,8 @@ public function __construct( \Magento\Framework\Module\ModuleList $moduleList, \Magento\Framework\ObjectManagerInterface $objectManager, ConfigLoaderInterface $configLoader, - DeploymentConfig $deploymentConfig = null + DeploymentConfig $deploymentConfig = null, + File $driver = null ) { $this->state = $state; $this->response = $response; @@ -105,6 +115,7 @@ public function __construct( $this->objectManager = $objectManager; $this->configLoader = $configLoader; $this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class); + $this->driver = $driver ?: ObjectManager::getInstance()->get(File::class); } /** @@ -183,9 +194,9 @@ public function catchException(Bootstrap $bootstrap, \Exception $exception) */ protected function parsePath($path) { - $path = ltrim($path, '/'); - $parts = explode('/', $path, 6); - if (count($parts) < 5 || preg_match('/\.\.(\\\|\/)/', $path)) { + $safePath = $this->driver->getRealPathSafety(ltrim($path, '/')); + $parts = explode('/', $safePath, 6); + if (count($parts) < 5) { //Checking that path contains all required parts and is not above static folder. throw new \InvalidArgumentException("Requested path '$path' is wrong."); } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php b/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php index cfeb806bb3030..fdb109ce30708 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php @@ -8,16 +8,19 @@ namespace Magento\Framework\App\Test\Unit; use Magento\Framework\App\Action\Action; +use Magento\Framework\App\ActionFlag; use Magento\Framework\App\Area; use Magento\Framework\App\AreaInterface; use Magento\Framework\App\AreaList; use Magento\Framework\App\FrontController; use Magento\Framework\App\Request\InvalidRequestException; use Magento\Framework\App\Request\ValidatorInterface; +use Magento\Framework\App\RequestInterface; use Magento\Framework\App\Response\Http; use Magento\Framework\App\RouterInterface; use Magento\Framework\App\RouterList; use Magento\Framework\App\State; +use Magento\Framework\Event\ManagerInterface as EventManager; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\Message\ManagerInterface as MessageManager; use Magento\Framework\Phrase; @@ -103,6 +106,9 @@ protected function setUp(): void ->getMock(); $this->areaListMock = $this->createMock(AreaList::class); $this->areaMock = $this->getMockForAbstractClass(AreaInterface::class); + $actionFlagMock = $this->createMock(ActionFlag::class); + $eventManagerMock = $this->createMock(EventManager::class); + $requestMock = $this->createMock(RequestInterface::class); $this->model = new FrontController( $this->routerList, $this->response, @@ -110,7 +116,10 @@ protected function setUp(): void $this->messages, $this->logger, $this->appStateMock, - $this->areaListMock + $this->areaListMock, + $actionFlagMock, + $eventManagerMock, + $requestMock ); } @@ -217,7 +226,10 @@ public function testDispatched() $this->routerList->expects($this->any()) ->method('current') ->willReturn($this->router); - + $this->appStateMock->expects($this->any())->method('getAreaCode')->willReturn('frontend'); + $this->areaMock->expects($this->at(0))->method('load')->with(Area::PART_DESIGN)->willReturnSelf(); + $this->areaMock->expects($this->at(1))->method('load')->with(Area::PART_TRANSLATE)->willReturnSelf(); + $this->areaListMock->expects($this->any())->method('getArea')->willReturn($this->areaMock); $this->request->expects($this->at(0))->method('isDispatched')->willReturn(false); $this->request->expects($this->at(1))->method('setDispatched')->with(true); $this->request->expects($this->at(2))->method('isDispatched')->willReturn(true); @@ -252,6 +264,10 @@ public function testDispatchedNotFoundException() ->method('current') ->willReturn($this->router); + $this->appStateMock->expects($this->any())->method('getAreaCode')->willReturn('frontend'); + $this->areaMock->expects($this->at(0))->method('load')->with(Area::PART_DESIGN)->willReturnSelf(); + $this->areaMock->expects($this->at(1))->method('load')->with(Area::PART_TRANSLATE)->willReturnSelf(); + $this->areaListMock->expects($this->any())->method('getArea')->willReturn($this->areaMock); $this->request->expects($this->at(0))->method('isDispatched')->willReturn(false); $this->request->expects($this->at(1))->method('initForward'); $this->request->expects($this->at(2))->method('setActionName')->with('noroute'); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/VersionTest.php b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/VersionTest.php index bf03f7deae944..500140bbaeeaf 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/VersionTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/VersionTest.php @@ -104,6 +104,10 @@ public function testProcess($isPost) ->method('setHttpOnly') ->with(false)->willReturnSelf(); + $publicCookieMetadataMock->expects($this->once()) + ->method('setSameSite') + ->with('Lax')->willReturnSelf(); + $this->cookieMetadataFactoryMock->expects($this->once()) ->method('createPublicCookieMetadata') ->with() diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php index edfb7e8715506..35bb99ea3cc8b 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php @@ -146,7 +146,12 @@ public function testSendVary() $this->cookieMetadataFactoryMock->expects($this->once()) ->method('createSensitiveCookieMetadata') - ->with([CookieMetadata::KEY_DURATION => $this->cookieLifeTime]) + ->with( + [ + CookieMetadata::KEY_DURATION => $this->cookieLifeTime, + CookieMetadata::KEY_SAME_SITE => 'Lax' + ] + ) ->willReturn($sensitiveCookieMetadataMock); $this->cookieManagerMock->expects($this->once()) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Router/BaseTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Router/BaseTest.php index 0c7454768b5f5..8a963780624d8 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Router/BaseTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Router/BaseTest.php @@ -1,49 +1,40 @@ -<?php declare(strict_types=1); +<?php /** - * Tests Magento\Framework\App\Router\Base - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Framework\App\Test\Unit\Router; -use Magento\Framework\App\Action\Action; use Magento\Framework\App\ActionFactory; +use Magento\Framework\App\ActionInterface; use Magento\Framework\App\DefaultPathInterface; use Magento\Framework\App\Request\Http; +use Magento\Framework\App\ResponseFactory; use Magento\Framework\App\Route\ConfigInterface; use Magento\Framework\App\Router\ActionList; use Magento\Framework\App\Router\Base; -use Magento\Framework\App\State; +use Magento\Framework\App\Router\PathConfigInterface; use Magento\Framework\Code\NameBuilder; -use Magento\Framework\TestFramework\Unit\BaseTestCase; +use Magento\Framework\UrlInterface; use PHPUnit\Framework\MockObject\MockObject; /** * Base router unit test. */ -class BaseTest extends BaseTestCase +class BaseTest extends \PHPUnit\Framework\TestCase { /** * @var Base */ private $model; - /** - * @var MockObject|Http - */ - private $requestMock; - /** * @var MockObject|ConfigInterface */ private $routeConfigMock; - /** - * @var MockObject|State - */ - private $appStateMock; - /** * @var MockObject|ActionList */ @@ -64,175 +55,241 @@ class BaseTest extends BaseTestCase */ private $defaultPathMock; + /** + * @var MockObject|ResponseFactory + */ + private $responseFactoryMock; + + /** + * @var MockObject|UrlInterface + */ + private $urlMock; + + /** + * @var MockObject|PathConfigInterface + */ + private $pathConfigMock; + protected function setUp(): void { - parent::setUp(); - // Create mocks - $this->requestMock = $this->basicMock(Http::class); - $this->routeConfigMock = $this->basicMock(ConfigInterface::class); - $this->appStateMock = $this->getMockBuilder(State::class) - ->addMethods(['isInstalled']) - ->disableOriginalConstructor() - ->getMock(); - $this->actionListMock = $this->basicMock(ActionList::class); - $this->actionFactoryMock = $this->basicMock(ActionFactory::class); - $this->nameBuilderMock = $this->basicMock(NameBuilder::class); - $this->defaultPathMock = $this->basicMock(DefaultPathInterface::class); - - // Prepare SUT - $mocks = [ - 'actionList' => $this->actionListMock, - 'actionFactory' => $this->actionFactoryMock, - 'routeConfig' => $this->routeConfigMock, - 'appState' => $this->appStateMock, - 'nameBuilder' => $this->nameBuilderMock, - 'defaultPath' => $this->defaultPathMock, - ]; - $this->model = $this->objectManager->getObject(Base::class, $mocks); - } + $this->routeConfigMock = $this->createMock(ConfigInterface::class); + $this->actionListMock = $this->createMock(ActionList::class); + $this->actionFactoryMock = $this->createMock(ActionFactory::class); + $this->nameBuilderMock = $this->createMock(NameBuilder::class); + $this->defaultPathMock = $this->createMock(DefaultPathInterface::class); + $this->responseFactoryMock = $this->createMock(ResponseFactory::class); + $this->urlMock = $this->createMock(UrlInterface::class); + $this->pathConfigMock = $this->createMock(PathConfigInterface::class); - public function testMatch() - { - // Test Data - $actionInstance = 'action instance'; - $moduleFrontName = 'module front name'; - $actionPath = 'action path'; - $actionName = 'action name'; - $actionClassName = Action::class; - $moduleName = 'module name'; - $moduleList = [$moduleName]; - $paramList = $moduleFrontName . '/' . $actionPath . '/' . $actionName . '/key/val/key2/val2/'; - - // Stubs - $this->requestMock->expects($this->any())->method('getModuleName')->willReturn($moduleFrontName); - $this->requestMock->expects($this->any())->method('getControllerName')->willReturn($actionPath); - $this->requestMock->expects($this->any())->method('getActionName')->willReturn($actionName); - $this->requestMock->expects($this->any())->method('getPathInfo')->willReturn($paramList); - $this->routeConfigMock->expects($this->any())->method('getModulesByFrontName')->willReturn($moduleList); - $this->appStateMock->expects($this->any())->method('isInstalled')->willReturn(true); - $this->actionListMock->expects($this->any())->method('get')->willReturn($actionClassName); - $this->actionFactoryMock->expects($this->any())->method('create')->willReturn($actionInstance); - - // Expectations and Test - $this->requestExpects('setModuleName', $moduleFrontName) - ->requestExpects('setControllerName', $actionPath) - ->requestExpects('setActionName', $actionName) - ->requestExpects('setControllerModule', $moduleName); - - $this->assertSame($actionInstance, $this->model->match($this->requestMock)); + $this->model = new Base( + $this->actionListMock, + $this->actionFactoryMock, + $this->defaultPathMock, + $this->responseFactoryMock, + $this->routeConfigMock, + $this->urlMock, + $this->nameBuilderMock, + $this->pathConfigMock + ); } - public function testMatchUseParams() - { - // Test Data - $actionInstance = 'action instance'; - $moduleFrontName = 'module front name'; - $actionPath = 'action path'; - $actionName = 'action name'; - $actionClassName = Action::class; - $moduleName = 'module name'; - $moduleList = [$moduleName]; - $paramList = $moduleFrontName . '/' . $actionPath . '/' . $actionName . '/key/val/key2/val2/'; - - // Stubs - $this->requestMock->expects($this->any())->method('getPathInfo')->willReturn($paramList); - $this->routeConfigMock->expects($this->any())->method('getModulesByFrontName')->willReturn($moduleList); - $this->appStateMock->expects($this->any())->method('isInstalled')->willReturn(false); - $this->actionListMock->expects($this->any())->method('get')->willReturn($actionClassName); - $this->actionFactoryMock->expects($this->any())->method('create')->willReturn($actionInstance); - - // Expectations and Test - $this->requestExpects('setModuleName', $moduleFrontName) - ->requestExpects('setControllerName', $actionPath) - ->requestExpects('setActionName', $actionName) - ->requestExpects('setControllerModule', $moduleName); - - $this->assertSame($actionInstance, $this->model->match($this->requestMock)); + /** + * @dataProvider matchDataProvider + * @param MockObject|Http $requestMock + * @param string $defaultPath + * @param string $moduleFrontName + * @param string|null $actionPath + * @param string|null $actionName + * @param string|null $moduleName + */ + public function testMatch( + MockObject $requestMock, + string $defaultPath, + string $moduleFrontName, + ?string $actionPath, + ?string $actionName, + ?string $moduleName + ) { + $actionInstance = 'Magento_TestFramework_ActionInstance'; + + $defaultReturnMap = [ + ['module', $moduleFrontName], + ['controller', $actionPath], + ['action', $actionName], + ]; + $this->defaultPathMock->method('getPart') + ->willReturnMap($defaultReturnMap); + $this->pathConfigMock->method('getDefaultPath') + ->willReturn($defaultPath); + $this->routeConfigMock->expects($this->once()) + ->method('getModulesByFrontName') + ->with($moduleFrontName) + ->willReturn([$moduleName]); + + $actionMock = $this->getMockBuilder(ActionInterface::class) + ->setMockClassName($actionInstance) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->actionListMock->expects($this->once()) + ->method('get') + ->with($moduleName) + ->willReturn($actionInstance); + $this->actionFactoryMock->expects($this->once()) + ->method('create') + ->with($actionInstance) + ->willReturn($actionMock); + + $requestMock->expects($this->once())->method('setModuleName')->with($moduleFrontName); + $requestMock->expects($this->once())->method('setControllerName')->with($actionPath); + $requestMock->expects($this->once())->method('setActionName')->with($actionName); + $requestMock->expects($this->once())->method('setControllerModule')->with($moduleName); + + $this->assertEquals($actionMock, $this->model->match($requestMock)); } - public function testMatchUseDefaultPath() + public function matchDataProvider(): array { - // Test Data - $actionInstance = 'action instance'; - $moduleFrontName = 'module front name'; - $actionPath = 'action path'; - $actionName = 'action name'; - $actionClassName = Action::class; - $moduleName = 'module name'; - $moduleList = [$moduleName]; - $paramList = $moduleFrontName . '/' . $actionPath . '/' . $actionName . '/key/val/key2/val2/'; + $moduleFrontName = 'module_front_name'; + $actionPath = 'action_path'; + $actionName = 'action_name'; + $moduleName = 'module_name'; + + $requestMock = $this->createMock(Http::class); + $requestMock->expects($this->atLeastOnce())->method('getModuleName')->willReturn($moduleFrontName); + $requestMock->expects($this->atLeastOnce())->method('getControllerName')->willReturn($actionPath); + $requestMock->expects($this->atLeastOnce())->method('getActionName')->willReturn($actionName); + $requestMock->expects($this->atLeastOnce()) + ->method('getPathInfo') + ->willReturn($moduleFrontName . '/' . $actionPath . '/' . $actionName . '/key/val/key2/val2/'); + + $emptyRequestMock = $this->createMock(Http::class); + $emptyRequestMock->expects($this->atLeastOnce())->method('getModuleName')->willReturn(''); + $emptyRequestMock->expects($this->atLeastOnce())->method('getControllerName')->willReturn(''); + $emptyRequestMock->expects($this->atLeastOnce())->method('getActionName')->willReturn(''); + $emptyRequestMock->expects($this->atLeastOnce())->method('getPathInfo')->willReturn(''); - // Stubs + $emptyRequestMock2 = $this->createMock(Http::class); + $emptyRequestMock2->expects($this->atLeastOnce())->method('getModuleName')->willReturn(''); + $emptyRequestMock2->expects($this->atLeastOnce())->method('getControllerName')->willReturn(''); + $emptyRequestMock2->expects($this->atLeastOnce())->method('getActionName')->willReturn(''); + $emptyRequestMock2->expects($this->atLeastOnce())->method('getPathInfo')->willReturn(''); + $emptyRequestMock2->expects($this->atLeastOnce())->method('getOriginalPathInfo')->willReturn(''); + + return [ + [ + $requestMock, + 'val1/val2/val3/', + $moduleFrontName, + $actionPath, + $actionName, + $moduleName + ], + [ + $emptyRequestMock, + $moduleFrontName . '/' . $actionPath . '/' . $actionName . '/key/val/key2/val2/', + $moduleFrontName, + $actionPath, + $actionName, + $moduleName + ], + [ + $emptyRequestMock2, + '', + $moduleFrontName, + $actionPath, + $actionName, + $moduleName + ], + ]; + } + + /** + * @dataProvider matchEmptyActionDataProvider + * @param MockObject|Http $requestMock + * @param string $defaultPath + * @param string $moduleFrontName + * @param string|null $actionPath + * @param string|null $actionName + * @param string|null $moduleName + */ + public function testMatchEmptyAction( + MockObject $requestMock, + string $defaultPath, + string $moduleFrontName, + ?string $actionPath, + ?string $actionName, + ?string $moduleName + ) { $defaultReturnMap = [ ['module', $moduleFrontName], ['controller', $actionPath], ['action', $actionName], ]; - $this->requestMock->expects($this->any())->method('getPathInfo')->willReturn($paramList); - $this->defaultPathMock->expects($this->any())->method('getPart')->willReturnMap($defaultReturnMap); - $this->routeConfigMock->expects($this->any())->method('getModulesByFrontName')->willReturn($moduleList); - $this->appStateMock->expects($this->any())->method('isInstalled')->willReturn(false); - $this->actionListMock->expects($this->any())->method('get')->willReturn($actionClassName); - $this->actionFactoryMock->expects($this->any())->method('create')->willReturn($actionInstance); - - // Expectations and Test - $this->requestExpects('setModuleName', $moduleFrontName) - ->requestExpects('setControllerName', $actionPath) - ->requestExpects('setActionName', $actionName) - ->requestExpects('setControllerModule', $moduleName); - - $this->assertSame($actionInstance, $this->model->match($this->requestMock)); - } + $this->defaultPathMock->method('getPart') + ->willReturnMap($defaultReturnMap); + $this->pathConfigMock->method('getDefaultPath') + ->willReturn($defaultPath); - public function testMatchEmptyModuleList() - { - // Test Data - $actionInstance = 'action instance'; - $moduleFrontName = 'module front name'; - $actionPath = 'action path'; - $actionName = 'action name'; - $actionClassName = Action::class; - $emptyModuleList = []; - $paramList = $moduleFrontName . '/' . $actionPath . '/' . $actionName . '/key/val/key2/val2/'; - - // Stubs - $this->requestMock->expects($this->any())->method('getModuleName')->willReturn($moduleFrontName); - $this->requestMock->expects($this->any())->method('getPathInfo')->willReturn($paramList); - $this->routeConfigMock->expects($this->any())->method('getModulesByFrontName')->willReturn($emptyModuleList); - $this->requestMock->expects($this->any())->method('getControllerName')->willReturn($actionPath); - $this->requestMock->expects($this->any())->method('getActionName')->willReturn($actionName); - $this->appStateMock->expects($this->any())->method('isInstalled')->willReturn(false); - $this->actionListMock->expects($this->any())->method('get')->willReturn($actionClassName); - $this->actionFactoryMock->expects($this->any())->method('create')->willReturn($actionInstance); - - // Test - $this->assertNull($this->model->match($this->requestMock)); + $this->routeConfigMock->expects($this->once()) + ->method('getModulesByFrontName') + ->with($moduleFrontName) + ->willReturn($moduleName ? [$moduleName] : []); + $this->actionFactoryMock->expects($this->never()) + ->method('create'); + + $this->assertNull($this->model->match($requestMock)); } - public function testMatchEmptyActionInstance() + public function matchEmptyActionDataProvider(): array { - // Test Data - $nullActionInstance = null; - $moduleFrontName = 'module front name'; - $actionPath = 'action path'; - $actionName = 'action name'; - $actionClassName = Action::class; - $moduleName = 'module name'; - $moduleList = [$moduleName]; - $paramList = $moduleFrontName . '/' . $actionPath . '/' . $actionName . '/key/val/key2/val2/'; - - // Stubs - $this->requestMock->expects($this->any())->method('getModuleName')->willReturn($moduleFrontName); - $this->requestMock->expects($this->any())->method('getPathInfo')->willReturn($paramList); - $this->routeConfigMock->expects($this->any())->method('getModulesByFrontName')->willReturn($moduleList); - $this->requestMock->expects($this->any())->method('getControllerName')->willReturn($actionPath); - $this->requestMock->expects($this->any())->method('getActionName')->willReturn($actionName); - $this->appStateMock->expects($this->any())->method('isInstalled')->willReturn(false); - $this->actionListMock->expects($this->any())->method('get')->willReturn($actionClassName); - $this->actionFactoryMock->expects($this->any())->method('create')->willReturn($nullActionInstance); - - // Expectations and Test - $this->assertNull($this->model->match($this->requestMock)); + $moduleFrontName = 'module_front_name'; + $actionPath = 'action_path'; + $actionName = 'action_name'; + + $requestMock1 = $this->createMock(Http::class); + $requestMock1->expects($this->atLeastOnce())->method('getModuleName')->willReturn($moduleFrontName); + $requestMock1->expects($this->atLeastOnce())->method('getControllerName')->willReturn($actionPath); + $requestMock1->expects($this->atLeastOnce())->method('getActionName')->willReturn($actionName); + $requestMock1->expects($this->atLeastOnce()) + ->method('getPathInfo') + ->willReturn($moduleFrontName . '/' . $actionPath . '/' . $actionName . '/'); + + $requestMock2 = $this->createMock(Http::class); + $requestMock2->expects($this->atLeastOnce())->method('getModuleName')->willReturn($moduleFrontName); + $requestMock2->expects($this->atLeastOnce()) + ->method('getPathInfo') + ->willReturn($moduleFrontName . '/' . $actionPath . '/' . $actionName . '/'); + + $requestMock3 = $this->createMock(Http::class); + $requestMock3->expects($this->atLeastOnce())->method('getModuleName')->willReturn(''); + $requestMock3->expects($this->atLeastOnce())->method('getPathInfo')->willReturn('0'); + + return [ + [ + $requestMock1, + '', + $moduleFrontName, + $actionPath, + $actionName, + 'module_name', + ], + [ + $requestMock2, + '', + $moduleFrontName, + $actionPath, + $actionName, + null, + ], + [ + $requestMock3, + $moduleFrontName . '/' . $actionPath . '/' . $actionName . '/', + '0', + null, + null, + null + ], + ]; } public function testGetActionClassName() @@ -247,19 +304,4 @@ public function testGetActionClassName() ->willReturn($className); $this->assertEquals($className, $this->model->getActionClassName($module, $actionPath)); } - - /** - * Generate a stub with an expected usage for the request mock object - * - * @param string $method - * @param string $with - * @return $this - */ - private function requestExpects($method, $with) - { - $this->requestMock->expects($this->once()) - ->method($method) - ->with($with); - return $this; - } } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php b/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php index ee422ed8b8e17..2eb02e542a565 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php @@ -16,6 +16,7 @@ use Magento\Framework\App\StaticResource; use Magento\Framework\App\View\Asset\Publisher; use Magento\Framework\Config\ConfigOptionsListConstants; +use Magento\Framework\Filesystem\Driver\File; use Magento\Framework\Module\ModuleList; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\View\Asset\LocalInterface; @@ -79,6 +80,11 @@ class StaticResourceTest extends TestCase */ private $deploymentConfigMock; + /** + * @var File|MockObject + */ + private $driverMock; + /** * @var StaticResource */ @@ -99,6 +105,7 @@ protected function setUp(): void $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); $this->configLoaderMock = $this->createMock(ConfigLoader::class); $this->deploymentConfigMock = $this->createMock(DeploymentConfig::class); + $this->driverMock = $this->createMock(File::class); $this->object = new StaticResource( $this->stateMock, $this->responseMock, @@ -108,7 +115,8 @@ protected function setUp(): void $this->moduleListMock, $this->objectManagerMock, $this->configLoaderMock, - $this->deploymentConfigMock + $this->deploymentConfigMock, + $this->driverMock ); } @@ -199,6 +207,9 @@ public function testLaunch( $this->responseMock->expects($this->once()) ->method('setFilePath') ->with('resource/file.css'); + $this->driverMock->expects($this->once()) + ->method('getRealPathSafety') + ->willReturnArgument(0); $this->object->launch(); } @@ -269,6 +280,9 @@ public function testLaunchWrongPath() ->method('get') ->with('resource') ->willReturn('short/path.js'); + $this->driverMock->expects($this->once()) + ->method('getRealPathSafety') + ->willReturnArgument(0); $this->object->launch(); } @@ -331,6 +345,10 @@ public function testLaunchPathAbove() ->method('get') ->with('resource') ->willReturn('frontend/..\..\folder_above/././Magento_Ui/template/messages.html'); + $this->driverMock->expects($this->once()) + ->method('getRealPathSafety') + ->with('frontend/..\..\folder_above/././Magento_Ui/template/messages.html') + ->willReturn('folder_above/Magento_Ui/template/messages.html'); $this->expectExceptionMessage("Requested path '$path' is wrong."); $this->object->launch(); diff --git a/lib/internal/Magento/Framework/Backup/AbstractBackup.php b/lib/internal/Magento/Framework/Backup/AbstractBackup.php index a46f7d629f6f1..d8f365dc2460d 100644 --- a/lib/internal/Magento/Framework/Backup/AbstractBackup.php +++ b/lib/internal/Magento/Framework/Backup/AbstractBackup.php @@ -160,7 +160,7 @@ public function setRootDir($rootDir) ); } - $this->_rootDir = $rootDir; + $this->_rootDir = rtrim($rootDir, '/'); return $this; } @@ -181,7 +181,7 @@ public function getRootDir() */ public function setBackupsDir($backupsDir) { - $this->_backupsDir = $backupsDir; + $this->_backupsDir = rtrim($backupsDir, '/'); return $this; } diff --git a/lib/internal/Magento/Framework/Backup/Filesystem.php b/lib/internal/Magento/Framework/Backup/Filesystem.php index 299bf88c1c409..8759e3c5a466b 100644 --- a/lib/internal/Magento/Framework/Backup/Filesystem.php +++ b/lib/internal/Magento/Framework/Backup/Filesystem.php @@ -249,6 +249,7 @@ public function getIgnorePaths() */ public function setBackupsDir($backupsDir) { + $backupsDir = rtrim($backupsDir, '/'); parent::setBackupsDir($backupsDir); $this->addIgnorePaths($backupsDir); return $this; diff --git a/lib/internal/Magento/Framework/Backup/Test/Unit/MediaTest.php b/lib/internal/Magento/Framework/Backup/Test/Unit/MediaTest.php index 573be62566069..b6638de87965b 100644 --- a/lib/internal/Magento/Framework/Backup/Test/Unit/MediaTest.php +++ b/lib/internal/Magento/Framework/Backup/Test/Unit/MediaTest.php @@ -114,8 +114,8 @@ public function testAction($action) 'rollBackFs' => $this->fsMock, ] ); - $model->setRootDir($rootDir); - $model->setBackupsDir($rootDir); + $model->setRootDir($rootDir . '/'); + $model->setBackupsDir($rootDir . '/'); $model->{$action}(); $this->assertTrue($model->getIsSuccess()); diff --git a/lib/internal/Magento/Framework/Backup/Test/Unit/NomediaTest.php b/lib/internal/Magento/Framework/Backup/Test/Unit/NomediaTest.php index 7d22f2ddb4030..da7505c651fbe 100644 --- a/lib/internal/Magento/Framework/Backup/Test/Unit/NomediaTest.php +++ b/lib/internal/Magento/Framework/Backup/Test/Unit/NomediaTest.php @@ -113,8 +113,8 @@ public function testAction($action) 'rollBackFs' => $this->fsMock, ] ); - $model->setRootDir($rootDir); - $model->setBackupsDir($rootDir); + $model->setRootDir($rootDir . '/'); + $model->setBackupsDir($rootDir . '/'); $model->{$action}(); $this->assertTrue($model->getIsSuccess()); diff --git a/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php b/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php index 96f7ad842691f..86c67b68b3936 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php +++ b/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php @@ -248,6 +248,8 @@ public function save($data, $id, $tags = [], $specificLifetime = false) $this->unlock($id); } + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction if (!mt_rand(0, 100) && $this->checkIfLocalCacheSpaceExceeded()) { $this->local->clean(); } diff --git a/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php b/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php index f29474f476b45..b0fe493ab0eaa 100644 --- a/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php +++ b/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php @@ -6,6 +6,9 @@ namespace Magento\Framework\Code\Generator; use Laminas\Code\Generator\ValueGenerator; +use ReflectionClass; +use ReflectionException; +use ReflectionParameter; /** * Abstract entity @@ -323,29 +326,46 @@ protected function _getNullDefaultValue() private function extractParameterType( \ReflectionParameter $parameter ): ?string { + if (!$parameter->hasType()) { + return null; + } + /** @var string|null $typeName */ $typeName = null; - if ($parameter->hasType()) { - if ($parameter->isArray()) { - $typeName = 'array'; - } elseif ($parameter->getClass()) { - $typeName = $this->_getFullyQualifiedClassName( - $parameter->getClass()->getName() - ); - } elseif ($parameter->isCallable()) { - $typeName = 'callable'; - } else { - $typeName = $parameter->getType()->getName(); - } - if ($parameter->allowsNull()) { - $typeName = '?' .$typeName; - } + if ($parameter->isArray()) { + $typeName = 'array'; + } elseif ($parameterClass = $this->getParameterClass($parameter)) { + $typeName = $this->_getFullyQualifiedClassName($parameterClass->getName()); + } elseif ($parameter->isCallable()) { + $typeName = 'callable'; + } else { + $typeName = $parameter->getType()->getName(); + } + + if ($parameter->allowsNull()) { + $typeName = '?' . $typeName; } return $typeName; } + /** + * Get class by reflection parameter + * + * @param ReflectionParameter $reflectionParameter + * @return ReflectionClass|null + * @throws ReflectionException + */ + private function getParameterClass(ReflectionParameter $reflectionParameter): ?ReflectionClass + { + $parameterType = $reflectionParameter->getType(); + + return $parameterType && !$parameterType->isBuiltin() + ? new ReflectionClass($parameterType->getName()) + : null; + } + /** * Extract parameter default value * diff --git a/lib/internal/Magento/Framework/Code/Reader/ArgumentsReader.php b/lib/internal/Magento/Framework/Code/Reader/ArgumentsReader.php index c9a8cce706af4..3396093c78bc4 100644 --- a/lib/internal/Magento/Framework/Code/Reader/ArgumentsReader.php +++ b/lib/internal/Magento/Framework/Code/Reader/ArgumentsReader.php @@ -5,6 +5,10 @@ */ namespace Magento\Framework\Code\Reader; +use ReflectionClass; +use ReflectionException; +use ReflectionParameter; + /** * The class arguments reader */ @@ -98,11 +102,13 @@ public function getConstructorArguments(\ReflectionClass $class, $groupByPositio */ private function processType(\ReflectionClass $class, \Laminas\Code\Reflection\ParameterReflection $parameter) { - if ($parameter->getClass()) { - return NamespaceResolver::NS_SEPARATOR . $parameter->getClass()->getName(); + $parameterClass = $this->getParameterClass($parameter); + + if ($parameterClass) { + return NamespaceResolver::NS_SEPARATOR . $parameterClass->getName(); } - $type = $parameter->detectType(); + $type = $parameter->detectType(); if ($type === 'null') { return null; @@ -121,6 +127,22 @@ private function processType(\ReflectionClass $class, \Laminas\Code\Reflection\P return $type; } + /** + * Get class by reflection parameter + * + * @param ReflectionParameter $reflectionParameter + * @return ReflectionClass|null + * @throws ReflectionException + */ + private function getParameterClass(ReflectionParameter $reflectionParameter): ?ReflectionClass + { + $parameterType = $reflectionParameter->getType(); + + return $parameterType && !$parameterType->isBuiltin() + ? new ReflectionClass($parameterType->getName()) + : null; + } + /** * Get arguments of parent __construct call * diff --git a/lib/internal/Magento/Framework/Code/Reader/ClassReader.php b/lib/internal/Magento/Framework/Code/Reader/ClassReader.php index 2aad3b83390bf..d796cd8978cd0 100644 --- a/lib/internal/Magento/Framework/Code/Reader/ClassReader.php +++ b/lib/internal/Magento/Framework/Code/Reader/ClassReader.php @@ -5,6 +5,10 @@ */ namespace Magento\Framework\Code\Reader; +use ReflectionClass; +use ReflectionException; +use ReflectionParameter; + /** * Class ClassReader */ @@ -17,32 +21,34 @@ class ClassReader implements ClassReaderInterface * * @param string $className * @return array|null - * @throws \ReflectionException + * @throws ReflectionException */ public function getConstructor($className) { - $class = new \ReflectionClass($className); + $class = new ReflectionClass($className); $result = null; $constructor = $class->getConstructor(); if ($constructor) { $result = []; - /** @var $parameter \ReflectionParameter */ + /** @var $parameter ReflectionParameter */ foreach ($constructor->getParameters() as $parameter) { try { + $parameterClass = $this->getParameterClass($parameter); + $result[] = [ $parameter->getName(), - $parameter->getClass() !== null ? $parameter->getClass()->getName() : null, + $parameterClass ? $parameterClass->getName() : null, !$parameter->isOptional() && !$parameter->isDefaultValueAvailable(), $this->getReflectionParameterDefaultValue($parameter), $parameter->isVariadic(), ]; - } catch (\ReflectionException $e) { + } catch (ReflectionException $e) { $message = sprintf( 'Impossible to process constructor argument %s of %s class', $parameter->__toString(), $className ); - throw new \ReflectionException($message, 0, $e); + throw new ReflectionException($message, 0, $e); } } } @@ -50,13 +56,29 @@ public function getConstructor($className) return $result; } + /** + * Get class by reflection parameter + * + * @param ReflectionParameter $reflectionParameter + * @return ReflectionClass|null + * @throws ReflectionException + */ + private function getParameterClass(ReflectionParameter $reflectionParameter): ?ReflectionClass + { + $parameterType = $reflectionParameter->getType(); + + return $parameterType && !$parameterType->isBuiltin() + ? new ReflectionClass($parameterType->getName()) + : null; + } + /** * Get reflection parameter default value * - * @param \ReflectionParameter $parameter + * @param ReflectionParameter $parameter * @return array|mixed|null */ - private function getReflectionParameterDefaultValue(\ReflectionParameter $parameter) + private function getReflectionParameterDefaultValue(ReflectionParameter $parameter) { if ($parameter->isVariadic()) { return []; diff --git a/lib/internal/Magento/Framework/Code/Reader/SourceArgumentsReader.php b/lib/internal/Magento/Framework/Code/Reader/SourceArgumentsReader.php index 840cc2a3e943c..16cb47e2fa119 100644 --- a/lib/internal/Magento/Framework/Code/Reader/SourceArgumentsReader.php +++ b/lib/internal/Magento/Framework/Code/Reader/SourceArgumentsReader.php @@ -5,6 +5,10 @@ */ namespace Magento\Framework\Code\Reader; +use ReflectionClass; +use ReflectionException; +use ReflectionParameter; + class SourceArgumentsReader { /** @@ -61,7 +65,7 @@ public function getConstructorArgumentTypes( $typeName = 'array'; } else { try { - $paramClass = $param->getClass(); + $paramClass = $this->getParameterClass($param); if ($paramClass) { $typeName = '\\' .$paramClass->getName(); } @@ -81,6 +85,22 @@ public function getConstructorArgumentTypes( return $types; } + /** + * Get class by reflection parameter + * + * @param ReflectionParameter $reflectionParameter + * @return ReflectionClass|null + * @throws ReflectionException + */ + private function getParameterClass(ReflectionParameter $reflectionParameter): ?ReflectionClass + { + $parameterType = $reflectionParameter->getType(); + + return $parameterType && !$parameterType->isBuiltin() + ? new ReflectionClass($parameterType->getName()) + : null; + } + /** * Perform namespace resolution if required and return fully qualified name. * diff --git a/lib/internal/Magento/Framework/Composer/ComposerInformation.php b/lib/internal/Magento/Framework/Composer/ComposerInformation.php index 0b796da73452c..d830a6eb105b5 100644 --- a/lib/internal/Magento/Framework/Composer/ComposerInformation.php +++ b/lib/internal/Magento/Framework/Composer/ComposerInformation.php @@ -261,7 +261,7 @@ public function getSystemPackages() */ public function isSystemPackage($packageName = '') { - if (preg_match('/magento\/product-*/', $packageName) == 1) { + if (preg_match('/magento\/product-.*?-edition/', $packageName) == 1) { return true; } return false; diff --git a/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php b/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php index 9bbfb21e3e0a7..757f41463ec96 100644 --- a/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php +++ b/lib/internal/Magento/Framework/Composer/Test/Unit/ComposerInformationTest.php @@ -57,8 +57,8 @@ protected function setUp(): void $this->packageMock = $this->getMockForAbstractClass(CompletePackageInterface::class); $this->lockerMock->method('getLockedRepository')->willReturn($this->lockerRepositoryMock); $this->packageMock->method('getType')->willReturn('metapackage'); - $this->packageMock->method('getPrettyName')->willReturn('magento/product-test-package-name'); - $this->packageMock->method('getName')->willReturn('magento/product-test-package-name'); + $this->packageMock->method('getPrettyName')->willReturn('magento/product-test-package-name-edition'); + $this->packageMock->method('getName')->willReturn('magento/product-test-package-name-edition'); $this->packageMock->method('getPrettyVersion')->willReturn('123.456.789'); $this->lockerRepositoryMock->method('getPackages')->willReturn([$this->packageMock]); @@ -75,8 +75,8 @@ protected function setUp(): void public function testGetSystemPackages() { $expected = [ - 'magento/product-test-package-name' => [ - 'name' => 'magento/product-test-package-name', + 'magento/product-test-package-name-edition' => [ + 'name' => 'magento/product-test-package-name-edition', 'type' => 'metapackage', 'version' => '123.456.789' ] diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/CssInliner.php b/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/CssInliner.php index b54761698f16c..81f3608674752 100644 --- a/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/CssInliner.php +++ b/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/CssInliner.php @@ -6,7 +6,8 @@ namespace Magento\Framework\Css\PreProcessor\Adapter; use Magento\Framework\App\State; -use Pelago\Emogrifier; +use Pelago\Emogrifier\CssInliner as EmogrifierCssInliner; +use Symfony\Component\CssSelector\Exception\ParseException; /** * This class will inline the css of an html to each tag to be used for applications such as a styled email. @@ -14,17 +15,31 @@ class CssInliner { /** - * @var Emogrifier + * @var State */ - private $emogrifier; + private $appState; + + /** + * @var string + */ + private $html = ''; + + /** + * @var string + */ + private $css = ''; + + /** + * @var bool + */ + private $disableStyleBlocksParsing = false; /** * @param State $appState */ public function __construct(State $appState) { - $this->emogrifier = new Emogrifier(); - $this->emogrifier->setDebug($appState->getMode() === State::MODE_DEVELOPER); + $this->appState = $appState; } /** @@ -35,7 +50,7 @@ public function __construct(State $appState) */ public function setHtml($html) { - $this->emogrifier->setHtml($html); + $this->html = $html; } /** @@ -46,7 +61,7 @@ public function setHtml($html) */ public function setCss($css) { - $this->emogrifier->setCss($css); + $this->css = $css; } /** @@ -56,7 +71,7 @@ public function setCss($css) */ public function disableStyleBlocksParsing() { - $this->emogrifier->disableStyleBlocksParsing(); + $this->disableStyleBlocksParsing = true; } /** @@ -64,9 +79,19 @@ public function disableStyleBlocksParsing() * * @return string * @throws \BadMethodCallException + * @throws ParseException */ public function process() { - return $this->emogrifier->emogrify(); + $emogrifier = EmogrifierCssInliner::fromHtml($this->html) + ->setDebug($this->appState->getMode() === State::MODE_DEVELOPER); + + if ($this->disableStyleBlocksParsing) { + $emogrifier->disableStyleBlocksParsing(); + } + + $emogrifier->inlineCss($this->css); + + return $emogrifier->render(); } } diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index 5765a3a7fe1b2..66e6bb26293e2 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -3072,8 +3072,8 @@ public function prepareSqlCondition($fieldName, $condition) */ protected function _prepareQuotedSqlCondition($text, $value, $fieldName) { + $text = str_replace('{{fieldName}}', $fieldName, $text); $sql = $this->quoteInto($text, $value); - $sql = str_replace('{{fieldName}}', $fieldName, $sql); return $sql; } @@ -4080,7 +4080,7 @@ public function getAutoIncrementField($tableName, $schemaName = null) { $indexName = $this->getPrimaryKeyName($tableName, $schemaName); $indexes = $this->getIndexList($tableName); - if ($indexName && count($indexes[$indexName]['COLUMNS_LIST']) == 1) { + if ($indexName && isset($indexes[$indexName]) && count($indexes[$indexName]['COLUMNS_LIST']) == 1) { return current($indexes[$indexName]['COLUMNS_LIST']); } return false; diff --git a/lib/internal/Magento/Framework/DB/Ddl/TriggerFactory.php b/lib/internal/Magento/Framework/DB/Ddl/TriggerFactory.php index b1fefd0852a21..ae03686a822cf 100644 --- a/lib/internal/Magento/Framework/DB/Ddl/TriggerFactory.php +++ b/lib/internal/Magento/Framework/DB/Ddl/TriggerFactory.php @@ -22,7 +22,7 @@ class TriggerFactory */ public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager) { - $this->_objectManager = $objectManager; + $this->objectManager = $objectManager; } /** @@ -33,6 +33,6 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objectMan */ public function create(array $data = []) { - return $this->_objectManager->create(self::INSTANCE_NAME, $data); + return $this->objectManager->create(self::INSTANCE_NAME, $data); } } diff --git a/lib/internal/Magento/Framework/DB/ExpressionConverter.php b/lib/internal/Magento/Framework/DB/ExpressionConverter.php index cacde221a608f..7f567a7a3918b 100644 --- a/lib/internal/Magento/Framework/DB/ExpressionConverter.php +++ b/lib/internal/Magento/Framework/DB/ExpressionConverter.php @@ -102,6 +102,8 @@ public static function shortenEntityName($entityName, $prefix) if (strlen($entityName) > self::MYSQL_IDENTIFIER_LEN) { $shortName = ExpressionConverter::shortName($entityName); if (strlen($shortName) > self::MYSQL_IDENTIFIER_LEN) { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $hash = md5($entityName); if (strlen($prefix . $hash) > self::MYSQL_IDENTIFIER_LEN) { $entityName = self::trimHash($hash, $prefix, self::MYSQL_IDENTIFIER_LEN); diff --git a/lib/internal/Magento/Framework/Data/Collection/Db/FetchStrategy/Cache.php b/lib/internal/Magento/Framework/Data/Collection/Db/FetchStrategy/Cache.php index 05c34d12a1fa9..0ab2d1e0c5423 100644 --- a/lib/internal/Magento/Framework/Data/Collection/Db/FetchStrategy/Cache.php +++ b/lib/internal/Magento/Framework/Data/Collection/Db/FetchStrategy/Cache.php @@ -99,6 +99,8 @@ public function fetchAll(Select $select, array $bindParams = []) */ protected function _getSelectCacheId($select) { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction return $this->_cacheIdPrefix . md5((string)$select); } } diff --git a/lib/internal/Magento/Framework/Encryption/Encryptor.php b/lib/internal/Magento/Framework/Encryption/Encryptor.php index c5caf39152607..227b7d0839bc3 100644 --- a/lib/internal/Magento/Framework/Encryption/Encryptor.php +++ b/lib/internal/Magento/Framework/Encryption/Encryptor.php @@ -38,12 +38,18 @@ class Encryptor implements EncryptorInterface */ public const HASH_VERSION_ARGON2ID13 = 2; + /** + * Key of Argon2ID13 algorithm that works on any PHP and libsodium version. + */ + public const HASH_VERSION_ARGON2ID13_AGNOSTIC = 3; + /** * Key of latest used algorithm - * @deprecated + * + * @deprecated Latest version is dynamic based on current setup. * @see \Magento\Framework\Encryption\Encryptor::getLatestHashVersion */ - const HASH_VERSION_LATEST = 2; + const HASH_VERSION_LATEST = 3; /** * Default length of salt in bytes @@ -83,22 +89,15 @@ class Encryptor implements EncryptorInterface const DELIMITER = ':'; /** - * @var array map of hash versions + * Map of simple hash versions + * + * @var array */ private $hashVersionMap = [ self::HASH_VERSION_MD5 => 'md5', self::HASH_VERSION_SHA256 => 'sha256' ]; - /** - * @var array map of password hash - */ - private $passwordHashMap = [ - self::PASSWORD_HASH => '', - self::PASSWORD_SALT => '', - self::PASSWORD_VERSION => self::HASH_VERSION_SHA256 - ]; - /** * Indicate cipher * @@ -148,11 +147,6 @@ public function __construct( $this->keys = preg_split('/\s+/s', trim((string)$deploymentConfig->get(self::PARAM_CRYPT_KEY))); $this->keyVersion = count($this->keys) - 1; $this->keyValidator = $keyValidator ?: ObjectManager::getInstance()->get(KeyValidator::class); - $latestHashVersion = $this->getLatestHashVersion(); - if ($latestHashVersion === self::HASH_VERSION_ARGON2ID13) { - $this->hashVersionMap[self::HASH_VERSION_ARGON2ID13] = SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13; - $this->passwordHashMap[self::PASSWORD_VERSION] = self::HASH_VERSION_ARGON2ID13; - } } /** @@ -162,11 +156,7 @@ public function __construct( */ public function getLatestHashVersion(): int { - if (extension_loaded('sodium') && defined('SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13')) { - return self::HASH_VERSION_ARGON2ID13; - } - - return self::HASH_VERSION_SHA256; + return self::HASH_VERSION_ARGON2ID13_AGNOSTIC; } /** @@ -197,31 +187,44 @@ public function validateCipher($version) /** * @inheritdoc + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function getHash($password, $salt = false, $version = self::HASH_VERSION_LATEST) { - if (!isset($this->hashVersionMap[$version])) { - $version = self::HASH_VERSION_SHA256; + if ($version < 0 || $version > $this->getLatestHashVersion()) { + $version = $this->getLatestHashVersion(); } + $isArgon = $version === self::HASH_VERSION_ARGON2ID13 || $version === self::HASH_VERSION_ARGON2ID13_AGNOSTIC; if ($salt === false) { - $version = $version === self::HASH_VERSION_ARGON2ID13 ? self::HASH_VERSION_SHA256 : $version; + //Generating a simple hash without salt. + if ($isArgon) { + $version = self::HASH_VERSION_SHA256; + } + return $this->hash($password, $version); } if ($salt === true) { + //Generate random default length salt $salt = self::DEFAULT_SALT_LENGTH; } if (is_integer($salt)) { - $salt = $version === self::HASH_VERSION_ARGON2ID13 ? - SODIUM_CRYPTO_PWHASH_SALTBYTES : - $salt; + //Generate salt of given length. $salt = $this->random->getRandomString($salt); } - if ($version === self::HASH_VERSION_ARGON2ID13) { - $hash = $this->getArgonHash($password, $salt); + if ($isArgon) { + $seedBytes = SODIUM_CRYPTO_SIGN_SEEDBYTES; + $opsLimit = SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE; + $memLimit = SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE; + if ($version === self::HASH_VERSION_ARGON2ID13_AGNOSTIC) { + $version = implode('_', [self::HASH_VERSION_ARGON2ID13_AGNOSTIC, $seedBytes, $opsLimit, $memLimit]); + } + + $hash = $this->getArgonHash($password, $seedBytes, $opsLimit, $memLimit, $salt); } else { - $hash = $this->generateSimpleHash($salt . $password, $version); + $hash = $this->generateSimpleHash($salt . $password, (int)$version); } return implode( @@ -243,6 +246,10 @@ public function getHash($password, $salt = false, $version = self::HASH_VERSION_ */ private function generateSimpleHash(string $data, int $version): string { + if (!array_key_exists($version, $this->hashVersionMap)) { + throw new \InvalidArgumentException('Unknown hashing algorithm'); + } + return hash($this->hashVersionMap[$version], (string)$data); } @@ -254,6 +261,9 @@ public function hash($data, $version = self::HASH_VERSION_SHA256) if (empty($this->keys[$this->keyVersion])) { throw new \RuntimeException('No key available'); } + if (!array_key_exists($version, $this->hashVersionMap)) { + throw new \InvalidArgumentException('Unknown hashing algorithm'); + } return hash_hmac($this->hashVersionMap[$version], (string)$data, $this->keys[$this->keyVersion], false); } @@ -271,18 +281,35 @@ public function validateHash($password, $hash) */ public function isValidHash($password, $hash) { + $agnosticArgonRegEx = '/^' .self::HASH_VERSION_ARGON2ID13_AGNOSTIC + .'\_(?<seed>\d+)\_(?<ops>\d+)\_(?<mem>\d+)$/'; try { - $this->explodePasswordHash($hash); + [$hash, $hashSalt, $hashVersions] = $this->explodePasswordHash($hash); $recreated = $password; - foreach ($this->getPasswordVersion() as $hashVersion) { - if ($hashVersion === self::HASH_VERSION_ARGON2ID13) { - $recreated = $this->getArgonHash($recreated, $this->getPasswordSalt()); + //Upgraded hashes would have been hashed with multiple algorithms. + //Hashing the test string with every algorithm the original string has been hashed with. + foreach ($hashVersions as $hashVersion) { + if (is_string($hashVersion) && preg_match($agnosticArgonRegEx, $hashVersion, $argonParams)) { + $recreated = $this->getArgonHash( + $recreated, + (int)$argonParams['seed'], + (int)$argonParams['ops'], + (int)$argonParams['mem'], + $hashSalt + ); + } elseif ((int)$hashVersion === self::HASH_VERSION_ARGON2ID13) { + $recreated = $this->getArgonHash( + $recreated, + SODIUM_CRYPTO_SIGN_SEEDBYTES, + SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, + SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE, + $hashSalt + ); } else { - $recreated = $this->generateSimpleHash($this->getPasswordSalt() . $recreated, $hashVersion); + $recreated = $this->generateSimpleHash($hashSalt . $recreated, (int)$hashVersion); } - $hash = $this->getPasswordHash(); } - } catch (\RuntimeException $exception) { + } catch (\Throwable $exception) { //Hash is not a password hash. $recreated = $this->hash($password); } @@ -299,16 +326,22 @@ public function isValidHash($password, $hash) public function validateHashVersion($hash, $validateCount = false) { try { - $this->explodePasswordHash($hash); + $hashVersions = $this->explodePasswordHash($hash)[2]; } catch (\RuntimeException $exception) { //Not a password hash. return true; } - $hashVersions = $this->getPasswordVersion(); + if ($this->getLatestHashVersion() === self::HASH_VERSION_ARGON2ID13_AGNOSTIC) { + //Agnostic Argon also stores Argon parameters. + $validVersion = preg_match( + '/^' .self::HASH_VERSION_ARGON2ID13_AGNOSTIC .'\_\d+\_\d+\_\d+$/', + end($hashVersions) + ); + } else { + $validVersion = end($hashVersions) === $this->getLatestHashVersion(); + } - return $validateCount - ? end($hashVersions) === $this->getLatestHashVersion() && count($hashVersions) === 1 - : end($hashVersions) === $this->getLatestHashVersion(); + return $validVersion && (!$validateCount || count($hashVersions) === 1); } /** @@ -325,47 +358,13 @@ private function explodePasswordHash($hash) throw new \RuntimeException('Hash is not a password hash'); } - foreach ($this->passwordHashMap as $key => $defaultValue) { - $this->passwordHashMap[$key] = (isset($explodedPassword[$key])) ? $explodedPassword[$key] : $defaultValue; - } - - return $this->passwordHashMap; - } - - /** - * Get password hash - * - * @return string - */ - private function getPasswordHash() - { - return (string)$this->passwordHashMap[self::PASSWORD_HASH]; - } - - /** - * Get password salt - * - * @return string - */ - private function getPasswordSalt() - { - return (string)$this->passwordHashMap[self::PASSWORD_SALT]; - } - - /** - * Get password version - * - * @return array - */ - private function getPasswordVersion() - { - return array_map( - 'intval', - explode( - self::DELIMITER, - (string)$this->passwordHashMap[self::PASSWORD_VERSION] - ) + //Hashes that have been upgraded will have algorithm version history starting from the oldest one used. + $explodedPassword[self::PASSWORD_VERSION] = explode( + self::DELIMITER, + $explodedPassword[self::PASSWORD_VERSION] ); + + return $explodedPassword; } /** @@ -514,6 +513,7 @@ private function getCrypt( int $cipherVersion = null, string $initVector = null ): ?EncryptionAdapterInterface { + //phpcs:disable PHPCompatibility.Constants.RemovedConstants if (null === $key && null === $cipherVersion) { $cipherVersion = $this->getCipherVersion(); } @@ -545,6 +545,7 @@ private function getCrypt( $cipher = MCRYPT_BLOWFISH; $mode = MCRYPT_MODE_ECB; } + //phpcs:enable PHPCompatibility.Constants.RemovedConstants return new Mcrypt($key, $cipher, $mode, $initVector); } @@ -556,39 +557,41 @@ private function getCrypt( */ private function getCipherVersion() { - if (extension_loaded('sodium')) { - return $this->cipher; - } else { - return self::CIPHER_RIJNDAEL_256; - } + return $this->cipher; } /** * Generate Argon2ID13 hash. * * @param string $data + * @param int $seedBytes + * @param int $opsLimit + * @param int $memLimit * @param string $salt * @return string * @throws \SodiumException */ - private function getArgonHash($data, $salt = ''): string - { - $salt = empty($salt) ? - random_bytes(SODIUM_CRYPTO_PWHASH_SALTBYTES) : - substr($salt, 0, SODIUM_CRYPTO_PWHASH_SALTBYTES); - + private function getArgonHash( + string $data, + int $seedBytes, + int $opsLimit, + int $memLimit, + string $salt + ): string { if (strlen($salt) < SODIUM_CRYPTO_PWHASH_SALTBYTES) { $salt = str_pad($salt, SODIUM_CRYPTO_PWHASH_SALTBYTES, $salt); + } elseif (strlen($salt) > SODIUM_CRYPTO_PWHASH_SALTBYTES) { + $salt = substr($salt, 0, SODIUM_CRYPTO_PWHASH_SALTBYTES); } return bin2hex( sodium_crypto_pwhash( - SODIUM_CRYPTO_SIGN_SEEDBYTES, + $seedBytes, $data, $salt, - SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, - SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE, - $this->hashVersionMap[self::HASH_VERSION_ARGON2ID13] + $opsLimit, + $memLimit, + SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13 ) ); } diff --git a/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php b/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php index 62ff90d559383..567f56b4fa17a 100644 --- a/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php +++ b/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php @@ -82,10 +82,14 @@ public function testGetHashNoSalt(): void public function testGetHashSpecifiedSalt(): void { $this->randomGeneratorMock->expects($this->never())->method('getRandomString'); - $expected = $this->encryptor->getLatestHashVersion() === Encryptor::HASH_VERSION_ARGON2ID13 ? - '7640855aef9cb6ffd20229601d2904a2192e372b391db8230d7faf073b393e4c:salt:2' : - '13601bda4ea78e55a07b98866d2be6be0744e3866f13c00c811cab608a28f322:salt:1'; - $actual = $this->encryptor->getHash('password', 'salt'); + if ($this->encryptor->getLatestHashVersion() >= Encryptor::HASH_VERSION_ARGON2ID13) { + $version = Encryptor::HASH_VERSION_ARGON2ID13; + $expected = '7640855aef9cb6ffd20229601d2904a2192e372b391db8230d7faf073b393e4c:salt:2'; + } else { + $version = Encryptor::HASH_VERSION_SHA256; + $expected = '13601bda4ea78e55a07b98866d2be6be0744e3866f13c00c811cab608a28f322:salt:1'; + } + $actual = $this->encryptor->getHash('password', 'salt', $version); $this->assertEquals($expected, $actual); } @@ -94,16 +98,25 @@ public function testGetHashSpecifiedSalt(): void */ public function testGetHashRandomSaltDefaultLength(): void { - $salt = '-----------random_salt----------'; + $salt = 'random-salt'; + $salt = str_pad( + $salt, + $this->encryptor->getLatestHashVersion() >= Encryptor::HASH_VERSION_ARGON2ID13 + ? SODIUM_CRYPTO_PWHASH_SALTBYTES : 32, + $salt + ); + if ($this->encryptor->getLatestHashVersion() >= Encryptor::HASH_VERSION_ARGON2ID13) { + $version = Encryptor::HASH_VERSION_ARGON2ID13; + $expected = '2d78b5e93b683c4d3b0574c1ced8e40ddec7730c2e1b35f282b2c955b5cb7262:' . $salt . ':2'; + } else { + $version = Encryptor::HASH_VERSION_SHA256; + $expected = '2c210995b6029cdbd3a88c32be1083fdca263cf19600247d09a2409b30f09f16:' . $salt . ':1'; + } $this->randomGeneratorMock ->expects($this->once()) ->method('getRandomString') - ->with($this->encryptor->getLatestHashVersion() === Encryptor::HASH_VERSION_ARGON2ID13 ? 16 : 32) ->willReturn($salt); - $expected = $this->encryptor->getLatestHashVersion() === Encryptor::HASH_VERSION_ARGON2ID13 ? - '0be2351d7513d3e9622bd2df1891c39ba5ba6d1e3d67a058c60d6fd83f6641d8:' . $salt . ':2' : - 'a1c7fc88037b70c9be84d3ad12522c7888f647915db78f42eb572008422ba2fa:' . $salt . ':1'; - $actual = $this->encryptor->getHash('password', true); + $actual = $this->encryptor->getHash('password', true, $version); $this->assertEquals($expected, $actual); } @@ -115,16 +128,17 @@ public function testGetHashRandomSaltSpecifiedLength(): void $this->randomGeneratorMock ->expects($this->once()) ->method('getRandomString') - ->with($this->encryptor->getLatestHashVersion() === Encryptor::HASH_VERSION_ARGON2ID13 ? 16 : 11) ->willReturn( - $this->encryptor->getLatestHashVersion() === Encryptor::HASH_VERSION_ARGON2ID13 ? + $this->encryptor->getLatestHashVersion() >= Encryptor::HASH_VERSION_ARGON2ID13 ? 'random_salt12345' : 'random_salt' ); - $expected = $this->encryptor->getLatestHashVersion() === Encryptor::HASH_VERSION_ARGON2ID13 ? + $expected = $this->encryptor->getLatestHashVersion() >= Encryptor::HASH_VERSION_ARGON2ID13 ? 'ca7982945fa90444b78d586678ff1c223ce13f99a39ec9541eae8b63ada3816a:random_salt12345:2' : '4c5cab8dd00137d11258f8f87b93fd17bd94c5026fc52d3c5af911dd177a2611:random_salt:1'; - $actual = $this->encryptor->getHash('password', 11); + $version = $this->encryptor->getLatestHashVersion() >= Encryptor::HASH_VERSION_ARGON2ID13 + ? Encryptor::HASH_VERSION_ARGON2ID13 : Encryptor::HASH_VERSION_SHA256; + $actual = $this->encryptor->getHash('password', 11, $version); $this->assertEquals($expected, $actual); } @@ -258,6 +272,7 @@ public function testLegacyDecrypt(): void [, , $iv, $encrypted] = explode(':', $data, 4); // Decrypt returned data with RIJNDAEL_256 cipher, cbc mode + //phpcs:ignore PHPCompatibility.Constants.RemovedConstants $crypt = new Crypt(self::CRYPT_KEY_1, MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC, $iv); // Verify decrypted matches original data $this->assertEquals($encrypted, base64_encode($crypt->encrypt($actual))); @@ -340,6 +355,12 @@ public function useSpecifiedHashingAlgoDataProvider(): array false, Encryptor::HASH_VERSION_SHA256, '/^[0-9a-z]{64}$/' + ], + [ + 'password', + true, + Encryptor::HASH_VERSION_ARGON2ID13_AGNOSTIC, + '/^.+\:.+\:' .Encryptor::HASH_VERSION_ARGON2ID13_AGNOSTIC .'\_\d+\_\d+\_\d+$/is' ] ]; } @@ -356,6 +377,12 @@ public function useSpecifiedHashingAlgoDataProvider(): array */ public function testGetHashMustUseSpecifiedHashingAlgo($password, $salt, $hashAlgo, $pattern): void { + $this->randomGeneratorMock->method('getRandomString') + ->willReturnCallback( + function (int $length = 32): string { + return random_bytes($length); + } + ); $hash = $this->encryptor->getHash($password, $salt, $hashAlgo); $this->assertMatchesRegularExpression($pattern, $hash); } @@ -381,4 +408,62 @@ public function testHash() //Validation still works $this->assertTrue($this->encryptor->validateHash($value, $hash3)); } + + /** + * Test that generated hashes can be later validated. + * + * @throws \Throwable + */ + public function testValidation(): void + { + $original = 'password'; + $this->randomGeneratorMock->method('getRandomString') + ->willReturnCallback( + function (int $length = 32): string { + return bin2hex(random_bytes($length)); + } + ); + for ($version = $this->encryptor->getLatestHashVersion(); $version >= 0; $version--) { + $hash = $this->encryptor->getHash($original, true, $version); + $this->assertTrue( + $this->encryptor->isValidHash($original, $hash), + 'Algo #' .$version .' hash is invalid' + ); + } + } + + /** + * Test that upgraded generated hashes can be later validated. + * + * @throws \Throwable + */ + public function testUpgradedValidation(): void + { + $original = 'password'; + $hash = $original; + $this->randomGeneratorMock->method('getRandomString') + ->willReturnCallback( + function (int $length = 32): string { + return bin2hex(random_bytes($length)); + } + ); + //The hash will become sort of downgraded but that's important for the latest Argon algo. + for ($version = $this->encryptor->getLatestHashVersion(); $version >= 0; $version--) { + $info = explode(Encryptor::DELIMITER, $hash, 3); + if (count($info) !== 3) { + $salt = true; + $hashStr = $hash; + $versionInfo = ''; + } else { + $salt = $info[1]; + $hashStr = $info[0]; + $versionInfo = $info[2] .':'; + } + $hash = $this->encryptor->getHash($hashStr, $salt, $version); + [$hashStr, $salt, $newVersion] = explode(Encryptor::DELIMITER, $hash, 3); + $hash = implode(Encryptor::DELIMITER, [$hashStr, $salt, $versionInfo .$newVersion]); + } + + $this->assertTrue($this->encryptor->isValidHash($original, $hash)); + } } diff --git a/lib/internal/Magento/Framework/EntityManager/EntityManager.php b/lib/internal/Magento/Framework/EntityManager/EntityManager.php index 1adb03cdfb1a4..6054f4681550a 100644 --- a/lib/internal/Magento/Framework/EntityManager/EntityManager.php +++ b/lib/internal/Magento/Framework/EntityManager/EntityManager.php @@ -35,6 +35,16 @@ class EntityManager */ private $callbackHandler; + /** + * @var MetadataPool + */ + private $metadataPool; + + /** + * @var TypeResolver + */ + private $typeResolver; + /** * @param OperationPool $operationPool * @param MetadataPool $metadataPool diff --git a/lib/internal/Magento/Framework/Escaper.php b/lib/internal/Magento/Framework/Escaper.php index 9c67d2e891345..dae830dd889dc 100644 --- a/lib/internal/Magento/Framework/Escaper.php +++ b/lib/internal/Magento/Framework/Escaper.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Framework; @@ -257,10 +258,17 @@ private function escapeAttributeValue($name, $value) */ public function escapeHtmlAttr($string, $escapeSingleQuote = true) { + $string = (string)$string; + if ($escapeSingleQuote) { - return $this->getEscaper()->escapeHtmlAttr((string) $string); + $translateInline = $this->getTranslateInline(); + + return $translateInline->isAllowed() + ? $this->inlineSensitiveEscapeHthmlAttr($string) + : $this->getEscaper()->escapeHtmlAttr($string); } - return htmlspecialchars((string)$string, $this->htmlSpecialCharsFlag, 'UTF-8', false); + + return htmlspecialchars($string, $this->htmlSpecialCharsFlag, 'UTF-8', false); } /** @@ -476,4 +484,37 @@ private function getTranslateInline() return $this->translateInline; } + + /** + * Inline sensitive escape attribute value. + * + * @param string $text + * @return string + */ + private function inlineSensitiveEscapeHthmlAttr(string $text): string + { + $escaper = $this->getEscaper(); + $textLength = strlen($text); + + if ($textLength < 6) { + return $escaper->escapeHtmlAttr($text); + } + + $firstCharacters = substr($text, 0, 3); + $lastCharacters = substr($text, -3, 3); + + if ($firstCharacters !== '{{{' || $lastCharacters !== '}}}') { + return $escaper->escapeHtmlAttr($text); + } + + $text = substr($text, 3, $textLength - 6); + $strings = explode('}}{{', $text); + $escapedStrings = []; + + foreach ($strings as $string) { + $escapedStrings[] = $escaper->escapeHtmlAttr($string); + } + + return '{{{' . implode('}}{{', $escapedStrings) . '}}}'; + } } diff --git a/lib/internal/Magento/Framework/File/Uploader.php b/lib/internal/Magento/Framework/File/Uploader.php index 3ed8e274cfecd..5e0bf593fef49 100644 --- a/lib/internal/Magento/Framework/File/Uploader.php +++ b/lib/internal/Magento/Framework/File/Uploader.php @@ -12,6 +12,7 @@ use Magento\Framework\Filesystem\Directory\TargetDirectory; use Magento\Framework\Filesystem\DriverInterface; use Magento\Framework\Filesystem\DriverPool; +use Magento\Framework\Filter\ArrayFilter; use Magento\Framework\Validation\ValidationException; use Psr\Log\LoggerInterface; @@ -139,6 +140,11 @@ class Uploader */ private $logger; + /** + * @var Filesystem + */ + private $filesystem; + /**#@+ * File upload type (multiple or single) */ @@ -201,6 +207,7 @@ class Uploader * @param DirectoryList|null $directoryList * @param DriverPool|null $driverPool * @param TargetDirectory|null $targetDirectory + * @param Filesystem|null $filesystem * @throws \DomainException */ public function __construct( @@ -208,10 +215,12 @@ public function __construct( Mime $fileMime = null, DirectoryList $directoryList = null, DriverPool $driverPool = null, - TargetDirectory $targetDirectory = null + TargetDirectory $targetDirectory = null, + Filesystem $filesystem = null ) { $this->directoryList = $directoryList ?: ObjectManager::getInstance()->get(DirectoryList::class); + $this->filesystem = $filesystem ?: ObjectManager::getInstance()->get(FileSystem::class); $this->_setUploadFileId($fileId); if (!file_exists($this->_file['tmp_name'])) { $code = empty($this->_file['tmp_name']) ? self::TMP_NAME_EMPTY : 0; @@ -306,6 +315,11 @@ public function save($destinationFolder, $newFileName = null) */ private function validateDestination(string $destinationFolder): void { + if (strlen($this->getFileDriver()->getRealPathSafety($destinationFolder)) > 4096) { + throw new \InvalidArgumentException( + 'Destination folder path is too long; must be 255 characters or less' + ); + } if ($this->_allowCreateFolders) { $this->createDestinationFolder($destinationFolder); } elseif (!$this->getTargetDirectory() diff --git a/lib/internal/Magento/Framework/Filesystem/Directory/PathValidator.php b/lib/internal/Magento/Framework/Filesystem/Directory/PathValidator.php index 74e6cac7d77b3..9ecbfa6c9d2a3 100644 --- a/lib/internal/Magento/Framework/Filesystem/Directory/PathValidator.php +++ b/lib/internal/Magento/Framework/Filesystem/Directory/PathValidator.php @@ -42,13 +42,10 @@ public function validate( bool $absolutePath = false ): void { $realDirectoryPath = $this->driver->getRealPathSafety($directoryPath); - if ($realDirectoryPath[-1] !== DIRECTORY_SEPARATOR) { - $realDirectoryPath .= DIRECTORY_SEPARATOR; - } if (!$absolutePath) { $actualPath = $this->driver->getRealPathSafety( $this->driver->getAbsolutePath( - $realDirectoryPath, + $realDirectoryPath . DIRECTORY_SEPARATOR, $path, $scheme ) @@ -58,7 +55,7 @@ public function validate( } if (mb_strpos($actualPath, $realDirectoryPath) !== 0 - && rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR !== $realDirectoryPath + && rtrim($path, DIRECTORY_SEPARATOR) !== $realDirectoryPath ) { throw new ValidatorException( new Phrase( diff --git a/lib/internal/Magento/Framework/Filesystem/Driver/File.php b/lib/internal/Magento/Framework/Filesystem/Driver/File.php index 7b508942c107d..3ed9b24a0316c 100644 --- a/lib/internal/Magento/Framework/Filesystem/Driver/File.php +++ b/lib/internal/Magento/Framework/Filesystem/Driver/File.php @@ -26,6 +26,21 @@ class File implements DriverInterface */ protected $scheme = ''; + /** + * Flag for checking whether or not to be the behavior of statefulFile + * @var bool + */ + private $stateful; + + /** + * File constructor. + * @param bool $stateful + */ + public function __construct(bool $stateful = false) + { + $this->stateful = $stateful ?? false; + } + /** * Returns last warning message string * @@ -50,7 +65,9 @@ protected function getWarningMessage() public function isExists($path) { $filename = $this->getScheme() . $path; - clearstatcache(false, $filename); + if (!$this->stateful) { + clearstatcache(false, $filename); + } $result = @file_exists($filename); if ($result === null) { throw new FileSystemException( @@ -70,7 +87,9 @@ public function isExists($path) public function stat($path) { $filename = $this->getScheme() . $path; - clearstatcache(false, $filename); + if (!$this->stateful) { + clearstatcache(false, $filename); + } $result = @stat($filename); if (!$result) { throw new FileSystemException( @@ -90,7 +109,9 @@ public function stat($path) public function isReadable($path) { $filename = $this->getScheme() . $path; - clearstatcache(false, $filename); + if (!$this->stateful) { + clearstatcache(false, $filename); + } $result = @is_readable($filename); if ($result === null) { throw new FileSystemException( @@ -110,7 +131,9 @@ public function isReadable($path) public function isFile($path) { $filename = $this->getScheme() . $path; - clearstatcache(false, $filename); + if (!$this->stateful) { + clearstatcache(false, $filename); + } $result = @is_file($filename); if ($result === null) { throw new FileSystemException( @@ -130,7 +153,9 @@ public function isFile($path) public function isDirectory($path) { $filename = $this->getScheme() . $path; - clearstatcache(false, $filename); + if (!$this->stateful) { + clearstatcache(false, $filename); + } $result = @is_dir($filename); if ($result === null) { throw new FileSystemException( @@ -152,7 +177,9 @@ public function isDirectory($path) public function fileGetContents($path, $flag = null, $context = null) { $filename = $this->getScheme() . $path; - clearstatcache(false, $filename); + if (!$this->stateful) { + clearstatcache(false, $filename); + } $result = @file_get_contents($filename, $flag, $context); if (false === $result) { throw new FileSystemException( @@ -175,7 +202,9 @@ public function fileGetContents($path, $flag = null, $context = null) public function isWritable($path) { $filename = $this->getScheme() . $path; - clearstatcache(false, $filename); + if (!$this->stateful) { + clearstatcache(false, $filename); + } $result = @is_writable($filename); if ($result === null) { throw new FileSystemException( @@ -206,6 +235,9 @@ public function getParentDirectory($path) */ public function createDirectory($path, $permissions = 0777) { + if ($this->stateful) { + clearstatcache(true, $path); + } return $this->mkdirRecursive($path, $permissions); } @@ -228,6 +260,9 @@ private function mkdirRecursive($path, $permissions = 0777) $this->mkdirRecursive($parentDir, $permissions); } $result = @mkdir($path, $permissions); + if ($this->stateful) { + clearstatcache(true, $path); + } if (!$result) { if (is_dir($path)) { $result = true; @@ -280,7 +315,9 @@ public function readDirectory($path) */ public function search($pattern, $path) { - clearstatcache(); + if (!$this->stateful) { + clearstatcache(); + } $globPattern = rtrim($path, '/') . '/' . ltrim($pattern, '/'); $result = Glob::glob($globPattern, Glob::GLOB_BRACE); return is_array($result) ? $result : []; @@ -301,6 +338,10 @@ public function rename($oldPath, $newPath, DriverInterface $targetDriver = null) $targetDriver = $targetDriver ?: $this; if (get_class($targetDriver) === get_class($this)) { $result = @rename($this->getScheme() . $oldPath, $newPath); + if ($this->stateful) { + clearstatcache(true, $this->getScheme() . $oldPath); + clearstatcache(true, $newPath); + } $this->changePermissions($newPath, 0777 & ~umask()); } else { $content = $this->fileGetContents($oldPath); @@ -333,6 +374,9 @@ public function copy($source, $destination, DriverInterface $targetDriver = null $targetDriver = $targetDriver ?: $this; if (get_class($targetDriver) === get_class($this)) { $result = @copy($this->getScheme() . $source, $destination); + if ($this->stateful) { + clearstatcache(true, $destination); + } } else { $content = $this->fileGetContents($source); $result = $targetDriver->filePutContents($destination, $content); @@ -366,6 +410,9 @@ public function symlink($source, $destination, DriverInterface $targetDriver = n $result = false; if ($targetDriver === null || get_class($targetDriver) == get_class($this)) { $result = @symlink($this->getScheme() . $source, $destination); + if ($this->stateful) { + clearstatcache(true, $destination); + } } if (!$result) { throw new FileSystemException( @@ -392,6 +439,9 @@ public function symlink($source, $destination, DriverInterface $targetDriver = n public function deleteFile($path) { $result = @unlink($this->getScheme() . $path); + if ($this->stateful) { + clearstatcache(true, $this->getScheme() . $path); + } if (!$result) { throw new FileSystemException( new Phrase( @@ -442,6 +492,9 @@ public function deleteDirectory($path) } else { $result = @rmdir($fullPath); } + if ($this->stateful) { + clearstatcache(true, $fullPath); + } if (!$result) { throw new FileSystemException( new Phrase( @@ -464,6 +517,9 @@ public function deleteDirectory($path) public function changePermissions($path, $permissions) { $result = @chmod($this->getScheme() . $path, $permissions); + if ($this->stateful) { + clearstatcache(false, $this->getScheme() . $path); + } if (!$result) { throw new FileSystemException( new Phrase( @@ -492,6 +548,10 @@ public function changePermissionsRecursively($path, $dirPermissions, $filePermis } else { $result = @chmod($path, $dirPermissions); } + if ($this->stateful) { + clearstatcache(false, $this->getScheme() . $path); + } + if (!$result) { throw new FileSystemException( new Phrase( @@ -541,6 +601,9 @@ public function touch($path, $modificationTime = null) } else { $result = @touch($this->getScheme() . $path, $modificationTime); } + if ($this->stateful) { + clearstatcache(true, $this->getScheme() . $path); + } if (!$result) { throw new FileSystemException( new Phrase( @@ -564,6 +627,9 @@ public function touch($path, $modificationTime = null) public function filePutContents($path, $content, $mode = null) { $result = @file_put_contents($this->getScheme() . $path, $content, $mode); + if ($this->stateful) { + clearstatcache(true, $this->getScheme() . $path); + } if ($result === false) { throw new FileSystemException( new Phrase( @@ -586,6 +652,9 @@ public function filePutContents($path, $content, $mode = null) public function fileOpen($path, $mode) { $result = @fopen($this->getScheme() . $path, $mode); + if ($this->stateful) { + clearstatcache(true, $this->getScheme() . $path); + } if (!$result) { throw new FileSystemException( new Phrase('File "%1" cannot be opened %2', [$path, $this->getWarningMessage()]) @@ -706,7 +775,7 @@ public function fileSeek($resource, $offset, $whence = SEEK_SET) * Returns true if pointer at the end of file or in case of exception * * @param resource $resource - * @return boolean + * @return bool */ public function endOfFile($resource) { @@ -717,7 +786,7 @@ public function endOfFile($resource) * Close file * * @param resource $resource - * @return boolean + * @return bool * @throws FileSystemException */ public function fileClose($resource) @@ -991,9 +1060,12 @@ public function getRealPath($path) */ public function getRealPathSafety($path) { - if (strpos($path, DIRECTORY_SEPARATOR . '.') === false) { - return $path; - } + //Check backslashes + $path = preg_replace( + '/\\\\+/', + DIRECTORY_SEPARATOR, + $path + ); //Removing redundant directory separators. $path = preg_replace( @@ -1001,6 +1073,11 @@ public function getRealPathSafety($path) DIRECTORY_SEPARATOR, $path ); + + if (strpos($path, DIRECTORY_SEPARATOR . '.') === false) { + return rtrim($path, DIRECTORY_SEPARATOR); + } + $pathParts = explode(DIRECTORY_SEPARATOR, $path); if (end($pathParts) == '.') { $pathParts[count($pathParts) - 1] = ''; @@ -1016,6 +1093,7 @@ public function getRealPathSafety($path) } $realPath[] = $pathPart; } - return implode(DIRECTORY_SEPARATOR, $realPath); + + return rtrim(implode(DIRECTORY_SEPARATOR, $realPath), DIRECTORY_SEPARATOR); } } diff --git a/lib/internal/Magento/Framework/Filesystem/Driver/StatefulFile.php b/lib/internal/Magento/Framework/Filesystem/Driver/StatefulFile.php index 9f69a38527ab3..4cccb4e46406d 100644 --- a/lib/internal/Magento/Framework/Filesystem/Driver/StatefulFile.php +++ b/lib/internal/Magento/Framework/Filesystem/Driver/StatefulFile.php @@ -8,16 +8,16 @@ namespace Magento\Framework\Filesystem\Driver; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Filesystem\DriverInterface; -use Magento\Framework\Filesystem\Glob; -use Magento\Framework\Phrase; /** * Filesystem driver that uses the local filesystem. * * Assumed that stat cache is cleanup by data modification methods * + * @deprecated moved most of the functionality back to File * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ class StatefulFile implements DriverInterface @@ -27,6 +27,22 @@ class StatefulFile implements DriverInterface */ protected $scheme = ''; + /** + * @var File + */ + private $driverFile; + + /** + * StatefulFile constructor. + * @param File $driverFile + */ + public function __construct(File $driverFile = null) + { + $this->driverFile = $driverFile ?? ObjectManager::getInstance()->create( + File::class, + ['stateful' => true] + ); + } /** * Returns last warning message string * @@ -50,13 +66,7 @@ protected function getWarningMessage() */ public function isExists($path) { - $result = @file_exists($this->getScheme() . $path); - if ($result === null) { - throw new FileSystemException( - new Phrase('An error occurred during "%1" execution.', [$this->getWarningMessage()]) - ); - } - return $result; + return $this->driverFile->isExists($path); } /** @@ -68,13 +78,7 @@ public function isExists($path) */ public function stat($path) { - $result = @stat($this->getScheme() . $path); - if (!$result) { - throw new FileSystemException( - new Phrase('Cannot gather stats! %1', [$this->getWarningMessage()]) - ); - } - return $result; + return $this->driverFile->stat($path); } /** @@ -86,13 +90,7 @@ public function stat($path) */ public function isReadable($path) { - $result = @is_readable($this->getScheme() . $path); - if ($result === null) { - throw new FileSystemException( - new Phrase('An error occurred during "%1" execution.', [$this->getWarningMessage()]) - ); - } - return $result; + return $this->driverFile->isReadable($path); } /** @@ -104,13 +102,7 @@ public function isReadable($path) */ public function isFile($path) { - $result = @is_file($this->getScheme() . $path); - if ($result === null) { - throw new FileSystemException( - new Phrase('An error occurred during "%1" execution.', [$this->getWarningMessage()]) - ); - } - return $result; + return $this->driverFile->isFile($path); } /** @@ -122,13 +114,7 @@ public function isFile($path) */ public function isDirectory($path) { - $result = @is_dir($this->getScheme() . $path); - if ($result === null) { - throw new FileSystemException( - new Phrase('An error occurred during "%1" execution.', [$this->getWarningMessage()]) - ); - } - return $result; + return $this->driverFile->isDirectory($path); } /** @@ -142,16 +128,7 @@ public function isDirectory($path) */ public function fileGetContents($path, $flag = null, $context = null) { - $result = @file_get_contents($this->getScheme() . $path, $flag, $context); - if (false === $result) { - throw new FileSystemException( - new Phrase( - 'The contents from the "%1" file can\'t be read. %2', - [$path, $this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->fileGetContents($path, $flag, $context); } /** @@ -163,13 +140,7 @@ public function fileGetContents($path, $flag = null, $context = null) */ public function isWritable($path) { - $result = @is_writable($this->getScheme() . $path); - if ($result === null) { - throw new FileSystemException( - new Phrase('An error occurred during "%1" execution.', [$this->getWarningMessage()]) - ); - } - return $result; + return $this->driverFile->isWritable($path); } /** @@ -180,7 +151,7 @@ public function isWritable($path) */ public function getParentDirectory($path) { - return dirname($this->getScheme() . $path); + return $this->driverFile->getParentDirectory($path); } /** @@ -193,43 +164,7 @@ public function getParentDirectory($path) */ public function createDirectory($path, $permissions = 0777) { - clearstatcache(true, $path); - return $this->mkdirRecursive($path, $permissions); - } - - /** - * Create a directory recursively taking into account race conditions - * - * @param string $path - * @param int $permissions - * @return bool - * @throws FileSystemException - */ - private function mkdirRecursive($path, $permissions = 0777) - { - $path = $this->getScheme() . $path; - if (is_dir($path)) { - return true; - } - $parentDir = dirname($path); - while (!is_dir($parentDir)) { - $this->mkdirRecursive($parentDir, $permissions); - } - $result = @mkdir($path, $permissions); - clearstatcache(true, $path); - if (!$result) { - if (is_dir($path)) { - $result = true; - } else { - throw new FileSystemException( - new Phrase( - 'Directory "%1" cannot be created %2', - [$path, $this->getWarningMessage()] - ) - ); - } - } - return $result; + return $this->driverFile->createDirectory($path, $permissions); } /** @@ -241,19 +176,7 @@ private function mkdirRecursive($path, $permissions = 0777) */ public function readDirectory($path) { - try { - $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS; - $iterator = new \FilesystemIterator($path, $flags); - $result = []; - /** @var \FilesystemIterator $file */ - foreach ($iterator as $file) { - $result[] = $file->getPathname(); - } - sort($result); - return $result; - } catch (\Exception $e) { - throw new FileSystemException(new Phrase($e->getMessage()), $e); - } + return $this->driverFile->readDirectory($path); } /** @@ -266,9 +189,7 @@ public function readDirectory($path) */ public function search($pattern, $path) { - $globPattern = rtrim($path, '/') . '/' . ltrim($pattern, '/'); - $result = Glob::glob($globPattern, Glob::GLOB_BRACE); - return is_array($result) ? $result : []; + return $this->driverFile->search($pattern, $path); } /** @@ -282,27 +203,7 @@ public function search($pattern, $path) */ public function rename($oldPath, $newPath, DriverInterface $targetDriver = null) { - $result = false; - $targetDriver = $targetDriver ?: $this; - if (get_class($targetDriver) == get_class($this)) { - $result = @rename($this->getScheme() . $oldPath, $newPath); - clearstatcache(true, $this->getScheme() . $oldPath); - clearstatcache(true, $newPath); - } else { - $content = $this->fileGetContents($oldPath); - if (false !== $targetDriver->filePutContents($newPath, $content)) { - $result = $this->deleteFile($newPath); - } - } - if (!$result) { - throw new FileSystemException( - new Phrase( - 'The path "%1" cannot be renamed into "%2" %3', - [$oldPath, $newPath, $this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->rename($oldPath, $newPath, $targetDriver); } /** @@ -316,27 +217,7 @@ public function rename($oldPath, $newPath, DriverInterface $targetDriver = null) */ public function copy($source, $destination, DriverInterface $targetDriver = null) { - $targetDriver = $targetDriver ?: $this; - if (get_class($targetDriver) == get_class($this)) { - $result = @copy($this->getScheme() . $source, $destination); - clearstatcache(true, $destination); - } else { - $content = $this->fileGetContents($source); - $result = $targetDriver->filePutContents($destination, $content); - } - if (!$result) { - throw new FileSystemException( - new Phrase( - 'The file or directory "%1" cannot be copied to "%2" %3', - [ - $source, - $destination, - $this->getWarningMessage() - ] - ) - ); - } - return $result; + return $this->driverFile->copy($source, $destination, $targetDriver); } /** @@ -350,24 +231,7 @@ public function copy($source, $destination, DriverInterface $targetDriver = null */ public function symlink($source, $destination, DriverInterface $targetDriver = null) { - $result = false; - if ($targetDriver === null || get_class($targetDriver) == get_class($this)) { - $result = @symlink($this->getScheme() . $source, $destination); - clearstatcache(true, $destination); - } - if (!$result) { - throw new FileSystemException( - new Phrase( - 'A symlink for "%1" can\'t be created and placed to "%2". %3', - [ - $source, - $destination, - $this->getWarningMessage() - ] - ) - ); - } - return $result; + return $this->driverFile->symlink($source, $destination, $targetDriver); } /** @@ -379,17 +243,7 @@ public function symlink($source, $destination, DriverInterface $targetDriver = n */ public function deleteFile($path) { - $result = @unlink($this->getScheme() . $path); - clearstatcache(true, $this->getScheme() . $path); - if (!$result) { - throw new FileSystemException( - new Phrase( - 'The "%1" file can\'t be deleted. %2', - [$path, $this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->deleteFile($path); } /** @@ -401,46 +255,7 @@ public function deleteFile($path) */ public function deleteDirectory($path) { - $exceptionMessages = []; - $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS; - $iterator = new \FilesystemIterator($path, $flags); - /** @var \FilesystemIterator $entity */ - foreach ($iterator as $entity) { - try { - if ($entity->isDir()) { - $this->deleteDirectory($entity->getPathname()); - } else { - $this->deleteFile($entity->getPathname()); - } - } catch (FileSystemException $exception) { - $exceptionMessages[] = $exception->getMessage(); - } - } - - if (!empty($exceptionMessages)) { - throw new FileSystemException( - new Phrase( - \implode(' ', $exceptionMessages) - ) - ); - } - - $fullPath = $this->getScheme() . $path; - if (is_link($fullPath)) { - $result = @unlink($fullPath); - } else { - $result = @rmdir($fullPath); - } - clearstatcache(true, $fullPath); - if (!$result) { - throw new FileSystemException( - new Phrase( - 'The directory "%1" cannot be deleted %2', - [$path, $this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->deleteDirectory($path); } /** @@ -453,17 +268,7 @@ public function deleteDirectory($path) */ public function changePermissions($path, $permissions) { - $result = @chmod($this->getScheme() . $path, $permissions); - clearstatcache(false, $this->getScheme() . $path); - if (!$result) { - throw new FileSystemException( - new Phrase( - 'The permissions can\'t be changed for the "%1" path. %2.', - [$path, $this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->changePermissions($path, $permissions); } /** @@ -477,46 +282,7 @@ public function changePermissions($path, $permissions) */ public function changePermissionsRecursively($path, $dirPermissions, $filePermissions) { - $result = true; - if ($this->isFile($path)) { - $result = @chmod($path, $filePermissions); - } else { - $result = @chmod($path, $dirPermissions); - } - clearstatcache(false, $this->getScheme() . $path); - - if (!$result) { - throw new FileSystemException( - new Phrase( - 'The permissions can\'t be changed for the "%1" path. %2.', - [$path, $this->getWarningMessage()] - ) - ); - } - - $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS; - - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path, $flags), - \RecursiveIteratorIterator::CHILD_FIRST - ); - /** @var \FilesystemIterator $entity */ - foreach ($iterator as $entity) { - if ($entity->isDir()) { - $result = @chmod($entity->getPathname(), $dirPermissions); - } else { - $result = @chmod($entity->getPathname(), $filePermissions); - } - if (!$result) { - throw new FileSystemException( - new Phrase( - 'The permissions can\'t be changed for the "%1" path. %2.', - [$path, $this->getWarningMessage()] - ) - ); - } - } - return $result; + return $this->driverFile->changePermissionsRecursively($path, $dirPermissions, $filePermissions); } /** @@ -529,21 +295,7 @@ public function changePermissionsRecursively($path, $dirPermissions, $filePermis */ public function touch($path, $modificationTime = null) { - if (!$modificationTime) { - $result = @touch($this->getScheme() . $path); - } else { - $result = @touch($this->getScheme() . $path, $modificationTime); - } - clearstatcache(true, $this->getScheme() . $path); - if (!$result) { - throw new FileSystemException( - new Phrase( - 'The "%1" file or directory can\'t be touched. %2', - [$path, $this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->touch($path, $modificationTime); } /** @@ -557,17 +309,7 @@ public function touch($path, $modificationTime = null) */ public function filePutContents($path, $content, $mode = null) { - $result = @file_put_contents($this->getScheme() . $path, $content, $mode); - clearstatcache(true, $this->getScheme() . $path); - if (!$result) { - throw new FileSystemException( - new Phrase( - 'The specified "%1" file couldn\'t be written. %2', - [$path, $this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->filePutContents($path, $content, $mode); } /** @@ -580,14 +322,7 @@ public function filePutContents($path, $content, $mode = null) */ public function fileOpen($path, $mode) { - $result = @fopen($this->getScheme() . $path, $mode); - clearstatcache(true, $this->getScheme() . $path); - if (!$result) { - throw new FileSystemException( - new Phrase('File "%1" cannot be opened %2', [$path, $this->getWarningMessage()]) - ); - } - return $result; + return $this->driverFile->fileOpen($path, $mode); } /** @@ -601,15 +336,7 @@ public function fileOpen($path, $mode) */ public function fileReadLine($resource, $length, $ending = null) { - // phpcs:disable - $result = @stream_get_line($resource, $length, $ending); - // phpcs:enable - if (false === $result) { - throw new FileSystemException( - new Phrase('File cannot be read %1', [$this->getWarningMessage()]) - ); - } - return $result; + return $this->driverFile->fileReadLine($resource, $length, $ending); } /** @@ -622,13 +349,7 @@ public function fileReadLine($resource, $length, $ending = null) */ public function fileRead($resource, $length) { - $result = @fread($resource, $length); - if ($result === false) { - throw new FileSystemException( - new Phrase('File cannot be read %1', [$this->getWarningMessage()]) - ); - } - return $result; + return $this->driverFile->fileRead($resource, $length); } /** @@ -644,16 +365,7 @@ public function fileRead($resource, $length) */ public function fileGetCsv($resource, $length = 0, $delimiter = ',', $enclosure = '"', $escape = "\0") { - $result = @fgetcsv($resource, $length, $delimiter, $enclosure, $escape); - if ($result === null) { - throw new FileSystemException( - new Phrase( - 'The "%1" CSV handle is incorrect. Verify the handle and try again.', - [$this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->fileGetCsv($resource, $length, $delimiter, $enclosure, $escape); } /** @@ -665,13 +377,7 @@ public function fileGetCsv($resource, $length = 0, $delimiter = ',', $enclosure */ public function fileTell($resource) { - $result = @ftell($resource); - if ($result === null) { - throw new FileSystemException( - new Phrase('An error occurred during "%1" execution.', [$this->getWarningMessage()]) - ); - } - return $result; + return $this->driverFile->fileTell($resource); } /** @@ -685,48 +391,30 @@ public function fileTell($resource) */ public function fileSeek($resource, $offset, $whence = SEEK_SET) { - $result = @fseek($resource, $offset, $whence); - if ($result === -1) { - throw new FileSystemException( - new Phrase( - 'An error occurred during "%1" fileSeek execution.', - [$this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->fileSeek($resource, $offset, $whence); } /** * Returns true if pointer at the end of file or in case of exception * * @param resource $resource - * @return boolean + * @return bool */ public function endOfFile($resource) { - return feof($resource); + return $this->driverFile->endOfFile($resource); } /** * Close file * * @param resource $resource - * @return boolean + * @return bool * @throws FileSystemException */ public function fileClose($resource) { - $result = @fclose($resource); - if (!$result) { - throw new FileSystemException( - new Phrase( - 'An error occurred during "%1" fileClose execution.', - [$this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->fileClose($resource); } /** @@ -739,34 +427,7 @@ public function fileClose($resource) */ public function fileWrite($resource, $data) { - $lenData = strlen($data); - for ($result = 0; $result < $lenData; $result += $fwrite) { - $fwrite = @fwrite($resource, substr($data, $result)); - if (0 === $fwrite) { - $this->fileSystemException('Unable to write'); - } - if (false === $fwrite) { - $this->fileSystemException( - 'An error occurred during "%1" fileWrite execution.', - [$this->getWarningMessage()] - ); - } - } - - return $result; - } - - /** - * Throw a FileSystemException with a Phrase of message and optional arguments - * - * @param string $message - * @param array $arguments - * @return void - * @throws FileSystemException - */ - private function fileSystemException($message, $arguments = []) - { - throw new FileSystemException(new Phrase($message, $arguments)); + return $this->driverFile->fileWrite($resource, $data); } /** @@ -781,31 +442,7 @@ private function fileSystemException($message, $arguments = []) */ public function filePutCsv($resource, array $data, $delimiter = ',', $enclosure = '"') { - /** - * Security enhancement for CSV data processing by Excel-like applications. - * @see https://bugzilla.mozilla.org/show_bug.cgi?id=1054702 - * - * @var $value string|Phrase - */ - foreach ($data as $key => $value) { - if (!is_string($value)) { - $value = (string)$value; - } - if (isset($value[0]) && in_array($value[0], ['=', '+', '-'])) { - $data[$key] = ' ' . $value; - } - } - - $result = @fputcsv($resource, $data, $delimiter, $enclosure); - if (!$result) { - throw new FileSystemException( - new Phrase( - 'An error occurred during "%1" filePutCsv execution.', - [$this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->filePutCsv($resource, $data, $delimiter, $enclosure); } /** @@ -817,16 +454,7 @@ public function filePutCsv($resource, array $data, $delimiter = ',', $enclosure */ public function fileFlush($resource) { - $result = @fflush($resource); - if (!$result) { - throw new FileSystemException( - new Phrase( - 'An error occurred during "%1" fileFlush execution.', - [$this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->fileFlush($resource); } /** @@ -839,16 +467,7 @@ public function fileFlush($resource) */ public function fileLock($resource, $lockMode = LOCK_EX) { - $result = @flock($resource, $lockMode); - if (!$result) { - throw new FileSystemException( - new Phrase( - 'An error occurred during "%1" fileLock execution.', - [$this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->fileLock($resource, $lockMode); } /** @@ -860,16 +479,7 @@ public function fileLock($resource, $lockMode = LOCK_EX) */ public function fileUnlock($resource) { - $result = @flock($resource, LOCK_UN); - if (!$result) { - throw new FileSystemException( - new Phrase( - 'An error occurred during "%1" fileUnlock execution.', - [$this->getWarningMessage()] - ) - ); - } - return $result; + return $this->driverFile->fileUnlock($resource); } /** @@ -882,14 +492,7 @@ public function fileUnlock($resource) */ public function getAbsolutePath($basePath, $path, $scheme = null) { - // check if the path given is already an absolute path containing the - // basepath. so if the basepath starts at position 0 in the path, we - // must not concatinate them again because path is already absolute. - if (0 === strpos($path, $basePath)) { - return $this->getScheme($scheme) . $path; - } - - return $this->getScheme($scheme) . $basePath . ltrim($this->fixSeparator($path), '/'); + return $this->driverFile->getAbsolutePath($basePath, $path, $scheme); } /** @@ -901,13 +504,7 @@ public function getAbsolutePath($basePath, $path, $scheme = null) */ public function getRelativePath($basePath, $path = null) { - $path = $this->fixSeparator($path); - if (strpos($path, $basePath) === 0 || $basePath == $path . '/') { - $result = substr($path, strlen($basePath)); - } else { - $result = $path; - } - return $result; + return $this->driverFile->getRelativePath($basePath, $path); } /** @@ -943,21 +540,7 @@ protected function getScheme($scheme = null) */ public function readDirectoryRecursively($path = null) { - $result = []; - $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS; - try { - $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path, $flags), - \RecursiveIteratorIterator::CHILD_FIRST - ); - /** @var \FilesystemIterator $file */ - foreach ($iterator as $file) { - $result[] = $file->getPathname(); - } - } catch (\Exception $e) { - throw new FileSystemException(new Phrase($e->getMessage()), $e); - } - return $result; + return $this->driverFile->readDirectoryRecursively($path); } /** @@ -969,7 +552,7 @@ public function readDirectoryRecursively($path = null) */ public function getRealPath($path) { - return realpath($path); + return $this->driverFile->getRealPath($path); } /** @@ -980,28 +563,6 @@ public function getRealPath($path) */ public function getRealPathSafety($path) { - if (strpos($path, DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR) === false) { - return $path; - } - - //Removing redundant directory separators. - $path = preg_replace( - '/\\' . DIRECTORY_SEPARATOR . '\\' . DIRECTORY_SEPARATOR . '+/', - DIRECTORY_SEPARATOR, - $path - ); - $pathParts = explode(DIRECTORY_SEPARATOR, $path); - $realPath = []; - foreach ($pathParts as $pathPart) { - if ($pathPart == '.') { - continue; - } - if ($pathPart == '..') { - array_pop($realPath); - continue; - } - $realPath[] = $pathPart; - } - return implode(DIRECTORY_SEPARATOR, $realPath); + return $this->driverFile->getRealPathSafety($path); } } diff --git a/lib/internal/Magento/Framework/Filesystem/Io/Ftp.php b/lib/internal/Magento/Framework/Filesystem/Io/Ftp.php index 0027329e7d54c..13138c0d3b30c 100644 --- a/lib/internal/Magento/Framework/Filesystem/Io/Ftp.php +++ b/lib/internal/Magento/Framework/Filesystem/Io/Ftp.php @@ -316,7 +316,7 @@ public function ls($grep = null) $ls = @ftp_nlist($this->_conn, '.') ?: []; $list = []; - + foreach ($ls as $file) { $list[] = ['text' => $file, 'id' => $this->pwd() . '/' . $file]; } @@ -331,6 +331,8 @@ public function ls($grep = null) protected function _tmpFilename($new = false) { if ($new || !$this->_tmpFilename) { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $this->_tmpFilename = tempnam(md5(uniqid(rand(), true)), ''); } return $this->_tmpFilename; diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Directory/PathValidatorTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Directory/PathValidatorTest.php index e3279c4c5f56b..b74268a869537 100644 --- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Directory/PathValidatorTest.php +++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Directory/PathValidatorTest.php @@ -59,8 +59,8 @@ public function testValidate($directoryPath, $path, $scheme, $absolutePath, $pre ->method('getRealPathSafety') ->willReturnMap( [ - [$directoryPath, $directoryPath], - [null, $prefix . $directoryPath . ltrim($path, '/')], + [$directoryPath, rtrim($directoryPath, DIRECTORY_SEPARATOR)], + [null, $prefix . $directoryPath . ltrim($path, DIRECTORY_SEPARATOR)], ] ); diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/FileTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/FileTest.php index 58cabe561419b..9c82ce6bbc35b 100644 --- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/FileTest.php +++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/FileTest.php @@ -5,9 +5,6 @@ */ declare(strict_types=1); - -declare(strict_types=1); - namespace Magento\Framework\Filesystem\Test\Unit\Driver; use Magento\Framework\Filesystem\Driver\File; @@ -113,11 +110,16 @@ public function dataProviderForTestGetRealPathSafety(): array ['/1/.test', '/1/.test'], ['/1/..test', '/1/..test'], ['/1/.test/.test', '/1/.test/.test'], - ['/1/2/./.', '/1/2/'], + ['/1/2/./.', '/1/2'], + ['/1/2/./././', '/1/2'], ['/1/2/3/../..', '/1'], - ['/1/2/3/.', '/1/2/3/'], + ['/1/2/3/.', '/1/2/3'], ['/1/2/3/./4/5', '/1/2/3/4/5'], - ['/1/2/3/../4/5', '/1/2/4/5'] + ['/1/2/3/../4/5', '/1/2/4/5'], + ['1/2/.//.\3/4/..\..\5', '1/2/5'], + ['\./.test', '/.test'], + ['\\1/\\\.\..test', '/1/..test'], + ['/1/2\\3\\\.', '/1/2/3'] ]; } } diff --git a/lib/internal/Magento/Framework/Interception/Code/InterfaceValidator.php b/lib/internal/Magento/Framework/Interception/Code/InterfaceValidator.php index b67af21878c3d..5eab8dd62ebd3 100644 --- a/lib/internal/Magento/Framework/Interception/Code/InterfaceValidator.php +++ b/lib/internal/Magento/Framework/Interception/Code/InterfaceValidator.php @@ -8,6 +8,9 @@ use Magento\Framework\Code\Reader\ArgumentsReader; use Magento\Framework\Exception\ValidatorException; use Magento\Framework\Phrase; +use ReflectionClass; +use ReflectionException; +use ReflectionParameter; /** * @SuppressWarnings(PHPMD.NPathComplexity) @@ -162,16 +165,32 @@ protected function validateMethodsParameters(array $pluginParameters, array $ori /** * Get parameters type * - * @param \ReflectionParameter $parameter + * @param ReflectionParameter $parameter * * @return string */ - protected function getParametersType(\ReflectionParameter $parameter) + protected function getParametersType(ReflectionParameter $parameter) { - $parameterClass = $parameter->getClass(); + $parameterClass = $this->getParameterClass($parameter); return $parameterClass ? '\\' . $parameterClass->getName() : ($parameter->isArray() ? 'array' : null); } + /** + * Get class by reflection parameter + * + * @param ReflectionParameter $reflectionParameter + * @return ReflectionClass|null + * @throws ReflectionException + */ + private function getParameterClass(ReflectionParameter $reflectionParameter): ?ReflectionClass + { + $parameterType = $reflectionParameter->getType(); + + return $parameterType && !$parameterType->isBuiltin() + ? new ReflectionClass($parameterType->getName()) + : null; + } + /** * Get intercepted method name * diff --git a/lib/internal/Magento/Framework/Jwt/Claim/AbstractClaim.php b/lib/internal/Magento/Framework/Jwt/Claim/AbstractClaim.php new file mode 100644 index 0000000000000..92e5934a9547b --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Claim/AbstractClaim.php @@ -0,0 +1,91 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Claim; + +use Magento\Framework\Jwt\ClaimInterface; + +/** + * Abstract user-defined claim. + */ +abstract class AbstractClaim implements ClaimInterface +{ + /** + * @var string + */ + private $name; + + /** + * @var int|float|string|bool|array|null + */ + private $value; + + /** + * @var int|null + */ + private $class; + + /** + * @var bool + */ + private $duplicated; + + /** + * Parse NumericDate and return DateTime with UTC timezone. + * + * @param string $date + * @return \DateTimeInterface + */ + public static function parseNumericDate(string $date): \DateTimeInterface + { + $dt = \DateTime::createFromFormat('Y-m-d\TH:i:sT', $date); + $dt->setTimezone(new \DateTimeZone('UTC')); + + return \DateTimeImmutable::createFromMutable($dt); + } + + public function __construct(string $name, $value, ?int $class, bool $duplicated = false) + { + $this->name = $name; + $this->value = $value; + $this->class = $class; + $this->duplicated = $duplicated; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return $this->name; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return $this->class; + } + + /** + * @inheritDoc + */ + public function isHeaderDuplicated(): bool + { + return $this->duplicated; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Claim/Audience.php b/lib/internal/Magento/Framework/Jwt/Claim/Audience.php new file mode 100644 index 0000000000000..2d4f5099d7296 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Claim/Audience.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Claim; + +use Magento\Framework\Jwt\ClaimInterface; + +/** + * "aud" claim. + */ +class Audience implements ClaimInterface +{ + /** + * @var string[] + */ + private $value; + + /** + * @var bool + */ + private $duplicate; + + /** + * @param string[] $value + * @param bool $duplicate + */ + public function __construct(array $value, bool $duplicate = false) + { + if (!$value) { + throw new \InvalidArgumentException("Audience list cannot be empty"); + } + $this->value = $value; + $this->duplicate = $duplicate; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'aud'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return json_encode($this->value); + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } + + /** + * @inheritDoc + */ + public function isHeaderDuplicated(): bool + { + return $this->duplicate; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Claim/ExpirationTime.php b/lib/internal/Magento/Framework/Jwt/Claim/ExpirationTime.php new file mode 100644 index 0000000000000..fe3c8da24af60 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Claim/ExpirationTime.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Claim; + +use Magento\Framework\Jwt\ClaimInterface; + +/** + * "exp" claim. + */ +class ExpirationTime implements ClaimInterface +{ + /** + * @var string + */ + private $value; + + /** + * @var bool + */ + private $duplicate; + + /** + * @param \DateTimeInterface $value + * @param bool $duplicate + */ + public function __construct(\DateTimeInterface $value, bool $duplicate = false) + { + if ($value instanceof \DateTimeImmutable) { + $value = \DateTime::createFromImmutable($value); + } + $value->setTimezone(new \DateTimeZone('UTC')); + $this->value = $value->format('Y-m-d\TH:i:s\Z UTC'); + $this->duplicate = $duplicate; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'exp'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } + + /** + * @inheritDoc + */ + public function isHeaderDuplicated(): bool + { + return $this->duplicate; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Claim/IssuedAt.php b/lib/internal/Magento/Framework/Jwt/Claim/IssuedAt.php new file mode 100644 index 0000000000000..6e4c94e0cc350 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Claim/IssuedAt.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Claim; + +use Magento\Framework\Jwt\ClaimInterface; + +/** + * "iat" claim. + */ +class IssuedAt implements ClaimInterface +{ + /** + * @var string + */ + private $value; + + /** + * @var bool + */ + private $duplicate; + + /** + * @param \DateTimeInterface $value + * @param bool $duplicate + */ + public function __construct(\DateTimeInterface $value, bool $duplicate = false) + { + if ($value instanceof \DateTimeImmutable) { + $value = \DateTime::createFromImmutable($value); + } + $value->setTimezone(new \DateTimeZone('UTC')); + $this->value = $value->format('Y-m-d\TH:i:s\Z UTC'); + $this->duplicate = $duplicate; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'iat'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } + + /** + * @inheritDoc + */ + public function isHeaderDuplicated(): bool + { + return $this->duplicate; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Claim/Issuer.php b/lib/internal/Magento/Framework/Jwt/Claim/Issuer.php new file mode 100644 index 0000000000000..16befd23a9963 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Claim/Issuer.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Claim; + +use Magento\Framework\Jwt\ClaimInterface; + +/** + * "iss" claim. + */ +class Issuer implements ClaimInterface +{ + /** + * @var string + */ + private $value; + + /** + * @var bool + */ + private $duplicate; + + /** + * @param string $value + * @param bool $duplicate + */ + public function __construct(string $value, bool $duplicate = false) + { + $this->value = $value; + $this->duplicate = $duplicate; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'iss'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } + + /** + * @inheritDoc + */ + public function isHeaderDuplicated(): bool + { + return $this->duplicate; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Claim/JwtId.php b/lib/internal/Magento/Framework/Jwt/Claim/JwtId.php new file mode 100644 index 0000000000000..3fab77c915df3 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Claim/JwtId.php @@ -0,0 +1,84 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Claim; + +use Magento\Framework\Jwt\ClaimInterface; + +/** + * "jti" claim. + */ +class JwtId implements ClaimInterface +{ + /** + * @var string + */ + private $value; + + /** + * @var bool + */ + private $duplicate; + + /** + * @param string|null $value + * @param bool $duplicate + */ + public function __construct(?string $value = null, bool $duplicate = false) + { + $this->value = $value ?? $this->generateRandom(); + $this->duplicate = $duplicate; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'jti'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } + + /** + * @inheritDoc + */ + public function isHeaderDuplicated(): bool + { + return $this->duplicate; + } + + private function generateRandom(): string + { + return implode('', array_map( + function($value) { + return chr($value); + }, + array_map( + function() { + return random_int(33, 126); + }, + array_fill(0, 21, null) + ) + )); + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Claim/NotBefore.php b/lib/internal/Magento/Framework/Jwt/Claim/NotBefore.php new file mode 100644 index 0000000000000..db4a21421efef --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Claim/NotBefore.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Claim; + +use Magento\Framework\Jwt\ClaimInterface; + +/** + * "nbf" claim. + */ +class NotBefore implements ClaimInterface +{ + /** + * @var string + */ + private $value; + + /** + * @var bool + */ + private $duplicate; + + /** + * @param \DateTimeInterface $value + * @param bool $duplicate + */ + public function __construct(\DateTimeInterface $value, bool $duplicate = false) + { + if ($value instanceof \DateTimeImmutable) { + $value = \DateTime::createFromImmutable($value); + } + $value->setTimezone(new \DateTimeZone('UTC')); + $this->value = $value->format('Y-m-d\TH:i:s\Z UTC'); + $this->duplicate = $duplicate; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'nbf'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } + + /** + * @inheritDoc + */ + public function isHeaderDuplicated(): bool + { + return $this->duplicate; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Claim/PrivateClaim.php b/lib/internal/Magento/Framework/Jwt/Claim/PrivateClaim.php new file mode 100644 index 0000000000000..821ff944d5c00 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Claim/PrivateClaim.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Claim; + +/** + * Private non-registered claim. + */ +class PrivateClaim extends AbstractClaim +{ + /** + * @param string $name + * @param $value + * @param bool $duplicated + */ + public function __construct(string $name, $value, bool $duplicated = false) + { + parent::__construct($name, $value, self::CLASS_PRIVATE, $duplicated); + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Claim/PublicClaim.php b/lib/internal/Magento/Framework/Jwt/Claim/PublicClaim.php new file mode 100644 index 0000000000000..993d03f027dda --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Claim/PublicClaim.php @@ -0,0 +1,23 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Claim; + +/** + * Public collision-resistant claim. + */ +class PublicClaim extends AbstractClaim +{ + public function __construct(string $name, $value, ?string $prefix, bool $duplicated = false) + { + if ($prefix) { + $prefix .= '-'; + } + parent::__construct($prefix .$name, $value, self::CLASS_PUBLIC, $duplicated); + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Claim/Subject.php b/lib/internal/Magento/Framework/Jwt/Claim/Subject.php new file mode 100644 index 0000000000000..2a1f12ab71dc3 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Claim/Subject.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Claim; + +use Magento\Framework\Jwt\ClaimInterface; + +/** + * "sub" claim. + */ +class Subject implements ClaimInterface +{ + /** + * @var string + */ + private $value; + + /** + * @var bool + */ + private $duplicate; + + /** + * @param string $value + * @param bool $duplicate + */ + public function __construct(string $value, bool $duplicate = false) + { + $this->value = $value; + $this->duplicate = $duplicate; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'sub'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } + + /** + * @inheritDoc + */ + public function isHeaderDuplicated(): bool + { + return $this->duplicate; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/ClaimInterface.php b/lib/internal/Magento/Framework/Jwt/ClaimInterface.php new file mode 100644 index 0000000000000..2b0278247a0fb --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/ClaimInterface.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt; + +/** + * JWT Claim. + */ +interface ClaimInterface +{ + public const CLASS_REGISTERED = 1; + + public const CLASS_PUBLIC = 2; + + public const CLASS_PRIVATE = 3; + + /** + * Claim name. + * + * @return string + */ + public function getName(): string; + + /** + * Value carried. + * + * @return mixed + */ + public function getValue(); + + /** + * Claim class when possible to identify. + * + * @return int|null + */ + public function getClass(): ?int; + + /** + * Whether to duplicate this claim to JOSE header. + * + * Only works for JWEs. + * + * @return bool + */ + public function isHeaderDuplicated(): bool; +} diff --git a/lib/internal/Magento/Framework/Jwt/EncryptionSettingsInterface.php b/lib/internal/Magento/Framework/Jwt/EncryptionSettingsInterface.php new file mode 100644 index 0000000000000..d50989904a265 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/EncryptionSettingsInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt; + +/** + * Encryption settings for JWT. + */ +interface EncryptionSettingsInterface +{ + /** + * Algorithm name. + * + * @return string + */ + public function getAlgorithmName(): string; +} diff --git a/lib/internal/Magento/Framework/Jwt/Exception/EncryptionException.php b/lib/internal/Magento/Framework/Jwt/Exception/EncryptionException.php new file mode 100644 index 0000000000000..264cd4265815a --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Exception/EncryptionException.php @@ -0,0 +1,17 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Exception; + +/** + * Thrown when encryption failed. + */ +class EncryptionException extends JwtException +{ + +} diff --git a/lib/internal/Magento/Framework/Jwt/Exception/ExpiredException.php b/lib/internal/Magento/Framework/Jwt/Exception/ExpiredException.php new file mode 100644 index 0000000000000..1aac415ea8451 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Exception/ExpiredException.php @@ -0,0 +1,75 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Exception; + +/** + * Thrown when token has expired or is not active yet. + */ +class ExpiredException extends JwtException +{ + /** + * @var int|null + */ + private $activeFrom; + + /** + * @var int|null + */ + private $expiresAt; + + /** + * @var int + */ + private $checked; + + public function __construct( + ?int $expiresAt = null, + ?int $activeFrom = null, + $message = "JWT has expired/not active yet", + \Throwable $previous = null + ) { + parent::__construct($message, 0, $previous); + if (!$expiresAt && !$activeFrom) { + throw new \InvalidArgumentException('Provide either expire time or active from time.'); + } + $this->expiresAt = $expiresAt; + $this->activeFrom = $activeFrom; + $this->checked = time(); + } + + /** + * JWT will be active from. + * + * @return int|null + */ + public function getActiveFrom(): ?int + { + return $this->activeFrom; + } + + /** + * JWT expired at. + * + * @return int|null + */ + public function getExpiresAt(): ?int + { + return $this->expiresAt; + } + + /** + * Check was performed at. + * + * @return int + */ + public function getChecked(): int + { + return $this->checked; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Exception/JwtException.php b/lib/internal/Magento/Framework/Jwt/Exception/JwtException.php new file mode 100644 index 0000000000000..dc3f99ce8c53c --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Exception/JwtException.php @@ -0,0 +1,17 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Exception; + +/** + * Thrown when processing JWTs. + */ +class JwtException extends \RuntimeException +{ + +} diff --git a/lib/internal/Magento/Framework/Jwt/Exception/MalformedTokenException.php b/lib/internal/Magento/Framework/Jwt/Exception/MalformedTokenException.php new file mode 100644 index 0000000000000..b2631ddd902a8 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Exception/MalformedTokenException.php @@ -0,0 +1,17 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Exception; + +/** + * Thrown when a token is either not a JWT, it is impossible to read with given settings or it's a bad JWT. + */ +class MalformedTokenException extends JwtException +{ + +} diff --git a/lib/internal/Magento/Framework/Jwt/Header/Algorithm.php b/lib/internal/Magento/Framework/Jwt/Header/Algorithm.php new file mode 100644 index 0000000000000..a3084509946e5 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Header/Algorithm.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +/** + * "alg" header. + */ +class Algorithm implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string + */ + private $value; + + /** + * @param string $value + */ + public function __construct(string $value) + { + $this->value = $value; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'alg'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Header/Critical.php b/lib/internal/Magento/Framework/Jwt/Header/Critical.php new file mode 100644 index 0000000000000..7b38463c624bf --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Header/Critical.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +/** + * "crit" header. + */ +class Critical implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string[] + */ + private $value; + + /** + * @param string[] $value + */ + public function __construct(array $value) + { + if (!$value) { + throw new \InvalidArgumentException('Critical header cannot be empty'); + } + $this->value = array_values($value); + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'crit'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return json_encode($this->value); + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Header/Jwk.php b/lib/internal/Magento/Framework/Jwt/Header/Jwk.php new file mode 100644 index 0000000000000..d3aa9a176e38c --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Header/Jwk.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; +use Magento\Framework\Jwt\Jwk as JwkData; + +/** + * "jwk" header. + */ +class Jwk implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var JwkData + */ + private $value; + + /** + * @param JwkData $value + */ + public function __construct(JwkData $value) + { + $this->value = $value; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'jwk'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return json_encode($this->value->getJsonData()); + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Header/JwkSetUrl.php b/lib/internal/Magento/Framework/Jwt/Header/JwkSetUrl.php new file mode 100644 index 0000000000000..f20bc7e6c1a7c --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Header/JwkSetUrl.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +/** + * "jku" header. + */ +class JwkSetUrl implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string + */ + private $value; + + /** + * @param string $value + */ + public function __construct(string $value) + { + $this->value = $value; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'jku'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Header/KeyId.php b/lib/internal/Magento/Framework/Jwt/Header/KeyId.php new file mode 100644 index 0000000000000..7c06477abd973 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Header/KeyId.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +/** + * "kid" header. + */ +class KeyId implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string + */ + private $value; + + /** + * @param string $value + */ + public function __construct(string $value) + { + $this->value = $value; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'kid'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Header/PrivateHeaderParameter.php b/lib/internal/Magento/Framework/Jwt/Header/PrivateHeaderParameter.php new file mode 100644 index 0000000000000..1158812838d04 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Header/PrivateHeaderParameter.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +class PrivateHeaderParameter implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string + */ + private $name; + + /** + * @var array|bool|int|float|string|null + */ + private $value; + + /** + * @param string $name + * @param array|bool|float|int|string|null $value + */ + public function __construct(string $name, $value) + { + $this->name = $name; + $this->value = $value; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return $this->name; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_PRIVATE; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Header/PublicHeaderParameter.php b/lib/internal/Magento/Framework/Jwt/Header/PublicHeaderParameter.php new file mode 100644 index 0000000000000..c6e7ec34d619e --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Header/PublicHeaderParameter.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +/** + * Public header. + */ +class PublicHeaderParameter implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string + */ + private $name; + + /** + * @var mixed + */ + private $value; + + /** + * @param string $name + * @param string|null $prefix Prefix for preventing collision. + * @param mixed $value + */ + public function __construct(string $name, ?string $prefix, $value) + { + $this->name = $prefix ? $prefix .'-' .$name : $name; + $this->value = $value; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return $this->name; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_PUBLIC; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Header/X509Chain.php b/lib/internal/Magento/Framework/Jwt/Header/X509Chain.php new file mode 100644 index 0000000000000..33a4b5c7dfff0 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Header/X509Chain.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +/** + * "x5c" header. + */ +class X509Chain implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string[] + */ + private $value; + + /** + * @param string[] $value + */ + public function __construct(array $value) + { + if (count($value) < 1) { + throw new \InvalidArgumentException('X.509 Certificate chain must contain at least 1 key'); + } + $this->value = $value; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'x5c'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return json_encode(array_map('base64_encode', $this->value)); + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Header/X509Sha1Thumbprint.php b/lib/internal/Magento/Framework/Jwt/Header/X509Sha1Thumbprint.php new file mode 100644 index 0000000000000..df71409dee6b2 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Header/X509Sha1Thumbprint.php @@ -0,0 +1,60 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +/** + * "x5t" header. + */ +class X509Sha1Thumbprint implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string + */ + private $value; + + /** + * @param string $value + */ + public function __construct(string $value) + { + $this->value = $this->base64UrlEncode($value); + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'x5t'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } + + private function base64UrlEncode(string $key): string + { + return rtrim(strtr(base64_encode($key), '+/', '-_'), '='); + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Header/X509Sha256Thumbprint.php b/lib/internal/Magento/Framework/Jwt/Header/X509Sha256Thumbprint.php new file mode 100644 index 0000000000000..9e4813e3efb03 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Header/X509Sha256Thumbprint.php @@ -0,0 +1,60 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +/** + * "x5t#S256" header. + */ +class X509Sha256Thumbprint implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string + */ + private $value; + + /** + * @param string $value + */ + public function __construct(string $value) + { + $this->value = $this->base64UrlEncode($value); + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'x5t#S256'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } + + private function base64UrlEncode(string $key): string + { + return rtrim(strtr(base64_encode($key), '+/', '-_'), '='); + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Header/X509Url.php b/lib/internal/Magento/Framework/Jwt/Header/X509Url.php new file mode 100644 index 0000000000000..ad561dbb8febb --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Header/X509Url.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; +use Magento\Framework\Jwt\Jws\JwsHeaderParameterInterface; + +/** + * "x5u" header. + */ +class X509Url implements JwsHeaderParameterInterface, JweHeaderParameterInterface +{ + /** + * @var string + */ + private $value; + + /** + * @param string $value + */ + public function __construct(string $value) + { + $this->value = $value; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'x5u'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/HeaderInterface.php b/lib/internal/Magento/Framework/Jwt/HeaderInterface.php new file mode 100644 index 0000000000000..44eadd1ab17dc --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/HeaderInterface.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt; + +/** + * JWT Header. + */ +interface HeaderInterface +{ + /** + * Parameters. + * + * @return HeaderParameterInterface[] + */ + public function getParameters(): array; + + /** + * Find a parameter by name. + * + * @param string $name + * @return HeaderParameterInterface|null + */ + public function getParameter(string $name): ?HeaderParameterInterface; +} diff --git a/lib/internal/Magento/Framework/Jwt/HeaderParameterInterface.php b/lib/internal/Magento/Framework/Jwt/HeaderParameterInterface.php new file mode 100644 index 0000000000000..b9240c97f5994 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/HeaderParameterInterface.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt; + +/** + * JWT Header parameter. + */ +interface HeaderParameterInterface +{ + public const CLASS_REGISTERED = 0; + + public const CLASS_PUBLIC = 1; + + public const CLASS_PRIVATE = 2; + + /** + * Header parameter's name. + * + * @return string + */ + public function getName(): string; + + /** + * Header parameter value. + * + * @return int|float|string|bool + */ + public function getValue(); + + /** + * Parameter's class if possible to identify. + * + * @return int|null + */ + public function getClass(): ?int; +} diff --git a/lib/internal/Magento/Framework/Jwt/Jwe/Header/CompressionAlgorithm.php b/lib/internal/Magento/Framework/Jwt/Jwe/Header/CompressionAlgorithm.php new file mode 100644 index 0000000000000..d9f2a68ef61af --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jwe/Header/CompressionAlgorithm.php @@ -0,0 +1,54 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jwe\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; + +/** + * "zip" header. + */ +class CompressionAlgorithm implements JweHeaderParameterInterface +{ + /** + * @var string + */ + private $value; + + /** + * @param string $value + */ + public function __construct(string $value) + { + $this->value = $value; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'zip'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Jwe/Header/Encryption.php b/lib/internal/Magento/Framework/Jwt/Jwe/Header/Encryption.php new file mode 100644 index 0000000000000..accff60827f78 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jwe/Header/Encryption.php @@ -0,0 +1,54 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jwe\Header; + +use Magento\Framework\Jwt\Jwe\JweHeaderParameterInterface; + +/** + * "enc" header. + */ +class Encryption implements JweHeaderParameterInterface +{ + /** + * @var string + */ + private $value; + + /** + * @param string $value + */ + public function __construct(string $value) + { + $this->value = $value; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return 'enc'; + } + + /** + * @inheritDoc + */ + public function getValue() + { + return $this->value; + } + + /** + * @inheritDoc + */ + public function getClass(): ?int + { + return self::CLASS_REGISTERED; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Jwe/Jwe.php b/lib/internal/Magento/Framework/Jwt/Jwe/Jwe.php new file mode 100644 index 0000000000000..8b10244fb6f87 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jwe/Jwe.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jwe; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\PayloadInterface; + +/** + * JWE DTO. + */ +class Jwe implements JweInterface +{ + /** + * @var HeaderInterface + */ + private $protectedHeader; + + /** + * @var HeaderInterface|null + */ + private $unprotectedHeader; + + /** + * @var HeaderInterface[]|null + */ + private $recipientHeaders; + + /** + * @var PayloadInterface + */ + private $payload; + + /** + * @param HeaderInterface $protectedHeader + * @param HeaderInterface|null $unprotectedHeader + * @param HeaderInterface[]|null $recipientHeaders + * @param PayloadInterface $payload + */ + public function __construct( + HeaderInterface $protectedHeader, + ?HeaderInterface $unprotectedHeader, + ?array $recipientHeaders, + PayloadInterface $payload + ) { + $this->protectedHeader = $protectedHeader; + $this->unprotectedHeader = $unprotectedHeader; + $this->recipientHeaders = $recipientHeaders ? array_values($recipientHeaders) : null; + $this->payload = $payload; + } + + /** + * @inheritDoc + */ + public function getProtectedHeader(): HeaderInterface + { + return $this->protectedHeader; + } + + /** + * @inheritDoc + */ + public function getSharedUnprotectedHeader(): ?HeaderInterface + { + return $this->unprotectedHeader; + } + + /** + * @inheritDoc + */ + public function getPerRecipientUnprotectedHeaders(): ?array + { + return $this->recipientHeaders; + } + + /** + * @inheritDoc + */ + public function getHeader(): HeaderInterface + { + return $this->getProtectedHeader(); + } + + /** + * @inheritDoc + */ + public function getPayload(): PayloadInterface + { + return $this->payload; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Jwe/JweEncryptionJwks.php b/lib/internal/Magento/Framework/Jwt/Jwe/JweEncryptionJwks.php new file mode 100644 index 0000000000000..d3d3614053d7c --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jwe/JweEncryptionJwks.php @@ -0,0 +1,91 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jwe; + +use Magento\Framework\Jwt\Exception\EncryptionException; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\JwkSet; + +/** + * JWK encryption settings. + */ +class JweEncryptionJwks implements JweEncryptionSettingsInterface +{ + /** + * @var JwkSet + */ + private $jwkSet; + + /** + * @var string + */ + private $contentAlgo; + + /** + * @param JwkSet|Jwk $jwk + * @param string $contentEncryptionAlgo + */ + public function __construct($jwk, string $contentEncryptionAlgo) + { + if ($jwk instanceof Jwk) { + $jwk = new JwkSet([$jwk]); + } + if (!$jwk instanceof JwkSet) { + throw new \InvalidArgumentException('JWK has to be provided'); + } + $this->jwkSet = $jwk; + foreach ($this->jwkSet->getKeys() as $jwk) { + $this->validateJwk($jwk); + } + $this->contentAlgo = $contentEncryptionAlgo; + } + + /** + * @inheritDoc + */ + public function getAlgorithmName(): string + { + if (count($this->jwkSet->getKeys()) > 1) { + return 'jwe-json-serialization'; + } else { + return $this->jwkSet->getKeys()[0]->getAlgorithm(); + } + } + + /** + * @inheritDoc + */ + public function getContentEncryptionAlgorithm(): string + { + return $this->contentAlgo; + } + + /** + * JWK Set. + * + * @return JwkSet + */ + public function getJwkSet(): JwkSet + { + return $this->jwkSet; + } + + /** + * Validate JWK values. + * + * @param Jwk $jwk + * @return void + */ + private function validateJwk(Jwk $jwk): void + { + if ($jwk->getPublicKeyUse() === Jwk::PUBLIC_KEY_USE_SIGNATURE) { + throw new EncryptionException('JWK is not meant for JWEs'); + } + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Jwe/JweEncryptionSettingsInterface.php b/lib/internal/Magento/Framework/Jwt/Jwe/JweEncryptionSettingsInterface.php new file mode 100644 index 0000000000000..06ef79db13b37 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jwe/JweEncryptionSettingsInterface.php @@ -0,0 +1,38 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jwe; + +use Magento\Framework\Jwt\EncryptionSettingsInterface; + +/** + * JWE Encryption settings. + */ +interface JweEncryptionSettingsInterface extends EncryptionSettingsInterface +{ + public const CONTENT_ENCRYPTION_ALGO_A128_HS256 = 'A128CBC-HS256'; + + public const CONTENT_ENCRYPTION_ALGO_A192_HS384 = 'A192CBC-HS384'; + + public const CONTENT_ENCRYPTION_ALGO_A256_HS512 = 'A256CBC-HS512'; + + public const CONTENT_ENCRYPTION_ALGO_A128GCM = 'A128GCM'; + + public const CONTENT_ENCRYPTION_ALGO_A192GCM = 'A192GCM'; + + public const CONTENT_ENCRYPTION_ALGO_A256GCM = 'A256GCM'; + + /** + * Algorithm used to encrypt payload. + * + * "enc" header value. + * + * @return string + */ + public function getContentEncryptionAlgorithm(): string; +} diff --git a/lib/internal/Magento/Framework/Jwt/Jwe/JweHeader.php b/lib/internal/Magento/Framework/Jwt/Jwe/JweHeader.php new file mode 100644 index 0000000000000..f7aec5c38f009 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jwe/JweHeader.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jwe; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\HeaderParameterInterface; + +class JweHeader implements HeaderInterface +{ + /** + * @var JweHeaderParameterInterface[] + */ + private $parameters; + + /** + * @param JweHeaderParameterInterface[] $parameters + */ + public function __construct(array $parameters) + { + $this->parameters = []; + foreach ($parameters as $parameter) { + if (!$parameter instanceof JweHeaderParameterInterface) { + throw new \InvalidArgumentException( + sprintf('Header "%s" is not applicable to JWE tokens', $parameter->getName()) + ); + } + $this->parameters[$parameter->getName()] = $parameter; + } + } + + /** + * @inheritDoc + */ + public function getParameters(): array + { + return $this->parameters; + } + + /** + * @inheritDoc + */ + public function getParameter(string $name): ?HeaderParameterInterface + { + return !empty($this->parameters[$name]) ? $this->parameters[$name] : null; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Jwe/JweHeaderParameterInterface.php b/lib/internal/Magento/Framework/Jwt/Jwe/JweHeaderParameterInterface.php new file mode 100644 index 0000000000000..8e0fa5f6b74e5 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jwe/JweHeaderParameterInterface.php @@ -0,0 +1,17 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Jwt\Jwe; + +use Magento\Framework\Jwt\HeaderParameterInterface; + +/** + * Header parameter that is applicable to JWE. + */ +interface JweHeaderParameterInterface extends HeaderParameterInterface +{ + +} diff --git a/lib/internal/Magento/Framework/Jwt/Jwe/JweInterface.php b/lib/internal/Magento/Framework/Jwt/Jwe/JweInterface.php new file mode 100644 index 0000000000000..d38cb878609bf --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jwe/JweInterface.php @@ -0,0 +1,41 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jwe; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\JwtInterface; + +/** + * JWE. + */ +interface JweInterface extends JwtInterface +{ + /** + * Protected header. + * + * Same as "getHeader" for compact serialization. + * + * @return HeaderInterface + */ + public function getProtectedHeader(): HeaderInterface; + + /** + * Unprotected header can be present when JSON serialization is employed. + * + * @return HeaderInterface|null + */ + public function getSharedUnprotectedHeader(): ?HeaderInterface; + + /** + * Can be present when JSON serialization is used. + * + * @return HeaderInterface[] + */ + public function getPerRecipientUnprotectedHeaders(): ?array; +} diff --git a/lib/internal/Magento/Framework/Jwt/Jwk.php b/lib/internal/Magento/Framework/Jwt/Jwk.php new file mode 100644 index 0000000000000..b7a00319b1485 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jwk.php @@ -0,0 +1,335 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt; + +/** + * JWK. + * + * Signature/encryption settings for JWTs. + */ +class Jwk +{ + public const KEY_TYPE_EC = 'EC'; + + public const KEY_TYPE_RSA = 'RSA'; + + public const KEY_TYPE_OCTET = 'oct'; + + public const PUBLIC_KEY_USE_SIGNATURE = 'sig'; + + public const PUBLIC_KEY_USE_ENCRYPTION = 'enc'; + + public const KEY_OP_SIGN = 'sign'; + + public const KEY_OP_VERIFY = 'verify'; + + public const KEY_OP_ENCRYPT = 'encrypt'; + + public const KEY_OP_DECRYPT = 'decrypt'; + + public const KEY_OP_WRAP_KEY = 'wrapKey'; + + public const KEY_OP_UNWRAP_KEY = 'unwrapKey'; + + public const KEY_OP_DERIVE_KEY = 'deriveKey'; + + public const KEY_OP_DERIVE_BITS = 'deriveBits'; + + public const ALGORITHM_NONE = 'none'; + + public const ALGORITHM_HS256 = 'HS256'; + + public const ALGORITHM_HS384 = 'HS384'; + + public const ALGORITHM_HS512 = 'HS512'; + + public const ALGORITHM_RS256 = 'RS256'; + + public const ALGORITHM_RS384 = 'RS384'; + + public const ALGORITHM_RS512 = 'RS512'; + + public const ALGORITHM_ES256 = 'ES256'; + + public const ALGORITHM_ES384 = 'ES384'; + + public const ALGORITHM_ES512 = 'ES512'; + + public const ALGORITHM_PS256 = 'PS256'; + + public const ALGORITHM_PS384 = 'PS384'; + + public const ALGORITHM_PS512 = 'PS512'; + + public const ALGORITHM_RSA_OAEP = 'RSA-OAEP'; + + public const ALGORITHM_RSA_OAEP_256 = 'RSA-OAEP-256'; + + public const ALGORITHM_A128KW = 'A128KW'; + + public const ALGORITHM_A192KW = 'A192KW'; + + public const ALGORITHM_A256KW = 'A256KW'; + + public const ALGORITHM_DIR = 'dir'; + + public const ALGORITHM_ECDH_ES = 'ECDH-ES'; + + public const ALGORITHM_ECDH_ES_A128KW = 'ECDH-ES+A128KW'; + + public const ALGORITHM_ECDH_ES_A192KW = 'ECDH-ES+A192KW'; + + public const ALGORITHM_ECDH_ES_A256KW = 'ECDH-ES+A256KW'; + + public const ALGORITHM_A128GCMKW = 'A128GCMKW'; + + public const ALGORITHM_A192GCMKW = 'A192GCMKW'; + + public const ALGORITHM_A256GCMKW = 'A256GCMKW'; + + public const ALGORITHM_PBES2_HS256_A128KW = 'PBES2-HS256+A128KW'; + + public const ALGORITHM_PBES2_HS384_A192KW = 'PBES2-HS384+A192KW'; + + public const ALGORITHM_PBES2_HS512_A256KW = 'PBES2-HS512+A256KW'; + + /** + * @var string + */ + private $kty; + + /** + * @var string|null + */ + private $use; + + /** + * @var string|null + */ + private $kid; + + /** + * @var string[]|null + */ + private $keyOps; + + /** + * @var string|null + */ + private $alg; + + /** + * @var string|null + */ + private $x5u; + + /** + * @var string[]|null + */ + private $x5c; + + /** + * @var string|null + */ + private $x5t; + + /** + * @var string|null + */ + private $x5ts256; + + /** + * @var string|null + */ + private $contentEncryption; + + /** + * @var array + */ + private $data; + + /** + * @param string $kty + * @param array $data + * @param string|null $use + * @param string[]|null $keyOps + * @param string|null $alg + * @param string|null $x5u + * @param string[]|null $x5c + * @param string|null $x5t + * @param string|null $x5ts256 + * @param string|null $kid + * @param string|null $contentEncryption + */ + public function __construct( + string $kty, + array $data, + ?string $use = null, + ?array $keyOps = null, + ?string $alg = null, + ?string $x5u = null, + ?array $x5c = null, + ?string $x5t = null, + ?string $x5ts256 = null, + ?string $kid = null, + ?string $contentEncryption = null + ) { + $this->kty = $kty; + $this->data = $data; + $this->use = $use; + $this->keyOps = $keyOps; + $this->alg = $alg; + $this->x5u = $x5u; + $this->x5c = $x5c; + $this->x5t = $x5t; + $this->x5ts256 = $x5ts256; + $this->kid = $kid; + if ($contentEncryption && $alg !== self::ALGORITHM_DIR) { + throw new \InvalidArgumentException( + 'Can only specify content encryption algorithm as "alg" for JWEs with "dir" algorithm' + ); + } + $this->contentEncryption = $contentEncryption; + } + + /** + * "kty" parameter. + * + * @return string + */ + public function getKeyType(): string + { + return $this->kty; + } + + /** + * "use" parameter. + * + * @return string|null + */ + public function getPublicKeyUse(): ?string + { + return $this->use; + } + + /** + * "key_ops" parameter. + * + * @return string[]|null + */ + public function getKeyOperations(): ?array + { + return $this->keyOps; + } + + /** + * "alg" parameter. + * + * @return string|null + */ + public function getAlgorithm(): ?string + { + return $this->alg; + } + + /** + * "x5u" parameter. + * + * @return string|null + */ + public function getX509Url(): ?string + { + return $this->x5u; + } + + /** + * "x5c" parameter. + * + * @return string[]|null + */ + public function getX509CertificateChain(): ?array + { + return $this->x5c; + } + + /** + * "x5t" parameter. + * + * @return string|null + */ + public function getX509Sha1Thumbprint(): ?string + { + return $this->x5t; + } + + /** + * "x5t#S256" parameter. + * + * @return string|null + */ + public function getX509Sha256Thumbprint(): ?string + { + return $this->x5ts256; + } + + /** + * "kid" parameter. + * + * @return string|null + */ + public function getKeyId(): ?string + { + return $this->kid; + } + + /** + * Content encryption algorithm for JWEs with "alg" == "dir". + * + * @return string|null + */ + public function getContentEncryption(): ?string + { + return $this->contentEncryption; + } + + /** + * Map with algorithm (type) specific data. + * + * @return string[] + */ + public function getAlgoData(): array + { + return $this->data; + } + + /** + * JWK data to be represented in JSON. + * + * @return array + */ + public function getJsonData(): array + { + $data = [ + 'kty' => $this->getKeyType(), + 'use' => $this->getPublicKeyUse(), + 'key_ops' => $this->getKeyOperations(), + 'alg' => $this->getContentEncryption() ?? $this->getAlgorithm(), + 'x5u' => $this->getX509Url(), + 'x5c' => $this->getX509CertificateChain(), + 'x5t' => $this->getX509Sha1Thumbprint(), + 'x5t#S256' => $this->getX509Sha256Thumbprint(), + 'kid' => $this->getKeyId() + ]; + $data = array_merge($this->getAlgoData(), $data); + + return array_filter($data, function ($value) { + return $value !== null; + }); + } +} diff --git a/lib/internal/Magento/Framework/Jwt/JwkFactory.php b/lib/internal/Magento/Framework/Jwt/JwkFactory.php new file mode 100644 index 0000000000000..14561b5ed98f2 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/JwkFactory.php @@ -0,0 +1,948 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt; + +/** + * Initiates JWKs for various encryption types. + */ +class JwkFactory +{ + private const EC_CURVE_MAP = [ + '1.2.840.10045.3.1.7' => ['name' => 'P-256', 'bits' => 256], + '1.3.132.0.34' => ['name' => 'P-384', 'bits' => 384], + '1.3.132.0.35' => ['name' => 'P-521', 'bits' => 512] + ]; + + /** + * Create JWK object from key data. + * + * @param array $data + * @return Jwk + */ + public function createFromData(array $data): Jwk + { + if (!array_key_exists('kty', $data)) { + throw new \InvalidArgumentException('Missing key type in JWK data (kty)'); + } + $kty = $data['kty']; + unset($data['kty']); + $use = array_key_exists('use', $data) ? $data['use'] : null; + unset($data['use']); + $keyOps = array_key_exists('key_ops', $data) ? $data['key_ops'] : null; + unset($data['key_ops']); + $alg = array_key_exists('alg', $data) ? $data['alg'] : null; + unset($data['alg']); + $x5u = array_key_exists('x5u', $data) ? $data['x5u'] : null; + unset($data['use']); + $x5c = array_key_exists('x5c', $data) ? $data['x5c'] : null; + unset($data['x5c']); + $x5t = array_key_exists('x5t', $data) ? $data['x5t'] : null; + unset($data['x5t']); + $x5tS256 = array_key_exists('x5t#S256', $data) ? $data['x5t#S256'] : null; + unset($data['x5t#S256']); + $kid = array_key_exists('kid', $data) ? $data['kid'] : null; + unset($data['kid']); + + return new Jwk( + $kty, + $data, + $use, + $keyOps, + $alg, + $x5u, + $x5c, + $x5t, + $x5tS256, + $kid + ); + } + + /** + * Create JWK for signatures generated with HMAC and SHA256 + * + * @param string $key + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createHs256(string $key, ?string $kid = null): Jwk + { + return $this->createOct($key, Jwk::PUBLIC_KEY_USE_SIGNATURE, Jwk::ALGORITHM_HS256, $kid); + } + + /** + * Create JWK for signatures generated with HMAC and SHA384 + * + * @param string $key + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createHs384(string $key, ?string $kid = null): Jwk + { + return $this->createOct($key, Jwk::PUBLIC_KEY_USE_SIGNATURE, Jwk::ALGORITHM_HS384, $kid); + } + + /** + * Create JWK for signatures generated with HMAC and SHA512 + * + * @param string $key + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createHs512(string $key, ?string $kid = null): Jwk + { + return $this->createOct($key, Jwk::PUBLIC_KEY_USE_SIGNATURE, Jwk::ALGORITHM_HS512, $kid); + } + + /** + * Create JWK to sign JWS with RSASSA-PKCS1-v1_5 using SHA-256. + * + * @param string $privateKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createSignRs256(string $privateKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateRsa( + $privateKey, + $passPhrase, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + Jwk::ALGORITHM_RS256, + $kid + ); + } + + /** + * Create JWK to verify JWS signed with RSASSA-PKCS1-v1_5 using SHA-256. + * + * @param string $publicKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createVerifyRs256(string $publicKey, ?string $kid = null): Jwk + { + return $this->createPublicRsa($publicKey, Jwk::PUBLIC_KEY_USE_SIGNATURE, Jwk::ALGORITHM_RS256, $kid); + } + + /** + * Create JWK to sign JWS with RSASSA-PKCS1-v1_5 using SHA-384. + * + * @param string $privateKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createSignRs384(string $privateKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateRsa( + $privateKey, + $passPhrase, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + Jwk::ALGORITHM_RS384, + $kid + ); + } + + /** + * Create JWK to verify JWS signed with RSASSA-PKCS1-v1_5 using SHA-384. + * + * @param string $publicKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createVerifyRs384(string $publicKey, ?string $kid = null): Jwk + { + return $this->createPublicRsa($publicKey, Jwk::PUBLIC_KEY_USE_SIGNATURE, Jwk::ALGORITHM_RS384, $kid); + } + + /** + * Create JWK to sign JWS with RSASSA-PKCS1-v1_5 using SHA-512. + * + * @param string $privateKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createSignRs512(string $privateKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateRsa( + $privateKey, + $passPhrase, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + Jwk::ALGORITHM_RS512, + $kid + ); + } + + /** + * Create JWK to verify JWS signed with RSASSA-PKCS1-v1_5 using SHA-512. + * + * @param string $publicKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createVerifyRs512(string $publicKey, ?string $kid = null): Jwk + { + return $this->createPublicRsa($publicKey, Jwk::PUBLIC_KEY_USE_SIGNATURE, Jwk::ALGORITHM_RS512, $kid); + } + + /** + * Create JWK to sign JWS with ECDSA using P-256 and SHA-256. + * + * @param string $privateKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createSignEs256(string $privateKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateEc( + $privateKey, + $passPhrase, + 256, + Jwk::ALGORITHM_ES256, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + $kid + ); + } + + /** + * Create JWK to verify JWS signed with ECDSA using P-256 and SHA-256. + * + * @param string $publicKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createVerifyEs256(string $publicKey, ?string $kid = null): Jwk + { + return $this->createPublicEc( + $publicKey, + 256, + Jwk::ALGORITHM_ES256, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + $kid + ); + } + + /** + * Create JWK to sign JWS with ECDSA using P-384 and SHA-384 . + * + * @param string $privateKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createSignEs384(string $privateKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateEc( + $privateKey, + $passPhrase, + 384, + Jwk::ALGORITHM_ES384, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + $kid + ); + } + + /** + * Create JWK to verify JWS signed with ECDSA using P-384 and SHA-384 . + * + * @param string $publicKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createVerifyEs384(string $publicKey, ?string $kid = null): Jwk + { + return $this->createPublicEc( + $publicKey, + 384, + Jwk::ALGORITHM_ES384, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + $kid + ); + } + + /** + * Create JWK to sign JWS with ECDSA using P-521 and SHA-512. + * + * @param string $privateKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createSignEs512(string $privateKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateEc( + $privateKey, + $passPhrase, + 512, + Jwk::ALGORITHM_ES512, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + $kid + ); + } + + /** + * Create JWK to verify JWS signed with ECDSA using P-521 and SHA-512. + * + * @param string $publicKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createVerifyEs512(string $publicKey, ?string $kid = null): Jwk + { + return $this->createPublicEc( + $publicKey, + 512, + Jwk::ALGORITHM_ES512, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + $kid + ); + } + + /** + * Create JWK to sign JWS with RSASSA-PSS using SHA-256 and MGF1 with SHA-256. + * + * @param string $privateKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createSignPs256(string $privateKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateRsa( + $privateKey, + $passPhrase, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + Jwk::ALGORITHM_PS256, + $kid + ); + } + + /** + * Create JWK to verify JWS signed with RSASSA-PSS using SHA-256 and MGF1 with SHA-256. + * + * @param string $publicKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createVerifyPs256(string $publicKey, ?string $kid = null): Jwk + { + return $this->createPublicRsa($publicKey, Jwk::PUBLIC_KEY_USE_SIGNATURE, Jwk::ALGORITHM_PS256, $kid); + } + + /** + * Create JWK to sign JWS with RSASSA-PSS using SHA-384 and MGF1 with SHA-384. + * + * @param string $privateKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createSignPs384(string $privateKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateRsa( + $privateKey, + $passPhrase, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + Jwk::ALGORITHM_PS384, + $kid + ); + } + + /** + * Create JWK to verify JWS signed with RSASSA-PSS using SHA-384 and MGF1 with SHA-384. + * + * @param string $publicKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createVerifyPs384(string $publicKey, ?string $kid = null): Jwk + { + return $this->createPublicRsa($publicKey, Jwk::PUBLIC_KEY_USE_SIGNATURE, Jwk::ALGORITHM_PS384, $kid); + } + + /** + * Create JWK to sign JWS with RSASSA-PSS using SHA-512 and MGF1 with SHA-512. + * + * @param string $privateKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createSignPs512(string $privateKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateRsa( + $privateKey, + $passPhrase, + Jwk::PUBLIC_KEY_USE_SIGNATURE, + Jwk::ALGORITHM_PS512, + $kid + ); + } + + /** + * Create JWK to verify JWS signed with RSASSA-PSS using SHA-512 and MGF1 with SHA-512. + * + * @param string $publicKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createVerifyPs512(string $publicKey, ?string $kid = null): Jwk + { + return $this->createPublicRsa($publicKey, Jwk::PUBLIC_KEY_USE_SIGNATURE, Jwk::ALGORITHM_PS512, $kid); + } + + /** + * Create key to use with A128KW algorithm to encrypt JWE. + * + * @param string $key + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createA128KW(string $key, ?string $kid = null): Jwk + { + return $this->createOct($key, Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_A128KW, $kid); + } + + /** + * Create key to use with A192KW algorithm to encrypt JWE. + * + * @param string $key + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createA192KW(string $key, ?string $kid = null): Jwk + { + return $this->createOct($key, Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_A192KW, $kid); + } + + /** + * Create key to use with A256KW algorithm to encrypt JWE. + * + * @param string $key + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createA256KW(string $key, ?string $kid = null): Jwk + { + return $this->createOct($key, Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_A256KW, $kid); + } + + /** + * Create RSA key to use with RSA-OAEP algorithm to encrypt JWE. + * + * @param string $publicKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createEncryptRsaOaep(string $publicKey, ?string $kid = null): Jwk + { + return $this->createPublicRsa($publicKey, Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_RSA_OAEP, $kid); + } + + /** + * Create RSA key to use with RSA-OAEP algorithm to decrypt JWE. + * + * @param string $privateKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createDecryptRsaOaep(string $privateKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateRsa( + $privateKey, + $passPhrase, + Jwk::PUBLIC_KEY_USE_ENCRYPTION, + Jwk::ALGORITHM_RSA_OAEP, + $kid + ); + } + + /** + * Create RSA key to use with RSA-OAEP-256 algorithm to encrypt JWE. + * + * @param string $publicKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createEncryptRsaOaep256(string $publicKey, ?string $kid = null): Jwk + { + return $this->createPublicRsa($publicKey, Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_RSA_OAEP_256, $kid); + } + + /** + * Create RSA key to use with RSA-OAEP-256 algorithm to decrypt JWE. + * + * @param string $privateKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createDecryptRsaOaep256(string $privateKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateRsa( + $privateKey, + $passPhrase, + Jwk::PUBLIC_KEY_USE_ENCRYPTION, + Jwk::ALGORITHM_RSA_OAEP_256, + $kid + ); + } + + /** + * Create JWK to use with "dir" algorithm for JWEs. + * + * @param string $key + * @param string $contentEncryptionAlgorithm + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createDir(string $key, string $contentEncryptionAlgorithm, ?string $kid = null): Jwk + { + if (strlen($key) < 2048) { + throw new \InvalidArgumentException('Shared secret key must be at least 2048 bits.'); + } + + return new Jwk( + Jwk::KEY_TYPE_OCTET, + ['k' => self::base64Encode($key)], + Jwk::PUBLIC_KEY_USE_ENCRYPTION, + null, + Jwk::ALGORITHM_DIR, + null, + null, + null, + null, + $kid, + $contentEncryptionAlgorithm + ); + } + + /** + * Create JWK to use ECDH-ES algorithm with EC key to encrypt JWE. + * + * @param string $publicEcKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createEncryptEcdhEsWithEc(string $publicEcKey, ?string $kid = null): Jwk + { + return $this->createPublicEc( + $publicEcKey, + null, + Jwk::ALGORITHM_ECDH_ES, + Jwk::PUBLIC_KEY_USE_ENCRYPTION, + $kid + ); + } + + /** + * Create JWK to use ECDH-ES algorithm with EC key to decrypt JWE. + * + * @param string $privateEcKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createDecryptEcdhEsWithEc(string $privateEcKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateEc( + $privateEcKey, + $passPhrase, + null, + Jwk::ALGORITHM_ECDH_ES, + Jwk::PUBLIC_KEY_USE_ENCRYPTION, + $kid + ); + } + + /** + * Create JWK to use ECDH-ES+A128KW algorithm with EC key to encrypt JWE. + * + * @param string $publicEcKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createEncryptEcdhEsA128kwWithEc(string $publicEcKey, ?string $kid = null): Jwk + { + return $this->createPublicEc( + $publicEcKey, + null, + Jwk::ALGORITHM_ECDH_ES_A128KW, + Jwk::PUBLIC_KEY_USE_ENCRYPTION, + $kid + ); + } + + /** + * Create JWK to use ECDH-ES+A128KW algorithm with EC key to decrypt JWE. + * + * @param string $privateEcKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createDecryptEcdhEsA128kwWithEc(string $privateEcKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateEc( + $privateEcKey, + $passPhrase, + null, + Jwk::ALGORITHM_ECDH_ES_A128KW, + Jwk::PUBLIC_KEY_USE_ENCRYPTION, + $kid + ); + } + + /** + * Create JWK to use ECDH-ES+A192KW algorithm with EC key to encrypt JWE. + * + * @param string $publicEcKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createEncryptEcdhEsA192kwWithEc(string $publicEcKey, ?string $kid = null): Jwk + { + return $this->createPublicEc( + $publicEcKey, + null, + Jwk::ALGORITHM_ECDH_ES_A192KW, + Jwk::PUBLIC_KEY_USE_ENCRYPTION, + $kid + ); + } + + /** + * Create JWK to use ECDH-ES+A192KW algorithm with EC key to decrypt JWE. + * + * @param string $privateEcKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createDecryptEcdhEsA192kwWithEc(string $privateEcKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateEc( + $privateEcKey, + $passPhrase, + null, + Jwk::ALGORITHM_ECDH_ES_A192KW, + Jwk::PUBLIC_KEY_USE_ENCRYPTION, + $kid + ); + } + + /** + * Create JWK to use ECDH-ES+A256KW algorithm with EC key to encrypt JWE. + * + * @param string $publicEcKey + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createEncryptEcdhEsA256kwWithEc(string $publicEcKey, ?string $kid = null): Jwk + { + return $this->createPublicEc( + $publicEcKey, + null, + Jwk::ALGORITHM_ECDH_ES_A256KW, + Jwk::PUBLIC_KEY_USE_ENCRYPTION, + $kid + ); + } + + /** + * Create JWK to use ECDH-ES+A256KW algorithm with EC key to decrypt JWE. + * + * @param string $privateEcKey + * @param string|null $passPhrase + * @param string|null $kid JWK ID. + * @return Jwk + */ + public function createDecryptEcdhEsA256kwWithEc(string $privateEcKey, ?string $passPhrase, ?string $kid = null): Jwk + { + return $this->createPrivateEc( + $privateEcKey, + $passPhrase, + null, + Jwk::ALGORITHM_ECDH_ES_A256KW, + Jwk::PUBLIC_KEY_USE_ENCRYPTION, + $kid + ); + } + + /** + * Create JWK to encrypt/decrypt JWEs with A128GCMKW algorithm. + * + * @param string $key + * @param string|null $kid + * @return Jwk + */ + public function createA128Gcmkw(string $key, ?string $kid = null): Jwk + { + return $this->createOct($key, Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_A128GCMKW, $kid); + } + + /** + * Create JWK to encrypt/decrypt JWEs with A192GCMKW algorithm. + * + * @param string $key + * @param string|null $kid + * @return Jwk + */ + public function createA192Gcmkw(string $key, ?string $kid = null): Jwk + { + return $this->createOct($key, Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_A192GCMKW, $kid); + } + + /** + * Create JWK to encrypt/decrypt JWEs with A256GCMKW algorithm. + * + * @param string $key + * @param string|null $kid + * @return Jwk + */ + public function createA256Gcmkw(string $key, ?string $kid = null): Jwk + { + return $this->createOct($key, Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_A256GCMKW, $kid); + } + + /** + * Create JWK to encrypt/decrypt JWEs with PBES2-HS256+A128KW algorithm. + * + * @param string $password + * @param string|null $kid + * @return Jwk + */ + public function createPbes2Hs256A128kw(string $password, ?string $kid = null): Jwk + { + return $this->createOct($password, Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_PBES2_HS256_A128KW, $kid); + } + + /** + * Create JWK to encrypt/decrypt JWEs with PBES2-HS384+A192KW algorithm. + * + * @param string $password + * @param string|null $kid + * @return Jwk + */ + public function createPbes2Hs384A192kw(string $password, ?string $kid = null): Jwk + { + return $this->createOct($password, Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_PBES2_HS384_A192KW, $kid); + } + + /** + * Create JWK to encrypt/decrypt JWEs with PBES2-HS512+A256KW algorithm. + * + * @param string $password + * @param string|null $kid + * @return Jwk + */ + public function createPbes2Hs512A256kw(string $password, ?string $kid = null): Jwk + { + return $this->createOct($password, Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_PBES2_HS512_A256KW, $kid); + } + + public function createNone(): Jwk + { + return new Jwk( + + ); + } + + private function createOct(string $key, string $use, string $algo, ?string $kid): Jwk + { + if (strlen($key) < 2048) { + throw new \InvalidArgumentException('Shared secret key must be at least 2048 bits.'); + } + + return new Jwk( + Jwk::KEY_TYPE_OCTET, + ['k' => self::base64Encode($key)], + $use, + null, + $algo, + null, + null, + null, + null, + $kid + ); + } + + private function createPrivateRsa(string $key, ?string $pass, string $use, string $algorithm, ?string $kid): Jwk + { + $resource = openssl_get_privatekey($key, (string)$pass); + $keyData = openssl_pkey_get_details($resource)['rsa']; + openssl_free_key($resource); + $keysMap = [ + 'n' => 'n', + 'e' => 'e', + 'd' => 'd', + 'p' => 'p', + 'q' => 'q', + 'dp' => 'dmp1', + 'dq' => 'dmq1', + 'qi' => 'iqmp' + ]; + $jwkData = []; + foreach ($keysMap as $jwkKey => $rsaKey) { + if (array_key_exists($rsaKey, $keyData)) { + $jwkData[$jwkKey] = self::base64Encode($keyData[$rsaKey]); + } + } + + return new Jwk( + Jwk::KEY_TYPE_RSA, + $jwkData, + $use, + null, + $algorithm, + null, + null, + null, + null, + $kid + ); + } + + private function createPublicRsa(string $key, string $use, string $algorithm, ?string $kid): Jwk + { + $resource = openssl_get_publickey($key); + $keyData = openssl_pkey_get_details($resource)['rsa']; + openssl_free_key($resource); + $keysMap = [ + 'n' => 'n', + 'e' => 'e' + ]; + $jwkData = []; + foreach ($keysMap as $jwkKey => $rsaKey) { + if (array_key_exists($rsaKey, $keyData)) { + $jwkData[$jwkKey] = self::base64Encode($keyData[$rsaKey]); + } + } + + return new Jwk( + Jwk::KEY_TYPE_RSA, + $jwkData, + $use, + null, + $algorithm, + null, + null, + null, + null, + $kid + ); + } + + private function createPrivateEc( + string $key, + ?string $pass, + ?int $validateCurveBits, + string $algorithm, + string $use, + ?string $kid + ): Jwk { + $resource = openssl_get_privatekey($key, (string)$pass); + $keyData = openssl_pkey_get_details($resource)['ec']; + openssl_free_key($resource); + if (!array_key_exists($keyData['curve_oid'], self::EC_CURVE_MAP)) { + throw new \RuntimeException('Unsupported EC curve'); + } + if ($validateCurveBits && $validateCurveBits !== self::EC_CURVE_MAP[$keyData['curve_oid']]['bits']) { + throw new \RuntimeException( + 'The key cannot be used with SHA-' .$validateCurveBits .' hashing algorithm' + ); + } + + return new Jwk( + Jwk::KEY_TYPE_EC, + [ + 'd' => self::base64Encode($keyData['d']), + 'x' => self::base64Encode($keyData['x']), + 'y' => self::base64Encode($keyData['y']), + 'crv' => self::EC_CURVE_MAP[$keyData['curve_oid']]['name'] + ], + $use, + null, + $algorithm, + null, + null, + null, + null, + $kid + ); + } + + private function createPublicEc( + string $key, + ?int $validateCurveBits, + string $algorithm, + string $use, + ?string $kid + ): Jwk { + $resource = openssl_get_publickey($key); + $keyData = openssl_pkey_get_details($resource)['ec']; + openssl_free_key($resource); + if (!array_key_exists($keyData['curve_oid'], self::EC_CURVE_MAP)) { + throw new \RuntimeException('Unsupported EC curve'); + } + if ($validateCurveBits && $validateCurveBits !== self::EC_CURVE_MAP[$keyData['curve_oid']]['bits']) { + throw new \RuntimeException( + 'The key cannot be used with SHA-' .$validateCurveBits .' hashing algorithm' + ); + } + + return new Jwk( + Jwk::KEY_TYPE_EC, + [ + 'x' => self::base64Encode($keyData['x']), + 'y' => self::base64Encode($keyData['y']), + 'crv' => self::EC_CURVE_MAP[$keyData['curve_oid']]['name'] + ], + $use, + null, + $algorithm, + null, + null, + null, + null, + $kid + ); + } + + /** + * Encode value into Base64Url format. + * + * @param string $value + * @return string + */ + private static function base64Encode(string $value): string + { + return rtrim(strtr(base64_encode($value), '+/', '-_'), '='); + } + + /** + * Decode Base64Url value. + * + * @param string $encoded + * @return string + */ + private static function base64Decode(string $encoded): string + { + $value = base64_decode(strtr($encoded, '-_', '+/'), true); + if ($value === false) { + throw new \InvalidArgumentException('Invalid base64Url string provided'); + } + + return $value; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/JwkSet.php b/lib/internal/Magento/Framework/Jwt/JwkSet.php new file mode 100644 index 0000000000000..93a1c0f8c90b4 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/JwkSet.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt; + +/** + * Set of JWKs. + */ +class JwkSet +{ + /** + * @var Jwk[] + */ + private $keys; + + /** + * @param Jwk[] $keys + */ + public function __construct(array $keys) + { + $this->keys = $keys; + } + + /** + * @return Jwk[] + */ + public function getKeys(): array + { + return $this->keys; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Jws/AbstractJws.php b/lib/internal/Magento/Framework/Jwt/Jws/AbstractJws.php new file mode 100644 index 0000000000000..6cd71c6cb8427 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jws/AbstractJws.php @@ -0,0 +1,88 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jws; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\JwtInterface; +use Magento\Framework\Jwt\PayloadInterface; + +/** + * Abstract JWS DTO. + */ +abstract class AbstractJws implements JwtInterface +{ + /** + * @var HeaderInterface[] + */ + private $protectedHeaders; + + /** + * @var HeaderInterface[]|null + */ + private $unprotectedHeaders; + + /** + * @var PayloadInterface + */ + private $payload; + + /** + * @param HeaderInterface[] $protectedHeaders + * @param PayloadInterface $payload + * @param HeaderInterface[]|null $unprotectedHeaders + */ + public function __construct(array $protectedHeaders, PayloadInterface $payload, ?array $unprotectedHeaders) + { + if (!$protectedHeaders) { + throw new \InvalidArgumentException('Need at least 1 header'); + } + $this->protectedHeaders = array_values($protectedHeaders); + $this->payload = $payload; + if (!$unprotectedHeaders) { + $unprotectedHeaders = null; + } elseif (count($protectedHeaders) !== count($unprotectedHeaders)) { + throw new \InvalidArgumentException('There has to be equal amount of protected and unprotected headers'); + } else { + $unprotectedHeaders = array_values($unprotectedHeaders); + } + $this->unprotectedHeaders = $unprotectedHeaders; + } + + /** + * @inheritDoc + */ + public function getProtectedHeaders(): array + { + return $this->protectedHeaders; + } + + /** + * @inheritDoc + */ + public function getUnprotectedHeaders(): ?array + { + return $this->unprotectedHeaders; + } + + /** + * @inheritDoc + */ + public function getHeader(): HeaderInterface + { + return $this->protectedHeaders[0]; + } + + /** + * @inheritDoc + */ + public function getPayload(): PayloadInterface + { + return $this->payload; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Jws/Jws.php b/lib/internal/Magento/Framework/Jwt/Jws/Jws.php new file mode 100644 index 0000000000000..a03bb3bad8a95 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jws/Jws.php @@ -0,0 +1,14 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jws; + +class Jws extends AbstractJws implements JwsInterface +{ + +} diff --git a/lib/internal/Magento/Framework/Jwt/Jws/JwsHeader.php b/lib/internal/Magento/Framework/Jwt/Jws/JwsHeader.php new file mode 100644 index 0000000000000..a3e37744742cb --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jws/JwsHeader.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jws; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\HeaderParameterInterface; + +class JwsHeader implements HeaderInterface +{ + /** + * @var JwsHeaderParameterInterface[] + */ + private $parameters; + + /** + * @param JwsHeaderParameterInterface[] $parameters + */ + public function __construct(array $parameters) + { + $this->parameters = []; + foreach ($parameters as $parameter) { + if (!$parameter instanceof JwsHeaderParameterInterface) { + throw new \InvalidArgumentException( + sprintf('Header "%s" is not applicable to JWS tokens', $parameter->getName()) + ); + } + $this->parameters[$parameter->getName()] = $parameter; + } + } + + /** + * @inheritDoc + */ + public function getParameters(): array + { + return $this->parameters; + } + + /** + * @inheritDoc + */ + public function getParameter(string $name): ?HeaderParameterInterface + { + return !empty($this->parameters[$name]) ? $this->parameters[$name] : null; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Jws/JwsHeaderParameterInterface.php b/lib/internal/Magento/Framework/Jwt/Jws/JwsHeaderParameterInterface.php new file mode 100644 index 0000000000000..9967592a9fdab --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jws/JwsHeaderParameterInterface.php @@ -0,0 +1,17 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Jwt\Jws; + +use Magento\Framework\Jwt\HeaderParameterInterface; + +/** + * Header parameter that is applicable to JWS. + */ +interface JwsHeaderParameterInterface extends HeaderParameterInterface +{ + +} diff --git a/lib/internal/Magento/Framework/Jwt/Jws/JwsInterface.php b/lib/internal/Magento/Framework/Jwt/Jws/JwsInterface.php new file mode 100644 index 0000000000000..4fb922989826c --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jws/JwsInterface.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jws; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\JwtInterface; + +/** + * JWS + */ +interface JwsInterface extends JwtInterface +{ + /** + * Protected header. + * + * Same as "[getHeader()]" for compact serialization. + * + * @return HeaderInterface[] + */ + public function getProtectedHeaders(): array; + + /** + * Unprotected header can be present when JSON serialization is employed. + * + * @return HeaderInterface[]|null + */ + public function getUnprotectedHeaders(): ?array; +} diff --git a/lib/internal/Magento/Framework/Jwt/Jws/JwsSignatureJwks.php b/lib/internal/Magento/Framework/Jwt/Jws/JwsSignatureJwks.php new file mode 100644 index 0000000000000..03b505c6fb824 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jws/JwsSignatureJwks.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jws; + +use Magento\Framework\Jwt\Exception\EncryptionException; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\JwkSet; + +/** + * JWK signature settings. + */ +class JwsSignatureJwks implements JwsSignatureSettingsInterface +{ + /** + * @var JwkSet + */ + private $jwkSet; + + /** + * @param JwkSet|Jwk $jwk + */ + public function __construct($jwk) + { + if ($jwk instanceof Jwk) { + $jwk = new JwkSet([$jwk]); + } + if (!$jwk instanceof JwkSet) { + throw new \InvalidArgumentException('JWK has to be provided'); + } + $this->jwkSet = $jwk; + foreach ($this->jwkSet->getKeys() as $jwk) { + $this->validateJwk($jwk); + } + } + + /** + * @inheritDoc + */ + public function getAlgorithmName(): string + { + if (count($this->jwkSet->getKeys()) > 1) { + return 'jws-json-serialization'; + } else { + return $this->jwkSet->getKeys()[0]->getAlgorithm(); + } + } + + /** + * JWK Set. + * + * @return JwkSet + */ + public function getJwkSet(): JwkSet + { + return $this->jwkSet; + } + + /** + * Validate JWK values. + * + * @param Jwk $jwk + * @return void + */ + private function validateJwk(Jwk $jwk): void + { + if ($jwk->getPublicKeyUse() === Jwk::PUBLIC_KEY_USE_ENCRYPTION) { + throw new EncryptionException('JWK is not meant for JWSs'); + } + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Jws/JwsSignatureSettingsInterface.php b/lib/internal/Magento/Framework/Jwt/Jws/JwsSignatureSettingsInterface.php new file mode 100644 index 0000000000000..4fc8f20d79a44 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Jws/JwsSignatureSettingsInterface.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Jws; + +use Magento\Framework\Jwt\EncryptionSettingsInterface; + +/** + * JWS Signature settings. + */ +interface JwsSignatureSettingsInterface extends EncryptionSettingsInterface +{ + +} diff --git a/lib/internal/Magento/Framework/Jwt/JwtInterface.php b/lib/internal/Magento/Framework/Jwt/JwtInterface.php new file mode 100644 index 0000000000000..84e406a9452b9 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/JwtInterface.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt; + +/** + * JWT + */ +interface JwtInterface +{ + /** + * Header. + * + * @return HeaderInterface + */ + public function getHeader(): HeaderInterface; + + /** + * Payload. + * + * @return PayloadInterface + */ + public function getPayload(): PayloadInterface; +} diff --git a/lib/internal/Magento/Framework/Jwt/JwtManagerInterface.php b/lib/internal/Magento/Framework/Jwt/JwtManagerInterface.php new file mode 100644 index 0000000000000..8387ddfba7e33 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/JwtManagerInterface.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt; + +use Magento\Framework\Jwt\Exception\JwtException; + +/** + * Manages JWTs. + */ +interface JwtManagerInterface +{ + /** + * Generate a token based on JWT data. + * + * @param JwtInterface $jwt + * @param EncryptionSettingsInterface $encryption + * @return string + * @throws JwtException + */ + public function create(JwtInterface $jwt, EncryptionSettingsInterface $encryption): string; + + /** + * Read a JWT. + * + * @param string $token + * @param EncryptionSettingsInterface[] $acceptableEncryption + * @return JwtInterface + * @throws JwtException + */ + public function read(string $token, array $acceptableEncryption): JwtInterface; + + /** + * Read unprotected headers. + * + * @param string $token + * @return HeaderInterface[] + */ + public function readHeaders(string $token): array; +} diff --git a/lib/internal/Magento/Framework/Jwt/Payload/ArbitraryPayload.php b/lib/internal/Magento/Framework/Jwt/Payload/ArbitraryPayload.php new file mode 100644 index 0000000000000..d5d96607211f4 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Payload/ArbitraryPayload.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Payload; + +use Magento\Framework\Jwt\PayloadInterface; + +class ArbitraryPayload implements PayloadInterface +{ + /** + * @var string + */ + private $content; + + /** + * @var string|null + */ + private $type; + + /** + * @param string $content + * @param string|null $type + */ + public function __construct(string $content, ?string $type = null) + { + $this->content = $content; + $this->type = $type; + } + + /** + * @inheritDoc + */ + public function getContent(): string + { + return $this->content; + } + + /** + * @inheritDoc + */ + public function getContentType(): ?string + { + return $this->type; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Payload/ClaimsPayload.php b/lib/internal/Magento/Framework/Jwt/Payload/ClaimsPayload.php new file mode 100644 index 0000000000000..0e456008c1632 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Payload/ClaimsPayload.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Payload; + +use Magento\Framework\Jwt\ClaimInterface; + +class ClaimsPayload implements ClaimsPayloadInterface +{ + public const CONTENT_TYPE = 'json'; + + /** + * @var ClaimInterface[] + */ + private $claims; + + /** + * @param ClaimInterface[] $claims + */ + public function __construct(array $claims) + { + $this->claims = $claims; + } + + /** + * @inheritDoc + */ + public function getClaims(): array + { + return $this->claims; + } + + /** + * @inheritDoc + */ + public function getContent(): string + { + $data = []; + foreach ($this->claims as $claim) { + $data[$claim->getName()] = $claim->getValue(); + } + + return json_encode((object)$data); + } + + /** + * @inheritDoc + */ + public function getContentType(): ?string + { + return null; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Payload/ClaimsPayloadInterface.php b/lib/internal/Magento/Framework/Jwt/Payload/ClaimsPayloadInterface.php new file mode 100644 index 0000000000000..b42445ad7d36e --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Payload/ClaimsPayloadInterface.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Payload; + +use Magento\Framework\Jwt\ClaimInterface; +use Magento\Framework\Jwt\PayloadInterface; + +/** + * Payload with claims. + */ +interface ClaimsPayloadInterface extends PayloadInterface +{ + /** + * Claims. + * + * @return ClaimInterface[] + */ + public function getClaims(): array; +} diff --git a/lib/internal/Magento/Framework/Jwt/Payload/NestedPayload.php b/lib/internal/Magento/Framework/Jwt/Payload/NestedPayload.php new file mode 100644 index 0000000000000..2a26eecaae124 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Payload/NestedPayload.php @@ -0,0 +1,41 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Payload; + +class NestedPayload implements NestedPayloadInterface +{ + /** + * @var string + */ + private $token; + + /** + * @param string $token + */ + public function __construct(string $token) + { + $this->token = $token; + } + + /** + * @inheritDoc + */ + public function getContent(): string + { + return $this->token; + } + + /** + * @inheritDoc + */ + public function getContentType(): ?string + { + return self::CONTENT_TYPE; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Payload/NestedPayloadInterface.php b/lib/internal/Magento/Framework/Jwt/Payload/NestedPayloadInterface.php new file mode 100644 index 0000000000000..08423576007e9 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Payload/NestedPayloadInterface.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Payload; + +use Magento\Framework\Jwt\PayloadInterface; + +/** + * Payload with nested JWT. + */ +interface NestedPayloadInterface extends PayloadInterface +{ + public const CONTENT_TYPE = 'JWT'; +} diff --git a/lib/internal/Magento/Framework/Jwt/PayloadInterface.php b/lib/internal/Magento/Framework/Jwt/PayloadInterface.php new file mode 100644 index 0000000000000..e481994d9bfa2 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/PayloadInterface.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt; + +/** + * JWT Payload. + */ +interface PayloadInterface +{ + /** + * Payload's content. + * + * @return string + */ + public function getContent(): string; + + /** + * Payload type ("cty" header). + * + * @return string|null + */ + public function getContentType(): ?string; +} diff --git a/lib/internal/Magento/Framework/Jwt/README.md b/lib/internal/Magento/Framework/Jwt/README.md new file mode 100644 index 0000000000000..09eba2907f84a --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/README.md @@ -0,0 +1,3 @@ +# JWT + +**JWT** module provides abstraction to work with JWTs along with useful utilities. diff --git a/lib/internal/Magento/Framework/Jwt/Test/Unit/Claim/AbstractClaimTest.php b/lib/internal/Magento/Framework/Jwt/Test/Unit/Claim/AbstractClaimTest.php new file mode 100644 index 0000000000000..00d93afc0ef28 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Test/Unit/Claim/AbstractClaimTest.php @@ -0,0 +1,40 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Test\Unit\Claim; + +use Magento\Framework\Jwt\Claim\AbstractClaim; +use PHPUnit\Framework\TestCase; + +class AbstractClaimTest extends TestCase +{ + /** + * Test parsing NumericDate JS format. + * + * @param string $numericDate + * @param string $expectedTime + * @param string $expectedZone + * @return void + * + * @dataProvider getDates + */ + public function testParseNumericDate(string $numericDate, string $expectedTime): void + { + $dt = AbstractClaim::parseNumericDate($numericDate); + $this->assertEquals($expectedTime, $dt->format('Y-m-d H:i:s')); + $this->assertEquals('UTC', $dt->getTimezone()->getName()); + } + + public function getDates(): array + { + return [ + ['1970-01-01T00:00:00Z', '1970-01-01 00:00:00'], + ['1996-12-19T16:39:57-08:00', '1996-12-20 00:39:57'] + ]; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Test/Unit/Header/X509ChainTest.php b/lib/internal/Magento/Framework/Jwt/Test/Unit/Header/X509ChainTest.php new file mode 100644 index 0000000000000..93a2d469780d4 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Test/Unit/Header/X509ChainTest.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Test\Unit\Header; + +use Magento\Framework\Jwt\Header\X509Chain; +use PHPUnit\Framework\TestCase; + +class X509ChainTest extends TestCase +{ + public function testEmpty(): void + { + $this->expectException(\InvalidArgumentException::class); + + new X509Chain([]); + } + + public function testGetValue(): void + { + $model = new X509Chain(['cert1', 'cert2']); + + $this->assertEquals('["Y2VydDE=","Y2VydDI="]', $model->getValue()); + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Test/Unit/Header/X509Sha1ThumbprintTest.php b/lib/internal/Magento/Framework/Jwt/Test/Unit/Header/X509Sha1ThumbprintTest.php new file mode 100644 index 0000000000000..4d090a3c54bc6 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Test/Unit/Header/X509Sha1ThumbprintTest.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Test\Unit\Header; + +use Magento\Framework\Jwt\Header\X509Sha1Thumbprint; +use PHPUnit\Framework\TestCase; + +class X509Sha1ThumbprintTest extends TestCase +{ + public function testGetValue(): void + { + $model = new X509Sha1Thumbprint('cert:==somecert'); + + $this->assertEquals('Y2VydDo9PXNvbWVjZXJ0', $model->getValue()); + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Test/Unit/Header/X509Sha256ThumbprintTest.php b/lib/internal/Magento/Framework/Jwt/Test/Unit/Header/X509Sha256ThumbprintTest.php new file mode 100644 index 0000000000000..6ca6075f5cedb --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Test/Unit/Header/X509Sha256ThumbprintTest.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Test\Unit\Header; + +use Magento\Framework\Jwt\Header\X509Sha256Thumbprint; +use PHPUnit\Framework\TestCase; + +class X509Sha256ThumbprintTest extends TestCase +{ + public function testGetValue(): void + { + $model = new X509Sha256Thumbprint('cert:=cert'); + + $this->assertEquals('Y2VydDo9Y2VydA', $model->getValue()); + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Test/Unit/Jwe/JweEncryptionJwksTest.php b/lib/internal/Magento/Framework/Jwt/Test/Unit/Jwe/JweEncryptionJwksTest.php new file mode 100644 index 0000000000000..aaf293fd28759 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Test/Unit/Jwe/JweEncryptionJwksTest.php @@ -0,0 +1,114 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Test\Unit\Jwe; + +use Magento\Framework\Jwt\Exception\EncryptionException; +use Magento\Framework\Jwt\Jwe\JweEncryptionJwks; +use Magento\Framework\Jwt\Jwe\JweEncryptionSettingsInterface; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\JwkSet; +use Magento\Framework\Jwt\Jws\JwsSignatureJwks; +use PHPUnit\Framework\TestCase; + +class JweEncryptionJwksTest extends TestCase +{ + public function getConstructorCases(): array + { + return [ + 'valid-jwk' => [$this->createJwk(Jwk::PUBLIC_KEY_USE_ENCRYPTION), true], + 'valid-jwks' => [ + $this->createJwkSet( + [ + $this->createJwk(Jwk::PUBLIC_KEY_USE_ENCRYPTION), + $this->createJwk(Jwk::PUBLIC_KEY_USE_ENCRYPTION) + ] + ), + true + ], + 'invalid-jwk' => [$this->createJwk(Jwk::PUBLIC_KEY_USE_SIGNATURE), false], + 'invalid-jwks' => [ + $this->createJwkSet( + [ + $this->createJwk(Jwk::PUBLIC_KEY_USE_SIGNATURE), + $this->createJwk(Jwk::PUBLIC_KEY_USE_ENCRYPTION) + ] + ), + false + ] + ]; + } + + /** + * Test constructor validation. + * + * @param Jwk|JwkSet $jwks + * @param bool $valid + * @return void + * @dataProvider getConstructorCases + */ + public function testConstruct($jwks, $valid): void + { + if (!$valid) { + $this->expectException(EncryptionException::class); + } + + new JweEncryptionJwks($jwks, JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM); + } + + public function getAlgorithmCases(): array + { + return [ + 'one-algo' => [ + $this->createJwk(Jwk::PUBLIC_KEY_USE_ENCRYPTION, Jwk::ALGORITHM_RSA_OAEP), + Jwk::ALGORITHM_RSA_OAEP + ], + 'json' => [ + $this->createJwkSet( + [ + $this->createJwk(Jwk::PUBLIC_KEY_USE_ENCRYPTION), + $this->createJwk(Jwk::PUBLIC_KEY_USE_ENCRYPTION) + ] + ), + 'jwe-json-serialization' + ], + ]; + } + + /** + * Test algorithm logic. + * + * @param Jwk|JwkSet $jwk + * @param string $expectedName + * @return void + * @dataProvider getAlgorithmCases + */ + public function testGetAlgorithmName($jwk, string $expectedName): void + { + $model = new JweEncryptionJwks($jwk, JweEncryptionSettingsInterface::CONTENT_ENCRYPTION_ALGO_A128GCM); + + $this->assertEquals($expectedName, $model->getAlgorithmName()); + } + + private function createJwk(string $use, string $alg = Jwk::ALGORITHM_RSA_OAEP_256): Jwk + { + $mock = $this->createMock(Jwk::class); + $mock->method('getPublicKeyUse')->willReturn($use); + $mock->method('getAlgorithm')->willReturn($alg); + + return $mock; + } + + public function createJwkSet(array $jwks): JwkSet + { + $mock = $this->createMock(JwkSet::class); + $mock->method('getKeys')->willReturn($jwks); + + return $mock; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Test/Unit/Jws/JwsSignatureJwksTest.php b/lib/internal/Magento/Framework/Jwt/Test/Unit/Jws/JwsSignatureJwksTest.php new file mode 100644 index 0000000000000..8ac53f5d5dd54 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Test/Unit/Jws/JwsSignatureJwksTest.php @@ -0,0 +1,112 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Test\Unit\Jws; + +use Magento\Framework\Jwt\Exception\EncryptionException; +use Magento\Framework\Jwt\Jwk; +use Magento\Framework\Jwt\JwkSet; +use Magento\Framework\Jwt\Jws\JwsSignatureJwks; +use PHPUnit\Framework\TestCase; + +class JwsSignatureJwksTest extends TestCase +{ + public function getConstructorCases(): array + { + return [ + 'valid-jwk' => [$this->createJwk(Jwk::PUBLIC_KEY_USE_SIGNATURE), true], + 'valid-jwks' => [ + $this->createJwkSet( + [ + $this->createJwk(Jwk::PUBLIC_KEY_USE_SIGNATURE), + $this->createJwk(Jwk::PUBLIC_KEY_USE_SIGNATURE) + ] + ), + true + ], + 'invalid-jwk' => [$this->createJwk(Jwk::PUBLIC_KEY_USE_ENCRYPTION), false], + 'invalid-jwks' => [ + $this->createJwkSet( + [ + $this->createJwk(Jwk::PUBLIC_KEY_USE_SIGNATURE), + $this->createJwk(Jwk::PUBLIC_KEY_USE_ENCRYPTION) + ] + ), + false + ] + ]; + } + + /** + * Test constructor validation. + * + * @param Jwk|JwkSet $jwks + * @param bool $valid + * @return void + * @dataProvider getConstructorCases + */ + public function testConstruct($jwks, $valid): void + { + if (!$valid) { + $this->expectException(EncryptionException::class); + } + + new JwsSignatureJwks($jwks); + } + + public function getAlgorithmCases(): array + { + return [ + 'one-algo' => [ + $this->createJwk(Jwk::PUBLIC_KEY_USE_SIGNATURE, Jwk::ALGORITHM_HS384), + Jwk::ALGORITHM_HS384 + ], + 'json' => [ + $this->createJwkSet( + [ + $this->createJwk(Jwk::PUBLIC_KEY_USE_SIGNATURE), + $this->createJwk(Jwk::PUBLIC_KEY_USE_SIGNATURE) + ] + ), + 'jws-json-serialization' + ], + ]; + } + + /** + * Test algorithm logic. + * + * @param Jwk|JwkSet $jwk + * @param string $expectedName + * @return void + * @dataProvider getAlgorithmCases + */ + public function testGetAlgorithmName($jwk, string $expectedName): void + { + $model = new JwsSignatureJwks($jwk); + + $this->assertEquals($expectedName, $model->getAlgorithmName()); + } + + private function createJwk(string $use, string $alg = Jwk::ALGORITHM_HS256): Jwk + { + $mock = $this->createMock(Jwk::class); + $mock->method('getPublicKeyUse')->willReturn($use); + $mock->method('getAlgorithm')->willReturn($alg); + + return $mock; + } + + public function createJwkSet(array $jwks): JwkSet + { + $mock = $this->createMock(JwkSet::class); + $mock->method('getKeys')->willReturn($jwks); + + return $mock; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Unsecured/NoEncryption.php b/lib/internal/Magento/Framework/Jwt/Unsecured/NoEncryption.php new file mode 100644 index 0000000000000..59596e444145e --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Unsecured/NoEncryption.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Unsecured; + +use Magento\Framework\Jwt\EncryptionSettingsInterface; + +/** + * No encryption. + */ +class NoEncryption implements EncryptionSettingsInterface +{ + /** + * @inheritDoc + */ + public function getAlgorithmName(): string + { + return 'none'; + } +} diff --git a/lib/internal/Magento/Framework/Jwt/Unsecured/UnsecuredJwt.php b/lib/internal/Magento/Framework/Jwt/Unsecured/UnsecuredJwt.php new file mode 100644 index 0000000000000..f5834063c5bf0 --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Unsecured/UnsecuredJwt.php @@ -0,0 +1,16 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Unsecured; + +use Magento\Framework\Jwt\Jws\AbstractJws; + +class UnsecuredJwt extends AbstractJws implements UnsecuredJwtInterface +{ + +} diff --git a/lib/internal/Magento/Framework/Jwt/Unsecured/UnsecuredJwtInterface.php b/lib/internal/Magento/Framework/Jwt/Unsecured/UnsecuredJwtInterface.php new file mode 100644 index 0000000000000..06ed6a5d3814b --- /dev/null +++ b/lib/internal/Magento/Framework/Jwt/Unsecured/UnsecuredJwtInterface.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\Jwt\Unsecured; + +use Magento\Framework\Jwt\HeaderInterface; +use Magento\Framework\Jwt\JwtInterface; + +/** + * Unprotected JWT. + */ +interface UnsecuredJwtInterface extends JwtInterface +{ + /** + * Protected (not really) headers. + * + * Same as "[getHeader()]" for compact serialization. + * + * @return HeaderInterface[] + */ + public function getProtectedHeaders(): array; + + /** + * Unprotected header can be present when JSON serialization is employed. + * + * @return HeaderInterface[]|null + */ + public function getUnprotectedHeaders(): ?array; +} diff --git a/lib/internal/Magento/Framework/Mail/AddressConverter.php b/lib/internal/Magento/Framework/Mail/AddressConverter.php index d787482f1757d..76c770ab2c9d3 100644 --- a/lib/internal/Magento/Framework/Mail/AddressConverter.php +++ b/lib/internal/Magento/Framework/Mail/AddressConverter.php @@ -40,6 +40,7 @@ public function __construct( */ public function convert(string $email, ?string $name = null): Address { + $email = $this->convertEmailUserToAscii($email); return $this->addressFactory->create( [ 'name' => $name, @@ -48,6 +49,26 @@ public function convert(string $email, ?string $name = null): Address ); } + /** + * Convert email user to ascii + * + * @param string $email + * @return string + */ + private function convertEmailUserToAscii(string $email): string + { + if (preg_match('/^(.+)@([^@]+)$/', $email, $matches)) { + $user = $matches[1]; + $hostname = $matches[2]; + $userEncoded = idn_to_ascii($user, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46); + if ($userEncoded == $user) { + return $email; + } + $email = sprintf('%s@%s', $userEncoded, $hostname); + } + return $email; + } + /** * Converts array to list of MailAddresses * diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/AddressConverterTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/AddressConverterTest.php new file mode 100644 index 0000000000000..ffed24da18415 --- /dev/null +++ b/lib/internal/Magento/Framework/Mail/Test/Unit/AddressConverterTest.php @@ -0,0 +1,76 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\Mail\Test\Unit; + +use Magento\Framework\Mail\AddressConverter; +use Magento\Framework\Mail\AddressFactory; +use Magento\Framework\Mail\Address; +use PHPUnit\Framework\TestCase; + +class AddressConverterTest extends TestCase +{ + /** + * @var Address + */ + private $addressMock; + + /** + * @var AddressFactory + */ + private $addressFactoryMock; + + /** + * @var AddressConverter + */ + private $addressConverter; + + protected function setUp(): void + { + $this->addressMock = $this->createMock(Address::class); + $this->addressFactoryMock = $this->createMock(AddressFactory::class); + $this->addressConverter = new AddressConverter($this->addressFactoryMock); + } + + /** + * @param string $email + * @param string $name + * @param string $emailExpected + * @param string $nameExpected + * @dataProvider convertDataProvider + */ + public function testConvert(string $email, string $name, string $emailExpected, string $nameExpected) + { + $this->addressFactoryMock->expects($this->once()) + ->method('create') + ->with(['name' => $nameExpected, 'email' => $emailExpected]) + ->willReturn($this->addressMock); + $address = $this->addressConverter->convert($email, $name); + $this->assertInstanceOf(Address::class, $address); + } + + /** + * @return array + */ + public function convertDataProvider(): array + { + return [ + [ + 'email' => 'test@example.com', + 'name' => 'Test', + 'emailExpected' => 'test@example.com', + 'nameExpected' => 'Test' + ], + [ + 'email' => 'tést@example.com', + 'name' => 'Test', + 'emailExpected' => 'xn--tst-bma@example.com', + 'nameExpected' => 'Test' + ] + ]; + } +} diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/TransportTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/TransportTest.php index 1bab0a67c81ab..15efbc0d9e5f3 100644 --- a/lib/internal/Magento/Framework/Mail/Test/Unit/TransportTest.php +++ b/lib/internal/Magento/Framework/Mail/Test/Unit/TransportTest.php @@ -7,23 +7,57 @@ namespace Magento\Framework\Mail\Test\Unit; +use Laminas\Mail\Transport\Exception\RuntimeException; use Magento\Framework\Mail\Message; use Magento\Framework\Mail\Transport; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; +/** + * Provides tests for framework email transport functionality. + */ class TransportTest extends TestCase { /** + * @var MockObject|LoggerInterface + */ + private $loggerMock; + + /** + * @var Transport + */ + private $transport; + + /** + * @inheridoc + */ + protected function setUp(): void + { + $this->loggerMock = $this->getMockBuilder(LoggerInterface::class) + ->disableOriginalConstructor() + ->onlyMethods(['error']) + ->getMockForAbstractClass(); + $this->transport = new Transport( + new Message(), + null, + $this->loggerMock + ); + } + + /** + * Verify exception is properly handled in case one occurred when message sent. + * * @covers \Magento\Framework\Mail\Transport::sendMessage + * @return void */ - public function testSendMessageBrokenMessage() + public function testSendMessageBrokenMessage(): void { + $exception = new RuntimeException('Invalid email; contains no at least one of "To", "Cc", and "Bcc" header'); + $this->loggerMock->expects(self::once())->method('error')->with($exception); $this->expectException('Magento\Framework\Exception\MailException'); - $this->expectExceptionMessage('Invalid email; contains no at least one of "To", "Cc", and "Bcc" header'); - $transport = new Transport( - new Message() - ); + $this->expectExceptionMessage('Unable to send mail. Please try again later.'); - $transport->sendMessage(); + $this->transport->sendMessage(); } } diff --git a/lib/internal/Magento/Framework/Mail/Transport.php b/lib/internal/Magento/Framework/Mail/Transport.php index c1772075baaf3..afb42b7af1f41 100644 --- a/lib/internal/Magento/Framework/Mail/Transport.php +++ b/lib/internal/Magento/Framework/Mail/Transport.php @@ -3,17 +3,21 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Framework\Mail; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\MailException; use Magento\Framework\Phrase; use Laminas\Mail\Message as LaminasMessage; use Laminas\Mail\Transport\Sendmail; +use Psr\Log\LoggerInterface; /** * Mail transport */ -class Transport implements \Magento\Framework\Mail\TransportInterface +class Transport implements TransportInterface { /** * @var Sendmail @@ -25,14 +29,21 @@ class Transport implements \Magento\Framework\Mail\TransportInterface */ private $message; + /** + * @var LoggerInterface|null + */ + private $logger; + /** * @param MessageInterface $message * @param null|string|array|\Traversable $parameters + * @param LoggerInterface|null $logger */ - public function __construct(MessageInterface $message, $parameters = null) + public function __construct(MessageInterface $message, $parameters = null, LoggerInterface $logger = null) { $this->laminasTransport = new Sendmail($parameters); $this->message = $message; + $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class); } /** @@ -45,7 +56,8 @@ public function sendMessage() LaminasMessage::fromString($this->message->getRawMessage()) ); } catch (\Exception $e) { - throw new MailException(new Phrase($e->getMessage()), $e); + $this->logger->error($e); + throw new MailException(new Phrase('Unable to send mail. Please try again later.')); } } diff --git a/lib/internal/Magento/Framework/MessageQueue/MessageController.php b/lib/internal/Magento/Framework/MessageQueue/MessageController.php index 16853501e1d65..4d178f0fe4d0a 100644 --- a/lib/internal/Magento/Framework/MessageQueue/MessageController.php +++ b/lib/internal/Magento/Framework/MessageQueue/MessageController.php @@ -60,6 +60,8 @@ public function lock(EnvelopeInterface $envelope, $consumerName) throw new NotFoundException(new Phrase("Property 'message_id' not found in properties.")); } $code = $consumerName . '-' . $properties['message_id']; + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $code = md5($code); $this->reader->read($lock, $code); if ($lock->getId()) { diff --git a/lib/internal/Magento/Framework/MessageQueue/Publisher.php b/lib/internal/Magento/Framework/MessageQueue/Publisher.php index 78d8c0f1bcafa..07440e373b2ef 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Publisher.php +++ b/lib/internal/Magento/Framework/MessageQueue/Publisher.php @@ -83,6 +83,8 @@ public function publish($topicName, $data) 'body' => $data, 'properties' => [ 'delivery_mode' => 2, + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction 'message_id' => md5(uniqid($topicName)) ] ] diff --git a/lib/internal/Magento/Framework/MessageQueue/Rpc/Publisher.php b/lib/internal/Magento/Framework/MessageQueue/Rpc/Publisher.php index 90b2763471ee0..6ad285ce60c5d 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Rpc/Publisher.php +++ b/lib/internal/Magento/Framework/MessageQueue/Rpc/Publisher.php @@ -92,6 +92,8 @@ public function publish($topicName, $data) 'reply_to' => $replyTo, 'delivery_mode' => 2, 'correlation_id' => rand(), + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction 'message_id' => md5(uniqid($topicName)) ] ] diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php index 8d460ac99a46b..1e18ae1960238 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php @@ -1,4 +1,5 @@ <?php + /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. @@ -7,12 +8,13 @@ namespace Magento\Framework\Mview\Test\Unit; -use Laminas\Log\Filter\Mock; use Magento\Framework\Mview\ActionFactory; use Magento\Framework\Mview\ActionInterface; use Magento\Framework\Mview\ConfigInterface; use Magento\Framework\Mview\View; use Magento\Framework\Mview\View\Changelog; +use Magento\Framework\Mview\View\ChangeLogBatchWalkerFactory; +use Magento\Framework\Mview\View\ChangeLogBatchWalkerInterface; use Magento\Framework\Mview\View\StateInterface; use Magento\Framework\Mview\View\Subscription; use Magento\Framework\Mview\View\SubscriptionFactory; @@ -55,7 +57,7 @@ class ViewTest extends TestCase protected $subscriptionFactoryMock; /** - * @var MockObject|View\ChangeLogBatchIteratorInterface + * @var MockObject|ChangeLogBatchWalkerInterface */ private $iteratorMock; @@ -73,7 +75,15 @@ protected function setUp(): void true, ['getView'] ); - $this->iteratorMock = $this->createMock(View\ChangeLogBatchIteratorInterface::class); + $this->iteratorMock = $this->getMockBuilder(ChangeLogBatchWalkerInterface::class) + ->disableOriginalConstructor() + ->onlyMethods(['walk']) + ->getMockForAbstractClass(); + $changeLogBatchWalkerFactory = $this->getMockBuilder(ChangeLogBatchWalkerFactory::class) + ->disableOriginalConstructor() + ->onlyMethods(['create']) + ->getMockForAbstractClass(); + $changeLogBatchWalkerFactory->method('create')->willReturn($this->iteratorMock); $this->actionFactoryMock = $this->createPartialMock(ActionFactory::class, ['get']); $this->stateMock = $this->createPartialMock( State::class, @@ -107,7 +117,7 @@ protected function setUp(): void $this->subscriptionFactoryMock, [], [], - $this->iteratorMock + $changeLogBatchWalkerFactory ); } @@ -485,7 +495,7 @@ public function testUpdateWithException() ); $this->iteratorMock->expects($this->any()) ->method('walk') - ->willReturn([2,3]); + ->willReturn([2, 3]); $actionMock = $this->createPartialMock(ActionInterface::class, ['execute']); $actionMock->expects($this->once())->method('execute')->with($listId)->willReturnCallback( @@ -796,6 +806,7 @@ protected function getViewData() 'action_class' => 'Some\Class\Name', 'group' => 'some_group', 'subscriptions' => ['some_entity' => ['name' => 'some_entity', 'column' => 'entity_id']], + 'walker' => ChangeLogBatchWalkerInterface::class ]; } } diff --git a/lib/internal/Magento/Framework/Notification/MessageList.php b/lib/internal/Magento/Framework/Notification/MessageList.php index 62ac8e083bfd1..4bb8cf2ae6b8e 100644 --- a/lib/internal/Magento/Framework/Notification/MessageList.php +++ b/lib/internal/Magento/Framework/Notification/MessageList.php @@ -29,13 +29,18 @@ class MessageList */ protected $_messages; + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + /** * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param array $messages */ public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, $messages = []) { - $this->_objectManager = $objectManager; + $this->objectManager = $objectManager; $this->_messageClasses = $messages; } @@ -55,7 +60,7 @@ protected function _loadMessages() if (!$messageClass) { throw new \InvalidArgumentException('Message class for message "' . $key . '" is not set'); } - $message = $this->_objectManager->get($messageClass); + $message = $this->objectManager->get($messageClass); if ($message instanceof \Magento\Framework\Notification\MessageInterface) { $this->_messages[$message->getIdentity()] = $message; } else { diff --git a/lib/internal/Magento/Framework/NumberFormatter.php b/lib/internal/Magento/Framework/NumberFormatter.php new file mode 100644 index 0000000000000..2c5c621e84bdb --- /dev/null +++ b/lib/internal/Magento/Framework/NumberFormatter.php @@ -0,0 +1,24 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Framework; + +class NumberFormatter extends \NumberFormatter +{ + /** + * Creates a currency instance. + * + * @param null $locale Locale name + * @param null $style + * @param null $pattern + */ + public function __construct( + $locale = null, + $style = \NumberFormatter::CURRENCY, + $pattern = null + ) { + parent::__construct($locale, $style, $pattern); + } +} diff --git a/lib/internal/Magento/Framework/ObjectManager/Config/Config.php b/lib/internal/Magento/Framework/ObjectManager/Config/Config.php index 72b5902337b0d..df74eedf463a4 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Config/Config.php +++ b/lib/internal/Magento/Framework/ObjectManager/Config/Config.php @@ -272,12 +272,16 @@ public function extend(array $configuration) { if ($this->_cache) { if (!$this->_currentCacheKey) { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $this->_currentCacheKey = md5( $this->getSerializer()->serialize( [$this->_arguments, $this->_nonShared, $this->_preferences, $this->_virtualTypes] ) ); } + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $key = md5($this->_currentCacheKey . $this->getSerializer()->serialize($configuration)); $cached = $this->_cache->get($key); if ($cached) { diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/Fixture/TSample.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/Fixture/TSample.php index 544165774db82..cf7d3f970b835 100644 --- a/lib/internal/Magento/Framework/Reflection/Test/Unit/Fixture/TSample.php +++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/Fixture/TSample.php @@ -5,7 +5,7 @@ */ namespace Magento\Framework\Reflection\Test\Unit\Fixture; -class TSample implements TSampleInterface +class TSample extends TSampleAbstract implements TSampleInterface { /** * @inheritdoc @@ -38,4 +38,12 @@ public function getOnlyNull() { return null; } + + /** + * @inheritdoc + */ + public function getDataOverridden() + { + return []; + } } diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/Fixture/TSampleAbstract.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/Fixture/TSampleAbstract.php new file mode 100644 index 0000000000000..0e696af9ea80c --- /dev/null +++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/Fixture/TSampleAbstract.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\Reflection\Test\Unit\Fixture; + +abstract class TSampleAbstract +{ + /** + * @return array + */ + public function getData() + { + return []; + } + + /** + * @return array + */ + public function getDataOverridden() + { + return []; + } +} diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php index a955e5cff2df8..b7091df6b90ac 100644 --- a/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php +++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php @@ -330,20 +330,50 @@ public function testGetOperationName() /** * Checks a case when method has only `@inheritdoc` annotation. + * + * @dataProvider getReturnTypeWithInheritDocBlockDataProvider + * @param string $methodName + * @param array $returnTypeData */ - public function testGetReturnTypeWithInheritDocBlock() + public function testGetReturnTypeWithInheritDocBlock(string $methodName, array $returnTypeData) { - $expected = [ - 'type' => 'string', - 'isRequired' => true, - 'description' => null, - 'parameterCount' => 0 - ]; - $classReflection = new ClassReflection(TSample::class); - $methodReflection = $classReflection->getMethod('getPropertyName'); + $methodReflection = $classReflection->getMethod($methodName); - self::assertEquals($expected, $this->typeProcessor->getGetterReturnType($methodReflection)); + self::assertEquals($returnTypeData, $this->typeProcessor->getGetterReturnType($methodReflection)); + } + + public function getReturnTypeWithInheritDocBlockDataProvider(): array + { + return [ + [ + 'getPropertyName', + [ + 'type' => 'string', + 'isRequired' => true, + 'description' => null, + 'parameterCount' => 0, + ], + ], + [ + 'getData', + [ + 'type' => 'array', + 'isRequired' => true, + 'description' => null, + 'parameterCount' => 0, + ], + ], + [ + 'getDataOverridden', + [ + 'type' => 'array', + 'isRequired' => true, + 'description' => null, + 'parameterCount' => 0, + ], + ], + ]; } /** diff --git a/lib/internal/Magento/Framework/Reflection/TypeProcessor.php b/lib/internal/Magento/Framework/Reflection/TypeProcessor.php index 2f16d0410c673..7de6fe9e97761 100644 --- a/lib/internal/Magento/Framework/Reflection/TypeProcessor.php +++ b/lib/internal/Magento/Framework/Reflection/TypeProcessor.php @@ -851,9 +851,11 @@ private function getMethodReturnAnnotation(MethodReflection $methodReflection) { $methodName = $methodReflection->getName(); $returnAnnotations = $this->getReturnFromDocBlock($methodReflection); + if (empty($returnAnnotations)) { + $classReflection = $methodReflection->getDeclaringClass(); // method can inherit doc block from implemented interface, like for interceptors - $implemented = $methodReflection->getDeclaringClass()->getInterfaces(); + $implemented = $classReflection->getInterfaces(); /** @var ClassReflection $parentClassReflection */ foreach ($implemented as $parentClassReflection) { if ($parentClassReflection->hasMethod($methodName)) { @@ -863,14 +865,28 @@ private function getMethodReturnAnnotation(MethodReflection $methodReflection) break; } } - // throw an exception if even implemented interface doesn't have return annotations + if (empty($returnAnnotations)) { - throw new \InvalidArgumentException( - "Method's return type must be specified using @return annotation. " - . "See {$methodReflection->getDeclaringClass()->getName()}::{$methodName}()" - ); + while ($classReflection->getParentClass()) { + $classReflection = $classReflection->getParentClass(); + if ($classReflection->hasMethod($methodName)) { + $returnAnnotations = $this->getReturnFromDocBlock( + $classReflection->getMethod($methodName) + ); + break; + } + } + + // throw an exception if even implemented interface doesn't have return annotations + if (empty($returnAnnotations)) { + throw new \InvalidArgumentException( + "Method's return type must be specified using @return annotation. " + . "See {$methodReflection->getDeclaringClass()->getName()}::{$methodName}()" + ); + } } } + return $returnAnnotations; } diff --git a/lib/internal/Magento/Framework/Serialize/Serializer/Serialize.php b/lib/internal/Magento/Framework/Serialize/Serializer/Serialize.php index b5b4206e6507f..b7108fdbd3f0f 100644 --- a/lib/internal/Magento/Framework/Serialize/Serializer/Serialize.php +++ b/lib/internal/Magento/Framework/Serialize/Serializer/Serialize.php @@ -21,6 +21,8 @@ public function serialize($data) if (is_resource($data)) { throw new \InvalidArgumentException('Unable to serialize value.'); } + // We have to use serialize + // phpcs:ignore Magento2.Security.InsecureFunction return serialize($data); } @@ -39,6 +41,8 @@ function () { }, E_NOTICE ); + // We have to use unserialize here + // phpcs:ignore Magento2.Security.InsecureFunction $result = unserialize($string, ['allowed_classes' => false]); restore_error_handler(); return $result; diff --git a/lib/internal/Magento/Framework/Session/Config.php b/lib/internal/Magento/Framework/Session/Config.php index 1791ab09156fd..8ebed1d69f3cc 100644 --- a/lib/internal/Magento/Framework/Session/Config.php +++ b/lib/internal/Magento/Framework/Session/Config.php @@ -5,12 +5,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Framework\Session; use Magento\Framework\App\DeploymentConfig; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; use Magento\Framework\Session\Config\ConfigInterface; +use Magento\Framework\Session\Config\Validator\CookieSameSiteValidator; /** * Magento session configuration @@ -208,6 +211,7 @@ public function __construct( $unsecureURL = $this->_scopeConfig->getValue('web/unsecure/base_url', $this->_scopeType); $isFullySecuredURL = $secureURL == $unsecureURL; $this->setCookieSecure($isFullySecuredURL && $this->_httpRequest->isSecure()); + $this->setCookieSameSite('Lax'); } /** @@ -572,4 +576,36 @@ public function __call($method, $args) throw new \BadMethodCallException(sprintf('Method "%s" does not exist in %s', $method, get_class($this))); } } + + /** + * Set session.cookie_samesite + * + * @param string $cookieSameSite + * @return $this + */ + public function setCookieSameSite(string $cookieSameSite = 'Lax'): ConfigInterface + { + $validator = $this->_validatorFactory->create( + [], + CookieSameSiteValidator::class + ); + if (!$validator->isValid($cookieSameSite) || + !$this->getCookieSecure() && strtolower($cookieSameSite) === 'none') { + throw new \InvalidArgumentException( + 'Invalid Samesite attribute.' + ); + } + $this->setOption('session.cookie_samesite', $cookieSameSite); + return $this; + } + + /** + * Get session.cookie_samesite + * + * @return string + */ + public function getCookieSameSite(): string + { + return (string)$this->getOption('session.cookie_samesite'); + } } diff --git a/lib/internal/Magento/Framework/Session/Config/ConfigInterface.php b/lib/internal/Magento/Framework/Session/Config/ConfigInterface.php index 55c082b3d80aa..8d3154e9a3b41 100644 --- a/lib/internal/Magento/Framework/Session/Config/ConfigInterface.php +++ b/lib/internal/Magento/Framework/Session/Config/ConfigInterface.php @@ -5,6 +5,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Framework\Session\Config; /** @@ -174,4 +176,19 @@ public function setUseCookies($useCookies); * @SuppressWarnings(PHPMD.BooleanGetMethodName) */ public function getUseCookies(); + + /** + * Set session.cookie_samesite + * + * @param string $cookieSameSite + * @return $this + */ + public function setCookieSameSite(string $cookieSameSite): ConfigInterface; + + /** + * Get session.cookie_samesite + * + * @return string + */ + public function getCookieSameSite(): string; } diff --git a/lib/internal/Magento/Framework/Session/Config/Validator/CookieSameSiteValidator.php b/lib/internal/Magento/Framework/Session/Config/Validator/CookieSameSiteValidator.php new file mode 100644 index 0000000000000..ed763dba7c60f --- /dev/null +++ b/lib/internal/Magento/Framework/Session/Config/Validator/CookieSameSiteValidator.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\Session\Config\Validator; + +/** + * Cookie SameSite Attribute validator + */ +class CookieSameSiteValidator extends \Magento\Framework\Validator\AbstractValidator +{ + /**#@+ + * Constant for validating same site allowed values + */ + private const SAME_SITE_ALLOWED_VALUES = [ + 'strict', + 'lax', + 'none' + ]; + + /** + * @inheritdoc + */ + public function isValid($value) + { + return in_array(strtolower($value), self::SAME_SITE_ALLOWED_VALUES); + } +} diff --git a/lib/internal/Magento/Framework/Session/SessionManager.php b/lib/internal/Magento/Framework/Session/SessionManager.php index 90b49a32a7851..2298fb61c4dec 100644 --- a/lib/internal/Magento/Framework/Session/SessionManager.php +++ b/lib/internal/Magento/Framework/Session/SessionManager.php @@ -216,6 +216,7 @@ public function start() $this->_addHost(); \Magento\Framework\Profiler::stop('session_start'); } + // phpstan:ignore $this->storage->init(isset($_SESSION) ? $_SESSION : []); } return $this; @@ -242,6 +243,7 @@ private function renewCookie($sid) $metadata->setDuration($this->sessionConfig->getCookieLifetime()); $metadata->setSecure($this->sessionConfig->getCookieSecure()); $metadata->setHttpOnly($this->sessionConfig->getCookieHttpOnly()); + $metadata->setSameSite($this->sessionConfig->getCookieSameSite()); $this->cookieManager->setPublicCookie( $this->getName(), @@ -552,7 +554,7 @@ public function regenerateId() } else { session_start(); } - + // phpstan:ignore $this->storage->init(isset($_SESSION) ? $_SESSION : []); if ($this->sessionConfig->getUseCookies()) { diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php index 8b0f4957046eb..ebdc8d5500491 100644 --- a/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php @@ -8,6 +8,7 @@ /** * Test class for \Magento\Framework\Session\Config */ + namespace Magento\Framework\Session\Test\Unit; use Magento\Framework\App\Config\ScopeConfigInterface; @@ -121,7 +122,8 @@ public function optionsProvider() ['use_trans_sid', 'getUseTransSid', true], ['hash_function', 'getHashFunction', 'md5'], ['hash_bits_per_character', 'getHashBitsPerCharacter', 5], - ['url_rewriter_tags', 'getUrlRewriterTags', 'a=href'] + ['url_rewriter_tags', 'getUrlRewriterTags', 'a=href'], + ['cookie_samesite', 'getCookieSameSite', 'Lax'] ]; } @@ -163,12 +165,17 @@ public function testCookieLifetimeCanBeZero() public function testSettingInvalidCookieLifetime() { + $returnMap = + [ + ['foobar_bogus', false], + ['Lax', true] + ]; $validatorMock = $this->getMockBuilder(ValidatorInterface::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); $validatorMock->expects($this->any()) ->method('isValid') - ->willReturn(false); + ->willReturnMap($returnMap); $this->getModel($validatorMock); $preVal = $this->config->getCookieLifetime(); $this->config->setCookieLifetime('foobar_bogus'); @@ -177,12 +184,17 @@ public function testSettingInvalidCookieLifetime() public function testSettingInvalidCookieLifetime2() { + $returnMap = + [ + [-1, false], + ['Lax', true] + ]; $validatorMock = $this->getMockBuilder(ValidatorInterface::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); $validatorMock->expects($this->any()) ->method('isValid') - ->willReturn(false); + ->willReturnMap($returnMap); $this->getModel($validatorMock); $preVal = $this->config->getCookieLifetime(); $this->config->setCookieLifetime(-1); @@ -227,12 +239,17 @@ public function testCookieDomainCanBeEmpty() public function testSettingInvalidCookieDomain() { + $returnMap = + [ + [24, false], + ['Lax', true] + ]; $validatorMock = $this->getMockBuilder(ValidatorInterface::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); $validatorMock->expects($this->any()) ->method('isValid') - ->willReturn(false); + ->willReturnMap($returnMap); $this->getModel($validatorMock); $preVal = $this->config->getCookieDomain(); $this->config->setCookieDomain(24); @@ -241,12 +258,17 @@ public function testSettingInvalidCookieDomain() public function testSettingInvalidCookieDomain2() { + $returnMap = + [ + ['D:\\WINDOWS\\System32\\drivers\\etc\\hosts', false], + ['Lax', true] + ]; $validatorMock = $this->getMockBuilder(ValidatorInterface::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); $validatorMock->expects($this->any()) ->method('isValid') - ->willReturn(false); + ->willReturnMap($returnMap); $this->getModel($validatorMock); $preVal = $this->config->getCookieDomain(); $this->config->setCookieDomain('D:\\WINDOWS\\System32\\drivers\\etc\\hosts'); @@ -333,22 +355,30 @@ public function testConstructor($isValidSame, $isValid, $expected) $validatorMock = $this->getMockBuilder(ValidatorInterface::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); + if ($isValidSame) { + $returnMap = + [ + [7200, $isValid], + ['/', $isValid], + ['init.host', $isValid], + ['Lax', true] + ]; $validatorMock->expects($this->any()) ->method('isValid') - ->willReturn($isValid); + ->willReturnMap($returnMap); } else { - for ($x = 0; $x<6; $x++) { - if ($x % 2 == 0) { - $validatorMock->expects($this->at($x)) - ->method('isValid') - ->willReturn(false); - } else { - $validatorMock->expects($this->at($x)) - ->method('isValid') - ->willReturn(true); - } - } + $returnMap = + [ + [3600, true], + [7200, false], + ['/', true], + ['init.host', true], + ['Lax', true] + ]; + $validatorMock->expects($this->any()) + ->method('isValid') + ->willReturnMap($returnMap); } $this->getModel($validatorMock); @@ -372,7 +402,8 @@ public function constructorDataProvider() 'session.cookie_domain' => 'init.host', 'session.cookie_httponly' => false, 'session.cookie_secure' => false, - 'session.save_handler' => 'files' + 'session.save_handler' => 'files', + 'session.cookie_samesite' => 'Lax' ], ], 'all invalid' => [ @@ -382,7 +413,8 @@ public function constructorDataProvider() 'session.cache_limiter' => 'private_no_expire', 'session.cookie_httponly' => false, 'session.cookie_secure' => false, - 'session.save_handler' => 'files' + 'session.save_handler' => 'files', + 'session.cookie_samesite' => 'Lax' ], ], 'invalid_valid' => [ @@ -395,7 +427,8 @@ public function constructorDataProvider() 'session.cookie_domain' => 'init.host', 'session.cookie_httponly' => false, 'session.cookie_secure' => false, - 'session.save_handler' => 'files' + 'session.save_handler' => 'files', + 'session.cookie_samesite' => 'Lax' ], ], ]; diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/DbSchemaWriter.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/DbSchemaWriter.php index 00bffa4ff54b2..b466eae77d9e2 100644 --- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/DbSchemaWriter.php +++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/DbSchemaWriter.php @@ -313,10 +313,16 @@ public function compile(StatementAggregator $statementAggregator, $dryRun) private function getNextAutoIncrementValue(string $tableName, string $resource): int { $adapter = $this->resourceConnection->getConnection($resource); - $sql = sprintf('SELECT MAX(`%s`) + 1 FROM `%s`', $adapter->getAutoIncrementField($tableName), $tableName); - $adapter->resetDdlCache($tableName); - $stmt = $adapter->query($sql); + $autoIncrementField = $adapter->getAutoIncrementField($tableName); + if ($autoIncrementField) { + $sql = sprintf('SELECT MAX(`%s`) + 1 FROM `%s`', $autoIncrementField, $tableName); + $adapter->resetDdlCache($tableName); + $stmt = $adapter->query($sql); + + return (int)$stmt->fetchColumn(); + } else { + return 1; + } - return (int)$stmt->fetchColumn(); } } diff --git a/lib/internal/Magento/Framework/Shell.php b/lib/internal/Magento/Framework/Shell.php index 9a70bec54811f..1cc5d33904019 100644 --- a/lib/internal/Magento/Framework/Shell.php +++ b/lib/internal/Magento/Framework/Shell.php @@ -55,6 +55,8 @@ public function execute($command, array $arguments = []) throw new Exception\LocalizedException(new \Magento\Framework\Phrase('The exec function is disabled.')); } + // exec() have to be called here + // phpcs:ignore Magento2.Security.InsecureFunction exec($command, $output, $exitCode); $output = implode(PHP_EOL, $output); $this->log($output); diff --git a/lib/internal/Magento/Framework/Shell/Driver.php b/lib/internal/Magento/Framework/Shell/Driver.php index f905b5a441ba3..d42062bd3529d 100644 --- a/lib/internal/Magento/Framework/Shell/Driver.php +++ b/lib/internal/Magento/Framework/Shell/Driver.php @@ -42,6 +42,8 @@ public function execute($command, $arguments) } $command = $this->commandRenderer->render($command, $arguments); + // exec() have to be called here + // phpcs:ignore Magento2.Security.InsecureFunction exec($command, $output, $exitCode); $output = implode(PHP_EOL, $output); return new Response(['output' => $output, 'exit_code' => $exitCode, 'escaped_command' => $command]); diff --git a/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php b/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php index 97c7945a2aee3..67dac40863ad4 100644 --- a/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php @@ -13,6 +13,7 @@ use Magento\Framework\ZendEscaper; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; +use Magento\Framework\Translate\Inline\StateInterface; /** * \Magento\Framework\Escaper test case @@ -24,6 +25,11 @@ class EscaperTest extends TestCase */ protected $escaper; + /** + * @var ObjectManager + */ + private $objectManagerHelper; + /** * @var ZendEscaper */ @@ -44,14 +50,14 @@ class EscaperTest extends TestCase */ protected function setUp(): void { - $objectManagerHelper = new ObjectManager($this); + $this->objectManagerHelper = new ObjectManager($this); $this->escaper = new Escaper(); $this->zendEscaper = new ZendEscaper(); - $this->translateInline = $objectManagerHelper->getObject(Inline::class); + $this->translateInline = $this->objectManagerHelper->getObject(Inline::class); $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); - $objectManagerHelper->setBackwardCompatibleProperty($this->escaper, 'escaper', $this->zendEscaper); - $objectManagerHelper->setBackwardCompatibleProperty($this->escaper, 'logger', $this->loggerMock); - $objectManagerHelper->setBackwardCompatibleProperty( + $this->objectManagerHelper->setBackwardCompatibleProperty($this->escaper, 'escaper', $this->zendEscaper); + $this->objectManagerHelper->setBackwardCompatibleProperty($this->escaper, 'logger', $this->loggerMock); + $this->objectManagerHelper->setBackwardCompatibleProperty( $this->escaper, 'translateInline', $this->translateInline @@ -169,6 +175,58 @@ public function testEscapeHtml($data, $expected, $allowedTags = []) $this->assertEquals($expected, $actual); } + /** + * Tests escapeHtmlAttr method when Inline translate is configured. + * + * @param string $input + * @param string $output + * @return void + * @dataProvider escapeHtmlAttributeWithInlineTranslateEnabledDataProvider + */ + public function testEscapeHtmlAttributeWithInlineTranslateEnabled(string $input, string $output): void + { + $this->objectManagerHelper->setBackwardCompatibleProperty( + $this->translateInline, + 'isAllowed', + true + ); + $stateMock = $this->createMock(StateInterface::class); + $stateMock->method('isEnabled') + ->willReturn(true); + $this->objectManagerHelper->setBackwardCompatibleProperty( + $this->translateInline, + 'state', + $stateMock + ); + + + $actual = $this->escaper->escapeHtmlAttr($input); + $this->assertEquals($output, $actual); + } + + /** + * Data provider for escapeHtmlAttrWithInline test. + * + * @return array + */ + public function escapeHtmlAttributeWithInlineTranslateEnabledDataProvider(): array + { + return [ + [ + '{{{Search entire store here...}}}', + '{{{Search entire store here...}}}', + ], + [ + '{{{Product search}}{{Translated to language}}{{themeMagento/Luma}}}', + '{{{Product search}}{{Translated to language}}{{themeMagento/Luma}}}', + ], + [ + 'Simple string', + 'Simple string', + ], + ]; + } + /** * @covers \Magento\Framework\Escaper::escapeHtml * @dataProvider escapeHtmlInvalidDataProvider diff --git a/lib/internal/Magento/Framework/TestFramework/Unit/Helper/ObjectManager.php b/lib/internal/Magento/Framework/TestFramework/Unit/Helper/ObjectManager.php index 69156225e9c39..adf6e81c10c5f 100644 --- a/lib/internal/Magento/Framework/TestFramework/Unit/Helper/ObjectManager.php +++ b/lib/internal/Magento/Framework/TestFramework/Unit/Helper/ObjectManager.php @@ -6,6 +6,9 @@ namespace Magento\Framework\TestFramework\Unit\Helper; use PHPUnit\Framework\MockObject\MockObject; +use ReflectionClass; +use ReflectionException; +use ReflectionParameter; /** * Helper class for basic object retrieving, such as blocks, models etc... @@ -222,7 +225,8 @@ function ($className, $arguments) { } elseif ($parameter->allowsNull()) { $args[] = null; } else { - $mock = $this->_getMockWithoutConstructorCall($parameter->getClass()->getName()); + $parameterClass = $this->getParameterClass($parameter); + $mock = $this->_getMockWithoutConstructorCall($parameterClass->getName()); $args[] = $mock; } } @@ -237,6 +241,22 @@ function ($className, $arguments) { return new $className(...array_values($this->getConstructArguments($className, $arguments))); } + /** + * Get class by reflection parameter + * + * @param ReflectionParameter $reflectionParameter + * @return ReflectionClass|null + * @throws ReflectionException + */ + private function getParameterClass(ReflectionParameter $reflectionParameter): ?ReflectionClass + { + $parameterType = $reflectionParameter->getType(); + + return $parameterType && !$parameterType->isBuiltin() + ? new ReflectionClass($parameterType->getName()) + : null; + } + /** * Retrieve associative array of arguments that used for new object instance creation * @@ -268,8 +288,8 @@ public function getConstructArguments($className, array $arguments = []) $object = null; try { - if ($parameter->getClass()) { - $argClassName = $parameter->getClass()->getName(); + if ($parameterClass = $this->getParameterClass($parameter)) { + $argClassName = $parameterClass->getName(); } $object = $this->_getMockObject($argClassName, $arguments); } catch (\ReflectionException $e) { diff --git a/lib/internal/Magento/Framework/Validator/Test/Unit/FactoryTest.php b/lib/internal/Magento/Framework/Validator/Test/Unit/FactoryTest.php index b91b3e500cadf..cea23eee1a670 100644 --- a/lib/internal/Magento/Framework/Validator/Test/Unit/FactoryTest.php +++ b/lib/internal/Magento/Framework/Validator/Test/Unit/FactoryTest.php @@ -88,7 +88,6 @@ protected function setUp(): void Reader::class, ['getConfigurationFiles'] ); - $this->cacheMock = $this->getMockForAbstractClass(FrontendInterface::class); $objectManager = new ObjectManager($this); diff --git a/lib/internal/Magento/Framework/Validator/UrlKey.php b/lib/internal/Magento/Framework/Validator/UrlKey.php new file mode 100644 index 0000000000000..81dabf230d111 --- /dev/null +++ b/lib/internal/Magento/Framework/Validator/UrlKey.php @@ -0,0 +1,53 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\Validator; + +/** + * Class UrlKey performs validation for reserved endpoint names + */ +class UrlKey +{ + /** + * @var array + */ + private $restrictedValues = []; + + /** + * @param array $restrictedValues + */ + public function __construct( + array $restrictedValues + ) { + $this->restrictedValues = $restrictedValues; + } + + /** + * Validates that urlkey not belongs to reserved endpoints + * + * @param string|null $urlKey + * @return bool + */ + public function isValid(?string $urlKey): bool + { + if (in_array($urlKey, $this->restrictedValues)) { + return false; + } + + return true; + } + + /** + * Returns array of reserved endpoints + * + * @return array + */ + public function getRestrictedValues(): array + { + return $this->restrictedValues; + } +} diff --git a/lib/internal/Magento/Framework/View/Asset/Bundle.php b/lib/internal/Magento/Framework/View/Asset/Bundle.php index 5d918982412b7..4775f50bd12a0 100644 --- a/lib/internal/Magento/Framework/View/Asset/Bundle.php +++ b/lib/internal/Magento/Framework/View/Asset/Bundle.php @@ -51,6 +51,11 @@ class Bundle */ protected $minification; + /** + * @var Filesystem + */ + private $filesystem; + /** * @param Filesystem $filesystem * @param Bundle\ConfigInterface $bundleConfig diff --git a/lib/internal/Magento/Framework/View/Asset/Merged.php b/lib/internal/Magento/Framework/View/Asset/Merged.php index 302eb1226b8ef..77f6b4d20a314 100644 --- a/lib/internal/Magento/Framework/View/Asset/Merged.php +++ b/lib/internal/Magento/Framework/View/Asset/Merged.php @@ -136,6 +136,8 @@ private function createMergedAsset(array $assets) $paths[] = $version; } + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $filePath = md5(implode('|', $paths)) . '.' . $this->contentType; return $this->assetRepo->createArbitrary($filePath, self::getRelativeDir()); } diff --git a/lib/internal/Magento/Framework/View/Asset/Repository.php b/lib/internal/Magento/Framework/View/Asset/Repository.php index 6ec4d1219af63..4176827815502 100644 --- a/lib/internal/Magento/Framework/View/Asset/Repository.php +++ b/lib/internal/Magento/Framework/View/Asset/Repository.php @@ -87,6 +87,11 @@ class Repository */ private $themeProvider; + /** + * @var \Magento\Framework\App\Request\Http + */ + private $request; + /** * @param \Magento\Framework\UrlInterface $baseUrl * @param \Magento\Framework\View\DesignInterface $design diff --git a/lib/internal/Magento/Framework/View/Design/Theme/Customization/FileServiceFactory.php b/lib/internal/Magento/Framework/View/Design/Theme/Customization/FileServiceFactory.php index 9e39e80012913..86966f06dcf2e 100644 --- a/lib/internal/Magento/Framework/View/Design/Theme/Customization/FileServiceFactory.php +++ b/lib/internal/Magento/Framework/View/Design/Theme/Customization/FileServiceFactory.php @@ -17,6 +17,11 @@ class FileServiceFactory */ protected $_objectManager; + /** + * @var array + */ + private $_types; + /** * Constructor * diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 8034e1592a232..ea47c22d8f602 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -166,7 +166,10 @@ abstract class AbstractBlock extends \Magento\Framework\DataObject implements Bl * The property is used to define content-scope of block. Can be private or public. * If it isn't defined then application considers it as false. * + * @see https://devdocs.magento.com/guides/v2.4/extension-dev-guide/cache/page-caching/private-content.html * @var bool + * @deprecated + * @since 103.0.1 */ protected $_isScopePrivate = false; @@ -1190,6 +1193,8 @@ public function getVar($name, $module = null) * Returns true if scope is private, false otherwise * * @return bool + * @deprecated + * @since 103.0.1 */ public function isScopePrivate() { diff --git a/lib/internal/Magento/Framework/View/Element/Template/File/Validator.php b/lib/internal/Magento/Framework/View/Element/Template/File/Validator.php index 285c05c9db69c..8f0310af0a317 100644 --- a/lib/internal/Magento/Framework/View/Element/Template/File/Validator.php +++ b/lib/internal/Magento/Framework/View/Element/Template/File/Validator.php @@ -74,8 +74,11 @@ class Validator private $fileDriver; /** - * Class constructor - * + * @var array + */ + private $moduleDirs; + + /** * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface * @param ComponentRegistrar $componentRegistrar diff --git a/lib/internal/Magento/Framework/View/Result/Page.php b/lib/internal/Magento/Framework/View/Result/Page.php index 14a83a8320330..2221908346f8a 100644 --- a/lib/internal/Magento/Framework/View/Result/Page.php +++ b/lib/internal/Magento/Framework/View/Result/Page.php @@ -223,6 +223,8 @@ public function addPageLayoutHandles(array $parameters = [], $defaultHandle = nu $handle = $defaultHandle ? $defaultHandle : $this->getDefaultLayoutHandle(); $pageHandles = [$handle]; foreach ($parameters as $key => $value) { + $handle = $value['handle'] ?? $handle; + $value = $value['value'] ?? $value; $pageHandle = $handle . '_' . $key . '_' . $value; $pageHandles[] = $pageHandle; if ($entitySpecific) { diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index dfc81189bf544..3d6b0405662f5 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -23,24 +23,25 @@ "ext-xsl": "*", "lib-libxml": "*", "colinmollenhour/php-redis-session-abstract": "~1.4.0", - "composer/composer": "^1.9", + "composer/composer": "^1.9 || ^2.0", "guzzlehttp/guzzle": "^6.3.3", - "laminas/laminas-code": "~3.4.1", - "laminas/laminas-crypt": "^2.6.0", + "laminas/laminas-code": "^3.5.1", + "laminas/laminas-crypt": "^3.4.0", "laminas/laminas-http": "^2.6.0", "laminas/laminas-mail": "^2.9.0", - "laminas/laminas-mime": "^2.5.0", - "laminas/laminas-mvc": "~2.7.0", + "laminas/laminas-mime": "^2.8.0", + "laminas/laminas-mvc": "^3.2.0", "laminas/laminas-stdlib": "^3.2.1", "laminas/laminas-uri": "^2.5.1", "laminas/laminas-validator": "^2.6.0", "magento/zendframework1": "~1.14.2", "monolog/monolog": "^1.17", - "ramsey/uuid": "~3.8.0", + "ramsey/uuid": "~4.1.0", "symfony/console": "~4.4.0", "symfony/process": "~4.4.0", - "tedivm/jshrink": "~1.3.0", - "wikimedia/less.php": "~1.8.0" + "tedivm/jshrink": "~1.4.0", + "wikimedia/less.php": "^3.0.0", + "web-token/jwt-framework": "^v2.2.7" }, "archive": { "exclude": [ diff --git a/lib/web/fotorama/fotorama.js b/lib/web/fotorama/fotorama.js index f268c9aa73667..007a0e1a88bd5 100644 --- a/lib/web/fotorama/fotorama.js +++ b/lib/web/fotorama/fotorama.js @@ -1140,7 +1140,7 @@ fotoramaVersion = '4.6.4'; function addEvent(el, e, fn, bool) { if (!e) return; - el.addEventListener ? el.addEventListener(e, fn, !!bool) : el.attachEvent('on' + e, fn); + el.addEventListener ? el.addEventListener(e, fn, {passive: true}) : el.attachEvent('on' + e, fn); } /** @@ -1903,6 +1903,14 @@ fotoramaVersion = '4.6.4'; }); } + /** + * Checks if current media object is YouTube or Vimeo video stream + * @returns {boolean} + */ + function isVideo() { + return $((that.activeFrame || {}).$stageFrame || {}).hasClass('fotorama-video-container'); + } + function allowKey(key) { return o_keyboard[key]; } @@ -3149,8 +3157,7 @@ fotoramaVersion = '4.6.4'; if (o_allowFullScreen && !that.fullScreen) { //check that this is not video - var isVideo = $((that.activeFrame || {}).$stageFrame || {}).hasClass('fotorama-video-container'); - if(isVideo) { + if(isVideo()) { return; } @@ -3739,7 +3746,10 @@ fotoramaVersion = '4.6.4'; } activeIndexes = []; - detachFrames(STAGE_FRAME_KEY); + + if (!isVideo()) { + detachFrames(STAGE_FRAME_KEY); + } reset.ok = true; diff --git a/lib/web/jquery/jquery.cookie.js b/lib/web/jquery/jquery.cookie.js index b0675946910ab..654b4619fdb43 100644 --- a/lib/web/jquery/jquery.cookie.js +++ b/lib/web/jquery/jquery.cookie.js @@ -46,7 +46,8 @@ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', - options.secure ? '; secure' : '' + options.secure ? '; secure' : '', + '; samesite=' + (options.samesite ? options.samesite : 'lax'), ].join('')); } diff --git a/lib/web/jquery/ui-modules/dialog.js b/lib/web/jquery/ui-modules/dialog.js index 430ec90534e92..f041e56701179 100644 --- a/lib/web/jquery/ui-modules/dialog.js +++ b/lib/web/jquery/ui-modules/dialog.js @@ -12,9 +12,7 @@ define([ 'jquery', 'jquery-ui-modules/button', - 'jquery-ui-modules/draggable', - 'jquery-ui-modules/position', - 'jquery-ui-modules/resizable' + 'jquery-ui-modules/position' ], function ($, undefined) { var sizeRelatedOptions = { @@ -107,11 +105,22 @@ define([ this._createTitlebar(); this._createButtonPane(); - if (this.options.draggable && $.fn.draggable) { - this._makeDraggable(); + var widget = this; + + if (this.options.draggable) { + require(['jquery-ui-modules/draggable'], function () { + if($.fn.draggable) { + widget._makeDraggable(); + } + }); } - if (this.options.resizable && $.fn.resizable) { - this._makeResizable(); + + if (this.options.resizable) { + require(['jquery-ui-modules/resizable'], function () { + if($.fn.resizable) { + widget._makeResizable(); + } + }); } this._isOpen = false; diff --git a/lib/web/knockoutjs/knockout.js b/lib/web/knockoutjs/knockout.js index 93ccdc5415111..6450f3e68ebb3 100644 --- a/lib/web/knockoutjs/knockout.js +++ b/lib/web/knockoutjs/knockout.js @@ -1,4680 +1,5184 @@ /*! - * Knockout JavaScript library v3.4.2 + * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) */ (function(){ -var DEBUG=true; -(function(undefined){ - // (0, eval)('this') is a robust way of getting a reference to the global object - // For details, see http://stackoverflow.com/questions/14119988/return-this-0-evalthis/14120023#14120023 - var window = this || (0, eval)('this'), - document = window['document'], - navigator = window['navigator'], - jQueryInstance = window["jQuery"], - JSON = window["JSON"]; -(function(factory) { - // Support three module loading scenarios - if (typeof define === 'function' && define['amd']) { - // [1] AMD anonymous module - define(['exports', 'require'], factory); - } else if (typeof exports === 'object' && typeof module === 'object') { - // [2] CommonJS/Node.js - factory(module['exports'] || exports); // module.exports is for Node.js - } else { - // [3] No module loader (plain <script> tag) - put directly in global namespace - factory(window['ko'] = {}); - } -}(function(koExports, amdRequire){ + var DEBUG=true; + (function(undefined){ + // (0, eval)('this') is a robust way of getting a reference to the global object + // For details, see http://stackoverflow.com/questions/14119988/return-this-0-evalthis/14120023#14120023 + var window = this || (0, eval)('this'), + document = window['document'], + navigator = window['navigator'], + jQueryInstance = window["jQuery"], + JSON = window["JSON"]; + + if (!jQueryInstance && typeof jQuery !== "undefined") { + jQueryInstance = jQuery; + } + (function(factory) { + // Support three module loading scenarios + if (typeof define === 'function' && define['amd']) { + // [1] AMD anonymous module + define(['exports', 'require'], factory); + } else if (typeof exports === 'object' && typeof module === 'object') { + // [2] CommonJS/Node.js + factory(module['exports'] || exports); // module.exports is for Node.js + } else { + // [3] No module loader (plain <script> tag) - put directly in global namespace + factory(window['ko'] = {}); + } + }(function(koExports, amdRequire){ // Internally, all KO objects are attached to koExports (even the non-exported ones whose names will be minified by the closure compiler). // In the future, the following "ko" variable may be made distinct from "koExports" so that private objects are not externally reachable. -var ko = typeof koExports !== 'undefined' ? koExports : {}; + var ko = typeof koExports !== 'undefined' ? koExports : {}; // Google Closure Compiler helpers (used only to make the minified file smaller) -ko.exportSymbol = function(koPath, object) { - var tokens = koPath.split("."); - - // In the future, "ko" may become distinct from "koExports" (so that non-exported objects are not reachable) - // At that point, "target" would be set to: (typeof koExports !== "undefined" ? koExports : ko) - var target = ko; - - for (var i = 0; i < tokens.length - 1; i++) - target = target[tokens[i]]; - target[tokens[tokens.length - 1]] = object; -}; -ko.exportProperty = function(owner, publicName, object) { - owner[publicName] = object; -}; -ko.version = "3.4.2"; - -ko.exportSymbol('version', ko.version); + ko.exportSymbol = function(koPath, object) { + var tokens = koPath.split("."); + + // In the future, "ko" may become distinct from "koExports" (so that non-exported objects are not reachable) + // At that point, "target" would be set to: (typeof koExports !== "undefined" ? koExports : ko) + var target = ko; + + for (var i = 0; i < tokens.length - 1; i++) + target = target[tokens[i]]; + target[tokens[tokens.length - 1]] = object; + }; + ko.exportProperty = function(owner, publicName, object) { + owner[publicName] = object; + }; + ko.version = "3.5.1"; + + ko.exportSymbol('version', ko.version); // For any options that may affect various areas of Knockout and aren't directly associated with data binding. -ko.options = { - 'deferUpdates': false, - 'useOnlyNativeEvents': false -}; + ko.options = { + 'deferUpdates': false, + 'useOnlyNativeEvents': false, + 'foreachHidesDestroyed': false + }; //ko.exportSymbol('options', ko.options); // 'options' isn't minified -ko.utils = (function () { - function objectForEach(obj, action) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - action(prop, obj[prop]); - } - } - } + ko.utils = (function () { + var hasOwnProperty = Object.prototype.hasOwnProperty; - function extend(target, source) { - if (source) { - for(var prop in source) { - if(source.hasOwnProperty(prop)) { - target[prop] = source[prop]; + function objectForEach(obj, action) { + for (var prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + action(prop, obj[prop]); + } + } } - } - } - return target; - } - - function setPrototypeOf(obj, proto) { - obj.__proto__ = proto; - return obj; - } - - var canSetPrototype = ({ __proto__: [] } instanceof Array); - var canUseSymbols = !DEBUG && typeof Symbol === 'function'; - - // Represent the known event types in a compact way, then at runtime transform it into a hash with event name as key (for fast lookup) - var knownEvents = {}, knownEventTypesByEventName = {}; - var keyEventTypeName = (navigator && /Firefox\/2/i.test(navigator.userAgent)) ? 'KeyboardEvent' : 'UIEvents'; - knownEvents[keyEventTypeName] = ['keyup', 'keydown', 'keypress']; - knownEvents['MouseEvents'] = ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave']; - objectForEach(knownEvents, function(eventType, knownEventsForType) { - if (knownEventsForType.length) { - for (var i = 0, j = knownEventsForType.length; i < j; i++) - knownEventTypesByEventName[knownEventsForType[i]] = eventType; - } - }); - var eventsThatMustBeRegisteredUsingAttachEvent = { 'propertychange': true }; // Workaround for an IE9 issue - https://github.com/SteveSanderson/knockout/issues/406 - - // Detect IE versions for bug workarounds (uses IE conditionals, not UA string, for robustness) - // Note that, since IE 10 does not support conditional comments, the following logic only detects IE < 10. - // Currently this is by design, since IE 10+ behaves correctly when treated as a standard browser. - // If there is a future need to detect specific versions of IE10+, we will amend this. - var ieVersion = document && (function() { - var version = 3, div = document.createElement('div'), iElems = div.getElementsByTagName('i'); - - // Keep constructing conditional HTML blocks until we hit one that resolves to an empty fragment - while ( - div.innerHTML = '<!--[if gt IE ' + (++version) + ']><i></i><![endif]-->', - iElems[0] - ) {} - return version > 4 ? version : undefined; - }()); - var isIe6 = ieVersion === 6, - isIe7 = ieVersion === 7; - - function isClickOnCheckableElement(element, eventType) { - if ((ko.utils.tagNameLower(element) !== "input") || !element.type) return false; - if (eventType.toLowerCase() != "click") return false; - var inputType = element.type; - return (inputType == "checkbox") || (inputType == "radio"); - } - - // For details on the pattern for changing node classes - // see: https://github.com/knockout/knockout/issues/1597 - var cssClassNameRegex = /\S+/g; - - function toggleDomNodeCssClass(node, classNames, shouldHaveClass) { - var addOrRemoveFn; - if (classNames) { - if (typeof node.classList === 'object') { - addOrRemoveFn = node.classList[shouldHaveClass ? 'add' : 'remove']; - ko.utils.arrayForEach(classNames.match(cssClassNameRegex), function(className) { - addOrRemoveFn.call(node.classList, className); - }); - } else if (typeof node.className['baseVal'] === 'string') { - // SVG tag .classNames is an SVGAnimatedString instance - toggleObjectClassPropertyString(node.className, 'baseVal', classNames, shouldHaveClass); - } else { - // node.className ought to be a string. - toggleObjectClassPropertyString(node, 'className', classNames, shouldHaveClass); - } - } - } - - function toggleObjectClassPropertyString(obj, prop, classNames, shouldHaveClass) { - // obj/prop is either a node/'className' or a SVGAnimatedString/'baseVal'. - var currentClassNames = obj[prop].match(cssClassNameRegex) || []; - ko.utils.arrayForEach(classNames.match(cssClassNameRegex), function(className) { - ko.utils.addOrRemoveItem(currentClassNames, className, shouldHaveClass); - }); - obj[prop] = currentClassNames.join(" "); - } - - return { - fieldsIncludedWithJsonPost: ['authenticity_token', /^__RequestVerificationToken(_.*)?$/], - - arrayForEach: function (array, action) { - for (var i = 0, j = array.length; i < j; i++) - action(array[i], i); - }, - - arrayIndexOf: function (array, item) { - if (typeof Array.prototype.indexOf == "function") - return Array.prototype.indexOf.call(array, item); - for (var i = 0, j = array.length; i < j; i++) - if (array[i] === item) - return i; - return -1; - }, - - arrayFirst: function (array, predicate, predicateOwner) { - for (var i = 0, j = array.length; i < j; i++) - if (predicate.call(predicateOwner, array[i], i)) - return array[i]; - return null; - }, - - arrayRemoveItem: function (array, itemToRemove) { - var index = ko.utils.arrayIndexOf(array, itemToRemove); - if (index > 0) { - array.splice(index, 1); - } - else if (index === 0) { - array.shift(); - } - }, - - arrayGetDistinctValues: function (array) { - array = array || []; - var result = []; - for (var i = 0, j = array.length; i < j; i++) { - if (ko.utils.arrayIndexOf(result, array[i]) < 0) - result.push(array[i]); - } - return result; - }, - - arrayMap: function (array, mapping) { - array = array || []; - var result = []; - for (var i = 0, j = array.length; i < j; i++) - result.push(mapping(array[i], i)); - return result; - }, - - arrayFilter: function (array, predicate) { - array = array || []; - var result = []; - for (var i = 0, j = array.length; i < j; i++) - if (predicate(array[i], i)) - result.push(array[i]); - return result; - }, - - arrayPushAll: function (array, valuesToPush) { - if (valuesToPush instanceof Array) - array.push.apply(array, valuesToPush); - else - for (var i = 0, j = valuesToPush.length; i < j; i++) - array.push(valuesToPush[i]); - return array; - }, - - addOrRemoveItem: function(array, value, included) { - var existingEntryIndex = ko.utils.arrayIndexOf(ko.utils.peekObservable(array), value); - if (existingEntryIndex < 0) { - if (included) - array.push(value); - } else { - if (!included) - array.splice(existingEntryIndex, 1); - } - }, - - canSetPrototype: canSetPrototype, - extend: extend, + function extend(target, source) { + if (source) { + for(var prop in source) { + if(hasOwnProperty.call(source, prop)) { + target[prop] = source[prop]; + } + } + } + return target; + } - setPrototypeOf: setPrototypeOf, + function setPrototypeOf(obj, proto) { + obj.__proto__ = proto; + return obj; + } - setPrototypeOfOrExtend: canSetPrototype ? setPrototypeOf : extend, + var canSetPrototype = ({ __proto__: [] } instanceof Array); + var canUseSymbols = !DEBUG && typeof Symbol === 'function'; + + // Represent the known event types in a compact way, then at runtime transform it into a hash with event name as key (for fast lookup) + var knownEvents = {}, knownEventTypesByEventName = {}; + var keyEventTypeName = (navigator && /Firefox\/2/i.test(navigator.userAgent)) ? 'KeyboardEvent' : 'UIEvents'; + knownEvents[keyEventTypeName] = ['keyup', 'keydown', 'keypress']; + knownEvents['MouseEvents'] = ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave']; + objectForEach(knownEvents, function(eventType, knownEventsForType) { + if (knownEventsForType.length) { + for (var i = 0, j = knownEventsForType.length; i < j; i++) + knownEventTypesByEventName[knownEventsForType[i]] = eventType; + } + }); + var eventsThatMustBeRegisteredUsingAttachEvent = { 'propertychange': true }; // Workaround for an IE9 issue - https://github.com/SteveSanderson/knockout/issues/406 + + // Detect IE versions for bug workarounds (uses IE conditionals, not UA string, for robustness) + // Note that, since IE 10 does not support conditional comments, the following logic only detects IE < 10. + // Currently this is by design, since IE 10+ behaves correctly when treated as a standard browser. + // If there is a future need to detect specific versions of IE10+, we will amend this. + var ieVersion = document && (function() { + var version = 3, div = document.createElement('div'), iElems = div.getElementsByTagName('i'); + + // Keep constructing conditional HTML blocks until we hit one that resolves to an empty fragment + while ( + div.innerHTML = '<!--[if gt IE ' + (++version) + ']><i></i><![endif]-->', + iElems[0] + ) {} + return version > 4 ? version : undefined; + }()); + var isIe6 = ieVersion === 6, + isIe7 = ieVersion === 7; + + function isClickOnCheckableElement(element, eventType) { + if ((ko.utils.tagNameLower(element) !== "input") || !element.type) return false; + if (eventType.toLowerCase() != "click") return false; + var inputType = element.type; + return (inputType == "checkbox") || (inputType == "radio"); + } - objectForEach: objectForEach, + // For details on the pattern for changing node classes + // see: https://github.com/knockout/knockout/issues/1597 + var cssClassNameRegex = /\S+/g; + + var jQueryEventAttachName; + + function toggleDomNodeCssClass(node, classNames, shouldHaveClass) { + var addOrRemoveFn; + if (classNames) { + if (typeof node.classList === 'object') { + addOrRemoveFn = node.classList[shouldHaveClass ? 'add' : 'remove']; + ko.utils.arrayForEach(classNames.match(cssClassNameRegex), function(className) { + addOrRemoveFn.call(node.classList, className); + }); + } else if (typeof node.className['baseVal'] === 'string') { + // SVG tag .classNames is an SVGAnimatedString instance + toggleObjectClassPropertyString(node.className, 'baseVal', classNames, shouldHaveClass); + } else { + // node.className ought to be a string. + toggleObjectClassPropertyString(node, 'className', classNames, shouldHaveClass); + } + } + } - objectMap: function(source, mapping) { - if (!source) - return source; - var target = {}; - for (var prop in source) { - if (source.hasOwnProperty(prop)) { - target[prop] = mapping(source[prop], prop, source); + function toggleObjectClassPropertyString(obj, prop, classNames, shouldHaveClass) { + // obj/prop is either a node/'className' or a SVGAnimatedString/'baseVal'. + var currentClassNames = obj[prop].match(cssClassNameRegex) || []; + ko.utils.arrayForEach(classNames.match(cssClassNameRegex), function(className) { + ko.utils.addOrRemoveItem(currentClassNames, className, shouldHaveClass); + }); + obj[prop] = currentClassNames.join(" "); } - } - return target; - }, - emptyDomNode: function (domNode) { - while (domNode.firstChild) { - ko.removeNode(domNode.firstChild); - } - }, + return { + fieldsIncludedWithJsonPost: ['authenticity_token', /^__RequestVerificationToken(_.*)?$/], - moveCleanedNodesToContainerElement: function(nodes) { - // Ensure it's a real array, as we're about to reparent the nodes and - // we don't want the underlying collection to change while we're doing that. - var nodesArray = ko.utils.makeArray(nodes); - var templateDocument = (nodesArray[0] && nodesArray[0].ownerDocument) || document; + arrayForEach: function (array, action, actionOwner) { + for (var i = 0, j = array.length; i < j; i++) { + action.call(actionOwner, array[i], i, array); + } + }, - var container = templateDocument.createElement('div'); - for (var i = 0, j = nodesArray.length; i < j; i++) { - container.appendChild(ko.cleanNode(nodesArray[i])); - } - return container; - }, + arrayIndexOf: typeof Array.prototype.indexOf == "function" + ? function (array, item) { + return Array.prototype.indexOf.call(array, item); + } + : function (array, item) { + for (var i = 0, j = array.length; i < j; i++) { + if (array[i] === item) + return i; + } + return -1; + }, - cloneNodes: function (nodesArray, shouldCleanNodes) { - for (var i = 0, j = nodesArray.length, newNodesArray = []; i < j; i++) { - var clonedNode = nodesArray[i].cloneNode(true); - newNodesArray.push(shouldCleanNodes ? ko.cleanNode(clonedNode) : clonedNode); - } - return newNodesArray; - }, - - setDomNodeChildren: function (domNode, childNodes) { - ko.utils.emptyDomNode(domNode); - if (childNodes) { - for (var i = 0, j = childNodes.length; i < j; i++) - domNode.appendChild(childNodes[i]); - } - }, - - replaceDomNodes: function (nodeToReplaceOrNodeArray, newNodesArray) { - var nodesToReplaceArray = nodeToReplaceOrNodeArray.nodeType ? [nodeToReplaceOrNodeArray] : nodeToReplaceOrNodeArray; - if (nodesToReplaceArray.length > 0) { - var insertionPoint = nodesToReplaceArray[0]; - var parent = insertionPoint.parentNode; - for (var i = 0, j = newNodesArray.length; i < j; i++) - parent.insertBefore(newNodesArray[i], insertionPoint); - for (var i = 0, j = nodesToReplaceArray.length; i < j; i++) { - ko.removeNode(nodesToReplaceArray[i]); - } - } - }, - - fixUpContinuousNodeArray: function(continuousNodeArray, parentNode) { - // Before acting on a set of nodes that were previously outputted by a template function, we have to reconcile - // them against what is in the DOM right now. It may be that some of the nodes have already been removed, or that - // new nodes might have been inserted in the middle, for example by a binding. Also, there may previously have been - // leading comment nodes (created by rewritten string-based templates) that have since been removed during binding. - // So, this function translates the old "map" output array into its best guess of the set of current DOM nodes. - // - // Rules: - // [A] Any leading nodes that have been removed should be ignored - // These most likely correspond to memoization nodes that were already removed during binding - // See https://github.com/knockout/knockout/pull/440 - // [B] Any trailing nodes that have been remove should be ignored - // This prevents the code here from adding unrelated nodes to the array while processing rule [C] - // See https://github.com/knockout/knockout/pull/1903 - // [C] We want to output a continuous series of nodes. So, ignore any nodes that have already been removed, - // and include any nodes that have been inserted among the previous collection - - if (continuousNodeArray.length) { - // The parent node can be a virtual element; so get the real parent node - parentNode = (parentNode.nodeType === 8 && parentNode.parentNode) || parentNode; - - // Rule [A] - while (continuousNodeArray.length && continuousNodeArray[0].parentNode !== parentNode) - continuousNodeArray.splice(0, 1); - - // Rule [B] - while (continuousNodeArray.length > 1 && continuousNodeArray[continuousNodeArray.length - 1].parentNode !== parentNode) - continuousNodeArray.length--; - - // Rule [C] - if (continuousNodeArray.length > 1) { - var current = continuousNodeArray[0], last = continuousNodeArray[continuousNodeArray.length - 1]; - // Replace with the actual new continuous node set - continuousNodeArray.length = 0; - while (current !== last) { - continuousNodeArray.push(current); - current = current.nextSibling; - } - continuousNodeArray.push(last); - } - } - return continuousNodeArray; - }, - - setOptionNodeSelectionState: function (optionNode, isSelected) { - // IE6 sometimes throws "unknown error" if you try to write to .selected directly, whereas Firefox struggles with setAttribute. Pick one based on browser. - if (ieVersion < 7) - optionNode.setAttribute("selected", isSelected); - else - optionNode.selected = isSelected; - }, - - stringTrim: function (string) { - return string === null || string === undefined ? '' : - string.trim ? - string.trim() : - string.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, ''); - }, - - stringStartsWith: function (string, startsWith) { - string = string || ""; - if (startsWith.length > string.length) - return false; - return string.substring(0, startsWith.length) === startsWith; - }, - - domNodeIsContainedBy: function (node, containedByNode) { - if (node === containedByNode) - return true; - if (node.nodeType === 11) - return false; // Fixes issue #1162 - can't use node.contains for document fragments on IE8 - if (containedByNode.contains) - return containedByNode.contains(node.nodeType === 3 ? node.parentNode : node); - if (containedByNode.compareDocumentPosition) - return (containedByNode.compareDocumentPosition(node) & 16) == 16; - while (node && node != containedByNode) { - node = node.parentNode; - } - return !!node; - }, - - domNodeIsAttachedToDocument: function (node) { - return ko.utils.domNodeIsContainedBy(node, node.ownerDocument.documentElement); - }, - - anyDomNodeIsAttachedToDocument: function(nodes) { - return !!ko.utils.arrayFirst(nodes, ko.utils.domNodeIsAttachedToDocument); - }, - - tagNameLower: function(element) { - // For HTML elements, tagName will always be upper case; for XHTML elements, it'll be lower case. - // Possible future optimization: If we know it's an element from an XHTML document (not HTML), - // we don't need to do the .toLowerCase() as it will always be lower case anyway. - return element && element.tagName && element.tagName.toLowerCase(); - }, - - catchFunctionErrors: function (delegate) { - return ko['onError'] ? function () { - try { - return delegate.apply(this, arguments); - } catch (e) { - ko['onError'] && ko['onError'](e); - throw e; - } - } : delegate; - }, - - setTimeout: function (handler, timeout) { - return setTimeout(ko.utils.catchFunctionErrors(handler), timeout); - }, - - deferError: function (error) { - setTimeout(function () { - ko['onError'] && ko['onError'](error); - throw error; - }, 0); - }, - - registerEventHandler: function (element, eventType, handler) { - var wrappedHandler = ko.utils.catchFunctionErrors(handler); - - var mustUseAttachEvent = ieVersion && eventsThatMustBeRegisteredUsingAttachEvent[eventType]; - if (!ko.options['useOnlyNativeEvents'] && !mustUseAttachEvent && jQueryInstance) { - jQueryInstance(element)['bind'](eventType, wrappedHandler); - } else if (!mustUseAttachEvent && typeof element.addEventListener == "function") - element.addEventListener(eventType, wrappedHandler, false); - else if (typeof element.attachEvent != "undefined") { - var attachEventHandler = function (event) { wrappedHandler.call(element, event); }, - attachEventName = "on" + eventType; - element.attachEvent(attachEventName, attachEventHandler); - - // IE does not dispose attachEvent handlers automatically (unlike with addEventListener) - // so to avoid leaks, we have to remove them manually. See bug #856 - ko.utils.domNodeDisposal.addDisposeCallback(element, function() { - element.detachEvent(attachEventName, attachEventHandler); - }); - } else - throw new Error("Browser doesn't support addEventListener or attachEvent"); - }, - - triggerEvent: function (element, eventType) { - if (!(element && element.nodeType)) - throw new Error("element must be a DOM node when calling triggerEvent"); - - // For click events on checkboxes and radio buttons, jQuery toggles the element checked state *after* the - // event handler runs instead of *before*. (This was fixed in 1.9 for checkboxes but not for radio buttons.) - // IE doesn't change the checked state when you trigger the click event using "fireEvent". - // In both cases, we'll use the click method instead. - var useClickWorkaround = isClickOnCheckableElement(element, eventType); - - if (!ko.options['useOnlyNativeEvents'] && jQueryInstance && !useClickWorkaround) { - jQueryInstance(element)['trigger'](eventType); - } else if (typeof document.createEvent == "function") { - if (typeof element.dispatchEvent == "function") { - var eventCategory = knownEventTypesByEventName[eventType] || "HTMLEvents"; - var event = document.createEvent(eventCategory); - event.initEvent(eventType, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, element); - element.dispatchEvent(event); - } - else - throw new Error("The supplied element doesn't support dispatchEvent"); - } else if (useClickWorkaround && element.click) { - element.click(); - } else if (typeof element.fireEvent != "undefined") { - element.fireEvent("on" + eventType); - } else { - throw new Error("Browser doesn't support triggering events"); - } - }, + arrayFirst: function (array, predicate, predicateOwner) { + for (var i = 0, j = array.length; i < j; i++) { + if (predicate.call(predicateOwner, array[i], i, array)) + return array[i]; + } + return undefined; + }, - unwrapObservable: function (value) { - return ko.isObservable(value) ? value() : value; - }, + arrayRemoveItem: function (array, itemToRemove) { + var index = ko.utils.arrayIndexOf(array, itemToRemove); + if (index > 0) { + array.splice(index, 1); + } + else if (index === 0) { + array.shift(); + } + }, + + arrayGetDistinctValues: function (array) { + var result = []; + if (array) { + ko.utils.arrayForEach(array, function(item) { + if (ko.utils.arrayIndexOf(result, item) < 0) + result.push(item); + }); + } + return result; + }, + + arrayMap: function (array, mapping, mappingOwner) { + var result = []; + if (array) { + for (var i = 0, j = array.length; i < j; i++) + result.push(mapping.call(mappingOwner, array[i], i)); + } + return result; + }, + + arrayFilter: function (array, predicate, predicateOwner) { + var result = []; + if (array) { + for (var i = 0, j = array.length; i < j; i++) + if (predicate.call(predicateOwner, array[i], i)) + result.push(array[i]); + } + return result; + }, + + arrayPushAll: function (array, valuesToPush) { + if (valuesToPush instanceof Array) + array.push.apply(array, valuesToPush); + else + for (var i = 0, j = valuesToPush.length; i < j; i++) + array.push(valuesToPush[i]); + return array; + }, + + addOrRemoveItem: function(array, value, included) { + var existingEntryIndex = ko.utils.arrayIndexOf(ko.utils.peekObservable(array), value); + if (existingEntryIndex < 0) { + if (included) + array.push(value); + } else { + if (!included) + array.splice(existingEntryIndex, 1); + } + }, - peekObservable: function (value) { - return ko.isObservable(value) ? value.peek() : value; - }, + canSetPrototype: canSetPrototype, - toggleDomNodeCssClass: toggleDomNodeCssClass, + extend: extend, - setTextContent: function(element, textContent) { - var value = ko.utils.unwrapObservable(textContent); - if ((value === null) || (value === undefined)) - value = ""; + setPrototypeOf: setPrototypeOf, - // We need there to be exactly one child: a text node. - // If there are no children, more than one, or if it's not a text node, - // we'll clear everything and create a single text node. - var innerTextNode = ko.virtualElements.firstChild(element); - if (!innerTextNode || innerTextNode.nodeType != 3 || ko.virtualElements.nextSibling(innerTextNode)) { - ko.virtualElements.setDomNodeChildren(element, [element.ownerDocument.createTextNode(value)]); - } else { - innerTextNode.data = value; - } + setPrototypeOfOrExtend: canSetPrototype ? setPrototypeOf : extend, - ko.utils.forceRefresh(element); - }, + objectForEach: objectForEach, - setElementName: function(element, name) { - element.name = name; - }, + objectMap: function(source, mapping, mappingOwner) { + if (!source) + return source; + var target = {}; + for (var prop in source) { + if (hasOwnProperty.call(source, prop)) { + target[prop] = mapping.call(mappingOwner, source[prop], prop, source); + } + } + return target; + }, - forceRefresh: function(node) { - // Workaround for an IE9 rendering bug - https://github.com/SteveSanderson/knockout/issues/209 - if (ieVersion >= 9) { - // For text nodes and comment nodes (most likely virtual elements), we will have to refresh the container - var elem = node.nodeType == 1 ? node : node.parentNode; - if (elem.style) - elem.style.zoom = elem.style.zoom; - } - }, - - ensureSelectElementIsRenderedCorrectly: function(selectElement) { - // Workaround for IE9 rendering bug - it doesn't reliably display all the text in dynamically-added select boxes unless you force it to re-render by updating the width. - // (See https://github.com/SteveSanderson/knockout/issues/312, http://stackoverflow.com/questions/5908494/select-only-shows-first-char-of-selected-option) - // Also fixes IE7 and IE8 bug that causes selects to be zero width if enclosed by 'if' or 'with'. (See issue #839) - if (ieVersion) { - var originalWidth = selectElement.style.width; - selectElement.style.width = 0; - selectElement.style.width = originalWidth; - } - }, - - range: function (min, max) { - min = ko.utils.unwrapObservable(min); - max = ko.utils.unwrapObservable(max); - var result = []; - for (var i = min; i <= max; i++) - result.push(i); - return result; - }, - - makeArray: function(arrayLikeObject) { - var result = []; - for (var i = 0, j = arrayLikeObject.length; i < j; i++) { - result.push(arrayLikeObject[i]); - }; - return result; - }, - - createSymbolOrString: function(identifier) { - return canUseSymbols ? Symbol(identifier) : identifier; - }, - - isIe6 : isIe6, - isIe7 : isIe7, - ieVersion : ieVersion, - - getFormFields: function(form, fieldName) { - var fields = ko.utils.makeArray(form.getElementsByTagName("input")).concat(ko.utils.makeArray(form.getElementsByTagName("textarea"))); - var isMatchingField = (typeof fieldName == 'string') - ? function(field) { return field.name === fieldName } - : function(field) { return fieldName.test(field.name) }; // Treat fieldName as regex or object containing predicate - var matches = []; - for (var i = fields.length - 1; i >= 0; i--) { - if (isMatchingField(fields[i])) - matches.push(fields[i]); - }; - return matches; - }, + emptyDomNode: function (domNode) { + while (domNode.firstChild) { + ko.removeNode(domNode.firstChild); + } + }, - parseJson: function (jsonString) { - if (typeof jsonString == "string") { - jsonString = ko.utils.stringTrim(jsonString); - if (jsonString) { - if (JSON && JSON.parse) // Use native parsing where available - return JSON.parse(jsonString); - return (new Function("return " + jsonString))(); // Fallback on less safe parsing for older browsers - } - } - return null; - }, - - stringifyJson: function (data, replacer, space) { // replacer and space are optional - if (!JSON || !JSON.stringify) - throw new Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"); - return JSON.stringify(ko.utils.unwrapObservable(data), replacer, space); - }, - - postJson: function (urlOrForm, data, options) { - options = options || {}; - var params = options['params'] || {}; - var includeFields = options['includeFields'] || this.fieldsIncludedWithJsonPost; - var url = urlOrForm; - - // If we were given a form, use its 'action' URL and pick out any requested field values - if((typeof urlOrForm == 'object') && (ko.utils.tagNameLower(urlOrForm) === "form")) { - var originalForm = urlOrForm; - url = originalForm.action; - for (var i = includeFields.length - 1; i >= 0; i--) { - var fields = ko.utils.getFormFields(originalForm, includeFields[i]); - for (var j = fields.length - 1; j >= 0; j--) - params[fields[j].name] = fields[j].value; - } - } + moveCleanedNodesToContainerElement: function(nodes) { + // Ensure it's a real array, as we're about to reparent the nodes and + // we don't want the underlying collection to change while we're doing that. + var nodesArray = ko.utils.makeArray(nodes); + var templateDocument = (nodesArray[0] && nodesArray[0].ownerDocument) || document; - data = ko.utils.unwrapObservable(data); - var form = document.createElement("form"); - form.style.display = "none"; - form.action = url; - form.method = "post"; - for (var key in data) { - // Since 'data' this is a model object, we include all properties including those inherited from its prototype - var input = document.createElement("input"); - input.type = "hidden"; - input.name = key; - input.value = ko.utils.stringifyJson(ko.utils.unwrapObservable(data[key])); - form.appendChild(input); - } - objectForEach(params, function(key, value) { - var input = document.createElement("input"); - input.type = "hidden"; - input.name = key; - input.value = value; - form.appendChild(input); - }); - document.body.appendChild(form); - options['submitter'] ? options['submitter'](form) : form.submit(); - setTimeout(function () { form.parentNode.removeChild(form); }, 0); - } - } -}()); - -ko.exportSymbol('utils', ko.utils); -ko.exportSymbol('utils.arrayForEach', ko.utils.arrayForEach); -ko.exportSymbol('utils.arrayFirst', ko.utils.arrayFirst); -ko.exportSymbol('utils.arrayFilter', ko.utils.arrayFilter); -ko.exportSymbol('utils.arrayGetDistinctValues', ko.utils.arrayGetDistinctValues); -ko.exportSymbol('utils.arrayIndexOf', ko.utils.arrayIndexOf); -ko.exportSymbol('utils.arrayMap', ko.utils.arrayMap); -ko.exportSymbol('utils.arrayPushAll', ko.utils.arrayPushAll); -ko.exportSymbol('utils.arrayRemoveItem', ko.utils.arrayRemoveItem); -ko.exportSymbol('utils.extend', ko.utils.extend); -ko.exportSymbol('utils.fieldsIncludedWithJsonPost', ko.utils.fieldsIncludedWithJsonPost); -ko.exportSymbol('utils.getFormFields', ko.utils.getFormFields); -ko.exportSymbol('utils.peekObservable', ko.utils.peekObservable); -ko.exportSymbol('utils.postJson', ko.utils.postJson); -ko.exportSymbol('utils.parseJson', ko.utils.parseJson); -ko.exportSymbol('utils.registerEventHandler', ko.utils.registerEventHandler); -ko.exportSymbol('utils.stringifyJson', ko.utils.stringifyJson); -ko.exportSymbol('utils.range', ko.utils.range); -ko.exportSymbol('utils.toggleDomNodeCssClass', ko.utils.toggleDomNodeCssClass); -ko.exportSymbol('utils.triggerEvent', ko.utils.triggerEvent); -ko.exportSymbol('utils.unwrapObservable', ko.utils.unwrapObservable); -ko.exportSymbol('utils.objectForEach', ko.utils.objectForEach); -ko.exportSymbol('utils.addOrRemoveItem', ko.utils.addOrRemoveItem); -ko.exportSymbol('utils.setTextContent', ko.utils.setTextContent); -ko.exportSymbol('unwrap', ko.utils.unwrapObservable); // Convenient shorthand, because this is used so commonly - -if (!Function.prototype['bind']) { - // Function.prototype.bind is a standard part of ECMAScript 5th Edition (December 2009, http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf) - // In case the browser doesn't implement it natively, provide a JavaScript implementation. This implementation is based on the one in prototype.js - Function.prototype['bind'] = function (object) { - var originalFunction = this; - if (arguments.length === 1) { - return function () { - return originalFunction.apply(object, arguments); - }; - } else { - var partialArgs = Array.prototype.slice.call(arguments, 1); - return function () { - var args = partialArgs.slice(0); - args.push.apply(args, arguments); - return originalFunction.apply(object, args); - }; - } - }; -} - -ko.utils.domData = new (function () { - var uniqueId = 0; - var dataStoreKeyExpandoPropertyName = "__ko__" + (new Date).getTime(); - var dataStore = {}; - - function getAll(node, createIfNotFound) { - var dataStoreKey = node[dataStoreKeyExpandoPropertyName]; - var hasExistingDataStore = dataStoreKey && (dataStoreKey !== "null") && dataStore[dataStoreKey]; - if (!hasExistingDataStore) { - if (!createIfNotFound) - return undefined; - dataStoreKey = node[dataStoreKeyExpandoPropertyName] = "ko" + uniqueId++; - dataStore[dataStoreKey] = {}; - } - return dataStore[dataStoreKey]; - } - - return { - get: function (node, key) { - var allDataForNode = getAll(node, false); - return allDataForNode === undefined ? undefined : allDataForNode[key]; - }, - set: function (node, key, value) { - if (value === undefined) { - // Make sure we don't actually create a new domData key if we are actually deleting a value - if (getAll(node, false) === undefined) - return; - } - var allDataForNode = getAll(node, true); - allDataForNode[key] = value; - }, - clear: function (node) { - var dataStoreKey = node[dataStoreKeyExpandoPropertyName]; - if (dataStoreKey) { - delete dataStore[dataStoreKey]; - node[dataStoreKeyExpandoPropertyName] = null; - return true; // Exposing "did clean" flag purely so specs can infer whether things have been cleaned up as intended - } - return false; - }, + var container = templateDocument.createElement('div'); + for (var i = 0, j = nodesArray.length; i < j; i++) { + container.appendChild(ko.cleanNode(nodesArray[i])); + } + return container; + }, - nextKey: function () { - return (uniqueId++) + dataStoreKeyExpandoPropertyName; - } - }; -})(); + cloneNodes: function (nodesArray, shouldCleanNodes) { + for (var i = 0, j = nodesArray.length, newNodesArray = []; i < j; i++) { + var clonedNode = nodesArray[i].cloneNode(true); + newNodesArray.push(shouldCleanNodes ? ko.cleanNode(clonedNode) : clonedNode); + } + return newNodesArray; + }, + + setDomNodeChildren: function (domNode, childNodes) { + ko.utils.emptyDomNode(domNode); + if (childNodes) { + for (var i = 0, j = childNodes.length; i < j; i++) + domNode.appendChild(childNodes[i]); + } + }, + + replaceDomNodes: function (nodeToReplaceOrNodeArray, newNodesArray) { + var nodesToReplaceArray = nodeToReplaceOrNodeArray.nodeType ? [nodeToReplaceOrNodeArray] : nodeToReplaceOrNodeArray; + if (nodesToReplaceArray.length > 0) { + var insertionPoint = nodesToReplaceArray[0]; + var parent = insertionPoint.parentNode; + for (var i = 0, j = newNodesArray.length; i < j; i++) + parent.insertBefore(newNodesArray[i], insertionPoint); + for (var i = 0, j = nodesToReplaceArray.length; i < j; i++) { + ko.removeNode(nodesToReplaceArray[i]); + } + } + }, + + fixUpContinuousNodeArray: function(continuousNodeArray, parentNode) { + // Before acting on a set of nodes that were previously outputted by a template function, we have to reconcile + // them against what is in the DOM right now. It may be that some of the nodes have already been removed, or that + // new nodes might have been inserted in the middle, for example by a binding. Also, there may previously have been + // leading comment nodes (created by rewritten string-based templates) that have since been removed during binding. + // So, this function translates the old "map" output array into its best guess of the set of current DOM nodes. + // + // Rules: + // [A] Any leading nodes that have been removed should be ignored + // These most likely correspond to memoization nodes that were already removed during binding + // See https://github.com/knockout/knockout/pull/440 + // [B] Any trailing nodes that have been remove should be ignored + // This prevents the code here from adding unrelated nodes to the array while processing rule [C] + // See https://github.com/knockout/knockout/pull/1903 + // [C] We want to output a continuous series of nodes. So, ignore any nodes that have already been removed, + // and include any nodes that have been inserted among the previous collection + + if (continuousNodeArray.length) { + // The parent node can be a virtual element; so get the real parent node + parentNode = (parentNode.nodeType === 8 && parentNode.parentNode) || parentNode; + + // Rule [A] + while (continuousNodeArray.length && continuousNodeArray[0].parentNode !== parentNode) + continuousNodeArray.splice(0, 1); + + // Rule [B] + while (continuousNodeArray.length > 1 && continuousNodeArray[continuousNodeArray.length - 1].parentNode !== parentNode) + continuousNodeArray.length--; + + // Rule [C] + if (continuousNodeArray.length > 1) { + var current = continuousNodeArray[0], last = continuousNodeArray[continuousNodeArray.length - 1]; + // Replace with the actual new continuous node set + continuousNodeArray.length = 0; + while (current !== last) { + continuousNodeArray.push(current); + current = current.nextSibling; + } + continuousNodeArray.push(last); + } + } + return continuousNodeArray; + }, + + setOptionNodeSelectionState: function (optionNode, isSelected) { + // IE6 sometimes throws "unknown error" if you try to write to .selected directly, whereas Firefox struggles with setAttribute. Pick one based on browser. + if (ieVersion < 7) + optionNode.setAttribute("selected", isSelected); + else + optionNode.selected = isSelected; + }, + + stringTrim: function (string) { + return string === null || string === undefined ? '' : + string.trim ? + string.trim() : + string.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, ''); + }, + + stringStartsWith: function (string, startsWith) { + string = string || ""; + if (startsWith.length > string.length) + return false; + return string.substring(0, startsWith.length) === startsWith; + }, + + domNodeIsContainedBy: function (node, containedByNode) { + if (node === containedByNode) + return true; + if (node.nodeType === 11) + return false; // Fixes issue #1162 - can't use node.contains for document fragments on IE8 + if (containedByNode.contains) + return containedByNode.contains(node.nodeType !== 1 ? node.parentNode : node); + if (containedByNode.compareDocumentPosition) + return (containedByNode.compareDocumentPosition(node) & 16) == 16; + while (node && node != containedByNode) { + node = node.parentNode; + } + return !!node; + }, + + domNodeIsAttachedToDocument: function (node) { + return ko.utils.domNodeIsContainedBy(node, node.ownerDocument.documentElement); + }, + + anyDomNodeIsAttachedToDocument: function(nodes) { + return !!ko.utils.arrayFirst(nodes, ko.utils.domNodeIsAttachedToDocument); + }, + + tagNameLower: function(element) { + // For HTML elements, tagName will always be upper case; for XHTML elements, it'll be lower case. + // Possible future optimization: If we know it's an element from an XHTML document (not HTML), + // we don't need to do the .toLowerCase() as it will always be lower case anyway. + return element && element.tagName && element.tagName.toLowerCase(); + }, + + catchFunctionErrors: function (delegate) { + return ko['onError'] ? function () { + try { + return delegate.apply(this, arguments); + } catch (e) { + ko['onError'] && ko['onError'](e); + throw e; + } + } : delegate; + }, + + setTimeout: function (handler, timeout) { + return setTimeout(ko.utils.catchFunctionErrors(handler), timeout); + }, + + deferError: function (error) { + setTimeout(function () { + ko['onError'] && ko['onError'](error); + throw error; + }, 0); + }, + + registerEventHandler: function (element, eventType, handler) { + var wrappedHandler = ko.utils.catchFunctionErrors(handler); + + var mustUseAttachEvent = eventsThatMustBeRegisteredUsingAttachEvent[eventType]; + if (!ko.options['useOnlyNativeEvents'] && !mustUseAttachEvent && jQueryInstance) { + if (!jQueryEventAttachName) { + jQueryEventAttachName = (typeof jQueryInstance(element)['on'] == 'function') ? 'on' : 'bind'; + } + jQueryInstance(element)[jQueryEventAttachName](eventType, wrappedHandler); + } else if (!mustUseAttachEvent && typeof element.addEventListener == "function") + element.addEventListener(eventType, wrappedHandler, false); + else if (typeof element.attachEvent != "undefined") { + var attachEventHandler = function (event) { wrappedHandler.call(element, event); }, + attachEventName = "on" + eventType; + element.attachEvent(attachEventName, attachEventHandler); + + // IE does not dispose attachEvent handlers automatically (unlike with addEventListener) + // so to avoid leaks, we have to remove them manually. See bug #856 + ko.utils.domNodeDisposal.addDisposeCallback(element, function() { + element.detachEvent(attachEventName, attachEventHandler); + }); + } else + throw new Error("Browser doesn't support addEventListener or attachEvent"); + }, + + triggerEvent: function (element, eventType) { + if (!(element && element.nodeType)) + throw new Error("element must be a DOM node when calling triggerEvent"); + + // For click events on checkboxes and radio buttons, jQuery toggles the element checked state *after* the + // event handler runs instead of *before*. (This was fixed in 1.9 for checkboxes but not for radio buttons.) + // IE doesn't change the checked state when you trigger the click event using "fireEvent". + // In both cases, we'll use the click method instead. + var useClickWorkaround = isClickOnCheckableElement(element, eventType); + + if (!ko.options['useOnlyNativeEvents'] && jQueryInstance && !useClickWorkaround) { + jQueryInstance(element)['trigger'](eventType); + } else if (typeof document.createEvent == "function") { + if (typeof element.dispatchEvent == "function") { + var eventCategory = knownEventTypesByEventName[eventType] || "HTMLEvents"; + var event = document.createEvent(eventCategory); + event.initEvent(eventType, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, element); + element.dispatchEvent(event); + } + else + throw new Error("The supplied element doesn't support dispatchEvent"); + } else if (useClickWorkaround && element.click) { + element.click(); + } else if (typeof element.fireEvent != "undefined") { + element.fireEvent("on" + eventType); + } else { + throw new Error("Browser doesn't support triggering events"); + } + }, -ko.exportSymbol('utils.domData', ko.utils.domData); -ko.exportSymbol('utils.domData.clear', ko.utils.domData.clear); // Exporting only so specs can clear up after themselves fully + unwrapObservable: function (value) { + return ko.isObservable(value) ? value() : value; + }, -ko.utils.domNodeDisposal = new (function () { - var domDataKey = ko.utils.domData.nextKey(); - var cleanableNodeTypes = { 1: true, 8: true, 9: true }; // Element, Comment, Document - var cleanableNodeTypesWithDescendants = { 1: true, 9: true }; // Element, Document + peekObservable: function (value) { + return ko.isObservable(value) ? value.peek() : value; + }, - function getDisposeCallbacksCollection(node, createIfNotFound) { - var allDisposeCallbacks = ko.utils.domData.get(node, domDataKey); - if ((allDisposeCallbacks === undefined) && createIfNotFound) { - allDisposeCallbacks = []; - ko.utils.domData.set(node, domDataKey, allDisposeCallbacks); - } - return allDisposeCallbacks; - } - function destroyCallbacksCollection(node) { - ko.utils.domData.set(node, domDataKey, undefined); - } - - function cleanSingleNode(node) { - // Run all the dispose callbacks - var callbacks = getDisposeCallbacksCollection(node, false); - if (callbacks) { - callbacks = callbacks.slice(0); // Clone, as the array may be modified during iteration (typically, callbacks will remove themselves) - for (var i = 0; i < callbacks.length; i++) - callbacks[i](node); - } + toggleDomNodeCssClass: toggleDomNodeCssClass, - // Erase the DOM data - ko.utils.domData.clear(node); + setTextContent: function(element, textContent) { + var value = ko.utils.unwrapObservable(textContent); + if ((value === null) || (value === undefined)) + value = ""; - // Perform cleanup needed by external libraries (currently only jQuery, but can be extended) - ko.utils.domNodeDisposal["cleanExternalData"](node); + // We need there to be exactly one child: a text node. + // If there are no children, more than one, or if it's not a text node, + // we'll clear everything and create a single text node. + var innerTextNode = ko.virtualElements.firstChild(element); + if (!innerTextNode || innerTextNode.nodeType != 3 || ko.virtualElements.nextSibling(innerTextNode)) { + ko.virtualElements.setDomNodeChildren(element, [element.ownerDocument.createTextNode(value)]); + } else { + innerTextNode.data = value; + } - // Clear any immediate-child comment nodes, as these wouldn't have been found by - // node.getElementsByTagName("*") in cleanNode() (comment nodes aren't elements) - if (cleanableNodeTypesWithDescendants[node.nodeType]) - cleanImmediateCommentTypeChildren(node); - } + ko.utils.forceRefresh(element); + }, - function cleanImmediateCommentTypeChildren(nodeWithChildren) { - var child, nextChild = nodeWithChildren.firstChild; - while (child = nextChild) { - nextChild = child.nextSibling; - if (child.nodeType === 8) - cleanSingleNode(child); - } - } - - return { - addDisposeCallback : function(node, callback) { - if (typeof callback != "function") - throw new Error("Callback must be a function"); - getDisposeCallbacksCollection(node, true).push(callback); - }, - - removeDisposeCallback : function(node, callback) { - var callbacksCollection = getDisposeCallbacksCollection(node, false); - if (callbacksCollection) { - ko.utils.arrayRemoveItem(callbacksCollection, callback); - if (callbacksCollection.length == 0) - destroyCallbacksCollection(node); - } - }, + setElementName: function(element, name) { + element.name = name; - cleanNode : function(node) { - // First clean this node, where applicable - if (cleanableNodeTypes[node.nodeType]) { - cleanSingleNode(node); + // Workaround IE 6/7 issue + // - https://github.com/SteveSanderson/knockout/issues/197 + // - http://www.matts411.com/post/setting_the_name_attribute_in_ie_dom/ + if (ieVersion <= 7) { + try { + var escapedName = element.name.replace(/[&<>'"]/g, function(r){ return "&#" + r.charCodeAt(0) + ";"; }); + element.mergeAttributes(document.createElement("<input name='" + escapedName + "'/>"), false); + } + catch(e) {} // For IE9 with doc mode "IE9 Standards" and browser mode "IE9 Compatibility View" + } + }, + + forceRefresh: function(node) { + // Workaround for an IE9 rendering bug - https://github.com/SteveSanderson/knockout/issues/209 + if (ieVersion >= 9) { + // For text nodes and comment nodes (most likely virtual elements), we will have to refresh the container + var elem = node.nodeType == 1 ? node : node.parentNode; + if (elem.style) + elem.style.zoom = elem.style.zoom; + } + }, + + ensureSelectElementIsRenderedCorrectly: function(selectElement) { + // Workaround for IE9 rendering bug - it doesn't reliably display all the text in dynamically-added select boxes unless you force it to re-render by updating the width. + // (See https://github.com/SteveSanderson/knockout/issues/312, http://stackoverflow.com/questions/5908494/select-only-shows-first-char-of-selected-option) + // Also fixes IE7 and IE8 bug that causes selects to be zero width if enclosed by 'if' or 'with'. (See issue #839) + if (ieVersion) { + var originalWidth = selectElement.style.width; + selectElement.style.width = 0; + selectElement.style.width = originalWidth; + } + }, + + range: function (min, max) { + min = ko.utils.unwrapObservable(min); + max = ko.utils.unwrapObservable(max); + var result = []; + for (var i = min; i <= max; i++) + result.push(i); + return result; + }, + + makeArray: function(arrayLikeObject) { + var result = []; + for (var i = 0, j = arrayLikeObject.length; i < j; i++) { + result.push(arrayLikeObject[i]); + }; + return result; + }, + + createSymbolOrString: function(identifier) { + return canUseSymbols ? Symbol(identifier) : identifier; + }, + + isIe6 : isIe6, + isIe7 : isIe7, + ieVersion : ieVersion, + + getFormFields: function(form, fieldName) { + var fields = ko.utils.makeArray(form.getElementsByTagName("input")).concat(ko.utils.makeArray(form.getElementsByTagName("textarea"))); + var isMatchingField = (typeof fieldName == 'string') + ? function(field) { return field.name === fieldName } + : function(field) { return fieldName.test(field.name) }; // Treat fieldName as regex or object containing predicate + var matches = []; + for (var i = fields.length - 1; i >= 0; i--) { + if (isMatchingField(fields[i])) + matches.push(fields[i]); + }; + return matches; + }, + + parseJson: function (jsonString) { + if (typeof jsonString == "string") { + jsonString = ko.utils.stringTrim(jsonString); + if (jsonString) { + if (JSON && JSON.parse) // Use native parsing where available + return JSON.parse(jsonString); + return (new Function("return " + jsonString))(); // Fallback on less safe parsing for older browsers + } + } + return null; + }, + + stringifyJson: function (data, replacer, space) { // replacer and space are optional + if (!JSON || !JSON.stringify) + throw new Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"); + return JSON.stringify(ko.utils.unwrapObservable(data), replacer, space); + }, + + postJson: function (urlOrForm, data, options) { + options = options || {}; + var params = options['params'] || {}; + var includeFields = options['includeFields'] || this.fieldsIncludedWithJsonPost; + var url = urlOrForm; + + // If we were given a form, use its 'action' URL and pick out any requested field values + if((typeof urlOrForm == 'object') && (ko.utils.tagNameLower(urlOrForm) === "form")) { + var originalForm = urlOrForm; + url = originalForm.action; + for (var i = includeFields.length - 1; i >= 0; i--) { + var fields = ko.utils.getFormFields(originalForm, includeFields[i]); + for (var j = fields.length - 1; j >= 0; j--) + params[fields[j].name] = fields[j].value; + } + } - // ... then its descendants, where applicable - if (cleanableNodeTypesWithDescendants[node.nodeType]) { - // Clone the descendants list in case it changes during iteration - var descendants = []; - ko.utils.arrayPushAll(descendants, node.getElementsByTagName("*")); - for (var i = 0, j = descendants.length; i < j; i++) - cleanSingleNode(descendants[i]); + data = ko.utils.unwrapObservable(data); + var form = document.createElement("form"); + form.style.display = "none"; + form.action = url; + form.method = "post"; + for (var key in data) { + // Since 'data' this is a model object, we include all properties including those inherited from its prototype + var input = document.createElement("input"); + input.type = "hidden"; + input.name = key; + input.value = ko.utils.stringifyJson(ko.utils.unwrapObservable(data[key])); + form.appendChild(input); + } + objectForEach(params, function(key, value) { + var input = document.createElement("input"); + input.type = "hidden"; + input.name = key; + input.value = value; + form.appendChild(input); + }); + document.body.appendChild(form); + options['submitter'] ? options['submitter'](form) : form.submit(); + setTimeout(function () { form.parentNode.removeChild(form); }, 0); + } } + }()); + + ko.exportSymbol('utils', ko.utils); + ko.exportSymbol('utils.arrayForEach', ko.utils.arrayForEach); + ko.exportSymbol('utils.arrayFirst', ko.utils.arrayFirst); + ko.exportSymbol('utils.arrayFilter', ko.utils.arrayFilter); + ko.exportSymbol('utils.arrayGetDistinctValues', ko.utils.arrayGetDistinctValues); + ko.exportSymbol('utils.arrayIndexOf', ko.utils.arrayIndexOf); + ko.exportSymbol('utils.arrayMap', ko.utils.arrayMap); + ko.exportSymbol('utils.arrayPushAll', ko.utils.arrayPushAll); + ko.exportSymbol('utils.arrayRemoveItem', ko.utils.arrayRemoveItem); + ko.exportSymbol('utils.cloneNodes', ko.utils.cloneNodes); + ko.exportSymbol('utils.createSymbolOrString', ko.utils.createSymbolOrString); + ko.exportSymbol('utils.extend', ko.utils.extend); + ko.exportSymbol('utils.fieldsIncludedWithJsonPost', ko.utils.fieldsIncludedWithJsonPost); + ko.exportSymbol('utils.getFormFields', ko.utils.getFormFields); + ko.exportSymbol('utils.objectMap', ko.utils.objectMap); + ko.exportSymbol('utils.peekObservable', ko.utils.peekObservable); + ko.exportSymbol('utils.postJson', ko.utils.postJson); + ko.exportSymbol('utils.parseJson', ko.utils.parseJson); + ko.exportSymbol('utils.registerEventHandler', ko.utils.registerEventHandler); + ko.exportSymbol('utils.stringifyJson', ko.utils.stringifyJson); + ko.exportSymbol('utils.range', ko.utils.range); + ko.exportSymbol('utils.toggleDomNodeCssClass', ko.utils.toggleDomNodeCssClass); + ko.exportSymbol('utils.triggerEvent', ko.utils.triggerEvent); + ko.exportSymbol('utils.unwrapObservable', ko.utils.unwrapObservable); + ko.exportSymbol('utils.objectForEach', ko.utils.objectForEach); + ko.exportSymbol('utils.addOrRemoveItem', ko.utils.addOrRemoveItem); + ko.exportSymbol('utils.setTextContent', ko.utils.setTextContent); + ko.exportSymbol('unwrap', ko.utils.unwrapObservable); // Convenient shorthand, because this is used so commonly + + if (!Function.prototype['bind']) { + // Function.prototype.bind is a standard part of ECMAScript 5th Edition (December 2009, http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf) + // In case the browser doesn't implement it natively, provide a JavaScript implementation. This implementation is based on the one in prototype.js + Function.prototype['bind'] = function (object) { + var originalFunction = this; + if (arguments.length === 1) { + return function () { + return originalFunction.apply(object, arguments); + }; + } else { + var partialArgs = Array.prototype.slice.call(arguments, 1); + return function () { + var args = partialArgs.slice(0); + args.push.apply(args, arguments); + return originalFunction.apply(object, args); + }; + } + }; } - return node; - }, - - removeNode : function(node) { - ko.cleanNode(node); - if (node.parentNode) - node.parentNode.removeChild(node); - }, - - "cleanExternalData" : function (node) { - // Special support for jQuery here because it's so commonly used. - // Many jQuery plugins (including jquery.tmpl) store data using jQuery's equivalent of domData - // so notify it to tear down any resources associated with the node & descendants here. - if (jQueryInstance && (typeof jQueryInstance['cleanData'] == "function")) - jQueryInstance['cleanData']([node]); - } - }; -})(); -ko.cleanNode = ko.utils.domNodeDisposal.cleanNode; // Shorthand name for convenience -ko.removeNode = ko.utils.domNodeDisposal.removeNode; // Shorthand name for convenience -ko.exportSymbol('cleanNode', ko.cleanNode); -ko.exportSymbol('removeNode', ko.removeNode); -ko.exportSymbol('utils.domNodeDisposal', ko.utils.domNodeDisposal); -ko.exportSymbol('utils.domNodeDisposal.addDisposeCallback', ko.utils.domNodeDisposal.addDisposeCallback); -ko.exportSymbol('utils.domNodeDisposal.removeDisposeCallback', ko.utils.domNodeDisposal.removeDisposeCallback); -(function () { - var none = [0, "", ""], - table = [1, "<table>", "</table>"], - tbody = [2, "<table><tbody>", "</tbody></table>"], - tr = [3, "<table><tbody><tr>", "</tr></tbody></table>"], - select = [1, "<select multiple='multiple'>", "</select>"], - lookup = { - 'thead': table, - 'tbody': table, - 'tfoot': table, - 'tr': tbody, - 'td': tr, - 'th': tr, - 'option': select, - 'optgroup': select - }, - - // This is needed for old IE if you're *not* using either jQuery or innerShiv. Doesn't affect other cases. - mayRequireCreateElementHack = ko.utils.ieVersion <= 8; - - function getWrap(tags) { - var m = tags.match(/^<([a-z]+)[ >]/); - return (m && lookup[m[1]]) || none; - } - - function simpleHtmlParse(html, documentContext) { - documentContext || (documentContext = document); - var windowContext = documentContext['parentWindow'] || documentContext['defaultView'] || window; - - // Based on jQuery's "clean" function, but only accounting for table-related elements. - // If you have referenced jQuery, this won't be used anyway - KO will use jQuery's "clean" function directly - - // Note that there's still an issue in IE < 9 whereby it will discard comment nodes that are the first child of - // a descendant node. For example: "<div><!-- mycomment -->abc</div>" will get parsed as "<div>abc</div>" - // This won't affect anyone who has referenced jQuery, and there's always the workaround of inserting a dummy node - // (possibly a text node) in front of the comment. So, KO does not attempt to workaround this IE issue automatically at present. - - // Trim whitespace, otherwise indexOf won't work as expected - var tags = ko.utils.stringTrim(html).toLowerCase(), div = documentContext.createElement("div"), - wrap = getWrap(tags), - depth = wrap[0]; - - // Go to html and back, then peel off extra wrappers - // Note that we always prefix with some dummy text, because otherwise, IE<9 will strip out leading comment nodes in descendants. Total madness. - var markup = "ignored<div>" + wrap[1] + html + wrap[2] + "</div>"; - if (typeof windowContext['innerShiv'] == "function") { - // Note that innerShiv is deprecated in favour of html5shiv. We should consider adding - // support for html5shiv (except if no explicit support is needed, e.g., if html5shiv - // somehow shims the native APIs so it just works anyway) - div.appendChild(windowContext['innerShiv'](markup)); - } else { - if (mayRequireCreateElementHack) { - // The document.createElement('my-element') trick to enable custom elements in IE6-8 - // only works if we assign innerHTML on an element associated with that document. - documentContext.appendChild(div); - } - - div.innerHTML = markup; - - if (mayRequireCreateElementHack) { - div.parentNode.removeChild(div); - } - } - // Move to the right depth - while (depth--) - div = div.lastChild; - - return ko.utils.makeArray(div.lastChild.childNodes); - } - - function jQueryHtmlParse(html, documentContext) { - // jQuery's "parseHTML" function was introduced in jQuery 1.8.0 and is a documented public API. - if (jQueryInstance['parseHTML']) { - return jQueryInstance['parseHTML'](html, documentContext) || []; // Ensure we always return an array and never null - } else { - // For jQuery < 1.8.0, we fall back on the undocumented internal "clean" function. - var elems = jQueryInstance['clean']([html], documentContext); - - // As of jQuery 1.7.1, jQuery parses the HTML by appending it to some dummy parent nodes held in an in-memory document fragment. - // Unfortunately, it never clears the dummy parent nodes from the document fragment, so it leaks memory over time. - // Fix this by finding the top-most dummy parent element, and detaching it from its owner fragment. - if (elems && elems[0]) { - // Find the top-most parent element that's a direct child of a document fragment - var elem = elems[0]; - while (elem.parentNode && elem.parentNode.nodeType !== 11 /* i.e., DocumentFragment */) - elem = elem.parentNode; - // ... then detach it - if (elem.parentNode) - elem.parentNode.removeChild(elem); - } + ko.utils.domData = new (function () { + var uniqueId = 0; + var dataStoreKeyExpandoPropertyName = "__ko__" + (new Date).getTime(); + var dataStore = {}; + + var getDataForNode, clear; + if (!ko.utils.ieVersion) { + // We considered using WeakMap, but it has a problem in IE 11 and Edge that prevents using + // it cross-window, so instead we just store the data directly on the node. + // See https://github.com/knockout/knockout/issues/2141 + getDataForNode = function (node, createIfNotFound) { + var dataForNode = node[dataStoreKeyExpandoPropertyName]; + if (!dataForNode && createIfNotFound) { + dataForNode = node[dataStoreKeyExpandoPropertyName] = {}; + } + return dataForNode; + }; + clear = function (node) { + if (node[dataStoreKeyExpandoPropertyName]) { + delete node[dataStoreKeyExpandoPropertyName]; + return true; // Exposing "did clean" flag purely so specs can infer whether things have been cleaned up as intended + } + return false; + }; + } else { + // Old IE versions have memory issues if you store objects on the node, so we use a + // separate data storage and link to it from the node using a string key. + getDataForNode = function (node, createIfNotFound) { + var dataStoreKey = node[dataStoreKeyExpandoPropertyName]; + var hasExistingDataStore = dataStoreKey && (dataStoreKey !== "null") && dataStore[dataStoreKey]; + if (!hasExistingDataStore) { + if (!createIfNotFound) + return undefined; + dataStoreKey = node[dataStoreKeyExpandoPropertyName] = "ko" + uniqueId++; + dataStore[dataStoreKey] = {}; + } + return dataStore[dataStoreKey]; + }; + clear = function (node) { + var dataStoreKey = node[dataStoreKeyExpandoPropertyName]; + if (dataStoreKey) { + delete dataStore[dataStoreKey]; + node[dataStoreKeyExpandoPropertyName] = null; + return true; // Exposing "did clean" flag purely so specs can infer whether things have been cleaned up as intended + } + return false; + }; + } - return elems; - } - } + return { + get: function (node, key) { + var dataForNode = getDataForNode(node, false); + return dataForNode && dataForNode[key]; + }, + set: function (node, key, value) { + // Make sure we don't actually create a new domData key if we are actually deleting a value + var dataForNode = getDataForNode(node, value !== undefined /* createIfNotFound */); + dataForNode && (dataForNode[key] = value); + }, + getOrSet: function (node, key, value) { + var dataForNode = getDataForNode(node, true /* createIfNotFound */); + return dataForNode[key] || (dataForNode[key] = value); + }, + clear: clear, + + nextKey: function () { + return (uniqueId++) + dataStoreKeyExpandoPropertyName; + } + }; + })(); - ko.utils.parseHtmlFragment = function(html, documentContext) { - return jQueryInstance ? - jQueryHtmlParse(html, documentContext) : // As below, benefit from jQuery's optimisations where possible - simpleHtmlParse(html, documentContext); // ... otherwise, this simple logic will do in most common cases. - }; + ko.exportSymbol('utils.domData', ko.utils.domData); + ko.exportSymbol('utils.domData.clear', ko.utils.domData.clear); // Exporting only so specs can clear up after themselves fully - ko.utils.setHtml = function(node, html) { - ko.utils.emptyDomNode(node); + ko.utils.domNodeDisposal = new (function () { + var domDataKey = ko.utils.domData.nextKey(); + var cleanableNodeTypes = { 1: true, 8: true, 9: true }; // Element, Comment, Document + var cleanableNodeTypesWithDescendants = { 1: true, 9: true }; // Element, Document - // There's no legitimate reason to display a stringified observable without unwrapping it, so we'll unwrap it - html = ko.utils.unwrapObservable(html); + function getDisposeCallbacksCollection(node, createIfNotFound) { + var allDisposeCallbacks = ko.utils.domData.get(node, domDataKey); + if ((allDisposeCallbacks === undefined) && createIfNotFound) { + allDisposeCallbacks = []; + ko.utils.domData.set(node, domDataKey, allDisposeCallbacks); + } + return allDisposeCallbacks; + } + function destroyCallbacksCollection(node) { + ko.utils.domData.set(node, domDataKey, undefined); + } - if ((html !== null) && (html !== undefined)) { - if (typeof html != 'string') - html = html.toString(); + function cleanSingleNode(node) { + // Run all the dispose callbacks + var callbacks = getDisposeCallbacksCollection(node, false); + if (callbacks) { + callbacks = callbacks.slice(0); // Clone, as the array may be modified during iteration (typically, callbacks will remove themselves) + for (var i = 0; i < callbacks.length; i++) + callbacks[i](node); + } - // jQuery contains a lot of sophisticated code to parse arbitrary HTML fragments, - // for example <tr> elements which are not normally allowed to exist on their own. - // If you've referenced jQuery we'll use that rather than duplicating its code. - if (jQueryInstance) { - jQueryInstance(node)['html'](html); - } else { - // ... otherwise, use KO's own parsing logic. - var parsedNodes = ko.utils.parseHtmlFragment(html, node.ownerDocument); - for (var i = 0; i < parsedNodes.length; i++) - node.appendChild(parsedNodes[i]); - } - } - }; -})(); + // Erase the DOM data + ko.utils.domData.clear(node); -ko.exportSymbol('utils.parseHtmlFragment', ko.utils.parseHtmlFragment); -ko.exportSymbol('utils.setHtml', ko.utils.setHtml); - -ko.memoization = (function () { - var memos = {}; - - function randomMax8HexChars() { - return (((1 + Math.random()) * 0x100000000) | 0).toString(16).substring(1); - } - function generateRandomId() { - return randomMax8HexChars() + randomMax8HexChars(); - } - function findMemoNodes(rootNode, appendToArray) { - if (!rootNode) - return; - if (rootNode.nodeType == 8) { - var memoId = ko.memoization.parseMemoText(rootNode.nodeValue); - if (memoId != null) - appendToArray.push({ domNode: rootNode, memoId: memoId }); - } else if (rootNode.nodeType == 1) { - for (var i = 0, childNodes = rootNode.childNodes, j = childNodes.length; i < j; i++) - findMemoNodes(childNodes[i], appendToArray); - } - } - - return { - memoize: function (callback) { - if (typeof callback != "function") - throw new Error("You can only pass a function to ko.memoization.memoize()"); - var memoId = generateRandomId(); - memos[memoId] = callback; - return "<!--[ko_memo:" + memoId + "]-->"; - }, - - unmemoize: function (memoId, callbackParams) { - var callback = memos[memoId]; - if (callback === undefined) - throw new Error("Couldn't find any memo with ID " + memoId + ". Perhaps it's already been unmemoized."); - try { - callback.apply(null, callbackParams || []); - return true; - } - finally { delete memos[memoId]; } - }, - - unmemoizeDomNodeAndDescendants: function (domNode, extraCallbackParamsArray) { - var memos = []; - findMemoNodes(domNode, memos); - for (var i = 0, j = memos.length; i < j; i++) { - var node = memos[i].domNode; - var combinedParams = [node]; - if (extraCallbackParamsArray) - ko.utils.arrayPushAll(combinedParams, extraCallbackParamsArray); - ko.memoization.unmemoize(memos[i].memoId, combinedParams); - node.nodeValue = ""; // Neuter this node so we don't try to unmemoize it again - if (node.parentNode) - node.parentNode.removeChild(node); // If possible, erase it totally (not always possible - someone else might just hold a reference to it then call unmemoizeDomNodeAndDescendants again) - } - }, + // Perform cleanup needed by external libraries (currently only jQuery, but can be extended) + ko.utils.domNodeDisposal["cleanExternalData"](node); - parseMemoText: function (memoText) { - var match = memoText.match(/^\[ko_memo\:(.*?)\]$/); - return match ? match[1] : null; - } - }; -})(); + // Clear any immediate-child comment nodes, as these wouldn't have been found by + // node.getElementsByTagName("*") in cleanNode() (comment nodes aren't elements) + if (cleanableNodeTypesWithDescendants[node.nodeType]) { + cleanNodesInList(node.childNodes, true/*onlyComments*/); + } + } -ko.exportSymbol('memoization', ko.memoization); -ko.exportSymbol('memoization.memoize', ko.memoization.memoize); -ko.exportSymbol('memoization.unmemoize', ko.memoization.unmemoize); -ko.exportSymbol('memoization.parseMemoText', ko.memoization.parseMemoText); -ko.exportSymbol('memoization.unmemoizeDomNodeAndDescendants', ko.memoization.unmemoizeDomNodeAndDescendants); -ko.tasks = (function () { - var scheduler, - taskQueue = [], - taskQueueLength = 0, - nextHandle = 1, - nextIndexToProcess = 0; - - if (window['MutationObserver']) { - // Chrome 27+, Firefox 14+, IE 11+, Opera 15+, Safari 6.1+ - // From https://github.com/petkaantonov/bluebird * Copyright (c) 2014 Petka Antonov * License: MIT - scheduler = (function (callback) { - var div = document.createElement("div"); - new MutationObserver(callback).observe(div, {attributes: true}); - return function () { div.classList.toggle("foo"); }; - })(scheduledProcess); - } else if (document && "onreadystatechange" in document.createElement("script")) { - // IE 6-10 - // From https://github.com/YuzuJS/setImmediate * Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic Denicola * License: MIT - scheduler = function (callback) { - var script = document.createElement("script"); - script.onreadystatechange = function () { - script.onreadystatechange = null; - document.documentElement.removeChild(script); - script = null; - callback(); - }; - document.documentElement.appendChild(script); - }; - } else { - scheduler = function (callback) { - setTimeout(callback, 0); - }; - } - - function processTasks() { - if (taskQueueLength) { - // Each mark represents the end of a logical group of tasks and the number of these groups is - // limited to prevent unchecked recursion. - var mark = taskQueueLength, countMarks = 0; - - // nextIndexToProcess keeps track of where we are in the queue; processTasks can be called recursively without issue - for (var task; nextIndexToProcess < taskQueueLength; ) { - if (task = taskQueue[nextIndexToProcess++]) { - if (nextIndexToProcess > mark) { - if (++countMarks >= 5000) { - nextIndexToProcess = taskQueueLength; // skip all tasks remaining in the queue since any of them could be causing the recursion - ko.utils.deferError(Error("'Too much recursion' after processing " + countMarks + " task groups.")); - break; + function cleanNodesInList(nodeList, onlyComments) { + var cleanedNodes = [], lastCleanedNode; + for (var i = 0; i < nodeList.length; i++) { + if (!onlyComments || nodeList[i].nodeType === 8) { + cleanSingleNode(cleanedNodes[cleanedNodes.length] = lastCleanedNode = nodeList[i]); + if (nodeList[i] !== lastCleanedNode) { + while (i-- && ko.utils.arrayIndexOf(cleanedNodes, nodeList[i]) == -1) {} + } } - mark = taskQueueLength; - } - try { - task(); - } catch (ex) { - ko.utils.deferError(ex); } } - } - } - } - function scheduledProcess() { - processTasks(); - - // Reset the queue - nextIndexToProcess = taskQueueLength = taskQueue.length = 0; - } + return { + addDisposeCallback : function(node, callback) { + if (typeof callback != "function") + throw new Error("Callback must be a function"); + getDisposeCallbacksCollection(node, true).push(callback); + }, + + removeDisposeCallback : function(node, callback) { + var callbacksCollection = getDisposeCallbacksCollection(node, false); + if (callbacksCollection) { + ko.utils.arrayRemoveItem(callbacksCollection, callback); + if (callbacksCollection.length == 0) + destroyCallbacksCollection(node); + } + }, - function scheduleTaskProcessing() { - ko.tasks['scheduler'](scheduledProcess); - } + cleanNode : function(node) { + ko.dependencyDetection.ignore(function () { + // First clean this node, where applicable + if (cleanableNodeTypes[node.nodeType]) { + cleanSingleNode(node); - var tasks = { - 'scheduler': scheduler, // Allow overriding the scheduler + // ... then its descendants, where applicable + if (cleanableNodeTypesWithDescendants[node.nodeType]) { + cleanNodesInList(node.getElementsByTagName("*")); + } + } + }); - schedule: function (func) { - if (!taskQueueLength) { - scheduleTaskProcessing(); - } + return node; + }, + + removeNode : function(node) { + ko.cleanNode(node); + if (node.parentNode) + node.parentNode.removeChild(node); + }, + + "cleanExternalData" : function (node) { + // Special support for jQuery here because it's so commonly used. + // Many jQuery plugins (including jquery.tmpl) store data using jQuery's equivalent of domData + // so notify it to tear down any resources associated with the node & descendants here. + if (jQueryInstance && (typeof jQueryInstance['cleanData'] == "function")) + jQueryInstance['cleanData']([node]); + } + }; + })(); + ko.cleanNode = ko.utils.domNodeDisposal.cleanNode; // Shorthand name for convenience + ko.removeNode = ko.utils.domNodeDisposal.removeNode; // Shorthand name for convenience + ko.exportSymbol('cleanNode', ko.cleanNode); + ko.exportSymbol('removeNode', ko.removeNode); + ko.exportSymbol('utils.domNodeDisposal', ko.utils.domNodeDisposal); + ko.exportSymbol('utils.domNodeDisposal.addDisposeCallback', ko.utils.domNodeDisposal.addDisposeCallback); + ko.exportSymbol('utils.domNodeDisposal.removeDisposeCallback', ko.utils.domNodeDisposal.removeDisposeCallback); + (function () { + var none = [0, "", ""], + table = [1, "<table>", "</table>"], + tbody = [2, "<table><tbody>", "</tbody></table>"], + tr = [3, "<table><tbody><tr>", "</tr></tbody></table>"], + select = [1, "<select multiple='multiple'>", "</select>"], + lookup = { + 'thead': table, + 'tbody': table, + 'tfoot': table, + 'tr': tbody, + 'td': tr, + 'th': tr, + 'option': select, + 'optgroup': select + }, + + // This is needed for old IE if you're *not* using either jQuery or innerShiv. Doesn't affect other cases. + mayRequireCreateElementHack = ko.utils.ieVersion <= 8; + + function getWrap(tags) { + var m = tags.match(/^(?:<!--.*?-->\s*?)*?<([a-z]+)[\s>]/); + return (m && lookup[m[1]]) || none; + } - taskQueue[taskQueueLength++] = func; - return nextHandle++; - }, + function simpleHtmlParse(html, documentContext) { + documentContext || (documentContext = document); + var windowContext = documentContext['parentWindow'] || documentContext['defaultView'] || window; + + // Based on jQuery's "clean" function, but only accounting for table-related elements. + // If you have referenced jQuery, this won't be used anyway - KO will use jQuery's "clean" function directly + + // Note that there's still an issue in IE < 9 whereby it will discard comment nodes that are the first child of + // a descendant node. For example: "<div><!-- mycomment -->abc</div>" will get parsed as "<div>abc</div>" + // This won't affect anyone who has referenced jQuery, and there's always the workaround of inserting a dummy node + // (possibly a text node) in front of the comment. So, KO does not attempt to workaround this IE issue automatically at present. + + // Trim whitespace, otherwise indexOf won't work as expected + var tags = ko.utils.stringTrim(html).toLowerCase(), div = documentContext.createElement("div"), + wrap = getWrap(tags), + depth = wrap[0]; + + // Go to html and back, then peel off extra wrappers + // Note that we always prefix with some dummy text, because otherwise, IE<9 will strip out leading comment nodes in descendants. Total madness. + var markup = "ignored<div>" + wrap[1] + html + wrap[2] + "</div>"; + if (typeof windowContext['innerShiv'] == "function") { + // Note that innerShiv is deprecated in favour of html5shiv. We should consider adding + // support for html5shiv (except if no explicit support is needed, e.g., if html5shiv + // somehow shims the native APIs so it just works anyway) + div.appendChild(windowContext['innerShiv'](markup)); + } else { + if (mayRequireCreateElementHack) { + // The document.createElement('my-element') trick to enable custom elements in IE6-8 + // only works if we assign innerHTML on an element associated with that document. + documentContext.body.appendChild(div); + } - cancel: function (handle) { - var index = handle - (nextHandle - taskQueueLength); - if (index >= nextIndexToProcess && index < taskQueueLength) { - taskQueue[index] = null; - } - }, + div.innerHTML = markup; - // For testing only: reset the queue and return the previous queue length - 'resetForTesting': function () { - var length = taskQueueLength - nextIndexToProcess; - nextIndexToProcess = taskQueueLength = taskQueue.length = 0; - return length; - }, + if (mayRequireCreateElementHack) { + div.parentNode.removeChild(div); + } + } - runEarly: processTasks - }; + // Move to the right depth + while (depth--) + div = div.lastChild; - return tasks; -})(); + return ko.utils.makeArray(div.lastChild.childNodes); + } -ko.exportSymbol('tasks', ko.tasks); -ko.exportSymbol('tasks.schedule', ko.tasks.schedule); -//ko.exportSymbol('tasks.cancel', ko.tasks.cancel); "cancel" isn't minified -ko.exportSymbol('tasks.runEarly', ko.tasks.runEarly); -ko.extenders = { - 'throttle': function(target, timeout) { - // Throttling means two things: - - // (1) For dependent observables, we throttle *evaluations* so that, no matter how fast its dependencies - // notify updates, the target doesn't re-evaluate (and hence doesn't notify) faster than a certain rate - target['throttleEvaluation'] = timeout; - - // (2) For writable targets (observables, or writable dependent observables), we throttle *writes* - // so the target cannot change value synchronously or faster than a certain rate - var writeTimeoutInstance = null; - return ko.dependentObservable({ - 'read': target, - 'write': function(value) { - clearTimeout(writeTimeoutInstance); - writeTimeoutInstance = ko.utils.setTimeout(function() { - target(value); - }, timeout); - } - }); - }, + function jQueryHtmlParse(html, documentContext) { + // jQuery's "parseHTML" function was introduced in jQuery 1.8.0 and is a documented public API. + if (jQueryInstance['parseHTML']) { + return jQueryInstance['parseHTML'](html, documentContext) || []; // Ensure we always return an array and never null + } else { + // For jQuery < 1.8.0, we fall back on the undocumented internal "clean" function. + var elems = jQueryInstance['clean']([html], documentContext); + + // As of jQuery 1.7.1, jQuery parses the HTML by appending it to some dummy parent nodes held in an in-memory document fragment. + // Unfortunately, it never clears the dummy parent nodes from the document fragment, so it leaks memory over time. + // Fix this by finding the top-most dummy parent element, and detaching it from its owner fragment. + if (elems && elems[0]) { + // Find the top-most parent element that's a direct child of a document fragment + var elem = elems[0]; + while (elem.parentNode && elem.parentNode.nodeType !== 11 /* i.e., DocumentFragment */) + elem = elem.parentNode; + // ... then detach it + if (elem.parentNode) + elem.parentNode.removeChild(elem); + } - 'rateLimit': function(target, options) { - var timeout, method, limitFunction; + return elems; + } + } - if (typeof options == 'number') { - timeout = options; - } else { - timeout = options['timeout']; - method = options['method']; - } + ko.utils.parseHtmlFragment = function(html, documentContext) { + return jQueryInstance ? + jQueryHtmlParse(html, documentContext) : // As below, benefit from jQuery's optimisations where possible + simpleHtmlParse(html, documentContext); // ... otherwise, this simple logic will do in most common cases. + }; - // rateLimit supersedes deferred updates - target._deferUpdates = false; + ko.utils.parseHtmlForTemplateNodes = function(html, documentContext) { + var nodes = ko.utils.parseHtmlFragment(html, documentContext); + return (nodes.length && nodes[0].parentElement) || ko.utils.moveCleanedNodesToContainerElement(nodes); + }; - limitFunction = method == 'notifyWhenChangesStop' ? debounce : throttle; - target.limit(function(callback) { - return limitFunction(callback, timeout); - }); - }, + ko.utils.setHtml = function(node, html) { + ko.utils.emptyDomNode(node); - 'deferred': function(target, options) { - if (options !== true) { - throw new Error('The \'deferred\' extender only accepts the value \'true\', because it is not supported to turn deferral off once enabled.') - } + // There's no legitimate reason to display a stringified observable without unwrapping it, so we'll unwrap it + html = ko.utils.unwrapObservable(html); - if (!target._deferUpdates) { - target._deferUpdates = true; - target.limit(function (callback) { - var handle, - ignoreUpdates = false; - return function () { - if (!ignoreUpdates) { - ko.tasks.cancel(handle); - handle = ko.tasks.schedule(callback); + if ((html !== null) && (html !== undefined)) { + if (typeof html != 'string') + html = html.toString(); - try { - ignoreUpdates = true; - target['notifySubscribers'](undefined, 'dirty'); - } finally { - ignoreUpdates = false; + // jQuery contains a lot of sophisticated code to parse arbitrary HTML fragments, + // for example <tr> elements which are not normally allowed to exist on their own. + // If you've referenced jQuery we'll use that rather than duplicating its code. + if (jQueryInstance) { + jQueryInstance(node)['html'](html); + } else { + // ... otherwise, use KO's own parsing logic. + var parsedNodes = ko.utils.parseHtmlFragment(html, node.ownerDocument); + for (var i = 0; i < parsedNodes.length; i++) + node.appendChild(parsedNodes[i]); } } }; - }); - } - }, - - 'notify': function(target, notifyWhen) { - target["equalityComparer"] = notifyWhen == "always" ? - null : // null equalityComparer means to always notify - valuesArePrimitiveAndEqual; - } -}; - -var primitiveTypes = { 'undefined':1, 'boolean':1, 'number':1, 'string':1 }; -function valuesArePrimitiveAndEqual(a, b) { - var oldValueIsPrimitive = (a === null) || (typeof(a) in primitiveTypes); - return oldValueIsPrimitive ? (a === b) : false; -} - -function throttle(callback, timeout) { - var timeoutInstance; - return function () { - if (!timeoutInstance) { - timeoutInstance = ko.utils.setTimeout(function () { - timeoutInstance = undefined; - callback(); - }, timeout); - } - }; -} - -function debounce(callback, timeout) { - var timeoutInstance; - return function () { - clearTimeout(timeoutInstance); - timeoutInstance = ko.utils.setTimeout(callback, timeout); - }; -} - -function applyExtenders(requestedExtenders) { - var target = this; - if (requestedExtenders) { - ko.utils.objectForEach(requestedExtenders, function(key, value) { - var extenderHandler = ko.extenders[key]; - if (typeof extenderHandler == 'function') { - target = extenderHandler(target, value) || target; - } - }); - } - return target; -} - -ko.exportSymbol('extenders', ko.extenders); - -ko.subscription = function (target, callback, disposeCallback) { - this._target = target; - this.callback = callback; - this.disposeCallback = disposeCallback; - this.isDisposed = false; - ko.exportProperty(this, 'dispose', this.dispose); -}; -ko.subscription.prototype.dispose = function () { - this.isDisposed = true; - this.disposeCallback(); -}; - -ko.subscribable = function () { - ko.utils.setPrototypeOfOrExtend(this, ko_subscribable_fn); - ko_subscribable_fn.init(this); -} - -var defaultEvent = "change"; + })(); -// Moved out of "limit" to avoid the extra closure -function limitNotifySubscribers(value, event) { - if (!event || event === defaultEvent) { - this._limitChange(value); - } else if (event === 'beforeChange') { - this._limitBeforeChange(value); - } else { - this._origNotifySubscribers(value, event); - } -} - -var ko_subscribable_fn = { - init: function(instance) { - instance._subscriptions = { "change": [] }; - instance._versionNumber = 1; - }, - - subscribe: function (callback, callbackTarget, event) { - var self = this; - - event = event || defaultEvent; - var boundCallback = callbackTarget ? callback.bind(callbackTarget) : callback; - - var subscription = new ko.subscription(self, boundCallback, function () { - ko.utils.arrayRemoveItem(self._subscriptions[event], subscription); - if (self.afterSubscriptionRemove) - self.afterSubscriptionRemove(event); - }); - - if (self.beforeSubscriptionAdd) - self.beforeSubscriptionAdd(event); - - if (!self._subscriptions[event]) - self._subscriptions[event] = []; - self._subscriptions[event].push(subscription); - - return subscription; - }, - - "notifySubscribers": function (valueToNotify, event) { - event = event || defaultEvent; - if (event === defaultEvent) { - this.updateVersion(); - } - if (this.hasSubscriptionsForEvent(event)) { - var subs = event === defaultEvent && this._changeSubscriptions || this._subscriptions[event].slice(0); - try { - ko.dependencyDetection.begin(); // Begin suppressing dependency detection (by setting the top frame to undefined) - for (var i = 0, subscription; subscription = subs[i]; ++i) { - // In case a subscription was disposed during the arrayForEach cycle, check - // for isDisposed on each subscription before invoking its callback - if (!subscription.isDisposed) - subscription.callback(valueToNotify); - } - } finally { - ko.dependencyDetection.end(); // End suppressing dependency detection - } - } - }, + ko.exportSymbol('utils.parseHtmlFragment', ko.utils.parseHtmlFragment); + ko.exportSymbol('utils.setHtml', ko.utils.setHtml); - getVersion: function () { - return this._versionNumber; - }, + ko.memoization = (function () { + var memos = {}; - hasChanged: function (versionToCheck) { - return this.getVersion() !== versionToCheck; - }, - - updateVersion: function () { - ++this._versionNumber; - }, + function randomMax8HexChars() { + return (((1 + Math.random()) * 0x100000000) | 0).toString(16).substring(1); + } + function generateRandomId() { + return randomMax8HexChars() + randomMax8HexChars(); + } + function findMemoNodes(rootNode, appendToArray) { + if (!rootNode) + return; + if (rootNode.nodeType == 8) { + var memoId = ko.memoization.parseMemoText(rootNode.nodeValue); + if (memoId != null) + appendToArray.push({ domNode: rootNode, memoId: memoId }); + } else if (rootNode.nodeType == 1) { + for (var i = 0, childNodes = rootNode.childNodes, j = childNodes.length; i < j; i++) + findMemoNodes(childNodes[i], appendToArray); + } + } - limit: function(limitFunction) { - var self = this, selfIsObservable = ko.isObservable(self), - ignoreBeforeChange, notifyNextChange, previousValue, pendingValue, beforeChange = 'beforeChange'; + return { + memoize: function (callback) { + if (typeof callback != "function") + throw new Error("You can only pass a function to ko.memoization.memoize()"); + var memoId = generateRandomId(); + memos[memoId] = callback; + return "<!--[ko_memo:" + memoId + "]-->"; + }, + + unmemoize: function (memoId, callbackParams) { + var callback = memos[memoId]; + if (callback === undefined) + throw new Error("Couldn't find any memo with ID " + memoId + ". Perhaps it's already been unmemoized."); + try { + callback.apply(null, callbackParams || []); + return true; + } + finally { delete memos[memoId]; } + }, + + unmemoizeDomNodeAndDescendants: function (domNode, extraCallbackParamsArray) { + var memos = []; + findMemoNodes(domNode, memos); + for (var i = 0, j = memos.length; i < j; i++) { + var node = memos[i].domNode; + var combinedParams = [node]; + if (extraCallbackParamsArray) + ko.utils.arrayPushAll(combinedParams, extraCallbackParamsArray); + ko.memoization.unmemoize(memos[i].memoId, combinedParams); + node.nodeValue = ""; // Neuter this node so we don't try to unmemoize it again + if (node.parentNode) + node.parentNode.removeChild(node); // If possible, erase it totally (not always possible - someone else might just hold a reference to it then call unmemoizeDomNodeAndDescendants again) + } + }, - if (!self._origNotifySubscribers) { - self._origNotifySubscribers = self["notifySubscribers"]; - self["notifySubscribers"] = limitNotifySubscribers; - } + parseMemoText: function (memoText) { + var match = memoText.match(/^\[ko_memo\:(.*?)\]$/); + return match ? match[1] : null; + } + }; + })(); + + ko.exportSymbol('memoization', ko.memoization); + ko.exportSymbol('memoization.memoize', ko.memoization.memoize); + ko.exportSymbol('memoization.unmemoize', ko.memoization.unmemoize); + ko.exportSymbol('memoization.parseMemoText', ko.memoization.parseMemoText); + ko.exportSymbol('memoization.unmemoizeDomNodeAndDescendants', ko.memoization.unmemoizeDomNodeAndDescendants); + ko.tasks = (function () { + var scheduler, + taskQueue = [], + taskQueueLength = 0, + nextHandle = 1, + nextIndexToProcess = 0; + + if (window['MutationObserver']) { + // Chrome 27+, Firefox 14+, IE 11+, Opera 15+, Safari 6.1+ + // From https://github.com/petkaantonov/bluebird * Copyright (c) 2014 Petka Antonov * License: MIT + scheduler = (function (callback) { + var div = document.createElement("div"); + new MutationObserver(callback).observe(div, {attributes: true}); + return function () { div.classList.toggle("foo"); }; + })(scheduledProcess); + } else if (document && "onreadystatechange" in document.createElement("script")) { + // IE 6-10 + // From https://github.com/YuzuJS/setImmediate * Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic Denicola * License: MIT + scheduler = function (callback) { + var script = document.createElement("script"); + script.onreadystatechange = function () { + script.onreadystatechange = null; + document.documentElement.removeChild(script); + script = null; + callback(); + }; + document.documentElement.appendChild(script); + }; + } else { + scheduler = function (callback) { + setTimeout(callback, 0); + }; + } - var finish = limitFunction(function() { - self._notificationIsPending = false; + function processTasks() { + if (taskQueueLength) { + // Each mark represents the end of a logical group of tasks and the number of these groups is + // limited to prevent unchecked recursion. + var mark = taskQueueLength, countMarks = 0; + + // nextIndexToProcess keeps track of where we are in the queue; processTasks can be called recursively without issue + for (var task; nextIndexToProcess < taskQueueLength; ) { + if (task = taskQueue[nextIndexToProcess++]) { + if (nextIndexToProcess > mark) { + if (++countMarks >= 5000) { + nextIndexToProcess = taskQueueLength; // skip all tasks remaining in the queue since any of them could be causing the recursion + ko.utils.deferError(Error("'Too much recursion' after processing " + countMarks + " task groups.")); + break; + } + mark = taskQueueLength; + } + try { + task(); + } catch (ex) { + ko.utils.deferError(ex); + } + } + } + } + } - // If an observable provided a reference to itself, access it to get the latest value. - // This allows computed observables to delay calculating their value until needed. - if (selfIsObservable && pendingValue === self) { - pendingValue = self._evalIfChanged ? self._evalIfChanged() : self(); - } - var shouldNotify = notifyNextChange || self.isDifferent(previousValue, pendingValue); + function scheduledProcess() { + processTasks(); - notifyNextChange = ignoreBeforeChange = false; + // Reset the queue + nextIndexToProcess = taskQueueLength = taskQueue.length = 0; + } - if (shouldNotify) { - self._origNotifySubscribers(previousValue = pendingValue); - } - }); - - self._limitChange = function(value) { - self._changeSubscriptions = self._subscriptions[defaultEvent].slice(0); - self._notificationIsPending = ignoreBeforeChange = true; - pendingValue = value; - finish(); - }; - self._limitBeforeChange = function(value) { - if (!ignoreBeforeChange) { - previousValue = value; - self._origNotifySubscribers(value, beforeChange); - } - }; - self._notifyNextChangeIfValueIsDifferent = function() { - if (self.isDifferent(previousValue, self.peek(true /*evaluate*/))) { - notifyNextChange = true; - } - }; - }, - - hasSubscriptionsForEvent: function(event) { - return this._subscriptions[event] && this._subscriptions[event].length; - }, - - getSubscriptionsCount: function (event) { - if (event) { - return this._subscriptions[event] && this._subscriptions[event].length || 0; - } else { - var total = 0; - ko.utils.objectForEach(this._subscriptions, function(eventName, subscriptions) { - if (eventName !== 'dirty') - total += subscriptions.length; - }); - return total; - } - }, + function scheduleTaskProcessing() { + ko.tasks['scheduler'](scheduledProcess); + } - isDifferent: function(oldValue, newValue) { - return !this['equalityComparer'] || !this['equalityComparer'](oldValue, newValue); - }, + var tasks = { + 'scheduler': scheduler, // Allow overriding the scheduler - extend: applyExtenders -}; + schedule: function (func) { + if (!taskQueueLength) { + scheduleTaskProcessing(); + } -ko.exportProperty(ko_subscribable_fn, 'subscribe', ko_subscribable_fn.subscribe); -ko.exportProperty(ko_subscribable_fn, 'extend', ko_subscribable_fn.extend); -ko.exportProperty(ko_subscribable_fn, 'getSubscriptionsCount', ko_subscribable_fn.getSubscriptionsCount); + taskQueue[taskQueueLength++] = func; + return nextHandle++; + }, -// For browsers that support proto assignment, we overwrite the prototype of each -// observable instance. Since observables are functions, we need Function.prototype -// to still be in the prototype chain. -if (ko.utils.canSetPrototype) { - ko.utils.setPrototypeOf(ko_subscribable_fn, Function.prototype); -} - -ko.subscribable['fn'] = ko_subscribable_fn; - - -ko.isSubscribable = function (instance) { - return instance != null && typeof instance.subscribe == "function" && typeof instance["notifySubscribers"] == "function"; -}; - -ko.exportSymbol('subscribable', ko.subscribable); -ko.exportSymbol('isSubscribable', ko.isSubscribable); - -ko.computedContext = ko.dependencyDetection = (function () { - var outerFrames = [], - currentFrame, - lastId = 0; - - // Return a unique ID that can be assigned to an observable for dependency tracking. - // Theoretically, you could eventually overflow the number storage size, resulting - // in duplicate IDs. But in JavaScript, the largest exact integral value is 2^53 - // or 9,007,199,254,740,992. If you created 1,000,000 IDs per second, it would - // take over 285 years to reach that number. - // Reference http://blog.vjeux.com/2010/javascript/javascript-max_int-number-limits.html - function getId() { - return ++lastId; - } - - function begin(options) { - outerFrames.push(currentFrame); - currentFrame = options; - } - - function end() { - currentFrame = outerFrames.pop(); - } - - return { - begin: begin, - - end: end, - - registerDependency: function (subscribable) { - if (currentFrame) { - if (!ko.isSubscribable(subscribable)) - throw new Error("Only subscribable things can act as dependencies"); - currentFrame.callback.call(currentFrame.callbackTarget, subscribable, subscribable._id || (subscribable._id = getId())); - } - }, - - ignore: function (callback, callbackTarget, callbackArgs) { - try { - begin(); - return callback.apply(callbackTarget, callbackArgs || []); - } finally { - end(); - } - }, + cancel: function (handle) { + var index = handle - (nextHandle - taskQueueLength); + if (index >= nextIndexToProcess && index < taskQueueLength) { + taskQueue[index] = null; + } + }, - getDependenciesCount: function () { - if (currentFrame) - return currentFrame.computed.getDependenciesCount(); - }, + // For testing only: reset the queue and return the previous queue length + 'resetForTesting': function () { + var length = taskQueueLength - nextIndexToProcess; + nextIndexToProcess = taskQueueLength = taskQueue.length = 0; + return length; + }, - isInitial: function() { - if (currentFrame) - return currentFrame.isInitial; - } - }; -})(); + runEarly: processTasks + }; -ko.exportSymbol('computedContext', ko.computedContext); -ko.exportSymbol('computedContext.getDependenciesCount', ko.computedContext.getDependenciesCount); -ko.exportSymbol('computedContext.isInitial', ko.computedContext.isInitial); + return tasks; + })(); -ko.exportSymbol('ignoreDependencies', ko.ignoreDependencies = ko.dependencyDetection.ignore); -var observableLatestValue = ko.utils.createSymbolOrString('_latestValue'); + ko.exportSymbol('tasks', ko.tasks); + ko.exportSymbol('tasks.schedule', ko.tasks.schedule); +//ko.exportSymbol('tasks.cancel', ko.tasks.cancel); "cancel" isn't minified + ko.exportSymbol('tasks.runEarly', ko.tasks.runEarly); + ko.extenders = { + 'throttle': function(target, timeout) { + // Throttling means two things: + + // (1) For dependent observables, we throttle *evaluations* so that, no matter how fast its dependencies + // notify updates, the target doesn't re-evaluate (and hence doesn't notify) faster than a certain rate + target['throttleEvaluation'] = timeout; + + // (2) For writable targets (observables, or writable dependent observables), we throttle *writes* + // so the target cannot change value synchronously or faster than a certain rate + var writeTimeoutInstance = null; + return ko.dependentObservable({ + 'read': target, + 'write': function(value) { + clearTimeout(writeTimeoutInstance); + writeTimeoutInstance = ko.utils.setTimeout(function() { + target(value); + }, timeout); + } + }); + }, -ko.observable = function (initialValue) { - function observable() { - if (arguments.length > 0) { - // Write + 'rateLimit': function(target, options) { + var timeout, method, limitFunction; - // Ignore writes if the value hasn't changed - if (observable.isDifferent(observable[observableLatestValue], arguments[0])) { - observable.valueWillMutate(); - observable[observableLatestValue] = arguments[0]; - observable.valueHasMutated(); - } - return this; // Permits chained assignments - } - else { - // Read - ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a "read" operation - return observable[observableLatestValue]; - } - } + if (typeof options == 'number') { + timeout = options; + } else { + timeout = options['timeout']; + method = options['method']; + } - observable[observableLatestValue] = initialValue; + // rateLimit supersedes deferred updates + target._deferUpdates = false; - // Inherit from 'subscribable' - if (!ko.utils.canSetPrototype) { - // 'subscribable' won't be on the prototype chain unless we put it there directly - ko.utils.extend(observable, ko.subscribable['fn']); - } - ko.subscribable['fn'].init(observable); + limitFunction = typeof method == 'function' ? method : method == 'notifyWhenChangesStop' ? debounce : throttle; + target.limit(function(callback) { + return limitFunction(callback, timeout, options); + }); + }, - // Inherit from 'observable' - ko.utils.setPrototypeOfOrExtend(observable, observableFn); + 'deferred': function(target, options) { + if (options !== true) { + throw new Error('The \'deferred\' extender only accepts the value \'true\', because it is not supported to turn deferral off once enabled.') + } - if (ko.options['deferUpdates']) { - ko.extenders['deferred'](observable, true); - } - - return observable; -} - -// Define prototype for observables -var observableFn = { - 'equalityComparer': valuesArePrimitiveAndEqual, - peek: function() { return this[observableLatestValue]; }, - valueHasMutated: function () { this['notifySubscribers'](this[observableLatestValue]); }, - valueWillMutate: function () { this['notifySubscribers'](this[observableLatestValue], 'beforeChange'); } -}; + if (!target._deferUpdates) { + target._deferUpdates = true; + target.limit(function (callback) { + var handle, + ignoreUpdates = false; + return function () { + if (!ignoreUpdates) { + ko.tasks.cancel(handle); + handle = ko.tasks.schedule(callback); + + try { + ignoreUpdates = true; + target['notifySubscribers'](undefined, 'dirty'); + } finally { + ignoreUpdates = false; + } + } + }; + }); + } + }, -// Note that for browsers that don't support proto assignment, the -// inheritance chain is created manually in the ko.observable constructor -if (ko.utils.canSetPrototype) { - ko.utils.setPrototypeOf(observableFn, ko.subscribable['fn']); -} - -var protoProperty = ko.observable.protoProperty = '__ko_proto__'; -observableFn[protoProperty] = ko.observable; - -ko.hasPrototype = function(instance, prototype) { - if ((instance === null) || (instance === undefined) || (instance[protoProperty] === undefined)) return false; - if (instance[protoProperty] === prototype) return true; - return ko.hasPrototype(instance[protoProperty], prototype); // Walk the prototype chain -}; - -ko.isObservable = function (instance) { - return ko.hasPrototype(instance, ko.observable); -} -ko.isWriteableObservable = function (instance) { - // Observable - if ((typeof instance == 'function') && instance[protoProperty] === ko.observable) - return true; - // Writeable dependent observable - if ((typeof instance == 'function') && (instance[protoProperty] === ko.dependentObservable) && (instance.hasWriteFunction)) - return true; - // Anything else - return false; -} - -ko.exportSymbol('observable', ko.observable); -ko.exportSymbol('isObservable', ko.isObservable); -ko.exportSymbol('isWriteableObservable', ko.isWriteableObservable); -ko.exportSymbol('isWritableObservable', ko.isWriteableObservable); -ko.exportSymbol('observable.fn', observableFn); -ko.exportProperty(observableFn, 'peek', observableFn.peek); -ko.exportProperty(observableFn, 'valueHasMutated', observableFn.valueHasMutated); -ko.exportProperty(observableFn, 'valueWillMutate', observableFn.valueWillMutate); -ko.observableArray = function (initialValues) { - initialValues = initialValues || []; - - if (typeof initialValues != 'object' || !('length' in initialValues)) - throw new Error("The argument passed when initializing an observable array must be an array, or null, or undefined."); - - var result = ko.observable(initialValues); - ko.utils.setPrototypeOfOrExtend(result, ko.observableArray['fn']); - return result.extend({'trackArrayChanges':true}); -}; - -ko.observableArray['fn'] = { - 'remove': function (valueOrPredicate) { - var underlyingArray = this.peek(); - var removedValues = []; - var predicate = typeof valueOrPredicate == "function" && !ko.isObservable(valueOrPredicate) ? valueOrPredicate : function (value) { return value === valueOrPredicate; }; - for (var i = 0; i < underlyingArray.length; i++) { - var value = underlyingArray[i]; - if (predicate(value)) { - if (removedValues.length === 0) { - this.valueWillMutate(); + 'notify': function(target, notifyWhen) { + target["equalityComparer"] = notifyWhen == "always" ? + null : // null equalityComparer means to always notify + valuesArePrimitiveAndEqual; } - removedValues.push(value); - underlyingArray.splice(i, 1); - i--; + }; + + var primitiveTypes = { 'undefined':1, 'boolean':1, 'number':1, 'string':1 }; + function valuesArePrimitiveAndEqual(a, b) { + var oldValueIsPrimitive = (a === null) || (typeof(a) in primitiveTypes); + return oldValueIsPrimitive ? (a === b) : false; } - } - if (removedValues.length) { - this.valueHasMutated(); - } - return removedValues; - }, - - 'removeAll': function (arrayOfValues) { - // If you passed zero args, we remove everything - if (arrayOfValues === undefined) { - var underlyingArray = this.peek(); - var allValues = underlyingArray.slice(0); - this.valueWillMutate(); - underlyingArray.splice(0, underlyingArray.length); - this.valueHasMutated(); - return allValues; - } - // If you passed an arg, we interpret it as an array of entries to remove - if (!arrayOfValues) - return []; - return this['remove'](function (value) { - return ko.utils.arrayIndexOf(arrayOfValues, value) >= 0; - }); - }, - - 'destroy': function (valueOrPredicate) { - var underlyingArray = this.peek(); - var predicate = typeof valueOrPredicate == "function" && !ko.isObservable(valueOrPredicate) ? valueOrPredicate : function (value) { return value === valueOrPredicate; }; - this.valueWillMutate(); - for (var i = underlyingArray.length - 1; i >= 0; i--) { - var value = underlyingArray[i]; - if (predicate(value)) - underlyingArray[i]["_destroy"] = true; - } - this.valueHasMutated(); - }, - - 'destroyAll': function (arrayOfValues) { - // If you passed zero args, we destroy everything - if (arrayOfValues === undefined) - return this['destroy'](function() { return true }); - - // If you passed an arg, we interpret it as an array of entries to destroy - if (!arrayOfValues) - return []; - return this['destroy'](function (value) { - return ko.utils.arrayIndexOf(arrayOfValues, value) >= 0; - }); - }, - - 'indexOf': function (item) { - var underlyingArray = this(); - return ko.utils.arrayIndexOf(underlyingArray, item); - }, - - 'replace': function(oldItem, newItem) { - var index = this['indexOf'](oldItem); - if (index >= 0) { - this.valueWillMutate(); - this.peek()[index] = newItem; - this.valueHasMutated(); - } - } -}; -// Note that for browsers that don't support proto assignment, the -// inheritance chain is created manually in the ko.observableArray constructor -if (ko.utils.canSetPrototype) { - ko.utils.setPrototypeOf(ko.observableArray['fn'], ko.observable['fn']); -} + function throttle(callback, timeout) { + var timeoutInstance; + return function () { + if (!timeoutInstance) { + timeoutInstance = ko.utils.setTimeout(function () { + timeoutInstance = undefined; + callback(); + }, timeout); + } + }; + } -// Populate ko.observableArray.fn with read/write functions from native arrays -// Important: Do not add any additional functions here that may reasonably be used to *read* data from the array -// because we'll eval them without causing subscriptions, so ko.computed output could end up getting stale -ko.utils.arrayForEach(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function (methodName) { - ko.observableArray['fn'][methodName] = function () { - // Use "peek" to avoid creating a subscription in any computed that we're executing in the context of - // (for consistency with mutating regular observables) - var underlyingArray = this.peek(); - this.valueWillMutate(); - this.cacheDiffForKnownOperation(underlyingArray, methodName, arguments); - var methodCallResult = underlyingArray[methodName].apply(underlyingArray, arguments); - this.valueHasMutated(); - // The native sort and reverse methods return a reference to the array, but it makes more sense to return the observable array instead. - return methodCallResult === underlyingArray ? this : methodCallResult; - }; -}); + function debounce(callback, timeout) { + var timeoutInstance; + return function () { + clearTimeout(timeoutInstance); + timeoutInstance = ko.utils.setTimeout(callback, timeout); + }; + } -// Populate ko.observableArray.fn with read-only functions from native arrays -ko.utils.arrayForEach(["slice"], function (methodName) { - ko.observableArray['fn'][methodName] = function () { - var underlyingArray = this(); - return underlyingArray[methodName].apply(underlyingArray, arguments); - }; -}); - -ko.exportSymbol('observableArray', ko.observableArray); -var arrayChangeEventName = 'arrayChange'; -ko.extenders['trackArrayChanges'] = function(target, options) { - // Use the provided options--each call to trackArrayChanges overwrites the previously set options - target.compareArrayOptions = {}; - if (options && typeof options == "object") { - ko.utils.extend(target.compareArrayOptions, options); - } - target.compareArrayOptions['sparse'] = true; - - // Only modify the target observable once - if (target.cacheDiffForKnownOperation) { - return; - } - var trackingChanges = false, - cachedDiff = null, - arrayChangeSubscription, - pendingNotifications = 0, - underlyingNotifySubscribersFunction, - underlyingBeforeSubscriptionAddFunction = target.beforeSubscriptionAdd, - underlyingAfterSubscriptionRemoveFunction = target.afterSubscriptionRemove; - - // Watch "subscribe" calls, and for array change events, ensure change tracking is enabled - target.beforeSubscriptionAdd = function (event) { - if (underlyingBeforeSubscriptionAddFunction) - underlyingBeforeSubscriptionAddFunction.call(target, event); - if (event === arrayChangeEventName) { - trackChanges(); - } - }; - // Watch "dispose" calls, and for array change events, ensure change tracking is disabled when all are disposed - target.afterSubscriptionRemove = function (event) { - if (underlyingAfterSubscriptionRemoveFunction) - underlyingAfterSubscriptionRemoveFunction.call(target, event); - if (event === arrayChangeEventName && !target.hasSubscriptionsForEvent(arrayChangeEventName)) { - if (underlyingNotifySubscribersFunction) { - target['notifySubscribers'] = underlyingNotifySubscribersFunction; - underlyingNotifySubscribersFunction = undefined; + function applyExtenders(requestedExtenders) { + var target = this; + if (requestedExtenders) { + ko.utils.objectForEach(requestedExtenders, function(key, value) { + var extenderHandler = ko.extenders[key]; + if (typeof extenderHandler == 'function') { + target = extenderHandler(target, value) || target; + } + }); + } + return target; } - arrayChangeSubscription.dispose(); - trackingChanges = false; - } - }; - function trackChanges() { - // Calling 'trackChanges' multiple times is the same as calling it once - if (trackingChanges) { - return; - } + ko.exportSymbol('extenders', ko.extenders); - trackingChanges = true; + ko.subscription = function (target, callback, disposeCallback) { + this._target = target; + this._callback = callback; + this._disposeCallback = disposeCallback; + this._isDisposed = false; + this._node = null; + this._domNodeDisposalCallback = null; + ko.exportProperty(this, 'dispose', this.dispose); + ko.exportProperty(this, 'disposeWhenNodeIsRemoved', this.disposeWhenNodeIsRemoved); + }; + ko.subscription.prototype.dispose = function () { + var self = this; + if (!self._isDisposed) { + if (self._domNodeDisposalCallback) { + ko.utils.domNodeDisposal.removeDisposeCallback(self._node, self._domNodeDisposalCallback); + } + self._isDisposed = true; + self._disposeCallback(); - // Intercept "notifySubscribers" to track how many times it was called. - underlyingNotifySubscribersFunction = target['notifySubscribers']; - target['notifySubscribers'] = function(valueToNotify, event) { - if (!event || event === defaultEvent) { - ++pendingNotifications; - } - return underlyingNotifySubscribersFunction.apply(this, arguments); - }; - - // Each time the array changes value, capture a clone so that on the next - // change it's possible to produce a diff - var previousContents = [].concat(target.peek() || []); - cachedDiff = null; - arrayChangeSubscription = target.subscribe(function(currentContents) { - // Make a copy of the current contents and ensure it's an array - currentContents = [].concat(currentContents || []); - - // Compute the diff and issue notifications, but only if someone is listening - if (target.hasSubscriptionsForEvent(arrayChangeEventName)) { - var changes = getChanges(previousContents, currentContents); + self._target = self._callback = self._disposeCallback = self._node = self._domNodeDisposalCallback = null; + } + }; + ko.subscription.prototype.disposeWhenNodeIsRemoved = function (node) { + this._node = node; + ko.utils.domNodeDisposal.addDisposeCallback(node, this._domNodeDisposalCallback = this.dispose.bind(this)); + }; + + ko.subscribable = function () { + ko.utils.setPrototypeOfOrExtend(this, ko_subscribable_fn); + ko_subscribable_fn.init(this); } - // Eliminate references to the old, removed items, so they can be GCed - previousContents = currentContents; - cachedDiff = null; - pendingNotifications = 0; + var defaultEvent = "change"; - if (changes && changes.length) { - target['notifySubscribers'](changes, arrayChangeEventName); +// Moved out of "limit" to avoid the extra closure + function limitNotifySubscribers(value, event) { + if (!event || event === defaultEvent) { + this._limitChange(value); + } else if (event === 'beforeChange') { + this._limitBeforeChange(value); + } else { + this._origNotifySubscribers(value, event); + } } - }); - } - - function getChanges(previousContents, currentContents) { - // We try to re-use cached diffs. - // The scenarios where pendingNotifications > 1 are when using rate-limiting or the Deferred Updates - // plugin, which without this check would not be compatible with arrayChange notifications. Normally, - // notifications are issued immediately so we wouldn't be queueing up more than one. - if (!cachedDiff || pendingNotifications > 1) { - cachedDiff = ko.utils.compareArrays(previousContents, currentContents, target.compareArrayOptions); - } - return cachedDiff; - } + var ko_subscribable_fn = { + init: function(instance) { + instance._subscriptions = { "change": [] }; + instance._versionNumber = 1; + }, - target.cacheDiffForKnownOperation = function(rawArray, operationName, args) { - // Only run if we're currently tracking changes for this observable array - // and there aren't any pending deferred notifications. - if (!trackingChanges || pendingNotifications) { - return; - } - var diff = [], - arrayLength = rawArray.length, - argsLength = args.length, - offset = 0; + subscribe: function (callback, callbackTarget, event) { + var self = this; - function pushDiff(status, value, index) { - return diff[diff.length] = { 'status': status, 'value': value, 'index': index }; - } - switch (operationName) { - case 'push': - offset = arrayLength; - case 'unshift': - for (var index = 0; index < argsLength; index++) { - pushDiff('added', args[index], offset + index); - } - break; - - case 'pop': - offset = arrayLength - 1; - case 'shift': - if (arrayLength) { - pushDiff('deleted', rawArray[offset], offset); - } - break; - - case 'splice': - // Negative start index means 'from end of array'. After that we clamp to [0...arrayLength]. - // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice - var startIndex = Math.min(Math.max(0, args[0] < 0 ? arrayLength + args[0] : args[0]), arrayLength), - endDeleteIndex = argsLength === 1 ? arrayLength : Math.min(startIndex + (args[1] || 0), arrayLength), - endAddIndex = startIndex + argsLength - 2, - endIndex = Math.max(endDeleteIndex, endAddIndex), - additions = [], deletions = []; - for (var index = startIndex, argsIndex = 2; index < endIndex; ++index, ++argsIndex) { - if (index < endDeleteIndex) - deletions.push(pushDiff('deleted', rawArray[index], index)); - if (index < endAddIndex) - additions.push(pushDiff('added', args[argsIndex], index)); - } - ko.utils.findMovesInArrayComparison(deletions, additions); - break; - - default: - return; - } - cachedDiff = diff; - }; -}; -var computedState = ko.utils.createSymbolOrString('_state'); - -ko.computed = ko.dependentObservable = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget, options) { - if (typeof evaluatorFunctionOrOptions === "object") { - // Single-parameter syntax - everything is on this "options" param - options = evaluatorFunctionOrOptions; - } else { - // Multi-parameter syntax - construct the options according to the params passed - options = options || {}; - if (evaluatorFunctionOrOptions) { - options["read"] = evaluatorFunctionOrOptions; - } - } - if (typeof options["read"] != "function") - throw Error("Pass a function that returns the value of the ko.computed"); - - var writeFunction = options["write"]; - var state = { - latestValue: undefined, - isStale: true, - isDirty: true, - isBeingEvaluated: false, - suppressDisposalUntilDisposeWhenReturnsFalse: false, - isDisposed: false, - pure: false, - isSleeping: false, - readFunction: options["read"], - evaluatorFunctionTarget: evaluatorFunctionTarget || options["owner"], - disposeWhenNodeIsRemoved: options["disposeWhenNodeIsRemoved"] || options.disposeWhenNodeIsRemoved || null, - disposeWhen: options["disposeWhen"] || options.disposeWhen, - domNodeDisposalCallback: null, - dependencyTracking: {}, - dependenciesCount: 0, - evaluationTimeoutInstance: null - }; - - function computedObservable() { - if (arguments.length > 0) { - if (typeof writeFunction === "function") { - // Writing a value - writeFunction.apply(state.evaluatorFunctionTarget, arguments); - } else { - throw new Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters."); - } - return this; // Permits chained assignments - } else { - // Reading the value - ko.dependencyDetection.registerDependency(computedObservable); - if (state.isDirty || (state.isSleeping && computedObservable.haveDependenciesChanged())) { - computedObservable.evaluateImmediate(); - } - return state.latestValue; - } - } - - computedObservable[computedState] = state; - computedObservable.hasWriteFunction = typeof writeFunction === "function"; - - // Inherit from 'subscribable' - if (!ko.utils.canSetPrototype) { - // 'subscribable' won't be on the prototype chain unless we put it there directly - ko.utils.extend(computedObservable, ko.subscribable['fn']); - } - ko.subscribable['fn'].init(computedObservable); - - // Inherit from 'computed' - ko.utils.setPrototypeOfOrExtend(computedObservable, computedFn); - - if (options['pure']) { - state.pure = true; - state.isSleeping = true; // Starts off sleeping; will awake on the first subscription - ko.utils.extend(computedObservable, pureComputedOverrides); - } else if (options['deferEvaluation']) { - ko.utils.extend(computedObservable, deferEvaluationOverrides); - } - - if (ko.options['deferUpdates']) { - ko.extenders['deferred'](computedObservable, true); - } - - if (DEBUG) { - // #1731 - Aid debugging by exposing the computed's options - computedObservable["_options"] = options; - } - - if (state.disposeWhenNodeIsRemoved) { - // Since this computed is associated with a DOM node, and we don't want to dispose the computed - // until the DOM node is *removed* from the document (as opposed to never having been in the document), - // we'll prevent disposal until "disposeWhen" first returns false. - state.suppressDisposalUntilDisposeWhenReturnsFalse = true; - - // disposeWhenNodeIsRemoved: true can be used to opt into the "only dispose after first false result" - // behaviour even if there's no specific node to watch. In that case, clear the option so we don't try - // to watch for a non-node's disposal. This technique is intended for KO's internal use only and shouldn't - // be documented or used by application code, as it's likely to change in a future version of KO. - if (!state.disposeWhenNodeIsRemoved.nodeType) { - state.disposeWhenNodeIsRemoved = null; - } - } + event = event || defaultEvent; + var boundCallback = callbackTarget ? callback.bind(callbackTarget) : callback; - // Evaluate, unless sleeping or deferEvaluation is true - if (!state.isSleeping && !options['deferEvaluation']) { - computedObservable.evaluateImmediate(); - } + var subscription = new ko.subscription(self, boundCallback, function () { + ko.utils.arrayRemoveItem(self._subscriptions[event], subscription); + if (self.afterSubscriptionRemove) + self.afterSubscriptionRemove(event); + }); - // Attach a DOM node disposal callback so that the computed will be proactively disposed as soon as the node is - // removed using ko.removeNode. But skip if isActive is false (there will never be any dependencies to dispose). - if (state.disposeWhenNodeIsRemoved && computedObservable.isActive()) { - ko.utils.domNodeDisposal.addDisposeCallback(state.disposeWhenNodeIsRemoved, state.domNodeDisposalCallback = function () { - computedObservable.dispose(); - }); - } + if (self.beforeSubscriptionAdd) + self.beforeSubscriptionAdd(event); - return computedObservable; -}; + if (!self._subscriptions[event]) + self._subscriptions[event] = []; + self._subscriptions[event].push(subscription); -// Utility function that disposes a given dependencyTracking entry -function computedDisposeDependencyCallback(id, entryToDispose) { - if (entryToDispose !== null && entryToDispose.dispose) { - entryToDispose.dispose(); - } -} + return subscription; + }, -// This function gets called each time a dependency is detected while evaluating a computed. -// It's factored out as a shared function to avoid creating unnecessary function instances during evaluation. -function computedBeginDependencyDetectionCallback(subscribable, id) { - var computedObservable = this.computedObservable, - state = computedObservable[computedState]; - if (!state.isDisposed) { - if (this.disposalCount && this.disposalCandidates[id]) { - // Don't want to dispose this subscription, as it's still being used - computedObservable.addDependencyTracking(id, subscribable, this.disposalCandidates[id]); - this.disposalCandidates[id] = null; // No need to actually delete the property - disposalCandidates is a transient object anyway - --this.disposalCount; - } else if (!state.dependencyTracking[id]) { - // Brand new subscription - add it - computedObservable.addDependencyTracking(id, subscribable, state.isSleeping ? { _target: subscribable } : computedObservable.subscribeToDependency(subscribable)); - } - // If the observable we've accessed has a pending notification, ensure we get notified of the actual final value (bypass equality checks) - if (subscribable._notificationIsPending) { - subscribable._notifyNextChangeIfValueIsDifferent(); - } - } -} - -var computedFn = { - "equalityComparer": valuesArePrimitiveAndEqual, - getDependenciesCount: function () { - return this[computedState].dependenciesCount; - }, - addDependencyTracking: function (id, target, trackingObj) { - if (this[computedState].pure && target === this) { - throw Error("A 'pure' computed must not be called recursively"); - } + "notifySubscribers": function (valueToNotify, event) { + event = event || defaultEvent; + if (event === defaultEvent) { + this.updateVersion(); + } + if (this.hasSubscriptionsForEvent(event)) { + var subs = event === defaultEvent && this._changeSubscriptions || this._subscriptions[event].slice(0); + try { + ko.dependencyDetection.begin(); // Begin suppressing dependency detection (by setting the top frame to undefined) + for (var i = 0, subscription; subscription = subs[i]; ++i) { + // In case a subscription was disposed during the arrayForEach cycle, check + // for isDisposed on each subscription before invoking its callback + if (!subscription._isDisposed) + subscription._callback(valueToNotify); + } + } finally { + ko.dependencyDetection.end(); // End suppressing dependency detection + } + } + }, - this[computedState].dependencyTracking[id] = trackingObj; - trackingObj._order = this[computedState].dependenciesCount++; - trackingObj._version = target.getVersion(); - }, - haveDependenciesChanged: function () { - var id, dependency, dependencyTracking = this[computedState].dependencyTracking; - for (id in dependencyTracking) { - if (dependencyTracking.hasOwnProperty(id)) { - dependency = dependencyTracking[id]; - if ((this._evalDelayed && dependency._target._notificationIsPending) || dependency._target.hasChanged(dependency._version)) { - return true; - } - } - } - }, - markDirty: function () { - // Process "dirty" events if we can handle delayed notifications - if (this._evalDelayed && !this[computedState].isBeingEvaluated) { - this._evalDelayed(false /*isChange*/); - } - }, - isActive: function () { - var state = this[computedState]; - return state.isDirty || state.dependenciesCount > 0; - }, - respondToChange: function () { - // Ignore "change" events if we've already scheduled a delayed notification - if (!this._notificationIsPending) { - this.evaluatePossiblyAsync(); - } else if (this[computedState].isDirty) { - this[computedState].isStale = true; - } - }, - subscribeToDependency: function (target) { - if (target._deferUpdates && !this[computedState].disposeWhenNodeIsRemoved) { - var dirtySub = target.subscribe(this.markDirty, this, 'dirty'), - changeSub = target.subscribe(this.respondToChange, this); - return { - _target: target, - dispose: function () { - dirtySub.dispose(); - changeSub.dispose(); - } - }; - } else { - return target.subscribe(this.evaluatePossiblyAsync, this); - } - }, - evaluatePossiblyAsync: function () { - var computedObservable = this, - throttleEvaluationTimeout = computedObservable['throttleEvaluation']; - if (throttleEvaluationTimeout && throttleEvaluationTimeout >= 0) { - clearTimeout(this[computedState].evaluationTimeoutInstance); - this[computedState].evaluationTimeoutInstance = ko.utils.setTimeout(function () { - computedObservable.evaluateImmediate(true /*notifyChange*/); - }, throttleEvaluationTimeout); - } else if (computedObservable._evalDelayed) { - computedObservable._evalDelayed(true /*isChange*/); - } else { - computedObservable.evaluateImmediate(true /*notifyChange*/); - } - }, - evaluateImmediate: function (notifyChange) { - var computedObservable = this, - state = computedObservable[computedState], - disposeWhen = state.disposeWhen, - changed = false; - - if (state.isBeingEvaluated) { - // If the evaluation of a ko.computed causes side effects, it's possible that it will trigger its own re-evaluation. - // This is not desirable (it's hard for a developer to realise a chain of dependencies might cause this, and they almost - // certainly didn't intend infinite re-evaluations). So, for predictability, we simply prevent ko.computeds from causing - // their own re-evaluation. Further discussion at https://github.com/SteveSanderson/knockout/pull/387 - return; - } + getVersion: function () { + return this._versionNumber; + }, - // Do not evaluate (and possibly capture new dependencies) if disposed - if (state.isDisposed) { - return; - } + hasChanged: function (versionToCheck) { + return this.getVersion() !== versionToCheck; + }, - if (state.disposeWhenNodeIsRemoved && !ko.utils.domNodeIsAttachedToDocument(state.disposeWhenNodeIsRemoved) || disposeWhen && disposeWhen()) { - // See comment above about suppressDisposalUntilDisposeWhenReturnsFalse - if (!state.suppressDisposalUntilDisposeWhenReturnsFalse) { - computedObservable.dispose(); - return; - } - } else { - // It just did return false, so we can stop suppressing now - state.suppressDisposalUntilDisposeWhenReturnsFalse = false; - } + updateVersion: function () { + ++this._versionNumber; + }, - state.isBeingEvaluated = true; - try { - changed = this.evaluateImmediate_CallReadWithDependencyDetection(notifyChange); - } finally { - state.isBeingEvaluated = false; - } + limit: function(limitFunction) { + var self = this, selfIsObservable = ko.isObservable(self), + ignoreBeforeChange, notifyNextChange, previousValue, pendingValue, didUpdate, + beforeChange = 'beforeChange'; - if (!state.dependenciesCount) { - computedObservable.dispose(); - } + if (!self._origNotifySubscribers) { + self._origNotifySubscribers = self["notifySubscribers"]; + self["notifySubscribers"] = limitNotifySubscribers; + } - return changed; - }, - evaluateImmediate_CallReadWithDependencyDetection: function (notifyChange) { - // This function is really just part of the evaluateImmediate logic. You would never call it from anywhere else. - // Factoring it out into a separate function means it can be independent of the try/catch block in evaluateImmediate, - // which contributes to saving about 40% off the CPU overhead of computed evaluation (on V8 at least). - - var computedObservable = this, - state = computedObservable[computedState], - changed = false; - - // Initially, we assume that none of the subscriptions are still being used (i.e., all are candidates for disposal). - // Then, during evaluation, we cross off any that are in fact still being used. - var isInitial = state.pure ? undefined : !state.dependenciesCount, // If we're evaluating when there are no previous dependencies, it must be the first time - dependencyDetectionContext = { - computedObservable: computedObservable, - disposalCandidates: state.dependencyTracking, - disposalCount: state.dependenciesCount - }; + var finish = limitFunction(function() { + self._notificationIsPending = false; + + // If an observable provided a reference to itself, access it to get the latest value. + // This allows computed observables to delay calculating their value until needed. + if (selfIsObservable && pendingValue === self) { + pendingValue = self._evalIfChanged ? self._evalIfChanged() : self(); + } + var shouldNotify = notifyNextChange || (didUpdate && self.isDifferent(previousValue, pendingValue)); - ko.dependencyDetection.begin({ - callbackTarget: dependencyDetectionContext, - callback: computedBeginDependencyDetectionCallback, - computed: computedObservable, - isInitial: isInitial - }); + didUpdate = notifyNextChange = ignoreBeforeChange = false; - state.dependencyTracking = {}; - state.dependenciesCount = 0; + if (shouldNotify) { + self._origNotifySubscribers(previousValue = pendingValue); + } + }); - var newValue = this.evaluateImmediate_CallReadThenEndDependencyDetection(state, dependencyDetectionContext); + self._limitChange = function(value, isDirty) { + if (!isDirty || !self._notificationIsPending) { + didUpdate = !isDirty; + } + self._changeSubscriptions = self._subscriptions[defaultEvent].slice(0); + self._notificationIsPending = ignoreBeforeChange = true; + pendingValue = value; + finish(); + }; + self._limitBeforeChange = function(value) { + if (!ignoreBeforeChange) { + previousValue = value; + self._origNotifySubscribers(value, beforeChange); + } + }; + self._recordUpdate = function() { + didUpdate = true; + }; + self._notifyNextChangeIfValueIsDifferent = function() { + if (self.isDifferent(previousValue, self.peek(true /*evaluate*/))) { + notifyNextChange = true; + } + }; + }, - if (computedObservable.isDifferent(state.latestValue, newValue)) { - if (!state.isSleeping) { - computedObservable["notifySubscribers"](state.latestValue, "beforeChange"); - } + hasSubscriptionsForEvent: function(event) { + return this._subscriptions[event] && this._subscriptions[event].length; + }, - state.latestValue = newValue; - if (DEBUG) computedObservable._latestValue = newValue; + getSubscriptionsCount: function (event) { + if (event) { + return this._subscriptions[event] && this._subscriptions[event].length || 0; + } else { + var total = 0; + ko.utils.objectForEach(this._subscriptions, function(eventName, subscriptions) { + if (eventName !== 'dirty') + total += subscriptions.length; + }); + return total; + } + }, - if (state.isSleeping) { - computedObservable.updateVersion(); - } else if (notifyChange) { - computedObservable["notifySubscribers"](state.latestValue); - } + isDifferent: function(oldValue, newValue) { + return !this['equalityComparer'] || !this['equalityComparer'](oldValue, newValue); + }, - changed = true; - } + toString: function() { + return '[object Object]' + }, - if (isInitial) { - computedObservable["notifySubscribers"](state.latestValue, "awake"); - } + extend: applyExtenders + }; - return changed; - }, - evaluateImmediate_CallReadThenEndDependencyDetection: function (state, dependencyDetectionContext) { - // This function is really part of the evaluateImmediate_CallReadWithDependencyDetection logic. - // You'd never call it from anywhere else. Factoring it out means that evaluateImmediate_CallReadWithDependencyDetection - // can be independent of try/finally blocks, which contributes to saving about 40% off the CPU - // overhead of computed evaluation (on V8 at least). - - try { - var readFunction = state.readFunction; - return state.evaluatorFunctionTarget ? readFunction.call(state.evaluatorFunctionTarget) : readFunction(); - } finally { - ko.dependencyDetection.end(); - - // For each subscription no longer being used, remove it from the active subscriptions list and dispose it - if (dependencyDetectionContext.disposalCount && !state.isSleeping) { - ko.utils.objectForEach(dependencyDetectionContext.disposalCandidates, computedDisposeDependencyCallback); - } + ko.exportProperty(ko_subscribable_fn, 'init', ko_subscribable_fn.init); + ko.exportProperty(ko_subscribable_fn, 'subscribe', ko_subscribable_fn.subscribe); + ko.exportProperty(ko_subscribable_fn, 'extend', ko_subscribable_fn.extend); + ko.exportProperty(ko_subscribable_fn, 'getSubscriptionsCount', ko_subscribable_fn.getSubscriptionsCount); - state.isStale = state.isDirty = false; - } - }, - peek: function (evaluate) { - // By default, peek won't re-evaluate, except while the computed is sleeping or to get the initial value when "deferEvaluation" is set. - // Pass in true to evaluate if needed. - var state = this[computedState]; - if ((state.isDirty && (evaluate || !state.dependenciesCount)) || (state.isSleeping && this.haveDependenciesChanged())) { - this.evaluateImmediate(); - } - return state.latestValue; - }, - limit: function (limitFunction) { - // Override the limit function with one that delays evaluation as well - ko.subscribable['fn'].limit.call(this, limitFunction); - this._evalIfChanged = function () { - if (this[computedState].isStale) { - this.evaluateImmediate(); - } else { - this[computedState].isDirty = false; - } - return this[computedState].latestValue; - }; - this._evalDelayed = function (isChange) { - this._limitBeforeChange(this[computedState].latestValue); - - // Mark as dirty - this[computedState].isDirty = true; - if (isChange) { - this[computedState].isStale = true; +// For browsers that support proto assignment, we overwrite the prototype of each +// observable instance. Since observables are functions, we need Function.prototype +// to still be in the prototype chain. + if (ko.utils.canSetPrototype) { + ko.utils.setPrototypeOf(ko_subscribable_fn, Function.prototype); } - // Pass the observable to the "limit" code, which will evaluate it when - // it's time to do the notification. - this._limitChange(this); - }; - }, - dispose: function () { - var state = this[computedState]; - if (!state.isSleeping && state.dependencyTracking) { - ko.utils.objectForEach(state.dependencyTracking, function (id, dependency) { - if (dependency.dispose) - dependency.dispose(); - }); - } - if (state.disposeWhenNodeIsRemoved && state.domNodeDisposalCallback) { - ko.utils.domNodeDisposal.removeDisposeCallback(state.disposeWhenNodeIsRemoved, state.domNodeDisposalCallback); - } - state.dependencyTracking = null; - state.dependenciesCount = 0; - state.isDisposed = true; - state.isStale = false; - state.isDirty = false; - state.isSleeping = false; - state.disposeWhenNodeIsRemoved = null; - } -}; - -var pureComputedOverrides = { - beforeSubscriptionAdd: function (event) { - // If asleep, wake up the computed by subscribing to any dependencies. - var computedObservable = this, - state = computedObservable[computedState]; - if (!state.isDisposed && state.isSleeping && event == 'change') { - state.isSleeping = false; - if (state.isStale || computedObservable.haveDependenciesChanged()) { - state.dependencyTracking = null; - state.dependenciesCount = 0; - if (computedObservable.evaluateImmediate()) { - computedObservable.updateVersion(); + ko.subscribable['fn'] = ko_subscribable_fn; + + + ko.isSubscribable = function (instance) { + return instance != null && typeof instance.subscribe == "function" && typeof instance["notifySubscribers"] == "function"; + }; + + ko.exportSymbol('subscribable', ko.subscribable); + ko.exportSymbol('isSubscribable', ko.isSubscribable); + + ko.computedContext = ko.dependencyDetection = (function () { + var outerFrames = [], + currentFrame, + lastId = 0; + + // Return a unique ID that can be assigned to an observable for dependency tracking. + // Theoretically, you could eventually overflow the number storage size, resulting + // in duplicate IDs. But in JavaScript, the largest exact integral value is 2^53 + // or 9,007,199,254,740,992. If you created 1,000,000 IDs per second, it would + // take over 285 years to reach that number. + // Reference http://blog.vjeux.com/2010/javascript/javascript-max_int-number-limits.html + function getId() { + return ++lastId; } - } else { - // First put the dependencies in order - var dependeciesOrder = []; - ko.utils.objectForEach(state.dependencyTracking, function (id, dependency) { - dependeciesOrder[dependency._order] = id; - }); - // Next, subscribe to each one - ko.utils.arrayForEach(dependeciesOrder, function (id, order) { - var dependency = state.dependencyTracking[id], - subscription = computedObservable.subscribeToDependency(dependency._target); - subscription._order = order; - subscription._version = dependency._version; - state.dependencyTracking[id] = subscription; - }); - } - if (!state.isDisposed) { // test since evaluating could trigger disposal - computedObservable["notifySubscribers"](state.latestValue, "awake"); - } - } - }, - afterSubscriptionRemove: function (event) { - var state = this[computedState]; - if (!state.isDisposed && event == 'change' && !this.hasSubscriptionsForEvent('change')) { - ko.utils.objectForEach(state.dependencyTracking, function (id, dependency) { - if (dependency.dispose) { - state.dependencyTracking[id] = { - _target: dependency._target, - _order: dependency._order, - _version: dependency._version - }; - dependency.dispose(); + + function begin(options) { + outerFrames.push(currentFrame); + currentFrame = options; } - }); - state.isSleeping = true; - this["notifySubscribers"](undefined, "asleep"); - } - }, - getVersion: function () { - // Because a pure computed is not automatically updated while it is sleeping, we can't - // simply return the version number. Instead, we check if any of the dependencies have - // changed and conditionally re-evaluate the computed observable. - var state = this[computedState]; - if (state.isSleeping && (state.isStale || this.haveDependenciesChanged())) { - this.evaluateImmediate(); - } - return ko.subscribable['fn'].getVersion.call(this); - } -}; - -var deferEvaluationOverrides = { - beforeSubscriptionAdd: function (event) { - // This will force a computed with deferEvaluation to evaluate when the first subscription is registered. - if (event == 'change' || event == 'beforeChange') { - this.peek(); - } - } -}; -// Note that for browsers that don't support proto assignment, the -// inheritance chain is created manually in the ko.computed constructor -if (ko.utils.canSetPrototype) { - ko.utils.setPrototypeOf(computedFn, ko.subscribable['fn']); -} - -// Set the proto chain values for ko.hasPrototype -var protoProp = ko.observable.protoProperty; // == "__ko_proto__" -ko.computed[protoProp] = ko.observable; -computedFn[protoProp] = ko.computed; - -ko.isComputed = function (instance) { - return ko.hasPrototype(instance, ko.computed); -}; - -ko.isPureComputed = function (instance) { - return ko.hasPrototype(instance, ko.computed) - && instance[computedState] && instance[computedState].pure; -}; - -ko.exportSymbol('computed', ko.computed); -ko.exportSymbol('dependentObservable', ko.computed); // export ko.dependentObservable for backwards compatibility (1.x) -ko.exportSymbol('isComputed', ko.isComputed); -ko.exportSymbol('isPureComputed', ko.isPureComputed); -ko.exportSymbol('computed.fn', computedFn); -ko.exportProperty(computedFn, 'peek', computedFn.peek); -ko.exportProperty(computedFn, 'dispose', computedFn.dispose); -ko.exportProperty(computedFn, 'isActive', computedFn.isActive); -ko.exportProperty(computedFn, 'getDependenciesCount', computedFn.getDependenciesCount); - -ko.pureComputed = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget) { - if (typeof evaluatorFunctionOrOptions === 'function') { - return ko.computed(evaluatorFunctionOrOptions, evaluatorFunctionTarget, {'pure':true}); - } else { - evaluatorFunctionOrOptions = ko.utils.extend({}, evaluatorFunctionOrOptions); // make a copy of the parameter object - evaluatorFunctionOrOptions['pure'] = true; - return ko.computed(evaluatorFunctionOrOptions, evaluatorFunctionTarget); - } -} -ko.exportSymbol('pureComputed', ko.pureComputed); - -(function() { - var maxNestedObservableDepth = 10; // Escape the (unlikely) pathalogical case where an observable's current value is itself (or similar reference cycle) - - ko.toJS = function(rootObject) { - if (arguments.length == 0) - throw new Error("When calling ko.toJS, pass the object you want to convert."); - - // We just unwrap everything at every level in the object graph - return mapJsObjectGraph(rootObject, function(valueToMap) { - // Loop because an observable's value might in turn be another observable wrapper - for (var i = 0; ko.isObservable(valueToMap) && (i < maxNestedObservableDepth); i++) - valueToMap = valueToMap(); - return valueToMap; - }); - }; - - ko.toJSON = function(rootObject, replacer, space) { // replacer and space are optional - var plainJavaScriptObject = ko.toJS(rootObject); - return ko.utils.stringifyJson(plainJavaScriptObject, replacer, space); - }; - - function mapJsObjectGraph(rootObject, mapInputCallback, visitedObjects) { - visitedObjects = visitedObjects || new objectLookup(); - - rootObject = mapInputCallback(rootObject); - var canHaveProperties = (typeof rootObject == "object") && (rootObject !== null) && (rootObject !== undefined) && (!(rootObject instanceof RegExp)) && (!(rootObject instanceof Date)) && (!(rootObject instanceof String)) && (!(rootObject instanceof Number)) && (!(rootObject instanceof Boolean)); - if (!canHaveProperties) - return rootObject; - - var outputProperties = rootObject instanceof Array ? [] : {}; - visitedObjects.save(rootObject, outputProperties); - - visitPropertiesOrArrayEntries(rootObject, function(indexer) { - var propertyValue = mapInputCallback(rootObject[indexer]); - - switch (typeof propertyValue) { - case "boolean": - case "number": - case "string": - case "function": - outputProperties[indexer] = propertyValue; - break; - case "object": - case "undefined": - var previouslyMappedValue = visitedObjects.get(propertyValue); - outputProperties[indexer] = (previouslyMappedValue !== undefined) - ? previouslyMappedValue - : mapJsObjectGraph(propertyValue, mapInputCallback, visitedObjects); - break; - } - }); - - return outputProperties; - } - - function visitPropertiesOrArrayEntries(rootObject, visitorCallback) { - if (rootObject instanceof Array) { - for (var i = 0; i < rootObject.length; i++) - visitorCallback(i); - - // For arrays, also respect toJSON property for custom mappings (fixes #278) - if (typeof rootObject['toJSON'] == 'function') - visitorCallback('toJSON'); - } else { - for (var propertyName in rootObject) { - visitorCallback(propertyName); - } - } - }; - - function objectLookup() { - this.keys = []; - this.values = []; - }; - - objectLookup.prototype = { - constructor: objectLookup, - save: function(key, value) { - var existingIndex = ko.utils.arrayIndexOf(this.keys, key); - if (existingIndex >= 0) - this.values[existingIndex] = value; - else { - this.keys.push(key); - this.values.push(value); - } - }, - get: function(key) { - var existingIndex = ko.utils.arrayIndexOf(this.keys, key); - return (existingIndex >= 0) ? this.values[existingIndex] : undefined; - } - }; -})(); + function end() { + currentFrame = outerFrames.pop(); + } -ko.exportSymbol('toJS', ko.toJS); -ko.exportSymbol('toJSON', ko.toJSON); -(function () { - var hasDomDataExpandoProperty = '__ko__hasDomDataOptionValue__'; - - // Normally, SELECT elements and their OPTIONs can only take value of type 'string' (because the values - // are stored on DOM attributes). ko.selectExtensions provides a way for SELECTs/OPTIONs to have values - // that are arbitrary objects. This is very convenient when implementing things like cascading dropdowns. - ko.selectExtensions = { - readValue : function(element) { - switch (ko.utils.tagNameLower(element)) { - case 'option': - if (element[hasDomDataExpandoProperty] === true) - return ko.utils.domData.get(element, ko.bindingHandlers.options.optionValueDomDataKey); - return ko.utils.ieVersion <= 7 - ? (element.getAttributeNode('value') && element.getAttributeNode('value').specified ? element.value : element.text) - : element.value; - case 'select': - return element.selectedIndex >= 0 ? ko.selectExtensions.readValue(element.options[element.selectedIndex]) : undefined; - default: - return element.value; - } - }, - - writeValue: function(element, value, allowUnset) { - switch (ko.utils.tagNameLower(element)) { - case 'option': - switch(typeof value) { - case "string": - ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, undefined); - if (hasDomDataExpandoProperty in element) { // IE <= 8 throws errors if you delete non-existent properties from a DOM node - delete element[hasDomDataExpandoProperty]; - } - element.value = value; - break; - default: - // Store arbitrary object using DomData - ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, value); - element[hasDomDataExpandoProperty] = true; + return { + begin: begin, - // Special treatment of numbers is just for backward compatibility. KO 1.2.1 wrote numerical values to element.value. - element.value = typeof value === "number" ? value : ""; - break; + end: end, + + registerDependency: function (subscribable) { + if (currentFrame) { + if (!ko.isSubscribable(subscribable)) + throw new Error("Only subscribable things can act as dependencies"); + currentFrame.callback.call(currentFrame.callbackTarget, subscribable, subscribable._id || (subscribable._id = getId())); + } + }, + + ignore: function (callback, callbackTarget, callbackArgs) { + try { + begin(); + return callback.apply(callbackTarget, callbackArgs || []); + } finally { + end(); + } + }, + + getDependenciesCount: function () { + if (currentFrame) + return currentFrame.computed.getDependenciesCount(); + }, + + getDependencies: function () { + if (currentFrame) + return currentFrame.computed.getDependencies(); + }, + + isInitial: function() { + if (currentFrame) + return currentFrame.isInitial; + }, + + computed: function() { + if (currentFrame) + return currentFrame.computed; } - break; - case 'select': - if (value === "" || value === null) // A blank string or null value will select the caption - value = undefined; - var selection = -1; - for (var i = 0, n = element.options.length, optionValue; i < n; ++i) { - optionValue = ko.selectExtensions.readValue(element.options[i]); - // Include special check to handle selecting a caption with a blank string value - if (optionValue == value || (optionValue == "" && value === undefined)) { - selection = i; - break; + }; + })(); + + ko.exportSymbol('computedContext', ko.computedContext); + ko.exportSymbol('computedContext.getDependenciesCount', ko.computedContext.getDependenciesCount); + ko.exportSymbol('computedContext.getDependencies', ko.computedContext.getDependencies); + ko.exportSymbol('computedContext.isInitial', ko.computedContext.isInitial); + ko.exportSymbol('computedContext.registerDependency', ko.computedContext.registerDependency); + + ko.exportSymbol('ignoreDependencies', ko.ignoreDependencies = ko.dependencyDetection.ignore); + var observableLatestValue = ko.utils.createSymbolOrString('_latestValue'); + + ko.observable = function (initialValue) { + function observable() { + if (arguments.length > 0) { + // Write + + // Ignore writes if the value hasn't changed + if (observable.isDifferent(observable[observableLatestValue], arguments[0])) { + observable.valueWillMutate(); + observable[observableLatestValue] = arguments[0]; + observable.valueHasMutated(); } + return this; // Permits chained assignments } - if (allowUnset || selection >= 0 || (value === undefined && element.size > 1)) { - element.selectedIndex = selection; + else { + // Read + ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a "read" operation + return observable[observableLatestValue]; } - break; - default: - if ((value === null) || (value === undefined)) - value = ""; - element.value = value; - break; - } - } - }; -})(); - -ko.exportSymbol('selectExtensions', ko.selectExtensions); -ko.exportSymbol('selectExtensions.readValue', ko.selectExtensions.readValue); -ko.exportSymbol('selectExtensions.writeValue', ko.selectExtensions.writeValue); -ko.expressionRewriting = (function () { - var javaScriptReservedWords = ["true", "false", "null", "undefined"]; - - // Matches something that can be assigned to--either an isolated identifier or something ending with a property accessor - // This is designed to be simple and avoid false negatives, but could produce false positives (e.g., a+b.c). - // This also will not properly handle nested brackets (e.g., obj1[obj2['prop']]; see #911). - var javaScriptAssignmentTarget = /^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i; - - function getWriteableValue(expression) { - if (ko.utils.arrayIndexOf(javaScriptReservedWords, expression) >= 0) - return false; - var match = expression.match(javaScriptAssignmentTarget); - return match === null ? false : match[1] ? ('Object(' + match[1] + ')' + match[2]) : expression; - } - - // The following regular expressions will be used to split an object-literal string into tokens - - // These two match strings, either with double quotes or single quotes - var stringDouble = '"(?:[^"\\\\]|\\\\.)*"', - stringSingle = "'(?:[^'\\\\]|\\\\.)*'", - // Matches a regular expression (text enclosed by slashes), but will also match sets of divisions - // as a regular expression (this is handled by the parsing loop below). - stringRegexp = '/(?:[^/\\\\]|\\\\.)*/\w*', - // These characters have special meaning to the parser and must not appear in the middle of a - // token, except as part of a string. - specials = ',"\'{}()/:[\\]', - // Match text (at least two characters) that does not contain any of the above special characters, - // although some of the special characters are allowed to start it (all but the colon and comma). - // The text can contain spaces, but leading or trailing spaces are skipped. - everyThingElse = '[^\\s:,/][^' + specials + ']*[^\\s' + specials + ']', - // Match any non-space character not matched already. This will match colons and commas, since they're - // not matched by "everyThingElse", but will also match any other single character that wasn't already - // matched (for example: in "a: 1, b: 2", each of the non-space characters will be matched by oneNotSpace). - oneNotSpace = '[^\\s]', - - // Create the actual regular expression by or-ing the above strings. The order is important. - bindingToken = RegExp(stringDouble + '|' + stringSingle + '|' + stringRegexp + '|' + everyThingElse + '|' + oneNotSpace, 'g'), - - // Match end of previous token to determine whether a slash is a division or regex. - divisionLookBehind = /[\])"'A-Za-z0-9_$]+$/, - keywordRegexLookBehind = {'in':1,'return':1,'typeof':1}; - - function parseObjectLiteral(objectLiteralString) { - // Trim leading and trailing spaces from the string - var str = ko.utils.stringTrim(objectLiteralString); - - // Trim braces '{' surrounding the whole object literal - if (str.charCodeAt(0) === 123) str = str.slice(1, -1); - - // Split into tokens - var result = [], toks = str.match(bindingToken), key, values = [], depth = 0; - - if (toks) { - // Append a comma so that we don't need a separate code block to deal with the last item - toks.push(','); - - for (var i = 0, tok; tok = toks[i]; ++i) { - var c = tok.charCodeAt(0); - // A comma signals the end of a key/value pair if depth is zero - if (c === 44) { // "," - if (depth <= 0) { - result.push((key && values.length) ? {key: key, value: values.join('')} : {'unknown': key || values.join('')}); - key = depth = 0; - values = []; - continue; - } - // Simply skip the colon that separates the name and value - } else if (c === 58) { // ":" - if (!depth && !key && values.length === 1) { - key = values.pop(); - continue; - } - // A set of slashes is initially matched as a regular expression, but could be division - } else if (c === 47 && i && tok.length > 1) { // "/" - // Look at the end of the previous token to determine if the slash is actually division - var match = toks[i-1].match(divisionLookBehind); - if (match && !keywordRegexLookBehind[match[0]]) { - // The slash is actually a division punctuator; re-parse the remainder of the string (not including the slash) - str = str.substr(str.indexOf(tok) + 1); - toks = str.match(bindingToken); - toks.push(','); - i = -1; - // Continue with just the slash - tok = '/'; - } - // Increment depth for parentheses, braces, and brackets so that interior commas are ignored - } else if (c === 40 || c === 123 || c === 91) { // '(', '{', '[' - ++depth; - } else if (c === 41 || c === 125 || c === 93) { // ')', '}', ']' - --depth; - // The key will be the first token; if it's a string, trim the quotes - } else if (!key && !values.length && (c === 34 || c === 39)) { // '"', "'" - tok = tok.slice(1, -1); - } - values.push(tok); - } - } - return result; - } + } - // Two-way bindings include a write function that allow the handler to update the value even if it's not an observable. - var twoWayBindings = {}; + observable[observableLatestValue] = initialValue; - function preProcessBindings(bindingsStringOrKeyValueArray, bindingOptions) { - bindingOptions = bindingOptions || {}; + // Inherit from 'subscribable' + if (!ko.utils.canSetPrototype) { + // 'subscribable' won't be on the prototype chain unless we put it there directly + ko.utils.extend(observable, ko.subscribable['fn']); + } + ko.subscribable['fn'].init(observable); - function processKeyValue(key, val) { - var writableVal; - function callPreprocessHook(obj) { - return (obj && obj['preprocess']) ? (val = obj['preprocess'](val, key, processKeyValue)) : true; - } - if (!bindingParams) { - if (!callPreprocessHook(ko['getBindingHandler'](key))) - return; + // Inherit from 'observable' + ko.utils.setPrototypeOfOrExtend(observable, observableFn); - if (twoWayBindings[key] && (writableVal = getWriteableValue(val))) { - // For two-way bindings, provide a write method in case the value - // isn't a writable observable. - propertyAccessorResultStrings.push("'" + key + "':function(_z){" + writableVal + "=_z}"); + if (ko.options['deferUpdates']) { + ko.extenders['deferred'](observable, true); } - } - // Values are wrapped in a function so that each value can be accessed independently - if (makeValueAccessors) { - val = 'function(){return ' + val + ' }'; - } - resultStrings.push("'" + key + "':" + val); - } - var resultStrings = [], - propertyAccessorResultStrings = [], - makeValueAccessors = bindingOptions['valueAccessors'], - bindingParams = bindingOptions['bindingParams'], - keyValueArray = typeof bindingsStringOrKeyValueArray === "string" ? - parseObjectLiteral(bindingsStringOrKeyValueArray) : bindingsStringOrKeyValueArray; + return observable; + } - ko.utils.arrayForEach(keyValueArray, function(keyValue) { - processKeyValue(keyValue.key || keyValue['unknown'], keyValue.value); - }); +// Define prototype for observables + var observableFn = { + 'equalityComparer': valuesArePrimitiveAndEqual, + peek: function() { return this[observableLatestValue]; }, + valueHasMutated: function () { + this['notifySubscribers'](this[observableLatestValue], 'spectate'); + this['notifySubscribers'](this[observableLatestValue]); + }, + valueWillMutate: function () { this['notifySubscribers'](this[observableLatestValue], 'beforeChange'); } + }; - if (propertyAccessorResultStrings.length) - processKeyValue('_ko_property_writers', "{" + propertyAccessorResultStrings.join(",") + " }"); +// Note that for browsers that don't support proto assignment, the +// inheritance chain is created manually in the ko.observable constructor + if (ko.utils.canSetPrototype) { + ko.utils.setPrototypeOf(observableFn, ko.subscribable['fn']); + } - return resultStrings.join(","); - } + var protoProperty = ko.observable.protoProperty = '__ko_proto__'; + observableFn[protoProperty] = ko.observable; - return { - bindingRewriteValidators: [], + ko.isObservable = function (instance) { + var proto = typeof instance == 'function' && instance[protoProperty]; + if (proto && proto !== observableFn[protoProperty] && proto !== ko.computed['fn'][protoProperty]) { + throw Error("Invalid object that looks like an observable; possibly from another Knockout instance"); + } + return !!proto; + }; - twoWayBindings: twoWayBindings, + ko.isWriteableObservable = function (instance) { + return (typeof instance == 'function' && ( + (instance[protoProperty] === observableFn[protoProperty]) || // Observable + (instance[protoProperty] === ko.computed['fn'][protoProperty] && instance.hasWriteFunction))); // Writable computed observable + }; - parseObjectLiteral: parseObjectLiteral, + ko.exportSymbol('observable', ko.observable); + ko.exportSymbol('isObservable', ko.isObservable); + ko.exportSymbol('isWriteableObservable', ko.isWriteableObservable); + ko.exportSymbol('isWritableObservable', ko.isWriteableObservable); + ko.exportSymbol('observable.fn', observableFn); + ko.exportProperty(observableFn, 'peek', observableFn.peek); + ko.exportProperty(observableFn, 'valueHasMutated', observableFn.valueHasMutated); + ko.exportProperty(observableFn, 'valueWillMutate', observableFn.valueWillMutate); + ko.observableArray = function (initialValues) { + initialValues = initialValues || []; + + if (typeof initialValues != 'object' || !('length' in initialValues)) + throw new Error("The argument passed when initializing an observable array must be an array, or null, or undefined."); + + var result = ko.observable(initialValues); + ko.utils.setPrototypeOfOrExtend(result, ko.observableArray['fn']); + return result.extend({'trackArrayChanges':true}); + }; - preProcessBindings: preProcessBindings, + ko.observableArray['fn'] = { + 'remove': function (valueOrPredicate) { + var underlyingArray = this.peek(); + var removedValues = []; + var predicate = typeof valueOrPredicate == "function" && !ko.isObservable(valueOrPredicate) ? valueOrPredicate : function (value) { return value === valueOrPredicate; }; + for (var i = 0; i < underlyingArray.length; i++) { + var value = underlyingArray[i]; + if (predicate(value)) { + if (removedValues.length === 0) { + this.valueWillMutate(); + } + if (underlyingArray[i] !== value) { + throw Error("Array modified during remove; cannot remove item"); + } + removedValues.push(value); + underlyingArray.splice(i, 1); + i--; + } + } + if (removedValues.length) { + this.valueHasMutated(); + } + return removedValues; + }, - keyValueArrayContainsKey: function(keyValueArray, key) { - for (var i = 0; i < keyValueArray.length; i++) - if (keyValueArray[i]['key'] == key) - return true; - return false; - }, - - // Internal, private KO utility for updating model properties from within bindings - // property: If the property being updated is (or might be) an observable, pass it here - // If it turns out to be a writable observable, it will be written to directly - // allBindings: An object with a get method to retrieve bindings in the current execution context. - // This will be searched for a '_ko_property_writers' property in case you're writing to a non-observable - // key: The key identifying the property to be written. Example: for { hasFocus: myValue }, write to 'myValue' by specifying the key 'hasFocus' - // value: The value to be written - // checkIfDifferent: If true, and if the property being written is a writable observable, the value will only be written if - // it is !== existing value on that writable observable - writeValueToProperty: function(property, allBindings, key, value, checkIfDifferent) { - if (!property || !ko.isObservable(property)) { - var propWriters = allBindings.get('_ko_property_writers'); - if (propWriters && propWriters[key]) - propWriters[key](value); - } else if (ko.isWriteableObservable(property) && (!checkIfDifferent || property.peek() !== value)) { - property(value); - } - } - }; -})(); + 'removeAll': function (arrayOfValues) { + // If you passed zero args, we remove everything + if (arrayOfValues === undefined) { + var underlyingArray = this.peek(); + var allValues = underlyingArray.slice(0); + this.valueWillMutate(); + underlyingArray.splice(0, underlyingArray.length); + this.valueHasMutated(); + return allValues; + } + // If you passed an arg, we interpret it as an array of entries to remove + if (!arrayOfValues) + return []; + return this['remove'](function (value) { + return ko.utils.arrayIndexOf(arrayOfValues, value) >= 0; + }); + }, -ko.exportSymbol('expressionRewriting', ko.expressionRewriting); -ko.exportSymbol('expressionRewriting.bindingRewriteValidators', ko.expressionRewriting.bindingRewriteValidators); -ko.exportSymbol('expressionRewriting.parseObjectLiteral', ko.expressionRewriting.parseObjectLiteral); -ko.exportSymbol('expressionRewriting.preProcessBindings', ko.expressionRewriting.preProcessBindings); + 'destroy': function (valueOrPredicate) { + var underlyingArray = this.peek(); + var predicate = typeof valueOrPredicate == "function" && !ko.isObservable(valueOrPredicate) ? valueOrPredicate : function (value) { return value === valueOrPredicate; }; + this.valueWillMutate(); + for (var i = underlyingArray.length - 1; i >= 0; i--) { + var value = underlyingArray[i]; + if (predicate(value)) + value["_destroy"] = true; + } + this.valueHasMutated(); + }, -// Making bindings explicitly declare themselves as "two way" isn't ideal in the long term (it would be better if -// all bindings could use an official 'property writer' API without needing to declare that they might). However, -// since this is not, and has never been, a public API (_ko_property_writers was never documented), it's acceptable -// as an internal implementation detail in the short term. -// For those developers who rely on _ko_property_writers in their custom bindings, we expose _twoWayBindings as an -// undocumented feature that makes it relatively easy to upgrade to KO 3.0. However, this is still not an official -// public API, and we reserve the right to remove it at any time if we create a real public property writers API. -ko.exportSymbol('expressionRewriting._twoWayBindings', ko.expressionRewriting.twoWayBindings); + 'destroyAll': function (arrayOfValues) { + // If you passed zero args, we destroy everything + if (arrayOfValues === undefined) + return this['destroy'](function() { return true }); -// For backward compatibility, define the following aliases. (Previously, these function names were misleading because -// they referred to JSON specifically, even though they actually work with arbitrary JavaScript object literal expressions.) -ko.exportSymbol('jsonExpressionRewriting', ko.expressionRewriting); -ko.exportSymbol('jsonExpressionRewriting.insertPropertyAccessorsIntoJson', ko.expressionRewriting.preProcessBindings); -(function() { - // "Virtual elements" is an abstraction on top of the usual DOM API which understands the notion that comment nodes - // may be used to represent hierarchy (in addition to the DOM's natural hierarchy). - // If you call the DOM-manipulating functions on ko.virtualElements, you will be able to read and write the state - // of that virtual hierarchy - // - // The point of all this is to support containerless templates (e.g., <!-- ko foreach:someCollection -->blah<!-- /ko -->) - // without having to scatter special cases all over the binding and templating code. - - // IE 9 cannot reliably read the "nodeValue" property of a comment node (see https://github.com/SteveSanderson/knockout/issues/186) - // but it does give them a nonstandard alternative property called "text" that it can read reliably. Other browsers don't have that property. - // So, use node.text where available, and node.nodeValue elsewhere - var commentNodesHaveTextProperty = document && document.createComment("test").text === "<!--test-->"; - - var startCommentRegex = commentNodesHaveTextProperty ? /^<!--\s*ko(?:\s+([\s\S]+))?\s*-->$/ : /^\s*ko(?:\s+([\s\S]+))?\s*$/; - var endCommentRegex = commentNodesHaveTextProperty ? /^<!--\s*\/ko\s*-->$/ : /^\s*\/ko\s*$/; - var htmlTagsWithOptionallyClosingChildren = { 'ul': true, 'ol': true }; - - function isStartComment(node) { - return (node.nodeType == 8) && startCommentRegex.test(commentNodesHaveTextProperty ? node.text : node.nodeValue); - } - - function isEndComment(node) { - return (node.nodeType == 8) && endCommentRegex.test(commentNodesHaveTextProperty ? node.text : node.nodeValue); - } - - function getVirtualChildren(startComment, allowUnbalanced) { - var currentNode = startComment; - var depth = 1; - var children = []; - while (currentNode = currentNode.nextSibling) { - if (isEndComment(currentNode)) { - depth--; - if (depth === 0) - return children; - } + // If you passed an arg, we interpret it as an array of entries to destroy + if (!arrayOfValues) + return []; + return this['destroy'](function (value) { + return ko.utils.arrayIndexOf(arrayOfValues, value) >= 0; + }); + }, - children.push(currentNode); + 'indexOf': function (item) { + var underlyingArray = this(); + return ko.utils.arrayIndexOf(underlyingArray, item); + }, - if (isStartComment(currentNode)) - depth++; - } - if (!allowUnbalanced) - throw new Error("Cannot find closing comment tag to match: " + startComment.nodeValue); - return null; - } - - function getMatchingEndComment(startComment, allowUnbalanced) { - var allVirtualChildren = getVirtualChildren(startComment, allowUnbalanced); - if (allVirtualChildren) { - if (allVirtualChildren.length > 0) - return allVirtualChildren[allVirtualChildren.length - 1].nextSibling; - return startComment.nextSibling; - } else - return null; // Must have no matching end comment, and allowUnbalanced is true - } - - function getUnbalancedChildTags(node) { - // e.g., from <div>OK</div><!-- ko blah --><span>Another</span>, returns: <!-- ko blah --><span>Another</span> - // from <div>OK</div><!-- /ko --><!-- /ko -->, returns: <!-- /ko --><!-- /ko --> - var childNode = node.firstChild, captureRemaining = null; - if (childNode) { - do { - if (captureRemaining) // We already hit an unbalanced node and are now just scooping up all subsequent nodes - captureRemaining.push(childNode); - else if (isStartComment(childNode)) { - var matchingEndComment = getMatchingEndComment(childNode, /* allowUnbalanced: */ true); - if (matchingEndComment) // It's a balanced tag, so skip immediately to the end of this virtual set - childNode = matchingEndComment; - else - captureRemaining = [childNode]; // It's unbalanced, so start capturing from this point - } else if (isEndComment(childNode)) { - captureRemaining = [childNode]; // It's unbalanced (if it wasn't, we'd have skipped over it already), so start capturing - } - } while (childNode = childNode.nextSibling); - } - return captureRemaining; - } - - ko.virtualElements = { - allowedBindings: {}, - - childNodes: function(node) { - return isStartComment(node) ? getVirtualChildren(node) : node.childNodes; - }, - - emptyNode: function(node) { - if (!isStartComment(node)) - ko.utils.emptyDomNode(node); - else { - var virtualChildren = ko.virtualElements.childNodes(node); - for (var i = 0, j = virtualChildren.length; i < j; i++) - ko.removeNode(virtualChildren[i]); - } - }, - - setDomNodeChildren: function(node, childNodes) { - if (!isStartComment(node)) - ko.utils.setDomNodeChildren(node, childNodes); - else { - ko.virtualElements.emptyNode(node); - var endCommentNode = node.nextSibling; // Must be the next sibling, as we just emptied the children - for (var i = 0, j = childNodes.length; i < j; i++) - endCommentNode.parentNode.insertBefore(childNodes[i], endCommentNode); - } - }, - - prepend: function(containerNode, nodeToPrepend) { - if (!isStartComment(containerNode)) { - if (containerNode.firstChild) - containerNode.insertBefore(nodeToPrepend, containerNode.firstChild); - else - containerNode.appendChild(nodeToPrepend); - } else { - // Start comments must always have a parent and at least one following sibling (the end comment) - containerNode.parentNode.insertBefore(nodeToPrepend, containerNode.nextSibling); - } - }, - - insertAfter: function(containerNode, nodeToInsert, insertAfterNode) { - if (!insertAfterNode) { - ko.virtualElements.prepend(containerNode, nodeToInsert); - } else if (!isStartComment(containerNode)) { - // Insert after insertion point - if (insertAfterNode.nextSibling) - containerNode.insertBefore(nodeToInsert, insertAfterNode.nextSibling); - else - containerNode.appendChild(nodeToInsert); - } else { - // Children of start comments must always have a parent and at least one following sibling (the end comment) - containerNode.parentNode.insertBefore(nodeToInsert, insertAfterNode.nextSibling); - } - }, - - firstChild: function(node) { - if (!isStartComment(node)) - return node.firstChild; - if (!node.nextSibling || isEndComment(node.nextSibling)) - return null; - return node.nextSibling; - }, - - nextSibling: function(node) { - if (isStartComment(node)) - node = getMatchingEndComment(node); - if (node.nextSibling && isEndComment(node.nextSibling)) - return null; - return node.nextSibling; - }, - - hasBindingValue: isStartComment, - - virtualNodeBindingValue: function(node) { - var regexMatch = (commentNodesHaveTextProperty ? node.text : node.nodeValue).match(startCommentRegex); - return regexMatch ? regexMatch[1] : null; - }, - - normaliseVirtualElementDomStructure: function(elementVerified) { - // Workaround for https://github.com/SteveSanderson/knockout/issues/155 - // (IE <= 8 or IE 9 quirks mode parses your HTML weirdly, treating closing </li> tags as if they don't exist, thereby moving comment nodes - // that are direct descendants of <ul> into the preceding <li>) - if (!htmlTagsWithOptionallyClosingChildren[ko.utils.tagNameLower(elementVerified)]) - return; - - // Scan immediate children to see if they contain unbalanced comment tags. If they do, those comment tags - // must be intended to appear *after* that child, so move them there. - var childNode = elementVerified.firstChild; - if (childNode) { - do { - if (childNode.nodeType === 1) { - var unbalancedTags = getUnbalancedChildTags(childNode); - if (unbalancedTags) { - // Fix up the DOM by moving the unbalanced tags to where they most likely were intended to be placed - *after* the child - var nodeToInsertBefore = childNode.nextSibling; - for (var i = 0; i < unbalancedTags.length; i++) { - if (nodeToInsertBefore) - elementVerified.insertBefore(unbalancedTags[i], nodeToInsertBefore); - else - elementVerified.appendChild(unbalancedTags[i]); - } - } + 'replace': function(oldItem, newItem) { + var index = this['indexOf'](oldItem); + if (index >= 0) { + this.valueWillMutate(); + this.peek()[index] = newItem; + this.valueHasMutated(); } - } while (childNode = childNode.nextSibling); - } - } - }; -})(); -ko.exportSymbol('virtualElements', ko.virtualElements); -ko.exportSymbol('virtualElements.allowedBindings', ko.virtualElements.allowedBindings); -ko.exportSymbol('virtualElements.emptyNode', ko.virtualElements.emptyNode); -//ko.exportSymbol('virtualElements.firstChild', ko.virtualElements.firstChild); // firstChild is not minified -ko.exportSymbol('virtualElements.insertAfter', ko.virtualElements.insertAfter); -//ko.exportSymbol('virtualElements.nextSibling', ko.virtualElements.nextSibling); // nextSibling is not minified -ko.exportSymbol('virtualElements.prepend', ko.virtualElements.prepend); -ko.exportSymbol('virtualElements.setDomNodeChildren', ko.virtualElements.setDomNodeChildren); -(function() { - var defaultBindingAttributeName = "data-bind"; - - ko.bindingProvider = function() { - this.bindingCache = {}; - }; - - ko.utils.extend(ko.bindingProvider.prototype, { - 'nodeHasBindings': function(node) { - switch (node.nodeType) { - case 1: // Element - return node.getAttribute(defaultBindingAttributeName) != null - || ko.components['getComponentNameForNode'](node); - case 8: // Comment node - return ko.virtualElements.hasBindingValue(node); - default: return false; - } - }, - - 'getBindings': function(node, bindingContext) { - var bindingsString = this['getBindingsString'](node, bindingContext), - parsedBindings = bindingsString ? this['parseBindingsString'](bindingsString, bindingContext, node) : null; - return ko.components.addBindingsForCustomElement(parsedBindings, node, bindingContext, /* valueAccessors */ false); - }, - - 'getBindingAccessors': function(node, bindingContext) { - var bindingsString = this['getBindingsString'](node, bindingContext), - parsedBindings = bindingsString ? this['parseBindingsString'](bindingsString, bindingContext, node, { 'valueAccessors': true }) : null; - return ko.components.addBindingsForCustomElement(parsedBindings, node, bindingContext, /* valueAccessors */ true); - }, - - // The following function is only used internally by this default provider. - // It's not part of the interface definition for a general binding provider. - 'getBindingsString': function(node, bindingContext) { - switch (node.nodeType) { - case 1: return node.getAttribute(defaultBindingAttributeName); // Element - case 8: return ko.virtualElements.virtualNodeBindingValue(node); // Comment node - default: return null; - } - }, - - // The following function is only used internally by this default provider. - // It's not part of the interface definition for a general binding provider. - 'parseBindingsString': function(bindingsString, bindingContext, node, options) { - try { - var bindingFunction = createBindingsStringEvaluatorViaCache(bindingsString, this.bindingCache, options); - return bindingFunction(bindingContext, node); - } catch (ex) { - ex.message = "Unable to parse bindings.\nBindings value: " + bindingsString + "\nMessage: " + ex.message; - throw ex; - } - } - }); - - ko.bindingProvider['instance'] = new ko.bindingProvider(); - - function createBindingsStringEvaluatorViaCache(bindingsString, cache, options) { - var cacheKey = bindingsString + (options && options['valueAccessors'] || ''); - return cache[cacheKey] - || (cache[cacheKey] = createBindingsStringEvaluator(bindingsString, options)); - } - - function createBindingsStringEvaluator(bindingsString, options) { - // Build the source for a function that evaluates "expression" - // For each scope variable, add an extra level of "with" nesting - // Example result: with(sc1) { with(sc0) { return (expression) } } - var rewrittenBindings = ko.expressionRewriting.preProcessBindings(bindingsString, options), - functionBody = "with($context){with($data||{}){return{" + rewrittenBindings + "}}}"; - return new Function("$context", "$element", functionBody); - } -})(); + }, -ko.exportSymbol('bindingProvider', ko.bindingProvider); -(function () { - ko.bindingHandlers = {}; - - // The following element types will not be recursed into during binding. - var bindingDoesNotRecurseIntoElementTypes = { - // Don't want bindings that operate on text nodes to mutate <script> and <textarea> contents, - // because it's unexpected and a potential XSS issue. - // Also bindings should not operate on <template> elements since this breaks in Internet Explorer - // and because such elements' contents are always intended to be bound in a different context - // from where they appear in the document. - 'script': true, - 'textarea': true, - 'template': true - }; - - // Use an overridable method for retrieving binding handlers so that a plugins may support dynamically created handlers - ko['getBindingHandler'] = function(bindingKey) { - return ko.bindingHandlers[bindingKey]; - }; - - // The ko.bindingContext constructor is only called directly to create the root context. For child - // contexts, use bindingContext.createChildContext or bindingContext.extend. - ko.bindingContext = function(dataItemOrAccessor, parentContext, dataItemAlias, extendCallback, options) { - - // The binding context object includes static properties for the current, parent, and root view models. - // If a view model is actually stored in an observable, the corresponding binding context object, and - // any child contexts, must be updated when the view model is changed. - function updateContext() { - // Most of the time, the context will directly get a view model object, but if a function is given, - // we call the function to retrieve the view model. If the function accesses any observables or returns - // an observable, the dependency is tracked, and those observables can later cause the binding - // context to be updated. - var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor, - dataItem = ko.utils.unwrapObservable(dataItemOrObservable); - - if (parentContext) { - // When a "parent" context is given, register a dependency on the parent context. Thus whenever the - // parent context is updated, this context will also be updated. - if (parentContext._subscribable) - parentContext._subscribable(); - - // Copy $root and any custom properties from the parent context - ko.utils.extend(self, parentContext); - - // Because the above copy overwrites our own properties, we need to reset them. - self._subscribable = subscribable; - } else { - self['$parents'] = []; - self['$root'] = dataItem; + 'sorted': function (compareFunction) { + var arrayCopy = this().slice(0); + return compareFunction ? arrayCopy.sort(compareFunction) : arrayCopy.sort(); + }, - // Export 'ko' in the binding context so it will be available in bindings and templates - // even if 'ko' isn't exported as a global, such as when using an AMD loader. - // See https://github.com/SteveSanderson/knockout/issues/490 - self['ko'] = ko; - } - self['$rawData'] = dataItemOrObservable; - self['$data'] = dataItem; - if (dataItemAlias) - self[dataItemAlias] = dataItem; - - // The extendCallback function is provided when creating a child context or extending a context. - // It handles the specific actions needed to finish setting up the binding context. Actions in this - // function could also add dependencies to this binding context. - if (extendCallback) - extendCallback(self, parentContext, dataItem); - - return self['$data']; - } - function disposeWhen() { - return nodes && !ko.utils.anyDomNodeIsAttachedToDocument(nodes); - } + 'reversed': function () { + return this().slice(0).reverse(); + } + }; - var self = this, - isFunc = typeof(dataItemOrAccessor) == "function" && !ko.isObservable(dataItemOrAccessor), - nodes, - subscribable; - - if (options && options['exportDependencies']) { - // The "exportDependencies" option means that the calling code will track any dependencies and re-create - // the binding context when they change. - updateContext(); - } else { - subscribable = ko.dependentObservable(updateContext, null, { disposeWhen: disposeWhen, disposeWhenNodeIsRemoved: true }); - - // At this point, the binding context has been initialized, and the "subscribable" computed observable is - // subscribed to any observables that were accessed in the process. If there is nothing to track, the - // computed will be inactive, and we can safely throw it away. If it's active, the computed is stored in - // the context object. - if (subscribable.isActive()) { - self._subscribable = subscribable; - - // Always notify because even if the model ($data) hasn't changed, other context properties might have changed - subscribable['equalityComparer'] = null; - - // We need to be able to dispose of this computed observable when it's no longer needed. This would be - // easy if we had a single node to watch, but binding contexts can be used by many different nodes, and - // we cannot assume that those nodes have any relation to each other. So instead we track any node that - // the context is attached to, and dispose the computed when all of those nodes have been cleaned. - - // Add properties to *subscribable* instead of *self* because any properties added to *self* may be overwritten on updates - nodes = []; - subscribable._addNode = function(node) { - nodes.push(node); - ko.utils.domNodeDisposal.addDisposeCallback(node, function(node) { - ko.utils.arrayRemoveItem(nodes, node); - if (!nodes.length) { - subscribable.dispose(); - self._subscribable = subscribable = undefined; - } - }); - }; +// Note that for browsers that don't support proto assignment, the +// inheritance chain is created manually in the ko.observableArray constructor + if (ko.utils.canSetPrototype) { + ko.utils.setPrototypeOf(ko.observableArray['fn'], ko.observable['fn']); } - } - } - - // Extend the binding context hierarchy with a new view model object. If the parent context is watching - // any observables, the new child context will automatically get a dependency on the parent context. - // But this does not mean that the $data value of the child context will also get updated. If the child - // view model also depends on the parent view model, you must provide a function that returns the correct - // view model on each update. - ko.bindingContext.prototype['createChildContext'] = function (dataItemOrAccessor, dataItemAlias, extendCallback, options) { - return new ko.bindingContext(dataItemOrAccessor, this, dataItemAlias, function(self, parentContext) { - // Extend the context hierarchy by setting the appropriate pointers - self['$parentContext'] = parentContext; - self['$parent'] = parentContext['$data']; - self['$parents'] = (parentContext['$parents'] || []).slice(0); - self['$parents'].unshift(self['$parent']); - if (extendCallback) - extendCallback(self); - }, options); - }; - - // Extend the binding context with new custom properties. This doesn't change the context hierarchy. - // Similarly to "child" contexts, provide a function here to make sure that the correct values are set - // when an observable view model is updated. - ko.bindingContext.prototype['extend'] = function(properties) { - // If the parent context references an observable view model, "_subscribable" will always be the - // latest view model object. If not, "_subscribable" isn't set, and we can use the static "$data" value. - return new ko.bindingContext(this._subscribable || this['$data'], this, null, function(self, parentContext) { - // This "child" context doesn't directly track a parent observable view model, - // so we need to manually set the $rawData value to match the parent. - self['$rawData'] = parentContext['$rawData']; - ko.utils.extend(self, typeof(properties) == "function" ? properties() : properties); - }); - }; - - ko.bindingContext.prototype.createStaticChildContext = function (dataItemOrAccessor, dataItemAlias) { - return this['createChildContext'](dataItemOrAccessor, dataItemAlias, null, { "exportDependencies": true }); - }; - - // Returns the valueAccesor function for a binding value - function makeValueAccessor(value) { - return function() { - return value; - }; - } - - // Returns the value of a valueAccessor function - function evaluateValueAccessor(valueAccessor) { - return valueAccessor(); - } - - // Given a function that returns bindings, create and return a new object that contains - // binding value-accessors functions. Each accessor function calls the original function - // so that it always gets the latest value and all dependencies are captured. This is used - // by ko.applyBindingsToNode and getBindingsAndMakeAccessors. - function makeAccessorsFromFunction(callback) { - return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) { - return function() { - return callback()[key]; + +// Populate ko.observableArray.fn with read/write functions from native arrays +// Important: Do not add any additional functions here that may reasonably be used to *read* data from the array +// because we'll eval them without causing subscriptions, so ko.computed output could end up getting stale + ko.utils.arrayForEach(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function (methodName) { + ko.observableArray['fn'][methodName] = function () { + // Use "peek" to avoid creating a subscription in any computed that we're executing in the context of + // (for consistency with mutating regular observables) + var underlyingArray = this.peek(); + this.valueWillMutate(); + this.cacheDiffForKnownOperation(underlyingArray, methodName, arguments); + var methodCallResult = underlyingArray[methodName].apply(underlyingArray, arguments); + this.valueHasMutated(); + // The native sort and reverse methods return a reference to the array, but it makes more sense to return the observable array instead. + return methodCallResult === underlyingArray ? this : methodCallResult; + }; + }); + +// Populate ko.observableArray.fn with read-only functions from native arrays + ko.utils.arrayForEach(["slice"], function (methodName) { + ko.observableArray['fn'][methodName] = function () { + var underlyingArray = this(); + return underlyingArray[methodName].apply(underlyingArray, arguments); + }; + }); + + ko.isObservableArray = function (instance) { + return ko.isObservable(instance) + && typeof instance["remove"] == "function" + && typeof instance["push"] == "function"; }; - }); - } - - // Given a bindings function or object, create and return a new object that contains - // binding value-accessors functions. This is used by ko.applyBindingsToNode. - function makeBindingAccessors(bindings, context, node) { - if (typeof bindings === 'function') { - return makeAccessorsFromFunction(bindings.bind(null, context, node)); - } else { - return ko.utils.objectMap(bindings, makeValueAccessor); - } - } - - // This function is used if the binding provider doesn't include a getBindingAccessors function. - // It must be called with 'this' set to the provider instance. - function getBindingsAndMakeAccessors(node, context) { - return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context)); - } - - function validateThatBindingIsAllowedForVirtualElements(bindingName) { - var validator = ko.virtualElements.allowedBindings[bindingName]; - if (!validator) - throw new Error("The binding '" + bindingName + "' cannot be used with virtual elements") - } - - function applyBindingsToDescendantsInternal (bindingContext, elementOrVirtualElement, bindingContextsMayDifferFromDomParentElement) { - var currentChild, - nextInQueue = ko.virtualElements.firstChild(elementOrVirtualElement), - provider = ko.bindingProvider['instance'], - preprocessNode = provider['preprocessNode']; - - // Preprocessing allows a binding provider to mutate a node before bindings are applied to it. For example it's - // possible to insert new siblings after it, and/or replace the node with a different one. This can be used to - // implement custom binding syntaxes, such as {{ value }} for string interpolation, or custom element types that - // trigger insertion of <template> contents at that point in the document. - if (preprocessNode) { - while (currentChild = nextInQueue) { - nextInQueue = ko.virtualElements.nextSibling(currentChild); - preprocessNode.call(provider, currentChild); + + ko.exportSymbol('observableArray', ko.observableArray); + ko.exportSymbol('isObservableArray', ko.isObservableArray); + var arrayChangeEventName = 'arrayChange'; + ko.extenders['trackArrayChanges'] = function(target, options) { + // Use the provided options--each call to trackArrayChanges overwrites the previously set options + target.compareArrayOptions = {}; + if (options && typeof options == "object") { + ko.utils.extend(target.compareArrayOptions, options); + } + target.compareArrayOptions['sparse'] = true; + + // Only modify the target observable once + if (target.cacheDiffForKnownOperation) { + return; + } + var trackingChanges = false, + cachedDiff = null, + changeSubscription, + spectateSubscription, + pendingChanges = 0, + previousContents, + underlyingBeforeSubscriptionAddFunction = target.beforeSubscriptionAdd, + underlyingAfterSubscriptionRemoveFunction = target.afterSubscriptionRemove; + + // Watch "subscribe" calls, and for array change events, ensure change tracking is enabled + target.beforeSubscriptionAdd = function (event) { + if (underlyingBeforeSubscriptionAddFunction) { + underlyingBeforeSubscriptionAddFunction.call(target, event); + } + if (event === arrayChangeEventName) { + trackChanges(); + } + }; + // Watch "dispose" calls, and for array change events, ensure change tracking is disabled when all are disposed + target.afterSubscriptionRemove = function (event) { + if (underlyingAfterSubscriptionRemoveFunction) { + underlyingAfterSubscriptionRemoveFunction.call(target, event); + } + if (event === arrayChangeEventName && !target.hasSubscriptionsForEvent(arrayChangeEventName)) { + if (changeSubscription) { + changeSubscription.dispose(); + } + if (spectateSubscription) { + spectateSubscription.dispose(); + } + spectateSubscription = changeSubscription = null; + trackingChanges = false; + previousContents = undefined; + } + }; + + function trackChanges() { + if (trackingChanges) { + // Whenever there's a new subscription and there are pending notifications, make sure all previous + // subscriptions are notified of the change so that all subscriptions are in sync. + notifyChanges(); + return; + } + + trackingChanges = true; + + // Track how many times the array actually changed value + spectateSubscription = target.subscribe(function () { + ++pendingChanges; + }, null, "spectate"); + + // Each time the array changes value, capture a clone so that on the next + // change it's possible to produce a diff + previousContents = [].concat(target.peek() || []); + cachedDiff = null; + changeSubscription = target.subscribe(notifyChanges); + + function notifyChanges() { + if (pendingChanges) { + // Make a copy of the current contents and ensure it's an array + var currentContents = [].concat(target.peek() || []), changes; + + // Compute the diff and issue notifications, but only if someone is listening + if (target.hasSubscriptionsForEvent(arrayChangeEventName)) { + changes = getChanges(previousContents, currentContents); + } + + // Eliminate references to the old, removed items, so they can be GCed + previousContents = currentContents; + cachedDiff = null; + pendingChanges = 0; + + if (changes && changes.length) { + target['notifySubscribers'](changes, arrayChangeEventName); + } + } + } + } + + function getChanges(previousContents, currentContents) { + // We try to re-use cached diffs. + // The scenarios where pendingChanges > 1 are when using rate limiting or deferred updates, + // which without this check would not be compatible with arrayChange notifications. Normally, + // notifications are issued immediately so we wouldn't be queueing up more than one. + if (!cachedDiff || pendingChanges > 1) { + cachedDiff = ko.utils.compareArrays(previousContents, currentContents, target.compareArrayOptions); + } + + return cachedDiff; + } + + target.cacheDiffForKnownOperation = function(rawArray, operationName, args) { + // Only run if we're currently tracking changes for this observable array + // and there aren't any pending deferred notifications. + if (!trackingChanges || pendingChanges) { + return; + } + var diff = [], + arrayLength = rawArray.length, + argsLength = args.length, + offset = 0; + + function pushDiff(status, value, index) { + return diff[diff.length] = { 'status': status, 'value': value, 'index': index }; + } + switch (operationName) { + case 'push': + offset = arrayLength; + case 'unshift': + for (var index = 0; index < argsLength; index++) { + pushDiff('added', args[index], offset + index); + } + break; + + case 'pop': + offset = arrayLength - 1; + case 'shift': + if (arrayLength) { + pushDiff('deleted', rawArray[offset], offset); + } + break; + + case 'splice': + // Negative start index means 'from end of array'. After that we clamp to [0...arrayLength]. + // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice + var startIndex = Math.min(Math.max(0, args[0] < 0 ? arrayLength + args[0] : args[0]), arrayLength), + endDeleteIndex = argsLength === 1 ? arrayLength : Math.min(startIndex + (args[1] || 0), arrayLength), + endAddIndex = startIndex + argsLength - 2, + endIndex = Math.max(endDeleteIndex, endAddIndex), + additions = [], deletions = []; + for (var index = startIndex, argsIndex = 2; index < endIndex; ++index, ++argsIndex) { + if (index < endDeleteIndex) + deletions.push(pushDiff('deleted', rawArray[index], index)); + if (index < endAddIndex) + additions.push(pushDiff('added', args[argsIndex], index)); + } + ko.utils.findMovesInArrayComparison(deletions, additions); + break; + + default: + return; + } + cachedDiff = diff; + }; + }; + var computedState = ko.utils.createSymbolOrString('_state'); + + ko.computed = ko.dependentObservable = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget, options) { + if (typeof evaluatorFunctionOrOptions === "object") { + // Single-parameter syntax - everything is on this "options" param + options = evaluatorFunctionOrOptions; + } else { + // Multi-parameter syntax - construct the options according to the params passed + options = options || {}; + if (evaluatorFunctionOrOptions) { + options["read"] = evaluatorFunctionOrOptions; + } + } + if (typeof options["read"] != "function") + throw Error("Pass a function that returns the value of the ko.computed"); + + var writeFunction = options["write"]; + var state = { + latestValue: undefined, + isStale: true, + isDirty: true, + isBeingEvaluated: false, + suppressDisposalUntilDisposeWhenReturnsFalse: false, + isDisposed: false, + pure: false, + isSleeping: false, + readFunction: options["read"], + evaluatorFunctionTarget: evaluatorFunctionTarget || options["owner"], + disposeWhenNodeIsRemoved: options["disposeWhenNodeIsRemoved"] || options.disposeWhenNodeIsRemoved || null, + disposeWhen: options["disposeWhen"] || options.disposeWhen, + domNodeDisposalCallback: null, + dependencyTracking: {}, + dependenciesCount: 0, + evaluationTimeoutInstance: null + }; + + function computedObservable() { + if (arguments.length > 0) { + if (typeof writeFunction === "function") { + // Writing a value + writeFunction.apply(state.evaluatorFunctionTarget, arguments); + } else { + throw new Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters."); + } + return this; // Permits chained assignments + } else { + // Reading the value + if (!state.isDisposed) { + ko.dependencyDetection.registerDependency(computedObservable); + } + if (state.isDirty || (state.isSleeping && computedObservable.haveDependenciesChanged())) { + computedObservable.evaluateImmediate(); + } + return state.latestValue; + } + } + + computedObservable[computedState] = state; + computedObservable.hasWriteFunction = typeof writeFunction === "function"; + + // Inherit from 'subscribable' + if (!ko.utils.canSetPrototype) { + // 'subscribable' won't be on the prototype chain unless we put it there directly + ko.utils.extend(computedObservable, ko.subscribable['fn']); + } + ko.subscribable['fn'].init(computedObservable); + + // Inherit from 'computed' + ko.utils.setPrototypeOfOrExtend(computedObservable, computedFn); + + if (options['pure']) { + state.pure = true; + state.isSleeping = true; // Starts off sleeping; will awake on the first subscription + ko.utils.extend(computedObservable, pureComputedOverrides); + } else if (options['deferEvaluation']) { + ko.utils.extend(computedObservable, deferEvaluationOverrides); + } + + if (ko.options['deferUpdates']) { + ko.extenders['deferred'](computedObservable, true); + } + + if (DEBUG) { + // #1731 - Aid debugging by exposing the computed's options + computedObservable["_options"] = options; + } + + if (state.disposeWhenNodeIsRemoved) { + // Since this computed is associated with a DOM node, and we don't want to dispose the computed + // until the DOM node is *removed* from the document (as opposed to never having been in the document), + // we'll prevent disposal until "disposeWhen" first returns false. + state.suppressDisposalUntilDisposeWhenReturnsFalse = true; + + // disposeWhenNodeIsRemoved: true can be used to opt into the "only dispose after first false result" + // behaviour even if there's no specific node to watch. In that case, clear the option so we don't try + // to watch for a non-node's disposal. This technique is intended for KO's internal use only and shouldn't + // be documented or used by application code, as it's likely to change in a future version of KO. + if (!state.disposeWhenNodeIsRemoved.nodeType) { + state.disposeWhenNodeIsRemoved = null; + } + } + + // Evaluate, unless sleeping or deferEvaluation is true + if (!state.isSleeping && !options['deferEvaluation']) { + computedObservable.evaluateImmediate(); + } + + // Attach a DOM node disposal callback so that the computed will be proactively disposed as soon as the node is + // removed using ko.removeNode. But skip if isActive is false (there will never be any dependencies to dispose). + if (state.disposeWhenNodeIsRemoved && computedObservable.isActive()) { + ko.utils.domNodeDisposal.addDisposeCallback(state.disposeWhenNodeIsRemoved, state.domNodeDisposalCallback = function () { + computedObservable.dispose(); + }); + } + + return computedObservable; + }; + +// Utility function that disposes a given dependencyTracking entry + function computedDisposeDependencyCallback(id, entryToDispose) { + if (entryToDispose !== null && entryToDispose.dispose) { + entryToDispose.dispose(); + } } - // Reset nextInQueue for the next loop - nextInQueue = ko.virtualElements.firstChild(elementOrVirtualElement); - } - while (currentChild = nextInQueue) { - // Keep a record of the next child *before* applying bindings, in case the binding removes the current child from its position - nextInQueue = ko.virtualElements.nextSibling(currentChild); - applyBindingsToNodeAndDescendantsInternal(bindingContext, currentChild, bindingContextsMayDifferFromDomParentElement); - } - } - - function applyBindingsToNodeAndDescendantsInternal (bindingContext, nodeVerified, bindingContextMayDifferFromDomParentElement) { - var shouldBindDescendants = true; - - // Perf optimisation: Apply bindings only if... - // (1) We need to store the binding context on this node (because it may differ from the DOM parent node's binding context) - // Note that we can't store binding contexts on non-elements (e.g., text nodes), as IE doesn't allow expando properties for those - // (2) It might have bindings (e.g., it has a data-bind attribute, or it's a marker for a containerless template) - var isElement = (nodeVerified.nodeType === 1); - if (isElement) // Workaround IE <= 8 HTML parsing weirdness - ko.virtualElements.normaliseVirtualElementDomStructure(nodeVerified); - - var shouldApplyBindings = (isElement && bindingContextMayDifferFromDomParentElement) // Case (1) - || ko.bindingProvider['instance']['nodeHasBindings'](nodeVerified); // Case (2) - if (shouldApplyBindings) - shouldBindDescendants = applyBindingsToNodeInternal(nodeVerified, null, bindingContext, bindingContextMayDifferFromDomParentElement)['shouldBindDescendants']; - - if (shouldBindDescendants && !bindingDoesNotRecurseIntoElementTypes[ko.utils.tagNameLower(nodeVerified)]) { - // We're recursing automatically into (real or virtual) child nodes without changing binding contexts. So, - // * For children of a *real* element, the binding context is certainly the same as on their DOM .parentNode, - // hence bindingContextsMayDifferFromDomParentElement is false - // * For children of a *virtual* element, we can't be sure. Evaluating .parentNode on those children may - // skip over any number of intermediate virtual elements, any of which might define a custom binding context, - // hence bindingContextsMayDifferFromDomParentElement is true - applyBindingsToDescendantsInternal(bindingContext, nodeVerified, /* bindingContextsMayDifferFromDomParentElement: */ !isElement); - } - } - - var boundElementDomDataKey = ko.utils.domData.nextKey(); - - - function topologicalSortBindings(bindings) { - // Depth-first sort - var result = [], // The list of key/handler pairs that we will return - bindingsConsidered = {}, // A temporary record of which bindings are already in 'result' - cyclicDependencyStack = []; // Keeps track of a depth-search so that, if there's a cycle, we know which bindings caused it - ko.utils.objectForEach(bindings, function pushBinding(bindingKey) { - if (!bindingsConsidered[bindingKey]) { - var binding = ko['getBindingHandler'](bindingKey); - if (binding) { - // First add dependencies (if any) of the current binding - if (binding['after']) { - cyclicDependencyStack.push(bindingKey); - ko.utils.arrayForEach(binding['after'], function(bindingDependencyKey) { - if (bindings[bindingDependencyKey]) { - if (ko.utils.arrayIndexOf(cyclicDependencyStack, bindingDependencyKey) !== -1) { - throw Error("Cannot combine the following bindings, because they have a cyclic dependency: " + cyclicDependencyStack.join(", ")); - } else { - pushBinding(bindingDependencyKey); - } +// This function gets called each time a dependency is detected while evaluating a computed. +// It's factored out as a shared function to avoid creating unnecessary function instances during evaluation. + function computedBeginDependencyDetectionCallback(subscribable, id) { + var computedObservable = this.computedObservable, + state = computedObservable[computedState]; + if (!state.isDisposed) { + if (this.disposalCount && this.disposalCandidates[id]) { + // Don't want to dispose this subscription, as it's still being used + computedObservable.addDependencyTracking(id, subscribable, this.disposalCandidates[id]); + this.disposalCandidates[id] = null; // No need to actually delete the property - disposalCandidates is a transient object anyway + --this.disposalCount; + } else if (!state.dependencyTracking[id]) { + // Brand new subscription - add it + computedObservable.addDependencyTracking(id, subscribable, state.isSleeping ? { _target: subscribable } : computedObservable.subscribeToDependency(subscribable)); + } + // If the observable we've accessed has a pending notification, ensure we get notified of the actual final value (bypass equality checks) + if (subscribable._notificationIsPending) { + subscribable._notifyNextChangeIfValueIsDifferent(); + } + } + } + + var computedFn = { + "equalityComparer": valuesArePrimitiveAndEqual, + getDependenciesCount: function () { + return this[computedState].dependenciesCount; + }, + getDependencies: function () { + var dependencyTracking = this[computedState].dependencyTracking, dependentObservables = []; + + ko.utils.objectForEach(dependencyTracking, function (id, dependency) { + dependentObservables[dependency._order] = dependency._target; + }); + + return dependentObservables; + }, + hasAncestorDependency: function (obs) { + if (!this[computedState].dependenciesCount) { + return false; + } + var dependencies = this.getDependencies(); + if (ko.utils.arrayIndexOf(dependencies, obs) !== -1) { + return true; + } + return !!ko.utils.arrayFirst(dependencies, function (dep) { + return dep.hasAncestorDependency && dep.hasAncestorDependency(obs); + }); + }, + addDependencyTracking: function (id, target, trackingObj) { + if (this[computedState].pure && target === this) { + throw Error("A 'pure' computed must not be called recursively"); + } + + this[computedState].dependencyTracking[id] = trackingObj; + trackingObj._order = this[computedState].dependenciesCount++; + trackingObj._version = target.getVersion(); + }, + haveDependenciesChanged: function () { + var id, dependency, dependencyTracking = this[computedState].dependencyTracking; + for (id in dependencyTracking) { + if (Object.prototype.hasOwnProperty.call(dependencyTracking, id)) { + dependency = dependencyTracking[id]; + if ((this._evalDelayed && dependency._target._notificationIsPending) || dependency._target.hasChanged(dependency._version)) { + return true; + } + } + } + }, + markDirty: function () { + // Process "dirty" events if we can handle delayed notifications + if (this._evalDelayed && !this[computedState].isBeingEvaluated) { + this._evalDelayed(false /*isChange*/); + } + }, + isActive: function () { + var state = this[computedState]; + return state.isDirty || state.dependenciesCount > 0; + }, + respondToChange: function () { + // Ignore "change" events if we've already scheduled a delayed notification + if (!this._notificationIsPending) { + this.evaluatePossiblyAsync(); + } else if (this[computedState].isDirty) { + this[computedState].isStale = true; + } + }, + subscribeToDependency: function (target) { + if (target._deferUpdates) { + var dirtySub = target.subscribe(this.markDirty, this, 'dirty'), + changeSub = target.subscribe(this.respondToChange, this); + return { + _target: target, + dispose: function () { + dirtySub.dispose(); + changeSub.dispose(); + } + }; + } else { + return target.subscribe(this.evaluatePossiblyAsync, this); + } + }, + evaluatePossiblyAsync: function () { + var computedObservable = this, + throttleEvaluationTimeout = computedObservable['throttleEvaluation']; + if (throttleEvaluationTimeout && throttleEvaluationTimeout >= 0) { + clearTimeout(this[computedState].evaluationTimeoutInstance); + this[computedState].evaluationTimeoutInstance = ko.utils.setTimeout(function () { + computedObservable.evaluateImmediate(true /*notifyChange*/); + }, throttleEvaluationTimeout); + } else if (computedObservable._evalDelayed) { + computedObservable._evalDelayed(true /*isChange*/); + } else { + computedObservable.evaluateImmediate(true /*notifyChange*/); + } + }, + evaluateImmediate: function (notifyChange) { + var computedObservable = this, + state = computedObservable[computedState], + disposeWhen = state.disposeWhen, + changed = false; + + if (state.isBeingEvaluated) { + // If the evaluation of a ko.computed causes side effects, it's possible that it will trigger its own re-evaluation. + // This is not desirable (it's hard for a developer to realise a chain of dependencies might cause this, and they almost + // certainly didn't intend infinite re-evaluations). So, for predictability, we simply prevent ko.computeds from causing + // their own re-evaluation. Further discussion at https://github.com/SteveSanderson/knockout/pull/387 + return; + } + + // Do not evaluate (and possibly capture new dependencies) if disposed + if (state.isDisposed) { + return; + } + + if (state.disposeWhenNodeIsRemoved && !ko.utils.domNodeIsAttachedToDocument(state.disposeWhenNodeIsRemoved) || disposeWhen && disposeWhen()) { + // See comment above about suppressDisposalUntilDisposeWhenReturnsFalse + if (!state.suppressDisposalUntilDisposeWhenReturnsFalse) { + computedObservable.dispose(); + return; + } + } else { + // It just did return false, so we can stop suppressing now + state.suppressDisposalUntilDisposeWhenReturnsFalse = false; + } + + state.isBeingEvaluated = true; + try { + changed = this.evaluateImmediate_CallReadWithDependencyDetection(notifyChange); + } finally { + state.isBeingEvaluated = false; + } + + return changed; + }, + evaluateImmediate_CallReadWithDependencyDetection: function (notifyChange) { + // This function is really just part of the evaluateImmediate logic. You would never call it from anywhere else. + // Factoring it out into a separate function means it can be independent of the try/catch block in evaluateImmediate, + // which contributes to saving about 40% off the CPU overhead of computed evaluation (on V8 at least). + + var computedObservable = this, + state = computedObservable[computedState], + changed = false; + + // Initially, we assume that none of the subscriptions are still being used (i.e., all are candidates for disposal). + // Then, during evaluation, we cross off any that are in fact still being used. + var isInitial = state.pure ? undefined : !state.dependenciesCount, // If we're evaluating when there are no previous dependencies, it must be the first time + dependencyDetectionContext = { + computedObservable: computedObservable, + disposalCandidates: state.dependencyTracking, + disposalCount: state.dependenciesCount + }; + + ko.dependencyDetection.begin({ + callbackTarget: dependencyDetectionContext, + callback: computedBeginDependencyDetectionCallback, + computed: computedObservable, + isInitial: isInitial + }); + + state.dependencyTracking = {}; + state.dependenciesCount = 0; + + var newValue = this.evaluateImmediate_CallReadThenEndDependencyDetection(state, dependencyDetectionContext); + + if (!state.dependenciesCount) { + computedObservable.dispose(); + changed = true; // When evaluation causes a disposal, make sure all dependent computeds get notified so they'll see the new state + } else { + changed = computedObservable.isDifferent(state.latestValue, newValue); + } + + if (changed) { + if (!state.isSleeping) { + computedObservable["notifySubscribers"](state.latestValue, "beforeChange"); + } else { + computedObservable.updateVersion(); + } + + state.latestValue = newValue; + if (DEBUG) computedObservable._latestValue = newValue; + + computedObservable["notifySubscribers"](state.latestValue, "spectate"); + + if (!state.isSleeping && notifyChange) { + computedObservable["notifySubscribers"](state.latestValue); + } + if (computedObservable._recordUpdate) { + computedObservable._recordUpdate(); + } + } + + if (isInitial) { + computedObservable["notifySubscribers"](state.latestValue, "awake"); + } + + return changed; + }, + evaluateImmediate_CallReadThenEndDependencyDetection: function (state, dependencyDetectionContext) { + // This function is really part of the evaluateImmediate_CallReadWithDependencyDetection logic. + // You'd never call it from anywhere else. Factoring it out means that evaluateImmediate_CallReadWithDependencyDetection + // can be independent of try/finally blocks, which contributes to saving about 40% off the CPU + // overhead of computed evaluation (on V8 at least). + + try { + var readFunction = state.readFunction; + return state.evaluatorFunctionTarget ? readFunction.call(state.evaluatorFunctionTarget) : readFunction(); + } finally { + ko.dependencyDetection.end(); + + // For each subscription no longer being used, remove it from the active subscriptions list and dispose it + if (dependencyDetectionContext.disposalCount && !state.isSleeping) { + ko.utils.objectForEach(dependencyDetectionContext.disposalCandidates, computedDisposeDependencyCallback); + } + + state.isStale = state.isDirty = false; + } + }, + peek: function (evaluate) { + // By default, peek won't re-evaluate, except while the computed is sleeping or to get the initial value when "deferEvaluation" is set. + // Pass in true to evaluate if needed. + var state = this[computedState]; + if ((state.isDirty && (evaluate || !state.dependenciesCount)) || (state.isSleeping && this.haveDependenciesChanged())) { + this.evaluateImmediate(); + } + return state.latestValue; + }, + limit: function (limitFunction) { + // Override the limit function with one that delays evaluation as well + ko.subscribable['fn'].limit.call(this, limitFunction); + this._evalIfChanged = function () { + if (!this[computedState].isSleeping) { + if (this[computedState].isStale) { + this.evaluateImmediate(); + } else { + this[computedState].isDirty = false; + } + } + return this[computedState].latestValue; + }; + this._evalDelayed = function (isChange) { + this._limitBeforeChange(this[computedState].latestValue); + + // Mark as dirty + this[computedState].isDirty = true; + if (isChange) { + this[computedState].isStale = true; + } + + // Pass the observable to the "limit" code, which will evaluate it when + // it's time to do the notification. + this._limitChange(this, !isChange /* isDirty */); + }; + }, + dispose: function () { + var state = this[computedState]; + if (!state.isSleeping && state.dependencyTracking) { + ko.utils.objectForEach(state.dependencyTracking, function (id, dependency) { + if (dependency.dispose) + dependency.dispose(); + }); + } + if (state.disposeWhenNodeIsRemoved && state.domNodeDisposalCallback) { + ko.utils.domNodeDisposal.removeDisposeCallback(state.disposeWhenNodeIsRemoved, state.domNodeDisposalCallback); + } + state.dependencyTracking = undefined; + state.dependenciesCount = 0; + state.isDisposed = true; + state.isStale = false; + state.isDirty = false; + state.isSleeping = false; + state.disposeWhenNodeIsRemoved = undefined; + state.disposeWhen = undefined; + state.readFunction = undefined; + if (!this.hasWriteFunction) { + state.evaluatorFunctionTarget = undefined; + } + } + }; + + var pureComputedOverrides = { + beforeSubscriptionAdd: function (event) { + // If asleep, wake up the computed by subscribing to any dependencies. + var computedObservable = this, + state = computedObservable[computedState]; + if (!state.isDisposed && state.isSleeping && event == 'change') { + state.isSleeping = false; + if (state.isStale || computedObservable.haveDependenciesChanged()) { + state.dependencyTracking = null; + state.dependenciesCount = 0; + if (computedObservable.evaluateImmediate()) { + computedObservable.updateVersion(); + } + } else { + // First put the dependencies in order + var dependenciesOrder = []; + ko.utils.objectForEach(state.dependencyTracking, function (id, dependency) { + dependenciesOrder[dependency._order] = id; + }); + // Next, subscribe to each one + ko.utils.arrayForEach(dependenciesOrder, function (id, order) { + var dependency = state.dependencyTracking[id], + subscription = computedObservable.subscribeToDependency(dependency._target); + subscription._order = order; + subscription._version = dependency._version; + state.dependencyTracking[id] = subscription; + }); + // Waking dependencies may have triggered effects + if (computedObservable.haveDependenciesChanged()) { + if (computedObservable.evaluateImmediate()) { + computedObservable.updateVersion(); + } + } + } + + if (!state.isDisposed) { // test since evaluating could trigger disposal + computedObservable["notifySubscribers"](state.latestValue, "awake"); + } + } + }, + afterSubscriptionRemove: function (event) { + var state = this[computedState]; + if (!state.isDisposed && event == 'change' && !this.hasSubscriptionsForEvent('change')) { + ko.utils.objectForEach(state.dependencyTracking, function (id, dependency) { + if (dependency.dispose) { + state.dependencyTracking[id] = { + _target: dependency._target, + _order: dependency._order, + _version: dependency._version + }; + dependency.dispose(); + } + }); + state.isSleeping = true; + this["notifySubscribers"](undefined, "asleep"); + } + }, + getVersion: function () { + // Because a pure computed is not automatically updated while it is sleeping, we can't + // simply return the version number. Instead, we check if any of the dependencies have + // changed and conditionally re-evaluate the computed observable. + var state = this[computedState]; + if (state.isSleeping && (state.isStale || this.haveDependenciesChanged())) { + this.evaluateImmediate(); + } + return ko.subscribable['fn'].getVersion.call(this); + } + }; + + var deferEvaluationOverrides = { + beforeSubscriptionAdd: function (event) { + // This will force a computed with deferEvaluation to evaluate when the first subscription is registered. + if (event == 'change' || event == 'beforeChange') { + this.peek(); + } + } + }; + +// Note that for browsers that don't support proto assignment, the +// inheritance chain is created manually in the ko.computed constructor + if (ko.utils.canSetPrototype) { + ko.utils.setPrototypeOf(computedFn, ko.subscribable['fn']); + } + +// Set the proto values for ko.computed + var protoProp = ko.observable.protoProperty; // == "__ko_proto__" + computedFn[protoProp] = ko.computed; + + ko.isComputed = function (instance) { + return (typeof instance == 'function' && instance[protoProp] === computedFn[protoProp]); + }; + + ko.isPureComputed = function (instance) { + return ko.isComputed(instance) && instance[computedState] && instance[computedState].pure; + }; + + ko.exportSymbol('computed', ko.computed); + ko.exportSymbol('dependentObservable', ko.computed); // export ko.dependentObservable for backwards compatibility (1.x) + ko.exportSymbol('isComputed', ko.isComputed); + ko.exportSymbol('isPureComputed', ko.isPureComputed); + ko.exportSymbol('computed.fn', computedFn); + ko.exportProperty(computedFn, 'peek', computedFn.peek); + ko.exportProperty(computedFn, 'dispose', computedFn.dispose); + ko.exportProperty(computedFn, 'isActive', computedFn.isActive); + ko.exportProperty(computedFn, 'getDependenciesCount', computedFn.getDependenciesCount); + ko.exportProperty(computedFn, 'getDependencies', computedFn.getDependencies); + + ko.pureComputed = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget) { + if (typeof evaluatorFunctionOrOptions === 'function') { + return ko.computed(evaluatorFunctionOrOptions, evaluatorFunctionTarget, {'pure':true}); + } else { + evaluatorFunctionOrOptions = ko.utils.extend({}, evaluatorFunctionOrOptions); // make a copy of the parameter object + evaluatorFunctionOrOptions['pure'] = true; + return ko.computed(evaluatorFunctionOrOptions, evaluatorFunctionTarget); + } + } + ko.exportSymbol('pureComputed', ko.pureComputed); + + (function() { + var maxNestedObservableDepth = 10; // Escape the (unlikely) pathological case where an observable's current value is itself (or similar reference cycle) + + ko.toJS = function(rootObject) { + if (arguments.length == 0) + throw new Error("When calling ko.toJS, pass the object you want to convert."); + + // We just unwrap everything at every level in the object graph + return mapJsObjectGraph(rootObject, function(valueToMap) { + // Loop because an observable's value might in turn be another observable wrapper + for (var i = 0; ko.isObservable(valueToMap) && (i < maxNestedObservableDepth); i++) + valueToMap = valueToMap(); + return valueToMap; + }); + }; + + ko.toJSON = function(rootObject, replacer, space) { // replacer and space are optional + var plainJavaScriptObject = ko.toJS(rootObject); + return ko.utils.stringifyJson(plainJavaScriptObject, replacer, space); + }; + + function mapJsObjectGraph(rootObject, mapInputCallback, visitedObjects) { + visitedObjects = visitedObjects || new objectLookup(); + + rootObject = mapInputCallback(rootObject); + var canHaveProperties = (typeof rootObject == "object") && (rootObject !== null) && (rootObject !== undefined) && (!(rootObject instanceof RegExp)) && (!(rootObject instanceof Date)) && (!(rootObject instanceof String)) && (!(rootObject instanceof Number)) && (!(rootObject instanceof Boolean)); + if (!canHaveProperties) + return rootObject; + + var outputProperties = rootObject instanceof Array ? [] : {}; + visitedObjects.save(rootObject, outputProperties); + + visitPropertiesOrArrayEntries(rootObject, function(indexer) { + var propertyValue = mapInputCallback(rootObject[indexer]); + + switch (typeof propertyValue) { + case "boolean": + case "number": + case "string": + case "function": + outputProperties[indexer] = propertyValue; + break; + case "object": + case "undefined": + var previouslyMappedValue = visitedObjects.get(propertyValue); + outputProperties[indexer] = (previouslyMappedValue !== undefined) + ? previouslyMappedValue + : mapJsObjectGraph(propertyValue, mapInputCallback, visitedObjects); + break; + } + }); + + return outputProperties; + } + + function visitPropertiesOrArrayEntries(rootObject, visitorCallback) { + if (rootObject instanceof Array) { + for (var i = 0; i < rootObject.length; i++) + visitorCallback(i); + + // For arrays, also respect toJSON property for custom mappings (fixes #278) + if (typeof rootObject['toJSON'] == 'function') + visitorCallback('toJSON'); + } else { + for (var propertyName in rootObject) { + visitorCallback(propertyName); + } + } + }; + + function objectLookup() { + this.keys = []; + this.values = []; + }; + + objectLookup.prototype = { + constructor: objectLookup, + save: function(key, value) { + var existingIndex = ko.utils.arrayIndexOf(this.keys, key); + if (existingIndex >= 0) + this.values[existingIndex] = value; + else { + this.keys.push(key); + this.values.push(value); + } + }, + get: function(key) { + var existingIndex = ko.utils.arrayIndexOf(this.keys, key); + return (existingIndex >= 0) ? this.values[existingIndex] : undefined; + } + }; + })(); + + ko.exportSymbol('toJS', ko.toJS); + ko.exportSymbol('toJSON', ko.toJSON); + ko.when = function(predicate, callback, context) { + function kowhen (resolve) { + var observable = ko.pureComputed(predicate, context).extend({notify:'always'}); + var subscription = observable.subscribe(function(value) { + if (value) { + subscription.dispose(); + resolve(value); + } + }); + // In case the initial value is true, process it right away + observable['notifySubscribers'](observable.peek()); + + return subscription; + } + if (typeof Promise === "function" && !callback) { + return new Promise(kowhen); + } else { + return kowhen(callback.bind(context)); + } + }; + + ko.exportSymbol('when', ko.when); + (function () { + var hasDomDataExpandoProperty = '__ko__hasDomDataOptionValue__'; + + // Normally, SELECT elements and their OPTIONs can only take value of type 'string' (because the values + // are stored on DOM attributes). ko.selectExtensions provides a way for SELECTs/OPTIONs to have values + // that are arbitrary objects. This is very convenient when implementing things like cascading dropdowns. + ko.selectExtensions = { + readValue : function(element) { + switch (ko.utils.tagNameLower(element)) { + case 'option': + if (element[hasDomDataExpandoProperty] === true) + return ko.utils.domData.get(element, ko.bindingHandlers.options.optionValueDomDataKey); + return ko.utils.ieVersion <= 7 + ? (element.getAttributeNode('value') && element.getAttributeNode('value').specified ? element.value : element.text) + : element.value; + case 'select': + return element.selectedIndex >= 0 ? ko.selectExtensions.readValue(element.options[element.selectedIndex]) : undefined; + default: + return element.value; + } + }, + + writeValue: function(element, value, allowUnset) { + switch (ko.utils.tagNameLower(element)) { + case 'option': + if (typeof value === "string") { + ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, undefined); + if (hasDomDataExpandoProperty in element) { // IE <= 8 throws errors if you delete non-existent properties from a DOM node + delete element[hasDomDataExpandoProperty]; + } + element.value = value; + } + else { + // Store arbitrary object using DomData + ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, value); + element[hasDomDataExpandoProperty] = true; + + // Special treatment of numbers is just for backward compatibility. KO 1.2.1 wrote numerical values to element.value. + element.value = typeof value === "number" ? value : ""; + } + break; + case 'select': + if (value === "" || value === null) // A blank string or null value will select the caption + value = undefined; + var selection = -1; + for (var i = 0, n = element.options.length, optionValue; i < n; ++i) { + optionValue = ko.selectExtensions.readValue(element.options[i]); + // Include special check to handle selecting a caption with a blank string value + if (optionValue == value || (optionValue === "" && value === undefined)) { + selection = i; + break; + } + } + if (allowUnset || selection >= 0 || (value === undefined && element.size > 1)) { + element.selectedIndex = selection; + if (ko.utils.ieVersion === 6) { + // Workaround for IE6 bug: It won't reliably apply values to SELECT nodes during the same execution thread + // right after you've changed the set of OPTION nodes on it. So for that node type, we'll schedule a second thread + // to apply the value as well. + ko.utils.setTimeout(function () { + element.selectedIndex = selection; + }, 0); + } + } + break; + default: + if ((value === null) || (value === undefined)) + value = ""; + element.value = value; + break; + } + } + }; + })(); + + ko.exportSymbol('selectExtensions', ko.selectExtensions); + ko.exportSymbol('selectExtensions.readValue', ko.selectExtensions.readValue); + ko.exportSymbol('selectExtensions.writeValue', ko.selectExtensions.writeValue); + ko.expressionRewriting = (function () { + var javaScriptReservedWords = ["true", "false", "null", "undefined"]; + + // Matches something that can be assigned to--either an isolated identifier or something ending with a property accessor + // This is designed to be simple and avoid false negatives, but could produce false positives (e.g., a+b.c). + // This also will not properly handle nested brackets (e.g., obj1[obj2['prop']]; see #911). + var javaScriptAssignmentTarget = /^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i; + + function getWriteableValue(expression) { + if (ko.utils.arrayIndexOf(javaScriptReservedWords, expression) >= 0) + return false; + var match = expression.match(javaScriptAssignmentTarget); + return match === null ? false : match[1] ? ('Object(' + match[1] + ')' + match[2]) : expression; + } + + // The following regular expressions will be used to split an object-literal string into tokens + + var specials = ',"\'`{}()/:[\\]', // These characters have special meaning to the parser and must not appear in the middle of a token, except as part of a string. + // Create the actual regular expression by or-ing the following regex strings. The order is important. + bindingToken = RegExp([ + // These match strings, either with double quotes, single quotes, or backticks + '"(?:\\\\.|[^"])*"', + "'(?:\\\\.|[^'])*'", + "`(?:\\\\.|[^`])*`", + // Match C style comments + "/\\*(?:[^*]|\\*+[^*/])*\\*+/", + // Match C++ style comments + "//.*\n", + // Match a regular expression (text enclosed by slashes), but will also match sets of divisions + // as a regular expression (this is handled by the parsing loop below). + '/(?:\\\\.|[^/])+/\w*', + // Match text (at least two characters) that does not contain any of the above special characters, + // although some of the special characters are allowed to start it (all but the colon and comma). + // The text can contain spaces, but leading or trailing spaces are skipped. + '[^\\s:,/][^' + specials + ']*[^\\s' + specials + ']', + // Match any non-space character not matched already. This will match colons and commas, since they're + // not matched by "everyThingElse", but will also match any other single character that wasn't already + // matched (for example: in "a: 1, b: 2", each of the non-space characters will be matched by oneNotSpace). + '[^\\s]' + ].join('|'), 'g'), + + // Match end of previous token to determine whether a slash is a division or regex. + divisionLookBehind = /[\])"'A-Za-z0-9_$]+$/, + keywordRegexLookBehind = {'in':1,'return':1,'typeof':1}; + + function parseObjectLiteral(objectLiteralString) { + // Trim leading and trailing spaces from the string + var str = ko.utils.stringTrim(objectLiteralString); + + // Trim braces '{' surrounding the whole object literal + if (str.charCodeAt(0) === 123) str = str.slice(1, -1); + + // Add a newline to correctly match a C++ style comment at the end of the string and + // add a comma so that we don't need a separate code block to deal with the last item + str += "\n,"; + + // Split into tokens + var result = [], toks = str.match(bindingToken), key, values = [], depth = 0; + + if (toks.length > 1) { + for (var i = 0, tok; tok = toks[i]; ++i) { + var c = tok.charCodeAt(0); + // A comma signals the end of a key/value pair if depth is zero + if (c === 44) { // "," + if (depth <= 0) { + result.push((key && values.length) ? {key: key, value: values.join('')} : {'unknown': key || values.join('')}); + key = depth = 0; + values = []; + continue; + } + // Simply skip the colon that separates the name and value + } else if (c === 58) { // ":" + if (!depth && !key && values.length === 1) { + key = values.pop(); + continue; + } + // Comments: skip them + } else if (c === 47 && tok.length > 1 && (tok.charCodeAt(1) === 47 || tok.charCodeAt(1) === 42)) { // "//" or "/*" + continue; + // A set of slashes is initially matched as a regular expression, but could be division + } else if (c === 47 && i && tok.length > 1) { // "/" + // Look at the end of the previous token to determine if the slash is actually division + var match = toks[i-1].match(divisionLookBehind); + if (match && !keywordRegexLookBehind[match[0]]) { + // The slash is actually a division punctuator; re-parse the remainder of the string (not including the slash) + str = str.substr(str.indexOf(tok) + 1); + toks = str.match(bindingToken); + i = -1; + // Continue with just the slash + tok = '/'; + } + // Increment depth for parentheses, braces, and brackets so that interior commas are ignored + } else if (c === 40 || c === 123 || c === 91) { // '(', '{', '[' + ++depth; + } else if (c === 41 || c === 125 || c === 93) { // ')', '}', ']' + --depth; + // The key will be the first token; if it's a string, trim the quotes + } else if (!key && !values.length && (c === 34 || c === 39)) { // '"', "'" + tok = tok.slice(1, -1); + } + values.push(tok); + } + if (depth > 0) { + throw Error("Unbalanced parentheses, braces, or brackets"); + } + } + return result; + } + + // Two-way bindings include a write function that allow the handler to update the value even if it's not an observable. + var twoWayBindings = {}; + + function preProcessBindings(bindingsStringOrKeyValueArray, bindingOptions) { + bindingOptions = bindingOptions || {}; + + function processKeyValue(key, val) { + var writableVal; + function callPreprocessHook(obj) { + return (obj && obj['preprocess']) ? (val = obj['preprocess'](val, key, processKeyValue)) : true; + } + if (!bindingParams) { + if (!callPreprocessHook(ko['getBindingHandler'](key))) + return; + + if (twoWayBindings[key] && (writableVal = getWriteableValue(val))) { + // For two-way bindings, provide a write method in case the value + // isn't a writable observable. + var writeKey = typeof twoWayBindings[key] == 'string' ? twoWayBindings[key] : key; + propertyAccessorResultStrings.push("'" + writeKey + "':function(_z){" + writableVal + "=_z}"); + } + } + // Values are wrapped in a function so that each value can be accessed independently + if (makeValueAccessors) { + val = 'function(){return ' + val + ' }'; + } + resultStrings.push("'" + key + "':" + val); + } + + var resultStrings = [], + propertyAccessorResultStrings = [], + makeValueAccessors = bindingOptions['valueAccessors'], + bindingParams = bindingOptions['bindingParams'], + keyValueArray = typeof bindingsStringOrKeyValueArray === "string" ? + parseObjectLiteral(bindingsStringOrKeyValueArray) : bindingsStringOrKeyValueArray; + + ko.utils.arrayForEach(keyValueArray, function(keyValue) { + processKeyValue(keyValue.key || keyValue['unknown'], keyValue.value); + }); + + if (propertyAccessorResultStrings.length) + processKeyValue('_ko_property_writers', "{" + propertyAccessorResultStrings.join(",") + " }"); + + return resultStrings.join(","); + } + + return { + bindingRewriteValidators: [], + + twoWayBindings: twoWayBindings, + + parseObjectLiteral: parseObjectLiteral, + + preProcessBindings: preProcessBindings, + + keyValueArrayContainsKey: function(keyValueArray, key) { + for (var i = 0; i < keyValueArray.length; i++) + if (keyValueArray[i]['key'] == key) + return true; + return false; + }, + + // Internal, private KO utility for updating model properties from within bindings + // property: If the property being updated is (or might be) an observable, pass it here + // If it turns out to be a writable observable, it will be written to directly + // allBindings: An object with a get method to retrieve bindings in the current execution context. + // This will be searched for a '_ko_property_writers' property in case you're writing to a non-observable + // key: The key identifying the property to be written. Example: for { hasFocus: myValue }, write to 'myValue' by specifying the key 'hasFocus' + // value: The value to be written + // checkIfDifferent: If true, and if the property being written is a writable observable, the value will only be written if + // it is !== existing value on that writable observable + writeValueToProperty: function(property, allBindings, key, value, checkIfDifferent) { + if (!property || !ko.isObservable(property)) { + var propWriters = allBindings.get('_ko_property_writers'); + if (propWriters && propWriters[key]) + propWriters[key](value); + } else if (ko.isWriteableObservable(property) && (!checkIfDifferent || property.peek() !== value)) { + property(value); + } + } + }; + })(); + + ko.exportSymbol('expressionRewriting', ko.expressionRewriting); + ko.exportSymbol('expressionRewriting.bindingRewriteValidators', ko.expressionRewriting.bindingRewriteValidators); + ko.exportSymbol('expressionRewriting.parseObjectLiteral', ko.expressionRewriting.parseObjectLiteral); + ko.exportSymbol('expressionRewriting.preProcessBindings', ko.expressionRewriting.preProcessBindings); + +// Making bindings explicitly declare themselves as "two way" isn't ideal in the long term (it would be better if +// all bindings could use an official 'property writer' API without needing to declare that they might). However, +// since this is not, and has never been, a public API (_ko_property_writers was never documented), it's acceptable +// as an internal implementation detail in the short term. +// For those developers who rely on _ko_property_writers in their custom bindings, we expose _twoWayBindings as an +// undocumented feature that makes it relatively easy to upgrade to KO 3.0. However, this is still not an official +// public API, and we reserve the right to remove it at any time if we create a real public property writers API. + ko.exportSymbol('expressionRewriting._twoWayBindings', ko.expressionRewriting.twoWayBindings); + +// For backward compatibility, define the following aliases. (Previously, these function names were misleading because +// they referred to JSON specifically, even though they actually work with arbitrary JavaScript object literal expressions.) + ko.exportSymbol('jsonExpressionRewriting', ko.expressionRewriting); + ko.exportSymbol('jsonExpressionRewriting.insertPropertyAccessorsIntoJson', ko.expressionRewriting.preProcessBindings); + (function() { + // "Virtual elements" is an abstraction on top of the usual DOM API which understands the notion that comment nodes + // may be used to represent hierarchy (in addition to the DOM's natural hierarchy). + // If you call the DOM-manipulating functions on ko.virtualElements, you will be able to read and write the state + // of that virtual hierarchy + // + // The point of all this is to support containerless templates (e.g., <!-- ko foreach:someCollection -->blah<!-- /ko -->) + // without having to scatter special cases all over the binding and templating code. + + // IE 9 cannot reliably read the "nodeValue" property of a comment node (see https://github.com/SteveSanderson/knockout/issues/186) + // but it does give them a nonstandard alternative property called "text" that it can read reliably. Other browsers don't have that property. + // So, use node.text where available, and node.nodeValue elsewhere + var commentNodesHaveTextProperty = document && document.createComment("test").text === "<!--test-->"; + + var startCommentRegex = commentNodesHaveTextProperty ? /^<!--\s*ko(?:\s+([\s\S]+))?\s*-->$/ : /^\s*ko(?:\s+([\s\S]+))?\s*$/; + var endCommentRegex = commentNodesHaveTextProperty ? /^<!--\s*\/ko\s*-->$/ : /^\s*\/ko\s*$/; + var htmlTagsWithOptionallyClosingChildren = { 'ul': true, 'ol': true }; + + function isStartComment(node) { + return (node.nodeType == 8) && startCommentRegex.test(commentNodesHaveTextProperty ? node.text : node.nodeValue); + } + + function isEndComment(node) { + return (node.nodeType == 8) && endCommentRegex.test(commentNodesHaveTextProperty ? node.text : node.nodeValue); + } + + function isUnmatchedEndComment(node) { + return isEndComment(node) && !(ko.utils.domData.get(node, matchedEndCommentDataKey)); + } + + var matchedEndCommentDataKey = "__ko_matchedEndComment__" + + function getVirtualChildren(startComment, allowUnbalanced) { + var currentNode = startComment; + var depth = 1; + var children = []; + while (currentNode = currentNode.nextSibling) { + if (isEndComment(currentNode)) { + ko.utils.domData.set(currentNode, matchedEndCommentDataKey, true); + depth--; + if (depth === 0) + return children; + } + + children.push(currentNode); + + if (isStartComment(currentNode)) + depth++; + } + if (!allowUnbalanced) + throw new Error("Cannot find closing comment tag to match: " + startComment.nodeValue); + return null; + } + + function getMatchingEndComment(startComment, allowUnbalanced) { + var allVirtualChildren = getVirtualChildren(startComment, allowUnbalanced); + if (allVirtualChildren) { + if (allVirtualChildren.length > 0) + return allVirtualChildren[allVirtualChildren.length - 1].nextSibling; + return startComment.nextSibling; + } else + return null; // Must have no matching end comment, and allowUnbalanced is true + } + + function getUnbalancedChildTags(node) { + // e.g., from <div>OK</div><!-- ko blah --><span>Another</span>, returns: <!-- ko blah --><span>Another</span> + // from <div>OK</div><!-- /ko --><!-- /ko -->, returns: <!-- /ko --><!-- /ko --> + var childNode = node.firstChild, captureRemaining = null; + if (childNode) { + do { + if (captureRemaining) // We already hit an unbalanced node and are now just scooping up all subsequent nodes + captureRemaining.push(childNode); + else if (isStartComment(childNode)) { + var matchingEndComment = getMatchingEndComment(childNode, /* allowUnbalanced: */ true); + if (matchingEndComment) // It's a balanced tag, so skip immediately to the end of this virtual set + childNode = matchingEndComment; + else + captureRemaining = [childNode]; // It's unbalanced, so start capturing from this point + } else if (isEndComment(childNode)) { + captureRemaining = [childNode]; // It's unbalanced (if it wasn't, we'd have skipped over it already), so start capturing + } + } while (childNode = childNode.nextSibling); + } + return captureRemaining; + } + + ko.virtualElements = { + allowedBindings: {}, + + childNodes: function(node) { + return isStartComment(node) ? getVirtualChildren(node) : node.childNodes; + }, + + emptyNode: function(node) { + if (!isStartComment(node)) + ko.utils.emptyDomNode(node); + else { + var virtualChildren = ko.virtualElements.childNodes(node); + for (var i = 0, j = virtualChildren.length; i < j; i++) + ko.removeNode(virtualChildren[i]); + } + }, + + setDomNodeChildren: function(node, childNodes) { + if (!isStartComment(node)) + ko.utils.setDomNodeChildren(node, childNodes); + else { + ko.virtualElements.emptyNode(node); + var endCommentNode = node.nextSibling; // Must be the next sibling, as we just emptied the children + for (var i = 0, j = childNodes.length; i < j; i++) + endCommentNode.parentNode.insertBefore(childNodes[i], endCommentNode); + } + }, + + prepend: function(containerNode, nodeToPrepend) { + var insertBeforeNode; + + if (isStartComment(containerNode)) { + // Start comments must always have a parent and at least one following sibling (the end comment) + insertBeforeNode = containerNode.nextSibling; + containerNode = containerNode.parentNode; + } else { + insertBeforeNode = containerNode.firstChild; + } + + if (!insertBeforeNode) { + containerNode.appendChild(nodeToPrepend); + } else if (nodeToPrepend !== insertBeforeNode) { // IE will sometimes crash if you try to insert a node before itself + containerNode.insertBefore(nodeToPrepend, insertBeforeNode); + } + }, + + insertAfter: function(containerNode, nodeToInsert, insertAfterNode) { + if (!insertAfterNode) { + ko.virtualElements.prepend(containerNode, nodeToInsert); + } else { + // Children of start comments must always have a parent and at least one following sibling (the end comment) + var insertBeforeNode = insertAfterNode.nextSibling; + + if (isStartComment(containerNode)) { + containerNode = containerNode.parentNode; + } + + if (!insertBeforeNode) { + containerNode.appendChild(nodeToInsert); + } else if (nodeToInsert !== insertBeforeNode) { // IE will sometimes crash if you try to insert a node before itself + containerNode.insertBefore(nodeToInsert, insertBeforeNode); + } + } + }, + + firstChild: function(node) { + if (!isStartComment(node)) { + if (node.firstChild && isEndComment(node.firstChild)) { + throw new Error("Found invalid end comment, as the first child of " + node); + } + return node.firstChild; + } else if (!node.nextSibling || isEndComment(node.nextSibling)) { + return null; + } else { + return node.nextSibling; + } + }, + + nextSibling: function(node) { + if (isStartComment(node)) { + node = getMatchingEndComment(node); + } + + if (node.nextSibling && isEndComment(node.nextSibling)) { + if (isUnmatchedEndComment(node.nextSibling)) { + throw Error("Found end comment without a matching opening comment, as child of " + node); + } else { + return null; + } + } else { + return node.nextSibling; + } + }, + + hasBindingValue: isStartComment, + + virtualNodeBindingValue: function(node) { + var regexMatch = (commentNodesHaveTextProperty ? node.text : node.nodeValue).match(startCommentRegex); + return regexMatch ? regexMatch[1] : null; + }, + + normaliseVirtualElementDomStructure: function(elementVerified) { + // Workaround for https://github.com/SteveSanderson/knockout/issues/155 + // (IE <= 8 or IE 9 quirks mode parses your HTML weirdly, treating closing </li> tags as if they don't exist, thereby moving comment nodes + // that are direct descendants of <ul> into the preceding <li>) + if (!htmlTagsWithOptionallyClosingChildren[ko.utils.tagNameLower(elementVerified)]) + return; + + // Scan immediate children to see if they contain unbalanced comment tags. If they do, those comment tags + // must be intended to appear *after* that child, so move them there. + var childNode = elementVerified.firstChild; + if (childNode) { + do { + if (childNode.nodeType === 1) { + var unbalancedTags = getUnbalancedChildTags(childNode); + if (unbalancedTags) { + // Fix up the DOM by moving the unbalanced tags to where they most likely were intended to be placed - *after* the child + var nodeToInsertBefore = childNode.nextSibling; + for (var i = 0; i < unbalancedTags.length; i++) { + if (nodeToInsertBefore) + elementVerified.insertBefore(unbalancedTags[i], nodeToInsertBefore); + else + elementVerified.appendChild(unbalancedTags[i]); + } + } + } + } while (childNode = childNode.nextSibling); + } + } + }; + })(); + ko.exportSymbol('virtualElements', ko.virtualElements); + ko.exportSymbol('virtualElements.allowedBindings', ko.virtualElements.allowedBindings); + ko.exportSymbol('virtualElements.emptyNode', ko.virtualElements.emptyNode); +//ko.exportSymbol('virtualElements.firstChild', ko.virtualElements.firstChild); // firstChild is not minified + ko.exportSymbol('virtualElements.insertAfter', ko.virtualElements.insertAfter); +//ko.exportSymbol('virtualElements.nextSibling', ko.virtualElements.nextSibling); // nextSibling is not minified + ko.exportSymbol('virtualElements.prepend', ko.virtualElements.prepend); + ko.exportSymbol('virtualElements.setDomNodeChildren', ko.virtualElements.setDomNodeChildren); + (function() { + var defaultBindingAttributeName = "data-bind"; + + ko.bindingProvider = function() { + this.bindingCache = {}; + }; + + ko.utils.extend(ko.bindingProvider.prototype, { + 'nodeHasBindings': function(node) { + switch (node.nodeType) { + case 1: // Element + return node.getAttribute(defaultBindingAttributeName) != null + || ko.components['getComponentNameForNode'](node); + case 8: // Comment node + return ko.virtualElements.hasBindingValue(node); + default: return false; + } + }, + + 'getBindings': function(node, bindingContext) { + var bindingsString = this['getBindingsString'](node, bindingContext), + parsedBindings = bindingsString ? this['parseBindingsString'](bindingsString, bindingContext, node) : null; + return ko.components.addBindingsForCustomElement(parsedBindings, node, bindingContext, /* valueAccessors */ false); + }, + + 'getBindingAccessors': function(node, bindingContext) { + var bindingsString = this['getBindingsString'](node, bindingContext), + parsedBindings = bindingsString ? this['parseBindingsString'](bindingsString, bindingContext, node, { 'valueAccessors': true }) : null; + return ko.components.addBindingsForCustomElement(parsedBindings, node, bindingContext, /* valueAccessors */ true); + }, + + // The following function is only used internally by this default provider. + // It's not part of the interface definition for a general binding provider. + 'getBindingsString': function(node, bindingContext) { + switch (node.nodeType) { + case 1: return node.getAttribute(defaultBindingAttributeName); // Element + case 8: return ko.virtualElements.virtualNodeBindingValue(node); // Comment node + default: return null; + } + }, + + // The following function is only used internally by this default provider. + // It's not part of the interface definition for a general binding provider. + 'parseBindingsString': function(bindingsString, bindingContext, node, options) { + try { + var bindingFunction = createBindingsStringEvaluatorViaCache(bindingsString, this.bindingCache, options); + return bindingFunction(bindingContext, node); + } catch (ex) { + ex.message = "Unable to parse bindings.\nBindings value: " + bindingsString + "\nMessage: " + ex.message; + throw ex; + } + } + }); + + ko.bindingProvider['instance'] = new ko.bindingProvider(); + + function createBindingsStringEvaluatorViaCache(bindingsString, cache, options) { + var cacheKey = bindingsString + (options && options['valueAccessors'] || ''); + return cache[cacheKey] + || (cache[cacheKey] = createBindingsStringEvaluator(bindingsString, options)); + } + + function createBindingsStringEvaluator(bindingsString, options) { + // Build the source for a function that evaluates "expression" + // For each scope variable, add an extra level of "with" nesting + // Example result: with(sc1) { with(sc0) { return (expression) } } + var rewrittenBindings = ko.expressionRewriting.preProcessBindings(bindingsString, options), + functionBody = "with($context){with($data||{}){return{" + rewrittenBindings + "}}}"; + return new Function("$context", "$element", functionBody); + } + })(); + + ko.exportSymbol('bindingProvider', ko.bindingProvider); + (function () { + // Hide or don't minify context properties, see https://github.com/knockout/knockout/issues/2294 + var contextSubscribable = ko.utils.createSymbolOrString('_subscribable'); + var contextAncestorBindingInfo = ko.utils.createSymbolOrString('_ancestorBindingInfo'); + var contextDataDependency = ko.utils.createSymbolOrString('_dataDependency'); + + ko.bindingHandlers = {}; + + // The following element types will not be recursed into during binding. + var bindingDoesNotRecurseIntoElementTypes = { + // Don't want bindings that operate on text nodes to mutate <script> and <textarea> contents, + // because it's unexpected and a potential XSS issue. + // Also bindings should not operate on <template> elements since this breaks in Internet Explorer + // and because such elements' contents are always intended to be bound in a different context + // from where they appear in the document. + 'script': true, + 'textarea': true, + 'template': true + }; + + // Use an overridable method for retrieving binding handlers so that plugins may support dynamically created handlers + ko['getBindingHandler'] = function(bindingKey) { + return ko.bindingHandlers[bindingKey]; + }; + + var inheritParentVm = {}; + + // The ko.bindingContext constructor is only called directly to create the root context. For child + // contexts, use bindingContext.createChildContext or bindingContext.extend. + ko.bindingContext = function(dataItemOrAccessor, parentContext, dataItemAlias, extendCallback, options) { + + // The binding context object includes static properties for the current, parent, and root view models. + // If a view model is actually stored in an observable, the corresponding binding context object, and + // any child contexts, must be updated when the view model is changed. + function updateContext() { + // Most of the time, the context will directly get a view model object, but if a function is given, + // we call the function to retrieve the view model. If the function accesses any observables or returns + // an observable, the dependency is tracked, and those observables can later cause the binding + // context to be updated. + var dataItemOrObservable = isFunc ? realDataItemOrAccessor() : realDataItemOrAccessor, + dataItem = ko.utils.unwrapObservable(dataItemOrObservable); + + if (parentContext) { + // Copy $root and any custom properties from the parent context + ko.utils.extend(self, parentContext); + + // Copy Symbol properties + if (contextAncestorBindingInfo in parentContext) { + self[contextAncestorBindingInfo] = parentContext[contextAncestorBindingInfo]; + } + } else { + self['$parents'] = []; + self['$root'] = dataItem; + + // Export 'ko' in the binding context so it will be available in bindings and templates + // even if 'ko' isn't exported as a global, such as when using an AMD loader. + // See https://github.com/SteveSanderson/knockout/issues/490 + self['ko'] = ko; + } + + self[contextSubscribable] = subscribable; + + if (shouldInheritData) { + dataItem = self['$data']; + } else { + self['$rawData'] = dataItemOrObservable; + self['$data'] = dataItem; + } + + if (dataItemAlias) + self[dataItemAlias] = dataItem; + + // The extendCallback function is provided when creating a child context or extending a context. + // It handles the specific actions needed to finish setting up the binding context. Actions in this + // function could also add dependencies to this binding context. + if (extendCallback) + extendCallback(self, parentContext, dataItem); + + // When a "parent" context is given and we don't already have a dependency on its context, register a dependency on it. + // Thus whenever the parent context is updated, this context will also be updated. + if (parentContext && parentContext[contextSubscribable] && !ko.computedContext.computed().hasAncestorDependency(parentContext[contextSubscribable])) { + parentContext[contextSubscribable](); + } + + if (dataDependency) { + self[contextDataDependency] = dataDependency; + } + + return self['$data']; + } + + var self = this, + shouldInheritData = dataItemOrAccessor === inheritParentVm, + realDataItemOrAccessor = shouldInheritData ? undefined : dataItemOrAccessor, + isFunc = typeof(realDataItemOrAccessor) == "function" && !ko.isObservable(realDataItemOrAccessor), + nodes, + subscribable, + dataDependency = options && options['dataDependency']; + + if (options && options['exportDependencies']) { + // The "exportDependencies" option means that the calling code will track any dependencies and re-create + // the binding context when they change. + updateContext(); + } else { + subscribable = ko.pureComputed(updateContext); + subscribable.peek(); + + // At this point, the binding context has been initialized, and the "subscribable" computed observable is + // subscribed to any observables that were accessed in the process. If there is nothing to track, the + // computed will be inactive, and we can safely throw it away. If it's active, the computed is stored in + // the context object. + if (subscribable.isActive()) { + // Always notify because even if the model ($data) hasn't changed, other context properties might have changed + subscribable['equalityComparer'] = null; + } else { + self[contextSubscribable] = undefined; + } + } + } + + // Extend the binding context hierarchy with a new view model object. If the parent context is watching + // any observables, the new child context will automatically get a dependency on the parent context. + // But this does not mean that the $data value of the child context will also get updated. If the child + // view model also depends on the parent view model, you must provide a function that returns the correct + // view model on each update. + ko.bindingContext.prototype['createChildContext'] = function (dataItemOrAccessor, dataItemAlias, extendCallback, options) { + if (!options && dataItemAlias && typeof dataItemAlias == "object") { + options = dataItemAlias; + dataItemAlias = options['as']; + extendCallback = options['extend']; + } + + if (dataItemAlias && options && options['noChildContext']) { + var isFunc = typeof(dataItemOrAccessor) == "function" && !ko.isObservable(dataItemOrAccessor); + return new ko.bindingContext(inheritParentVm, this, null, function (self) { + if (extendCallback) + extendCallback(self); + self[dataItemAlias] = isFunc ? dataItemOrAccessor() : dataItemOrAccessor; + }, options); + } + + return new ko.bindingContext(dataItemOrAccessor, this, dataItemAlias, function (self, parentContext) { + // Extend the context hierarchy by setting the appropriate pointers + self['$parentContext'] = parentContext; + self['$parent'] = parentContext['$data']; + self['$parents'] = (parentContext['$parents'] || []).slice(0); + self['$parents'].unshift(self['$parent']); + if (extendCallback) + extendCallback(self); + }, options); + }; + + // Extend the binding context with new custom properties. This doesn't change the context hierarchy. + // Similarly to "child" contexts, provide a function here to make sure that the correct values are set + // when an observable view model is updated. + ko.bindingContext.prototype['extend'] = function(properties, options) { + return new ko.bindingContext(inheritParentVm, this, null, function(self, parentContext) { + ko.utils.extend(self, typeof(properties) == "function" ? properties(self) : properties); + }, options); + }; + + var boundElementDomDataKey = ko.utils.domData.nextKey(); + + function asyncContextDispose(node) { + var bindingInfo = ko.utils.domData.get(node, boundElementDomDataKey), + asyncContext = bindingInfo && bindingInfo.asyncContext; + if (asyncContext) { + bindingInfo.asyncContext = null; + asyncContext.notifyAncestor(); + } + } + function AsyncCompleteContext(node, bindingInfo, ancestorBindingInfo) { + this.node = node; + this.bindingInfo = bindingInfo; + this.asyncDescendants = []; + this.childrenComplete = false; + + if (!bindingInfo.asyncContext) { + ko.utils.domNodeDisposal.addDisposeCallback(node, asyncContextDispose); + } + + if (ancestorBindingInfo && ancestorBindingInfo.asyncContext) { + ancestorBindingInfo.asyncContext.asyncDescendants.push(node); + this.ancestorBindingInfo = ancestorBindingInfo; + } + } + AsyncCompleteContext.prototype.notifyAncestor = function () { + if (this.ancestorBindingInfo && this.ancestorBindingInfo.asyncContext) { + this.ancestorBindingInfo.asyncContext.descendantComplete(this.node); + } + }; + AsyncCompleteContext.prototype.descendantComplete = function (node) { + ko.utils.arrayRemoveItem(this.asyncDescendants, node); + if (!this.asyncDescendants.length && this.childrenComplete) { + this.completeChildren(); + } + }; + AsyncCompleteContext.prototype.completeChildren = function () { + this.childrenComplete = true; + if (this.bindingInfo.asyncContext && !this.asyncDescendants.length) { + this.bindingInfo.asyncContext = null; + ko.utils.domNodeDisposal.removeDisposeCallback(this.node, asyncContextDispose); + ko.bindingEvent.notify(this.node, ko.bindingEvent.descendantsComplete); + this.notifyAncestor(); + } + }; + + ko.bindingEvent = { + childrenComplete: "childrenComplete", + descendantsComplete : "descendantsComplete", + + subscribe: function (node, event, callback, context, options) { + var bindingInfo = ko.utils.domData.getOrSet(node, boundElementDomDataKey, {}); + if (!bindingInfo.eventSubscribable) { + bindingInfo.eventSubscribable = new ko.subscribable; + } + if (options && options['notifyImmediately'] && bindingInfo.notifiedEvents[event]) { + ko.dependencyDetection.ignore(callback, context, [node]); + } + return bindingInfo.eventSubscribable.subscribe(callback, context, event); + }, + + notify: function (node, event) { + var bindingInfo = ko.utils.domData.get(node, boundElementDomDataKey); + if (bindingInfo) { + bindingInfo.notifiedEvents[event] = true; + if (bindingInfo.eventSubscribable) { + bindingInfo.eventSubscribable['notifySubscribers'](node, event); + } + if (event == ko.bindingEvent.childrenComplete) { + if (bindingInfo.asyncContext) { + bindingInfo.asyncContext.completeChildren(); + } else if (bindingInfo.asyncContext === undefined && bindingInfo.eventSubscribable && bindingInfo.eventSubscribable.hasSubscriptionsForEvent(ko.bindingEvent.descendantsComplete)) { + // It's currently an error to register a descendantsComplete handler for a node that was never registered as completing asynchronously. + // That's because without the asyncContext, we don't have a way to know that all descendants have completed. + throw new Error("descendantsComplete event not supported for bindings on this node"); + } + } + } + }, + + startPossiblyAsyncContentBinding: function (node, bindingContext) { + var bindingInfo = ko.utils.domData.getOrSet(node, boundElementDomDataKey, {}); + + if (!bindingInfo.asyncContext) { + bindingInfo.asyncContext = new AsyncCompleteContext(node, bindingInfo, bindingContext[contextAncestorBindingInfo]); + } + + // If the provided context was already extended with this node's binding info, just return the extended context + if (bindingContext[contextAncestorBindingInfo] == bindingInfo) { + return bindingContext; + } + + return bindingContext['extend'](function (ctx) { + ctx[contextAncestorBindingInfo] = bindingInfo; + }); + } + }; + + // Returns the valueAccessor function for a binding value + function makeValueAccessor(value) { + return function() { + return value; + }; + } + + // Returns the value of a valueAccessor function + function evaluateValueAccessor(valueAccessor) { + return valueAccessor(); + } + + // Given a function that returns bindings, create and return a new object that contains + // binding value-accessors functions. Each accessor function calls the original function + // so that it always gets the latest value and all dependencies are captured. This is used + // by ko.applyBindingsToNode and getBindingsAndMakeAccessors. + function makeAccessorsFromFunction(callback) { + return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) { + return function() { + return callback()[key]; + }; + }); + } + + // Given a bindings function or object, create and return a new object that contains + // binding value-accessors functions. This is used by ko.applyBindingsToNode. + function makeBindingAccessors(bindings, context, node) { + if (typeof bindings === 'function') { + return makeAccessorsFromFunction(bindings.bind(null, context, node)); + } else { + return ko.utils.objectMap(bindings, makeValueAccessor); + } + } + + // This function is used if the binding provider doesn't include a getBindingAccessors function. + // It must be called with 'this' set to the provider instance. + function getBindingsAndMakeAccessors(node, context) { + return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context)); + } + + function validateThatBindingIsAllowedForVirtualElements(bindingName) { + var validator = ko.virtualElements.allowedBindings[bindingName]; + if (!validator) + throw new Error("The binding '" + bindingName + "' cannot be used with virtual elements") + } + + function applyBindingsToDescendantsInternal(bindingContext, elementOrVirtualElement) { + var nextInQueue = ko.virtualElements.firstChild(elementOrVirtualElement); + + if (nextInQueue) { + var currentChild, + provider = ko.bindingProvider['instance'], + preprocessNode = provider['preprocessNode']; + + // Preprocessing allows a binding provider to mutate a node before bindings are applied to it. For example it's + // possible to insert new siblings after it, and/or replace the node with a different one. This can be used to + // implement custom binding syntaxes, such as {{ value }} for string interpolation, or custom element types that + // trigger insertion of <template> contents at that point in the document. + if (preprocessNode) { + while (currentChild = nextInQueue) { + nextInQueue = ko.virtualElements.nextSibling(currentChild); + preprocessNode.call(provider, currentChild); + } + // Reset nextInQueue for the next loop + nextInQueue = ko.virtualElements.firstChild(elementOrVirtualElement); + } + + while (currentChild = nextInQueue) { + // Keep a record of the next child *before* applying bindings, in case the binding removes the current child from its position + nextInQueue = ko.virtualElements.nextSibling(currentChild); + applyBindingsToNodeAndDescendantsInternal(bindingContext, currentChild); + } + } + ko.bindingEvent.notify(elementOrVirtualElement, ko.bindingEvent.childrenComplete); + } + + function applyBindingsToNodeAndDescendantsInternal(bindingContext, nodeVerified) { + var bindingContextForDescendants = bindingContext; + + var isElement = (nodeVerified.nodeType === 1); + if (isElement) // Workaround IE <= 8 HTML parsing weirdness + ko.virtualElements.normaliseVirtualElementDomStructure(nodeVerified); + + // Perf optimisation: Apply bindings only if... + // (1) We need to store the binding info for the node (all element nodes) + // (2) It might have bindings (e.g., it has a data-bind attribute, or it's a marker for a containerless template) + var shouldApplyBindings = isElement || ko.bindingProvider['instance']['nodeHasBindings'](nodeVerified); + if (shouldApplyBindings) + bindingContextForDescendants = applyBindingsToNodeInternal(nodeVerified, null, bindingContext)['bindingContextForDescendants']; + + if (bindingContextForDescendants && !bindingDoesNotRecurseIntoElementTypes[ko.utils.tagNameLower(nodeVerified)]) { + applyBindingsToDescendantsInternal(bindingContextForDescendants, nodeVerified); + } + } + + function topologicalSortBindings(bindings) { + // Depth-first sort + var result = [], // The list of key/handler pairs that we will return + bindingsConsidered = {}, // A temporary record of which bindings are already in 'result' + cyclicDependencyStack = []; // Keeps track of a depth-search so that, if there's a cycle, we know which bindings caused it + ko.utils.objectForEach(bindings, function pushBinding(bindingKey) { + if (!bindingsConsidered[bindingKey]) { + var binding = ko['getBindingHandler'](bindingKey); + if (binding) { + // First add dependencies (if any) of the current binding + if (binding['after']) { + cyclicDependencyStack.push(bindingKey); + ko.utils.arrayForEach(binding['after'], function(bindingDependencyKey) { + if (bindings[bindingDependencyKey]) { + if (ko.utils.arrayIndexOf(cyclicDependencyStack, bindingDependencyKey) !== -1) { + throw Error("Cannot combine the following bindings, because they have a cyclic dependency: " + cyclicDependencyStack.join(", ")); + } else { + pushBinding(bindingDependencyKey); + } + } + }); + cyclicDependencyStack.length--; + } + // Next add the current binding + result.push({ key: bindingKey, handler: binding }); + } + bindingsConsidered[bindingKey] = true; + } + }); + + return result; + } + + function applyBindingsToNodeInternal(node, sourceBindings, bindingContext) { + var bindingInfo = ko.utils.domData.getOrSet(node, boundElementDomDataKey, {}); + + // Prevent multiple applyBindings calls for the same node, except when a binding value is specified + var alreadyBound = bindingInfo.alreadyBound; + if (!sourceBindings) { + if (alreadyBound) { + throw Error("You cannot apply bindings multiple times to the same element."); + } + bindingInfo.alreadyBound = true; + } + if (!alreadyBound) { + bindingInfo.context = bindingContext; + } + if (!bindingInfo.notifiedEvents) { + bindingInfo.notifiedEvents = {}; + } + + // Use bindings if given, otherwise fall back on asking the bindings provider to give us some bindings + var bindings; + if (sourceBindings && typeof sourceBindings !== 'function') { + bindings = sourceBindings; + } else { + var provider = ko.bindingProvider['instance'], + getBindings = provider['getBindingAccessors'] || getBindingsAndMakeAccessors; + + // Get the binding from the provider within a computed observable so that we can update the bindings whenever + // the binding context is updated or if the binding provider accesses observables. + var bindingsUpdater = ko.dependentObservable( + function() { + bindings = sourceBindings ? sourceBindings(bindingContext, node) : getBindings.call(provider, node, bindingContext); + // Register a dependency on the binding context to support observable view models. + if (bindings) { + if (bindingContext[contextSubscribable]) { + bindingContext[contextSubscribable](); + } + if (bindingContext[contextDataDependency]) { + bindingContext[contextDataDependency](); + } + } + return bindings; + }, + null, { disposeWhenNodeIsRemoved: node } + ); + + if (!bindings || !bindingsUpdater.isActive()) + bindingsUpdater = null; + } + + var contextToExtend = bindingContext; + var bindingHandlerThatControlsDescendantBindings; + if (bindings) { + // Return the value accessor for a given binding. When bindings are static (won't be updated because of a binding + // context update), just return the value accessor from the binding. Otherwise, return a function that always gets + // the latest binding value and registers a dependency on the binding updater. + var getValueAccessor = bindingsUpdater + ? function(bindingKey) { + return function() { + return evaluateValueAccessor(bindingsUpdater()[bindingKey]); + }; + } : function(bindingKey) { + return bindings[bindingKey]; + }; + + // Use of allBindings as a function is maintained for backwards compatibility, but its use is deprecated + function allBindings() { + return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor); + } + // The following is the 3.x allBindings API + allBindings['get'] = function(key) { + return bindings[key] && evaluateValueAccessor(getValueAccessor(key)); + }; + allBindings['has'] = function(key) { + return key in bindings; + }; + + if (ko.bindingEvent.childrenComplete in bindings) { + ko.bindingEvent.subscribe(node, ko.bindingEvent.childrenComplete, function () { + var callback = evaluateValueAccessor(bindings[ko.bindingEvent.childrenComplete]); + if (callback) { + var nodes = ko.virtualElements.childNodes(node); + if (nodes.length) { + callback(nodes, ko.dataFor(nodes[0])); + } + } + }); + } + + if (ko.bindingEvent.descendantsComplete in bindings) { + contextToExtend = ko.bindingEvent.startPossiblyAsyncContentBinding(node, bindingContext); + ko.bindingEvent.subscribe(node, ko.bindingEvent.descendantsComplete, function () { + var callback = evaluateValueAccessor(bindings[ko.bindingEvent.descendantsComplete]); + if (callback && ko.virtualElements.firstChild(node)) { + callback(node); + } + }); + } + + // First put the bindings into the right order + var orderedBindings = topologicalSortBindings(bindings); + + // Go through the sorted bindings, calling init and update for each + ko.utils.arrayForEach(orderedBindings, function(bindingKeyAndHandler) { + // Note that topologicalSortBindings has already filtered out any nonexistent binding handlers, + // so bindingKeyAndHandler.handler will always be nonnull. + var handlerInitFn = bindingKeyAndHandler.handler["init"], + handlerUpdateFn = bindingKeyAndHandler.handler["update"], + bindingKey = bindingKeyAndHandler.key; + + if (node.nodeType === 8) { + validateThatBindingIsAllowedForVirtualElements(bindingKey); + } + + try { + // Run init, ignoring any dependencies + if (typeof handlerInitFn == "function") { + ko.dependencyDetection.ignore(function() { + var initResult = handlerInitFn(node, getValueAccessor(bindingKey), allBindings, contextToExtend['$data'], contextToExtend); + + // If this binding handler claims to control descendant bindings, make a note of this + if (initResult && initResult['controlsDescendantBindings']) { + if (bindingHandlerThatControlsDescendantBindings !== undefined) + throw new Error("Multiple bindings (" + bindingHandlerThatControlsDescendantBindings + " and " + bindingKey + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element."); + bindingHandlerThatControlsDescendantBindings = bindingKey; + } + }); + } + + // Run update in its own computed wrapper + if (typeof handlerUpdateFn == "function") { + ko.dependentObservable( + function() { + handlerUpdateFn(node, getValueAccessor(bindingKey), allBindings, contextToExtend['$data'], contextToExtend); + }, + null, + { disposeWhenNodeIsRemoved: node } + ); + } + } catch (ex) { + ex.message = "Unable to process binding \"" + bindingKey + ": " + bindings[bindingKey] + "\"\nMessage: " + ex.message; + throw ex; + } + }); + } + + var shouldBindDescendants = bindingHandlerThatControlsDescendantBindings === undefined; + return { + 'shouldBindDescendants': shouldBindDescendants, + 'bindingContextForDescendants': shouldBindDescendants && contextToExtend + }; + }; + + ko.storedBindingContextForNode = function (node) { + var bindingInfo = ko.utils.domData.get(node, boundElementDomDataKey); + return bindingInfo && bindingInfo.context; + } + + function getBindingContext(viewModelOrBindingContext, extendContextCallback) { + return viewModelOrBindingContext && (viewModelOrBindingContext instanceof ko.bindingContext) + ? viewModelOrBindingContext + : new ko.bindingContext(viewModelOrBindingContext, undefined, undefined, extendContextCallback); + } + + ko.applyBindingAccessorsToNode = function (node, bindings, viewModelOrBindingContext) { + if (node.nodeType === 1) // If it's an element, workaround IE <= 8 HTML parsing weirdness + ko.virtualElements.normaliseVirtualElementDomStructure(node); + return applyBindingsToNodeInternal(node, bindings, getBindingContext(viewModelOrBindingContext)); + }; + + ko.applyBindingsToNode = function (node, bindings, viewModelOrBindingContext) { + var context = getBindingContext(viewModelOrBindingContext); + return ko.applyBindingAccessorsToNode(node, makeBindingAccessors(bindings, context, node), context); + }; + + ko.applyBindingsToDescendants = function(viewModelOrBindingContext, rootNode) { + if (rootNode.nodeType === 1 || rootNode.nodeType === 8) + applyBindingsToDescendantsInternal(getBindingContext(viewModelOrBindingContext), rootNode); + }; + + ko.applyBindings = function (viewModelOrBindingContext, rootNode, extendContextCallback) { + // If jQuery is loaded after Knockout, we won't initially have access to it. So save it here. + if (!jQueryInstance && window['jQuery']) { + jQueryInstance = window['jQuery']; + } + + if (arguments.length < 2) { + rootNode = document.body; + if (!rootNode) { + throw Error("ko.applyBindings: could not find document.body; has the document been loaded?"); + } + } else if (!rootNode || (rootNode.nodeType !== 1 && rootNode.nodeType !== 8)) { + throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node"); + } + + applyBindingsToNodeAndDescendantsInternal(getBindingContext(viewModelOrBindingContext, extendContextCallback), rootNode); + }; + + // Retrieving binding context from arbitrary nodes + ko.contextFor = function(node) { + // We can only do something meaningful for elements and comment nodes (in particular, not text nodes, as IE can't store domdata for them) + if (node && (node.nodeType === 1 || node.nodeType === 8)) { + return ko.storedBindingContextForNode(node); + } + return undefined; + }; + ko.dataFor = function(node) { + var context = ko.contextFor(node); + return context ? context['$data'] : undefined; + }; + + ko.exportSymbol('bindingHandlers', ko.bindingHandlers); + ko.exportSymbol('bindingEvent', ko.bindingEvent); + ko.exportSymbol('bindingEvent.subscribe', ko.bindingEvent.subscribe); + ko.exportSymbol('bindingEvent.startPossiblyAsyncContentBinding', ko.bindingEvent.startPossiblyAsyncContentBinding); + ko.exportSymbol('applyBindings', ko.applyBindings); + ko.exportSymbol('applyBindingsToDescendants', ko.applyBindingsToDescendants); + ko.exportSymbol('applyBindingAccessorsToNode', ko.applyBindingAccessorsToNode); + ko.exportSymbol('applyBindingsToNode', ko.applyBindingsToNode); + ko.exportSymbol('contextFor', ko.contextFor); + ko.exportSymbol('dataFor', ko.dataFor); + })(); + (function(undefined) { + var loadingSubscribablesCache = {}, // Tracks component loads that are currently in flight + loadedDefinitionsCache = {}; // Tracks component loads that have already completed + + ko.components = { + get: function(componentName, callback) { + var cachedDefinition = getObjectOwnProperty(loadedDefinitionsCache, componentName); + if (cachedDefinition) { + // It's already loaded and cached. Reuse the same definition object. + // Note that for API consistency, even cache hits complete asynchronously by default. + // You can bypass this by putting synchronous:true on your component config. + if (cachedDefinition.isSynchronousComponent) { + ko.dependencyDetection.ignore(function() { // See comment in loaderRegistryBehaviors.js for reasoning + callback(cachedDefinition.definition); + }); + } else { + ko.tasks.schedule(function() { callback(cachedDefinition.definition); }); + } + } else { + // Join the loading process that is already underway, or start a new one. + loadComponentAndNotify(componentName, callback); + } + }, + + clearCachedDefinition: function(componentName) { + delete loadedDefinitionsCache[componentName]; + }, + + _getFirstResultFromLoaders: getFirstResultFromLoaders + }; + + function getObjectOwnProperty(obj, propName) { + return Object.prototype.hasOwnProperty.call(obj, propName) ? obj[propName] : undefined; + } + + function loadComponentAndNotify(componentName, callback) { + var subscribable = getObjectOwnProperty(loadingSubscribablesCache, componentName), + completedAsync; + if (!subscribable) { + // It's not started loading yet. Start loading, and when it's done, move it to loadedDefinitionsCache. + subscribable = loadingSubscribablesCache[componentName] = new ko.subscribable(); + subscribable.subscribe(callback); + + beginLoadingComponent(componentName, function(definition, config) { + var isSynchronousComponent = !!(config && config['synchronous']); + loadedDefinitionsCache[componentName] = { definition: definition, isSynchronousComponent: isSynchronousComponent }; + delete loadingSubscribablesCache[componentName]; + + // For API consistency, all loads complete asynchronously. However we want to avoid + // adding an extra task schedule if it's unnecessary (i.e., the completion is already + // async). + // + // You can bypass the 'always asynchronous' feature by putting the synchronous:true + // flag on your component configuration when you register it. + if (completedAsync || isSynchronousComponent) { + // Note that notifySubscribers ignores any dependencies read within the callback. + // See comment in loaderRegistryBehaviors.js for reasoning + subscribable['notifySubscribers'](definition); + } else { + ko.tasks.schedule(function() { + subscribable['notifySubscribers'](definition); + }); } }); - cyclicDependencyStack.length--; + completedAsync = true; + } else { + subscribable.subscribe(callback); } - // Next add the current binding - result.push({ key: bindingKey, handler: binding }); } - bindingsConsidered[bindingKey] = true; - } - }); - return result; - } + function beginLoadingComponent(componentName, callback) { + getFirstResultFromLoaders('getConfig', [componentName], function(config) { + if (config) { + // We have a config, so now load its definition + getFirstResultFromLoaders('loadComponent', [componentName, config], function(definition) { + callback(definition, config); + }); + } else { + // The component has no config - it's unknown to all the loaders. + // Note that this is not an error (e.g., a module loading error) - that would abort the + // process and this callback would not run. For this callback to run, all loaders must + // have confirmed they don't know about this component. + callback(null, null); + } + }); + } - function applyBindingsToNodeInternal(node, sourceBindings, bindingContext, bindingContextMayDifferFromDomParentElement) { - // Prevent multiple applyBindings calls for the same node, except when a binding value is specified - var alreadyBound = ko.utils.domData.get(node, boundElementDomDataKey); - if (!sourceBindings) { - if (alreadyBound) { - throw Error("You cannot apply bindings multiple times to the same element."); - } - ko.utils.domData.set(node, boundElementDomDataKey, true); - } + function getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders) { + // On the first call in the stack, start with the full set of loaders + if (!candidateLoaders) { + candidateLoaders = ko.components['loaders'].slice(0); // Use a copy, because we'll be mutating this array + } - // Optimization: Don't store the binding context on this node if it's definitely the same as on node.parentNode, because - // we can easily recover it just by scanning up the node's ancestors in the DOM - // (note: here, parent node means "real DOM parent" not "virtual parent", as there's no O(1) way to find the virtual parent) - if (!alreadyBound && bindingContextMayDifferFromDomParentElement) - ko.storedBindingContextForNode(node, bindingContext); - - // Use bindings if given, otherwise fall back on asking the bindings provider to give us some bindings - var bindings; - if (sourceBindings && typeof sourceBindings !== 'function') { - bindings = sourceBindings; - } else { - var provider = ko.bindingProvider['instance'], - getBindings = provider['getBindingAccessors'] || getBindingsAndMakeAccessors; - - // Get the binding from the provider within a computed observable so that we can update the bindings whenever - // the binding context is updated or if the binding provider accesses observables. - var bindingsUpdater = ko.dependentObservable( - function() { - bindings = sourceBindings ? sourceBindings(bindingContext, node) : getBindings.call(provider, node, bindingContext); - // Register a dependency on the binding context to support observable view models. - if (bindings && bindingContext._subscribable) - bindingContext._subscribable(); - return bindings; - }, - null, { disposeWhenNodeIsRemoved: node } - ); + // Try the next candidate + var currentCandidateLoader = candidateLoaders.shift(); + if (currentCandidateLoader) { + var methodInstance = currentCandidateLoader[methodName]; + if (methodInstance) { + var wasAborted = false, + synchronousReturnValue = methodInstance.apply(currentCandidateLoader, argsExceptCallback.concat(function(result) { + if (wasAborted) { + callback(null); + } else if (result !== null) { + // This candidate returned a value. Use it. + callback(result); + } else { + // Try the next candidate + getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders); + } + })); + + // Currently, loaders may not return anything synchronously. This leaves open the possibility + // that we'll extend the API to support synchronous return values in the future. It won't be + // a breaking change, because currently no loader is allowed to return anything except undefined. + if (synchronousReturnValue !== undefined) { + wasAborted = true; + + // Method to suppress exceptions will remain undocumented. This is only to keep + // KO's specs running tidily, since we can observe the loading got aborted without + // having exceptions cluttering up the console too. + if (!currentCandidateLoader['suppressLoaderExceptions']) { + throw new Error('Component loaders must supply values by invoking the callback, not by returning values synchronously.'); + } + } + } else { + // This candidate doesn't have the relevant handler. Synchronously move on to the next one. + getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders); + } + } else { + // No candidates returned a value + callback(null); + } + } - if (!bindings || !bindingsUpdater.isActive()) - bindingsUpdater = null; - } + // Reference the loaders via string name so it's possible for developers + // to replace the whole array by assigning to ko.components.loaders + ko.components['loaders'] = []; + + ko.exportSymbol('components', ko.components); + ko.exportSymbol('components.get', ko.components.get); + ko.exportSymbol('components.clearCachedDefinition', ko.components.clearCachedDefinition); + })(); + (function(undefined) { + + // The default loader is responsible for two things: + // 1. Maintaining the default in-memory registry of component configuration objects + // (i.e., the thing you're writing to when you call ko.components.register(someName, ...)) + // 2. Answering requests for components by fetching configuration objects + // from that default in-memory registry and resolving them into standard + // component definition objects (of the form { createViewModel: ..., template: ... }) + // Custom loaders may override either of these facilities, i.e., + // 1. To supply configuration objects from some other source (e.g., conventions) + // 2. Or, to resolve configuration objects by loading viewmodels/templates via arbitrary logic. + + var defaultConfigRegistry = {}; + + ko.components.register = function(componentName, config) { + if (!config) { + throw new Error('Invalid configuration for ' + componentName); + } - var bindingHandlerThatControlsDescendantBindings; - if (bindings) { - // Return the value accessor for a given binding. When bindings are static (won't be updated because of a binding - // context update), just return the value accessor from the binding. Otherwise, return a function that always gets - // the latest binding value and registers a dependency on the binding updater. - var getValueAccessor = bindingsUpdater - ? function(bindingKey) { - return function() { - return evaluateValueAccessor(bindingsUpdater()[bindingKey]); - }; - } : function(bindingKey) { - return bindings[bindingKey]; + if (ko.components.isRegistered(componentName)) { + throw new Error('Component ' + componentName + ' is already registered'); + } + + defaultConfigRegistry[componentName] = config; }; - // Use of allBindings as a function is maintained for backwards compatibility, but its use is deprecated - function allBindings() { - return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor); - } - // The following is the 3.x allBindings API - allBindings['get'] = function(key) { - return bindings[key] && evaluateValueAccessor(getValueAccessor(key)); - }; - allBindings['has'] = function(key) { - return key in bindings; - }; + ko.components.isRegistered = function(componentName) { + return Object.prototype.hasOwnProperty.call(defaultConfigRegistry, componentName); + }; - // First put the bindings into the right order - var orderedBindings = topologicalSortBindings(bindings); + ko.components.unregister = function(componentName) { + delete defaultConfigRegistry[componentName]; + ko.components.clearCachedDefinition(componentName); + }; - // Go through the sorted bindings, calling init and update for each - ko.utils.arrayForEach(orderedBindings, function(bindingKeyAndHandler) { - // Note that topologicalSortBindings has already filtered out any nonexistent binding handlers, - // so bindingKeyAndHandler.handler will always be nonnull. - var handlerInitFn = bindingKeyAndHandler.handler["init"], - handlerUpdateFn = bindingKeyAndHandler.handler["update"], - bindingKey = bindingKeyAndHandler.key; + ko.components.defaultLoader = { + 'getConfig': function(componentName, callback) { + var result = ko.components.isRegistered(componentName) + ? defaultConfigRegistry[componentName] + : null; + callback(result); + }, + + 'loadComponent': function(componentName, config, callback) { + var errorCallback = makeErrorCallback(componentName); + possiblyGetConfigFromAmd(errorCallback, config, function(loadedConfig) { + resolveConfig(componentName, errorCallback, loadedConfig, callback); + }); + }, - if (node.nodeType === 8) { - validateThatBindingIsAllowedForVirtualElements(bindingKey); - } + 'loadTemplate': function(componentName, templateConfig, callback) { + resolveTemplate(makeErrorCallback(componentName), templateConfig, callback); + }, - try { - // Run init, ignoring any dependencies - if (typeof handlerInitFn == "function") { - ko.dependencyDetection.ignore(function() { - var initResult = handlerInitFn(node, getValueAccessor(bindingKey), allBindings, bindingContext['$data'], bindingContext); + 'loadViewModel': function(componentName, viewModelConfig, callback) { + resolveViewModel(makeErrorCallback(componentName), viewModelConfig, callback); + } + }; - // If this binding handler claims to control descendant bindings, make a note of this - if (initResult && initResult['controlsDescendantBindings']) { - if (bindingHandlerThatControlsDescendantBindings !== undefined) - throw new Error("Multiple bindings (" + bindingHandlerThatControlsDescendantBindings + " and " + bindingKey + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element."); - bindingHandlerThatControlsDescendantBindings = bindingKey; + var createViewModelKey = 'createViewModel'; + + // Takes a config object of the form { template: ..., viewModel: ... }, and asynchronously convert it + // into the standard component definition format: + // { template: <ArrayOfDomNodes>, createViewModel: function(params, componentInfo) { ... } }. + // Since both template and viewModel may need to be resolved asynchronously, both tasks are performed + // in parallel, and the results joined when both are ready. We don't depend on any promises infrastructure, + // so this is implemented manually below. + function resolveConfig(componentName, errorCallback, config, callback) { + var result = {}, + makeCallBackWhenZero = 2, + tryIssueCallback = function() { + if (--makeCallBackWhenZero === 0) { + callback(result); } + }, + templateConfig = config['template'], + viewModelConfig = config['viewModel']; + + if (templateConfig) { + possiblyGetConfigFromAmd(errorCallback, templateConfig, function(loadedConfig) { + ko.components._getFirstResultFromLoaders('loadTemplate', [componentName, loadedConfig], function(resolvedTemplate) { + result['template'] = resolvedTemplate; + tryIssueCallback(); + }); }); + } else { + tryIssueCallback(); } - // Run update in its own computed wrapper - if (typeof handlerUpdateFn == "function") { - ko.dependentObservable( - function() { - handlerUpdateFn(node, getValueAccessor(bindingKey), allBindings, bindingContext['$data'], bindingContext); - }, - null, - { disposeWhenNodeIsRemoved: node } - ); + if (viewModelConfig) { + possiblyGetConfigFromAmd(errorCallback, viewModelConfig, function(loadedConfig) { + ko.components._getFirstResultFromLoaders('loadViewModel', [componentName, loadedConfig], function(resolvedViewModel) { + result[createViewModelKey] = resolvedViewModel; + tryIssueCallback(); + }); + }); + } else { + tryIssueCallback(); } - } catch (ex) { - ex.message = "Unable to process binding \"" + bindingKey + ": " + bindings[bindingKey] + "\"\nMessage: " + ex.message; - throw ex; } - }); - } - return { - 'shouldBindDescendants': bindingHandlerThatControlsDescendantBindings === undefined - }; - }; - - var storedBindingContextDomDataKey = ko.utils.domData.nextKey(); - ko.storedBindingContextForNode = function (node, bindingContext) { - if (arguments.length == 2) { - ko.utils.domData.set(node, storedBindingContextDomDataKey, bindingContext); - if (bindingContext._subscribable) - bindingContext._subscribable._addNode(node); - } else { - return ko.utils.domData.get(node, storedBindingContextDomDataKey); - } - } - - function getBindingContext(viewModelOrBindingContext) { - return viewModelOrBindingContext && (viewModelOrBindingContext instanceof ko.bindingContext) - ? viewModelOrBindingContext - : new ko.bindingContext(viewModelOrBindingContext); - } - - ko.applyBindingAccessorsToNode = function (node, bindings, viewModelOrBindingContext) { - if (node.nodeType === 1) // If it's an element, workaround IE <= 8 HTML parsing weirdness - ko.virtualElements.normaliseVirtualElementDomStructure(node); - return applyBindingsToNodeInternal(node, bindings, getBindingContext(viewModelOrBindingContext), true); - }; - - ko.applyBindingsToNode = function (node, bindings, viewModelOrBindingContext) { - var context = getBindingContext(viewModelOrBindingContext); - return ko.applyBindingAccessorsToNode(node, makeBindingAccessors(bindings, context, node), context); - }; - - ko.applyBindingsToDescendants = function(viewModelOrBindingContext, rootNode) { - if (rootNode.nodeType === 1 || rootNode.nodeType === 8) - applyBindingsToDescendantsInternal(getBindingContext(viewModelOrBindingContext), rootNode, true); - }; - - ko.applyBindings = function (viewModelOrBindingContext, rootNode) { - // If jQuery is loaded after Knockout, we won't initially have access to it. So save it here. - if (!jQueryInstance && window['jQuery']) { - jQueryInstance = window['jQuery']; - } + function resolveTemplate(errorCallback, templateConfig, callback) { + if (typeof templateConfig === 'string') { + // Markup - parse it + callback(ko.utils.parseHtmlFragment(templateConfig)); + } else if (templateConfig instanceof Array) { + // Assume already an array of DOM nodes - pass through unchanged + callback(templateConfig); + } else if (isDocumentFragment(templateConfig)) { + // Document fragment - use its child nodes + callback(ko.utils.makeArray(templateConfig.childNodes)); + } else if (templateConfig['element']) { + var element = templateConfig['element']; + if (isDomElement(element)) { + // Element instance - copy its child nodes + callback(cloneNodesFromTemplateSourceElement(element)); + } else if (typeof element === 'string') { + // Element ID - find it, then copy its child nodes + var elemInstance = document.getElementById(element); + if (elemInstance) { + callback(cloneNodesFromTemplateSourceElement(elemInstance)); + } else { + errorCallback('Cannot find element with ID ' + element); + } + } else { + errorCallback('Unknown element type: ' + element); + } + } else { + errorCallback('Unknown template value: ' + templateConfig); + } + } - if (rootNode && (rootNode.nodeType !== 1) && (rootNode.nodeType !== 8)) - throw new Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node"); - rootNode = rootNode || window.document.body; // Make "rootNode" parameter optional - - applyBindingsToNodeAndDescendantsInternal(getBindingContext(viewModelOrBindingContext), rootNode, true); - }; - - // Retrieving binding context from arbitrary nodes - ko.contextFor = function(node) { - // We can only do something meaningful for elements and comment nodes (in particular, not text nodes, as IE can't store domdata for them) - switch (node.nodeType) { - case 1: - case 8: - var context = ko.storedBindingContextForNode(node); - if (context) return context; - if (node.parentNode) return ko.contextFor(node.parentNode); - break; - } - return undefined; - }; - ko.dataFor = function(node) { - var context = ko.contextFor(node); - return context ? context['$data'] : undefined; - }; - - ko.exportSymbol('bindingHandlers', ko.bindingHandlers); - ko.exportSymbol('applyBindings', ko.applyBindings); - ko.exportSymbol('applyBindingsToDescendants', ko.applyBindingsToDescendants); - ko.exportSymbol('applyBindingAccessorsToNode', ko.applyBindingAccessorsToNode); - ko.exportSymbol('applyBindingsToNode', ko.applyBindingsToNode); - ko.exportSymbol('contextFor', ko.contextFor); - ko.exportSymbol('dataFor', ko.dataFor); -})(); -(function(undefined) { - var loadingSubscribablesCache = {}, // Tracks component loads that are currently in flight - loadedDefinitionsCache = {}; // Tracks component loads that have already completed - - ko.components = { - get: function(componentName, callback) { - var cachedDefinition = getObjectOwnProperty(loadedDefinitionsCache, componentName); - if (cachedDefinition) { - // It's already loaded and cached. Reuse the same definition object. - // Note that for API consistency, even cache hits complete asynchronously by default. - // You can bypass this by putting synchronous:true on your component config. - if (cachedDefinition.isSynchronousComponent) { - ko.dependencyDetection.ignore(function() { // See comment in loaderRegistryBehaviors.js for reasoning - callback(cachedDefinition.definition); - }); - } else { - ko.tasks.schedule(function() { callback(cachedDefinition.definition); }); + function resolveViewModel(errorCallback, viewModelConfig, callback) { + if (typeof viewModelConfig === 'function') { + // Constructor - convert to standard factory function format + // By design, this does *not* supply componentInfo to the constructor, as the intent is that + // componentInfo contains non-viewmodel data (e.g., the component's element) that should only + // be used in factory functions, not viewmodel constructors. + callback(function (params /*, componentInfo */) { + return new viewModelConfig(params); + }); + } else if (typeof viewModelConfig[createViewModelKey] === 'function') { + // Already a factory function - use it as-is + callback(viewModelConfig[createViewModelKey]); + } else if ('instance' in viewModelConfig) { + // Fixed object instance - promote to createViewModel format for API consistency + var fixedInstance = viewModelConfig['instance']; + callback(function (params, componentInfo) { + return fixedInstance; + }); + } else if ('viewModel' in viewModelConfig) { + // Resolved AMD module whose value is of the form { viewModel: ... } + resolveViewModel(errorCallback, viewModelConfig['viewModel'], callback); + } else { + errorCallback('Unknown viewModel value: ' + viewModelConfig); + } } - } else { - // Join the loading process that is already underway, or start a new one. - loadComponentAndNotify(componentName, callback); - } - }, - - clearCachedDefinition: function(componentName) { - delete loadedDefinitionsCache[componentName]; - }, - - _getFirstResultFromLoaders: getFirstResultFromLoaders - }; - - function getObjectOwnProperty(obj, propName) { - return obj.hasOwnProperty(propName) ? obj[propName] : undefined; - } - - function loadComponentAndNotify(componentName, callback) { - var subscribable = getObjectOwnProperty(loadingSubscribablesCache, componentName), - completedAsync; - if (!subscribable) { - // It's not started loading yet. Start loading, and when it's done, move it to loadedDefinitionsCache. - subscribable = loadingSubscribablesCache[componentName] = new ko.subscribable(); - subscribable.subscribe(callback); - - beginLoadingComponent(componentName, function(definition, config) { - var isSynchronousComponent = !!(config && config['synchronous']); - loadedDefinitionsCache[componentName] = { definition: definition, isSynchronousComponent: isSynchronousComponent }; - delete loadingSubscribablesCache[componentName]; - - // For API consistency, all loads complete asynchronously. However we want to avoid - // adding an extra task schedule if it's unnecessary (i.e., the completion is already - // async). - // - // You can bypass the 'always asynchronous' feature by putting the synchronous:true - // flag on your component configuration when you register it. - if (completedAsync || isSynchronousComponent) { - // Note that notifySubscribers ignores any dependencies read within the callback. - // See comment in loaderRegistryBehaviors.js for reasoning - subscribable['notifySubscribers'](definition); - } else { - ko.tasks.schedule(function() { - subscribable['notifySubscribers'](definition); - }); + + function cloneNodesFromTemplateSourceElement(elemInstance) { + switch (ko.utils.tagNameLower(elemInstance)) { + case 'script': + return ko.utils.parseHtmlFragment(elemInstance.text); + case 'textarea': + return ko.utils.parseHtmlFragment(elemInstance.value); + case 'template': + // For browsers with proper <template> element support (i.e., where the .content property + // gives a document fragment), use that document fragment. + if (isDocumentFragment(elemInstance.content)) { + return ko.utils.cloneNodes(elemInstance.content.childNodes); + } + } + + // Regular elements such as <div>, and <template> elements on old browsers that don't really + // understand <template> and just treat it as a regular container + return ko.utils.cloneNodes(elemInstance.childNodes); } - }); - completedAsync = true; - } else { - subscribable.subscribe(callback); - } - } - - function beginLoadingComponent(componentName, callback) { - getFirstResultFromLoaders('getConfig', [componentName], function(config) { - if (config) { - // We have a config, so now load its definition - getFirstResultFromLoaders('loadComponent', [componentName, config], function(definition) { - callback(definition, config); - }); - } else { - // The component has no config - it's unknown to all the loaders. - // Note that this is not an error (e.g., a module loading error) - that would abort the - // process and this callback would not run. For this callback to run, all loaders must - // have confirmed they don't know about this component. - callback(null, null); - } - }); - } - function getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders) { - // On the first call in the stack, start with the full set of loaders - if (!candidateLoaders) { - candidateLoaders = ko.components['loaders'].slice(0); // Use a copy, because we'll be mutating this array - } + function isDomElement(obj) { + if (window['HTMLElement']) { + return obj instanceof HTMLElement; + } else { + return obj && obj.tagName && obj.nodeType === 1; + } + } + + function isDocumentFragment(obj) { + if (window['DocumentFragment']) { + return obj instanceof DocumentFragment; + } else { + return obj && obj.nodeType === 11; + } + } - // Try the next candidate - var currentCandidateLoader = candidateLoaders.shift(); - if (currentCandidateLoader) { - var methodInstance = currentCandidateLoader[methodName]; - if (methodInstance) { - var wasAborted = false, - synchronousReturnValue = methodInstance.apply(currentCandidateLoader, argsExceptCallback.concat(function(result) { - if (wasAborted) { - callback(null); - } else if (result !== null) { - // This candidate returned a value. Use it. - callback(result); + function possiblyGetConfigFromAmd(errorCallback, config, callback) { + if (typeof config['require'] === 'string') { + // The config is the value of an AMD module + if (amdRequire || window['require']) { + (amdRequire || window['require'])([config['require']], function (module) { + if (module && typeof module === 'object' && module.__esModule && module.default) { + module = module.default; + } + callback(module); + }); } else { - // Try the next candidate - getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders); + errorCallback('Uses require, but no AMD loader is present'); + } + } else { + callback(config); + } + } + + function makeErrorCallback(componentName) { + return function (message) { + throw new Error('Component \'' + componentName + '\': ' + message); + }; + } + + ko.exportSymbol('components.register', ko.components.register); + ko.exportSymbol('components.isRegistered', ko.components.isRegistered); + ko.exportSymbol('components.unregister', ko.components.unregister); + + // Expose the default loader so that developers can directly ask it for configuration + // or to resolve configuration + ko.exportSymbol('components.defaultLoader', ko.components.defaultLoader); + + // By default, the default loader is the only registered component loader + ko.components['loaders'].push(ko.components.defaultLoader); + + // Privately expose the underlying config registry for use in old-IE shim + ko.components._allRegisteredComponents = defaultConfigRegistry; + })(); + (function (undefined) { + // Overridable API for determining which component name applies to a given node. By overriding this, + // you can for example map specific tagNames to components that are not preregistered. + ko.components['getComponentNameForNode'] = function(node) { + var tagNameLower = ko.utils.tagNameLower(node); + if (ko.components.isRegistered(tagNameLower)) { + // Try to determine that this node can be considered a *custom* element; see https://github.com/knockout/knockout/issues/1603 + if (tagNameLower.indexOf('-') != -1 || ('' + node) == "[object HTMLUnknownElement]" || (ko.utils.ieVersion <= 8 && node.tagName === tagNameLower)) { + return tagNameLower; + } + } + }; + + ko.components.addBindingsForCustomElement = function(allBindings, node, bindingContext, valueAccessors) { + // Determine if it's really a custom element matching a component + if (node.nodeType === 1) { + var componentName = ko.components['getComponentNameForNode'](node); + if (componentName) { + // It does represent a component, so add a component binding for it + allBindings = allBindings || {}; + + if (allBindings['component']) { + // Avoid silently overwriting some other 'component' binding that may already be on the element + throw new Error('Cannot use the "component" binding on a custom element matching a component'); + } + + var componentBindingValue = { 'name': componentName, 'params': getComponentParamsFromCustomElement(node, bindingContext) }; + + allBindings['component'] = valueAccessors + ? function() { return componentBindingValue; } + : componentBindingValue; } - })); + } + + return allBindings; + } + + var nativeBindingProviderInstance = new ko.bindingProvider(); + + function getComponentParamsFromCustomElement(elem, bindingContext) { + var paramsAttribute = elem.getAttribute('params'); + + if (paramsAttribute) { + var params = nativeBindingProviderInstance['parseBindingsString'](paramsAttribute, bindingContext, elem, { 'valueAccessors': true, 'bindingParams': true }), + rawParamComputedValues = ko.utils.objectMap(params, function(paramValue, paramName) { + return ko.computed(paramValue, null, { disposeWhenNodeIsRemoved: elem }); + }), + result = ko.utils.objectMap(rawParamComputedValues, function(paramValueComputed, paramName) { + var paramValue = paramValueComputed.peek(); + // Does the evaluation of the parameter value unwrap any observables? + if (!paramValueComputed.isActive()) { + // No it doesn't, so there's no need for any computed wrapper. Just pass through the supplied value directly. + // Example: "someVal: firstName, age: 123" (whether or not firstName is an observable/computed) + return paramValue; + } else { + // Yes it does. Supply a computed property that unwraps both the outer (binding expression) + // level of observability, and any inner (resulting model value) level of observability. + // This means the component doesn't have to worry about multiple unwrapping. If the value is a + // writable observable, the computed will also be writable and pass the value on to the observable. + return ko.computed({ + 'read': function() { + return ko.utils.unwrapObservable(paramValueComputed()); + }, + 'write': ko.isWriteableObservable(paramValue) && function(value) { + paramValueComputed()(value); + }, + disposeWhenNodeIsRemoved: elem + }); + } + }); - // Currently, loaders may not return anything synchronously. This leaves open the possibility - // that we'll extend the API to support synchronous return values in the future. It won't be - // a breaking change, because currently no loader is allowed to return anything except undefined. - if (synchronousReturnValue !== undefined) { - wasAborted = true; + // Give access to the raw computeds, as long as that wouldn't overwrite any custom param also called '$raw' + // This is in case the developer wants to react to outer (binding) observability separately from inner + // (model value) observability, or in case the model value observable has subobservables. + if (!Object.prototype.hasOwnProperty.call(result, '$raw')) { + result['$raw'] = rawParamComputedValues; + } - // Method to suppress exceptions will remain undocumented. This is only to keep - // KO's specs running tidily, since we can observe the loading got aborted without - // having exceptions cluttering up the console too. - if (!currentCandidateLoader['suppressLoaderExceptions']) { - throw new Error('Component loaders must supply values by invoking the callback, not by returning values synchronously.'); + return result; + } else { + // For consistency, absence of a "params" attribute is treated the same as the presence of + // any empty one. Otherwise component viewmodels need special code to check whether or not + // 'params' or 'params.$raw' is null/undefined before reading subproperties, which is annoying. + return { '$raw': {} }; } } - } else { - // This candidate doesn't have the relevant handler. Synchronously move on to the next one. - getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders); - } - } else { - // No candidates returned a value - callback(null); - } - } - // Reference the loaders via string name so it's possible for developers - // to replace the whole array by assigning to ko.components.loaders - ko.components['loaders'] = []; + // -------------------------------------------------------------------------------- + // Compatibility code for older (pre-HTML5) IE browsers - ko.exportSymbol('components', ko.components); - ko.exportSymbol('components.get', ko.components.get); - ko.exportSymbol('components.clearCachedDefinition', ko.components.clearCachedDefinition); -})(); -(function(undefined) { - - // The default loader is responsible for two things: - // 1. Maintaining the default in-memory registry of component configuration objects - // (i.e., the thing you're writing to when you call ko.components.register(someName, ...)) - // 2. Answering requests for components by fetching configuration objects - // from that default in-memory registry and resolving them into standard - // component definition objects (of the form { createViewModel: ..., template: ... }) - // Custom loaders may override either of these facilities, i.e., - // 1. To supply configuration objects from some other source (e.g., conventions) - // 2. Or, to resolve configuration objects by loading viewmodels/templates via arbitrary logic. - - var defaultConfigRegistry = {}; - - ko.components.register = function(componentName, config) { - if (!config) { - throw new Error('Invalid configuration for ' + componentName); - } + if (ko.utils.ieVersion < 9) { + // Whenever you preregister a component, enable it as a custom element in the current document + ko.components['register'] = (function(originalFunction) { + return function(componentName) { + document.createElement(componentName); // Allows IE<9 to parse markup containing the custom element + return originalFunction.apply(this, arguments); + } + })(ko.components['register']); + + // Whenever you create a document fragment, enable all preregistered component names as custom elements + // This is needed to make innerShiv/jQuery HTML parsing correctly handle the custom elements + document.createDocumentFragment = (function(originalFunction) { + return function() { + var newDocFrag = originalFunction(), + allComponents = ko.components._allRegisteredComponents; + for (var componentName in allComponents) { + if (Object.prototype.hasOwnProperty.call(allComponents, componentName)) { + newDocFrag.createElement(componentName); + } + } + return newDocFrag; + }; + })(document.createDocumentFragment); + } + })();(function(undefined) { + var componentLoadingOperationUniqueId = 0; + + ko.bindingHandlers['component'] = { + 'init': function(element, valueAccessor, ignored1, ignored2, bindingContext) { + var currentViewModel, + currentLoadingOperationId, + afterRenderSub, + disposeAssociatedComponentViewModel = function () { + var currentViewModelDispose = currentViewModel && currentViewModel['dispose']; + if (typeof currentViewModelDispose === 'function') { + currentViewModelDispose.call(currentViewModel); + } + if (afterRenderSub) { + afterRenderSub.dispose(); + } + afterRenderSub = null; + currentViewModel = null; + // Any in-flight loading operation is no longer relevant, so make sure we ignore its completion + currentLoadingOperationId = null; + }, + originalChildNodes = ko.utils.makeArray(ko.virtualElements.childNodes(element)); - if (ko.components.isRegistered(componentName)) { - throw new Error('Component ' + componentName + ' is already registered'); - } + ko.virtualElements.emptyNode(element); + ko.utils.domNodeDisposal.addDisposeCallback(element, disposeAssociatedComponentViewModel); - defaultConfigRegistry[componentName] = config; - }; - - ko.components.isRegistered = function(componentName) { - return defaultConfigRegistry.hasOwnProperty(componentName); - }; - - ko.components.unregister = function(componentName) { - delete defaultConfigRegistry[componentName]; - ko.components.clearCachedDefinition(componentName); - }; - - ko.components.defaultLoader = { - 'getConfig': function(componentName, callback) { - var result = defaultConfigRegistry.hasOwnProperty(componentName) - ? defaultConfigRegistry[componentName] - : null; - callback(result); - }, - - 'loadComponent': function(componentName, config, callback) { - var errorCallback = makeErrorCallback(componentName); - possiblyGetConfigFromAmd(errorCallback, config, function(loadedConfig) { - resolveConfig(componentName, errorCallback, loadedConfig, callback); - }); - }, + ko.computed(function () { + var value = ko.utils.unwrapObservable(valueAccessor()), + componentName, componentParams; - 'loadTemplate': function(componentName, templateConfig, callback) { - resolveTemplate(makeErrorCallback(componentName), templateConfig, callback); - }, + if (typeof value === 'string') { + componentName = value; + } else { + componentName = ko.utils.unwrapObservable(value['name']); + componentParams = ko.utils.unwrapObservable(value['params']); + } - 'loadViewModel': function(componentName, viewModelConfig, callback) { - resolveViewModel(makeErrorCallback(componentName), viewModelConfig, callback); - } - }; - - var createViewModelKey = 'createViewModel'; - - // Takes a config object of the form { template: ..., viewModel: ... }, and asynchronously convert it - // into the standard component definition format: - // { template: <ArrayOfDomNodes>, createViewModel: function(params, componentInfo) { ... } }. - // Since both template and viewModel may need to be resolved asynchronously, both tasks are performed - // in parallel, and the results joined when both are ready. We don't depend on any promises infrastructure, - // so this is implemented manually below. - function resolveConfig(componentName, errorCallback, config, callback) { - var result = {}, - makeCallBackWhenZero = 2, - tryIssueCallback = function() { - if (--makeCallBackWhenZero === 0) { - callback(result); - } - }, - templateConfig = config['template'], - viewModelConfig = config['viewModel']; - - if (templateConfig) { - possiblyGetConfigFromAmd(errorCallback, templateConfig, function(loadedConfig) { - ko.components._getFirstResultFromLoaders('loadTemplate', [componentName, loadedConfig], function(resolvedTemplate) { - result['template'] = resolvedTemplate; - tryIssueCallback(); - }); - }); - } else { - tryIssueCallback(); - } + if (!componentName) { + throw new Error('No component name specified'); + } - if (viewModelConfig) { - possiblyGetConfigFromAmd(errorCallback, viewModelConfig, function(loadedConfig) { - ko.components._getFirstResultFromLoaders('loadViewModel', [componentName, loadedConfig], function(resolvedViewModel) { - result[createViewModelKey] = resolvedViewModel; - tryIssueCallback(); - }); - }); - } else { - tryIssueCallback(); - } - } - - function resolveTemplate(errorCallback, templateConfig, callback) { - if (typeof templateConfig === 'string') { - // Markup - parse it - callback(ko.utils.parseHtmlFragment(templateConfig)); - } else if (templateConfig instanceof Array) { - // Assume already an array of DOM nodes - pass through unchanged - callback(templateConfig); - } else if (isDocumentFragment(templateConfig)) { - // Document fragment - use its child nodes - callback(ko.utils.makeArray(templateConfig.childNodes)); - } else if (templateConfig['element']) { - var element = templateConfig['element']; - if (isDomElement(element)) { - // Element instance - copy its child nodes - callback(cloneNodesFromTemplateSourceElement(element)); - } else if (typeof element === 'string') { - // Element ID - find it, then copy its child nodes - var elemInstance = document.getElementById(element); - if (elemInstance) { - callback(cloneNodesFromTemplateSourceElement(elemInstance)); - } else { - errorCallback('Cannot find element with ID ' + element); + var asyncContext = ko.bindingEvent.startPossiblyAsyncContentBinding(element, bindingContext); + + var loadingOperationId = currentLoadingOperationId = ++componentLoadingOperationUniqueId; + ko.components.get(componentName, function(componentDefinition) { + // If this is not the current load operation for this element, ignore it. + if (currentLoadingOperationId !== loadingOperationId) { + return; + } + + // Clean up previous state + disposeAssociatedComponentViewModel(); + + // Instantiate and bind new component. Implicitly this cleans any old DOM nodes. + if (!componentDefinition) { + throw new Error('Unknown component \'' + componentName + '\''); + } + cloneTemplateIntoElement(componentName, componentDefinition, element); + + var componentInfo = { + 'element': element, + 'templateNodes': originalChildNodes + }; + + var componentViewModel = createViewModel(componentDefinition, componentParams, componentInfo), + childBindingContext = asyncContext['createChildContext'](componentViewModel, { + 'extend': function(ctx) { + ctx['$component'] = componentViewModel; + ctx['$componentTemplateNodes'] = originalChildNodes; + } + }); + + if (componentViewModel && componentViewModel['koDescendantsComplete']) { + afterRenderSub = ko.bindingEvent.subscribe(element, ko.bindingEvent.descendantsComplete, componentViewModel['koDescendantsComplete'], componentViewModel); + } + + currentViewModel = componentViewModel; + ko.applyBindingsToDescendants(childBindingContext, element); + }); + }, null, { disposeWhenNodeIsRemoved: element }); + + return { 'controlsDescendantBindings': true }; + } + }; + + ko.virtualElements.allowedBindings['component'] = true; + + function cloneTemplateIntoElement(componentName, componentDefinition, element) { + var template = componentDefinition['template']; + if (!template) { + throw new Error('Component \'' + componentName + '\' has no template'); + } + + var clonedNodesArray = ko.utils.cloneNodes(template); + ko.virtualElements.setDomNodeChildren(element, clonedNodesArray); } - } else { - errorCallback('Unknown element type: ' + element); - } - } else { - errorCallback('Unknown template value: ' + templateConfig); - } - } - - function resolveViewModel(errorCallback, viewModelConfig, callback) { - if (typeof viewModelConfig === 'function') { - // Constructor - convert to standard factory function format - // By design, this does *not* supply componentInfo to the constructor, as the intent is that - // componentInfo contains non-viewmodel data (e.g., the component's element) that should only - // be used in factory functions, not viewmodel constructors. - callback(function (params /*, componentInfo */) { - return new viewModelConfig(params); - }); - } else if (typeof viewModelConfig[createViewModelKey] === 'function') { - // Already a factory function - use it as-is - callback(viewModelConfig[createViewModelKey]); - } else if ('instance' in viewModelConfig) { - // Fixed object instance - promote to createViewModel format for API consistency - var fixedInstance = viewModelConfig['instance']; - callback(function (params, componentInfo) { - return fixedInstance; - }); - } else if ('viewModel' in viewModelConfig) { - // Resolved AMD module whose value is of the form { viewModel: ... } - resolveViewModel(errorCallback, viewModelConfig['viewModel'], callback); - } else { - errorCallback('Unknown viewModel value: ' + viewModelConfig); - } - } - - function cloneNodesFromTemplateSourceElement(elemInstance) { - switch (ko.utils.tagNameLower(elemInstance)) { - case 'script': - return ko.utils.parseHtmlFragment(elemInstance.text); - case 'textarea': - return ko.utils.parseHtmlFragment(elemInstance.value); - case 'template': - // For browsers with proper <template> element support (i.e., where the .content property - // gives a document fragment), use that document fragment. - if (isDocumentFragment(elemInstance.content)) { - return ko.utils.cloneNodes(elemInstance.content.childNodes); + + function createViewModel(componentDefinition, componentParams, componentInfo) { + var componentViewModelFactory = componentDefinition['createViewModel']; + return componentViewModelFactory + ? componentViewModelFactory.call(componentDefinition, componentParams, componentInfo) + : componentParams; // Template-only component } - } - // Regular elements such as <div>, and <template> elements on old browsers that don't really - // understand <template> and just treat it as a regular container - return ko.utils.cloneNodes(elemInstance.childNodes); - } + })(); + var attrHtmlToJavaScriptMap = { 'class': 'className', 'for': 'htmlFor' }; + ko.bindingHandlers['attr'] = { + 'update': function(element, valueAccessor, allBindings) { + var value = ko.utils.unwrapObservable(valueAccessor()) || {}; + ko.utils.objectForEach(value, function(attrName, attrValue) { + attrValue = ko.utils.unwrapObservable(attrValue); + + // Find the namespace of this attribute, if any. + var prefixLen = attrName.indexOf(':'); + var namespace = "lookupNamespaceURI" in element && prefixLen > 0 && element.lookupNamespaceURI(attrName.substr(0, prefixLen)); + + // To cover cases like "attr: { checked:someProp }", we want to remove the attribute entirely + // when someProp is a "no value"-like value (strictly null, false, or undefined) + // (because the absence of the "checked" attr is how to mark an element as not checked, etc.) + var toRemove = (attrValue === false) || (attrValue === null) || (attrValue === undefined); + if (toRemove) { + namespace ? element.removeAttributeNS(namespace, attrName) : element.removeAttribute(attrName); + } else { + attrValue = attrValue.toString(); + } - function isDomElement(obj) { - if (window['HTMLElement']) { - return obj instanceof HTMLElement; - } else { - return obj && obj.tagName && obj.nodeType === 1; - } - } + // In IE <= 7 and IE8 Quirks Mode, you have to use the JavaScript property name instead of the + // HTML attribute name for certain attributes. IE8 Standards Mode supports the correct behavior, + // but instead of figuring out the mode, we'll just set the attribute through the JavaScript + // property for IE <= 8. + if (ko.utils.ieVersion <= 8 && attrName in attrHtmlToJavaScriptMap) { + attrName = attrHtmlToJavaScriptMap[attrName]; + if (toRemove) + element.removeAttribute(attrName); + else + element[attrName] = attrValue; + } else if (!toRemove) { + namespace ? element.setAttributeNS(namespace, attrName, attrValue) : element.setAttribute(attrName, attrValue); + } - function isDocumentFragment(obj) { - if (window['DocumentFragment']) { - return obj instanceof DocumentFragment; - } else { - return obj && obj.nodeType === 11; - } - } + // Treat "name" specially - although you can think of it as an attribute, it also needs + // special handling on older versions of IE (https://github.com/SteveSanderson/knockout/pull/333) + // Deliberately being case-sensitive here because XHTML would regard "Name" as a different thing + // entirely, and there's no strong reason to allow for such casing in HTML. + if (attrName === "name") { + ko.utils.setElementName(element, toRemove ? "" : attrValue); + } + }); + } + }; + (function() { + + ko.bindingHandlers['checked'] = { + 'after': ['value', 'attr'], + 'init': function (element, valueAccessor, allBindings) { + var checkedValue = ko.pureComputed(function() { + // Treat "value" like "checkedValue" when it is included with "checked" binding + if (allBindings['has']('checkedValue')) { + return ko.utils.unwrapObservable(allBindings.get('checkedValue')); + } else if (useElementValue) { + if (allBindings['has']('value')) { + return ko.utils.unwrapObservable(allBindings.get('value')); + } else { + return element.value; + } + } + }); - function possiblyGetConfigFromAmd(errorCallback, config, callback) { - if (typeof config['require'] === 'string') { - // The config is the value of an AMD module - if (amdRequire || window['require']) { - (amdRequire || window['require'])([config['require']], callback); - } else { - errorCallback('Uses require, but no AMD loader is present'); - } - } else { - callback(config); - } - } + function updateModel() { + // This updates the model value from the view value. + // It runs in response to DOM events (click) and changes in checkedValue. + var isChecked = element.checked, + elemValue = checkedValue(); + + // When we're first setting up this computed, don't change any model state. + if (ko.computedContext.isInitial()) { + return; + } + + // We can ignore unchecked radio buttons, because some other radio + // button will be checked, and that one can take care of updating state. + // Also ignore value changes to an already unchecked checkbox. + if (!isChecked && (isRadio || ko.computedContext.getDependenciesCount())) { + return; + } + + var modelValue = ko.dependencyDetection.ignore(valueAccessor); + if (valueIsArray) { + var writableValue = rawValueIsNonArrayObservable ? modelValue.peek() : modelValue, + saveOldValue = oldElemValue; + oldElemValue = elemValue; + + if (saveOldValue !== elemValue) { + // When we're responding to the checkedValue changing, and the element is + // currently checked, replace the old elem value with the new elem value + // in the model array. + if (isChecked) { + ko.utils.addOrRemoveItem(writableValue, elemValue, true); + ko.utils.addOrRemoveItem(writableValue, saveOldValue, false); + } + } else { + // When we're responding to the user having checked/unchecked a checkbox, + // add/remove the element value to the model array. + ko.utils.addOrRemoveItem(writableValue, elemValue, isChecked); + } - function makeErrorCallback(componentName) { - return function (message) { - throw new Error('Component \'' + componentName + '\': ' + message); - }; - } + if (rawValueIsNonArrayObservable && ko.isWriteableObservable(modelValue)) { + modelValue(writableValue); + } + } else { + if (isCheckbox) { + if (elemValue === undefined) { + elemValue = isChecked; + } else if (!isChecked) { + elemValue = undefined; + } + } + ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'checked', elemValue, true); + } + }; + + function updateView() { + // This updates the view value from the model value. + // It runs in response to changes in the bound (checked) value. + var modelValue = ko.utils.unwrapObservable(valueAccessor()), + elemValue = checkedValue(); + + if (valueIsArray) { + // When a checkbox is bound to an array, being checked represents its value being present in that array + element.checked = ko.utils.arrayIndexOf(modelValue, elemValue) >= 0; + oldElemValue = elemValue; + } else if (isCheckbox && elemValue === undefined) { + // When a checkbox is bound to any other value (not an array) and "checkedValue" is not defined, + // being checked represents the value being trueish + element.checked = !!modelValue; + } else { + // Otherwise, being checked means that the checkbox or radio button's value corresponds to the model value + element.checked = (checkedValue() === modelValue); + } + }; - ko.exportSymbol('components.register', ko.components.register); - ko.exportSymbol('components.isRegistered', ko.components.isRegistered); - ko.exportSymbol('components.unregister', ko.components.unregister); + var isCheckbox = element.type == "checkbox", + isRadio = element.type == "radio"; - // Expose the default loader so that developers can directly ask it for configuration - // or to resolve configuration - ko.exportSymbol('components.defaultLoader', ko.components.defaultLoader); + // Only bind to check boxes and radio buttons + if (!isCheckbox && !isRadio) { + return; + } - // By default, the default loader is the only registered component loader - ko.components['loaders'].push(ko.components.defaultLoader); + var rawValue = valueAccessor(), + valueIsArray = isCheckbox && (ko.utils.unwrapObservable(rawValue) instanceof Array), + rawValueIsNonArrayObservable = !(valueIsArray && rawValue.push && rawValue.splice), + useElementValue = isRadio || valueIsArray, + oldElemValue = valueIsArray ? checkedValue() : undefined; - // Privately expose the underlying config registry for use in old-IE shim - ko.components._allRegisteredComponents = defaultConfigRegistry; -})(); -(function (undefined) { - // Overridable API for determining which component name applies to a given node. By overriding this, - // you can for example map specific tagNames to components that are not preregistered. - ko.components['getComponentNameForNode'] = function(node) { - var tagNameLower = ko.utils.tagNameLower(node); - if (ko.components.isRegistered(tagNameLower)) { - // Try to determine that this node can be considered a *custom* element; see https://github.com/knockout/knockout/issues/1603 - if (tagNameLower.indexOf('-') != -1 || ('' + node) == "[object HTMLUnknownElement]" || (ko.utils.ieVersion <= 8 && node.tagName === tagNameLower)) { - return tagNameLower; + // IE 6 won't allow radio buttons to be selected unless they have a name + if (isRadio && !element.name) + ko.bindingHandlers['uniqueName']['init'](element, function() { return true }); + + // Set up two computeds to update the binding: + + // The first responds to changes in the checkedValue value and to element clicks + ko.computed(updateModel, null, { disposeWhenNodeIsRemoved: element }); + ko.utils.registerEventHandler(element, "click", updateModel); + + // The second responds to changes in the model value (the one associated with the checked binding) + ko.computed(updateView, null, { disposeWhenNodeIsRemoved: element }); + + rawValue = undefined; + } + }; + ko.expressionRewriting.twoWayBindings['checked'] = true; + + ko.bindingHandlers['checkedValue'] = { + 'update': function (element, valueAccessor) { + element.value = ko.utils.unwrapObservable(valueAccessor()); + } + }; + + })();var classesWrittenByBindingKey = '__ko__cssValue'; + ko.bindingHandlers['class'] = { + 'update': function (element, valueAccessor) { + var value = ko.utils.stringTrim(ko.utils.unwrapObservable(valueAccessor())); + ko.utils.toggleDomNodeCssClass(element, element[classesWrittenByBindingKey], false); + element[classesWrittenByBindingKey] = value; + ko.utils.toggleDomNodeCssClass(element, value, true); + } + }; + + ko.bindingHandlers['css'] = { + 'update': function (element, valueAccessor) { + var value = ko.utils.unwrapObservable(valueAccessor()); + if (value !== null && typeof value == "object") { + ko.utils.objectForEach(value, function(className, shouldHaveClass) { + shouldHaveClass = ko.utils.unwrapObservable(shouldHaveClass); + ko.utils.toggleDomNodeCssClass(element, className, shouldHaveClass); + }); + } else { + ko.bindingHandlers['class']['update'](element, valueAccessor); + } + } + }; + ko.bindingHandlers['enable'] = { + 'update': function (element, valueAccessor) { + var value = ko.utils.unwrapObservable(valueAccessor()); + if (value && element.disabled) + element.removeAttribute("disabled"); + else if ((!value) && (!element.disabled)) + element.disabled = true; + } + }; + + ko.bindingHandlers['disable'] = { + 'update': function (element, valueAccessor) { + ko.bindingHandlers['enable']['update'](element, function() { return !ko.utils.unwrapObservable(valueAccessor()) }); + } + }; +// For certain common events (currently just 'click'), allow a simplified data-binding syntax +// e.g. click:handler instead of the usual full-length event:{click:handler} + function makeEventHandlerShortcut(eventName) { + ko.bindingHandlers[eventName] = { + 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { + var newValueAccessor = function () { + var result = {}; + result[eventName] = valueAccessor(); + return result; + }; + return ko.bindingHandlers['event']['init'].call(this, element, newValueAccessor, allBindings, viewModel, bindingContext); + } + } } - } - }; - ko.components.addBindingsForCustomElement = function(allBindings, node, bindingContext, valueAccessors) { - // Determine if it's really a custom element matching a component - if (node.nodeType === 1) { - var componentName = ko.components['getComponentNameForNode'](node); - if (componentName) { - // It does represent a component, so add a component binding for it - allBindings = allBindings || {}; + ko.bindingHandlers['event'] = { + 'init' : function (element, valueAccessor, allBindings, viewModel, bindingContext) { + var eventsToHandle = valueAccessor() || {}; + ko.utils.objectForEach(eventsToHandle, function(eventName) { + if (typeof eventName == "string") { + ko.utils.registerEventHandler(element, eventName, function (event) { + var handlerReturnValue; + var handlerFunction = valueAccessor()[eventName]; + if (!handlerFunction) + return; + + try { + // Take all the event args, and prefix with the viewmodel + var argsForHandler = ko.utils.makeArray(arguments); + viewModel = bindingContext['$data']; + argsForHandler.unshift(viewModel); + handlerReturnValue = handlerFunction.apply(viewModel, argsForHandler); + } finally { + if (handlerReturnValue !== true) { // Normally we want to prevent default action. Developer can override this be explicitly returning true. + if (event.preventDefault) + event.preventDefault(); + else + event.returnValue = false; + } + } - if (allBindings['component']) { - // Avoid silently overwriting some other 'component' binding that may already be on the element - throw new Error('Cannot use the "component" binding on a custom element matching a component'); + var bubble = allBindings.get(eventName + 'Bubble') !== false; + if (!bubble) { + event.cancelBubble = true; + if (event.stopPropagation) + event.stopPropagation(); + } + }); + } + }); + } + }; +// "foreach: someExpression" is equivalent to "template: { foreach: someExpression }" +// "foreach: { data: someExpression, afterAdd: myfn }" is equivalent to "template: { foreach: someExpression, afterAdd: myfn }" + ko.bindingHandlers['foreach'] = { + makeTemplateValueAccessor: function(valueAccessor) { + return function() { + var modelValue = valueAccessor(), + unwrappedValue = ko.utils.peekObservable(modelValue); // Unwrap without setting a dependency here + + // If unwrappedValue is the array, pass in the wrapped value on its own + // The value will be unwrapped and tracked within the template binding + // (See https://github.com/SteveSanderson/knockout/issues/523) + if ((!unwrappedValue) || typeof unwrappedValue.length == "number") + return { 'foreach': modelValue, 'templateEngine': ko.nativeTemplateEngine.instance }; + + // If unwrappedValue.data is the array, preserve all relevant options and unwrap again value so we get updates + ko.utils.unwrapObservable(modelValue); + return { + 'foreach': unwrappedValue['data'], + 'as': unwrappedValue['as'], + 'noChildContext': unwrappedValue['noChildContext'], + 'includeDestroyed': unwrappedValue['includeDestroyed'], + 'afterAdd': unwrappedValue['afterAdd'], + 'beforeRemove': unwrappedValue['beforeRemove'], + 'afterRender': unwrappedValue['afterRender'], + 'beforeMove': unwrappedValue['beforeMove'], + 'afterMove': unwrappedValue['afterMove'], + 'templateEngine': ko.nativeTemplateEngine.instance + }; + }; + }, + 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { + return ko.bindingHandlers['template']['init'](element, ko.bindingHandlers['foreach'].makeTemplateValueAccessor(valueAccessor)); + }, + 'update': function(element, valueAccessor, allBindings, viewModel, bindingContext) { + return ko.bindingHandlers['template']['update'](element, ko.bindingHandlers['foreach'].makeTemplateValueAccessor(valueAccessor), allBindings, viewModel, bindingContext); } + }; + ko.expressionRewriting.bindingRewriteValidators['foreach'] = false; // Can't rewrite control flow bindings + ko.virtualElements.allowedBindings['foreach'] = true; + var hasfocusUpdatingProperty = '__ko_hasfocusUpdating'; + var hasfocusLastValue = '__ko_hasfocusLastValue'; + ko.bindingHandlers['hasfocus'] = { + 'init': function(element, valueAccessor, allBindings) { + var handleElementFocusChange = function(isFocused) { + // Where possible, ignore which event was raised and determine focus state using activeElement, + // as this avoids phantom focus/blur events raised when changing tabs in modern browsers. + // However, not all KO-targeted browsers (Firefox 2) support activeElement. For those browsers, + // prevent a loss of focus when changing tabs/windows by setting a flag that prevents hasfocus + // from calling 'blur()' on the element when it loses focus. + // Discussion at https://github.com/SteveSanderson/knockout/pull/352 + element[hasfocusUpdatingProperty] = true; + var ownerDoc = element.ownerDocument; + if ("activeElement" in ownerDoc) { + var active; + try { + active = ownerDoc.activeElement; + } catch(e) { + // IE9 throws if you access activeElement during page load (see issue #703) + active = ownerDoc.body; + } + isFocused = (active === element); + } + var modelValue = valueAccessor(); + ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'hasfocus', isFocused, true); - var componentBindingValue = { 'name': componentName, 'params': getComponentParamsFromCustomElement(node, bindingContext) }; - - allBindings['component'] = valueAccessors - ? function() { return componentBindingValue; } - : componentBindingValue; - } - } - - return allBindings; - } - - var nativeBindingProviderInstance = new ko.bindingProvider(); - - function getComponentParamsFromCustomElement(elem, bindingContext) { - var paramsAttribute = elem.getAttribute('params'); - - if (paramsAttribute) { - var params = nativeBindingProviderInstance['parseBindingsString'](paramsAttribute, bindingContext, elem, { 'valueAccessors': true, 'bindingParams': true }), - rawParamComputedValues = ko.utils.objectMap(params, function(paramValue, paramName) { - return ko.computed(paramValue, null, { disposeWhenNodeIsRemoved: elem }); - }), - result = ko.utils.objectMap(rawParamComputedValues, function(paramValueComputed, paramName) { - var paramValue = paramValueComputed.peek(); - // Does the evaluation of the parameter value unwrap any observables? - if (!paramValueComputed.isActive()) { - // No it doesn't, so there's no need for any computed wrapper. Just pass through the supplied value directly. - // Example: "someVal: firstName, age: 123" (whether or not firstName is an observable/computed) - return paramValue; - } else { - // Yes it does. Supply a computed property that unwraps both the outer (binding expression) - // level of observability, and any inner (resulting model value) level of observability. - // This means the component doesn't have to worry about multiple unwrapping. If the value is a - // writable observable, the computed will also be writable and pass the value on to the observable. - return ko.computed({ - 'read': function() { - return ko.utils.unwrapObservable(paramValueComputed()); - }, - 'write': ko.isWriteableObservable(paramValue) && function(value) { - paramValueComputed()(value); - }, - disposeWhenNodeIsRemoved: elem - }); - } - }); + //cache the latest value, so we can avoid unnecessarily calling focus/blur in the update function + element[hasfocusLastValue] = isFocused; + element[hasfocusUpdatingProperty] = false; + }; + var handleElementFocusIn = handleElementFocusChange.bind(null, true); + var handleElementFocusOut = handleElementFocusChange.bind(null, false); - // Give access to the raw computeds, as long as that wouldn't overwrite any custom param also called '$raw' - // This is in case the developer wants to react to outer (binding) observability separately from inner - // (model value) observability, or in case the model value observable has subobservables. - if (!result.hasOwnProperty('$raw')) { - result['$raw'] = rawParamComputedValues; - } + ko.utils.registerEventHandler(element, "focus", handleElementFocusIn); + ko.utils.registerEventHandler(element, "focusin", handleElementFocusIn); // For IE + ko.utils.registerEventHandler(element, "blur", handleElementFocusOut); + ko.utils.registerEventHandler(element, "focusout", handleElementFocusOut); // For IE - return result; - } else { - // For consistency, absence of a "params" attribute is treated the same as the presence of - // any empty one. Otherwise component viewmodels need special code to check whether or not - // 'params' or 'params.$raw' is null/undefined before reading subproperties, which is annoying. - return { '$raw': {} }; - } - } + // Assume element is not focused (prevents "blur" being called initially) + element[hasfocusLastValue] = false; + }, + 'update': function(element, valueAccessor) { + var value = !!ko.utils.unwrapObservable(valueAccessor()); - // -------------------------------------------------------------------------------- - // Compatibility code for older (pre-HTML5) IE browsers + if (!element[hasfocusUpdatingProperty] && element[hasfocusLastValue] !== value) { + value ? element.focus() : element.blur(); - if (ko.utils.ieVersion < 9) { - // Whenever you preregister a component, enable it as a custom element in the current document - ko.components['register'] = (function(originalFunction) { - return function(componentName) { - document.createElement(componentName); // Allows IE<9 to parse markup containing the custom element - return originalFunction.apply(this, arguments); - } - })(ko.components['register']); + // In IE, the blur method doesn't always cause the element to lose focus (for example, if the window is not in focus). + // Setting focus to the body element does seem to be reliable in IE, but should only be used if we know that the current + // element was focused already. + if (!value && element[hasfocusLastValue]) { + element.ownerDocument.body.focus(); + } - // Whenever you create a document fragment, enable all preregistered component names as custom elements - // This is needed to make innerShiv/jQuery HTML parsing correctly handle the custom elements - document.createDocumentFragment = (function(originalFunction) { - return function() { - var newDocFrag = originalFunction(), - allComponents = ko.components._allRegisteredComponents; - for (var componentName in allComponents) { - if (allComponents.hasOwnProperty(componentName)) { - newDocFrag.createElement(componentName); + // For IE, which doesn't reliably fire "focus" or "blur" events synchronously + ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, value ? "focusin" : "focusout"]); } } - return newDocFrag; }; - })(document.createDocumentFragment); - } -})();(function(undefined) { - - var componentLoadingOperationUniqueId = 0; - - ko.bindingHandlers['component'] = { - 'init': function(element, valueAccessor, ignored1, ignored2, bindingContext) { - var currentViewModel, - currentLoadingOperationId, - disposeAssociatedComponentViewModel = function () { - var currentViewModelDispose = currentViewModel && currentViewModel['dispose']; - if (typeof currentViewModelDispose === 'function') { - currentViewModelDispose.call(currentViewModel); - } - currentViewModel = null; - // Any in-flight loading operation is no longer relevant, so make sure we ignore its completion - currentLoadingOperationId = null; + ko.expressionRewriting.twoWayBindings['hasfocus'] = true; + + ko.bindingHandlers['hasFocus'] = ko.bindingHandlers['hasfocus']; // Make "hasFocus" an alias + ko.expressionRewriting.twoWayBindings['hasFocus'] = 'hasfocus'; + ko.bindingHandlers['html'] = { + 'init': function() { + // Prevent binding on the dynamically-injected HTML (as developers are unlikely to expect that, and it has security implications) + return { 'controlsDescendantBindings': true }; }, - originalChildNodes = ko.utils.makeArray(ko.virtualElements.childNodes(element)); - - ko.utils.domNodeDisposal.addDisposeCallback(element, disposeAssociatedComponentViewModel); - - ko.computed(function () { - var value = ko.utils.unwrapObservable(valueAccessor()), - componentName, componentParams; - - if (typeof value === 'string') { - componentName = value; - } else { - componentName = ko.utils.unwrapObservable(value['name']); - componentParams = ko.utils.unwrapObservable(value['params']); + 'update': function (element, valueAccessor) { + // setHtml will unwrap the value if needed + ko.utils.setHtml(element, valueAccessor()); } + }; + (function () { - if (!componentName) { - throw new Error('No component name specified'); - } +// Makes a binding like with or if + function makeWithIfBinding(bindingKey, isWith, isNot) { + ko.bindingHandlers[bindingKey] = { + 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { + var didDisplayOnLastUpdate, savedNodes, contextOptions = {}, completeOnRender, needAsyncContext, renderOnEveryChange; + + if (isWith) { + var as = allBindings.get('as'), noChildContext = allBindings.get('noChildContext'); + renderOnEveryChange = !(as && noChildContext); + contextOptions = { 'as': as, 'noChildContext': noChildContext, 'exportDependencies': renderOnEveryChange }; + } - var loadingOperationId = currentLoadingOperationId = ++componentLoadingOperationUniqueId; - ko.components.get(componentName, function(componentDefinition) { - // If this is not the current load operation for this element, ignore it. - if (currentLoadingOperationId !== loadingOperationId) { - return; - } + completeOnRender = allBindings.get("completeOn") == "render"; + needAsyncContext = completeOnRender || allBindings['has'](ko.bindingEvent.descendantsComplete); - // Clean up previous state - disposeAssociatedComponentViewModel(); + ko.computed(function() { + var value = ko.utils.unwrapObservable(valueAccessor()), + shouldDisplay = !isNot !== !value, // equivalent to isNot ? !value : !!value, + isInitial = !savedNodes, + childContext; - // Instantiate and bind new component. Implicitly this cleans any old DOM nodes. - if (!componentDefinition) { - throw new Error('Unknown component \'' + componentName + '\''); - } - cloneTemplateIntoElement(componentName, componentDefinition, element); - var componentViewModel = createViewModel(componentDefinition, element, originalChildNodes, componentParams), - childBindingContext = bindingContext['createChildContext'](componentViewModel, /* dataItemAlias */ undefined, function(ctx) { - ctx['$component'] = componentViewModel; - ctx['$componentTemplateNodes'] = originalChildNodes; - }); - currentViewModel = componentViewModel; - ko.applyBindingsToDescendants(childBindingContext, element); - }); - }, null, { disposeWhenNodeIsRemoved: element }); + if (!renderOnEveryChange && shouldDisplay === didDisplayOnLastUpdate) { + return; + } - return { 'controlsDescendantBindings': true }; - } - }; + if (needAsyncContext) { + bindingContext = ko.bindingEvent.startPossiblyAsyncContentBinding(element, bindingContext); + } - ko.virtualElements.allowedBindings['component'] = true; + if (shouldDisplay) { + if (!isWith || renderOnEveryChange) { + contextOptions['dataDependency'] = ko.computedContext.computed(); + } + + if (isWith) { + childContext = bindingContext['createChildContext'](typeof value == "function" ? value : valueAccessor, contextOptions); + } else if (ko.computedContext.getDependenciesCount()) { + childContext = bindingContext['extend'](null, contextOptions); + } else { + childContext = bindingContext; + } + } - function cloneTemplateIntoElement(componentName, componentDefinition, element) { - var template = componentDefinition['template']; - if (!template) { - throw new Error('Component \'' + componentName + '\' has no template'); - } + // Save a copy of the inner nodes on the initial update, but only if we have dependencies. + if (isInitial && ko.computedContext.getDependenciesCount()) { + savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */); + } - var clonedNodesArray = ko.utils.cloneNodes(template); - ko.virtualElements.setDomNodeChildren(element, clonedNodesArray); - } + if (shouldDisplay) { + if (!isInitial) { + ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes)); + } - function createViewModel(componentDefinition, element, originalChildNodes, componentParams) { - var componentViewModelFactory = componentDefinition['createViewModel']; - return componentViewModelFactory - ? componentViewModelFactory.call(componentDefinition, componentParams, { 'element': element, 'templateNodes': originalChildNodes }) - : componentParams; // Template-only component - } + ko.applyBindingsToDescendants(childContext, element); + } else { + ko.virtualElements.emptyNode(element); -})(); -var attrHtmlToJavascriptMap = { 'class': 'className', 'for': 'htmlFor' }; -ko.bindingHandlers['attr'] = { - 'update': function(element, valueAccessor, allBindings) { - var value = ko.utils.unwrapObservable(valueAccessor()) || {}; - ko.utils.objectForEach(value, function(attrName, attrValue) { - attrValue = ko.utils.unwrapObservable(attrValue); - - // To cover cases like "attr: { checked:someProp }", we want to remove the attribute entirely - // when someProp is a "no value"-like value (strictly null, false, or undefined) - // (because the absence of the "checked" attr is how to mark an element as not checked, etc.) - var toRemove = (attrValue === false) || (attrValue === null) || (attrValue === undefined); - if (toRemove) - element.removeAttribute(attrName); - - // In IE <= 7 and IE8 Quirks Mode, you have to use the Javascript property name instead of the - // HTML attribute name for certain attributes. IE8 Standards Mode supports the correct behavior, - // but instead of figuring out the mode, we'll just set the attribute through the Javascript - // property for IE <= 8. - if (ko.utils.ieVersion <= 8 && attrName in attrHtmlToJavascriptMap) { - attrName = attrHtmlToJavascriptMap[attrName]; - if (toRemove) - element.removeAttribute(attrName); - else - element[attrName] = attrValue; - } else if (!toRemove) { - element.setAttribute(attrName, attrValue.toString()); - } + if (!completeOnRender) { + ko.bindingEvent.notify(element, ko.bindingEvent.childrenComplete); + } + } - // Treat "name" specially - although you can think of it as an attribute, it also needs - // special handling on older versions of IE (https://github.com/SteveSanderson/knockout/pull/333) - // Deliberately being case-sensitive here because XHTML would regard "Name" as a different thing - // entirely, and there's no strong reason to allow for such casing in HTML. - if (attrName === "name") { - ko.utils.setElementName(element, toRemove ? "" : attrValue.toString()); - } - }); - } -}; -(function() { - -ko.bindingHandlers['checked'] = { - 'after': ['value', 'attr'], - 'init': function (element, valueAccessor, allBindings) { - var checkedValue = ko.pureComputed(function() { - // Treat "value" like "checkedValue" when it is included with "checked" binding - if (allBindings['has']('checkedValue')) { - return ko.utils.unwrapObservable(allBindings.get('checkedValue')); - } else if (allBindings['has']('value')) { - return ko.utils.unwrapObservable(allBindings.get('value')); - } + didDisplayOnLastUpdate = shouldDisplay; - return element.value; - }); + }, null, { disposeWhenNodeIsRemoved: element }); - function updateModel() { - // This updates the model value from the view value. - // It runs in response to DOM events (click) and changes in checkedValue. - var isChecked = element.checked, - elemValue = useCheckedValue ? checkedValue() : isChecked; + return { 'controlsDescendantBindings': true }; + } + }; + ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings + ko.virtualElements.allowedBindings[bindingKey] = true; + } - // When we're first setting up this computed, don't change any model state. - if (ko.computedContext.isInitial()) { - return; - } +// Construct the actual binding handlers + makeWithIfBinding('if'); + makeWithIfBinding('ifnot', false /* isWith */, true /* isNot */); + makeWithIfBinding('with', true /* isWith */); - // We can ignore unchecked radio buttons, because some other radio - // button will be getting checked, and that one can take care of updating state. - if (isRadio && !isChecked) { - return; - } + })();ko.bindingHandlers['let'] = { + 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { + // Make a modified binding context, with extra properties, and apply it to descendant elements + var innerContext = bindingContext['extend'](valueAccessor); + ko.applyBindingsToDescendants(innerContext, element); - var modelValue = ko.dependencyDetection.ignore(valueAccessor); - if (valueIsArray) { - var writableValue = rawValueIsNonArrayObservable ? modelValue.peek() : modelValue; - if (oldElemValue !== elemValue) { - // When we're responding to the checkedValue changing, and the element is - // currently checked, replace the old elem value with the new elem value - // in the model array. - if (isChecked) { - ko.utils.addOrRemoveItem(writableValue, elemValue, true); - ko.utils.addOrRemoveItem(writableValue, oldElemValue, false); + return { 'controlsDescendantBindings': true }; + } + }; + ko.virtualElements.allowedBindings['let'] = true; + var captionPlaceholder = {}; + ko.bindingHandlers['options'] = { + 'init': function(element) { + if (ko.utils.tagNameLower(element) !== "select") + throw new Error("options binding applies only to SELECT elements"); + + // Remove all existing <option>s. + while (element.length > 0) { + element.remove(0); } - oldElemValue = elemValue; - } else { - // When we're responding to the user having checked/unchecked a checkbox, - // add/remove the element value to the model array. - ko.utils.addOrRemoveItem(writableValue, elemValue, isChecked); - } - if (rawValueIsNonArrayObservable && ko.isWriteableObservable(modelValue)) { - modelValue(writableValue); - } - } else { - ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'checked', elemValue, true); - } - }; - - function updateView() { - // This updates the view value from the model value. - // It runs in response to changes in the bound (checked) value. - var modelValue = ko.utils.unwrapObservable(valueAccessor()); - - if (valueIsArray) { - // When a checkbox is bound to an array, being checked represents its value being present in that array - element.checked = ko.utils.arrayIndexOf(modelValue, checkedValue()) >= 0; - } else if (isCheckbox) { - // When a checkbox is bound to any other value (not an array), being checked represents the value being trueish - element.checked = modelValue; - } else { - // For radio buttons, being checked means that the radio button's value corresponds to the model value - element.checked = (checkedValue() === modelValue); - } - }; + // Ensures that the binding processor doesn't try to bind the options + return { 'controlsDescendantBindings': true }; + }, + 'update': function (element, valueAccessor, allBindings) { + function selectedOptions() { + return ko.utils.arrayFilter(element.options, function (node) { return node.selected; }); + } - var isCheckbox = element.type == "checkbox", - isRadio = element.type == "radio"; + var selectWasPreviouslyEmpty = element.length == 0, + multiple = element.multiple, + previousScrollTop = (!selectWasPreviouslyEmpty && multiple) ? element.scrollTop : null, + unwrappedArray = ko.utils.unwrapObservable(valueAccessor()), + valueAllowUnset = allBindings.get('valueAllowUnset') && allBindings['has']('value'), + includeDestroyed = allBindings.get('optionsIncludeDestroyed'), + arrayToDomNodeChildrenOptions = {}, + captionValue, + filteredArray, + previousSelectedValues = []; + + if (!valueAllowUnset) { + if (multiple) { + previousSelectedValues = ko.utils.arrayMap(selectedOptions(), ko.selectExtensions.readValue); + } else if (element.selectedIndex >= 0) { + previousSelectedValues.push(ko.selectExtensions.readValue(element.options[element.selectedIndex])); + } + } - // Only bind to check boxes and radio buttons - if (!isCheckbox && !isRadio) { - return; - } + if (unwrappedArray) { + if (typeof unwrappedArray.length == "undefined") // Coerce single value into array + unwrappedArray = [unwrappedArray]; - var rawValue = valueAccessor(), - valueIsArray = isCheckbox && (ko.utils.unwrapObservable(rawValue) instanceof Array), - rawValueIsNonArrayObservable = !(valueIsArray && rawValue.push && rawValue.splice), - oldElemValue = valueIsArray ? checkedValue() : undefined, - useCheckedValue = isRadio || valueIsArray; - - // IE 6 won't allow radio buttons to be selected unless they have a name - if (isRadio && !element.name) - ko.bindingHandlers['uniqueName']['init'](element, function() { return true }); - - // Set up two computeds to update the binding: - - // The first responds to changes in the checkedValue value and to element clicks - ko.computed(updateModel, null, { disposeWhenNodeIsRemoved: element }); - ko.utils.registerEventHandler(element, "click", updateModel); - - // The second responds to changes in the model value (the one associated with the checked binding) - ko.computed(updateView, null, { disposeWhenNodeIsRemoved: element }); - - rawValue = undefined; - } -}; -ko.expressionRewriting.twoWayBindings['checked'] = true; - -ko.bindingHandlers['checkedValue'] = { - 'update': function (element, valueAccessor) { - element.value = ko.utils.unwrapObservable(valueAccessor()); - } -}; - -})();var classesWrittenByBindingKey = '__ko__cssValue'; -ko.bindingHandlers['css'] = { - 'update': function (element, valueAccessor) { - var value = ko.utils.unwrapObservable(valueAccessor()); - if (value !== null && typeof value == "object") { - ko.utils.objectForEach(value, function(className, shouldHaveClass) { - shouldHaveClass = ko.utils.unwrapObservable(shouldHaveClass); - ko.utils.toggleDomNodeCssClass(element, className, shouldHaveClass); - }); - } else { - value = ko.utils.stringTrim(String(value || '')); // Make sure we don't try to store or set a non-string value - ko.utils.toggleDomNodeCssClass(element, element[classesWrittenByBindingKey], false); - element[classesWrittenByBindingKey] = value; - ko.utils.toggleDomNodeCssClass(element, value, true); - } - } -}; -ko.bindingHandlers['enable'] = { - 'update': function (element, valueAccessor) { - var value = ko.utils.unwrapObservable(valueAccessor()); - if (value && element.disabled) - element.removeAttribute("disabled"); - else if ((!value) && (!element.disabled)) - element.disabled = true; - } -}; - -ko.bindingHandlers['disable'] = { - 'update': function (element, valueAccessor) { - ko.bindingHandlers['enable']['update'](element, function() { return !ko.utils.unwrapObservable(valueAccessor()) }); - } -}; -// For certain common events (currently just 'click'), allow a simplified data-binding syntax -// e.g. click:handler instead of the usual full-length event:{click:handler} -function makeEventHandlerShortcut(eventName) { - ko.bindingHandlers[eventName] = { - 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { - var newValueAccessor = function () { - var result = {}; - result[eventName] = valueAccessor(); - return result; - }; - return ko.bindingHandlers['event']['init'].call(this, element, newValueAccessor, allBindings, viewModel, bindingContext); - } - } -} - -ko.bindingHandlers['event'] = { - 'init' : function (element, valueAccessor, allBindings, viewModel, bindingContext) { - var eventsToHandle = valueAccessor() || {}; - ko.utils.objectForEach(eventsToHandle, function(eventName) { - if (typeof eventName == "string") { - ko.utils.registerEventHandler(element, eventName, function (event) { - var handlerReturnValue; - var handlerFunction = valueAccessor()[eventName]; - if (!handlerFunction) - return; + // Filter out any entries marked as destroyed + filteredArray = ko.utils.arrayFilter(unwrappedArray, function(item) { + return includeDestroyed || item === undefined || item === null || !ko.utils.unwrapObservable(item['_destroy']); + }); - try { - // Take all the event args, and prefix with the viewmodel - var argsForHandler = ko.utils.makeArray(arguments); - viewModel = bindingContext['$data']; - argsForHandler.unshift(viewModel); - handlerReturnValue = handlerFunction.apply(viewModel, argsForHandler); - } finally { - if (handlerReturnValue !== true) { // Normally we want to prevent default action. Developer can override this be explicitly returning true. - if (event.preventDefault) - event.preventDefault(); - else - event.returnValue = false; + // If caption is included, add it to the array + if (allBindings['has']('optionsCaption')) { + captionValue = ko.utils.unwrapObservable(allBindings.get('optionsCaption')); + // If caption value is null or undefined, don't show a caption + if (captionValue !== null && captionValue !== undefined) { + filteredArray.unshift(captionPlaceholder); + } } + } else { + // If a falsy value is provided (e.g. null), we'll simply empty the select element } - var bubble = allBindings.get(eventName + 'Bubble') !== false; - if (!bubble) { - event.cancelBubble = true; - if (event.stopPropagation) - event.stopPropagation(); + function applyToObject(object, predicate, defaultValue) { + var predicateType = typeof predicate; + if (predicateType == "function") // Given a function; run it against the data value + return predicate(object); + else if (predicateType == "string") // Given a string; treat it as a property name on the data value + return object[predicate]; + else // Given no optionsText arg; use the data value itself + return defaultValue; } - }); - } - }); - } -}; -// "foreach: someExpression" is equivalent to "template: { foreach: someExpression }" -// "foreach: { data: someExpression, afterAdd: myfn }" is equivalent to "template: { foreach: someExpression, afterAdd: myfn }" -ko.bindingHandlers['foreach'] = { - makeTemplateValueAccessor: function(valueAccessor) { - return function() { - var modelValue = valueAccessor(), - unwrappedValue = ko.utils.peekObservable(modelValue); // Unwrap without setting a dependency here - - // If unwrappedValue is the array, pass in the wrapped value on its own - // The value will be unwrapped and tracked within the template binding - // (See https://github.com/SteveSanderson/knockout/issues/523) - if ((!unwrappedValue) || typeof unwrappedValue.length == "number") - return { 'foreach': modelValue, 'templateEngine': ko.nativeTemplateEngine.instance }; - - // If unwrappedValue.data is the array, preserve all relevant options and unwrap again value so we get updates - ko.utils.unwrapObservable(modelValue); - return { - 'foreach': unwrappedValue['data'], - 'as': unwrappedValue['as'], - 'includeDestroyed': unwrappedValue['includeDestroyed'], - 'afterAdd': unwrappedValue['afterAdd'], - 'beforeRemove': unwrappedValue['beforeRemove'], - 'afterRender': unwrappedValue['afterRender'], - 'beforeMove': unwrappedValue['beforeMove'], - 'afterMove': unwrappedValue['afterMove'], - 'templateEngine': ko.nativeTemplateEngine.instance - }; - }; - }, - 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { - return ko.bindingHandlers['template']['init'](element, ko.bindingHandlers['foreach'].makeTemplateValueAccessor(valueAccessor)); - }, - 'update': function(element, valueAccessor, allBindings, viewModel, bindingContext) { - return ko.bindingHandlers['template']['update'](element, ko.bindingHandlers['foreach'].makeTemplateValueAccessor(valueAccessor), allBindings, viewModel, bindingContext); - } -}; -ko.expressionRewriting.bindingRewriteValidators['foreach'] = false; // Can't rewrite control flow bindings -ko.virtualElements.allowedBindings['foreach'] = true; -var hasfocusUpdatingProperty = '__ko_hasfocusUpdating'; -var hasfocusLastValue = '__ko_hasfocusLastValue'; -ko.bindingHandlers['hasfocus'] = { - 'init': function(element, valueAccessor, allBindings) { - var handleElementFocusChange = function(isFocused) { - // Where possible, ignore which event was raised and determine focus state using activeElement, - // as this avoids phantom focus/blur events raised when changing tabs in modern browsers. - // However, not all KO-targeted browsers (Firefox 2) support activeElement. For those browsers, - // prevent a loss of focus when changing tabs/windows by setting a flag that prevents hasfocus - // from calling 'blur()' on the element when it loses focus. - // Discussion at https://github.com/SteveSanderson/knockout/pull/352 - element[hasfocusUpdatingProperty] = true; - var ownerDoc = element.ownerDocument; - if ("activeElement" in ownerDoc) { - var active; - try { - active = ownerDoc.activeElement; - } catch(e) { - // IE9 throws if you access activeElement during page load (see issue #703) - active = ownerDoc.body; - } - isFocused = (active === element); - } - var modelValue = valueAccessor(); - ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'hasfocus', isFocused, true); - - //cache the latest value, so we can avoid unnecessarily calling focus/blur in the update function - element[hasfocusLastValue] = isFocused; - element[hasfocusUpdatingProperty] = false; - }; - var handleElementFocusIn = handleElementFocusChange.bind(null, true); - var handleElementFocusOut = handleElementFocusChange.bind(null, false); - - ko.utils.registerEventHandler(element, "focus", handleElementFocusIn); - ko.utils.registerEventHandler(element, "focusin", handleElementFocusIn); // For IE - ko.utils.registerEventHandler(element, "blur", handleElementFocusOut); - ko.utils.registerEventHandler(element, "focusout", handleElementFocusOut); // For IE - }, - 'update': function(element, valueAccessor) { - var value = !!ko.utils.unwrapObservable(valueAccessor()); - - if (!element[hasfocusUpdatingProperty] && element[hasfocusLastValue] !== value) { - value ? element.focus() : element.blur(); - - // In IE, the blur method doesn't always cause the element to lose focus (for example, if the window is not in focus). - // Setting focus to the body element does seem to be reliable in IE, but should only be used if we know that the current - // element was focused already. - if (!value && element[hasfocusLastValue]) { - element.ownerDocument.body.focus(); - } - // For IE, which doesn't reliably fire "focus" or "blur" events synchronously - ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, value ? "focusin" : "focusout"]); - } - } -}; -ko.expressionRewriting.twoWayBindings['hasfocus'] = true; - -ko.bindingHandlers['hasFocus'] = ko.bindingHandlers['hasfocus']; // Make "hasFocus" an alias -ko.expressionRewriting.twoWayBindings['hasFocus'] = true; -ko.bindingHandlers['html'] = { - 'init': function() { - // Prevent binding on the dynamically-injected HTML (as developers are unlikely to expect that, and it has security implications) - return { 'controlsDescendantBindings': true }; - }, - 'update': function (element, valueAccessor) { - // setHtml will unwrap the value if needed - ko.utils.setHtml(element, valueAccessor()); - } -}; -// Makes a binding like with or if -function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) { - ko.bindingHandlers[bindingKey] = { - 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { - var didDisplayOnLastUpdate, - savedNodes; - ko.computed(function() { - var rawValue = valueAccessor(), - dataValue = ko.utils.unwrapObservable(rawValue), - shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue - isFirstRender = !savedNodes, - needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate); - - if (needsRefresh) { - // Save a copy of the inner nodes on the initial update, but only if we have dependencies. - if (isFirstRender && ko.computedContext.getDependenciesCount()) { - savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */); - } - - if (shouldDisplay) { - if (!isFirstRender) { - ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes)); - } - ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, rawValue) : bindingContext, element); - } else { - ko.virtualElements.emptyNode(element); + // The following functions can run at two different times: + // The first is when the whole array is being updated directly from this binding handler. + // The second is when an observable value for a specific array entry is updated. + // oldOptions will be empty in the first case, but will be filled with the previously generated option in the second. + var itemUpdate = false; + function optionForArrayItem(arrayEntry, index, oldOptions) { + if (oldOptions.length) { + previousSelectedValues = !valueAllowUnset && oldOptions[0].selected ? [ ko.selectExtensions.readValue(oldOptions[0]) ] : []; + itemUpdate = true; + } + var option = element.ownerDocument.createElement("option"); + if (arrayEntry === captionPlaceholder) { + ko.utils.setTextContent(option, allBindings.get('optionsCaption')); + ko.selectExtensions.writeValue(option, undefined); + } else { + // Apply a value to the option element + var optionValue = applyToObject(arrayEntry, allBindings.get('optionsValue'), arrayEntry); + ko.selectExtensions.writeValue(option, ko.utils.unwrapObservable(optionValue)); + + // Apply some text to the option element + var optionText = applyToObject(arrayEntry, allBindings.get('optionsText'), optionValue); + ko.utils.setTextContent(option, optionText); + } + return [option]; } - didDisplayOnLastUpdate = shouldDisplay; - } - }, null, { disposeWhenNodeIsRemoved: element }); - return { 'controlsDescendantBindings': true }; - } - }; - ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings - ko.virtualElements.allowedBindings[bindingKey] = true; -} + // By using a beforeRemove callback, we delay the removal until after new items are added. This fixes a selection + // problem in IE<=8 and Firefox. See https://github.com/knockout/knockout/issues/1208 + arrayToDomNodeChildrenOptions['beforeRemove'] = + function (option) { + element.removeChild(option); + }; + + function setSelectionCallback(arrayEntry, newOptions) { + if (itemUpdate && valueAllowUnset) { + // The model value is authoritative, so make sure its value is the one selected + ko.bindingEvent.notify(element, ko.bindingEvent.childrenComplete); + } else if (previousSelectedValues.length) { + // IE6 doesn't like us to assign selection to OPTION nodes before they're added to the document. + // That's why we first added them without selection. Now it's time to set the selection. + var isSelected = ko.utils.arrayIndexOf(previousSelectedValues, ko.selectExtensions.readValue(newOptions[0])) >= 0; + ko.utils.setOptionNodeSelectionState(newOptions[0], isSelected); + + // If this option was changed from being selected during a single-item update, notify the change + if (itemUpdate && !isSelected) { + ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, "change"]); + } + } + } -// Construct the actual binding handlers -makeWithIfBinding('if'); -makeWithIfBinding('ifnot', false /* isWith */, true /* isNot */); -makeWithIfBinding('with', true /* isWith */, false /* isNot */, - function(bindingContext, dataValue) { - return bindingContext.createStaticChildContext(dataValue); - } -); -var captionPlaceholder = {}; -ko.bindingHandlers['options'] = { - 'init': function(element) { - if (ko.utils.tagNameLower(element) !== "select") - throw new Error("options binding applies only to SELECT elements"); - - // Remove all existing <option>s. - while (element.length > 0) { - element.remove(0); - } + var callback = setSelectionCallback; + if (allBindings['has']('optionsAfterRender') && typeof allBindings.get('optionsAfterRender') == "function") { + callback = function(arrayEntry, newOptions) { + setSelectionCallback(arrayEntry, newOptions); + ko.dependencyDetection.ignore(allBindings.get('optionsAfterRender'), null, [newOptions[0], arrayEntry !== captionPlaceholder ? arrayEntry : undefined]); + } + } - // Ensures that the binding processor doesn't try to bind the options - return { 'controlsDescendantBindings': true }; - }, - 'update': function (element, valueAccessor, allBindings) { - function selectedOptions() { - return ko.utils.arrayFilter(element.options, function (node) { return node.selected; }); - } + ko.utils.setDomNodeChildrenFromArrayMapping(element, filteredArray, optionForArrayItem, arrayToDomNodeChildrenOptions, callback); - var selectWasPreviouslyEmpty = element.length == 0, - multiple = element.multiple, - previousScrollTop = (!selectWasPreviouslyEmpty && multiple) ? element.scrollTop : null, - unwrappedArray = ko.utils.unwrapObservable(valueAccessor()), - valueAllowUnset = allBindings.get('valueAllowUnset') && allBindings['has']('value'), - includeDestroyed = allBindings.get('optionsIncludeDestroyed'), - arrayToDomNodeChildrenOptions = {}, - captionValue, - filteredArray, - previousSelectedValues = []; - - if (!valueAllowUnset) { - if (multiple) { - previousSelectedValues = ko.utils.arrayMap(selectedOptions(), ko.selectExtensions.readValue); - } else if (element.selectedIndex >= 0) { - previousSelectedValues.push(ko.selectExtensions.readValue(element.options[element.selectedIndex])); - } - } + if (!valueAllowUnset) { + // Determine if the selection has changed as a result of updating the options list + var selectionChanged; + if (multiple) { + // For a multiple-select box, compare the new selection count to the previous one + // But if nothing was selected before, the selection can't have changed + selectionChanged = previousSelectedValues.length && selectedOptions().length < previousSelectedValues.length; + } else { + // For a single-select box, compare the current value to the previous value + // But if nothing was selected before or nothing is selected now, just look for a change in selection + selectionChanged = (previousSelectedValues.length && element.selectedIndex >= 0) + ? (ko.selectExtensions.readValue(element.options[element.selectedIndex]) !== previousSelectedValues[0]) + : (previousSelectedValues.length || element.selectedIndex >= 0); + } + + // Ensure consistency between model value and selected option. + // If the dropdown was changed so that selection is no longer the same, + // notify the value or selectedOptions binding. + if (selectionChanged) { + ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, "change"]); + } + } - if (unwrappedArray) { - if (typeof unwrappedArray.length == "undefined") // Coerce single value into array - unwrappedArray = [unwrappedArray]; + if (valueAllowUnset || ko.computedContext.isInitial()) { + ko.bindingEvent.notify(element, ko.bindingEvent.childrenComplete); + } - // Filter out any entries marked as destroyed - filteredArray = ko.utils.arrayFilter(unwrappedArray, function(item) { - return includeDestroyed || item === undefined || item === null || !ko.utils.unwrapObservable(item['_destroy']); - }); + // Workaround for IE bug + ko.utils.ensureSelectElementIsRenderedCorrectly(element); - // If caption is included, add it to the array - if (allBindings['has']('optionsCaption')) { - captionValue = ko.utils.unwrapObservable(allBindings.get('optionsCaption')); - // If caption value is null or undefined, don't show a caption - if (captionValue !== null && captionValue !== undefined) { - filteredArray.unshift(captionPlaceholder); + if (previousScrollTop && Math.abs(previousScrollTop - element.scrollTop) > 20) + element.scrollTop = previousScrollTop; } - } - } else { - // If a falsy value is provided (e.g. null), we'll simply empty the select element - } + }; + ko.bindingHandlers['options'].optionValueDomDataKey = ko.utils.domData.nextKey(); + ko.bindingHandlers['selectedOptions'] = { + 'init': function (element, valueAccessor, allBindings) { + function updateFromView() { + var value = valueAccessor(), valueToWrite = []; + ko.utils.arrayForEach(element.getElementsByTagName("option"), function(node) { + if (node.selected) + valueToWrite.push(ko.selectExtensions.readValue(node)); + }); + ko.expressionRewriting.writeValueToProperty(value, allBindings, 'selectedOptions', valueToWrite); + } - function applyToObject(object, predicate, defaultValue) { - var predicateType = typeof predicate; - if (predicateType == "function") // Given a function; run it against the data value - return predicate(object); - else if (predicateType == "string") // Given a string; treat it as a property name on the data value - return object[predicate]; - else // Given no optionsText arg; use the data value itself - return defaultValue; - } + function updateFromModel() { + var newValue = ko.utils.unwrapObservable(valueAccessor()), + previousScrollTop = element.scrollTop; - // The following functions can run at two different times: - // The first is when the whole array is being updated directly from this binding handler. - // The second is when an observable value for a specific array entry is updated. - // oldOptions will be empty in the first case, but will be filled with the previously generated option in the second. - var itemUpdate = false; - function optionForArrayItem(arrayEntry, index, oldOptions) { - if (oldOptions.length) { - previousSelectedValues = !valueAllowUnset && oldOptions[0].selected ? [ ko.selectExtensions.readValue(oldOptions[0]) ] : []; - itemUpdate = true; - } - var option = element.ownerDocument.createElement("option"); - if (arrayEntry === captionPlaceholder) { - ko.utils.setTextContent(option, allBindings.get('optionsCaption')); - ko.selectExtensions.writeValue(option, undefined); - } else { - // Apply a value to the option element - var optionValue = applyToObject(arrayEntry, allBindings.get('optionsValue'), arrayEntry); - ko.selectExtensions.writeValue(option, ko.utils.unwrapObservable(optionValue)); + if (newValue && typeof newValue.length == "number") { + ko.utils.arrayForEach(element.getElementsByTagName("option"), function(node) { + var isSelected = ko.utils.arrayIndexOf(newValue, ko.selectExtensions.readValue(node)) >= 0; + if (node.selected != isSelected) { // This check prevents flashing of the select element in IE + ko.utils.setOptionNodeSelectionState(node, isSelected); + } + }); + } - // Apply some text to the option element - var optionText = applyToObject(arrayEntry, allBindings.get('optionsText'), optionValue); - ko.utils.setTextContent(option, optionText); - } - return [option]; - } + element.scrollTop = previousScrollTop; + } - // By using a beforeRemove callback, we delay the removal until after new items are added. This fixes a selection - // problem in IE<=8 and Firefox. See https://github.com/knockout/knockout/issues/1208 - arrayToDomNodeChildrenOptions['beforeRemove'] = - function (option) { - element.removeChild(option); - }; + if (ko.utils.tagNameLower(element) != "select") { + throw new Error("selectedOptions binding applies only to SELECT elements"); + } - function setSelectionCallback(arrayEntry, newOptions) { - if (itemUpdate && valueAllowUnset) { - // The model value is authoritative, so make sure its value is the one selected - // There is no need to use dependencyDetection.ignore since setDomNodeChildrenFromArrayMapping does so already. - ko.selectExtensions.writeValue(element, ko.utils.unwrapObservable(allBindings.get('value')), true /* allowUnset */); - } else if (previousSelectedValues.length) { - // IE6 doesn't like us to assign selection to OPTION nodes before they're added to the document. - // That's why we first added them without selection. Now it's time to set the selection. - var isSelected = ko.utils.arrayIndexOf(previousSelectedValues, ko.selectExtensions.readValue(newOptions[0])) >= 0; - ko.utils.setOptionNodeSelectionState(newOptions[0], isSelected); - - // If this option was changed from being selected during a single-item update, notify the change - if (itemUpdate && !isSelected) { - ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, "change"]); - } - } - } + var updateFromModelComputed; + ko.bindingEvent.subscribe(element, ko.bindingEvent.childrenComplete, function () { + if (!updateFromModelComputed) { + ko.utils.registerEventHandler(element, "change", updateFromView); + updateFromModelComputed = ko.computed(updateFromModel, null, { disposeWhenNodeIsRemoved: element }); + } else { + updateFromView(); + } + }, null, { 'notifyImmediately': true }); + }, + 'update': function() {} // Keep for backwards compatibility with code that may have wrapped binding + }; + ko.expressionRewriting.twoWayBindings['selectedOptions'] = true; + ko.bindingHandlers['style'] = { + 'update': function (element, valueAccessor) { + var value = ko.utils.unwrapObservable(valueAccessor() || {}); + ko.utils.objectForEach(value, function(styleName, styleValue) { + styleValue = ko.utils.unwrapObservable(styleValue); + + if (styleValue === null || styleValue === undefined || styleValue === false) { + // Empty string removes the value, whereas null/undefined have no effect + styleValue = ""; + } - var callback = setSelectionCallback; - if (allBindings['has']('optionsAfterRender') && typeof allBindings.get('optionsAfterRender') == "function") { - callback = function(arrayEntry, newOptions) { - setSelectionCallback(arrayEntry, newOptions); - ko.dependencyDetection.ignore(allBindings.get('optionsAfterRender'), null, [newOptions[0], arrayEntry !== captionPlaceholder ? arrayEntry : undefined]); - } - } + if (jQueryInstance) { + jQueryInstance(element)['css'](styleName, styleValue); + } else if (/^--/.test(styleName)) { + // Is styleName a custom CSS property? + element.style.setProperty(styleName, styleValue); + } else { + styleName = styleName.replace(/-(\w)/g, function (all, letter) { + return letter.toUpperCase(); + }); - ko.utils.setDomNodeChildrenFromArrayMapping(element, filteredArray, optionForArrayItem, arrayToDomNodeChildrenOptions, callback); + var previousStyle = element.style[styleName]; + element.style[styleName] = styleValue; - ko.dependencyDetection.ignore(function () { - if (valueAllowUnset) { - // The model value is authoritative, so make sure its value is the one selected - ko.selectExtensions.writeValue(element, ko.utils.unwrapObservable(allBindings.get('value')), true /* allowUnset */); - } else { - // Determine if the selection has changed as a result of updating the options list - var selectionChanged; - if (multiple) { - // For a multiple-select box, compare the new selection count to the previous one - // But if nothing was selected before, the selection can't have changed - selectionChanged = previousSelectedValues.length && selectedOptions().length < previousSelectedValues.length; - } else { - // For a single-select box, compare the current value to the previous value - // But if nothing was selected before or nothing is selected now, just look for a change in selection - selectionChanged = (previousSelectedValues.length && element.selectedIndex >= 0) - ? (ko.selectExtensions.readValue(element.options[element.selectedIndex]) !== previousSelectedValues[0]) - : (previousSelectedValues.length || element.selectedIndex >= 0); + if (styleValue !== previousStyle && element.style[styleName] == previousStyle && !isNaN(styleValue)) { + element.style[styleName] = styleValue + "px"; + } + } + }); } - - // Ensure consistency between model value and selected option. - // If the dropdown was changed so that selection is no longer the same, - // notify the value or selectedOptions binding. - if (selectionChanged) { - ko.utils.triggerEvent(element, "change"); + }; + ko.bindingHandlers['submit'] = { + 'init': function (element, valueAccessor, allBindings, viewModel, bindingContext) { + if (typeof valueAccessor() != "function") + throw new Error("The value for a submit binding must be a function"); + ko.utils.registerEventHandler(element, "submit", function (event) { + var handlerReturnValue; + var value = valueAccessor(); + try { handlerReturnValue = value.call(bindingContext['$data'], element); } + finally { + if (handlerReturnValue !== true) { // Normally we want to prevent default action. Developer can override this be explicitly returning true. + if (event.preventDefault) + event.preventDefault(); + else + event.returnValue = false; + } + } + }); } - } - }); - - // Workaround for IE bug - ko.utils.ensureSelectElementIsRenderedCorrectly(element); - - if (previousScrollTop && Math.abs(previousScrollTop - element.scrollTop) > 20) - element.scrollTop = previousScrollTop; - } -}; -ko.bindingHandlers['options'].optionValueDomDataKey = ko.utils.domData.nextKey(); -ko.bindingHandlers['selectedOptions'] = { - 'after': ['options', 'foreach'], - 'init': function (element, valueAccessor, allBindings) { - ko.utils.registerEventHandler(element, "change", function () { - var value = valueAccessor(), valueToWrite = []; - ko.utils.arrayForEach(element.getElementsByTagName("option"), function(node) { - if (node.selected) - valueToWrite.push(ko.selectExtensions.readValue(node)); - }); - ko.expressionRewriting.writeValueToProperty(value, allBindings, 'selectedOptions', valueToWrite); - }); - }, - 'update': function (element, valueAccessor) { - if (ko.utils.tagNameLower(element) != "select") - throw new Error("values binding applies only to SELECT elements"); - - var newValue = ko.utils.unwrapObservable(valueAccessor()), - previousScrollTop = element.scrollTop; - - if (newValue && typeof newValue.length == "number") { - ko.utils.arrayForEach(element.getElementsByTagName("option"), function(node) { - var isSelected = ko.utils.arrayIndexOf(newValue, ko.selectExtensions.readValue(node)) >= 0; - if (node.selected != isSelected) { // This check prevents flashing of the select element in IE - ko.utils.setOptionNodeSelectionState(node, isSelected); + }; + ko.bindingHandlers['text'] = { + 'init': function() { + // Prevent binding on the dynamically-injected text node (as developers are unlikely to expect that, and it has security implications). + // It should also make things faster, as we no longer have to consider whether the text node might be bindable. + return { 'controlsDescendantBindings': true }; + }, + 'update': function (element, valueAccessor) { + ko.utils.setTextContent(element, valueAccessor()); } - }); - } + }; + ko.virtualElements.allowedBindings['text'] = true; + (function () { - element.scrollTop = previousScrollTop; - } -}; -ko.expressionRewriting.twoWayBindings['selectedOptions'] = true; -ko.bindingHandlers['style'] = { - 'update': function (element, valueAccessor) { - var value = ko.utils.unwrapObservable(valueAccessor() || {}); - ko.utils.objectForEach(value, function(styleName, styleValue) { - styleValue = ko.utils.unwrapObservable(styleValue); - - if (styleValue === null || styleValue === undefined || styleValue === false) { - // Empty string removes the value, whereas null/undefined have no effect - styleValue = ""; - } + if (window && window.navigator) { + var parseVersion = function (matches) { + if (matches) { + return parseFloat(matches[1]); + } + }; - element.style[styleName] = styleValue; - }); - } -}; -ko.bindingHandlers['submit'] = { - 'init': function (element, valueAccessor, allBindings, viewModel, bindingContext) { - if (typeof valueAccessor() != "function") - throw new Error("The value for a submit binding must be a function"); - ko.utils.registerEventHandler(element, "submit", function (event) { - var handlerReturnValue; - var value = valueAccessor(); - try { handlerReturnValue = value.call(bindingContext['$data'], element); } - finally { - if (handlerReturnValue !== true) { // Normally we want to prevent default action. Developer can override this be explicitly returning true. - if (event.preventDefault) - event.preventDefault(); - else - event.returnValue = false; + // Detect various browser versions because some old versions don't fully support the 'input' event + var userAgent = window.navigator.userAgent, + operaVersion, chromeVersion, safariVersion, firefoxVersion, ieVersion, edgeVersion; + + (operaVersion = window.opera && window.opera.version && parseInt(window.opera.version())) + || (edgeVersion = parseVersion(userAgent.match(/Edge\/([^ ]+)$/))) + || (chromeVersion = parseVersion(userAgent.match(/Chrome\/([^ ]+)/))) + || (safariVersion = parseVersion(userAgent.match(/Version\/([^ ]+) Safari/))) + || (firefoxVersion = parseVersion(userAgent.match(/Firefox\/([^ ]+)/))) + || (ieVersion = ko.utils.ieVersion || parseVersion(userAgent.match(/MSIE ([^ ]+)/))) // Detects up to IE 10 + || (ieVersion = parseVersion(userAgent.match(/rv:([^ )]+)/))); // Detects IE 11 } - } - }); - } -}; -ko.bindingHandlers['text'] = { - 'init': function() { - // Prevent binding on the dynamically-injected text node (as developers are unlikely to expect that, and it has security implications). - // It should also make things faster, as we no longer have to consider whether the text node might be bindable. - return { 'controlsDescendantBindings': true }; - }, - 'update': function (element, valueAccessor) { - ko.utils.setTextContent(element, valueAccessor()); - } -}; -ko.virtualElements.allowedBindings['text'] = true; -(function () { - -if (window && window.navigator) { - var parseVersion = function (matches) { - if (matches) { - return parseFloat(matches[1]); - } - }; - - // Detect various browser versions because some old versions don't fully support the 'input' event - var operaVersion = window.opera && window.opera.version && parseInt(window.opera.version()), - userAgent = window.navigator.userAgent, - safariVersion = parseVersion(userAgent.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)), - firefoxVersion = parseVersion(userAgent.match(/Firefox\/([^ ]*)/)); -} // IE 8 and 9 have bugs that prevent the normal events from firing when the value changes. // But it does fire the 'selectionchange' event on many of those, presumably because the @@ -4682,292 +5186,352 @@ if (window && window.navigator) { // fired at the document level only and doesn't directly indicate which element changed. We // set up just one event handler for the document and use 'activeElement' to determine which // element was changed. -if (ko.utils.ieVersion < 10) { - var selectionChangeRegisteredName = ko.utils.domData.nextKey(), - selectionChangeHandlerName = ko.utils.domData.nextKey(); - var selectionChangeHandler = function(event) { - var target = this.activeElement, - handler = target && ko.utils.domData.get(target, selectionChangeHandlerName); - if (handler) { - handler(event); - } - }; - var registerForSelectionChangeEvent = function (element, handler) { - var ownerDoc = element.ownerDocument; - if (!ko.utils.domData.get(ownerDoc, selectionChangeRegisteredName)) { - ko.utils.domData.set(ownerDoc, selectionChangeRegisteredName, true); - ko.utils.registerEventHandler(ownerDoc, 'selectionchange', selectionChangeHandler); - } - ko.utils.domData.set(element, selectionChangeHandlerName, handler); - }; -} - -ko.bindingHandlers['textInput'] = { - 'init': function (element, valueAccessor, allBindings) { - - var previousElementValue = element.value, - timeoutHandle, - elementValueBeforeEvent; - - var updateModel = function (event) { - clearTimeout(timeoutHandle); - elementValueBeforeEvent = timeoutHandle = undefined; - - var elementValue = element.value; - if (previousElementValue !== elementValue) { - // Provide a way for tests to know exactly which event was processed - if (DEBUG && event) element['_ko_textInputProcessedEvent'] = event.type; - previousElementValue = elementValue; - ko.expressionRewriting.writeValueToProperty(valueAccessor(), allBindings, 'textInput', elementValue); - } - }; - - var deferUpdateModel = function (event) { - if (!timeoutHandle) { - // The elementValueBeforeEvent variable is set *only* during the brief gap between an - // event firing and the updateModel function running. This allows us to ignore model - // updates that are from the previous state of the element, usually due to techniques - // such as rateLimit. Such updates, if not ignored, can cause keystrokes to be lost. - elementValueBeforeEvent = element.value; - var handler = DEBUG ? updateModel.bind(element, {type: event.type}) : updateModel; - timeoutHandle = ko.utils.setTimeout(handler, 4); - } - }; + if (ieVersion >= 8 && ieVersion < 10) { + var selectionChangeRegisteredName = ko.utils.domData.nextKey(), + selectionChangeHandlerName = ko.utils.domData.nextKey(); + var selectionChangeHandler = function(event) { + var target = this.activeElement, + handler = target && ko.utils.domData.get(target, selectionChangeHandlerName); + if (handler) { + handler(event); + } + }; + var registerForSelectionChangeEvent = function (element, handler) { + var ownerDoc = element.ownerDocument; + if (!ko.utils.domData.get(ownerDoc, selectionChangeRegisteredName)) { + ko.utils.domData.set(ownerDoc, selectionChangeRegisteredName, true); + ko.utils.registerEventHandler(ownerDoc, 'selectionchange', selectionChangeHandler); + } + ko.utils.domData.set(element, selectionChangeHandlerName, handler); + }; + } - // IE9 will mess up the DOM if you handle events synchronously which results in DOM changes (such as other bindings); - // so we'll make sure all updates are asynchronous - var ieUpdateModel = ko.utils.ieVersion == 9 ? deferUpdateModel : updateModel; + ko.bindingHandlers['textInput'] = { + 'init': function (element, valueAccessor, allBindings) { - var updateView = function () { - var modelValue = ko.utils.unwrapObservable(valueAccessor()); + var previousElementValue = element.value, + timeoutHandle, + elementValueBeforeEvent; - if (modelValue === null || modelValue === undefined) { - modelValue = ''; - } + var updateModel = function (event) { + clearTimeout(timeoutHandle); + elementValueBeforeEvent = timeoutHandle = undefined; - if (elementValueBeforeEvent !== undefined && modelValue === elementValueBeforeEvent) { - ko.utils.setTimeout(updateView, 4); - return; - } + var elementValue = element.value; + if (previousElementValue !== elementValue) { + // Provide a way for tests to know exactly which event was processed + if (DEBUG && event) element['_ko_textInputProcessedEvent'] = event.type; + previousElementValue = elementValue; + ko.expressionRewriting.writeValueToProperty(valueAccessor(), allBindings, 'textInput', elementValue); + } + }; + + var deferUpdateModel = function (event) { + if (!timeoutHandle) { + // The elementValueBeforeEvent variable is set *only* during the brief gap between an + // event firing and the updateModel function running. This allows us to ignore model + // updates that are from the previous state of the element, usually due to techniques + // such as rateLimit. Such updates, if not ignored, can cause keystrokes to be lost. + elementValueBeforeEvent = element.value; + var handler = DEBUG ? updateModel.bind(element, {type: event.type}) : updateModel; + timeoutHandle = ko.utils.setTimeout(handler, 4); + } + }; - // Update the element only if the element and model are different. On some browsers, updating the value - // will move the cursor to the end of the input, which would be bad while the user is typing. - if (element.value !== modelValue) { - previousElementValue = modelValue; // Make sure we ignore events (propertychange) that result from updating the value - element.value = modelValue; - } - }; + // IE9 will mess up the DOM if you handle events synchronously which results in DOM changes (such as other bindings); + // so we'll make sure all updates are asynchronous + var ieUpdateModel = ko.utils.ieVersion == 9 ? deferUpdateModel : updateModel, + ourUpdate = false; - var onEvent = function (event, handler) { - ko.utils.registerEventHandler(element, event, handler); - }; + var updateView = function () { + var modelValue = ko.utils.unwrapObservable(valueAccessor()); - if (DEBUG && ko.bindingHandlers['textInput']['_forceUpdateOn']) { - // Provide a way for tests to specify exactly which events are bound - ko.utils.arrayForEach(ko.bindingHandlers['textInput']['_forceUpdateOn'], function(eventName) { - if (eventName.slice(0,5) == 'after') { - onEvent(eventName.slice(5), deferUpdateModel); - } else { - onEvent(eventName, updateModel); - } - }); - } else { - if (ko.utils.ieVersion < 10) { - // Internet Explorer <= 8 doesn't support the 'input' event, but does include 'propertychange' that fires whenever - // any property of an element changes. Unlike 'input', it also fires if a property is changed from JavaScript code, - // but that's an acceptable compromise for this binding. IE 9 does support 'input', but since it doesn't fire it - // when using autocomplete, we'll use 'propertychange' for it also. - onEvent('propertychange', function(event) { - if (event.propertyName === 'value') { - ieUpdateModel(event); - } - }); + if (modelValue === null || modelValue === undefined) { + modelValue = ''; + } - if (ko.utils.ieVersion == 8) { - // IE 8 has a bug where it fails to fire 'propertychange' on the first update following a value change from - // JavaScript code. It also doesn't fire if you clear the entire value. To fix this, we bind to the following - // events too. - onEvent('keyup', updateModel); // A single keystoke - onEvent('keydown', updateModel); // The first character when a key is held down - } - if (ko.utils.ieVersion >= 8) { - // Internet Explorer 9 doesn't fire the 'input' event when deleting text, including using - // the backspace, delete, or ctrl-x keys, clicking the 'x' to clear the input, dragging text - // out of the field, and cutting or deleting text using the context menu. 'selectionchange' - // can detect all of those except dragging text out of the field, for which we use 'dragend'. - // These are also needed in IE8 because of the bug described above. - registerForSelectionChangeEvent(element, ieUpdateModel); // 'selectionchange' covers cut, paste, drop, delete, etc. - onEvent('dragend', deferUpdateModel); - } - } else { - // All other supported browsers support the 'input' event, which fires whenever the content of the element is changed - // through the user interface. - onEvent('input', updateModel); - - if (safariVersion < 5 && ko.utils.tagNameLower(element) === "textarea") { - // Safari <5 doesn't fire the 'input' event for <textarea> elements (it does fire 'textInput' - // but only when typing). So we'll just catch as much as we can with keydown, cut, and paste. - onEvent('keydown', deferUpdateModel); - onEvent('paste', deferUpdateModel); - onEvent('cut', deferUpdateModel); - } else if (operaVersion < 11) { - // Opera 10 doesn't always fire the 'input' event for cut, paste, undo & drop operations. - // We can try to catch some of those using 'keydown'. - onEvent('keydown', deferUpdateModel); - } else if (firefoxVersion < 4.0) { - // Firefox <= 3.6 doesn't fire the 'input' event when text is filled in through autocomplete - onEvent('DOMAutoComplete', updateModel); - - // Firefox <=3.5 doesn't fire the 'input' event when text is dropped into the input. - onEvent('dragdrop', updateModel); // <3.5 - onEvent('drop', updateModel); // 3.5 - } - } - } + if (elementValueBeforeEvent !== undefined && modelValue === elementValueBeforeEvent) { + ko.utils.setTimeout(updateView, 4); + return; + } + + // Update the element only if the element and model are different. On some browsers, updating the value + // will move the cursor to the end of the input, which would be bad while the user is typing. + if (element.value !== modelValue) { + ourUpdate = true; // Make sure we ignore events (propertychange) that result from updating the value + element.value = modelValue; + ourUpdate = false; + previousElementValue = element.value; // In case the browser changes the value (see #2281) + } + }; + + var onEvent = function (event, handler) { + ko.utils.registerEventHandler(element, event, handler); + }; + + if (DEBUG && ko.bindingHandlers['textInput']['_forceUpdateOn']) { + // Provide a way for tests to specify exactly which events are bound + ko.utils.arrayForEach(ko.bindingHandlers['textInput']['_forceUpdateOn'], function(eventName) { + if (eventName.slice(0,5) == 'after') { + onEvent(eventName.slice(5), deferUpdateModel); + } else { + onEvent(eventName, updateModel); + } + }); + } else { + if (ieVersion) { + // All versions (including 11) of Internet Explorer have a bug that they don't generate an input or propertychange event when ESC is pressed + onEvent('keypress', updateModel); + } + if (ieVersion < 11) { + // Internet Explorer <= 8 doesn't support the 'input' event, but does include 'propertychange' that fires whenever + // any property of an element changes. Unlike 'input', it also fires if a property is changed from JavaScript code, + // but that's an acceptable compromise for this binding. IE 9 and 10 support 'input', but since they don't always + // fire it when using autocomplete, we'll use 'propertychange' for them also. + onEvent('propertychange', function(event) { + if (!ourUpdate && event.propertyName === 'value') { + ieUpdateModel(event); + } + }); + } + if (ieVersion == 8) { + // IE 8 has a bug where it fails to fire 'propertychange' on the first update following a value change from + // JavaScript code. It also doesn't fire if you clear the entire value. To fix this, we bind to the following + // events too. + onEvent('keyup', updateModel); // A single keystoke + onEvent('keydown', updateModel); // The first character when a key is held down + } + if (registerForSelectionChangeEvent) { + // Internet Explorer 9 doesn't fire the 'input' event when deleting text, including using + // the backspace, delete, or ctrl-x keys, clicking the 'x' to clear the input, dragging text + // out of the field, and cutting or deleting text using the context menu. 'selectionchange' + // can detect all of those except dragging text out of the field, for which we use 'dragend'. + // These are also needed in IE8 because of the bug described above. + registerForSelectionChangeEvent(element, ieUpdateModel); // 'selectionchange' covers cut, paste, drop, delete, etc. + onEvent('dragend', deferUpdateModel); + } + + if (!ieVersion || ieVersion >= 9) { + // All other supported browsers support the 'input' event, which fires whenever the content of the element is changed + // through the user interface. + onEvent('input', ieUpdateModel); + } + + if (safariVersion < 5 && ko.utils.tagNameLower(element) === "textarea") { + // Safari <5 doesn't fire the 'input' event for <textarea> elements (it does fire 'textInput' + // but only when typing). So we'll just catch as much as we can with keydown, cut, and paste. + onEvent('keydown', deferUpdateModel); + onEvent('paste', deferUpdateModel); + onEvent('cut', deferUpdateModel); + } else if (operaVersion < 11) { + // Opera 10 doesn't always fire the 'input' event for cut, paste, undo & drop operations. + // We can try to catch some of those using 'keydown'. + onEvent('keydown', deferUpdateModel); + } else if (firefoxVersion < 4.0) { + // Firefox <= 3.6 doesn't fire the 'input' event when text is filled in through autocomplete + onEvent('DOMAutoComplete', updateModel); + + // Firefox <=3.5 doesn't fire the 'input' event when text is dropped into the input. + onEvent('dragdrop', updateModel); // <3.5 + onEvent('drop', updateModel); // 3.5 + } else if (edgeVersion && element.type === "number") { + // Microsoft Edge doesn't fire 'input' or 'change' events for number inputs when + // the value is changed via the up / down arrow keys + onEvent('keydown', deferUpdateModel); + } + } - // Bind to the change event so that we can catch programmatic updates of the value that fire this event. - onEvent('change', updateModel); + // Bind to the change event so that we can catch programmatic updates of the value that fire this event. + onEvent('change', updateModel); - ko.computed(updateView, null, { disposeWhenNodeIsRemoved: element }); - } -}; -ko.expressionRewriting.twoWayBindings['textInput'] = true; + // To deal with browsers that don't notify any kind of event for some changes (IE, Safari, etc.) + onEvent('blur', updateModel); + + ko.computed(updateView, null, { disposeWhenNodeIsRemoved: element }); + } + }; + ko.expressionRewriting.twoWayBindings['textInput'] = true; // textinput is an alias for textInput -ko.bindingHandlers['textinput'] = { - // preprocess is the only way to set up a full alias - 'preprocess': function (value, name, addBinding) { - addBinding('textInput', value); - } -}; - -})();ko.bindingHandlers['uniqueName'] = { - 'init': function (element, valueAccessor) { - if (valueAccessor()) { - var name = "ko_unique_" + (++ko.bindingHandlers['uniqueName'].currentIndex); - ko.utils.setElementName(element, name); - } - } -}; -ko.bindingHandlers['uniqueName'].currentIndex = 0; -ko.bindingHandlers['value'] = { - 'after': ['options', 'foreach'], - 'init': function (element, valueAccessor, allBindings) { - // If the value binding is placed on a radio/checkbox, then just pass through to checkedValue and quit - if (element.tagName.toLowerCase() == "input" && (element.type == "checkbox" || element.type == "radio")) { - ko.applyBindingAccessorsToNode(element, { 'checkedValue': valueAccessor }); - return; - } + ko.bindingHandlers['textinput'] = { + // preprocess is the only way to set up a full alias + 'preprocess': function (value, name, addBinding) { + addBinding('textInput', value); + } + }; - // Always catch "change" event; possibly other events too if asked - var eventsToCatch = ["change"]; - var requestedEventsToCatch = allBindings.get("valueUpdate"); - var propertyChangedFired = false; - var elementValueBeforeEvent = null; - - if (requestedEventsToCatch) { - if (typeof requestedEventsToCatch == "string") // Allow both individual event names, and arrays of event names - requestedEventsToCatch = [requestedEventsToCatch]; - ko.utils.arrayPushAll(eventsToCatch, requestedEventsToCatch); - eventsToCatch = ko.utils.arrayGetDistinctValues(eventsToCatch); - } + })();ko.bindingHandlers['uniqueName'] = { + 'init': function (element, valueAccessor) { + if (valueAccessor()) { + var name = "ko_unique_" + (++ko.bindingHandlers['uniqueName'].currentIndex); + ko.utils.setElementName(element, name); + } + } + }; + ko.bindingHandlers['uniqueName'].currentIndex = 0; + ko.bindingHandlers['using'] = { + 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { + var options; - var valueUpdateHandler = function() { - elementValueBeforeEvent = null; - propertyChangedFired = false; - var modelValue = valueAccessor(); - var elementValue = ko.selectExtensions.readValue(element); - ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'value', elementValue); - } + if (allBindings['has']('as')) { + options = { 'as': allBindings.get('as'), 'noChildContext': allBindings.get('noChildContext') }; + } + + var innerContext = bindingContext['createChildContext'](valueAccessor, options); + ko.applyBindingsToDescendants(innerContext, element); - // Workaround for https://github.com/SteveSanderson/knockout/issues/122 - // IE doesn't fire "change" events on textboxes if the user selects a value from its autocomplete list - var ieAutoCompleteHackNeeded = ko.utils.ieVersion && element.tagName.toLowerCase() == "input" && element.type == "text" - && element.autocomplete != "off" && (!element.form || element.form.autocomplete != "off"); - if (ieAutoCompleteHackNeeded && ko.utils.arrayIndexOf(eventsToCatch, "propertychange") == -1) { - ko.utils.registerEventHandler(element, "propertychange", function () { propertyChangedFired = true }); - ko.utils.registerEventHandler(element, "focus", function () { propertyChangedFired = false }); - ko.utils.registerEventHandler(element, "blur", function() { - if (propertyChangedFired) { - valueUpdateHandler(); + return { 'controlsDescendantBindings': true }; } - }); - } + }; + ko.virtualElements.allowedBindings['using'] = true; + ko.bindingHandlers['value'] = { + 'init': function (element, valueAccessor, allBindings) { + var tagName = ko.utils.tagNameLower(element), + isInputElement = tagName == "input"; + + // If the value binding is placed on a radio/checkbox, then just pass through to checkedValue and quit + if (isInputElement && (element.type == "checkbox" || element.type == "radio")) { + ko.applyBindingAccessorsToNode(element, { 'checkedValue': valueAccessor }); + return; + } - ko.utils.arrayForEach(eventsToCatch, function(eventName) { - // The syntax "after<eventname>" means "run the handler asynchronously after the event" - // This is useful, for example, to catch "keydown" events after the browser has updated the control - // (otherwise, ko.selectExtensions.readValue(this) will receive the control's value *before* the key event) - var handler = valueUpdateHandler; - if (ko.utils.stringStartsWith(eventName, "after")) { - handler = function() { - // The elementValueBeforeEvent variable is non-null *only* during the brief gap between - // a keyX event firing and the valueUpdateHandler running, which is scheduled to happen - // at the earliest asynchronous opportunity. We store this temporary information so that - // if, between keyX and valueUpdateHandler, the underlying model value changes separately, - // we can overwrite that model value change with the value the user just typed. Otherwise, - // techniques like rateLimit can trigger model changes at critical moments that will - // override the user's inputs, causing keystrokes to be lost. - elementValueBeforeEvent = ko.selectExtensions.readValue(element); - ko.utils.setTimeout(valueUpdateHandler, 0); - }; - eventName = eventName.substring("after".length); - } - ko.utils.registerEventHandler(element, eventName, handler); - }); + var eventsToCatch = []; + var requestedEventsToCatch = allBindings.get("valueUpdate"); + var propertyChangedFired = false; + var elementValueBeforeEvent = null; + + if (requestedEventsToCatch) { + // Allow both individual event names, and arrays of event names + if (typeof requestedEventsToCatch == "string") { + eventsToCatch = [requestedEventsToCatch]; + } else { + eventsToCatch = ko.utils.arrayGetDistinctValues(requestedEventsToCatch); + } + ko.utils.arrayRemoveItem(eventsToCatch, "change"); // We'll subscribe to "change" events later + } - var updateFromModel = function () { - var newValue = ko.utils.unwrapObservable(valueAccessor()); - var elementValue = ko.selectExtensions.readValue(element); + var valueUpdateHandler = function() { + elementValueBeforeEvent = null; + propertyChangedFired = false; + var modelValue = valueAccessor(); + var elementValue = ko.selectExtensions.readValue(element); + ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'value', elementValue); + } - if (elementValueBeforeEvent !== null && newValue === elementValueBeforeEvent) { - ko.utils.setTimeout(updateFromModel, 0); - return; - } + // Workaround for https://github.com/SteveSanderson/knockout/issues/122 + // IE doesn't fire "change" events on textboxes if the user selects a value from its autocomplete list + var ieAutoCompleteHackNeeded = ko.utils.ieVersion && isInputElement && element.type == "text" + && element.autocomplete != "off" && (!element.form || element.form.autocomplete != "off"); + if (ieAutoCompleteHackNeeded && ko.utils.arrayIndexOf(eventsToCatch, "propertychange") == -1) { + ko.utils.registerEventHandler(element, "propertychange", function () { propertyChangedFired = true }); + ko.utils.registerEventHandler(element, "focus", function () { propertyChangedFired = false }); + ko.utils.registerEventHandler(element, "blur", function() { + if (propertyChangedFired) { + valueUpdateHandler(); + } + }); + } + + ko.utils.arrayForEach(eventsToCatch, function(eventName) { + // The syntax "after<eventname>" means "run the handler asynchronously after the event" + // This is useful, for example, to catch "keydown" events after the browser has updated the control + // (otherwise, ko.selectExtensions.readValue(this) will receive the control's value *before* the key event) + var handler = valueUpdateHandler; + if (ko.utils.stringStartsWith(eventName, "after")) { + handler = function() { + // The elementValueBeforeEvent variable is non-null *only* during the brief gap between + // a keyX event firing and the valueUpdateHandler running, which is scheduled to happen + // at the earliest asynchronous opportunity. We store this temporary information so that + // if, between keyX and valueUpdateHandler, the underlying model value changes separately, + // we can overwrite that model value change with the value the user just typed. Otherwise, + // techniques like rateLimit can trigger model changes at critical moments that will + // override the user's inputs, causing keystrokes to be lost. + elementValueBeforeEvent = ko.selectExtensions.readValue(element); + ko.utils.setTimeout(valueUpdateHandler, 0); + }; + eventName = eventName.substring("after".length); + } + ko.utils.registerEventHandler(element, eventName, handler); + }); - var valueHasChanged = (newValue !== elementValue); + var updateFromModel; - if (valueHasChanged) { - if (ko.utils.tagNameLower(element) === "select") { - var allowUnset = allBindings.get('valueAllowUnset'); - var applyValueAction = function () { - ko.selectExtensions.writeValue(element, newValue, allowUnset); - }; - applyValueAction(); + if (isInputElement && element.type == "file") { + // For file input elements, can only write the empty string + updateFromModel = function () { + var newValue = ko.utils.unwrapObservable(valueAccessor()); + if (newValue === null || newValue === undefined || newValue === "") { + element.value = ""; + } else { + ko.dependencyDetection.ignore(valueUpdateHandler); // reset the model to match the element + } + } + } else { + updateFromModel = function () { + var newValue = ko.utils.unwrapObservable(valueAccessor()); + var elementValue = ko.selectExtensions.readValue(element); + + if (elementValueBeforeEvent !== null && newValue === elementValueBeforeEvent) { + ko.utils.setTimeout(updateFromModel, 0); + return; + } + + var valueHasChanged = newValue !== elementValue; + + if (valueHasChanged || elementValue === undefined) { + if (tagName === "select") { + var allowUnset = allBindings.get('valueAllowUnset'); + ko.selectExtensions.writeValue(element, newValue, allowUnset); + if (!allowUnset && newValue !== ko.selectExtensions.readValue(element)) { + // If you try to set a model value that can't be represented in an already-populated dropdown, reject that change, + // because you're not allowed to have a model value that disagrees with a visible UI selection. + ko.dependencyDetection.ignore(valueUpdateHandler); + } + } else { + ko.selectExtensions.writeValue(element, newValue); + } + } + }; + } - if (!allowUnset && newValue !== ko.selectExtensions.readValue(element)) { - // If you try to set a model value that can't be represented in an already-populated dropdown, reject that change, - // because you're not allowed to have a model value that disagrees with a visible UI selection. - ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, "change"]); + if (tagName === "select") { + var updateFromModelComputed; + ko.bindingEvent.subscribe(element, ko.bindingEvent.childrenComplete, function () { + if (!updateFromModelComputed) { + ko.utils.registerEventHandler(element, "change", valueUpdateHandler); + updateFromModelComputed = ko.computed(updateFromModel, null, { disposeWhenNodeIsRemoved: element }); + } else if (allBindings.get('valueAllowUnset')) { + updateFromModel(); + } else { + valueUpdateHandler(); + } + }, null, { 'notifyImmediately': true }); } else { - // Workaround for IE6 bug: It won't reliably apply values to SELECT nodes during the same execution thread - // right after you've changed the set of OPTION nodes on it. So for that node type, we'll schedule a second thread - // to apply the value as well. - ko.utils.setTimeout(applyValueAction, 0); + ko.utils.registerEventHandler(element, "change", valueUpdateHandler); + ko.computed(updateFromModel, null, { disposeWhenNodeIsRemoved: element }); } - } else { - ko.selectExtensions.writeValue(element, newValue); + }, + 'update': function() {} // Keep for backwards compatibility with code that may have wrapped value binding + }; + ko.expressionRewriting.twoWayBindings['value'] = true; + ko.bindingHandlers['visible'] = { + 'update': function (element, valueAccessor) { + var value = ko.utils.unwrapObservable(valueAccessor()); + var isCurrentlyVisible = !(element.style.display == "none"); + if (value && !isCurrentlyVisible) + element.style.display = ""; + else if ((!value) && isCurrentlyVisible) + element.style.display = "none"; } - } - }; - - ko.computed(updateFromModel, null, { disposeWhenNodeIsRemoved: element }); - }, - 'update': function() {} // Keep for backwards compatibility with code that may have wrapped value binding -}; -ko.expressionRewriting.twoWayBindings['value'] = true; -ko.bindingHandlers['visible'] = { - 'update': function (element, valueAccessor) { - var value = ko.utils.unwrapObservable(valueAccessor()); - var isCurrentlyVisible = !(element.style.display == "none"); - if (value && !isCurrentlyVisible) - element.style.display = ""; - else if ((!value) && isCurrentlyVisible) - element.style.display = "none"; - } -}; + }; + + ko.bindingHandlers['hidden'] = { + 'update': function (element, valueAccessor) { + ko.bindingHandlers['visible']['update'](element, function() { return !ko.utils.unwrapObservable(valueAccessor()) }); + } + }; // 'click' is just a shorthand for the usual full-length event:{click:handler} -makeEventHandlerShortcut('click'); + makeEventHandlerShortcut('click'); // If you want to make a custom template engine, // // [1] Inherit from this class (like ko.nativeTemplateEngine does) @@ -4995,930 +5559,1053 @@ makeEventHandlerShortcut('click'); // If you don't want to allow that, you can set the property 'allowTemplateRewriting' to false (like ko.nativeTemplateEngine does) // and then you don't need to override 'createJavaScriptEvaluatorBlock'. -ko.templateEngine = function () { }; - -ko.templateEngine.prototype['renderTemplateSource'] = function (templateSource, bindingContext, options, templateDocument) { - throw new Error("Override renderTemplateSource"); -}; - -ko.templateEngine.prototype['createJavaScriptEvaluatorBlock'] = function (script) { - throw new Error("Override createJavaScriptEvaluatorBlock"); -}; - -ko.templateEngine.prototype['makeTemplateSource'] = function(template, templateDocument) { - // Named template - if (typeof template == "string") { - templateDocument = templateDocument || document; - var elem = templateDocument.getElementById(template); - if (!elem) - throw new Error("Cannot find template with ID " + template); - return new ko.templateSources.domElement(elem); - } else if ((template.nodeType == 1) || (template.nodeType == 8)) { - // Anonymous template - return new ko.templateSources.anonymousTemplate(template); - } else - throw new Error("Unknown template type: " + template); -}; - -ko.templateEngine.prototype['renderTemplate'] = function (template, bindingContext, options, templateDocument) { - var templateSource = this['makeTemplateSource'](template, templateDocument); - return this['renderTemplateSource'](templateSource, bindingContext, options, templateDocument); -}; - -ko.templateEngine.prototype['isTemplateRewritten'] = function (template, templateDocument) { - // Skip rewriting if requested - if (this['allowTemplateRewriting'] === false) - return true; - return this['makeTemplateSource'](template, templateDocument)['data']("isRewritten"); -}; - -ko.templateEngine.prototype['rewriteTemplate'] = function (template, rewriterCallback, templateDocument) { - var templateSource = this['makeTemplateSource'](template, templateDocument); - var rewritten = rewriterCallback(templateSource['text']()); - templateSource['text'](rewritten); - templateSource['data']("isRewritten", true); -}; - -ko.exportSymbol('templateEngine', ko.templateEngine); - -ko.templateRewriting = (function () { - var memoizeDataBindingAttributeSyntaxRegex = /(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi; - var memoizeVirtualContainerBindingSyntaxRegex = /<!--\s*ko\b\s*([\s\S]*?)\s*-->/g; - - function validateDataBindValuesForRewriting(keyValueArray) { - var allValidators = ko.expressionRewriting.bindingRewriteValidators; - for (var i = 0; i < keyValueArray.length; i++) { - var key = keyValueArray[i]['key']; - if (allValidators.hasOwnProperty(key)) { - var validator = allValidators[key]; - - if (typeof validator === "function") { - var possibleErrorMessage = validator(keyValueArray[i]['value']); - if (possibleErrorMessage) - throw new Error(possibleErrorMessage); - } else if (!validator) { - throw new Error("This template engine does not support the '" + key + "' binding within its templates"); + ko.templateEngine = function () { }; + + ko.templateEngine.prototype['renderTemplateSource'] = function (templateSource, bindingContext, options, templateDocument) { + throw new Error("Override renderTemplateSource"); + }; + + ko.templateEngine.prototype['createJavaScriptEvaluatorBlock'] = function (script) { + throw new Error("Override createJavaScriptEvaluatorBlock"); + }; + + ko.templateEngine.prototype['makeTemplateSource'] = function(template, templateDocument) { + // Named template + if (typeof template == "string") { + templateDocument = templateDocument || document; + var elem = templateDocument.getElementById(template); + if (!elem) + throw new Error("Cannot find template with ID " + template); + return new ko.templateSources.domElement(elem); + } else if ((template.nodeType == 1) || (template.nodeType == 8)) { + // Anonymous template + return new ko.templateSources.anonymousTemplate(template); + } else + throw new Error("Unknown template type: " + template); + }; + + ko.templateEngine.prototype['renderTemplate'] = function (template, bindingContext, options, templateDocument) { + var templateSource = this['makeTemplateSource'](template, templateDocument); + return this['renderTemplateSource'](templateSource, bindingContext, options, templateDocument); + }; + + ko.templateEngine.prototype['isTemplateRewritten'] = function (template, templateDocument) { + // Skip rewriting if requested + if (this['allowTemplateRewriting'] === false) + return true; + return this['makeTemplateSource'](template, templateDocument)['data']("isRewritten"); + }; + + ko.templateEngine.prototype['rewriteTemplate'] = function (template, rewriterCallback, templateDocument) { + var templateSource = this['makeTemplateSource'](template, templateDocument); + var rewritten = rewriterCallback(templateSource['text']()); + templateSource['text'](rewritten); + templateSource['data']("isRewritten", true); + }; + + ko.exportSymbol('templateEngine', ko.templateEngine); + + ko.templateRewriting = (function () { + var memoizeDataBindingAttributeSyntaxRegex = /(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi; + var memoizeVirtualContainerBindingSyntaxRegex = /<!--\s*ko\b\s*([\s\S]*?)\s*-->/g; + + function validateDataBindValuesForRewriting(keyValueArray) { + var allValidators = ko.expressionRewriting.bindingRewriteValidators; + for (var i = 0; i < keyValueArray.length; i++) { + var key = keyValueArray[i]['key']; + if (Object.prototype.hasOwnProperty.call(allValidators, key)) { + var validator = allValidators[key]; + + if (typeof validator === "function") { + var possibleErrorMessage = validator(keyValueArray[i]['value']); + if (possibleErrorMessage) + throw new Error(possibleErrorMessage); + } else if (!validator) { + throw new Error("This template engine does not support the '" + key + "' binding within its templates"); + } + } + } + } + + function constructMemoizedTagReplacement(dataBindAttributeValue, tagToRetain, nodeName, templateEngine) { + var dataBindKeyValueArray = ko.expressionRewriting.parseObjectLiteral(dataBindAttributeValue); + validateDataBindValuesForRewriting(dataBindKeyValueArray); + var rewrittenDataBindAttributeValue = ko.expressionRewriting.preProcessBindings(dataBindKeyValueArray, {'valueAccessors':true}); + + // For no obvious reason, Opera fails to evaluate rewrittenDataBindAttributeValue unless it's wrapped in an additional + // anonymous function, even though Opera's built-in debugger can evaluate it anyway. No other browser requires this + // extra indirection. + var applyBindingsToNextSiblingScript = + "ko.__tr_ambtns(function($context,$element){return(function(){return{ " + rewrittenDataBindAttributeValue + " } })()},'" + nodeName.toLowerCase() + "')"; + return templateEngine['createJavaScriptEvaluatorBlock'](applyBindingsToNextSiblingScript) + tagToRetain; } - } - } - } - - function constructMemoizedTagReplacement(dataBindAttributeValue, tagToRetain, nodeName, templateEngine) { - var dataBindKeyValueArray = ko.expressionRewriting.parseObjectLiteral(dataBindAttributeValue); - validateDataBindValuesForRewriting(dataBindKeyValueArray); - var rewrittenDataBindAttributeValue = ko.expressionRewriting.preProcessBindings(dataBindKeyValueArray, {'valueAccessors':true}); - - // For no obvious reason, Opera fails to evaluate rewrittenDataBindAttributeValue unless it's wrapped in an additional - // anonymous function, even though Opera's built-in debugger can evaluate it anyway. No other browser requires this - // extra indirection. - var applyBindingsToNextSiblingScript = - "ko.__tr_ambtns(function($context,$element){return(function(){return{ " + rewrittenDataBindAttributeValue + " } })()},'" + nodeName.toLowerCase() + "')"; - return templateEngine['createJavaScriptEvaluatorBlock'](applyBindingsToNextSiblingScript) + tagToRetain; - } - - return { - ensureTemplateIsRewritten: function (template, templateEngine, templateDocument) { - if (!templateEngine['isTemplateRewritten'](template, templateDocument)) - templateEngine['rewriteTemplate'](template, function (htmlString) { - return ko.templateRewriting.memoizeBindingAttributeSyntax(htmlString, templateEngine); - }, templateDocument); - }, - - memoizeBindingAttributeSyntax: function (htmlString, templateEngine) { - return htmlString.replace(memoizeDataBindingAttributeSyntaxRegex, function () { - return constructMemoizedTagReplacement(/* dataBindAttributeValue: */ arguments[4], /* tagToRetain: */ arguments[1], /* nodeName: */ arguments[2], templateEngine); - }).replace(memoizeVirtualContainerBindingSyntaxRegex, function() { - return constructMemoizedTagReplacement(/* dataBindAttributeValue: */ arguments[1], /* tagToRetain: */ "<!-- ko -->", /* nodeName: */ "#comment", templateEngine); - }); - }, - applyMemoizedBindingsToNextSibling: function (bindings, nodeName) { - return ko.memoization.memoize(function (domNode, bindingContext) { - var nodeToBind = domNode.nextSibling; - if (nodeToBind && nodeToBind.nodeName.toLowerCase() === nodeName) { - ko.applyBindingAccessorsToNode(nodeToBind, bindings, bindingContext); + return { + ensureTemplateIsRewritten: function (template, templateEngine, templateDocument) { + if (!templateEngine['isTemplateRewritten'](template, templateDocument)) + templateEngine['rewriteTemplate'](template, function (htmlString) { + return ko.templateRewriting.memoizeBindingAttributeSyntax(htmlString, templateEngine); + }, templateDocument); + }, + + memoizeBindingAttributeSyntax: function (htmlString, templateEngine) { + return htmlString.replace(memoizeDataBindingAttributeSyntaxRegex, function () { + return constructMemoizedTagReplacement(/* dataBindAttributeValue: */ arguments[4], /* tagToRetain: */ arguments[1], /* nodeName: */ arguments[2], templateEngine); + }).replace(memoizeVirtualContainerBindingSyntaxRegex, function() { + return constructMemoizedTagReplacement(/* dataBindAttributeValue: */ arguments[1], /* tagToRetain: */ "<!-- ko -->", /* nodeName: */ "#comment", templateEngine); + }); + }, + + applyMemoizedBindingsToNextSibling: function (bindings, nodeName) { + return ko.memoization.memoize(function (domNode, bindingContext) { + var nodeToBind = domNode.nextSibling; + if (nodeToBind && nodeToBind.nodeName.toLowerCase() === nodeName) { + ko.applyBindingAccessorsToNode(nodeToBind, bindings, bindingContext); + } + }); + } } - }); - } - } -})(); + })(); // Exported only because it has to be referenced by string lookup from within rewritten template -ko.exportSymbol('__tr_ambtns', ko.templateRewriting.applyMemoizedBindingsToNextSibling); -(function() { - // A template source represents a read/write way of accessing a template. This is to eliminate the need for template loading/saving - // logic to be duplicated in every template engine (and means they can all work with anonymous templates, etc.) - // - // Two are provided by default: - // 1. ko.templateSources.domElement - reads/writes the text content of an arbitrary DOM element - // 2. ko.templateSources.anonymousElement - uses ko.utils.domData to read/write text *associated* with the DOM element, but - // without reading/writing the actual element text content, since it will be overwritten - // with the rendered template output. - // You can implement your own template source if you want to fetch/store templates somewhere other than in DOM elements. - // Template sources need to have the following functions: - // text() - returns the template text from your storage location - // text(value) - writes the supplied template text to your storage location - // data(key) - reads values stored using data(key, value) - see below - // data(key, value) - associates "value" with this template and the key "key". Is used to store information like "isRewritten". - // - // Optionally, template sources can also have the following functions: - // nodes() - returns a DOM element containing the nodes of this template, where available - // nodes(value) - writes the given DOM element to your storage location - // If a DOM element is available for a given template source, template engines are encouraged to use it in preference over text() - // for improved speed. However, all templateSources must supply text() even if they don't supply nodes(). - // - // Once you've implemented a templateSource, make your template engine use it by subclassing whatever template engine you were - // using and overriding "makeTemplateSource" to return an instance of your custom template source. - - ko.templateSources = {}; - - // ---- ko.templateSources.domElement ----- - - // template types - var templateScript = 1, - templateTextArea = 2, - templateTemplate = 3, - templateElement = 4; - - ko.templateSources.domElement = function(element) { - this.domElement = element; - - if (element) { - var tagNameLower = ko.utils.tagNameLower(element); - this.templateType = - tagNameLower === "script" ? templateScript : - tagNameLower === "textarea" ? templateTextArea : - // For browsers with proper <template> element support, where the .content property gives a document fragment - tagNameLower == "template" && element.content && element.content.nodeType === 11 ? templateTemplate : - templateElement; - } - } - - ko.templateSources.domElement.prototype['text'] = function(/* valueToWrite */) { - var elemContentsProperty = this.templateType === templateScript ? "text" - : this.templateType === templateTextArea ? "value" - : "innerHTML"; - - if (arguments.length == 0) { - return this.domElement[elemContentsProperty]; - } else { - var valueToWrite = arguments[0]; - if (elemContentsProperty === "innerHTML") - ko.utils.setHtml(this.domElement, valueToWrite); - else - this.domElement[elemContentsProperty] = valueToWrite; - } - }; - - var dataDomDataPrefix = ko.utils.domData.nextKey() + "_"; - ko.templateSources.domElement.prototype['data'] = function(key /*, valueToWrite */) { - if (arguments.length === 1) { - return ko.utils.domData.get(this.domElement, dataDomDataPrefix + key); - } else { - ko.utils.domData.set(this.domElement, dataDomDataPrefix + key, arguments[1]); - } - }; - - var templatesDomDataKey = ko.utils.domData.nextKey(); - function getTemplateDomData(element) { - return ko.utils.domData.get(element, templatesDomDataKey) || {}; - } - function setTemplateDomData(element, data) { - ko.utils.domData.set(element, templatesDomDataKey, data); - } - - ko.templateSources.domElement.prototype['nodes'] = function(/* valueToWrite */) { - var element = this.domElement; - if (arguments.length == 0) { - var templateData = getTemplateDomData(element), - containerData = templateData.containerData; - return containerData || ( - this.templateType === templateTemplate ? element.content : - this.templateType === templateElement ? element : - undefined); - } else { - var valueToWrite = arguments[0]; - setTemplateDomData(element, {containerData: valueToWrite}); - } - }; - - // ---- ko.templateSources.anonymousTemplate ----- - // Anonymous templates are normally saved/retrieved as DOM nodes through "nodes". - // For compatibility, you can also read "text"; it will be serialized from the nodes on demand. - // Writing to "text" is still supported, but then the template data will not be available as DOM nodes. - - ko.templateSources.anonymousTemplate = function(element) { - this.domElement = element; - } - ko.templateSources.anonymousTemplate.prototype = new ko.templateSources.domElement(); - ko.templateSources.anonymousTemplate.prototype.constructor = ko.templateSources.anonymousTemplate; - ko.templateSources.anonymousTemplate.prototype['text'] = function(/* valueToWrite */) { - if (arguments.length == 0) { - var templateData = getTemplateDomData(this.domElement); - if (templateData.textData === undefined && templateData.containerData) - templateData.textData = templateData.containerData.innerHTML; - return templateData.textData; - } else { - var valueToWrite = arguments[0]; - setTemplateDomData(this.domElement, {textData: valueToWrite}); - } - }; + ko.exportSymbol('__tr_ambtns', ko.templateRewriting.applyMemoizedBindingsToNextSibling); + (function() { + // A template source represents a read/write way of accessing a template. This is to eliminate the need for template loading/saving + // logic to be duplicated in every template engine (and means they can all work with anonymous templates, etc.) + // + // Two are provided by default: + // 1. ko.templateSources.domElement - reads/writes the text content of an arbitrary DOM element + // 2. ko.templateSources.anonymousElement - uses ko.utils.domData to read/write text *associated* with the DOM element, but + // without reading/writing the actual element text content, since it will be overwritten + // with the rendered template output. + // You can implement your own template source if you want to fetch/store templates somewhere other than in DOM elements. + // Template sources need to have the following functions: + // text() - returns the template text from your storage location + // text(value) - writes the supplied template text to your storage location + // data(key) - reads values stored using data(key, value) - see below + // data(key, value) - associates "value" with this template and the key "key". Is used to store information like "isRewritten". + // + // Optionally, template sources can also have the following functions: + // nodes() - returns a DOM element containing the nodes of this template, where available + // nodes(value) - writes the given DOM element to your storage location + // If a DOM element is available for a given template source, template engines are encouraged to use it in preference over text() + // for improved speed. However, all templateSources must supply text() even if they don't supply nodes(). + // + // Once you've implemented a templateSource, make your template engine use it by subclassing whatever template engine you were + // using and overriding "makeTemplateSource" to return an instance of your custom template source. + + ko.templateSources = {}; + + // ---- ko.templateSources.domElement ----- + + // template types + var templateScript = 1, + templateTextArea = 2, + templateTemplate = 3, + templateElement = 4; + + ko.templateSources.domElement = function(element) { + this.domElement = element; + + if (element) { + var tagNameLower = ko.utils.tagNameLower(element); + this.templateType = + tagNameLower === "script" ? templateScript : + tagNameLower === "textarea" ? templateTextArea : + // For browsers with proper <template> element support, where the .content property gives a document fragment + tagNameLower == "template" && element.content && element.content.nodeType === 11 ? templateTemplate : + templateElement; + } + } - ko.exportSymbol('templateSources', ko.templateSources); - ko.exportSymbol('templateSources.domElement', ko.templateSources.domElement); - ko.exportSymbol('templateSources.anonymousTemplate', ko.templateSources.anonymousTemplate); -})(); -(function () { - var _templateEngine; - ko.setTemplateEngine = function (templateEngine) { - if ((templateEngine != undefined) && !(templateEngine instanceof ko.templateEngine)) - throw new Error("templateEngine must inherit from ko.templateEngine"); - _templateEngine = templateEngine; - } - - function invokeForEachNodeInContinuousRange(firstNode, lastNode, action) { - var node, nextInQueue = firstNode, firstOutOfRangeNode = ko.virtualElements.nextSibling(lastNode); - while (nextInQueue && ((node = nextInQueue) !== firstOutOfRangeNode)) { - nextInQueue = ko.virtualElements.nextSibling(node); - action(node, nextInQueue); - } - } - - function activateBindingsOnContinuousNodeArray(continuousNodeArray, bindingContext) { - // To be used on any nodes that have been rendered by a template and have been inserted into some parent element - // Walks through continuousNodeArray (which *must* be continuous, i.e., an uninterrupted sequence of sibling nodes, because - // the algorithm for walking them relies on this), and for each top-level item in the virtual-element sense, - // (1) Does a regular "applyBindings" to associate bindingContext with this node and to activate any non-memoized bindings - // (2) Unmemoizes any memos in the DOM subtree (e.g., to activate bindings that had been memoized during template rewriting) - - if (continuousNodeArray.length) { - var firstNode = continuousNodeArray[0], - lastNode = continuousNodeArray[continuousNodeArray.length - 1], - parentNode = firstNode.parentNode, - provider = ko.bindingProvider['instance'], - preprocessNode = provider['preprocessNode']; - - if (preprocessNode) { - invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node, nextNodeInRange) { - var nodePreviousSibling = node.previousSibling; - var newNodes = preprocessNode.call(provider, node); - if (newNodes) { - if (node === firstNode) - firstNode = newNodes[0] || nextNodeInRange; - if (node === lastNode) - lastNode = newNodes[newNodes.length - 1] || nodePreviousSibling; + ko.templateSources.domElement.prototype['text'] = function(/* valueToWrite */) { + var elemContentsProperty = this.templateType === templateScript ? "text" + : this.templateType === templateTextArea ? "value" + : "innerHTML"; + + if (arguments.length == 0) { + return this.domElement[elemContentsProperty]; + } else { + var valueToWrite = arguments[0]; + if (elemContentsProperty === "innerHTML") + ko.utils.setHtml(this.domElement, valueToWrite); + else + this.domElement[elemContentsProperty] = valueToWrite; } - }); + }; - // Because preprocessNode can change the nodes, including the first and last nodes, update continuousNodeArray to match. - // We need the full set, including inner nodes, because the unmemoize step might remove the first node (and so the real - // first node needs to be in the array). - continuousNodeArray.length = 0; - if (!firstNode) { // preprocessNode might have removed all the nodes, in which case there's nothing left to do - return; + var dataDomDataPrefix = ko.utils.domData.nextKey() + "_"; + ko.templateSources.domElement.prototype['data'] = function(key /*, valueToWrite */) { + if (arguments.length === 1) { + return ko.utils.domData.get(this.domElement, dataDomDataPrefix + key); + } else { + ko.utils.domData.set(this.domElement, dataDomDataPrefix + key, arguments[1]); + } + }; + + var templatesDomDataKey = ko.utils.domData.nextKey(); + function getTemplateDomData(element) { + return ko.utils.domData.get(element, templatesDomDataKey) || {}; } - if (firstNode === lastNode) { - continuousNodeArray.push(firstNode); - } else { - continuousNodeArray.push(firstNode, lastNode); - ko.utils.fixUpContinuousNodeArray(continuousNodeArray, parentNode); + function setTemplateDomData(element, data) { + ko.utils.domData.set(element, templatesDomDataKey, data); } - } - // Need to applyBindings *before* unmemoziation, because unmemoization might introduce extra nodes (that we don't want to re-bind) - // whereas a regular applyBindings won't introduce new memoized nodes - invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node) { - if (node.nodeType === 1 || node.nodeType === 8) - ko.applyBindings(bindingContext, node); - }); - invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node) { - if (node.nodeType === 1 || node.nodeType === 8) - ko.memoization.unmemoizeDomNodeAndDescendants(node, [bindingContext]); - }); + ko.templateSources.domElement.prototype['nodes'] = function(/* valueToWrite */) { + var element = this.domElement; + if (arguments.length == 0) { + var templateData = getTemplateDomData(element), + nodes = templateData.containerData || ( + this.templateType === templateTemplate ? element.content : + this.templateType === templateElement ? element : + undefined); + if (!nodes || templateData.alwaysCheckText) { + // If the template is associated with an element that stores the template as text, + // parse and cache the nodes whenever there's new text content available. This allows + // the user to update the template content by updating the text of template node. + var text = this['text'](); + if (text && text !== templateData.textData) { + nodes = ko.utils.parseHtmlForTemplateNodes(text, element.ownerDocument); + setTemplateDomData(element, {containerData: nodes, textData: text, alwaysCheckText: true}); + } + } + return nodes; + } else { + var valueToWrite = arguments[0]; + if (this.templateType !== undefined) { + this['text'](""); // clear the text from the node + } + setTemplateDomData(element, {containerData: valueToWrite}); + } + }; - // Make sure any changes done by applyBindings or unmemoize are reflected in the array - ko.utils.fixUpContinuousNodeArray(continuousNodeArray, parentNode); - } - } - - function getFirstNodeFromPossibleArray(nodeOrNodeArray) { - return nodeOrNodeArray.nodeType ? nodeOrNodeArray - : nodeOrNodeArray.length > 0 ? nodeOrNodeArray[0] - : null; - } - - function executeTemplate(targetNodeOrNodeArray, renderMode, template, bindingContext, options) { - options = options || {}; - var firstTargetNode = targetNodeOrNodeArray && getFirstNodeFromPossibleArray(targetNodeOrNodeArray); - var templateDocument = (firstTargetNode || template || {}).ownerDocument; - var templateEngineToUse = (options['templateEngine'] || _templateEngine); - ko.templateRewriting.ensureTemplateIsRewritten(template, templateEngineToUse, templateDocument); - var renderedNodesArray = templateEngineToUse['renderTemplate'](template, bindingContext, options, templateDocument); - - // Loosely check result is an array of DOM nodes - if ((typeof renderedNodesArray.length != "number") || (renderedNodesArray.length > 0 && typeof renderedNodesArray[0].nodeType != "number")) - throw new Error("Template engine must return an array of DOM nodes"); - - var haveAddedNodesToParent = false; - switch (renderMode) { - case "replaceChildren": - ko.virtualElements.setDomNodeChildren(targetNodeOrNodeArray, renderedNodesArray); - haveAddedNodesToParent = true; - break; - case "replaceNode": - ko.utils.replaceDomNodes(targetNodeOrNodeArray, renderedNodesArray); - haveAddedNodesToParent = true; - break; - case "ignoreTargetNode": break; - default: - throw new Error("Unknown renderMode: " + renderMode); - } + // ---- ko.templateSources.anonymousTemplate ----- + // Anonymous templates are normally saved/retrieved as DOM nodes through "nodes". + // For compatibility, you can also read "text"; it will be serialized from the nodes on demand. + // Writing to "text" is still supported, but then the template data will not be available as DOM nodes. - if (haveAddedNodesToParent) { - activateBindingsOnContinuousNodeArray(renderedNodesArray, bindingContext); - if (options['afterRender']) - ko.dependencyDetection.ignore(options['afterRender'], null, [renderedNodesArray, bindingContext['$data']]); - } + ko.templateSources.anonymousTemplate = function(element) { + this.domElement = element; + } + ko.templateSources.anonymousTemplate.prototype = new ko.templateSources.domElement(); + ko.templateSources.anonymousTemplate.prototype.constructor = ko.templateSources.anonymousTemplate; + ko.templateSources.anonymousTemplate.prototype['text'] = function(/* valueToWrite */) { + if (arguments.length == 0) { + var templateData = getTemplateDomData(this.domElement); + if (templateData.textData === undefined && templateData.containerData) + templateData.textData = templateData.containerData.innerHTML; + return templateData.textData; + } else { + var valueToWrite = arguments[0]; + setTemplateDomData(this.domElement, {textData: valueToWrite}); + } + }; - return renderedNodesArray; - } - - function resolveTemplateName(template, data, context) { - // The template can be specified as: - if (ko.isObservable(template)) { - // 1. An observable, with string value - return template(); - } else if (typeof template === 'function') { - // 2. A function of (data, context) returning a string - return template(data, context); - } else { - // 3. A string - return template; - } - } + ko.exportSymbol('templateSources', ko.templateSources); + ko.exportSymbol('templateSources.domElement', ko.templateSources.domElement); + ko.exportSymbol('templateSources.anonymousTemplate', ko.templateSources.anonymousTemplate); + })(); + (function () { + var _templateEngine; + ko.setTemplateEngine = function (templateEngine) { + if ((templateEngine != undefined) && !(templateEngine instanceof ko.templateEngine)) + throw new Error("templateEngine must inherit from ko.templateEngine"); + _templateEngine = templateEngine; + } - ko.renderTemplate = function (template, dataOrBindingContext, options, targetNodeOrNodeArray, renderMode) { - options = options || {}; - if ((options['templateEngine'] || _templateEngine) == undefined) - throw new Error("Set a template engine before calling renderTemplate"); - renderMode = renderMode || "replaceChildren"; + function invokeForEachNodeInContinuousRange(firstNode, lastNode, action) { + var node, nextInQueue = firstNode, firstOutOfRangeNode = ko.virtualElements.nextSibling(lastNode); + while (nextInQueue && ((node = nextInQueue) !== firstOutOfRangeNode)) { + nextInQueue = ko.virtualElements.nextSibling(node); + action(node, nextInQueue); + } + } - if (targetNodeOrNodeArray) { - var firstTargetNode = getFirstNodeFromPossibleArray(targetNodeOrNodeArray); + function activateBindingsOnContinuousNodeArray(continuousNodeArray, bindingContext) { + // To be used on any nodes that have been rendered by a template and have been inserted into some parent element + // Walks through continuousNodeArray (which *must* be continuous, i.e., an uninterrupted sequence of sibling nodes, because + // the algorithm for walking them relies on this), and for each top-level item in the virtual-element sense, + // (1) Does a regular "applyBindings" to associate bindingContext with this node and to activate any non-memoized bindings + // (2) Unmemoizes any memos in the DOM subtree (e.g., to activate bindings that had been memoized during template rewriting) + + if (continuousNodeArray.length) { + var firstNode = continuousNodeArray[0], + lastNode = continuousNodeArray[continuousNodeArray.length - 1], + parentNode = firstNode.parentNode, + provider = ko.bindingProvider['instance'], + preprocessNode = provider['preprocessNode']; + + if (preprocessNode) { + invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node, nextNodeInRange) { + var nodePreviousSibling = node.previousSibling; + var newNodes = preprocessNode.call(provider, node); + if (newNodes) { + if (node === firstNode) + firstNode = newNodes[0] || nextNodeInRange; + if (node === lastNode) + lastNode = newNodes[newNodes.length - 1] || nodePreviousSibling; + } + }); + + // Because preprocessNode can change the nodes, including the first and last nodes, update continuousNodeArray to match. + // We need the full set, including inner nodes, because the unmemoize step might remove the first node (and so the real + // first node needs to be in the array). + continuousNodeArray.length = 0; + if (!firstNode) { // preprocessNode might have removed all the nodes, in which case there's nothing left to do + return; + } + if (firstNode === lastNode) { + continuousNodeArray.push(firstNode); + } else { + continuousNodeArray.push(firstNode, lastNode); + ko.utils.fixUpContinuousNodeArray(continuousNodeArray, parentNode); + } + } - var whenToDispose = function () { return (!firstTargetNode) || !ko.utils.domNodeIsAttachedToDocument(firstTargetNode); }; // Passive disposal (on next evaluation) - var activelyDisposeWhenNodeIsRemoved = (firstTargetNode && renderMode == "replaceNode") ? firstTargetNode.parentNode : firstTargetNode; + // Need to applyBindings *before* unmemoziation, because unmemoization might introduce extra nodes (that we don't want to re-bind) + // whereas a regular applyBindings won't introduce new memoized nodes + invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node) { + if (node.nodeType === 1 || node.nodeType === 8) + ko.applyBindings(bindingContext, node); + }); + invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node) { + if (node.nodeType === 1 || node.nodeType === 8) + ko.memoization.unmemoizeDomNodeAndDescendants(node, [bindingContext]); + }); - return ko.dependentObservable( // So the DOM is automatically updated when any dependency changes - function () { - // Ensure we've got a proper binding context to work with - var bindingContext = (dataOrBindingContext && (dataOrBindingContext instanceof ko.bindingContext)) - ? dataOrBindingContext - : new ko.bindingContext(dataOrBindingContext, null, null, null, { "exportDependencies": true }); + // Make sure any changes done by applyBindings or unmemoize are reflected in the array + ko.utils.fixUpContinuousNodeArray(continuousNodeArray, parentNode); + } + } - var templateName = resolveTemplateName(template, bindingContext['$data'], bindingContext), - renderedNodesArray = executeTemplate(targetNodeOrNodeArray, renderMode, templateName, bindingContext, options); + function getFirstNodeFromPossibleArray(nodeOrNodeArray) { + return nodeOrNodeArray.nodeType ? nodeOrNodeArray + : nodeOrNodeArray.length > 0 ? nodeOrNodeArray[0] + : null; + } - if (renderMode == "replaceNode") { - targetNodeOrNodeArray = renderedNodesArray; - firstTargetNode = getFirstNodeFromPossibleArray(targetNodeOrNodeArray); + function executeTemplate(targetNodeOrNodeArray, renderMode, template, bindingContext, options) { + options = options || {}; + var firstTargetNode = targetNodeOrNodeArray && getFirstNodeFromPossibleArray(targetNodeOrNodeArray); + var templateDocument = (firstTargetNode || template || {}).ownerDocument; + var templateEngineToUse = (options['templateEngine'] || _templateEngine); + ko.templateRewriting.ensureTemplateIsRewritten(template, templateEngineToUse, templateDocument); + var renderedNodesArray = templateEngineToUse['renderTemplate'](template, bindingContext, options, templateDocument); + + // Loosely check result is an array of DOM nodes + if ((typeof renderedNodesArray.length != "number") || (renderedNodesArray.length > 0 && typeof renderedNodesArray[0].nodeType != "number")) + throw new Error("Template engine must return an array of DOM nodes"); + + var haveAddedNodesToParent = false; + switch (renderMode) { + case "replaceChildren": + ko.virtualElements.setDomNodeChildren(targetNodeOrNodeArray, renderedNodesArray); + haveAddedNodesToParent = true; + break; + case "replaceNode": + ko.utils.replaceDomNodes(targetNodeOrNodeArray, renderedNodesArray); + haveAddedNodesToParent = true; + break; + case "ignoreTargetNode": break; + default: + throw new Error("Unknown renderMode: " + renderMode); } - }, - null, - { disposeWhen: whenToDispose, disposeWhenNodeIsRemoved: activelyDisposeWhenNodeIsRemoved } - ); - } else { - // We don't yet have a DOM node to evaluate, so use a memo and render the template later when there is a DOM node - return ko.memoization.memoize(function (domNode) { - ko.renderTemplate(template, dataOrBindingContext, options, domNode, "replaceNode"); - }); - } - }; - - ko.renderTemplateForEach = function (template, arrayOrObservableArray, options, targetNode, parentBindingContext) { - // Since setDomNodeChildrenFromArrayMapping always calls executeTemplateForArrayItem and then - // activateBindingsCallback for added items, we can store the binding context in the former to use in the latter. - var arrayItemContext; - - // This will be called by setDomNodeChildrenFromArrayMapping to get the nodes to add to targetNode - var executeTemplateForArrayItem = function (arrayValue, index) { - // Support selecting template as a function of the data being rendered - arrayItemContext = parentBindingContext['createChildContext'](arrayValue, options['as'], function(context) { - context['$index'] = index; - }); - var templateName = resolveTemplateName(template, arrayValue, arrayItemContext); - return executeTemplate(null, "ignoreTargetNode", templateName, arrayItemContext, options); - } + if (haveAddedNodesToParent) { + activateBindingsOnContinuousNodeArray(renderedNodesArray, bindingContext); + if (options['afterRender']) { + ko.dependencyDetection.ignore(options['afterRender'], null, [renderedNodesArray, bindingContext[options['as'] || '$data']]); + } + if (renderMode == "replaceChildren") { + ko.bindingEvent.notify(targetNodeOrNodeArray, ko.bindingEvent.childrenComplete); + } + } - // This will be called whenever setDomNodeChildrenFromArrayMapping has added nodes to targetNode - var activateBindingsCallback = function(arrayValue, addedNodesArray, index) { - activateBindingsOnContinuousNodeArray(addedNodesArray, arrayItemContext); - if (options['afterRender']) - options['afterRender'](addedNodesArray, arrayValue); - - // release the "cache" variable, so that it can be collected by - // the GC when its value isn't used from within the bindings anymore. - arrayItemContext = null; - }; - - return ko.dependentObservable(function () { - var unwrappedArray = ko.utils.unwrapObservable(arrayOrObservableArray) || []; - if (typeof unwrappedArray.length == "undefined") // Coerce single value into array - unwrappedArray = [unwrappedArray]; - - // Filter out any entries marked as destroyed - var filteredArray = ko.utils.arrayFilter(unwrappedArray, function(item) { - return options['includeDestroyed'] || item === undefined || item === null || !ko.utils.unwrapObservable(item['_destroy']); - }); + return renderedNodesArray; + } - // Call setDomNodeChildrenFromArrayMapping, ignoring any observables unwrapped within (most likely from a callback function). - // If the array items are observables, though, they will be unwrapped in executeTemplateForArrayItem and managed within setDomNodeChildrenFromArrayMapping. - ko.dependencyDetection.ignore(ko.utils.setDomNodeChildrenFromArrayMapping, null, [targetNode, filteredArray, executeTemplateForArrayItem, options, activateBindingsCallback]); - - }, null, { disposeWhenNodeIsRemoved: targetNode }); - }; - - var templateComputedDomDataKey = ko.utils.domData.nextKey(); - function disposeOldComputedAndStoreNewOne(element, newComputed) { - var oldComputed = ko.utils.domData.get(element, templateComputedDomDataKey); - if (oldComputed && (typeof(oldComputed.dispose) == 'function')) - oldComputed.dispose(); - ko.utils.domData.set(element, templateComputedDomDataKey, (newComputed && newComputed.isActive()) ? newComputed : undefined); - } - - ko.bindingHandlers['template'] = { - 'init': function(element, valueAccessor) { - // Support anonymous templates - var bindingValue = ko.utils.unwrapObservable(valueAccessor()); - if (typeof bindingValue == "string" || bindingValue['name']) { - // It's a named template - clear the element - ko.virtualElements.emptyNode(element); - } else if ('nodes' in bindingValue) { - // We've been given an array of DOM nodes. Save them as the template source. - // There is no known use case for the node array being an observable array (if the output - // varies, put that behavior *into* your template - that's what templates are for), and - // the implementation would be a mess, so assert that it's not observable. - var nodes = bindingValue['nodes'] || []; - if (ko.isObservable(nodes)) { - throw new Error('The "nodes" option must be a plain, non-observable array.'); - } - var container = ko.utils.moveCleanedNodesToContainerElement(nodes); // This also removes the nodes from their current parent - new ko.templateSources.anonymousTemplate(element)['nodes'](container); - } else { - // It's an anonymous template - store the element contents, then clear the element - var templateNodes = ko.virtualElements.childNodes(element), - container = ko.utils.moveCleanedNodesToContainerElement(templateNodes); // This also removes the nodes from their current parent - new ko.templateSources.anonymousTemplate(element)['nodes'](container); - } - return { 'controlsDescendantBindings': true }; - }, - 'update': function (element, valueAccessor, allBindings, viewModel, bindingContext) { - var value = valueAccessor(), - options = ko.utils.unwrapObservable(value), - shouldDisplay = true, - templateComputed = null, - templateName; - - if (typeof options == "string") { - templateName = value; - options = {}; - } else { - templateName = options['name']; + function resolveTemplateName(template, data, context) { + // The template can be specified as: + if (ko.isObservable(template)) { + // 1. An observable, with string value + return template(); + } else if (typeof template === 'function') { + // 2. A function of (data, context) returning a string + return template(data, context); + } else { + // 3. A string + return template; + } + } - // Support "if"/"ifnot" conditions - if ('if' in options) - shouldDisplay = ko.utils.unwrapObservable(options['if']); - if (shouldDisplay && 'ifnot' in options) - shouldDisplay = !ko.utils.unwrapObservable(options['ifnot']); - } + ko.renderTemplate = function (template, dataOrBindingContext, options, targetNodeOrNodeArray, renderMode) { + options = options || {}; + if ((options['templateEngine'] || _templateEngine) == undefined) + throw new Error("Set a template engine before calling renderTemplate"); + renderMode = renderMode || "replaceChildren"; - if ('foreach' in options) { - // Render once for each data point (treating data set as empty if shouldDisplay==false) - var dataArray = (shouldDisplay && options['foreach']) || []; - templateComputed = ko.renderTemplateForEach(templateName || element, dataArray, options, element, bindingContext); - } else if (!shouldDisplay) { - ko.virtualElements.emptyNode(element); - } else { - // Render once for this single data point (or use the viewModel if no data was provided) - var innerBindingContext = ('data' in options) ? - bindingContext.createStaticChildContext(options['data'], options['as']) : // Given an explitit 'data' value, we create a child binding context for it - bindingContext; // Given no explicit 'data' value, we retain the same binding context - templateComputed = ko.renderTemplate(templateName || element, innerBindingContext, options, element); - } + if (targetNodeOrNodeArray) { + var firstTargetNode = getFirstNodeFromPossibleArray(targetNodeOrNodeArray); - // It only makes sense to have a single template computed per element (otherwise which one should have its output displayed?) - disposeOldComputedAndStoreNewOne(element, templateComputed); - } - }; + var whenToDispose = function () { return (!firstTargetNode) || !ko.utils.domNodeIsAttachedToDocument(firstTargetNode); }; // Passive disposal (on next evaluation) + var activelyDisposeWhenNodeIsRemoved = (firstTargetNode && renderMode == "replaceNode") ? firstTargetNode.parentNode : firstTargetNode; + + return ko.dependentObservable( // So the DOM is automatically updated when any dependency changes + function () { + // Ensure we've got a proper binding context to work with + var bindingContext = (dataOrBindingContext && (dataOrBindingContext instanceof ko.bindingContext)) + ? dataOrBindingContext + : new ko.bindingContext(dataOrBindingContext, null, null, null, { "exportDependencies": true }); + + var templateName = resolveTemplateName(template, bindingContext['$data'], bindingContext), + renderedNodesArray = executeTemplate(targetNodeOrNodeArray, renderMode, templateName, bindingContext, options); + + if (renderMode == "replaceNode") { + targetNodeOrNodeArray = renderedNodesArray; + firstTargetNode = getFirstNodeFromPossibleArray(targetNodeOrNodeArray); + } + }, + null, + { disposeWhen: whenToDispose, disposeWhenNodeIsRemoved: activelyDisposeWhenNodeIsRemoved } + ); + } else { + // We don't yet have a DOM node to evaluate, so use a memo and render the template later when there is a DOM node + return ko.memoization.memoize(function (domNode) { + ko.renderTemplate(template, dataOrBindingContext, options, domNode, "replaceNode"); + }); + } + }; + + ko.renderTemplateForEach = function (template, arrayOrObservableArray, options, targetNode, parentBindingContext) { + // Since setDomNodeChildrenFromArrayMapping always calls executeTemplateForArrayItem and then + // activateBindingsCallback for added items, we can store the binding context in the former to use in the latter. + var arrayItemContext, asName = options['as']; + + // This will be called by setDomNodeChildrenFromArrayMapping to get the nodes to add to targetNode + var executeTemplateForArrayItem = function (arrayValue, index) { + // Support selecting template as a function of the data being rendered + arrayItemContext = parentBindingContext['createChildContext'](arrayValue, { + 'as': asName, + 'noChildContext': options['noChildContext'], + 'extend': function(context) { + context['$index'] = index; + if (asName) { + context[asName + "Index"] = index; + } + } + }); - // Anonymous templates can't be rewritten. Give a nice error message if you try to do it. - ko.expressionRewriting.bindingRewriteValidators['template'] = function(bindingValue) { - var parsedBindingValue = ko.expressionRewriting.parseObjectLiteral(bindingValue); + var templateName = resolveTemplateName(template, arrayValue, arrayItemContext); + return executeTemplate(targetNode, "ignoreTargetNode", templateName, arrayItemContext, options); + }; - if ((parsedBindingValue.length == 1) && parsedBindingValue[0]['unknown']) - return null; // It looks like a string literal, not an object literal, so treat it as a named template (which is allowed for rewriting) + // This will be called whenever setDomNodeChildrenFromArrayMapping has added nodes to targetNode + var activateBindingsCallback = function(arrayValue, addedNodesArray, index) { + activateBindingsOnContinuousNodeArray(addedNodesArray, arrayItemContext); + if (options['afterRender']) + options['afterRender'](addedNodesArray, arrayValue); - if (ko.expressionRewriting.keyValueArrayContainsKey(parsedBindingValue, "name")) - return null; // Named templates can be rewritten, so return "no error" - return "This template engine does not support anonymous templates nested within its templates"; - }; + // release the "cache" variable, so that it can be collected by + // the GC when its value isn't used from within the bindings anymore. + arrayItemContext = null; + }; - ko.virtualElements.allowedBindings['template'] = true; -})(); + var setDomNodeChildrenFromArrayMapping = function (newArray, changeList) { + // Call setDomNodeChildrenFromArrayMapping, ignoring any observables unwrapped within (most likely from a callback function). + // If the array items are observables, though, they will be unwrapped in executeTemplateForArrayItem and managed within setDomNodeChildrenFromArrayMapping. + ko.dependencyDetection.ignore(ko.utils.setDomNodeChildrenFromArrayMapping, null, [targetNode, newArray, executeTemplateForArrayItem, options, activateBindingsCallback, changeList]); + ko.bindingEvent.notify(targetNode, ko.bindingEvent.childrenComplete); + }; + + var shouldHideDestroyed = (options['includeDestroyed'] === false) || (ko.options['foreachHidesDestroyed'] && !options['includeDestroyed']); + + if (!shouldHideDestroyed && !options['beforeRemove'] && ko.isObservableArray(arrayOrObservableArray)) { + setDomNodeChildrenFromArrayMapping(arrayOrObservableArray.peek()); + + var subscription = arrayOrObservableArray.subscribe(function (changeList) { + setDomNodeChildrenFromArrayMapping(arrayOrObservableArray(), changeList); + }, null, "arrayChange"); + subscription.disposeWhenNodeIsRemoved(targetNode); + + return subscription; + } else { + return ko.dependentObservable(function () { + var unwrappedArray = ko.utils.unwrapObservable(arrayOrObservableArray) || []; + if (typeof unwrappedArray.length == "undefined") // Coerce single value into array + unwrappedArray = [unwrappedArray]; + + if (shouldHideDestroyed) { + // Filter out any entries marked as destroyed + unwrappedArray = ko.utils.arrayFilter(unwrappedArray, function(item) { + return item === undefined || item === null || !ko.utils.unwrapObservable(item['_destroy']); + }); + } + setDomNodeChildrenFromArrayMapping(unwrappedArray); + + }, null, { disposeWhenNodeIsRemoved: targetNode }); + } + }; + + var templateComputedDomDataKey = ko.utils.domData.nextKey(); + function disposeOldComputedAndStoreNewOne(element, newComputed) { + var oldComputed = ko.utils.domData.get(element, templateComputedDomDataKey); + if (oldComputed && (typeof(oldComputed.dispose) == 'function')) + oldComputed.dispose(); + ko.utils.domData.set(element, templateComputedDomDataKey, (newComputed && (!newComputed.isActive || newComputed.isActive())) ? newComputed : undefined); + } + + var cleanContainerDomDataKey = ko.utils.domData.nextKey(); + ko.bindingHandlers['template'] = { + 'init': function(element, valueAccessor) { + // Support anonymous templates + var bindingValue = ko.utils.unwrapObservable(valueAccessor()); + if (typeof bindingValue == "string" || 'name' in bindingValue) { + // It's a named template - clear the element + ko.virtualElements.emptyNode(element); + } else if ('nodes' in bindingValue) { + // We've been given an array of DOM nodes. Save them as the template source. + // There is no known use case for the node array being an observable array (if the output + // varies, put that behavior *into* your template - that's what templates are for), and + // the implementation would be a mess, so assert that it's not observable. + var nodes = bindingValue['nodes'] || []; + if (ko.isObservable(nodes)) { + throw new Error('The "nodes" option must be a plain, non-observable array.'); + } + + // If the nodes are already attached to a KO-generated container, we reuse that container without moving the + // elements to a new one (we check only the first node, as the nodes are always moved together) + var container = nodes[0] && nodes[0].parentNode; + if (!container || !ko.utils.domData.get(container, cleanContainerDomDataKey)) { + container = ko.utils.moveCleanedNodesToContainerElement(nodes); + ko.utils.domData.set(container, cleanContainerDomDataKey, true); + } + + new ko.templateSources.anonymousTemplate(element)['nodes'](container); + } else { + // It's an anonymous template - store the element contents, then clear the element + var templateNodes = ko.virtualElements.childNodes(element); + if (templateNodes.length > 0) { + var container = ko.utils.moveCleanedNodesToContainerElement(templateNodes); // This also removes the nodes from their current parent + new ko.templateSources.anonymousTemplate(element)['nodes'](container); + } else { + throw new Error("Anonymous template defined, but no template content was provided"); + } + } + return { 'controlsDescendantBindings': true }; + }, + 'update': function (element, valueAccessor, allBindings, viewModel, bindingContext) { + var value = valueAccessor(), + options = ko.utils.unwrapObservable(value), + shouldDisplay = true, + templateComputed = null, + template; + + if (typeof options == "string") { + template = value; + options = {}; + } else { + template = 'name' in options ? options['name'] : element; + + // Support "if"/"ifnot" conditions + if ('if' in options) + shouldDisplay = ko.utils.unwrapObservable(options['if']); + if (shouldDisplay && 'ifnot' in options) + shouldDisplay = !ko.utils.unwrapObservable(options['ifnot']); + + // Don't show anything if an empty name is given (see #2446) + if (shouldDisplay && !template) { + shouldDisplay = false; + } + } + + if ('foreach' in options) { + // Render once for each data point (treating data set as empty if shouldDisplay==false) + var dataArray = (shouldDisplay && options['foreach']) || []; + templateComputed = ko.renderTemplateForEach(template, dataArray, options, element, bindingContext); + } else if (!shouldDisplay) { + ko.virtualElements.emptyNode(element); + } else { + // Render once for this single data point (or use the viewModel if no data was provided) + var innerBindingContext = bindingContext; + if ('data' in options) { + innerBindingContext = bindingContext['createChildContext'](options['data'], { + 'as': options['as'], + 'noChildContext': options['noChildContext'], + 'exportDependencies': true + }); + } + templateComputed = ko.renderTemplate(template, innerBindingContext, options, element); + } + + // It only makes sense to have a single template computed per element (otherwise which one should have its output displayed?) + disposeOldComputedAndStoreNewOne(element, templateComputed); + } + }; + + // Anonymous templates can't be rewritten. Give a nice error message if you try to do it. + ko.expressionRewriting.bindingRewriteValidators['template'] = function(bindingValue) { + var parsedBindingValue = ko.expressionRewriting.parseObjectLiteral(bindingValue); + + if ((parsedBindingValue.length == 1) && parsedBindingValue[0]['unknown']) + return null; // It looks like a string literal, not an object literal, so treat it as a named template (which is allowed for rewriting) + + if (ko.expressionRewriting.keyValueArrayContainsKey(parsedBindingValue, "name")) + return null; // Named templates can be rewritten, so return "no error" + return "This template engine does not support anonymous templates nested within its templates"; + }; + + ko.virtualElements.allowedBindings['template'] = true; + })(); -ko.exportSymbol('setTemplateEngine', ko.setTemplateEngine); -ko.exportSymbol('renderTemplate', ko.renderTemplate); + ko.exportSymbol('setTemplateEngine', ko.setTemplateEngine); + ko.exportSymbol('renderTemplate', ko.renderTemplate); // Go through the items that have been added and deleted and try to find matches between them. -ko.utils.findMovesInArrayComparison = function (left, right, limitFailedCompares) { - if (left.length && right.length) { - var failedCompares, l, r, leftItem, rightItem; - for (failedCompares = l = 0; (!limitFailedCompares || failedCompares < limitFailedCompares) && (leftItem = left[l]); ++l) { - for (r = 0; rightItem = right[r]; ++r) { - if (leftItem['value'] === rightItem['value']) { - leftItem['moved'] = rightItem['index']; - rightItem['moved'] = leftItem['index']; - right.splice(r, 1); // This item is marked as moved; so remove it from right list - failedCompares = r = 0; // Reset failed compares count because we're checking for consecutive failures - break; + ko.utils.findMovesInArrayComparison = function (left, right, limitFailedCompares) { + if (left.length && right.length) { + var failedCompares, l, r, leftItem, rightItem; + for (failedCompares = l = 0; (!limitFailedCompares || failedCompares < limitFailedCompares) && (leftItem = left[l]); ++l) { + for (r = 0; rightItem = right[r]; ++r) { + if (leftItem['value'] === rightItem['value']) { + leftItem['moved'] = rightItem['index']; + rightItem['moved'] = leftItem['index']; + right.splice(r, 1); // This item is marked as moved; so remove it from right list + failedCompares = r = 0; // Reset failed compares count because we're checking for consecutive failures + break; + } + } + failedCompares += r; + } } - } - failedCompares += r; - } - } -}; - -ko.utils.compareArrays = (function () { - var statusNotInOld = 'added', statusNotInNew = 'deleted'; - - // Simple calculation based on Levenshtein distance. - function compareArrays(oldArray, newArray, options) { - // For backward compatibility, if the third arg is actually a bool, interpret - // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }. - options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {}); - oldArray = oldArray || []; - newArray = newArray || []; - - if (oldArray.length < newArray.length) - return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options); - else - return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options); - } - - function compareSmallArrayToBigArray(smlArray, bigArray, statusNotInSml, statusNotInBig, options) { - var myMin = Math.min, - myMax = Math.max, - editDistanceMatrix = [], - smlIndex, smlIndexMax = smlArray.length, - bigIndex, bigIndexMax = bigArray.length, - compareRange = (bigIndexMax - smlIndexMax) || 1, - maxDistance = smlIndexMax + bigIndexMax + 1, - thisRow, lastRow, - bigIndexMaxForRow, bigIndexMinForRow; - - for (smlIndex = 0; smlIndex <= smlIndexMax; smlIndex++) { - lastRow = thisRow; - editDistanceMatrix.push(thisRow = []); - bigIndexMaxForRow = myMin(bigIndexMax, smlIndex + compareRange); - bigIndexMinForRow = myMax(0, smlIndex - 1); - for (bigIndex = bigIndexMinForRow; bigIndex <= bigIndexMaxForRow; bigIndex++) { - if (!bigIndex) - thisRow[bigIndex] = smlIndex + 1; - else if (!smlIndex) // Top row - transform empty array into new array via additions - thisRow[bigIndex] = bigIndex + 1; - else if (smlArray[smlIndex - 1] === bigArray[bigIndex - 1]) - thisRow[bigIndex] = lastRow[bigIndex - 1]; // copy value (no edit) - else { - var northDistance = lastRow[bigIndex] || maxDistance; // not in big (deletion) - var westDistance = thisRow[bigIndex - 1] || maxDistance; // not in small (addition) - thisRow[bigIndex] = myMin(northDistance, westDistance) + 1; + }; + + ko.utils.compareArrays = (function () { + var statusNotInOld = 'added', statusNotInNew = 'deleted'; + + // Simple calculation based on Levenshtein distance. + function compareArrays(oldArray, newArray, options) { + // For backward compatibility, if the third arg is actually a bool, interpret + // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }. + options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {}); + oldArray = oldArray || []; + newArray = newArray || []; + + if (oldArray.length < newArray.length) + return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options); + else + return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options); } - } - } - var editScript = [], meMinusOne, notInSml = [], notInBig = []; - for (smlIndex = smlIndexMax, bigIndex = bigIndexMax; smlIndex || bigIndex;) { - meMinusOne = editDistanceMatrix[smlIndex][bigIndex] - 1; - if (bigIndex && meMinusOne === editDistanceMatrix[smlIndex][bigIndex-1]) { - notInSml.push(editScript[editScript.length] = { // added - 'status': statusNotInSml, - 'value': bigArray[--bigIndex], - 'index': bigIndex }); - } else if (smlIndex && meMinusOne === editDistanceMatrix[smlIndex - 1][bigIndex]) { - notInBig.push(editScript[editScript.length] = { // deleted - 'status': statusNotInBig, - 'value': smlArray[--smlIndex], - 'index': smlIndex }); - } else { - --bigIndex; - --smlIndex; - if (!options['sparse']) { - editScript.push({ - 'status': "retained", - 'value': bigArray[bigIndex] }); + function compareSmallArrayToBigArray(smlArray, bigArray, statusNotInSml, statusNotInBig, options) { + var myMin = Math.min, + myMax = Math.max, + editDistanceMatrix = [], + smlIndex, smlIndexMax = smlArray.length, + bigIndex, bigIndexMax = bigArray.length, + compareRange = (bigIndexMax - smlIndexMax) || 1, + maxDistance = smlIndexMax + bigIndexMax + 1, + thisRow, lastRow, + bigIndexMaxForRow, bigIndexMinForRow; + + for (smlIndex = 0; smlIndex <= smlIndexMax; smlIndex++) { + lastRow = thisRow; + editDistanceMatrix.push(thisRow = []); + bigIndexMaxForRow = myMin(bigIndexMax, smlIndex + compareRange); + bigIndexMinForRow = myMax(0, smlIndex - 1); + for (bigIndex = bigIndexMinForRow; bigIndex <= bigIndexMaxForRow; bigIndex++) { + if (!bigIndex) + thisRow[bigIndex] = smlIndex + 1; + else if (!smlIndex) // Top row - transform empty array into new array via additions + thisRow[bigIndex] = bigIndex + 1; + else if (smlArray[smlIndex - 1] === bigArray[bigIndex - 1]) + thisRow[bigIndex] = lastRow[bigIndex - 1]; // copy value (no edit) + else { + var northDistance = lastRow[bigIndex] || maxDistance; // not in big (deletion) + var westDistance = thisRow[bigIndex - 1] || maxDistance; // not in small (addition) + thisRow[bigIndex] = myMin(northDistance, westDistance) + 1; + } + } + } + + var editScript = [], meMinusOne, notInSml = [], notInBig = []; + for (smlIndex = smlIndexMax, bigIndex = bigIndexMax; smlIndex || bigIndex;) { + meMinusOne = editDistanceMatrix[smlIndex][bigIndex] - 1; + if (bigIndex && meMinusOne === editDistanceMatrix[smlIndex][bigIndex-1]) { + notInSml.push(editScript[editScript.length] = { // added + 'status': statusNotInSml, + 'value': bigArray[--bigIndex], + 'index': bigIndex }); + } else if (smlIndex && meMinusOne === editDistanceMatrix[smlIndex - 1][bigIndex]) { + notInBig.push(editScript[editScript.length] = { // deleted + 'status': statusNotInBig, + 'value': smlArray[--smlIndex], + 'index': smlIndex }); + } else { + --bigIndex; + --smlIndex; + if (!options['sparse']) { + editScript.push({ + 'status': "retained", + 'value': bigArray[bigIndex] }); + } + } + } + + // Set a limit on the number of consecutive non-matching comparisons; having it a multiple of + // smlIndexMax keeps the time complexity of this algorithm linear. + ko.utils.findMovesInArrayComparison(notInBig, notInSml, !options['dontLimitMoves'] && smlIndexMax * 10); + + return editScript.reverse(); } - } - } - // Set a limit on the number of consecutive non-matching comparisons; having it a multiple of - // smlIndexMax keeps the time complexity of this algorithm linear. - ko.utils.findMovesInArrayComparison(notInBig, notInSml, !options['dontLimitMoves'] && smlIndexMax * 10); + return compareArrays; + })(); + + ko.exportSymbol('utils.compareArrays', ko.utils.compareArrays); + (function () { + // Objective: + // * Given an input array, a container DOM node, and a function from array elements to arrays of DOM nodes, + // map the array elements to arrays of DOM nodes, concatenate together all these arrays, and use them to populate the container DOM node + // * Next time we're given the same combination of things (with the array possibly having mutated), update the container DOM node + // so that its children is again the concatenation of the mappings of the array elements, but don't re-map any array elements that we + // previously mapped - retain those nodes, and just insert/delete other ones + + // "callbackAfterAddingNodes" will be invoked after any "mapping"-generated nodes are inserted into the container node + // You can use this, for example, to activate bindings on those nodes. + + function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) { + // Map this array value inside a dependentObservable so we re-map when any dependency changes + var mappedNodes = []; + var dependentObservable = ko.dependentObservable(function() { + var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || []; + + // On subsequent evaluations, just replace the previously-inserted DOM nodes + if (mappedNodes.length > 0) { + ko.utils.replaceDomNodes(mappedNodes, newMappedNodes); + if (callbackAfterAddingNodes) + ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]); + } - return editScript.reverse(); - } + // Replace the contents of the mappedNodes array, thereby updating the record + // of which nodes would be deleted if valueToMap was itself later removed + mappedNodes.length = 0; + ko.utils.arrayPushAll(mappedNodes, newMappedNodes); + }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } }); + return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) }; + } - return compareArrays; -})(); + var lastMappingResultDomDataKey = ko.utils.domData.nextKey(), + deletedItemDummyValue = ko.utils.domData.nextKey(); + + ko.utils.setDomNodeChildrenFromArrayMapping = function (domNode, array, mapping, options, callbackAfterAddingNodes, editScript) { + array = array || []; + if (typeof array.length == "undefined") // Coerce single value into array + array = [array]; + + options = options || {}; + var lastMappingResult = ko.utils.domData.get(domNode, lastMappingResultDomDataKey); + var isFirstExecution = !lastMappingResult; + + // Build the new mapping result + var newMappingResult = []; + var lastMappingResultIndex = 0; + var currentArrayIndex = 0; + + var nodesToDelete = []; + var itemsToMoveFirstIndexes = []; + var itemsForBeforeRemoveCallbacks = []; + var itemsForMoveCallbacks = []; + var itemsForAfterAddCallbacks = []; + var mapData; + var countWaitingForRemove = 0; + + function itemAdded(value) { + mapData = { arrayEntry: value, indexObservable: ko.observable(currentArrayIndex++) }; + newMappingResult.push(mapData); + if (!isFirstExecution) { + itemsForAfterAddCallbacks.push(mapData); + } + } -ko.exportSymbol('utils.compareArrays', ko.utils.compareArrays); -(function () { - // Objective: - // * Given an input array, a container DOM node, and a function from array elements to arrays of DOM nodes, - // map the array elements to arrays of DOM nodes, concatenate together all these arrays, and use them to populate the container DOM node - // * Next time we're given the same combination of things (with the array possibly having mutated), update the container DOM node - // so that its children is again the concatenation of the mappings of the array elements, but don't re-map any array elements that we - // previously mapped - retain those nodes, and just insert/delete other ones - - // "callbackAfterAddingNodes" will be invoked after any "mapping"-generated nodes are inserted into the container node - // You can use this, for example, to activate bindings on those nodes. - - function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) { - // Map this array value inside a dependentObservable so we re-map when any dependency changes - var mappedNodes = []; - var dependentObservable = ko.dependentObservable(function() { - var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || []; - - // On subsequent evaluations, just replace the previously-inserted DOM nodes - if (mappedNodes.length > 0) { - ko.utils.replaceDomNodes(mappedNodes, newMappedNodes); - if (callbackAfterAddingNodes) - ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]); - } + function itemMovedOrRetained(oldPosition) { + mapData = lastMappingResult[oldPosition]; + if (currentArrayIndex !== mapData.indexObservable.peek()) + itemsForMoveCallbacks.push(mapData); + // Since updating the index might change the nodes, do so before calling fixUpContinuousNodeArray + mapData.indexObservable(currentArrayIndex++); + ko.utils.fixUpContinuousNodeArray(mapData.mappedNodes, domNode); + newMappingResult.push(mapData); + } - // Replace the contents of the mappedNodes array, thereby updating the record - // of which nodes would be deleted if valueToMap was itself later removed - mappedNodes.length = 0; - ko.utils.arrayPushAll(mappedNodes, newMappedNodes); - }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } }); - return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) }; - } - - var lastMappingResultDomDataKey = ko.utils.domData.nextKey(), - deletedItemDummyValue = ko.utils.domData.nextKey(); - - ko.utils.setDomNodeChildrenFromArrayMapping = function (domNode, array, mapping, options, callbackAfterAddingNodes) { - // Compare the provided array against the previous one - array = array || []; - options = options || {}; - var isFirstExecution = ko.utils.domData.get(domNode, lastMappingResultDomDataKey) === undefined; - var lastMappingResult = ko.utils.domData.get(domNode, lastMappingResultDomDataKey) || []; - var lastArray = ko.utils.arrayMap(lastMappingResult, function (x) { return x.arrayEntry; }); - var editScript = ko.utils.compareArrays(lastArray, array, options['dontLimitMoves']); - - // Build the new mapping result - var newMappingResult = []; - var lastMappingResultIndex = 0; - var newMappingResultIndex = 0; - - var nodesToDelete = []; - var itemsToProcess = []; - var itemsForBeforeRemoveCallbacks = []; - var itemsForMoveCallbacks = []; - var itemsForAfterAddCallbacks = []; - var mapData; - - function itemMovedOrRetained(editScriptIndex, oldPosition) { - mapData = lastMappingResult[oldPosition]; - if (newMappingResultIndex !== oldPosition) - itemsForMoveCallbacks[editScriptIndex] = mapData; - // Since updating the index might change the nodes, do so before calling fixUpContinuousNodeArray - mapData.indexObservable(newMappingResultIndex++); - ko.utils.fixUpContinuousNodeArray(mapData.mappedNodes, domNode); - newMappingResult.push(mapData); - itemsToProcess.push(mapData); - } + function callCallback(callback, items) { + if (callback) { + for (var i = 0, n = items.length; i < n; i++) { + ko.utils.arrayForEach(items[i].mappedNodes, function(node) { + callback(node, i, items[i].arrayEntry); + }); + } + } + } - function callCallback(callback, items) { - if (callback) { - for (var i = 0, n = items.length; i < n; i++) { - if (items[i]) { - ko.utils.arrayForEach(items[i].mappedNodes, function(node) { - callback(node, i, items[i].arrayEntry); - }); + if (isFirstExecution) { + ko.utils.arrayForEach(array, itemAdded); + } else { + if (!editScript || (lastMappingResult && lastMappingResult['_countWaitingForRemove'])) { + // Compare the provided array against the previous one + var lastArray = ko.utils.arrayMap(lastMappingResult, function (x) { return x.arrayEntry; }), + compareOptions = { + 'dontLimitMoves': options['dontLimitMoves'], + 'sparse': true + }; + editScript = ko.utils.compareArrays(lastArray, array, compareOptions); + } + + for (var i = 0, editScriptItem, movedIndex, itemIndex; editScriptItem = editScript[i]; i++) { + movedIndex = editScriptItem['moved']; + itemIndex = editScriptItem['index']; + switch (editScriptItem['status']) { + case "deleted": + while (lastMappingResultIndex < itemIndex) { + itemMovedOrRetained(lastMappingResultIndex++); + } + if (movedIndex === undefined) { + mapData = lastMappingResult[lastMappingResultIndex]; + + // Stop tracking changes to the mapping for these nodes + if (mapData.dependentObservable) { + mapData.dependentObservable.dispose(); + mapData.dependentObservable = undefined; + } + + // Queue these nodes for later removal + if (ko.utils.fixUpContinuousNodeArray(mapData.mappedNodes, domNode).length) { + if (options['beforeRemove']) { + newMappingResult.push(mapData); + countWaitingForRemove++; + if (mapData.arrayEntry === deletedItemDummyValue) { + mapData = null; + } else { + itemsForBeforeRemoveCallbacks.push(mapData); + } + } + if (mapData) { + nodesToDelete.push.apply(nodesToDelete, mapData.mappedNodes); + } + } + } + lastMappingResultIndex++; + break; + + case "added": + while (currentArrayIndex < itemIndex) { + itemMovedOrRetained(lastMappingResultIndex++); + } + if (movedIndex !== undefined) { + itemsToMoveFirstIndexes.push(newMappingResult.length); + itemMovedOrRetained(movedIndex); + } else { + itemAdded(editScriptItem['value']); + } + break; + } + } + + while (currentArrayIndex < array.length) { + itemMovedOrRetained(lastMappingResultIndex++); + } + + // Record that the current view may still contain deleted items + // because it means we won't be able to use a provided editScript. + newMappingResult['_countWaitingForRemove'] = countWaitingForRemove; } - } - } - } - for (var i = 0, editScriptItem, movedIndex; editScriptItem = editScript[i]; i++) { - movedIndex = editScriptItem['moved']; - switch (editScriptItem['status']) { - case "deleted": - if (movedIndex === undefined) { - mapData = lastMappingResult[lastMappingResultIndex]; - - // Stop tracking changes to the mapping for these nodes - if (mapData.dependentObservable) { - mapData.dependentObservable.dispose(); - mapData.dependentObservable = undefined; - } - - // Queue these nodes for later removal - if (ko.utils.fixUpContinuousNodeArray(mapData.mappedNodes, domNode).length) { - if (options['beforeRemove']) { - newMappingResult.push(mapData); - itemsToProcess.push(mapData); - if (mapData.arrayEntry === deletedItemDummyValue) { - mapData = null; - } else { - itemsForBeforeRemoveCallbacks[i] = mapData; + // Store a copy of the array items we just considered so we can difference it next time + ko.utils.domData.set(domNode, lastMappingResultDomDataKey, newMappingResult); + + // Call beforeMove first before any changes have been made to the DOM + callCallback(options['beforeMove'], itemsForMoveCallbacks); + + // Next remove nodes for deleted items (or just clean if there's a beforeRemove callback) + ko.utils.arrayForEach(nodesToDelete, options['beforeRemove'] ? ko.cleanNode : ko.removeNode); + + var i, j, lastNode, nodeToInsert, mappedNodes, activeElement; + + // Since most browsers remove the focus from an element when it's moved to another location, + // save the focused element and try to restore it later. + try { + activeElement = domNode.ownerDocument.activeElement; + } catch(e) { + // IE9 throws if you access activeElement during page load (see issue #703) + } + + // Try to reduce overall moved nodes by first moving the ones that were marked as moved by the edit script + if (itemsToMoveFirstIndexes.length) { + while ((i = itemsToMoveFirstIndexes.shift()) != undefined) { + mapData = newMappingResult[i]; + for (lastNode = undefined; i; ) { + if ((mappedNodes = newMappingResult[--i].mappedNodes) && mappedNodes.length) { + lastNode = mappedNodes[mappedNodes.length-1]; + break; } } - if (mapData) { - nodesToDelete.push.apply(nodesToDelete, mapData.mappedNodes); + for (j = 0; nodeToInsert = mapData.mappedNodes[j]; lastNode = nodeToInsert, j++) { + ko.virtualElements.insertAfter(domNode, nodeToInsert, lastNode); } } } - lastMappingResultIndex++; - break; - case "retained": - itemMovedOrRetained(i, lastMappingResultIndex++); - break; + // Next add/reorder the remaining items (will include deleted items if there's a beforeRemove callback) + for (i = 0; mapData = newMappingResult[i]; i++) { + // Get nodes for newly added items + if (!mapData.mappedNodes) + ko.utils.extend(mapData, mapNodeAndRefreshWhenChanged(domNode, mapping, mapData.arrayEntry, callbackAfterAddingNodes, mapData.indexObservable)); - case "added": - if (movedIndex !== undefined) { - itemMovedOrRetained(i, movedIndex); - } else { - mapData = { arrayEntry: editScriptItem['value'], indexObservable: ko.observable(newMappingResultIndex++) }; - newMappingResult.push(mapData); - itemsToProcess.push(mapData); - if (!isFirstExecution) - itemsForAfterAddCallbacks[i] = mapData; - } - break; - } - } + // Put nodes in the right place if they aren't there already + for (j = 0; nodeToInsert = mapData.mappedNodes[j]; lastNode = nodeToInsert, j++) { + ko.virtualElements.insertAfter(domNode, nodeToInsert, lastNode); + } - // Store a copy of the array items we just considered so we can difference it next time - ko.utils.domData.set(domNode, lastMappingResultDomDataKey, newMappingResult); + // Run the callbacks for newly added nodes (for example, to apply bindings, etc.) + if (!mapData.initialized && callbackAfterAddingNodes) { + callbackAfterAddingNodes(mapData.arrayEntry, mapData.mappedNodes, mapData.indexObservable); + mapData.initialized = true; + lastNode = mapData.mappedNodes[mapData.mappedNodes.length - 1]; // get the last node again since it may have been changed by a preprocessor + } + } - // Call beforeMove first before any changes have been made to the DOM - callCallback(options['beforeMove'], itemsForMoveCallbacks); + // Restore the focused element if it had lost focus + if (activeElement && domNode.ownerDocument.activeElement != activeElement) { + activeElement.focus(); + } - // Next remove nodes for deleted items (or just clean if there's a beforeRemove callback) - ko.utils.arrayForEach(nodesToDelete, options['beforeRemove'] ? ko.cleanNode : ko.removeNode); + // If there's a beforeRemove callback, call it after reordering. + // Note that we assume that the beforeRemove callback will usually be used to remove the nodes using + // some sort of animation, which is why we first reorder the nodes that will be removed. If the + // callback instead removes the nodes right away, it would be more efficient to skip reordering them. + // Perhaps we'll make that change in the future if this scenario becomes more common. + callCallback(options['beforeRemove'], itemsForBeforeRemoveCallbacks); + + // Replace the stored values of deleted items with a dummy value. This provides two benefits: it marks this item + // as already "removed" so we won't call beforeRemove for it again, and it ensures that the item won't match up + // with an actual item in the array and appear as "retained" or "moved". + for (i = 0; i < itemsForBeforeRemoveCallbacks.length; ++i) { + itemsForBeforeRemoveCallbacks[i].arrayEntry = deletedItemDummyValue; + } - // Next add/reorder the remaining items (will include deleted items if there's a beforeRemove callback) - for (var i = 0, nextNode = ko.virtualElements.firstChild(domNode), lastNode, node; mapData = itemsToProcess[i]; i++) { - // Get nodes for newly added items - if (!mapData.mappedNodes) - ko.utils.extend(mapData, mapNodeAndRefreshWhenChanged(domNode, mapping, mapData.arrayEntry, callbackAfterAddingNodes, mapData.indexObservable)); + // Finally call afterMove and afterAdd callbacks + callCallback(options['afterMove'], itemsForMoveCallbacks); + callCallback(options['afterAdd'], itemsForAfterAddCallbacks); + } + })(); - // Put nodes in the right place if they aren't there already - for (var j = 0; node = mapData.mappedNodes[j]; nextNode = node.nextSibling, lastNode = node, j++) { - if (node !== nextNode) - ko.virtualElements.insertAfter(domNode, node, lastNode); + ko.exportSymbol('utils.setDomNodeChildrenFromArrayMapping', ko.utils.setDomNodeChildrenFromArrayMapping); + ko.nativeTemplateEngine = function () { + this['allowTemplateRewriting'] = false; } - // Run the callbacks for newly added nodes (for example, to apply bindings, etc.) - if (!mapData.initialized && callbackAfterAddingNodes) { - callbackAfterAddingNodes(mapData.arrayEntry, mapData.mappedNodes, mapData.indexObservable); - mapData.initialized = true; - } - } + ko.nativeTemplateEngine.prototype = new ko.templateEngine(); + ko.nativeTemplateEngine.prototype.constructor = ko.nativeTemplateEngine; + ko.nativeTemplateEngine.prototype['renderTemplateSource'] = function (templateSource, bindingContext, options, templateDocument) { + var useNodesIfAvailable = !(ko.utils.ieVersion < 9), // IE<9 cloneNode doesn't work properly + templateNodesFunc = useNodesIfAvailable ? templateSource['nodes'] : null, + templateNodes = templateNodesFunc ? templateSource['nodes']() : null; - // If there's a beforeRemove callback, call it after reordering. - // Note that we assume that the beforeRemove callback will usually be used to remove the nodes using - // some sort of animation, which is why we first reorder the nodes that will be removed. If the - // callback instead removes the nodes right away, it would be more efficient to skip reordering them. - // Perhaps we'll make that change in the future if this scenario becomes more common. - callCallback(options['beforeRemove'], itemsForBeforeRemoveCallbacks); - - // Replace the stored values of deleted items with a dummy value. This provides two benefits: it marks this item - // as already "removed" so we won't call beforeRemove for it again, and it ensures that the item won't match up - // with an actual item in the array and appear as "retained" or "moved". - for (i = 0; i < itemsForBeforeRemoveCallbacks.length; ++i) { - if (itemsForBeforeRemoveCallbacks[i]) { - itemsForBeforeRemoveCallbacks[i].arrayEntry = deletedItemDummyValue; - } - } + if (templateNodes) { + return ko.utils.makeArray(templateNodes.cloneNode(true).childNodes); + } else { + var templateText = templateSource['text'](); + return ko.utils.parseHtmlFragment(templateText, templateDocument); + } + }; - // Finally call afterMove and afterAdd callbacks - callCallback(options['afterMove'], itemsForMoveCallbacks); - callCallback(options['afterAdd'], itemsForAfterAddCallbacks); - } -})(); + ko.nativeTemplateEngine.instance = new ko.nativeTemplateEngine(); + ko.setTemplateEngine(ko.nativeTemplateEngine.instance); + + ko.exportSymbol('nativeTemplateEngine', ko.nativeTemplateEngine); + (function() { + ko.jqueryTmplTemplateEngine = function () { + // Detect which version of jquery-tmpl you're using. Unfortunately jquery-tmpl + // doesn't expose a version number, so we have to infer it. + // Note that as of Knockout 1.3, we only support jQuery.tmpl 1.0.0pre and later, + // which KO internally refers to as version "2", so older versions are no longer detected. + var jQueryTmplVersion = this.jQueryTmplVersion = (function() { + if (!jQueryInstance || !(jQueryInstance['tmpl'])) + return 0; + // Since it exposes no official version number, we use our own numbering system. To be updated as jquery-tmpl evolves. + try { + if (jQueryInstance['tmpl']['tag']['tmpl']['open'].toString().indexOf('__') >= 0) { + // Since 1.0.0pre, custom tags should append markup to an array called "__" + return 2; // Final version of jquery.tmpl + } + } catch(ex) { /* Apparently not the version we were looking for */ } -ko.exportSymbol('utils.setDomNodeChildrenFromArrayMapping', ko.utils.setDomNodeChildrenFromArrayMapping); -ko.nativeTemplateEngine = function () { - this['allowTemplateRewriting'] = false; -} - -ko.nativeTemplateEngine.prototype = new ko.templateEngine(); -ko.nativeTemplateEngine.prototype.constructor = ko.nativeTemplateEngine; -ko.nativeTemplateEngine.prototype['renderTemplateSource'] = function (templateSource, bindingContext, options, templateDocument) { - var useNodesIfAvailable = !(ko.utils.ieVersion < 9), // IE<9 cloneNode doesn't work properly - templateNodesFunc = useNodesIfAvailable ? templateSource['nodes'] : null, - templateNodes = templateNodesFunc ? templateSource['nodes']() : null; - - if (templateNodes) { - return ko.utils.makeArray(templateNodes.cloneNode(true).childNodes); - } else { - var templateText = templateSource['text'](); - return ko.utils.parseHtmlFragment(templateText, templateDocument); - } -}; - -ko.nativeTemplateEngine.instance = new ko.nativeTemplateEngine(); -ko.setTemplateEngine(ko.nativeTemplateEngine.instance); - -ko.exportSymbol('nativeTemplateEngine', ko.nativeTemplateEngine); -(function() { - ko.jqueryTmplTemplateEngine = function () { - // Detect which version of jquery-tmpl you're using. Unfortunately jquery-tmpl - // doesn't expose a version number, so we have to infer it. - // Note that as of Knockout 1.3, we only support jQuery.tmpl 1.0.0pre and later, - // which KO internally refers to as version "2", so older versions are no longer detected. - var jQueryTmplVersion = this.jQueryTmplVersion = (function() { - if (!jQueryInstance || !(jQueryInstance['tmpl'])) - return 0; - // Since it exposes no official version number, we use our own numbering system. To be updated as jquery-tmpl evolves. - try { - if (jQueryInstance['tmpl']['tag']['tmpl']['open'].toString().indexOf('__') >= 0) { - // Since 1.0.0pre, custom tags should append markup to an array called "__" - return 2; // Final version of jquery.tmpl - } - } catch(ex) { /* Apparently not the version we were looking for */ } - - return 1; // Any older version that we don't support - })(); - - function ensureHasReferencedJQueryTemplates() { - if (jQueryTmplVersion < 2) - throw new Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."); - } + return 1; // Any older version that we don't support + })(); - function executeTemplate(compiledTemplate, data, jQueryTemplateOptions) { - return jQueryInstance['tmpl'](compiledTemplate, data, jQueryTemplateOptions); - } + function ensureHasReferencedJQueryTemplates() { + if (jQueryTmplVersion < 2) + throw new Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."); + } - this['renderTemplateSource'] = function(templateSource, bindingContext, options, templateDocument) { - templateDocument = templateDocument || document; - options = options || {}; - ensureHasReferencedJQueryTemplates(); + function executeTemplate(compiledTemplate, data, jQueryTemplateOptions) { + return jQueryInstance['tmpl'](compiledTemplate, data, jQueryTemplateOptions); + } - // Ensure we have stored a precompiled version of this template (don't want to reparse on every render) - var precompiled = templateSource['data']('precompiled'); - if (!precompiled) { - var templateText = templateSource['text']() || ""; - // Wrap in "with($whatever.koBindingContext) { ... }" - templateText = "{{ko_with $item.koBindingContext}}" + templateText + "{{/ko_with}}"; + this['renderTemplateSource'] = function(templateSource, bindingContext, options, templateDocument) { + templateDocument = templateDocument || document; + options = options || {}; + ensureHasReferencedJQueryTemplates(); - precompiled = jQueryInstance['template'](null, templateText); - templateSource['data']('precompiled', precompiled); - } + // Ensure we have stored a precompiled version of this template (don't want to reparse on every render) + var precompiled = templateSource['data']('precompiled'); + if (!precompiled) { + var templateText = templateSource['text']() || ""; + // Wrap in "with($whatever.koBindingContext) { ... }" + templateText = "{{ko_with $item.koBindingContext}}" + templateText + "{{/ko_with}}"; - var data = [bindingContext['$data']]; // Prewrap the data in an array to stop jquery.tmpl from trying to unwrap any arrays - var jQueryTemplateOptions = jQueryInstance['extend']({ 'koBindingContext': bindingContext }, options['templateOptions']); + precompiled = jQueryInstance['template'](null, templateText); + templateSource['data']('precompiled', precompiled); + } - var resultNodes = executeTemplate(precompiled, data, jQueryTemplateOptions); - resultNodes['appendTo'](templateDocument.createElement("div")); // Using "appendTo" forces jQuery/jQuery.tmpl to perform necessary cleanup work + var data = [bindingContext['$data']]; // Prewrap the data in an array to stop jquery.tmpl from trying to unwrap any arrays + var jQueryTemplateOptions = jQueryInstance['extend']({ 'koBindingContext': bindingContext }, options['templateOptions']); - jQueryInstance['fragments'] = {}; // Clear jQuery's fragment cache to avoid a memory leak after a large number of template renders - return resultNodes; - }; + var resultNodes = executeTemplate(precompiled, data, jQueryTemplateOptions); + resultNodes['appendTo'](templateDocument.createElement("div")); // Using "appendTo" forces jQuery/jQuery.tmpl to perform necessary cleanup work - this['createJavaScriptEvaluatorBlock'] = function(script) { - return "{{ko_code ((function() { return " + script + " })()) }}"; - }; + jQueryInstance['fragments'] = {}; // Clear jQuery's fragment cache to avoid a memory leak after a large number of template renders + return resultNodes; + }; - this['addTemplate'] = function(templateName, templateMarkup) { - document.write("<script type='text/html' id='" + templateName + "'>" + templateMarkup + "<" + "/script>"); - }; + this['createJavaScriptEvaluatorBlock'] = function(script) { + return "{{ko_code ((function() { return " + script + " })()) }}"; + }; - if (jQueryTmplVersion > 0) { - jQueryInstance['tmpl']['tag']['ko_code'] = { - open: "__.push($1 || '');" - }; - jQueryInstance['tmpl']['tag']['ko_with'] = { - open: "with($1) {", - close: "} " - }; - } - }; + this['addTemplate'] = function(templateName, templateMarkup) { + document.write("<script type='text/html' id='" + templateName + "'>" + templateMarkup + "<" + "/script>"); + }; + + if (jQueryTmplVersion > 0) { + jQueryInstance['tmpl']['tag']['ko_code'] = { + open: "__.push($1 || '');" + }; + jQueryInstance['tmpl']['tag']['ko_with'] = { + open: "with($1) {", + close: "} " + }; + } + }; - ko.jqueryTmplTemplateEngine.prototype = new ko.templateEngine(); - ko.jqueryTmplTemplateEngine.prototype.constructor = ko.jqueryTmplTemplateEngine; + ko.jqueryTmplTemplateEngine.prototype = new ko.templateEngine(); + ko.jqueryTmplTemplateEngine.prototype.constructor = ko.jqueryTmplTemplateEngine; - // Use this one by default *only if jquery.tmpl is referenced* - var jqueryTmplTemplateEngineInstance = new ko.jqueryTmplTemplateEngine(); - if (jqueryTmplTemplateEngineInstance.jQueryTmplVersion > 0) - ko.setTemplateEngine(jqueryTmplTemplateEngineInstance); + // Use this one by default *only if jquery.tmpl is referenced* + var jqueryTmplTemplateEngineInstance = new ko.jqueryTmplTemplateEngine(); + if (jqueryTmplTemplateEngineInstance.jQueryTmplVersion > 0) + ko.setTemplateEngine(jqueryTmplTemplateEngineInstance); - ko.exportSymbol('jqueryTmplTemplateEngine', ko.jqueryTmplTemplateEngine); -})(); -})); -}()); + ko.exportSymbol('jqueryTmplTemplateEngine', ko.jqueryTmplTemplateEngine); + })(); + })); + }()); })(); diff --git a/lib/web/mage/adminhtml/backup.js b/lib/web/mage/adminhtml/backup.js index 3be192558a4eb..478b2bcc2113a 100644 --- a/lib/web/mage/adminhtml/backup.js +++ b/lib/web/mage/adminhtml/backup.js @@ -70,13 +70,12 @@ define([ * request backup options. */ requestBackupOptions: function () { - var action; - this.hidePopups(); - action = this.type != 'snapshot' ? 'hide' : 'show'; //eslint-disable-line eqeqeq this.showPopup('backup-options'); - $$('#exclude-media-checkbox-container').invoke(action); + if (this.type === 'snapshot') { + jQuery('#exclude-media-checkbox-container').removeClass('no-display'); + } }, /** diff --git a/lib/web/mage/adminhtml/form.js b/lib/web/mage/adminhtml/form.js index 20ca1d505bb21..85ee38f966fa6 100644 --- a/lib/web/mage/adminhtml/form.js +++ b/lib/web/mage/adminhtml/form.js @@ -551,6 +551,8 @@ define([ } else { if (target) { target.show(); + headElement = jQuery('.field-' + idTo).add('.field-chooser' + idTo); + headElement.show(); } if (isAnInputOrSelect && !isInheritCheckboxChecked) { @@ -580,6 +582,9 @@ define([ if (headElement.length > 0) { headElement.hide(); + } else { + headElement = jQuery('.field-' + idTo).add('.field-chooser' + idTo); + headElement.hide(); } if (target) { diff --git a/lib/web/mage/adminhtml/tools.js b/lib/web/mage/adminhtml/tools.js index 27f6efcfc5876..12fe88bb171a4 100644 --- a/lib/web/mage/adminhtml/tools.js +++ b/lib/web/mage/adminhtml/tools.js @@ -267,7 +267,7 @@ var Cookie = { return null; }, - write: function (cookieName, cookieValue, cookieLifeTime) { + write: function (cookieName, cookieValue, cookieLifeTime, samesite) { var expires = ''; if (cookieLifeTime) { @@ -278,7 +278,9 @@ var Cookie = { } var urlPath = '/' + BASE_URL.split('/').slice(3).join('/'); // Get relative path - document.cookie = escape(cookieName) + '=' + escape(cookieValue) + expires + '; path=' + urlPath; + samesite = '; samesite=' + (samesite ? samesite : 'lax'); + + document.cookie = escape(cookieName) + '=' + escape(cookieValue) + expires + '; path=' + urlPath + samesite; }, clear: function (cookieName) { this.write(cookieName, '', -1); diff --git a/lib/web/mage/cookies.js b/lib/web/mage/cookies.js index 627e22ade323b..3e42ff9c404c7 100644 --- a/lib/web/mage/cookies.js +++ b/lib/web/mage/cookies.js @@ -26,7 +26,8 @@ define([ path: '/', domain: null, secure: false, - lifetime: null + lifetime: null, + samesite: 'lax' }; /** @@ -60,19 +61,22 @@ define([ var expires, path, domain, - secure; + secure, + samesite; options = $.extend({}, this.defaults, options || {}); expires = lifetimeToExpires(options, this.defaults) || options.expires; path = options.path; domain = options.domain; secure = options.secure; + samesite = options.samesite; document.cookie = name + '=' + encodeURIComponent(value) + (expires ? '; expires=' + expires.toUTCString() : '') + (path ? '; path=' + path : '') + (domain ? '; domain=' + domain : '') + - (secure ? '; secure' : ''); + (secure ? '; secure' : '') + + '; samesite=' + (samesite ? samesite : 'lax'); }; /** diff --git a/lib/web/mage/utils/misc.js b/lib/web/mage/utils/misc.js index b1c0c33324c28..f634f9cb2187c 100644 --- a/lib/web/mage/utils/misc.js +++ b/lib/web/mage/utils/misc.js @@ -178,13 +178,15 @@ define([ } }) .fail(function () { - config.response.status(undefined); - config.response.status(false); - config.response.data({ - error: true, - messages: 'Something went wrong.', - t: t - }); + if (config.response) { + config.response.status(undefined); + config.response.status(false); + config.response.data({ + error: true, + messages: 'Something went wrong.', + t: t + }); + } }) .always(function () { if (!config.ignoreProcessEvents) { diff --git a/lib/web/magnifier/magnifier.js b/lib/web/magnifier/magnifier.js index 155b946b68467..f6d97f40d51a5 100644 --- a/lib/web/magnifier/magnifier.js +++ b/lib/web/magnifier/magnifier.js @@ -401,6 +401,13 @@ } function bindEvents(eType, thumb) { + var eventFlag = 'hasBoundEvent_' + eType; + if (thumb[eventFlag]) { + // Events are already bound, no need to bind in duplicate + return; + } + thumb[eventFlag] = true; + switch (eType) { case 'hover': hoverEvents(thumb); diff --git a/nginx.conf.sample b/nginx.conf.sample index 2dbba68c39c39..1c406ff181ae9 100644 --- a/nginx.conf.sample +++ b/nginx.conf.sample @@ -108,11 +108,11 @@ location /static/ { # expires max; # Remove signature of the static files that is used to overcome the browser cache - location ~ ^/static/version { - rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last; + location ~ ^/static/version\d*/ { + rewrite ^/static/version\d*/(.*)$ /static/$1 last; } - location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|html|json)$ { + location ~* \.(ico|jpg|jpeg|png|gif|svg|svgz|webp|avif|avifs|js|css|eot|ttf|otf|woff|woff2|html|json|webmanifest)$ { add_header Cache-Control "public"; add_header X-Frame-Options "SAMEORIGIN"; expires +1y; @@ -140,7 +140,7 @@ location /media/ { ## The following section allows to offload image resizing from Magento instance to the Nginx. ## Catalog image URL format should be set accordingly. -## See https://docs.magento.com/m2/ee/user_guide/configuration/general/web.html#url-options +## See https://docs.magento.com/user-guide/configuration/general/web.html#url-options # location ~* ^/media/catalog/.* { # # # Replace placeholders and uncomment the line below to serve product images from public S3 @@ -166,7 +166,7 @@ location /media/ { deny all; } - location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ { + location ~* \.(ico|jpg|jpeg|png|gif|svg|svgz|webp|avif|avifs|js|css|eot|ttf|otf|woff|woff2)$ { add_header Cache-Control "public"; add_header X-Frame-Options "SAMEORIGIN"; expires +1y; diff --git a/phpserver/README.md b/phpserver/README.md index a6f9cafaf023c..385a09b7f8802 100644 --- a/phpserver/README.md +++ b/phpserver/README.md @@ -1,9 +1,9 @@ -PHP Built-in webserver -====================== +# PHP Built-in webserver -PHP has had a <a href="https://secure.php.net/manual/en/features.commandline.webserver.php" target="_blank">built-in web sever</a> since version 5.4. +PHP has had a [built-in web sever](https://secure.php.net/manual/en/features.commandline.webserver.php) since version 5.4. PHP's web server provides a router script for use with server rewrites. Magento, like many other applications and frameworks, requires server rewrites. The router script either: + - The web server executes the requested PHP script using a server-side include - Returns `false`, which means the web server returns the file using file system lookup @@ -12,11 +12,11 @@ requests to `/static/frontend/Magento/blank/en_US/mage/calendar.css` should deli Without a router script, that is not possible via the php built-in server. -### How to install Magento +## How to install Magento -Please read how to install Magento using the <a href="https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli.html" target="_blank">command line</a>. An example follows: +Please read how to install Magento using the [command line](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli.html). An example follows: -``` +```php php bin/magento setup:install --base-url=http://127.0.0.1:8082 \ --db-host=localhost --db-name=magento --db-user=magento --db-password=magento \ --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \ @@ -25,20 +25,24 @@ php bin/magento setup:install --base-url=http://127.0.0.1:8082 \ --search-engine=elasticsearch7 --elasticsearch-host=es-host.example.com --elasticsearch-port=9200 ``` -Notes: -- By default, Magento creates a random Admin URI for you. Make sure to write this value down because it's how you access the Magento Admin later. For example : ```http://127.0.0.1:8082/index.php/admin_1vpn01```. +Note: By default, Magento creates a random Admin URI for you. Make sure to write this value down because it's how you access the Magento Admin later. For example: `http://127.0.0.1:8082/index.php/admin_1vpn01`. -For more information about the installation process using the CLI, you can consult the dedicated documentation that can found in [the developer documentation](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands.html). +For more information about the installation process using the CLI, you can consult the dedicated documentation that can found in [the developer documentation](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands.html). ### How to run Magento -Example usage: ```php -S 127.0.0.1:8082 -t ./pub/ ./phpserver/router.php``` +Example usage: + +```shell +php -S 127.0.0.1:8082 -t ./pub/ ./phpserver/router.php +``` ### What exactly the script does The `$debug` option provides low-level logging for debugging purposes. Forwarding rules: + - Any request for `favicon.ico` or for any path that starts with `index.php`, `get.php`, `static.php` are processed normally. - Requests for the path `pub/errors/default` are rewritten as `errors/default`. This is provided for compatibility with older versions. - Files under request paths `media`, `opt`, or `static` are tested; if the file exists, the file is served. If the file does not exist, `static` files are forwarded to `static.php` and `media` files are forwarded to `get.php` ((How about `opt`?)) @@ -53,6 +57,6 @@ If none of the rules matched, return 404. You may instead include the index.php, ### How to access to the admin dashboard When the installation is finished, you can access Magento as follows: + - Storefront: `<your Magento base URL>` - Magento Admin: `<your Magento base URL>/<admin URI>` - diff --git a/pub/media/.htaccess b/pub/media/.htaccess index d68d163d7a6b5..42908cc63421e 100644 --- a/pub/media/.htaccess +++ b/pub/media/.htaccess @@ -52,9 +52,12 @@ AddType image/gif gif AddType image/png png AddType image/jpeg jpg AddType image/jpeg jpeg +AddType image/webp webp +AddType image/avif avif +AddType image/avif-sequence avifs # SVG -AddType image/svg+xml svg +AddType image/svg+xml svg svgz # Fonts AddType application/vnd.ms-fontobject eot @@ -63,9 +66,6 @@ AddType application/x-font-otf otf AddType application/x-font-woff woff AddType application/font-woff2 woff2 -# Flash -AddType application/x-shockwave-flash swf - # Archives and exports AddType application/zip gzip AddType application/x-gzip gz gzip @@ -75,7 +75,7 @@ AddType application/xml xml <IfModule mod_headers.c> - <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$> + <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|svgz|webp|avif|avifs|js|css|eot|ttf|otf|woff|woff2)$> Header append Cache-Control public </FilesMatch> @@ -111,8 +111,8 @@ AddType application/xml xml ExpiresByType text/css "access plus 1 year" ExpiresByType application/javascript "access plus 1 year" - # Favicon, images, flash - <FilesMatch \.(ico|gif|png|jpg|jpeg|swf|svg)$> + # Favicon, images + <FilesMatch \.(ico|gif|png|jpg|jpeg|svg|svgz|webp|avif|avifs)$> ExpiresDefault "access plus 1 year" </FilesMatch> ExpiresByType image/gif "access plus 1 year" @@ -120,6 +120,9 @@ AddType application/xml xml ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" + ExpiresByType image/webp "access plus 1 year" + ExpiresByType image/avif "access plus 1 year" + ExpiresByType image/avif-sequence "access plus 1 year" # Fonts <FilesMatch \.(eot|ttf|otf|svg|woff|woff2)$> diff --git a/pub/static/.htaccess b/pub/static/.htaccess index 84741c4ebb35e..eeda4c2e0e441 100644 --- a/pub/static/.htaccess +++ b/pub/static/.htaccess @@ -37,7 +37,6 @@ AddType application/javascript js jsonp AddType application/json json # HTML - AddType text/html html # CSS @@ -49,9 +48,12 @@ AddType image/gif gif AddType image/png png AddType image/jpeg jpg AddType image/jpeg jpeg +AddType image/webp webp +AddType image/avif avif +AddType image/avif-sequence avifs # SVG -AddType image/svg+xml svg +AddType image/svg+xml svg svgz # Fonts AddType application/vnd.ms-fontobject eot @@ -60,8 +62,8 @@ AddType application/x-font-otf otf AddType application/x-font-woff woff AddType application/font-woff2 woff2 -# Flash -AddType application/x-shockwave-flash swf +# Manifest +AddType application/manifest+json webmanifest # Archives and exports AddType application/zip gzip @@ -72,7 +74,7 @@ AddType application/xml xml <IfModule mod_headers.c> - <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|html|json)$> + <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|webp|avif|avifs|js|css|eot|ttf|otf|woff|woff2|html|json|webmanifest)$> Header append Cache-Control public </FilesMatch> @@ -100,6 +102,12 @@ AddType application/xml xml ExpiresByType application/zip "access plus 0 seconds" ExpiresByType application/x-gzip "access plus 0 seconds" ExpiresByType application/x-bzip2 "access plus 0 seconds" + + # Manifest + <FilesMatch \.(webmanifest)$> + ExpiresDefault "access plus 0 seconds" + </FilesMatch> + ExpiresByType application/manifest+json "access plus 0 seconds" # CSS, JavaScript, html <FilesMatch \.(css|js|html|json)$> @@ -111,7 +119,7 @@ AddType application/xml xml ExpiresByType application/json "access plus 1 year" # Favicon, images, flash - <FilesMatch \.(ico|gif|png|jpg|jpeg|swf|svg)$> + <FilesMatch \.(ico|gif|png|jpg|jpeg|svg|svgz|webp|avif|avifs)$> ExpiresDefault "access plus 1 year" </FilesMatch> ExpiresByType image/gif "access plus 1 year" @@ -119,6 +127,9 @@ AddType application/xml xml ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" + ExpiresByType image/webp "access plus 1 year" + ExpiresByType image/avif "access plus 1 year" + ExpiresByType image/avif-sequence "access plus 1 year" # Fonts <FilesMatch \.(eot|ttf|otf|svg|woff|woff2)$> @@ -129,5 +140,7 @@ AddType application/xml xml ExpiresByType application/x-font-otf "access plus 1 year" ExpiresByType application/x-font-woff "access plus 1 year" ExpiresByType application/font-woff2 "access plus 1 year" + ExpiresByType font/opentype "access plus 1 year" + ExpiresByType font/truetype "access plus 1 year" </IfModule> diff --git a/setup/config/application.config.php b/setup/config/application.config.php index a293e20219b27..7a55e71560f1e 100644 --- a/setup/config/application.config.php +++ b/setup/config/application.config.php @@ -4,14 +4,11 @@ * See COPYING.txt for license details. */ +use Magento\Setup\Di\MagentoDiFactory; use Magento\Setup\Mvc\Bootstrap\InitParamListener; -use Laminas\Mvc\Service\DiAbstractServiceFactoryFactory; -use Laminas\ServiceManager\Di\DiAbstractServiceFactory; return [ - 'modules' => [ - 'Magento\Setup', - ], + 'modules' => require __DIR__ . '/modules.config.php', 'module_listener_options' => [ 'module_paths' => [ __DIR__ . '/../src', @@ -25,12 +22,13 @@ ], 'service_manager' => [ 'factories' => [ - DiAbstractServiceFactory::class => DiAbstractServiceFactoryFactory::class, InitParamListener::BOOTSTRAP_PARAM => InitParamListener::class, + \Magento\Framework\App\MaintenanceMode::class => MagentoDiFactory::class, + \Magento\Setup\Model\ConfigGenerator::class => MagentoDiFactory::class, + \Magento\Indexer\Console\Command\IndexerReindexCommand::class => MagentoDiFactory::class, + \Symfony\Component\Console\Helper\TableFactory::class => MagentoDiFactory::class, + \Magento\Deploy\Console\InputValidator::class => MagentoDiFactory::class, + \Magento\Framework\App\State::class => MagentoDiFactory::class, ], - ], - // list of Magento specific required services, like default abstract factory - 'required_services' => [ - DiAbstractServiceFactory::class ] ]; diff --git a/setup/config/di.config.php b/setup/config/di.config.php index ccbf3b51fe1c2..c3abe439f65f1 100644 --- a/setup/config/di.config.php +++ b/setup/config/di.config.php @@ -17,9 +17,9 @@ use Magento\Framework\Setup\Declaration\Schema\SchemaConfig; return [ - 'di' => [ - 'instance' => [ - 'preference' => [ + 'dependencies' => [ + 'auto' => [ + 'preferences' => [ EventManagerInterface::class => 'EventManager', ServiceLocatorInterface::class => ServiceManager::class, LoggerInterface::class => Quiet::class, @@ -27,14 +27,16 @@ DriverInterface::class => \Magento\Framework\Filesystem\Driver\File::class, ComponentRegistrarInterface::class => ComponentRegistrar::class, ], - SchemaConfig::class => [ - 'parameters' => [ - 'connectionScopes' => [ - 'default', - 'checkout', - 'sales' + 'types' => [ + SchemaConfig::class => [ + 'parameters' => [ + 'connectionScopes' => [ + 'default', + 'checkout', + 'sales' + ] ] - ] + ], ], ], ], diff --git a/setup/config/module.config.php b/setup/config/module.config.php index 9ed7b9b839131..f1a23f3518084 100644 --- a/setup/config/module.config.php +++ b/setup/config/module.config.php @@ -12,25 +12,10 @@ 'template_path_stack' => [ 'setup' => __DIR__ . '/../view', ], - 'strategies' => ['ViewJsonStrategy'], - ], - 'translator' => [ - 'translation_file_patterns' => [ - [ - 'type' => 'gettext', - 'base_dir' => __DIR__ . '/../lang', - 'pattern' => '%s.mo', - ], - ], - ], - 'service_manager' => [ - 'aliases' => [ - 'translator' => 'MvcTranslator' - ] ], 'controllers' => [ - 'abstract_factories' => [ - \Zend\Mvc\Controller\LazyControllerAbstractFactory::class, + 'factories' => [ + \Magento\Setup\Controller\Index::class => \Laminas\ServiceManager\AbstractFactory\ReflectionBasedAbstractFactory::class, ], ], ]; diff --git a/setup/config/modules.config.php b/setup/config/modules.config.php new file mode 100644 index 0000000000000..9396d1511fdfa --- /dev/null +++ b/setup/config/modules.config.php @@ -0,0 +1,15 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +/** + * List of enabled modules for this application. + * + * This should be an array of module namespaces used in the application. + */ +return [ + 'Magento\Setup', + 'Laminas\Di', + 'Laminas\Router', +]; diff --git a/setup/config/router.config.php b/setup/config/router.config.php index de78555a69474..0817752498c18 100644 --- a/setup/config/router.config.php +++ b/setup/config/router.config.php @@ -17,21 +17,6 @@ ], ], ], - 'setup' => [ - 'type' => 'Segment', - 'options' => [ - 'route' => '[/:controller[/:action]]', - 'defaults' => [ - '__NAMESPACE__' => 'Magento\Setup\Controller', - 'controller' => 'Index', - 'action' => 'index', - ], - 'constraints' => [ - 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', - 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', - ], - ], - ], ], ], ]; diff --git a/setup/config/states.install.config.php b/setup/config/states.install.config.php deleted file mode 100644 index 5d1b7c8fa150f..0000000000000 --- a/setup/config/states.install.config.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -//phpcs:ignore -$base = basename($_SERVER['SCRIPT_FILENAME']); - -return [ - 'navLandingTitles' => [ - 'install' => 'Magento', - ], - 'navLanding' => [ - [ - 'id' => 'root', - 'step' => 0, - 'views' => ['root' => []], - ], - [ - 'id' => 'root.license', - 'url' => 'license', - 'templateUrl' => "$base/license", - 'title' => 'License', - 'main' => true, - 'nav' => false, - 'order' => -1, - 'type' => 'install' - ], - [ - 'id' => 'root.landing', - 'url' => 'landing', - 'templateUrl' => "$base/landing", - 'title' => 'Magento', - 'controller' => 'landingController', - 'main' => true, - 'default' => true, - 'order' => 0, - 'type' => 'install' - ], - ], -]; diff --git a/setup/performance-toolkit/README.md b/setup/performance-toolkit/README.md index 77b40c84595e3..108872555a40d 100644 --- a/setup/performance-toolkit/README.md +++ b/setup/performance-toolkit/README.md @@ -1,6 +1,4 @@ -## Performance Toolkit - -## Overview +# 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). @@ -12,6 +10,7 @@ The Performance Toolkit enables you to test the performance of your Magento inst - 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. @@ -29,18 +28,19 @@ Splitting generation and indexation processes doesn't reduce total processing ti 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.3/config-guide/cli/config-cli-subcommands-perf-data.html). +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.` +- "Admin Account Sharing" is enabled + + `Follow Stores > Configuration > Advanced > Admin > Security. + Set Admin Account Sharing to Yes.` - - Indexers setup in "Update by schedule" mode: +- Indexers setup in "Update by schedule" mode: - `Follow System > Tool > Index Management - Set "Update by schedule" for all idexers` + `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. @@ -187,7 +187,6 @@ Parameters for Combined Benchmark pool: | 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}` @@ -205,11 +204,13 @@ To get more details about available JMeter options, read [Non-GUI Mode](http://j 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. + +- 10% - admin products grid browsing activities. - 90% - admin product creation activities. cd {JMeter path}/bin/ @@ -217,7 +218,6 @@ For example, you can run the B2C scenario via console with: 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 | @@ -289,34 +289,48 @@ For more details, read [Summary Report](http://jmeter.apache.org/usermanual/comp `benchmark.jmx` scenario has the following pools: -**Frontend Pool** (frontendPoolUsers) +- **Frontend Pool** (frontendPoolUsers) + +- **Admin Pool** (adminPoolUsers) + +- **CSR Pool** (csrPoolUsers) -**Admin Pool** (adminPoolUsers) +- **API Pool** (apiPoolUsers) -**CSR Pool** (csrPoolUsers) +- **One Thread Scenarios Pool** (oneThreadScenariosPoolUsers) -**API Pool** (apiPoolUsers) +- **GraphQL Pool** (graphQLPoolUsers) -**One Thread Scenarios Pool** (oneThreadScenariosPoolUsers) +- **Combined Benchmark Pool** (combinedBenchmarkPoolUsers) -**GraphQL Pool** (graphQLPoolUsers) +- **Legacy Threads** -**Combined Benchmark Pool** (combinedBenchmarkPoolUsers) +- **Legacy Scenario** -**Legacy Threads** +#### 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** +#### 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 diff --git a/setup/performance-toolkit/benchmark.jmx b/setup/performance-toolkit/benchmark.jmx index 22f2c25135c3a..423b1de1e62bc 100644 --- a/setup/performance-toolkit/benchmark.jmx +++ b/setup/performance-toolkit/benchmark.jmx @@ -104,6 +104,16 @@ <stringProp name="Argument.value">${__P(combinedBenchmarkPoolUsers,0)}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> + <elementProp name="restAPIcombinedBenchmarkPoolUsers" elementType="Argument"> + <stringProp name="Argument.name">restAPIcombinedBenchmarkPoolUsers</stringProp> + <stringProp name="Argument.value">${__P(restAPIcombinedBenchmarkPoolUsers,0)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + <elementProp name="graphQLcombinedBenchmarkPoolUsers" elementType="Argument"> + <stringProp name="Argument.name">graphQLcombinedBenchmarkPoolUsers</stringProp> + <stringProp name="Argument.value">${__P(graphQLcombinedBenchmarkPoolUsers,0)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> <elementProp name="accountManagementPercentage" elementType="Argument"> <stringProp name="Argument.name">accountManagementPercentage</stringProp> <stringProp name="Argument.value">${__P(accountManagementPercentage,0)}</stringProp> @@ -2488,7 +2498,7 @@ vars.putObject("category", categories[number]); customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); if (customerUser == null) { - SampleResult.setResponseMessage("customernUser list is empty"); + SampleResult.setResponseMessage("customerUser list is empty"); SampleResult.setResponseData("customerUser list is empty","UTF-8"); IsSuccess=false; SampleResult.setSuccessful(false); @@ -5212,7 +5222,7 @@ vars.putObject("randomIntGenerator", random); customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); if (customerUser == null) { - SampleResult.setResponseMessage("customernUser list is empty"); + SampleResult.setResponseMessage("customerUser list is empty"); SampleResult.setResponseData("customerUser list is empty","UTF-8"); IsSuccess=false; SampleResult.setSuccessful(false); @@ -7505,7 +7515,7 @@ vars.putObject("category", categories[number]); customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); if (customerUser == null) { - SampleResult.setResponseMessage("customernUser list is empty"); + SampleResult.setResponseMessage("customerUser list is empty"); SampleResult.setResponseData("customerUser list is empty","UTF-8"); IsSuccess=false; SampleResult.setSuccessful(false); @@ -8818,7 +8828,7 @@ vars.putObject("randomIntGenerator", random); customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); if (customerUser == null) { - SampleResult.setResponseMessage("customernUser list is empty"); + SampleResult.setResponseMessage("customerUser list is empty"); SampleResult.setResponseData("customerUser list is empty","UTF-8"); IsSuccess=false; SampleResult.setSuccessful(false); @@ -9341,7 +9351,7 @@ vars.putObject("category", categories[number]); customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); if (customerUser == null) { - SampleResult.setResponseMessage("customernUser list is empty"); + SampleResult.setResponseMessage("customerUser list is empty"); SampleResult.setResponseData("customerUser list is empty","UTF-8"); IsSuccess=false; SampleResult.setSuccessful(false); @@ -10466,7 +10476,7 @@ if (tmpLabel) { customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); if (customerUser == null) { - SampleResult.setResponseMessage("customernUser list is empty"); + SampleResult.setResponseMessage("customerUser list is empty"); SampleResult.setResponseData("customerUser list is empty","UTF-8"); IsSuccess=false; SampleResult.setSuccessful(false); @@ -26402,9 +26412,7 @@ vars.put("product_sku", product.get("sku")); <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "storeId": 1 -}</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -26677,27 +26685,6 @@ vars.put("product_sku", product.get("sku")); <stringProp name="HTTPSampler.embedded_url_re"/> <stringProp name="TestPlan.comments">tool/fragments/ce/api/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Referer</stringProp> - <stringProp name="Header.value">${base_path}checkout/onepage/</stringProp> - </elementProp> - <elementProp name="Content-Type" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> - </elementProp> - <elementProp name="X-Requested-With" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> <stringProp name="-297987887">"[0-9]+"</stringProp> @@ -27157,13 +27144,13 @@ if (tmpLabel) { </hashTree> - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="One Thread Scenarios Pool" enabled="true"> + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="GraphQL Pool" enabled="true"> <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> <boolProp name="LoopController.continue_forever">false</boolProp> <stringProp name="LoopController.loops">${loops}</stringProp> </elementProp> - <stringProp name="ThreadGroup.num_threads">${oneThreadScenariosPoolUsers}</stringProp> + <stringProp name="ThreadGroup.num_threads">${graphQLPoolUsers}</stringProp> <stringProp name="ThreadGroup.ramp_time">${ramp_period}</stringProp> <longProp name="ThreadGroup.start_time">1505803944000</longProp> <longProp name="ThreadGroup.end_time">1505803944000</longProp> @@ -27172,11 +27159,11 @@ if (tmpLabel) { <stringProp name="ThreadGroup.delay"/> <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> <hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Import Products" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get List of Products by category_id" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${importProductsPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetListOfProductsByCategoryIdPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -27202,263 +27189,351 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "Import Products"); + vars.put("testLabel", "GraphQL Get List of Products by category_id"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> - <stringProp name="script"> - 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"); + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; - currentFormKey = getFormKeyFromResponse(); +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } +vars.putObject("randomIntGenerator", random); </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> - <hashTree/> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - } - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PreProcessor> - <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"/> - <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> - <hashTree/> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> - <hashTree> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -adminUser = "none"; -adminUserList = props.get("adminUserList"); -adminUserListIterator = props.get("adminUserListIterator"); -adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">random = vars.getObject("randomIntGenerator"); - adminUser = adminUserListIterator.next(); -} +var categories = props.get("categories"); +number = random.nextInt(categories.length); -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); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> +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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1397214398">Welcome</stringProp> - <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + <stringProp name="1201352014">"name":"${category_name}","id":${category_id},</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_form_key</stringProp> - </ResponseAssertion> - <hashTree/> </hashTree> + </hashTree> + - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Simple Product Details by product_url_key" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetSimpleProductDetailsByProductUrlKeyPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Get Simple Product Details by product_url_key"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Simple Product Details by product_url_key" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="dummy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> - <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> </hashTree> </hashTree> + - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Simple Product Details by name" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetSimpleProductDetailsByNamePercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="BeanShellSampler.query">vars.put("entity", "catalog_product"); -String behavior = "${adminImportProductBehavior}"; -vars.put("adminImportBehavior", behavior); -String filepath = "${files_folder}${adminImportProductFilePath}"; -vars.put("adminImportFilePath", filepath); </stringProp> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Get Simple Product Details by name"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/import_products/setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Simple Product Details by name" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/import.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1723813687">Import Settings</stringProp> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> @@ -27466,239 +27541,272 @@ vars.put("adminImportFilePath", filepath); </stringProp> </ResponseAssertion> <hashTree/> </hashTree> + </hashTree> + - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Validate" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="entity" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${entity}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">entity</stringProp> - </elementProp> - <elementProp name="behavior" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${adminImportBehavior}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">behavior</stringProp> - </elementProp> - <elementProp name="validation_strategy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">validation-stop-on-errors</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">validation_strategy</stringProp> - </elementProp> - <elementProp name="allowed_error_count" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">10</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">allowed_error_count</stringProp> - </elementProp> - <elementProp name="_import_field_separator" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">,</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_import_field_separator</stringProp> - </elementProp> - <elementProp name="_import_multiple_value_separator" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">,</stringProp> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Configurable Product Detail by product_url_key" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetConfigurableProductDetailsByProductUrlKeyPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Get Configurable Product Detail by product_url_key"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by product_url_key" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_import_multiple_value_separator</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/validate</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> - <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> - <collectionProp name="HTTPFileArgs.files"> - <elementProp name="${adminImportFilePath}" elementType="HTTPFileArg"> - <stringProp name="File.path">${adminImportFilePath}</stringProp> - <stringProp name="File.paramname">import_file</stringProp> - <stringProp name="File.mimetype">application/vnd.ms-excel</stringProp> - </elementProp> - </collectionProp> - </elementProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_validate.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="37280142">File is valid! To start import process</stringProp> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> </hashTree> + </hashTree> + - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Start" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Configurable Product Detail by name" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetConfigurableProductDetailsByNamePercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Get Configurable Product Detail by name"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="entity" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${entity}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">entity</stringProp> - </elementProp> - <elementProp name="behavior" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${adminImportBehavior}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">behavior</stringProp> - </elementProp> - <elementProp name="validation_strategy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">validation-stop-on-errors</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">validation_strategy</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="allowed_error_count" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">10</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">allowed_error_count</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="_import_field_separator" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">,</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_import_field_separator</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="_import_multiple_value_separator" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">,</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_import_multiple_value_separator</stringProp> - <stringProp name="Argument.desc">false</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/start</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> - <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> - <collectionProp name="HTTPFileArgs.files"> - <elementProp name="${adminImportFilePath}" elementType="HTTPFileArg"> - <stringProp name="File.path">${adminImportFilePath}</stringProp> - <stringProp name="File.paramname">import_file</stringProp> - <stringProp name="File.mimetype">application/vnd.ms-excel</stringProp> - </elementProp> - </collectionProp> - </elementProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_save.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1731221824">Import successfully done</stringProp> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> </hashTree> </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - </hashTree> - </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Import Customers" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Product Search by text and category_id" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${importCustomersPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetProductSearchByTextAndCategoryIdPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -27724,503 +27832,129 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "Import Customers"); + vars.put("testLabel", "GraphQL Get Product Search by text and category_id"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> - <stringProp name="script"> - 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"); + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; - currentFormKey = getFormKeyFromResponse(); +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } +vars.putObject("randomIntGenerator", random); </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> - <hashTree/> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - } - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PreProcessor> - <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"/> - <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> - <hashTree/> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> - <hashTree> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -adminUser = "none"; -adminUserList = props.get("adminUserList"); -adminUserListIterator = props.get("adminUserListIterator"); -adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">random = vars.getObject("randomIntGenerator"); - adminUser = adminUserListIterator.next(); -} +var categories = props.get("categories"); +number = random.nextInt(categories.length); -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); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> +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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Product Search by text and category_id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1397214398">Welcome</stringProp> - <stringProp name="-515240035"><title>Magento Admin</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_form_key</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="dummy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> - <hashTree/> - </hashTree> - </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="BeanShellSampler.query">vars.put("entity", "customer"); -String behavior = "${adminImportCustomerBehavior}"; -vars.put("adminImportBehavior", behavior); -String filepath = "${files_folder}${adminImportCustomerFilePath}"; -vars.put("adminImportFilePath", filepath); </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/import_customers/setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/import.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1723813687">Import Settings</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Validate" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="entity" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${entity}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">entity</stringProp> - </elementProp> - <elementProp name="behavior" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${adminImportBehavior}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">behavior</stringProp> - </elementProp> - <elementProp name="validation_strategy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">validation-stop-on-errors</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">validation_strategy</stringProp> - </elementProp> - <elementProp name="allowed_error_count" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">10</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">allowed_error_count</stringProp> - </elementProp> - <elementProp name="_import_field_separator" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">,</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_import_field_separator</stringProp> - </elementProp> - <elementProp name="_import_multiple_value_separator" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">,</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_import_multiple_value_separator</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/validate</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> - <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> - <collectionProp name="HTTPFileArgs.files"> - <elementProp name="${adminImportFilePath}" elementType="HTTPFileArg"> - <stringProp name="File.path">${adminImportFilePath}</stringProp> - <stringProp name="File.paramname">import_file</stringProp> - <stringProp name="File.mimetype">application/vnd.ms-excel</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_validate.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="37280142">File is valid! To start import process</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Start" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="entity" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${entity}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">entity</stringProp> - </elementProp> - <elementProp name="behavior" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${adminImportBehavior}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">behavior</stringProp> - </elementProp> - <elementProp name="validation_strategy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">validation-stop-on-errors</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">validation_strategy</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="allowed_error_count" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">10</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">allowed_error_count</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="_import_field_separator" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">,</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_import_field_separator</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="_import_multiple_value_separator" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">,</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_import_multiple_value_separator</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/start</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> - <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> - <collectionProp name="HTTPFileArgs.files"> - <elementProp name="${adminImportFilePath}" elementType="HTTPFileArg"> - <stringProp name="File.path">${adminImportFilePath}</stringProp> - <stringProp name="File.paramname">import_file</stringProp> - <stringProp name="File.mimetype">application/vnd.ms-excel</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_save.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1731221824">Import successfully done</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> - </ResponseAssertion> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> <hashTree/> </hashTree> </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - </hashTree> - </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="API" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Category List by category_id" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${apiSinglePercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -28246,7 +27980,7 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "API"); + vars.put("testLabel", "GraphQL Get Category List by category_id"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> @@ -28266,24 +28000,62 @@ if (tmpLabel) { <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List by category_id" enabled="true"> <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -28291,44 +28063,51 @@ if (tmpLabel) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_category_list_by_category_id.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> - <stringProp name="VAR">admin_token</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_token</stringProp> - </ResponseAssertion> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert found categories" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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); + } + } + +} + +</stringProp> + </JSR223Assertion> <hashTree/> </hashTree> + </hashTree> + - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Authorization</stringProp> - <stringProp name="Header.value">Bearer ${admin_token}</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> - <hashTree/> - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="API Process Orders" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Category List by category_url_key" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">100</stringProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -28354,139 +28133,80 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "API Process Orders"); + vars.put("testLabel", "GraphQL Get Category List by category_url_key"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="BeanShellSampler.query">// Each thread gets an equal number of orders, based on how many orders are available. + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; - int ordersPerThread = 1; - int apiProcessOrders = Integer.parseInt("${apiProcessOrders}"); - if (apiProcessOrders > 0) { - ordersPerThread = apiProcessOrders; - } +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} - threadNum = ${__threadNum}; - vars.put("ordersPerThread", String.valueOf(ordersPerThread)); - vars.put("threadNum", String.valueOf(threadNum)); +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">random = vars.getObject("randomIntGenerator"); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/setup.jmx</stringProp></BeanShellSampler> +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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Orders" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List by category_url_key" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="searchCriteria[filterGroups][0][filters][0][field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">status</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][field]</stringProp> - </elementProp> - <elementProp name="searchCriteria[filterGroups][0][filters][0][value]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Pending</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][value]</stringProp> - </elementProp> - <elementProp name="searchCriteria[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${ordersPerThread}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">searchCriteria[pageSize]</stringProp> - </elementProp> - <elementProp name="searchCriteria[current_page]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${threadNum}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">searchCriteria[current_page]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/orders</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/get_orders.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract entity ids" enabled="true"> - <stringProp name="VAR">entity_ids</stringProp> - <stringProp name="JSONPATH">$.items[*].entity_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - </hashTree> - - <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Order" enabled="true"> - <stringProp name="ForeachController.inputVal">entity_ids</stringProp> - <stringProp name="ForeachController.returnVal">order_id</stringProp> - <boolProp name="ForeachController.useSeparator">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/for_each_order.jmx</stringProp></ForeachController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Invoice" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/order/${order_id}/invoice</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/create_invoice.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="34237953">"\d+"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Shipment" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/order/${order_id}/ship</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -28494,27 +28214,52 @@ if (tmpLabel) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/create_shipment.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_category_list_by_category_url_key.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="34237953">"\d+"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert found categories" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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); + } + } + +} + +</stringProp> + </JSR223Assertion> <hashTree/> </hashTree> </hashTree> - </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="API Product Attribute Management" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Multiple Categories" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">100</stringProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -28540,222 +28285,96 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "API Product Attribute Management"); + vars.put("testLabel", "GraphQL Get Multiple Categories"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create attribute set" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "attributeSet": { - "attribute_set_name": "new_attribute_set_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "sort_order": 500 - }, - "skeletonId": "4" -}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attribute-sets/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_attribute_set.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute_set_id" enabled="true"> - <stringProp name="VAR">attribute_set_id</stringProp> - <stringProp name="JSONPATH">$.attribute_set_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert attribute_set_id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">attribute_set_id</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create attribute group" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "group": { - "attribute_group_name": "empty_attribute_group_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "attribute_set_id": ${attribute_set_id} - } -}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attribute-sets/groups</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_attribute_group.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute_group_id" enabled="true"> - <stringProp name="VAR">attribute_group_id</stringProp> - <stringProp name="JSONPATH">$.attribute_group_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert attribute_group_id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">attribute_set_id</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create attribute" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "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 - } -}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_attribute.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute_id" enabled="true"> - <stringProp name="VAR">attribute_id</stringProp> - <stringProp name="JSONPATH">$.attribute_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute_code" enabled="true"> - <stringProp name="VAR">attribute_code</stringProp> - <stringProp name="JSONPATH">$.attribute_code</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert attribute_id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">attribute_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert attribute_code not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2131456825">^[a-z0-9-_]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">attribute_code</stringProp> - </ResponseAssertion> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - </hashTree> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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); +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_multiple_categories_setup.jmx</stringProp> + </JSR223Sampler> + <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add attribute to attribute set" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get multiple categories by ID" enabled="true"> <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "attributeSetId": "${attribute_set_id}", - "attributeGroupId": "${attribute_group_id}", - "attributeCode": "${attribute_code}", - "sortOrder": 3 -}</stringProp> + <stringProp name="Argument.value">{"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}"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attribute-sets/attributes</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -28763,27 +28382,37 @@ if (tmpLabel) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/add_attribute_to_attribute_set.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_multiple_categories_by_id.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert response is not null" enabled="true"> - <stringProp name="JSON_PATH">$</stringProp> - <stringProp name="EXPECTED_VALUE">(\d+)</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert category count" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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); +} +</stringProp> + </JSR223Assertion> <hashTree/> </hashTree> </hashTree> - </hashTree> - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Admin Category Management" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Categories Query: Get Multiple Categories By Id" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${adminCategoryManagementPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -28809,1031 +28438,488 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "Admin Category Management"); + vars.put("testLabel", "GraphQL Categories Query: Get Multiple Categories By Id"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> - <hashTree/> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - } - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PreProcessor> - <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"/> - <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> - <hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -adminUser = "none"; -adminUserList = props.get("adminUserList"); -adminUserListIterator = props.get("adminUserListIterator"); -adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; - adminUser = adminUserListIterator.next(); +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); } -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); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1397214398">Welcome</stringProp> - <stringProp name="-515240035"><title>Magento Admin</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_form_key</stringProp> - </ResponseAssertion> +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="dummy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> - <hashTree/> - </hashTree> - </hashTree> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Category Management" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_category_management/admin_category_management.jmx</stringProp> -</TestFragmentController> - <hashTree> - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Set Arguments" enabled="true"> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="parameters"/> <stringProp name="filename"/> <stringProp name="cacheKey"/> - <stringProp name="script">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(); + <stringProp name="script">random = vars.getObject("randomIntGenerator"); +var categories = props.get("categories"); -for (i = 1; i<= productsVariationsSize; i++) { - var productVariablePrefix = "simple_product_" + i + "_"; - number = getNextProductNumber(i); - simpleList = props.get("simple_products_list_for_edit").get(number); +var numbers = []; - vars.put(productVariablePrefix + "url_key", simpleList.get("url_key")); - vars.put(productVariablePrefix + "id", simpleList.get("id")); - vars.put(productVariablePrefix + "name", simpleList.get("title")); +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); } -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));</stringProp> +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); +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_multiple_categories_setup.jmx</stringProp> </JSR223Sampler> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="[categories query] Get multiple categories by ID" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/categories_query_get_multiple_categories_by_id.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="Accept-Language" elementType="Header"> - <stringProp name="Header.name">Accept-Language</stringProp> - <stringProp name="Header.value">en-US,en;q=0.5</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> - </elementProp> - <elementProp name="User-Agent" elementType="Header"> - <stringProp name="Header.name">User-Agent</stringProp> - <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> - </elementProp> - <elementProp name="Accept-Encoding" elementType="Header"> - <stringProp name="Header.name">Accept-Encoding</stringProp> - <stringProp name="Header.value">gzip, deflate</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert category count" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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); +} +</stringProp> + </JSR223Assertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select parent category" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Categories Query: Get Many Categories with Pagination" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Categories Query: Get Many Categories with Pagination"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${parent_category_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="Accept-Language" elementType="Header"> - <stringProp name="Header.name">Accept-Language</stringProp> - <stringProp name="Header.value">en-US,en;q=0.5</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> - </elementProp> - <elementProp name="User-Agent" elementType="Header"> - <stringProp name="Header.name">User-Agent</stringProp> - <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> - </elementProp> - <elementProp name="Accept-Encoding" elementType="Header"> - <stringProp name="Header.name">Accept-Encoding</stringProp> - <stringProp name="Header.value">gzip, deflate</stringProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="[categories query] Get many categories by name" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> - </HeaderManager> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open new category page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/add/store/0/parent/${parent_category_id}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/categories_query_get_many_categories_by_name_match.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1903925024"><title>New Category</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert category count" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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); +} +</stringProp> + </JSR223Assertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create category" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">id</stringProp> - </elementProp> - <elementProp name="parent" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${parent_category_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">parent</stringProp> - </elementProp> - <elementProp name="path" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">path</stringProp> - </elementProp> - <elementProp name="store_id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">store_id</stringProp> - </elementProp> - <elementProp name="is_active" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">is_active</stringProp> - </elementProp> - <elementProp name="include_in_menu" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">include_in_menu</stringProp> - </elementProp> - <elementProp name="is_anchor" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">is_anchor</stringProp> - </elementProp> - <elementProp name="use_config[available_sort_by]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">use_config[available_sort_by]</stringProp> - </elementProp> - <elementProp name="use_config[default_sort_by]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">use_config[default_sort_by]</stringProp> - </elementProp> - <elementProp name="use_config[filter_price_range]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">use_config[filter_price_range]</stringProp> - </elementProp> - <elementProp name="use_default[url_key]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">use_default[url_key]</stringProp> - </elementProp> - <elementProp name="url_key_create_redirect" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">url_key_create_redirect</stringProp> - </elementProp> - <elementProp name="custom_use_parent_settings" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">custom_use_parent_settings</stringProp> - </elementProp> - <elementProp name="custom_apply_to_products" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">custom_apply_to_products</stringProp> - </elementProp> - <elementProp name="name" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Admin Category Management ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">name</stringProp> - </elementProp> - <elementProp name="url_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">admin-category-management-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">url_key</stringProp> - </elementProp> - <elementProp name="meta_title" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">meta_title</stringProp> - </elementProp> - <elementProp name="description" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">description</stringProp> - </elementProp> - <elementProp name="display_mode" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">PRODUCTS</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">display_mode</stringProp> - </elementProp> - <elementProp name="default_sort_by" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">position</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">default_sort_by</stringProp> - </elementProp> - <elementProp name="meta_keywords" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">meta_keywords</stringProp> - </elementProp> - <elementProp name="meta_description" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">meta_description</stringProp> - </elementProp> - <elementProp name="custom_layout_update" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">custom_layout_update</stringProp> - </elementProp> - <elementProp name="category_products" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"${simple_product_1_id}":"","${simple_product_2_id}":"","${simple_product_3_id}":"","${simple_product_4_id}":"","${simple_product_5_id}":""}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">category_products</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/save/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">URL</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_id</stringProp> - <stringProp name="RegexExtractor.regex">/catalog/category/edit/id/(\d+)/</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Url Info by url_key" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlUrlInfoByUrlKeyPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_id</stringProp> - </ResponseAssertion> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Get Url Info by url_key"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select created category" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${admin_category_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="Accept-Language" elementType="Header"> - <stringProp name="Header.name">Accept-Language</stringProp> - <stringProp name="Header.value">en-US,en;q=0.5</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> - </elementProp> - <elementProp name="User-Agent" elementType="Header"> - <stringProp name="Header.name">User-Agent</stringProp> - <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> - </elementProp> - <elementProp name="Accept-Encoding" elementType="Header"> - <stringProp name="Header.name">Accept-Encoding</stringProp> - <stringProp name="Header.value">gzip, deflate</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category row id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_entity_id</stringProp> - <stringProp name="RegexExtractor.regex">"entity_id":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category attribute set id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_attribute_set_id</stringProp> - <stringProp name="RegexExtractor.regex">"attribute_set_id":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category parent Id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_parent_id</stringProp> - <stringProp name="RegexExtractor.regex">"parent_id":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category created at" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_created_at</stringProp> - <stringProp name="RegexExtractor.regex">"created_at":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category updated at" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_updated_at</stringProp> - <stringProp name="RegexExtractor.regex">"updated_at":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category path" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_path</stringProp> - <stringProp name="RegexExtractor.regex">"entity_id":(.+)"path":"([^\"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$2$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category level" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_level</stringProp> - <stringProp name="RegexExtractor.regex">"level":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category name" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_name</stringProp> - <stringProp name="RegexExtractor.regex">"entity_id":(.+)"name":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$2$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_url_key</stringProp> - <stringProp name="RegexExtractor.regex">"url_key":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url path" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_url_path</stringProp> - <stringProp name="RegexExtractor.regex">"url_path":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category row id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_entity_id</stringProp> - </ResponseAssertion> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Url Info by url_key" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"query":"query resolveUrl($urlKey: String!) {\n urlResolver(url: $urlKey) {\n type\n id\n }\n}","variables":{"urlKey":"${category_url_key}${url_suffix}"},"operationName":"resolveUrl"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_url_info_by_url_key.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1062388959">{"type":"CATEGORY","id":${category_id}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Cms Page by id" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetCmsPageByIdPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category attribute set id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_attribute_set_id</stringProp> - </ResponseAssertion> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Get Cms Page by id"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category parent id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_parent_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category created at" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_created_at</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category updated at" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_updated_at</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category path" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="59022110">^[\d\\\/]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_path</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category level" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_level</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category name" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_name</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url key" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_url_key</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url path" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_url_path</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert products added" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="417284990">${simple_product_1_name}</stringProp> - <stringProp name="1304788671">${simple_product_2_name}</stringProp> - <stringProp name="-2102674944">${simple_product_3_name}</stringProp> - <stringProp name="-1215171263">${simple_product_4_name}</stringProp> - <stringProp name="-327667582">${simple_product_5_name}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Move category" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_category_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">id</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="point" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">append</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">point</stringProp> - </elementProp> - <elementProp name="pid" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${new_parent_category_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">pid</stringProp> - </elementProp> - <elementProp name="paid" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${parent_category_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paid</stringProp> - </elementProp> - <elementProp name="aid" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">aid</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - </elementProp> - </collectionProp> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/move/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete category" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - </collectionProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/delete/id/${admin_category_id}/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category deleted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1277069529">You deleted the category.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> - <intProp name="ActionProcessor.action">1</intProp> - <intProp name="ActionProcessor.target">0</intProp> - <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCategoryManagementDelay}*1000))}</stringProp> - </TestAction> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - </hashTree> - </hashTree> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare CMS Page" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">random = vars.getObject("randomIntGenerator"); + +var cmsPages = props.get("cms_pages"); +var number = random.nextInt(cmsPages.length); + +vars.put("cms_page_id", cmsPages[number].id); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/prepare_cms_page.jmx</stringProp></JSR223Sampler> + <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cms Page by id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> <hashTree> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - </hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> + <stringProp name="EXPECTED_VALUE">${cms_page_id}</stringProp> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Admin Promotion Rules" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Navigation Menu by category_id" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${adminPromotionRulesPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetNavigationMenuByCategoryIdPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -29859,671 +28945,108 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "Admin Promotion Rules"); + vars.put("testLabel", "GraphQL Get Navigation Menu by category_id"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> - <stringProp name="script"> - 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"); + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; - currentFormKey = getFormKeyFromResponse(); +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } +vars.putObject("randomIntGenerator", random); </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> - <hashTree/> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - } - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PreProcessor> - <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"/> - <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> - <hashTree/> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> - <hashTree> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -adminUser = "none"; -adminUserList = props.get("adminUserList"); -adminUserListIterator = props.get("adminUserListIterator"); -adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">random = vars.getObject("randomIntGenerator"); - adminUser = adminUserListIterator.next(); -} +var categories = props.get("categories"); +number = random.nextInt(categories.length); -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); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> +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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Navigation Menu by category_id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1397214398">Welcome</stringProp> - <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + <stringProp name="1201352014">"id":${category_id},"name":"${category_name}","product_count"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_form_key</stringProp> - </ResponseAssertion> - <hashTree/> </hashTree> + </hashTree> + - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="dummy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> - <hashTree/> - </hashTree> - </hashTree> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Promotions Management" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx</stringProp> -</TestFragmentController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/new</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New Conditional" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1--1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">id</stringProp> - </elementProp> - <elementProp name="type" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">type</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/newConditionHtml/form/sales_rule_formrule_conditions_fieldset_/form_namespace/sales_rule_form</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="name" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Rule Name ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">name</stringProp> - </elementProp> - <elementProp name="is_active" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">is_active</stringProp> - </elementProp> - <elementProp name="use_auto_generation" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">use_auto_generation</stringProp> - </elementProp> - <elementProp name="is_rss" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">is_rss</stringProp> - </elementProp> - <elementProp name="apply_to_shipping" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">apply_to_shipping</stringProp> - </elementProp> - <elementProp name="stop_rules_processing" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">stop_rules_processing</stringProp> - </elementProp> - <elementProp name="coupon_code" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">coupon_code</stringProp> - </elementProp> - <elementProp name="uses_per_coupon" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">uses_per_coupon</stringProp> - </elementProp> - <elementProp name="uses_per_customer" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">uses_per_customer</stringProp> - </elementProp> - <elementProp name="sort_order" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sort_order</stringProp> - </elementProp> - <elementProp name="discount_amount" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">5</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">discount_amount</stringProp> - </elementProp> - <elementProp name="discount_qty" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">discount_qty</stringProp> - </elementProp> - <elementProp name="discount_step" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">discount_step</stringProp> - </elementProp> - <elementProp name="reward_points_delta" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">reward_points_delta</stringProp> - </elementProp> - <elementProp name="store_labels[0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">store_labels[0]</stringProp> - </elementProp> - <elementProp name="description" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Rule Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">description</stringProp> - </elementProp> - <elementProp name="coupon_type" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">coupon_type</stringProp> - </elementProp> - <elementProp name="simple_action" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">cart_fixed</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">simple_action</stringProp> - </elementProp> - <elementProp name="website_ids[0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">website_ids[0]</stringProp> - </elementProp> - <elementProp name="customer_group_ids[0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer_group_ids[0]</stringProp> - </elementProp> - <elementProp name="from_date" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">from_date</stringProp> - </elementProp> - <elementProp name="to_date" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">to_date</stringProp> - </elementProp> - <elementProp name="rule[conditions][1][type]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Combine</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1][type]</stringProp> - </elementProp> - <elementProp name="rule[conditions][1][aggregator]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">all</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1][aggregator]</stringProp> - </elementProp> - <elementProp name="rule[conditions][1][value]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1][value]</stringProp> - </elementProp> - <elementProp name="rule[conditions][1--1][type]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1--1][type]</stringProp> - </elementProp> - <elementProp name="rule[conditions][1--1][attribute]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">base_subtotal</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1--1][attribute]</stringProp> - </elementProp> - <elementProp name="rule[conditions][1--1][operator]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">>=</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1--1][operator]</stringProp> - </elementProp> - <elementProp name="rule[conditions][1--1][value]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">100</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1--1][value]</stringProp> - </elementProp> - <elementProp name="rule[conditions][1][new_chlid]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1][new_chlid]</stringProp> - </elementProp> - <elementProp name="rule[actions][1][type]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Product\Combine</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[actions][1][type]</stringProp> - </elementProp> - <elementProp name="rule[actions][1][aggregator]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">all</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[actions][1][aggregator]</stringProp> - </elementProp> - <elementProp name="rule[actions][1][value]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[actions][1][value]</stringProp> - </elementProp> - <elementProp name="rule[actions][1][new_child]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[actions][1][new_child]</stringProp> - </elementProp> - <elementProp name="store_labels[1]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">store_labels[1]</stringProp> - </elementProp> - <elementProp name="store_labels[2]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">store_labels[2]</stringProp> - </elementProp> - <elementProp name="related_banners" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">related_banners</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/save/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-396438583">You saved the rule.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> - <intProp name="ActionProcessor.action">1</intProp> - <intProp name="ActionProcessor.target">0</intProp> - <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminPromotionsManagementDelay}*1000))}</stringProp> - </TestAction> - <hashTree/> - </hashTree> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Admin Customer Management" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Create Empty Cart" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${adminCustomerManagementPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlCreateEmptyCartPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -30549,2136 +29072,2196 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "Admin Customer Management"); + vars.put("testLabel", "GraphQL Create Empty Cart"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> - <stringProp name="script"> - 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); - } + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> - <hashTree/> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Empty Cart" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlGetEmptyCartPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> <stringProp name="script"> - 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); - } - } - } +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PreProcessor> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Get Empty Cart"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"/> - <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> - <hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -adminUser = "none"; -adminUserList = props.get("adminUserList"); -adminUserListIterator = props.get("adminUserListIterator"); -adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; - adminUser = adminUserListIterator.next(); +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); } -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); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1397214398">Welcome</stringProp> - <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="1901638450">{"data":{"cart":{"items":[]}}}</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_form_key</stringProp> + <intProp name="Assertion.test_type">8</intProp> </ResponseAssertion> <hashTree/> </hashTree> + </hashTree> + - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Set Shipping Address On Cart" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlSetShippingAddressOnCartPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Set Shipping Address On Cart"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="dummy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1901638450">{"data":{"cart":{"items":[]}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Shipping Address On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> - <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1671866339">{"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"}}]}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> </hashTree> </hashTree> + - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Customer Management" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_customer_management/admin_customer_management.jmx</stringProp> -</TestFragmentController> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Set Billing Address On Cart" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlSetBillingAddressOnCartPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="Accept-Language" elementType="Header"> - <stringProp name="Header.name">Accept-Language</stringProp> - <stringProp name="Header.value">en-US,en;q=0.5</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> - </elementProp> - <elementProp name="User-Agent" elementType="Header"> - <stringProp name="Header.name">User-Agent</stringProp> - <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> - </elementProp> - <elementProp name="Accept-Encoding" elementType="Header"> - <stringProp name="Header.name">Accept-Encoding</stringProp> - <stringProp name="Header.value">gzip, deflate</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Render" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">customer_listing</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - </elementProp> - <elementProp name="search" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">20</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">entity_id</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">asc</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Set Billing Address On Cart"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Render" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">customer_listing</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - </elementProp> - <elementProp name="search" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Lastname</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">20</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">entity_id</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">asc</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - </elementProp> - </collectionProp> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer edit url" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">customer_edit_url_path</stringProp> - <stringProp name="RegexExtractor.regex">actions":\{"edit":\{"href":"(?:http|https):\\/\\/(.*?)\\/customer\\/index\\/edit\\/id\\/(\d+)\\/",</stringProp> - <stringProp name="RegexExtractor.template">/customer/index/edit/id/$2$/</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer edit url" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">customer_edit_url_path</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Customer" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}${customer_edit_url_path}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert edit customer page" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1422614550">Customer Information</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer entity_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_entity_id</stringProp> - <stringProp name="RegexExtractor.regex">"entity_id":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract website_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_website_id</stringProp> - <stringProp name="RegexExtractor.regex">"website_id":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer firstname" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_firstname</stringProp> - <stringProp name="RegexExtractor.regex">"firstname":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1901638450">{"data":{"cart":{"items":[]}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Billing Address On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_billing_address_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1147076914">{"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"}}}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Add Simple Product To Cart" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlAddSimpleProductToCartPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer lastname" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_lastname</stringProp> - <stringProp name="RegexExtractor.regex">"lastname":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Add Simple Product To Cart"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer email" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_email</stringProp> - <stringProp name="RegexExtractor.regex">"email":"([^\@]+@[^.]+.[^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract group_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_group_id</stringProp> - <stringProp name="RegexExtractor.regex">"group_id":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract store_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_store_id</stringProp> - <stringProp name="RegexExtractor.regex">"store_id":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extact created_at" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_created_at</stringProp> - <stringProp name="RegexExtractor.regex">"created_at":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract updated_at" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_updated_at</stringProp> - <stringProp name="RegexExtractor.regex">"updated_at":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract is_active" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_is_active</stringProp> - <stringProp name="RegexExtractor.regex">"is_active":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract disable_auto_group_change" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_disable_auto_group_change</stringProp> - <stringProp name="RegexExtractor.regex">"disable_auto_group_change":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract created_in" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_created_in</stringProp> - <stringProp name="RegexExtractor.regex">"created_in":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract dob" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_dob</stringProp> - <stringProp name="RegexExtractor.regex">"dob":"(\d+)-(\d+)-(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$2$/$3$/$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_billing" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_default_billing</stringProp> - <stringProp name="RegexExtractor.regex">"default_billing":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addSimpleProductsToCart</stringProp> + <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Add Configurable Product To Cart" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlAddConfigurableProductToCartPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_shipping" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_default_shipping</stringProp> - <stringProp name="RegexExtractor.regex">"default_shipping":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Add Configurable Product To Cart"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract gender" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_gender</stringProp> - <stringProp name="RegexExtractor.regex">"gender":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> + <stringProp name="VAR">product_option</stringProp> + <stringProp name="JSONPATH">$.data.products.items[0].variants[0].product.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Configurable Product To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> + <stringProp name="675049292">"sku":"${product_option}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Update Simple Product Qty In Cart" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateSimpleProductQtyInCartPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract failures_num" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_failures_num</stringProp> - <stringProp name="RegexExtractor.regex">"failures_num":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Update Simple Product Qty In Cart"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_entity_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_entity_id</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{"entity_id":"(\d+)".+?"parent_id":"${admin_customer_entity_id}"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_created_at" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_created_at</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"created_at":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_updated_at" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_updated_at</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"updated_at":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_is_active" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_is_active</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"is_active":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_city" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_city</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"city":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_country_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_country_id</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"country_id":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_firstname" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_firstname</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"firstname":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_lastname" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_lastname</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"lastname":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_postcode" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_postcode</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"postcode":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_region</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_region_id</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region_id":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address street" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_street</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"street":\["([^"]+)"\]</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_telephone" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_telephone</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"telephone":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_customer_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_customer_id</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"customer_id":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer entity_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_entity_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert website_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_website_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer firstname" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_firstname</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer lastname" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_lastname</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer email" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_email</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer group_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_group_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer store_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_store_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_at" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_created_at</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer updated_at" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_updated_at</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer is_active" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_is_active</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer disable_auto_group_change" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_disable_auto_group_change</stringProp> - </ResponseAssertion> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addSimpleProductsToCart</stringProp> + <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> + <stringProp name="VAR">item_id</stringProp> + <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update Simple Product qty In Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_simple_product_qty_in_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="664196114">{"data":{"updateCartItems":{"cart":{"items":[{"id":"${item_id}","quantity":5}]}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Update Configurable Product Qty In Cart" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateConfigurableProductQtyInCartPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_in" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_created_in</stringProp> - </ResponseAssertion> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Update Configurable Product Qty In Cart"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer dob" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="221072919">^\d+/\d+/\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_dob</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_billing" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_default_billing</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_shipping" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_default_shipping</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer gender" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_gender</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer failures_num" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_failures_num</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_entity_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_entity_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_created_at" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_created_at</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_updated_at" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_updated_at</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_is_active" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_is_active</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_city" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_city</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_country_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_country_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_firstname" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_firstname</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_lastname" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_lastname</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_postcode" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_postcode</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_region</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_region_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_street" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_street</stringProp> - </ResponseAssertion> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> + <stringProp name="VAR">product_option</stringProp> + <stringProp name="JSONPATH">$.data.products.items[0].variants[0].product.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Configurable Product To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> + <stringProp name="675049292">"sku":"${product_option}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> + <stringProp name="VAR">item_id</stringProp> + <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update Configurable Product qty In Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_configurable_product_qty_in_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="664196114">{"data":{"updateCartItems":{"cart":{"items":[{"id":"${item_id}","quantity":5}]}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Update Simple Product Qty In Cart with Prices" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateSimpleProductQtyInCartWithPricesPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_telephone" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_telephone</stringProp> - </ResponseAssertion> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Update Simple Product Qty In Cart with Prices"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_customer_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_customer_id</stringProp> - </ResponseAssertion> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart With Prices" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart_with_prices.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addSimpleProductsToCart</stringProp> + <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart With Prices" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart_with_prices.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> + <stringProp name="VAR">item_id</stringProp> + <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update Simple Product qty In Cart With Prices" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_simple_product_qty_in_cart_with_prices.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">"quantity":5</stringProp> + <stringProp name="675049292">"id":"${item_id}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Update Configurable Product Qty In Cart with Prices" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateConfigurableProductQtyInCartWithPricesPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="Accept-Language" elementType="Header"> - <stringProp name="Header.name">Accept-Language</stringProp> - <stringProp name="Header.value">en-US,en;q=0.5</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> - </elementProp> - <elementProp name="User-Agent" elementType="Header"> - <stringProp name="Header.name">User-Agent</stringProp> - <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> - </elementProp> - <elementProp name="Accept-Encoding" elementType="Header"> - <stringProp name="Header.name">Accept-Encoding</stringProp> - <stringProp name="Header.value">gzip, deflate</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Update Configurable Product Qty In Cart with Prices"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Validate" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="isAjax " elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax </stringProp> - </elementProp> - <elementProp name="customer[entity_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[entity_id]</stringProp> - </elementProp> - <elementProp name="customer[website_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[website_id]</stringProp> - </elementProp> - <elementProp name="customer[email]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_email}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[email]</stringProp> - </elementProp> - <elementProp name="customer[group_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[group_id]</stringProp> - </elementProp> - <elementProp name="customer[store_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[store_id]</stringProp> - </elementProp> - <elementProp name="customer[created_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[created_at]</stringProp> - </elementProp> - <elementProp name="customer[updated_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[updated_at]</stringProp> - </elementProp> - <elementProp name="customer[is_active]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[is_active]</stringProp> - </elementProp> - <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> - </elementProp> - <elementProp name="customer[created_in]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[created_in]</stringProp> - </elementProp> - <elementProp name="customer[prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[prefix]</stringProp> - </elementProp> - <elementProp name="customer[firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[firstname]</stringProp> - </elementProp> - <elementProp name="customer[middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[middlename]</stringProp> - </elementProp> - <elementProp name="customer[lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[lastname]</stringProp> - </elementProp> - <elementProp name="customer[suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[suffix]</stringProp> - </elementProp> - <elementProp name="customer[dob]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_dob}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[dob]</stringProp> - </elementProp> - <elementProp name="customer[default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[default_billing]</stringProp> - </elementProp> - <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[default_shipping]</stringProp> - </elementProp> - <elementProp name="customer[taxvat]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[taxvat]</stringProp> - </elementProp> - <elementProp name="customer[gender]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_gender}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[gender]</stringProp> - </elementProp> - <elementProp name="customer[failures_num]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[failures_num]</stringProp> - </elementProp> - <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> - </elementProp> - <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][prefix]</stringProp> - </elementProp> - <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">John</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][firstname]</stringProp> - </elementProp> - <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][middlename]</stringProp> - </elementProp> - <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Doe</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][lastname]</stringProp> - </elementProp> - <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][suffix]</stringProp> - </elementProp> - <elementProp name="address[new_0][company]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Test Company</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][company]</stringProp> - </elementProp> - <elementProp name="address[new_0][city]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Folsom</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][city]</stringProp> - </elementProp> - <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">95630</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][postcode]</stringProp> - </elementProp> - <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1234567890</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][telephone]</stringProp> - </elementProp> - <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> - </elementProp> - <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> - </elementProp> - <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> - </elementProp> - <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">123 Main</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][street][0]</stringProp> - </elementProp> - <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][street][1]</stringProp> - </elementProp> - <elementProp name="address[new_0][region]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][region]</stringProp> - </elementProp> - <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">US</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][country_id]</stringProp> - </elementProp> - <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][region_id]</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - </collectionProp> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/validate/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="49586">200</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Save" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="isAjax " elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax </stringProp> - </elementProp> - <elementProp name="customer[entity_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[entity_id]</stringProp> - </elementProp> - <elementProp name="customer[website_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[website_id]</stringProp> - </elementProp> - <elementProp name="customer[email]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_email}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[email]</stringProp> - </elementProp> - <elementProp name="customer[group_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[group_id]</stringProp> - </elementProp> - <elementProp name="customer[store_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[store_id]</stringProp> - </elementProp> - <elementProp name="customer[created_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[created_at]</stringProp> - </elementProp> - <elementProp name="customer[updated_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[updated_at]</stringProp> - </elementProp> - <elementProp name="customer[is_active]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[is_active]</stringProp> - </elementProp> - <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> - </elementProp> - <elementProp name="customer[created_in]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[created_in]</stringProp> - </elementProp> - <elementProp name="customer[prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[prefix]</stringProp> - </elementProp> - <elementProp name="customer[firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[firstname]</stringProp> - </elementProp> - <elementProp name="customer[middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[middlename]</stringProp> - </elementProp> - <elementProp name="customer[lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[lastname]</stringProp> - </elementProp> - <elementProp name="customer[suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[suffix]</stringProp> - </elementProp> - <elementProp name="customer[dob]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_dob}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[dob]</stringProp> - </elementProp> - <elementProp name="customer[default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[default_billing]</stringProp> - </elementProp> - <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[default_shipping]</stringProp> - </elementProp> - <elementProp name="customer[taxvat]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[taxvat]</stringProp> - </elementProp> - <elementProp name="customer[gender]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_gender}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[gender]</stringProp> - </elementProp> - <elementProp name="customer[failures_num]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[failures_num]</stringProp> - </elementProp> - <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> - </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; - <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> - </elementProp> - <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][prefix]</stringProp> - </elementProp> - <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">John</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][firstname]</stringProp> - </elementProp> - <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][middlename]</stringProp> - </elementProp> - <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Doe</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][lastname]</stringProp> - </elementProp> - <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][suffix]</stringProp> - </elementProp> - <elementProp name="address[new_0][company]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Test Company</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][company]</stringProp> - </elementProp> - <elementProp name="address[new_0][city]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Folsom</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][city]</stringProp> - </elementProp> - <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">95630</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][postcode]</stringProp> - </elementProp> - <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1234567890</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][telephone]</stringProp> - </elementProp> - <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> - </elementProp> - <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> - </elementProp> - <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> - </elementProp> - <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">123 Main</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][street][0]</stringProp> - </elementProp> - <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][street][1]</stringProp> - </elementProp> - <elementProp name="address[new_0][region]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][region]</stringProp> - </elementProp> - <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">US</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][country_id]</stringProp> - </elementProp> - <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">12</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][region_id]</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/save/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer saved" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="292987815">You saved the customer.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> - <intProp name="ActionProcessor.action">1</intProp> - <intProp name="ActionProcessor.target">0</intProp> - <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCustomerManagementDelay}*1000))}</stringProp> - </TestAction> +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> </hashTree> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> + <stringProp name="VAR">product_option</stringProp> + <stringProp name="JSONPATH">$.data.products.items[0].variants[0].product.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Configurable Product To Cart With Prices" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart_with_prices.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> + <stringProp name="675049292">"sku":"${product_option}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart With Prices" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart_with_prices.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> + <stringProp name="VAR">item_id</stringProp> + <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update Configurable Product qty In Cart With Prices" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_configurable_product_qty_in_cart_with_prices.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">"quantity":5</stringProp> + <stringProp name="675049292">"id":"${item_id}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Admin Edit Order" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Remove Simple Product From Cart" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${adminEditOrderPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlRemoveSimpleProductFromCartPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -32704,639 +31287,392 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "Admin Edit Order"); + vars.put("testLabel", "GraphQL Remove Simple Product From Cart"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> - <hashTree/> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - } - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PreProcessor> - <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"/> - <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> - <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> <stringProp name="BeanShellSampler.query"> -adminUser = "none"; -adminUserList = props.get("adminUserList"); -adminUserListIterator = props.get("adminUserListIterator"); -adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } +import java.util.Random; - adminUser = adminUserListIterator.next(); -} +Random random = vars.getObject("randomIntGenerator"); +number = random.nextInt(props.get("simple_products_list").size()); +product = props.get("simple_products_list").get(number); -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); +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")); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1397214398">Welcome</stringProp> - <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + <stringProp name="1421843282">addSimpleProductsToCart</stringProp> + <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> + <stringProp name="VAR">item_id</stringProp> + <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_form_key</stringProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Remove Simple Product From Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="dummy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_simple_product_from_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> - <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1452665323">{"data":{"removeItemFromCart":{"cart":{"items":[]}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> </hashTree> </hashTree> + - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Remove Configurable Product From Cart" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlRemoveConfigurableProductFromCartPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1204796042">Create New Order</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Orders" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">sales_order_grid</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - </elementProp> - <elementProp name="search" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">200</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">increment_id</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">desc</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="filters[status]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">pending</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[status]</stringProp> - <stringProp name="Argument.desc">true</stringProp> + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Remove Configurable Product From Cart"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1637639774">totalRecords</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> - </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Pending Orders" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">sales_order_grid</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="search" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">200</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">increment_id</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">asc</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="filters[status]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">pending</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[status]</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> -<hashTree> +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1637639774">totalRecords</stringProp> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order numbers" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_numbers</stringProp> - <stringProp name="RegexExtractor.regex">\"increment_id\":\"(\d+)\"\,</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order ids" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_ids</stringProp> - <stringProp name="RegexExtractor.regex">\"entity_id\":\"(\d+)\"\,</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> - <hashTree/> </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> - import java.util.ArrayList; - import java.util.HashMap; - 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); - - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - </BeanShellSampler> - <hashTree/> +Random random = vars.getObject("randomIntGenerator"); +number = random.nextInt(props.get("configurable_products_list").size()); +product = props.get("configurable_products_list").get(number); - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Order" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/view/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2103620713">#${order_number}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order status" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_status</stringProp> - <stringProp name="RegexExtractor.regex"><span id="order_status">([^<]+)</span></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> - </hashTree> - - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> - <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Comment" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="history[status]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">pending</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">history[status]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="history[comment]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Some text</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">history[comment]</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/addComment/order_id/${order_id}/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -33344,144 +31680,61 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/add_comment.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-2089278331">Not Notified</stringProp> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1233850814">Invoice Totals</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract ordered items ids" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">item_ids</stringProp> - <stringProp name="RegexExtractor.regex"><div id="order_item_(\d+)_title"\s*class="product-title"></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Submit" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="invoice[items][${item_ids_1}]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">invoice[items][${item_ids_1}]</stringProp> - </elementProp> - <elementProp name="invoice[items][${item_ids_2}]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">invoice[items][${item_ids_2}]</stringProp> - </elementProp> - <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Invoiced</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">invoice[comment_text]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1740524604">The invoice has been created</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> + <stringProp name="VAR">product_option</stringProp> + <stringProp name="JSONPATH">$.data.products.items[0].variants[0].product.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Start" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Configurable Product To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/start/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="304100442">New Shipment</stringProp> + <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> + <stringProp name="675049292">"sku":"${product_option}"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> @@ -33490,47 +31743,24 @@ vars.put("admin_user", adminUser); <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Submit" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="shipment[items][${item_ids_1}]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">shipment[items][${item_ids_1}]</stringProp> - </elementProp> - <elementProp name="shipment[items][${item_ids_2}]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">shipment[items][${item_ids_2}]</stringProp> - </elementProp> - <elementProp name="shipment[comment_text]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Shipped</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">shipment[comment_text]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -33538,11 +31768,20 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_submit.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> + <stringProp name="VAR">item_id</stringProp> + <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-2089453199">The shipment has been created</stringProp> + <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> @@ -33550,52 +31789,53 @@ vars.put("admin_user", adminUser); </ResponseAssertion> <hashTree/> </hashTree> - </hashTree> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Remove Configurable Product From Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_configurable_product_from_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - </hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1452665323">{"data":{"removeItemFromCart":{"cart":{"items":[]}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Catalog GraphQL" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Apply Coupon To Cart" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${catalogGraphQLPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlApplyCouponToCartPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -33621,352 +31861,244 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "Catalog GraphQL"); + vars.put("testLabel", "GraphQL Apply Coupon To Cart"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Admin Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/once_only_controller.jmx</stringProp> -</OnceOnlyController> - <hashTree> - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> - <stringProp name="script"> - 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"); + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; - currentFormKey = getFormKeyFromResponse(); +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } +vars.putObject("randomIntGenerator", random); </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> - <hashTree/> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - } - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PreProcessor> - <hashTree/> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"/> - <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> - <hashTree/> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> <stringProp name="BeanShellSampler.query"> -adminUser = "none"; -adminUserList = props.get("adminUserList"); -adminUserListIterator = props.get("adminUserListIterator"); -adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } +import java.util.Random; - adminUser = adminUserListIterator.next(); -} +Random random = vars.getObject("randomIntGenerator"); +number = random.nextInt(props.get("simple_products_list").size()); +product = props.get("simple_products_list").get(number); -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); +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")); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1397214398">Welcome</stringProp> - <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + <stringProp name="1421843282">addSimpleProductsToCart</stringProp> + <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_form_key</stringProp> - </ResponseAssertion> - <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Coupon Code Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">random = vars.getObject("randomIntGenerator"); + +var coupons = props.get("coupon_codes"); +number = random.nextInt(coupons.length); + +vars.put("coupon_code", coupons[number].code); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> + </JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Apply Coupon To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="dummy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> - <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1026466978">{"data":{"applyCouponToCart":{"cart":{"applied_coupon":{"code":"${coupon_code}"}}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> </hashTree> </hashTree> + - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Indexer Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Indexers Management Catalog Set On Save" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_indexers_management/admin_indexer_management_catalog_set_on_save.jmx</stringProp> - </TestFragmentController> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Remove Coupon From Cart" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlRemoveCouponFromCartPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Index Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/indexer/indexer/list/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="Accept-Language" elementType="Header"> - <stringProp name="Header.name">Accept-Language</stringProp> - <stringProp name="Header.value">en-US,en;q=0.5</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> - </elementProp> - <elementProp name="User-Agent" elementType="Header"> - <stringProp name="Header.name">User-Agent</stringProp> - <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> - </elementProp> - <elementProp name="Accept-Encoding" elementType="Header"> - <stringProp name="Header.name">Accept-Encoding</stringProp> - <stringProp name="Header.value">gzip, deflate</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Indexers on Save" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="indexer_ids" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">catalog_category_product,catalog_product_category,catalog_product_price,catalog_product_attribute,cataloginventory_stock,catalogsearch_fulltext</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">indexer_ids</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="massaction_prepare_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">indexer_ids</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">massaction_prepare_key</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/indexer/indexer/massOnTheFly/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="49586">200</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> - </ResponseAssertion> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Remove Coupon From Cart"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - </hashTree> - </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Related Product Id" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_related_product_id.jmx</stringProp> - <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; -import java.util.Random; -Random random = new Random(); -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"));</stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Get Product Attributes" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> <elementProp name="" elementType="Header"> @@ -33981,24 +32113,42 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -34006,2387 +32156,31513 @@ vars.put("related_product_id", props.get("simple_products_list").get(relatedInde <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> - <stringProp name="VAR">admin_token</stringProp> - <stringProp name="JSONPATH">$</stringProp> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> <stringProp name="DEFAULT"/> <stringProp name="VARIABLE"/> <stringProp name="SUBJECT">BODY</stringProp> </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_token</stringProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> </hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Authorization</stringProp> - <stringProp name="Header.value">Bearer ${admin_token}</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - API Get product attributes" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="searchCriteria[filterGroups][0][filters][0][value]" elementType="HTTPArgument"> + <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">mycolor</stringProp> + <stringProp name="Argument.value">{"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}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][value]</stringProp> </elementProp> - <elementProp name="searchCriteria[filterGroups][0][filters][0][field]" elementType="HTTPArgument"> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addSimpleProductsToCart</stringProp> + <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Coupon Code Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">random = vars.getObject("randomIntGenerator"); + +var coupons = props.get("coupon_codes"); +number = random.nextInt(coupons.length); + +vars.put("coupon_code", coupons[number].code); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> + </JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Apply Coupon To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">attribute_code</stringProp> + <stringProp name="Argument.value">{"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}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="searchCriteria[filterGroups][0][filters][1][value]" elementType="HTTPArgument"> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1026466978">{"data":{"applyCouponToCart":{"cart":{"applied_coupon":{"code":"${coupon_code}"}}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Remove Coupon From Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">mysize</stringProp> + <stringProp name="Argument.value">{"query":"mutation {\n removeCouponFromCart(input: {cart_id: \"${quote_id}\"}) {\n cart {\n applied_coupon {\n code\n }\n }\n }\n}","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][1][value]</stringProp> </elementProp> - <elementProp name="searchCriteria[filterGroups][0][filters][1][field]" elementType="HTTPArgument"> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_coupon_from_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-76201335">{"data":{"removeCouponFromCart":{"cart":{"applied_coupon":null}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Catalog Browsing By Guest" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlCatalogBrowsingByGuestPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Catalog Browsing By Guest"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Navigation Menu by category_id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">attribute_code</stringProp> + <stringProp name="Argument.value">{"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"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][1][field]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_product_attributes.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product attributes" enabled="true"> - <stringProp name="VAR">product_attributes</stringProp> - <stringProp name="JSONPATH">$.items</stringProp> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"id":${category_id},"name":"${category_name}","product_count"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Product Search by text and category_id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> <stringProp name="DEFAULT"/> <stringProp name="VARIABLE"/> <stringProp name="SUBJECT">BODY</stringProp> </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="SetUp - Prepare product attributes" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script"> -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": [] - }; + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">String totalCount=vars.get("graphql_search_products_query_total_count"); - 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); +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; + } } -vars.putObject("product_attributes", attributes); + </stringProp> - </JSR223PostProcessor> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> <hashTree/> </hashTree> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get Attribute Set Id" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Url Info by url_key" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"query":"query resolveUrl($urlKey: String!) {\n urlResolver(url: $urlKey) {\n type\n id\n }\n}","variables":{"urlKey":"${category_url_key}${url_suffix}"},"operationName":"resolveUrl"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product_set/index/filter/${attribute_set_filter}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_url_info_by_url_key.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">attribute_set_id</stringProp> - <stringProp name="RegexExtractor.regex">catalog&#x2F;product_set&#x2F;edit&#x2F;id&#x2F;([\d]+)&#x2F;"[\D\d]*Attribute Set 1</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1062388959">{"type":"CATEGORY","id":${category_id}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="SetUp - Set Attribute Set Filter" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script">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)); -</stringProp> - </BeanShellPreProcessor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"name":"${category_name}","id":${category_id},</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> </hashTree> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> 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)}"); +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")); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/setup.jmx</stringProp></BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> - <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Bundle Product" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_bundle_product.jmx</stringProp> -</TestFragmentController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1509986340">records found</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by product_url_key" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Simple Product Details by name" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Simple Product Details by product_url_key" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare CMS Page" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">random = vars.getObject("randomIntGenerator"); + +var cmsPages = props.get("cms_pages"); +var number = random.nextInt(cmsPages.length); + +vars.put("cms_page_id", cmsPages[number].id); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/prepare_cms_page.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cms Page by id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> + <stringProp name="EXPECTED_VALUE">${cms_page_id}</stringProp> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Checkout By Guest" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${graphqlCheckoutByGuestPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/new/set/4/type/bundle/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-144461265">New Product</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "GraphQL Checkout By Guest"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product Validate" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="ajax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">ajax</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[name]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[name]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[sku]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[sku]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[price]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">42</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[price]</stringProp> - </elementProp> - <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">2</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tax_class_id]</stringProp> - </elementProp> - <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">111</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> - </elementProp> - <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> - </elementProp> - <elementProp name="product[weight]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1.0000</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[weight]</stringProp> - </elementProp> - <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[product_has_weight]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="product[category_ids][]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">2</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[category_ids][]</stringProp> - </elementProp> - <elementProp name="product[description]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"><p>Full bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[description]</stringProp> - </elementProp> - <elementProp name="product[short_description]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"><p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[short_description]</stringProp> - </elementProp> - <elementProp name="product[status]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[status]</stringProp> - </elementProp> - <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[configurable_variations]</stringProp> - </elementProp> - <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> - </elementProp> - <elementProp name="product[image]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[image]</stringProp> - </elementProp> - <elementProp name="product[small_image]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[small_image]</stringProp> - </elementProp> - <elementProp name="product[thumbnail]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[thumbnail]</stringProp> - </elementProp> - <elementProp name="product[url_key]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[url_key]</stringProp> - </elementProp> - <elementProp name="product[meta_title]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[meta_title]</stringProp> - </elementProp> - <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[meta_keyword]</stringProp> - </elementProp> - <elementProp name="product[meta_description]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[meta_description]</stringProp> - </elementProp> - <elementProp name="product[website_ids][]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[website_ids][]</stringProp> - </elementProp> - <elementProp name="product[special_price]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">99</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[special_price]</stringProp> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1901638450">{"data":{"cart":{"items":[]}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> + <stringProp name="VAR">product_option</stringProp> + <stringProp name="JSONPATH">$.data.products.items[0].variants[0].product.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Configurable Product To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> + <stringProp name="675049292">"sku":"${product_option}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addSimpleProductsToCart</stringProp> + <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Billing Address On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_billing_address_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1147076914">{"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"}}}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Shipping Address On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1671866339">{"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"}}]}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Payment Method On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_payment_method_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1830199373">{"data":{"setPaymentMethodOnCart":{"cart":{"selected_payment_method":{"code":"checkmo"}}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Current Shipping Address" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"{\n cart(cart_id: \"${quote_id}\") {\n shipping_addresses {\n postcode\n }\n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_current_shipping_address.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Shipping Method On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_method_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="644143859">{"data":{"setShippingMethodsOnCart":{"cart":{"shipping_addresses":[{"selected_shipping_method":{"carrier_code":"flatrate","method_code":"flatrate"}}]}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Coupon Code Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">random = vars.getObject("randomIntGenerator"); + +var coupons = props.get("coupon_codes"); +number = random.nextInt(coupons.length); + +vars.put("coupon_code", coupons[number].code); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> + </JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Apply Coupon To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1026466978">{"data":{"applyCouponToCart":{"cart":{"applied_coupon":{"code":"${coupon_code}"}}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Remove Coupon From Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n removeCouponFromCart(input: {cart_id: \"${quote_id}\"}) {\n cart {\n applied_coupon {\n code\n }\n }\n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_coupon_from_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-76201335">{"data":{"removeCouponFromCart":{"cart":{"applied_coupon":null}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + </hashTree> + + + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Combined Benchmark Pool" enabled="true"> + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> + <boolProp name="LoopController.continue_forever">false</boolProp> + <stringProp name="LoopController.loops">${loops}</stringProp> + </elementProp> + <stringProp name="ThreadGroup.num_threads">${combinedBenchmarkPoolUsers}</stringProp> + <stringProp name="ThreadGroup.ramp_time">${ramp_period}</stringProp> + <longProp name="ThreadGroup.start_time">1505803944000</longProp> + <longProp name="ThreadGroup.end_time">1505803944000</longProp> + <boolProp name="ThreadGroup.scheduler">false</boolProp> + <stringProp name="ThreadGroup.duration"/> + <stringProp name="ThreadGroup.delay"/> + <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Cache hit miss" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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)); + } +} +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Catalog Browsing By Guest" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cBrowseCatalogByGuestPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Catalog Browsing By Guest"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"> + <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> + <stringProp name="Cookie.value">30</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">/</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> + <stringProp name="Cookie.value">${form_key}</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">${base_path}</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + </collectionProp> + <boolProp name="CookieManager.clearEachIteration">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="571386695"><title>Home page</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${category_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1210004667"><span class="base" data-ui-id="page-title">${category_name}</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract category id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">category_id</stringProp> + <stringProp name="RegexExtractor.regex"><li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="Scope.variable">simple_product_1_url_key</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert category id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1191417111">^[0-9]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">category_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Site Search" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cSiteSearchPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Site Search"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="Search Terms" enabled="true"> + <stringProp name="filename">${files_folder}search_terms.csv</stringProp> + <stringProp name="fileEncoding">UTF-8</stringProp> + <stringProp name="variableNames"/> + <stringProp name="delimiter">,</stringProp> + <boolProp name="quotedData">false</boolProp> + <boolProp name="recycle">true</boolProp> + <boolProp name="stopThread">false</boolProp> + <stringProp name="shareMode">shareMode.thread</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms.jmx</stringProp></CSVDataSet> + <hashTree/> + + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Cache hit miss" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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)); + } +} +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Quick Search" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${searchQuickPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Quick Search"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"> + <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> + <stringProp name="Cookie.value">30</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">/</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> + <stringProp name="Cookie.value">${form_key}</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">${base_path}</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + </collectionProp> + <boolProp name="CookieManager.clearEachIteration">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="571386695"><title>Home page</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="q" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">q</stringProp> + <stringProp name="Argument.value">${searchTerm}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}catalogsearch/result/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="56511661">Search results for: </stringProp> + <stringProp name="1533671447"><span class="toolbar-number">\d<\/span> Items|Items <span class="toolbar-number">1</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product url keys" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> + <stringProp name="RegexExtractor.regex"><a class="product-item-link"(?s).+?href="(?:http|https)://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s).</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: isPageCacheable" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">isPageCacheable</stringProp> + <stringProp name="RegexExtractor.regex">catalogsearch/searchTermsLog/save</stringProp> + <stringProp name="RegexExtractor.template">$0$</stringProp> + <stringProp name="RegexExtractor.default">0</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> + <stringProp name="IfController.condition">"${isPageCacheable}" != "0"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Terms Log" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="q" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">q</stringProp> + <stringProp name="Argument.value">${searchTerm}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}catalogsearch/searchTermsLog/save/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-547797305">"success":true</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query"> +foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); + +if (foundProducts > 3) { + foundProducts = 3; +} + +vars.put("foundProducts", String.valueOf(foundProducts)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">${foundProducts}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +number = vars.get("_counter"); +product = vars.get("product_url_keys_"+number); + +vars.put("product_url_key", product); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Quick Search With Filtration" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${searchQuickFilterPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Quick Search With Filtration"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"> + <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> + <stringProp name="Cookie.value">30</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">/</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> + <stringProp name="Cookie.value">${form_key}</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">${base_path}</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + </collectionProp> + <boolProp name="CookieManager.clearEachIteration">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="571386695"><title>Home page</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="q" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">q</stringProp> + <stringProp name="Argument.value">${searchTerm}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol"/> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}catalogsearch/result/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="56511661">Search results for: </stringProp> + <stringProp name="1533671447">Items <span class="toolbar-number">1</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract number of attribute 1 options" enabled="true"> + <stringProp name="XPathExtractor.default">0</stringProp> + <stringProp name="XPathExtractor.refname">attribute_1_options_count</stringProp> + <stringProp name="XPathExtractor.xpathQuery">count((//div[@class="filter-options-content"])[1]//li[@class="item"])</stringProp> + <boolProp name="XPathExtractor.validate">false</boolProp> + <boolProp name="XPathExtractor.tolerant">true</boolProp> + <boolProp name="XPathExtractor.namespace">false</boolProp> + </XPathExtractor> + <hashTree/> + <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract number of attribute 2 options" enabled="true"> + <stringProp name="XPathExtractor.default">0</stringProp> + <stringProp name="XPathExtractor.refname">attribute_2_options_count</stringProp> + <stringProp name="XPathExtractor.xpathQuery">count((//div[@class="filter-options-content"])[2]//li[@class="item"])</stringProp> + <boolProp name="XPathExtractor.validate">false</boolProp> + <boolProp name="XPathExtractor.tolerant">true</boolProp> + <boolProp name="XPathExtractor.namespace">false</boolProp> + </XPathExtractor> + <hashTree/> + <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract filter link from layered navigation" enabled="true"> + <stringProp name="XPathExtractor.default"/> + <stringProp name="XPathExtractor.refname">attribute_1_filter_url</stringProp> + <stringProp name="XPathExtractor.xpathQuery">((//div[@class="filter-options-content"])[1]//li[@class="item"]//a)[1]/@href</stringProp> + <boolProp name="XPathExtractor.validate">false</boolProp> + <boolProp name="XPathExtractor.tolerant">true</boolProp> + <boolProp name="XPathExtractor.namespace">false</boolProp> + </XPathExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract product url keys" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> + <stringProp name="RegexExtractor.regex"><a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s).</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: isPageCacheable" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">isPageCacheable</stringProp> + <stringProp name="RegexExtractor.regex">catalogsearch/searchTermsLog/save</stringProp> + <stringProp name="RegexExtractor.template">$0$</stringProp> + <stringProp name="RegexExtractor.default">0</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> + <stringProp name="IfController.condition">"${isPageCacheable}" != "0"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Terms Log" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="q" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">q</stringProp> + <stringProp name="Argument.value">${searchTerm}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}catalogsearch/searchTermsLog/save/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-547797305">"success":true</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Attribute 1 present in layered navigation" enabled="true"> + <stringProp name="IfController.condition">${attribute_1_options_count} > 0</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter-first-attribute.jmx</stringProp></IfController> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Search Url 2" enabled="true"> + <stringProp name="BeanShellSampler.query">vars.put("search_url", vars.get("attribute_1_filter_url"));</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Filter by Attribute 1" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol"/> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${attribute_1_filter_url}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="56511661">Search results for: </stringProp> + <stringProp name="1420634794"><span class="toolbar-number">[1-9]+</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract number of attribute 2 options" enabled="true"> + <stringProp name="XPathExtractor.default">0</stringProp> + <stringProp name="XPathExtractor.refname">attribute_2_options_count</stringProp> + <stringProp name="XPathExtractor.xpathQuery">count((//div[@class="filter-options-content"])[2]//li[@class="item"])</stringProp> + <boolProp name="XPathExtractor.validate">false</boolProp> + <boolProp name="XPathExtractor.tolerant">true</boolProp> + <boolProp name="XPathExtractor.namespace">false</boolProp> + </XPathExtractor> + <hashTree/> + <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract filter link from layered navigation" enabled="true"> + <stringProp name="XPathExtractor.default"/> + <stringProp name="XPathExtractor.refname">attribute_2_filter_url</stringProp> + <stringProp name="XPathExtractor.xpathQuery">((//div[@class="filter-options-content"])[2]//li[@class="item"]//a)[1]/@href</stringProp> + <boolProp name="XPathExtractor.validate">false</boolProp> + <boolProp name="XPathExtractor.tolerant">true</boolProp> + <boolProp name="XPathExtractor.namespace">false</boolProp> + </XPathExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract product url keys" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> + <stringProp name="RegexExtractor.regex"><a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s).</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Attribute 2 present in layered navigation" enabled="true"> + <stringProp name="IfController.condition">${attribute_2_options_count} > 0</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter-second-attribute.jmx</stringProp></IfController> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Search Ul 3" enabled="true"> + <stringProp name="BeanShellSampler.query">vars.put("search_url", vars.get("attribute_2_filter_url"));</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Filter by Attribute 2" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol"/> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${attribute_2_filter_url}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="56511661">Search results for: </stringProp> + <stringProp name="1420634794"><span class="toolbar-number">[1-9]+</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract product url keys" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> + <stringProp name="RegexExtractor.regex"><a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s).</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query"> +foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); + +if (foundProducts > 3) { + foundProducts = 3; +} + +vars.put("foundProducts", String.valueOf(foundProducts)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">${foundProducts}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +number = vars.get("_counter"); +product = vars.get("product_url_keys_"+number); + +vars.put("product_url_key", product); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Advanced Search" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${searchAdvancedPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Advanced Search"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"> + <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> + <stringProp name="Cookie.value">30</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">/</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> + <stringProp name="Cookie.value">${form_key}</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">${base_path}</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + </collectionProp> + <boolProp name="CookieManager.clearEachIteration">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="571386695"><title>Home page</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Advanced Search" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol"/> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}catalogsearch/advanced/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/open_advanced_search_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="921122077"><title>Advanced Search</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract attribute name" enabled="true"> + <stringProp name="XPathExtractor.default"/> + <stringProp name="XPathExtractor.refname">attribute_name</stringProp> + <stringProp name="XPathExtractor.xpathQuery">(//select[@class="multiselect"])[last()]/@name</stringProp> + <boolProp name="XPathExtractor.validate">false</boolProp> + <boolProp name="XPathExtractor.tolerant">true</boolProp> + <boolProp name="XPathExtractor.namespace">false</boolProp> + </XPathExtractor> + <hashTree/> + <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract attribute options count" enabled="true"> + <stringProp name="XPathExtractor.default">0</stringProp> + <stringProp name="XPathExtractor.refname">attribute_options_count</stringProp> + <stringProp name="XPathExtractor.xpathQuery">count((//select[@class="multiselect"])[last()]/option)</stringProp> + <boolProp name="XPathExtractor.validate">false</boolProp> + <boolProp name="XPathExtractor.tolerant">true</boolProp> + <boolProp name="XPathExtractor.namespace">false</boolProp> + </XPathExtractor> + <hashTree/> + <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract attribute value" enabled="true"> + <stringProp name="XPathExtractor.default"/> + <stringProp name="XPathExtractor.refname">attribute_value</stringProp> + <stringProp name="XPathExtractor.xpathQuery">((//select[@class="multiselect"])[last()]/option)[1]/@value</stringProp> + <boolProp name="XPathExtractor.validate">false</boolProp> + <boolProp name="XPathExtractor.tolerant">true</boolProp> + <boolProp name="XPathExtractor.namespace">false</boolProp> + </XPathExtractor> + <hashTree/> + </hashTree> + + + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="sku" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">sku</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">description</stringProp> + <stringProp name="Argument.value">${searchTerm}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="short_description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">short_description</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="price%5Bfrom%5D" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">price%5Bfrom%5D</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="price%5Bto%5D" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">price%5Bto%5D</stringProp> + <stringProp name="Argument.value">${priceTo}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <!-- Should be fixed in MAGETWO-80420 --> + <!--<elementProp name="${attribute_name}" elementType="HTTPArgument">--> + <!--<boolProp name="HTTPArgument.always_encode">true</boolProp>--> + <!--<stringProp name="Argument.value">${attribute_value}</stringProp>--> + <!--<stringProp name="Argument.metadata">=</stringProp>--> + <!--<boolProp name="HTTPArgument.use_equals">true</boolProp>--> + <!--<stringProp name="Argument.name">${attribute_name}</stringProp>--> + <!--</elementProp>--> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}catalogsearch/advanced/result/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_advanced.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1851531284">items</strong> were found using the following search criteria</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product url keys" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> + <stringProp name="RegexExtractor.regex"><a class="product-item-link"(?s).+?href="(?:http|https)://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s).</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query"> +foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); + +if (foundProducts > 3) { + foundProducts = 3; +} + +vars.put("foundProducts", String.valueOf(foundProducts)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">${foundProducts}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +number = vars.get("_counter"); +product = vars.get("product_url_keys_"+number); + +vars.put("product_url_key", product); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Add To Cart By Guest" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAddToCartByGuestPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Add To Cart By Guest"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"> + <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> + <stringProp name="Cookie.value">30</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">/</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> + <stringProp name="Cookie.value">${form_key}</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">${base_path}</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + </collectionProp> + <boolProp name="CookieManager.clearEachIteration">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +vars.put("totalProductsAdded", "0"); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="571386695"><title>Home page</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${category_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1210004667"><span class="base" data-ui-id="page-title">${category_name}</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract category id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">category_id</stringProp> + <stringProp name="RegexExtractor.regex"><li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="Scope.variable">simple_product_1_url_key</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert category id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1191417111">^[0-9]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">category_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); +productsAdded = productsAdded + 1; + +vars.put("totalProductsAdded", String.valueOf(productsAdded)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Cart" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product</stringProp> + </elementProp> + <elementProp name="related_product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">related_product</stringProp> + </elementProp> + <elementProp name="qty" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">qty</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">cart,messages</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2057973164">This product is out of stock.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); +productsAdded = productsAdded + 1; + +vars.put("totalProductsAdded", String.valueOf(productsAdded)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Options" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/configurable-products/${product_sku}/options/all</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract attribute_ids" enabled="true"> + <stringProp name="VAR">attribute_ids</stringProp> + <stringProp name="JSONPATH">$.[*].attribute_id</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract option_values" enabled="true"> + <stringProp name="VAR">option_values</stringProp> + <stringProp name="JSONPATH">$.[*].values[0].value_index</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product</stringProp> + </elementProp> + <elementProp name="related_product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">related_product</stringProp> + </elementProp> + <elementProp name="qty" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">qty</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">cart,messages</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2057973164">This product is out of stock.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Add to Wishlist" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAddToWishlistPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Add to Wishlist"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"> + <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> + <stringProp name="Cookie.value">30</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">/</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> + <stringProp name="Cookie.value">${form_key}</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">${base_path}</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + </collectionProp> + <boolProp name="CookieManager.clearEachIteration">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Login Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/account/login/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="637394530"><title>Customer Login</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${customer_email}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${customer_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="send" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">send</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/account/loginPost/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1312950388"><title>My Account</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Address" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">addressId</stringProp> + <stringProp name="RegexExtractor.regex">customer/address/edit/id/([^'"]+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert addressId extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">addressId</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Customer Private Data" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Produts to Wishlist" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">5</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Wishlist" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="uenc" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_uenc}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">uenc</stringProp> + </elementProp> + <elementProp name="product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}wishlist/index/add/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/add_to_wishlist.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1907714722"><title>My Wish List</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">wishListItems</stringProp> + <stringProp name="RegexExtractor.regex">data-post-remove='\{"action":"(.+)\/wishlist\\/index\\/remove\\/","data":\{"item":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Wishlist Section ${_counter}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">wishlist,messages</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/load_wishlist_section.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1865430343">{"wishlist":{"counter":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">${wishlistDelay}*1000</stringProp> + </ConstantTimer> + <hashTree/> + </hashTree> + </hashTree> + + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Controller: Clear Wishlist" enabled="true"> + <stringProp name="ForeachController.inputVal">wishListItems</stringProp> + <stringProp name="ForeachController.returnVal">wishListItem</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/clear_wishlist.jmx</stringProp></ForeachController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">5</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Clear Wishlist ${counter}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="item" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${wishListItem}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">item</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}wishlist/index/remove/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/account/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1723813687">You are signed out.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Customer to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> +customerUserList = props.get("customer_emails_list"); +customerUserList.add(vars.get("customer_email")); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Compare Products" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cCompareProductsPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Compare Products"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"> + <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> + <stringProp name="Cookie.value">30</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">/</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> + <stringProp name="Cookie.value">${form_key}</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">${base_path}</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + </collectionProp> + <boolProp name="CookieManager.clearEachIteration">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +vars.put("totalProductsAdded", "0"); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${category_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/open_category.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1210004667"><span class="base" data-ui-id="page-title">${category_name}</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Random Product Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">random_product_compare_id</stringProp> + <stringProp name="RegexExtractor.regex">catalog\\/product_compare\\/add\\/\",\"data\":\{\"product\":\"([0-9]+)\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Random Product Id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1191417111">^[0-9]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">random_product_compare_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Compare" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); +productsAdded = productsAdded + 1; + +vars.put("totalProductsAdded", String.valueOf(productsAdded)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Comparison Add" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="uenc" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_uenc}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">uenc</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}catalog/product_compare/add/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Compare Product Section" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">compare-products,messages</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-350323027">\"compare-products\":{\"count\":${totalProductsAdded}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Compare" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); +productsAdded = productsAdded + 1; + +vars.put("totalProductsAdded", String.valueOf(productsAdded)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Comparison Add" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="uenc" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_uenc}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">uenc</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}catalog/product_compare/add/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Compare Product Section" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">compare-products,messages</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-350323027">\"compare-products\":{\"count\":${totalProductsAdded}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Compare Products" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}catalog/product_compare/index/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products.jmx</stringProp></HTTPSamplerProxy> + <hashTree/> + + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Product Compare - Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${productCompareDelay}*1000))}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products_pause.jmx</stringProp></TestAction> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Compare Products Clear" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}catalog/product_compare/clear</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products_clear.jmx</stringProp></HTTPSamplerProxy> + <hashTree/> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Checkout By Guest" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cCheckoutByGuestPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Checkout By Guest"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"> + <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> + <stringProp name="Cookie.value">30</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">/</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> + <stringProp name="Cookie.value">${form_key}</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">${base_path}</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + </collectionProp> + <boolProp name="CookieManager.clearEachIteration">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +vars.put("totalProductsAdded", "0"); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="571386695"><title>Home page</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${category_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1210004667"><span class="base" data-ui-id="page-title">${category_name}</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract category id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">category_id</stringProp> + <stringProp name="RegexExtractor.regex"><li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="Scope.variable">simple_product_1_url_key</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert category id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1191417111">^[0-9]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">category_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); +productsAdded = productsAdded + 1; + +vars.put("totalProductsAdded", String.valueOf(productsAdded)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Cart" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product</stringProp> + </elementProp> + <elementProp name="related_product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">related_product</stringProp> + </elementProp> + <elementProp name="qty" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">qty</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">cart,messages</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2057973164">This product is out of stock.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); +productsAdded = productsAdded + 1; + +vars.put("totalProductsAdded", String.valueOf(productsAdded)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Options" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/configurable-products/${product_sku}/options/all</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract attribute_ids" enabled="true"> + <stringProp name="VAR">attribute_ids</stringProp> + <stringProp name="JSONPATH">$.[*].attribute_id</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract option_values" enabled="true"> + <stringProp name="VAR">option_values</stringProp> + <stringProp name="JSONPATH">$.[*].values[0].value_index</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product</stringProp> + </elementProp> + <elementProp name="related_product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">related_product</stringProp> + </elementProp> + <elementProp name="qty" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">qty</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">cart,messages</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2057973164">This product is out of stock.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Checkout" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> + vars.put("alabama_region_id", props.get("alabama_region_id")); + vars.put("california_region_id", props.get("california_region_id")); +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}checkout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1403911775"><title>Checkout</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-179817969"><title>Shopping Cart</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Cart Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">cart_id</stringProp> + <stringProp name="RegexExtractor.regex">"quoteData":{"entity_id":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Cart Id extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">cart_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Email Available" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"customerEmail":"test@example.com"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/customers/isEmailAvailable</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_email_available.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Referer</stringProp> + <stringProp name="Header.value">${base_path}checkout/onepage/</stringProp> + </elementProp> + <elementProp name="Content-Type" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> + </elementProp> + <elementProp name="X-Requested-With" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="3569038">true</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Estimate Shipping Methods" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"address":{"country_id":"US","postcode":"95630"}}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/estimate-shipping-methods</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Referer</stringProp> + <stringProp name="Header.value">${base_path}checkout/onepage/</stringProp> + </elementProp> + <elementProp name="Content-Type" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> + </elementProp> + <elementProp name="X-Requested-With" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1224567411">"available":true</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Billing/Shipping Information" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/shipping-information</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Referer</stringProp> + <stringProp name="Header.value">${base_path}checkout/onepage/</stringProp> + </elementProp> + <elementProp name="Content-Type" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> + </elementProp> + <elementProp name="X-Requested-With" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1494218646">{"payment_methods":</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Payment Info/Place Order" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/payment-information</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Referer</stringProp> + <stringProp name="Header.value">${base_path}checkout/onepage/</stringProp> + </elementProp> + <elementProp name="Content-Type" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> + </elementProp> + <elementProp name="X-Requested-With" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-297987887">"[0-9]+"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">order_id</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout success" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}checkout/onepage/success/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="494863233">Thank you for your purchase!</stringProp> + <stringProp name="1635682758">Your order # is</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Checkout By Customer" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cCheckoutByCustomerPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Checkout By Customer"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"> + <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> + <stringProp name="Cookie.value">30</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">/</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> + <stringProp name="Cookie.value">${form_key}</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">${base_path}</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + </collectionProp> + <boolProp name="CookieManager.clearEachIteration">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +vars.put("totalProductsAdded", "0"); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="571386695"><title>Home page</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Login Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/account/login/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="637394530"><title>Customer Login</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${customer_email}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${customer_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="send" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">send</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/account/loginPost/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1312950388"><title>My Account</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Address" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">addressId</stringProp> + <stringProp name="RegexExtractor.regex">customer/address/edit/id/([^'"]+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert addressId extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">addressId</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Customer Private Data" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${category_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1210004667"><span class="base" data-ui-id="page-title">${category_name}</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract category id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">category_id</stringProp> + <stringProp name="RegexExtractor.regex"><li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="Scope.variable">simple_product_1_url_key</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert category id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1191417111">^[0-9]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">category_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); +productsAdded = productsAdded + 1; + +vars.put("totalProductsAdded", String.valueOf(productsAdded)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Cart" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product</stringProp> + </elementProp> + <elementProp name="related_product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">related_product</stringProp> + </elementProp> + <elementProp name="qty" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">qty</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">cart,messages</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2057973164">This product is out of stock.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); +productsAdded = productsAdded + 1; + +vars.put("totalProductsAdded", String.valueOf(productsAdded)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1787050162"><span>In stock</span></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Options" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/configurable-products/${product_sku}/options/all</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract attribute_ids" enabled="true"> + <stringProp name="VAR">attribute_ids</stringProp> + <stringProp name="JSONPATH">$.[*].attribute_id</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract option_values" enabled="true"> + <stringProp name="VAR">option_values</stringProp> + <stringProp name="JSONPATH">$.[*].values[0].value_index</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product</stringProp> + </elementProp> + <elementProp name="related_product" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">related_product</stringProp> + </elementProp> + <elementProp name="qty" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">qty</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">cart,messages</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2057973164">This product is out of stock.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Checkout" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> + vars.put("alabama_region_id", props.get("alabama_region_id")); + vars.put("california_region_id", props.get("california_region_id")); +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}checkout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1403911775"><title>Checkout</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-179817969"><title>Shopping Cart</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Cart Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">cart_id</stringProp> + <stringProp name="RegexExtractor.regex">"quoteData":{"entity_id":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Address Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">address_id</stringProp> + <stringProp name="RegexExtractor.regex">"default_billing":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Customer Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">customer_id</stringProp> + <stringProp name="RegexExtractor.regex">"customer_id":([^'",]+),</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Cart Id extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">cart_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Address Id extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="576002869">[0-9]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">address_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Customer Id extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="576002869">[0-9]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">customer_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Estimate Shipping Methods" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"addressId":"${addressId}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Referer</stringProp> + <stringProp name="Header.value">${base_path}checkout/onepage/</stringProp> + </elementProp> + <elementProp name="Content-Type" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> + </elementProp> + <elementProp name="X-Requested-With" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1224567411">"available":true</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Billing/Shipping Information" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine/shipping-information</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Referer</stringProp> + <stringProp name="Header.value">${host}${base_path}checkout/onepage</stringProp> + </elementProp> + <elementProp name="Content-Type" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> + </elementProp> + <elementProp name="X-Requested-With" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-740937264">{"payment_methods"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Payment Info/Place Order" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine/payment-information</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Referer</stringProp> + <stringProp name="Header.value">${host}${base_path}checkout/onepage</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json; charset=UTF-8 </stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert order number" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-297987887">"[0-9]+"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout success" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}checkout/onepage/success/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="494863233">Thank you for your purchase!</stringProp> + <stringProp name="-1590086334">Your order number is</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/account/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1723813687">You are signed out.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Clear Cookie" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">curSampler = ctx.getCurrentSampler(); +if(curSampler.getName().contains("Checkout success")) { + manager = curSampler.getCookieManager(); + manager.clear(); +} +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Customer to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> +customerUserList = props.get("customer_emails_list"); +customerUserList.add(vars.get("customer_email")); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Account management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAccountManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Account management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"> + <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> + <stringProp name="Cookie.value">30</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">/</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> + <stringProp name="Cookie.value">${form_key}</stringProp> + <stringProp name="Cookie.domain">${host}</stringProp> + <stringProp name="Cookie.path">${base_path}</stringProp> + <boolProp name="Cookie.secure">false</boolProp> + <longProp name="Cookie.expires">0</longProp> + <boolProp name="Cookie.path_specified">true</boolProp> + <boolProp name="Cookie.domain_specified">true</boolProp> + </elementProp> + </collectionProp> + <boolProp name="CookieManager.clearEachIteration">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <hashTree/> + + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="571386695"><title>Home page</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Login Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/account/login/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="637394530"><title>Customer Login</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${customer_email}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${customer_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="send" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">send</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/account/loginPost/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1312950388"><title>My Account</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Address" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">addressId</stringProp> + <stringProp name="RegexExtractor.regex">customer/address/edit/id/([^'"]+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert addressId extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">addressId</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Customer Private Data" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="sections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sections</stringProp> + </elementProp> + <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="My Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}sales/order/history/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_orders.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="220295440"><title>My Orders</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract orderId" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">orderId</stringProp> + <stringProp name="RegexExtractor.regex">sales/order/view/order_id/(\d+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">NOT_FOUND</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Orders Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_orders.jmx</stringProp> + <stringProp name="IfController.condition">"${orderId}" != "NOT_FOUND"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + </IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}sales/order/view/order_id/${orderId}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1956770127"><title>Order #</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract shipment tab" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">shipment_tab</stringProp> + <stringProp name="RegexExtractor.regex">sales/order/shipment/order_id/(\d+)..Order Shipments</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">NOT_FOUND</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Shipments Controller" enabled="true"> + <stringProp name="TestPlan.comments">May not have shipped</stringProp> + <stringProp name="IfController.condition">"${shipment_tab}" != "NOT_FOUND"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + </IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View Order Shipments" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}sales/order/shipment/order_id/${orderId}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="120578727">Track this shipment</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract popup link" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">popupLink</stringProp> + <stringProp name="RegexExtractor.regex">popupWindow": {"windowURL":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Track Shipment" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${popupLink}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-760430210"><title>Tracking Information</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="My Downloadable Products" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}downloadable/customer/products</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_downloadable_products.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="358050505"><title>My Downloadable Products</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract orderId" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">orderId</stringProp> + <stringProp name="RegexExtractor.regex">sales/order/view/order_id/(\d+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">NOT_FOUND</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract linkId" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">linkId</stringProp> + <stringProp name="RegexExtractor.regex">downloadable/download/link/id/(\d+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Downloadables Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_downloadables.jmx</stringProp> + <stringProp name="IfController.condition">"${orderId}" != "NOT_FOUND"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + </IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View Downloadable Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}sales/order/view/order_id/${orderId}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/view_downloadable_products.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1956770127"><title>Order #</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Download Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}downloadable/download/link/id/${linkId}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/download_product.jmx</stringProp></HTTPSamplerProxy> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="My Wish List" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}wishlist</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1907714722"><title>My Wish List</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract wishlistId" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">wishlistId</stringProp> + <stringProp name="RegexExtractor.regex">wishlist/index/update/wishlist_id/([^'"]+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_wish_list.jmx</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Verify that there are items in the wishlist" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">buttonTitle</stringProp> + <stringProp name="RegexExtractor.regex">Update Wish List</stringProp> + <stringProp name="RegexExtractor.template">FOUND</stringProp> + <stringProp name="RegexExtractor.default">NOT_FOUND</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Wish List Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_wishlist.jmx</stringProp> + <stringProp name="IfController.condition">"${buttonTitle}" === "FOUND"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + </IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Share Wish List" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}wishlist/index/share/wishlist_id/${wishlistId}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/share_wish_list.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1257102154"><title>Wish List Sharing</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Send Wish List" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="emails" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${customer_email}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">emails</stringProp> + </elementProp> + <elementProp name="message" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">[TEST] See my wishlist!!!</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">message</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}wishlist/index/send/wishlist_id/${wishlistId}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/send_wish_list.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1907714722"><title>My Wish List</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}customer/account/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1723813687">You are signed out.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Customer to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> +customerUserList = props.get("customer_emails_list"); +customerUserList.add(vars.get("customer_email")); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin CMS Management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminCMSManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin CMS Management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin CMS Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_cms_management/admin_cms_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/cms/page/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/cms/page/new</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="content" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>CMS Content ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">content</stringProp> + </elementProp> + <elementProp name="content_heading" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">content_heading</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="identifier" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">identifier</stringProp> + </elementProp> + <elementProp name="is_active" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_active</stringProp> + </elementProp> + <elementProp name="layout_update_xml" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">layout_update_xml</stringProp> + </elementProp> + <elementProp name="meta_description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_description</stringProp> + </elementProp> + <elementProp name="meta_keywords" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_keywords</stringProp> + </elementProp> + <elementProp name="meta_title" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_title</stringProp> + </elementProp> + <elementProp name="nodes_data" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">nodes_data</stringProp> + </elementProp> + <elementProp name="node_ids" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">node_ids</stringProp> + </elementProp> + <elementProp name="page_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">page_id</stringProp> + </elementProp> + <elementProp name="page_layout" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1column</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">page_layout</stringProp> + </elementProp> + <elementProp name="store_id[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_id[0]</stringProp> + </elementProp> + <elementProp name="title" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">CMS Title ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">title</stringProp> + </elementProp> + <elementProp name="website_root" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">website_root</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/cms/page/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-398886250">You saved the page.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCMSManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Browse Product Grid" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminBrowseProductGridPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin Browse Product Grid"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="script"> + 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"); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_products_grid/setup.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} pages count" enabled="true"> + <stringProp name="cacheKey"/> + <stringProp name="filename"/> + <stringProp name="parameters"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Filtered Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} filtered pages count" enabled="true"> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select Filtered ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count_filtered}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> +</TestFragmentController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_field</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_field</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">3</stringProp> + </ForeachController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Order Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_order</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_order</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">2</stringProp> + </ForeachController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page - Filtering + Sort By ${grid_sort_field} ${grid_sort_order}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[${grid_filter_field}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[${grid_filter_field}]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_field}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_order}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Browse Order Grid" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminBrowseOrderGridPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin Browse Order Grid"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="script"> + 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"); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_orders_grid/setup.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} pages count" enabled="true"> + <stringProp name="cacheKey"/> + <stringProp name="filename"/> + <stringProp name="parameters"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Filtered Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} filtered pages count" enabled="true"> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select Filtered ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count_filtered}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> +</TestFragmentController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_field</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_field</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">3</stringProp> + </ForeachController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Order Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_order</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_order</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">2</stringProp> + </ForeachController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page - Filtering + Sort By ${grid_sort_field} ${grid_sort_order}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[${grid_filter_field}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[${grid_filter_field}]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_field}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_order}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Create Product" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminProductCreationPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin Create Product"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Once Only Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/once_only_controller.jmx</stringProp> +</OnceOnlyController> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Related Product Id" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_related_product_id.jmx</stringProp> + <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; +import java.util.Random; +Random random = new Random(); +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"));</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Get Product Attributes" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - API Get product attributes" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filterGroups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">mycolor</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filterGroups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">attribute_code</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filterGroups][0][filters][1][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">mysize</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][1][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filterGroups][0][filters][1][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">attribute_code</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][1][field]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_product_attributes.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product attributes" enabled="true"> + <stringProp name="VAR">product_attributes</stringProp> + <stringProp name="JSONPATH">$.items</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="SetUp - Prepare product attributes" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> +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); +</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get Attribute Set Id" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product_set/index/filter/${attribute_set_filter}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">attribute_set_id</stringProp> + <stringProp name="RegexExtractor.regex">catalog&#x2F;product_set&#x2F;edit&#x2F;id&#x2F;([\d]+)&#x2F;"[\D\d]*Attribute Set 1</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="SetUp - Set Attribute Set Filter" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">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)); +</stringProp> + </BeanShellPreProcessor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; +import java.util.Random; +Random random = new Random(); +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)}"); + + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Bundle Product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_bundle_product.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1509986340">records found</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/new/set/4/type/bundle/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-144461265">New Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">42</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variations]</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + </elementProp> + <elementProp name="product[shipment_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[shipment_type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title one</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][title]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][required]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][product_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">25</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][product_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10.99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title two</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][title]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][required]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][option_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][product_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][delete]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">5.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][position]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][option_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][product_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][delete]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">7.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][position]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="affect_bundle_product_selections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_bundle_product_selections</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/set/4/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">42</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full bundle product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variations]</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + </elementProp> + <elementProp name="product[shipment_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[shipment_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title one</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][required]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">25</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10.99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title two</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][required]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">5.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">7.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_bundle_product_selections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_bundle_product_selections</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/set/4/type/bundle/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + <stringProp name="-1534079309">option title one</stringProp> + <stringProp name="-1534074215">option title two</stringProp> + <stringProp name="1304788671">${simple_product_2_name}</stringProp> + <stringProp name="417284990">${simple_product_1_name}</stringProp> + </collectionProp> + + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Create Configurable Product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/open_catalog_grid.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1509986340">records found</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Configurable Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/new/set/${attribute_set_id}/type/configurable/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/new_configurable.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-144461265">New Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Configurable Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${attribute_set_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[affect_product_custom_options]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[affect_product_custom_options]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[attribute_set_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${attribute_set_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[attribute_set_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][0]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_message_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_wrapping_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_wrapping_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_wrapping_price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[is_returnable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[is_returnable]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][deferred_stock_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][deferred_stock_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][manage_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_deferred_stock_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_deferred_stock_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_message_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_wrapping_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_is_returnable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_is_returnable]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[visibility]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[visibility]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[website_ids][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][1]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/set/${attribute_set_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_validate.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Prepare Configurable Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> +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); +} + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Configurable Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${attribute_set_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[affect_product_custom_options]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[affect_product_custom_options]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[attribute_set_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${attribute_set_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[attribute_set_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][0]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_message_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_wrapping_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_wrapping_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_wrapping_price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[is_returnable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[is_returnable]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][deferred_stock_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][deferred_stock_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][manage_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_deferred_stock_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_deferred_stock_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_message_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_wrapping_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_is_returnable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_is_returnable]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[visibility]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[visibility]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[website_ids][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][1]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/set/${attribute_set_id}/type/configurable/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_save.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert Variation" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> +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); + } +}); +</stringProp> + </JSR223Assertion> + <hashTree/> + + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Prepare Configurable Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> +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); +} + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + </hashTree> + </hashTree> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Downloadable Product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_downloadable_product.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1509986340">records found</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Downloadable Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/new/set/4/type/downloadable/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-144461265">New Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Downloadable Upload Original File" enabled="true"> + <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> + <collectionProp name="HTTPFileArgs.files"> + <elementProp name="${files_folder}downloadable_original.txt" elementType="HTTPFileArg"> + <stringProp name="File.path">${files_folder}downloadable_original.txt</stringProp> + <stringProp name="File.paramname">links</stringProp> + <stringProp name="File.mimetype">text/plain</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/downloadable_file/upload/type/links/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">false</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract original file" enabled="true"> + <stringProp name="VAR">original_file</stringProp> + <stringProp name="JSONPATH">$.file</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Downloadable Upload Sample File" enabled="true"> + <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> + <collectionProp name="HTTPFileArgs.files"> + <elementProp name="${files_folder}downloadable_sample.txt" elementType="HTTPFileArg"> + <stringProp name="File.path">${files_folder}downloadable_sample.txt</stringProp> + <stringProp name="File.paramname">samples</stringProp> + <stringProp name="File.mimetype">text/plain</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/downloadable_file/upload/type/samples/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">false</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract sample file" enabled="true"> + <stringProp name="VAR">sample_file</stringProp> + <stringProp name="JSONPATH">$.file</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Downloadable Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="is_downloadable" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">on</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_downloadable</stringProp> + </elementProp> + <elementProp name="product[links_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Links</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[links_title]</stringProp> + </elementProp> + <elementProp name="product[links_purchased_separately]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[links_purchased_separately]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][file]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${original_file}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][file]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable_original.txt</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">13</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][size]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">new</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][is_shareable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][is_shareable]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][is_unlimited]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][is_unlimited]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][link_url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][link_url]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][number_of_downloads]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][number_of_downloads]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">120</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][record_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][record_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sample][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sample][type]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sample][url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sample][url]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sort_order]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Original Link</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][title]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][type]</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][file]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${sample_file}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][file]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable_sample.txt</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][name]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">14</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">new</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][record_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][record_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][sample_url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][sample_url]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][sort_order]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Sample Link</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][title]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/set/4/type/downloadable/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Downloadable Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][file]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${original_file}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][file]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable_original.txt</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">13</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][size]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">new</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][is_shareable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][is_shareable]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][is_unlimited]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][is_unlimited]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][link_url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][link_url]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][number_of_downloads]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][number_of_downloads]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">120</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][record_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][record_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sample][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sample][type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sample][url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sample][url]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sort_order]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Original Link</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][title]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][file]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${sample_file}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][file]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable_sample.txt</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][name]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">14</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">new</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][record_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][record_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][sample_url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][sample_url]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][sort_order]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Sample Link</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][title]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/set/4/type/downloadable/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1600986843">violation</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Simple Product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_simple_product.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1509986340">records found</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Simple Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/new/set/4/type/simple/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-144461265">New Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Simple Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="product[options][1][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][is_delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][is_require]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][is_require]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][previous_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][previous_group]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][previous_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">drop_down</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][previous_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][sort_order]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Product Option Title One</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">drop_down</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][is_delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">fixed</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sku-one</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][sort_order]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Row Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][is_delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][is_require]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][is_require]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][max_characters]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">250</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][max_characters]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][previous_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">text</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][previous_group]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][previous_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">field</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][previous_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">fixed</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sku-two</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][sort_order]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Field Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">field</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/set/4/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Simple Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full simple product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="product[options][1][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][is_delete]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[options][1][is_require]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][is_require]</stringProp> + </elementProp> + <elementProp name="product[options][1][previous_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][previous_group]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][previous_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">drop_down</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][previous_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][sort_order]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Product Option Title One</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][title]</stringProp> + </elementProp> + <elementProp name="product[options][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">drop_down</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][type]</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][is_delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][price]</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">fixed</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][price_type]</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sku-one</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][sku]</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][sort_order]</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Row Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][title]</stringProp> + </elementProp> + <elementProp name="product[options][2][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][is_delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][is_require]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][is_require]</stringProp> + </elementProp> + <elementProp name="product[options][2][max_characters]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">250</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][max_characters]</stringProp> + </elementProp> + <elementProp name="product[options][2][previous_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">text</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][previous_group]</stringProp> + </elementProp> + <elementProp name="product[options][2][previous_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">field</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][previous_type]</stringProp> + </elementProp> + <elementProp name="product[options][2][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][price]</stringProp> + </elementProp> + <elementProp name="product[options][2][price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">fixed</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][price_type]</stringProp> + </elementProp> + <elementProp name="product[options][2][sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sku-two</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][sku]</stringProp> + </elementProp> + <elementProp name="product[options][2][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][sort_order]</stringProp> + </elementProp> + <elementProp name="product[options][2][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Field Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][title]</stringProp> + </elementProp> + <elementProp name="product[options][2][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">field</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][type]</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/set/4/type/simple/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1600986843">violation</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Edit Product" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminProductEditingPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin Edit Product"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Edit Product" enabled="true"/> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_product/admin_edit_product_updated.jmx</stringProp> + <stringProp name="BeanShellSampler.query">import java.util.ArrayList; + import java.util.HashMap; + import java.util.Random; + + int relatedIndex; + try { + Random random = new Random(); + if (${seedForRandom} > 0) { + 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); +}</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Simple Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/edit/id/${simple_product_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1355179215">Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract name" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">simple_product_name</stringProp> + <stringProp name="RegexExtractor.regex">,"name":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract sku" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">simple_product_sku</stringProp> + <stringProp name="RegexExtractor.regex">,"sku":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">simple_product_category_id</stringProp> + <stringProp name="RegexExtractor.regex">,"category_ids":."(\d+)".</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set updated values" enabled="true"> + <stringProp name="TestPlan.comments">Passing arguments between threads</stringProp> + <stringProp name="BeanShellSampler.query">//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"); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Simple Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full simple product Description ${simple_product_id} Edited</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variations]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Title Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Keyword Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Description Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/id/${simple_product_id}/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Simple Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${category_additional}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full simple product Description ${simple_product_id} Edited</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variations]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Title Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Keyword Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Description Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/id/${simple_product_id}/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/edit/id/${configurable_product_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1355179215">Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract name" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_name</stringProp> + <stringProp name="RegexExtractor.regex">,"name":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract sku" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_sku</stringProp> + <stringProp name="RegexExtractor.regex">,"sku":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_category_id</stringProp> + <stringProp name="RegexExtractor.regex">,"category_ids":."(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable attribute id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_id</stringProp> + <stringProp name="RegexExtractor.regex">,"configurable_variation":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <boolProp name="RegexExtractor.default_empty_value">true</boolProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable matrix" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_matrix</stringProp> + <stringProp name="RegexExtractor.regex">"configurable-matrix":(\[.*?\])</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <boolProp name="RegexExtractor.default_empty_value">true</boolProp> + </RegexExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract associated products ids" enabled="true"> + <stringProp name="VAR">associated_products_ids</stringProp> + <stringProp name="JSONPATH">$.[*].id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE">configurable_matrix</stringProp> + <stringProp name="SUBJECT">VAR</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable product json" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_data</stringProp> + <stringProp name="RegexExtractor.regex">(\{"product":.*?configurable_attributes_data.*?\})\s*<</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract configurable attributes data" enabled="true"> + <stringProp name="VAR">configurable_attributes_data</stringProp> + <stringProp name="JSONPATH">$.product.configurable_attributes_data</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE">configurable_product_data</stringProp> + <stringProp name="SUBJECT">VAR</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_ids</stringProp> + <stringProp name="RegexExtractor.regex">"attribute_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute codes" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_codes</stringProp> + <stringProp name="RegexExtractor.regex">"code":"(\w+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute labels" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_labels</stringProp> + <stringProp name="RegexExtractor.regex">"label":"(.*?)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute values" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_values</stringProp> + <stringProp name="RegexExtractor.regex">"values":(\{(?:\}|.*?\}\}))</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach configurable attribute id" enabled="true"> + <stringProp name="ForeachController.inputVal">configurable_attribute_ids</stringProp> + <stringProp name="ForeachController.returnVal">configurable_attribute_id</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + </ForeachController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${configurable_attribute_ids_matchNr}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">attribute_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="Process configurable attribute values" enabled="true"> + <stringProp name="BeanShellSampler.query">return vars.get("configurable_attribute_values_" + vars.get("attribute_counter"));</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Exctract attribute values" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">attribute_${configurable_attribute_id}_values</stringProp> + <stringProp name="RegexExtractor.regex">"value_index":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">configurable_attribute_values_${attribute_counter}</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">3</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${category_additional}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Configurable product description ${configurable_product_id} Edited</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Title Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Keyword Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Description Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_attribute_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_message_available]</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_wrapping_available]</stringProp> + </elementProp> + <elementProp name="product[visibility]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[visibility]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">50</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][type_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">configurable</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][type_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/id/${configurable_product_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Configure product options" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">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); + }</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]admin" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]admin</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">3</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${category_additional}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Configurable product description ${configurable_product_id} Edited</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Title Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Keyword Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Description Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_attribute_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_message_available]</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_wrapping_available]</stringProp> + </elementProp> + <elementProp name="product[visibility]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[visibility]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">50</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][type_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">configurable</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][type_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/id/${configurable_product_id}/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Configure product options" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">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); + }</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + <stringProp name="TestPlan.comments"> if have trouble see messages-message-error </stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Returns Management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminReturnsManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin Returns Management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1204796042">Create New Order</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">desc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Pending Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> +<hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order numbers" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_numbers</stringProp> + <stringProp name="RegexExtractor.regex">\"increment_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_ids</stringProp> + <stringProp name="RegexExtractor.regex">\"entity_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> + import java.util.ArrayList; + import java.util.HashMap; + 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); + + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/view/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2103620713">#${order_number}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order status" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_status</stringProp> + <stringProp name="RegexExtractor.regex"><span id="order_status">([^<]+)</span></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> + <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1233850814">Invoice Totals</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract ordered items ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">item_ids</stringProp> + <stringProp name="RegexExtractor.regex"><div id="order_item_(\d+)_title"\s*class="product-title"></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Submit" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_1}]</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_2}]</stringProp> + </elementProp> + <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Invoiced</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[comment_text]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1740524604">The invoice has been created</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Credit Memo Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_creditmemo/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1382627322">New Memo</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Credit Memo Submit - Full Refund" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="creditmemo[items][${item_ids_1}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[items][${item_ids_1}][qty]</stringProp> + </elementProp> + <elementProp name="creditmemo[items][${item_ids_2}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[items][${item_ids_2}][qty]</stringProp> + </elementProp> + <elementProp name="creditmemo[do_offline]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[do_offline]</stringProp> + </elementProp> + <elementProp name="creditmemo[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Credit Memo added</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[comment_text]</stringProp> + </elementProp> + <elementProp name="creditmemo[shipping_amount]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[shipping_amount]</stringProp> + </elementProp> + <elementProp name="creditmemo[adjustment_positive]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[adjustment_positive]</stringProp> + </elementProp> + <elementProp name="creditmemo[adjustment_negative]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[adjustment_negative]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_creditmemo/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-515117447">You created the credit memo</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Create/Process Returns - Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/pause.jmx</stringProp></TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Browse Customer Grid" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminBrowseCustomerGridPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin Browse Customer Grid"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="script"> + 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"); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_customers_grid/setup.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} pages count" enabled="true"> + <stringProp name="cacheKey"/> + <stringProp name="filename"/> + <stringProp name="parameters"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Filtered Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} filtered pages count" enabled="true"> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select Filtered ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count_filtered}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> +</TestFragmentController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_field</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_field</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">3</stringProp> + </ForeachController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Order Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_order</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_order</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">2</stringProp> + </ForeachController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page - Filtering + Sort By ${grid_sort_field} ${grid_sort_order}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[${grid_filter_field}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[${grid_filter_field}]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_field}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_order}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Create Order" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminCreateOrderPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin Create Order"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> + vars.put("alabama_region_id", props.get("alabama_region_id")); + vars.put("california_region_id", props.get("california_region_id")); +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Order" enabled="true"/> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_order/admin_create_order.jmx</stringProp> + <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; +import java.util.Random; +Random random = new Random(); + +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); +}</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Start Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/start/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree/> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Get Configurable Product Options" enabled="true"/> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get Configurable Product Options" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/configurable-products/${configurable_product_1_sku}/options/all</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract attribute_ids" enabled="true"> + <stringProp name="VAR">attribute_ids</stringProp> + <stringProp name="JSONPATH">$.[*].attribute_id</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract option_values" enabled="true"> + <stringProp name="VAR">option_values</stringProp> + <stringProp name="JSONPATH">$.[*].values[0].value_index</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Products" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="item[${simple_product_1_id}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">item[${simple_product_1_id}][qty]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="item[${simple_product_2_id}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">item[${simple_product_2_id}][qty]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="item[${configurable_product_1_id}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">item[${configurable_product_1_id}][qty]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="customer_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">customer_id</stringProp> + <stringProp name="Argument.value">${customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="store_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">store_id</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="currency_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">currency_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="payment[method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">payment[method]</stringProp> + <stringProp name="Argument.value">checkmo</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="reset_shipping" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">reset_shipping</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="json" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">json</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="as_js_varname" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">as_js_varname</stringProp> + <stringProp name="Argument.value">iFrameResponse</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/loadBlock/block/search,items,shipping_method,totals,giftmessage,billing_method?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Configure product options" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">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); +}</stringProp> + </BeanShellPreProcessor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Collect Shipping Rates" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="collect_shipping_rates" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">collect_shipping_rates</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="customer_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">customer_id</stringProp> + <stringProp name="Argument.value">${customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="store_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">store_id</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="currency_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">currency_id</stringProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="payment[method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">payment[method]</stringProp> + <stringProp name="Argument.value">checkmo</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="json" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">json</stringProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/loadBlock/block/shipping_method,totals?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Shipping Method" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1987784558">shipping_method</stringProp> + <stringProp name="818779431">Flat Rate</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Filled Order Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/index/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Filled Order Page" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-37823069">Select from existing customer addresses</stringProp> + <stringProp name="-13185722">Submit Order</stringProp> + <stringProp name="-209419315">Items Ordered</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="limit" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">limit</stringProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="entity_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">entity_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="email" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">email</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="Telephone" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">Telephone</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="billing_postcode" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">billing_postcode</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="billing_country_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">billing_country_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="billing_regione" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">billing_regione</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="store_name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">store_name</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="page" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">page</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[currency]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[currency]</stringProp> + <stringProp name="Argument.value">USD</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="sku" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">sku</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="qty" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">qty</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="limit" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">limit</stringProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="entity_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">entity_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="sku" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">sku</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="price[from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">price[from]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="price[to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">price[to]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="in_products" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">in_products</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="page" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">page</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="coupon_code" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">coupon_code</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[account][group_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[account][group_id]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[account][email]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[account][email]</stringProp> + <stringProp name="Argument.value">user_${customer_id}@example.com</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][customer_address_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][customer_address_id]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][prefix]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][firstname]</stringProp> + <stringProp name="Argument.value">Anthony</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][middlename]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][lastname]</stringProp> + <stringProp name="Argument.value">Nealy</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][suffix]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][company]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][street][0]</stringProp> + <stringProp name="Argument.value">123 Freedom Blvd. #123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][street][1]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][city]</stringProp> + <stringProp name="Argument.value">Fayetteville</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][country_id]</stringProp> + <stringProp name="Argument.value">US</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][region]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][region_id]</stringProp> + <stringProp name="Argument.value">${alabama_region_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][postcode]</stringProp> + <stringProp name="Argument.value">123123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][telephone]</stringProp> + <stringProp name="Argument.value">022-333-4455</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][fax]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][fax]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][vat_id]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipping_same_as_billing" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipping_same_as_billing</stringProp> + <stringProp name="Argument.value">on</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="payment[method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">payment[method]</stringProp> + <stringProp name="Argument.value">checkmo</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[shipping_method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[shipping_method]</stringProp> + <stringProp name="Argument.value">flatrate_flatrate</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[comment][customer_note]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[comment][customer_note]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[comment][customer_note_notify]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[comment][customer_note_notify]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[send_confirmation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[send_confirmation]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_id</stringProp> + <stringProp name="RegexExtractor.regex">${host}${base_path}${admin_path}/sales/order/index/order_id/(\d+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 1" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_item_1</stringProp> + <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 2" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_item_2</stringProp> + <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">2</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 3" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_item_3</stringProp> + <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">3</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 1" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_item_1</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 2" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_item_2</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 3" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_item_3</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Created" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="563107624">You created the order.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Invoice" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[items][${order_item_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[items][${order_item_1}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[items][${order_item_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[items][${order_item_2}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[items][${order_item_3}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[items][${order_item_3}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[comment_text]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Invoice Created" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1878312078">The invoice has been created.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Shipment" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[items][${order_item_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[items][${order_item_1}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[items][${order_item_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[items][${order_item_2}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[items][${order_item_3}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[items][${order_item_3}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[comment_text]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Shipment Created" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-348539683">The shipment has been created.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Category Management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminCategoryManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin Category Management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Category Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_category_management/admin_category_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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));</stringProp> + </JSR223Sampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select parent category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${parent_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open new category page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/add/store/0/parent/${parent_category_id}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1903925024"><title>New Category</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> + </elementProp> + <elementProp name="parent" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">parent</stringProp> + </elementProp> + <elementProp name="path" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">path</stringProp> + </elementProp> + <elementProp name="store_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_id</stringProp> + </elementProp> + <elementProp name="is_active" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_active</stringProp> + </elementProp> + <elementProp name="include_in_menu" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">include_in_menu</stringProp> + </elementProp> + <elementProp name="is_anchor" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_anchor</stringProp> + </elementProp> + <elementProp name="use_config[available_sort_by]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[available_sort_by]</stringProp> + </elementProp> + <elementProp name="use_config[default_sort_by]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[default_sort_by]</stringProp> + </elementProp> + <elementProp name="use_config[filter_price_range]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[filter_price_range]</stringProp> + </elementProp> + <elementProp name="use_default[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_default[url_key]</stringProp> + </elementProp> + <elementProp name="url_key_create_redirect" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">url_key_create_redirect</stringProp> + </elementProp> + <elementProp name="custom_use_parent_settings" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_use_parent_settings</stringProp> + </elementProp> + <elementProp name="custom_apply_to_products" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_apply_to_products</stringProp> + </elementProp> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Admin Category Management ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + </elementProp> + <elementProp name="url_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">admin-category-management-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">url_key</stringProp> + </elementProp> + <elementProp name="meta_title" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_title</stringProp> + </elementProp> + <elementProp name="description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">description</stringProp> + </elementProp> + <elementProp name="display_mode" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">PRODUCTS</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">display_mode</stringProp> + </elementProp> + <elementProp name="default_sort_by" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">position</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">default_sort_by</stringProp> + </elementProp> + <elementProp name="meta_keywords" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_keywords</stringProp> + </elementProp> + <elementProp name="meta_description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_description</stringProp> + </elementProp> + <elementProp name="custom_layout_update" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_layout_update</stringProp> + </elementProp> + <elementProp name="category_products" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"${simple_product_1_id}":"","${simple_product_2_id}":"","${simple_product_3_id}":"","${simple_product_4_id}":"","${simple_product_5_id}":""}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">category_products</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">URL</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_id</stringProp> + <stringProp name="RegexExtractor.regex">/catalog/category/edit/id/(\d+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select created category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${admin_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category row id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category attribute set id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_attribute_set_id</stringProp> + <stringProp name="RegexExtractor.regex">"attribute_set_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category parent Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_parent_id</stringProp> + <stringProp name="RegexExtractor.regex">"parent_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category created at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_created_at</stringProp> + <stringProp name="RegexExtractor.regex">"created_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category updated at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_updated_at</stringProp> + <stringProp name="RegexExtractor.regex">"updated_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category path" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_path</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":(.+)"path":"([^\"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category level" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_level</stringProp> + <stringProp name="RegexExtractor.regex">"level":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category name" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_name</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":(.+)"name":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_url_key</stringProp> + <stringProp name="RegexExtractor.regex">"url_key":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url path" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_url_path</stringProp> + <stringProp name="RegexExtractor.regex">"url_path":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category row id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_entity_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category attribute set id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_attribute_set_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category parent id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_parent_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category created at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_created_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category updated at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_updated_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category path" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="59022110">^[\d\\\/]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_path</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category level" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_level</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category name" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_name</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url key" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_url_key</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url path" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_url_path</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert products added" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="417284990">${simple_product_1_name}</stringProp> + <stringProp name="1304788671">${simple_product_2_name}</stringProp> + <stringProp name="-2102674944">${simple_product_3_name}</stringProp> + <stringProp name="-1215171263">${simple_product_4_name}</stringProp> + <stringProp name="-327667582">${simple_product_5_name}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Move category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="point" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">append</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">point</stringProp> + </elementProp> + <elementProp name="pid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${new_parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">pid</stringProp> + </elementProp> + <elementProp name="paid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paid</stringProp> + </elementProp> + <elementProp name="aid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">aid</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/move/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/delete/id/${admin_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category deleted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1277069529">You deleted the category.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCategoryManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Promotion Rules" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminPromotionRulesPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin Promotion Rules"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Promotions Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/new</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New Conditional" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1--1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> + </elementProp> + <elementProp name="type" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">type</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/newConditionHtml/form/sales_rule_formrule_conditions_fieldset_/form_namespace/sales_rule_form</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Rule Name ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + </elementProp> + <elementProp name="is_active" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_active</stringProp> + </elementProp> + <elementProp name="use_auto_generation" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_auto_generation</stringProp> </elementProp> - <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <elementProp name="is_rss" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.name">is_rss</stringProp> </elementProp> - <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <elementProp name="apply_to_shipping" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">apply_to_shipping</stringProp> + </elementProp> + <elementProp name="stop_rules_processing" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">stop_rules_processing</stringProp> + </elementProp> + <elementProp name="coupon_code" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[special_from_date]</stringProp> + <stringProp name="Argument.name">coupon_code</stringProp> </elementProp> - <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <elementProp name="uses_per_coupon" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[special_to_date]</stringProp> + <stringProp name="Argument.name">uses_per_coupon</stringProp> </elementProp> - <elementProp name="product[cost]" elementType="HTTPArgument"> + <elementProp name="uses_per_customer" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[cost]</stringProp> + <stringProp name="Argument.name">uses_per_customer</stringProp> </elementProp> - <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <elementProp name="sort_order" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sort_order</stringProp> + </elementProp> + <elementProp name="discount_amount" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">5</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">discount_amount</stringProp> + </elementProp> + <elementProp name="discount_qty" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">0</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + <stringProp name="Argument.name">discount_qty</stringProp> </elementProp> - <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <elementProp name="discount_step" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + <stringProp name="Argument.name">discount_step</stringProp> </elementProp> - <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <elementProp name="reward_points_delta" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">reward_points_delta</stringProp> + </elementProp> + <elementProp name="store_labels[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[0]</stringProp> + </elementProp> + <elementProp name="description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Rule Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">description</stringProp> + </elementProp> + <elementProp name="coupon_type" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">coupon_type</stringProp> + </elementProp> + <elementProp name="simple_action" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">cart_fixed</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">simple_action</stringProp> + </elementProp> + <elementProp name="website_ids[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">website_ids[0]</stringProp> + </elementProp> + <elementProp name="customer_group_ids[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer_group_ids[0]</stringProp> + </elementProp> + <elementProp name="from_date" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">from_date</stringProp> + </elementProp> + <elementProp name="to_date" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">to_date</stringProp> + </elementProp> + <elementProp name="rule[conditions][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Combine</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][type]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1][aggregator]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">all</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][aggregator]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][value]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][type]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][attribute]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">base_subtotal</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][attribute]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][operator]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">>=</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][operator]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">100</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + <stringProp name="Argument.name">rule[conditions][1--1][value]</stringProp> </elementProp> - <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <elementProp name="rule[conditions][1][new_chlid]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + <stringProp name="Argument.name">rule[conditions][1][new_chlid]</stringProp> </elementProp> - <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <elementProp name="rule[actions][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Product\Combine</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][type]</stringProp> + </elementProp> + <elementProp name="rule[actions][1][aggregator]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">all</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][aggregator]</stringProp> + </elementProp> + <elementProp name="rule[actions][1][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][value]</stringProp> + </elementProp> + <elementProp name="rule[actions][1][new_child]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + <stringProp name="Argument.name">rule[actions][1][new_child]</stringProp> + </elementProp> + <elementProp name="store_labels[1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[1]</stringProp> + </elementProp> + <elementProp name="store_labels[2]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[2]</stringProp> + </elementProp> + <elementProp name="related_banners" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">related_banners</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-396438583">You saved the rule.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminPromotionsManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Customer Management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminCustomerManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin Customer Management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Customer Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_customer_management/admin_customer_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> </elementProp> - <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> </elementProp> - <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> </elementProp> - <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">101</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> </elementProp> - <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Render" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.value">customer_listing</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + <stringProp name="Argument.name">namespace</stringProp> </elementProp> - <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <elementProp name="search" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> - </elementProp> - <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">100500</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> - </elementProp> - <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">100500</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][qty]</stringProp> - </elementProp> - <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> - </elementProp> - <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> - </elementProp> - <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">10000</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> - </elementProp> - <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> - </elementProp> - <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> - </elementProp> - <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> - </elementProp> - <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.name">search</stringProp> </elementProp> - <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> </elementProp> - <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">20</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> </elementProp> - <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <elementProp name="paging[current]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> - </elementProp> - <elementProp name="product[custom_design]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_design]</stringProp> - </elementProp> - <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_design_from]</stringProp> - </elementProp> - <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_design_to]</stringProp> - </elementProp> - <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.name">paging[current]</stringProp> </elementProp> - <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <elementProp name="sorting[field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">entity_id</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[page_layout]</stringProp> + <stringProp name="Argument.name">sorting[field]</stringProp> </elementProp> - <elementProp name="product[options_container]" elementType="HTTPArgument"> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.value">asc</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> </elementProp> - <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <elementProp name="isAjax" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.name">isAjax</stringProp> </elementProp> - <elementProp name="product[shipment_type]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[shipment_type]</stringProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][title]" elementType="HTTPArgument"> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Render" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">option title one</stringProp> + <stringProp name="Argument.value">customer_listing</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][title]</stringProp> + <stringProp name="Argument.name">namespace</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][option_id]" elementType="HTTPArgument"> + <elementProp name="search" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">Lastname</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][option_id]</stringProp> + <stringProp name="Argument.name">search</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][delete]" elementType="HTTPArgument"> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][delete]</stringProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][type]" elementType="HTTPArgument"> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.value">20</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][type]</stringProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][required]" elementType="HTTPArgument"> + <elementProp name="paging[current]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][required]</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][0][position]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][position]</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_id]</stringProp> + <stringProp name="Argument.name">paging[current]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <elementProp name="sorting[field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">entity_id</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][option_id]</stringProp> + <stringProp name="Argument.name">sorting[field]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.value">asc</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][product_id]</stringProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][delete]" elementType="HTTPArgument"> + <elementProp name="isAjax" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][delete]</stringProp> + <stringProp name="Argument.name">isAjax</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">25</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]</stringProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]</stringProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer edit url" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">customer_edit_url_path</stringProp> + <stringProp name="RegexExtractor.regex">actions":\{"edit":\{"href":"(?:http|https):\\/\\/(.*?)\\/customer\\/index\\/edit\\/id\\/(\d+)\\/",</stringProp> + <stringProp name="RegexExtractor.template">/customer/index/edit/id/$2$/</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer edit url" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">customer_edit_url_path</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Customer" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}${customer_edit_url_path}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert edit customer page" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1422614550">Customer Information</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer entity_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract website_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_website_id</stringProp> + <stringProp name="RegexExtractor.regex">"website_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer firstname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_firstname</stringProp> + <stringProp name="RegexExtractor.regex">"firstname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer lastname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_lastname</stringProp> + <stringProp name="RegexExtractor.regex">"lastname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer email" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_email</stringProp> + <stringProp name="RegexExtractor.regex">"email":"([^\@]+@[^.]+.[^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract group_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_group_id</stringProp> + <stringProp name="RegexExtractor.regex">"group_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract store_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_store_id</stringProp> + <stringProp name="RegexExtractor.regex">"store_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extact created_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_created_at</stringProp> + <stringProp name="RegexExtractor.regex">"created_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract updated_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_updated_at</stringProp> + <stringProp name="RegexExtractor.regex">"updated_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract is_active" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_is_active</stringProp> + <stringProp name="RegexExtractor.regex">"is_active":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract disable_auto_group_change" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_disable_auto_group_change</stringProp> + <stringProp name="RegexExtractor.regex">"disable_auto_group_change":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract created_in" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_created_in</stringProp> + <stringProp name="RegexExtractor.regex">"created_in":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract dob" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_dob</stringProp> + <stringProp name="RegexExtractor.regex">"dob":"(\d+)-(\d+)-(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$/$3$/$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_billing" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_default_billing</stringProp> + <stringProp name="RegexExtractor.regex">"default_billing":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_shipping" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_default_shipping</stringProp> + <stringProp name="RegexExtractor.regex">"default_shipping":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract gender" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_gender</stringProp> + <stringProp name="RegexExtractor.regex">"gender":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract failures_num" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_failures_num</stringProp> + <stringProp name="RegexExtractor.regex">"failures_num":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_entity_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{"entity_id":"(\d+)".+?"parent_id":"${admin_customer_entity_id}"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_created_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_created_at</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"created_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_updated_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_updated_at</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"updated_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_is_active" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_is_active</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"is_active":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_city" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_city</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"city":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_country_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_country_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"country_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_firstname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_firstname</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"firstname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_lastname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_lastname</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"lastname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_postcode" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_postcode</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"postcode":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_region</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_region_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address street" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_street</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"street":\["([^"]+)"\]</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_telephone" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_telephone</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"telephone":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_customer_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_customer_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"customer_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer entity_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_entity_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert website_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_website_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer firstname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_firstname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer lastname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_lastname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer email" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_email</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer group_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_group_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer store_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_store_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_created_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer updated_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_updated_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer is_active" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_is_active</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer disable_auto_group_change" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_disable_auto_group_change</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_in" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_created_in</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer dob" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="221072919">^\d+/\d+/\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_dob</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_billing" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_default_billing</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_shipping" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_default_shipping</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer gender" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_gender</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer failures_num" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_failures_num</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_entity_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_entity_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_created_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_created_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_updated_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_updated_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_is_active" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_is_active</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_city" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_city</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_country_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_country_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_firstname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_firstname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_lastname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_lastname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_postcode" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_postcode</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_region</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_region_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_street" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_street</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_telephone" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_telephone</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_customer_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_customer_id</stringProp> + </ResponseAssertion> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_qty]</stringProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]</stringProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][position]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][position]</stringProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="isAjax " elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_id]</stringProp> + <stringProp name="Argument.name">isAjax </stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <elementProp name="customer[entity_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][option_id]</stringProp> + <stringProp name="Argument.name">customer[entity_id]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <elementProp name="customer[website_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][product_id]</stringProp> + <stringProp name="Argument.name">customer[website_id]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][delete]" elementType="HTTPArgument"> + <elementProp name="customer[email]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_email}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][delete]</stringProp> + <stringProp name="Argument.name">customer[email]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <elementProp name="customer[group_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">10.99</stringProp> + <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]</stringProp> + <stringProp name="Argument.name">customer[group_id]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <elementProp name="customer[store_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]</stringProp> + <stringProp name="Argument.name">customer[store_id]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <elementProp name="customer[created_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_qty]</stringProp> + <stringProp name="Argument.name">customer[created_at]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <elementProp name="customer[updated_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]</stringProp> + <stringProp name="Argument.name">customer[updated_at]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][position]" elementType="HTTPArgument"> + <elementProp name="customer[is_active]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][position]</stringProp> + <stringProp name="Argument.name">customer[is_active]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][title]" elementType="HTTPArgument"> + <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">option title two</stringProp> + <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][title]</stringProp> + <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][option_id]" elementType="HTTPArgument"> + <elementProp name="customer[created_in]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][option_id]</stringProp> + <stringProp name="Argument.name">customer[created_in]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][delete]" elementType="HTTPArgument"> + <elementProp name="customer[prefix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][delete]</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][type]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">select</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][type]</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][required]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][required]</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][position]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][position]</stringProp> + <stringProp name="Argument.name">customer[prefix]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <elementProp name="customer[firstname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_id]</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">customer[firstname]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <elementProp name="customer[middlename]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][option_id]</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">customer[middlename]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <elementProp name="customer[lastname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][product_id]</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">customer[lastname]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][delete]" elementType="HTTPArgument"> + <elementProp name="customer[suffix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][delete]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">5.00</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_qty]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][position]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][position]</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">customer[suffix]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <elementProp name="customer[dob]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_dob}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_id]</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">customer[dob]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <elementProp name="customer[default_billing]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][option_id]</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">customer[default_billing]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][product_id]</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">customer[default_shipping]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][delete]" elementType="HTTPArgument"> + <elementProp name="customer[taxvat]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][delete]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">7.00</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_qty]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][position]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][position]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="affect_bundle_product_selections" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">2</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">affect_bundle_product_selections</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="links[related][0][id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${related_product_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[related][0][id]</stringProp> - </elementProp> - <elementProp name="links[related][0][position]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[related][0][position]</stringProp> - </elementProp> - <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${related_product_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[upsell][0][id]</stringProp> - </elementProp> - <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[upsell][0][position]</stringProp> - </elementProp> - <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${related_product_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> - </elementProp> - <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/set/4/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1853918323">{"error":false}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product Save" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="ajax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">ajax</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[name]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[name]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[sku]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[sku]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[price]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">42</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[price]</stringProp> - </elementProp> - <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">2</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tax_class_id]</stringProp> - </elementProp> - <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">111</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> - </elementProp> - <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> - </elementProp> - <elementProp name="product[weight]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1.0000</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[weight]</stringProp> - </elementProp> - <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[product_has_weight]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="product[category_ids][]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">2</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[category_ids][]</stringProp> - </elementProp> - <elementProp name="product[description]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"><p>Full bundle product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[description]</stringProp> - </elementProp> - <elementProp name="product[short_description]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"><p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[short_description]</stringProp> - </elementProp> - <elementProp name="product[status]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.name">customer[taxvat]</stringProp> </elementProp> - <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <elementProp name="customer[gender]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_gender}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[configurable_variations]</stringProp> + <stringProp name="Argument.name">customer[gender]</stringProp> </elementProp> - <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <elementProp name="customer[failures_num]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.name">customer[failures_num]</stringProp> </elementProp> - <elementProp name="product[image]" elementType="HTTPArgument"> + <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[image]</stringProp> + <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> </elementProp> - <elementProp name="product[small_image]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[small_image]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> </elementProp> - <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[thumbnail]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> </elementProp> - <elementProp name="product[url_key]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[url_key]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> </elementProp> - <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> </elementProp> - <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> </elementProp> - <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> </elementProp> - <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[website_ids][]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> </elementProp> - <elementProp name="product[special_price]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> </elementProp> - <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[special_from_date]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> </elementProp> - <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[special_to_date]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> </elementProp> - <elementProp name="product[cost]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[cost]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> </elementProp> - <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> </elementProp> - <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> </elementProp> - <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> </elementProp> - <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> </elementProp> - <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> </elementProp> - <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> </elementProp> - <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> </elementProp> - <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> </elementProp> - <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> </elementProp> - <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> </elementProp> - <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> </elementProp> - <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + <stringProp name="Argument.name">address[new_0][prefix]</stringProp> </elementProp> - <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.value">John</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + <stringProp name="Argument.name">address[new_0][firstname]</stringProp> </elementProp> - <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.name">address[new_0][middlename]</stringProp> </elementProp> - <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">Doe</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.name">address[new_0][lastname]</stringProp> </elementProp> - <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.name">address[new_0][suffix]</stringProp> </elementProp> - <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][company]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">Test Company</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.name">address[new_0][company]</stringProp> </elementProp> - <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][city]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.value">Folsom</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + <stringProp name="Argument.name">address[new_0][city]</stringProp> </elementProp> - <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">95630</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.name">address[new_0][postcode]</stringProp> </elementProp> - <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">1234567890</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.name">address[new_0][telephone]</stringProp> </elementProp> - <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> </elementProp> - <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">false</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> </elementProp> - <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">false</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> </elementProp> - <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">123 Main</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.name">address[new_0][street][0]</stringProp> </elementProp> - <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.name">address[new_0][street][1]</stringProp> </elementProp> - <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <elementProp name="address[new_0][region]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.name">address[new_0][region]</stringProp> </elementProp> - <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">US</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.name">address[new_0][country_id]</stringProp> </elementProp> - <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.name">address[new_0][region_id]</stringProp> </elementProp> - <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <elementProp name="form_key" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + <stringProp name="Argument.name">form_key</stringProp> </elementProp> - <elementProp name="product[custom_design]" elementType="HTTPArgument"> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/validate/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="isAjax " elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_design]</stringProp> + <stringProp name="Argument.name">isAjax </stringProp> </elementProp> - <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <elementProp name="customer[entity_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_design_from]</stringProp> + <stringProp name="Argument.name">customer[entity_id]</stringProp> </elementProp> - <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <elementProp name="customer[website_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_design_to]</stringProp> + <stringProp name="Argument.name">customer[website_id]</stringProp> </elementProp> - <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <elementProp name="customer[email]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_email}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.name">customer[email]</stringProp> </elementProp> - <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <elementProp name="customer[group_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[page_layout]</stringProp> + <stringProp name="Argument.name">customer[group_id]</stringProp> </elementProp> - <elementProp name="product[options_container]" elementType="HTTPArgument"> + <elementProp name="customer[store_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.name">customer[store_id]</stringProp> </elementProp> - <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <elementProp name="customer[created_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.name">customer[created_at]</stringProp> </elementProp> - <elementProp name="product[shipment_type]" elementType="HTTPArgument"> + <elementProp name="customer[updated_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[shipment_type]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[updated_at]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][title]" elementType="HTTPArgument"> + <elementProp name="customer[is_active]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">option title one</stringProp> + <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][title]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[is_active]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][option_id]" elementType="HTTPArgument"> + <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][option_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][delete]" elementType="HTTPArgument"> + <elementProp name="customer[created_in]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][delete]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[created_in]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][type]" elementType="HTTPArgument"> + <elementProp name="customer[prefix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][type]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[prefix]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][required]" elementType="HTTPArgument"> + <elementProp name="customer[firstname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][required]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[firstname]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][position]" elementType="HTTPArgument"> + <elementProp name="customer[middlename]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][position]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[middlename]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <elementProp name="customer[lastname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[lastname]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <elementProp name="customer[suffix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][option_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[suffix]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <elementProp name="customer[dob]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.value">${admin_customer_dob}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][product_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[dob]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][delete]" elementType="HTTPArgument"> + <elementProp name="customer[default_billing]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][delete]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[default_billing]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">25</stringProp> + <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[default_shipping]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <elementProp name="customer[taxvat]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[taxvat]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <elementProp name="customer[gender]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_gender}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[gender]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <elementProp name="customer[failures_num]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[failures_num]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][position]" elementType="HTTPArgument"> + <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][position]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][option_id]" elementType="HTTPArgument"> + + <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][option_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][product_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][delete]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][delete]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">10.99</stringProp> + <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][position]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][position]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][title]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">option title two</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][title]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][option_id]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][option_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][delete]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][delete]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][type]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][type]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][required]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][required]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][position]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][position]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][option_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][product_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][delete]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][delete]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">5.00</stringProp> + <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][prefix]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][position]" elementType="HTTPArgument"> + <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">John</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][position]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][firstname]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][middlename]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">Doe</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][option_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][lastname]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][product_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][suffix]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][delete]" elementType="HTTPArgument"> + <elementProp name="address[new_0][company]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">Test Company</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][delete]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][company]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <elementProp name="address[new_0][city]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">7.00</stringProp> + <stringProp name="Argument.value">Folsom</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][city]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">95630</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][postcode]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">1234567890</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][telephone]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> </elementProp> - <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][position]" elementType="HTTPArgument"> + <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">false</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][position]</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> </elementProp> - <elementProp name="affect_bundle_product_selections" elementType="HTTPArgument"> + <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.value">false</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">affect_bundle_product_selections</stringProp> - <stringProp name="Argument.desc">false</stringProp> + <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> </elementProp> - <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.value">123 Main</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[related][0][id]</stringProp> + <stringProp name="Argument.name">address[new_0][street][0]</stringProp> </elementProp> - <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[related][0][position]</stringProp> + <stringProp name="Argument.name">address[new_0][street][1]</stringProp> </elementProp> - <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <elementProp name="address[new_0][region]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + <stringProp name="Argument.name">address[new_0][region]</stringProp> </elementProp> - <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">US</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + <stringProp name="Argument.name">address[new_0][country_id]</stringProp> </elementProp> - <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.value">12</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + <stringProp name="Argument.name">address[new_0][region_id]</stringProp> </elementProp> - <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <elementProp name="form_key" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer saved" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="292987815">You saved the customer.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCustomerManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Edit Order" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminEditOrderPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[C] Admin Edit Order"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1204796042">Create New Order</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">desc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Pending Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> +<hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order numbers" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_numbers</stringProp> + <stringProp name="RegexExtractor.regex">\"increment_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_ids</stringProp> + <stringProp name="RegexExtractor.regex">\"entity_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> + import java.util.ArrayList; + import java.util.HashMap; + 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); + + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/view/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2103620713">#${order_number}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order status" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_status</stringProp> + <stringProp name="RegexExtractor.regex"><span id="order_status">([^<]+)</span></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> + <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Comment" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="history[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">history[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="history[comment]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Some text</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">history[comment]</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/addComment/order_id/${order_id}/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/add_comment.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-2089278331">Not Notified</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1233850814">Invoice Totals</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract ordered items ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">item_ids</stringProp> + <stringProp name="RegexExtractor.regex"><div id="order_item_(\d+)_title"\s*class="product-title"></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Submit" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_1}]</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_2}]</stringProp> + </elementProp> + <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Invoiced</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[comment_text]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1740524604">The invoice has been created</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="304100442">New Shipment</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Submit" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="shipment[items][${item_ids_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">shipment[items][${item_ids_1}]</stringProp> + </elementProp> + <elementProp name="shipment[items][${item_ids_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">shipment[items][${item_ids_2}]</stringProp> + </elementProp> + <elementProp name="shipment[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Shipped</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">shipment[comment_text]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_submit.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-2089453199">The shipment has been created</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + </hashTree> + + + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="GraphQL Combined Benchmark Pool" enabled="true"> + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> + <boolProp name="LoopController.continue_forever">false</boolProp> + <stringProp name="LoopController.loops">${loops}</stringProp> </elementProp> - </collectionProp> + <stringProp name="ThreadGroup.num_threads">${graphQLcombinedBenchmarkPoolUsers}</stringProp> + <stringProp name="ThreadGroup.ramp_time">${ramp_period}</stringProp> + <longProp name="ThreadGroup.start_time">1505803944000</longProp> + <longProp name="ThreadGroup.end_time">1505803944000</longProp> + <boolProp name="ThreadGroup.scheduler">false</boolProp> + <stringProp name="ThreadGroup.duration"/> + <stringProp name="ThreadGroup.delay"/> + <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Cache hit miss" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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)); + } +} +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Catalog Browsing By Guest" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cBrowseCatalogByGuestPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Catalog Browsing By Guest"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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}"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_categories.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.categoryList</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"name":"${category_name}","id":${category_id},</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Site Search" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cSiteSearchPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Site Search"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="Search Terms" enabled="true"> + <stringProp name="filename">${files_folder}search_terms.csv</stringProp> + <stringProp name="fileEncoding">UTF-8</stringProp> + <stringProp name="variableNames"/> + <stringProp name="delimiter">,</stringProp> + <boolProp name="quotedData">false</boolProp> + <boolProp name="recycle">true</boolProp> + <boolProp name="stopThread">false</boolProp> + <stringProp name="shareMode">shareMode.thread</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms.jmx</stringProp></CSVDataSet> + <hashTree/> + + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Cache hit miss" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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)); + } +} +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Quick Search" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${searchQuickPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Quick Search"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/search_quick.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product url keys" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> + <stringProp name="RegexExtractor.regex">"url_key":"([^'"]+)</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 1" enabled="true"> + <stringProp name="VAR">attribute_code_1</stringProp> + <stringProp name="JSONPATH">$.data.products.filters[1].request_var</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 1" enabled="true"> + <stringProp name="VAR">attribute_value_1</stringProp> + <stringProp name="JSONPATH">$.data.products.filters[1].filter_items[0].value_string</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 2" enabled="true"> + <stringProp name="VAR">attribute_code_2</stringProp> + <stringProp name="JSONPATH">$.data.products.filters[2].request_var</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 2" enabled="true"> + <stringProp name="VAR">attribute_value_2</stringProp> + <stringProp name="JSONPATH">$.data.products.filters[2].filter_items[0].value_string</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query"> +foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); + +if (foundProducts > 3) { + foundProducts = 3; +} + +vars.put("foundProducts", String.valueOf(foundProducts)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">${foundProducts}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +number = vars.get("_counter"); +product = vars.get("product_url_keys_"+number); + +vars.put("product_url_key", product); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.productDetail.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Quick Search With Filtration" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${searchQuickFilterPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Quick Search With Filtration"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/search_quick.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product url keys" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> + <stringProp name="RegexExtractor.regex">"url_key":"([^'"]+)</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 1" enabled="true"> + <stringProp name="VAR">attribute_code_1</stringProp> + <stringProp name="JSONPATH">$.data.products.filters[1].request_var</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 1" enabled="true"> + <stringProp name="VAR">attribute_value_1</stringProp> + <stringProp name="JSONPATH">$.data.products.filters[1].filter_items[0].value_string</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 2" enabled="true"> + <stringProp name="VAR">attribute_code_2</stringProp> + <stringProp name="JSONPATH">$.data.products.filters[2].request_var</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 2" enabled="true"> + <stringProp name="VAR">attribute_value_2</stringProp> + <stringProp name="JSONPATH">$.data.products.filters[2].filter_items[0].value_string</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Filter by Attribute" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Attributes Data" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/searched_attributes_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Filter by Attribute ${_counter}" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/search_quick_filter_attribute.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product url keys" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> + <stringProp name="RegexExtractor.regex">"url_key":"([^'"]+)</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query"> +foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); + +if (foundProducts > 3) { + foundProducts = 3; +} + +vars.put("foundProducts", String.valueOf(foundProducts)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">${foundProducts}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +number = vars.get("_counter"); +product = vars.get("product_url_keys_"+number); + +vars.put("product_url_key", product); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.productDetail.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Advanced Search" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${searchAdvancedPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Advanced Search"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Advanced" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/search_advanced.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product url keys" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> + <stringProp name="RegexExtractor.regex">"url_key":"([^'"]+)</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query"> +foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); + +if (foundProducts > 3) { + foundProducts = 3; +} + +vars.put("foundProducts", String.valueOf(foundProducts)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">${foundProducts}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +number = vars.get("_counter"); +product = vars.get("product_url_keys_"+number); + +vars.put("product_url_key", product); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.productDetail.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Add To Cart By Guest" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAddToCartByGuestPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Add To Cart By Guest"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1901638450">{"data":{"cart":{"items":[]}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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}"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_categories.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.categoryList</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"name":"${category_name}","id":${category_id},</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addSimpleProductsToCart</stringProp> + <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> + <stringProp name="VAR">product_option</stringProp> + <stringProp name="JSONPATH">$.data.productDetail.items[0].variants[0].product.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option_from_product_detail.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> + <stringProp name="675049292">"sku":"${product_option}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Add to Wishlist" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAddToWishlistPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Add to Wishlist"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n generateCustomerToken(\n email: \"${customer_email}\" \n password: \"${customer_password}\" \n ) {\n token \n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/login.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> + <stringProp name="VAR">customer_token</stringProp> + <stringProp name="JSONPATH">$.data.generateCustomerToken.token</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.generateCustomerToken.token</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Wishlist" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":" { \n customer {\n wishlist \n { \n id \n } \n } \n }","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_wishlist.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract wishlist id" enabled="true"> + <stringProp name="VAR">wishlist_id</stringProp> + <stringProp name="JSONPATH">$.data.customer.wishlist.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.customer.wishlist.id</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Products to Wishlist" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">5</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Wishlist" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_wishlist.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract wishlist product id" enabled="true"> + <stringProp name="VAR">wishlist_product_id</stringProp> + <stringProp name="JSONPATH">$.data.addProductsToWishlist.wishlist.items[0].id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.addProductsToWishlist.wishlist</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Delete Products from Wishlist" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">5</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete Product ${_counter} From Wishlist" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/clear_wishlist.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract wishlist product id" enabled="true"> + <stringProp name="VAR">wishlist_product_id</stringProp> + <stringProp name="JSONPATH">$.data.removeProductsFromWishlist.wishlist.items_v2.items[0].id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.removeProductsFromWishlist.wishlist</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check Wishlist" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":" { \n customer {\n wishlist \n { \n id \n items_count \n } \n } \n }","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/check_wishlist.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.customer.wishlist.items_count</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n revokeCustomerToken {\n result \n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/logout.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.revokeCustomerToken.result</stringProp> + <stringProp name="EXPECTED_VALUE">true</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Customer to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> +customerUserList = props.get("customer_emails_list"); +customerUserList.add(vars.get("customer_email")); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Compare Products" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cCompareProductsPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Compare Products"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Compare List" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createCompareList \n { \n uid \n } \n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_compare_list.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract compare list id" enabled="true"> + <stringProp name="VAR">compare_list_id</stringProp> + <stringProp name="JSONPATH">$.data.createCompareList.uid</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.createCompareList.uid</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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}"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_categories.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.categoryList</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"name":"${category_name}","id":${category_id},</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Comparison Add" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/product_compare_add.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.addProductsToCompareList.item_count</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Comparison Add" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/product_compare_add.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.addProductsToCompareList.item_count</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Compare Products" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query" :"{\n compareList(uid: \"${compare_list_id}\") { \n uid \n items { \n product { \n sku \n } \n } \n } \n}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/compare_products.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.compareList.items</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Compare Products Clear" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n deleteCompareList(uid: \"${compare_list_id}\") \n { \n result \n } \n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/compare_products_clear.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.deleteCompareList.result</stringProp> + <stringProp name="EXPECTED_VALUE">true</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Checkout By Guest" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cCheckoutByGuestPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Checkout By Guest"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/set/4/type/bundle/back/edit/active_tab/product-details/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-583471546">You saved the product</stringProp> - <stringProp name="-1534079309">option title one</stringProp> - <stringProp name="-1534074215">option title two</stringProp> - <stringProp name="1304788671">${simple_product_2_name}</stringProp> - <stringProp name="417284990">${simple_product_1_name}</stringProp> - </collectionProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1901638450">{"data":{"cart":{"items":[]}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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}"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_categories.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.categoryList</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"name":"${category_name}","id":${category_id},</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addSimpleProductsToCart</stringProp> + <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> + <stringProp name="VAR">product_option</stringProp> + <stringProp name="JSONPATH">$.data.productDetail.items[0].variants[0].product.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option_from_product_detail.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> + <stringProp name="675049292">"sku":"${product_option}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Email Available" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/checkout_email_available.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.setGuestEmailOnCart.cart.email</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Billing Address On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_billing_address_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1147076914">{"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"}}}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Shipping Address On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1671866339">{"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"}}]}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Payment Method On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_payment_method_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1830199373">{"data":{"setPaymentMethodOnCart":{"cart":{"selected_payment_method":{"code":"checkmo"}}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Current Shipping Address" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"{\n cart(cart_id: \"${quote_id}\") {\n shipping_addresses {\n postcode\n }\n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_current_shipping_address.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Shipping Method On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_method_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="644143859">{"data":{"setShippingMethodsOnCart":{"cart":{"shipping_addresses":[{"selected_shipping_method":{"carrier_code":"flatrate","method_code":"flatrate"}}]}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Place Order" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n placeOrder(input: \n {\n cart_id: \"${quote_id}\" \n }) {\n order {\n order_number \n }\n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/place_order.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.placeOrder.order.order_number</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Checkout By Customer" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cCheckoutByCustomerPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - </hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Checkout By Customer"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n generateCustomerToken(\n email: \"${customer_email}\" \n password: \"${customer_password}\" \n ) {\n token \n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/login.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> + <stringProp name="VAR">customer_token</stringProp> + <stringProp name="JSONPATH">$.data.generateCustomerToken.token</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.generateCustomerToken.token</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> </hashTree> - <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Test Fragment" enabled="true"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Create Cms Page with Page Builder Product List" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ee/admin_create_cms_page_with_page_builder_product_list/admin_create_cms_page_with_page_builder_product_list.jmx</stringProp> - </GenericController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">quote_id</stringProp> + <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Empty Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/cms/page/new</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="content" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">&lt;div data-content-type=&quot;row&quot; data-appearance=&quot;contained&quot; data-element=&quot;main&quot;&gt;&lt;div data-enable-parallax=&quot;0&quot; data-parallax-speed=&quot;0.5&quot; data-background-images=&quot;{}&quot; data-element=&quot;inner&quot; style=&quot;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;&quot;&gt;&lt;div data-content-type=&quot;products&quot; data-appearance=&quot;grid&quot; data-element=&quot;main&quot; style=&quot;border-style: none; border-width: 1px; border-radius: 0px; margin: 0px; padding: 0px;&quot;&gt;{{widget type=&quot;Magento\CatalogWidget\Block\Product\ProductsList&quot; template=&quot;Magento_CatalogWidget::product/widget/content/grid.phtml&quot; anchor_text=&quot;&quot; id_path=&quot;&quot; show_pager=&quot;0&quot; products_count=&quot;5&quot; sort_order=&quot;date_newest_top&quot; type_name=&quot;Catalog Products List&quot; conditions_encoded=&quot;^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`any`,`value`:`1`,`new_child`:``^]^]&quot;}}&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">content</stringProp> - </elementProp> - <elementProp name="content_heading" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">content_heading</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="identifier" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">identifier</stringProp> - </elementProp> - <elementProp name="is_active" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">is_active</stringProp> - </elementProp> - <elementProp name="layout_update_xml" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">layout_update_xml</stringProp> - </elementProp> - <elementProp name="meta_description" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">meta_description</stringProp> - </elementProp> - <elementProp name="meta_keywords" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">meta_keywords</stringProp> - </elementProp> - <elementProp name="meta_title" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">meta_title</stringProp> - </elementProp> - <elementProp name="nodes_data" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">nodes_data</stringProp> - </elementProp> - <elementProp name="node_ids" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">node_ids</stringProp> - </elementProp> - <elementProp name="page_id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">page_id</stringProp> - </elementProp> - <elementProp name="page_layout" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1column</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">page_layout</stringProp> - </elementProp> - <elementProp name="store_id[0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">store_id[0]</stringProp> - </elementProp> - <elementProp name="title" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Page Builder Products ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">title</stringProp> - </elementProp> - <elementProp name="website_root" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">website_root</stringProp> - </elementProp> - </collectionProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1901638450">{"data":{"cart":{"items":[]}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/cms/page/save/back/edit</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-398886250">You saved the page.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">URL</stringProp> - <stringProp name="RegexExtractor.refname">cms_page_id</stringProp> - <stringProp name="RegexExtractor.regex">/page_id\/([0-9]*)\/back/</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - </hashTree> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> </hashTree> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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}"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_categories.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.categoryList</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"name":"${category_name}","id":${category_id},</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1421843282">addSimpleProductsToCart</stringProp> + <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> </hashTree> - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Product Fixtures Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.value">{"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"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -36394,99 +63670,199 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> - <stringProp name="VAR">admin_token</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> + <stringProp name="VAR">product_option</stringProp> + <stringProp name="JSONPATH">$.data.productDetail.items[0].variants[0].product.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option_from_product_detail.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> + <stringProp name="675049292">"sku":"${product_option}"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_token</stringProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> </hashTree> + </hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Authorization</stringProp> - <stringProp name="Header.value">Bearer ${admin_token}</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> - <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Billing Address On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_billing_address_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1147076914">{"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"}}}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create product with extensible data objects" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Shipping Address On Cart" enabled="true"> <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "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" - } - } - ] - } -}</stringProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1671866339">{"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"}}]}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Payment Method On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -36494,751 +63870,988 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_product_with_extensible_data_objects.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_payment_method_on_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> - <stringProp name="VAR">simple_product_id</stringProp> - <stringProp name="JSONPATH">$.id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> - <stringProp name="VAR">simple_product_sku</stringProp> - <stringProp name="JSONPATH">$.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> - <stringProp name="VAR">simple_stock_item_id</stringProp> - <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">simple_product_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">simple_product_sku</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> + <stringProp name="-1830199373">{"data":{"setPaymentMethodOnCart":{"cart":{"selected_payment_method":{"code":"checkmo"}}}}}</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">simple_stock_item_id</stringProp> + <intProp name="Assertion.test_type">8</intProp> </ResponseAssertion> <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> </hashTree> - <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create configurable product" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_configurable_product_with_extensible_data_objects.jmx</stringProp> -</OnceOnlyController> - <hashTree> - <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Current Shipping Address" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="configurable_product_attribute_color_1" elementType="Argument"> - <stringProp name="Argument.name">configurable_product_attribute_color_1</stringProp> - <stringProp name="Argument.value">color123X</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - <elementProp name="configurable_product_attribute_color_2" elementType="Argument"> - <stringProp name="Argument.name">configurable_product_attribute_color_2</stringProp> - <stringProp name="Argument.value">color567Y</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"{\n cart(cart_id: \"${quote_id}\") {\n shipping_addresses {\n postcode\n }\n }\n}","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> - <elementProp name="color_attribute_section" elementType="Argument"> - <stringProp name="Argument.name">color_attribute_section</stringProp> - <stringProp name="Argument.value">0</stringProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_current_shipping_address.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Shipping Method On Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> - </Arguments> - <hashTree/> - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If color is assigned to default attribute set" enabled="true"> - <stringProp name="IfController.condition">"${color_attribute_section}" == "0"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - </IfController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Assign color to attribute set" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "attributeSetId": 4, - "attributeGroupId": 7, - "attributeCode": "color", - "sortOrder": 0 -} -</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attribute-sets/attributes</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1865724479">^\"\d+\"$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - </ResponseAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract color_attribute_section id" enabled="true"> - <stringProp name="VAR">color_attribute_section</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - </hashTree> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Get color values ids" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/color/options</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Extract color value #1" enabled="true"> - <stringProp name="JSONPostProcessor.referenceNames">color_1_value_id</stringProp> - <stringProp name="JSONPostProcessor.jsonPathExprs">$.[?(@.label =~ /${configurable_product_attribute_color_1}/i)].value</stringProp> - <stringProp name="JSONPostProcessor.match_numbers"/> - <stringProp name="JSONPostProcessor.defaultValues">null</stringProp> - </JSONPostProcessor> - <hashTree/> - <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Extract color value #2" enabled="true"> - <stringProp name="JSONPostProcessor.referenceNames">color_2_value_id</stringProp> - <stringProp name="JSONPostProcessor.jsonPathExprs">$.[?(@.label =~ /${configurable_product_attribute_color_2}/i)].value</stringProp> - <stringProp name="JSONPostProcessor.match_numbers"/> - <stringProp name="JSONPostProcessor.defaultValues">null</stringProp> - </JSONPostProcessor> - <hashTree/> - </hashTree> - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If color value #1 is null" enabled="true"> - <stringProp name="IfController.condition">"${color_1_value_id}" == "null"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - </IfController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create color #1 from existing color attribute " enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "option": { - "label": "${configurable_product_attribute_color_1}" - } -}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/color/options</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Option Id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^[a-z0-9_\"]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Get color values ids" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/color/options</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Extract color value #1" enabled="true"> - <stringProp name="JSONPostProcessor.referenceNames">color_1_value_id</stringProp> - <stringProp name="JSONPostProcessor.jsonPathExprs">$.[?(@.label =~ /${configurable_product_attribute_color_1}/i)].value</stringProp> - <stringProp name="JSONPostProcessor.match_numbers"/> - </JSONPostProcessor> - <hashTree/> - </hashTree> - </hashTree> - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If color value #2 is null" enabled="true"> - <stringProp name="IfController.condition">"${color_2_value_id}" == "null"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - </IfController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create color #2 from existing color attribute " enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "option": { - "label": "${configurable_product_attribute_color_2}" - } -}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/color/options</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Option Id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9_\"]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Get color values ids" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/color/options</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Extract color value #1" enabled="true"> - <stringProp name="JSONPostProcessor.referenceNames">color_2_value_id</stringProp> - <stringProp name="JSONPostProcessor.jsonPathExprs">$.[?(@.label =~ /${configurable_product_attribute_color_2}/i)].value</stringProp> - <stringProp name="JSONPostProcessor.match_numbers"/> - </JSONPostProcessor> - <hashTree/> - </hashTree> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create configurable product with extensible data objects" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "product": { - "sku": "configurable-apsku-test-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "name": "Configurable Extensible_Product_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "visibility": "4", - "type_id": "configurable", - "price": "99", - "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":"configurable_test_label_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "position":1, - "disabled":false, - "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": "configurable_test_image_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}.jpeg" - } - } - ] - } -}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> - <stringProp name="VAR">configurable_product_id</stringProp> - <stringProp name="JSONPATH">$.id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> - <stringProp name="VAR">configurable_product_sku</stringProp> - <stringProp name="JSONPATH">$.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> - <stringProp name="VAR">configurable_stock_item_id</stringProp> - <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_product_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_product_sku</stringProp> - </ResponseAssertion> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_method_on_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="644143859">{"data":{"setShippingMethodsOnCart":{"cart":{"shipping_addresses":[{"selected_shipping_method":{"carrier_code":"flatrate","method_code":"flatrate"}}]}}}}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + </ResponseAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Place Order" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n placeOrder(input: \n {\n cart_id: \"${quote_id}\" \n }) {\n order {\n order_number \n }\n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/place_order.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.placeOrder.order.order_number</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n revokeCustomerToken {\n result \n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/logout.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.revokeCustomerToken.result</stringProp> + <stringProp name="EXPECTED_VALUE">true</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Customer to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> +customerUserList = props.get("customer_emails_list"); +customerUserList.add(vars.get("customer_email")); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Account management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAccountManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_stock_item_id</stringProp> - </ResponseAssertion> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Account management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create child product with variation red" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "product": { - "sku": "apsku-test-${configurable_product_attribute_color_1}", - "name": "Extensible_Product_${configurable_product_attribute_color_1}", - "visibility": "1", - "type_id": "simple", - "price": "3.62", - "status": "1", - "attribute_set_id": "4", - "custom_attributes": [ - { - "attribute_code": "cost", - "value": "" - }, - { - "attribute_code": "description", - "value": "Description" - }, - { - "attribute_code": "color", - "value": "${color_1_value_id}" - } - ], - "extension_attributes":{ - "stock_item":{ - "manage_stock": 1, - "is_in_stock": 1, - "qty":"100" - } - } , - "media_gallery_entries": - [{ - "id": null, - "label":"test_label_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "position":1, - "disabled":false, - "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" - } - } - ] - } -}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> - <stringProp name="VAR">configurable_red_product_id</stringProp> - <stringProp name="JSONPATH">$.id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> - <stringProp name="VAR">configurable_red_product_sku</stringProp> - <stringProp name="JSONPATH">$.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> - <stringProp name="VAR">configurable_red_stock_item_id</stringProp> - <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_red_product_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-425311000">^[A-Za-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_red_product_sku</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_red_stock_item_id</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create child product with variation blue" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "product": { - "sku": "apsku-test-${configurable_product_attribute_color_2}", - "name": "Extensible_Product_${configurable_product_attribute_color_2}", - "visibility": "1", - "type_id": "simple", - "price": "3.62", - "status": "1", - "attribute_set_id": "4", - "custom_attributes": [ - { - "attribute_code": "cost", - "value": "" - }, - { - "attribute_code": "description", - "value": "Description" - }, - { - "attribute_code": "color", - "value": "${color_2_value_id}" - } - ], - "extension_attributes":{ - "stock_item":{ - "manage_stock": 1, - "is_in_stock": 1, - "qty":"100" - } - } , - "media_gallery_entries": - [{ - "id": null, - "label":"test_label_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "position":1, - "disabled":false, - "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" - } - } - ] - } -}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n generateCustomerToken(\n email: \"${customer_email}\" \n password: \"${customer_password}\" \n ) {\n token \n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/login.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> + <stringProp name="VAR">customer_token</stringProp> + <stringProp name="JSONPATH">$.data.generateCustomerToken.token</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.generateCustomerToken.token</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Orders" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/my_orders.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract order number" enabled="true"> + <stringProp name="VAR">order_number</stringProp> + <stringProp name="JSONPATH">$.data.customer.orders.items[0].number</stringProp> + <stringProp name="DEFAULT">NOT_FOUND</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.customer.orders</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Orders Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/if_orders.jmx</stringProp> + <stringProp name="IfController.condition">"${order_number}" != "NOT_FOUND"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + </IfController> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> - <stringProp name="VAR">configurable_blue_product_id</stringProp> - <stringProp name="JSONPATH">$.id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> - <stringProp name="VAR">configurable_blue_product_sku</stringProp> - <stringProp name="JSONPATH">$.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> - <stringProp name="VAR">configurable_blue_stock_item_id</stringProp> - <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View Orders" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/if_orders.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract shipments id" enabled="true"> + <stringProp name="VAR">shipments_id</stringProp> + <stringProp name="JSONPATH">$.data.customer.orders.items[0].shipments.id</stringProp> + <stringProp name="DEFAULT">NOT_FOUND</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.customer.orders.items</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="My Downloadable Products" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/my_downloadable_products.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.customerDownloadableProducts.items</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Wishlist" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":" { \n customer {\n wishlist \n { \n id \n items_count \n sharing_code \n updated_at \n } \n } \n }","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/my_wish_list.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.customer.wishlist.items_count</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"mutation {\n revokeCustomerToken {\n result \n }\n}","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/logout.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.revokeCustomerToken.result</stringProp> + <stringProp name="EXPECTED_VALUE">true</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Customer to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> +customerUserList = props.get("customer_emails_list"); +customerUserList.add(vars.get("customer_email")); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin CMS Management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminCMSManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_blue_product_id</stringProp> - </ResponseAssertion> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Admin CMS Management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-425311000">^[A-Za-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_blue_product_sku</stringProp> - </ResponseAssertion> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_blue_stock_item_id</stringProp> - </ResponseAssertion> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create color option for configurable product" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "option": { - "attribute_id": "93", - "label": "Color", - "position": 0, - "is_use_default": 1, - "values": [ - { - "value_index": 0 - } - ] - } -}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin CMS Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_cms_management/admin_cms_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/configurable-products/${configurable_product_sku}/options</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/cms/page/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> @@ -37246,37 +64859,19 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert option id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1865724479">^\"\d+\"$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Scope.variable"/> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create children from variation color #1" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"childSku": "apsku-test-${configurable_product_attribute_color_1}"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/configurable-products/${configurable_product_sku}/child</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/cms/page/new</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> @@ -37284,35 +64879,131 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert True" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="3569038">true</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create children from variation color #2" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> + <elementProp name="content" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>CMS Content ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">content</stringProp> + </elementProp> + <elementProp name="content_heading" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">content_heading</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="identifier" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">identifier</stringProp> + </elementProp> + <elementProp name="is_active" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_active</stringProp> + </elementProp> + <elementProp name="layout_update_xml" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">layout_update_xml</stringProp> + </elementProp> + <elementProp name="meta_description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_description</stringProp> + </elementProp> + <elementProp name="meta_keywords" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_keywords</stringProp> + </elementProp> + <elementProp name="meta_title" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_title</stringProp> + </elementProp> + <elementProp name="nodes_data" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"childSku": "apsku-test-${configurable_product_attribute_color_2}"}</stringProp> + <stringProp name="Argument.value">{}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">nodes_data</stringProp> + </elementProp> + <elementProp name="node_ids" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">node_ids</stringProp> + </elementProp> + <elementProp name="page_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">page_id</stringProp> + </elementProp> + <elementProp name="page_layout" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1column</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">page_layout</stringProp> + </elementProp> + <elementProp name="store_id[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_id[0]</stringProp> + </elementProp> + <elementProp name="title" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">CMS Title ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">title</stringProp> + </elementProp> + <elementProp name="website_root" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">website_root</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/configurable-products/${configurable_product_sku}/child</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/cms/page/save/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -37322,2991 +65013,4099 @@ vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNu <stringProp name="HTTPSampler.embedded_url_re"/> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert True" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="3569038">true</stringProp> + <stringProp name="-398886250">You saved the page.</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> + <intProp name="Assertion.test_type">16</intProp> </ResponseAssertion> <hashTree/> </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCMSManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin Browse Product Grid" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminBrowseProductGridPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Admin Browse Product Grid"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="script"> + 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"); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_products_grid/setup.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} pages count" enabled="true"> + <stringProp name="cacheKey"/> + <stringProp name="filename"/> + <stringProp name="parameters"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> </hashTree> - <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create bundle product" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_bundle_product_with_extensible_data_objects.jmx</stringProp> - </OnceOnlyController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create bundle product with extensible data objects" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "product": { - "sku": "bundle-apsku-test-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "name": "Bundle Extensible_Product_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "visibility": "4", - "type_id": "bundle", - "price": "99", - "status": "1", - "attribute_set_id": "4", - "custom_attributes": [ - { - "attribute_code": "price_view", - "value": "0" - }, - { - "attribute_code": "price_type", - "value": "0" - }, - { - "attribute_code": "weight_type", - "value": "0" - }, - { - "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":"bundle_test_label_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "position":1, - "disabled":false, - "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": "bundle_test_image_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}.jpeg" - } - } - ] - } - }</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract bundle product id" enabled="true"> - <stringProp name="VAR">bundle_product_id</stringProp> - <stringProp name="JSONPATH">$.id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> - <stringProp name="VAR">bundle_product_sku</stringProp> - <stringProp name="JSONPATH">$.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">bundle_product_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">bundle_product_sku</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create child product child simple 1" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "product": { - "sku": "apsku-test-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "name": "Extensible_Product_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "visibility": "1", - "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(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "position":1, - "disabled":false, - "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" - } - } - ] - } - }</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Filtered Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} filtered pages count" enabled="true"> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select Filtered ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count_filtered}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> +</TestFragmentController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_field</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_field</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">3</stringProp> + </ForeachController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Order Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_order</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_order</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">2</stringProp> + </ForeachController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page - Filtering + Sort By ${grid_sort_field} ${grid_sort_order}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">false</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> - <stringProp name="VAR">bundle_child_1_product_id</stringProp> - <stringProp name="JSONPATH">$.id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> - <stringProp name="VAR">bundle_child_1_product_sku</stringProp> - <stringProp name="JSONPATH">$.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> - <stringProp name="VAR">bundle_child_1_product_stock_item_id</stringProp> - <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">bundle_child_1_product_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-425311000">^[A-Za-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">bundle_child_1_product_sku</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">bundle_child_1_product_stock_item_id</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create child product child simple 2" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "product": { - "sku": "apsku-test-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "name": "Extensible_Product_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "visibility": "1", - "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(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "position":1, - "disabled":false, - "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" - } - } - ] - } - }</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <elementProp name="filters[${grid_filter_field}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[${grid_filter_field}]</stringProp> + <stringProp name="Argument.desc">false</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> - <stringProp name="VAR">bundle_child_2_product_id</stringProp> - <stringProp name="JSONPATH">$.id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> - <stringProp name="VAR">bundle_child_2_product_sku</stringProp> - <stringProp name="JSONPATH">$.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> - <stringProp name="VAR">bundle_child_2_product_stock_item_id</stringProp> - <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">bundle_child_2_product_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-425311000">^[A-Za-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">bundle_child_2_product_sku</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">bundle_child_2_product_stock_item_id</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create option and values for bundle product" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "option": { - "title": "option-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", - "required": 1, - "type": "select", - "position": 0, - "sku": "${bundle_product_sku}", - "product_links": [ - { - "sku": "${bundle_child_1_product_sku}", - "qty": 1, - "position": 0, - "is_default": 1, - "can_change_quantity": 0 - }, - { - "sku": "${bundle_child_2_product_sku}", - "qty": 1, - "position": 0, - "is_default": 0, - "can_change_quantity": 0 - } - ] - } - }</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">false</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/bundle-products/options/add</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert option id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1865724479">^\"\d+\"$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Scope.variable"/> - </ResponseAssertion> - <hashTree/> - </hashTree> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_field}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_order}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> </hashTree> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin Browse Order Grid" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminBrowseOrderGridPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Admin Browse Order Grid"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> - <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create downloadable product" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_downloadable_product_with_extensible_data_objects.jmx</stringProp> - </OnceOnlyController> + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="script"> + 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"); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_orders_grid/setup.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} pages count" enabled="true"> + <stringProp name="cacheKey"/> + <stringProp name="filename"/> + <stringProp name="parameters"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Filtered Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} filtered pages count" enabled="true"> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select Filtered ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count_filtered}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> +</TestFragmentController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_field</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_field</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">3</stringProp> + </ForeachController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Order Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_order</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_order</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">2</stringProp> + </ForeachController> <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create downloadable product with extensible data objects" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "product": { - "sku": "apsku-test-${__time()}-${__threadNum}-${__Random(1,1000000)}", - "name": "Extensible_Product_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "visibility": "4", - "type_id": "downloadable", - "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":false, - "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" - } - } - ] - } - }</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable product id" enabled="true"> - <stringProp name="VAR">downloadable_product_id</stringProp> - <stringProp name="JSONPATH">$.id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable product sku" enabled="true"> - <stringProp name="VAR">downloadable_product_sku</stringProp> - <stringProp name="JSONPATH">$.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">downloadable_product_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">downloadable_product_sku</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create Links and samples" enabled="true"/> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create link 1" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "link": { - "title": "link1", - "sort_order": 0, - "is_shareable": 1, - "price": 10, - "number_of_downloads": 10, - "link_type": "file", - "link_file_content": { - "file_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", - "name": "file1.jpeg", - "extension_attributes": {} - }, - "sample_type": "file", - "sample_file_content": { - "file_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", - "name": "file1.jpeg", - "extension_attributes": {} - }, - "extension_attributes": {} - }, - "isGlobalScopeContent": 1 - } - </stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${downloadable_product_sku}/downloadable-links</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable link id" enabled="true"> - <stringProp name="VAR">downloadable_link_id</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert response id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Scope.variable">downloadable_link_id</stringProp> - <stringProp name="Assertion.scope">variable</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create link 2" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "link": { - "title": "link2", - "sort_order": 0, - "is_shareable": 1, - "price": 10, - "number_of_downloads": 10, - "link_type": "file", - "link_file_content": { - "file_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", - "name": "file1.jpeg", - "extension_attributes": {} - }, - "sample_type": "file", - "sample_file_content": { - "file_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", - "name": "file1.jpeg", - "extension_attributes": {} - }, - "extension_attributes": {} - }, - "isGlobalScopeContent": 1 - } - </stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${downloadable_product_sku}/downloadable-links</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable link id" enabled="true"> - <stringProp name="VAR">downloadable_link_id</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert response id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Scope.variable">downloadable_link_id</stringProp> - <stringProp name="Assertion.scope">variable</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create link 3" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "link": { - "title": "link3", - "sort_order": 0, - "is_shareable": 1, - "price": 10, - "number_of_downloads": 10, - "link_type": "file", - "link_file_content": { - "file_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", - "name": "file1.jpeg", - "extension_attributes": {} - }, - "sample_type": "file", - "sample_file_content": { - "file_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", - "name": "file1.jpeg", - "extension_attributes": {} - }, - "extension_attributes": {} - }, - "isGlobalScopeContent": 1 - } - </stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${downloadable_product_sku}/downloadable-links</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable link id" enabled="true"> - <stringProp name="VAR">downloadable_link_id</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert response id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Scope.variable">downloadable_link_id</stringProp> - <stringProp name="Assertion.scope">variable</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create sample 1" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "sample": { - "title": "sample1", - "sort_order": 0, - "sample_type": "file", - "sample_file_content": { - "file_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", - "name": "file2.jpeg", - "extension_attributes": {} - }, - "sample_url": "string", - "extension_attributes": {} - }, - "isGlobalScopeContent": 1 - }</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${downloadable_product_sku}/downloadable-links/samples</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable sample id" enabled="true"> - <stringProp name="VAR">sample_link_id</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert response id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">sample_link_id</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create sample 2" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "sample": { - "title": "sample2", - "sort_order": 0, - "sample_type": "file", - "sample_file_content": { - "file_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", - "name": "file2.jpeg", - "extension_attributes": {} - }, - "sample_url": "string", - "extension_attributes": {} - }, - "isGlobalScopeContent": 1 - }</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${downloadable_product_sku}/downloadable-links/samples</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable sample id" enabled="true"> - <stringProp name="VAR">sample_link_id</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert response id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">sample_link_id</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page - Filtering + Sort By ${grid_sort_field} ${grid_sort_order}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[${grid_filter_field}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[${grid_filter_field}]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_field}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_order}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> </hashTree> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create virtual product with extensible data objects" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "product": { - "sku": "apsku-test-${__time()}-${__threadNum}-${__Random(1,1000000)}", - "name": "Extensible_Product_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "visibility": "4", - "type_id": "virtual", - "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" - } - } - ] - } - }</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin Create Product" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminProductCreationPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Admin Create Product"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Once Only Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/once_only_controller.jmx</stringProp> +</OnceOnlyController> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Related Product Id" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_related_product_id.jmx</stringProp> + <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; +import java.util.Random; +Random random = new Random(); +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"));</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Get Product Attributes" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - API Get product attributes" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filterGroups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">mycolor</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filterGroups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">attribute_code</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filterGroups][0][filters][1][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">mysize</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][1][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filterGroups][0][filters][1][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">attribute_code</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][1][field]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_product_attributes.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product attributes" enabled="true"> + <stringProp name="VAR">product_attributes</stringProp> + <stringProp name="JSONPATH">$.items</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="SetUp - Prepare product attributes" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> +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); +</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get Attribute Set Id" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product_set/index/filter/${attribute_set_filter}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">attribute_set_id</stringProp> + <stringProp name="RegexExtractor.regex">catalog&#x2F;product_set&#x2F;edit&#x2F;id&#x2F;([\d]+)&#x2F;"[\D\d]*Attribute Set 1</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="SetUp - Set Attribute Set Filter" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">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)); +</stringProp> + </BeanShellPreProcessor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; +import java.util.Random; +Random random = new Random(); +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)}"); + + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Bundle Product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_bundle_product.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1509986340">records found</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/new/set/4/type/bundle/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-144461265">New Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">42</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variations]</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + </elementProp> + <elementProp name="product[shipment_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[shipment_type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title one</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][title]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][required]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][product_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">25</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][product_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10.99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title two</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][title]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][required]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][option_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][product_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][delete]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">5.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][position]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_virtual_product_with_extensible_data_objects.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> - <stringProp name="VAR">virtual_product_id</stringProp> - <stringProp name="JSONPATH">$.id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> - <stringProp name="VAR">virtual_product_sku</stringProp> - <stringProp name="JSONPATH">$.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> - <stringProp name="VAR">virtual_stock_item_id</stringProp> - <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">virtual_product_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">virtual_product_sku</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">virtual_stock_item_id</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create grouped product" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_grouped_product_with_extensible_data_objects.jmx</stringProp> - </OnceOnlyController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create grouped product with extensible data objects" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "product": { - "sku": "apsku-test-${__time()}-${__threadNum}-${__Random(1,1000000)}", - "name": "Extensible_Product_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "visibility": "4", - "type_id": "grouped", - "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":false, - "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" - } - } - ] - } - }</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable product id" enabled="true"> - <stringProp name="VAR">grouped_product_id</stringProp> - <stringProp name="JSONPATH">$.id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable product sku" enabled="true"> - <stringProp name="VAR">grouped_product_sku</stringProp> - <stringProp name="JSONPATH">$.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">grouped_product_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">grouped_product_sku</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create Links" enabled="true"/> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create child bundle, configurable, simple, downloadable, for grouped" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "items": [ - { - "sku": "${grouped_product_sku}", - "link_type": "associated", - "linked_product_sku": "${bundle_product_sku}", - "linked_product_type": "bundle", - "position": 1, - "extension_attributes": { - "qty": 1 - } - }, - { - "sku": "${grouped_product_sku}", - "link_type": "associated", - "linked_product_sku": "${configurable_product_sku}", - "linked_product_type": "configurable", - "position": 2, - "extension_attributes": { - "qty": 1 - } - }, - { - "sku": "${grouped_product_sku}", - "link_type": "associated", - "linked_product_sku": "${simple_product_sku}", - "linked_product_type": "simple", - "position": 3, - "extension_attributes": { - "qty": 1 - } - }, - { - "sku": "${grouped_product_sku}", - "link_type": "associated", - "linked_product_sku": "${downloadable_product_sku}", - "linked_product_type": "downloadable", - "position": 4, - "extension_attributes": { - "qty": 1 - } - } - ] - } - </stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${grouped_product_sku}/links</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> - <stringProp name="VAR">grouped_product_response</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert add true" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="3569038">true</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">grouped_product_response</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - </hashTree> - </hashTree> - </hashTree> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Graphql Query Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> - <stringProp name="VAR">admin_token</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_token</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Authorization</stringProp> - <stringProp name="Header.value">Bearer ${admin_token}</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query multiple products" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][option_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_filter_only.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_multiple_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 200" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } - } - </stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query simple product" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_simple_product_with_extensible_data_objects.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_simple_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract response" enabled="true"> - <stringProp name="VAR">graphql_multiple_products_query_response</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][product_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][delete]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">7.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][position]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="affect_bundle_product_selections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_bundle_product_selections</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/set/4/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } -} -</stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert product sku" enabled="true"> - <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> - <stringProp name="EXPECTED_VALUE">${simple_product_sku}</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">true</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query configurable product" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_configurable_product_with_extensible_data_objects.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_configurable_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } -} - - -</stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert configurable product sku" enabled="true"> - <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> - <stringProp name="EXPECTED_VALUE">${configurable_product_sku}</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">true</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query products with full text search and filter" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_search_products_query_total_count_fulltext_filter</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_pages" enabled="true"> - <stringProp name="VAR">graphql_search_products_query_total_pages_fulltext_filter</stringProp> - <stringProp name="JSONPATH">$.data.products.page_info.total_pages</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } -} - - -</stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query products with full text search and filter last page" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter_last_page.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_search_products_query_total_count_fulltext_filter</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } -} - - -</stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query products with full text search only" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_only.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } -} - - -</stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query products with full text search and filters" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filters.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } -} - - -</stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query products with full text search and aggregations" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">42</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_aggregations.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } - } - </stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query bundle product" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\nproducts(filter: {sku: {eq:\"${bundle_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 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 BundleProduct {\n weight\n price_view\n dynamic_price\n dynamic_sku\n ship_bundle_items\n dynamic_weight\n items {\n option_id\n title\n required\n type\n position\n sku\n options {\n id\n qty\n position\n is_default\n price\n price_type\n can_change_quantity\n product {\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 }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_bundle_product_with_extensible_data_objects.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_bundle_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> - <stringProp name="BeanShellAssertion.query">String totalCount=vars.get("graphql_bundle_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; - } - } - - - </stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert bundle product sku" enabled="true"> - <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> - <stringProp name="EXPECTED_VALUE">${bundle_product_sku}</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">false</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query downloadable product" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: { eq: \"${downloadable_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 ... on DownloadableProduct {\n links_purchased_separately\n links_title\n downloadable_product_samples {\n id\n title\n sort_order\n sample_type\n sample_file\n sample_url\n }\n downloadable_product_links {\n id\n title\n sort_order\n is_shareable\n price\n number_of_downloads\n link_type\n sample_type\n sample_file\n sample_url\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_downloadable_product_with_extensible_data_objects.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_downloadable_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> - <stringProp name="BeanShellAssertion.query">String totalCount=vars.get("graphql_downloadable_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; - } - } - - - </stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert downloadable product sku" enabled="true"> - <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> - <stringProp name="EXPECTED_VALUE">${downloadable_product_sku}</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">true</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert link samples titles" enabled="true"> - <stringProp name="JSON_PATH">$.data.products.items[0].downloadable_product_samples..title</stringProp> - <stringProp name="EXPECTED_VALUE">["sample1","sample2"]</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">false</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert sample titles" enabled="true"> - <stringProp name="JSON_PATH">$.data.products.items[0].downloadable_product_samples..title</stringProp> - <stringProp name="EXPECTED_VALUE">["sample1","sample2"]</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">false</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query virtual product" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: { eq: \"${virtual_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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_virtual_product_with_extensible_data_objects.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_virtual_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> - <stringProp name="BeanShellAssertion.query">String totalCount=vars.get("graphql_virtual_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; - } -} -</stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert product sku" enabled="true"> - <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> - <stringProp name="EXPECTED_VALUE">${virtual_product_sku}</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">true</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query grouped product" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\nproducts(filter: {sku: {eq:\"${grouped_product_sku}\"} }, 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 GroupedProduct {\n weight\n items {\n qty\n position\n product {\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 }\n }\n}\n","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full bundle product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variations]</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_grouped_product_with_extensible_data_objects.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_grouped_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> - <stringProp name="BeanShellAssertion.query">String totalCount=vars.get("graphql_grouped_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; - } - } - - - </stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert grouped product sku" enabled="true"> - <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> - <stringProp name="EXPECTED_VALUE">${grouped_product_sku}</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">true</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - </hashTree> - - <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Query Customer" enabled="true"/> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create customer" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "customer": { - - "email": "customer_${__time()}-${__threadNum}-${__Random(1,1000000)}@example.com", - "firstname": "test_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "lastname": "Doe" - }, - "password": "test@123" - }</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/customers</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_frontend_customer.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer id" enabled="true"> - <stringProp name="VAR">customer_id</stringProp> - <stringProp name="JSONPATH">$.id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer id not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">customer_id</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check customer" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/customers/${customer_id}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/check_customer.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> - <stringProp name="JSON_PATH">$.id</stringProp> - <stringProp name="EXPECTED_VALUE">${customer_id}</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">true</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer email" enabled="true"> - <stringProp name="VAR">customer_email</stringProp> - <stringProp name="JSONPATH">$.email</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create customer token" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{ - "username":"${customer_email}", - "password":"test@123" - } - </stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/integration/customer/token</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_customer.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer token" enabled="true"> - <stringProp name="VAR">customer_token</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query customer with token" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_frontend_customer.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> - </BeanShellPreProcessor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert customer lastname" enabled="true"> - <stringProp name="JSON_PATH">$.data.customer.lastname</stringProp> - <stringProp name="EXPECTED_VALUE">Doe</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">true</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - </hashTree> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query Category" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_root_category.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_category_query_name</stringProp> - <stringProp name="JSONPATH">$.data.category.name</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="BeanShell Assertion" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } -} -</stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query CategoryList" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout"/> - <stringProp name="HTTPSampler.response_timeout"/> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_root_category_list.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_categoryList_query_name</stringProp> - <stringProp name="JSONPATH">$.data.categoryList[0].name</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - <stringProp name="INPUT_FORMAT">JSON</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="BeanShell Assertion" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } -} -</stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cms Page by id" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value"> - {"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"} - </stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> - <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> - <stringProp name="EXPECTED_VALUE">${cms_page_id}</stringProp> - <boolProp name="JSONVALIDATION">false</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">false</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - </hashTree> - </hashTree> - </hashTree> - - </hashTree> - - - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="GraphQL Pool" enabled="true"> - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> - <boolProp name="LoopController.continue_forever">false</boolProp> - <stringProp name="LoopController.loops">${loops}</stringProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> </elementProp> - <stringProp name="ThreadGroup.num_threads">${graphQLPoolUsers}</stringProp> - <stringProp name="ThreadGroup.ramp_time">${ramp_period}</stringProp> - <longProp name="ThreadGroup.start_time">1505803944000</longProp> - <longProp name="ThreadGroup.end_time">1505803944000</longProp> - <boolProp name="ThreadGroup.scheduler">false</boolProp> - <stringProp name="ThreadGroup.duration"/> - <stringProp name="ThreadGroup.delay"/> - <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> - <hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get List of Products by category_id" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetListOfProductsByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get List of Products by category_id"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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]); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"name":"${category_name}","id":${category_id},</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Simple Product Details by product_url_key" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetSimpleProductDetailsByProductUrlKeyPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Simple Product Details by product_url_key"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Simple Product Details by product_url_key" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Simple Product Details by name" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetSimpleProductDetailsByNamePercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Simple Product Details by name"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + </elementProp> + <elementProp name="product[shipment_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[shipment_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title one</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][required]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">25</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10.99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title two</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][required]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">5.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">7.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_bundle_product_selections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_bundle_product_selections</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Simple Product Details by name" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Configurable Product Detail by product_url_key" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetConfigurableProductDetailsByProductUrlKeyPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/set/4/type/bundle/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + <stringProp name="-1534079309">option title one</stringProp> + <stringProp name="-1534074215">option title two</stringProp> + <stringProp name="1304788671">${simple_product_2_name}</stringProp> + <stringProp name="417284990">${simple_product_1_name}</stringProp> + </collectionProp> - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Configurable Product Detail by product_url_key"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by product_url_key" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Create Configurable Product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/open_catalog_grid.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> + <stringProp name="1509986340">records found</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> @@ -40314,711 +69113,548 @@ vars.put("product_sku", product.get("sku")); </ResponseAssertion> <hashTree/> </hashTree> - </hashTree> - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Configurable Product Detail by name" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetConfigurableProductDetailsByNamePercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Configurable Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/new/set/${attribute_set_id}/type/configurable/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/new_configurable.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Configurable Product Detail by name"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-144461265">New Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Configurable Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${attribute_set_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[affect_product_custom_options]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[affect_product_custom_options]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[attribute_set_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${attribute_set_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[attribute_set_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][0]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_message_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_wrapping_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_wrapping_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_wrapping_price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[is_returnable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[is_returnable]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][deferred_stock_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][deferred_stock_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][manage_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_deferred_stock_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_deferred_stock_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Product Search by text and category_id" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetProductSearchByTextAndCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Product Search by text and category_id"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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]); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Product Search by text and category_id" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } -} - - -</stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Category List by category_id" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Category List by category_id"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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]); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List by category_id" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value"> - {"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"} - </stringProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_category_list_by_category_id.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert found categories" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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); - } - } - -} - -</stringProp> - </JSR223Assertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Category List by category_url_key" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Category List by category_url_key"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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]); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List by category_url_key" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}"}</stringProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_message_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_wrapping_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_is_returnable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_is_returnable]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[visibility]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[visibility]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[website_ids][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][1]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_category_list_by_category_url_key.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert found categories" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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); - } - } - -} - -</stringProp> - </JSR223Assertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Multiple Categories" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Multiple Categories"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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); -</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_multiple_categories_setup.jmx</stringProp> - </JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get multiple categories by ID" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}"}</stringProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/set/${attribute_set_id}/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -41026,392 +69662,611 @@ vars.put("category_id_4", categories[numbers[3]].id); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_multiple_categories_by_id.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert category count" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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); -} -</stringProp> - </JSR223Assertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Categories Query: Get Multiple Categories By Id" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_validate.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Categories Query: Get Multiple Categories By Id"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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); -</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_multiple_categories_setup.jmx</stringProp> - </JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="[categories query] Get multiple categories by ID" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/categories_query_get_multiple_categories_by_id.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert category count" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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); -} -</stringProp> - </JSR223Assertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Categories Query: Get Many Categories with Pagination" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetCategoryListByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Prepare Configurable Data" enabled="true"> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Categories Query: Get Many Categories with Pagination"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="[categories query] Get many categories by name" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/categories_query_get_many_categories_by_name_match.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert category count" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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); -} -</stringProp> - </JSR223Assertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Url Info by url_key" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlUrlInfoByUrlKeyPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } +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); - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Url Info by url_key"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; +function addConfigurableAttributeData(attribute) { + var attributeId = attribute.id; -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); + 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); + }); } -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">random = vars.getObject("randomIntGenerator"); +/** + * Build 4 simple products for Configurable + */ +function addConfigurableMatrix(attributes) { -var categories = props.get("categories"); -number = random.nextInt(categories.length); + 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; -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]); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> - <hashTree/> + 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); +} + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Url Info by url_key" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Configurable Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value"> - {"query":"query resolveUrl($urlKey: String!) {\n urlResolver(url: $urlKey) {\n type\n id\n }\n}","variables":{"urlKey":"${category_url_key}${url_suffix}"},"operationName":"resolveUrl"} - </stringProp> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${attribute_set_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[affect_product_custom_options]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[affect_product_custom_options]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[attribute_set_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${attribute_set_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[attribute_set_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][0]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_message_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_wrapping_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[gift_wrapping_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[gift_wrapping_price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[is_returnable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[is_returnable]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku} - Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][deferred_stock_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][deferred_stock_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][manage_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_deferred_stock_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_deferred_stock_update]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_message_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_wrapping_available]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[use_config_is_returnable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_is_returnable]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[visibility]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[visibility]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[website_ids][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][1]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/set/${attribute_set_id}/type/configurable/back/edit/active_tab/product-details/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -41419,1343 +70274,3304 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_url_info_by_url_key.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_save.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1062388959">{"type":"CATEGORY","id":${category_id}}</stringProp> + <stringProp name="-583471546">You saved the product</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Cms Page by id" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetCmsPageByIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Assert Variation" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> +var configurableVariations = vars.getObject("configurable_variations_assertion"), +response = SampleResult.getResponseDataAsString(); - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Cms Page by id"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> +configurableVariations.forEach(function (variation) { + if (response.indexOf(variation) == -1) { + AssertionResult.setFailureMessage("Cannot find variation \"" + variation + "\""); + AssertionResult.setFailure(true); + } +}); +</stringProp> + </JSR223Assertion> + <hashTree/> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Prepare Configurable Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> +attributes = vars.getObject("product_attributes"); -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); +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); } -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare CMS Page" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">random = vars.getObject("randomIntGenerator"); +addConfigurableMatrix(attributes); -var cmsPages = props.get("cms_pages"); -var number = random.nextInt(cmsPages.length); +function addConfigurableAttributeData(attribute) { + var attributeId = attribute.id; -vars.put("cms_page_id", cmsPages[number].id); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/prepare_cms_page.jmx</stringProp></JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cms Page by id" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value"> - {"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"} - </stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> - <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> - <stringProp name="EXPECTED_VALUE">${cms_page_id}</stringProp> - <boolProp name="JSONVALIDATION">false</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">false</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - </hashTree> - </hashTree> + 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); + }); +} - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Navigation Menu by category_id" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetNavigationMenuByCategoryIdPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } +/** + * 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; - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Navigation Menu by category_id"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; + 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); + }); + }); -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); + sampler.addArgument("configurable-matrix-serialized", JSON.stringify(products)); + vars.putObject("configurable_variations_assertion", variationNames); } - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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]); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Navigation Menu by category_id" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"id":${category_id},"name":"${category_name}","product_count"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx</stringProp></JSR223PreProcessor> + <hashTree/> </hashTree> </hashTree> - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Create Empty Cart" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlCreateEmptyCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Downloadable Product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_downloadable_product.jmx</stringProp> +</TestFragmentController> <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1509986340">records found</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Downloadable Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/new/set/4/type/downloadable/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-144461265">New Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Create Empty Cart"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Downloadable Upload Original File" enabled="true"> + <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> + <collectionProp name="HTTPFileArgs.files"> + <elementProp name="${files_folder}downloadable_original.txt" elementType="HTTPFileArg"> + <stringProp name="File.path">${files_folder}downloadable_original.txt</stringProp> + <stringProp name="File.paramname">links</stringProp> + <stringProp name="File.mimetype">text/plain</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/downloadable_file/upload/type/links/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">false</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract original file" enabled="true"> + <stringProp name="VAR">original_file</stringProp> + <stringProp name="JSONPATH">$.file</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Downloadable Upload Sample File" enabled="true"> + <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> + <collectionProp name="HTTPFileArgs.files"> + <elementProp name="${files_folder}downloadable_sample.txt" elementType="HTTPFileArg"> + <stringProp name="File.path">${files_folder}downloadable_sample.txt</stringProp> + <stringProp name="File.paramname">samples</stringProp> + <stringProp name="File.mimetype">text/plain</stringProp> + </elementProp> + </collectionProp> </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/downloadable_file/upload/type/samples/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">false</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract sample file" enabled="true"> + <stringProp name="VAR">sample_file</stringProp> + <stringProp name="JSONPATH">$.file</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Downloadable Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="is_downloadable" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">on</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_downloadable</stringProp> + </elementProp> + <elementProp name="product[links_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Links</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[links_title]</stringProp> + </elementProp> + <elementProp name="product[links_purchased_separately]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[links_purchased_separately]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][file]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${original_file}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][file]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable_original.txt</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">13</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][size]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">new</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][is_shareable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][is_shareable]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][is_unlimited]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][is_unlimited]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][link_url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][link_url]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][number_of_downloads]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][number_of_downloads]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">120</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][price]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][record_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][record_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sample][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sample][type]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sample][url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sample][url]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sort_order]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Original Link</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][title]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][type]</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][file]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${sample_file}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][file]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable_sample.txt</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][name]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">14</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">new</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][record_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][record_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][sample_url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][sample_url]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][sort_order]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Sample Link</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][title]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Get Empty Cart" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlGetEmptyCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Get Empty Cart"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/set/4/type/downloadable/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Downloadable Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][file]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${original_file}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][file]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable_original.txt</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">13</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][size]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][file][0][status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">new</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][file][0][status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][is_shareable]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][is_shareable]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][is_unlimited]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][is_unlimited]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][link_url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][link_url]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][number_of_downloads]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][number_of_downloads]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">120</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][record_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][record_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sample][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sample][type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sample][url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sample][url]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][sort_order]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Original Link</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][title]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[link][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[link][0][type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][file]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${sample_file}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][file]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">downloadable_sample.txt</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][name]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">14</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][file][0][status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">new</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][file][0][status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][record_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][record_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][sample_url]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][sample_url]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][sort_order]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Sample Link</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][title]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="downloadable[sample][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">file</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">downloadable[sample][0][type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1901638450">{"data":{"cart":{"items":[]}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Set Shipping Address On Cart" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlSetShippingAddressOnCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/set/4/type/downloadable/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Set Shipping Address On Cart"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1600986843">violation</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1901638450">{"data":{"cart":{"items":[]}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Shipping Address On Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1671866339">{"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"}}]}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> + </hashTree> </hashTree> - </hashTree> - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Set Billing Address On Cart" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlSetBillingAddressOnCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Simple Product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_simple_product.jmx</stringProp> +</TestFragmentController> <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Set Billing Address On Cart"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1509986340">records found</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Simple Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/new/set/4/type/simple/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-144461265">New Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Simple Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="product[options][1][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][is_delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][is_require]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][is_require]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][previous_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][previous_group]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][previous_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">drop_down</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][previous_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][sort_order]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Product Option Title One</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">drop_down</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][is_delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">fixed</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sku-one</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][sort_order]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Row Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][is_delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][is_require]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][is_require]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][max_characters]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">250</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][max_characters]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][previous_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">text</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][previous_group]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][previous_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">field</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][previous_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">fixed</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sku-two</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][sort_order]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Field Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">field</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1901638450">{"data":{"cart":{"items":[]}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Billing Address On Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_billing_address_on_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1147076914">{"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"}}}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Add Simple Product To Cart" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlAddSimpleProductToCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Add Simple Product To Cart"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/set/4/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Simple Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full simple product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="product[options][1][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][is_delete]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[options][1][is_require]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][is_require]</stringProp> + </elementProp> + <elementProp name="product[options][1][previous_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][previous_group]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][previous_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">drop_down</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][previous_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][sort_order]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Product Option Title One</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][title]</stringProp> + </elementProp> + <elementProp name="product[options][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">drop_down</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][type]</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][is_delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][price]</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">fixed</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][price_type]</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sku-one</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][sku]</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][sort_order]</stringProp> + </elementProp> + <elementProp name="product[options][1][values][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Row Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][1][values][1][title]</stringProp> + </elementProp> + <elementProp name="product[options][2][is_delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][is_delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options][2][is_require]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][is_require]</stringProp> + </elementProp> + <elementProp name="product[options][2][max_characters]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">250</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][max_characters]</stringProp> + </elementProp> + <elementProp name="product[options][2][previous_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">text</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][previous_group]</stringProp> + </elementProp> + <elementProp name="product[options][2][previous_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">field</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][previous_type]</stringProp> + </elementProp> + <elementProp name="product[options][2][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][price]</stringProp> + </elementProp> + <elementProp name="product[options][2][price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">fixed</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][price_type]</stringProp> + </elementProp> + <elementProp name="product[options][2][sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sku-two</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][sku]</stringProp> + </elementProp> + <elementProp name="product[options][2][sort_order]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][sort_order]</stringProp> + </elementProp> + <elementProp name="product[options][2][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Field Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][title]</stringProp> + </elementProp> + <elementProp name="product[options][2][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">field</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options][2][type]</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> + </collectionProp> </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addSimpleProductsToCart</stringProp> - <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Add Configurable Product To Cart" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlAddConfigurableProductToCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/set/4/type/simple/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Add Configurable Product To Cart"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1600986843">violation</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + </ResponseAssertion> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> + </hashTree> </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> - <stringProp name="VAR">product_option</stringProp> - <stringProp name="JSONPATH">$.data.products.items[0].variants[0].product.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Configurable Product To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> - <stringProp name="675049292">"sku":"${product_option}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Update Simple Product Qty In Cart" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin Edit Product" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateSimpleProductQtyInCartPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminProductEditingPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -42781,244 +73597,2484 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Update Simple Product Qty In Cart"); + vars.put("testLabel", "[GraphQL C] Admin Edit Product"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); +if (adminUsersDistribution == 1) { + adminUser = adminUserList.poll(); +} else { + if (!adminUserListIterator.hasNext()) { + adminUserListIterator = adminUserList.descendingIterator(); + } + + adminUser = adminUserListIterator.next(); } -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> </hashTree> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Edit Product" enabled="true"/> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_product/admin_edit_product_updated.jmx</stringProp> + <stringProp name="BeanShellSampler.query">import java.util.ArrayList; + import java.util.HashMap; + import java.util.Random; + + int relatedIndex; + try { + Random random = new Random(); + if (${seedForRandom} > 0) { + 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); +}</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Simple Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/edit/id/${simple_product_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1355179215">Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract name" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">simple_product_name</stringProp> + <stringProp name="RegexExtractor.regex">,"name":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract sku" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">simple_product_sku</stringProp> + <stringProp name="RegexExtractor.regex">,"sku":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">simple_product_category_id</stringProp> + <stringProp name="RegexExtractor.regex">,"category_ids":."(\d+)".</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set updated values" enabled="true"> + <stringProp name="TestPlan.comments">Passing arguments between threads</stringProp> + <stringProp name="BeanShellSampler.query">//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"); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Simple Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full simple product Description ${simple_product_id} Edited</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variations]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Title Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Keyword Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Description Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/id/${simple_product_id}/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Simple Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${category_additional}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full simple product Description ${simple_product_id} Edited</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variations]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Title Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Keyword Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Description Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/id/${simple_product_id}/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/edit/id/${configurable_product_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1355179215">Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract name" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_name</stringProp> + <stringProp name="RegexExtractor.regex">,"name":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract sku" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_sku</stringProp> + <stringProp name="RegexExtractor.regex">,"sku":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_category_id</stringProp> + <stringProp name="RegexExtractor.regex">,"category_ids":."(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable attribute id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_id</stringProp> + <stringProp name="RegexExtractor.regex">,"configurable_variation":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <boolProp name="RegexExtractor.default_empty_value">true</boolProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable matrix" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_matrix</stringProp> + <stringProp name="RegexExtractor.regex">"configurable-matrix":(\[.*?\])</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <boolProp name="RegexExtractor.default_empty_value">true</boolProp> + </RegexExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract associated products ids" enabled="true"> + <stringProp name="VAR">associated_products_ids</stringProp> + <stringProp name="JSONPATH">$.[*].id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE">configurable_matrix</stringProp> + <stringProp name="SUBJECT">VAR</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable product json" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_data</stringProp> + <stringProp name="RegexExtractor.regex">(\{"product":.*?configurable_attributes_data.*?\})\s*<</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract configurable attributes data" enabled="true"> + <stringProp name="VAR">configurable_attributes_data</stringProp> + <stringProp name="JSONPATH">$.product.configurable_attributes_data</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE">configurable_product_data</stringProp> + <stringProp name="SUBJECT">VAR</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_ids</stringProp> + <stringProp name="RegexExtractor.regex">"attribute_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute codes" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_codes</stringProp> + <stringProp name="RegexExtractor.regex">"code":"(\w+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute labels" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_labels</stringProp> + <stringProp name="RegexExtractor.regex">"label":"(.*?)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute values" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_values</stringProp> + <stringProp name="RegexExtractor.regex">"values":(\{(?:\}|.*?\}\}))</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach configurable attribute id" enabled="true"> + <stringProp name="ForeachController.inputVal">configurable_attribute_ids</stringProp> + <stringProp name="ForeachController.returnVal">configurable_attribute_id</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + </ForeachController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${configurable_attribute_ids_matchNr}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">attribute_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="Process configurable attribute values" enabled="true"> + <stringProp name="BeanShellSampler.query">return vars.get("configurable_attribute_values_" + vars.get("attribute_counter"));</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Exctract attribute values" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">attribute_${configurable_attribute_id}_values</stringProp> + <stringProp name="RegexExtractor.regex">"value_index":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">configurable_attribute_values_${attribute_counter}</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">3</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${category_additional}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Configurable product description ${configurable_product_id} Edited</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Title Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Keyword Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Description Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_attribute_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_message_available]</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_wrapping_available]</stringProp> + </elementProp> + <elementProp name="product[visibility]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[visibility]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">50</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][type_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">configurable</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][type_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/id/${configurable_product_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Configure product options" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">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); -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); + 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); + }</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]admin" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]admin</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">3</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${category_additional}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Configurable product description ${configurable_product_id} Edited</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Title Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Keyword Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Description Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_attribute_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_message_available]</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_wrapping_available]</stringProp> + </elementProp> + <elementProp name="product[visibility]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[visibility]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">50</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][type_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">configurable</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][type_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/id/${configurable_product_id}/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Configure product options" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">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); -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addSimpleProductsToCart</stringProp> - <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> - <stringProp name="VAR">item_id</stringProp> - <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> + 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); + }</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + <stringProp name="TestPlan.comments"> if have trouble see messages-message-error </stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> </hashTree> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update Simple Product qty In Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_simple_product_qty_in_cart.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="664196114">{"data":{"updateCartItems":{"cart":{"items":[{"id":"${item_id}","quantity":5}]}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Update Configurable Product Qty In Cart" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin Returns Management" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateConfigurableProductQtyInCartPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminReturnsManagementPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -43044,292 +76100,878 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Update Configurable Product Qty In Cart"); + vars.put("testLabel", "[GraphQL C] Admin Returns Management"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); +if (adminUsersDistribution == 1) { + adminUser = adminUserList.poll(); +} else { + if (!adminUserListIterator.hasNext()) { + adminUserListIterator = adminUserList.descendingIterator(); + } + + adminUser = adminUserListIterator.next(); } -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1204796042">Create New Order</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">desc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Pending Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> +<hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + <stringProp name="1637639774">totalRecords</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order numbers" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_numbers</stringProp> + <stringProp name="RegexExtractor.regex">\"increment_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_ids</stringProp> + <stringProp name="RegexExtractor.regex">\"entity_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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); + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> + import java.util.ArrayList; + import java.util.HashMap; + import org.apache.jmeter.protocol.http.util.Base64Encoder; + import java.util.Random; -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + // 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); + + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/view/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2103620713">#${order_number}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> - <stringProp name="VAR">product_option</stringProp> - <stringProp name="JSONPATH">$.data.products.items[0].variants[0].product.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order status" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_status</stringProp> + <stringProp name="RegexExtractor.regex"><span id="order_status">([^<]+)</span></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> <hashTree/> </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Configurable Product To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> - <stringProp name="675049292">"sku":"${product_option}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> - </HTTPSamplerProxy> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> + <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> - <stringProp name="VAR">item_id</stringProp> - <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update Configurable Product qty In Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1233850814">Invoice Totals</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract ordered items ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">item_ids</stringProp> + <stringProp name="RegexExtractor.regex"><div id="order_item_(\d+)_title"\s*class="product-title"></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Submit" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_1}]</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_2}]</stringProp> + </elementProp> + <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Invoiced</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[comment_text]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1740524604">The invoice has been created</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Credit Memo Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_creditmemo/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1382627322">New Memo</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Credit Memo Submit - Full Refund" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="creditmemo[items][${item_ids_1}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[items][${item_ids_1}][qty]</stringProp> + </elementProp> + <elementProp name="creditmemo[items][${item_ids_2}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[items][${item_ids_2}][qty]</stringProp> + </elementProp> + <elementProp name="creditmemo[do_offline]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[do_offline]</stringProp> + </elementProp> + <elementProp name="creditmemo[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Credit Memo added</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[comment_text]</stringProp> + </elementProp> + <elementProp name="creditmemo[shipping_amount]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[shipping_amount]</stringProp> + </elementProp> + <elementProp name="creditmemo[adjustment_positive]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[adjustment_positive]</stringProp> + </elementProp> + <elementProp name="creditmemo[adjustment_negative]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[adjustment_negative]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_creditmemo/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-515117447">You created the credit memo</stringProp> </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Create/Process Returns - Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/pause.jmx</stringProp></TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_configurable_product_qty_in_cart.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="664196114">{"data":{"updateCartItems":{"cart":{"items":[{"id":"${item_id}","quantity":5}]}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Update Simple Product Qty In Cart with Prices" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin Browse Customer Grid" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateSimpleProductQtyInCartWithPricesPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminBrowseCustomerGridPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -43355,455 +76997,582 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Update Simple Product Qty In Cart with Prices"); + vars.put("testLabel", "[GraphQL C] Admin Browse Customer Grid"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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; + } -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} + formKey = vars.get("form_key_storage"); -vars.putObject("randomIntGenerator", random); + currentFormKey = getFormKeyFromResponse(); + + if (currentFormKey != null && currentFormKey != formKey) { + vars.put("form_key_storage", currentFormKey); + } </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> -import java.util.Random; +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); +if (adminUsersDistribution == 1) { + adminUser = adminUserList.poll(); +} else { + if (!adminUserListIterator.hasNext()) { + adminUserListIterator = adminUserList.descendingIterator(); + } -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")); + 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); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + </BeanShellSampler> <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart With Prices" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart_with_prices.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addSimpleProductsToCart</stringProp> - <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart With Prices" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart_with_prices.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> - <stringProp name="VAR">item_id</stringProp> - <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> + <stringProp name="2845929">^.+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update Simple Product qty In Cart With Prices" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_simple_product_qty_in_cart_with_prices.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">"quantity":5</stringProp> - <stringProp name="675049292">"id":"${item_id}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> </hashTree> </hashTree> - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Update Configurable Product Qty In Cart with Prices" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlUpdateConfigurableProductQtyInCartWithPricesPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="script"> + 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"); - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Update Configurable Product Qty In Cart with Prices"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + // 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"); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_customers_grid/setup.jmx</stringProp></JSR223PostProcessor> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> <stringProp name="DEFAULT"/> <stringProp name="VARIABLE"/> <stringProp name="SUBJECT">BODY</stringProp> </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} pages count" enabled="true"> + <stringProp name="cacheKey"/> + <stringProp name="filename"/> + <stringProp name="parameters"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> <hashTree/> </hashTree> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Filtered Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> - - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> - <stringProp name="VAR">product_option</stringProp> - <stringProp name="JSONPATH">$.data.products.items[0].variants[0].product.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} filtered pages count" enabled="true"> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Configurable Product To Cart With Prices" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart_with_prices.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> - <stringProp name="675049292">"sku":"${product_option}"</stringProp> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> @@ -43812,100 +77581,180 @@ vars.put("product_sku", product.get("sku")); <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart With Prices" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart_with_prices.jmx</stringProp> - </HTTPSamplerProxy> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select Filtered ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count_filtered}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> +</TestFragmentController> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> - <stringProp name="VAR">item_id</stringProp> - <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_field</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_field</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">3</stringProp> + </ForeachController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Order Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_order</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_order</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">2</stringProp> + </ForeachController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page - Filtering + Sort By ${grid_sort_field} ${grid_sort_order}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[${grid_filter_field}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[${grid_filter_field}]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_field}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_order}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> </hashTree> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update Configurable Product qty In Cart With Prices" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/update_configurable_product_qty_in_cart_with_prices.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">"quantity":5</stringProp> - <stringProp name="675049292">"id":"${item_id}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Remove Simple Product From Cart" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin Create Order" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlRemoveSimpleProductFromCartPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminCreateOrderPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -43931,555 +77780,1308 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Remove Simple Product From Cart"); + vars.put("testLabel", "[GraphQL C] Admin Create Order"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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; + } -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} + formKey = vars.get("form_key_storage"); -vars.putObject("randomIntGenerator", random); + currentFormKey = getFormKeyFromResponse(); + + if (currentFormKey != null && currentFormKey != formKey) { + vars.put("form_key_storage", currentFormKey); + } </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> -import java.util.Random; +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); +if (adminUsersDistribution == 1) { + adminUser = adminUserList.poll(); +} else { + if (!adminUserListIterator.hasNext()) { + adminUserListIterator = adminUserList.descendingIterator(); + } -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")); + 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); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + </BeanShellSampler> <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addSimpleProductsToCart</stringProp> - <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> - <stringProp name="VAR">item_id</stringProp> - <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> + <stringProp name="2845929">^.+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Remove Simple Product From Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_simple_product_from_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1452665323">{"data":{"removeItemFromCart":{"cart":{"items":[]}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> </hashTree> </hashTree> - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Remove Configurable Product From Cart" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlRemoveConfigurableProductFromCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> + vars.put("alabama_region_id", props.get("alabama_region_id")); + vars.put("california_region_id", props.get("california_region_id")); +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Order" enabled="true"/> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_order/admin_create_order.jmx</stringProp> + <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; +import java.util.Random; +Random random = new Random(); + +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); +}</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Start Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/start/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree/> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Get Configurable Product Options" enabled="true"/> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get Configurable Product Options" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/configurable-products/${configurable_product_1_sku}/options/all</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract attribute_ids" enabled="true"> + <stringProp name="VAR">attribute_ids</stringProp> + <stringProp name="JSONPATH">$.[*].attribute_id</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract option_values" enabled="true"> + <stringProp name="VAR">option_values</stringProp> + <stringProp name="JSONPATH">$.[*].values[0].value_index</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Products" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="item[${simple_product_1_id}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">item[${simple_product_1_id}][qty]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="item[${simple_product_2_id}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">item[${simple_product_2_id}][qty]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="item[${configurable_product_1_id}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">item[${configurable_product_1_id}][qty]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="customer_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">customer_id</stringProp> + <stringProp name="Argument.value">${customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="store_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">store_id</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="currency_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">currency_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="payment[method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">payment[method]</stringProp> + <stringProp name="Argument.value">checkmo</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="reset_shipping" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">reset_shipping</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="json" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">json</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="as_js_varname" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">as_js_varname</stringProp> + <stringProp name="Argument.value">iFrameResponse</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/loadBlock/block/search,items,shipping_method,totals,giftmessage,billing_method?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Configure product options" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">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++) { - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + 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); +}</stringProp> + </BeanShellPreProcessor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Collect Shipping Rates" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="collect_shipping_rates" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">collect_shipping_rates</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="customer_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">customer_id</stringProp> + <stringProp name="Argument.value">${customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="store_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">store_id</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="currency_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">currency_id</stringProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="payment[method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">payment[method]</stringProp> + <stringProp name="Argument.value">checkmo</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="json" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">json</stringProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/loadBlock/block/shipping_method,totals?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Shipping Method" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1987784558">shipping_method</stringProp> + <stringProp name="818779431">Flat Rate</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Filled Order Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/index/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Filled Order Page" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-37823069">Select from existing customer addresses</stringProp> + <stringProp name="-13185722">Submit Order</stringProp> + <stringProp name="-209419315">Items Ordered</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="limit" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">limit</stringProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="entity_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">entity_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="email" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">email</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="Telephone" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">Telephone</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="billing_postcode" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">billing_postcode</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="billing_country_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">billing_country_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="billing_regione" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">billing_regione</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="store_name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">store_name</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="page" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">page</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[currency]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[currency]</stringProp> + <stringProp name="Argument.value">USD</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="sku" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">sku</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="qty" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">qty</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="limit" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">limit</stringProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="entity_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">entity_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="sku" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">sku</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="price[from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">price[from]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="price[to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">price[to]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="in_products" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">in_products</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="page" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">page</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="coupon_code" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">coupon_code</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[account][group_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[account][group_id]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[account][email]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[account][email]</stringProp> + <stringProp name="Argument.value">user_${customer_id}@example.com</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][customer_address_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][customer_address_id]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][prefix]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][firstname]</stringProp> + <stringProp name="Argument.value">Anthony</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][middlename]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][lastname]</stringProp> + <stringProp name="Argument.value">Nealy</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][suffix]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][company]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][street][0]</stringProp> + <stringProp name="Argument.value">123 Freedom Blvd. #123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][street][1]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][city]</stringProp> + <stringProp name="Argument.value">Fayetteville</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][country_id]</stringProp> + <stringProp name="Argument.value">US</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][region]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][region_id]</stringProp> + <stringProp name="Argument.value">${alabama_region_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][postcode]</stringProp> + <stringProp name="Argument.value">123123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][telephone]</stringProp> + <stringProp name="Argument.value">022-333-4455</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][fax]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][fax]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][vat_id]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipping_same_as_billing" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipping_same_as_billing</stringProp> + <stringProp name="Argument.value">on</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="payment[method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">payment[method]</stringProp> + <stringProp name="Argument.value">checkmo</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[shipping_method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[shipping_method]</stringProp> + <stringProp name="Argument.value">flatrate_flatrate</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[comment][customer_note]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[comment][customer_note]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[comment][customer_note_notify]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[comment][customer_note_notify]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[send_confirmation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[send_confirmation]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_id</stringProp> + <stringProp name="RegexExtractor.regex">${host}${base_path}${admin_path}/sales/order/index/order_id/(\d+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Remove Configurable Product From Cart"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 1" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_item_1</stringProp> + <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 2" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_item_2</stringProp> + <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">2</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 3" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_item_3</stringProp> + <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">3</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 1" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_item_1</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 2" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_item_2</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 3" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_item_3</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Created" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="563107624">You created the order.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Invoice" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[items][${order_item_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[items][${order_item_1}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[items][${order_item_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[items][${order_item_2}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[items][${order_item_3}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[items][${order_item_3}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[comment_text]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> - <stringProp name="VAR">product_option</stringProp> - <stringProp name="JSONPATH">$.data.products.items[0].variants[0].product.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Configurable Product To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> - <stringProp name="675049292">"sku":"${product_option}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract item id" enabled="true"> - <stringProp name="VAR">item_id</stringProp> - <stringProp name="JSONPATH">$.data.cart.items[0].id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1486007127">{"data":{"cart":{"items":</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Invoice Created" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1878312078">The invoice has been created.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Shipment" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[items][${order_item_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[items][${order_item_1}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[items][${order_item_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[items][${order_item_2}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[items][${order_item_3}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[items][${order_item_3}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[comment_text]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Shipment Created" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-348539683">The shipment has been created.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> </hashTree> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Remove Configurable Product From Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_configurable_product_from_cart.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1452665323">{"data":{"removeItemFromCart":{"cart":{"items":[]}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Apply Coupon To Cart" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin Category Management" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlApplyCouponToCartPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminCategoryManagementPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -44505,1001 +79107,1031 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Apply Coupon To Cart"); + vars.put("testLabel", "[GraphQL C] Admin Category Management"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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); + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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; + } -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addSimpleProductsToCart</stringProp> - <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Coupon Code Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">random = vars.getObject("randomIntGenerator"); + formKey = vars.get("form_key_storage"); -var coupons = props.get("coupon_codes"); -number = random.nextInt(coupons.length); + currentFormKey = getFormKeyFromResponse(); -vars.put("coupon_code", coupons[number].code); + if (currentFormKey != null && currentFormKey != formKey) { + vars.put("form_key_storage", currentFormKey); + } </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> - </JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Apply Coupon To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1026466978">{"data":{"applyCouponToCart":{"cart":{"applied_coupon":{"code":"${coupon_code}"}}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Remove Coupon From Cart" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlRemoveCouponFromCartPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - + 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); + } + } + } </stringProp> <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Remove Coupon From Cart"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + </JSR223PreProcessor> <hashTree/> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> -import java.util.Random; +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); +if (adminUsersDistribution == 1) { + adminUser = adminUserList.poll(); +} else { + if (!adminUserListIterator.hasNext()) { + adminUserListIterator = adminUserList.descendingIterator(); + } -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")); + 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); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + </BeanShellSampler> <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addSimpleProductsToCart</stringProp> - <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - </hashTree> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Coupon Code Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">random = vars.getObject("randomIntGenerator"); - -var coupons = props.get("coupon_codes"); -number = random.nextInt(coupons.length); - -vars.put("coupon_code", coupons[number].code); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> - </JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Apply Coupon To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1026466978">{"data":{"applyCouponToCart":{"cart":{"applied_coupon":{"code":"${coupon_code}"}}}}}</stringProp> + <stringProp name="2845929">^.+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Remove Coupon From Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n removeCouponFromCart(input: {cart_id: \"${quote_id}\"}) {\n cart {\n applied_coupon {\n code\n }\n }\n }\n}","variables":null,"operationName":null}</stringProp> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_coupon_from_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-76201335">{"data":{"removeCouponFromCart":{"cart":{"applied_coupon":null}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> </hashTree> </hashTree> - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Catalog Browsing By Guest" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlCatalogBrowsingByGuestPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Category Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_category_management/admin_category_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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(); - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + +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));</stringProp> + </JSR223Sampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select parent category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${parent_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open new category page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/add/store/0/parent/${parent_category_id}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1903925024"><title>New Category</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> + </elementProp> + <elementProp name="parent" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">parent</stringProp> + </elementProp> + <elementProp name="path" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">path</stringProp> + </elementProp> + <elementProp name="store_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_id</stringProp> + </elementProp> + <elementProp name="is_active" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_active</stringProp> + </elementProp> + <elementProp name="include_in_menu" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">include_in_menu</stringProp> + </elementProp> + <elementProp name="is_anchor" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_anchor</stringProp> + </elementProp> + <elementProp name="use_config[available_sort_by]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[available_sort_by]</stringProp> + </elementProp> + <elementProp name="use_config[default_sort_by]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[default_sort_by]</stringProp> + </elementProp> + <elementProp name="use_config[filter_price_range]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[filter_price_range]</stringProp> + </elementProp> + <elementProp name="use_default[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_default[url_key]</stringProp> + </elementProp> + <elementProp name="url_key_create_redirect" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">url_key_create_redirect</stringProp> + </elementProp> + <elementProp name="custom_use_parent_settings" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_use_parent_settings</stringProp> + </elementProp> + <elementProp name="custom_apply_to_products" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_apply_to_products</stringProp> + </elementProp> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Admin Category Management ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + </elementProp> + <elementProp name="url_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">admin-category-management-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">url_key</stringProp> + </elementProp> + <elementProp name="meta_title" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_title</stringProp> + </elementProp> + <elementProp name="description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">description</stringProp> + </elementProp> + <elementProp name="display_mode" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">PRODUCTS</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">display_mode</stringProp> + </elementProp> + <elementProp name="default_sort_by" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">position</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">default_sort_by</stringProp> + </elementProp> + <elementProp name="meta_keywords" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_keywords</stringProp> + </elementProp> + <elementProp name="meta_description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_description</stringProp> + </elementProp> + <elementProp name="custom_layout_update" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_layout_update</stringProp> + </elementProp> + <elementProp name="category_products" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"${simple_product_1_id}":"","${simple_product_2_id}":"","${simple_product_3_id}":"","${simple_product_4_id}":"","${simple_product_5_id}":""}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">category_products</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">URL</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_id</stringProp> + <stringProp name="RegexExtractor.regex">/catalog/category/edit/id/(\d+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Catalog Browsing By Guest"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_id</stringProp> + </ResponseAssertion> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select created category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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]); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Navigation Menu by category_id" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"id":${category_id},"name":"${category_name}","product_count"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Product Search by text and category_id" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> - <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> - <stringProp name="JSONPATH">$.data.products.total_count</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> - <stringProp name="BeanShellAssertion.query">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; - } -} - - -</stringProp> - <stringProp name="BeanShellAssertion.filename"/> - <stringProp name="BeanShellAssertion.parameters"/> - <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> - </BeanShellAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Url Info by url_key" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value"> - {"query":"query resolveUrl($urlKey: String!) {\n urlResolver(url: $urlKey) {\n type\n id\n }\n}","variables":{"urlKey":"${category_url_key}${url_suffix}"},"operationName":"resolveUrl"} - </stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_url_info_by_url_key.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1062388959">{"type":"CATEGORY","id":${category_id}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"name":"${category_name}","id":${category_id},</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by product_url_key" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${admin_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category row id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category attribute set id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_attribute_set_id</stringProp> + <stringProp name="RegexExtractor.regex">"attribute_set_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category parent Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_parent_id</stringProp> + <stringProp name="RegexExtractor.regex">"parent_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category created at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_created_at</stringProp> + <stringProp name="RegexExtractor.regex">"created_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category updated at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_updated_at</stringProp> + <stringProp name="RegexExtractor.regex">"updated_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category path" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_path</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":(.+)"path":"([^\"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category level" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_level</stringProp> + <stringProp name="RegexExtractor.regex">"level":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category name" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_name</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":(.+)"name":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_url_key</stringProp> + <stringProp name="RegexExtractor.regex">"url_key":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url path" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_url_path</stringProp> + <stringProp name="RegexExtractor.regex">"url_path":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category row id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_entity_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category attribute set id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_attribute_set_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category parent id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_parent_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category created at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_created_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category updated at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_updated_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category path" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="59022110">^[\d\\\/]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_path</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category level" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_level</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category name" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_name</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url key" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_url_key</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url path" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_url_path</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert products added" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="417284990">${simple_product_1_name}</stringProp> + <stringProp name="1304788671">${simple_product_2_name}</stringProp> + <stringProp name="-2102674944">${simple_product_3_name}</stringProp> + <stringProp name="-1215171263">${simple_product_4_name}</stringProp> + <stringProp name="-327667582">${simple_product_5_name}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Move category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="point" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">append</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">point</stringProp> + </elementProp> + <elementProp name="pid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${new_parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">pid</stringProp> + </elementProp> + <elementProp name="paid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paid</stringProp> + </elementProp> + <elementProp name="aid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">aid</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/move/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> <hashTree/> - </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Simple Product Details by name" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/delete/id/${admin_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category deleted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1277069529">You deleted the category.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCategoryManagementDelay}*1000))}</stringProp> + </TestAction> <hashTree/> </hashTree> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Simple Product Details by product_url_key" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare CMS Page" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">random = vars.getObject("randomIntGenerator"); - -var cmsPages = props.get("cms_pages"); -var number = random.nextInt(cmsPages.length); - -vars.put("cms_page_id", cmsPages[number].id); + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/prepare_cms_page.jmx</stringProp></JSR223Sampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cms Page by id" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value"> - {"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"} - </stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> - <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> - <stringProp name="EXPECTED_VALUE">${cms_page_id}</stringProp> - <boolProp name="JSONVALIDATION">false</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">false</boolProp> - <boolProp name="ISREGEX">false</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - </hashTree> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="GraphQL Checkout By Guest" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin Promotion Rules" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${graphqlCheckoutByGuestPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminPromotionRulesPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -45525,1074 +80157,2274 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "GraphQL Checkout By Guest"); + vars.put("testLabel", "[GraphQL C] Admin Promotion Rules"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); +if (adminUsersDistribution == 1) { + adminUser = adminUserList.poll(); +} else { + if (!adminUserListIterator.hasNext()) { + adminUserListIterator = adminUserList.descendingIterator(); + } + + adminUser = adminUserListIterator.next(); } -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/create_empty_cart.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">quote_id</stringProp> - <stringProp name="JSONPATH">$.data.createEmptyCart</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1404608713">{"data":{"createEmptyCart":"</stringProp> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Empty Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_empty_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1901638450">{"data":{"cart":{"items":[]}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Promotions Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/new</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New Conditional" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1--1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> + </elementProp> + <elementProp name="type" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">type</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/newConditionHtml/form/sales_rule_formrule_conditions_fieldset_/form_namespace/sales_rule_form</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Rule Name ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + </elementProp> + <elementProp name="is_active" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_active</stringProp> + </elementProp> + <elementProp name="use_auto_generation" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_auto_generation</stringProp> + </elementProp> + <elementProp name="is_rss" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_rss</stringProp> + </elementProp> + <elementProp name="apply_to_shipping" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">apply_to_shipping</stringProp> + </elementProp> + <elementProp name="stop_rules_processing" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">stop_rules_processing</stringProp> + </elementProp> + <elementProp name="coupon_code" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">coupon_code</stringProp> + </elementProp> + <elementProp name="uses_per_coupon" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">uses_per_coupon</stringProp> + </elementProp> + <elementProp name="uses_per_customer" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">uses_per_customer</stringProp> + </elementProp> + <elementProp name="sort_order" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sort_order</stringProp> + </elementProp> + <elementProp name="discount_amount" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">5</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">discount_amount</stringProp> + </elementProp> + <elementProp name="discount_qty" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">discount_qty</stringProp> + </elementProp> + <elementProp name="discount_step" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">discount_step</stringProp> + </elementProp> + <elementProp name="reward_points_delta" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">reward_points_delta</stringProp> + </elementProp> + <elementProp name="store_labels[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[0]</stringProp> + </elementProp> + <elementProp name="description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Rule Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">description</stringProp> + </elementProp> + <elementProp name="coupon_type" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">coupon_type</stringProp> + </elementProp> + <elementProp name="simple_action" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">cart_fixed</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">simple_action</stringProp> + </elementProp> + <elementProp name="website_ids[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">website_ids[0]</stringProp> + </elementProp> + <elementProp name="customer_group_ids[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer_group_ids[0]</stringProp> + </elementProp> + <elementProp name="from_date" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">from_date</stringProp> + </elementProp> + <elementProp name="to_date" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">to_date</stringProp> + </elementProp> + <elementProp name="rule[conditions][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Combine</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][type]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1][aggregator]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">all</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][aggregator]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][value]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][type]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][attribute]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">base_subtotal</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][attribute]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][operator]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">>=</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][operator]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][value]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1][new_chlid]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][new_chlid]</stringProp> + </elementProp> + <elementProp name="rule[actions][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Product\Combine</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][type]</stringProp> + </elementProp> + <elementProp name="rule[actions][1][aggregator]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">all</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][aggregator]</stringProp> + </elementProp> + <elementProp name="rule[actions][1][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][value]</stringProp> + </elementProp> + <elementProp name="rule[actions][1][new_child]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][new_child]</stringProp> + </elementProp> + <elementProp name="store_labels[1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[1]</stringProp> + </elementProp> + <elementProp name="store_labels[2]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[2]</stringProp> + </elementProp> + <elementProp name="related_banners" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">related_banners</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-396438583">You saved the rule.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminPromotionsManagementDelay}*1000))}</stringProp> + </TestAction> <hashTree/> </hashTree> + </hashTree> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Details by name" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1201352014">"sku":"${product_sku}","name":"${product_name}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> - <stringProp name="VAR">product_option</stringProp> - <stringProp name="JSONPATH">$.data.products.items[0].variants[0].product.sku</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/extract_configurable_product_option.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> </hashTree> + </hashTree> + - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Configurable Product To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx</stringProp> - </HTTPSamplerProxy> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin Customer Management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminCustomerManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addConfigurableProductsToCart</stringProp> - <stringProp name="675049292">"sku":"${product_option}"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[GraphQL C] Admin Customer Management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> <stringProp name="BeanShellSampler.query"> -import java.util.Random; +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); +if (adminUsersDistribution == 1) { + adminUser = adminUserList.poll(); +} else { + if (!adminUserListIterator.hasNext()) { + adminUserListIterator = adminUserList.descendingIterator(); + } -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")); + 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); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + </BeanShellSampler> <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Simple Product To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/add_simple_product_to_cart.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1421843282">addSimpleProductsToCart</stringProp> - <stringProp name="-1173443935">"sku":"${product_sku}"</stringProp> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Billing Address On Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_billing_address_on_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1147076914">{"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"}}}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Shipping Address On Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1671866339">{"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"}}]}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Payment Method On Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_payment_method_on_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1830199373">{"data":{"setPaymentMethodOnCart":{"cart":{"selected_payment_method":{"code":"checkmo"}}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Current Shipping Address" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n cart(cart_id: \"${quote_id}\") {\n shipping_addresses {\n postcode\n }\n }\n}","variables":null,"operationName":null}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_current_shipping_address.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Shipping Method On Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_shipping_method_on_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="644143859">{"data":{"setShippingMethodsOnCart":{"cart":{"shipping_addresses":[{"selected_shipping_method":{"carrier_code":"flatrate","method_code":"flatrate"}}]}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Coupon Code Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">random = vars.getObject("randomIntGenerator"); - -var coupons = props.get("coupon_codes"); -number = random.nextInt(coupons.length); - -vars.put("coupon_code", coupons[number].code); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_coupon_code_setup.jmx</stringProp> - </JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Apply Coupon To Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/apply_coupon_to_cart.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1026466978">{"data":{"applyCouponToCart":{"cart":{"applied_coupon":{"code":"${coupon_code}"}}}}}</stringProp> + <stringProp name="2845929">^.+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Remove Coupon From Cart" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"mutation {\n removeCouponFromCart(input: {cart_id: \"${quote_id}\"}) {\n cart {\n applied_coupon {\n code\n }\n }\n }\n}","variables":null,"operationName":null}</stringProp> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/remove_coupon_from_cart.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-76201335">{"data":{"removeCouponFromCart":{"cart":{"applied_coupon":null}}}}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> - </ResponseAssertion> - <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> </hashTree> </hashTree> - - </hashTree> - - - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Combined Benchmark Pool" enabled="true"> - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> - <boolProp name="LoopController.continue_forever">false</boolProp> - <stringProp name="LoopController.loops">${loops}</stringProp> - </elementProp> - <stringProp name="ThreadGroup.num_threads">${combinedBenchmarkPoolUsers}</stringProp> - <stringProp name="ThreadGroup.ramp_time">${ramp_period}</stringProp> - <longProp name="ThreadGroup.start_time">1505803944000</longProp> - <longProp name="ThreadGroup.end_time">1505803944000</longProp> - <boolProp name="ThreadGroup.scheduler">false</boolProp> - <stringProp name="ThreadGroup.duration"/> - <stringProp name="ThreadGroup.delay"/> - <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Cache hit miss" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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)); - } -} -</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Catalog Browsing By Guest" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cBrowseCatalogByGuestPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Customer Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_customer_management/admin_customer_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Render" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">customer_listing</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Render" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">customer_listing</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Lastname</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer edit url" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">customer_edit_url_path</stringProp> + <stringProp name="RegexExtractor.regex">actions":\{"edit":\{"href":"(?:http|https):\\/\\/(.*?)\\/customer\\/index\\/edit\\/id\\/(\d+)\\/",</stringProp> + <stringProp name="RegexExtractor.template">/customer/index/edit/id/$2$/</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer edit url" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">customer_edit_url_path</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Customer" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}${customer_edit_url_path}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert edit customer page" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1422614550">Customer Information</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer entity_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract website_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_website_id</stringProp> + <stringProp name="RegexExtractor.regex">"website_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer firstname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_firstname</stringProp> + <stringProp name="RegexExtractor.regex">"firstname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer lastname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_lastname</stringProp> + <stringProp name="RegexExtractor.regex">"lastname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer email" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_email</stringProp> + <stringProp name="RegexExtractor.regex">"email":"([^\@]+@[^.]+.[^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract group_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_group_id</stringProp> + <stringProp name="RegexExtractor.regex">"group_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract store_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_store_id</stringProp> + <stringProp name="RegexExtractor.regex">"store_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extact created_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_created_at</stringProp> + <stringProp name="RegexExtractor.regex">"created_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract updated_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_updated_at</stringProp> + <stringProp name="RegexExtractor.regex">"updated_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract is_active" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_is_active</stringProp> + <stringProp name="RegexExtractor.regex">"is_active":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract disable_auto_group_change" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_disable_auto_group_change</stringProp> + <stringProp name="RegexExtractor.regex">"disable_auto_group_change":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract created_in" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_created_in</stringProp> + <stringProp name="RegexExtractor.regex">"created_in":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Catalog Browsing By Guest"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract dob" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_dob</stringProp> + <stringProp name="RegexExtractor.regex">"dob":"(\d+)-(\d+)-(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$/$3$/$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_billing" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_default_billing</stringProp> + <stringProp name="RegexExtractor.regex">"default_billing":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_shipping" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_default_shipping</stringProp> + <stringProp name="RegexExtractor.regex">"default_shipping":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract gender" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_gender</stringProp> + <stringProp name="RegexExtractor.regex">"gender":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract failures_num" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_failures_num</stringProp> + <stringProp name="RegexExtractor.regex">"failures_num":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_entity_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{"entity_id":"(\d+)".+?"parent_id":"${admin_customer_entity_id}"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_created_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_created_at</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"created_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_updated_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_updated_at</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"updated_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_is_active" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_is_active</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"is_active":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_city" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_city</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"city":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_country_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_country_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"country_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_firstname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_firstname</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"firstname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_lastname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_lastname</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"lastname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_postcode" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_postcode</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"postcode":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_region</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_region_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address street" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_street</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"street":\["([^"]+)"\]</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_telephone" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_telephone</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"telephone":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_customer_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_customer_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"customer_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer entity_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_entity_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert website_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_website_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer firstname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_firstname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer lastname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_lastname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer email" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_email</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer group_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_group_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer store_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_store_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_created_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer updated_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_updated_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer is_active" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_is_active</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer disable_auto_group_change" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_disable_auto_group_change</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_in" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_created_in</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer dob" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="221072919">^\d+/\d+/\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_dob</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_billing" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_default_billing</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_shipping" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_default_shipping</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer gender" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_gender</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer failures_num" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_failures_num</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_entity_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_entity_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_created_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_created_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_updated_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_updated_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_is_active" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_is_active</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_city" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_city</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_country_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_country_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_firstname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_firstname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_lastname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_lastname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_postcode" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_postcode</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_region</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_region_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_street" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_street</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_telephone" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_telephone</stringProp> + </ResponseAssertion> <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"> - <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> - <stringProp name="Cookie.value">30</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">/</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> - </elementProp> - <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> - <stringProp name="Cookie.value">${form_key}</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">${base_path}</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> - </elementProp> - </collectionProp> - <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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]); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_customer_id" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="571386695"><title>Home page</title></stringProp> + <stringProp name="89649215">^\d+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_customer_id</stringProp> </ResponseAssertion> <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${category_url_key}${url_suffix}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1210004667"><span class="base" data-ui-id="page-title">${category_name}</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">6</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract category id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">category_id</stringProp> - <stringProp name="RegexExtractor.regex"><li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="Scope.variable">simple_product_1_url_key</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert category id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1191417111">^[0-9]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">category_id</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> - <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> - <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end"/> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">_counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">true</boolProp> - <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> - </CounterConfig> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="isAjax " elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax </stringProp> + </elementProp> + <elementProp name="customer[entity_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[entity_id]</stringProp> + </elementProp> + <elementProp name="customer[website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[website_id]</stringProp> + </elementProp> + <elementProp name="customer[email]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_email}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[email]</stringProp> + </elementProp> + <elementProp name="customer[group_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[group_id]</stringProp> + </elementProp> + <elementProp name="customer[store_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[store_id]</stringProp> + </elementProp> + <elementProp name="customer[created_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[created_at]</stringProp> + </elementProp> + <elementProp name="customer[updated_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[updated_at]</stringProp> + </elementProp> + <elementProp name="customer[is_active]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[is_active]</stringProp> + </elementProp> + <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> + </elementProp> + <elementProp name="customer[created_in]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[created_in]</stringProp> + </elementProp> + <elementProp name="customer[prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[prefix]</stringProp> + </elementProp> + <elementProp name="customer[firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[firstname]</stringProp> + </elementProp> + <elementProp name="customer[middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[middlename]</stringProp> + </elementProp> + <elementProp name="customer[lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[lastname]</stringProp> + </elementProp> + <elementProp name="customer[suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[suffix]</stringProp> + </elementProp> + <elementProp name="customer[dob]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_dob}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[dob]</stringProp> + </elementProp> + <elementProp name="customer[default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[default_billing]</stringProp> + </elementProp> + <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[default_shipping]</stringProp> + </elementProp> + <elementProp name="customer[taxvat]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[taxvat]</stringProp> + </elementProp> + <elementProp name="customer[gender]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_gender}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[gender]</stringProp> + </elementProp> + <elementProp name="customer[failures_num]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[failures_num]</stringProp> + </elementProp> + <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> - <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> - <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end"/> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">_counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">true</boolProp> - <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> - </CounterConfig> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Site Search" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cSiteSearchPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Site Search"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="Search Terms" enabled="true"> - <stringProp name="filename">${files_folder}search_terms.csv</stringProp> - <stringProp name="fileEncoding">UTF-8</stringProp> - <stringProp name="variableNames"/> - <stringProp name="delimiter">,</stringProp> - <boolProp name="quotedData">false</boolProp> - <boolProp name="recycle">true</boolProp> - <boolProp name="stopThread">false</boolProp> - <stringProp name="shareMode">shareMode.thread</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms.jmx</stringProp></CSVDataSet> - <hashTree/> - - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Cache hit miss" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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)); - } -} -</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Quick Search" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${searchQuickPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "Quick Search"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"> - <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> - <stringProp name="Cookie.value">30</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">/</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> - </elementProp> - <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> - <stringProp name="Cookie.value">${form_key}</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">${base_path}</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> - </elementProp> - </collectionProp> - <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][prefix]</stringProp> + </elementProp> + <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">John</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][firstname]</stringProp> + </elementProp> + <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][middlename]</stringProp> + </elementProp> + <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Doe</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][lastname]</stringProp> + </elementProp> + <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][suffix]</stringProp> + </elementProp> + <elementProp name="address[new_0][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Test Company</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][company]</stringProp> + </elementProp> + <elementProp name="address[new_0][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Folsom</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][city]</stringProp> + </elementProp> + <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">95630</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][postcode]</stringProp> + </elementProp> + <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1234567890</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][telephone]</stringProp> + </elementProp> + <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> + </elementProp> + <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> + </elementProp> + <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> + </elementProp> + <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123 Main</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][street][0]</stringProp> + </elementProp> + <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][street][1]</stringProp> + </elementProp> + <elementProp name="address[new_0][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][region]</stringProp> + </elementProp> + <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">US</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][country_id]</stringProp> + </elementProp> + <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][region_id]</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -46600,275 +82432,472 @@ if (tmpLabel) { <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/validate/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="571386695"><title>Home page</title></stringProp> + <stringProp name="49586">200</stringProp> </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">16</intProp> </ResponseAssertion> <hashTree/> </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="q" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">q</stringProp> - <stringProp name="Argument.value">${searchTerm}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}catalogsearch/result/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="56511661">Search results for: </stringProp> - <stringProp name="1533671447"><span class="toolbar-number">\d<\/span> Items|Items <span class="toolbar-number">1</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product url keys" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> - <stringProp name="RegexExtractor.regex"><a class="product-item-link"(?s).+?href="(?:http|https)://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s).</stringProp> - <stringProp name="RegexExtractor.template">$2$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: isPageCacheable" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">isPageCacheable</stringProp> - <stringProp name="RegexExtractor.regex">catalogsearch/searchTermsLog/save</stringProp> - <stringProp name="RegexExtractor.template">$0$</stringProp> - <stringProp name="RegexExtractor.default">0</stringProp> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> - <stringProp name="IfController.condition">"${isPageCacheable}" != "0"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Terms Log" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Save" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="q" elementType="HTTPArgument"> + <elementProp name="isAjax " elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax </stringProp> + </elementProp> + <elementProp name="customer[entity_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[entity_id]</stringProp> + </elementProp> + <elementProp name="customer[website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[website_id]</stringProp> + </elementProp> + <elementProp name="customer[email]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_email}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[email]</stringProp> + </elementProp> + <elementProp name="customer[group_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[group_id]</stringProp> + </elementProp> + <elementProp name="customer[store_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[store_id]</stringProp> + </elementProp> + <elementProp name="customer[created_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[created_at]</stringProp> + </elementProp> + <elementProp name="customer[updated_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[updated_at]</stringProp> + </elementProp> + <elementProp name="customer[is_active]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[is_active]</stringProp> + </elementProp> + <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">q</stringProp> - <stringProp name="Argument.value">${searchTerm}</stringProp> + <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}catalogsearch/searchTermsLog/save/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-547797305">"success":true</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="BeanShellSampler.query"> -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> - <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">${foundProducts}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> - <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end"/> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">_counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">true</boolProp> - <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> - </CounterConfig> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <elementProp name="customer[created_in]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[created_in]</stringProp> + </elementProp> + <elementProp name="customer[prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[prefix]</stringProp> + </elementProp> + <elementProp name="customer[firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[firstname]</stringProp> + </elementProp> + <elementProp name="customer[middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[middlename]</stringProp> + </elementProp> + <elementProp name="customer[lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[lastname]</stringProp> + </elementProp> + <elementProp name="customer[suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[suffix]</stringProp> + </elementProp> + <elementProp name="customer[dob]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_dob}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[dob]</stringProp> + </elementProp> + <elementProp name="customer[default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[default_billing]</stringProp> + </elementProp> + <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[default_shipping]</stringProp> + </elementProp> + <elementProp name="customer[taxvat]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[taxvat]</stringProp> + </elementProp> + <elementProp name="customer[gender]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_gender}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[gender]</stringProp> + </elementProp> + <elementProp name="customer[failures_num]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[failures_num]</stringProp> + </elementProp> + <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Quick Search With Filtration" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${searchQuickFilterPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "Quick Search With Filtration"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"> - <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> - <stringProp name="Cookie.value">30</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">/</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> - </elementProp> - <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> - <stringProp name="Cookie.value">${form_key}</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">${base_path}</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> - </elementProp> - </collectionProp> - <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> + </elementProp> + <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][prefix]</stringProp> + </elementProp> + <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">John</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][firstname]</stringProp> + </elementProp> + <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][middlename]</stringProp> + </elementProp> + <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Doe</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][lastname]</stringProp> + </elementProp> + <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][suffix]</stringProp> + </elementProp> + <elementProp name="address[new_0][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Test Company</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][company]</stringProp> + </elementProp> + <elementProp name="address[new_0][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Folsom</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][city]</stringProp> + </elementProp> + <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">95630</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][postcode]</stringProp> + </elementProp> + <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1234567890</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][telephone]</stringProp> + </elementProp> + <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> + </elementProp> + <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> + </elementProp> + <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> + </elementProp> + <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123 Main</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][street][0]</stringProp> + </elementProp> + <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][street][1]</stringProp> + </elementProp> + <elementProp name="address[new_0][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][region]</stringProp> + </elementProp> + <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">US</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][country_id]</stringProp> + </elementProp> + <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">12</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][region_id]</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -46876,19 +82905,19 @@ if (tmpLabel) { <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer saved" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="571386695"><title>Home page</title></stringProp> + <stringProp name="292987815">You saved the customer.</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> @@ -46896,26 +82925,26 @@ if (tmpLabel) { </ResponseAssertion> <hashTree/> </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCustomerManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> + </hashTree> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="q" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">q</stringProp> - <stringProp name="Argument.value">${searchTerm}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - </collectionProp> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}catalogsearch/result/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -46923,322 +82952,31 @@ if (tmpLabel) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="56511661">Search results for: </stringProp> - <stringProp name="1533671447">Items <span class="toolbar-number">1</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract number of attribute 1 options" enabled="true"> - <stringProp name="XPathExtractor.default">0</stringProp> - <stringProp name="XPathExtractor.refname">attribute_1_options_count</stringProp> - <stringProp name="XPathExtractor.xpathQuery">count((//div[@class="filter-options-content"])[1]//li[@class="item"])</stringProp> - <boolProp name="XPathExtractor.validate">false</boolProp> - <boolProp name="XPathExtractor.tolerant">true</boolProp> - <boolProp name="XPathExtractor.namespace">false</boolProp> - </XPathExtractor> - <hashTree/> - <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract number of attribute 2 options" enabled="true"> - <stringProp name="XPathExtractor.default">0</stringProp> - <stringProp name="XPathExtractor.refname">attribute_2_options_count</stringProp> - <stringProp name="XPathExtractor.xpathQuery">count((//div[@class="filter-options-content"])[2]//li[@class="item"])</stringProp> - <boolProp name="XPathExtractor.validate">false</boolProp> - <boolProp name="XPathExtractor.tolerant">true</boolProp> - <boolProp name="XPathExtractor.namespace">false</boolProp> - </XPathExtractor> - <hashTree/> - <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract filter link from layered navigation" enabled="true"> - <stringProp name="XPathExtractor.default"/> - <stringProp name="XPathExtractor.refname">attribute_1_filter_url</stringProp> - <stringProp name="XPathExtractor.xpathQuery">((//div[@class="filter-options-content"])[1]//li[@class="item"]//a)[1]/@href</stringProp> - <boolProp name="XPathExtractor.validate">false</boolProp> - <boolProp name="XPathExtractor.tolerant">true</boolProp> - <boolProp name="XPathExtractor.namespace">false</boolProp> - </XPathExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract product url keys" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> - <stringProp name="RegexExtractor.regex"><a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s).</stringProp> - <stringProp name="RegexExtractor.template">$2$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: isPageCacheable" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">isPageCacheable</stringProp> - <stringProp name="RegexExtractor.regex">catalogsearch/searchTermsLog/save</stringProp> - <stringProp name="RegexExtractor.template">$0$</stringProp> - <stringProp name="RegexExtractor.default">0</stringProp> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> - <stringProp name="IfController.condition">"${isPageCacheable}" != "0"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/if_page_cacheable_controller.jmx</stringProp></IfController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Terms Log" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="q" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">q</stringProp> - <stringProp name="Argument.value">${searchTerm}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}catalogsearch/searchTermsLog/save/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms_log_save.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-547797305">"success":true</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Attribute 1 present in layered navigation" enabled="true"> - <stringProp name="IfController.condition">${attribute_1_options_count} > 0</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter-first-attribute.jmx</stringProp></IfController> - <hashTree> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Search Url 2" enabled="true"> - <stringProp name="BeanShellSampler.query">vars.put("search_url", vars.get("attribute_1_filter_url"));</stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - </BeanShellSampler> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Filter by Attribute 1" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol"/> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${attribute_1_filter_url}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="56511661">Search results for: </stringProp> - <stringProp name="1420634794"><span class="toolbar-number">[1-9]+</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract number of attribute 2 options" enabled="true"> - <stringProp name="XPathExtractor.default">0</stringProp> - <stringProp name="XPathExtractor.refname">attribute_2_options_count</stringProp> - <stringProp name="XPathExtractor.xpathQuery">count((//div[@class="filter-options-content"])[2]//li[@class="item"])</stringProp> - <boolProp name="XPathExtractor.validate">false</boolProp> - <boolProp name="XPathExtractor.tolerant">true</boolProp> - <boolProp name="XPathExtractor.namespace">false</boolProp> - </XPathExtractor> - <hashTree/> - <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract filter link from layered navigation" enabled="true"> - <stringProp name="XPathExtractor.default"/> - <stringProp name="XPathExtractor.refname">attribute_2_filter_url</stringProp> - <stringProp name="XPathExtractor.xpathQuery">((//div[@class="filter-options-content"])[2]//li[@class="item"]//a)[1]/@href</stringProp> - <boolProp name="XPathExtractor.validate">false</boolProp> - <boolProp name="XPathExtractor.tolerant">true</boolProp> - <boolProp name="XPathExtractor.namespace">false</boolProp> - </XPathExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract product url keys" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> - <stringProp name="RegexExtractor.regex"><a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s).</stringProp> - <stringProp name="RegexExtractor.template">$2$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - </hashTree> - - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Attribute 2 present in layered navigation" enabled="true"> - <stringProp name="IfController.condition">${attribute_2_options_count} > 0</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_quick_filter-second-attribute.jmx</stringProp></IfController> - <hashTree> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Search Ul 3" enabled="true"> - <stringProp name="BeanShellSampler.query">vars.put("search_url", vars.get("attribute_2_filter_url"));</stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - </BeanShellSampler> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Filter by Attribute 2" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol"/> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${attribute_2_filter_url}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="56511661">Search results for: </stringProp> - <stringProp name="1420634794"><span class="toolbar-number">[1-9]+</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract product url keys" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> - <stringProp name="RegexExtractor.regex"><a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s).</stringProp> - <stringProp name="RegexExtractor.template">$2$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="BeanShellSampler.query"> -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> - <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">${foundProducts}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end"/> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">_counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">true</boolProp> - <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> - </CounterConfig> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Advanced Search" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[GraphQL C] Admin Edit Order" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${searchAdvancedPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminEditOrderPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -47264,70 +83002,110 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "Advanced Search"); + vars.put("testLabel", "[GraphQL C] Admin Edit Order"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"> - <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> - <stringProp name="Cookie.value">30</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">/</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> - </elementProp> - <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> - <stringProp name="Cookie.value">${form_key}</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">${base_path}</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> - </elementProp> - </collectionProp> - <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="571386695"><title>Home page</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Advanced Search" enabled="true"> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"/> </elementProp> @@ -47335,9 +83113,9 @@ if (tmpLabel) { <stringProp name="HTTPSampler.port"/> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}catalogsearch/advanced/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -47345,101 +83123,509 @@ if (tmpLabel) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/open_advanced_search_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="921122077"><title>Advanced Search</title></stringProp> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract attribute name" enabled="true"> - <stringProp name="XPathExtractor.default"/> - <stringProp name="XPathExtractor.refname">attribute_name</stringProp> - <stringProp name="XPathExtractor.xpathQuery">(//select[@class="multiselect"])[last()]/@name</stringProp> - <boolProp name="XPathExtractor.validate">false</boolProp> - <boolProp name="XPathExtractor.tolerant">true</boolProp> - <boolProp name="XPathExtractor.namespace">false</boolProp> - </XPathExtractor> - <hashTree/> - <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract attribute options count" enabled="true"> - <stringProp name="XPathExtractor.default">0</stringProp> - <stringProp name="XPathExtractor.refname">attribute_options_count</stringProp> - <stringProp name="XPathExtractor.xpathQuery">count((//select[@class="multiselect"])[last()]/option)</stringProp> - <boolProp name="XPathExtractor.validate">false</boolProp> - <boolProp name="XPathExtractor.tolerant">true</boolProp> - <boolProp name="XPathExtractor.namespace">false</boolProp> - </XPathExtractor> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> <hashTree/> - <XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="Extract attribute value" enabled="true"> - <stringProp name="XPathExtractor.default"/> - <stringProp name="XPathExtractor.refname">attribute_value</stringProp> - <stringProp name="XPathExtractor.xpathQuery">((//select[@class="multiselect"])[last()]/option)[1]/@value</stringProp> - <boolProp name="XPathExtractor.validate">false</boolProp> - <boolProp name="XPathExtractor.tolerant">true</boolProp> - <boolProp name="XPathExtractor.namespace">false</boolProp> - </XPathExtractor> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> <hashTree/> </hashTree> - - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="name" elementType="HTTPArgument"> + <elementProp name="dummy" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">name</stringProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> </elementProp> - <elementProp name="sku" elementType="HTTPArgument"> + <elementProp name="form_key" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">sku</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_form_key}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> </elementProp> - <elementProp name="description" elementType="HTTPArgument"> + <elementProp name="login[password]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">description</stringProp> - <stringProp name="Argument.value">${searchTerm}</stringProp> + <stringProp name="Argument.value">${admin_password}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> </elementProp> - <elementProp name="short_description" elementType="HTTPArgument"> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1204796042">Create New Order</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">desc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Pending Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> +<hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order numbers" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_numbers</stringProp> + <stringProp name="RegexExtractor.regex">\"increment_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_ids</stringProp> + <stringProp name="RegexExtractor.regex">\"entity_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> + import java.util.ArrayList; + import java.util.HashMap; + 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); + + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/view/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2103620713">#${order_number}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order status" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_status</stringProp> + <stringProp name="RegexExtractor.regex"><span id="order_status">([^<]+)</span></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> + <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Comment" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="history[status]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">short_description</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">pending</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">history[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> </elementProp> - <elementProp name="price%5Bfrom%5D" elementType="HTTPArgument"> + <elementProp name="history[comment]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">price%5Bfrom%5D</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">Some text</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">history[comment]</stringProp> </elementProp> - <elementProp name="price%5Bto%5D" elementType="HTTPArgument"> + <elementProp name="form_key" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">price%5Bto%5D</stringProp> - <stringProp name="Argument.value">${priceTo}</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> </elementProp> - <!-- Should be fixed in MAGETWO-80420 --> - <!--<elementProp name="${attribute_name}" elementType="HTTPArgument">--> - <!--<boolProp name="HTTPArgument.always_encode">true</boolProp>--> - <!--<stringProp name="Argument.value">${attribute_value}</stringProp>--> - <!--<stringProp name="Argument.metadata">=</stringProp>--> - <!--<boolProp name="HTTPArgument.use_equals">true</boolProp>--> - <!--<stringProp name="Argument.name">${attribute_name}</stringProp>--> - <!--</elementProp>--> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> @@ -47448,258 +83634,130 @@ if (tmpLabel) { <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}catalogsearch/advanced/result/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/addComment/order_id/${order_id}/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_advanced.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/add_comment.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert search result" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1851531284">items</strong> were found using the following search criteria</stringProp> + <stringProp name="-2089278331">Not Notified</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product url keys" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">product_url_keys</stringProp> - <stringProp name="RegexExtractor.regex"><a class="product-item-link"(?s).+?href="(?:http|https)://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s).</stringProp> - <stringProp name="RegexExtractor.template">$2$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - </RegexExtractor> - <hashTree/> </hashTree> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="BeanShellSampler.query"> -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items.jmx</stringProp></BeanShellSampler> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1233850814">Invoice Totals</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> - <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">${foundProducts}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> - <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end"/> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">_counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">true</boolProp> - <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> - </CounterConfig> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract ordered items ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">item_ids</stringProp> + <stringProp name="RegexExtractor.regex"><div id="order_item_(\d+)_title"\s*class="product-title"></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - </hashTree> - </hashTree> - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Add To Cart By Guest" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cAddToCartByGuestPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Add To Cart By Guest"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"> - <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> - <stringProp name="Cookie.value">30</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">/</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Submit" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> </elementProp> - <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> - <stringProp name="Cookie.value">${form_key}</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">${base_path}</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> + <elementProp name="invoice[items][${item_ids_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_1}]</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_2}]</stringProp> + </elementProp> + <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Invoiced</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[comment_text]</stringProp> </elementProp> </collectionProp> - <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1740524604">The invoice has been created</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -vars.put("totalProductsAdded", "0"); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); + </hashTree> -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]); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="571386695"><title>Home page</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Start" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"/> </elementProp> @@ -47709,7 +83767,7 @@ vars.putObject("category", categories[number]); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${category_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/start/order_id/${order_id}/</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -47717,151 +83775,50 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_start.jmx</stringProp></HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1210004667"><span class="base" data-ui-id="page-title">${category_name}</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">6</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract category id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">category_id</stringProp> - <stringProp name="RegexExtractor.regex"><li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="Scope.variable">simple_product_1_url_key</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert category id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1191417111">^[0-9]+$</stringProp> + <stringProp name="304100442">New Shipment</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">category_id</stringProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> </hashTree> - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> - <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">2</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> - <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end"/> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">_counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">true</boolProp> - <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> - </CounterConfig> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Cart" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Submit" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="product" elementType="HTTPArgument"> + <elementProp name="form_key" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product</stringProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> </elementProp> - <elementProp name="related_product" elementType="HTTPArgument"> + <elementProp name="shipment[items][${item_ids_1}]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">related_product</stringProp> + <stringProp name="Argument.name">shipment[items][${item_ids_1}]</stringProp> </elementProp> - <elementProp name="qty" elementType="HTTPArgument"> + <elementProp name="shipment[items][${item_ids_2}]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">qty</stringProp> + <stringProp name="Argument.name">shipment[items][${item_ids_2}]</stringProp> </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> + <elementProp name="shipment[comment_text]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.value">Shipped</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.name">shipment[comment_text]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -47871,50 +83828,166 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_submit.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-2089453199">The shipment has been created</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + </hashTree> + + + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="REST API Combined Benchmark Pool" enabled="true"> + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> + <boolProp name="LoopController.continue_forever">false</boolProp> + <stringProp name="LoopController.loops">${loops}</stringProp> + </elementProp> + <stringProp name="ThreadGroup.num_threads">${restAPIcombinedBenchmarkPoolUsers}</stringProp> + <stringProp name="ThreadGroup.ramp_time">${ramp_period}</stringProp> + <longProp name="ThreadGroup.start_time">1505803944000</longProp> + <longProp name="ThreadGroup.end_time">1505803944000</longProp> + <boolProp name="ThreadGroup.scheduler">false</boolProp> + <stringProp name="ThreadGroup.duration"/> + <stringProp name="ThreadGroup.delay"/> + <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Cache hit miss" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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)); + } +} +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/cache_hit_miss.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Catalog Browsing By Guest" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cBrowseCatalogByGuestPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[REST API C] Catalog Browsing By Guest"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">cart,messages</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> - </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> </elementProp> </collectionProp> </elementProp> @@ -47924,280 +83997,106 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2057973164">This product is out of stock.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">6</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> </ResponseAssertion> <hashTree/> - + </hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <collectionProp name="HeaderManager.headers"> <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> </elementProp> </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> - </hashTree> - </hashTree> - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> - <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> - <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end"/> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">_counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">true</boolProp> - <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> - </CounterConfig> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> 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); +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">random = vars.getObject("randomIntGenerator"); -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> +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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> - <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> - <stringProp name="VAR">admin_token</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_token</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Authorization</stringProp> - <stringProp name="Header.value">Bearer ${admin_token}</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Options" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/configurable-products/${product_sku}/options/all</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract attribute_ids" enabled="true"> - <stringProp name="VAR">attribute_ids</stringProp> - <stringProp name="JSONPATH">$.[*].attribute_id</stringProp> - <stringProp name="DEFAULT">NO_VALUE</stringProp> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract option_values" enabled="true"> - <stringProp name="VAR">option_values</stringProp> - <stringProp name="JSONPATH">$.[*].values[0].value_index</stringProp> - <stringProp name="DEFAULT">NO_VALUE</stringProp> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - </hashTree> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="product" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product</stringProp> - </elementProp> - <elementProp name="related_product" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">identifier</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">related_product</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="qty" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">home</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">qty</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.value">eq</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -48207,80 +84106,104 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/cmsPage/search</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - 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); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> - <hashTree/> - </hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/categories</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_list_of_categories.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">cart,messages</stringProp> + <stringProp name="Argument.value">category_id</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.value">${category_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> </elementProp> - <elementProp name="_" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.value">eq</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">12</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> </collectionProp> </elementProp> @@ -48290,7 +84213,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -48298,55 +84221,233 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_list_of_products_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2057973164">This product is out of stock.</stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> <hashTree/> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> - </hashTree> - </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">url_key</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_url_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">url_key</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_url_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_configurable_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Add to Wishlist" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Site Search" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cAddToWishlistPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${cSiteSearchPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -48372,84 +84473,48 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Add to Wishlist"); + vars.put("testLabel", "[REST API C] Site Search"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"> - <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> - <stringProp name="Cookie.value">30</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">/</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="Search Terms" enabled="true"> + <stringProp name="filename">${files_folder}search_terms.csv</stringProp> + <stringProp name="fileEncoding">UTF-8</stringProp> + <stringProp name="variableNames"/> + <stringProp name="delimiter">,</stringProp> + <boolProp name="quotedData">false</boolProp> + <boolProp name="recycle">true</boolProp> + <boolProp name="stopThread">false</boolProp> + <stringProp name="shareMode">shareMode.thread</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/search_terms.jmx</stringProp></CSVDataSet> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> - <stringProp name="Cookie.value">${form_key}</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">${base_path}</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> - <hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customernUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Login Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -48457,57 +84522,124 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/account/login/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="637394530"><title>Customer Login</title></stringProp> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true"> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Quick Search" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${searchQuickPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Quick Search"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${customer_email}</stringProp> + <stringProp name="Argument.value">identifier</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${customer_password}</stringProp> + <stringProp name="Argument.value">home</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> </elementProp> - <elementProp name="send" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">eq</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">send</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -48517,69 +84649,60 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/account/loginPost/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/cmsPage/search</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1312950388"><title>My Account</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Address" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">addressId</stringProp> - <stringProp name="RegexExtractor.regex">customer/address/edit/id/([^'"]+)/</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert addressId extracted" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> + <intProp name="Assertion.test_type">6</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">addressId</stringProp> + <stringProp name="Scope.variable"/> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Customer Private Data" enabled="true"> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> + <elementProp name="searchCriteria[request_name]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">quick_search_container</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[request_name]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">search_term</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.value">${searchTerm}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> </elementProp> - <elementProp name="_" elementType="HTTPArgument"> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.value">20</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -48589,7 +84712,7 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/search</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -48597,12 +84720,101 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/search_quick.jmx</stringProp> </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">api_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_ids</stringProp> + <stringProp name="RegexExtractor.regex">"id":([^',]+)</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 1" enabled="true"> + <stringProp name="VAR">attribute_code_1</stringProp> + <stringProp name="JSONPATH">$.aggregations.buckets[1].name</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 1" enabled="true"> + <stringProp name="VAR">attribute_value_1</stringProp> + <stringProp name="JSONPATH">$.aggregations.buckets[1].values[0].value</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 2" enabled="true"> + <stringProp name="VAR">attribute_code_2</stringProp> + <stringProp name="JSONPATH">$.aggregations.buckets[2].name</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 2" enabled="true"> + <stringProp name="VAR">attribute_value_2</stringProp> + <stringProp name="JSONPATH">$.aggregations.buckets[2].values[0].value</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query"> +foundProducts = Integer.parseInt(vars.get("product_ids_matchNr")); + +if (foundProducts > 3) { + foundProducts = 3; +} + +vars.put("foundProducts", String.valueOf(foundProducts)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items_by_id.jmx</stringProp></BeanShellSampler> <hashTree/> - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Produts to Wishlist" enabled="true"> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">5</stringProp> + <stringProp name="LoopController.loops">${foundProducts}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> @@ -48616,37 +84828,53 @@ vars.put("customer_email", customerUser); </CounterConfig> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup_by_id.jmx</stringProp> <stringProp name="BeanShellSampler.query"> -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); +number = vars.get("_counter"); +product = vars.get("product_ids_"+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")); +vars.put("product_id", product); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + </BeanShellSampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -48654,243 +84882,39 @@ vars.put("product_sku", product.get("sku")); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_simple_product_details_by_product_id.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Wishlist" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="uenc" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_uenc}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">uenc</stringProp> - </elementProp> - <elementProp name="product" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}wishlist/index/add/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/add_to_wishlist.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1907714722"><title>My Wish List</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">wishListItems</stringProp> - <stringProp name="RegexExtractor.regex">data-post-remove='\{"action":"(.+)\/wishlist\\/index\\/remove\\/","data":\{"item":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$2$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Wishlist Section ${_counter}" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">wishlist,messages</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> - </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/load_wishlist_section.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1865430343">{"wishlist":{"counter":"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> - </ResponseAssertion> - <hashTree/> - <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> - <stringProp name="ConstantTimer.delay">${wishlistDelay}*1000</stringProp> - </ConstantTimer> - <hashTree/> - </hashTree> - </hashTree> - - <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Controller: Clear Wishlist" enabled="true"> - <stringProp name="ForeachController.inputVal">wishListItems</stringProp> - <stringProp name="ForeachController.returnVal">wishListItem</stringProp> - <boolProp name="ForeachController.useSeparator">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/wishlist/clear_wishlist.jmx</stringProp></ForeachController> - <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end">5</stringProp> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">true</boolProp> - <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> - </CounterConfig> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Clear Wishlist ${counter}" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="item" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${wishListItem}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">item</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}wishlist/index/remove/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/account/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1723813687">You are signed out.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Customer to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Compare Products" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Quick Search With Filtration" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cCompareProductsPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${searchQuickFilterPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -48916,87 +84940,100 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Compare Products"); + vars.put("testLabel", "Quick Search With Filtration"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"> - <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> - <stringProp name="Cookie.value">30</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">/</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> - </elementProp> - <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> - <stringProp name="Cookie.value">${form_key}</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">${base_path}</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> - </elementProp> - </collectionProp> - <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -vars.put("totalProductsAdded", "0"); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">identifier</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">home</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/cmsPage/search</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> <hashTree/> - - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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]); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> - <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[request_name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">quick_search_container</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[request_name]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">search_term</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${searchTerm}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -49004,7 +85041,7 @@ vars.putObject("category", categories[number]); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${category_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/search</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -49012,40 +85049,83 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/search_quick.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1210004667"><span class="base" data-ui-id="page-title">${category_name}</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">6</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">api_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Random Product Id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">random_product_compare_id</stringProp> - <stringProp name="RegexExtractor.regex">catalog\\/product_compare\\/add\\/\",\"data\":\{\"product\":\"([0-9]+)\"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Random Product Id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1191417111">^[0-9]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">random_product_compare_id</stringProp> - </ResponseAssertion> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_ids</stringProp> + <stringProp name="RegexExtractor.regex">"id":([^',]+)</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 1" enabled="true"> + <stringProp name="VAR">attribute_code_1</stringProp> + <stringProp name="JSONPATH">$.aggregations.buckets[1].name</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 1" enabled="true"> + <stringProp name="VAR">attribute_value_1</stringProp> + <stringProp name="JSONPATH">$.aggregations.buckets[1].values[0].value</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute code 2" enabled="true"> + <stringProp name="VAR">attribute_code_2</stringProp> + <stringProp name="JSONPATH">$.aggregations.buckets[2].name</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute value 2" enabled="true"> + <stringProp name="VAR">attribute_value_2</stringProp> + <stringProp name="JSONPATH">$.aggregations.buckets[2].values[0].value</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> </hashTree> - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Compare" enabled="true"> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Filter by Attribute" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> @@ -49061,33 +85141,19 @@ vars.putObject("category", categories[number]); </CounterConfig> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Attributes Data" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/searched_attributes_setup.jmx</stringProp> <stringProp name="BeanShellSampler.query"> -import java.util.Random; +number = vars.get("_counter"); +attribute_code = vars.get("attribute_code_"+number); -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); +attribute_code = attribute_code.replace("_bucket", ""); -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; +vars.put("attribute_code", attribute_code); -vars.put("totalProductsAdded", String.valueOf(productsAdded)); +attribute_value = vars.get("attribute_value_"+number); + +vars.put("attribute_value", attribute_value); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> @@ -49095,103 +85161,50 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); </BeanShellSampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Comparison Add" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Filter by Attribute ${_counter}" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="product" elementType="HTTPArgument"> + <elementProp name="searchCriteria[request_name]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.value">quick_search_container</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product</stringProp> + <stringProp name="Argument.name">searchCriteria[request_name]</stringProp> </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.value">search_term</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="uenc" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_uenc}</stringProp> + <stringProp name="Argument.value">${searchTerm}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">uenc</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}catalog/product_compare/add/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Compare Product Section" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][1][filters][0][field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">compare-products,messages</stringProp> + <stringProp name="Argument.value">${attribute_code}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][1][filters][0][field]</stringProp> </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][1][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.value">${attribute_value}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][1][filters][0][value]</stringProp> </elementProp> - <elementProp name="_" elementType="HTTPArgument"> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.value">20</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -49201,7 +85214,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/search</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -49209,23 +85222,70 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/search_quick_filter_attribute.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-350323027">\"compare-products\":{\"count\":${totalProductsAdded}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">api_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_ids</stringProp> + <stringProp name="RegexExtractor.regex">"id":([^',]+)</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> <hashTree/> </hashTree> </hashTree> - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Compare" enabled="true"> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query"> +foundProducts = Integer.parseInt(vars.get("product_ids_matchNr")); + +if (foundProducts > 3) { + foundProducts = 3; +} + +vars.put("foundProducts", String.valueOf(foundProducts)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items_by_id.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="LoopController.loops">${foundProducts}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> @@ -49239,33 +85299,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); </CounterConfig> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> - <stringProp name="BeanShellSampler.query"> -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")); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup_by_id.jmx</stringProp> <stringProp name="BeanShellSampler.query"> -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; +number = vars.get("_counter"); +product = vars.get("product_ids_"+number); -vars.put("totalProductsAdded", String.valueOf(productsAdded)); +vars.put("product_id", product); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> @@ -49273,17 +85313,39 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); </BeanShellSampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -49291,42 +85353,93 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_simple_product_details_by_product_id.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> </hashTree> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Advanced Search" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${searchAdvancedPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Advanced Search"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Comparison Add" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="product" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.value">identifier</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.value">home</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> </elementProp> - <elementProp name="uenc" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_uenc}</stringProp> + <stringProp name="Argument.value">eq</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">uenc</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -49336,40 +85449,74 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}catalog/product_compare/add/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/cmsPage/search</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/product_compare_add.jmx</stringProp></HTTPSamplerProxy> - <hashTree/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Compare Product Section" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Advanced" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> + <elementProp name="searchCriteria[request_name]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">compare-products,messages</stringProp> + <stringProp name="Argument.value">quick_search_container</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> + <stringProp name="Argument.name">searchCriteria[request_name]</stringProp> </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.value">search_term</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="_" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.value">${searchTerm}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][1][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">price.to</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][1][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][1][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${priceTo}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][1][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -49379,7 +85526,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/search</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -49387,84 +85534,171 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/search_advanced.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-350323027">\"compare-products\":{\"count\":${totalProductsAdded}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">api_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract product ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">product_ids</stringProp> + <stringProp name="RegexExtractor.regex">"id":([^',]+)</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + </RegexExtractor> <hashTree/> </hashTree> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Compare Products" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}catalog/product_compare/index/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products.jmx</stringProp></HTTPSamplerProxy> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query"> +foundProducts = Integer.parseInt(vars.get("product_ids_matchNr")); + +if (foundProducts > 3) { + foundProducts = 3; +} + +vars.put("foundProducts", String.valueOf(foundProducts)); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/set_found_items_by_id.jmx</stringProp></BeanShellSampler> <hashTree/> - <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Product Compare - Pause" enabled="true"> - <intProp name="ActionProcessor.action">1</intProp> - <intProp name="ActionProcessor.target">0</intProp> - <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${productCompareDelay}*1000))}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products_pause.jmx</stringProp></TestAction> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Searched Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">${foundProducts}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Product Data" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/search/searched_products_setup_by_id.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +number = vars.get("_counter"); +product = vars.get("product_ids_"+number); + +vars.put("product_id", product); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Compare Products Clear" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}catalog/product_compare/clear</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_compare/compare_products_clear.jmx</stringProp></HTTPSamplerProxy> - <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_simple_product_details_by_product_id.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Checkout By Guest" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Add To Cart By Guest" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cCheckoutByGuestPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${cAddToCartByGuestPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -49490,35 +85724,82 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Checkout By Guest"); + vars.put("testLabel", "[REST API C] Add To Cart By Guest"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"> - <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> - <stringProp name="Cookie.value">30</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">/</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> - <stringProp name="Cookie.value">${form_key}</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">${base_path}</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> @@ -49539,17 +85820,6 @@ vars.putObject("randomIntGenerator", random); </BeanShellSampler> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -vars.put("totalProductsAdded", "0"); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="parameters"/> @@ -49568,40 +85838,79 @@ vars.putObject("category", categories[number]); <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="571386695"><title>Home page</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Guest Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_guest_cart.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">cart_id</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Guest Cart Id extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">cart_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">identifier</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">home</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -49609,7 +85918,7 @@ vars.putObject("category", categories[number]); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${category_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/cmsPage/search</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -49617,41 +85926,130 @@ vars.putObject("category", categories[number]); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1210004667"><span class="base" data-ui-id="page-title">${category_name}</span></stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract category id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">category_id</stringProp> - <stringProp name="RegexExtractor.regex"><li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="Scope.variable">simple_product_1_url_key</stringProp> - </RegexExtractor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/categories</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_list_of_categories.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert category id" enabled="true"> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">category_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">12</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_list_of_products_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1191417111">^[0-9]+$</stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> + <intProp name="Assertion.test_type">6</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">category_id</stringProp> + <stringProp name="Scope.variable"/> </ResponseAssertion> <hashTree/> </hashTree> - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> @@ -49685,33 +86083,41 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">url_key</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_url_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -49719,102 +86125,46 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> </hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Cart" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="product" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product</stringProp> - </elementProp> - <elementProp name="related_product" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">related_product</stringProp> - </elementProp> - <elementProp name="qty" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">qty</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">cart,messages</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> - </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "cartItem": { + "sku": "${product_sku}", + "qty":"1", + "quote_id":"${cart_id}" + } +} +</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> </elementProp> </collectionProp> </elementProp> @@ -49824,57 +86174,29 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/items</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/guest_checkout/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2057973164">This product is out of stock.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">6</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.quote_id</stringProp> + <stringProp name="EXPECTED_VALUE">^[a-z0-9-]+$</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> - <hashTree/> - </hashTree> + </hashTree> </hashTree> - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> @@ -49908,33 +86230,41 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">url_key</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_url_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -49942,245 +86272,97 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_configurable_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> </hashTree> - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> - <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Options" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> - <stringProp name="VAR">admin_token</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_token</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Authorization</stringProp> - <stringProp name="Header.value">Bearer ${admin_token}</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Options" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/configurable-products/${product_sku}/options/all</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract attribute_ids" enabled="true"> - <stringProp name="VAR">attribute_ids</stringProp> - <stringProp name="JSONPATH">$.[*].attribute_id</stringProp> - <stringProp name="DEFAULT">NO_VALUE</stringProp> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract option_values" enabled="true"> - <stringProp name="VAR">option_values</stringProp> - <stringProp name="JSONPATH">$.[*].values[0].value_index</stringProp> - <stringProp name="DEFAULT">NO_VALUE</stringProp> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - </hashTree> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="product" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product</stringProp> - </elementProp> - <elementProp name="related_product" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">related_product</stringProp> - </elementProp> - <elementProp name="qty" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">qty</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - 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); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/configurable-products/${product_sku}/children</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_configurable_product_options_by_product_sku.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> + <stringProp name="VAR">product_option</stringProp> + <stringProp name="JSONPATH">$[0].sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/extract_configurable_product_option_from_product_detail.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">cart,messages</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> - </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "cartItem": { + "sku": "${product_option}", + "qty":"1", + "quote_id":"${cart_id}" + } +} +</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> </elementProp> </collectionProp> </elementProp> @@ -50190,139 +86372,87 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2057973164">This product is out of stock.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">6</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> - <hashTree/> - </hashTree> - </hashTree> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Checkout" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script"> - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); -</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout start" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}checkout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/items</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1403911775"><title>Checkout</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-179817969"><title>Shopping Cart</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">6</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Cart Id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">cart_id</stringProp> - <stringProp name="RegexExtractor.regex">"quoteData":{"entity_id":"([^'"]+)",</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Cart Id extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">cart_id</stringProp> - </ResponseAssertion> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/guest_checkout/add_configurable_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.quote_id</stringProp> + <stringProp name="EXPECTED_VALUE">^[a-z0-9-]+$</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> </hashTree> + </hashTree> + </hashTree> + - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Email Available" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Add to Wishlist" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAddToWishlistPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[REST API C] Add to Wishlist"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"customerEmail":"test@example.com"}</stringProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -50333,7 +86463,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/customers/isEmailAvailable</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -50341,47 +86471,218 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_email_available.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Referer</stringProp> - <stringProp name="Header.value">${base_path}checkout/onepage/</stringProp> - </elementProp> - <elementProp name="Content-Type" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> - </elementProp> - <elementProp name="X-Requested-With" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="3569038">true</stringProp> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">8</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Estimate Shipping Methods" enabled="true"> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Products to Wishlist" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">5</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">url_key</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_url_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Compare Products" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cCompareProductsPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[REST API C] Compare Products"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"address":{"country_id":"US","postcode":"95630"}}</stringProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -50392,7 +86693,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/estimate-shipping-methods</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -50400,48 +86701,98 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Referer</stringProp> - <stringProp name="Header.value">${base_path}checkout/onepage/</stringProp> - </elementProp> - <elementProp name="Content-Type" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> - </elementProp> - <elementProp name="X-Requested-With" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1224567411">"available":true</stringProp> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Billing/Shipping Information" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}}</stringProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">identifier</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">home</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">eq</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -50451,56 +86802,40 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/shipping-information</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/cmsPage/search</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Referer</stringProp> - <stringProp name="Header.value">${base_path}checkout/onepage/</stringProp> - </elementProp> - <elementProp name="Content-Type" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> - </elementProp> - <elementProp name="X-Requested-With" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1494218646">{"payment_methods":</stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Payment Info/Place Order" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}}</stringProp> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> </collectionProp> </elementProp> @@ -50510,70 +86845,63 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/payment-information</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/categories</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_list_of_categories.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Referer</stringProp> - <stringProp name="Header.value">${base_path}checkout/onepage/</stringProp> - </elementProp> - <elementProp name="Content-Type" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> - </elementProp> - <elementProp name="X-Requested-With" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-297987887">"[0-9]+"</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> - <stringProp name="VAR">order_id</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> + <intProp name="Assertion.test_type">6</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">order_id</stringProp> + <stringProp name="Scope.variable"/> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout success" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">category_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">12</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -50581,7 +86909,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}checkout/onepage/success/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -50589,28 +86917,233 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/guest_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_list_of_products_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="494863233">Thank you for your purchase!</stringProp> - <stringProp name="1635682758">Your order # is</stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> </ResponseAssertion> <hashTree/> </hashTree> - </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">url_key</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_url_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">url_key</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_url_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_configurable_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Checkout By Customer" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Checkout By Guest" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cCheckoutByCustomerPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${cCheckoutByGuestPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -50636,35 +87169,82 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Checkout By Customer"); + vars.put("testLabel", "[REST API C] Checkout By Guest"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"> - <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> - <stringProp name="Cookie.value">30</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">/</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> - <stringProp name="Cookie.value">${form_key}</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">${base_path}</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> @@ -50685,17 +87265,6 @@ vars.putObject("randomIntGenerator", random); </BeanShellSampler> <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Total Products In Cart" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_total_products_in_cart_setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -vars.put("totalProductsAdded", "0"); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="parameters"/> @@ -50714,66 +87283,16 @@ vars.putObject("category", categories[number]); <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> - <hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customernUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="571386695"><title>Home page</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Login Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Guest Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -50781,57 +87300,60 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/account/login/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_guest_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">cart_id</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Guest Cart Id extracted" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="637394530"><title>Customer Login</title></stringProp> + <stringProp name="2845929">^.+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">cart_id</stringProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${customer_email}</stringProp> + <stringProp name="Argument.value">identifier</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${customer_password}</stringProp> + <stringProp name="Argument.value">home</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> </elementProp> - <elementProp name="send" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">eq</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">send</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -50841,69 +87363,40 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/account/loginPost/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/cmsPage/search</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1312950388"><title>My Account</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Address" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">addressId</stringProp> - <stringProp name="RegexExtractor.regex">customer/address/edit/id/([^'"]+)/</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert addressId extracted" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> + <intProp name="Assertion.test_type">6</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">addressId</stringProp> + <stringProp name="Scope.variable"/> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Customer Private Data" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> - </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> </collectionProp> </elementProp> @@ -50913,7 +87406,7 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/categories</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -50921,12 +87414,55 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_list_of_categories.jmx</stringProp> </HTTPSamplerProxy> - <hashTree/> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Category" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">category_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">12</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -50934,7 +87470,7 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${category_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -50942,41 +87478,23 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_category.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_list_of_products_by_category_id.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1210004667"><span class="base" data-ui-id="page-title">${category_name}</span></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">6</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor: Extract category id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">category_id</stringProp> - <stringProp name="RegexExtractor.regex"><li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="Scope.variable">simple_product_1_url_key</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion: Assert category id" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1191417111">^[0-9]+$</stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> + <intProp name="Assertion.test_type">6</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">category_id</stringProp> + <stringProp name="Scope.variable"/> </ResponseAssertion> <hashTree/> </hashTree> - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Simple Products to Cart" enabled="true"> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">2</stringProp> <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> @@ -51010,33 +87528,41 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">url_key</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_url_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -51044,49 +87570,46 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> </hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Cart" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="product" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product</stringProp> - </elementProp> - <elementProp name="related_product" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">related_product</stringProp> - </elementProp> - <elementProp name="qty" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">qty</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "cartItem": { + "sku": "${product_sku}", + "qty":"1", + "quote_id":"${cart_id}" + } +} +</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> </elementProp> </collectionProp> </elementProp> @@ -51096,7 +87619,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/items</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -51104,102 +87627,21 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">cart,messages</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> - </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/guest_checkout/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2057973164">This product is out of stock.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">6</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.quote_id</stringProp> + <stringProp name="EXPECTED_VALUE">^[a-z0-9-]+$</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> - <hashTree/> - </hashTree> + </hashTree> </hashTree> - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Add Configurable Products to Cart" enabled="true"> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> <boolProp name="LoopController.continue_forever">true</boolProp> <stringProp name="LoopController.loops">1</stringProp> <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> @@ -51233,33 +87675,41 @@ vars.put("product_sku", product.get("sku")); <stringProp name="BeanShellSampler.parameters"/> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> - <hashTree/> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Update Products Added Counter" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/loops/update_products_added_counter.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">url_key</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_url_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${product_url_key}${url_suffix}</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -51267,245 +87717,97 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_configurable_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1787050162"><span>In stock</span></stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> </hashTree> - <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="SetUp - Get Configurable Product Options" enabled="true"> - <boolProp name="LoopController.continue_forever">true</boolProp> - <stringProp name="LoopController.loops">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_configurable_product_options.jmx</stringProp></LoopController> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Options" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> - <stringProp name="VAR">admin_token</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_token</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Authorization</stringProp> - <stringProp name="Header.value">Bearer ${admin_token}</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Configurable Product Options" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/configurable-products/${product_sku}/options/all</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract attribute_ids" enabled="true"> - <stringProp name="VAR">attribute_ids</stringProp> - <stringProp name="JSONPATH">$.[*].attribute_id</stringProp> - <stringProp name="DEFAULT">NO_VALUE</stringProp> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract option_values" enabled="true"> - <stringProp name="VAR">option_values</stringProp> - <stringProp name="JSONPATH">$.[*].values[0].value_index</stringProp> - <stringProp name="DEFAULT">NO_VALUE</stringProp> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - </hashTree> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="product" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${product_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product</stringProp> - </elementProp> - <elementProp name="related_product" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">related_product</stringProp> - </elementProp> - <elementProp name="qty" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">qty</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}checkout/cart/add/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - 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); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx</stringProp></BeanShellPreProcessor> - <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/configurable-products/${product_sku}/children</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_configurable_product_options_by_product_sku.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> + <stringProp name="VAR">product_option</stringProp> + <stringProp name="JSONPATH">$[0].sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/extract_configurable_product_option_from_product_detail.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Cart Section ${_counter}" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">cart,messages</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> - </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "cartItem": { + "sku": "${product_option}", + "qty":"1", + "quote_id":"${cart_id}" + } +} +</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> </elementProp> </collectionProp> </elementProp> @@ -51515,60 +87817,28 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/items</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/load_cart_section.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/guest_checkout/add_configurable_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="210217247">You added ${product_name} to your <a href="${base_path}checkout/cart/">shopping cart</a>.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2057973164">This product is out of stock.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">6</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-350323027">\"summary_count\":${totalProductsAdded}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.quote_id</stringProp> + <stringProp name="EXPECTED_VALUE">^[a-z0-9-]+$</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> - - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/http_header_manager_ajax.jmx</stringProp></HeaderManager> - <hashTree/> - </hashTree> + </hashTree> </hashTree> - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Checkout" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> <stringProp name="scriptLanguage">javascript</stringProp> <stringProp name="parameters"/> @@ -51581,113 +87851,13 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout start" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}checkout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_start.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1403911775"><title>Checkout</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-179817969"><title>Shopping Cart</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">6</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Cart Id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">cart_id</stringProp> - <stringProp name="RegexExtractor.regex">"quoteData":{"entity_id":"([^'"]+)",</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Address Id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">address_id</stringProp> - <stringProp name="RegexExtractor.regex">"default_billing":"([^'"]+)",</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Customer Id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">customer_id</stringProp> - <stringProp name="RegexExtractor.regex">"customer_id":([^'",]+),</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Cart Id extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">cart_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Address Id extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="576002869">[0-9]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">address_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Customer Id extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="576002869">[0-9]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">customer_id</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Estimate Shipping Methods" enabled="true"> <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"addressId":"${addressId}"}</stringProp> + <stringProp name="Argument.value">{"address":{"country_id":"US","postcode":"95630"}}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -51698,7 +87868,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/estimate-shipping-methods</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -51706,29 +87876,9 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Referer</stringProp> - <stringProp name="Header.value">${base_path}checkout/onepage/</stringProp> - </elementProp> - <elementProp name="Content-Type" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> - </elementProp> - <elementProp name="X-Requested-With" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> <stringProp name="-1224567411">"available":true</stringProp> @@ -51746,7 +87896,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}}</stringProp> + <stringProp name="Argument.value">{"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"}}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -51757,7 +87907,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine/shipping-information</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/shipping-information</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -51765,32 +87915,12 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/guest_checkout/checkout_billing_shipping_information.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Referer</stringProp> - <stringProp name="Header.value">${host}${base_path}checkout/onepage</stringProp> - </elementProp> - <elementProp name="Content-Type" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json; charset=UTF-8</stringProp> - </elementProp> - <elementProp name="X-Requested-With" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-740937264">{"payment_methods"</stringProp> + <stringProp name="-1494218646">{"payment_methods":</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> @@ -51805,7 +87935,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"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"}}</stringProp> + <stringProp name="Argument.value">{"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}}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -51816,7 +87946,7 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine/payment-information</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/guest-carts/${cart_id}/payment-information</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -51824,30 +87954,10 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/guest_checkout/checkout_payment_info_place_order.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Referer</stringProp> - <stringProp name="Header.value">${host}${base_path}checkout/onepage</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json; charset=UTF-8 </stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert order number" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> <stringProp name="-297987887">"[0-9]+"</stringProp> </collectionProp> @@ -51856,103 +87966,34 @@ vars.put("totalProductsAdded", String.valueOf(productsAdded)); <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout success" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}checkout/onepage/success/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_success.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="494863233">Thank you for your purchase!</stringProp> - <stringProp name="-1590086334">Your order number is</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">order_id</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - </hashTree> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/account/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1723813687">You are signed out.</stringProp> + <stringProp name="89649215">^\d+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_id</stringProp> </ResponseAssertion> <hashTree/> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Clear Cookie" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script">curSampler = ctx.getCurrentSampler(); -if(curSampler.getName().contains("Checkout success")) { - manager = curSampler.getCookieManager(); - manager.clear(); -} -</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Customer to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - </hashTree> + </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Account management" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Checkout By Customer" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cAccountManagementPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${cCheckoutByCustomerPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -51978,35 +88019,118 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Account management"); + vars.put("testLabel", "[REST API C] Checkout By Customer"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"> - <elementProp name="product_list_limit" elementType="Cookie" testname="product_list_limit"> - <stringProp name="Cookie.value">30</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">/</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <elementProp name="product_list_limit" elementType="Cookie" testname="form_key"> - <stringProp name="Cookie.value">${form_key}</stringProp> - <stringProp name="Cookie.domain">${host}</stringProp> - <stringProp name="Cookie.path">${base_path}</stringProp> - <boolProp name="Cookie.secure">false</boolProp> - <longProp name="Cookie.expires">0</longProp> - <boolProp name="Cookie.path_specified">true</boolProp> - <boolProp name="Cookie.domain_specified">true</boolProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> </elementProp> </collectionProp> - <boolProp name="CookieManager.clearEachIteration">true</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager.jmx</stringProp></CookieManager> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Prepare Category Data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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]); + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/extract_category_setup.jmx</stringProp></JSR223Sampler> <hashTree/> <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> @@ -52020,7 +88144,7 @@ if (tmpLabel) { customerUserList = props.get("customer_emails_list"); customerUser = customerUserList.poll(); if (customerUser == null) { - SampleResult.setResponseMessage("customernUser list is empty"); + SampleResult.setResponseMessage("customerUser list is empty"); SampleResult.setResponseData("customerUser list is empty","UTF-8"); IsSuccess=false; SampleResult.setSuccessful(false); @@ -52035,9 +88159,67 @@ vars.put("customer_email", customerUser); <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Home Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "username": "${customer_email}", + "password": "${customer_password}" +} +</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/integration/customer/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/login.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer token" enabled="true"> + <stringProp name="VAR">customer_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Customer Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -52045,30 +88227,75 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_home_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_customer_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">cart_id</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Guest Cart Id extracted" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="571386695"><title>Home page</title></stringProp> + <stringProp name="2845929">^.+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">cart_id</stringProp> </ResponseAssertion> <hashTree/> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/set_customer_token.jmx</stringProp> + </BeanShellPreProcessor> + <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Login Page" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Home Page" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">identifier</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">home</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -52076,7 +88303,7 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/account/login/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/cmsPage/search</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -52084,49 +88311,32 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/open_login_page.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_home_page.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="637394530"><title>Customer Login</title></stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Category List" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${customer_email}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> - </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${customer_password}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> - </elementProp> - <elementProp name="send" elementType="HTTPArgument"> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">send</stringProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> </collectionProp> </elementProp> @@ -52136,69 +88346,61 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/account/loginPost/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/categories</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_list_of_categories.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1312950388"><title>My Account</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Address" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">addressId</stringProp> - <stringProp name="RegexExtractor.regex">customer/address/edit/id/([^'"]+)/</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert addressId extracted" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="-1294635157">errors</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> + <intProp name="Assertion.test_type">6</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">addressId</stringProp> + <stringProp name="Scope.variable"/> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Load Customer Private Data" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get List of Products by category_id" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="sections" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">category_id</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sections</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="force_new_section_timestamp" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.value">${category_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">force_new_section_timestamp</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> </elementProp> - <elementProp name="_" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.value">eq</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + <elementProp name="searchCriteria[page_size]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">12</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[page_size]</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> </collectionProp> </elementProp> @@ -52208,7 +88410,7 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/section/load/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -52216,12 +88418,140 @@ vars.put("customer_email", customerUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_list_of_products_by_category_id.jmx</stringProp> </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Simple Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">2</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Simple Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx</stringProp></BeanShellSampler> <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="My Orders" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">url_key</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_url_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Simple Product ${_counter} Add To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "cartItem": { + "sku": "${product_sku}", + "qty":"1", + "quote_id":"${cart_id}" + } +} +</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -52229,162 +88559,208 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}sales/order/history/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine/items</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_orders.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/customer_checkout/add_simple_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="220295440"><title>My Orders</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract orderId" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">orderId</stringProp> - <stringProp name="RegexExtractor.regex">sales/order/view/order_id/(\d+)/</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default">NOT_FOUND</stringProp> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.quote_id</stringProp> + <stringProp name="EXPECTED_VALUE">^[a-z0-9-]+$</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/set_customer_token.jmx</stringProp></BeanShellPreProcessor> </hashTree> + </hashTree> - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Orders Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_orders.jmx</stringProp> - <stringProp name="IfController.condition">"${orderId}" != "NOT_FOUND"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - </IfController> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="View Configurable Products" enabled="true"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/loop_controller.jmx</stringProp></LoopController> <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View Order" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}sales/order/view/order_id/${orderId}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1956770127"><title>Order #</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract shipment tab" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">shipment_tab</stringProp> - <stringProp name="RegexExtractor.regex">sales/order/shipment/order_id/(\d+)..Order Shipments</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default">NOT_FOUND</stringProp> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Shipments Controller" enabled="true"> - <stringProp name="TestPlan.comments">May not have shipped</stringProp> - <stringProp name="IfController.condition">"${shipment_tab}" != "NOT_FOUND"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - </IfController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View Order Shipments" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}sales/order/shipment/order_id/${orderId}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"/> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Prepare Configurable Product Data" enabled="true"> + <stringProp name="BeanShellSampler.query"> +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")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} View" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filter_groups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">url_key</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">${product_url_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filter_groups][0][filters][0][condition_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">eq</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filter_groups][0][filters][0][condition_type]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_configurable_product_details_by_product_url_key.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="120578727">Track this shipment</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract popup link" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">popupLink</stringProp> - <stringProp name="RegexExtractor.regex">popupWindow": {"windowURL":"([^'"]+)",</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Track Shipment" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Options" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/configurable-products/${product_sku}/children</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/get_configurable_product_options_by_product_sku.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert results are present" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1294635157">errors</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">6</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract Configurable Product option" enabled="true"> + <stringProp name="VAR">product_option</stringProp> + <stringProp name="JSONPATH">$[0].sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/extract_configurable_product_option_from_product_detail.jmx</stringProp></com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Configurable Product ${_counter} Add To Cart" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "cartItem": { + "sku": "${product_option}", + "qty":"1", + "quote_id":"${cart_id}" + } +} +</stringProp> + <stringProp name="Argument.metadata">=</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${popupLink}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-760430210"><title>Tracking Information</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="My Downloadable Products" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -52392,54 +88768,61 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}downloadable/customer/products</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine/items</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_downloadable_products.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/customer_checkout/add_configurable_product_to_cart.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="358050505"><title>My Downloadable Products</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract orderId" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">orderId</stringProp> - <stringProp name="RegexExtractor.regex">sales/order/view/order_id/(\d+)/</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default">NOT_FOUND</stringProp> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract linkId" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">linkId</stringProp> - <stringProp name="RegexExtractor.regex">downloadable/download/link/id/(\d+)/</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.quote_id</stringProp> + <stringProp name="EXPECTED_VALUE">^[a-z0-9-]+$</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/set_customer_token.jmx</stringProp></BeanShellPreProcessor> </hashTree> + </hashTree> - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Downloadables Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_downloadables.jmx</stringProp> - <stringProp name="IfController.condition">"${orderId}" != "NOT_FOUND"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - </IfController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View Downloadable Product" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> + vars.put("alabama_region_id", props.get("alabama_region_id")); + vars.put("california_region_id", props.get("california_region_id")); +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Estimate Shipping Methods" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"address":{"country_id":"US","postcode":"95630"}}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -52447,30 +88830,49 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}sales/order/view/order_id/${orderId}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine/estimate-shipping-methods</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/view_downloadable_products.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/customer_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1956770127"><title>Order #</stringProp> + <stringProp name="-1224567411">"available":true</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/set_customer_token.jmx</stringProp></BeanShellPreProcessor> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Download Product" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Billing/Shipping Information" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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"}}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -52478,21 +88880,49 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}downloadable/download/link/id/${linkId}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine/shipping-information</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/download_product.jmx</stringProp></HTTPSamplerProxy> - <hashTree/> - </hashTree> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/customer_checkout/checkout_billing_shipping_information.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1494218646">{"payment_methods":</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/set_customer_token.jmx</stringProp></BeanShellPreProcessor> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="My Wish List" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Checkout Payment Info/Place Order" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -52500,55 +88930,138 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}wishlist</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/carts/mine/payment-information</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/customer_checkout/checkout_payment_info_place_order.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-1907714722"><title>My Wish List</title></stringProp> + <stringProp name="-297987887">"[0-9]+"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract wishlistId" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">wishlistId</stringProp> - <stringProp name="RegexExtractor.regex">wishlist/index/update/wishlist_id/([^'"]+)/</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/my_wish_list.jmx</stringProp> - </RegexExtractor> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract cart id" enabled="true"> + <stringProp name="VAR">order_id</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Verify that there are items in the wishlist" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">buttonTitle</stringProp> - <stringProp name="RegexExtractor.regex">Update Wish List</stringProp> - <stringProp name="RegexExtractor.template">FOUND</stringProp> - <stringProp name="RegexExtractor.default">NOT_FOUND</stringProp> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_id</stringProp> + </ResponseAssertion> <hashTree/> + + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; + + sampler.getHeaderManager().removeHeaderNamed("Authorization"); + + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/set_customer_token.jmx</stringProp></BeanShellPreProcessor> </hashTree> - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Wish List Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/if_wishlist.jmx</stringProp> - <stringProp name="IfController.condition">"${buttonTitle}" === "FOUND"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - </IfController> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Return Customer Email" enabled="true"> + <stringProp name="CriticalSectionController.lockName">return-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Share Wish List" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Return Customer Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/return_customer_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +customerUserList = props.get("customer_emails_list"); +customerUserList.add(vars.get("customer_email")); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Account management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAccountManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[REST API C] Account management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -52556,51 +89069,114 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}wishlist/index/share/wishlist_id/${wishlistId}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/share_wish_list.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1257102154"><title>Wish List Sharing</title></stringProp> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Send Wish List" enabled="true"> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <hashTree/> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Init Random Generator" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/init_random_generator_setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +import java.util.Random; + +Random random = new Random(); +if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); +} + +vars.putObject("randomIntGenerator", random); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Get Customer Email" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Customer Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_customer_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Orders" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filterGroups][0][filters][0][field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${form_key}</stringProp> + <stringProp name="Argument.value">customer_email</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="emails" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filterGroups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">${customer_email}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">emails</stringProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][value]</stringProp> </elementProp> - <elementProp name="message" elementType="HTTPArgument"> + <elementProp name="searchCriteria[pageSize]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">[TEST] See my wishlist!!!</stringProp> + <stringProp name="Argument.value">20</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">message</stringProp> + <stringProp name="Argument.name">searchCriteria[pageSize]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -52610,73 +89186,109 @@ vars.put("customer_email", customerUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}wishlist/index/send/wishlist_id/${wishlistId}/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/orders</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/account_management/send_wish_list.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/customer_orders.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1907714722"><title>My Wish List</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract entity ids" enabled="true"> + <stringProp name="VAR">order_number</stringProp> + <stringProp name="JSONPATH">$.items[0].increment_id</stringProp> + <stringProp name="DEFAULT">NOT_FOUND</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> </hashTree> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}customer/account/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/logout.jmx</stringProp></HTTPSamplerProxy> + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Orders Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/if_orders.jmx</stringProp> + <stringProp name="IfController.condition">"${order_number}" != "NOT_FOUND"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + </IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filterGroups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filterGroups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${order_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[pageSize]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/orders</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/if_orders.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.items[0].increment_id</stringProp> + <stringProp name="EXPECTED_VALUE"/> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Return Customer Email" enabled="true"> + <stringProp name="CriticalSectionController.lockName">return-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1723813687">You are signed out.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Customer to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Return Customer Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/return_customer_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> customerUserList = props.get("customer_emails_list"); customerUserList.add(vars.get("customer_email")); - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> </hashTree> </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin CMS Management" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin CMS Management" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> @@ -52706,7 +89318,7 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin CMS Management"); + vars.put("testLabel", "[REST API C] Admin CMS Management"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> @@ -53162,7 +89774,7 @@ vars.put("admin_user", adminUser); </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Browse Product Grid" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin Browse Product Grid" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> @@ -53192,7 +89804,7 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin Browse Product Grid"); + vars.put("testLabel", "[REST API C] Admin Browse Product Grid"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> @@ -53945,7 +90557,7 @@ vars.put("grid_pages_count_filtered", pageCount); </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Browse Order Grid" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin Browse Order Grid" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> @@ -53975,7 +90587,7 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin Browse Order Grid"); + vars.put("testLabel", "[REST API C] Admin Browse Order Grid"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> @@ -54728,7 +91340,7 @@ vars.put("grid_pages_count_filtered", pageCount); </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Create Product" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin Create Product" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> @@ -54758,7 +91370,7 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin Create Product"); + vars.put("testLabel", "[REST API C] Admin Create Product"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> @@ -61659,7 +98271,7 @@ function addConfigurableMatrix(attributes) { </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Edit Product" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin Edit Product" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> @@ -61689,7 +98301,7 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin Edit Product"); + vars.put("testLabel", "[REST API C] Admin Edit Product"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> @@ -62513,7 +99125,477 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/id/${simple_product_id}/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/id/${simple_product_id}/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1853918323">{"error":false}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Simple Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_sku}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${category_additional}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full simple product Description ${simple_product_id} Edited</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variations]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Title Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Keyword Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_name} Meta Description Edited</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${special_price_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${quantity_new}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/id/${simple_product_id}/back/edit/active_tab/product-details/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -62525,7 +99607,7 @@ vars.put("admin_user", adminUser); <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1853918323">{"error":false}</stringProp> + <stringProp name="-583471546">You saved the product</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> @@ -62533,17 +99615,190 @@ vars.put("admin_user", adminUser); </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Simple Product Save" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/edit/id/${configurable_product_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1355179215">Product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract name" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_name</stringProp> + <stringProp name="RegexExtractor.regex">,"name":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract sku" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_sku</stringProp> + <stringProp name="RegexExtractor.regex">,"sku":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_category_id</stringProp> + <stringProp name="RegexExtractor.regex">,"category_ids":."(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable attribute id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_id</stringProp> + <stringProp name="RegexExtractor.regex">,"configurable_variation":"([^'"]+)",</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <boolProp name="RegexExtractor.default_empty_value">true</boolProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable matrix" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_matrix</stringProp> + <stringProp name="RegexExtractor.regex">"configurable-matrix":(\[.*?\])</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <boolProp name="RegexExtractor.default_empty_value">true</boolProp> + </RegexExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract associated products ids" enabled="true"> + <stringProp name="VAR">associated_products_ids</stringProp> + <stringProp name="JSONPATH">$.[*].id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE">configurable_matrix</stringProp> + <stringProp name="SUBJECT">VAR</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable product json" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_product_data</stringProp> + <stringProp name="RegexExtractor.regex">(\{"product":.*?configurable_attributes_data.*?\})\s*<</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract configurable attributes data" enabled="true"> + <stringProp name="VAR">configurable_attributes_data</stringProp> + <stringProp name="JSONPATH">$.product.configurable_attributes_data</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE">configurable_product_data</stringProp> + <stringProp name="SUBJECT">VAR</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_ids</stringProp> + <stringProp name="RegexExtractor.regex">"attribute_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute codes" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_codes</stringProp> + <stringProp name="RegexExtractor.regex">"code":"(\w+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute labels" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_labels</stringProp> + <stringProp name="RegexExtractor.regex">"label":"(.*?)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute values" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">configurable_attribute_values</stringProp> + <stringProp name="RegexExtractor.regex">"values":(\{(?:\}|.*?\}\}))</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Sample.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_attributes_data</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach configurable attribute id" enabled="true"> + <stringProp name="ForeachController.inputVal">configurable_attribute_ids</stringProp> + <stringProp name="ForeachController.returnVal">configurable_attribute_id</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + </ForeachController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${configurable_attribute_ids_matchNr}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">attribute_counter</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="Process configurable attribute values" enabled="true"> + <stringProp name="BeanShellSampler.query">return vars.get("configurable_attribute_values_" + vars.get("attribute_counter"));</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Exctract attribute values" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">attribute_${configurable_attribute_id}_values</stringProp> + <stringProp name="RegexExtractor.regex">"value_index":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">configurable_attribute_values_${attribute_counter}</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product Validate" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="ajax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">ajax</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> <elementProp name="isAjax" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">true</stringProp> @@ -62562,7 +99817,7 @@ vars.put("admin_user", adminUser); </elementProp> <elementProp name="product[name]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_name}</stringProp> + <stringProp name="Argument.value">${configurable_product_name}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">product[name]</stringProp> @@ -62570,7 +99825,7 @@ vars.put("admin_user", adminUser); </elementProp> <elementProp name="product[sku]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_sku}</stringProp> + <stringProp name="Argument.value">${configurable_product_sku}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">product[sku]</stringProp> @@ -62592,14 +99847,6 @@ vars.put("admin_user", adminUser); <stringProp name="Argument.name">product[tax_class_id]</stringProp> <stringProp name="Argument.desc">false</stringProp> </elementProp> - <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${quantity_new}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">1</stringProp> @@ -62610,23 +99857,15 @@ vars.put("admin_user", adminUser); </elementProp> <elementProp name="product[weight]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.value">3</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">product[weight]</stringProp> <stringProp name="Argument.desc">false</stringProp> </elementProp> - <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[product_has_weight]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> <elementProp name="product[category_ids][]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_category_id}</stringProp> + <stringProp name="Argument.value">${configurable_product_category_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">product[category_ids][]</stringProp> @@ -62638,10 +99877,11 @@ vars.put("admin_user", adminUser); <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">product[category_ids][]</stringProp> + <stringProp name="Argument.desc">false</stringProp> </elementProp> <elementProp name="product[description]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"><p>Full simple product Description ${simple_product_id} Edited</p></stringProp> + <stringProp name="Argument.value"><p>Configurable product description ${configurable_product_id} Edited</p></stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">product[description]</stringProp> @@ -62655,57 +99895,9 @@ vars.put("admin_user", adminUser); <stringProp name="Argument.name">product[status]</stringProp> <stringProp name="Argument.desc">false</stringProp> </elementProp> - <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[configurable_variations]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[image]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[image]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[small_image]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[small_image]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[thumbnail]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[thumbnail]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[url_key]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_name}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[url_key]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> <elementProp name="product[meta_title]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_name} Meta Title Edited</stringProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Title Edited</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">product[meta_title]</stringProp> @@ -62713,7 +99905,7 @@ vars.put("admin_user", adminUser); </elementProp> <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_name} Meta Keyword Edited</stringProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Keyword Edited</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">product[meta_keyword]</stringProp> @@ -62721,7 +99913,7 @@ vars.put("admin_user", adminUser); </elementProp> <elementProp name="product[meta_description]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${simple_product_name} Meta Description Edited</stringProp> + <stringProp name="Argument.value">${configurable_product_name} Meta Description Edited</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> <stringProp name="Argument.name">product[meta_description]</stringProp> @@ -62775,22 +99967,6 @@ vars.put("admin_user", adminUser); <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> <stringProp name="Argument.desc">false</stringProp> </elementProp> - <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${quantity_new}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${quantity_new}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">0</stringProp> @@ -62823,14 +99999,6 @@ vars.put("admin_user", adminUser); <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> <stringProp name="Argument.desc">false</stringProp> </elementProp> - <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">10000</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">1</stringProp> @@ -62967,12 +100135,64 @@ vars.put("admin_user", adminUser); <stringProp name="Argument.name">product[options_container]</stringProp> <stringProp name="Argument.desc">false</stringProp> </elementProp> - <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${configurable_attribute_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + <stringProp name="Argument.name">product[configurable_variation]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${configurable_product_name}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_message_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_message_available]</stringProp> + </elementProp> + <elementProp name="product[use_config_gift_wrapping_available]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[use_config_gift_wrapping_available]</stringProp> + </elementProp> + <elementProp name="product[visibility]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">4</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[visibility]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">50</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[stock_data][type_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">configurable</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][type_id]</stringProp> <stringProp name="Argument.desc">false</stringProp> </elementProp> </collectionProp> @@ -62983,7 +100203,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/id/${simple_product_id}/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/id/${configurable_product_id}/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -62993,200 +100213,64 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.embedded_url_re"/> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-583471546">You saved the product</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Configure product options" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">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); + }</stringProp> + </BeanShellPreProcessor> <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/edit/id/${configurable_product_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1355179215">Product</stringProp> + <stringProp name="1853918323">{"error":false}</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract name" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_product_name</stringProp> - <stringProp name="RegexExtractor.regex">,"name":"([^'"]+)",</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract sku" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_product_sku</stringProp> - <stringProp name="RegexExtractor.regex">,"sku":"([^'"]+)",</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_product_category_id</stringProp> - <stringProp name="RegexExtractor.regex">,"category_ids":."(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable attribute id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_attribute_id</stringProp> - <stringProp name="RegexExtractor.regex">,"configurable_variation":"([^'"]+)",</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <boolProp name="RegexExtractor.default_empty_value">true</boolProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable matrix" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_matrix</stringProp> - <stringProp name="RegexExtractor.regex">"configurable-matrix":(\[.*?\])</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <boolProp name="RegexExtractor.default_empty_value">true</boolProp> - </RegexExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract associated products ids" enabled="true"> - <stringProp name="VAR">associated_products_ids</stringProp> - <stringProp name="JSONPATH">$.[*].id</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE">configurable_matrix</stringProp> - <stringProp name="SUBJECT">VAR</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract configurable product json" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_product_data</stringProp> - <stringProp name="RegexExtractor.regex">(\{"product":.*?configurable_attributes_data.*?\})\s*<</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract configurable attributes data" enabled="true"> - <stringProp name="VAR">configurable_attributes_data</stringProp> - <stringProp name="JSONPATH">$.product.configurable_attributes_data</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE">configurable_product_data</stringProp> - <stringProp name="SUBJECT">VAR</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute ids" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_attribute_ids</stringProp> - <stringProp name="RegexExtractor.regex">"attribute_id":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Sample.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_attributes_data</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute codes" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_attribute_codes</stringProp> - <stringProp name="RegexExtractor.regex">"code":"(\w+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Sample.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_attributes_data</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute labels" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_attribute_labels</stringProp> - <stringProp name="RegexExtractor.regex">"label":"(.*?)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Sample.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_attributes_data</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract attribute values" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">configurable_attribute_values</stringProp> - <stringProp name="RegexExtractor.regex">"values":(\{(?:\}|.*?\}\}))</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Sample.scope">variable</stringProp> - <stringProp name="Scope.variable">configurable_attributes_data</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach configurable attribute id" enabled="true"> - <stringProp name="ForeachController.inputVal">configurable_attribute_ids</stringProp> - <stringProp name="ForeachController.returnVal">configurable_attribute_id</stringProp> - <boolProp name="ForeachController.useSeparator">true</boolProp> - </ForeachController> - <hashTree> - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end">${configurable_attribute_ids_matchNr}</stringProp> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">attribute_counter</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">true</boolProp> - <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> - </CounterConfig> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="Process configurable attribute values" enabled="true"> - <stringProp name="BeanShellSampler.query">return vars.get("configurable_attribute_values_" + vars.get("attribute_counter"));</stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - </BeanShellSampler> - <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Exctract attribute values" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">attribute_${configurable_attribute_id}_values</stringProp> - <stringProp name="RegexExtractor.regex">"value_index":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Scope.variable">configurable_attribute_values_${attribute_counter}</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product Validate" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product Save" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> <elementProp name="isAjax" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">true</stringProp> @@ -63227,12 +100311,12 @@ vars.put("admin_user", adminUser); <stringProp name="Argument.name">product[price]</stringProp> <stringProp name="Argument.desc">false</stringProp> </elementProp> - <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <elementProp name="product[tax_class_id]admin" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">2</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tax_class_id]</stringProp> + <stringProp name="Argument.name">product[tax_class_id]admin</stringProp> <stringProp name="Argument.desc">false</stringProp> </elementProp> <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> @@ -63591,7 +100675,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/id/${configurable_product_id}/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/id/${configurable_product_id}/back/edit/active_tab/product-details/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -63619,554 +100703,9070 @@ vars.put("admin_user", adminUser); 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); - }</stringProp> - </BeanShellPreProcessor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1853918323">{"error":false}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Configurable Product Save" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="ajax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">ajax</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[name]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${configurable_product_name}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[name]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[sku]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${configurable_product_sku}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[sku]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[price]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${price_new}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[price]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[tax_class_id]admin" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">2</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[tax_class_id]admin</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[weight]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">3</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[weight]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[category_ids][]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${configurable_product_category_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[category_ids][]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[category_ids][]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${category_additional}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[category_ids][]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[description]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"><p>Configurable product description ${configurable_product_id} Edited</p></stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[description]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[status]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[status]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[meta_title]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${configurable_product_name} Meta Title Edited</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[meta_title]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${configurable_product_name} Meta Keyword Edited</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[meta_keyword]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[meta_description]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${configurable_product_name} Meta Description Edited</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[meta_description]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[website_ids][]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[website_ids][]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[special_price]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${special_price_new}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[special_price]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[special_from_date]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[special_from_date]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[special_to_date]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[special_to_date]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[cost]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[cost]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[custom_design]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_design]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_design_from]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_design_to]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[custom_layout_update]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[page_layout]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[page_layout]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[options_container]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">container2</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[options_container]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[configurable_variation]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${configurable_attribute_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[configurable_variation]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[url_key]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${configurable_product_name}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[url_key]</stringProp> - </elementProp> - <elementProp name="product[use_config_gift_message_available]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[use_config_gift_message_available]</stringProp> - </elementProp> - <elementProp name="product[use_config_gift_wrapping_available]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[use_config_gift_wrapping_available]</stringProp> - </elementProp> - <elementProp name="product[visibility]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">4</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[visibility]</stringProp> - </elementProp> - <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[product_has_weight]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">50</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][qty]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="product[stock_data][type_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">configurable</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">product[stock_data][type_id]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/id/${configurable_product_id}/back/edit/active_tab/product-details/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Configure product options" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script">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); + }</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-583471546">You saved the product</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + <stringProp name="TestPlan.comments"> if have trouble see messages-message-error </stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin Returns Management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminReturnsManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[REST API C] Admin Returns Management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1204796042">Create New Order</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">desc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Pending Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> +<hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order numbers" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_numbers</stringProp> + <stringProp name="RegexExtractor.regex">\"increment_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_ids</stringProp> + <stringProp name="RegexExtractor.regex">\"entity_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> + import java.util.ArrayList; + import java.util.HashMap; + 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); + + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/view/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2103620713">#${order_number}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order status" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_status</stringProp> + <stringProp name="RegexExtractor.regex"><span id="order_status">([^<]+)</span></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> + <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1233850814">Invoice Totals</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract ordered items ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">item_ids</stringProp> + <stringProp name="RegexExtractor.regex"><div id="order_item_(\d+)_title"\s*class="product-title"></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Submit" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_1}]</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_2}]</stringProp> + </elementProp> + <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Invoiced</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[comment_text]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1740524604">The invoice has been created</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Credit Memo Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_creditmemo/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1382627322">New Memo</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Credit Memo Submit - Full Refund" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="creditmemo[items][${item_ids_1}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[items][${item_ids_1}][qty]</stringProp> + </elementProp> + <elementProp name="creditmemo[items][${item_ids_2}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[items][${item_ids_2}][qty]</stringProp> + </elementProp> + <elementProp name="creditmemo[do_offline]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[do_offline]</stringProp> + </elementProp> + <elementProp name="creditmemo[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Credit Memo added</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[comment_text]</stringProp> + </elementProp> + <elementProp name="creditmemo[shipping_amount]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[shipping_amount]</stringProp> + </elementProp> + <elementProp name="creditmemo[adjustment_positive]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[adjustment_positive]</stringProp> + </elementProp> + <elementProp name="creditmemo[adjustment_negative]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">creditmemo[adjustment_negative]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_creditmemo/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-515117447">You created the credit memo</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Create/Process Returns - Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/pause.jmx</stringProp></TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin Browse Customer Grid" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminBrowseCustomerGridPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[REST API C] Admin Browse Customer Grid"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="script"> + 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"); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_customers_grid/setup.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} pages count" enabled="true"> + <stringProp name="cacheKey"/> + <stringProp name="filename"/> + <stringProp name="parameters"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Filtered Pages Count" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> + <stringProp name="JSON_PATH">$.totalRecords</stringProp> + <stringProp name="EXPECTED_VALUE">0</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">true</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> + <stringProp name="VAR">entity_total_records</stringProp> + <stringProp name="JSONPATH">$.totalRecords</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} filtered pages count" enabled="true"> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + 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); + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select Filtered ${gridEntityType} Page Number" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end">${grid_pages_count_filtered}</stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">page_number</stringProp> + <stringProp name="CounterConfig.format"/> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> +</TestFragmentController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_field</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_field</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">3</stringProp> + </ForeachController> + <hashTree> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Order Defined" enabled="true"> + <stringProp name="ForeachController.inputVal">grid_sort_order</stringProp> + <stringProp name="ForeachController.returnVal">grid_sort_order</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="ForeachController.startIndex">0</stringProp> + <stringProp name="ForeachController.endIndex">2</stringProp> + </ForeachController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page - Filtering + Sort By ${grid_sort_field} ${grid_sort_order}" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_namespace}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[${grid_filter_field}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[${grid_filter_field}]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${page_number}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_field}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${grid_sort_order}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin Create Order" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminCreateOrderPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[REST API C] Admin Create Order"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> + vars.put("alabama_region_id", props.get("alabama_region_id")); + vars.put("california_region_id", props.get("california_region_id")); +</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Order" enabled="true"/> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_order/admin_create_order.jmx</stringProp> + <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; +import java.util.Random; +Random random = new Random(); + +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); +}</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Start Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/start/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree/> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Get Configurable Product Options" enabled="true"/> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get Configurable Product Options" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/configurable-products/${configurable_product_1_sku}/options/all</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract attribute_ids" enabled="true"> + <stringProp name="VAR">attribute_ids</stringProp> + <stringProp name="JSONPATH">$.[*].attribute_id</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract option_values" enabled="true"> + <stringProp name="VAR">option_values</stringProp> + <stringProp name="JSONPATH">$.[*].values[0].value_index</stringProp> + <stringProp name="DEFAULT">NO_VALUE</stringProp> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Products" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="item[${simple_product_1_id}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">item[${simple_product_1_id}][qty]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="item[${simple_product_2_id}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">item[${simple_product_2_id}][qty]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="item[${configurable_product_1_id}][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">item[${configurable_product_1_id}][qty]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="customer_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">customer_id</stringProp> + <stringProp name="Argument.value">${customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="store_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">store_id</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="currency_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">currency_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="payment[method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">payment[method]</stringProp> + <stringProp name="Argument.value">checkmo</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="reset_shipping" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">reset_shipping</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="json" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">json</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="as_js_varname" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">as_js_varname</stringProp> + <stringProp name="Argument.value">iFrameResponse</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/loadBlock/block/search,items,shipping_method,totals,giftmessage,billing_method?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Configure product options" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">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); +}</stringProp> + </BeanShellPreProcessor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Collect Shipping Rates" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="collect_shipping_rates" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">collect_shipping_rates</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="customer_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">customer_id</stringProp> + <stringProp name="Argument.value">${customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="store_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">store_id</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="currency_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">currency_id</stringProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="payment[method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">payment[method]</stringProp> + <stringProp name="Argument.value">checkmo</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="json" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">json</stringProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/loadBlock/block/shipping_method,totals?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Shipping Method" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1987784558">shipping_method</stringProp> + <stringProp name="818779431">Flat Rate</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Filled Order Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/index/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Filled Order Page" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-37823069">Select from existing customer addresses</stringProp> + <stringProp name="-13185722">Submit Order</stringProp> + <stringProp name="-209419315">Items Ordered</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="limit" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">limit</stringProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="entity_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">entity_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="email" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">email</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="Telephone" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">Telephone</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="billing_postcode" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">billing_postcode</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="billing_country_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">billing_country_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="billing_regione" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">billing_regione</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="store_name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">store_name</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="page" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">page</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[currency]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[currency]</stringProp> + <stringProp name="Argument.value">USD</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="sku" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">sku</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="qty" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">qty</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="limit" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">limit</stringProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="entity_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">entity_id</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="sku" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">sku</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="price[from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">price[from]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="price[to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">price[to]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="in_products" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">in_products</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="page" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">page</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="coupon_code" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">coupon_code</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[account][group_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[account][group_id]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[account][email]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[account][email]</stringProp> + <stringProp name="Argument.value">user_${customer_id}@example.com</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][customer_address_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][customer_address_id]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][prefix]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][firstname]</stringProp> + <stringProp name="Argument.value">Anthony</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][middlename]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][lastname]</stringProp> + <stringProp name="Argument.value">Nealy</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][suffix]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][company]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][street][0]</stringProp> + <stringProp name="Argument.value">123 Freedom Blvd. #123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][street][1]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][city]</stringProp> + <stringProp name="Argument.value">Fayetteville</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][country_id]</stringProp> + <stringProp name="Argument.value">US</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][region]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][region_id]</stringProp> + <stringProp name="Argument.value">${alabama_region_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][postcode]</stringProp> + <stringProp name="Argument.value">123123</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][telephone]</stringProp> + <stringProp name="Argument.value">022-333-4455</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][fax]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][fax]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[billing_address][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[billing_address][vat_id]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipping_same_as_billing" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipping_same_as_billing</stringProp> + <stringProp name="Argument.value">on</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="payment[method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">payment[method]</stringProp> + <stringProp name="Argument.value">checkmo</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[shipping_method]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[shipping_method]</stringProp> + <stringProp name="Argument.value">flatrate_flatrate</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[comment][customer_note]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[comment][customer_note]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[comment][customer_note_notify]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[comment][customer_note_notify]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="order[send_confirmation]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">order[send_confirmation]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_id</stringProp> + <stringProp name="RegexExtractor.regex">${host}${base_path}${admin_path}/sales/order/index/order_id/(\d+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 1" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_item_1</stringProp> + <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 2" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_item_2</stringProp> + <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">2</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 3" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_item_3</stringProp> + <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">3</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 1" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_item_1</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 2" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_item_2</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 3" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">order_item_3</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Created" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="563107624">You created the order.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Invoice" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[items][${order_item_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[items][${order_item_1}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[items][${order_item_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[items][${order_item_2}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[items][${order_item_3}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[items][${order_item_3}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">invoice[comment_text]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Invoice Created" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1878312078">The invoice has been created.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Shipment" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[items][${order_item_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[items][${order_item_1}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[items][${order_item_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[items][${order_item_2}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[items][${order_item_3}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[items][${order_item_3}]</stringProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + <elementProp name="shipment[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.name">shipment[comment_text]</stringProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Shipment Created" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-348539683">The shipment has been created.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin Category Management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminCategoryManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[REST API C] Admin Category Management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Category Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_category_management/admin_category_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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));</stringProp> + </JSR223Sampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select parent category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${parent_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open new category page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/add/store/0/parent/${parent_category_id}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1903925024"><title>New Category</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> + </elementProp> + <elementProp name="parent" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">parent</stringProp> + </elementProp> + <elementProp name="path" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">path</stringProp> + </elementProp> + <elementProp name="store_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_id</stringProp> + </elementProp> + <elementProp name="is_active" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_active</stringProp> + </elementProp> + <elementProp name="include_in_menu" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">include_in_menu</stringProp> + </elementProp> + <elementProp name="is_anchor" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_anchor</stringProp> + </elementProp> + <elementProp name="use_config[available_sort_by]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[available_sort_by]</stringProp> + </elementProp> + <elementProp name="use_config[default_sort_by]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[default_sort_by]</stringProp> + </elementProp> + <elementProp name="use_config[filter_price_range]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[filter_price_range]</stringProp> + </elementProp> + <elementProp name="use_default[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_default[url_key]</stringProp> + </elementProp> + <elementProp name="url_key_create_redirect" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">url_key_create_redirect</stringProp> + </elementProp> + <elementProp name="custom_use_parent_settings" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_use_parent_settings</stringProp> + </elementProp> + <elementProp name="custom_apply_to_products" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_apply_to_products</stringProp> + </elementProp> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Admin Category Management ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + </elementProp> + <elementProp name="url_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">admin-category-management-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">url_key</stringProp> + </elementProp> + <elementProp name="meta_title" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_title</stringProp> + </elementProp> + <elementProp name="description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">description</stringProp> + </elementProp> + <elementProp name="display_mode" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">PRODUCTS</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">display_mode</stringProp> + </elementProp> + <elementProp name="default_sort_by" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">position</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">default_sort_by</stringProp> + </elementProp> + <elementProp name="meta_keywords" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_keywords</stringProp> + </elementProp> + <elementProp name="meta_description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_description</stringProp> + </elementProp> + <elementProp name="custom_layout_update" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_layout_update</stringProp> + </elementProp> + <elementProp name="category_products" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"${simple_product_1_id}":"","${simple_product_2_id}":"","${simple_product_3_id}":"","${simple_product_4_id}":"","${simple_product_5_id}":""}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">category_products</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">URL</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_id</stringProp> + <stringProp name="RegexExtractor.regex">/catalog/category/edit/id/(\d+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select created category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${admin_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category row id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category attribute set id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_attribute_set_id</stringProp> + <stringProp name="RegexExtractor.regex">"attribute_set_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category parent Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_parent_id</stringProp> + <stringProp name="RegexExtractor.regex">"parent_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category created at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_created_at</stringProp> + <stringProp name="RegexExtractor.regex">"created_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category updated at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_updated_at</stringProp> + <stringProp name="RegexExtractor.regex">"updated_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category path" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_path</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":(.+)"path":"([^\"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category level" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_level</stringProp> + <stringProp name="RegexExtractor.regex">"level":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category name" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_name</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":(.+)"name":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_url_key</stringProp> + <stringProp name="RegexExtractor.regex">"url_key":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url path" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_url_path</stringProp> + <stringProp name="RegexExtractor.regex">"url_path":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category row id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_entity_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category attribute set id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_attribute_set_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category parent id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_parent_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category created at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_created_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category updated at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_updated_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category path" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="59022110">^[\d\\\/]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_path</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category level" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_level</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category name" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_name</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url key" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_url_key</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url path" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_url_path</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert products added" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="417284990">${simple_product_1_name}</stringProp> + <stringProp name="1304788671">${simple_product_2_name}</stringProp> + <stringProp name="-2102674944">${simple_product_3_name}</stringProp> + <stringProp name="-1215171263">${simple_product_4_name}</stringProp> + <stringProp name="-327667582">${simple_product_5_name}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Move category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="point" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">append</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">point</stringProp> + </elementProp> + <elementProp name="pid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${new_parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">pid</stringProp> + </elementProp> + <elementProp name="paid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paid</stringProp> + </elementProp> + <elementProp name="aid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">aid</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/move/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/delete/id/${admin_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category deleted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1277069529">You deleted the category.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCategoryManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin Promotion Rules" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminPromotionRulesPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[REST API C] Admin Promotion Rules"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Promotions Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/new</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New Conditional" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1--1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> + </elementProp> + <elementProp name="type" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">type</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/newConditionHtml/form/sales_rule_formrule_conditions_fieldset_/form_namespace/sales_rule_form</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Rule Name ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + </elementProp> + <elementProp name="is_active" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_active</stringProp> + </elementProp> + <elementProp name="use_auto_generation" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_auto_generation</stringProp> + </elementProp> + <elementProp name="is_rss" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_rss</stringProp> + </elementProp> + <elementProp name="apply_to_shipping" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">apply_to_shipping</stringProp> + </elementProp> + <elementProp name="stop_rules_processing" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">stop_rules_processing</stringProp> + </elementProp> + <elementProp name="coupon_code" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">coupon_code</stringProp> + </elementProp> + <elementProp name="uses_per_coupon" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">uses_per_coupon</stringProp> + </elementProp> + <elementProp name="uses_per_customer" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">uses_per_customer</stringProp> + </elementProp> + <elementProp name="sort_order" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sort_order</stringProp> + </elementProp> + <elementProp name="discount_amount" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">5</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">discount_amount</stringProp> + </elementProp> + <elementProp name="discount_qty" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">discount_qty</stringProp> + </elementProp> + <elementProp name="discount_step" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">discount_step</stringProp> + </elementProp> + <elementProp name="reward_points_delta" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">reward_points_delta</stringProp> + </elementProp> + <elementProp name="store_labels[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[0]</stringProp> + </elementProp> + <elementProp name="description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Rule Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">description</stringProp> + </elementProp> + <elementProp name="coupon_type" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">coupon_type</stringProp> + </elementProp> + <elementProp name="simple_action" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">cart_fixed</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">simple_action</stringProp> + </elementProp> + <elementProp name="website_ids[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">website_ids[0]</stringProp> + </elementProp> + <elementProp name="customer_group_ids[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer_group_ids[0]</stringProp> + </elementProp> + <elementProp name="from_date" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">from_date</stringProp> + </elementProp> + <elementProp name="to_date" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">to_date</stringProp> + </elementProp> + <elementProp name="rule[conditions][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Combine</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][type]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1][aggregator]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">all</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][aggregator]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][value]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][type]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][attribute]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">base_subtotal</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][attribute]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][operator]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">>=</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][operator]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1--1][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][value]</stringProp> + </elementProp> + <elementProp name="rule[conditions][1][new_chlid]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][new_chlid]</stringProp> + </elementProp> + <elementProp name="rule[actions][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Product\Combine</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][type]</stringProp> + </elementProp> + <elementProp name="rule[actions][1][aggregator]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">all</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][aggregator]</stringProp> + </elementProp> + <elementProp name="rule[actions][1][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][value]</stringProp> + </elementProp> + <elementProp name="rule[actions][1][new_child]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][new_child]</stringProp> + </elementProp> + <elementProp name="store_labels[1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[1]</stringProp> + </elementProp> + <elementProp name="store_labels[2]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[2]</stringProp> + </elementProp> + <elementProp name="related_banners" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">related_banners</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-396438583">You saved the rule.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminPromotionsManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin Customer Management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminCustomerManagementPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[REST API C] Admin Customer Management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Customer Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_customer_management/admin_customer_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Render" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">customer_listing</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Render" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">customer_listing</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Lastname</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer edit url" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">customer_edit_url_path</stringProp> + <stringProp name="RegexExtractor.regex">actions":\{"edit":\{"href":"(?:http|https):\\/\\/(.*?)\\/customer\\/index\\/edit\\/id\\/(\d+)\\/",</stringProp> + <stringProp name="RegexExtractor.template">/customer/index/edit/id/$2$/</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer edit url" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">customer_edit_url_path</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Customer" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}${customer_edit_url_path}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert edit customer page" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1422614550">Customer Information</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer entity_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract website_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_website_id</stringProp> + <stringProp name="RegexExtractor.regex">"website_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer firstname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_firstname</stringProp> + <stringProp name="RegexExtractor.regex">"firstname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer lastname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_lastname</stringProp> + <stringProp name="RegexExtractor.regex">"lastname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer email" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_email</stringProp> + <stringProp name="RegexExtractor.regex">"email":"([^\@]+@[^.]+.[^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract group_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_group_id</stringProp> + <stringProp name="RegexExtractor.regex">"group_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract store_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_store_id</stringProp> + <stringProp name="RegexExtractor.regex">"store_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extact created_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_created_at</stringProp> + <stringProp name="RegexExtractor.regex">"created_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract updated_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_updated_at</stringProp> + <stringProp name="RegexExtractor.regex">"updated_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract is_active" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_is_active</stringProp> + <stringProp name="RegexExtractor.regex">"is_active":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract disable_auto_group_change" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_disable_auto_group_change</stringProp> + <stringProp name="RegexExtractor.regex">"disable_auto_group_change":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract created_in" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_created_in</stringProp> + <stringProp name="RegexExtractor.regex">"created_in":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract dob" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_dob</stringProp> + <stringProp name="RegexExtractor.regex">"dob":"(\d+)-(\d+)-(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$/$3$/$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_billing" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_default_billing</stringProp> + <stringProp name="RegexExtractor.regex">"default_billing":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_shipping" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_default_shipping</stringProp> + <stringProp name="RegexExtractor.regex">"default_shipping":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract gender" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_gender</stringProp> + <stringProp name="RegexExtractor.regex">"gender":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract failures_num" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_failures_num</stringProp> + <stringProp name="RegexExtractor.regex">"failures_num":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_entity_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{"entity_id":"(\d+)".+?"parent_id":"${admin_customer_entity_id}"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_created_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_created_at</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"created_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_updated_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_updated_at</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"updated_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_is_active" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_is_active</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"is_active":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_city" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_city</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"city":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_country_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_country_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"country_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_firstname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_firstname</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"firstname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_lastname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_lastname</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"lastname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_postcode" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_postcode</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"postcode":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_region</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_region_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address street" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_street</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"street":\["([^"]+)"\]</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_telephone" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_telephone</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"telephone":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_customer_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_customer_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"customer_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer entity_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_entity_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert website_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_website_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer firstname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_firstname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer lastname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_lastname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer email" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_email</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer group_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_group_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer store_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_store_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_created_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer updated_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_updated_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer is_active" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_is_active</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer disable_auto_group_change" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_disable_auto_group_change</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_in" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_created_in</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer dob" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="221072919">^\d+/\d+/\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_dob</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_billing" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_default_billing</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_shipping" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_default_shipping</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer gender" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_gender</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer failures_num" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_failures_num</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_entity_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_entity_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_created_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_created_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_updated_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_updated_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_is_active" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_is_active</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_city" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_city</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_country_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_country_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_firstname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_firstname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_lastname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_lastname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_postcode" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_postcode</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_region</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_region_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_street" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_street</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_telephone" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_telephone</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_customer_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_customer_id</stringProp> + </ResponseAssertion> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="isAjax " elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax </stringProp> + </elementProp> + <elementProp name="customer[entity_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[entity_id]</stringProp> + </elementProp> + <elementProp name="customer[website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[website_id]</stringProp> + </elementProp> + <elementProp name="customer[email]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_email}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[email]</stringProp> + </elementProp> + <elementProp name="customer[group_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[group_id]</stringProp> + </elementProp> + <elementProp name="customer[store_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[store_id]</stringProp> + </elementProp> + <elementProp name="customer[created_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[created_at]</stringProp> + </elementProp> + <elementProp name="customer[updated_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[updated_at]</stringProp> + </elementProp> + <elementProp name="customer[is_active]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[is_active]</stringProp> + </elementProp> + <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> + </elementProp> + <elementProp name="customer[created_in]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[created_in]</stringProp> + </elementProp> + <elementProp name="customer[prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[prefix]</stringProp> + </elementProp> + <elementProp name="customer[firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[firstname]</stringProp> + </elementProp> + <elementProp name="customer[middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[middlename]</stringProp> + </elementProp> + <elementProp name="customer[lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[lastname]</stringProp> + </elementProp> + <elementProp name="customer[suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[suffix]</stringProp> + </elementProp> + <elementProp name="customer[dob]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_dob}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[dob]</stringProp> + </elementProp> + <elementProp name="customer[default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[default_billing]</stringProp> + </elementProp> + <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[default_shipping]</stringProp> + </elementProp> + <elementProp name="customer[taxvat]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[taxvat]</stringProp> + </elementProp> + <elementProp name="customer[gender]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_gender}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[gender]</stringProp> + </elementProp> + <elementProp name="customer[failures_num]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[failures_num]</stringProp> + </elementProp> + <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> + </elementProp> + <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][prefix]</stringProp> + </elementProp> + <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">John</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][firstname]</stringProp> + </elementProp> + <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][middlename]</stringProp> + </elementProp> + <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Doe</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][lastname]</stringProp> + </elementProp> + <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][suffix]</stringProp> + </elementProp> + <elementProp name="address[new_0][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Test Company</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][company]</stringProp> + </elementProp> + <elementProp name="address[new_0][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Folsom</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][city]</stringProp> + </elementProp> + <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">95630</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][postcode]</stringProp> + </elementProp> + <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1234567890</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][telephone]</stringProp> + </elementProp> + <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> + </elementProp> + <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> + </elementProp> + <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> + </elementProp> + <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123 Main</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][street][0]</stringProp> + </elementProp> + <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][street][1]</stringProp> + </elementProp> + <elementProp name="address[new_0][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][region]</stringProp> + </elementProp> + <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">US</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][country_id]</stringProp> + </elementProp> + <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][region_id]</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/validate/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="isAjax " elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax </stringProp> + </elementProp> + <elementProp name="customer[entity_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[entity_id]</stringProp> + </elementProp> + <elementProp name="customer[website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[website_id]</stringProp> + </elementProp> + <elementProp name="customer[email]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_email}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[email]</stringProp> + </elementProp> + <elementProp name="customer[group_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[group_id]</stringProp> + </elementProp> + <elementProp name="customer[store_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[store_id]</stringProp> + </elementProp> + <elementProp name="customer[created_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[created_at]</stringProp> + </elementProp> + <elementProp name="customer[updated_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[updated_at]</stringProp> + </elementProp> + <elementProp name="customer[is_active]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[is_active]</stringProp> + </elementProp> + <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> + </elementProp> + <elementProp name="customer[created_in]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[created_in]</stringProp> + </elementProp> + <elementProp name="customer[prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[prefix]</stringProp> + </elementProp> + <elementProp name="customer[firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[firstname]</stringProp> + </elementProp> + <elementProp name="customer[middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[middlename]</stringProp> + </elementProp> + <elementProp name="customer[lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[lastname]</stringProp> + </elementProp> + <elementProp name="customer[suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[suffix]</stringProp> + </elementProp> + <elementProp name="customer[dob]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_dob}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[dob]</stringProp> + </elementProp> + <elementProp name="customer[default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[default_billing]</stringProp> + </elementProp> + <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[default_shipping]</stringProp> + </elementProp> + <elementProp name="customer[taxvat]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[taxvat]</stringProp> + </elementProp> + <elementProp name="customer[gender]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_gender}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[gender]</stringProp> + </elementProp> + <elementProp name="customer[failures_num]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[failures_num]</stringProp> + </elementProp> + <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> + </elementProp> + + <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> + </elementProp> + <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][prefix]</stringProp> + </elementProp> + <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">John</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][firstname]</stringProp> + </elementProp> + <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][middlename]</stringProp> + </elementProp> + <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Doe</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][lastname]</stringProp> + </elementProp> + <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][suffix]</stringProp> + </elementProp> + <elementProp name="address[new_0][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Test Company</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][company]</stringProp> + </elementProp> + <elementProp name="address[new_0][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Folsom</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][city]</stringProp> + </elementProp> + <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">95630</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][postcode]</stringProp> + </elementProp> + <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1234567890</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][telephone]</stringProp> + </elementProp> + <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> + </elementProp> + <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> + </elementProp> + <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> + </elementProp> + <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123 Main</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][street][0]</stringProp> + </elementProp> + <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][street][1]</stringProp> + </elementProp> + <elementProp name="address[new_0][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][region]</stringProp> + </elementProp> + <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">US</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][country_id]</stringProp> + </elementProp> + <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">12</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][region_id]</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer saved" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="292987815">You saved the customer.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCustomerManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[REST API C] Admin Edit Order" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${cAdminEditOrderPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "[REST API C] Admin Edit Order"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1204796042">Create New Order</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">desc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Pending Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> +<hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order numbers" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_numbers</stringProp> + <stringProp name="RegexExtractor.regex">\"increment_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_ids</stringProp> + <stringProp name="RegexExtractor.regex">\"entity_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> + import java.util.ArrayList; + import java.util.HashMap; + 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); + + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/view/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2103620713">#${order_number}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order status" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_status</stringProp> + <stringProp name="RegexExtractor.regex"><span id="order_status">([^<]+)</span></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> + <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Comment" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="history[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">history[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="history[comment]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Some text</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">history[comment]</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/addComment/order_id/${order_id}/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/add_comment.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-2089278331">Not Notified</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1233850814">Invoice Totals</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract ordered items ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">item_ids</stringProp> + <stringProp name="RegexExtractor.regex"><div id="order_item_(\d+)_title"\s*class="product-title"></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Submit" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_1}]</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_2}]</stringProp> + </elementProp> + <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Invoiced</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[comment_text]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1740524604">The invoice has been created</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="304100442">New Shipment</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Submit" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="shipment[items][${item_ids_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">shipment[items][${item_ids_1}]</stringProp> + </elementProp> + <elementProp name="shipment[items][${item_ids_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">shipment[items][${item_ids_2}]</stringProp> + </elementProp> + <elementProp name="shipment[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Shipped</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">shipment[comment_text]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_submit.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-2089453199">The shipment has been created</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + </hashTree> + + + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="One Thread Scenarios Pool" enabled="true"> + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> + <boolProp name="LoopController.continue_forever">false</boolProp> + <stringProp name="LoopController.loops">${loops}</stringProp> + </elementProp> + <stringProp name="ThreadGroup.num_threads">${oneThreadScenariosPoolUsers}</stringProp> + <stringProp name="ThreadGroup.ramp_time">${ramp_period}</stringProp> + <longProp name="ThreadGroup.start_time">1505803944000</longProp> + <longProp name="ThreadGroup.end_time">1505803944000</longProp> + <boolProp name="ThreadGroup.scheduler">false</boolProp> + <stringProp name="ThreadGroup.duration"/> + <stringProp name="ThreadGroup.delay"/> + <stringProp name="TestPlan.comments">tool/fragments/_system/thread_group.jmx</stringProp></ThreadGroup> + <hashTree> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Import Products" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${importProductsPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Import Products"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query">vars.put("entity", "catalog_product"); +String behavior = "${adminImportProductBehavior}"; +vars.put("adminImportBehavior", behavior); +String filepath = "${files_folder}${adminImportProductFilePath}"; +vars.put("adminImportFilePath", filepath); </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/import_products/setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1723813687">Import Settings</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="entity" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${entity}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">entity</stringProp> + </elementProp> + <elementProp name="behavior" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${adminImportBehavior}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">behavior</stringProp> + </elementProp> + <elementProp name="validation_strategy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">validation-stop-on-errors</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">validation_strategy</stringProp> + </elementProp> + <elementProp name="allowed_error_count" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">allowed_error_count</stringProp> + </elementProp> + <elementProp name="_import_field_separator" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">,</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_import_field_separator</stringProp> + </elementProp> + <elementProp name="_import_multiple_value_separator" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">,</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_import_multiple_value_separator</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/validate</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> + <collectionProp name="HTTPFileArgs.files"> + <elementProp name="${adminImportFilePath}" elementType="HTTPFileArg"> + <stringProp name="File.path">${adminImportFilePath}</stringProp> + <stringProp name="File.paramname">import_file</stringProp> + <stringProp name="File.mimetype">application/vnd.ms-excel</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_validate.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="37280142">File is valid! To start import process</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="entity" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${entity}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">entity</stringProp> + </elementProp> + <elementProp name="behavior" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${adminImportBehavior}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">behavior</stringProp> + </elementProp> + <elementProp name="validation_strategy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">validation-stop-on-errors</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">validation_strategy</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="allowed_error_count" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">allowed_error_count</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="_import_field_separator" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">,</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_import_field_separator</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="_import_multiple_value_separator" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">,</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_import_multiple_value_separator</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/start</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> + <collectionProp name="HTTPFileArgs.files"> + <elementProp name="${adminImportFilePath}" elementType="HTTPFileArg"> + <stringProp name="File.path">${adminImportFilePath}</stringProp> + <stringProp name="File.paramname">import_file</stringProp> + <stringProp name="File.mimetype">application/vnd.ms-excel</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_save.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1731221824">Import successfully done</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Import Customers" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${importCustomersPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Import Customers"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <hashTree/> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> + <hashTree/> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query">vars.put("entity", "customer"); +String behavior = "${adminImportCustomerBehavior}"; +vars.put("adminImportBehavior", behavior); +String filepath = "${files_folder}${adminImportCustomerFilePath}"; +vars.put("adminImportFilePath", filepath); </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/import_customers/setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert success" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1723813687">Import Settings</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="entity" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${entity}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">entity</stringProp> + </elementProp> + <elementProp name="behavior" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${adminImportBehavior}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">behavior</stringProp> + </elementProp> + <elementProp name="validation_strategy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">validation-stop-on-errors</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">validation_strategy</stringProp> + </elementProp> + <elementProp name="allowed_error_count" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">allowed_error_count</stringProp> + </elementProp> + <elementProp name="_import_field_separator" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">,</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_import_field_separator</stringProp> + </elementProp> + <elementProp name="_import_multiple_value_separator" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">,</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_import_multiple_value_separator</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/validate</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> + <collectionProp name="HTTPFileArgs.files"> + <elementProp name="${adminImportFilePath}" elementType="HTTPFileArg"> + <stringProp name="File.path">${adminImportFilePath}</stringProp> + <stringProp name="File.paramname">import_file</stringProp> + <stringProp name="File.mimetype">application/vnd.ms-excel</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_validate.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="37280142">File is valid! To start import process</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Import Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="entity" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${entity}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">entity</stringProp> + </elementProp> + <elementProp name="behavior" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${adminImportBehavior}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">behavior</stringProp> + </elementProp> + <elementProp name="validation_strategy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">validation-stop-on-errors</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">validation_strategy</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="allowed_error_count" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">allowed_error_count</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="_import_field_separator" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">,</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_import_field_separator</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="_import_multiple_value_separator" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">,</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_import_multiple_value_separator</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/import/start</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <elementProp name="HTTPsampler.Files" elementType="HTTPFileArgs"> + <collectionProp name="HTTPFileArgs.files"> + <elementProp name="${adminImportFilePath}" elementType="HTTPFileArg"> + <stringProp name="File.path">${adminImportFilePath}</stringProp> + <stringProp name="File.paramname">import_file</stringProp> + <stringProp name="File.mimetype">application/vnd.ms-excel</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/import_save.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1731221824">Import successfully done</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> - 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); - }</stringProp> - </BeanShellPreProcessor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-583471546">You saved the product</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - <stringProp name="TestPlan.comments"> if have trouble see messages-message-error </stringProp> - </ResponseAssertion> + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="API" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${apiSinglePercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - </hashTree> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "API"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> </hashTree> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> <hashTree/> - </hashTree> - </hashTree> - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Returns Management" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="API Process Orders" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cAdminReturnsManagementPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">100</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -64192,191 +109792,62 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin Returns Management"); + vars.put("testLabel", "API Process Orders"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> <hashTree/> - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> - <hashTree/> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - } - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PreProcessor> - <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"/> - <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> - <hashTree/> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> - <hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -adminUser = "none"; -adminUserList = props.get("adminUserList"); -adminUserListIterator = props.get("adminUserListIterator"); -adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query">// Each thread gets an equal number of orders, based on how many orders are available. -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } + int ordersPerThread = 1; + int apiProcessOrders = Integer.parseInt("${apiProcessOrders}"); + if (apiProcessOrders > 0) { + ordersPerThread = apiProcessOrders; + } - adminUser = adminUserListIterator.next(); -} + threadNum = ${__threadNum}; + vars.put("ordersPerThread", String.valueOf(ordersPerThread)); + vars.put("threadNum", String.valueOf(threadNum)); -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); </stringProp> <stringProp name="BeanShellSampler.filename"/> <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/setup.jmx</stringProp></BeanShellSampler> <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1397214398">Welcome</stringProp> - <stringProp name="-515240035"><title>Magento Admin</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_form_key</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Orders" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="dummy" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filterGroups][0][filters][0][field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">status</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][field]</stringProp> </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> + <elementProp name="searchCriteria[filterGroups][0][filters][0][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.value">Pending</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][value]</stringProp> </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> + <elementProp name="searchCriteria[pageSize]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.value">${ordersPerThread}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> + <stringProp name="Argument.name">searchCriteria[pageSize]</stringProp> </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> + <elementProp name="searchCriteria[current_page]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.value">${threadNum}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> + <stringProp name="Argument.name">searchCriteria[current_page]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -64386,644 +109857,335 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/orders</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> - </HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/get_orders.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> - <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract entity ids" enabled="true"> + <stringProp name="VAR">entity_ids</stringProp> + <stringProp name="JSONPATH">$.items[*].entity_id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> </hashTree> - </hashTree> - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> + <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Order" enabled="true"> + <stringProp name="ForeachController.inputVal">entity_ids</stringProp> + <stringProp name="ForeachController.returnVal">order_id</stringProp> + <boolProp name="ForeachController.useSeparator">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/for_each_order.jmx</stringProp></ForeachController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Invoice" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/order/${order_id}/invoice</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/create_invoice.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1204796042">Create New Order</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Orders" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">sales_order_grid</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - </elementProp> - <elementProp name="search" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">200</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">increment_id</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">desc</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="filters[status]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">pending</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[status]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1637639774">totalRecords</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Pending Orders" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">sales_order_grid</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="search" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">200</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">increment_id</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">asc</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="filters[status]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">pending</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[status]</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> -<hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1637639774">totalRecords</stringProp> + <stringProp name="34237953">"\d+"</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order numbers" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_numbers</stringProp> - <stringProp name="RegexExtractor.regex">\"increment_id\":\"(\d+)\"\,</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order ids" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_ids</stringProp> - <stringProp name="RegexExtractor.regex">\"entity_id\":\"(\d+)\"\,</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Shipment" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/order/${order_id}/ship</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/process_orders/create_shipment.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="34237953">"\d+"</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> </hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> - import java.util.ArrayList; - import java.util.HashMap; - 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); - - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - </BeanShellSampler> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Order" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/view/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2103620713">#${order_number}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order status" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_status</stringProp> - <stringProp name="RegexExtractor.regex"><span id="order_status">([^<]+)</span></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> - <hashTree/> </hashTree> - - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> - <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1233850814">Invoice Totals</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract ordered items ids" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">item_ids</stringProp> - <stringProp name="RegexExtractor.regex"><div id="order_item_(\d+)_title"\s*class="product-title"></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> - <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Submit" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="invoice[items][${item_ids_1}]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">invoice[items][${item_ids_1}]</stringProp> - </elementProp> - <elementProp name="invoice[items][${item_ids_2}]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">invoice[items][${item_ids_2}]</stringProp> - </elementProp> - <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Invoiced</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">invoice[comment_text]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1740524604">The invoice has been created</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="API Product Attribute Management" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">100</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Credit Memo Start" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_creditmemo/start/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1382627322">New Memo</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Credit Memo Submit - Full Refund" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="creditmemo[items][${item_ids_1}][qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">creditmemo[items][${item_ids_1}][qty]</stringProp> - </elementProp> - <elementProp name="creditmemo[items][${item_ids_2}][qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">creditmemo[items][${item_ids_2}][qty]</stringProp> - </elementProp> - <elementProp name="creditmemo[do_offline]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">creditmemo[do_offline]</stringProp> - </elementProp> - <elementProp name="creditmemo[comment_text]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Credit Memo added</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">creditmemo[comment_text]</stringProp> - </elementProp> - <elementProp name="creditmemo[shipping_amount]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">10</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">creditmemo[shipping_amount]</stringProp> - </elementProp> - <elementProp name="creditmemo[adjustment_positive]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">creditmemo[adjustment_positive]</stringProp> - </elementProp> - <elementProp name="creditmemo[adjustment_negative]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">creditmemo[adjustment_negative]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_creditmemo/save/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> + <hashTree/> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "API Product Attribute Management"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create attribute set" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "attributeSet": { + "attribute_set_name": "new_attribute_set_${__time()}-${__threadNum}-${__Random(1,1000000)}", + "sort_order": 500 + }, + "skeletonId": "4" +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attribute-sets/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_attribute_set.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute_set_id" enabled="true"> + <stringProp name="VAR">attribute_set_id</stringProp> + <stringProp name="JSONPATH">$.attribute_set_id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert attribute_set_id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">attribute_set_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create attribute group" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "group": { + "attribute_group_name": "empty_attribute_group_${__time()}-${__threadNum}-${__Random(1,1000000)}", + "attribute_set_id": ${attribute_set_id} + } +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attribute-sets/groups</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_attribute_group.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute_group_id" enabled="true"> + <stringProp name="VAR">attribute_group_id</stringProp> + <stringProp name="JSONPATH">$.attribute_group_id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert attribute_group_id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">attribute_set_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create attribute" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "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 + } +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_attribute.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute_id" enabled="true"> + <stringProp name="VAR">attribute_id</stringProp> + <stringProp name="JSONPATH">$.attribute_id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract attribute_code" enabled="true"> + <stringProp name="VAR">attribute_code</stringProp> + <stringProp name="JSONPATH">$.attribute_code</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert attribute_id not null" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-515117447">You created the credit memo</stringProp> + <stringProp name="89649215">^\d+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">attribute_id</stringProp> </ResponseAssertion> - <hashTree/> - </hashTree> - - <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Create/Process Returns - Pause" enabled="true"> - <intProp name="ActionProcessor.action">1</intProp> - <intProp name="ActionProcessor.target">0</intProp> - <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/pause.jmx</stringProp></TestAction> - <hashTree/> - </hashTree> - </hashTree> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert attribute_code not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2131456825">^[a-z0-9-_]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">attribute_code</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add attribute to attribute set" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "attributeSetId": "${attribute_set_id}", + "attributeGroupId": "${attribute_group_id}", + "attributeCode": "${attribute_code}", + "sortOrder": 3 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -65031,39 +110193,35 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attribute-sets/attributes</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/add_attribute_to_attribute_set.jmx</stringProp></HTTPSamplerProxy> <hashTree> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert response is not null" enabled="true"> + <stringProp name="JSON_PATH">$</stringProp> + <stringProp name="EXPECTED_VALUE">(\d+)</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> </hashTree> + </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Browse Customer Grid" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Admin Category Management" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cAdminBrowseCustomerGridPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${adminCategoryManagementPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -65089,7 +110247,7 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin Browse Customer Grid"); + vars.put("testLabel", "Admin Category Management"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> @@ -65252,397 +110410,28 @@ vars.put("admin_user", adminUser); <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> - <hashTree/> - </hashTree> - </hashTree> - - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="script"> - 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"); - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_browse_customers_grid/setup.jmx</stringProp></JSR223PostProcessor> - <hashTree/> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Pages Count" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_namespace}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="search" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">entity_id</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">asc</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> - <stringProp name="JSON_PATH">$.totalRecords</stringProp> - <stringProp name="EXPECTED_VALUE">0</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">true</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> - <stringProp name="VAR">entity_total_records</stringProp> - <stringProp name="JSONPATH">$.totalRecords</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} pages count" enabled="true"> - <stringProp name="cacheKey"/> - <stringProp name="filename"/> - <stringProp name="parameters"/> - <stringProp name="script"> - 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); - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PostProcessor> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Set ${gridEntityType} Filtered Pages Count" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_namespace}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="search" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">entity_id</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">asc</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert total records is not 0" enabled="true"> - <stringProp name="JSON_PATH">$.totalRecords</stringProp> - <stringProp name="EXPECTED_VALUE">0</stringProp> - <boolProp name="JSONVALIDATION">true</boolProp> - <boolProp name="EXPECT_NULL">false</boolProp> - <boolProp name="INVERT">true</boolProp> - <boolProp name="ISREGEX">true</boolProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total records" enabled="true"> - <stringProp name="VAR">entity_total_records</stringProp> - <stringProp name="JSONPATH">$.totalRecords</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="SetUp - Calculate ${gridEntityType} filtered pages count" enabled="true"> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - 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); - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PostProcessor> - <hashTree/> - </hashTree> - - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select ${gridEntityType} Page Number" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end">${grid_pages_count}</stringProp> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">page_number</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">true</boolProp> - <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_page_number.jmx</stringProp></CounterConfig> - <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_namespace}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="search" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${page_number}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">dummy</stringProp> </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> + <elementProp name="form_key" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">form_key</stringProp> </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <elementProp name="login[password]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.value">${admin_password}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">login[password]</stringProp> </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> + <elementProp name="login[username]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.value">${admin_user}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> @@ -65652,155 +110441,791 @@ vars.put("grid_pages_count_filtered", pageCount); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Category Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_category_management/admin_category_management.jmx</stringProp> +</TestFragmentController> + <hashTree> + <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script">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));</stringProp> + </JSR223Sampler> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select parent category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${parent_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open new category page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/add/store/0/parent/${parent_category_id}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1903925024"><title>New Category</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> + </elementProp> + <elementProp name="parent" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">parent</stringProp> + </elementProp> + <elementProp name="path" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">path</stringProp> + </elementProp> + <elementProp name="store_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_id</stringProp> + </elementProp> + <elementProp name="is_active" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_active</stringProp> + </elementProp> + <elementProp name="include_in_menu" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">include_in_menu</stringProp> + </elementProp> + <elementProp name="is_anchor" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_anchor</stringProp> + </elementProp> + <elementProp name="use_config[available_sort_by]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[available_sort_by]</stringProp> + </elementProp> + <elementProp name="use_config[default_sort_by]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[default_sort_by]</stringProp> + </elementProp> + <elementProp name="use_config[filter_price_range]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_config[filter_price_range]</stringProp> + </elementProp> + <elementProp name="use_default[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_default[url_key]</stringProp> + </elementProp> + <elementProp name="url_key_create_redirect" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">url_key_create_redirect</stringProp> + </elementProp> + <elementProp name="custom_use_parent_settings" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_use_parent_settings</stringProp> + </elementProp> + <elementProp name="custom_apply_to_products" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_apply_to_products</stringProp> + </elementProp> + <elementProp name="name" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Admin Category Management ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">name</stringProp> + </elementProp> + <elementProp name="url_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">admin-category-management-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">url_key</stringProp> + </elementProp> + <elementProp name="meta_title" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_title</stringProp> + </elementProp> + <elementProp name="description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">description</stringProp> + </elementProp> + <elementProp name="display_mode" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">PRODUCTS</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">display_mode</stringProp> + </elementProp> + <elementProp name="default_sort_by" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">position</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">default_sort_by</stringProp> + </elementProp> + <elementProp name="meta_keywords" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_keywords</stringProp> + </elementProp> + <elementProp name="meta_description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_description</stringProp> + </elementProp> + <elementProp name="custom_layout_update" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">custom_layout_update</stringProp> + </elementProp> + <elementProp name="category_products" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"${simple_product_1_id}":"","${simple_product_2_id}":"","${simple_product_3_id}":"","${simple_product_4_id}":"","${simple_product_5_id}":""}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">category_products</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">URL</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_id</stringProp> + <stringProp name="RegexExtractor.regex">/catalog/category/edit/id/(\d+)/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select created category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${admin_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category row id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category attribute set id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_attribute_set_id</stringProp> + <stringProp name="RegexExtractor.regex">"attribute_set_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category parent Id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_parent_id</stringProp> + <stringProp name="RegexExtractor.regex">"parent_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category created at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_created_at</stringProp> + <stringProp name="RegexExtractor.regex">"created_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category updated at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_updated_at</stringProp> + <stringProp name="RegexExtractor.regex">"updated_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category path" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_path</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":(.+)"path":"([^\"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category level" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_level</stringProp> + <stringProp name="RegexExtractor.regex">"level":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category name" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_name</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":(.+)"name":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_url_key</stringProp> + <stringProp name="RegexExtractor.regex">"url_key":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url path" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_category_url_path</stringProp> + <stringProp name="RegexExtractor.regex">"url_path":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category row id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_entity_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category attribute set id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_attribute_set_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category parent id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_parent_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category created at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_created_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category updated at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_updated_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category path" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="59022110">^[\d\\\/]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_path</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category level" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_level</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category name" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_name</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url key" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_url_key</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url path" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_category_url_path</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert products added" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="417284990">${simple_product_1_name}</stringProp> + <stringProp name="1304788671">${simple_product_2_name}</stringProp> + <stringProp name="-2102674944">${simple_product_3_name}</stringProp> + <stringProp name="-1215171263">${simple_product_4_name}</stringProp> + <stringProp name="-327667582">${simple_product_5_name}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Move category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="point" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">append</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">point</stringProp> + </elementProp> + <elementProp name="pid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${new_parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">pid</stringProp> + </elementProp> + <elementProp name="paid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${parent_category_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paid</stringProp> + </elementProp> + <elementProp name="aid" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">aid</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/move/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> <hashTree/> - </hashTree> - - <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="SetUp - Select Filtered ${gridEntityType} Page Number" enabled="true"> - <stringProp name="CounterConfig.start">1</stringProp> - <stringProp name="CounterConfig.end">${grid_pages_count_filtered}</stringProp> - <stringProp name="CounterConfig.incr">1</stringProp> - <stringProp name="CounterConfig.name">page_number</stringProp> - <stringProp name="CounterConfig.format"/> - <boolProp name="CounterConfig.per_user">true</boolProp> - <boolProp name="CounterConfig.reset_on_tg_iteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx</stringProp></CounterConfig> - <hashTree/> - - <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="View ${gridEntityType} page - Filtering + Sorting" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx</stringProp> -</TestFragmentController> - <hashTree> - <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Field Defined" enabled="true"> - <stringProp name="ForeachController.inputVal">grid_sort_field</stringProp> - <stringProp name="ForeachController.returnVal">grid_sort_field</stringProp> - <boolProp name="ForeachController.useSeparator">true</boolProp> - <stringProp name="ForeachController.startIndex">0</stringProp> - <stringProp name="ForeachController.endIndex">3</stringProp> - </ForeachController> - <hashTree> - <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="ForEach Sort Order Defined" enabled="true"> - <stringProp name="ForeachController.inputVal">grid_sort_order</stringProp> - <stringProp name="ForeachController.returnVal">grid_sort_order</stringProp> - <boolProp name="ForeachController.useSeparator">true</boolProp> - <stringProp name="ForeachController.startIndex">0</stringProp> - <stringProp name="ForeachController.endIndex">2</stringProp> - </ForeachController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="View ${gridEntityType} page - Filtering + Sort By ${grid_sort_field} ${grid_sort_order}" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_namespace}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="filters[${grid_filter_field}]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_admin_browse_filter_text}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[${grid_filter_field}]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_entity_page_size}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${page_number}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_sort_field}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${grid_sort_order}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - </collectionProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete category" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1637639774">\"totalRecords\":[^0]\d*</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - </hashTree> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/delete/id/${admin_category_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category deleted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1277069529">You deleted the category.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCategoryManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> </hashTree> </hashTree> @@ -65842,11 +111267,11 @@ vars.put("grid_pages_count_filtered", pageCount); </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Create Order" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Admin Promotion Rules" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cAdminCreateOrderPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${adminPromotionRulesPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -65872,7 +111297,7 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin Create Order"); + vars.put("testLabel", "Admin Promotion Rules"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> @@ -66094,80 +111519,11 @@ vars.put("admin_user", adminUser); <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Get region data" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script"> - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); -</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/get_region_data.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - - <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Order" enabled="true"/> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Promotions Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx</stringProp> +</TestFragmentController> <hashTree> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_order/admin_create_order.jmx</stringProp> - <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; -import java.util.Random; -Random random = new Random(); - -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); -}</stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Start Order" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"/> </elementProp> @@ -66177,7 +111533,7 @@ catch (java.lang.Exception e) { <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/start/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -66185,206 +111541,11 @@ catch (java.lang.Exception e) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> </HTTPSamplerProxy> <hashTree/> - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Get Configurable Product Options" enabled="true"/> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">*/*</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> - <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> - <collectionProp name="Arguments.arguments"> - <elementProp name="" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> - <stringProp name="VAR">admin_token</stringProp> - <stringProp name="JSONPATH">$</stringProp> - <stringProp name="DEFAULT"/> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="484395188">^[a-z0-9-]+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_token</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Authorization</stringProp> - <stringProp name="Header.value">Bearer ${admin_token}</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get Configurable Product Options" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}rest/V1/configurable-products/${configurable_product_1_sku}/options/all</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract attribute_ids" enabled="true"> - <stringProp name="VAR">attribute_ids</stringProp> - <stringProp name="JSONPATH">$.[*].attribute_id</stringProp> - <stringProp name="DEFAULT">NO_VALUE</stringProp> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="JSON Path Extractor: Extract option_values" enabled="true"> - <stringProp name="VAR">option_values</stringProp> - <stringProp name="JSONPATH">$.[*].values[0].value_index</stringProp> - <stringProp name="DEFAULT">NO_VALUE</stringProp> - <stringProp name="VARIABLE"/> - <stringProp name="SUBJECT">BODY</stringProp> - </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> - <hashTree/> - </hashTree> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Products" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="item[${simple_product_1_id}][qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">item[${simple_product_1_id}][qty]</stringProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="item[${simple_product_2_id}][qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">item[${simple_product_2_id}][qty]</stringProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="item[${configurable_product_1_id}][qty]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">item[${configurable_product_1_id}][qty]</stringProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="customer_id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">customer_id</stringProp> - <stringProp name="Argument.value">${customer_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="store_id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">store_id</stringProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="currency_id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">currency_id</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="payment[method]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">payment[method]</stringProp> - <stringProp name="Argument.value">checkmo</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="reset_shipping" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">reset_shipping</stringProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="json" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">json</stringProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="as_js_varname" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">as_js_varname</stringProp> - <stringProp name="Argument.value">iFrameResponse</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - </collectionProp> + <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> @@ -66392,97 +111553,47 @@ catch (java.lang.Exception e) { <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/loadBlock/block/search,items,shipping_method,totals,giftmessage,billing_method?isAjax=true</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/new</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> </HTTPSamplerProxy> - <hashTree> - <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Configure product options" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script">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); -}</stringProp> - </BeanShellPreProcessor> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Collect Shipping Rates" enabled="true"> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New Conditional" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="collect_shipping_rates" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">collect_shipping_rates</stringProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="customer_id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">customer_id</stringProp> - <stringProp name="Argument.value">${customer_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="store_id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">store_id</stringProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="currency_id" elementType="HTTPArgument"> + <elementProp name="isAjax" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">currency_id</stringProp> - <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> </elementProp> <elementProp name="form_key" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> <stringProp name="Argument.value">${admin_form_key}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">true</stringProp> </elementProp> - <elementProp name="payment[method]" elementType="HTTPArgument"> + <elementProp name="id" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">payment[method]</stringProp> - <stringProp name="Argument.value">checkmo</stringProp> + <stringProp name="Argument.value">1--1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">id</stringProp> </elementProp> - <elementProp name="json" elementType="HTTPArgument"> + <elementProp name="type" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">json</stringProp> - <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">type</stringProp> </elementProp> </collectionProp> </elementProp> @@ -66492,7 +111603,7 @@ catch (java.lang.Exception e) { <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/loadBlock/block/shipping_method,totals?isAjax=true</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/newConditionHtml/form/sales_rule_formrule_conditions_fieldset_/form_namespace/sales_rule_form</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -66501,603 +111612,275 @@ catch (java.lang.Exception e) { <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Shipping Method" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1987784558">shipping_method</stringProp> - <stringProp name="818779431">Flat Rate</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Filled Order Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/index/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Filled Order Page" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-37823069">Select from existing customer addresses</stringProp> - <stringProp name="-13185722">Submit Order</stringProp> - <stringProp name="-209419315">Items Ordered</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Order" enabled="true"> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="limit" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">limit</stringProp> - <stringProp name="Argument.value">20</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="entity_id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">entity_id</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> <elementProp name="name" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">name</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="email" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">email</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="Telephone" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">Telephone</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="billing_postcode" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">billing_postcode</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="billing_country_id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">billing_country_id</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="billing_regione" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">billing_regione</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="store_name" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">store_name</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="page" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">page</stringProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="order[currency]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[currency]</stringProp> - <stringProp name="Argument.value">USD</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="sku" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">sku</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="qty" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">qty</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="limit" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">limit</stringProp> - <stringProp name="Argument.value">20</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="entity_id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">entity_id</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">Rule Name ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="name" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.name">name</stringProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> </elementProp> - <elementProp name="sku" elementType="HTTPArgument"> + <elementProp name="is_active" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">sku</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">0</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_active</stringProp> </elementProp> - <elementProp name="price[from]" elementType="HTTPArgument"> + <elementProp name="use_auto_generation" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">price[from]</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">0</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">use_auto_generation</stringProp> </elementProp> - <elementProp name="price[to]" elementType="HTTPArgument"> + <elementProp name="is_rss" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">price[to]</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_rss</stringProp> </elementProp> - <elementProp name="in_products" elementType="HTTPArgument"> + <elementProp name="apply_to_shipping" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">in_products</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">0</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">apply_to_shipping</stringProp> </elementProp> - <elementProp name="page" elementType="HTTPArgument"> + <elementProp name="stop_rules_processing" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">page</stringProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">0</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">stop_rules_processing</stringProp> </elementProp> <elementProp name="coupon_code" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">coupon_code</stringProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">coupon_code</stringProp> </elementProp> - <elementProp name="order[account][group_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[account][group_id]</stringProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="order[account][email]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[account][email]</stringProp> - <stringProp name="Argument.value">user_${customer_id}@example.com</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="order[billing_address][customer_address_id]" elementType="HTTPArgument"> + <elementProp name="uses_per_coupon" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][customer_address_id]</stringProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">uses_per_coupon</stringProp> </elementProp> - <elementProp name="order[billing_address][prefix]" elementType="HTTPArgument"> + <elementProp name="uses_per_customer" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][prefix]</stringProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">uses_per_customer</stringProp> </elementProp> - <elementProp name="order[billing_address][firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][firstname]</stringProp> - <stringProp name="Argument.value">Anthony</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="order[billing_address][middlename]" elementType="HTTPArgument"> + <elementProp name="sort_order" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][middlename]</stringProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sort_order</stringProp> </elementProp> - <elementProp name="order[billing_address][lastname]" elementType="HTTPArgument"> + <elementProp name="discount_amount" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][lastname]</stringProp> - <stringProp name="Argument.value">Nealy</stringProp> + <stringProp name="Argument.value">5</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">discount_amount</stringProp> </elementProp> - <elementProp name="order[billing_address][suffix]" elementType="HTTPArgument"> + <elementProp name="discount_qty" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][suffix]</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">0</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">discount_qty</stringProp> </elementProp> - <elementProp name="order[billing_address][company]" elementType="HTTPArgument"> + <elementProp name="discount_step" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][company]</stringProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">discount_step</stringProp> </elementProp> - <elementProp name="order[billing_address][street][0]" elementType="HTTPArgument"> + <elementProp name="reward_points_delta" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][street][0]</stringProp> - <stringProp name="Argument.value">123 Freedom Blvd. #123</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">reward_points_delta</stringProp> </elementProp> - <elementProp name="order[billing_address][street][1]" elementType="HTTPArgument"> + <elementProp name="store_labels[0]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][street][1]</stringProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[0]</stringProp> </elementProp> - <elementProp name="order[billing_address][city]" elementType="HTTPArgument"> + <elementProp name="description" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][city]</stringProp> - <stringProp name="Argument.value">Fayetteville</stringProp> + <stringProp name="Argument.value">Rule Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">description</stringProp> </elementProp> - <elementProp name="order[billing_address][country_id]" elementType="HTTPArgument"> + <elementProp name="coupon_type" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][country_id]</stringProp> - <stringProp name="Argument.value">US</stringProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">coupon_type</stringProp> </elementProp> - <elementProp name="order[billing_address][region]" elementType="HTTPArgument"> + <elementProp name="simple_action" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][region]</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">cart_fixed</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">simple_action</stringProp> </elementProp> - <elementProp name="order[billing_address][region_id]" elementType="HTTPArgument"> + <elementProp name="website_ids[0]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][region_id]</stringProp> - <stringProp name="Argument.value">${alabama_region_id}</stringProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">website_ids[0]</stringProp> </elementProp> - <elementProp name="order[billing_address][postcode]" elementType="HTTPArgument"> + <elementProp name="customer_group_ids[0]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][postcode]</stringProp> - <stringProp name="Argument.value">123123</stringProp> + <stringProp name="Argument.value">0</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer_group_ids[0]</stringProp> </elementProp> - <elementProp name="order[billing_address][telephone]" elementType="HTTPArgument"> + <elementProp name="from_date" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][telephone]</stringProp> - <stringProp name="Argument.value">022-333-4455</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">from_date</stringProp> </elementProp> - <elementProp name="order[billing_address][fax]" elementType="HTTPArgument"> + <elementProp name="to_date" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][fax]</stringProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">to_date</stringProp> </elementProp> - <elementProp name="order[billing_address][vat_id]" elementType="HTTPArgument"> + <elementProp name="rule[conditions][1][type]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[billing_address][vat_id]</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Combine</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][type]</stringProp> </elementProp> - <elementProp name="shipping_same_as_billing" elementType="HTTPArgument"> + <elementProp name="rule[conditions][1][aggregator]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">shipping_same_as_billing</stringProp> - <stringProp name="Argument.value">on</stringProp> + <stringProp name="Argument.value">all</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][aggregator]</stringProp> </elementProp> - <elementProp name="payment[method]" elementType="HTTPArgument"> + <elementProp name="rule[conditions][1][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">payment[method]</stringProp> - <stringProp name="Argument.value">checkmo</stringProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][value]</stringProp> </elementProp> - <elementProp name="order[shipping_method]" elementType="HTTPArgument"> + <elementProp name="rule[conditions][1--1][type]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[shipping_method]</stringProp> - <stringProp name="Argument.value">flatrate_flatrate</stringProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][type]</stringProp> </elementProp> - <elementProp name="order[comment][customer_note]" elementType="HTTPArgument"> + <elementProp name="rule[conditions][1--1][attribute]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[comment][customer_note]</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">base_subtotal</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][attribute]</stringProp> </elementProp> - <elementProp name="order[comment][customer_note_notify]" elementType="HTTPArgument"> + <elementProp name="rule[conditions][1--1][operator]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[comment][customer_note_notify]</stringProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">>=</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][operator]</stringProp> </elementProp> - <elementProp name="order[send_confirmation]" elementType="HTTPArgument"> + <elementProp name="rule[conditions][1--1][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">order[send_confirmation]</stringProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">100</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1--1][value]</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_create/save/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> - </HTTPSamplerProxy> - <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_id</stringProp> - <stringProp name="RegexExtractor.regex">${host}${base_path}${admin_path}/sales/order/index/order_id/(\d+)/</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 1" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_item_1</stringProp> - <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 2" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_item_2</stringProp> - <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">2</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract Order Item 3" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_item_3</stringProp> - <stringProp name="RegexExtractor.regex">order_item_(\d+)_title</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">3</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">order_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 1" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">order_item_1</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 2" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">order_item_2</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Item 3" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">order_item_3</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Order Created" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="563107624">You created the order.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Invoice" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> + <elementProp name="rule[conditions][1][new_chlid]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[conditions][1][new_chlid]</stringProp> </elementProp> - <elementProp name="invoice[items][${order_item_1}]" elementType="HTTPArgument"> + <elementProp name="rule[actions][1][type]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">invoice[items][${order_item_1}]</stringProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Product\Combine</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][type]</stringProp> </elementProp> - <elementProp name="invoice[items][${order_item_2}]" elementType="HTTPArgument"> + <elementProp name="rule[actions][1][aggregator]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">invoice[items][${order_item_2}]</stringProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">all</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][aggregator]</stringProp> </elementProp> - <elementProp name="invoice[items][${order_item_3}]" elementType="HTTPArgument"> + <elementProp name="rule[actions][1][value]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">invoice[items][${order_item_3}]</stringProp> <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][value]</stringProp> </elementProp> - <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> + <elementProp name="rule[actions][1][new_child]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">invoice[comment_text]</stringProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">rule[actions][1][new_child]</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Invoice Created" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1878312078">The invoice has been created.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save Shipment" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - </elementProp> - <elementProp name="shipment[items][${order_item_1}]" elementType="HTTPArgument"> + <elementProp name="store_labels[1]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">shipment[items][${order_item_1}]</stringProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[1]</stringProp> </elementProp> - <elementProp name="shipment[items][${order_item_2}]" elementType="HTTPArgument"> + <elementProp name="store_labels[2]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">shipment[items][${order_item_2}]</stringProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_labels[2]</stringProp> </elementProp> - <elementProp name="shipment[items][${order_item_3}]" elementType="HTTPArgument"> + <elementProp name="related_banners" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">shipment[items][${order_item_3}]</stringProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">related_banners</stringProp> </elementProp> - <elementProp name="shipment[comment_text]" elementType="HTTPArgument"> + <elementProp name="form_key" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.name">shipment[comment_text]</stringProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_form_key}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> </elementProp> </collectionProp> </elementProp> @@ -67107,7 +111890,7 @@ catch (java.lang.Exception e) { <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/save/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -67115,19 +111898,24 @@ catch (java.lang.Exception e) { <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Shipment Created" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-348539683">The shipment has been created.</stringProp> + <stringProp name="-396438583">You saved the rule.</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">16</intProp> </ResponseAssertion> <hashTree/> </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminPromotionsManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> </hashTree> </hashTree> @@ -67169,11 +111957,11 @@ catch (java.lang.Exception e) { </hashTree> - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Category Management" enabled="true"> + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Admin Customer Management" enabled="true"> <intProp name="ThroughputController.style">1</intProp> <boolProp name="ThroughputController.perThread">false</boolProp> <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cAdminCategoryManagementPercentage}</stringProp> + <stringProp name="ThroughputController.percentThroughput">${adminCustomerManagementPercentage}</stringProp> <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> <hashTree> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> @@ -67199,7 +111987,7 @@ if (tmpLabel) { <hashTree/> <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin Category Management"); + vars.put("testLabel", "Admin Customer Management"); </stringProp> <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> </BeanShellSampler> @@ -67421,54 +112209,10 @@ vars.put("admin_user", adminUser); <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> </GenericController> <hashTree> - <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Category Management" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_category_management/admin_category_management.jmx</stringProp> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Customer Management" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_customer_management/admin_customer_management.jmx</stringProp> </TestFragmentController> <hashTree> - <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="SetUp - Set Arguments" enabled="true"> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="cacheKey"/> - <stringProp name="script">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));</stringProp> - </JSR223Sampler> - <hashTree/> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"/> @@ -67479,58 +112223,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="Accept-Language" elementType="Header"> - <stringProp name="Header.name">Accept-Language</stringProp> - <stringProp name="Header.value">en-US,en;q=0.5</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> - </elementProp> - <elementProp name="User-Agent" elementType="Header"> - <stringProp name="Header.name">User-Agent</stringProp> - <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> - </elementProp> - <elementProp name="Accept-Encoding" elementType="Header"> - <stringProp name="Header.name">Accept-Encoding</stringProp> - <stringProp name="Header.value">gzip, deflate</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select parent category" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${parent_category_id}/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -67559,216 +112252,154 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <stringProp name="Header.value">gzip, deflate</stringProp> </elementProp> </collectionProp> - </HeaderManager> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open new category page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/add/store/0/parent/${parent_category_id}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1903925024"><title>New Category</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create category" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">id</stringProp> - </elementProp> - <elementProp name="parent" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${parent_category_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">parent</stringProp> - </elementProp> - <elementProp name="path" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">path</stringProp> - </elementProp> - <elementProp name="store_id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">store_id</stringProp> - </elementProp> - <elementProp name="is_active" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">is_active</stringProp> - </elementProp> - <elementProp name="include_in_menu" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">include_in_menu</stringProp> - </elementProp> - <elementProp name="is_anchor" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">is_anchor</stringProp> - </elementProp> - <elementProp name="use_config[available_sort_by]" elementType="HTTPArgument"> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Render" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.value">customer_listing</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">use_config[available_sort_by]</stringProp> + <stringProp name="Argument.name">namespace</stringProp> </elementProp> - <elementProp name="use_config[default_sort_by]" elementType="HTTPArgument"> + <elementProp name="search" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">use_config[default_sort_by]</stringProp> + <stringProp name="Argument.name">search</stringProp> </elementProp> - <elementProp name="use_config[filter_price_range]" elementType="HTTPArgument"> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">use_config[filter_price_range]</stringProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> </elementProp> - <elementProp name="use_default[url_key]" elementType="HTTPArgument"> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.value">20</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">use_default[url_key]</stringProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> </elementProp> - <elementProp name="url_key_create_redirect" elementType="HTTPArgument"> + <elementProp name="paging[current]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">url_key_create_redirect</stringProp> + <stringProp name="Argument.name">paging[current]</stringProp> </elementProp> - <elementProp name="custom_use_parent_settings" elementType="HTTPArgument"> + <elementProp name="sorting[field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">entity_id</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">custom_use_parent_settings</stringProp> + <stringProp name="Argument.name">sorting[field]</stringProp> </elementProp> - <elementProp name="custom_apply_to_products" elementType="HTTPArgument"> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">asc</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">custom_apply_to_products</stringProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> </elementProp> - <elementProp name="name" elementType="HTTPArgument"> + <elementProp name="isAjax" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Admin Category Management ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">name</stringProp> + <stringProp name="Argument.name">isAjax</stringProp> </elementProp> - <elementProp name="url_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">admin-category-management-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">url_key</stringProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> </elementProp> - <elementProp name="meta_title" elementType="HTTPArgument"> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Render" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">customer_listing</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">meta_title</stringProp> + <stringProp name="Argument.name">namespace</stringProp> </elementProp> - <elementProp name="description" elementType="HTTPArgument"> + <elementProp name="search" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">Lastname</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">description</stringProp> + <stringProp name="Argument.name">search</stringProp> </elementProp> - <elementProp name="display_mode" elementType="HTTPArgument"> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">PRODUCTS</stringProp> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">display_mode</stringProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> </elementProp> - <elementProp name="default_sort_by" elementType="HTTPArgument"> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">position</stringProp> + <stringProp name="Argument.value">20</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">default_sort_by</stringProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> </elementProp> - <elementProp name="meta_keywords" elementType="HTTPArgument"> + <elementProp name="paging[current]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">meta_keywords</stringProp> + <stringProp name="Argument.name">paging[current]</stringProp> </elementProp> - <elementProp name="meta_description" elementType="HTTPArgument"> + <elementProp name="sorting[field]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">entity_id</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">meta_description</stringProp> + <stringProp name="Argument.name">sorting[field]</stringProp> </elementProp> - <elementProp name="custom_layout_update" elementType="HTTPArgument"> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">custom_layout_update</stringProp> - </elementProp> - <elementProp name="category_products" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"${simple_product_1_id}":"","${simple_product_2_id}":"","${simple_product_3_id}":"","${simple_product_4_id}":"","${simple_product_5_id}":""}</stringProp> + <stringProp name="Argument.value">asc</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">category_products</stringProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> + <elementProp name="isAjax" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.name">isAjax</stringProp> </elementProp> </collectionProp> </elementProp> @@ -67778,8 +112409,8 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/save/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> @@ -67788,28 +112419,37 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <stringProp name="HTTPSampler.embedded_url_re"/> </HTTPSamplerProxy> <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">URL</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_id</stringProp> - <stringProp name="RegexExtractor.regex">/catalog/category/edit/id/(\d+)/</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">X-Requested-With</stringProp> + <stringProp name="Header.value">XMLHttpRequest</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer edit url" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">customer_edit_url_path</stringProp> + <stringProp name="RegexExtractor.regex">actions":\{"edit":\{"href":"(?:http|https):\\/\\/(.*?)\\/customer\\/index\\/edit\\/id\\/(\d+)\\/",</stringProp> + <stringProp name="RegexExtractor.template">/customer/index/edit/id/$2$/</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category id" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer edit url" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> + <stringProp name="2845929">^.+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">1</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_id</stringProp> + <stringProp name="Scope.variable">customer_edit_url_path</stringProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Select created category" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Customer" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"/> </elementProp> @@ -67819,7 +112459,7 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/edit/id/${admin_category_id}/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}${customer_edit_url_path}</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -67829,118 +112469,361 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <stringProp name="HTTPSampler.embedded_url_re"/> </HTTPSamplerProxy> <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="Accept-Language" elementType="Header"> - <stringProp name="Header.name">Accept-Language</stringProp> - <stringProp name="Header.value">en-US,en;q=0.5</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> - </elementProp> - <elementProp name="User-Agent" elementType="Header"> - <stringProp name="Header.name">User-Agent</stringProp> - <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> - </elementProp> - <elementProp name="Accept-Encoding" elementType="Header"> - <stringProp name="Header.name">Accept-Encoding</stringProp> - <stringProp name="Header.value">gzip, deflate</stringProp> - </elementProp> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert edit customer page" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1422614550">Customer Information</stringProp> </collectionProp> - </HeaderManager> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category row id" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer entity_id" enabled="true"> <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_entity_id</stringProp> - <stringProp name="RegexExtractor.regex">"entity_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">"entity_id":"(\d+)"</stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category attribute set id" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract website_id" enabled="true"> <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_attribute_set_id</stringProp> - <stringProp name="RegexExtractor.regex">"attribute_set_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_website_id</stringProp> + <stringProp name="RegexExtractor.regex">"website_id":"(\d+)"</stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category parent Id" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer firstname" enabled="true"> <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_parent_id</stringProp> - <stringProp name="RegexExtractor.regex">"parent_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_firstname</stringProp> + <stringProp name="RegexExtractor.regex">"firstname":"([^"]+)"</stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category created at" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer lastname" enabled="true"> <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_created_at</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_lastname</stringProp> + <stringProp name="RegexExtractor.regex">"lastname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer email" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_email</stringProp> + <stringProp name="RegexExtractor.regex">"email":"([^\@]+@[^.]+.[^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract group_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_group_id</stringProp> + <stringProp name="RegexExtractor.regex">"group_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract store_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_store_id</stringProp> + <stringProp name="RegexExtractor.regex">"store_id":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extact created_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_created_at</stringProp> <stringProp name="RegexExtractor.regex">"created_at":"([^"]+)"</stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category updated at" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract updated_at" enabled="true"> <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_updated_at</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_updated_at</stringProp> <stringProp name="RegexExtractor.regex">"updated_at":"([^"]+)"</stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category path" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract is_active" enabled="true"> <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_path</stringProp> - <stringProp name="RegexExtractor.regex">"entity_id":(.+)"path":"([^\"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_is_active</stringProp> + <stringProp name="RegexExtractor.regex">"is_active":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category level" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract disable_auto_group_change" enabled="true"> <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_level</stringProp> - <stringProp name="RegexExtractor.regex">"level":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_disable_auto_group_change</stringProp> + <stringProp name="RegexExtractor.regex">"disable_auto_group_change":"(\d+)"</stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category name" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract created_in" enabled="true"> <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_name</stringProp> - <stringProp name="RegexExtractor.regex">"entity_id":(.+)"name":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$2$</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_created_in</stringProp> + <stringProp name="RegexExtractor.regex">"created_in":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url key" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract dob" enabled="true"> <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_url_key</stringProp> - <stringProp name="RegexExtractor.regex">"url_key":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_dob</stringProp> + <stringProp name="RegexExtractor.regex">"dob":"(\d+)-(\d+)-(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$2$/$3$/$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_billing" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_default_billing</stringProp> + <stringProp name="RegexExtractor.regex">"default_billing":"(\d+)"</stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract category url path" enabled="true"> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_shipping" enabled="true"> <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_category_url_path</stringProp> - <stringProp name="RegexExtractor.regex">"url_path":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_default_shipping</stringProp> + <stringProp name="RegexExtractor.regex">"default_shipping":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract gender" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_gender</stringProp> + <stringProp name="RegexExtractor.regex">"gender":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract failures_num" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_failures_num</stringProp> + <stringProp name="RegexExtractor.regex">"failures_num":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_entity_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_entity_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{"entity_id":"(\d+)".+?"parent_id":"${admin_customer_entity_id}"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_created_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_created_at</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"created_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_updated_at" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_updated_at</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"updated_at":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_is_active" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_is_active</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"is_active":"(\d+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_city" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_city</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"city":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_country_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_country_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"country_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_firstname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_firstname</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"firstname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_lastname" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_lastname</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"lastname":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_postcode" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_postcode</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"postcode":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_region</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_region_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region_id":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address street" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_street</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"street":\["([^"]+)"\]</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_telephone" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_telephone</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"telephone":"([^"]+)"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_customer_id" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_customer_address_customer_id</stringProp> + <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"customer_id":"([^"]+)"</stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"/> <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category row id" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer entity_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_entity_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert website_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_website_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer firstname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_firstname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer lastname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_lastname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer email" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_email</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer group_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_group_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer store_id" enabled="true"> <collectionProp name="Asserion.test_strings"> <stringProp name="89649215">^\d+$</stringProp> </collectionProp> @@ -67948,21 +112831,32 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">1</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_entity_id</stringProp> + <stringProp name="Scope.variable">admin_customer_store_id</stringProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category attribute set id" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_at" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> + <stringProp name="2845929">^.+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">1</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_attribute_set_id</stringProp> + <stringProp name="Scope.variable">admin_customer_created_at</stringProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category parent id" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer updated_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_updated_at</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer is_active" enabled="true"> <collectionProp name="Asserion.test_strings"> <stringProp name="89649215">^\d+$</stringProp> </collectionProp> @@ -67970,21 +112864,21 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">1</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_parent_id</stringProp> + <stringProp name="Scope.variable">admin_customer_is_active</stringProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category created at" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer disable_auto_group_change" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="89649215">^\d+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">1</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_created_at</stringProp> + <stringProp name="Scope.variable">admin_customer_disable_auto_group_change</stringProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category updated at" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_in" enabled="true"> <collectionProp name="Asserion.test_strings"> <stringProp name="2845929">^.+$</stringProp> </collectionProp> @@ -67992,21 +112886,21 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">1</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_updated_at</stringProp> + <stringProp name="Scope.variable">admin_customer_created_in</stringProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category path" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer dob" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="59022110">^[\d\\\/]+$</stringProp> + <stringProp name="221072919">^\d+/\d+/\d+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">1</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_path</stringProp> + <stringProp name="Scope.variable">admin_customer_dob</stringProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category level" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_billing" enabled="true"> <collectionProp name="Asserion.test_strings"> <stringProp name="89649215">^\d+$</stringProp> </collectionProp> @@ -68014,818 +112908,654 @@ vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(cate <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">1</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_level</stringProp> + <stringProp name="Scope.variable">admin_customer_default_billing</stringProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category name" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_shipping" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="89649215">^\d+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">1</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_name</stringProp> + <stringProp name="Scope.variable">admin_customer_default_shipping</stringProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url key" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer gender" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="89649215">^\d+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">1</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_url_key</stringProp> + <stringProp name="Scope.variable">admin_customer_gender</stringProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category url path" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer failures_num" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="89649215">^\d+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">1</intProp> <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_category_url_path</stringProp> + <stringProp name="Scope.variable">admin_customer_failures_num</stringProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert products added" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="417284990">${simple_product_1_name}</stringProp> - <stringProp name="1304788671">${simple_product_2_name}</stringProp> - <stringProp name="-2102674944">${simple_product_3_name}</stringProp> - <stringProp name="-1215171263">${simple_product_4_name}</stringProp> - <stringProp name="-327667582">${simple_product_5_name}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Move category" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="id" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_category_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">id</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="point" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">append</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">point</stringProp> - </elementProp> - <elementProp name="pid" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${new_parent_category_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">pid</stringProp> - </elementProp> - <elementProp name="paid" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${parent_category_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paid</stringProp> - </elementProp> - <elementProp name="aid" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">aid</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/move/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete category" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/category/delete/id/${admin_category_id}/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert category deleted" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_entity_id" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="1277069529">You deleted the category.</stringProp> + <stringProp name="89649215">^\d+$</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_entity_id</stringProp> </ResponseAssertion> <hashTree/> - </hashTree> - <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> - <intProp name="ActionProcessor.action">1</intProp> - <intProp name="ActionProcessor.target">0</intProp> - <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCategoryManagementDelay}*1000))}</stringProp> - </TestAction> - <hashTree/> - </hashTree> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Promotion Rules" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cAdminPromotionRulesPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin Promotion Rules"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_created_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_created_at</stringProp> + </ResponseAssertion> <hashTree/> - - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_updated_at" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_updated_at</stringProp> + </ResponseAssertion> <hashTree/> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - } - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PreProcessor> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_is_active" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_is_active</stringProp> + </ResponseAssertion> <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"/> - <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> - <hashTree/> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> - <hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -adminUser = "none"; -adminUserList = props.get("adminUserList"); -adminUserListIterator = props.get("adminUserListIterator"); -adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - -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); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1397214398">Welcome</stringProp> - <stringProp name="-515240035"><title>Magento Admin</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_form_key</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="dummy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_city" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_city</stringProp> + </ResponseAssertion> <hashTree/> - </hashTree> - </hashTree> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Promotions Management" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx</stringProp> -</TestFragmentController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/new</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New Conditional" enabled="true"> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_country_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_country_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_firstname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_firstname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_lastname" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_lastname</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_postcode" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_postcode</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_region</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_region_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_street" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_street</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_telephone" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_telephone</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_customer_id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_customer_address_customer_id</stringProp> + </ResponseAssertion> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Validate" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> <collectionProp name="Arguments.arguments"> - <elementProp name="isAjax" elementType="HTTPArgument"> + <elementProp name="isAjax " elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value">true</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.name">isAjax </stringProp> </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> + <elementProp name="customer[entity_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">true</stringProp> + <stringProp name="Argument.name">customer[entity_id]</stringProp> </elementProp> - <elementProp name="id" elementType="HTTPArgument"> + <elementProp name="customer[website_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1--1</stringProp> + <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">id</stringProp> + <stringProp name="Argument.name">customer[website_id]</stringProp> </elementProp> - <elementProp name="type" elementType="HTTPArgument"> + <elementProp name="customer[email]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal</stringProp> + <stringProp name="Argument.value">${admin_customer_email}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">type</stringProp> + <stringProp name="Argument.name">customer[email]</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/newConditionHtml/form/sales_rule_formrule_conditions_fieldset_/form_namespace/sales_rule_form</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree/> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="name" elementType="HTTPArgument"> + <elementProp name="customer[group_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Rule Name ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">name</stringProp> + <stringProp name="Argument.name">customer[group_id]</stringProp> </elementProp> - <elementProp name="is_active" elementType="HTTPArgument"> + <elementProp name="customer[store_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">is_active</stringProp> + <stringProp name="Argument.name">customer[store_id]</stringProp> </elementProp> - <elementProp name="use_auto_generation" elementType="HTTPArgument"> + <elementProp name="customer[created_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">use_auto_generation</stringProp> + <stringProp name="Argument.name">customer[created_at]</stringProp> </elementProp> - <elementProp name="is_rss" elementType="HTTPArgument"> + <elementProp name="customer[updated_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">is_rss</stringProp> + <stringProp name="Argument.name">customer[updated_at]</stringProp> </elementProp> - <elementProp name="apply_to_shipping" elementType="HTTPArgument"> + <elementProp name="customer[is_active]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">apply_to_shipping</stringProp> + <stringProp name="Argument.name">customer[is_active]</stringProp> </elementProp> - <elementProp name="stop_rules_processing" elementType="HTTPArgument"> + <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">stop_rules_processing</stringProp> + <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> </elementProp> - <elementProp name="coupon_code" elementType="HTTPArgument"> + <elementProp name="customer[created_in]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[created_in]</stringProp> + </elementProp> + <elementProp name="customer[prefix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">coupon_code</stringProp> + <stringProp name="Argument.name">customer[prefix]</stringProp> </elementProp> - <elementProp name="uses_per_coupon" elementType="HTTPArgument"> + <elementProp name="customer[firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[firstname]</stringProp> + </elementProp> + <elementProp name="customer[middlename]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">uses_per_coupon</stringProp> + <stringProp name="Argument.name">customer[middlename]</stringProp> </elementProp> - <elementProp name="uses_per_customer" elementType="HTTPArgument"> + <elementProp name="customer[lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[lastname]</stringProp> + </elementProp> + <elementProp name="customer[suffix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">uses_per_customer</stringProp> + <stringProp name="Argument.name">customer[suffix]</stringProp> </elementProp> - <elementProp name="sort_order" elementType="HTTPArgument"> + <elementProp name="customer[dob]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_dob}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[dob]</stringProp> + </elementProp> + <elementProp name="customer[default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[default_billing]</stringProp> + </elementProp> + <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[default_shipping]</stringProp> + </elementProp> + <elementProp name="customer[taxvat]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sort_order</stringProp> + <stringProp name="Argument.name">customer[taxvat]</stringProp> </elementProp> - <elementProp name="discount_amount" elementType="HTTPArgument"> + <elementProp name="customer[gender]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">5</stringProp> + <stringProp name="Argument.value">${admin_customer_gender}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">discount_amount</stringProp> + <stringProp name="Argument.name">customer[gender]</stringProp> </elementProp> - <elementProp name="discount_qty" elementType="HTTPArgument"> + <elementProp name="customer[failures_num]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">discount_qty</stringProp> + <stringProp name="Argument.name">customer[failures_num]</stringProp> </elementProp> - <elementProp name="discount_step" elementType="HTTPArgument"> + <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">discount_step</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> </elementProp> - <elementProp name="reward_points_delta" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">reward_points_delta</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> </elementProp> - <elementProp name="store_labels[0]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">store_labels[0]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> </elementProp> - <elementProp name="description" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Rule Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">description</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> </elementProp> - <elementProp name="coupon_type" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">coupon_type</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> </elementProp> - <elementProp name="simple_action" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">cart_fixed</stringProp> + <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">simple_action</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> </elementProp> - <elementProp name="website_ids[0]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">website_ids[0]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> </elementProp> - <elementProp name="customer_group_ids[0]" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer_group_ids[0]</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> </elementProp> - <elementProp name="from_date" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">from_date</stringProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> </elementProp> - <elementProp name="to_date" elementType="HTTPArgument"> + <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> + </elementProp> + <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">to_date</stringProp> + <stringProp name="Argument.name">address[new_0][prefix]</stringProp> </elementProp> - <elementProp name="rule[conditions][1][type]" elementType="HTTPArgument"> + <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Combine</stringProp> + <stringProp name="Argument.value">John</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1][type]</stringProp> + <stringProp name="Argument.name">address[new_0][firstname]</stringProp> </elementProp> - <elementProp name="rule[conditions][1][aggregator]" elementType="HTTPArgument"> + <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">all</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1][aggregator]</stringProp> + <stringProp name="Argument.name">address[new_0][middlename]</stringProp> </elementProp> - <elementProp name="rule[conditions][1][value]" elementType="HTTPArgument"> + <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">Doe</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1][value]</stringProp> + <stringProp name="Argument.name">address[new_0][lastname]</stringProp> </elementProp> - <elementProp name="rule[conditions][1--1][type]" elementType="HTTPArgument"> + <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Address</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1--1][type]</stringProp> + <stringProp name="Argument.name">address[new_0][suffix]</stringProp> </elementProp> - <elementProp name="rule[conditions][1--1][attribute]" elementType="HTTPArgument"> + <elementProp name="address[new_0][company]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">base_subtotal</stringProp> + <stringProp name="Argument.value">Test Company</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1--1][attribute]</stringProp> + <stringProp name="Argument.name">address[new_0][company]</stringProp> + </elementProp> + <elementProp name="address[new_0][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Folsom</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][city]</stringProp> </elementProp> - <elementProp name="rule[conditions][1--1][operator]" elementType="HTTPArgument"> + <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">>=</stringProp> + <stringProp name="Argument.value">95630</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1--1][operator]</stringProp> + <stringProp name="Argument.name">address[new_0][postcode]</stringProp> </elementProp> - <elementProp name="rule[conditions][1--1][value]" elementType="HTTPArgument"> + <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.value">1234567890</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1--1][value]</stringProp> + <stringProp name="Argument.name">address[new_0][telephone]</stringProp> </elementProp> - <elementProp name="rule[conditions][1][new_chlid]" elementType="HTTPArgument"> + <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[conditions][1][new_chlid]</stringProp> + <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> </elementProp> - <elementProp name="rule[actions][1][type]" elementType="HTTPArgument"> + <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Magento\SalesRule\Model\Rule\Condition\Product\Combine</stringProp> + <stringProp name="Argument.value">false</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[actions][1][type]</stringProp> + <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> </elementProp> - <elementProp name="rule[actions][1][aggregator]" elementType="HTTPArgument"> + <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">all</stringProp> + <stringProp name="Argument.value">false</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[actions][1][aggregator]</stringProp> + <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> </elementProp> - <elementProp name="rule[actions][1][value]" elementType="HTTPArgument"> + <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">123 Main</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[actions][1][value]</stringProp> + <stringProp name="Argument.name">address[new_0][street][0]</stringProp> </elementProp> - <elementProp name="rule[actions][1][new_child]" elementType="HTTPArgument"> + <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">rule[actions][1][new_child]</stringProp> + <stringProp name="Argument.name">address[new_0][street][1]</stringProp> </elementProp> - <elementProp name="store_labels[1]" elementType="HTTPArgument"> + <elementProp name="address[new_0][region]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">store_labels[1]</stringProp> + <stringProp name="Argument.name">address[new_0][region]</stringProp> </elementProp> - <elementProp name="store_labels[2]" elementType="HTTPArgument"> + <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">US</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">store_labels[2]</stringProp> + <stringProp name="Argument.name">address[new_0][country_id]</stringProp> </elementProp> - <elementProp name="related_banners" elementType="HTTPArgument"> + <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">related_banners</stringProp> + <stringProp name="Argument.name">address[new_0][region_id]</stringProp> </elementProp> <elementProp name="form_key" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> @@ -68842,7 +113572,7 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales_rule/promo_quote/save/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/validate/</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -68854,1677 +113584,4739 @@ vars.put("admin_user", adminUser); <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="-396438583">You saved the rule.</stringProp> + <stringProp name="49586">200</stringProp> </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> <intProp name="Assertion.test_type">16</intProp> </ResponseAssertion> <hashTree/> </hashTree> - <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> - <intProp name="ActionProcessor.action">1</intProp> - <intProp name="ActionProcessor.target">0</intProp> - <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminPromotionsManagementDelay}*1000))}</stringProp> - </TestAction> - <hashTree/> - </hashTree> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Customer Management" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cAdminCustomerManagementPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin Customer Management"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> - <hashTree/> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - } - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PreProcessor> - <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"/> - <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> - <hashTree/> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> - <hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -adminUser = "none"; -adminUserList = props.get("adminUserList"); -adminUserListIterator = props.get("adminUserListIterator"); -adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - -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); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1397214398">Welcome</stringProp> - <stringProp name="-515240035"><title>Magento Admin</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_form_key</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="dummy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> - </HTTPSamplerProxy> - <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> - <hashTree/> - </hashTree> - </hashTree> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Customer Management" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_customer_management/admin_customer_management.jmx</stringProp> -</TestFragmentController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Landing Page" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Save" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="Accept-Language" elementType="Header"> - <stringProp name="Header.name">Accept-Language</stringProp> - <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + <collectionProp name="Arguments.arguments"> + <elementProp name="isAjax " elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax </stringProp> </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + <elementProp name="customer[entity_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[entity_id]</stringProp> </elementProp> - <elementProp name="User-Agent" elementType="Header"> - <stringProp name="Header.name">User-Agent</stringProp> - <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + <elementProp name="customer[website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[website_id]</stringProp> </elementProp> - <elementProp name="Accept-Encoding" elementType="Header"> - <stringProp name="Header.name">Accept-Encoding</stringProp> - <stringProp name="Header.value">gzip, deflate</stringProp> + <elementProp name="customer[email]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_email}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[email]</stringProp> </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Render" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="namespace" elementType="HTTPArgument"> + <elementProp name="customer[group_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">customer_listing</stringProp> + <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.name">customer[group_id]</stringProp> </elementProp> - <elementProp name="search" elementType="HTTPArgument"> + <elementProp name="customer[store_id]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.name">customer[store_id]</stringProp> </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <elementProp name="customer[created_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.name">customer[created_at]</stringProp> </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <elementProp name="customer[updated_at]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.name">customer[updated_at]</stringProp> </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> + <elementProp name="customer[is_active]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.name">customer[is_active]</stringProp> </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> + <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <elementProp name="customer[created_in]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.name">customer[created_in]</stringProp> </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> + <elementProp name="customer[prefix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.name">customer[prefix]</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> + <elementProp name="customer[firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[firstname]</stringProp> + </elementProp> + <elementProp name="customer[middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[middlename]</stringProp> </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Render" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="namespace" elementType="HTTPArgument"> + <elementProp name="customer[lastname]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">customer_listing</stringProp> + <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.name">customer[lastname]</stringProp> </elementProp> - <elementProp name="search" elementType="HTTPArgument"> + <elementProp name="customer[suffix]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Lastname</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.name">customer[suffix]</stringProp> </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <elementProp name="customer[dob]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.value">${admin_customer_dob}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.name">customer[dob]</stringProp> </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <elementProp name="customer[default_billing]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">20</stringProp> + <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.name">customer[default_billing]</stringProp> </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> + <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.name">customer[default_shipping]</stringProp> </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> + <elementProp name="customer[taxvat]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">entity_id</stringProp> + <stringProp name="Argument.value"/> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.name">customer[taxvat]</stringProp> </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <elementProp name="customer[gender]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.value">${admin_customer_gender}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.name">customer[gender]</stringProp> </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> + <elementProp name="customer[failures_num]" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> <stringProp name="Argument.metadata">=</stringProp> <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.name">customer[failures_num]</stringProp> </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">X-Requested-With</stringProp> - <stringProp name="Header.value">XMLHttpRequest</stringProp> + <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> + </elementProp> + + <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> + </elementProp> + <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> + </elementProp> + <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][prefix]</stringProp> + </elementProp> + <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">John</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][firstname]</stringProp> + </elementProp> + <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][middlename]</stringProp> + </elementProp> + <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Doe</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][lastname]</stringProp> + </elementProp> + <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][suffix]</stringProp> + </elementProp> + <elementProp name="address[new_0][company]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Test Company</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][company]</stringProp> + </elementProp> + <elementProp name="address[new_0][city]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Folsom</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][city]</stringProp> + </elementProp> + <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">95630</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][postcode]</stringProp> + </elementProp> + <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1234567890</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][telephone]</stringProp> + </elementProp> + <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> + </elementProp> + <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> + </elementProp> + <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">false</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> + </elementProp> + <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">123 Main</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][street][0]</stringProp> + </elementProp> + <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][street][1]</stringProp> + </elementProp> + <elementProp name="address[new_0][region]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][region]</stringProp> + </elementProp> + <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">US</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][country_id]</stringProp> + </elementProp> + <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">12</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">address[new_0][region_id]</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> </elementProp> </collectionProp> - </HeaderManager> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer edit url" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">customer_edit_url_path</stringProp> - <stringProp name="RegexExtractor.regex">actions":\{"edit":\{"href":"(?:http|https):\\/\\/(.*?)\\/customer\\/index\\/edit\\/id\\/(\d+)\\/",</stringProp> - <stringProp name="RegexExtractor.template">/customer/index/edit/id/$2$/</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer edit url" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">customer_edit_url_path</stringProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Edit Customer" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}${customer_edit_url_path}</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert edit customer page" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1422614550">Customer Information</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer entity_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_entity_id</stringProp> - <stringProp name="RegexExtractor.regex">"entity_id":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract website_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_website_id</stringProp> - <stringProp name="RegexExtractor.regex">"website_id":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer firstname" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_firstname</stringProp> - <stringProp name="RegexExtractor.regex">"firstname":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer lastname" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_lastname</stringProp> - <stringProp name="RegexExtractor.regex">"lastname":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract customer email" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_email</stringProp> - <stringProp name="RegexExtractor.regex">"email":"([^\@]+@[^.]+.[^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract group_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_group_id</stringProp> - <stringProp name="RegexExtractor.regex">"group_id":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract store_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_store_id</stringProp> - <stringProp name="RegexExtractor.regex">"store_id":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extact created_at" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_created_at</stringProp> - <stringProp name="RegexExtractor.regex">"created_at":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract updated_at" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_updated_at</stringProp> - <stringProp name="RegexExtractor.regex">"updated_at":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract is_active" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_is_active</stringProp> - <stringProp name="RegexExtractor.regex">"is_active":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract disable_auto_group_change" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_disable_auto_group_change</stringProp> - <stringProp name="RegexExtractor.regex">"disable_auto_group_change":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract created_in" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_created_in</stringProp> - <stringProp name="RegexExtractor.regex">"created_in":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract dob" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_dob</stringProp> - <stringProp name="RegexExtractor.regex">"dob":"(\d+)-(\d+)-(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$2$/$3$/$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_billing" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_default_billing</stringProp> - <stringProp name="RegexExtractor.regex">"default_billing":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract default_shipping" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_default_shipping</stringProp> - <stringProp name="RegexExtractor.regex">"default_shipping":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract gender" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_gender</stringProp> - <stringProp name="RegexExtractor.regex">"gender":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract failures_num" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_failures_num</stringProp> - <stringProp name="RegexExtractor.regex">"failures_num":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_entity_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_entity_id</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{"entity_id":"(\d+)".+?"parent_id":"${admin_customer_entity_id}"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_created_at" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_created_at</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"created_at":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_updated_at" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_updated_at</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"updated_at":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_is_active" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_is_active</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"is_active":"(\d+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_city" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_city</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"city":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_country_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_country_id</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"country_id":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_firstname" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_firstname</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"firstname":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_lastname" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_lastname</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"lastname":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_postcode" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_postcode</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"postcode":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_region</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_region_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_region_id</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region_id":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address street" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_street</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"street":\["([^"]+)"\]</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_telephone" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_telephone</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"telephone":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract address_customer_id" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_customer_address_customer_id</stringProp> - <stringProp name="RegexExtractor.regex">_address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"customer_id":"([^"]+)"</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer entity_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_entity_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert website_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_website_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer firstname" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_firstname</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer lastname" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_lastname</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer email" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_email</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer group_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_group_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer store_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_store_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_at" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_created_at</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer updated_at" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_updated_at</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer is_active" enabled="true"> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/save/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer saved" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> + <stringProp name="292987815">You saved the customer.</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_is_active</stringProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer disable_auto_group_change" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_disable_auto_group_change</stringProp> - </ResponseAssertion> + </hashTree> + <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> + <intProp name="ActionProcessor.action">1</intProp> + <intProp name="ActionProcessor.target">0</intProp> + <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCustomerManagementDelay}*1000))}</stringProp> + </TestAction> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Admin Edit Order" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${adminEditOrderPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer created_in" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_created_in</stringProp> - </ResponseAssertion> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Admin Edit Order"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer dob" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="221072919">^\d+/\d+/\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_dob</stringProp> - </ResponseAssertion> + + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_billing" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_default_billing</stringProp> - </ResponseAssertion> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer default_shipping" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_default_shipping</stringProp> - </ResponseAssertion> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer gender" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_gender</stringProp> - </ResponseAssertion> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1204796042">Create New Order</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">desc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Pending Orders" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="namespace" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">sales_order_grid</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">namespace</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="search" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">search</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[placeholder]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[placeholder]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[pageSize]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">200</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[pageSize]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="paging[current]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">paging[current]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">increment_id</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[field]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="sorting[direction]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">asc</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">sorting[direction]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="filters[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filters[status]</stringProp> + </elementProp> + <elementProp name="_" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">_</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> +<hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1637639774">totalRecords</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order numbers" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_numbers</stringProp> + <stringProp name="RegexExtractor.regex">\"increment_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_ids</stringProp> + <stringProp name="RegexExtractor.regex">\"entity_id\":\"(\d+)\"\,</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> + import java.util.ArrayList; + import java.util.HashMap; + 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); + + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> + </BeanShellSampler> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Order" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/view/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2103620713">#${order_number}</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order status" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">order_status</stringProp> + <stringProp name="RegexExtractor.regex"><span id="order_status">([^<]+)</span></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> + <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Comment" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="history[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">pending</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">history[status]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="history[comment]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Some text</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">history[comment]</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/addComment/order_id/${order_id}/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/add_comment.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-2089278331">Not Notified</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1233850814">Invoice Totals</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract ordered items ids" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">item_ids</stringProp> + <stringProp name="RegexExtractor.regex"><div id="order_item_(\d+)_title"\s*class="product-title"></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">-1</stringProp> + <stringProp name="Scope.variable">simple_products</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Submit" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_1}]</stringProp> + </elementProp> + <elementProp name="invoice[items][${item_ids_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[items][${item_ids_2}]</stringProp> + </elementProp> + <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Invoiced</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">invoice[comment_text]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1740524604">The invoice has been created</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Start" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/start/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_start.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="304100442">New Shipment</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Submit" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="shipment[items][${item_ids_1}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">shipment[items][${item_ids_1}]</stringProp> + </elementProp> + <elementProp name="shipment[items][${item_ids_2}]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">shipment[items][${item_ids_2}]</stringProp> + </elementProp> + <elementProp name="shipment[comment_text]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Shipped</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">shipment[comment_text]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_submit.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-2089453199">The shipment has been created</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + + <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Catalog GraphQL" enabled="true"> + <intProp name="ThroughputController.style">1</intProp> + <boolProp name="ThroughputController.perThread">false</boolProp> + <intProp name="ThroughputController.maxThroughput">1</intProp> + <stringProp name="ThroughputController.percentThroughput">${catalogGraphQLPercentage}</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> + <hashTree> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> + <stringProp name="script"> +var tmpLabel = vars.get("testLabel") +if (tmpLabel) { + var testLabel = " (" + tmpLabel + ")" + if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { + if (sampler.getName().indexOf(testLabel) == -1) { + sampler.setName(sampler.getName() + testLabel); + } + } else if (sampler.getName().indexOf("SetUp - ") == -1) { + sampler.setName("SetUp - " + sampler.getName()); + } + } else { + testLabel = "" + } + + + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer failures_num" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_failures_num</stringProp> - </ResponseAssertion> + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> + <stringProp name="BeanShellSampler.query"> + vars.put("testLabel", "Catalog GraphQL"); + </stringProp> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_entity_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_entity_id</stringProp> - </ResponseAssertion> + + <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Admin Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/once_only_controller.jmx</stringProp> +</OnceOnlyController> + <hashTree> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_created_at" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_created_at</stringProp> - </ResponseAssertion> + <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> + <stringProp name="script"> + 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); + } + } + } + </stringProp> + <stringProp name="scriptLanguage">javascript</stringProp> + </JSR223PreProcessor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_updated_at" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_updated_at</stringProp> - </ResponseAssertion> + + <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> + <collectionProp name="CookieManager.cookies"/> + <boolProp name="CookieManager.clearEachIteration">false</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> + <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> + <stringProp name="BeanShellSampler.query"> +adminUser = "none"; +adminUserList = props.get("adminUserList"); +adminUserListIterator = props.get("adminUserListIterator"); +adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + +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); + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-1397214398">Welcome</stringProp> + <stringProp name="-515240035"><title>Magento Admin</title></stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">2</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="2845929">^.+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_form_key</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="dummy" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">dummy</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="login[password]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_password}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[password]</stringProp> + </elementProp> + <elementProp name="login[username]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_user}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">login[username]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.implementation">Java</stringProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> + <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_is_active" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Indexer Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Indexers Management Catalog Set On Save" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_indexers_management/admin_indexer_management_catalog_set_on_save.jmx</stringProp> + </TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Index Page" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/indexer/indexer/list/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="Accept-Language" elementType="Header"> + <stringProp name="Header.name">Accept-Language</stringProp> + <stringProp name="Header.value">en-US,en;q=0.5</stringProp> + </elementProp> + <elementProp name="Accept" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> + </elementProp> + <elementProp name="User-Agent" elementType="Header"> + <stringProp name="Header.name">User-Agent</stringProp> + <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> + </elementProp> + <elementProp name="Accept-Encoding" elementType="Header"> + <stringProp name="Header.name">Accept-Encoding</stringProp> + <stringProp name="Header.value">gzip, deflate</stringProp> + </elementProp> </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_is_active</stringProp> - </ResponseAssertion> + </HeaderManager> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_city" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Set Indexers on Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="indexer_ids" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">catalog_category_product,catalog_product_category,catalog_product_price,catalog_product_attribute,cataloginventory_stock,catalogsearch_fulltext</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">indexer_ids</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="massaction_prepare_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">indexer_ids</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">massaction_prepare_key</stringProp> + </elementProp> </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_city</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_country_id" enabled="true"> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/indexer/indexer/massOnTheFly/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="49586">200</stringProp> </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_country_id</stringProp> + <intProp name="Assertion.test_type">16</intProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_firstname" enabled="true"> + </hashTree> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Related Product Id" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_related_product_id.jmx</stringProp> + <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; +import java.util.Random; +Random random = new Random(); +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"));</stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + </BeanShellSampler> + <hashTree/> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="SetUp - Get Product Attributes" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - API Get product attributes" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="searchCriteria[filterGroups][0][filters][0][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">mycolor</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filterGroups][0][filters][0][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">attribute_code</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][0][field]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filterGroups][0][filters][1][value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">mysize</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][1][value]</stringProp> + </elementProp> + <elementProp name="searchCriteria[filterGroups][0][filters][1][field]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">attribute_code</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">searchCriteria[filterGroups][0][filters][1][field]</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/get_product_attributes.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product attributes" enabled="true"> + <stringProp name="VAR">product_attributes</stringProp> + <stringProp name="JSONPATH">$.items</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="SetUp - Prepare product attributes" enabled="true"> + <stringProp name="scriptLanguage">javascript</stringProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="cacheKey"/> + <stringProp name="script"> +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); +</stringProp> + </JSR223PostProcessor> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Get Attribute Set Id" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product_set/index/filter/${attribute_set_filter}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">attribute_set_id</stringProp> + <stringProp name="RegexExtractor.regex">catalog&#x2F;product_set&#x2F;edit&#x2F;id&#x2F;([\d]+)&#x2F;"[\D\d]*Attribute Set 1</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="SetUp - Set Attribute Set Filter" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">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)); +</stringProp> + </BeanShellPreProcessor> + <hashTree/> + </hashTree> + + <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Arguments" enabled="true"> + <stringProp name="BeanShellSampler.query">import org.apache.jmeter.samplers.SampleResult; +import java.util.Random; +Random random = new Random(); +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)}"); + + </stringProp> + <stringProp name="BeanShellSampler.filename"/> + <stringProp name="BeanShellSampler.parameters"/> + <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/setup.jmx</stringProp></BeanShellSampler> + <hashTree/> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Admin Create Bundle Product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_product/create_bundle_product.jmx</stringProp> +</TestFragmentController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Catalog Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="1509986340">records found</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_firstname</stringProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_lastname" enabled="true"> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/new/set/4/type/bundle/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="-144461265">New Product</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_lastname</stringProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_postcode" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product Validate" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">42</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variations]</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + </elementProp> + <elementProp name="product[shipment_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[shipment_type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title one</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][title]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][required]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][product_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">25</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][product_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10.99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title two</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][title]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][option_id]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][delete]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][type]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][required]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][position]</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][option_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][product_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][delete]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">5.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][position]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][option_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][product_id]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][delete]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">7.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][position]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="affect_bundle_product_selections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_bundle_product_selections</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_postcode</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region" enabled="true"> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/validate/set/4/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="1853918323">{"error":false}</stringProp> </collectionProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_region</stringProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_region_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="New Bundle Product Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="ajax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">ajax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="isAjax" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">true</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">isAjax</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[name]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[name]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[sku]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[sku]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="product[price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">42</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[price]</stringProp> + </elementProp> + <elementProp name="product[tax_class_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tax_class_id]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">111</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][qty]</stringProp> + </elementProp> + <elementProp name="product[quantity_and_stock_status][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[quantity_and_stock_status][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1.0000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[weight]</stringProp> + </elementProp> + <elementProp name="product[product_has_weight]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[product_has_weight]</stringProp> + <stringProp name="Argument.desc">true</stringProp> + </elementProp> + <elementProp name="product[category_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[category_ids][]</stringProp> + </elementProp> + <elementProp name="product[description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Full bundle product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[description]</stringProp> + </elementProp> + <elementProp name="product[short_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"><p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p></stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[short_description]</stringProp> + </elementProp> + <elementProp name="product[status]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[status]</stringProp> + </elementProp> + <elementProp name="product[configurable_variations]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[configurable_variations]</stringProp> + </elementProp> + <elementProp name="affect_configurable_product_attributes" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_configurable_product_attributes</stringProp> + </elementProp> + <elementProp name="product[image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[image]</stringProp> + </elementProp> + <elementProp name="product[small_image]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[small_image]</stringProp> + </elementProp> + <elementProp name="product[thumbnail]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[thumbnail]</stringProp> + </elementProp> + <elementProp name="product[url_key]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[url_key]</stringProp> + </elementProp> + <elementProp name="product[meta_title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_title]</stringProp> + </elementProp> + <elementProp name="product[meta_keyword]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_keyword]</stringProp> + </elementProp> + <elementProp name="product[meta_description]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[meta_description]</stringProp> + </elementProp> + <elementProp name="product[website_ids][]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[website_ids][]</stringProp> + </elementProp> + <elementProp name="product[special_price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_price]</stringProp> + </elementProp> + <elementProp name="product[special_from_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_from_date]</stringProp> + </elementProp> + <elementProp name="product[special_to_date]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[special_to_date]</stringProp> + </elementProp> + <elementProp name="product[cost]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[cost]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">32000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">90</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][0][delete]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][website_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][website_id]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][cust_group]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][cust_group]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">101</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price_qty]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][price]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][price]</stringProp> + </elementProp> + <elementProp name="product[tier_price][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[tier_price][1][delete]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_manage_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_manage_stock]</stringProp> + </elementProp> + <elementProp name="product[stock_data][original_inventory_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][original_inventory_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">100500</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_min_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_min_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10000</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_max_sale_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_max_sale_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_qty_decimal]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_qty_decimal]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_decimal_divided]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_decimal_divided]</stringProp> + </elementProp> + <elementProp name="product[stock_data][backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_backorders]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_backorders]</stringProp> + </elementProp> + <elementProp name="product[stock_data][notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_notify_stock_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_notify_stock_qty]</stringProp> + </elementProp> + <elementProp name="product[stock_data][enable_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][enable_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][use_config_qty_increments]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][use_config_qty_increments]</stringProp> + </elementProp> + <elementProp name="product[stock_data][is_in_stock]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[stock_data][is_in_stock]</stringProp> + </elementProp> + <elementProp name="product[custom_design]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design]</stringProp> + </elementProp> + <elementProp name="product[custom_design_from]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_from]</stringProp> + </elementProp> + <elementProp name="product[custom_design_to]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_design_to]</stringProp> + </elementProp> + <elementProp name="product[custom_layout_update]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[custom_layout_update]</stringProp> + </elementProp> + <elementProp name="product[page_layout]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[page_layout]</stringProp> + </elementProp> + <elementProp name="product[options_container]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">container2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[options_container]</stringProp> + </elementProp> + <elementProp name="new-variations-attribute-set-id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">new-variations-attribute-set-id</stringProp> + </elementProp> + <elementProp name="product[shipment_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">product[shipment_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title one</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][required]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">25</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][0][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">10.99</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][0][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][0][bundle_selections][1][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][title]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">option title two</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][title]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">select</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][required]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][required]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_1_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">5.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][0][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][option_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][option_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][product_id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${simple_product_2_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][product_id]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][delete]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][delete]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">7.00</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_value]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_price_type]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="bundle_options[bundle_options][1][bundle_selections][1][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">bundle_options[bundle_options][1][bundle_selections][1][position]</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="affect_bundle_product_selections" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">2</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">affect_bundle_product_selections</stringProp> + <stringProp name="Argument.desc">false</stringProp> + </elementProp> + <elementProp name="links[related][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][id]</stringProp> + </elementProp> + <elementProp name="links[related][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[related][0][position]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][id]</stringProp> + </elementProp> + <elementProp name="links[upsell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[upsell][0][position]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][id]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${related_product_id}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][id]</stringProp> + </elementProp> + <elementProp name="links[crosssell][0][position]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">links[crosssell][0][position]</stringProp> + </elementProp> </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_region_id</stringProp> - </ResponseAssertion> - <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_street" enabled="true"> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/catalog/product/save/set/4/type/bundle/back/edit/active_tab/product-details/</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> + <stringProp name="-583471546">You saved the product</stringProp> + <stringProp name="-1534079309">option title one</stringProp> + <stringProp name="-1534074215">option title two</stringProp> + <stringProp name="1304788671">${simple_product_2_name}</stringProp> + <stringProp name="417284990">${simple_product_1_name}</stringProp> </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_street</stringProp> + <intProp name="Assertion.test_type">2</intProp> </ResponseAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_telephone" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_telephone</stringProp> - </ResponseAssertion> + </hashTree> + </hashTree> + + <TestFragmentController guiclass="TestFragmentControllerGui" testclass="TestFragmentController" testname="Test Fragment" enabled="true"/> + <hashTree> + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Create Cms Page with Page Builder Product List" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ee/admin_create_cms_page_with_page_builder_product_list/admin_create_cms_page_with_page_builder_product_list.jmx</stringProp> + </GenericController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create New" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/cms/page/new</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert address_customer_id" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="89649215">^\d+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_customer_address_customer_id</stringProp> - </ResponseAssertion> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Save" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="content" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">&lt;div data-content-type=&quot;row&quot; data-appearance=&quot;contained&quot; data-element=&quot;main&quot;&gt;&lt;div data-enable-parallax=&quot;0&quot; data-parallax-speed=&quot;0.5&quot; data-background-images=&quot;{}&quot; data-element=&quot;inner&quot; style=&quot;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;&quot;&gt;&lt;div data-content-type=&quot;products&quot; data-appearance=&quot;grid&quot; data-element=&quot;main&quot; style=&quot;border-style: none; border-width: 1px; border-radius: 0px; margin: 0px; padding: 0px;&quot;&gt;{{widget type=&quot;Magento\CatalogWidget\Block\Product\ProductsList&quot; template=&quot;Magento_CatalogWidget::product/widget/content/grid.phtml&quot; anchor_text=&quot;&quot; id_path=&quot;&quot; show_pager=&quot;0&quot; products_count=&quot;5&quot; sort_order=&quot;date_newest_top&quot; type_name=&quot;Catalog Products List&quot; conditions_encoded=&quot;^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`any`,`value`:`1`,`new_child`:``^]^]&quot;}}&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">content</stringProp> + </elementProp> + <elementProp name="content_heading" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">content_heading</stringProp> + </elementProp> + <elementProp name="form_key" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">${admin_form_key}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">form_key</stringProp> + </elementProp> + <elementProp name="identifier" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">identifier</stringProp> + </elementProp> + <elementProp name="is_active" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">is_active</stringProp> + </elementProp> + <elementProp name="layout_update_xml" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">layout_update_xml</stringProp> + </elementProp> + <elementProp name="meta_description" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_description</stringProp> + </elementProp> + <elementProp name="meta_keywords" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_keywords</stringProp> + </elementProp> + <elementProp name="meta_title" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">meta_title</stringProp> + </elementProp> + <elementProp name="nodes_data" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">nodes_data</stringProp> + </elementProp> + <elementProp name="node_ids" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">node_ids</stringProp> + </elementProp> + <elementProp name="page_id" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value"/> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">page_id</stringProp> + </elementProp> + <elementProp name="page_layout" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">1column</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">page_layout</stringProp> + </elementProp> + <elementProp name="store_id[0]" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">store_id[0]</stringProp> + </elementProp> + <elementProp name="title" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">Page Builder Products ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">title</stringProp> + </elementProp> + <elementProp name="website_root" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">website_root</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/cms/page/save/back/edit</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-398886250">You saved the page.</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">16</intProp> + </ResponseAssertion> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">URL</stringProp> + <stringProp name="RegexExtractor.refname">cms_page_id</stringProp> + <stringProp name="RegexExtractor.regex">/page_id\/([0-9]*)\/back/</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default"/> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + + <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script"> + adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + if (adminUsersDistribution == 1) { + adminUserList = props.get("adminUserList"); + adminUserList.add(vars.get("admin_user")); + } + </stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> + <hashTree/> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Product Fixtures Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create product with extensible data objects" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "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" + } + } + ] + } +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_product_with_extensible_data_objects.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> + <stringProp name="VAR">simple_product_id</stringProp> + <stringProp name="JSONPATH">$.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> + <stringProp name="VAR">simple_product_sku</stringProp> + <stringProp name="JSONPATH">$.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> + <stringProp name="VAR">simple_stock_item_id</stringProp> + <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">simple_product_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">simple_product_sku</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">simple_stock_item_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create configurable product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_configurable_product_with_extensible_data_objects.jmx</stringProp> +</OnceOnlyController> + <hashTree> + <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="configurable_product_attribute_color_1" elementType="Argument"> + <stringProp name="Argument.name">configurable_product_attribute_color_1</stringProp> + <stringProp name="Argument.value">color123X</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + <elementProp name="configurable_product_attribute_color_2" elementType="Argument"> + <stringProp name="Argument.name">configurable_product_attribute_color_2</stringProp> + <stringProp name="Argument.value">color567Y</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + <elementProp name="color_attribute_section" elementType="Argument"> + <stringProp name="Argument.name">color_attribute_section</stringProp> + <stringProp name="Argument.value">0</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </Arguments> + <hashTree/> + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If color is assigned to default attribute set" enabled="true"> + <stringProp name="IfController.condition">"${color_attribute_section}" == "0"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + </IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Assign color to attribute set" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "attributeSetId": 4, + "attributeGroupId": 7, + "attributeCode": "color", + "sortOrder": 0 +} +</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attribute-sets/attributes</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1865724479">^\"\d+\"$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract color_attribute_section id" enabled="true"> + <stringProp name="VAR">color_attribute_section</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Get color values ids" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/color/options</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Extract color value #1" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">color_1_value_id</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.[?(@.label =~ /${configurable_product_attribute_color_1}/i)].value</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"/> + <stringProp name="JSONPostProcessor.defaultValues">null</stringProp> + </JSONPostProcessor> <hashTree/> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="Accept-Language" elementType="Header"> - <stringProp name="Header.name">Accept-Language</stringProp> - <stringProp name="Header.value">en-US,en;q=0.5</stringProp> - </elementProp> - <elementProp name="Accept" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp> - </elementProp> - <elementProp name="User-Agent" elementType="Header"> - <stringProp name="Header.name">User-Agent</stringProp> - <stringProp name="Header.value">Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</stringProp> - </elementProp> - <elementProp name="Accept-Encoding" elementType="Header"> - <stringProp name="Header.name">Accept-Encoding</stringProp> - <stringProp name="Header.value">gzip, deflate</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Extract color value #2" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">color_2_value_id</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.[?(@.label =~ /${configurable_product_attribute_color_2}/i)].value</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"/> + <stringProp name="JSONPostProcessor.defaultValues">null</stringProp> + </JSONPostProcessor> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Validate" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If color value #1 is null" enabled="true"> + <stringProp name="IfController.condition">"${color_1_value_id}" == "null"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + </IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create color #1 from existing color attribute " enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "option": { + "label": "${configurable_product_attribute_color_1}" + } +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/color/options</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Option Id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^[a-z0-9_\"]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Get color values ids" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/color/options</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Extract color value #1" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">color_1_value_id</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.[?(@.label =~ /${configurable_product_attribute_color_1}/i)].value</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"/> + </JSONPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If color value #2 is null" enabled="true"> + <stringProp name="IfController.condition">"${color_2_value_id}" == "null"</stringProp> + <boolProp name="IfController.evaluateAll">false</boolProp> + </IfController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create color #2 from existing color attribute " enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "option": { + "label": "${configurable_product_attribute_color_2}" + } +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/color/options</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert Option Id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9_\"]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Get color values ids" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/attributes/color/options</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Extract color value #1" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">color_2_value_id</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.[?(@.label =~ /${configurable_product_attribute_color_2}/i)].value</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"/> + </JSONPostProcessor> + <hashTree/> + </hashTree> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create configurable product with extensible data objects" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="isAjax " elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax </stringProp> - </elementProp> - <elementProp name="customer[entity_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[entity_id]</stringProp> - </elementProp> - <elementProp name="customer[website_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[website_id]</stringProp> - </elementProp> - <elementProp name="customer[email]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_email}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[email]</stringProp> - </elementProp> - <elementProp name="customer[group_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[group_id]</stringProp> - </elementProp> - <elementProp name="customer[store_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[store_id]</stringProp> - </elementProp> - <elementProp name="customer[created_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[created_at]</stringProp> - </elementProp> - <elementProp name="customer[updated_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[updated_at]</stringProp> - </elementProp> - <elementProp name="customer[is_active]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[is_active]</stringProp> - </elementProp> - <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> - </elementProp> - <elementProp name="customer[created_in]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[created_in]</stringProp> - </elementProp> - <elementProp name="customer[prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[prefix]</stringProp> - </elementProp> - <elementProp name="customer[firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[firstname]</stringProp> - </elementProp> - <elementProp name="customer[middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[middlename]</stringProp> - </elementProp> - <elementProp name="customer[lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[lastname]</stringProp> - </elementProp> - <elementProp name="customer[suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[suffix]</stringProp> - </elementProp> - <elementProp name="customer[dob]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_dob}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[dob]</stringProp> - </elementProp> - <elementProp name="customer[default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[default_billing]</stringProp> - </elementProp> - <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[default_shipping]</stringProp> - </elementProp> - <elementProp name="customer[taxvat]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[taxvat]</stringProp> - </elementProp> - <elementProp name="customer[gender]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_gender}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[gender]</stringProp> - </elementProp> - <elementProp name="customer[failures_num]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[failures_num]</stringProp> - </elementProp> - <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> - </elementProp> - <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][prefix]</stringProp> - </elementProp> - <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">John</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][firstname]</stringProp> - </elementProp> - <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][middlename]</stringProp> - </elementProp> - <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Doe</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][lastname]</stringProp> - </elementProp> - <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][suffix]</stringProp> - </elementProp> - <elementProp name="address[new_0][company]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Test Company</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][company]</stringProp> - </elementProp> - <elementProp name="address[new_0][city]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Folsom</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][city]</stringProp> - </elementProp> - <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">95630</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][postcode]</stringProp> - </elementProp> - <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1234567890</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][telephone]</stringProp> - </elementProp> - <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> - </elementProp> - <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> - </elementProp> - <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> - </elementProp> - <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">123 Main</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][street][0]</stringProp> - </elementProp> - <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][street][1]</stringProp> - </elementProp> - <elementProp name="address[new_0][region]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][region]</stringProp> - </elementProp> - <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">US</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][country_id]</stringProp> - </elementProp> - <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][region_id]</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "product": { + "sku": "configurable-apsku-test-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "name": "Configurable Extensible_Product_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "visibility": "4", + "type_id": "configurable", + "price": "99", + "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":"configurable_test_label_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "position":1, + "disabled":false, + "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": "configurable_test_image_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}.jpeg" + } + } + ] + } +}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/validate/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -70534,1199 +118326,2764 @@ vars.put("admin_user", adminUser); <stringProp name="HTTPSampler.embedded_url_re"/> </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> + <stringProp name="VAR">configurable_product_id</stringProp> + <stringProp name="JSONPATH">$.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> + <stringProp name="VAR">configurable_product_sku</stringProp> + <stringProp name="JSONPATH">$.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> + <stringProp name="VAR">configurable_stock_item_id</stringProp> + <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> <collectionProp name="Asserion.test_strings"> - <stringProp name="49586">200</stringProp> + <stringProp name="89649215">^\d+$</stringProp> </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">16</intProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_product_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_product_sku</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_stock_item_id</stringProp> </ResponseAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Customer Save" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create child product with variation red" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="isAjax " elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax </stringProp> - </elementProp> - <elementProp name="customer[entity_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_entity_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[entity_id]</stringProp> - </elementProp> - <elementProp name="customer[website_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_website_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[website_id]</stringProp> - </elementProp> - <elementProp name="customer[email]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_email}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[email]</stringProp> - </elementProp> - <elementProp name="customer[group_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_group_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[group_id]</stringProp> - </elementProp> - <elementProp name="customer[store_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[store_id]</stringProp> - </elementProp> - <elementProp name="customer[created_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_created_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[created_at]</stringProp> - </elementProp> - <elementProp name="customer[updated_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_updated_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[updated_at]</stringProp> - </elementProp> - <elementProp name="customer[is_active]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_is_active}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[is_active]</stringProp> - </elementProp> - <elementProp name="customer[disable_auto_group_change]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_disable_auto_group_change}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[disable_auto_group_change]</stringProp> - </elementProp> - <elementProp name="customer[created_in]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_created_in}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[created_in]</stringProp> - </elementProp> - <elementProp name="customer[prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[prefix]</stringProp> - </elementProp> - <elementProp name="customer[firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_firstname} 1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[firstname]</stringProp> - </elementProp> - <elementProp name="customer[middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[middlename]</stringProp> - </elementProp> - <elementProp name="customer[lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_lastname} 1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[lastname]</stringProp> - </elementProp> - <elementProp name="customer[suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[suffix]</stringProp> - </elementProp> - <elementProp name="customer[dob]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_dob}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[dob]</stringProp> - </elementProp> - <elementProp name="customer[default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_default_billing}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[default_billing]</stringProp> - </elementProp> - <elementProp name="customer[default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_default_shipping}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[default_shipping]</stringProp> - </elementProp> - <elementProp name="customer[taxvat]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[taxvat]</stringProp> - </elementProp> - <elementProp name="customer[gender]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_gender}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[gender]</stringProp> - </elementProp> - <elementProp name="customer[failures_num]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_failures_num}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[failures_num]</stringProp> - </elementProp> - <elementProp name="customer[sendemail_store_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_store_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">customer[sendemail_store_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][entity_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_entity_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][entity_id]</stringProp> - </elementProp> - - <elementProp name="address[${admin_customer_address_entity_id}][created_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_created_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][created_at]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][updated_at]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_updated_at}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][updated_at]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][is_active]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_is_active}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][is_active]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][city]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_city}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][city]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][company]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][company]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][country_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_country_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][country_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_firstname}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][firstname]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_lastname}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][lastname]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][middlename]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][postcode]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_postcode}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][postcode]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][prefix]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][region]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_region}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][region_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_region_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][region_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][street][0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_street}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][0]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][street][1]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][street][1]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][suffix]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][telephone]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_telephone}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][telephone]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][vat_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][vat_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][customer_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_customer_address_customer_id}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][customer_id]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_billing]</stringProp> - </elementProp> - <elementProp name="address[${admin_customer_address_entity_id}][default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[${admin_customer_address_entity_id}][default_shipping]</stringProp> - </elementProp> - <elementProp name="address[new_0][prefix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][prefix]</stringProp> - </elementProp> - <elementProp name="address[new_0][firstname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">John</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][firstname]</stringProp> - </elementProp> - <elementProp name="address[new_0][middlename]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][middlename]</stringProp> - </elementProp> - <elementProp name="address[new_0][lastname]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Doe</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][lastname]</stringProp> - </elementProp> - <elementProp name="address[new_0][suffix]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][suffix]</stringProp> - </elementProp> - <elementProp name="address[new_0][company]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Test Company</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][company]</stringProp> - </elementProp> - <elementProp name="address[new_0][city]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Folsom</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][city]</stringProp> - </elementProp> - <elementProp name="address[new_0][postcode]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">95630</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][postcode]</stringProp> - </elementProp> - <elementProp name="address[new_0][telephone]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1234567890</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][telephone]</stringProp> - </elementProp> - <elementProp name="address[new_0][vat_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][vat_id]</stringProp> - </elementProp> - <elementProp name="address[new_0][default_billing]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][default_billing]</stringProp> - </elementProp> - <elementProp name="address[new_0][default_shipping]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">false</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][default_shipping]</stringProp> - </elementProp> - <elementProp name="address[new_0][street][0]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">123 Main</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "product": { + "sku": "apsku-test-${configurable_product_attribute_color_1}", + "name": "Extensible_Product_${configurable_product_attribute_color_1}", + "visibility": "1", + "type_id": "simple", + "price": "3.62", + "status": "1", + "attribute_set_id": "4", + "custom_attributes": [ + { + "attribute_code": "cost", + "value": "" + }, + { + "attribute_code": "description", + "value": "Description" + }, + { + "attribute_code": "color", + "value": "${color_1_value_id}" + } + ], + "extension_attributes":{ + "stock_item":{ + "manage_stock": 1, + "is_in_stock": 1, + "qty":"100" + } + } , + "media_gallery_entries": + [{ + "id": null, + "label":"test_label_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "position":1, + "disabled":false, + "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" + } + } + ] + } +}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][street][0]</stringProp> </elementProp> - <elementProp name="address[new_0][street][1]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> + <stringProp name="VAR">configurable_red_product_id</stringProp> + <stringProp name="JSONPATH">$.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> + <stringProp name="VAR">configurable_red_product_sku</stringProp> + <stringProp name="JSONPATH">$.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> + <stringProp name="VAR">configurable_red_stock_item_id</stringProp> + <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_red_product_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-425311000">^[A-Za-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_red_product_sku</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_red_stock_item_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create child product with variation blue" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "product": { + "sku": "apsku-test-${configurable_product_attribute_color_2}", + "name": "Extensible_Product_${configurable_product_attribute_color_2}", + "visibility": "1", + "type_id": "simple", + "price": "3.62", + "status": "1", + "attribute_set_id": "4", + "custom_attributes": [ + { + "attribute_code": "cost", + "value": "" + }, + { + "attribute_code": "description", + "value": "Description" + }, + { + "attribute_code": "color", + "value": "${color_2_value_id}" + } + ], + "extension_attributes":{ + "stock_item":{ + "manage_stock": 1, + "is_in_stock": 1, + "qty":"100" + } + } , + "media_gallery_entries": + [{ + "id": null, + "label":"test_label_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "position":1, + "disabled":false, + "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" + } + } + ] + } +}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][street][1]</stringProp> </elementProp> - <elementProp name="address[new_0][region]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> + <stringProp name="VAR">configurable_blue_product_id</stringProp> + <stringProp name="JSONPATH">$.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> + <stringProp name="VAR">configurable_blue_product_sku</stringProp> + <stringProp name="JSONPATH">$.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> + <stringProp name="VAR">configurable_blue_stock_item_id</stringProp> + <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_blue_product_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-425311000">^[A-Za-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_blue_product_sku</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">configurable_blue_stock_item_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create color option for configurable product" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "option": { + "attribute_id": "93", + "label": "Color", + "position": 0, + "is_use_default": 1, + "values": [ + { + "value_index": 0 + } + ] + } +}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][region]</stringProp> </elementProp> - <elementProp name="address[new_0][country_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">US</stringProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/configurable-products/${configurable_product_sku}/options</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert option id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1865724479">^\"\d+\"$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create children from variation color #1" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"childSku": "apsku-test-${configurable_product_attribute_color_1}"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][country_id]</stringProp> </elementProp> - <elementProp name="address[new_0][region_id]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">12</stringProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/configurable-products/${configurable_product_sku}/child</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert True" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="3569038">true</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create children from variation color #2" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"childSku": "apsku-test-${configurable_product_attribute_color_2}"}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">address[new_0][region_id]</stringProp> </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/configurable-products/${configurable_product_sku}/child</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert True" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="3569038">true</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create bundle product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_bundle_product_with_extensible_data_objects.jmx</stringProp> + </OnceOnlyController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create bundle product with extensible data objects" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "product": { + "sku": "bundle-apsku-test-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "name": "Bundle Extensible_Product_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "visibility": "4", + "type_id": "bundle", + "price": "99", + "status": "1", + "attribute_set_id": "4", + "custom_attributes": [ + { + "attribute_code": "price_view", + "value": "0" + }, + { + "attribute_code": "price_type", + "value": "0" + }, + { + "attribute_code": "weight_type", + "value": "0" + }, + { + "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":"bundle_test_label_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "position":1, + "disabled":false, + "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": "bundle_test_image_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}.jpeg" + } + } + ] + } + }</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract bundle product id" enabled="true"> + <stringProp name="VAR">bundle_product_id</stringProp> + <stringProp name="JSONPATH">$.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> + <stringProp name="VAR">bundle_product_sku</stringProp> + <stringProp name="JSONPATH">$.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">bundle_product_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">bundle_product_sku</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create child product child simple 1" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "product": { + "sku": "apsku-test-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "name": "Extensible_Product_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "visibility": "1", + "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(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "position":1, + "disabled":false, + "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" + } + } + ] + } + }</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> + <stringProp name="VAR">bundle_child_1_product_id</stringProp> + <stringProp name="JSONPATH">$.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> + <stringProp name="VAR">bundle_child_1_product_sku</stringProp> + <stringProp name="JSONPATH">$.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> + <stringProp name="VAR">bundle_child_1_product_stock_item_id</stringProp> + <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">bundle_child_1_product_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-425311000">^[A-Za-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">bundle_child_1_product_sku</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">bundle_child_1_product_stock_item_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create child product child simple 2" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "product": { + "sku": "apsku-test-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "name": "Extensible_Product_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "visibility": "1", + "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(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "position":1, + "disabled":false, + "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" + } + } + ] + } + }</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> + <stringProp name="VAR">bundle_child_2_product_id</stringProp> + <stringProp name="JSONPATH">$.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> + <stringProp name="VAR">bundle_child_2_product_sku</stringProp> + <stringProp name="JSONPATH">$.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> + <stringProp name="VAR">bundle_child_2_product_stock_item_id</stringProp> + <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">bundle_child_2_product_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="-425311000">^[A-Za-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">bundle_child_2_product_sku</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">bundle_child_2_product_stock_item_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create option and values for bundle product" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "option": { + "title": "option-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}", + "required": 1, + "type": "select", + "position": 0, + "sku": "${bundle_product_sku}", + "product_links": [ + { + "sku": "${bundle_child_1_product_sku}", + "qty": 1, + "position": 0, + "is_default": 1, + "can_change_quantity": 0 + }, + { + "sku": "${bundle_child_2_product_sku}", + "qty": 1, + "position": 0, + "is_default": 0, + "can_change_quantity": 0 + } + ] + } + }</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/bundle-products/options/add</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert option id" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="1865724479">^\"\d+\"$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Scope.variable"/> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create downloadable product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_downloadable_product_with_extensible_data_objects.jmx</stringProp> + </OnceOnlyController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create downloadable product with extensible data objects" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "product": { + "sku": "apsku-test-${__time()}-${__threadNum}-${__Random(1,1000000)}", + "name": "Extensible_Product_${__time()}-${__threadNum}-${__Random(1,1000000)}", + "visibility": "4", + "type_id": "downloadable", + "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":false, + "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" + } + } + ] + } + }</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable product id" enabled="true"> + <stringProp name="VAR">downloadable_product_id</stringProp> + <stringProp name="JSONPATH">$.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable product sku" enabled="true"> + <stringProp name="VAR">downloadable_product_sku</stringProp> + <stringProp name="JSONPATH">$.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">downloadable_product_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">downloadable_product_sku</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create Links and samples" enabled="true"/> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create link 1" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "link": { + "title": "link1", + "sort_order": 0, + "is_shareable": 1, + "price": 10, + "number_of_downloads": 10, + "link_type": "file", + "link_file_content": { + "file_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", + "name": "file1.jpeg", + "extension_attributes": {} + }, + "sample_type": "file", + "sample_file_content": { + "file_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", + "name": "file1.jpeg", + "extension_attributes": {} + }, + "extension_attributes": {} + }, + "isGlobalScopeContent": 1 + } + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${downloadable_product_sku}/downloadable-links</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable link id" enabled="true"> + <stringProp name="VAR">downloadable_link_id</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert response id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Scope.variable">downloadable_link_id</stringProp> + <stringProp name="Assertion.scope">variable</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create link 2" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "link": { + "title": "link2", + "sort_order": 0, + "is_shareable": 1, + "price": 10, + "number_of_downloads": 10, + "link_type": "file", + "link_file_content": { + "file_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", + "name": "file1.jpeg", + "extension_attributes": {} + }, + "sample_type": "file", + "sample_file_content": { + "file_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", + "name": "file1.jpeg", + "extension_attributes": {} + }, + "extension_attributes": {} + }, + "isGlobalScopeContent": 1 + } + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${downloadable_product_sku}/downloadable-links</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable link id" enabled="true"> + <stringProp name="VAR">downloadable_link_id</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert response id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Scope.variable">downloadable_link_id</stringProp> + <stringProp name="Assertion.scope">variable</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create link 3" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "link": { + "title": "link3", + "sort_order": 0, + "is_shareable": 1, + "price": 10, + "number_of_downloads": 10, + "link_type": "file", + "link_file_content": { + "file_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", + "name": "file1.jpeg", + "extension_attributes": {} + }, + "sample_type": "file", + "sample_file_content": { + "file_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", + "name": "file1.jpeg", + "extension_attributes": {} + }, + "extension_attributes": {} + }, + "isGlobalScopeContent": 1 + } + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${downloadable_product_sku}/downloadable-links</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable link id" enabled="true"> + <stringProp name="VAR">downloadable_link_id</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert response id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Scope.variable">downloadable_link_id</stringProp> + <stringProp name="Assertion.scope">variable</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create sample 1" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "sample": { + "title": "sample1", + "sort_order": 0, + "sample_type": "file", + "sample_file_content": { + "file_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", + "name": "file2.jpeg", + "extension_attributes": {} + }, + "sample_url": "string", + "extension_attributes": {} + }, + "isGlobalScopeContent": 1 + }</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${downloadable_product_sku}/downloadable-links/samples</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable sample id" enabled="true"> + <stringProp name="VAR">sample_link_id</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert response id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">sample_link_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create sample 2" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "sample": { + "title": "sample2", + "sort_order": 0, + "sample_type": "file", + "sample_file_content": { + "file_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", + "name": "file2.jpeg", + "extension_attributes": {} + }, + "sample_url": "string", + "extension_attributes": {} + }, + "isGlobalScopeContent": 1 + }</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${downloadable_product_sku}/downloadable-links/samples</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable sample id" enabled="true"> + <stringProp name="VAR">sample_link_id</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert response id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">sample_link_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create virtual product with extensible data objects" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "product": { + "sku": "apsku-test-${__time()}-${__threadNum}-${__Random(1,1000000)}", + "name": "Extensible_Product_${__time()}-${__threadNum}-${__Random(1,1000000)}", + "visibility": "4", + "type_id": "virtual", + "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" + } + } + ] + } + }</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> - </collectionProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_virtual_product_with_extensible_data_objects.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> + <stringProp name="VAR">virtual_product_id</stringProp> + <stringProp name="JSONPATH">$.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product sku" enabled="true"> + <stringProp name="VAR">virtual_product_sku</stringProp> + <stringProp name="JSONPATH">$.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract stock item id" enabled="true"> + <stringProp name="VAR">virtual_stock_item_id</stringProp> + <stringProp name="JSONPATH">$.extension_attributes.stock_item.item_id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">virtual_product_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">virtual_product_sku</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert stock item id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">virtual_stock_item_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create grouped product" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_grouped_product_with_extensible_data_objects.jmx</stringProp> + </OnceOnlyController> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create grouped product with extensible data objects" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "product": { + "sku": "apsku-test-${__time()}-${__threadNum}-${__Random(1,1000000)}", + "name": "Extensible_Product_${__time()}-${__threadNum}-${__Random(1,1000000)}", + "visibility": "4", + "type_id": "grouped", + "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":false, + "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" + } + } + ] + } + }</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable product id" enabled="true"> + <stringProp name="VAR">grouped_product_id</stringProp> + <stringProp name="JSONPATH">$.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract downloadable product sku" enabled="true"> + <stringProp name="VAR">grouped_product_sku</stringProp> + <stringProp name="JSONPATH">$.sku</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">grouped_product_id</stringProp> + </ResponseAssertion> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert product sku not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">grouped_product_sku</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Create Links" enabled="true"/> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API - Create child bundle, configurable, simple, downloadable, for grouped" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "items": [ + { + "sku": "${grouped_product_sku}", + "link_type": "associated", + "linked_product_sku": "${bundle_product_sku}", + "linked_product_type": "bundle", + "position": 1, + "extension_attributes": { + "qty": 1 + } + }, + { + "sku": "${grouped_product_sku}", + "link_type": "associated", + "linked_product_sku": "${configurable_product_sku}", + "linked_product_type": "configurable", + "position": 2, + "extension_attributes": { + "qty": 1 + } + }, + { + "sku": "${grouped_product_sku}", + "link_type": "associated", + "linked_product_sku": "${simple_product_sku}", + "linked_product_type": "simple", + "position": 3, + "extension_attributes": { + "qty": 1 + } + }, + { + "sku": "${grouped_product_sku}", + "link_type": "associated", + "linked_product_sku": "${downloadable_product_sku}", + "linked_product_type": "downloadable", + "position": 4, + "extension_attributes": { + "qty": 1 + } + } + ] + } + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/products/${grouped_product_sku}/links</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract product id" enabled="true"> + <stringProp name="VAR">grouped_product_response</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert add true" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="3569038">true</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">8</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">grouped_product_response</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + + <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Graphql Query Controller" enabled="true"> + <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> +</GenericController> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/customer/index/save/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - </HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer saved" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="292987815">You saved the customer.</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">*/*</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager_before_token.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Admin Token Retrieval" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"username":"${admin_user}","password":"${admin_password}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> + <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/V1/integration/admin/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/admin_token_retrieval.jmx</stringProp></HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="jp@gc - JSON Path Extractor" enabled="true"> + <stringProp name="VAR">admin_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert token not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="484395188">^[a-z0-9-]+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">admin_token</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Authorization</stringProp> + <stringProp name="Header.value">Bearer ${admin_token}</stringProp> + </elementProp> + </collectionProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/header_manager.jmx</stringProp></HeaderManager> + <hashTree/> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query multiple products" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_filter_only.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_multiple_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 200" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } + } + </stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query simple product" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_simple_product_with_extensible_data_objects.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_simple_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract response" enabled="true"> + <stringProp name="VAR">graphql_multiple_products_query_response</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - </hashTree> - <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Pause" enabled="true"> - <intProp name="ActionProcessor.action">1</intProp> - <intProp name="ActionProcessor.target">0</intProp> - <stringProp name="ActionProcessor.duration">${__javaScript(Math.round(${adminCustomerManagementDelay}*1000))}</stringProp> - </TestAction> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert product sku" enabled="true"> + <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE">${simple_product_sku}</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query configurable product" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_configurable_product_with_extensible_data_objects.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_configurable_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert configurable product sku" enabled="true"> + <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE">${configurable_product_sku}</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query products with full text search and filter" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count_fulltext_filter</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_pages" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_pages_fulltext_filter</stringProp> + <stringProp name="JSONPATH">$.data.products.page_info.total_pages</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query products with full text search and filter last page" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter_last_page.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count_fulltext_filter</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> <hashTree/> </hashTree> - </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query products with full text search only" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - </hashTree> - </hashTree> - - - <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="[C] Admin Edit Order" enabled="true"> - <intProp name="ThroughputController.style">1</intProp> - <boolProp name="ThroughputController.perThread">false</boolProp> - <intProp name="ThroughputController.maxThroughput">1</intProp> - <stringProp name="ThroughputController.percentThroughput">${cAdminEditOrderPercentage}</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/scenario_controller_tmpl.jmx</stringProp></ThroughputController> - <hashTree> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Test Label" enabled="true"> - <stringProp name="script"> -var tmpLabel = vars.get("testLabel") -if (tmpLabel) { - var testLabel = " (" + tmpLabel + ")" - if (sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy') { - if (sampler.getName().indexOf(testLabel) == -1) { - sampler.setName(sampler.getName() + testLabel); - } - } else if (sampler.getName().indexOf("SetUp - ") == -1) { - sampler.setName("SetUp - " + sampler.getName()); - } - } else { - testLabel = "" - } - - - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/_system/setup_label.jmx</stringProp></JSR223PreProcessor> - <hashTree/> - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Set Label" enabled="true"> - <stringProp name="BeanShellSampler.query"> - vars.put("testLabel", "[C] Admin Edit Order"); - </stringProp> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - - <JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Get admin form key PostProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin/handle_admin_form_key.jmx</stringProp></JSR223PostProcessor> - <hashTree/> - <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set admin form key PreProcessor" enabled="true"> - <stringProp name="script"> - 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); - } - } - } - </stringProp> - <stringProp name="scriptLanguage">javascript</stringProp> - </JSR223PreProcessor> - <hashTree/> - - <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true"> - <collectionProp name="CookieManager.cookies"/> - <boolProp name="CookieManager.clearEachIteration">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx</stringProp></CookieManager> - <hashTree/> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Admin Login" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <CriticalSectionController guiclass="CriticalSectionControllerGui" testclass="CriticalSectionController" testname="Admin Login Lock" enabled="true"> - <stringProp name="CriticalSectionController.lockName">get-admin-email</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/lock_controller.jmx</stringProp></CriticalSectionController> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_only.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Get Admin Email" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/get_admin_email.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> -adminUser = "none"; -adminUserList = props.get("adminUserList"); -adminUserListIterator = props.get("adminUserListIterator"); -adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">String totalCount=vars.get("graphql_search_products_query_total_count"); -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); +if (totalCount == null) { + Failure = true; + FailureMessage = "Not Expected \"totalCount\" to be null"; } else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); + if (Integer.parseInt(totalCount) < 1) { + Failure = true; + FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; + } else { + Failure = false; + } } -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); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">true</boolProp> - </BeanShellSampler> - <hashTree/> - </hashTree> + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query products with full text search and filters" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filters.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert login form shown" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1397214398">Welcome</stringProp> - <stringProp name="-515240035"><title>Magento Admin</title></stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - </RegexExtractor> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> <hashTree/> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert form_key extracted" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2845929">^.+$</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">1</intProp> - <stringProp name="Assertion.scope">variable</stringProp> - <stringProp name="Scope.variable">admin_form_key</stringProp> - </ResponseAssertion> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query products with full text search and aggregations" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_aggregations.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } + } + </stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Login Submit Form" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="dummy" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">dummy</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="login[password]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_password}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[password]</stringProp> - </elementProp> - <elementProp name="login[username]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_user}</stringProp> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query bundle product" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"{\nproducts(filter: {sku: {eq:\"${bundle_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 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 BundleProduct {\n weight\n price_view\n dynamic_price\n dynamic_sku\n ship_bundle_items\n dynamic_weight\n items {\n option_id\n title\n required\n type\n position\n sku\n options {\n id\n qty\n position\n is_default\n price\n price_type\n can_change_quantity\n product {\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 }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_bundle_product_with_extensible_data_objects.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_bundle_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> + <stringProp name="BeanShellAssertion.query">String totalCount=vars.get("graphql_bundle_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; + } + } + + + </stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert bundle product sku" enabled="true"> + <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE">${bundle_product_sku}</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query downloadable product" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: { eq: \"${downloadable_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 ... on DownloadableProduct {\n links_purchased_separately\n links_title\n downloadable_product_samples {\n id\n title\n sort_order\n sample_type\n sample_file\n sample_url\n }\n downloadable_product_links {\n id\n title\n sort_order\n is_shareable\n price\n number_of_downloads\n link_type\n sample_type\n sample_file\n sample_url\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_downloadable_product_with_extensible_data_objects.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_downloadable_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> + <stringProp name="BeanShellAssertion.query">String totalCount=vars.get("graphql_downloadable_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; + } + } + + + </stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert downloadable product sku" enabled="true"> + <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE">${downloadable_product_sku}</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert link samples titles" enabled="true"> + <stringProp name="JSON_PATH">$.data.products.items[0].downloadable_product_samples..title</stringProp> + <stringProp name="EXPECTED_VALUE">["sample1","sample2"]</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert sample titles" enabled="true"> + <stringProp name="JSON_PATH">$.data.products.items[0].downloadable_product_samples..title</stringProp> + <stringProp name="EXPECTED_VALUE">["sample1","sample2"]</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query virtual product" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"{\n products(filter: {sku: { eq: \"${virtual_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}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">login[username]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/dashboard/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <stringProp name="HTTPSampler.implementation">Java</stringProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_login_submit_form.jmx</stringProp> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_virtual_product_with_extensible_data_objects.jmx</stringProp> </HTTPSamplerProxy> <hashTree> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract form key" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">admin_form_key</stringProp> - <stringProp name="RegexExtractor.regex"><input name="form_key" type="hidden" value="([^'"]+)" /></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx</stringProp></RegexExtractor> - <hashTree/> - </hashTree> - </hashTree> - - <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Simple Controller" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/simple_controller.jmx</stringProp> -</GenericController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Orders page" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/orders_page.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1204796042">Create New Order</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Orders" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">sales_order_grid</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - </elementProp> - <elementProp name="search" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">200</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">increment_id</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">desc</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="filters[status]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">pending</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[status]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_orders.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1637639774">totalRecords</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Search Pending Orders" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - </elementProp> - <elementProp name="namespace" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">sales_order_grid</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">namespace</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="search" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value"/> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">search</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="filters[placeholder]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[placeholder]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[pageSize]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">200</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[pageSize]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="paging[current]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">paging[current]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="sorting[field]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">increment_id</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[field]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="sorting[direction]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">asc</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">sorting[direction]</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - <stringProp name="Argument.desc">true</stringProp> - </elementProp> - <elementProp name="filters[status]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">pending</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">filters[status]</stringProp> - </elementProp> - <elementProp name="_" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${__time()}${__Random(1,1000000)}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">_</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/mui/index/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/search_orders.jmx</stringProp></HTTPSamplerProxy> -<hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1637639774">totalRecords</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_virtual_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order numbers" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_numbers</stringProp> - <stringProp name="RegexExtractor.regex">\"increment_id\":\"(\d+)\"\,</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> + <stringProp name="BeanShellAssertion.query">String totalCount=vars.get("graphql_virtual_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; + } +} +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order ids" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_ids</stringProp> - <stringProp name="RegexExtractor.regex">\"entity_id\":\"(\d+)\"\,</stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert product sku" enabled="true"> + <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE">${virtual_product_sku}</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query grouped product" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"{\nproducts(filter: {sku: {eq:\"${grouped_product_sku}\"} }, 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 GroupedProduct {\n weight\n items {\n qty\n position\n product {\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 }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_grouped_product_with_extensible_data_objects.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_grouped_products_query_total_count</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count = 1" enabled="true"> + <stringProp name="BeanShellAssertion.query">String totalCount=vars.get("graphql_grouped_products_query_total_count"); - <BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="SetUp - Generate Unique Ids for each Thread" enabled="true"> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/setup.jmx</stringProp> - <stringProp name="BeanShellSampler.query"> - import java.util.ArrayList; - import java.util.HashMap; - 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; + 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; + } + } - orderNumber = vars.get("order_numbers_" + i.toString()); - orderId = vars.get("order_ids_" + i.toString()); - vars.put("order_number", orderNumber); - vars.put("order_id", orderId); - </stringProp> - <stringProp name="BeanShellSampler.filename"/> - <stringProp name="BeanShellSampler.parameters"/> - <boolProp name="BeanShellSampler.resetInterpreter">false</boolProp> - </BeanShellSampler> - <hashTree/> + </stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert grouped product sku" enabled="true"> + <stringProp name="JSON_PATH">$.data.products.items[0].sku</stringProp> + <stringProp name="EXPECTED_VALUE">${grouped_product_sku}</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + + <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Query Customer" enabled="true"/> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create customer" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "customer": { + + "email": "customer_${__time()}-${__threadNum}-${__Random(1,1000000)}@example.com", + "firstname": "test_${__time()}-${__threadNum}-${__Random(1,1000000)}", + "lastname": "Doe" + }, + "password": "test@123" + }</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/customers</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_frontend_customer.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer id" enabled="true"> + <stringProp name="VAR">customer_id</stringProp> + <stringProp name="JSONPATH">$.id</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer id not null" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="89649215">^\d+$</stringProp> + </collectionProp> + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + <stringProp name="Assertion.scope">variable</stringProp> + <stringProp name="Scope.variable">customer_id</stringProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check customer" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/customers/${customer_id}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/check_customer.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.id</stringProp> + <stringProp name="EXPECTED_VALUE">${customer_id}</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer email" enabled="true"> + <stringProp name="VAR">customer_email</stringProp> + <stringProp name="JSONPATH">$.email</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create customer token" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{ + "username":"${customer_email}", + "password":"test@123" + } + </stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}rest/default/V1/integration/customer/token</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/api/create_customer.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract customer token" enabled="true"> + <stringProp name="VAR">customer_token</stringProp> + <stringProp name="JSONPATH">$</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query customer with token" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_frontend_customer.jmx</stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Customer Token" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"/> + <stringProp name="filename"/> + <stringProp name="script">import org.apache.jmeter.protocol.http.control.Header; - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Open Order" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/view/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/open_order.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="2103620713">#${order_number}</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract order status" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">order_status</stringProp> - <stringProp name="RegexExtractor.regex"><span id="order_status">([^<]+)</span></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> + sampler.getHeaderManager().removeHeaderNamed("Authorization"); - <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true"> - <stringProp name="IfController.condition">"${order_status}" == "Pending"</stringProp> - <boolProp name="IfController.evaluateAll">false</boolProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/if_controller.jmx</stringProp></IfController> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Add Comment" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token")));</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="Assert customer lastname" enabled="true"> + <stringProp name="JSON_PATH">$.data.customer.lastname</stringProp> + <stringProp name="EXPECTED_VALUE">Doe</stringProp> + <boolProp name="JSONVALIDATION">true</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">true</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> + <hashTree/> + </hashTree> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query Category" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="history[status]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">pending</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">history[status]</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="history[comment]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Some text</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">history[comment]</stringProp> - </elementProp> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order/addComment/order_id/${order_id}/?isAjax=true</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -71734,193 +121091,116 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/add_comment.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_root_category.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-2089278331">Not Notified</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_category_query_name</stringProp> + <stringProp name="JSONPATH">$.data.category.name</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="BeanShell Assertion" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Start" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_start.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-1233850814">Invoice Totals</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract ordered items ids" enabled="true"> - <stringProp name="RegexExtractor.useHeaders">false</stringProp> - <stringProp name="RegexExtractor.refname">item_ids</stringProp> - <stringProp name="RegexExtractor.regex"><div id="order_item_(\d+)_title"\s*class="product-title"></stringProp> - <stringProp name="RegexExtractor.template">$1$</stringProp> - <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">-1</stringProp> - <stringProp name="Scope.variable">simple_products</stringProp> - </RegexExtractor> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Invoice Submit" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="invoice[items][${item_ids_1}]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">invoice[items][${item_ids_1}]</stringProp> - </elementProp> - <elementProp name="invoice[items][${item_ids_2}]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">invoice[items][${item_ids_2}]</stringProp> - </elementProp> - <elementProp name="invoice[comment_text]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Invoiced</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">invoice[comment_text]</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">POST</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="1740524604">The invoice has been created</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Start" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query CategoryList" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"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}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/start/order_id/${order_id}/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.use_keepalive">true</boolProp> <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_start.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/query_root_category_list.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="304100442">New Shipment</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_categoryList_query_name</stringProp> + <stringProp name="JSONPATH">$.data.categoryList[0].name</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + <stringProp name="INPUT_FORMAT">JSON</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="BeanShell Assertion" enabled="true"> + <stringProp name="BeanShellAssertion.query">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; + } +} +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> <hashTree/> </hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Shipment Submit" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get Cms Page by id" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> <collectionProp name="Arguments.arguments"> - <elementProp name="form_key" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">${admin_form_key}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">form_key</stringProp> - <stringProp name="Argument.desc">false</stringProp> - </elementProp> - <elementProp name="shipment[items][${item_ids_1}]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">shipment[items][${item_ids_1}]</stringProp> - </elementProp> - <elementProp name="shipment[items][${item_ids_2}]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">1</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">shipment[items][${item_ids_2}]</stringProp> - </elementProp> - <elementProp name="shipment[comment_text]" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">Shipped</stringProp> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value"> + {"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"} + </stringProp> <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">shipment[comment_text]</stringProp> </elementProp> </collectionProp> </elementProp> <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.port">${graphql_port_number}</stringProp> <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> <stringProp name="HTTPSampler.response_timeout">200000</stringProp> <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/</stringProp> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> <stringProp name="HTTPSampler.method">POST</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -71928,56 +121208,19 @@ vars.put("admin_user", adminUser); <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> <boolProp name="HTTPSampler.monitor">false</boolProp> <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/admin_edit_order/shipment_submit.jmx</stringProp></HTTPSamplerProxy> + <stringProp name="TestPlan.comments">tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx</stringProp></HTTPSamplerProxy> <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="-2089453199">The shipment has been created</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.gui.JSONPathAssertionGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion" testname="jp@gc - JSON Path Assertion" enabled="true"> + <stringProp name="JSON_PATH">$.data.cmsPage.url_key</stringProp> + <stringProp name="EXPECTED_VALUE">${cms_page_id}</stringProp> + <boolProp name="JSONVALIDATION">false</boolProp> + <boolProp name="EXPECT_NULL">false</boolProp> + <boolProp name="INVERT">false</boolProp> + <boolProp name="ISREGEX">false</boolProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathassertion.JSONPathAssertion> <hashTree/> </hashTree> </hashTree> - </hashTree> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Logout" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"/> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}${admin_path}/admin/auth/logout/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">tool/fragments/ce/setup/admin_logout.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - - <BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="Return Admin to Pool" enabled="true"> - <boolProp name="resetInterpreter">false</boolProp> - <stringProp name="parameters"/> - <stringProp name="filename"/> - <stringProp name="script"> - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - </stringProp> - <stringProp name="TestPlan.comments">tool/fragments/ce/common/return_admin_email_to_pool.jmx</stringProp></BeanShellPostProcessor> - <hashTree/> - </hashTree> </hashTree> </hashTree> diff --git a/setup/pub/angular-clickout/angular-clickout.js b/setup/pub/angular-clickout/angular-clickout.js deleted file mode 100644 index 36317edc7a4ea..0000000000000 --- a/setup/pub/angular-clickout/angular-clickout.js +++ /dev/null @@ -1,25 +0,0 @@ -/*! Angular clickout v1.0.2 | © 2014 Greg Bergé | License MIT */ -(function (window, angular, undefined) { 'use strict'; - - /** - * Click out directive. - * Execute an angular expression when we click out of the current element. - */ - - angular.module('clickOut', []) - .directive('clickOut', ['$window', '$parse', function ($window, $parse) { - return { - restrict: 'A', - link: function (scope, element, attrs) { - var clickOutHandler = $parse(attrs.clickOut); - - angular.element($window).on('click', function (event) { - if (element[0].contains(event.target)) return; - clickOutHandler(scope, {$event: event}); - scope.$apply(); - }); - } - }; - }]); - -}(window, window.angular)); diff --git a/setup/pub/angular-clickout/angular-clickout.min.js b/setup/pub/angular-clickout/angular-clickout.min.js deleted file mode 100644 index 093193c46538a..0000000000000 --- a/setup/pub/angular-clickout/angular-clickout.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Angular clickout v1.0.2 | © 2014 Greg Bergé | License MIT */ -!function(a,b,c){"use strict";b.module("clickOut",[]).directive("clickOut",["$window","$parse",function(a,c){return{restrict:"A",link:function(d,e,f){var g=c(f.clickOut);b.element(a).on("click",function(a){e[0].contains(a.target)||(g(d,{$event:a}),d.$apply())})}}}])}(window,window.angular); -//# sourceMappingURL=angular-clickout.min.js.map \ No newline at end of file diff --git a/setup/pub/angular-clickout/angular-clickout.min.js.map b/setup/pub/angular-clickout/angular-clickout.min.js.map deleted file mode 100644 index 70c6dfb1c9e4f..0000000000000 --- a/setup/pub/angular-clickout/angular-clickout.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"angular-clickout.min.js","sources":["angular-clickout.js"],"names":["window","angular","undefined","module","directive","$window","$parse","restrict","link","scope","element","attrs","clickOutHandler","clickOut","on","event","contains","target","$event","$apply"],"mappings":";CACC,SAAUA,EAAQC,EAASC,GAAa,YAOvCD,GAAQE,OAAO,eACdC,UAAU,YAAa,UAAW,SAAU,SAAUC,EAASC,GAC9D,OACEC,SAAU,IACVC,KAAM,SAAUC,EAAOC,EAASC,GAC9B,GAAIC,GAAkBN,EAAOK,EAAME,SAEnCZ,GAAQS,QAAQL,GAASS,GAAG,QAAS,SAAUC,GACzCL,EAAQ,GAAGM,SAASD,EAAME,UAC9BL,EAAgBH,GAAQS,OAAQH,IAChCN,EAAMU,kBAMdnB,OAAQA,OAAOC"} \ No newline at end of file diff --git a/setup/pub/angular-ng-dialog/angular-ng-dialog.min.js b/setup/pub/angular-ng-dialog/angular-ng-dialog.min.js deleted file mode 100644 index 07c3f3b95ddf4..0000000000000 --- a/setup/pub/angular-ng-dialog/angular-ng-dialog.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! ng-dialog - v0.4.0 (https://github.com/likeastore/ngDialog) */ -!function(a,b){"undefined"!=typeof module&&module.exports?module.exports=b(require("angular")):"function"==typeof define&&define.amd?define(["angular"],b):b(a.angular)}(this,function(a){"use strict";var b=a.module("ngDialog",[]),c=a.element,d=a.isDefined,e=(document.body||document.documentElement).style,f=d(e.animation)||d(e.WebkitAnimation)||d(e.MozAnimation)||d(e.MsAnimation)||d(e.OAnimation),g="animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",h="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]",i="ngdialog-disabled-animation",j=!1,k={},l=[],m=!1;return b.provider("ngDialog",function(){var b=this.defaults={className:"ngdialog-theme-default",disableAnimation:!1,plain:!1,showClose:!0,closeByDocument:!0,closeByEscape:!0,closeByNavigation:!1,appendTo:!1,preCloseCallback:!1,overlay:!0,cache:!0,trapFocus:!0,preserveFocus:!0,ariaAuto:!0,ariaRole:null,ariaLabelledById:null,ariaLabelledBySelector:null,ariaDescribedById:null,ariaDescribedBySelector:null};this.setForceBodyReload=function(a){j=a||!1},this.setDefaults=function(c){a.extend(b,c)};var d,e=0,n=0,o={};this.$get=["$document","$templateCache","$compile","$q","$http","$rootScope","$timeout","$window","$controller","$injector",function(p,q,r,s,t,u,v,w,x,y){var z=p.find("body");if(j){var A=B.getRouterLocationEventName();u.$on(A,function(){z=p.find("body")})}var B={onDocumentKeydown:function(a){27===a.keyCode&&C.close("$escape")},activate:function(a){var b=a.data("$ngDialogOptions");b.trapFocus&&(a.on("keydown",B.onTrapFocusKeydown),z.on("keydown",B.onTrapFocusKeydown))},deactivate:function(a){a.off("keydown",B.onTrapFocusKeydown),z.off("keydown",B.onTrapFocusKeydown)},deactivateAll:function(){a.forEach(function(b){var c=a.element(b);B.deactivate(c)})},setBodyPadding:function(a){var b=parseInt(z.css("padding-right")||0,10);z.css("padding-right",b+a+"px"),z.data("ng-dialog-original-padding",b)},resetBodyPadding:function(){var a=z.data("ng-dialog-original-padding");a?z.css("padding-right",a+"px"):z.css("padding-right","")},performCloseDialog:function(a,b){var c=a.data("$ngDialogOptions"),e=a.attr("id"),h=k[e];if(h){if("undefined"!=typeof w.Hammer){var i=h.hammerTime;i.off("tap",d),i.destroy&&i.destroy(),delete h.hammerTime}else a.unbind("click");1===n&&z.unbind("keydown"),a.hasClass("ngdialog-closing")||(n-=1);var j=a.data("$ngDialogPreviousFocus");j&&j.focus(),u.$broadcast("ngDialog.closing",a,b),n=0>n?0:n,f&&!c.disableAnimation?(h.$destroy(),a.unbind(g).bind(g,function(){a.remove(),0===n&&(z.removeClass("ngdialog-open"),B.resetBodyPadding()),u.$broadcast("ngDialog.closed",a,b)}).addClass("ngdialog-closing")):(h.$destroy(),a.remove(),0===n&&(z.removeClass("ngdialog-open"),B.resetBodyPadding()),u.$broadcast("ngDialog.closed",a,b)),o[e]&&(o[e].resolve({id:e,value:b,$dialog:a,remainingDialogs:n}),delete o[e]),k[e]&&delete k[e],l.splice(l.indexOf(e),1),l.length||(z.unbind("keydown",B.onDocumentKeydown),m=!1)}},closeDialog:function(b,c){var d=b.data("$ngDialogPreCloseCallback");if(d&&a.isFunction(d)){var e=d.call(b,c);a.isObject(e)?e.closePromise?e.closePromise.then(function(){B.performCloseDialog(b,c)}):e.then(function(){B.performCloseDialog(b,c)},function(){}):e!==!1&&B.performCloseDialog(b,c)}else B.performCloseDialog(b,c)},onTrapFocusKeydown:function(b){var c,d=a.element(b.currentTarget);if(d.hasClass("ngdialog"))c=d;else if(c=B.getActiveDialog(),null===c)return;var e=9===b.keyCode,f=b.shiftKey===!0;e&&B.handleTab(c,b,f)},handleTab:function(a,b,c){var d=B.getFocusableElements(a);if(0===d.length)return void(document.activeElement&&document.activeElement.blur());var e=document.activeElement,f=Array.prototype.indexOf.call(d,e),g=-1===f,h=0===f,i=f===d.length-1,j=!1;c?(g||h)&&(d[d.length-1].focus(),j=!0):(g||i)&&(d[0].focus(),j=!0),j&&(b.preventDefault(),b.stopPropagation())},autoFocus:function(a){var b=a[0],d=b.querySelector("*[autofocus]");if(null===d||(d.focus(),document.activeElement!==d)){var e=B.getFocusableElements(a);if(e.length>0)return void e[0].focus();var f=B.filterVisibleElements(b.querySelectorAll("h1,h2,h3,h4,h5,h6,p,span"));if(f.length>0){var g=f[0];c(g).attr("tabindex","-1").css("outline","0"),g.focus()}}},getFocusableElements:function(a){var b=a[0],c=b.querySelectorAll(h);return B.filterVisibleElements(c)},filterVisibleElements:function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];(d.offsetWidth>0||d.offsetHeight>0)&&b.push(d)}return b},getActiveDialog:function(){var a=document.querySelectorAll(".ngdialog");return 0===a.length?null:c(a[a.length-1])},applyAriaAttributes:function(a,b){if(b.ariaAuto){if(!b.ariaRole){var c=B.getFocusableElements(a).length>0?"dialog":"alertdialog";b.ariaRole=c}b.ariaLabelledBySelector||(b.ariaLabelledBySelector="h1,h2,h3,h4,h5,h6"),b.ariaDescribedBySelector||(b.ariaDescribedBySelector="article,section,p")}b.ariaRole&&a.attr("role",b.ariaRole),B.applyAriaAttribute(a,"aria-labelledby",b.ariaLabelledById,b.ariaLabelledBySelector),B.applyAriaAttribute(a,"aria-describedby",b.ariaDescribedById,b.ariaDescribedBySelector)},applyAriaAttribute:function(a,b,d,e){if(d&&a.attr(b,d),e){var f=a.attr("id"),g=a[0].querySelector(e);if(!g)return;var h=f+"-"+b;return c(g).attr("id",h),a.attr(b,h),h}},detectUIRouter:function(){try{return a.module("ui.router"),!0}catch(b){return!1}},getRouterLocationEventName:function(){return B.detectUIRouter()?"$stateChangeSuccess":"$locationChangeSuccess"}},C={open:function(f){function g(a,b){return u.$broadcast("ngDialog.templateLoading",a),t.get(a,b||{}).then(function(b){return u.$broadcast("ngDialog.templateLoaded",a),b.data||""})}function h(b){return b?a.isString(b)&&j.plain?b:"boolean"!=typeof j.cache||j.cache?g(b,{cache:q}):g(b,{cache:!1}):"Empty template"}var j=a.copy(b),p=++e,A="ngdialog"+p;l.push(A),f=f||{},a.extend(j,f);var D;o[A]=D=s.defer();var E;k[A]=E=a.isObject(j.scope)?j.scope.$new():u.$new();var F,G,H=a.extend({},j.resolve);return a.forEach(H,function(b,c){H[c]=a.isString(b)?y.get(b):y.invoke(b,null,null,c)}),s.all({template:h(j.template||j.templateUrl),locals:s.all(H)}).then(function(b){var e=b.template,f=b.locals;if(j.showClose&&(e+='<div class="ngdialog-close"></div>'),F=c('<div id="ngdialog'+p+'" class="ngdialog"></div>'),F.html(j.overlay?'<div class="ngdialog-overlay"></div><div class="ngdialog-content" role="document">'+e+"</div>":'<div class="ngdialog-content" role="document">'+e+"</div>"),F.data("$ngDialogOptions",j),E.ngDialogId=A,j.data&&a.isString(j.data)){var g=j.data.replace(/^\s*/,"")[0];E.ngDialogData="{"===g||"["===g?a.fromJson(j.data):j.data,E.ngDialogData.ngDialogId=A}else j.data&&a.isObject(j.data)&&(E.ngDialogData=j.data,E.ngDialogData.ngDialogId=A);if(j.controller&&(a.isString(j.controller)||a.isArray(j.controller)||a.isFunction(j.controller))){var h;j.controllerAs&&a.isString(j.controllerAs)&&(h=j.controllerAs);var k=x(j.controller,a.extend(f,{$scope:E,$element:F}),null,h);F.data("$ngDialogControllerController",k)}if(j.className&&F.addClass(j.className),j.disableAnimation&&F.addClass(i),G=j.appendTo&&a.isString(j.appendTo)?a.element(document.querySelector(j.appendTo)):z,B.applyAriaAttributes(F,j),j.preCloseCallback){var l;a.isFunction(j.preCloseCallback)?l=j.preCloseCallback:a.isString(j.preCloseCallback)&&E&&(a.isFunction(E[j.preCloseCallback])?l=E[j.preCloseCallback]:E.$parent&&a.isFunction(E.$parent[j.preCloseCallback])?l=E.$parent[j.preCloseCallback]:u&&a.isFunction(u[j.preCloseCallback])&&(l=u[j.preCloseCallback])),l&&F.data("$ngDialogPreCloseCallback",l)}if(E.closeThisDialog=function(a){B.closeDialog(F,a)},v(function(){var a=document.querySelectorAll(".ngdialog");B.deactivateAll(a),r(F)(E);var b=w.innerWidth-z.prop("clientWidth");z.addClass("ngdialog-open");var c=b-(w.innerWidth-z.prop("clientWidth"));c>0&&B.setBodyPadding(c),G.append(F),B.activate(F),j.trapFocus&&B.autoFocus(F),j.name?u.$broadcast("ngDialog.opened",{dialog:F,name:j.name}):u.$broadcast("ngDialog.opened",F)}),m||(z.bind("keydown",B.onDocumentKeydown),m=!0),j.closeByNavigation){var o=B.getRouterLocationEventName();u.$on(o,function(){B.closeDialog(F)})}if(j.preserveFocus&&F.data("$ngDialogPreviousFocus",document.activeElement),d=function(a){var b=j.closeByDocument?c(a.target).hasClass("ngdialog-overlay"):!1,d=c(a.target).hasClass("ngdialog-close");(b||d)&&C.close(F.attr("id"),d?"$closeButton":"$document")},"undefined"!=typeof w.Hammer){var q=E.hammerTime=w.Hammer(F[0]);q.on("tap",d)}else F.bind("click",d);return n+=1,C}),{id:A,closePromise:D.promise,close:function(a){B.closeDialog(F,a)}}},openConfirm:function(b){var d=s.defer(),e={closeByEscape:!1,closeByDocument:!1};a.extend(e,b),e.scope=a.isObject(e.scope)?e.scope.$new():u.$new(),e.scope.confirm=function(a){d.resolve(a);var b=c(document.getElementById(f.id));B.performCloseDialog(b,a)};var f=C.open(e);return f.closePromise.then(function(a){return a?d.reject(a.value):d.reject()}),d.promise},isOpen:function(a){var b=c(document.getElementById(a));return b.length>0},close:function(a,b){var d=c(document.getElementById(a));if(d.length)B.closeDialog(d,b);else if("$escape"===a){var e=l[l.length-1];d=c(document.getElementById(e)),d.data("$ngDialogOptions").closeByEscape&&B.closeDialog(d,b)}else C.closeAll(b);return C},closeAll:function(a){for(var b=document.querySelectorAll(".ngdialog"),d=b.length-1;d>=0;d--){var e=b[d];B.closeDialog(c(e),a)}},getOpenDialogs:function(){return l},getDefaults:function(){return b}};return C}]}),b.directive("ngDialog",["ngDialog",function(b){return{restrict:"A",scope:{ngDialogScope:"="},link:function(c,d,e){d.on("click",function(d){d.preventDefault();var f=a.isDefined(c.ngDialogScope)?c.ngDialogScope:"noScope";a.isDefined(e.ngDialogClosePrevious)&&b.close(e.ngDialogClosePrevious);var g=b.getDefaults();b.open({template:e.ngDialog,className:e.ngDialogClass||g.className,controller:e.ngDialogController,controllerAs:e.ngDialogControllerAs,bindToController:e.ngDialogBindToController,scope:f,data:e.ngDialogData,showClose:"false"===e.ngDialogShowClose?!1:"true"===e.ngDialogShowClose?!0:g.showClose,closeByDocument:"false"===e.ngDialogCloseByDocument?!1:"true"===e.ngDialogCloseByDocument?!0:g.closeByDocument,closeByEscape:"false"===e.ngDialogCloseByEscape?!1:"true"===e.ngDialogCloseByEscape?!0:g.closeByEscape,overlay:"false"===e.ngDialogOverlay?!1:"true"===e.ngDialogOverlay?!0:g.overlay,preCloseCallback:e.ngDialogPreCloseCallback||g.preCloseCallback})})}}}]),b}); \ No newline at end of file diff --git a/setup/pub/angular-ng-storage/angular-ng-storage.min.js b/setup/pub/angular-ng-storage/angular-ng-storage.min.js deleted file mode 100644 index 54891ebb4087f..0000000000000 --- a/setup/pub/angular-ng-storage/angular-ng-storage.min.js +++ /dev/null @@ -1 +0,0 @@ -/*! ngstorage 0.3.10 | Copyright (c) 2016 Gias Kay Lee | MIT License */!function(a,b){"use strict";"function"==typeof define&&define.amd?define(["angular"],b):a.hasOwnProperty("angular")?b(a.angular):"object"==typeof exports&&(module.exports=b(require("angular")))}(this,function(a){"use strict";function b(a,b){var c;try{c=a[b]}catch(d){c=!1}if(c){var e="__"+Math.round(1e7*Math.random());try{a[b].setItem(e,e),a[b].removeItem(e,e)}catch(d){c=!1}}return c}function c(c){var d=b(window,c);return function(){var e="ngStorage-";this.setKeyPrefix=function(a){if("string"!=typeof a)throw new TypeError("[ngStorage] - "+c+"Provider.setKeyPrefix() expects a String.");e=a};var f=a.toJson,g=a.fromJson;this.setSerializer=function(a){if("function"!=typeof a)throw new TypeError("[ngStorage] - "+c+"Provider.setSerializer expects a function.");f=a},this.setDeserializer=function(a){if("function"!=typeof a)throw new TypeError("[ngStorage] - "+c+"Provider.setDeserializer expects a function.");g=a},this.supported=function(){return!!d},this.get=function(a){return d&&g(d.getItem(e+a))},this.set=function(a,b){return d&&d.setItem(e+a,f(b))},this.remove=function(a){d&&d.removeItem(e+a)},this.$get=["$rootScope","$window","$log","$timeout","$document",function(d,h,i,j,k){var l,m,n=e.length,o=b(h,c),p=o||(i.warn("This browser does not support Web Storage!"),{setItem:a.noop,getItem:a.noop,removeItem:a.noop}),q={$default:function(b){for(var c in b)a.isDefined(q[c])||(q[c]=a.copy(b[c]));return q.$sync(),q},$reset:function(a){for(var b in q)"$"===b[0]||delete q[b]&&p.removeItem(e+b);return q.$default(a)},$sync:function(){for(var a,b=0,c=p.length;c>b;b++)(a=p.key(b))&&e===a.slice(0,n)&&(q[a.slice(n)]=g(p.getItem(a)))},$apply:function(){var b;if(m=null,!a.equals(q,l)){b=a.copy(l),a.forEach(q,function(c,d){a.isDefined(c)&&"$"!==d[0]&&(p.setItem(e+d,f(c)),delete b[d])});for(var c in b)p.removeItem(e+c);l=a.copy(q)}},$supported:function(){return!!o}};return q.$sync(),l=a.copy(q),d.$watch(function(){m||(m=j(q.$apply,100,!1))}),h.addEventListener&&h.addEventListener("storage",function(b){if(b.key){var c=k[0];c.hasFocus&&c.hasFocus()||e!==b.key.slice(0,n)||(b.newValue?q[b.key.slice(n)]=g(b.newValue):delete q[b.key.slice(n)],l=a.copy(q),d.$apply())}}),h.addEventListener&&h.addEventListener("beforeunload",function(){q.$apply()}),q}]}}return a=a&&a.module?a:window.angular,a.module("ngStorage",[]).provider("$localStorage",c("localStorage")).provider("$sessionStorage",c("sessionStorage"))}); \ No newline at end of file diff --git a/setup/pub/angular-sanitize/angular-sanitize.js b/setup/pub/angular-sanitize/angular-sanitize.js deleted file mode 100644 index 8faa84315009f..0000000000000 --- a/setup/pub/angular-sanitize/angular-sanitize.js +++ /dev/null @@ -1,801 +0,0 @@ -/** - * @license AngularJS v1.6.9 - * (c) 2010-2018 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - var $sanitizeMinErr = angular.$$minErr('$sanitize'); - var bind; - var extend; - var forEach; - var isDefined; - var lowercase; - var noop; - var nodeContains; - var htmlParser; - var htmlSanitizeWriter; - - /** - * @ngdoc module - * @name ngSanitize - * @description - * - * The `ngSanitize` module provides functionality to sanitize HTML. - * - * See {@link ngSanitize.$sanitize `$sanitize`} for usage. - */ - - /** - * @ngdoc service - * @name $sanitize - * @kind function - * - * @description - * Sanitizes an html string by stripping all potentially dangerous tokens. - * - * The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are - * then serialized back to properly escaped html string. This means that no unsafe input can make - * it into the returned string. - * - * The whitelist for URL sanitization of attribute values is configured using the functions - * `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider - * `$compileProvider`}. - * - * The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}. - * - * @param {string} html HTML input. - * @returns {string} Sanitized HTML. - * - * @example - <example module="sanitizeExample" deps="angular-sanitize.js" name="sanitize-service"> - <file name="index.html"> - <script> - angular.module('sanitizeExample', ['ngSanitize']) - .controller('ExampleController', ['$scope', '$sce', function($scope, $sce) { - $scope.snippet = - '<p style="color:blue">an html\n' + - '<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' + - 'snippet</p>'; - $scope.deliberatelyTrustDangerousSnippet = function() { - return $sce.trustAsHtml($scope.snippet); - }; - }]); - </script> - <div ng-controller="ExampleController"> - Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea> - <table> - <tr> - <td>Directive</td> - <td>How</td> - <td>Source</td> - <td>Rendered</td> - </tr> - <tr id="bind-html-with-sanitize"> - <td>ng-bind-html</td> - <td>Automatically uses $sanitize</td> - <td><pre><div ng-bind-html="snippet"><br/></div></pre></td> - <td><div ng-bind-html="snippet"></div></td> - </tr> - <tr id="bind-html-with-trust"> - <td>ng-bind-html</td> - <td>Bypass $sanitize by explicitly trusting the dangerous value</td> - <td> - <pre><div ng-bind-html="deliberatelyTrustDangerousSnippet()"> - </div></pre> - </td> - <td><div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div></td> - </tr> - <tr id="bind-default"> - <td>ng-bind</td> - <td>Automatically escapes</td> - <td><pre><div ng-bind="snippet"><br/></div></pre></td> - <td><div ng-bind="snippet"></div></td> - </tr> - </table> - </div> - </file> - <file name="protractor.js" type="protractor"> - it('should sanitize the html snippet by default', function() { - expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')). - toBe('<p>an html\n<em>click here</em>\nsnippet</p>'); - }); - - it('should inline raw snippet if bound to a trusted value', function() { - expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')). - toBe("<p style=\"color:blue\">an html\n" + - "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + - "snippet</p>"); - }); - - it('should escape snippet without any filter', function() { - expect(element(by.css('#bind-default div')).getAttribute('innerHTML')). - toBe("<p style=\"color:blue\">an html\n" + - "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + - "snippet</p>"); - }); - - it('should update', function() { - element(by.model('snippet')).clear(); - element(by.model('snippet')).sendKeys('new <b onclick="alert(1)">text</b>'); - expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')). - toBe('new <b>text</b>'); - expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')).toBe( - 'new <b onclick="alert(1)">text</b>'); - expect(element(by.css('#bind-default div')).getAttribute('innerHTML')).toBe( - "new <b onclick=\"alert(1)\">text</b>"); - }); - </file> - </example> - */ - - - /** - * @ngdoc provider - * @name $sanitizeProvider - * @this - * - * @description - * Creates and configures {@link $sanitize} instance. - */ - function $SanitizeProvider() { - var svgEnabled = false; - - this.$get = ['$$sanitizeUri', function($$sanitizeUri) { - if (svgEnabled) { - extend(validElements, svgElements); - } - return function(html) { - var buf = []; - htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) { - return !/^unsafe:/.test($$sanitizeUri(uri, isImage)); - })); - return buf.join(''); - }; - }]; - - - /** - * @ngdoc method - * @name $sanitizeProvider#enableSvg - * @kind function - * - * @description - * Enables a subset of svg to be supported by the sanitizer. - * - * <div class="alert alert-warning"> - * <p>By enabling this setting without taking other precautions, you might expose your - * application to click-hijacking attacks. In these attacks, sanitized svg elements could be positioned - * outside of the containing element and be rendered over other elements on the page (e.g. a login - * link). Such behavior can then result in phishing incidents.</p> - * - * <p>To protect against these, explicitly setup `overflow: hidden` css rule for all potential svg - * tags within the sanitized content:</p> - * - * <br> - * - * <pre><code> - * .rootOfTheIncludedContent svg { - * overflow: hidden !important; - * } - * </code></pre> - * </div> - * - * @param {boolean=} flag Enable or disable SVG support in the sanitizer. - * @returns {boolean|ng.$sanitizeProvider} Returns the currently configured value if called - * without an argument or self for chaining otherwise. - */ - this.enableSvg = function(enableSvg) { - if (isDefined(enableSvg)) { - svgEnabled = enableSvg; - return this; - } else { - return svgEnabled; - } - }; - - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Private stuff - ////////////////////////////////////////////////////////////////////////////////////////////////// - - bind = angular.bind; - extend = angular.extend; - forEach = angular.forEach; - isDefined = angular.isDefined; - lowercase = angular.lowercase; - noop = angular.noop; - - htmlParser = htmlParserImpl; - htmlSanitizeWriter = htmlSanitizeWriterImpl; - - nodeContains = window.Node.prototype.contains || /** @this */ function(arg) { - // eslint-disable-next-line no-bitwise - return !!(this.compareDocumentPosition(arg) & 16); - }; - - // Regular Expressions for parsing tags and attributes - var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - // Match everything outside of normal chars and " (quote character) - NON_ALPHANUMERIC_REGEXP = /([^#-~ |!])/g; - - - // Good source of info about elements and attributes - // http://dev.w3.org/html5/spec/Overview.html#semantics - // http://simon.html5.org/html-elements - - // Safe Void Elements - HTML5 - // http://dev.w3.org/html5/spec/Overview.html#void-elements - var voidElements = toMap('area,br,col,hr,img,wbr'); - - // Elements that you can, intentionally, leave open (and which close themselves) - // http://dev.w3.org/html5/spec/Overview.html#optional-tags - var optionalEndTagBlockElements = toMap('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'), - optionalEndTagInlineElements = toMap('rp,rt'), - optionalEndTagElements = extend({}, - optionalEndTagInlineElements, - optionalEndTagBlockElements); - - // Safe Block Elements - HTML5 - var blockElements = extend({}, optionalEndTagBlockElements, toMap('address,article,' + - 'aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' + - 'h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul')); - - // Inline Elements - HTML5 - var inlineElements = extend({}, optionalEndTagInlineElements, toMap('a,abbr,acronym,b,' + - 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,' + - 'samp,small,span,strike,strong,sub,sup,time,tt,u,var')); - - // SVG Elements - // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements - // Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted. - // They can potentially allow for arbitrary javascript to be executed. See #11290 - var svgElements = toMap('circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,' + - 'hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,' + - 'radialGradient,rect,stop,svg,switch,text,title,tspan'); - - // Blocked Elements (will be stripped) - var blockedElements = toMap('script,style'); - - var validElements = extend({}, - voidElements, - blockElements, - inlineElements, - optionalEndTagElements); - - //Attributes that have href and hence need to be sanitized - var uriAttrs = toMap('background,cite,href,longdesc,src,xlink:href,xml:base'); - - var htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' + - 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' + - 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' + - 'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' + - 'valign,value,vspace,width'); - - // SVG attributes (without "id" and "name" attributes) - // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes - var svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' + - 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' + - 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' + - 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' + - 'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' + - 'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' + - 'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' + - 'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' + - 'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' + - 'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' + - 'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' + - 'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' + - 'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' + - 'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' + - 'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true); - - var validAttrs = extend({}, - uriAttrs, - svgAttrs, - htmlAttrs); - - function toMap(str, lowercaseKeys) { - var obj = {}, items = str.split(','), i; - for (i = 0; i < items.length; i++) { - obj[lowercaseKeys ? lowercase(items[i]) : items[i]] = true; - } - return obj; - } - - /** - * Create an inert document that contains the dirty HTML that needs sanitizing - * Depending upon browser support we use one of three strategies for doing this. - * Support: Safari 10.x -> XHR strategy - * Support: Firefox -> DomParser strategy - */ - var getInertBodyElement /* function(html: string): HTMLBodyElement */ = (function(window, document) { - var inertDocument; - if (document && document.implementation) { - inertDocument = document.implementation.createHTMLDocument('inert'); - } else { - throw $sanitizeMinErr('noinert', 'Can\'t create an inert html document'); - } - var inertBodyElement = (inertDocument.documentElement || inertDocument.getDocumentElement()).querySelector('body'); - - // Check for the Safari 10.1 bug - which allows JS to run inside the SVG G element - inertBodyElement.innerHTML = '<svg><g onload="this.parentNode.remove()"></g></svg>'; - if (!inertBodyElement.querySelector('svg')) { - return getInertBodyElement_XHR; - } else { - // Check for the Firefox bug - which prevents the inner img JS from being sanitized - inertBodyElement.innerHTML = '<svg><p><style><img src="</style><img src=x onerror=alert(1)//">'; - if (inertBodyElement.querySelector('svg img')) { - return getInertBodyElement_DOMParser; - } else { - return getInertBodyElement_InertDocument; - } - } - - function getInertBodyElement_XHR(html) { - // We add this dummy element to ensure that the rest of the content is parsed as expected - // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the `<head>` tag. - html = '<remove></remove>' + html; - try { - html = encodeURI(html); - } catch (e) { - return undefined; - } - var xhr = new window.XMLHttpRequest(); - xhr.responseType = 'document'; - xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false); - xhr.send(null); - var body = xhr.response.body; - body.firstChild.remove(); - return body; - } - - function getInertBodyElement_DOMParser(html) { - // We add this dummy element to ensure that the rest of the content is parsed as expected - // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the `<head>` tag. - html = '<remove></remove>' + html; - try { - var body = new window.DOMParser().parseFromString(html, 'text/html').body; - body.firstChild.remove(); - return body; - } catch (e) { - return undefined; - } - } - - function getInertBodyElement_InertDocument(html) { - inertBodyElement.innerHTML = html; - - // Support: IE 9-11 only - // strip custom-namespaced attributes on IE<=11 - if (document.documentMode) { - stripCustomNsAttrs(inertBodyElement); - } - - return inertBodyElement; - } - })(window, window.document); - - /** - * @example - * htmlParser(htmlString, { - * start: function(tag, attrs) {}, - * end: function(tag) {}, - * chars: function(text) {}, - * comment: function(text) {} - * }); - * - * @param {string} html string - * @param {object} handler - */ - function htmlParserImpl(html, handler) { - if (html === null || html === undefined) { - html = ''; - } else if (typeof html !== 'string') { - html = '' + html; - } - - var inertBodyElement = getInertBodyElement(html); - if (!inertBodyElement) return ''; - - //mXSS protection - var mXSSAttempts = 5; - do { - if (mXSSAttempts === 0) { - throw $sanitizeMinErr('uinput', 'Failed to sanitize html because the input is unstable'); - } - mXSSAttempts--; - - // trigger mXSS if it is going to happen by reading and writing the innerHTML - html = inertBodyElement.innerHTML; - inertBodyElement = getInertBodyElement(html); - } while (html !== inertBodyElement.innerHTML); - - var node = inertBodyElement.firstChild; - while (node) { - switch (node.nodeType) { - case 1: // ELEMENT_NODE - handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes)); - break; - case 3: // TEXT NODE - handler.chars(node.textContent); - break; - } - - var nextNode; - if (!(nextNode = node.firstChild)) { - if (node.nodeType === 1) { - handler.end(node.nodeName.toLowerCase()); - } - nextNode = getNonDescendant('nextSibling', node); - if (!nextNode) { - while (nextNode == null) { - node = getNonDescendant('parentNode', node); - if (node === inertBodyElement) break; - nextNode = getNonDescendant('nextSibling', node); - if (node.nodeType === 1) { - handler.end(node.nodeName.toLowerCase()); - } - } - } - } - node = nextNode; - } - - while ((node = inertBodyElement.firstChild)) { - inertBodyElement.removeChild(node); - } - } - - function attrToMap(attrs) { - var map = {}; - for (var i = 0, ii = attrs.length; i < ii; i++) { - var attr = attrs[i]; - map[attr.name] = attr.value; - } - return map; - } - - - /** - * Escapes all potentially dangerous characters, so that the - * resulting string can be safely inserted into attribute or - * element text. - * @param value - * @returns {string} escaped text - */ - function encodeEntities(value) { - return value. - replace(/&/g, '&'). - replace(SURROGATE_PAIR_REGEXP, function(value) { - var hi = value.charCodeAt(0); - var low = value.charCodeAt(1); - return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';'; - }). - replace(NON_ALPHANUMERIC_REGEXP, function(value) { - return '&#' + value.charCodeAt(0) + ';'; - }). - replace(/</g, '<'). - replace(/>/g, '>'); - } - - /** - * create an HTML/XML writer which writes to buffer - * @param {Array} buf use buf.join('') to get out sanitized html string - * @returns {object} in the form of { - * start: function(tag, attrs) {}, - * end: function(tag) {}, - * chars: function(text) {}, - * comment: function(text) {} - * } - */ - function htmlSanitizeWriterImpl(buf, uriValidator) { - var ignoreCurrentElement = false; - var out = bind(buf, buf.push); - return { - start: function(tag, attrs) { - tag = lowercase(tag); - if (!ignoreCurrentElement && blockedElements[tag]) { - ignoreCurrentElement = tag; - } - if (!ignoreCurrentElement && validElements[tag] === true) { - out('<'); - out(tag); - forEach(attrs, function(value, key) { - var lkey = lowercase(key); - var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background'); - if (validAttrs[lkey] === true && - (uriAttrs[lkey] !== true || uriValidator(value, isImage))) { - out(' '); - out(key); - out('="'); - out(encodeEntities(value)); - out('"'); - } - }); - out('>'); - } - }, - end: function(tag) { - tag = lowercase(tag); - if (!ignoreCurrentElement && validElements[tag] === true && voidElements[tag] !== true) { - out('</'); - out(tag); - out('>'); - } - // eslint-disable-next-line eqeqeq - if (tag == ignoreCurrentElement) { - ignoreCurrentElement = false; - } - }, - chars: function(chars) { - if (!ignoreCurrentElement) { - out(encodeEntities(chars)); - } - } - }; - } - - - /** - * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1' attribute to declare - * ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo'). This is undesirable since we don't want - * to allow any of these custom attributes. This method strips them all. - * - * @param node Root element to process - */ - function stripCustomNsAttrs(node) { - while (node) { - if (node.nodeType === window.Node.ELEMENT_NODE) { - var attrs = node.attributes; - for (var i = 0, l = attrs.length; i < l; i++) { - var attrNode = attrs[i]; - var attrName = attrNode.name.toLowerCase(); - if (attrName === 'xmlns:ns1' || attrName.lastIndexOf('ns1:', 0) === 0) { - node.removeAttributeNode(attrNode); - i--; - l--; - } - } - } - - var nextNode = node.firstChild; - if (nextNode) { - stripCustomNsAttrs(nextNode); - } - - node = getNonDescendant('nextSibling', node); - } - } - - function getNonDescendant(propName, node) { - // An element is clobbered if its `propName` property points to one of its descendants - var nextNode = node[propName]; - if (nextNode && nodeContains.call(node, nextNode)) { - throw $sanitizeMinErr('elclob', 'Failed to sanitize html because the element is clobbered: {0}', node.outerHTML || node.outerText); - } - return nextNode; - } - } - - function sanitizeText(chars) { - var buf = []; - var writer = htmlSanitizeWriter(buf, noop); - writer.chars(chars); - return buf.join(''); - } - - -// define ngSanitize module and register $sanitize service - angular.module('ngSanitize', []) - .provider('$sanitize', $SanitizeProvider) - .info({ angularVersion: '1.6.9' }); - - /** - * @ngdoc filter - * @name linky - * @kind function - * - * @description - * Finds links in text input and turns them into html links. Supports `http/https/ftp/sftp/mailto` and - * plain email address links. - * - * Requires the {@link ngSanitize `ngSanitize`} module to be installed. - * - * @param {string} text Input text. - * @param {string} [target] Window (`_blank|_self|_parent|_top`) or named frame to open links in. - * @param {object|function(url)} [attributes] Add custom attributes to the link element. - * - * Can be one of: - * - * - `object`: A map of attributes - * - `function`: Takes the url as a parameter and returns a map of attributes - * - * If the map of attributes contains a value for `target`, it overrides the value of - * the target parameter. - * - * - * @returns {string} Html-linkified and {@link $sanitize sanitized} text. - * - * @usage - <span ng-bind-html="linky_expression | linky"></span> - * - * @example - <example module="linkyExample" deps="angular-sanitize.js" name="linky-filter"> - <file name="index.html"> - <div ng-controller="ExampleController"> - Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea> - <table> - <tr> - <th>Filter</th> - <th>Source</th> - <th>Rendered</th> - </tr> - <tr id="linky-filter"> - <td>linky filter</td> - <td> - <pre><div ng-bind-html="snippet | linky"><br></div></pre> - </td> - <td> - <div ng-bind-html="snippet | linky"></div> - </td> - </tr> - <tr id="linky-target"> - <td>linky target</td> - <td> - <pre><div ng-bind-html="snippetWithSingleURL | linky:'_blank'"><br></div></pre> - </td> - <td> - <div ng-bind-html="snippetWithSingleURL | linky:'_blank'"></div> - </td> - </tr> - <tr id="linky-custom-attributes"> - <td>linky custom attributes</td> - <td> - <pre><div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}"><br></div></pre> - </td> - <td> - <div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}"></div> - </td> - </tr> - <tr id="escaped-html"> - <td>no filter</td> - <td><pre><div ng-bind="snippet"><br></div></pre></td> - <td><div ng-bind="snippet"></div></td> - </tr> - </table> - </file> - <file name="script.js"> - angular.module('linkyExample', ['ngSanitize']) - .controller('ExampleController', ['$scope', function($scope) { - $scope.snippet = - 'Pretty text with some links:\n' + - 'http://angularjs.org/,\n' + - 'mailto:us@somewhere.org,\n' + - 'another@somewhere.org,\n' + - 'and one more: ftp://127.0.0.1/.'; - $scope.snippetWithSingleURL = 'http://angularjs.org/'; - }]); - </file> - <file name="protractor.js" type="protractor"> - it('should linkify the snippet with urls', function() { - expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()). - toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' + - 'another@somewhere.org, and one more: ftp://127.0.0.1/.'); - expect(element.all(by.css('#linky-filter a')).count()).toEqual(4); - }); - - it('should not linkify snippet without the linky filter', function() { - expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()). - toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' + - 'another@somewhere.org, and one more: ftp://127.0.0.1/.'); - expect(element.all(by.css('#escaped-html a')).count()).toEqual(0); - }); - - it('should update', function() { - element(by.model('snippet')).clear(); - element(by.model('snippet')).sendKeys('new http://link.'); - expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()). - toBe('new http://link.'); - expect(element.all(by.css('#linky-filter a')).count()).toEqual(1); - expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()) - .toBe('new http://link.'); - }); - - it('should work with the target property', function() { - expect(element(by.id('linky-target')). - element(by.binding("snippetWithSingleURL | linky:'_blank'")).getText()). - toBe('http://angularjs.org/'); - expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank'); - }); - - it('should optionally add custom attributes', function() { - expect(element(by.id('linky-custom-attributes')). - element(by.binding("snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}")).getText()). - toBe('http://angularjs.org/'); - expect(element(by.css('#linky-custom-attributes a')).getAttribute('rel')).toEqual('nofollow'); - }); - </file> - </example> - */ - angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) { - var LINKY_URL_REGEXP = - /((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i, - MAILTO_REGEXP = /^mailto:/i; - - var linkyMinErr = angular.$$minErr('linky'); - var isDefined = angular.isDefined; - var isFunction = angular.isFunction; - var isObject = angular.isObject; - var isString = angular.isString; - - return function(text, target, attributes) { - if (text == null || text === '') return text; - if (!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', text); - - var attributesFn = - isFunction(attributes) ? attributes : - isObject(attributes) ? function getAttributesObject() {return attributes;} : - function getEmptyAttributesObject() {return {};}; - - var match; - var raw = text; - var html = []; - var url; - var i; - while ((match = raw.match(LINKY_URL_REGEXP))) { - // We can not end in these as they are sometimes found at the end of the sentence - url = match[0]; - // if we did not match ftp/http/www/mailto then assume mailto - if (!match[2] && !match[4]) { - url = (match[3] ? 'http://' : 'mailto:') + url; - } - i = match.index; - addText(raw.substr(0, i)); - addLink(url, match[0].replace(MAILTO_REGEXP, '')); - raw = raw.substring(i + match[0].length); - } - addText(raw); - return $sanitize(html.join('')); - - function addText(text) { - if (!text) { - return; - } - html.push(sanitizeText(text)); - } - - function addLink(url, text) { - var key, linkAttributes = attributesFn(url); - html.push('<a '); - - for (key in linkAttributes) { - html.push(key + '="' + linkAttributes[key] + '" '); - } - - if (isDefined(target) && !('target' in linkAttributes)) { - html.push('target="', - target, - '" '); - } - html.push('href="', - url.replace(/"/g, '"'), - '">'); - addText(text); - html.push('</a>'); - } - }; - }]); - - -})(window, window.angular); \ No newline at end of file diff --git a/setup/pub/angular-sanitize/angular-sanitize.min.js b/setup/pub/angular-sanitize/angular-sanitize.min.js deleted file mode 100644 index 991dd00987a8c..0000000000000 --- a/setup/pub/angular-sanitize/angular-sanitize.min.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - AngularJS v1.6.9 - (c) 2010-2018 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(s,d){'use strict';function J(d){var k=[];w(k,B).chars(d);return k.join("")}var x=d.$$minErr("$sanitize"),C,k,D,E,p,B,F,G,w;d.module("ngSanitize",[]).provider("$sanitize",function(){function g(a,e){var c={},b=a.split(","),f;for(f=0;f<b.length;f++)c[e?p(b[f]):b[f]]=!0;return c}function K(a){for(var e={},c=0,b=a.length;c<b;c++){var f=a[c];e[f.name]=f.value}return e}function H(a){return a.replace(/&/g,"&").replace(L,function(a){var c=a.charCodeAt(0);a=a.charCodeAt(1);return"&#"+(1024*(c- - 55296)+(a-56320)+65536)+";"}).replace(M,function(a){return"&#"+a.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}function I(a){for(;a;){if(a.nodeType===s.Node.ELEMENT_NODE)for(var e=a.attributes,c=0,b=e.length;c<b;c++){var f=e[c],h=f.name.toLowerCase();if("xmlns:ns1"===h||0===h.lastIndexOf("ns1:",0))a.removeAttributeNode(f),c--,b--}(e=a.firstChild)&&I(e);a=t("nextSibling",a)}}function t(a,e){var c=e[a];if(c&&F.call(e,c))throw x("elclob",e.outerHTML||e.outerText);return c}var y=!1;this.$get= - ["$$sanitizeUri",function(a){y&&k(n,z);return function(e){var c=[];G(e,w(c,function(b,c){return!/^unsafe:/.test(a(b,c))}));return c.join("")}}];this.enableSvg=function(a){return E(a)?(y=a,this):y};C=d.bind;k=d.extend;D=d.forEach;E=d.isDefined;p=d.lowercase;B=d.noop;G=function(a,e){null===a||void 0===a?a="":"string"!==typeof a&&(a=""+a);var c=u(a);if(!c)return"";var b=5;do{if(0===b)throw x("uinput");b--;a=c.innerHTML;c=u(a)}while(a!==c.innerHTML);for(b=c.firstChild;b;){switch(b.nodeType){case 1:e.start(b.nodeName.toLowerCase(), - K(b.attributes));break;case 3:e.chars(b.textContent)}var f;if(!(f=b.firstChild)&&(1===b.nodeType&&e.end(b.nodeName.toLowerCase()),f=t("nextSibling",b),!f))for(;null==f;){b=t("parentNode",b);if(b===c)break;f=t("nextSibling",b);1===b.nodeType&&e.end(b.nodeName.toLowerCase())}b=f}for(;b=c.firstChild;)c.removeChild(b)};w=function(a,e){var c=!1,b=C(a,a.push);return{start:function(a,h){a=p(a);!c&&A[a]&&(c=a);c||!0!==n[a]||(b("<"),b(a),D(h,function(c,h){var d=p(h),g="img"===a&&"src"===d||"background"=== - d;!0!==v[d]||!0===m[d]&&!e(c,g)||(b(" "),b(h),b('="'),b(H(c)),b('"'))}),b(">"))},end:function(a){a=p(a);c||!0!==n[a]||!0===h[a]||(b("</"),b(a),b(">"));a==c&&(c=!1)},chars:function(a){c||b(H(a))}}};F=s.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)};var L=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,M=/([^#-~ |!])/g,h=g("area,br,col,hr,img,wbr"),q=g("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),l=g("rp,rt"),r=k({},l,q),q=k({},q,g("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")), - l=k({},l,g("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),z=g("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),A=g("script,style"),n=k({},h,q,l,r),m=g("background,cite,href,longdesc,src,xlink:href,xml:base"),r=g("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"), - l=g("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan", - !0),v=k({},m,l,r),u=function(a,e){function c(b){b="<remove></remove>"+b;try{var c=(new a.DOMParser).parseFromString(b,"text/html").body;c.firstChild.remove();return c}catch(e){}}function b(a){d.innerHTML=a;e.documentMode&&I(d);return d}var h;if(e&&e.implementation)h=e.implementation.createHTMLDocument("inert");else throw x("noinert");var d=(h.documentElement||h.getDocumentElement()).querySelector("body");d.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>';return d.querySelector("svg")? - (d.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',d.querySelector("svg img")?c:b):function(b){b="<remove></remove>"+b;try{b=encodeURI(b)}catch(c){return}var e=new a.XMLHttpRequest;e.responseType="document";e.open("GET","data:text/html;charset=utf-8,"+b,!1);e.send(null);b=e.response.body;b.firstChild.remove();return b}}(s,s.document)}).info({angularVersion:"1.6.9"});d.module("ngSanitize").filter("linky",["$sanitize",function(g){var k=/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i, - p=/^mailto:/i,s=d.$$minErr("linky"),t=d.isDefined,y=d.isFunction,w=d.isObject,x=d.isString;return function(d,q,l){function r(a){a&&m.push(J(a))}function z(a,d){var c,b=A(a);m.push("<a ");for(c in b)m.push(c+'="'+b[c]+'" ');!t(q)||"target"in b||m.push('target="',q,'" ');m.push('href="',a.replace(/"/g,"""),'">');r(d);m.push("</a>")}if(null==d||""===d)return d;if(!x(d))throw s("notstring",d);for(var A=y(l)?l:w(l)?function(){return l}:function(){return{}},n=d,m=[],v,u;d=n.match(k);)v=d[0],d[2]|| -d[4]||(v=(d[3]?"http://":"mailto:")+v),u=d.index,r(n.substr(0,u)),z(v,d[0].replace(p,"")),n=n.substring(u+d[0].length);r(n);return g(m.join(""))}}])})(window,window.angular); -//# sourceMappingURL=angular-sanitize.min.js.map \ No newline at end of file diff --git a/setup/pub/angular-sanitize/angular-sanitize.min.js.map b/setup/pub/angular-sanitize/angular-sanitize.min.js.map deleted file mode 100644 index 8ce8290b2b387..0000000000000 --- a/setup/pub/angular-sanitize/angular-sanitize.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ - "version":3, - "file":"angular-sanitize.min.js", - "lineCount":16, - "mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkB,CAykB3BC,QAASA,EAAY,CAACC,CAAD,CAAQ,CAC3B,IAAIC,EAAM,EACGC,EAAAC,CAAmBF,CAAnBE,CAAwBC,CAAxBD,CACbH,MAAA,CAAaA,CAAb,CACA,OAAOC,EAAAI,KAAA,CAAS,EAAT,CAJoB,CA5jB7B,IAAIC,EAAkBR,CAAAS,SAAA,CAAiB,WAAjB,CAAtB,CACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAMIR,CANJ,CAOIS,CAPJ,CAQIC,CARJ,CASIZ,CA4jBJJ,EAAAiB,OAAA,CAAe,YAAf,CAA6B,EAA7B,CAAAC,SAAA,CACY,WADZ,CAhcAC,QAA0B,EAAG,CA4J3BC,QAASA,EAAK,CAACC,CAAD,CAAMC,CAAN,CAAqB,CAAA,IAC7BC,EAAM,EADuB,CACnBC,EAAQH,CAAAI,MAAA,CAAU,GAAV,CADW,CACKC,CACtC,KAAKA,CAAL,CAAS,CAAT,CAAYA,CAAZ,CAAgBF,CAAAG,OAAhB,CAA8BD,CAAA,EAA9B,CACEH,CAAA,CAAID,CAAA,CAAgBR,CAAA,CAAUU,CAAA,CAAME,CAAN,CAAV,CAAhB,CAAsCF,CAAA,CAAME,CAAN,CAA1C,CAAA,CAAsD,CAAA,CAExD,OAAOH,EAL0B,CAwJnCK,QAASA,EAAS,CAACC,CAAD,CAAQ,CAExB,IADA,IAAIC,EAAM,EAAV,CACSJ,EAAI,CADb,CACgBK,EAAKF,CAAAF,OAArB,CAAmCD,CAAnC,CAAuCK,CAAvC,CAA2CL,CAAA,EAA3C,CAAgD,CAC9C,IAAIM,EAAOH,CAAA,CAAMH,CAAN,CACXI,EAAA,CAAIE,CAAAC,KAAJ,CAAA,CAAiBD,CAAAE,MAF6B,CAIhD,MAAOJ,EANiB,CAiB1BK,QAASA,EAAc,CAACD,CAAD,CAAQ,CAC7B,MAAOA,EAAAE,QAAA,CACG,IADH,CACS,OADT,CAAAA,QAAA,CAEGC,CAFH,CAE0B,QAAQ,CAACH,CAAD,CAAQ,CAC7C,IAAII,EAAKJ,CAAAK,WAAA,CAAiB,CAAjB,CACLC,EAAAA,CAAMN,CAAAK,WAAA,CAAiB,CAAjB,CACV,OAAO,IAAP,EAAgC,IAAhC,EAAiBD,CAAjB;AAAsB,KAAtB,GAA0CE,CAA1C,CAAgD,KAAhD,EAA0D,KAA1D,EAAqE,GAHxB,CAF1C,CAAAJ,QAAA,CAOGK,CAPH,CAO4B,QAAQ,CAACP,CAAD,CAAQ,CAC/C,MAAO,IAAP,CAAcA,CAAAK,WAAA,CAAiB,CAAjB,CAAd,CAAoC,GADW,CAP5C,CAAAH,QAAA,CAUG,IAVH,CAUS,MAVT,CAAAA,QAAA,CAWG,IAXH,CAWS,MAXT,CADsB,CAgF/BM,QAASA,EAAkB,CAACC,CAAD,CAAO,CAChC,IAAA,CAAOA,CAAP,CAAA,CAAa,CACX,GAAIA,CAAAC,SAAJ,GAAsB7C,CAAA8C,KAAAC,aAAtB,CAEE,IADA,IAAIjB,EAAQc,CAAAI,WAAZ,CACSrB,EAAI,CADb,CACgBsB,EAAInB,CAAAF,OAApB,CAAkCD,CAAlC,CAAsCsB,CAAtC,CAAyCtB,CAAA,EAAzC,CAA8C,CAC5C,IAAIuB,EAAWpB,CAAA,CAAMH,CAAN,CAAf,CACIwB,EAAWD,CAAAhB,KAAAkB,YAAA,EACf,IAAiB,WAAjB,GAAID,CAAJ,EAAoE,CAApE,GAAgCA,CAAAE,YAAA,CAAqB,MAArB,CAA6B,CAA7B,CAAhC,CACET,CAAAU,oBAAA,CAAyBJ,CAAzB,CAEA,CADAvB,CAAA,EACA,CAAAsB,CAAA,EAN0C,CAYhD,CADIM,CACJ,CADeX,CAAAY,WACf,GACEb,CAAA,CAAmBY,CAAnB,CAGFX,EAAA,CAAOa,CAAA,CAAiB,aAAjB,CAAgCb,CAAhC,CAnBI,CADmB,CAwBlCa,QAASA,EAAgB,CAACC,CAAD,CAAWd,CAAX,CAAiB,CAExC,IAAIW,EAAWX,CAAA,CAAKc,CAAL,CACf,IAAIH,CAAJ,EAAgBvC,CAAA2C,KAAA,CAAkBf,CAAlB,CAAwBW,CAAxB,CAAhB,CACE,KAAM9C,EAAA,CAAgB,QAAhB,CAA2FmC,CAAAgB,UAA3F,EAA6GhB,CAAAiB,UAA7G,CAAN,CAEF,MAAON,EANiC,CA5a1C,IAAIO,EAAa,CAAA,CAEjB,KAAAC,KAAA;AAAY,CAAC,eAAD,CAAkB,QAAQ,CAACC,CAAD,CAAgB,CAChDF,CAAJ,EACElD,CAAA,CAAOqD,CAAP,CAAsBC,CAAtB,CAEF,OAAO,SAAQ,CAACC,CAAD,CAAO,CACpB,IAAI/D,EAAM,EACVa,EAAA,CAAWkD,CAAX,CAAiB9D,CAAA,CAAmBD,CAAnB,CAAwB,QAAQ,CAACgE,CAAD,CAAMC,CAAN,CAAe,CAC9D,MAAO,CAAC,UAAAC,KAAA,CAAgBN,CAAA,CAAcI,CAAd,CAAmBC,CAAnB,CAAhB,CADsD,CAA/C,CAAjB,CAGA,OAAOjE,EAAAI,KAAA,CAAS,EAAT,CALa,CAJ8B,CAA1C,CA4CZ,KAAA+D,UAAA,CAAiBC,QAAQ,CAACD,CAAD,CAAY,CACnC,MAAIzD,EAAA,CAAUyD,CAAV,CAAJ,EACET,CACO,CADMS,CACN,CAAA,IAFT,EAIST,CAL0B,CAarCnD,EAAA,CAAOV,CAAAU,KACPC,EAAA,CAASX,CAAAW,OACTC,EAAA,CAAUZ,CAAAY,QACVC,EAAA,CAAYb,CAAAa,UACZC,EAAA,CAAYd,CAAAc,UACZR,EAAA,CAAON,CAAAM,KAEPU,EAAA,CAsLAwD,QAAuB,CAACN,CAAD,CAAOO,CAAP,CAAgB,CACxB,IAAb,GAAIP,CAAJ,EAA8BQ,IAAAA,EAA9B,GAAqBR,CAArB,CACEA,CADF,CACS,EADT,CAE2B,QAF3B,GAEW,MAAOA,EAFlB,GAGEA,CAHF,CAGS,EAHT,CAGcA,CAHd,CAMA,KAAIS,EAAmBC,CAAA,CAAoBV,CAApB,CACvB,IAAKS,CAAAA,CAAL,CAAuB,MAAO,EAG9B,KAAIE,EAAe,CACnB,GAAG,CACD,GAAqB,CAArB,GAAIA,CAAJ,CACE,KAAMrE,EAAA,CAAgB,QAAhB,CAAN,CAEFqE,CAAA,EAGAX,EAAA,CAAOS,CAAAG,UACPH,EAAA,CAAmBC,CAAA,CAAoBV,CAApB,CARlB,CAAH,MASSA,CATT,GASkBS,CAAAG,UATlB,CAYA,KADInC,CACJ,CADWgC,CAAApB,WACX,CAAOZ,CAAP,CAAA,CAAa,CACX,OAAQA,CAAAC,SAAR,EACE,KAAK,CAAL,CACE6B,CAAAM,MAAA,CAAcpC,CAAAqC,SAAA7B,YAAA,EAAd;AAA2CvB,CAAA,CAAUe,CAAAI,WAAV,CAA3C,CACA,MACF,MAAK,CAAL,CACE0B,CAAAvE,MAAA,CAAcyC,CAAAsC,YAAd,CALJ,CASA,IAAI3B,CACJ,IAAM,EAAAA,CAAA,CAAWX,CAAAY,WAAX,CAAN,GACwB,CAIjBD,GAJDX,CAAAC,SAICU,EAHHmB,CAAAS,IAAA,CAAYvC,CAAAqC,SAAA7B,YAAA,EAAZ,CAGGG,CADLA,CACKA,CADME,CAAA,CAAiB,aAAjB,CAAgCb,CAAhC,CACNW,CAAAA,CAAAA,CALP,EAMI,IAAA,CAAmB,IAAnB,EAAOA,CAAP,CAAA,CAAyB,CACvBX,CAAA,CAAOa,CAAA,CAAiB,YAAjB,CAA+Bb,CAA/B,CACP,IAAIA,CAAJ,GAAagC,CAAb,CAA+B,KAC/BrB,EAAA,CAAWE,CAAA,CAAiB,aAAjB,CAAgCb,CAAhC,CACW,EAAtB,GAAIA,CAAAC,SAAJ,EACE6B,CAAAS,IAAA,CAAYvC,CAAAqC,SAAA7B,YAAA,EAAZ,CALqB,CAU7BR,CAAA,CAAOW,CA3BI,CA8Bb,IAAA,CAAQX,CAAR,CAAegC,CAAApB,WAAf,CAAA,CACEoB,CAAAQ,YAAA,CAA6BxC,CAA7B,CAvDmC,CArLvCvC,EAAA,CA0RAgF,QAA+B,CAACjF,CAAD,CAAMkF,CAAN,CAAoB,CACjD,IAAIC,EAAuB,CAAA,CAA3B,CACIC,EAAM7E,CAAA,CAAKP,CAAL,CAAUA,CAAAqF,KAAV,CACV,OAAO,CACLT,MAAOA,QAAQ,CAACU,CAAD,CAAM5D,CAAN,CAAa,CAC1B4D,CAAA,CAAM3E,CAAA,CAAU2E,CAAV,CACDH,EAAAA,CAAL,EAA6BI,CAAA,CAAgBD,CAAhB,CAA7B,GACEH,CADF,CACyBG,CADzB,CAGKH,EAAL,EAAoD,CAAA,CAApD,GAA6BtB,CAAA,CAAcyB,CAAd,CAA7B,GACEF,CAAA,CAAI,GAAJ,CAcA,CAbAA,CAAA,CAAIE,CAAJ,CAaA,CAZA7E,CAAA,CAAQiB,CAAR,CAAe,QAAQ,CAACK,CAAD,CAAQyD,CAAR,CAAa,CAClC,IAAIC,EAAO9E,CAAA,CAAU6E,CAAV,CAAX,CACIvB,EAAmB,KAAnBA,GAAWqB,CAAXrB,EAAqC,KAArCA,GAA4BwB,CAA5BxB,EAAyD,YAAzDA;AAAgDwB,CAC3B,EAAA,CAAzB,GAAIC,CAAA,CAAWD,CAAX,CAAJ,EACsB,CAAA,CADtB,GACGE,CAAA,CAASF,CAAT,CADH,EAC8B,CAAAP,CAAA,CAAanD,CAAb,CAAoBkC,CAApB,CAD9B,GAEEmB,CAAA,CAAI,GAAJ,CAIA,CAHAA,CAAA,CAAII,CAAJ,CAGA,CAFAJ,CAAA,CAAI,IAAJ,CAEA,CADAA,CAAA,CAAIpD,CAAA,CAAeD,CAAf,CAAJ,CACA,CAAAqD,CAAA,CAAI,GAAJ,CANF,CAHkC,CAApC,CAYA,CAAAA,CAAA,CAAI,GAAJ,CAfF,CAL0B,CADvB,CAwBLL,IAAKA,QAAQ,CAACO,CAAD,CAAM,CACjBA,CAAA,CAAM3E,CAAA,CAAU2E,CAAV,CACDH,EAAL,EAAoD,CAAA,CAApD,GAA6BtB,CAAA,CAAcyB,CAAd,CAA7B,EAAkF,CAAA,CAAlF,GAA4DM,CAAA,CAAaN,CAAb,CAA5D,GACEF,CAAA,CAAI,IAAJ,CAEA,CADAA,CAAA,CAAIE,CAAJ,CACA,CAAAF,CAAA,CAAI,GAAJ,CAHF,CAMIE,EAAJ,EAAWH,CAAX,GACEA,CADF,CACyB,CAAA,CADzB,CARiB,CAxBd,CAoCLpF,MAAOA,QAAQ,CAACA,CAAD,CAAQ,CAChBoF,CAAL,EACEC,CAAA,CAAIpD,CAAA,CAAejC,CAAf,CAAJ,CAFmB,CApClB,CAH0C,CAxRnDa,EAAA,CAAehB,CAAA8C,KAAAmD,UAAAC,SAAf,EAA8D,QAAQ,CAACC,CAAD,CAAM,CAE1E,MAAO,CAAG,EAAA,IAAAC,wBAAA,CAA6BD,CAA7B,CAAA,CAAoC,EAApC,CAFgE,CAtEjD,KA4EvB7D,EAAwB,iCA5ED,CA8EzBI,EAA0B,cA9ED,CAuFvBsD,EAAe3E,CAAA,CAAM,wBAAN,CAvFQ,CA2FvBgF,EAA8BhF,CAAA,CAAM,gDAAN,CA3FP,CA4FvBiF,EAA+BjF,CAAA,CAAM,OAAN,CA5FR,CA6FvBkF,EAAyB3F,CAAA,CAAO,EAAP,CACe0F,CADf,CAEeD,CAFf,CA7FF,CAkGvBG,EAAgB5F,CAAA,CAAO,EAAP,CAAWyF,CAAX,CAAwChF,CAAA,CAAM,qKAAN,CAAxC,CAlGO;AAuGvBoF,EAAiB7F,CAAA,CAAO,EAAP,CAAW0F,CAAX,CAAyCjF,CAAA,CAAM,2JAAN,CAAzC,CAvGM,CA+GvB6C,EAAc7C,CAAA,CAAM,wNAAN,CA/GS,CAoHvBsE,EAAkBtE,CAAA,CAAM,cAAN,CApHK,CAsHvB4C,EAAgBrD,CAAA,CAAO,EAAP,CACeoF,CADf,CAEeQ,CAFf,CAGeC,CAHf,CAIeF,CAJf,CAtHO,CA6HvBR,EAAW1E,CAAA,CAAM,uDAAN,CA7HY,CA+HvBqF,EAAYrF,CAAA,CAAM,kTAAN,CA/HW;AAuIvBsF,EAAWtF,CAAA,CAAM,guCAAN;AAcoE,CAAA,CAdpE,CAvIY,CAuJvByE,EAAalF,CAAA,CAAO,EAAP,CACemF,CADf,CAEeY,CAFf,CAGeD,CAHf,CAvJU,CA0KvB7B,EAAqE,QAAQ,CAAC7E,CAAD,CAAS4G,CAAT,CAAmB,CAyClGC,QAASA,EAA6B,CAAC1C,CAAD,CAAO,CAG3CA,CAAA,CAAO,mBAAP,CAA6BA,CAC7B,IAAI,CACF,IAAI2C,EAAOC,CAAA,IAAI/G,CAAAgH,UAAJD,iBAAA,CAAuC5C,CAAvC,CAA6C,WAA7C,CAAA2C,KACXA,EAAAtD,WAAAyD,OAAA,EACA,OAAOH,EAHL,CAIF,MAAOI,CAAP,CAAU,EAR+B,CAa7CC,QAASA,EAAiC,CAAChD,CAAD,CAAO,CAC/CS,CAAAG,UAAA,CAA6BZ,CAIzByC,EAAAQ,aAAJ,EACEzE,CAAA,CAAmBiC,CAAnB,CAGF,OAAOA,EATwC,CArDjD,IAAIyC,CACJ,IAAIT,CAAJ,EAAgBA,CAAAU,eAAhB,CACED,CAAA,CAAgBT,CAAAU,eAAAC,mBAAA,CAA2C,OAA3C,CADlB,KAGE,MAAM9G,EAAA,CAAgB,SAAhB,CAAN,CAEF,IAAImE,EAAmB4C,CAACH,CAAAI,gBAADD,EAAkCH,CAAAK,mBAAA,EAAlCF,eAAA,CAAoF,MAApF,CAGvB5C,EAAAG,UAAA,CAA6B,sDAC7B,OAAKH,EAAA4C,cAAA,CAA+B,KAA/B,CAAL;CAIE5C,CAAAG,UACA,CAD6B,kEAC7B,CAAIH,CAAA4C,cAAA,CAA+B,SAA/B,CAAJ,CACSX,CADT,CAGSM,CARX,EAYAQ,QAAgC,CAACxD,CAAD,CAAO,CAGrCA,CAAA,CAAO,mBAAP,CAA6BA,CAC7B,IAAI,CACFA,CAAA,CAAOyD,SAAA,CAAUzD,CAAV,CADL,CAEF,MAAO+C,CAAP,CAAU,CACV,MADU,CAGZ,IAAIW,EAAM,IAAI7H,CAAA8H,eACdD,EAAAE,aAAA,CAAmB,UACnBF,EAAAG,KAAA,CAAS,KAAT,CAAgB,+BAAhB,CAAkD7D,CAAlD,CAAwD,CAAA,CAAxD,CACA0D,EAAAI,KAAA,CAAS,IAAT,CACInB,EAAAA,CAAOe,CAAAK,SAAApB,KACXA,EAAAtD,WAAAyD,OAAA,EACA,OAAOH,EAf8B,CAvB2D,CAA5B,CAiErE9G,CAjEqE,CAiE7DA,CAAA4G,SAjE6D,CA1K7C,CAgc7B,CAAAuB,KAAA,CAEQ,CAAEC,eAAgB,OAAlB,CAFR,CAmIAnI,EAAAiB,OAAA,CAAe,YAAf,CAAAmH,OAAA,CAAoC,OAApC,CAA6C,CAAC,WAAD,CAAc,QAAQ,CAACC,CAAD,CAAY,CAAA,IACzEC,EACE,2FAFuE;AAGzEC,EAAgB,WAHyD,CAKzEC,EAAcxI,CAAAS,SAAA,CAAiB,OAAjB,CAL2D,CAMzEI,EAAYb,CAAAa,UAN6D,CAOzE4H,EAAazI,CAAAyI,WAP4D,CAQzEC,EAAW1I,CAAA0I,SAR8D,CASzEC,EAAW3I,CAAA2I,SAEf,OAAO,SAAQ,CAACC,CAAD,CAAOC,CAAP,CAAe9F,CAAf,CAA2B,CA6BxC+F,QAASA,EAAO,CAACF,CAAD,CAAO,CAChBA,CAAL,EAGA1E,CAAAsB,KAAA,CAAUvF,CAAA,CAAa2I,CAAb,CAAV,CAJqB,CAOvBG,QAASA,EAAO,CAACC,CAAD,CAAMJ,CAAN,CAAY,CAAA,IACtBjD,CADsB,CACjBsD,EAAiBC,CAAA,CAAaF,CAAb,CAC1B9E,EAAAsB,KAAA,CAAU,KAAV,CAEA,KAAKG,CAAL,GAAYsD,EAAZ,CACE/E,CAAAsB,KAAA,CAAUG,CAAV,CAAgB,IAAhB,CAAuBsD,CAAA,CAAetD,CAAf,CAAvB,CAA6C,IAA7C,CAGE,EAAA9E,CAAA,CAAUgI,CAAV,CAAJ,EAA2B,QAA3B,EAAuCI,EAAvC,EACE/E,CAAAsB,KAAA,CAAU,UAAV,CACUqD,CADV,CAEU,IAFV,CAIF3E,EAAAsB,KAAA,CAAU,QAAV,CACUwD,CAAA5G,QAAA,CAAY,IAAZ,CAAkB,QAAlB,CADV,CAEU,IAFV,CAGA0G,EAAA,CAAQF,CAAR,CACA1E,EAAAsB,KAAA,CAAU,MAAV,CAjB0B,CAnC5B,GAAY,IAAZ,EAAIoD,CAAJ,EAA6B,EAA7B,GAAoBA,CAApB,CAAiC,MAAOA,EACxC,IAAK,CAAAD,CAAA,CAASC,CAAT,CAAL,CAAqB,KAAMJ,EAAA,CAAY,WAAZ,CAA8DI,CAA9D,CAAN,CAYrB,IAVA,IAAIM,EACFT,CAAA,CAAW1F,CAAX,CAAA,CAAyBA,CAAzB,CACA2F,CAAA,CAAS3F,CAAT,CAAA,CAAuBoG,QAA4B,EAAG,CAAC,MAAOpG,EAAR,CAAtD,CACAqG,QAAiC,EAAG,CAAC,MAAO,EAAR,CAHtC,CAMIC,EAAMT,CANV,CAOI1E,EAAO,EAPX,CAQI8E,CARJ,CASItH,CACJ,CAAQ4H,CAAR,CAAgBD,CAAAC,MAAA,CAAUhB,CAAV,CAAhB,CAAA,CAEEU,CAQA,CARMM,CAAA,CAAM,CAAN,CAQN,CANKA,CAAA,CAAM,CAAN,CAML;AANkBA,CAAA,CAAM,CAAN,CAMlB,GALEN,CAKF,EALSM,CAAA,CAAM,CAAN,CAAA,CAAW,SAAX,CAAuB,SAKhC,EAL6CN,CAK7C,EAHAtH,CAGA,CAHI4H,CAAAC,MAGJ,CAFAT,CAAA,CAAQO,CAAAG,OAAA,CAAW,CAAX,CAAc9H,CAAd,CAAR,CAEA,CADAqH,CAAA,CAAQC,CAAR,CAAaM,CAAA,CAAM,CAAN,CAAAlH,QAAA,CAAiBmG,CAAjB,CAAgC,EAAhC,CAAb,CACA,CAAAc,CAAA,CAAMA,CAAAI,UAAA,CAAc/H,CAAd,CAAkB4H,CAAA,CAAM,CAAN,CAAA3H,OAAlB,CAERmH,EAAA,CAAQO,CAAR,CACA,OAAOhB,EAAA,CAAUnE,CAAA3D,KAAA,CAAU,EAAV,CAAV,CA3BiC,CAXmC,CAAlC,CAA7C,CArtB2B,CAA1B,CAAD,CA2xBGR,MA3xBH,CA2xBWA,MAAAC,QA3xBX;", - "sources":["angular-sanitize.js"], - "names":["window","angular","sanitizeText","chars","buf","htmlSanitizeWriter","writer","noop","join","$sanitizeMinErr","$$minErr","bind","extend","forEach","isDefined","lowercase","nodeContains","htmlParser","module","provider","$SanitizeProvider","toMap","str","lowercaseKeys","obj","items","split","i","length","attrToMap","attrs","map","ii","attr","name","value","encodeEntities","replace","SURROGATE_PAIR_REGEXP","hi","charCodeAt","low","NON_ALPHANUMERIC_REGEXP","stripCustomNsAttrs","node","nodeType","Node","ELEMENT_NODE","attributes","l","attrNode","attrName","toLowerCase","lastIndexOf","removeAttributeNode","nextNode","firstChild","getNonDescendant","propName","call","outerHTML","outerText","svgEnabled","$get","$$sanitizeUri","validElements","svgElements","html","uri","isImage","test","enableSvg","this.enableSvg","htmlParserImpl","handler","undefined","inertBodyElement","getInertBodyElement","mXSSAttempts","innerHTML","start","nodeName","textContent","end","removeChild","htmlSanitizeWriterImpl","uriValidator","ignoreCurrentElement","out","push","tag","blockedElements","key","lkey","validAttrs","uriAttrs","voidElements","prototype","contains","arg","compareDocumentPosition","optionalEndTagBlockElements","optionalEndTagInlineElements","optionalEndTagElements","blockElements","inlineElements","htmlAttrs","svgAttrs","document","getInertBodyElement_DOMParser","body","parseFromString","DOMParser","remove","e","getInertBodyElement_InertDocument","documentMode","inertDocument","implementation","createHTMLDocument","querySelector","documentElement","getDocumentElement","getInertBodyElement_XHR","encodeURI","xhr","XMLHttpRequest","responseType","open","send","response","info","angularVersion","filter","$sanitize","LINKY_URL_REGEXP","MAILTO_REGEXP","linkyMinErr","isFunction","isObject","isString","text","target","addText","addLink","url","linkAttributes","attributesFn","getAttributesObject","getEmptyAttributesObject","raw","match","index","substr","substring"] -} \ No newline at end of file diff --git a/setup/pub/angular-ui-bootstrap/angular-ui-bootstrap.min.js b/setup/pub/angular-ui-bootstrap/angular-ui-bootstrap.min.js deleted file mode 100644 index 2676e0ae9dd18..0000000000000 --- a/setup/pub/angular-ui-bootstrap/angular-ui-bootstrap.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * angular-ui-bootstrap - * http://angular-ui.github.io/bootstrap/ - - * Version: 0.11.0 - 2014-05-01 - * License: MIT - */ -angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.transition","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/day.html","template/datepicker/month.html","template/datepicker/popup.html","template/datepicker/year.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/progressbar/progressbar.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.transition",[]).factory("$transition",["$q","$timeout","$rootScope",function(a,b,c){function d(a){for(var b in a)if(void 0!==f.style[b])return a[b]}var e=function(d,f,g){g=g||{};var h=a.defer(),i=e[g.animation?"animationEndEventName":"transitionEndEventName"],j=function(){c.$apply(function(){d.unbind(i,j),h.resolve(d)})};return i&&d.bind(i,j),b(function(){angular.isString(f)?d.addClass(f):angular.isFunction(f)?f(d):angular.isObject(f)&&d.css(f),i||h.resolve(d)}),h.promise.cancel=function(){i&&d.unbind(i,j),h.reject("Transition cancelled")},h.promise},f=document.createElement("trans"),g={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},h={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return e.transitionEndEventName=d(g),e.animationEndEventName=d(h),e}]),angular.module("ui.bootstrap.collapse",["ui.bootstrap.transition"]).directive("collapse",["$transition",function(a){return{link:function(b,c,d){function e(b){function d(){j===e&&(j=void 0)}var e=a(c,b);return j&&j.cancel(),j=e,e.then(d,d),e}function f(){k?(k=!1,g()):(c.removeClass("collapse").addClass("collapsing"),e({height:c[0].scrollHeight+"px"}).then(g))}function g(){c.removeClass("collapsing"),c.addClass("collapse in"),c.css({height:"auto"})}function h(){if(k)k=!1,i(),c.css({height:0});else{c.css({height:c[0].scrollHeight+"px"});{c[0].offsetWidth}c.removeClass("collapse in").addClass("collapsing"),e({height:0}).then(i)}}function i(){c.removeClass("collapsing"),c.addClass("collapse")}var j,k=!0;b.$watch(d.collapse,function(a){a?h():f()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.$watch("isOpen",function(b){b&&d.closeOthers(a)}),a.toggleOpen=function(){a.isDisabled||(a.isOpen=!a.isOpen)}}}}).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,function(){}))}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.accordionTransclude]},function(a){a&&(b.html(""),b.append(a))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(a,b){a.closeable="close"in b}]).directive("alert",function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",function(){return function(a,b,c){b.addClass("ng-binding").data("$binding",c.bindHtmlUnsafe),a.$watch(c.bindHtmlUnsafe,function(a){b.html(a||"")})}}),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){var e=d[0],f=d[1];f.$render=function(){b.toggleClass(e.activeClass,angular.equals(f.$modelValue,a.$eval(c.btnRadio)))},b.bind(e.toggleEvent,function(){var d=b.hasClass(e.activeClass);(!d||angular.isDefined(c.uncheckable))&&a.$apply(function(){f.$setViewValue(d?null:a.$eval(c.btnRadio)),f.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){var d=a.$eval(b);return angular.isDefined(d)?d:c}var h=d[0],i=d[1];i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.bind(h.toggleEvent,function(){a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",["ui.bootstrap.transition"]).controller("CarouselController",["$scope","$timeout","$transition",function(a,b,c){function d(){e();var c=+a.interval;!isNaN(c)&&c>=0&&(g=b(f,c))}function e(){g&&(b.cancel(g),g=null)}function f(){h?(a.next(),d()):a.pause()}var g,h,i=this,j=i.slides=a.slides=[],k=-1;i.currentSlide=null;var l=!1;i.select=a.select=function(e,f){function g(){if(!l){if(i.currentSlide&&angular.isString(f)&&!a.noTransition&&e.$element){e.$element.addClass(f);{e.$element[0].offsetWidth}angular.forEach(j,function(a){angular.extend(a,{direction:"",entering:!1,leaving:!1,active:!1})}),angular.extend(e,{direction:f,active:!0,entering:!0}),angular.extend(i.currentSlide||{},{direction:f,leaving:!0}),a.$currentTransition=c(e.$element,{}),function(b,c){a.$currentTransition.then(function(){h(b,c)},function(){h(b,c)})}(e,i.currentSlide)}else h(e,i.currentSlide);i.currentSlide=e,k=m,d()}}function h(b,c){angular.extend(b,{direction:"",active:!0,leaving:!1,entering:!1}),angular.extend(c||{},{direction:"",active:!1,leaving:!1,entering:!1}),a.$currentTransition=null}var m=j.indexOf(e);void 0===f&&(f=m>k?"next":"prev"),e&&e!==i.currentSlide&&(a.$currentTransition?(a.$currentTransition.cancel(),b(g)):g())},a.$on("$destroy",function(){l=!0}),i.indexOfSlide=function(a){return j.indexOf(a)},a.next=function(){var b=(k+1)%j.length;return a.$currentTransition?void 0:i.select(j[b],"next")},a.prev=function(){var b=0>k-1?j.length-1:k-1;return a.$currentTransition?void 0:i.select(j[b],"prev")},a.isActive=function(a){return i.currentSlide===a},a.$watch("interval",d),a.$on("$destroy",e),a.play=function(){h||(h=!0,d())},a.pause=function(){a.noPause||(h=!1,e())},i.addSlide=function(b,c){b.$element=c,j.push(b),1===j.length||b.active?(i.select(j[j.length-1]),1==j.length&&a.play()):b.active=!1},i.removeSlide=function(a){var b=j.indexOf(a);j.splice(b,1),j.length>0&&a.active?i.select(b>=j.length?j[b-1]:j[b]):k>b&&k--}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"="}}}]).directive("slide",function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)}),a.$watch("active",function(b){b&&d.select(a)})}}}),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(a,b){function c(a,b,c){return 1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}this.parsers={};var d={yyyy:{regex:"\\d{4}",apply:function(a){this.year=+a}},yy:{regex:"\\d{2}",apply:function(a){this.year=+a+2e3}},y:{regex:"\\d{1,4}",apply:function(a){this.year=+a}},MMMM:{regex:a.DATETIME_FORMATS.MONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.MONTH.indexOf(b)}},MMM:{regex:a.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.SHORTMONTH.indexOf(b)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1}},M:{regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},EEEE:{regex:a.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:a.DATETIME_FORMATS.SHORTDAY.join("|")}};this.createParser=function(a){var c=[],e=a.split("");return angular.forEach(d,function(b,d){var f=a.indexOf(d);if(f>-1){a=a.split(""),e[f]="("+b.regex+")",a[f]="$";for(var g=f+1,h=f+d.length;h>g;g++)e[g]="",a[g]="$";a=a.join(""),c.push({index:f,apply:b.apply})}}),{regex:new RegExp("^"+e.join("")+"$"),map:b(c,"index")}},this.parse=function(b,d){if(!angular.isString(b))return b;d=a.DATETIME_FORMATS[d]||d,this.parsers[d]||(this.parsers[d]=this.createParser(d));var e=this.parsers[d],f=e.regex,g=e.map,h=b.match(f);if(h&&h.length){for(var i,j={year:1900,month:0,date:1,hours:0},k=1,l=h.length;l>k;k++){var m=g[k-1];m.apply&&m.apply.call(j,h[k])}return c(j.year,j.month,j.date)&&(i=new Date(j.year,j.month,j.date,j.hours)),i}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(a,b){function c(a,c){return a.currentStyle?a.currentStyle[c]:b.getComputedStyle?b.getComputedStyle(a)[c]:a.style[c]}function d(a){return"static"===(c(a,"position")||"static")}var e=function(b){for(var c=a[0],e=b.offsetParent||c;e&&e!==c&&d(e);)e=e.offsetParent;return e||c};return{position:function(b){var c=this.offset(b),d={top:0,left:0},f=e(b[0]);f!=a[0]&&(d=this.offset(angular.element(f)),d.top+=f.clientTop-f.scrollTop,d.left+=f.clientLeft-f.scrollLeft);var g=b[0].getBoundingClientRect();return{width:g.width||b.prop("offsetWidth"),height:g.height||b.prop("offsetHeight"),top:c.top-d.top,left:c.left-d.left}},offset:function(c){var d=c[0].getBoundingClientRect();return{width:d.width||c.prop("offsetWidth"),height:d.height||c.prop("offsetHeight"),top:d.top+(b.pageYOffset||a[0].documentElement.scrollTop),left:d.left+(b.pageXOffset||a[0].documentElement.scrollLeft)}},positionElements:function(a,b,c,d){var e,f,g,h,i=c.split("-"),j=i[0],k=i[1]||"center";e=d?this.offset(a):this.position(a),f=b.prop("offsetWidth"),g=b.prop("offsetHeight");var l={center:function(){return e.left+e.width/2-f/2},left:function(){return e.left},right:function(){return e.left+e.width}},m={center:function(){return e.top+e.height/2-g/2},top:function(){return e.top},bottom:function(){return e.top+e.height}};switch(j){case"right":h={top:m[k](),left:l[j]()};break;case"left":h={top:m[k](),left:e.left-f};break;case"bottom":h={top:m[j](),left:l[k]()};break;default:h={top:e.top-g,left:l[k]()}}return h}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(a,b,c,d,e,f,g,h){var i=this,j={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange"],function(c,e){i[c]=angular.isDefined(b[c])?8>e?d(b[c])(a.$parent):a.$parent.$eval(b[c]):h[c]}),angular.forEach(["minDate","maxDate"],function(d){b[d]?a.$parent.$watch(c(b[d]),function(a){i[d]=a?new Date(a):null,i.refreshView()}):i[d]=h[d]?new Date(h[d]):null}),a.datepickerMode=a.datepickerMode||h.datepickerMode,a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),this.activeDate=angular.isDefined(b.initDate)?a.$parent.$eval(b.initDate):new Date,a.isActive=function(b){return 0===i.compare(b.date,i.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(a){j=a,j.$render=function(){i.render()}},this.render=function(){if(j.$modelValue){var a=new Date(j.$modelValue),b=!isNaN(a);b?this.activeDate=a:f.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),j.$setValidity("date",b)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var a=j.$modelValue?new Date(j.$modelValue):null;j.$setValidity("date-disabled",!a||this.element&&!this.isDisabled(a))}},this.createDateObject=function(a,b){var c=j.$modelValue?new Date(j.$modelValue):null;return{date:a,label:g(a,b),selected:c&&0===this.compare(a,c),disabled:this.isDisabled(a),current:0===this.compare(a,new Date)}},this.isDisabled=function(c){return this.minDate&&this.compare(c,this.minDate)<0||this.maxDate&&this.compare(c,this.maxDate)>0||b.dateDisabled&&a.dateDisabled({date:c,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===i.minMode){var c=j.$modelValue?new Date(j.$modelValue):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),j.$setViewValue(c),j.$render()}else i.activeDate=b,a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)-1]},a.move=function(a){var b=i.activeDate.getFullYear()+a*(i.step.years||0),c=i.activeDate.getMonth()+a*(i.step.months||0);i.activeDate.setFullYear(b,c,1),i.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===i.maxMode&&1===b||a.datepickerMode===i.minMode&&-1===b||(a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)+b])},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var k=function(){e(function(){i.element[0].focus()},0,!1)};a.$on("datepicker.focus",k),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey)if(b.preventDefault(),b.stopPropagation(),"enter"===c||"space"===c){if(i.isDisabled(i.activeDate))return;a.select(i.activeDate),k()}else!b.ctrlKey||"up"!==c&&"down"!==c?(i.handleKeyDown(c,b),i.refreshView()):(a.toggleMode("up"===c?1:-1),k())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}).directive("daypicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(b,c,d,e){function f(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?i[b]:29}function g(a,b){var c=new Array(b),d=new Date(a),e=0;for(d.setHours(12);b>e;)c[e++]=new Date(d),d.setDate(d.getDate()+1);return c}function h(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}b.showWeeks=e.showWeeks,e.step={months:1},e.element=c;var i=[31,28,31,30,31,30,31,31,30,31,30,31];e._refreshView=function(){var c=e.activeDate.getFullYear(),d=e.activeDate.getMonth(),f=new Date(c,d,1),i=e.startingDay-f.getDay(),j=i>0?7-i:-i,k=new Date(f);j>0&&k.setDate(-j+1);for(var l=g(k,42),m=0;42>m;m++)l[m]=angular.extend(e.createDateObject(l[m],e.formatDay),{secondary:l[m].getMonth()!==d,uid:b.uniqueId+"-"+m});b.labels=new Array(7);for(var n=0;7>n;n++)b.labels[n]={abbr:a(l[n].date,e.formatDayHeader),full:a(l[n].date,"EEEE")};if(b.title=a(e.activeDate,e.formatDayTitle),b.rows=e.split(l,7),b.showWeeks){b.weekNumbers=[];for(var o=h(b.rows[0][0].date),p=b.rows.length;b.weekNumbers.push(o++)<p;);}},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},e.handleKeyDown=function(a){var b=e.activeDate.getDate();if("left"===a)b-=1;else if("up"===a)b-=7;else if("right"===a)b+=1;else if("down"===a)b+=7;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getMonth()+("pageup"===a?-1:1);e.activeDate.setMonth(c,1),b=Math.min(f(e.activeDate.getFullYear(),e.activeDate.getMonth()),b)}else"home"===a?b=1:"end"===a&&(b=f(e.activeDate.getFullYear(),e.activeDate.getMonth()));e.activeDate.setDate(b)},e.refreshView()}}}]).directive("monthpicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(b,c,d,e){e.step={years:1},e.element=c,e._refreshView=function(){for(var c=new Array(12),d=e.activeDate.getFullYear(),f=0;12>f;f++)c[f]=angular.extend(e.createDateObject(new Date(d,f,1),e.formatMonth),{uid:b.uniqueId+"-"+f});b.title=a(e.activeDate,e.formatMonthTitle),b.rows=e.split(c,3)},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth())-new Date(b.getFullYear(),b.getMonth())},e.handleKeyDown=function(a){var b=e.activeDate.getMonth();if("left"===a)b-=1;else if("up"===a)b-=3;else if("right"===a)b+=1;else if("down"===a)b+=3;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getFullYear()+("pageup"===a?-1:1);e.activeDate.setFullYear(c)}else"home"===a?b=0:"end"===a&&(b=11);e.activeDate.setMonth(b)},e.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(a,b,c,d){function e(a){return parseInt((a-1)/f,10)*f+1}var f=d.yearRange;d.step={years:f},d.element=b,d._refreshView=function(){for(var b=new Array(f),c=0,g=e(d.activeDate.getFullYear());f>c;c++)b[c]=angular.extend(d.createDateObject(new Date(g+c,0,1),d.formatYear),{uid:a.uniqueId+"-"+c});a.title=[b[0].label,b[f-1].label].join(" - "),a.rows=d.split(b,5)},d.compare=function(a,b){return a.getFullYear()-b.getFullYear()},d.handleKeyDown=function(a){var b=d.activeDate.getFullYear();"left"===a?b-=1:"up"===a?b-=5:"right"===a?b+=1:"down"===a?b+=5:"pageup"===a||"pagedown"===a?b+=("pageup"===a?-1:1)*d.step.years:"home"===a?b=e(d.activeDate.getFullYear()):"end"===a&&(b=e(d.activeDate.getFullYear())+f-1),d.activeDate.setFullYear(b)},d.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(a,b,c,d,e,f,g){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&"},link:function(h,i,j,k){function l(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function m(a){if(a){if(angular.isDate(a)&&!isNaN(a))return k.$setValidity("date",!0),a;if(angular.isString(a)){var b=f.parse(a,n)||new Date(a);return isNaN(b)?void k.$setValidity("date",!1):(k.$setValidity("date",!0),b)}return void k.$setValidity("date",!1)}return k.$setValidity("date",!0),null}var n,o=angular.isDefined(j.closeOnDateSelection)?h.$parent.$eval(j.closeOnDateSelection):g.closeOnDateSelection,p=angular.isDefined(j.datepickerAppendToBody)?h.$parent.$eval(j.datepickerAppendToBody):g.appendToBody;h.showButtonBar=angular.isDefined(j.showButtonBar)?h.$parent.$eval(j.showButtonBar):g.showButtonBar,h.getText=function(a){return h[a+"Text"]||g[a+"Text"]},j.$observe("datepickerPopup",function(a){n=a||g.datepickerPopup,k.$render()});var q=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");q.attr({"ng-model":"date","ng-change":"dateSelection()"});var r=angular.element(q.children()[0]);j.datepickerOptions&&angular.forEach(h.$parent.$eval(j.datepickerOptions),function(a,b){r.attr(l(b),a)}),angular.forEach(["minDate","maxDate"],function(a){j[a]&&(h.$parent.$watch(b(j[a]),function(b){h[a]=b}),r.attr(l(a),a))}),j.dateDisabled&&r.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),k.$parsers.unshift(m),h.dateSelection=function(a){angular.isDefined(a)&&(h.date=a),k.$setViewValue(h.date),k.$render(),o&&(h.isOpen=!1,i[0].focus())},i.bind("input change keyup",function(){h.$apply(function(){h.date=k.$modelValue})}),k.$render=function(){var a=k.$viewValue?e(k.$viewValue,n):"";i.val(a),h.date=m(k.$modelValue)};var s=function(a){h.isOpen&&a.target!==i[0]&&h.$apply(function(){h.isOpen=!1})},t=function(a){h.keydown(a)};i.bind("keydown",t),h.keydown=function(a){27===a.which?(a.preventDefault(),a.stopPropagation(),h.close()):40!==a.which||h.isOpen||(h.isOpen=!0)},h.$watch("isOpen",function(a){a?(h.$broadcast("datepicker.focus"),h.position=p?d.offset(i):d.position(i),h.position.top=h.position.top+i.prop("offsetHeight"),c.bind("click",s)):c.unbind("click",s)}),h.select=function(a){if("today"===a){var b=new Date;angular.isDate(k.$modelValue)?(a=new Date(k.$modelValue),a.setFullYear(b.getFullYear(),b.getMonth(),b.getDate())):a=new Date(b.setHours(0,0,0,0))}h.dateSelection(a)},h.close=function(){h.isOpen=!1,i[0].focus()};var u=a(q)(h);p?c.find("body").append(u):i.after(u),h.$on("$destroy",function(){u.remove(),i.unbind("keydown",t),c.unbind("click",s)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(a,b){b.bind("click",function(a){a.preventDefault(),a.stopPropagation()})}}}),angular.module("ui.bootstrap.dropdown",[]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document",function(a){var b=null;this.open=function(e){b||(a.bind("click",c),a.bind("keydown",d)),b&&b!==e&&(b.isOpen=!1),b=e},this.close=function(e){b===e&&(b=null,a.unbind("click",c),a.unbind("keydown",d))};var c=function(a){a&&a.isDefaultPrevented()||b.$apply(function(){b.isOpen=!1})},d=function(a){27===a.which&&(b.focusToggleElement(),c())}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate",function(a,b,c,d,e,f){var g,h=this,i=a.$new(),j=d.openClass,k=angular.noop,l=b.onToggle?c(b.onToggle):angular.noop;this.init=function(d){h.$element=d,b.isOpen&&(g=c(b.isOpen),k=g.assign,a.$watch(g,function(a){i.isOpen=!!a}))},this.toggle=function(a){return i.isOpen=arguments.length?!!a:!i.isOpen},this.isOpen=function(){return i.isOpen},i.focusToggleElement=function(){h.toggleElement&&h.toggleElement[0].focus()},i.$watch("isOpen",function(b,c){f[b?"addClass":"removeClass"](h.$element,j),b?(i.focusToggleElement(),e.open(i)):e.close(i),k(a,b),angular.isDefined(b)&&b!==c&&l(a,{open:!!b})}),a.$on("$locationChangeSuccess",function(){i.isOpen=!1}),a.$on("$destroy",function(){i.$destroy()})}]).directive("dropdown",function(){return{restrict:"CA",controller:"DropdownController",link:function(a,b,c,d){d.init(b)}}}).directive("dropdownToggle",function(){return{restrict:"CA",require:"?^dropdown",link:function(a,b,c,d){if(d){d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.transition"]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b==a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b==a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}).directive("modalBackdrop",["$timeout",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",link:function(b){b.animate=!1,a(function(){b.animate=!0})}}}]).directive("modalWindow",["$modalStack","$timeout",function(a,b){return{restrict:"EA",scope:{index:"@",animate:"="},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"template/modal/window.html"},link:function(c,d,e){d.addClass(e.windowClass||""),c.size=e.size,b(function(){c.animate=!0,d[0].focus()}),c.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!=c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))}}}}]).factory("$modalStack",["$transition","$timeout","$document","$compile","$rootScope","$$stackedMap",function(a,b,c,d,e,f){function g(){for(var a=-1,b=n.keys(),c=0;c<b.length;c++)n.get(b[c]).value.backdrop&&(a=c);return a}function h(a){var b=c.find("body").eq(0),d=n.get(a).value;n.remove(a),j(d.modalDomEl,d.modalScope,300,function(){d.modalScope.$destroy(),b.toggleClass(m,n.length()>0),i()})}function i(){if(k&&-1==g()){var a=l;j(k,l,150,function(){a.$destroy(),a=null}),k=void 0,l=void 0}}function j(c,d,e,f){function g(){g.done||(g.done=!0,c.remove(),f&&f())}d.animate=!1;var h=a.transitionEndEventName;if(h){var i=b(g,e);c.bind(h,function(){b.cancel(i),g(),d.$apply()})}else b(g,0)}var k,l,m="modal-open",n=f.createNew(),o={};return e.$watch(g,function(a){l&&(l.index=a)}),c.bind("keydown",function(a){var b;27===a.which&&(b=n.top(),b&&b.value.keyboard&&(a.preventDefault(),e.$apply(function(){o.dismiss(b.key,"escape key press")})))}),o.open=function(a,b){n.add(a,{deferred:b.deferred,modalScope:b.scope,backdrop:b.backdrop,keyboard:b.keyboard});var f=c.find("body").eq(0),h=g();h>=0&&!k&&(l=e.$new(!0),l.index=h,k=d("<div modal-backdrop></div>")(l),f.append(k));var i=angular.element("<div modal-window></div>");i.attr({"template-url":b.windowTemplateUrl,"window-class":b.windowClass,size:b.size,index:n.length()-1,animate:"animate"}).html(b.content);var j=d(i)(b.scope);n.top().value.modalDomEl=j,f.append(j),f.addClass(m)},o.close=function(a,b){var c=n.get(a).value;c&&(c.deferred.resolve(b),h(a))},o.dismiss=function(a,b){var c=n.get(a).value;c&&(c.deferred.reject(b),h(a))},o.dismissAll=function(a){for(var b=this.getTop();b;)this.dismiss(b.key,a),b=this.getTop()},o.getTop=function(){return n.top()},o}]).provider("$modal",function(){var a={options:{backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$http","$templateCache","$controller","$modalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?d.when(a.template):e.get(a.templateUrl,{cache:f}).then(function(a){return a.data})}function j(a){var c=[];return angular.forEach(a,function(a){(angular.isFunction(a)||angular.isArray(a))&&c.push(d.when(b.invoke(a)))}),c}var k={};return k.open=function(b){var e=d.defer(),f=d.defer(),k={result:e.promise,opened:f.promise,close:function(a){h.close(k,a)},dismiss:function(a){h.dismiss(k,a)}};if(b=angular.extend({},a.options,b),b.resolve=b.resolve||{},!b.template&&!b.templateUrl)throw new Error("One of template or templateUrl options is required.");var l=d.all([i(b)].concat(j(b.resolve)));return l.then(function(a){var d=(b.scope||c).$new();d.$close=k.close,d.$dismiss=k.dismiss;var f,i={},j=1;b.controller&&(i.$scope=d,i.$modalInstance=k,angular.forEach(b.resolve,function(b,c){i[c]=a[j++]}),f=g(b.controller,i)),h.open(k,{scope:d,deferred:e,content:a[0],backdrop:b.backdrop,keyboard:b.keyboard,windowClass:b.windowClass,windowTemplateUrl:b.windowTemplateUrl,size:b.size})},function(a){e.reject(a)}),l.then(function(){f.resolve(!0)},function(){f.reject(!1)}),k},k}]};return a}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(a,b,c){var d=this,e={$setViewValue:angular.noop},f=b.numPages?c(b.numPages).assign:angular.noop;this.init=function(f,g){e=f,this.config=g,e.$render=function(){d.render()},b.itemsPerPage?a.$parent.$watch(c(b.itemsPerPage),function(b){d.itemsPerPage=parseInt(b,10),a.totalPages=d.calculateTotalPages()}):this.itemsPerPage=g.itemsPerPage},this.calculateTotalPages=function(){var b=this.itemsPerPage<1?1:Math.ceil(a.totalItems/this.itemsPerPage);return Math.max(b||0,1)},this.render=function(){a.page=parseInt(e.$viewValue,10)||1},a.selectPage=function(b){a.page!==b&&b>0&&b<=a.totalPages&&(e.$setViewValue(b),e.$render())},a.getText=function(b){return a[b+"Text"]||d.config[b+"Text"]},a.noPrevious=function(){return 1===a.page},a.noNext=function(){return a.page===a.totalPages},a.$watch("totalItems",function(){a.totalPages=d.calculateTotalPages()}),a.$watch("totalPages",function(b){f(a.$parent,b),a.page>b?a.selectPage(b):e.$render()})}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(a,b){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},require:["pagination","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(c,d,e,f){function g(a,b,c){return{number:a,text:b,active:c}}function h(a,b){var c=[],d=1,e=b,f=angular.isDefined(k)&&b>k;f&&(l?(d=Math.max(a-Math.floor(k/2),1),e=d+k-1,e>b&&(e=b,d=e-k+1)):(d=(Math.ceil(a/k)-1)*k+1,e=Math.min(d+k-1,b)));for(var h=d;e>=h;h++){var i=g(h,h,h===a);c.push(i)}if(f&&!l){if(d>1){var j=g(d-1,"...",!1);c.unshift(j)}if(b>e){var m=g(e+1,"...",!1);c.push(m)}}return c}var i=f[0],j=f[1];if(j){var k=angular.isDefined(e.maxSize)?c.$parent.$eval(e.maxSize):b.maxSize,l=angular.isDefined(e.rotate)?c.$parent.$eval(e.rotate):b.rotate;c.boundaryLinks=angular.isDefined(e.boundaryLinks)?c.$parent.$eval(e.boundaryLinks):b.boundaryLinks,c.directionLinks=angular.isDefined(e.directionLinks)?c.$parent.$eval(e.directionLinks):b.directionLinks,i.init(j,b),e.maxSize&&c.$parent.$watch(a(e.maxSize),function(a){k=parseInt(a,10),i.render()});var m=i.render;i.render=function(){m(),c.page>0&&c.page<=c.totalPages&&(c.pages=h(c.page,c.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(a){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@"},require:["pager","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&(b.align=angular.isDefined(d.align)?b.$parent.$eval(d.align):a.align,f.init(g,a))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function a(a){var b=/[A-Z]/g,c="-"; - return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",animation:!0,popupDelay:0},c={mouseenter:"mouseleave",click:"click",focus:"blur"},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$parse","$document","$position","$interpolate",function(e,f,g,h,i,j,k){return function(e,l,m){function n(a){var b=a||o.trigger||m,d=c[b]||b;return{show:b,hide:d}}var o=angular.extend({},b,d),p=a(e),q=k.startSymbol(),r=k.endSymbol(),s="<div "+p+'-popup title="'+q+"tt_title"+r+'" content="'+q+"tt_content"+r+'" placement="'+q+"tt_placement"+r+'" animation="tt_animation" is-open="tt_isOpen"></div>';return{restrict:"EA",scope:!0,compile:function(){var a=f(s);return function(b,c,d){function f(){b.tt_isOpen?m():k()}function k(){(!y||b.$eval(d[l+"Enable"]))&&(b.tt_popupDelay?v||(v=g(p,b.tt_popupDelay,!1),v.then(function(a){a()})):p()())}function m(){b.$apply(function(){q()})}function p(){return v=null,u&&(g.cancel(u),u=null),b.tt_content?(r(),t.css({top:0,left:0,display:"block"}),w?i.find("body").append(t):c.after(t),z(),b.tt_isOpen=!0,b.$digest(),z):angular.noop}function q(){b.tt_isOpen=!1,g.cancel(v),v=null,b.tt_animation?u||(u=g(s,500)):s()}function r(){t&&s(),t=a(b,function(){}),b.$digest()}function s(){u=null,t&&(t.remove(),t=null)}var t,u,v,w=angular.isDefined(o.appendToBody)?o.appendToBody:!1,x=n(void 0),y=angular.isDefined(d[l+"Enable"]),z=function(){var a=j.positionElements(c,t,b.tt_placement,w);a.top+="px",a.left+="px",t.css(a)};b.tt_isOpen=!1,d.$observe(e,function(a){b.tt_content=a,!a&&b.tt_isOpen&&q()}),d.$observe(l+"Title",function(a){b.tt_title=a}),d.$observe(l+"Placement",function(a){b.tt_placement=angular.isDefined(a)?a:o.placement}),d.$observe(l+"PopupDelay",function(a){var c=parseInt(a,10);b.tt_popupDelay=isNaN(c)?o.popupDelay:c});var A=function(){c.unbind(x.show,k),c.unbind(x.hide,m)};d.$observe(l+"Trigger",function(a){A(),x=n(a),x.show===x.hide?c.bind(x.show,f):(c.bind(x.show,k),c.bind(x.hide,m))});var B=b.$eval(d[l+"Animation"]);b.tt_animation=angular.isDefined(B)?!!B:o.animation,d.$observe(l+"AppendToBody",function(a){w=angular.isDefined(a)?h(a)(b):w}),w&&b.$on("$locationChangeSuccess",function(){b.tt_isOpen&&q()}),b.$on("$destroy",function(){g.cancel(u),g.cancel(v),A(),s()})}}}}}]}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(a){return a("tooltip","tooltip","mouseenter")}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).directive("tooltipHtmlUnsafe",["$tooltip",function(a){return a("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$tooltip",function(a){return a("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig",function(a,b,c){var d=this,e=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max,this.addBar=function(b,c){e||c.css({transition:"none"}),this.bars.push(b),b.$watch("value",function(c){b.percent=+(100*c/a.max).toFixed(2)}),b.$on("$destroy",function(){c=null,d.removeBar(b)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1)}}]).directive("progress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},templateUrl:"template/progressbar/progress.html"}}).directive("bar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b)}}}).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(a,b,c){var d={$setViewValue:angular.noop};this.init=function(e){d=e,d.$render=this.render,this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff;var f=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(f)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff},a[b]);return a},a.rate=function(b){!a.readonly&&b>=0&&b<=a.range.length&&(d.$setViewValue(b),d.$render())},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue}}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(a){var b=this,c=b.tabs=a.tabs=[];b.select=function(a){angular.forEach(c,function(b){b.active&&b!==a&&(b.active=!1,b.onDeselect())}),a.active=!0,a.onSelect()},b.addTab=function(a){c.push(a),1===c.length?a.active=!0:a.active&&b.select(a)},b.removeTab=function(a){var d=c.indexOf(a);if(a.active&&c.length>1){var e=d==c.length-1?d-1:d+1;b.select(c[e])}c.splice(d,1)}}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1}}}).directive("tab",["$parse",function(a){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(b,c,d){return function(b,c,e,f){b.$watch("active",function(a){a&&f.select(b)}),b.disabled=!1,e.disabled&&b.$parent.$watch(a(e.disabled),function(a){b.disabled=!!a}),b.select=function(){b.disabled||(b.active=!0)},f.addTab(b),b.$on("$destroy",function(){f.removeTab(b)}),b.$transcludeFn=d}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}]).directive("tabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("tab-heading")||a.hasAttribute("data-tab-heading")||"tab-heading"===a.tagName.toLowerCase()||"data-tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^tabset",link:function(b,c,d){var e=b.$eval(d.tabContentTransclude);e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(a,b,c,d,e,f){function g(){var b=parseInt(a.hours,10),c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c?(a.showMeridian&&(12===b&&(b=0),a.meridian===p[1]&&(b+=12)),b):void 0}function h(){var b=parseInt(a.minutes,10);return b>=0&&60>b?b:void 0}function i(a){return angular.isDefined(a)&&a.toString().length<2?"0"+a:a}function j(a){k(),o.$setViewValue(new Date(n)),l(a)}function k(){o.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1}function l(b){var c=n.getHours(),d=n.getMinutes();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:i(c),a.minutes="m"===b?d:i(d),a.meridian=n.getHours()<12?p[0]:p[1]}function m(a){var b=new Date(n.getTime()+6e4*a);n.setHours(b.getHours(),b.getMinutes()),j()}var n=new Date,o={$setViewValue:angular.noop},p=angular.isDefined(b.meridians)?a.$parent.$eval(b.meridians):f.meridians||e.DATETIME_FORMATS.AMPMS;this.init=function(c,d){o=c,o.$render=this.render;var e=d.eq(0),g=d.eq(1),h=angular.isDefined(b.mousewheel)?a.$parent.$eval(b.mousewheel):f.mousewheel;h&&this.setupMousewheelEvents(e,g),a.readonlyInput=angular.isDefined(b.readonlyInput)?a.$parent.$eval(b.readonlyInput):f.readonlyInput,this.setupInputEvents(e,g)};var q=f.hourStep;b.hourStep&&a.$parent.$watch(c(b.hourStep),function(a){q=parseInt(a,10)});var r=f.minuteStep;b.minuteStep&&a.$parent.$watch(c(b.minuteStep),function(a){r=parseInt(a,10)}),a.showMeridian=f.showMeridian,b.showMeridian&&a.$parent.$watch(c(b.showMeridian),function(b){if(a.showMeridian=!!b,o.$error.time){var c=g(),d=h();angular.isDefined(c)&&angular.isDefined(d)&&(n.setHours(c),j())}else l()}),this.setupMousewheelEvents=function(b,c){var d=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()})},this.setupInputEvents=function(b,c){if(a.readonlyInput)return a.updateHours=angular.noop,void(a.updateMinutes=angular.noop);var d=function(b,c){o.$setViewValue(null),o.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c)};a.updateHours=function(){var a=g();angular.isDefined(a)?(n.setHours(a),j("h")):d(!0)},b.bind("blur",function(){!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=i(a.hours)})}),a.updateMinutes=function(){var a=h();angular.isDefined(a)?(n.setMinutes(a),j("m")):d(void 0,!0)},c.bind("blur",function(){!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=i(a.minutes)})})},this.render=function(){var a=o.$modelValue?new Date(o.$modelValue):null;isNaN(a)?(o.$setValidity("time",!1),d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(a&&(n=a),k(),l())},a.incrementHours=function(){m(60*q)},a.decrementHours=function(){m(60*-q)},a.incrementMinutes=function(){m(r)},a.decrementMinutes=function(){m(-r)},a.toggleMeridian=function(){m(720*(n.getHours()<12?1:-1))}}]).directive("timepicker",function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(a){var b=/^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(a,b,c,d,e,f,g){var h=[9,13,27,38,40];return{require:"ngModel",link:function(i,j,k,l){var m,n=i.$eval(k.typeaheadMinLength)||1,o=i.$eval(k.typeaheadWaitMs)||0,p=i.$eval(k.typeaheadEditable)!==!1,q=b(k.typeaheadLoading).assign||angular.noop,r=b(k.typeaheadOnSelect),s=k.typeaheadInputFormatter?b(k.typeaheadInputFormatter):void 0,t=k.typeaheadAppendToBody?i.$eval(k.typeaheadAppendToBody):!1,u=b(k.ngModel).assign,v=g.parse(k.typeahead),w=i.$new();i.$on("$destroy",function(){w.$destroy()});var x="typeahead-"+w.$id+"-"+Math.floor(1e4*Math.random());j.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":x});var y=angular.element("<div typeahead-popup></div>");y.attr({id:x,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(k.typeaheadTemplateUrl)&&y.attr("template-url",k.typeaheadTemplateUrl);var z=function(){w.matches=[],w.activeIdx=-1,j.attr("aria-expanded",!1)},A=function(a){return x+"-option-"+a};w.$watch("activeIdx",function(a){0>a?j.removeAttr("aria-activedescendant"):j.attr("aria-activedescendant",A(a))});var B=function(a){var b={$viewValue:a};q(i,!0),c.when(v.source(i,b)).then(function(c){var d=a===l.$viewValue;if(d&&m)if(c.length>0){w.activeIdx=0,w.matches.length=0;for(var e=0;e<c.length;e++)b[v.itemName]=c[e],w.matches.push({id:A(e),label:v.viewMapper(w,b),model:c[e]});w.query=a,w.position=t?f.offset(j):f.position(j),w.position.top=w.position.top+j.prop("offsetHeight"),j.attr("aria-expanded",!0)}else z();d&&q(i,!1)},function(){z(),q(i,!1)})};z(),w.query=void 0;var C;l.$parsers.unshift(function(a){return m=!0,a&&a.length>=n?o>0?(C&&d.cancel(C),C=d(function(){B(a)},o)):B(a):(q(i,!1),z()),p?a:a?void l.$setValidity("editable",!1):(l.$setValidity("editable",!0),a)}),l.$formatters.push(function(a){var b,c,d={};return s?(d.$model=a,s(i,d)):(d[v.itemName]=a,b=v.viewMapper(i,d),d[v.itemName]=void 0,c=v.viewMapper(i,d),b!==c?b:a)}),w.select=function(a){var b,c,e={};e[v.itemName]=c=w.matches[a].model,b=v.modelMapper(i,e),u(i,b),l.$setValidity("editable",!0),r(i,{$item:c,$model:b,$label:v.viewMapper(i,e)}),z(),d(function(){j[0].focus()},0,!1)},j.bind("keydown",function(a){0!==w.matches.length&&-1!==h.indexOf(a.which)&&(a.preventDefault(),40===a.which?(w.activeIdx=(w.activeIdx+1)%w.matches.length,w.$digest()):38===a.which?(w.activeIdx=(w.activeIdx?w.activeIdx:w.matches.length)-1,w.$digest()):13===a.which||9===a.which?w.$apply(function(){w.select(w.activeIdx)}):27===a.which&&(a.stopPropagation(),z(),w.$digest()))}),j.bind("blur",function(){m=!1});var D=function(a){j[0]!==a.target&&(z(),w.$digest())};e.bind("click",D),i.$on("$destroy",function(){e.unbind("click",D)});var E=a(y)(w);t?e.find("body").append(E):j.after(E)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(a,b,c){a.templateUrl=c.templateUrl,a.isOpen=function(){return a.matches.length>0},a.isActive=function(b){return a.active==b},a.selectActive=function(b){a.active=b},a.selectMatch=function(b){a.select({activeIdx:b})}}}}).directive("typeaheadMatch",["$http","$templateCache","$compile","$parse",function(a,b,c,d){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(e,f,g){var h=d(g.templateUrl)(e.$parent)||"template/typeahead/typeahead-match.html";a.get(h,{cache:b}).success(function(a){f.replaceWith(c(a.trim())(e))})}}}]).filter("typeaheadHighlight",function(){function a(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(b,c){return c?(""+b).replace(new RegExp(a(c),"gi"),"<strong>$&</strong>"):b}}),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion-group.html",'<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel-title">\n <a class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div class="panel-collapse" collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n </div>\n</div>')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion.html",'<div class="panel-group" ng-transclude></div>')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function(a){a.put("template/alert/alert.html",'<div class="alert" ng-class="{\'alert-{{type || \'warning\'}}\': true, \'alert-dismissable\': closeable}" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close()">\n <span aria-hidden="true">×</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n')}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(a){a.put("template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(a){a.put("template/carousel/slide.html","<div ng-class=\"{\n 'active': leaving || (active && !entering),\n 'prev': (next || active) && direction=='prev',\n 'next': (next || active) && direction=='next',\n 'right': direction=='prev',\n 'left': direction=='next'\n }\" class=\"item text-center\" ng-transclude></div>\n")}]),angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/datepicker.html",'<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>')}]),angular.module("template/datepicker/day.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/day.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-show="showWeeks" class="text-center"></th>\n <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/month.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/month.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/popup.html",'<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" style="padding:10px 9px 2px">\n <span class="btn-group">\n <button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n </li>\n</ul>\n')}]),angular.module("template/datepicker/year.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/year.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(a){a.put("template/modal/backdrop.html",'<div class="modal-backdrop fade"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(a){a.put("template/modal/window.html",'<div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal-dialog" ng-class="{\'modal-sm\': size == \'sm\', \'modal-lg\': size == \'lg\'}"><div class="modal-content" ng-transclude></div></div>\n</div>')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pager.html",'<ul class="pager">\n <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n</ul>')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pagination.html",'<ul class="pagination">\n <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1)">{{getText(\'first\')}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number)">{{page.text}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages)">{{getText(\'last\')}}</a></li>\n</ul>')}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-html-unsafe-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module("template/popover/popover.html",[]).run(["$templateCache",function(a){a.put("template/popover/popover.html",'<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')}]),angular.module("template/progressbar/bar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>')}]),angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progress.html",'<div class="progress" ng-transclude></div>')}]),angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progressbar.html",'<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>')}]),angular.module("template/rating/rating.html",[]).run(["$templateCache",function(a){a.put("template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n </i>\n</span>')}]),angular.module("template/tabs/tab.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tab.html",'<li ng-class="{active: active, disabled: disabled}">\n <a ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("template/tabs/tabset-titles.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tabset-titles.html","<ul class=\"nav {{type && 'nav-' + type}}\" ng-class=\"{'nav-stacked': vertical}\">\n</ul>\n")}]),angular.module("template/tabs/tabset.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tabset.html",'\n<div>\n <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("template/timepicker/timepicker.html",[]).run(["$templateCache",function(a){a.put("template/timepicker/timepicker.html",'<table>\n <tbody>\n <tr class="text-center">\n <td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td> </td>\n <td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidHours}">\n <input type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-mousewheel="incrementHours()" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td>:</td>\n <td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n <input type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n </tr>\n <tr class="text-center">\n <td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td> </td>\n <td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-match.html",'<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>')}]),angular.module("template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-if="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>') -}]); \ No newline at end of file diff --git a/setup/pub/angular-ui-router/angular-ui-router.min.js b/setup/pub/angular-ui-router/angular-ui-router.min.js deleted file mode 100644 index 66568f91192ec..0000000000000 --- a/setup/pub/angular-ui-router/angular-ui-router.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * State-based routing for AngularJS - * @version v0.4.3 - * @link http://angular-ui.github.com/ - * @license MIT License, http://www.opensource.org/licenses/MIT - */ -"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return T(new(T(function(){},{prototype:a})),b)}function e(a){return S(arguments,function(b){b!==a&&S(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return S(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=d<0?Math.ceil(d):Math.floor(d),d<0&&(d+=c);d<c;d++)if(d in a&&a[d]===b)return d;return-1}function i(a,b,c,d){var e,i=f(c,d),j={},k=[];for(var l in i)if(i[l]&&i[l].params&&(e=g(i[l].params),e.length))for(var m in e)h(k,e[m])>=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return T({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e<c.length;e++){var f=c[e];if(a[f]!=b[f])return!1}return!0}function k(a,b){var c={};return S(a,function(a){c[a]=b[a]}),c}function l(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));return S(c,function(c){c in a&&(b[c]=a[c])}),b}function m(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var d in a)-1==h(c,d)&&(b[d]=a[d]);return b}function n(a,b){var c=R(a),d=c?[]:{};return S(a,function(a,e){b(a,e)&&(d[c?d.length:e]=a)}),d}function o(a,b){var c=R(a)?[]:{};return S(a,function(a,d){c[d]=b(a,d)}),c}function p(a){return a.then(c,function(){})&&a}function q(a,b){var d=1,f=2,i={},j=[],k=i,l=T(a.when(i),{$$promises:i,$$values:i});this.study=function(i){function n(a,c){if(t[c]!==f){if(s.push(c),t[c]===d)throw s.splice(0,h(s,c)),new Error("Cyclic dependency: "+s.join(" -> "));if(t[c]=d,P(a))r.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);S(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),r.push(c,a,e)}s.pop(),t[c]=f}}function o(a){return Q(a)&&a.then&&a.$$promises}if(!Q(i))throw new Error("'invocables' must be an object");var q=g(i||{}),r=[],s=[],t={};return S(i,n),i=s=t=null,function(d,f,g){function h(){--v||(w||e(u,f.$$values),s.$$values=u,s.$$promises=s.$$promises||!0,delete s.$$inheritedValues,n.resolve(u))}function i(a){s.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!N(s.$$failure))try{l.resolve(b.invoke(e,g,u)),l.promise.then(function(a){u[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;S(f,function(a){t.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,t[a].then(function(b){u[a]=b,--m||k()},j))}),m||k(),t[c]=p(l.promise)}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!Q(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),s=p(n.promise),t=s.$$promises={},u=T({},d),v=1+r.length/3,w=!1;if(p(s),N(f.$$failure))return i(f.$$failure),s;f.$$inheritedValues&&e(u,m(f.$$inheritedValues,q)),T(t,f.$$promises),f.$$values?(w=e(u,m(f.$$values,q)),s.$$inheritedValues=m(f.$$values,q),h()):(f.$$inheritedValues&&(s.$$inheritedValues=m(f.$$inheritedValues,q)),f.then(h,i));for(var x=0,y=r.length;x<y;x+=3)d.hasOwnProperty(r[x])?h():j(r[x],r[x+1],r[x+2]);return s}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function r(){var a=b.version.minor<3;this.shouldUnsafelyUseHttp=function(b){a=!!b},this.$get=["$http","$templateCache","$injector",function(b,c,d){return new s(b,c,d,a)}]}function s(a,b,c,d){this.fromConfig=function(a,b,c){return N(a.template)?this.fromString(a.template,b):N(a.templateUrl)?this.fromUrl(a.templateUrl,b):N(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return O(a)?a(b):a},this.fromUrl=function(e,f){return O(e)&&(e=e(f)),null==e?null:d?a.get(e,{cache:b,headers:{Accept:"text/html"}}).then(function(a){return a.data}):c.get("$templateRequest")(e)},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function t(a,b,e){function f(b,c,d,e){if(q.push(b),o[b])return o[b];if(!/^\w+([-.]+\w+)*(?:\[\])?$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(p[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");return p[b]=new W.Param(b,c,d,e),p[b]}function g(a,b,c,d){var e=["",""],f=a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!b)return f;switch(c){case!1:e=["(",")"+(d?"?":"")];break;case!0:f=f.replace(/\/$/,""),e=["(?:/(",")|/)?"];break;default:e=["("+c+"|",")?"]}return f+e[0]+b+e[1]}function h(e,f){var g,h,i,j,k;return g=e[2]||e[3],k=b.params[g],i=a.substring(m,e.index),h=f?e[4]:e[4]||("*"==e[1]?".*":null),h&&(j=W.type(h)||d(W.type("string"),{pattern:new RegExp(h,b.caseInsensitive?"i":c)})),{id:g,regexp:h,segment:i,type:j,cfg:k}}b=T({params:{}},Q(b)?b:{});var i,j=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,k=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l="^",m=0,n=this.segments=[],o=e?e.params:{},p=this.params=e?e.params.$$new():new W.ParamSet,q=[];this.source=a;for(var r,s,t;(i=j.exec(a))&&(r=h(i,!1),!(r.segment.indexOf("?")>=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(!1===b.strict?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function u(a){T(this,a)}function v(){function a(a){return null!=a?a.toString().replace(/(~|\/)/g,function(a){return{"~":"~~","/":"~2F"}[a]}):a}function e(a){return null!=a?a.toString().replace(/(~~|~2F)/g,function(a){return{"~~":"~","~2F":"/"}[a]}):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return O(a)||R(a)&&O(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(r[a.name],l.invoke(a.def))}}function k(a){T(this,a||{})}W=this;var l,m=!1,p=!0,q=!1,r={},s=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!N(a)||"string"==typeof a},pattern:/[^\/]*/},int:{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return a!==c&&null!==a&&this.decode(a.toString())===a},pattern:/-?\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return!0===a||!1===a},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};v.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return N(a)&&(m=a),m},this.strictMode=function(a){return N(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!N(a))return q;if(!0!==a&&!1!==a&&!P(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new t(a,T(f(),b))},this.isMatcher=function(a){if(!Q(a))return!1;var b=!0;return S(t.prototype,function(c,d){O(c)&&(b=b&&N(a[d])&&O(a[d]))}),b},this.type=function(a,b,c){if(!N(b))return r[a];if(r.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return r[a]=new u(T({name:a},b)),c&&(w.push({name:a,def:c}),s||j()),this},S(x,function(a,b){r[b]=new u(T({name:b},a))}),r=d(r,{}),this.$get=["$injector",function(a){return l=a,s=!1,j(),S(x,function(a,b){r[b]||(r[b]=new u(a))}),this}],this.Param=function(a,d,e,f){function j(a){var b=Q(a)?g(a):[];return-1===h(b,"value")&&-1===h(b,"type")&&-1===h(b,"squash")&&-1===h(b,"array")&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function k(c,d,e){if(c.type&&d)throw new Error("Param '"+a+"' has two type configurations.");return d||(c.type?b.isString(c.type)?r[c.type]:c.type instanceof u?c.type:new u(c.type):"config"===e?r.any:r.string)}function m(){var b={array:"search"===f&&"auto"},c=a.match(/\[\]$/)?{array:!0}:{};return T(b,c,e).array}function p(a,b){var c=a.squash;if(!b||!1===c)return!1;if(!N(c)||null==c)return q;if(!0===c||P(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function s(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=R(a.replace)?a.replace:[],P(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return-1===h(g,a.from)}).concat(f)}function t(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))throw new Error("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return a}function v(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(x.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),N(a)?x.type.$normalize(a):t()}function w(){return"{Param:"+a+" "+d+" squash: '"+A+"' optional: "+z+"}"}var x=this;e=j(e),d=k(e,d,f);var y=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");var z=e.value!==c,A=p(e,z),B=s(e,y,z,A);T(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){return d(this,T(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),S(b,function(b){S(g(b),function(b){-1===h(a,b)&&-1===h(d,b)&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return S(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return S(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d<i.length&&(e=this[i[d]],(f=a[i[d]])!==c&&null!==f||!e.isOptional);d++){if(g=e.type.$normalize(f),!e.type.is(g))return!1;if(h=e.type.encode(g),b.isString(h)&&!e.type.pattern.exec(h))return!1}return!0},$$parent:c},this.ParamSet=k}function w(a,d){function e(a){var b=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);return null!=b?b[1].replace(/\\(.)/g,"$1"):""}function f(a,b){return a.replace(/\$(\$|\d{1,2})/,function(a,c){return b["$"===c?0:Number(c)]})}function g(a,b,c){if(!c)return!1;var d=a.invoke(b,b,{$match:c});return!N(d)||d}function h(d,e,f,g,h){function m(a,b,c){return"/"===q?a:b?q.slice(0,-1)+a:c?q.slice(1)+a:a}function n(a){function b(a){var b=a(f,d);return!!b&&(P(b)&&d.replace().url(b),!0)}if(!a||!a.defaultPrevented){p&&d.url();p=c;var e,g=j.length;for(e=0;e<g;e++)if(b(j[e]))return;k&&b(k)}}function o(){return i=i||e.$on("$locationChangeSuccess",n)}var p,q=g.baseHref(),r=d.url();return l||o(),{sync:function(){n()},listen:function(){return o()},update:function(a){if(a)return void(r=d.url());d.url()!==r&&(d.url(r),d.replace())},push:function(a,b,e){var f=a.format(b||{});null!==f&&b&&b["#"]&&(f+="#"+b["#"]),d.url(f),p=e&&e.$$avoidResync?d.url():c,e&&e.replace&&d.replace()},href:function(c,e,f){if(!c.validates(e))return null;var g=a.html5Mode();b.isObject(g)&&(g=g.enabled),g=g&&h.history;var i=c.format(e);if(f=f||{},g||null===i||(i="#"+a.hashPrefix()+i),null!==i&&e&&e["#"]&&(i+="#"+e["#"]),i=m(i,g,f.absolute),!f.absolute||!i)return i;var j=!g&&i?"/":"",k=d.port();return k=80===k||443===k?"":":"+k,[d.protocol(),"://",d.host(),k,j,i].join("")}}}var i,j=[],k=null,l=!1;this.rule=function(a){if(!O(a))throw new Error("'rule' must be a function");return j.push(a),this},this.otherwise=function(a){if(P(a)){var b=a;a=function(){return b}}else if(!O(a))throw new Error("'rule' must be a function");return k=a,this},this.when=function(a,b){var c,h=P(b);if(P(a)&&(a=d.compile(a)),!h&&!O(b)&&!R(b))throw new Error("invalid 'handler' in when()");var i={matcher:function(a,b){return h&&(c=d.compile(b),b=["$match",function(a){return c.format(a)}]),T(function(c,d){return g(c,b,a.exec(d.path(),d.search()))},{prefix:P(a.prefix)?a.prefix:""})},regex:function(a,b){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(c=b,b=["$match",function(a){return f(c,a)}]),T(function(c,d){return g(c,b,a.exec(d.path()))},{prefix:e(a)})}},j={matcher:d.isMatcher(a),regex:a instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](a,b));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(a){a===c&&(a=!0),l=a},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser","$sniffer"]}function x(a,e){function f(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function m(a,b){if(!a)return c;var d=P(a),e=d?a:a.name;if(f(e)){if(!b)throw new Error("No reference point given for path '"+e+"'");b=m(b);for(var g=e.split("."),h=0,i=g.length,j=b;h<i;h++)if(""!==g[h]||0!==h){if("^"!==g[h])break;if(!j.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");j=j.parent}else j=b;g=g.slice(h).join("."),e=j.name+(j.name&&g?".":"")+g}var k=A[e];return!k||!d&&(d||k!==a&&k.self!==a)?c:k}function n(a,b){B[a]||(B[a]=[]),B[a].push(b)}function q(a){for(var b=B[a]||[];b.length;)r(b.shift())}function r(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!P(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(A.hasOwnProperty(c))throw new Error("State '"+c+"' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):P(b.parent)?b.parent:Q(b.parent)&&P(b.parent.name)?b.parent.name:"";if(e&&!A[e])return n(e,b.self);for(var f in D)O(D[f])&&(b[f]=D[f](b,D.$delegates[f]));return A[c]=b,!b[C]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){z.$current.navigable==b&&j(a,c)||z.transitionTo(b,a,{inherit:!0,location:!1})}]),q(c),b}function s(a){return a.indexOf("*")>-1}function t(a){for(var b=a.split("."),c=z.$current.name.split("."),d=0,e=b.length;d<e;d++)"*"===b[d]&&(c[d]="*");return"**"===b[0]&&(c=c.slice(h(c,b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(h(c,b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length==c.length&&c.join("")===b.join("")}function u(a,b){return P(a)&&!N(b)?D[a]:O(b)&&P(a)?(D[a]&&!D.$delegates[a]&&(D.$delegates[a]=D[a]),D[a]=b,this):this}function v(a,b){return Q(a)?b=a:b.name=a,r(b),this}function w(a,e,f,h,j,l,n,q,r){function u(b,c,d,f){var g=a.$broadcast("$stateNotFound",b,c,d);if(g.defaultPrevented)return n.update(),E;if(!g.retry)return null;if(f.$retry)return n.update(),F;var h=z.transition=e.when(g.retry);return h.then(function(){return h!==z.transition?(a.$broadcast("$stateChangeCancel",b.to,b.toParams,c,d),B):(b.options.$retry=!0,z.transitionTo(b.to,b.toParams,b.options))},function(){return E}),n.update(),h}function v(a,c,d,g,i,l){function m(){var c=[];return S(a.views,function(d,e){var g=d.resolve&&d.resolve!==a.resolve?d.resolve:{};g.$template=[function(){return f.load(e,{view:d,locals:i.globals,params:n,notify:l.notify})||""}],c.push(j.resolve(g,i.globals,i.resolve,a).then(function(c){if(O(d.controllerProvider)||R(d.controllerProvider)){var f=b.extend({},g,i.globals);c.$$controller=h.invoke(d.controllerProvider,null,f)}else c.$$controller=d.controller;c.$$state=a,c.$$controllerAs=d.controllerAs,c.$$resolveAs=d.resolveAs,i[e]=c}))}),e.all(c).then(function(){return i.globals})}var n=d?c:k(a.params.$$keys(),c),o={$stateParams:n};i.resolve=j.resolve(a.resolve,o,i.resolve,a);var p=[i.resolve.then(function(a){i.globals=a})];return g&&p.push(g),e.all(p).then(m).then(function(a){return i})}var w=new Error("transition superseded"),B=p(e.reject(w)),D=p(e.reject(new Error("transition prevented"))),E=p(e.reject(new Error("transition aborted"))),F=p(e.reject(new Error("transition failed")));return y.locals={resolve:null,globals:{$stateParams:{}}},z={params:{},current:y.self,$current:y,transition:null},z.reload=function(a){return z.transitionTo(z.current,l,{reload:a||!0,inherit:!1,notify:!0})},z.go=function(a,b,c){return z.transitionTo(a,b,T({inherit:!0,relative:z.$current},c))},z.transitionTo=function(b,c,f){c=c||{},f=T({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});var g,j=z.$current,o=z.params,q=j.path,r=m(b,f.relative),s=c["#"];if(!N(r)){var t={to:b,toParams:c,options:f},A=u(t,j.self,o,f);if(A)return A;if(b=t.to,c=t.toParams,f=t.options,r=m(b,f.relative),!N(r)){if(!f.relative)throw new Error("No such state '"+b+"'");throw new Error("Could not resolve '"+b+"' from state '"+f.relative+"'")}}if(r[C])throw new Error("Cannot transition to abstract state '"+b+"'");if(f.inherit&&(c=i(l,c||{},z.$current,r)),!r.params.$$validates(c))return F;c=r.params.$$values(c),b=r;var E=b.path,G=0,H=E[G],I=y.locals,J=[];if(f.reload){if(P(f.reload)||Q(f.reload)){if(Q(f.reload)&&!f.reload.name)throw new Error("Invalid reload state object");var K=!0===f.reload?q[0]:m(f.reload);if(f.reload&&!K)throw new Error("No such reload state '"+(P(f.reload)?f.reload:f.reload.name)+"'");for(;H&&H===q[G]&&H!==K;)I=J[G]=H.locals,G++,H=E[G]}}else for(;H&&H===q[G]&&H.ownParams.$$equals(c,o);)I=J[G]=H.locals,G++,H=E[G];if(x(b,c,j,o,I,f))return s&&(c["#"]=s),z.params=c,U(z.params,l),U(k(b.params.$$keys(),l),b.locals.globals.$stateParams),f.location&&b.navigable&&b.navigable.url&&(n.push(b.navigable.url,c,{$$avoidResync:!0,replace:"replace"===f.location}),n.update(!0)),z.transition=null,e.when(z.current);if(c=k(b.params.$$keys(),c||{}),s&&(c["#"]=s),f.notify&&a.$broadcast("$stateChangeStart",b.self,c,j.self,o,f).defaultPrevented)return a.$broadcast("$stateChangeCancel",b.self,c,j.self,o),null==z.transition&&n.update(),D;for(var L=e.when(I),M=G;M<E.length;M++,H=E[M])I=J[M]=d(I),L=v(H,c,H===b,L,I,f);var O=z.transition=L.then(function(){var d,e,g;if(z.transition!==O)return a.$broadcast("$stateChangeCancel",b.self,c,j.self,o),B;for(d=q.length-1;d>=G;d--)g=q[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=G;d<E.length;d++)e=E[d],e.locals=J[d],e.self.onEnter&&h.invoke(e.self.onEnter,e.self,e.locals.globals);return z.transition!==O?(a.$broadcast("$stateChangeCancel",b.self,c,j.self,o),B):(z.$current=b,z.current=b.self,z.params=c,U(z.params,l),z.transition=null,f.location&&b.navigable&&n.push(b.navigable.url,b.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===f.location}),f.notify&&a.$broadcast("$stateChangeSuccess",b.self,c,j.self,o),n.update(!0),z.current)}).then(null,function(d){return d===w?B:z.transition!==O?(a.$broadcast("$stateChangeCancel",b.self,c,j.self,o),B):(z.transition=null,g=a.$broadcast("$stateChangeError",b.self,c,j.self,o,d),g.defaultPrevented||n.update(),e.reject(d))});return p(O),O},z.is=function(a,b,d){d=T({relative:z.$current},d||{});var e=m(a,d.relative);return N(e)?z.$current===e&&(!b||g(b).reduce(function(a,c){var d=e.params[c];return a&&(!d||d.type.equals(l[c],b[c]))},!0)):c},z.includes=function(a,b,d){if(d=T({relative:z.$current},d||{}),P(a)&&s(a)){if(!t(a))return!1;a=z.$current.name}var e=m(a,d.relative);if(!N(e))return c;if(!N(z.$current.includes[e.name]))return!1;if(!b)return!0;for(var f=g(b),h=0;h<f.length;h++){var i=f[h],j=e.params[i];if(j&&!j.type.equals(l[i],b[i]))return!1}return g(b).reduce(function(a,c){var d=e.params[c];return a&&!d||d.type.equals(l[c],b[c])},!0)},z.href=function(a,b,d){d=T({lossy:!0,inherit:!0,absolute:!1,relative:z.$current},d||{});var e=m(a,d.relative);if(!N(e))return null;d.inherit&&(b=i(l,b||{},z.$current,e));var f=e&&d.lossy?e.navigable:e;return f&&f.url!==c&&null!==f.url?n.href(f.url,k(e.params.$$keys().concat("#"),b||{}),{absolute:d.absolute}):null},z.get=function(a,b){if(0===arguments.length)return o(g(A),function(a){return A[a].self});var c=m(a,b||z.$current);return c&&c.self?c.self:null},z}function x(a,b,c,d,e,f){function g(a,b,c){function d(b){return"search"!=a.params[b].location}var e=a.params.$$keys().filter(d),f=l.apply({},[a.params].concat(e));return new W.ParamSet(f).$$equals(b,c)}if(!f.reload&&a===c&&(e===c.locals||!1===a.self.reloadOnSearch&&g(c,d,b)))return!0}var y,z,A={},B={},C="abstract",D={parent:function(a){if(N(a.parent)&&a.parent)return m(a.parent);var b=/^(.+)\.[^.]+$/.exec(a.name);return b?m(b[1]):y},data:function(a){return a.parent&&a.parent.data&&(a.data=a.self.data=d(a.parent.data,a.data)),a.data},url:function(a){var b=a.url,c={params:a.params||{}};if(P(b))return"^"==b.charAt(0)?e.compile(b.substring(1),c):(a.parent.navigable||y).url.concat(b,c);if(!b||e.isMatcher(b))return b;throw new Error("Invalid url '"+b+"' in state '"+a+"'")},navigable:function(a){return a.url?a:a.parent?a.parent.navigable:null},ownParams:function(a){var b=a.url&&a.url.params||new W.ParamSet;return S(a.params||{},function(a,c){b[c]||(b[c]=new W.Param(c,null,a,"config"))}),b},params:function(a){var b=l(a.ownParams,a.ownParams.$$keys());return a.parent&&a.parent.params?T(a.parent.params.$$new(),b):new W.ParamSet},views:function(a){var b={};return S(N(a.views)?a.views:{"":a},function(c,d){d.indexOf("@")<0&&(d+="@"+a.parent.name),c.resolveAs=c.resolveAs||a.resolveAs||"$resolve",b[d]=c}),b},path:function(a){return a.parent?a.parent.path.concat(a):[]},includes:function(a){var b=a.parent?T({},a.parent.includes):{};return b[a.name]=!0,b},$delegates:{}};y=r({name:"",url:"^",views:null,abstract:!0}),y.navigable=null,this.decorator=u,this.state=v,this.$get=w,w.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function y(){function a(a,b){return{load:function(a,c){var d;return c=T({template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}},c),c.view&&(d=b.fromConfig(c.view,c.params,c.locals)),d}}}this.$get=a,a.$inject=["$rootScope","$templateFactory"]}function z(){var a=!1;this.useAnchorScroll=function(){a=!0},this.$get=["$anchorScroll","$timeout",function(b,c){return a?b:function(a){return c(function(){a[0].scrollIntoView()},0,!1)}}]}function A(a,c,d,e,f){function g(){return c.has?function(a){return c.has(a)?c.get(a):null}:function(a){try{return c.get(a)}catch(a){return null}}}function h(a,c){var d=function(){return{enter:function(a,b,c){b.after(a),c()},leave:function(a,b){a.remove(),b()}}};if(k)return{enter:function(a,c,d){b.version.minor>2?k.enter(a,null,c).then(d):k.enter(a,null,c,d)},leave:function(a,c){b.version.minor>2?k.leave(a).then(c):k.leave(a,c)}};if(j){var e=j&&j(c,a);return{enter:function(a,b,c){e.enter(a,null,b),c()},leave:function(a,b){e.leave(a),b()}}}return d()}var i=g(),j=i("$animator"),k=i("$animate");return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,g,i){return function(c,g,j){function k(){if(m&&(m.remove(),m=null),o&&(o.$destroy(),o=null),n){var a=n.data("$uiViewAnim");s.leave(n,function(){a.$$animLeave.resolve(),m=null}),m=n,n=null}}function l(h){var l,m=C(c,j,g,e),t=m&&a.$current&&a.$current.locals[m];if(h||t!==p){l=c.$new(),p=a.$current.locals[m],l.$emit("$viewContentLoading",m);var u=i(l,function(a){var e=f.defer(),h=f.defer(),i={$animEnter:e.promise,$animLeave:h.promise,$$animLeave:h};a.data("$uiViewAnim",i),s.enter(a,g,function(){e.resolve(),o&&o.$emit("$viewContentAnimationEnded"),(b.isDefined(r)&&!r||c.$eval(r))&&d(a)}),k()});n=u,o=l,o.$emit("$viewContentLoaded",m),o.$eval(q)}}var m,n,o,p,q=j.onload||"",r=j.autoscroll,s=h(j,c);g.inheritedData("$uiView");c.$on("$stateChangeSuccess",function(){l(!1)}),l(!0)}}}}function B(a,c,d,e){return{restrict:"ECA",priority:-400,compile:function(f){var g=f.html();return f.empty?f.empty():f[0].innerHTML=null,function(f,h,i){var j=d.$current,k=C(f,i,h,e),l=j&&j.locals[k];if(!l)return h.html(g),void a(h.contents())(f);h.data("$uiView",{name:k,state:l.$$state}),h.html(l.$template?l.$template:g);var m=b.extend({},l);f[l.$$resolveAs]=m;var n=a(h.contents());if(l.$$controller){l.$scope=f,l.$element=h;var o=c(l.$$controller,l);l.$$controllerAs&&(f[l.$$controllerAs]=o,f[l.$$controllerAs][l.$$resolveAs]=m),O(o.$onInit)&&o.$onInit(),h.data("$ngControllerController",o),h.children().data("$ngControllerController",o)}n(f)}}}}function C(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function D(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),!(c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/))||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function E(a){var b=a.parent().inheritedData("$uiView");if(b&&b.state&&b.state.name)return b.state}function F(a){var b="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}function G(a,b,c,d,e){return function(f){var g=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){var i=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();var j=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}function H(a,b){return{relative:E(a)||b.$current,inherit:!0}}function I(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){var h,i=D(f.uiSref,a.current.name),j={state:i.state,href:null,params:null},k=F(e),l=g[1]||g[0],m=null;j.options=T(H(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});var n=function(c){c&&(j.params=b.copy(c)),j.href=a.href(i.state,j.params,j.options),m&&m(),l&&(m=l.$$addStateInfo(i.state,j.params)),null!==j.href&&f.$set(k.attr,j.href)};i.paramExpr&&(d.$watch(i.paramExpr,function(a){a!==j.params&&n(a)},!0),j.params=b.copy(d.$eval(i.paramExpr))),n(),k.clickable&&(h=G(e,a,c,k,function(){return j}),e[e.on?"on":"bind"]("click",h),d.$on("$destroy",function(){e[e.off?"off":"unbind"]("click",h)}))}}}function J(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){function g(b){m.state=b[0],m.params=b[1],m.options=b[2],m.href=a.href(m.state,m.params,m.options),n&&n(),j&&(n=j.$$addStateInfo(m.state,m.params)),m.href&&e.$set(i.attr,m.href)}var h,i=F(d),j=f[1]||f[0],k=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],l="["+k.map(function(a){return a||"null"}).join(", ")+"]",m={state:null,params:null,options:null,href:null},n=null;c.$watch(l,g,!0),g(c.$eval(l)),i.clickable&&(h=G(d,a,b,i,function(){return m}),d[d.on?"on":"bind"]("click",h),c.$on("$destroy",function(){d[d.off?"off":"unbind"]("click",h)}))}}}function K(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){function g(b,c,e){var f=a.get(b,E(d)),g=h(b,c),i={state:f||{name:b},params:c,hash:g};return p.push(i),q[g]=e,function(){var a=p.indexOf(i);-1!==a&&p.splice(a,1)}}function h(a,c){if(!P(a))throw new Error("state should be a string");return Q(c)?a+V(c):(c=b.$eval(c),Q(c)?a+V(c):a)}function i(){for(var a=0;a<p.length;a++)l(p[a].state,p[a].params)?j(d,q[p[a].hash]):k(d,q[p[a].hash]),m(p[a].state,p[a].params)?j(d,n):k(d,n)}function j(a,b){f(function(){a.addClass(b)})}function k(a,b){a.removeClass(b)}function l(b,c){return a.includes(b.name,c)}function m(b,c){return a.is(b.name,c)}var n,o,p=[],q={};n=c(e.uiSrefActiveEq||"",!1)(b);try{o=b.$eval(e.uiSrefActive)}catch(a){}o=o||c(e.uiSrefActive||"",!1)(b),Q(o)&&S(o,function(c,d){if(P(c)){var e=D(c,a.current.name);g(e.state,b.$eval(e.paramExpr),d)}}),this.$$addStateInfo=function(a,b){if(!(Q(o)&&p.length>0)){var c=g(a,b,o);return i(),c}},b.$on("$stateChangeSuccess",i),i()}]}}function L(a){var b=function(b,c){return a.is(b,c)};return b.$stateful=!0,b}function M(a){var b=function(b,c,d){return a.includes(b,c,d)};return b.$stateful=!0,b}var N=b.isDefined,O=b.isFunction,P=b.isString,Q=b.isObject,R=b.isArray,S=b.forEach,T=b.extend,U=b.copy,V=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),q.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",q),b.module("ui.router.util").provider("$templateFactory",r);var W;t.prototype.concat=function(a,b){var c={caseInsensitive:W.caseInsensitive(),strict:W.strictMode(),squash:W.defaultSquashPolicy()};return new t(this.sourcePath+a+this.sourceSearch,T(c,b),this)},t.prototype.toString=function(){return this.source},t.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}return o(o(b(a).split(/-(?!\\)/),b),c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var l,m;for(e=0;e<j;e++){for(g=h[e],l=this.params[g],m=d[e+1],f=0;f<l.replace.length;f++)l.replace[f].from===m&&(m=l.replace[f].to);m&&!0===l.array&&(m=c(m)),N(m)&&(m=l.type.decode(m)),k[g]=l.value(m)}for(;e<i;e++){for(g=h[e],k[g]=this.params[g].value(b[g]),l=this.params[g],m=b[g],f=0;f<l.replace.length;f++)l.replace[f].from===m&&(m=l.replace[f].to);N(m)&&(m=l.type.decode(m)),k[g]=l.value(m)}return k},t.prototype.parameters=function(a){return N(a)?this.params[a]||null:this.$$paramNames},t.prototype.validates=function(a){return this.params.$$validates(a)},t.prototype.format=function(a){function b(a){return encodeURIComponent(a).replace(/-/g,function(a){return"%5C%"+a.charCodeAt(0).toString(16).toUpperCase()})}a=a||{};var c=this.segments,d=this.parameters(),e=this.params;if(!this.validates(a))return null;var f,g=!1,h=c.length-1,i=d.length,j=c[0];for(f=0;f<i;f++){var k=f<h,l=d[f],m=e[l],n=m.value(a[l]),p=m.isOptional&&m.type.equals(m.value(),n),q=!!p&&m.squash,r=m.type.encode(n);if(k){var s=c[f+1],t=f+1===h;if(!1===q)null!=r&&(R(r)?j+=o(r,b).join("-"):j+=encodeURIComponent(r)),j+=s;else if(!0===q){var u=j.match(/\/$/)?/\/?(.*)/:/(.*)/;j+=s.match(u)[1]}else P(q)&&(j+=q+s);t&&!0===m.squash&&"/"===j.slice(-1)&&(j=j.slice(0,-1))}else{if(null==r||p&&!1!==q)continue;if(R(r)||(r=[r]),0===r.length)continue;r=o(r,encodeURIComponent).join("&"+l+"="),j+=(g?"&":"?")+l+"="+r,g=!0}}return j},u.prototype.is=function(a,b){return!0},u.prototype.encode=function(a,b){return a},u.prototype.decode=function(a,b){return a},u.prototype.equals=function(a,b){return a==b},u.prototype.$subPattern=function(){var a=this.pattern.toString();return a.substr(1,a.length-2)},u.prototype.pattern=/.*/,u.prototype.toString=function(){return"{Type:"+this.name+"}"},u.prototype.$normalize=function(a){return this.is(a)?a:this.decode(a)},u.prototype.$asArray=function(a,b){function d(a,b){function d(a,b){return function(){return a[b].apply(a,arguments)}}function e(a){return R(a)?a:N(a)?[a]:[]}function f(a){switch(a.length){case 0:return c;case 1:return"auto"===b?a[0]:a;default:return a}}function g(a){return!a}function h(a,b){return function(c){if(R(c)&&0===c.length)return c;c=e(c);var d=o(c,a);return!0===b?0===n(d,g).length:f(d)}}function i(a){return function(b,c){var d=e(b),f=e(c);if(d.length!==f.length)return!1;for(var g=0;g<d.length;g++)if(!a(d[g],f[g]))return!1;return!0}}this.encode=h(d(a,"encode")),this.decode=h(d(a,"decode")),this.is=h(d(a,"is"),!0),this.equals=i(d(a,"equals")),this.pattern=a.pattern,this.$normalize=h(d(a,"$normalize")),this.name=a.name,this.$arrayMode=b}if(!a)return this;if("auto"===a&&!b)throw new Error("'auto' array mode is for query parameters only");return new d(this,a)},b.module("ui.router.util").provider("$urlMatcherFactory",v),b.module("ui.router.util").run(["$urlMatcherFactory",function(a){}]),w.$inject=["$locationProvider","$urlMatcherFactoryProvider"],b.module("ui.router.router").provider("$urlRouter",w),x.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],b.module("ui.router.state").factory("$stateParams",function(){return{}}).constant("$state.runtime",{autoinject:!0}).provider("$state",x).run(["$injector",function(a){a.get("$state.runtime").autoinject&&a.get("$state")}]),y.$inject=[],b.module("ui.router.state").provider("$view",y),b.module("ui.router.state").provider("$uiViewScroll",z),A.$inject=["$state","$injector","$uiViewScroll","$interpolate","$q"],B.$inject=["$compile","$controller","$state","$interpolate"],b.module("ui.router.state").directive("uiView",A),b.module("ui.router.state").directive("uiView",B),I.$inject=["$state","$timeout"],J.$inject=["$state","$timeout"],K.$inject=["$state","$stateParams","$interpolate"],b.module("ui.router.state").directive("uiSref",I).directive("uiSrefActive",K).directive("uiSrefActiveEq",K).directive("uiState",J),L.$inject=["$state"],M.$inject=["$state"],b.module("ui.router.state").filter("isState",L).filter("includedByState",M)}(window,window.angular); \ No newline at end of file diff --git a/setup/pub/angular/angular.js b/setup/pub/angular/angular.js deleted file mode 100644 index 189ff16495b25..0000000000000 --- a/setup/pub/angular/angular.js +++ /dev/null @@ -1,34359 +0,0 @@ -/** - * @license AngularJS v1.6.9 - * (c) 2010-2018 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window) {'use strict'; - - /* exported - minErrConfig, - errorHandlingConfig, - isValidObjectMaxDepth -*/ - - var minErrConfig = { - objectMaxDepth: 5 - }; - - /** - * @ngdoc function - * @name angular.errorHandlingConfig - * @module ng - * @kind function - * - * @description - * Configure several aspects of error handling in AngularJS if used as a setter or return the - * current configuration if used as a getter. The following options are supported: - * - * - **objectMaxDepth**: The maximum depth to which objects are traversed when stringified for error messages. - * - * Omitted or undefined options will leave the corresponding configuration values unchanged. - * - * @param {Object=} config - The configuration object. May only contain the options that need to be - * updated. Supported keys: - * - * * `objectMaxDepth` **{Number}** - The max depth for stringifying objects. Setting to a - * non-positive or non-numeric value, removes the max depth limit. - * Default: 5 - */ - function errorHandlingConfig(config) { - if (isObject(config)) { - if (isDefined(config.objectMaxDepth)) { - minErrConfig.objectMaxDepth = isValidObjectMaxDepth(config.objectMaxDepth) ? config.objectMaxDepth : NaN; - } - } else { - return minErrConfig; - } - } - - /** - * @private - * @param {Number} maxDepth - * @return {boolean} - */ - function isValidObjectMaxDepth(maxDepth) { - return isNumber(maxDepth) && maxDepth > 0; - } - - /** - * @description - * - * This object provides a utility for producing rich Error messages within - * AngularJS. It can be called as follows: - * - * var exampleMinErr = minErr('example'); - * throw exampleMinErr('one', 'This {0} is {1}', foo, bar); - * - * The above creates an instance of minErr in the example namespace. The - * resulting error will have a namespaced error code of example.one. The - * resulting error will replace {0} with the value of foo, and {1} with the - * value of bar. The object is not restricted in the number of arguments it can - * take. - * - * If fewer arguments are specified than necessary for interpolation, the extra - * interpolation markers will be preserved in the final string. - * - * Since data will be parsed statically during a build step, some restrictions - * are applied with respect to how minErr instances are created and called. - * Instances should have names of the form namespaceMinErr for a minErr created - * using minErr('namespace') . Error codes, namespaces and template strings - * should all be static strings, not variables or general expressions. - * - * @param {string} module The namespace to use for the new minErr instance. - * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning - * error from returned function, for cases when a particular type of error is useful. - * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance - */ - - function minErr(module, ErrorConstructor) { - ErrorConstructor = ErrorConstructor || Error; - return function() { - var code = arguments[0], - template = arguments[1], - message = '[' + (module ? module + ':' : '') + code + '] ', - templateArgs = sliceArgs(arguments, 2).map(function(arg) { - return toDebugString(arg, minErrConfig.objectMaxDepth); - }), - paramPrefix, i; - - message += template.replace(/\{\d+\}/g, function(match) { - var index = +match.slice(1, -1); - - if (index < templateArgs.length) { - return templateArgs[index]; - } - - return match; - }); - - message += '\nhttp://errors.angularjs.org/1.6.9/' + - (module ? module + '/' : '') + code; - - for (i = 0, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') { - message += paramPrefix + 'p' + i + '=' + encodeURIComponent(templateArgs[i]); - } - - return new ErrorConstructor(message); - }; - } - - /* We need to tell ESLint what variables are being exported */ - /* exported - angular, - msie, - jqLite, - jQuery, - slice, - splice, - push, - toString, - minErrConfig, - errorHandlingConfig, - isValidObjectMaxDepth, - ngMinErr, - angularModule, - uid, - REGEX_STRING_REGEXP, - VALIDITY_STATE_PROPERTY, - - lowercase, - uppercase, - manualLowercase, - manualUppercase, - nodeName_, - isArrayLike, - forEach, - forEachSorted, - reverseParams, - nextUid, - setHashKey, - extend, - toInt, - inherit, - merge, - noop, - identity, - valueFn, - isUndefined, - isDefined, - isObject, - isBlankObject, - isString, - isNumber, - isNumberNaN, - isDate, - isError, - isArray, - isFunction, - isRegExp, - isWindow, - isScope, - isFile, - isFormData, - isBlob, - isBoolean, - isPromiseLike, - trim, - escapeForRegexp, - isElement, - makeMap, - includes, - arrayRemove, - copy, - simpleCompare, - equals, - csp, - jq, - concat, - sliceArgs, - bind, - toJsonReplacer, - toJson, - fromJson, - convertTimezoneToLocal, - timezoneToOffset, - startingTag, - tryDecodeURIComponent, - parseKeyValue, - toKeyValue, - encodeUriSegment, - encodeUriQuery, - angularInit, - bootstrap, - getTestability, - snake_case, - bindJQuery, - assertArg, - assertArgFn, - assertNotHasOwnProperty, - getter, - getBlockNodes, - hasOwnProperty, - createMap, - stringify, - - NODE_TYPE_ELEMENT, - NODE_TYPE_ATTRIBUTE, - NODE_TYPE_TEXT, - NODE_TYPE_COMMENT, - NODE_TYPE_DOCUMENT, - NODE_TYPE_DOCUMENT_FRAGMENT -*/ - -//////////////////////////////////// - - /** - * @ngdoc module - * @name ng - * @module ng - * @installation - * @description - * - * The ng module is loaded by default when an AngularJS application is started. The module itself - * contains the essential components for an AngularJS application to function. The table below - * lists a high level breakdown of each of the services/factories, filters, directives and testing - * components available within this core module. - * - */ - - var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/; - -// The name of a form control's ValidityState property. -// This is used so that it's possible for internal tests to create mock ValidityStates. - var VALIDITY_STATE_PROPERTY = 'validity'; - - - var hasOwnProperty = Object.prototype.hasOwnProperty; - - /** - * @ngdoc function - * @name angular.lowercase - * @module ng - * @kind function - * - * @deprecated - * sinceVersion="1.5.0" - * removeVersion="1.7.0" - * Use [String.prototype.toLowerCase](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) instead. - * - * @description Converts the specified string to lowercase. - * @param {string} string String to be converted to lowercase. - * @returns {string} Lowercased string. - */ - var lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;}; - - /** - * @ngdoc function - * @name angular.uppercase - * @module ng - * @kind function - * - * @deprecated - * sinceVersion="1.5.0" - * removeVersion="1.7.0" - * Use [String.prototype.toUpperCase](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) instead. - * - * @description Converts the specified string to uppercase. - * @param {string} string String to be converted to uppercase. - * @returns {string} Uppercased string. - */ - var uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;}; - - - var manualLowercase = function(s) { - /* eslint-disable no-bitwise */ - return isString(s) - ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);}) - : s; - /* eslint-enable */ - }; - var manualUppercase = function(s) { - /* eslint-disable no-bitwise */ - return isString(s) - ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);}) - : s; - /* eslint-enable */ - }; - - -// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish -// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods -// with correct but slower alternatives. See https://github.com/angular/angular.js/issues/11387 - if ('i' !== 'I'.toLowerCase()) { - lowercase = manualLowercase; - uppercase = manualUppercase; - } - - - var - msie, // holds major version number for IE, or NaN if UA is not IE. - jqLite, // delay binding since jQuery could be loaded after us. - jQuery, // delay binding - slice = [].slice, - splice = [].splice, - push = [].push, - toString = Object.prototype.toString, - getPrototypeOf = Object.getPrototypeOf, - ngMinErr = minErr('ng'), - - /** @name angular */ - angular = window.angular || (window.angular = {}), - angularModule, - uid = 0; - -// Support: IE 9-11 only - /** - * documentMode is an IE-only property - * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx - */ - msie = window.document.documentMode; - - - /** - * @private - * @param {*} obj - * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, - * String ...) - */ - function isArrayLike(obj) { - - // `null`, `undefined` and `window` are not array-like - if (obj == null || isWindow(obj)) return false; - - // arrays, strings and jQuery/jqLite objects are array like - // * jqLite is either the jQuery or jqLite constructor function - // * we have to check the existence of jqLite first as this method is called - // via the forEach method when constructing the jqLite object in the first place - if (isArray(obj) || isString(obj) || (jqLite && obj instanceof jqLite)) return true; - - // Support: iOS 8.2 (not reproducible in simulator) - // "length" in obj used to prevent JIT error (gh-11508) - var length = 'length' in Object(obj) && obj.length; - - // NodeList objects (with `item` method) and - // other objects with suitable length characteristics are array-like - return isNumber(length) && - (length >= 0 && ((length - 1) in obj || obj instanceof Array) || typeof obj.item === 'function'); - - } - - /** - * @ngdoc function - * @name angular.forEach - * @module ng - * @kind function - * - * @description - * Invokes the `iterator` function once for each item in `obj` collection, which can be either an - * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value` - * is the value of an object property or an array element, `key` is the object property key or - * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional. - * - * It is worth noting that `.forEach` does not iterate over inherited properties because it filters - * using the `hasOwnProperty` method. - * - * Unlike ES262's - * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18), - * providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just - * return the value provided. - * - ```js - var values = {name: 'misko', gender: 'male'}; - var log = []; - angular.forEach(values, function(value, key) { - this.push(key + ': ' + value); - }, log); - expect(log).toEqual(['name: misko', 'gender: male']); - ``` - * - * @param {Object|Array} obj Object to iterate over. - * @param {Function} iterator Iterator function. - * @param {Object=} context Object to become context (`this`) for the iterator function. - * @returns {Object|Array} Reference to `obj`. - */ - - function forEach(obj, iterator, context) { - var key, length; - if (obj) { - if (isFunction(obj)) { - for (key in obj) { - if (key !== 'prototype' && key !== 'length' && key !== 'name' && obj.hasOwnProperty(key)) { - iterator.call(context, obj[key], key, obj); - } - } - } else if (isArray(obj) || isArrayLike(obj)) { - var isPrimitive = typeof obj !== 'object'; - for (key = 0, length = obj.length; key < length; key++) { - if (isPrimitive || key in obj) { - iterator.call(context, obj[key], key, obj); - } - } - } else if (obj.forEach && obj.forEach !== forEach) { - obj.forEach(iterator, context, obj); - } else if (isBlankObject(obj)) { - // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty - for (key in obj) { - iterator.call(context, obj[key], key, obj); - } - } else if (typeof obj.hasOwnProperty === 'function') { - // Slow path for objects inheriting Object.prototype, hasOwnProperty check needed - for (key in obj) { - if (obj.hasOwnProperty(key)) { - iterator.call(context, obj[key], key, obj); - } - } - } else { - // Slow path for objects which do not have a method `hasOwnProperty` - for (key in obj) { - if (hasOwnProperty.call(obj, key)) { - iterator.call(context, obj[key], key, obj); - } - } - } - } - return obj; - } - - function forEachSorted(obj, iterator, context) { - var keys = Object.keys(obj).sort(); - for (var i = 0; i < keys.length; i++) { - iterator.call(context, obj[keys[i]], keys[i]); - } - return keys; - } - - - /** - * when using forEach the params are value, key, but it is often useful to have key, value. - * @param {function(string, *)} iteratorFn - * @returns {function(*, string)} - */ - function reverseParams(iteratorFn) { - return function(value, key) {iteratorFn(key, value);}; - } - - /** - * A consistent way of creating unique IDs in angular. - * - * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before - * we hit number precision issues in JavaScript. - * - * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M - * - * @returns {number} an unique alpha-numeric string - */ - function nextUid() { - return ++uid; - } - - - /** - * Set or clear the hashkey for an object. - * @param obj object - * @param h the hashkey (!truthy to delete the hashkey) - */ - function setHashKey(obj, h) { - if (h) { - obj.$$hashKey = h; - } else { - delete obj.$$hashKey; - } - } - - - function baseExtend(dst, objs, deep) { - var h = dst.$$hashKey; - - for (var i = 0, ii = objs.length; i < ii; ++i) { - var obj = objs[i]; - if (!isObject(obj) && !isFunction(obj)) continue; - var keys = Object.keys(obj); - for (var j = 0, jj = keys.length; j < jj; j++) { - var key = keys[j]; - var src = obj[key]; - - if (deep && isObject(src)) { - if (isDate(src)) { - dst[key] = new Date(src.valueOf()); - } else if (isRegExp(src)) { - dst[key] = new RegExp(src); - } else if (src.nodeName) { - dst[key] = src.cloneNode(true); - } else if (isElement(src)) { - dst[key] = src.clone(); - } else { - if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {}; - baseExtend(dst[key], [src], true); - } - } else { - dst[key] = src; - } - } - } - - setHashKey(dst, h); - return dst; - } - - /** - * @ngdoc function - * @name angular.extend - * @module ng - * @kind function - * - * @description - * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s) - * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so - * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`. - * - * **Note:** Keep in mind that `angular.extend` does not support recursive merge (deep copy). Use - * {@link angular.merge} for this. - * - * @param {Object} dst Destination object. - * @param {...Object} src Source object(s). - * @returns {Object} Reference to `dst`. - */ - function extend(dst) { - return baseExtend(dst, slice.call(arguments, 1), false); - } - - - /** - * @ngdoc function - * @name angular.merge - * @module ng - * @kind function - * - * @description - * Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s) - * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so - * by passing an empty object as the target: `var object = angular.merge({}, object1, object2)`. - * - * Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source - * objects, performing a deep copy. - * - * @deprecated - * sinceVersion="1.6.5" - * This function is deprecated, but will not be removed in the 1.x lifecycle. - * There are edge cases (see {@link angular.merge#known-issues known issues}) that are not - * supported by this function. We suggest - * using [lodash's merge()](https://lodash.com/docs/4.17.4#merge) instead. - * - * @knownIssue - * This is a list of (known) object types that are not handled correctly by this function: - * - [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob) - * - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream) - * - [`CanvasGradient`](https://developer.mozilla.org/docs/Web/API/CanvasGradient) - * - AngularJS {@link $rootScope.Scope scopes}; - * - * @param {Object} dst Destination object. - * @param {...Object} src Source object(s). - * @returns {Object} Reference to `dst`. - */ - function merge(dst) { - return baseExtend(dst, slice.call(arguments, 1), true); - } - - - - function toInt(str) { - return parseInt(str, 10); - } - - var isNumberNaN = Number.isNaN || function isNumberNaN(num) { - // eslint-disable-next-line no-self-compare - return num !== num; - }; - - - function inherit(parent, extra) { - return extend(Object.create(parent), extra); - } - - /** - * @ngdoc function - * @name angular.noop - * @module ng - * @kind function - * - * @description - * A function that performs no operations. This function can be useful when writing code in the - * functional style. - ```js - function foo(callback) { - var result = calculateResult(); - (callback || angular.noop)(result); - } - ``` - */ - function noop() {} - noop.$inject = []; - - - /** - * @ngdoc function - * @name angular.identity - * @module ng - * @kind function - * - * @description - * A function that returns its first argument. This function is useful when writing code in the - * functional style. - * - ```js - function transformer(transformationFn, value) { - return (transformationFn || angular.identity)(value); - }; - - // E.g. - function getResult(fn, input) { - return (fn || angular.identity)(input); - }; - - getResult(function(n) { return n * 2; }, 21); // returns 42 - getResult(null, 21); // returns 21 - getResult(undefined, 21); // returns 21 - ``` - * - * @param {*} value to be returned. - * @returns {*} the value passed in. - */ - function identity($) {return $;} - identity.$inject = []; - - - function valueFn(value) {return function valueRef() {return value;};} - - function hasCustomToString(obj) { - return isFunction(obj.toString) && obj.toString !== toString; - } - - - /** - * @ngdoc function - * @name angular.isUndefined - * @module ng - * @kind function - * - * @description - * Determines if a reference is undefined. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is undefined. - */ - function isUndefined(value) {return typeof value === 'undefined';} - - - /** - * @ngdoc function - * @name angular.isDefined - * @module ng - * @kind function - * - * @description - * Determines if a reference is defined. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is defined. - */ - function isDefined(value) {return typeof value !== 'undefined';} - - - /** - * @ngdoc function - * @name angular.isObject - * @module ng - * @kind function - * - * @description - * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not - * considered to be objects. Note that JavaScript arrays are objects. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is an `Object` but not `null`. - */ - function isObject(value) { - // http://jsperf.com/isobject4 - return value !== null && typeof value === 'object'; - } - - - /** - * Determine if a value is an object with a null prototype - * - * @returns {boolean} True if `value` is an `Object` with a null prototype - */ - function isBlankObject(value) { - return value !== null && typeof value === 'object' && !getPrototypeOf(value); - } - - - /** - * @ngdoc function - * @name angular.isString - * @module ng - * @kind function - * - * @description - * Determines if a reference is a `String`. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `String`. - */ - function isString(value) {return typeof value === 'string';} - - - /** - * @ngdoc function - * @name angular.isNumber - * @module ng - * @kind function - * - * @description - * Determines if a reference is a `Number`. - * - * This includes the "special" numbers `NaN`, `+Infinity` and `-Infinity`. - * - * If you wish to exclude these then you can use the native - * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite) - * method. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `Number`. - */ - function isNumber(value) {return typeof value === 'number';} - - - /** - * @ngdoc function - * @name angular.isDate - * @module ng - * @kind function - * - * @description - * Determines if a value is a date. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `Date`. - */ - function isDate(value) { - return toString.call(value) === '[object Date]'; - } - - - /** - * @ngdoc function - * @name angular.isArray - * @module ng - * @kind function - * - * @description - * Determines if a reference is an `Array`. Alias of Array.isArray. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is an `Array`. - */ - var isArray = Array.isArray; - - /** - * @description - * Determines if a reference is an `Error`. - * Loosely based on https://www.npmjs.com/package/iserror - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is an `Error`. - */ - function isError(value) { - var tag = toString.call(value); - switch (tag) { - case '[object Error]': return true; - case '[object Exception]': return true; - case '[object DOMException]': return true; - default: return value instanceof Error; - } - } - - /** - * @ngdoc function - * @name angular.isFunction - * @module ng - * @kind function - * - * @description - * Determines if a reference is a `Function`. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `Function`. - */ - function isFunction(value) {return typeof value === 'function';} - - - /** - * Determines if a value is a regular expression object. - * - * @private - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `RegExp`. - */ - function isRegExp(value) { - return toString.call(value) === '[object RegExp]'; - } - - - /** - * Checks if `obj` is a window object. - * - * @private - * @param {*} obj Object to check - * @returns {boolean} True if `obj` is a window obj. - */ - function isWindow(obj) { - return obj && obj.window === obj; - } - - - function isScope(obj) { - return obj && obj.$evalAsync && obj.$watch; - } - - - function isFile(obj) { - return toString.call(obj) === '[object File]'; - } - - - function isFormData(obj) { - return toString.call(obj) === '[object FormData]'; - } - - - function isBlob(obj) { - return toString.call(obj) === '[object Blob]'; - } - - - function isBoolean(value) { - return typeof value === 'boolean'; - } - - - function isPromiseLike(obj) { - return obj && isFunction(obj.then); - } - - - var TYPED_ARRAY_REGEXP = /^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/; - function isTypedArray(value) { - return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value)); - } - - function isArrayBuffer(obj) { - return toString.call(obj) === '[object ArrayBuffer]'; - } - - - var trim = function(value) { - return isString(value) ? value.trim() : value; - }; - -// Copied from: -// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021 -// Prereq: s is a string. - var escapeForRegexp = function(s) { - return s - .replace(/([-()[\]{}+?*.$^|,:#<!\\])/g, '\\$1') - // eslint-disable-next-line no-control-regex - .replace(/\x08/g, '\\x08'); - }; - - - /** - * @ngdoc function - * @name angular.isElement - * @module ng - * @kind function - * - * @description - * Determines if a reference is a DOM element (or wrapped jQuery element). - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element). - */ - function isElement(node) { - return !!(node && - (node.nodeName // We are a direct element. - || (node.prop && node.attr && node.find))); // We have an on and find method part of jQuery API. - } - - /** - * @param str 'key1,key2,...' - * @returns {object} in the form of {key1:true, key2:true, ...} - */ - function makeMap(str) { - var obj = {}, items = str.split(','), i; - for (i = 0; i < items.length; i++) { - obj[items[i]] = true; - } - return obj; - } - - - function nodeName_(element) { - return lowercase(element.nodeName || (element[0] && element[0].nodeName)); - } - - function includes(array, obj) { - return Array.prototype.indexOf.call(array, obj) !== -1; - } - - function arrayRemove(array, value) { - var index = array.indexOf(value); - if (index >= 0) { - array.splice(index, 1); - } - return index; - } - - /** - * @ngdoc function - * @name angular.copy - * @module ng - * @kind function - * - * @description - * Creates a deep copy of `source`, which should be an object or an array. - * - * * If no destination is supplied, a copy of the object or array is created. - * * If a destination is provided, all of its elements (for arrays) or properties (for objects) - * are deleted and then all elements/properties from the source are copied to it. - * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned. - * * If `source` is identical to `destination` an exception will be thrown. - * - * <br /> - * <div class="alert alert-warning"> - * Only enumerable properties are taken into account. Non-enumerable properties (both on `source` - * and on `destination`) will be ignored. - * </div> - * - * @param {*} source The source that will be used to make a copy. - * Can be any type, including primitives, `null`, and `undefined`. - * @param {(Object|Array)=} destination Destination into which the source is copied. If - * provided, must be of the same type as `source`. - * @returns {*} The copy or updated `destination`, if `destination` was specified. - * - * @example - <example module="copyExample" name="angular-copy"> - <file name="index.html"> - <div ng-controller="ExampleController"> - <form novalidate class="simple-form"> - <label>Name: <input type="text" ng-model="user.name" /></label><br /> - <label>Age: <input type="number" ng-model="user.age" /></label><br /> - Gender: <label><input type="radio" ng-model="user.gender" value="male" />male</label> - <label><input type="radio" ng-model="user.gender" value="female" />female</label><br /> - <button ng-click="reset()">RESET</button> - <button ng-click="update(user)">SAVE</button> - </form> - <pre>form = {{user | json}}</pre> - <pre>leader = {{leader | json}}</pre> - </div> - </file> - <file name="script.js"> - // Module: copyExample - angular. - module('copyExample', []). - controller('ExampleController', ['$scope', function($scope) { - $scope.leader = {}; - - $scope.reset = function() { - // Example with 1 argument - $scope.user = angular.copy($scope.leader); - }; - - $scope.update = function(user) { - // Example with 2 arguments - angular.copy(user, $scope.leader); - }; - - $scope.reset(); - }]); - </file> - </example> - */ - function copy(source, destination, maxDepth) { - var stackSource = []; - var stackDest = []; - maxDepth = isValidObjectMaxDepth(maxDepth) ? maxDepth : NaN; - - if (destination) { - if (isTypedArray(destination) || isArrayBuffer(destination)) { - throw ngMinErr('cpta', 'Can\'t copy! TypedArray destination cannot be mutated.'); - } - if (source === destination) { - throw ngMinErr('cpi', 'Can\'t copy! Source and destination are identical.'); - } - - // Empty the destination object - if (isArray(destination)) { - destination.length = 0; - } else { - forEach(destination, function(value, key) { - if (key !== '$$hashKey') { - delete destination[key]; - } - }); - } - - stackSource.push(source); - stackDest.push(destination); - return copyRecurse(source, destination, maxDepth); - } - - return copyElement(source, maxDepth); - - function copyRecurse(source, destination, maxDepth) { - maxDepth--; - if (maxDepth < 0) { - return '...'; - } - var h = destination.$$hashKey; - var key; - if (isArray(source)) { - for (var i = 0, ii = source.length; i < ii; i++) { - destination.push(copyElement(source[i], maxDepth)); - } - } else if (isBlankObject(source)) { - // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty - for (key in source) { - destination[key] = copyElement(source[key], maxDepth); - } - } else if (source && typeof source.hasOwnProperty === 'function') { - // Slow path, which must rely on hasOwnProperty - for (key in source) { - if (source.hasOwnProperty(key)) { - destination[key] = copyElement(source[key], maxDepth); - } - } - } else { - // Slowest path --- hasOwnProperty can't be called as a method - for (key in source) { - if (hasOwnProperty.call(source, key)) { - destination[key] = copyElement(source[key], maxDepth); - } - } - } - setHashKey(destination, h); - return destination; - } - - function copyElement(source, maxDepth) { - // Simple values - if (!isObject(source)) { - return source; - } - - // Already copied values - var index = stackSource.indexOf(source); - if (index !== -1) { - return stackDest[index]; - } - - if (isWindow(source) || isScope(source)) { - throw ngMinErr('cpws', - 'Can\'t copy! Making copies of Window or Scope instances is not supported.'); - } - - var needsRecurse = false; - var destination = copyType(source); - - if (destination === undefined) { - destination = isArray(source) ? [] : Object.create(getPrototypeOf(source)); - needsRecurse = true; - } - - stackSource.push(source); - stackDest.push(destination); - - return needsRecurse - ? copyRecurse(source, destination, maxDepth) - : destination; - } - - function copyType(source) { - switch (toString.call(source)) { - case '[object Int8Array]': - case '[object Int16Array]': - case '[object Int32Array]': - case '[object Float32Array]': - case '[object Float64Array]': - case '[object Uint8Array]': - case '[object Uint8ClampedArray]': - case '[object Uint16Array]': - case '[object Uint32Array]': - return new source.constructor(copyElement(source.buffer), source.byteOffset, source.length); - - case '[object ArrayBuffer]': - // Support: IE10 - if (!source.slice) { - // If we're in this case we know the environment supports ArrayBuffer - /* eslint-disable no-undef */ - var copied = new ArrayBuffer(source.byteLength); - new Uint8Array(copied).set(new Uint8Array(source)); - /* eslint-enable */ - return copied; - } - return source.slice(0); - - case '[object Boolean]': - case '[object Number]': - case '[object String]': - case '[object Date]': - return new source.constructor(source.valueOf()); - - case '[object RegExp]': - var re = new RegExp(source.source, source.toString().match(/[^/]*$/)[0]); - re.lastIndex = source.lastIndex; - return re; - - case '[object Blob]': - return new source.constructor([source], {type: source.type}); - } - - if (isFunction(source.cloneNode)) { - return source.cloneNode(true); - } - } - } - - -// eslint-disable-next-line no-self-compare - function simpleCompare(a, b) { return a === b || (a !== a && b !== b); } - - - /** - * @ngdoc function - * @name angular.equals - * @module ng - * @kind function - * - * @description - * Determines if two objects or two values are equivalent. Supports value types, regular - * expressions, arrays and objects. - * - * Two objects or values are considered equivalent if at least one of the following is true: - * - * * Both objects or values pass `===` comparison. - * * Both objects or values are of the same type and all of their properties are equal by - * comparing them with `angular.equals`. - * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal) - * * Both values represent the same regular expression (In JavaScript, - * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual - * representation matches). - * - * During a property comparison, properties of `function` type and properties with names - * that begin with `$` are ignored. - * - * Scope and DOMWindow objects are being compared only by identify (`===`). - * - * @param {*} o1 Object or value to compare. - * @param {*} o2 Object or value to compare. - * @returns {boolean} True if arguments are equal. - * - * @example - <example module="equalsExample" name="equalsExample"> - <file name="index.html"> - <div ng-controller="ExampleController"> - <form novalidate> - <h3>User 1</h3> - Name: <input type="text" ng-model="user1.name"> - Age: <input type="number" ng-model="user1.age"> - - <h3>User 2</h3> - Name: <input type="text" ng-model="user2.name"> - Age: <input type="number" ng-model="user2.age"> - - <div> - <br/> - <input type="button" value="Compare" ng-click="compare()"> - </div> - User 1: <pre>{{user1 | json}}</pre> - User 2: <pre>{{user2 | json}}</pre> - Equal: <pre>{{result}}</pre> - </form> - </div> - </file> - <file name="script.js"> - angular.module('equalsExample', []).controller('ExampleController', ['$scope', function($scope) { - $scope.user1 = {}; - $scope.user2 = {}; - $scope.compare = function() { - $scope.result = angular.equals($scope.user1, $scope.user2); - }; - }]); - </file> - </example> - */ - function equals(o1, o2) { - if (o1 === o2) return true; - if (o1 === null || o2 === null) return false; - // eslint-disable-next-line no-self-compare - if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN - var t1 = typeof o1, t2 = typeof o2, length, key, keySet; - if (t1 === t2 && t1 === 'object') { - if (isArray(o1)) { - if (!isArray(o2)) return false; - if ((length = o1.length) === o2.length) { - for (key = 0; key < length; key++) { - if (!equals(o1[key], o2[key])) return false; - } - return true; - } - } else if (isDate(o1)) { - if (!isDate(o2)) return false; - return simpleCompare(o1.getTime(), o2.getTime()); - } else if (isRegExp(o1)) { - if (!isRegExp(o2)) return false; - return o1.toString() === o2.toString(); - } else { - if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || - isArray(o2) || isDate(o2) || isRegExp(o2)) return false; - keySet = createMap(); - for (key in o1) { - if (key.charAt(0) === '$' || isFunction(o1[key])) continue; - if (!equals(o1[key], o2[key])) return false; - keySet[key] = true; - } - for (key in o2) { - if (!(key in keySet) && - key.charAt(0) !== '$' && - isDefined(o2[key]) && - !isFunction(o2[key])) return false; - } - return true; - } - } - return false; - } - - var csp = function() { - if (!isDefined(csp.rules)) { - - - var ngCspElement = (window.document.querySelector('[ng-csp]') || - window.document.querySelector('[data-ng-csp]')); - - if (ngCspElement) { - var ngCspAttribute = ngCspElement.getAttribute('ng-csp') || - ngCspElement.getAttribute('data-ng-csp'); - csp.rules = { - noUnsafeEval: !ngCspAttribute || (ngCspAttribute.indexOf('no-unsafe-eval') !== -1), - noInlineStyle: !ngCspAttribute || (ngCspAttribute.indexOf('no-inline-style') !== -1) - }; - } else { - csp.rules = { - noUnsafeEval: noUnsafeEval(), - noInlineStyle: false - }; - } - } - - return csp.rules; - - function noUnsafeEval() { - try { - // eslint-disable-next-line no-new, no-new-func - new Function(''); - return false; - } catch (e) { - return true; - } - } - }; - - /** - * @ngdoc directive - * @module ng - * @name ngJq - * - * @element ANY - * @param {string=} ngJq the name of the library available under `window` - * to be used for angular.element - * @description - * Use this directive to force the angular.element library. This should be - * used to force either jqLite by leaving ng-jq blank or setting the name of - * the jquery variable under window (eg. jQuery). - * - * Since AngularJS looks for this directive when it is loaded (doesn't wait for the - * DOMContentLoaded event), it must be placed on an element that comes before the script - * which loads angular. Also, only the first instance of `ng-jq` will be used and all - * others ignored. - * - * @example - * This example shows how to force jqLite using the `ngJq` directive to the `html` tag. - ```html - <!doctype html> - <html ng-app ng-jq> - ... - ... - </html> - ``` - * @example - * This example shows how to use a jQuery based library of a different name. - * The library name must be available at the top most 'window'. - ```html - <!doctype html> - <html ng-app ng-jq="jQueryLib"> - ... - ... - </html> - ``` - */ - var jq = function() { - if (isDefined(jq.name_)) return jq.name_; - var el; - var i, ii = ngAttrPrefixes.length, prefix, name; - for (i = 0; i < ii; ++i) { - prefix = ngAttrPrefixes[i]; - el = window.document.querySelector('[' + prefix.replace(':', '\\:') + 'jq]'); - if (el) { - name = el.getAttribute(prefix + 'jq'); - break; - } - } - - return (jq.name_ = name); - }; - - function concat(array1, array2, index) { - return array1.concat(slice.call(array2, index)); - } - - function sliceArgs(args, startIndex) { - return slice.call(args, startIndex || 0); - } - - - /** - * @ngdoc function - * @name angular.bind - * @module ng - * @kind function - * - * @description - * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for - * `fn`). You can supply optional `args` that are prebound to the function. This feature is also - * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as - * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application). - * - * @param {Object} self Context which `fn` should be evaluated in. - * @param {function()} fn Function to be bound. - * @param {...*} args Optional arguments to be prebound to the `fn` function call. - * @returns {function()} Function that wraps the `fn` with all the specified bindings. - */ - function bind(self, fn) { - var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : []; - if (isFunction(fn) && !(fn instanceof RegExp)) { - return curryArgs.length - ? function() { - return arguments.length - ? fn.apply(self, concat(curryArgs, arguments, 0)) - : fn.apply(self, curryArgs); - } - : function() { - return arguments.length - ? fn.apply(self, arguments) - : fn.call(self); - }; - } else { - // In IE, native methods are not functions so they cannot be bound (note: they don't need to be). - return fn; - } - } - - - function toJsonReplacer(key, value) { - var val = value; - - if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') { - val = undefined; - } else if (isWindow(value)) { - val = '$WINDOW'; - } else if (value && window.document === value) { - val = '$DOCUMENT'; - } else if (isScope(value)) { - val = '$SCOPE'; - } - - return val; - } - - - /** - * @ngdoc function - * @name angular.toJson - * @module ng - * @kind function - * - * @description - * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be - * stripped since AngularJS uses this notation internally. - * - * @param {Object|Array|Date|string|number|boolean} obj Input to be serialized into JSON. - * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace. - * If set to an integer, the JSON output will contain that many spaces per indentation. - * @returns {string|undefined} JSON-ified string representing `obj`. - * @knownIssue - * - * The Safari browser throws a `RangeError` instead of returning `null` when it tries to stringify a `Date` - * object with an invalid date value. The only reliable way to prevent this is to monkeypatch the - * `Date.prototype.toJSON` method as follows: - * - * ``` - * var _DatetoJSON = Date.prototype.toJSON; - * Date.prototype.toJSON = function() { - * try { - * return _DatetoJSON.call(this); - * } catch(e) { - * if (e instanceof RangeError) { - * return null; - * } - * throw e; - * } - * }; - * ``` - * - * See https://github.com/angular/angular.js/pull/14221 for more information. - */ - function toJson(obj, pretty) { - if (isUndefined(obj)) return undefined; - if (!isNumber(pretty)) { - pretty = pretty ? 2 : null; - } - return JSON.stringify(obj, toJsonReplacer, pretty); - } - - - /** - * @ngdoc function - * @name angular.fromJson - * @module ng - * @kind function - * - * @description - * Deserializes a JSON string. - * - * @param {string} json JSON string to deserialize. - * @returns {Object|Array|string|number} Deserialized JSON string. - */ - function fromJson(json) { - return isString(json) - ? JSON.parse(json) - : json; - } - - - var ALL_COLONS = /:/g; - function timezoneToOffset(timezone, fallback) { - // Support: IE 9-11 only, Edge 13-15+ - // IE/Edge do not "understand" colon (`:`) in timezone - timezone = timezone.replace(ALL_COLONS, ''); - var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000; - return isNumberNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset; - } - - - function addDateMinutes(date, minutes) { - date = new Date(date.getTime()); - date.setMinutes(date.getMinutes() + minutes); - return date; - } - - - function convertTimezoneToLocal(date, timezone, reverse) { - reverse = reverse ? -1 : 1; - var dateTimezoneOffset = date.getTimezoneOffset(); - var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset); - return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset)); - } - - - /** - * @returns {string} Returns the string representation of the element. - */ - function startingTag(element) { - element = jqLite(element).clone().empty(); - var elemHtml = jqLite('<div>').append(element).html(); - try { - return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) : - elemHtml. - match(/^(<[^>]+>)/)[1]. - replace(/^<([\w-]+)/, function(match, nodeName) {return '<' + lowercase(nodeName);}); - } catch (e) { - return lowercase(elemHtml); - } - - } - - -///////////////////////////////////////////////// - - /** - * Tries to decode the URI component without throwing an exception. - * - * @private - * @param str value potential URI component to check. - * @returns {boolean} True if `value` can be decoded - * with the decodeURIComponent function. - */ - function tryDecodeURIComponent(value) { - try { - return decodeURIComponent(value); - } catch (e) { - // Ignore any invalid uri component. - } - } - - - /** - * Parses an escaped url query string into key-value pairs. - * @returns {Object.<string,boolean|Array>} - */ - function parseKeyValue(/**string*/keyValue) { - var obj = {}; - forEach((keyValue || '').split('&'), function(keyValue) { - var splitPoint, key, val; - if (keyValue) { - key = keyValue = keyValue.replace(/\+/g,'%20'); - splitPoint = keyValue.indexOf('='); - if (splitPoint !== -1) { - key = keyValue.substring(0, splitPoint); - val = keyValue.substring(splitPoint + 1); - } - key = tryDecodeURIComponent(key); - if (isDefined(key)) { - val = isDefined(val) ? tryDecodeURIComponent(val) : true; - if (!hasOwnProperty.call(obj, key)) { - obj[key] = val; - } else if (isArray(obj[key])) { - obj[key].push(val); - } else { - obj[key] = [obj[key],val]; - } - } - } - }); - return obj; - } - - function toKeyValue(obj) { - var parts = []; - forEach(obj, function(value, key) { - if (isArray(value)) { - forEach(value, function(arrayValue) { - parts.push(encodeUriQuery(key, true) + - (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true))); - }); - } else { - parts.push(encodeUriQuery(key, true) + - (value === true ? '' : '=' + encodeUriQuery(value, true))); - } - }); - return parts.length ? parts.join('&') : ''; - } - - - /** - * We need our custom method because encodeURIComponent is too aggressive and doesn't follow - * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path - * segments: - * segment = *pchar - * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - * pct-encoded = "%" HEXDIG HEXDIG - * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" - * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" - * / "*" / "+" / "," / ";" / "=" - */ - function encodeUriSegment(val) { - return encodeUriQuery(val, true). - replace(/%26/gi, '&'). - replace(/%3D/gi, '='). - replace(/%2B/gi, '+'); - } - - - /** - * This method is intended for encoding *key* or *value* parts of query component. We need a custom - * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be - * encoded per http://tools.ietf.org/html/rfc3986: - * query = *( pchar / "/" / "?" ) - * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" - * pct-encoded = "%" HEXDIG HEXDIG - * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" - * / "*" / "+" / "," / ";" / "=" - */ - function encodeUriQuery(val, pctEncodeSpaces) { - return encodeURIComponent(val). - replace(/%40/gi, '@'). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%3B/gi, ';'). - replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); - } - - var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-']; - - function getNgAttribute(element, ngAttr) { - var attr, i, ii = ngAttrPrefixes.length; - for (i = 0; i < ii; ++i) { - attr = ngAttrPrefixes[i] + ngAttr; - if (isString(attr = element.getAttribute(attr))) { - return attr; - } - } - return null; - } - - function allowAutoBootstrap(document) { - var script = document.currentScript; - - if (!script) { - // Support: IE 9-11 only - // IE does not have `document.currentScript` - return true; - } - - // If the `currentScript` property has been clobbered just return false, since this indicates a probable attack - if (!(script instanceof window.HTMLScriptElement || script instanceof window.SVGScriptElement)) { - return false; - } - - var attributes = script.attributes; - var srcs = [attributes.getNamedItem('src'), attributes.getNamedItem('href'), attributes.getNamedItem('xlink:href')]; - - return srcs.every(function(src) { - if (!src) { - return true; - } - if (!src.value) { - return false; - } - - var link = document.createElement('a'); - link.href = src.value; - - if (document.location.origin === link.origin) { - // Same-origin resources are always allowed, even for non-whitelisted schemes. - return true; - } - // Disabled bootstrapping unless angular.js was loaded from a known scheme used on the web. - // This is to prevent angular.js bundled with browser extensions from being used to bypass the - // content security policy in web pages and other browser extensions. - switch (link.protocol) { - case 'http:': - case 'https:': - case 'ftp:': - case 'blob:': - case 'file:': - case 'data:': - return true; - default: - return false; - } - }); - } - -// Cached as it has to run during loading so that document.currentScript is available. - var isAutoBootstrapAllowed = allowAutoBootstrap(window.document); - - /** - * @ngdoc directive - * @name ngApp - * @module ng - * - * @element ANY - * @param {angular.Module} ngApp an optional application - * {@link angular.module module} name to load. - * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be - * created in "strict-di" mode. This means that the application will fail to invoke functions which - * do not use explicit function annotation (and are thus unsuitable for minification), as described - * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in - * tracking down the root of these bugs. - * - * @description - * - * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive - * designates the **root element** of the application and is typically placed near the root element - * of the page - e.g. on the `<body>` or `<html>` tags. - * - * There are a few things to keep in mind when using `ngApp`: - * - only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp` - * found in the document will be used to define the root element to auto-bootstrap as an - * application. To run multiple applications in an HTML document you must manually bootstrap them using - * {@link angular.bootstrap} instead. - * - AngularJS applications cannot be nested within each other. - * - Do not use a directive that uses {@link ng.$compile#transclusion transclusion} on the same element as `ngApp`. - * This includes directives such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and - * {@link ngRoute.ngView `ngView`}. - * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector}, - * causing animations to stop working and making the injector inaccessible from outside the app. - * - * You can specify an **AngularJS module** to be used as the root module for the application. This - * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It - * should contain the application code needed or have dependencies on other modules that will - * contain the code. See {@link angular.module} for more information. - * - * In the example below if the `ngApp` directive were not placed on the `html` element then the - * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}` - * would not be resolved to `3`. - * - * @example - * - * ### Simple Usage - * - * `ngApp` is the easiest, and most common way to bootstrap an application. - * - <example module="ngAppDemo" name="ng-app"> - <file name="index.html"> - <div ng-controller="ngAppDemoController"> - I can add: {{a}} + {{b}} = {{ a+b }} - </div> - </file> - <file name="script.js"> - angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) { - $scope.a = 1; - $scope.b = 2; - }); - </file> - </example> - * - * @example - * - * ### With `ngStrictDi` - * - * Using `ngStrictDi`, you would see something like this: - * - <example ng-app-included="true" name="strict-di"> - <file name="index.html"> - <div ng-app="ngAppStrictDemo" ng-strict-di> - <div ng-controller="GoodController1"> - I can add: {{a}} + {{b}} = {{ a+b }} - - <p>This renders because the controller does not fail to - instantiate, by using explicit annotation style (see - script.js for details) - </p> - </div> - - <div ng-controller="GoodController2"> - Name: <input ng-model="name"><br /> - Hello, {{name}}! - - <p>This renders because the controller does not fail to - instantiate, by using explicit annotation style - (see script.js for details) - </p> - </div> - - <div ng-controller="BadController"> - I can add: {{a}} + {{b}} = {{ a+b }} - - <p>The controller could not be instantiated, due to relying - on automatic function annotations (which are disabled in - strict mode). As such, the content of this section is not - interpolated, and there should be an error in your web console. - </p> - </div> - </div> - </file> - <file name="script.js"> - angular.module('ngAppStrictDemo', []) - // BadController will fail to instantiate, due to relying on automatic function annotation, - // rather than an explicit annotation - .controller('BadController', function($scope) { - $scope.a = 1; - $scope.b = 2; - }) - // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated, - // due to using explicit annotations using the array style and $inject property, respectively. - .controller('GoodController1', ['$scope', function($scope) { - $scope.a = 1; - $scope.b = 2; - }]) - .controller('GoodController2', GoodController2); - function GoodController2($scope) { - $scope.name = 'World'; - } - GoodController2.$inject = ['$scope']; - </file> - <file name="style.css"> - div[ng-controller] { - margin-bottom: 1em; - -webkit-border-radius: 4px; - border-radius: 4px; - border: 1px solid; - padding: .5em; - } - div[ng-controller^=Good] { - border-color: #d6e9c6; - background-color: #dff0d8; - color: #3c763d; - } - div[ng-controller^=Bad] { - border-color: #ebccd1; - background-color: #f2dede; - color: #a94442; - margin-bottom: 0; - } - </file> - </example> - */ - function angularInit(element, bootstrap) { - var appElement, - module, - config = {}; - - // The element `element` has priority over any other element. - forEach(ngAttrPrefixes, function(prefix) { - var name = prefix + 'app'; - - if (!appElement && element.hasAttribute && element.hasAttribute(name)) { - appElement = element; - module = element.getAttribute(name); - } - }); - forEach(ngAttrPrefixes, function(prefix) { - var name = prefix + 'app'; - var candidate; - - if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) { - appElement = candidate; - module = candidate.getAttribute(name); - } - }); - if (appElement) { - if (!isAutoBootstrapAllowed) { - window.console.error('AngularJS: disabling automatic bootstrap. <script> protocol indicates ' + - 'an extension, document.location.href does not match.'); - return; - } - config.strictDi = getNgAttribute(appElement, 'strict-di') !== null; - bootstrap(appElement, module ? [module] : [], config); - } - } - - /** - * @ngdoc function - * @name angular.bootstrap - * @module ng - * @description - * Use this function to manually start up AngularJS application. - * - * For more information, see the {@link guide/bootstrap Bootstrap guide}. - * - * AngularJS will detect if it has been loaded into the browser more than once and only allow the - * first loaded script to be bootstrapped and will report a warning to the browser console for - * each of the subsequent scripts. This prevents strange results in applications, where otherwise - * multiple instances of AngularJS try to work on the DOM. - * - * <div class="alert alert-warning"> - * **Note:** Protractor based end-to-end tests cannot use this function to bootstrap manually. - * They must use {@link ng.directive:ngApp ngApp}. - * </div> - * - * <div class="alert alert-warning"> - * **Note:** Do not bootstrap the app on an element with a directive that uses {@link ng.$compile#transclusion transclusion}, - * such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and {@link ngRoute.ngView `ngView`}. - * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector}, - * causing animations to stop working and making the injector inaccessible from outside the app. - * </div> - * - * ```html - * <!doctype html> - * <html> - * <body> - * <div ng-controller="WelcomeController"> - * {{greeting}} - * </div> - * - * <script src="angular.js"></script> - * <script> - * var app = angular.module('demo', []) - * .controller('WelcomeController', function($scope) { - * $scope.greeting = 'Welcome!'; - * }); - * angular.bootstrap(document, ['demo']); - * </script> - * </body> - * </html> - * ``` - * - * @param {DOMElement} element DOM element which is the root of AngularJS application. - * @param {Array<String|Function|Array>=} modules an array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a `config` block. - * See: {@link angular.module modules} - * @param {Object=} config an object for defining configuration options for the application. The - * following keys are supported: - * - * * `strictDi` - disable automatic function annotation for the application. This is meant to - * assist in finding bugs which break minified code. Defaults to `false`. - * - * @returns {auto.$injector} Returns the newly created injector for this app. - */ - function bootstrap(element, modules, config) { - if (!isObject(config)) config = {}; - var defaultConfig = { - strictDi: false - }; - config = extend(defaultConfig, config); - var doBootstrap = function() { - element = jqLite(element); - - if (element.injector()) { - var tag = (element[0] === window.document) ? 'document' : startingTag(element); - // Encode angle brackets to prevent input from being sanitized to empty string #8683. - throw ngMinErr( - 'btstrpd', - 'App already bootstrapped with this element \'{0}\'', - tag.replace(/</,'<').replace(/>/,'>')); - } - - modules = modules || []; - modules.unshift(['$provide', function($provide) { - $provide.value('$rootElement', element); - }]); - - if (config.debugInfoEnabled) { - // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`. - modules.push(['$compileProvider', function($compileProvider) { - $compileProvider.debugInfoEnabled(true); - }]); - } - - modules.unshift('ng'); - var injector = createInjector(modules, config.strictDi); - injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', - function bootstrapApply(scope, element, compile, injector) { - scope.$apply(function() { - element.data('$injector', injector); - compile(element)(scope); - }); - }] - ); - return injector; - }; - - var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/; - var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/; - - if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) { - config.debugInfoEnabled = true; - window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, ''); - } - - if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) { - return doBootstrap(); - } - - window.name = window.name.replace(NG_DEFER_BOOTSTRAP, ''); - angular.resumeBootstrap = function(extraModules) { - forEach(extraModules, function(module) { - modules.push(module); - }); - return doBootstrap(); - }; - - if (isFunction(angular.resumeDeferredBootstrap)) { - angular.resumeDeferredBootstrap(); - } - } - - /** - * @ngdoc function - * @name angular.reloadWithDebugInfo - * @module ng - * @description - * Use this function to reload the current application with debug information turned on. - * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`. - * - * See {@link ng.$compileProvider#debugInfoEnabled} for more. - */ - function reloadWithDebugInfo() { - window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name; - window.location.reload(); - } - - /** - * @name angular.getTestability - * @module ng - * @description - * Get the testability service for the instance of AngularJS on the given - * element. - * @param {DOMElement} element DOM element which is the root of AngularJS application. - */ - function getTestability(rootElement) { - var injector = angular.element(rootElement).injector(); - if (!injector) { - throw ngMinErr('test', - 'no injector found for element argument to getTestability'); - } - return injector.get('$$testability'); - } - - var SNAKE_CASE_REGEXP = /[A-Z]/g; - function snake_case(name, separator) { - separator = separator || '_'; - return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) { - return (pos ? separator : '') + letter.toLowerCase(); - }); - } - - var bindJQueryFired = false; - function bindJQuery() { - var originalCleanData; - - if (bindJQueryFired) { - return; - } - - // bind to jQuery if present; - var jqName = jq(); - jQuery = isUndefined(jqName) ? window.jQuery : // use jQuery (if present) - !jqName ? undefined : // use jqLite - window[jqName]; // use jQuery specified by `ngJq` - - // Use jQuery if it exists with proper functionality, otherwise default to us. - // AngularJS 1.2+ requires jQuery 1.7+ for on()/off() support. - // AngularJS 1.3+ technically requires at least jQuery 2.1+ but it may work with older - // versions. It will not work for sure with jQuery <1.7, though. - if (jQuery && jQuery.fn.on) { - jqLite = jQuery; - extend(jQuery.fn, { - scope: JQLitePrototype.scope, - isolateScope: JQLitePrototype.isolateScope, - controller: /** @type {?} */ (JQLitePrototype).controller, - injector: JQLitePrototype.injector, - inheritedData: JQLitePrototype.inheritedData - }); - - // All nodes removed from the DOM via various jQuery APIs like .remove() - // are passed through jQuery.cleanData. Monkey-patch this method to fire - // the $destroy event on all removed nodes. - originalCleanData = jQuery.cleanData; - jQuery.cleanData = function(elems) { - var events; - for (var i = 0, elem; (elem = elems[i]) != null; i++) { - events = jQuery._data(elem, 'events'); - if (events && events.$destroy) { - jQuery(elem).triggerHandler('$destroy'); - } - } - originalCleanData(elems); - }; - } else { - jqLite = JQLite; - } - - angular.element = jqLite; - - // Prevent double-proxying. - bindJQueryFired = true; - } - - /** - * throw error if the argument is falsy. - */ - function assertArg(arg, name, reason) { - if (!arg) { - throw ngMinErr('areq', 'Argument \'{0}\' is {1}', (name || '?'), (reason || 'required')); - } - return arg; - } - - function assertArgFn(arg, name, acceptArrayAnnotation) { - if (acceptArrayAnnotation && isArray(arg)) { - arg = arg[arg.length - 1]; - } - - assertArg(isFunction(arg), name, 'not a function, got ' + - (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg)); - return arg; - } - - /** - * throw error if the name given is hasOwnProperty - * @param {String} name the name to test - * @param {String} context the context in which the name is used, such as module or directive - */ - function assertNotHasOwnProperty(name, context) { - if (name === 'hasOwnProperty') { - throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context); - } - } - - /** - * Return the value accessible from the object by path. Any undefined traversals are ignored - * @param {Object} obj starting object - * @param {String} path path to traverse - * @param {boolean} [bindFnToScope=true] - * @returns {Object} value as accessible by path - */ -//TODO(misko): this function needs to be removed - function getter(obj, path, bindFnToScope) { - if (!path) return obj; - var keys = path.split('.'); - var key; - var lastInstance = obj; - var len = keys.length; - - for (var i = 0; i < len; i++) { - key = keys[i]; - if (obj) { - obj = (lastInstance = obj)[key]; - } - } - if (!bindFnToScope && isFunction(obj)) { - return bind(lastInstance, obj); - } - return obj; - } - - /** - * Return the DOM siblings between the first and last node in the given array. - * @param {Array} array like object - * @returns {Array} the inputted object or a jqLite collection containing the nodes - */ - function getBlockNodes(nodes) { - // TODO(perf): update `nodes` instead of creating a new object? - var node = nodes[0]; - var endNode = nodes[nodes.length - 1]; - var blockNodes; - - for (var i = 1; node !== endNode && (node = node.nextSibling); i++) { - if (blockNodes || nodes[i] !== node) { - if (!blockNodes) { - blockNodes = jqLite(slice.call(nodes, 0, i)); - } - blockNodes.push(node); - } - } - - return blockNodes || nodes; - } - - - /** - * Creates a new object without a prototype. This object is useful for lookup without having to - * guard against prototypically inherited properties via hasOwnProperty. - * - * Related micro-benchmarks: - * - http://jsperf.com/object-create2 - * - http://jsperf.com/proto-map-lookup/2 - * - http://jsperf.com/for-in-vs-object-keys2 - * - * @returns {Object} - */ - function createMap() { - return Object.create(null); - } - - function stringify(value) { - if (value == null) { // null || undefined - return ''; - } - switch (typeof value) { - case 'string': - break; - case 'number': - value = '' + value; - break; - default: - if (hasCustomToString(value) && !isArray(value) && !isDate(value)) { - value = value.toString(); - } else { - value = toJson(value); - } - } - - return value; - } - - var NODE_TYPE_ELEMENT = 1; - var NODE_TYPE_ATTRIBUTE = 2; - var NODE_TYPE_TEXT = 3; - var NODE_TYPE_COMMENT = 8; - var NODE_TYPE_DOCUMENT = 9; - var NODE_TYPE_DOCUMENT_FRAGMENT = 11; - - /** - * @ngdoc type - * @name angular.Module - * @module ng - * @description - * - * Interface for configuring AngularJS {@link angular.module modules}. - */ - - function setupModuleLoader(window) { - - var $injectorMinErr = minErr('$injector'); - var ngMinErr = minErr('ng'); - - function ensure(obj, name, factory) { - return obj[name] || (obj[name] = factory()); - } - - var angular = ensure(window, 'angular', Object); - - // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap - angular.$$minErr = angular.$$minErr || minErr; - - return ensure(angular, 'module', function() { - /** @type {Object.<string, angular.Module>} */ - var modules = {}; - - /** - * @ngdoc function - * @name angular.module - * @module ng - * @description - * - * The `angular.module` is a global place for creating, registering and retrieving AngularJS - * modules. - * All modules (AngularJS core or 3rd party) that should be available to an application must be - * registered using this mechanism. - * - * Passing one argument retrieves an existing {@link angular.Module}, - * whereas passing more than one argument creates a new {@link angular.Module} - * - * - * # Module - * - * A module is a collection of services, directives, controllers, filters, and configuration information. - * `angular.module` is used to configure the {@link auto.$injector $injector}. - * - * ```js - * // Create a new module - * var myModule = angular.module('myModule', []); - * - * // register a new service - * myModule.value('appName', 'MyCoolApp'); - * - * // configure existing services inside initialization blocks. - * myModule.config(['$locationProvider', function($locationProvider) { - * // Configure existing providers - * $locationProvider.hashPrefix('!'); - * }]); - * ``` - * - * Then you can create an injector and load your modules like this: - * - * ```js - * var injector = angular.injector(['ng', 'myModule']) - * ``` - * - * However it's more likely that you'll just use - * {@link ng.directive:ngApp ngApp} or - * {@link angular.bootstrap} to simplify this process for you. - * - * @param {!string} name The name of the module to create or retrieve. - * @param {!Array.<string>=} requires If specified then new module is being created. If - * unspecified then the module is being retrieved for further configuration. - * @param {Function=} configFn Optional configuration function for the module. Same as - * {@link angular.Module#config Module#config()}. - * @returns {angular.Module} new module with the {@link angular.Module} api. - */ - return function module(name, requires, configFn) { - - var info = {}; - - var assertNotHasOwnProperty = function(name, context) { - if (name === 'hasOwnProperty') { - throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context); - } - }; - - assertNotHasOwnProperty(name, 'module'); - if (requires && modules.hasOwnProperty(name)) { - modules[name] = null; - } - return ensure(modules, name, function() { - if (!requires) { - throw $injectorMinErr('nomod', 'Module \'{0}\' is not available! You either misspelled ' + - 'the module name or forgot to load it. If registering a module ensure that you ' + - 'specify the dependencies as the second argument.', name); - } - - /** @type {!Array.<Array.<*>>} */ - var invokeQueue = []; - - /** @type {!Array.<Function>} */ - var configBlocks = []; - - /** @type {!Array.<Function>} */ - var runBlocks = []; - - var config = invokeLater('$injector', 'invoke', 'push', configBlocks); - - /** @type {angular.Module} */ - var moduleInstance = { - // Private state - _invokeQueue: invokeQueue, - _configBlocks: configBlocks, - _runBlocks: runBlocks, - - /** - * @ngdoc method - * @name angular.Module#info - * @module ng - * - * @param {Object=} info Information about the module - * @returns {Object|Module} The current info object for this module if called as a getter, - * or `this` if called as a setter. - * - * @description - * Read and write custom information about this module. - * For example you could put the version of the module in here. - * - * ```js - * angular.module('myModule', []).info({ version: '1.0.0' }); - * ``` - * - * The version could then be read back out by accessing the module elsewhere: - * - * ``` - * var version = angular.module('myModule').info().version; - * ``` - * - * You can also retrieve this information during runtime via the - * {@link $injector#modules `$injector.modules`} property: - * - * ```js - * var version = $injector.modules['myModule'].info().version; - * ``` - */ - info: function(value) { - if (isDefined(value)) { - if (!isObject(value)) throw ngMinErr('aobj', 'Argument \'{0}\' must be an object', 'value'); - info = value; - return this; - } - return info; - }, - - /** - * @ngdoc property - * @name angular.Module#requires - * @module ng - * - * @description - * Holds the list of modules which the injector will load before the current module is - * loaded. - */ - requires: requires, - - /** - * @ngdoc property - * @name angular.Module#name - * @module ng - * - * @description - * Name of the module. - */ - name: name, - - - /** - * @ngdoc method - * @name angular.Module#provider - * @module ng - * @param {string} name service name - * @param {Function} providerType Construction function for creating new instance of the - * service. - * @description - * See {@link auto.$provide#provider $provide.provider()}. - */ - provider: invokeLaterAndSetModuleName('$provide', 'provider'), - - /** - * @ngdoc method - * @name angular.Module#factory - * @module ng - * @param {string} name service name - * @param {Function} providerFunction Function for creating new instance of the service. - * @description - * See {@link auto.$provide#factory $provide.factory()}. - */ - factory: invokeLaterAndSetModuleName('$provide', 'factory'), - - /** - * @ngdoc method - * @name angular.Module#service - * @module ng - * @param {string} name service name - * @param {Function} constructor A constructor function that will be instantiated. - * @description - * See {@link auto.$provide#service $provide.service()}. - */ - service: invokeLaterAndSetModuleName('$provide', 'service'), - - /** - * @ngdoc method - * @name angular.Module#value - * @module ng - * @param {string} name service name - * @param {*} object Service instance object. - * @description - * See {@link auto.$provide#value $provide.value()}. - */ - value: invokeLater('$provide', 'value'), - - /** - * @ngdoc method - * @name angular.Module#constant - * @module ng - * @param {string} name constant name - * @param {*} object Constant value. - * @description - * Because the constants are fixed, they get applied before other provide methods. - * See {@link auto.$provide#constant $provide.constant()}. - */ - constant: invokeLater('$provide', 'constant', 'unshift'), - - /** - * @ngdoc method - * @name angular.Module#decorator - * @module ng - * @param {string} name The name of the service to decorate. - * @param {Function} decorFn This function will be invoked when the service needs to be - * instantiated and should return the decorated service instance. - * @description - * See {@link auto.$provide#decorator $provide.decorator()}. - */ - decorator: invokeLaterAndSetModuleName('$provide', 'decorator', configBlocks), - - /** - * @ngdoc method - * @name angular.Module#animation - * @module ng - * @param {string} name animation name - * @param {Function} animationFactory Factory function for creating new instance of an - * animation. - * @description - * - * **NOTE**: animations take effect only if the **ngAnimate** module is loaded. - * - * - * Defines an animation hook that can be later used with - * {@link $animate $animate} service and directives that use this service. - * - * ```js - * module.animation('.animation-name', function($inject1, $inject2) { - * return { - * eventName : function(element, done) { - * //code to run the animation - * //once complete, then run done() - * return function cancellationFunction(element) { - * //code to cancel the animation - * } - * } - * } - * }) - * ``` - * - * See {@link ng.$animateProvider#register $animateProvider.register()} and - * {@link ngAnimate ngAnimate module} for more information. - */ - animation: invokeLaterAndSetModuleName('$animateProvider', 'register'), - - /** - * @ngdoc method - * @name angular.Module#filter - * @module ng - * @param {string} name Filter name - this must be a valid AngularJS expression identifier - * @param {Function} filterFactory Factory function for creating new instance of filter. - * @description - * See {@link ng.$filterProvider#register $filterProvider.register()}. - * - * <div class="alert alert-warning"> - * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`. - * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace - * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores - * (`myapp_subsection_filterx`). - * </div> - */ - filter: invokeLaterAndSetModuleName('$filterProvider', 'register'), - - /** - * @ngdoc method - * @name angular.Module#controller - * @module ng - * @param {string|Object} name Controller name, or an object map of controllers where the - * keys are the names and the values are the constructors. - * @param {Function} constructor Controller constructor function. - * @description - * See {@link ng.$controllerProvider#register $controllerProvider.register()}. - */ - controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'), - - /** - * @ngdoc method - * @name angular.Module#directive - * @module ng - * @param {string|Object} name Directive name, or an object map of directives where the - * keys are the names and the values are the factories. - * @param {Function} directiveFactory Factory function for creating new instance of - * directives. - * @description - * See {@link ng.$compileProvider#directive $compileProvider.directive()}. - */ - directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'), - - /** - * @ngdoc method - * @name angular.Module#component - * @module ng - * @param {string} name Name of the component in camel-case (i.e. myComp which will match as my-comp) - * @param {Object} options Component definition object (a simplified - * {@link ng.$compile#directive-definition-object directive definition object}) - * - * @description - * See {@link ng.$compileProvider#component $compileProvider.component()}. - */ - component: invokeLaterAndSetModuleName('$compileProvider', 'component'), - - /** - * @ngdoc method - * @name angular.Module#config - * @module ng - * @param {Function} configFn Execute this function on module load. Useful for service - * configuration. - * @description - * Use this method to configure services by injecting their - * {@link angular.Module#provider `providers`}, e.g. for adding routes to the - * {@link ngRoute.$routeProvider $routeProvider}. - * - * Note that you can only inject {@link angular.Module#provider `providers`} and - * {@link angular.Module#constant `constants`} into this function. - * - * For more about how to configure services, see - * {@link providers#provider-recipe Provider Recipe}. - */ - config: config, - - /** - * @ngdoc method - * @name angular.Module#run - * @module ng - * @param {Function} initializationFn Execute this function after injector creation. - * Useful for application initialization. - * @description - * Use this method to register work which should be performed when the injector is done - * loading all modules. - */ - run: function(block) { - runBlocks.push(block); - return this; - } - }; - - if (configFn) { - config(configFn); - } - - return moduleInstance; - - /** - * @param {string} provider - * @param {string} method - * @param {String=} insertMethod - * @returns {angular.Module} - */ - function invokeLater(provider, method, insertMethod, queue) { - if (!queue) queue = invokeQueue; - return function() { - queue[insertMethod || 'push']([provider, method, arguments]); - return moduleInstance; - }; - } - - /** - * @param {string} provider - * @param {string} method - * @returns {angular.Module} - */ - function invokeLaterAndSetModuleName(provider, method, queue) { - if (!queue) queue = invokeQueue; - return function(recipeName, factoryFunction) { - if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name; - queue.push([provider, method, arguments]); - return moduleInstance; - }; - } - }); - }; - }); - - } - - /* global shallowCopy: true */ - - /** - * Creates a shallow copy of an object, an array or a primitive. - * - * Assumes that there are no proto properties for objects. - */ - function shallowCopy(src, dst) { - if (isArray(src)) { - dst = dst || []; - - for (var i = 0, ii = src.length; i < ii; i++) { - dst[i] = src[i]; - } - } else if (isObject(src)) { - dst = dst || {}; - - for (var key in src) { - if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) { - dst[key] = src[key]; - } - } - } - - return dst || src; - } - - /* exported toDebugString */ - - function serializeObject(obj, maxDepth) { - var seen = []; - - // There is no direct way to stringify object until reaching a specific depth - // and a very deep object can cause a performance issue, so we copy the object - // based on this specific depth and then stringify it. - if (isValidObjectMaxDepth(maxDepth)) { - // This file is also included in `angular-loader`, so `copy()` might not always be available in - // the closure. Therefore, it is lazily retrieved as `angular.copy()` when needed. - obj = angular.copy(obj, null, maxDepth); - } - return JSON.stringify(obj, function(key, val) { - val = toJsonReplacer(key, val); - if (isObject(val)) { - - if (seen.indexOf(val) >= 0) return '...'; - - seen.push(val); - } - return val; - }); - } - - function toDebugString(obj, maxDepth) { - if (typeof obj === 'function') { - return obj.toString().replace(/ \{[\s\S]*$/, ''); - } else if (isUndefined(obj)) { - return 'undefined'; - } else if (typeof obj !== 'string') { - return serializeObject(obj, maxDepth); - } - return obj; - } - - /* global angularModule: true, - version: true, - - $CompileProvider, - - htmlAnchorDirective, - inputDirective, - inputDirective, - formDirective, - scriptDirective, - selectDirective, - optionDirective, - ngBindDirective, - ngBindHtmlDirective, - ngBindTemplateDirective, - ngClassDirective, - ngClassEvenDirective, - ngClassOddDirective, - ngCloakDirective, - ngControllerDirective, - ngFormDirective, - ngHideDirective, - ngIfDirective, - ngIncludeDirective, - ngIncludeFillContentDirective, - ngInitDirective, - ngNonBindableDirective, - ngPluralizeDirective, - ngRepeatDirective, - ngShowDirective, - ngStyleDirective, - ngSwitchDirective, - ngSwitchWhenDirective, - ngSwitchDefaultDirective, - ngOptionsDirective, - ngTranscludeDirective, - ngModelDirective, - ngListDirective, - ngChangeDirective, - patternDirective, - patternDirective, - requiredDirective, - requiredDirective, - minlengthDirective, - minlengthDirective, - maxlengthDirective, - maxlengthDirective, - ngValueDirective, - ngModelOptionsDirective, - ngAttributeAliasDirectives, - ngEventDirectives, - - $AnchorScrollProvider, - $AnimateProvider, - $CoreAnimateCssProvider, - $$CoreAnimateJsProvider, - $$CoreAnimateQueueProvider, - $$AnimateRunnerFactoryProvider, - $$AnimateAsyncRunFactoryProvider, - $BrowserProvider, - $CacheFactoryProvider, - $ControllerProvider, - $DateProvider, - $DocumentProvider, - $$IsDocumentHiddenProvider, - $ExceptionHandlerProvider, - $FilterProvider, - $$ForceReflowProvider, - $InterpolateProvider, - $IntervalProvider, - $HttpProvider, - $HttpParamSerializerProvider, - $HttpParamSerializerJQLikeProvider, - $HttpBackendProvider, - $xhrFactoryProvider, - $jsonpCallbacksProvider, - $LocationProvider, - $LogProvider, - $$MapProvider, - $ParseProvider, - $RootScopeProvider, - $QProvider, - $$QProvider, - $$SanitizeUriProvider, - $SceProvider, - $SceDelegateProvider, - $SnifferProvider, - $TemplateCacheProvider, - $TemplateRequestProvider, - $$TestabilityProvider, - $TimeoutProvider, - $$RAFProvider, - $WindowProvider, - $$jqLiteProvider, - $$CookieReaderProvider -*/ - - - /** - * @ngdoc object - * @name angular.version - * @module ng - * @description - * An object that contains information about the current AngularJS version. - * - * This object has the following properties: - * - * - `full` – `{string}` – Full version string, such as "0.9.18". - * - `major` – `{number}` – Major version number, such as "0". - * - `minor` – `{number}` – Minor version number, such as "9". - * - `dot` – `{number}` – Dot version number, such as "18". - * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". - */ - var version = { - // These placeholder strings will be replaced by grunt's `build` task. - // They need to be double- or single-quoted. - full: '1.6.9', - major: 1, - minor: 6, - dot: 9, - codeName: 'fiery-basilisk' - }; - - - function publishExternalAPI(angular) { - extend(angular, { - 'errorHandlingConfig': errorHandlingConfig, - 'bootstrap': bootstrap, - 'copy': copy, - 'extend': extend, - 'merge': merge, - 'equals': equals, - 'element': jqLite, - 'forEach': forEach, - 'injector': createInjector, - 'noop': noop, - 'bind': bind, - 'toJson': toJson, - 'fromJson': fromJson, - 'identity': identity, - 'isUndefined': isUndefined, - 'isDefined': isDefined, - 'isString': isString, - 'isFunction': isFunction, - 'isObject': isObject, - 'isNumber': isNumber, - 'isElement': isElement, - 'isArray': isArray, - 'version': version, - 'isDate': isDate, - 'lowercase': lowercase, - 'uppercase': uppercase, - 'callbacks': {$$counter: 0}, - 'getTestability': getTestability, - 'reloadWithDebugInfo': reloadWithDebugInfo, - '$$minErr': minErr, - '$$csp': csp, - '$$encodeUriSegment': encodeUriSegment, - '$$encodeUriQuery': encodeUriQuery, - '$$stringify': stringify - }); - - angularModule = setupModuleLoader(window); - - angularModule('ng', ['ngLocale'], ['$provide', - function ngModule($provide) { - // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it. - $provide.provider({ - $$sanitizeUri: $$SanitizeUriProvider - }); - $provide.provider('$compile', $CompileProvider). - directive({ - a: htmlAnchorDirective, - input: inputDirective, - textarea: inputDirective, - form: formDirective, - script: scriptDirective, - select: selectDirective, - option: optionDirective, - ngBind: ngBindDirective, - ngBindHtml: ngBindHtmlDirective, - ngBindTemplate: ngBindTemplateDirective, - ngClass: ngClassDirective, - ngClassEven: ngClassEvenDirective, - ngClassOdd: ngClassOddDirective, - ngCloak: ngCloakDirective, - ngController: ngControllerDirective, - ngForm: ngFormDirective, - ngHide: ngHideDirective, - ngIf: ngIfDirective, - ngInclude: ngIncludeDirective, - ngInit: ngInitDirective, - ngNonBindable: ngNonBindableDirective, - ngPluralize: ngPluralizeDirective, - ngRepeat: ngRepeatDirective, - ngShow: ngShowDirective, - ngStyle: ngStyleDirective, - ngSwitch: ngSwitchDirective, - ngSwitchWhen: ngSwitchWhenDirective, - ngSwitchDefault: ngSwitchDefaultDirective, - ngOptions: ngOptionsDirective, - ngTransclude: ngTranscludeDirective, - ngModel: ngModelDirective, - ngList: ngListDirective, - ngChange: ngChangeDirective, - pattern: patternDirective, - ngPattern: patternDirective, - required: requiredDirective, - ngRequired: requiredDirective, - minlength: minlengthDirective, - ngMinlength: minlengthDirective, - maxlength: maxlengthDirective, - ngMaxlength: maxlengthDirective, - ngValue: ngValueDirective, - ngModelOptions: ngModelOptionsDirective - }). - directive({ - ngInclude: ngIncludeFillContentDirective - }). - directive(ngAttributeAliasDirectives). - directive(ngEventDirectives); - $provide.provider({ - $anchorScroll: $AnchorScrollProvider, - $animate: $AnimateProvider, - $animateCss: $CoreAnimateCssProvider, - $$animateJs: $$CoreAnimateJsProvider, - $$animateQueue: $$CoreAnimateQueueProvider, - $$AnimateRunner: $$AnimateRunnerFactoryProvider, - $$animateAsyncRun: $$AnimateAsyncRunFactoryProvider, - $browser: $BrowserProvider, - $cacheFactory: $CacheFactoryProvider, - $controller: $ControllerProvider, - $document: $DocumentProvider, - $$isDocumentHidden: $$IsDocumentHiddenProvider, - $exceptionHandler: $ExceptionHandlerProvider, - $filter: $FilterProvider, - $$forceReflow: $$ForceReflowProvider, - $interpolate: $InterpolateProvider, - $interval: $IntervalProvider, - $http: $HttpProvider, - $httpParamSerializer: $HttpParamSerializerProvider, - $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider, - $httpBackend: $HttpBackendProvider, - $xhrFactory: $xhrFactoryProvider, - $jsonpCallbacks: $jsonpCallbacksProvider, - $location: $LocationProvider, - $log: $LogProvider, - $parse: $ParseProvider, - $rootScope: $RootScopeProvider, - $q: $QProvider, - $$q: $$QProvider, - $sce: $SceProvider, - $sceDelegate: $SceDelegateProvider, - $sniffer: $SnifferProvider, - $templateCache: $TemplateCacheProvider, - $templateRequest: $TemplateRequestProvider, - $$testability: $$TestabilityProvider, - $timeout: $TimeoutProvider, - $window: $WindowProvider, - $$rAF: $$RAFProvider, - $$jqLite: $$jqLiteProvider, - $$Map: $$MapProvider, - $$cookieReader: $$CookieReaderProvider - }); - } - ]) - .info({ angularVersion: '1.6.9' }); - } - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /* global - JQLitePrototype: true, - BOOLEAN_ATTR: true, - ALIASED_ATTR: true -*/ - -////////////////////////////////// -//JQLite -////////////////////////////////// - - /** - * @ngdoc function - * @name angular.element - * @module ng - * @kind function - * - * @description - * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element. - * - * If jQuery is available, `angular.element` is an alias for the - * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element` - * delegates to AngularJS's built-in subset of jQuery, called "jQuery lite" or **jqLite**. - * - * jqLite is a tiny, API-compatible subset of jQuery that allows - * AngularJS to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most - * commonly needed functionality with the goal of having a very small footprint. - * - * To use `jQuery`, simply ensure it is loaded before the `angular.js` file. You can also use the - * {@link ngJq `ngJq`} directive to specify that jqlite should be used over jQuery, or to use a - * specific version of jQuery if multiple versions exist on the page. - * - * <div class="alert alert-info">**Note:** All element references in AngularJS are always wrapped with jQuery or - * jqLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.</div> - * - * <div class="alert alert-warning">**Note:** Keep in mind that this function will not find elements - * by tag name / CSS selector. For lookups by tag name, try instead `angular.element(document).find(...)` - * or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`.</div> - * - * ## AngularJS's jqLite - * jqLite provides only the following jQuery methods: - * - * - [`addClass()`](http://api.jquery.com/addClass/) - Does not support a function as first argument - * - [`after()`](http://api.jquery.com/after/) - * - [`append()`](http://api.jquery.com/append/) - * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters - * - [`bind()`](http://api.jquery.com/bind/) (_deprecated_, use [`on()`](http://api.jquery.com/on/)) - Does not support namespaces, selectors or eventData - * - [`children()`](http://api.jquery.com/children/) - Does not support selectors - * - [`clone()`](http://api.jquery.com/clone/) - * - [`contents()`](http://api.jquery.com/contents/) - * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`. - * As a setter, does not convert numbers to strings or append 'px', and also does not have automatic property prefixing. - * - [`data()`](http://api.jquery.com/data/) - * - [`detach()`](http://api.jquery.com/detach/) - * - [`empty()`](http://api.jquery.com/empty/) - * - [`eq()`](http://api.jquery.com/eq/) - * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name - * - [`hasClass()`](http://api.jquery.com/hasClass/) - * - [`html()`](http://api.jquery.com/html/) - * - [`next()`](http://api.jquery.com/next/) - Does not support selectors - * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData - * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces, selectors or event object as parameter - * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors - * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors - * - [`prepend()`](http://api.jquery.com/prepend/) - * - [`prop()`](http://api.jquery.com/prop/) - * - [`ready()`](http://api.jquery.com/ready/) (_deprecated_, use `angular.element(callback)` instead of `angular.element(document).ready(callback)`) - * - [`remove()`](http://api.jquery.com/remove/) - * - [`removeAttr()`](http://api.jquery.com/removeAttr/) - Does not support multiple attributes - * - [`removeClass()`](http://api.jquery.com/removeClass/) - Does not support a function as first argument - * - [`removeData()`](http://api.jquery.com/removeData/) - * - [`replaceWith()`](http://api.jquery.com/replaceWith/) - * - [`text()`](http://api.jquery.com/text/) - * - [`toggleClass()`](http://api.jquery.com/toggleClass/) - Does not support a function as first argument - * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers - * - [`unbind()`](http://api.jquery.com/unbind/) (_deprecated_, use [`off()`](http://api.jquery.com/off/)) - Does not support namespaces or event object as parameter - * - [`val()`](http://api.jquery.com/val/) - * - [`wrap()`](http://api.jquery.com/wrap/) - * - * ## jQuery/jqLite Extras - * AngularJS also provides the following additional methods and events to both jQuery and jqLite: - * - * ### Events - * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event - * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM - * element before it is removed. - * - * ### Methods - * - `controller(name)` - retrieves the controller of the current element or its parent. By default - * retrieves controller associated with the `ngController` directive. If `name` is provided as - * camelCase directive name, then the controller for this directive will be retrieved (e.g. - * `'ngModel'`). - * - `injector()` - retrieves the injector of the current element or its parent. - * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current - * element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to - * be enabled. - * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the - * current element. This getter should be used only on elements that contain a directive which starts a new isolate - * scope. Calling `scope()` on this element always returns the original non-isolate scope. - * Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled. - * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top - * parent element is reached. - * - * @knownIssue You cannot spy on `angular.element` if you are using Jasmine version 1.x. See - * https://github.com/angular/angular.js/issues/14251 for more information. - * - * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery. - * @returns {Object} jQuery object. - */ - - JQLite.expando = 'ng339'; - - var jqCache = JQLite.cache = {}, - jqId = 1; - - /* - * !!! This is an undocumented "private" function !!! - */ - JQLite._data = function(node) { - //jQuery always returns an object on cache miss - return this.cache[node[this.expando]] || {}; - }; - - function jqNextId() { return ++jqId; } - - - var DASH_LOWERCASE_REGEXP = /-([a-z])/g; - var MS_HACK_REGEXP = /^-ms-/; - var MOUSE_EVENT_MAP = { mouseleave: 'mouseout', mouseenter: 'mouseover' }; - var jqLiteMinErr = minErr('jqLite'); - - /** - * Converts kebab-case to camelCase. - * There is also a special case for the ms prefix starting with a lowercase letter. - * @param name Name to normalize - */ - function cssKebabToCamel(name) { - return kebabToCamel(name.replace(MS_HACK_REGEXP, 'ms-')); - } - - function fnCamelCaseReplace(all, letter) { - return letter.toUpperCase(); - } - - /** - * Converts kebab-case to camelCase. - * @param name Name to normalize - */ - function kebabToCamel(name) { - return name - .replace(DASH_LOWERCASE_REGEXP, fnCamelCaseReplace); - } - - var SINGLE_TAG_REGEXP = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/; - var HTML_REGEXP = /<|&#?\w+;/; - var TAG_NAME_REGEXP = /<([\w:-]+)/; - var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi; - - var wrapMap = { - 'option': [1, '<select multiple="multiple">', '</select>'], - - 'thead': [1, '<table>', '</table>'], - 'col': [2, '<table><colgroup>', '</colgroup></table>'], - 'tr': [2, '<table><tbody>', '</tbody></table>'], - 'td': [3, '<table><tbody><tr>', '</tr></tbody></table>'], - '_default': [0, '', ''] - }; - - wrapMap.optgroup = wrapMap.option; - wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; - wrapMap.th = wrapMap.td; - - - function jqLiteIsTextNode(html) { - return !HTML_REGEXP.test(html); - } - - function jqLiteAcceptsData(node) { - // The window object can accept data but has no nodeType - // Otherwise we are only interested in elements (1) and documents (9) - var nodeType = node.nodeType; - return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT; - } - - function jqLiteHasData(node) { - for (var key in jqCache[node.ng339]) { - return true; - } - return false; - } - - function jqLiteBuildFragment(html, context) { - var tmp, tag, wrap, - fragment = context.createDocumentFragment(), - nodes = [], i; - - if (jqLiteIsTextNode(html)) { - // Convert non-html into a text node - nodes.push(context.createTextNode(html)); - } else { - // Convert html into DOM nodes - tmp = fragment.appendChild(context.createElement('div')); - tag = (TAG_NAME_REGEXP.exec(html) || ['', ''])[1].toLowerCase(); - wrap = wrapMap[tag] || wrapMap._default; - tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, '<$1></$2>') + wrap[2]; - - // Descend through wrappers to the right content - i = wrap[0]; - while (i--) { - tmp = tmp.lastChild; - } - - nodes = concat(nodes, tmp.childNodes); - - tmp = fragment.firstChild; - tmp.textContent = ''; - } - - // Remove wrapper from fragment - fragment.textContent = ''; - fragment.innerHTML = ''; // Clear inner HTML - forEach(nodes, function(node) { - fragment.appendChild(node); - }); - - return fragment; - } - - function jqLiteParseHTML(html, context) { - context = context || window.document; - var parsed; - - if ((parsed = SINGLE_TAG_REGEXP.exec(html))) { - return [context.createElement(parsed[1])]; - } - - if ((parsed = jqLiteBuildFragment(html, context))) { - return parsed.childNodes; - } - - return []; - } - - function jqLiteWrapNode(node, wrapper) { - var parent = node.parentNode; - - if (parent) { - parent.replaceChild(wrapper, node); - } - - wrapper.appendChild(node); - } - - -// IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259. - var jqLiteContains = window.Node.prototype.contains || /** @this */ function(arg) { - // eslint-disable-next-line no-bitwise - return !!(this.compareDocumentPosition(arg) & 16); - }; - -///////////////////////////////////////////// - function JQLite(element) { - if (element instanceof JQLite) { - return element; - } - - var argIsString; - - if (isString(element)) { - element = trim(element); - argIsString = true; - } - if (!(this instanceof JQLite)) { - if (argIsString && element.charAt(0) !== '<') { - throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element'); - } - return new JQLite(element); - } - - if (argIsString) { - jqLiteAddNodes(this, jqLiteParseHTML(element)); - } else if (isFunction(element)) { - jqLiteReady(element); - } else { - jqLiteAddNodes(this, element); - } - } - - function jqLiteClone(element) { - return element.cloneNode(true); - } - - function jqLiteDealoc(element, onlyDescendants) { - if (!onlyDescendants && jqLiteAcceptsData(element)) jqLite.cleanData([element]); - - if (element.querySelectorAll) { - jqLite.cleanData(element.querySelectorAll('*')); - } - } - - function jqLiteOff(element, type, fn, unsupported) { - if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument'); - - var expandoStore = jqLiteExpandoStore(element); - var events = expandoStore && expandoStore.events; - var handle = expandoStore && expandoStore.handle; - - if (!handle) return; //no listeners registered - - if (!type) { - for (type in events) { - if (type !== '$destroy') { - element.removeEventListener(type, handle); - } - delete events[type]; - } - } else { - - var removeHandler = function(type) { - var listenerFns = events[type]; - if (isDefined(fn)) { - arrayRemove(listenerFns || [], fn); - } - if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) { - element.removeEventListener(type, handle); - delete events[type]; - } - }; - - forEach(type.split(' '), function(type) { - removeHandler(type); - if (MOUSE_EVENT_MAP[type]) { - removeHandler(MOUSE_EVENT_MAP[type]); - } - }); - } - } - - function jqLiteRemoveData(element, name) { - var expandoId = element.ng339; - var expandoStore = expandoId && jqCache[expandoId]; - - if (expandoStore) { - if (name) { - delete expandoStore.data[name]; - return; - } - - if (expandoStore.handle) { - if (expandoStore.events.$destroy) { - expandoStore.handle({}, '$destroy'); - } - jqLiteOff(element); - } - delete jqCache[expandoId]; - element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it - } - } - - - function jqLiteExpandoStore(element, createIfNecessary) { - var expandoId = element.ng339, - expandoStore = expandoId && jqCache[expandoId]; - - if (createIfNecessary && !expandoStore) { - element.ng339 = expandoId = jqNextId(); - expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined}; - } - - return expandoStore; - } - - - function jqLiteData(element, key, value) { - if (jqLiteAcceptsData(element)) { - var prop; - - var isSimpleSetter = isDefined(value); - var isSimpleGetter = !isSimpleSetter && key && !isObject(key); - var massGetter = !key; - var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter); - var data = expandoStore && expandoStore.data; - - if (isSimpleSetter) { // data('key', value) - data[kebabToCamel(key)] = value; - } else { - if (massGetter) { // data() - return data; - } else { - if (isSimpleGetter) { // data('key') - // don't force creation of expandoStore if it doesn't exist yet - return data && data[kebabToCamel(key)]; - } else { // mass-setter: data({key1: val1, key2: val2}) - for (prop in key) { - data[kebabToCamel(prop)] = key[prop]; - } - } - } - } - } - } - - function jqLiteHasClass(element, selector) { - if (!element.getAttribute) return false; - return ((' ' + (element.getAttribute('class') || '') + ' ').replace(/[\n\t]/g, ' '). - indexOf(' ' + selector + ' ') > -1); - } - - function jqLiteRemoveClass(element, cssClasses) { - if (cssClasses && element.setAttribute) { - var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ') - .replace(/[\n\t]/g, ' '); - var newClasses = existingClasses; - - forEach(cssClasses.split(' '), function(cssClass) { - cssClass = trim(cssClass); - newClasses = newClasses.replace(' ' + cssClass + ' ', ' '); - }); - - if (newClasses !== existingClasses) { - element.setAttribute('class', trim(newClasses)); - } - } - } - - function jqLiteAddClass(element, cssClasses) { - if (cssClasses && element.setAttribute) { - var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ') - .replace(/[\n\t]/g, ' '); - var newClasses = existingClasses; - - forEach(cssClasses.split(' '), function(cssClass) { - cssClass = trim(cssClass); - if (newClasses.indexOf(' ' + cssClass + ' ') === -1) { - newClasses += cssClass + ' '; - } - }); - - if (newClasses !== existingClasses) { - element.setAttribute('class', trim(newClasses)); - } - } - } - - - function jqLiteAddNodes(root, elements) { - // THIS CODE IS VERY HOT. Don't make changes without benchmarking. - - if (elements) { - - // if a Node (the most common case) - if (elements.nodeType) { - root[root.length++] = elements; - } else { - var length = elements.length; - - // if an Array or NodeList and not a Window - if (typeof length === 'number' && elements.window !== elements) { - if (length) { - for (var i = 0; i < length; i++) { - root[root.length++] = elements[i]; - } - } - } else { - root[root.length++] = elements; - } - } - } - } - - - function jqLiteController(element, name) { - return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller'); - } - - function jqLiteInheritedData(element, name, value) { - // if element is the document object work with the html element instead - // this makes $(document).scope() possible - if (element.nodeType === NODE_TYPE_DOCUMENT) { - element = element.documentElement; - } - var names = isArray(name) ? name : [name]; - - while (element) { - for (var i = 0, ii = names.length; i < ii; i++) { - if (isDefined(value = jqLite.data(element, names[i]))) return value; - } - - // If dealing with a document fragment node with a host element, and no parent, use the host - // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM - // to lookup parent controllers. - element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host); - } - } - - function jqLiteEmpty(element) { - jqLiteDealoc(element, true); - while (element.firstChild) { - element.removeChild(element.firstChild); - } - } - - function jqLiteRemove(element, keepData) { - if (!keepData) jqLiteDealoc(element); - var parent = element.parentNode; - if (parent) parent.removeChild(element); - } - - - function jqLiteDocumentLoaded(action, win) { - win = win || window; - if (win.document.readyState === 'complete') { - // Force the action to be run async for consistent behavior - // from the action's point of view - // i.e. it will definitely not be in a $apply - win.setTimeout(action); - } else { - // No need to unbind this handler as load is only ever called once - jqLite(win).on('load', action); - } - } - - function jqLiteReady(fn) { - function trigger() { - window.document.removeEventListener('DOMContentLoaded', trigger); - window.removeEventListener('load', trigger); - fn(); - } - - // check if document is already loaded - if (window.document.readyState === 'complete') { - window.setTimeout(fn); - } else { - // We can not use jqLite since we are not done loading and jQuery could be loaded later. - - // Works for modern browsers and IE9 - window.document.addEventListener('DOMContentLoaded', trigger); - - // Fallback to window.onload for others - window.addEventListener('load', trigger); - } - } - -////////////////////////////////////////// -// Functions which are declared directly. -////////////////////////////////////////// - var JQLitePrototype = JQLite.prototype = { - ready: jqLiteReady, - toString: function() { - var value = []; - forEach(this, function(e) { value.push('' + e);}); - return '[' + value.join(', ') + ']'; - }, - - eq: function(index) { - return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]); - }, - - length: 0, - push: push, - sort: [].sort, - splice: [].splice - }; - -////////////////////////////////////////// -// Functions iterating getter/setters. -// these functions return self on setter and -// value on get. -////////////////////////////////////////// - var BOOLEAN_ATTR = {}; - forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) { - BOOLEAN_ATTR[lowercase(value)] = value; - }); - var BOOLEAN_ELEMENTS = {}; - forEach('input,select,option,textarea,button,form,details'.split(','), function(value) { - BOOLEAN_ELEMENTS[value] = true; - }); - var ALIASED_ATTR = { - 'ngMinlength': 'minlength', - 'ngMaxlength': 'maxlength', - 'ngMin': 'min', - 'ngMax': 'max', - 'ngPattern': 'pattern', - 'ngStep': 'step' - }; - - function getBooleanAttrName(element, name) { - // check dom last since we will most likely fail on name - var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()]; - - // booleanAttr is here twice to minimize DOM access - return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr; - } - - function getAliasedAttrName(name) { - return ALIASED_ATTR[name]; - } - - forEach({ - data: jqLiteData, - removeData: jqLiteRemoveData, - hasData: jqLiteHasData, - cleanData: function jqLiteCleanData(nodes) { - for (var i = 0, ii = nodes.length; i < ii; i++) { - jqLiteRemoveData(nodes[i]); - } - } - }, function(fn, name) { - JQLite[name] = fn; - }); - - forEach({ - data: jqLiteData, - inheritedData: jqLiteInheritedData, - - scope: function(element) { - // Can't use jqLiteData here directly so we stay compatible with jQuery! - return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']); - }, - - isolateScope: function(element) { - // Can't use jqLiteData here directly so we stay compatible with jQuery! - return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate'); - }, - - controller: jqLiteController, - - injector: function(element) { - return jqLiteInheritedData(element, '$injector'); - }, - - removeAttr: function(element, name) { - element.removeAttribute(name); - }, - - hasClass: jqLiteHasClass, - - css: function(element, name, value) { - name = cssKebabToCamel(name); - - if (isDefined(value)) { - element.style[name] = value; - } else { - return element.style[name]; - } - }, - - attr: function(element, name, value) { - var ret; - var nodeType = element.nodeType; - if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT || - !element.getAttribute) { - return; - } - - var lowercasedName = lowercase(name); - var isBooleanAttr = BOOLEAN_ATTR[lowercasedName]; - - if (isDefined(value)) { - // setter - - if (value === null || (value === false && isBooleanAttr)) { - element.removeAttribute(name); - } else { - element.setAttribute(name, isBooleanAttr ? lowercasedName : value); - } - } else { - // getter - - ret = element.getAttribute(name); - - if (isBooleanAttr && ret !== null) { - ret = lowercasedName; - } - // Normalize non-existing attributes to undefined (as jQuery). - return ret === null ? undefined : ret; - } - }, - - prop: function(element, name, value) { - if (isDefined(value)) { - element[name] = value; - } else { - return element[name]; - } - }, - - text: (function() { - getText.$dv = ''; - return getText; - - function getText(element, value) { - if (isUndefined(value)) { - var nodeType = element.nodeType; - return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : ''; - } - element.textContent = value; - } - })(), - - val: function(element, value) { - if (isUndefined(value)) { - if (element.multiple && nodeName_(element) === 'select') { - var result = []; - forEach(element.options, function(option) { - if (option.selected) { - result.push(option.value || option.text); - } - }); - return result; - } - return element.value; - } - element.value = value; - }, - - html: function(element, value) { - if (isUndefined(value)) { - return element.innerHTML; - } - jqLiteDealoc(element, true); - element.innerHTML = value; - }, - - empty: jqLiteEmpty - }, function(fn, name) { - /** - * Properties: writes return selection, reads return first value - */ - JQLite.prototype[name] = function(arg1, arg2) { - var i, key; - var nodeCount = this.length; - - // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it - // in a way that survives minification. - // jqLiteEmpty takes no arguments but is a setter. - if (fn !== jqLiteEmpty && - (isUndefined((fn.length === 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) { - if (isObject(arg1)) { - - // we are a write, but the object properties are the key/values - for (i = 0; i < nodeCount; i++) { - if (fn === jqLiteData) { - // data() takes the whole object in jQuery - fn(this[i], arg1); - } else { - for (key in arg1) { - fn(this[i], key, arg1[key]); - } - } - } - // return self for chaining - return this; - } else { - // we are a read, so read the first child. - // TODO: do we still need this? - var value = fn.$dv; - // Only if we have $dv do we iterate over all, otherwise it is just the first element. - var jj = (isUndefined(value)) ? Math.min(nodeCount, 1) : nodeCount; - for (var j = 0; j < jj; j++) { - var nodeValue = fn(this[j], arg1, arg2); - value = value ? value + nodeValue : nodeValue; - } - return value; - } - } else { - // we are a write, so apply to all children - for (i = 0; i < nodeCount; i++) { - fn(this[i], arg1, arg2); - } - // return self for chaining - return this; - } - }; - }); - - function createEventHandler(element, events) { - var eventHandler = function(event, type) { - // jQuery specific api - event.isDefaultPrevented = function() { - return event.defaultPrevented; - }; - - var eventFns = events[type || event.type]; - var eventFnsLength = eventFns ? eventFns.length : 0; - - if (!eventFnsLength) return; - - if (isUndefined(event.immediatePropagationStopped)) { - var originalStopImmediatePropagation = event.stopImmediatePropagation; - event.stopImmediatePropagation = function() { - event.immediatePropagationStopped = true; - - if (event.stopPropagation) { - event.stopPropagation(); - } - - if (originalStopImmediatePropagation) { - originalStopImmediatePropagation.call(event); - } - }; - } - - event.isImmediatePropagationStopped = function() { - return event.immediatePropagationStopped === true; - }; - - // Some events have special handlers that wrap the real handler - var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper; - - // Copy event handlers in case event handlers array is modified during execution. - if ((eventFnsLength > 1)) { - eventFns = shallowCopy(eventFns); - } - - for (var i = 0; i < eventFnsLength; i++) { - if (!event.isImmediatePropagationStopped()) { - handlerWrapper(element, event, eventFns[i]); - } - } - }; - - // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all - // events on `element` - eventHandler.elem = element; - return eventHandler; - } - - function defaultHandlerWrapper(element, event, handler) { - handler.call(element, event); - } - - function specialMouseHandlerWrapper(target, event, handler) { - // Refer to jQuery's implementation of mouseenter & mouseleave - // Read about mouseenter and mouseleave: - // http://www.quirksmode.org/js/events_mouse.html#link8 - var related = event.relatedTarget; - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if (!related || (related !== target && !jqLiteContains.call(target, related))) { - handler.call(target, event); - } - } - -////////////////////////////////////////// -// Functions iterating traversal. -// These functions chain results into a single -// selector. -////////////////////////////////////////// - forEach({ - removeData: jqLiteRemoveData, - - on: function jqLiteOn(element, type, fn, unsupported) { - if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters'); - - // Do not add event handlers to non-elements because they will not be cleaned up. - if (!jqLiteAcceptsData(element)) { - return; - } - - var expandoStore = jqLiteExpandoStore(element, true); - var events = expandoStore.events; - var handle = expandoStore.handle; - - if (!handle) { - handle = expandoStore.handle = createEventHandler(element, events); - } - - // http://jsperf.com/string-indexof-vs-split - var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type]; - var i = types.length; - - var addHandler = function(type, specialHandlerWrapper, noEventListener) { - var eventFns = events[type]; - - if (!eventFns) { - eventFns = events[type] = []; - eventFns.specialHandlerWrapper = specialHandlerWrapper; - if (type !== '$destroy' && !noEventListener) { - element.addEventListener(type, handle); - } - } - - eventFns.push(fn); - }; - - while (i--) { - type = types[i]; - if (MOUSE_EVENT_MAP[type]) { - addHandler(MOUSE_EVENT_MAP[type], specialMouseHandlerWrapper); - addHandler(type, undefined, true); - } else { - addHandler(type); - } - } - }, - - off: jqLiteOff, - - one: function(element, type, fn) { - element = jqLite(element); - - //add the listener twice so that when it is called - //you can remove the original function and still be - //able to call element.off(ev, fn) normally - element.on(type, function onFn() { - element.off(type, fn); - element.off(type, onFn); - }); - element.on(type, fn); - }, - - replaceWith: function(element, replaceNode) { - var index, parent = element.parentNode; - jqLiteDealoc(element); - forEach(new JQLite(replaceNode), function(node) { - if (index) { - parent.insertBefore(node, index.nextSibling); - } else { - parent.replaceChild(node, element); - } - index = node; - }); - }, - - children: function(element) { - var children = []; - forEach(element.childNodes, function(element) { - if (element.nodeType === NODE_TYPE_ELEMENT) { - children.push(element); - } - }); - return children; - }, - - contents: function(element) { - return element.contentDocument || element.childNodes || []; - }, - - append: function(element, node) { - var nodeType = element.nodeType; - if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return; - - node = new JQLite(node); - - for (var i = 0, ii = node.length; i < ii; i++) { - var child = node[i]; - element.appendChild(child); - } - }, - - prepend: function(element, node) { - if (element.nodeType === NODE_TYPE_ELEMENT) { - var index = element.firstChild; - forEach(new JQLite(node), function(child) { - element.insertBefore(child, index); - }); - } - }, - - wrap: function(element, wrapNode) { - jqLiteWrapNode(element, jqLite(wrapNode).eq(0).clone()[0]); - }, - - remove: jqLiteRemove, - - detach: function(element) { - jqLiteRemove(element, true); - }, - - after: function(element, newElement) { - var index = element, parent = element.parentNode; - - if (parent) { - newElement = new JQLite(newElement); - - for (var i = 0, ii = newElement.length; i < ii; i++) { - var node = newElement[i]; - parent.insertBefore(node, index.nextSibling); - index = node; - } - } - }, - - addClass: jqLiteAddClass, - removeClass: jqLiteRemoveClass, - - toggleClass: function(element, selector, condition) { - if (selector) { - forEach(selector.split(' '), function(className) { - var classCondition = condition; - if (isUndefined(classCondition)) { - classCondition = !jqLiteHasClass(element, className); - } - (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className); - }); - } - }, - - parent: function(element) { - var parent = element.parentNode; - return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null; - }, - - next: function(element) { - return element.nextElementSibling; - }, - - find: function(element, selector) { - if (element.getElementsByTagName) { - return element.getElementsByTagName(selector); - } else { - return []; - } - }, - - clone: jqLiteClone, - - triggerHandler: function(element, event, extraParameters) { - - var dummyEvent, eventFnsCopy, handlerArgs; - var eventName = event.type || event; - var expandoStore = jqLiteExpandoStore(element); - var events = expandoStore && expandoStore.events; - var eventFns = events && events[eventName]; - - if (eventFns) { - // Create a dummy event to pass to the handlers - dummyEvent = { - preventDefault: function() { this.defaultPrevented = true; }, - isDefaultPrevented: function() { return this.defaultPrevented === true; }, - stopImmediatePropagation: function() { this.immediatePropagationStopped = true; }, - isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; }, - stopPropagation: noop, - type: eventName, - target: element - }; - - // If a custom event was provided then extend our dummy event with it - if (event.type) { - dummyEvent = extend(dummyEvent, event); - } - - // Copy event handlers in case event handlers array is modified during execution. - eventFnsCopy = shallowCopy(eventFns); - handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent]; - - forEach(eventFnsCopy, function(fn) { - if (!dummyEvent.isImmediatePropagationStopped()) { - fn.apply(element, handlerArgs); - } - }); - } - } - }, function(fn, name) { - /** - * chaining functions - */ - JQLite.prototype[name] = function(arg1, arg2, arg3) { - var value; - - for (var i = 0, ii = this.length; i < ii; i++) { - if (isUndefined(value)) { - value = fn(this[i], arg1, arg2, arg3); - if (isDefined(value)) { - // any function which returns a value needs to be wrapped - value = jqLite(value); - } - } else { - jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3)); - } - } - return isDefined(value) ? value : this; - }; - }); - -// bind legacy bind/unbind to on/off - JQLite.prototype.bind = JQLite.prototype.on; - JQLite.prototype.unbind = JQLite.prototype.off; - - -// Provider for private $$jqLite service - /** @this */ - function $$jqLiteProvider() { - this.$get = function $$jqLite() { - return extend(JQLite, { - hasClass: function(node, classes) { - if (node.attr) node = node[0]; - return jqLiteHasClass(node, classes); - }, - addClass: function(node, classes) { - if (node.attr) node = node[0]; - return jqLiteAddClass(node, classes); - }, - removeClass: function(node, classes) { - if (node.attr) node = node[0]; - return jqLiteRemoveClass(node, classes); - } - }); - }; - } - - /** - * Computes a hash of an 'obj'. - * Hash of a: - * string is string - * number is number as string - * object is either result of calling $$hashKey function on the object or uniquely generated id, - * that is also assigned to the $$hashKey property of the object. - * - * @param obj - * @returns {string} hash string such that the same input will have the same hash string. - * The resulting string key is in 'type:hashKey' format. - */ - function hashKey(obj, nextUidFn) { - var key = obj && obj.$$hashKey; - - if (key) { - if (typeof key === 'function') { - key = obj.$$hashKey(); - } - return key; - } - - var objType = typeof obj; - if (objType === 'function' || (objType === 'object' && obj !== null)) { - key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)(); - } else { - key = objType + ':' + obj; - } - - return key; - } - -// A minimal ES2015 Map implementation. -// Should be bug/feature equivalent to the native implementations of supported browsers -// (for the features required in Angular). -// See https://kangax.github.io/compat-table/es6/#test-Map - var nanKey = Object.create(null); - function NgMapShim() { - this._keys = []; - this._values = []; - this._lastKey = NaN; - this._lastIndex = -1; - } - NgMapShim.prototype = { - _idx: function(key) { - if (key === this._lastKey) { - return this._lastIndex; - } - this._lastKey = key; - this._lastIndex = this._keys.indexOf(key); - return this._lastIndex; - }, - _transformKey: function(key) { - return isNumberNaN(key) ? nanKey : key; - }, - get: function(key) { - key = this._transformKey(key); - var idx = this._idx(key); - if (idx !== -1) { - return this._values[idx]; - } - }, - set: function(key, value) { - key = this._transformKey(key); - var idx = this._idx(key); - if (idx === -1) { - idx = this._lastIndex = this._keys.length; - } - this._keys[idx] = key; - this._values[idx] = value; - - // Support: IE11 - // Do not `return this` to simulate the partial IE11 implementation - }, - delete: function(key) { - key = this._transformKey(key); - var idx = this._idx(key); - if (idx === -1) { - return false; - } - this._keys.splice(idx, 1); - this._values.splice(idx, 1); - this._lastKey = NaN; - this._lastIndex = -1; - return true; - } - }; - -// For now, always use `NgMapShim`, even if `window.Map` is available. Some native implementations -// are still buggy (often in subtle ways) and can cause hard-to-debug failures. When native `Map` -// implementations get more stable, we can reconsider switching to `window.Map` (when available). - var NgMap = NgMapShim; - - var $$MapProvider = [/** @this */function() { - this.$get = [function() { - return NgMap; - }]; - }]; - - /** - * @ngdoc function - * @module ng - * @name angular.injector - * @kind function - * - * @description - * Creates an injector object that can be used for retrieving services as well as for - * dependency injection (see {@link guide/di dependency injection}). - * - * @param {Array.<string|Function>} modules A list of module functions or their aliases. See - * {@link angular.module}. The `ng` module must be explicitly added. - * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which - * disallows argument name annotation inference. - * @returns {injector} Injector object. See {@link auto.$injector $injector}. - * - * @example - * Typical usage - * ```js - * // create an injector - * var $injector = angular.injector(['ng']); - * - * // use the injector to kick off your application - * // use the type inference to auto inject arguments, or use implicit injection - * $injector.invoke(function($rootScope, $compile, $document) { - * $compile($document)($rootScope); - * $rootScope.$digest(); - * }); - * ``` - * - * Sometimes you want to get access to the injector of a currently running AngularJS app - * from outside AngularJS. Perhaps, you want to inject and compile some markup after the - * application has been bootstrapped. You can do this using the extra `injector()` added - * to JQuery/jqLite elements. See {@link angular.element}. - * - * *This is fairly rare but could be the case if a third party library is injecting the - * markup.* - * - * In the following example a new block of HTML containing a `ng-controller` - * directive is added to the end of the document body by JQuery. We then compile and link - * it into the current AngularJS scope. - * - * ```js - * var $div = $('<div ng-controller="MyCtrl">{{content.label}}</div>'); - * $(document.body).append($div); - * - * angular.element(document).injector().invoke(function($compile) { - * var scope = angular.element($div).scope(); - * $compile($div)(scope); - * }); - * ``` - */ - - - /** - * @ngdoc module - * @name auto - * @installation - * @description - * - * Implicit module which gets automatically added to each {@link auto.$injector $injector}. - */ - - var ARROW_ARG = /^([^(]+?)=>/; - var FN_ARGS = /^[^(]*\(\s*([^)]*)\)/m; - var FN_ARG_SPLIT = /,/; - var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/; - var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; - var $injectorMinErr = minErr('$injector'); - - function stringifyFn(fn) { - return Function.prototype.toString.call(fn); - } - - function extractArgs(fn) { - var fnText = stringifyFn(fn).replace(STRIP_COMMENTS, ''), - args = fnText.match(ARROW_ARG) || fnText.match(FN_ARGS); - return args; - } - - function anonFn(fn) { - // For anonymous functions, showing at the very least the function signature can help in - // debugging. - var args = extractArgs(fn); - if (args) { - return 'function(' + (args[1] || '').replace(/[\s\r\n]+/, ' ') + ')'; - } - return 'fn'; - } - - function annotate(fn, strictDi, name) { - var $inject, - argDecl, - last; - - if (typeof fn === 'function') { - if (!($inject = fn.$inject)) { - $inject = []; - if (fn.length) { - if (strictDi) { - if (!isString(name) || !name) { - name = fn.name || anonFn(fn); - } - throw $injectorMinErr('strictdi', - '{0} is not using explicit annotation and cannot be invoked in strict mode', name); - } - argDecl = extractArgs(fn); - forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) { - arg.replace(FN_ARG, function(all, underscore, name) { - $inject.push(name); - }); - }); - } - fn.$inject = $inject; - } - } else if (isArray(fn)) { - last = fn.length - 1; - assertArgFn(fn[last], 'fn'); - $inject = fn.slice(0, last); - } else { - assertArgFn(fn, 'fn', true); - } - return $inject; - } - -/////////////////////////////////////// - - /** - * @ngdoc service - * @name $injector - * - * @description - * - * `$injector` is used to retrieve object instances as defined by - * {@link auto.$provide provider}, instantiate types, invoke methods, - * and load modules. - * - * The following always holds true: - * - * ```js - * var $injector = angular.injector(); - * expect($injector.get('$injector')).toBe($injector); - * expect($injector.invoke(function($injector) { - * return $injector; - * })).toBe($injector); - * ``` - * - * ## Injection Function Annotation - * - * JavaScript does not have annotations, and annotations are needed for dependency injection. The - * following are all valid ways of annotating function with injection arguments and are equivalent. - * - * ```js - * // inferred (only works if code not minified/obfuscated) - * $injector.invoke(function(serviceA){}); - * - * // annotated - * function explicit(serviceA) {}; - * explicit.$inject = ['serviceA']; - * $injector.invoke(explicit); - * - * // inline - * $injector.invoke(['serviceA', function(serviceA){}]); - * ``` - * - * ### Inference - * - * In JavaScript calling `toString()` on a function returns the function definition. The definition - * can then be parsed and the function arguments can be extracted. This method of discovering - * annotations is disallowed when the injector is in strict mode. - * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the - * argument names. - * - * ### `$inject` Annotation - * By adding an `$inject` property onto a function the injection parameters can be specified. - * - * ### Inline - * As an array of injection names, where the last item in the array is the function to call. - */ - - /** - * @ngdoc property - * @name $injector#modules - * @type {Object} - * @description - * A hash containing all the modules that have been loaded into the - * $injector. - * - * You can use this property to find out information about a module via the - * {@link angular.Module#info `myModule.info(...)`} method. - * - * For example: - * - * ``` - * var info = $injector.modules['ngAnimate'].info(); - * ``` - * - * **Do not use this property to attempt to modify the modules after the application - * has been bootstrapped.** - */ - - - /** - * @ngdoc method - * @name $injector#get - * - * @description - * Return an instance of the service. - * - * @param {string} name The name of the instance to retrieve. - * @param {string=} caller An optional string to provide the origin of the function call for error messages. - * @return {*} The instance. - */ - - /** - * @ngdoc method - * @name $injector#invoke - * - * @description - * Invoke the method and supply the method arguments from the `$injector`. - * - * @param {Function|Array.<string|Function>} fn The injectable function to invoke. Function parameters are - * injected according to the {@link guide/di $inject Annotation} rules. - * @param {Object=} self The `this` for the invoked method. - * @param {Object=} locals Optional object. If preset then any argument names are read from this - * object first, before the `$injector` is consulted. - * @returns {*} the value returned by the invoked `fn` function. - */ - - /** - * @ngdoc method - * @name $injector#has - * - * @description - * Allows the user to query if the particular service exists. - * - * @param {string} name Name of the service to query. - * @returns {boolean} `true` if injector has given service. - */ - - /** - * @ngdoc method - * @name $injector#instantiate - * @description - * Create a new instance of JS type. The method takes a constructor function, invokes the new - * operator, and supplies all of the arguments to the constructor function as specified by the - * constructor annotation. - * - * @param {Function} Type Annotated constructor function. - * @param {Object=} locals Optional object. If preset then any argument names are read from this - * object first, before the `$injector` is consulted. - * @returns {Object} new instance of `Type`. - */ - - /** - * @ngdoc method - * @name $injector#annotate - * - * @description - * Returns an array of service names which the function is requesting for injection. This API is - * used by the injector to determine which services need to be injected into the function when the - * function is invoked. There are three ways in which the function can be annotated with the needed - * dependencies. - * - * #### Argument names - * - * The simplest form is to extract the dependencies from the arguments of the function. This is done - * by converting the function into a string using `toString()` method and extracting the argument - * names. - * ```js - * // Given - * function MyController($scope, $route) { - * // ... - * } - * - * // Then - * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); - * ``` - * - * You can disallow this method by using strict injection mode. - * - * This method does not work with code minification / obfuscation. For this reason the following - * annotation strategies are supported. - * - * #### The `$inject` property - * - * If a function has an `$inject` property and its value is an array of strings, then the strings - * represent names of services to be injected into the function. - * ```js - * // Given - * var MyController = function(obfuscatedScope, obfuscatedRoute) { - * // ... - * } - * // Define function dependencies - * MyController['$inject'] = ['$scope', '$route']; - * - * // Then - * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); - * ``` - * - * #### The array notation - * - * It is often desirable to inline Injected functions and that's when setting the `$inject` property - * is very inconvenient. In these situations using the array notation to specify the dependencies in - * a way that survives minification is a better choice: - * - * ```js - * // We wish to write this (not minification / obfuscation safe) - * injector.invoke(function($compile, $rootScope) { - * // ... - * }); - * - * // We are forced to write break inlining - * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) { - * // ... - * }; - * tmpFn.$inject = ['$compile', '$rootScope']; - * injector.invoke(tmpFn); - * - * // To better support inline function the inline annotation is supported - * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) { - * // ... - * }]); - * - * // Therefore - * expect(injector.annotate( - * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}]) - * ).toEqual(['$compile', '$rootScope']); - * ``` - * - * @param {Function|Array.<string|Function>} fn Function for which dependent service names need to - * be retrieved as described above. - * - * @param {boolean=} [strictDi=false] Disallow argument name annotation inference. - * - * @returns {Array.<string>} The names of the services which the function requires. - */ - /** - * @ngdoc method - * @name $injector#loadNewModules - * - * @description - * - * **This is a dangerous API, which you use at your own risk!** - * - * Add the specified modules to the current injector. - * - * This method will add each of the injectables to the injector and execute all of the config and run - * blocks for each module passed to the method. - * - * If a module has already been loaded into the injector then it will not be loaded again. - * - * * The application developer is responsible for loading the code containing the modules; and for - * ensuring that lazy scripts are not downloaded and executed more often that desired. - * * Previously compiled HTML will not be affected by newly loaded directives, filters and components. - * * Modules cannot be unloaded. - * - * You can use {@link $injector#modules `$injector.modules`} to check whether a module has been loaded - * into the injector, which may indicate whether the script has been executed already. - * - * @example - * Here is an example of loading a bundle of modules, with a utility method called `getScript`: - * - * ```javascript - * app.factory('loadModule', function($injector) { - * return function loadModule(moduleName, bundleUrl) { - * return getScript(bundleUrl).then(function() { $injector.loadNewModules([moduleName]); }); - * }; - * }) - * ``` - * - * @param {Array<String|Function|Array>=} mods an array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a `config` block. - * See: {@link angular.module modules} - */ - - - /** - * @ngdoc service - * @name $provide - * - * @description - * - * The {@link auto.$provide $provide} service has a number of methods for registering components - * with the {@link auto.$injector $injector}. Many of these functions are also exposed on - * {@link angular.Module}. - * - * An AngularJS **service** is a singleton object created by a **service factory**. These **service - * factories** are functions which, in turn, are created by a **service provider**. - * The **service providers** are constructor functions. When instantiated they must contain a - * property called `$get`, which holds the **service factory** function. - * - * When you request a service, the {@link auto.$injector $injector} is responsible for finding the - * correct **service provider**, instantiating it and then calling its `$get` **service factory** - * function to get the instance of the **service**. - * - * Often services have no configuration options and there is no need to add methods to the service - * provider. The provider will be no more than a constructor function with a `$get` property. For - * these cases the {@link auto.$provide $provide} service has additional helper methods to register - * services without specifying a provider. - * - * * {@link auto.$provide#provider provider(name, provider)} - registers a **service provider** with the - * {@link auto.$injector $injector} - * * {@link auto.$provide#constant constant(name, obj)} - registers a value/object that can be accessed by - * providers and services. - * * {@link auto.$provide#value value(name, obj)} - registers a value/object that can only be accessed by - * services, not providers. - * * {@link auto.$provide#factory factory(name, fn)} - registers a service **factory function** - * that will be wrapped in a **service provider** object, whose `$get` property will contain the - * given factory function. - * * {@link auto.$provide#service service(name, Fn)} - registers a **constructor function** - * that will be wrapped in a **service provider** object, whose `$get` property will instantiate - * a new object using the given constructor function. - * * {@link auto.$provide#decorator decorator(name, decorFn)} - registers a **decorator function** that - * will be able to modify or replace the implementation of another service. - * - * See the individual methods for more information and examples. - */ - - /** - * @ngdoc method - * @name $provide#provider - * @description - * - * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions - * are constructor functions, whose instances are responsible for "providing" a factory for a - * service. - * - * Service provider names start with the name of the service they provide followed by `Provider`. - * For example, the {@link ng.$log $log} service has a provider called - * {@link ng.$logProvider $logProvider}. - * - * Service provider objects can have additional methods which allow configuration of the provider - * and its service. Importantly, you can configure what kind of service is created by the `$get` - * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a - * method {@link ng.$logProvider#debugEnabled debugEnabled} - * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the - * console or not. - * - * It is possible to inject other providers into the provider function, - * but the injected provider must have been defined before the one that requires it. - * - * @param {string} name The name of the instance. NOTE: the provider will be available under `name + - 'Provider'` key. - * @param {(Object|function())} provider If the provider is: - * - * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using - * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created. - * - `Constructor`: a new instance of the provider will be created using - * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`. - * - * @returns {Object} registered provider instance - - * @example - * - * The following example shows how to create a simple event tracking service and register it using - * {@link auto.$provide#provider $provide.provider()}. - * - * ```js - * // Define the eventTracker provider - * function EventTrackerProvider() { - * var trackingUrl = '/track'; - * - * // A provider method for configuring where the tracked events should been saved - * this.setTrackingUrl = function(url) { - * trackingUrl = url; - * }; - * - * // The service factory function - * this.$get = ['$http', function($http) { - * var trackedEvents = {}; - * return { - * // Call this to track an event - * event: function(event) { - * var count = trackedEvents[event] || 0; - * count += 1; - * trackedEvents[event] = count; - * return count; - * }, - * // Call this to save the tracked events to the trackingUrl - * save: function() { - * $http.post(trackingUrl, trackedEvents); - * } - * }; - * }]; - * } - * - * describe('eventTracker', function() { - * var postSpy; - * - * beforeEach(module(function($provide) { - * // Register the eventTracker provider - * $provide.provider('eventTracker', EventTrackerProvider); - * })); - * - * beforeEach(module(function(eventTrackerProvider) { - * // Configure eventTracker provider - * eventTrackerProvider.setTrackingUrl('/custom-track'); - * })); - * - * it('tracks events', inject(function(eventTracker) { - * expect(eventTracker.event('login')).toEqual(1); - * expect(eventTracker.event('login')).toEqual(2); - * })); - * - * it('saves to the tracking url', inject(function(eventTracker, $http) { - * postSpy = spyOn($http, 'post'); - * eventTracker.event('login'); - * eventTracker.save(); - * expect(postSpy).toHaveBeenCalled(); - * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track'); - * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track'); - * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 }); - * })); - * }); - * ``` - */ - - /** - * @ngdoc method - * @name $provide#factory - * @description - * - * Register a **service factory**, which will be called to return the service instance. - * This is short for registering a service where its provider consists of only a `$get` property, - * which is the given service factory function. - * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to - * configure your service in a provider. - * - * @param {string} name The name of the instance. - * @param {Function|Array.<string|Function>} $getFn The injectable $getFn for the instance creation. - * Internally this is a short hand for `$provide.provider(name, {$get: $getFn})`. - * @returns {Object} registered provider instance - * - * @example - * Here is an example of registering a service - * ```js - * $provide.factory('ping', ['$http', function($http) { - * return function ping() { - * return $http.send('/ping'); - * }; - * }]); - * ``` - * You would then inject and use this service like this: - * ```js - * someModule.controller('Ctrl', ['ping', function(ping) { - * ping(); - * }]); - * ``` - */ - - - /** - * @ngdoc method - * @name $provide#service - * @description - * - * Register a **service constructor**, which will be invoked with `new` to create the service - * instance. - * This is short for registering a service where its provider's `$get` property is a factory - * function that returns an instance instantiated by the injector from the service constructor - * function. - * - * Internally it looks a bit like this: - * - * ``` - * { - * $get: function() { - * return $injector.instantiate(constructor); - * } - * } - * ``` - * - * - * You should use {@link auto.$provide#service $provide.service(class)} if you define your service - * as a type/class. - * - * @param {string} name The name of the instance. - * @param {Function|Array.<string|Function>} constructor An injectable class (constructor function) - * that will be instantiated. - * @returns {Object} registered provider instance - * - * @example - * Here is an example of registering a service using - * {@link auto.$provide#service $provide.service(class)}. - * ```js - * var Ping = function($http) { - * this.$http = $http; - * }; - * - * Ping.$inject = ['$http']; - * - * Ping.prototype.send = function() { - * return this.$http.get('/ping'); - * }; - * $provide.service('ping', Ping); - * ``` - * You would then inject and use this service like this: - * ```js - * someModule.controller('Ctrl', ['ping', function(ping) { - * ping.send(); - * }]); - * ``` - */ - - - /** - * @ngdoc method - * @name $provide#value - * @description - * - * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a - * number, an array, an object or a function. This is short for registering a service where its - * provider's `$get` property is a factory function that takes no arguments and returns the **value - * service**. That also means it is not possible to inject other services into a value service. - * - * Value services are similar to constant services, except that they cannot be injected into a - * module configuration function (see {@link angular.Module#config}) but they can be overridden by - * an AngularJS {@link auto.$provide#decorator decorator}. - * - * @param {string} name The name of the instance. - * @param {*} value The value. - * @returns {Object} registered provider instance - * - * @example - * Here are some examples of creating value services. - * ```js - * $provide.value('ADMIN_USER', 'admin'); - * - * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 }); - * - * $provide.value('halfOf', function(value) { - * return value / 2; - * }); - * ``` - */ - - - /** - * @ngdoc method - * @name $provide#constant - * @description - * - * Register a **constant service** with the {@link auto.$injector $injector}, such as a string, - * a number, an array, an object or a function. Like the {@link auto.$provide#value value}, it is not - * possible to inject other services into a constant. - * - * But unlike {@link auto.$provide#value value}, a constant can be - * injected into a module configuration function (see {@link angular.Module#config}) and it cannot - * be overridden by an AngularJS {@link auto.$provide#decorator decorator}. - * - * @param {string} name The name of the constant. - * @param {*} value The constant value. - * @returns {Object} registered instance - * - * @example - * Here a some examples of creating constants: - * ```js - * $provide.constant('SHARD_HEIGHT', 306); - * - * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']); - * - * $provide.constant('double', function(value) { - * return value * 2; - * }); - * ``` - */ - - - /** - * @ngdoc method - * @name $provide#decorator - * @description - * - * Register a **decorator function** with the {@link auto.$injector $injector}. A decorator function - * intercepts the creation of a service, allowing it to override or modify the behavior of the - * service. The return value of the decorator function may be the original service, or a new service - * that replaces (or wraps and delegates to) the original service. - * - * You can find out more about using decorators in the {@link guide/decorators} guide. - * - * @param {string} name The name of the service to decorate. - * @param {Function|Array.<string|Function>} decorator This function will be invoked when the service needs to be - * provided and should return the decorated service instance. The function is called using - * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable. - * Local injection arguments: - * - * * `$delegate` - The original service instance, which can be replaced, monkey patched, configured, - * decorated or delegated to. - * - * @example - * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting - * calls to {@link ng.$log#error $log.warn()}. - * ```js - * $provide.decorator('$log', ['$delegate', function($delegate) { - * $delegate.warn = $delegate.error; - * return $delegate; - * }]); - * ``` - */ - - - function createInjector(modulesToLoad, strictDi) { - strictDi = (strictDi === true); - var INSTANTIATING = {}, - providerSuffix = 'Provider', - path = [], - loadedModules = new NgMap(), - providerCache = { - $provide: { - provider: supportObject(provider), - factory: supportObject(factory), - service: supportObject(service), - value: supportObject(value), - constant: supportObject(constant), - decorator: decorator - } - }, - providerInjector = (providerCache.$injector = - createInternalInjector(providerCache, function(serviceName, caller) { - if (angular.isString(caller)) { - path.push(caller); - } - throw $injectorMinErr('unpr', 'Unknown provider: {0}', path.join(' <- ')); - })), - instanceCache = {}, - protoInstanceInjector = - createInternalInjector(instanceCache, function(serviceName, caller) { - var provider = providerInjector.get(serviceName + providerSuffix, caller); - return instanceInjector.invoke( - provider.$get, provider, undefined, serviceName); - }), - instanceInjector = protoInstanceInjector; - - providerCache['$injector' + providerSuffix] = { $get: valueFn(protoInstanceInjector) }; - instanceInjector.modules = providerInjector.modules = createMap(); - var runBlocks = loadModules(modulesToLoad); - instanceInjector = protoInstanceInjector.get('$injector'); - instanceInjector.strictDi = strictDi; - forEach(runBlocks, function(fn) { if (fn) instanceInjector.invoke(fn); }); - - instanceInjector.loadNewModules = function(mods) { - forEach(loadModules(mods), function(fn) { if (fn) instanceInjector.invoke(fn); }); - }; - - - return instanceInjector; - - //////////////////////////////////// - // $provider - //////////////////////////////////// - - function supportObject(delegate) { - return function(key, value) { - if (isObject(key)) { - forEach(key, reverseParams(delegate)); - } else { - return delegate(key, value); - } - }; - } - - function provider(name, provider_) { - assertNotHasOwnProperty(name, 'service'); - if (isFunction(provider_) || isArray(provider_)) { - provider_ = providerInjector.instantiate(provider_); - } - if (!provider_.$get) { - throw $injectorMinErr('pget', 'Provider \'{0}\' must define $get factory method.', name); - } - return (providerCache[name + providerSuffix] = provider_); - } - - function enforceReturnValue(name, factory) { - return /** @this */ function enforcedReturnValue() { - var result = instanceInjector.invoke(factory, this); - if (isUndefined(result)) { - throw $injectorMinErr('undef', 'Provider \'{0}\' must return a value from $get factory method.', name); - } - return result; - }; - } - - function factory(name, factoryFn, enforce) { - return provider(name, { - $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn - }); - } - - function service(name, constructor) { - return factory(name, ['$injector', function($injector) { - return $injector.instantiate(constructor); - }]); - } - - function value(name, val) { return factory(name, valueFn(val), false); } - - function constant(name, value) { - assertNotHasOwnProperty(name, 'constant'); - providerCache[name] = value; - instanceCache[name] = value; - } - - function decorator(serviceName, decorFn) { - var origProvider = providerInjector.get(serviceName + providerSuffix), - orig$get = origProvider.$get; - - origProvider.$get = function() { - var origInstance = instanceInjector.invoke(orig$get, origProvider); - return instanceInjector.invoke(decorFn, null, {$delegate: origInstance}); - }; - } - - //////////////////////////////////// - // Module Loading - //////////////////////////////////// - function loadModules(modulesToLoad) { - assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array'); - var runBlocks = [], moduleFn; - forEach(modulesToLoad, function(module) { - if (loadedModules.get(module)) return; - loadedModules.set(module, true); - - function runInvokeQueue(queue) { - var i, ii; - for (i = 0, ii = queue.length; i < ii; i++) { - var invokeArgs = queue[i], - provider = providerInjector.get(invokeArgs[0]); - - provider[invokeArgs[1]].apply(provider, invokeArgs[2]); - } - } - - try { - if (isString(module)) { - moduleFn = angularModule(module); - instanceInjector.modules[module] = moduleFn; - runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); - runInvokeQueue(moduleFn._invokeQueue); - runInvokeQueue(moduleFn._configBlocks); - } else if (isFunction(module)) { - runBlocks.push(providerInjector.invoke(module)); - } else if (isArray(module)) { - runBlocks.push(providerInjector.invoke(module)); - } else { - assertArgFn(module, 'module'); - } - } catch (e) { - if (isArray(module)) { - module = module[module.length - 1]; - } - if (e.message && e.stack && e.stack.indexOf(e.message) === -1) { - // Safari & FF's stack traces don't contain error.message content - // unlike those of Chrome and IE - // So if stack doesn't contain message, we create a new string that contains both. - // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here. - // eslint-disable-next-line no-ex-assign - e = e.message + '\n' + e.stack; - } - throw $injectorMinErr('modulerr', 'Failed to instantiate module {0} due to:\n{1}', - module, e.stack || e.message || e); - } - }); - return runBlocks; - } - - //////////////////////////////////// - // internal Injector - //////////////////////////////////// - - function createInternalInjector(cache, factory) { - - function getService(serviceName, caller) { - if (cache.hasOwnProperty(serviceName)) { - if (cache[serviceName] === INSTANTIATING) { - throw $injectorMinErr('cdep', 'Circular dependency found: {0}', - serviceName + ' <- ' + path.join(' <- ')); - } - return cache[serviceName]; - } else { - try { - path.unshift(serviceName); - cache[serviceName] = INSTANTIATING; - cache[serviceName] = factory(serviceName, caller); - return cache[serviceName]; - } catch (err) { - if (cache[serviceName] === INSTANTIATING) { - delete cache[serviceName]; - } - throw err; - } finally { - path.shift(); - } - } - } - - - function injectionArgs(fn, locals, serviceName) { - var args = [], - $inject = createInjector.$$annotate(fn, strictDi, serviceName); - - for (var i = 0, length = $inject.length; i < length; i++) { - var key = $inject[i]; - if (typeof key !== 'string') { - throw $injectorMinErr('itkn', - 'Incorrect injection token! Expected service name as string, got {0}', key); - } - args.push(locals && locals.hasOwnProperty(key) ? locals[key] : - getService(key, serviceName)); - } - return args; - } - - function isClass(func) { - // Support: IE 9-11 only - // IE 9-11 do not support classes and IE9 leaks with the code below. - if (msie || typeof func !== 'function') { - return false; - } - var result = func.$$ngIsClass; - if (!isBoolean(result)) { - // Support: Edge 12-13 only - // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/6156135/ - result = func.$$ngIsClass = /^(?:class\b|constructor\()/.test(stringifyFn(func)); - } - return result; - } - - function invoke(fn, self, locals, serviceName) { - if (typeof locals === 'string') { - serviceName = locals; - locals = null; - } - - var args = injectionArgs(fn, locals, serviceName); - if (isArray(fn)) { - fn = fn[fn.length - 1]; - } - - if (!isClass(fn)) { - // http://jsperf.com/angularjs-invoke-apply-vs-switch - // #5388 - return fn.apply(self, args); - } else { - args.unshift(null); - return new (Function.prototype.bind.apply(fn, args))(); - } - } - - - function instantiate(Type, locals, serviceName) { - // Check if Type is annotated and use just the given function at n-1 as parameter - // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); - var ctor = (isArray(Type) ? Type[Type.length - 1] : Type); - var args = injectionArgs(Type, locals, serviceName); - // Empty object at position 0 is ignored for invocation with `new`, but required. - args.unshift(null); - return new (Function.prototype.bind.apply(ctor, args))(); - } - - - return { - invoke: invoke, - instantiate: instantiate, - get: getService, - annotate: createInjector.$$annotate, - has: function(name) { - return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name); - } - }; - } - } - - createInjector.$$annotate = annotate; - - /** - * @ngdoc provider - * @name $anchorScrollProvider - * @this - * - * @description - * Use `$anchorScrollProvider` to disable automatic scrolling whenever - * {@link ng.$location#hash $location.hash()} changes. - */ - function $AnchorScrollProvider() { - - var autoScrollingEnabled = true; - - /** - * @ngdoc method - * @name $anchorScrollProvider#disableAutoScrolling - * - * @description - * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to - * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.<br /> - * Use this method to disable automatic scrolling. - * - * If automatic scrolling is disabled, one must explicitly call - * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the - * current hash. - */ - this.disableAutoScrolling = function() { - autoScrollingEnabled = false; - }; - - /** - * @ngdoc service - * @name $anchorScroll - * @kind function - * @requires $window - * @requires $location - * @requires $rootScope - * - * @description - * When called, it scrolls to the element related to the specified `hash` or (if omitted) to the - * current value of {@link ng.$location#hash $location.hash()}, according to the rules specified - * in the - * [HTML5 spec](http://www.w3.org/html/wg/drafts/html/master/browsers.html#an-indicated-part-of-the-document). - * - * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to - * match any anchor whenever it changes. This can be disabled by calling - * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}. - * - * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a - * vertical scroll-offset (either fixed or dynamic). - * - * @param {string=} hash The hash specifying the element to scroll to. If omitted, the value of - * {@link ng.$location#hash $location.hash()} will be used. - * - * @property {(number|function|jqLite)} yOffset - * If set, specifies a vertical scroll-offset. This is often useful when there are fixed - * positioned elements at the top of the page, such as navbars, headers etc. - * - * `yOffset` can be specified in various ways: - * - **number**: A fixed number of pixels to be used as offset.<br /><br /> - * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return - * a number representing the offset (in pixels).<br /><br /> - * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from - * the top of the page to the element's bottom will be used as offset.<br /> - * **Note**: The element will be taken into account only as long as its `position` is set to - * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust - * their height and/or positioning according to the viewport's size. - * - * <br /> - * <div class="alert alert-warning"> - * In order for `yOffset` to work properly, scrolling should take place on the document's root and - * not some child element. - * </div> - * - * @example - <example module="anchorScrollExample" name="anchor-scroll"> - <file name="index.html"> - <div id="scrollArea" ng-controller="ScrollController"> - <a ng-click="gotoBottom()">Go to bottom</a> - <a id="bottom"></a> You're at the bottom! - </div> - </file> - <file name="script.js"> - angular.module('anchorScrollExample', []) - .controller('ScrollController', ['$scope', '$location', '$anchorScroll', - function($scope, $location, $anchorScroll) { - $scope.gotoBottom = function() { - // set the location.hash to the id of - // the element you wish to scroll to. - $location.hash('bottom'); - - // call $anchorScroll() - $anchorScroll(); - }; - }]); - </file> - <file name="style.css"> - #scrollArea { - height: 280px; - overflow: auto; - } - - #bottom { - display: block; - margin-top: 2000px; - } - </file> - </example> - * - * <hr /> - * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value). - * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details. - * - * @example - <example module="anchorScrollOffsetExample" name="anchor-scroll-offset"> - <file name="index.html"> - <div class="fixed-header" ng-controller="headerCtrl"> - <a href="" ng-click="gotoAnchor(x)" ng-repeat="x in [1,2,3,4,5]"> - Go to anchor {{x}} - </a> - </div> - <div id="anchor{{x}}" class="anchor" ng-repeat="x in [1,2,3,4,5]"> - Anchor {{x}} of 5 - </div> - </file> - <file name="script.js"> - angular.module('anchorScrollOffsetExample', []) - .run(['$anchorScroll', function($anchorScroll) { - $anchorScroll.yOffset = 50; // always scroll by 50 extra pixels - }]) - .controller('headerCtrl', ['$anchorScroll', '$location', '$scope', - function($anchorScroll, $location, $scope) { - $scope.gotoAnchor = function(x) { - var newHash = 'anchor' + x; - if ($location.hash() !== newHash) { - // set the $location.hash to `newHash` and - // $anchorScroll will automatically scroll to it - $location.hash('anchor' + x); - } else { - // call $anchorScroll() explicitly, - // since $location.hash hasn't changed - $anchorScroll(); - } - }; - } - ]); - </file> - <file name="style.css"> - body { - padding-top: 50px; - } - - .anchor { - border: 2px dashed DarkOrchid; - padding: 10px 10px 200px 10px; - } - - .fixed-header { - background-color: rgba(0, 0, 0, 0.2); - height: 50px; - position: fixed; - top: 0; left: 0; right: 0; - } - - .fixed-header > a { - display: inline-block; - margin: 5px 15px; - } - </file> - </example> - */ - this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) { - var document = $window.document; - - // Helper function to get first anchor from a NodeList - // (using `Array#some()` instead of `angular#forEach()` since it's more performant - // and working in all supported browsers.) - function getFirstAnchor(list) { - var result = null; - Array.prototype.some.call(list, function(element) { - if (nodeName_(element) === 'a') { - result = element; - return true; - } - }); - return result; - } - - function getYOffset() { - - var offset = scroll.yOffset; - - if (isFunction(offset)) { - offset = offset(); - } else if (isElement(offset)) { - var elem = offset[0]; - var style = $window.getComputedStyle(elem); - if (style.position !== 'fixed') { - offset = 0; - } else { - offset = elem.getBoundingClientRect().bottom; - } - } else if (!isNumber(offset)) { - offset = 0; - } - - return offset; - } - - function scrollTo(elem) { - if (elem) { - elem.scrollIntoView(); - - var offset = getYOffset(); - - if (offset) { - // `offset` is the number of pixels we should scroll UP in order to align `elem` properly. - // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the - // top of the viewport. - // - // IF the number of pixels from the top of `elem` to the end of the page's content is less - // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some - // way down the page. - // - // This is often the case for elements near the bottom of the page. - // - // In such cases we do not need to scroll the whole `offset` up, just the difference between - // the top of the element and the offset, which is enough to align the top of `elem` at the - // desired position. - var elemTop = elem.getBoundingClientRect().top; - $window.scrollBy(0, elemTop - offset); - } - } else { - $window.scrollTo(0, 0); - } - } - - function scroll(hash) { - // Allow numeric hashes - hash = isString(hash) ? hash : isNumber(hash) ? hash.toString() : $location.hash(); - var elm; - - // empty hash, scroll to the top of the page - if (!hash) scrollTo(null); - - // element with given id - else if ((elm = document.getElementById(hash))) scrollTo(elm); - - // first anchor with given name :-D - else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm); - - // no element and hash === 'top', scroll to the top of the page - else if (hash === 'top') scrollTo(null); - } - - // does not scroll when user clicks on anchor link that is currently on - // (no url change, no $location.hash() change), browser native does scroll - if (autoScrollingEnabled) { - $rootScope.$watch(function autoScrollWatch() {return $location.hash();}, - function autoScrollWatchAction(newVal, oldVal) { - // skip the initial scroll if $location.hash is empty - if (newVal === oldVal && newVal === '') return; - - jqLiteDocumentLoaded(function() { - $rootScope.$evalAsync(scroll); - }); - }); - } - - return scroll; - }]; - } - - var $animateMinErr = minErr('$animate'); - var ELEMENT_NODE = 1; - var NG_ANIMATE_CLASSNAME = 'ng-animate'; - - function mergeClasses(a,b) { - if (!a && !b) return ''; - if (!a) return b; - if (!b) return a; - if (isArray(a)) a = a.join(' '); - if (isArray(b)) b = b.join(' '); - return a + ' ' + b; - } - - function extractElementNode(element) { - for (var i = 0; i < element.length; i++) { - var elm = element[i]; - if (elm.nodeType === ELEMENT_NODE) { - return elm; - } - } - } - - function splitClasses(classes) { - if (isString(classes)) { - classes = classes.split(' '); - } - - // Use createMap() to prevent class assumptions involving property names in - // Object.prototype - var obj = createMap(); - forEach(classes, function(klass) { - // sometimes the split leaves empty string values - // incase extra spaces were applied to the options - if (klass.length) { - obj[klass] = true; - } - }); - return obj; - } - -// if any other type of options value besides an Object value is -// passed into the $animate.method() animation then this helper code -// will be run which will ignore it. While this patch is not the -// greatest solution to this, a lot of existing plugins depend on -// $animate to either call the callback (< 1.2) or return a promise -// that can be changed. This helper function ensures that the options -// are wiped clean incase a callback function is provided. - function prepareAnimateOptions(options) { - return isObject(options) - ? options - : {}; - } - - var $$CoreAnimateJsProvider = /** @this */ function() { - this.$get = noop; - }; - -// this is prefixed with Core since it conflicts with -// the animateQueueProvider defined in ngAnimate/animateQueue.js - var $$CoreAnimateQueueProvider = /** @this */ function() { - var postDigestQueue = new NgMap(); - var postDigestElements = []; - - this.$get = ['$$AnimateRunner', '$rootScope', - function($$AnimateRunner, $rootScope) { - return { - enabled: noop, - on: noop, - off: noop, - pin: noop, - - push: function(element, event, options, domOperation) { - if (domOperation) { - domOperation(); - } - - options = options || {}; - if (options.from) { - element.css(options.from); - } - if (options.to) { - element.css(options.to); - } - - if (options.addClass || options.removeClass) { - addRemoveClassesPostDigest(element, options.addClass, options.removeClass); - } - - var runner = new $$AnimateRunner(); - - // since there are no animations to run the runner needs to be - // notified that the animation call is complete. - runner.complete(); - return runner; - } - }; - - - function updateData(data, classes, value) { - var changed = false; - if (classes) { - classes = isString(classes) ? classes.split(' ') : - isArray(classes) ? classes : []; - forEach(classes, function(className) { - if (className) { - changed = true; - data[className] = value; - } - }); - } - return changed; - } - - function handleCSSClassChanges() { - forEach(postDigestElements, function(element) { - var data = postDigestQueue.get(element); - if (data) { - var existing = splitClasses(element.attr('class')); - var toAdd = ''; - var toRemove = ''; - forEach(data, function(status, className) { - var hasClass = !!existing[className]; - if (status !== hasClass) { - if (status) { - toAdd += (toAdd.length ? ' ' : '') + className; - } else { - toRemove += (toRemove.length ? ' ' : '') + className; - } - } - }); - - forEach(element, function(elm) { - if (toAdd) { - jqLiteAddClass(elm, toAdd); - } - if (toRemove) { - jqLiteRemoveClass(elm, toRemove); - } - }); - postDigestQueue.delete(element); - } - }); - postDigestElements.length = 0; - } - - - function addRemoveClassesPostDigest(element, add, remove) { - var data = postDigestQueue.get(element) || {}; - - var classesAdded = updateData(data, add, true); - var classesRemoved = updateData(data, remove, false); - - if (classesAdded || classesRemoved) { - - postDigestQueue.set(element, data); - postDigestElements.push(element); - - if (postDigestElements.length === 1) { - $rootScope.$$postDigest(handleCSSClassChanges); - } - } - } - }]; - }; - - /** - * @ngdoc provider - * @name $animateProvider - * - * @description - * Default implementation of $animate that doesn't perform any animations, instead just - * synchronously performs DOM updates and resolves the returned runner promise. - * - * In order to enable animations the `ngAnimate` module has to be loaded. - * - * To see the functional implementation check out `src/ngAnimate/animate.js`. - */ - var $AnimateProvider = ['$provide', /** @this */ function($provide) { - var provider = this; - var classNameFilter = null; - var customFilter = null; - - this.$$registeredAnimations = Object.create(null); - - /** - * @ngdoc method - * @name $animateProvider#register - * - * @description - * Registers a new injectable animation factory function. The factory function produces the - * animation object which contains callback functions for each event that is expected to be - * animated. - * - * * `eventFn`: `function(element, ... , doneFunction, options)` - * The element to animate, the `doneFunction` and the options fed into the animation. Depending - * on the type of animation additional arguments will be injected into the animation function. The - * list below explains the function signatures for the different animation methods: - * - * - setClass: function(element, addedClasses, removedClasses, doneFunction, options) - * - addClass: function(element, addedClasses, doneFunction, options) - * - removeClass: function(element, removedClasses, doneFunction, options) - * - enter, leave, move: function(element, doneFunction, options) - * - animate: function(element, fromStyles, toStyles, doneFunction, options) - * - * Make sure to trigger the `doneFunction` once the animation is fully complete. - * - * ```js - * return { - * //enter, leave, move signature - * eventFn : function(element, done, options) { - * //code to run the animation - * //once complete, then run done() - * return function endFunction(wasCancelled) { - * //code to cancel the animation - * } - * } - * } - * ``` - * - * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to). - * @param {Function} factory The factory function that will be executed to return the animation - * object. - */ - this.register = function(name, factory) { - if (name && name.charAt(0) !== '.') { - throw $animateMinErr('notcsel', 'Expecting class selector starting with \'.\' got \'{0}\'.', name); - } - - var key = name + '-animation'; - provider.$$registeredAnimations[name.substr(1)] = key; - $provide.factory(key, factory); - }; - - /** - * @ngdoc method - * @name $animateProvider#customFilter - * - * @description - * Sets and/or returns the custom filter function that is used to "filter" animations, i.e. - * determine if an animation is allowed or not. When no filter is specified (the default), no - * animation will be blocked. Setting the `customFilter` value will only allow animations for - * which the filter function's return value is truthy. - * - * This allows to easily create arbitrarily complex rules for filtering animations, such as - * allowing specific events only, or enabling animations on specific subtrees of the DOM, etc. - * Filtering animations can also boost performance for low-powered devices, as well as - * applications containing a lot of structural operations. - * - * <div class="alert alert-success"> - * **Best Practice:** - * Keep the filtering function as lean as possible, because it will be called for each DOM - * action (e.g. insertion, removal, class change) performed by "animation-aware" directives. - * See {@link guide/animations#which-directives-support-animations- here} for a list of built-in - * directives that support animations. - * Performing computationally expensive or time-consuming operations on each call of the - * filtering function can make your animations sluggish. - * </div> - * - * **Note:** If present, `customFilter` will be checked before - * {@link $animateProvider#classNameFilter classNameFilter}. - * - * @param {Function=} filterFn - The filter function which will be used to filter all animations. - * If a falsy value is returned, no animation will be performed. The function will be called - * with the following arguments: - * - **node** `{DOMElement}` - The DOM element to be animated. - * - **event** `{String}` - The name of the animation event (e.g. `enter`, `leave`, `addClass` - * etc). - * - **options** `{Object}` - A collection of options/styles used for the animation. - * @return {Function} The current filter function or `null` if there is none set. - */ - this.customFilter = function(filterFn) { - if (arguments.length === 1) { - customFilter = isFunction(filterFn) ? filterFn : null; - } - - return customFilter; - }; - - /** - * @ngdoc method - * @name $animateProvider#classNameFilter - * - * @description - * Sets and/or returns the CSS class regular expression that is checked when performing - * an animation. Upon bootstrap the classNameFilter value is not set at all and will - * therefore enable $animate to attempt to perform an animation on any element that is triggered. - * When setting the `classNameFilter` value, animations will only be performed on elements - * that successfully match the filter expression. This in turn can boost performance - * for low-powered devices as well as applications containing a lot of structural operations. - * - * **Note:** If present, `classNameFilter` will be checked after - * {@link $animateProvider#customFilter customFilter}. If `customFilter` is present and returns - * false, `classNameFilter` will not be checked. - * - * @param {RegExp=} expression The className expression which will be checked against all animations - * @return {RegExp} The current CSS className expression value. If null then there is no expression value - */ - this.classNameFilter = function(expression) { - if (arguments.length === 1) { - classNameFilter = (expression instanceof RegExp) ? expression : null; - if (classNameFilter) { - var reservedRegex = new RegExp('[(\\s|\\/)]' + NG_ANIMATE_CLASSNAME + '[(\\s|\\/)]'); - if (reservedRegex.test(classNameFilter.toString())) { - classNameFilter = null; - throw $animateMinErr('nongcls', '$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.', NG_ANIMATE_CLASSNAME); - } - } - } - return classNameFilter; - }; - - this.$get = ['$$animateQueue', function($$animateQueue) { - function domInsert(element, parentElement, afterElement) { - // if for some reason the previous element was removed - // from the dom sometime before this code runs then let's - // just stick to using the parent element as the anchor - if (afterElement) { - var afterNode = extractElementNode(afterElement); - if (afterNode && !afterNode.parentNode && !afterNode.previousElementSibling) { - afterElement = null; - } - } - if (afterElement) { - afterElement.after(element); - } else { - parentElement.prepend(element); - } - } - - /** - * @ngdoc service - * @name $animate - * @description The $animate service exposes a series of DOM utility methods that provide support - * for animation hooks. The default behavior is the application of DOM operations, however, - * when an animation is detected (and animations are enabled), $animate will do the heavy lifting - * to ensure that animation runs with the triggered DOM operation. - * - * By default $animate doesn't trigger any animations. This is because the `ngAnimate` module isn't - * included and only when it is active then the animation hooks that `$animate` triggers will be - * functional. Once active then all structural `ng-` directives will trigger animations as they perform - * their DOM-related operations (enter, leave and move). Other directives such as `ngClass`, - * `ngShow`, `ngHide` and `ngMessages` also provide support for animations. - * - * It is recommended that the`$animate` service is always used when executing DOM-related procedures within directives. - * - * To learn more about enabling animation support, click here to visit the - * {@link ngAnimate ngAnimate module page}. - */ - return { - // we don't call it directly since non-existant arguments may - // be interpreted as null within the sub enabled function - - /** - * - * @ngdoc method - * @name $animate#on - * @kind function - * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...) - * has fired on the given element or among any of its children. Once the listener is fired, the provided callback - * is fired with the following params: - * - * ```js - * $animate.on('enter', container, - * function callback(element, phase) { - * // cool we detected an enter animation within the container - * } - * ); - * ``` - * - * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...) - * @param {DOMElement} container the container element that will capture each of the animation events that are fired on itself - * as well as among its children - * @param {Function} callback the callback function that will be fired when the listener is triggered - * - * The arguments present in the callback function are: - * * `element` - The captured DOM element that the animation was fired on. - * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends). - */ - on: $$animateQueue.on, - - /** - * - * @ngdoc method - * @name $animate#off - * @kind function - * @description Deregisters an event listener based on the event which has been associated with the provided element. This method - * can be used in three different ways depending on the arguments: - * - * ```js - * // remove all the animation event listeners listening for `enter` - * $animate.off('enter'); - * - * // remove listeners for all animation events from the container element - * $animate.off(container); - * - * // remove all the animation event listeners listening for `enter` on the given element and its children - * $animate.off('enter', container); - * - * // remove the event listener function provided by `callback` that is set - * // to listen for `enter` on the given `container` as well as its children - * $animate.off('enter', container, callback); - * ``` - * - * @param {string|DOMElement} event|container the animation event (e.g. enter, leave, move, - * addClass, removeClass, etc...), or the container element. If it is the element, all other - * arguments are ignored. - * @param {DOMElement=} container the container element the event listener was placed on - * @param {Function=} callback the callback function that was registered as the listener - */ - off: $$animateQueue.off, - - /** - * @ngdoc method - * @name $animate#pin - * @kind function - * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists - * outside of the DOM structure of the AngularJS application. By doing so, any animation triggered via `$animate` can be issued on the - * element despite being outside the realm of the application or within another application. Say for example if the application - * was bootstrapped on an element that is somewhere inside of the `<body>` tag, but we wanted to allow for an element to be situated - * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind - * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association. - * - * Note that this feature is only active when the `ngAnimate` module is used. - * - * @param {DOMElement} element the external element that will be pinned - * @param {DOMElement} parentElement the host parent element that will be associated with the external element - */ - pin: $$animateQueue.pin, - - /** - * - * @ngdoc method - * @name $animate#enabled - * @kind function - * @description Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This - * function can be called in four ways: - * - * ```js - * // returns true or false - * $animate.enabled(); - * - * // changes the enabled state for all animations - * $animate.enabled(false); - * $animate.enabled(true); - * - * // returns true or false if animations are enabled for an element - * $animate.enabled(element); - * - * // changes the enabled state for an element and its children - * $animate.enabled(element, true); - * $animate.enabled(element, false); - * ``` - * - * @param {DOMElement=} element the element that will be considered for checking/setting the enabled state - * @param {boolean=} enabled whether or not the animations will be enabled for the element - * - * @return {boolean} whether or not animations are enabled - */ - enabled: $$animateQueue.enabled, - - /** - * @ngdoc method - * @name $animate#cancel - * @kind function - * @description Cancels the provided animation. - * - * @param {Promise} animationPromise The animation promise that is returned when an animation is started. - */ - cancel: function(runner) { - if (runner.end) { - runner.end(); - } - }, - - /** - * - * @ngdoc method - * @name $animate#enter - * @kind function - * @description Inserts the element into the DOM either after the `after` element (if provided) or - * as the first child within the `parent` element and then triggers an animation. - * A promise is returned that will be resolved during the next digest once the animation - * has completed. - * - * @param {DOMElement} element the element which will be inserted into the DOM - * @param {DOMElement} parent the parent element which will append the element as - * a child (so long as the after element is not present) - * @param {DOMElement=} after the sibling element after which the element will be appended - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - enter: function(element, parent, after, options) { - parent = parent && jqLite(parent); - after = after && jqLite(after); - parent = parent || after.parent(); - domInsert(element, parent, after); - return $$animateQueue.push(element, 'enter', prepareAnimateOptions(options)); - }, - - /** - * - * @ngdoc method - * @name $animate#move - * @kind function - * @description Inserts (moves) the element into its new position in the DOM either after - * the `after` element (if provided) or as the first child within the `parent` element - * and then triggers an animation. A promise is returned that will be resolved - * during the next digest once the animation has completed. - * - * @param {DOMElement} element the element which will be moved into the new DOM position - * @param {DOMElement} parent the parent element which will append the element as - * a child (so long as the after element is not present) - * @param {DOMElement=} after the sibling element after which the element will be appended - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - move: function(element, parent, after, options) { - parent = parent && jqLite(parent); - after = after && jqLite(after); - parent = parent || after.parent(); - domInsert(element, parent, after); - return $$animateQueue.push(element, 'move', prepareAnimateOptions(options)); - }, - - /** - * @ngdoc method - * @name $animate#leave - * @kind function - * @description Triggers an animation and then removes the element from the DOM. - * When the function is called a promise is returned that will be resolved during the next - * digest once the animation has completed. - * - * @param {DOMElement} element the element which will be removed from the DOM - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - leave: function(element, options) { - return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function() { - element.remove(); - }); - }, - - /** - * @ngdoc method - * @name $animate#addClass - * @kind function - * - * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon - * execution, the addClass operation will only be handled after the next digest and it will not trigger an - * animation if element already contains the CSS class or if the class is removed at a later step. - * Note that class-based animations are treated differently compared to structural animations - * (like enter, move and leave) since the CSS classes may be added/removed at different points - * depending if CSS or JavaScript animations are used. - * - * @param {DOMElement} element the element which the CSS classes will be applied to - * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces) - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - addClass: function(element, className, options) { - options = prepareAnimateOptions(options); - options.addClass = mergeClasses(options.addclass, className); - return $$animateQueue.push(element, 'addClass', options); - }, - - /** - * @ngdoc method - * @name $animate#removeClass - * @kind function - * - * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon - * execution, the removeClass operation will only be handled after the next digest and it will not trigger an - * animation if element does not contain the CSS class or if the class is added at a later step. - * Note that class-based animations are treated differently compared to structural animations - * (like enter, move and leave) since the CSS classes may be added/removed at different points - * depending if CSS or JavaScript animations are used. - * - * @param {DOMElement} element the element which the CSS classes will be applied to - * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces) - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - removeClass: function(element, className, options) { - options = prepareAnimateOptions(options); - options.removeClass = mergeClasses(options.removeClass, className); - return $$animateQueue.push(element, 'removeClass', options); - }, - - /** - * @ngdoc method - * @name $animate#setClass - * @kind function - * - * @description Performs both the addition and removal of a CSS classes on an element and (during the process) - * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and - * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has - * passed. Note that class-based animations are treated differently compared to structural animations - * (like enter, move and leave) since the CSS classes may be added/removed at different points - * depending if CSS or JavaScript animations are used. - * - * @param {DOMElement} element the element which the CSS classes will be applied to - * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces) - * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces) - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - setClass: function(element, add, remove, options) { - options = prepareAnimateOptions(options); - options.addClass = mergeClasses(options.addClass, add); - options.removeClass = mergeClasses(options.removeClass, remove); - return $$animateQueue.push(element, 'setClass', options); - }, - - /** - * @ngdoc method - * @name $animate#animate - * @kind function - * - * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element. - * If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take - * on the provided styles. For example, if a transition animation is set for the given className, then the provided `from` and - * `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding - * style in `to`, the style in `from` is applied immediately, and no animation is run. - * If a JavaScript animation is detected then the provided styles will be given in as function parameters into the `animate` - * method (or as part of the `options` parameter): - * - * ```js - * ngModule.animation('.my-inline-animation', function() { - * return { - * animate : function(element, from, to, done, options) { - * //animation - * done(); - * } - * } - * }); - * ``` - * - * @param {DOMElement} element the element which the CSS styles will be applied to - * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation. - * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation. - * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If - * this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element. - * (Note that if no animation is detected then this value will not be applied to the element.) - * @param {object=} options an optional collection of options/styles that will be applied to the element. - * The object can have the following properties: - * - * - **addClass** - `{string}` - space-separated CSS classes to add to element - * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to` - * - **removeClass** - `{string}` - space-separated CSS classes to remove from element - * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from` - * - * @return {Promise} the animation callback promise - */ - animate: function(element, from, to, className, options) { - options = prepareAnimateOptions(options); - options.from = options.from ? extend(options.from, from) : from; - options.to = options.to ? extend(options.to, to) : to; - - className = className || 'ng-inline-animate'; - options.tempClasses = mergeClasses(options.tempClasses, className); - return $$animateQueue.push(element, 'animate', options); - } - }; - }]; - }]; - - var $$AnimateAsyncRunFactoryProvider = /** @this */ function() { - this.$get = ['$$rAF', function($$rAF) { - var waitQueue = []; - - function waitForTick(fn) { - waitQueue.push(fn); - if (waitQueue.length > 1) return; - $$rAF(function() { - for (var i = 0; i < waitQueue.length; i++) { - waitQueue[i](); - } - waitQueue = []; - }); - } - - return function() { - var passed = false; - waitForTick(function() { - passed = true; - }); - return function(callback) { - if (passed) { - callback(); - } else { - waitForTick(callback); - } - }; - }; - }]; - }; - - var $$AnimateRunnerFactoryProvider = /** @this */ function() { - this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$$isDocumentHidden', '$timeout', - function($q, $sniffer, $$animateAsyncRun, $$isDocumentHidden, $timeout) { - - var INITIAL_STATE = 0; - var DONE_PENDING_STATE = 1; - var DONE_COMPLETE_STATE = 2; - - AnimateRunner.chain = function(chain, callback) { - var index = 0; - - next(); - function next() { - if (index === chain.length) { - callback(true); - return; - } - - chain[index](function(response) { - if (response === false) { - callback(false); - return; - } - index++; - next(); - }); - } - }; - - AnimateRunner.all = function(runners, callback) { - var count = 0; - var status = true; - forEach(runners, function(runner) { - runner.done(onProgress); - }); - - function onProgress(response) { - status = status && response; - if (++count === runners.length) { - callback(status); - } - } - }; - - function AnimateRunner(host) { - this.setHost(host); - - var rafTick = $$animateAsyncRun(); - var timeoutTick = function(fn) { - $timeout(fn, 0, false); - }; - - this._doneCallbacks = []; - this._tick = function(fn) { - if ($$isDocumentHidden()) { - timeoutTick(fn); - } else { - rafTick(fn); - } - }; - this._state = 0; - } - - AnimateRunner.prototype = { - setHost: function(host) { - this.host = host || {}; - }, - - done: function(fn) { - if (this._state === DONE_COMPLETE_STATE) { - fn(); - } else { - this._doneCallbacks.push(fn); - } - }, - - progress: noop, - - getPromise: function() { - if (!this.promise) { - var self = this; - this.promise = $q(function(resolve, reject) { - self.done(function(status) { - if (status === false) { - reject(); - } else { - resolve(); - } - }); - }); - } - return this.promise; - }, - - then: function(resolveHandler, rejectHandler) { - return this.getPromise().then(resolveHandler, rejectHandler); - }, - - 'catch': function(handler) { - return this.getPromise()['catch'](handler); - }, - - 'finally': function(handler) { - return this.getPromise()['finally'](handler); - }, - - pause: function() { - if (this.host.pause) { - this.host.pause(); - } - }, - - resume: function() { - if (this.host.resume) { - this.host.resume(); - } - }, - - end: function() { - if (this.host.end) { - this.host.end(); - } - this._resolve(true); - }, - - cancel: function() { - if (this.host.cancel) { - this.host.cancel(); - } - this._resolve(false); - }, - - complete: function(response) { - var self = this; - if (self._state === INITIAL_STATE) { - self._state = DONE_PENDING_STATE; - self._tick(function() { - self._resolve(response); - }); - } - }, - - _resolve: function(response) { - if (this._state !== DONE_COMPLETE_STATE) { - forEach(this._doneCallbacks, function(fn) { - fn(response); - }); - this._doneCallbacks.length = 0; - this._state = DONE_COMPLETE_STATE; - } - } - }; - - return AnimateRunner; - }]; - }; - - /* exported $CoreAnimateCssProvider */ - - /** - * @ngdoc service - * @name $animateCss - * @kind object - * @this - * - * @description - * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included, - * then the `$animateCss` service will actually perform animations. - * - * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}. - */ - var $CoreAnimateCssProvider = function() { - this.$get = ['$$rAF', '$q', '$$AnimateRunner', function($$rAF, $q, $$AnimateRunner) { - - return function(element, initialOptions) { - // all of the animation functions should create - // a copy of the options data, however, if a - // parent service has already created a copy then - // we should stick to using that - var options = initialOptions || {}; - if (!options.$$prepared) { - options = copy(options); - } - - // there is no point in applying the styles since - // there is no animation that goes on at all in - // this version of $animateCss. - if (options.cleanupStyles) { - options.from = options.to = null; - } - - if (options.from) { - element.css(options.from); - options.from = null; - } - - var closed, runner = new $$AnimateRunner(); - return { - start: run, - end: run - }; - - function run() { - $$rAF(function() { - applyAnimationContents(); - if (!closed) { - runner.complete(); - } - closed = true; - }); - return runner; - } - - function applyAnimationContents() { - if (options.addClass) { - element.addClass(options.addClass); - options.addClass = null; - } - if (options.removeClass) { - element.removeClass(options.removeClass); - options.removeClass = null; - } - if (options.to) { - element.css(options.to); - options.to = null; - } - } - }; - }]; - }; - - /* global stripHash: true */ - - /** - * ! This is a private undocumented service ! - * - * @name $browser - * @requires $log - * @description - * This object has two goals: - * - * - hide all the global state in the browser caused by the window object - * - abstract away all the browser specific features and inconsistencies - * - * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser` - * service, which can be used for convenient testing of the application without the interaction with - * the real browser apis. - */ - /** - * @param {object} window The global window object. - * @param {object} document jQuery wrapped document. - * @param {object} $log window.console or an object with the same interface. - * @param {object} $sniffer $sniffer service - */ - function Browser(window, document, $log, $sniffer) { - var self = this, - location = window.location, - history = window.history, - setTimeout = window.setTimeout, - clearTimeout = window.clearTimeout, - pendingDeferIds = {}; - - self.isMock = false; - - var outstandingRequestCount = 0; - var outstandingRequestCallbacks = []; - - // TODO(vojta): remove this temporary api - self.$$completeOutstandingRequest = completeOutstandingRequest; - self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; }; - - /** - * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` - * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. - */ - function completeOutstandingRequest(fn) { - try { - fn.apply(null, sliceArgs(arguments, 1)); - } finally { - outstandingRequestCount--; - if (outstandingRequestCount === 0) { - while (outstandingRequestCallbacks.length) { - try { - outstandingRequestCallbacks.pop()(); - } catch (e) { - $log.error(e); - } - } - } - } - } - - function getHash(url) { - var index = url.indexOf('#'); - return index === -1 ? '' : url.substr(index); - } - - /** - * @private - * TODO(vojta): prefix this method with $$ ? - * @param {function()} callback Function that will be called when no outstanding request - */ - self.notifyWhenNoOutstandingRequests = function(callback) { - if (outstandingRequestCount === 0) { - callback(); - } else { - outstandingRequestCallbacks.push(callback); - } - }; - - ////////////////////////////////////////////////////////////// - // URL API - ////////////////////////////////////////////////////////////// - - var cachedState, lastHistoryState, - lastBrowserUrl = location.href, - baseElement = document.find('base'), - pendingLocation = null, - getCurrentState = !$sniffer.history ? noop : function getCurrentState() { - try { - return history.state; - } catch (e) { - // MSIE can reportedly throw when there is no state (UNCONFIRMED). - } - }; - - cacheState(); - - /** - * @name $browser#url - * - * @description - * GETTER: - * Without any argument, this method just returns current value of location.href. - * - * SETTER: - * With at least one argument, this method sets url to new value. - * If html5 history api supported, pushState/replaceState is used, otherwise - * location.href/location.replace is used. - * Returns its own instance to allow chaining - * - * NOTE: this api is intended for use only by the $location service. Please use the - * {@link ng.$location $location service} to change url. - * - * @param {string} url New url (when used as setter) - * @param {boolean=} replace Should new url replace current history record? - * @param {object=} state object to use with pushState/replaceState - */ - self.url = function(url, replace, state) { - // In modern browsers `history.state` is `null` by default; treating it separately - // from `undefined` would cause `$browser.url('/foo')` to change `history.state` - // to undefined via `pushState`. Instead, let's change `undefined` to `null` here. - if (isUndefined(state)) { - state = null; - } - - // Android Browser BFCache causes location, history reference to become stale. - if (location !== window.location) location = window.location; - if (history !== window.history) history = window.history; - - // setter - if (url) { - var sameState = lastHistoryState === state; - - // Don't change anything if previous and current URLs and states match. This also prevents - // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode. - // See https://github.com/angular/angular.js/commit/ffb2701 - if (lastBrowserUrl === url && (!$sniffer.history || sameState)) { - return self; - } - var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url); - lastBrowserUrl = url; - lastHistoryState = state; - // Don't use history API if only the hash changed - // due to a bug in IE10/IE11 which leads - // to not firing a `hashchange` nor `popstate` event - // in some cases (see #9143). - if ($sniffer.history && (!sameBase || !sameState)) { - history[replace ? 'replaceState' : 'pushState'](state, '', url); - cacheState(); - } else { - if (!sameBase) { - pendingLocation = url; - } - if (replace) { - location.replace(url); - } else if (!sameBase) { - location.href = url; - } else { - location.hash = getHash(url); - } - if (location.href !== url) { - pendingLocation = url; - } - } - if (pendingLocation) { - pendingLocation = url; - } - return self; - // getter - } else { - // - pendingLocation is needed as browsers don't allow to read out - // the new location.href if a reload happened or if there is a bug like in iOS 9 (see - // https://openradar.appspot.com/22186109). - // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172 - return pendingLocation || location.href.replace(/%27/g,'\''); - } - }; - - /** - * @name $browser#state - * - * @description - * This method is a getter. - * - * Return history.state or null if history.state is undefined. - * - * @returns {object} state - */ - self.state = function() { - return cachedState; - }; - - var urlChangeListeners = [], - urlChangeInit = false; - - function cacheStateAndFireUrlChange() { - pendingLocation = null; - fireStateOrUrlChange(); - } - - // This variable should be used *only* inside the cacheState function. - var lastCachedState = null; - function cacheState() { - // This should be the only place in $browser where `history.state` is read. - cachedState = getCurrentState(); - cachedState = isUndefined(cachedState) ? null : cachedState; - - // Prevent callbacks fo fire twice if both hashchange & popstate were fired. - if (equals(cachedState, lastCachedState)) { - cachedState = lastCachedState; - } - - lastCachedState = cachedState; - lastHistoryState = cachedState; - } - - function fireStateOrUrlChange() { - var prevLastHistoryState = lastHistoryState; - cacheState(); - - if (lastBrowserUrl === self.url() && prevLastHistoryState === cachedState) { - return; - } - - lastBrowserUrl = self.url(); - lastHistoryState = cachedState; - forEach(urlChangeListeners, function(listener) { - listener(self.url(), cachedState); - }); - } - - /** - * @name $browser#onUrlChange - * - * @description - * Register callback function that will be called, when url changes. - * - * It's only called when the url is changed from outside of AngularJS: - * - user types different url into address bar - * - user clicks on history (forward/back) button - * - user clicks on a link - * - * It's not called when url is changed by $browser.url() method - * - * The listener gets called with new url as parameter. - * - * NOTE: this api is intended for use only by the $location service. Please use the - * {@link ng.$location $location service} to monitor url changes in AngularJS apps. - * - * @param {function(string)} listener Listener function to be called when url changes. - * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous. - */ - self.onUrlChange = function(callback) { - // TODO(vojta): refactor to use node's syntax for events - if (!urlChangeInit) { - // We listen on both (hashchange/popstate) when available, as some browsers don't - // fire popstate when user changes the address bar and don't fire hashchange when url - // changed by push/replaceState - - // html5 history api - popstate event - if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange); - // hashchange event - jqLite(window).on('hashchange', cacheStateAndFireUrlChange); - - urlChangeInit = true; - } - - urlChangeListeners.push(callback); - return callback; - }; - - /** - * @private - * Remove popstate and hashchange handler from window. - * - * NOTE: this api is intended for use only by $rootScope. - */ - self.$$applicationDestroyed = function() { - jqLite(window).off('hashchange popstate', cacheStateAndFireUrlChange); - }; - - /** - * Checks whether the url has changed outside of AngularJS. - * Needs to be exported to be able to check for changes that have been done in sync, - * as hashchange/popstate events fire in async. - */ - self.$$checkUrlChange = fireStateOrUrlChange; - - ////////////////////////////////////////////////////////////// - // Misc API - ////////////////////////////////////////////////////////////// - - /** - * @name $browser#baseHref - * - * @description - * Returns current <base href> - * (always relative - without domain) - * - * @returns {string} The current base href - */ - self.baseHref = function() { - var href = baseElement.attr('href'); - return href ? href.replace(/^(https?:)?\/\/[^/]*/, '') : ''; - }; - - /** - * @name $browser#defer - * @param {function()} fn A function, who's execution should be deferred. - * @param {number=} [delay=0] of milliseconds to defer the function execution. - * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`. - * - * @description - * Executes a fn asynchronously via `setTimeout(fn, delay)`. - * - * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using - * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed - * via `$browser.defer.flush()`. - * - */ - self.defer = function(fn, delay) { - var timeoutId; - outstandingRequestCount++; - timeoutId = setTimeout(function() { - delete pendingDeferIds[timeoutId]; - completeOutstandingRequest(fn); - }, delay || 0); - pendingDeferIds[timeoutId] = true; - return timeoutId; - }; - - - /** - * @name $browser#defer.cancel - * - * @description - * Cancels a deferred task identified with `deferId`. - * - * @param {*} deferId Token returned by the `$browser.defer` function. - * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully - * canceled. - */ - self.defer.cancel = function(deferId) { - if (pendingDeferIds[deferId]) { - delete pendingDeferIds[deferId]; - clearTimeout(deferId); - completeOutstandingRequest(noop); - return true; - } - return false; - }; - - } - - /** @this */ - function $BrowserProvider() { - this.$get = ['$window', '$log', '$sniffer', '$document', - function($window, $log, $sniffer, $document) { - return new Browser($window, $document, $log, $sniffer); - }]; - } - - /** - * @ngdoc service - * @name $cacheFactory - * @this - * - * @description - * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to - * them. - * - * ```js - * - * var cache = $cacheFactory('cacheId'); - * expect($cacheFactory.get('cacheId')).toBe(cache); - * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined(); - * - * cache.put("key", "value"); - * cache.put("another key", "another value"); - * - * // We've specified no options on creation - * expect(cache.info()).toEqual({id: 'cacheId', size: 2}); - * - * ``` - * - * - * @param {string} cacheId Name or id of the newly created cache. - * @param {object=} options Options object that specifies the cache behavior. Properties: - * - * - `{number=}` `capacity` — turns the cache into LRU cache. - * - * @returns {object} Newly created cache object with the following set of methods: - * - * - `{object}` `info()` — Returns id, size, and options of cache. - * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns - * it. - * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss. - * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache. - * - `{void}` `removeAll()` — Removes all cached values. - * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory. - * - * @example - <example module="cacheExampleApp" name="cache-factory"> - <file name="index.html"> - <div ng-controller="CacheController"> - <input ng-model="newCacheKey" placeholder="Key"> - <input ng-model="newCacheValue" placeholder="Value"> - <button ng-click="put(newCacheKey, newCacheValue)">Cache</button> - - <p ng-if="keys.length">Cached Values</p> - <div ng-repeat="key in keys"> - <span ng-bind="key"></span> - <span>: </span> - <b ng-bind="cache.get(key)"></b> - </div> - - <p>Cache Info</p> - <div ng-repeat="(key, value) in cache.info()"> - <span ng-bind="key"></span> - <span>: </span> - <b ng-bind="value"></b> - </div> - </div> - </file> - <file name="script.js"> - angular.module('cacheExampleApp', []). - controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) { - $scope.keys = []; - $scope.cache = $cacheFactory('cacheId'); - $scope.put = function(key, value) { - if (angular.isUndefined($scope.cache.get(key))) { - $scope.keys.push(key); - } - $scope.cache.put(key, angular.isUndefined(value) ? null : value); - }; - }]); - </file> - <file name="style.css"> - p { - margin: 10px 0 3px; - } - </file> - </example> - */ - function $CacheFactoryProvider() { - - this.$get = function() { - var caches = {}; - - function cacheFactory(cacheId, options) { - if (cacheId in caches) { - throw minErr('$cacheFactory')('iid', 'CacheId \'{0}\' is already taken!', cacheId); - } - - var size = 0, - stats = extend({}, options, {id: cacheId}), - data = createMap(), - capacity = (options && options.capacity) || Number.MAX_VALUE, - lruHash = createMap(), - freshEnd = null, - staleEnd = null; - - /** - * @ngdoc type - * @name $cacheFactory.Cache - * - * @description - * A cache object used to store and retrieve data, primarily used by - * {@link $templateRequest $templateRequest} and the {@link ng.directive:script script} - * directive to cache templates and other data. - * - * ```js - * angular.module('superCache') - * .factory('superCache', ['$cacheFactory', function($cacheFactory) { - * return $cacheFactory('super-cache'); - * }]); - * ``` - * - * Example test: - * - * ```js - * it('should behave like a cache', inject(function(superCache) { - * superCache.put('key', 'value'); - * superCache.put('another key', 'another value'); - * - * expect(superCache.info()).toEqual({ - * id: 'super-cache', - * size: 2 - * }); - * - * superCache.remove('another key'); - * expect(superCache.get('another key')).toBeUndefined(); - * - * superCache.removeAll(); - * expect(superCache.info()).toEqual({ - * id: 'super-cache', - * size: 0 - * }); - * })); - * ``` - */ - return (caches[cacheId] = { - - /** - * @ngdoc method - * @name $cacheFactory.Cache#put - * @kind function - * - * @description - * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be - * retrieved later, and incrementing the size of the cache if the key was not already - * present in the cache. If behaving like an LRU cache, it will also remove stale - * entries from the set. - * - * It will not insert undefined values into the cache. - * - * @param {string} key the key under which the cached data is stored. - * @param {*} value the value to store alongside the key. If it is undefined, the key - * will not be stored. - * @returns {*} the value stored. - */ - put: function(key, value) { - if (isUndefined(value)) return; - if (capacity < Number.MAX_VALUE) { - var lruEntry = lruHash[key] || (lruHash[key] = {key: key}); - - refresh(lruEntry); - } - - if (!(key in data)) size++; - data[key] = value; - - if (size > capacity) { - this.remove(staleEnd.key); - } - - return value; - }, - - /** - * @ngdoc method - * @name $cacheFactory.Cache#get - * @kind function - * - * @description - * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object. - * - * @param {string} key the key of the data to be retrieved - * @returns {*} the value stored. - */ - get: function(key) { - if (capacity < Number.MAX_VALUE) { - var lruEntry = lruHash[key]; - - if (!lruEntry) return; - - refresh(lruEntry); - } - - return data[key]; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#remove - * @kind function - * - * @description - * Removes an entry from the {@link $cacheFactory.Cache Cache} object. - * - * @param {string} key the key of the entry to be removed - */ - remove: function(key) { - if (capacity < Number.MAX_VALUE) { - var lruEntry = lruHash[key]; - - if (!lruEntry) return; - - if (lruEntry === freshEnd) freshEnd = lruEntry.p; - if (lruEntry === staleEnd) staleEnd = lruEntry.n; - link(lruEntry.n,lruEntry.p); - - delete lruHash[key]; - } - - if (!(key in data)) return; - - delete data[key]; - size--; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#removeAll - * @kind function - * - * @description - * Clears the cache object of any entries. - */ - removeAll: function() { - data = createMap(); - size = 0; - lruHash = createMap(); - freshEnd = staleEnd = null; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#destroy - * @kind function - * - * @description - * Destroys the {@link $cacheFactory.Cache Cache} object entirely, - * removing it from the {@link $cacheFactory $cacheFactory} set. - */ - destroy: function() { - data = null; - stats = null; - lruHash = null; - delete caches[cacheId]; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#info - * @kind function - * - * @description - * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}. - * - * @returns {object} an object with the following properties: - * <ul> - * <li>**id**: the id of the cache instance</li> - * <li>**size**: the number of entries kept in the cache instance</li> - * <li>**...**: any additional properties from the options object when creating the - * cache.</li> - * </ul> - */ - info: function() { - return extend({}, stats, {size: size}); - } - }); - - - /** - * makes the `entry` the freshEnd of the LRU linked list - */ - function refresh(entry) { - if (entry !== freshEnd) { - if (!staleEnd) { - staleEnd = entry; - } else if (staleEnd === entry) { - staleEnd = entry.n; - } - - link(entry.n, entry.p); - link(entry, freshEnd); - freshEnd = entry; - freshEnd.n = null; - } - } - - - /** - * bidirectionally links two entries of the LRU linked list - */ - function link(nextEntry, prevEntry) { - if (nextEntry !== prevEntry) { - if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify - if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify - } - } - } - - - /** - * @ngdoc method - * @name $cacheFactory#info - * - * @description - * Get information about all the caches that have been created - * - * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info` - */ - cacheFactory.info = function() { - var info = {}; - forEach(caches, function(cache, cacheId) { - info[cacheId] = cache.info(); - }); - return info; - }; - - - /** - * @ngdoc method - * @name $cacheFactory#get - * - * @description - * Get access to a cache object by the `cacheId` used when it was created. - * - * @param {string} cacheId Name or id of a cache to access. - * @returns {object} Cache object identified by the cacheId or undefined if no such cache. - */ - cacheFactory.get = function(cacheId) { - return caches[cacheId]; - }; - - - return cacheFactory; - }; - } - - /** - * @ngdoc service - * @name $templateCache - * @this - * - * @description - * `$templateCache` is a {@link $cacheFactory.Cache Cache object} created by the - * {@link ng.$cacheFactory $cacheFactory}. - * - * The first time a template is used, it is loaded in the template cache for quick retrieval. You - * can load templates directly into the cache in a `script` tag, by using {@link $templateRequest}, - * or by consuming the `$templateCache` service directly. - * - * Adding via the `script` tag: - * - * ```html - * <script type="text/ng-template" id="templateId.html"> - * <p>This is the content of the template</p> - * </script> - * ``` - * - * **Note:** the `script` tag containing the template does not need to be included in the `head` of - * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (e.g. - * element with {@link ngApp} attribute), otherwise the template will be ignored. - * - * Adding via the `$templateCache` service: - * - * ```js - * var myApp = angular.module('myApp', []); - * myApp.run(function($templateCache) { - * $templateCache.put('templateId.html', 'This is the content of the template'); - * }); - * ``` - * - * To retrieve the template later, simply use it in your component: - * ```js - * myApp.component('myComponent', { - * templateUrl: 'templateId.html' - * }); - * ``` - * - * or get it via the `$templateCache` service: - * ```js - * $templateCache.get('templateId.html') - * ``` - * - */ - function $TemplateCacheProvider() { - this.$get = ['$cacheFactory', function($cacheFactory) { - return $cacheFactory('templates'); - }]; - } - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables like document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE! - * - * DOM-related variables: - * - * - "node" - DOM Node - * - "element" - DOM Element or Node - * - "$node" or "$element" - jqLite-wrapped node or element - * - * - * Compiler related stuff: - * - * - "linkFn" - linking fn of a single directive - * - "nodeLinkFn" - function that aggregates all linking fns for a particular node - * - "childLinkFn" - function that aggregates all linking fns for child nodes of a particular node - * - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList) - */ - - - /** - * @ngdoc service - * @name $compile - * @kind function - * - * @description - * Compiles an HTML string or DOM into a template and produces a template function, which - * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together. - * - * The compilation is a process of walking the DOM tree and matching DOM elements to - * {@link ng.$compileProvider#directive directives}. - * - * <div class="alert alert-warning"> - * **Note:** This document is an in-depth reference of all directive options. - * For a gentle introduction to directives with examples of common use cases, - * see the {@link guide/directive directive guide}. - * </div> - * - * ## Comprehensive Directive API - * - * There are many different options for a directive. - * - * The difference resides in the return value of the factory function. - * You can either return a {@link $compile#directive-definition-object Directive Definition Object (see below)} - * that defines the directive properties, or just the `postLink` function (all other properties will have - * the default values). - * - * <div class="alert alert-success"> - * **Best Practice:** It's recommended to use the "directive definition object" form. - * </div> - * - * Here's an example directive declared with a Directive Definition Object: - * - * ```js - * var myModule = angular.module(...); - * - * myModule.directive('directiveName', function factory(injectables) { - * var directiveDefinitionObject = { - * {@link $compile#-priority- priority}: 0, - * {@link $compile#-template- template}: '<div></div>', // or // function(tElement, tAttrs) { ... }, - * // or - * // {@link $compile#-templateurl- templateUrl}: 'directive.html', // or // function(tElement, tAttrs) { ... }, - * {@link $compile#-transclude- transclude}: false, - * {@link $compile#-restrict- restrict}: 'A', - * {@link $compile#-templatenamespace- templateNamespace}: 'html', - * {@link $compile#-scope- scope}: false, - * {@link $compile#-controller- controller}: function($scope, $element, $attrs, $transclude, otherInjectables) { ... }, - * {@link $compile#-controlleras- controllerAs}: 'stringIdentifier', - * {@link $compile#-bindtocontroller- bindToController}: false, - * {@link $compile#-require- require}: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'], - * {@link $compile#-multielement- multiElement}: false, - * {@link $compile#-compile- compile}: function compile(tElement, tAttrs, transclude) { - * return { - * {@link $compile#pre-linking-function pre}: function preLink(scope, iElement, iAttrs, controller) { ... }, - * {@link $compile#post-linking-function post}: function postLink(scope, iElement, iAttrs, controller) { ... } - * } - * // or - * // return function postLink( ... ) { ... } - * }, - * // or - * // {@link $compile#-link- link}: { - * // {@link $compile#pre-linking-function pre}: function preLink(scope, iElement, iAttrs, controller) { ... }, - * // {@link $compile#post-linking-function post}: function postLink(scope, iElement, iAttrs, controller) { ... } - * // } - * // or - * // {@link $compile#-link- link}: function postLink( ... ) { ... } - * }; - * return directiveDefinitionObject; - * }); - * ``` - * - * <div class="alert alert-warning"> - * **Note:** Any unspecified options will use the default value. You can see the default values below. - * </div> - * - * Therefore the above can be simplified as: - * - * ```js - * var myModule = angular.module(...); - * - * myModule.directive('directiveName', function factory(injectables) { - * var directiveDefinitionObject = { - * link: function postLink(scope, iElement, iAttrs) { ... } - * }; - * return directiveDefinitionObject; - * // or - * // return function postLink(scope, iElement, iAttrs) { ... } - * }); - * ``` - * - * ### Life-cycle hooks - * Directive controllers can provide the following methods that are called by AngularJS at points in the life-cycle of the - * directive: - * * `$onInit()` - Called on each controller after all the controllers on an element have been constructed and - * had their bindings initialized (and before the pre & post linking functions for the directives on - * this element). This is a good place to put initialization code for your controller. - * * `$onChanges(changesObj)` - Called whenever one-way (`<`) or interpolation (`@`) bindings are updated. The - * `changesObj` is a hash whose keys are the names of the bound properties that have changed, and the values are an - * object of the form `{ currentValue, previousValue, isFirstChange() }`. Use this hook to trigger updates within a - * component such as cloning the bound value to prevent accidental mutation of the outer value. Note that this will - * also be called when your bindings are initialized. - * * `$doCheck()` - Called on each turn of the digest cycle. Provides an opportunity to detect and act on - * changes. Any actions that you wish to take in response to the changes that you detect must be - * invoked from this hook; implementing this has no effect on when `$onChanges` is called. For example, this hook - * could be useful if you wish to perform a deep equality check, or to check a Date object, changes to which would not - * be detected by AngularJS's change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments; - * if detecting changes, you must store the previous value(s) for comparison to the current values. - * * `$onDestroy()` - Called on a controller when its containing scope is destroyed. Use this hook for releasing - * external resources, watches and event handlers. Note that components have their `$onDestroy()` hooks called in - * the same order as the `$scope.$broadcast` events are triggered, which is top down. This means that parent - * components will have their `$onDestroy()` hook called before child components. - * * `$postLink()` - Called after this controller's element and its children have been linked. Similar to the post-link - * function this hook can be used to set up DOM event handlers and do direct DOM manipulation. - * Note that child elements that contain `templateUrl` directives will not have been compiled and linked since - * they are waiting for their template to load asynchronously and their own compilation and linking has been - * suspended until that occurs. - * - * #### Comparison with life-cycle hooks in the new Angular - * The new Angular also uses life-cycle hooks for its components. While the AngularJS life-cycle hooks are similar there are - * some differences that you should be aware of, especially when it comes to moving your code from AngularJS to Angular: - * - * * AngularJS hooks are prefixed with `$`, such as `$onInit`. Angular hooks are prefixed with `ng`, such as `ngOnInit`. - * * AngularJS hooks can be defined on the controller prototype or added to the controller inside its constructor. - * In Angular you can only define hooks on the prototype of the Component class. - * * Due to the differences in change-detection, you may get many more calls to `$doCheck` in AngularJS than you would to - * `ngDoCheck` in Angular. - * * Changes to the model inside `$doCheck` will trigger new turns of the digest loop, which will cause the changes to be - * propagated throughout the application. - * Angular does not allow the `ngDoCheck` hook to trigger a change outside of the component. It will either throw an - * error or do nothing depending upon the state of `enableProdMode()`. - * - * #### Life-cycle hook examples - * - * This example shows how you can check for mutations to a Date object even though the identity of the object - * has not changed. - * - * <example name="doCheckDateExample" module="do-check-module"> - * <file name="app.js"> - * angular.module('do-check-module', []) - * .component('app', { - * template: - * 'Month: <input ng-model="$ctrl.month" ng-change="$ctrl.updateDate()">' + - * 'Date: {{ $ctrl.date }}' + - * '<test date="$ctrl.date"></test>', - * controller: function() { - * this.date = new Date(); - * this.month = this.date.getMonth(); - * this.updateDate = function() { - * this.date.setMonth(this.month); - * }; - * } - * }) - * .component('test', { - * bindings: { date: '<' }, - * template: - * '<pre>{{ $ctrl.log | json }}</pre>', - * controller: function() { - * var previousValue; - * this.log = []; - * this.$doCheck = function() { - * var currentValue = this.date && this.date.valueOf(); - * if (previousValue !== currentValue) { - * this.log.push('doCheck: date mutated: ' + this.date); - * previousValue = currentValue; - * } - * }; - * } - * }); - * </file> - * <file name="index.html"> - * <app></app> - * </file> - * </example> - * - * This example show how you might use `$doCheck` to trigger changes in your component's inputs even if the - * actual identity of the component doesn't change. (Be aware that cloning and deep equality checks on large - * arrays or objects can have a negative impact on your application performance) - * - * <example name="doCheckArrayExample" module="do-check-module"> - * <file name="index.html"> - * <div ng-init="items = []"> - * <button ng-click="items.push(items.length)">Add Item</button> - * <button ng-click="items = []">Reset Items</button> - * <pre>{{ items }}</pre> - * <test items="items"></test> - * </div> - * </file> - * <file name="app.js"> - * angular.module('do-check-module', []) - * .component('test', { - * bindings: { items: '<' }, - * template: - * '<pre>{{ $ctrl.log | json }}</pre>', - * controller: function() { - * this.log = []; - * - * this.$doCheck = function() { - * if (this.items_ref !== this.items) { - * this.log.push('doCheck: items changed'); - * this.items_ref = this.items; - * } - * if (!angular.equals(this.items_clone, this.items)) { - * this.log.push('doCheck: items mutated'); - * this.items_clone = angular.copy(this.items); - * } - * }; - * } - * }); - * </file> - * </example> - * - * - * ### Directive Definition Object - * - * The directive definition object provides instructions to the {@link ng.$compile - * compiler}. The attributes are: - * - * #### `multiElement` - * When this property is set to true (default is `false`), the HTML compiler will collect DOM nodes between - * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them - * together as the directive elements. It is recommended that this feature be used on directives - * which are not strictly behavioral (such as {@link ngClick}), and which - * do not manipulate or replace child nodes (such as {@link ngInclude}). - * - * #### `priority` - * When there are multiple directives defined on a single DOM element, sometimes it - * is necessary to specify the order in which the directives are applied. The `priority` is used - * to sort the directives before their `compile` functions get called. Priority is defined as a - * number. Directives with greater numerical `priority` are compiled first. Pre-link functions - * are also run in priority order, but post-link functions are run in reverse order. The order - * of directives with the same priority is undefined. The default priority is `0`. - * - * #### `terminal` - * If set to true then the current `priority` will be the last set of directives - * which will execute (any directives at the current priority will still execute - * as the order of execution on same `priority` is undefined). Note that expressions - * and other directives used in the directive's template will also be excluded from execution. - * - * #### `scope` - * The scope property can be `false`, `true`, or an object: - * - * * **`false` (default):** No scope will be created for the directive. The directive will use its - * parent's scope. - * - * * **`true`:** A new child scope that prototypically inherits from its parent will be created for - * the directive's element. If multiple directives on the same element request a new scope, - * only one new scope is created. - * - * * **`{...}` (an object hash):** A new "isolate" scope is created for the directive's template. - * The 'isolate' scope differs from normal scope in that it does not prototypically - * inherit from its parent scope. This is useful when creating reusable components, which should not - * accidentally read or modify data in the parent scope. Note that an isolate scope - * directive without a `template` or `templateUrl` will not apply the isolate scope - * to its children elements. - * - * The 'isolate' scope object hash defines a set of local scope properties derived from attributes on the - * directive's element. These local properties are useful for aliasing values for templates. The keys in - * the object hash map to the name of the property on the isolate scope; the values define how the property - * is bound to the parent scope, via matching attributes on the directive's element: - * - * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is - * always a string since DOM attributes are strings. If no `attr` name is specified then the - * attribute name is assumed to be the same as the local name. Given `<my-component - * my-attr="hello {{name}}">` and the isolate scope definition `scope: { localName:'@myAttr' }`, - * the directive's scope property `localName` will reflect the interpolated value of `hello - * {{name}}`. As the `name` attribute changes so will the `localName` property on the directive's - * scope. The `name` is read from the parent scope (not the directive's scope). - * - * * `=` or `=attr` - set up a bidirectional binding between a local scope property and an expression - * passed via the attribute `attr`. The expression is evaluated in the context of the parent scope. - * If no `attr` name is specified then the attribute name is assumed to be the same as the local - * name. Given `<my-component my-attr="parentModel">` and the isolate scope definition `scope: { - * localModel: '=myAttr' }`, the property `localModel` on the directive's scope will reflect the - * value of `parentModel` on the parent scope. Changes to `parentModel` will be reflected in - * `localModel` and vice versa. Optional attributes should be marked as such with a question mark: - * `=?` or `=?attr`. If the binding expression is non-assignable, or if the attribute isn't - * optional and doesn't exist, an exception ({@link error/$compile/nonassign `$compile:nonassign`}) - * will be thrown upon discovering changes to the local value, since it will be impossible to sync - * them back to the parent scope. By default, the {@link ng.$rootScope.Scope#$watch `$watch`} - * method is used for tracking changes, and the equality check is based on object identity. - * However, if an object literal or an array literal is passed as the binding expression, the - * equality check is done by value (using the {@link angular.equals} function). It's also possible - * to watch the evaluated value shallowly with {@link ng.$rootScope.Scope#$watchCollection - * `$watchCollection`}: use `=*` or `=*attr` (`=*?` or `=*?attr` if the attribute is optional). - * - * * `<` or `<attr` - set up a one-way (one-directional) binding between a local scope property and an - * expression passed via the attribute `attr`. The expression is evaluated in the context of the - * parent scope. If no `attr` name is specified then the attribute name is assumed to be the same as the - * local name. You can also make the binding optional by adding `?`: `<?` or `<?attr`. - * - * For example, given `<my-component my-attr="parentModel">` and directive definition of - * `scope: { localModel:'<myAttr' }`, then the isolated scope property `localModel` will reflect the - * value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected - * in `localModel`, but changes in `localModel` will not reflect in `parentModel`. There are however - * two caveats: - * 1. one-way binding does not copy the value from the parent to the isolate scope, it simply - * sets the same value. That means if your bound value is an object, changes to its properties - * in the isolated scope will be reflected in the parent scope (because both reference the same object). - * 2. one-way binding watches changes to the **identity** of the parent value. That means the - * {@link ng.$rootScope.Scope#$watch `$watch`} on the parent value only fires if the reference - * to the value has changed. In most cases, this should not be of concern, but can be important - * to know if you one-way bind to an object, and then replace that object in the isolated scope. - * If you now change a property of the object in your parent scope, the change will not be - * propagated to the isolated scope, because the identity of the object on the parent scope - * has not changed. Instead you must assign a new object. - * - * One-way binding is useful if you do not plan to propagate changes to your isolated scope bindings - * back to the parent. However, it does not make this completely impossible. - * - * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope. If - * no `attr` name is specified then the attribute name is assumed to be the same as the local name. - * Given `<my-component my-attr="count = count + value">` and the isolate scope definition `scope: { - * localFn:'&myAttr' }`, the isolate scope property `localFn` will point to a function wrapper for - * the `count = count + value` expression. Often it's desirable to pass data from the isolated scope - * via an expression to the parent scope. This can be done by passing a map of local variable names - * and values into the expression wrapper fn. For example, if the expression is `increment(amount)` - * then we can specify the amount value by calling the `localFn` as `localFn({amount: 22})`. - * - * In general it's possible to apply more than one directive to one element, but there might be limitations - * depending on the type of scope required by the directives. The following points will help explain these limitations. - * For simplicity only two directives are taken into account, but it is also applicable for several directives: - * - * * **no scope** + **no scope** => Two directives which don't require their own scope will use their parent's scope - * * **child scope** + **no scope** => Both directives will share one single child scope - * * **child scope** + **child scope** => Both directives will share one single child scope - * * **isolated scope** + **no scope** => The isolated directive will use it's own created isolated scope. The other directive will use - * its parent's scope - * * **isolated scope** + **child scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives cannot - * be applied to the same element. - * * **isolated scope** + **isolated scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives - * cannot be applied to the same element. - * - * - * #### `bindToController` - * This property is used to bind scope properties directly to the controller. It can be either - * `true` or an object hash with the same format as the `scope` property. - * - * When an isolate scope is used for a directive (see above), `bindToController: true` will - * allow a component to have its properties bound to the controller, rather than to scope. - * - * After the controller is instantiated, the initial values of the isolate scope bindings will be bound to the controller - * properties. You can access these bindings once they have been initialized by providing a controller method called - * `$onInit`, which is called after all the controllers on an element have been constructed and had their bindings - * initialized. - * - * <div class="alert alert-warning"> - * **Deprecation warning:** if `$compileProcvider.preAssignBindingsEnabled(true)` was called, bindings for non-ES6 class - * controllers are bound to `this` before the controller constructor is called but this use is now deprecated. Please - * place initialization code that relies upon bindings inside a `$onInit` method on the controller, instead. - * </div> - * - * It is also possible to set `bindToController` to an object hash with the same format as the `scope` property. - * This will set up the scope bindings to the controller directly. Note that `scope` can still be used - * to define which kind of scope is created. By default, no scope is created. Use `scope: {}` to create an isolate - * scope (useful for component directives). - * - * If both `bindToController` and `scope` are defined and have object hashes, `bindToController` overrides `scope`. - * - * - * #### `controller` - * Controller constructor function. The controller is instantiated before the - * pre-linking phase and can be accessed by other directives (see - * `require` attribute). This allows the directives to communicate with each other and augment - * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals: - * - * * `$scope` - Current scope associated with the element - * * `$element` - Current element - * * `$attrs` - Current attributes object for the element - * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope: - * `function([scope], cloneLinkingFn, futureParentElement, slotName)`: - * * `scope`: (optional) override the scope. - * * `cloneLinkingFn`: (optional) argument to create clones of the original transcluded content. - * * `futureParentElement` (optional): - * * defines the parent to which the `cloneLinkingFn` will add the cloned elements. - * * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`. - * * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements) - * and when the `cloneLinkingFn` is passed, - * as those elements need to created and cloned in a special way when they are defined outside their - * usual containers (e.g. like `<svg>`). - * * See also the `directive.templateNamespace` property. - * * `slotName`: (optional) the name of the slot to transclude. If falsy (e.g. `null`, `undefined` or `''`) - * then the default transclusion is provided. - * The `$transclude` function also has a method on it, `$transclude.isSlotFilled(slotName)`, which returns - * `true` if the specified slot contains content (i.e. one or more DOM nodes). - * - * #### `require` - * Require another directive and inject its controller as the fourth argument to the linking function. The - * `require` property can be a string, an array or an object: - * * a **string** containing the name of the directive to pass to the linking function - * * an **array** containing the names of directives to pass to the linking function. The argument passed to the - * linking function will be an array of controllers in the same order as the names in the `require` property - * * an **object** whose property values are the names of the directives to pass to the linking function. The argument - * passed to the linking function will also be an object with matching keys, whose values will hold the corresponding - * controllers. - * - * If the `require` property is an object and `bindToController` is truthy, then the required controllers are - * bound to the controller using the keys of the `require` property. This binding occurs after all the controllers - * have been constructed but before `$onInit` is called. - * If the name of the required controller is the same as the local name (the key), the name can be - * omitted. For example, `{parentDir: '^^'}` is equivalent to `{parentDir: '^^parentDir'}`. - * See the {@link $compileProvider#component} helper for an example of how this can be used. - * If no such required directive(s) can be found, or if the directive does not have a controller, then an error is - * raised (unless no link function is specified and the required controllers are not being bound to the directive - * controller, in which case error checking is skipped). The name can be prefixed with: - * - * * (no prefix) - Locate the required controller on the current element. Throw an error if not found. - * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found. - * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found. - * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found. - * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass - * `null` to the `link` fn if not found. - * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass - * `null` to the `link` fn if not found. - * - * - * #### `controllerAs` - * Identifier name for a reference to the controller in the directive's scope. - * This allows the controller to be referenced from the directive template. This is especially - * useful when a directive is used as component, i.e. with an `isolate` scope. It's also possible - * to use it in a directive without an `isolate` / `new` scope, but you need to be aware that the - * `controllerAs` reference might overwrite a property that already exists on the parent scope. - * - * - * #### `restrict` - * String of subset of `EACM` which restricts the directive to a specific directive - * declaration style. If omitted, the defaults (elements and attributes) are used. - * - * * `E` - Element name (default): `<my-directive></my-directive>` - * * `A` - Attribute (default): `<div my-directive="exp"></div>` - * * `C` - Class: `<div class="my-directive: exp;"></div>` - * * `M` - Comment: `<!-- directive: my-directive exp -->` - * - * - * #### `templateNamespace` - * String representing the document type used by the markup in the template. - * AngularJS needs this information as those elements need to be created and cloned - * in a special way when they are defined outside their usual containers like `<svg>` and `<math>`. - * - * * `html` - All root nodes in the template are HTML. Root nodes may also be - * top-level elements such as `<svg>` or `<math>`. - * * `svg` - The root nodes in the template are SVG elements (excluding `<math>`). - * * `math` - The root nodes in the template are MathML elements (excluding `<svg>`). - * - * If no `templateNamespace` is specified, then the namespace is considered to be `html`. - * - * #### `template` - * HTML markup that may: - * * Replace the contents of the directive's element (default). - * * Replace the directive's element itself (if `replace` is true - DEPRECATED). - * * Wrap the contents of the directive's element (if `transclude` is true). - * - * Value may be: - * - * * A string. For example `<div red-on-hover>{{delete_str}}</div>`. - * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile` - * function api below) and returns a string value. - * - * - * #### `templateUrl` - * This is similar to `template` but the template is loaded from the specified URL, asynchronously. - * - * Because template loading is asynchronous the compiler will suspend compilation of directives on that element - * for later when the template has been resolved. In the meantime it will continue to compile and link - * sibling and parent elements as though this element had not contained any directives. - * - * The compiler does not suspend the entire compilation to wait for templates to be loaded because this - * would result in the whole app "stalling" until all templates are loaded asynchronously - even in the - * case when only one deeply nested directive has `templateUrl`. - * - * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache} - * - * You can specify `templateUrl` as a string representing the URL or as a function which takes two - * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns - * a string value representing the url. In either case, the template URL is passed through {@link - * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}. - * - * - * #### `replace` (*DEPRECATED*) - * - * `replace` will be removed in next major release - i.e. v2.0). - * - * Specifies what the template should replace. Defaults to `false`. - * - * * `true` - the template will replace the directive's element. - * * `false` - the template will replace the contents of the directive's element. - * - * The replacement process migrates all of the attributes / classes from the old element to the new - * one. See the {@link guide/directive#template-expanding-directive - * Directives Guide} for an example. - * - * There are very few scenarios where element replacement is required for the application function, - * the main one being reusable custom components that are used within SVG contexts - * (because SVG doesn't work with custom elements in the DOM tree). - * - * #### `transclude` - * Extract the contents of the element where the directive appears and make it available to the directive. - * The contents are compiled and provided to the directive as a **transclusion function**. See the - * {@link $compile#transclusion Transclusion} section below. - * - * - * #### `compile` - * - * ```js - * function compile(tElement, tAttrs, transclude) { ... } - * ``` - * - * The compile function deals with transforming the template DOM. Since most directives do not do - * template transformation, it is not used often. The compile function takes the following arguments: - * - * * `tElement` - template element - The element where the directive has been declared. It is - * safe to do template transformation on the element and child elements only. - * - * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared - * between all directive compile functions. - * - * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)` - * - * <div class="alert alert-warning"> - * **Note:** The template instance and the link instance may be different objects if the template has - * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that - * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration - * should be done in a linking function rather than in a compile function. - * </div> - - * <div class="alert alert-warning"> - * **Note:** The compile function cannot handle directives that recursively use themselves in their - * own templates or compile functions. Compiling these directives results in an infinite loop and - * stack overflow errors. - * - * This can be avoided by manually using $compile in the postLink function to imperatively compile - * a directive's template instead of relying on automatic template compilation via `template` or - * `templateUrl` declaration or manual compilation inside the compile function. - * </div> - * - * <div class="alert alert-danger"> - * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it - * e.g. does not know about the right outer scope. Please use the transclude function that is passed - * to the link function instead. - * </div> - - * A compile function can have a return value which can be either a function or an object. - * - * * returning a (post-link) function - is equivalent to registering the linking function via the - * `link` property of the config object when the compile function is empty. - * - * * returning an object with function(s) registered via `pre` and `post` properties - allows you to - * control when a linking function should be called during the linking phase. See info about - * pre-linking and post-linking functions below. - * - * - * #### `link` - * This property is used only if the `compile` property is not defined. - * - * ```js - * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... } - * ``` - * - * The link function is responsible for registering DOM listeners as well as updating the DOM. It is - * executed after the template has been cloned. This is where most of the directive logic will be - * put. - * - * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the - * directive for registering {@link ng.$rootScope.Scope#$watch watches}. - * - * * `iElement` - instance element - The element where the directive is to be used. It is safe to - * manipulate the children of the element only in `postLink` function since the children have - * already been linked. - * - * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared - * between all directive linking functions. - * - * * `controller` - the directive's required controller instance(s) - Instances are shared - * among all directives, which allows the directives to use the controllers as a communication - * channel. The exact value depends on the directive's `require` property: - * * no controller(s) required: the directive's own controller, or `undefined` if it doesn't have one - * * `string`: the controller instance - * * `array`: array of controller instances - * - * If a required controller cannot be found, and it is optional, the instance is `null`, - * otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown. - * - * Note that you can also require the directive's own controller - it will be made available like - * any other controller. - * - * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope. - * This is the same as the `$transclude` parameter of directive controllers, - * see {@link ng.$compile#-controller- the controller section for details}. - * `function([scope], cloneLinkingFn, futureParentElement)`. - * - * #### Pre-linking function - * - * Executed before the child elements are linked. Not safe to do DOM transformation since the - * compiler linking function will fail to locate the correct elements for linking. - * - * #### Post-linking function - * - * Executed after the child elements are linked. - * - * Note that child elements that contain `templateUrl` directives will not have been compiled - * and linked since they are waiting for their template to load asynchronously and their own - * compilation and linking has been suspended until that occurs. - * - * It is safe to do DOM transformation in the post-linking function on elements that are not waiting - * for their async templates to be resolved. - * - * - * ### Transclusion - * - * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and - * copying them to another part of the DOM, while maintaining their connection to the original AngularJS - * scope from where they were taken. - * - * Transclusion is used (often with {@link ngTransclude}) to insert the - * original contents of a directive's element into a specified place in the template of the directive. - * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded - * content has access to the properties on the scope from which it was taken, even if the directive - * has isolated scope. - * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}. - * - * This makes it possible for the widget to have private state for its template, while the transcluded - * content has access to its originating scope. - * - * <div class="alert alert-warning"> - * **Note:** When testing an element transclude directive you must not place the directive at the root of the - * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives - * Testing Transclusion Directives}. - * </div> - * - * There are three kinds of transclusion depending upon whether you want to transclude just the contents of the - * directive's element, the entire element or multiple parts of the element contents: - * - * * `true` - transclude the content (i.e. the child nodes) of the directive's element. - * * `'element'` - transclude the whole of the directive's element including any directives on this - * element that defined at a lower priority than this directive. When used, the `template` - * property is ignored. - * * **`{...}` (an object hash):** - map elements of the content onto transclusion "slots" in the template. - * - * **Mult-slot transclusion** is declared by providing an object for the `transclude` property. - * - * This object is a map where the keys are the name of the slot to fill and the value is an element selector - * used to match the HTML to the slot. The element selector should be in normalized form (e.g. `myElement`) - * and will match the standard element variants (e.g. `my-element`, `my:element`, `data-my-element`, etc). - * - * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives} - * - * If the element selector is prefixed with a `?` then that slot is optional. - * - * For example, the transclude object `{ slotA: '?myCustomElement' }` maps `<my-custom-element>` elements to - * the `slotA` slot, which can be accessed via the `$transclude` function or via the {@link ngTransclude} directive. - * - * Slots that are not marked as optional (`?`) will trigger a compile time error if there are no matching elements - * in the transclude content. If you wish to know if an optional slot was filled with content, then you can call - * `$transclude.isSlotFilled(slotName)` on the transclude function passed to the directive's link function and - * injectable into the directive's controller. - * - * - * #### Transclusion Functions - * - * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion - * function** to the directive's `link` function and `controller`. This transclusion function is a special - * **linking function** that will return the compiled contents linked to a new transclusion scope. - * - * <div class="alert alert-info"> - * If you are just using {@link ngTransclude} then you don't need to worry about this function, since - * ngTransclude will deal with it for us. - * </div> - * - * If you want to manually control the insertion and removal of the transcluded content in your directive - * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery - * object that contains the compiled DOM, which is linked to the correct transclusion scope. - * - * When you call a transclusion function you can pass in a **clone attach function**. This function accepts - * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded - * content and the `scope` is the newly created transclusion scope, which the clone will be linked to. - * - * <div class="alert alert-info"> - * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a transclude function - * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope. - * </div> - * - * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone - * attach function**: - * - * ```js - * var transcludedContent, transclusionScope; - * - * $transclude(function(clone, scope) { - * element.append(clone); - * transcludedContent = clone; - * transclusionScope = scope; - * }); - * ``` - * - * Later, if you want to remove the transcluded content from your DOM then you should also destroy the - * associated transclusion scope: - * - * ```js - * transcludedContent.remove(); - * transclusionScope.$destroy(); - * ``` - * - * <div class="alert alert-info"> - * **Best Practice**: if you intend to add and remove transcluded content manually in your directive - * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it), - * then you are also responsible for calling `$destroy` on the transclusion scope. - * </div> - * - * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat} - * automatically destroy their transcluded clones as necessary so you do not need to worry about this if - * you are simply using {@link ngTransclude} to inject the transclusion into your directive. - * - * - * #### Transclusion Scopes - * - * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion - * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed - * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it - * was taken. - * - * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look - * like this: - * - * ```html - * <div ng-app> - * <div isolate> - * <div transclusion> - * </div> - * </div> - * </div> - * ``` - * - * The `$parent` scope hierarchy will look like this: - * - ``` - - $rootScope - - isolate - - transclusion - ``` - * - * but the scopes will inherit prototypically from different scopes to their `$parent`. - * - ``` - - $rootScope - - transclusion - - isolate - ``` - * - * - * ### Attributes - * - * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the - * `link()` or `compile()` functions. It has a variety of uses. - * - * * *Accessing normalized attribute names:* Directives like 'ngBind' can be expressed in many ways: - * 'ng:bind', `data-ng-bind`, or 'x-ng-bind'. The attributes object allows for normalized access - * to the attributes. - * - * * *Directive inter-communication:* All directives share the same instance of the attributes - * object which allows the directives to use the attributes object as inter directive - * communication. - * - * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object - * allowing other directives to read the interpolated value. - * - * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes - * that contain interpolation (e.g. `src="{{bar}}"`). Not only is this very efficient but it's also - * the only way to easily get the actual value because during the linking phase the interpolation - * hasn't been evaluated yet and so the value is at this time set to `undefined`. - * - * ```js - * function linkingFn(scope, elm, attrs, ctrl) { - * // get the attribute value - * console.log(attrs.ngModel); - * - * // change the attribute - * attrs.$set('ngModel', 'new value'); - * - * // observe changes to interpolated attribute - * attrs.$observe('ngModel', function(value) { - * console.log('ngModel has changed value to ' + value); - * }); - * } - * ``` - * - * ## Example - * - * <div class="alert alert-warning"> - * **Note**: Typically directives are registered with `module.directive`. The example below is - * to illustrate how `$compile` works. - * </div> - * - <example module="compileExample" name="compile"> - <file name="index.html"> - <script> - angular.module('compileExample', [], function($compileProvider) { - // configure new 'compile' directive by passing a directive - // factory function. The factory function injects the '$compile' - $compileProvider.directive('compile', function($compile) { - // directive factory creates a link function - return function(scope, element, attrs) { - scope.$watch( - function(scope) { - // watch the 'compile' expression for changes - return scope.$eval(attrs.compile); - }, - function(value) { - // when the 'compile' expression changes - // assign it into the current DOM - element.html(value); - - // compile the new DOM and link it to the current - // scope. - // NOTE: we only compile .childNodes so that - // we don't get into infinite loop compiling ourselves - $compile(element.contents())(scope); - } - ); - }; - }); - }) - .controller('GreeterController', ['$scope', function($scope) { - $scope.name = 'AngularJS'; - $scope.html = 'Hello {{name}}'; - }]); - </script> - <div ng-controller="GreeterController"> - <input ng-model="name"> <br/> - <textarea ng-model="html"></textarea> <br/> - <div compile="html"></div> - </div> - </file> - <file name="protractor.js" type="protractor"> - it('should auto compile', function() { - var textarea = $('textarea'); - var output = $('div[compile]'); - // The initial state reads 'Hello AngularJS'. - expect(output.getText()).toBe('Hello AngularJS'); - textarea.clear(); - textarea.sendKeys('{{name}}!'); - expect(output.getText()).toBe('AngularJS!'); - }); - </file> - </example> - - * - * - * @param {string|DOMElement} element Element or HTML string to compile into a template function. - * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED. - * - * <div class="alert alert-danger"> - * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it - * e.g. will not use the right outer scope. Please pass the transclude function as a - * `parentBoundTranscludeFn` to the link function instead. - * </div> - * - * @param {number} maxPriority only apply directives lower than given priority (Only effects the - * root element(s), not their children) - * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template - * (a DOM element/tree) to a scope. Where: - * - * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to. - * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the - * `template` and call the `cloneAttachFn` function allowing the caller to attach the - * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is - * called as: <br/> `cloneAttachFn(clonedElement, scope)` where: - * - * * `clonedElement` - is a clone of the original `element` passed into the compiler. - * * `scope` - is the current scope with which the linking function is working with. - * - * * `options` - An optional object hash with linking options. If `options` is provided, then the following - * keys may be used to control linking behavior: - * - * * `parentBoundTranscludeFn` - the transclude function made available to - * directives; if given, it will be passed through to the link functions of - * directives found in `element` during compilation. - * * `transcludeControllers` - an object hash with keys that map controller names - * to a hash with the key `instance`, which maps to the controller instance; - * if given, it will make the controllers available to directives on the compileNode: - * ``` - * { - * parent: { - * instance: parentControllerInstance - * } - * } - * ``` - * * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add - * the cloned elements; only needed for transcludes that are allowed to contain non html - * elements (e.g. SVG elements). See also the directive.controller property. - * - * Calling the linking function returns the element of the template. It is either the original - * element passed in, or the clone of the element if the `cloneAttachFn` is provided. - * - * After linking the view is not updated until after a call to $digest which typically is done by - * AngularJS automatically. - * - * If you need access to the bound view, there are two ways to do it: - * - * - If you are not asking the linking function to clone the template, create the DOM element(s) - * before you send them to the compiler and keep this reference around. - * ```js - * var element = $compile('<p>{{total}}</p>')(scope); - * ``` - * - * - if on the other hand, you need the element to be cloned, the view reference from the original - * example would not point to the clone, but rather to the original template that was cloned. In - * this case, you can access the clone via the cloneAttachFn: - * ```js - * var templateElement = angular.element('<p>{{total}}</p>'), - * scope = ....; - * - * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) { - * //attach the clone to DOM document at the right place - * }); - * - * //now we have reference to the cloned DOM via `clonedElement` - * ``` - * - * - * For information on how the compiler works, see the - * {@link guide/compiler AngularJS HTML Compiler} section of the Developer Guide. - * - * @knownIssue - * - * ### Double Compilation - * - Double compilation occurs when an already compiled part of the DOM gets - compiled again. This is an undesired effect and can lead to misbehaving directives, performance issues, - and memory leaks. Refer to the Compiler Guide {@link guide/compiler#double-compilation-and-how-to-avoid-it - section on double compilation} for an in-depth explanation and ways to avoid it. - * - */ - - var $compileMinErr = minErr('$compile'); - - function UNINITIALIZED_VALUE() {} - var _UNINITIALIZED_VALUE = new UNINITIALIZED_VALUE(); - - /** - * @ngdoc provider - * @name $compileProvider - * - * @description - */ - $CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider']; - /** @this */ - function $CompileProvider($provide, $$sanitizeUriProvider) { - var hasDirectives = {}, - Suffix = 'Directive', - COMMENT_DIRECTIVE_REGEXP = /^\s*directive:\s*([\w-]+)\s+(.*)$/, - CLASS_DIRECTIVE_REGEXP = /(([\w-]+)(?::([^;]+))?;?)/, - ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'), - REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/; - - // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes - // The assumption is that future DOM event attribute names will begin with - // 'on' and be composed of only English letters. - var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/; - var bindingCache = createMap(); - - function parseIsolateBindings(scope, directiveName, isController) { - var LOCAL_REGEXP = /^\s*([@&<]|=(\*?))(\??)\s*([\w$]*)\s*$/; - - var bindings = createMap(); - - forEach(scope, function(definition, scopeName) { - if (definition in bindingCache) { - bindings[scopeName] = bindingCache[definition]; - return; - } - var match = definition.match(LOCAL_REGEXP); - - if (!match) { - throw $compileMinErr('iscp', - 'Invalid {3} for directive \'{0}\'.' + - ' Definition: {... {1}: \'{2}\' ...}', - directiveName, scopeName, definition, - (isController ? 'controller bindings definition' : - 'isolate scope definition')); - } - - bindings[scopeName] = { - mode: match[1][0], - collection: match[2] === '*', - optional: match[3] === '?', - attrName: match[4] || scopeName - }; - if (match[4]) { - bindingCache[definition] = bindings[scopeName]; - } - }); - - return bindings; - } - - function parseDirectiveBindings(directive, directiveName) { - var bindings = { - isolateScope: null, - bindToController: null - }; - if (isObject(directive.scope)) { - if (directive.bindToController === true) { - bindings.bindToController = parseIsolateBindings(directive.scope, - directiveName, true); - bindings.isolateScope = {}; - } else { - bindings.isolateScope = parseIsolateBindings(directive.scope, - directiveName, false); - } - } - if (isObject(directive.bindToController)) { - bindings.bindToController = - parseIsolateBindings(directive.bindToController, directiveName, true); - } - if (bindings.bindToController && !directive.controller) { - // There is no controller - throw $compileMinErr('noctrl', - 'Cannot bind to controller without directive \'{0}\'s controller.', - directiveName); - } - return bindings; - } - - function assertValidDirectiveName(name) { - var letter = name.charAt(0); - if (!letter || letter !== lowercase(letter)) { - throw $compileMinErr('baddir', 'Directive/Component name \'{0}\' is invalid. The first character must be a lowercase letter', name); - } - if (name !== name.trim()) { - throw $compileMinErr('baddir', - 'Directive/Component name \'{0}\' is invalid. The name should not contain leading or trailing whitespaces', - name); - } - } - - function getDirectiveRequire(directive) { - var require = directive.require || (directive.controller && directive.name); - - if (!isArray(require) && isObject(require)) { - forEach(require, function(value, key) { - var match = value.match(REQUIRE_PREFIX_REGEXP); - var name = value.substring(match[0].length); - if (!name) require[key] = match[0] + key; - }); - } - - return require; - } - - function getDirectiveRestrict(restrict, name) { - if (restrict && !(isString(restrict) && /[EACM]/.test(restrict))) { - throw $compileMinErr('badrestrict', - 'Restrict property \'{0}\' of directive \'{1}\' is invalid', - restrict, - name); - } - - return restrict || 'EA'; - } - - /** - * @ngdoc method - * @name $compileProvider#directive - * @kind function - * - * @description - * Register a new directive with the compiler. - * - * @param {string|Object} name Name of the directive in camel-case (i.e. <code>ngBind</code> which - * will match as <code>ng-bind</code>), or an object map of directives where the keys are the - * names and the values are the factories. - * @param {Function|Array} directiveFactory An injectable directive factory function. See the - * {@link guide/directive directive guide} and the {@link $compile compile API} for more info. - * @returns {ng.$compileProvider} Self for chaining. - */ - this.directive = function registerDirective(name, directiveFactory) { - assertArg(name, 'name'); - assertNotHasOwnProperty(name, 'directive'); - if (isString(name)) { - assertValidDirectiveName(name); - assertArg(directiveFactory, 'directiveFactory'); - if (!hasDirectives.hasOwnProperty(name)) { - hasDirectives[name] = []; - $provide.factory(name + Suffix, ['$injector', '$exceptionHandler', - function($injector, $exceptionHandler) { - var directives = []; - forEach(hasDirectives[name], function(directiveFactory, index) { - try { - var directive = $injector.invoke(directiveFactory); - if (isFunction(directive)) { - directive = { compile: valueFn(directive) }; - } else if (!directive.compile && directive.link) { - directive.compile = valueFn(directive.link); - } - directive.priority = directive.priority || 0; - directive.index = index; - directive.name = directive.name || name; - directive.require = getDirectiveRequire(directive); - directive.restrict = getDirectiveRestrict(directive.restrict, name); - directive.$$moduleName = directiveFactory.$$moduleName; - directives.push(directive); - } catch (e) { - $exceptionHandler(e); - } - }); - return directives; - }]); - } - hasDirectives[name].push(directiveFactory); - } else { - forEach(name, reverseParams(registerDirective)); - } - return this; - }; - - /** - * @ngdoc method - * @name $compileProvider#component - * @module ng - * @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match `<my-comp>`), - * or an object map of components where the keys are the names and the values are the component definition objects. - * @param {Object} options Component definition object (a simplified - * {@link ng.$compile#directive-definition-object directive definition object}), - * with the following properties (all optional): - * - * - `controller` – `{(string|function()=}` – controller constructor function that should be - * associated with newly created scope or the name of a {@link ng.$compile#-controller- - * registered controller} if passed as a string. An empty `noop` function by default. - * - `controllerAs` – `{string=}` – identifier name for to reference the controller in the component's scope. - * If present, the controller will be published to scope under the `controllerAs` name. - * If not present, this will default to be `$ctrl`. - * - `template` – `{string=|function()=}` – html template as a string or a function that - * returns an html template as a string which should be used as the contents of this component. - * Empty string by default. - * - * If `template` is a function, then it is {@link auto.$injector#invoke injected} with - * the following locals: - * - * - `$element` - Current element - * - `$attrs` - Current attributes object for the element - * - * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html - * template that should be used as the contents of this component. - * - * If `templateUrl` is a function, then it is {@link auto.$injector#invoke injected} with - * the following locals: - * - * - `$element` - Current element - * - `$attrs` - Current attributes object for the element - * - * - `bindings` – `{object=}` – defines bindings between DOM attributes and component properties. - * Component properties are always bound to the component controller and not to the scope. - * See {@link ng.$compile#-bindtocontroller- `bindToController`}. - * - `transclude` – `{boolean=}` – whether {@link $compile#transclusion content transclusion} is enabled. - * Disabled by default. - * - `require` - `{Object<string, string>=}` - requires the controllers of other directives and binds them to - * this component's controller. The object keys specify the property names under which the required - * controllers (object values) will be bound. See {@link ng.$compile#-require- `require`}. - * - `$...` – additional properties to attach to the directive factory function and the controller - * constructor function. (This is used by the component router to annotate) - * - * @returns {ng.$compileProvider} the compile provider itself, for chaining of function calls. - * @description - * Register a **component definition** with the compiler. This is a shorthand for registering a special - * type of directive, which represents a self-contained UI component in your application. Such components - * are always isolated (i.e. `scope: {}`) and are always restricted to elements (i.e. `restrict: 'E'`). - * - * Component definitions are very simple and do not require as much configuration as defining general - * directives. Component definitions usually consist only of a template and a controller backing it. - * - * In order to make the definition easier, components enforce best practices like use of `controllerAs`, - * `bindToController`. They always have **isolate scope** and are restricted to elements. - * - * Here are a few examples of how you would usually define components: - * - * ```js - * var myMod = angular.module(...); - * myMod.component('myComp', { - * template: '<div>My name is {{$ctrl.name}}</div>', - * controller: function() { - * this.name = 'shahar'; - * } - * }); - * - * myMod.component('myComp', { - * template: '<div>My name is {{$ctrl.name}}</div>', - * bindings: {name: '@'} - * }); - * - * myMod.component('myComp', { - * templateUrl: 'views/my-comp.html', - * controller: 'MyCtrl', - * controllerAs: 'ctrl', - * bindings: {name: '@'} - * }); - * - * ``` - * For more examples, and an in-depth guide, see the {@link guide/component component guide}. - * - * <br /> - * See also {@link ng.$compileProvider#directive $compileProvider.directive()}. - */ - this.component = function registerComponent(name, options) { - if (!isString(name)) { - forEach(name, reverseParams(bind(this, registerComponent))); - return this; - } - - var controller = options.controller || function() {}; - - function factory($injector) { - function makeInjectable(fn) { - if (isFunction(fn) || isArray(fn)) { - return /** @this */ function(tElement, tAttrs) { - return $injector.invoke(fn, this, {$element: tElement, $attrs: tAttrs}); - }; - } else { - return fn; - } - } - - var template = (!options.template && !options.templateUrl ? '' : options.template); - var ddo = { - controller: controller, - controllerAs: identifierForController(options.controller) || options.controllerAs || '$ctrl', - template: makeInjectable(template), - templateUrl: makeInjectable(options.templateUrl), - transclude: options.transclude, - scope: {}, - bindToController: options.bindings || {}, - restrict: 'E', - require: options.require - }; - - // Copy annotations (starting with $) over to the DDO - forEach(options, function(val, key) { - if (key.charAt(0) === '$') ddo[key] = val; - }); - - return ddo; - } - - // TODO(pete) remove the following `forEach` before we release 1.6.0 - // The component-router@0.2.0 looks for the annotations on the controller constructor - // Nothing in AngularJS looks for annotations on the factory function but we can't remove - // it from 1.5.x yet. - - // Copy any annotation properties (starting with $) over to the factory and controller constructor functions - // These could be used by libraries such as the new component router - forEach(options, function(val, key) { - if (key.charAt(0) === '$') { - factory[key] = val; - // Don't try to copy over annotations to named controller - if (isFunction(controller)) controller[key] = val; - } - }); - - factory.$inject = ['$injector']; - - return this.directive(name, factory); - }; - - - /** - * @ngdoc method - * @name $compileProvider#aHrefSanitizationWhitelist - * @kind function - * - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during a[href] sanitization. - * - * The sanitization is a security measure aimed at preventing XSS attacks via html links. - * - * Any url about to be assigned to a[href] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.aHrefSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp); - return this; - } else { - return $$sanitizeUriProvider.aHrefSanitizationWhitelist(); - } - }; - - - /** - * @ngdoc method - * @name $compileProvider#imgSrcSanitizationWhitelist - * @kind function - * - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during img[src] sanitization. - * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. - * - * Any url about to be assigned to img[src] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.imgSrcSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp); - return this; - } else { - return $$sanitizeUriProvider.imgSrcSanitizationWhitelist(); - } - }; - - /** - * @ngdoc method - * @name $compileProvider#debugInfoEnabled - * - * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the - * current debugInfoEnabled state - * @returns {*} current value if used as getter or itself (chaining) if used as setter - * - * @kind function - * - * @description - * Call this method to enable/disable various debug runtime information in the compiler such as adding - * binding information and a reference to the current scope on to DOM elements. - * If enabled, the compiler will add the following to DOM elements that have been bound to the scope - * * `ng-binding` CSS class - * * `ng-scope` and `ng-isolated-scope` CSS classes - * * `$binding` data property containing an array of the binding expressions - * * Data properties used by the {@link angular.element#methods `scope()`/`isolateScope()` methods} to return - * the element's scope. - * * Placeholder comments will contain information about what directive and binding caused the placeholder. - * E.g. `<!-- ngIf: shouldShow() -->`. - * - * You may want to disable this in production for a significant performance boost. See - * {@link guide/production#disabling-debug-data Disabling Debug Data} for more. - * - * The default value is true. - */ - var debugInfoEnabled = true; - this.debugInfoEnabled = function(enabled) { - if (isDefined(enabled)) { - debugInfoEnabled = enabled; - return this; - } - return debugInfoEnabled; - }; - - /** - * @ngdoc method - * @name $compileProvider#preAssignBindingsEnabled - * - * @param {boolean=} enabled update the preAssignBindingsEnabled state if provided, otherwise just return the - * current preAssignBindingsEnabled state - * @returns {*} current value if used as getter or itself (chaining) if used as setter - * - * @kind function - * - * @description - * Call this method to enable/disable whether directive controllers are assigned bindings before - * calling the controller's constructor. - * If enabled (true), the compiler assigns the value of each of the bindings to the - * properties of the controller object before the constructor of this object is called. - * - * If disabled (false), the compiler calls the constructor first before assigning bindings. - * - * The default value is false. - * - * @deprecated - * sinceVersion="1.6.0" - * removeVersion="1.7.0" - * - * This method and the option to assign the bindings before calling the controller's constructor - * will be removed in v1.7.0. - */ - var preAssignBindingsEnabled = false; - this.preAssignBindingsEnabled = function(enabled) { - if (isDefined(enabled)) { - preAssignBindingsEnabled = enabled; - return this; - } - return preAssignBindingsEnabled; - }; - - /** - * @ngdoc method - * @name $compileProvider#strictComponentBindingsEnabled - * - * @param {boolean=} enabled update the strictComponentBindingsEnabled state if provided, otherwise just return the - * current strictComponentBindingsEnabled state - * @returns {*} current value if used as getter or itself (chaining) if used as setter - * - * @kind function - * - * @description - * Call this method to enable/disable strict component bindings check. If enabled, the compiler will enforce that - * for all bindings of a component that are not set as optional with `?`, an attribute needs to be provided - * on the component's HTML tag. - * - * The default value is false. - */ - var strictComponentBindingsEnabled = false; - this.strictComponentBindingsEnabled = function(enabled) { - if (isDefined(enabled)) { - strictComponentBindingsEnabled = enabled; - return this; - } - return strictComponentBindingsEnabled; - }; - - var TTL = 10; - /** - * @ngdoc method - * @name $compileProvider#onChangesTtl - * @description - * - * Sets the number of times `$onChanges` hooks can trigger new changes before giving up and - * assuming that the model is unstable. - * - * The current default is 10 iterations. - * - * In complex applications it's possible that dependencies between `$onChanges` hooks and bindings will result - * in several iterations of calls to these hooks. However if an application needs more than the default 10 - * iterations to stabilize then you should investigate what is causing the model to continuously change during - * the `$onChanges` hook execution. - * - * Increasing the TTL could have performance implications, so you should not change it without proper justification. - * - * @param {number} limit The number of `$onChanges` hook iterations. - * @returns {number|object} the current limit (or `this` if called as a setter for chaining) - */ - this.onChangesTtl = function(value) { - if (arguments.length) { - TTL = value; - return this; - } - return TTL; - }; - - var commentDirectivesEnabledConfig = true; - /** - * @ngdoc method - * @name $compileProvider#commentDirectivesEnabled - * @description - * - * It indicates to the compiler - * whether or not directives on comments should be compiled. - * Defaults to `true`. - * - * Calling this function with false disables the compilation of directives - * on comments for the whole application. - * This results in a compilation performance gain, - * as the compiler doesn't have to check comments when looking for directives. - * This should however only be used if you are sure that no comment directives are used in - * the application (including any 3rd party directives). - * - * @param {boolean} enabled `false` if the compiler may ignore directives on comments - * @returns {boolean|object} the current value (or `this` if called as a setter for chaining) - */ - this.commentDirectivesEnabled = function(value) { - if (arguments.length) { - commentDirectivesEnabledConfig = value; - return this; - } - return commentDirectivesEnabledConfig; - }; - - - var cssClassDirectivesEnabledConfig = true; - /** - * @ngdoc method - * @name $compileProvider#cssClassDirectivesEnabled - * @description - * - * It indicates to the compiler - * whether or not directives on element classes should be compiled. - * Defaults to `true`. - * - * Calling this function with false disables the compilation of directives - * on element classes for the whole application. - * This results in a compilation performance gain, - * as the compiler doesn't have to check element classes when looking for directives. - * This should however only be used if you are sure that no class directives are used in - * the application (including any 3rd party directives). - * - * @param {boolean} enabled `false` if the compiler may ignore directives on element classes - * @returns {boolean|object} the current value (or `this` if called as a setter for chaining) - */ - this.cssClassDirectivesEnabled = function(value) { - if (arguments.length) { - cssClassDirectivesEnabledConfig = value; - return this; - } - return cssClassDirectivesEnabledConfig; - }; - - this.$get = [ - '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse', - '$controller', '$rootScope', '$sce', '$animate', '$$sanitizeUri', - function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse, - $controller, $rootScope, $sce, $animate, $$sanitizeUri) { - - var SIMPLE_ATTR_NAME = /^\w/; - var specialAttrHolder = window.document.createElement('div'); - - - var commentDirectivesEnabled = commentDirectivesEnabledConfig; - var cssClassDirectivesEnabled = cssClassDirectivesEnabledConfig; - - - var onChangesTtl = TTL; - // The onChanges hooks should all be run together in a single digest - // When changes occur, the call to trigger their hooks will be added to this queue - var onChangesQueue; - - // This function is called in a $$postDigest to trigger all the onChanges hooks in a single digest - function flushOnChangesQueue() { - try { - if (!(--onChangesTtl)) { - // We have hit the TTL limit so reset everything - onChangesQueue = undefined; - throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\n', TTL); - } - // We must run this hook in an apply since the $$postDigest runs outside apply - $rootScope.$apply(function() { - var errors = []; - for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) { - try { - onChangesQueue[i](); - } catch (e) { - errors.push(e); - } - } - // Reset the queue to trigger a new schedule next time there is a change - onChangesQueue = undefined; - if (errors.length) { - throw errors; - } - }); - } finally { - onChangesTtl++; - } - } - - - function Attributes(element, attributesToCopy) { - if (attributesToCopy) { - var keys = Object.keys(attributesToCopy); - var i, l, key; - - for (i = 0, l = keys.length; i < l; i++) { - key = keys[i]; - this[key] = attributesToCopy[key]; - } - } else { - this.$attr = {}; - } - - this.$$element = element; - } - - Attributes.prototype = { - /** - * @ngdoc method - * @name $compile.directive.Attributes#$normalize - * @kind function - * - * @description - * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or - * `data-`) to its normalized, camelCase form. - * - * Also there is special case for Moz prefix starting with upper case letter. - * - * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives} - * - * @param {string} name Name to normalize - */ - $normalize: directiveNormalize, - - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$addClass - * @kind function - * - * @description - * Adds the CSS class value specified by the classVal parameter to the element. If animations - * are enabled then an animation will be triggered for the class addition. - * - * @param {string} classVal The className value that will be added to the element - */ - $addClass: function(classVal) { - if (classVal && classVal.length > 0) { - $animate.addClass(this.$$element, classVal); - } - }, - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$removeClass - * @kind function - * - * @description - * Removes the CSS class value specified by the classVal parameter from the element. If - * animations are enabled then an animation will be triggered for the class removal. - * - * @param {string} classVal The className value that will be removed from the element - */ - $removeClass: function(classVal) { - if (classVal && classVal.length > 0) { - $animate.removeClass(this.$$element, classVal); - } - }, - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$updateClass - * @kind function - * - * @description - * Adds and removes the appropriate CSS class values to the element based on the difference - * between the new and old CSS class values (specified as newClasses and oldClasses). - * - * @param {string} newClasses The current CSS className value - * @param {string} oldClasses The former CSS className value - */ - $updateClass: function(newClasses, oldClasses) { - var toAdd = tokenDifference(newClasses, oldClasses); - if (toAdd && toAdd.length) { - $animate.addClass(this.$$element, toAdd); - } - - var toRemove = tokenDifference(oldClasses, newClasses); - if (toRemove && toRemove.length) { - $animate.removeClass(this.$$element, toRemove); - } - }, - - /** - * Set a normalized attribute on the element in a way such that all directives - * can share the attribute. This function properly handles boolean attributes. - * @param {string} key Normalized key. (ie ngAttribute) - * @param {string|boolean} value The value to set. If `null` attribute will be deleted. - * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute. - * Defaults to true. - * @param {string=} attrName Optional none normalized name. Defaults to key. - */ - $set: function(key, value, writeAttr, attrName) { - // TODO: decide whether or not to throw an error if "class" - //is set through this function since it may cause $updateClass to - //become unstable. - - var node = this.$$element[0], - booleanKey = getBooleanAttrName(node, key), - aliasedKey = getAliasedAttrName(key), - observer = key, - nodeName; - - if (booleanKey) { - this.$$element.prop(key, value); - attrName = booleanKey; - } else if (aliasedKey) { - this[aliasedKey] = value; - observer = aliasedKey; - } - - this[key] = value; - - // translate normalized key to actual key - if (attrName) { - this.$attr[key] = attrName; - } else { - attrName = this.$attr[key]; - if (!attrName) { - this.$attr[key] = attrName = snake_case(key, '-'); - } - } - - nodeName = nodeName_(this.$$element); - - if ((nodeName === 'a' && (key === 'href' || key === 'xlinkHref')) || - (nodeName === 'img' && key === 'src')) { - // sanitize a[href] and img[src] values - this[key] = value = $$sanitizeUri(value, key === 'src'); - } else if (nodeName === 'img' && key === 'srcset' && isDefined(value)) { - // sanitize img[srcset] values - var result = ''; - - // first check if there are spaces because it's not the same pattern - var trimmedSrcset = trim(value); - // ( 999x ,| 999w ,| ,|, ) - var srcPattern = /(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/; - var pattern = /\s/.test(trimmedSrcset) ? srcPattern : /(,)/; - - // split srcset into tuple of uri and descriptor except for the last item - var rawUris = trimmedSrcset.split(pattern); - - // for each tuples - var nbrUrisWith2parts = Math.floor(rawUris.length / 2); - for (var i = 0; i < nbrUrisWith2parts; i++) { - var innerIdx = i * 2; - // sanitize the uri - result += $$sanitizeUri(trim(rawUris[innerIdx]), true); - // add the descriptor - result += (' ' + trim(rawUris[innerIdx + 1])); - } - - // split the last item into uri and descriptor - var lastTuple = trim(rawUris[i * 2]).split(/\s/); - - // sanitize the last uri - result += $$sanitizeUri(trim(lastTuple[0]), true); - - // and add the last descriptor if any - if (lastTuple.length === 2) { - result += (' ' + trim(lastTuple[1])); - } - this[key] = value = result; - } - - if (writeAttr !== false) { - if (value === null || isUndefined(value)) { - this.$$element.removeAttr(attrName); - } else { - if (SIMPLE_ATTR_NAME.test(attrName)) { - this.$$element.attr(attrName, value); - } else { - setSpecialAttr(this.$$element[0], attrName, value); - } - } - } - - // fire observers - var $$observers = this.$$observers; - if ($$observers) { - forEach($$observers[observer], function(fn) { - try { - fn(value); - } catch (e) { - $exceptionHandler(e); - } - }); - } - }, - - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$observe - * @kind function - * - * @description - * Observes an interpolated attribute. - * - * The observer function will be invoked once during the next `$digest` following - * compilation. The observer is then invoked whenever the interpolated value - * changes. - * - * @param {string} key Normalized key. (ie ngAttribute) . - * @param {function(interpolatedValue)} fn Function that will be called whenever - the interpolated value of the attribute changes. - * See the {@link guide/interpolation#how-text-and-attribute-bindings-work Interpolation - * guide} for more info. - * @returns {function()} Returns a deregistration function for this observer. - */ - $observe: function(key, fn) { - var attrs = this, - $$observers = (attrs.$$observers || (attrs.$$observers = createMap())), - listeners = ($$observers[key] || ($$observers[key] = [])); - - listeners.push(fn); - $rootScope.$evalAsync(function() { - if (!listeners.$$inter && attrs.hasOwnProperty(key) && !isUndefined(attrs[key])) { - // no one registered attribute interpolation function, so lets call it manually - fn(attrs[key]); - } - }); - - return function() { - arrayRemove(listeners, fn); - }; - } - }; - - function setSpecialAttr(element, attrName, value) { - // Attributes names that do not start with letters (such as `(click)`) cannot be set using `setAttribute` - // so we have to jump through some hoops to get such an attribute - // https://github.com/angular/angular.js/pull/13318 - specialAttrHolder.innerHTML = '<span ' + attrName + '>'; - var attributes = specialAttrHolder.firstChild.attributes; - var attribute = attributes[0]; - // We have to remove the attribute from its container element before we can add it to the destination element - attributes.removeNamedItem(attribute.name); - attribute.value = value; - element.attributes.setNamedItem(attribute); - } - - function safeAddClass($element, className) { - try { - $element.addClass(className); - } catch (e) { - // ignore, since it means that we are trying to set class on - // SVG element, where class name is read-only. - } - } - - - var startSymbol = $interpolate.startSymbol(), - endSymbol = $interpolate.endSymbol(), - denormalizeTemplate = (startSymbol === '{{' && endSymbol === '}}') - ? identity - : function denormalizeTemplate(template) { - return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol); - }, - NG_ATTR_BINDING = /^ngAttr[A-Z]/; - var MULTI_ELEMENT_DIR_RE = /^(.+)Start$/; - - compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) { - var bindings = $element.data('$binding') || []; - - if (isArray(binding)) { - bindings = bindings.concat(binding); - } else { - bindings.push(binding); - } - - $element.data('$binding', bindings); - } : noop; - - compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) { - safeAddClass($element, 'ng-binding'); - } : noop; - - compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) { - var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope'; - $element.data(dataName, scope); - } : noop; - - compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) { - safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope'); - } : noop; - - compile.$$createComment = function(directiveName, comment) { - var content = ''; - if (debugInfoEnabled) { - content = ' ' + (directiveName || '') + ': '; - if (comment) content += comment + ' '; - } - return window.document.createComment(content); - }; - - return compile; - - //================================ - - function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, - previousCompileContext) { - if (!($compileNodes instanceof jqLite)) { - // jquery always rewraps, whereas we need to preserve the original selector so that we can - // modify it. - $compileNodes = jqLite($compileNodes); - } - var compositeLinkFn = - compileNodes($compileNodes, transcludeFn, $compileNodes, - maxPriority, ignoreDirective, previousCompileContext); - compile.$$addScopeClass($compileNodes); - var namespace = null; - return function publicLinkFn(scope, cloneConnectFn, options) { - if (!$compileNodes) { - throw $compileMinErr('multilink', 'This element has already been linked.'); - } - assertArg(scope, 'scope'); - - if (previousCompileContext && previousCompileContext.needsNewScope) { - // A parent directive did a replace and a directive on this element asked - // for transclusion, which caused us to lose a layer of element on which - // we could hold the new transclusion scope, so we will create it manually - // here. - scope = scope.$parent.$new(); - } - - options = options || {}; - var parentBoundTranscludeFn = options.parentBoundTranscludeFn, - transcludeControllers = options.transcludeControllers, - futureParentElement = options.futureParentElement; - - // When `parentBoundTranscludeFn` is passed, it is a - // `controllersBoundTransclude` function (it was previously passed - // as `transclude` to directive.link) so we must unwrap it to get - // its `boundTranscludeFn` - if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) { - parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude; - } - - if (!namespace) { - namespace = detectNamespaceForChildElements(futureParentElement); - } - var $linkNode; - if (namespace !== 'html') { - // When using a directive with replace:true and templateUrl the $compileNodes - // (or a child element inside of them) - // might change, so we need to recreate the namespace adapted compileNodes - // for call to the link function. - // Note: This will already clone the nodes... - $linkNode = jqLite( - wrapTemplate(namespace, jqLite('<div>').append($compileNodes).html()) - ); - } else if (cloneConnectFn) { - // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart - // and sometimes changes the structure of the DOM. - $linkNode = JQLitePrototype.clone.call($compileNodes); - } else { - $linkNode = $compileNodes; - } - - if (transcludeControllers) { - for (var controllerName in transcludeControllers) { - $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance); - } - } - - compile.$$addScopeInfo($linkNode, scope); - - if (cloneConnectFn) cloneConnectFn($linkNode, scope); - if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn); - - if (!cloneConnectFn) { - $compileNodes = compositeLinkFn = null; - } - return $linkNode; - }; - } - - function detectNamespaceForChildElements(parentElement) { - // TODO: Make this detect MathML as well... - var node = parentElement && parentElement[0]; - if (!node) { - return 'html'; - } else { - return nodeName_(node) !== 'foreignobject' && toString.call(node).match(/SVG/) ? 'svg' : 'html'; - } - } - - /** - * Compile function matches each node in nodeList against the directives. Once all directives - * for a particular node are collected their compile functions are executed. The compile - * functions return values - the linking functions - are combined into a composite linking - * function, which is the a linking function for the node. - * - * @param {NodeList} nodeList an array of nodes or NodeList to compile - * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the - * scope argument is auto-generated to the new child of the transcluded parent scope. - * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then - * the rootElement must be set the jqLite collection of the compile root. This is - * needed so that the jqLite collection items can be replaced with widgets. - * @param {number=} maxPriority Max directive priority. - * @returns {Function} A composite linking function of all of the matched directives or null. - */ - function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective, - previousCompileContext) { - var linkFns = [], - // `nodeList` can be either an element's `.childNodes` (live NodeList) - // or a jqLite/jQuery collection or an array - notLiveList = isArray(nodeList) || (nodeList instanceof jqLite), - attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; - - - for (var i = 0; i < nodeList.length; i++) { - attrs = new Attributes(); - - // Support: IE 11 only - // Workaround for #11781 and #14924 - if (msie === 11) { - mergeConsecutiveTextNodes(nodeList, i, notLiveList); - } - - // We must always refer to `nodeList[i]` hereafter, - // since the nodes can be replaced underneath us. - directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined, - ignoreDirective); - - nodeLinkFn = (directives.length) - ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, - null, [], [], previousCompileContext) - : null; - - if (nodeLinkFn && nodeLinkFn.scope) { - compile.$$addScopeClass(attrs.$$element); - } - - childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || - !(childNodes = nodeList[i].childNodes) || - !childNodes.length) - ? null - : compileNodes(childNodes, - nodeLinkFn ? ( - (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement) - && nodeLinkFn.transclude) : transcludeFn); - - if (nodeLinkFn || childLinkFn) { - linkFns.push(i, nodeLinkFn, childLinkFn); - linkFnFound = true; - nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn; - } - - //use the previous context only for the first element in the virtual group - previousCompileContext = null; - } - - // return a linking function if we have found anything, null otherwise - return linkFnFound ? compositeLinkFn : null; - - function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) { - var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn; - var stableNodeList; - - - if (nodeLinkFnFound) { - // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our - // offsets don't get screwed up - var nodeListLength = nodeList.length; - stableNodeList = new Array(nodeListLength); - - // create a sparse array by only copying the elements which have a linkFn - for (i = 0; i < linkFns.length; i += 3) { - idx = linkFns[i]; - stableNodeList[idx] = nodeList[idx]; - } - } else { - stableNodeList = nodeList; - } - - for (i = 0, ii = linkFns.length; i < ii;) { - node = stableNodeList[linkFns[i++]]; - nodeLinkFn = linkFns[i++]; - childLinkFn = linkFns[i++]; - - if (nodeLinkFn) { - if (nodeLinkFn.scope) { - childScope = scope.$new(); - compile.$$addScopeInfo(jqLite(node), childScope); - } else { - childScope = scope; - } - - if (nodeLinkFn.transcludeOnThisElement) { - childBoundTranscludeFn = createBoundTranscludeFn( - scope, nodeLinkFn.transclude, parentBoundTranscludeFn); - - } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) { - childBoundTranscludeFn = parentBoundTranscludeFn; - - } else if (!parentBoundTranscludeFn && transcludeFn) { - childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn); - - } else { - childBoundTranscludeFn = null; - } - - nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn); - - } else if (childLinkFn) { - childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn); - } - } - } - } - - function mergeConsecutiveTextNodes(nodeList, idx, notLiveList) { - var node = nodeList[idx]; - var parent = node.parentNode; - var sibling; - - if (node.nodeType !== NODE_TYPE_TEXT) { - return; - } - - while (true) { - sibling = parent ? node.nextSibling : nodeList[idx + 1]; - if (!sibling || sibling.nodeType !== NODE_TYPE_TEXT) { - break; - } - - node.nodeValue = node.nodeValue + sibling.nodeValue; - - if (sibling.parentNode) { - sibling.parentNode.removeChild(sibling); - } - if (notLiveList && sibling === nodeList[idx + 1]) { - nodeList.splice(idx + 1, 1); - } - } - } - - function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) { - function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) { - - if (!transcludedScope) { - transcludedScope = scope.$new(false, containingScope); - transcludedScope.$$transcluded = true; - } - - return transcludeFn(transcludedScope, cloneFn, { - parentBoundTranscludeFn: previousBoundTranscludeFn, - transcludeControllers: controllers, - futureParentElement: futureParentElement - }); - } - - // We need to attach the transclusion slots onto the `boundTranscludeFn` - // so that they are available inside the `controllersBoundTransclude` function - var boundSlots = boundTranscludeFn.$$slots = createMap(); - for (var slotName in transcludeFn.$$slots) { - if (transcludeFn.$$slots[slotName]) { - boundSlots[slotName] = createBoundTranscludeFn(scope, transcludeFn.$$slots[slotName], previousBoundTranscludeFn); - } else { - boundSlots[slotName] = null; - } - } - - return boundTranscludeFn; - } - - /** - * Looks for directives on the given node and adds them to the directive collection which is - * sorted. - * - * @param node Node to search. - * @param directives An array to which the directives are added to. This array is sorted before - * the function returns. - * @param attrs The shared attrs object which is used to populate the normalized attributes. - * @param {number=} maxPriority Max directive priority. - */ - function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) { - var nodeType = node.nodeType, - attrsMap = attrs.$attr, - match, - nodeName, - className; - - switch (nodeType) { - case NODE_TYPE_ELEMENT: /* Element */ - - nodeName = nodeName_(node); - - // use the node name: <directive> - addDirective(directives, - directiveNormalize(nodeName), 'E', maxPriority, ignoreDirective); - - // iterate over the attributes - for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes, - j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) { - var attrStartName = false; - var attrEndName = false; - - attr = nAttrs[j]; - name = attr.name; - value = attr.value; - - // support ngAttr attribute binding - ngAttrName = directiveNormalize(name); - isNgAttr = NG_ATTR_BINDING.test(ngAttrName); - if (isNgAttr) { - name = name.replace(PREFIX_REGEXP, '') - .substr(8).replace(/_(.)/g, function(match, letter) { - return letter.toUpperCase(); - }); - } - - var multiElementMatch = ngAttrName.match(MULTI_ELEMENT_DIR_RE); - if (multiElementMatch && directiveIsMultiElement(multiElementMatch[1])) { - attrStartName = name; - attrEndName = name.substr(0, name.length - 5) + 'end'; - name = name.substr(0, name.length - 6); - } - - nName = directiveNormalize(name.toLowerCase()); - attrsMap[nName] = name; - if (isNgAttr || !attrs.hasOwnProperty(nName)) { - attrs[nName] = value; - if (getBooleanAttrName(node, nName)) { - attrs[nName] = true; // presence means true - } - } - addAttrInterpolateDirective(node, directives, value, nName, isNgAttr); - addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, - attrEndName); - } - - if (nodeName === 'input' && node.getAttribute('type') === 'hidden') { - // Hidden input elements can have strange behaviour when navigating back to the page - // This tells the browser not to try to cache and reinstate previous values - node.setAttribute('autocomplete', 'off'); - } - - // use class as directive - if (!cssClassDirectivesEnabled) break; - className = node.className; - if (isObject(className)) { - // Maybe SVGAnimatedString - className = className.animVal; - } - if (isString(className) && className !== '') { - while ((match = CLASS_DIRECTIVE_REGEXP.exec(className))) { - nName = directiveNormalize(match[2]); - if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) { - attrs[nName] = trim(match[3]); - } - className = className.substr(match.index + match[0].length); - } - } - break; - case NODE_TYPE_TEXT: /* Text Node */ - addTextInterpolateDirective(directives, node.nodeValue); - break; - case NODE_TYPE_COMMENT: /* Comment */ - if (!commentDirectivesEnabled) break; - collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective); - break; - } - - directives.sort(byPriority); - return directives; - } - - function collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective) { - // function created because of performance, try/catch disables - // the optimization of the whole function #14848 - try { - var match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue); - if (match) { - var nName = directiveNormalize(match[1]); - if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) { - attrs[nName] = trim(match[2]); - } - } - } catch (e) { - // turns out that under some circumstances IE9 throws errors when one attempts to read - // comment's node value. - // Just ignore it and continue. (Can't seem to reproduce in test case.) - } - } - - /** - * Given a node with a directive-start it collects all of the siblings until it finds - * directive-end. - * @param node - * @param attrStart - * @param attrEnd - * @returns {*} - */ - function groupScan(node, attrStart, attrEnd) { - var nodes = []; - var depth = 0; - if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) { - do { - if (!node) { - throw $compileMinErr('uterdir', - 'Unterminated attribute, found \'{0}\' but no matching \'{1}\' found.', - attrStart, attrEnd); - } - if (node.nodeType === NODE_TYPE_ELEMENT) { - if (node.hasAttribute(attrStart)) depth++; - if (node.hasAttribute(attrEnd)) depth--; - } - nodes.push(node); - node = node.nextSibling; - } while (depth > 0); - } else { - nodes.push(node); - } - - return jqLite(nodes); - } - - /** - * Wrapper for linking function which converts normal linking function into a grouped - * linking function. - * @param linkFn - * @param attrStart - * @param attrEnd - * @returns {Function} - */ - function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) { - return function groupedElementsLink(scope, element, attrs, controllers, transcludeFn) { - element = groupScan(element[0], attrStart, attrEnd); - return linkFn(scope, element, attrs, controllers, transcludeFn); - }; - } - - /** - * A function generator that is used to support both eager and lazy compilation - * linking function. - * @param eager - * @param $compileNodes - * @param transcludeFn - * @param maxPriority - * @param ignoreDirective - * @param previousCompileContext - * @returns {Function} - */ - function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) { - var compiled; - - if (eager) { - return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); - } - return /** @this */ function lazyCompilation() { - if (!compiled) { - compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext); - - // Null out all of these references in order to make them eligible for garbage collection - // since this is a potentially long lived closure - $compileNodes = transcludeFn = previousCompileContext = null; - } - return compiled.apply(this, arguments); - }; - } - - /** - * Once the directives have been collected, their compile functions are executed. This method - * is responsible for inlining directive templates as well as terminating the application - * of the directives if the terminal directive has been reached. - * - * @param {Array} directives Array of collected directives to execute their compile function. - * this needs to be pre-sorted by priority order. - * @param {Node} compileNode The raw DOM node to apply the compile functions to - * @param {Object} templateAttrs The shared attribute function - * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the - * scope argument is auto-generated to the new - * child of the transcluded parent scope. - * @param {JQLite} jqCollection If we are working on the root of the compile tree then this - * argument has the root jqLite array so that we can replace nodes - * on it. - * @param {Object=} originalReplaceDirective An optional directive that will be ignored when - * compiling the transclusion. - * @param {Array.<Function>} preLinkFns - * @param {Array.<Function>} postLinkFns - * @param {Object} previousCompileContext Context used for previous compilation of the current - * node - * @returns {Function} linkFn - */ - function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, - jqCollection, originalReplaceDirective, preLinkFns, postLinkFns, - previousCompileContext) { - previousCompileContext = previousCompileContext || {}; - - var terminalPriority = -Number.MAX_VALUE, - newScopeDirective = previousCompileContext.newScopeDirective, - controllerDirectives = previousCompileContext.controllerDirectives, - newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective, - templateDirective = previousCompileContext.templateDirective, - nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective, - hasTranscludeDirective = false, - hasTemplate = false, - hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective, - $compileNode = templateAttrs.$$element = jqLite(compileNode), - directive, - directiveName, - $template, - replaceDirective = originalReplaceDirective, - childTranscludeFn = transcludeFn, - linkFn, - didScanForMultipleTransclusion = false, - mightHaveMultipleTransclusionError = false, - directiveValue; - - // executes all directives on the current element - for (var i = 0, ii = directives.length; i < ii; i++) { - directive = directives[i]; - var attrStart = directive.$$start; - var attrEnd = directive.$$end; - - // collect multiblock sections - if (attrStart) { - $compileNode = groupScan(compileNode, attrStart, attrEnd); - } - $template = undefined; - - if (terminalPriority > directive.priority) { - break; // prevent further processing of directives - } - - directiveValue = directive.scope; - - if (directiveValue) { - - // skip the check for directives with async templates, we'll check the derived sync - // directive when the template arrives - if (!directive.templateUrl) { - if (isObject(directiveValue)) { - // This directive is trying to add an isolated scope. - // Check that there is no scope of any kind already - assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective, - directive, $compileNode); - newIsolateScopeDirective = directive; - } else { - // This directive is trying to add a child scope. - // Check that there is no isolated scope already - assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive, - $compileNode); - } - } - - newScopeDirective = newScopeDirective || directive; - } - - directiveName = directive.name; - - // If we encounter a condition that can result in transclusion on the directive, - // then scan ahead in the remaining directives for others that may cause a multiple - // transclusion error to be thrown during the compilation process. If a matching directive - // is found, then we know that when we encounter a transcluded directive, we need to eagerly - // compile the `transclude` function rather than doing it lazily in order to throw - // exceptions at the correct time - if (!didScanForMultipleTransclusion && ((directive.replace && (directive.templateUrl || directive.template)) - || (directive.transclude && !directive.$$tlb))) { - var candidateDirective; - - for (var scanningIndex = i + 1; (candidateDirective = directives[scanningIndex++]);) { - if ((candidateDirective.transclude && !candidateDirective.$$tlb) - || (candidateDirective.replace && (candidateDirective.templateUrl || candidateDirective.template))) { - mightHaveMultipleTransclusionError = true; - break; - } - } - - didScanForMultipleTransclusion = true; - } - - if (!directive.templateUrl && directive.controller) { - controllerDirectives = controllerDirectives || createMap(); - assertNoDuplicate('\'' + directiveName + '\' controller', - controllerDirectives[directiveName], directive, $compileNode); - controllerDirectives[directiveName] = directive; - } - - directiveValue = directive.transclude; - - if (directiveValue) { - hasTranscludeDirective = true; - - // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion. - // This option should only be used by directives that know how to safely handle element transclusion, - // where the transcluded nodes are added or replaced after linking. - if (!directive.$$tlb) { - assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode); - nonTlbTranscludeDirective = directive; - } - - if (directiveValue === 'element') { - hasElementTranscludeDirective = true; - terminalPriority = directive.priority; - $template = $compileNode; - $compileNode = templateAttrs.$$element = - jqLite(compile.$$createComment(directiveName, templateAttrs[directiveName])); - compileNode = $compileNode[0]; - replaceWith(jqCollection, sliceArgs($template), compileNode); - - // Support: Chrome < 50 - // https://github.com/angular/angular.js/issues/14041 - - // In the versions of V8 prior to Chrome 50, the document fragment that is created - // in the `replaceWith` function is improperly garbage collected despite still - // being referenced by the `parentNode` property of all of the child nodes. By adding - // a reference to the fragment via a different property, we can avoid that incorrect - // behavior. - // TODO: remove this line after Chrome 50 has been released - $template[0].$$parentNode = $template[0].parentNode; - - childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, terminalPriority, - replaceDirective && replaceDirective.name, { - // Don't pass in: - // - controllerDirectives - otherwise we'll create duplicates controllers - // - newIsolateScopeDirective or templateDirective - combining templates with - // element transclusion doesn't make sense. - // - // We need only nonTlbTranscludeDirective so that we prevent putting transclusion - // on the same element more than once. - nonTlbTranscludeDirective: nonTlbTranscludeDirective - }); - } else { - - var slots = createMap(); - - if (!isObject(directiveValue)) { - $template = jqLite(jqLiteClone(compileNode)).contents(); - } else { - - // We have transclusion slots, - // collect them up, compile them and store their transclusion functions - $template = []; - - var slotMap = createMap(); - var filledSlots = createMap(); - - // Parse the element selectors - forEach(directiveValue, function(elementSelector, slotName) { - // If an element selector starts with a ? then it is optional - var optional = (elementSelector.charAt(0) === '?'); - elementSelector = optional ? elementSelector.substring(1) : elementSelector; - - slotMap[elementSelector] = slotName; - - // We explicitly assign `null` since this implies that a slot was defined but not filled. - // Later when calling boundTransclusion functions with a slot name we only error if the - // slot is `undefined` - slots[slotName] = null; - - // filledSlots contains `true` for all slots that are either optional or have been - // filled. This is used to check that we have not missed any required slots - filledSlots[slotName] = optional; - }); - - // Add the matching elements into their slot - forEach($compileNode.contents(), function(node) { - var slotName = slotMap[directiveNormalize(nodeName_(node))]; - if (slotName) { - filledSlots[slotName] = true; - slots[slotName] = slots[slotName] || []; - slots[slotName].push(node); - } else { - $template.push(node); - } - }); - - // Check for required slots that were not filled - forEach(filledSlots, function(filled, slotName) { - if (!filled) { - throw $compileMinErr('reqslot', 'Required transclusion slot `{0}` was not filled.', slotName); - } - }); - - for (var slotName in slots) { - if (slots[slotName]) { - // Only define a transclusion function if the slot was filled - slots[slotName] = compilationGenerator(mightHaveMultipleTransclusionError, slots[slotName], transcludeFn); - } - } - } - - $compileNode.empty(); // clear contents - childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, undefined, - undefined, { needsNewScope: directive.$$isolateScope || directive.$$newScope}); - childTranscludeFn.$$slots = slots; - } - } - - if (directive.template) { - hasTemplate = true; - assertNoDuplicate('template', templateDirective, directive, $compileNode); - templateDirective = directive; - - directiveValue = (isFunction(directive.template)) - ? directive.template($compileNode, templateAttrs) - : directive.template; - - directiveValue = denormalizeTemplate(directiveValue); - - if (directive.replace) { - replaceDirective = directive; - if (jqLiteIsTextNode(directiveValue)) { - $template = []; - } else { - $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue))); - } - compileNode = $template[0]; - - if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { - throw $compileMinErr('tplrt', - 'Template for directive \'{0}\' must have exactly one root element. {1}', - directiveName, ''); - } - - replaceWith(jqCollection, $compileNode, compileNode); - - var newTemplateAttrs = {$attr: {}}; - - // combine directives from the original node and from the template: - // - take the array of directives for this element - // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed) - // - collect directives from the template and sort them by priority - // - combine directives as: processed + template + unprocessed - var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs); - var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1)); - - if (newIsolateScopeDirective || newScopeDirective) { - // The original directive caused the current element to be replaced but this element - // also needs to have a new scope, so we need to tell the template directives - // that they would need to get their scope from further up, if they require transclusion - markDirectiveScope(templateDirectives, newIsolateScopeDirective, newScopeDirective); - } - directives = directives.concat(templateDirectives).concat(unprocessedDirectives); - mergeTemplateAttributes(templateAttrs, newTemplateAttrs); - - ii = directives.length; - } else { - $compileNode.html(directiveValue); - } - } - - if (directive.templateUrl) { - hasTemplate = true; - assertNoDuplicate('template', templateDirective, directive, $compileNode); - templateDirective = directive; - - if (directive.replace) { - replaceDirective = directive; - } - - // eslint-disable-next-line no-func-assign - nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode, - templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, { - controllerDirectives: controllerDirectives, - newScopeDirective: (newScopeDirective !== directive) && newScopeDirective, - newIsolateScopeDirective: newIsolateScopeDirective, - templateDirective: templateDirective, - nonTlbTranscludeDirective: nonTlbTranscludeDirective - }); - ii = directives.length; - } else if (directive.compile) { - try { - linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn); - var context = directive.$$originalDirective || directive; - if (isFunction(linkFn)) { - addLinkFns(null, bind(context, linkFn), attrStart, attrEnd); - } else if (linkFn) { - addLinkFns(bind(context, linkFn.pre), bind(context, linkFn.post), attrStart, attrEnd); - } - } catch (e) { - $exceptionHandler(e, startingTag($compileNode)); - } - } - - if (directive.terminal) { - nodeLinkFn.terminal = true; - terminalPriority = Math.max(terminalPriority, directive.priority); - } - - } - - nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true; - nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective; - nodeLinkFn.templateOnThisElement = hasTemplate; - nodeLinkFn.transclude = childTranscludeFn; - - previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective; - - // might be normal or delayed nodeLinkFn depending on if templateUrl is present - return nodeLinkFn; - - //////////////////// - - function addLinkFns(pre, post, attrStart, attrEnd) { - if (pre) { - if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd); - pre.require = directive.require; - pre.directiveName = directiveName; - if (newIsolateScopeDirective === directive || directive.$$isolateScope) { - pre = cloneAndAnnotateFn(pre, {isolateScope: true}); - } - preLinkFns.push(pre); - } - if (post) { - if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd); - post.require = directive.require; - post.directiveName = directiveName; - if (newIsolateScopeDirective === directive || directive.$$isolateScope) { - post = cloneAndAnnotateFn(post, {isolateScope: true}); - } - postLinkFns.push(post); - } - } - - function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) { - var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element, - attrs, scopeBindingInfo; - - if (compileNode === linkNode) { - attrs = templateAttrs; - $element = templateAttrs.$$element; - } else { - $element = jqLite(linkNode); - attrs = new Attributes($element, templateAttrs); - } - - controllerScope = scope; - if (newIsolateScopeDirective) { - isolateScope = scope.$new(true); - } else if (newScopeDirective) { - controllerScope = scope.$parent; - } - - if (boundTranscludeFn) { - // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` - // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` - transcludeFn = controllersBoundTransclude; - transcludeFn.$$boundTransclude = boundTranscludeFn; - // expose the slots on the `$transclude` function - transcludeFn.isSlotFilled = function(slotName) { - return !!boundTranscludeFn.$$slots[slotName]; - }; - } - - if (controllerDirectives) { - elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective); - } - - if (newIsolateScopeDirective) { - // Initialize isolate scope bindings for new isolate scope directive. - compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || - templateDirective === newIsolateScopeDirective.$$originalDirective))); - compile.$$addScopeClass($element, true); - isolateScope.$$isolateBindings = - newIsolateScopeDirective.$$isolateBindings; - scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope, - isolateScope.$$isolateBindings, - newIsolateScopeDirective); - if (scopeBindingInfo.removeWatches) { - isolateScope.$on('$destroy', scopeBindingInfo.removeWatches); - } - } - - // Initialize bindToController bindings - for (var name in elementControllers) { - var controllerDirective = controllerDirectives[name]; - var controller = elementControllers[name]; - var bindings = controllerDirective.$$bindings.bindToController; - - if (preAssignBindingsEnabled) { - if (bindings) { - controller.bindingInfo = - initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective); - } else { - controller.bindingInfo = {}; - } - - var controllerResult = controller(); - if (controllerResult !== controller.instance) { - // If the controller constructor has a return value, overwrite the instance - // from setupControllers - controller.instance = controllerResult; - $element.data('$' + controllerDirective.name + 'Controller', controllerResult); - if (controller.bindingInfo.removeWatches) { - controller.bindingInfo.removeWatches(); - } - controller.bindingInfo = - initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective); - } - } else { - controller.instance = controller(); - $element.data('$' + controllerDirective.name + 'Controller', controller.instance); - controller.bindingInfo = - initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective); - } - } - - // Bind the required controllers to the controller, if `require` is an object and `bindToController` is truthy - forEach(controllerDirectives, function(controllerDirective, name) { - var require = controllerDirective.require; - if (controllerDirective.bindToController && !isArray(require) && isObject(require)) { - extend(elementControllers[name].instance, getControllers(name, require, $element, elementControllers)); - } - }); - - // Handle the init and destroy lifecycle hooks on all controllers that have them - forEach(elementControllers, function(controller) { - var controllerInstance = controller.instance; - if (isFunction(controllerInstance.$onChanges)) { - try { - controllerInstance.$onChanges(controller.bindingInfo.initialChanges); - } catch (e) { - $exceptionHandler(e); - } - } - if (isFunction(controllerInstance.$onInit)) { - try { - controllerInstance.$onInit(); - } catch (e) { - $exceptionHandler(e); - } - } - if (isFunction(controllerInstance.$doCheck)) { - controllerScope.$watch(function() { controllerInstance.$doCheck(); }); - controllerInstance.$doCheck(); - } - if (isFunction(controllerInstance.$onDestroy)) { - controllerScope.$on('$destroy', function callOnDestroyHook() { - controllerInstance.$onDestroy(); - }); - } - }); - - // PRELINKING - for (i = 0, ii = preLinkFns.length; i < ii; i++) { - linkFn = preLinkFns[i]; - invokeLinkFn(linkFn, - linkFn.isolateScope ? isolateScope : scope, - $element, - attrs, - linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), - transcludeFn - ); - } - - // RECURSION - // We only pass the isolate scope, if the isolate directive has a template, - // otherwise the child elements do not belong to the isolate directive. - var scopeToChild = scope; - if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) { - scopeToChild = isolateScope; - } - if (childLinkFn) { - childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn); - } - - // POSTLINKING - for (i = postLinkFns.length - 1; i >= 0; i--) { - linkFn = postLinkFns[i]; - invokeLinkFn(linkFn, - linkFn.isolateScope ? isolateScope : scope, - $element, - attrs, - linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), - transcludeFn - ); - } - - // Trigger $postLink lifecycle hooks - forEach(elementControllers, function(controller) { - var controllerInstance = controller.instance; - if (isFunction(controllerInstance.$postLink)) { - controllerInstance.$postLink(); - } - }); - - // This is the function that is injected as `$transclude`. - // Note: all arguments are optional! - function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) { - var transcludeControllers; - // No scope passed in: - if (!isScope(scope)) { - slotName = futureParentElement; - futureParentElement = cloneAttachFn; - cloneAttachFn = scope; - scope = undefined; - } - - if (hasElementTranscludeDirective) { - transcludeControllers = elementControllers; - } - if (!futureParentElement) { - futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element; - } - if (slotName) { - // slotTranscludeFn can be one of three things: - // * a transclude function - a filled slot - // * `null` - an optional slot that was not filled - // * `undefined` - a slot that was not declared (i.e. invalid) - var slotTranscludeFn = boundTranscludeFn.$$slots[slotName]; - if (slotTranscludeFn) { - return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); - } else if (isUndefined(slotTranscludeFn)) { - throw $compileMinErr('noslot', - 'No parent directive that requires a transclusion with slot name "{0}". ' + - 'Element: {1}', - slotName, startingTag($element)); - } - } else { - return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); - } - } - } - } - - function getControllers(directiveName, require, $element, elementControllers) { - var value; - - if (isString(require)) { - var match = require.match(REQUIRE_PREFIX_REGEXP); - var name = require.substring(match[0].length); - var inheritType = match[1] || match[3]; - var optional = match[2] === '?'; - - //If only parents then start at the parent element - if (inheritType === '^^') { - $element = $element.parent(); - //Otherwise attempt getting the controller from elementControllers in case - //the element is transcluded (and has no data) and to avoid .data if possible - } else { - value = elementControllers && elementControllers[name]; - value = value && value.instance; - } - - if (!value) { - var dataName = '$' + name + 'Controller'; - value = inheritType ? $element.inheritedData(dataName) : $element.data(dataName); - } - - if (!value && !optional) { - throw $compileMinErr('ctreq', - 'Controller \'{0}\', required by directive \'{1}\', can\'t be found!', - name, directiveName); - } - } else if (isArray(require)) { - value = []; - for (var i = 0, ii = require.length; i < ii; i++) { - value[i] = getControllers(directiveName, require[i], $element, elementControllers); - } - } else if (isObject(require)) { - value = {}; - forEach(require, function(controller, property) { - value[property] = getControllers(directiveName, controller, $element, elementControllers); - }); - } - - return value || null; - } - - function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective) { - var elementControllers = createMap(); - for (var controllerKey in controllerDirectives) { - var directive = controllerDirectives[controllerKey]; - var locals = { - $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope, - $element: $element, - $attrs: attrs, - $transclude: transcludeFn - }; - - var controller = directive.controller; - if (controller === '@') { - controller = attrs[directive.name]; - } - - var controllerInstance = $controller(controller, locals, true, directive.controllerAs); - - // For directives with element transclusion the element is a comment. - // In this case .data will not attach any data. - // Instead, we save the controllers for the element in a local hash and attach to .data - // later, once we have the actual element. - elementControllers[directive.name] = controllerInstance; - $element.data('$' + directive.name + 'Controller', controllerInstance.instance); - } - return elementControllers; - } - - // Depending upon the context in which a directive finds itself it might need to have a new isolated - // or child scope created. For instance: - // * if the directive has been pulled into a template because another directive with a higher priority - // asked for element transclusion - // * if the directive itself asks for transclusion but it is at the root of a template and the original - // element was replaced. See https://github.com/angular/angular.js/issues/12936 - function markDirectiveScope(directives, isolateScope, newScope) { - for (var j = 0, jj = directives.length; j < jj; j++) { - directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope}); - } - } - - /** - * looks up the directive and decorates it with exception handling and proper parameters. We - * call this the boundDirective. - * - * @param {string} name name of the directive to look up. - * @param {string} location The directive must be found in specific format. - * String containing any of theses characters: - * - * * `E`: element name - * * `A': attribute - * * `C`: class - * * `M`: comment - * @returns {boolean} true if directive was added. - */ - function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, - endAttrName) { - if (name === ignoreDirective) return null; - var match = null; - if (hasDirectives.hasOwnProperty(name)) { - for (var directive, directives = $injector.get(name + Suffix), - i = 0, ii = directives.length; i < ii; i++) { - directive = directives[i]; - if ((isUndefined(maxPriority) || maxPriority > directive.priority) && - directive.restrict.indexOf(location) !== -1) { - if (startAttrName) { - directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); - } - if (!directive.$$bindings) { - var bindings = directive.$$bindings = - parseDirectiveBindings(directive, directive.name); - if (isObject(bindings.isolateScope)) { - directive.$$isolateBindings = bindings.isolateScope; - } - } - tDirectives.push(directive); - match = directive; - } - } - } - return match; - } - - - /** - * looks up the directive and returns true if it is a multi-element directive, - * and therefore requires DOM nodes between -start and -end markers to be grouped - * together. - * - * @param {string} name name of the directive to look up. - * @returns true if directive was registered as multi-element. - */ - function directiveIsMultiElement(name) { - if (hasDirectives.hasOwnProperty(name)) { - for (var directive, directives = $injector.get(name + Suffix), - i = 0, ii = directives.length; i < ii; i++) { - directive = directives[i]; - if (directive.multiElement) { - return true; - } - } - } - return false; - } - - /** - * When the element is replaced with HTML template then the new attributes - * on the template need to be merged with the existing attributes in the DOM. - * The desired effect is to have both of the attributes present. - * - * @param {object} dst destination attributes (original DOM) - * @param {object} src source attributes (from the directive template) - */ - function mergeTemplateAttributes(dst, src) { - var srcAttr = src.$attr, - dstAttr = dst.$attr; - - // reapply the old attributes to the new element - forEach(dst, function(value, key) { - if (key.charAt(0) !== '$') { - if (src[key] && src[key] !== value) { - if (value.length) { - value += (key === 'style' ? ';' : ' ') + src[key]; - } else { - value = src[key]; - } - } - dst.$set(key, value, true, srcAttr[key]); - } - }); - - // copy the new attributes on the old attrs object - forEach(src, function(value, key) { - // Check if we already set this attribute in the loop above. - // `dst` will never contain hasOwnProperty as DOM parser won't let it. - // You will get an "InvalidCharacterError: DOM Exception 5" error if you - // have an attribute like "has-own-property" or "data-has-own-property", etc. - if (!dst.hasOwnProperty(key) && key.charAt(0) !== '$') { - dst[key] = value; - - if (key !== 'class' && key !== 'style') { - dstAttr[key] = srcAttr[key]; - } - } - }); - } - - - function compileTemplateUrl(directives, $compileNode, tAttrs, - $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) { - var linkQueue = [], - afterTemplateNodeLinkFn, - afterTemplateChildLinkFn, - beforeTemplateCompileNode = $compileNode[0], - origAsyncDirective = directives.shift(), - derivedSyncDirective = inherit(origAsyncDirective, { - templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective - }), - templateUrl = (isFunction(origAsyncDirective.templateUrl)) - ? origAsyncDirective.templateUrl($compileNode, tAttrs) - : origAsyncDirective.templateUrl, - templateNamespace = origAsyncDirective.templateNamespace; - - $compileNode.empty(); - - $templateRequest(templateUrl) - .then(function(content) { - var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn; - - content = denormalizeTemplate(content); - - if (origAsyncDirective.replace) { - if (jqLiteIsTextNode(content)) { - $template = []; - } else { - $template = removeComments(wrapTemplate(templateNamespace, trim(content))); - } - compileNode = $template[0]; - - if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { - throw $compileMinErr('tplrt', - 'Template for directive \'{0}\' must have exactly one root element. {1}', - origAsyncDirective.name, templateUrl); - } - - tempTemplateAttrs = {$attr: {}}; - replaceWith($rootElement, $compileNode, compileNode); - var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs); - - if (isObject(origAsyncDirective.scope)) { - // the original directive that caused the template to be loaded async required - // an isolate scope - markDirectiveScope(templateDirectives, true); - } - directives = templateDirectives.concat(directives); - mergeTemplateAttributes(tAttrs, tempTemplateAttrs); - } else { - compileNode = beforeTemplateCompileNode; - $compileNode.html(content); - } - - directives.unshift(derivedSyncDirective); - - afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs, - childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns, - previousCompileContext); - forEach($rootElement, function(node, i) { - if (node === compileNode) { - $rootElement[i] = $compileNode[0]; - } - }); - afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn); - - while (linkQueue.length) { - var scope = linkQueue.shift(), - beforeTemplateLinkNode = linkQueue.shift(), - linkRootElement = linkQueue.shift(), - boundTranscludeFn = linkQueue.shift(), - linkNode = $compileNode[0]; - - if (scope.$$destroyed) continue; - - if (beforeTemplateLinkNode !== beforeTemplateCompileNode) { - var oldClasses = beforeTemplateLinkNode.className; - - if (!(previousCompileContext.hasElementTranscludeDirective && - origAsyncDirective.replace)) { - // it was cloned therefore we have to clone as well. - linkNode = jqLiteClone(compileNode); - } - replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode); - - // Copy in CSS classes from original node - safeAddClass(jqLite(linkNode), oldClasses); - } - if (afterTemplateNodeLinkFn.transcludeOnThisElement) { - childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); - } else { - childBoundTranscludeFn = boundTranscludeFn; - } - afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, - childBoundTranscludeFn); - } - linkQueue = null; - }).catch(function(error) { - if (isError(error)) { - $exceptionHandler(error); - } - }); - - return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) { - var childBoundTranscludeFn = boundTranscludeFn; - if (scope.$$destroyed) return; - if (linkQueue) { - linkQueue.push(scope, - node, - rootElement, - childBoundTranscludeFn); - } else { - if (afterTemplateNodeLinkFn.transcludeOnThisElement) { - childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); - } - afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn); - } - }; - } - - - /** - * Sorting function for bound directives. - */ - function byPriority(a, b) { - var diff = b.priority - a.priority; - if (diff !== 0) return diff; - if (a.name !== b.name) return (a.name < b.name) ? -1 : 1; - return a.index - b.index; - } - - function assertNoDuplicate(what, previousDirective, directive, element) { - - function wrapModuleNameIfDefined(moduleName) { - return moduleName ? - (' (module: ' + moduleName + ')') : - ''; - } - - if (previousDirective) { - throw $compileMinErr('multidir', 'Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}', - previousDirective.name, wrapModuleNameIfDefined(previousDirective.$$moduleName), - directive.name, wrapModuleNameIfDefined(directive.$$moduleName), what, startingTag(element)); - } - } - - - function addTextInterpolateDirective(directives, text) { - var interpolateFn = $interpolate(text, true); - if (interpolateFn) { - directives.push({ - priority: 0, - compile: function textInterpolateCompileFn(templateNode) { - var templateNodeParent = templateNode.parent(), - hasCompileParent = !!templateNodeParent.length; - - // When transcluding a template that has bindings in the root - // we don't have a parent and thus need to add the class during linking fn. - if (hasCompileParent) compile.$$addBindingClass(templateNodeParent); - - return function textInterpolateLinkFn(scope, node) { - var parent = node.parent(); - if (!hasCompileParent) compile.$$addBindingClass(parent); - compile.$$addBindingInfo(parent, interpolateFn.expressions); - scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { - node[0].nodeValue = value; - }); - }; - } - }); - } - } - - - function wrapTemplate(type, template) { - type = lowercase(type || 'html'); - switch (type) { - case 'svg': - case 'math': - var wrapper = window.document.createElement('div'); - wrapper.innerHTML = '<' + type + '>' + template + '</' + type + '>'; - return wrapper.childNodes[0].childNodes; - default: - return template; - } - } - - - function getTrustedContext(node, attrNormalizedName) { - if (attrNormalizedName === 'srcdoc') { - return $sce.HTML; - } - var tag = nodeName_(node); - // All tags with src attributes require a RESOURCE_URL value, except for - // img and various html5 media tags. - if (attrNormalizedName === 'src' || attrNormalizedName === 'ngSrc') { - if (['img', 'video', 'audio', 'source', 'track'].indexOf(tag) === -1) { - return $sce.RESOURCE_URL; - } - // maction[xlink:href] can source SVG. It's not limited to <maction>. - } else if (attrNormalizedName === 'xlinkHref' || - (tag === 'form' && attrNormalizedName === 'action') || - // links can be stylesheets or imports, which can run script in the current origin - (tag === 'link' && attrNormalizedName === 'href') - ) { - return $sce.RESOURCE_URL; - } - } - - - function addAttrInterpolateDirective(node, directives, value, name, isNgAttr) { - var trustedContext = getTrustedContext(node, name); - var mustHaveExpression = !isNgAttr; - var allOrNothing = ALL_OR_NOTHING_ATTRS[name] || isNgAttr; - - var interpolateFn = $interpolate(value, mustHaveExpression, trustedContext, allOrNothing); - - // no interpolation found -> ignore - if (!interpolateFn) return; - - if (name === 'multiple' && nodeName_(node) === 'select') { - throw $compileMinErr('selmulti', - 'Binding to the \'multiple\' attribute is not supported. Element: {0}', - startingTag(node)); - } - - if (EVENT_HANDLER_ATTR_REGEXP.test(name)) { - throw $compileMinErr('nodomevents', - 'Interpolations for HTML DOM event attributes are disallowed. Please use the ' + - 'ng- versions (such as ng-click instead of onclick) instead.'); - } - - directives.push({ - priority: 100, - compile: function() { - return { - pre: function attrInterpolatePreLinkFn(scope, element, attr) { - var $$observers = (attr.$$observers || (attr.$$observers = createMap())); - - // If the attribute has changed since last $interpolate()ed - var newValue = attr[name]; - if (newValue !== value) { - // we need to interpolate again since the attribute value has been updated - // (e.g. by another directive's compile function) - // ensure unset/empty values make interpolateFn falsy - interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing); - value = newValue; - } - - // if attribute was updated so that there is no interpolation going on we don't want to - // register any observers - if (!interpolateFn) return; - - // initialize attr object so that it's ready in case we need the value for isolate - // scope initialization, otherwise the value would not be available from isolate - // directive's linking fn during linking phase - attr[name] = interpolateFn(scope); - - ($$observers[name] || ($$observers[name] = [])).$$inter = true; - (attr.$$observers && attr.$$observers[name].$$scope || scope). - $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) { - //special case for class attribute addition + removal - //so that class changes can tap into the animation - //hooks provided by the $animate service. Be sure to - //skip animations when the first digest occurs (when - //both the new and the old values are the same) since - //the CSS classes are the non-interpolated values - if (name === 'class' && newValue !== oldValue) { - attr.$updateClass(newValue, oldValue); - } else { - attr.$set(name, newValue); - } - }); - } - }; - } - }); - } - - - /** - * This is a special jqLite.replaceWith, which can replace items which - * have no parents, provided that the containing jqLite collection is provided. - * - * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes - * in the root of the tree. - * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep - * the shell, but replace its DOM node reference. - * @param {Node} newNode The new DOM node. - */ - function replaceWith($rootElement, elementsToRemove, newNode) { - var firstElementToRemove = elementsToRemove[0], - removeCount = elementsToRemove.length, - parent = firstElementToRemove.parentNode, - i, ii; - - if ($rootElement) { - for (i = 0, ii = $rootElement.length; i < ii; i++) { - if ($rootElement[i] === firstElementToRemove) { - $rootElement[i++] = newNode; - for (var j = i, j2 = j + removeCount - 1, - jj = $rootElement.length; - j < jj; j++, j2++) { - if (j2 < jj) { - $rootElement[j] = $rootElement[j2]; - } else { - delete $rootElement[j]; - } - } - $rootElement.length -= removeCount - 1; - - // If the replaced element is also the jQuery .context then replace it - // .context is a deprecated jQuery api, so we should set it only when jQuery set it - // http://api.jquery.com/context/ - if ($rootElement.context === firstElementToRemove) { - $rootElement.context = newNode; - } - break; - } - } - } - - if (parent) { - parent.replaceChild(newNode, firstElementToRemove); - } - - // Append all the `elementsToRemove` to a fragment. This will... - // - remove them from the DOM - // - allow them to still be traversed with .nextSibling - // - allow a single fragment.qSA to fetch all elements being removed - var fragment = window.document.createDocumentFragment(); - for (i = 0; i < removeCount; i++) { - fragment.appendChild(elementsToRemove[i]); - } - - if (jqLite.hasData(firstElementToRemove)) { - // Copy over user data (that includes AngularJS's $scope etc.). Don't copy private - // data here because there's no public interface in jQuery to do that and copying over - // event listeners (which is the main use of private data) wouldn't work anyway. - jqLite.data(newNode, jqLite.data(firstElementToRemove)); - - // Remove $destroy event listeners from `firstElementToRemove` - jqLite(firstElementToRemove).off('$destroy'); - } - - // Cleanup any data/listeners on the elements and children. - // This includes invoking the $destroy event on any elements with listeners. - jqLite.cleanData(fragment.querySelectorAll('*')); - - // Update the jqLite collection to only contain the `newNode` - for (i = 1; i < removeCount; i++) { - delete elementsToRemove[i]; - } - elementsToRemove[0] = newNode; - elementsToRemove.length = 1; - } - - - function cloneAndAnnotateFn(fn, annotation) { - return extend(function() { return fn.apply(null, arguments); }, fn, annotation); - } - - - function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) { - try { - linkFn(scope, $element, attrs, controllers, transcludeFn); - } catch (e) { - $exceptionHandler(e, startingTag($element)); - } - } - - function strictBindingsCheck(attrName, directiveName) { - if (strictComponentBindingsEnabled) { - throw $compileMinErr('missingattr', - 'Attribute \'{0}\' of \'{1}\' is non-optional and must be set!', - attrName, directiveName); - } - } - - // Set up $watches for isolate scope and controller bindings. - function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) { - var removeWatchCollection = []; - var initialChanges = {}; - var changes; - - forEach(bindings, function initializeBinding(definition, scopeName) { - var attrName = definition.attrName, - optional = definition.optional, - mode = definition.mode, // @, =, <, or & - lastValue, - parentGet, parentSet, compare, removeWatch; - - switch (mode) { - - case '@': - if (!optional && !hasOwnProperty.call(attrs, attrName)) { - strictBindingsCheck(attrName, directive.name); - destination[scopeName] = attrs[attrName] = undefined; - - } - removeWatch = attrs.$observe(attrName, function(value) { - if (isString(value) || isBoolean(value)) { - var oldValue = destination[scopeName]; - recordChanges(scopeName, value, oldValue); - destination[scopeName] = value; - } - }); - attrs.$$observers[attrName].$$scope = scope; - lastValue = attrs[attrName]; - if (isString(lastValue)) { - // If the attribute has been provided then we trigger an interpolation to ensure - // the value is there for use in the link fn - destination[scopeName] = $interpolate(lastValue)(scope); - } else if (isBoolean(lastValue)) { - // If the attributes is one of the BOOLEAN_ATTR then AngularJS will have converted - // the value to boolean rather than a string, so we special case this situation - destination[scopeName] = lastValue; - } - initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]); - removeWatchCollection.push(removeWatch); - break; - - case '=': - if (!hasOwnProperty.call(attrs, attrName)) { - if (optional) break; - strictBindingsCheck(attrName, directive.name); - attrs[attrName] = undefined; - } - if (optional && !attrs[attrName]) break; - - parentGet = $parse(attrs[attrName]); - if (parentGet.literal) { - compare = equals; - } else { - compare = simpleCompare; - } - parentSet = parentGet.assign || function() { - // reset the change, or we will throw this exception on every $digest - lastValue = destination[scopeName] = parentGet(scope); - throw $compileMinErr('nonassign', - 'Expression \'{0}\' in attribute \'{1}\' used with directive \'{2}\' is non-assignable!', - attrs[attrName], attrName, directive.name); - }; - lastValue = destination[scopeName] = parentGet(scope); - var parentValueWatch = function parentValueWatch(parentValue) { - if (!compare(parentValue, destination[scopeName])) { - // we are out of sync and need to copy - if (!compare(parentValue, lastValue)) { - // parent changed and it has precedence - destination[scopeName] = parentValue; - } else { - // if the parent can be assigned then do so - parentSet(scope, parentValue = destination[scopeName]); - } - } - lastValue = parentValue; - return lastValue; - }; - parentValueWatch.$stateful = true; - if (definition.collection) { - removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch); - } else { - removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal); - } - removeWatchCollection.push(removeWatch); - break; - - case '<': - if (!hasOwnProperty.call(attrs, attrName)) { - if (optional) break; - strictBindingsCheck(attrName, directive.name); - attrs[attrName] = undefined; - } - if (optional && !attrs[attrName]) break; - - parentGet = $parse(attrs[attrName]); - var deepWatch = parentGet.literal; - - var initialValue = destination[scopeName] = parentGet(scope); - initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]); - - removeWatch = scope.$watch(parentGet, function parentValueWatchAction(newValue, oldValue) { - if (oldValue === newValue) { - if (oldValue === initialValue || (deepWatch && equals(oldValue, initialValue))) { - return; - } - oldValue = initialValue; - } - recordChanges(scopeName, newValue, oldValue); - destination[scopeName] = newValue; - }, deepWatch); - - removeWatchCollection.push(removeWatch); - break; - - case '&': - if (!optional && !hasOwnProperty.call(attrs, attrName)) { - strictBindingsCheck(attrName, directive.name); - } - // Don't assign Object.prototype method to scope - parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop; - - // Don't assign noop to destination if expression is not valid - if (parentGet === noop && optional) break; - - destination[scopeName] = function(locals) { - return parentGet(scope, locals); - }; - break; - } - }); - - function recordChanges(key, currentValue, previousValue) { - if (isFunction(destination.$onChanges) && !simpleCompare(currentValue, previousValue)) { - // If we have not already scheduled the top level onChangesQueue handler then do so now - if (!onChangesQueue) { - scope.$$postDigest(flushOnChangesQueue); - onChangesQueue = []; - } - // If we have not already queued a trigger of onChanges for this controller then do so now - if (!changes) { - changes = {}; - onChangesQueue.push(triggerOnChangesHook); - } - // If the has been a change on this property already then we need to reuse the previous value - if (changes[key]) { - previousValue = changes[key].previousValue; - } - // Store this change - changes[key] = new SimpleChange(previousValue, currentValue); - } - } - - function triggerOnChangesHook() { - destination.$onChanges(changes); - // Now clear the changes so that we schedule onChanges when more changes arrive - changes = undefined; - } - - return { - initialChanges: initialChanges, - removeWatches: removeWatchCollection.length && function removeWatches() { - for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) { - removeWatchCollection[i](); - } - } - }; - } - }]; - } - - function SimpleChange(previous, current) { - this.previousValue = previous; - this.currentValue = current; - } - SimpleChange.prototype.isFirstChange = function() { return this.previousValue === _UNINITIALIZED_VALUE; }; - - - var PREFIX_REGEXP = /^((?:x|data)[:\-_])/i; - var SPECIAL_CHARS_REGEXP = /[:\-_]+(.)/g; - - /** - * Converts all accepted directives format into proper directive name. - * @param name Name to normalize - */ - function directiveNormalize(name) { - return name - .replace(PREFIX_REGEXP, '') - .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) { - return offset ? letter.toUpperCase() : letter; - }); - } - - /** - * @ngdoc type - * @name $compile.directive.Attributes - * - * @description - * A shared object between directive compile / linking functions which contains normalized DOM - * element attributes. The values reflect current binding state `{{ }}`. The normalization is - * needed since all of these are treated as equivalent in AngularJS: - * - * ``` - * <span ng:bind="a" ng-bind="a" data-ng-bind="a" x-ng-bind="a"> - * ``` - */ - - /** - * @ngdoc property - * @name $compile.directive.Attributes#$attr - * - * @description - * A map of DOM element attribute names to the normalized name. This is - * needed to do reverse lookup from normalized name back to actual name. - */ - - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$set - * @kind function - * - * @description - * Set DOM element attribute value. - * - * - * @param {string} name Normalized element attribute name of the property to modify. The name is - * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr} - * property to the original name. - * @param {string} value Value to set the attribute to. The value can be an interpolated string. - */ - - - - /** - * Closure compiler type information - */ - - function nodesetLinkingFn( - /* angular.Scope */ scope, - /* NodeList */ nodeList, - /* Element */ rootElement, - /* function(Function) */ boundTranscludeFn - ) {} - - function directiveLinkingFn( - /* nodesetLinkingFn */ nodesetLinkingFn, - /* angular.Scope */ scope, - /* Node */ node, - /* Element */ rootElement, - /* function(Function) */ boundTranscludeFn - ) {} - - function tokenDifference(str1, str2) { - var values = '', - tokens1 = str1.split(/\s+/), - tokens2 = str2.split(/\s+/); - - outer: - for (var i = 0; i < tokens1.length; i++) { - var token = tokens1[i]; - for (var j = 0; j < tokens2.length; j++) { - if (token === tokens2[j]) continue outer; - } - values += (values.length > 0 ? ' ' : '') + token; - } - return values; - } - - function removeComments(jqNodes) { - jqNodes = jqLite(jqNodes); - var i = jqNodes.length; - - if (i <= 1) { - return jqNodes; - } - - while (i--) { - var node = jqNodes[i]; - if (node.nodeType === NODE_TYPE_COMMENT || - (node.nodeType === NODE_TYPE_TEXT && node.nodeValue.trim() === '')) { - splice.call(jqNodes, i, 1); - } - } - return jqNodes; - } - - var $controllerMinErr = minErr('$controller'); - - - var CNTRL_REG = /^(\S+)(\s+as\s+([\w$]+))?$/; - function identifierForController(controller, ident) { - if (ident && isString(ident)) return ident; - if (isString(controller)) { - var match = CNTRL_REG.exec(controller); - if (match) return match[3]; - } - } - - - /** - * @ngdoc provider - * @name $controllerProvider - * @this - * - * @description - * The {@link ng.$controller $controller service} is used by AngularJS to create new - * controllers. - * - * This provider allows controller registration via the - * {@link ng.$controllerProvider#register register} method. - */ - function $ControllerProvider() { - var controllers = {}, - globals = false; - - /** - * @ngdoc method - * @name $controllerProvider#has - * @param {string} name Controller name to check. - */ - this.has = function(name) { - return controllers.hasOwnProperty(name); - }; - - /** - * @ngdoc method - * @name $controllerProvider#register - * @param {string|Object} name Controller name, or an object map of controllers where the keys are - * the names and the values are the constructors. - * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI - * annotations in the array notation). - */ - this.register = function(name, constructor) { - assertNotHasOwnProperty(name, 'controller'); - if (isObject(name)) { - extend(controllers, name); - } else { - controllers[name] = constructor; - } - }; - - /** - * @ngdoc method - * @name $controllerProvider#allowGlobals - * @description If called, allows `$controller` to find controller constructors on `window` - * - * @deprecated - * sinceVersion="v1.3.0" - * removeVersion="v1.7.0" - * This method of finding controllers has been deprecated. - */ - this.allowGlobals = function() { - globals = true; - }; - - - this.$get = ['$injector', '$window', function($injector, $window) { - - /** - * @ngdoc service - * @name $controller - * @requires $injector - * - * @param {Function|string} constructor If called with a function then it's considered to be the - * controller constructor function. Otherwise it's considered to be a string which is used - * to retrieve the controller constructor using the following steps: - * - * * check if a controller with given name is registered via `$controllerProvider` - * * check if evaluating the string on the current scope returns a constructor - * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global - * `window` object (deprecated, not recommended) - * - * The string can use the `controller as property` syntax, where the controller instance is published - * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this - * to work correctly. - * - * @param {Object} locals Injection locals for Controller. - * @return {Object} Instance of given controller. - * - * @description - * `$controller` service is responsible for instantiating controllers. - * - * It's just a simple call to {@link auto.$injector $injector}, but extracted into - * a service, so that one can override this service with [BC version](https://gist.github.com/1649788). - */ - return function $controller(expression, locals, later, ident) { - // PRIVATE API: - // param `later` --- indicates that the controller's constructor is invoked at a later time. - // If true, $controller will allocate the object with the correct - // prototype chain, but will not invoke the controller until a returned - // callback is invoked. - // param `ident` --- An optional label which overrides the label parsed from the controller - // expression, if any. - var instance, match, constructor, identifier; - later = later === true; - if (ident && isString(ident)) { - identifier = ident; - } - - if (isString(expression)) { - match = expression.match(CNTRL_REG); - if (!match) { - throw $controllerMinErr('ctrlfmt', - 'Badly formed controller string \'{0}\'. ' + - 'Must match `__name__ as __id__` or `__name__`.', expression); - } - constructor = match[1]; - identifier = identifier || match[3]; - expression = controllers.hasOwnProperty(constructor) - ? controllers[constructor] - : getter(locals.$scope, constructor, true) || - (globals ? getter($window, constructor, true) : undefined); - - if (!expression) { - throw $controllerMinErr('ctrlreg', - 'The controller with the name \'{0}\' is not registered.', constructor); - } - - assertArgFn(expression, constructor, true); - } - - if (later) { - // Instantiate controller later: - // This machinery is used to create an instance of the object before calling the - // controller's constructor itself. - // - // This allows properties to be added to the controller before the constructor is - // invoked. Primarily, this is used for isolate scope bindings in $compile. - // - // This feature is not intended for use by applications, and is thus not documented - // publicly. - // Object creation: http://jsperf.com/create-constructor/2 - var controllerPrototype = (isArray(expression) ? - expression[expression.length - 1] : expression).prototype; - instance = Object.create(controllerPrototype || null); - - if (identifier) { - addIdentifier(locals, identifier, instance, constructor || expression.name); - } - - return extend(function $controllerInit() { - var result = $injector.invoke(expression, instance, locals, constructor); - if (result !== instance && (isObject(result) || isFunction(result))) { - instance = result; - if (identifier) { - // If result changed, re-assign controllerAs value to scope. - addIdentifier(locals, identifier, instance, constructor || expression.name); - } - } - return instance; - }, { - instance: instance, - identifier: identifier - }); - } - - instance = $injector.instantiate(expression, locals, constructor); - - if (identifier) { - addIdentifier(locals, identifier, instance, constructor || expression.name); - } - - return instance; - }; - - function addIdentifier(locals, identifier, instance, name) { - if (!(locals && isObject(locals.$scope))) { - throw minErr('$controller')('noscp', - 'Cannot export controller \'{0}\' as \'{1}\'! No $scope object provided via `locals`.', - name, identifier); - } - - locals.$scope[identifier] = instance; - } - }]; - } - - /** - * @ngdoc service - * @name $document - * @requires $window - * @this - * - * @description - * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object. - * - * @example - <example module="documentExample" name="document"> - <file name="index.html"> - <div ng-controller="ExampleController"> - <p>$document title: <b ng-bind="title"></b></p> - <p>window.document title: <b ng-bind="windowTitle"></b></p> - </div> - </file> - <file name="script.js"> - angular.module('documentExample', []) - .controller('ExampleController', ['$scope', '$document', function($scope, $document) { - $scope.title = $document[0].title; - $scope.windowTitle = angular.element(window.document)[0].title; - }]); - </file> - </example> - */ - function $DocumentProvider() { - this.$get = ['$window', function(window) { - return jqLite(window.document); - }]; - } - - - /** - * @private - * @this - * Listens for document visibility change and makes the current status accessible. - */ - function $$IsDocumentHiddenProvider() { - this.$get = ['$document', '$rootScope', function($document, $rootScope) { - var doc = $document[0]; - var hidden = doc && doc.hidden; - - $document.on('visibilitychange', changeListener); - - $rootScope.$on('$destroy', function() { - $document.off('visibilitychange', changeListener); - }); - - function changeListener() { - hidden = doc.hidden; - } - - return function() { - return hidden; - }; - }]; - } - - /** - * @ngdoc service - * @name $exceptionHandler - * @requires ng.$log - * @this - * - * @description - * Any uncaught exception in AngularJS expressions is delegated to this service. - * The default implementation simply delegates to `$log.error` which logs it into - * the browser console. - * - * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by - * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing. - * - * ## Example: - * - * The example below will overwrite the default `$exceptionHandler` in order to (a) log uncaught - * errors to the backend for later inspection by the developers and (b) to use `$log.warn()` instead - * of `$log.error()`. - * - * ```js - * angular. - * module('exceptionOverwrite', []). - * factory('$exceptionHandler', ['$log', 'logErrorsToBackend', function($log, logErrorsToBackend) { - * return function myExceptionHandler(exception, cause) { - * logErrorsToBackend(exception, cause); - * $log.warn(exception, cause); - * }; - * }]); - * ``` - * - * <hr /> - * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind` - * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler} - * (unless executed during a digest). - * - * If you wish, you can manually delegate exceptions, e.g. - * `try { ... } catch(e) { $exceptionHandler(e); }` - * - * @param {Error} exception Exception associated with the error. - * @param {string=} cause Optional information about the context in which - * the error was thrown. - * - */ - function $ExceptionHandlerProvider() { - this.$get = ['$log', function($log) { - return function(exception, cause) { - $log.error.apply($log, arguments); - }; - }]; - } - - var $$ForceReflowProvider = /** @this */ function() { - this.$get = ['$document', function($document) { - return function(domNode) { - //the line below will force the browser to perform a repaint so - //that all the animated elements within the animation frame will - //be properly updated and drawn on screen. This is required to - //ensure that the preparation animation is properly flushed so that - //the active state picks up from there. DO NOT REMOVE THIS LINE. - //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH - //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND - //WILL TAKE YEARS AWAY FROM YOUR LIFE. - if (domNode) { - if (!domNode.nodeType && domNode instanceof jqLite) { - domNode = domNode[0]; - } - } else { - domNode = $document[0].body; - } - return domNode.offsetWidth + 1; - }; - }]; - }; - - var APPLICATION_JSON = 'application/json'; - var CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'}; - var JSON_START = /^\[|^\{(?!\{)/; - var JSON_ENDS = { - '[': /]$/, - '{': /}$/ - }; - var JSON_PROTECTION_PREFIX = /^\)]\}',?\n/; - var $httpMinErr = minErr('$http'); - - function serializeValue(v) { - if (isObject(v)) { - return isDate(v) ? v.toISOString() : toJson(v); - } - return v; - } - - - /** @this */ - function $HttpParamSerializerProvider() { - /** - * @ngdoc service - * @name $httpParamSerializer - * @description - * - * Default {@link $http `$http`} params serializer that converts objects to strings - * according to the following rules: - * - * * `{'foo': 'bar'}` results in `foo=bar` - * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object) - * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element) - * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D` (stringified and encoded representation of an object) - * - * Note that serializer will sort the request parameters alphabetically. - * */ - - this.$get = function() { - return function ngParamSerializer(params) { - if (!params) return ''; - var parts = []; - forEachSorted(params, function(value, key) { - if (value === null || isUndefined(value) || isFunction(value)) return; - if (isArray(value)) { - forEach(value, function(v) { - parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(v))); - }); - } else { - parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value))); - } - }); - - return parts.join('&'); - }; - }; - } - - /** @this */ - function $HttpParamSerializerJQLikeProvider() { - /** - * @ngdoc service - * @name $httpParamSerializerJQLike - * - * @description - * - * Alternative {@link $http `$http`} params serializer that follows - * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic. - * The serializer will also sort the params alphabetically. - * - * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property: - * - * ```js - * $http({ - * url: myUrl, - * method: 'GET', - * params: myParams, - * paramSerializer: '$httpParamSerializerJQLike' - * }); - * ``` - * - * It is also possible to set it as the default `paramSerializer` in the - * {@link $httpProvider#defaults `$httpProvider`}. - * - * Additionally, you can inject the serializer and use it explicitly, for example to serialize - * form data for submission: - * - * ```js - * .controller(function($http, $httpParamSerializerJQLike) { - * //... - * - * $http({ - * url: myUrl, - * method: 'POST', - * data: $httpParamSerializerJQLike(myData), - * headers: { - * 'Content-Type': 'application/x-www-form-urlencoded' - * } - * }); - * - * }); - * ``` - * - * */ - this.$get = function() { - return function jQueryLikeParamSerializer(params) { - if (!params) return ''; - var parts = []; - serialize(params, '', true); - return parts.join('&'); - - function serialize(toSerialize, prefix, topLevel) { - if (toSerialize === null || isUndefined(toSerialize)) return; - if (isArray(toSerialize)) { - forEach(toSerialize, function(value, index) { - serialize(value, prefix + '[' + (isObject(value) ? index : '') + ']'); - }); - } else if (isObject(toSerialize) && !isDate(toSerialize)) { - forEachSorted(toSerialize, function(value, key) { - serialize(value, prefix + - (topLevel ? '' : '[') + - key + - (topLevel ? '' : ']')); - }); - } else { - parts.push(encodeUriQuery(prefix) + '=' + encodeUriQuery(serializeValue(toSerialize))); - } - } - }; - }; - } - - function defaultHttpResponseTransform(data, headers) { - if (isString(data)) { - // Strip json vulnerability protection prefix and trim whitespace - var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim(); - - if (tempData) { - var contentType = headers('Content-Type'); - var hasJsonContentType = contentType && (contentType.indexOf(APPLICATION_JSON) === 0); - - if (hasJsonContentType || isJsonLike(tempData)) { - try { - data = fromJson(tempData); - } catch (e) { - if (!hasJsonContentType) { - return data; - } - throw $httpMinErr('baddata', 'Data must be a valid JSON object. Received: "{0}". ' + - 'Parse error: "{1}"', data, e); - } - } - } - } - - return data; - } - - function isJsonLike(str) { - var jsonStart = str.match(JSON_START); - return jsonStart && JSON_ENDS[jsonStart[0]].test(str); - } - - /** - * Parse headers into key value object - * - * @param {string} headers Raw headers as a string - * @returns {Object} Parsed headers as key value object - */ - function parseHeaders(headers) { - var parsed = createMap(), i; - - function fillInParsed(key, val) { - if (key) { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } - } - - if (isString(headers)) { - forEach(headers.split('\n'), function(line) { - i = line.indexOf(':'); - fillInParsed(lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1))); - }); - } else if (isObject(headers)) { - forEach(headers, function(headerVal, headerKey) { - fillInParsed(lowercase(headerKey), trim(headerVal)); - }); - } - - return parsed; - } - - - /** - * Returns a function that provides access to parsed headers. - * - * Headers are lazy parsed when first requested. - * @see parseHeaders - * - * @param {(string|Object)} headers Headers to provide access to. - * @returns {function(string=)} Returns a getter function which if called with: - * - * - if called with an argument returns a single header value or null - * - if called with no arguments returns an object containing all headers. - */ - function headersGetter(headers) { - var headersObj; - - return function(name) { - if (!headersObj) headersObj = parseHeaders(headers); - - if (name) { - var value = headersObj[lowercase(name)]; - if (value === undefined) { - value = null; - } - return value; - } - - return headersObj; - }; - } - - - /** - * Chain all given functions - * - * This function is used for both request and response transforming - * - * @param {*} data Data to transform. - * @param {function(string=)} headers HTTP headers getter fn. - * @param {number} status HTTP status code of the response. - * @param {(Function|Array.<Function>)} fns Function or an array of functions. - * @returns {*} Transformed data. - */ - function transformData(data, headers, status, fns) { - if (isFunction(fns)) { - return fns(data, headers, status); - } - - forEach(fns, function(fn) { - data = fn(data, headers, status); - }); - - return data; - } - - - function isSuccess(status) { - return 200 <= status && status < 300; - } - - - /** - * @ngdoc provider - * @name $httpProvider - * @this - * - * @description - * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service. - * */ - function $HttpProvider() { - /** - * @ngdoc property - * @name $httpProvider#defaults - * @description - * - * Object containing default values for all {@link ng.$http $http} requests. - * - * - **`defaults.cache`** - {boolean|Object} - A boolean value or object created with - * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses - * by default. See {@link $http#caching $http Caching} for more information. - * - * - **`defaults.headers`** - {Object} - Default headers for all $http requests. - * Refer to {@link ng.$http#setting-http-headers $http} for documentation on - * setting default headers. - * - **`defaults.headers.common`** - * - **`defaults.headers.post`** - * - **`defaults.headers.put`** - * - **`defaults.headers.patch`** - * - * - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the - * callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the - * {@link $jsonpCallbacks} service. Defaults to `'callback'`. - * - * - **`defaults.paramSerializer`** - `{string|function(Object<string,string>):string}` - A function - * used to the prepare string representation of request parameters (specified as an object). - * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}. - * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}. - * - * - **`defaults.transformRequest`** - - * `{Array<function(data, headersGetter)>|function(data, headersGetter)}` - - * An array of functions (or a single function) which are applied to the request data. - * By default, this is an array with one request transformation function: - * - * - If the `data` property of the request configuration object contains an object, serialize it - * into JSON format. - * - * - **`defaults.transformResponse`** - - * `{Array<function(data, headersGetter, status)>|function(data, headersGetter, status)}` - - * An array of functions (or a single function) which are applied to the response data. By default, - * this is an array which applies one response transformation function that does two things: - * - * - If XSRF prefix is detected, strip it - * (see {@link ng.$http#security-considerations Security Considerations in the $http docs}). - * - If the `Content-Type` is `application/json` or the response looks like JSON, - * deserialize it using a JSON parser. - * - * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token. - * Defaults value is `'XSRF-TOKEN'`. - * - * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the - * XSRF token. Defaults value is `'X-XSRF-TOKEN'`. - * - **/ - var defaults = this.defaults = { - // transform incoming response data - transformResponse: [defaultHttpResponseTransform], - - // transform outgoing request data - transformRequest: [function(d) { - return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d; - }], - - // default headers - headers: { - common: { - 'Accept': 'application/json, text/plain, */*' - }, - post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), - put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), - patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON) - }, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - paramSerializer: '$httpParamSerializer', - - jsonpCallbackParam: 'callback' - }; - - var useApplyAsync = false; - /** - * @ngdoc method - * @name $httpProvider#useApplyAsync - * @description - * - * Configure $http service to combine processing of multiple http responses received at around - * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in - * significant performance improvement for bigger applications that make many HTTP requests - * concurrently (common during application bootstrap). - * - * Defaults to false. If no value is specified, returns the current configured value. - * - * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred - * "apply" on the next tick, giving time for subsequent requests in a roughly ~10ms window - * to load and share the same digest cycle. - * - * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. - * otherwise, returns the current configured value. - **/ - this.useApplyAsync = function(value) { - if (isDefined(value)) { - useApplyAsync = !!value; - return this; - } - return useApplyAsync; - }; - - /** - * @ngdoc property - * @name $httpProvider#interceptors - * @description - * - * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http} - * pre-processing of request or postprocessing of responses. - * - * These service factories are ordered by request, i.e. they are applied in the same order as the - * array, on request, but reverse order, on response. - * - * {@link ng.$http#interceptors Interceptors detailed info} - **/ - var interceptorFactories = this.interceptors = []; - - this.$get = ['$browser', '$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector', '$sce', - function($browser, $httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector, $sce) { - - var defaultCache = $cacheFactory('$http'); - - /** - * Make sure that default param serializer is exposed as a function - */ - defaults.paramSerializer = isString(defaults.paramSerializer) ? - $injector.get(defaults.paramSerializer) : defaults.paramSerializer; - - /** - * Interceptors stored in reverse order. Inner interceptors before outer interceptors. - * The reversal is needed so that we can build up the interception chain around the - * server request. - */ - var reversedInterceptors = []; - - forEach(interceptorFactories, function(interceptorFactory) { - reversedInterceptors.unshift(isString(interceptorFactory) - ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory)); - }); - - /** - * @ngdoc service - * @kind function - * @name $http - * @requires ng.$httpBackend - * @requires $cacheFactory - * @requires $rootScope - * @requires $q - * @requires $injector - * - * @description - * The `$http` service is a core AngularJS service that facilitates communication with the remote - * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest) - * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP). - * - * For unit testing applications that use `$http` service, see - * {@link ngMock.$httpBackend $httpBackend mock}. - * - * For a higher level of abstraction, please check out the {@link ngResource.$resource - * $resource} service. - * - * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by - * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage - * it is important to familiarize yourself with these APIs and the guarantees they provide. - * - * - * ## General usage - * The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} — - * that is used to generate an HTTP request and returns a {@link ng.$q promise}. - * - * ```js - * // Simple GET request example: - * $http({ - * method: 'GET', - * url: '/someUrl' - * }).then(function successCallback(response) { - * // this callback will be called asynchronously - * // when the response is available - * }, function errorCallback(response) { - * // called asynchronously if an error occurs - * // or server returns response with an error status. - * }); - * ``` - * - * The response object has these properties: - * - * - **data** – `{string|Object}` – The response body transformed with the transform - * functions. - * - **status** – `{number}` – HTTP status code of the response. - * - **headers** – `{function([headerName])}` – Header getter function. - * - **config** – `{Object}` – The configuration object that was used to generate the request. - * - **statusText** – `{string}` – HTTP status text of the response. - * - **xhrStatus** – `{string}` – Status of the XMLHttpRequest (`complete`, `error`, `timeout` or `abort`). - * - * A response status code between 200 and 299 is considered a success status and will result in - * the success callback being called. Any response status code outside of that range is - * considered an error status and will result in the error callback being called. - * Also, status codes less than -1 are normalized to zero. -1 usually means the request was - * aborted, e.g. using a `config.timeout`. - * Note that if the response is a redirect, XMLHttpRequest will transparently follow it, meaning - * that the outcome (success or error) will be determined by the final response status code. - * - * - * ## Shortcut methods - * - * Shortcut methods are also available. All shortcut methods require passing in the URL, and - * request data must be passed in for POST/PUT requests. An optional config can be passed as the - * last argument. - * - * ```js - * $http.get('/someUrl', config).then(successCallback, errorCallback); - * $http.post('/someUrl', data, config).then(successCallback, errorCallback); - * ``` - * - * Complete list of shortcut methods: - * - * - {@link ng.$http#get $http.get} - * - {@link ng.$http#head $http.head} - * - {@link ng.$http#post $http.post} - * - {@link ng.$http#put $http.put} - * - {@link ng.$http#delete $http.delete} - * - {@link ng.$http#jsonp $http.jsonp} - * - {@link ng.$http#patch $http.patch} - * - * - * ## Writing Unit Tests that use $http - * When unit testing (using {@link ngMock ngMock}), it is necessary to call - * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending - * request using trained responses. - * - * ``` - * $httpBackend.expectGET(...); - * $http.get(...); - * $httpBackend.flush(); - * ``` - * - * ## Setting HTTP Headers - * - * The $http service will automatically add certain HTTP headers to all requests. These defaults - * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration - * object, which currently contains this default configuration: - * - * - `$httpProvider.defaults.headers.common` (headers that are common for all requests): - * - <code>Accept: application/json, text/plain, \*/\*</code> - * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests) - * - `Content-Type: application/json` - * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests) - * - `Content-Type: application/json` - * - * To add or overwrite these defaults, simply add or remove a property from these configuration - * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object - * with the lowercased HTTP method name as the key, e.g. - * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`. - * - * The defaults can also be set at runtime via the `$http.defaults` object in the same - * fashion. For example: - * - * ``` - * module.run(function($http) { - * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w'; - * }); - * ``` - * - * In addition, you can supply a `headers` property in the config object passed when - * calling `$http(config)`, which overrides the defaults without changing them globally. - * - * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis, - * Use the `headers` property, setting the desired header to `undefined`. For example: - * - * ```js - * var req = { - * method: 'POST', - * url: 'http://example.com', - * headers: { - * 'Content-Type': undefined - * }, - * data: { test: 'test' } - * } - * - * $http(req).then(function(){...}, function(){...}); - * ``` - * - * ## Transforming Requests and Responses - * - * Both requests and responses can be transformed using transformation functions: `transformRequest` - * and `transformResponse`. These properties can be a single function that returns - * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions, - * which allows you to `push` or `unshift` a new transformation function into the transformation chain. - * - * <div class="alert alert-warning"> - * **Note:** AngularJS does not make a copy of the `data` parameter before it is passed into the `transformRequest` pipeline. - * That means changes to the properties of `data` are not local to the transform function (since Javascript passes objects by reference). - * For example, when calling `$http.get(url, $scope.myObject)`, modifications to the object's properties in a transformRequest - * function will be reflected on the scope and in any templates where the object is data-bound. - * To prevent this, transform functions should have no side-effects. - * If you need to modify properties, it is recommended to make a copy of the data, or create new object to return. - * </div> - * - * ### Default Transformations - * - * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and - * `defaults.transformResponse` properties. If a request does not provide its own transformations - * then these will be applied. - * - * You can augment or replace the default transformations by modifying these properties by adding to or - * replacing the array. - * - * AngularJS provides the following default transformations: - * - * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`) is - * an array with one function that does the following: - * - * - If the `data` property of the request configuration object contains an object, serialize it - * into JSON format. - * - * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`) is - * an array with one function that does the following: - * - * - If XSRF prefix is detected, strip it (see Security Considerations section below). - * - If the `Content-Type` is `application/json` or the response looks like JSON, - * deserialize it using a JSON parser. - * - * - * ### Overriding the Default Transformations Per Request - * - * If you wish to override the request/response transformations only for a single request then provide - * `transformRequest` and/or `transformResponse` properties on the configuration object passed - * into `$http`. - * - * Note that if you provide these properties on the config object the default transformations will be - * overwritten. If you wish to augment the default transformations then you must include them in your - * local transformation array. - * - * The following code demonstrates adding a new response transformation to be run after the default response - * transformations have been run. - * - * ```js - * function appendTransform(defaults, transform) { - * - * // We can't guarantee that the default transformation is an array - * defaults = angular.isArray(defaults) ? defaults : [defaults]; - * - * // Append the new transformation to the defaults - * return defaults.concat(transform); - * } - * - * $http({ - * url: '...', - * method: 'GET', - * transformResponse: appendTransform($http.defaults.transformResponse, function(value) { - * return doTransform(value); - * }) - * }); - * ``` - * - * - * ## Caching - * - * {@link ng.$http `$http`} responses are not cached by default. To enable caching, you must - * set the config.cache value or the default cache value to TRUE or to a cache object (created - * with {@link ng.$cacheFactory `$cacheFactory`}). If defined, the value of config.cache takes - * precedence over the default cache value. - * - * In order to: - * * cache all responses - set the default cache value to TRUE or to a cache object - * * cache a specific response - set config.cache value to TRUE or to a cache object - * - * If caching is enabled, but neither the default cache nor config.cache are set to a cache object, - * then the default `$cacheFactory("$http")` object is used. - * - * The default cache value can be set by updating the - * {@link ng.$http#defaults `$http.defaults.cache`} property or the - * {@link $httpProvider#defaults `$httpProvider.defaults.cache`} property. - * - * When caching is enabled, {@link ng.$http `$http`} stores the response from the server using - * the relevant cache object. The next time the same request is made, the response is returned - * from the cache without sending a request to the server. - * - * Take note that: - * - * * Only GET and JSONP requests are cached. - * * The cache key is the request URL including search parameters; headers are not considered. - * * Cached responses are returned asynchronously, in the same way as responses from the server. - * * If multiple identical requests are made using the same cache, which is not yet populated, - * one request will be made to the server and remaining requests will return the same response. - * * A cache-control header on the response does not affect if or how responses are cached. - * - * - * ## Interceptors - * - * Before you start creating interceptors, be sure to understand the - * {@link ng.$q $q and deferred/promise APIs}. - * - * For purposes of global error handling, authentication, or any kind of synchronous or - * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be - * able to intercept requests before they are handed to the server and - * responses before they are handed over to the application code that - * initiated these requests. The interceptors leverage the {@link ng.$q - * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing. - * - * The interceptors are service factories that are registered with the `$httpProvider` by - * adding them to the `$httpProvider.interceptors` array. The factory is called and - * injected with dependencies (if specified) and returns the interceptor. - * - * There are two kinds of interceptors (and two kinds of rejection interceptors): - * - * * `request`: interceptors get called with a http {@link $http#usage config} object. The function is free to - * modify the `config` object or create a new one. The function needs to return the `config` - * object directly, or a promise containing the `config` or a new `config` object. - * * `requestError`: interceptor gets called when a previous interceptor threw an error or - * resolved with a rejection. - * * `response`: interceptors get called with http `response` object. The function is free to - * modify the `response` object or create a new one. The function needs to return the `response` - * object directly, or as a promise containing the `response` or a new `response` object. - * * `responseError`: interceptor gets called when a previous interceptor threw an error or - * resolved with a rejection. - * - * - * ```js - * // register the interceptor as a service - * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) { - * return { - * // optional method - * 'request': function(config) { - * // do something on success - * return config; - * }, - * - * // optional method - * 'requestError': function(rejection) { - * // do something on error - * if (canRecover(rejection)) { - * return responseOrNewPromise - * } - * return $q.reject(rejection); - * }, - * - * - * - * // optional method - * 'response': function(response) { - * // do something on success - * return response; - * }, - * - * // optional method - * 'responseError': function(rejection) { - * // do something on error - * if (canRecover(rejection)) { - * return responseOrNewPromise - * } - * return $q.reject(rejection); - * } - * }; - * }); - * - * $httpProvider.interceptors.push('myHttpInterceptor'); - * - * - * // alternatively, register the interceptor via an anonymous factory - * $httpProvider.interceptors.push(function($q, dependency1, dependency2) { - * return { - * 'request': function(config) { - * // same as above - * }, - * - * 'response': function(response) { - * // same as above - * } - * }; - * }); - * ``` - * - * ## Security Considerations - * - * When designing web applications, consider security threats from: - * - * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) - * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) - * - * Both server and the client must cooperate in order to eliminate these threats. AngularJS comes - * pre-configured with strategies that address these issues, but for this to work backend server - * cooperation is required. - * - * ### JSON Vulnerability Protection - * - * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) - * allows third party website to turn your JSON resource URL into - * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To - * counter this your server can prefix all JSON requests with following string `")]}',\n"`. - * AngularJS will automatically strip the prefix before processing it as JSON. - * - * For example if your server needs to return: - * ```js - * ['one','two'] - * ``` - * - * which is vulnerable to attack, your server can return: - * ```js - * )]}', - * ['one','two'] - * ``` - * - * AngularJS will strip the prefix, before processing the JSON. - * - * - * ### Cross Site Request Forgery (XSRF) Protection - * - * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is an attack technique by - * which the attacker can trick an authenticated user into unknowingly executing actions on your - * website. AngularJS provides a mechanism to counter XSRF. When performing XHR requests, the - * $http service reads a token from a cookie (by default, `XSRF-TOKEN`) and sets it as an HTTP - * header (`X-XSRF-TOKEN`). Since only JavaScript that runs on your domain could read the - * cookie, your server can be assured that the XHR came from JavaScript running on your domain. - * The header will not be set for cross-domain requests. - * - * To take advantage of this, your server needs to set a token in a JavaScript readable session - * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the - * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure - * that only JavaScript running on your domain could have sent the request. The token must be - * unique for each user and must be verifiable by the server (to prevent the JavaScript from - * making up its own tokens). We recommend that the token is a digest of your site's - * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography)) - * for added security. - * - * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName - * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time, - * or the per-request config object. - * - * In order to prevent collisions in environments where multiple AngularJS apps share the - * same domain or subdomain, we recommend that each application uses unique cookie name. - * - * @param {object} config Object describing the request to be made and how it should be - * processed. The object has following properties: - * - * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc) - * - **url** – `{string|TrustedObject}` – Absolute or relative URL of the resource that is being requested; - * or an object created by a call to `$sce.trustAsResourceUrl(url)`. - * - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be serialized - * with the `paramSerializer` and appended as GET parameters. - * - **data** – `{string|Object}` – Data to be sent as the request message data. - * - **headers** – `{Object}` – Map of strings or functions which return strings representing - * HTTP headers to send to the server. If the return value of a function is null, the - * header will not be sent. Functions accept a config object as an argument. - * - **eventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest object. - * To bind events to the XMLHttpRequest upload object, use `uploadEventHandlers`. - * The handler will be called in the context of a `$apply` block. - * - **uploadEventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest upload - * object. To bind events to the XMLHttpRequest object, use `eventHandlers`. - * The handler will be called in the context of a `$apply` block. - * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token. - * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token. - * - **transformRequest** – - * `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` – - * transform function or an array of such functions. The transform function takes the http - * request body and headers and returns its transformed (typically serialized) version. - * See {@link ng.$http#overriding-the-default-transformations-per-request - * Overriding the Default Transformations} - * - **transformResponse** – - * `{function(data, headersGetter, status)|Array.<function(data, headersGetter, status)>}` – - * transform function or an array of such functions. The transform function takes the http - * response body, headers and status and returns its transformed (typically deserialized) version. - * See {@link ng.$http#overriding-the-default-transformations-per-request - * Overriding the Default Transformations} - * - **paramSerializer** - `{string|function(Object<string,string>):string}` - A function used to - * prepare the string representation of request parameters (specified as an object). - * If specified as string, it is interpreted as function registered with the - * {@link $injector $injector}, which means you can create your own serializer - * by registering it as a {@link auto.$provide#service service}. - * The default serializer is the {@link $httpParamSerializer $httpParamSerializer}; - * alternatively, you can use the {@link $httpParamSerializerJQLike $httpParamSerializerJQLike} - * - **cache** – `{boolean|Object}` – A boolean value or object created with - * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of the HTTP response. - * See {@link $http#caching $http Caching} for more information. - * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} - * that should abort the request when resolved. - * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the - * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials) - * for more information. - * - **responseType** - `{string}` - see - * [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype). - * - * @returns {HttpPromise} Returns a {@link ng.$q `Promise}` that will be resolved to a response object - * when the request succeeds or fails. - * - * - * @property {Array.<Object>} pendingRequests Array of config objects for currently pending - * requests. This is primarily meant to be used for debugging purposes. - * - * - * @example - <example module="httpExample" name="http-service"> - <file name="index.html"> - <div ng-controller="FetchController"> - <select ng-model="method" aria-label="Request method"> - <option>GET</option> - <option>JSONP</option> - </select> - <input type="text" ng-model="url" size="80" aria-label="URL" /> - <button id="fetchbtn" ng-click="fetch()">fetch</button><br> - <button id="samplegetbtn" ng-click="updateModel('GET', 'http-hello.html')">Sample GET</button> - <button id="samplejsonpbtn" - ng-click="updateModel('JSONP', - 'https://angularjs.org/greet.php?name=Super%20Hero')"> - Sample JSONP - </button> - <button id="invalidjsonpbtn" - ng-click="updateModel('JSONP', 'https://angularjs.org/doesntexist')"> - Invalid JSONP - </button> - <pre>http status code: {{status}}</pre> - <pre>http response data: {{data}}</pre> - </div> - </file> - <file name="script.js"> - angular.module('httpExample', []) - .config(['$sceDelegateProvider', function($sceDelegateProvider) { - // We must whitelist the JSONP endpoint that we are using to show that we trust it - $sceDelegateProvider.resourceUrlWhitelist([ - 'self', - 'https://angularjs.org/**' - ]); - }]) - .controller('FetchController', ['$scope', '$http', '$templateCache', - function($scope, $http, $templateCache) { - $scope.method = 'GET'; - $scope.url = 'http-hello.html'; - - $scope.fetch = function() { - $scope.code = null; - $scope.response = null; - - $http({method: $scope.method, url: $scope.url, cache: $templateCache}). - then(function(response) { - $scope.status = response.status; - $scope.data = response.data; - }, function(response) { - $scope.data = response.data || 'Request failed'; - $scope.status = response.status; - }); - }; - - $scope.updateModel = function(method, url) { - $scope.method = method; - $scope.url = url; - }; - }]); - </file> - <file name="http-hello.html"> - Hello, $http! - </file> - <file name="protractor.js" type="protractor"> - var status = element(by.binding('status')); - var data = element(by.binding('data')); - var fetchBtn = element(by.id('fetchbtn')); - var sampleGetBtn = element(by.id('samplegetbtn')); - var invalidJsonpBtn = element(by.id('invalidjsonpbtn')); - - it('should make an xhr GET request', function() { - sampleGetBtn.click(); - fetchBtn.click(); - expect(status.getText()).toMatch('200'); - expect(data.getText()).toMatch(/Hello, \$http!/); - }); - - // Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185 - // it('should make a JSONP request to angularjs.org', function() { -// var sampleJsonpBtn = element(by.id('samplejsonpbtn')); -// sampleJsonpBtn.click(); -// fetchBtn.click(); -// expect(status.getText()).toMatch('200'); -// expect(data.getText()).toMatch(/Super Hero!/); -// }); - - it('should make JSONP request to invalid URL and invoke the error handler', - function() { - invalidJsonpBtn.click(); - fetchBtn.click(); - expect(status.getText()).toMatch('0'); - expect(data.getText()).toMatch('Request failed'); - }); - </file> - </example> - */ - function $http(requestConfig) { - - if (!isObject(requestConfig)) { - throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig); - } - - if (!isString($sce.valueOf(requestConfig.url))) { - throw minErr('$http')('badreq', 'Http request configuration url must be a string or a $sce trusted object. Received: {0}', requestConfig.url); - } - - var config = extend({ - method: 'get', - transformRequest: defaults.transformRequest, - transformResponse: defaults.transformResponse, - paramSerializer: defaults.paramSerializer, - jsonpCallbackParam: defaults.jsonpCallbackParam - }, requestConfig); - - config.headers = mergeHeaders(requestConfig); - config.method = uppercase(config.method); - config.paramSerializer = isString(config.paramSerializer) ? - $injector.get(config.paramSerializer) : config.paramSerializer; - - $browser.$$incOutstandingRequestCount(); - - var requestInterceptors = []; - var responseInterceptors = []; - var promise = $q.resolve(config); - - // apply interceptors - forEach(reversedInterceptors, function(interceptor) { - if (interceptor.request || interceptor.requestError) { - requestInterceptors.unshift(interceptor.request, interceptor.requestError); - } - if (interceptor.response || interceptor.responseError) { - responseInterceptors.push(interceptor.response, interceptor.responseError); - } - }); - - promise = chainInterceptors(promise, requestInterceptors); - promise = promise.then(serverRequest); - promise = chainInterceptors(promise, responseInterceptors); - promise = promise.finally(completeOutstandingRequest); - - return promise; - - - function chainInterceptors(promise, interceptors) { - for (var i = 0, ii = interceptors.length; i < ii;) { - var thenFn = interceptors[i++]; - var rejectFn = interceptors[i++]; - - promise = promise.then(thenFn, rejectFn); - } - - interceptors.length = 0; - - return promise; - } - - function completeOutstandingRequest() { - $browser.$$completeOutstandingRequest(noop); - } - - function executeHeaderFns(headers, config) { - var headerContent, processedHeaders = {}; - - forEach(headers, function(headerFn, header) { - if (isFunction(headerFn)) { - headerContent = headerFn(config); - if (headerContent != null) { - processedHeaders[header] = headerContent; - } - } else { - processedHeaders[header] = headerFn; - } - }); - - return processedHeaders; - } - - function mergeHeaders(config) { - var defHeaders = defaults.headers, - reqHeaders = extend({}, config.headers), - defHeaderName, lowercaseDefHeaderName, reqHeaderName; - - defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]); - - // using for-in instead of forEach to avoid unnecessary iteration after header has been found - defaultHeadersIteration: - for (defHeaderName in defHeaders) { - lowercaseDefHeaderName = lowercase(defHeaderName); - - for (reqHeaderName in reqHeaders) { - if (lowercase(reqHeaderName) === lowercaseDefHeaderName) { - continue defaultHeadersIteration; - } - } - - reqHeaders[defHeaderName] = defHeaders[defHeaderName]; - } - - // execute if header value is a function for merged headers - return executeHeaderFns(reqHeaders, shallowCopy(config)); - } - - function serverRequest(config) { - var headers = config.headers; - var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest); - - // strip content-type if data is undefined - if (isUndefined(reqData)) { - forEach(headers, function(value, header) { - if (lowercase(header) === 'content-type') { - delete headers[header]; - } - }); - } - - if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) { - config.withCredentials = defaults.withCredentials; - } - - // send request - return sendReq(config, reqData).then(transformResponse, transformResponse); - } - - function transformResponse(response) { - // make a copy since the response must be cacheable - var resp = extend({}, response); - resp.data = transformData(response.data, response.headers, response.status, - config.transformResponse); - return (isSuccess(response.status)) - ? resp - : $q.reject(resp); - } - } - - $http.pendingRequests = []; - - /** - * @ngdoc method - * @name $http#get - * - * @description - * Shortcut method to perform `GET` request. - * - * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested; - * or an object created by a call to `$sce.trustAsResourceUrl(url)`. - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#delete - * - * @description - * Shortcut method to perform `DELETE` request. - * - * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested; - * or an object created by a call to `$sce.trustAsResourceUrl(url)`. - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#head - * - * @description - * Shortcut method to perform `HEAD` request. - * - * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested; - * or an object created by a call to `$sce.trustAsResourceUrl(url)`. - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#jsonp - * - * @description - * Shortcut method to perform `JSONP` request. - * - * Note that, since JSONP requests are sensitive because the response is given full access to the browser, - * the url must be declared, via {@link $sce} as a trusted resource URL. - * You can trust a URL by adding it to the whitelist via - * {@link $sceDelegateProvider#resourceUrlWhitelist `$sceDelegateProvider.resourceUrlWhitelist`} or - * by explicitly trusting the URL via {@link $sce#trustAsResourceUrl `$sce.trustAsResourceUrl(url)`}. - * - * You should avoid generating the URL for the JSONP request from user provided data. - * Provide additional query parameters via `params` property of the `config` parameter, rather than - * modifying the URL itself. - * - * JSONP requests must specify a callback to be used in the response from the server. This callback - * is passed as a query parameter in the request. You must specify the name of this parameter by - * setting the `jsonpCallbackParam` property on the request config object. - * - * ``` - * $http.jsonp('some/trusted/url', {jsonpCallbackParam: 'callback'}) - * ``` - * - * You can also specify a default callback parameter name in `$http.defaults.jsonpCallbackParam`. - * Initially this is set to `'callback'`. - * - * <div class="alert alert-danger"> - * You can no longer use the `JSON_CALLBACK` string as a placeholder for specifying where the callback - * parameter value should go. - * </div> - * - * If you would like to customise where and how the callbacks are stored then try overriding - * or decorating the {@link $jsonpCallbacks} service. - * - * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested; - * or an object created by a call to `$sce.trustAsResourceUrl(url)`. - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - createShortMethods('get', 'delete', 'head', 'jsonp'); - - /** - * @ngdoc method - * @name $http#post - * - * @description - * Shortcut method to perform `POST` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {*} data Request content - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#put - * - * @description - * Shortcut method to perform `PUT` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {*} data Request content - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#patch - * - * @description - * Shortcut method to perform `PATCH` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {*} data Request content - * @param {Object=} config Optional configuration object. See https://docs.angularjs.org/api/ng/service/$http#usage - * @returns {HttpPromise} Future object - */ - createShortMethodsWithData('post', 'put', 'patch'); - - /** - * @ngdoc property - * @name $http#defaults - * - * @description - * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of - * default headers, withCredentials as well as request and response transformations. - * - * See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above. - */ - $http.defaults = defaults; - - - return $http; - - - function createShortMethods(names) { - forEach(arguments, function(name) { - $http[name] = function(url, config) { - return $http(extend({}, config || {}, { - method: name, - url: url - })); - }; - }); - } - - - function createShortMethodsWithData(name) { - forEach(arguments, function(name) { - $http[name] = function(url, data, config) { - return $http(extend({}, config || {}, { - method: name, - url: url, - data: data - })); - }; - }); - } - - - /** - * Makes the request. - * - * !!! ACCESSES CLOSURE VARS: - * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests - */ - function sendReq(config, reqData) { - var deferred = $q.defer(), - promise = deferred.promise, - cache, - cachedResp, - reqHeaders = config.headers, - isJsonp = lowercase(config.method) === 'jsonp', - url = config.url; - - if (isJsonp) { - // JSONP is a pretty sensitive operation where we're allowing a script to have full access to - // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL. - url = $sce.getTrustedResourceUrl(url); - } else if (!isString(url)) { - // If it is not a string then the URL must be a $sce trusted object - url = $sce.valueOf(url); - } - - url = buildUrl(url, config.paramSerializer(config.params)); - - if (isJsonp) { - // Check the url and add the JSONP callback placeholder - url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam); - } - - $http.pendingRequests.push(config); - promise.then(removePendingReq, removePendingReq); - - if ((config.cache || defaults.cache) && config.cache !== false && - (config.method === 'GET' || config.method === 'JSONP')) { - cache = isObject(config.cache) ? config.cache - : isObject(/** @type {?} */ (defaults).cache) - ? /** @type {?} */ (defaults).cache - : defaultCache; - } - - if (cache) { - cachedResp = cache.get(url); - if (isDefined(cachedResp)) { - if (isPromiseLike(cachedResp)) { - // cached request has already been sent, but there is no response yet - cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult); - } else { - // serving from cache - if (isArray(cachedResp)) { - resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]); - } else { - resolvePromise(cachedResp, 200, {}, 'OK', 'complete'); - } - } - } else { - // put the promise for the non-transformed response into cache as a placeholder - cache.put(url, promise); - } - } - - - // if we won't have the response in cache, set the xsrf headers and - // send the request to the backend - if (isUndefined(cachedResp)) { - var xsrfValue = urlIsSameOrigin(config.url) - ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName] - : undefined; - if (xsrfValue) { - reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue; - } - - $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, - config.withCredentials, config.responseType, - createApplyHandlers(config.eventHandlers), - createApplyHandlers(config.uploadEventHandlers)); - } - - return promise; - - function createApplyHandlers(eventHandlers) { - if (eventHandlers) { - var applyHandlers = {}; - forEach(eventHandlers, function(eventHandler, key) { - applyHandlers[key] = function(event) { - if (useApplyAsync) { - $rootScope.$applyAsync(callEventHandler); - } else if ($rootScope.$$phase) { - callEventHandler(); - } else { - $rootScope.$apply(callEventHandler); - } - - function callEventHandler() { - eventHandler(event); - } - }; - }); - return applyHandlers; - } - } - - - /** - * Callback registered to $httpBackend(): - * - caches the response if desired - * - resolves the raw $http promise - * - calls $apply - */ - function done(status, response, headersString, statusText, xhrStatus) { - if (cache) { - if (isSuccess(status)) { - cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]); - } else { - // remove promise from the cache - cache.remove(url); - } - } - - function resolveHttpPromise() { - resolvePromise(response, status, headersString, statusText, xhrStatus); - } - - if (useApplyAsync) { - $rootScope.$applyAsync(resolveHttpPromise); - } else { - resolveHttpPromise(); - if (!$rootScope.$$phase) $rootScope.$apply(); - } - } - - - /** - * Resolves the raw $http promise. - */ - function resolvePromise(response, status, headers, statusText, xhrStatus) { - //status: HTTP response status code, 0, -1 (aborted by timeout / promise) - status = status >= -1 ? status : 0; - - (isSuccess(status) ? deferred.resolve : deferred.reject)({ - data: response, - status: status, - headers: headersGetter(headers), - config: config, - statusText: statusText, - xhrStatus: xhrStatus - }); - } - - function resolvePromiseWithResult(result) { - resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus); - } - - function removePendingReq() { - var idx = $http.pendingRequests.indexOf(config); - if (idx !== -1) $http.pendingRequests.splice(idx, 1); - } - } - - - function buildUrl(url, serializedParams) { - if (serializedParams.length > 0) { - url += ((url.indexOf('?') === -1) ? '?' : '&') + serializedParams; - } - return url; - } - - function sanitizeJsonpCallbackParam(url, cbKey) { - var parts = url.split('?'); - if (parts.length > 2) { - // Throw if the url contains more than one `?` query indicator - throw $httpMinErr('badjsonp', 'Illegal use more than one "?", in url, "{1}"', url); - } - var params = parseKeyValue(parts[1]); - forEach(params, function(value, key) { - if (value === 'JSON_CALLBACK') { - // Throw if the url already contains a reference to JSON_CALLBACK - throw $httpMinErr('badjsonp', 'Illegal use of JSON_CALLBACK in url, "{0}"', url); - } - if (key === cbKey) { - // Throw if the callback param was already provided - throw $httpMinErr('badjsonp', 'Illegal use of callback param, "{0}", in url, "{1}"', cbKey, url); - } - }); - - // Add in the JSON_CALLBACK callback param value - url += ((url.indexOf('?') === -1) ? '?' : '&') + cbKey + '=JSON_CALLBACK'; - - return url; - } - }]; - } - - /** - * @ngdoc service - * @name $xhrFactory - * @this - * - * @description - * Factory function used to create XMLHttpRequest objects. - * - * Replace or decorate this service to create your own custom XMLHttpRequest objects. - * - * ``` - * angular.module('myApp', []) - * .factory('$xhrFactory', function() { - * return function createXhr(method, url) { - * return new window.XMLHttpRequest({mozSystem: true}); - * }; - * }); - * ``` - * - * @param {string} method HTTP method of the request (GET, POST, PUT, ..) - * @param {string} url URL of the request. - */ - function $xhrFactoryProvider() { - this.$get = function() { - return function createXhr() { - return new window.XMLHttpRequest(); - }; - }; - } - - /** - * @ngdoc service - * @name $httpBackend - * @requires $jsonpCallbacks - * @requires $document - * @requires $xhrFactory - * @this - * - * @description - * HTTP backend used by the {@link ng.$http service} that delegates to - * XMLHttpRequest object or JSONP and deals with browser incompatibilities. - * - * You should never need to use this service directly, instead use the higher-level abstractions: - * {@link ng.$http $http} or {@link ngResource.$resource $resource}. - * - * During testing this implementation is swapped with {@link ngMock.$httpBackend mock - * $httpBackend} which can be trained with responses. - */ - function $HttpBackendProvider() { - this.$get = ['$browser', '$jsonpCallbacks', '$document', '$xhrFactory', function($browser, $jsonpCallbacks, $document, $xhrFactory) { - return createHttpBackend($browser, $xhrFactory, $browser.defer, $jsonpCallbacks, $document[0]); - }]; - } - - function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) { - // TODO(vojta): fix the signature - return function(method, url, post, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) { - url = url || $browser.url(); - - if (lowercase(method) === 'jsonp') { - var callbackPath = callbacks.createCallback(url); - var jsonpDone = jsonpReq(url, callbackPath, function(status, text) { - // jsonpReq only ever sets status to 200 (OK), 404 (ERROR) or -1 (WAITING) - var response = (status === 200) && callbacks.getResponse(callbackPath); - completeRequest(callback, status, response, '', text, 'complete'); - callbacks.removeCallback(callbackPath); - }); - } else { - - var xhr = createXhr(method, url); - - xhr.open(method, url, true); - forEach(headers, function(value, key) { - if (isDefined(value)) { - xhr.setRequestHeader(key, value); - } - }); - - xhr.onload = function requestLoaded() { - var statusText = xhr.statusText || ''; - - // responseText is the old-school way of retrieving response (supported by IE9) - // response/responseType properties were introduced in XHR Level2 spec (supported by IE10) - var response = ('response' in xhr) ? xhr.response : xhr.responseText; - - // normalize IE9 bug (http://bugs.jquery.com/ticket/1450) - var status = xhr.status === 1223 ? 204 : xhr.status; - - // fix status code when it is 0 (0 status is undocumented). - // Occurs when accessing file resources or on Android 4.1 stock browser - // while retrieving files from application cache. - if (status === 0) { - status = response ? 200 : urlResolve(url).protocol === 'file' ? 404 : 0; - } - - completeRequest(callback, - status, - response, - xhr.getAllResponseHeaders(), - statusText, - 'complete'); - }; - - var requestError = function() { - // The response is always empty - // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error - completeRequest(callback, -1, null, null, '', 'error'); - }; - - var requestAborted = function() { - completeRequest(callback, -1, null, null, '', 'abort'); - }; - - var requestTimeout = function() { - // The response is always empty - // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error - completeRequest(callback, -1, null, null, '', 'timeout'); - }; - - xhr.onerror = requestError; - xhr.onabort = requestAborted; - xhr.ontimeout = requestTimeout; - - forEach(eventHandlers, function(value, key) { - xhr.addEventListener(key, value); - }); - - forEach(uploadEventHandlers, function(value, key) { - xhr.upload.addEventListener(key, value); - }); - - if (withCredentials) { - xhr.withCredentials = true; - } - - if (responseType) { - try { - xhr.responseType = responseType; - } catch (e) { - // WebKit added support for the json responseType value on 09/03/2013 - // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are - // known to throw when setting the value "json" as the response type. Other older - // browsers implementing the responseType - // - // The json response type can be ignored if not supported, because JSON payloads are - // parsed on the client-side regardless. - if (responseType !== 'json') { - throw e; - } - } - } - - xhr.send(isUndefined(post) ? null : post); - } - - if (timeout > 0) { - var timeoutId = $browserDefer(timeoutRequest, timeout); - } else if (isPromiseLike(timeout)) { - timeout.then(timeoutRequest); - } - - - function timeoutRequest() { - if (jsonpDone) { - jsonpDone(); - } - if (xhr) { - xhr.abort(); - } - } - - function completeRequest(callback, status, response, headersString, statusText, xhrStatus) { - // cancel timeout and subsequent timeout promise resolution - if (isDefined(timeoutId)) { - $browserDefer.cancel(timeoutId); - } - jsonpDone = xhr = null; - - callback(status, response, headersString, statusText, xhrStatus); - } - }; - - function jsonpReq(url, callbackPath, done) { - url = url.replace('JSON_CALLBACK', callbackPath); - // we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.: - // - fetches local scripts via XHR and evals them - // - adds and immediately removes script elements from the document - var script = rawDocument.createElement('script'), callback = null; - script.type = 'text/javascript'; - script.src = url; - script.async = true; - - callback = function(event) { - script.removeEventListener('load', callback); - script.removeEventListener('error', callback); - rawDocument.body.removeChild(script); - script = null; - var status = -1; - var text = 'unknown'; - - if (event) { - if (event.type === 'load' && !callbacks.wasCalled(callbackPath)) { - event = { type: 'error' }; - } - text = event.type; - status = event.type === 'error' ? 404 : 200; - } - - if (done) { - done(status, text); - } - }; - - script.addEventListener('load', callback); - script.addEventListener('error', callback); - rawDocument.body.appendChild(script); - return callback; - } - } - - var $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate'); - $interpolateMinErr.throwNoconcat = function(text) { - throw $interpolateMinErr('noconcat', - 'Error while interpolating: {0}\nStrict Contextual Escaping disallows ' + - 'interpolations that concatenate multiple expressions when a trusted value is ' + - 'required. See http://docs.angularjs.org/api/ng.$sce', text); - }; - - $interpolateMinErr.interr = function(text, err) { - return $interpolateMinErr('interr', 'Can\'t interpolate: {0}\n{1}', text, err.toString()); - }; - - /** - * @ngdoc provider - * @name $interpolateProvider - * @this - * - * @description - * - * Used for configuring the interpolation markup. Defaults to `{{` and `}}`. - * - * <div class="alert alert-danger"> - * This feature is sometimes used to mix different markup languages, e.g. to wrap an AngularJS - * template within a Python Jinja template (or any other template language). Mixing templating - * languages is **very dangerous**. The embedding template language will not safely escape AngularJS - * expressions, so any user-controlled values in the template will cause Cross Site Scripting (XSS) - * security bugs! - * </div> - * - * @example - <example name="custom-interpolation-markup" module="customInterpolationApp"> - <file name="index.html"> - <script> - var customInterpolationApp = angular.module('customInterpolationApp', []); - - customInterpolationApp.config(function($interpolateProvider) { - $interpolateProvider.startSymbol('//'); - $interpolateProvider.endSymbol('//'); - }); - - - customInterpolationApp.controller('DemoController', function() { - this.label = "This binding is brought you by // interpolation symbols."; - }); - </script> - <div ng-controller="DemoController as demo"> - //demo.label// - </div> - </file> - <file name="protractor.js" type="protractor"> - it('should interpolate binding with custom symbols', function() { - expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.'); - }); - </file> - </example> - */ - function $InterpolateProvider() { - var startSymbol = '{{'; - var endSymbol = '}}'; - - /** - * @ngdoc method - * @name $interpolateProvider#startSymbol - * @description - * Symbol to denote start of expression in the interpolated string. Defaults to `{{`. - * - * @param {string=} value new value to set the starting symbol to. - * @returns {string|self} Returns the symbol when used as getter and self if used as setter. - */ - this.startSymbol = function(value) { - if (value) { - startSymbol = value; - return this; - } else { - return startSymbol; - } - }; - - /** - * @ngdoc method - * @name $interpolateProvider#endSymbol - * @description - * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. - * - * @param {string=} value new value to set the ending symbol to. - * @returns {string|self} Returns the symbol when used as getter and self if used as setter. - */ - this.endSymbol = function(value) { - if (value) { - endSymbol = value; - return this; - } else { - return endSymbol; - } - }; - - - this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) { - var startSymbolLength = startSymbol.length, - endSymbolLength = endSymbol.length, - escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'), - escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g'); - - function escape(ch) { - return '\\\\\\' + ch; - } - - function unescapeText(text) { - return text.replace(escapedStartRegexp, startSymbol). - replace(escapedEndRegexp, endSymbol); - } - - // TODO: this is the same as the constantWatchDelegate in parse.js - function constantWatchDelegate(scope, listener, objectEquality, constantInterp) { - var unwatch = scope.$watch(function constantInterpolateWatch(scope) { - unwatch(); - return constantInterp(scope); - }, listener, objectEquality); - return unwatch; - } - - /** - * @ngdoc service - * @name $interpolate - * @kind function - * - * @requires $parse - * @requires $sce - * - * @description - * - * Compiles a string with markup into an interpolation function. This service is used by the - * HTML {@link ng.$compile $compile} service for data binding. See - * {@link ng.$interpolateProvider $interpolateProvider} for configuring the - * interpolation markup. - * - * - * ```js - * var $interpolate = ...; // injected - * var exp = $interpolate('Hello {{name | uppercase}}!'); - * expect(exp({name:'AngularJS'})).toEqual('Hello ANGULAR!'); - * ``` - * - * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is - * `true`, the interpolation function will return `undefined` unless all embedded expressions - * evaluate to a value other than `undefined`. - * - * ```js - * var $interpolate = ...; // injected - * var context = {greeting: 'Hello', name: undefined }; - * - * // default "forgiving" mode - * var exp = $interpolate('{{greeting}} {{name}}!'); - * expect(exp(context)).toEqual('Hello !'); - * - * // "allOrNothing" mode - * exp = $interpolate('{{greeting}} {{name}}!', false, null, true); - * expect(exp(context)).toBeUndefined(); - * context.name = 'AngularJS'; - * expect(exp(context)).toEqual('Hello AngularJS!'); - * ``` - * - * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior. - * - * #### Escaped Interpolation - * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers - * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash). - * It will be rendered as a regular start/end marker, and will not be interpreted as an expression - * or binding. - * - * This enables web-servers to prevent script injection attacks and defacing attacks, to some - * degree, while also enabling code examples to work without relying on the - * {@link ng.directive:ngNonBindable ngNonBindable} directive. - * - * **For security purposes, it is strongly encouraged that web servers escape user-supplied data, - * replacing angle brackets (<, >) with &lt; and &gt; respectively, and replacing all - * interpolation start/end markers with their escaped counterparts.** - * - * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered - * output when the $interpolate service processes the text. So, for HTML elements interpolated - * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter - * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such, - * this is typically useful only when user-data is used in rendering a template from the server, or - * when otherwise untrusted data is used by a directive. - * - * <example name="interpolation"> - * <file name="index.html"> - * <div ng-init="username='A user'"> - * <p ng-init="apptitle='Escaping demo'">{{apptitle}}: \{\{ username = "defaced value"; \}\} - * </p> - * <p><strong>{{username}}</strong> attempts to inject code which will deface the - * application, but fails to accomplish their task, because the server has correctly - * escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash) - * characters.</p> - * <p>Instead, the result of the attempted script injection is visible, and can be removed - * from the database by an administrator.</p> - * </div> - * </file> - * </example> - * - * @knownIssue - * It is currently not possible for an interpolated expression to contain the interpolation end - * symbol. For example, `{{ '}}' }}` will be incorrectly interpreted as `{{ ' }}` + `' }}`, i.e. - * an interpolated expression consisting of a single-quote (`'`) and the `' }}` string. - * - * @knownIssue - * All directives and components must use the standard `{{` `}}` interpolation symbols - * in their templates. If you change the application interpolation symbols the {@link $compile} - * service will attempt to denormalize the standard symbols to the custom symbols. - * The denormalization process is not clever enough to know not to replace instances of the standard - * symbols where they would not normally be treated as interpolation symbols. For example in the following - * code snippet the closing braces of the literal object will get incorrectly denormalized: - * - * ``` - * <div data-context='{"context":{"id":3,"type":"page"}}"> - * ``` - * - * The workaround is to ensure that such instances are separated by whitespace: - * ``` - * <div data-context='{"context":{"id":3,"type":"page"} }"> - * ``` - * - * See https://github.com/angular/angular.js/pull/14610#issuecomment-219401099 for more information. - * - * @param {string} text The text with markup to interpolate. - * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have - * embedded expression in order to return an interpolation function. Strings with no - * embedded expression will return null for the interpolation function. - * @param {string=} trustedContext when provided, the returned function passes the interpolated - * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult, - * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that - * provides Strict Contextual Escaping for details. - * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined - * unless all embedded expressions evaluate to a value other than `undefined`. - * @returns {function(context)} an interpolation function which is used to compute the - * interpolated string. The function has these parameters: - * - * - `context`: evaluation context for all expressions embedded in the interpolated text - */ - function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) { - // Provide a quick exit and simplified result function for text with no interpolation - if (!text.length || text.indexOf(startSymbol) === -1) { - var constantInterp; - if (!mustHaveExpression) { - var unescapedText = unescapeText(text); - constantInterp = valueFn(unescapedText); - constantInterp.exp = text; - constantInterp.expressions = []; - constantInterp.$$watchDelegate = constantWatchDelegate; - } - return constantInterp; - } - - allOrNothing = !!allOrNothing; - var startIndex, - endIndex, - index = 0, - expressions = [], - parseFns = [], - textLength = text.length, - exp, - concat = [], - expressionPositions = []; - - while (index < textLength) { - if (((startIndex = text.indexOf(startSymbol, index)) !== -1) && - ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) !== -1)) { - if (index !== startIndex) { - concat.push(unescapeText(text.substring(index, startIndex))); - } - exp = text.substring(startIndex + startSymbolLength, endIndex); - expressions.push(exp); - parseFns.push($parse(exp, parseStringifyInterceptor)); - index = endIndex + endSymbolLength; - expressionPositions.push(concat.length); - concat.push(''); - } else { - // we did not find an interpolation, so we have to add the remainder to the separators array - if (index !== textLength) { - concat.push(unescapeText(text.substring(index))); - } - break; - } - } - - // Concatenating expressions makes it hard to reason about whether some combination of - // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a - // single expression be used for iframe[src], object[src], etc., we ensure that the value - // that's used is assigned or constructed by some JS code somewhere that is more testable or - // make it obvious that you bound the value to some user controlled value. This helps reduce - // the load when auditing for XSS issues. - if (trustedContext && concat.length > 1) { - $interpolateMinErr.throwNoconcat(text); - } - - if (!mustHaveExpression || expressions.length) { - var compute = function(values) { - for (var i = 0, ii = expressions.length; i < ii; i++) { - if (allOrNothing && isUndefined(values[i])) return; - concat[expressionPositions[i]] = values[i]; - } - return concat.join(''); - }; - - var getValue = function(value) { - return trustedContext ? - $sce.getTrusted(trustedContext, value) : - $sce.valueOf(value); - }; - - return extend(function interpolationFn(context) { - var i = 0; - var ii = expressions.length; - var values = new Array(ii); - - try { - for (; i < ii; i++) { - values[i] = parseFns[i](context); - } - - return compute(values); - } catch (err) { - $exceptionHandler($interpolateMinErr.interr(text, err)); - } - - }, { - // all of these properties are undocumented for now - exp: text, //just for compatibility with regular watchers created via $watch - expressions: expressions, - $$watchDelegate: function(scope, listener) { - var lastValue; - return scope.$watchGroup(parseFns, /** @this */ function interpolateFnWatcher(values, oldValues) { - var currValue = compute(values); - listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope); - lastValue = currValue; - }); - } - }); - } - - function parseStringifyInterceptor(value) { - try { - value = getValue(value); - return allOrNothing && !isDefined(value) ? value : stringify(value); - } catch (err) { - $exceptionHandler($interpolateMinErr.interr(text, err)); - } - } - } - - - /** - * @ngdoc method - * @name $interpolate#startSymbol - * @description - * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`. - * - * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change - * the symbol. - * - * @returns {string} start symbol. - */ - $interpolate.startSymbol = function() { - return startSymbol; - }; - - - /** - * @ngdoc method - * @name $interpolate#endSymbol - * @description - * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. - * - * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change - * the symbol. - * - * @returns {string} end symbol. - */ - $interpolate.endSymbol = function() { - return endSymbol; - }; - - return $interpolate; - }]; - } - - /** @this */ - function $IntervalProvider() { - this.$get = ['$rootScope', '$window', '$q', '$$q', '$browser', - function($rootScope, $window, $q, $$q, $browser) { - var intervals = {}; - - - /** - * @ngdoc service - * @name $interval - * - * @description - * AngularJS's wrapper for `window.setInterval`. The `fn` function is executed every `delay` - * milliseconds. - * - * The return value of registering an interval function is a promise. This promise will be - * notified upon each tick of the interval, and will be resolved after `count` iterations, or - * run indefinitely if `count` is not defined. The value of the notification will be the - * number of iterations that have run. - * To cancel an interval, call `$interval.cancel(promise)`. - * - * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to - * move forward by `millis` milliseconds and trigger any functions scheduled to run in that - * time. - * - * <div class="alert alert-warning"> - * **Note**: Intervals created by this service must be explicitly destroyed when you are finished - * with them. In particular they are not automatically destroyed when a controller's scope or a - * directive's element are destroyed. - * You should take this into consideration and make sure to always cancel the interval at the - * appropriate moment. See the example below for more details on how and when to do this. - * </div> - * - * @param {function()} fn A function that should be called repeatedly. If no additional arguments - * are passed (see below), the function is called with the current iteration count. - * @param {number} delay Number of milliseconds between each function call. - * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat - * indefinitely. - * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise - * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. - * @param {...*=} Pass additional parameters to the executed function. - * @returns {promise} A promise which will be notified on each iteration. It will resolve once all iterations of the interval complete. - * - * @example - * <example module="intervalExample" name="interval-service"> - * <file name="index.html"> - * <script> - * angular.module('intervalExample', []) - * .controller('ExampleController', ['$scope', '$interval', - * function($scope, $interval) { - * $scope.format = 'M/d/yy h:mm:ss a'; - * $scope.blood_1 = 100; - * $scope.blood_2 = 120; - * - * var stop; - * $scope.fight = function() { - * // Don't start a new fight if we are already fighting - * if ( angular.isDefined(stop) ) return; - * - * stop = $interval(function() { - * if ($scope.blood_1 > 0 && $scope.blood_2 > 0) { - * $scope.blood_1 = $scope.blood_1 - 3; - * $scope.blood_2 = $scope.blood_2 - 4; - * } else { - * $scope.stopFight(); - * } - * }, 100); - * }; - * - * $scope.stopFight = function() { - * if (angular.isDefined(stop)) { - * $interval.cancel(stop); - * stop = undefined; - * } - * }; - * - * $scope.resetFight = function() { - * $scope.blood_1 = 100; - * $scope.blood_2 = 120; - * }; - * - * $scope.$on('$destroy', function() { - * // Make sure that the interval is destroyed too - * $scope.stopFight(); - * }); - * }]) - * // Register the 'myCurrentTime' directive factory method. - * // We inject $interval and dateFilter service since the factory method is DI. - * .directive('myCurrentTime', ['$interval', 'dateFilter', - * function($interval, dateFilter) { - * // return the directive link function. (compile function not needed) - * return function(scope, element, attrs) { - * var format, // date format - * stopTime; // so that we can cancel the time updates - * - * // used to update the UI - * function updateTime() { - * element.text(dateFilter(new Date(), format)); - * } - * - * // watch the expression, and update the UI on change. - * scope.$watch(attrs.myCurrentTime, function(value) { - * format = value; - * updateTime(); - * }); - * - * stopTime = $interval(updateTime, 1000); - * - * // listen on DOM destroy (removal) event, and cancel the next UI update - * // to prevent updating time after the DOM element was removed. - * element.on('$destroy', function() { - * $interval.cancel(stopTime); - * }); - * } - * }]); - * </script> - * - * <div> - * <div ng-controller="ExampleController"> - * <label>Date format: <input ng-model="format"></label> <hr/> - * Current time is: <span my-current-time="format"></span> - * <hr/> - * Blood 1 : <font color='red'>{{blood_1}}</font> - * Blood 2 : <font color='red'>{{blood_2}}</font> - * <button type="button" data-ng-click="fight()">Fight</button> - * <button type="button" data-ng-click="stopFight()">StopFight</button> - * <button type="button" data-ng-click="resetFight()">resetFight</button> - * </div> - * </div> - * - * </file> - * </example> - */ - function interval(fn, delay, count, invokeApply) { - var hasParams = arguments.length > 4, - args = hasParams ? sliceArgs(arguments, 4) : [], - setInterval = $window.setInterval, - clearInterval = $window.clearInterval, - iteration = 0, - skipApply = (isDefined(invokeApply) && !invokeApply), - deferred = (skipApply ? $$q : $q).defer(), - promise = deferred.promise; - - count = isDefined(count) ? count : 0; - - promise.$$intervalId = setInterval(function tick() { - if (skipApply) { - $browser.defer(callback); - } else { - $rootScope.$evalAsync(callback); - } - deferred.notify(iteration++); - - if (count > 0 && iteration >= count) { - deferred.resolve(iteration); - clearInterval(promise.$$intervalId); - delete intervals[promise.$$intervalId]; - } - - if (!skipApply) $rootScope.$apply(); - - }, delay); - - intervals[promise.$$intervalId] = deferred; - - return promise; - - function callback() { - if (!hasParams) { - fn(iteration); - } else { - fn.apply(null, args); - } - } - } - - - /** - * @ngdoc method - * @name $interval#cancel - * - * @description - * Cancels a task associated with the `promise`. - * - * @param {Promise=} promise returned by the `$interval` function. - * @returns {boolean} Returns `true` if the task was successfully canceled. - */ - interval.cancel = function(promise) { - if (promise && promise.$$intervalId in intervals) { - // Interval cancels should not report as unhandled promise. - markQExceptionHandled(intervals[promise.$$intervalId].promise); - intervals[promise.$$intervalId].reject('canceled'); - $window.clearInterval(promise.$$intervalId); - delete intervals[promise.$$intervalId]; - return true; - } - return false; - }; - - return interval; - }]; - } - - /** - * @ngdoc service - * @name $jsonpCallbacks - * @requires $window - * @description - * This service handles the lifecycle of callbacks to handle JSONP requests. - * Override this service if you wish to customise where the callbacks are stored and - * how they vary compared to the requested url. - */ - var $jsonpCallbacksProvider = /** @this */ function() { - this.$get = function() { - var callbacks = angular.callbacks; - var callbackMap = {}; - - function createCallback(callbackId) { - var callback = function(data) { - callback.data = data; - callback.called = true; - }; - callback.id = callbackId; - return callback; - } - - return { - /** - * @ngdoc method - * @name $jsonpCallbacks#createCallback - * @param {string} url the url of the JSONP request - * @returns {string} the callback path to send to the server as part of the JSONP request - * @description - * {@link $httpBackend} calls this method to create a callback and get hold of the path to the callback - * to pass to the server, which will be used to call the callback with its payload in the JSONP response. - */ - createCallback: function(url) { - var callbackId = '_' + (callbacks.$$counter++).toString(36); - var callbackPath = 'angular.callbacks.' + callbackId; - var callback = createCallback(callbackId); - callbackMap[callbackPath] = callbacks[callbackId] = callback; - return callbackPath; - }, - /** - * @ngdoc method - * @name $jsonpCallbacks#wasCalled - * @param {string} callbackPath the path to the callback that was sent in the JSONP request - * @returns {boolean} whether the callback has been called, as a result of the JSONP response - * @description - * {@link $httpBackend} calls this method to find out whether the JSONP response actually called the - * callback that was passed in the request. - */ - wasCalled: function(callbackPath) { - return callbackMap[callbackPath].called; - }, - /** - * @ngdoc method - * @name $jsonpCallbacks#getResponse - * @param {string} callbackPath the path to the callback that was sent in the JSONP request - * @returns {*} the data received from the response via the registered callback - * @description - * {@link $httpBackend} calls this method to get hold of the data that was provided to the callback - * in the JSONP response. - */ - getResponse: function(callbackPath) { - return callbackMap[callbackPath].data; - }, - /** - * @ngdoc method - * @name $jsonpCallbacks#removeCallback - * @param {string} callbackPath the path to the callback that was sent in the JSONP request - * @description - * {@link $httpBackend} calls this method to remove the callback after the JSONP request has - * completed or timed-out. - */ - removeCallback: function(callbackPath) { - var callback = callbackMap[callbackPath]; - delete callbacks[callback.id]; - delete callbackMap[callbackPath]; - } - }; - }; - }; - - /** - * @ngdoc service - * @name $locale - * - * @description - * $locale service provides localization rules for various AngularJS components. As of right now the - * only public api is: - * - * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`) - */ - - var PATH_MATCH = /^([^?#]*)(\?([^#]*))?(#(.*))?$/, - DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21}; - var $locationMinErr = minErr('$location'); - - - /** - * Encode path using encodeUriSegment, ignoring forward slashes - * - * @param {string} path Path to encode - * @returns {string} - */ - function encodePath(path) { - var segments = path.split('/'), - i = segments.length; - - while (i--) { - // decode forward slashes to prevent them from being double encoded - segments[i] = encodeUriSegment(segments[i].replace(/%2F/g, '/')); - } - - return segments.join('/'); - } - - function decodePath(path, html5Mode) { - var segments = path.split('/'), - i = segments.length; - - while (i--) { - segments[i] = decodeURIComponent(segments[i]); - if (html5Mode) { - // encode forward slashes to prevent them from being mistaken for path separators - segments[i] = segments[i].replace(/\//g, '%2F'); - } - } - - return segments.join('/'); - } - - function parseAbsoluteUrl(absoluteUrl, locationObj) { - var parsedUrl = urlResolve(absoluteUrl); - - locationObj.$$protocol = parsedUrl.protocol; - locationObj.$$host = parsedUrl.hostname; - locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; - } - - var DOUBLE_SLASH_REGEX = /^\s*[\\/]{2,}/; - function parseAppUrl(url, locationObj, html5Mode) { - - if (DOUBLE_SLASH_REGEX.test(url)) { - throw $locationMinErr('badpath', 'Invalid url "{0}".', url); - } - - var prefixed = (url.charAt(0) !== '/'); - if (prefixed) { - url = '/' + url; - } - var match = urlResolve(url); - var path = prefixed && match.pathname.charAt(0) === '/' ? match.pathname.substring(1) : match.pathname; - locationObj.$$path = decodePath(path, html5Mode); - locationObj.$$search = parseKeyValue(match.search); - locationObj.$$hash = decodeURIComponent(match.hash); - - // make sure path starts with '/'; - if (locationObj.$$path && locationObj.$$path.charAt(0) !== '/') { - locationObj.$$path = '/' + locationObj.$$path; - } - } - - function startsWith(str, search) { - return str.slice(0, search.length) === search; - } - - /** - * - * @param {string} base - * @param {string} url - * @returns {string} returns text from `url` after `base` or `undefined` if it does not begin with - * the expected string. - */ - function stripBaseUrl(base, url) { - if (startsWith(url, base)) { - return url.substr(base.length); - } - } - - - function stripHash(url) { - var index = url.indexOf('#'); - return index === -1 ? url : url.substr(0, index); - } - - function trimEmptyHash(url) { - return url.replace(/(#.+)|#$/, '$1'); - } - - - function stripFile(url) { - return url.substr(0, stripHash(url).lastIndexOf('/') + 1); - } - - /* return the server only (scheme://host:port) */ - function serverBase(url) { - return url.substring(0, url.indexOf('/', url.indexOf('//') + 2)); - } - - - /** - * LocationHtml5Url represents a URL - * This object is exposed as $location service when HTML5 mode is enabled and supported - * - * @constructor - * @param {string} appBase application base URL - * @param {string} appBaseNoFile application base URL stripped of any filename - * @param {string} basePrefix URL path prefix - */ - function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) { - this.$$html5 = true; - basePrefix = basePrefix || ''; - parseAbsoluteUrl(appBase, this); - - - /** - * Parse given HTML5 (regular) URL string into properties - * @param {string} url HTML5 URL - * @private - */ - this.$$parse = function(url) { - var pathUrl = stripBaseUrl(appBaseNoFile, url); - if (!isString(pathUrl)) { - throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url, - appBaseNoFile); - } - - parseAppUrl(pathUrl, this, true); - - if (!this.$$path) { - this.$$path = '/'; - } - - this.$$compose(); - }; - - /** - * Compose url and update `absUrl` property - * @private - */ - this.$$compose = function() { - var search = toKeyValue(this.$$search), - hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; - - this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; - this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/' - - this.$$urlUpdatedByLocation = true; - }; - - this.$$parseLinkUrl = function(url, relHref) { - if (relHref && relHref[0] === '#') { - // special case for links to hash fragments: - // keep the old url and only replace the hash fragment - this.hash(relHref.slice(1)); - return true; - } - var appUrl, prevAppUrl; - var rewrittenUrl; - - - if (isDefined(appUrl = stripBaseUrl(appBase, url))) { - prevAppUrl = appUrl; - if (basePrefix && isDefined(appUrl = stripBaseUrl(basePrefix, appUrl))) { - rewrittenUrl = appBaseNoFile + (stripBaseUrl('/', appUrl) || appUrl); - } else { - rewrittenUrl = appBase + prevAppUrl; - } - } else if (isDefined(appUrl = stripBaseUrl(appBaseNoFile, url))) { - rewrittenUrl = appBaseNoFile + appUrl; - } else if (appBaseNoFile === url + '/') { - rewrittenUrl = appBaseNoFile; - } - if (rewrittenUrl) { - this.$$parse(rewrittenUrl); - } - return !!rewrittenUrl; - }; - } - - - /** - * LocationHashbangUrl represents URL - * This object is exposed as $location service when developer doesn't opt into html5 mode. - * It also serves as the base class for html5 mode fallback on legacy browsers. - * - * @constructor - * @param {string} appBase application base URL - * @param {string} appBaseNoFile application base URL stripped of any filename - * @param {string} hashPrefix hashbang prefix - */ - function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) { - - parseAbsoluteUrl(appBase, this); - - - /** - * Parse given hashbang URL into properties - * @param {string} url Hashbang URL - * @private - */ - this.$$parse = function(url) { - var withoutBaseUrl = stripBaseUrl(appBase, url) || stripBaseUrl(appBaseNoFile, url); - var withoutHashUrl; - - if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') { - - // The rest of the URL starts with a hash so we have - // got either a hashbang path or a plain hash fragment - withoutHashUrl = stripBaseUrl(hashPrefix, withoutBaseUrl); - if (isUndefined(withoutHashUrl)) { - // There was no hashbang prefix so we just have a hash fragment - withoutHashUrl = withoutBaseUrl; - } - - } else { - // There was no hashbang path nor hash fragment: - // If we are in HTML5 mode we use what is left as the path; - // Otherwise we ignore what is left - if (this.$$html5) { - withoutHashUrl = withoutBaseUrl; - } else { - withoutHashUrl = ''; - if (isUndefined(withoutBaseUrl)) { - appBase = url; - /** @type {?} */ (this).replace(); - } - } - } - - parseAppUrl(withoutHashUrl, this, false); - - this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase); - - this.$$compose(); - - /* - * In Windows, on an anchor node on documents loaded from - * the filesystem, the browser will return a pathname - * prefixed with the drive name ('/C:/path') when a - * pathname without a drive is set: - * * a.setAttribute('href', '/foo') - * * a.pathname === '/C:/foo' //true - * - * Inside of AngularJS, we're always using pathnames that - * do not include drive names for routing. - */ - function removeWindowsDriveName(path, url, base) { - /* - Matches paths for file protocol on windows, - such as /C:/foo/bar, and captures only /foo/bar. - */ - var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; - - var firstPathSegmentMatch; - - //Get the relative path from the input URL. - if (startsWith(url, base)) { - url = url.replace(base, ''); - } - - // The input URL intentionally contains a first path segment that ends with a colon. - if (windowsFilePathExp.exec(url)) { - return path; - } - - firstPathSegmentMatch = windowsFilePathExp.exec(path); - return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; - } - }; - - /** - * Compose hashbang URL and update `absUrl` property - * @private - */ - this.$$compose = function() { - var search = toKeyValue(this.$$search), - hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; - - this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; - this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : ''); - - this.$$urlUpdatedByLocation = true; - }; - - this.$$parseLinkUrl = function(url, relHref) { - if (stripHash(appBase) === stripHash(url)) { - this.$$parse(url); - return true; - } - return false; - }; - } - - - /** - * LocationHashbangUrl represents URL - * This object is exposed as $location service when html5 history api is enabled but the browser - * does not support it. - * - * @constructor - * @param {string} appBase application base URL - * @param {string} appBaseNoFile application base URL stripped of any filename - * @param {string} hashPrefix hashbang prefix - */ - function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) { - this.$$html5 = true; - LocationHashbangUrl.apply(this, arguments); - - this.$$parseLinkUrl = function(url, relHref) { - if (relHref && relHref[0] === '#') { - // special case for links to hash fragments: - // keep the old url and only replace the hash fragment - this.hash(relHref.slice(1)); - return true; - } - - var rewrittenUrl; - var appUrl; - - if (appBase === stripHash(url)) { - rewrittenUrl = url; - } else if ((appUrl = stripBaseUrl(appBaseNoFile, url))) { - rewrittenUrl = appBase + hashPrefix + appUrl; - } else if (appBaseNoFile === url + '/') { - rewrittenUrl = appBaseNoFile; - } - if (rewrittenUrl) { - this.$$parse(rewrittenUrl); - } - return !!rewrittenUrl; - }; - - this.$$compose = function() { - var search = toKeyValue(this.$$search), - hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; - - this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; - // include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#' - this.$$absUrl = appBase + hashPrefix + this.$$url; - - this.$$urlUpdatedByLocation = true; - }; - - } - - - var locationPrototype = { - - /** - * Ensure absolute URL is initialized. - * @private - */ - $$absUrl:'', - - /** - * Are we in html5 mode? - * @private - */ - $$html5: false, - - /** - * Has any change been replacing? - * @private - */ - $$replace: false, - - /** - * @ngdoc method - * @name $location#absUrl - * - * @description - * This method is getter only. - * - * Return full URL representation with all segments encoded according to rules specified in - * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt). - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var absUrl = $location.absUrl(); - * // => "http://example.com/#/some/path?foo=bar&baz=xoxo" - * ``` - * - * @return {string} full URL - */ - absUrl: locationGetter('$$absUrl'), - - /** - * @ngdoc method - * @name $location#url - * - * @description - * This method is getter / setter. - * - * Return URL (e.g. `/path?a=b#hash`) when called without any parameter. - * - * Change path, search and hash, when called with parameter and return `$location`. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var url = $location.url(); - * // => "/some/path?foo=bar&baz=xoxo" - * ``` - * - * @param {string=} url New URL without base prefix (e.g. `/path?a=b#hash`) - * @return {string} url - */ - url: function(url) { - if (isUndefined(url)) { - return this.$$url; - } - - var match = PATH_MATCH.exec(url); - if (match[1] || url === '') this.path(decodeURIComponent(match[1])); - if (match[2] || match[1] || url === '') this.search(match[3] || ''); - this.hash(match[5] || ''); - - return this; - }, - - /** - * @ngdoc method - * @name $location#protocol - * - * @description - * This method is getter only. - * - * Return protocol of current URL. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var protocol = $location.protocol(); - * // => "http" - * ``` - * - * @return {string} protocol of current URL - */ - protocol: locationGetter('$$protocol'), - - /** - * @ngdoc method - * @name $location#host - * - * @description - * This method is getter only. - * - * Return host of current URL. - * - * Note: compared to the non-AngularJS version `location.host` which returns `hostname:port`, this returns the `hostname` portion only. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var host = $location.host(); - * // => "example.com" - * - * // given URL http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo - * host = $location.host(); - * // => "example.com" - * host = location.host; - * // => "example.com:8080" - * ``` - * - * @return {string} host of current URL. - */ - host: locationGetter('$$host'), - - /** - * @ngdoc method - * @name $location#port - * - * @description - * This method is getter only. - * - * Return port of current URL. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var port = $location.port(); - * // => 80 - * ``` - * - * @return {Number} port - */ - port: locationGetter('$$port'), - - /** - * @ngdoc method - * @name $location#path - * - * @description - * This method is getter / setter. - * - * Return path of current URL when called without any parameter. - * - * Change path when called with parameter and return `$location`. - * - * Note: Path should always begin with forward slash (/), this method will add the forward slash - * if it is missing. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var path = $location.path(); - * // => "/some/path" - * ``` - * - * @param {(string|number)=} path New path - * @return {(string|object)} path if called with no parameters, or `$location` if called with a parameter - */ - path: locationGetterSetter('$$path', function(path) { - path = path !== null ? path.toString() : ''; - return path.charAt(0) === '/' ? path : '/' + path; - }), - - /** - * @ngdoc method - * @name $location#search - * - * @description - * This method is getter / setter. - * - * Return search part (as object) of current URL when called without any parameter. - * - * Change search part when called with parameter and return `$location`. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo - * var searchObject = $location.search(); - * // => {foo: 'bar', baz: 'xoxo'} - * - * // set foo to 'yipee' - * $location.search('foo', 'yipee'); - * // $location.search() => {foo: 'yipee', baz: 'xoxo'} - * ``` - * - * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or - * hash object. - * - * When called with a single argument the method acts as a setter, setting the `search` component - * of `$location` to the specified value. - * - * If the argument is a hash object containing an array of values, these values will be encoded - * as duplicate search parameters in the URL. - * - * @param {(string|Number|Array<string>|boolean)=} paramValue If `search` is a string or number, then `paramValue` - * will override only a single search property. - * - * If `paramValue` is an array, it will override the property of the `search` component of - * `$location` specified via the first argument. - * - * If `paramValue` is `null`, the property specified via the first argument will be deleted. - * - * If `paramValue` is `true`, the property specified via the first argument will be added with no - * value nor trailing equal sign. - * - * @return {Object} If called with no arguments returns the parsed `search` object. If called with - * one or more arguments returns `$location` object itself. - */ - search: function(search, paramValue) { - switch (arguments.length) { - case 0: - return this.$$search; - case 1: - if (isString(search) || isNumber(search)) { - search = search.toString(); - this.$$search = parseKeyValue(search); - } else if (isObject(search)) { - search = copy(search, {}); - // remove object undefined or null properties - forEach(search, function(value, key) { - if (value == null) delete search[key]; - }); - - this.$$search = search; - } else { - throw $locationMinErr('isrcharg', - 'The first argument of the `$location#search()` call must be a string or an object.'); - } - break; - default: - if (isUndefined(paramValue) || paramValue === null) { - delete this.$$search[search]; - } else { - this.$$search[search] = paramValue; - } - } - - this.$$compose(); - return this; - }, - - /** - * @ngdoc method - * @name $location#hash - * - * @description - * This method is getter / setter. - * - * Returns the hash fragment when called without any parameters. - * - * Changes the hash fragment when called with a parameter and returns `$location`. - * - * - * ```js - * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue - * var hash = $location.hash(); - * // => "hashValue" - * ``` - * - * @param {(string|number)=} hash New hash fragment - * @return {string} hash - */ - hash: locationGetterSetter('$$hash', function(hash) { - return hash !== null ? hash.toString() : ''; - }), - - /** - * @ngdoc method - * @name $location#replace - * - * @description - * If called, all changes to $location during the current `$digest` will replace the current history - * record, instead of adding a new one. - */ - replace: function() { - this.$$replace = true; - return this; - } - }; - - forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) { - Location.prototype = Object.create(locationPrototype); - - /** - * @ngdoc method - * @name $location#state - * - * @description - * This method is getter / setter. - * - * Return the history state object when called without any parameter. - * - * Change the history state object when called with one parameter and return `$location`. - * The state object is later passed to `pushState` or `replaceState`. - * - * NOTE: This method is supported only in HTML5 mode and only in browsers supporting - * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support - * older browsers (like IE9 or Android < 4.0), don't use this method. - * - * @param {object=} state State object for pushState or replaceState - * @return {object} state - */ - Location.prototype.state = function(state) { - if (!arguments.length) { - return this.$$state; - } - - if (Location !== LocationHtml5Url || !this.$$html5) { - throw $locationMinErr('nostate', 'History API state support is available only ' + - 'in HTML5 mode and only in browsers supporting HTML5 History API'); - } - // The user might modify `stateObject` after invoking `$location.state(stateObject)` - // but we're changing the $$state reference to $browser.state() during the $digest - // so the modification window is narrow. - this.$$state = isUndefined(state) ? null : state; - this.$$urlUpdatedByLocation = true; - - return this; - }; - }); - - - function locationGetter(property) { - return /** @this */ function() { - return this[property]; - }; - } - - - function locationGetterSetter(property, preprocess) { - return /** @this */ function(value) { - if (isUndefined(value)) { - return this[property]; - } - - this[property] = preprocess(value); - this.$$compose(); - - return this; - }; - } - - - /** - * @ngdoc service - * @name $location - * - * @requires $rootElement - * - * @description - * The $location service parses the URL in the browser address bar (based on the - * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL - * available to your application. Changes to the URL in the address bar are reflected into - * $location service and changes to $location are reflected into the browser address bar. - * - * **The $location service:** - * - * - Exposes the current URL in the browser address bar, so you can - * - Watch and observe the URL. - * - Change the URL. - * - Synchronizes the URL with the browser when the user - * - Changes the address bar. - * - Clicks the back or forward button (or clicks a History link). - * - Clicks on a link. - * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash). - * - * For more information see {@link guide/$location Developer Guide: Using $location} - */ - - /** - * @ngdoc provider - * @name $locationProvider - * @this - * - * @description - * Use the `$locationProvider` to configure how the application deep linking paths are stored. - */ - function $LocationProvider() { - var hashPrefix = '!', - html5Mode = { - enabled: false, - requireBase: true, - rewriteLinks: true - }; - - /** - * @ngdoc method - * @name $locationProvider#hashPrefix - * @description - * The default value for the prefix is `'!'`. - * @param {string=} prefix Prefix for hash part (containing path and search) - * @returns {*} current value if used as getter or itself (chaining) if used as setter - */ - this.hashPrefix = function(prefix) { - if (isDefined(prefix)) { - hashPrefix = prefix; - return this; - } else { - return hashPrefix; - } - }; - - /** - * @ngdoc method - * @name $locationProvider#html5Mode - * @description - * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value. - * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported - * properties: - * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to - * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not - * support `pushState`. - * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies - * whether or not a <base> tag is required to be present. If `enabled` and `requireBase` are - * true, and a base tag is not present, an error will be thrown when `$location` is injected. - * See the {@link guide/$location $location guide for more information} - * - **rewriteLinks** - `{boolean|string}` - (default: `true`) When html5Mode is enabled, - * enables/disables URL rewriting for relative links. If set to a string, URL rewriting will - * only happen on links with an attribute that matches the given string. For example, if set - * to `'internal-link'`, then the URL will only be rewritten for `<a internal-link>` links. - * Note that [attribute name normalization](guide/directive#normalization) does not apply - * here, so `'internalLink'` will **not** match `'internal-link'`. - * - * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter - */ - this.html5Mode = function(mode) { - if (isBoolean(mode)) { - html5Mode.enabled = mode; - return this; - } else if (isObject(mode)) { - - if (isBoolean(mode.enabled)) { - html5Mode.enabled = mode.enabled; - } - - if (isBoolean(mode.requireBase)) { - html5Mode.requireBase = mode.requireBase; - } - - if (isBoolean(mode.rewriteLinks) || isString(mode.rewriteLinks)) { - html5Mode.rewriteLinks = mode.rewriteLinks; - } - - return this; - } else { - return html5Mode; - } - }; - - /** - * @ngdoc event - * @name $location#$locationChangeStart - * @eventType broadcast on root scope - * @description - * Broadcasted before a URL will change. - * - * This change can be prevented by calling - * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more - * details about event object. Upon successful change - * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired. - * - * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when - * the browser supports the HTML5 History API. - * - * @param {Object} angularEvent Synthetic event object. - * @param {string} newUrl New URL - * @param {string=} oldUrl URL that was before it was changed. - * @param {string=} newState New history state object - * @param {string=} oldState History state object that was before it was changed. - */ - - /** - * @ngdoc event - * @name $location#$locationChangeSuccess - * @eventType broadcast on root scope - * @description - * Broadcasted after a URL was changed. - * - * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when - * the browser supports the HTML5 History API. - * - * @param {Object} angularEvent Synthetic event object. - * @param {string} newUrl New URL - * @param {string=} oldUrl URL that was before it was changed. - * @param {string=} newState New history state object - * @param {string=} oldState History state object that was before it was changed. - */ - - this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window', - function($rootScope, $browser, $sniffer, $rootElement, $window) { - var $location, - LocationMode, - baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to '' - initialUrl = $browser.url(), - appBase; - - if (html5Mode.enabled) { - if (!baseHref && html5Mode.requireBase) { - throw $locationMinErr('nobase', - '$location in HTML5 mode requires a <base> tag to be present!'); - } - appBase = serverBase(initialUrl) + (baseHref || '/'); - LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url; - } else { - appBase = stripHash(initialUrl); - LocationMode = LocationHashbangUrl; - } - var appBaseNoFile = stripFile(appBase); - - $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix); - $location.$$parseLinkUrl(initialUrl, initialUrl); - - $location.$$state = $browser.state(); - - var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i; - - function setBrowserUrlWithFallback(url, replace, state) { - var oldUrl = $location.url(); - var oldState = $location.$$state; - try { - $browser.url(url, replace, state); - - // Make sure $location.state() returns referentially identical (not just deeply equal) - // state object; this makes possible quick checking if the state changed in the digest - // loop. Checking deep equality would be too expensive. - $location.$$state = $browser.state(); - } catch (e) { - // Restore old values if pushState fails - $location.url(oldUrl); - $location.$$state = oldState; - - throw e; - } - } - - $rootElement.on('click', function(event) { - var rewriteLinks = html5Mode.rewriteLinks; - // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) - // currently we open nice url link and redirect then - - if (!rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which === 2 || event.button === 2) return; - - var elm = jqLite(event.target); - - // traverse the DOM up to find first A tag - while (nodeName_(elm[0]) !== 'a') { - // ignore rewriting if no A tag (reached root element, or no parent - removed from document) - if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return; - } - - if (isString(rewriteLinks) && isUndefined(elm.attr(rewriteLinks))) return; - - var absHref = elm.prop('href'); - // get the actual href attribute - see - // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx - var relHref = elm.attr('href') || elm.attr('xlink:href'); - - if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') { - // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during - // an animation. - absHref = urlResolve(absHref.animVal).href; - } - - // Ignore when url is started with javascript: or mailto: - if (IGNORE_URI_REGEXP.test(absHref)) return; - - if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) { - if ($location.$$parseLinkUrl(absHref, relHref)) { - // We do a preventDefault for all urls that are part of the AngularJS application, - // in html5mode and also without, so that we are able to abort navigation without - // getting double entries in the location history. - event.preventDefault(); - // update location manually - if ($location.absUrl() !== $browser.url()) { - $rootScope.$apply(); - // hack to work around FF6 bug 684208 when scenario runner clicks on links - $window.angular['ff-684208-preventDefault'] = true; - } - } - } - }); - - - // rewrite hashbang url <> html5 url - if (trimEmptyHash($location.absUrl()) !== trimEmptyHash(initialUrl)) { - $browser.url($location.absUrl(), true); - } - - var initializing = true; - - // update $location when $browser url changes - $browser.onUrlChange(function(newUrl, newState) { - - if (!startsWith(newUrl, appBaseNoFile)) { - // If we are navigating outside of the app then force a reload - $window.location.href = newUrl; - return; - } - - $rootScope.$evalAsync(function() { - var oldUrl = $location.absUrl(); - var oldState = $location.$$state; - var defaultPrevented; - newUrl = trimEmptyHash(newUrl); - $location.$$parse(newUrl); - $location.$$state = newState; - - defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, - newState, oldState).defaultPrevented; - - // if the location was changed by a `$locationChangeStart` handler then stop - // processing this location change - if ($location.absUrl() !== newUrl) return; - - if (defaultPrevented) { - $location.$$parse(oldUrl); - $location.$$state = oldState; - setBrowserUrlWithFallback(oldUrl, false, oldState); - } else { - initializing = false; - afterLocationChange(oldUrl, oldState); - } - }); - if (!$rootScope.$$phase) $rootScope.$digest(); - }); - - // update browser - $rootScope.$watch(function $locationWatch() { - if (initializing || $location.$$urlUpdatedByLocation) { - $location.$$urlUpdatedByLocation = false; - - var oldUrl = trimEmptyHash($browser.url()); - var newUrl = trimEmptyHash($location.absUrl()); - var oldState = $browser.state(); - var currentReplace = $location.$$replace; - var urlOrStateChanged = oldUrl !== newUrl || - ($location.$$html5 && $sniffer.history && oldState !== $location.$$state); - - if (initializing || urlOrStateChanged) { - initializing = false; - - $rootScope.$evalAsync(function() { - var newUrl = $location.absUrl(); - var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, - $location.$$state, oldState).defaultPrevented; - - // if the location was changed by a `$locationChangeStart` handler then stop - // processing this location change - if ($location.absUrl() !== newUrl) return; - - if (defaultPrevented) { - $location.$$parse(oldUrl); - $location.$$state = oldState; - } else { - if (urlOrStateChanged) { - setBrowserUrlWithFallback(newUrl, currentReplace, - oldState === $location.$$state ? null : $location.$$state); - } - afterLocationChange(oldUrl, oldState); - } - }); - } - } - - $location.$$replace = false; - - // we don't need to return anything because $evalAsync will make the digest loop dirty when - // there is a change - }); - - return $location; - - function afterLocationChange(oldUrl, oldState) { - $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl, - $location.$$state, oldState); - } - }]; - } - - /** - * @ngdoc service - * @name $log - * @requires $window - * - * @description - * Simple service for logging. Default implementation safely writes the message - * into the browser's console (if present). - * - * The main purpose of this service is to simplify debugging and troubleshooting. - * - * To reveal the location of the calls to `$log` in the JavaScript console, - * you can "blackbox" the AngularJS source in your browser: - * - * [Mozilla description of blackboxing](https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Black_box_a_source). - * [Chrome description of blackboxing](https://developer.chrome.com/devtools/docs/blackboxing). - * - * Note: Not all browsers support blackboxing. - * - * The default is to log `debug` messages. You can use - * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this. - * - * @example - <example module="logExample" name="log-service"> - <file name="script.js"> - angular.module('logExample', []) - .controller('LogController', ['$scope', '$log', function($scope, $log) { - $scope.$log = $log; - $scope.message = 'Hello World!'; - }]); - </file> - <file name="index.html"> - <div ng-controller="LogController"> - <p>Reload this page with open console, enter text and hit the log button...</p> - <label>Message: - <input type="text" ng-model="message" /></label> - <button ng-click="$log.log(message)">log</button> - <button ng-click="$log.warn(message)">warn</button> - <button ng-click="$log.info(message)">info</button> - <button ng-click="$log.error(message)">error</button> - <button ng-click="$log.debug(message)">debug</button> - </div> - </file> - </example> - */ - - /** - * @ngdoc provider - * @name $logProvider - * @this - * - * @description - * Use the `$logProvider` to configure how the application logs messages - */ - function $LogProvider() { - var debug = true, - self = this; - - /** - * @ngdoc method - * @name $logProvider#debugEnabled - * @description - * @param {boolean=} flag enable or disable debug level messages - * @returns {*} current value if used as getter or itself (chaining) if used as setter - */ - this.debugEnabled = function(flag) { - if (isDefined(flag)) { - debug = flag; - return this; - } else { - return debug; - } - }; - - this.$get = ['$window', function($window) { - // Support: IE 9-11, Edge 12-14+ - // IE/Edge display errors in such a way that it requires the user to click in 4 places - // to see the stack trace. There is no way to feature-detect it so there's a chance - // of the user agent sniffing to go wrong but since it's only about logging, this shouldn't - // break apps. Other browsers display errors in a sensible way and some of them map stack - // traces along source maps if available so it makes sense to let browsers display it - // as they want. - var formatStackTrace = msie || /\bEdge\//.test($window.navigator && $window.navigator.userAgent); - - return { - /** - * @ngdoc method - * @name $log#log - * - * @description - * Write a log message - */ - log: consoleLog('log'), - - /** - * @ngdoc method - * @name $log#info - * - * @description - * Write an information message - */ - info: consoleLog('info'), - - /** - * @ngdoc method - * @name $log#warn - * - * @description - * Write a warning message - */ - warn: consoleLog('warn'), - - /** - * @ngdoc method - * @name $log#error - * - * @description - * Write an error message - */ - error: consoleLog('error'), - - /** - * @ngdoc method - * @name $log#debug - * - * @description - * Write a debug message - */ - debug: (function() { - var fn = consoleLog('debug'); - - return function() { - if (debug) { - fn.apply(self, arguments); - } - }; - })() - }; - - function formatError(arg) { - if (isError(arg)) { - if (arg.stack && formatStackTrace) { - arg = (arg.message && arg.stack.indexOf(arg.message) === -1) - ? 'Error: ' + arg.message + '\n' + arg.stack - : arg.stack; - } else if (arg.sourceURL) { - arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line; - } - } - return arg; - } - - function consoleLog(type) { - var console = $window.console || {}, - logFn = console[type] || console.log || noop; - - return function() { - var args = []; - forEach(arguments, function(arg) { - args.push(formatError(arg)); - }); - // Support: IE 9 only - // console methods don't inherit from Function.prototype in IE 9 so we can't - // call `logFn.apply(console, args)` directly. - return Function.prototype.apply.call(logFn, console, args); - }; - } - }]; - } - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - var $parseMinErr = minErr('$parse'); - - var objectValueOf = {}.constructor.prototype.valueOf; - -// Sandboxing AngularJS Expressions -// ------------------------------ -// AngularJS expressions are no longer sandboxed. So it is now even easier to access arbitrary JS code by -// various means such as obtaining a reference to native JS functions like the Function constructor. -// -// As an example, consider the following AngularJS expression: -// -// {}.toString.constructor('alert("evil JS code")') -// -// It is important to realize that if you create an expression from a string that contains user provided -// content then it is possible that your application contains a security vulnerability to an XSS style attack. -// -// See https://docs.angularjs.org/guide/security - - - function getStringValue(name) { - // Property names must be strings. This means that non-string objects cannot be used - // as keys in an object. Any non-string object, including a number, is typecasted - // into a string via the toString method. - // -- MDN, https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Property_accessors#Property_names - // - // So, to ensure that we are checking the same `name` that JavaScript would use, we cast it - // to a string. It's not always possible. If `name` is an object and its `toString` method is - // 'broken' (doesn't return a string, isn't a function, etc.), an error will be thrown: - // - // TypeError: Cannot convert object to primitive value - // - // For performance reasons, we don't catch this error here and allow it to propagate up the call - // stack. Note that you'll get the same error in JavaScript if you try to access a property using - // such a 'broken' object as a key. - return name + ''; - } - - - var OPERATORS = createMap(); - forEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function(operator) { OPERATORS[operator] = true; }); - var ESCAPE = {'n':'\n', 'f':'\f', 'r':'\r', 't':'\t', 'v':'\v', '\'':'\'', '"':'"'}; - - -///////////////////////////////////////// - - - /** - * @constructor - */ - var Lexer = function Lexer(options) { - this.options = options; - }; - - Lexer.prototype = { - constructor: Lexer, - - lex: function(text) { - this.text = text; - this.index = 0; - this.tokens = []; - - while (this.index < this.text.length) { - var ch = this.text.charAt(this.index); - if (ch === '"' || ch === '\'') { - this.readString(ch); - } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) { - this.readNumber(); - } else if (this.isIdentifierStart(this.peekMultichar())) { - this.readIdent(); - } else if (this.is(ch, '(){}[].,;:?')) { - this.tokens.push({index: this.index, text: ch}); - this.index++; - } else if (this.isWhitespace(ch)) { - this.index++; - } else { - var ch2 = ch + this.peek(); - var ch3 = ch2 + this.peek(2); - var op1 = OPERATORS[ch]; - var op2 = OPERATORS[ch2]; - var op3 = OPERATORS[ch3]; - if (op1 || op2 || op3) { - var token = op3 ? ch3 : (op2 ? ch2 : ch); - this.tokens.push({index: this.index, text: token, operator: true}); - this.index += token.length; - } else { - this.throwError('Unexpected next character ', this.index, this.index + 1); - } - } - } - return this.tokens; - }, - - is: function(ch, chars) { - return chars.indexOf(ch) !== -1; - }, - - peek: function(i) { - var num = i || 1; - return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false; - }, - - isNumber: function(ch) { - return ('0' <= ch && ch <= '9') && typeof ch === 'string'; - }, - - isWhitespace: function(ch) { - // IE treats non-breaking space as \u00A0 - return (ch === ' ' || ch === '\r' || ch === '\t' || - ch === '\n' || ch === '\v' || ch === '\u00A0'); - }, - - isIdentifierStart: function(ch) { - return this.options.isIdentifierStart ? - this.options.isIdentifierStart(ch, this.codePointAt(ch)) : - this.isValidIdentifierStart(ch); - }, - - isValidIdentifierStart: function(ch) { - return ('a' <= ch && ch <= 'z' || - 'A' <= ch && ch <= 'Z' || - '_' === ch || ch === '$'); - }, - - isIdentifierContinue: function(ch) { - return this.options.isIdentifierContinue ? - this.options.isIdentifierContinue(ch, this.codePointAt(ch)) : - this.isValidIdentifierContinue(ch); - }, - - isValidIdentifierContinue: function(ch, cp) { - return this.isValidIdentifierStart(ch, cp) || this.isNumber(ch); - }, - - codePointAt: function(ch) { - if (ch.length === 1) return ch.charCodeAt(0); - // eslint-disable-next-line no-bitwise - return (ch.charCodeAt(0) << 10) + ch.charCodeAt(1) - 0x35FDC00; - }, - - peekMultichar: function() { - var ch = this.text.charAt(this.index); - var peek = this.peek(); - if (!peek) { - return ch; - } - var cp1 = ch.charCodeAt(0); - var cp2 = peek.charCodeAt(0); - if (cp1 >= 0xD800 && cp1 <= 0xDBFF && cp2 >= 0xDC00 && cp2 <= 0xDFFF) { - return ch + peek; - } - return ch; - }, - - isExpOperator: function(ch) { - return (ch === '-' || ch === '+' || this.isNumber(ch)); - }, - - throwError: function(error, start, end) { - end = end || this.index; - var colStr = (isDefined(start) - ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']' - : ' ' + end); - throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].', - error, colStr, this.text); - }, - - readNumber: function() { - var number = ''; - var start = this.index; - while (this.index < this.text.length) { - var ch = lowercase(this.text.charAt(this.index)); - if (ch === '.' || this.isNumber(ch)) { - number += ch; - } else { - var peekCh = this.peek(); - if (ch === 'e' && this.isExpOperator(peekCh)) { - number += ch; - } else if (this.isExpOperator(ch) && - peekCh && this.isNumber(peekCh) && - number.charAt(number.length - 1) === 'e') { - number += ch; - } else if (this.isExpOperator(ch) && - (!peekCh || !this.isNumber(peekCh)) && - number.charAt(number.length - 1) === 'e') { - this.throwError('Invalid exponent'); - } else { - break; - } - } - this.index++; - } - this.tokens.push({ - index: start, - text: number, - constant: true, - value: Number(number) - }); - }, - - readIdent: function() { - var start = this.index; - this.index += this.peekMultichar().length; - while (this.index < this.text.length) { - var ch = this.peekMultichar(); - if (!this.isIdentifierContinue(ch)) { - break; - } - this.index += ch.length; - } - this.tokens.push({ - index: start, - text: this.text.slice(start, this.index), - identifier: true - }); - }, - - readString: function(quote) { - var start = this.index; - this.index++; - var string = ''; - var rawString = quote; - var escape = false; - while (this.index < this.text.length) { - var ch = this.text.charAt(this.index); - rawString += ch; - if (escape) { - if (ch === 'u') { - var hex = this.text.substring(this.index + 1, this.index + 5); - if (!hex.match(/[\da-f]{4}/i)) { - this.throwError('Invalid unicode escape [\\u' + hex + ']'); - } - this.index += 4; - string += String.fromCharCode(parseInt(hex, 16)); - } else { - var rep = ESCAPE[ch]; - string = string + (rep || ch); - } - escape = false; - } else if (ch === '\\') { - escape = true; - } else if (ch === quote) { - this.index++; - this.tokens.push({ - index: start, - text: rawString, - constant: true, - value: string - }); - return; - } else { - string += ch; - } - this.index++; - } - this.throwError('Unterminated quote', start); - } - }; - - var AST = function AST(lexer, options) { - this.lexer = lexer; - this.options = options; - }; - - AST.Program = 'Program'; - AST.ExpressionStatement = 'ExpressionStatement'; - AST.AssignmentExpression = 'AssignmentExpression'; - AST.ConditionalExpression = 'ConditionalExpression'; - AST.LogicalExpression = 'LogicalExpression'; - AST.BinaryExpression = 'BinaryExpression'; - AST.UnaryExpression = 'UnaryExpression'; - AST.CallExpression = 'CallExpression'; - AST.MemberExpression = 'MemberExpression'; - AST.Identifier = 'Identifier'; - AST.Literal = 'Literal'; - AST.ArrayExpression = 'ArrayExpression'; - AST.Property = 'Property'; - AST.ObjectExpression = 'ObjectExpression'; - AST.ThisExpression = 'ThisExpression'; - AST.LocalsExpression = 'LocalsExpression'; - -// Internal use only - AST.NGValueParameter = 'NGValueParameter'; - - AST.prototype = { - ast: function(text) { - this.text = text; - this.tokens = this.lexer.lex(text); - - var value = this.program(); - - if (this.tokens.length !== 0) { - this.throwError('is an unexpected token', this.tokens[0]); - } - - return value; - }, - - program: function() { - var body = []; - while (true) { - if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']')) - body.push(this.expressionStatement()); - if (!this.expect(';')) { - return { type: AST.Program, body: body}; - } - } - }, - - expressionStatement: function() { - return { type: AST.ExpressionStatement, expression: this.filterChain() }; - }, - - filterChain: function() { - var left = this.expression(); - while (this.expect('|')) { - left = this.filter(left); - } - return left; - }, - - expression: function() { - return this.assignment(); - }, - - assignment: function() { - var result = this.ternary(); - if (this.expect('=')) { - if (!isAssignable(result)) { - throw $parseMinErr('lval', 'Trying to assign a value to a non l-value'); - } - - result = { type: AST.AssignmentExpression, left: result, right: this.assignment(), operator: '='}; - } - return result; - }, - - ternary: function() { - var test = this.logicalOR(); - var alternate; - var consequent; - if (this.expect('?')) { - alternate = this.expression(); - if (this.consume(':')) { - consequent = this.expression(); - return { type: AST.ConditionalExpression, test: test, alternate: alternate, consequent: consequent}; - } - } - return test; - }, - - logicalOR: function() { - var left = this.logicalAND(); - while (this.expect('||')) { - left = { type: AST.LogicalExpression, operator: '||', left: left, right: this.logicalAND() }; - } - return left; - }, - - logicalAND: function() { - var left = this.equality(); - while (this.expect('&&')) { - left = { type: AST.LogicalExpression, operator: '&&', left: left, right: this.equality()}; - } - return left; - }, - - equality: function() { - var left = this.relational(); - var token; - while ((token = this.expect('==','!=','===','!=='))) { - left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.relational() }; - } - return left; - }, - - relational: function() { - var left = this.additive(); - var token; - while ((token = this.expect('<', '>', '<=', '>='))) { - left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.additive() }; - } - return left; - }, - - additive: function() { - var left = this.multiplicative(); - var token; - while ((token = this.expect('+','-'))) { - left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.multiplicative() }; - } - return left; - }, - - multiplicative: function() { - var left = this.unary(); - var token; - while ((token = this.expect('*','/','%'))) { - left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.unary() }; - } - return left; - }, - - unary: function() { - var token; - if ((token = this.expect('+', '-', '!'))) { - return { type: AST.UnaryExpression, operator: token.text, prefix: true, argument: this.unary() }; - } else { - return this.primary(); - } - }, - - primary: function() { - var primary; - if (this.expect('(')) { - primary = this.filterChain(); - this.consume(')'); - } else if (this.expect('[')) { - primary = this.arrayDeclaration(); - } else if (this.expect('{')) { - primary = this.object(); - } else if (this.selfReferential.hasOwnProperty(this.peek().text)) { - primary = copy(this.selfReferential[this.consume().text]); - } else if (this.options.literals.hasOwnProperty(this.peek().text)) { - primary = { type: AST.Literal, value: this.options.literals[this.consume().text]}; - } else if (this.peek().identifier) { - primary = this.identifier(); - } else if (this.peek().constant) { - primary = this.constant(); - } else { - this.throwError('not a primary expression', this.peek()); - } - - var next; - while ((next = this.expect('(', '[', '.'))) { - if (next.text === '(') { - primary = {type: AST.CallExpression, callee: primary, arguments: this.parseArguments() }; - this.consume(')'); - } else if (next.text === '[') { - primary = { type: AST.MemberExpression, object: primary, property: this.expression(), computed: true }; - this.consume(']'); - } else if (next.text === '.') { - primary = { type: AST.MemberExpression, object: primary, property: this.identifier(), computed: false }; - } else { - this.throwError('IMPOSSIBLE'); - } - } - return primary; - }, - - filter: function(baseExpression) { - var args = [baseExpression]; - var result = {type: AST.CallExpression, callee: this.identifier(), arguments: args, filter: true}; - - while (this.expect(':')) { - args.push(this.expression()); - } - - return result; - }, - - parseArguments: function() { - var args = []; - if (this.peekToken().text !== ')') { - do { - args.push(this.filterChain()); - } while (this.expect(',')); - } - return args; - }, - - identifier: function() { - var token = this.consume(); - if (!token.identifier) { - this.throwError('is not a valid identifier', token); - } - return { type: AST.Identifier, name: token.text }; - }, - - constant: function() { - // TODO check that it is a constant - return { type: AST.Literal, value: this.consume().value }; - }, - - arrayDeclaration: function() { - var elements = []; - if (this.peekToken().text !== ']') { - do { - if (this.peek(']')) { - // Support trailing commas per ES5.1. - break; - } - elements.push(this.expression()); - } while (this.expect(',')); - } - this.consume(']'); - - return { type: AST.ArrayExpression, elements: elements }; - }, - - object: function() { - var properties = [], property; - if (this.peekToken().text !== '}') { - do { - if (this.peek('}')) { - // Support trailing commas per ES5.1. - break; - } - property = {type: AST.Property, kind: 'init'}; - if (this.peek().constant) { - property.key = this.constant(); - property.computed = false; - this.consume(':'); - property.value = this.expression(); - } else if (this.peek().identifier) { - property.key = this.identifier(); - property.computed = false; - if (this.peek(':')) { - this.consume(':'); - property.value = this.expression(); - } else { - property.value = property.key; - } - } else if (this.peek('[')) { - this.consume('['); - property.key = this.expression(); - this.consume(']'); - property.computed = true; - this.consume(':'); - property.value = this.expression(); - } else { - this.throwError('invalid key', this.peek()); - } - properties.push(property); - } while (this.expect(',')); - } - this.consume('}'); - - return {type: AST.ObjectExpression, properties: properties }; - }, - - throwError: function(msg, token) { - throw $parseMinErr('syntax', - 'Syntax Error: Token \'{0}\' {1} at column {2} of the expression [{3}] starting at [{4}].', - token.text, msg, (token.index + 1), this.text, this.text.substring(token.index)); - }, - - consume: function(e1) { - if (this.tokens.length === 0) { - throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); - } - - var token = this.expect(e1); - if (!token) { - this.throwError('is unexpected, expecting [' + e1 + ']', this.peek()); - } - return token; - }, - - peekToken: function() { - if (this.tokens.length === 0) { - throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); - } - return this.tokens[0]; - }, - - peek: function(e1, e2, e3, e4) { - return this.peekAhead(0, e1, e2, e3, e4); - }, - - peekAhead: function(i, e1, e2, e3, e4) { - if (this.tokens.length > i) { - var token = this.tokens[i]; - var t = token.text; - if (t === e1 || t === e2 || t === e3 || t === e4 || - (!e1 && !e2 && !e3 && !e4)) { - return token; - } - } - return false; - }, - - expect: function(e1, e2, e3, e4) { - var token = this.peek(e1, e2, e3, e4); - if (token) { - this.tokens.shift(); - return token; - } - return false; - }, - - selfReferential: { - 'this': {type: AST.ThisExpression }, - '$locals': {type: AST.LocalsExpression } - } - }; - - function ifDefined(v, d) { - return typeof v !== 'undefined' ? v : d; - } - - function plusFn(l, r) { - if (typeof l === 'undefined') return r; - if (typeof r === 'undefined') return l; - return l + r; - } - - function isStateless($filter, filterName) { - var fn = $filter(filterName); - return !fn.$stateful; - } - - var PURITY_ABSOLUTE = 1; - var PURITY_RELATIVE = 2; - -// Detect nodes which could depend on non-shallow state of objects - function isPure(node, parentIsPure) { - switch (node.type) { - // Computed members might invoke a stateful toString() - case AST.MemberExpression: - if (node.computed) { - return false; - } - break; - - // Unary always convert to primative - case AST.UnaryExpression: - return PURITY_ABSOLUTE; - - // The binary + operator can invoke a stateful toString(). - case AST.BinaryExpression: - return node.operator !== '+' ? PURITY_ABSOLUTE : false; - - // Functions / filters probably read state from within objects - case AST.CallExpression: - return false; - } - - return (undefined === parentIsPure) ? PURITY_RELATIVE : parentIsPure; - } - - function findConstantAndWatchExpressions(ast, $filter, parentIsPure) { - var allConstants; - var argsToWatch; - var isStatelessFilter; - - var astIsPure = ast.isPure = isPure(ast, parentIsPure); - - switch (ast.type) { - case AST.Program: - allConstants = true; - forEach(ast.body, function(expr) { - findConstantAndWatchExpressions(expr.expression, $filter, astIsPure); - allConstants = allConstants && expr.expression.constant; - }); - ast.constant = allConstants; - break; - case AST.Literal: - ast.constant = true; - ast.toWatch = []; - break; - case AST.UnaryExpression: - findConstantAndWatchExpressions(ast.argument, $filter, astIsPure); - ast.constant = ast.argument.constant; - ast.toWatch = ast.argument.toWatch; - break; - case AST.BinaryExpression: - findConstantAndWatchExpressions(ast.left, $filter, astIsPure); - findConstantAndWatchExpressions(ast.right, $filter, astIsPure); - ast.constant = ast.left.constant && ast.right.constant; - ast.toWatch = ast.left.toWatch.concat(ast.right.toWatch); - break; - case AST.LogicalExpression: - findConstantAndWatchExpressions(ast.left, $filter, astIsPure); - findConstantAndWatchExpressions(ast.right, $filter, astIsPure); - ast.constant = ast.left.constant && ast.right.constant; - ast.toWatch = ast.constant ? [] : [ast]; - break; - case AST.ConditionalExpression: - findConstantAndWatchExpressions(ast.test, $filter, astIsPure); - findConstantAndWatchExpressions(ast.alternate, $filter, astIsPure); - findConstantAndWatchExpressions(ast.consequent, $filter, astIsPure); - ast.constant = ast.test.constant && ast.alternate.constant && ast.consequent.constant; - ast.toWatch = ast.constant ? [] : [ast]; - break; - case AST.Identifier: - ast.constant = false; - ast.toWatch = [ast]; - break; - case AST.MemberExpression: - findConstantAndWatchExpressions(ast.object, $filter, astIsPure); - if (ast.computed) { - findConstantAndWatchExpressions(ast.property, $filter, astIsPure); - } - ast.constant = ast.object.constant && (!ast.computed || ast.property.constant); - ast.toWatch = ast.constant ? [] : [ast]; - break; - case AST.CallExpression: - isStatelessFilter = ast.filter ? isStateless($filter, ast.callee.name) : false; - allConstants = isStatelessFilter; - argsToWatch = []; - forEach(ast.arguments, function(expr) { - findConstantAndWatchExpressions(expr, $filter, astIsPure); - allConstants = allConstants && expr.constant; - argsToWatch.push.apply(argsToWatch, expr.toWatch); - }); - ast.constant = allConstants; - ast.toWatch = isStatelessFilter ? argsToWatch : [ast]; - break; - case AST.AssignmentExpression: - findConstantAndWatchExpressions(ast.left, $filter, astIsPure); - findConstantAndWatchExpressions(ast.right, $filter, astIsPure); - ast.constant = ast.left.constant && ast.right.constant; - ast.toWatch = [ast]; - break; - case AST.ArrayExpression: - allConstants = true; - argsToWatch = []; - forEach(ast.elements, function(expr) { - findConstantAndWatchExpressions(expr, $filter, astIsPure); - allConstants = allConstants && expr.constant; - argsToWatch.push.apply(argsToWatch, expr.toWatch); - }); - ast.constant = allConstants; - ast.toWatch = argsToWatch; - break; - case AST.ObjectExpression: - allConstants = true; - argsToWatch = []; - forEach(ast.properties, function(property) { - findConstantAndWatchExpressions(property.value, $filter, astIsPure); - allConstants = allConstants && property.value.constant; - argsToWatch.push.apply(argsToWatch, property.value.toWatch); - if (property.computed) { - //`{[key]: value}` implicitly does `key.toString()` which may be non-pure - findConstantAndWatchExpressions(property.key, $filter, /*parentIsPure=*/false); - allConstants = allConstants && property.key.constant; - argsToWatch.push.apply(argsToWatch, property.key.toWatch); - } - }); - ast.constant = allConstants; - ast.toWatch = argsToWatch; - break; - case AST.ThisExpression: - ast.constant = false; - ast.toWatch = []; - break; - case AST.LocalsExpression: - ast.constant = false; - ast.toWatch = []; - break; - } - } - - function getInputs(body) { - if (body.length !== 1) return; - var lastExpression = body[0].expression; - var candidate = lastExpression.toWatch; - if (candidate.length !== 1) return candidate; - return candidate[0] !== lastExpression ? candidate : undefined; - } - - function isAssignable(ast) { - return ast.type === AST.Identifier || ast.type === AST.MemberExpression; - } - - function assignableAST(ast) { - if (ast.body.length === 1 && isAssignable(ast.body[0].expression)) { - return {type: AST.AssignmentExpression, left: ast.body[0].expression, right: {type: AST.NGValueParameter}, operator: '='}; - } - } - - function isLiteral(ast) { - return ast.body.length === 0 || - ast.body.length === 1 && ( - ast.body[0].expression.type === AST.Literal || - ast.body[0].expression.type === AST.ArrayExpression || - ast.body[0].expression.type === AST.ObjectExpression); - } - - function isConstant(ast) { - return ast.constant; - } - - function ASTCompiler($filter) { - this.$filter = $filter; - } - - ASTCompiler.prototype = { - compile: function(ast) { - var self = this; - this.state = { - nextId: 0, - filters: {}, - fn: {vars: [], body: [], own: {}}, - assign: {vars: [], body: [], own: {}}, - inputs: [] - }; - findConstantAndWatchExpressions(ast, self.$filter); - var extra = ''; - var assignable; - this.stage = 'assign'; - if ((assignable = assignableAST(ast))) { - this.state.computing = 'assign'; - var result = this.nextId(); - this.recurse(assignable, result); - this.return_(result); - extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l'); - } - var toWatch = getInputs(ast.body); - self.stage = 'inputs'; - forEach(toWatch, function(watch, key) { - var fnKey = 'fn' + key; - self.state[fnKey] = {vars: [], body: [], own: {}}; - self.state.computing = fnKey; - var intoId = self.nextId(); - self.recurse(watch, intoId); - self.return_(intoId); - self.state.inputs.push({name: fnKey, isPure: watch.isPure}); - watch.watchId = key; - }); - this.state.computing = 'fn'; - this.stage = 'main'; - this.recurse(ast); - var fnString = - // The build and minification steps remove the string "use strict" from the code, but this is done using a regex. - // This is a workaround for this until we do a better job at only removing the prefix only when we should. - '"' + this.USE + ' ' + this.STRICT + '";\n' + - this.filterPrefix() + - 'var fn=' + this.generateFunction('fn', 's,l,a,i') + - extra + - this.watchFns() + - 'return fn;'; - - // eslint-disable-next-line no-new-func - var fn = (new Function('$filter', - 'getStringValue', - 'ifDefined', - 'plus', - fnString))( - this.$filter, - getStringValue, - ifDefined, - plusFn); - this.state = this.stage = undefined; - return fn; - }, - - USE: 'use', - - STRICT: 'strict', - - watchFns: function() { - var result = []; - var inputs = this.state.inputs; - var self = this; - forEach(inputs, function(input) { - result.push('var ' + input.name + '=' + self.generateFunction(input.name, 's')); - if (input.isPure) { - result.push(input.name, '.isPure=' + JSON.stringify(input.isPure) + ';'); - } - }); - if (inputs.length) { - result.push('fn.inputs=[' + inputs.map(function(i) { return i.name; }).join(',') + '];'); - } - return result.join(''); - }, - - generateFunction: function(name, params) { - return 'function(' + params + '){' + - this.varsPrefix(name) + - this.body(name) + - '};'; - }, - - filterPrefix: function() { - var parts = []; - var self = this; - forEach(this.state.filters, function(id, filter) { - parts.push(id + '=$filter(' + self.escape(filter) + ')'); - }); - if (parts.length) return 'var ' + parts.join(',') + ';'; - return ''; - }, - - varsPrefix: function(section) { - return this.state[section].vars.length ? 'var ' + this.state[section].vars.join(',') + ';' : ''; - }, - - body: function(section) { - return this.state[section].body.join(''); - }, - - recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) { - var left, right, self = this, args, expression, computed; - recursionFn = recursionFn || noop; - if (!skipWatchIdCheck && isDefined(ast.watchId)) { - intoId = intoId || this.nextId(); - this.if_('i', - this.lazyAssign(intoId, this.computedMember('i', ast.watchId)), - this.lazyRecurse(ast, intoId, nameId, recursionFn, create, true) - ); - return; - } - switch (ast.type) { - case AST.Program: - forEach(ast.body, function(expression, pos) { - self.recurse(expression.expression, undefined, undefined, function(expr) { right = expr; }); - if (pos !== ast.body.length - 1) { - self.current().body.push(right, ';'); - } else { - self.return_(right); - } - }); - break; - case AST.Literal: - expression = this.escape(ast.value); - this.assign(intoId, expression); - recursionFn(intoId || expression); - break; - case AST.UnaryExpression: - this.recurse(ast.argument, undefined, undefined, function(expr) { right = expr; }); - expression = ast.operator + '(' + this.ifDefined(right, 0) + ')'; - this.assign(intoId, expression); - recursionFn(expression); - break; - case AST.BinaryExpression: - this.recurse(ast.left, undefined, undefined, function(expr) { left = expr; }); - this.recurse(ast.right, undefined, undefined, function(expr) { right = expr; }); - if (ast.operator === '+') { - expression = this.plus(left, right); - } else if (ast.operator === '-') { - expression = this.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0); - } else { - expression = '(' + left + ')' + ast.operator + '(' + right + ')'; - } - this.assign(intoId, expression); - recursionFn(expression); - break; - case AST.LogicalExpression: - intoId = intoId || this.nextId(); - self.recurse(ast.left, intoId); - self.if_(ast.operator === '&&' ? intoId : self.not(intoId), self.lazyRecurse(ast.right, intoId)); - recursionFn(intoId); - break; - case AST.ConditionalExpression: - intoId = intoId || this.nextId(); - self.recurse(ast.test, intoId); - self.if_(intoId, self.lazyRecurse(ast.alternate, intoId), self.lazyRecurse(ast.consequent, intoId)); - recursionFn(intoId); - break; - case AST.Identifier: - intoId = intoId || this.nextId(); - if (nameId) { - nameId.context = self.stage === 'inputs' ? 's' : this.assign(this.nextId(), this.getHasOwnProperty('l', ast.name) + '?l:s'); - nameId.computed = false; - nameId.name = ast.name; - } - self.if_(self.stage === 'inputs' || self.not(self.getHasOwnProperty('l', ast.name)), - function() { - self.if_(self.stage === 'inputs' || 's', function() { - if (create && create !== 1) { - self.if_( - self.isNull(self.nonComputedMember('s', ast.name)), - self.lazyAssign(self.nonComputedMember('s', ast.name), '{}')); - } - self.assign(intoId, self.nonComputedMember('s', ast.name)); - }); - }, intoId && self.lazyAssign(intoId, self.nonComputedMember('l', ast.name)) - ); - recursionFn(intoId); - break; - case AST.MemberExpression: - left = nameId && (nameId.context = this.nextId()) || this.nextId(); - intoId = intoId || this.nextId(); - self.recurse(ast.object, left, undefined, function() { - self.if_(self.notNull(left), function() { - if (ast.computed) { - right = self.nextId(); - self.recurse(ast.property, right); - self.getStringValue(right); - if (create && create !== 1) { - self.if_(self.not(self.computedMember(left, right)), self.lazyAssign(self.computedMember(left, right), '{}')); - } - expression = self.computedMember(left, right); - self.assign(intoId, expression); - if (nameId) { - nameId.computed = true; - nameId.name = right; - } - } else { - if (create && create !== 1) { - self.if_(self.isNull(self.nonComputedMember(left, ast.property.name)), self.lazyAssign(self.nonComputedMember(left, ast.property.name), '{}')); - } - expression = self.nonComputedMember(left, ast.property.name); - self.assign(intoId, expression); - if (nameId) { - nameId.computed = false; - nameId.name = ast.property.name; - } - } - }, function() { - self.assign(intoId, 'undefined'); - }); - recursionFn(intoId); - }, !!create); - break; - case AST.CallExpression: - intoId = intoId || this.nextId(); - if (ast.filter) { - right = self.filter(ast.callee.name); - args = []; - forEach(ast.arguments, function(expr) { - var argument = self.nextId(); - self.recurse(expr, argument); - args.push(argument); - }); - expression = right + '(' + args.join(',') + ')'; - self.assign(intoId, expression); - recursionFn(intoId); - } else { - right = self.nextId(); - left = {}; - args = []; - self.recurse(ast.callee, right, left, function() { - self.if_(self.notNull(right), function() { - forEach(ast.arguments, function(expr) { - self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) { - args.push(argument); - }); - }); - if (left.name) { - expression = self.member(left.context, left.name, left.computed) + '(' + args.join(',') + ')'; - } else { - expression = right + '(' + args.join(',') + ')'; - } - self.assign(intoId, expression); - }, function() { - self.assign(intoId, 'undefined'); - }); - recursionFn(intoId); - }); - } - break; - case AST.AssignmentExpression: - right = this.nextId(); - left = {}; - this.recurse(ast.left, undefined, left, function() { - self.if_(self.notNull(left.context), function() { - self.recurse(ast.right, right); - expression = self.member(left.context, left.name, left.computed) + ast.operator + right; - self.assign(intoId, expression); - recursionFn(intoId || expression); - }); - }, 1); - break; - case AST.ArrayExpression: - args = []; - forEach(ast.elements, function(expr) { - self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) { - args.push(argument); - }); - }); - expression = '[' + args.join(',') + ']'; - this.assign(intoId, expression); - recursionFn(intoId || expression); - break; - case AST.ObjectExpression: - args = []; - computed = false; - forEach(ast.properties, function(property) { - if (property.computed) { - computed = true; - } - }); - if (computed) { - intoId = intoId || this.nextId(); - this.assign(intoId, '{}'); - forEach(ast.properties, function(property) { - if (property.computed) { - left = self.nextId(); - self.recurse(property.key, left); - } else { - left = property.key.type === AST.Identifier ? - property.key.name : - ('' + property.key.value); - } - right = self.nextId(); - self.recurse(property.value, right); - self.assign(self.member(intoId, left, property.computed), right); - }); - } else { - forEach(ast.properties, function(property) { - self.recurse(property.value, ast.constant ? undefined : self.nextId(), undefined, function(expr) { - args.push(self.escape( - property.key.type === AST.Identifier ? property.key.name : - ('' + property.key.value)) + - ':' + expr); - }); - }); - expression = '{' + args.join(',') + '}'; - this.assign(intoId, expression); - } - recursionFn(intoId || expression); - break; - case AST.ThisExpression: - this.assign(intoId, 's'); - recursionFn(intoId || 's'); - break; - case AST.LocalsExpression: - this.assign(intoId, 'l'); - recursionFn(intoId || 'l'); - break; - case AST.NGValueParameter: - this.assign(intoId, 'v'); - recursionFn(intoId || 'v'); - break; - } - }, - - getHasOwnProperty: function(element, property) { - var key = element + '.' + property; - var own = this.current().own; - if (!own.hasOwnProperty(key)) { - own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')'); - } - return own[key]; - }, - - assign: function(id, value) { - if (!id) return; - this.current().body.push(id, '=', value, ';'); - return id; - }, - - filter: function(filterName) { - if (!this.state.filters.hasOwnProperty(filterName)) { - this.state.filters[filterName] = this.nextId(true); - } - return this.state.filters[filterName]; - }, - - ifDefined: function(id, defaultValue) { - return 'ifDefined(' + id + ',' + this.escape(defaultValue) + ')'; - }, - - plus: function(left, right) { - return 'plus(' + left + ',' + right + ')'; - }, - - return_: function(id) { - this.current().body.push('return ', id, ';'); - }, - - if_: function(test, alternate, consequent) { - if (test === true) { - alternate(); - } else { - var body = this.current().body; - body.push('if(', test, '){'); - alternate(); - body.push('}'); - if (consequent) { - body.push('else{'); - consequent(); - body.push('}'); - } - } - }, - - not: function(expression) { - return '!(' + expression + ')'; - }, - - isNull: function(expression) { - return expression + '==null'; - }, - - notNull: function(expression) { - return expression + '!=null'; - }, - - nonComputedMember: function(left, right) { - var SAFE_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/; - var UNSAFE_CHARACTERS = /[^$_a-zA-Z0-9]/g; - if (SAFE_IDENTIFIER.test(right)) { - return left + '.' + right; - } else { - return left + '["' + right.replace(UNSAFE_CHARACTERS, this.stringEscapeFn) + '"]'; - } - }, - - computedMember: function(left, right) { - return left + '[' + right + ']'; - }, - - member: function(left, right, computed) { - if (computed) return this.computedMember(left, right); - return this.nonComputedMember(left, right); - }, - - getStringValue: function(item) { - this.assign(item, 'getStringValue(' + item + ')'); - }, - - lazyRecurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) { - var self = this; - return function() { - self.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck); - }; - }, - - lazyAssign: function(id, value) { - var self = this; - return function() { - self.assign(id, value); - }; - }, - - stringEscapeRegex: /[^ a-zA-Z0-9]/g, - - stringEscapeFn: function(c) { - return '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4); - }, - - escape: function(value) { - if (isString(value)) return '\'' + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + '\''; - if (isNumber(value)) return value.toString(); - if (value === true) return 'true'; - if (value === false) return 'false'; - if (value === null) return 'null'; - if (typeof value === 'undefined') return 'undefined'; - - throw $parseMinErr('esc', 'IMPOSSIBLE'); - }, - - nextId: function(skip, init) { - var id = 'v' + (this.state.nextId++); - if (!skip) { - this.current().vars.push(id + (init ? '=' + init : '')); - } - return id; - }, - - current: function() { - return this.state[this.state.computing]; - } - }; - - - function ASTInterpreter($filter) { - this.$filter = $filter; - } - - ASTInterpreter.prototype = { - compile: function(ast) { - var self = this; - findConstantAndWatchExpressions(ast, self.$filter); - var assignable; - var assign; - if ((assignable = assignableAST(ast))) { - assign = this.recurse(assignable); - } - var toWatch = getInputs(ast.body); - var inputs; - if (toWatch) { - inputs = []; - forEach(toWatch, function(watch, key) { - var input = self.recurse(watch); - input.isPure = watch.isPure; - watch.input = input; - inputs.push(input); - watch.watchId = key; - }); - } - var expressions = []; - forEach(ast.body, function(expression) { - expressions.push(self.recurse(expression.expression)); - }); - var fn = ast.body.length === 0 ? noop : - ast.body.length === 1 ? expressions[0] : - function(scope, locals) { - var lastValue; - forEach(expressions, function(exp) { - lastValue = exp(scope, locals); - }); - return lastValue; - }; - if (assign) { - fn.assign = function(scope, value, locals) { - return assign(scope, locals, value); - }; - } - if (inputs) { - fn.inputs = inputs; - } - return fn; - }, - - recurse: function(ast, context, create) { - var left, right, self = this, args; - if (ast.input) { - return this.inputs(ast.input, ast.watchId); - } - switch (ast.type) { - case AST.Literal: - return this.value(ast.value, context); - case AST.UnaryExpression: - right = this.recurse(ast.argument); - return this['unary' + ast.operator](right, context); - case AST.BinaryExpression: - left = this.recurse(ast.left); - right = this.recurse(ast.right); - return this['binary' + ast.operator](left, right, context); - case AST.LogicalExpression: - left = this.recurse(ast.left); - right = this.recurse(ast.right); - return this['binary' + ast.operator](left, right, context); - case AST.ConditionalExpression: - return this['ternary?:']( - this.recurse(ast.test), - this.recurse(ast.alternate), - this.recurse(ast.consequent), - context - ); - case AST.Identifier: - return self.identifier(ast.name, context, create); - case AST.MemberExpression: - left = this.recurse(ast.object, false, !!create); - if (!ast.computed) { - right = ast.property.name; - } - if (ast.computed) right = this.recurse(ast.property); - return ast.computed ? - this.computedMember(left, right, context, create) : - this.nonComputedMember(left, right, context, create); - case AST.CallExpression: - args = []; - forEach(ast.arguments, function(expr) { - args.push(self.recurse(expr)); - }); - if (ast.filter) right = this.$filter(ast.callee.name); - if (!ast.filter) right = this.recurse(ast.callee, true); - return ast.filter ? - function(scope, locals, assign, inputs) { - var values = []; - for (var i = 0; i < args.length; ++i) { - values.push(args[i](scope, locals, assign, inputs)); - } - var value = right.apply(undefined, values, inputs); - return context ? {context: undefined, name: undefined, value: value} : value; - } : - function(scope, locals, assign, inputs) { - var rhs = right(scope, locals, assign, inputs); - var value; - if (rhs.value != null) { - var values = []; - for (var i = 0; i < args.length; ++i) { - values.push(args[i](scope, locals, assign, inputs)); - } - value = rhs.value.apply(rhs.context, values); - } - return context ? {value: value} : value; - }; - case AST.AssignmentExpression: - left = this.recurse(ast.left, true, 1); - right = this.recurse(ast.right); - return function(scope, locals, assign, inputs) { - var lhs = left(scope, locals, assign, inputs); - var rhs = right(scope, locals, assign, inputs); - lhs.context[lhs.name] = rhs; - return context ? {value: rhs} : rhs; - }; - case AST.ArrayExpression: - args = []; - forEach(ast.elements, function(expr) { - args.push(self.recurse(expr)); - }); - return function(scope, locals, assign, inputs) { - var value = []; - for (var i = 0; i < args.length; ++i) { - value.push(args[i](scope, locals, assign, inputs)); - } - return context ? {value: value} : value; - }; - case AST.ObjectExpression: - args = []; - forEach(ast.properties, function(property) { - if (property.computed) { - args.push({key: self.recurse(property.key), - computed: true, - value: self.recurse(property.value) - }); - } else { - args.push({key: property.key.type === AST.Identifier ? - property.key.name : - ('' + property.key.value), - computed: false, - value: self.recurse(property.value) - }); - } - }); - return function(scope, locals, assign, inputs) { - var value = {}; - for (var i = 0; i < args.length; ++i) { - if (args[i].computed) { - value[args[i].key(scope, locals, assign, inputs)] = args[i].value(scope, locals, assign, inputs); - } else { - value[args[i].key] = args[i].value(scope, locals, assign, inputs); - } - } - return context ? {value: value} : value; - }; - case AST.ThisExpression: - return function(scope) { - return context ? {value: scope} : scope; - }; - case AST.LocalsExpression: - return function(scope, locals) { - return context ? {value: locals} : locals; - }; - case AST.NGValueParameter: - return function(scope, locals, assign) { - return context ? {value: assign} : assign; - }; - } - }, - - 'unary+': function(argument, context) { - return function(scope, locals, assign, inputs) { - var arg = argument(scope, locals, assign, inputs); - if (isDefined(arg)) { - arg = +arg; - } else { - arg = 0; - } - return context ? {value: arg} : arg; - }; - }, - 'unary-': function(argument, context) { - return function(scope, locals, assign, inputs) { - var arg = argument(scope, locals, assign, inputs); - if (isDefined(arg)) { - arg = -arg; - } else { - arg = -0; - } - return context ? {value: arg} : arg; - }; - }, - 'unary!': function(argument, context) { - return function(scope, locals, assign, inputs) { - var arg = !argument(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary+': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var lhs = left(scope, locals, assign, inputs); - var rhs = right(scope, locals, assign, inputs); - var arg = plusFn(lhs, rhs); - return context ? {value: arg} : arg; - }; - }, - 'binary-': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var lhs = left(scope, locals, assign, inputs); - var rhs = right(scope, locals, assign, inputs); - var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0); - return context ? {value: arg} : arg; - }; - }, - 'binary*': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary/': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary%': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary===': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary!==': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary==': function(left, right, context) { - return function(scope, locals, assign, inputs) { - // eslint-disable-next-line eqeqeq - var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary!=': function(left, right, context) { - return function(scope, locals, assign, inputs) { - // eslint-disable-next-line eqeqeq - var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary<': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary>': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary<=': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary>=': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary&&': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'binary||': function(left, right, context) { - return function(scope, locals, assign, inputs) { - var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - 'ternary?:': function(test, alternate, consequent, context) { - return function(scope, locals, assign, inputs) { - var arg = test(scope, locals, assign, inputs) ? alternate(scope, locals, assign, inputs) : consequent(scope, locals, assign, inputs); - return context ? {value: arg} : arg; - }; - }, - value: function(value, context) { - return function() { return context ? {context: undefined, name: undefined, value: value} : value; }; - }, - identifier: function(name, context, create) { - return function(scope, locals, assign, inputs) { - var base = locals && (name in locals) ? locals : scope; - if (create && create !== 1 && base && base[name] == null) { - base[name] = {}; - } - var value = base ? base[name] : undefined; - if (context) { - return {context: base, name: name, value: value}; - } else { - return value; - } - }; - }, - computedMember: function(left, right, context, create) { - return function(scope, locals, assign, inputs) { - var lhs = left(scope, locals, assign, inputs); - var rhs; - var value; - if (lhs != null) { - rhs = right(scope, locals, assign, inputs); - rhs = getStringValue(rhs); - if (create && create !== 1) { - if (lhs && !(lhs[rhs])) { - lhs[rhs] = {}; - } - } - value = lhs[rhs]; - } - if (context) { - return {context: lhs, name: rhs, value: value}; - } else { - return value; - } - }; - }, - nonComputedMember: function(left, right, context, create) { - return function(scope, locals, assign, inputs) { - var lhs = left(scope, locals, assign, inputs); - if (create && create !== 1) { - if (lhs && lhs[right] == null) { - lhs[right] = {}; - } - } - var value = lhs != null ? lhs[right] : undefined; - if (context) { - return {context: lhs, name: right, value: value}; - } else { - return value; - } - }; - }, - inputs: function(input, watchId) { - return function(scope, value, locals, inputs) { - if (inputs) return inputs[watchId]; - return input(scope, value, locals); - }; - } - }; - - /** - * @constructor - */ - function Parser(lexer, $filter, options) { - this.ast = new AST(lexer, options); - this.astCompiler = options.csp ? new ASTInterpreter($filter) : - new ASTCompiler($filter); - } - - Parser.prototype = { - constructor: Parser, - - parse: function(text) { - var ast = this.getAst(text); - var fn = this.astCompiler.compile(ast.ast); - fn.literal = isLiteral(ast.ast); - fn.constant = isConstant(ast.ast); - fn.oneTime = ast.oneTime; - return fn; - }, - - getAst: function(exp) { - var oneTime = false; - exp = exp.trim(); - - if (exp.charAt(0) === ':' && exp.charAt(1) === ':') { - oneTime = true; - exp = exp.substring(2); - } - return { - ast: this.ast.ast(exp), - oneTime: oneTime - }; - } - }; - - function getValueOf(value) { - return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value); - } - -/////////////////////////////////// - - /** - * @ngdoc service - * @name $parse - * @kind function - * - * @description - * - * Converts AngularJS {@link guide/expression expression} into a function. - * - * ```js - * var getter = $parse('user.name'); - * var setter = getter.assign; - * var context = {user:{name:'AngularJS'}}; - * var locals = {user:{name:'local'}}; - * - * expect(getter(context)).toEqual('AngularJS'); - * setter(context, 'newValue'); - * expect(context.user.name).toEqual('newValue'); - * expect(getter(context, locals)).toEqual('local'); - * ``` - * - * - * @param {string} expression String expression to compile. - * @returns {function(context, locals)} a function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the strings - * are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values in - * `context`. - * - * The returned function also has the following properties: - * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript - * literal. - * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript - * constant literals. - * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be - * set to a function to change its value on the given context. - * - */ - - - /** - * @ngdoc provider - * @name $parseProvider - * @this - * - * @description - * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse} - * service. - */ - function $ParseProvider() { - var cache = createMap(); - var literals = { - 'true': true, - 'false': false, - 'null': null, - 'undefined': undefined - }; - var identStart, identContinue; - - /** - * @ngdoc method - * @name $parseProvider#addLiteral - * @description - * - * Configure $parse service to add literal values that will be present as literal at expressions. - * - * @param {string} literalName Token for the literal value. The literal name value must be a valid literal name. - * @param {*} literalValue Value for this literal. All literal values must be primitives or `undefined`. - * - **/ - this.addLiteral = function(literalName, literalValue) { - literals[literalName] = literalValue; - }; - - /** - * @ngdoc method - * @name $parseProvider#setIdentifierFns - * - * @description - * - * Allows defining the set of characters that are allowed in AngularJS expressions. The function - * `identifierStart` will get called to know if a given character is a valid character to be the - * first character for an identifier. The function `identifierContinue` will get called to know if - * a given character is a valid character to be a follow-up identifier character. The functions - * `identifierStart` and `identifierContinue` will receive as arguments the single character to be - * identifier and the character code point. These arguments will be `string` and `numeric`. Keep in - * mind that the `string` parameter can be two characters long depending on the character - * representation. It is expected for the function to return `true` or `false`, whether that - * character is allowed or not. - * - * Since this function will be called extensively, keep the implementation of these functions fast, - * as the performance of these functions have a direct impact on the expressions parsing speed. - * - * @param {function=} identifierStart The function that will decide whether the given character is - * a valid identifier start character. - * @param {function=} identifierContinue The function that will decide whether the given character is - * a valid identifier continue character. - */ - this.setIdentifierFns = function(identifierStart, identifierContinue) { - identStart = identifierStart; - identContinue = identifierContinue; - return this; - }; - - this.$get = ['$filter', function($filter) { - var noUnsafeEval = csp().noUnsafeEval; - var $parseOptions = { - csp: noUnsafeEval, - literals: copy(literals), - isIdentifierStart: isFunction(identStart) && identStart, - isIdentifierContinue: isFunction(identContinue) && identContinue - }; - $parse.$$getAst = $$getAst; - return $parse; - - function $parse(exp, interceptorFn) { - var parsedExpression, cacheKey; - - switch (typeof exp) { - case 'string': - exp = exp.trim(); - cacheKey = exp; - - parsedExpression = cache[cacheKey]; - - if (!parsedExpression) { - var lexer = new Lexer($parseOptions); - var parser = new Parser(lexer, $filter, $parseOptions); - parsedExpression = parser.parse(exp); - if (parsedExpression.constant) { - parsedExpression.$$watchDelegate = constantWatchDelegate; - } else if (parsedExpression.oneTime) { - parsedExpression.$$watchDelegate = parsedExpression.literal ? - oneTimeLiteralWatchDelegate : oneTimeWatchDelegate; - } else if (parsedExpression.inputs) { - parsedExpression.$$watchDelegate = inputsWatchDelegate; - } - cache[cacheKey] = parsedExpression; - } - return addInterceptor(parsedExpression, interceptorFn); - - case 'function': - return addInterceptor(exp, interceptorFn); - - default: - return addInterceptor(noop, interceptorFn); - } - } - - function $$getAst(exp) { - var lexer = new Lexer($parseOptions); - var parser = new Parser(lexer, $filter, $parseOptions); - return parser.getAst(exp).ast; - } - - function expressionInputDirtyCheck(newValue, oldValueOfValue, compareObjectIdentity) { - - if (newValue == null || oldValueOfValue == null) { // null/undefined - return newValue === oldValueOfValue; - } - - if (typeof newValue === 'object') { - - // attempt to convert the value to a primitive type - // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can - // be cheaply dirty-checked - newValue = getValueOf(newValue); - - if (typeof newValue === 'object' && !compareObjectIdentity) { - // objects/arrays are not supported - deep-watching them would be too expensive - return false; - } - - // fall-through to the primitive equality check - } - - //Primitive or NaN - // eslint-disable-next-line no-self-compare - return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue); - } - - function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) { - var inputExpressions = parsedExpression.inputs; - var lastResult; - - if (inputExpressions.length === 1) { - var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails - inputExpressions = inputExpressions[0]; - return scope.$watch(function expressionInputWatch(scope) { - var newInputValue = inputExpressions(scope); - if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf, inputExpressions.isPure)) { - lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]); - oldInputValueOf = newInputValue && getValueOf(newInputValue); - } - return lastResult; - }, listener, objectEquality, prettyPrintExpression); - } - - var oldInputValueOfValues = []; - var oldInputValues = []; - for (var i = 0, ii = inputExpressions.length; i < ii; i++) { - oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails - oldInputValues[i] = null; - } - - return scope.$watch(function expressionInputsWatch(scope) { - var changed = false; - - for (var i = 0, ii = inputExpressions.length; i < ii; i++) { - var newInputValue = inputExpressions[i](scope); - if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i], inputExpressions[i].isPure))) { - oldInputValues[i] = newInputValue; - oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue); - } - } - - if (changed) { - lastResult = parsedExpression(scope, undefined, undefined, oldInputValues); - } - - return lastResult; - }, listener, objectEquality, prettyPrintExpression); - } - - function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) { - var unwatch, lastValue; - if (parsedExpression.inputs) { - unwatch = inputsWatchDelegate(scope, oneTimeListener, objectEquality, parsedExpression, prettyPrintExpression); - } else { - unwatch = scope.$watch(oneTimeWatch, oneTimeListener, objectEquality); - } - return unwatch; - - function oneTimeWatch(scope) { - return parsedExpression(scope); - } - function oneTimeListener(value, old, scope) { - lastValue = value; - if (isFunction(listener)) { - listener(value, old, scope); - } - if (isDefined(value)) { - scope.$$postDigest(function() { - if (isDefined(lastValue)) { - unwatch(); - } - }); - } - } - } - - function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var unwatch, lastValue; - unwatch = scope.$watch(function oneTimeWatch(scope) { - return parsedExpression(scope); - }, function oneTimeListener(value, old, scope) { - lastValue = value; - if (isFunction(listener)) { - listener(value, old, scope); - } - if (isAllDefined(value)) { - scope.$$postDigest(function() { - if (isAllDefined(lastValue)) unwatch(); - }); - } - }, objectEquality); - - return unwatch; - - function isAllDefined(value) { - var allDefined = true; - forEach(value, function(val) { - if (!isDefined(val)) allDefined = false; - }); - return allDefined; - } - } - - function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var unwatch = scope.$watch(function constantWatch(scope) { - unwatch(); - return parsedExpression(scope); - }, listener, objectEquality); - return unwatch; - } - - function addInterceptor(parsedExpression, interceptorFn) { - if (!interceptorFn) return parsedExpression; - var watchDelegate = parsedExpression.$$watchDelegate; - var useInputs = false; - - var regularWatch = - watchDelegate !== oneTimeLiteralWatchDelegate && - watchDelegate !== oneTimeWatchDelegate; - - var fn = regularWatch ? function regularInterceptedExpression(scope, locals, assign, inputs) { - var value = useInputs && inputs ? inputs[0] : parsedExpression(scope, locals, assign, inputs); - return interceptorFn(value, scope, locals); - } : function oneTimeInterceptedExpression(scope, locals, assign, inputs) { - var value = parsedExpression(scope, locals, assign, inputs); - var result = interceptorFn(value, scope, locals); - // we only return the interceptor's result if the - // initial value is defined (for bind-once) - return isDefined(value) ? result : value; - }; - - // Propagate $$watchDelegates other then inputsWatchDelegate - useInputs = !parsedExpression.inputs; - if (watchDelegate && watchDelegate !== inputsWatchDelegate) { - fn.$$watchDelegate = watchDelegate; - fn.inputs = parsedExpression.inputs; - } else if (!interceptorFn.$stateful) { - // Treat interceptor like filters - assume non-stateful by default and use the inputsWatchDelegate - fn.$$watchDelegate = inputsWatchDelegate; - fn.inputs = parsedExpression.inputs ? parsedExpression.inputs : [parsedExpression]; - } - - if (fn.inputs) { - fn.inputs = fn.inputs.map(function(e) { - // Remove the isPure flag of inputs when it is not absolute because they are now wrapped in a - // potentially non-pure interceptor function. - if (e.isPure === PURITY_RELATIVE) { - return function depurifier(s) { return e(s); }; - } - return e; - }); - } - - return fn; - } - }]; - } - - /** - * @ngdoc service - * @name $q - * @requires $rootScope - * - * @description - * A service that helps you run functions asynchronously, and use their return values (or exceptions) - * when they are done processing. - * - * This is a [Promises/A+](https://promisesaplus.com/)-compliant implementation of promises/deferred - * objects inspired by [Kris Kowal's Q](https://github.com/kriskowal/q). - * - * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred - * implementations, and the other which resembles ES6 (ES2015) promises to some degree. - * - * ## $q constructor - * - * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver` - * function as the first argument. This is similar to the native Promise implementation from ES6, - * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * While the constructor-style use is supported, not all of the supporting methods from ES6 promises are - * available yet. - * - * It can be used like so: - * - * ```js - * // for the purpose of this example let's assume that variables `$q` and `okToGreet` - * // are available in the current lexical scope (they could have been injected or passed in). - * - * function asyncGreet(name) { - * // perform some asynchronous operation, resolve or reject the promise when appropriate. - * return $q(function(resolve, reject) { - * setTimeout(function() { - * if (okToGreet(name)) { - * resolve('Hello, ' + name + '!'); - * } else { - * reject('Greeting ' + name + ' is not allowed.'); - * } - * }, 1000); - * }); - * } - * - * var promise = asyncGreet('Robin Hood'); - * promise.then(function(greeting) { - * alert('Success: ' + greeting); - * }, function(reason) { - * alert('Failed: ' + reason); - * }); - * ``` - * - * Note: progress/notify callbacks are not currently supported via the ES6-style interface. - * - * Note: unlike ES6 behavior, an exception thrown in the constructor function will NOT implicitly reject the promise. - * - * However, the more traditional CommonJS-style usage is still available, and documented below. - * - * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an - * interface for interacting with an object that represents the result of an action that is - * performed asynchronously, and may or may not be finished at any given point in time. - * - * From the perspective of dealing with error handling, deferred and promise APIs are to - * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming. - * - * ```js - * // for the purpose of this example let's assume that variables `$q` and `okToGreet` - * // are available in the current lexical scope (they could have been injected or passed in). - * - * function asyncGreet(name) { - * var deferred = $q.defer(); - * - * setTimeout(function() { - * deferred.notify('About to greet ' + name + '.'); - * - * if (okToGreet(name)) { - * deferred.resolve('Hello, ' + name + '!'); - * } else { - * deferred.reject('Greeting ' + name + ' is not allowed.'); - * } - * }, 1000); - * - * return deferred.promise; - * } - * - * var promise = asyncGreet('Robin Hood'); - * promise.then(function(greeting) { - * alert('Success: ' + greeting); - * }, function(reason) { - * alert('Failed: ' + reason); - * }, function(update) { - * alert('Got notification: ' + update); - * }); - * ``` - * - * At first it might not be obvious why this extra complexity is worth the trouble. The payoff - * comes in the way of guarantees that promise and deferred APIs make, see - * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md. - * - * Additionally the promise api allows for composition that is very hard to do with the - * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach. - * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the - * section on serial or parallel joining of promises. - * - * ## The Deferred API - * - * A new instance of deferred is constructed by calling `$q.defer()`. - * - * The purpose of the deferred object is to expose the associated Promise instance as well as APIs - * that can be used for signaling the successful or unsuccessful completion, as well as the status - * of the task. - * - * **Methods** - * - * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection - * constructed via `$q.reject`, the promise will be rejected instead. - * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to - * resolving it with a rejection constructed via `$q.reject`. - * - `notify(value)` - provides updates on the status of the promise's execution. This may be called - * multiple times before the promise is either resolved or rejected. - * - * **Properties** - * - * - promise – `{Promise}` – promise object associated with this deferred. - * - * - * ## The Promise API - * - * A new promise instance is created when a deferred instance is created and can be retrieved by - * calling `deferred.promise`. - * - * The purpose of the promise object is to allow for interested parties to get access to the result - * of the deferred task when it completes. - * - * **Methods** - * - * - `then(successCallback, [errorCallback], [notifyCallback])` – regardless of when the promise was or - * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously - * as soon as the result is available. The callbacks are called with a single argument: the result - * or rejection reason. Additionally, the notify callback may be called zero or more times to - * provide a progress indication, before the promise is resolved or rejected. - * - * This method *returns a new promise* which is resolved or rejected via the return value of the - * `successCallback`, `errorCallback` (unless that value is a promise, in which case it is resolved - * with the value which is resolved in that promise using - * [promise chaining](http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promises-queues)). - * It also notifies via the return value of the `notifyCallback` method. The promise cannot be - * resolved or rejected from the notifyCallback method. The errorCallback and notifyCallback - * arguments are optional. - * - * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)` - * - * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise, - * but to do so without modifying the final value. This is useful to release resources or do some - * clean-up that needs to be done whether the promise was rejected or resolved. See the [full - * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for - * more information. - * - * ## Chaining promises - * - * Because calling the `then` method of a promise returns a new derived promise, it is easily - * possible to create a chain of promises: - * - * ```js - * promiseB = promiseA.then(function(result) { - * return result + 1; - * }); - * - * // promiseB will be resolved immediately after promiseA is resolved and its value - * // will be the result of promiseA incremented by 1 - * ``` - * - * It is possible to create chains of any length and since a promise can be resolved with another - * promise (which will defer its resolution further), it is possible to pause/defer resolution of - * the promises at any point in the chain. This makes it possible to implement powerful APIs like - * $http's response interceptors. - * - * - * ## Differences between Kris Kowal's Q and $q - * - * There are two main differences: - * - * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation - * mechanism in AngularJS, which means faster propagation of resolution or rejection into your - * models and avoiding unnecessary browser repaints, which would result in flickering UI. - * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains - * all the important functionality needed for common async tasks. - * - * ## Testing - * - * ```js - * it('should simulate promise', inject(function($q, $rootScope) { - * var deferred = $q.defer(); - * var promise = deferred.promise; - * var resolvedValue; - * - * promise.then(function(value) { resolvedValue = value; }); - * expect(resolvedValue).toBeUndefined(); - * - * // Simulate resolving of promise - * deferred.resolve(123); - * // Note that the 'then' function does not get called synchronously. - * // This is because we want the promise API to always be async, whether or not - * // it got called synchronously or asynchronously. - * expect(resolvedValue).toBeUndefined(); - * - * // Propagate promise resolution to 'then' functions using $apply(). - * $rootScope.$apply(); - * expect(resolvedValue).toEqual(123); - * })); - * ``` - * - * @param {function(function, function)} resolver Function which is responsible for resolving or - * rejecting the newly created promise. The first parameter is a function which resolves the - * promise, the second parameter is a function which rejects the promise. - * - * @returns {Promise} The newly created promise. - */ - /** - * @ngdoc provider - * @name $qProvider - * @this - * - * @description - */ - function $QProvider() { - var errorOnUnhandledRejections = true; - this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) { - return qFactory(function(callback) { - $rootScope.$evalAsync(callback); - }, $exceptionHandler, errorOnUnhandledRejections); - }]; - - /** - * @ngdoc method - * @name $qProvider#errorOnUnhandledRejections - * @kind function - * - * @description - * Retrieves or overrides whether to generate an error when a rejected promise is not handled. - * This feature is enabled by default. - * - * @param {boolean=} value Whether to generate an error when a rejected promise is not handled. - * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for - * chaining otherwise. - */ - this.errorOnUnhandledRejections = function(value) { - if (isDefined(value)) { - errorOnUnhandledRejections = value; - return this; - } else { - return errorOnUnhandledRejections; - } - }; - } - - /** @this */ - function $$QProvider() { - var errorOnUnhandledRejections = true; - this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) { - return qFactory(function(callback) { - $browser.defer(callback); - }, $exceptionHandler, errorOnUnhandledRejections); - }]; - - this.errorOnUnhandledRejections = function(value) { - if (isDefined(value)) { - errorOnUnhandledRejections = value; - return this; - } else { - return errorOnUnhandledRejections; - } - }; - } - - /** - * Constructs a promise manager. - * - * @param {function(function)} nextTick Function for executing functions in the next turn. - * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for - * debugging purposes. - * @param {boolean=} errorOnUnhandledRejections Whether an error should be generated on unhandled - * promises rejections. - * @returns {object} Promise manager. - */ - function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) { - var $qMinErr = minErr('$q', TypeError); - var queueSize = 0; - var checkQueue = []; - - /** - * @ngdoc method - * @name ng.$q#defer - * @kind function - * - * @description - * Creates a `Deferred` object which represents a task which will finish in the future. - * - * @returns {Deferred} Returns a new instance of deferred. - */ - function defer() { - return new Deferred(); - } - - function Deferred() { - var promise = this.promise = new Promise(); - //Non prototype methods necessary to support unbound execution :/ - this.resolve = function(val) { resolvePromise(promise, val); }; - this.reject = function(reason) { rejectPromise(promise, reason); }; - this.notify = function(progress) { notifyPromise(promise, progress); }; - } - - - function Promise() { - this.$$state = { status: 0 }; - } - - extend(Promise.prototype, { - then: function(onFulfilled, onRejected, progressBack) { - if (isUndefined(onFulfilled) && isUndefined(onRejected) && isUndefined(progressBack)) { - return this; - } - var result = new Promise(); - - this.$$state.pending = this.$$state.pending || []; - this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]); - if (this.$$state.status > 0) scheduleProcessQueue(this.$$state); - - return result; - }, - - 'catch': function(callback) { - return this.then(null, callback); - }, - - 'finally': function(callback, progressBack) { - return this.then(function(value) { - return handleCallback(value, resolve, callback); - }, function(error) { - return handleCallback(error, reject, callback); - }, progressBack); - } - }); - - function processQueue(state) { - var fn, promise, pending; - - pending = state.pending; - state.processScheduled = false; - state.pending = undefined; - try { - for (var i = 0, ii = pending.length; i < ii; ++i) { - markQStateExceptionHandled(state); - promise = pending[i][0]; - fn = pending[i][state.status]; - try { - if (isFunction(fn)) { - resolvePromise(promise, fn(state.value)); - } else if (state.status === 1) { - resolvePromise(promise, state.value); - } else { - rejectPromise(promise, state.value); - } - } catch (e) { - rejectPromise(promise, e); - // This error is explicitly marked for being passed to the $exceptionHandler - if (e && e.$$passToExceptionHandler === true) { - exceptionHandler(e); - } - } - } - } finally { - --queueSize; - if (errorOnUnhandledRejections && queueSize === 0) { - nextTick(processChecks); - } - } - } - - function processChecks() { - // eslint-disable-next-line no-unmodified-loop-condition - while (!queueSize && checkQueue.length) { - var toCheck = checkQueue.shift(); - if (!isStateExceptionHandled(toCheck)) { - markQStateExceptionHandled(toCheck); - var errorMessage = 'Possibly unhandled rejection: ' + toDebugString(toCheck.value); - if (isError(toCheck.value)) { - exceptionHandler(toCheck.value, errorMessage); - } else { - exceptionHandler(errorMessage); - } - } - } - } - - function scheduleProcessQueue(state) { - if (errorOnUnhandledRejections && !state.pending && state.status === 2 && !isStateExceptionHandled(state)) { - if (queueSize === 0 && checkQueue.length === 0) { - nextTick(processChecks); - } - checkQueue.push(state); - } - if (state.processScheduled || !state.pending) return; - state.processScheduled = true; - ++queueSize; - nextTick(function() { processQueue(state); }); - } - - function resolvePromise(promise, val) { - if (promise.$$state.status) return; - if (val === promise) { - $$reject(promise, $qMinErr( - 'qcycle', - 'Expected promise to be resolved with value other than itself \'{0}\'', - val)); - } else { - $$resolve(promise, val); - } - - } - - function $$resolve(promise, val) { - var then; - var done = false; - try { - if (isObject(val) || isFunction(val)) then = val.then; - if (isFunction(then)) { - promise.$$state.status = -1; - then.call(val, doResolve, doReject, doNotify); - } else { - promise.$$state.value = val; - promise.$$state.status = 1; - scheduleProcessQueue(promise.$$state); - } - } catch (e) { - doReject(e); - } - - function doResolve(val) { - if (done) return; - done = true; - $$resolve(promise, val); - } - function doReject(val) { - if (done) return; - done = true; - $$reject(promise, val); - } - function doNotify(progress) { - notifyPromise(promise, progress); - } - } - - function rejectPromise(promise, reason) { - if (promise.$$state.status) return; - $$reject(promise, reason); - } - - function $$reject(promise, reason) { - promise.$$state.value = reason; - promise.$$state.status = 2; - scheduleProcessQueue(promise.$$state); - } - - function notifyPromise(promise, progress) { - var callbacks = promise.$$state.pending; - - if ((promise.$$state.status <= 0) && callbacks && callbacks.length) { - nextTick(function() { - var callback, result; - for (var i = 0, ii = callbacks.length; i < ii; i++) { - result = callbacks[i][0]; - callback = callbacks[i][3]; - try { - notifyPromise(result, isFunction(callback) ? callback(progress) : progress); - } catch (e) { - exceptionHandler(e); - } - } - }); - } - } - - /** - * @ngdoc method - * @name $q#reject - * @kind function - * - * @description - * Creates a promise that is resolved as rejected with the specified `reason`. This api should be - * used to forward rejection in a chain of promises. If you are dealing with the last promise in - * a promise chain, you don't need to worry about it. - * - * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of - * `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via - * a promise error callback and you want to forward the error to the promise derived from the - * current promise, you have to "rethrow" the error by returning a rejection constructed via - * `reject`. - * - * ```js - * promiseB = promiseA.then(function(result) { - * // success: do something and resolve promiseB - * // with the old or a new result - * return result; - * }, function(reason) { - * // error: handle the error if possible and - * // resolve promiseB with newPromiseOrValue, - * // otherwise forward the rejection to promiseB - * if (canHandle(reason)) { - * // handle the error and recover - * return newPromiseOrValue; - * } - * return $q.reject(reason); - * }); - * ``` - * - * @param {*} reason Constant, message, exception or an object representing the rejection reason. - * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`. - */ - function reject(reason) { - var result = new Promise(); - rejectPromise(result, reason); - return result; - } - - function handleCallback(value, resolver, callback) { - var callbackOutput = null; - try { - if (isFunction(callback)) callbackOutput = callback(); - } catch (e) { - return reject(e); - } - if (isPromiseLike(callbackOutput)) { - return callbackOutput.then(function() { - return resolver(value); - }, reject); - } else { - return resolver(value); - } - } - - /** - * @ngdoc method - * @name $q#when - * @kind function - * - * @description - * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. - * This is useful when you are dealing with an object that might or might not be a promise, or if - * the promise comes from a source that can't be trusted. - * - * @param {*} value Value or a promise - * @param {Function=} successCallback - * @param {Function=} errorCallback - * @param {Function=} progressCallback - * @returns {Promise} Returns a promise of the passed value or promise - */ - - - function when(value, callback, errback, progressBack) { - var result = new Promise(); - resolvePromise(result, value); - return result.then(callback, errback, progressBack); - } - - /** - * @ngdoc method - * @name $q#resolve - * @kind function - * - * @description - * Alias of {@link ng.$q#when when} to maintain naming consistency with ES6. - * - * @param {*} value Value or a promise - * @param {Function=} successCallback - * @param {Function=} errorCallback - * @param {Function=} progressCallback - * @returns {Promise} Returns a promise of the passed value or promise - */ - var resolve = when; - - /** - * @ngdoc method - * @name $q#all - * @kind function - * - * @description - * Combines multiple promises into a single promise that is resolved when all of the input - * promises are resolved. - * - * @param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises. - * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values, - * each value corresponding to the promise at the same index/key in the `promises` array/hash. - * If any of the promises is resolved with a rejection, this resulting promise will be rejected - * with the same rejection value. - */ - - function all(promises) { - var result = new Promise(), - counter = 0, - results = isArray(promises) ? [] : {}; - - forEach(promises, function(promise, key) { - counter++; - when(promise).then(function(value) { - results[key] = value; - if (!(--counter)) resolvePromise(result, results); - }, function(reason) { - rejectPromise(result, reason); - }); - }); - - if (counter === 0) { - resolvePromise(result, results); - } - - return result; - } - - /** - * @ngdoc method - * @name $q#race - * @kind function - * - * @description - * Returns a promise that resolves or rejects as soon as one of those promises - * resolves or rejects, with the value or reason from that promise. - * - * @param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises. - * @returns {Promise} a promise that resolves or rejects as soon as one of the `promises` - * resolves or rejects, with the value or reason from that promise. - */ - - function race(promises) { - var deferred = defer(); - - forEach(promises, function(promise) { - when(promise).then(deferred.resolve, deferred.reject); - }); - - return deferred.promise; - } - - function $Q(resolver) { - if (!isFunction(resolver)) { - throw $qMinErr('norslvr', 'Expected resolverFn, got \'{0}\'', resolver); - } - - var promise = new Promise(); - - function resolveFn(value) { - resolvePromise(promise, value); - } - - function rejectFn(reason) { - rejectPromise(promise, reason); - } - - resolver(resolveFn, rejectFn); - - return promise; - } - - // Let's make the instanceof operator work for promises, so that - // `new $q(fn) instanceof $q` would evaluate to true. - $Q.prototype = Promise.prototype; - - $Q.defer = defer; - $Q.reject = reject; - $Q.when = when; - $Q.resolve = resolve; - $Q.all = all; - $Q.race = race; - - return $Q; - } - - function isStateExceptionHandled(state) { - return !!state.pur; - } - function markQStateExceptionHandled(state) { - state.pur = true; - } - function markQExceptionHandled(q) { - markQStateExceptionHandled(q.$$state); - } - - /** @this */ - function $$RAFProvider() { //rAF - this.$get = ['$window', '$timeout', function($window, $timeout) { - var requestAnimationFrame = $window.requestAnimationFrame || - $window.webkitRequestAnimationFrame; - - var cancelAnimationFrame = $window.cancelAnimationFrame || - $window.webkitCancelAnimationFrame || - $window.webkitCancelRequestAnimationFrame; - - var rafSupported = !!requestAnimationFrame; - var raf = rafSupported - ? function(fn) { - var id = requestAnimationFrame(fn); - return function() { - cancelAnimationFrame(id); - }; - } - : function(fn) { - var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666 - return function() { - $timeout.cancel(timer); - }; - }; - - raf.supported = rafSupported; - - return raf; - }]; - } - - /** - * DESIGN NOTES - * - * The design decisions behind the scope are heavily favored for speed and memory consumption. - * - * The typical use of scope is to watch the expressions, which most of the time return the same - * value as last time so we optimize the operation. - * - * Closures construction is expensive in terms of speed as well as memory: - * - No closures, instead use prototypical inheritance for API - * - Internal state needs to be stored on scope directly, which means that private state is - * exposed as $$____ properties - * - * Loop operations are optimized by using while(count--) { ... } - * - This means that in order to keep the same order of execution as addition we have to add - * items to the array at the beginning (unshift) instead of at the end (push) - * - * Child scopes are created and removed often - * - Using an array would be slow since inserts in the middle are expensive; so we use linked lists - * - * There are fewer watches than observers. This is why you don't want the observer to be implemented - * in the same way as watch. Watch requires return of the initialization function which is expensive - * to construct. - */ - - - /** - * @ngdoc provider - * @name $rootScopeProvider - * @description - * - * Provider for the $rootScope service. - */ - - /** - * @ngdoc method - * @name $rootScopeProvider#digestTtl - * @description - * - * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and - * assuming that the model is unstable. - * - * The current default is 10 iterations. - * - * In complex applications it's possible that the dependencies between `$watch`s will result in - * several digest iterations. However if an application needs more than the default 10 digest - * iterations for its model to stabilize then you should investigate what is causing the model to - * continuously change during the digest. - * - * Increasing the TTL could have performance implications, so you should not change it without - * proper justification. - * - * @param {number} limit The number of digest iterations. - */ - - - /** - * @ngdoc service - * @name $rootScope - * @this - * - * @description - * - * Every application has a single root {@link ng.$rootScope.Scope scope}. - * All other scopes are descendant scopes of the root scope. Scopes provide separation - * between the model and the view, via a mechanism for watching the model for changes. - * They also provide event emission/broadcast and subscription facility. See the - * {@link guide/scope developer guide on scopes}. - */ - function $RootScopeProvider() { - var TTL = 10; - var $rootScopeMinErr = minErr('$rootScope'); - var lastDirtyWatch = null; - var applyAsyncId = null; - - this.digestTtl = function(value) { - if (arguments.length) { - TTL = value; - } - return TTL; - }; - - function createChildScopeClass(parent) { - function ChildScope() { - this.$$watchers = this.$$nextSibling = - this.$$childHead = this.$$childTail = null; - this.$$listeners = {}; - this.$$listenerCount = {}; - this.$$watchersCount = 0; - this.$id = nextUid(); - this.$$ChildScope = null; - } - ChildScope.prototype = parent; - return ChildScope; - } - - this.$get = ['$exceptionHandler', '$parse', '$browser', - function($exceptionHandler, $parse, $browser) { - - function destroyChildScope($event) { - $event.currentScope.$$destroyed = true; - } - - function cleanUpScope($scope) { - - // Support: IE 9 only - if (msie === 9) { - // There is a memory leak in IE9 if all child scopes are not disconnected - // completely when a scope is destroyed. So this code will recurse up through - // all this scopes children - // - // See issue https://github.com/angular/angular.js/issues/10706 - if ($scope.$$childHead) { - cleanUpScope($scope.$$childHead); - } - if ($scope.$$nextSibling) { - cleanUpScope($scope.$$nextSibling); - } - } - - // The code below works around IE9 and V8's memory leaks - // - // See: - // - https://code.google.com/p/v8/issues/detail?id=2073#c26 - // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909 - // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451 - - $scope.$parent = $scope.$$nextSibling = $scope.$$prevSibling = $scope.$$childHead = - $scope.$$childTail = $scope.$root = $scope.$$watchers = null; - } - - /** - * @ngdoc type - * @name $rootScope.Scope - * - * @description - * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the - * {@link auto.$injector $injector}. Child scopes are created using the - * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when - * compiled HTML template is executed.) See also the {@link guide/scope Scopes guide} for - * an in-depth introduction and usage examples. - * - * - * ## Inheritance - * A scope can inherit from a parent scope, as in this example: - * ```js - var parent = $rootScope; - var child = parent.$new(); - - parent.salutation = "Hello"; - expect(child.salutation).toEqual('Hello'); - - child.salutation = "Welcome"; - expect(child.salutation).toEqual('Welcome'); - expect(parent.salutation).toEqual('Hello'); - * ``` - * - * When interacting with `Scope` in tests, additional helper methods are available on the - * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional - * details. - * - * - * @param {Object.<string, function()>=} providers Map of service factory which need to be - * provided for the current scope. Defaults to {@link ng}. - * @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should - * append/override services provided by `providers`. This is handy - * when unit-testing and having the need to override a default - * service. - * @returns {Object} Newly created scope. - * - */ - function Scope() { - this.$id = nextUid(); - this.$$phase = this.$parent = this.$$watchers = - this.$$nextSibling = this.$$prevSibling = - this.$$childHead = this.$$childTail = null; - this.$root = this; - this.$$destroyed = false; - this.$$listeners = {}; - this.$$listenerCount = {}; - this.$$watchersCount = 0; - this.$$isolateBindings = null; - } - - /** - * @ngdoc property - * @name $rootScope.Scope#$id - * - * @description - * Unique scope ID (monotonically increasing) useful for debugging. - */ - - /** - * @ngdoc property - * @name $rootScope.Scope#$parent - * - * @description - * Reference to the parent scope. - */ - - /** - * @ngdoc property - * @name $rootScope.Scope#$root - * - * @description - * Reference to the root scope. - */ - - Scope.prototype = { - constructor: Scope, - /** - * @ngdoc method - * @name $rootScope.Scope#$new - * @kind function - * - * @description - * Creates a new child {@link ng.$rootScope.Scope scope}. - * - * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event. - * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}. - * - * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is - * desired for the scope and its child scopes to be permanently detached from the parent and - * thus stop participating in model change detection and listener notification by invoking. - * - * @param {boolean} isolate If true, then the scope does not prototypically inherit from the - * parent scope. The scope is isolated, as it can not see parent scope properties. - * When creating widgets, it is useful for the widget to not accidentally read parent - * state. - * - * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent` - * of the newly created scope. Defaults to `this` scope if not provided. - * This is used when creating a transclude scope to correctly place it - * in the scope hierarchy while maintaining the correct prototypical - * inheritance. - * - * @returns {Object} The newly created child scope. - * - */ - $new: function(isolate, parent) { - var child; - - parent = parent || this; - - if (isolate) { - child = new Scope(); - child.$root = this.$root; - } else { - // Only create a child scope class if somebody asks for one, - // but cache it to allow the VM to optimize lookups. - if (!this.$$ChildScope) { - this.$$ChildScope = createChildScopeClass(this); - } - child = new this.$$ChildScope(); - } - child.$parent = parent; - child.$$prevSibling = parent.$$childTail; - if (parent.$$childHead) { - parent.$$childTail.$$nextSibling = child; - parent.$$childTail = child; - } else { - parent.$$childHead = parent.$$childTail = child; - } - - // When the new scope is not isolated or we inherit from `this`, and - // the parent scope is destroyed, the property `$$destroyed` is inherited - // prototypically. In all other cases, this property needs to be set - // when the parent scope is destroyed. - // The listener needs to be added after the parent is set - if (isolate || parent !== this) child.$on('$destroy', destroyChildScope); - - return child; - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$watch - * @kind function - * - * @description - * Registers a `listener` callback to be executed whenever the `watchExpression` changes. - * - * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest - * $digest()} and should return the value that will be watched. (`watchExpression` should not change - * its value when executed multiple times with the same input because it may be executed multiple - * times by {@link ng.$rootScope.Scope#$digest $digest()}. That is, `watchExpression` should be - * [idempotent](http://en.wikipedia.org/wiki/Idempotence).) - * - The `listener` is called only when the value from the current `watchExpression` and the - * previous call to `watchExpression` are not equal (with the exception of the initial run, - * see below). Inequality is determined according to reference inequality, - * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators) - * via the `!==` Javascript operator, unless `objectEquality == true` - * (see next point) - * - When `objectEquality == true`, inequality of the `watchExpression` is determined - * according to the {@link angular.equals} function. To save the value of the object for - * later comparison, the {@link angular.copy} function is used. This therefore means that - * watching complex objects will have adverse memory and performance implications. - * - This should not be used to watch for changes in objects that are - * or contain [File](https://developer.mozilla.org/docs/Web/API/File) objects due to limitations with {@link angular.copy `angular.copy`}. - * - The watch `listener` may change the model, which may trigger other `listener`s to fire. - * This is achieved by rerunning the watchers until no changes are detected. The rerun - * iteration limit is 10 to prevent an infinite loop deadlock. - * - * - * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called, - * you can register a `watchExpression` function with no `listener`. (Be prepared for - * multiple calls to your `watchExpression` because it will execute multiple times in a - * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.) - * - * After a watcher is registered with the scope, the `listener` fn is called asynchronously - * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the - * watcher. In rare cases, this is undesirable because the listener is called when the result - * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you - * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the - * listener was called due to initialization. - * - * - * - * @example - * ```js - // let's assume that scope was dependency injected as the $rootScope - var scope = $rootScope; - scope.name = 'misko'; - scope.counter = 0; - - expect(scope.counter).toEqual(0); - scope.$watch('name', function(newValue, oldValue) { - scope.counter = scope.counter + 1; - }); - expect(scope.counter).toEqual(0); - - scope.$digest(); - // the listener is always called during the first $digest loop after it was registered - expect(scope.counter).toEqual(1); - - scope.$digest(); - // but now it will not be called unless the value changes - expect(scope.counter).toEqual(1); - - scope.name = 'adam'; - scope.$digest(); - expect(scope.counter).toEqual(2); - - - - // Using a function as a watchExpression - var food; - scope.foodCounter = 0; - expect(scope.foodCounter).toEqual(0); - scope.$watch( - // This function returns the value being watched. It is called for each turn of the $digest loop - function() { return food; }, - // This is the change listener, called when the value returned from the above function changes - function(newValue, oldValue) { - if ( newValue !== oldValue ) { - // Only increment the counter if the value changed - scope.foodCounter = scope.foodCounter + 1; - } - } - ); - // No digest has been run so the counter will be zero - expect(scope.foodCounter).toEqual(0); - - // Run the digest but since food has not changed count will still be zero - scope.$digest(); - expect(scope.foodCounter).toEqual(0); - - // Update food and run digest. Now the counter will increment - food = 'cheeseburger'; - scope.$digest(); - expect(scope.foodCounter).toEqual(1); - - * ``` - * - * - * - * @param {(function()|string)} watchExpression Expression that is evaluated on each - * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers - * a call to the `listener`. - * - * - `string`: Evaluated as {@link guide/expression expression} - * - `function(scope)`: called with current `scope` as a parameter. - * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value - * of `watchExpression` changes. - * - * - `newVal` contains the current value of the `watchExpression` - * - `oldVal` contains the previous value of the `watchExpression` - * - `scope` refers to the current scope - * @param {boolean=} [objectEquality=false] Compare for object equality using {@link angular.equals} instead of - * comparing for reference equality. - * @returns {function()} Returns a deregistration function for this listener. - */ - $watch: function(watchExp, listener, objectEquality, prettyPrintExpression) { - var get = $parse(watchExp); - var fn = isFunction(listener) ? listener : noop; - - if (get.$$watchDelegate) { - return get.$$watchDelegate(this, fn, objectEquality, get, watchExp); - } - var scope = this, - array = scope.$$watchers, - watcher = { - fn: fn, - last: initWatchVal, - get: get, - exp: prettyPrintExpression || watchExp, - eq: !!objectEquality - }; - - lastDirtyWatch = null; - - if (!array) { - array = scope.$$watchers = []; - array.$$digestWatchIndex = -1; - } - // we use unshift since we use a while loop in $digest for speed. - // the while loop reads in reverse order. - array.unshift(watcher); - array.$$digestWatchIndex++; - incrementWatchersCount(this, 1); - - return function deregisterWatch() { - var index = arrayRemove(array, watcher); - if (index >= 0) { - incrementWatchersCount(scope, -1); - if (index < array.$$digestWatchIndex) { - array.$$digestWatchIndex--; - } - } - lastDirtyWatch = null; - }; - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$watchGroup - * @kind function - * - * @description - * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`. - * If any one expression in the collection changes the `listener` is executed. - * - * - The items in the `watchExpressions` array are observed via the standard `$watch` operation. Their return - * values are examined for changes on every call to `$digest`. - * - The `listener` is called whenever any expression in the `watchExpressions` array changes. - * - * `$watchGroup` is more performant than watching each expression individually, and should be - * used when the listener does not need to know which expression has changed. - * If the listener needs to know which expression has changed, - * {@link ng.$rootScope.Scope#$watch $watch()} or - * {@link ng.$rootScope.Scope#$watchCollection $watchCollection()} should be used. - * - * @param {Array.<string|Function(scope)>} watchExpressions Array of expressions that will be individually - * watched using {@link ng.$rootScope.Scope#$watch $watch()} - * - * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any - * expression in `watchExpressions` changes - * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching - * those of `watchExpression` - * and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching - * those of `watchExpression`. - * - * Note that `newValues` and `oldValues` reflect the differences in each **individual** - * expression, and not the difference of the values between each call of the listener. - * That means the difference between `newValues` and `oldValues` cannot be used to determine - * which expression has changed / remained stable: - * - * ```js - * - * $scope.$watchGroup(['v1', 'v2'], function(newValues, oldValues) { - * console.log(newValues, oldValues); - * }); - * - * // newValues, oldValues initially - * // [undefined, undefined], [undefined, undefined] - * - * $scope.v1 = 'a'; - * $scope.v2 = 'a'; - * - * // ['a', 'a'], [undefined, undefined] - * - * $scope.v2 = 'b' - * - * // v1 hasn't changed since it became `'a'`, therefore its oldValue is still `undefined` - * // ['a', 'b'], [undefined, 'a'] - * - * ``` - * - * The `scope` refers to the current scope. - * @returns {function()} Returns a de-registration function for all listeners. - */ - $watchGroup: function(watchExpressions, listener) { - var oldValues = new Array(watchExpressions.length); - var newValues = new Array(watchExpressions.length); - var deregisterFns = []; - var self = this; - var changeReactionScheduled = false; - var firstRun = true; - - if (!watchExpressions.length) { - // No expressions means we call the listener ASAP - var shouldCall = true; - self.$evalAsync(function() { - if (shouldCall) listener(newValues, newValues, self); - }); - return function deregisterWatchGroup() { - shouldCall = false; - }; - } - - if (watchExpressions.length === 1) { - // Special case size of one - return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) { - newValues[0] = value; - oldValues[0] = oldValue; - listener(newValues, (value === oldValue) ? newValues : oldValues, scope); - }); - } - - forEach(watchExpressions, function(expr, i) { - var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) { - newValues[i] = value; - oldValues[i] = oldValue; - if (!changeReactionScheduled) { - changeReactionScheduled = true; - self.$evalAsync(watchGroupAction); - } - }); - deregisterFns.push(unwatchFn); - }); - - function watchGroupAction() { - changeReactionScheduled = false; - - if (firstRun) { - firstRun = false; - listener(newValues, newValues, self); - } else { - listener(newValues, oldValues, self); - } - } - - return function deregisterWatchGroup() { - while (deregisterFns.length) { - deregisterFns.shift()(); - } - }; - }, - - - /** - * @ngdoc method - * @name $rootScope.Scope#$watchCollection - * @kind function - * - * @description - * Shallow watches the properties of an object and fires whenever any of the properties change - * (for arrays, this implies watching the array items; for object maps, this implies watching - * the properties). If a change is detected, the `listener` callback is fired. - * - * - The `obj` collection is observed via standard $watch operation and is examined on every - * call to $digest() to see if any items have been added, removed, or moved. - * - The `listener` is called whenever anything within the `obj` has changed. Examples include - * adding, removing, and moving items belonging to an object or array. - * - * - * @example - * ```js - $scope.names = ['igor', 'matias', 'misko', 'james']; - $scope.dataCount = 4; - - $scope.$watchCollection('names', function(newNames, oldNames) { - $scope.dataCount = newNames.length; - }); - - expect($scope.dataCount).toEqual(4); - $scope.$digest(); - - //still at 4 ... no changes - expect($scope.dataCount).toEqual(4); - - $scope.names.pop(); - $scope.$digest(); - - //now there's been a change - expect($scope.dataCount).toEqual(3); - * ``` - * - * - * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The - * expression value should evaluate to an object or an array which is observed on each - * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the - * collection will trigger a call to the `listener`. - * - * @param {function(newCollection, oldCollection, scope)} listener a callback function called - * when a change is detected. - * - The `newCollection` object is the newly modified data obtained from the `obj` expression - * - The `oldCollection` object is a copy of the former collection data. - * Due to performance considerations, the`oldCollection` value is computed only if the - * `listener` function declares two or more arguments. - * - The `scope` argument refers to the current scope. - * - * @returns {function()} Returns a de-registration function for this listener. When the - * de-registration function is executed, the internal watch operation is terminated. - */ - $watchCollection: function(obj, listener) { - $watchCollectionInterceptor.$stateful = true; - - var self = this; - // the current value, updated on each dirty-check run - var newValue; - // a shallow copy of the newValue from the last dirty-check run, - // updated to match newValue during dirty-check run - var oldValue; - // a shallow copy of the newValue from when the last change happened - var veryOldValue; - // only track veryOldValue if the listener is asking for it - var trackVeryOldValue = (listener.length > 1); - var changeDetected = 0; - var changeDetector = $parse(obj, $watchCollectionInterceptor); - var internalArray = []; - var internalObject = {}; - var initRun = true; - var oldLength = 0; - - function $watchCollectionInterceptor(_value) { - newValue = _value; - var newLength, key, bothNaN, newItem, oldItem; - - // If the new value is undefined, then return undefined as the watch may be a one-time watch - if (isUndefined(newValue)) return; - - if (!isObject(newValue)) { // if primitive - if (oldValue !== newValue) { - oldValue = newValue; - changeDetected++; - } - } else if (isArrayLike(newValue)) { - if (oldValue !== internalArray) { - // we are transitioning from something which was not an array into array. - oldValue = internalArray; - oldLength = oldValue.length = 0; - changeDetected++; - } - - newLength = newValue.length; - - if (oldLength !== newLength) { - // if lengths do not match we need to trigger change notification - changeDetected++; - oldValue.length = oldLength = newLength; - } - // copy the items to oldValue and look for changes. - for (var i = 0; i < newLength; i++) { - oldItem = oldValue[i]; - newItem = newValue[i]; - - // eslint-disable-next-line no-self-compare - bothNaN = (oldItem !== oldItem) && (newItem !== newItem); - if (!bothNaN && (oldItem !== newItem)) { - changeDetected++; - oldValue[i] = newItem; - } - } - } else { - if (oldValue !== internalObject) { - // we are transitioning from something which was not an object into object. - oldValue = internalObject = {}; - oldLength = 0; - changeDetected++; - } - // copy the items to oldValue and look for changes. - newLength = 0; - for (key in newValue) { - if (hasOwnProperty.call(newValue, key)) { - newLength++; - newItem = newValue[key]; - oldItem = oldValue[key]; - - if (key in oldValue) { - // eslint-disable-next-line no-self-compare - bothNaN = (oldItem !== oldItem) && (newItem !== newItem); - if (!bothNaN && (oldItem !== newItem)) { - changeDetected++; - oldValue[key] = newItem; - } - } else { - oldLength++; - oldValue[key] = newItem; - changeDetected++; - } - } - } - if (oldLength > newLength) { - // we used to have more keys, need to find them and destroy them. - changeDetected++; - for (key in oldValue) { - if (!hasOwnProperty.call(newValue, key)) { - oldLength--; - delete oldValue[key]; - } - } - } - } - return changeDetected; - } - - function $watchCollectionAction() { - if (initRun) { - initRun = false; - listener(newValue, newValue, self); - } else { - listener(newValue, veryOldValue, self); - } - - // make a copy for the next time a collection is changed - if (trackVeryOldValue) { - if (!isObject(newValue)) { - //primitive - veryOldValue = newValue; - } else if (isArrayLike(newValue)) { - veryOldValue = new Array(newValue.length); - for (var i = 0; i < newValue.length; i++) { - veryOldValue[i] = newValue[i]; - } - } else { // if object - veryOldValue = {}; - for (var key in newValue) { - if (hasOwnProperty.call(newValue, key)) { - veryOldValue[key] = newValue[key]; - } - } - } - } - } - - return this.$watch(changeDetector, $watchCollectionAction); - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$digest - * @kind function - * - * @description - * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and - * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change - * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers} - * until no more listeners are firing. This means that it is possible to get into an infinite - * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of - * iterations exceeds 10. - * - * Usually, you don't call `$digest()` directly in - * {@link ng.directive:ngController controllers} or in - * {@link ng.$compileProvider#directive directives}. - * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within - * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`. - * - * If you want to be notified whenever `$digest()` is called, - * you can register a `watchExpression` function with - * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`. - * - * In unit tests, you may need to call `$digest()` to simulate the scope life cycle. - * - * @example - * ```js - var scope = ...; - scope.name = 'misko'; - scope.counter = 0; - - expect(scope.counter).toEqual(0); - scope.$watch('name', function(newValue, oldValue) { - scope.counter = scope.counter + 1; - }); - expect(scope.counter).toEqual(0); - - scope.$digest(); - // the listener is always called during the first $digest loop after it was registered - expect(scope.counter).toEqual(1); - - scope.$digest(); - // but now it will not be called unless the value changes - expect(scope.counter).toEqual(1); - - scope.name = 'adam'; - scope.$digest(); - expect(scope.counter).toEqual(2); - * ``` - * - */ - $digest: function() { - var watch, value, last, fn, get, - watchers, - dirty, ttl = TTL, - next, current, target = this, - watchLog = [], - logIdx, asyncTask; - - beginPhase('$digest'); - // Check for changes to browser url that happened in sync before the call to $digest - $browser.$$checkUrlChange(); - - if (this === $rootScope && applyAsyncId !== null) { - // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then - // cancel the scheduled $apply and flush the queue of expressions to be evaluated. - $browser.defer.cancel(applyAsyncId); - flushApplyAsync(); - } - - lastDirtyWatch = null; - - do { // "while dirty" loop - dirty = false; - current = target; - - // It's safe for asyncQueuePosition to be a local variable here because this loop can't - // be reentered recursively. Calling $digest from a function passed to $evalAsync would - // lead to a '$digest already in progress' error. - for (var asyncQueuePosition = 0; asyncQueuePosition < asyncQueue.length; asyncQueuePosition++) { - try { - asyncTask = asyncQueue[asyncQueuePosition]; - fn = asyncTask.fn; - fn(asyncTask.scope, asyncTask.locals); - } catch (e) { - $exceptionHandler(e); - } - lastDirtyWatch = null; - } - asyncQueue.length = 0; - - traverseScopesLoop: - do { // "traverse the scopes" loop - if ((watchers = current.$$watchers)) { - // process our watches - watchers.$$digestWatchIndex = watchers.length; - while (watchers.$$digestWatchIndex--) { - try { - watch = watchers[watchers.$$digestWatchIndex]; - // Most common watches are on primitives, in which case we can short - // circuit it with === operator, only when === fails do we use .equals - if (watch) { - get = watch.get; - if ((value = get(current)) !== (last = watch.last) && - !(watch.eq - ? equals(value, last) - : (isNumberNaN(value) && isNumberNaN(last)))) { - dirty = true; - lastDirtyWatch = watch; - watch.last = watch.eq ? copy(value, null) : value; - fn = watch.fn; - fn(value, ((last === initWatchVal) ? value : last), current); - if (ttl < 5) { - logIdx = 4 - ttl; - if (!watchLog[logIdx]) watchLog[logIdx] = []; - watchLog[logIdx].push({ - msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp, - newVal: value, - oldVal: last - }); - } - } else if (watch === lastDirtyWatch) { - // If the most recently dirty watcher is now clean, short circuit since the remaining watchers - // have already been tested. - dirty = false; - break traverseScopesLoop; - } - } - } catch (e) { - $exceptionHandler(e); - } - } - } - - // Insanity Warning: scope depth-first traversal - // yes, this code is a bit crazy, but it works and we have tests to prove it! - // this piece should be kept in sync with the traversal in $broadcast - if (!(next = ((current.$$watchersCount && current.$$childHead) || - (current !== target && current.$$nextSibling)))) { - while (current !== target && !(next = current.$$nextSibling)) { - current = current.$parent; - } - } - } while ((current = next)); - - // `break traverseScopesLoop;` takes us to here - - if ((dirty || asyncQueue.length) && !(ttl--)) { - clearPhase(); - throw $rootScopeMinErr('infdig', - '{0} $digest() iterations reached. Aborting!\n' + - 'Watchers fired in the last 5 iterations: {1}', - TTL, watchLog); - } - - } while (dirty || asyncQueue.length); - - clearPhase(); - - // postDigestQueuePosition isn't local here because this loop can be reentered recursively. - while (postDigestQueuePosition < postDigestQueue.length) { - try { - postDigestQueue[postDigestQueuePosition++](); - } catch (e) { - $exceptionHandler(e); - } - } - postDigestQueue.length = postDigestQueuePosition = 0; - - // Check for changes to browser url that happened during the $digest - // (for which no event is fired; e.g. via `history.pushState()`) - $browser.$$checkUrlChange(); - }, - - - /** - * @ngdoc event - * @name $rootScope.Scope#$destroy - * @eventType broadcast on scope being destroyed - * - * @description - * Broadcasted when a scope and its children are being destroyed. - * - * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to - * clean up DOM bindings before an element is removed from the DOM. - */ - - /** - * @ngdoc method - * @name $rootScope.Scope#$destroy - * @kind function - * - * @description - * Removes the current scope (and all of its children) from the parent scope. Removal implies - * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer - * propagate to the current scope and its children. Removal also implies that the current - * scope is eligible for garbage collection. - * - * The `$destroy()` is usually used by directives such as - * {@link ng.directive:ngRepeat ngRepeat} for managing the - * unrolling of the loop. - * - * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope. - * Application code can register a `$destroy` event handler that will give it a chance to - * perform any necessary cleanup. - * - * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to - * clean up DOM bindings before an element is removed from the DOM. - */ - $destroy: function() { - // We can't destroy a scope that has been already destroyed. - if (this.$$destroyed) return; - var parent = this.$parent; - - this.$broadcast('$destroy'); - this.$$destroyed = true; - - if (this === $rootScope) { - //Remove handlers attached to window when $rootScope is removed - $browser.$$applicationDestroyed(); - } - - incrementWatchersCount(this, -this.$$watchersCount); - for (var eventName in this.$$listenerCount) { - decrementListenerCount(this, this.$$listenerCount[eventName], eventName); - } - - // sever all the references to parent scopes (after this cleanup, the current scope should - // not be retained by any of our references and should be eligible for garbage collection) - if (parent && parent.$$childHead === this) parent.$$childHead = this.$$nextSibling; - if (parent && parent.$$childTail === this) parent.$$childTail = this.$$prevSibling; - if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling; - if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling; - - // Disable listeners, watchers and apply/digest methods - this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop; - this.$on = this.$watch = this.$watchGroup = function() { return noop; }; - this.$$listeners = {}; - - // Disconnect the next sibling to prevent `cleanUpScope` destroying those too - this.$$nextSibling = null; - cleanUpScope(this); - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$eval - * @kind function - * - * @description - * Executes the `expression` on the current scope and returns the result. Any exceptions in - * the expression are propagated (uncaught). This is useful when evaluating AngularJS - * expressions. - * - * @example - * ```js - var scope = ng.$rootScope.Scope(); - scope.a = 1; - scope.b = 2; - - expect(scope.$eval('a+b')).toEqual(3); - expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3); - * ``` - * - * @param {(string|function())=} expression An AngularJS expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with the current `scope` parameter. - * - * @param {(object)=} locals Local variables object, useful for overriding values in scope. - * @returns {*} The result of evaluating the expression. - */ - $eval: function(expr, locals) { - return $parse(expr)(this, locals); - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$evalAsync - * @kind function - * - * @description - * Executes the expression on the current scope at a later point in time. - * - * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only - * that: - * - * - it will execute after the function that scheduled the evaluation (preferably before DOM - * rendering). - * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after - * `expression` execution. - * - * Any exceptions from the execution of the expression are forwarded to the - * {@link ng.$exceptionHandler $exceptionHandler} service. - * - * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle - * will be scheduled. However, it is encouraged to always call code that changes the model - * from within an `$apply` call. That includes code evaluated via `$evalAsync`. - * - * @param {(string|function())=} expression An AngularJS expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with the current `scope` parameter. - * - * @param {(object)=} locals Local variables object, useful for overriding values in scope. - */ - $evalAsync: function(expr, locals) { - // if we are outside of an $digest loop and this is the first time we are scheduling async - // task also schedule async auto-flush - if (!$rootScope.$$phase && !asyncQueue.length) { - $browser.defer(function() { - if (asyncQueue.length) { - $rootScope.$digest(); - } - }); - } - - asyncQueue.push({scope: this, fn: $parse(expr), locals: locals}); - }, - - $$postDigest: function(fn) { - postDigestQueue.push(fn); - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$apply - * @kind function - * - * @description - * `$apply()` is used to execute an expression in AngularJS from outside of the AngularJS - * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries). - * Because we are calling into the AngularJS framework we need to perform proper scope life - * cycle of {@link ng.$exceptionHandler exception handling}, - * {@link ng.$rootScope.Scope#$digest executing watches}. - * - * **Life cycle: Pseudo-Code of `$apply()`** - * - * ```js - function $apply(expr) { - try { - return $eval(expr); - } catch (e) { - $exceptionHandler(e); - } finally { - $root.$digest(); - } - } - * ``` - * - * - * Scope's `$apply()` method transitions through the following stages: - * - * 1. The {@link guide/expression expression} is executed using the - * {@link ng.$rootScope.Scope#$eval $eval()} method. - * 2. Any exceptions from the execution of the expression are forwarded to the - * {@link ng.$exceptionHandler $exceptionHandler} service. - * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the - * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method. - * - * - * @param {(string|function())=} exp An AngularJS expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with current `scope` parameter. - * - * @returns {*} The result of evaluating the expression. - */ - $apply: function(expr) { - try { - beginPhase('$apply'); - try { - return this.$eval(expr); - } finally { - clearPhase(); - } - } catch (e) { - $exceptionHandler(e); - } finally { - try { - $rootScope.$digest(); - } catch (e) { - $exceptionHandler(e); - // eslint-disable-next-line no-unsafe-finally - throw e; - } - } - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$applyAsync - * @kind function - * - * @description - * Schedule the invocation of $apply to occur at a later time. The actual time difference - * varies across browsers, but is typically around ~10 milliseconds. - * - * This can be used to queue up multiple expressions which need to be evaluated in the same - * digest. - * - * @param {(string|function())=} exp An AngularJS expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with current `scope` parameter. - */ - $applyAsync: function(expr) { - var scope = this; - if (expr) { - applyAsyncQueue.push($applyAsyncExpression); - } - expr = $parse(expr); - scheduleApplyAsync(); - - function $applyAsyncExpression() { - scope.$eval(expr); - } - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$on - * @kind function - * - * @description - * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for - * discussion of event life cycle. - * - * The event listener function format is: `function(event, args...)`. The `event` object - * passed into the listener has the following attributes: - * - * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or - * `$broadcast`-ed. - * - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the - * event propagates through the scope hierarchy, this property is set to null. - * - `name` - `{string}`: name of the event. - * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel - * further event propagation (available only for events that were `$emit`-ed). - * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag - * to true. - * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called. - * - * @param {string} name Event name to listen on. - * @param {function(event, ...args)} listener Function to call when the event is emitted. - * @returns {function()} Returns a deregistration function for this listener. - */ - $on: function(name, listener) { - var namedListeners = this.$$listeners[name]; - if (!namedListeners) { - this.$$listeners[name] = namedListeners = []; - } - namedListeners.push(listener); - - var current = this; - do { - if (!current.$$listenerCount[name]) { - current.$$listenerCount[name] = 0; - } - current.$$listenerCount[name]++; - } while ((current = current.$parent)); - - var self = this; - return function() { - var indexOfListener = namedListeners.indexOf(listener); - if (indexOfListener !== -1) { - // Use delete in the hope of the browser deallocating the memory for the array entry, - // while not shifting the array indexes of other listeners. - // See issue https://github.com/angular/angular.js/issues/16135 - delete namedListeners[indexOfListener]; - decrementListenerCount(self, 1, name); - } - }; - }, - - - /** - * @ngdoc method - * @name $rootScope.Scope#$emit - * @kind function - * - * @description - * Dispatches an event `name` upwards through the scope hierarchy notifying the - * registered {@link ng.$rootScope.Scope#$on} listeners. - * - * The event life cycle starts at the scope on which `$emit` was called. All - * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get - * notified. Afterwards, the event traverses upwards toward the root scope and calls all - * registered listeners along the way. The event will stop propagating if one of the listeners - * cancels it. - * - * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed - * onto the {@link ng.$exceptionHandler $exceptionHandler} service. - * - * @param {string} name Event name to emit. - * @param {...*} args Optional one or more arguments which will be passed onto the event listeners. - * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}). - */ - $emit: function(name, args) { - var empty = [], - namedListeners, - scope = this, - stopPropagation = false, - event = { - name: name, - targetScope: scope, - stopPropagation: function() {stopPropagation = true;}, - preventDefault: function() { - event.defaultPrevented = true; - }, - defaultPrevented: false - }, - listenerArgs = concat([event], arguments, 1), - i, length; - - do { - namedListeners = scope.$$listeners[name] || empty; - event.currentScope = scope; - for (i = 0, length = namedListeners.length; i < length; i++) { - - // if listeners were deregistered, defragment the array - if (!namedListeners[i]) { - namedListeners.splice(i, 1); - i--; - length--; - continue; - } - try { - //allow all listeners attached to the current scope to run - namedListeners[i].apply(null, listenerArgs); - } catch (e) { - $exceptionHandler(e); - } - } - //if any listener on the current scope stops propagation, prevent bubbling - if (stopPropagation) { - break; - } - //traverse upwards - scope = scope.$parent; - } while (scope); - - event.currentScope = null; - - return event; - }, - - - /** - * @ngdoc method - * @name $rootScope.Scope#$broadcast - * @kind function - * - * @description - * Dispatches an event `name` downwards to all child scopes (and their children) notifying the - * registered {@link ng.$rootScope.Scope#$on} listeners. - * - * The event life cycle starts at the scope on which `$broadcast` was called. All - * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get - * notified. Afterwards, the event propagates to all direct and indirect scopes of the current - * scope and calls all registered listeners along the way. The event cannot be canceled. - * - * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed - * onto the {@link ng.$exceptionHandler $exceptionHandler} service. - * - * @param {string} name Event name to broadcast. - * @param {...*} args Optional one or more arguments which will be passed onto the event listeners. - * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on} - */ - $broadcast: function(name, args) { - var target = this, - current = target, - next = target, - event = { - name: name, - targetScope: target, - preventDefault: function() { - event.defaultPrevented = true; - }, - defaultPrevented: false - }; - - if (!target.$$listenerCount[name]) return event; - - var listenerArgs = concat([event], arguments, 1), - listeners, i, length; - - //down while you can, then up and next sibling or up and next sibling until back at root - while ((current = next)) { - event.currentScope = current; - listeners = current.$$listeners[name] || []; - for (i = 0, length = listeners.length; i < length; i++) { - // if listeners were deregistered, defragment the array - if (!listeners[i]) { - listeners.splice(i, 1); - i--; - length--; - continue; - } - - try { - listeners[i].apply(null, listenerArgs); - } catch (e) { - $exceptionHandler(e); - } - } - - // Insanity Warning: scope depth-first traversal - // yes, this code is a bit crazy, but it works and we have tests to prove it! - // this piece should be kept in sync with the traversal in $digest - // (though it differs due to having the extra check for $$listenerCount) - if (!(next = ((current.$$listenerCount[name] && current.$$childHead) || - (current !== target && current.$$nextSibling)))) { - while (current !== target && !(next = current.$$nextSibling)) { - current = current.$parent; - } - } - } - - event.currentScope = null; - return event; - } - }; - - var $rootScope = new Scope(); - - //The internal queues. Expose them on the $rootScope for debugging/testing purposes. - var asyncQueue = $rootScope.$$asyncQueue = []; - var postDigestQueue = $rootScope.$$postDigestQueue = []; - var applyAsyncQueue = $rootScope.$$applyAsyncQueue = []; - - var postDigestQueuePosition = 0; - - return $rootScope; - - - function beginPhase(phase) { - if ($rootScope.$$phase) { - throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase); - } - - $rootScope.$$phase = phase; - } - - function clearPhase() { - $rootScope.$$phase = null; - } - - function incrementWatchersCount(current, count) { - do { - current.$$watchersCount += count; - } while ((current = current.$parent)); - } - - function decrementListenerCount(current, count, name) { - do { - current.$$listenerCount[name] -= count; - - if (current.$$listenerCount[name] === 0) { - delete current.$$listenerCount[name]; - } - } while ((current = current.$parent)); - } - - /** - * function used as an initial value for watchers. - * because it's unique we can easily tell it apart from other values - */ - function initWatchVal() {} - - function flushApplyAsync() { - while (applyAsyncQueue.length) { - try { - applyAsyncQueue.shift()(); - } catch (e) { - $exceptionHandler(e); - } - } - applyAsyncId = null; - } - - function scheduleApplyAsync() { - if (applyAsyncId === null) { - applyAsyncId = $browser.defer(function() { - $rootScope.$apply(flushApplyAsync); - }); - } - } - }]; - } - - /** - * @ngdoc service - * @name $rootElement - * - * @description - * The root element of AngularJS application. This is either the element where {@link - * ng.directive:ngApp ngApp} was declared or the element passed into - * {@link angular.bootstrap}. The element represents the root element of application. It is also the - * location where the application's {@link auto.$injector $injector} service gets - * published, and can be retrieved using `$rootElement.injector()`. - */ - - -// the implementation is in angular.bootstrap - - /** - * @this - * @description - * Private service to sanitize uris for links and images. Used by $compile and $sanitize. - */ - function $$SanitizeUriProvider() { - var aHrefSanitizationWhitelist = /^\s*(https?|s?ftp|mailto|tel|file):/, - imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/; - - /** - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during a[href] sanitization. - * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. - * - * Any url about to be assigned to a[href] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.aHrefSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - aHrefSanitizationWhitelist = regexp; - return this; - } - return aHrefSanitizationWhitelist; - }; - - - /** - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during img[src] sanitization. - * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. - * - * Any url about to be assigned to img[src] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.imgSrcSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - imgSrcSanitizationWhitelist = regexp; - return this; - } - return imgSrcSanitizationWhitelist; - }; - - this.$get = function() { - return function sanitizeUri(uri, isImage) { - var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist; - var normalizedVal; - normalizedVal = urlResolve(uri && uri.trim()).href; - if (normalizedVal !== '' && !normalizedVal.match(regex)) { - return 'unsafe:' + normalizedVal; - } - return uri; - }; - }; - } - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - /* exported $SceProvider, $SceDelegateProvider */ - - var $sceMinErr = minErr('$sce'); - - var SCE_CONTEXTS = { - // HTML is used when there's HTML rendered (e.g. ng-bind-html, iframe srcdoc binding). - HTML: 'html', - - // Style statements or stylesheets. Currently unused in AngularJS. - CSS: 'css', - - // An URL used in a context where it does not refer to a resource that loads code. Currently - // unused in AngularJS. - URL: 'url', - - // RESOURCE_URL is a subtype of URL used where the referred-to resource could be interpreted as - // code. (e.g. ng-include, script src binding, templateUrl) - RESOURCE_URL: 'resourceUrl', - - // Script. Currently unused in AngularJS. - JS: 'js' - }; - -// Helper functions follow. - - var UNDERSCORE_LOWERCASE_REGEXP = /_([a-z])/g; - - function snakeToCamel(name) { - return name - .replace(UNDERSCORE_LOWERCASE_REGEXP, fnCamelCaseReplace); - } - - function adjustMatcher(matcher) { - if (matcher === 'self') { - return matcher; - } else if (isString(matcher)) { - // Strings match exactly except for 2 wildcards - '*' and '**'. - // '*' matches any character except those from the set ':/.?&'. - // '**' matches any character (like .* in a RegExp). - // More than 2 *'s raises an error as it's ill defined. - if (matcher.indexOf('***') > -1) { - throw $sceMinErr('iwcard', - 'Illegal sequence *** in string matcher. String: {0}', matcher); - } - matcher = escapeForRegexp(matcher). - replace(/\\\*\\\*/g, '.*'). - replace(/\\\*/g, '[^:/.?&;]*'); - return new RegExp('^' + matcher + '$'); - } else if (isRegExp(matcher)) { - // The only other type of matcher allowed is a Regexp. - // Match entire URL / disallow partial matches. - // Flags are reset (i.e. no global, ignoreCase or multiline) - return new RegExp('^' + matcher.source + '$'); - } else { - throw $sceMinErr('imatcher', - 'Matchers may only be "self", string patterns or RegExp objects'); - } - } - - - function adjustMatchers(matchers) { - var adjustedMatchers = []; - if (isDefined(matchers)) { - forEach(matchers, function(matcher) { - adjustedMatchers.push(adjustMatcher(matcher)); - }); - } - return adjustedMatchers; - } - - - /** - * @ngdoc service - * @name $sceDelegate - * @kind function - * - * @description - * - * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict - * Contextual Escaping (SCE)} services to AngularJS. - * - * For an overview of this service and the functionnality it provides in AngularJS, see the main - * page for {@link ng.$sce SCE}. The current page is targeted for developers who need to alter how - * SCE works in their application, which shouldn't be needed in most cases. - * - * <div class="alert alert-danger"> - * AngularJS strongly relies on contextual escaping for the security of bindings: disabling or - * modifying this might cause cross site scripting (XSS) vulnerabilities. For libraries owners, - * changes to this service will also influence users, so be extra careful and document your changes. - * </div> - * - * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of - * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is - * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to - * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things - * work because `$sce` delegates to `$sceDelegate` for these operations. - * - * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service. - * - * The default instance of `$sceDelegate` should work out of the box with little pain. While you - * can override it completely to change the behavior of `$sce`, the common case would - * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting - * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as - * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist - * $sceDelegateProvider.resourceUrlWhitelist} and {@link - * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} - */ - - /** - * @ngdoc provider - * @name $sceDelegateProvider - * @this - * - * @description - * - * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate - * $sceDelegate service}, used as a delegate for {@link ng.$sce Strict Contextual Escaping (SCE)}. - * - * The `$sceDelegateProvider` allows one to get/set the whitelists and blacklists used to ensure - * that the URLs used for sourcing AngularJS templates and other script-running URLs are safe (all - * places that use the `$sce.RESOURCE_URL` context). See - * {@link ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} - * and - * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}, - * - * For the general details about this service in AngularJS, read the main page for {@link ng.$sce - * Strict Contextual Escaping (SCE)}. - * - * **Example**: Consider the following case. <a name="example"></a> - * - * - your app is hosted at url `http://myapp.example.com/` - * - but some of your templates are hosted on other domains you control such as - * `http://srv01.assets.example.com/`, `http://srv02.assets.example.com/`, etc. - * - and you have an open redirect at `http://myapp.example.com/clickThru?...`. - * - * Here is what a secure configuration for this scenario might look like: - * - * ``` - * angular.module('myApp', []).config(function($sceDelegateProvider) { - * $sceDelegateProvider.resourceUrlWhitelist([ - * // Allow same origin resource loads. - * 'self', - * // Allow loading from our assets domain. Notice the difference between * and **. - * 'http://srv*.assets.example.com/**' - * ]); - * - * // The blacklist overrides the whitelist so the open redirect here is blocked. - * $sceDelegateProvider.resourceUrlBlacklist([ - * 'http://myapp.example.com/clickThru**' - * ]); - * }); - * ``` - * Note that an empty whitelist will block every resource URL from being loaded, and will require - * you to manually mark each one as trusted with `$sce.trustAsResourceUrl`. However, templates - * requested by {@link ng.$templateRequest $templateRequest} that are present in - * {@link ng.$templateCache $templateCache} will not go through this check. If you have a mechanism - * to populate your templates in that cache at config time, then it is a good idea to remove 'self' - * from that whitelist. This helps to mitigate the security impact of certain types of issues, like - * for instance attacker-controlled `ng-includes`. - */ - - function $SceDelegateProvider() { - this.SCE_CONTEXTS = SCE_CONTEXTS; - - // Resource URLs can also be trusted by policy. - var resourceUrlWhitelist = ['self'], - resourceUrlBlacklist = []; - - /** - * @ngdoc method - * @name $sceDelegateProvider#resourceUrlWhitelist - * @kind function - * - * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value - * provided. This must be an array or null. A snapshot of this array is used so further - * changes to the array are ignored. - * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items - * allowed in this array. - * - * @return {Array} The currently set whitelist array. - * - * @description - * Sets/Gets the whitelist of trusted resource URLs. - * - * The **default value** when no whitelist has been explicitly set is `['self']` allowing only - * same origin resource requests. - * - * <div class="alert alert-warning"> - * **Note:** the default whitelist of 'self' is not recommended if your app shares its origin - * with other apps! It is a good idea to limit it to only your application's directory. - * </div> - */ - this.resourceUrlWhitelist = function(value) { - if (arguments.length) { - resourceUrlWhitelist = adjustMatchers(value); - } - return resourceUrlWhitelist; - }; - - /** - * @ngdoc method - * @name $sceDelegateProvider#resourceUrlBlacklist - * @kind function - * - * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value - * provided. This must be an array or null. A snapshot of this array is used so further - * changes to the array are ignored.</p><p> - * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items - * allowed in this array.</p><p> - * The typical usage for the blacklist is to **block - * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as - * these would otherwise be trusted but actually return content from the redirected domain. - * </p><p> - * Finally, **the blacklist overrides the whitelist** and has the final say. - * - * @return {Array} The currently set blacklist array. - * - * @description - * Sets/Gets the blacklist of trusted resource URLs. - * - * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there - * is no blacklist.) - */ - - this.resourceUrlBlacklist = function(value) { - if (arguments.length) { - resourceUrlBlacklist = adjustMatchers(value); - } - return resourceUrlBlacklist; - }; - - this.$get = ['$injector', function($injector) { - - var htmlSanitizer = function htmlSanitizer(html) { - throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); - }; - - if ($injector.has('$sanitize')) { - htmlSanitizer = $injector.get('$sanitize'); - } - - - function matchUrl(matcher, parsedUrl) { - if (matcher === 'self') { - return urlIsSameOrigin(parsedUrl); - } else { - // definitely a regex. See adjustMatchers() - return !!matcher.exec(parsedUrl.href); - } - } - - function isResourceUrlAllowedByPolicy(url) { - var parsedUrl = urlResolve(url.toString()); - var i, n, allowed = false; - // Ensure that at least one item from the whitelist allows this url. - for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) { - if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) { - allowed = true; - break; - } - } - if (allowed) { - // Ensure that no item from the blacklist blocked this url. - for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) { - if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) { - allowed = false; - break; - } - } - } - return allowed; - } - - function generateHolderType(Base) { - var holderType = function TrustedValueHolderType(trustedValue) { - this.$$unwrapTrustedValue = function() { - return trustedValue; - }; - }; - if (Base) { - holderType.prototype = new Base(); - } - holderType.prototype.valueOf = function sceValueOf() { - return this.$$unwrapTrustedValue(); - }; - holderType.prototype.toString = function sceToString() { - return this.$$unwrapTrustedValue().toString(); - }; - return holderType; - } - - var trustedValueHolderBase = generateHolderType(), - byType = {}; - - byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]); - - /** - * @ngdoc method - * @name $sceDelegate#trustAs - * - * @description - * Returns a trusted representation of the parameter for the specified context. This trusted - * object will later on be used as-is, without any security check, by bindings or directives - * that require this security context. - * For instance, marking a string as trusted for the `$sce.HTML` context will entirely bypass - * the potential `$sanitize` call in corresponding `$sce.HTML` bindings or directives, such as - * `ng-bind-html`. Note that in most cases you won't need to call this function: if you have the - * sanitizer loaded, passing the value itself will render all the HTML that does not pose a - * security risk. - * - * See {@link ng.$sceDelegate#getTrusted getTrusted} for the function that will consume those - * trusted values, and {@link ng.$sce $sce} for general documentation about strict contextual - * escaping. - * - * @param {string} type The context in which this value is safe for use, e.g. `$sce.URL`, - * `$sce.RESOURCE_URL`, `$sce.HTML`, `$sce.JS` or `$sce.CSS`. - * - * @param {*} value The value that should be considered trusted. - * @return {*} A trusted representation of value, that can be used in the given context. - */ - function trustAs(type, trustedValue) { - var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null); - if (!Constructor) { - throw $sceMinErr('icontext', - 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}', - type, trustedValue); - } - if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') { - return trustedValue; - } - // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting - // mutable objects, we ensure here that the value passed in is actually a string. - if (typeof trustedValue !== 'string') { - throw $sceMinErr('itype', - 'Attempted to trust a non-string value in a content requiring a string: Context: {0}', - type); - } - return new Constructor(trustedValue); - } - - /** - * @ngdoc method - * @name $sceDelegate#valueOf - * - * @description - * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs - * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link - * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. - * - * If the passed parameter is not a value that had been returned by {@link - * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, it must be returned as-is. - * - * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} - * call or anything else. - * @return {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs - * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns - * `value` unchanged. - */ - function valueOf(maybeTrusted) { - if (maybeTrusted instanceof trustedValueHolderBase) { - return maybeTrusted.$$unwrapTrustedValue(); - } else { - return maybeTrusted; - } - } - - /** - * @ngdoc method - * @name $sceDelegate#getTrusted - * - * @description - * Takes any input, and either returns a value that's safe to use in the specified context, or - * throws an exception. - * - * In practice, there are several cases. When given a string, this function runs checks - * and sanitization to make it safe without prior assumptions. When given the result of a {@link - * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call, it returns the originally supplied - * value if that value's context is valid for this call's context. Finally, this function can - * also throw when there is no way to turn `maybeTrusted` in a safe value (e.g., no sanitization - * is available or possible.) - * - * @param {string} type The context in which this value is to be used (such as `$sce.HTML`). - * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs - * `$sceDelegate.trustAs`} call, or anything else (which will not be considered trusted.) - * @return {*} A version of the value that's safe to use in the given context, or throws an - * exception if this is impossible. - */ - function getTrusted(type, maybeTrusted) { - if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') { - return maybeTrusted; - } - var constructor = (byType.hasOwnProperty(type) ? byType[type] : null); - // If maybeTrusted is a trusted class instance or subclass instance, then unwrap and return - // as-is. - if (constructor && maybeTrusted instanceof constructor) { - return maybeTrusted.$$unwrapTrustedValue(); - } - // Otherwise, if we get here, then we may either make it safe, or throw an exception. This - // depends on the context: some are sanitizatible (HTML), some use whitelists (RESOURCE_URL), - // some are impossible to do (JS). This step isn't implemented for CSS and URL, as AngularJS - // has no corresponding sinks. - if (type === SCE_CONTEXTS.RESOURCE_URL) { - // RESOURCE_URL uses a whitelist. - if (isResourceUrlAllowedByPolicy(maybeTrusted)) { - return maybeTrusted; - } else { - throw $sceMinErr('insecurl', - 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}', - maybeTrusted.toString()); - } - } else if (type === SCE_CONTEXTS.HTML) { - // htmlSanitizer throws its own error when no sanitizer is available. - return htmlSanitizer(maybeTrusted); - } - // Default error when the $sce service has no way to make the input safe. - throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); - } - - return { trustAs: trustAs, - getTrusted: getTrusted, - valueOf: valueOf }; - }]; - } - - - /** - * @ngdoc provider - * @name $sceProvider - * @this - * - * @description - * - * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service. - * - enable/disable Strict Contextual Escaping (SCE) in a module - * - override the default implementation with a custom delegate - * - * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}. - */ - - /** - * @ngdoc service - * @name $sce - * @kind function - * - * @description - * - * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS. - * - * ## Strict Contextual Escaping - * - * Strict Contextual Escaping (SCE) is a mode in which AngularJS constrains bindings to only render - * trusted values. Its goal is to assist in writing code in a way that (a) is secure by default, and - * (b) makes auditing for security vulnerabilities such as XSS, clickjacking, etc. a lot easier. - * - * ### Overview - * - * To systematically block XSS security bugs, AngularJS treats all values as untrusted by default in - * HTML or sensitive URL bindings. When binding untrusted values, AngularJS will automatically - * run security checks on them (sanitizations, whitelists, depending on context), or throw when it - * cannot guarantee the security of the result. That behavior depends strongly on contexts: HTML - * can be sanitized, but template URLs cannot, for instance. - * - * To illustrate this, consider the `ng-bind-html` directive. It renders its value directly as HTML: - * we call that the *context*. When given an untrusted input, AngularJS will attempt to sanitize it - * before rendering if a sanitizer is available, and throw otherwise. To bypass sanitization and - * render the input as-is, you will need to mark it as trusted for that context before attempting - * to bind it. - * - * As of version 1.2, AngularJS ships with SCE enabled by default. - * - * ### In practice - * - * Here's an example of a binding in a privileged context: - * - * ``` - * <input ng-model="userHtml" aria-label="User input"> - * <div ng-bind-html="userHtml"></div> - * ``` - * - * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE - * disabled, this application allows the user to render arbitrary HTML into the DIV, which would - * be an XSS security bug. In a more realistic example, one may be rendering user comments, blog - * articles, etc. via bindings. (HTML is just one example of a context where rendering user - * controlled input creates security vulnerabilities.) - * - * For the case of HTML, you might use a library, either on the client side, or on the server side, - * to sanitize unsafe HTML before binding to the value and rendering it in the document. - * - * How would you ensure that every place that used these types of bindings was bound to a value that - * was sanitized by your library (or returned as safe for rendering by your server?) How can you - * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some - * properties/fields and forgot to update the binding to the sanitized value? - * - * To be secure by default, AngularJS makes sure bindings go through that sanitization, or - * any similar validation process, unless there's a good reason to trust the given value in this - * context. That trust is formalized with a function call. This means that as a developer, you - * can assume all untrusted bindings are safe. Then, to audit your code for binding security issues, - * you just need to ensure the values you mark as trusted indeed are safe - because they were - * received from your server, sanitized by your library, etc. You can organize your codebase to - * help with this - perhaps allowing only the files in a specific directory to do this. - * Ensuring that the internal API exposed by that code doesn't markup arbitrary values as safe then - * becomes a more manageable task. - * - * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs} - * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to - * build the trusted versions of your values. - * - * ### How does it work? - * - * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted - * $sce.getTrusted(context, value)} rather than to the value directly. Think of this function as - * a way to enforce the required security context in your data sink. Directives use {@link - * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs - * the {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals. Also, - * when binding without directives, AngularJS will understand the context of your bindings - * automatically. - * - * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link - * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly - * simplified): - * - * ``` - * var ngBindHtmlDirective = ['$sce', function($sce) { - * return function(scope, element, attr) { - * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) { - * element.html(value || ''); - * }); - * }; - * }]; - * ``` - * - * ### Impact on loading templates - * - * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as - * `templateUrl`'s specified by {@link guide/directive directives}. - * - * By default, AngularJS only loads templates from the same domain and protocol as the application - * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl - * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or - * protocols, you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist - * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value. - * - * *Please note*: - * The browser's - * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest) - * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/) - * policy apply in addition to this and may further restrict whether the template is successfully - * loaded. This means that without the right CORS policy, loading templates from a different domain - * won't work on all browsers. Also, loading templates from `file://` URL does not work on some - * browsers. - * - * ### This feels like too much overhead - * - * It's important to remember that SCE only applies to interpolation expressions. - * - * If your expressions are constant literals, they're automatically trusted and you don't need to - * call `$sce.trustAs` on them (e.g. - * `<div ng-bind-html="'<b>implicitly trusted</b>'"></div>`) just works. The `$sceDelegate` will - * also use the `$sanitize` service if it is available when binding untrusted values to - * `$sce.HTML` context. AngularJS provides an implementation in `angular-sanitize.js`, and if you - * wish to use it, you will also need to depend on the {@link ngSanitize `ngSanitize`} module in - * your application. - * - * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load - * templates in `ng-include` from your application's domain without having to even know about SCE. - * It blocks loading templates from other domains or loading templates over http from an https - * served document. You can change these by setting your own custom {@link - * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link - * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs. - * - * This significantly reduces the overhead. It is far easier to pay the small overhead and have an - * application that's secure and can be audited to verify that with much more ease than bolting - * security onto an application later. - * - * <a name="contexts"></a> - * ### What trusted context types are supported? - * - * | Context | Notes | - * |---------------------|----------------| - * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered, and the {@link ngSanitize.$sanitize $sanitize} service is available (implemented by the {@link ngSanitize ngSanitize} module) this will sanitize the value instead of throwing an error. | - * | `$sce.CSS` | For CSS that's safe to source into the application. Currently, no bindings require this context. Feel free to use it in your own directives. | - * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`<a href=`, `<img src=`, and some others sanitize their urls and don't constitute an SCE context.) | - * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG`, `VIDEO`, `AUDIO`, `SOURCE`, and `TRACK` (e.g. `IFRAME`, `OBJECT`, etc.) <br><br>Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does (it's not just the URL that matters, but also what is at the end of it), and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. | - * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently, no bindings require this context. Feel free to use it in your own directives. | - * - * - * Be aware that `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them - * through {@link ng.$sce#getTrusted $sce.getTrusted}. There's no CSS-, URL-, or JS-context bindings - * in AngularJS currently, so their corresponding `$sce.trustAs` functions aren't useful yet. This - * might evolve. - * - * ### Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist} <a name="resourceUrlPatternItem"></a> - * - * Each element in these arrays must be one of the following: - * - * - **'self'** - * - The special **string**, `'self'`, can be used to match against all URLs of the **same - * domain** as the application document using the **same protocol**. - * - **String** (except the special value `'self'`) - * - The string is matched against the full *normalized / absolute URL* of the resource - * being tested (substring matches are not good enough.) - * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters - * match themselves. - * - `*`: matches zero or more occurrences of any character other than one of the following 6 - * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'. It's a useful wildcard for use - * in a whitelist. - * - `**`: matches zero or more occurrences of *any* character. As such, it's not - * appropriate for use in a scheme, domain, etc. as it would match too much. (e.g. - * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might - * not have been the intention.) Its usage at the very end of the path is ok. (e.g. - * http://foo.example.com/templates/**). - * - **RegExp** (*see caveat below*) - * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax - * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to - * accidentally introduce a bug when one updates a complex expression (imho, all regexes should - * have good test coverage). For instance, the use of `.` in the regex is correct only in a - * small number of cases. A `.` character in the regex used when matching the scheme or a - * subdomain could be matched against a `:` or literal `.` that was likely not intended. It - * is highly recommended to use the string patterns and only fall back to regular expressions - * as a last resort. - * - The regular expression must be an instance of RegExp (i.e. not a string.) It is - * matched against the **entire** *normalized / absolute URL* of the resource being tested - * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags - * present on the RegExp (such as multiline, global, ignoreCase) are ignored. - * - If you are generating your JavaScript from some other templating engine (not - * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)), - * remember to escape your regular expression (and be aware that you might need more than - * one level of escaping depending on your templating engine and the way you interpolated - * the value.) Do make use of your platform's escaping mechanism as it might be good - * enough before coding your own. E.g. Ruby has - * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape) - * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape). - * Javascript lacks a similar built in function for escaping. Take a look at Google - * Closure library's [goog.string.regExpEscape(s)]( - * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962). - * - * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example. - * - * ### Show me an example using SCE. - * - * <example module="mySceApp" deps="angular-sanitize.js" name="sce-service"> - * <file name="index.html"> - * <div ng-controller="AppController as myCtrl"> - * <i ng-bind-html="myCtrl.explicitlyTrustedHtml" id="explicitlyTrustedHtml"></i><br><br> - * <b>User comments</b><br> - * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when - * $sanitize is available. If $sanitize isn't available, this results in an error instead of an - * exploit. - * <div class="well"> - * <div ng-repeat="userComment in myCtrl.userComments"> - * <b>{{userComment.name}}</b>: - * <span ng-bind-html="userComment.htmlComment" class="htmlComment"></span> - * <br> - * </div> - * </div> - * </div> - * </file> - * - * <file name="script.js"> - * angular.module('mySceApp', ['ngSanitize']) - * .controller('AppController', ['$http', '$templateCache', '$sce', - * function AppController($http, $templateCache, $sce) { - * var self = this; - * $http.get('test_data.json', {cache: $templateCache}).then(function(response) { - * self.userComments = response.data; - * }); - * self.explicitlyTrustedHtml = $sce.trustAsHtml( - * '<span onmouseover="this.textContent="Explicitly trusted HTML bypasses ' + - * 'sanitization."">Hover over this text.</span>'); - * }]); - * </file> - * - * <file name="test_data.json"> - * [ - * { "name": "Alice", - * "htmlComment": - * "<span onmouseover='this.textContent=\"PWN3D!\"'>Is <i>anyone</i> reading this?</span>" - * }, - * { "name": "Bob", - * "htmlComment": "<i>Yes!</i> Am I the only other one?" - * } - * ] - * </file> - * - * <file name="protractor.js" type="protractor"> - * describe('SCE doc demo', function() { - * it('should sanitize untrusted values', function() { - * expect(element.all(by.css('.htmlComment')).first().getAttribute('innerHTML')) - * .toBe('<span>Is <i>anyone</i> reading this?</span>'); - * }); - * - * it('should NOT sanitize explicitly trusted values', function() { - * expect(element(by.id('explicitlyTrustedHtml')).getAttribute('innerHTML')).toBe( - * '<span onmouseover="this.textContent="Explicitly trusted HTML bypasses ' + - * 'sanitization."">Hover over this text.</span>'); - * }); - * }); - * </file> - * </example> - * - * - * - * ## Can I disable SCE completely? - * - * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits - * for little coding overhead. It will be much harder to take an SCE disabled application and - * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE - * for cases where you have a lot of existing code that was written before SCE was introduced and - * you're migrating them a module at a time. Also do note that this is an app-wide setting, so if - * you are writing a library, you will cause security bugs applications using it. - * - * That said, here's how you can completely disable SCE: - * - * ``` - * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) { - * // Completely disable SCE. For demonstration purposes only! - * // Do not use in new projects or libraries. - * $sceProvider.enabled(false); - * }); - * ``` - * - */ - - function $SceProvider() { - var enabled = true; - - /** - * @ngdoc method - * @name $sceProvider#enabled - * @kind function - * - * @param {boolean=} value If provided, then enables/disables SCE application-wide. - * @return {boolean} True if SCE is enabled, false otherwise. - * - * @description - * Enables/disables SCE and returns the current value. - */ - this.enabled = function(value) { - if (arguments.length) { - enabled = !!value; - } - return enabled; - }; - - - /* Design notes on the default implementation for SCE. - * - * The API contract for the SCE delegate - * ------------------------------------- - * The SCE delegate object must provide the following 3 methods: - * - * - trustAs(contextEnum, value) - * This method is used to tell the SCE service that the provided value is OK to use in the - * contexts specified by contextEnum. It must return an object that will be accepted by - * getTrusted() for a compatible contextEnum and return this value. - * - * - valueOf(value) - * For values that were not produced by trustAs(), return them as is. For values that were - * produced by trustAs(), return the corresponding input value to trustAs. Basically, if - * trustAs is wrapping the given values into some type, this operation unwraps it when given - * such a value. - * - * - getTrusted(contextEnum, value) - * This function should return the a value that is safe to use in the context specified by - * contextEnum or throw and exception otherwise. - * - * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be - * opaque or wrapped in some holder object. That happens to be an implementation detail. For - * instance, an implementation could maintain a registry of all trusted objects by context. In - * such a case, trustAs() would return the same object that was passed in. getTrusted() would - * return the same object passed in if it was found in the registry under a compatible context or - * throw an exception otherwise. An implementation might only wrap values some of the time based - * on some criteria. getTrusted() might return a value and not throw an exception for special - * constants or objects even if not wrapped. All such implementations fulfill this contract. - * - * - * A note on the inheritance model for SCE contexts - * ------------------------------------------------ - * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This - * is purely an implementation details. - * - * The contract is simply this: - * - * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value) - * will also succeed. - * - * Inheritance happens to capture this in a natural way. In some future, we may not use - * inheritance anymore. That is OK because no code outside of sce.js and sceSpecs.js would need to - * be aware of this detail. - */ - - this.$get = ['$parse', '$sceDelegate', function( - $parse, $sceDelegate) { - // Support: IE 9-11 only - // Prereq: Ensure that we're not running in IE<11 quirks mode. In that mode, IE < 11 allow - // the "expression(javascript expression)" syntax which is insecure. - if (enabled && msie < 8) { - throw $sceMinErr('iequirks', - 'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' + - 'mode. You can fix this by adding the text <!doctype html> to the top of your HTML ' + - 'document. See http://docs.angularjs.org/api/ng.$sce for more information.'); - } - - var sce = shallowCopy(SCE_CONTEXTS); - - /** - * @ngdoc method - * @name $sce#isEnabled - * @kind function - * - * @return {Boolean} True if SCE is enabled, false otherwise. If you want to set the value, you - * have to do it at module config time on {@link ng.$sceProvider $sceProvider}. - * - * @description - * Returns a boolean indicating if SCE is enabled. - */ - sce.isEnabled = function() { - return enabled; - }; - sce.trustAs = $sceDelegate.trustAs; - sce.getTrusted = $sceDelegate.getTrusted; - sce.valueOf = $sceDelegate.valueOf; - - if (!enabled) { - sce.trustAs = sce.getTrusted = function(type, value) { return value; }; - sce.valueOf = identity; - } - - /** - * @ngdoc method - * @name $sce#parseAs - * - * @description - * Converts AngularJS {@link guide/expression expression} into a function. This is like {@link - * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it - * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*, - * *result*)} - * - * @param {string} type The SCE context in which this result will be used. - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - sce.parseAs = function sceParseAs(type, expr) { - var parsed = $parse(expr); - if (parsed.literal && parsed.constant) { - return parsed; - } else { - return $parse(expr, function(value) { - return sce.getTrusted(type, value); - }); - } - }; - - /** - * @ngdoc method - * @name $sce#trustAs - * - * @description - * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such, returns a - * wrapped object that represents your value, and the trust you have in its safety for the given - * context. AngularJS can then use that value as-is in bindings of the specified secure context. - * This is used in bindings for `ng-bind-html`, `ng-include`, and most `src` attribute - * interpolations. See {@link ng.$sce $sce} for strict contextual escaping. - * - * @param {string} type The context in which this value is safe for use, e.g. `$sce.URL`, - * `$sce.RESOURCE_URL`, `$sce.HTML`, `$sce.JS` or `$sce.CSS`. - * - * @param {*} value The value that that should be considered trusted. - * @return {*} A wrapped version of value that can be used as a trusted variant of your `value` - * in the context you specified. - */ - - /** - * @ngdoc method - * @name $sce#trustAsHtml - * - * @description - * Shorthand method. `$sce.trustAsHtml(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`} - * - * @param {*} value The value to mark as trusted for `$sce.HTML` context. - * @return {*} A wrapped version of value that can be used as a trusted variant of your `value` - * in `$sce.HTML` context (like `ng-bind-html`). - */ - - /** - * @ngdoc method - * @name $sce#trustAsCss - * - * @description - * Shorthand method. `$sce.trustAsCss(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.CSS, value)`} - * - * @param {*} value The value to mark as trusted for `$sce.CSS` context. - * @return {*} A wrapped version of value that can be used as a trusted variant - * of your `value` in `$sce.CSS` context. This context is currently unused, so there are - * almost no reasons to use this function so far. - */ - - /** - * @ngdoc method - * @name $sce#trustAsUrl - * - * @description - * Shorthand method. `$sce.trustAsUrl(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`} - * - * @param {*} value The value to mark as trusted for `$sce.URL` context. - * @return {*} A wrapped version of value that can be used as a trusted variant of your `value` - * in `$sce.URL` context. That context is currently unused, so there are almost no reasons - * to use this function so far. - */ - - /** - * @ngdoc method - * @name $sce#trustAsResourceUrl - * - * @description - * Shorthand method. `$sce.trustAsResourceUrl(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`} - * - * @param {*} value The value to mark as trusted for `$sce.RESOURCE_URL` context. - * @return {*} A wrapped version of value that can be used as a trusted variant of your `value` - * in `$sce.RESOURCE_URL` context (template URLs in `ng-include`, most `src` attribute - * bindings, ...) - */ - - /** - * @ngdoc method - * @name $sce#trustAsJs - * - * @description - * Shorthand method. `$sce.trustAsJs(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`} - * - * @param {*} value The value to mark as trusted for `$sce.JS` context. - * @return {*} A wrapped version of value that can be used as a trusted variant of your `value` - * in `$sce.JS` context. That context is currently unused, so there are almost no reasons to - * use this function so far. - */ - - /** - * @ngdoc method - * @name $sce#getTrusted - * - * @description - * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such, - * takes any input, and either returns a value that's safe to use in the specified context, - * or throws an exception. This function is aware of trusted values created by the `trustAs` - * function and its shorthands, and when contexts are appropriate, returns the unwrapped value - * as-is. Finally, this function can also throw when there is no way to turn `maybeTrusted` in a - * safe value (e.g., no sanitization is available or possible.) - * - * @param {string} type The context in which this value is to be used. - * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs - * `$sce.trustAs`} call, or anything else (which will not be considered trusted.) - * @return {*} A version of the value that's safe to use in the given context, or throws an - * exception if this is impossible. - */ - - /** - * @ngdoc method - * @name $sce#getTrustedHtml - * - * @description - * Shorthand method. `$sce.getTrustedHtml(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @return {*} The return value of `$sce.getTrusted($sce.HTML, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedCss - * - * @description - * Shorthand method. `$sce.getTrustedCss(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @return {*} The return value of `$sce.getTrusted($sce.CSS, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedUrl - * - * @description - * Shorthand method. `$sce.getTrustedUrl(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @return {*} The return value of `$sce.getTrusted($sce.URL, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedResourceUrl - * - * @description - * Shorthand method. `$sce.getTrustedResourceUrl(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`} - * - * @param {*} value The value to pass to `$sceDelegate.getTrusted`. - * @return {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedJs - * - * @description - * Shorthand method. `$sce.getTrustedJs(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @return {*} The return value of `$sce.getTrusted($sce.JS, value)` - */ - - /** - * @ngdoc method - * @name $sce#parseAsHtml - * - * @description - * Shorthand method. `$sce.parseAsHtml(expression string)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`} - * - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsCss - * - * @description - * Shorthand method. `$sce.parseAsCss(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`} - * - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsUrl - * - * @description - * Shorthand method. `$sce.parseAsUrl(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`} - * - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsResourceUrl - * - * @description - * Shorthand method. `$sce.parseAsResourceUrl(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`} - * - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsJs - * - * @description - * Shorthand method. `$sce.parseAsJs(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`} - * - * @param {string} expression String expression to compile. - * @return {function(context, locals)} A function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the - * strings are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values - * in `context`. - */ - - // Shorthand delegations. - var parse = sce.parseAs, - getTrusted = sce.getTrusted, - trustAs = sce.trustAs; - - forEach(SCE_CONTEXTS, function(enumValue, name) { - var lName = lowercase(name); - sce[snakeToCamel('parse_as_' + lName)] = function(expr) { - return parse(enumValue, expr); - }; - sce[snakeToCamel('get_trusted_' + lName)] = function(value) { - return getTrusted(enumValue, value); - }; - sce[snakeToCamel('trust_as_' + lName)] = function(value) { - return trustAs(enumValue, value); - }; - }); - - return sce; - }]; - } - - /* exported $SnifferProvider */ - - /** - * !!! This is an undocumented "private" service !!! - * - * @name $sniffer - * @requires $window - * @requires $document - * @this - * - * @property {boolean} history Does the browser support html5 history api ? - * @property {boolean} transitions Does the browser support CSS transition events ? - * @property {boolean} animations Does the browser support CSS animation events ? - * - * @description - * This is very simple implementation of testing browser's features. - */ - function $SnifferProvider() { - this.$get = ['$window', '$document', function($window, $document) { - var eventSupport = {}, - // Chrome Packaged Apps are not allowed to access `history.pushState`. - // If not sandboxed, they can be detected by the presence of `chrome.app.runtime` - // (see https://developer.chrome.com/apps/api_index). If sandboxed, they can be detected by - // the presence of an extension runtime ID and the absence of other Chrome runtime APIs - // (see https://developer.chrome.com/apps/manifest/sandbox). - // (NW.js apps have access to Chrome APIs, but do support `history`.) - isNw = $window.nw && $window.nw.process, - isChromePackagedApp = - !isNw && - $window.chrome && - ($window.chrome.app && $window.chrome.app.runtime || - !$window.chrome.app && $window.chrome.runtime && $window.chrome.runtime.id), - hasHistoryPushState = !isChromePackagedApp && $window.history && $window.history.pushState, - android = - toInt((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), - boxee = /Boxee/i.test(($window.navigator || {}).userAgent), - document = $document[0] || {}, - bodyStyle = document.body && document.body.style, - transitions = false, - animations = false; - - if (bodyStyle) { - // Support: Android <5, Blackberry Browser 10, default Chrome in Android 4.4.x - // Mentioned browsers need a -webkit- prefix for transitions & animations. - transitions = !!('transition' in bodyStyle || 'webkitTransition' in bodyStyle); - animations = !!('animation' in bodyStyle || 'webkitAnimation' in bodyStyle); - } - - - return { - // Android has history.pushState, but it does not update location correctly - // so let's not use the history API at all. - // http://code.google.com/p/android/issues/detail?id=17471 - // https://github.com/angular/angular.js/issues/904 - - // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has - // so let's not use the history API also - // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined - history: !!(hasHistoryPushState && !(android < 4) && !boxee), - hasEvent: function(event) { - // Support: IE 9-11 only - // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have - // it. In particular the event is not fired when backspace or delete key are pressed or - // when cut operation is performed. - // IE10+ implements 'input' event but it erroneously fires under various situations, - // e.g. when placeholder changes, or a form is focused. - if (event === 'input' && msie) return false; - - if (isUndefined(eventSupport[event])) { - var divElm = document.createElement('div'); - eventSupport[event] = 'on' + event in divElm; - } - - return eventSupport[event]; - }, - csp: csp(), - transitions: transitions, - animations: animations, - android: android - }; - }]; - } - - var $templateRequestMinErr = minErr('$compile'); - - /** - * @ngdoc provider - * @name $templateRequestProvider - * @this - * - * @description - * Used to configure the options passed to the {@link $http} service when making a template request. - * - * For example, it can be used for specifying the "Accept" header that is sent to the server, when - * requesting a template. - */ - function $TemplateRequestProvider() { - - var httpOptions; - - /** - * @ngdoc method - * @name $templateRequestProvider#httpOptions - * @description - * The options to be passed to the {@link $http} service when making the request. - * You can use this to override options such as the "Accept" header for template requests. - * - * The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the - * options if not overridden here. - * - * @param {string=} value new value for the {@link $http} options. - * @returns {string|self} Returns the {@link $http} options when used as getter and self if used as setter. - */ - this.httpOptions = function(val) { - if (val) { - httpOptions = val; - return this; - } - return httpOptions; - }; - - /** - * @ngdoc service - * @name $templateRequest - * - * @description - * The `$templateRequest` service runs security checks then downloads the provided template using - * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request - * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the - * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the - * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted - * when `tpl` is of type string and `$templateCache` has the matching entry. - * - * If you want to pass custom options to the `$http` service, such as setting the Accept header you - * can configure this via {@link $templateRequestProvider#httpOptions}. - * - * `$templateRequest` is used internally by {@link $compile}, {@link ngRoute.$route}, and directives such - * as {@link ngInclude} to download and cache templates. - * - * 3rd party modules should use `$templateRequest` if their services or directives are loading - * templates. - * - * @param {string|TrustedResourceUrl} tpl The HTTP request template URL - * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty - * - * @return {Promise} a promise for the HTTP response data of the given URL. - * - * @property {number} totalPendingRequests total amount of pending template requests being downloaded. - */ - this.$get = ['$exceptionHandler', '$templateCache', '$http', '$q', '$sce', - function($exceptionHandler, $templateCache, $http, $q, $sce) { - - function handleRequestFn(tpl, ignoreRequestError) { - handleRequestFn.totalPendingRequests++; - - // We consider the template cache holds only trusted templates, so - // there's no need to go through whitelisting again for keys that already - // are included in there. This also makes AngularJS accept any script - // directive, no matter its name. However, we still need to unwrap trusted - // types. - if (!isString(tpl) || isUndefined($templateCache.get(tpl))) { - tpl = $sce.getTrustedResourceUrl(tpl); - } - - var transformResponse = $http.defaults && $http.defaults.transformResponse; - - if (isArray(transformResponse)) { - transformResponse = transformResponse.filter(function(transformer) { - return transformer !== defaultHttpResponseTransform; - }); - } else if (transformResponse === defaultHttpResponseTransform) { - transformResponse = null; - } - - return $http.get(tpl, extend({ - cache: $templateCache, - transformResponse: transformResponse - }, httpOptions)) - .finally(function() { - handleRequestFn.totalPendingRequests--; - }) - .then(function(response) { - $templateCache.put(tpl, response.data); - return response.data; - }, handleError); - - function handleError(resp) { - if (!ignoreRequestError) { - resp = $templateRequestMinErr('tpload', - 'Failed to load template: {0} (HTTP status: {1} {2})', - tpl, resp.status, resp.statusText); - - $exceptionHandler(resp); - } - - return $q.reject(resp); - } - } - - handleRequestFn.totalPendingRequests = 0; - - return handleRequestFn; - } - ]; - } - - /** @this */ - function $$TestabilityProvider() { - this.$get = ['$rootScope', '$browser', '$location', - function($rootScope, $browser, $location) { - - /** - * @name $testability - * - * @description - * The private $$testability service provides a collection of methods for use when debugging - * or by automated test and debugging tools. - */ - var testability = {}; - - /** - * @name $$testability#findBindings - * - * @description - * Returns an array of elements that are bound (via ng-bind or {{}}) - * to expressions matching the input. - * - * @param {Element} element The element root to search from. - * @param {string} expression The binding expression to match. - * @param {boolean} opt_exactMatch If true, only returns exact matches - * for the expression. Filters and whitespace are ignored. - */ - testability.findBindings = function(element, expression, opt_exactMatch) { - var bindings = element.getElementsByClassName('ng-binding'); - var matches = []; - forEach(bindings, function(binding) { - var dataBinding = angular.element(binding).data('$binding'); - if (dataBinding) { - forEach(dataBinding, function(bindingName) { - if (opt_exactMatch) { - var matcher = new RegExp('(^|\\s)' + escapeForRegexp(expression) + '(\\s|\\||$)'); - if (matcher.test(bindingName)) { - matches.push(binding); - } - } else { - if (bindingName.indexOf(expression) !== -1) { - matches.push(binding); - } - } - }); - } - }); - return matches; - }; - - /** - * @name $$testability#findModels - * - * @description - * Returns an array of elements that are two-way found via ng-model to - * expressions matching the input. - * - * @param {Element} element The element root to search from. - * @param {string} expression The model expression to match. - * @param {boolean} opt_exactMatch If true, only returns exact matches - * for the expression. - */ - testability.findModels = function(element, expression, opt_exactMatch) { - var prefixes = ['ng-', 'data-ng-', 'ng\\:']; - for (var p = 0; p < prefixes.length; ++p) { - var attributeEquals = opt_exactMatch ? '=' : '*='; - var selector = '[' + prefixes[p] + 'model' + attributeEquals + '"' + expression + '"]'; - var elements = element.querySelectorAll(selector); - if (elements.length) { - return elements; - } - } - }; - - /** - * @name $$testability#getLocation - * - * @description - * Shortcut for getting the location in a browser agnostic way. Returns - * the path, search, and hash. (e.g. /path?a=b#hash) - */ - testability.getLocation = function() { - return $location.url(); - }; - - /** - * @name $$testability#setLocation - * - * @description - * Shortcut for navigating to a location without doing a full page reload. - * - * @param {string} url The location url (path, search and hash, - * e.g. /path?a=b#hash) to go to. - */ - testability.setLocation = function(url) { - if (url !== $location.url()) { - $location.url(url); - $rootScope.$digest(); - } - }; - - /** - * @name $$testability#whenStable - * - * @description - * Calls the callback when $timeout and $http requests are completed. - * - * @param {function} callback - */ - testability.whenStable = function(callback) { - $browser.notifyWhenNoOutstandingRequests(callback); - }; - - return testability; - }]; - } - - /** @this */ - function $TimeoutProvider() { - this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler', - function($rootScope, $browser, $q, $$q, $exceptionHandler) { - - var deferreds = {}; - - - /** - * @ngdoc service - * @name $timeout - * - * @description - * AngularJS's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch - * block and delegates any exceptions to - * {@link ng.$exceptionHandler $exceptionHandler} service. - * - * The return value of calling `$timeout` is a promise, which will be resolved when - * the delay has passed and the timeout function, if provided, is executed. - * - * To cancel a timeout request, call `$timeout.cancel(promise)`. - * - * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to - * synchronously flush the queue of deferred functions. - * - * If you only want a promise that will be resolved after some specified delay - * then you can call `$timeout` without the `fn` function. - * - * @param {function()=} fn A function, whose execution should be delayed. - * @param {number=} [delay=0] Delay in milliseconds. - * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise - * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. - * @param {...*=} Pass additional parameters to the executed function. - * @returns {Promise} Promise that will be resolved when the timeout is reached. The promise - * will be resolved with the return value of the `fn` function. - * - */ - function timeout(fn, delay, invokeApply) { - if (!isFunction(fn)) { - invokeApply = delay; - delay = fn; - fn = noop; - } - - var args = sliceArgs(arguments, 3), - skipApply = (isDefined(invokeApply) && !invokeApply), - deferred = (skipApply ? $$q : $q).defer(), - promise = deferred.promise, - timeoutId; - - timeoutId = $browser.defer(function() { - try { - deferred.resolve(fn.apply(null, args)); - } catch (e) { - deferred.reject(e); - $exceptionHandler(e); - } finally { - delete deferreds[promise.$$timeoutId]; - } - - if (!skipApply) $rootScope.$apply(); - }, delay); - - promise.$$timeoutId = timeoutId; - deferreds[timeoutId] = deferred; - - return promise; - } - - - /** - * @ngdoc method - * @name $timeout#cancel - * - * @description - * Cancels a task associated with the `promise`. As a result of this, the promise will be - * resolved with a rejection. - * - * @param {Promise=} promise Promise returned by the `$timeout` function. - * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully - * canceled. - */ - timeout.cancel = function(promise) { - if (promise && promise.$$timeoutId in deferreds) { - // Timeout cancels should not report an unhandled promise. - markQExceptionHandled(deferreds[promise.$$timeoutId].promise); - deferreds[promise.$$timeoutId].reject('canceled'); - delete deferreds[promise.$$timeoutId]; - return $browser.defer.cancel(promise.$$timeoutId); - } - return false; - }; - - return timeout; - }]; - } - -// NOTE: The usage of window and document instead of $window and $document here is -// deliberate. This service depends on the specific behavior of anchor nodes created by the -// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and -// cause us to break tests. In addition, when the browser resolves a URL for XHR, it -// doesn't know about mocked locations and resolves URLs to the real document - which is -// exactly the behavior needed here. There is little value is mocking these out for this -// service. - var urlParsingNode = window.document.createElement('a'); - var originUrl = urlResolve(window.location.href); - - - /** - * - * Implementation Notes for non-IE browsers - * ---------------------------------------- - * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM, - * results both in the normalizing and parsing of the URL. Normalizing means that a relative - * URL will be resolved into an absolute URL in the context of the application document. - * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related - * properties are all populated to reflect the normalized URL. This approach has wide - * compatibility - Safari 1+, Mozilla 1+ etc. See - * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html - * - * Implementation Notes for IE - * --------------------------- - * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other - * browsers. However, the parsed components will not be set if the URL assigned did not specify - * them. (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.) We - * work around that by performing the parsing in a 2nd step by taking a previously normalized - * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the - * properties such as protocol, hostname, port, etc. - * - * References: - * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement - * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html - * http://url.spec.whatwg.org/#urlutils - * https://github.com/angular/angular.js/pull/2902 - * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/ - * - * @kind function - * @param {string} url The URL to be parsed. - * @description Normalizes and parses a URL. - * @returns {object} Returns the normalized URL as a dictionary. - * - * | member name | Description | - * |---------------|----------------| - * | href | A normalized version of the provided URL if it was not an absolute URL | - * | protocol | The protocol including the trailing colon | - * | host | The host and port (if the port is non-default) of the normalizedUrl | - * | search | The search params, minus the question mark | - * | hash | The hash string, minus the hash symbol - * | hostname | The hostname - * | port | The port, without ":" - * | pathname | The pathname, beginning with "/" - * - */ - function urlResolve(url) { - var href = url; - - // Support: IE 9-11 only - if (msie) { - // Normalize before parse. Refer Implementation Notes on why this is - // done in two steps on IE. - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') - ? urlParsingNode.pathname - : '/' + urlParsingNode.pathname - }; - } - - /** - * Parse a request URL and determine whether this is a same-origin request as the application document. - * - * @param {string|object} requestUrl The url of the request as a string that will be resolved - * or a parsed URL object. - * @returns {boolean} Whether the request is for the same origin as the application document. - */ - function urlIsSameOrigin(requestUrl) { - var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl; - return (parsed.protocol === originUrl.protocol && - parsed.host === originUrl.host); - } - - /** - * @ngdoc service - * @name $window - * @this - * - * @description - * A reference to the browser's `window` object. While `window` - * is globally available in JavaScript, it causes testability problems, because - * it is a global variable. In AngularJS we always refer to it through the - * `$window` service, so it may be overridden, removed or mocked for testing. - * - * Expressions, like the one defined for the `ngClick` directive in the example - * below, are evaluated with respect to the current scope. Therefore, there is - * no risk of inadvertently coding in a dependency on a global value in such an - * expression. - * - * @example - <example module="windowExample" name="window-service"> - <file name="index.html"> - <script> - angular.module('windowExample', []) - .controller('ExampleController', ['$scope', '$window', function($scope, $window) { - $scope.greeting = 'Hello, World!'; - $scope.doGreeting = function(greeting) { - $window.alert(greeting); - }; - }]); - </script> - <div ng-controller="ExampleController"> - <input type="text" ng-model="greeting" aria-label="greeting" /> - <button ng-click="doGreeting(greeting)">ALERT</button> - </div> - </file> - <file name="protractor.js" type="protractor"> - it('should display the greeting in the input box', function() { - element(by.model('greeting')).sendKeys('Hello, E2E Tests'); - // If we click the button it will block the test runner - // element(':button').click(); - }); - </file> - </example> - */ - function $WindowProvider() { - this.$get = valueFn(window); - } - - /** - * @name $$cookieReader - * @requires $document - * - * @description - * This is a private service for reading cookies used by $http and ngCookies - * - * @return {Object} a key/value map of the current cookies - */ - function $$CookieReader($document) { - var rawDocument = $document[0] || {}; - var lastCookies = {}; - var lastCookieString = ''; - - function safeGetCookie(rawDocument) { - try { - return rawDocument.cookie || ''; - } catch (e) { - return ''; - } - } - - function safeDecodeURIComponent(str) { - try { - return decodeURIComponent(str); - } catch (e) { - return str; - } - } - - return function() { - var cookieArray, cookie, i, index, name; - var currentCookieString = safeGetCookie(rawDocument); - - if (currentCookieString !== lastCookieString) { - lastCookieString = currentCookieString; - cookieArray = lastCookieString.split('; '); - lastCookies = {}; - - for (i = 0; i < cookieArray.length; i++) { - cookie = cookieArray[i]; - index = cookie.indexOf('='); - if (index > 0) { //ignore nameless cookies - name = safeDecodeURIComponent(cookie.substring(0, index)); - // the first value that is seen for a cookie is the most - // specific one. values for the same cookie name that - // follow are for less specific paths. - if (isUndefined(lastCookies[name])) { - lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1)); - } - } - } - } - return lastCookies; - }; - } - - $$CookieReader.$inject = ['$document']; - - /** @this */ - function $$CookieReaderProvider() { - this.$get = $$CookieReader; - } - - /* global currencyFilter: true, - dateFilter: true, - filterFilter: true, - jsonFilter: true, - limitToFilter: true, - lowercaseFilter: true, - numberFilter: true, - orderByFilter: true, - uppercaseFilter: true, - */ - - /** - * @ngdoc provider - * @name $filterProvider - * @description - * - * Filters are just functions which transform input to an output. However filters need to be - * Dependency Injected. To achieve this a filter definition consists of a factory function which is - * annotated with dependencies and is responsible for creating a filter function. - * - * <div class="alert alert-warning"> - * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`. - * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace - * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores - * (`myapp_subsection_filterx`). - * </div> - * - * ```js - * // Filter registration - * function MyModule($provide, $filterProvider) { - * // create a service to demonstrate injection (not always needed) - * $provide.value('greet', function(name){ - * return 'Hello ' + name + '!'; - * }); - * - * // register a filter factory which uses the - * // greet service to demonstrate DI. - * $filterProvider.register('greet', function(greet){ - * // return the filter function which uses the greet service - * // to generate salutation - * return function(text) { - * // filters need to be forgiving so check input validity - * return text && greet(text) || text; - * }; - * }); - * } - * ``` - * - * The filter function is registered with the `$injector` under the filter name suffix with - * `Filter`. - * - * ```js - * it('should be the same instance', inject( - * function($filterProvider) { - * $filterProvider.register('reverse', function(){ - * return ...; - * }); - * }, - * function($filter, reverseFilter) { - * expect($filter('reverse')).toBe(reverseFilter); - * }); - * ``` - * - * - * For more information about how AngularJS filters work, and how to create your own filters, see - * {@link guide/filter Filters} in the AngularJS Developer Guide. - */ - - /** - * @ngdoc service - * @name $filter - * @kind function - * @description - * Filters are used for formatting data displayed to the user. - * - * They can be used in view templates, controllers or services. AngularJS comes - * with a collection of [built-in filters](api/ng/filter), but it is easy to - * define your own as well. - * - * The general syntax in templates is as follows: - * - * ```html - * {{ expression [| filter_name[:parameter_value] ... ] }} - * ``` - * - * @param {String} name Name of the filter function to retrieve - * @return {Function} the filter function - * @example - <example name="$filter" module="filterExample"> - <file name="index.html"> - <div ng-controller="MainCtrl"> - <h3>{{ originalText }}</h3> - <h3>{{ filteredText }}</h3> - </div> - </file> - - <file name="script.js"> - angular.module('filterExample', []) - .controller('MainCtrl', function($scope, $filter) { - $scope.originalText = 'hello'; - $scope.filteredText = $filter('uppercase')($scope.originalText); - }); - </file> - </example> - */ - $FilterProvider.$inject = ['$provide']; - /** @this */ - function $FilterProvider($provide) { - var suffix = 'Filter'; - - /** - * @ngdoc method - * @name $filterProvider#register - * @param {string|Object} name Name of the filter function, or an object map of filters where - * the keys are the filter names and the values are the filter factories. - * - * <div class="alert alert-warning"> - * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`. - * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace - * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores - * (`myapp_subsection_filterx`). - * </div> - * @param {Function} factory If the first argument was a string, a factory function for the filter to be registered. - * @returns {Object} Registered filter instance, or if a map of filters was provided then a map - * of the registered filter instances. - */ - function register(name, factory) { - if (isObject(name)) { - var filters = {}; - forEach(name, function(filter, key) { - filters[key] = register(key, filter); - }); - return filters; - } else { - return $provide.factory(name + suffix, factory); - } - } - this.register = register; - - this.$get = ['$injector', function($injector) { - return function(name) { - return $injector.get(name + suffix); - }; - }]; - - //////////////////////////////////////// - - /* global - currencyFilter: false, - dateFilter: false, - filterFilter: false, - jsonFilter: false, - limitToFilter: false, - lowercaseFilter: false, - numberFilter: false, - orderByFilter: false, - uppercaseFilter: false - */ - - register('currency', currencyFilter); - register('date', dateFilter); - register('filter', filterFilter); - register('json', jsonFilter); - register('limitTo', limitToFilter); - register('lowercase', lowercaseFilter); - register('number', numberFilter); - register('orderBy', orderByFilter); - register('uppercase', uppercaseFilter); - } - - /** - * @ngdoc filter - * @name filter - * @kind function - * - * @description - * Selects a subset of items from `array` and returns it as a new array. - * - * @param {Array} array The source array. - * <div class="alert alert-info"> - * **Note**: If the array contains objects that reference themselves, filtering is not possible. - * </div> - * @param {string|Object|function()} expression The predicate to be used for selecting items from - * `array`. - * - * Can be one of: - * - * - `string`: The string is used for matching against the contents of the `array`. All strings or - * objects with string properties in `array` that match this string will be returned. This also - * applies to nested object properties. - * The predicate can be negated by prefixing the string with `!`. - * - * - `Object`: A pattern object can be used to filter specific properties on objects contained - * by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items - * which have property `name` containing "M" and property `phone` containing "1". A special - * property name (`$` by default) can be used (e.g. as in `{$: "text"}`) to accept a match - * against any property of the object or its nested object properties. That's equivalent to the - * simple substring match with a `string` as described above. The special property name can be - * overwritten, using the `anyPropertyKey` parameter. - * The predicate can be negated by prefixing the string with `!`. - * For example `{name: "!M"}` predicate will return an array of items which have property `name` - * not containing "M". - * - * Note that a named property will match properties on the same level only, while the special - * `$` property will match properties on the same level or deeper. E.g. an array item like - * `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but - * **will** be matched by `{$: 'John'}`. - * - * - `function(value, index, array)`: A predicate function can be used to write arbitrary filters. - * The function is called for each element of the array, with the element, its index, and - * the entire array itself as arguments. - * - * The final result is an array of those elements that the predicate returned true for. - * - * @param {function(actual, expected)|true|false} [comparator] Comparator which is used in - * determining if values retrieved using `expression` (when it is not a function) should be - * considered a match based on the expected value (from the filter expression) and actual - * value (from the object in the array). - * - * Can be one of: - * - * - `function(actual, expected)`: - * The function will be given the object value and the predicate value to compare and - * should return true if both values should be considered equal. - * - * - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`. - * This is essentially strict comparison of expected and actual. - * - * - `false`: A short hand for a function which will look for a substring match in a case - * insensitive way. Primitive values are converted to strings. Objects are not compared against - * primitives, unless they have a custom `toString` method (e.g. `Date` objects). - * - * - * Defaults to `false`. - * - * @param {string} [anyPropertyKey] The special property name that matches against any property. - * By default `$`. - * - * @example - <example name="filter-filter"> - <file name="index.html"> - <div ng-init="friends = [{name:'John', phone:'555-1276'}, - {name:'Mary', phone:'800-BIG-MARY'}, - {name:'Mike', phone:'555-4321'}, - {name:'Adam', phone:'555-5678'}, - {name:'Julie', phone:'555-8765'}, - {name:'Juliette', phone:'555-5678'}]"></div> - - <label>Search: <input ng-model="searchText"></label> - <table id="searchTextResults"> - <tr><th>Name</th><th>Phone</th></tr> - <tr ng-repeat="friend in friends | filter:searchText"> - <td>{{friend.name}}</td> - <td>{{friend.phone}}</td> - </tr> - </table> - <hr> - <label>Any: <input ng-model="search.$"></label> <br> - <label>Name only <input ng-model="search.name"></label><br> - <label>Phone only <input ng-model="search.phone"></label><br> - <label>Equality <input type="checkbox" ng-model="strict"></label><br> - <table id="searchObjResults"> - <tr><th>Name</th><th>Phone</th></tr> - <tr ng-repeat="friendObj in friends | filter:search:strict"> - <td>{{friendObj.name}}</td> - <td>{{friendObj.phone}}</td> - </tr> - </table> - </file> - <file name="protractor.js" type="protractor"> - var expectFriendNames = function(expectedNames, key) { - element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) { - arr.forEach(function(wd, i) { - expect(wd.getText()).toMatch(expectedNames[i]); - }); - }); - }; - - it('should search across all fields when filtering with a string', function() { - var searchText = element(by.model('searchText')); - searchText.clear(); - searchText.sendKeys('m'); - expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend'); - - searchText.clear(); - searchText.sendKeys('76'); - expectFriendNames(['John', 'Julie'], 'friend'); - }); - - it('should search in specific fields when filtering with a predicate object', function() { - var searchAny = element(by.model('search.$')); - searchAny.clear(); - searchAny.sendKeys('i'); - expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj'); - }); - it('should use a equal comparison when comparator is true', function() { - var searchName = element(by.model('search.name')); - var strict = element(by.model('strict')); - searchName.clear(); - searchName.sendKeys('Julie'); - strict.click(); - expectFriendNames(['Julie'], 'friendObj'); - }); - </file> - </example> - */ - - function filterFilter() { - return function(array, expression, comparator, anyPropertyKey) { - if (!isArrayLike(array)) { - if (array == null) { - return array; - } else { - throw minErr('filter')('notarray', 'Expected array but received: {0}', array); - } - } - - anyPropertyKey = anyPropertyKey || '$'; - var expressionType = getTypeForFilter(expression); - var predicateFn; - var matchAgainstAnyProp; - - switch (expressionType) { - case 'function': - predicateFn = expression; - break; - case 'boolean': - case 'null': - case 'number': - case 'string': - matchAgainstAnyProp = true; - // falls through - case 'object': - predicateFn = createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp); - break; - default: - return array; - } - - return Array.prototype.filter.call(array, predicateFn); - }; - } - -// Helper functions for `filterFilter` - function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) { - var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression); - var predicateFn; - - if (comparator === true) { - comparator = equals; - } else if (!isFunction(comparator)) { - comparator = function(actual, expected) { - if (isUndefined(actual)) { - // No substring matching against `undefined` - return false; - } - if ((actual === null) || (expected === null)) { - // No substring matching against `null`; only match against `null` - return actual === expected; - } - if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) { - // Should not compare primitives against objects, unless they have custom `toString` method - return false; - } - - actual = lowercase('' + actual); - expected = lowercase('' + expected); - return actual.indexOf(expected) !== -1; - }; - } - - predicateFn = function(item) { - if (shouldMatchPrimitives && !isObject(item)) { - return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false); - } - return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp); - }; - - return predicateFn; - } - - function deepCompare(actual, expected, comparator, anyPropertyKey, matchAgainstAnyProp, dontMatchWholeObject) { - var actualType = getTypeForFilter(actual); - var expectedType = getTypeForFilter(expected); - - if ((expectedType === 'string') && (expected.charAt(0) === '!')) { - return !deepCompare(actual, expected.substring(1), comparator, anyPropertyKey, matchAgainstAnyProp); - } else if (isArray(actual)) { - // In case `actual` is an array, consider it a match - // if ANY of it's items matches `expected` - return actual.some(function(item) { - return deepCompare(item, expected, comparator, anyPropertyKey, matchAgainstAnyProp); - }); - } - - switch (actualType) { - case 'object': - var key; - if (matchAgainstAnyProp) { - for (key in actual) { - // Under certain, rare, circumstances, key may not be a string and `charAt` will be undefined - // See: https://github.com/angular/angular.js/issues/15644 - if (key.charAt && (key.charAt(0) !== '$') && - deepCompare(actual[key], expected, comparator, anyPropertyKey, true)) { - return true; - } - } - return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, anyPropertyKey, false); - } else if (expectedType === 'object') { - for (key in expected) { - var expectedVal = expected[key]; - if (isFunction(expectedVal) || isUndefined(expectedVal)) { - continue; - } - - var matchAnyProperty = key === anyPropertyKey; - var actualVal = matchAnyProperty ? actual : actual[key]; - if (!deepCompare(actualVal, expectedVal, comparator, anyPropertyKey, matchAnyProperty, matchAnyProperty)) { - return false; - } - } - return true; - } else { - return comparator(actual, expected); - } - case 'function': - return false; - default: - return comparator(actual, expected); - } - } - -// Used for easily differentiating between `null` and actual `object` - function getTypeForFilter(val) { - return (val === null) ? 'null' : typeof val; - } - - var MAX_DIGITS = 22; - var DECIMAL_SEP = '.'; - var ZERO_CHAR = '0'; - - /** - * @ngdoc filter - * @name currency - * @kind function - * - * @description - * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default - * symbol for current locale is used. - * - * @param {number} amount Input to filter. - * @param {string=} symbol Currency symbol or identifier to be displayed. - * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale - * @returns {string} Formatted number. - * - * - * @example - <example module="currencyExample" name="currency-filter"> - <file name="index.html"> - <script> - angular.module('currencyExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.amount = 1234.56; - }]); - </script> - <div ng-controller="ExampleController"> - <input type="number" ng-model="amount" aria-label="amount"> <br> - default currency symbol ($): <span id="currency-default">{{amount | currency}}</span><br> - custom currency identifier (USD$): <span id="currency-custom">{{amount | currency:"USD$"}}</span><br> - no fractions (0): <span id="currency-no-fractions">{{amount | currency:"USD$":0}}</span> - </div> - </file> - <file name="protractor.js" type="protractor"> - it('should init with 1234.56', function() { - expect(element(by.id('currency-default')).getText()).toBe('$1,234.56'); - expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56'); - expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235'); - }); - it('should update', function() { - if (browser.params.browser === 'safari') { - // Safari does not understand the minus key. See - // https://github.com/angular/protractor/issues/481 - return; - } - element(by.model('amount')).clear(); - element(by.model('amount')).sendKeys('-1234'); - expect(element(by.id('currency-default')).getText()).toBe('-$1,234.00'); - expect(element(by.id('currency-custom')).getText()).toBe('-USD$1,234.00'); - expect(element(by.id('currency-no-fractions')).getText()).toBe('-USD$1,234'); - }); - </file> - </example> - */ - currencyFilter.$inject = ['$locale']; - function currencyFilter($locale) { - var formats = $locale.NUMBER_FORMATS; - return function(amount, currencySymbol, fractionSize) { - if (isUndefined(currencySymbol)) { - currencySymbol = formats.CURRENCY_SYM; - } - - if (isUndefined(fractionSize)) { - fractionSize = formats.PATTERNS[1].maxFrac; - } - - // If the currency symbol is empty, trim whitespace around the symbol - var currencySymbolRe = !currencySymbol ? /\s*\u00A4\s*/g : /\u00A4/g; - - // if null or undefined pass it through - return (amount == null) - ? amount - : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize). - replace(currencySymbolRe, currencySymbol); - }; - } - - /** - * @ngdoc filter - * @name number - * @kind function - * - * @description - * Formats a number as text. - * - * If the input is null or undefined, it will just be returned. - * If the input is infinite (Infinity or -Infinity), the Infinity symbol '∞' or '-∞' is returned, respectively. - * If the input is not a number an empty string is returned. - * - * - * @param {number|string} number Number to format. - * @param {(number|string)=} fractionSize Number of decimal places to round the number to. - * If this is not provided then the fraction size is computed from the current locale's number - * formatting pattern. In the case of the default locale, it will be 3. - * @returns {string} Number rounded to `fractionSize` appropriately formatted based on the current - * locale (e.g., in the en_US locale it will have "." as the decimal separator and - * include "," group separators after each third digit). - * - * @example - <example module="numberFilterExample" name="number-filter"> - <file name="index.html"> - <script> - angular.module('numberFilterExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.val = 1234.56789; - }]); - </script> - <div ng-controller="ExampleController"> - <label>Enter number: <input ng-model='val'></label><br> - Default formatting: <span id='number-default'>{{val | number}}</span><br> - No fractions: <span>{{val | number:0}}</span><br> - Negative number: <span>{{-val | number:4}}</span> - </div> - </file> - <file name="protractor.js" type="protractor"> - it('should format numbers', function() { - expect(element(by.id('number-default')).getText()).toBe('1,234.568'); - expect(element(by.binding('val | number:0')).getText()).toBe('1,235'); - expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679'); - }); - - it('should update', function() { - element(by.model('val')).clear(); - element(by.model('val')).sendKeys('3374.333'); - expect(element(by.id('number-default')).getText()).toBe('3,374.333'); - expect(element(by.binding('val | number:0')).getText()).toBe('3,374'); - expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330'); - }); - </file> - </example> - */ - numberFilter.$inject = ['$locale']; - function numberFilter($locale) { - var formats = $locale.NUMBER_FORMATS; - return function(number, fractionSize) { - - // if null or undefined pass it through - return (number == null) - ? number - : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP, - fractionSize); - }; - } - - /** - * Parse a number (as a string) into three components that can be used - * for formatting the number. - * - * (Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/) - * - * @param {string} numStr The number to parse - * @return {object} An object describing this number, containing the following keys: - * - d : an array of digits containing leading zeros as necessary - * - i : the number of the digits in `d` that are to the left of the decimal point - * - e : the exponent for numbers that would need more than `MAX_DIGITS` digits in `d` - * - */ - function parse(numStr) { - var exponent = 0, digits, numberOfIntegerDigits; - var i, j, zeros; - - // Decimal point? - if ((numberOfIntegerDigits = numStr.indexOf(DECIMAL_SEP)) > -1) { - numStr = numStr.replace(DECIMAL_SEP, ''); - } - - // Exponential form? - if ((i = numStr.search(/e/i)) > 0) { - // Work out the exponent. - if (numberOfIntegerDigits < 0) numberOfIntegerDigits = i; - numberOfIntegerDigits += +numStr.slice(i + 1); - numStr = numStr.substring(0, i); - } else if (numberOfIntegerDigits < 0) { - // There was no decimal point or exponent so it is an integer. - numberOfIntegerDigits = numStr.length; - } - - // Count the number of leading zeros. - for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */ } - - if (i === (zeros = numStr.length)) { - // The digits are all zero. - digits = [0]; - numberOfIntegerDigits = 1; - } else { - // Count the number of trailing zeros - zeros--; - while (numStr.charAt(zeros) === ZERO_CHAR) zeros--; - - // Trailing zeros are insignificant so ignore them - numberOfIntegerDigits -= i; - digits = []; - // Convert string to array of digits without leading/trailing zeros. - for (j = 0; i <= zeros; i++, j++) { - digits[j] = +numStr.charAt(i); - } - } - - // If the number overflows the maximum allowed digits then use an exponent. - if (numberOfIntegerDigits > MAX_DIGITS) { - digits = digits.splice(0, MAX_DIGITS - 1); - exponent = numberOfIntegerDigits - 1; - numberOfIntegerDigits = 1; - } - - return { d: digits, e: exponent, i: numberOfIntegerDigits }; - } - - /** - * Round the parsed number to the specified number of decimal places - * This function changed the parsedNumber in-place - */ - function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) { - var digits = parsedNumber.d; - var fractionLen = digits.length - parsedNumber.i; - - // determine fractionSize if it is not specified; `+fractionSize` converts it to a number - fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize; - - // The index of the digit to where rounding is to occur - var roundAt = fractionSize + parsedNumber.i; - var digit = digits[roundAt]; - - if (roundAt > 0) { - // Drop fractional digits beyond `roundAt` - digits.splice(Math.max(parsedNumber.i, roundAt)); - - // Set non-fractional digits beyond `roundAt` to 0 - for (var j = roundAt; j < digits.length; j++) { - digits[j] = 0; - } - } else { - // We rounded to zero so reset the parsedNumber - fractionLen = Math.max(0, fractionLen); - parsedNumber.i = 1; - digits.length = Math.max(1, roundAt = fractionSize + 1); - digits[0] = 0; - for (var i = 1; i < roundAt; i++) digits[i] = 0; - } - - if (digit >= 5) { - if (roundAt - 1 < 0) { - for (var k = 0; k > roundAt; k--) { - digits.unshift(0); - parsedNumber.i++; - } - digits.unshift(1); - parsedNumber.i++; - } else { - digits[roundAt - 1]++; - } - } - - // Pad out with zeros to get the required fraction length - for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0); - - - // Do any carrying, e.g. a digit was rounded up to 10 - var carry = digits.reduceRight(function(carry, d, i, digits) { - d = d + carry; - digits[i] = d % 10; - return Math.floor(d / 10); - }, 0); - if (carry) { - digits.unshift(carry); - parsedNumber.i++; - } - } - - /** - * Format a number into a string - * @param {number} number The number to format - * @param {{ - * minFrac, // the minimum number of digits required in the fraction part of the number - * maxFrac, // the maximum number of digits required in the fraction part of the number - * gSize, // number of digits in each group of separated digits - * lgSize, // number of digits in the last group of digits before the decimal separator - * negPre, // the string to go in front of a negative number (e.g. `-` or `(`)) - * posPre, // the string to go in front of a positive number - * negSuf, // the string to go after a negative number (e.g. `)`) - * posSuf // the string to go after a positive number - * }} pattern - * @param {string} groupSep The string to separate groups of number (e.g. `,`) - * @param {string} decimalSep The string to act as the decimal separator (e.g. `.`) - * @param {[type]} fractionSize The size of the fractional part of the number - * @return {string} The number formatted as a string - */ - function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { - - if (!(isString(number) || isNumber(number)) || isNaN(number)) return ''; - - var isInfinity = !isFinite(number); - var isZero = false; - var numStr = Math.abs(number) + '', - formattedText = '', - parsedNumber; - - if (isInfinity) { - formattedText = '\u221e'; - } else { - parsedNumber = parse(numStr); - - roundNumber(parsedNumber, fractionSize, pattern.minFrac, pattern.maxFrac); - - var digits = parsedNumber.d; - var integerLen = parsedNumber.i; - var exponent = parsedNumber.e; - var decimals = []; - isZero = digits.reduce(function(isZero, d) { return isZero && !d; }, true); - - // pad zeros for small numbers - while (integerLen < 0) { - digits.unshift(0); - integerLen++; - } - - // extract decimals digits - if (integerLen > 0) { - decimals = digits.splice(integerLen, digits.length); - } else { - decimals = digits; - digits = [0]; - } - - // format the integer digits with grouping separators - var groups = []; - if (digits.length >= pattern.lgSize) { - groups.unshift(digits.splice(-pattern.lgSize, digits.length).join('')); - } - while (digits.length > pattern.gSize) { - groups.unshift(digits.splice(-pattern.gSize, digits.length).join('')); - } - if (digits.length) { - groups.unshift(digits.join('')); - } - formattedText = groups.join(groupSep); - - // append the decimal digits - if (decimals.length) { - formattedText += decimalSep + decimals.join(''); - } - - if (exponent) { - formattedText += 'e+' + exponent; - } - } - if (number < 0 && !isZero) { - return pattern.negPre + formattedText + pattern.negSuf; - } else { - return pattern.posPre + formattedText + pattern.posSuf; - } - } - - function padNumber(num, digits, trim, negWrap) { - var neg = ''; - if (num < 0 || (negWrap && num <= 0)) { - if (negWrap) { - num = -num + 1; - } else { - num = -num; - neg = '-'; - } - } - num = '' + num; - while (num.length < digits) num = ZERO_CHAR + num; - if (trim) { - num = num.substr(num.length - digits); - } - return neg + num; - } - - - function dateGetter(name, size, offset, trim, negWrap) { - offset = offset || 0; - return function(date) { - var value = date['get' + name](); - if (offset > 0 || value > -offset) { - value += offset; - } - if (value === 0 && offset === -12) value = 12; - return padNumber(value, size, trim, negWrap); - }; - } - - function dateStrGetter(name, shortForm, standAlone) { - return function(date, formats) { - var value = date['get' + name](); - var propPrefix = (standAlone ? 'STANDALONE' : '') + (shortForm ? 'SHORT' : ''); - var get = uppercase(propPrefix + name); - - return formats[get][value]; - }; - } - - function timeZoneGetter(date, formats, offset) { - var zone = -1 * offset; - var paddedZone = (zone >= 0) ? '+' : ''; - - paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) + - padNumber(Math.abs(zone % 60), 2); - - return paddedZone; - } - - function getFirstThursdayOfYear(year) { - // 0 = index of January - var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay(); - // 4 = index of Thursday (+1 to account for 1st = 5) - // 11 = index of *next* Thursday (+1 account for 1st = 12) - return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst); - } - - function getThursdayThisWeek(datetime) { - return new Date(datetime.getFullYear(), datetime.getMonth(), - // 4 = index of Thursday - datetime.getDate() + (4 - datetime.getDay())); - } - - function weekGetter(size) { - return function(date) { - var firstThurs = getFirstThursdayOfYear(date.getFullYear()), - thisThurs = getThursdayThisWeek(date); - - var diff = +thisThurs - +firstThurs, - result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week - - return padNumber(result, size); - }; - } - - function ampmGetter(date, formats) { - return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]; - } - - function eraGetter(date, formats) { - return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1]; - } - - function longEraGetter(date, formats) { - return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1]; - } - - var DATE_FORMATS = { - yyyy: dateGetter('FullYear', 4, 0, false, true), - yy: dateGetter('FullYear', 2, 0, true, true), - y: dateGetter('FullYear', 1, 0, false, true), - MMMM: dateStrGetter('Month'), - MMM: dateStrGetter('Month', true), - MM: dateGetter('Month', 2, 1), - M: dateGetter('Month', 1, 1), - LLLL: dateStrGetter('Month', false, true), - dd: dateGetter('Date', 2), - d: dateGetter('Date', 1), - HH: dateGetter('Hours', 2), - H: dateGetter('Hours', 1), - hh: dateGetter('Hours', 2, -12), - h: dateGetter('Hours', 1, -12), - mm: dateGetter('Minutes', 2), - m: dateGetter('Minutes', 1), - ss: dateGetter('Seconds', 2), - s: dateGetter('Seconds', 1), - // while ISO 8601 requires fractions to be prefixed with `.` or `,` - // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions - sss: dateGetter('Milliseconds', 3), - EEEE: dateStrGetter('Day'), - EEE: dateStrGetter('Day', true), - a: ampmGetter, - Z: timeZoneGetter, - ww: weekGetter(2), - w: weekGetter(1), - G: eraGetter, - GG: eraGetter, - GGG: eraGetter, - GGGG: longEraGetter - }; - - var DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/, - NUMBER_STRING = /^-?\d+$/; - - /** - * @ngdoc filter - * @name date - * @kind function - * - * @description - * Formats `date` to a string based on the requested `format`. - * - * `format` string can be composed of the following elements: - * - * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010) - * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10) - * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199) - * * `'MMMM'`: Month in year (January-December) - * * `'MMM'`: Month in year (Jan-Dec) - * * `'MM'`: Month in year, padded (01-12) - * * `'M'`: Month in year (1-12) - * * `'LLLL'`: Stand-alone month in year (January-December) - * * `'dd'`: Day in month, padded (01-31) - * * `'d'`: Day in month (1-31) - * * `'EEEE'`: Day in Week,(Sunday-Saturday) - * * `'EEE'`: Day in Week, (Sun-Sat) - * * `'HH'`: Hour in day, padded (00-23) - * * `'H'`: Hour in day (0-23) - * * `'hh'`: Hour in AM/PM, padded (01-12) - * * `'h'`: Hour in AM/PM, (1-12) - * * `'mm'`: Minute in hour, padded (00-59) - * * `'m'`: Minute in hour (0-59) - * * `'ss'`: Second in minute, padded (00-59) - * * `'s'`: Second in minute (0-59) - * * `'sss'`: Millisecond in second, padded (000-999) - * * `'a'`: AM/PM marker - * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200) - * * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year - * * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year - * * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD') - * * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini') - * - * `format` string can also be one of the following predefined - * {@link guide/i18n localizable formats}: - * - * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale - * (e.g. Sep 3, 2010 12:05:08 PM) - * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 PM) - * * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US locale - * (e.g. Friday, September 3, 2010) - * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010) - * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010) - * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10) - * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM) - * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM) - * - * `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g. - * `"h 'in the morning'"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence - * (e.g. `"h 'o''clock'"`). - * - * Any other characters in the `format` string will be output as-is. - * - * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or - * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its - * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is - * specified in the string input, the time is considered to be in the local timezone. - * @param {string=} format Formatting rules (see Description). If not specified, - * `mediumDate` is used. - * @param {string=} timezone Timezone to be used for formatting. It understands UTC/GMT and the - * continental US time zone abbreviations, but for general use, use a time zone offset, for - * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian) - * If not specified, the timezone of the browser will be used. - * @returns {string} Formatted string or the input if input is not recognized as date/millis. - * - * @example - <example name="filter-date"> - <file name="index.html"> - <span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>: - <span>{{1288323623006 | date:'medium'}}</span><br> - <span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>: - <span>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span><br> - <span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>: - <span>{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}</span><br> - <span ng-non-bindable>{{1288323623006 | date:"MM/dd/yyyy 'at' h:mma"}}</span>: - <span>{{'1288323623006' | date:"MM/dd/yyyy 'at' h:mma"}}</span><br> - </file> - <file name="protractor.js" type="protractor"> - it('should format date', function() { - expect(element(by.binding("1288323623006 | date:'medium'")).getText()). - toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/); - expect(element(by.binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).getText()). - toMatch(/2010-10-2\d \d{2}:\d{2}:\d{2} (-|\+)?\d{4}/); - expect(element(by.binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).getText()). - toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/); - expect(element(by.binding("'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"")).getText()). - toMatch(/10\/2\d\/2010 at \d{1,2}:\d{2}(AM|PM)/); - }); - </file> - </example> - */ - dateFilter.$inject = ['$locale']; - function dateFilter($locale) { - - - var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; - // 1 2 3 4 5 6 7 8 9 10 11 - function jsonStringToDate(string) { - var match; - if ((match = string.match(R_ISO8601_STR))) { - var date = new Date(0), - tzHour = 0, - tzMin = 0, - dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear, - timeSetter = match[8] ? date.setUTCHours : date.setHours; - - if (match[9]) { - tzHour = toInt(match[9] + match[10]); - tzMin = toInt(match[9] + match[11]); - } - dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3])); - var h = toInt(match[4] || 0) - tzHour; - var m = toInt(match[5] || 0) - tzMin; - var s = toInt(match[6] || 0); - var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000); - timeSetter.call(date, h, m, s, ms); - return date; - } - return string; - } - - - return function(date, format, timezone) { - var text = '', - parts = [], - fn, match; - - format = format || 'mediumDate'; - format = $locale.DATETIME_FORMATS[format] || format; - if (isString(date)) { - date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date); - } - - if (isNumber(date)) { - date = new Date(date); - } - - if (!isDate(date) || !isFinite(date.getTime())) { - return date; - } - - while (format) { - match = DATE_FORMATS_SPLIT.exec(format); - if (match) { - parts = concat(parts, match, 1); - format = parts.pop(); - } else { - parts.push(format); - format = null; - } - } - - var dateTimezoneOffset = date.getTimezoneOffset(); - if (timezone) { - dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset); - date = convertTimezoneToLocal(date, timezone, true); - } - forEach(parts, function(value) { - fn = DATE_FORMATS[value]; - text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset) - : value === '\'\'' ? '\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\''); - }); - - return text; - }; - } - - - /** - * @ngdoc filter - * @name json - * @kind function - * - * @description - * Allows you to convert a JavaScript object into JSON string. - * - * This filter is mostly useful for debugging. When using the double curly {{value}} notation - * the binding is automatically converted to JSON. - * - * @param {*} object Any JavaScript object (including arrays and primitive types) to filter. - * @param {number=} spacing The number of spaces to use per indentation, defaults to 2. - * @returns {string} JSON string. - * - * - * @example - <example name="filter-json"> - <file name="index.html"> - <pre id="default-spacing">{{ {'name':'value'} | json }}</pre> - <pre id="custom-spacing">{{ {'name':'value'} | json:4 }}</pre> - </file> - <file name="protractor.js" type="protractor"> - it('should jsonify filtered objects', function() { - expect(element(by.id('default-spacing')).getText()).toMatch(/\{\n {2}"name": ?"value"\n}/); - expect(element(by.id('custom-spacing')).getText()).toMatch(/\{\n {4}"name": ?"value"\n}/); - }); - </file> - </example> - * - */ - function jsonFilter() { - return function(object, spacing) { - if (isUndefined(spacing)) { - spacing = 2; - } - return toJson(object, spacing); - }; - } - - - /** - * @ngdoc filter - * @name lowercase - * @kind function - * @description - * Converts string to lowercase. - * - * See the {@link ng.uppercase uppercase filter documentation} for a functionally identical example. - * - * @see angular.lowercase - */ - var lowercaseFilter = valueFn(lowercase); - - - /** - * @ngdoc filter - * @name uppercase - * @kind function - * @description - * Converts string to uppercase. - * @example - <example module="uppercaseFilterExample" name="filter-uppercase"> - <file name="index.html"> - <script> - angular.module('uppercaseFilterExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.title = 'This is a title'; - }]); - </script> - <div ng-controller="ExampleController"> - <!-- This title should be formatted normally --> - <h1>{{title}}</h1> - <!-- This title should be capitalized --> - <h1>{{title | uppercase}}</h1> - </div> - </file> - </example> - */ - var uppercaseFilter = valueFn(uppercase); - - /** - * @ngdoc filter - * @name limitTo - * @kind function - * - * @description - * Creates a new array or string containing only a specified number of elements. The elements are - * taken from either the beginning or the end of the source array, string or number, as specified by - * the value and sign (positive or negative) of `limit`. Other array-like objects are also supported - * (e.g. array subclasses, NodeLists, jqLite/jQuery collections etc). If a number is used as input, - * it is converted to a string. - * - * @param {Array|ArrayLike|string|number} input - Array/array-like, string or number to be limited. - * @param {string|number} limit - The length of the returned array or string. If the `limit` number - * is positive, `limit` number of items from the beginning of the source array/string are copied. - * If the number is negative, `limit` number of items from the end of the source array/string - * are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined, - * the input will be returned unchanged. - * @param {(string|number)=} begin - Index at which to begin limitation. As a negative index, - * `begin` indicates an offset from the end of `input`. Defaults to `0`. - * @returns {Array|string} A new sub-array or substring of length `limit` or less if the input had - * less than `limit` elements. - * - * @example - <example module="limitToExample" name="limit-to-filter"> - <file name="index.html"> - <script> - angular.module('limitToExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.numbers = [1,2,3,4,5,6,7,8,9]; - $scope.letters = "abcdefghi"; - $scope.longNumber = 2345432342; - $scope.numLimit = 3; - $scope.letterLimit = 3; - $scope.longNumberLimit = 3; - }]); - </script> - <div ng-controller="ExampleController"> - <label> - Limit {{numbers}} to: - <input type="number" step="1" ng-model="numLimit"> - </label> - <p>Output numbers: {{ numbers | limitTo:numLimit }}</p> - <label> - Limit {{letters}} to: - <input type="number" step="1" ng-model="letterLimit"> - </label> - <p>Output letters: {{ letters | limitTo:letterLimit }}</p> - <label> - Limit {{longNumber}} to: - <input type="number" step="1" ng-model="longNumberLimit"> - </label> - <p>Output long number: {{ longNumber | limitTo:longNumberLimit }}</p> - </div> - </file> - <file name="protractor.js" type="protractor"> - var numLimitInput = element(by.model('numLimit')); - var letterLimitInput = element(by.model('letterLimit')); - var longNumberLimitInput = element(by.model('longNumberLimit')); - var limitedNumbers = element(by.binding('numbers | limitTo:numLimit')); - var limitedLetters = element(by.binding('letters | limitTo:letterLimit')); - var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit')); - - it('should limit the number array to first three items', function() { - expect(numLimitInput.getAttribute('value')).toBe('3'); - expect(letterLimitInput.getAttribute('value')).toBe('3'); - expect(longNumberLimitInput.getAttribute('value')).toBe('3'); - expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]'); - expect(limitedLetters.getText()).toEqual('Output letters: abc'); - expect(limitedLongNumber.getText()).toEqual('Output long number: 234'); - }); - - // There is a bug in safari and protractor that doesn't like the minus key - // it('should update the output when -3 is entered', function() { - // numLimitInput.clear(); - // numLimitInput.sendKeys('-3'); - // letterLimitInput.clear(); - // letterLimitInput.sendKeys('-3'); - // longNumberLimitInput.clear(); - // longNumberLimitInput.sendKeys('-3'); - // expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]'); - // expect(limitedLetters.getText()).toEqual('Output letters: ghi'); - // expect(limitedLongNumber.getText()).toEqual('Output long number: 342'); - // }); - - it('should not exceed the maximum size of input array', function() { - numLimitInput.clear(); - numLimitInput.sendKeys('100'); - letterLimitInput.clear(); - letterLimitInput.sendKeys('100'); - longNumberLimitInput.clear(); - longNumberLimitInput.sendKeys('100'); - expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]'); - expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi'); - expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342'); - }); - </file> - </example> - */ - function limitToFilter() { - return function(input, limit, begin) { - if (Math.abs(Number(limit)) === Infinity) { - limit = Number(limit); - } else { - limit = toInt(limit); - } - if (isNumberNaN(limit)) return input; - - if (isNumber(input)) input = input.toString(); - if (!isArrayLike(input)) return input; - - begin = (!begin || isNaN(begin)) ? 0 : toInt(begin); - begin = (begin < 0) ? Math.max(0, input.length + begin) : begin; - - if (limit >= 0) { - return sliceFn(input, begin, begin + limit); - } else { - if (begin === 0) { - return sliceFn(input, limit, input.length); - } else { - return sliceFn(input, Math.max(0, begin + limit), begin); - } - } - }; - } - - function sliceFn(input, begin, end) { - if (isString(input)) return input.slice(begin, end); - - return slice.call(input, begin, end); - } - - /** - * @ngdoc filter - * @name orderBy - * @kind function - * - * @description - * Returns an array containing the items from the specified `collection`, ordered by a `comparator` - * function based on the values computed using the `expression` predicate. - * - * For example, `[{id: 'foo'}, {id: 'bar'}] | orderBy:'id'` would result in - * `[{id: 'bar'}, {id: 'foo'}]`. - * - * The `collection` can be an Array or array-like object (e.g. NodeList, jQuery object, TypedArray, - * String, etc). - * - * The `expression` can be a single predicate, or a list of predicates each serving as a tie-breaker - * for the preceding one. The `expression` is evaluated against each item and the output is used - * for comparing with other items. - * - * You can change the sorting order by setting `reverse` to `true`. By default, items are sorted in - * ascending order. - * - * The comparison is done using the `comparator` function. If none is specified, a default, built-in - * comparator is used (see below for details - in a nutshell, it compares numbers numerically and - * strings alphabetically). - * - * ### Under the hood - * - * Ordering the specified `collection` happens in two phases: - * - * 1. All items are passed through the predicate (or predicates), and the returned values are saved - * along with their type (`string`, `number` etc). For example, an item `{label: 'foo'}`, passed - * through a predicate that extracts the value of the `label` property, would be transformed to: - * ``` - * { - * value: 'foo', - * type: 'string', - * index: ... - * } - * ``` - * 2. The comparator function is used to sort the items, based on the derived values, types and - * indices. - * - * If you use a custom comparator, it will be called with pairs of objects of the form - * `{value: ..., type: '...', index: ...}` and is expected to return `0` if the objects are equal - * (as far as the comparator is concerned), `-1` if the 1st one should be ranked higher than the - * second, or `1` otherwise. - * - * In order to ensure that the sorting will be deterministic across platforms, if none of the - * specified predicates can distinguish between two items, `orderBy` will automatically introduce a - * dummy predicate that returns the item's index as `value`. - * (If you are using a custom comparator, make sure it can handle this predicate as well.) - * - * If a custom comparator still can't distinguish between two items, then they will be sorted based - * on their index using the built-in comparator. - * - * Finally, in an attempt to simplify things, if a predicate returns an object as the extracted - * value for an item, `orderBy` will try to convert that object to a primitive value, before passing - * it to the comparator. The following rules govern the conversion: - * - * 1. If the object has a `valueOf()` method that returns a primitive, its return value will be - * used instead.<br /> - * (If the object has a `valueOf()` method that returns another object, then the returned object - * will be used in subsequent steps.) - * 2. If the object has a custom `toString()` method (i.e. not the one inherited from `Object`) that - * returns a primitive, its return value will be used instead.<br /> - * (If the object has a `toString()` method that returns another object, then the returned object - * will be used in subsequent steps.) - * 3. No conversion; the object itself is used. - * - * ### The default comparator - * - * The default, built-in comparator should be sufficient for most usecases. In short, it compares - * numbers numerically, strings alphabetically (and case-insensitively), for objects falls back to - * using their index in the original collection, and sorts values of different types by type. - * - * More specifically, it follows these steps to determine the relative order of items: - * - * 1. If the compared values are of different types, compare the types themselves alphabetically. - * 2. If both values are of type `string`, compare them alphabetically in a case- and - * locale-insensitive way. - * 3. If both values are objects, compare their indices instead. - * 4. Otherwise, return: - * - `0`, if the values are equal (by strict equality comparison, i.e. using `===`). - * - `-1`, if the 1st value is "less than" the 2nd value (compared using the `<` operator). - * - `1`, otherwise. - * - * **Note:** If you notice numbers not being sorted as expected, make sure they are actually being - * saved as numbers and not strings. - * **Note:** For the purpose of sorting, `null` values are treated as the string `'null'` (i.e. - * `type: 'string'`, `value: 'null'`). This may cause unexpected sort order relative to - * other values. - * - * @param {Array|ArrayLike} collection - The collection (array or array-like object) to sort. - * @param {(Function|string|Array.<Function|string>)=} expression - A predicate (or list of - * predicates) to be used by the comparator to determine the order of elements. - * - * Can be one of: - * - * - `Function`: A getter function. This function will be called with each item as argument and - * the return value will be used for sorting. - * - `string`: An AngularJS expression. This expression will be evaluated against each item and the - * result will be used for sorting. For example, use `'label'` to sort by a property called - * `label` or `'label.substring(0, 3)'` to sort by the first 3 characters of the `label` - * property.<br /> - * (The result of a constant expression is interpreted as a property name to be used for - * comparison. For example, use `'"special name"'` (note the extra pair of quotes) to sort by a - * property called `special name`.)<br /> - * An expression can be optionally prefixed with `+` or `-` to control the sorting direction, - * ascending or descending. For example, `'+label'` or `'-label'`. If no property is provided, - * (e.g. `'+'` or `'-'`), the collection element itself is used in comparisons. - * - `Array`: An array of function and/or string predicates. If a predicate cannot determine the - * relative order of two items, the next predicate is used as a tie-breaker. - * - * **Note:** If the predicate is missing or empty then it defaults to `'+'`. - * - * @param {boolean=} reverse - If `true`, reverse the sorting order. - * @param {(Function)=} comparator - The comparator function used to determine the relative order of - * value pairs. If omitted, the built-in comparator will be used. - * - * @returns {Array} - The sorted array. - * - * - * @example - * ### Ordering a table with `ngRepeat` - * - * The example below demonstrates a simple {@link ngRepeat ngRepeat}, where the data is sorted by - * age in descending order (expression is set to `'-age'`). The `comparator` is not set, which means - * it defaults to the built-in comparator. - * - <example name="orderBy-static" module="orderByExample1"> - <file name="index.html"> - <div ng-controller="ExampleController"> - <table class="friends"> - <tr> - <th>Name</th> - <th>Phone Number</th> - <th>Age</th> - </tr> - <tr ng-repeat="friend in friends | orderBy:'-age'"> - <td>{{friend.name}}</td> - <td>{{friend.phone}}</td> - <td>{{friend.age}}</td> - </tr> - </table> - </div> - </file> - <file name="script.js"> - angular.module('orderByExample1', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.friends = [ - {name: 'John', phone: '555-1212', age: 10}, - {name: 'Mary', phone: '555-9876', age: 19}, - {name: 'Mike', phone: '555-4321', age: 21}, - {name: 'Adam', phone: '555-5678', age: 35}, - {name: 'Julie', phone: '555-8765', age: 29} - ]; - }]); - </file> - <file name="style.css"> - .friends { - border-collapse: collapse; - } - - .friends th { - border-bottom: 1px solid; - } - .friends td, .friends th { - border-left: 1px solid; - padding: 5px 10px; - } - .friends td:first-child, .friends th:first-child { - border-left: none; - } - </file> - <file name="protractor.js" type="protractor"> - // Element locators - var names = element.all(by.repeater('friends').column('friend.name')); - - it('should sort friends by age in reverse order', function() { - expect(names.get(0).getText()).toBe('Adam'); - expect(names.get(1).getText()).toBe('Julie'); - expect(names.get(2).getText()).toBe('Mike'); - expect(names.get(3).getText()).toBe('Mary'); - expect(names.get(4).getText()).toBe('John'); - }); - </file> - </example> - * <hr /> - * - * @example - * ### Changing parameters dynamically - * - * All parameters can be changed dynamically. The next example shows how you can make the columns of - * a table sortable, by binding the `expression` and `reverse` parameters to scope properties. - * - <example name="orderBy-dynamic" module="orderByExample2"> - <file name="index.html"> - <div ng-controller="ExampleController"> - <pre>Sort by = {{propertyName}}; reverse = {{reverse}}</pre> - <hr/> - <button ng-click="propertyName = null; reverse = false">Set to unsorted</button> - <hr/> - <table class="friends"> - <tr> - <th> - <button ng-click="sortBy('name')">Name</button> - <span class="sortorder" ng-show="propertyName === 'name'" ng-class="{reverse: reverse}"></span> - </th> - <th> - <button ng-click="sortBy('phone')">Phone Number</button> - <span class="sortorder" ng-show="propertyName === 'phone'" ng-class="{reverse: reverse}"></span> - </th> - <th> - <button ng-click="sortBy('age')">Age</button> - <span class="sortorder" ng-show="propertyName === 'age'" ng-class="{reverse: reverse}"></span> - </th> - </tr> - <tr ng-repeat="friend in friends | orderBy:propertyName:reverse"> - <td>{{friend.name}}</td> - <td>{{friend.phone}}</td> - <td>{{friend.age}}</td> - </tr> - </table> - </div> - </file> - <file name="script.js"> - angular.module('orderByExample2', []) - .controller('ExampleController', ['$scope', function($scope) { - var friends = [ - {name: 'John', phone: '555-1212', age: 10}, - {name: 'Mary', phone: '555-9876', age: 19}, - {name: 'Mike', phone: '555-4321', age: 21}, - {name: 'Adam', phone: '555-5678', age: 35}, - {name: 'Julie', phone: '555-8765', age: 29} - ]; - - $scope.propertyName = 'age'; - $scope.reverse = true; - $scope.friends = friends; - - $scope.sortBy = function(propertyName) { - $scope.reverse = ($scope.propertyName === propertyName) ? !$scope.reverse : false; - $scope.propertyName = propertyName; - }; - }]); - </file> - <file name="style.css"> - .friends { - border-collapse: collapse; - } - - .friends th { - border-bottom: 1px solid; - } - .friends td, .friends th { - border-left: 1px solid; - padding: 5px 10px; - } - .friends td:first-child, .friends th:first-child { - border-left: none; - } - - .sortorder:after { - content: '\25b2'; // BLACK UP-POINTING TRIANGLE - } - .sortorder.reverse:after { - content: '\25bc'; // BLACK DOWN-POINTING TRIANGLE - } - </file> - <file name="protractor.js" type="protractor"> - // Element locators - var unsortButton = element(by.partialButtonText('unsorted')); - var nameHeader = element(by.partialButtonText('Name')); - var phoneHeader = element(by.partialButtonText('Phone')); - var ageHeader = element(by.partialButtonText('Age')); - var firstName = element(by.repeater('friends').column('friend.name').row(0)); - var lastName = element(by.repeater('friends').column('friend.name').row(4)); - - it('should sort friends by some property, when clicking on the column header', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - phoneHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Mary'); - - nameHeader.click(); - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('Mike'); - - ageHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Adam'); - }); - - it('should sort friends in reverse order, when clicking on the same column', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - ageHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Adam'); - - ageHeader.click(); - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - }); - - it('should restore the original order, when clicking "Set to unsorted"', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - unsortButton.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Julie'); - }); - </file> - </example> - * <hr /> - * - * @example - * ### Using `orderBy` inside a controller - * - * It is also possible to call the `orderBy` filter manually, by injecting `orderByFilter`, and - * calling it with the desired parameters. (Alternatively, you could inject the `$filter` factory - * and retrieve the `orderBy` filter with `$filter('orderBy')`.) - * - <example name="orderBy-call-manually" module="orderByExample3"> - <file name="index.html"> - <div ng-controller="ExampleController"> - <pre>Sort by = {{propertyName}}; reverse = {{reverse}}</pre> - <hr/> - <button ng-click="sortBy(null)">Set to unsorted</button> - <hr/> - <table class="friends"> - <tr> - <th> - <button ng-click="sortBy('name')">Name</button> - <span class="sortorder" ng-show="propertyName === 'name'" ng-class="{reverse: reverse}"></span> - </th> - <th> - <button ng-click="sortBy('phone')">Phone Number</button> - <span class="sortorder" ng-show="propertyName === 'phone'" ng-class="{reverse: reverse}"></span> - </th> - <th> - <button ng-click="sortBy('age')">Age</button> - <span class="sortorder" ng-show="propertyName === 'age'" ng-class="{reverse: reverse}"></span> - </th> - </tr> - <tr ng-repeat="friend in friends"> - <td>{{friend.name}}</td> - <td>{{friend.phone}}</td> - <td>{{friend.age}}</td> - </tr> - </table> - </div> - </file> - <file name="script.js"> - angular.module('orderByExample3', []) - .controller('ExampleController', ['$scope', 'orderByFilter', function($scope, orderBy) { - var friends = [ - {name: 'John', phone: '555-1212', age: 10}, - {name: 'Mary', phone: '555-9876', age: 19}, - {name: 'Mike', phone: '555-4321', age: 21}, - {name: 'Adam', phone: '555-5678', age: 35}, - {name: 'Julie', phone: '555-8765', age: 29} - ]; - - $scope.propertyName = 'age'; - $scope.reverse = true; - $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse); - - $scope.sortBy = function(propertyName) { - $scope.reverse = (propertyName !== null && $scope.propertyName === propertyName) - ? !$scope.reverse : false; - $scope.propertyName = propertyName; - $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse); - }; - }]); - </file> - <file name="style.css"> - .friends { - border-collapse: collapse; - } - - .friends th { - border-bottom: 1px solid; - } - .friends td, .friends th { - border-left: 1px solid; - padding: 5px 10px; - } - .friends td:first-child, .friends th:first-child { - border-left: none; - } - - .sortorder:after { - content: '\25b2'; // BLACK UP-POINTING TRIANGLE - } - .sortorder.reverse:after { - content: '\25bc'; // BLACK DOWN-POINTING TRIANGLE - } - </file> - <file name="protractor.js" type="protractor"> - // Element locators - var unsortButton = element(by.partialButtonText('unsorted')); - var nameHeader = element(by.partialButtonText('Name')); - var phoneHeader = element(by.partialButtonText('Phone')); - var ageHeader = element(by.partialButtonText('Age')); - var firstName = element(by.repeater('friends').column('friend.name').row(0)); - var lastName = element(by.repeater('friends').column('friend.name').row(4)); - - it('should sort friends by some property, when clicking on the column header', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - phoneHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Mary'); - - nameHeader.click(); - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('Mike'); - - ageHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Adam'); - }); - - it('should sort friends in reverse order, when clicking on the same column', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - ageHeader.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Adam'); - - ageHeader.click(); - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - }); - - it('should restore the original order, when clicking "Set to unsorted"', function() { - expect(firstName.getText()).toBe('Adam'); - expect(lastName.getText()).toBe('John'); - - unsortButton.click(); - expect(firstName.getText()).toBe('John'); - expect(lastName.getText()).toBe('Julie'); - }); - </file> - </example> - * <hr /> - * - * @example - * ### Using a custom comparator - * - * If you have very specific requirements about the way items are sorted, you can pass your own - * comparator function. For example, you might need to compare some strings in a locale-sensitive - * way. (When specifying a custom comparator, you also need to pass a value for the `reverse` - * argument - passing `false` retains the default sorting order, i.e. ascending.) - * - <example name="orderBy-custom-comparator" module="orderByExample4"> - <file name="index.html"> - <div ng-controller="ExampleController"> - <div class="friends-container custom-comparator"> - <h3>Locale-sensitive Comparator</h3> - <table class="friends"> - <tr> - <th>Name</th> - <th>Favorite Letter</th> - </tr> - <tr ng-repeat="friend in friends | orderBy:'favoriteLetter':false:localeSensitiveComparator"> - <td>{{friend.name}}</td> - <td>{{friend.favoriteLetter}}</td> - </tr> - </table> - </div> - <div class="friends-container default-comparator"> - <h3>Default Comparator</h3> - <table class="friends"> - <tr> - <th>Name</th> - <th>Favorite Letter</th> - </tr> - <tr ng-repeat="friend in friends | orderBy:'favoriteLetter'"> - <td>{{friend.name}}</td> - <td>{{friend.favoriteLetter}}</td> - </tr> - </table> - </div> - </div> - </file> - <file name="script.js"> - angular.module('orderByExample4', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.friends = [ - {name: 'John', favoriteLetter: 'Ä'}, - {name: 'Mary', favoriteLetter: 'Ü'}, - {name: 'Mike', favoriteLetter: 'Ö'}, - {name: 'Adam', favoriteLetter: 'H'}, - {name: 'Julie', favoriteLetter: 'Z'} - ]; - - $scope.localeSensitiveComparator = function(v1, v2) { - // If we don't get strings, just compare by index - if (v1.type !== 'string' || v2.type !== 'string') { - return (v1.index < v2.index) ? -1 : 1; - } - - // Compare strings alphabetically, taking locale into account - return v1.value.localeCompare(v2.value); - }; - }]); - </file> - <file name="style.css"> - .friends-container { - display: inline-block; - margin: 0 30px; - } - - .friends { - border-collapse: collapse; - } - - .friends th { - border-bottom: 1px solid; - } - .friends td, .friends th { - border-left: 1px solid; - padding: 5px 10px; - } - .friends td:first-child, .friends th:first-child { - border-left: none; - } - </file> - <file name="protractor.js" type="protractor"> - // Element locators - var container = element(by.css('.custom-comparator')); - var names = container.all(by.repeater('friends').column('friend.name')); - - it('should sort friends by favorite letter (in correct alphabetical order)', function() { - expect(names.get(0).getText()).toBe('John'); - expect(names.get(1).getText()).toBe('Adam'); - expect(names.get(2).getText()).toBe('Mike'); - expect(names.get(3).getText()).toBe('Mary'); - expect(names.get(4).getText()).toBe('Julie'); - }); - </file> - </example> - * - */ - orderByFilter.$inject = ['$parse']; - function orderByFilter($parse) { - return function(array, sortPredicate, reverseOrder, compareFn) { - - if (array == null) return array; - if (!isArrayLike(array)) { - throw minErr('orderBy')('notarray', 'Expected array but received: {0}', array); - } - - if (!isArray(sortPredicate)) { sortPredicate = [sortPredicate]; } - if (sortPredicate.length === 0) { sortPredicate = ['+']; } - - var predicates = processPredicates(sortPredicate); - - var descending = reverseOrder ? -1 : 1; - - // Define the `compare()` function. Use a default comparator if none is specified. - var compare = isFunction(compareFn) ? compareFn : defaultCompare; - - // The next three lines are a version of a Swartzian Transform idiom from Perl - // (sometimes called the Decorate-Sort-Undecorate idiom) - // See https://en.wikipedia.org/wiki/Schwartzian_transform - var compareValues = Array.prototype.map.call(array, getComparisonObject); - compareValues.sort(doComparison); - array = compareValues.map(function(item) { return item.value; }); - - return array; - - function getComparisonObject(value, index) { - // NOTE: We are adding an extra `tieBreaker` value based on the element's index. - // This will be used to keep the sort stable when none of the input predicates can - // distinguish between two elements. - return { - value: value, - tieBreaker: {value: index, type: 'number', index: index}, - predicateValues: predicates.map(function(predicate) { - return getPredicateValue(predicate.get(value), index); - }) - }; - } - - function doComparison(v1, v2) { - for (var i = 0, ii = predicates.length; i < ii; i++) { - var result = compare(v1.predicateValues[i], v2.predicateValues[i]); - if (result) { - return result * predicates[i].descending * descending; - } - } - - return (compare(v1.tieBreaker, v2.tieBreaker) || defaultCompare(v1.tieBreaker, v2.tieBreaker)) * descending; - } - }; - - function processPredicates(sortPredicates) { - return sortPredicates.map(function(predicate) { - var descending = 1, get = identity; - - if (isFunction(predicate)) { - get = predicate; - } else if (isString(predicate)) { - if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) { - descending = predicate.charAt(0) === '-' ? -1 : 1; - predicate = predicate.substring(1); - } - if (predicate !== '') { - get = $parse(predicate); - if (get.constant) { - var key = get(); - get = function(value) { return value[key]; }; - } - } - } - return {get: get, descending: descending}; - }); - } - - function isPrimitive(value) { - switch (typeof value) { - case 'number': /* falls through */ - case 'boolean': /* falls through */ - case 'string': - return true; - default: - return false; - } - } - - function objectValue(value) { - // If `valueOf` is a valid function use that - if (isFunction(value.valueOf)) { - value = value.valueOf(); - if (isPrimitive(value)) return value; - } - // If `toString` is a valid function and not the one from `Object.prototype` use that - if (hasCustomToString(value)) { - value = value.toString(); - if (isPrimitive(value)) return value; - } - - return value; - } - - function getPredicateValue(value, index) { - var type = typeof value; - if (value === null) { - type = 'string'; - value = 'null'; - } else if (type === 'object') { - value = objectValue(value); - } - return {value: value, type: type, index: index}; - } - - function defaultCompare(v1, v2) { - var result = 0; - var type1 = v1.type; - var type2 = v2.type; - - if (type1 === type2) { - var value1 = v1.value; - var value2 = v2.value; - - if (type1 === 'string') { - // Compare strings case-insensitively - value1 = value1.toLowerCase(); - value2 = value2.toLowerCase(); - } else if (type1 === 'object') { - // For basic objects, use the position of the object - // in the collection instead of the value - if (isObject(value1)) value1 = v1.index; - if (isObject(value2)) value2 = v2.index; - } - - if (value1 !== value2) { - result = value1 < value2 ? -1 : 1; - } - } else { - result = type1 < type2 ? -1 : 1; - } - - return result; - } - } - - function ngDirective(directive) { - if (isFunction(directive)) { - directive = { - link: directive - }; - } - directive.restrict = directive.restrict || 'AC'; - return valueFn(directive); - } - - /** - * @ngdoc directive - * @name a - * @restrict E - * - * @description - * Modifies the default behavior of the html a tag so that the default action is prevented when - * the href attribute is empty. - * - * For dynamically creating `href` attributes for a tags, see the {@link ng.ngHref `ngHref`} directive. - */ - var htmlAnchorDirective = valueFn({ - restrict: 'E', - compile: function(element, attr) { - if (!attr.href && !attr.xlinkHref) { - return function(scope, element) { - // If the linked element is not an anchor tag anymore, do nothing - if (element[0].nodeName.toLowerCase() !== 'a') return; - - // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. - var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? - 'xlink:href' : 'href'; - element.on('click', function(event) { - // if we have no href url, then don't navigate anywhere. - if (!element.attr(href)) { - event.preventDefault(); - } - }); - }; - } - } - }); - - /** - * @ngdoc directive - * @name ngHref - * @restrict A - * @priority 99 - * - * @description - * Using AngularJS markup like `{{hash}}` in an href attribute will - * make the link go to the wrong URL if the user clicks it before - * AngularJS has a chance to replace the `{{hash}}` markup with its - * value. Until AngularJS replaces the markup the link will be broken - * and will most likely return a 404 error. The `ngHref` directive - * solves this problem. - * - * The wrong way to write it: - * ```html - * <a href="http://www.gravatar.com/avatar/{{hash}}">link1</a> - * ``` - * - * The correct way to write it: - * ```html - * <a ng-href="http://www.gravatar.com/avatar/{{hash}}">link1</a> - * ``` - * - * @element A - * @param {template} ngHref any string which can contain `{{}}` markup. - * - * @example - * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes - * in links and their different behaviors: - <example name="ng-href"> - <file name="index.html"> - <input ng-model="value" /><br /> - <a id="link-1" href ng-click="value = 1">link 1</a> (link, don't reload)<br /> - <a id="link-2" href="" ng-click="value = 2">link 2</a> (link, don't reload)<br /> - <a id="link-3" ng-href="/{{'123'}}">link 3</a> (link, reload!)<br /> - <a id="link-4" href="" name="xx" ng-click="value = 4">anchor</a> (link, don't reload)<br /> - <a id="link-5" name="xxx" ng-click="value = 5">anchor</a> (no link)<br /> - <a id="link-6" ng-href="{{value}}">link</a> (link, change location) - </file> - <file name="protractor.js" type="protractor"> - it('should execute ng-click but not reload when href without value', function() { - element(by.id('link-1')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('1'); - expect(element(by.id('link-1')).getAttribute('href')).toBe(''); - }); - - it('should execute ng-click but not reload when href empty string', function() { - element(by.id('link-2')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('2'); - expect(element(by.id('link-2')).getAttribute('href')).toBe(''); - }); - - it('should execute ng-click and change url when ng-href specified', function() { - expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\/123$/); - - element(by.id('link-3')).click(); - - // At this point, we navigate away from an AngularJS page, so we need - // to use browser.driver to get the base webdriver. - - browser.wait(function() { - return browser.driver.getCurrentUrl().then(function(url) { - return url.match(/\/123$/); - }); - }, 5000, 'page should navigate to /123'); - }); - - it('should execute ng-click but not reload when href empty string and name specified', function() { - element(by.id('link-4')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('4'); - expect(element(by.id('link-4')).getAttribute('href')).toBe(''); - }); - - it('should execute ng-click but not reload when no href but name specified', function() { - element(by.id('link-5')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('5'); - expect(element(by.id('link-5')).getAttribute('href')).toBe(null); - }); - - it('should only change url when only ng-href', function() { - element(by.model('value')).clear(); - element(by.model('value')).sendKeys('6'); - expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\/6$/); - - element(by.id('link-6')).click(); - - // At this point, we navigate away from an AngularJS page, so we need - // to use browser.driver to get the base webdriver. - browser.wait(function() { - return browser.driver.getCurrentUrl().then(function(url) { - return url.match(/\/6$/); - }); - }, 5000, 'page should navigate to /6'); - }); - </file> - </example> - */ - - /** - * @ngdoc directive - * @name ngSrc - * @restrict A - * @priority 99 - * - * @description - * Using AngularJS markup like `{{hash}}` in a `src` attribute doesn't - * work right: The browser will fetch from the URL with the literal - * text `{{hash}}` until AngularJS replaces the expression inside - * `{{hash}}`. The `ngSrc` directive solves this problem. - * - * The buggy way to write it: - * ```html - * <img src="http://www.gravatar.com/avatar/{{hash}}" alt="Description"/> - * ``` - * - * The correct way to write it: - * ```html - * <img ng-src="http://www.gravatar.com/avatar/{{hash}}" alt="Description" /> - * ``` - * - * @element IMG - * @param {template} ngSrc any string which can contain `{{}}` markup. - */ - - /** - * @ngdoc directive - * @name ngSrcset - * @restrict A - * @priority 99 - * - * @description - * Using AngularJS markup like `{{hash}}` in a `srcset` attribute doesn't - * work right: The browser will fetch from the URL with the literal - * text `{{hash}}` until AngularJS replaces the expression inside - * `{{hash}}`. The `ngSrcset` directive solves this problem. - * - * The buggy way to write it: - * ```html - * <img srcset="http://www.gravatar.com/avatar/{{hash}} 2x" alt="Description"/> - * ``` - * - * The correct way to write it: - * ```html - * <img ng-srcset="http://www.gravatar.com/avatar/{{hash}} 2x" alt="Description" /> - * ``` - * - * @element IMG - * @param {template} ngSrcset any string which can contain `{{}}` markup. - */ - - /** - * @ngdoc directive - * @name ngDisabled - * @restrict A - * @priority 100 - * - * @description - * - * This directive sets the `disabled` attribute on the element (typically a form control, - * e.g. `input`, `button`, `select` etc.) if the - * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy. - * - * A special directive is necessary because we cannot use interpolation inside the `disabled` - * attribute. See the {@link guide/interpolation interpolation guide} for more info. - * - * @example - <example name="ng-disabled"> - <file name="index.html"> - <label>Click me to toggle: <input type="checkbox" ng-model="checked"></label><br/> - <button ng-model="button" ng-disabled="checked">Button</button> - </file> - <file name="protractor.js" type="protractor"> - it('should toggle button', function() { - expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy(); - element(by.model('checked')).click(); - expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy(); - }); - </file> - </example> - * - * @element INPUT - * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy, - * then the `disabled` attribute will be set on the element - */ - - - /** - * @ngdoc directive - * @name ngChecked - * @restrict A - * @priority 100 - * - * @description - * Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy. - * - * Note that this directive should not be used together with {@link ngModel `ngModel`}, - * as this can lead to unexpected behavior. - * - * A special directive is necessary because we cannot use interpolation inside the `checked` - * attribute. See the {@link guide/interpolation interpolation guide} for more info. - * - * @example - <example name="ng-checked"> - <file name="index.html"> - <label>Check me to check both: <input type="checkbox" ng-model="leader"></label><br/> - <input id="checkFollower" type="checkbox" ng-checked="leader" aria-label="Follower input"> - </file> - <file name="protractor.js" type="protractor"> - it('should check both checkBoxes', function() { - expect(element(by.id('checkFollower')).getAttribute('checked')).toBeFalsy(); - element(by.model('leader')).click(); - expect(element(by.id('checkFollower')).getAttribute('checked')).toBeTruthy(); - }); - </file> - </example> - * - * @element INPUT - * @param {expression} ngChecked If the {@link guide/expression expression} is truthy, - * then the `checked` attribute will be set on the element - */ - - - /** - * @ngdoc directive - * @name ngReadonly - * @restrict A - * @priority 100 - * - * @description - * - * Sets the `readonly` attribute on the element, if the expression inside `ngReadonly` is truthy. - * Note that `readonly` applies only to `input` elements with specific types. [See the input docs on - * MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly) for more information. - * - * A special directive is necessary because we cannot use interpolation inside the `readonly` - * attribute. See the {@link guide/interpolation interpolation guide} for more info. - * - * @example - <example name="ng-readonly"> - <file name="index.html"> - <label>Check me to make text readonly: <input type="checkbox" ng-model="checked"></label><br/> - <input type="text" ng-readonly="checked" value="I'm AngularJS" aria-label="Readonly field" /> - </file> - <file name="protractor.js" type="protractor"> - it('should toggle readonly attr', function() { - expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeFalsy(); - element(by.model('checked')).click(); - expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeTruthy(); - }); - </file> - </example> - * - * @element INPUT - * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy, - * then special attribute "readonly" will be set on the element - */ - - - /** - * @ngdoc directive - * @name ngSelected - * @restrict A - * @priority 100 - * - * @description - * - * Sets the `selected` attribute on the element, if the expression inside `ngSelected` is truthy. - * - * A special directive is necessary because we cannot use interpolation inside the `selected` - * attribute. See the {@link guide/interpolation interpolation guide} for more info. - * - * <div class="alert alert-warning"> - * **Note:** `ngSelected` does not interact with the `select` and `ngModel` directives, it only - * sets the `selected` attribute on the element. If you are using `ngModel` on the select, you - * should not use `ngSelected` on the options, as `ngModel` will set the select value and - * selected options. - * </div> - * - * @example - <example name="ng-selected"> - <file name="index.html"> - <label>Check me to select: <input type="checkbox" ng-model="selected"></label><br/> - <select aria-label="ngSelected demo"> - <option>Hello!</option> - <option id="greet" ng-selected="selected">Greetings!</option> - </select> - </file> - <file name="protractor.js" type="protractor"> - it('should select Greetings!', function() { - expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy(); - element(by.model('selected')).click(); - expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy(); - }); - </file> - </example> - * - * @element OPTION - * @param {expression} ngSelected If the {@link guide/expression expression} is truthy, - * then special attribute "selected" will be set on the element - */ - - /** - * @ngdoc directive - * @name ngOpen - * @restrict A - * @priority 100 - * - * @description - * - * Sets the `open` attribute on the element, if the expression inside `ngOpen` is truthy. - * - * A special directive is necessary because we cannot use interpolation inside the `open` - * attribute. See the {@link guide/interpolation interpolation guide} for more info. - * - * ## A note about browser compatibility - * - * Internet Explorer and Edge do not support the `details` element, it is - * recommended to use {@link ng.ngShow} and {@link ng.ngHide} instead. - * - * @example - <example name="ng-open"> - <file name="index.html"> - <label>Toggle details: <input type="checkbox" ng-model="open"></label><br/> - <details id="details" ng-open="open"> - <summary>List</summary> - <ul> - <li>Apple</li> - <li>Orange</li> - <li>Durian</li> - </ul> - </details> - </file> - <file name="protractor.js" type="protractor"> - it('should toggle open', function() { - expect(element(by.id('details')).getAttribute('open')).toBeFalsy(); - element(by.model('open')).click(); - expect(element(by.id('details')).getAttribute('open')).toBeTruthy(); - }); - </file> - </example> - * - * @element DETAILS - * @param {expression} ngOpen If the {@link guide/expression expression} is truthy, - * then special attribute "open" will be set on the element - */ - - var ngAttributeAliasDirectives = {}; - -// boolean attrs are evaluated - forEach(BOOLEAN_ATTR, function(propName, attrName) { - // binding to multiple is not supported - if (propName === 'multiple') return; - - function defaultLinkFn(scope, element, attr) { - scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { - attr.$set(attrName, !!value); - }); - } - - var normalized = directiveNormalize('ng-' + attrName); - var linkFn = defaultLinkFn; - - if (propName === 'checked') { - linkFn = function(scope, element, attr) { - // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input - if (attr.ngModel !== attr[normalized]) { - defaultLinkFn(scope, element, attr); - } - }; - } - - ngAttributeAliasDirectives[normalized] = function() { - return { - restrict: 'A', - priority: 100, - link: linkFn - }; - }; - }); - -// aliased input attrs are evaluated - forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) { - ngAttributeAliasDirectives[ngAttr] = function() { - return { - priority: 100, - link: function(scope, element, attr) { - //special case ngPattern when a literal regular expression value - //is used as the expression (this way we don't have to watch anything). - if (ngAttr === 'ngPattern' && attr.ngPattern.charAt(0) === '/') { - var match = attr.ngPattern.match(REGEX_STRING_REGEXP); - if (match) { - attr.$set('ngPattern', new RegExp(match[1], match[2])); - return; - } - } - - scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) { - attr.$set(ngAttr, value); - }); - } - }; - }; - }); - -// ng-src, ng-srcset, ng-href are interpolated - forEach(['src', 'srcset', 'href'], function(attrName) { - var normalized = directiveNormalize('ng-' + attrName); - ngAttributeAliasDirectives[normalized] = function() { - return { - priority: 99, // it needs to run after the attributes are interpolated - link: function(scope, element, attr) { - var propName = attrName, - name = attrName; - - if (attrName === 'href' && - toString.call(element.prop('href')) === '[object SVGAnimatedString]') { - name = 'xlinkHref'; - attr.$attr[name] = 'xlink:href'; - propName = null; - } - - attr.$observe(normalized, function(value) { - if (!value) { - if (attrName === 'href') { - attr.$set(name, null); - } - return; - } - - attr.$set(name, value); - - // Support: IE 9-11 only - // On IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist - // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need - // to set the property as well to achieve the desired effect. - // We use attr[attrName] value since $set can sanitize the url. - if (msie && propName) element.prop(propName, attr[name]); - }); - } - }; - }; - }); - - /* global -nullFormCtrl, -PENDING_CLASS, -SUBMITTED_CLASS - */ - var nullFormCtrl = { - $addControl: noop, - $$renameControl: nullFormRenameControl, - $removeControl: noop, - $setValidity: noop, - $setDirty: noop, - $setPristine: noop, - $setSubmitted: noop - }, - PENDING_CLASS = 'ng-pending', - SUBMITTED_CLASS = 'ng-submitted'; - - function nullFormRenameControl(control, name) { - control.$name = name; - } - - /** - * @ngdoc type - * @name form.FormController - * - * @property {boolean} $pristine True if user has not interacted with the form yet. - * @property {boolean} $dirty True if user has already interacted with the form. - * @property {boolean} $valid True if all of the containing forms and controls are valid. - * @property {boolean} $invalid True if at least one containing control or form is invalid. - * @property {boolean} $submitted True if user has submitted the form even if its invalid. - * - * @property {Object} $pending An object hash, containing references to controls or forms with - * pending validators, where: - * - * - keys are validations tokens (error names). - * - values are arrays of controls or forms that have a pending validator for the given error name. - * - * See {@link form.FormController#$error $error} for a list of built-in validation tokens. - * - * @property {Object} $error An object hash, containing references to controls or forms with failing - * validators, where: - * - * - keys are validation tokens (error names), - * - values are arrays of controls or forms that have a failing validator for the given error name. - * - * Built-in validation tokens: - * - `email` - * - `max` - * - `maxlength` - * - `min` - * - `minlength` - * - `number` - * - `pattern` - * - `required` - * - `url` - * - `date` - * - `datetimelocal` - * - `time` - * - `week` - * - `month` - * - * @description - * `FormController` keeps track of all its controls and nested forms as well as the state of them, - * such as being valid/invalid or dirty/pristine. - * - * Each {@link ng.directive:form form} directive creates an instance - * of `FormController`. - * - */ -//asks for $scope to fool the BC controller module - FormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate']; - function FormController($element, $attrs, $scope, $animate, $interpolate) { - this.$$controls = []; - - // init state - this.$error = {}; - this.$$success = {}; - this.$pending = undefined; - this.$name = $interpolate($attrs.name || $attrs.ngForm || '')($scope); - this.$dirty = false; - this.$pristine = true; - this.$valid = true; - this.$invalid = false; - this.$submitted = false; - this.$$parentForm = nullFormCtrl; - - this.$$element = $element; - this.$$animate = $animate; - - setupValidity(this); - } - - FormController.prototype = { - /** - * @ngdoc method - * @name form.FormController#$rollbackViewValue - * - * @description - * Rollback all form controls pending updates to the `$modelValue`. - * - * Updates may be pending by a debounced event or because the input is waiting for a some future - * event defined in `ng-model-options`. This method is typically needed by the reset button of - * a form that uses `ng-model-options` to pend updates. - */ - $rollbackViewValue: function() { - forEach(this.$$controls, function(control) { - control.$rollbackViewValue(); - }); - }, - - /** - * @ngdoc method - * @name form.FormController#$commitViewValue - * - * @description - * Commit all form controls pending updates to the `$modelValue`. - * - * Updates may be pending by a debounced event or because the input is waiting for a some future - * event defined in `ng-model-options`. This method is rarely needed as `NgModelController` - * usually handles calling this in response to input events. - */ - $commitViewValue: function() { - forEach(this.$$controls, function(control) { - control.$commitViewValue(); - }); - }, - - /** - * @ngdoc method - * @name form.FormController#$addControl - * @param {object} control control object, either a {@link form.FormController} or an - * {@link ngModel.NgModelController} - * - * @description - * Register a control with the form. Input elements using ngModelController do this automatically - * when they are linked. - * - * Note that the current state of the control will not be reflected on the new parent form. This - * is not an issue with normal use, as freshly compiled and linked controls are in a `$pristine` - * state. - * - * However, if the method is used programmatically, for example by adding dynamically created controls, - * or controls that have been previously removed without destroying their corresponding DOM element, - * it's the developers responsibility to make sure the current state propagates to the parent form. - * - * For example, if an input control is added that is already `$dirty` and has `$error` properties, - * calling `$setDirty()` and `$validate()` afterwards will propagate the state to the parent form. - */ - $addControl: function(control) { - // Breaking change - before, inputs whose name was "hasOwnProperty" were quietly ignored - // and not added to the scope. Now we throw an error. - assertNotHasOwnProperty(control.$name, 'input'); - this.$$controls.push(control); - - if (control.$name) { - this[control.$name] = control; - } - - control.$$parentForm = this; - }, - - // Private API: rename a form control - $$renameControl: function(control, newName) { - var oldName = control.$name; - - if (this[oldName] === control) { - delete this[oldName]; - } - this[newName] = control; - control.$name = newName; - }, - - /** - * @ngdoc method - * @name form.FormController#$removeControl - * @param {object} control control object, either a {@link form.FormController} or an - * {@link ngModel.NgModelController} - * - * @description - * Deregister a control from the form. - * - * Input elements using ngModelController do this automatically when they are destroyed. - * - * Note that only the removed control's validation state (`$errors`etc.) will be removed from the - * form. `$dirty`, `$submitted` states will not be changed, because the expected behavior can be - * different from case to case. For example, removing the only `$dirty` control from a form may or - * may not mean that the form is still `$dirty`. - */ - $removeControl: function(control) { - if (control.$name && this[control.$name] === control) { - delete this[control.$name]; - } - forEach(this.$pending, function(value, name) { - // eslint-disable-next-line no-invalid-this - this.$setValidity(name, null, control); - }, this); - forEach(this.$error, function(value, name) { - // eslint-disable-next-line no-invalid-this - this.$setValidity(name, null, control); - }, this); - forEach(this.$$success, function(value, name) { - // eslint-disable-next-line no-invalid-this - this.$setValidity(name, null, control); - }, this); - - arrayRemove(this.$$controls, control); - control.$$parentForm = nullFormCtrl; - }, - - /** - * @ngdoc method - * @name form.FormController#$setDirty - * - * @description - * Sets the form to a dirty state. - * - * This method can be called to add the 'ng-dirty' class and set the form to a dirty - * state (ng-dirty class). This method will also propagate to parent forms. - */ - $setDirty: function() { - this.$$animate.removeClass(this.$$element, PRISTINE_CLASS); - this.$$animate.addClass(this.$$element, DIRTY_CLASS); - this.$dirty = true; - this.$pristine = false; - this.$$parentForm.$setDirty(); - }, - - /** - * @ngdoc method - * @name form.FormController#$setPristine - * - * @description - * Sets the form to its pristine state. - * - * This method sets the form's `$pristine` state to true, the `$dirty` state to false, removes - * the `ng-dirty` class and adds the `ng-pristine` class. Additionally, it sets the `$submitted` - * state to false. - * - * This method will also propagate to all the controls contained in this form. - * - * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after - * saving or resetting it. - */ - $setPristine: function() { - this.$$animate.setClass(this.$$element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS); - this.$dirty = false; - this.$pristine = true; - this.$submitted = false; - forEach(this.$$controls, function(control) { - control.$setPristine(); - }); - }, - - /** - * @ngdoc method - * @name form.FormController#$setUntouched - * - * @description - * Sets the form to its untouched state. - * - * This method can be called to remove the 'ng-touched' class and set the form controls to their - * untouched state (ng-untouched class). - * - * Setting a form controls back to their untouched state is often useful when setting the form - * back to its pristine state. - */ - $setUntouched: function() { - forEach(this.$$controls, function(control) { - control.$setUntouched(); - }); - }, - - /** - * @ngdoc method - * @name form.FormController#$setSubmitted - * - * @description - * Sets the form to its submitted state. - */ - $setSubmitted: function() { - this.$$animate.addClass(this.$$element, SUBMITTED_CLASS); - this.$submitted = true; - this.$$parentForm.$setSubmitted(); - } - }; - - /** - * @ngdoc method - * @name form.FormController#$setValidity - * - * @description - * Change the validity state of the form, and notify the parent form (if any). - * - * Application developers will rarely need to call this method directly. It is used internally, by - * {@link ngModel.NgModelController#$setValidity NgModelController.$setValidity()}, to propagate a - * control's validity state to the parent `FormController`. - * - * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be - * assigned to either `$error[validationErrorKey]` or `$pending[validationErrorKey]` (for - * unfulfilled `$asyncValidators`), so that it is available for data-binding. The - * `validationErrorKey` should be in camelCase and will get converted into dash-case for - * class name. Example: `myError` will result in `ng-valid-my-error` and - * `ng-invalid-my-error` classes and can be bound to as `{{ someForm.$error.myError }}`. - * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending - * (undefined), or skipped (null). Pending is used for unfulfilled `$asyncValidators`. - * Skipped is used by AngularJS when validators do not run because of parse errors and when - * `$asyncValidators` do not run because any of the `$validators` failed. - * @param {NgModelController | FormController} controller - The controller whose validity state is - * triggering the change. - */ - addSetValidityMethod({ - clazz: FormController, - set: function(object, property, controller) { - var list = object[property]; - if (!list) { - object[property] = [controller]; - } else { - var index = list.indexOf(controller); - if (index === -1) { - list.push(controller); - } - } - }, - unset: function(object, property, controller) { - var list = object[property]; - if (!list) { - return; - } - arrayRemove(list, controller); - if (list.length === 0) { - delete object[property]; - } - } - }); - - /** - * @ngdoc directive - * @name ngForm - * @restrict EAC - * - * @description - * Nestable alias of {@link ng.directive:form `form`} directive. HTML - * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a - * sub-group of controls needs to be determined. - * - * Note: the purpose of `ngForm` is to group controls, - * but not to be a replacement for the `<form>` tag with all of its capabilities - * (e.g. posting to the server, ...). - * - * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into - * related scope, under this name. - * - */ - - /** - * @ngdoc directive - * @name form - * @restrict E - * - * @description - * Directive that instantiates - * {@link form.FormController FormController}. - * - * If the `name` attribute is specified, the form controller is published onto the current scope under - * this name. - * - * ## Alias: {@link ng.directive:ngForm `ngForm`} - * - * In AngularJS, forms can be nested. This means that the outer form is valid when all of the child - * forms are valid as well. However, browsers do not allow nesting of `<form>` elements, so - * AngularJS provides the {@link ng.directive:ngForm `ngForm`} directive, which behaves identically to - * `form` but can be nested. Nested forms can be useful, for example, if the validity of a sub-group - * of controls needs to be determined. - * - * ## CSS classes - * - `ng-valid` is set if the form is valid. - * - `ng-invalid` is set if the form is invalid. - * - `ng-pending` is set if the form is pending. - * - `ng-pristine` is set if the form is pristine. - * - `ng-dirty` is set if the form is dirty. - * - `ng-submitted` is set if the form was submitted. - * - * Keep in mind that ngAnimate can detect each of these classes when added and removed. - * - * - * ## Submitting a form and preventing the default action - * - * Since the role of forms in client-side AngularJS applications is different than in classical - * roundtrip apps, it is desirable for the browser not to translate the form submission into a full - * page reload that sends the data to the server. Instead some javascript logic should be triggered - * to handle the form submission in an application-specific way. - * - * For this reason, AngularJS prevents the default action (form submission to the server) unless the - * `<form>` element has an `action` attribute specified. - * - * You can use one of the following two ways to specify what javascript method should be called when - * a form is submitted: - * - * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element - * - {@link ng.directive:ngClick ngClick} directive on the first - * button or input field of type submit (input[type=submit]) - * - * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit} - * or {@link ng.directive:ngClick ngClick} directives. - * This is because of the following form submission rules in the HTML specification: - * - * - If a form has only one input field then hitting enter in this field triggers form submit - * (`ngSubmit`) - * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter - * doesn't trigger submit - * - if a form has one or more input fields and one or more buttons or input[type=submit] then - * hitting enter in any of the input fields will trigger the click handler on the *first* button or - * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`) - * - * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is - * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit` - * to have access to the updated model. - * - * @animations - * Animations in ngForm are triggered when any of the associated CSS classes are added and removed. - * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any - * other validations that are performed within the form. Animations in ngForm are similar to how - * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well - * as JS animations. - * - * The following example shows a simple way to utilize CSS transitions to style a form element - * that has been rendered as invalid after it has been validated: - * - * <pre> - * //be sure to include ngAnimate as a module to hook into more - * //advanced animations - * .my-form { - * transition:0.5s linear all; - * background: white; - * } - * .my-form.ng-invalid { - * background: red; - * color:white; - * } - * </pre> - * - * @example - <example name="ng-form" deps="angular-animate.js" animations="true" fixBase="true" module="formExample"> - <file name="index.html"> - <script> - angular.module('formExample', []) - .controller('FormController', ['$scope', function($scope) { - $scope.userType = 'guest'; - }]); - </script> - <style> - .my-form { - transition:all linear 0.5s; - background: transparent; - } - .my-form.ng-invalid { - background: red; - } - </style> - <form name="myForm" ng-controller="FormController" class="my-form"> - userType: <input name="input" ng-model="userType" required> - <span class="error" ng-show="myForm.input.$error.required">Required!</span><br> - <code>userType = {{userType}}</code><br> - <code>myForm.input.$valid = {{myForm.input.$valid}}</code><br> - <code>myForm.input.$error = {{myForm.input.$error}}</code><br> - <code>myForm.$valid = {{myForm.$valid}}</code><br> - <code>myForm.$error.required = {{!!myForm.$error.required}}</code><br> - </form> - </file> - <file name="protractor.js" type="protractor"> - it('should initialize to model', function() { - var userType = element(by.binding('userType')); - var valid = element(by.binding('myForm.input.$valid')); - - expect(userType.getText()).toContain('guest'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - var userType = element(by.binding('userType')); - var valid = element(by.binding('myForm.input.$valid')); - var userInput = element(by.model('userType')); - - userInput.clear(); - userInput.sendKeys(''); - - expect(userType.getText()).toEqual('userType ='); - expect(valid.getText()).toContain('false'); - }); - </file> - </example> - * - * @param {string=} name Name of the form. If specified, the form controller will be published into - * related scope, under this name. - */ - var formDirectiveFactory = function(isNgForm) { - return ['$timeout', '$parse', function($timeout, $parse) { - var formDirective = { - name: 'form', - restrict: isNgForm ? 'EAC' : 'E', - require: ['form', '^^?form'], //first is the form's own ctrl, second is an optional parent form - controller: FormController, - compile: function ngFormCompile(formElement, attr) { - // Setup initial state of the control - formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS); - - var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false); - - return { - pre: function ngFormPreLink(scope, formElement, attr, ctrls) { - var controller = ctrls[0]; - - // if `action` attr is not present on the form, prevent the default action (submission) - if (!('action' in attr)) { - // we can't use jq events because if a form is destroyed during submission the default - // action is not prevented. see #1238 - // - // IE 9 is not affected because it doesn't fire a submit event and try to do a full - // page reload if the form was destroyed by submission of the form via a click handler - // on a button in the form. Looks like an IE9 specific bug. - var handleFormSubmission = function(event) { - scope.$apply(function() { - controller.$commitViewValue(); - controller.$setSubmitted(); - }); - - event.preventDefault(); - }; - - formElement[0].addEventListener('submit', handleFormSubmission); - - // unregister the preventDefault listener so that we don't not leak memory but in a - // way that will achieve the prevention of the default action. - formElement.on('$destroy', function() { - $timeout(function() { - formElement[0].removeEventListener('submit', handleFormSubmission); - }, 0, false); - }); - } - - var parentFormCtrl = ctrls[1] || controller.$$parentForm; - parentFormCtrl.$addControl(controller); - - var setter = nameAttr ? getSetter(controller.$name) : noop; - - if (nameAttr) { - setter(scope, controller); - attr.$observe(nameAttr, function(newValue) { - if (controller.$name === newValue) return; - setter(scope, undefined); - controller.$$parentForm.$$renameControl(controller, newValue); - setter = getSetter(controller.$name); - setter(scope, controller); - }); - } - formElement.on('$destroy', function() { - controller.$$parentForm.$removeControl(controller); - setter(scope, undefined); - extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards - }); - } - }; - } - }; - - return formDirective; - - function getSetter(expression) { - if (expression === '') { - //create an assignable expression, so forms with an empty name can be renamed later - return $parse('this[""]').assign; - } - return $parse(expression).assign || noop; - } - }]; - }; - - var formDirective = formDirectiveFactory(); - var ngFormDirective = formDirectiveFactory(true); - - - -// helper methods - function setupValidity(instance) { - instance.$$classCache = {}; - instance.$$classCache[INVALID_CLASS] = !(instance.$$classCache[VALID_CLASS] = instance.$$element.hasClass(VALID_CLASS)); - } - function addSetValidityMethod(context) { - var clazz = context.clazz, - set = context.set, - unset = context.unset; - - clazz.prototype.$setValidity = function(validationErrorKey, state, controller) { - if (isUndefined(state)) { - createAndSet(this, '$pending', validationErrorKey, controller); - } else { - unsetAndCleanup(this, '$pending', validationErrorKey, controller); - } - if (!isBoolean(state)) { - unset(this.$error, validationErrorKey, controller); - unset(this.$$success, validationErrorKey, controller); - } else { - if (state) { - unset(this.$error, validationErrorKey, controller); - set(this.$$success, validationErrorKey, controller); - } else { - set(this.$error, validationErrorKey, controller); - unset(this.$$success, validationErrorKey, controller); - } - } - if (this.$pending) { - cachedToggleClass(this, PENDING_CLASS, true); - this.$valid = this.$invalid = undefined; - toggleValidationCss(this, '', null); - } else { - cachedToggleClass(this, PENDING_CLASS, false); - this.$valid = isObjectEmpty(this.$error); - this.$invalid = !this.$valid; - toggleValidationCss(this, '', this.$valid); - } - - // re-read the state as the set/unset methods could have - // combined state in this.$error[validationError] (used for forms), - // where setting/unsetting only increments/decrements the value, - // and does not replace it. - var combinedState; - if (this.$pending && this.$pending[validationErrorKey]) { - combinedState = undefined; - } else if (this.$error[validationErrorKey]) { - combinedState = false; - } else if (this.$$success[validationErrorKey]) { - combinedState = true; - } else { - combinedState = null; - } - - toggleValidationCss(this, validationErrorKey, combinedState); - this.$$parentForm.$setValidity(validationErrorKey, combinedState, this); - }; - - function createAndSet(ctrl, name, value, controller) { - if (!ctrl[name]) { - ctrl[name] = {}; - } - set(ctrl[name], value, controller); - } - - function unsetAndCleanup(ctrl, name, value, controller) { - if (ctrl[name]) { - unset(ctrl[name], value, controller); - } - if (isObjectEmpty(ctrl[name])) { - ctrl[name] = undefined; - } - } - - function cachedToggleClass(ctrl, className, switchValue) { - if (switchValue && !ctrl.$$classCache[className]) { - ctrl.$$animate.addClass(ctrl.$$element, className); - ctrl.$$classCache[className] = true; - } else if (!switchValue && ctrl.$$classCache[className]) { - ctrl.$$animate.removeClass(ctrl.$$element, className); - ctrl.$$classCache[className] = false; - } - } - - function toggleValidationCss(ctrl, validationErrorKey, isValid) { - validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : ''; - - cachedToggleClass(ctrl, VALID_CLASS + validationErrorKey, isValid === true); - cachedToggleClass(ctrl, INVALID_CLASS + validationErrorKey, isValid === false); - } - } - - function isObjectEmpty(obj) { - if (obj) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - return false; - } - } - } - return true; - } - - /* global - VALID_CLASS: false, - INVALID_CLASS: false, - PRISTINE_CLASS: false, - DIRTY_CLASS: false, - ngModelMinErr: false -*/ - -// Regex code was initially obtained from SO prior to modification: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231 - var ISO_DATE_REGEXP = /^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/; -// See valid URLs in RFC3987 (http://tools.ietf.org/html/rfc3987) -// Note: We are being more lenient, because browsers are too. -// 1. Scheme -// 2. Slashes -// 3. Username -// 4. Password -// 5. Hostname -// 6. Port -// 7. Path -// 8. Query -// 9. Fragment -// 1111111111111111 222 333333 44444 55555555555555555555555 666 77777777 8888888 999 - var URL_REGEXP = /^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i; -// eslint-disable-next-line max-len - var EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/; - var NUMBER_REGEXP = /^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/; - var DATE_REGEXP = /^(\d{4,})-(\d{2})-(\d{2})$/; - var DATETIMELOCAL_REGEXP = /^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; - var WEEK_REGEXP = /^(\d{4,})-W(\d\d)$/; - var MONTH_REGEXP = /^(\d{4,})-(\d\d)$/; - var TIME_REGEXP = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; - - var PARTIAL_VALIDATION_EVENTS = 'keydown wheel mousedown'; - var PARTIAL_VALIDATION_TYPES = createMap(); - forEach('date,datetime-local,month,time,week'.split(','), function(type) { - PARTIAL_VALIDATION_TYPES[type] = true; - }); - - var inputType = { - - /** - * @ngdoc input - * @name input[text] - * - * @description - * Standard HTML text input with AngularJS data binding, inherited by most of the `input` elements. - * - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Adds `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue} - * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value. - * If the expression evaluates to a RegExp object, then this is used directly. - * If the expression evaluates to a string, then it will be converted to a RegExp - * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to - * `new RegExp('^abc$')`.<br /> - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input. - * This parameter is ignored for input[type=password] controls, which will never trim the - * input. - * - * @example - <example name="text-input-directive" module="textInputExample"> - <file name="index.html"> - <script> - angular.module('textInputExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.example = { - text: 'guest', - word: /^\s*\w*\s*$/ - }; - }]); - </script> - <form name="myForm" ng-controller="ExampleController"> - <label>Single word: - <input type="text" name="input" ng-model="example.text" - ng-pattern="example.word" required ng-trim="false"> - </label> - <div role="alert"> - <span class="error" ng-show="myForm.input.$error.required"> - Required!</span> - <span class="error" ng-show="myForm.input.$error.pattern"> - Single word only!</span> - </div> - <code>text = {{example.text}}</code><br/> - <code>myForm.input.$valid = {{myForm.input.$valid}}</code><br/> - <code>myForm.input.$error = {{myForm.input.$error}}</code><br/> - <code>myForm.$valid = {{myForm.$valid}}</code><br/> - <code>myForm.$error.required = {{!!myForm.$error.required}}</code><br/> - </form> - </file> - <file name="protractor.js" type="protractor"> - var text = element(by.binding('example.text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.text')); - - it('should initialize to model', function() { - expect(text.getText()).toContain('guest'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - - expect(text.getText()).toEqual('text ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if multi word', function() { - input.clear(); - input.sendKeys('hello world'); - - expect(valid.getText()).toContain('false'); - }); - </file> - </example> - */ - 'text': textInputType, - - /** - * @ngdoc input - * @name input[date] - * - * @description - * Input with date validation and transformation. In browsers that do not yet support - * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601 - * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many - * modern browsers do not yet support this input type, it is important to provide cues to users on the - * expected input format via a placeholder or label. - * - * The model must always be a Date object, otherwise AngularJS will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a - * valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute - * (e.g. `min="{{minDate | date:'yyyy-MM-dd'}}"`). Note that `min` will also add native HTML5 - * constraint validation. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be - * a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute - * (e.g. `max="{{maxDate | date:'yyyy-MM-dd'}}"`). Note that `max` will also add native HTML5 - * constraint validation. - * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO date string - * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. - * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO date string - * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - <example name="date-input-directive" module="dateInputExample"> - <file name="index.html"> - <script> - angular.module('dateInputExample', []) - .controller('DateController', ['$scope', function($scope) { - $scope.example = { - value: new Date(2013, 9, 22) - }; - }]); - </script> - <form name="myForm" ng-controller="DateController as dateCtrl"> - <label for="exampleInput">Pick a date in 2013:</label> - <input type="date" id="exampleInput" name="input" ng-model="example.value" - placeholder="yyyy-MM-dd" min="2013-01-01" max="2013-12-31" required /> - <div role="alert"> - <span class="error" ng-show="myForm.input.$error.required"> - Required!</span> - <span class="error" ng-show="myForm.input.$error.date"> - Not a valid date!</span> - </div> - <tt>value = {{example.value | date: "yyyy-MM-dd"}}</tt><br/> - <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> - <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> - <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> - <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/> - </form> - </file> - <file name="protractor.js" type="protractor"> - var value = element(by.binding('example.value | date: "yyyy-MM-dd"')); - var valid = element(by.binding('myForm.input.$valid')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (see https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-10-22'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01-01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - </file> - </example> - */ - 'date': createDateInputType('date', DATE_REGEXP, - createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']), - 'yyyy-MM-dd'), - - /** - * @ngdoc input - * @name input[datetime-local] - * - * @description - * Input with datetime validation and transformation. In browsers that do not yet support - * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`. - * - * The model must always be a Date object, otherwise AngularJS will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. - * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation - * inside this attribute (e.g. `min="{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`). - * Note that `min` will also add native HTML5 constraint validation. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. - * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation - * inside this attribute (e.g. `max="{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`). - * Note that `max` will also add native HTML5 constraint validation. - * @param {(date|string)=} ngMin Sets the `min` validation error key to the Date / ISO datetime string - * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. - * @param {(date|string)=} ngMax Sets the `max` validation error key to the Date / ISO datetime string - * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - <example name="datetimelocal-input-directive" module="dateExample"> - <file name="index.html"> - <script> - angular.module('dateExample', []) - .controller('DateController', ['$scope', function($scope) { - $scope.example = { - value: new Date(2010, 11, 28, 14, 57) - }; - }]); - </script> - <form name="myForm" ng-controller="DateController as dateCtrl"> - <label for="exampleInput">Pick a date between in 2013:</label> - <input type="datetime-local" id="exampleInput" name="input" ng-model="example.value" - placeholder="yyyy-MM-ddTHH:mm:ss" min="2001-01-01T00:00:00" max="2013-12-31T00:00:00" required /> - <div role="alert"> - <span class="error" ng-show="myForm.input.$error.required"> - Required!</span> - <span class="error" ng-show="myForm.input.$error.datetimelocal"> - Not a valid date!</span> - </div> - <tt>value = {{example.value | date: "yyyy-MM-ddTHH:mm:ss"}}</tt><br/> - <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> - <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> - <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> - <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/> - </form> - </file> - <file name="protractor.js" type="protractor"> - var value = element(by.binding('example.value | date: "yyyy-MM-ddTHH:mm:ss"')); - var valid = element(by.binding('myForm.input.$valid')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2010-12-28T14:57:00'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01-01T23:59:00'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - </file> - </example> - */ - 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP, - createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']), - 'yyyy-MM-ddTHH:mm:ss.sss'), - - /** - * @ngdoc input - * @name input[time] - * - * @description - * Input with time validation and transformation. In browsers that do not yet support - * the HTML5 time input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a - * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`. - * - * The model must always be a Date object, otherwise AngularJS will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. - * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this - * attribute (e.g. `min="{{minTime | date:'HH:mm:ss'}}"`). Note that `min` will also add - * native HTML5 constraint validation. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. - * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this - * attribute (e.g. `max="{{maxTime | date:'HH:mm:ss'}}"`). Note that `max` will also add - * native HTML5 constraint validation. - * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO time string the - * `ngMin` expression evaluates to. Note that it does not set the `min` attribute. - * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO time string the - * `ngMax` expression evaluates to. Note that it does not set the `max` attribute. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - <example name="time-input-directive" module="timeExample"> - <file name="index.html"> - <script> - angular.module('timeExample', []) - .controller('DateController', ['$scope', function($scope) { - $scope.example = { - value: new Date(1970, 0, 1, 14, 57, 0) - }; - }]); - </script> - <form name="myForm" ng-controller="DateController as dateCtrl"> - <label for="exampleInput">Pick a time between 8am and 5pm:</label> - <input type="time" id="exampleInput" name="input" ng-model="example.value" - placeholder="HH:mm:ss" min="08:00:00" max="17:00:00" required /> - <div role="alert"> - <span class="error" ng-show="myForm.input.$error.required"> - Required!</span> - <span class="error" ng-show="myForm.input.$error.time"> - Not a valid date!</span> - </div> - <tt>value = {{example.value | date: "HH:mm:ss"}}</tt><br/> - <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> - <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> - <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> - <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/> - </form> - </file> - <file name="protractor.js" type="protractor"> - var value = element(by.binding('example.value | date: "HH:mm:ss"')); - var valid = element(by.binding('myForm.input.$valid')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('14:57:00'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('23:59:00'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - </file> - </example> - */ - 'time': createDateInputType('time', TIME_REGEXP, - createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']), - 'HH:mm:ss.sss'), - - /** - * @ngdoc input - * @name input[week] - * - * @description - * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support - * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * week format (yyyy-W##), for example: `2013-W02`. - * - * The model must always be a Date object, otherwise AngularJS will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. - * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this - * attribute (e.g. `min="{{minWeek | date:'yyyy-Www'}}"`). Note that `min` will also add - * native HTML5 constraint validation. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. - * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this - * attribute (e.g. `max="{{maxWeek | date:'yyyy-Www'}}"`). Note that `max` will also add - * native HTML5 constraint validation. - * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string - * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. - * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string - * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - <example name="week-input-directive" module="weekExample"> - <file name="index.html"> - <script> - angular.module('weekExample', []) - .controller('DateController', ['$scope', function($scope) { - $scope.example = { - value: new Date(2013, 0, 3) - }; - }]); - </script> - <form name="myForm" ng-controller="DateController as dateCtrl"> - <label>Pick a date between in 2013: - <input id="exampleInput" type="week" name="input" ng-model="example.value" - placeholder="YYYY-W##" min="2012-W32" - max="2013-W52" required /> - </label> - <div role="alert"> - <span class="error" ng-show="myForm.input.$error.required"> - Required!</span> - <span class="error" ng-show="myForm.input.$error.week"> - Not a valid date!</span> - </div> - <tt>value = {{example.value | date: "yyyy-Www"}}</tt><br/> - <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> - <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> - <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> - <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/> - </form> - </file> - <file name="protractor.js" type="protractor"> - var value = element(by.binding('example.value | date: "yyyy-Www"')); - var valid = element(by.binding('myForm.input.$valid')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-W01'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-W01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - </file> - </example> - */ - 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'), - - /** - * @ngdoc input - * @name input[month] - * - * @description - * Input with month validation and transformation. In browsers that do not yet support - * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * month format (yyyy-MM), for example: `2009-01`. - * - * The model must always be a Date object, otherwise AngularJS will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * If the model is not set to the first of the month, the next view to model update will set it - * to the first of the month. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. - * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this - * attribute (e.g. `min="{{minMonth | date:'yyyy-MM'}}"`). Note that `min` will also add - * native HTML5 constraint validation. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. - * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this - * attribute (e.g. `max="{{maxMonth | date:'yyyy-MM'}}"`). Note that `max` will also add - * native HTML5 constraint validation. - * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string - * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute. - * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string - * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute. - - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - <example name="month-input-directive" module="monthExample"> - <file name="index.html"> - <script> - angular.module('monthExample', []) - .controller('DateController', ['$scope', function($scope) { - $scope.example = { - value: new Date(2013, 9, 1) - }; - }]); - </script> - <form name="myForm" ng-controller="DateController as dateCtrl"> - <label for="exampleInput">Pick a month in 2013:</label> - <input id="exampleInput" type="month" name="input" ng-model="example.value" - placeholder="yyyy-MM" min="2013-01" max="2013-12" required /> - <div role="alert"> - <span class="error" ng-show="myForm.input.$error.required"> - Required!</span> - <span class="error" ng-show="myForm.input.$error.month"> - Not a valid month!</span> - </div> - <tt>value = {{example.value | date: "yyyy-MM"}}</tt><br/> - <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> - <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> - <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> - <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/> - </form> - </file> - <file name="protractor.js" type="protractor"> - var value = element(by.binding('example.value | date: "yyyy-MM"')); - var valid = element(by.binding('myForm.input.$valid')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-10'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - </file> - </example> - */ - 'month': createDateInputType('month', MONTH_REGEXP, - createDateParser(MONTH_REGEXP, ['yyyy', 'MM']), - 'yyyy-MM'), - - /** - * @ngdoc input - * @name input[number] - * - * @description - * Text input with number validation and transformation. Sets the `number` validation - * error if not a valid number. - * - * <div class="alert alert-warning"> - * The model must always be of type `number` otherwise AngularJS will throw an error. - * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt} - * error docs for more information and an example of how to convert your model if necessary. - * </div> - * - * ## Issues with HTML5 constraint validation - * - * In browsers that follow the - * [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29), - * `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}. - * If a non-number is entered in the input, the browser will report the value as an empty string, - * which means the view / model values in `ngModel` and subsequently the scope value - * will also be an empty string. - * - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. - * Can be interpolated. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. - * Can be interpolated. - * @param {string=} ngMin Like `min`, sets the `min` validation error key if the value entered is less than `ngMin`, - * but does not trigger HTML5 native validation. Takes an expression. - * @param {string=} ngMax Like `max`, sets the `max` validation error key if the value entered is greater than `ngMax`, - * but does not trigger HTML5 native validation. Takes an expression. - * @param {string=} step Sets the `step` validation error key if the value entered does not fit the `step` constraint. - * Can be interpolated. - * @param {string=} ngStep Like `step`, sets the `step` validation error key if the value entered does not fit the `ngStep` constraint, - * but does not trigger HTML5 native validation. Takes an expression. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue} - * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value. - * If the expression evaluates to a RegExp object, then this is used directly. - * If the expression evaluates to a string, then it will be converted to a RegExp - * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to - * `new RegExp('^abc$')`.<br /> - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - <example name="number-input-directive" module="numberExample"> - <file name="index.html"> - <script> - angular.module('numberExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.example = { - value: 12 - }; - }]); - </script> - <form name="myForm" ng-controller="ExampleController"> - <label>Number: - <input type="number" name="input" ng-model="example.value" - min="0" max="99" required> - </label> - <div role="alert"> - <span class="error" ng-show="myForm.input.$error.required"> - Required!</span> - <span class="error" ng-show="myForm.input.$error.number"> - Not valid number!</span> - </div> - <tt>value = {{example.value}}</tt><br/> - <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> - <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> - <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> - <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/> - </form> - </file> - <file name="protractor.js" type="protractor"> - var value = element(by.binding('example.value')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); - - it('should initialize to model', function() { - expect(value.getText()).toContain('12'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if over max', function() { - input.clear(); - input.sendKeys('123'); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('false'); - }); - </file> - </example> - */ - 'number': numberInputType, - - - /** - * @ngdoc input - * @name input[url] - * - * @description - * Text input with URL validation. Sets the `url` validation error key if the content is not a - * valid URL. - * - * <div class="alert alert-warning"> - * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex - * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify - * the built-in validators (see the {@link guide/forms Forms guide}) - * </div> - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue} - * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value. - * If the expression evaluates to a RegExp object, then this is used directly. - * If the expression evaluates to a string, then it will be converted to a RegExp - * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to - * `new RegExp('^abc$')`.<br /> - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - <example name="url-input-directive" module="urlExample"> - <file name="index.html"> - <script> - angular.module('urlExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.url = { - text: 'http://google.com' - }; - }]); - </script> - <form name="myForm" ng-controller="ExampleController"> - <label>URL: - <input type="url" name="input" ng-model="url.text" required> - <label> - <div role="alert"> - <span class="error" ng-show="myForm.input.$error.required"> - Required!</span> - <span class="error" ng-show="myForm.input.$error.url"> - Not valid url!</span> - </div> - <tt>text = {{url.text}}</tt><br/> - <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> - <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> - <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> - <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/> - <tt>myForm.$error.url = {{!!myForm.$error.url}}</tt><br/> - </form> - </file> - <file name="protractor.js" type="protractor"> - var text = element(by.binding('url.text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('url.text')); - - it('should initialize to model', function() { - expect(text.getText()).toContain('http://google.com'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - - expect(text.getText()).toEqual('text ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if not url', function() { - input.clear(); - input.sendKeys('box'); - - expect(valid.getText()).toContain('false'); - }); - </file> - </example> - */ - 'url': urlInputType, - - - /** - * @ngdoc input - * @name input[email] - * - * @description - * Text input with email validation. Sets the `email` validation error key if not a valid email - * address. - * - * <div class="alert alert-warning"> - * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex - * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can - * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide}) - * </div> - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of - * any length. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue} - * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value. - * If the expression evaluates to a RegExp object, then this is used directly. - * If the expression evaluates to a string, then it will be converted to a RegExp - * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to - * `new RegExp('^abc$')`.<br /> - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - <example name="email-input-directive" module="emailExample"> - <file name="index.html"> - <script> - angular.module('emailExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.email = { - text: 'me@example.com' - }; - }]); - </script> - <form name="myForm" ng-controller="ExampleController"> - <label>Email: - <input type="email" name="input" ng-model="email.text" required> - </label> - <div role="alert"> - <span class="error" ng-show="myForm.input.$error.required"> - Required!</span> - <span class="error" ng-show="myForm.input.$error.email"> - Not valid email!</span> - </div> - <tt>text = {{email.text}}</tt><br/> - <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> - <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> - <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> - <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/> - <tt>myForm.$error.email = {{!!myForm.$error.email}}</tt><br/> - </form> - </file> - <file name="protractor.js" type="protractor"> - var text = element(by.binding('email.text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('email.text')); - - it('should initialize to model', function() { - expect(text.getText()).toContain('me@example.com'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - expect(text.getText()).toEqual('text ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if not email', function() { - input.clear(); - input.sendKeys('xxx'); - - expect(valid.getText()).toContain('false'); - }); - </file> - </example> - */ - 'email': emailInputType, - - - /** - * @ngdoc input - * @name input[radio] - * - * @description - * HTML radio button. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string} value The value to which the `ngModel` expression should be set when selected. - * Note that `value` only supports `string` values, i.e. the scope model needs to be a string, - * too. Use `ngValue` if you need complex models (`number`, `object`, ...). - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * @param {string} ngValue AngularJS expression to which `ngModel` will be be set when the radio - * is selected. Should be used instead of the `value` attribute if you need - * a non-string `ngModel` (`boolean`, `array`, ...). - * - * @example - <example name="radio-input-directive" module="radioExample"> - <file name="index.html"> - <script> - angular.module('radioExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.color = { - name: 'blue' - }; - $scope.specialValue = { - "id": "12345", - "value": "green" - }; - }]); - </script> - <form name="myForm" ng-controller="ExampleController"> - <label> - <input type="radio" ng-model="color.name" value="red"> - Red - </label><br/> - <label> - <input type="radio" ng-model="color.name" ng-value="specialValue"> - Green - </label><br/> - <label> - <input type="radio" ng-model="color.name" value="blue"> - Blue - </label><br/> - <tt>color = {{color.name | json}}</tt><br/> - </form> - Note that `ng-value="specialValue"` sets radio item's value to be the value of `$scope.specialValue`. - </file> - <file name="protractor.js" type="protractor"> - it('should change state', function() { - var inputs = element.all(by.model('color.name')); - var color = element(by.binding('color.name')); - - expect(color.getText()).toContain('blue'); - - inputs.get(0).click(); - expect(color.getText()).toContain('red'); - - inputs.get(1).click(); - expect(color.getText()).toContain('green'); - }); - </file> - </example> - */ - 'radio': radioInputType, - - /** - * @ngdoc input - * @name input[range] - * - * @description - * Native range input with validation and transformation. - * - * The model for the range input must always be a `Number`. - * - * IE9 and other browsers that do not support the `range` type fall back - * to a text input without any default values for `min`, `max` and `step`. Model binding, - * validation and number parsing are nevertheless supported. - * - * Browsers that support range (latest Chrome, Safari, Firefox, Edge) treat `input[range]` - * in a way that never allows the input to hold an invalid value. That means: - * - any non-numerical value is set to `(max + min) / 2`. - * - any numerical value that is less than the current min val, or greater than the current max val - * is set to the min / max val respectively. - * - additionally, the current `step` is respected, so the nearest value that satisfies a step - * is used. - * - * See the [HTML Spec on input[type=range]](https://www.w3.org/TR/html5/forms.html#range-state-(type=range)) - * for more info. - * - * This has the following consequences for AngularJS: - * - * Since the element value should always reflect the current model value, a range input - * will set the bound ngModel expression to the value that the browser has set for the - * input element. For example, in the following input `<input type="range" ng-model="model.value">`, - * if the application sets `model.value = null`, the browser will set the input to `'50'`. - * AngularJS will then set the model to `50`, to prevent input and model value being out of sync. - * - * That means the model for range will immediately be set to `50` after `ngModel` has been - * initialized. It also means a range input can never have the required error. - * - * This does not only affect changes to the model value, but also to the values of the `min`, - * `max`, and `step` attributes. When these change in a way that will cause the browser to modify - * the input value, AngularJS will also update the model value. - * - * Automatic value adjustment also means that a range input element can never have the `required`, - * `min`, or `max` errors. - * - * However, `step` is currently only fully implemented by Firefox. Other browsers have problems - * when the step value changes dynamically - they do not adjust the element value correctly, but - * instead may set the `stepMismatch` error. If that's the case, the AngularJS will set the `step` - * error on the input, and set the model to `undefined`. - * - * Note that `input[range]` is not compatible with`ngMax`, `ngMin`, and `ngStep`, because they do - * not set the `min` and `max` attributes, which means that the browser won't automatically adjust - * the input value based on their values, and will always assume min = 0, max = 100, and step = 1. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation to ensure that the value entered is greater - * than `min`. Can be interpolated. - * @param {string=} max Sets the `max` validation to ensure that the value entered is less than `max`. - * Can be interpolated. - * @param {string=} step Sets the `step` validation to ensure that the value entered matches the `step` - * Can be interpolated. - * @param {string=} ngChange AngularJS expression to be executed when the ngModel value changes due - * to user interaction with the input element. - * @param {expression=} ngChecked If the expression is truthy, then the `checked` attribute will be set on the - * element. **Note** : `ngChecked` should not be used alongside `ngModel`. - * Checkout {@link ng.directive:ngChecked ngChecked} for usage. - * - * @example - <example name="range-input-directive" module="rangeExample"> - <file name="index.html"> - <script> - angular.module('rangeExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.value = 75; - $scope.min = 10; - $scope.max = 90; - }]); - </script> - <form name="myForm" ng-controller="ExampleController"> - - Model as range: <input type="range" name="range" ng-model="value" min="{{min}}" max="{{max}}"> - <hr> - Model as number: <input type="number" ng-model="value"><br> - Min: <input type="number" ng-model="min"><br> - Max: <input type="number" ng-model="max"><br> - value = <code>{{value}}</code><br/> - myForm.range.$valid = <code>{{myForm.range.$valid}}</code><br/> - myForm.range.$error = <code>{{myForm.range.$error}}</code> - </form> - </file> - </example> - - * ## Range Input with ngMin & ngMax attributes - - * @example - <example name="range-input-directive-ng" module="rangeExample"> - <file name="index.html"> - <script> - angular.module('rangeExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.value = 75; - $scope.min = 10; - $scope.max = 90; - }]); - </script> - <form name="myForm" ng-controller="ExampleController"> - Model as range: <input type="range" name="range" ng-model="value" ng-min="min" ng-max="max"> - <hr> - Model as number: <input type="number" ng-model="value"><br> - Min: <input type="number" ng-model="min"><br> - Max: <input type="number" ng-model="max"><br> - value = <code>{{value}}</code><br/> - myForm.range.$valid = <code>{{myForm.range.$valid}}</code><br/> - myForm.range.$error = <code>{{myForm.range.$error}}</code> - </form> - </file> - </example> - - */ - 'range': rangeInputType, - - /** - * @ngdoc input - * @name input[checkbox] - * - * @description - * HTML checkbox. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {expression=} ngTrueValue The value to which the expression should be set when selected. - * @param {expression=} ngFalseValue The value to which the expression should be set when not selected. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - <example name="checkbox-input-directive" module="checkboxExample"> - <file name="index.html"> - <script> - angular.module('checkboxExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.checkboxModel = { - value1 : true, - value2 : 'YES' - }; - }]); - </script> - <form name="myForm" ng-controller="ExampleController"> - <label>Value1: - <input type="checkbox" ng-model="checkboxModel.value1"> - </label><br/> - <label>Value2: - <input type="checkbox" ng-model="checkboxModel.value2" - ng-true-value="'YES'" ng-false-value="'NO'"> - </label><br/> - <tt>value1 = {{checkboxModel.value1}}</tt><br/> - <tt>value2 = {{checkboxModel.value2}}</tt><br/> - </form> - </file> - <file name="protractor.js" type="protractor"> - it('should change state', function() { - var value1 = element(by.binding('checkboxModel.value1')); - var value2 = element(by.binding('checkboxModel.value2')); - - expect(value1.getText()).toContain('true'); - expect(value2.getText()).toContain('YES'); - - element(by.model('checkboxModel.value1')).click(); - element(by.model('checkboxModel.value2')).click(); - - expect(value1.getText()).toContain('false'); - expect(value2.getText()).toContain('NO'); - }); - </file> - </example> - */ - 'checkbox': checkboxInputType, - - 'hidden': noop, - 'button': noop, - 'submit': noop, - 'reset': noop, - 'file': noop - }; - - function stringBasedInputType(ctrl) { - ctrl.$formatters.push(function(value) { - return ctrl.$isEmpty(value) ? value : value.toString(); - }); - } - - function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); - } - - function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) { - var type = lowercase(element[0].type); - - // In composition mode, users are still inputting intermediate text buffer, - // hold the listener until composition is done. - // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent - if (!$sniffer.android) { - var composing = false; - - element.on('compositionstart', function() { - composing = true; - }); - - element.on('compositionend', function() { - composing = false; - listener(); - }); - } - - var timeout; - - var listener = function(ev) { - if (timeout) { - $browser.defer.cancel(timeout); - timeout = null; - } - if (composing) return; - var value = element.val(), - event = ev && ev.type; - - // By default we will trim the value - // If the attribute ng-trim exists we will avoid trimming - // If input type is 'password', the value is never trimmed - if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) { - value = trim(value); - } - - // If a control is suffering from bad input (due to native validators), browsers discard its - // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the - // control's value is the same empty value twice in a row. - if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) { - ctrl.$setViewValue(value, event); - } - }; - - // if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the - // input event on backspace, delete or cut - if ($sniffer.hasEvent('input')) { - element.on('input', listener); - } else { - var deferListener = function(ev, input, origValue) { - if (!timeout) { - timeout = $browser.defer(function() { - timeout = null; - if (!input || input.value !== origValue) { - listener(ev); - } - }); - } - }; - - element.on('keydown', /** @this */ function(event) { - var key = event.keyCode; - - // ignore - // command modifiers arrows - if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return; - - deferListener(event, this, this.value); - }); - - // if user modifies input value using context menu in IE, we need "paste", "cut" and "drop" events to catch it - if ($sniffer.hasEvent('paste')) { - element.on('paste cut drop', deferListener); - } - } - - // if user paste into input using mouse on older browser - // or form autocomplete on newer browser, we need "change" event to catch it - element.on('change', listener); - - // Some native input types (date-family) have the ability to change validity without - // firing any input/change events. - // For these event types, when native validators are present and the browser supports the type, - // check for validity changes on various DOM events. - if (PARTIAL_VALIDATION_TYPES[type] && ctrl.$$hasNativeValidators && type === attr.type) { - element.on(PARTIAL_VALIDATION_EVENTS, /** @this */ function(ev) { - if (!timeout) { - var validity = this[VALIDITY_STATE_PROPERTY]; - var origBadInput = validity.badInput; - var origTypeMismatch = validity.typeMismatch; - timeout = $browser.defer(function() { - timeout = null; - if (validity.badInput !== origBadInput || validity.typeMismatch !== origTypeMismatch) { - listener(ev); - } - }); - } - }); - } - - ctrl.$render = function() { - // Workaround for Firefox validation #12102. - var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue; - if (element.val() !== value) { - element.val(value); - } - }; - } - - function weekParser(isoWeek, existingDate) { - if (isDate(isoWeek)) { - return isoWeek; - } - - if (isString(isoWeek)) { - WEEK_REGEXP.lastIndex = 0; - var parts = WEEK_REGEXP.exec(isoWeek); - if (parts) { - var year = +parts[1], - week = +parts[2], - hours = 0, - minutes = 0, - seconds = 0, - milliseconds = 0, - firstThurs = getFirstThursdayOfYear(year), - addDays = (week - 1) * 7; - - if (existingDate) { - hours = existingDate.getHours(); - minutes = existingDate.getMinutes(); - seconds = existingDate.getSeconds(); - milliseconds = existingDate.getMilliseconds(); - } - - return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); - } - } - - return NaN; - } - - function createDateParser(regexp, mapping) { - return function(iso, date) { - var parts, map; - - if (isDate(iso)) { - return iso; - } - - if (isString(iso)) { - // When a date is JSON'ified to wraps itself inside of an extra - // set of double quotes. This makes the date parsing code unable - // to match the date string and parse it as a date. - if (iso.charAt(0) === '"' && iso.charAt(iso.length - 1) === '"') { - iso = iso.substring(1, iso.length - 1); - } - if (ISO_DATE_REGEXP.test(iso)) { - return new Date(iso); - } - regexp.lastIndex = 0; - parts = regexp.exec(iso); - - if (parts) { - parts.shift(); - if (date) { - map = { - yyyy: date.getFullYear(), - MM: date.getMonth() + 1, - dd: date.getDate(), - HH: date.getHours(), - mm: date.getMinutes(), - ss: date.getSeconds(), - sss: date.getMilliseconds() / 1000 - }; - } else { - map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 }; - } - - forEach(parts, function(part, index) { - if (index < mapping.length) { - map[mapping[index]] = +part; - } - }); - return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0); - } - } - - return NaN; - }; - } - - function createDateInputType(type, regexp, parseDate, format) { - return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) { - badInputChecker(scope, element, attr, ctrl); - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - var timezone = ctrl && ctrl.$options.getOption('timezone'); - var previousDate; - - ctrl.$$parserName = type; - ctrl.$parsers.push(function(value) { - if (ctrl.$isEmpty(value)) return null; - if (regexp.test(value)) { - // Note: We cannot read ctrl.$modelValue, as there might be a different - // parser/formatter in the processing chain so that the model - // contains some different data format! - var parsedDate = parseDate(value, previousDate); - if (timezone) { - parsedDate = convertTimezoneToLocal(parsedDate, timezone); - } - return parsedDate; - } - return undefined; - }); - - ctrl.$formatters.push(function(value) { - if (value && !isDate(value)) { - throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value); - } - if (isValidDate(value)) { - previousDate = value; - if (previousDate && timezone) { - previousDate = convertTimezoneToLocal(previousDate, timezone, true); - } - return $filter('date')(value, format, timezone); - } else { - previousDate = null; - return ''; - } - }); - - if (isDefined(attr.min) || attr.ngMin) { - var minVal; - ctrl.$validators.min = function(value) { - return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal; - }; - attr.$observe('min', function(val) { - minVal = parseObservedDateValue(val); - ctrl.$validate(); - }); - } - - if (isDefined(attr.max) || attr.ngMax) { - var maxVal; - ctrl.$validators.max = function(value) { - return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal; - }; - attr.$observe('max', function(val) { - maxVal = parseObservedDateValue(val); - ctrl.$validate(); - }); - } - - function isValidDate(value) { - // Invalid Date: getTime() returns NaN - return value && !(value.getTime && value.getTime() !== value.getTime()); - } - - function parseObservedDateValue(val) { - return isDefined(val) && !isDate(val) ? parseDate(val) || undefined : val; - } - }; - } - - function badInputChecker(scope, element, attr, ctrl) { - var node = element[0]; - var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity); - if (nativeValidation) { - ctrl.$parsers.push(function(value) { - var validity = element.prop(VALIDITY_STATE_PROPERTY) || {}; - return validity.badInput || validity.typeMismatch ? undefined : value; - }); - } - } - - function numberFormatterParser(ctrl) { - ctrl.$$parserName = 'number'; - ctrl.$parsers.push(function(value) { - if (ctrl.$isEmpty(value)) return null; - if (NUMBER_REGEXP.test(value)) return parseFloat(value); - return undefined; - }); - - ctrl.$formatters.push(function(value) { - if (!ctrl.$isEmpty(value)) { - if (!isNumber(value)) { - throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); - } - value = value.toString(); - } - return value; - }); - } - - function parseNumberAttrVal(val) { - if (isDefined(val) && !isNumber(val)) { - val = parseFloat(val); - } - return !isNumberNaN(val) ? val : undefined; - } - - function isNumberInteger(num) { - // See http://stackoverflow.com/questions/14636536/how-to-check-if-a-variable-is-an-integer-in-javascript#14794066 - // (minus the assumption that `num` is a number) - - // eslint-disable-next-line no-bitwise - return (num | 0) === num; - } - - function countDecimals(num) { - var numString = num.toString(); - var decimalSymbolIndex = numString.indexOf('.'); - - if (decimalSymbolIndex === -1) { - if (-1 < num && num < 1) { - // It may be in the exponential notation format (`1e-X`) - var match = /e-(\d+)$/.exec(numString); - - if (match) { - return Number(match[1]); - } - } - - return 0; - } - - return numString.length - decimalSymbolIndex - 1; - } - - function isValidForStep(viewValue, stepBase, step) { - // At this point `stepBase` and `step` are expected to be non-NaN values - // and `viewValue` is expected to be a valid stringified number. - var value = Number(viewValue); - - var isNonIntegerValue = !isNumberInteger(value); - var isNonIntegerStepBase = !isNumberInteger(stepBase); - var isNonIntegerStep = !isNumberInteger(step); - - // Due to limitations in Floating Point Arithmetic (e.g. `0.3 - 0.2 !== 0.1` or - // `0.5 % 0.1 !== 0`), we need to convert all numbers to integers. - if (isNonIntegerValue || isNonIntegerStepBase || isNonIntegerStep) { - var valueDecimals = isNonIntegerValue ? countDecimals(value) : 0; - var stepBaseDecimals = isNonIntegerStepBase ? countDecimals(stepBase) : 0; - var stepDecimals = isNonIntegerStep ? countDecimals(step) : 0; - - var decimalCount = Math.max(valueDecimals, stepBaseDecimals, stepDecimals); - var multiplier = Math.pow(10, decimalCount); - - value = value * multiplier; - stepBase = stepBase * multiplier; - step = step * multiplier; - - if (isNonIntegerValue) value = Math.round(value); - if (isNonIntegerStepBase) stepBase = Math.round(stepBase); - if (isNonIntegerStep) step = Math.round(step); - } - - return (value - stepBase) % step === 0; - } - - function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { - badInputChecker(scope, element, attr, ctrl); - numberFormatterParser(ctrl); - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - - var minVal; - var maxVal; - - if (isDefined(attr.min) || attr.ngMin) { - ctrl.$validators.min = function(value) { - return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal; - }; - - attr.$observe('min', function(val) { - minVal = parseNumberAttrVal(val); - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - }); - } - - if (isDefined(attr.max) || attr.ngMax) { - ctrl.$validators.max = function(value) { - return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal; - }; - - attr.$observe('max', function(val) { - maxVal = parseNumberAttrVal(val); - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - }); - } - - if (isDefined(attr.step) || attr.ngStep) { - var stepVal; - ctrl.$validators.step = function(modelValue, viewValue) { - return ctrl.$isEmpty(viewValue) || isUndefined(stepVal) || - isValidForStep(viewValue, minVal || 0, stepVal); - }; - - attr.$observe('step', function(val) { - stepVal = parseNumberAttrVal(val); - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - }); - } - } - - function rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) { - badInputChecker(scope, element, attr, ctrl); - numberFormatterParser(ctrl); - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - - var supportsRange = ctrl.$$hasNativeValidators && element[0].type === 'range', - minVal = supportsRange ? 0 : undefined, - maxVal = supportsRange ? 100 : undefined, - stepVal = supportsRange ? 1 : undefined, - validity = element[0].validity, - hasMinAttr = isDefined(attr.min), - hasMaxAttr = isDefined(attr.max), - hasStepAttr = isDefined(attr.step); - - var originalRender = ctrl.$render; - - ctrl.$render = supportsRange && isDefined(validity.rangeUnderflow) && isDefined(validity.rangeOverflow) ? - //Browsers that implement range will set these values automatically, but reading the adjusted values after - //$render would cause the min / max validators to be applied with the wrong value - function rangeRender() { - originalRender(); - ctrl.$setViewValue(element.val()); - } : - originalRender; - - if (hasMinAttr) { - ctrl.$validators.min = supportsRange ? - // Since all browsers set the input to a valid value, we don't need to check validity - function noopMinValidator() { return true; } : - // non-support browsers validate the min val - function minValidator(modelValue, viewValue) { - return ctrl.$isEmpty(viewValue) || isUndefined(minVal) || viewValue >= minVal; - }; - - setInitialValueAndObserver('min', minChange); - } - - if (hasMaxAttr) { - ctrl.$validators.max = supportsRange ? - // Since all browsers set the input to a valid value, we don't need to check validity - function noopMaxValidator() { return true; } : - // non-support browsers validate the max val - function maxValidator(modelValue, viewValue) { - return ctrl.$isEmpty(viewValue) || isUndefined(maxVal) || viewValue <= maxVal; - }; - - setInitialValueAndObserver('max', maxChange); - } - - if (hasStepAttr) { - ctrl.$validators.step = supportsRange ? - function nativeStepValidator() { - // Currently, only FF implements the spec on step change correctly (i.e. adjusting the - // input element value to a valid value). It's possible that other browsers set the stepMismatch - // validity error instead, so we can at least report an error in that case. - return !validity.stepMismatch; - } : - // ngStep doesn't set the setp attr, so the browser doesn't adjust the input value as setting step would - function stepValidator(modelValue, viewValue) { - return ctrl.$isEmpty(viewValue) || isUndefined(stepVal) || - isValidForStep(viewValue, minVal || 0, stepVal); - }; - - setInitialValueAndObserver('step', stepChange); - } - - function setInitialValueAndObserver(htmlAttrName, changeFn) { - // interpolated attributes set the attribute value only after a digest, but we need the - // attribute value when the input is first rendered, so that the browser can adjust the - // input value based on the min/max value - element.attr(htmlAttrName, attr[htmlAttrName]); - attr.$observe(htmlAttrName, changeFn); - } - - function minChange(val) { - minVal = parseNumberAttrVal(val); - // ignore changes before model is initialized - if (isNumberNaN(ctrl.$modelValue)) { - return; - } - - if (supportsRange) { - var elVal = element.val(); - // IE11 doesn't set the el val correctly if the minVal is greater than the element value - if (minVal > elVal) { - elVal = minVal; - element.val(elVal); - } - ctrl.$setViewValue(elVal); - } else { - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - } - } - - function maxChange(val) { - maxVal = parseNumberAttrVal(val); - // ignore changes before model is initialized - if (isNumberNaN(ctrl.$modelValue)) { - return; - } - - if (supportsRange) { - var elVal = element.val(); - // IE11 doesn't set the el val correctly if the maxVal is less than the element value - if (maxVal < elVal) { - element.val(maxVal); - // IE11 and Chrome don't set the value to the minVal when max < min - elVal = maxVal < minVal ? minVal : maxVal; - } - ctrl.$setViewValue(elVal); - } else { - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - } - } - - function stepChange(val) { - stepVal = parseNumberAttrVal(val); - // ignore changes before model is initialized - if (isNumberNaN(ctrl.$modelValue)) { - return; - } - - // Some browsers don't adjust the input value correctly, but set the stepMismatch error - if (supportsRange && ctrl.$viewValue !== element.val()) { - ctrl.$setViewValue(element.val()); - } else { - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - } - } - } - - function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) { - // Note: no badInputChecker here by purpose as `url` is only a validation - // in browsers, i.e. we can always read out input.value even if it is not valid! - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); - - ctrl.$$parserName = 'url'; - ctrl.$validators.url = function(modelValue, viewValue) { - var value = modelValue || viewValue; - return ctrl.$isEmpty(value) || URL_REGEXP.test(value); - }; - } - - function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) { - // Note: no badInputChecker here by purpose as `url` is only a validation - // in browsers, i.e. we can always read out input.value even if it is not valid! - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); - - ctrl.$$parserName = 'email'; - ctrl.$validators.email = function(modelValue, viewValue) { - var value = modelValue || viewValue; - return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value); - }; - } - - function radioInputType(scope, element, attr, ctrl) { - var doTrim = !attr.ngTrim || trim(attr.ngTrim) !== 'false'; - // make the name unique, if not defined - if (isUndefined(attr.name)) { - element.attr('name', nextUid()); - } - - var listener = function(ev) { - var value; - if (element[0].checked) { - value = attr.value; - if (doTrim) { - value = trim(value); - } - ctrl.$setViewValue(value, ev && ev.type); - } - }; - - element.on('click', listener); - - ctrl.$render = function() { - var value = attr.value; - if (doTrim) { - value = trim(value); - } - element[0].checked = (value === ctrl.$viewValue); - }; - - attr.$observe('value', ctrl.$render); - } - - function parseConstantExpr($parse, context, name, expression, fallback) { - var parseFn; - if (isDefined(expression)) { - parseFn = $parse(expression); - if (!parseFn.constant) { - throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' + - '`{1}`.', name, expression); - } - return parseFn(context); - } - return fallback; - } - - function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) { - var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true); - var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false); - - var listener = function(ev) { - ctrl.$setViewValue(element[0].checked, ev && ev.type); - }; - - element.on('click', listener); - - ctrl.$render = function() { - element[0].checked = ctrl.$viewValue; - }; - - // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false` - // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert - // it to a boolean. - ctrl.$isEmpty = function(value) { - return value === false; - }; - - ctrl.$formatters.push(function(value) { - return equals(value, trueValue); - }); - - ctrl.$parsers.push(function(value) { - return value ? trueValue : falseValue; - }); - } - - - /** - * @ngdoc directive - * @name textarea - * @restrict E - * - * @description - * HTML textarea element control with AngularJS data-binding. The data-binding and validation - * properties of this element are exactly the same as those of the - * {@link ng.directive:input input element}. - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any - * length. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue} - * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value. - * If the expression evaluates to a RegExp object, then this is used directly. - * If the expression evaluates to a string, then it will be converted to a RegExp - * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to - * `new RegExp('^abc$')`.<br /> - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input. - * - * @knownIssue - * - * When specifying the `placeholder` attribute of `<textarea>`, Internet Explorer will temporarily - * insert the placeholder value as the textarea's content. If the placeholder value contains - * interpolation (`{{ ... }}`), an error will be logged in the console when AngularJS tries to update - * the value of the by-then-removed text node. This doesn't affect the functionality of the - * textarea, but can be undesirable. - * - * You can work around this Internet Explorer issue by using `ng-attr-placeholder` instead of - * `placeholder` on textareas, whenever you need interpolation in the placeholder value. You can - * find more details on `ngAttr` in the - * [Interpolation](guide/interpolation#-ngattr-for-binding-to-arbitrary-attributes) section of the - * Developer Guide. - */ - - - /** - * @ngdoc directive - * @name input - * @restrict E - * - * @description - * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding, - * input state control, and validation. - * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers. - * - * <div class="alert alert-warning"> - * **Note:** Not every feature offered is available for all input types. - * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`. - * </div> - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {boolean=} ngRequired Sets `required` attribute if set to true - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any - * length. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue} - * value does not match a RegExp found by evaluating the AngularJS expression given in the attribute value. - * If the expression evaluates to a RegExp object, then this is used directly. - * If the expression evaluates to a string, then it will be converted to a RegExp - * after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to - * `new RegExp('^abc$')`.<br /> - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * @param {string=} ngChange AngularJS expression to be executed when input changes due to user - * interaction with the input element. - * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input. - * This parameter is ignored for input[type=password] controls, which will never trim the - * input. - * - * @example - <example name="input-directive" module="inputExample"> - <file name="index.html"> - <script> - angular.module('inputExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.user = {name: 'guest', last: 'visitor'}; - }]); - </script> - <div ng-controller="ExampleController"> - <form name="myForm"> - <label> - User name: - <input type="text" name="userName" ng-model="user.name" required> - </label> - <div role="alert"> - <span class="error" ng-show="myForm.userName.$error.required"> - Required!</span> - </div> - <label> - Last name: - <input type="text" name="lastName" ng-model="user.last" - ng-minlength="3" ng-maxlength="10"> - </label> - <div role="alert"> - <span class="error" ng-show="myForm.lastName.$error.minlength"> - Too short!</span> - <span class="error" ng-show="myForm.lastName.$error.maxlength"> - Too long!</span> - </div> - </form> - <hr> - <tt>user = {{user}}</tt><br/> - <tt>myForm.userName.$valid = {{myForm.userName.$valid}}</tt><br/> - <tt>myForm.userName.$error = {{myForm.userName.$error}}</tt><br/> - <tt>myForm.lastName.$valid = {{myForm.lastName.$valid}}</tt><br/> - <tt>myForm.lastName.$error = {{myForm.lastName.$error}}</tt><br/> - <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> - <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/> - <tt>myForm.$error.minlength = {{!!myForm.$error.minlength}}</tt><br/> - <tt>myForm.$error.maxlength = {{!!myForm.$error.maxlength}}</tt><br/> - </div> - </file> - <file name="protractor.js" type="protractor"> - var user = element(by.exactBinding('user')); - var userNameValid = element(by.binding('myForm.userName.$valid')); - var lastNameValid = element(by.binding('myForm.lastName.$valid')); - var lastNameError = element(by.binding('myForm.lastName.$error')); - var formValid = element(by.binding('myForm.$valid')); - var userNameInput = element(by.model('user.name')); - var userLastInput = element(by.model('user.last')); - - it('should initialize to model', function() { - expect(user.getText()).toContain('{"name":"guest","last":"visitor"}'); - expect(userNameValid.getText()).toContain('true'); - expect(formValid.getText()).toContain('true'); - }); - - it('should be invalid if empty when required', function() { - userNameInput.clear(); - userNameInput.sendKeys(''); - - expect(user.getText()).toContain('{"last":"visitor"}'); - expect(userNameValid.getText()).toContain('false'); - expect(formValid.getText()).toContain('false'); - }); - - it('should be valid if empty when min length is set', function() { - userLastInput.clear(); - userLastInput.sendKeys(''); - - expect(user.getText()).toContain('{"name":"guest","last":""}'); - expect(lastNameValid.getText()).toContain('true'); - expect(formValid.getText()).toContain('true'); - }); - - it('should be invalid if less than required min length', function() { - userLastInput.clear(); - userLastInput.sendKeys('xx'); - - expect(user.getText()).toContain('{"name":"guest"}'); - expect(lastNameValid.getText()).toContain('false'); - expect(lastNameError.getText()).toContain('minlength'); - expect(formValid.getText()).toContain('false'); - }); - - it('should be invalid if longer than max length', function() { - userLastInput.clear(); - userLastInput.sendKeys('some ridiculously long name'); - - expect(user.getText()).toContain('{"name":"guest"}'); - expect(lastNameValid.getText()).toContain('false'); - expect(lastNameError.getText()).toContain('maxlength'); - expect(formValid.getText()).toContain('false'); - }); - </file> - </example> - */ - var inputDirective = ['$browser', '$sniffer', '$filter', '$parse', - function($browser, $sniffer, $filter, $parse) { - return { - restrict: 'E', - require: ['?ngModel'], - link: { - pre: function(scope, element, attr, ctrls) { - if (ctrls[0]) { - (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer, - $browser, $filter, $parse); - } - } - } - }; - }]; - - - - var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/; - /** - * @ngdoc directive - * @name ngValue - * @restrict A - * @priority 100 - * - * @description - * Binds the given expression to the value of the element. - * - * It is mainly used on {@link input[radio] `input[radio]`} and option elements, - * so that when the element is selected, the {@link ngModel `ngModel`} of that element (or its - * {@link select `select`} parent element) is set to the bound value. It is especially useful - * for dynamically generated lists using {@link ngRepeat `ngRepeat`}, as shown below. - * - * It can also be used to achieve one-way binding of a given expression to an input element - * such as an `input[text]` or a `textarea`, when that element does not use ngModel. - * - * @element ANY - * @param {string=} ngValue AngularJS expression, whose value will be bound to the `value` attribute - * and `value` property of the element. - * - * @example - <example name="ngValue-directive" module="valueExample"> - <file name="index.html"> - <script> - angular.module('valueExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.names = ['pizza', 'unicorns', 'robots']; - $scope.my = { favorite: 'unicorns' }; - }]); - </script> - <form ng-controller="ExampleController"> - <h2>Which is your favorite?</h2> - <label ng-repeat="name in names" for="{{name}}"> - {{name}} - <input type="radio" - ng-model="my.favorite" - ng-value="name" - id="{{name}}" - name="favorite"> - </label> - <div>You chose {{my.favorite}}</div> - </form> - </file> - <file name="protractor.js" type="protractor"> - var favorite = element(by.binding('my.favorite')); - - it('should initialize to model', function() { - expect(favorite.getText()).toContain('unicorns'); - }); - it('should bind the values to the inputs', function() { - element.all(by.model('my.favorite')).get(0).click(); - expect(favorite.getText()).toContain('pizza'); - }); - </file> - </example> - */ - var ngValueDirective = function() { - /** - * inputs use the value attribute as their default value if the value property is not set. - * Once the value property has been set (by adding input), it will not react to changes to - * the value attribute anymore. Setting both attribute and property fixes this behavior, and - * makes it possible to use ngValue as a sort of one-way bind. - */ - function updateElementValue(element, attr, value) { - // Support: IE9 only - // In IE9 values are converted to string (e.g. `input.value = null` results in `input.value === 'null'`). - var propValue = isDefined(value) ? value : (msie === 9) ? '' : null; - element.prop('value', propValue); - attr.$set('value', value); - } - - return { - restrict: 'A', - priority: 100, - compile: function(tpl, tplAttr) { - if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) { - return function ngValueConstantLink(scope, elm, attr) { - var value = scope.$eval(attr.ngValue); - updateElementValue(elm, attr, value); - }; - } else { - return function ngValueLink(scope, elm, attr) { - scope.$watch(attr.ngValue, function valueWatchAction(value) { - updateElementValue(elm, attr, value); - }); - }; - } - } - }; - }; - - /** - * @ngdoc directive - * @name ngBind - * @restrict AC - * - * @description - * The `ngBind` attribute tells AngularJS to replace the text content of the specified HTML element - * with the value of a given expression, and to update the text content when the value of that - * expression changes. - * - * Typically, you don't use `ngBind` directly, but instead you use the double curly markup like - * `{{ expression }}` which is similar but less verbose. - * - * It is preferable to use `ngBind` instead of `{{ expression }}` if a template is momentarily - * displayed by the browser in its raw state before AngularJS compiles it. Since `ngBind` is an - * element attribute, it makes the bindings invisible to the user while the page is loading. - * - * An alternative solution to this problem would be using the - * {@link ng.directive:ngCloak ngCloak} directive. - * - * - * @element ANY - * @param {expression} ngBind {@link guide/expression Expression} to evaluate. - * - * @example - * Enter a name in the Live Preview text box; the greeting below the text box changes instantly. - <example module="bindExample" name="ng-bind"> - <file name="index.html"> - <script> - angular.module('bindExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.name = 'Whirled'; - }]); - </script> - <div ng-controller="ExampleController"> - <label>Enter name: <input type="text" ng-model="name"></label><br> - Hello <span ng-bind="name"></span>! - </div> - </file> - <file name="protractor.js" type="protractor"> - it('should check ng-bind', function() { - var nameInput = element(by.model('name')); - - expect(element(by.binding('name')).getText()).toBe('Whirled'); - nameInput.clear(); - nameInput.sendKeys('world'); - expect(element(by.binding('name')).getText()).toBe('world'); - }); - </file> - </example> - */ - var ngBindDirective = ['$compile', function($compile) { - return { - restrict: 'AC', - compile: function ngBindCompile(templateElement) { - $compile.$$addBindingClass(templateElement); - return function ngBindLink(scope, element, attr) { - $compile.$$addBindingInfo(element, attr.ngBind); - element = element[0]; - scope.$watch(attr.ngBind, function ngBindWatchAction(value) { - element.textContent = stringify(value); - }); - }; - } - }; - }]; - - - /** - * @ngdoc directive - * @name ngBindTemplate - * - * @description - * The `ngBindTemplate` directive specifies that the element - * text content should be replaced with the interpolation of the template - * in the `ngBindTemplate` attribute. - * Unlike `ngBind`, the `ngBindTemplate` can contain multiple `{{` `}}` - * expressions. This directive is needed since some HTML elements - * (such as TITLE and OPTION) cannot contain SPAN elements. - * - * @element ANY - * @param {string} ngBindTemplate template of form - * <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval. - * - * @example - * Try it here: enter text in text box and watch the greeting change. - <example module="bindExample" name="ng-bind-template"> - <file name="index.html"> - <script> - angular.module('bindExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.salutation = 'Hello'; - $scope.name = 'World'; - }]); - </script> - <div ng-controller="ExampleController"> - <label>Salutation: <input type="text" ng-model="salutation"></label><br> - <label>Name: <input type="text" ng-model="name"></label><br> - <pre ng-bind-template="{{salutation}} {{name}}!"></pre> - </div> - </file> - <file name="protractor.js" type="protractor"> - it('should check ng-bind', function() { - var salutationElem = element(by.binding('salutation')); - var salutationInput = element(by.model('salutation')); - var nameInput = element(by.model('name')); - - expect(salutationElem.getText()).toBe('Hello World!'); - - salutationInput.clear(); - salutationInput.sendKeys('Greetings'); - nameInput.clear(); - nameInput.sendKeys('user'); - - expect(salutationElem.getText()).toBe('Greetings user!'); - }); - </file> - </example> - */ - var ngBindTemplateDirective = ['$interpolate', '$compile', function($interpolate, $compile) { - return { - compile: function ngBindTemplateCompile(templateElement) { - $compile.$$addBindingClass(templateElement); - return function ngBindTemplateLink(scope, element, attr) { - var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate)); - $compile.$$addBindingInfo(element, interpolateFn.expressions); - element = element[0]; - attr.$observe('ngBindTemplate', function(value) { - element.textContent = isUndefined(value) ? '' : value; - }); - }; - } - }; - }]; - - - /** - * @ngdoc directive - * @name ngBindHtml - * - * @description - * Evaluates the expression and inserts the resulting HTML into the element in a secure way. By default, - * the resulting HTML content will be sanitized using the {@link ngSanitize.$sanitize $sanitize} service. - * To utilize this functionality, ensure that `$sanitize` is available, for example, by including {@link - * ngSanitize} in your module's dependencies (not in core AngularJS). In order to use {@link ngSanitize} - * in your module's dependencies, you need to include "angular-sanitize.js" in your application. - * - * You may also bypass sanitization for values you know are safe. To do so, bind to - * an explicitly trusted value via {@link ng.$sce#trustAsHtml $sce.trustAsHtml}. See the example - * under {@link ng.$sce#show-me-an-example-using-sce- Strict Contextual Escaping (SCE)}. - * - * Note: If a `$sanitize` service is unavailable and the bound value isn't explicitly trusted, you - * will have an exception (instead of an exploit.) - * - * @element ANY - * @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate. - * - * @example - - <example module="bindHtmlExample" deps="angular-sanitize.js" name="ng-bind-html"> - <file name="index.html"> - <div ng-controller="ExampleController"> - <p ng-bind-html="myHTML"></p> - </div> - </file> - - <file name="script.js"> - angular.module('bindHtmlExample', ['ngSanitize']) - .controller('ExampleController', ['$scope', function($scope) { - $scope.myHTML = - 'I am an <code>HTML</code>string with ' + - '<a href="#">links!</a> and other <em>stuff</em>'; - }]); - </file> - - <file name="protractor.js" type="protractor"> - it('should check ng-bind-html', function() { - expect(element(by.binding('myHTML')).getText()).toBe( - 'I am an HTMLstring with links! and other stuff'); - }); - </file> - </example> - */ - var ngBindHtmlDirective = ['$sce', '$parse', '$compile', function($sce, $parse, $compile) { - return { - restrict: 'A', - compile: function ngBindHtmlCompile(tElement, tAttrs) { - var ngBindHtmlGetter = $parse(tAttrs.ngBindHtml); - var ngBindHtmlWatch = $parse(tAttrs.ngBindHtml, function sceValueOf(val) { - // Unwrap the value to compare the actual inner safe value, not the wrapper object. - return $sce.valueOf(val); - }); - $compile.$$addBindingClass(tElement); - - return function ngBindHtmlLink(scope, element, attr) { - $compile.$$addBindingInfo(element, attr.ngBindHtml); - - scope.$watch(ngBindHtmlWatch, function ngBindHtmlWatchAction() { - // The watched value is the unwrapped value. To avoid re-escaping, use the direct getter. - var value = ngBindHtmlGetter(scope); - element.html($sce.getTrustedHtml(value) || ''); - }); - }; - } - }; - }]; - - /** - * @ngdoc directive - * @name ngChange - * @restrict A - * - * @description - * Evaluate the given expression when the user changes the input. - * The expression is evaluated immediately, unlike the JavaScript onchange event - * which only triggers at the end of a change (usually, when the user leaves the - * form element or presses the return key). - * - * The `ngChange` expression is only evaluated when a change in the input value causes - * a new value to be committed to the model. - * - * It will not be evaluated: - * * if the value returned from the `$parsers` transformation pipeline has not changed - * * if the input has continued to be invalid since the model will stay `null` - * * if the model is changed programmatically and not by a change to the input value - * - * - * Note, this directive requires `ngModel` to be present. - * - * @element ANY - * @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change - * in input value. - * - * @example - * <example name="ngChange-directive" module="changeExample"> - * <file name="index.html"> - * <script> - * angular.module('changeExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.counter = 0; - * $scope.change = function() { - * $scope.counter++; - * }; - * }]); - * </script> - * <div ng-controller="ExampleController"> - * <input type="checkbox" ng-model="confirmed" ng-change="change()" id="ng-change-example1" /> - * <input type="checkbox" ng-model="confirmed" id="ng-change-example2" /> - * <label for="ng-change-example2">Confirmed</label><br /> - * <tt>debug = {{confirmed}}</tt><br/> - * <tt>counter = {{counter}}</tt><br/> - * </div> - * </file> - * <file name="protractor.js" type="protractor"> - * var counter = element(by.binding('counter')); - * var debug = element(by.binding('confirmed')); - * - * it('should evaluate the expression if changing from view', function() { - * expect(counter.getText()).toContain('0'); - * - * element(by.id('ng-change-example1')).click(); - * - * expect(counter.getText()).toContain('1'); - * expect(debug.getText()).toContain('true'); - * }); - * - * it('should not evaluate the expression if changing from model', function() { - * element(by.id('ng-change-example2')).click(); - - * expect(counter.getText()).toContain('0'); - * expect(debug.getText()).toContain('true'); - * }); - * </file> - * </example> - */ - var ngChangeDirective = valueFn({ - restrict: 'A', - require: 'ngModel', - link: function(scope, element, attr, ctrl) { - ctrl.$viewChangeListeners.push(function() { - scope.$eval(attr.ngChange); - }); - } - }); - - /* exported - ngClassDirective, - ngClassEvenDirective, - ngClassOddDirective -*/ - - function classDirective(name, selector) { - name = 'ngClass' + name; - var indexWatchExpression; - - return ['$parse', function($parse) { - return { - restrict: 'AC', - link: function(scope, element, attr) { - var expression = attr[name].trim(); - var isOneTime = (expression.charAt(0) === ':') && (expression.charAt(1) === ':'); - - var watchInterceptor = isOneTime ? toFlatValue : toClassString; - var watchExpression = $parse(expression, watchInterceptor); - var watchAction = isOneTime ? ngClassOneTimeWatchAction : ngClassWatchAction; - - var classCounts = element.data('$classCounts'); - var oldModulo = true; - var oldClassString; - - if (!classCounts) { - // Use createMap() to prevent class assumptions involving property - // names in Object.prototype - classCounts = createMap(); - element.data('$classCounts', classCounts); - } - - if (name !== 'ngClass') { - if (!indexWatchExpression) { - indexWatchExpression = $parse('$index', function moduloTwo($index) { - // eslint-disable-next-line no-bitwise - return $index & 1; - }); - } - - scope.$watch(indexWatchExpression, ngClassIndexWatchAction); - } - - scope.$watch(watchExpression, watchAction, isOneTime); - - function addClasses(classString) { - classString = digestClassCounts(split(classString), 1); - attr.$addClass(classString); - } - - function removeClasses(classString) { - classString = digestClassCounts(split(classString), -1); - attr.$removeClass(classString); - } - - function updateClasses(oldClassString, newClassString) { - var oldClassArray = split(oldClassString); - var newClassArray = split(newClassString); - - var toRemoveArray = arrayDifference(oldClassArray, newClassArray); - var toAddArray = arrayDifference(newClassArray, oldClassArray); - - var toRemoveString = digestClassCounts(toRemoveArray, -1); - var toAddString = digestClassCounts(toAddArray, 1); - - attr.$addClass(toAddString); - attr.$removeClass(toRemoveString); - } - - function digestClassCounts(classArray, count) { - var classesToUpdate = []; - - forEach(classArray, function(className) { - if (count > 0 || classCounts[className]) { - classCounts[className] = (classCounts[className] || 0) + count; - if (classCounts[className] === +(count > 0)) { - classesToUpdate.push(className); - } - } - }); - - return classesToUpdate.join(' '); - } - - function ngClassIndexWatchAction(newModulo) { - // This watch-action should run before the `ngClass[OneTime]WatchAction()`, thus it - // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the - // `ngClass[OneTime]WatchAction()` will update the classes. - if (newModulo === selector) { - addClasses(oldClassString); - } else { - removeClasses(oldClassString); - } - - oldModulo = newModulo; - } - - function ngClassOneTimeWatchAction(newClassValue) { - var newClassString = toClassString(newClassValue); - - if (newClassString !== oldClassString) { - ngClassWatchAction(newClassString); - } - } - - function ngClassWatchAction(newClassString) { - if (oldModulo === selector) { - updateClasses(oldClassString, newClassString); - } - - oldClassString = newClassString; - } - } - }; - }]; - - // Helpers - function arrayDifference(tokens1, tokens2) { - if (!tokens1 || !tokens1.length) return []; - if (!tokens2 || !tokens2.length) return tokens1; - - var values = []; - - outer: - for (var i = 0; i < tokens1.length; i++) { - var token = tokens1[i]; - for (var j = 0; j < tokens2.length; j++) { - if (token === tokens2[j]) continue outer; - } - values.push(token); - } - - return values; - } - - function split(classString) { - return classString && classString.split(' '); - } - - function toClassString(classValue) { - var classString = classValue; - - if (isArray(classValue)) { - classString = classValue.map(toClassString).join(' '); - } else if (isObject(classValue)) { - classString = Object.keys(classValue). - filter(function(key) { return classValue[key]; }). - join(' '); - } - - return classString; - } - - function toFlatValue(classValue) { - var flatValue = classValue; - - if (isArray(classValue)) { - flatValue = classValue.map(toFlatValue); - } else if (isObject(classValue)) { - var hasUndefined = false; - - flatValue = Object.keys(classValue).filter(function(key) { - var value = classValue[key]; - - if (!hasUndefined && isUndefined(value)) { - hasUndefined = true; - } - - return value; - }); - - if (hasUndefined) { - // Prevent the `oneTimeLiteralWatchInterceptor` from unregistering - // the watcher, by including at least one `undefined` value. - flatValue.push(undefined); - } - } - - return flatValue; - } - } - - /** - * @ngdoc directive - * @name ngClass - * @restrict AC - * @element ANY - * - * @description - * The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding - * an expression that represents all classes to be added. - * - * The directive operates in three different ways, depending on which of three types the expression - * evaluates to: - * - * 1. If the expression evaluates to a string, the string should be one or more space-delimited class - * names. - * - * 2. If the expression evaluates to an object, then for each key-value pair of the - * object with a truthy value the corresponding key is used as a class name. - * - * 3. If the expression evaluates to an array, each element of the array should either be a string as in - * type 1 or an object as in type 2. This means that you can mix strings and objects together in an array - * to give you more control over what CSS classes appear. See the code below for an example of this. - * - * - * The directive won't add duplicate classes if a particular class was already set. - * - * When the expression changes, the previously added classes are removed and only then are the - * new classes added. - * - * @knownIssue - * You should not use {@link guide/interpolation interpolation} in the value of the `class` - * attribute, when using the `ngClass` directive on the same element. - * See {@link guide/interpolation#known-issues here} for more info. - * - * @animations - * | Animation | Occurs | - * |----------------------------------|-------------------------------------| - * | {@link ng.$animate#addClass addClass} | just before the class is applied to the element | - * | {@link ng.$animate#removeClass removeClass} | just before the class is removed from the element | - * - * ### ngClass and pre-existing CSS3 Transitions/Animations - The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure. - Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder - any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure - to view the step by step details of {@link $animate#addClass $animate.addClass} and - {@link $animate#removeClass $animate.removeClass}. - * - * @param {expression} ngClass {@link guide/expression Expression} to eval. The result - * of the evaluation can be a string representing space delimited class - * names, an array, or a map of class names to boolean values. In the case of a map, the - * names of the properties whose values are truthy will be added as css classes to the - * element. - * - * @example - * ### Basic - <example name="ng-class"> - <file name="index.html"> - <p ng-class="{strike: deleted, bold: important, 'has-error': error}">Map Syntax Example</p> - <label> - <input type="checkbox" ng-model="deleted"> - deleted (apply "strike" class) - </label><br> - <label> - <input type="checkbox" ng-model="important"> - important (apply "bold" class) - </label><br> - <label> - <input type="checkbox" ng-model="error"> - error (apply "has-error" class) - </label> - <hr> - <p ng-class="style">Using String Syntax</p> - <input type="text" ng-model="style" - placeholder="Type: bold strike red" aria-label="Type: bold strike red"> - <hr> - <p ng-class="[style1, style2, style3]">Using Array Syntax</p> - <input ng-model="style1" - placeholder="Type: bold, strike or red" aria-label="Type: bold, strike or red"><br> - <input ng-model="style2" - placeholder="Type: bold, strike or red" aria-label="Type: bold, strike or red 2"><br> - <input ng-model="style3" - placeholder="Type: bold, strike or red" aria-label="Type: bold, strike or red 3"><br> - <hr> - <p ng-class="[style4, {orange: warning}]">Using Array and Map Syntax</p> - <input ng-model="style4" placeholder="Type: bold, strike" aria-label="Type: bold, strike"><br> - <label><input type="checkbox" ng-model="warning"> warning (apply "orange" class)</label> - </file> - <file name="style.css"> - .strike { - text-decoration: line-through; - } - .bold { - font-weight: bold; - } - .red { - color: red; - } - .has-error { - color: red; - background-color: yellow; - } - .orange { - color: orange; - } - </file> - <file name="protractor.js" type="protractor"> - var ps = element.all(by.css('p')); - - it('should let you toggle the class', function() { - - expect(ps.first().getAttribute('class')).not.toMatch(/bold/); - expect(ps.first().getAttribute('class')).not.toMatch(/has-error/); - - element(by.model('important')).click(); - expect(ps.first().getAttribute('class')).toMatch(/bold/); - - element(by.model('error')).click(); - expect(ps.first().getAttribute('class')).toMatch(/has-error/); - }); - - it('should let you toggle string example', function() { - expect(ps.get(1).getAttribute('class')).toBe(''); - element(by.model('style')).clear(); - element(by.model('style')).sendKeys('red'); - expect(ps.get(1).getAttribute('class')).toBe('red'); - }); - - it('array example should have 3 classes', function() { - expect(ps.get(2).getAttribute('class')).toBe(''); - element(by.model('style1')).sendKeys('bold'); - element(by.model('style2')).sendKeys('strike'); - element(by.model('style3')).sendKeys('red'); - expect(ps.get(2).getAttribute('class')).toBe('bold strike red'); - }); - - it('array with map example should have 2 classes', function() { - expect(ps.last().getAttribute('class')).toBe(''); - element(by.model('style4')).sendKeys('bold'); - element(by.model('warning')).click(); - expect(ps.last().getAttribute('class')).toBe('bold orange'); - }); - </file> - </example> - - @example - ### Animations - - The example below demonstrates how to perform animations using ngClass. - - <example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-class"> - <file name="index.html"> - <input id="setbtn" type="button" value="set" ng-click="myVar='my-class'"> - <input id="clearbtn" type="button" value="clear" ng-click="myVar=''"> - <br> - <span class="base-class" ng-class="myVar">Sample Text</span> - </file> - <file name="style.css"> - .base-class { - transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; - } - - .base-class.my-class { - color: red; - font-size:3em; - } - </file> - <file name="protractor.js" type="protractor"> - it('should check ng-class', function() { - expect(element(by.css('.base-class')).getAttribute('class')).not. - toMatch(/my-class/); - - element(by.id('setbtn')).click(); - - expect(element(by.css('.base-class')).getAttribute('class')). - toMatch(/my-class/); - - element(by.id('clearbtn')).click(); - - expect(element(by.css('.base-class')).getAttribute('class')).not. - toMatch(/my-class/); - }); - </file> - </example> - */ - var ngClassDirective = classDirective('', true); - - /** - * @ngdoc directive - * @name ngClassOdd - * @restrict AC - * - * @description - * The `ngClassOdd` and `ngClassEven` directives work exactly as - * {@link ng.directive:ngClass ngClass}, except they work in - * conjunction with `ngRepeat` and take effect only on odd (even) rows. - * - * This directive can be applied only within the scope of an - * {@link ng.directive:ngRepeat ngRepeat}. - * - * @element ANY - * @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result - * of the evaluation can be a string representing space delimited class names or an array. - * - * @example - <example name="ng-class-odd"> - <file name="index.html"> - <ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']"> - <li ng-repeat="name in names"> - <span ng-class-odd="'odd'" ng-class-even="'even'"> - {{name}} - </span> - </li> - </ol> - </file> - <file name="style.css"> - .odd { - color: red; - } - .even { - color: blue; - } - </file> - <file name="protractor.js" type="protractor"> - it('should check ng-class-odd and ng-class-even', function() { - expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')). - toMatch(/odd/); - expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')). - toMatch(/even/); - }); - </file> - </example> - */ - var ngClassOddDirective = classDirective('Odd', 0); - - /** - * @ngdoc directive - * @name ngClassEven - * @restrict AC - * - * @description - * The `ngClassOdd` and `ngClassEven` directives work exactly as - * {@link ng.directive:ngClass ngClass}, except they work in - * conjunction with `ngRepeat` and take effect only on odd (even) rows. - * - * This directive can be applied only within the scope of an - * {@link ng.directive:ngRepeat ngRepeat}. - * - * @element ANY - * @param {expression} ngClassEven {@link guide/expression Expression} to eval. The - * result of the evaluation can be a string representing space delimited class names or an array. - * - * @example - <example name="ng-class-even"> - <file name="index.html"> - <ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']"> - <li ng-repeat="name in names"> - <span ng-class-odd="'odd'" ng-class-even="'even'"> - {{name}}       - </span> - </li> - </ol> - </file> - <file name="style.css"> - .odd { - color: red; - } - .even { - color: blue; - } - </file> - <file name="protractor.js" type="protractor"> - it('should check ng-class-odd and ng-class-even', function() { - expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')). - toMatch(/odd/); - expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')). - toMatch(/even/); - }); - </file> - </example> - */ - var ngClassEvenDirective = classDirective('Even', 1); - - /** - * @ngdoc directive - * @name ngCloak - * @restrict AC - * - * @description - * The `ngCloak` directive is used to prevent the AngularJS html template from being briefly - * displayed by the browser in its raw (uncompiled) form while your application is loading. Use this - * directive to avoid the undesirable flicker effect caused by the html template display. - * - * The directive can be applied to the `<body>` element, but the preferred usage is to apply - * multiple `ngCloak` directives to small portions of the page to permit progressive rendering - * of the browser view. - * - * `ngCloak` works in cooperation with the following css rule embedded within `angular.js` and - * `angular.min.js`. - * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}). - * - * ```css - * [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { - * display: none !important; - * } - * ``` - * - * When this css rule is loaded by the browser, all html elements (including their children) that - * are tagged with the `ngCloak` directive are hidden. When AngularJS encounters this directive - * during the compilation of the template it deletes the `ngCloak` element attribute, making - * the compiled element visible. - * - * For the best result, the `angular.js` script must be loaded in the head section of the html - * document; alternatively, the css rule above must be included in the external stylesheet of the - * application. - * - * @element ANY - * - * @example - <example name="ng-cloak"> - <file name="index.html"> - <div id="template1" ng-cloak>{{ 'hello' }}</div> - <div id="template2" class="ng-cloak">{{ 'world' }}</div> - </file> - <file name="protractor.js" type="protractor"> - it('should remove the template directive and css class', function() { - expect($('#template1').getAttribute('ng-cloak')). - toBeNull(); - expect($('#template2').getAttribute('ng-cloak')). - toBeNull(); - }); - </file> - </example> - * - */ - var ngCloakDirective = ngDirective({ - compile: function(element, attr) { - attr.$set('ngCloak', undefined); - element.removeClass('ng-cloak'); - } - }); - - /** - * @ngdoc directive - * @name ngController - * - * @description - * The `ngController` directive attaches a controller class to the view. This is a key aspect of how angular - * supports the principles behind the Model-View-Controller design pattern. - * - * MVC components in angular: - * - * * Model — Models are the properties of a scope; scopes are attached to the DOM where scope properties - * are accessed through bindings. - * * View — The template (HTML with data bindings) that is rendered into the View. - * * Controller — The `ngController` directive specifies a Controller class; the class contains business - * logic behind the application to decorate the scope with functions and values - * - * Note that you can also attach controllers to the DOM by declaring it in a route definition - * via the {@link ngRoute.$route $route} service. A common mistake is to declare the controller - * again using `ng-controller` in the template itself. This will cause the controller to be attached - * and executed twice. - * - * @element ANY - * @scope - * @priority 500 - * @param {expression} ngController Name of a constructor function registered with the current - * {@link ng.$controllerProvider $controllerProvider} or an {@link guide/expression expression} - * that on the current scope evaluates to a constructor function. - * - * The controller instance can be published into a scope property by specifying - * `ng-controller="as propertyName"`. - * - * If the current `$controllerProvider` is configured to use globals (via - * {@link ng.$controllerProvider#allowGlobals `$controllerProvider.allowGlobals()` }), this may - * also be the name of a globally accessible constructor function (deprecated, not recommended). - * - * @example - * Here is a simple form for editing user contact information. Adding, removing, clearing, and - * greeting are methods declared on the controller (see source tab). These methods can - * easily be called from the AngularJS markup. Any changes to the data are automatically reflected - * in the View without the need for a manual update. - * - * Two different declaration styles are included below: - * - * * one binds methods and properties directly onto the controller using `this`: - * `ng-controller="SettingsController1 as settings"` - * * one injects `$scope` into the controller: - * `ng-controller="SettingsController2"` - * - * The second option is more common in the AngularJS community, and is generally used in boilerplates - * and in this guide. However, there are advantages to binding properties directly to the controller - * and avoiding scope. - * - * * Using `controller as` makes it obvious which controller you are accessing in the template when - * multiple controllers apply to an element. - * * If you are writing your controllers as classes you have easier access to the properties and - * methods, which will appear on the scope, from inside the controller code. - * * Since there is always a `.` in the bindings, you don't have to worry about prototypal - * inheritance masking primitives. - * - * This example demonstrates the `controller as` syntax. - * - * <example name="ngControllerAs" module="controllerAsExample"> - * <file name="index.html"> - * <div id="ctrl-as-exmpl" ng-controller="SettingsController1 as settings"> - * <label>Name: <input type="text" ng-model="settings.name"/></label> - * <button ng-click="settings.greet()">greet</button><br/> - * Contact: - * <ul> - * <li ng-repeat="contact in settings.contacts"> - * <select ng-model="contact.type" aria-label="Contact method" id="select_{{$index}}"> - * <option>phone</option> - * <option>email</option> - * </select> - * <input type="text" ng-model="contact.value" aria-labelledby="select_{{$index}}" /> - * <button ng-click="settings.clearContact(contact)">clear</button> - * <button ng-click="settings.removeContact(contact)" aria-label="Remove">X</button> - * </li> - * <li><button ng-click="settings.addContact()">add</button></li> - * </ul> - * </div> - * </file> - * <file name="app.js"> - * angular.module('controllerAsExample', []) - * .controller('SettingsController1', SettingsController1); - * - * function SettingsController1() { - * this.name = 'John Smith'; - * this.contacts = [ - * {type: 'phone', value: '408 555 1212'}, - * {type: 'email', value: 'john.smith@example.org'} - * ]; - * } - * - * SettingsController1.prototype.greet = function() { - * alert(this.name); - * }; - * - * SettingsController1.prototype.addContact = function() { - * this.contacts.push({type: 'email', value: 'yourname@example.org'}); - * }; - * - * SettingsController1.prototype.removeContact = function(contactToRemove) { - * var index = this.contacts.indexOf(contactToRemove); - * this.contacts.splice(index, 1); - * }; - * - * SettingsController1.prototype.clearContact = function(contact) { - * contact.type = 'phone'; - * contact.value = ''; - * }; - * </file> - * <file name="protractor.js" type="protractor"> - * it('should check controller as', function() { - * var container = element(by.id('ctrl-as-exmpl')); - * expect(container.element(by.model('settings.name')) - * .getAttribute('value')).toBe('John Smith'); - * - * var firstRepeat = - * container.element(by.repeater('contact in settings.contacts').row(0)); - * var secondRepeat = - * container.element(by.repeater('contact in settings.contacts').row(1)); - * - * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value')) - * .toBe('408 555 1212'); - * - * expect(secondRepeat.element(by.model('contact.value')).getAttribute('value')) - * .toBe('john.smith@example.org'); - * - * firstRepeat.element(by.buttonText('clear')).click(); - * - * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value')) - * .toBe(''); - * - * container.element(by.buttonText('add')).click(); - * - * expect(container.element(by.repeater('contact in settings.contacts').row(2)) - * .element(by.model('contact.value')) - * .getAttribute('value')) - * .toBe('yourname@example.org'); - * }); - * </file> - * </example> - * - * This example demonstrates the "attach to `$scope`" style of controller. - * - * <example name="ngController" module="controllerExample"> - * <file name="index.html"> - * <div id="ctrl-exmpl" ng-controller="SettingsController2"> - * <label>Name: <input type="text" ng-model="name"/></label> - * <button ng-click="greet()">greet</button><br/> - * Contact: - * <ul> - * <li ng-repeat="contact in contacts"> - * <select ng-model="contact.type" id="select_{{$index}}"> - * <option>phone</option> - * <option>email</option> - * </select> - * <input type="text" ng-model="contact.value" aria-labelledby="select_{{$index}}" /> - * <button ng-click="clearContact(contact)">clear</button> - * <button ng-click="removeContact(contact)">X</button> - * </li> - * <li>[ <button ng-click="addContact()">add</button> ]</li> - * </ul> - * </div> - * </file> - * <file name="app.js"> - * angular.module('controllerExample', []) - * .controller('SettingsController2', ['$scope', SettingsController2]); - * - * function SettingsController2($scope) { - * $scope.name = 'John Smith'; - * $scope.contacts = [ - * {type:'phone', value:'408 555 1212'}, - * {type:'email', value:'john.smith@example.org'} - * ]; - * - * $scope.greet = function() { - * alert($scope.name); - * }; - * - * $scope.addContact = function() { - * $scope.contacts.push({type:'email', value:'yourname@example.org'}); - * }; - * - * $scope.removeContact = function(contactToRemove) { - * var index = $scope.contacts.indexOf(contactToRemove); - * $scope.contacts.splice(index, 1); - * }; - * - * $scope.clearContact = function(contact) { - * contact.type = 'phone'; - * contact.value = ''; - * }; - * } - * </file> - * <file name="protractor.js" type="protractor"> - * it('should check controller', function() { - * var container = element(by.id('ctrl-exmpl')); - * - * expect(container.element(by.model('name')) - * .getAttribute('value')).toBe('John Smith'); - * - * var firstRepeat = - * container.element(by.repeater('contact in contacts').row(0)); - * var secondRepeat = - * container.element(by.repeater('contact in contacts').row(1)); - * - * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value')) - * .toBe('408 555 1212'); - * expect(secondRepeat.element(by.model('contact.value')).getAttribute('value')) - * .toBe('john.smith@example.org'); - * - * firstRepeat.element(by.buttonText('clear')).click(); - * - * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value')) - * .toBe(''); - * - * container.element(by.buttonText('add')).click(); - * - * expect(container.element(by.repeater('contact in contacts').row(2)) - * .element(by.model('contact.value')) - * .getAttribute('value')) - * .toBe('yourname@example.org'); - * }); - * </file> - *</example> - - */ - var ngControllerDirective = [function() { - return { - restrict: 'A', - scope: true, - controller: '@', - priority: 500 - }; - }]; - - /** - * @ngdoc directive - * @name ngCsp - * - * @restrict A - * @element ANY - * @description - * - * AngularJS has some features that can conflict with certain restrictions that are applied when using - * [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) rules. - * - * If you intend to implement CSP with these rules then you must tell AngularJS not to use these - * features. - * - * This is necessary when developing things like Google Chrome Extensions or Universal Windows Apps. - * - * - * The following default rules in CSP affect AngularJS: - * - * * The use of `eval()`, `Function(string)` and similar functions to dynamically create and execute - * code from strings is forbidden. AngularJS makes use of this in the {@link $parse} service to - * provide a 30% increase in the speed of evaluating AngularJS expressions. (This CSP rule can be - * disabled with the CSP keyword `unsafe-eval`, but it is generally not recommended as it would - * weaken the protections offered by CSP.) - * - * * The use of inline resources, such as inline `<script>` and `<style>` elements, are forbidden. - * This prevents apps from injecting custom styles directly into the document. AngularJS makes use of - * this to include some CSS rules (e.g. {@link ngCloak} and {@link ngHide}). To make these - * directives work when a CSP rule is blocking inline styles, you must link to the `angular-csp.css` - * in your HTML manually. (This CSP rule can be disabled with the CSP keyword `unsafe-inline`, but - * it is generally not recommended as it would weaken the protections offered by CSP.) - * - * If you do not provide `ngCsp` then AngularJS tries to autodetect if CSP is blocking dynamic code - * creation from strings (e.g., `unsafe-eval` not specified in CSP header) and automatically - * deactivates this feature in the {@link $parse} service. This autodetection, however, triggers a - * CSP error to be logged in the console: - * - * ``` - * Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of - * script in the following Content Security Policy directive: "default-src 'self'". Note that - * 'script-src' was not explicitly set, so 'default-src' is used as a fallback. - * ``` - * - * This error is harmless but annoying. To prevent the error from showing up, put the `ngCsp` - * directive on an element of the HTML document that appears before the `<script>` tag that loads - * the `angular.js` file. - * - * *Note: This directive is only available in the `ng-csp` and `data-ng-csp` attribute form.* - * - * You can specify which of the CSP related AngularJS features should be deactivated by providing - * a value for the `ng-csp` attribute. The options are as follows: - * - * * no-inline-style: this stops AngularJS from injecting CSS styles into the DOM - * - * * no-unsafe-eval: this stops AngularJS from optimizing $parse with unsafe eval of strings - * - * You can use these values in the following combinations: - * - * - * * No declaration means that AngularJS will assume that you can do inline styles, but it will do - * a runtime check for unsafe-eval. E.g. `<body>`. This is backwardly compatible with previous - * versions of AngularJS. - * - * * A simple `ng-csp` (or `data-ng-csp`) attribute will tell AngularJS to deactivate both inline - * styles and unsafe eval. E.g. `<body ng-csp>`. This is backwardly compatible with previous - * versions of AngularJS. - * - * * Specifying only `no-unsafe-eval` tells AngularJS that we must not use eval, but that we can - * inject inline styles. E.g. `<body ng-csp="no-unsafe-eval">`. - * - * * Specifying only `no-inline-style` tells AngularJS that we must not inject styles, but that we can - * run eval - no automatic check for unsafe eval will occur. E.g. `<body ng-csp="no-inline-style">` - * - * * Specifying both `no-unsafe-eval` and `no-inline-style` tells AngularJS that we must not inject - * styles nor use eval, which is the same as an empty: ng-csp. - * E.g.`<body ng-csp="no-inline-style;no-unsafe-eval">` - * - * @example - * - * This example shows how to apply the `ngCsp` directive to the `html` tag. - ```html - <!doctype html> - <html ng-app ng-csp> - ... - ... - </html> - ``` - - <!-- Note: the `.csp` suffix in the example name triggers CSP mode in our http server! --> - <example name="example.csp" module="cspExample" ng-csp="true"> - <file name="index.html"> - <div ng-controller="MainController as ctrl"> - <div> - <button ng-click="ctrl.inc()" id="inc">Increment</button> - <span id="counter"> - {{ctrl.counter}} - </span> - </div> - - <div> - <button ng-click="ctrl.evil()" id="evil">Evil</button> - <span id="evilError"> - {{ctrl.evilError}} - </span> - </div> - </div> - </file> - <file name="script.js"> - angular.module('cspExample', []) - .controller('MainController', function MainController() { - this.counter = 0; - this.inc = function() { - this.counter++; - }; - this.evil = function() { - try { - eval('1+2'); // eslint-disable-line no-eval - } catch (e) { - this.evilError = e.message; - } - }; - }); - </file> - <file name="protractor.js" type="protractor"> - var util, webdriver; - - var incBtn = element(by.id('inc')); - var counter = element(by.id('counter')); - var evilBtn = element(by.id('evil')); - var evilError = element(by.id('evilError')); - - function getAndClearSevereErrors() { - return browser.manage().logs().get('browser').then(function(browserLog) { - return browserLog.filter(function(logEntry) { - return logEntry.level.value > webdriver.logging.Level.WARNING.value; - }); - }); - } - - function clearErrors() { - getAndClearSevereErrors(); - } - - function expectNoErrors() { - getAndClearSevereErrors().then(function(filteredLog) { - expect(filteredLog.length).toEqual(0); - if (filteredLog.length) { - console.log('browser console errors: ' + util.inspect(filteredLog)); - } - }); - } - - function expectError(regex) { - getAndClearSevereErrors().then(function(filteredLog) { - var found = false; - filteredLog.forEach(function(log) { - if (log.message.match(regex)) { - found = true; - } - }); - if (!found) { - throw new Error('expected an error that matches ' + regex); - } - }); - } - - beforeEach(function() { - util = require('util'); - webdriver = require('selenium-webdriver'); - }); - - // For now, we only test on Chrome, - // as Safari does not load the page with Protractor's injected scripts, - // and Firefox webdriver always disables content security policy (#6358) - if (browser.params.browser !== 'chrome') { - return; - } - - it('should not report errors when the page is loaded', function() { - // clear errors so we are not dependent on previous tests - clearErrors(); - // Need to reload the page as the page is already loaded when - // we come here - browser.driver.getCurrentUrl().then(function(url) { - browser.get(url); - }); - expectNoErrors(); - }); - - it('should evaluate expressions', function() { - expect(counter.getText()).toEqual('0'); - incBtn.click(); - expect(counter.getText()).toEqual('1'); - expectNoErrors(); - }); - - it('should throw and report an error when using "eval"', function() { - evilBtn.click(); - expect(evilError.getText()).toMatch(/Content Security Policy/); - expectError(/Content Security Policy/); - }); - </file> - </example> - */ - -// `ngCsp` is not implemented as a proper directive any more, because we need it be processed while -// we bootstrap the app (before `$parse` is instantiated). For this reason, we just have the `csp()` -// fn that looks for the `ng-csp` attribute anywhere in the current doc. - - /** - * @ngdoc directive - * @name ngClick - * @restrict A - * @element ANY - * @priority 0 - * - * @description - * The ngClick directive allows you to specify custom behavior when - * an element is clicked. - * - * @param {expression} ngClick {@link guide/expression Expression} to evaluate upon - * click. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - <example name="ng-click"> - <file name="index.html"> - <button ng-click="count = count + 1" ng-init="count=0"> - Increment - </button> - <span> - count: {{count}} - </span> - </file> - <file name="protractor.js" type="protractor"> - it('should check ng-click', function() { - expect(element(by.binding('count')).getText()).toMatch('0'); - element(by.css('button')).click(); - expect(element(by.binding('count')).getText()).toMatch('1'); - }); - </file> - </example> - */ - /* - * A collection of directives that allows creation of custom event handlers that are defined as - * AngularJS expressions and are compiled and executed within the current scope. - */ - var ngEventDirectives = {}; - -// For events that might fire synchronously during DOM manipulation -// we need to execute their event handlers asynchronously using $evalAsync, -// so that they are not executed in an inconsistent state. - var forceAsyncEvents = { - 'blur': true, - 'focus': true - }; - forEach( - 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '), - function(eventName) { - var directiveName = directiveNormalize('ng-' + eventName); - ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) { - return { - restrict: 'A', - compile: function($element, attr) { - // NOTE: - // We expose the powerful `$event` object on the scope that provides access to the Window, - // etc. This is OK, because expressions are not sandboxed any more (and the expression - // sandbox was never meant to be a security feature anyway). - var fn = $parse(attr[directiveName]); - return function ngEventHandler(scope, element) { - element.on(eventName, function(event) { - var callback = function() { - fn(scope, {$event: event}); - }; - if (forceAsyncEvents[eventName] && $rootScope.$$phase) { - scope.$evalAsync(callback); - } else { - scope.$apply(callback); - } - }); - }; - } - }; - }]; - } - ); - - /** - * @ngdoc directive - * @name ngDblclick - * @restrict A - * @element ANY - * @priority 0 - * - * @description - * The `ngDblclick` directive allows you to specify custom behavior on a dblclick event. - * - * @param {expression} ngDblclick {@link guide/expression Expression} to evaluate upon - * a dblclick. (The Event object is available as `$event`) - * - * @example - <example name="ng-dblclick"> - <file name="index.html"> - <button ng-dblclick="count = count + 1" ng-init="count=0"> - Increment (on double click) - </button> - count: {{count}} - </file> - </example> - */ - - - /** - * @ngdoc directive - * @name ngMousedown - * @restrict A - * @element ANY - * @priority 0 - * - * @description - * The ngMousedown directive allows you to specify custom behavior on mousedown event. - * - * @param {expression} ngMousedown {@link guide/expression Expression} to evaluate upon - * mousedown. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - <example name="ng-mousedown"> - <file name="index.html"> - <button ng-mousedown="count = count + 1" ng-init="count=0"> - Increment (on mouse down) - </button> - count: {{count}} - </file> - </example> - */ - - - /** - * @ngdoc directive - * @name ngMouseup - * @restrict A - * @element ANY - * @priority 0 - * - * @description - * Specify custom behavior on mouseup event. - * - * @param {expression} ngMouseup {@link guide/expression Expression} to evaluate upon - * mouseup. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - <example name="ng-mouseup"> - <file name="index.html"> - <button ng-mouseup="count = count + 1" ng-init="count=0"> - Increment (on mouse up) - </button> - count: {{count}} - </file> - </example> - */ - - /** - * @ngdoc directive - * @name ngMouseover - * @restrict A - * @element ANY - * @priority 0 - * - * @description - * Specify custom behavior on mouseover event. - * - * @param {expression} ngMouseover {@link guide/expression Expression} to evaluate upon - * mouseover. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - <example name="ng-mouseover"> - <file name="index.html"> - <button ng-mouseover="count = count + 1" ng-init="count=0"> - Increment (when mouse is over) - </button> - count: {{count}} - </file> - </example> - */ - - - /** - * @ngdoc directive - * @name ngMouseenter - * @restrict A - * @element ANY - * @priority 0 - * - * @description - * Specify custom behavior on mouseenter event. - * - * @param {expression} ngMouseenter {@link guide/expression Expression} to evaluate upon - * mouseenter. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - <example name="ng-mouseenter"> - <file name="index.html"> - <button ng-mouseenter="count = count + 1" ng-init="count=0"> - Increment (when mouse enters) - </button> - count: {{count}} - </file> - </example> - */ - - - /** - * @ngdoc directive - * @name ngMouseleave - * @restrict A - * @element ANY - * @priority 0 - * - * @description - * Specify custom behavior on mouseleave event. - * - * @param {expression} ngMouseleave {@link guide/expression Expression} to evaluate upon - * mouseleave. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - <example name="ng-mouseleave"> - <file name="index.html"> - <button ng-mouseleave="count = count + 1" ng-init="count=0"> - Increment (when mouse leaves) - </button> - count: {{count}} - </file> - </example> - */ - - - /** - * @ngdoc directive - * @name ngMousemove - * @restrict A - * @element ANY - * @priority 0 - * - * @description - * Specify custom behavior on mousemove event. - * - * @param {expression} ngMousemove {@link guide/expression Expression} to evaluate upon - * mousemove. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - <example name="ng-mousemove"> - <file name="index.html"> - <button ng-mousemove="count = count + 1" ng-init="count=0"> - Increment (when mouse moves) - </button> - count: {{count}} - </file> - </example> - */ - - - /** - * @ngdoc directive - * @name ngKeydown - * @restrict A - * @element ANY - * @priority 0 - * - * @description - * Specify custom behavior on keydown event. - * - * @param {expression} ngKeydown {@link guide/expression Expression} to evaluate upon - * keydown. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.) - * - * @example - <example name="ng-keydown"> - <file name="index.html"> - <input ng-keydown="count = count + 1" ng-init="count=0"> - key down count: {{count}} - </file> - </example> - */ - - - /** - * @ngdoc directive - * @name ngKeyup - * @restrict A - * @element ANY - * @priority 0 - * - * @description - * Specify custom behavior on keyup event. - * - * @param {expression} ngKeyup {@link guide/expression Expression} to evaluate upon - * keyup. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.) - * - * @example - <example name="ng-keyup"> - <file name="index.html"> - <p>Typing in the input box below updates the key count</p> - <input ng-keyup="count = count + 1" ng-init="count=0"> key up count: {{count}} - - <p>Typing in the input box below updates the keycode</p> - <input ng-keyup="event=$event"> - <p>event keyCode: {{ event.keyCode }}</p> - <p>event altKey: {{ event.altKey }}</p> - </file> - </example> - */ - - - /** - * @ngdoc directive - * @name ngKeypress - * @restrict A - * @element ANY - * - * @description - * Specify custom behavior on keypress event. - * - * @param {expression} ngKeypress {@link guide/expression Expression} to evaluate upon - * keypress. ({@link guide/expression#-event- Event object is available as `$event`} - * and can be interrogated for keyCode, altKey, etc.) - * - * @example - <example name="ng-keypress"> - <file name="index.html"> - <input ng-keypress="count = count + 1" ng-init="count=0"> - key press count: {{count}} - </file> - </example> - */ - - - /** - * @ngdoc directive - * @name ngSubmit - * @restrict A - * @element form - * @priority 0 - * - * @description - * Enables binding AngularJS expressions to onsubmit events. - * - * Additionally it prevents the default action (which for form means sending the request to the - * server and reloading the current page), but only if the form does not contain `action`, - * `data-action`, or `x-action` attributes. - * - * <div class="alert alert-warning"> - * **Warning:** Be careful not to cause "double-submission" by using both the `ngClick` and - * `ngSubmit` handlers together. See the - * {@link form#submitting-a-form-and-preventing-the-default-action `form` directive documentation} - * for a detailed discussion of when `ngSubmit` may be triggered. - * </div> - * - * @param {expression} ngSubmit {@link guide/expression Expression} to eval. - * ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - <example module="submitExample" name="ng-submit"> - <file name="index.html"> - <script> - angular.module('submitExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.list = []; - $scope.text = 'hello'; - $scope.submit = function() { - if ($scope.text) { - $scope.list.push(this.text); - $scope.text = ''; - } - }; - }]); - </script> - <form ng-submit="submit()" ng-controller="ExampleController"> - Enter text and hit enter: - <input type="text" ng-model="text" name="text" /> - <input type="submit" id="submit" value="Submit" /> - <pre>list={{list}}</pre> - </form> - </file> - <file name="protractor.js" type="protractor"> - it('should check ng-submit', function() { - expect(element(by.binding('list')).getText()).toBe('list=[]'); - element(by.css('#submit')).click(); - expect(element(by.binding('list')).getText()).toContain('hello'); - expect(element(by.model('text')).getAttribute('value')).toBe(''); - }); - it('should ignore empty strings', function() { - expect(element(by.binding('list')).getText()).toBe('list=[]'); - element(by.css('#submit')).click(); - element(by.css('#submit')).click(); - expect(element(by.binding('list')).getText()).toContain('hello'); - }); - </file> - </example> - */ - - /** - * @ngdoc directive - * @name ngFocus - * @restrict A - * @element window, input, select, textarea, a - * @priority 0 - * - * @description - * Specify custom behavior on focus event. - * - * Note: As the `focus` event is executed synchronously when calling `input.focus()` - * AngularJS executes the expression using `scope.$evalAsync` if the event is fired - * during an `$apply` to ensure a consistent state. - * - * @param {expression} ngFocus {@link guide/expression Expression} to evaluate upon - * focus. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - * See {@link ng.directive:ngClick ngClick} - */ - - /** - * @ngdoc directive - * @name ngBlur - * @restrict A - * @element window, input, select, textarea, a - * @priority 0 - * - * @description - * Specify custom behavior on blur event. - * - * A [blur event](https://developer.mozilla.org/en-US/docs/Web/Events/blur) fires when - * an element has lost focus. - * - * Note: As the `blur` event is executed synchronously also during DOM manipulations - * (e.g. removing a focussed input), - * AngularJS executes the expression using `scope.$evalAsync` if the event is fired - * during an `$apply` to ensure a consistent state. - * - * @param {expression} ngBlur {@link guide/expression Expression} to evaluate upon - * blur. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - * See {@link ng.directive:ngClick ngClick} - */ - - /** - * @ngdoc directive - * @name ngCopy - * @restrict A - * @element window, input, select, textarea, a - * @priority 0 - * - * @description - * Specify custom behavior on copy event. - * - * @param {expression} ngCopy {@link guide/expression Expression} to evaluate upon - * copy. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - <example name="ng-copy"> - <file name="index.html"> - <input ng-copy="copied=true" ng-init="copied=false; value='copy me'" ng-model="value"> - copied: {{copied}} - </file> - </example> - */ - - /** - * @ngdoc directive - * @name ngCut - * @restrict A - * @element window, input, select, textarea, a - * @priority 0 - * - * @description - * Specify custom behavior on cut event. - * - * @param {expression} ngCut {@link guide/expression Expression} to evaluate upon - * cut. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - <example name="ng-cut"> - <file name="index.html"> - <input ng-cut="cut=true" ng-init="cut=false; value='cut me'" ng-model="value"> - cut: {{cut}} - </file> - </example> - */ - - /** - * @ngdoc directive - * @name ngPaste - * @restrict A - * @element window, input, select, textarea, a - * @priority 0 - * - * @description - * Specify custom behavior on paste event. - * - * @param {expression} ngPaste {@link guide/expression Expression} to evaluate upon - * paste. ({@link guide/expression#-event- Event object is available as `$event`}) - * - * @example - <example name="ng-paste"> - <file name="index.html"> - <input ng-paste="paste=true" ng-init="paste=false" placeholder='paste here'> - pasted: {{paste}} - </file> - </example> - */ - - /** - * @ngdoc directive - * @name ngIf - * @restrict A - * @multiElement - * - * @description - * The `ngIf` directive removes or recreates a portion of the DOM tree based on an - * {expression}. If the expression assigned to `ngIf` evaluates to a false - * value then the element is removed from the DOM, otherwise a clone of the - * element is reinserted into the DOM. - * - * `ngIf` differs from `ngShow` and `ngHide` in that `ngIf` completely removes and recreates the - * element in the DOM rather than changing its visibility via the `display` css property. A common - * case when this difference is significant is when using css selectors that rely on an element's - * position within the DOM, such as the `:first-child` or `:last-child` pseudo-classes. - * - * Note that when an element is removed using `ngIf` its scope is destroyed and a new scope - * is created when the element is restored. The scope created within `ngIf` inherits from - * its parent scope using - * [prototypal inheritance](https://github.com/angular/angular.js/wiki/Understanding-Scopes#javascript-prototypal-inheritance). - * An important implication of this is if `ngModel` is used within `ngIf` to bind to - * a javascript primitive defined in the parent scope. In this case any modifications made to the - * variable within the child scope will override (hide) the value in the parent scope. - * - * Also, `ngIf` recreates elements using their compiled state. An example of this behavior - * is if an element's class attribute is directly modified after it's compiled, using something like - * jQuery's `.addClass()` method, and the element is later removed. When `ngIf` recreates the element - * the added class will be lost because the original compiled state is used to regenerate the element. - * - * Additionally, you can provide animations via the `ngAnimate` module to animate the `enter` - * and `leave` effects. - * - * @animations - * | Animation | Occurs | - * |----------------------------------|-------------------------------------| - * | {@link ng.$animate#enter enter} | just after the `ngIf` contents change and a new DOM element is created and injected into the `ngIf` container | - * | {@link ng.$animate#leave leave} | just before the `ngIf` contents are removed from the DOM | - * - * @element ANY - * @scope - * @priority 600 - * @param {expression} ngIf If the {@link guide/expression expression} is falsy then - * the element is removed from the DOM tree. If it is truthy a copy of the compiled - * element is added to the DOM tree. - * - * @example - <example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-if"> - <file name="index.html"> - <label>Click me: <input type="checkbox" ng-model="checked" ng-init="checked=true" /></label><br/> - Show when checked: - <span ng-if="checked" class="animate-if"> - This is removed when the checkbox is unchecked. - </span> - </file> - <file name="animations.css"> - .animate-if { - background:white; - border:1px solid black; - padding:10px; - } - - .animate-if.ng-enter, .animate-if.ng-leave { - transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; - } - - .animate-if.ng-enter, - .animate-if.ng-leave.ng-leave-active { - opacity:0; - } - - .animate-if.ng-leave, - .animate-if.ng-enter.ng-enter-active { - opacity:1; - } - </file> - </example> - */ - var ngIfDirective = ['$animate', '$compile', function($animate, $compile) { - return { - multiElement: true, - transclude: 'element', - priority: 600, - terminal: true, - restrict: 'A', - $$tlb: true, - link: function($scope, $element, $attr, ctrl, $transclude) { - var block, childScope, previousElements; - $scope.$watch($attr.ngIf, function ngIfWatchAction(value) { - - if (value) { - if (!childScope) { - $transclude(function(clone, newScope) { - childScope = newScope; - clone[clone.length++] = $compile.$$createComment('end ngIf', $attr.ngIf); - // Note: We only need the first/last node of the cloned nodes. - // However, we need to keep the reference to the jqlite wrapper as it might be changed later - // by a directive with templateUrl when its template arrives. - block = { - clone: clone - }; - $animate.enter(clone, $element.parent(), $element); - }); - } - } else { - if (previousElements) { - previousElements.remove(); - previousElements = null; - } - if (childScope) { - childScope.$destroy(); - childScope = null; - } - if (block) { - previousElements = getBlockNodes(block.clone); - $animate.leave(previousElements).done(function(response) { - if (response !== false) previousElements = null; - }); - block = null; - } - } - }); - } - }; - }]; - - /** - * @ngdoc directive - * @name ngInclude - * @restrict ECA - * @scope - * @priority -400 - * - * @description - * Fetches, compiles and includes an external HTML fragment. - * - * By default, the template URL is restricted to the same domain and protocol as the - * application document. This is done by calling {@link $sce#getTrustedResourceUrl - * $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols - * you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist them} or - * {@link $sce#trustAsResourceUrl wrap them} as trusted values. Refer to AngularJS's {@link - * ng.$sce Strict Contextual Escaping}. - * - * In addition, the browser's - * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest) - * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/) - * policy may further restrict whether the template is successfully loaded. - * For example, `ngInclude` won't work for cross-domain requests on all browsers and for `file://` - * access on some browsers. - * - * @animations - * | Animation | Occurs | - * |----------------------------------|-------------------------------------| - * | {@link ng.$animate#enter enter} | when the expression changes, on the new include | - * | {@link ng.$animate#leave leave} | when the expression changes, on the old include | - * - * The enter and leave animation occur concurrently. - * - * @param {string} ngInclude|src AngularJS expression evaluating to URL. If the source is a string constant, - * make sure you wrap it in **single** quotes, e.g. `src="'myPartialTemplate.html'"`. - * @param {string=} onload Expression to evaluate when a new partial is loaded. - * <div class="alert alert-warning"> - * **Note:** When using onload on SVG elements in IE11, the browser will try to call - * a function with the name on the window element, which will usually throw a - * "function is undefined" error. To fix this, you can instead use `data-onload` or a - * different form that {@link guide/directive#normalization matches} `onload`. - * </div> - * - * @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll - * $anchorScroll} to scroll the viewport after the content is loaded. - * - * - If the attribute is not set, disable scrolling. - * - If the attribute is set without value, enable scrolling. - * - Otherwise enable scrolling only if the expression evaluates to truthy value. - * - * @example - <example module="includeExample" deps="angular-animate.js" animations="true" name="ng-include"> - <file name="index.html"> - <div ng-controller="ExampleController"> - <select ng-model="template" ng-options="t.name for t in templates"> - <option value="">(blank)</option> - </select> - url of the template: <code>{{template.url}}</code> - <hr/> - <div class="slide-animate-container"> - <div class="slide-animate" ng-include="template.url"></div> - </div> - </div> - </file> - <file name="script.js"> - angular.module('includeExample', ['ngAnimate']) - .controller('ExampleController', ['$scope', function($scope) { - $scope.templates = - [{ name: 'template1.html', url: 'template1.html'}, - { name: 'template2.html', url: 'template2.html'}]; - $scope.template = $scope.templates[0]; - }]); - </file> - <file name="template1.html"> - Content of template1.html - </file> - <file name="template2.html"> - Content of template2.html - </file> - <file name="animations.css"> - .slide-animate-container { - position:relative; - background:white; - border:1px solid black; - height:40px; - overflow:hidden; - } - - .slide-animate { - padding:10px; - } - - .slide-animate.ng-enter, .slide-animate.ng-leave { - transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; - - position:absolute; - top:0; - left:0; - right:0; - bottom:0; - display:block; - padding:10px; - } - - .slide-animate.ng-enter { - top:-50px; - } - .slide-animate.ng-enter.ng-enter-active { - top:0; - } - - .slide-animate.ng-leave { - top:0; - } - .slide-animate.ng-leave.ng-leave-active { - top:50px; - } - </file> - <file name="protractor.js" type="protractor"> - var templateSelect = element(by.model('template')); - var includeElem = element(by.css('[ng-include]')); - - it('should load template1.html', function() { - expect(includeElem.getText()).toMatch(/Content of template1.html/); - }); - - it('should load template2.html', function() { - if (browser.params.browser === 'firefox') { - // Firefox can't handle using selects - // See https://github.com/angular/protractor/issues/480 - return; - } - templateSelect.click(); - templateSelect.all(by.css('option')).get(2).click(); - expect(includeElem.getText()).toMatch(/Content of template2.html/); - }); - - it('should change to blank', function() { - if (browser.params.browser === 'firefox') { - // Firefox can't handle using selects - return; - } - templateSelect.click(); - templateSelect.all(by.css('option')).get(0).click(); - expect(includeElem.isPresent()).toBe(false); - }); - </file> - </example> - */ - - - /** - * @ngdoc event - * @name ngInclude#$includeContentRequested - * @eventType emit on the scope ngInclude was declared in - * @description - * Emitted every time the ngInclude content is requested. - * - * @param {Object} angularEvent Synthetic event object. - * @param {String} src URL of content to load. - */ - - - /** - * @ngdoc event - * @name ngInclude#$includeContentLoaded - * @eventType emit on the current ngInclude scope - * @description - * Emitted every time the ngInclude content is reloaded. - * - * @param {Object} angularEvent Synthetic event object. - * @param {String} src URL of content to load. - */ - - - /** - * @ngdoc event - * @name ngInclude#$includeContentError - * @eventType emit on the scope ngInclude was declared in - * @description - * Emitted when a template HTTP request yields an erroneous response (status < 200 || status > 299) - * - * @param {Object} angularEvent Synthetic event object. - * @param {String} src URL of content to load. - */ - var ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate', - function($templateRequest, $anchorScroll, $animate) { - return { - restrict: 'ECA', - priority: 400, - terminal: true, - transclude: 'element', - controller: angular.noop, - compile: function(element, attr) { - var srcExp = attr.ngInclude || attr.src, - onloadExp = attr.onload || '', - autoScrollExp = attr.autoscroll; - - return function(scope, $element, $attr, ctrl, $transclude) { - var changeCounter = 0, - currentScope, - previousElement, - currentElement; - - var cleanupLastIncludeContent = function() { - if (previousElement) { - previousElement.remove(); - previousElement = null; - } - if (currentScope) { - currentScope.$destroy(); - currentScope = null; - } - if (currentElement) { - $animate.leave(currentElement).done(function(response) { - if (response !== false) previousElement = null; - }); - previousElement = currentElement; - currentElement = null; - } - }; - - scope.$watch(srcExp, function ngIncludeWatchAction(src) { - var afterAnimation = function(response) { - if (response !== false && isDefined(autoScrollExp) && - (!autoScrollExp || scope.$eval(autoScrollExp))) { - $anchorScroll(); - } - }; - var thisChangeId = ++changeCounter; - - if (src) { - //set the 2nd param to true to ignore the template request error so that the inner - //contents and scope can be cleaned up. - $templateRequest(src, true).then(function(response) { - if (scope.$$destroyed) return; - - if (thisChangeId !== changeCounter) return; - var newScope = scope.$new(); - ctrl.template = response; - - // Note: This will also link all children of ng-include that were contained in the original - // html. If that content contains controllers, ... they could pollute/change the scope. - // However, using ng-include on an element with additional content does not make sense... - // Note: We can't remove them in the cloneAttchFn of $transclude as that - // function is called before linking the content, which would apply child - // directives to non existing elements. - var clone = $transclude(newScope, function(clone) { - cleanupLastIncludeContent(); - $animate.enter(clone, null, $element).done(afterAnimation); - }); - - currentScope = newScope; - currentElement = clone; - - currentScope.$emit('$includeContentLoaded', src); - scope.$eval(onloadExp); - }, function() { - if (scope.$$destroyed) return; - - if (thisChangeId === changeCounter) { - cleanupLastIncludeContent(); - scope.$emit('$includeContentError', src); - } - }); - scope.$emit('$includeContentRequested', src); - } else { - cleanupLastIncludeContent(); - ctrl.template = null; - } - }); - }; - } - }; - }]; - -// This directive is called during the $transclude call of the first `ngInclude` directive. -// It will replace and compile the content of the element with the loaded template. -// We need this directive so that the element content is already filled when -// the link function of another directive on the same element as ngInclude -// is called. - var ngIncludeFillContentDirective = ['$compile', - function($compile) { - return { - restrict: 'ECA', - priority: -400, - require: 'ngInclude', - link: function(scope, $element, $attr, ctrl) { - if (toString.call($element[0]).match(/SVG/)) { - // WebKit: https://bugs.webkit.org/show_bug.cgi?id=135698 --- SVG elements do not - // support innerHTML, so detect this here and try to generate the contents - // specially. - $element.empty(); - $compile(jqLiteBuildFragment(ctrl.template, window.document).childNodes)(scope, - function namespaceAdaptedClone(clone) { - $element.append(clone); - }, {futureParentElement: $element}); - return; - } - - $element.html(ctrl.template); - $compile($element.contents())(scope); - } - }; - }]; - - /** - * @ngdoc directive - * @name ngInit - * @restrict AC - * @priority 450 - * @element ANY - * - * @param {expression} ngInit {@link guide/expression Expression} to eval. - * - * @description - * The `ngInit` directive allows you to evaluate an expression in the - * current scope. - * - * <div class="alert alert-danger"> - * This directive can be abused to add unnecessary amounts of logic into your templates. - * There are only a few appropriate uses of `ngInit`: - * <ul> - * <li>aliasing special properties of {@link ng.directive:ngRepeat `ngRepeat`}, - * as seen in the demo below.</li> - * <li>initializing data during development, or for examples, as seen throughout these docs.</li> - * <li>injecting data via server side scripting.</li> - * </ul> - * - * Besides these few cases, you should use {@link guide/component Components} or - * {@link guide/controller Controllers} rather than `ngInit` to initialize values on a scope. - * </div> - * - * <div class="alert alert-warning"> - * **Note**: If you have assignment in `ngInit` along with a {@link ng.$filter `filter`}, make - * sure you have parentheses to ensure correct operator precedence: - * <pre class="prettyprint"> - * `<div ng-init="test1 = ($index | toString)"></div>` - * </pre> - * </div> - * - * @example - <example module="initExample" name="ng-init"> - <file name="index.html"> - <script> - angular.module('initExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.list = [['a', 'b'], ['c', 'd']]; - }]); - </script> - <div ng-controller="ExampleController"> - <div ng-repeat="innerList in list" ng-init="outerIndex = $index"> - <div ng-repeat="value in innerList" ng-init="innerIndex = $index"> - <span class="example-init">list[ {{outerIndex}} ][ {{innerIndex}} ] = {{value}};</span> - </div> - </div> - </div> - </file> - <file name="protractor.js" type="protractor"> - it('should alias index positions', function() { - var elements = element.all(by.css('.example-init')); - expect(elements.get(0).getText()).toBe('list[ 0 ][ 0 ] = a;'); - expect(elements.get(1).getText()).toBe('list[ 0 ][ 1 ] = b;'); - expect(elements.get(2).getText()).toBe('list[ 1 ][ 0 ] = c;'); - expect(elements.get(3).getText()).toBe('list[ 1 ][ 1 ] = d;'); - }); - </file> - </example> - */ - var ngInitDirective = ngDirective({ - priority: 450, - compile: function() { - return { - pre: function(scope, element, attrs) { - scope.$eval(attrs.ngInit); - } - }; - } - }); - - /** - * @ngdoc directive - * @name ngList - * @restrict A - * @priority 100 - * - * @param {string=} ngList optional delimiter that should be used to split the value. - * - * @description - * Text input that converts between a delimited string and an array of strings. The default - * delimiter is a comma followed by a space - equivalent to `ng-list=", "`. You can specify a custom - * delimiter as the value of the `ngList` attribute - for example, `ng-list=" | "`. - * - * The behaviour of the directive is affected by the use of the `ngTrim` attribute. - * * If `ngTrim` is set to `"false"` then whitespace around both the separator and each - * list item is respected. This implies that the user of the directive is responsible for - * dealing with whitespace but also allows you to use whitespace as a delimiter, such as a - * tab or newline character. - * * Otherwise whitespace around the delimiter is ignored when splitting (although it is respected - * when joining the list items back together) and whitespace around each list item is stripped - * before it is added to the model. - * - * @example - * ### Validation - * - * <example name="ngList-directive" module="listExample"> - * <file name="app.js"> - * angular.module('listExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.names = ['morpheus', 'neo', 'trinity']; - * }]); - * </file> - * <file name="index.html"> - * <form name="myForm" ng-controller="ExampleController"> - * <label>List: <input name="namesInput" ng-model="names" ng-list required></label> - * <span role="alert"> - * <span class="error" ng-show="myForm.namesInput.$error.required"> - * Required!</span> - * </span> - * <br> - * <tt>names = {{names}}</tt><br/> - * <tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/> - * <tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/> - * <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> - * <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/> - * </form> - * </file> - * <file name="protractor.js" type="protractor"> - * var listInput = element(by.model('names')); - * var names = element(by.exactBinding('names')); - * var valid = element(by.binding('myForm.namesInput.$valid')); - * var error = element(by.css('span.error')); - * - * it('should initialize to model', function() { - * expect(names.getText()).toContain('["morpheus","neo","trinity"]'); - * expect(valid.getText()).toContain('true'); - * expect(error.getCssValue('display')).toBe('none'); - * }); - * - * it('should be invalid if empty', function() { - * listInput.clear(); - * listInput.sendKeys(''); - * - * expect(names.getText()).toContain(''); - * expect(valid.getText()).toContain('false'); - * expect(error.getCssValue('display')).not.toBe('none'); - * }); - * </file> - * </example> - * - * @example - * ### Splitting on newline - * - * <example name="ngList-directive-newlines"> - * <file name="index.html"> - * <textarea ng-model="list" ng-list=" " ng-trim="false"></textarea> - * <pre>{{ list | json }}</pre> - * </file> - * <file name="protractor.js" type="protractor"> - * it("should split the text by newlines", function() { - * var listInput = element(by.model('list')); - * var output = element(by.binding('list | json')); - * listInput.sendKeys('abc\ndef\nghi'); - * expect(output.getText()).toContain('[\n "abc",\n "def",\n "ghi"\n]'); - * }); - * </file> - * </example> - * - */ - var ngListDirective = function() { - return { - restrict: 'A', - priority: 100, - require: 'ngModel', - link: function(scope, element, attr, ctrl) { - var ngList = attr.ngList || ', '; - var trimValues = attr.ngTrim !== 'false'; - var separator = trimValues ? trim(ngList) : ngList; - - var parse = function(viewValue) { - // If the viewValue is invalid (say required but empty) it will be `undefined` - if (isUndefined(viewValue)) return; - - var list = []; - - if (viewValue) { - forEach(viewValue.split(separator), function(value) { - if (value) list.push(trimValues ? trim(value) : value); - }); - } - - return list; - }; - - ctrl.$parsers.push(parse); - ctrl.$formatters.push(function(value) { - if (isArray(value)) { - return value.join(ngList); - } - - return undefined; - }); - - // Override the standard $isEmpty because an empty array means the input is empty. - ctrl.$isEmpty = function(value) { - return !value || !value.length; - }; - } - }; - }; - - /* global VALID_CLASS: true, - INVALID_CLASS: true, - PRISTINE_CLASS: true, - DIRTY_CLASS: true, - UNTOUCHED_CLASS: true, - TOUCHED_CLASS: true, - PENDING_CLASS: true, - addSetValidityMethod: true, - setupValidity: true, - defaultModelOptions: false -*/ - - - var VALID_CLASS = 'ng-valid', - INVALID_CLASS = 'ng-invalid', - PRISTINE_CLASS = 'ng-pristine', - DIRTY_CLASS = 'ng-dirty', - UNTOUCHED_CLASS = 'ng-untouched', - TOUCHED_CLASS = 'ng-touched', - EMPTY_CLASS = 'ng-empty', - NOT_EMPTY_CLASS = 'ng-not-empty'; - - var ngModelMinErr = minErr('ngModel'); - - /** - * @ngdoc type - * @name ngModel.NgModelController - * @property {*} $viewValue The actual value from the control's view. For `input` elements, this is a - * String. See {@link ngModel.NgModelController#$setViewValue} for information about when the $viewValue - * is set. - * - * @property {*} $modelValue The value in the model that the control is bound to. - * - * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever - * the control updates the ngModelController with a new {@link ngModel.NgModelController#$viewValue - `$viewValue`} from the DOM, usually via user input. - See {@link ngModel.NgModelController#$setViewValue `$setViewValue()`} for a detailed lifecycle explanation. - Note that the `$parsers` are not called when the bound ngModel expression changes programmatically. - - The functions are called in array order, each passing - its return value through to the next. The last return value is forwarded to the - {@link ngModel.NgModelController#$validators `$validators`} collection. - - Parsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue - `$viewValue`}. - - Returning `undefined` from a parser means a parse error occurred. In that case, - no {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel` - will be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`} - is set to `true`. The parse error is stored in `ngModel.$error.parse`. - - This simple example shows a parser that would convert text input value to lowercase: - * ```js - * function parse(value) { - * if (value) { - * return value.toLowerCase(); - * } - * } - * ngModelController.$parsers.push(parse); - * ``` - - * - * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever - the bound ngModel expression changes programmatically. The `$formatters` are not called when the - value of the control is changed by user interaction. - - Formatters are used to format / convert the {@link ngModel.NgModelController#$modelValue - `$modelValue`} for display in the control. - - The functions are called in reverse array order, each passing the value through to the - next. The last return value is used as the actual DOM value. - - This simple example shows a formatter that would convert the model value to uppercase: - - * ```js - * function format(value) { - * if (value) { - * return value.toUpperCase(); - * } - * } - * ngModel.$formatters.push(format); - * ``` - * - * @property {Object.<string, function>} $validators A collection of validators that are applied - * whenever the model value changes. The key value within the object refers to the name of the - * validator while the function refers to the validation operation. The validation operation is - * provided with the model value as an argument and must return a true or false value depending - * on the response of that validation. - * - * ```js - * ngModel.$validators.validCharacters = function(modelValue, viewValue) { - * var value = modelValue || viewValue; - * return /[0-9]+/.test(value) && - * /[a-z]+/.test(value) && - * /[A-Z]+/.test(value) && - * /\W+/.test(value); - * }; - * ``` - * - * @property {Object.<string, function>} $asyncValidators A collection of validations that are expected to - * perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided - * is expected to return a promise when it is run during the model validation process. Once the promise - * is delivered then the validation status will be set to true when fulfilled and false when rejected. - * When the asynchronous validators are triggered, each of the validators will run in parallel and the model - * value will only be updated once all validators have been fulfilled. As long as an asynchronous validator - * is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators - * will only run once all synchronous validators have passed. - * - * Please note that if $http is used then it is important that the server returns a success HTTP response code - * in order to fulfill the validation and a status level of `4xx` in order to reject the validation. - * - * ```js - * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) { - * var value = modelValue || viewValue; - * - * // Lookup user by username - * return $http.get('/api/users/' + value). - * then(function resolved() { - * //username exists, this means validation fails - * return $q.reject('exists'); - * }, function rejected() { - * //username does not exist, therefore this validation passes - * return true; - * }); - * }; - * ``` - * - * @property {Array.<Function>} $viewChangeListeners Array of functions to execute whenever - * a change to {@link ngModel.NgModelController#$viewValue `$viewValue`} has caused a change - * to {@link ngModel.NgModelController#$modelValue `$modelValue`}. - * It is called with no arguments, and its return value is ignored. - * This can be used in place of additional $watches against the model value. - * - * @property {Object} $error An object hash with all failing validator ids as keys. - * @property {Object} $pending An object hash with all pending validator ids as keys. - * - * @property {boolean} $untouched True if control has not lost focus yet. - * @property {boolean} $touched True if control has lost focus. - * @property {boolean} $pristine True if user has not interacted with the control yet. - * @property {boolean} $dirty True if user has already interacted with the control. - * @property {boolean} $valid True if there is no error. - * @property {boolean} $invalid True if at least one error on the control. - * @property {string} $name The name attribute of the control. - * - * @description - * - * `NgModelController` provides API for the {@link ngModel `ngModel`} directive. - * The controller contains services for data-binding, validation, CSS updates, and value formatting - * and parsing. It purposefully does not contain any logic which deals with DOM rendering or - * listening to DOM events. - * Such DOM related logic should be provided by other directives which make use of - * `NgModelController` for data-binding to control elements. - * AngularJS provides this DOM logic for most {@link input `input`} elements. - * At the end of this page you can find a {@link ngModel.NgModelController#custom-control-example - * custom control example} that uses `ngModelController` to bind to `contenteditable` elements. - * - * @example - * ### Custom Control Example - * This example shows how to use `NgModelController` with a custom control to achieve - * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`) - * collaborate together to achieve the desired result. - * - * `contenteditable` is an HTML5 attribute, which tells the browser to let the element - * contents be edited in place by the user. - * - * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize} - * module to automatically remove "bad" content like inline event listener (e.g. `<span onclick="...">`). - * However, as we are using `$sce` the model can still decide to provide unsafe content if it marks - * that content using the `$sce` service. - * - * <example name="NgModelController" module="customControl" deps="angular-sanitize.js"> - <file name="style.css"> - [contenteditable] { - border: 1px solid black; - background-color: white; - min-height: 20px; - } - - .ng-invalid { - border: 1px solid red; - } - - </file> - <file name="script.js"> - angular.module('customControl', ['ngSanitize']). - directive('contenteditable', ['$sce', function($sce) { - return { - restrict: 'A', // only activate on element attribute - require: '?ngModel', // get a hold of NgModelController - link: function(scope, element, attrs, ngModel) { - if (!ngModel) return; // do nothing if no ng-model - - // Specify how UI should be updated - ngModel.$render = function() { - element.html($sce.getTrustedHtml(ngModel.$viewValue || '')); - }; - - // Listen for change events to enable binding - element.on('blur keyup change', function() { - scope.$evalAsync(read); - }); - read(); // initialize - - // Write data to the model - function read() { - var html = element.html(); - // When we clear the content editable the browser leaves a <br> behind - // If strip-br attribute is provided then we strip this out - if (attrs.stripBr && html === '<br>') { - html = ''; - } - ngModel.$setViewValue(html); - } - } - }; - }]); - </file> - <file name="index.html"> - <form name="myForm"> - <div contenteditable - name="myWidget" ng-model="userContent" - strip-br="true" - required>Change me!</div> - <span ng-show="myForm.myWidget.$error.required">Required!</span> - <hr> - <textarea ng-model="userContent" aria-label="Dynamic textarea"></textarea> - </form> - </file> - <file name="protractor.js" type="protractor"> - it('should data-bind and become invalid', function() { - if (browser.params.browser === 'safari' || browser.params.browser === 'firefox') { - // SafariDriver can't handle contenteditable - // and Firefox driver can't clear contenteditables very well - return; - } - var contentEditable = element(by.css('[contenteditable]')); - var content = 'Change me!'; - - expect(contentEditable.getText()).toEqual(content); - - contentEditable.clear(); - contentEditable.sendKeys(protractor.Key.BACK_SPACE); - expect(contentEditable.getText()).toEqual(''); - expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/); - }); - </file> - * </example> - * - * - */ - NgModelController.$inject = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$q', '$interpolate']; - function NgModelController($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $q, $interpolate) { - this.$viewValue = Number.NaN; - this.$modelValue = Number.NaN; - this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity. - this.$validators = {}; - this.$asyncValidators = {}; - this.$parsers = []; - this.$formatters = []; - this.$viewChangeListeners = []; - this.$untouched = true; - this.$touched = false; - this.$pristine = true; - this.$dirty = false; - this.$valid = true; - this.$invalid = false; - this.$error = {}; // keep invalid keys here - this.$$success = {}; // keep valid keys here - this.$pending = undefined; // keep pending keys here - this.$name = $interpolate($attr.name || '', false)($scope); - this.$$parentForm = nullFormCtrl; - this.$options = defaultModelOptions; - this.$$updateEvents = ''; - // Attach the correct context to the event handler function for updateOn - this.$$updateEventHandler = this.$$updateEventHandler.bind(this); - - this.$$parsedNgModel = $parse($attr.ngModel); - this.$$parsedNgModelAssign = this.$$parsedNgModel.assign; - this.$$ngModelGet = this.$$parsedNgModel; - this.$$ngModelSet = this.$$parsedNgModelAssign; - this.$$pendingDebounce = null; - this.$$parserValid = undefined; - - this.$$currentValidationRunId = 0; - - // https://github.com/angular/angular.js/issues/15833 - // Prevent `$$scope` from being iterated over by `copy` when NgModelController is deep watched - Object.defineProperty(this, '$$scope', {value: $scope}); - this.$$attr = $attr; - this.$$element = $element; - this.$$animate = $animate; - this.$$timeout = $timeout; - this.$$parse = $parse; - this.$$q = $q; - this.$$exceptionHandler = $exceptionHandler; - - setupValidity(this); - setupModelWatcher(this); - } - - NgModelController.prototype = { - $$initGetterSetters: function() { - if (this.$options.getOption('getterSetter')) { - var invokeModelGetter = this.$$parse(this.$$attr.ngModel + '()'), - invokeModelSetter = this.$$parse(this.$$attr.ngModel + '($$$p)'); - - this.$$ngModelGet = function($scope) { - var modelValue = this.$$parsedNgModel($scope); - if (isFunction(modelValue)) { - modelValue = invokeModelGetter($scope); - } - return modelValue; - }; - this.$$ngModelSet = function($scope, newValue) { - if (isFunction(this.$$parsedNgModel($scope))) { - invokeModelSetter($scope, {$$$p: newValue}); - } else { - this.$$parsedNgModelAssign($scope, newValue); - } - }; - } else if (!this.$$parsedNgModel.assign) { - throw ngModelMinErr('nonassign', 'Expression \'{0}\' is non-assignable. Element: {1}', - this.$$attr.ngModel, startingTag(this.$$element)); - } - }, - - - /** - * @ngdoc method - * @name ngModel.NgModelController#$render - * - * @description - * Called when the view needs to be updated. It is expected that the user of the ng-model - * directive will implement this method. - * - * The `$render()` method is invoked in the following situations: - * - * * `$rollbackViewValue()` is called. If we are rolling back the view value to the last - * committed value then `$render()` is called to update the input control. - * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and - * the `$viewValue` are different from last time. - * - * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of - * `$modelValue` and `$viewValue` are actually different from their previous values. If `$modelValue` - * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be - * invoked if you only change a property on the objects. - */ - $render: noop, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$isEmpty - * - * @description - * This is called when we need to determine if the value of an input is empty. - * - * For instance, the required directive does this to work out if the input has data or not. - * - * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`. - * - * You can override this for input directives whose concept of being empty is different from the - * default. The `checkboxInputType` directive does this because in its case a value of `false` - * implies empty. - * - * @param {*} value The value of the input to check for emptiness. - * @returns {boolean} True if `value` is "empty". - */ - $isEmpty: function(value) { - // eslint-disable-next-line no-self-compare - return isUndefined(value) || value === '' || value === null || value !== value; - }, - - $$updateEmptyClasses: function(value) { - if (this.$isEmpty(value)) { - this.$$animate.removeClass(this.$$element, NOT_EMPTY_CLASS); - this.$$animate.addClass(this.$$element, EMPTY_CLASS); - } else { - this.$$animate.removeClass(this.$$element, EMPTY_CLASS); - this.$$animate.addClass(this.$$element, NOT_EMPTY_CLASS); - } - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setPristine - * - * @description - * Sets the control to its pristine state. - * - * This method can be called to remove the `ng-dirty` class and set the control to its pristine - * state (`ng-pristine` class). A model is considered to be pristine when the control - * has not been changed from when first compiled. - */ - $setPristine: function() { - this.$dirty = false; - this.$pristine = true; - this.$$animate.removeClass(this.$$element, DIRTY_CLASS); - this.$$animate.addClass(this.$$element, PRISTINE_CLASS); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setDirty - * - * @description - * Sets the control to its dirty state. - * - * This method can be called to remove the `ng-pristine` class and set the control to its dirty - * state (`ng-dirty` class). A model is considered to be dirty when the control has been changed - * from when first compiled. - */ - $setDirty: function() { - this.$dirty = true; - this.$pristine = false; - this.$$animate.removeClass(this.$$element, PRISTINE_CLASS); - this.$$animate.addClass(this.$$element, DIRTY_CLASS); - this.$$parentForm.$setDirty(); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setUntouched - * - * @description - * Sets the control to its untouched state. - * - * This method can be called to remove the `ng-touched` class and set the control to its - * untouched state (`ng-untouched` class). Upon compilation, a model is set as untouched - * by default, however this function can be used to restore that state if the model has - * already been touched by the user. - */ - $setUntouched: function() { - this.$touched = false; - this.$untouched = true; - this.$$animate.setClass(this.$$element, UNTOUCHED_CLASS, TOUCHED_CLASS); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setTouched - * - * @description - * Sets the control to its touched state. - * - * This method can be called to remove the `ng-untouched` class and set the control to its - * touched state (`ng-touched` class). A model is considered to be touched when the user has - * first focused the control element and then shifted focus away from the control (blur event). - */ - $setTouched: function() { - this.$touched = true; - this.$untouched = false; - this.$$animate.setClass(this.$$element, TOUCHED_CLASS, UNTOUCHED_CLASS); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$rollbackViewValue - * - * @description - * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`, - * which may be caused by a pending debounced event or because the input is waiting for some - * future event. - * - * If you have an input that uses `ng-model-options` to set up debounced updates or updates that - * depend on special events such as `blur`, there can be a period when the `$viewValue` is out of - * sync with the ngModel's `$modelValue`. - * - * In this case, you can use `$rollbackViewValue()` to manually cancel the debounced / future update - * and reset the input to the last committed view value. - * - * It is also possible that you run into difficulties if you try to update the ngModel's `$modelValue` - * programmatically before these debounced/future events have resolved/occurred, because AngularJS's - * dirty checking mechanism is not able to tell whether the model has actually changed or not. - * - * The `$rollbackViewValue()` method should be called before programmatically changing the model of an - * input which may have such events pending. This is important in order to make sure that the - * input field will be updated with the new model value and any pending operations are cancelled. - * - * @example - * <example name="ng-model-cancel-update" module="cancel-update-example"> - * <file name="app.js"> - * angular.module('cancel-update-example', []) - * - * .controller('CancelUpdateController', ['$scope', function($scope) { - * $scope.model = {value1: '', value2: ''}; - * - * $scope.setEmpty = function(e, value, rollback) { - * if (e.keyCode === 27) { - * e.preventDefault(); - * if (rollback) { - * $scope.myForm[value].$rollbackViewValue(); - * } - * $scope.model[value] = ''; - * } - * }; - * }]); - * </file> - * <file name="index.html"> - * <div ng-controller="CancelUpdateController"> - * <p>Both of these inputs are only updated if they are blurred. Hitting escape should - * empty them. Follow these steps and observe the difference:</p> - * <ol> - * <li>Type something in the input. You will see that the model is not yet updated</li> - * <li>Press the Escape key. - * <ol> - * <li> In the first example, nothing happens, because the model is already '', and no - * update is detected. If you blur the input, the model will be set to the current view. - * </li> - * <li> In the second example, the pending update is cancelled, and the input is set back - * to the last committed view value (''). Blurring the input does nothing. - * </li> - * </ol> - * </li> - * </ol> - * - * <form name="myForm" ng-model-options="{ updateOn: 'blur' }"> - * <div> - * <p id="inputDescription1">Without $rollbackViewValue():</p> - * <input name="value1" aria-describedby="inputDescription1" ng-model="model.value1" - * ng-keydown="setEmpty($event, 'value1')"> - * value1: "{{ model.value1 }}" - * </div> - * - * <div> - * <p id="inputDescription2">With $rollbackViewValue():</p> - * <input name="value2" aria-describedby="inputDescription2" ng-model="model.value2" - * ng-keydown="setEmpty($event, 'value2', true)"> - * value2: "{{ model.value2 }}" - * </div> - * </form> - * </div> - * </file> - <file name="style.css"> - div { - display: table-cell; - } - div:nth-child(1) { - padding-right: 30px; - } - - </file> - * </example> - */ - $rollbackViewValue: function() { - this.$$timeout.cancel(this.$$pendingDebounce); - this.$viewValue = this.$$lastCommittedViewValue; - this.$render(); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$validate - * - * @description - * Runs each of the registered validators (first synchronous validators and then - * asynchronous validators). - * If the validity changes to invalid, the model will be set to `undefined`, - * unless {@link ngModelOptions `ngModelOptions.allowInvalid`} is `true`. - * If the validity changes to valid, it will set the model to the last available valid - * `$modelValue`, i.e. either the last parsed value or the last value set from the scope. - */ - $validate: function() { - // ignore $validate before model is initialized - if (isNumberNaN(this.$modelValue)) { - return; - } - - var viewValue = this.$$lastCommittedViewValue; - // Note: we use the $$rawModelValue as $modelValue might have been - // set to undefined during a view -> model update that found validation - // errors. We can't parse the view here, since that could change - // the model although neither viewValue nor the model on the scope changed - var modelValue = this.$$rawModelValue; - - var prevValid = this.$valid; - var prevModelValue = this.$modelValue; - - var allowInvalid = this.$options.getOption('allowInvalid'); - - var that = this; - this.$$runValidators(modelValue, viewValue, function(allValid) { - // If there was no change in validity, don't update the model - // This prevents changing an invalid modelValue to undefined - if (!allowInvalid && prevValid !== allValid) { - // Note: Don't check this.$valid here, as we could have - // external validators (e.g. calculated on the server), - // that just call $setValidity and need the model value - // to calculate their validity. - that.$modelValue = allValid ? modelValue : undefined; - - if (that.$modelValue !== prevModelValue) { - that.$$writeModelToScope(); - } - } - }); - }, - - $$runValidators: function(modelValue, viewValue, doneCallback) { - this.$$currentValidationRunId++; - var localValidationRunId = this.$$currentValidationRunId; - var that = this; - - // check parser error - if (!processParseErrors()) { - validationDone(false); - return; - } - if (!processSyncValidators()) { - validationDone(false); - return; - } - processAsyncValidators(); - - function processParseErrors() { - var errorKey = that.$$parserName || 'parse'; - if (isUndefined(that.$$parserValid)) { - setValidity(errorKey, null); - } else { - if (!that.$$parserValid) { - forEach(that.$validators, function(v, name) { - setValidity(name, null); - }); - forEach(that.$asyncValidators, function(v, name) { - setValidity(name, null); - }); - } - // Set the parse error last, to prevent unsetting it, should a $validators key == parserName - setValidity(errorKey, that.$$parserValid); - return that.$$parserValid; - } - return true; - } - - function processSyncValidators() { - var syncValidatorsValid = true; - forEach(that.$validators, function(validator, name) { - var result = Boolean(validator(modelValue, viewValue)); - syncValidatorsValid = syncValidatorsValid && result; - setValidity(name, result); - }); - if (!syncValidatorsValid) { - forEach(that.$asyncValidators, function(v, name) { - setValidity(name, null); - }); - return false; - } - return true; - } - - function processAsyncValidators() { - var validatorPromises = []; - var allValid = true; - forEach(that.$asyncValidators, function(validator, name) { - var promise = validator(modelValue, viewValue); - if (!isPromiseLike(promise)) { - throw ngModelMinErr('nopromise', - 'Expected asynchronous validator to return a promise but got \'{0}\' instead.', promise); - } - setValidity(name, undefined); - validatorPromises.push(promise.then(function() { - setValidity(name, true); - }, function() { - allValid = false; - setValidity(name, false); - })); - }); - if (!validatorPromises.length) { - validationDone(true); - } else { - that.$$q.all(validatorPromises).then(function() { - validationDone(allValid); - }, noop); - } - } - - function setValidity(name, isValid) { - if (localValidationRunId === that.$$currentValidationRunId) { - that.$setValidity(name, isValid); - } - } - - function validationDone(allValid) { - if (localValidationRunId === that.$$currentValidationRunId) { - - doneCallback(allValid); - } - } - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$commitViewValue - * - * @description - * Commit a pending update to the `$modelValue`. - * - * Updates may be pending by a debounced event or because the input is waiting for a some future - * event defined in `ng-model-options`. this method is rarely needed as `NgModelController` - * usually handles calling this in response to input events. - */ - $commitViewValue: function() { - var viewValue = this.$viewValue; - - this.$$timeout.cancel(this.$$pendingDebounce); - - // If the view value has not changed then we should just exit, except in the case where there is - // a native validator on the element. In this case the validation state may have changed even though - // the viewValue has stayed empty. - if (this.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !this.$$hasNativeValidators)) { - return; - } - this.$$updateEmptyClasses(viewValue); - this.$$lastCommittedViewValue = viewValue; - - // change to dirty - if (this.$pristine) { - this.$setDirty(); - } - this.$$parseAndValidate(); - }, - - $$parseAndValidate: function() { - var viewValue = this.$$lastCommittedViewValue; - var modelValue = viewValue; - var that = this; - - this.$$parserValid = isUndefined(modelValue) ? undefined : true; - - if (this.$$parserValid) { - for (var i = 0; i < this.$parsers.length; i++) { - modelValue = this.$parsers[i](modelValue); - if (isUndefined(modelValue)) { - this.$$parserValid = false; - break; - } - } - } - if (isNumberNaN(this.$modelValue)) { - // this.$modelValue has not been touched yet... - this.$modelValue = this.$$ngModelGet(this.$$scope); - } - var prevModelValue = this.$modelValue; - var allowInvalid = this.$options.getOption('allowInvalid'); - this.$$rawModelValue = modelValue; - - if (allowInvalid) { - this.$modelValue = modelValue; - writeToModelIfNeeded(); - } - - // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date. - // This can happen if e.g. $setViewValue is called from inside a parser - this.$$runValidators(modelValue, this.$$lastCommittedViewValue, function(allValid) { - if (!allowInvalid) { - // Note: Don't check this.$valid here, as we could have - // external validators (e.g. calculated on the server), - // that just call $setValidity and need the model value - // to calculate their validity. - that.$modelValue = allValid ? modelValue : undefined; - writeToModelIfNeeded(); - } - }); - - function writeToModelIfNeeded() { - if (that.$modelValue !== prevModelValue) { - that.$$writeModelToScope(); - } - } - }, - - $$writeModelToScope: function() { - this.$$ngModelSet(this.$$scope, this.$modelValue); - forEach(this.$viewChangeListeners, function(listener) { - try { - listener(); - } catch (e) { - // eslint-disable-next-line no-invalid-this - this.$$exceptionHandler(e); - } - }, this); - }, - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setViewValue - * - * @description - * Update the view value. - * - * This method should be called when a control wants to change the view value; typically, - * this is done from within a DOM event handler. For example, the {@link ng.directive:input input} - * directive calls it when the value of the input changes and {@link ng.directive:select select} - * calls it when an option is selected. - * - * When `$setViewValue` is called, the new `value` will be staged for committing through the `$parsers` - * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged - * value is sent directly for processing through the `$parsers` pipeline. After this, the `$validators` and - * `$asyncValidators` are called and the value is applied to `$modelValue`. - * Finally, the value is set to the **expression** specified in the `ng-model` attribute and - * all the registered change listeners, in the `$viewChangeListeners` list are called. - * - * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn` - * and the `default` trigger is not listed, all those actions will remain pending until one of the - * `updateOn` events is triggered on the DOM element. - * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions} - * directive is used with a custom debounce for this particular event. - * Note that a `$digest` is only triggered once the `updateOn` events are fired, or if `debounce` - * is specified, once the timer runs out. - * - * When used with standard inputs, the view value will always be a string (which is in some cases - * parsed into another type, such as a `Date` object for `input[date]`.) - * However, custom controls might also pass objects to this method. In this case, we should make - * a copy of the object before passing it to `$setViewValue`. This is because `ngModel` does not - * perform a deep watch of objects, it only looks for a change of identity. If you only change - * the property of the object then ngModel will not realize that the object has changed and - * will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should - * not change properties of the copy once it has been passed to `$setViewValue`. - * Otherwise you may cause the model value on the scope to change incorrectly. - * - * <div class="alert alert-info"> - * In any case, the value passed to the method should always reflect the current value - * of the control. For example, if you are calling `$setViewValue` for an input element, - * you should pass the input DOM value. Otherwise, the control and the scope model become - * out of sync. It's also important to note that `$setViewValue` does not call `$render` or change - * the control's DOM value in any way. If we want to change the control's DOM value - * programmatically, we should update the `ngModel` scope expression. Its new value will be - * picked up by the model controller, which will run it through the `$formatters`, `$render` it - * to update the DOM, and finally call `$validate` on it. - * </div> - * - * @param {*} value value from the view. - * @param {string} trigger Event that triggered the update. - */ - $setViewValue: function(value, trigger) { - this.$viewValue = value; - if (this.$options.getOption('updateOnDefault')) { - this.$$debounceViewValueCommit(trigger); - } - }, - - $$debounceViewValueCommit: function(trigger) { - var debounceDelay = this.$options.getOption('debounce'); - - if (isNumber(debounceDelay[trigger])) { - debounceDelay = debounceDelay[trigger]; - } else if (isNumber(debounceDelay['default'])) { - debounceDelay = debounceDelay['default']; - } - - this.$$timeout.cancel(this.$$pendingDebounce); - var that = this; - if (debounceDelay > 0) { // this fails if debounceDelay is an object - this.$$pendingDebounce = this.$$timeout(function() { - that.$commitViewValue(); - }, debounceDelay); - } else if (this.$$scope.$root.$$phase) { - this.$commitViewValue(); - } else { - this.$$scope.$apply(function() { - that.$commitViewValue(); - }); - } - }, - - /** - * @ngdoc method - * - * @name ngModel.NgModelController#$overrideModelOptions - * - * @description - * - * Override the current model options settings programmatically. - * - * The previous `ModelOptions` value will not be modified. Instead, a - * new `ModelOptions` object will inherit from the previous one overriding - * or inheriting settings that are defined in the given parameter. - * - * See {@link ngModelOptions} for information about what options can be specified - * and how model option inheritance works. - * - * <div class="alert alert-warning"> - * **Note:** this function only affects the options set on the `ngModelController`, - * and not the options on the {@link ngModelOptions} directive from which they might have been - * obtained initially. - * </div> - * - * <div class="alert alert-danger"> - * **Note:** it is not possible to override the `getterSetter` option. - * </div> - * - * @param {Object} options a hash of settings to override the previous options - * - */ - $overrideModelOptions: function(options) { - this.$options = this.$options.createChild(options); - this.$$setUpdateOnEvents(); - }, - - /** - * @ngdoc method - * - * @name ngModel.NgModelController#$processModelValue - - * @description - * - * Runs the model -> view pipeline on the current - * {@link ngModel.NgModelController#$modelValue $modelValue}. - * - * The following actions are performed by this method: - * - * - the `$modelValue` is run through the {@link ngModel.NgModelController#$formatters $formatters} - * and the result is set to the {@link ngModel.NgModelController#$viewValue $viewValue} - * - the `ng-empty` or `ng-not-empty` class is set on the element - * - if the `$viewValue` has changed: - * - {@link ngModel.NgModelController#$render $render} is called on the control - * - the {@link ngModel.NgModelController#$validators $validators} are run and - * the validation status is set. - * - * This method is called by ngModel internally when the bound scope value changes. - * Application developers usually do not have to call this function themselves. - * - * This function can be used when the `$viewValue` or the rendered DOM value are not correctly - * formatted and the `$modelValue` must be run through the `$formatters` again. - * - * @example - * Consider a text input with an autocomplete list (for fruit), where the items are - * objects with a name and an id. - * A user enters `ap` and then selects `Apricot` from the list. - * Based on this, the autocomplete widget will call `$setViewValue({name: 'Apricot', id: 443})`, - * but the rendered value will still be `ap`. - * The widget can then call `ctrl.$processModelValue()` to run the model -> view - * pipeline again, which formats the object to the string `Apricot`, - * then updates the `$viewValue`, and finally renders it in the DOM. - * - * <example module="inputExample" name="ng-model-process"> - <file name="index.html"> - <div ng-controller="inputController" style="display: flex;"> - <div style="margin-right: 30px;"> - Search Fruit: - <basic-autocomplete items="items" on-select="selectedFruit = item"></basic-autocomplete> - </div> - <div> - Model:<br> - <pre>{{selectedFruit | json}}</pre> - </div> - </div> - </file> - <file name="app.js"> - angular.module('inputExample', []) - .controller('inputController', function($scope) { - $scope.items = [ - {name: 'Apricot', id: 443}, - {name: 'Clementine', id: 972}, - {name: 'Durian', id: 169}, - {name: 'Jackfruit', id: 982}, - {name: 'Strawberry', id: 863} - ]; - }) - .component('basicAutocomplete', { - bindings: { - items: '<', - onSelect: '&' - }, - templateUrl: 'autocomplete.html', - controller: function($element, $scope) { - var that = this; - var ngModel; - - that.$postLink = function() { - ngModel = $element.find('input').controller('ngModel'); - - ngModel.$formatters.push(function(value) { - return (value && value.name) || value; - }); - - ngModel.$parsers.push(function(value) { - var match = value; - for (var i = 0; i < that.items.length; i++) { - if (that.items[i].name === value) { - match = that.items[i]; - break; - } - } - - return match; - }); - }; - - that.selectItem = function(item) { - ngModel.$setViewValue(item); - ngModel.$processModelValue(); - that.onSelect({item: item}); - }; - } - }); - </file> - <file name="autocomplete.html"> - <div> - <input type="search" ng-model="$ctrl.searchTerm" /> - <ul> - <li ng-repeat="item in $ctrl.items | filter:$ctrl.searchTerm"> - <button ng-click="$ctrl.selectItem(item)">{{ item.name }}</button> - </li> - </ul> - </div> - </file> - * </example> - * - */ - $processModelValue: function() { - var viewValue = this.$$format(); - - if (this.$viewValue !== viewValue) { - this.$$updateEmptyClasses(viewValue); - this.$viewValue = this.$$lastCommittedViewValue = viewValue; - this.$render(); - // It is possible that model and view value have been updated during render - this.$$runValidators(this.$modelValue, this.$viewValue, noop); - } - }, - - /** - * This method is called internally to run the $formatters on the $modelValue - */ - $$format: function() { - var formatters = this.$formatters, - idx = formatters.length; - - var viewValue = this.$modelValue; - while (idx--) { - viewValue = formatters[idx](viewValue); - } - - return viewValue; - }, - - /** - * This method is called internally when the bound scope value changes. - */ - $$setModelValue: function(modelValue) { - this.$modelValue = this.$$rawModelValue = modelValue; - this.$$parserValid = undefined; - this.$processModelValue(); - }, - - $$setUpdateOnEvents: function() { - if (this.$$updateEvents) { - this.$$element.off(this.$$updateEvents, this.$$updateEventHandler); - } - - this.$$updateEvents = this.$options.getOption('updateOn'); - if (this.$$updateEvents) { - this.$$element.on(this.$$updateEvents, this.$$updateEventHandler); - } - }, - - $$updateEventHandler: function(ev) { - this.$$debounceViewValueCommit(ev && ev.type); - } - }; - - function setupModelWatcher(ctrl) { - // model -> value - // Note: we cannot use a normal scope.$watch as we want to detect the following: - // 1. scope value is 'a' - // 2. user enters 'b' - // 3. ng-change kicks in and reverts scope value to 'a' - // -> scope value did not change since the last digest as - // ng-change executes in apply phase - // 4. view should be changed back to 'a' - ctrl.$$scope.$watch(function ngModelWatch(scope) { - var modelValue = ctrl.$$ngModelGet(scope); - - // if scope model value and ngModel value are out of sync - // This cannot be moved to the action function, because it would not catch the - // case where the model is changed in the ngChange function or the model setter - if (modelValue !== ctrl.$modelValue && - // checks for NaN is needed to allow setting the model to NaN when there's an asyncValidator - // eslint-disable-next-line no-self-compare - (ctrl.$modelValue === ctrl.$modelValue || modelValue === modelValue) - ) { - ctrl.$$setModelValue(modelValue); - } - - return modelValue; - }); - } - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setValidity - * - * @description - * Change the validity state, and notify the form. - * - * This method can be called within $parsers/$formatters or a custom validation implementation. - * However, in most cases it should be sufficient to use the `ngModel.$validators` and - * `ngModel.$asyncValidators` collections which will call `$setValidity` automatically. - * - * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be assigned - * to either `$error[validationErrorKey]` or `$pending[validationErrorKey]` - * (for unfulfilled `$asyncValidators`), so that it is available for data-binding. - * The `validationErrorKey` should be in camelCase and will get converted into dash-case - * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error` - * classes and can be bound to as `{{ someForm.someControl.$error.myError }}`. - * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined), - * or skipped (null). Pending is used for unfulfilled `$asyncValidators`. - * Skipped is used by AngularJS when validators do not run because of parse errors and - * when `$asyncValidators` do not run because any of the `$validators` failed. - */ - addSetValidityMethod({ - clazz: NgModelController, - set: function(object, property) { - object[property] = true; - }, - unset: function(object, property) { - delete object[property]; - } - }); - - - /** - * @ngdoc directive - * @name ngModel - * @restrict A - * @priority 1 - * @param {expression} ngModel assignable {@link guide/expression Expression} to bind to. - * - * @description - * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a - * property on the scope using {@link ngModel.NgModelController NgModelController}, - * which is created and exposed by this directive. - * - * `ngModel` is responsible for: - * - * - Binding the view into the model, which other directives such as `input`, `textarea` or `select` - * require. - * - Providing validation behavior (i.e. required, number, email, url). - * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors). - * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`, - * `ng-untouched`, `ng-empty`, `ng-not-empty`) including animations. - * - Registering the control with its parent {@link ng.directive:form form}. - * - * Note: `ngModel` will try to bind to the property given by evaluating the expression on the - * current scope. If the property doesn't already exist on this scope, it will be created - * implicitly and added to the scope. - * - * For best practices on using `ngModel`, see: - * - * - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes) - * - * For basic examples, how to use `ngModel`, see: - * - * - {@link ng.directive:input input} - * - {@link input[text] text} - * - {@link input[checkbox] checkbox} - * - {@link input[radio] radio} - * - {@link input[number] number} - * - {@link input[email] email} - * - {@link input[url] url} - * - {@link input[date] date} - * - {@link input[datetime-local] datetime-local} - * - {@link input[time] time} - * - {@link input[month] month} - * - {@link input[week] week} - * - {@link ng.directive:select select} - * - {@link ng.directive:textarea textarea} - * - * ## Complex Models (objects or collections) - * - * By default, `ngModel` watches the model by reference, not value. This is important to know when - * binding inputs to models that are objects (e.g. `Date`) or collections (e.g. arrays). If only properties of the - * object or collection change, `ngModel` will not be notified and so the input will not be re-rendered. - * - * The model must be assigned an entirely new object or collection before a re-rendering will occur. - * - * Some directives have options that will cause them to use a custom `$watchCollection` on the model expression - * - for example, `ngOptions` will do so when a `track by` clause is included in the comprehension expression or - * if the select is given the `multiple` attribute. - * - * The `$watchCollection()` method only does a shallow comparison, meaning that changing properties deeper than the - * first level of the object (or only changing the properties of an item in the collection if it's an array) will still - * not trigger a re-rendering of the model. - * - * ## CSS classes - * The following CSS classes are added and removed on the associated input/select/textarea element - * depending on the validity of the model. - * - * - `ng-valid`: the model is valid - * - `ng-invalid`: the model is invalid - * - `ng-valid-[key]`: for each valid key added by `$setValidity` - * - `ng-invalid-[key]`: for each invalid key added by `$setValidity` - * - `ng-pristine`: the control hasn't been interacted with yet - * - `ng-dirty`: the control has been interacted with - * - `ng-touched`: the control has been blurred - * - `ng-untouched`: the control hasn't been blurred - * - `ng-pending`: any `$asyncValidators` are unfulfilled - * - `ng-empty`: the view does not contain a value or the value is deemed "empty", as defined - * by the {@link ngModel.NgModelController#$isEmpty} method - * - `ng-not-empty`: the view contains a non-empty value - * - * Keep in mind that ngAnimate can detect each of these classes when added and removed. - * - * @animations - * Animations within models are triggered when any of the associated CSS classes are added and removed - * on the input element which is attached to the model. These classes include: `.ng-pristine`, `.ng-dirty`, - * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself. - * The animations that are triggered within ngModel are similar to how they work in ngClass and - * animations can be hooked into using CSS transitions, keyframes as well as JS animations. - * - * The following example shows a simple way to utilize CSS transitions to style an input element - * that has been rendered as invalid after it has been validated: - * - * <pre> - * //be sure to include ngAnimate as a module to hook into more - * //advanced animations - * .my-input { - * transition:0.5s linear all; - * background: white; - * } - * .my-input.ng-invalid { - * background: red; - * color:white; - * } - * </pre> - * - * @example - * ### Basic Usage - * <example deps="angular-animate.js" animations="true" fixBase="true" module="inputExample" name="ng-model"> - <file name="index.html"> - <script> - angular.module('inputExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.val = '1'; - }]); - </script> - <style> - .my-input { - transition:all linear 0.5s; - background: transparent; - } - .my-input.ng-invalid { - color:white; - background: red; - } - </style> - <p id="inputDescription"> - Update input to see transitions when valid/invalid. - Integer is a valid value. - </p> - <form name="testForm" ng-controller="ExampleController"> - <input ng-model="val" ng-pattern="/^\d+$/" name="anim" class="my-input" - aria-describedby="inputDescription" /> - </form> - </file> - * </example> - * - * @example - * ### Binding to a getter/setter - * - * Sometimes it's helpful to bind `ngModel` to a getter/setter function. A getter/setter is a - * function that returns a representation of the model when called with zero arguments, and sets - * the internal state of a model when called with an argument. It's sometimes useful to use this - * for models that have an internal representation that's different from what the model exposes - * to the view. - * - * <div class="alert alert-success"> - * **Best Practice:** It's best to keep getters fast because AngularJS is likely to call them more - * frequently than other parts of your code. - * </div> - * - * You use this behavior by adding `ng-model-options="{ getterSetter: true }"` to an element that - * has `ng-model` attached to it. You can also add `ng-model-options="{ getterSetter: true }"` to - * a `<form>`, which will enable this behavior for all `<input>`s within it. See - * {@link ng.directive:ngModelOptions `ngModelOptions`} for more. - * - * The following example shows how to use `ngModel` with a getter/setter: - * - * @example - * <example name="ngModel-getter-setter" module="getterSetterExample"> - <file name="index.html"> - <div ng-controller="ExampleController"> - <form name="userForm"> - <label>Name: - <input type="text" name="userName" - ng-model="user.name" - ng-model-options="{ getterSetter: true }" /> - </label> - </form> - <pre>user.name = <span ng-bind="user.name()"></span></pre> - </div> - </file> - <file name="app.js"> - angular.module('getterSetterExample', []) - .controller('ExampleController', ['$scope', function($scope) { - var _name = 'Brian'; - $scope.user = { - name: function(newName) { - // Note that newName can be undefined for two reasons: - // 1. Because it is called as a getter and thus called with no arguments - // 2. Because the property should actually be set to undefined. This happens e.g. if the - // input is invalid - return arguments.length ? (_name = newName) : _name; - } - }; - }]); - </file> - * </example> - */ - var ngModelDirective = ['$rootScope', function($rootScope) { - return { - restrict: 'A', - require: ['ngModel', '^?form', '^?ngModelOptions'], - controller: NgModelController, - // Prelink needs to run before any input directive - // so that we can set the NgModelOptions in NgModelController - // before anyone else uses it. - priority: 1, - compile: function ngModelCompile(element) { - // Setup initial state of the control - element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS); - - return { - pre: function ngModelPreLink(scope, element, attr, ctrls) { - var modelCtrl = ctrls[0], - formCtrl = ctrls[1] || modelCtrl.$$parentForm, - optionsCtrl = ctrls[2]; - - if (optionsCtrl) { - modelCtrl.$options = optionsCtrl.$options; - } - - modelCtrl.$$initGetterSetters(); - - // notify others, especially parent forms - formCtrl.$addControl(modelCtrl); - - attr.$observe('name', function(newValue) { - if (modelCtrl.$name !== newValue) { - modelCtrl.$$parentForm.$$renameControl(modelCtrl, newValue); - } - }); - - scope.$on('$destroy', function() { - modelCtrl.$$parentForm.$removeControl(modelCtrl); - }); - }, - post: function ngModelPostLink(scope, element, attr, ctrls) { - var modelCtrl = ctrls[0]; - modelCtrl.$$setUpdateOnEvents(); - - function setTouched() { - modelCtrl.$setTouched(); - } - - element.on('blur', function() { - if (modelCtrl.$touched) return; - - if ($rootScope.$$phase) { - scope.$evalAsync(setTouched); - } else { - scope.$apply(setTouched); - } - }); - } - }; - } - }; - }]; - - /* exported defaultModelOptions */ - var defaultModelOptions; - var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/; - - /** - * @ngdoc type - * @name ModelOptions - * @description - * A container for the options set by the {@link ngModelOptions} directive - */ - function ModelOptions(options) { - this.$$options = options; - } - - ModelOptions.prototype = { - - /** - * @ngdoc method - * @name ModelOptions#getOption - * @param {string} name the name of the option to retrieve - * @returns {*} the value of the option - * @description - * Returns the value of the given option - */ - getOption: function(name) { - return this.$$options[name]; - }, - - /** - * @ngdoc method - * @name ModelOptions#createChild - * @param {Object} options a hash of options for the new child that will override the parent's options - * @return {ModelOptions} a new `ModelOptions` object initialized with the given options. - */ - createChild: function(options) { - var inheritAll = false; - - // make a shallow copy - options = extend({}, options); - - // Inherit options from the parent if specified by the value `"$inherit"` - forEach(options, /* @this */ function(option, key) { - if (option === '$inherit') { - if (key === '*') { - inheritAll = true; - } else { - options[key] = this.$$options[key]; - // `updateOn` is special so we must also inherit the `updateOnDefault` option - if (key === 'updateOn') { - options.updateOnDefault = this.$$options.updateOnDefault; - } - } - } else { - if (key === 'updateOn') { - // If the `updateOn` property contains the `default` event then we have to remove - // it from the event list and set the `updateOnDefault` flag. - options.updateOnDefault = false; - options[key] = trim(option.replace(DEFAULT_REGEXP, function() { - options.updateOnDefault = true; - return ' '; - })); - } - } - }, this); - - if (inheritAll) { - // We have a property of the form: `"*": "$inherit"` - delete options['*']; - defaults(options, this.$$options); - } - - // Finally add in any missing defaults - defaults(options, defaultModelOptions.$$options); - - return new ModelOptions(options); - } - }; - - - defaultModelOptions = new ModelOptions({ - updateOn: '', - updateOnDefault: true, - debounce: 0, - getterSetter: false, - allowInvalid: false, - timezone: null - }); - - - /** - * @ngdoc directive - * @name ngModelOptions - * @restrict A - * @priority 10 - * - * @description - * This directive allows you to modify the behaviour of {@link ngModel} directives within your - * application. You can specify an `ngModelOptions` directive on any element. All {@link ngModel} - * directives will use the options of their nearest `ngModelOptions` ancestor. - * - * The `ngModelOptions` settings are found by evaluating the value of the attribute directive as - * an AngularJS expression. This expression should evaluate to an object, whose properties contain - * the settings. For example: `<div ng-model-options="{ debounce: 100 }"`. - * - * ## Inheriting Options - * - * You can specify that an `ngModelOptions` setting should be inherited from a parent `ngModelOptions` - * directive by giving it the value of `"$inherit"`. - * Then it will inherit that setting from the first `ngModelOptions` directive found by traversing up the - * DOM tree. If there is no ancestor element containing an `ngModelOptions` directive then default settings - * will be used. - * - * For example given the following fragment of HTML - * - * - * ```html - * <div ng-model-options="{ allowInvalid: true, debounce: 200 }"> - * <form ng-model-options="{ updateOn: 'blur', allowInvalid: '$inherit' }"> - * <input ng-model-options="{ updateOn: 'default', allowInvalid: '$inherit' }" /> - * </form> - * </div> - * ``` - * - * the `input` element will have the following settings - * - * ```js - * { allowInvalid: true, updateOn: 'default', debounce: 0 } - * ``` - * - * Notice that the `debounce` setting was not inherited and used the default value instead. - * - * You can specify that all undefined settings are automatically inherited from an ancestor by - * including a property with key of `"*"` and value of `"$inherit"`. - * - * For example given the following fragment of HTML - * - * - * ```html - * <div ng-model-options="{ allowInvalid: true, debounce: 200 }"> - * <form ng-model-options="{ updateOn: 'blur', "*": '$inherit' }"> - * <input ng-model-options="{ updateOn: 'default', "*": '$inherit' }" /> - * </form> - * </div> - * ``` - * - * the `input` element will have the following settings - * - * ```js - * { allowInvalid: true, updateOn: 'default', debounce: 200 } - * ``` - * - * Notice that the `debounce` setting now inherits the value from the outer `<div>` element. - * - * If you are creating a reusable component then you should be careful when using `"*": "$inherit"` - * since you may inadvertently inherit a setting in the future that changes the behavior of your component. - * - * - * ## Triggering and debouncing model updates - * - * The `updateOn` and `debounce` properties allow you to specify a custom list of events that will - * trigger a model update and/or a debouncing delay so that the actual update only takes place when - * a timer expires; this timer will be reset after another change takes place. - * - * Given the nature of `ngModelOptions`, the value displayed inside input fields in the view might - * be different from the value in the actual model. This means that if you update the model you - * should also invoke {@link ngModel.NgModelController#$rollbackViewValue} on the relevant input field in - * order to make sure it is synchronized with the model and that any debounced action is canceled. - * - * The easiest way to reference the control's {@link ngModel.NgModelController#$rollbackViewValue} - * method is by making sure the input is placed inside a form that has a `name` attribute. This is - * important because `form` controllers are published to the related scope under the name in their - * `name` attribute. - * - * Any pending changes will take place immediately when an enclosing form is submitted via the - * `submit` event. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit` - * to have access to the updated model. - * - * ### Overriding immediate updates - * - * The following example shows how to override immediate updates. Changes on the inputs within the - * form will update the model only when the control loses focus (blur event). If `escape` key is - * pressed while the input field is focused, the value is reset to the value in the current model. - * - * <example name="ngModelOptions-directive-blur" module="optionsExample"> - * <file name="index.html"> - * <div ng-controller="ExampleController"> - * <form name="userForm"> - * <label> - * Name: - * <input type="text" name="userName" - * ng-model="user.name" - * ng-model-options="{ updateOn: 'blur' }" - * ng-keyup="cancel($event)" /> - * </label><br /> - * <label> - * Other data: - * <input type="text" ng-model="user.data" /> - * </label><br /> - * </form> - * <pre>user.name = <span ng-bind="user.name"></span></pre> - * </div> - * </file> - * <file name="app.js"> - * angular.module('optionsExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.user = { name: 'say', data: '' }; - * - * $scope.cancel = function(e) { - * if (e.keyCode === 27) { - * $scope.userForm.userName.$rollbackViewValue(); - * } - * }; - * }]); - * </file> - * <file name="protractor.js" type="protractor"> - * var model = element(by.binding('user.name')); - * var input = element(by.model('user.name')); - * var other = element(by.model('user.data')); - * - * it('should allow custom events', function() { - * input.sendKeys(' hello'); - * input.click(); - * expect(model.getText()).toEqual('say'); - * other.click(); - * expect(model.getText()).toEqual('say hello'); - * }); - * - * it('should $rollbackViewValue when model changes', function() { - * input.sendKeys(' hello'); - * expect(input.getAttribute('value')).toEqual('say hello'); - * input.sendKeys(protractor.Key.ESCAPE); - * expect(input.getAttribute('value')).toEqual('say'); - * other.click(); - * expect(model.getText()).toEqual('say'); - * }); - * </file> - * </example> - * - * ### Debouncing updates - * - * The next example shows how to debounce model changes. Model will be updated only 1 sec after last change. - * If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty. - * - * <example name="ngModelOptions-directive-debounce" module="optionsExample"> - * <file name="index.html"> - * <div ng-controller="ExampleController"> - * <form name="userForm"> - * Name: - * <input type="text" name="userName" - * ng-model="user.name" - * ng-model-options="{ debounce: 1000 }" /> - * <button ng-click="userForm.userName.$rollbackViewValue(); user.name=''">Clear</button><br /> - * </form> - * <pre>user.name = <span ng-bind="user.name"></span></pre> - * </div> - * </file> - * <file name="app.js"> - * angular.module('optionsExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.user = { name: 'say' }; - * }]); - * </file> - * </example> - * - * - * ## Model updates and validation - * - * The default behaviour in `ngModel` is that the model value is set to `undefined` when the - * validation determines that the value is invalid. By setting the `allowInvalid` property to true, - * the model will still be updated even if the value is invalid. - * - * - * ## Connecting to the scope - * - * By setting the `getterSetter` property to true you are telling ngModel that the `ngModel` expression - * on the scope refers to a "getter/setter" function rather than the value itself. - * - * The following example shows how to bind to getter/setters: - * - * <example name="ngModelOptions-directive-getter-setter" module="getterSetterExample"> - * <file name="index.html"> - * <div ng-controller="ExampleController"> - * <form name="userForm"> - * <label> - * Name: - * <input type="text" name="userName" - * ng-model="user.name" - * ng-model-options="{ getterSetter: true }" /> - * </label> - * </form> - * <pre>user.name = <span ng-bind="user.name()"></span></pre> - * </div> - * </file> - * <file name="app.js"> - * angular.module('getterSetterExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * var _name = 'Brian'; - * $scope.user = { - * name: function(newName) { - * return angular.isDefined(newName) ? (_name = newName) : _name; - * } - * }; - * }]); - * </file> - * </example> - * - * - * ## Specifying timezones - * - * You can specify the timezone that date/time input directives expect by providing its name in the - * `timezone` property. - * - * - * ## Programmatically changing options - * - * The `ngModelOptions` expression is only evaluated once when the directive is linked; it is not - * watched for changes. However, it is possible to override the options on a single - * {@link ngModel.NgModelController} instance with - * {@link ngModel.NgModelController#$overrideModelOptions `NgModelController#$overrideModelOptions()`}. - * - * - * @param {Object} ngModelOptions options to apply to {@link ngModel} directives on this element and - * and its descendents. Valid keys are: - * - `updateOn`: string specifying which event should the input be bound to. You can set several - * events using an space delimited list. There is a special event called `default` that - * matches the default events belonging to the control. These are the events that are bound to - * the control, and when fired, update the `$viewValue` via `$setViewValue`. - * - * `ngModelOptions` considers every event that is not listed in `updateOn` a "default" event, - * since different control types use different default events. - * - * See also the section {@link ngModelOptions#triggering-and-debouncing-model-updates - * Triggering and debouncing model updates}. - * - * - `debounce`: integer value which contains the debounce model update value in milliseconds. A - * value of 0 triggers an immediate update. If an object is supplied instead, you can specify a - * custom value for each event. For example: - * ``` - * ng-model-options="{ - * updateOn: 'default blur click', - * debounce: { 'default': 500, 'blur': 0 } - * }" - * ``` - * - * "default" also applies to all events that are listed in `updateOn` but are not - * listed in `debounce`, i.e. "click" would also be debounced by 500 milliseconds. - * - * - `allowInvalid`: boolean value which indicates that the model can be set with values that did - * not validate correctly instead of the default behavior of setting the model to undefined. - * - `getterSetter`: boolean value which determines whether or not to treat functions bound to - * `ngModel` as getters/setters. - * - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for - * `<input type="date" />`, `<input type="time" />`, ... . It understands UTC/GMT and the - * continental US time zone abbreviations, but for general use, use a time zone offset, for - * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian) - * If not specified, the timezone of the browser will be used. - * - */ - var ngModelOptionsDirective = function() { - NgModelOptionsController.$inject = ['$attrs', '$scope']; - function NgModelOptionsController($attrs, $scope) { - this.$$attrs = $attrs; - this.$$scope = $scope; - } - NgModelOptionsController.prototype = { - $onInit: function() { - var parentOptions = this.parentCtrl ? this.parentCtrl.$options : defaultModelOptions; - var modelOptionsDefinition = this.$$scope.$eval(this.$$attrs.ngModelOptions); - - this.$options = parentOptions.createChild(modelOptionsDefinition); - } - }; - - return { - restrict: 'A', - // ngModelOptions needs to run before ngModel and input directives - priority: 10, - require: {parentCtrl: '?^^ngModelOptions'}, - bindToController: true, - controller: NgModelOptionsController - }; - }; - - -// shallow copy over values from `src` that are not already specified on `dst` - function defaults(dst, src) { - forEach(src, function(value, key) { - if (!isDefined(dst[key])) { - dst[key] = value; - } - }); - } - - /** - * @ngdoc directive - * @name ngNonBindable - * @restrict AC - * @priority 1000 - * @element ANY - * - * @description - * The `ngNonBindable` directive tells AngularJS not to compile or bind the contents of the current - * DOM element, including directives on the element itself that have a lower priority than - * `ngNonBindable`. This is useful if the element contains what appears to be AngularJS directives - * and bindings but which should be ignored by AngularJS. This could be the case if you have a site - * that displays snippets of code, for instance. - * - * @example - * In this example there are two locations where a simple interpolation binding (`{{}}`) is present, - * but the one wrapped in `ngNonBindable` is left alone. - * - <example name="ng-non-bindable"> - <file name="index.html"> - <div>Normal: {{1 + 2}}</div> - <div ng-non-bindable>Ignored: {{1 + 2}}</div> - </file> - <file name="protractor.js" type="protractor"> - it('should check ng-non-bindable', function() { - expect(element(by.binding('1 + 2')).getText()).toContain('3'); - expect(element.all(by.css('div')).last().getText()).toMatch(/1 \+ 2/); - }); - </file> - </example> - */ - var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 }); - - /* exported ngOptionsDirective */ - - /* global jqLiteRemove */ - - var ngOptionsMinErr = minErr('ngOptions'); - - /** - * @ngdoc directive - * @name ngOptions - * @restrict A - * - * @description - * - * The `ngOptions` attribute can be used to dynamically generate a list of `<option>` - * elements for the `<select>` element using the array or object obtained by evaluating the - * `ngOptions` comprehension expression. - * - * In many cases, {@link ng.directive:ngRepeat ngRepeat} can be used on `<option>` elements instead of - * `ngOptions` to achieve a similar result. However, `ngOptions` provides some benefits: - * - more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the - * comprehension expression - * - reduced memory consumption by not creating a new scope for each repeated instance - * - increased render speed by creating the options in a documentFragment instead of individually - * - * When an item in the `<select>` menu is selected, the array element or object property - * represented by the selected option will be bound to the model identified by the `ngModel` - * directive. - * - * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can - * be nested into the `<select>` element. This element will then represent the `null` or "not selected" - * option. See example below for demonstration. - * - * ## Complex Models (objects or collections) - * - * By default, `ngModel` watches the model by reference, not value. This is important to know when - * binding the select to a model that is an object or a collection. - * - * One issue occurs if you want to preselect an option. For example, if you set - * the model to an object that is equal to an object in your collection, `ngOptions` won't be able to set the selection, - * because the objects are not identical. So by default, you should always reference the item in your collection - * for preselections, e.g.: `$scope.selected = $scope.collection[3]`. - * - * Another solution is to use a `track by` clause, because then `ngOptions` will track the identity - * of the item not by reference, but by the result of the `track by` expression. For example, if your - * collection items have an id property, you would `track by item.id`. - * - * A different issue with objects or collections is that ngModel won't detect if an object property or - * a collection item changes. For that reason, `ngOptions` additionally watches the model using - * `$watchCollection`, when the expression contains a `track by` clause or the the select has the `multiple` attribute. - * This allows ngOptions to trigger a re-rendering of the options even if the actual object/collection - * has not changed identity, but only a property on the object or an item in the collection changes. - * - * Note that `$watchCollection` does a shallow comparison of the properties of the object (or the items in the collection - * if the model is an array). This means that changing a property deeper than the first level inside the - * object/collection will not trigger a re-rendering. - * - * ## `select` **`as`** - * - * Using `select` **`as`** will bind the result of the `select` expression to the model, but - * the value of the `<select>` and `<option>` html elements will be either the index (for array data sources) - * or property name (for object data sources) of the value within the collection. If a **`track by`** expression - * is used, the result of that expression will be set as the value of the `option` and `select` elements. - * - * - * ### `select` **`as`** and **`track by`** - * - * <div class="alert alert-warning"> - * Be careful when using `select` **`as`** and **`track by`** in the same expression. - * </div> - * - * Given this array of items on the $scope: - * - * ```js - * $scope.items = [{ - * id: 1, - * label: 'aLabel', - * subItem: { name: 'aSubItem' } - * }, { - * id: 2, - * label: 'bLabel', - * subItem: { name: 'bSubItem' } - * }]; - * ``` - * - * This will work: - * - * ```html - * <select ng-options="item as item.label for item in items track by item.id" ng-model="selected"></select> - * ``` - * ```js - * $scope.selected = $scope.items[0]; - * ``` - * - * but this will not work: - * - * ```html - * <select ng-options="item.subItem as item.label for item in items track by item.id" ng-model="selected"></select> - * ``` - * ```js - * $scope.selected = $scope.items[0].subItem; - * ``` - * - * In both examples, the **`track by`** expression is applied successfully to each `item` in the - * `items` array. Because the selected option has been set programmatically in the controller, the - * **`track by`** expression is also applied to the `ngModel` value. In the first example, the - * `ngModel` value is `items[0]` and the **`track by`** expression evaluates to `items[0].id` with - * no issue. In the second example, the `ngModel` value is `items[0].subItem` and the **`track by`** - * expression evaluates to `items[0].subItem.id` (which is undefined). As a result, the model value - * is not matched against any `<option>` and the `<select>` appears as having no selected value. - * - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {comprehension_expression} ngOptions in one of the following forms: - * - * * for array data sources: - * * `label` **`for`** `value` **`in`** `array` - * * `select` **`as`** `label` **`for`** `value` **`in`** `array` - * * `label` **`group by`** `group` **`for`** `value` **`in`** `array` - * * `label` **`disable when`** `disable` **`for`** `value` **`in`** `array` - * * `label` **`group by`** `group` **`for`** `value` **`in`** `array` **`track by`** `trackexpr` - * * `label` **`disable when`** `disable` **`for`** `value` **`in`** `array` **`track by`** `trackexpr` - * * `label` **`for`** `value` **`in`** `array` | orderBy:`orderexpr` **`track by`** `trackexpr` - * (for including a filter with `track by`) - * * for object data sources: - * * `label` **`for (`**`key` **`,`** `value`**`) in`** `object` - * * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object` - * * `label` **`group by`** `group` **`for (`**`key`**`,`** `value`**`) in`** `object` - * * `label` **`disable when`** `disable` **`for (`**`key`**`,`** `value`**`) in`** `object` - * * `select` **`as`** `label` **`group by`** `group` - * **`for` `(`**`key`**`,`** `value`**`) in`** `object` - * * `select` **`as`** `label` **`disable when`** `disable` - * **`for` `(`**`key`**`,`** `value`**`) in`** `object` - * - * Where: - * - * * `array` / `object`: an expression which evaluates to an array / object to iterate over. - * * `value`: local variable which will refer to each item in the `array` or each property value - * of `object` during iteration. - * * `key`: local variable which will refer to a property name in `object` during iteration. - * * `label`: The result of this expression will be the label for `<option>` element. The - * `expression` will most likely refer to the `value` variable (e.g. `value.propertyName`). - * * `select`: The result of this expression will be bound to the model of the parent `<select>` - * element. If not specified, `select` expression will default to `value`. - * * `group`: The result of this expression will be used to group options using the `<optgroup>` - * DOM element. - * * `disable`: The result of this expression will be used to disable the rendered `<option>` - * element. Return `true` to disable. - * * `trackexpr`: Used when working with an array of objects. The result of this expression will be - * used to identify the objects in the array. The `trackexpr` will most likely refer to the - * `value` variable (e.g. `value.propertyName`). With this the selection is preserved - * even when the options are recreated (e.g. reloaded from the server). - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required The control is considered valid only if value is entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngAttrSize sets the size of the select element dynamically. Uses the - * {@link guide/interpolation#-ngattr-for-binding-to-arbitrary-attributes ngAttr} directive. - * - * @example - <example module="selectExample" name="select"> - <file name="index.html"> - <script> - angular.module('selectExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.colors = [ - {name:'black', shade:'dark'}, - {name:'white', shade:'light', notAnOption: true}, - {name:'red', shade:'dark'}, - {name:'blue', shade:'dark', notAnOption: true}, - {name:'yellow', shade:'light', notAnOption: false} - ]; - $scope.myColor = $scope.colors[2]; // red - }]); - </script> - <div ng-controller="ExampleController"> - <ul> - <li ng-repeat="color in colors"> - <label>Name: <input ng-model="color.name"></label> - <label><input type="checkbox" ng-model="color.notAnOption"> Disabled?</label> - <button ng-click="colors.splice($index, 1)" aria-label="Remove">X</button> - </li> - <li> - <button ng-click="colors.push({})">add</button> - </li> - </ul> - <hr/> - <label>Color (null not allowed): - <select ng-model="myColor" ng-options="color.name for color in colors"></select> - </label><br/> - <label>Color (null allowed): - <span class="nullable"> - <select ng-model="myColor" ng-options="color.name for color in colors"> - <option value="">-- choose color --</option> - </select> - </span></label><br/> - - <label>Color grouped by shade: - <select ng-model="myColor" ng-options="color.name group by color.shade for color in colors"> - </select> - </label><br/> - - <label>Color grouped by shade, with some disabled: - <select ng-model="myColor" - ng-options="color.name group by color.shade disable when color.notAnOption for color in colors"> - </select> - </label><br/> - - - - Select <button ng-click="myColor = { name:'not in list', shade: 'other' }">bogus</button>. - <br/> - <hr/> - Currently selected: {{ {selected_color:myColor} }} - <div style="border:solid 1px black; height:20px" - ng-style="{'background-color':myColor.name}"> - </div> - </div> - </file> - <file name="protractor.js" type="protractor"> - it('should check ng-options', function() { - expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('red'); - element.all(by.model('myColor')).first().click(); - element.all(by.css('select[ng-model="myColor"] option')).first().click(); - expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('black'); - element(by.css('.nullable select[ng-model="myColor"]')).click(); - element.all(by.css('.nullable select[ng-model="myColor"] option')).first().click(); - expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('null'); - }); - </file> - </example> - */ - - /* eslint-disable max-len */ -// //00001111111111000000000002222222222000000000000000000000333333333300000000000000000000000004444444444400000000000005555555555555000000000666666666666600000007777777777777000000000000000888888888800000000000000000009999999999 - var NG_OPTIONS_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/; - // 1: value expression (valueFn) - // 2: label expression (displayFn) - // 3: group by expression (groupByFn) - // 4: disable when expression (disableWhenFn) - // 5: array item variable name - // 6: object item key variable name - // 7: object item value variable name - // 8: collection expression - // 9: track by expression - /* eslint-enable */ - - - var ngOptionsDirective = ['$compile', '$document', '$parse', function($compile, $document, $parse) { - - function parseOptionsExpression(optionsExp, selectElement, scope) { - - var match = optionsExp.match(NG_OPTIONS_REGEXP); - if (!(match)) { - throw ngOptionsMinErr('iexp', - 'Expected expression in form of ' + - '\'_select_ (as _label_)? for (_key_,)?_value_ in _collection_\'' + - ' but got \'{0}\'. Element: {1}', - optionsExp, startingTag(selectElement)); - } - - // Extract the parts from the ngOptions expression - - // The variable name for the value of the item in the collection - var valueName = match[5] || match[7]; - // The variable name for the key of the item in the collection - var keyName = match[6]; - - // An expression that generates the viewValue for an option if there is a label expression - var selectAs = / as /.test(match[0]) && match[1]; - // An expression that is used to track the id of each object in the options collection - var trackBy = match[9]; - // An expression that generates the viewValue for an option if there is no label expression - var valueFn = $parse(match[2] ? match[1] : valueName); - var selectAsFn = selectAs && $parse(selectAs); - var viewValueFn = selectAsFn || valueFn; - var trackByFn = trackBy && $parse(trackBy); - - // Get the value by which we are going to track the option - // if we have a trackFn then use that (passing scope and locals) - // otherwise just hash the given viewValue - var getTrackByValueFn = trackBy ? - function(value, locals) { return trackByFn(scope, locals); } : - function getHashOfValue(value) { return hashKey(value); }; - var getTrackByValue = function(value, key) { - return getTrackByValueFn(value, getLocals(value, key)); - }; - - var displayFn = $parse(match[2] || match[1]); - var groupByFn = $parse(match[3] || ''); - var disableWhenFn = $parse(match[4] || ''); - var valuesFn = $parse(match[8]); - - var locals = {}; - var getLocals = keyName ? function(value, key) { - locals[keyName] = key; - locals[valueName] = value; - return locals; - } : function(value) { - locals[valueName] = value; - return locals; - }; - - - function Option(selectValue, viewValue, label, group, disabled) { - this.selectValue = selectValue; - this.viewValue = viewValue; - this.label = label; - this.group = group; - this.disabled = disabled; - } - - function getOptionValuesKeys(optionValues) { - var optionValuesKeys; - - if (!keyName && isArrayLike(optionValues)) { - optionValuesKeys = optionValues; - } else { - // if object, extract keys, in enumeration order, unsorted - optionValuesKeys = []; - for (var itemKey in optionValues) { - if (optionValues.hasOwnProperty(itemKey) && itemKey.charAt(0) !== '$') { - optionValuesKeys.push(itemKey); - } - } - } - return optionValuesKeys; - } - - return { - trackBy: trackBy, - getTrackByValue: getTrackByValue, - getWatchables: $parse(valuesFn, function(optionValues) { - // Create a collection of things that we would like to watch (watchedArray) - // so that they can all be watched using a single $watchCollection - // that only runs the handler once if anything changes - var watchedArray = []; - optionValues = optionValues || []; - - var optionValuesKeys = getOptionValuesKeys(optionValues); - var optionValuesLength = optionValuesKeys.length; - for (var index = 0; index < optionValuesLength; index++) { - var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index]; - var value = optionValues[key]; - - var locals = getLocals(value, key); - var selectValue = getTrackByValueFn(value, locals); - watchedArray.push(selectValue); - - // Only need to watch the displayFn if there is a specific label expression - if (match[2] || match[1]) { - var label = displayFn(scope, locals); - watchedArray.push(label); - } - - // Only need to watch the disableWhenFn if there is a specific disable expression - if (match[4]) { - var disableWhen = disableWhenFn(scope, locals); - watchedArray.push(disableWhen); - } - } - return watchedArray; - }), - - getOptions: function() { - - var optionItems = []; - var selectValueMap = {}; - - // The option values were already computed in the `getWatchables` fn, - // which must have been called to trigger `getOptions` - var optionValues = valuesFn(scope) || []; - var optionValuesKeys = getOptionValuesKeys(optionValues); - var optionValuesLength = optionValuesKeys.length; - - for (var index = 0; index < optionValuesLength; index++) { - var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index]; - var value = optionValues[key]; - var locals = getLocals(value, key); - var viewValue = viewValueFn(scope, locals); - var selectValue = getTrackByValueFn(viewValue, locals); - var label = displayFn(scope, locals); - var group = groupByFn(scope, locals); - var disabled = disableWhenFn(scope, locals); - var optionItem = new Option(selectValue, viewValue, label, group, disabled); - - optionItems.push(optionItem); - selectValueMap[selectValue] = optionItem; - } - - return { - items: optionItems, - selectValueMap: selectValueMap, - getOptionFromViewValue: function(value) { - return selectValueMap[getTrackByValue(value)]; - }, - getViewValueFromOption: function(option) { - // If the viewValue could be an object that may be mutated by the application, - // we need to make a copy and not return the reference to the value on the option. - return trackBy ? copy(option.viewValue) : option.viewValue; - } - }; - } - }; - } - - - // Support: IE 9 only - // We can't just jqLite('<option>') since jqLite is not smart enough - // to create it in <select> and IE barfs otherwise. - var optionTemplate = window.document.createElement('option'), - optGroupTemplate = window.document.createElement('optgroup'); - - function ngOptionsPostLink(scope, selectElement, attr, ctrls) { - - var selectCtrl = ctrls[0]; - var ngModelCtrl = ctrls[1]; - var multiple = attr.multiple; - - // The emptyOption allows the application developer to provide their own custom "empty" - // option when the viewValue does not match any of the option values. - for (var i = 0, children = selectElement.children(), ii = children.length; i < ii; i++) { - if (children[i].value === '') { - selectCtrl.hasEmptyOption = true; - selectCtrl.emptyOption = children.eq(i); - break; - } - } - - // The empty option will be compiled and rendered before we first generate the options - selectElement.empty(); - - var providedEmptyOption = !!selectCtrl.emptyOption; - - var unknownOption = jqLite(optionTemplate.cloneNode(false)); - unknownOption.val('?'); - - var options; - var ngOptions = parseOptionsExpression(attr.ngOptions, selectElement, scope); - // This stores the newly created options before they are appended to the select. - // Since the contents are removed from the fragment when it is appended, - // we only need to create it once. - var listFragment = $document[0].createDocumentFragment(); - - // Overwrite the implementation. ngOptions doesn't use hashes - selectCtrl.generateUnknownOptionValue = function(val) { - return '?'; - }; - - // Update the controller methods for multiple selectable options - if (!multiple) { - - selectCtrl.writeValue = function writeNgOptionsValue(value) { - // The options might not be defined yet when ngModel tries to render - if (!options) return; - - var selectedOption = selectElement[0].options[selectElement[0].selectedIndex]; - var option = options.getOptionFromViewValue(value); - - // Make sure to remove the selected attribute from the previously selected option - // Otherwise, screen readers might get confused - if (selectedOption) selectedOption.removeAttribute('selected'); - - if (option) { - // Don't update the option when it is already selected. - // For example, the browser will select the first option by default. In that case, - // most properties are set automatically - except the `selected` attribute, which we - // set always - - if (selectElement[0].value !== option.selectValue) { - selectCtrl.removeUnknownOption(); - - selectElement[0].value = option.selectValue; - option.element.selected = true; - } - - option.element.setAttribute('selected', 'selected'); - } else { - selectCtrl.selectUnknownOrEmptyOption(value); - } - }; - - selectCtrl.readValue = function readNgOptionsValue() { - - var selectedOption = options.selectValueMap[selectElement.val()]; - - if (selectedOption && !selectedOption.disabled) { - selectCtrl.unselectEmptyOption(); - selectCtrl.removeUnknownOption(); - return options.getViewValueFromOption(selectedOption); - } - return null; - }; - - // If we are using `track by` then we must watch the tracked value on the model - // since ngModel only watches for object identity change - // FIXME: When a user selects an option, this watch will fire needlessly - if (ngOptions.trackBy) { - scope.$watch( - function() { return ngOptions.getTrackByValue(ngModelCtrl.$viewValue); }, - function() { ngModelCtrl.$render(); } - ); - } - - } else { - - selectCtrl.writeValue = function writeNgOptionsMultiple(values) { - // The options might not be defined yet when ngModel tries to render - if (!options) return; - - // Only set `<option>.selected` if necessary, in order to prevent some browsers from - // scrolling to `<option>` elements that are outside the `<select>` element's viewport. - var selectedOptions = values && values.map(getAndUpdateSelectedOption) || []; - - options.items.forEach(function(option) { - if (option.element.selected && !includes(selectedOptions, option)) { - option.element.selected = false; - } - }); - }; - - - selectCtrl.readValue = function readNgOptionsMultiple() { - var selectedValues = selectElement.val() || [], - selections = []; - - forEach(selectedValues, function(value) { - var option = options.selectValueMap[value]; - if (option && !option.disabled) selections.push(options.getViewValueFromOption(option)); - }); - - return selections; - }; - - // If we are using `track by` then we must watch these tracked values on the model - // since ngModel only watches for object identity change - if (ngOptions.trackBy) { - - scope.$watchCollection(function() { - if (isArray(ngModelCtrl.$viewValue)) { - return ngModelCtrl.$viewValue.map(function(value) { - return ngOptions.getTrackByValue(value); - }); - } - }, function() { - ngModelCtrl.$render(); - }); - - } - } - - if (providedEmptyOption) { - - // compile the element since there might be bindings in it - $compile(selectCtrl.emptyOption)(scope); - - selectElement.prepend(selectCtrl.emptyOption); - - if (selectCtrl.emptyOption[0].nodeType === NODE_TYPE_COMMENT) { - // This means the empty option has currently no actual DOM node, probably because - // it has been modified by a transclusion directive. - selectCtrl.hasEmptyOption = false; - - // Redefine the registerOption function, which will catch - // options that are added by ngIf etc. (rendering of the node is async because of - // lazy transclusion) - selectCtrl.registerOption = function(optionScope, optionEl) { - if (optionEl.val() === '') { - selectCtrl.hasEmptyOption = true; - selectCtrl.emptyOption = optionEl; - selectCtrl.emptyOption.removeClass('ng-scope'); - // This ensures the new empty option is selected if previously no option was selected - ngModelCtrl.$render(); - - optionEl.on('$destroy', function() { - var needsRerender = selectCtrl.$isEmptyOptionSelected(); - - selectCtrl.hasEmptyOption = false; - selectCtrl.emptyOption = undefined; - - if (needsRerender) ngModelCtrl.$render(); - }); - } - }; - - } else { - // remove the class, which is added automatically because we recompile the element and it - // becomes the compilation root - selectCtrl.emptyOption.removeClass('ng-scope'); - } - - } - - // We will re-render the option elements if the option values or labels change - scope.$watchCollection(ngOptions.getWatchables, updateOptions); - - // ------------------------------------------------------------------ // - - function addOptionElement(option, parent) { - var optionElement = optionTemplate.cloneNode(false); - parent.appendChild(optionElement); - updateOptionElement(option, optionElement); - } - - function getAndUpdateSelectedOption(viewValue) { - var option = options.getOptionFromViewValue(viewValue); - var element = option && option.element; - - if (element && !element.selected) element.selected = true; - - return option; - } - - function updateOptionElement(option, element) { - option.element = element; - element.disabled = option.disabled; - // Support: IE 11 only, Edge 12-13 only - // NOTE: The label must be set before the value, otherwise IE 11 & Edge create unresponsive - // selects in certain circumstances when multiple selects are next to each other and display - // the option list in listbox style, i.e. the select is [multiple], or specifies a [size]. - // See https://github.com/angular/angular.js/issues/11314 for more info. - // This is unfortunately untestable with unit / e2e tests - if (option.label !== element.label) { - element.label = option.label; - element.textContent = option.label; - } - element.value = option.selectValue; - } - - function updateOptions() { - var previousValue = options && selectCtrl.readValue(); - - // We must remove all current options, but cannot simply set innerHTML = null - // since the providedEmptyOption might have an ngIf on it that inserts comments which we - // must preserve. - // Instead, iterate over the current option elements and remove them or their optgroup - // parents - if (options) { - - for (var i = options.items.length - 1; i >= 0; i--) { - var option = options.items[i]; - if (isDefined(option.group)) { - jqLiteRemove(option.element.parentNode); - } else { - jqLiteRemove(option.element); - } - } - } - - options = ngOptions.getOptions(); - - var groupElementMap = {}; - - options.items.forEach(function addOption(option) { - var groupElement; - - if (isDefined(option.group)) { - - // This option is to live in a group - // See if we have already created this group - groupElement = groupElementMap[option.group]; - - if (!groupElement) { - - groupElement = optGroupTemplate.cloneNode(false); - listFragment.appendChild(groupElement); - - // Update the label on the group element - // "null" is special cased because of Safari - groupElement.label = option.group === null ? 'null' : option.group; - - // Store it for use later - groupElementMap[option.group] = groupElement; - } - - addOptionElement(option, groupElement); - - } else { - - // This option is not in a group - addOptionElement(option, listFragment); - } - }); - - selectElement[0].appendChild(listFragment); - - ngModelCtrl.$render(); - - // Check to see if the value has changed due to the update to the options - if (!ngModelCtrl.$isEmpty(previousValue)) { - var nextValue = selectCtrl.readValue(); - var isNotPrimitive = ngOptions.trackBy || multiple; - if (isNotPrimitive ? !equals(previousValue, nextValue) : previousValue !== nextValue) { - ngModelCtrl.$setViewValue(nextValue); - ngModelCtrl.$render(); - } - } - } - } - - return { - restrict: 'A', - terminal: true, - require: ['select', 'ngModel'], - link: { - pre: function ngOptionsPreLink(scope, selectElement, attr, ctrls) { - // Deactivate the SelectController.register method to prevent - // option directives from accidentally registering themselves - // (and unwanted $destroy handlers etc.) - ctrls[0].registerOption = noop; - }, - post: ngOptionsPostLink - } - }; - }]; - - /** - * @ngdoc directive - * @name ngPluralize - * @restrict EA - * - * @description - * `ngPluralize` is a directive that displays messages according to en-US localization rules. - * These rules are bundled with angular.js, but can be overridden - * (see {@link guide/i18n AngularJS i18n} dev guide). You configure ngPluralize directive - * by specifying the mappings between - * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html) - * and the strings to be displayed. - * - * ## Plural categories and explicit number rules - * There are two - * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html) - * in AngularJS's default en-US locale: "one" and "other". - * - * While a plural category may match many numbers (for example, in en-US locale, "other" can match - * any number that is not 1), an explicit number rule can only match one number. For example, the - * explicit number rule for "3" matches the number 3. There are examples of plural categories - * and explicit number rules throughout the rest of this documentation. - * - * ## Configuring ngPluralize - * You configure ngPluralize by providing 2 attributes: `count` and `when`. - * You can also provide an optional attribute, `offset`. - * - * The value of the `count` attribute can be either a string or an {@link guide/expression - * AngularJS expression}; these are evaluated on the current scope for its bound value. - * - * The `when` attribute specifies the mappings between plural categories and the actual - * string to be displayed. The value of the attribute should be a JSON object. - * - * The following example shows how to configure ngPluralize: - * - * ```html - * <ng-pluralize count="personCount" - when="{'0': 'Nobody is viewing.', - * 'one': '1 person is viewing.', - * 'other': '{} people are viewing.'}"> - * </ng-pluralize> - *``` - * - * In the example, `"0: Nobody is viewing."` is an explicit number rule. If you did not - * specify this rule, 0 would be matched to the "other" category and "0 people are viewing" - * would be shown instead of "Nobody is viewing". You can specify an explicit number rule for - * other numbers, for example 12, so that instead of showing "12 people are viewing", you can - * show "a dozen people are viewing". - * - * You can use a set of closed braces (`{}`) as a placeholder for the number that you want substituted - * into pluralized strings. In the previous example, AngularJS will replace `{}` with - * <span ng-non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder - * for <span ng-non-bindable>{{numberExpression}}</span>. - * - * If no rule is defined for a category, then an empty string is displayed and a warning is generated. - * Note that some locales define more categories than `one` and `other`. For example, fr-fr defines `few` and `many`. - * - * ## Configuring ngPluralize with offset - * The `offset` attribute allows further customization of pluralized text, which can result in - * a better user experience. For example, instead of the message "4 people are viewing this document", - * you might display "John, Kate and 2 others are viewing this document". - * The offset attribute allows you to offset a number by any desired value. - * Let's take a look at an example: - * - * ```html - * <ng-pluralize count="personCount" offset=2 - * when="{'0': 'Nobody is viewing.', - * '1': '{{person1}} is viewing.', - * '2': '{{person1}} and {{person2}} are viewing.', - * 'one': '{{person1}}, {{person2}} and one other person are viewing.', - * 'other': '{{person1}}, {{person2}} and {} other people are viewing.'}"> - * </ng-pluralize> - * ``` - * - * Notice that we are still using two plural categories(one, other), but we added - * three explicit number rules 0, 1 and 2. - * When one person, perhaps John, views the document, "John is viewing" will be shown. - * When three people view the document, no explicit number rule is found, so - * an offset of 2 is taken off 3, and AngularJS uses 1 to decide the plural category. - * In this case, plural category 'one' is matched and "John, Mary and one other person are viewing" - * is shown. - * - * Note that when you specify offsets, you must provide explicit number rules for - * numbers from 0 up to and including the offset. If you use an offset of 3, for example, - * you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for - * plural categories "one" and "other". - * - * @param {string|expression} count The variable to be bound to. - * @param {string} when The mapping between plural category to its corresponding strings. - * @param {number=} offset Offset to deduct from the total number. - * - * @example - <example module="pluralizeExample" name="ng-pluralize"> - <file name="index.html"> - <script> - angular.module('pluralizeExample', []) - .controller('ExampleController', ['$scope', function($scope) { - $scope.person1 = 'Igor'; - $scope.person2 = 'Misko'; - $scope.personCount = 1; - }]); - </script> - <div ng-controller="ExampleController"> - <label>Person 1:<input type="text" ng-model="person1" value="Igor" /></label><br/> - <label>Person 2:<input type="text" ng-model="person2" value="Misko" /></label><br/> - <label>Number of People:<input type="text" ng-model="personCount" value="1" /></label><br/> - - <!--- Example with simple pluralization rules for en locale ---> - Without Offset: - <ng-pluralize count="personCount" - when="{'0': 'Nobody is viewing.', - 'one': '1 person is viewing.', - 'other': '{} people are viewing.'}"> - </ng-pluralize><br> - - <!--- Example with offset ---> - With Offset(2): - <ng-pluralize count="personCount" offset=2 - when="{'0': 'Nobody is viewing.', - '1': '{{person1}} is viewing.', - '2': '{{person1}} and {{person2}} are viewing.', - 'one': '{{person1}}, {{person2}} and one other person are viewing.', - 'other': '{{person1}}, {{person2}} and {} other people are viewing.'}"> - </ng-pluralize> - </div> - </file> - <file name="protractor.js" type="protractor"> - it('should show correct pluralized string', function() { - var withoutOffset = element.all(by.css('ng-pluralize')).get(0); - var withOffset = element.all(by.css('ng-pluralize')).get(1); - var countInput = element(by.model('personCount')); - - expect(withoutOffset.getText()).toEqual('1 person is viewing.'); - expect(withOffset.getText()).toEqual('Igor is viewing.'); - - countInput.clear(); - countInput.sendKeys('0'); - - expect(withoutOffset.getText()).toEqual('Nobody is viewing.'); - expect(withOffset.getText()).toEqual('Nobody is viewing.'); - - countInput.clear(); - countInput.sendKeys('2'); - - expect(withoutOffset.getText()).toEqual('2 people are viewing.'); - expect(withOffset.getText()).toEqual('Igor and Misko are viewing.'); - - countInput.clear(); - countInput.sendKeys('3'); - - expect(withoutOffset.getText()).toEqual('3 people are viewing.'); - expect(withOffset.getText()).toEqual('Igor, Misko and one other person are viewing.'); - - countInput.clear(); - countInput.sendKeys('4'); - - expect(withoutOffset.getText()).toEqual('4 people are viewing.'); - expect(withOffset.getText()).toEqual('Igor, Misko and 2 other people are viewing.'); - }); - it('should show data-bound names', function() { - var withOffset = element.all(by.css('ng-pluralize')).get(1); - var personCount = element(by.model('personCount')); - var person1 = element(by.model('person1')); - var person2 = element(by.model('person2')); - personCount.clear(); - personCount.sendKeys('4'); - person1.clear(); - person1.sendKeys('Di'); - person2.clear(); - person2.sendKeys('Vojta'); - expect(withOffset.getText()).toEqual('Di, Vojta and 2 other people are viewing.'); - }); - </file> - </example> - */ - var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale, $interpolate, $log) { - var BRACE = /{}/g, - IS_WHEN = /^when(Minus)?(.+)$/; - - return { - link: function(scope, element, attr) { - var numberExp = attr.count, - whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs - offset = attr.offset || 0, - whens = scope.$eval(whenExp) || {}, - whensExpFns = {}, - startSymbol = $interpolate.startSymbol(), - endSymbol = $interpolate.endSymbol(), - braceReplacement = startSymbol + numberExp + '-' + offset + endSymbol, - watchRemover = angular.noop, - lastCount; - - forEach(attr, function(expression, attributeName) { - var tmpMatch = IS_WHEN.exec(attributeName); - if (tmpMatch) { - var whenKey = (tmpMatch[1] ? '-' : '') + lowercase(tmpMatch[2]); - whens[whenKey] = element.attr(attr.$attr[attributeName]); - } - }); - forEach(whens, function(expression, key) { - whensExpFns[key] = $interpolate(expression.replace(BRACE, braceReplacement)); - - }); - - scope.$watch(numberExp, function ngPluralizeWatchAction(newVal) { - var count = parseFloat(newVal); - var countIsNaN = isNumberNaN(count); - - if (!countIsNaN && !(count in whens)) { - // If an explicit number rule such as 1, 2, 3... is defined, just use it. - // Otherwise, check it against pluralization rules in $locale service. - count = $locale.pluralCat(count - offset); - } - - // If both `count` and `lastCount` are NaN, we don't need to re-register a watch. - // In JS `NaN !== NaN`, so we have to explicitly check. - if ((count !== lastCount) && !(countIsNaN && isNumberNaN(lastCount))) { - watchRemover(); - var whenExpFn = whensExpFns[count]; - if (isUndefined(whenExpFn)) { - if (newVal != null) { - $log.debug('ngPluralize: no rule defined for \'' + count + '\' in ' + whenExp); - } - watchRemover = noop; - updateElementText(); - } else { - watchRemover = scope.$watch(whenExpFn, updateElementText); - } - lastCount = count; - } - }); - - function updateElementText(newText) { - element.text(newText || ''); - } - } - }; - }]; - - /* exported ngRepeatDirective */ - - /** - * @ngdoc directive - * @name ngRepeat - * @multiElement - * @restrict A - * - * @description - * The `ngRepeat` directive instantiates a template once per item from a collection. Each template - * instance gets its own scope, where the given loop variable is set to the current collection item, - * and `$index` is set to the item index or key. - * - * Special properties are exposed on the local scope of each template instance, including: - * - * | Variable | Type | Details | - * |-----------|-----------------|-----------------------------------------------------------------------------| - * | `$index` | {@type number} | iterator offset of the repeated element (0..length-1) | - * | `$first` | {@type boolean} | true if the repeated element is first in the iterator. | - * | `$middle` | {@type boolean} | true if the repeated element is between the first and last in the iterator. | - * | `$last` | {@type boolean} | true if the repeated element is last in the iterator. | - * | `$even` | {@type boolean} | true if the iterator position `$index` is even (otherwise false). | - * | `$odd` | {@type boolean} | true if the iterator position `$index` is odd (otherwise false). | - * - * <div class="alert alert-info"> - * Creating aliases for these properties is possible with {@link ng.directive:ngInit `ngInit`}. - * This may be useful when, for instance, nesting ngRepeats. - * </div> - * - * - * ## Iterating over object properties - * - * It is possible to get `ngRepeat` to iterate over the properties of an object using the following - * syntax: - * - * ```js - * <div ng-repeat="(key, value) in myObj"> ... </div> - * ``` - * - * However, there are a few limitations compared to array iteration: - * - * - The JavaScript specification does not define the order of keys - * returned for an object, so AngularJS relies on the order returned by the browser - * when running `for key in myObj`. Browsers generally follow the strategy of providing - * keys in the order in which they were defined, although there are exceptions when keys are deleted - * and reinstated. See the - * [MDN page on `delete` for more info](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete#Cross-browser_notes). - * - * - `ngRepeat` will silently *ignore* object keys starting with `$`, because - * it's a prefix used by AngularJS for public (`$`) and private (`$$`) properties. - * - * - The built-in filters {@link ng.orderBy orderBy} and {@link ng.filter filter} do not work with - * objects, and will throw an error if used with one. - * - * If you are hitting any of these limitations, the recommended workaround is to convert your object into an array - * that is sorted into the order that you prefer before providing it to `ngRepeat`. You could - * do this with a filter such as [toArrayFilter](http://ngmodules.org/modules/angular-toArrayFilter) - * or implement a `$watch` on the object yourself. - * - * - * ## Tracking and Duplicates - * - * `ngRepeat` uses {@link $rootScope.Scope#$watchCollection $watchCollection} to detect changes in - * the collection. When a change happens, `ngRepeat` then makes the corresponding changes to the DOM: - * - * * When an item is added, a new instance of the template is added to the DOM. - * * When an item is removed, its template instance is removed from the DOM. - * * When items are reordered, their respective templates are reordered in the DOM. - * - * To minimize creation of DOM elements, `ngRepeat` uses a function - * to "keep track" of all items in the collection and their corresponding DOM elements. - * For example, if an item is added to the collection, `ngRepeat` will know that all other items - * already have DOM elements, and will not re-render them. - * - * All different types of tracking functions, their syntax, and and their support for duplicate - * items in collections can be found in the - * {@link ngRepeat#ngRepeat-arguments ngRepeat expression description}. - * - * <div class="alert alert-success"> - * **Best Practice:** If you are working with objects that have a unique identifier property, you - * should track by this identifier instead of the object instance, - * e.g. `item in items track by item.id`. - * Should you reload your data later, `ngRepeat` will not have to rebuild the DOM elements for items - * it has already rendered, even if the JavaScript objects in the collection have been substituted - * for new ones. For large collections, this significantly improves rendering performance. - * </div> - * - * ### Effects of DOM Element re-use - * - * When DOM elements are re-used, ngRepeat updates the scope for the element, which will - * automatically update any active bindings on the template. However, other - * functionality will not be updated, because the element is not re-created: - * - * - Directives are not re-compiled - * - {@link guide/expression#one-time-binding one-time expressions} on the repeated template are not - * updated if they have stabilized. - * - * The above affects all kinds of element re-use due to tracking, but may be especially visible - * when tracking by `$index` due to the way ngRepeat re-uses elements. - * - * The following example shows the effects of different actions with tracking: - - <example module="ngRepeat" name="ngRepeat-tracking" deps="angular-animate.js" animations="true"> - <file name="script.js"> - angular.module('ngRepeat', ['ngAnimate']).controller('repeatController', function($scope) { - var friends = [ - {name:'John', age:25}, - {name:'Mary', age:40}, - {name:'Peter', age:85} - ]; - - $scope.removeFirst = function() { - $scope.friends.shift(); - }; - - $scope.updateAge = function() { - $scope.friends.forEach(function(el) { - el.age = el.age + 5; - }); - }; - - $scope.copy = function() { - $scope.friends = angular.copy($scope.friends); - }; - - $scope.reset = function() { - $scope.friends = angular.copy(friends); - }; - - $scope.reset(); - }); - </file> - <file name="index.html"> - <div ng-controller="repeatController"> - <ol> - <li>When you click "Update Age", only the first list updates the age, because all others have - a one-time binding on the age property. If you then click "Copy", the current friend list - is copied, and now the second list updates the age, because the identity of the collection items - has changed and the list must be re-rendered. The 3rd and 4th list stay the same, because all the - items are already known according to their tracking functions. - </li> - <li>When you click "Remove First", the 4th list has the wrong age on both remaining items. This is - due to tracking by $index: when the first collection item is removed, ngRepeat reuses the first - DOM element for the new first collection item, and so on. Since the age property is one-time - bound, the value remains from the collection item which was previously at this index. - </li> - </ol> - - <button ng-click="removeFirst()">Remove First</button> - <button ng-click="updateAge()">Update Age</button> - <button ng-click="copy()">Copy</button> - <br><button ng-click="reset()">Reset List</button> - <br> - <code>track by $id(friend)</code> (default): - <ul class="example-animate-container"> - <li class="animate-repeat" ng-repeat="friend in friends"> - {{friend.name}} is {{friend.age}} years old. - </li> - </ul> - <code>track by $id(friend)</code> (default), with age one-time binding: - <ul class="example-animate-container"> - <li class="animate-repeat" ng-repeat="friend in friends"> - {{friend.name}} is {{::friend.age}} years old. - </li> - </ul> - <code>track by friend.name</code>, with age one-time binding: - <ul class="example-animate-container"> - <li class="animate-repeat" ng-repeat="friend in friends track by friend.name"> - {{friend.name}} is {{::friend.age}} years old. - </li> - </ul> - <code>track by $index</code>, with age one-time binding: - <ul class="example-animate-container"> - <li class="animate-repeat" ng-repeat="friend in friends track by $index"> - {{friend.name}} is {{::friend.age}} years old. - </li> - </ul> - </div> - </file> - <file name="animations.css"> - .example-animate-container { - background:white; - border:1px solid black; - list-style:none; - margin:0; - padding:0 10px; - } - - .animate-repeat { - line-height:30px; - list-style:none; - box-sizing:border-box; - } - - .animate-repeat.ng-move, - .animate-repeat.ng-enter, - .animate-repeat.ng-leave { - transition:all linear 0.5s; - } - - .animate-repeat.ng-leave.ng-leave-active, - .animate-repeat.ng-move, - .animate-repeat.ng-enter { - opacity:0; - max-height:0; - } - - .animate-repeat.ng-leave, - .animate-repeat.ng-move.ng-move-active, - .animate-repeat.ng-enter.ng-enter-active { - opacity:1; - max-height:30px; - } - </file> - </example> - - * - * ## Special repeat start and end points - * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending - * the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively. - * The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on) - * up to and including the ending HTML tag where **ng-repeat-end** is placed. - * - * The example below makes use of this feature: - * ```html - * <header ng-repeat-start="item in items"> - * Header {{ item }} - * </header> - * <div class="body"> - * Body {{ item }} - * </div> - * <footer ng-repeat-end> - * Footer {{ item }} - * </footer> - * ``` - * - * And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to: - * ```html - * <header> - * Header A - * </header> - * <div class="body"> - * Body A - * </div> - * <footer> - * Footer A - * </footer> - * <header> - * Header B - * </header> - * <div class="body"> - * Body B - * </div> - * <footer> - * Footer B - * </footer> - * ``` - * - * The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such - * as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**). - * - * @animations - * | Animation | Occurs | - * |----------------------------------|-------------------------------------| - * | {@link ng.$animate#enter enter} | when a new item is added to the list or when an item is revealed after a filter | - * | {@link ng.$animate#leave leave} | when an item is removed from the list or when an item is filtered out | - * | {@link ng.$animate#move move } | when an adjacent item is filtered out causing a reorder or when the item contents are reordered | - * - * See the example below for defining CSS animations with ngRepeat. - * - * @element ANY - * @scope - * @priority 1000 - * @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. These - * formats are currently supported: - * - * * `variable in expression` – where variable is the user defined loop variable and `expression` - * is a scope expression giving the collection to enumerate. - * - * For example: `album in artist.albums`. - * - * * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers, - * and `expression` is the scope expression giving the collection to enumerate. - * - * For example: `(name, age) in {'adam':10, 'amalie':12}`. - * - * * `variable in expression track by tracking_expression` – You can also provide an optional tracking expression - * which can be used to associate the objects in the collection with the DOM elements. If no tracking expression - * is specified, ng-repeat associates elements by identity. It is an error to have - * more than one tracking expression value resolve to the same key. (This would mean that two distinct objects are - * mapped to the same DOM element, which is not possible.) - * - * *Default tracking: $id()*: `item in items` is equivalent to `item in items track by $id(item)`. - * This implies that the DOM elements will be associated by item identity in the collection. - * - * The built-in `$id()` function can be used to assign a unique - * `$$hashKey` property to each item in the collection. This property is then used as a key to associated DOM elements - * with the corresponding item in the collection by identity. Moving the same object would move - * the DOM element in the same way in the DOM. - * Note that the default id function does not support duplicate primitive values (`number`, `string`), - * but supports duplictae non-primitive values (`object`) that are *equal* in shape. - * - * *Custom Expression*: It is possible to use any AngularJS expression to compute the tracking - * id, for example with a function, or using a property on the collection items. - * `item in items track by item.id` is a typical pattern when the items have a unique identifier, - * e.g. database id. In this case the object identity does not matter. Two objects are considered - * equivalent as long as their `id` property is same. - * Tracking by unique identifier is the most performant way and should be used whenever possible. - * - * *$index*: This special property tracks the collection items by their index, and - * re-uses the DOM elements that match that index, e.g. `item in items track by $index`. This can - * be used for a performance improvement if no unique identfier is available and the identity of - * the collection items cannot be easily computed. It also allows duplicates. - * - * <div class="alert alert-warning"> - * <strong>Note:</strong> Re-using DOM elements can have unforeseen effects. Read the - * {@link ngRepeat#tracking-and-duplicates section on tracking and duplicates} for - * more info. - * </div> - * - * <div class="alert alert-warning"> - * <strong>Note:</strong> the `track by` expression must come last - after any filters, and the alias expression: - * `item in items | filter:searchText as results track by item.id` - * </div> - * - * * `variable in expression as alias_expression` – You can also provide an optional alias expression which will then store the - * intermediate results of the repeater after the filters have been applied. Typically this is used to render a special message - * when a filter is active on the repeater, but the filtered result set is empty. - * - * For example: `item in items | filter:x as results` will store the fragment of the repeated items as `results`, but only after - * the items have been processed through the filter. - * - * Please note that `as [variable name] is not an operator but rather a part of ngRepeat - * micro-syntax so it can be used only after all filters (and not as operator, inside an expression). - * - * For example: `item in items | filter : x | orderBy : order | limitTo : limit as results track by item.id` . - * - * @example - * This example uses `ngRepeat` to display a list of people. A filter is used to restrict the displayed - * results by name or by age. New (entering) and removed (leaving) items are animated. - <example module="ngRepeat" name="ngRepeat" deps="angular-animate.js" animations="true"> - <file name="index.html"> - <div ng-controller="repeatController"> - I have {{friends.length}} friends. They are: - <input type="search" ng-model="q" placeholder="filter friends..." aria-label="filter friends" /> - <ul class="example-animate-container"> - <li class="animate-repeat" ng-repeat="friend in friends | filter:q as results track by friend.name"> - [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old. - </li> - <li class="animate-repeat" ng-if="results.length === 0"> - <strong>No results found...</strong> - </li> - </ul> - </div> - </file> - <file name="script.js"> - angular.module('ngRepeat', ['ngAnimate']).controller('repeatController', function($scope) { - $scope.friends = [ - {name:'John', age:25, gender:'boy'}, - {name:'Jessie', age:30, gender:'girl'}, - {name:'Johanna', age:28, gender:'girl'}, - {name:'Joy', age:15, gender:'girl'}, - {name:'Mary', age:28, gender:'girl'}, - {name:'Peter', age:95, gender:'boy'}, - {name:'Sebastian', age:50, gender:'boy'}, - {name:'Erika', age:27, gender:'girl'}, - {name:'Patrick', age:40, gender:'boy'}, - {name:'Samantha', age:60, gender:'girl'} - ]; - }); - </file> - <file name="animations.css"> - .example-animate-container { - background:white; - border:1px solid black; - list-style:none; - margin:0; - padding:0 10px; - } - - .animate-repeat { - line-height:30px; - list-style:none; - box-sizing:border-box; - } - - .animate-repeat.ng-move, - .animate-repeat.ng-enter, - .animate-repeat.ng-leave { - transition:all linear 0.5s; - } - - .animate-repeat.ng-leave.ng-leave-active, - .animate-repeat.ng-move, - .animate-repeat.ng-enter { - opacity:0; - max-height:0; - } - - .animate-repeat.ng-leave, - .animate-repeat.ng-move.ng-move-active, - .animate-repeat.ng-enter.ng-enter-active { - opacity:1; - max-height:30px; - } - </file> - <file name="protractor.js" type="protractor"> - var friends = element.all(by.repeater('friend in friends')); - - it('should render initial data set', function() { - expect(friends.count()).toBe(10); - expect(friends.get(0).getText()).toEqual('[1] John who is 25 years old.'); - expect(friends.get(1).getText()).toEqual('[2] Jessie who is 30 years old.'); - expect(friends.last().getText()).toEqual('[10] Samantha who is 60 years old.'); - expect(element(by.binding('friends.length')).getText()) - .toMatch("I have 10 friends. They are:"); - }); - - it('should update repeater when filter predicate changes', function() { - expect(friends.count()).toBe(10); - - element(by.model('q')).sendKeys('ma'); - - expect(friends.count()).toBe(2); - expect(friends.get(0).getText()).toEqual('[1] Mary who is 28 years old.'); - expect(friends.last().getText()).toEqual('[2] Samantha who is 60 years old.'); - }); - </file> - </example> - */ - var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $animate, $compile) { - var NG_REMOVED = '$$NG_REMOVED'; - var ngRepeatMinErr = minErr('ngRepeat'); - - var updateScope = function(scope, index, valueIdentifier, value, keyIdentifier, key, arrayLength) { - // TODO(perf): generate setters to shave off ~40ms or 1-1.5% - scope[valueIdentifier] = value; - if (keyIdentifier) scope[keyIdentifier] = key; - scope.$index = index; - scope.$first = (index === 0); - scope.$last = (index === (arrayLength - 1)); - scope.$middle = !(scope.$first || scope.$last); - // eslint-disable-next-line no-bitwise - scope.$odd = !(scope.$even = (index & 1) === 0); - }; - - var getBlockStart = function(block) { - return block.clone[0]; - }; - - var getBlockEnd = function(block) { - return block.clone[block.clone.length - 1]; - }; - - - return { - restrict: 'A', - multiElement: true, - transclude: 'element', - priority: 1000, - terminal: true, - $$tlb: true, - compile: function ngRepeatCompile($element, $attr) { - var expression = $attr.ngRepeat; - var ngRepeatEndComment = $compile.$$createComment('end ngRepeat', expression); - - var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/); - - if (!match) { - throw ngRepeatMinErr('iexp', 'Expected expression in form of \'_item_ in _collection_[ track by _id_]\' but got \'{0}\'.', - expression); - } - - var lhs = match[1]; - var rhs = match[2]; - var aliasAs = match[3]; - var trackByExp = match[4]; - - match = lhs.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/); - - if (!match) { - throw ngRepeatMinErr('iidexp', '\'_item_\' in \'_item_ in _collection_\' should be an identifier or \'(_key_, _value_)\' expression, but got \'{0}\'.', - lhs); - } - var valueIdentifier = match[3] || match[1]; - var keyIdentifier = match[2]; - - if (aliasAs && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs) || - /^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(aliasAs))) { - throw ngRepeatMinErr('badident', 'alias \'{0}\' is invalid --- must be a valid JS identifier which is not a reserved name.', - aliasAs); - } - - var trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn; - var hashFnLocals = {$id: hashKey}; - - if (trackByExp) { - trackByExpGetter = $parse(trackByExp); - } else { - trackByIdArrayFn = function(key, value) { - return hashKey(value); - }; - trackByIdObjFn = function(key) { - return key; - }; - } - - return function ngRepeatLink($scope, $element, $attr, ctrl, $transclude) { - - if (trackByExpGetter) { - trackByIdExpFn = function(key, value, index) { - // assign key, value, and $index to the locals so that they can be used in hash functions - if (keyIdentifier) hashFnLocals[keyIdentifier] = key; - hashFnLocals[valueIdentifier] = value; - hashFnLocals.$index = index; - return trackByExpGetter($scope, hashFnLocals); - }; - } - - // Store a list of elements from previous run. This is a hash where key is the item from the - // iterator, and the value is objects with following properties. - // - scope: bound scope - // - clone: previous element. - // - index: position - // - // We are using no-proto object so that we don't need to guard against inherited props via - // hasOwnProperty. - var lastBlockMap = createMap(); - - //watch props - $scope.$watchCollection(rhs, function ngRepeatAction(collection) { - var index, length, - previousNode = $element[0], // node that cloned nodes should be inserted after - // initialized to the comment node anchor - nextNode, - // Same as lastBlockMap but it has the current state. It will become the - // lastBlockMap on the next iteration. - nextBlockMap = createMap(), - collectionLength, - key, value, // key/value of iteration - trackById, - trackByIdFn, - collectionKeys, - block, // last object information {scope, element, id} - nextBlockOrder, - elementsToRemove; - - if (aliasAs) { - $scope[aliasAs] = collection; - } - - if (isArrayLike(collection)) { - collectionKeys = collection; - trackByIdFn = trackByIdExpFn || trackByIdArrayFn; - } else { - trackByIdFn = trackByIdExpFn || trackByIdObjFn; - // if object, extract keys, in enumeration order, unsorted - collectionKeys = []; - for (var itemKey in collection) { - if (hasOwnProperty.call(collection, itemKey) && itemKey.charAt(0) !== '$') { - collectionKeys.push(itemKey); - } - } - } - - collectionLength = collectionKeys.length; - nextBlockOrder = new Array(collectionLength); - - // locate existing items - for (index = 0; index < collectionLength; index++) { - key = (collection === collectionKeys) ? index : collectionKeys[index]; - value = collection[key]; - trackById = trackByIdFn(key, value, index); - if (lastBlockMap[trackById]) { - // found previously seen block - block = lastBlockMap[trackById]; - delete lastBlockMap[trackById]; - nextBlockMap[trackById] = block; - nextBlockOrder[index] = block; - } else if (nextBlockMap[trackById]) { - // if collision detected. restore lastBlockMap and throw an error - forEach(nextBlockOrder, function(block) { - if (block && block.scope) lastBlockMap[block.id] = block; - }); - throw ngRepeatMinErr('dupes', - 'Duplicates in a repeater are not allowed. Use \'track by\' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}', - expression, trackById, value); - } else { - // new never before seen block - nextBlockOrder[index] = {id: trackById, scope: undefined, clone: undefined}; - nextBlockMap[trackById] = true; - } - } - - // remove leftover items - for (var blockKey in lastBlockMap) { - block = lastBlockMap[blockKey]; - elementsToRemove = getBlockNodes(block.clone); - $animate.leave(elementsToRemove); - if (elementsToRemove[0].parentNode) { - // if the element was not removed yet because of pending animation, mark it as deleted - // so that we can ignore it later - for (index = 0, length = elementsToRemove.length; index < length; index++) { - elementsToRemove[index][NG_REMOVED] = true; - } - } - block.scope.$destroy(); - } - - // we are not using forEach for perf reasons (trying to avoid #call) - for (index = 0; index < collectionLength; index++) { - key = (collection === collectionKeys) ? index : collectionKeys[index]; - value = collection[key]; - block = nextBlockOrder[index]; - - if (block.scope) { - // if we have already seen this object, then we need to reuse the - // associated scope/element - - nextNode = previousNode; - - // skip nodes that are already pending removal via leave animation - do { - nextNode = nextNode.nextSibling; - } while (nextNode && nextNode[NG_REMOVED]); - - if (getBlockStart(block) !== nextNode) { - // existing item which got moved - $animate.move(getBlockNodes(block.clone), null, previousNode); - } - previousNode = getBlockEnd(block); - updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength); - } else { - // new item which we don't know about - $transclude(function ngRepeatTransclude(clone, scope) { - block.scope = scope; - // http://jsperf.com/clone-vs-createcomment - var endNode = ngRepeatEndComment.cloneNode(false); - clone[clone.length++] = endNode; - - $animate.enter(clone, null, previousNode); - previousNode = endNode; - // Note: We only need the first/last node of the cloned nodes. - // However, we need to keep the reference to the jqlite wrapper as it might be changed later - // by a directive with templateUrl when its template arrives. - block.clone = clone; - nextBlockMap[block.id] = block; - updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength); - }); - } - } - lastBlockMap = nextBlockMap; - }); - }; - } - }; - }]; - - var NG_HIDE_CLASS = 'ng-hide'; - var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate'; - /** - * @ngdoc directive - * @name ngShow - * @multiElement - * - * @description - * The `ngShow` directive shows or hides the given HTML element based on the expression provided to - * the `ngShow` attribute. - * - * The element is shown or hidden by removing or adding the `.ng-hide` CSS class onto the element. - * The `.ng-hide` CSS class is predefined in AngularJS and sets the display style to none (using an - * `!important` flag). For CSP mode please add `angular-csp.css` to your HTML file (see - * {@link ng.directive:ngCsp ngCsp}). - * - * ```html - * <!-- when $scope.myValue is truthy (element is visible) --> - * <div ng-show="myValue"></div> - * - * <!-- when $scope.myValue is falsy (element is hidden) --> - * <div ng-show="myValue" class="ng-hide"></div> - * ``` - * - * When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added - * to the class attribute on the element causing it to become hidden. When truthy, the `.ng-hide` - * CSS class is removed from the element causing the element not to appear hidden. - * - * ## Why is `!important` used? - * - * You may be wondering why `!important` is used for the `.ng-hide` CSS class. This is because the - * `.ng-hide` selector can be easily overridden by heavier selectors. For example, something as - * simple as changing the display style on a HTML list item would make hidden elements appear - * visible. This also becomes a bigger issue when dealing with CSS frameworks. - * - * By using `!important`, the show and hide behavior will work as expected despite any clash between - * CSS selector specificity (when `!important` isn't used with any conflicting styles). If a - * developer chooses to override the styling to change how to hide an element then it is just a - * matter of using `!important` in their own CSS code. - * - * ### Overriding `.ng-hide` - * - * By default, the `.ng-hide` class will style the element with `display: none !important`. If you - * wish to change the hide behavior with `ngShow`/`ngHide`, you can simply overwrite the styles for - * the `.ng-hide` CSS class. Note that the selector that needs to be used is actually - * `.ng-hide:not(.ng-hide-animate)` to cope with extra animation classes that can be added. - * - * ```css - * .ng-hide:not(.ng-hide-animate) { - * /* These are just alternative ways of hiding an element */ - * display: block!important; - * position: absolute; - * top: -9999px; - * left: -9999px; - * } - * ``` - * - * By default you don't need to override anything in CSS and the animations will work around the - * display style. - * - * @animations - * | Animation | Occurs | - * |-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------| - * | {@link $animate#addClass addClass} `.ng-hide` | After the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden. | - * | {@link $animate#removeClass removeClass} `.ng-hide` | After the `ngShow` expression evaluates to a truthy value and just before contents are set to visible. | - * - * Animations in `ngShow`/`ngHide` work with the show and hide events that are triggered when the - * directive expression is true and false. This system works like the animation system present with - * `ngClass` except that you must also include the `!important` flag to override the display - * property so that the elements are not actually hidden during the animation. - * - * ```css - * /* A working example can be found at the bottom of this page. */ - * .my-element.ng-hide-add, .my-element.ng-hide-remove { - * transition: all 0.5s linear; - * } - * - * .my-element.ng-hide-add { ... } - * .my-element.ng-hide-add.ng-hide-add-active { ... } - * .my-element.ng-hide-remove { ... } - * .my-element.ng-hide-remove.ng-hide-remove-active { ... } - * ``` - * - * Keep in mind that, as of AngularJS version 1.3, there is no need to change the display property - * to block during animation states - ngAnimate will automatically handle the style toggling for you. - * - * @element ANY - * @param {expression} ngShow If the {@link guide/expression expression} is truthy/falsy then the - * element is shown/hidden respectively. - * - * @example - * A simple example, animating the element's opacity: - * - <example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-show-simple"> - <file name="index.html"> - Show: <input type="checkbox" ng-model="checked" aria-label="Toggle ngShow"><br /> - <div class="check-element animate-show-hide" ng-show="checked"> - I show up when your checkbox is checked. - </div> - </file> - <file name="animations.css"> - .animate-show-hide.ng-hide { - opacity: 0; - } - - .animate-show-hide.ng-hide-add, - .animate-show-hide.ng-hide-remove { - transition: all linear 0.5s; - } - - .check-element { - border: 1px solid black; - opacity: 1; - padding: 10px; - } - </file> - <file name="protractor.js" type="protractor"> - it('should check ngShow', function() { - var checkbox = element(by.model('checked')); - var checkElem = element(by.css('.check-element')); - - expect(checkElem.isDisplayed()).toBe(false); - checkbox.click(); - expect(checkElem.isDisplayed()).toBe(true); - }); - </file> - </example> - * - * <hr /> - * @example - * A more complex example, featuring different show/hide animations: - * - <example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-show-complex"> - <file name="index.html"> - Show: <input type="checkbox" ng-model="checked" aria-label="Toggle ngShow"><br /> - <div class="check-element funky-show-hide" ng-show="checked"> - I show up when your checkbox is checked. - </div> - </file> - <file name="animations.css"> - body { - overflow: hidden; - perspective: 1000px; - } - - .funky-show-hide.ng-hide-add { - transform: rotateZ(0); - transform-origin: right; - transition: all 0.5s ease-in-out; - } - - .funky-show-hide.ng-hide-add.ng-hide-add-active { - transform: rotateZ(-135deg); - } - - .funky-show-hide.ng-hide-remove { - transform: rotateY(90deg); - transform-origin: left; - transition: all 0.5s ease; - } - - .funky-show-hide.ng-hide-remove.ng-hide-remove-active { - transform: rotateY(0); - } - - .check-element { - border: 1px solid black; - opacity: 1; - padding: 10px; - } - </file> - <file name="protractor.js" type="protractor"> - it('should check ngShow', function() { - var checkbox = element(by.model('checked')); - var checkElem = element(by.css('.check-element')); - - expect(checkElem.isDisplayed()).toBe(false); - checkbox.click(); - expect(checkElem.isDisplayed()).toBe(true); - }); - </file> - </example> - */ - var ngShowDirective = ['$animate', function($animate) { - return { - restrict: 'A', - multiElement: true, - link: function(scope, element, attr) { - scope.$watch(attr.ngShow, function ngShowWatchAction(value) { - // we're adding a temporary, animation-specific class for ng-hide since this way - // we can control when the element is actually displayed on screen without having - // to have a global/greedy CSS selector that breaks when other animations are run. - // Read: https://github.com/angular/angular.js/issues/9103#issuecomment-58335845 - $animate[value ? 'removeClass' : 'addClass'](element, NG_HIDE_CLASS, { - tempClasses: NG_HIDE_IN_PROGRESS_CLASS - }); - }); - } - }; - }]; - - - /** - * @ngdoc directive - * @name ngHide - * @multiElement - * - * @description - * The `ngHide` directive shows or hides the given HTML element based on the expression provided to - * the `ngHide` attribute. - * - * The element is shown or hidden by removing or adding the `.ng-hide` CSS class onto the element. - * The `.ng-hide` CSS class is predefined in AngularJS and sets the display style to none (using an - * `!important` flag). For CSP mode please add `angular-csp.css` to your HTML file (see - * {@link ng.directive:ngCsp ngCsp}). - * - * ```html - * <!-- when $scope.myValue is truthy (element is hidden) --> - * <div ng-hide="myValue" class="ng-hide"></div> - * - * <!-- when $scope.myValue is falsy (element is visible) --> - * <div ng-hide="myValue"></div> - * ``` - * - * When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added - * to the class attribute on the element causing it to become hidden. When falsy, the `.ng-hide` - * CSS class is removed from the element causing the element not to appear hidden. - * - * ## Why is `!important` used? - * - * You may be wondering why `!important` is used for the `.ng-hide` CSS class. This is because the - * `.ng-hide` selector can be easily overridden by heavier selectors. For example, something as - * simple as changing the display style on a HTML list item would make hidden elements appear - * visible. This also becomes a bigger issue when dealing with CSS frameworks. - * - * By using `!important`, the show and hide behavior will work as expected despite any clash between - * CSS selector specificity (when `!important` isn't used with any conflicting styles). If a - * developer chooses to override the styling to change how to hide an element then it is just a - * matter of using `!important` in their own CSS code. - * - * ### Overriding `.ng-hide` - * - * By default, the `.ng-hide` class will style the element with `display: none !important`. If you - * wish to change the hide behavior with `ngShow`/`ngHide`, you can simply overwrite the styles for - * the `.ng-hide` CSS class. Note that the selector that needs to be used is actually - * `.ng-hide:not(.ng-hide-animate)` to cope with extra animation classes that can be added. - * - * ```css - * .ng-hide:not(.ng-hide-animate) { - * /* These are just alternative ways of hiding an element */ - * display: block!important; - * position: absolute; - * top: -9999px; - * left: -9999px; - * } - * ``` - * - * By default you don't need to override in CSS anything and the animations will work around the - * display style. - * - * @animations - * | Animation | Occurs | - * |-----------------------------------------------------|------------------------------------------------------------------------------------------------------------| - * | {@link $animate#addClass addClass} `.ng-hide` | After the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden. | - * | {@link $animate#removeClass removeClass} `.ng-hide` | After the `ngHide` expression evaluates to a non truthy value and just before contents are set to visible. | - * - * Animations in `ngShow`/`ngHide` work with the show and hide events that are triggered when the - * directive expression is true and false. This system works like the animation system present with - * `ngClass` except that you must also include the `!important` flag to override the display - * property so that the elements are not actually hidden during the animation. - * - * ```css - * /* A working example can be found at the bottom of this page. */ - * .my-element.ng-hide-add, .my-element.ng-hide-remove { - * transition: all 0.5s linear; - * } - * - * .my-element.ng-hide-add { ... } - * .my-element.ng-hide-add.ng-hide-add-active { ... } - * .my-element.ng-hide-remove { ... } - * .my-element.ng-hide-remove.ng-hide-remove-active { ... } - * ``` - * - * Keep in mind that, as of AngularJS version 1.3, there is no need to change the display property - * to block during animation states - ngAnimate will automatically handle the style toggling for you. - * - * @element ANY - * @param {expression} ngHide If the {@link guide/expression expression} is truthy/falsy then the - * element is hidden/shown respectively. - * - * @example - * A simple example, animating the element's opacity: - * - <example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-hide-simple"> - <file name="index.html"> - Hide: <input type="checkbox" ng-model="checked" aria-label="Toggle ngHide"><br /> - <div class="check-element animate-show-hide" ng-hide="checked"> - I hide when your checkbox is checked. - </div> - </file> - <file name="animations.css"> - .animate-show-hide.ng-hide { - opacity: 0; - } - - .animate-show-hide.ng-hide-add, - .animate-show-hide.ng-hide-remove { - transition: all linear 0.5s; - } - - .check-element { - border: 1px solid black; - opacity: 1; - padding: 10px; - } - </file> - <file name="protractor.js" type="protractor"> - it('should check ngHide', function() { - var checkbox = element(by.model('checked')); - var checkElem = element(by.css('.check-element')); - - expect(checkElem.isDisplayed()).toBe(true); - checkbox.click(); - expect(checkElem.isDisplayed()).toBe(false); - }); - </file> - </example> - * - * <hr /> - * @example - * A more complex example, featuring different show/hide animations: - * - <example module="ngAnimate" deps="angular-animate.js" animations="true" name="ng-hide-complex"> - <file name="index.html"> - Hide: <input type="checkbox" ng-model="checked" aria-label="Toggle ngHide"><br /> - <div class="check-element funky-show-hide" ng-hide="checked"> - I hide when your checkbox is checked. - </div> - </file> - <file name="animations.css"> - body { - overflow: hidden; - perspective: 1000px; - } - - .funky-show-hide.ng-hide-add { - transform: rotateZ(0); - transform-origin: right; - transition: all 0.5s ease-in-out; - } - - .funky-show-hide.ng-hide-add.ng-hide-add-active { - transform: rotateZ(-135deg); - } - - .funky-show-hide.ng-hide-remove { - transform: rotateY(90deg); - transform-origin: left; - transition: all 0.5s ease; - } - - .funky-show-hide.ng-hide-remove.ng-hide-remove-active { - transform: rotateY(0); - } - - .check-element { - border: 1px solid black; - opacity: 1; - padding: 10px; - } - </file> - <file name="protractor.js" type="protractor"> - it('should check ngHide', function() { - var checkbox = element(by.model('checked')); - var checkElem = element(by.css('.check-element')); - - expect(checkElem.isDisplayed()).toBe(true); - checkbox.click(); - expect(checkElem.isDisplayed()).toBe(false); - }); - </file> - </example> - */ - var ngHideDirective = ['$animate', function($animate) { - return { - restrict: 'A', - multiElement: true, - link: function(scope, element, attr) { - scope.$watch(attr.ngHide, function ngHideWatchAction(value) { - // The comment inside of the ngShowDirective explains why we add and - // remove a temporary class for the show/hide animation - $animate[value ? 'addClass' : 'removeClass'](element,NG_HIDE_CLASS, { - tempClasses: NG_HIDE_IN_PROGRESS_CLASS - }); - }); - } - }; - }]; - - /** - * @ngdoc directive - * @name ngStyle - * @restrict AC - * - * @description - * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally. - * - * @knownIssue - * You should not use {@link guide/interpolation interpolation} in the value of the `style` - * attribute, when using the `ngStyle` directive on the same element. - * See {@link guide/interpolation#known-issues here} for more info. - * - * @element ANY - * @param {expression} ngStyle - * - * {@link guide/expression Expression} which evals to an - * object whose keys are CSS style names and values are corresponding values for those CSS - * keys. - * - * Since some CSS style names are not valid keys for an object, they must be quoted. - * See the 'background-color' style in the example below. - * - * @example - <example name="ng-style"> - <file name="index.html"> - <input type="button" value="set color" ng-click="myStyle={color:'red'}"> - <input type="button" value="set background" ng-click="myStyle={'background-color':'blue'}"> - <input type="button" value="clear" ng-click="myStyle={}"> - <br/> - <span ng-style="myStyle">Sample Text</span> - <pre>myStyle={{myStyle}}</pre> - </file> - <file name="style.css"> - span { - color: black; - } - </file> - <file name="protractor.js" type="protractor"> - var colorSpan = element(by.css('span')); - - it('should check ng-style', function() { - expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)'); - element(by.css('input[value=\'set color\']')).click(); - expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)'); - element(by.css('input[value=clear]')).click(); - expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)'); - }); - </file> - </example> - */ - var ngStyleDirective = ngDirective(function(scope, element, attr) { - scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) { - if (oldStyles && (newStyles !== oldStyles)) { - forEach(oldStyles, function(val, style) { element.css(style, '');}); - } - if (newStyles) element.css(newStyles); - }, true); - }); - - /** - * @ngdoc directive - * @name ngSwitch - * @restrict EA - * - * @description - * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression. - * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location - * as specified in the template. - * - * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it - * from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element - * matches the value obtained from the evaluated expression. In other words, you define a container element - * (where you place the directive), place an expression on the **`on="..."` attribute** - * (or the **`ng-switch="..."` attribute**), define any inner elements inside of the directive and place - * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on - * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default - * attribute is displayed. - * - * <div class="alert alert-info"> - * Be aware that the attribute values to match against cannot be expressions. They are interpreted - * as literal string values to match against. - * For example, **`ng-switch-when="someVal"`** will match against the string `"someVal"` not against the - * value of the expression `$scope.someVal`. - * </div> - - * @animations - * | Animation | Occurs | - * |----------------------------------|-------------------------------------| - * | {@link ng.$animate#enter enter} | after the ngSwitch contents change and the matched child element is placed inside the container | - * | {@link ng.$animate#leave leave} | after the ngSwitch contents change and just before the former contents are removed from the DOM | - * - * @usage - * - * ``` - * <ANY ng-switch="expression"> - * <ANY ng-switch-when="matchValue1">...</ANY> - * <ANY ng-switch-when="matchValue2">...</ANY> - * <ANY ng-switch-default>...</ANY> - * </ANY> - * ``` - * - * - * @scope - * @priority 1200 - * @param {*} ngSwitch|on expression to match against <code>ng-switch-when</code>. - * On child elements add: - * - * * `ngSwitchWhen`: the case statement to match against. If match then this - * case will be displayed. If the same match appears multiple times, all the - * elements will be displayed. It is possible to associate multiple values to - * the same `ngSwitchWhen` by defining the optional attribute - * `ngSwitchWhenSeparator`. The separator will be used to split the value of - * the `ngSwitchWhen` attribute into multiple tokens, and the element will show - * if any of the `ngSwitch` evaluates to any of these tokens. - * * `ngSwitchDefault`: the default case when no other case match. If there - * are multiple default cases, all of them will be displayed when no other - * case match. - * - * - * @example - <example module="switchExample" deps="angular-animate.js" animations="true" name="ng-switch"> - <file name="index.html"> - <div ng-controller="ExampleController"> - <select ng-model="selection" ng-options="item for item in items"> - </select> - <code>selection={{selection}}</code> - <hr/> - <div class="animate-switch-container" - ng-switch on="selection"> - <div class="animate-switch" ng-switch-when="settings|options" ng-switch-when-separator="|">Settings Div</div> - <div class="animate-switch" ng-switch-when="home">Home Span</div> - <div class="animate-switch" ng-switch-default>default</div> - </div> - </div> - </file> - <file name="script.js"> - angular.module('switchExample', ['ngAnimate']) - .controller('ExampleController', ['$scope', function($scope) { - $scope.items = ['settings', 'home', 'options', 'other']; - $scope.selection = $scope.items[0]; - }]); - </file> - <file name="animations.css"> - .animate-switch-container { - position:relative; - background:white; - border:1px solid black; - height:40px; - overflow:hidden; - } - - .animate-switch { - padding:10px; - } - - .animate-switch.ng-animate { - transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; - - position:absolute; - top:0; - left:0; - right:0; - bottom:0; - } - - .animate-switch.ng-leave.ng-leave-active, - .animate-switch.ng-enter { - top:-50px; - } - .animate-switch.ng-leave, - .animate-switch.ng-enter.ng-enter-active { - top:0; - } - </file> - <file name="protractor.js" type="protractor"> - var switchElem = element(by.css('[ng-switch]')); - var select = element(by.model('selection')); - - it('should start in settings', function() { - expect(switchElem.getText()).toMatch(/Settings Div/); - }); - it('should change to home', function() { - select.all(by.css('option')).get(1).click(); - expect(switchElem.getText()).toMatch(/Home Span/); - }); - it('should change to settings via "options"', function() { - select.all(by.css('option')).get(2).click(); - expect(switchElem.getText()).toMatch(/Settings Div/); - }); - it('should select default', function() { - select.all(by.css('option')).get(3).click(); - expect(switchElem.getText()).toMatch(/default/); - }); - </file> - </example> - */ - var ngSwitchDirective = ['$animate', '$compile', function($animate, $compile) { - return { - require: 'ngSwitch', - - // asks for $scope to fool the BC controller module - controller: ['$scope', function NgSwitchController() { - this.cases = {}; - }], - link: function(scope, element, attr, ngSwitchController) { - var watchExpr = attr.ngSwitch || attr.on, - selectedTranscludes = [], - selectedElements = [], - previousLeaveAnimations = [], - selectedScopes = []; - - var spliceFactory = function(array, index) { - return function(response) { - if (response !== false) array.splice(index, 1); - }; - }; - - scope.$watch(watchExpr, function ngSwitchWatchAction(value) { - var i, ii; - - // Start with the last, in case the array is modified during the loop - while (previousLeaveAnimations.length) { - $animate.cancel(previousLeaveAnimations.pop()); - } - - for (i = 0, ii = selectedScopes.length; i < ii; ++i) { - var selected = getBlockNodes(selectedElements[i].clone); - selectedScopes[i].$destroy(); - var runner = previousLeaveAnimations[i] = $animate.leave(selected); - runner.done(spliceFactory(previousLeaveAnimations, i)); - } - - selectedElements.length = 0; - selectedScopes.length = 0; - - if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) { - forEach(selectedTranscludes, function(selectedTransclude) { - selectedTransclude.transclude(function(caseElement, selectedScope) { - selectedScopes.push(selectedScope); - var anchor = selectedTransclude.element; - caseElement[caseElement.length++] = $compile.$$createComment('end ngSwitchWhen'); - var block = { clone: caseElement }; - - selectedElements.push(block); - $animate.enter(caseElement, anchor.parent(), anchor); - }); - }); - } - }); - } - }; - }]; - - var ngSwitchWhenDirective = ngDirective({ - transclude: 'element', - priority: 1200, - require: '^ngSwitch', - multiElement: true, - link: function(scope, element, attrs, ctrl, $transclude) { - - var cases = attrs.ngSwitchWhen.split(attrs.ngSwitchWhenSeparator).sort().filter( - // Filter duplicate cases - function(element, index, array) { return array[index - 1] !== element; } - ); - - forEach(cases, function(whenCase) { - ctrl.cases['!' + whenCase] = (ctrl.cases['!' + whenCase] || []); - ctrl.cases['!' + whenCase].push({ transclude: $transclude, element: element }); - }); - } - }); - - var ngSwitchDefaultDirective = ngDirective({ - transclude: 'element', - priority: 1200, - require: '^ngSwitch', - multiElement: true, - link: function(scope, element, attr, ctrl, $transclude) { - ctrl.cases['?'] = (ctrl.cases['?'] || []); - ctrl.cases['?'].push({ transclude: $transclude, element: element }); - } - }); - - /** - * @ngdoc directive - * @name ngTransclude - * @restrict EAC - * - * @description - * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion. - * - * You can specify that you want to insert a named transclusion slot, instead of the default slot, by providing the slot name - * as the value of the `ng-transclude` or `ng-transclude-slot` attribute. - * - * If the transcluded content is not empty (i.e. contains one or more DOM nodes, including whitespace text nodes), any existing - * content of this element will be removed before the transcluded content is inserted. - * If the transcluded content is empty (or only whitespace), the existing content is left intact. This lets you provide fallback - * content in the case that no transcluded content is provided. - * - * @element ANY - * - * @param {string} ngTransclude|ngTranscludeSlot the name of the slot to insert at this point. If this is not provided, is empty - * or its value is the same as the name of the attribute then the default slot is used. - * - * @example - * ### Basic transclusion - * This example demonstrates basic transclusion of content into a component directive. - * <example name="simpleTranscludeExample" module="transcludeExample"> - * <file name="index.html"> - * <script> - * angular.module('transcludeExample', []) - * .directive('pane', function(){ - * return { - * restrict: 'E', - * transclude: true, - * scope: { title:'@' }, - * template: '<div style="border: 1px solid black;">' + - * '<div style="background-color: gray">{{title}}</div>' + - * '<ng-transclude></ng-transclude>' + - * '</div>' - * }; - * }) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.title = 'Lorem Ipsum'; - * $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...'; - * }]); - * </script> - * <div ng-controller="ExampleController"> - * <input ng-model="title" aria-label="title"> <br/> - * <textarea ng-model="text" aria-label="text"></textarea> <br/> - * <pane title="{{title}}"><span>{{text}}</span></pane> - * </div> - * </file> - * <file name="protractor.js" type="protractor"> - * it('should have transcluded', function() { - * var titleElement = element(by.model('title')); - * titleElement.clear(); - * titleElement.sendKeys('TITLE'); - * var textElement = element(by.model('text')); - * textElement.clear(); - * textElement.sendKeys('TEXT'); - * expect(element(by.binding('title')).getText()).toEqual('TITLE'); - * expect(element(by.binding('text')).getText()).toEqual('TEXT'); - * }); - * </file> - * </example> - * - * @example - * ### Transclude fallback content - * This example shows how to use `NgTransclude` with fallback content, that - * is displayed if no transcluded content is provided. - * - * <example module="transcludeFallbackContentExample" name="ng-transclude"> - * <file name="index.html"> - * <script> - * angular.module('transcludeFallbackContentExample', []) - * .directive('myButton', function(){ - * return { - * restrict: 'E', - * transclude: true, - * scope: true, - * template: '<button style="cursor: pointer;">' + - * '<ng-transclude>' + - * '<b style="color: red;">Button1</b>' + - * '</ng-transclude>' + - * '</button>' - * }; - * }); - * </script> - * <!-- fallback button content --> - * <my-button id="fallback"></my-button> - * <!-- modified button content --> - * <my-button id="modified"> - * <i style="color: green;">Button2</i> - * </my-button> - * </file> - * <file name="protractor.js" type="protractor"> - * it('should have different transclude element content', function() { - * expect(element(by.id('fallback')).getText()).toBe('Button1'); - * expect(element(by.id('modified')).getText()).toBe('Button2'); - * }); - * </file> - * </example> - * - * @example - * ### Multi-slot transclusion - * This example demonstrates using multi-slot transclusion in a component directive. - * <example name="multiSlotTranscludeExample" module="multiSlotTranscludeExample"> - * <file name="index.html"> - * <style> - * .title, .footer { - * background-color: gray - * } - * </style> - * <div ng-controller="ExampleController"> - * <input ng-model="title" aria-label="title"> <br/> - * <textarea ng-model="text" aria-label="text"></textarea> <br/> - * <pane> - * <pane-title><a ng-href="{{link}}">{{title}}</a></pane-title> - * <pane-body><p>{{text}}</p></pane-body> - * </pane> - * </div> - * </file> - * <file name="app.js"> - * angular.module('multiSlotTranscludeExample', []) - * .directive('pane', function() { - * return { - * restrict: 'E', - * transclude: { - * 'title': '?paneTitle', - * 'body': 'paneBody', - * 'footer': '?paneFooter' - * }, - * template: '<div style="border: 1px solid black;">' + - * '<div class="title" ng-transclude="title">Fallback Title</div>' + - * '<div ng-transclude="body"></div>' + - * '<div class="footer" ng-transclude="footer">Fallback Footer</div>' + - * '</div>' - * }; - * }) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.title = 'Lorem Ipsum'; - * $scope.link = 'https://google.com'; - * $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...'; - * }]); - * </file> - * <file name="protractor.js" type="protractor"> - * it('should have transcluded the title and the body', function() { - * var titleElement = element(by.model('title')); - * titleElement.clear(); - * titleElement.sendKeys('TITLE'); - * var textElement = element(by.model('text')); - * textElement.clear(); - * textElement.sendKeys('TEXT'); - * expect(element(by.css('.title')).getText()).toEqual('TITLE'); - * expect(element(by.binding('text')).getText()).toEqual('TEXT'); - * expect(element(by.css('.footer')).getText()).toEqual('Fallback Footer'); - * }); - * </file> - * </example> - */ - var ngTranscludeMinErr = minErr('ngTransclude'); - var ngTranscludeDirective = ['$compile', function($compile) { - return { - restrict: 'EAC', - compile: function ngTranscludeCompile(tElement) { - - // Remove and cache any original content to act as a fallback - var fallbackLinkFn = $compile(tElement.contents()); - tElement.empty(); - - return function ngTranscludePostLink($scope, $element, $attrs, controller, $transclude) { - - if (!$transclude) { - throw ngTranscludeMinErr('orphan', - 'Illegal use of ngTransclude directive in the template! ' + - 'No parent directive that requires a transclusion found. ' + - 'Element: {0}', - startingTag($element)); - } - - - // If the attribute is of the form: `ng-transclude="ng-transclude"` then treat it like the default - if ($attrs.ngTransclude === $attrs.$attr.ngTransclude) { - $attrs.ngTransclude = ''; - } - var slotName = $attrs.ngTransclude || $attrs.ngTranscludeSlot; - - // If the slot is required and no transclusion content is provided then this call will throw an error - $transclude(ngTranscludeCloneAttachFn, null, slotName); - - // If the slot is optional and no transclusion content is provided then use the fallback content - if (slotName && !$transclude.isSlotFilled(slotName)) { - useFallbackContent(); - } - - function ngTranscludeCloneAttachFn(clone, transcludedScope) { - if (clone.length && notWhitespace(clone)) { - $element.append(clone); - } else { - useFallbackContent(); - // There is nothing linked against the transcluded scope since no content was available, - // so it should be safe to clean up the generated scope. - transcludedScope.$destroy(); - } - } - - function useFallbackContent() { - // Since this is the fallback content rather than the transcluded content, - // we link against the scope of this directive rather than the transcluded scope - fallbackLinkFn($scope, function(clone) { - $element.append(clone); - }); - } - - function notWhitespace(nodes) { - for (var i = 0, ii = nodes.length; i < ii; i++) { - var node = nodes[i]; - if (node.nodeType !== NODE_TYPE_TEXT || node.nodeValue.trim()) { - return true; - } - } - } - }; - } - }; - }]; - - /** - * @ngdoc directive - * @name script - * @restrict E - * - * @description - * Load the content of a `<script>` element into {@link ng.$templateCache `$templateCache`}, so that the - * template can be used by {@link ng.directive:ngInclude `ngInclude`}, - * {@link ngRoute.directive:ngView `ngView`}, or {@link guide/directive directives}. The type of the - * `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be - * assigned through the element's `id`, which can then be used as a directive's `templateUrl`. - * - * @param {string} type Must be set to `'text/ng-template'`. - * @param {string} id Cache name of the template. - * - * @example - <example name="script-tag"> - <file name="index.html"> - <script type="text/ng-template" id="/tpl.html"> - Content of the template. - </script> - - <a ng-click="currentTpl='/tpl.html'" id="tpl-link">Load inlined template</a> - <div id="tpl-content" ng-include src="currentTpl"></div> - </file> - <file name="protractor.js" type="protractor"> - it('should load template defined inside script tag', function() { - element(by.css('#tpl-link')).click(); - expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/); - }); - </file> - </example> - */ - var scriptDirective = ['$templateCache', function($templateCache) { - return { - restrict: 'E', - terminal: true, - compile: function(element, attr) { - if (attr.type === 'text/ng-template') { - var templateUrl = attr.id, - text = element[0].text; - - $templateCache.put(templateUrl, text); - } - } - }; - }]; - - /* exported selectDirective, optionDirective */ - - var noopNgModelController = { $setViewValue: noop, $render: noop }; - - function setOptionSelectedStatus(optionEl, value) { - optionEl.prop('selected', value); - /** - * When unselecting an option, setting the property to null / false should be enough - * However, screenreaders might react to the selected attribute instead, see - * https://github.com/angular/angular.js/issues/14419 - * Note: "selected" is a boolean attr and will be removed when the "value" arg in attr() is false - * or null - */ - optionEl.attr('selected', value); - } - - /** - * @ngdoc type - * @name select.SelectController - * - * @description - * The controller for the {@link ng.select select} directive. The controller exposes - * a few utility methods that can be used to augment the behavior of a regular or an - * {@link ng.ngOptions ngOptions} select element. - * - * @example - * ### Set a custom error when the unknown option is selected - * - * This example sets a custom error "unknownValue" on the ngModelController - * when the select element's unknown option is selected, i.e. when the model is set to a value - * that is not matched by any option. - * - * <example name="select-unknown-value-error" module="staticSelect"> - * <file name="index.html"> - * <div ng-controller="ExampleController"> - * <form name="myForm"> - * <label for="testSelect"> Single select: </label><br> - * <select name="testSelect" ng-model="selected" unknown-value-error> - * <option value="option-1">Option 1</option> - * <option value="option-2">Option 2</option> - * </select><br> - * <span class="error" ng-if="myForm.testSelect.$error.unknownValue"> - * Error: The current model doesn't match any option</span><br> - * - * <button ng-click="forceUnknownOption()">Force unknown option</button><br> - * </form> - * </div> - * </file> - * <file name="app.js"> - * angular.module('staticSelect', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.selected = null; - * - * $scope.forceUnknownOption = function() { - * $scope.selected = 'nonsense'; - * }; - * }]) - * .directive('unknownValueError', function() { - * return { - * require: ['ngModel', 'select'], - * link: function(scope, element, attrs, ctrls) { - * var ngModelCtrl = ctrls[0]; - * var selectCtrl = ctrls[1]; - * - * ngModelCtrl.$validators.unknownValue = function(modelValue, viewValue) { - * if (selectCtrl.$isUnknownOptionSelected()) { - * return false; - * } - * - * return true; - * }; - * } - * - * }; - * }); - * </file> - *</example> - * - * - * @example - * ### Set the "required" error when the unknown option is selected. - * - * By default, the "required" error on the ngModelController is only set on a required select - * when the empty option is selected. This example adds a custom directive that also sets the - * error when the unknown option is selected. - * - * <example name="select-unknown-value-required" module="staticSelect"> - * <file name="index.html"> - * <div ng-controller="ExampleController"> - * <form name="myForm"> - * <label for="testSelect"> Select: </label><br> - * <select name="testSelect" ng-model="selected" required unknown-value-required> - * <option value="option-1">Option 1</option> - * <option value="option-2">Option 2</option> - * </select><br> - * <span class="error" ng-if="myForm.testSelect.$error.required">Error: Please select a value</span><br> - * - * <button ng-click="forceUnknownOption()">Force unknown option</button><br> - * </form> - * </div> - * </file> - * <file name="app.js"> - * angular.module('staticSelect', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.selected = null; - * - * $scope.forceUnknownOption = function() { - * $scope.selected = 'nonsense'; - * }; - * }]) - * .directive('unknownValueRequired', function() { - * return { - * priority: 1, // This directive must run after the required directive has added its validator - * require: ['ngModel', 'select'], - * link: function(scope, element, attrs, ctrls) { - * var ngModelCtrl = ctrls[0]; - * var selectCtrl = ctrls[1]; - * - * var originalRequiredValidator = ngModelCtrl.$validators.required; - * - * ngModelCtrl.$validators.required = function() { - * if (attrs.required && selectCtrl.$isUnknownOptionSelected()) { - * return false; - * } - * - * return originalRequiredValidator.apply(this, arguments); - * }; - * } - * }; - * }); - * </file> - * <file name="protractor.js" type="protractor"> - * it('should show the error message when the unknown option is selected', function() { - - var error = element(by.className('error')); - - expect(error.getText()).toBe('Error: Please select a value'); - - element(by.cssContainingText('option', 'Option 1')).click(); - - expect(error.isPresent()).toBe(false); - - element(by.tagName('button')).click(); - - expect(error.getText()).toBe('Error: Please select a value'); - }); - * </file> - *</example> - * - * - */ - var SelectController = - ['$element', '$scope', /** @this */ function($element, $scope) { - - var self = this, - optionsMap = new NgMap(); - - self.selectValueMap = {}; // Keys are the hashed values, values the original values - - // If the ngModel doesn't get provided then provide a dummy noop version to prevent errors - self.ngModelCtrl = noopNgModelController; - self.multiple = false; - - // The "unknown" option is one that is prepended to the list if the viewValue - // does not match any of the options. When it is rendered the value of the unknown - // option is '? XXX ?' where XXX is the hashKey of the value that is not known. - // - // Support: IE 9 only - // We can't just jqLite('<option>') since jqLite is not smart enough - // to create it in <select> and IE barfs otherwise. - self.unknownOption = jqLite(window.document.createElement('option')); - - // The empty option is an option with the value '' that the application developer can - // provide inside the select. It is always selectable and indicates that a "null" selection has - // been made by the user. - // If the select has an empty option, and the model of the select is set to "undefined" or "null", - // the empty option is selected. - // If the model is set to a different unmatched value, the unknown option is rendered and - // selected, i.e both are present, because a "null" selection and an unknown value are different. - self.hasEmptyOption = false; - self.emptyOption = undefined; - - self.renderUnknownOption = function(val) { - var unknownVal = self.generateUnknownOptionValue(val); - self.unknownOption.val(unknownVal); - $element.prepend(self.unknownOption); - setOptionSelectedStatus(self.unknownOption, true); - $element.val(unknownVal); - }; - - self.updateUnknownOption = function(val) { - var unknownVal = self.generateUnknownOptionValue(val); - self.unknownOption.val(unknownVal); - setOptionSelectedStatus(self.unknownOption, true); - $element.val(unknownVal); - }; - - self.generateUnknownOptionValue = function(val) { - return '? ' + hashKey(val) + ' ?'; - }; - - self.removeUnknownOption = function() { - if (self.unknownOption.parent()) self.unknownOption.remove(); - }; - - self.selectEmptyOption = function() { - if (self.emptyOption) { - $element.val(''); - setOptionSelectedStatus(self.emptyOption, true); - } - }; - - self.unselectEmptyOption = function() { - if (self.hasEmptyOption) { - setOptionSelectedStatus(self.emptyOption, false); - } - }; - - $scope.$on('$destroy', function() { - // disable unknown option so that we don't do work when the whole select is being destroyed - self.renderUnknownOption = noop; - }); - - // Read the value of the select control, the implementation of this changes depending - // upon whether the select can have multiple values and whether ngOptions is at work. - self.readValue = function readSingleValue() { - var val = $element.val(); - // ngValue added option values are stored in the selectValueMap, normal interpolations are not - var realVal = val in self.selectValueMap ? self.selectValueMap[val] : val; - - if (self.hasOption(realVal)) { - return realVal; - } - - return null; - }; - - - // Write the value to the select control, the implementation of this changes depending - // upon whether the select can have multiple values and whether ngOptions is at work. - self.writeValue = function writeSingleValue(value) { - // Make sure to remove the selected attribute from the previously selected option - // Otherwise, screen readers might get confused - var currentlySelectedOption = $element[0].options[$element[0].selectedIndex]; - if (currentlySelectedOption) setOptionSelectedStatus(jqLite(currentlySelectedOption), false); - - if (self.hasOption(value)) { - self.removeUnknownOption(); - - var hashedVal = hashKey(value); - $element.val(hashedVal in self.selectValueMap ? hashedVal : value); - - // Set selected attribute and property on selected option for screen readers - var selectedOption = $element[0].options[$element[0].selectedIndex]; - setOptionSelectedStatus(jqLite(selectedOption), true); - } else { - self.selectUnknownOrEmptyOption(value); - } - }; - - - // Tell the select control that an option, with the given value, has been added - self.addOption = function(value, element) { - // Skip comment nodes, as they only pollute the `optionsMap` - if (element[0].nodeType === NODE_TYPE_COMMENT) return; - - assertNotHasOwnProperty(value, '"option value"'); - if (value === '') { - self.hasEmptyOption = true; - self.emptyOption = element; - } - var count = optionsMap.get(value) || 0; - optionsMap.set(value, count + 1); - // Only render at the end of a digest. This improves render performance when many options - // are added during a digest and ensures all relevant options are correctly marked as selected - scheduleRender(); - }; - - // Tell the select control that an option, with the given value, has been removed - self.removeOption = function(value) { - var count = optionsMap.get(value); - if (count) { - if (count === 1) { - optionsMap.delete(value); - if (value === '') { - self.hasEmptyOption = false; - self.emptyOption = undefined; - } - } else { - optionsMap.set(value, count - 1); - } - } - }; - - // Check whether the select control has an option matching the given value - self.hasOption = function(value) { - return !!optionsMap.get(value); - }; - - /** - * @ngdoc method - * @name select.SelectController#$hasEmptyOption - * - * @description - * - * Returns `true` if the select element currently has an empty option - * element, i.e. an option that signifies that the select is empty / the selection is null. - * - */ - self.$hasEmptyOption = function() { - return self.hasEmptyOption; - }; - - /** - * @ngdoc method - * @name select.SelectController#$isUnknownOptionSelected - * - * @description - * - * Returns `true` if the select element's unknown option is selected. The unknown option is added - * and automatically selected whenever the select model doesn't match any option. - * - */ - self.$isUnknownOptionSelected = function() { - // Presence of the unknown option means it is selected - return $element[0].options[0] === self.unknownOption[0]; - }; - - /** - * @ngdoc method - * @name select.SelectController#$isEmptyOptionSelected - * - * @description - * - * Returns `true` if the select element has an empty option and this empty option is currently - * selected. Returns `false` if the select element has no empty option or it is not selected. - * - */ - self.$isEmptyOptionSelected = function() { - return self.hasEmptyOption && $element[0].options[$element[0].selectedIndex] === self.emptyOption[0]; - }; - - self.selectUnknownOrEmptyOption = function(value) { - if (value == null && self.emptyOption) { - self.removeUnknownOption(); - self.selectEmptyOption(); - } else if (self.unknownOption.parent().length) { - self.updateUnknownOption(value); - } else { - self.renderUnknownOption(value); - } - }; - - var renderScheduled = false; - function scheduleRender() { - if (renderScheduled) return; - renderScheduled = true; - $scope.$$postDigest(function() { - renderScheduled = false; - self.ngModelCtrl.$render(); - }); - } - - var updateScheduled = false; - function scheduleViewValueUpdate(renderAfter) { - if (updateScheduled) return; - - updateScheduled = true; - - $scope.$$postDigest(function() { - if ($scope.$$destroyed) return; - - updateScheduled = false; - self.ngModelCtrl.$setViewValue(self.readValue()); - if (renderAfter) self.ngModelCtrl.$render(); - }); - } - - - self.registerOption = function(optionScope, optionElement, optionAttrs, interpolateValueFn, interpolateTextFn) { - - if (optionAttrs.$attr.ngValue) { - // The value attribute is set by ngValue - var oldVal, hashedVal = NaN; - optionAttrs.$observe('value', function valueAttributeObserveAction(newVal) { - - var removal; - var previouslySelected = optionElement.prop('selected'); - - if (isDefined(hashedVal)) { - self.removeOption(oldVal); - delete self.selectValueMap[hashedVal]; - removal = true; - } - - hashedVal = hashKey(newVal); - oldVal = newVal; - self.selectValueMap[hashedVal] = newVal; - self.addOption(newVal, optionElement); - // Set the attribute directly instead of using optionAttrs.$set - this stops the observer - // from firing a second time. Other $observers on value will also get the result of the - // ngValue expression, not the hashed value - optionElement.attr('value', hashedVal); - - if (removal && previouslySelected) { - scheduleViewValueUpdate(); - } - - }); - } else if (interpolateValueFn) { - // The value attribute is interpolated - optionAttrs.$observe('value', function valueAttributeObserveAction(newVal) { - // This method is overwritten in ngOptions and has side-effects! - self.readValue(); - - var removal; - var previouslySelected = optionElement.prop('selected'); - - if (isDefined(oldVal)) { - self.removeOption(oldVal); - removal = true; - } - oldVal = newVal; - self.addOption(newVal, optionElement); - - if (removal && previouslySelected) { - scheduleViewValueUpdate(); - } - }); - } else if (interpolateTextFn) { - // The text content is interpolated - optionScope.$watch(interpolateTextFn, function interpolateWatchAction(newVal, oldVal) { - optionAttrs.$set('value', newVal); - var previouslySelected = optionElement.prop('selected'); - if (oldVal !== newVal) { - self.removeOption(oldVal); - } - self.addOption(newVal, optionElement); - - if (oldVal && previouslySelected) { - scheduleViewValueUpdate(); - } - }); - } else { - // The value attribute is static - self.addOption(optionAttrs.value, optionElement); - } - - - optionAttrs.$observe('disabled', function(newVal) { - - // Since model updates will also select disabled options (like ngOptions), - // we only have to handle options becoming disabled, not enabled - - if (newVal === 'true' || newVal && optionElement.prop('selected')) { - if (self.multiple) { - scheduleViewValueUpdate(true); - } else { - self.ngModelCtrl.$setViewValue(null); - self.ngModelCtrl.$render(); - } - } - }); - - optionElement.on('$destroy', function() { - var currentValue = self.readValue(); - var removeValue = optionAttrs.value; - - self.removeOption(removeValue); - scheduleRender(); - - if (self.multiple && currentValue && currentValue.indexOf(removeValue) !== -1 || - currentValue === removeValue - ) { - // When multiple (selected) options are destroyed at the same time, we don't want - // to run a model update for each of them. Instead, run a single update in the $$postDigest - scheduleViewValueUpdate(true); - } - }); - }; - }]; - - /** - * @ngdoc directive - * @name select - * @restrict E - * - * @description - * HTML `select` element with AngularJS data-binding. - * - * The `select` directive is used together with {@link ngModel `ngModel`} to provide data-binding - * between the scope and the `<select>` control (including setting default values). - * It also handles dynamic `<option>` elements, which can be added using the {@link ngRepeat `ngRepeat}` or - * {@link ngOptions `ngOptions`} directives. - * - * When an item in the `<select>` menu is selected, the value of the selected option will be bound - * to the model identified by the `ngModel` directive. With static or repeated options, this is - * the content of the `value` attribute or the textContent of the `<option>`, if the value attribute is missing. - * Value and textContent can be interpolated. - * - * The {@link select.SelectController select controller} exposes utility functions that can be used - * to manipulate the select's behavior. - * - * ## Matching model and option values - * - * In general, the match between the model and an option is evaluated by strictly comparing the model - * value against the value of the available options. - * - * If you are setting the option value with the option's `value` attribute, or textContent, the - * value will always be a `string` which means that the model value must also be a string. - * Otherwise the `select` directive cannot match them correctly. - * - * To bind the model to a non-string value, you can use one of the following strategies: - * - the {@link ng.ngOptions `ngOptions`} directive - * ({@link ng.select#using-select-with-ngoptions-and-setting-a-default-value}) - * - the {@link ng.ngValue `ngValue`} directive, which allows arbitrary expressions to be - * option values ({@link ng.select#using-ngvalue-to-bind-the-model-to-an-array-of-objects Example}) - * - model $parsers / $formatters to convert the string value - * ({@link ng.select#binding-select-to-a-non-string-value-via-ngmodel-parsing-formatting Example}) - * - * If the viewValue of `ngModel` does not match any of the options, then the control - * will automatically add an "unknown" option, which it then removes when the mismatch is resolved. - * - * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can - * be nested into the `<select>` element. This element will then represent the `null` or "not selected" - * option. See example below for demonstration. - * - * ## Choosing between `ngRepeat` and `ngOptions` - * - * In many cases, `ngRepeat` can be used on `<option>` elements instead of {@link ng.directive:ngOptions - * ngOptions} to achieve a similar result. However, `ngOptions` provides some benefits: - * - more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the - * comprehension expression - * - reduced memory consumption by not creating a new scope for each repeated instance - * - increased render speed by creating the options in a documentFragment instead of individually - * - * Specifically, select with repeated options slows down significantly starting at 2000 options in - * Chrome and Internet Explorer / Edge. - * - * - * @param {string} ngModel Assignable AngularJS expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} multiple Allows multiple options to be selected. The selected values will be - * bound to the model as an array. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds required attribute and required validation constraint to - * the element when the ngRequired expression evaluates to true. Use ngRequired instead of required - * when you want to data-bind to the required attribute. - * @param {string=} ngChange AngularJS expression to be executed when selected option(s) changes due to user - * interaction with the select element. - * @param {string=} ngOptions sets the options that the select is populated with and defines what is - * set on the model on selection. See {@link ngOptions `ngOptions`}. - * @param {string=} ngAttrSize sets the size of the select element dynamically. Uses the - * {@link guide/interpolation#-ngattr-for-binding-to-arbitrary-attributes ngAttr} directive. - * - * - * @knownIssue - * - * In Firefox, the select model is only updated when the select element is blurred. For example, - * when switching between options with the keyboard, the select model is only set to the - * currently selected option when the select is blurred, e.g via tab key or clicking the mouse - * outside the select. - * - * This is due to an ambiguity in the select element specification. See the - * [issue on the Firefox bug tracker](https://bugzilla.mozilla.org/show_bug.cgi?id=126379) - * for more information, and this - * [Github comment for a workaround](https://github.com/angular/angular.js/issues/9134#issuecomment-130800488) - * - * @example - * ### Simple `select` elements with static options - * - * <example name="static-select" module="staticSelect"> - * <file name="index.html"> - * <div ng-controller="ExampleController"> - * <form name="myForm"> - * <label for="singleSelect"> Single select: </label><br> - * <select name="singleSelect" ng-model="data.singleSelect"> - * <option value="option-1">Option 1</option> - * <option value="option-2">Option 2</option> - * </select><br> - * - * <label for="singleSelect"> Single select with "not selected" option and dynamic option values: </label><br> - * <select name="singleSelect" id="singleSelect" ng-model="data.singleSelect"> - * <option value="">---Please select---</option> <!-- not selected / blank option --> - * <option value="{{data.option1}}">Option 1</option> <!-- interpolation --> - * <option value="option-2">Option 2</option> - * </select><br> - * <button ng-click="forceUnknownOption()">Force unknown option</button><br> - * <tt>singleSelect = {{data.singleSelect}}</tt> - * - * <hr> - * <label for="multipleSelect"> Multiple select: </label><br> - * <select name="multipleSelect" id="multipleSelect" ng-model="data.multipleSelect" multiple> - * <option value="option-1">Option 1</option> - * <option value="option-2">Option 2</option> - * <option value="option-3">Option 3</option> - * </select><br> - * <tt>multipleSelect = {{data.multipleSelect}}</tt><br/> - * </form> - * </div> - * </file> - * <file name="app.js"> - * angular.module('staticSelect', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.data = { - * singleSelect: null, - * multipleSelect: [], - * option1: 'option-1' - * }; - * - * $scope.forceUnknownOption = function() { - * $scope.data.singleSelect = 'nonsense'; - * }; - * }]); - * </file> - *</example> - * - * @example - * ### Using `ngRepeat` to generate `select` options - * <example name="select-ngrepeat" module="ngrepeatSelect"> - * <file name="index.html"> - * <div ng-controller="ExampleController"> - * <form name="myForm"> - * <label for="repeatSelect"> Repeat select: </label> - * <select name="repeatSelect" id="repeatSelect" ng-model="data.model"> - * <option ng-repeat="option in data.availableOptions" value="{{option.id}}">{{option.name}}</option> - * </select> - * </form> - * <hr> - * <tt>model = {{data.model}}</tt><br/> - * </div> - * </file> - * <file name="app.js"> - * angular.module('ngrepeatSelect', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.data = { - * model: null, - * availableOptions: [ - * {id: '1', name: 'Option A'}, - * {id: '2', name: 'Option B'}, - * {id: '3', name: 'Option C'} - * ] - * }; - * }]); - * </file> - *</example> - * - * @example - * ### Using `ngValue` to bind the model to an array of objects - * <example name="select-ngvalue" module="ngvalueSelect"> - * <file name="index.html"> - * <div ng-controller="ExampleController"> - * <form name="myForm"> - * <label for="ngvalueselect"> ngvalue select: </label> - * <select size="6" name="ngvalueselect" ng-model="data.model" multiple> - * <option ng-repeat="option in data.availableOptions" ng-value="option.value">{{option.name}}</option> - * </select> - * </form> - * <hr> - * <pre>model = {{data.model | json}}</pre><br/> - * </div> - * </file> - * <file name="app.js"> - * angular.module('ngvalueSelect', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.data = { - * model: null, - * availableOptions: [ - {value: 'myString', name: 'string'}, - {value: 1, name: 'integer'}, - {value: true, name: 'boolean'}, - {value: null, name: 'null'}, - {value: {prop: 'value'}, name: 'object'}, - {value: ['a'], name: 'array'} - * ] - * }; - * }]); - * </file> - *</example> - * - * @example - * ### Using `select` with `ngOptions` and setting a default value - * See the {@link ngOptions ngOptions documentation} for more `ngOptions` usage examples. - * - * <example name="select-with-default-values" module="defaultValueSelect"> - * <file name="index.html"> - * <div ng-controller="ExampleController"> - * <form name="myForm"> - * <label for="mySelect">Make a choice:</label> - * <select name="mySelect" id="mySelect" - * ng-options="option.name for option in data.availableOptions track by option.id" - * ng-model="data.selectedOption"></select> - * </form> - * <hr> - * <tt>option = {{data.selectedOption}}</tt><br/> - * </div> - * </file> - * <file name="app.js"> - * angular.module('defaultValueSelect', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.data = { - * availableOptions: [ - * {id: '1', name: 'Option A'}, - * {id: '2', name: 'Option B'}, - * {id: '3', name: 'Option C'} - * ], - * selectedOption: {id: '3', name: 'Option C'} //This sets the default value of the select in the ui - * }; - * }]); - * </file> - *</example> - * - * @example - * ### Binding `select` to a non-string value via `ngModel` parsing / formatting - * - * <example name="select-with-non-string-options" module="nonStringSelect"> - * <file name="index.html"> - * <select ng-model="model.id" convert-to-number> - * <option value="0">Zero</option> - * <option value="1">One</option> - * <option value="2">Two</option> - * </select> - * {{ model }} - * </file> - * <file name="app.js"> - * angular.module('nonStringSelect', []) - * .run(function($rootScope) { - * $rootScope.model = { id: 2 }; - * }) - * .directive('convertToNumber', function() { - * return { - * require: 'ngModel', - * link: function(scope, element, attrs, ngModel) { - * ngModel.$parsers.push(function(val) { - * return parseInt(val, 10); - * }); - * ngModel.$formatters.push(function(val) { - * return '' + val; - * }); - * } - * }; - * }); - * </file> - * <file name="protractor.js" type="protractor"> - * it('should initialize to model', function() { - * expect(element(by.model('model.id')).$('option:checked').getText()).toEqual('Two'); - * }); - * </file> - * </example> - * - */ - var selectDirective = function() { - - return { - restrict: 'E', - require: ['select', '?ngModel'], - controller: SelectController, - priority: 1, - link: { - pre: selectPreLink, - post: selectPostLink - } - }; - - function selectPreLink(scope, element, attr, ctrls) { - - var selectCtrl = ctrls[0]; - var ngModelCtrl = ctrls[1]; - - // if ngModel is not defined, we don't need to do anything but set the registerOption - // function to noop, so options don't get added internally - if (!ngModelCtrl) { - selectCtrl.registerOption = noop; - return; - } - - - selectCtrl.ngModelCtrl = ngModelCtrl; - - // When the selected item(s) changes we delegate getting the value of the select control - // to the `readValue` method, which can be changed if the select can have multiple - // selected values or if the options are being generated by `ngOptions` - element.on('change', function() { - selectCtrl.removeUnknownOption(); - scope.$apply(function() { - ngModelCtrl.$setViewValue(selectCtrl.readValue()); - }); - }); - - // If the select allows multiple values then we need to modify how we read and write - // values from and to the control; also what it means for the value to be empty and - // we have to add an extra watch since ngModel doesn't work well with arrays - it - // doesn't trigger rendering if only an item in the array changes. - if (attr.multiple) { - selectCtrl.multiple = true; - - // Read value now needs to check each option to see if it is selected - selectCtrl.readValue = function readMultipleValue() { - var array = []; - forEach(element.find('option'), function(option) { - if (option.selected && !option.disabled) { - var val = option.value; - array.push(val in selectCtrl.selectValueMap ? selectCtrl.selectValueMap[val] : val); - } - }); - return array; - }; - - // Write value now needs to set the selected property of each matching option - selectCtrl.writeValue = function writeMultipleValue(value) { - forEach(element.find('option'), function(option) { - var shouldBeSelected = !!value && (includes(value, option.value) || - includes(value, selectCtrl.selectValueMap[option.value])); - var currentlySelected = option.selected; - - // Support: IE 9-11 only, Edge 12-15+ - // In IE and Edge adding options to the selection via shift+click/UP/DOWN - // will de-select already selected options if "selected" on those options was set - // more than once (i.e. when the options were already selected) - // So we only modify the selected property if necessary. - // Note: this behavior cannot be replicated via unit tests because it only shows in the - // actual user interface. - if (shouldBeSelected !== currentlySelected) { - setOptionSelectedStatus(jqLite(option), shouldBeSelected); - } - - }); - }; - - // we have to do it on each watch since ngModel watches reference, but - // we need to work of an array, so we need to see if anything was inserted/removed - var lastView, lastViewRef = NaN; - scope.$watch(function selectMultipleWatch() { - if (lastViewRef === ngModelCtrl.$viewValue && !equals(lastView, ngModelCtrl.$viewValue)) { - lastView = shallowCopy(ngModelCtrl.$viewValue); - ngModelCtrl.$render(); - } - lastViewRef = ngModelCtrl.$viewValue; - }); - - // If we are a multiple select then value is now a collection - // so the meaning of $isEmpty changes - ngModelCtrl.$isEmpty = function(value) { - return !value || value.length === 0; - }; - - } - } - - function selectPostLink(scope, element, attrs, ctrls) { - // if ngModel is not defined, we don't need to do anything - var ngModelCtrl = ctrls[1]; - if (!ngModelCtrl) return; - - var selectCtrl = ctrls[0]; - - // We delegate rendering to the `writeValue` method, which can be changed - // if the select can have multiple selected values or if the options are being - // generated by `ngOptions`. - // This must be done in the postLink fn to prevent $render to be called before - // all nodes have been linked correctly. - ngModelCtrl.$render = function() { - selectCtrl.writeValue(ngModelCtrl.$viewValue); - }; - } - }; - - -// The option directive is purely designed to communicate the existence (or lack of) -// of dynamically created (and destroyed) option elements to their containing select -// directive via its controller. - var optionDirective = ['$interpolate', function($interpolate) { - return { - restrict: 'E', - priority: 100, - compile: function(element, attr) { - var interpolateValueFn, interpolateTextFn; - - if (isDefined(attr.ngValue)) { - // Will be handled by registerOption - } else if (isDefined(attr.value)) { - // If the value attribute is defined, check if it contains an interpolation - interpolateValueFn = $interpolate(attr.value, true); - } else { - // If the value attribute is not defined then we fall back to the - // text content of the option element, which may be interpolated - interpolateTextFn = $interpolate(element.text(), true); - if (!interpolateTextFn) { - attr.$set('value', element.text()); - } - } - - return function(scope, element, attr) { - // This is an optimization over using ^^ since we don't want to have to search - // all the way to the root of the DOM for every single option element - var selectCtrlName = '$selectController', - parent = element.parent(), - selectCtrl = parent.data(selectCtrlName) || - parent.parent().data(selectCtrlName); // in case we are in optgroup - - if (selectCtrl) { - selectCtrl.registerOption(scope, element, attr, interpolateValueFn, interpolateTextFn); - } - }; - } - }; - }]; - - /** - * @ngdoc directive - * @name ngRequired - * @restrict A - * - * @param {expression} ngRequired AngularJS expression. If it evaluates to `true`, it sets the - * `required` attribute to the element and adds the `required` - * {@link ngModel.NgModelController#$validators `validator`}. - * - * @description - * - * ngRequired adds the required {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}. - * It is most often used for {@link input `input`} and {@link select `select`} controls, but can also be - * applied to custom controls. - * - * The directive sets the `required` attribute on the element if the AngularJS expression inside - * `ngRequired` evaluates to true. A special directive for setting `required` is necessary because we - * cannot use interpolation inside `required`. See the {@link guide/interpolation interpolation guide} - * for more info. - * - * The validator will set the `required` error key to true if the `required` attribute is set and - * calling {@link ngModel.NgModelController#$isEmpty `NgModelController.$isEmpty`} with the - * {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`} returns `true`. For example, the - * `$isEmpty()` implementation for `input[text]` checks the length of the `$viewValue`. When developing - * custom controls, `$isEmpty()` can be overwritten to account for a $viewValue that is not string-based. - * - * @example - * <example name="ngRequiredDirective" module="ngRequiredExample"> - * <file name="index.html"> - * <script> - * angular.module('ngRequiredExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.required = true; - * }]); - * </script> - * <div ng-controller="ExampleController"> - * <form name="form"> - * <label for="required">Toggle required: </label> - * <input type="checkbox" ng-model="required" id="required" /> - * <br> - * <label for="input">This input must be filled if `required` is true: </label> - * <input type="text" ng-model="model" id="input" name="input" ng-required="required" /><br> - * <hr> - * required error set? = <code>{{form.input.$error.required}}</code><br> - * model = <code>{{model}}</code> - * </form> - * </div> - * </file> - * <file name="protractor.js" type="protractor"> - var required = element(by.binding('form.input.$error.required')); - var model = element(by.binding('model')); - var input = element(by.id('input')); - - it('should set the required error', function() { - expect(required.getText()).toContain('true'); - - input.sendKeys('123'); - expect(required.getText()).not.toContain('true'); - expect(model.getText()).toContain('123'); - }); - * </file> - * </example> - */ - var requiredDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - attr.required = true; // force truthy in case we are on non input element - - ctrl.$validators.required = function(modelValue, viewValue) { - return !attr.required || !ctrl.$isEmpty(viewValue); - }; - - attr.$observe('required', function() { - ctrl.$validate(); - }); - } - }; - }; - - /** - * @ngdoc directive - * @name ngPattern - * @restrict A - * - * @param {expression|RegExp} ngPattern AngularJS expression that must evaluate to a `RegExp` or a `String` - * parsable into a `RegExp`, or a `RegExp` literal. See above for - * more details. - * - * @description - * - * ngPattern adds the pattern {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}. - * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls. - * - * The validator sets the `pattern` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`} - * does not match a RegExp which is obtained from the `ngPattern` attribute value: - * - the value is an AngularJS expression: - * - If the expression evaluates to a RegExp object, then this is used directly. - * - If the expression evaluates to a string, then it will be converted to a RegExp after wrapping it - * in `^` and `$` characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. - * - If the value is a RegExp literal, e.g. `ngPattern="/^\d+$/"`, it is used directly. - * - * <div class="alert alert-info"> - * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to - * start at the index of the last search's match, thus not taking the whole input value into - * account. - * </div> - * - * <div class="alert alert-info"> - * **Note:** This directive is also added when the plain `pattern` attribute is used, with two - * differences: - * <ol> - * <li> - * `ngPattern` does not set the `pattern` attribute and therefore HTML5 constraint validation is - * not available. - * </li> - * <li> - * The `ngPattern` attribute must be an expression, while the `pattern` value must be - * interpolated. - * </li> - * </ol> - * </div> - * - * @example - * <example name="ngPatternDirective" module="ngPatternExample"> - * <file name="index.html"> - * <script> - * angular.module('ngPatternExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.regex = '\\d+'; - * }]); - * </script> - * <div ng-controller="ExampleController"> - * <form name="form"> - * <label for="regex">Set a pattern (regex string): </label> - * <input type="text" ng-model="regex" id="regex" /> - * <br> - * <label for="input">This input is restricted by the current pattern: </label> - * <input type="text" ng-model="model" id="input" name="input" ng-pattern="regex" /><br> - * <hr> - * input valid? = <code>{{form.input.$valid}}</code><br> - * model = <code>{{model}}</code> - * </form> - * </div> - * </file> - * <file name="protractor.js" type="protractor"> - var model = element(by.binding('model')); - var input = element(by.id('input')); - - it('should validate the input with the default pattern', function() { - input.sendKeys('aaa'); - expect(model.getText()).not.toContain('aaa'); - - input.clear().then(function() { - input.sendKeys('123'); - expect(model.getText()).toContain('123'); - }); - }); - * </file> - * </example> - */ - var patternDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - - var regexp, patternExp = attr.ngPattern || attr.pattern; - attr.$observe('pattern', function(regex) { - if (isString(regex) && regex.length > 0) { - regex = new RegExp('^' + regex + '$'); - } - - if (regex && !regex.test) { - throw minErr('ngPattern')('noregexp', - 'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp, - regex, startingTag(elm)); - } - - regexp = regex || undefined; - ctrl.$validate(); - }); - - ctrl.$validators.pattern = function(modelValue, viewValue) { - // HTML5 pattern constraint validates the input value, so we validate the viewValue - return ctrl.$isEmpty(viewValue) || isUndefined(regexp) || regexp.test(viewValue); - }; - } - }; - }; - - /** - * @ngdoc directive - * @name ngMaxlength - * @restrict A - * - * @param {expression} ngMaxlength AngularJS expression that must evaluate to a `Number` or `String` - * parsable into a `Number`. Used as value for the `maxlength` - * {@link ngModel.NgModelController#$validators validator}. - * - * @description - * - * ngMaxlength adds the maxlength {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}. - * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls. - * - * The validator sets the `maxlength` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`} - * is longer than the integer obtained by evaluating the AngularJS expression given in the - * `ngMaxlength` attribute value. - * - * <div class="alert alert-info"> - * **Note:** This directive is also added when the plain `maxlength` attribute is used, with two - * differences: - * <ol> - * <li> - * `ngMaxlength` does not set the `maxlength` attribute and therefore HTML5 constraint - * validation is not available. - * </li> - * <li> - * The `ngMaxlength` attribute must be an expression, while the `maxlength` value must be - * interpolated. - * </li> - * </ol> - * </div> - * - * @example - * <example name="ngMaxlengthDirective" module="ngMaxlengthExample"> - * <file name="index.html"> - * <script> - * angular.module('ngMaxlengthExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.maxlength = 5; - * }]); - * </script> - * <div ng-controller="ExampleController"> - * <form name="form"> - * <label for="maxlength">Set a maxlength: </label> - * <input type="number" ng-model="maxlength" id="maxlength" /> - * <br> - * <label for="input">This input is restricted by the current maxlength: </label> - * <input type="text" ng-model="model" id="input" name="input" ng-maxlength="maxlength" /><br> - * <hr> - * input valid? = <code>{{form.input.$valid}}</code><br> - * model = <code>{{model}}</code> - * </form> - * </div> - * </file> - * <file name="protractor.js" type="protractor"> - var model = element(by.binding('model')); - var input = element(by.id('input')); - - it('should validate the input with the default maxlength', function() { - input.sendKeys('abcdef'); - expect(model.getText()).not.toContain('abcdef'); - - input.clear().then(function() { - input.sendKeys('abcde'); - expect(model.getText()).toContain('abcde'); - }); - }); - * </file> - * </example> - */ - var maxlengthDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - - var maxlength = -1; - attr.$observe('maxlength', function(value) { - var intVal = toInt(value); - maxlength = isNumberNaN(intVal) ? -1 : intVal; - ctrl.$validate(); - }); - ctrl.$validators.maxlength = function(modelValue, viewValue) { - return (maxlength < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlength); - }; - } - }; - }; - - /** - * @ngdoc directive - * @name ngMinlength - * @restrict A - * - * @param {expression} ngMinlength AngularJS expression that must evaluate to a `Number` or `String` - * parsable into a `Number`. Used as value for the `minlength` - * {@link ngModel.NgModelController#$validators validator}. - * - * @description - * - * ngMinlength adds the minlength {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}. - * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls. - * - * The validator sets the `minlength` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`} - * is shorter than the integer obtained by evaluating the AngularJS expression given in the - * `ngMinlength` attribute value. - * - * <div class="alert alert-info"> - * **Note:** This directive is also added when the plain `minlength` attribute is used, with two - * differences: - * <ol> - * <li> - * `ngMinlength` does not set the `minlength` attribute and therefore HTML5 constraint - * validation is not available. - * </li> - * <li> - * The `ngMinlength` value must be an expression, while the `minlength` value must be - * interpolated. - * </li> - * </ol> - * </div> - * - * @example - * <example name="ngMinlengthDirective" module="ngMinlengthExample"> - * <file name="index.html"> - * <script> - * angular.module('ngMinlengthExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.minlength = 3; - * }]); - * </script> - * <div ng-controller="ExampleController"> - * <form name="form"> - * <label for="minlength">Set a minlength: </label> - * <input type="number" ng-model="minlength" id="minlength" /> - * <br> - * <label for="input">This input is restricted by the current minlength: </label> - * <input type="text" ng-model="model" id="input" name="input" ng-minlength="minlength" /><br> - * <hr> - * input valid? = <code>{{form.input.$valid}}</code><br> - * model = <code>{{model}}</code> - * </form> - * </div> - * </file> - * <file name="protractor.js" type="protractor"> - var model = element(by.binding('model')); - var input = element(by.id('input')); - - it('should validate the input with the default minlength', function() { - input.sendKeys('ab'); - expect(model.getText()).not.toContain('ab'); - - input.sendKeys('abc'); - expect(model.getText()).toContain('abc'); - }); - * </file> - * </example> - */ - var minlengthDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - - var minlength = 0; - attr.$observe('minlength', function(value) { - minlength = toInt(value) || 0; - ctrl.$validate(); - }); - ctrl.$validators.minlength = function(modelValue, viewValue) { - return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength; - }; - } - }; - }; - - if (window.angular.bootstrap) { - // AngularJS is already loaded, so we can return here... - if (window.console) { - console.log('WARNING: Tried to load AngularJS more than once.'); - } - return; - } - -// try to bind to jquery now so that one can write jqLite(fn) -// but we will rebind on bootstrap again. - bindJQuery(); - - publishExternalAPI(angular); - - angular.module("ngLocale", [], ["$provide", function($provide) { - var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; - function getDecimals(n) { - n = n + ''; - var i = n.indexOf('.'); - return (i == -1) ? 0 : n.length - i - 1; - } - - function getVF(n, opt_precision) { - var v = opt_precision; - - if (undefined === v) { - v = Math.min(getDecimals(n), 3); - } - - var base = Math.pow(10, v); - var f = ((n * base) | 0) % base; - return {v: v, f: f}; - } - - $provide.value("$locale", { - "DATETIME_FORMATS": { - "AMPMS": [ - "AM", - "PM" - ], - "DAY": [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" - ], - "ERANAMES": [ - "Before Christ", - "Anno Domini" - ], - "ERAS": [ - "BC", - "AD" - ], - "FIRSTDAYOFWEEK": 6, - "MONTH": [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" - ], - "SHORTDAY": [ - "Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat" - ], - "SHORTMONTH": [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" - ], - "STANDALONEMONTH": [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" - ], - "WEEKENDRANGE": [ - 5, - 6 - ], - "fullDate": "EEEE, MMMM d, y", - "longDate": "MMMM d, y", - "medium": "MMM d, y h:mm:ss a", - "mediumDate": "MMM d, y", - "mediumTime": "h:mm:ss a", - "short": "M/d/yy h:mm a", - "shortDate": "M/d/yy", - "shortTime": "h:mm a" - }, - "NUMBER_FORMATS": { - "CURRENCY_SYM": "$", - "DECIMAL_SEP": ".", - "GROUP_SEP": ",", - "PATTERNS": [ - { - "gSize": 3, - "lgSize": 3, - "maxFrac": 3, - "minFrac": 0, - "minInt": 1, - "negPre": "-", - "negSuf": "", - "posPre": "", - "posSuf": "" - }, - { - "gSize": 3, - "lgSize": 3, - "maxFrac": 2, - "minFrac": 2, - "minInt": 1, - "negPre": "-\u00a4", - "negSuf": "", - "posPre": "\u00a4", - "posSuf": "" - } - ] - }, - "id": "en-us", - "localeID": "en_US", - "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} - }); - }]); - - jqLite(function() { - angularInit(window.document, bootstrap); - }); - -})(window); - -!window.angular.$$csp().noInlineStyle && window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>'); \ No newline at end of file diff --git a/setup/pub/angular/angular.min.js b/setup/pub/angular/angular.min.js deleted file mode 100644 index 4c57937335798..0000000000000 --- a/setup/pub/angular/angular.min.js +++ /dev/null @@ -1,337 +0,0 @@ -/* - AngularJS v1.6.9 - (c) 2010-2018 Google, Inc. http://angularjs.org - License: MIT -*/ -(function(w){'use strict';function oe(a){if(B(a))u(a.objectMaxDepth)&&(Mc.objectMaxDepth=Wb(a.objectMaxDepth)?a.objectMaxDepth:NaN);else return Mc}function Wb(a){return Y(a)&&0<a}function K(a,b){b=b||Error;return function(){var d=arguments[0],c;c="["+(a?a+":":"")+d+"] http://errors.angularjs.org/1.6.9/"+(a?a+"/":"")+d;for(d=1;d<arguments.length;d++){c=c+(1==d?"?":"&")+"p"+(d-1)+"=";var e=encodeURIComponent,f;f=arguments[d];f="function"==typeof f?f.toString().replace(/ \{[\s\S]*$/,""):"undefined"== -typeof f?"undefined":"string"!=typeof f?JSON.stringify(f):f;c+=e(f)}return new b(c)}}function wa(a){if(null==a||Za(a))return!1;if(I(a)||E(a)||z&&a instanceof z)return!0;var b="length"in Object(a)&&a.length;return Y(b)&&(0<=b&&(b-1 in a||a instanceof Array)||"function"===typeof a.item)}function r(a,b,d){var c,e;if(a)if(C(a))for(c in a)"prototype"!==c&&"length"!==c&&"name"!==c&&a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else if(I(a)||wa(a)){var f="object"!==typeof a;c=0;for(e=a.length;c<e;c++)(f||c in - a)&&b.call(d,a[c],c,a)}else if(a.forEach&&a.forEach!==r)a.forEach(b,d,a);else if(Nc(a))for(c in a)b.call(d,a[c],c,a);else if("function"===typeof a.hasOwnProperty)for(c in a)a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else for(c in a)ra.call(a,c)&&b.call(d,a[c],c,a);return a}function Oc(a,b,d){for(var c=Object.keys(a).sort(),e=0;e<c.length;e++)b.call(d,a[c[e]],c[e]);return c}function Xb(a){return function(b,d){a(d,b)}}function pe(){return++qb}function Yb(a,b,d){for(var c=a.$$hashKey,e=0,f=b.length;e<f;++e){var g= - b[e];if(B(g)||C(g))for(var h=Object.keys(g),k=0,l=h.length;k<l;k++){var m=h[k],p=g[m];d&&B(p)?fa(p)?a[m]=new Date(p.valueOf()):$a(p)?a[m]=new RegExp(p):p.nodeName?a[m]=p.cloneNode(!0):Zb(p)?a[m]=p.clone():(B(a[m])||(a[m]=I(p)?[]:{}),Yb(a[m],[p],!0)):a[m]=p}}c?a.$$hashKey=c:delete a.$$hashKey;return a}function O(a){return Yb(a,xa.call(arguments,1),!1)}function qe(a){return Yb(a,xa.call(arguments,1),!0)}function Z(a){return parseInt(a,10)}function $b(a,b){return O(Object.create(a),b)}function D(){} - function ab(a){return a}function la(a){return function(){return a}}function ac(a){return C(a.toString)&&a.toString!==ia}function x(a){return"undefined"===typeof a}function u(a){return"undefined"!==typeof a}function B(a){return null!==a&&"object"===typeof a}function Nc(a){return null!==a&&"object"===typeof a&&!Pc(a)}function E(a){return"string"===typeof a}function Y(a){return"number"===typeof a}function fa(a){return"[object Date]"===ia.call(a)}function bc(a){switch(ia.call(a)){case "[object Error]":return!0; - case "[object Exception]":return!0;case "[object DOMException]":return!0;default:return a instanceof Error}}function C(a){return"function"===typeof a}function $a(a){return"[object RegExp]"===ia.call(a)}function Za(a){return a&&a.window===a}function bb(a){return a&&a.$evalAsync&&a.$watch}function Na(a){return"boolean"===typeof a}function re(a){return a&&Y(a.length)&&se.test(ia.call(a))}function Zb(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function te(a){var b={};a=a.split(",");var d;for(d= - 0;d<a.length;d++)b[a[d]]=!0;return b}function ya(a){return L(a.nodeName||a[0]&&a[0].nodeName)}function cb(a,b){var d=a.indexOf(b);0<=d&&a.splice(d,1);return d}function pa(a,b,d){function c(a,b,c){c--;if(0>c)return"...";var d=b.$$hashKey,g;if(I(a)){g=0;for(var f=a.length;g<f;g++)b.push(e(a[g],c))}else if(Nc(a))for(g in a)b[g]=e(a[g],c);else if(a&&"function"===typeof a.hasOwnProperty)for(g in a)a.hasOwnProperty(g)&&(b[g]=e(a[g],c));else for(g in a)ra.call(a,g)&&(b[g]=e(a[g],c));d?b.$$hashKey=d:delete b.$$hashKey; - return b}function e(a,b){if(!B(a))return a;var d=g.indexOf(a);if(-1!==d)return h[d];if(Za(a)||bb(a))throw qa("cpws");var d=!1,e=f(a);void 0===e&&(e=I(a)?[]:Object.create(Pc(a)),d=!0);g.push(a);h.push(e);return d?c(a,e,b):e}function f(a){switch(ia.call(a)){case "[object Int8Array]":case "[object Int16Array]":case "[object Int32Array]":case "[object Float32Array]":case "[object Float64Array]":case "[object Uint8Array]":case "[object Uint8ClampedArray]":case "[object Uint16Array]":case "[object Uint32Array]":return new a.constructor(e(a.buffer), - a.byteOffset,a.length);case "[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);(new Uint8Array(b)).set(new Uint8Array(a));return b}return a.slice(0);case "[object Boolean]":case "[object Number]":case "[object String]":case "[object Date]":return new a.constructor(a.valueOf());case "[object RegExp]":return b=new RegExp(a.source,a.toString().match(/[^/]*$/)[0]),b.lastIndex=a.lastIndex,b;case "[object Blob]":return new a.constructor([a],{type:a.type})}if(C(a.cloneNode))return a.cloneNode(!0)} - var g=[],h=[];d=Wb(d)?d:NaN;if(b){if(re(b)||"[object ArrayBuffer]"===ia.call(b))throw qa("cpta");if(a===b)throw qa("cpi");I(b)?b.length=0:r(b,function(a,c){"$$hashKey"!==c&&delete b[c]});g.push(a);h.push(b);return c(a,b,d)}return e(a,d)}function cc(a,b){return a===b||a!==a&&b!==b}function sa(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var d=typeof a,c;if(d===typeof b&&"object"===d)if(I(a)){if(!I(b))return!1;if((d=a.length)===b.length){for(c=0;c<d;c++)if(!sa(a[c], - b[c]))return!1;return!0}}else{if(fa(a))return fa(b)?cc(a.getTime(),b.getTime()):!1;if($a(a))return $a(b)?a.toString()===b.toString():!1;if(bb(a)||bb(b)||Za(a)||Za(b)||I(b)||fa(b)||$a(b))return!1;d=S();for(c in a)if("$"!==c.charAt(0)&&!C(a[c])){if(!sa(a[c],b[c]))return!1;d[c]=!0}for(c in b)if(!(c in d)&&"$"!==c.charAt(0)&&u(b[c])&&!C(b[c]))return!1;return!0}return!1}function db(a,b,d){return a.concat(xa.call(b,d))}function Ra(a,b){var d=2<arguments.length?xa.call(arguments,2):[];return!C(b)||b instanceof - RegExp?b:d.length?function(){return arguments.length?b.apply(a,db(d,arguments,0)):b.apply(a,d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function Qc(a,b){var d=b;"string"===typeof a&&"$"===a.charAt(0)&&"$"===a.charAt(1)?d=void 0:Za(b)?d="$WINDOW":b&&w.document===b?d="$DOCUMENT":bb(b)&&(d="$SCOPE");return d}function eb(a,b){if(!x(a))return Y(b)||(b=b?2:null),JSON.stringify(a,Qc,b)}function Rc(a){return E(a)?JSON.parse(a):a}function Sc(a,b){a=a.replace(ue,"");var d=Date.parse("Jan 01, 1970 00:00:00 "+ - a)/6E4;return U(d)?b:d}function dc(a,b,d){d=d?-1:1;var c=a.getTimezoneOffset();b=Sc(b,c);d*=b-c;a=new Date(a.getTime());a.setMinutes(a.getMinutes()+d);return a}function za(a){a=z(a).clone().empty();var b=z("<div>").append(a).html();try{return a[0].nodeType===Oa?L(b):b.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(a,b){return"<"+L(b)})}catch(d){return L(b)}}function Tc(a){try{return decodeURIComponent(a)}catch(b){}}function ec(a){var b={};r((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g, - "%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=Tc(e),u(e)&&(f=u(f)?Tc(f):!0,ra.call(b,e)?I(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function fc(a){var b=[];r(a,function(a,c){I(a)?r(a,function(a){b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))}):b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))});return b.length?b.join("&"):""}function fb(a){return ja(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ja(a,b){return encodeURIComponent(a).replace(/%40/gi, - "@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function ve(a,b){var d,c,e=Ha.length;for(c=0;c<e;++c)if(d=Ha[c]+b,E(d=a.getAttribute(d)))return d;return null}function we(a,b){var d,c,e={};r(Ha,function(b){b+="app";!d&&a.hasAttribute&&a.hasAttribute(b)&&(d=a,c=a.getAttribute(b))});r(Ha,function(b){b+="app";var e;!d&&(e=a.querySelector("["+b.replace(":","\\:")+"]"))&&(d=e,c=e.getAttribute(b))});d&&(xe?(e.strictDi=null!==ve(d,"strict-di"), - b(d,c?[c]:[],e)):w.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match."))}function Uc(a,b,d){B(d)||(d={});d=O({strictDi:!1},d);var c=function(){a=z(a);if(a.injector()){var c=a[0]===w.document?"document":za(a);throw qa("btstrpd",c.replace(/</,"<").replace(/>/,">"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]); - b.unshift("ng");c=gb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;w&&e.test(w.name)&&(d.debugInfoEnabled=!0,w.name=w.name.replace(e,""));if(w&&!f.test(w.name))return c();w.name=w.name.replace(f,"");$.resumeBootstrap=function(a){r(a,function(a){b.push(a)});return c()};C($.resumeDeferredBootstrap)&&$.resumeDeferredBootstrap()}function ye(){w.name= - "NG_ENABLE_DEBUG_INFO!"+w.name;w.location.reload()}function ze(a){a=$.element(a).injector();if(!a)throw qa("test");return a.get("$$testability")}function Vc(a,b){b=b||"_";return a.replace(Ae,function(a,c){return(c?b:"")+a.toLowerCase()})}function Be(){var a;if(!Wc){var b=rb();(ma=x(b)?w.jQuery:b?w[b]:void 0)&&ma.fn.on?(z=ma,O(ma.fn,{scope:Sa.scope,isolateScope:Sa.isolateScope,controller:Sa.controller,injector:Sa.injector,inheritedData:Sa.inheritedData}),a=ma.cleanData,ma.cleanData=function(b){for(var c, - e=0,f;null!=(f=b[e]);e++)(c=ma._data(f,"events"))&&c.$destroy&&ma(f).triggerHandler("$destroy");a(b)}):z=V;$.element=z;Wc=!0}}function hb(a,b,d){if(!a)throw qa("areq",b||"?",d||"required");return a}function sb(a,b,d){d&&I(a)&&(a=a[a.length-1]);hb(C(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Ia(a,b){if("hasOwnProperty"===a)throw qa("badname",b);}function Xc(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g<f;g++)c= - b[g],a&&(a=(e=a)[c]);return!d&&C(a)?Ra(e,a):a}function tb(a){for(var b=a[0],d=a[a.length-1],c,e=1;b!==d&&(b=b.nextSibling);e++)if(c||a[e]!==b)c||(c=z(xa.call(a,0,e))),c.push(b);return c||a}function S(){return Object.create(null)}function gc(a){if(null==a)return"";switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=!ac(a)||I(a)||fa(a)?eb(a):a.toString()}return a}function Ce(a){function b(a,b,c){return a[b]||(a[b]=c())}var d=K("$injector"),c=K("ng");a=b(a,"angular",Object);a.$$minErr= - a.$$minErr||K;return b(a,"module",function(){var a={};return function(f,g,h){var k={};if("hasOwnProperty"===f)throw c("badname","module");g&&a.hasOwnProperty(f)&&(a[f]=null);return b(a,f,function(){function a(b,c,d,g){g||(g=e);return function(){g[d||"push"]([b,c,arguments]);return v}}function b(a,c,d){d||(d=e);return function(b,e){e&&C(e)&&(e.$$moduleName=f);d.push([a,c,arguments]);return v}}if(!g)throw d("nomod",f);var e=[],n=[],F=[],s=a("$injector","invoke","push",n),v={_invokeQueue:e,_configBlocks:n, - _runBlocks:F,info:function(a){if(u(a)){if(!B(a))throw c("aobj","value");k=a;return this}return k},requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide","decorator",n),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),component:b("$compileProvider", - "component"),config:s,run:function(a){F.push(a);return this}};h&&s(h);return v})}})}function ka(a,b){if(I(a)){b=b||[];for(var d=0,c=a.length;d<c;d++)b[d]=a[d]}else if(B(a))for(d in b=b||{},a)if("$"!==d.charAt(0)||"$"!==d.charAt(1))b[d]=a[d];return b||a}function De(a,b){var d=[];Wb(b)&&(a=$.copy(a,null,b));return JSON.stringify(a,function(a,b){b=Qc(a,b);if(B(b)){if(0<=d.indexOf(b))return"...";d.push(b)}return b})}function Ee(a){O(a,{errorHandlingConfig:oe,bootstrap:Uc,copy:pa,extend:O,merge:qe,equals:sa, - element:z,forEach:r,injector:gb,noop:D,bind:Ra,toJson:eb,fromJson:Rc,identity:ab,isUndefined:x,isDefined:u,isString:E,isFunction:C,isObject:B,isNumber:Y,isElement:Zb,isArray:I,version:Fe,isDate:fa,lowercase:L,uppercase:ub,callbacks:{$$counter:0},getTestability:ze,reloadWithDebugInfo:ye,$$minErr:K,$$csp:Ja,$$encodeUriSegment:fb,$$encodeUriQuery:ja,$$stringify:gc});ic=Ce(w);ic("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:Ge});a.provider("$compile",Yc).directive({a:He,input:Zc, - textarea:Zc,form:Ie,script:Je,select:Ke,option:Le,ngBind:Me,ngBindHtml:Ne,ngBindTemplate:Oe,ngClass:Pe,ngClassEven:Qe,ngClassOdd:Re,ngCloak:Se,ngController:Te,ngForm:Ue,ngHide:Ve,ngIf:We,ngInclude:Xe,ngInit:Ye,ngNonBindable:Ze,ngPluralize:$e,ngRepeat:af,ngShow:bf,ngStyle:cf,ngSwitch:df,ngSwitchWhen:ef,ngSwitchDefault:ff,ngOptions:gf,ngTransclude:hf,ngModel:jf,ngList:kf,ngChange:lf,pattern:$c,ngPattern:$c,required:ad,ngRequired:ad,minlength:bd,ngMinlength:bd,maxlength:cd,ngMaxlength:cd,ngValue:mf, - ngModelOptions:nf}).directive({ngInclude:of}).directive(vb).directive(dd);a.provider({$anchorScroll:pf,$animate:qf,$animateCss:rf,$$animateJs:sf,$$animateQueue:tf,$$AnimateRunner:uf,$$animateAsyncRun:vf,$browser:wf,$cacheFactory:xf,$controller:yf,$document:zf,$$isDocumentHidden:Af,$exceptionHandler:Bf,$filter:ed,$$forceReflow:Cf,$interpolate:Df,$interval:Ef,$http:Ff,$httpParamSerializer:Gf,$httpParamSerializerJQLike:Hf,$httpBackend:If,$xhrFactory:Jf,$jsonpCallbacks:Kf,$location:Lf,$log:Mf,$parse:Nf, - $rootScope:Of,$q:Pf,$$q:Qf,$sce:Rf,$sceDelegate:Sf,$sniffer:Tf,$templateCache:Uf,$templateRequest:Vf,$$testability:Wf,$timeout:Xf,$window:Yf,$$rAF:Zf,$$jqLite:$f,$$Map:ag,$$cookieReader:bg})}]).info({angularVersion:"1.6.9"})}function wb(a,b){return b.toUpperCase()}function xb(a){return a.replace(cg,wb)}function jc(a){a=a.nodeType;return 1===a||!a||9===a}function fd(a,b){var d,c,e=b.createDocumentFragment(),f=[];if(kc.test(a)){d=e.appendChild(b.createElement("div"));c=(dg.exec(a)||["",""])[1].toLowerCase(); - c=aa[c]||aa._default;d.innerHTML=c[1]+a.replace(eg,"<$1></$2>")+c[2];for(c=c[0];c--;)d=d.lastChild;f=db(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";r(f,function(a){e.appendChild(a)});return e}function V(a){if(a instanceof V)return a;var b;E(a)&&(a=Q(a),b=!0);if(!(this instanceof V)){if(b&&"<"!==a.charAt(0))throw lc("nosel");return new V(a)}if(b){b=w.document;var d;a=(d=fg.exec(a))?[b.createElement(d[1])]:(d=fd(a,b))?d.childNodes: - [];mc(this,a)}else C(a)?gd(a):mc(this,a)}function nc(a){return a.cloneNode(!0)}function yb(a,b){!b&&jc(a)&&z.cleanData([a]);a.querySelectorAll&&z.cleanData(a.querySelectorAll("*"))}function hd(a,b,d,c){if(u(c))throw lc("offargs");var e=(c=zb(a))&&c.events,f=c&&c.handle;if(f)if(b){var g=function(b){var c=e[b];u(d)&&cb(c||[],d);u(d)&&c&&0<c.length||(a.removeEventListener(b,f),delete e[b])};r(b.split(" "),function(a){g(a);Ab[a]&&g(Ab[a])})}else for(b in e)"$destroy"!==b&&a.removeEventListener(b,f),delete e[b]} - function oc(a,b){var d=a.ng339,c=d&&ib[d];c&&(b?delete c.data[b]:(c.handle&&(c.events.$destroy&&c.handle({},"$destroy"),hd(a)),delete ib[d],a.ng339=void 0))}function zb(a,b){var d=a.ng339,d=d&&ib[d];b&&!d&&(a.ng339=d=++gg,d=ib[d]={events:{},data:{},handle:void 0});return d}function pc(a,b,d){if(jc(a)){var c,e=u(d),f=!e&&b&&!B(b),g=!b;a=(a=zb(a,!f))&&a.data;if(e)a[xb(b)]=d;else{if(g)return a;if(f)return a&&a[xb(b)];for(c in b)a[xb(c)]=b[c]}}}function Bb(a,b){return a.getAttribute?-1<(" "+(a.getAttribute("class")|| - "")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" "):!1}function Cb(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d;r(b.split(" "),function(a){a=Q(a);c=c.replace(" "+a+" "," ")});c!==d&&a.setAttribute("class",Q(c))}}function Db(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d;r(b.split(" "),function(a){a=Q(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});c!==d&&a.setAttribute("class",Q(c))}}function mc(a, - b){if(b)if(b.nodeType)a[a.length++]=b;else{var d=b.length;if("number"===typeof d&&b.window!==b){if(d)for(var c=0;c<d;c++)a[a.length++]=b[c]}else a[a.length++]=b}}function id(a,b){return Eb(a,"$"+(b||"ngController")+"Controller")}function Eb(a,b,d){9===a.nodeType&&(a=a.documentElement);for(b=I(b)?b:[b];a;){for(var c=0,e=b.length;c<e;c++)if(u(d=z.data(a,b[c])))return d;a=a.parentNode||11===a.nodeType&&a.host}}function jd(a){for(yb(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Fb(a,b){b|| - yb(a);var d=a.parentNode;d&&d.removeChild(a)}function hg(a,b){b=b||w;if("complete"===b.document.readyState)b.setTimeout(a);else z(b).on("load",a)}function gd(a){function b(){w.document.removeEventListener("DOMContentLoaded",b);w.removeEventListener("load",b);a()}"complete"===w.document.readyState?w.setTimeout(a):(w.document.addEventListener("DOMContentLoaded",b),w.addEventListener("load",b))}function kd(a,b){var d=Gb[b.toLowerCase()];return d&&ld[ya(a)]&&d}function ig(a,b){var d=function(c,d){c.isDefaultPrevented= - function(){return c.defaultPrevented};var f=b[d||c.type],g=f?f.length:0;if(g){if(x(c.immediatePropagationStopped)){var h=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();h&&h.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};var k=f.specialHandlerWrapper||jg;1<g&&(f=ka(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||k(a,c,f[l])}};d.elem=a;return d}function jg(a, - b,d){d.call(a,b)}function kg(a,b,d){var c=b.relatedTarget;c&&(c===a||lg.call(a,c))||d.call(a,b)}function $f(){this.$get=function(){return O(V,{hasClass:function(a,b){a.attr&&(a=a[0]);return Bb(a,b)},addClass:function(a,b){a.attr&&(a=a[0]);return Db(a,b)},removeClass:function(a,b){a.attr&&(a=a[0]);return Cb(a,b)}})}}function Pa(a,b){var d=a&&a.$$hashKey;if(d)return"function"===typeof d&&(d=a.$$hashKey()),d;d=typeof a;return d="function"===d||"object"===d&&null!==a?a.$$hashKey=d+":"+(b||pe)():d+":"+ - a}function md(){this._keys=[];this._values=[];this._lastKey=NaN;this._lastIndex=-1}function nd(a){a=Function.prototype.toString.call(a).replace(mg,"");return a.match(ng)||a.match(og)}function pg(a){return(a=nd(a))?"function("+(a[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function gb(a,b){function d(a){return function(b,c){if(B(b))r(b,Xb(a));else return a(b,c)}}function c(a,b){Ia(a,"service");if(C(b)||I(b))b=n.instantiate(b);if(!b.$get)throw Ba("pget",a);return p[a+"Provider"]=b}function e(a,b){return function(){var c= - v.invoke(b,this);if(x(c))throw Ba("undef",a);return c}}function f(a,b,d){return c(a,{$get:!1!==d?e(a,b):b})}function g(a){hb(x(a)||I(a),"modulesToLoad","not an array");var b=[],c;r(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],g=n.get(e[0]);g[e[1]].apply(g,e[2])}}if(!m.get(a)){m.set(a,!0);try{E(a)?(c=ic(a),v.modules[a]=c,b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):C(a)?b.push(n.invoke(a)):I(a)?b.push(n.invoke(a)):sb(a,"module")}catch(e){throw I(a)&& - (a=a[a.length-1]),e.message&&e.stack&&-1===e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ba("modulerr",a,e.stack||e.message||e);}}});return b}function h(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===k)throw Ba("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=k,a[b]=c(b,e),a[b]}catch(g){throw a[b]===k&&delete a[b],g;}finally{l.shift()}}function e(a,c,g){var f=[];a=gb.$$annotate(a,b,g);for(var k=0,h=a.length;k<h;k++){var l=a[k];if("string"!==typeof l)throw Ba("itkn", - l);f.push(c&&c.hasOwnProperty(l)?c[l]:d(l,g))}return f}return{invoke:function(a,b,c,d){"string"===typeof c&&(d=c,c=null);c=e(a,c,d);I(a)&&(a=a[a.length-1]);d=a;if(Ca||"function"!==typeof d)d=!1;else{var g=d.$$ngIsClass;Na(g)||(g=d.$$ngIsClass=/^(?:class\b|constructor\()/.test(Function.prototype.toString.call(d)));d=g}return d?(c.unshift(null),new (Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=I(a)?a[a.length-1]:a;a=e(a,b,c);a.unshift(null);return new (Function.prototype.bind.apply(d, - a))},get:d,annotate:gb.$$annotate,has:function(b){return p.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var k={},l=[],m=new Hb,p={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,la(b),!1)}),constant:d(function(a,b){Ia(a,"constant");p[a]=b;F[a]=b}),decorator:function(a,b){var c=n.get(a+"Provider"),d=c.$get;c.$get=function(){var a=v.invoke(d,c);return v.invoke(b,null,{$delegate:a})}}}}, - n=p.$injector=h(p,function(a,b){$.isString(b)&&l.push(b);throw Ba("unpr",l.join(" <- "));}),F={},s=h(F,function(a,b){var c=n.get(a+"Provider",b);return v.invoke(c.$get,c,void 0,a)}),v=s;p.$injectorProvider={$get:la(s)};v.modules=n.modules=S();var y=g(a),v=s.get("$injector");v.strictDi=b;r(y,function(a){a&&v.invoke(a)});v.loadNewModules=function(a){r(g(a),function(a){a&&v.invoke(a)})};return v}function pf(){var a=!0;this.disableAutoScrolling=function(){a=!1};this.$get=["$window","$location","$rootScope", - function(b,d,c){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===ya(a))return b=a,!0});return b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset;C(c)?c=c():Zb(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):Y(c)||(c=0);c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=E(a)?a:Y(a)?a.toString():d.hash();var b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))?f(b):"top"===a&& - f(null):f(null)}var h=b.document;a&&c.$watch(function(){return d.hash()},function(a,b){a===b&&""===a||hg(function(){c.$evalAsync(g)})});return g}]}function jb(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;I(a)&&(a=a.join(" "));I(b)&&(b=b.join(" "));return a+" "+b}function qg(a){E(a)&&(a=a.split(" "));var b=S();r(a,function(a){a.length&&(b[a]=!0)});return b}function Ka(a){return B(a)?a:{}}function rg(a,b,d,c){function e(a){try{a.apply(null,xa.call(arguments,1))}finally{if(s--,0===s)for(;v.length;)try{v.pop()()}catch(b){d.error(b)}}} - function f(){A=null;h()}function g(){y=H();y=x(y)?null:y;sa(y,J)&&(y=J);t=J=y}function h(){var a=t;g();if(Aa!==k.url()||a!==y)Aa=k.url(),t=y,r(G,function(a){a(k.url(),y)})}var k=this,l=a.location,m=a.history,p=a.setTimeout,n=a.clearTimeout,F={};k.isMock=!1;var s=0,v=[];k.$$completeOutstandingRequest=e;k.$$incOutstandingRequestCount=function(){s++};k.notifyWhenNoOutstandingRequests=function(a){0===s?a():v.push(a)};var y,t,Aa=l.href,hc=b.find("base"),A=null,H=c.history?function(){try{return m.state}catch(a){}}: - D;g();k.url=function(b,d,e){x(e)&&(e=null);l!==a.location&&(l=a.location);m!==a.history&&(m=a.history);if(b){var f=t===e;if(Aa===b&&(!c.history||f))return k;var h=Aa&&La(Aa)===La(b);Aa=b;t=e;!c.history||h&&f?(h||(A=b),d?l.replace(b):h?(d=l,e=b.indexOf("#"),e=-1===e?"":b.substr(e),d.hash=e):l.href=b,l.href!==b&&(A=b)):(m[d?"replaceState":"pushState"](e,"",b),g());A&&(A=b);return k}return A||l.href.replace(/%27/g,"'")};k.state=function(){return y};var G=[],ba=!1,J=null;k.onUrlChange=function(b){if(!ba){if(c.history)z(a).on("popstate", - f);z(a).on("hashchange",f);ba=!0}G.push(b);return b};k.$$applicationDestroyed=function(){z(a).off("hashchange popstate",f)};k.$$checkUrlChange=h;k.baseHref=function(){var a=hc.attr("href");return a?a.replace(/^(https?:)?\/\/[^/]*/,""):""};k.defer=function(a,b){var c;s++;c=p(function(){delete F[c];e(a)},b||0);F[c]=!0;return c};k.defer.cancel=function(a){return F[a]?(delete F[a],n(a),e(D),!0):!1}}function wf(){this.$get=["$window","$log","$sniffer","$document",function(a,b,d,c){return new rg(a,c,b, - d)}]}function xf(){this.$get=function(){function a(a,c){function e(a){a!==p&&(n?n===a&&(n=a.n):n=a,f(a.n,a.p),f(a,p),p=a,p.n=null)}function f(a,b){a!==b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw K("$cacheFactory")("iid",a);var g=0,h=O({},c,{id:a}),k=S(),l=c&&c.capacity||Number.MAX_VALUE,m=S(),p=null,n=null;return b[a]={put:function(a,b){if(!x(b)){if(l<Number.MAX_VALUE){var c=m[a]||(m[a]={key:a});e(c)}a in k||g++;k[a]=b;g>l&&this.remove(n.key);return b}},get:function(a){if(l<Number.MAX_VALUE){var b= - m[a];if(!b)return;e(b)}return k[a]},remove:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;b===p&&(p=b.p);b===n&&(n=b.n);f(b.n,b.p);delete m[a]}a in k&&(delete k[a],g--)},removeAll:function(){k=S();g=0;m=S();p=n=null},destroy:function(){m=h=k=null;delete b[a]},info:function(){return O({},h,{size:g})}}}var b={};a.info=function(){var a={};r(b,function(b,e){a[e]=b.info()});return a};a.get=function(a){return b[a]};return a}}function Uf(){this.$get=["$cacheFactory",function(a){return a("templates")}]} - function Yc(a,b){function d(a,b,c){var d=/^\s*([@&<]|=(\*?))(\??)\s*([\w$]*)\s*$/,e=S();r(a,function(a,g){if(a in p)e[g]=p[a];else{var f=a.match(d);if(!f)throw ca("iscp",b,g,a,c?"controller bindings definition":"isolate scope definition");e[g]={mode:f[1][0],collection:"*"===f[2],optional:"?"===f[3],attrName:f[4]||g};f[4]&&(p[a]=e[g])}});return e}function c(a){var b=a.charAt(0);if(!b||b!==L(b))throw ca("baddir",a);if(a!==a.trim())throw ca("baddir",a);}function e(a){var b=a.require||a.controller&&a.name; - !I(b)&&B(b)&&r(b,function(a,c){var d=a.match(l);a.substring(d[0].length)||(b[c]=d[0]+c)});return b}var f={},g=/^\s*directive:\s*([\w-]+)\s+(.*)$/,h=/(([\w-]+)(?::([^;]+))?;?)/,k=te("ngSrc,ngSrcset,src,srcset"),l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,m=/^(on[a-z]+|formaction)$/,p=S();this.directive=function hc(b,d){hb(b,"name");Ia(b,"directive");E(b)?(c(b),hb(d,"directiveFactory"),f.hasOwnProperty(b)||(f[b]=[],a.factory(b+"Directive",["$injector","$exceptionHandler",function(a,c){var d=[];r(f[b],function(g, - f){try{var h=a.invoke(g);C(h)?h={compile:la(h)}:!h.compile&&h.link&&(h.compile=la(h.link));h.priority=h.priority||0;h.index=f;h.name=h.name||b;h.require=e(h);var k=h,l=h.restrict;if(l&&(!E(l)||!/[EACM]/.test(l)))throw ca("badrestrict",l,b);k.restrict=l||"EA";h.$$moduleName=g.$$moduleName;d.push(h)}catch(m){c(m)}});return d}])),f[b].push(d)):r(b,Xb(hc));return this};this.component=function A(a,b){function c(a){function e(b){return C(b)||I(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}: - b}var g=b.template||b.templateUrl?b.template:"",f={controller:d,controllerAs:sg(b.controller)||b.controllerAs||"$ctrl",template:e(g),templateUrl:e(b.templateUrl),transclude:b.transclude,scope:{},bindToController:b.bindings||{},restrict:"E",require:b.require};r(b,function(a,b){"$"===b.charAt(0)&&(f[b]=a)});return f}if(!E(a))return r(a,Xb(Ra(this,A))),this;var d=b.controller||function(){};r(b,function(a,b){"$"===b.charAt(0)&&(c[b]=a,C(d)&&(d[b]=a))});c.$inject=["$injector"];return this.directive(a, - c)};this.aHrefSanitizationWhitelist=function(a){return u(a)?(b.aHrefSanitizationWhitelist(a),this):b.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(a){return u(a)?(b.imgSrcSanitizationWhitelist(a),this):b.imgSrcSanitizationWhitelist()};var n=!0;this.debugInfoEnabled=function(a){return u(a)?(n=a,this):n};var F=!1;this.preAssignBindingsEnabled=function(a){return u(a)?(F=a,this):F};var s=!1;this.strictComponentBindingsEnabled=function(a){return u(a)?(s=a,this):s};var v=10;this.onChangesTtl= - function(a){return arguments.length?(v=a,this):v};var y=!0;this.commentDirectivesEnabled=function(a){return arguments.length?(y=a,this):y};var t=!0;this.cssClassDirectivesEnabled=function(a){return arguments.length?(t=a,this):t};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate","$$sanitizeUri",function(a,b,c,e,p,R,M,T,P,q){function N(){try{if(!--Fa)throw ha=void 0,ca("infchng",v);M.$apply(function(){for(var a=[],b=0, - c=ha.length;b<c;++b)try{ha[b]()}catch(d){a.push(d)}ha=void 0;if(a.length)throw a;})}finally{Fa++}}function qc(a,b){if(b){var c=Object.keys(b),d,e,g;d=0;for(e=c.length;d<e;d++)g=c[d],this[g]=b[g]}else this.$attr={};this.$$element=a}function Ta(a,b,c){Ba.innerHTML="<span "+b+">";b=Ba.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function na(a,b){try{a.addClass(b)}catch(c){}}function da(a,b,c,d,e){a instanceof z||(a=z(a));var g=Ua(a,b,a,c,d,e);da.$$addScopeClass(a); - var f=null;return function(b,c,d){if(!a)throw ca("multilink");hb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var h=d.parentBoundTranscludeFn,k=d.transcludeControllers;d=d.futureParentElement;h&&h.$$boundTransclude&&(h=h.$$boundTransclude);f||(f=(d=d&&d[0])?"foreignobject"!==ya(d)&&ia.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==f?z(ka(f,z("<div>").append(a).html())):c?Sa.clone.call(a):a;if(k)for(var l in k)d.data("$"+l+"Controller",k[l].instance);da.$$addScopeInfo(d,b);c&& - c(d,b);g&&g(b,d,d,h);c||(a=g=null);return d}}function Ua(a,b,c,d,e,g){function f(a,c,d,e){var g,k,l,m,p,n,G;if(t)for(G=Array(c.length),m=0;m<h.length;m+=3)g=h[m],G[g]=c[g];else G=c;m=0;for(p=h.length;m<p;)k=G[h[m++]],c=h[m++],g=h[m++],c?(c.scope?(l=a.$new(),da.$$addScopeInfo(z(k),l)):l=a,n=c.transcludeOnThisElement?Ma(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?Ma(a,b):null,c(g,l,k,d,n)):g&&g(a,k.childNodes,void 0,e)}for(var h=[],k=I(a)||a instanceof z,l,m,p,n,t,G=0;G<a.length;G++){l=new qc; - 11===Ca&&Da(a,G,k);m=K(a[G],[],l,0===G?d:void 0,e);(g=m.length?Y(m,a[G],l,b,c,null,[],[],g):null)&&g.scope&&da.$$addScopeClass(l.$$element);l=g&&g.terminal||!(p=a[G].childNodes)||!p.length?null:Ua(p,g?(g.transcludeOnThisElement||!g.templateOnThisElement)&&g.transclude:b);if(g||l)h.push(G,g,l),n=!0,t=t||g;g=null}return n?f:null}function Da(a,b,c){var d=a[b],e=d.parentNode,g;if(d.nodeType===Oa)for(;;){g=e?d.nextSibling:a[b+1];if(!g||g.nodeType!==Oa)break;d.nodeValue+=g.nodeValue;g.parentNode&&g.parentNode.removeChild(g); - c&&g===a[b+1]&&a.splice(b+1,1)}}function Ma(a,b,c){function d(e,g,f,h,k){e||(e=a.$new(!1,k),e.$$transcluded=!0);return b(e,g,{parentBoundTranscludeFn:c,transcludeControllers:f,futureParentElement:h})}var e=d.$$slots=S(),g;for(g in b.$$slots)e[g]=b.$$slots[g]?Ma(a,b.$$slots[g],c):null;return d}function K(a,b,c,d,e){var g=c.$attr,f;switch(a.nodeType){case 1:f=ya(a);U(b,Ea(f),"E",d,e);for(var k,l,m,p,n=a.attributes,t=0,G=n&&n.length;t<G;t++){var H=!1,F=!1;k=n[t];l=k.name;m=k.value;k=Ea(l);(p=Pa.test(k))&& - (l=l.replace(od,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()}));(k=k.match(Qa))&&$(k[1])&&(H=l,F=l.substr(0,l.length-5)+"end",l=l.substr(0,l.length-6));k=Ea(l.toLowerCase());g[k]=l;if(p||!c.hasOwnProperty(k))c[k]=m,kd(a,k)&&(c[k]=!0);wa(a,b,m,k,p);U(b,k,"A",d,e,H,F)}"input"===f&&"hidden"===a.getAttribute("type")&&a.setAttribute("autocomplete","off");if(!La)break;g=a.className;B(g)&&(g=g.animVal);if(E(g)&&""!==g)for(;a=h.exec(g);)k=Ea(a[2]),U(b,k,"C",d,e)&&(c[k]=Q(a[3])),g=g.substr(a.index+ - a[0].length);break;case Oa:oa(b,a.nodeValue);break;case 8:if(!Ka)break;rc(a,b,c,d,e)}b.sort(la);return b}function rc(a,b,c,d,e){try{var f=g.exec(a.nodeValue);if(f){var h=Ea(f[1]);U(b,h,"M",d,e)&&(c[h]=Q(f[2]))}}catch(k){}}function pd(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ca("uterdir",b,c);1===a.nodeType&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return z(d)}function V(a,b,c){return function(d,e,g,f,h){e= - pd(e[0],b,c);return a(d,e,g,f,h)}}function W(a,b,c,d,e,g){var f;return a?da(b,c,d,e,g):function(){f||(f=da(b,c,d,e,g),b=c=g=null);return f.apply(this,arguments)}}function Y(a,b,d,e,g,f,h,k,l){function m(a,b,c,d){if(a){c&&(a=V(a,c,d));a.require=s.require;a.directiveName=R;if(J===s||s.$$isolateScope)a=ta(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=V(b,c,d));b.require=s.require;b.directiveName=R;if(J===s||s.$$isolateScope)b=ta(b,{isolateScope:!0});k.push(b)}}function p(a,e,g,f,l){function m(a,b,c,d){var e; - bb(a)||(d=c,c=b,b=a,a=void 0);T&&(e=M);c||(c=T?ga.parent():ga);if(d){var g=l.$$slots[d];if(g)return g(a,b,e,c,N);if(x(g))throw ca("noslot",d,za(ga));}else return l(a,b,e,c,N)}var n,s,v,y,ba,M,R,ga;b===g?(f=d,ga=d.$$element):(ga=z(g),f=new qc(ga,d));ba=e;J?y=e.$new(!0):t&&(ba=e.$parent);l&&(R=m,R.$$boundTransclude=l,R.isSlotFilled=function(a){return!!l.$$slots[a]});H&&(M=ea(ga,f,R,H,y,e,J));J&&(da.$$addScopeInfo(ga,y,!0,!(A&&(A===J||A===J.$$originalDirective))),da.$$addScopeClass(ga,!0),y.$$isolateBindings= - J.$$isolateBindings,s=qa(e,f,y,y.$$isolateBindings,J),s.removeWatches&&y.$on("$destroy",s.removeWatches));for(n in M){s=H[n];v=M[n];var P=s.$$bindings.bindToController;if(F){v.bindingInfo=P?qa(ba,f,v.instance,P,s):{};var q=v();q!==v.instance&&(v.instance=q,ga.data("$"+s.name+"Controller",q),v.bindingInfo.removeWatches&&v.bindingInfo.removeWatches(),v.bindingInfo=qa(ba,f,v.instance,P,s))}else v.instance=v(),ga.data("$"+s.name+"Controller",v.instance),v.bindingInfo=qa(ba,f,v.instance,P,s)}r(H,function(a, - b){var c=a.require;a.bindToController&&!I(c)&&B(c)&&O(M[b].instance,X(b,c,ga,M))});r(M,function(a){var b=a.instance;if(C(b.$onChanges))try{b.$onChanges(a.bindingInfo.initialChanges)}catch(d){c(d)}if(C(b.$onInit))try{b.$onInit()}catch(e){c(e)}C(b.$doCheck)&&(ba.$watch(function(){b.$doCheck()}),b.$doCheck());C(b.$onDestroy)&&ba.$on("$destroy",function(){b.$onDestroy()})});n=0;for(s=h.length;n<s;n++)v=h[n],va(v,v.isolateScope?y:e,ga,f,v.require&&X(v.directiveName,v.require,ga,M),R);var N=e;J&&(J.template|| - null===J.templateUrl)&&(N=y);a&&a(N,g.childNodes,void 0,l);for(n=k.length-1;0<=n;n--)v=k[n],va(v,v.isolateScope?y:e,ga,f,v.require&&X(v.directiveName,v.require,ga,M),R);r(M,function(a){a=a.instance;C(a.$postLink)&&a.$postLink()})}l=l||{};for(var n=-Number.MAX_VALUE,t=l.newScopeDirective,H=l.controllerDirectives,J=l.newIsolateScopeDirective,A=l.templateDirective,y=l.nonTlbTranscludeDirective,ba=!1,M=!1,T=l.hasElementTranscludeDirective,v=d.$$element=z(b),s,R,P,q=e,N,u=!1,Ib=!1,w,Da=0,D=a.length;Da< - D;Da++){s=a[Da];var Ta=s.$$start,E=s.$$end;Ta&&(v=pd(b,Ta,E));P=void 0;if(n>s.priority)break;if(w=s.scope)s.templateUrl||(B(w)?(aa("new/isolated scope",J||t,s,v),J=s):aa("new/isolated scope",J,s,v)),t=t||s;R=s.name;if(!u&&(s.replace&&(s.templateUrl||s.template)||s.transclude&&!s.$$tlb)){for(w=Da+1;u=a[w++];)if(u.transclude&&!u.$$tlb||u.replace&&(u.templateUrl||u.template)){Ib=!0;break}u=!0}!s.templateUrl&&s.controller&&(H=H||S(),aa("'"+R+"' controller",H[R],s,v),H[R]=s);if(w=s.transclude)if(ba=!0, - s.$$tlb||(aa("transclusion",y,s,v),y=s),"element"===w)T=!0,n=s.priority,P=v,v=d.$$element=z(da.$$createComment(R,d[R])),b=v[0],ma(g,xa.call(P,0),b),P[0].$$parentNode=P[0].parentNode,q=W(Ib,P,e,n,f&&f.name,{nonTlbTranscludeDirective:y});else{var na=S();if(B(w)){P=[];var Ua=S(),Ma=S();r(w,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;Ua[a]=b;na[b]=null;Ma[b]=c});r(v.contents(),function(a){var b=Ua[Ea(ya(a))];b?(Ma[b]=!0,na[b]=na[b]||[],na[b].push(a)):P.push(a)});r(Ma,function(a,b){if(!a)throw ca("reqslot", - b);});for(var L in na)na[L]&&(na[L]=W(Ib,na[L],e))}else P=z(nc(b)).contents();v.empty();q=W(Ib,P,e,void 0,void 0,{needsNewScope:s.$$isolateScope||s.$$newScope});q.$$slots=na}if(s.template)if(M=!0,aa("template",A,s,v),A=s,w=C(s.template)?s.template(v,d):s.template,w=Ia(w),s.replace){f=s;P=kc.test(w)?qd(ka(s.templateNamespace,Q(w))):[];b=P[0];if(1!==P.length||1!==b.nodeType)throw ca("tplrt",R,"");ma(g,v,b);D={$attr:{}};w=K(b,[],D);var rc=a.splice(Da+1,a.length-(Da+1));(J||t)&&Z(w,J,t);a=a.concat(w).concat(rc); - fa(d,D);D=a.length}else v.html(w);if(s.templateUrl)M=!0,aa("template",A,s,v),A=s,s.replace&&(f=s),p=ja(a.splice(Da,a.length-Da),v,d,g,ba&&q,h,k,{controllerDirectives:H,newScopeDirective:t!==s&&t,newIsolateScopeDirective:J,templateDirective:A,nonTlbTranscludeDirective:y}),D=a.length;else if(s.compile)try{N=s.compile(v,d,q);var U=s.$$originalDirective||s;C(N)?m(null,Ra(U,N),Ta,E):N&&m(Ra(U,N.pre),Ra(U,N.post),Ta,E)}catch($){c($,za(v))}s.terminal&&(p.terminal=!0,n=Math.max(n,s.priority))}p.scope=t&& - !0===t.scope;p.transcludeOnThisElement=ba;p.templateOnThisElement=M;p.transclude=q;l.hasElementTranscludeDirective=T;return p}function X(a,b,c,d){var e;if(E(b)){var g=b.match(l);b=b.substring(g[0].length);var f=g[1]||g[3],g="?"===g[2];"^^"===f?c=c.parent():e=(e=d&&d[b])&&e.instance;if(!e){var h="$"+b+"Controller";e=f?c.inheritedData(h):c.data(h)}if(!e&&!g)throw ca("ctreq",b,a);}else if(I(b))for(e=[],f=0,g=b.length;f<g;f++)e[f]=X(a,b[f],c,d);else B(b)&&(e={},r(b,function(b,g){e[g]=X(a,b,c,d)}));return e|| - null}function ea(a,b,c,d,e,g,f){var h=S(),k;for(k in d){var l=d[k],m={$scope:l===f||l.$$isolateScope?e:g,$element:a,$attrs:b,$transclude:c},p=l.controller;"@"===p&&(p=b[l.name]);m=R(p,m,!0,l.controllerAs);h[l.name]=m;a.data("$"+l.name+"Controller",m.instance)}return h}function Z(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=$b(a[d],{$$isolateScope:b,$$newScope:c})}function U(b,c,e,g,h,k,l){if(c===h)return null;var m=null;if(f.hasOwnProperty(c)){h=a.get(c+"Directive");for(var p=0,n=h.length;p<n;p++)if(c= - h[p],(x(g)||g>c.priority)&&-1!==c.restrict.indexOf(e)){k&&(c=$b(c,{$$start:k,$$end:l}));if(!c.$$bindings){var t=m=c,G=c.name,H={isolateScope:null,bindToController:null};B(t.scope)&&(!0===t.bindToController?(H.bindToController=d(t.scope,G,!0),H.isolateScope={}):H.isolateScope=d(t.scope,G,!1));B(t.bindToController)&&(H.bindToController=d(t.bindToController,G,!0));if(H.bindToController&&!t.controller)throw ca("noctrl",G);m=m.$$bindings=H;B(m.isolateScope)&&(c.$$isolateBindings=m.isolateScope)}b.push(c); - m=c}}return m}function $(b){if(f.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,e=c.length;d<e;d++)if(b=c[d],b.multiElement)return!0;return!1}function fa(a,b){var c=b.$attr,d=a.$attr;r(a,function(d,e){"$"!==e.charAt(0)&&(b[e]&&b[e]!==d&&(d=d.length?d+(("style"===e?";":" ")+b[e]):b[e]),a.$set(e,d,!0,c[e]))});r(b,function(b,e){a.hasOwnProperty(e)||"$"===e.charAt(0)||(a[e]=b,"class"!==e&&"style"!==e&&(d[e]=c[e]))})}function ja(a,b,d,g,f,h,k,l){var m=[],p,n,t=b[0],H=a.shift(),s=$b(H,{templateUrl:null, - transclude:null,replace:null,$$originalDirective:H}),F=C(H.templateUrl)?H.templateUrl(b,d):H.templateUrl,v=H.templateNamespace;b.empty();e(F).then(function(c){var e,G;c=Ia(c);if(H.replace){c=kc.test(c)?qd(ka(v,Q(c))):[];e=c[0];if(1!==c.length||1!==e.nodeType)throw ca("tplrt",H.name,F);c={$attr:{}};ma(g,b,e);var J=K(e,[],c);B(H.scope)&&Z(J,!0);a=J.concat(a);fa(d,c)}else e=t,b.html(c);a.unshift(s);p=Y(a,e,d,f,b,H,h,k,l);r(g,function(a,c){a===e&&(g[c]=b[0])});for(n=Ua(b[0].childNodes,f);m.length;){c= - m.shift();G=m.shift();var y=m.shift(),A=m.shift(),J=b[0];if(!c.$$destroyed){if(G!==t){var M=G.className;l.hasElementTranscludeDirective&&H.replace||(J=nc(e));ma(y,z(G),J);na(z(J),M)}G=p.transcludeOnThisElement?Ma(c,p.transclude,A):A;p(n,c,J,g,G)}}m=null}).catch(function(a){bc(a)&&c(a)});return function(a,b,c,d,e){a=e;b.$$destroyed||(m?m.push(b,c,d,a):(p.transcludeOnThisElement&&(a=Ma(b,p.transclude,e)),p(n,b,c,d,a)))}}function la(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name< - b.name?-1:1:a.index-b.index}function aa(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw ca("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,za(d));}function oa(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&da.$$addBindingClass(a);return function(a,c){var e=c.parent();b||da.$$addBindingClass(e);da.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function ka(a,b){a=L(a||"html");switch(a){case "svg":case "math":var c= - w.document.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function ua(a,b){if("srcdoc"===b)return T.HTML;var c=ya(a);if("src"===b||"ngSrc"===b){if(-1===["img","video","audio","source","track"].indexOf(c))return T.RESOURCE_URL}else if("xlinkHref"===b||"form"===c&&"action"===b||"link"===c&&"href"===b)return T.RESOURCE_URL}function wa(a,c,d,e,g){var f=ua(a,e),h=k[e]||g,l=b(d,!g,f,h);if(l){if("multiple"===e&&"select"===ya(a))throw ca("selmulti", - za(a));if(m.test(e))throw ca("nodomevents");c.push({priority:100,compile:function(){return{pre:function(a,c,g){c=g.$$observers||(g.$$observers=S());var k=g[e];k!==d&&(l=k&&b(k,!0,f,h),d=k);l&&(g[e]=l(a),(c[e]||(c[e]=[])).$$inter=!0,(g.$$observers&&g.$$observers[e].$$scope||a).$watch(l,function(a,b){"class"===e&&a!==b?g.$updateClass(a,b):g.$set(e,a)}))}}}})}}function ma(a,b,c){var d=b[0],e=b.length,g=d.parentNode,f,h;if(a)for(f=0,h=a.length;f<h;f++)if(a[f]===d){a[f++]=c;h=f+e-1;for(var k=a.length;f< - k;f++,h++)h<k?a[f]=a[h]:delete a[f];a.length-=e-1;a.context===d&&(a.context=c);break}g&&g.replaceChild(c,d);a=w.document.createDocumentFragment();for(f=0;f<e;f++)a.appendChild(b[f]);z.hasData(d)&&(z.data(c,z.data(d)),z(d).off("$destroy"));z.cleanData(a.querySelectorAll("*"));for(f=1;f<e;f++)delete b[f];b[0]=c;b.length=1}function ta(a,b){return O(function(){return a.apply(null,arguments)},a,b)}function va(a,b,d,e,g,f){try{a(b,d,e,g,f)}catch(h){c(h,za(d))}}function pa(a,b){if(s)throw ca("missingattr", - a,b);}function qa(a,c,d,e,g){function f(b,c,e){C(d.$onChanges)&&!cc(c,e)&&(ha||(a.$$postDigest(N),ha=[]),m||(m={},ha.push(h)),m[b]&&(e=m[b].previousValue),m[b]=new Jb(e,c))}function h(){d.$onChanges(m);m=void 0}var k=[],l={},m;r(e,function(e,h){var m=e.attrName,n=e.optional,t,G,s,F;switch(e.mode){case "@":n||ra.call(c,m)||(pa(m,g.name),d[h]=c[m]=void 0);n=c.$observe(m,function(a){if(E(a)||Na(a))f(h,a,d[h]),d[h]=a});c.$$observers[m].$$scope=a;t=c[m];E(t)?d[h]=b(t)(a):Na(t)&&(d[h]=t);l[h]=new Jb(sc, - d[h]);k.push(n);break;case "=":if(!ra.call(c,m)){if(n)break;pa(m,g.name);c[m]=void 0}if(n&&!c[m])break;G=p(c[m]);F=G.literal?sa:cc;s=G.assign||function(){t=d[h]=G(a);throw ca("nonassign",c[m],m,g.name);};t=d[h]=G(a);n=function(b){F(b,d[h])||(F(b,t)?s(a,b=d[h]):d[h]=b);return t=b};n.$stateful=!0;n=e.collection?a.$watchCollection(c[m],n):a.$watch(p(c[m],n),null,G.literal);k.push(n);break;case "<":if(!ra.call(c,m)){if(n)break;pa(m,g.name);c[m]=void 0}if(n&&!c[m])break;G=p(c[m]);var v=G.literal,y=d[h]= - G(a);l[h]=new Jb(sc,d[h]);n=a.$watch(G,function(a,b){if(b===a){if(b===y||v&&sa(b,y))return;b=y}f(h,a,b);d[h]=a},v);k.push(n);break;case "&":n||ra.call(c,m)||pa(m,g.name);G=c.hasOwnProperty(m)?p(c[m]):D;if(G===D&&n)break;d[h]=function(b){return G(a,b)}}});return{initialChanges:l,removeWatches:k.length&&function(){for(var a=0,b=k.length;a<b;++a)k[a]()}}}var Ja=/^\w/,Ba=w.document.createElement("div"),Ka=y,La=t,Fa=v,ha;qc.prototype={$normalize:Ea,$addClass:function(a){a&&0<a.length&&P.addClass(this.$$element, - a)},$removeClass:function(a){a&&0<a.length&&P.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=rd(a,b);c&&c.length&&P.addClass(this.$$element,c);(c=rd(b,a))&&c.length&&P.removeClass(this.$$element,c)},$set:function(a,b,d,e){var g=kd(this.$$element[0],a),f=sd[a],h=a;g?(this.$$element.prop(a,b),e=g):f&&(this[f]=b,h=f);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=Vc(a,"-"));g=ya(this.$$element);if("a"===g&&("href"===a||"xlinkHref"===a)||"img"===g&&"src"===a)this[a]= - b=q(b,"src"===a);else if("img"===g&&"srcset"===a&&u(b)){for(var g="",f=Q(b),k=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,k=/\s/.test(f)?k:/(,)/,f=f.split(k),k=Math.floor(f.length/2),l=0;l<k;l++)var m=2*l,g=g+q(Q(f[m]),!0),g=g+(" "+Q(f[m+1]));f=Q(f[2*l]).split(/\s/);g+=q(Q(f[0]),!0);2===f.length&&(g+=" "+Q(f[1]));this[a]=b=g}!1!==d&&(null===b||x(b)?this.$$element.removeAttr(e):Ja.test(e)?this.$$element.attr(e,b):Ta(this.$$element[0],e,b));(a=this.$$observers)&&r(a[h],function(a){try{a(b)}catch(d){c(d)}})}, - $observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=S()),e=d[a]||(d[a]=[]);e.push(b);M.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||x(c[a])||b(c[a])});return function(){cb(e,b)}}};var Ga=b.startSymbol(),Ha=b.endSymbol(),Ia="{{"===Ga&&"}}"===Ha?ab:function(a){return a.replace(/\{\{/g,Ga).replace(/}}/g,Ha)},Pa=/^ngAttr[A-Z]/,Qa=/^(.+)Start$/;da.$$addBindingInfo=n?function(a,b){var c=a.data("$binding")||[];I(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:D;da.$$addBindingClass= - n?function(a){na(a,"ng-binding")}:D;da.$$addScopeInfo=n?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:D;da.$$addScopeClass=n?function(a,b){na(a,b?"ng-isolate-scope":"ng-scope")}:D;da.$$createComment=function(a,b){var c="";n&&(c=" "+(a||"")+": ",b&&(c+=b+" "));return w.document.createComment(c)};return da}]}function Jb(a,b){this.previousValue=a;this.currentValue=b}function Ea(a){return a.replace(od,"").replace(tg,function(a,d,c){return c?d.toUpperCase():d})}function rd(a, - b){var d="",c=a.split(/\s+/),e=b.split(/\s+/),f=0;a:for(;f<c.length;f++){for(var g=c[f],h=0;h<e.length;h++)if(g===e[h])continue a;d+=(0<d.length?" ":"")+g}return d}function qd(a){a=z(a);var b=a.length;if(1>=b)return a;for(;b--;){var d=a[b];(8===d.nodeType||d.nodeType===Oa&&""===d.nodeValue.trim())&&ug.call(a,b,1)}return a}function sg(a,b){if(b&&E(b))return b;if(E(a)){var d=td.exec(a);if(d)return d[3]}}function yf(){var a={},b=!1;this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b, - c){Ia(b,"controller");B(b)?O(a,b):a[b]=c};this.allowGlobals=function(){b=!0};this.$get=["$injector","$window",function(d,c){function e(a,b,c,d){if(!a||!B(a.$scope))throw K("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,k){var l,m,p;h=!0===h;k&&E(k)&&(p=k);if(E(f)){k=f.match(td);if(!k)throw ud("ctrlfmt",f);m=k[1];p=p||k[3];f=a.hasOwnProperty(m)?a[m]:Xc(g.$scope,m,!0)||(b?Xc(c,m,!0):void 0);if(!f)throw ud("ctrlreg",m);sb(f,m,!0)}if(h)return h=(I(f)?f[f.length-1]:f).prototype,l=Object.create(h|| - null),p&&e(g,p,l,m||f.name),O(function(){var a=d.invoke(f,l,g,m);a!==l&&(B(a)||C(a))&&(l=a,p&&e(g,p,l,m||f.name));return l},{instance:l,identifier:p});l=d.instantiate(f,g,m);p&&e(g,p,l,m||f.name);return l}}]}function zf(){this.$get=["$window",function(a){return z(a.document)}]}function Af(){this.$get=["$document","$rootScope",function(a,b){function d(){e=c.hidden}var c=a[0],e=c&&c.hidden;a.on("visibilitychange",d);b.$on("$destroy",function(){a.off("visibilitychange",d)});return function(){return e}}]} - function Bf(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,arguments)}}]}function tc(a){return B(a)?fa(a)?a.toISOString():eb(a):a}function Gf(){this.$get=function(){return function(a){if(!a)return"";var b=[];Oc(a,function(a,c){null===a||x(a)||C(a)||(I(a)?r(a,function(a){b.push(ja(c)+"="+ja(tc(a)))}):b.push(ja(c)+"="+ja(tc(a))))});return b.join("&")}}}function Hf(){this.$get=function(){return function(a){function b(a,e,f){null===a||x(a)||(I(a)?r(a,function(a,c){b(a,e+"["+(B(a)? - c:"")+"]")}):B(a)&&!fa(a)?Oc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):d.push(ja(e)+"="+ja(tc(a))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function uc(a,b){if(E(a)){var d=a.replace(vg,"").trim();if(d){var c=b("Content-Type"),c=c&&0===c.indexOf(vd),e;(e=c)||(e=(e=d.match(wg))&&xg[e[0]].test(d));if(e)try{a=Rc(d)}catch(f){if(!c)return a;throw Kb("baddata",a,f);}}}return a}function wd(a){var b=S(),d;E(a)?r(a.split("\n"),function(a){d=a.indexOf(":");var e=L(Q(a.substr(0,d)));a= - Q(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):B(a)&&r(a,function(a,d){var f=L(d),g=Q(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function xd(a){var b;return function(d){b||(b=wd(a));return d?(d=b[L(d)],void 0===d&&(d=null),d):b}}function yd(a,b,d,c){if(C(c))return c(a,b,d);r(c,function(c){a=c(a,b,d)});return a}function Ff(){var a=this.defaults={transformResponse:[uc],transformRequest:[function(a){return B(a)&&"[object File]"!==ia.call(a)&&"[object Blob]"!==ia.call(a)&&"[object FormData]"!==ia.call(a)? - eb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ka(vc),put:ka(vc),patch:ka(vc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer",jsonpCallbackParam:"callback"},b=!1;this.useApplyAsync=function(a){return u(a)?(b=!!a,this):b};var d=this.interceptors=[];this.$get=["$browser","$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector","$sce",function(c,e,f,g,h,k,l,m){function p(b){function d(a,b){for(var c=0, - e=b.length;c<e;){var g=b[c++],f=b[c++];a=a.then(g,f)}b.length=0;return a}function e(a,b){var c,d={};r(a,function(a,e){C(a)?(c=a(b),null!=c&&(d[e]=c)):d[e]=a});return d}function g(a){var b=O({},a);b.data=yd(a.data,a.headers,a.status,f.transformResponse);a=a.status;return 200<=a&&300>a?b:k.reject(b)}if(!B(b))throw K("$http")("badreq",b);if(!E(m.valueOf(b.url)))throw K("$http")("badreq",b.url);var f=O({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer, - jsonpCallbackParam:a.jsonpCallbackParam},b);f.headers=function(b){var c=a.headers,d=O({},b.headers),g,f,h,c=O({},c.common,c[L(b.method)]);a:for(g in c){f=L(g);for(h in d)if(L(h)===f)continue a;d[g]=c[g]}return e(d,ka(b))}(b);f.method=ub(f.method);f.paramSerializer=E(f.paramSerializer)?l.get(f.paramSerializer):f.paramSerializer;c.$$incOutstandingRequestCount();var h=[],p=[];b=k.resolve(f);r(y,function(a){(a.request||a.requestError)&&h.unshift(a.request,a.requestError);(a.response||a.responseError)&& - p.push(a.response,a.responseError)});b=d(b,h);b=b.then(function(b){var c=b.headers,d=yd(b.data,xd(c),void 0,b.transformRequest);x(d)&&r(c,function(a,b){"content-type"===L(b)&&delete c[b]});x(b.withCredentials)&&!x(a.withCredentials)&&(b.withCredentials=a.withCredentials);return n(b,d).then(g,g)});b=d(b,p);return b=b.finally(function(){c.$$completeOutstandingRequest(D)})}function n(c,d){function g(a){if(a){var c={};r(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d(): - h.$apply(d)}});return c}}function l(a,c,d,e,g){function f(){n(c,a,d,e,g)}M&&(200<=a&&300>a?M.put(N,[a,c,wd(d),e,g]):M.remove(N));b?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function n(a,b,d,e,g){b=-1<=b?b:0;(200<=b&&300>b?J.resolve:J.reject)({data:a,status:b,headers:xd(d),config:c,statusText:e,xhrStatus:g})}function G(a){n(a.data,a.status,ka(a.headers()),a.statusText,a.xhrStatus)}function y(){var a=p.pendingRequests.indexOf(c);-1!==a&&p.pendingRequests.splice(a,1)}var J=k.defer(),R=J.promise,M, - T,P=c.headers,q="jsonp"===L(c.method),N=c.url;q?N=m.getTrustedResourceUrl(N):E(N)||(N=m.valueOf(N));N=F(N,c.paramSerializer(c.params));q&&(N=s(N,c.jsonpCallbackParam));p.pendingRequests.push(c);R.then(y,y);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(M=B(c.cache)?c.cache:B(a.cache)?a.cache:v);M&&(T=M.get(N),u(T)?T&&C(T.then)?T.then(G,G):I(T)?n(T[1],T[0],ka(T[2]),T[3],T[4]):n(T,200,{},"OK","complete"):M.put(N,R));x(T)&&((T=zd(c.url)?f()[c.xsrfCookieName||a.xsrfCookieName]: - void 0)&&(P[c.xsrfHeaderName||a.xsrfHeaderName]=T),e(c.method,N,d,l,P,c.timeout,c.withCredentials,c.responseType,g(c.eventHandlers),g(c.uploadEventHandlers)));return R}function F(a,b){0<b.length&&(a+=(-1===a.indexOf("?")?"?":"&")+b);return a}function s(a,b){var c=a.split("?");if(2<c.length)throw Kb("badjsonp",a);c=ec(c[1]);r(c,function(c,d){if("JSON_CALLBACK"===c)throw Kb("badjsonp",a);if(d===b)throw Kb("badjsonp",b,a);});return a+=(-1===a.indexOf("?")?"?":"&")+b+"=JSON_CALLBACK"}var v=g("$http"); - a.paramSerializer=E(a.paramSerializer)?l.get(a.paramSerializer):a.paramSerializer;var y=[];r(d,function(a){y.unshift(E(a)?l.get(a):l.invoke(a))});p.pendingRequests=[];(function(a){r(arguments,function(a){p[a]=function(b,c){return p(O({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){r(arguments,function(a){p[a]=function(b,c,d){return p(O({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");p.defaults=a;return p}]}function Jf(){this.$get=function(){return function(){return new w.XMLHttpRequest}}} - function If(){this.$get=["$browser","$jsonpCallbacks","$document","$xhrFactory",function(a,b,d,c){return yg(a,c,a.defer,b,d[0])}]}function yg(a,b,d,c,e){function f(a,b,d){a=a.replace("JSON_CALLBACK",b);var f=e.createElement("script"),m=null;f.type="text/javascript";f.src=a;f.async=!0;m=function(a){f.removeEventListener("load",m);f.removeEventListener("error",m);e.body.removeChild(f);f=null;var g=-1,F="unknown";a&&("load"!==a.type||c.wasCalled(b)||(a={type:"error"}),F=a.type,g="error"===a.type?404: - 200);d&&d(g,F)};f.addEventListener("load",m);f.addEventListener("error",m);e.body.appendChild(f);return m}return function(e,h,k,l,m,p,n,F,s,v){function y(){q&&q();A&&A.abort()}function t(a,b,c,e,g,f){u(G)&&d.cancel(G);q=A=null;a(b,c,e,g,f)}h=h||a.url();if("jsonp"===L(e))var Aa=c.createCallback(h),q=f(h,Aa,function(a,b){var d=200===a&&c.getResponse(Aa);t(l,a,d,"",b,"complete");c.removeCallback(Aa)});else{var A=b(e,h);A.open(e,h,!0);r(m,function(a,b){u(a)&&A.setRequestHeader(b,a)});A.onload=function(){var a= - A.statusText||"",b="response"in A?A.response:A.responseText,c=1223===A.status?204:A.status;0===c&&(c=b?200:"file"===ta(h).protocol?404:0);t(l,c,b,A.getAllResponseHeaders(),a,"complete")};A.onerror=function(){t(l,-1,null,null,"","error")};A.onabort=function(){t(l,-1,null,null,"","abort")};A.ontimeout=function(){t(l,-1,null,null,"","timeout")};r(s,function(a,b){A.addEventListener(b,a)});r(v,function(a,b){A.upload.addEventListener(b,a)});n&&(A.withCredentials=!0);if(F)try{A.responseType=F}catch(H){if("json"!== - F)throw H;}A.send(x(k)?null:k)}if(0<p)var G=d(y,p);else p&&C(p.then)&&p.then(y)}}function Df(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a};this.endSymbol=function(a){return a?(b=a,this):b};this.$get=["$parse","$exceptionHandler","$sce",function(d,c,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(p,a).replace(n,b)}function h(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}function k(f,k,p,n){function t(a){try{var b=a;a=p?e.getTrusted(p, - b):e.valueOf(b);return n&&!u(a)?a:gc(a)}catch(d){c(Fa.interr(f,d))}}if(!f.length||-1===f.indexOf(a)){var r;k||(k=g(f),r=la(k),r.exp=f,r.expressions=[],r.$$watchDelegate=h);return r}n=!!n;var q,A,H=0,G=[],ba=[];r=f.length;for(var J=[],R=[];H<r;)if(-1!==(q=f.indexOf(a,H))&&-1!==(A=f.indexOf(b,q+l)))H!==q&&J.push(g(f.substring(H,q))),H=f.substring(q+l,A),G.push(H),ba.push(d(H,t)),H=A+m,R.push(J.length),J.push("");else{H!==r&&J.push(g(f.substring(H)));break}p&&1<J.length&&Fa.throwNoconcat(f);if(!k||G.length){var M= - function(a){for(var b=0,c=G.length;b<c;b++){if(n&&x(a[b]))return;J[R[b]]=a[b]}return J.join("")};return O(function(a){var b=0,d=G.length,e=Array(d);try{for(;b<d;b++)e[b]=ba[b](a);return M(e)}catch(g){c(Fa.interr(f,g))}},{exp:f,expressions:G,$$watchDelegate:function(a,b){var c;return a.$watchGroup(ba,function(d,e){var g=M(d);b.call(this,g,d!==e?c:g,a);c=g})}})}}var l=a.length,m=b.length,p=new RegExp(a.replace(/./g,f),"g"),n=new RegExp(b.replace(/./g,f),"g");k.startSymbol=function(){return a};k.endSymbol= - function(){return b};return k}]}function Ef(){this.$get=["$rootScope","$window","$q","$$q","$browser",function(a,b,d,c,e){function f(f,k,l,m){function p(){n?f.apply(null,F):f(y)}var n=4<arguments.length,F=n?xa.call(arguments,4):[],s=b.setInterval,v=b.clearInterval,y=0,t=u(m)&&!m,r=(t?c:d).defer(),q=r.promise;l=u(l)?l:0;q.$$intervalId=s(function(){t?e.defer(p):a.$evalAsync(p);r.notify(y++);0<l&&y>=l&&(r.resolve(y),v(q.$$intervalId),delete g[q.$$intervalId]);t||a.$apply()},k);g[q.$$intervalId]=r;return q} - var g={};f.cancel=function(a){return a&&a.$$intervalId in g?(g[a.$$intervalId].promise.$$state.pur=!0,g[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId),delete g[a.$$intervalId],!0):!1};return f}]}function wc(a){a=a.split("/");for(var b=a.length;b--;)a[b]=fb(a[b].replace(/%2F/g,"/"));return a.join("/")}function Ad(a,b){var d=ta(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=Z(d.port)||zg[d.protocol]||null}function Bd(a,b,d){if(Ag.test(a))throw kb("badpath",a);var c="/"!== - a.charAt(0);c&&(a="/"+a);a=ta(a);for(var c=(c&&"/"===a.pathname.charAt(0)?a.pathname.substring(1):a.pathname).split("/"),e=c.length;e--;)c[e]=decodeURIComponent(c[e]),d&&(c[e]=c[e].replace(/\//g,"%2F"));d=c.join("/");b.$$path=d;b.$$search=ec(a.search);b.$$hash=decodeURIComponent(a.hash);b.$$path&&"/"!==b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function xc(a,b){return a.slice(0,b.length)===b}function ua(a,b){if(xc(b,a))return b.substr(a.length)}function La(a){var b=a.indexOf("#");return-1===b?a: - a.substr(0,b)}function lb(a){return a.replace(/(#.+)|#$/,"$1")}function yc(a,b,d){this.$$html5=!0;d=d||"";Ad(a,this);this.$$parse=function(a){var d=ua(b,a);if(!E(d))throw kb("ipthprfx",a,b);Bd(d,this,!0);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=fc(this.$$search),d=this.$$hash?"#"+fb(this.$$hash):"";this.$$url=wc(this.$$path)+(a?"?"+a:"")+d;this.$$absUrl=b+this.$$url.substr(1);this.$$urlUpdatedByLocation=!0};this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)), - !0;var f,g;u(f=ua(a,c))?(g=f,g=d&&u(f=ua(d,f))?b+(ua("/",f)||f):a+g):u(f=ua(b,c))?g=b+f:b===c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function zc(a,b,d){Ad(a,this);this.$$parse=function(c){var e=ua(a,c)||ua(b,c),f;x(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",x(e)&&(a=c,this.replace())):(f=ua(d,e),x(f)&&(f=e));Bd(f,this,!1);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;xc(f,e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?f[1]:c);this.$$path=c;this.$$compose()};this.$$compose=function(){var b=fc(this.$$search), - e=this.$$hash?"#"+fb(this.$$hash):"";this.$$url=wc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+(this.$$url?d+this.$$url:"");this.$$urlUpdatedByLocation=!0};this.$$parseLinkUrl=function(b,d){return La(a)===La(b)?(this.$$parse(b),!0):!1}}function Cd(a,b,d){this.$$html5=!0;zc.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a===La(c)?f=c:(g=ua(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$compose=function(){var b=fc(this.$$search), - e=this.$$hash?"#"+fb(this.$$hash):"";this.$$url=wc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+d+this.$$url;this.$$urlUpdatedByLocation=!0}}function Lb(a){return function(){return this[a]}}function Dd(a,b){return function(d){if(x(d))return this[a];this[a]=b(d);this.$$compose();return this}}function Lf(){var a="!",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return u(b)?(a=b,this):a};this.html5Mode=function(a){if(Na(a))return b.enabled=a,this;if(B(a)){Na(a.enabled)&&(b.enabled= - a.enabled);Na(a.requireBase)&&(b.requireBase=a.requireBase);if(Na(a.rewriteLinks)||E(a.rewriteLinks))b.rewriteLinks=a.rewriteLinks;return this}return b};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,c,e,f,g){function h(a,b,d){var e=l.url(),g=l.$$state;try{c.url(a,b,d),l.$$state=c.state()}catch(f){throw l.url(e),l.$$state=g,f;}}function k(a,b){d.$broadcast("$locationChangeSuccess",l.absUrl(),a,l.$$state,b)}var l,m;m=c.baseHref();var p=c.url(),n;if(b.enabled){if(!m&& - b.requireBase)throw kb("nobase");n=p.substring(0,p.indexOf("/",p.indexOf("//")+2))+(m||"/");m=e.history?yc:Cd}else n=La(p),m=zc;var F=n.substr(0,La(n).lastIndexOf("/")+1);l=new m(n,F,"#"+a);l.$$parseLinkUrl(p,p);l.$$state=c.state();var s=/^\s*(javascript|mailto):/i;f.on("click",function(a){var e=b.rewriteLinks;if(e&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!==a.which&&2!==a.button){for(var h=z(a.target);"a"!==ya(h[0]);)if(h[0]===f[0]||!(h=h.parent())[0])return;if(!E(e)||!x(h.attr(e))){var e=h.prop("href"), - k=h.attr("href")||h.attr("xlink:href");B(e)&&"[object SVGAnimatedString]"===e.toString()&&(e=ta(e.animVal).href);s.test(e)||!e||h.attr("target")||a.isDefaultPrevented()||!l.$$parseLinkUrl(e,k)||(a.preventDefault(),l.absUrl()!==c.url()&&(d.$apply(),g.angular["ff-684208-preventDefault"]=!0))}}});lb(l.absUrl())!==lb(p)&&c.url(l.absUrl(),!0);var v=!0;c.onUrlChange(function(a,b){xc(a,F)?(d.$evalAsync(function(){var c=l.absUrl(),e=l.$$state,g;a=lb(a);l.$$parse(a);l.$$state=b;g=d.$broadcast("$locationChangeStart", - a,c,b,e).defaultPrevented;l.absUrl()===a&&(g?(l.$$parse(c),l.$$state=e,h(c,!1,e)):(v=!1,k(c,e)))}),d.$$phase||d.$digest()):g.location.href=a});d.$watch(function(){if(v||l.$$urlUpdatedByLocation){l.$$urlUpdatedByLocation=!1;var a=lb(c.url()),b=lb(l.absUrl()),g=c.state(),f=l.$$replace,m=a!==b||l.$$html5&&e.history&&g!==l.$$state;if(v||m)v=!1,d.$evalAsync(function(){var b=l.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,l.$$state,g).defaultPrevented;l.absUrl()===b&&(c?(l.$$parse(a),l.$$state=g): - (m&&h(b,f,g===l.$$state?null:l.$$state),k(a,g)))})}l.$$replace=!1});return l}]}function Mf(){var a=!0,b=this;this.debugEnabled=function(b){return u(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){bc(a)&&(a.stack&&f?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||D;return function(){var a=[];r(arguments,function(b){a.push(c(b))});return Function.prototype.apply.call(e, - b,a)}}var f=Ca||/\bEdge\//.test(d.navigator&&d.navigator.userAgent);return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Bg(a){return a+""}function Cg(a,b){return"undefined"!==typeof a?a:b}function Ed(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function Dg(a,b){switch(a.type){case q.MemberExpression:if(a.computed)return!1;break;case q.UnaryExpression:return 1;case q.BinaryExpression:return"+"!== - a.operator?1:!1;case q.CallExpression:return!1}return void 0===b?Fd:b}function W(a,b,d){var c,e,f=a.isPure=Dg(a,d);switch(a.type){case q.Program:c=!0;r(a.body,function(a){W(a.expression,b,f);c=c&&a.expression.constant});a.constant=c;break;case q.Literal:a.constant=!0;a.toWatch=[];break;case q.UnaryExpression:W(a.argument,b,f);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;break;case q.BinaryExpression:W(a.left,b,f);W(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch= - a.left.toWatch.concat(a.right.toWatch);break;case q.LogicalExpression:W(a.left,b,f);W(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case q.ConditionalExpression:W(a.test,b,f);W(a.alternate,b,f);W(a.consequent,b,f);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case q.Identifier:a.constant=!1;a.toWatch=[a];break;case q.MemberExpression:W(a.object,b,f);a.computed&&W(a.property,b,f);a.constant=a.object.constant&& - (!a.computed||a.property.constant);a.toWatch=a.constant?[]:[a];break;case q.CallExpression:c=d=a.filter?!b(a.callee.name).$stateful:!1;e=[];r(a.arguments,function(a){W(a,b,f);c=c&&a.constant;e.push.apply(e,a.toWatch)});a.constant=c;a.toWatch=d?e:[a];break;case q.AssignmentExpression:W(a.left,b,f);W(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=[a];break;case q.ArrayExpression:c=!0;e=[];r(a.elements,function(a){W(a,b,f);c=c&&a.constant;e.push.apply(e,a.toWatch)});a.constant=c; - a.toWatch=e;break;case q.ObjectExpression:c=!0;e=[];r(a.properties,function(a){W(a.value,b,f);c=c&&a.value.constant;e.push.apply(e,a.value.toWatch);a.computed&&(W(a.key,b,!1),c=c&&a.key.constant,e.push.apply(e,a.key.toWatch))});a.constant=c;a.toWatch=e;break;case q.ThisExpression:a.constant=!1;a.toWatch=[];break;case q.LocalsExpression:a.constant=!1,a.toWatch=[]}}function Gd(a){if(1===a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function Hd(a){return a.type=== - q.Identifier||a.type===q.MemberExpression}function Id(a){if(1===a.body.length&&Hd(a.body[0].expression))return{type:q.AssignmentExpression,left:a.body[0].expression,right:{type:q.NGValueParameter},operator:"="}}function Jd(a){this.$filter=a}function Kd(a){this.$filter=a}function Mb(a,b,d){this.ast=new q(a,d);this.astCompiler=d.csp?new Kd(b):new Jd(b)}function Ac(a){return C(a.valueOf)?a.valueOf():Eg.call(a)}function Nf(){var a=S(),b={"true":!0,"false":!1,"null":null,undefined:void 0},d,c;this.addLiteral= - function(a,c){b[a]=c};this.setIdentifierFns=function(a,b){d=a;c=b;return this};this.$get=["$filter",function(e){function f(b,c){var d,g;switch(typeof b){case "string":return g=b=b.trim(),d=a[g],d||(d=new Nb(n),d=(new Mb(d,e,n)).parse(b),d.constant?d.$$watchDelegate=m:d.oneTime?d.$$watchDelegate=d.literal?l:k:d.inputs&&(d.$$watchDelegate=h),a[g]=d),p(d,c);case "function":return p(b,c);default:return p(D,c)}}function g(a,b,c){return null==a||null==b?a===b:"object"!==typeof a||(a=Ac(a),"object"!==typeof a|| - c)?a===b||a!==a&&b!==b:!1}function h(a,b,c,d,e){var f=d.inputs,h;if(1===f.length){var k=g,f=f[0];return a.$watch(function(a){var b=f(a);g(b,k,f.isPure)||(h=d(a,void 0,void 0,[b]),k=b&&Ac(b));return h},b,c,e)}for(var l=[],m=[],p=0,n=f.length;p<n;p++)l[p]=g,m[p]=null;return a.$watch(function(a){for(var b=!1,c=0,e=f.length;c<e;c++){var k=f[c](a);if(b||(b=!g(k,l[c],f[c].isPure)))m[c]=k,l[c]=k&&Ac(k)}b&&(h=d(a,void 0,void 0,m));return h},b,c,e)}function k(a,b,c,d,e){function g(a){return d(a)}function f(a, - c,d){l=a;C(b)&&b(a,c,d);u(a)&&d.$$postDigest(function(){u(l)&&k()})}var k,l;return k=d.inputs?h(a,f,c,d,e):a.$watch(g,f,c)}function l(a,b,c,d){function e(a){var b=!0;r(a,function(a){u(a)||(b=!1)});return b}var g,f;return g=a.$watch(function(a){return d(a)},function(a,c,d){f=a;C(b)&&b(a,c,d);e(a)&&d.$$postDigest(function(){e(f)&&g()})},c)}function m(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}function p(a,b){if(!b)return a;var c=a.$$watchDelegate,d=!1,e=c!==l&&c!==k?function(c, - e,g,f){g=d&&f?f[0]:a(c,e,g,f);return b(g,c,e)}:function(c,d,e,g){e=a(c,d,e,g);c=b(e,c,d);return u(e)?c:e},d=!a.inputs;c&&c!==h?(e.$$watchDelegate=c,e.inputs=a.inputs):b.$stateful||(e.$$watchDelegate=h,e.inputs=a.inputs?a.inputs:[a]);e.inputs&&(e.inputs=e.inputs.map(function(a){return a.isPure===Fd?function(b){return a(b)}:a}));return e}var n={csp:Ja().noUnsafeEval,literals:pa(b),isIdentifierStart:C(d)&&d,isIdentifierContinue:C(c)&&c};f.$$getAst=function(a){var b=new Nb(n);return(new Mb(b,e,n)).getAst(a).ast}; - return f}]}function Pf(){var a=!0;this.$get=["$rootScope","$exceptionHandler",function(b,d){return Ld(function(a){b.$evalAsync(a)},d,a)}];this.errorOnUnhandledRejections=function(b){return u(b)?(a=b,this):a}}function Qf(){var a=!0;this.$get=["$browser","$exceptionHandler",function(b,d){return Ld(function(a){b.defer(a)},d,a)}];this.errorOnUnhandledRejections=function(b){return u(b)?(a=b,this):a}}function Ld(a,b,d){function c(){return new e}function e(){var a=this.promise=new f;this.resolve=function(b){k(a, - b)};this.reject=function(b){m(a,b)};this.notify=function(b){n(a,b)}}function f(){this.$$state={status:0}}function g(){for(;!u&&w.length;){var a=w.shift();if(!a.pur){a.pur=!0;var c=a.value,c="Possibly unhandled rejection: "+("function"===typeof c?c.toString().replace(/ \{[\s\S]*$/,""):x(c)?"undefined":"string"!==typeof c?De(c,void 0):c);bc(a.value)?b(a.value,c):b(c)}}}function h(c){!d||c.pending||2!==c.status||c.pur||(0===u&&0===w.length&&a(g),w.push(c));!c.processScheduled&&c.pending&&(c.processScheduled= - !0,++u,a(function(){var e,f,h;h=c.pending;c.processScheduled=!1;c.pending=void 0;try{for(var l=0,p=h.length;l<p;++l){c.pur=!0;f=h[l][0];e=h[l][c.status];try{C(e)?k(f,e(c.value)):1===c.status?k(f,c.value):m(f,c.value)}catch(n){m(f,n),n&&!0===n.$$passToExceptionHandler&&b(n)}}}finally{--u,d&&0===u&&a(g)}}))}function k(a,b){a.$$state.status||(b===a?p(a,t("qcycle",b)):l(a,b))}function l(a,b){function c(b){g||(g=!0,l(a,b))}function d(b){g||(g=!0,p(a,b))}function e(b){n(a,b)}var f,g=!1;try{if(B(b)||C(b))f= - b.then;C(f)?(a.$$state.status=-1,f.call(b,c,d,e)):(a.$$state.value=b,a.$$state.status=1,h(a.$$state))}catch(k){d(k)}}function m(a,b){a.$$state.status||p(a,b)}function p(a,b){a.$$state.value=b;a.$$state.status=2;h(a.$$state)}function n(c,d){var e=c.$$state.pending;0>=c.$$state.status&&e&&e.length&&a(function(){for(var a,c,g=0,f=e.length;g<f;g++){c=e[g][0];a=e[g][3];try{n(c,C(a)?a(d):d)}catch(h){b(h)}}})}function F(a){var b=new f;m(b,a);return b}function s(a,b,c){var d=null;try{C(c)&&(d=c())}catch(e){return F(e)}return d&& - C(d.then)?d.then(function(){return b(a)},F):b(a)}function v(a,b,c,d){var e=new f;k(e,a);return e.then(b,c,d)}function q(a){if(!C(a))throw t("norslvr",a);var b=new f;a(function(a){k(b,a)},function(a){m(b,a)});return b}var t=K("$q",TypeError),u=0,w=[];O(f.prototype,{then:function(a,b,c){if(x(a)&&x(b)&&x(c))return this;var d=new f;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,a,b,c]);0<this.$$state.status&&h(this.$$state);return d},"catch":function(a){return this.then(null, - a)},"finally":function(a,b){return this.then(function(b){return s(b,A,a)},function(b){return s(b,F,a)},b)}});var A=v;q.prototype=f.prototype;q.defer=c;q.reject=F;q.when=v;q.resolve=A;q.all=function(a){var b=new f,c=0,d=I(a)?[]:{};r(a,function(a,e){c++;v(a).then(function(a){d[e]=a;--c||k(b,d)},function(a){m(b,a)})});0===c&&k(b,d);return b};q.race=function(a){var b=c();r(a,function(a){v(a).then(b.resolve,b.reject)});return b.promise};return q}function Zf(){this.$get=["$window","$timeout",function(a, - b){var d=a.requestAnimationFrame||a.webkitRequestAnimationFrame,c=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame,e=!!d,f=e?function(a){var b=d(a);return function(){c(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};f.supported=e;return f}]}function Of(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++qb;this.$$ChildScope= - null}b.prototype=a;return b}var b=10,d=K("$rootScope"),c=null,e=null;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$exceptionHandler","$parse","$browser",function(f,g,h){function k(a){a.currentScope.$$destroyed=!0}function l(a){9===Ca&&(a.$$childHead&&l(a.$$childHead),a.$$nextSibling&&l(a.$$nextSibling));a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function m(){this.$id=++qb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling= - this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function p(a){if(t.$$phase)throw d("inprog",t.$$phase);t.$$phase=a}function n(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function F(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function s(){}function v(){for(;A.length;)try{A.shift()()}catch(a){f(a)}e= - null}function q(){null===e&&(e=h.defer(function(){t.$apply(v)}))}m.prototype={constructor:m,$new:function(b,c){var d;c=c||this;b?(d=new m,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(b||c!==this)&&d.$on("$destroy",k);return d},$watch:function(a,b,d,e){var f=g(a);b=C(b)?b:D;if(f.$$watchDelegate)return f.$$watchDelegate(this, - b,d,f,a);var h=this,k=h.$$watchers,l={fn:b,last:s,get:f,exp:e||a,eq:!!d};c=null;k||(k=h.$$watchers=[],k.$$digestWatchIndex=-1);k.unshift(l);k.$$digestWatchIndex++;n(this,1);return function(){var a=cb(k,l);0<=a&&(n(h,-1),a<k.$$digestWatchIndex&&k.$$digestWatchIndex--);c=null}},$watchGroup:function(a,b){function c(){h=!1;k?(k=!1,b(e,e,g)):b(e,d,g)}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=!1}}if(1=== - a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});r(a,function(a,b){var k=g.$watch(a,function(a,f){e[b]=a;d[b]=f;h||(h=!0,g.$evalAsync(c))});f.push(k)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!x(e)){if(B(e))if(wa(e))for(f!==p&&(f=p,t=f.length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==n&&(f=n={},t=0,l++);a=0;for(b in e)ra.call(e, - b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(t>a)for(b in l++,f)ra.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,h,k=1<b.length,l=0,m=g(a,c),p=[],n={},s=!0,t=0;return this.$watch(m,function(){s?(s=!1,b(e,e,d)):b(e,h,d);if(k)if(B(e))if(wa(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)ra.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var a,g,k,l,m,n,r,F=b,q,A=[],y,x;p("$digest"); - h.$$checkUrlChange();this===t&&null!==e&&(h.defer.cancel(e),v());c=null;do{r=!1;q=this;for(n=0;n<u.length;n++){try{x=u[n],l=x.fn,l(x.scope,x.locals)}catch(z){f(z)}c=null}u.length=0;a:do{if(n=q.$$watchers)for(n.$$digestWatchIndex=n.length;n.$$digestWatchIndex--;)try{if(a=n[n.$$digestWatchIndex])if(m=a.get,(g=m(q))!==(k=a.last)&&!(a.eq?sa(g,k):U(g)&&U(k)))r=!0,c=a,a.last=a.eq?pa(g,null):g,l=a.fn,l(g,k===s?g:k,q),5>F&&(y=4-F,A[y]||(A[y]=[]),A[y].push({msg:C(a.exp)?"fn: "+(a.exp.name||a.exp.toString()): - a.exp,newVal:g,oldVal:k}));else if(a===c){r=!1;break a}}catch(D){f(D)}if(!(n=q.$$watchersCount&&q.$$childHead||q!==this&&q.$$nextSibling))for(;q!==this&&!(n=q.$$nextSibling);)q=q.$parent}while(q=n);if((r||u.length)&&!F--)throw t.$$phase=null,d("infdig",b,A);}while(r||u.length);for(t.$$phase=null;H<w.length;)try{w[H++]()}catch(B){f(B)}w.length=H=0;h.$$checkUrlChange()},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===t&&h.$$applicationDestroyed(); - n(this,-this.$$watchersCount);for(var b in this.$$listenerCount)F(this,this.$$listenerCount[b],b);a&&a.$$childHead===this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail===this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=D;this.$on=this.$watch=this.$watchGroup=function(){return D};this.$$listeners= - {};this.$$nextSibling=null;l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){t.$$phase||u.length||h.defer(function(){u.length&&t.$digest()});u.push({scope:this,fn:g(a),locals:b})},$$postDigest:function(a){w.push(a)},$apply:function(a){try{p("$apply");try{return this.$eval(a)}finally{t.$$phase=null}}catch(b){f(b)}finally{try{t.$digest()}catch(c){throw f(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&A.push(b);a=g(a);q()},$on:function(a,b){var c=this.$$listeners[a]; - c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(delete c[d],F(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=db([h],arguments,1),l,m;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(m=d.length;l<m;l++)if(d[l])try{d[l].apply(null, - k)}catch(n){f(n)}else d.splice(l,1),l--,m--;if(g)break;e=e.$parent}while(e);h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var g=db([e],arguments,1),h,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(k=d.length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead|| - c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var t=new m,u=t.$$asyncQueue=[],w=t.$$postDigestQueue=[],A=t.$$applyAsyncQueue=[],H=0;return t}]}function Ge(){var a=/^\s*(https?|s?ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(b){return u(b)?(a=b,this):a};this.imgSrcSanitizationWhitelist=function(a){return u(a)?(b=a,this):b};this.$get=function(){return function(d,c){var e=c?b: - a,f;f=ta(d&&d.trim()).href;return""===f||f.match(e)?d:"unsafe:"+f}}}function Fg(a){if("self"===a)return a;if(E(a)){if(-1<a.indexOf("***"))throw va("iwcard",a);a=Md(a).replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^:/.?&;]*");return new RegExp("^"+a+"$")}if($a(a))return new RegExp("^"+a.source+"$");throw va("imatcher");}function Nd(a){var b=[];u(a)&&r(a,function(a){b.push(Fg(a))});return b}function Sf(){this.SCE_CONTEXTS=oa;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){arguments.length&& - (a=Nd(b));return a};this.resourceUrlBlacklist=function(a){arguments.length&&(b=Nd(a));return b};this.$get=["$injector",function(d){function c(a,b){return"self"===a?zd(b):!!a.exec(b.href)}function e(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var f=function(a){throw va("unsafe");};d.has("$sanitize")&& - (f=d.get("$sanitize"));var g=e(),h={};h[oa.HTML]=e(g);h[oa.CSS]=e(g);h[oa.URL]=e(g);h[oa.JS]=e(g);h[oa.RESOURCE_URL]=e(h[oa.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw va("icontext",a,b);if(null===b||x(b)||""===b)return b;if("string"!==typeof b)throw va("itype",a);return new c(b)},getTrusted:function(d,e){if(null===e||x(e)||""===e)return e;var g=h.hasOwnProperty(d)?h[d]:null;if(g&&e instanceof g)return e.$$unwrapTrustedValue();if(d===oa.RESOURCE_URL){var g=ta(e.toString()), - p,n,r=!1;p=0;for(n=a.length;p<n;p++)if(c(a[p],g)){r=!0;break}if(r)for(p=0,n=b.length;p<n;p++)if(c(b[p],g)){r=!1;break}if(r)return e;throw va("insecurl",e.toString());}if(d===oa.HTML)return f(e);throw va("unsafe");},valueOf:function(a){return a instanceof g?a.$$unwrapTrustedValue():a}}}]}function Rf(){var a=!0;this.enabled=function(b){arguments.length&&(a=!!b);return a};this.$get=["$parse","$sceDelegate",function(b,d){if(a&&8>Ca)throw va("iequirks");var c=ka(oa);c.isEnabled=function(){return a};c.trustAs= - d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=ab);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;r(oa,function(a,b){var d=L(b);c[("parse_as_"+d).replace(Bc,wb)]=function(b){return e(a,b)};c[("get_trusted_"+d).replace(Bc,wb)]=function(b){return f(a,b)};c[("trust_as_"+d).replace(Bc,wb)]=function(b){return g(a,b)}});return c}]} - function Tf(){this.$get=["$window","$document",function(a,b){var d={},c=!((!a.nw||!a.nw.process)&&a.chrome&&(a.chrome.app&&a.chrome.app.runtime||!a.chrome.app&&a.chrome.runtime&&a.chrome.runtime.id))&&a.history&&a.history.pushState,e=Z((/android (\d+)/.exec(L((a.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},h=g.body&&g.body.style,k=!1,l=!1;h&&(k=!!("transition"in h||"webkitTransition"in h),l=!!("animation"in h||"webkitAnimation"in h));return{history:!(!c|| - 4>e||f),hasEvent:function(a){if("input"===a&&Ca)return!1;if(x(d[a])){var b=g.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ja(),transitions:k,animations:l,android:e}}]}function Vf(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(b,d,c,e,f){function g(h,k){g.totalPendingRequests++;if(!E(h)||x(d.get(h)))h=f.getTrustedResourceUrl(h);var l=c.defaults&&c.defaults.transformResponse;I(l)?l=l.filter(function(a){return a!== - uc}):l===uc&&(l=null);return c.get(h,O({cache:d,transformResponse:l},a)).finally(function(){g.totalPendingRequests--}).then(function(a){d.put(h,a.data);return a.data},function(a){k||(a=Gg("tpload",h,a.status,a.statusText),b(a));return e.reject(a)})}g.totalPendingRequests=0;return g}]}function Wf(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];r(a,function(a){var c=$.element(a).data("$binding");c&& - r(c,function(c){d?(new RegExp("(^|\\s)"+Md(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!==c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],h=0;h<g.length;++h){var k=a.querySelectorAll("["+g[h]+"model"+(d?"=":"*=")+'"'+b+'"]');if(k.length)return k}},getLocation:function(){return d.url()},setLocation:function(b){b!==d.url()&&(d.url(b),a.$digest())},whenStable:function(a){b.notifyWhenNoOutstandingRequests(a)}}}]}function Xf(){this.$get=["$rootScope","$browser", - "$q","$$q","$exceptionHandler",function(a,b,d,c,e){function f(f,k,l){C(f)||(l=k,k=f,f=D);var m=xa.call(arguments,3),p=u(l)&&!l,n=(p?c:d).defer(),r=n.promise,s;s=b.defer(function(){try{n.resolve(f.apply(null,m))}catch(b){n.reject(b),e(b)}finally{delete g[r.$$timeoutId]}p||a.$apply()},k);r.$$timeoutId=s;g[s]=n;return r}var g={};f.cancel=function(a){return a&&a.$$timeoutId in g?(g[a.$$timeoutId].promise.$$state.pur=!0,g[a.$$timeoutId].reject("canceled"),delete g[a.$$timeoutId],b.defer.cancel(a.$$timeoutId)): - !1};return f}]}function ta(a){Ca&&(X.setAttribute("href",a),a=X.href);X.setAttribute("href",a);return{href:X.href,protocol:X.protocol?X.protocol.replace(/:$/,""):"",host:X.host,search:X.search?X.search.replace(/^\?/,""):"",hash:X.hash?X.hash.replace(/^#/,""):"",hostname:X.hostname,port:X.port,pathname:"/"===X.pathname.charAt(0)?X.pathname:"/"+X.pathname}}function zd(a){a=E(a)?ta(a):a;return a.protocol===Od.protocol&&a.host===Od.host}function Yf(){this.$get=la(w)}function Pd(a){function b(a){try{return decodeURIComponent(a)}catch(b){return a}} - var d=a[0]||{},c={},e="";return function(){var a,g,h,k,l;try{a=d.cookie||""}catch(m){a=""}if(a!==e)for(e=a,a=e.split("; "),c={},h=0;h<a.length;h++)g=a[h],k=g.indexOf("="),0<k&&(l=b(g.substring(0,k)),x(c[l])&&(c[l]=b(g.substring(k+1))));return c}}function bg(){this.$get=Pd}function ed(a){function b(d,c){if(B(d)){var e={};r(d,function(a,c){e[c]=b(c,a)});return e}return a.factory(d+"Filter",c)}this.register=b;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];b("currency", - Qd);b("date",Rd);b("filter",Hg);b("json",Ig);b("limitTo",Jg);b("lowercase",Kg);b("number",Sd);b("orderBy",Td);b("uppercase",Lg)}function Hg(){return function(a,b,d,c){if(!wa(a)){if(null==a)return a;throw K("filter")("notarray",a);}c=c||"$";var e;switch(Cc(b)){case "function":break;case "boolean":case "null":case "number":case "string":e=!0;case "object":b=Mg(b,d,c,e);break;default:return a}return Array.prototype.filter.call(a,b)}}function Mg(a,b,d,c){var e=B(a)&&d in a;!0===b?b=sa:C(b)||(b=function(a, - b){if(x(a))return!1;if(null===a||null===b)return a===b;if(B(b)||B(a)&&!ac(a))return!1;a=L(""+a);b=L(""+b);return-1!==a.indexOf(b)});return function(f){return e&&!B(f)?ha(f,a[d],b,d,!1):ha(f,a,b,d,c)}}function ha(a,b,d,c,e,f){var g=Cc(a),h=Cc(b);if("string"===h&&"!"===b.charAt(0))return!ha(a,b.substring(1),d,c,e);if(I(a))return a.some(function(a){return ha(a,b,d,c,e)});switch(g){case "object":var k;if(e){for(k in a)if(k.charAt&&"$"!==k.charAt(0)&&ha(a[k],b,d,c,!0))return!0;return f?!1:ha(a,b,d,c,!1)}if("object"=== - h){for(k in b)if(f=b[k],!C(f)&&!x(f)&&(g=k===c,!ha(g?a:a[k],f,d,c,g,g)))return!1;return!0}return d(a,b);case "function":return!1;default:return d(a,b)}}function Cc(a){return null===a?"null":typeof a}function Qd(a){var b=a.NUMBER_FORMATS;return function(a,c,e){x(c)&&(c=b.CURRENCY_SYM);x(e)&&(e=b.PATTERNS[1].maxFrac);var f=c?/\u00A4/g:/\s*\u00A4\s*/g;return null==a?a:Ud(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,e).replace(f,c)}}function Sd(a){var b=a.NUMBER_FORMATS;return function(a,c){return null== - a?a:Ud(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function Ng(a){var b=0,d,c,e,f,g;-1<(c=a.indexOf(Vd))&&(a=a.replace(Vd,""));0<(e=a.search(/e/i))?(0>c&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)===Dc;e++);if(e===(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)===Dc;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Wd&&(d=d.splice(0,Wd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function Og(a,b,d,c){var e=a.d,f=e.length-a.i;b=x(b)?Math.min(Math.max(d,f),c):+b;d= - b+a.i;c=e[d];if(0<d){e.splice(Math.max(a.i,d));for(var g=d;g<e.length;g++)e[g]=0}else for(f=Math.max(0,f),a.i=1,e.length=Math.max(1,d=b+1),e[0]=0,g=1;g<d;g++)e[g]=0;if(5<=c)if(0>d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++;for(;f<Math.max(0,b);f++)e.push(0);if(b=e.reduceRight(function(a,b,c,d){b+=a;d[c]=b%10;return Math.floor(b/10)},0))e.unshift(b),a.i++}function Ud(a,b,d,c,e){if(!E(a)&&!Y(a)||isNaN(a))return"";var f=!isFinite(a),g=!1,h=Math.abs(a)+"",k="";if(f)k="\u221e"; - else{g=Ng(h);Og(g,e,b.minFrac,b.maxFrac);k=g.d;h=g.i;e=g.e;f=[];for(g=k.reduce(function(a,b){return a&&!b},!0);0>h;)k.unshift(0),h++;0<h?f=k.splice(h,k.length):(f=k,k=[0]);h=[];for(k.length>=b.lgSize&&h.unshift(k.splice(-b.lgSize,k.length).join(""));k.length>b.gSize;)h.unshift(k.splice(-b.gSize,k.length).join(""));k.length&&h.unshift(k.join(""));k=h.join(d);f.length&&(k+=c+f.join(""));e&&(k+="e+"+e)}return 0>a&&!g?b.negPre+k+b.negSuf:b.posPre+k+b.posSuf}function Ob(a,b,d,c){var e="";if(0>a||c&&0>= - a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length<b;)a=Dc+a;d&&(a=a.substr(a.length-b));return e+a}function ea(a,b,d,c,e){d=d||0;return function(f){f=f["get"+a]();if(0<d||f>-d)f+=d;0===f&&-12===d&&(f=12);return Ob(f,b,c,e)}}function mb(a,b,d){return function(c,e){var f=c["get"+a](),g=ub((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Xd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Yd(a){return function(b){var d=Xd(b.getFullYear());b=+new Date(b.getFullYear(), - b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Ob(b,a)}}function Ec(a,b){return 0>=a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function Rd(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=Z(b[9]+b[10]),g=Z(b[9]+b[11]));h.call(a,Z(b[1]),Z(b[2])-1,Z(b[3]));f=Z(b[4]||0)-f;g=Z(b[5]||0)-g;h=Z(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));k.call(a,f,g,h,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; - return function(c,d,f){var g="",h=[],k,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;E(c)&&(c=Pg.test(c)?Z(c):b(c));Y(c)&&(c=new Date(c));if(!fa(c)||!isFinite(c.getTime()))return c;for(;d;)(l=Qg.exec(d))?(h=db(h,l,1),d=h.pop()):(h.push(d),d=null);var m=c.getTimezoneOffset();f&&(m=Sc(f,m),c=dc(c,f,!0));r(h,function(b){k=Rg[b];g+=k?k(c,a.DATETIME_FORMATS,m):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function Ig(){return function(a,b){x(b)&&(b=2);return eb(a,b)}}function Jg(){return function(a, - b,d){b=Infinity===Math.abs(Number(b))?Number(b):Z(b);if(U(b))return a;Y(a)&&(a=a.toString());if(!wa(a))return a;d=!d||isNaN(d)?0:Z(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?Fc(a,d,d+b):0===d?Fc(a,b,a.length):Fc(a,Math.max(0,d+b),d)}}function Fc(a,b,d){return E(a)?a.slice(b,d):xa.call(a,b,d)}function Td(a){function b(b){return b.map(function(b){var c=1,d=ab;if(C(b))d=b;else if(E(b)){if("+"===b.charAt(0)||"-"===b.charAt(0))c="-"===b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(d=a(b),d.constant))var e= - d(),d=function(a){return a[e]}}return{get:d,descending:c}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}function c(a,b){var c=0,d=a.type,k=b.type;if(d===k){var k=a.value,l=b.value;"string"===d?(k=k.toLowerCase(),l=l.toLowerCase()):"object"===d&&(B(k)&&(k=a.index),B(l)&&(l=b.index));k!==l&&(c=k<l?-1:1)}else c=d<k?-1:1;return c}return function(a,f,g,h){if(null==a)return a;if(!wa(a))throw K("orderBy")("notarray",a);I(f)||(f=[f]);0===f.length&& - (f=["+"]);var k=b(f),l=g?-1:1,m=C(h)?h:c;a=Array.prototype.map.call(a,function(a,b){return{value:a,tieBreaker:{value:b,type:"number",index:b},predicateValues:k.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="string",e="null";else if("object"===c)a:{if(C(e.valueOf)&&(e=e.valueOf(),d(e)))break a;ac(e)&&(e=e.toString(),d(e))}return{value:e,type:c,index:b}})}});a.sort(function(a,b){for(var d=0,e=k.length;d<e;d++){var g=m(a.predicateValues[d],b.predicateValues[d]);if(g)return g*k[d].descending* - l}return(m(a.tieBreaker,b.tieBreaker)||c(a.tieBreaker,b.tieBreaker))*l});return a=a.map(function(a){return a.value})}}function Qa(a){C(a)&&(a={link:a});a.restrict=a.restrict||"AC";return la(a)}function Pb(a,b,d,c,e){this.$$controls=[];this.$error={};this.$$success={};this.$pending=void 0;this.$name=e(b.name||b.ngForm||"")(d);this.$dirty=!1;this.$valid=this.$pristine=!0;this.$submitted=this.$invalid=!1;this.$$parentForm=Qb;this.$$element=a;this.$$animate=c;Zd(this)}function Zd(a){a.$$classCache={}; - a.$$classCache[$d]=!(a.$$classCache[nb]=a.$$element.hasClass(nb))}function ae(a){function b(a,b,c){c&&!a.$$classCache[b]?(a.$$animate.addClass(a.$$element,b),a.$$classCache[b]=!0):!c&&a.$$classCache[b]&&(a.$$animate.removeClass(a.$$element,b),a.$$classCache[b]=!1)}function d(a,c,d){c=c?"-"+Vc(c,"-"):"";b(a,nb+c,!0===d);b(a,$d+c,!1===d)}var c=a.set,e=a.unset;a.clazz.prototype.$setValidity=function(a,g,h){x(g)?(this.$pending||(this.$pending={}),c(this.$pending,a,h)):(this.$pending&&e(this.$pending, - a,h),be(this.$pending)&&(this.$pending=void 0));Na(g)?g?(e(this.$error,a,h),c(this.$$success,a,h)):(c(this.$error,a,h),e(this.$$success,a,h)):(e(this.$error,a,h),e(this.$$success,a,h));this.$pending?(b(this,"ng-pending",!0),this.$valid=this.$invalid=void 0,d(this,"",null)):(b(this,"ng-pending",!1),this.$valid=be(this.$error),this.$invalid=!this.$valid,d(this,"",this.$valid));g=this.$pending&&this.$pending[a]?void 0:this.$error[a]?!1:this.$$success[a]?!0:null;d(this,a,g);this.$$parentForm.$setValidity(a, - g,this)}}function be(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function Gc(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function Va(a,b,d,c,e,f){var g=L(b[0].type);if(!e.android){var h=!1;b.on("compositionstart",function(){h=!0});b.on("compositionend",function(){h=!1;l()})}var k,l=function(a){k&&(f.defer.cancel(k),k=null);if(!h){var e=b.val();a=a&&a.type;"password"===g||d.ngTrim&&"false"===d.ngTrim||(e=Q(e));(c.$viewValue!==e||""===e&&c.$$hasNativeValidators)&& - c.$setViewValue(e,a)}};if(e.hasEvent("input"))b.on("input",l);else{var m=function(a,b,c){k||(k=f.defer(function(){k=null;b&&b.value===c||l(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||m(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut drop",m)}b.on("change",l);if(ce[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!k){var b=this.validity,c=b.badInput,d=b.typeMismatch;k=f.defer(function(){k=null;b.badInput===c&& - b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Rb(a,b){return function(d,c){var e,f;if(fa(d))return d;if(E(d)){'"'===d.charAt(0)&&'"'===d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));if(Sg.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970, - MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},r(e,function(a,c){c<b.length&&(f[b[c]]=+a)}),new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function ob(a,b,d,c){return function(e,f,g,h,k,l,m){function p(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function n(a){return u(a)&&!fa(a)?d(a)||void 0:a}Hc(e,f,g,h);Va(e,f,g,h,k,l);var r=h&&h.$options.getOption("timezone"),s;h.$$parserName=a;h.$parsers.push(function(a){if(h.$isEmpty(a))return null;if(b.test(a))return a=d(a,s),r&&(a=dc(a,r)), - a});h.$formatters.push(function(a){if(a&&!fa(a))throw pb("datefmt",a);if(p(a))return(s=a)&&r&&(s=dc(s,r,!0)),m("date")(a,c,r);s=null;return""});if(u(g.min)||g.ngMin){var q;h.$validators.min=function(a){return!p(a)||x(q)||d(a)>=q};g.$observe("min",function(a){q=n(a);h.$validate()})}if(u(g.max)||g.ngMax){var y;h.$validators.max=function(a){return!p(a)||x(y)||d(a)<=y};g.$observe("max",function(a){y=n(a);h.$validate()})}}}function Hc(a,b,d,c){(c.$$hasNativeValidators=B(b[0].validity))&&c.$parsers.push(function(a){var c= - b.prop("validity")||{};return c.badInput||c.typeMismatch?void 0:a})}function de(a){a.$$parserName="number";a.$parsers.push(function(b){if(a.$isEmpty(b))return null;if(Tg.test(b))return parseFloat(b)});a.$formatters.push(function(b){if(!a.$isEmpty(b)){if(!Y(b))throw pb("numfmt",b);b=b.toString()}return b})}function Wa(a){u(a)&&!Y(a)&&(a=parseFloat(a));return U(a)?void 0:a}function Ic(a){var b=a.toString(),d=b.indexOf(".");return-1===d?-1<a&&1>a&&(a=/e-(\d+)$/.exec(b))?Number(a[1]):0:b.length-d-1}function ee(a, - b,d){a=Number(a);var c=(a|0)!==a,e=(b|0)!==b,f=(d|0)!==d;if(c||e||f){var g=c?Ic(a):0,h=e?Ic(b):0,k=f?Ic(d):0,g=Math.max(g,h,k),g=Math.pow(10,g);a*=g;b*=g;d*=g;c&&(a=Math.round(a));e&&(b=Math.round(b));f&&(d=Math.round(d))}return 0===(a-b)%d}function fe(a,b,d,c,e){if(u(c)){a=a(c);if(!a.constant)throw pb("constexpr",d,c);return a(b)}return e}function Jc(a,b){function d(a,b){if(!a||!a.length)return[];if(!b||!b.length)return a;var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],f=0;f<b.length;f++)if(e=== - b[f])continue a;c.push(e)}return c}function c(a){var b=a;I(a)?b=a.map(c).join(" "):B(a)&&(b=Object.keys(a).filter(function(b){return a[b]}).join(" "));return b}function e(a){var b=a;if(I(a))b=a.map(e);else if(B(a)){var c=!1,b=Object.keys(a).filter(function(b){b=a[b];!c&&x(b)&&(c=!0);return b});c&&b.push(void 0)}return b}a="ngClass"+a;var f;return["$parse",function(g){return{restrict:"AC",link:function(h,k,l){function m(a,b){var c=[];r(a,function(a){if(0<b||t[a])t[a]=(t[a]||0)+b,t[a]===+(0<b)&&c.push(a)}); - return c.join(" ")}function p(a){if(a===b){var c=w,c=m(c&&c.split(" "),1);l.$addClass(c)}else c=w,c=m(c&&c.split(" "),-1),l.$removeClass(c);u=a}function n(a){a=c(a);a!==w&&q(a)}function q(a){if(u===b){var c=w&&w.split(" "),e=a&&a.split(" "),g=d(c,e),c=d(e,c),g=m(g,-1),c=m(c,1);l.$addClass(c);l.$removeClass(g)}w=a}var s=l[a].trim(),v=":"===s.charAt(0)&&":"===s.charAt(1),s=g(s,v?e:c),y=v?n:q,t=k.data("$classCounts"),u=!0,w;t||(t=S(),k.data("$classCounts",t));"ngClass"!==a&&(f||(f=g("$index",function(a){return a& - 1})),h.$watch(f,p));h.$watch(s,y,v)}}}]}function Sb(a,b,d,c,e,f,g,h,k){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=void 0;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=void 0;this.$name=k(d.name||"",!1)(a);this.$$parentForm=Qb;this.$options=Tb;this.$$updateEvents=""; - this.$$updateEventHandler=this.$$updateEventHandler.bind(this);this.$$parsedNgModel=e(d.ngModel);this.$$parsedNgModelAssign=this.$$parsedNgModel.assign;this.$$ngModelGet=this.$$parsedNgModel;this.$$ngModelSet=this.$$parsedNgModelAssign;this.$$pendingDebounce=null;this.$$parserValid=void 0;this.$$currentValidationRunId=0;Object.defineProperty(this,"$$scope",{value:a});this.$$attr=d;this.$$element=c;this.$$animate=f;this.$$timeout=g;this.$$parse=e;this.$$q=h;this.$$exceptionHandler=b;Zd(this);Ug(this)} - function Ug(a){a.$$scope.$watch(function(b){b=a.$$ngModelGet(b);b===a.$modelValue||a.$modelValue!==a.$modelValue&&b!==b||a.$$setModelValue(b);return b})}function Kc(a){this.$$options=a}function ge(a,b){r(b,function(b,c){u(a[c])||(a[c]=b)})}function Ga(a,b){a.prop("selected",b);a.attr("selected",b)}var Mc={objectMaxDepth:5},Vg=/^\/(.+)\/([a-z]*)$/,ra=Object.prototype.hasOwnProperty,L=function(a){return E(a)?a.toLowerCase():a},ub=function(a){return E(a)?a.toUpperCase():a},Ca,z,ma,xa=[].slice,ug=[].splice, - Wg=[].push,ia=Object.prototype.toString,Pc=Object.getPrototypeOf,qa=K("ng"),$=w.angular||(w.angular={}),ic,qb=0;Ca=w.document.documentMode;var U=Number.isNaN||function(a){return a!==a};D.$inject=[];ab.$inject=[];var I=Array.isArray,se=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/,Q=function(a){return E(a)?a.trim():a},Md=function(a){return a.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Ja=function(){if(!u(Ja.rules)){var a=w.document.querySelector("[ng-csp]")|| - w.document.querySelector("[data-ng-csp]");if(a){var b=a.getAttribute("ng-csp")||a.getAttribute("data-ng-csp");Ja.rules={noUnsafeEval:!b||-1!==b.indexOf("no-unsafe-eval"),noInlineStyle:!b||-1!==b.indexOf("no-inline-style")}}else{a=Ja;try{new Function(""),b=!1}catch(d){b=!0}a.rules={noUnsafeEval:b,noInlineStyle:!1}}}return Ja.rules},rb=function(){if(u(rb.name_))return rb.name_;var a,b,d=Ha.length,c,e;for(b=0;b<d;++b)if(c=Ha[b],a=w.document.querySelector("["+c.replace(":","\\:")+"jq]")){e=a.getAttribute(c+ - "jq");break}return rb.name_=e},ue=/:/g,Ha=["ng-","data-ng-","ng:","x-ng-"],xe=function(a){var b=a.currentScript;if(!b)return!0;if(!(b instanceof w.HTMLScriptElement||b instanceof w.SVGScriptElement))return!1;b=b.attributes;return[b.getNamedItem("src"),b.getNamedItem("href"),b.getNamedItem("xlink:href")].every(function(b){if(!b)return!0;if(!b.value)return!1;var c=a.createElement("a");c.href=b.value;if(a.location.origin===c.origin)return!0;switch(c.protocol){case "http:":case "https:":case "ftp:":case "blob:":case "file:":case "data:":return!0; - default:return!1}})}(w.document),Ae=/[A-Z]/g,Wc=!1,Oa=3,Fe={full:"1.6.9",major:1,minor:6,dot:9,codeName:"fiery-basilisk"};V.expando="ng339";var ib=V.cache={},gg=1;V._data=function(a){return this.cache[a[this.expando]]||{}};var cg=/-([a-z])/g,Xg=/^-ms-/,Ab={mouseleave:"mouseout",mouseenter:"mouseover"},lc=K("jqLite"),fg=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,kc=/<|&#?\w+;/,dg=/<([\w:-]+)/,eg=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,aa={option:[1,'<select multiple="multiple">', - "</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};aa.optgroup=aa.option;aa.tbody=aa.tfoot=aa.colgroup=aa.caption=aa.thead;aa.th=aa.td;var lg=w.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)},Sa=V.prototype={ready:gd,toString:function(){var a=[];r(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"}, - eq:function(a){return 0<=a?z(this[a]):z(this[this.length+a])},length:0,push:Wg,sort:[].sort,splice:[].splice},Gb={};r("multiple selected checked disabled readOnly required open".split(" "),function(a){Gb[L(a)]=a});var ld={};r("input select option textarea button form details".split(" "),function(a){ld[a]=!0});var sd={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern",ngStep:"step"};r({data:pc,removeData:oc,hasData:function(a){for(var b in ib[a.ng339])return!0; - return!1},cleanData:function(a){for(var b=0,d=a.length;b<d;b++)oc(a[b])}},function(a,b){V[b]=a});r({data:pc,inheritedData:Eb,scope:function(a){return z.data(a,"$scope")||Eb(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return z.data(a,"$isolateScope")||z.data(a,"$isolateScopeNoTemplate")},controller:id,injector:function(a){return Eb(a,"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:Bb,css:function(a,b,d){b=xb(b.replace(Xg,"ms-"));if(u(d))a.style[b]=d; - else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Oa&&2!==c&&8!==c&&a.getAttribute){var c=L(b),e=Gb[c];if(u(d))null===d||!1===d&&e?a.removeAttribute(b):a.setAttribute(b,e?c:d);else return a=a.getAttribute(b),e&&null!==a&&(a=c),null===a?void 0:a}},prop:function(a,b,d){if(u(d))a[b]=d;else return a[b]},text:function(){function a(a,d){if(x(d)){var c=a.nodeType;return 1===c||c===Oa?a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(x(b)){if(a.multiple&&"select"=== - ya(a)){var d=[];r(a.options,function(a){a.selected&&d.push(a.value||a.text)});return d}return a.value}a.value=b},html:function(a,b){if(x(b))return a.innerHTML;yb(a,!0);a.innerHTML=b},empty:jd},function(a,b){V.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==jd&&x(2===a.length&&a!==Bb&&a!==id?b:c)){if(B(b)){for(e=0;e<g;e++)if(a===pc)a(this[e],b);else for(f in b)a(this[e],f,b[f]);return this}e=a.$dv;g=x(e)?Math.min(g,1):g;for(f=0;f<g;f++){var h=a(this[f],b,c);e=e?e+h:h}return e}for(e=0;e<g;e++)a(this[e], - b,c);return this}});r({removeData:oc,on:function(a,b,d,c){if(u(c))throw lc("onargs");if(jc(a)){c=zb(a,!0);var e=c.events,f=c.handle;f||(f=c.handle=ig(a,e));c=0<=b.indexOf(" ")?b.split(" "):[b];for(var g=c.length,h=function(b,c,g){var h=e[b];h||(h=e[b]=[],h.specialHandlerWrapper=c,"$destroy"===b||g||a.addEventListener(b,f));h.push(d)};g--;)b=c[g],Ab[b]?(h(Ab[b],kg),h(b,void 0,!0)):h(b)}},off:hd,one:function(a,b,d){a=z(a);a.on(b,function e(){a.off(b,d);a.off(b,e)});a.on(b,d)},replaceWith:function(a, - b){var d,c=a.parentNode;yb(a);r(new V(b),function(b){d?c.insertBefore(b,d.nextSibling):c.replaceChild(b,a);d=b})},children:function(a){var b=[];r(a.childNodes,function(a){1===a.nodeType&&b.push(a)});return b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,b){var d=a.nodeType;if(1===d||11===d){b=new V(b);for(var d=0,c=b.length;d<c;d++)a.appendChild(b[d])}},prepend:function(a,b){if(1===a.nodeType){var d=a.firstChild;r(new V(b),function(b){a.insertBefore(b,d)})}}, - wrap:function(a,b){var d=z(b).eq(0).clone()[0],c=a.parentNode;c&&c.replaceChild(d,a);d.appendChild(a)},remove:Fb,detach:function(a){Fb(a,!0)},after:function(a,b){var d=a,c=a.parentNode;if(c){b=new V(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];c.insertBefore(g,d.nextSibling);d=g}}},addClass:Db,removeClass:Cb,toggleClass:function(a,b,d){b&&r(b.split(" "),function(b){var e=d;x(e)&&(e=!Bb(a,b));(e?Db:Cb)(a,b)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling}, - find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:nc,triggerHandler:function(a,b,d){var c,e,f=b.type||b,g=zb(a);if(g=(g=g&&g.events)&&g[f])c={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:D,type:f,target:a},b.type&&(c=O(c, - b)),b=ka(g),e=d?[c].concat(d):[c],r(b,function(b){c.isImmediatePropagationStopped()||b.apply(a,e)})}},function(a,b){V.prototype[b]=function(b,c,e){for(var f,g=0,h=this.length;g<h;g++)x(f)?(f=a(this[g],b,c,e),u(f)&&(f=z(f))):mc(f,a(this[g],b,c,e));return u(f)?f:this}});V.prototype.bind=V.prototype.on;V.prototype.unbind=V.prototype.off;var Yg=Object.create(null);md.prototype={_idx:function(a){if(a===this._lastKey)return this._lastIndex;this._lastKey=a;return this._lastIndex=this._keys.indexOf(a)},_transformKey:function(a){return U(a)? - Yg:a},get:function(a){a=this._transformKey(a);a=this._idx(a);if(-1!==a)return this._values[a]},set:function(a,b){a=this._transformKey(a);var d=this._idx(a);-1===d&&(d=this._lastIndex=this._keys.length);this._keys[d]=a;this._values[d]=b},delete:function(a){a=this._transformKey(a);a=this._idx(a);if(-1===a)return!1;this._keys.splice(a,1);this._values.splice(a,1);this._lastKey=NaN;this._lastIndex=-1;return!0}};var Hb=md,ag=[function(){this.$get=[function(){return Hb}]}],ng=/^([^(]+?)=>/,og=/^[^(]*\(\s*([^)]*)\)/m, - Zg=/,/,$g=/^\s*(_?)(\S+?)\1\s*$/,mg=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ba=K("$injector");gb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw E(d)&&d||(d=a.name||pg(a)),Ba("strictdi",d);b=nd(a);r(b[1].split(Zg),function(a){a.replace($g,function(a,b,d){c.push(d)})})}a.$inject=c}}else I(a)?(b=a.length-1,sb(a[b],"fn"),c=a.slice(0,b)):sb(a,"fn",!0);return c};var he=K("$animate"),sf=function(){this.$get=D},tf=function(){var a=new Hb,b=[];this.$get= - ["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=E(b)?b.split(" "):I(b)?b:[],r(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){r(b,function(b){var c=a.get(b);if(c){var d=qg(b.attr("class")),e="",f="";r(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});r(b,function(a){e&&Db(a,e);f&&Cb(a,f)});a.delete(b)}});b.length=0}return{enabled:D,on:D,off:D,pin:D,push:function(g,h,k,l){l&&l();k=k||{};k.from&&g.css(k.from);k.to&&g.css(k.to);if(k.addClass|| - k.removeClass)if(h=k.addClass,l=k.removeClass,k=a.get(g)||{},h=e(k,h,!0),l=e(k,l,!1),h||l)a.set(g,k),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},qf=["$provide",function(a){var b=this,d=null,c=null;this.$$registeredAnimations=Object.create(null);this.register=function(c,d){if(c&&"."!==c.charAt(0))throw he("notcsel",c);var g=c+"-animation";b.$$registeredAnimations[c.substr(1)]=g;a.factory(g,d)};this.customFilter=function(a){1===arguments.length&&(c=C(a)?a:null);return c}; - this.classNameFilter=function(a){if(1===arguments.length&&(d=a instanceof RegExp?a:null)&&/[(\s|\/)]ng-animate[(\s|\/)]/.test(d.toString()))throw d=null,he("nongcls","ng-animate");return d};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var e;a:{for(e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){e=f;break a}}e=void 0}!e||e.parentNode||e.previousElementSibling||(d=null)}d?d.after(a):c.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.end&&a.end()}, - enter:function(c,d,k,l){d=d&&z(d);k=k&&z(k);d=d||k.parent();b(c,d,k);return a.push(c,"enter",Ka(l))},move:function(c,d,k,l){d=d&&z(d);k=k&&z(k);d=d||k.parent();b(c,d,k);return a.push(c,"move",Ka(l))},leave:function(b,c){return a.push(b,"leave",Ka(c),function(){b.remove()})},addClass:function(b,c,d){d=Ka(d);d.addClass=jb(d.addclass,c);return a.push(b,"addClass",d)},removeClass:function(b,c,d){d=Ka(d);d.removeClass=jb(d.removeClass,c);return a.push(b,"removeClass",d)},setClass:function(b,c,d,f){f=Ka(f); - f.addClass=jb(f.addClass,c);f.removeClass=jb(f.removeClass,d);return a.push(b,"setClass",f)},animate:function(b,c,d,f,m){m=Ka(m);m.from=m.from?O(m.from,c):c;m.to=m.to?O(m.to,d):d;m.tempClasses=jb(m.tempClasses,f||"ng-inline-animate");return a.push(b,"animate",m)}}}]}],vf=function(){this.$get=["$$rAF",function(a){function b(b){d.push(b);1<d.length||a(function(){for(var a=0;a<d.length;a++)d[a]();d=[]})}var d=[];return function(){var a=!1;b(function(){a=!0});return function(d){a?d():b(d)}}}]},uf=function(){this.$get= - ["$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout",function(a,b,d,c,e){function f(a){this.setHost(a);var b=d();this._doneCallbacks=[];this._tick=function(a){c()?e(a,0,!1):b(a)};this._state=0}f.chain=function(a,b){function c(){if(d===a.length)b(!0);else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};f.all=function(a,b){function c(f){e=e&&f;++d===a.length&&b(e)}var d=0,e=!0;r(a,function(a){a.done(c)})};f.prototype={setHost:function(a){this.host=a||{}},done:function(a){2=== - this._state?a():this._doneCallbacks.push(a)},progress:D,getPromise:function(){if(!this.promise){var b=this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},"finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&& - this.host.end();this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(r(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=0,this._state=2)}};return f}]},rf=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,d){return function(b,e){function f(){a(function(){g.addClass&&(b.addClass(g.addClass),g.addClass= - null);g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null);g.to&&(b.css(g.to),g.to=null);h||k.complete();h=!0});return k}var g=e||{};g.$$prepared||(g=pa(g));g.cleanupStyles&&(g.from=g.to=null);g.from&&(b.css(g.from),g.from=null);var h,k=new d;return{start:f,end:f}}}]},ca=K("$compile"),sc=new function(){};Yc.$inject=["$provide","$$sanitizeUriProvider"];Jb.prototype.isFirstChange=function(){return this.previousValue===sc};var od=/^((?:x|data)[:\-_])/i,tg=/[:\-_]+(.)/g,ud=K("$controller"), - td=/^(\S+)(\s+as\s+([\w$]+))?$/,Cf=function(){this.$get=["$document",function(a){return function(b){b?!b.nodeType&&b instanceof z&&(b=b[0]):b=a[0].body;return b.offsetWidth+1}}]},vd="application/json",vc={"Content-Type":vd+";charset=utf-8"},wg=/^\[|^\{(?!\{)/,xg={"[":/]$/,"{":/}$/},vg=/^\)]\}',?\n/,Kb=K("$http"),Fa=$.$interpolateMinErr=K("$interpolate");Fa.throwNoconcat=function(a){throw Fa("noconcat",a);};Fa.interr=function(a,b){return Fa("interr",a,b.toString())};var Kf=function(){this.$get=function(){function a(a){var b= - function(a){b.data=a;b.called=!0};b.id=a;return b}var b=$.callbacks,d={};return{createCallback:function(c){c="_"+(b.$$counter++).toString(36);var e="angular.callbacks."+c,f=a(c);d[e]=b[c]=f;return e},wasCalled:function(a){return d[a].called},getResponse:function(a){return d[a].data},removeCallback:function(a){delete b[d[a].id];delete d[a]}}}},ah=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,zg={http:80,https:443,ftp:21},kb=K("$location"),Ag=/^\s*[\\/]{2,}/,bh={$$absUrl:"",$$html5:!1,$$replace:!1,absUrl:Lb("$$absUrl"), - url:function(a){if(x(a))return this.$$url;var b=ah.exec(a);(b[1]||""===a)&&this.path(decodeURIComponent(b[1]));(b[2]||b[1]||""===a)&&this.search(b[3]||"");this.hash(b[5]||"");return this},protocol:Lb("$$protocol"),host:Lb("$$host"),port:Lb("$$port"),path:Dd("$$path",function(a){a=null!==a?a.toString():"";return"/"===a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(E(a)||Y(a))a=a.toString(),this.$$search=ec(a);else if(B(a))a=pa(a,{}),r(a,function(b, - c){null==b&&delete a[c]}),this.$$search=a;else throw kb("isrcharg");break;default:x(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}this.$$compose();return this},hash:Dd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};r([Cd,zc,yc],function(a){a.prototype=Object.create(bh);a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==yc||!this.$$html5)throw kb("nostate");this.$$state=x(b)?null:b;this.$$urlUpdatedByLocation= - !0;return this}});var Xa=K("$parse"),Eg={}.constructor.prototype.valueOf,Ub=S();r("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Ub[a]=!0});var ch={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Nb=function(a){this.options=a};Nb.prototype={constructor:Nb,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber(); - else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var b=a+this.peek(),d=b+this.peek(2),c=Ub[b],e=Ub[d];Ub[a]||c||e?(a=e?d:c?b:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){a= - a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue? - this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"=== - a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=u(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw Xa("lexerr",a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index<this.text.length;){var d=L(this.text.charAt(this.index));if("."===d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"===d&&this.isExpOperator(c))a+=d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"===a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)|| - c&&this.isNumber(c)||"e"!==a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++; - for(var d="",c=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index),c=c+f;if(e)"u"===f?(e=this.text.substring(this.index+1,this.index+5),e.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+e+"]"),this.index+=4,d+=String.fromCharCode(parseInt(e,16))):d+=ch[f]||f,e=!1;else if("\\"===f)e=!0;else{if(f===a){this.index++;this.tokens.push({index:b,text:c,constant:!0,value:d});return}d+=f}this.index++}this.throwError("Unterminated quote",b)}};var q=function(a,b){this.lexer= - a;this.options=b};q.Program="Program";q.ExpressionStatement="ExpressionStatement";q.AssignmentExpression="AssignmentExpression";q.ConditionalExpression="ConditionalExpression";q.LogicalExpression="LogicalExpression";q.BinaryExpression="BinaryExpression";q.UnaryExpression="UnaryExpression";q.CallExpression="CallExpression";q.MemberExpression="MemberExpression";q.Identifier="Identifier";q.Literal="Literal";q.ArrayExpression="ArrayExpression";q.Property="Property";q.ObjectExpression="ObjectExpression"; - q.ThisExpression="ThisExpression";q.LocalsExpression="LocalsExpression";q.NGValueParameter="NGValueParameter";q.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:q.Program,body:a}},expressionStatement:function(){return{type:q.ExpressionStatement, - expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary();if(this.expect("=")){if(!Hd(a))throw Xa("lval");a={type:q.AssignmentExpression,left:a,right:this.assignment(),operator:"="}}return a},ternary:function(){var a=this.logicalOR(),b,d;return this.expect("?")&&(b=this.expression(),this.consume(":"))?(d=this.expression(),{type:q.ConditionalExpression, - test:a,alternate:b,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:q.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=this.equality();this.expect("&&");)a={type:q.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),b;b=this.expect("==","!=","===","!==");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.relational()}; - return a},relational:function(){for(var a=this.additive(),b;b=this.expect("<",">","<=",">=");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),b;b=this.expect("+","-");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a}, - unary:function(){var a;return(a=this.expect("+","-","!"))?{type:q.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=pa(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:q.Literal,value:this.options.literals[this.consume().text]}: - this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:q.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:q.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:q.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE"); - return a},filter:function(a){a=[a];for(var b={type:q.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.filterChain());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:q.Identifier,name:a.text}},constant:function(){return{type:q.Literal,value:this.consume().value}}, - arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:q.ArrayExpression,elements:a}},object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;b={type:q.Property,kind:"init"};this.peek().constant?(b.key=this.constant(),b.computed=!1,this.consume(":"),b.value=this.expression()):this.peek().identifier?(b.key=this.identifier(),b.computed=!1,this.peek(":")? - (this.consume(":"),b.value=this.expression()):b.value=b.key):this.peek("[")?(this.consume("["),b.key=this.expression(),this.consume("]"),b.computed=!0,this.consume(":"),b.value=this.expression()):this.throwError("invalid key",this.peek());a.push(b)}while(this.expect(","))}this.consume("}");return{type:q.ObjectExpression,properties:a}},throwError:function(a,b){throw Xa("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===this.tokens.length)throw Xa("ueoe", - this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw Xa("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?(this.tokens.shift(),a):!1},selfReferential:{"this":{type:q.ThisExpression}, - $locals:{type:q.LocalsExpression}}};var Fd=2;Jd.prototype={compile:function(a){var b=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};W(a,b.$filter);var d="",c;this.stage="assign";if(c=Id(a))this.state.computing="assign",d=this.nextId(),this.recurse(c,d),this.return_(d),d="fn.assign="+this.generateFunction("assign","s,v,l");c=Gd(a.body);b.stage="inputs";r(c,function(a,c){var d="fn"+c;b.state[d]={vars:[],body:[],own:{}};b.state.computing=d; - var h=b.nextId();b.recurse(a,h);b.return_(h);b.state.inputs.push({name:d,isPure:a.isPure});a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(a);a='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+d+this.watchFns()+"return fn;";a=(new Function("$filter","getStringValue","ifDefined","plus",a))(this.$filter,Bg,Cg,Ed);this.state=this.stage=void 0;return a},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs, - d=this;r(b,function(b){a.push("var "+b.name+"="+d.generateFunction(b.name,"s"));b.isPure&&a.push(b.name,".isPure="+JSON.stringify(b.isPure)+";")});b.length&&a.push("fn.inputs=["+b.map(function(a){return a.name}).join(",")+"];");return a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;r(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length? - "var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,h,k=this,l,m,p;c=c||D;if(!f&&u(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case q.Program:r(a.body,function(b,c){k.recurse(b.expression,void 0,void 0,function(a){h=a});c!==a.body.length-1?k.current().body.push(h,";"):k.return_(h)});break;case q.Literal:m=this.escape(a.value); - this.assign(b,m);c(b||m);break;case q.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){h=a});m=a.operator+"("+this.ifDefined(h,0)+")";this.assign(b,m);c(m);break;case q.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){h=a});m="+"===a.operator?this.plus(g,h):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(h,0):"("+g+")"+a.operator+"("+h+")";this.assign(b,m);c(m);break;case q.LogicalExpression:b=b||this.nextId(); - k.recurse(a.left,b);k.if_("&&"===a.operator?b:k.not(b),k.lazyRecurse(a.right,b));c(b);break;case q.ConditionalExpression:b=b||this.nextId();k.recurse(a.test,b);k.if_(b,k.lazyRecurse(a.alternate,b),k.lazyRecurse(a.consequent,b));c(b);break;case q.Identifier:b=b||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"=== - k.stage||"s",function(){e&&1!==e&&k.if_(k.isNull(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(b,k.nonComputedMember("s",a.name))})},b&&k.lazyAssign(b,k.nonComputedMember("l",a.name)));c(b);break;case q.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId();b=b||this.nextId();k.recurse(a.object,g,void 0,function(){k.if_(k.notNull(g),function(){a.computed?(h=k.nextId(),k.recurse(a.property,h),k.getStringValue(h),e&&1!==e&&k.if_(k.not(k.computedMember(g, - h)),k.lazyAssign(k.computedMember(g,h),"{}")),m=k.computedMember(g,h),k.assign(b,m),d&&(d.computed=!0,d.name=h)):(e&&1!==e&&k.if_(k.isNull(k.nonComputedMember(g,a.property.name)),k.lazyAssign(k.nonComputedMember(g,a.property.name),"{}")),m=k.nonComputedMember(g,a.property.name),k.assign(b,m),d&&(d.computed=!1,d.name=a.property.name))},function(){k.assign(b,"undefined")});c(b)},!!e);break;case q.CallExpression:b=b||this.nextId();a.filter?(h=k.filter(a.callee.name),l=[],r(a.arguments,function(a){var b= - k.nextId();k.recurse(a,b);l.push(b)}),m=h+"("+l.join(",")+")",k.assign(b,m),c(b)):(h=k.nextId(),g={},l=[],k.recurse(a.callee,h,g,function(){k.if_(k.notNull(h),function(){r(a.arguments,function(b){k.recurse(b,a.constant?void 0:k.nextId(),void 0,function(a){l.push(a)})});m=g.name?k.member(g.context,g.name,g.computed)+"("+l.join(",")+")":h+"("+l.join(",")+")";k.assign(b,m)},function(){k.assign(b,"undefined")});c(b)}));break;case q.AssignmentExpression:h=this.nextId();g={};this.recurse(a.left,void 0, - g,function(){k.if_(k.notNull(g.context),function(){k.recurse(a.right,h);m=k.member(g.context,g.name,g.computed)+a.operator+h;k.assign(b,m);c(b||m)})},1);break;case q.ArrayExpression:l=[];r(a.elements,function(b){k.recurse(b,a.constant?void 0:k.nextId(),void 0,function(a){l.push(a)})});m="["+l.join(",")+"]";this.assign(b,m);c(b||m);break;case q.ObjectExpression:l=[];p=!1;r(a.properties,function(a){a.computed&&(p=!0)});p?(b=b||this.nextId(),this.assign(b,"{}"),r(a.properties,function(a){a.computed? - (g=k.nextId(),k.recurse(a.key,g)):g=a.key.type===q.Identifier?a.key.name:""+a.key.value;h=k.nextId();k.recurse(a.value,h);k.assign(k.member(b,g,a.computed),h)})):(r(a.properties,function(b){k.recurse(b.value,a.constant?void 0:k.nextId(),void 0,function(a){l.push(k.escape(b.key.type===q.Identifier?b.key.name:""+b.key.value)+":"+a)})}),m="{"+l.join(",")+"}",this.assign(b,m));c(b||m);break;case q.ThisExpression:this.assign(b,"s");c(b||"s");break;case q.LocalsExpression:this.assign(b,"l");c(b||"l");break; - case q.NGValueParameter:this.assign(b,"v"),c(b||"v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a, - b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},isNull:function(a){return a+"==null"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){var d=/[^$_a-zA-Z0-9]/g;return/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a, - b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},lazyRecurse:function(a,b,d,c,e,f){var g=this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(E(a))return"'"+a.replace(this.stringEscapeRegex, - this.stringEscapeFn)+"'";if(Y(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw Xa("esc");},nextId:function(a,b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};Kd.prototype={compile:function(a){var b=this;W(a,b.$filter);var d,c;if(d=Id(a))c=this.recurse(d);d=Gd(a.body);var e;d&&(e=[],r(d,function(a,c){var d= - b.recurse(a);d.isPure=a.isPure;a.input=d;e.push(d);a.watchId=c}));var f=[];r(a.body,function(a){f.push(b.recurse(a.expression))});a=0===a.body.length?D:1===a.body.length?f[0]:function(a,b){var c;r(f,function(d){c=d(a,b)});return c};c&&(a.assign=function(a,b,d){return c(a,d,b)});e&&(a.inputs=e);return a},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case q.Literal:return this.value(a.value,b);case q.UnaryExpression:return e=this.recurse(a.argument), - this["unary"+a.operator](e,b);case q.BinaryExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case q.Identifier:return f.identifier(a.name,b,d);case q.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed|| - (e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d):this.nonComputedMember(c,e,b,d);case q.CallExpression:return g=[],r(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var p=[],n=0;n<g.length;++n)p.push(g[n](a,c,d,f));a=e.apply(void 0,p,f);return b?{context:void 0,name:void 0,value:a}:a}:function(a,c,d,f){var p=e(a,c,d,f),n;if(null!=p.value){n= - [];for(var r=0;r<g.length;++r)n.push(g[r](a,c,d,f));n=p.value.apply(p.context,n)}return b?{value:n}:n};case q.AssignmentExpression:return c=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,d,f,g){var p=c(a,d,f,g);a=e(a,d,f,g);p.context[p.name]=a;return b?{value:a}:a};case q.ArrayExpression:return g=[],r(a.elements,function(a){g.push(f.recurse(a))}),function(a,c,d,e){for(var f=[],n=0;n<g.length;++n)f.push(g[n](a,c,d,e));return b?{value:f}:f};case q.ObjectExpression:return g=[],r(a.properties, - function(a){a.computed?g.push({key:f.recurse(a.key),computed:!0,value:f.recurse(a.value)}):g.push({key:a.key.type===q.Identifier?a.key.name:""+a.key.value,computed:!1,value:f.recurse(a.value)})}),function(a,c,d,e){for(var f={},n=0;n<g.length;++n)g[n].computed?f[g[n].key(a,c,d,e)]=g[n].value(a,c,d,e):f[g[n].key]=g[n].value(a,c,d,e);return b?{value:f}:f};case q.ThisExpression:return function(a){return b?{value:a}:a};case q.LocalsExpression:return function(a,c){return b?{value:c}:c};case q.NGValueParameter:return function(a, - c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=u(d)?+d:0;return b?{value:d}:d}},"unary-":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=u(d)?-d:-0;return b?{value:d}:d}},"unary!":function(a,b){return function(d,c,e,f){d=!a(d,c,e,f);return b?{value:d}:d}},"binary+":function(a,b,d){return function(c,e,f,g){var h=a(c,e,f,g);c=b(c,e,f,g);h=Ed(h,c);return d?{value:h}:h}},"binary-":function(a,b,d){return function(c,e,f,g){var h=a(c,e,f,g);c=b(c,e,f,g); - h=(u(h)?h:0)-(u(c)?c:0);return d?{value:h}:h}},"binary*":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)*b(c,e,f,g);return d?{value:c}:c}},"binary/":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)/b(c,e,f,g);return d?{value:c}:c}},"binary%":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)%b(c,e,f,g);return d?{value:c}:c}},"binary===":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)===b(c,e,f,g);return d?{value:c}:c}},"binary!==":function(a,b,d){return function(c,e,f,g){c=a(c, - e,f,g)!==b(c,e,f,g);return d?{value:c}:c}},"binary==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)==b(c,e,f,g);return d?{value:c}:c}},"binary!=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!=b(c,e,f,g);return d?{value:c}:c}},"binary<":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<b(c,e,f,g);return d?{value:c}:c}},"binary>":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f, - g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,h){e=a(e,f,g,h)?b(e,f,g,h):d(e,f,g,h);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0, - name:void 0,value:a}:a}},identifier:function(a,b,d){return function(c,e,f,g){c=e&&a in e?e:c;d&&1!==d&&c&&null==c[a]&&(c[a]={});e=c?c[a]:void 0;return b?{context:c,name:a,value:e}:e}},computedMember:function(a,b,d,c){return function(e,f,g,h){var k=a(e,f,g,h),l,m;null!=k&&(l=b(e,f,g,h),l+="",c&&1!==c&&k&&!k[l]&&(k[l]={}),m=k[l]);return d?{context:k,name:l,value:m}:m}},nonComputedMember:function(a,b,d,c){return function(e,f,g,h){e=a(e,f,g,h);c&&1!==c&&e&&null==e[b]&&(e[b]={});f=null!=e?e[b]:void 0; - return d?{context:e,name:b,value:f}:f}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};Mb.prototype={constructor:Mb,parse:function(a){a=this.getAst(a);var b=this.astCompiler.compile(a.ast),d=a.ast;b.literal=0===d.body.length||1===d.body.length&&(d.body[0].expression.type===q.Literal||d.body[0].expression.type===q.ArrayExpression||d.body[0].expression.type===q.ObjectExpression);b.constant=a.ast.constant;b.oneTime=a.oneTime;return b},getAst:function(a){var b=!1;a=a.trim();":"=== - a.charAt(0)&&":"===a.charAt(1)&&(b=!0,a=a.substring(2));return{ast:this.ast.ast(a),oneTime:b}}};var va=K("$sce"),oa={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Bc=/_([a-z])/g,Gg=K("$compile"),X=w.document.createElement("a"),Od=ta(w.location.href);Pd.$inject=["$document"];ed.$inject=["$provide"];var Wd=22,Vd=".",Dc="0";Qd.$inject=["$locale"];Sd.$inject=["$locale"];var Rg={yyyy:ea("FullYear",4,0,!1,!0),yy:ea("FullYear",2,0,!0,!0),y:ea("FullYear",1,0,!1,!0),MMMM:mb("Month"), - MMM:mb("Month",!0),MM:ea("Month",2,1),M:ea("Month",1,1),LLLL:mb("Month",!1,!0),dd:ea("Date",2),d:ea("Date",1),HH:ea("Hours",2),H:ea("Hours",1),hh:ea("Hours",2,-12),h:ea("Hours",1,-12),mm:ea("Minutes",2),m:ea("Minutes",1),ss:ea("Seconds",2),s:ea("Seconds",1),sss:ea("Milliseconds",3),EEEE:mb("Day"),EEE:mb("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Ob(Math[0<a?"floor":"ceil"](a/60),2)+Ob(Math.abs(a%60),2))},ww:Yd(2),w:Yd(1), - G:Ec,GG:Ec,GGG:Ec,GGGG:function(a,b){return 0>=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},Qg=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,Pg=/^-?\d+$/;Rd.$inject=["$locale"];var Kg=la(L),Lg=la(ub);Td.$inject=["$parse"];var He=la({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===ia.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)|| - a.preventDefault()})}}}}),vb={};r(Gb,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!==a){var c=Ea("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)});vb[c]=function(){return{restrict:"A",priority:100,link:e}}}});r(sd,function(a,b){vb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"===e.ngPattern.charAt(0)&&(c=e.ngPattern.match(Vg))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b, - a)})}}}});r(["src","srcset","href"],function(a){var b=Ea("ng-"+a);vb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===ia.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null);e.$observe(b,function(b){b?(e.$set(g,b),Ca&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}});var Qb={$addControl:D,$$renameControl:function(a,b){a.$name=b},$removeControl:D,$setValidity:D,$setDirty:D,$setPristine:D,$setSubmitted:D};Pb.$inject=["$element", - "$attrs","$scope","$animate","$interpolate"];Pb.prototype={$rollbackViewValue:function(){r(this.$$controls,function(a){a.$rollbackViewValue()})},$commitViewValue:function(){r(this.$$controls,function(a){a.$commitViewValue()})},$addControl:function(a){Ia(a.$name,"input");this.$$controls.push(a);a.$name&&(this[a.$name]=a);a.$$parentForm=this},$$renameControl:function(a,b){var d=a.$name;this[d]===a&&delete this[d];this[b]=a;a.$name=b},$removeControl:function(a){a.$name&&this[a.$name]===a&&delete this[a.$name]; - r(this.$pending,function(b,d){this.$setValidity(d,null,a)},this);r(this.$error,function(b,d){this.$setValidity(d,null,a)},this);r(this.$$success,function(b,d){this.$setValidity(d,null,a)},this);cb(this.$$controls,a);a.$$parentForm=Qb},$setDirty:function(){this.$$animate.removeClass(this.$$element,Ya);this.$$animate.addClass(this.$$element,Vb);this.$dirty=!0;this.$pristine=!1;this.$$parentForm.$setDirty()},$setPristine:function(){this.$$animate.setClass(this.$$element,Ya,Vb+" ng-submitted");this.$dirty= - !1;this.$pristine=!0;this.$submitted=!1;r(this.$$controls,function(a){a.$setPristine()})},$setUntouched:function(){r(this.$$controls,function(a){a.$setUntouched()})},$setSubmitted:function(){this.$$animate.addClass(this.$$element,"ng-submitted");this.$submitted=!0;this.$$parentForm.$setSubmitted()}};ae({clazz:Pb,set:function(a,b,d){var c=a[b];c?-1===c.indexOf(d)&&c.push(d):a[b]=[d]},unset:function(a,b,d){var c=a[b];c&&(cb(c,d),0===c.length&&delete a[b])}});var ie=function(a){return["$timeout","$parse", - function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||D}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Pb,compile:function(d,f){d.addClass(Ya).addClass(nb);var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var p=f[0];if(!("action"in e)){var n=function(b){a.$apply(function(){p.$commitViewValue();p.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",n);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit", - n)},0,!1)})}(f[1]||p.$$parentForm).$addControl(p);var r=g?c(p.$name):D;g&&(r(a,p),e.$observe(g,function(b){p.$name!==b&&(r(a,void 0),p.$$parentForm.$$renameControl(p,b),r=c(p.$name),r(a,p))}));d.on("$destroy",function(){p.$$parentForm.$removeControl(p);r(a,void 0);O(p,Qb)})}}}}}]},Ie=ie(),Ue=ie(!0),Sg=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,dh=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i, - eh=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,Tg=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,je=/^(\d{4,})-(\d{2})-(\d{2})$/,ke=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Lc=/^(\d{4,})-W(\d\d)$/,le=/^(\d{4,})-(\d\d)$/,me=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,ce=S();r(["date","datetime-local","month","time","week"],function(a){ce[a]= - !0});var ne={text:function(a,b,d,c,e,f){Va(a,b,d,c,e,f);Gc(c)},date:ob("date",je,Rb(je,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":ob("datetimelocal",ke,Rb(ke,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:ob("time",me,Rb(me,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:ob("week",Lc,function(a,b){if(fa(a))return a;if(E(a)){Lc.lastIndex=0;var d=Lc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,h=0,k=Xd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),h=b.getMilliseconds()); - return new Date(c,0,k.getDate()+e,d,f,g,h)}}return NaN},"yyyy-Www"),month:ob("month",le,Rb(le,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){Hc(a,b,d,c);de(c);Va(a,b,d,c,e,f);var g,h;if(u(d.min)||d.ngMin)c.$validators.min=function(a){return c.$isEmpty(a)||x(g)||a>=g},d.$observe("min",function(a){g=Wa(a);c.$validate()});if(u(d.max)||d.ngMax)c.$validators.max=function(a){return c.$isEmpty(a)||x(h)||a<=h},d.$observe("max",function(a){h=Wa(a);c.$validate()});if(u(d.step)||d.ngStep){var k;c.$validators.step= - function(a,b){return c.$isEmpty(b)||x(k)||ee(b,g||0,k)};d.$observe("step",function(a){k=Wa(a);c.$validate()})}},url:function(a,b,d,c,e,f){Va(a,b,d,c,e,f);Gc(c);c.$$parserName="url";c.$validators.url=function(a,b){var d=a||b;return c.$isEmpty(d)||dh.test(d)}},email:function(a,b,d,c,e,f){Va(a,b,d,c,e,f);Gc(c);c.$$parserName="email";c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||eh.test(d)}},radio:function(a,b,d,c){var e=!d.ngTrim||"false"!==Q(d.ngTrim);x(d.name)&&b.attr("name",++qb); - b.on("click",function(a){var g;b[0].checked&&(g=d.value,e&&(g=Q(g)),c.$setViewValue(g,a&&a.type))});c.$render=function(){var a=d.value;e&&(a=Q(a));b[0].checked=a===c.$viewValue};d.$observe("value",c.$render)},range:function(a,b,d,c,e,f){function g(a,c){b.attr(a,d[a]);d.$observe(a,c)}function h(a){p=Wa(a);U(c.$modelValue)||(m?(a=b.val(),p>a&&(a=p,b.val(a)),c.$setViewValue(a)):c.$validate())}function k(a){n=Wa(a);U(c.$modelValue)||(m?(a=b.val(),n<a&&(b.val(n),a=n<p?p:n),c.$setViewValue(a)):c.$validate())} - function l(a){r=Wa(a);U(c.$modelValue)||(m&&c.$viewValue!==b.val()?c.$setViewValue(b.val()):c.$validate())}Hc(a,b,d,c);de(c);Va(a,b,d,c,e,f);var m=c.$$hasNativeValidators&&"range"===b[0].type,p=m?0:void 0,n=m?100:void 0,r=m?1:void 0,q=b[0].validity;a=u(d.min);e=u(d.max);f=u(d.step);var v=c.$render;c.$render=m&&u(q.rangeUnderflow)&&u(q.rangeOverflow)?function(){v();c.$setViewValue(b.val())}:v;a&&(c.$validators.min=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||x(p)||b>=p},g("min",h));e&& - (c.$validators.max=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||x(n)||b<=n},g("max",k));f&&(c.$validators.step=m?function(){return!q.stepMismatch}:function(a,b){return c.$isEmpty(b)||x(r)||ee(b,p||0,r)},g("step",l))},checkbox:function(a,b,d,c,e,f,g,h){var k=fe(h,a,"ngTrueValue",d.ngTrueValue,!0),l=fe(h,a,"ngFalseValue",d.ngFalseValue,!1);b.on("click",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1=== - a};c.$formatters.push(function(a){return sa(a,k)});c.$parsers.push(function(a){return a?k:l})},hidden:D,button:D,submit:D,reset:D,file:D},Zc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){h[0]&&(ne[L(g.type)]||ne.text)(e,f,g,h[0],b,a,d,c)}}}}],fh=/^(true|false|\d+)$/,mf=function(){function a(a,d,c){var e=u(c)?c:9===Ca?"":null;a.prop("value",e);d.$set("value",c)}return{restrict:"A",priority:100,compile:function(b,d){return fh.test(d.ngValue)? - function(b,d,f){b=b.$eval(f.ngValue);a(d,f,b)}:function(b,d,f){b.$watch(f.ngValue,function(b){a(d,f,b)})}}}},Me=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];b.$watch(e.ngBind,function(a){c.textContent=gc(a)})}}}}],Oe=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions); - d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=x(a)?"":a})}}}}],Ne=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(b){return a.valueOf(b)});d.$$addBindingClass(c);return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){var d=f(b);c.html(a.getTrustedHtml(d)||"")})}}}}],lf=la({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}), - Pe=Jc("",!0),Re=Jc("Odd",0),Qe=Jc("Even",1),Se=Qa({compile:function(a,b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),Te=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],dd={},gh={blur:!0,focus:!0};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=Ea("ng-"+a);dd[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g= - d(f[b]);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};gh[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var We=["$animate","$compile",function(a,b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var h,k,l;d.$watch(e.ngIf,function(d){d?k||g(function(d,f){k=f;d[d.length++]=b.$$createComment("end ngIf",e.ngIf);h={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),k&&(k.$destroy(),k=null),h&&(l= - tb(h.clone),a.leave(l).done(function(a){!1!==a&&(l=null)}),h=null))})}}}],Xe=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:$.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(c,e,m,p,n){var r=0,q,v,y,t=function(){v&&(v.remove(),v=null);q&&(q.$destroy(),q=null);y&&(d.leave(y).done(function(a){!1!==a&&(v=null)}),v=y,y=null)};c.$watch(f,function(f){var m=function(a){!1=== - a||!u(h)||h&&!c.$eval(h)||b()},v=++r;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&v===r){var b=c.$new();p.template=a;a=n(b,function(a){t();d.enter(a,null,e).done(m)});q=b;y=a;q.$emit("$includeContentLoaded",f);c.$eval(g)}},function(){c.$$destroyed||v!==r||(t(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(t(),p.template=null)})}}}}],of=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){ia.call(d[0]).match(/SVG/)? - (d.empty(),a(fd(e.template,w.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],Ye=Qa({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),kf=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=d.ngList||", ",f="false"!==d.ngTrim,g=f?Q(e):e;c.$parsers.push(function(a){if(!x(a)){var b=[];a&&r(a.split(g),function(a){a&&b.push(f?Q(a):a)});return b}});c.$formatters.push(function(a){if(I(a))return a.join(e)}); - c.$isEmpty=function(a){return!a||!a.length}}}},nb="ng-valid",$d="ng-invalid",Ya="ng-pristine",Vb="ng-dirty",pb=K("ngModel");Sb.$inject="$scope $exceptionHandler $attrs $element $parse $animate $timeout $q $interpolate".split(" ");Sb.prototype={$$initGetterSetters:function(){if(this.$options.getOption("getterSetter")){var a=this.$$parse(this.$$attr.ngModel+"()"),b=this.$$parse(this.$$attr.ngModel+"($$$p)");this.$$ngModelGet=function(b){var c=this.$$parsedNgModel(b);C(c)&&(c=a(b));return c};this.$$ngModelSet= - function(a,c){C(this.$$parsedNgModel(a))?b(a,{$$$p:c}):this.$$parsedNgModelAssign(a,c)}}else if(!this.$$parsedNgModel.assign)throw pb("nonassign",this.$$attr.ngModel,za(this.$$element));},$render:D,$isEmpty:function(a){return x(a)||""===a||null===a||a!==a},$$updateEmptyClasses:function(a){this.$isEmpty(a)?(this.$$animate.removeClass(this.$$element,"ng-not-empty"),this.$$animate.addClass(this.$$element,"ng-empty")):(this.$$animate.removeClass(this.$$element,"ng-empty"),this.$$animate.addClass(this.$$element, - "ng-not-empty"))},$setPristine:function(){this.$dirty=!1;this.$pristine=!0;this.$$animate.removeClass(this.$$element,Vb);this.$$animate.addClass(this.$$element,Ya)},$setDirty:function(){this.$dirty=!0;this.$pristine=!1;this.$$animate.removeClass(this.$$element,Ya);this.$$animate.addClass(this.$$element,Vb);this.$$parentForm.$setDirty()},$setUntouched:function(){this.$touched=!1;this.$untouched=!0;this.$$animate.setClass(this.$$element,"ng-untouched","ng-touched")},$setTouched:function(){this.$touched= - !0;this.$untouched=!1;this.$$animate.setClass(this.$$element,"ng-touched","ng-untouched")},$rollbackViewValue:function(){this.$$timeout.cancel(this.$$pendingDebounce);this.$viewValue=this.$$lastCommittedViewValue;this.$render()},$validate:function(){if(!U(this.$modelValue)){var a=this.$$lastCommittedViewValue,b=this.$$rawModelValue,d=this.$valid,c=this.$modelValue,e=this.$options.getOption("allowInvalid"),f=this;this.$$runValidators(b,a,function(a){e||d===a||(f.$modelValue=a?b:void 0,f.$modelValue!== - c&&f.$$writeModelToScope())})}},$$runValidators:function(a,b,d){function c(){var c=!0;r(k.$validators,function(d,e){var g=Boolean(d(a,b));c=c&&g;f(e,g)});return c?!0:(r(k.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;r(k.$asyncValidators,function(e,g){var k=e(a,b);if(!k||!C(k.then))throw pb("nopromise",k);f(g,void 0);c.push(k.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?k.$$q.all(c).then(function(){g(d)},D):g(!0)}function f(a,b){h===k.$$currentValidationRunId&& - k.$setValidity(a,b)}function g(a){h===k.$$currentValidationRunId&&d(a)}this.$$currentValidationRunId++;var h=this.$$currentValidationRunId,k=this;(function(){var a=k.$$parserName||"parse";if(x(k.$$parserValid))f(a,null);else return k.$$parserValid||(r(k.$validators,function(a,b){f(b,null)}),r(k.$asyncValidators,function(a,b){f(b,null)})),f(a,k.$$parserValid),k.$$parserValid;return!0})()?c()?e():g(!1):g(!1)},$commitViewValue:function(){var a=this.$viewValue;this.$$timeout.cancel(this.$$pendingDebounce); - if(this.$$lastCommittedViewValue!==a||""===a&&this.$$hasNativeValidators)this.$$updateEmptyClasses(a),this.$$lastCommittedViewValue=a,this.$pristine&&this.$setDirty(),this.$$parseAndValidate()},$$parseAndValidate:function(){var a=this.$$lastCommittedViewValue,b=this;if(this.$$parserValid=x(a)?void 0:!0)for(var d=0;d<this.$parsers.length;d++)if(a=this.$parsers[d](a),x(a)){this.$$parserValid=!1;break}U(this.$modelValue)&&(this.$modelValue=this.$$ngModelGet(this.$$scope));var c=this.$modelValue,e=this.$options.getOption("allowInvalid"); - this.$$rawModelValue=a;e&&(this.$modelValue=a,b.$modelValue!==c&&b.$$writeModelToScope());this.$$runValidators(a,this.$$lastCommittedViewValue,function(d){e||(b.$modelValue=d?a:void 0,b.$modelValue!==c&&b.$$writeModelToScope())})},$$writeModelToScope:function(){this.$$ngModelSet(this.$$scope,this.$modelValue);r(this.$viewChangeListeners,function(a){try{a()}catch(b){this.$$exceptionHandler(b)}},this)},$setViewValue:function(a,b){this.$viewValue=a;this.$options.getOption("updateOnDefault")&&this.$$debounceViewValueCommit(b)}, - $$debounceViewValueCommit:function(a){var b=this.$options.getOption("debounce");Y(b[a])?b=b[a]:Y(b["default"])&&(b=b["default"]);this.$$timeout.cancel(this.$$pendingDebounce);var d=this;0<b?this.$$pendingDebounce=this.$$timeout(function(){d.$commitViewValue()},b):this.$$scope.$root.$$phase?this.$commitViewValue():this.$$scope.$apply(function(){d.$commitViewValue()})},$overrideModelOptions:function(a){this.$options=this.$options.createChild(a);this.$$setUpdateOnEvents()},$processModelValue:function(){var a= - this.$$format();this.$viewValue!==a&&(this.$$updateEmptyClasses(a),this.$viewValue=this.$$lastCommittedViewValue=a,this.$render(),this.$$runValidators(this.$modelValue,this.$viewValue,D))},$$format:function(){for(var a=this.$formatters,b=a.length,d=this.$modelValue;b--;)d=a[b](d);return d},$$setModelValue:function(a){this.$modelValue=this.$$rawModelValue=a;this.$$parserValid=void 0;this.$processModelValue()},$$setUpdateOnEvents:function(){this.$$updateEvents&&this.$$element.off(this.$$updateEvents, - this.$$updateEventHandler);if(this.$$updateEvents=this.$options.getOption("updateOn"))this.$$element.on(this.$$updateEvents,this.$$updateEventHandler)},$$updateEventHandler:function(a){this.$$debounceViewValueCommit(a&&a.type)}};ae({clazz:Sb,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]}});var jf=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Sb,priority:1,compile:function(b){b.addClass(Ya).addClass("ng-untouched").addClass(nb); - return{pre:function(a,b,e,f){var g=f[0];b=f[1]||g.$$parentForm;if(f=f[2])g.$options=f.$options;g.$$initGetterSetters();b.$addControl(g);e.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},post:function(b,c,e,f){function g(){h.$setTouched()}var h=f[0];h.$$setUpdateOnEvents();c.on("blur",function(){h.$touched||(a.$$phase?b.$evalAsync(g):b.$apply(g))})}}}}}],Tb,hh=/(\s+|^)default(\s+|$)/;Kc.prototype={getOption:function(a){return this.$$options[a]}, - createChild:function(a){var b=!1;a=O({},a);r(a,function(d,c){"$inherit"===d?"*"===c?b=!0:(a[c]=this.$$options[c],"updateOn"===c&&(a.updateOnDefault=this.$$options.updateOnDefault)):"updateOn"===c&&(a.updateOnDefault=!1,a[c]=Q(d.replace(hh,function(){a.updateOnDefault=!0;return" "})))},this);b&&(delete a["*"],ge(a,this.$$options));ge(a,Tb.$$options);return new Kc(a)}};Tb=new Kc({updateOn:"",updateOnDefault:!0,debounce:0,getterSetter:!1,allowInvalid:!1,timezone:null});var nf=function(){function a(a, - d){this.$$attrs=a;this.$$scope=d}a.$inject=["$attrs","$scope"];a.prototype={$onInit:function(){var a=this.parentCtrl?this.parentCtrl.$options:Tb,d=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=a.createChild(d)}};return{restrict:"A",priority:10,require:{parentCtrl:"?^^ngModelOptions"},bindToController:!0,controller:a}},Ze=Qa({terminal:!0,priority:1E3}),ih=K("ngOptions"),jh=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/, - gf=["$compile","$document","$parse",function(a,b,d){function c(a,b,c){function e(a,b,c,d,f){this.selectValue=a;this.viewValue=b;this.label=c;this.group=d;this.disabled=f}function f(a){var b;if(!r&&wa(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&"$"!==c.charAt(0)&&b.push(c)}return b}var p=a.match(jh);if(!p)throw ih("iexp",a,za(b));var n=p[5]||p[7],r=p[6];a=/ as /.test(p[0])&&p[1];var q=p[9];b=d(p[2]?p[1]:n);var v=a&&d(a)||b,u=q&&d(q),t=q?function(a,b){return u(c,b)}:function(a){return Pa(a)}, - w=function(a,b){return t(a,C(a,b))},x=d(p[2]||p[1]),A=d(p[3]||""),H=d(p[4]||""),G=d(p[8]),z={},C=r?function(a,b){z[r]=b;z[n]=a;return z}:function(a){z[n]=a;return z};return{trackBy:q,getTrackByValue:w,getWatchables:d(G,function(a){var b=[];a=a||[];for(var d=f(a),e=d.length,g=0;g<e;g++){var h=a===d?g:d[g],l=a[h],h=C(l,h),l=t(l,h);b.push(l);if(p[2]||p[1])l=x(c,h),b.push(l);p[4]&&(h=H(c,h),b.push(h))}return b}),getOptions:function(){for(var a=[],b={},d=G(c)||[],g=f(d),h=g.length,n=0;n<h;n++){var p=d=== - g?n:g[n],r=C(d[p],p),u=v(c,r),p=t(u,r),y=x(c,r),F=A(c,r),r=H(c,r),u=new e(p,u,y,F,r);a.push(u);b[p]=u}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[w(a)]},getViewValueFromOption:function(a){return q?pa(a.viewValue):a.viewValue}}}}}var e=w.document.createElement("option"),f=w.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=D},post:function(d,h,k,l){function m(a){var b=(a=t.getOptionFromViewValue(a))&& - a.element;b&&!b.selected&&(b.selected=!0);return a}function p(a,b){a.element=b;b.disabled=a.disabled;a.label!==b.label&&(b.label=a.label,b.textContent=a.label);b.value=a.selectValue}var n=l[0],q=l[1],s=k.multiple;l=0;for(var v=h.children(),y=v.length;l<y;l++)if(""===v[l].value){n.hasEmptyOption=!0;n.emptyOption=v.eq(l);break}h.empty();l=!!n.emptyOption;z(e.cloneNode(!1)).val("?");var t,w=c(k.ngOptions,h,d),x=b[0].createDocumentFragment();n.generateUnknownOptionValue=function(a){return"?"};s?(n.writeValue= - function(a){if(t){var b=a&&a.map(m)||[];t.items.forEach(function(a){a.element.selected&&-1===Array.prototype.indexOf.call(b,a)&&(a.element.selected=!1)})}},n.readValue=function(){var a=h.val()||[],b=[];r(a,function(a){(a=t.selectValueMap[a])&&!a.disabled&&b.push(t.getViewValueFromOption(a))});return b},w.trackBy&&d.$watchCollection(function(){if(I(q.$viewValue))return q.$viewValue.map(function(a){return w.getTrackByValue(a)})},function(){q.$render()})):(n.writeValue=function(a){if(t){var b=h[0].options[h[0].selectedIndex], - c=t.getOptionFromViewValue(a);b&&b.removeAttribute("selected");c?(h[0].value!==c.selectValue&&(n.removeUnknownOption(),h[0].value=c.selectValue,c.element.selected=!0),c.element.setAttribute("selected","selected")):n.selectUnknownOrEmptyOption(a)}},n.readValue=function(){var a=t.selectValueMap[h.val()];return a&&!a.disabled?(n.unselectEmptyOption(),n.removeUnknownOption(),t.getViewValueFromOption(a)):null},w.trackBy&&d.$watch(function(){return w.getTrackByValue(q.$viewValue)},function(){q.$render()})); - l&&(a(n.emptyOption)(d),h.prepend(n.emptyOption),8===n.emptyOption[0].nodeType?(n.hasEmptyOption=!1,n.registerOption=function(a,b){""===b.val()&&(n.hasEmptyOption=!0,n.emptyOption=b,n.emptyOption.removeClass("ng-scope"),q.$render(),b.on("$destroy",function(){var a=n.$isEmptyOptionSelected();n.hasEmptyOption=!1;n.emptyOption=void 0;a&&q.$render()}))}):n.emptyOption.removeClass("ng-scope"));d.$watchCollection(w.getWatchables,function(){var a=t&&n.readValue();if(t)for(var b=t.items.length-1;0<=b;b--){var c= - t.items[b];u(c.group)?Fb(c.element.parentNode):Fb(c.element)}t=w.getOptions();var d={};t.items.forEach(function(a){var b;if(u(a.group)){b=d[a.group];b||(b=f.cloneNode(!1),x.appendChild(b),b.label=null===a.group?"null":a.group,d[a.group]=b);var c=e.cloneNode(!1);b.appendChild(c);p(a,c)}else b=e.cloneNode(!1),x.appendChild(b),p(a,b)});h[0].appendChild(x);q.$render();q.$isEmpty(a)||(b=n.readValue(),(w.trackBy||s?sa(a,b):a===b)||(q.$setViewValue(b),q.$render()))})}}}}],$e=["$locale","$interpolate","$log", - function(a,b,d){var c=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(f,g,h){function k(a){g.text(a||"")}var l=h.count,m=h.$attr.when&&g.attr(h.$attr.when),p=h.offset||0,n=f.$eval(m)||{},q={},s=b.startSymbol(),v=b.endSymbol(),u=s+l+"-"+p+v,t=$.noop,w;r(h,function(a,b){var c=e.exec(b);c&&(c=(c[1]?"-":"")+L(c[2]),n[c]=g.attr(h.$attr[b]))});r(n,function(a,d){q[d]=b(a.replace(c,u))});f.$watch(l,function(b){var c=parseFloat(b),e=U(c);e||c in n||(c=a.pluralCat(c-p));c===w||e&&U(w)||(t(),e=q[c],x(e)?(null!= - b&&d.debug("ngPluralize: no rule defined for '"+c+"' in "+m),t=D,k()):t=f.$watch(e,k),w=c)})}}}],af=["$parse","$animate","$compile",function(a,b,d){var c=K("ngRepeat"),e=function(a,b,c,d,e,m,p){a[c]=d;e&&(a[e]=m);a.$index=b;a.$first=0===b;a.$last=b===p-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(b&1))};return{restrict:"A",multiElement:!0,transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,compile:function(f,g){var h=g.ngRepeat,k=d.$$createComment("end ngRepeat",h),l=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/); - if(!l)throw c("iexp",h);var m=l[1],p=l[2],n=l[3],q=l[4],l=m.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/);if(!l)throw c("iidexp",m);var s=l[3]||l[1],v=l[2];if(n&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(n)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(n)))throw c("badident",n);var u,t,w,x,z={$id:Pa};q?u=a(q):(w=function(a,b){return Pa(b)},x=function(a){return a});return function(a,d,f,g,l){u&&(t=function(b,c,d){v&&(z[v]=b);z[s]=c;z.$index= - d;return u(a,z)});var m=S();a.$watchCollection(p,function(f){var g,p,q=d[0],u,y=S(),z,F,C,A,D,B,E;n&&(a[n]=f);if(wa(f))D=f,p=t||w;else for(E in p=t||x,D=[],f)ra.call(f,E)&&"$"!==E.charAt(0)&&D.push(E);z=D.length;E=Array(z);for(g=0;g<z;g++)if(F=f===D?g:D[g],C=f[F],A=p(F,C,g),m[A])B=m[A],delete m[A],y[A]=B,E[g]=B;else{if(y[A])throw r(E,function(a){a&&a.scope&&(m[a.id]=a)}),c("dupes",h,A,C);E[g]={id:A,scope:void 0,clone:void 0};y[A]=!0}for(u in m){B=m[u];A=tb(B.clone);b.leave(A);if(A[0].parentNode)for(g= - 0,p=A.length;g<p;g++)A[g].$$NG_REMOVED=!0;B.scope.$destroy()}for(g=0;g<z;g++)if(F=f===D?g:D[g],C=f[F],B=E[g],B.scope){u=q;do u=u.nextSibling;while(u&&u.$$NG_REMOVED);B.clone[0]!==u&&b.move(tb(B.clone),null,q);q=B.clone[B.clone.length-1];e(B.scope,g,s,C,v,F,z)}else l(function(a,c){B.scope=c;var d=k.cloneNode(!1);a[a.length++]=d;b.enter(a,null,q);q=d;B.clone=a;y[B.id]=B;e(B.scope,g,s,C,v,F,z)});m=y})}}}}],bf=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngShow, - function(b){a[b?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ve=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngHide,function(b){a[b?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],cf=Qa(function(a,b,d){a.$watch(d.ngStyle,function(a,d){d&&a!==d&&r(d,function(a,c){b.css(c,"")});a&&b.css(a)},!0)}),df=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases= - {}}],link:function(d,c,e,f){var g=[],h=[],k=[],l=[],m=function(a,b){return function(c){!1!==c&&a.splice(b,1)}};d.$watch(e.ngSwitch||e.on,function(c){for(var d,e;k.length;)a.cancel(k.pop());d=0;for(e=l.length;d<e;++d){var q=tb(h[d].clone);l[d].$destroy();(k[d]=a.leave(q)).done(m(k,d))}h.length=0;l.length=0;(g=f.cases["!"+c]||f.cases["?"])&&r(g,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");h.push({clone:d});a.enter(d,f.parent(), - f)})})})}}}],ef=Qa({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){a=d.ngSwitchWhen.split(d.ngSwitchWhenSeparator).sort().filter(function(a,b,c){return c[b-1]!==a});r(a,function(a){c.cases["!"+a]=c.cases["!"+a]||[];c.cases["!"+a].push({transclude:e,element:b})})}}),ff=Qa({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){c.cases["?"]=c.cases["?"]||[];c.cases["?"].push({transclude:e,element:b})}}),kh=K("ngTransclude"), - hf=["$compile",function(a){return{restrict:"EAC",compile:function(b){var d=a(b.contents());b.empty();return function(a,b,f,g,h){function k(){d(a,function(a){b.append(a)})}if(!h)throw kh("orphan",za(b));f.ngTransclude===f.$attr.ngTransclude&&(f.ngTransclude="");f=f.ngTransclude||f.ngTranscludeSlot;h(function(a,c){var d;if(d=a.length)a:{d=0;for(var f=a.length;d<f;d++){var g=a[d];if(g.nodeType!==Oa||g.nodeValue.trim()){d=!0;break a}}d=void 0}d?b.append(a):(k(),c.$destroy())},null,f);f&&!h.isSlotFilled(f)&& - k()}}}}],Je=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,d){"text/ng-template"===d.type&&a.put(d.id,b[0].text)}}}],lh={$setViewValue:D,$render:D},mh=["$element","$scope",function(a,b){function d(){g||(g=!0,b.$$postDigest(function(){g=!1;e.ngModelCtrl.$render()}))}function c(a){h||(h=!0,b.$$postDigest(function(){b.$$destroyed||(h=!1,e.ngModelCtrl.$setViewValue(e.readValue()),a&&e.ngModelCtrl.$render())}))}var e=this,f=new Hb;e.selectValueMap={};e.ngModelCtrl=lh; - e.multiple=!1;e.unknownOption=z(w.document.createElement("option"));e.hasEmptyOption=!1;e.emptyOption=void 0;e.renderUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);a.prepend(e.unknownOption);Ga(e.unknownOption,!0);a.val(b)};e.updateUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);Ga(e.unknownOption,!0);a.val(b)};e.generateUnknownOptionValue=function(a){return"? "+Pa(a)+" ?"};e.removeUnknownOption=function(){e.unknownOption.parent()&& - e.unknownOption.remove()};e.selectEmptyOption=function(){e.emptyOption&&(a.val(""),Ga(e.emptyOption,!0))};e.unselectEmptyOption=function(){e.hasEmptyOption&&Ga(e.emptyOption,!1)};b.$on("$destroy",function(){e.renderUnknownOption=D});e.readValue=function(){var b=a.val(),b=b in e.selectValueMap?e.selectValueMap[b]:b;return e.hasOption(b)?b:null};e.writeValue=function(b){var c=a[0].options[a[0].selectedIndex];c&&Ga(z(c),!1);e.hasOption(b)?(e.removeUnknownOption(),c=Pa(b),a.val(c in e.selectValueMap? - c:b),Ga(z(a[0].options[a[0].selectedIndex]),!0)):e.selectUnknownOrEmptyOption(b)};e.addOption=function(a,b){if(8!==b[0].nodeType){Ia(a,'"option value"');""===a&&(e.hasEmptyOption=!0,e.emptyOption=b);var c=f.get(a)||0;f.set(a,c+1);d()}};e.removeOption=function(a){var b=f.get(a);b&&(1===b?(f.delete(a),""===a&&(e.hasEmptyOption=!1,e.emptyOption=void 0)):f.set(a,b-1))};e.hasOption=function(a){return!!f.get(a)};e.$hasEmptyOption=function(){return e.hasEmptyOption};e.$isUnknownOptionSelected=function(){return a[0].options[0]=== - e.unknownOption[0]};e.$isEmptyOptionSelected=function(){return e.hasEmptyOption&&a[0].options[a[0].selectedIndex]===e.emptyOption[0]};e.selectUnknownOrEmptyOption=function(a){null==a&&e.emptyOption?(e.removeUnknownOption(),e.selectEmptyOption()):e.unknownOption.parent().length?e.updateUnknownOption(a):e.renderUnknownOption(a)};var g=!1,h=!1;e.registerOption=function(a,b,f,g,h){if(f.$attr.ngValue){var q,r=NaN;f.$observe("value",function(a){var d,f=b.prop("selected");u(r)&&(e.removeOption(q),delete e.selectValueMap[r], - d=!0);r=Pa(a);q=a;e.selectValueMap[r]=a;e.addOption(a,b);b.attr("value",r);d&&f&&c()})}else g?f.$observe("value",function(a){e.readValue();var d,f=b.prop("selected");u(q)&&(e.removeOption(q),d=!0);q=a;e.addOption(a,b);d&&f&&c()}):h?a.$watch(h,function(a,d){f.$set("value",a);var g=b.prop("selected");d!==a&&e.removeOption(d);e.addOption(a,b);d&&g&&c()}):e.addOption(f.value,b);f.$observe("disabled",function(a){if("true"===a||a&&b.prop("selected"))e.multiple?c(!0):(e.ngModelCtrl.$setViewValue(null),e.ngModelCtrl.$render())}); - b.on("$destroy",function(){var a=e.readValue(),b=f.value;e.removeOption(b);d();(e.multiple&&a&&-1!==a.indexOf(b)||a===b)&&c(!0)})}}],Ke=function(){return{restrict:"E",require:["select","?ngModel"],controller:mh,priority:1,link:{pre:function(a,b,d,c){var e=c[0],f=c[1];if(f){if(e.ngModelCtrl=f,b.on("change",function(){e.removeUnknownOption();a.$apply(function(){f.$setViewValue(e.readValue())})}),d.multiple){e.multiple=!0;e.readValue=function(){var a=[];r(b.find("option"),function(b){b.selected&&!b.disabled&& - (b=b.value,a.push(b in e.selectValueMap?e.selectValueMap[b]:b))});return a};e.writeValue=function(a){r(b.find("option"),function(b){var c=!!a&&(-1!==Array.prototype.indexOf.call(a,b.value)||-1!==Array.prototype.indexOf.call(a,e.selectValueMap[b.value]));c!==b.selected&&Ga(z(b),c)})};var g,h=NaN;a.$watch(function(){h!==f.$viewValue||sa(g,f.$viewValue)||(g=ka(f.$viewValue),f.$render());h=f.$viewValue});f.$isEmpty=function(a){return!a||0===a.length}}}else e.registerOption=D},post:function(a,b,d,c){var e= - c[1];if(e){var f=c[0];e.$render=function(){f.writeValue(e.$viewValue)}}}}}},Le=["$interpolate",function(a){return{restrict:"E",priority:100,compile:function(b,d){var c,e;u(d.ngValue)||(u(d.value)?c=a(d.value,!0):(e=a(b.text(),!0))||d.$set("value",b.text()));return function(a,b,d){var k=b.parent();(k=k.data("$selectController")||k.parent().data("$selectController"))&&k.registerOption(a,b,d,c,e)}}}}],ad=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){c&&(d.required=!0,c.$validators.required= - function(a,b){return!d.required||!c.$isEmpty(b)},d.$observe("required",function(){c.$validate()}))}}},$c=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e,f=d.ngPattern||d.pattern;d.$observe("pattern",function(a){E(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw K("ngPattern")("noregexp",f,a,za(b));e=a||void 0;c.$validate()});c.$validators.pattern=function(a,b){return c.$isEmpty(b)||x(e)||e.test(b)}}}}},cd=function(){return{restrict:"A",require:"?ngModel", - link:function(a,b,d,c){if(c){var e=-1;d.$observe("maxlength",function(a){a=Z(a);e=U(a)?-1:a;c.$validate()});c.$validators.maxlength=function(a,b){return 0>e||c.$isEmpty(b)||b.length<=e}}}}},bd=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=Z(a)||0;c.$validate()});c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};w.angular.bootstrap?w.console&&console.log("WARNING: Tried to load AngularJS more than once."): - (Be(),Ee($),$.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), - STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2, - minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),z(function(){we(w.document,Uc)}))})(window);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>'); -//# sourceMappingURL=angular.min.js.map \ No newline at end of file diff --git a/setup/pub/angular/angular.min.js.map b/setup/pub/angular/angular.min.js.map deleted file mode 100644 index 1f7eb768415b8..0000000000000 --- a/setup/pub/angular/angular.min.js.map +++ /dev/null @@ -1,8 +0,0 @@ -{ -"version":3, -"file":"angular.min.js", -"lineCount":196, -"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAmBC,CAAnB,CAA8B,CCLvCC,QAAS,EAAM,CAAC,CAAD,CAAS,CAWtB,MAAO,SAAS,EAAG,CAAA,IACb,EAAO,SAAA,CAAU,CAAV,CADM,CAIf,CAJe,CAKjB,EAHW,GAGX,EAHkB,CAAA,CAAS,CAAT,CAAkB,GAAlB,CAAwB,EAG1C,EAHgD,CAGhD,CAAmB,0CAAnB,EAA+D,CAAA,CAAS,CAAT,CAAkB,GAAlB,CAAwB,EAAvF,EAA6F,CAC7F,KAAK,CAAL,CAAS,CAAT,CAAY,CAAZ,CAAgB,SAAA,OAAhB,CAAkC,CAAA,EAAlC,CACE,CAAA,CAAU,CAAV,EAA0B,CAAL,EAAA,CAAA,CAAS,GAAT,CAAe,GAApC,EAA2C,GAA3C,EAAkD,CAAlD,CAAoD,CAApD,EAAyD,GAAzD,CACE,kBAAA,CAjBc,UAAlB,EAAI,MAiB6B,UAAA,CAAU,CAAV,CAjBjC,CAiBiC,SAAA,CAAU,CAAV,CAhBxB,SAAA,EAAA,QAAA,CAAuB,aAAvB,CAAsC,EAAtC,CADT,CAEyB,WAAlB,EAAI,MAesB,UAAA,CAAU,CAAV,CAf1B,CACE,WADF,CAEoB,QAApB,EAAM,MAaoB,UAAA,CAAU,CAAV,CAb1B,CACE,IAAA,UAAA,CAYwB,SAAA,CAAU,CAAV,CAZxB,CADF,CAa0B,SAAA,CAAU,CAAV,CAA7B,CAEJ,OAAW,MAAJ,CAAU,CAAV,CAVU,CAXG,CDgKxBC,QAASA,GAAW,CAACC,CAAD,CAAM,CACxB,GAAW,IAAX,EAAIA,CAAJ,EAAmBC,EAAA,CAASD,CAAT,CAAnB,CACE,MAAO,CAAA,CAGT;IAAIE,EAASF,CAAAE,OAEb,OAAqB,EAArB,GAAIF,CAAAG,SAAJ,EAA0BD,CAA1B,CACS,CAAA,CADT,CAIOE,CAAA,CAASJ,CAAT,CAJP,EAIwBK,CAAA,CAAQL,CAAR,CAJxB,EAImD,CAJnD,GAIwCE,CAJxC,EAKyB,QALzB,GAKO,MAAOA,EALd,EAK8C,CAL9C,CAKqCA,CALrC,EAKoDA,CALpD,CAK6D,CAL7D,GAKmEF,EAZ3C,CA0C1BM,QAASA,EAAO,CAACN,CAAD,CAAMO,CAAN,CAAgBC,CAAhB,CAAyB,CACvC,IAAIC,CACJ,IAAIT,CAAJ,CACE,GAAIU,CAAA,CAAWV,CAAX,CAAJ,CACE,IAAKS,CAAL,GAAYT,EAAZ,CACa,WAAX,EAAIS,CAAJ,GAAiC,QAAjC,EAA0BA,CAA1B,EAAoD,MAApD,EAA6CA,CAA7C,EAA8DT,CAAAW,eAAA,CAAmBF,CAAnB,CAA9D,GACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBR,CAAA,CAAIS,CAAJ,CAAvB,CAAiCA,CAAjC,CAHN,KAMO,IAAIT,CAAAM,QAAJ,EAAmBN,CAAAM,QAAnB,GAAmCA,CAAnC,CACLN,CAAAM,QAAA,CAAYC,CAAZ,CAAsBC,CAAtB,CADK,KAEA,IAAIT,EAAA,CAAYC,CAAZ,CAAJ,CACL,IAAKS,CAAL,CAAW,CAAX,CAAcA,CAAd,CAAoBT,CAAAE,OAApB,CAAgCO,CAAA,EAAhC,CACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBR,CAAA,CAAIS,CAAJ,CAAvB,CAAiCA,CAAjC,CAFG,KAIL,KAAKA,CAAL,GAAYT,EAAZ,CACMA,CAAAW,eAAA,CAAmBF,CAAnB,CAAJ,EACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBR,CAAA,CAAIS,CAAJ,CAAvB,CAAiCA,CAAjC,CAKR,OAAOT,EAtBgC,CAyBzCa,QAASA,GAAU,CAACb,CAAD,CAAM,CACvB,IAAIc,EAAO,EAAX,CACSL,CAAT,KAASA,CAAT,GAAgBT,EAAhB,CACMA,CAAAW,eAAA,CAAmBF,CAAnB,CAAJ,EACEK,CAAAC,KAAA,CAAUN,CAAV,CAGJ,OAAOK,EAAAE,KAAA,EAPgB,CAUzBC,QAASA,GAAa,CAACjB,CAAD,CAAMO,CAAN,CAAgBC,CAAhB,CAAyB,CAE7C,IADA,IAAIM;AAAOD,EAAA,CAAWb,CAAX,CAAX,CACUkB,EAAI,CAAd,CAAiBA,CAAjB,CAAqBJ,CAAAZ,OAArB,CAAkCgB,CAAA,EAAlC,CACEX,CAAAK,KAAA,CAAcJ,CAAd,CAAuBR,CAAA,CAAIc,CAAA,CAAKI,CAAL,CAAJ,CAAvB,CAAqCJ,CAAA,CAAKI,CAAL,CAArC,CAEF,OAAOJ,EALsC,CAc/CK,QAASA,GAAa,CAACC,CAAD,CAAa,CACjC,MAAO,SAAQ,CAACC,CAAD,CAAQZ,CAAR,CAAa,CAAEW,CAAA,CAAWX,CAAX,CAAgBY,CAAhB,CAAF,CADK,CAYnCC,QAASA,GAAO,EAAG,CAIjB,IAHA,IAAIC,EAAQC,EAAAtB,OAAZ,CACIuB,CAEJ,CAAMF,CAAN,CAAA,CAAa,CACXA,CAAA,EACAE,EAAA,CAAQD,EAAA,CAAID,CAAJ,CAAAG,WAAA,CAAsB,CAAtB,CACR,IAAa,EAAb,EAAID,CAAJ,CAEE,MADAD,GAAA,CAAID,CAAJ,CACO,CADM,GACN,CAAAC,EAAAG,KAAA,CAAS,EAAT,CAET,IAAa,EAAb,EAAIF,CAAJ,CACED,EAAA,CAAID,CAAJ,CAAA,CAAa,GADf,KAIE,OADAC,GAAA,CAAID,CAAJ,CACO,CADMK,MAAAC,aAAA,CAAoBJ,CAApB,CAA4B,CAA5B,CACN,CAAAD,EAAAG,KAAA,CAAS,EAAT,CAXE,CAcbH,EAAAM,QAAA,CAAY,GAAZ,CACA,OAAON,GAAAG,KAAA,CAAS,EAAT,CAnBU,CA4BnBI,QAASA,GAAU,CAAC/B,CAAD,CAAMgC,CAAN,CAAS,CACtBA,CAAJ,CACEhC,CAAAiC,UADF,CACkBD,CADlB,CAIE,OAAOhC,CAAAiC,UALiB,CAsB5BC,QAASA,EAAM,CAACC,CAAD,CAAM,CACnB,IAAIH,EAAIG,CAAAF,UACR3B,EAAA,CAAQ8B,SAAR,CAAmB,QAAQ,CAACpC,CAAD,CAAK,CAC1BA,CAAJ,GAAYmC,CAAZ,EACE7B,CAAA,CAAQN,CAAR,CAAa,QAAQ,CAACqB,CAAD,CAAQZ,CAAR,CAAY,CAC/B0B,CAAA,CAAI1B,CAAJ,CAAA,CAAWY,CADoB,CAAjC,CAF4B,CAAhC,CAQAU,GAAA,CAAWI,CAAX,CAAeH,CAAf,CACA,OAAOG,EAXY,CAcrBE,QAASA,EAAG,CAACC,CAAD,CAAM,CAChB,MAAOC,SAAA,CAASD,CAAT;AAAc,EAAd,CADS,CAKlBE,QAASA,GAAO,CAACC,CAAD,CAASC,CAAT,CAAgB,CAC9B,MAAOR,EAAA,CAAO,KAAKA,CAAA,CAAO,QAAQ,EAAG,EAAlB,CAAsB,WAAWO,CAAX,CAAtB,CAAL,CAAP,CAA0DC,CAA1D,CADuB,CAmBhCC,QAASA,EAAI,EAAG,EAmBhBC,QAASA,GAAQ,CAACC,CAAD,CAAI,CAAC,MAAOA,EAAR,CAIrBC,QAASA,GAAO,CAACzB,CAAD,CAAQ,CAAC,MAAO,SAAQ,EAAG,CAAC,MAAOA,EAAR,CAAnB,CAaxB0B,QAASA,EAAW,CAAC1B,CAAD,CAAO,CAAC,MAAuB,WAAvB,EAAO,MAAOA,EAAf,CAc3B2B,QAASA,EAAS,CAAC3B,CAAD,CAAO,CAAC,MAAuB,WAAvB,EAAO,MAAOA,EAAf,CAezB4B,QAASA,EAAQ,CAAC5B,CAAD,CAAO,CAAC,MAAgB,KAAhB,EAAOA,CAAP,EAAwC,QAAxC,EAAwB,MAAOA,EAAhC,CAcxBjB,QAASA,EAAQ,CAACiB,CAAD,CAAO,CAAC,MAAuB,QAAvB,EAAO,MAAOA,EAAf,CAcxB6B,QAASA,GAAQ,CAAC7B,CAAD,CAAO,CAAC,MAAuB,QAAvB,EAAO,MAAOA,EAAf,CAcxB8B,QAASA,GAAM,CAAC9B,CAAD,CAAO,CACpB,MAAgC,eAAhC,EAAO+B,EAAAC,MAAA,CAAehC,CAAf,CADa,CAgBtBhB,QAASA,EAAO,CAACgB,CAAD,CAAQ,CACtB,MAAgC,gBAAhC,EAAO+B,EAAAC,MAAA,CAAehC,CAAf,CADe,CAgBxBX,QAASA,EAAU,CAACW,CAAD,CAAO,CAAC,MAAuB,UAAvB,EAAO,MAAOA,EAAf,CArea;AA+evCiC,QAASA,GAAQ,CAACjC,CAAD,CAAQ,CACvB,MAAgC,iBAAhC,EAAO+B,EAAAC,MAAA,CAAehC,CAAf,CADgB,CAYzBpB,QAASA,GAAQ,CAACD,CAAD,CAAM,CACrB,MAAOA,EAAP,EAAcA,CAAAJ,SAAd,EAA8BI,CAAAuD,SAA9B,EAA8CvD,CAAAwD,MAA9C,EAA2DxD,CAAAyD,YADtC,CA8CvBC,QAASA,GAAS,CAACC,CAAD,CAAO,CACvB,MAAOA,EAAP,GACGA,CAAAC,SADH,EAEMD,CAAAE,GAFN,EAEiBF,CAAAG,KAFjB,CADuB,CA+BzBC,QAASA,GAAG,CAAC/D,CAAD,CAAMO,CAAN,CAAgBC,CAAhB,CAAyB,CACnC,IAAIwD,EAAU,EACd1D,EAAA,CAAQN,CAAR,CAAa,QAAQ,CAACqB,CAAD,CAAQE,CAAR,CAAe0C,CAAf,CAAqB,CACxCD,CAAAjD,KAAA,CAAaR,CAAAK,KAAA,CAAcJ,CAAd,CAAuBa,CAAvB,CAA8BE,CAA9B,CAAqC0C,CAArC,CAAb,CADwC,CAA1C,CAGA,OAAOD,EAL4B,CAwCrCE,QAASA,GAAO,CAACC,CAAD,CAAQnE,CAAR,CAAa,CAC3B,GAAImE,CAAAD,QAAJ,CAAmB,MAAOC,EAAAD,QAAA,CAAclE,CAAd,CAE1B,KAAM,IAAIkB,EAAI,CAAd,CAAiBA,CAAjB,CAAqBiD,CAAAjE,OAArB,CAAmCgB,CAAA,EAAnC,CACE,GAAIlB,CAAJ,GAAYmE,CAAA,CAAMjD,CAAN,CAAZ,CAAsB,MAAOA,EAE/B,OAAQ,EANmB,CAS7BkD,QAASA,GAAW,CAACD,CAAD,CAAQ9C,CAAR,CAAe,CACjC,IAAIE,EAAQ2C,EAAA,CAAQC,CAAR,CAAe9C,CAAf,CACA,EAAZ,EAAIE,CAAJ,EACE4C,CAAAE,OAAA,CAAa9C,CAAb,CAAoB,CAApB,CACF,OAAOF,EAJ0B,CA8EnCiD,QAASA,GAAI,CAACC,CAAD,CAASC,CAAT,CAAqB,CAChC,GAAIvE,EAAA,CAASsE,CAAT,CAAJ,EAAgCA,CAAhC,EAAgCA,CAvMlBE,WAuMd,EAAgCF,CAvMAG,OAuMhC,CACE,KAAMC,GAAA,CAAS,MAAT,CAAN,CAGF,GAAKH,CAAL,CAaO,CACL,GAAID,CAAJ;AAAeC,CAAf,CAA4B,KAAMG,GAAA,CAAS,KAAT,CAAN,CAC5B,GAAItE,CAAA,CAAQkE,CAAR,CAAJ,CAEE,IAAM,IAAIrD,EADVsD,CAAAtE,OACUgB,CADW,CACrB,CAAiBA,CAAjB,CAAqBqD,CAAArE,OAArB,CAAoCgB,CAAA,EAApC,CACEsD,CAAAzD,KAAA,CAAiBuD,EAAA,CAAKC,CAAA,CAAOrD,CAAP,CAAL,CAAjB,CAHJ,KAKO,CACDc,CAAAA,CAAIwC,CAAAvC,UACR3B,EAAA,CAAQkE,CAAR,CAAqB,QAAQ,CAACnD,CAAD,CAAQZ,CAAR,CAAY,CACvC,OAAO+D,CAAA,CAAY/D,CAAZ,CADgC,CAAzC,CAGA,KAAMA,IAAIA,CAAV,GAAiB8D,EAAjB,CACEC,CAAA,CAAY/D,CAAZ,CAAA,CAAmB6D,EAAA,CAAKC,CAAA,CAAO9D,CAAP,CAAL,CAErBsB,GAAA,CAAWyC,CAAX,CAAuBxC,CAAvB,CARK,CAPF,CAbP,IAEE,CADAwC,CACA,CADcD,CACd,IACMlE,CAAA,CAAQkE,CAAR,CAAJ,CACEC,CADF,CACgBF,EAAA,CAAKC,CAAL,CAAa,EAAb,CADhB,CAEWpB,EAAA,CAAOoB,CAAP,CAAJ,CACLC,CADK,CACS,IAAII,IAAJ,CAASL,CAAAM,QAAA,EAAT,CADT,CAEIvB,EAAA,CAASiB,CAAT,CAAJ,CACLC,CADK,CACaM,MAAJ,CAAWP,CAAAA,OAAX,CADT,CAEItB,CAAA,CAASsB,CAAT,CAFJ,GAGLC,CAHK,CAGSF,EAAA,CAAKC,CAAL,CAAa,EAAb,CAHT,CALT,CA6BF,OAAOC,EApCyB,CA0ClCO,QAASA,GAAW,CAACC,CAAD,CAAM7C,CAAN,CAAW,CAC7BA,CAAA,CAAMA,CAAN,EAAa,EAEb,KAAI1B,IAAIA,CAAR,GAAeuE,EAAf,CAGMA,CAAArE,eAAA,CAAmBF,CAAnB,CAAJ,EAAoD,IAApD,GAA+BA,CAAAwE,OAAA,CAAW,CAAX,CAAc,CAAd,CAA/B,GACE9C,CAAA,CAAI1B,CAAJ,CADF,CACauE,CAAA,CAAIvE,CAAJ,CADb,CAKF,OAAO0B,EAXsB,CA0C/B+C,QAASA,GAAM,CAACC,CAAD,CAAKC,CAAL,CAAS,CACtB,GAAID,CAAJ,GAAWC,CAAX,CAAe,MAAO,CAAA,CACtB,IAAW,IAAX,GAAID,CAAJ,EAA0B,IAA1B,GAAmBC,CAAnB,CAAgC,MAAO,CAAA,CACvC,IAAID,CAAJ,GAAWA,CAAX,EAAiBC,CAAjB,GAAwBA,CAAxB,CAA4B,MAAO,CAAA,CAHb,KAIlBC,EAAK,MAAOF,EAJM,CAIsB1E,CAC5C,IAAI4E,CAAJ,EADyBC,MAAOF,EAChC;AACY,QADZ,EACMC,CADN,CAEI,GAAIhF,CAAA,CAAQ8E,CAAR,CAAJ,CAAiB,CACf,GAAI,CAAC9E,CAAA,CAAQ+E,CAAR,CAAL,CAAkB,MAAO,CAAA,CACzB,KAAKlF,CAAL,CAAciF,CAAAjF,OAAd,GAA4BkF,CAAAlF,OAA5B,CAAuC,CACrC,IAAIO,CAAJ,CAAQ,CAAR,CAAWA,CAAX,CAAeP,CAAf,CAAuBO,CAAA,EAAvB,CACE,GAAI,CAACyE,EAAA,CAAOC,CAAA,CAAG1E,CAAH,CAAP,CAAgB2E,CAAA,CAAG3E,CAAH,CAAhB,CAAL,CAA+B,MAAO,CAAA,CAExC,OAAO,CAAA,CAJ8B,CAFxB,CAAjB,IAQO,CAAA,GAAI0C,EAAA,CAAOgC,CAAP,CAAJ,CACL,MAAOhC,GAAA,CAAOiC,CAAP,CAAP,EAAqBD,CAAAN,QAAA,EAArB,EAAqCO,CAAAP,QAAA,EAChC,IAAIvB,EAAA,CAAS6B,CAAT,CAAJ,EAAoB7B,EAAA,CAAS8B,CAAT,CAApB,CACL,MAAOD,EAAA/B,SAAA,EAAP,EAAwBgC,CAAAhC,SAAA,EAExB,IAAY+B,CAAZ,EAAYA,CA9SJV,WA8SR,EAAYU,CA9ScT,OA8S1B,EAA2BU,CAA3B,EAA2BA,CA9SnBX,WA8SR,EAA2BW,CA9SDV,OA8S1B,EAAkCzE,EAAA,CAASkF,CAAT,CAAlC,EAAkDlF,EAAA,CAASmF,CAAT,CAAlD,EAAkE/E,CAAA,CAAQ+E,CAAR,CAAlE,CAA+E,MAAO,CAAA,CACtFG,EAAA,CAAS,EACT,KAAI9E,CAAJ,GAAW0E,EAAX,CACE,GAAsB,GAAtB,GAAI1E,CAAA+E,OAAA,CAAW,CAAX,CAAJ,EAA6B,CAAA9E,CAAA,CAAWyE,CAAA,CAAG1E,CAAH,CAAX,CAA7B,CAAA,CACA,GAAI,CAACyE,EAAA,CAAOC,CAAA,CAAG1E,CAAH,CAAP,CAAgB2E,CAAA,CAAG3E,CAAH,CAAhB,CAAL,CAA+B,MAAO,CAAA,CACtC8E,EAAA,CAAO9E,CAAP,CAAA,CAAc,CAAA,CAFd,CAIF,IAAIA,CAAJ,GAAW2E,EAAX,CACE,GAAI,CAACG,CAAA5E,eAAA,CAAsBF,CAAtB,CAAL,EACsB,GADtB,GACIA,CAAA+E,OAAA,CAAW,CAAX,CADJ,EAEIJ,CAAA,CAAG3E,CAAH,CAFJ,GAEgBZ,CAFhB,EAGI,CAACa,CAAA,CAAW0E,CAAA,CAAG3E,CAAH,CAAX,CAHL,CAG0B,MAAO,CAAA,CAEnC,OAAO,CAAA,CAlBF,CAsBX,MAAO,CAAA,CArCe,CAkExBgF,QAASA,GAAI,CAACC,CAAD;AAAOC,CAAP,CAAW,CACtB,IAAIC,EAA+B,CAAnB,CAAAxD,SAAAlC,OAAA,CArBT2F,EAAAjF,KAAA,CAqB0CwB,SArB1C,CAqBqD0D,CArBrD,CAqBS,CAAiD,EACjE,OAAI,CAAApF,CAAA,CAAWiF,CAAX,CAAJ,EAAwBA,CAAxB,WAAsCb,OAAtC,CAcSa,CAdT,CACSC,CAAA1F,OACA,CAAH,QAAQ,EAAG,CACT,MAAOkC,UAAAlC,OACA,CAAHyF,CAAAtC,MAAA,CAASqC,CAAT,CAAeE,CAAAG,OAAA,CAAiBF,EAAAjF,KAAA,CAAWwB,SAAX,CAAsB,CAAtB,CAAjB,CAAf,CAAG,CACHuD,CAAAtC,MAAA,CAASqC,CAAT,CAAeE,CAAf,CAHK,CAAR,CAKH,QAAQ,EAAG,CACT,MAAOxD,UAAAlC,OACA,CAAHyF,CAAAtC,MAAA,CAASqC,CAAT,CAAetD,SAAf,CAAG,CACHuD,CAAA/E,KAAA,CAAQ8E,CAAR,CAHK,CATK,CAqBxBM,QAASA,GAAc,CAACvF,CAAD,CAAMY,CAAN,CAAa,CAClC,IAAI4E,EAAM5E,CAES,SAAnB,GAAI,MAAOZ,EAAX,EAAiD,GAAjD,GAA+BA,CAAA+E,OAAA,CAAW,CAAX,CAA/B,CACES,CADF,CACQpG,CADR,CAEWI,EAAA,CAASoB,CAAT,CAAJ,CACL4E,CADK,CACC,SADD,CAEI5E,CAAJ,EAAczB,CAAd,GAA2ByB,CAA3B,CACL4E,CADK,CACC,WADD,CAEY5E,CAFZ,GAEYA,CA1XLoD,WAwXP,EAEYpD,CA1XaqD,OAwXzB,IAGLuB,CAHK,CAGC,QAHD,CAMP,OAAOA,EAb2B,CA8BpCC,QAASA,GAAM,CAAClG,CAAD,CAAMmG,CAAN,CAAc,CAC3B,MAAmB,WAAnB,GAAI,MAAOnG,EAAX,CAAuCH,CAAvC,CACOuG,IAAAC,UAAA,CAAerG,CAAf,CAAoBgG,EAApB,CAAoCG,CAAA,CAAS,IAAT,CAAgB,IAApD,CAFoB,CAiB7BG,QAASA,GAAQ,CAACC,CAAD,CAAO,CACtB,MAAOnG,EAAA,CAASmG,CAAT,CACA;AAADH,IAAAI,MAAA,CAAWD,CAAX,CAAC,CACDA,CAHgB,CAOxBE,QAASA,GAAS,CAACpF,CAAD,CAAQ,CACpBA,CAAJ,EAA8B,CAA9B,GAAaA,CAAAnB,OAAb,EACMwG,CACJ,CADQC,CAAA,CAAU,EAAV,CAAetF,CAAf,CACR,CAAAA,CAAA,CAAQ,EAAO,GAAP,EAAEqF,CAAF,EAAmB,GAAnB,EAAcA,CAAd,EAA+B,OAA/B,EAA0BA,CAA1B,EAA+C,IAA/C,EAA0CA,CAA1C,EAA4D,GAA5D,EAAuDA,CAAvD,EAAwE,IAAxE,EAAmEA,CAAnE,CAFV,EAIErF,CAJF,CAIU,CAAA,CAEV,OAAOA,EAPiB,CAa1BuF,QAASA,GAAW,CAACC,CAAD,CAAU,CAC5BA,CAAA,CAAUC,CAAA,CAAOD,CAAP,CAAAE,MAAA,EACV,IAAI,CAGFF,CAAAG,KAAA,CAAa,EAAb,CAHE,CAIF,MAAMC,CAAN,CAAS,EAGX,IAAIC,EAAWJ,CAAA,CAAO,OAAP,CAAAK,OAAA,CAAuBN,CAAvB,CAAAG,KAAA,EACf,IAAI,CACF,MAHcI,EAGP,GAAAP,CAAA,CAAQ,CAAR,CAAA1G,SAAA,CAAoCwG,CAAA,CAAUO,CAAV,CAApC,CACHA,CAAAG,MAAA,CACQ,YADR,CACA,CAAsB,CAAtB,CAAAC,QAAA,CACU,aADV,CACyB,QAAQ,CAACD,CAAD,CAAQzD,CAAR,CAAkB,CAAE,MAAO,GAAP,CAAa+C,CAAA,CAAU/C,CAAV,CAAf,CADnD,CAHF,CAKF,MAAMqD,CAAN,CAAS,CACT,MAAON,EAAA,CAAUO,CAAV,CADE,CAfiB,CAgC9BK,QAASA,GAAqB,CAAClG,CAAD,CAAQ,CACpC,GAAI,CACF,MAAOmG,mBAAA,CAAmBnG,CAAnB,CADL,CAEF,MAAM4F,CAAN,CAAS,EAHyB,CAatCQ,QAASA,GAAa,CAAYC,CAAZ,CAAsB,CAAA,IACtC1H,EAAM,EADgC,CAC5B2H,CAD4B,CACjBlH,CACzBH,EAAA,CAASsH,CAAAF,CAAAE,EAAY,EAAZA,OAAA,CAAsB,GAAtB,CAAT,CAAqC,QAAQ,CAACF,CAAD,CAAU,CAChDA,CAAL,GACEC,CAEA,CAFYD,CAAAE,MAAA,CAAe,GAAf,CAEZ,CADAnH,CACA,CADM8G,EAAA,CAAsBI,CAAA,CAAU,CAAV,CAAtB,CACN;AAAK3E,CAAA,CAAUvC,CAAV,CAAL,GACMwF,CACJ,CADUjD,CAAA,CAAU2E,CAAA,CAAU,CAAV,CAAV,CAAA,CAA0BJ,EAAA,CAAsBI,CAAA,CAAU,CAAV,CAAtB,CAA1B,CAAgE,CAAA,CAC1E,CAAK3H,CAAA,CAAIS,CAAJ,CAAL,CAEUJ,CAAA,CAAQL,CAAA,CAAIS,CAAJ,CAAR,CAAH,CACLT,CAAA,CAAIS,CAAJ,CAAAM,KAAA,CAAckF,CAAd,CADK,CAGLjG,CAAA,CAAIS,CAAJ,CAHK,CAGM,CAACT,CAAA,CAAIS,CAAJ,CAAD,CAAUwF,CAAV,CALb,CACEjG,CAAA,CAAIS,CAAJ,CADF,CACawF,CAHf,CAHF,CADqD,CAAvD,CAgBA,OAAOjG,EAlBmC,CAqB5C6H,QAASA,GAAU,CAAC7H,CAAD,CAAM,CACvB,IAAI8H,EAAQ,EACZxH,EAAA,CAAQN,CAAR,CAAa,QAAQ,CAACqB,CAAD,CAAQZ,CAAR,CAAa,CAC5BJ,CAAA,CAAQgB,CAAR,CAAJ,CACEf,CAAA,CAAQe,CAAR,CAAe,QAAQ,CAAC0G,CAAD,CAAa,CAClCD,CAAA/G,KAAA,CAAWiH,EAAA,CAAevH,CAAf,CAAoB,CAAA,CAApB,CAAX,EAAuD,CAAA,CAAf,GAAAsH,CAAA,CAAsB,EAAtB,CAA2B,GAA3B,CAAiCC,EAAA,CAAeD,CAAf,CAA2B,CAAA,CAA3B,CAAzE,EADkC,CAApC,CADF,CAKAD,CAAA/G,KAAA,CAAWiH,EAAA,CAAevH,CAAf,CAAoB,CAAA,CAApB,CAAX,EAAkD,CAAA,CAAV,GAAAY,CAAA,CAAiB,EAAjB,CAAsB,GAAtB,CAA4B2G,EAAA,CAAe3G,CAAf,CAAsB,CAAA,CAAtB,CAApE,EANgC,CAAlC,CASA,OAAOyG,EAAA5H,OAAA,CAAe4H,CAAAnG,KAAA,CAAW,GAAX,CAAf,CAAiC,EAXjB,CA0BzBsG,QAASA,GAAgB,CAAChC,CAAD,CAAM,CAC7B,MAAO+B,GAAA,CAAe/B,CAAf,CAAoB,CAAA,CAApB,CAAAqB,QAAA,CACY,OADZ,CACqB,GADrB,CAAAA,QAAA,CAEY,OAFZ,CAEqB,GAFrB,CAAAA,QAAA,CAGY,OAHZ,CAGqB,GAHrB,CADsB,CAmB/BU,QAASA,GAAc,CAAC/B,CAAD,CAAMiC,CAAN,CAAuB,CAC5C,MAAOC,mBAAA,CAAmBlC,CAAnB,CAAAqB,QAAA,CACY,OADZ,CACqB,GADrB,CAAAA,QAAA,CAEY,OAFZ,CAEqB,GAFrB,CAAAA,QAAA,CAGY,MAHZ,CAGoB,GAHpB,CAAAA,QAAA,CAIY,OAJZ,CAIqB,GAJrB,CAAAA,QAAA,CAKY,MALZ;AAKqBY,CAAA,CAAkB,KAAlB,CAA0B,GAL/C,CADqC,CA0C9CE,QAASA,GAAW,CAACvB,CAAD,CAAUwB,CAAV,CAAqB,CAOvClB,QAASA,EAAM,CAACN,CAAD,CAAU,CACvBA,CAAA,EAAWyB,CAAAvH,KAAA,CAAc8F,CAAd,CADY,CAPc,IACnCyB,EAAW,CAACzB,CAAD,CADwB,CAEnC0B,CAFmC,CAGnCC,CAHmC,CAInCC,EAAQ,CAAC,QAAD,CAAW,QAAX,CAAqB,UAArB,CAAiC,aAAjC,CAJ2B,CAKnCC,EAAsB,mCAM1BpI,EAAA,CAAQmI,CAAR,CAAe,QAAQ,CAACE,CAAD,CAAO,CAC5BF,CAAA,CAAME,CAAN,CAAA,CAAc,CAAA,CACdxB,EAAA,CAAOvH,CAAAgJ,eAAA,CAAwBD,CAAxB,CAAP,CACAA,EAAA,CAAOA,CAAArB,QAAA,CAAa,GAAb,CAAkB,KAAlB,CACHT,EAAAgC,iBAAJ,GACEvI,CAAA,CAAQuG,CAAAgC,iBAAA,CAAyB,GAAzB,CAA+BF,CAA/B,CAAR,CAA8CxB,CAA9C,CAEA,CADA7G,CAAA,CAAQuG,CAAAgC,iBAAA,CAAyB,GAAzB,CAA+BF,CAA/B,CAAsC,KAAtC,CAAR,CAAsDxB,CAAtD,CACA,CAAA7G,CAAA,CAAQuG,CAAAgC,iBAAA,CAAyB,GAAzB,CAA+BF,CAA/B,CAAsC,GAAtC,CAAR,CAAoDxB,CAApD,CAHF,CAJ4B,CAA9B,CAWA7G,EAAA,CAAQgI,CAAR,CAAkB,QAAQ,CAACzB,CAAD,CAAU,CAClC,GAAI,CAAC0B,CAAL,CAAiB,CAEf,IAAIlB,EAAQqB,CAAAI,KAAA,CADI,GACJ,CADUjC,CAAAkC,UACV,CAD8B,GAC9B,CACR1B,EAAJ,EACEkB,CACA,CADa1B,CACb,CAAA2B,CAAA,CAAUlB,CAAAD,CAAA,CAAM,CAAN,CAAAC,EAAY,EAAZA,SAAA,CAAwB,MAAxB,CAAgC,GAAhC,CAFZ,EAIEhH,CAAA,CAAQuG,CAAAmC,WAAR,CAA4B,QAAQ,CAACC,CAAD,CAAO,CACpCV,CAAAA,CAAL,EAAmBE,CAAA,CAAMQ,CAAAN,KAAN,CAAnB,GACEJ,CACA,CADa1B,CACb,CAAA2B,CAAA,CAASS,CAAA5H,MAFX,CADyC,CAA3C,CAPa,CADiB,CAApC,CAiBIkH;CAAJ,EACEF,CAAA,CAAUE,CAAV,CAAsBC,CAAA,CAAS,CAACA,CAAD,CAAT,CAAoB,EAA1C,CAxCqC,CA6DzCH,QAASA,GAAS,CAACxB,CAAD,CAAUqC,CAAV,CAAmB,CACnC,IAAIC,EAAcA,QAAQ,EAAG,CAC3BtC,CAAA,CAAUC,CAAA,CAAOD,CAAP,CAEV,IAAIA,CAAAuC,SAAA,EAAJ,CAAwB,CACtB,IAAIC,EAAOxC,CAAA,CAAQ,CAAR,CAAD,GAAgBjH,CAAhB,CAA4B,UAA5B,CAAyCgH,EAAA,CAAYC,CAAZ,CACnD,MAAMlC,GAAA,CAAS,SAAT,CAAwE0E,CAAxE,CAAN,CAFsB,CAKxBH,CAAA,CAAUA,CAAV,EAAqB,EACrBA,EAAApH,QAAA,CAAgB,CAAC,UAAD,CAAa,QAAQ,CAACwH,CAAD,CAAW,CAC9CA,CAAAjI,MAAA,CAAe,cAAf,CAA+BwF,CAA/B,CAD8C,CAAhC,CAAhB,CAGAqC,EAAApH,QAAA,CAAgB,IAAhB,CACIsH,EAAAA,CAAWG,EAAA,CAAeL,CAAf,CACfE,EAAAI,OAAA,CAAgB,CAAC,YAAD,CAAe,cAAf,CAA+B,UAA/B,CAA2C,WAA3C,CAAwD,UAAxD,CACb,QAAQ,CAACC,CAAD,CAAQ5C,CAAR,CAAiB6C,CAAjB,CAA0BN,CAA1B,CAAoCO,CAApC,CAA6C,CACpDF,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtB/C,CAAAgD,KAAA,CAAa,WAAb,CAA0BT,CAA1B,CACAM,EAAA,CAAQ7C,CAAR,CAAA,CAAiB4C,CAAjB,CAFsB,CAAxB,CAIAE,EAAAG,QAAA,CAAgB,CAAA,CAAhB,CALoD,CADxC,CAAhB,CASA,OAAOV,EAvBoB,CAA7B,CA0BIW,EAAqB,sBAEzB,IAAIpK,CAAJ,EAAc,CAACoK,CAAAC,KAAA,CAAwBrK,CAAAgJ,KAAxB,CAAf,CACE,MAAOQ,EAAA,EAGTxJ,EAAAgJ,KAAA,CAAchJ,CAAAgJ,KAAArB,QAAA,CAAoByC,CAApB,CAAwC,EAAxC,CACdE,GAAAC,gBAAA;AAA0BC,QAAQ,CAACC,CAAD,CAAe,CAC/C9J,CAAA,CAAQ8J,CAAR,CAAsB,QAAQ,CAAC5B,CAAD,CAAS,CACrCU,CAAAnI,KAAA,CAAayH,CAAb,CADqC,CAAvC,CAGAW,EAAA,EAJ+C,CAlCd,CA2CrCkB,QAASA,GAAU,CAAC1B,CAAD,CAAO2B,CAAP,CAAiB,CAClCA,CAAA,CAAYA,CAAZ,EAAyB,GACzB,OAAO3B,EAAArB,QAAA,CAAaiD,EAAb,CAAgC,QAAQ,CAACC,CAAD,CAASC,CAAT,CAAc,CAC3D,OAAQA,CAAA,CAAMH,CAAN,CAAkB,EAA1B,EAAgCE,CAAAE,YAAA,EAD2B,CAAtD,CAF2B,CAgCpCC,QAASA,GAAS,CAACC,CAAD,CAAMjC,CAAN,CAAYkC,CAAZ,CAAoB,CACpC,GAAI,CAACD,CAAL,CACE,KAAMjG,GAAA,CAAS,MAAT,CAA2CgE,CAA3C,EAAmD,GAAnD,CAA0DkC,CAA1D,EAAoE,UAApE,CAAN,CAEF,MAAOD,EAJ6B,CAOtCE,QAASA,GAAW,CAACF,CAAD,CAAMjC,CAAN,CAAYoC,CAAZ,CAAmC,CACjDA,CAAJ,EAA6B1K,CAAA,CAAQuK,CAAR,CAA7B,GACIA,CADJ,CACUA,CAAA,CAAIA,CAAA1K,OAAJ,CAAiB,CAAjB,CADV,CAIAyK,GAAA,CAAUjK,CAAA,CAAWkK,CAAX,CAAV,CAA2BjC,CAA3B,CAAiC,sBAAjC,EACKiC,CAAA,EAAqB,QAArB,EAAO,MAAOA,EAAd,CAAgCA,CAAAI,YAAArC,KAAhC,EAAwD,QAAxD,CAAmE,MAAOiC,EAD/E,EAEA,OAAOA,EAP8C,CAevDK,QAASA,GAAuB,CAACtC,CAAD,CAAOnI,CAAP,CAAgB,CAC9C,GAAa,gBAAb,GAAImI,CAAJ,CACE,KAAMhE,GAAA,CAAS,SAAT,CAA8DnE,CAA9D,CAAN,CAF4C,CAchD0K,QAASA,GAAM,CAAClL,CAAD,CAAMmL,CAAN,CAAYC,CAAZ,CAA2B,CACxC,GAAI,CAACD,CAAL,CAAW,MAAOnL,EACdc,EAAAA,CAAOqK,CAAAvD,MAAA,CAAW,GAAX,CAKX,KAJA,IAAInH,CAAJ,CACI4K,EAAerL,CADnB,CAEIsL,EAAMxK,CAAAZ,OAFV,CAISgB;AAAI,CAAb,CAAgBA,CAAhB,CAAoBoK,CAApB,CAAyBpK,CAAA,EAAzB,CACET,CACA,CADMK,CAAA,CAAKI,CAAL,CACN,CAAIlB,CAAJ,GACEA,CADF,CACQ,CAACqL,CAAD,CAAgBrL,CAAhB,EAAqBS,CAArB,CADR,CAIF,OAAI,CAAC2K,CAAL,EAAsB1K,CAAA,CAAWV,CAAX,CAAtB,CACSyF,EAAA,CAAK4F,CAAL,CAAmBrL,CAAnB,CADT,CAGOA,CAhBiC,CA2B1CuL,QAASA,GAAiB,CAAC5L,CAAD,CAAS,CAIjC6L,QAASA,EAAM,CAACxL,CAAD,CAAM2I,CAAN,CAAY8C,CAAZ,CAAqB,CAClC,MAAOzL,EAAA,CAAI2I,CAAJ,CAAP,GAAqB3I,CAAA,CAAI2I,CAAJ,CAArB,CAAiC8C,CAAA,EAAjC,CADkC,CAFpC,IAAIC,EAAkB5L,CAAA,CAAO,WAAP,CAMtB,OAAO0L,EAAA,CAAOA,CAAA,CAAO7L,CAAP,CAAe,SAAf,CAA0BgM,MAA1B,CAAP,CAA0C,QAA1C,CAAoD,QAAQ,EAAG,CAEpE,IAAIzC,EAAU,EAmDd,OAAOV,SAAe,CAACG,CAAD,CAAOiD,CAAP,CAAiBC,CAAjB,CAA2B,CAC/CZ,EAAA,CAAwBtC,CAAxB,CAA8B,QAA9B,CACIiD,EAAJ,EAAgB1C,CAAAvI,eAAA,CAAuBgI,CAAvB,CAAhB,GACEO,CAAA,CAAQP,CAAR,CADF,CACkB,IADlB,CAGA,OAAO6C,EAAA,CAAOtC,CAAP,CAAgBP,CAAhB,CAAsB,QAAQ,EAAG,CA6MtCmD,QAASA,EAAW,CAACC,CAAD,CAAWC,CAAX,CAAmBC,CAAnB,CAAiC,CACnD,MAAO,SAAQ,EAAG,CAChBC,CAAA,CAAYD,CAAZ,EAA4B,MAA5B,CAAA,CAAoC,CAACF,CAAD,CAAWC,CAAX,CAAmB5J,SAAnB,CAApC,CACA,OAAO+J,EAFS,CADiC,CA5MrD,GAAI,CAACP,CAAL,CACE,KAAMF,EAAA,CAAgB,OAAhB,CAEW/C,CAFX,CAAN,CAMF,IAAIuD,EAAc,EAAlB,CAGIE,EAAY,EAHhB,CAKIC,EAASP,CAAA,CAAY,WAAZ,CAAyB,QAAzB,CALb,CAQIK,EAAiB,cAELD,CAFK,YAGPE,CAHO,UAaTR,CAbS,MAsBbjD,CAtBa,UAkCTmD,CAAA,CAAY,UAAZ;AAAwB,UAAxB,CAlCS,SA6CVA,CAAA,CAAY,UAAZ,CAAwB,SAAxB,CA7CU,SAwDVA,CAAA,CAAY,UAAZ,CAAwB,SAAxB,CAxDU,OAmEZA,CAAA,CAAY,UAAZ,CAAwB,OAAxB,CAnEY,UA+ETA,CAAA,CAAY,UAAZ,CAAwB,UAAxB,CAAoC,SAApC,CA/ES,WAgHRA,CAAA,CAAY,kBAAZ,CAAgC,UAAhC,CAhHQ,QA2HXA,CAAA,CAAY,iBAAZ,CAA+B,UAA/B,CA3HW,YAuIPA,CAAA,CAAY,qBAAZ,CAAmC,UAAnC,CAvIO,WAoJRA,CAAA,CAAY,kBAAZ,CAAgC,WAAhC,CApJQ,QA+JXO,CA/JW,KA2KdC,QAAQ,CAACC,CAAD,CAAQ,CACnBH,CAAArL,KAAA,CAAewL,CAAf,CACA,OAAO,KAFY,CA3KF,CAiLjBV,EAAJ,EACEQ,CAAA,CAAOR,CAAP,CAGF,OAAQM,EArM8B,CAAjC,CALwC,CArDmB,CAA/D,CAR0B,CA0gBnCK,QAASA,GAAS,CAAC7D,CAAD,CAAO,CACvB,MAAOA,EAAArB,QAAA,CACGmF,EADH,CACyB,QAAQ,CAACC,CAAD,CAAIpC,CAAJ,CAAeE,CAAf,CAAuBmC,CAAvB,CAA+B,CACnE,MAAOA,EAAA,CAASnC,CAAAoC,YAAA,EAAT,CAAgCpC,CAD4B,CADhE,CAAAlD,QAAA,CAIGuF,EAJH,CAIoB,OAJpB,CADgB,CAgBzBC,QAASA,GAAuB,CAACnE,CAAD;AAAOoE,CAAP,CAAqBC,CAArB,CAAkCC,CAAlC,CAAuD,CAMrFC,QAASA,EAAW,CAACC,CAAD,CAAQ,CAAA,IACtBlJ,EAAO+I,CAAA,EAAeG,CAAf,CAAuB,CAAC,IAAAC,OAAA,CAAYD,CAAZ,CAAD,CAAvB,CAA8C,CAAC,IAAD,CAD/B,CAEtBE,EAAYN,CAFU,CAGtBO,CAHsB,CAGjBC,CAHiB,CAGPC,CAHO,CAItB3G,CAJsB,CAIb4G,CAJa,CAIYC,CAEtC,IAAI,CAACT,CAAL,EAAqC,IAArC,EAA4BE,CAA5B,CACE,IAAA,CAAMlJ,CAAA/D,OAAN,CAAA,CAEE,IADAoN,CACkB,CADZrJ,CAAA0J,MAAA,EACY,CAAdJ,CAAc,CAAH,CAAG,CAAAC,CAAA,CAAYF,CAAApN,OAA9B,CAA0CqN,CAA1C,CAAqDC,CAArD,CAAgED,CAAA,EAAhE,CAOE,IANA1G,CAMoB,CANVC,CAAA,CAAOwG,CAAA,CAAIC,CAAJ,CAAP,CAMU,CALhBF,CAAJ,CACExG,CAAA+G,eAAA,CAAuB,UAAvB,CADF,CAGEP,CAHF,CAGc,CAACA,CAEK,CAAhBI,CAAgB,CAAH,CAAG,CAAAI,CAAA,CAAe3N,CAAAwN,CAAAxN,CAAW2G,CAAA6G,SAAA,EAAXxN,QAAnC,CACIuN,CADJ,CACiBI,CADjB,CAEIJ,CAAA,EAFJ,CAGExJ,CAAAlD,KAAA,CAAU+M,EAAA,CAAOJ,CAAA,CAASD,CAAT,CAAP,CAAV,CAKR,OAAOM,EAAA1K,MAAA,CAAmB,IAAnB,CAAyBjB,SAAzB,CAxBmB,CAL5B,IAAI2L,EAAeD,EAAAnI,GAAA,CAAUgD,CAAV,CAAnB,CACAoF,EAAeA,CAAAC,UAAfD,EAAyCA,CACzCb,EAAAc,UAAA,CAAwBD,CACxBD,GAAAnI,GAAA,CAAUgD,CAAV,CAAA,CAAkBuE,CAJmE,CAmCvFe,QAASA,EAAM,CAACpH,CAAD,CAAU,CACvB,GAAIA,CAAJ,WAAuBoH,EAAvB,CACE,MAAOpH,EAET,IAAI,EAAE,IAAF,WAAkBoH,EAAlB,CAAJ,CAA+B,CAC7B,GAAI7N,CAAA,CAASyG,CAAT,CAAJ,EAA8C,GAA9C,EAAyBA,CAAArB,OAAA,CAAe,CAAf,CAAzB,CACE,KAAM0I,GAAA,CAAa,OAAb,CAAN,CAEF,MAAO,KAAID,CAAJ,CAAWpH,CAAX,CAJsB,CAO/B,GAAIzG,CAAA,CAASyG,CAAT,CAAJ,CAAuB,CACrB,IAAIsH,EAAMvO,CAAAwO,cAAA,CAAuB,KAAvB,CAGVD,EAAAE,UAAA;AAAgB,mBAAhB,CAAsCxH,CACtCsH,EAAAG,YAAA,CAAgBH,CAAAI,WAAhB,CACAC,GAAA,CAAe,IAAf,CAAqBL,CAAAM,WAArB,CACe3H,EAAA4H,CAAO9O,CAAA+O,uBAAA,EAAPD,CACfvH,OAAA,CAAgB,IAAhB,CARqB,CAAvB,IAUEqH,GAAA,CAAe,IAAf,CAAqB3H,CAArB,CArBqB,CAyBzB+H,QAASA,GAAW,CAAC/H,CAAD,CAAU,CAC5B,MAAOA,EAAAgI,UAAA,CAAkB,CAAA,CAAlB,CADqB,CAI9BC,QAASA,GAAY,CAACjI,CAAD,CAAS,CAC5BkI,EAAA,CAAiBlI,CAAjB,CAD4B,KAElB3F,EAAI,CAAd,KAAiBwM,CAAjB,CAA4B7G,CAAA4H,WAA5B,EAAkD,EAAlD,CAAsDvN,CAAtD,CAA0DwM,CAAAxN,OAA1D,CAA2EgB,CAAA,EAA3E,CACE4N,EAAA,CAAapB,CAAA,CAASxM,CAAT,CAAb,CAH0B,CAO9B8N,QAASA,GAAS,CAACnI,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoBuJ,CAApB,CAAiC,CACjD,GAAIlM,CAAA,CAAUkM,CAAV,CAAJ,CAA4B,KAAMhB,GAAA,CAAa,SAAb,CAAN,CADqB,IAG7CiB,EAASC,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CACAuI,GAAAC,CAAmBxI,CAAnBwI,CAA4B,QAA5BA,CAEb,GAEItM,CAAA,CAAYkM,CAAZ,CAAJ,CACE3O,CAAA,CAAQ6O,CAAR,CAAgB,QAAQ,CAACG,CAAD,CAAeL,CAAf,CAAqB,CAC3CM,EAAA,CAAsB1I,CAAtB,CAA+BoI,CAA/B,CAAqCK,CAArC,CACA,QAAOH,CAAA,CAAOF,CAAP,CAFoC,CAA7C,CADF,CAME3O,CAAA,CAAQ2O,CAAArH,MAAA,CAAW,GAAX,CAAR,CAAyB,QAAQ,CAACqH,CAAD,CAAO,CAClClM,CAAA,CAAY4C,CAAZ,CAAJ,EACE4J,EAAA,CAAsB1I,CAAtB,CAA+BoI,CAA/B,CAAqCE,CAAA,CAAOF,CAAP,CAArC,CACA,CAAA,OAAOE,CAAA,CAAOF,CAAP,CAFT,EAIE7K,EAAA,CAAY+K,CAAA,CAAOF,CAAP,CAAZ,EAA4B,EAA5B,CAAgCtJ,CAAhC,CALoC,CAAxC,CARF,CANiD,CAyBnDoJ,QAASA,GAAgB,CAAClI,CAAD,CAAU8B,CAAV,CAAgB,CAAA,IACnC6G,EAAY3I,CAAA,CAAQ4I,EAAR,CADuB,CAEnCC,EAAeC,EAAA,CAAQH,CAAR,CAEfE,EAAJ,GACM/G,CAAJ,CACE,OAAOgH,EAAA,CAAQH,CAAR,CAAA3F,KAAA,CAAwBlB,CAAxB,CADT;CAKI+G,CAAAL,OAKJ,GAJEK,CAAAP,OAAAS,SACA,EADgCF,CAAAL,OAAA,CAAoB,EAApB,CAAwB,UAAxB,CAChC,CAAAL,EAAA,CAAUnI,CAAV,CAGF,EADA,OAAO8I,EAAA,CAAQH,CAAR,CACP,CAAA3I,CAAA,CAAQ4I,EAAR,CAAA,CAAkB5P,CAVlB,CADF,CAJuC,CAmBzCuP,QAASA,GAAkB,CAACvI,CAAD,CAAUpG,CAAV,CAAeY,CAAf,CAAsB,CAAA,IAC3CmO,EAAY3I,CAAA,CAAQ4I,EAAR,CAD+B,CAE3CC,EAAeC,EAAA,CAAQH,CAAR,EAAsB,EAAtB,CAEnB,IAAIxM,CAAA,CAAU3B,CAAV,CAAJ,CACOqO,CAIL,GAHE7I,CAAA,CAAQ4I,EAAR,CACA,CADkBD,CAClB,CAtJuB,EAAEK,EAsJzB,CAAAH,CAAA,CAAeC,EAAA,CAAQH,CAAR,CAAf,CAAoC,EAEtC,EAAAE,CAAA,CAAajP,CAAb,CAAA,CAAoBY,CALtB,KAOE,OAAOqO,EAAP,EAAuBA,CAAA,CAAajP,CAAb,CAXsB,CAejDqP,QAASA,GAAU,CAACjJ,CAAD,CAAUpG,CAAV,CAAeY,CAAf,CAAsB,CAAA,IACnCwI,EAAOuF,EAAA,CAAmBvI,CAAnB,CAA4B,MAA5B,CAD4B,CAEnCkJ,EAAW/M,CAAA,CAAU3B,CAAV,CAFwB,CAGnC2O,EAAa,CAACD,CAAdC,EAA0BhN,CAAA,CAAUvC,CAAV,CAHS,CAInCwP,EAAiBD,CAAjBC,EAA+B,CAAChN,CAAA,CAASxC,CAAT,CAE/BoJ,EAAL,EAAcoG,CAAd,EACEb,EAAA,CAAmBvI,CAAnB,CAA4B,MAA5B,CAAoCgD,CAApC,CAA2C,EAA3C,CAGF,IAAIkG,CAAJ,CACElG,CAAA,CAAKpJ,CAAL,CAAA,CAAYY,CADd,KAGE,IAAI2O,CAAJ,CAAgB,CACd,GAAIC,CAAJ,CAEE,MAAOpG,EAAP,EAAeA,CAAA,CAAKpJ,CAAL,CAEfyB,EAAA,CAAO2H,CAAP,CAAapJ,CAAb,CALY,CAAhB,IAQE,OAAOoJ,EArB4B,CA0BzCqG,QAASA,GAAc,CAACrJ,CAAD,CAAUsJ,CAAV,CAAoB,CACzC,MAAKtJ,EAAAuJ,aAAL,CAEuC,EAFvC,CACS9I,CAAA,GAAAA,EAAOT,CAAAuJ,aAAA,CAAqB,OAArB,CAAP9I,EAAwC,EAAxCA,EAA8C,GAA9CA,SAAA,CAA2D,SAA3D,CAAsE,GAAtE,CAAApD,QAAA,CACI,GADJ,CACUiM,CADV,CACqB,GADrB,CADT,CAAkC,CAAA,CADO,CAM3CE,QAASA,GAAiB,CAACxJ,CAAD,CAAUyJ,CAAV,CAAsB,CAC1CA,CAAJ,EAAkBzJ,CAAA0J,aAAlB;AACEjQ,CAAA,CAAQgQ,CAAA1I,MAAA,CAAiB,GAAjB,CAAR,CAA+B,QAAQ,CAAC4I,CAAD,CAAW,CAChD3J,CAAA0J,aAAA,CAAqB,OAArB,CAA8BE,EAAA,CACzBnJ,CAAA,GAAAA,EAAOT,CAAAuJ,aAAA,CAAqB,OAArB,CAAP9I,EAAwC,EAAxCA,EAA8C,GAA9CA,SAAA,CACQ,SADR,CACmB,GADnB,CAAAA,QAAA,CAEQ,GAFR,CAEcmJ,EAAA,CAAKD,CAAL,CAFd,CAE+B,GAF/B,CAEoC,GAFpC,CADyB,CAA9B,CADgD,CAAlD,CAF4C,CAYhDE,QAASA,GAAc,CAAC7J,CAAD,CAAUyJ,CAAV,CAAsB,CAC3C,GAAIA,CAAJ,EAAkBzJ,CAAA0J,aAAlB,CAAwC,CACtC,IAAII,EAAmBrJ,CAAA,GAAAA,EAAOT,CAAAuJ,aAAA,CAAqB,OAArB,CAAP9I,EAAwC,EAAxCA,EAA8C,GAA9CA,SAAA,CACU,SADV,CACqB,GADrB,CAGvBhH,EAAA,CAAQgQ,CAAA1I,MAAA,CAAiB,GAAjB,CAAR,CAA+B,QAAQ,CAAC4I,CAAD,CAAW,CAChDA,CAAA,CAAWC,EAAA,CAAKD,CAAL,CAC4C,GAAvD,GAAIG,CAAAzM,QAAA,CAAwB,GAAxB,CAA8BsM,CAA9B,CAAyC,GAAzC,CAAJ,GACEG,CADF,EACqBH,CADrB,CACgC,GADhC,CAFgD,CAAlD,CAOA3J,EAAA0J,aAAA,CAAqB,OAArB,CAA8BE,EAAA,CAAKE,CAAL,CAA9B,CAXsC,CADG,CAgB7CnC,QAASA,GAAc,CAACoC,CAAD,CAAOtI,CAAP,CAAiB,CACtC,GAAIA,CAAJ,CAAc,CACZA,CAAA,CAAaA,CAAA1E,SACF,EADuB,CAAAZ,CAAA,CAAUsF,CAAApI,OAAV,CACvB,EADsDD,EAAA,CAASqI,CAAT,CACtD,CACP,CAAEA,CAAF,CADO,CAAPA,CAEJ,KAAI,IAAIpH,EAAE,CAAV,CAAaA,CAAb,CAAiBoH,CAAApI,OAAjB,CAAkCgB,CAAA,EAAlC,CACE0P,CAAA7P,KAAA,CAAUuH,CAAA,CAASpH,CAAT,CAAV,CALU,CADwB,CAWxC2P,QAASA,GAAgB,CAAChK,CAAD,CAAU8B,CAAV,CAAgB,CACvC,MAAOmI,GAAA,CAAoBjK,CAApB,CAA6B,GAA7B,EAAoC8B,CAApC;AAA4C,cAA5C,EAA+D,YAA/D,CADgC,CAIzCmI,QAASA,GAAmB,CAACjK,CAAD,CAAU8B,CAAV,CAAgBtH,CAAhB,CAAuB,CACjDwF,CAAA,CAAUC,CAAA,CAAOD,CAAP,CAQV,KAJ0B,CAI1B,EAJGA,CAAA,CAAQ,CAAR,CAAA1G,SAIH,GAHE0G,CAGF,CAHYA,CAAA/C,KAAA,CAAa,MAAb,CAGZ,EAAO+C,CAAA3G,OAAP,CAAA,CAAuB,CACrB,IAAKmB,CAAL,CAAawF,CAAAgD,KAAA,CAAalB,CAAb,CAAb,IAAqC9I,CAArC,CAAgD,MAAOwB,EACvDwF,EAAA,CAAUA,CAAApE,OAAA,EAFW,CAT0B,CAmEnDsO,QAASA,GAAkB,CAAClK,CAAD,CAAU8B,CAAV,CAAgB,CAEzC,IAAIqI,EAAcC,EAAA,CAAatI,CAAA+B,YAAA,EAAb,CAGlB,OAAOsG,EAAP,EAAsBE,EAAA,CAAiBrK,CAAAjD,SAAjB,CAAtB,EAA4DoN,CALnB,CAsL3CG,QAASA,GAAkB,CAACtK,CAAD,CAAUsI,CAAV,CAAkB,CAC3C,IAAIG,EAAeA,QAAS,CAAC8B,CAAD,CAAQnC,CAAR,CAAc,CACnCmC,CAAAC,eAAL,GACED,CAAAC,eADF,CACyBC,QAAQ,EAAG,CAChCF,CAAAG,YAAA,CAAoB,CAAA,CADY,CADpC,CAMKH,EAAAI,gBAAL,GACEJ,CAAAI,gBADF,CAC0BC,QAAQ,EAAG,CACjCL,CAAAM,aAAA,CAAqB,CAAA,CADY,CADrC,CAMKN,EAAAO,OAAL,GACEP,CAAAO,OADF,CACiBP,CAAAQ,WADjB,EACqChS,CADrC,CAIA,IAAImD,CAAA,CAAYqO,CAAAS,iBAAZ,CAAJ,CAAyC,CACvC,IAAIC,EAAUV,CAAAC,eACdD,EAAAC,eAAA,CAAuBC,QAAQ,EAAG,CAChCF,CAAAS,iBAAA;AAAyB,CAAA,CACzBC,EAAAlR,KAAA,CAAawQ,CAAb,CAFgC,CAIlCA,EAAAS,iBAAA,CAAyB,CAAA,CANc,CASzCT,CAAAW,mBAAA,CAA2BC,QAAQ,EAAG,CACpC,MAAOZ,EAAAS,iBAAP,EAAsD,CAAA,CAAtD,EAAiCT,CAAAG,YADG,CAItCjR,EAAA,CAAQ6O,CAAA,CAAOF,CAAP,EAAemC,CAAAnC,KAAf,CAAR,CAAoC,QAAQ,CAACtJ,CAAD,CAAK,CAC/CA,CAAA/E,KAAA,CAAQiG,CAAR,CAAiBuK,CAAjB,CAD+C,CAAjD,CAMY,EAAZ,EAAIa,CAAJ,EAEEb,CAAAC,eAEA,CAFuB,IAEvB,CADAD,CAAAI,gBACA,CADwB,IACxB,CAAAJ,CAAAW,mBAAA,CAA2B,IAJ7B,GAOE,OAAOX,CAAAC,eAEP,CADA,OAAOD,CAAAI,gBACP,CAAA,OAAOJ,CAAAW,mBATT,CApCwC,CAgD1CzC,EAAA4C,KAAA,CAAoBrL,CACpB,OAAOyI,EAlDoC,CAqR7C6C,QAASA,GAAO,CAACnS,CAAD,CAAM,CAAA,IAChBoS,EAAU,MAAOpS,EADD,CAEhBS,CAEW,SAAf,EAAI2R,CAAJ,EAAmC,IAAnC,GAA2BpS,CAA3B,CACsC,UAApC,EAAI,OAAQS,CAAR,CAAcT,CAAAiC,UAAd,CAAJ,CAEExB,CAFF,CAEQT,CAAAiC,UAAA,EAFR,CAGWxB,CAHX,GAGmBZ,CAHnB,GAIEY,CAJF,CAIQT,CAAAiC,UAJR,CAIwBX,EAAA,EAJxB,CADF,CAQEb,CARF,CAQQT,CAGR,OAAOoS,EAAP,CAAiB,GAAjB,CAAuB3R,CAfH,CAqBtB4R,QAASA,GAAO,CAAClO,CAAD,CAAO,CACrB7D,CAAA,CAAQ6D,CAAR;AAAe,IAAAmO,IAAf,CAAyB,IAAzB,CADqB,CA2EvBC,QAASA,GAAQ,CAAC5M,CAAD,CAAK,CAAA,IAChB6M,CADgB,CAEhBC,CAIa,WAAjB,EAAI,MAAO9M,EAAX,EACQ6M,CADR,CACkB7M,CAAA6M,QADlB,IAEIA,CAUA,CAVU,EAUV,CATI7M,CAAAzF,OASJ,GAREuS,CAEA,CAFS9M,CAAAvC,SAAA,EAAAkE,QAAA,CAAsBoL,EAAtB,CAAsC,EAAtC,CAET,CADAC,CACA,CADUF,CAAApL,MAAA,CAAauL,EAAb,CACV,CAAAtS,CAAA,CAAQqS,CAAA,CAAQ,CAAR,CAAA/K,MAAA,CAAiBiL,EAAjB,CAAR,CAAwC,QAAQ,CAACjI,CAAD,CAAK,CACnDA,CAAAtD,QAAA,CAAYwL,EAAZ,CAAoB,QAAQ,CAACC,CAAD,CAAMC,CAAN,CAAkBrK,CAAlB,CAAuB,CACjD6J,CAAAzR,KAAA,CAAa4H,CAAb,CADiD,CAAnD,CADmD,CAArD,CAMF,EAAAhD,CAAA6M,QAAA,CAAaA,CAZjB,EAcWnS,CAAA,CAAQsF,CAAR,CAAJ,EACLsN,CAEA,CAFOtN,CAAAzF,OAEP,CAFmB,CAEnB,CADA4K,EAAA,CAAYnF,CAAA,CAAGsN,CAAH,CAAZ,CAAsB,IAAtB,CACA,CAAAT,CAAA,CAAU7M,CAAAE,MAAA,CAAS,CAAT,CAAYoN,CAAZ,CAHL,EAKLnI,EAAA,CAAYnF,CAAZ,CAAgB,IAAhB,CAAsB,CAAA,CAAtB,CAEF,OAAO6M,EA3Ba,CAsgBtBjJ,QAASA,GAAc,CAAC2J,CAAD,CAAgB,CAmCrCC,QAASA,EAAa,CAACC,CAAD,CAAW,CAC/B,MAAO,SAAQ,CAAC3S,CAAD,CAAMY,CAAN,CAAa,CAC1B,GAAI4B,CAAA,CAASxC,CAAT,CAAJ,CACEH,CAAA,CAAQG,CAAR,CAAaU,EAAA,CAAciS,CAAd,CAAb,CADF,KAGE,OAAOA,EAAA,CAAS3S,CAAT,CAAcY,CAAd,CAJiB,CADG,CAUjC0K,QAASA,EAAQ,CAACpD,CAAD,CAAO0K,CAAP,CAAkB,CACjCpI,EAAA,CAAwBtC,CAAxB,CAA8B,SAA9B,CACA,IAAIjI,CAAA,CAAW2S,CAAX,CAAJ,EAA6BhT,CAAA,CAAQgT,CAAR,CAA7B,CACEA,CAAA,CAAYC,CAAAC,YAAA,CAA6BF,CAA7B,CAEd,IAAI,CAACA,CAAAG,KAAL,CACE,KAAM9H,GAAA,CAAgB,MAAhB,CAA2E/C,CAA3E,CAAN,CAEF,MAAO8K,EAAA,CAAc9K,CAAd,CAAqB+K,CAArB,CAAP,CAA8CL,CARb,CAWnC5H,QAASA,EAAO,CAAC9C,CAAD;AAAOgL,CAAP,CAAkB,CAAE,MAAO5H,EAAA,CAASpD,CAAT,CAAe,MAAQgL,CAAR,CAAf,CAAT,CA6BlCC,QAASA,EAAW,CAACV,CAAD,CAAe,CACjC,IAAI9G,EAAY,EAChB9L,EAAA,CAAQ4S,CAAR,CAAuB,QAAQ,CAAC1K,CAAD,CAAS,CACtC,GAAI,CAAAqL,CAAAC,IAAA,CAAkBtL,CAAlB,CAAJ,CAAA,CACAqL,CAAAvB,IAAA,CAAkB9J,CAAlB,CAA0B,CAAA,CAA1B,CAEA,IAAI,CACF,GAAIpI,CAAA,CAASoI,CAAT,CAAJ,CAAsB,CACpB,IAAIuL,EAAWC,EAAA,CAAcxL,CAAd,CACf4D,EAAA,CAAYA,CAAArG,OAAA,CAAiB6N,CAAA,CAAYG,CAAAnI,SAAZ,CAAjB,CAAA7F,OAAA,CAAwDgO,CAAAE,WAAxD,CAEZ,KAJoB,IAIZ/H,EAAc6H,CAAAG,aAJF,CAIyBhT,EAAI,CAJ7B,CAIgCiT,EAAKjI,CAAAhM,OAAzD,CAA6EgB,CAA7E,CAAiFiT,CAAjF,CAAqFjT,CAAA,EAArF,CAA0F,CAAA,IACpFkT,EAAalI,CAAA,CAAYhL,CAAZ,CADuE,CAEpF6K,EAAWuH,CAAAQ,IAAA,CAAqBM,CAAA,CAAW,CAAX,CAArB,CAEfrI,EAAA,CAASqI,CAAA,CAAW,CAAX,CAAT,CAAA/Q,MAAA,CAA8B0I,CAA9B,CAAwCqI,CAAA,CAAW,CAAX,CAAxC,CAJwF,CAJtE,CAAtB,IAUW1T,EAAA,CAAW8H,CAAX,CAAJ,CACH4D,CAAArL,KAAA,CAAeuS,CAAA9J,OAAA,CAAwBhB,CAAxB,CAAf,CADG,CAEInI,CAAA,CAAQmI,CAAR,CAAJ,CACH4D,CAAArL,KAAA,CAAeuS,CAAA9J,OAAA,CAAwBhB,CAAxB,CAAf,CADG,CAGLsC,EAAA,CAAYtC,CAAZ,CAAoB,QAApB,CAhBA,CAkBF,MAAOvB,CAAP,CAAU,CAUV,KATI5G,EAAA,CAAQmI,CAAR,CASE,GARJA,CAQI,CARKA,CAAA,CAAOA,CAAAtI,OAAP,CAAuB,CAAvB,CAQL,EANF+G,CAAAoN,QAME,GANWpN,CAAAqN,MAMX,EANqD,EAMrD,EANsBrN,CAAAqN,MAAApQ,QAAA,CAAgB+C,CAAAoN,QAAhB,CAMtB,IAFJpN,CAEI,CAFAA,CAAAoN,QAEA,CAFY,IAEZ,CAFmBpN,CAAAqN,MAEnB,EAAA5I,EAAA,CAAgB,UAAhB,CAA6ElD,CAA7E,CAAqFvB,CAAAqN,MAArF,EAAgGrN,CAAAoN,QAAhG,EAA6GpN,CAA7G,CAAN,CAVU,CArBZ,CADsC,CAAxC,CAmCA,OAAOmF,EArC0B,CArFE;AAiIrCmI,QAASA,EAAsB,CAACC,CAAD,CAAQ/I,CAAR,CAAiB,CAE9CgJ,QAASA,EAAU,CAACC,CAAD,CAAc,CAC/B,GAAIF,CAAA7T,eAAA,CAAqB+T,CAArB,CAAJ,CAAuC,CACrC,GAAIF,CAAA,CAAME,CAAN,CAAJ,GAA2BC,CAA3B,CACE,KAAMjJ,GAAA,CAAgB,MAAhB,CAA0DP,CAAAxJ,KAAA,CAAU,MAAV,CAA1D,CAAN,CAEF,MAAO6S,EAAA,CAAME,CAAN,CAJ8B,CAMrC,GAAI,CAGF,MAFAvJ,EAAArJ,QAAA,CAAa4S,CAAb,CAEO,CADPF,CAAA,CAAME,CAAN,CACO,CADcC,CACd,CAAAH,CAAA,CAAME,CAAN,CAAA,CAAqBjJ,CAAA,CAAQiJ,CAAR,CAH1B,CAAJ,OAIU,CACRvJ,CAAAwC,MAAA,EADQ,CAXmB,CAiBjCnE,QAASA,EAAM,CAAC7D,CAAD,CAAKD,CAAL,CAAWkP,CAAX,CAAkB,CAAA,IAC3BC,EAAO,EADoB,CAE3BrC,EAAUD,EAAA,CAAS5M,CAAT,CAFiB,CAG3BzF,CAH2B,CAGnBgB,CAHmB,CAI3BT,CAEAS,EAAA,CAAI,CAAR,KAAWhB,CAAX,CAAoBsS,CAAAtS,OAApB,CAAoCgB,CAApC,CAAwChB,CAAxC,CAAgDgB,CAAA,EAAhD,CAAqD,CACnDT,CAAA,CAAM+R,CAAA,CAAQtR,CAAR,CACN,IAAmB,QAAnB,GAAI,MAAOT,EAAX,CACE,KAAMiL,GAAA,CAAgB,MAAhB,CAA+FjL,CAA/F,CAAN,CAEFoU,CAAA9T,KAAA,CACE6T,CACA,EADUA,CAAAjU,eAAA,CAAsBF,CAAtB,CACV,CAAEmU,CAAA,CAAOnU,CAAP,CAAF,CACEgU,CAAA,CAAWhU,CAAX,CAHJ,CALmD,CAWhDkF,CAAA6M,QAAL,GAEE7M,CAFF,CAEOA,CAAA,CAAGzF,CAAH,CAFP,CAOA,QAAQwF,CAAA,CAAQ,EAAR,CAAYmP,CAAA3U,OAApB,EACE,KAAM,CAAN,CAAS,MAAOyF,EAAA,EAChB,MAAM,CAAN,CAAS,MAAOA,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB;AAA8BA,CAAA,CAAK,CAAL,CAA9B,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAAgDA,CAAA,CAAK,CAAL,CAAhD,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAAgDA,CAAA,CAAK,CAAL,CAAhD,CAAyDA,CAAA,CAAK,CAAL,CAAzD,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAAgDA,CAAA,CAAK,CAAL,CAAhD,CAAyDA,CAAA,CAAK,CAAL,CAAzD,CAAkEA,CAAA,CAAK,CAAL,CAAlE,CAChB,MAAM,CAAN,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAAgDA,CAAA,CAAK,CAAL,CAAhD,CAAyDA,CAAA,CAAK,CAAL,CAAzD,CAAkEA,CAAA,CAAK,CAAL,CAAlE,CAA2EA,CAAA,CAAK,CAAL,CAA3E,CAChB,MAAK,EAAL,CAAS,MAAOlP,EAAA,CAAGkP,CAAA,CAAK,CAAL,CAAH,CAAYA,CAAA,CAAK,CAAL,CAAZ,CAAqBA,CAAA,CAAK,CAAL,CAArB,CAA8BA,CAAA,CAAK,CAAL,CAA9B,CAAuCA,CAAA,CAAK,CAAL,CAAvC,CAAgDA,CAAA,CAAK,CAAL,CAAhD,CAAyDA,CAAA,CAAK,CAAL,CAAzD,CAAkEA,CAAA,CAAK,CAAL,CAAlE,CAA2EA,CAAA,CAAK,CAAL,CAA3E,CAAoFA,CAAA,CAAK,CAAL,CAApF,CAChB,SAAS,MAAOlP,EAAAtC,MAAA,CAASqC,CAAT,CAAemP,CAAf,CAZlB,CAxB+B,CAqDjC,MAAO,QACGrL,CADH,aAbP+J,QAAoB,CAACuB,CAAD,CAAOF,CAAP,CAAe,CAAA,IAC7BG,EAAcA,QAAQ,EAAG,EADI,CAEnBC,CAIdD,EAAAE,UAAA,CAAyBA,CAAA5U,CAAA,CAAQyU,CAAR,CAAA,CAAgBA,CAAA,CAAKA,CAAA5U,OAAL,CAAmB,CAAnB,CAAhB,CAAwC4U,CAAxCG,WACzBC,EAAA,CAAW,IAAIH,CACfC,EAAA,CAAgBxL,CAAA,CAAOsL,CAAP,CAAaI,CAAb,CAAuBN,CAAvB,CAEhB,OAAO3R,EAAA,CAAS+R,CAAT,CAAA;AAA0BA,CAA1B,CAA0CE,CAVhB,CAa5B,KAGAT,CAHA,UAIKlC,EAJL,KAKA4C,QAAQ,CAACxM,CAAD,CAAO,CAClB,MAAO8K,EAAA9S,eAAA,CAA6BgI,CAA7B,CAAoC+K,CAApC,CAAP,EAA8Dc,CAAA7T,eAAA,CAAqBgI,CAArB,CAD5C,CALf,CAxEuC,CAjIX,IACjCgM,EAAgB,EADiB,CAEjCjB,EAAiB,UAFgB,CAGjCvI,EAAO,EAH0B,CAIjC0I,EAAgB,IAAIxB,EAJa,CAKjCoB,EAAgB,UACJ,UACIN,CAAA,CAAcpH,CAAd,CADJ,SAEGoH,CAAA,CAAc1H,CAAd,CAFH,SAGG0H,CAAA,CAiDnBiC,QAAgB,CAACzM,CAAD,CAAOqC,CAAP,CAAoB,CAClC,MAAOS,EAAA,CAAQ9C,CAAR,CAAc,CAAC,WAAD,CAAc,QAAQ,CAAC0M,CAAD,CAAY,CACrD,MAAOA,EAAA9B,YAAA,CAAsBvI,CAAtB,CAD8C,CAAlC,CAAd,CAD2B,CAjDjB,CAHH,OAICmI,CAAA,CAsDjB9R,QAAc,CAACsH,CAAD,CAAOtH,CAAP,CAAc,CAAE,MAAOoK,EAAA,CAAQ9C,CAAR,CAAc7F,EAAA,CAAQzB,CAAR,CAAd,CAAT,CAtDX,CAJD,UAKI8R,CAAA,CAuDpBmC,QAAiB,CAAC3M,CAAD,CAAOtH,CAAP,CAAc,CAC7B4J,EAAA,CAAwBtC,CAAxB,CAA8B,UAA9B,CACA8K,EAAA,CAAc9K,CAAd,CAAA,CAAsBtH,CACtBkU,EAAA,CAAc5M,CAAd,CAAA,CAAsBtH,CAHO,CAvDX,CALJ,WAkEhBmU,QAAkB,CAACd,CAAD,CAAce,CAAd,CAAuB,CAAA,IACnCC,EAAepC,CAAAQ,IAAA,CAAqBY,CAArB,CAAmChB,CAAnC,CADoB,CAEnCiC,EAAWD,CAAAlC,KAEfkC,EAAAlC,KAAA,CAAoBoC,QAAQ,EAAG,CAC7B,IAAIC,EAAeC,CAAAtM,OAAA,CAAwBmM,CAAxB,CAAkCD,CAAlC,CACnB,OAAOI,EAAAtM,OAAA,CAAwBiM,CAAxB,CAAiC,IAAjC,CAAuC,WAAYI,CAAZ,CAAvC,CAFsB,CAJQ,CAlEzB,CADI,CALiB,CAejCvC,EAAoBG,CAAA4B,UAApB/B,CACIiB,CAAA,CAAuBd,CAAvB;AAAsC,QAAQ,EAAG,CAC/C,KAAM/H,GAAA,CAAgB,MAAhB,CAAiDP,CAAAxJ,KAAA,CAAU,MAAV,CAAjD,CAAN,CAD+C,CAAjD,CAhB6B,CAmBjC4T,EAAgB,EAnBiB,CAoBjCO,EAAoBP,CAAAF,UAApBS,CACIvB,CAAA,CAAuBgB,CAAvB,CAAsC,QAAQ,CAACQ,CAAD,CAAc,CACtDhK,CAAAA,CAAWuH,CAAAQ,IAAA,CAAqBiC,CAArB,CAAmCrC,CAAnC,CACf,OAAOoC,EAAAtM,OAAA,CAAwBuC,CAAAyH,KAAxB,CAAuCzH,CAAvC,CAFmD,CAA5D,CAMRzL,EAAA,CAAQsT,CAAA,CAAYV,CAAZ,CAAR,CAAoC,QAAQ,CAACvN,CAAD,CAAK,CAAEmQ,CAAAtM,OAAA,CAAwB7D,CAAxB,EAA8BhD,CAA9B,CAAF,CAAjD,CAEA,OAAOmT,EA7B8B,CAsQvCE,QAASA,GAAqB,EAAG,CAE/B,IAAIC,EAAuB,CAAA,CAE3B,KAAAC,qBAAA,CAA4BC,QAAQ,EAAG,CACrCF,CAAA,CAAuB,CAAA,CADc,CAIvC,KAAAzC,KAAA,CAAY,CAAC,SAAD,CAAY,WAAZ,CAAyB,YAAzB,CAAuC,QAAQ,CAAC4C,CAAD,CAAUC,CAAV,CAAqBC,CAArB,CAAiC,CAO1FC,QAASA,EAAc,CAACtS,CAAD,CAAO,CAC5B,IAAIuS,EAAS,IACblW,EAAA,CAAQ2D,CAAR,CAAc,QAAQ,CAAC4C,CAAD,CAAU,CACzB2P,CAAL,EAA+C,GAA/C,GAAe7P,CAAA,CAAUE,CAAAjD,SAAV,CAAf,GAAoD4S,CAApD,CAA6D3P,CAA7D,CAD8B,CAAhC,CAGA,OAAO2P,EALqB,CAQ9BC,QAASA,EAAM,EAAG,CAAA,IACZC,EAAOL,CAAAK,KAAA,EADK,CACaC,CAGxBD,EAAL,CAGK,CAAKC,CAAL,CAAW/W,CAAAgJ,eAAA,CAAwB8N,CAAxB,CAAX,EAA2CC,CAAAC,eAAA,EAA3C,CAGA,CAAKD,CAAL,CAAWJ,CAAA,CAAe3W,CAAAiX,kBAAA,CAA2BH,CAA3B,CAAf,CAAX,EAA8DC,CAAAC,eAAA,EAA9D;AAGa,KAHb,GAGIF,CAHJ,EAGoBN,CAAAU,SAAA,CAAiB,CAAjB,CAAoB,CAApB,CATzB,CAAWV,CAAAU,SAAA,CAAiB,CAAjB,CAAoB,CAApB,CAJK,CAdlB,IAAIlX,EAAWwW,CAAAxW,SAgCXqW,EAAJ,EACEK,CAAA5R,OAAA,CAAkBqS,QAAwB,EAAG,CAAC,MAAOV,EAAAK,KAAA,EAAR,CAA7C,CACEM,QAA8B,EAAG,CAC/BV,CAAA7R,WAAA,CAAsBgS,CAAtB,CAD+B,CADnC,CAMF,OAAOA,EAxCmF,CAAhF,CARmB,CAwQjCQ,QAASA,GAAO,CAACtX,CAAD,CAASC,CAAT,CAAmBsX,CAAnB,CAAyBC,CAAzB,CAAmC,CAsBjDC,QAASA,EAA0B,CAACzR,CAAD,CAAK,CACtC,GAAI,CACFA,CAAAtC,MAAA,CAAS,IAAT,CA70FGwC,EAAAjF,KAAA,CA60FsBwB,SA70FtB,CA60FiC0D,CA70FjC,CA60FH,CADE,CAAJ,OAEU,CAER,GADAuR,CAAA,EACI,CAA4B,CAA5B,GAAAA,CAAJ,CACE,IAAA,CAAMC,CAAApX,OAAN,CAAA,CACE,GAAI,CACFoX,CAAAC,IAAA,EAAA,EADE,CAEF,MAAOtQ,CAAP,CAAU,CACViQ,CAAAM,MAAA,CAAWvQ,CAAX,CADU,CANR,CAH4B,CAoExCwQ,QAASA,EAAW,CAACC,CAAD,CAAWC,CAAX,CAAuB,CACxCC,SAASA,GAAK,EAAG,CAChBtX,CAAA,CAAQuX,CAAR,CAAiB,QAAQ,CAACC,CAAD,CAAQ,CAAEA,CAAA,EAAF,CAAjC,CACAC,EAAA,CAAcJ,CAAA,CAAWC,EAAX,CAAkBF,CAAlB,CAFE,CAAjBE,CAAA,EADwC,CAuE3CI,QAASA,EAAa,EAAG,CACvBC,CAAA,CAAc,IACVC,EAAJ,EAAsBxS,CAAAyS,IAAA,EAAtB,GAEAD,CACA,CADiBxS,CAAAyS,IAAA,EACjB,CAAA7X,CAAA,CAAQ8X,CAAR,CAA4B,QAAQ,CAACC,CAAD,CAAW,CAC7CA,CAAA,CAAS3S,CAAAyS,IAAA,EAAT,CAD6C,CAA/C,CAHA,CAFuB,CAjKwB,IAC7CzS,EAAO,IADsC,CAE7C4S,EAAc1Y,CAAA,CAAS,CAAT,CAF+B,CAG7C2D,EAAW5D,CAAA4D,SAHkC,CAI7CgV,EAAU5Y,CAAA4Y,QAJmC,CAK7CZ,EAAahY,CAAAgY,WALgC,CAM7Ca,EAAe7Y,CAAA6Y,aAN8B;AAO7CC,EAAkB,EAEtB/S,EAAAgT,OAAA,CAAc,CAAA,CAEd,KAAIrB,EAA0B,CAA9B,CACIC,EAA8B,EAGlC5R,EAAAiT,6BAAA,CAAoCvB,CACpC1R,EAAAkT,6BAAA,CAAoCC,QAAQ,EAAG,CAAExB,CAAA,EAAF,CA6B/C3R,EAAAoT,gCAAA,CAAuCC,QAAQ,CAACC,CAAD,CAAW,CAIxD1Y,CAAA,CAAQuX,CAAR,CAAiB,QAAQ,CAACC,CAAD,CAAQ,CAAEA,CAAA,EAAF,CAAjC,CAEgC,EAAhC,GAAIT,CAAJ,CACE2B,CAAA,EADF,CAGE1B,CAAAvW,KAAA,CAAiCiY,CAAjC,CATsD,CA7CT,KA6D7CnB,EAAU,EA7DmC,CA8D7CE,CAcJrS,EAAAuT,UAAA,CAAiBC,QAAQ,CAACvT,CAAD,CAAK,CACxB5C,CAAA,CAAYgV,CAAZ,CAAJ,EAA8BN,CAAA,CAAY,GAAZ,CAAiBE,CAAjB,CAC9BE,EAAA9W,KAAA,CAAa4E,CAAb,CACA,OAAOA,EAHqB,CA5EmB,KAqG7CuS,EAAiB3U,CAAA4V,KArG4B,CAsG7CC,EAAcxZ,CAAAkE,KAAA,CAAc,MAAd,CAtG+B,CAuG7CmU,EAAc,IAsBlBvS,EAAAyS,IAAA,CAAWkB,QAAQ,CAAClB,CAAD,CAAM7Q,CAAN,CAAe,CAE5B/D,CAAJ,GAAiB5D,CAAA4D,SAAjB,GAAkCA,CAAlC,CAA6C5D,CAAA4D,SAA7C,CAGA,IAAI4U,CAAJ,CACE,IAAID,CAAJ,EAAsBC,CAAtB,CAiBA,MAhBAD,EAgBOxS,CAhBUyS,CAgBVzS,CAfHyR,CAAAoB,QAAJ,CACMjR,CAAJ,CAAaiR,CAAAe,aAAA,CAAqB,IAArB,CAA2B,EAA3B,CAA+BnB,CAA/B,CAAb,EAEEI,CAAAgB,UAAA,CAAkB,IAAlB,CAAwB,EAAxB,CAA4BpB,CAA5B,CAEA,CAAAiB,CAAAnQ,KAAA,CAAiB,MAAjB,CAAyBmQ,CAAAnQ,KAAA,CAAiB,MAAjB,CAAzB,CAJF,CADF,EAQEgP,CACA,CADcE,CACd,CAAI7Q,CAAJ,CACE/D,CAAA+D,QAAA,CAAiB6Q,CAAjB,CADF,CAGE5U,CAAA4V,KAHF;AAGkBhB,CAZpB,CAeOzS,CAAAA,CAjBP,CADF,IAwBE,OAAOuS,EAAP,EAAsB1U,CAAA4V,KAAA7R,QAAA,CAAsB,MAAtB,CAA6B,GAA7B,CA7BQ,CA7He,KA8J7C8Q,EAAqB,EA9JwB,CA+J7CoB,GAAgB,CAAA,CAmCpB9T,EAAA+T,YAAA,CAAmBC,QAAQ,CAACV,CAAD,CAAW,CACpC,GAAI,CAACQ,EAAL,CAAoB,CAMlB,GAAIrC,CAAAoB,QAAJ,CAAsBzR,CAAA,CAAOnH,CAAP,CAAAkE,GAAA,CAAkB,UAAlB,CAA8BmU,CAA9B,CAEtB,IAAIb,CAAAwC,WAAJ,CAAyB7S,CAAA,CAAOnH,CAAP,CAAAkE,GAAA,CAAkB,YAAlB,CAAgCmU,CAAhC,CAAzB,KAEKtS,EAAAuT,UAAA,CAAejB,CAAf,CAELwB,GAAA,CAAgB,CAAA,CAZE,CAepBpB,CAAArX,KAAA,CAAwBiY,CAAxB,CACA,OAAOA,EAjB6B,CAkCtCtT,EAAAkU,SAAA,CAAgBC,QAAQ,EAAG,CACzB,IAAIV,EAAOC,CAAAnQ,KAAA,CAAiB,MAAjB,CACX,OAAOkQ,EAAA,CAAOA,CAAA7R,QAAA,CAAa,qBAAb,CAAoC,EAApC,CAAP,CAAiD,EAF/B,CAQ3B,KAAIwS,EAAc,EAAlB,CACIC,GAAmB,EADvB,CAEIC,GAAatU,CAAAkU,SAAA,EAsBjBlU,EAAAuU,QAAA,CAAeC,QAAQ,CAACvR,CAAD,CAAOtH,CAAP,CAAc,CAAA,IAC/B8Y,CAD+B,CACJC,CADI,CACIlZ,CADJ,CACOK,CAE1C,IAAIoH,CAAJ,CACMtH,CAAJ,GAAcxB,CAAd,CACEyY,CAAA8B,OADF,CACuBC,MAAA,CAAO1R,CAAP,CADvB,CACsC,SADtC,CACkDqR,EADlD,CAC+D,wCAD/D,CAGM5Z,CAAA,CAASiB,CAAT,CAHN,GAII8Y,CAMA,CANgBja,CAAAoY,CAAA8B,OAAAla,CAAqBma,MAAA,CAAO1R,CAAP,CAArBzI,CAAoC,GAApCA,CAA0Cma,MAAA,CAAOhZ,CAAP,CAA1CnB;AAA0D,QAA1DA,CAAqE8Z,EAArE9Z,QAMhB,CAN0G,CAM1G,CAAmB,IAAnB,CAAIia,CAAJ,EACEjD,CAAAoD,KAAA,CAAU,UAAV,CAAsB3R,CAAtB,CAA4B,6DAA5B,CACEwR,CADF,CACiB,iBADjB,CAXN,CADF,KAiBO,CACL,GAAI7B,CAAA8B,OAAJ,GAA2BL,EAA3B,CAKE,IAJAA,EAIK,CAJczB,CAAA8B,OAId,CAHLG,CAGK,CAHSR,EAAAnS,MAAA,CAAuB,IAAvB,CAGT,CAFLkS,CAEK,CAFS,EAET,CAAA5Y,CAAA,CAAI,CAAT,CAAYA,CAAZ,CAAgBqZ,CAAAra,OAAhB,CAAoCgB,CAAA,EAApC,CACEkZ,CAEA,CAFSG,CAAA,CAAYrZ,CAAZ,CAET,CADAK,CACA,CADQ6Y,CAAAlW,QAAA,CAAe,GAAf,CACR,CAAY,CAAZ,CAAI3C,CAAJ,GACMoH,CAIJ,CAJW6R,QAAA,CAASJ,CAAAK,UAAA,CAAiB,CAAjB,CAAoBlZ,CAApB,CAAT,CAIX,CAAIuY,CAAA,CAAYnR,CAAZ,CAAJ,GAA0B9I,CAA1B,GACEia,CAAA,CAAYnR,CAAZ,CADF,CACsB6R,QAAA,CAASJ,CAAAK,UAAA,CAAiBlZ,CAAjB,CAAyB,CAAzB,CAAT,CADtB,CALF,CAWJ,OAAOuY,EApBF,CApB4B,CA4DrCpU,EAAAgV,MAAA,CAAaC,QAAQ,CAAChV,CAAD,CAAKiV,CAAL,CAAY,CAC/B,IAAIC,CACJxD,EAAA,EACAwD,EAAA,CAAYlD,CAAA,CAAW,QAAQ,EAAG,CAChC,OAAOc,CAAA,CAAgBoC,CAAhB,CACPzD,EAAA,CAA2BzR,CAA3B,CAFgC,CAAtB,CAGTiV,CAHS,EAGA,CAHA,CAIZnC,EAAA,CAAgBoC,CAAhB,CAAA,CAA6B,CAAA,CAC7B,OAAOA,EARwB,CAsBjCnV,EAAAgV,MAAAI,OAAA,CAAoBC,QAAQ,CAACC,CAAD,CAAU,CACpC,MAAIvC,EAAA,CAAgBuC,CAAhB,CAAJ,EACE,OAAOvC,CAAA,CAAgBuC,CAAhB,CAGA,CAFPxC,CAAA,CAAawC,CAAb,CAEO,CADP5D,CAAA,CAA2BzU,CAA3B,CACO,CAAA,CAAA,CAJT,EAMO,CAAA,CAP6B,CAtVW,CAkWnDsY,QAASA,GAAgB,EAAE,CACzB,IAAAzH,KAAA;AAAY,CAAC,SAAD,CAAY,MAAZ,CAAoB,UAApB,CAAgC,WAAhC,CACR,QAAQ,CAAE4C,CAAF,CAAac,CAAb,CAAqBC,CAArB,CAAiC+D,CAAjC,CAA2C,CACjD,MAAO,KAAIjE,EAAJ,CAAYb,CAAZ,CAAqB8E,CAArB,CAAgChE,CAAhC,CAAsCC,CAAtC,CAD0C,CAD3C,CADa,CA2C3BgE,QAASA,GAAqB,EAAG,CAE/B,IAAA3H,KAAA,CAAY4H,QAAQ,EAAG,CAGrBC,QAASA,EAAY,CAACC,CAAD,CAAUC,CAAV,CAAmB,CAmFtCC,QAASA,EAAO,CAACC,CAAD,CAAQ,CAClBA,CAAJ,EAAaC,CAAb,GACOC,CAAL,CAEWA,CAFX,EAEuBF,CAFvB,GAGEE,CAHF,CAGaF,CAAAG,EAHb,EACED,CADF,CACaF,CAQb,CAHAI,CAAA,CAAKJ,CAAAG,EAAL,CAAcH,CAAAK,EAAd,CAGA,CAFAD,CAAA,CAAKJ,CAAL,CAAYC,CAAZ,CAEA,CADAA,CACA,CADWD,CACX,CAAAC,CAAAE,EAAA,CAAa,IAVf,CADsB,CAmBxBC,QAASA,EAAI,CAACE,CAAD,CAAYC,CAAZ,CAAuB,CAC9BD,CAAJ,EAAiBC,CAAjB,GACMD,CACJ,GADeA,CAAAD,EACf,CAD6BE,CAC7B,EAAIA,CAAJ,GAAeA,CAAAJ,EAAf,CAA6BG,CAA7B,CAFF,CADkC,CArGpC,GAAIT,CAAJ,GAAeW,EAAf,CACE,KAAMnc,EAAA,CAAO,eAAP,CAAA,CAAwB,KAAxB,CAAkEwb,CAAlE,CAAN,CAFoC,IAKlCY,EAAO,CAL2B,CAMlCC,EAAQja,CAAA,CAAO,EAAP,CAAWqZ,CAAX,CAAoB,IAAKD,CAAL,CAApB,CAN0B,CAOlCzR,EAAO,EAP2B,CAQlCuS,EAAYb,CAAZa,EAAuBb,CAAAa,SAAvBA,EAA4CC,MAAAC,UARV,CASlCC,EAAU,EATwB,CAUlCb,EAAW,IAVuB,CAWlCC,EAAW,IAEf,OAAOM,EAAA,CAAOX,CAAP,CAAP,CAAyB,KAElBhJ,QAAQ,CAAC7R,CAAD,CAAMY,CAAN,CAAa,CACxB,IAAImb,EAAWD,CAAA,CAAQ9b,CAAR,CAAX+b,GAA4BD,CAAA,CAAQ9b,CAAR,CAA5B+b,CAA2C,KAAM/b,CAAN,CAA3C+b,CAEJhB,EAAA,CAAQgB,CAAR,CAEA,IAAI,CAAAzZ,CAAA,CAAY1B,CAAZ,CAAJ,CAQA,MAPMZ,EAOCY,GAPMwI,EAONxI,EAPa6a,CAAA,EAOb7a,CANPwI,CAAA,CAAKpJ,CAAL,CAMOY,CANKA,CAMLA,CAJH6a,CAIG7a,CAJI+a,CAIJ/a,EAHL,IAAAob,OAAA,CAAYd,CAAAlb,IAAZ,CAGKY;AAAAA,CAbiB,CAFH,KAmBlByS,QAAQ,CAACrT,CAAD,CAAM,CACjB,IAAI+b,EAAWD,CAAA,CAAQ9b,CAAR,CAEf,IAAK+b,CAAL,CAIA,MAFAhB,EAAA,CAAQgB,CAAR,CAEO,CAAA3S,CAAA,CAAKpJ,CAAL,CAPU,CAnBI,QA8Bfgc,QAAQ,CAAChc,CAAD,CAAM,CACpB,IAAI+b,EAAWD,CAAA,CAAQ9b,CAAR,CAEV+b,EAAL,GAEIA,CAMJ,EANgBd,CAMhB,GAN0BA,CAM1B,CANqCc,CAAAV,EAMrC,EALIU,CAKJ,EALgBb,CAKhB,GAL0BA,CAK1B,CALqCa,CAAAZ,EAKrC,EAJAC,CAAA,CAAKW,CAAAZ,EAAL,CAAgBY,CAAAV,EAAhB,CAIA,CAFA,OAAOS,CAAA,CAAQ9b,CAAR,CAEP,CADA,OAAOoJ,CAAA,CAAKpJ,CAAL,CACP,CAAAyb,CAAA,EARA,CAHoB,CA9BC,WA6CZQ,QAAQ,EAAG,CACpB7S,CAAA,CAAO,EACPqS,EAAA,CAAO,CACPK,EAAA,CAAU,EACVb,EAAA,CAAWC,CAAX,CAAsB,IAJF,CA7CC,SAqDdgB,QAAQ,EAAG,CAGlBJ,CAAA,CADAJ,CACA,CAFAtS,CAEA,CAFO,IAGP,QAAOoS,CAAA,CAAOX,CAAP,CAJW,CArDG,MA6DjBsB,QAAQ,EAAG,CACf,MAAO1a,EAAA,CAAO,EAAP,CAAWia,CAAX,CAAkB,MAAOD,CAAP,CAAlB,CADQ,CA7DM,CAba,CAFxC,IAAID,EAAS,EA2HbZ,EAAAuB,KAAA,CAAoBC,QAAQ,EAAG,CAC7B,IAAID,EAAO,EACXtc,EAAA,CAAQ2b,CAAR,CAAgB,QAAQ,CAACzH,CAAD,CAAQ8G,CAAR,CAAiB,CACvCsB,CAAA,CAAKtB,CAAL,CAAA,CAAgB9G,CAAAoI,KAAA,EADuB,CAAzC,CAGA,OAAOA,EALsB,CAoB/BvB,EAAAvH,IAAA,CAAmBgJ,QAAQ,CAACxB,CAAD,CAAU,CACnC,MAAOW,EAAA,CAAOX,CAAP,CAD4B,CAKrC,OAAOD,EArJc,CAFQ,CAyMjC0B,QAASA,GAAsB,EAAG,CAChC,IAAAvJ,KAAA,CAAY,CAAC,eAAD,CAAkB,QAAQ,CAACwJ,CAAD,CAAgB,CACpD,MAAOA,EAAA,CAAc,WAAd,CAD6C,CAA1C,CADoB,CA0JlCC,QAASA,GAAgB,CAAC3T,CAAD,CAAW,CAAA,IAC9B4T;AAAgB,EADc,CAE9BC,EAAS,WAFqB,CAG9BC,EAA2B,wCAHG,CAI9BC,EAAyB,gCAJK,CAK9BC,EAA6B,mCALC,CAM9BC,EAA8B,qCANA,CAW9BC,EAA4B,yBAkB/B,KAAAC,UAAA,CAAiBC,QAASC,EAAiB,CAAChV,CAAD,CAAOiV,CAAP,CAAyB,CACnE3S,EAAA,CAAwBtC,CAAxB,CAA8B,WAA9B,CACIvI,EAAA,CAASuI,CAAT,CAAJ,EACEgC,EAAA,CAAUiT,CAAV,CAA4B,kBAA5B,CA2BA,CA1BKV,CAAAvc,eAAA,CAA6BgI,CAA7B,CA0BL,GAzBEuU,CAAA,CAAcvU,CAAd,CACA,CADsB,EACtB,CAAAW,CAAAmC,QAAA,CAAiB9C,CAAjB,CAAwBwU,CAAxB,CAAgC,CAAC,WAAD,CAAc,mBAAd,CAC9B,QAAQ,CAAC9H,CAAD,CAAYwI,CAAZ,CAA+B,CACrC,IAAIC,EAAa,EACjBxd,EAAA,CAAQ4c,CAAA,CAAcvU,CAAd,CAAR,CAA6B,QAAQ,CAACiV,CAAD,CAAmBrc,CAAnB,CAA0B,CAC7D,GAAI,CACF,IAAIkc,EAAYpI,CAAA7L,OAAA,CAAiBoU,CAAjB,CACZld,EAAA,CAAW+c,CAAX,CAAJ,CACEA,CADF,CACc,SAAW3a,EAAA,CAAQ2a,CAAR,CAAX,CADd,CAEY/T,CAAA+T,CAAA/T,QAFZ,EAEiC+T,CAAA5B,KAFjC,GAGE4B,CAAA/T,QAHF,CAGsB5G,EAAA,CAAQ2a,CAAA5B,KAAR,CAHtB,CAKA4B,EAAAM,SAAA;AAAqBN,CAAAM,SAArB,EAA2C,CAC3CN,EAAAlc,MAAA,CAAkBA,CAClBkc,EAAA9U,KAAA,CAAiB8U,CAAA9U,KAAjB,EAAmCA,CACnC8U,EAAAO,QAAA,CAAoBP,CAAAO,QAApB,EAA0CP,CAAAQ,WAA1C,EAAkER,CAAA9U,KAClE8U,EAAAS,SAAA,CAAqBT,CAAAS,SAArB,EAA2C,GAC3CJ,EAAA/c,KAAA,CAAgB0c,CAAhB,CAZE,CAaF,MAAOxW,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CAdiD,CAA/D,CAkBA,OAAO6W,EApB8B,CADT,CAAhC,CAwBF,EAAAZ,CAAA,CAAcvU,CAAd,CAAA5H,KAAA,CAAyB6c,CAAzB,CA5BF,EA8BEtd,CAAA,CAAQqI,CAAR,CAAcxH,EAAA,CAAcwc,CAAd,CAAd,CAEF,OAAO,KAlC4D,CA2DrE,KAAAL,2BAAA,CAAkCa,QAAQ,CAACC,CAAD,CAAS,CACjD,MAAIpb,EAAA,CAAUob,CAAV,CAAJ,EACEd,CACO,CADsBc,CACtB,CAAA,IAFT,EAIOd,CAL0C,CA8BnD,KAAAC,4BAAA,CAAmCc,QAAQ,CAACD,CAAD,CAAS,CAClD,MAAIpb,EAAA,CAAUob,CAAV,CAAJ,EACEb,CACO,CADuBa,CACvB,CAAA,IAFT,EAIOb,CAL2C,CASpD,KAAA/J,KAAA,CAAY,CACF,WADE,CACW,cADX,CAC2B,mBAD3B,CACgD,OADhD,CACyD,gBADzD,CAC2E,QAD3E,CAEF,aAFE,CAEa,YAFb,CAE2B,WAF3B,CAEwC,MAFxC,CAEgD,UAFhD,CAGV,QAAQ,CAAC6B,CAAD,CAAciJ,CAAd,CAA8BT,CAA9B,CAAmDU,CAAnD,CAA4DC,CAA5D,CAA8EC,CAA9E,CACCC,CADD;AACgBpI,CADhB,CAC8B4E,CAD9B,CAC2CyD,CAD3C,CACmDC,CADnD,CAC6D,CA8LrElV,QAASA,EAAO,CAACmV,CAAD,CAAgBC,CAAhB,CAA8BC,CAA9B,CAA2CC,CAA3C,CAA4DC,CAA5D,CAAoF,CAC5FJ,CAAN,WAA+B/X,EAA/B,GAEE+X,CAFF,CAEkB/X,CAAA,CAAO+X,CAAP,CAFlB,CAMAve,EAAA,CAAQue,CAAR,CAAuB,QAAQ,CAAClb,CAAD,CAAOpC,CAAP,CAAa,CACrB,CAArB,EAAIoC,CAAAxD,SAAJ,EAA0CwD,CAAAub,UAAA7X,MAAA,CAAqB,KAArB,CAA1C,GACEwX,CAAA,CAActd,CAAd,CADF,CACgCuF,CAAA,CAAOnD,CAAP,CAAAwb,KAAA,CAAkB,eAAlB,CAAA1c,OAAA,EAAA,CAA4C,CAA5C,CADhC,CAD0C,CAA5C,CAKA,KAAI2c,EAAkBC,EAAA,CAAaR,CAAb,CAA4BC,CAA5B,CAA0CD,CAA1C,CAAyDE,CAAzD,CAAsEC,CAAtE,CAAuFC,CAAvF,CACtB,OAAOK,SAAqB,CAAC7V,CAAD,CAAQ8V,CAAR,CAAuB,CACjD5U,EAAA,CAAUlB,CAAV,CAAiB,OAAjB,CAQA,KALA,IAAI+V,EAAYD,CACA,CAAZE,EAAA1Y,MAAAnG,KAAA,CAA2Bie,CAA3B,CAAY,CACZA,CAFJ,CAKQ3d,EAAI,CALZ,CAKeiT,EAAKqL,CAAAtf,OAApB,CAAsCgB,CAAtC,CAAwCiT,CAAxC,CAA4CjT,CAAA,EAA5C,CAAiD,CAC/C,IAAIyC,EAAO6b,CAAA,CAAUte,CAAV,CACU,EAArB,EAAIyC,CAAAxD,SAAJ,EAAyD,CAAzD,EAAwCwD,CAAAxD,SAAxC,EACEqf,CAAAE,GAAA,CAAaxe,CAAb,CAAA2I,KAAA,CAAqB,QAArB,CAA+BJ,CAA/B,CAH6C,CAMjDkW,CAAA,CAAaH,CAAb,CAAwB,UAAxB,CACID,EAAJ,EAAoBA,CAAA,CAAeC,CAAf,CAA0B/V,CAA1B,CAChB2V,EAAJ,EAAqBA,CAAA,CAAgB3V,CAAhB,CAAuB+V,CAAvB,CAAkCA,CAAlC,CACrB,OAAOA,EAlB0C,CAb+C,CAmCpGG,QAASA,EAAY,CAACC,CAAD,CAAW7W,CAAX,CAAsB,CACzC,GAAI,CACF6W,CAAAC,SAAA,CAAkB9W,CAAlB,CADE,CAEF,MAAM9B,CAAN,CAAS,EAH8B,CAwB3CoY,QAASA,GAAY,CAACS,CAAD,CAAWhB,CAAX,CAAyBiB,CAAzB,CAAuChB,CAAvC,CAAoDC,CAApD,CAAqEC,CAArE,CAA6F,CA4BhHG,QAASA,EAAe,CAAC3V,CAAD,CAAQqW,CAAR,CAAkBC,CAAlB,CAAgCC,CAAhC,CAAmD,CAAA,IACzDC,CADyD,CAC5Ctc,CAD4C,CACtCuc,CADsC,CAC1BC,CAD0B,CACPjf,CADO,CACJiT,CADI,CACAyH,CADA,CAIrEwE,EAAiB,EAChBlf;CAAA,CAAI,CAAT,KAAYiT,CAAZ,CAAiB2L,CAAA5f,OAAjB,CAAkCgB,CAAlC,CAAsCiT,CAAtC,CAA0CjT,CAAA,EAA1C,CACEkf,CAAArf,KAAA,CAAoB+e,CAAA,CAAS5e,CAAT,CAApB,CAGS0a,EAAP,CAAA1a,CAAA,CAAI,CAAR,KAAkBiT,CAAlB,CAAuBkM,CAAAngB,OAAvB,CAAuCgB,CAAvC,CAA2CiT,CAA3C,CAA+CyH,CAAA,EAA/C,CACEjY,CAIA,CAJOyc,CAAA,CAAexE,CAAf,CAIP,CAHA0E,CAGA,CAHaD,CAAA,CAAQnf,CAAA,EAAR,CAGb,CAFA+e,CAEA,CAFcI,CAAA,CAAQnf,CAAA,EAAR,CAEd,CAAIof,CAAJ,EACMA,CAAA7W,MAAJ,EACEyW,CACA,CADazW,CAAA8W,KAAA,CAAWtd,CAAA,CAASqd,CAAA7W,MAAT,CAAX,CACb,CAAA3C,CAAA,CAAOnD,CAAP,CAAAkG,KAAA,CAAkB,QAAlB,CAA4BqW,CAA5B,CAFF,EAIEA,CAJF,CAIezW,CAGf,CAAA,CADA0W,CACA,CADoBG,CAAAE,WACpB,GAA2BR,CAAAA,CAA3B,EAAgDlB,CAAhD,CACEwB,CAAA,CAAWL,CAAX,CAAwBC,CAAxB,CAAoCvc,CAApC,CAA0Coc,CAA1C,CACK,QAAQ,CAACjB,CAAD,CAAe,CACtB,MAAO,SAAQ,CAAC2B,CAAD,CAAU,CACvB,IAAIC,EAAkBjX,CAAA8W,KAAA,EACtBG,EAAAC,cAAA,CAAgC,CAAA,CAEhC,OAAO7B,EAAA,CAAa4B,CAAb,CAA8BD,CAA9B,CAAA5c,GAAA,CACA,UADA,CACY4B,EAAA,CAAKib,CAAL,CAAsBA,CAAA9Q,SAAtB,CADZ,CAJgB,CADH,CAAvB,CAQEuQ,CARF,EAQuBrB,CARvB,CADL,CADF,CAaEwB,CAAA,CAAWL,CAAX,CAAwBC,CAAxB,CAAoCvc,CAApC,CAA0C9D,CAA1C,CAAqDmgB,CAArD,CArBJ,EAuBWC,CAvBX,EAwBEA,CAAA,CAAYxW,CAAZ,CAAmB9F,CAAA8K,WAAnB,CAAoC5O,CAApC,CAA+CmgB,CAA/C,CAtCqE,CAxB3E,IAJgH,IAC5GK,EAAU,EADkG,CAEhGJ,CAFgG,CAEvEW,CAFuE,CAEhEC,CAFgE,CAIxG3f,EAAI,CAAZ,CAAeA,CAAf,CAAmB4e,CAAA5f,OAAnB,CAAoCgB,CAAA,EAApC,CACE0f,CAiBA,CAjBQ,IAAIE,CAiBZ,CAdAhD,CAcA,CAdaiD,CAAA,CAAkBjB,CAAA,CAAS5e,CAAT,CAAlB,CAA+B,EAA/B,CAAmC0f,CAAnC,CAA+C,CAAL,EAAA1f,CAAA,CAAS6d,CAAT,CAAuBlf,CAAjE,CAA4Emf,CAA5E,CAcb,CARAiB,CAQA,CAPc,CALdK,CAKc,CALAxC,CAAA5d,OACD,CAAP8gB,CAAA,CAAsBlD,CAAtB,CAAkCgC,CAAA,CAAS5e,CAAT,CAAlC,CAA+C0f,CAA/C,CAAsD9B,CAAtD,CAAoEiB,CAApE,CAAkF,IAAlF,CAAwF,EAAxF,CAA4F,EAA5F,CAAgGd,CAAhG,CAAO,CACP,IAGQ,GADeqB,CAAAW,SACf,EADsC,CAACnB,CAAA,CAAS5e,CAAT,CAAAuN,WACvC,EADiE,CAACqR,CAAA,CAAS5e,CAAT,CAAAuN,WAAAvO,OAClE;AAAR,IAAQ,CACRmf,EAAA,CAAaS,CAAA,CAAS5e,CAAT,CAAAuN,WAAb,CACG6R,CAAA,CAAaA,CAAAE,WAAb,CAAqC1B,CADxC,CAMN,CAHAuB,CAAAtf,KAAA,CAAauf,CAAb,CAGA,CAFAD,CAAAtf,KAAA,CAAakf,CAAb,CAEA,CADAY,CACA,CADeA,CACf,EAD8BP,CAC9B,EAD4CL,CAC5C,CAAAhB,CAAA,CAAyB,IAI3B,OAAO4B,EAAA,CAAczB,CAAd,CAAgC,IA1ByE,CAmFlH2B,QAASA,EAAiB,CAACpd,CAAD,CAAOma,CAAP,CAAmB8C,CAAnB,CAA0B7B,CAA1B,CAAuCC,CAAvC,CAAwD,CAAA,IAE5EkC,EAAWN,CAAAO,MAFiE,CAG5E9Z,CAGJ,QALe1D,CAAAxD,SAKf,EACE,KAAK,CAAL,CAEEihB,CAAA,CAAatD,CAAb,CACIuD,EAAA,CAAmBC,EAAA,CAAU3d,CAAV,CAAA+G,YAAA,EAAnB,CADJ,CACuD,GADvD,CAC4DqU,CAD5D,CACyEC,CADzE,CAFF,KAMW/V,CANX,CAMiBN,CANjB,CAMuB4Y,CAA0BC,EAAAA,CAAS7d,CAAAqF,WAAxD,KANF,IAOWyY,EAAI,CAPf,CAOkBC,EAAKF,CAALE,EAAeF,CAAAthB,OAD/B,CAC8CuhB,CAD9C,CACkDC,CADlD,CACsDD,CAAA,EADtD,CAC2D,CACzD,IAAIE,EAAgB,CAAA,CAApB,CACIC,EAAc,CAAA,CAElB3Y,EAAA,CAAOuY,CAAA,CAAOC,CAAP,CACP,IAAI,CAACxP,CAAL,EAAqB,CAArB,EAAaA,CAAb,EAA0BhJ,CAAA4Y,UAA1B,CAA0C,CACxClZ,CAAA,CAAOM,CAAAN,KAEPmZ,EAAA,CAAaT,EAAA,CAAmB1Y,CAAnB,CACToZ,GAAA/X,KAAA,CAAqB8X,CAArB,CAAJ,GACEnZ,CADF,CACS0B,EAAA,CAAWyX,CAAA7c,OAAA,CAAkB,CAAlB,CAAX,CAAiC,GAAjC,CADT,CAIA,KAAI+c,EAAiBF,CAAAxa,QAAA,CAAmB,cAAnB,CAAmC,EAAnC,CACjBwa,EAAJ,GAAmBE,CAAnB,CAAoC,OAApC,GACEL,CAEA,CAFgBhZ,CAEhB,CADAiZ,CACA,CADcjZ,CAAA1D,OAAA,CAAY,CAAZ,CAAe0D,CAAAzI,OAAf,CAA6B,CAA7B,CACd,CADgD,KAChD,CAAAyI,CAAA,CAAOA,CAAA1D,OAAA,CAAY,CAAZ,CAAe0D,CAAAzI,OAAf,CAA6B,CAA7B,CAHT,CAMAqhB,EAAA,CAAQF,EAAA,CAAmB1Y,CAAA+B,YAAA,EAAnB,CACRwW,EAAA,CAASK,CAAT,CAAA,CAAkB5Y,CAClBiY,EAAA,CAAMW,CAAN,CAAA;AAAelgB,CAAf,CAAuBoP,EAAA,CAAMwB,CACD,EADiB,MACjB,EADStJ,CACT,CAAxBnB,kBAAA,CAAmB7D,CAAAyM,aAAA,CAAkBzH,CAAlB,CAAwB,CAAxB,CAAnB,CAAwB,CACxBM,CAAA5H,MAFmB,CAGnB0P,GAAA,CAAmBpN,CAAnB,CAAyB4d,CAAzB,CAAJ,GACEX,CAAA,CAAMW,CAAN,CADF,CACiB,CAAA,CADjB,CAGAU,EAAA,CAA4Bte,CAA5B,CAAkCma,CAAlC,CAA8Czc,CAA9C,CAAqDkgB,CAArD,CACAH,EAAA,CAAatD,CAAb,CAAyByD,CAAzB,CAAgC,GAAhC,CAAqCxC,CAArC,CAAkDC,CAAlD,CAAmE2C,CAAnE,CAAkFC,CAAlF,CAxBwC,CALe,CAkC3D7Y,CAAA,CAAYpF,CAAAoF,UACZ,IAAI3I,CAAA,CAAS2I,CAAT,CAAJ,EAAyC,EAAzC,GAA2BA,CAA3B,CACE,IAAA,CAAO1B,CAAP,CAAegW,CAAAvU,KAAA,CAA4BC,CAA5B,CAAf,CAAA,CACEwY,CAIA,CAJQF,EAAA,CAAmBha,CAAA,CAAM,CAAN,CAAnB,CAIR,CAHI+Z,CAAA,CAAatD,CAAb,CAAyByD,CAAzB,CAAgC,GAAhC,CAAqCxC,CAArC,CAAkDC,CAAlD,CAGJ,GAFE4B,CAAA,CAAMW,CAAN,CAEF,CAFiB9Q,EAAA,CAAKpJ,CAAA,CAAM,CAAN,CAAL,CAEjB,EAAA0B,CAAA,CAAYA,CAAA9D,OAAA,CAAiBoC,CAAA9F,MAAjB,CAA+B8F,CAAA,CAAM,CAAN,CAAAnH,OAA/B,CAGhB,MACF,MAAK,CAAL,CACEgiB,CAAA,CAA4BpE,CAA5B,CAAwCna,CAAAub,UAAxC,CACA,MACF,MAAK,CAAL,CACE,GAAI,CAEF,GADA7X,CACA,CADQ+V,CAAAtU,KAAA,CAA8BnF,CAAAub,UAA9B,CACR,CACEqC,CACA,CADQF,EAAA,CAAmBha,CAAA,CAAM,CAAN,CAAnB,CACR,CAAI+Z,CAAA,CAAatD,CAAb,CAAyByD,CAAzB,CAAgC,GAAhC,CAAqCxC,CAArC,CAAkDC,CAAlD,CAAJ,GACE4B,CAAA,CAAMW,CAAN,CADF,CACiB9Q,EAAA,CAAKpJ,CAAA,CAAM,CAAN,CAAL,CADjB,CAJA,CAQF,MAAOJ,CAAP,CAAU,EAjEhB,CAwEA6W,CAAA9c,KAAA,CAAgBmhB,CAAhB,CACA,OAAOrE,EA/EyE,CAyFlFsE,QAASA,GAAS,CAACze,CAAD,CAAO0e,CAAP,CAAkBC,CAAlB,CAA2B,CAC3C,IAAIC,EAAQ,EAAZ,CACIC,EAAQ,CACZ,IAAIH,CAAJ,EAAiB1e,CAAA8e,aAAjB,EAAsC9e,CAAA8e,aAAA,CAAkBJ,CAAlB,CAAtC,EAEE,EAAG,CACD,GAAI,CAAC1e,CAAL,CACE,KAAM+e,GAAA,CAAe,SAAf,CAA8FL,CAA9F,CAAyGC,CAAzG,CAAN,CAEmB,CAArB,EAAI3e,CAAAxD,SAAJ;CACMwD,CAAA8e,aAAA,CAAkBJ,CAAlB,CACJ,EADkCG,CAAA,EAClC,CAAI7e,CAAA8e,aAAA,CAAkBH,CAAlB,CAAJ,EAAgCE,CAAA,EAFlC,CAIAD,EAAAxhB,KAAA,CAAW4C,CAAX,CACAA,EAAA,CAAOA,CAAAgf,YATN,CAAH,MAUiB,CAVjB,CAUSH,CAVT,CAFF,KAcED,EAAAxhB,KAAA,CAAW4C,CAAX,CAGF,OAAOmD,EAAA,CAAOyb,CAAP,CApBoC,CA+B7CK,QAASA,GAA0B,CAACC,CAAD,CAASR,CAAT,CAAoBC,CAApB,CAA6B,CAC9D,MAAO,SAAQ,CAAC7Y,CAAD,CAAQ5C,CAAR,CAAiB+Z,CAAjB,CAAwBkC,CAAxB,CAAqC,CAClDjc,CAAA,CAAUub,EAAA,CAAUvb,CAAA,CAAQ,CAAR,CAAV,CAAsBwb,CAAtB,CAAiCC,CAAjC,CACV,OAAOO,EAAA,CAAOpZ,CAAP,CAAc5C,CAAd,CAAuB+Z,CAAvB,CAA8BkC,CAA9B,CAF2C,CADU,CA2BhE9B,QAASA,EAAqB,CAAClD,CAAD,CAAaiF,CAAb,CAA0BC,CAA1B,CAAyClE,CAAzC,CAAuDmE,CAAvD,CAC1BC,CAD0B,CACAC,CADA,CACYC,CADZ,CACyBnE,CADzB,CACiD,CAgL7EoE,QAASA,EAAU,CAACC,CAAD,CAAMC,CAAN,CAAYlB,CAAZ,CAAuBC,CAAvB,CAAgC,CAC7CgB,CAAJ,GACMjB,CAEJ,GAFeiB,CAEf,CAFqBV,EAAA,CAA2BU,CAA3B,CAAgCjB,CAAhC,CAA2CC,CAA3C,CAErB,EADAgB,CAAAtF,QACA,CADcP,CAAAO,QACd,CAAAmF,CAAApiB,KAAA,CAAgBuiB,CAAhB,CAHF,CAKIC,EAAJ,GACMlB,CAEJ,GAFekB,CAEf,CAFsBX,EAAA,CAA2BW,CAA3B,CAAiClB,CAAjC,CAA4CC,CAA5C,CAEtB,EADAiB,CAAAvF,QACA,CADeP,CAAAO,QACf,CAAAoF,CAAAriB,KAAA,CAAiBwiB,CAAjB,CAHF,CANiD,CAcnDC,QAASA,EAAc,CAACxF,CAAD,CAAU4B,CAAV,CAAoB,CAAA,IACrCve,CADqC,CAC9BoiB,EAAkB,MADY,CACJC,EAAW,CAAA,CAChD,IAAItjB,CAAA,CAAS4d,CAAT,CAAJ,CAAuB,CACrB,IAAA,CAAqC,GAArC,GAAO3c,CAAP,CAAe2c,CAAAxY,OAAA,CAAe,CAAf,CAAf,GAAqD,GAArD,EAA4CnE,CAA5C,CAAA,CACE2c,CAIA,CAJUA,CAAA/Y,OAAA,CAAe,CAAf,CAIV,CAHa,GAGb,EAHI5D,CAGJ,GAFEoiB,CAEF,CAFoB,eAEpB,EAAAC,CAAA,CAAWA,CAAX,EAAgC,GAAhC,EAAuBriB,CAGzBA,EAAA,CAAQue,CAAA,CAAS6D,CAAT,CAAA,CAA0B,GAA1B,CAAgCzF,CAAhC,CAA0C,YAA1C,CAEoB;CAA5B,EAAI4B,CAAA,CAAS,CAAT,CAAAzf,SAAJ,EAAiCyf,CAAA,CAAS,CAAT,CAAA+D,aAAjC,GACEtiB,CACA,CADQA,CACR,EADiBue,CAAA,CAAS,CAAT,CAAA+D,aACjB,CAAA/D,CAAA,CAAS,CAAT,CAAA+D,aAAA,CAA2B,IAF7B,CAKA,IAAI,CAACtiB,CAAL,EAAc,CAACqiB,CAAf,CACE,KAAMhB,GAAA,CAAe,OAAf,CAA0F1E,CAA1F,CAAmG4F,CAAnG,CAAN,CAjBmB,CAAvB,IAoBWvjB,EAAA,CAAQ2d,CAAR,CAAJ,GACL3c,CACA,CADQ,EACR,CAAAf,CAAA,CAAQ0d,CAAR,CAAiB,QAAQ,CAACA,CAAD,CAAU,CACjC3c,CAAAN,KAAA,CAAWyiB,CAAA,CAAexF,CAAf,CAAwB4B,CAAxB,CAAX,CADiC,CAAnC,CAFK,CAMP,OAAOve,EA5BkC,CAgC3Cif,QAASA,EAAU,CAACL,CAAD,CAAcxW,CAAd,CAAqBoa,CAArB,CAA+B9D,CAA/B,CAA6CC,CAA7C,CAAgE,CAAA,IAC7EY,CAD6E,CACtEhB,CADsE,CACzDzL,CADyD,CACrD0O,CADqD,CAC7C5E,CAGlC2C,EAAA,CADEmC,CAAJ,GAAoBc,CAApB,CACUb,CADV,CAGUje,EAAA,CAAYie,CAAZ,CAA2B,IAAIlC,CAAJ,CAAeha,CAAA,CAAO+c,CAAP,CAAf,CAAiCb,CAAA7B,MAAjC,CAA3B,CAEVvB,EAAA,CAAWgB,CAAAkD,UAEX,IAAIC,CAAJ,CAA8B,CAC5B,IAAIC,GAAe,8BAAnB,CAEIC,EAAcxa,CAAAya,QAAdD,EAA+Bxa,CAEnCnJ,EAAA,CAAQyjB,CAAAta,MAAR,CAAwC,QAAQ,CAAC0a,CAAD,CAAaC,CAAb,CAAwB,CAAA,IAClE/c,EAAQ8c,CAAA9c,MAAA,CAAiB2c,EAAjB,CAAR3c,EAA0C,EADwB,CAElEgd,EAAWhd,CAAA,CAAM,CAAN,CAAXgd,EAAuBD,CAF2C,CAGlEV,EAAwB,GAAxBA,EAAYrc,CAAA,CAAM,CAAN,CAHsD,CAIlEid,EAAOjd,CAAA,CAAM,CAAN,CAJ2D,CAKlEkd,CALkE,CAMlEC,CANkE,CAMvDC,CAEfhb,EAAAib,kBAAA,CAAwBN,CAAxB,CAAA,CAAqCE,CAArC,CAA4CD,CAE5C,QAAQC,CAAR,EAEE,KAAK,GAAL,CACE1D,CAAA+D,SAAA,CAAeN,CAAf,CAAyB,QAAQ,CAAChjB,CAAD,CAAQ,CACvCoI,CAAA,CAAM2a,CAAN,CAAA,CAAmB/iB,CADoB,CAAzC,CAGAuf,EAAAgE,YAAA,CAAkBP,CAAlB,CAAAQ,QAAA;AAAsCZ,CAClCrD,EAAA,CAAMyD,CAAN,CAAJ,GAEE5a,CAAA,CAAM2a,CAAN,CAFF,CAEqB9F,CAAA,CAAasC,CAAA,CAAMyD,CAAN,CAAb,CAAA,CAA8BJ,CAA9B,CAFrB,CAIA,MAGF,MAAK,GAAL,CACE,GAAIP,CAAJ,EAAgB,CAAC9C,CAAA,CAAMyD,CAAN,CAAjB,CACE,KAEFG,EAAA,CAAY/F,CAAA,CAAOmC,CAAA,CAAMyD,CAAN,CAAP,CACZI,EAAA,CAAYD,CAAAM,OAAZ,EAAgC,QAAQ,EAAG,CAEzCP,CAAA,CAAY9a,CAAA,CAAM2a,CAAN,CAAZ,CAA+BI,CAAA,CAAUP,CAAV,CAC/B,MAAMvB,GAAA,CAAe,WAAf,CACF9B,CAAA,CAAMyD,CAAN,CADE,CACeN,CAAApb,KADf,CAAN,CAHyC,CAM3C4b,EAAA,CAAY9a,CAAA,CAAM2a,CAAN,CAAZ,CAA+BI,CAAA,CAAUP,CAAV,CAC/Bxa,EAAA/E,OAAA,CAAaqgB,QAAyB,EAAG,CACvC,IAAIC,EAAcR,CAAA,CAAUP,CAAV,CAEde,EAAJ,GAAoBvb,CAAA,CAAM2a,CAAN,CAApB,GAEMY,CAAJ,GAAoBT,CAApB,CAEEA,CAFF,CAEc9a,CAAA,CAAM2a,CAAN,CAFd,CAEiCY,CAFjC,CAKEP,CAAA,CAAUR,CAAV,CAAuBe,CAAvB,CAAqCT,CAArC,CAAiD9a,CAAA,CAAM2a,CAAN,CAAjD,CAPJ,CAUA,OAAOY,EAbgC,CAAzC,CAeA,MAGF,MAAK,GAAL,CACER,CAAA,CAAY/F,CAAA,CAAOmC,CAAA,CAAMyD,CAAN,CAAP,CACZ5a,EAAA,CAAM2a,CAAN,CAAA,CAAmB,QAAQ,CAACxP,CAAD,CAAS,CAClC,MAAO4P,EAAA,CAAUP,CAAV,CAAuBrP,CAAvB,CAD2B,CAGpC,MAGF,SACE,KAAM8N,GAAA,CAAe,MAAf,CACFqB,CAAApb,KADE,CAC6Byb,CAD7B,CACwCD,CADxC,CAAN,CArDJ,CAVsE,CAAxE,CAL4B,CA2E1Bc,CAAJ,EACE3kB,CAAA,CAAQ2kB,CAAR,CAA8B,QAAQ,CAACxH,CAAD,CAAY,CAAA,IAC5C7I,EAAS,QACHnL,CADG,UAEDmW,CAFC,QAGHgB,CAHG,aAIEZ,CAJF,CADmC,CAM7CkF,CAEHjH,EAAA,CAAaR,CAAAQ,WACK,IAAlB,EAAIA,CAAJ,GACEA,CADF,CACe2C,CAAA,CAAMnD,CAAA9U,KAAN,CADf,CAIAuc,EAAA,CAAqBxG,CAAA,CAAYT,CAAZ,CAAwBrJ,CAAxB,CAMO,EAA5B,EAAIgL,CAAA,CAAS,CAAT,CAAAzf,SAAJ,CACEyf,CAAA,CAAS,CAAT,CAAA+D,aADF,CAC6BuB,CAD7B,CAGEtF,CAAA/V,KAAA,CAAc,GAAd;AAAoB4T,CAAA9U,KAApB,CAAqC,YAArC,CAAmDuc,CAAnD,CAEEzH,EAAA0H,aAAJ,GACEvQ,CAAAwQ,OAAA,CAAc3H,CAAA0H,aAAd,CADF,CAC0CD,CAD1C,CAxBgD,CAAlD,CA+BEhkB,EAAA,CAAI,CAAR,KAAWiT,CAAX,CAAgBgP,CAAAjjB,OAAhB,CAAmCgB,CAAnC,CAAuCiT,CAAvC,CAA2CjT,CAAA,EAA3C,CACE,GAAI,CACF2hB,CACA,CADSM,CAAA,CAAWjiB,CAAX,CACT,CAAA2hB,CAAA,CAAOpZ,CAAP,CAAcmW,CAAd,CAAwBgB,CAAxB,CACIiC,CAAA7E,QADJ,EACsBwF,CAAA,CAAeX,CAAA7E,QAAf,CAA+B4B,CAA/B,CADtB,CAFE,CAIF,MAAO3Y,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CAAqBL,EAAA,CAAYgZ,CAAZ,CAArB,CADU,CAMdK,CAAA,EAAeA,CAAA,CAAYxW,CAAZ,CAAmBoa,CAAApV,WAAnB,CAAwC5O,CAAxC,CAAmDmgB,CAAnD,CAGf,KAAI9e,CAAJ,CAAQkiB,CAAAljB,OAAR,CAA6B,CAA7B,CAAqC,CAArC,EAAgCgB,CAAhC,CAAwCA,CAAA,EAAxC,CACE,GAAI,CACF2hB,CACA,CADSO,CAAA,CAAYliB,CAAZ,CACT,CAAA2hB,CAAA,CAAOpZ,CAAP,CAAcmW,CAAd,CAAwBgB,CAAxB,CACIiC,CAAA7E,QADJ,EACsBwF,CAAA,CAAeX,CAAA7E,QAAf,CAA+B4B,CAA/B,CADtB,CAFE,CAIF,MAAO3Y,EAAP,CAAU,CACV4W,CAAA,CAAkB5W,EAAlB,CAAqBL,EAAA,CAAYgZ,CAAZ,CAArB,CADU,CAxImE,CA7NnFX,CAAA,CAAyBA,CAAzB,EAAmD,EAD0B,KAGzEoG,EAAmB,CAAChJ,MAAAC,UAHqD,CAIzEgJ,EAJyE,CAKzEvB,EAA2B9E,CAAA8E,yBAL8C,CAMzEwB,EAAoBtG,CAAAsG,kBANqD,CAOzEC,EAAexC,CAAAc,UAAf0B,CAAyC1e,CAAA,CAAOic,CAAP,CAPgC,CAQzEtF,CARyE,CASzEmG,CATyE,CAUzE6B,CACAC,EAAAA,CAAsBzG,CAAAyG,oBAQ1B,KAnB6E,IAazEvF,EAAoBrB,CAbqD,CAczEmG,CAdyE,CAezEpC,CAfyE,CAmBrE3hB,GAAI,CAnBiE,CAmB9DiT,EAAK2J,CAAA5d,OAApB,CAAuCgB,EAAvC,CAA2CiT,CAA3C,CAA+CjT,EAAA,EAA/C,CAAoD,CAClDuc,CAAA,CAAYK,CAAA,CAAW5c,EAAX,CACZ,KAAImhB,EAAY5E,CAAAkI,QAAhB,CACIrD,EAAU7E,CAAAmI,MAGVvD,EAAJ,GACEmD,CADF;AACiBpD,EAAA,CAAUW,CAAV,CAAuBV,CAAvB,CAAkCC,CAAlC,CADjB,CAGAmD,EAAA,CAAY5lB,CAEZ,IAAIwlB,CAAJ,CAAuB5H,CAAAM,SAAvB,CACE,KAGF,IAAI8H,CAAJ,CAAqBpI,CAAAhU,MAArB,CACE6b,EAIA,CAJoBA,EAIpB,EAJyC7H,CAIzC,CAAKA,CAAAqI,YAAL,GACEC,CAAA,CAAkB,oBAAlB,CAAwChC,CAAxC,CAAkEtG,CAAlE,CAA6E+H,CAA7E,CAKA,CAJIviB,CAAA,CAAS4iB,CAAT,CAIJ,GAHElG,CAAA,CAAa6F,CAAb,CAA2B,kBAA3B,CACA,CAAAzB,CAAA,CAA2BtG,CAE7B,EAAAkC,CAAA,CAAa6F,CAAb,CAA2B,UAA3B,CANF,CAUF5B,EAAA,CAAgBnG,CAAA9U,KAEXmd,EAAArI,CAAAqI,YAAL,EAA8BrI,CAAAQ,WAA9B,GACE4H,CAIA,CAJiBpI,CAAAQ,WAIjB,CAHAgH,CAGA,CAHuBA,CAGvB,EAH+C,EAG/C,CAFAc,CAAA,CAAkB,GAAlB,CAAwBnC,CAAxB,CAAwC,cAAxC,CACIqB,CAAA,CAAqBrB,CAArB,CADJ,CACyCnG,CADzC,CACoD+H,CADpD,CAEA,CAAAP,CAAA,CAAqBrB,CAArB,CAAA,CAAsCnG,CALxC,CAQA,IAAIoI,CAAJ,CAAqBpI,CAAA+C,WAArB,CAGwB,UAKtB,GALIoD,CAKJ,GAJEmC,CAAA,CAAkB,cAAlB,CAAkCL,CAAlC,CAAuDjI,CAAvD,CAAkE+H,CAAlE,CACA,CAAAE,CAAA,CAAsBjI,CAGxB,EAAsB,SAAtB,EAAIoI,CAAJ,EACER,CAOA,CAPmB5H,CAAAM,SAOnB,CANA0H,CAMA,CANYrD,EAAA,CAAUW,CAAV,CAAuBV,CAAvB,CAAkCC,CAAlC,CAMZ,CALAkD,CAKA,CALexC,CAAAc,UAKf,CAJIhd,CAAA,CAAOlH,CAAAomB,cAAA,CAAuB,GAAvB,CAA6BpC,CAA7B,CAA6C,IAA7C,CAAoDZ,CAAA,CAAcY,CAAd,CAApD,CAAmF,GAAnF,CAAP,CAIJ,CAHAb,CAGA,CAHcyC,CAAA,CAAa,CAAb,CAGd,CAFAS,EAAA,CAAYhD,CAAZ,CAA0Bnc,CAAA,CAjtI7BjB,EAAAjF,KAAA,CAitI8C6kB,CAjtI9C,CAA+B,CAA/B,CAitI6B,CAA1B,CAAwD1C,CAAxD,CAEA,CAAA5C,CAAA,CAAoBzW,CAAA,CAAQ+b,CAAR,CAAmB3G,CAAnB,CAAiCuG,CAAjC,CACQa,CADR,EAC4BA,CAAAvd,KAD5B,CACmD,0BACfob,CADe,qBAEpB2B,CAFoB;kBAGtBH,CAHsB,CADnD,CARtB,GAeEE,CAEA,CAFY3e,CAAA,CAAO8H,EAAA,CAAYmU,CAAZ,CAAP,CAAAoD,SAAA,EAEZ,CADAX,CAAAxe,KAAA,CAAkB,EAAlB,CACA,CAAAmZ,CAAA,CAAoBzW,CAAA,CAAQ+b,CAAR,CAAmB3G,CAAnB,CAjBtB,CAqBF,IAAIrB,CAAA2I,SAAJ,CAUE,GATAL,CAAA,CAAkB,UAAlB,CAA8BR,CAA9B,CAAiD9H,CAAjD,CAA4D+H,CAA5D,CASIle,CARJie,CAQIje,CARgBmW,CAQhBnW,CANJue,CAMIve,CANc5G,CAAA,CAAW+c,CAAA2I,SAAX,CACD,CAAX3I,CAAA2I,SAAA,CAAmBZ,CAAnB,CAAiCxC,CAAjC,CAAW,CACXvF,CAAA2I,SAIF9e,CAFJue,CAEIve,CAFa+e,EAAA,CAAoBR,CAApB,CAEbve,CAAAmW,CAAAnW,QAAJ,CAAuB,CACrB4e,CAAA,CAAmBzI,CACnBgI,EAAA,CAAY3e,CAAA,CAAO,OAAP,CACS2J,EAAA,CAAKoV,CAAL,CADT,CAEO,QAFP,CAAAM,SAAA,EAGZpD,EAAA,CAAc0C,CAAA,CAAU,CAAV,CAEd,IAAwB,CAAxB,EAAIA,CAAAvlB,OAAJ,EAAsD,CAAtD,GAA6B6iB,CAAA5iB,SAA7B,CACE,KAAMuiB,GAAA,CAAe,OAAf,CAAgGkB,CAAhG,CAA+G,EAA/G,CAAN,CAGFqC,EAAA,CAAYhD,CAAZ,CAA0BuC,CAA1B,CAAwCzC,CAAxC,CAEIuD,EAAAA,CAAmB,OAAQ,EAAR,CAOvBxI,EAAA,CAAaA,CAAA/X,OAAA,CACTgb,CAAA,CACIgC,CADJ,CAEIjF,CAAAzZ,OAAA,CAAkBnD,EAAlB,CAAsB,CAAtB,CAAyB4c,CAAA5d,OAAzB,EAA8CgB,EAA9C,CAAkD,CAAlD,EAFJ,CAGIolB,CAHJ,CADS,CAObC,GAAA,CAAwBvD,CAAxB,CAAuCsD,CAAvC,CAEAnS,EAAA,CAAK2J,CAAA5d,OA7BgB,CAAvB,IA+BEslB,EAAAxe,KAAA,CAAkB6e,CAAlB,CAIJ,IAAIpI,CAAAqI,YAAJ,CACEC,CAAA,CAAkB,UAAlB,CAA8BR,CAA9B,CAAiD9H,CAAjD,CAA4D+H,CAA5D,CAaA,CAZAD,CAYA,CAZoB9H,CAYpB,CAVIA,CAAAnW,QAUJ,GATE4e,CASF,CATqBzI,CASrB,EANA6C,CAMA,CANakG,EAAA,CAAmB1I,CAAAzZ,OAAA,CAAkBnD,EAAlB,CAAqB4c,CAAA5d,OAArB,CAAyCgB,EAAzC,CAAnB,CAAgEskB,CAAhE,CACTxC,CADS,CACMC,CADN,CACoB9C,CADpB,CACuCgD,CADvC,CACmDC,CADnD,CACgE,0BAC7CW,CAD6C;oBAElD2B,CAFkD,mBAGpDH,CAHoD,CADhE,CAMb,CAAApR,CAAA,CAAK2J,CAAA5d,OAdP,KAeO,IAAIud,CAAA/T,QAAJ,CACL,GAAI,CACFmZ,CACA,CADSpF,CAAA/T,QAAA,CAAkB8b,CAAlB,CAAgCxC,CAAhC,CAA+C7C,CAA/C,CACT,CAAIzf,CAAA,CAAWmiB,CAAX,CAAJ,CACEQ,CAAA,CAAW,IAAX,CAAiBR,CAAjB,CAAyBR,CAAzB,CAAoCC,CAApC,CADF,CAEWO,CAFX,EAGEQ,CAAA,CAAWR,CAAAS,IAAX,CAAuBT,CAAAU,KAAvB,CAAoClB,CAApC,CAA+CC,CAA/C,CALA,CAOF,MAAOrb,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CAAqBL,EAAA,CAAY4e,CAAZ,CAArB,CADU,CAKV/H,CAAAwD,SAAJ,GACEX,CAAAW,SACA,CADsB,CAAA,CACtB,CAAAoE,CAAA,CAAmBoB,IAAAC,IAAA,CAASrB,CAAT,CAA2B5H,CAAAM,SAA3B,CAFrB,CA9IkD,CAqJpDuC,CAAA7W,MAAA,CAAmB6b,EAAnB,EAAwCA,EAAA7b,MACxC6W,EAAAE,WAAA,CAAwBkF,CAAxB,EAA+CvF,CAG/C,OAAOG,EA5KsE,CA4X/Ec,QAASA,EAAY,CAACuF,CAAD,CAAche,CAAd,CAAoBpF,CAApB,CAA8Bwb,CAA9B,CAA2CC,CAA3C,CAA4D4H,CAA5D,CAA2EC,CAA3E,CAAwF,CAC3G,GAAIle,CAAJ,GAAaqW,CAAb,CAA8B,MAAO,KACjC3X,EAAAA,CAAQ,IACZ,IAAI6V,CAAAvc,eAAA,CAA6BgI,CAA7B,CAAJ,CAAwC,CAAA,IAC9B8U,CAAWK,EAAAA,CAAazI,CAAAvB,IAAA,CAAcnL,CAAd,CAAqBwU,CAArB,CAAhC,KADsC,IAElCjc,EAAI,CAF8B,CAE3BiT,EAAK2J,CAAA5d,OADhB,CACmCgB,CADnC,CACqCiT,CADrC,CACyCjT,CAAA,EADzC,CAEE,GAAI,CACFuc,CACA,CADYK,CAAA,CAAW5c,CAAX,CACZ,EAAM6d,CAAN,GAAsBlf,CAAtB,EAAmCkf,CAAnC,CAAiDtB,CAAAM,SAAjD,GAC8C,EAD9C,EACKN,CAAAS,SAAAha,QAAA,CAA2BX,CAA3B,CADL,GAEMqjB,CAIJ,GAHEnJ,CAGF,CAHcjb,EAAA,CAAQib,CAAR,CAAmB,SAAUmJ,CAAV,OAAgCC,CAAhC,CAAnB,CAGd,EADAF,CAAA5lB,KAAA,CAAiB0c,CAAjB,CACA,CAAApW,CAAA,CAAQoW,CANV,CAFE,CAUF,MAAMxW,CAAN,CAAS,CAAE4W,CAAA,CAAkB5W,CAAlB,CAAF,CAbyB,CAgBxC,MAAOI,EAnBoG,CA51BxC;AA23BrEkf,QAASA,GAAuB,CAACpkB,CAAD,CAAM6C,CAAN,CAAW,CAAA,IACrC8hB,EAAU9hB,CAAAmc,MAD2B,CAErC4F,EAAU5kB,CAAAgf,MAF2B,CAGrCvB,EAAWzd,CAAA2hB,UAGfxjB,EAAA,CAAQ6B,CAAR,CAAa,QAAQ,CAACd,CAAD,CAAQZ,CAAR,CAAa,CACX,GAArB,EAAIA,CAAA+E,OAAA,CAAW,CAAX,CAAJ,GACMR,CAAA,CAAIvE,CAAJ,CAGJ,GAFEY,CAEF,GAFoB,OAAR,GAAAZ,CAAA,CAAkB,GAAlB,CAAwB,GAEpC,EAF2CuE,CAAA,CAAIvE,CAAJ,CAE3C,EAAA0B,CAAA6kB,KAAA,CAASvmB,CAAT,CAAcY,CAAd,CAAqB,CAAA,CAArB,CAA2BylB,CAAA,CAAQrmB,CAAR,CAA3B,CAJF,CADgC,CAAlC,CAUAH,EAAA,CAAQ0E,CAAR,CAAa,QAAQ,CAAC3D,CAAD,CAAQZ,CAAR,CAAa,CACrB,OAAX,EAAIA,CAAJ,EACEkf,CAAA,CAAaC,CAAb,CAAuBve,CAAvB,CACA,CAAAc,CAAA,CAAI,OAAJ,CAAA,EAAgBA,CAAA,CAAI,OAAJ,CAAA,CAAeA,CAAA,CAAI,OAAJ,CAAf,CAA8B,GAA9B,CAAoC,EAApD,EAA0Dd,CAF5D,EAGkB,OAAX,EAAIZ,CAAJ,CACLmf,CAAA3W,KAAA,CAAc,OAAd,CAAuB2W,CAAA3W,KAAA,CAAc,OAAd,CAAvB,CAAgD,GAAhD,CAAsD5H,CAAtD,CADK,CAKqB,GALrB,EAKIZ,CAAA+E,OAAA,CAAW,CAAX,CALJ,EAK6BrD,CAAAxB,eAAA,CAAmBF,CAAnB,CAL7B,GAML0B,CAAA,CAAI1B,CAAJ,CACA,CADWY,CACX,CAAA0lB,CAAA,CAAQtmB,CAAR,CAAA,CAAeqmB,CAAA,CAAQrmB,CAAR,CAPV,CAJyB,CAAlC,CAhByC,CAiC3C+lB,QAASA,GAAkB,CAAC1I,CAAD,CAAa0H,CAAb,CAA2ByB,CAA3B,CACvBlH,CADuB,CACTI,CADS,CACUgD,CADV,CACsBC,CADtB,CACmCnE,CADnC,CAC2D,CAAA,IAChFiI,EAAY,EADoE,CAEhFC,CAFgF,CAGhFC,CAHgF,CAIhFC,EAA4B7B,CAAA,CAAa,CAAb,CAJoD,CAKhF8B,EAAqBxJ,CAAAnQ,MAAA,EAL2D,CAOhF4Z,EAAuBrlB,CAAA,CAAO,EAAP,CAAWolB,CAAX,CAA+B,aACvC,IADuC,YACrB,IADqB,SACN,IADM,CAA/B,CAPyD,CAUhFxB,EAAeplB,CAAA,CAAW4mB,CAAAxB,YAAX,CACD,CAARwB,CAAAxB,YAAA,CAA+BN,CAA/B,CAA6CyB,CAA7C,CAAQ;AACRK,CAAAxB,YAEVN,EAAAxe,KAAA,CAAkB,EAAlB,CAEAuX,EAAAzK,IAAA,CAAU6K,CAAA6I,sBAAA,CAA2B1B,CAA3B,CAAV,CAAmD,OAAQtH,CAAR,CAAnD,CAAAiJ,QAAA,CACU,QAAQ,CAACC,CAAD,CAAU,CAAA,IACpB3E,CAEJ2E,EAAA,CAAUrB,EAAA,CAAoBqB,CAApB,CAEV,IAAIJ,CAAAhgB,QAAJ,CAAgC,CAC9Bme,CAAA,CAAY3e,CAAA,CAAO,OAAP,CAAiB2J,EAAA,CAAKiX,CAAL,CAAjB,CAAiC,QAAjC,CAAAvB,SAAA,EACZpD,EAAA,CAAc0C,CAAA,CAAU,CAAV,CAEd,IAAwB,CAAxB,EAAIA,CAAAvlB,OAAJ,EAAsD,CAAtD,GAA6B6iB,CAAA5iB,SAA7B,CACE,KAAMuiB,GAAA,CAAe,OAAf,CACF4E,CAAA3e,KADE,CACuBmd,CADvB,CAAN,CAIF6B,CAAA,CAAoB,OAAQ,EAAR,CACpB1B,GAAA,CAAYlG,CAAZ,CAA0ByF,CAA1B,CAAwCzC,CAAxC,CACAhC,EAAA,CAAkBgC,CAAlB,CAA+BjF,CAA/B,CAA2C6J,CAA3C,CACApB,GAAA,CAAwBU,CAAxB,CAAgCU,CAAhC,CAZ8B,CAAhC,IAcE5E,EACA,CADcsE,CACd,CAAA7B,CAAAxe,KAAA,CAAkB0gB,CAAlB,CAGF5J,EAAAhc,QAAA,CAAmBylB,CAAnB,CAEAJ,EAAA,CAA0BnG,CAAA,CAAsBlD,CAAtB,CAAkCiF,CAAlC,CAA+CkE,CAA/C,CACtB9G,CADsB,CACHqF,CADG,CACW8B,CADX,CAC+BnE,CAD/B,CAC2CC,CAD3C,CACwDnE,CADxD,CAE1B3e,EAAA,CAAQyf,CAAR,CAAsB,QAAQ,CAACpc,CAAD,CAAOzC,CAAP,CAAU,CAClCyC,CAAJ,EAAYof,CAAZ,GACEhD,CAAA,CAAa7e,CAAb,CADF,CACoBskB,CAAA,CAAa,CAAb,CADpB,CADsC,CAAxC,CAQA,KAHA4B,CAGA,CAH2B/H,EAAA,CAAamG,CAAA,CAAa,CAAb,CAAA/W,WAAb,CAAyC0R,CAAzC,CAG3B,CAAM+G,CAAAhnB,OAAN,CAAA,CAAwB,CAClBuJ,CAAAA,CAAQyd,CAAAvZ,MAAA,EADU,KAElBia,EAAyBV,CAAAvZ,MAAA,EAFP,CAGlBka,EAAkBX,CAAAvZ,MAAA,EAHA,CAIlBsQ,EAAaiJ,CAAAvZ,MAAA,EAJK,CAKlBkW,EAAW2B,CAAA,CAAa,CAAb,CAEXoC,EAAJ,GAA+BP,CAA/B,GAEExD,CACA,CADWjV,EAAA,CAAYmU,CAAZ,CACX,CAAAkD,EAAA,CAAY4B,CAAZ,CAA6B/gB,CAAA,CAAO8gB,CAAP,CAA7B,CAA6D/D,CAA7D,CAHF,CAMAsD,EAAA,CAAwBC,CAAxB,CAAkD3d,CAAlD,CAAyDoa,CAAzD,CAAmE9D,CAAnE,CAAiF9B,CAAjF,CAbsB,CAexBiJ,CAAA,CAAY,IAlDY,CAD5B,CAAA1P,MAAA,CAqDQ,QAAQ,CAACsQ,CAAD;AAAWC,CAAX,CAAiBC,CAAjB,CAA0B3b,CAA1B,CAAkC,CAC9C,KAAMqW,GAAA,CAAe,QAAf,CAAyDrW,CAAA8L,IAAzD,CAAN,CAD8C,CArDlD,CAyDA,OAAO8P,SAA0B,CAACC,CAAD,CAAoBze,CAApB,CAA2B9F,CAA3B,CAAiCwkB,CAAjC,CAA8ClK,CAA9C,CAA0D,CACrFiJ,CAAJ,EACEA,CAAAnmB,KAAA,CAAe0I,CAAf,CAGA,CAFAyd,CAAAnmB,KAAA,CAAe4C,CAAf,CAEA,CADAujB,CAAAnmB,KAAA,CAAeonB,CAAf,CACA,CAAAjB,CAAAnmB,KAAA,CAAekd,CAAf,CAJF,EAMEkJ,CAAA,CAAwBC,CAAxB,CAAkD3d,CAAlD,CAAyD9F,CAAzD,CAA+DwkB,CAA/D,CAA4ElK,CAA5E,CAPuF,CAzEP,CAyFtFkE,QAASA,EAAU,CAACiG,CAAD,CAAIC,CAAJ,CAAO,CACxB,IAAIC,EAAOD,CAAAtK,SAAPuK,CAAoBF,CAAArK,SACxB,OAAa,EAAb,GAAIuK,CAAJ,CAAuBA,CAAvB,CACIF,CAAAzf,KAAJ,GAAe0f,CAAA1f,KAAf,CAA+Byf,CAAAzf,KAAD,CAAU0f,CAAA1f,KAAV,CAAqB,EAArB,CAAyB,CAAvD,CACOyf,CAAA7mB,MADP,CACiB8mB,CAAA9mB,MAJO,CAQ1BwkB,QAASA,EAAiB,CAACwC,CAAD,CAAOC,CAAP,CAA0B/K,CAA1B,CAAqC5W,CAArC,CAA8C,CACtE,GAAI2hB,CAAJ,CACE,KAAM9F,GAAA,CAAe,UAAf,CACF8F,CAAA7f,KADE,CACsB8U,CAAA9U,KADtB,CACsC4f,CADtC,CAC4C3hB,EAAA,CAAYC,CAAZ,CAD5C,CAAN,CAFoE,CAQxEqb,QAASA,EAA2B,CAACpE,CAAD,CAAa2K,CAAb,CAAmB,CACrD,IAAIC,EAAgBpK,CAAA,CAAamK,CAAb,CAAmB,CAAA,CAAnB,CAChBC,EAAJ,EACE5K,CAAA/c,KAAA,CAAgB,UACJ,CADI,SAEL+B,EAAA,CAAQ6lB,QAA8B,CAAClf,CAAD,CAAQ9F,CAAR,CAAc,CAAA,IACvDlB,EAASkB,CAAAlB,OAAA,EAD8C,CAEvDmmB,EAAWnmB,CAAAoH,KAAA,CAAY,UAAZ,CAAX+e,EAAsC,EAC1CA,EAAA7nB,KAAA,CAAc2nB,CAAd,CACA/I,EAAA,CAAald,CAAAoH,KAAA,CAAY,UAAZ,CAAwB+e,CAAxB,CAAb,CAAgD,YAAhD,CACAnf,EAAA/E,OAAA,CAAagkB,CAAb,CAA4BG,QAAiC,CAACxnB,CAAD,CAAQ,CACnEsC,CAAA,CAAK,CAAL,CAAAub,UAAA;AAAoB7d,CAD+C,CAArE,CAL2D,CAApD,CAFK,CAAhB,CAHmD,CAmBvDynB,QAASA,EAAiB,CAACnlB,CAAD,CAAOolB,CAAP,CAA2B,CAEnD,GAA0B,WAA1B,EAAIA,CAAJ,EACwB,KADxB,EACKzH,EAAA,CAAU3d,CAAV,CADL,GACwD,KADxD,EACkColB,CADlC,EAEwD,OAFxD,EAEkCA,CAFlC,EAGE,MAAOpK,EAAAqK,aAL0C,CAUrD/G,QAASA,EAA2B,CAACte,CAAD,CAAOma,CAAP,CAAmBzc,CAAnB,CAA0BsH,CAA1B,CAAgC,CAClE,IAAI+f,EAAgBpK,CAAA,CAAajd,CAAb,CAAoB,CAAA,CAApB,CAGpB,IAAKqnB,CAAL,CAAA,CAGA,GAAa,UAAb,GAAI/f,CAAJ,EAA+C,QAA/C,GAA2B2Y,EAAA,CAAU3d,CAAV,CAA3B,CACE,KAAM+e,GAAA,CAAe,UAAf,CACF9b,EAAA,CAAYjD,CAAZ,CADE,CAAN,CAIFma,CAAA/c,KAAA,CAAgB,UACH,IADG,SAEL+B,EAAA,CAAQmmB,QAA8B,CAACxf,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAChE2b,CAAAA,CAAe3b,CAAA2b,YAAfA,GAAoC3b,CAAA2b,YAApCA,CAAuD,EAAvDA,CAEJ,IAAIpH,CAAAxT,KAAA,CAA+BrB,CAA/B,CAAJ,CACE,KAAM+Z,GAAA,CAAe,aAAf,CAAN,CAWF,GAJAgG,CAIA,CAJgBpK,CAAA,CAAarV,CAAA,CAAKN,CAAL,CAAb,CAAyB,CAAA,CAAzB,CAA+BmgB,CAAA,CAAkBnlB,CAAlB,CAAwBgF,CAAxB,CAA/B,CAIhB,CAGAM,CAAA,CAAKN,CAAL,CAEC,CAFY+f,CAAA,CAAcjf,CAAd,CAEZ,CADAyf,CAAAtE,CAAA,CAAYjc,CAAZ,CAAAugB,GAAsBtE,CAAA,CAAYjc,CAAZ,CAAtBugB,CAA0C,EAA1CA,UACA,CADyD,CAAA,CACzD,CAAAxkB,CAAAuE,CAAA2b,YAAAlgB,EAAoBuE,CAAA2b,YAAA,CAAiBjc,CAAjB,CAAAkc,QAApBngB,EAAsD+E,CAAtD/E,QAAA,CACQgkB,CADR,CACuBG,QAAiC,CAACxnB,CAAD,CAAQ,CAC7D4H,CAAA+d,KAAA,CAAUre,CAAV,CAAgBtH,CAAhB,CAD6D,CADhE,CApBmE,CAA7D,CAFK,CAAhB,CARA,CAJkE,CAqDpE4kB,QAASA,GAAW,CAAClG,CAAD,CAAeoJ,CAAf,CAAiCC,CAAjC,CAA0C,CAAA,IACxDC,EAAuBF,CAAA,CAAiB,CAAjB,CADiC;AAExDG,EAAcH,CAAAjpB,OAF0C,CAGxDuC,EAAS4mB,CAAAE,WAH+C,CAIxDroB,CAJwD,CAIrDiT,CAEP,IAAI4L,CAAJ,CACE,IAAI7e,CAAO,CAAH,CAAG,CAAAiT,CAAA,CAAK4L,CAAA7f,OAAhB,CAAqCgB,CAArC,CAAyCiT,CAAzC,CAA6CjT,CAAA,EAA7C,CACE,GAAI6e,CAAA,CAAa7e,CAAb,CAAJ,EAAuBmoB,CAAvB,CAA6C,CAC3CtJ,CAAA,CAAa7e,CAAA,EAAb,CAAA,CAAoBkoB,CACJI,EAAAA,CAAK/H,CAAL+H,CAASF,CAATE,CAAuB,CAAvC,KAAK,IACI9H,EAAK3B,CAAA7f,OADd,CAEKuhB,CAFL,CAESC,CAFT,CAEaD,CAAA,EAAA,CAAK+H,CAAA,EAFlB,CAGMA,CAAJ,CAAS9H,CAAT,CACE3B,CAAA,CAAa0B,CAAb,CADF,CACoB1B,CAAA,CAAayJ,CAAb,CADpB,CAGE,OAAOzJ,CAAA,CAAa0B,CAAb,CAGX1B,EAAA7f,OAAA,EAAuBopB,CAAvB,CAAqC,CACrC,MAZ2C,CAiB7C7mB,CAAJ,EACEA,CAAAgnB,aAAA,CAAoBL,CAApB,CAA6BC,CAA7B,CAEE3a,EAAAA,CAAW9O,CAAA+O,uBAAA,EACfD,EAAAgb,YAAA,CAAqBL,CAArB,CACAD,EAAA,CAAQtiB,CAAA6iB,QAAR,CAAA,CAA0BN,CAAA,CAAqBviB,CAAA6iB,QAArB,CACjBC,EAAAA,CAAI,CAAb,KAAgBC,CAAhB,CAAqBV,CAAAjpB,OAArB,CAA8C0pB,CAA9C,CAAkDC,CAAlD,CAAsDD,CAAA,EAAtD,CACM/iB,CAGJ,CAHcsiB,CAAA,CAAiBS,CAAjB,CAGd,CAFA9iB,CAAA,CAAOD,CAAP,CAAA4V,OAAA,EAEA,CADA/N,CAAAgb,YAAA,CAAqB7iB,CAArB,CACA,CAAA,OAAOsiB,CAAA,CAAiBS,CAAjB,CAGTT,EAAA,CAAiB,CAAjB,CAAA,CAAsBC,CACtBD,EAAAjpB,OAAA,CAA0B,CAvCkC,CAtlC9D,IAAI4gB,EAAaA,QAAQ,CAACja,CAAD,CAAUoC,CAAV,CAAgB,CACvC,IAAA6a,UAAA,CAAiBjd,CACjB,KAAAsa,MAAA,CAAalY,CAAb,EAAqB,EAFkB,CAKzC6X,EAAA7L,UAAA,CAAuB,YACToM,EADS,WAgBTyI,QAAQ,CAACC,CAAD,CAAW,CAC1BA,CAAH,EAAiC,CAAjC,CAAeA,CAAA7pB,OAAf,EACE0e,CAAAiB,SAAA,CAAkB,IAAAiE,UAAlB;AAAkCiG,CAAlC,CAF2B,CAhBV,cAkCNC,QAAQ,CAACD,CAAD,CAAW,CAC7BA,CAAH,EAAiC,CAAjC,CAAeA,CAAA7pB,OAAf,EACE0e,CAAAqL,YAAA,CAAqB,IAAAnG,UAArB,CAAqCiG,CAArC,CAF8B,CAlCb,MAiDf/C,QAAQ,CAACvmB,CAAD,CAAMY,CAAN,CAAa6oB,CAAb,CAAwB7F,CAAxB,CAAkC,CAmE9C8F,QAASA,EAAe,CAACC,CAAD,CAAOC,CAAP,CAAa,CAAA,IAC/BC,EAAS,EADsB,CAE/BC,EAAUH,CAAAxiB,MAAA,CAAW,KAAX,CAFqB,CAG/B4iB,EAAUH,CAAAziB,MAAA,CAAW,KAAX,CAHqB,CAM3B1G,EAAE,CADV,EAAA,CACA,IAAA,CAAYA,CAAZ,CAAcqpB,CAAArqB,OAAd,CAA6BgB,CAAA,EAA7B,CAAkC,CAEhC,IADA,IAAIupB,EAAQF,CAAA,CAAQrpB,CAAR,CAAZ,CACQugB,EAAE,CAAV,CAAYA,CAAZ,CAAc+I,CAAAtqB,OAAd,CAA6BuhB,CAAA,EAA7B,CACE,GAAGgJ,CAAH,EAAYD,CAAA,CAAQ/I,CAAR,CAAZ,CAAwB,SAAS,CAEnC6I,EAAAvpB,KAAA,CAAY0pB,CAAZ,CALgC,CAOlC,MAAOH,EAb4B,CA/DrC,GAAU,OAAV,EAAG7pB,CAAH,CACEY,CAGA,CAHQA,CAGR,EAHiB,EAGjB,CAFIqpB,CAEJ,CAFc,IAAA5G,UAAA7a,KAAA,CAAoB,OAApB,CAEd,EAF8C,EAE9C,CADA,IAAA+gB,aAAA,CAAkBG,CAAA,CAAgBO,CAAhB,CAAyBrpB,CAAzB,CAAAM,KAAA,CAAqC,GAArC,CAAlB,CACA,CAAA,IAAAmoB,UAAA,CAAeK,CAAA,CAAgB9oB,CAAhB,CAAuBqpB,CAAvB,CAAA/oB,KAAA,CAAqC,GAArC,CAAf,CAJF,KAKO,CAAA,IACDgpB,EAAa5Z,EAAA,CAAmB,IAAA+S,UAAA,CAAe,CAAf,CAAnB,CAAsCrjB,CAAtC,CAIbkqB,EAAJ,GACE,IAAA7G,UAAA8G,KAAA,CAAoBnqB,CAApB,CAAyBY,CAAzB,CACA,CAAAgjB,CAAA,CAAWsG,CAFb,CAKA,KAAA,CAAKlqB,CAAL,CAAA,CAAYY,CAGRgjB,EAAJ,CACE,IAAAlD,MAAA,CAAW1gB,CAAX,CADF,CACoB4jB,CADpB,EAGEA,CAHF,CAGa,IAAAlD,MAAA,CAAW1gB,CAAX,CAHb;CAKI,IAAA0gB,MAAA,CAAW1gB,CAAX,CALJ,CAKsB4jB,CALtB,CAKiCha,EAAA,CAAW5J,CAAX,CAAgB,GAAhB,CALjC,CASAmD,EAAA,CAAW0d,EAAA,CAAU,IAAAwC,UAAV,CAGX,IAAkB,GAAlB,GAAKlgB,CAAL,EAAiC,MAAjC,GAAyBnD,CAAzB,EACkB,KADlB,GACKmD,CADL,EACmC,KADnC,GAC2BnD,CAD3B,CAGE,GAAI,CAACwR,CAAL,EAAqB,CAArB,EAAaA,CAAb,CACE4Y,CACA,CADgBC,EAAA,CAAWzpB,CAAX,CAAA8X,KAChB,CAAsB,EAAtB,GAAI0R,CAAJ,GACe,MADf,GACOpqB,CADP,EAC0B,CAAAoqB,CAAAxjB,MAAA,CAAoBiW,CAApB,CAD1B,EAEe,KAFf,GAEO7c,CAFP,EAEyB,CAAAoqB,CAAAxjB,MAAA,CAAoBkW,CAApB,CAFzB,IAGI,IAAA,CAAK9c,CAAL,CAHJ,CAGgBY,CAHhB,CAGwB,SAHxB,CAGoCwpB,CAHpC,CASc,EAAA,CAAlB,GAAIX,CAAJ,GACgB,IAAd,GAAI7oB,CAAJ,EAAsBA,CAAtB,GAAgCxB,CAAhC,CACE,IAAAikB,UAAAiH,WAAA,CAA0B1G,CAA1B,CADF,CAGE,IAAAP,UAAA7a,KAAA,CAAoBob,CAApB,CAA8BhjB,CAA9B,CAJJ,CAvCK,CAkDP,CADIujB,CACJ,CADkB,IAAAA,YAClB,GAAetkB,CAAA,CAAQskB,CAAA,CAAYnkB,CAAZ,CAAR,CAA0B,QAAQ,CAACkF,CAAD,CAAK,CACpD,GAAI,CACFA,CAAA,CAAGtE,CAAH,CADE,CAEF,MAAO4F,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CAHwC,CAAvC,CA3D+B,CAjD3B,UAyJX0d,QAAQ,CAAClkB,CAAD,CAAMkF,CAAN,CAAU,CAAA,IACtBib,EAAQ,IADc,CAEtBgE,EAAehE,CAAAgE,YAAfA,GAAqChE,CAAAgE,YAArCA,CAAyD,EAAzDA,CAFsB,CAGtBoG,EAAapG,CAAA,CAAYnkB,CAAZ,CAAbuqB,GAAkCpG,CAAA,CAAYnkB,CAAZ,CAAlCuqB,CAAqD,EAArDA,CAEJA,EAAAjqB,KAAA,CAAe4E,CAAf,CACA2Q,EAAA7R,WAAA,CAAsB,QAAQ,EAAG,CAC1BumB,CAAA9B,QAAL,EAEEvjB,CAAA,CAAGib,CAAA,CAAMngB,CAAN,CAAH,CAH6B,CAAjC,CAMA,OAAOkF,EAZmB,CAzJP,CAP8C;IAgLjEslB,EAAc3M,CAAA2M,YAAA,EAhLmD,CAiLjEC,EAAY5M,CAAA4M,UAAA,EAjLqD,CAkLjE7E,GAAsC,IAChB,EADC4E,CACD,EADsC,IACtC,EADwBC,CACxB,CAAhBtoB,EAAgB,CAChByjB,QAA4B,CAACD,CAAD,CAAW,CACvC,MAAOA,EAAA9e,QAAA,CAAiB,OAAjB,CAA0B2jB,CAA1B,CAAA3jB,QAAA,CAA+C,KAA/C,CAAsD4jB,CAAtD,CADgC,CApLoB,CAuLjEnJ,GAAkB,cAGtB,OAAOrY,EA1L8D,CAJ3D,CA/HsB,CAmxCpC2X,QAASA,GAAkB,CAAC1Y,CAAD,CAAO,CAChC,MAAO6D,GAAA,CAAU7D,CAAArB,QAAA,CAAa6jB,EAAb,CAA4B,EAA5B,CAAV,CADyB,CAwElCC,QAASA,GAAmB,EAAG,CAAA,IACzBtI,EAAc,EADW,CAEzBuI,EAAY,yBAYhB,KAAAC,SAAA,CAAgBC,QAAQ,CAAC5iB,CAAD,CAAOqC,CAAP,CAAoB,CAC1CC,EAAA,CAAwBtC,CAAxB,CAA8B,YAA9B,CACI1F,EAAA,CAAS0F,CAAT,CAAJ,CACEzG,CAAA,CAAO4gB,CAAP,CAAoBna,CAApB,CADF,CAGEma,CAAA,CAAYna,CAAZ,CAHF,CAGsBqC,CALoB,CAU5C,KAAAwI,KAAA,CAAY,CAAC,WAAD,CAAc,SAAd,CAAyB,QAAQ,CAAC6B,CAAD,CAAYe,CAAZ,CAAqB,CAyBhE,MAAO,SAAQ,CAACoV,CAAD,CAAa5W,CAAb,CAAqB,CAAA,IAC9BM,CAD8B,CACblK,CADa,CACAygB,CAE/BrrB,EAAA,CAASorB,CAAT,CAAH,GACEnkB,CAOA,CAPQmkB,CAAAnkB,MAAA,CAAiBgkB,CAAjB,CAOR,CANArgB,CAMA,CANc3D,CAAA,CAAM,CAAN,CAMd,CALAokB,CAKA,CALapkB,CAAA,CAAM,CAAN,CAKb,CAJAmkB,CAIA,CAJa1I,CAAAniB,eAAA,CAA2BqK,CAA3B,CACA,CAAP8X,CAAA,CAAY9X,CAAZ,CAAO,CACPE,EAAA,CAAO0J,CAAAwQ,OAAP,CAAsBpa,CAAtB,CAAmC,CAAA,CAAnC,CADO,EACqCE,EAAA,CAAOkL,CAAP,CAAgBpL,CAAhB,CAA6B,CAAA,CAA7B,CAElD,CAAAF,EAAA,CAAY0gB,CAAZ,CAAwBxgB,CAAxB,CAAqC,CAAA,CAArC,CARF,CAWAkK,EAAA,CAAWG,CAAA9B,YAAA,CAAsBiY,CAAtB;AAAkC5W,CAAlC,CAEX,IAAI6W,CAAJ,CAAgB,CACd,GAAM7W,CAAAA,CAAN,EAAwC,QAAxC,EAAgB,MAAOA,EAAAwQ,OAAvB,CACE,KAAMtlB,EAAA,CAAO,aAAP,CAAA,CAAsB,OAAtB,CAAmHkL,CAAnH,EAAkIwgB,CAAA7iB,KAAlI,CAAmJ8iB,CAAnJ,CAAN,CAGF7W,CAAAwQ,OAAA,CAAcqG,CAAd,CAAA,CAA4BvW,CALd,CAQhB,MAAOA,EAxB2B,CAzB4B,CAAtD,CAxBiB,CAuF/BwW,QAASA,GAAiB,EAAE,CAC1B,IAAAlY,KAAA,CAAY,CAAC,SAAD,CAAY,QAAQ,CAAC7T,CAAD,CAAQ,CACtC,MAAOmH,EAAA,CAAOnH,CAAAC,SAAP,CAD+B,CAA5B,CADc,CAsC5B+rB,QAASA,GAAyB,EAAG,CACnC,IAAAnY,KAAA,CAAY,CAAC,MAAD,CAAS,QAAQ,CAAC0D,CAAD,CAAO,CAClC,MAAO,SAAQ,CAAC0U,CAAD,CAAYC,CAAZ,CAAmB,CAChC3U,CAAAM,MAAAnU,MAAA,CAAiB6T,CAAjB,CAAuB9U,SAAvB,CADgC,CADA,CAAxB,CADuB,CAcrC0pB,QAASA,GAAY,CAAC9D,CAAD,CAAU,CAAA,IACzB+D,EAAS,EADgB,CACZtrB,CADY,CACPwF,CADO,CACF/E,CAE3B,IAAI,CAAC8mB,CAAL,CAAc,MAAO+D,EAErBzrB,EAAA,CAAQ0nB,CAAApgB,MAAA,CAAc,IAAd,CAAR,CAA6B,QAAQ,CAACokB,CAAD,CAAO,CAC1C9qB,CAAA,CAAI8qB,CAAA9nB,QAAA,CAAa,GAAb,CACJzD,EAAA,CAAMkG,CAAA,CAAU8J,EAAA,CAAKub,CAAA/mB,OAAA,CAAY,CAAZ,CAAe/D,CAAf,CAAL,CAAV,CACN+E,EAAA,CAAMwK,EAAA,CAAKub,CAAA/mB,OAAA,CAAY/D,CAAZ,CAAgB,CAAhB,CAAL,CAEFT,EAAJ,GAEIsrB,CAAA,CAAOtrB,CAAP,CAFJ,CACMsrB,CAAA,CAAOtrB,CAAP,CAAJ,CACEsrB,CAAA,CAAOtrB,CAAP,CADF,EACiB,IADjB,CACwBwF,CADxB,EAGgBA,CAJlB,CAL0C,CAA5C,CAcA,OAAO8lB,EAnBsB,CAmC/BE,QAASA,GAAa,CAACjE,CAAD,CAAU,CAC9B,IAAIkE,EAAajpB,CAAA,CAAS+kB,CAAT,CAAA,CAAoBA,CAApB,CAA8BnoB,CAE/C,OAAO,SAAQ,CAAC8I,CAAD,CAAO,CACfujB,CAAL;CAAiBA,CAAjB,CAA+BJ,EAAA,CAAa9D,CAAb,CAA/B,CAEA,OAAIrf,EAAJ,CACSujB,CAAA,CAAWvlB,CAAA,CAAUgC,CAAV,CAAX,CADT,EACwC,IADxC,CAIOujB,CAPa,CAHQ,CAyBhCC,QAASA,GAAa,CAACtiB,CAAD,CAAOme,CAAP,CAAgBoE,CAAhB,CAAqB,CACzC,GAAI1rB,CAAA,CAAW0rB,CAAX,CAAJ,CACE,MAAOA,EAAA,CAAIviB,CAAJ,CAAUme,CAAV,CAET1nB,EAAA,CAAQ8rB,CAAR,CAAa,QAAQ,CAACzmB,CAAD,CAAK,CACxBkE,CAAA,CAAOlE,CAAA,CAAGkE,CAAH,CAASme,CAAT,CADiB,CAA1B,CAIA,OAAOne,EARkC,CAiB3CwiB,QAASA,GAAa,EAAG,CAAA,IACnBC,EAAa,kBADM,CAEnBC,EAAW,YAFQ,CAGnBC,EAAoB,cAHD,CAInBC,EAAgC,CAAC,cAAD,CAAiB,gCAAjB,CAJb,CAMnBC,EAAW,IAAAA,SAAXA,CAA2B,mBAEV,CAAC,QAAQ,CAAC7iB,CAAD,CAAO,CAC7BzJ,CAAA,CAASyJ,CAAT,CAAJ,GAEEA,CACA,CADOA,CAAAvC,QAAA,CAAaklB,CAAb,CAAgC,EAAhC,CACP,CAAIF,CAAAtiB,KAAA,CAAgBH,CAAhB,CAAJ,EAA6B0iB,CAAAviB,KAAA,CAAcH,CAAd,CAA7B,GACEA,CADF,CACSvD,EAAA,CAASuD,CAAT,CADT,CAHF,CAMA,OAAOA,EAP0B,CAAhB,CAFU,kBAaX,CAAC,QAAQ,CAAC8iB,CAAD,CAAI,CAC7B,MAAO1pB,EAAA,CAAS0pB,CAAT,CAAA,EA/6KoB,eA+6KpB,GA/6KJvpB,EAAAC,MAAA,CA+6K2BspB,CA/6K3B,CA+6KI,CAA4BzmB,EAAA,CAAOymB,CAAP,CAA5B,CAAwCA,CADlB,CAAb,CAbW,SAkBpB,QACC,QACI,mCADJ,CADD,MAICF,CAJD;IAKCA,CALD,OAMCA,CAND,CAlBoB,gBA2Bb,YA3Ba,gBA4Bb,cA5Ba,CANR,CAyCnBG,EAAuB,IAAAC,aAAvBD,CAA2C,EAzCxB,CA+CnBE,EAA+B,IAAAC,qBAA/BD,CAA2D,EAE/D,KAAAtZ,KAAA,CAAY,CAAC,cAAD,CAAiB,UAAjB,CAA6B,eAA7B,CAA8C,YAA9C,CAA4D,IAA5D,CAAkE,WAAlE,CACR,QAAQ,CAACwZ,CAAD,CAAeC,CAAf,CAAyBjQ,CAAzB,CAAwC1G,CAAxC,CAAoD4W,CAApD,CAAwD7X,CAAxD,CAAmE,CAyf7EkJ,QAASA,EAAK,CAAC4O,CAAD,CAAgB,CA4E5BC,QAASA,EAAiB,CAACtF,CAAD,CAAW,CAEnC,IAAIuF,EAAOnrB,CAAA,CAAO,EAAP,CAAW4lB,CAAX,CAAqB,MACxBqE,EAAA,CAAcrE,CAAAje,KAAd,CAA6Bie,CAAAE,QAA7B,CAA+C3b,CAAA+gB,kBAA/C,CADwB,CAArB,CAGX,OAhoBC,IAioBM,EADWtF,CAAAwF,OACX,EAjoBoB,GAioBpB,CADWxF,CAAAwF,OACX,CAAHD,CAAG,CACHH,CAAAK,OAAA,CAAUF,CAAV,CAP+B,CA3ErC,IAAIhhB,EAAS,kBACOqgB,CAAAc,iBADP,mBAEQd,CAAAU,kBAFR,CAAb,CAIIpF,EAiFJyF,QAAqB,CAACphB,CAAD,CAAS,CA2B5BqhB,QAASA,EAAW,CAAC1F,CAAD,CAAU,CAC5B,IAAI2F,CAEJrtB,EAAA,CAAQ0nB,CAAR,CAAiB,QAAQ,CAAC4F,CAAD;AAAWC,CAAX,CAAmB,CACtCntB,CAAA,CAAWktB,CAAX,CAAJ,GACED,CACA,CADgBC,CAAA,EAChB,CAAqB,IAArB,EAAID,CAAJ,CACE3F,CAAA,CAAQ6F,CAAR,CADF,CACoBF,CADpB,CAGE,OAAO3F,CAAA,CAAQ6F,CAAR,CALX,CAD0C,CAA5C,CAH4B,CA3BF,IACxBC,EAAapB,CAAA1E,QADW,CAExB+F,EAAa7rB,CAAA,CAAO,EAAP,CAAWmK,CAAA2b,QAAX,CAFW,CAGxBgG,CAHwB,CAGeC,CAHf,CAK5BH,EAAa5rB,CAAA,CAAO,EAAP,CAAW4rB,CAAAI,OAAX,CAA8BJ,CAAA,CAAWnnB,CAAA,CAAU0F,CAAAL,OAAV,CAAX,CAA9B,CAGb0hB,EAAA,CAAYI,CAAZ,CACAJ,EAAA,CAAYK,CAAZ,CAGA,EAAA,CACA,IAAKC,CAAL,GAAsBF,EAAtB,CAAkC,CAChCK,CAAA,CAAyBxnB,CAAA,CAAUqnB,CAAV,CAEzB,KAAKC,CAAL,GAAsBF,EAAtB,CACE,GAAIpnB,CAAA,CAAUsnB,CAAV,CAAJ,GAAiCE,CAAjC,CACE,SAAS,CAIbJ,EAAA,CAAWC,CAAX,CAAA,CAA4BF,CAAA,CAAWE,CAAX,CATI,CAYlC,MAAOD,EAzBqB,CAjFhB,CAAaZ,CAAb,CAEdjrB,EAAA,CAAOmK,CAAP,CAAe8gB,CAAf,CACA9gB,EAAA2b,QAAA,CAAiBA,CACjB3b,EAAAL,OAAA,CAAgBoiB,EAAA,CAAU/hB,CAAAL,OAAV,CAKhB,EAHIqiB,CAGJ,CAHgBC,EAAA,CAAgBjiB,CAAA8L,IAAhB,CACA,CAAV8U,CAAAhT,QAAA,EAAA,CAAmB5N,CAAAkiB,eAAnB,EAA4C7B,CAAA6B,eAA5C,CAAU,CACV1uB,CACN,IACEmoB,CAAA,CAAS3b,CAAAmiB,eAAT,EAAkC9B,CAAA8B,eAAlC,CADF,CACgEH,CADhE,CA0BA,KAAII,EAAQ,CArBQC,QAAQ,CAACriB,CAAD,CAAS,CACnC2b,CAAA,CAAU3b,CAAA2b,QACV,KAAI2G,EAAUxC,EAAA,CAAc9f,CAAAxC,KAAd,CAA2BoiB,EAAA,CAAcjE,CAAd,CAA3B,CAAmD3b,CAAAmhB,iBAAnD,CAGVzqB,EAAA,CAAYsJ,CAAAxC,KAAZ,CAAJ,EACEvJ,CAAA,CAAQ0nB,CAAR,CAAiB,QAAQ,CAAC3mB,CAAD,CAAQwsB,CAAR,CAAgB,CACb,cAA1B,GAAIlnB,CAAA,CAAUknB,CAAV,CAAJ,EACI,OAAO7F,CAAA,CAAQ6F,CAAR,CAF4B,CAAzC,CAOE9qB,EAAA,CAAYsJ,CAAAuiB,gBAAZ,CAAJ;AAA4C,CAAA7rB,CAAA,CAAY2pB,CAAAkC,gBAAZ,CAA5C,GACEviB,CAAAuiB,gBADF,CAC2BlC,CAAAkC,gBAD3B,CAKA,OAAOC,EAAA,CAAQxiB,CAAR,CAAgBsiB,CAAhB,CAAyB3G,CAAzB,CAAA8G,KAAA,CAAuC1B,CAAvC,CAA0DA,CAA1D,CAlB4B,CAqBzB,CAAgBvtB,CAAhB,CAAZ,CACIkvB,EAAU7B,CAAA8B,KAAA,CAAQ3iB,CAAR,CAYd,KATA/L,CAAA,CAAQ2uB,CAAR,CAA8B,QAAQ,CAACC,CAAD,CAAc,CAClD,CAAIA,CAAAC,QAAJ,EAA2BD,CAAAE,aAA3B,GACEX,CAAA3sB,QAAA,CAAcotB,CAAAC,QAAd,CAAmCD,CAAAE,aAAnC,CAEF,EAAIF,CAAApH,SAAJ,EAA4BoH,CAAAG,cAA5B,GACEZ,CAAA1tB,KAAA,CAAWmuB,CAAApH,SAAX,CAAiCoH,CAAAG,cAAjC,CALgD,CAApD,CASA,CAAMZ,CAAAvuB,OAAN,CAAA,CAAoB,CACdovB,CAAAA,CAASb,CAAA9gB,MAAA,EACb,KAAI4hB,EAAWd,CAAA9gB,MAAA,EAAf,CAEAohB,EAAUA,CAAAD,KAAA,CAAaQ,CAAb,CAAqBC,CAArB,CAJQ,CAOpBR,CAAAtH,QAAA,CAAkB+H,QAAQ,CAAC7pB,CAAD,CAAK,CAC7BopB,CAAAD,KAAA,CAAa,QAAQ,CAAChH,CAAD,CAAW,CAC9BniB,CAAA,CAAGmiB,CAAAje,KAAH,CAAkBie,CAAAwF,OAAlB,CAAmCxF,CAAAE,QAAnC,CAAqD3b,CAArD,CAD8B,CAAhC,CAGA,OAAO0iB,EAJsB,CAO/BA,EAAAvX,MAAA,CAAgBiY,QAAQ,CAAC9pB,CAAD,CAAK,CAC3BopB,CAAAD,KAAA,CAAa,IAAb,CAAmB,QAAQ,CAAChH,CAAD,CAAW,CACpCniB,CAAA,CAAGmiB,CAAAje,KAAH,CAAkBie,CAAAwF,OAAlB,CAAmCxF,CAAAE,QAAnC,CAAqD3b,CAArD,CADoC,CAAtC,CAGA,OAAO0iB,EAJoB,CAO7B,OAAOA,EA1EqB,CAuQ9BF,QAASA,EAAO,CAACxiB,CAAD;AAASsiB,CAAT,CAAkBZ,CAAlB,CAA8B,CAqD5C2B,QAASA,EAAI,CAACpC,CAAD,CAASxF,CAAT,CAAmB6H,CAAnB,CAAkC,CACzCnb,CAAJ,GA52BC,GA62BC,EAAc8Y,CAAd,EA72ByB,GA62BzB,CAAcA,CAAd,CACE9Y,CAAAlC,IAAA,CAAU6F,CAAV,CAAe,CAACmV,CAAD,CAASxF,CAAT,CAAmBgE,EAAA,CAAa6D,CAAb,CAAnB,CAAf,CADF,CAIEnb,CAAAiI,OAAA,CAAatE,CAAb,CALJ,CASAyX,EAAA,CAAe9H,CAAf,CAAyBwF,CAAzB,CAAiCqC,CAAjC,CACKrZ,EAAAuZ,QAAL,EAAyBvZ,CAAA1M,OAAA,EAXoB,CAkB/CgmB,QAASA,EAAc,CAAC9H,CAAD,CAAWwF,CAAX,CAAmBtF,CAAnB,CAA4B,CAEjDsF,CAAA,CAAS7G,IAAAC,IAAA,CAAS4G,CAAT,CAAiB,CAAjB,CAER,EAj4BA,GAi4BA,EAAUA,CAAV,EAj4B0B,GAi4B1B,CAAUA,CAAV,CAAoBwC,CAAAC,QAApB,CAAuCD,CAAAvC,OAAvC,EAAwD,MACjDzF,CADiD,QAE/CwF,CAF+C,SAG9CrB,EAAA,CAAcjE,CAAd,CAH8C,QAI/C3b,CAJ+C,CAAxD,CAJgD,CAanD2jB,QAASA,EAAgB,EAAG,CAC1B,IAAIC,EAAM/rB,EAAA,CAAQqa,CAAA2R,gBAAR,CAA+B7jB,CAA/B,CACG,GAAb,GAAI4jB,CAAJ,EAAgB1R,CAAA2R,gBAAA7rB,OAAA,CAA6B4rB,CAA7B,CAAkC,CAAlC,CAFU,CApFgB,IACxCH,EAAW5C,CAAAxS,MAAA,EAD6B,CAExCqU,EAAUe,CAAAf,QAF8B,CAGxCva,CAHwC,CAIxC2b,CAJwC,CAKxChY,EAAMiY,CAAA,CAAS/jB,CAAA8L,IAAT,CAAqB9L,CAAAgkB,OAArB,CAEV9R,EAAA2R,gBAAAnvB,KAAA,CAA2BsL,CAA3B,CACA0iB,EAAAD,KAAA,CAAakB,CAAb,CAA+BA,CAA/B,CAGA,EAAK3jB,CAAAmI,MAAL,EAAqBkY,CAAAlY,MAArB,IAAyD,CAAA,CAAzD,GAAwCnI,CAAAmI,MAAxC,EAAmF,KAAnF,EAAkEnI,CAAAL,OAAlE,IACEwI,CADF,CACUvR,CAAA,CAASoJ,CAAAmI,MAAT,CAAA,CAAyBnI,CAAAmI,MAAzB,CACAvR,CAAA,CAASypB,CAAAlY,MAAT,CAAA,CAA2BkY,CAAAlY,MAA3B,CACA8b,CAHV,CAMA,IAAI9b,CAAJ,CAEE,GADA2b,CACI,CADS3b,CAAAV,IAAA,CAAUqE,CAAV,CACT;AAAAnV,CAAA,CAAUmtB,CAAV,CAAJ,CAA2B,CACzB,GAAIA,CAAArB,KAAJ,CAGE,MADAqB,EAAArB,KAAA,CAAgBkB,CAAhB,CAAkCA,CAAlC,CACOG,CAAAA,CAGH9vB,EAAA,CAAQ8vB,CAAR,CAAJ,CACEP,CAAA,CAAeO,CAAA,CAAW,CAAX,CAAf,CAA8BA,CAAA,CAAW,CAAX,CAA9B,CAA6C7rB,EAAA,CAAK6rB,CAAA,CAAW,CAAX,CAAL,CAA7C,CADF,CAGEP,CAAA,CAAeO,CAAf,CAA2B,GAA3B,CAAgC,EAAhC,CAVqB,CAA3B,IAeE3b,EAAAlC,IAAA,CAAU6F,CAAV,CAAe4W,CAAf,CAKAhsB,EAAA,CAAYotB,CAAZ,CAAJ,EACEnD,CAAA,CAAa3gB,CAAAL,OAAb,CAA4BmM,CAA5B,CAAiCwW,CAAjC,CAA0Ce,CAA1C,CAAgD3B,CAAhD,CAA4D1hB,CAAAkkB,QAA5D,CACIlkB,CAAAuiB,gBADJ,CAC4BviB,CAAAmkB,aAD5B,CAIF,OAAOzB,EA5CqC,CA2F9CqB,QAASA,EAAQ,CAACjY,CAAD,CAAMkY,CAAN,CAAc,CACzB,GAAI,CAACA,CAAL,CAAa,MAAOlY,EACpB,KAAIrQ,EAAQ,EACZ7G,GAAA,CAAcovB,CAAd,CAAsB,QAAQ,CAAChvB,CAAD,CAAQZ,CAAR,CAAa,CAC5B,IAAb,EAAIY,CAAJ,EAAqBA,CAArB,EAA8BxB,CAA9B,GACKQ,CAAA,CAAQgB,CAAR,CAEL,GAFqBA,CAErB,CAF6B,CAACA,CAAD,CAE7B,EAAAf,CAAA,CAAQe,CAAR,CAAe,QAAQ,CAACqF,CAAD,CAAI,CACrBzD,CAAA,CAASyD,CAAT,CAAJ,GACEA,CADF,CACMR,EAAA,CAAOQ,CAAP,CADN,CAGAoB,EAAA/G,KAAA,CAAWiH,EAAA,CAAevH,CAAf,CAAX,CAAiC,GAAjC,CACWuH,EAAA,CAAetB,CAAf,CADX,CAJyB,CAA3B,CAHA,CADyC,CAA3C,CAYA,OAAOyR,EAAP,EAAoC,EAAtB,EAACA,CAAAjU,QAAA,CAAY,GAAZ,CAAD,CAA2B,GAA3B,CAAiC,GAA/C,EAAsD4D,CAAAnG,KAAA,CAAW,GAAX,CAf7B,CAz1B/B,IAAI2uB,EAAetT,CAAA,CAAc,OAAd,CAAnB,CAOIiS,EAAuB,EAE3B3uB,EAAA,CAAQssB,CAAR,CAA8B,QAAQ,CAAC6D,CAAD,CAAqB,CACzDxB,CAAAntB,QAAA,CAA6B1B,CAAA,CAASqwB,CAAT,CACA,CAAvBpb,CAAAvB,IAAA,CAAc2c,CAAd,CAAuB,CAAapb,CAAA7L,OAAA,CAAiBinB,CAAjB,CAD1C,CADyD,CAA3D,CAKAnwB,EAAA,CAAQwsB,CAAR,CAAsC,QAAQ,CAAC2D,CAAD,CAAqBlvB,CAArB,CAA4B,CACxE,IAAImvB,EAAatwB,CAAA,CAASqwB,CAAT,CACA,CAAXpb,CAAAvB,IAAA,CAAc2c,CAAd,CAAW,CACXpb,CAAA7L,OAAA,CAAiBinB,CAAjB,CAONxB,EAAA5qB,OAAA,CAA4B9C,CAA5B;AAAmC,CAAnC,CAAsC,UAC1BumB,QAAQ,CAACA,CAAD,CAAW,CAC3B,MAAO4I,EAAA,CAAWxD,CAAA8B,KAAA,CAAQlH,CAAR,CAAX,CADoB,CADO,eAIrBuH,QAAQ,CAACvH,CAAD,CAAW,CAChC,MAAO4I,EAAA,CAAWxD,CAAAK,OAAA,CAAUzF,CAAV,CAAX,CADyB,CAJE,CAAtC,CAVwE,CAA1E,CA2mBAvJ,EAAA2R,gBAAA,CAAwB,EAsGxBS,UAA2B,CAACloB,CAAD,CAAQ,CACjCnI,CAAA,CAAQ8B,SAAR,CAAmB,QAAQ,CAACuG,CAAD,CAAO,CAChC4V,CAAA,CAAM5V,CAAN,CAAA,CAAc,QAAQ,CAACwP,CAAD,CAAM9L,CAAN,CAAc,CAClC,MAAOkS,EAAA,CAAMrc,CAAA,CAAOmK,CAAP,EAAiB,EAAjB,CAAqB,QACxB1D,CADwB,KAE3BwP,CAF2B,CAArB,CAAN,CAD2B,CADJ,CAAlC,CADiC,CAAnCwY,CAhDA,CAAmB,KAAnB,CAA0B,QAA1B,CAAoC,MAApC,CAA4C,OAA5C,CA4DAC,UAAmC,CAACjoB,CAAD,CAAO,CACxCrI,CAAA,CAAQ8B,SAAR,CAAmB,QAAQ,CAACuG,CAAD,CAAO,CAChC4V,CAAA,CAAM5V,CAAN,CAAA,CAAc,QAAQ,CAACwP,CAAD,CAAMtO,CAAN,CAAYwC,CAAZ,CAAoB,CACxC,MAAOkS,EAAA,CAAMrc,CAAA,CAAOmK,CAAP,EAAiB,EAAjB,CAAqB,QACxB1D,CADwB,KAE3BwP,CAF2B,MAG1BtO,CAH0B,CAArB,CAAN,CADiC,CADV,CAAlC,CADwC,CAA1C+mB,CA/BA,CAA2B,MAA3B,CAAmC,KAAnC,CAaArS,EAAAmO,SAAA,CAAiBA,CAGjB,OAAOnO,EA9tBsE,CADnE,CAjDW,CA47BzBsS,QAASA,GAAoB,EAAG,CAC9B,IAAArd,KAAA,CAAY,CAAC,UAAD,CAAa,SAAb,CAAwB,WAAxB,CAAqC,QAAQ,CAACyZ,CAAD,CAAW7W,CAAX,CAAoB8E,CAApB,CAA+B,CACtF,MAAO4V,GAAA,CAAkB7D,CAAlB,CAA4B8D,EAA5B,CAAiC9D,CAAAvS,MAAjC,CAAiDtE,CAAAnM,QAAA+mB,UAAjD;AACH9V,CAAA,CAAU,CAAV,CADG,CACW9E,CAAA7S,SAAA0tB,SAAA3pB,QAAA,CAAkC,GAAlC,CAAuC,EAAvC,CADX,CAD+E,CAA5E,CADkB,CAOhCwpB,QAASA,GAAiB,CAAC7D,CAAD,CAAW8D,CAAX,CAAgBG,CAAhB,CAA+BF,CAA/B,CAA0C1Y,CAA1C,CAAuD6Y,CAAvD,CAAyE,CAyFjGC,QAASA,EAAQ,CAACjZ,CAAD,CAAMuX,CAAN,CAAY,CAAA,IAIvB2B,EAAS/Y,CAAAlK,cAAA,CAA0B,QAA1B,CAJc,CAKvBkjB,EAAcA,QAAQ,EAAG,CACvBhZ,CAAAiZ,KAAAjjB,YAAA,CAA6B+iB,CAA7B,CACI3B,EAAJ,EAAUA,CAAA,EAFa,CAK7B2B,EAAApiB,KAAA,CAAc,iBACdoiB,EAAArsB,IAAA,CAAamT,CAETlG,EAAJ,CACEof,CAAAG,mBADF,CAC8BC,QAAQ,EAAG,CACjC,iBAAAznB,KAAA,CAAuBqnB,CAAAK,WAAvB,CAAJ,EAA+CJ,CAAA,EADV,CADzC,CAKED,CAAAM,OALF,CAKkBN,CAAAO,QALlB,CAKmCN,CAGnChZ,EAAAiZ,KAAA7H,YAAA,CAA6B2H,CAA7B,CACA,OAAOC,EAtBoB,CAvF7B,MAAO,SAAQ,CAACtlB,CAAD,CAASmM,CAAT,CAAcoL,CAAd,CAAoBvK,CAApB,CAA8BgP,CAA9B,CAAuCuI,CAAvC,CAAgD3B,CAAhD,CAAiE4B,CAAjE,CAA+E,CA+D5FqB,QAASA,EAAc,EAAG,CACxBvE,CAAA,CAAU,EACVwE,EAAA,EAAaA,CAAA,EACbC,EAAA,EAAOA,CAAAC,MAAA,EAHiB,CAM1BC,QAASA,EAAe,CAACjZ,CAAD,CAAWsU,CAAX,CAAmBxF,CAAnB,CAA6B6H,CAA7B,CAA4C,CAClE,IAAIsB,EAAWE,CAAXF,EAA+BnG,EAAA,CAAW3S,CAAX,CAAA8Y,SAGnCpW,EAAA,EAAaqW,CAAApW,OAAA,CAAqBD,CAArB,CACbiX,EAAA,CAAYC,CAAZ,CAAkB,IAGlBzE,EAAA,CAAsB,MAAb,EAAC2D,CAAD,CAAwBnJ,CAAA,CAAW,GAAX,CAAiB,GAAzC,CAAgDwF,CAKzDtU,EAAA,CAFmB,IAAVsU,EAAAA,CAAAA,CAAiB,GAAjBA,CAAuBA,CAEhC;AAAiBxF,CAAjB,CAA2B6H,CAA3B,CACA1C,EAAAtU,6BAAA,CAAsChW,CAAtC,CAdkE,CApEpE,IAAI2qB,CACJL,EAAArU,6BAAA,EACAT,EAAA,CAAMA,CAAN,EAAa8U,CAAA9U,IAAA,EAEb,IAAyB,OAAzB,EAAIxR,CAAA,CAAUqF,CAAV,CAAJ,CAAkC,CAChC,IAAIkmB,EAAa,GAAbA,CAAoB9uB,CAAA4tB,CAAAmB,QAAA,EAAA/uB,UAAA,CAA8B,EAA9B,CACxB4tB,EAAA,CAAUkB,CAAV,CAAA,CAAwB,QAAQ,CAACroB,CAAD,CAAO,CACrCmnB,CAAA,CAAUkB,CAAV,CAAAroB,KAAA,CAA6BA,CADQ,CAIvC,KAAIioB,EAAYV,CAAA,CAASjZ,CAAA7Q,QAAA,CAAY,eAAZ,CAA6B,oBAA7B,CAAoD4qB,CAApD,CAAT,CACZ,QAAQ,EAAG,CACTlB,CAAA,CAAUkB,CAAV,CAAAroB,KAAJ,CACEooB,CAAA,CAAgBjZ,CAAhB,CAA0B,GAA1B,CAA+BgY,CAAA,CAAUkB,CAAV,CAAAroB,KAA/B,CADF,CAGEooB,CAAA,CAAgBjZ,CAAhB,CAA0BsU,CAA1B,EAAqC,EAArC,CAEF,QAAO0D,CAAA,CAAUkB,CAAV,CANM,CADC,CANgB,CAAlC,IAeO,CACL,IAAIH,EAAM,IAAIhB,CACdgB,EAAAK,KAAA,CAASpmB,CAAT,CAAiBmM,CAAjB,CAAsB,CAAA,CAAtB,CACA7X,EAAA,CAAQ0nB,CAAR,CAAiB,QAAQ,CAAC3mB,CAAD,CAAQZ,CAAR,CAAa,CAChCuC,CAAA,CAAU3B,CAAV,CAAJ,EACI0wB,CAAAM,iBAAA,CAAqB5xB,CAArB,CAA0BY,CAA1B,CAFgC,CAAtC,CASA0wB,EAAAP,mBAAA,CAAyBc,QAAQ,EAAG,CAClC,GAAsB,CAAtB,EAAIP,CAAAL,WAAJ,CAAyB,CACvB,IAAIa,EAAkBR,CAAAS,sBAAA,EAItBP,EAAA,CAAgBjZ,CAAhB,CACIsU,CADJ,EACcyE,CAAAzE,OADd,CAEKyE,CAAAvB,aAAA,CAAmBuB,CAAAjK,SAAnB;AAAkCiK,CAAAU,aAFvC,CAGIF,CAHJ,CALuB,CADS,CAahC3D,EAAJ,GACEmD,CAAAnD,gBADF,CACwB,CAAA,CADxB,CAII4B,EAAJ,GACEuB,CAAAvB,aADF,CACqBA,CADrB,CAIAuB,EAAAW,KAAA,CAASnP,CAAT,EAAiB,IAAjB,CAjCK,CAoCP,GAAc,CAAd,CAAIgN,CAAJ,CACE,IAAI1V,EAAYqW,CAAA,CAAcW,CAAd,CAA8BtB,CAA9B,CADlB,KAEWA,EAAJ,EAAeA,CAAAzB,KAAf,EACLyB,CAAAzB,KAAA,CAAa+C,CAAb,CA3D0F,CAFG,CAyJnGc,QAASA,GAAoB,EAAG,CAC9B,IAAI1H,EAAc,IAAlB,CACIC,EAAY,IAYhB,KAAAD,YAAA,CAAmB2H,QAAQ,CAACvxB,CAAD,CAAO,CAChC,MAAIA,EAAJ,EACE4pB,CACO,CADO5pB,CACP,CAAA,IAFT,EAIS4pB,CALuB,CAmBlC,KAAAC,UAAA,CAAiB2H,QAAQ,CAACxxB,CAAD,CAAO,CAC9B,MAAIA,EAAJ,EACE6pB,CACO,CADK7pB,CACL,CAAA,IAFT,EAIS6pB,CALqB,CAUhC,KAAA1X,KAAA,CAAY,CAAC,QAAD,CAAW,mBAAX,CAAgC,MAAhC,CAAwC,QAAQ,CAACiL,CAAD,CAASZ,CAAT,CAA4Bc,CAA5B,CAAkC,CA0C5FL,QAASA,EAAY,CAACmK,CAAD,CAAOqK,CAAP,CAA2BC,CAA3B,CAA2C,CAW9D,IAX8D,IAC1DjtB,CAD0D,CAE1DktB,CAF0D,CAG1DzxB,EAAQ,CAHkD,CAI1DuG,EAAQ,EAJkD,CAK1D5H,EAASuoB,CAAAvoB,OALiD,CAM1D+yB,EAAmB,CAAA,CANuC,CAS1DltB,EAAS,EAEb,CAAMxE,CAAN,CAAcrB,CAAd,CAAA,CAC4D,EAA1D,GAAO4F,CAAP,CAAoB2iB,CAAAvkB,QAAA,CAAa+mB,CAAb,CAA0B1pB,CAA1B,CAApB,GAC+E,EAD/E,GACOyxB,CADP,CACkBvK,CAAAvkB,QAAA,CAAagnB,CAAb,CAAwBplB,CAAxB,CAAqCotB,CAArC,CADlB,GAEG3xB,CAID,EAJUuE,CAIV,EAJyBgC,CAAA/G,KAAA,CAAW0nB,CAAAhO,UAAA,CAAelZ,CAAf,CAAsBuE,CAAtB,CAAX,CAIzB,CAHAgC,CAAA/G,KAAA,CAAW4E,CAAX,CAAgB8Y,CAAA,CAAO0U,CAAP,CAAa1K,CAAAhO,UAAA,CAAe3U,CAAf;AAA4BotB,CAA5B,CAA+CF,CAA/C,CAAb,CAAhB,CAGA,CAFArtB,CAAAwtB,IAEA,CAFSA,CAET,CADA5xB,CACA,CADQyxB,CACR,CADmBI,CACnB,CAAAH,CAAA,CAAmB,CAAA,CANrB,GASG1xB,CACD,EADUrB,CACV,EADqB4H,CAAA/G,KAAA,CAAW0nB,CAAAhO,UAAA,CAAelZ,CAAf,CAAX,CACrB,CAAAA,CAAA,CAAQrB,CAVV,CAcF,EAAMA,CAAN,CAAe4H,CAAA5H,OAAf,IAEE4H,CAAA/G,KAAA,CAAW,EAAX,CACA,CAAAb,CAAA,CAAS,CAHX,CAYA,IAAI6yB,CAAJ,EAAqC,CAArC,CAAsBjrB,CAAA5H,OAAtB,CACI,KAAMmzB,GAAA,CAAmB,UAAnB,CAGsD5K,CAHtD,CAAN,CAMJ,GAAI,CAACqK,CAAL,EAA4BG,CAA5B,CA6BE,MA5BAltB,EAAA7F,OA4BOyF,CA5BSzF,CA4BTyF,CA3BPA,CA2BOA,CA3BFA,QAAQ,CAACnF,CAAD,CAAU,CACrB,GAAI,CACF,IADE,IACMU,EAAI,CADV,CACaiT,EAAKjU,CADlB,CAC0BozB,CAA5B,CAAkCpyB,CAAlC,CAAoCiT,CAApC,CAAwCjT,CAAA,EAAxC,CACkC,UAahC,EAbI,OAAQoyB,CAAR,CAAexrB,CAAA,CAAM5G,CAAN,CAAf,CAaJ,GAZEoyB,CAMA,CANOA,CAAA,CAAK9yB,CAAL,CAMP,CAJE8yB,CAIF,CALIP,CAAJ,CACSpU,CAAA4U,WAAA,CAAgBR,CAAhB,CAAgCO,CAAhC,CADT,CAGS3U,CAAA6U,QAAA,CAAaF,CAAb,CAET,CAAY,IAAZ,EAAIA,CAAJ,EAAoBA,CAApB,EAA4BzzB,CAA5B,CACEyzB,CADF,CACS,EADT,CAE0B,QAF1B,EAEW,MAAOA,EAFlB,GAGEA,CAHF,CAGSptB,EAAA,CAAOotB,CAAP,CAHT,CAMF,EAAAvtB,CAAA,CAAO7E,CAAP,CAAA,CAAYoyB,CAEd,OAAOvtB,EAAApE,KAAA,CAAY,EAAZ,CAjBL,CAmBJ,MAAM8xB,CAAN,CAAW,CACLC,CACJ,CADaL,EAAA,CAAmB,QAAnB,CAA4D5K,CAA5D,CAAkEgL,CAAArwB,SAAA,EAAlE,CACb,CAAAya,CAAA,CAAkB6V,CAAlB,CAFS,CApBU,CA2BhB/tB,CAFPA,CAAAwtB,IAEOxtB,CAFE8iB,CAEF9iB,CADPA,CAAAmC,MACOnC,CADImC,CACJnC,CAAAA,CA1EqD,CA1C4B,IACxFutB,EAAoBjI,CAAA/qB,OADoE,CAExFkzB,EAAkBlI,CAAAhrB,OAmItBoe,EAAA2M,YAAA,CAA2B0I,QAAQ,EAAG,CACpC,MAAO1I,EAD6B,CAiBtC3M,EAAA4M,UAAA,CAAyB0I,QAAQ,EAAG,CAClC,MAAO1I,EAD2B,CAIpC;MAAO5M,EA1JqF,CAAlF,CA3CkB,CAyMhCuV,QAASA,GAAiB,EAAG,CAC3B,IAAArgB,KAAA,CAAY,CAAC,YAAD,CAAe,SAAf,CAA0B,IAA1B,CACP,QAAQ,CAAC8C,CAAD,CAAeF,CAAf,CAA0B8W,CAA1B,CAA8B,CA8BzCxV,QAASA,EAAQ,CAAC/R,CAAD,CAAKiV,CAAL,CAAYkZ,CAAZ,CAAmBC,CAAnB,CAAgC,CAAA,IAC3CtwB,EAAc2S,CAAA3S,YAD6B,CAE3CuwB,EAAgB5d,CAAA4d,cAF2B,CAI3ClE,EAAW5C,CAAAxS,MAAA,EAJgC,CAK3CqU,EAAUe,CAAAf,QACV+E,EAN2C,CAMlC9wB,CAAA,CAAU8wB,CAAV,CAAD,CAAqBA,CAArB,CAA6B,CANM,KAO3CG,EAAY,CAP+B,CAQ3CC,EAAalxB,CAAA,CAAU+wB,CAAV,CAAbG,EAAuC,CAACH,CAE5ChF,EAAAD,KAAA,CAAa,IAAb,CAAmB,IAAnB,CAAyBnpB,CAAzB,CAEAopB,EAAAoF,aAAA,CAAuB1wB,CAAA,CAAY2wB,QAAa,EAAG,CACjDtE,CAAAuE,OAAA,CAAgBJ,CAAA,EAAhB,CAEY,EAAZ,CAAIH,CAAJ,EAAiBG,CAAjB,EAA8BH,CAA9B,GACEhE,CAAAC,QAAA,CAAiBkE,CAAjB,CAEA,CADAD,CAAA,CAAcjF,CAAAoF,aAAd,CACA,CAAA,OAAOG,CAAA,CAAUvF,CAAAoF,aAAV,CAHT,CAMKD,EAAL,EAAgB5d,CAAA1M,OAAA,EATiC,CAA5B,CAWpBgR,CAXoB,CAavB0Z,EAAA,CAAUvF,CAAAoF,aAAV,CAAA,CAAkCrE,CAElC,OAAOf,EA3BwC,CA7BjD,IAAIuF,EAAY,EAuEhB5c,EAAAoD,OAAA,CAAkByZ,QAAQ,CAACxF,CAAD,CAAU,CAClC,MAAIA,EAAJ,EAAeA,CAAAoF,aAAf,GAAuCG,EAAvC,EACEA,CAAA,CAAUvF,CAAAoF,aAAV,CAAA5G,OAAA,CAAuC,UAAvC,CAGO,CAFPyG,aAAA,CAAcjF,CAAAoF,aAAd,CAEO,CADP,OAAOG,CAAA,CAAUvF,CAAAoF,aAAV,CACA;AAAA,CAAA,CAJT,EAMO,CAAA,CAP2B,CAUpC,OAAOzc,EAlFkC,CAD/B,CADe,CAkG7B8c,QAASA,GAAe,EAAE,CACxB,IAAAhhB,KAAA,CAAY4H,QAAQ,EAAG,CACrB,MAAO,IACD,OADC,gBAGW,aACD,GADC,WAEH,GAFG,UAGJ,CACR,QACU,CADV,SAEW,CAFX,SAGW,CAHX,QAIU,EAJV,QAKU,EALV,QAMU,GANV,QAOU,EAPV,OAQS,CART,QASU,CATV,CADQ,CAWN,QACQ,CADR,SAES,CAFT,SAGS,CAHT,QAIQ,QAJR,QAKQ,EALR,QAMQ,SANR,QAOQ,GAPR,OAQO,CARP,QASQ,CATR,CAXM,CAHI,cA0BA,GA1BA,CAHX,kBAgCa,OACT,uFAAA,MAAA,CAAA,GAAA,CADS,YAGH,iDAAA,MAAA,CAAA,GAAA,CAHG;IAIX,0DAAA,MAAA,CAAA,GAAA,CAJW,UAKN,6BAAA,MAAA,CAAA,GAAA,CALM,OAMT,CAAC,IAAD,CAAM,IAAN,CANS,QAOR,oBAPQ,CAQhBqZ,OARgB,CAQT,eARS,UASN,iBATM,UAUN,WAVM,YAWJ,UAXI,WAYL,QAZK,YAaJ,WAbI,WAcL,QAdK,CAhCb,WAiDMC,QAAQ,CAACC,CAAD,CAAM,CACvB,MAAY,EAAZ,GAAIA,CAAJ,CACS,KADT,CAGO,OAJgB,CAjDpB,CADc,CADC,CAwE1BC,QAASA,GAAU,CAACzpB,CAAD,CAAO,CACpB0pB,CAAAA,CAAW1pB,CAAAvD,MAAA,CAAW,GAAX,CAGf,KAHA,IACI1G,EAAI2zB,CAAA30B,OAER,CAAOgB,CAAA,EAAP,CAAA,CACE2zB,CAAA,CAAS3zB,CAAT,CAAA,CAAc+G,EAAA,CAAiB4sB,CAAA,CAAS3zB,CAAT,CAAjB,CAGhB,OAAO2zB,EAAAlzB,KAAA,CAAc,GAAd,CARiB,CAW1BmzB,QAASA,GAAgB,CAACC,CAAD,CAAcC,CAAd,CAA2B,CAClD,IAAIC,EAAYnK,EAAA,CAAWiK,CAAX,CAEhBC,EAAAE,WAAA;AAAyBD,CAAAhE,SACzB+D,EAAAG,OAAA,CAAqBF,CAAAG,SACrBJ,EAAAK,OAAA,CAAqBhzB,CAAA,CAAI4yB,CAAAK,KAAJ,CAArB,EAA4CC,EAAA,CAAcN,CAAAhE,SAAd,CAA5C,EAAiF,IAL/B,CASpDuE,QAASA,GAAW,CAACC,CAAD,CAAcT,CAAd,CAA2B,CAC7C,IAAIU,EAAsC,GAAtCA,GAAYD,CAAAjwB,OAAA,CAAmB,CAAnB,CACZkwB,EAAJ,GACED,CADF,CACgB,GADhB,CACsBA,CADtB,CAGA,KAAIpuB,EAAQyjB,EAAA,CAAW2K,CAAX,CACZT,EAAAW,OAAA,CAAqBnuB,kBAAA,CAAmBkuB,CAAA,EAAyC,GAAzC,GAAYruB,CAAAuuB,SAAApwB,OAAA,CAAsB,CAAtB,CAAZ,CAA+C6B,CAAAuuB,SAAAnb,UAAA,CAAyB,CAAzB,CAA/C,CAA6EpT,CAAAuuB,SAAhG,CACrBZ,EAAAa,SAAA,CAAuBpuB,EAAA,CAAcJ,CAAAyuB,OAAd,CACvBd,EAAAe,OAAA,CAAqBvuB,kBAAA,CAAmBH,CAAAqP,KAAnB,CAGjBse,EAAAW,OAAJ,EAA0D,GAA1D,EAA0BX,CAAAW,OAAAnwB,OAAA,CAA0B,CAA1B,CAA1B,GAA+DwvB,CAAAW,OAA/D,CAAoF,GAApF,CAA0FX,CAAAW,OAA1F,CAX6C,CAqB/CK,QAASA,GAAU,CAACC,CAAD,CAAQC,CAAR,CAAe,CAChC,GAA4B,CAA5B,EAAIA,CAAAhyB,QAAA,CAAc+xB,CAAd,CAAJ,CACE,MAAOC,EAAAjxB,OAAA,CAAagxB,CAAA/1B,OAAb,CAFuB,CAOlCi2B,QAASA,GAAS,CAAChe,CAAD,CAAM,CACtB,IAAI5W,EAAQ4W,CAAAjU,QAAA,CAAY,GAAZ,CACZ,OAAiB,EAAV,EAAA3C,CAAA,CAAc4W,CAAd,CAAoBA,CAAAlT,OAAA,CAAW,CAAX,CAAc1D,CAAd,CAFL,CAMxB60B,QAASA,GAAS,CAACje,CAAD,CAAM,CACtB,MAAOA,EAAAlT,OAAA,CAAW,CAAX;AAAckxB,EAAA,CAAUhe,CAAV,CAAAke,YAAA,CAA2B,GAA3B,CAAd,CAAgD,CAAhD,CADe,CAkBxBC,QAASA,GAAgB,CAACC,CAAD,CAAUC,CAAV,CAAsB,CAC7C,IAAAC,QAAA,CAAe,CAAA,CACfD,EAAA,CAAaA,CAAb,EAA2B,EAC3B,KAAIE,EAAgBN,EAAA,CAAUG,CAAV,CACpBzB,GAAA,CAAiByB,CAAjB,CAA0B,IAA1B,CAQA,KAAAI,QAAA,CAAeC,QAAQ,CAACze,CAAD,CAAM,CAC3B,IAAI0e,EAAUb,EAAA,CAAWU,CAAX,CAA0Bve,CAA1B,CACd,IAAI,CAAC/X,CAAA,CAASy2B,CAAT,CAAL,CACE,KAAMC,GAAA,CAAgB,UAAhB,CAA6E3e,CAA7E,CAAkFue,CAAlF,CAAN,CAGFlB,EAAA,CAAYqB,CAAZ,CAAqB,IAArB,CAEK,KAAAlB,OAAL,GACE,IAAAA,OADF,CACgB,GADhB,CAIA,KAAAoB,UAAA,EAZ2B,CAmB7B,KAAAA,UAAA,CAAiBC,QAAQ,EAAG,CAAA,IACtBlB,EAASjuB,EAAA,CAAW,IAAAguB,SAAX,CADa,CAEtBnf,EAAO,IAAAqf,OAAA,CAAc,GAAd,CAAoB9tB,EAAA,CAAiB,IAAA8tB,OAAjB,CAApB,CAAoD,EAE/D,KAAAkB,MAAA,CAAarC,EAAA,CAAW,IAAAe,OAAX,CAAb,EAAwCG,CAAA,CAAS,GAAT,CAAeA,CAAf,CAAwB,EAAhE,EAAsEpf,CACtE,KAAAwgB,SAAA,CAAgBR,CAAhB,CAAgC,IAAAO,MAAAhyB,OAAA,CAAkB,CAAlB,CALN,CAQ5B,KAAAkyB,UAAA,CAAiBC,QAAQ,CAACjf,CAAD,CAAM,CAAA,IACzBkf,CAEJ,KAAMA,CAAN,CAAerB,EAAA,CAAWO,CAAX,CAAoBpe,CAApB,CAAf,IAA6CtY,CAA7C,CAEE,MADAy3B,EACA,CADaD,CACb,CAAA,CAAMA,CAAN,CAAerB,EAAA,CAAWQ,CAAX,CAAuBa,CAAvB,CAAf,IAAmDx3B,CAAnD,CACS62B,CADT,EAC0BV,EAAA,CAAW,GAAX,CAAgBqB,CAAhB,CAD1B,EACqDA,CADrD,EAGSd,CAHT,CAGmBe,CAEd,KAAMD,CAAN,CAAerB,EAAA,CAAWU,CAAX;AAA0Bve,CAA1B,CAAf,IAAmDtY,CAAnD,CACL,MAAO62B,EAAP,CAAuBW,CAClB,IAAIX,CAAJ,EAAqBve,CAArB,CAA2B,GAA3B,CACL,MAAOue,EAboB,CAvCc,CAmE/Ca,QAASA,GAAmB,CAAChB,CAAD,CAAUiB,CAAV,CAAsB,CAChD,IAAId,EAAgBN,EAAA,CAAUG,CAAV,CAEpBzB,GAAA,CAAiByB,CAAjB,CAA0B,IAA1B,CAQA,KAAAI,QAAA,CAAeC,QAAQ,CAACze,CAAD,CAAM,CAC3B,IAAIsf,EAAiBzB,EAAA,CAAWO,CAAX,CAAoBpe,CAApB,CAAjBsf,EAA6CzB,EAAA,CAAWU,CAAX,CAA0Bve,CAA1B,CAAjD,CACIuf,EAA6C,GAC5B,EADAD,CAAAjyB,OAAA,CAAsB,CAAtB,CACA,CAAfwwB,EAAA,CAAWwB,CAAX,CAAuBC,CAAvB,CAAe,CACd,IAAAhB,QACD,CAAEgB,CAAF,CACE,EAER,IAAI,CAACr3B,CAAA,CAASs3B,CAAT,CAAL,CACE,KAAMZ,GAAA,CAAgB,UAAhB,CAA6E3e,CAA7E,CAAkFqf,CAAlF,CAAN,CAEFhC,EAAA,CAAYkC,CAAZ,CAA4B,IAA5B,CACA,KAAAX,UAAA,EAZ2B,CAmB7B,KAAAA,UAAA,CAAiBC,QAAQ,EAAG,CAAA,IACtBlB,EAASjuB,EAAA,CAAW,IAAAguB,SAAX,CADa,CAEtBnf,EAAO,IAAAqf,OAAA,CAAc,GAAd,CAAoB9tB,EAAA,CAAiB,IAAA8tB,OAAjB,CAApB,CAAoD,EAE/D,KAAAkB,MAAA,CAAarC,EAAA,CAAW,IAAAe,OAAX,CAAb,EAAwCG,CAAA,CAAS,GAAT,CAAeA,CAAf,CAAwB,EAAhE,EAAsEpf,CACtE,KAAAwgB,SAAA,CAAgBX,CAAhB,EAA2B,IAAAU,MAAA,CAAaO,CAAb,CAA0B,IAAAP,MAA1B,CAAuC,EAAlE,CAL0B,CAQ5B,KAAAE,UAAA,CAAiBC,QAAQ,CAACjf,CAAD,CAAM,CAC7B,GAAGge,EAAA,CAAUI,CAAV,CAAH,EAAyBJ,EAAA,CAAUhe,CAAV,CAAzB,CACE,MAAOA,EAFoB,CAtCiB,CAuDlDwf,QAASA,GAA0B,CAACpB,CAAD,CAAUiB,CAAV,CAAsB,CACvD,IAAAf,QAAA,CAAe,CAAA,CACfc,GAAAl0B,MAAA,CAA0B,IAA1B;AAAgCjB,SAAhC,CAEA,KAAIs0B,EAAgBN,EAAA,CAAUG,CAAV,CAEpB,KAAAY,UAAA,CAAiBC,QAAQ,CAACjf,CAAD,CAAM,CAC7B,IAAIkf,CAEJ,IAAKd,CAAL,EAAgBJ,EAAA,CAAUhe,CAAV,CAAhB,CACE,MAAOA,EACF,IAAMkf,CAAN,CAAerB,EAAA,CAAWU,CAAX,CAA0Bve,CAA1B,CAAf,CACL,MAAOoe,EAAP,CAAiBiB,CAAjB,CAA8BH,CACzB,IAAKX,CAAL,GAAuBve,CAAvB,CAA6B,GAA7B,CACL,MAAOue,EARoB,CANwB,CA2NzDkB,QAASA,GAAc,CAACC,CAAD,CAAW,CAChC,MAAO,SAAQ,EAAG,CAChB,MAAO,KAAA,CAAKA,CAAL,CADS,CADc,CAOlCC,QAASA,GAAoB,CAACD,CAAD,CAAWE,CAAX,CAAuB,CAClD,MAAO,SAAQ,CAAC12B,CAAD,CAAQ,CACrB,GAAI0B,CAAA,CAAY1B,CAAZ,CAAJ,CACE,MAAO,KAAA,CAAKw2B,CAAL,CAET,KAAA,CAAKA,CAAL,CAAA,CAAiBE,CAAA,CAAW12B,CAAX,CACjB,KAAA01B,UAAA,EAEA,OAAO,KAPc,CAD2B,CAgDpDiB,QAASA,GAAiB,EAAE,CAAA,IACtBR,EAAa,EADS,CAEtBS,EAAY,CAAA,CAUhB,KAAAT,WAAA,CAAkBU,QAAQ,CAACC,CAAD,CAAS,CACjC,MAAIn1B,EAAA,CAAUm1B,CAAV,CAAJ,EACEX,CACO,CADMW,CACN,CAAA,IAFT,EAISX,CALwB,CAiBnC,KAAAS,UAAA,CAAiBG,QAAQ,CAAC9T,CAAD,CAAO,CAC9B,MAAIthB,EAAA,CAAUshB,CAAV,CAAJ,EACE2T,CACO,CADK3T,CACL,CAAA,IAFT,EAIS2T,CALqB,CAShC,KAAAzkB,KAAA,CAAY,CAAC,YAAD,CAAe,UAAf,CAA2B,UAA3B,CAAuC,cAAvC,CACR,QAAQ,CAAE8C,CAAF,CAAgB2W,CAAhB,CAA4B9V,CAA5B,CAAwC4I,CAAxC,CAAsD,CA8FhEsY,QAASA,EAAmB,CAACC,CAAD,CAAS,CACnChiB,CAAAiiB,WAAA,CAAsB,wBAAtB;AAAgDliB,CAAAmiB,OAAA,EAAhD,CAAoEF,CAApE,CADmC,CA9F2B,IAC5DjiB,CAD4D,CAG5DuD,EAAWqT,CAAArT,SAAA,EAHiD,CAI5D6e,EAAaxL,CAAA9U,IAAA,EAGb8f,EAAJ,EACE1B,CACA,CADqBkC,CAvclBhe,UAAA,CAAc,CAAd,CAuckBge,CAvcDv0B,QAAA,CAAY,GAAZ,CAucCu0B,CAvcgBv0B,QAAA,CAAY,IAAZ,CAAjB,CAAqC,CAArC,CAAjB,CAwcH,EADoC0V,CACpC,EADgD,GAChD,EAAA8e,CAAA,CAAevhB,CAAAoB,QAAA,CAAmB+d,EAAnB,CAAsCqB,EAFvD,GAIEpB,CACA,CADUJ,EAAA,CAAUsC,CAAV,CACV,CAAAC,CAAA,CAAenB,EALjB,CAOAlhB,EAAA,CAAY,IAAIqiB,CAAJ,CAAiBnC,CAAjB,CAA0B,GAA1B,CAAgCiB,CAAhC,CACZnhB,EAAAsgB,QAAA,CAAkBtgB,CAAA8gB,UAAA,CAAoBsB,CAApB,CAAlB,CAEA1Y,EAAAlc,GAAA,CAAgB,OAAhB,CAAyB,QAAQ,CAACuN,CAAD,CAAQ,CAIvC,GAAIunB,CAAAvnB,CAAAunB,QAAJ,EAAqBC,CAAAxnB,CAAAwnB,QAArB,EAAqD,CAArD,EAAsCxnB,CAAAynB,MAAtC,CAAA,CAKA,IAHA,IAAIliB,EAAM7P,CAAA,CAAOsK,CAAAO,OAAP,CAGV,CAAsC,GAAtC,GAAOhL,CAAA,CAAUgQ,CAAA,CAAI,CAAJ,CAAA/S,SAAV,CAAP,CAAA,CAEE,GAAI+S,CAAA,CAAI,CAAJ,CAAJ,GAAeoJ,CAAA,CAAa,CAAb,CAAf,EAAkC,CAAC,CAACpJ,CAAD,CAAOA,CAAAlU,OAAA,EAAP,EAAqB,CAArB,CAAnC,CAA4D,MAG9D,KAAIq2B,EAAUniB,CAAAiU,KAAA,CAAS,MAAT,CAAd,CACImO,EAAe1iB,CAAA8gB,UAAA,CAAoB2B,CAApB,CAEfA,EAAJ,GAAgB,CAAAniB,CAAA1N,KAAA,CAAS,QAAT,CAAhB,EAAsC8vB,CAAtC,EAAuD,CAAA3nB,CAAAW,mBAAA,EAAvD,IACEX,CAAAC,eAAA,EACA,CAAI0nB,CAAJ,EAAoB9L,CAAA9U,IAAA,EAApB,GAEE9B,CAAAsgB,QAAA,CAAkBoC,CAAlB,CAGA,CAFAziB,CAAA1M,OAAA,EAEA,CAAAjK,CAAAsK,QAAA,CAAe,0BAAf,CAAA;AAA6C,CAAA,CAL/C,CAFF,CAbA,CAJuC,CAAzC,CA+BIoM,EAAAmiB,OAAA,EAAJ,EAA0BC,CAA1B,EACExL,CAAA9U,IAAA,CAAa9B,CAAAmiB,OAAA,EAAb,CAAiC,CAAA,CAAjC,CAIFvL,EAAAxT,YAAA,CAAqB,QAAQ,CAACuf,CAAD,CAAS,CAChC3iB,CAAAmiB,OAAA,EAAJ,EAA0BQ,CAA1B,GACM1iB,CAAAiiB,WAAA,CAAsB,sBAAtB,CAA8CS,CAA9C,CAAsD3iB,CAAAmiB,OAAA,EAAtD,CAAA3mB,iBAAJ,CACEob,CAAA9U,IAAA,CAAa9B,CAAAmiB,OAAA,EAAb,CADF,EAIAliB,CAAA7R,WAAA,CAAsB,QAAQ,EAAG,CAC/B,IAAI6zB,EAASjiB,CAAAmiB,OAAA,EAEbniB,EAAAsgB,QAAA,CAAkBqC,CAAlB,CACAX,EAAA,CAAoBC,CAApB,CAJ+B,CAAjC,CAMA,CAAKhiB,CAAAuZ,QAAL,EAAyBvZ,CAAA2iB,QAAA,EAVzB,CADF,CADoC,CAAtC,CAiBA,KAAIC,EAAgB,CACpB5iB,EAAA5R,OAAA,CAAkBy0B,QAAuB,EAAG,CAC1C,IAAIb,EAASrL,CAAA9U,IAAA,EAAb,CACIihB,EAAiB/iB,CAAAgjB,UAEhBH,EAAL,EAAsBZ,CAAtB,EAAgCjiB,CAAAmiB,OAAA,EAAhC,GACEU,CAAA,EACA,CAAA5iB,CAAA7R,WAAA,CAAsB,QAAQ,EAAG,CAC3B6R,CAAAiiB,WAAA,CAAsB,sBAAtB,CAA8CliB,CAAAmiB,OAAA,EAA9C,CAAkEF,CAAlE,CAAAzmB,iBAAJ,CAEEwE,CAAAsgB,QAAA,CAAkB2B,CAAlB,CAFF,EAIErL,CAAA9U,IAAA,CAAa9B,CAAAmiB,OAAA,EAAb,CAAiCY,CAAjC,CACA,CAAAf,CAAA,CAAoBC,CAApB,CALF,CAD+B,CAAjC,CAFF,CAYAjiB,EAAAgjB,UAAA,CAAsB,CAAA,CAEtB,OAAOH,EAlBmC,CAA5C,CAqBA,OAAO7iB,EA5FyD,CADtD,CAtCc,CAp0PW;AAy/PvCijB,QAASA,GAAY,EAAE,CAAA,IACjBC,EAAQ,CAAA,CADS,CAEjB7zB,EAAO,IAUX,KAAA8zB,aAAA,CAAoBC,QAAQ,CAACC,CAAD,CAAO,CAClC,MAAI12B,EAAA,CAAU02B,CAAV,CAAJ,EACCH,CACO,CADCG,CACD,CAAA,IAFR,EAIQH,CAL0B,CASnC,KAAA/lB,KAAA,CAAY,CAAC,SAAD,CAAY,QAAQ,CAAC4C,CAAD,CAAS,CA6DvCujB,QAASA,EAAW,CAAC/uB,CAAD,CAAM,CACpBA,CAAJ,WAAmBgvB,MAAnB,GACMhvB,CAAA0J,MAAJ,CACE1J,CADF,CACSA,CAAAyJ,QACD,EADoD,EACpD,GADgBzJ,CAAA0J,MAAApQ,QAAA,CAAkB0G,CAAAyJ,QAAlB,CAChB,CAAA,SAAA,CAAYzJ,CAAAyJ,QAAZ,CAA0B,IAA1B,CAAiCzJ,CAAA0J,MAAjC,CACA1J,CAAA0J,MAHR,CAIW1J,CAAAivB,UAJX,GAKEjvB,CALF,CAKQA,CAAAyJ,QALR,CAKsB,IALtB,CAK6BzJ,CAAAivB,UAL7B,CAK6C,GAL7C,CAKmDjvB,CAAAohB,KALnD,CADF,CASA,OAAOphB,EAViB,CAa1BkvB,QAASA,EAAU,CAAC7qB,CAAD,CAAO,CAAA,IACpB8qB,EAAU3jB,CAAA2jB,QAAVA,EAA6B,EADT,CAEpBC,EAAQD,CAAA,CAAQ9qB,CAAR,CAAR+qB,EAAyBD,CAAAE,IAAzBD,EAAwCr3B,CAE5C,OAAIq3B,EAAA32B,MAAJ,CACS,QAAQ,EAAG,CAChB,IAAIwR,EAAO,EACXvU,EAAA,CAAQ8B,SAAR,CAAmB,QAAQ,CAACwI,CAAD,CAAM,CAC/BiK,CAAA9T,KAAA,CAAU44B,CAAA,CAAY/uB,CAAZ,CAAV,CAD+B,CAAjC,CAGA,OAAOovB,EAAA32B,MAAA,CAAY02B,CAAZ,CAAqBllB,CAArB,CALS,CADpB,CAYO,QAAQ,CAACqlB,CAAD,CAAOC,CAAP,CAAa,CAC1BH,CAAA,CAAME,CAAN,CAAoB,IAAR,EAAAC,CAAA,CAAe,EAAf,CAAoBA,CAAhC,CAD0B,CAhBJ,CAzE1B,MAAO,KASAL,CAAA,CAAW,KAAX,CATA;KAmBCA,CAAA,CAAW,MAAX,CAnBD,MA6BCA,CAAA,CAAW,MAAX,CA7BD,OAuCEA,CAAA,CAAW,OAAX,CAvCF,OAiDG,QAAS,EAAG,CACrB,IAAIn0B,EAAKm0B,CAAA,CAAW,OAAX,CAET,OAAO,SAAQ,EAAG,CACbP,CAAJ,EACC5zB,CAAAtC,MAAA,CAASqC,CAAT,CAAetD,SAAf,CAFgB,CAHG,CAAZ,EAjDH,CADgC,CAA7B,CArBS,CAqJvBg4B,QAASA,GAAoB,CAACzxB,CAAD,CAAO0xB,CAAP,CAAuB,CAClD,GAAa,aAAb,GAAI1xB,CAAJ,CACE,KAAM2xB,GAAA,CAAa,SAAb,CACuFD,CADvF,CAAN,CAGF,MAAO1xB,EAL2C,CAQpD4xB,QAASA,GAAgB,CAACv6B,CAAD,CAAMq6B,CAAN,CAAsB,CAE7C,GAAIr6B,CAAJ,EAAWA,CAAAgL,YAAX,GAA+BhL,CAA/B,CACE,KAAMs6B,GAAA,CAAa,QAAb,CAC4ED,CAD5E,CAAN,CAEK,GACHr6B,CADG,EACIA,CAAAJ,SADJ,EACoBI,CAAAuD,SADpB,EACoCvD,CAAAwD,MADpC,EACiDxD,CAAAyD,YADjD,CAEL,KAAM62B,GAAA,CAAa,YAAb,CAC8ED,CAD9E,CAAN,CAEK,GACHr6B,CADG,GACKA,CAAA4D,SADL,EACsB5D,CAAA6D,GADtB,EACgC7D,CAAA8D,KADhC,EAEL,KAAMw2B,GAAA,CAAa,SAAb,CAC6ED,CAD7E,CAAN,CAGA,MAAOr6B,EAdoC,CAqxB/Cw6B,QAASA,GAAM,CAACx6B,CAAD,CAAMmL,CAAN,CAAYsvB,CAAZ,CAAsBC,CAAtB,CAA+Bnf,CAA/B,CAAwC,CAErDA,CAAA,CAAUA,CAAV,EAAqB,EAEjB1U,EAAAA,CAAUsE,CAAAvD,MAAA,CAAW,GAAX,CACd,KADA,IAA+BnH,CAA/B,CACSS,EAAI,CAAb,CAAiC,CAAjC,CAAgB2F,CAAA3G,OAAhB,CAAoCgB,CAAA,EAApC,CAAyC,CACvCT,CAAA,CAAM25B,EAAA,CAAqBvzB,CAAA8G,MAAA,EAArB,CAAsC+sB,CAAtC,CACN,KAAIC;AAAc36B,CAAA,CAAIS,CAAJ,CACbk6B,EAAL,GACEA,CACA,CADc,EACd,CAAA36B,CAAA,CAAIS,CAAJ,CAAA,CAAWk6B,CAFb,CAIA36B,EAAA,CAAM26B,CACF36B,EAAA8uB,KAAJ,EAAgBvT,CAAAqf,eAAhB,GACEC,EAAA,CAAeH,CAAf,CASA,CARM,KAQN,EARe16B,EAQf,EAPG,QAAQ,CAAC+uB,CAAD,CAAU,CACjBA,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CADiB,CAAlB,CAECjG,CAFD,CAOH,CAHIA,CAAA86B,IAGJ,GAHgBj7B,CAGhB,GAFEG,CAAA86B,IAEF,CAFY,EAEZ,EAAA96B,CAAA,CAAMA,CAAA86B,IAVR,CARuC,CAqBzCr6B,CAAA,CAAM25B,EAAA,CAAqBvzB,CAAA8G,MAAA,EAArB,CAAsC+sB,CAAtC,CAEN,OADA16B,EAAA,CAAIS,CAAJ,CACA,CADWg6B,CA3B0C,CAsCvDM,QAASA,GAAe,CAACC,CAAD,CAAOC,CAAP,CAAaC,CAAb,CAAmBC,CAAnB,CAAyBC,CAAzB,CAA+BV,CAA/B,CAAwCnf,CAAxC,CAAiD,CACvE6e,EAAA,CAAqBY,CAArB,CAA2BN,CAA3B,CACAN,GAAA,CAAqBa,CAArB,CAA2BP,CAA3B,CACAN,GAAA,CAAqBc,CAArB,CAA2BR,CAA3B,CACAN,GAAA,CAAqBe,CAArB,CAA2BT,CAA3B,CACAN,GAAA,CAAqBgB,CAArB,CAA2BV,CAA3B,CAEA,OAAQnf,EAAAqf,eACD,CAoBDS,QAAoC,CAAC5xB,CAAD,CAAQmL,CAAR,CAAgB,CAAA,IAC9C0mB,EAAW1mB,CAAD,EAAWA,CAAAjU,eAAA,CAAsBq6B,CAAtB,CAAX,CAA0CpmB,CAA1C,CAAmDnL,CADf,CAE9CslB,CAEJ,IAAgB,IAAhB,GAAIuM,CAAJ,EAAwBA,CAAxB,GAAoCz7B,CAApC,CAA+C,MAAOy7B,EAGtD,EADAA,CACA,CADUA,CAAA,CAAQN,CAAR,CACV,GAAeM,CAAAxM,KAAf,GACE+L,EAAA,CAAeH,CAAf,CAMA,CALM,KAKN,EALeY,EAKf,GAJEvM,CAEA,CAFUuM,CAEV,CADAvM,CAAA+L,IACA,CADcj7B,CACd,CAAAkvB,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CAEF,EAAAq1B,CAAA,CAAUA,CAAAR,IAPZ,CASA,IAAI,CAACG,CAAL,EAAyB,IAAzB,GAAaK,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAG/D,EADAA,CACA,CADUA,CAAA,CAAQL,CAAR,CACV,GAAeK,CAAAxM,KAAf,GACE+L,EAAA,CAAeH,CAAf,CAMA,CALM,KAKN,EALeY,EAKf;CAJEvM,CAEA,CAFUuM,CAEV,CADAvM,CAAA+L,IACA,CADcj7B,CACd,CAAAkvB,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CAEF,EAAAq1B,CAAA,CAAUA,CAAAR,IAPZ,CASA,IAAI,CAACI,CAAL,EAAyB,IAAzB,GAAaI,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAG/D,EADAA,CACA,CADUA,CAAA,CAAQJ,CAAR,CACV,GAAeI,CAAAxM,KAAf,GACE+L,EAAA,CAAeH,CAAf,CAMA,CALM,KAKN,EALeY,EAKf,GAJEvM,CAEA,CAFUuM,CAEV,CADAvM,CAAA+L,IACA,CADcj7B,CACd,CAAAkvB,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CAEF,EAAAq1B,CAAA,CAAUA,CAAAR,IAPZ,CASA,IAAI,CAACK,CAAL,EAAyB,IAAzB,GAAaG,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAG/D,EADAA,CACA,CADUA,CAAA,CAAQH,CAAR,CACV,GAAeG,CAAAxM,KAAf,GACE+L,EAAA,CAAeH,CAAf,CAMA,CALM,KAKN,EALeY,EAKf,GAJEvM,CAEA,CAFUuM,CAEV,CADAvM,CAAA+L,IACA,CADcj7B,CACd,CAAAkvB,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CAEF,EAAAq1B,CAAA,CAAUA,CAAAR,IAPZ,CASA,IAAI,CAACM,CAAL,EAAyB,IAAzB,GAAaE,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAG/D,EADAA,CACA,CADUA,CAAA,CAAQF,CAAR,CACV,GAAeE,CAAAxM,KAAf,GACE+L,EAAA,CAAeH,CAAf,CAMA,CALM,KAKN,EALeY,EAKf,GAJEvM,CAEA,CAFUuM,CAEV,CADAvM,CAAA+L,IACA,CADcj7B,CACd,CAAAkvB,CAAAD,KAAA,CAAa,QAAQ,CAAC7oB,CAAD,CAAM,CAAE8oB,CAAA+L,IAAA,CAAc70B,CAAhB,CAA3B,CAEF,EAAAq1B,CAAA,CAAUA,CAAAR,IAPZ,CASA,OAAOQ,EAhE2C,CApBnD,CAADC,QAAsB,CAAC9xB,CAAD,CAAQmL,CAAR,CAAgB,CACpC,IAAI0mB,EAAW1mB,CAAD,EAAWA,CAAAjU,eAAA,CAAsBq6B,CAAtB,CAAX,CAA0CpmB,CAA1C,CAAmDnL,CAEjE,IAAgB,IAAhB,GAAI6xB,CAAJ,EAAwBA,CAAxB,GAAoCz7B,CAApC,CAA+C,MAAOy7B,EACtDA,EAAA,CAAUA,CAAA,CAAQN,CAAR,CAEV;GAAI,CAACC,CAAL,EAAyB,IAAzB,GAAaK,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAC/DA,EAAA,CAAUA,CAAA,CAAQL,CAAR,CAEV,IAAI,CAACC,CAAL,EAAyB,IAAzB,GAAaI,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAC/DA,EAAA,CAAUA,CAAA,CAAQJ,CAAR,CAEV,IAAI,CAACC,CAAL,EAAyB,IAAzB,GAAaG,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CAAwD,MAAOy7B,EAC/DA,EAAA,CAAUA,CAAA,CAAQH,CAAR,CAEV,OAAKC,EAAL,EAAyB,IAAzB,GAAaE,CAAb,EAAiCA,CAAjC,GAA6Cz7B,CAA7C,CACAy7B,CADA,CACUA,CAAA,CAAQF,CAAR,CADV,CAA+DE,CAf3B,CAR2B,CAgGzEE,QAASA,GAAQ,CAACrwB,CAAD,CAAOoQ,CAAP,CAAgBmf,CAAhB,CAAyB,CAIxC,GAAIe,EAAA96B,eAAA,CAA6BwK,CAA7B,CAAJ,CACE,MAAOswB,GAAA,CAActwB,CAAd,CAL+B,KAQpCuwB,EAAWvwB,CAAAvD,MAAA,CAAW,GAAX,CARyB,CASpC+zB,EAAiBD,CAAAx7B,OATmB,CAUpCyF,CAEJ,IAAI4V,CAAAqgB,IAAJ,CACEj2B,CAAA,CAAuB,CAClB,CADCg2B,CACD,CAACZ,EAAA,CAAgBW,CAAA,CAAS,CAAT,CAAhB,CAA6BA,CAAA,CAAS,CAAT,CAA7B,CAA0CA,CAAA,CAAS,CAAT,CAA1C,CAAuDA,CAAA,CAAS,CAAT,CAAvD,CAAoEA,CAAA,CAAS,CAAT,CAApE,CAAiFhB,CAAjF,CAA0Fnf,CAA1F,CAAD,CACC,QAAQ,CAAC9R,CAAD,CAAQmL,CAAR,CAAgB,CAAA,IACpB1T,EAAI,CADgB,CACb+E,CACX,GACEA,EAKA,CALM80B,EAAA,CACEW,CAAA,CAASx6B,CAAA,EAAT,CADF,CACiBw6B,CAAA,CAASx6B,CAAA,EAAT,CADjB,CACgCw6B,CAAA,CAASx6B,CAAA,EAAT,CADhC,CAC+Cw6B,CAAA,CAASx6B,CAAA,EAAT,CAD/C,CAC8Dw6B,CAAA,CAASx6B,CAAA,EAAT,CAD9D,CAC6Ew5B,CAD7E,CACsFnf,CADtF,CAAA,CAEE9R,CAFF,CAESmL,CAFT,CAKN,CADAA,CACA,CADS/U,CACT,CAAA4J,CAAA,CAAQxD,CANV,OAOS/E,CAPT,CAOay6B,CAPb,CAQA,OAAO11B,EAViB,CAHhC,KAeO,CACL,IAAI8hB,EAAO,iBACXznB,EAAA,CAAQo7B,CAAR,CAAkB,QAAQ,CAACj7B,CAAD,CAAMc,CAAN,CAAa,CACrC64B,EAAA,CAAqB35B,CAArB,CAA0Bi6B,CAA1B,CACA3S,EAAA,EAAQ,uDAAR;CAEexmB,CAEA,CAAG,GAAH,CAEG,yBAFH,CAE+Bd,CAF/B,CAEqC,UANpD,EAMkE,IANlE,CAMyEA,CANzE,CAMsF,OANtF,EAOS8a,CAAAqf,eACA,CAAG,2BAAH,CACaF,CAAApzB,QAAA,CAAgB,KAAhB,CAAuB,KAAvB,CADb,CAQC,4GARD,CASG,EAjBZ,CAFqC,CAAvC,CAqBA,KAAAygB,EAAAA,CAAAA,CAAQ,WAAR,CAEI8T,EAAiBC,QAAA,CAAS,GAAT,CAAc,GAAd,CAAmB,IAAnB,CAAyB/T,CAAzB,CACrB8T,EAAAz4B,SAAA,CAA0B24B,QAAQ,EAAG,CAAE,MAAOhU,EAAT,CACrCpiB,EAAA,CAAKA,QAAQ,CAAC8D,CAAD,CAAQmL,CAAR,CAAgB,CAC3B,MAAOinB,EAAA,CAAepyB,CAAf,CAAsBmL,CAAtB,CAA8BimB,EAA9B,CADoB,CA3BxB,CAkCM,gBAAb,GAAI1vB,CAAJ,GACEswB,EAAA,CAActwB,CAAd,CADF,CACwBxF,CADxB,CAGA,OAAOA,EAhEiC,CAsH1Cq2B,QAASA,GAAc,EAAG,CACxB,IAAIxnB,EAAQ,EAAZ,CAEIynB,EAAgB,KACb,CAAA,CADa,gBAEF,CAAA,CAFE,oBAGE,CAAA,CAHF,CA+CpB,KAAArB,eAAA,CAAsBsB,QAAQ,CAAC76B,CAAD,CAAQ,CACpC,MAAI2B,EAAA,CAAU3B,CAAV,CAAJ;CACE46B,CAAArB,eACO,CADwB,CAAC,CAACv5B,CAC1B,CAAA,IAFT,EAIS46B,CAAArB,eAL2B,CA2BvC,KAAAuB,mBAAA,CAA0BC,QAAQ,CAAC/6B,CAAD,CAAQ,CACvC,MAAI2B,EAAA,CAAU3B,CAAV,CAAJ,EACE46B,CAAAE,mBACO,CAD4B96B,CAC5B,CAAA,IAFT,EAIS46B,CAAAE,mBAL8B,CAUzC,KAAA3oB,KAAA,CAAY,CAAC,SAAD,CAAY,UAAZ,CAAwB,MAAxB,CAAgC,QAAQ,CAAC6oB,CAAD,CAAUllB,CAAV,CAAoBD,CAApB,CAA0B,CAC5E+kB,CAAAL,IAAA,CAAoBzkB,CAAAykB,IAEpBf,GAAA,CAAiBA,QAAyB,CAACH,CAAD,CAAU,CAC7CuB,CAAAE,mBAAL,EAAyC,CAAAG,EAAA37B,eAAA,CAAmC+5B,CAAnC,CAAzC,GACA4B,EAAA,CAAoB5B,CAApB,CACA,CAD+B,CAAA,CAC/B,CAAAxjB,CAAAoD,KAAA,CAAU,4CAAV,CAAyDogB,CAAzD,CACI,2EADJ,CAFA,CADkD,CAOpD,OAAO,SAAQ,CAACvH,CAAD,CAAM,CACnB,IAAIoJ,CAEJ,QAAQ,MAAOpJ,EAAf,EACE,KAAK,QAAL,CAEE,GAAI3e,CAAA7T,eAAA,CAAqBwyB,CAArB,CAAJ,CACE,MAAO3e,EAAA,CAAM2e,CAAN,CAGLqJ;CAAAA,CAAQ,IAAIC,EAAJ,CAAUR,CAAV,CAEZM,EAAA,CAAmB/1B,CADNk2B,IAAIC,EAAJD,CAAWF,CAAXE,CAAkBL,CAAlBK,CAA2BT,CAA3BS,CACMl2B,OAAA,CAAa2sB,CAAb,CAAkB,CAAA,CAAlB,CAEP,iBAAZ,GAAIA,CAAJ,GAGE3e,CAAA,CAAM2e,CAAN,CAHF,CAGeoJ,CAHf,CAMA,OAAOA,EAET,MAAK,UAAL,CACE,MAAOpJ,EAET,SACE,MAAOxwB,EAvBX,CAHmB,CAVuD,CAAlE,CAvFY,CA0S1Bi6B,QAASA,GAAU,EAAG,CAEpB,IAAAppB,KAAA,CAAY,CAAC,YAAD,CAAe,mBAAf,CAAoC,QAAQ,CAAC8C,CAAD,CAAauH,CAAb,CAAgC,CACtF,MAAOgf,GAAA,CAAS,QAAQ,CAAC7jB,CAAD,CAAW,CACjC1C,CAAA7R,WAAA,CAAsBuU,CAAtB,CADiC,CAA5B,CAEJ6E,CAFI,CAD+E,CAA5E,CAFQ,CAkBtBgf,QAASA,GAAQ,CAACC,CAAD,CAAWC,CAAX,CAA6B,CAgR5CC,QAASA,EAAe,CAAC37B,CAAD,CAAQ,CAC9B,MAAOA,EADuB,CAKhC47B,QAASA,EAAc,CAACpyB,CAAD,CAAS,CAC9B,MAAO0iB,EAAA,CAAO1iB,CAAP,CADuB,CA1QhC,IAAI6P,EAAQA,QAAQ,EAAG,CAAA,IACjBwiB,EAAU,EADO,CAEjB77B,CAFiB,CAEVyuB,CA+HX,OA7HAA,EA6HA,CA7HW,SAEAC,QAAQ,CAAC9pB,CAAD,CAAM,CACrB,GAAIi3B,CAAJ,CAAa,CACX,IAAIlM,EAAYkM,CAChBA,EAAA,CAAUr9B,CACVwB,EAAA,CAAQ87B,CAAA,CAAIl3B,CAAJ,CAEJ+qB,EAAA9wB,OAAJ,EACE48B,CAAA,CAAS,QAAQ,EAAG,CAElB,IADA,IAAI9jB,CAAJ,CACS9X,EAAI,CADb,CACgBiT,EAAK6c,CAAA9wB,OAArB,CAAuCgB,CAAvC,CAA2CiT,CAA3C,CAA+CjT,CAAA,EAA/C,CACE8X,CACA,CADWgY,CAAA,CAAU9vB,CAAV,CACX,CAAAG,CAAAytB,KAAA,CAAW9V,CAAA,CAAS,CAAT,CAAX,CAAwBA,CAAA,CAAS,CAAT,CAAxB,CAAqCA,CAAA,CAAS,CAAT,CAArC,CAJgB,CAApB,CANS,CADQ,CAFd,QAqBDuU,QAAQ,CAAC1iB,CAAD,CAAS,CACvBilB,CAAAC,QAAA,CAAiBxC,CAAA,CAAO1iB,CAAP,CAAjB,CADuB,CArBhB;OA0BDwpB,QAAQ,CAAC+I,CAAD,CAAW,CACzB,GAAIF,CAAJ,CAAa,CACX,IAAIlM,EAAYkM,CAEZA,EAAAh9B,OAAJ,EACE48B,CAAA,CAAS,QAAQ,EAAG,CAElB,IADA,IAAI9jB,CAAJ,CACS9X,EAAI,CADb,CACgBiT,EAAK6c,CAAA9wB,OAArB,CAAuCgB,CAAvC,CAA2CiT,CAA3C,CAA+CjT,CAAA,EAA/C,CACE8X,CACA,CADWgY,CAAA,CAAU9vB,CAAV,CACX,CAAA8X,CAAA,CAAS,CAAT,CAAA,CAAYokB,CAAZ,CAJgB,CAApB,CAJS,CADY,CA1BlB,SA2CA,MACDtO,QAAQ,CAAC9V,CAAD,CAAWqkB,CAAX,CAAoBC,CAApB,CAAkC,CAC9C,IAAI9mB,EAASkE,CAAA,EAAb,CAEI6iB,EAAkBA,QAAQ,CAACl8B,CAAD,CAAQ,CACpC,GAAI,CACFmV,CAAAuZ,QAAA,CAAgB,CAAArvB,CAAA,CAAWsY,CAAX,CAAA,CAAuBA,CAAvB,CAAkCgkB,CAAlC,EAAmD37B,CAAnD,CAAhB,CADE,CAEF,MAAM4F,CAAN,CAAS,CACTuP,CAAA+W,OAAA,CAActmB,CAAd,CACA,CAAA81B,CAAA,CAAiB91B,CAAjB,CAFS,CAHyB,CAFtC,CAWIu2B,EAAiBA,QAAQ,CAAC3yB,CAAD,CAAS,CACpC,GAAI,CACF2L,CAAAuZ,QAAA,CAAgB,CAAArvB,CAAA,CAAW28B,CAAX,CAAA,CAAsBA,CAAtB,CAAgCJ,CAAhC,EAAgDpyB,CAAhD,CAAhB,CADE,CAEF,MAAM5D,CAAN,CAAS,CACTuP,CAAA+W,OAAA,CAActmB,CAAd,CACA,CAAA81B,CAAA,CAAiB91B,CAAjB,CAFS,CAHyB,CAXtC,CAoBIw2B,EAAsBA,QAAQ,CAACL,CAAD,CAAW,CAC3C,GAAI,CACF5mB,CAAA6d,OAAA,CAAe,CAAA3zB,CAAA,CAAW48B,CAAX,CAAA,CAA2BA,CAA3B,CAA0CN,CAA1C,EAA2DI,CAA3D,CAAf,CADE,CAEF,MAAMn2B,CAAN,CAAS,CACT81B,CAAA,CAAiB91B,CAAjB,CADS,CAHgC,CAQzCi2B,EAAJ,CACEA,CAAAn8B,KAAA,CAAa,CAACw8B,CAAD,CAAkBC,CAAlB,CAAkCC,CAAlC,CAAb,CADF,CAGEp8B,CAAAytB,KAAA,CAAWyO,CAAX,CAA4BC,CAA5B,CAA4CC,CAA5C,CAGF,OAAOjnB,EAAAuY,QAnCuC,CADzC,CAuCP,OAvCO,CAuCE2O,QAAQ,CAAC1kB,CAAD,CAAW,CAC1B,MAAO,KAAA8V,KAAA,CAAU,IAAV,CAAgB9V,CAAhB,CADmB,CAvCrB,CA2CP,SA3CO,CA2CI2kB,QAAQ,CAAC3kB,CAAD,CAAW,CAE5B4kB,QAASA,EAAW,CAACv8B,CAAD,CAAQw8B,CAAR,CAAkB,CACpC,IAAIrnB,EAASkE,CAAA,EACTmjB,EAAJ,CACErnB,CAAAuZ,QAAA,CAAe1uB,CAAf,CADF;AAGEmV,CAAA+W,OAAA,CAAclsB,CAAd,CAEF,OAAOmV,EAAAuY,QAP6B,CAUtC+O,QAASA,EAAc,CAACz8B,CAAD,CAAQ08B,CAAR,CAAoB,CACzC,IAAIC,EAAiB,IACrB,IAAI,CACFA,CAAA,CAAkB,CAAAhlB,CAAA,EAAWgkB,CAAX,GADhB,CAEF,MAAM/1B,CAAN,CAAS,CACT,MAAO22B,EAAA,CAAY32B,CAAZ,CAAe,CAAA,CAAf,CADE,CAGX,MAAI+2B,EAAJ,EAAsBt9B,CAAA,CAAWs9B,CAAAlP,KAAX,CAAtB,CACSkP,CAAAlP,KAAA,CAAoB,QAAQ,EAAG,CACpC,MAAO8O,EAAA,CAAYv8B,CAAZ,CAAmB08B,CAAnB,CAD6B,CAA/B,CAEJ,QAAQ,CAACvmB,CAAD,CAAQ,CACjB,MAAOomB,EAAA,CAAYpmB,CAAZ,CAAmB,CAAA,CAAnB,CADU,CAFZ,CADT,CAOSomB,CAAA,CAAYv8B,CAAZ,CAAmB08B,CAAnB,CAdgC,CAkB3C,MAAO,KAAAjP,KAAA,CAAU,QAAQ,CAACztB,CAAD,CAAQ,CAC/B,MAAOy8B,EAAA,CAAez8B,CAAf,CAAsB,CAAA,CAAtB,CADwB,CAA1B,CAEJ,QAAQ,CAACmW,CAAD,CAAQ,CACjB,MAAOsmB,EAAA,CAAetmB,CAAf,CAAsB,CAAA,CAAtB,CADU,CAFZ,CA9BqB,CA3CvB,CA3CA,CAJU,CAAvB,CAqII2lB,EAAMA,QAAQ,CAAC97B,CAAD,CAAQ,CACxB,MAAIA,EAAJ,EAAaX,CAAA,CAAWW,CAAAytB,KAAX,CAAb,CAA4CztB,CAA5C,CACO,MACCytB,QAAQ,CAAC9V,CAAD,CAAW,CACvB,IAAIxC,EAASkE,CAAA,EACboiB,EAAA,CAAS,QAAQ,EAAG,CAClBtmB,CAAAuZ,QAAA,CAAe/W,CAAA,CAAS3X,CAAT,CAAf,CADkB,CAApB,CAGA,OAAOmV,EAAAuY,QALgB,CADpB,CAFiB,CArI1B,CAsLIxB,EAASA,QAAQ,CAAC1iB,CAAD,CAAS,CAC5B,MAAO,MACCikB,QAAQ,CAAC9V,CAAD,CAAWqkB,CAAX,CAAoB,CAChC,IAAI7mB,EAASkE,CAAA,EACboiB,EAAA,CAAS,QAAQ,EAAG,CAClB,GAAI,CACFtmB,CAAAuZ,QAAA,CAAgB,CAAArvB,CAAA,CAAW28B,CAAX,CAAA,CAAsBA,CAAtB,CAAgCJ,CAAhC,EAAgDpyB,CAAhD,CAAhB,CADE,CAEF,MAAM5D,CAAN,CAAS,CACTuP,CAAA+W,OAAA,CAActmB,CAAd,CACA,CAAA81B,CAAA,CAAiB91B,CAAjB,CAFS,CAHO,CAApB,CAQA,OAAOuP,EAAAuY,QAVyB,CAD7B,CADqB,CA+H9B;MAAO,OACErU,CADF,QAEG6S,CAFH,MAjGIyB,QAAQ,CAAC3tB,CAAD,CAAQ2X,CAAR,CAAkBqkB,CAAlB,CAA2BC,CAA3B,CAAyC,CAAA,IACtD9mB,EAASkE,CAAA,EAD6C,CAEtDgV,CAFsD,CAItD6N,EAAkBA,QAAQ,CAACl8B,CAAD,CAAQ,CACpC,GAAI,CACF,MAAQ,CAAAX,CAAA,CAAWsY,CAAX,CAAA,CAAuBA,CAAvB,CAAkCgkB,CAAlC,EAAmD37B,CAAnD,CADN,CAEF,MAAO4F,CAAP,CAAU,CAEV,MADA81B,EAAA,CAAiB91B,CAAjB,CACO,CAAAsmB,CAAA,CAAOtmB,CAAP,CAFG,CAHwB,CAJoB,CAatDu2B,EAAiBA,QAAQ,CAAC3yB,CAAD,CAAS,CACpC,GAAI,CACF,MAAQ,CAAAnK,CAAA,CAAW28B,CAAX,CAAA,CAAsBA,CAAtB,CAAgCJ,CAAhC,EAAgDpyB,CAAhD,CADN,CAEF,MAAO5D,CAAP,CAAU,CAEV,MADA81B,EAAA,CAAiB91B,CAAjB,CACO,CAAAsmB,CAAA,CAAOtmB,CAAP,CAFG,CAHwB,CAboB,CAsBtDw2B,EAAsBA,QAAQ,CAACL,CAAD,CAAW,CAC3C,GAAI,CACF,MAAQ,CAAA18B,CAAA,CAAW48B,CAAX,CAAA,CAA2BA,CAA3B,CAA0CN,CAA1C,EAA2DI,CAA3D,CADN,CAEF,MAAOn2B,CAAP,CAAU,CACV81B,CAAA,CAAiB91B,CAAjB,CADU,CAH+B,CAQ7C61B,EAAA,CAAS,QAAQ,EAAG,CAClBK,CAAA,CAAI97B,CAAJ,CAAAytB,KAAA,CAAgB,QAAQ,CAACztB,CAAD,CAAQ,CAC1BquB,CAAJ,GACAA,CACA,CADO,CAAA,CACP,CAAAlZ,CAAAuZ,QAAA,CAAeoN,CAAA,CAAI97B,CAAJ,CAAAytB,KAAA,CAAgByO,CAAhB,CAAiCC,CAAjC,CAAiDC,CAAjD,CAAf,CAFA,CAD8B,CAAhC,CAIG,QAAQ,CAAC5yB,CAAD,CAAS,CACd6kB,CAAJ,GACAA,CACA,CADO,CAAA,CACP,CAAAlZ,CAAAuZ,QAAA,CAAeyN,CAAA,CAAe3yB,CAAf,CAAf,CAFA,CADkB,CAJpB,CAQG,QAAQ,CAACuyB,CAAD,CAAW,CAChB1N,CAAJ,EACAlZ,CAAA6d,OAAA,CAAcoJ,CAAA,CAAoBL,CAApB,CAAd,CAFoB,CARtB,CADkB,CAApB,CAeA,OAAO5mB,EAAAuY,QA7CmD,CAiGrD,KAxBPhc,QAAY,CAACkrB,CAAD,CAAW,CAAA,IACjBnO,EAAWpV,CAAA,EADM,CAEjByX,EAAU,CAFO,CAGjBnuB,EAAU3D,CAAA,CAAQ49B,CAAR,CAAA,CAAoB,EAApB,CAAyB,EAEvC39B,EAAA,CAAQ29B,CAAR,CAAkB,QAAQ,CAAClP,CAAD,CAAUtuB,CAAV,CAAe,CACvC0xB,CAAA,EACAgL,EAAA,CAAIpO,CAAJ,CAAAD,KAAA,CAAkB,QAAQ,CAACztB,CAAD,CAAQ,CAC5B2C,CAAArD,eAAA,CAAuBF,CAAvB,CAAJ;CACAuD,CAAA,CAAQvD,CAAR,CACA,CADeY,CACf,CAAM,EAAE8wB,CAAR,EAAkBrC,CAAAC,QAAA,CAAiB/rB,CAAjB,CAFlB,CADgC,CAAlC,CAIG,QAAQ,CAAC6G,CAAD,CAAS,CACd7G,CAAArD,eAAA,CAAuBF,CAAvB,CAAJ,EACAqvB,CAAAvC,OAAA,CAAgB1iB,CAAhB,CAFkB,CAJpB,CAFuC,CAAzC,CAYgB,EAAhB,GAAIsnB,CAAJ,EACErC,CAAAC,QAAA,CAAiB/rB,CAAjB,CAGF,OAAO8rB,EAAAf,QArBc,CAwBhB,CAhUqC,CAoY9CmP,QAASA,GAAkB,EAAE,CAC3B,IAAIC,EAAM,EAAV,CACIC,EAAmBt+B,CAAA,CAAO,YAAP,CAEvB,KAAAu+B,UAAA,CAAiBC,QAAQ,CAACj9B,CAAD,CAAQ,CAC3Be,SAAAlC,OAAJ,GACEi+B,CADF,CACQ98B,CADR,CAGA,OAAO88B,EAJwB,CAOjC,KAAA3qB,KAAA,CAAY,CAAC,WAAD,CAAc,mBAAd,CAAmC,QAAnC,CAA6C,UAA7C,CACR,QAAQ,CAAE6B,CAAF,CAAewI,CAAf,CAAoCY,CAApC,CAA8CwO,CAA9C,CAAwD,CAyClEsR,QAASA,EAAK,EAAG,CACf,IAAAC,IAAA,CAAWl9B,EAAA,EACX,KAAAuuB,QAAA,CAAe,IAAA3L,QAAf,CAA8B,IAAAua,WAA9B,CACe,IAAAC,cADf,CACoC,IAAAC,cADpC,CAEe,IAAAC,YAFf,CAEkC,IAAAC,YAFlC,CAEqD,IACrD,KAAA,CAAK,MAAL,CAAA,CAAe,IAAAC,MAAf,CAA6B,IAC7B,KAAAC,YAAA,CAAmB,CAAA,CACnB,KAAAC,aAAA;AAAoB,EACpB,KAAAC,kBAAA,CAAyB,EACzB,KAAAC,YAAA,CAAmB,EACnB,KAAAxa,kBAAA,CAAyB,EAVV,CA+0BjBya,QAASA,EAAU,CAACC,CAAD,CAAQ,CACzB,GAAI9oB,CAAAuZ,QAAJ,CACE,KAAMuO,EAAA,CAAiB,QAAjB,CAAsD9nB,CAAAuZ,QAAtD,CAAN,CAGFvZ,CAAAuZ,QAAA,CAAqBuP,CALI,CAY3BC,QAASA,EAAW,CAAClM,CAAD,CAAMxqB,CAAN,CAAY,CAC9B,IAAIhD,EAAK8Y,CAAA,CAAO0U,CAAP,CACTroB,GAAA,CAAYnF,CAAZ,CAAgBgD,CAAhB,CACA,OAAOhD,EAHuB,CAUhC25B,QAASA,EAAY,EAAG,EA/0BxBf,CAAAtpB,UAAA,CAAkB,aACHspB,CADG,MA2BVhe,QAAQ,CAACgf,CAAD,CAAU,CAIlBA,CAAJ,EACEC,CAIA,CAJQ,IAAIjB,CAIZ,CAHAiB,CAAAV,MAGA,CAHc,IAAAA,MAGd,CADAU,CAAAR,aACA,CADqB,IAAAA,aACrB,CAAAQ,CAAAP,kBAAA,CAA0B,IAAAA,kBAL5B,GAOEQ,CAKA,CALQA,QAAQ,EAAG,EAKnB,CAFAA,CAAAxqB,UAEA,CAFkB,IAElB,CADAuqB,CACA,CADQ,IAAIC,CACZ,CAAAD,CAAAhB,IAAA,CAAYl9B,EAAA,EAZd,CAcAk+B,EAAA,CAAM,MAAN,CAAA,CAAgBA,CAChBA,EAAAN,YAAA,CAAoB,EACpBM,EAAAtb,QAAA,CAAgB,IAChBsb,EAAAf,WAAA,CAAmBe,CAAAd,cAAnB,CAAyCc,CAAAZ,YAAzC,CAA6DY,CAAAX,YAA7D;AAAiF,IACjFW,EAAAb,cAAA,CAAsB,IAAAE,YAClB,KAAAD,YAAJ,CAEE,IAAAC,YAFF,CACE,IAAAA,YAAAH,cADF,CACmCc,CADnC,CAIE,IAAAZ,YAJF,CAIqB,IAAAC,YAJrB,CAIwCW,CAExC,OAAOA,EA7Be,CA3BR,QAqIR96B,QAAQ,CAACg7B,CAAD,CAAWrnB,CAAX,CAAqBsnB,CAArB,CAAqC,CAAA,IAE/C7rB,EAAMurB,CAAA,CAAYK,CAAZ,CAAsB,OAAtB,CAFyC,CAG/Cv7B,EAFQsF,IAEAg1B,WAHuC,CAI/CmB,EAAU,IACJvnB,CADI,MAEFinB,CAFE,KAGHxrB,CAHG,KAIH4rB,CAJG,IAKJ,CAAC,CAACC,CALE,CASd,IAAI,CAACj/B,CAAA,CAAW2X,CAAX,CAAL,CAA2B,CACzB,IAAIwnB,EAAWR,CAAA,CAAYhnB,CAAZ,EAAwB1V,CAAxB,CAA8B,UAA9B,CACfi9B,EAAAj6B,GAAA,CAAam6B,QAAQ,CAACC,CAAD,CAASC,CAAT,CAAiBv2B,CAAjB,CAAwB,CAACo2B,CAAA,CAASp2B,CAAT,CAAD,CAFpB,CAK3B,GAAuB,QAAvB,EAAI,MAAOi2B,EAAX,EAAmC5rB,CAAAwB,SAAnC,CAAiD,CAC/C,IAAI2qB,EAAaL,CAAAj6B,GACjBi6B,EAAAj6B,GAAA,CAAam6B,QAAQ,CAACC,CAAD,CAASC,CAAT,CAAiBv2B,CAAjB,CAAwB,CAC3Cw2B,CAAAr/B,KAAA,CAAgB,IAAhB,CAAsBm/B,CAAtB,CAA8BC,CAA9B,CAAsCv2B,CAAtC,CACArF,GAAA,CAAYD,CAAZ,CAAmBy7B,CAAnB,CAF2C,CAFE,CAQ5Cz7B,CAAL,GACEA,CADF,CAzBYsF,IA0BFg1B,WADV,CAC6B,EAD7B,CAKAt6B,EAAArC,QAAA,CAAc89B,CAAd,CAEA,OAAO,SAAQ,EAAG,CAChBx7B,EAAA,CAAYD,CAAZ,CAAmBy7B,CAAnB,CADgB,CAjCiC,CArIrC,kBAkOEM,QAAQ,CAAClgC,CAAD,CAAMqY,CAAN,CAAgB,CACxC,IAAI3S;AAAO,IAAX,CACIy6B,CADJ,CAEIC,CAFJ,CAGIC,EAAiB,CAHrB,CAIIC,EAAY7hB,CAAA,CAAOze,CAAP,CAJhB,CAKIugC,EAAgB,EALpB,CAMIC,EAAiB,EANrB,CAOIC,EAAY,CA2EhB,OAAO,KAAA/7B,OAAA,CAzEPg8B,QAA8B,EAAG,CAC/BN,CAAA,CAAWE,CAAA,CAAU56B,CAAV,CADoB,KAE3Bi7B,CAF2B,CAEhBlgC,CAEf,IAAKwC,CAAA,CAASm9B,CAAT,CAAL,CAKO,GAAIrgC,EAAA,CAAYqgC,CAAZ,CAAJ,CAgBL,IAfID,CAeKj/B,GAfQq/B,CAeRr/B,GAbPi/B,CAEA,CAFWI,CAEX,CADAE,CACA,CADYN,CAAAjgC,OACZ,CAD8B,CAC9B,CAAAmgC,CAAA,EAWOn/B,EARTy/B,CAQSz/B,CARGk/B,CAAAlgC,OAQHgB,CANLu/B,CAMKv/B,GANSy/B,CAMTz/B,GAJPm/B,CAAA,EACA,CAAAF,CAAAjgC,OAAA,CAAkBugC,CAAlB,CAA8BE,CAGvBz/B,EAAAA,CAAAA,CAAI,CAAb,CAAgBA,CAAhB,CAAoBy/B,CAApB,CAA+Bz/B,CAAA,EAA/B,CACMi/B,CAAA,CAASj/B,CAAT,CAAJ,GAAoBk/B,CAAA,CAASl/B,CAAT,CAApB,GACEm/B,CAAA,EACA,CAAAF,CAAA,CAASj/B,CAAT,CAAA,CAAck/B,CAAA,CAASl/B,CAAT,CAFhB,CAjBG,KAsBA,CACDi/B,CAAJ,GAAiBK,CAAjB,GAEEL,CAEA,CAFWK,CAEX,CAF4B,EAE5B,CADAC,CACA,CADY,CACZ,CAAAJ,CAAA,EAJF,CAOAM,EAAA,CAAY,CACZ,KAAKlgC,CAAL,GAAY2/B,EAAZ,CACMA,CAAAz/B,eAAA,CAAwBF,CAAxB,CAAJ,GACEkgC,CAAA,EACA,CAAIR,CAAAx/B,eAAA,CAAwBF,CAAxB,CAAJ,CACM0/B,CAAA,CAAS1/B,CAAT,CADN,GACwB2/B,CAAA,CAAS3/B,CAAT,CADxB,GAEI4/B,CAAA,EACA,CAAAF,CAAA,CAAS1/B,CAAT,CAAA,CAAgB2/B,CAAA,CAAS3/B,CAAT,CAHpB,GAMEggC,CAAA,EAEA,CADAN,CAAA,CAAS1/B,CAAT,CACA,CADgB2/B,CAAA,CAAS3/B,CAAT,CAChB,CAAA4/B,CAAA,EARF,CAFF,CAcF,IAAII,CAAJ,CAAgBE,CAAhB,CAGE,IAAIlgC,CAAJ,GADA4/B,EAAA,EACWF,CAAAA,CAAX,CACMA,CAAAx/B,eAAA,CAAwBF,CAAxB,CAAJ,EAAqC,CAAA2/B,CAAAz/B,eAAA,CAAwBF,CAAxB,CAArC,GACEggC,CAAA,EACA,CAAA,OAAON,CAAA,CAAS1/B,CAAT,CAFT,CA5BC,CA3BP,IACM0/B,EAAJ,GAAiBC,CAAjB,GACED,CACA,CADWC,CACX,CAAAC,CAAA,EAFF,CA6DF,OAAOA,EAlEwB,CAyE1B,CAJPO,QAA+B,EAAG,CAChCvoB,CAAA,CAAS+nB,CAAT,CAAmBD,CAAnB,CAA6Bz6B,CAA7B,CADgC,CAI3B,CAnFiC,CAlO1B,SAuWPuzB,QAAQ,EAAG,CAAA,IACd4H,CADc;AACPx/B,CADO,CACA4R,CADA,CAEd6tB,CAFc,CAGdC,EAAa,IAAA/B,aAHC,CAIdgC,EAAkB,IAAA/B,kBAJJ,CAKd/+B,CALc,CAMd+gC,CANc,CAMPC,EAAM/C,CANC,CAORzT,CAPQ,CAQdyW,EAAW,EARG,CASdC,CATc,CASNC,CATM,CASEC,EAEpBnC,EAAA,CAAW,SAAX,CAEA,GAAG,CACD8B,CAAA,CAAQ,CAAA,CAGR,KAFAvW,CAEA,CAV0B/Y,IAU1B,CAAMovB,CAAA7gC,OAAN,CAAA,CACE,GAAI,CACFohC,EACA,CADYP,CAAApzB,MAAA,EACZ,CAAA2zB,EAAA73B,MAAA83B,MAAA,CAAsBD,EAAA9V,WAAtB,CAFE,CAGF,MAAOvkB,EAAP,CAAU,CACV4W,CAAA,CAAkB5W,EAAlB,CADU,CAKd,EAAG,CACD,GAAK65B,CAAL,CAAgBpW,CAAA+T,WAAhB,CAGE,IADAv+B,CACA,CADS4gC,CAAA5gC,OACT,CAAOA,CAAA,EAAP,CAAA,CACE,GAAI,CAIF,CAHA2gC,CAGA,CAHQC,CAAA,CAAS5gC,CAAT,CAGR,KAAcmB,CAAd,CAAsBw/B,CAAA/sB,IAAA,CAAU4W,CAAV,CAAtB,KAA+CzX,CAA/C,CAAsD4tB,CAAA5tB,KAAtD,GAEM,EADA4tB,CAAAnhB,GACA,CAAIxa,EAAA,CAAO7D,CAAP,CAAc4R,CAAd,CAAJ,CACqB,QADrB,EACK,MAAO5R,EADZ,EACgD,QADhD,EACiC,MAAO4R,EADxC,EAEQuuB,KAAA,CAAMngC,CAAN,CAFR,EAEwBmgC,KAAA,CAAMvuB,CAAN,CAFxB,CAFN,IAKEguB,CAGA,CAHQ,CAAA,CAGR,CAFAJ,CAAA5tB,KAEA,CAFa4tB,CAAAnhB,GAAA,CAAWpb,EAAA,CAAKjD,CAAL,CAAX,CAAyBA,CAEtC,CADAw/B,CAAAl7B,GAAA,CAAStE,CAAT,CAAkB4R,CAAD,GAAUqsB,CAAV,CAA0Bj+B,CAA1B,CAAkC4R,CAAnD,CAA0DyX,CAA1D,CACA,CAAU,CAAV,CAAIwW,CAAJ,GACEE,CAMA,CANS,CAMT,CANaF,CAMb,CALKC,CAAA,CAASC,CAAT,CAKL,GALuBD,CAAA,CAASC,CAAT,CAKvB,CAL0C,EAK1C,EAJAC,CAIA,CAJU3gC,CAAA,CAAWmgC,CAAA1N,IAAX,CACD,CAAH,MAAG,EAAO0N,CAAA1N,IAAAxqB,KAAP,EAAyBk4B,CAAA1N,IAAA/vB,SAAA,EAAzB,EACHy9B,CAAA1N,IAEN,CADAkO,CACA,EADU,YACV,CADyBn7B,EAAA,CAAO7E,CAAP,CACzB,CADyC,YACzC;AADwD6E,EAAA,CAAO+M,CAAP,CACxD,CAAAkuB,CAAA,CAASC,CAAT,CAAArgC,KAAA,CAAsBsgC,CAAtB,CAPF,CARF,CAJE,CAsBF,MAAOp6B,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CAShB,GAAI,EAAEw6B,CAAF,CAAU/W,CAAAkU,YAAV,EAAkClU,CAAlC,GAvDoB/Y,IAuDpB,EAAwD+Y,CAAAgU,cAAxD,CAAJ,CACE,IAAA,CAAMhU,CAAN,GAxDsB/Y,IAwDtB,EAA4B,EAAE8vB,CAAF,CAAS/W,CAAAgU,cAAT,CAA5B,CAAA,CACEhU,CAAA,CAAUA,CAAAxG,QAtCb,CAAH,MAyCUwG,CAzCV,CAyCoB+W,CAzCpB,CA2CA,IAAGR,CAAH,EAAY,CAAEC,CAAA,EAAd,CAEE,KAoZN5qB,EAAAuZ,QApZY,CAoZS,IApZT,CAAAuO,CAAA,CAAiB,QAAjB,CAEFD,CAFE,CAEGj4B,EAAA,CAAOi7B,CAAP,CAFH,CAAN,CA1DD,CAAH,MA8DSF,CA9DT,EA8DkBF,CAAA7gC,OA9DlB,CAkEA,KA4YFoW,CAAAuZ,QA5YE,CA4YmB,IA5YnB,CAAMmR,CAAA9gC,OAAN,CAAA,CACE,GAAI,CACF8gC,CAAArzB,MAAA,EAAA,EADE,CAEF,MAAO1G,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CAlFI,CAvWJ,UAoeN2I,QAAQ,EAAG,CAEnB,GAAI0G,CAAJ,EAAkB,IAAlB,EAA0ByoB,CAAA,IAAAA,YAA1B,CAAA,CACA,IAAIt8B,EAAS,IAAAyhB,QAEb,KAAAqU,WAAA,CAAgB,UAAhB,CACA,KAAAwG,YAAA,CAAmB,CAAA,CAEft8B,EAAAm8B,YAAJ,EAA0B,IAA1B,GAAgCn8B,CAAAm8B,YAAhC,CAAqD,IAAAF,cAArD,CACIj8B,EAAAo8B,YAAJ,EAA0B,IAA1B,GAAgCp8B,CAAAo8B,YAAhC,CAAqD,IAAAF,cAArD,CACI;IAAAA,cAAJ,GAAwB,IAAAA,cAAAD,cAAxB,CAA2D,IAAAA,cAA3D,CACI,KAAAA,cAAJ,GAAwB,IAAAA,cAAAC,cAAxB,CAA2D,IAAAA,cAA3D,CAIA,KAAAza,QAAA,CAAe,IAAAwa,cAAf,CAAoC,IAAAC,cAApC,CAAyD,IAAAC,YAAzD,CACI,IAAAC,YADJ,CACuB,IAdvB,CAFmB,CApeL,OAkhBT0C,QAAQ,CAACG,CAAD,CAAO9sB,CAAP,CAAe,CAC5B,MAAO6J,EAAA,CAAOijB,CAAP,CAAA,CAAa,IAAb,CAAmB9sB,CAAnB,CADqB,CAlhBd,YAijBJnQ,QAAQ,CAACi9B,CAAD,CAAO,CAGpBprB,CAAAuZ,QAAL,EAA4BvZ,CAAA0oB,aAAA9+B,OAA5B,EACE+sB,CAAAvS,MAAA,CAAe,QAAQ,EAAG,CACpBpE,CAAA0oB,aAAA9+B,OAAJ,EACEoW,CAAA2iB,QAAA,EAFsB,CAA1B,CAOF,KAAA+F,aAAAj+B,KAAA,CAAuB,OAAQ,IAAR,YAA0B2gC,CAA1B,CAAvB,CAXyB,CAjjBX,cA+jBDC,QAAQ,CAACh8B,CAAD,CAAK,CAC1B,IAAAs5B,kBAAAl+B,KAAA,CAA4B4E,CAA5B,CAD0B,CA/jBZ;OAinBRiE,QAAQ,CAAC83B,CAAD,CAAO,CACrB,GAAI,CAEF,MADAvC,EAAA,CAAW,QAAX,CACO,CAAA,IAAAoC,MAAA,CAAWG,CAAX,CAFL,CAGF,MAAOz6B,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CAHZ,OAKU,CA2MZqP,CAAAuZ,QAAA,CAAqB,IAzMjB,IAAI,CACFvZ,CAAA2iB,QAAA,EADE,CAEF,MAAOhyB,CAAP,CAAU,CAEV,KADA4W,EAAA,CAAkB5W,CAAlB,CACMA,CAAAA,CAAN,CAFU,CAJJ,CANW,CAjnBP,KA2pBX26B,QAAQ,CAACj5B,CAAD,CAAO0P,CAAP,CAAiB,CAC5B,IAAIwpB,EAAiB,IAAA3C,YAAA,CAAiBv2B,CAAjB,CAChBk5B,EAAL,GACE,IAAA3C,YAAA,CAAiBv2B,CAAjB,CADF,CAC2Bk5B,CAD3B,CAC4C,EAD5C,CAGAA,EAAA9gC,KAAA,CAAoBsX,CAApB,CAEA,OAAO,SAAQ,EAAG,CAChBwpB,CAAA,CAAe39B,EAAA,CAAQ29B,CAAR,CAAwBxpB,CAAxB,CAAf,CAAA,CAAoD,IADpC,CAPU,CA3pBd,OA8rBTypB,QAAQ,CAACn5B,CAAD,CAAOkM,CAAP,CAAa,CAAA,IACtBktB,EAAQ,EADc,CAEtBF,CAFsB,CAGtBp4B,EAAQ,IAHc,CAItB+H,EAAkB,CAAA,CAJI,CAKtBJ,EAAQ,MACAzI,CADA,aAEOc,CAFP,iBAGW+H,QAAQ,EAAG,CAACA,CAAA,CAAkB,CAAA,CAAnB,CAHtB,gBAIUH,QAAQ,EAAG,CACzBD,CAAAS,iBAAA,CAAyB,CAAA,CADA,CAJrB,kBAOY,CAAA,CAPZ,CALc,CActBmwB,EAAsBC,CAAC7wB,CAAD6wB,CAzzTzBl8B,OAAA,CAAcF,EAAAjF,KAAA,CAyzToBwB,SAzzTpB,CAyzT+Bb,CAzzT/B,CAAd,CA2yTyB,CAetBL,CAfsB,CAenBhB,CAEP,GAAG,CACD2hC,CAAA,CAAiBp4B,CAAAy1B,YAAA,CAAkBv2B,CAAlB,CAAjB,EAA4Co5B,CAC5C3wB,EAAA8wB,aAAA;AAAqBz4B,CAChBvI,EAAA,CAAE,CAAP,KAAUhB,CAAV,CAAiB2hC,CAAA3hC,OAAjB,CAAwCgB,CAAxC,CAA0ChB,CAA1C,CAAkDgB,CAAA,EAAlD,CAGE,GAAK2gC,CAAA,CAAe3gC,CAAf,CAAL,CAMA,GAAI,CAEF2gC,CAAA,CAAe3gC,CAAf,CAAAmC,MAAA,CAAwB,IAAxB,CAA8B2+B,CAA9B,CAFE,CAGF,MAAO/6B,CAAP,CAAU,CACV4W,CAAA,CAAkB5W,CAAlB,CADU,CATZ,IACE46B,EAAAx9B,OAAA,CAAsBnD,CAAtB,CAAyB,CAAzB,CAEA,CADAA,CAAA,EACA,CAAAhB,CAAA,EAWJ,IAAIsR,CAAJ,CAAqB,KAErB/H,EAAA,CAAQA,CAAAya,QAtBP,CAAH,MAuBSza,CAvBT,CAyBA,OAAO2H,EA1CmB,CA9rBZ,YAkwBJmnB,QAAQ,CAAC5vB,CAAD,CAAOkM,CAAP,CAAa,CAAA,IAE3B6V,EADS/Y,IADkB,CAG3B8vB,EAFS9vB,IADkB,CAI3BP,EAAQ,MACAzI,CADA,aAHCgJ,IAGD,gBAGUN,QAAQ,EAAG,CACzBD,CAAAS,iBAAA,CAAyB,CAAA,CADA,CAHrB,kBAMY,CAAA,CANZ,CAJmB,CAY3BmwB,EAAsBC,CAAC7wB,CAAD6wB,CA33TzBl8B,OAAA,CAAcF,EAAAjF,KAAA,CA23ToBwB,SA33TpB,CA23T+Bb,CA33T/B,CAAd,CA+2T8B,CAahBL,CAbgB,CAabhB,CAGlB,GAAG,CACDwqB,CAAA,CAAU+W,CACVrwB,EAAA8wB,aAAA,CAAqBxX,CACrBM,EAAA,CAAYN,CAAAwU,YAAA,CAAoBv2B,CAApB,CAAZ,EAAyC,EACpCzH,EAAA,CAAE,CAAP,KAAUhB,CAAV,CAAmB8qB,CAAA9qB,OAAnB,CAAqCgB,CAArC,CAAuChB,CAAvC,CAA+CgB,CAAA,EAA/C,CAEE,GAAK8pB,CAAA,CAAU9pB,CAAV,CAAL,CAOA,GAAI,CACF8pB,CAAA,CAAU9pB,CAAV,CAAAmC,MAAA,CAAmB,IAAnB,CAAyB2+B,CAAzB,CADE,CAEF,MAAM/6B,CAAN,CAAS,CACT4W,CAAA,CAAkB5W,CAAlB,CADS,CATX,IACE+jB,EAAA3mB,OAAA,CAAiBnD,CAAjB,CAAoB,CAApB,CAEA,CADAA,CAAA,EACA,CAAAhB,CAAA,EAcJ,IAAI,EAAEuhC,CAAF,CAAU/W,CAAAkU,YAAV,EAAkClU,CAAlC,GAtCO/Y,IAsCP,EAAwD+Y,CAAAgU,cAAxD,CAAJ,CACE,IAAA,CAAMhU,CAAN;AAvCS/Y,IAuCT,EAA4B,EAAE8vB,CAAF,CAAS/W,CAAAgU,cAAT,CAA5B,CAAA,CACEhU,CAAA,CAAUA,CAAAxG,QAzBb,CAAH,MA4BUwG,CA5BV,CA4BoB+W,CA5BpB,CA8BA,OAAOrwB,EA9CwB,CAlwBjB,CAozBlB,KAAIkF,EAAa,IAAIioB,CAErB,OAAOjoB,EAr3B2D,CADxD,CAXe,CAq7B7B6rB,QAASA,GAAa,CAACC,CAAD,CAAU,CAC9B,GAAgB,MAAhB,GAAIA,CAAJ,CACE,MAAOA,EACF,IAAIhiC,CAAA,CAASgiC,CAAT,CAAJ,CAAuB,CAK5B,GAA8B,EAA9B,CAAIA,CAAAl+B,QAAA,CAAgB,KAAhB,CAAJ,CACE,KAAMm+B,GAAA,CAAW,QAAX,CACsDD,CADtD,CAAN,CAGFA,CAAA,CAA0BA,CAjBrB96B,QAAA,CAAU,+BAAV,CAA2C,MAA3C,CAAAA,QAAA,CACU,OADV,CACmB,OADnB,CAiBKA,QAAA,CACY,QADZ,CACsB,IADtB,CAAAA,QAAA,CAEY,KAFZ,CAEmB,YAFnB,CAGV,OAAWxC,OAAJ,CAAW,GAAX,CAAiBs9B,CAAjB,CAA2B,GAA3B,CAZqB,CAavB,GAAI9+B,EAAA,CAAS8+B,CAAT,CAAJ,CAIL,MAAWt9B,OAAJ,CAAW,GAAX,CAAiBs9B,CAAA79B,OAAjB,CAAkC,GAAlC,CAEP,MAAM89B,GAAA,CAAW,UAAX,CAAN,CAtB4B,CA4BhCC,QAASA,GAAc,CAACC,CAAD,CAAW,CAChC,IAAIC,EAAmB,EACnBx/B,EAAA,CAAUu/B,CAAV,CAAJ,EACEjiC,CAAA,CAAQiiC,CAAR,CAAkB,QAAQ,CAACH,CAAD,CAAU,CAClCI,CAAAzhC,KAAA,CAAsBohC,EAAA,CAAcC,CAAd,CAAtB,CADkC,CAApC,CAIF,OAAOI,EAPyB,CA4ElCC,QAASA,GAAoB,EAAG,CAC9B,IAAAC,aAAA,CAAoBA,EADU,KAI1BC;AAAuB,CAAC,MAAD,CAJG,CAK1BC,EAAuB,EAyB3B,KAAAD,qBAAA,CAA4BE,QAAS,CAACxhC,CAAD,CAAQ,CACvCe,SAAAlC,OAAJ,GACEyiC,CADF,CACyBL,EAAA,CAAejhC,CAAf,CADzB,CAGA,OAAOshC,EAJoC,CAmC7C,KAAAC,qBAAA,CAA4BE,QAAS,CAACzhC,CAAD,CAAQ,CACvCe,SAAAlC,OAAJ,GACE0iC,CADF,CACyBN,EAAA,CAAejhC,CAAf,CADzB,CAGA,OAAOuhC,EAJoC,CAO7C,KAAApvB,KAAA,CAAY,CAAC,MAAD,CAAS,WAAT,CAAsB,WAAtB,CAAmC,QAAQ,CACzC0D,CADyC,CACjCgE,CADiC,CACpB7F,CADoB,CACT,CA0C5C0tB,QAASA,EAAkB,CAACC,CAAD,CAAO,CAChC,IAAIC,EAAaA,QAA+B,CAACC,CAAD,CAAe,CAC7D,IAAAC,qBAAA,CAA4BC,QAAQ,EAAG,CACrC,MAAOF,EAD8B,CADsB,CAK3DF,EAAJ,GACEC,CAAAhuB,UADF,CACyB,IAAI+tB,CAD7B,CAGAC,EAAAhuB,UAAAue,QAAA,CAA+B6P,QAAmB,EAAG,CACnD,MAAO,KAAAF,qBAAA,EAD4C,CAGrDF,EAAAhuB,UAAA7R,SAAA,CAAgCkgC,QAAoB,EAAG,CACrD,MAAO,KAAAH,qBAAA,EAAA//B,SAAA,EAD8C,CAGvD,OAAO6/B,EAfyB,CAxClC,IAAIM,EAAgBA,QAAsB,CAACv8B,CAAD,CAAO,CAC/C,KAAMq7B,GAAA,CAAW,QAAX,CAAN;AAD+C,CAI7ChtB,EAAAF,IAAA,CAAc,WAAd,CAAJ,GACEouB,CADF,CACkBluB,CAAAvB,IAAA,CAAc,WAAd,CADlB,CAN4C,KA4DxC0vB,EAAyBT,CAAA,EA5De,CA6DxCU,EAAS,EAEbA,EAAA,CAAOf,EAAAgB,KAAP,CAAA,CAA4BX,CAAA,CAAmBS,CAAnB,CAC5BC,EAAA,CAAOf,EAAAiB,IAAP,CAAA,CAA2BZ,CAAA,CAAmBS,CAAnB,CAC3BC,EAAA,CAAOf,EAAAkB,IAAP,CAAA,CAA2Bb,CAAA,CAAmBS,CAAnB,CAC3BC,EAAA,CAAOf,EAAAmB,GAAP,CAAA,CAA0Bd,CAAA,CAAmBS,CAAnB,CAC1BC,EAAA,CAAOf,EAAA1Z,aAAP,CAAA,CAAoC+Z,CAAA,CAAmBU,CAAA,CAAOf,EAAAkB,IAAP,CAAnB,CA0GpC,OAAO,SAtFPE,QAAgB,CAAC70B,CAAD,CAAOi0B,CAAP,CAAqB,CACnC,IAAIl4B,EAAey4B,CAAA9iC,eAAA,CAAsBsO,CAAtB,CAAA,CAA8Bw0B,CAAA,CAAOx0B,CAAP,CAA9B,CAA6C,IAChE,IAAI,CAACjE,CAAL,CACE,KAAMq3B,GAAA,CAAW,UAAX,CACFpzB,CADE,CACIi0B,CADJ,CAAN,CAGF,GAAqB,IAArB,GAAIA,CAAJ,EAA6BA,CAA7B,GAA8CrjC,CAA9C,EAA4E,EAA5E,GAA2DqjC,CAA3D,CACE,MAAOA,EAIT,IAA4B,QAA5B,GAAI,MAAOA,EAAX,CACE,KAAMb,GAAA,CAAW,OAAX,CAEFpzB,CAFE,CAAN,CAIF,MAAO,KAAIjE,CAAJ,CAAgBk4B,CAAhB,CAhB4B,CAsF9B,YAxBP3P,QAAmB,CAACtkB,CAAD,CAAO80B,CAAP,CAAqB,CACtC,GAAqB,IAArB,GAAIA,CAAJ,EAA6BA,CAA7B,GAA8ClkC,CAA9C,EAA4E,EAA5E,GAA2DkkC,CAA3D,CACE,MAAOA,EAET,KAAI/4B,EAAey4B,CAAA9iC,eAAA,CAAsBsO,CAAtB,CAAA,CAA8Bw0B,CAAA,CAAOx0B,CAAP,CAA9B,CAA6C,IAChE,IAAIjE,CAAJ,EAAmB+4B,CAAnB,WAA2C/4B,EAA3C,CACE,MAAO+4B,EAAAZ,qBAAA,EAKT,IAAIl0B,CAAJ;AAAayzB,EAAA1Z,aAAb,CAAwC,CA3IpCiM,IAAAA,EAAYnK,EAAA,CA4ImBiZ,CA5IR3gC,SAAA,EAAX,CAAZ6xB,CACA/zB,CADA+zB,CACGrZ,CADHqZ,CACM+O,EAAU,CAAA,CAEf9iC,EAAA,CAAI,CAAT,KAAY0a,CAAZ,CAAgB+mB,CAAAziC,OAAhB,CAA6CgB,CAA7C,CAAiD0a,CAAjD,CAAoD1a,CAAA,EAApD,CACE,GAbc,MAAhB,GAaeyhC,CAAAP,CAAqBlhC,CAArBkhC,CAbf,CACS9T,EAAA,CAY+B2G,CAZ/B,CADT,CAae0N,CAAAP,CAAqBlhC,CAArBkhC,CATJt5B,KAAA,CAS6BmsB,CAThB9b,KAAb,CAST,CAAkD,CAChD6qB,CAAA,CAAU,CAAA,CACV,MAFgD,CAKpD,GAAIA,CAAJ,CAEE,IAAK9iC,CAAO,CAAH,CAAG,CAAA0a,CAAA,CAAIgnB,CAAA1iC,OAAhB,CAA6CgB,CAA7C,CAAiD0a,CAAjD,CAAoD1a,CAAA,EAApD,CACE,GArBY,MAAhB,GAqBiB0hC,CAAAR,CAAqBlhC,CAArBkhC,CArBjB,CACS9T,EAAA,CAoBiC2G,CApBjC,CADT,CAqBiB2N,CAAAR,CAAqBlhC,CAArBkhC,CAjBNt5B,KAAA,CAiB+BmsB,CAjBlB9b,KAAb,CAiBP,CAAkD,CAChD6qB,CAAA,CAAU,CAAA,CACV,MAFgD,CAgIpD,GA1HKA,CA0HL,CACE,MAAOD,EAEP,MAAM1B,GAAA,CAAW,UAAX,CACiF0B,CAAA3gC,SAAA,EADjF,CAAN,CAJoC,CAOjC,GAAI6L,CAAJ,GAAayzB,EAAAgB,KAAb,CACL,MAAOH,EAAA,CAAcQ,CAAd,CAET,MAAM1B,GAAA,CAAW,QAAX,CAAN,CArBsC,CAwBjC,SAhDP7O,QAAgB,CAACuQ,CAAD,CAAe,CAC7B,MAAIA,EAAJ,WAA4BP,EAA5B,CACSO,CAAAZ,qBAAA,EADT,CAGSY,CAJoB,CAgDxB,CA7KqC,CADlC,CAxEkB,CA8gBhCE,QAASA,GAAY,EAAG,CACtB,IAAIn6B,EAAU,CAAA,CAcd,KAAAA,QAAA,CAAeo6B,QAAS,CAAC7iC,CAAD,CAAQ,CAC1Be,SAAAlC,OAAJ,GACE4J,CADF,CACY,CAAC,CAACzI,CADd,CAGA,OAAOyI,EAJuB,CAsDhC,KAAA0J,KAAA,CAAY,CAAC,QAAD,CAAW,WAAX,CAAwB,cAAxB;AAAwC,QAAQ,CAC9CiL,CAD8C,CACpCvD,CADoC,CACvBipB,CADuB,CACT,CAGjD,GAAIr6B,CAAJ,EAAemI,CAAf,GACMmyB,CACA,CADelpB,CAAA,CAAU,CAAV,CAAAkpB,aACf,CAAAA,CAAA,GAAiBvkC,CAAjB,EAA6C,CAA7C,CAA8BukC,CAFpC,EAGI,KAAM/B,GAAA,CAAW,UAAX,CAAN,CAOJ,IAAIgC,EAAM//B,EAAA,CAAKo+B,EAAL,CAcV2B,EAAAC,UAAA,CAAgBC,QAAS,EAAG,CAC1B,MAAOz6B,EADmB,CAG5Bu6B,EAAAP,QAAA,CAAcK,CAAAL,QACdO,EAAA9Q,WAAA,CAAiB4Q,CAAA5Q,WACjB8Q,EAAA7Q,QAAA,CAAc2Q,CAAA3Q,QAET1pB,EAAL,GACEu6B,CAAAP,QACA,CADcO,CAAA9Q,WACd,CAD+BiR,QAAQ,CAACv1B,CAAD,CAAO5N,CAAP,CAAc,CAAE,MAAOA,EAAT,CACrD,CAAAgjC,CAAA7Q,QAAA,CAAc5wB,EAFhB,CAyBAyhC,EAAAI,QAAA,CAAcC,QAAmB,CAACz1B,CAAD,CAAOyyB,CAAP,CAAa,CAC5C,IAAI3V,EAAStN,CAAA,CAAOijB,CAAP,CACb,OAAI3V,EAAA4Y,QAAJ,EAAsB5Y,CAAAzW,SAAtB,CACSyW,CADT,CAGS6Y,QAA0B,CAACl/B,CAAD,CAAOkP,CAAP,CAAe,CAC9C,MAAOyvB,EAAA9Q,WAAA,CAAetkB,CAAf,CAAqB8c,CAAA,CAAOrmB,CAAP,CAAakP,CAAb,CAArB,CADuC,CALN,CA3DG,KAwT7CpO,EAAQ69B,CAAAI,QAxTqC,CAyT7ClR,EAAa8Q,CAAA9Q,WAzTgC,CA0T7CuQ,EAAUO,CAAAP,QAEdxjC,EAAA,CAAQoiC,EAAR,CAAsB,QAAS,CAACmC,CAAD,CAAYl8B,CAAZ,CAAkB,CAC/C,IAAIm8B,EAAQn+B,CAAA,CAAUgC,CAAV,CACZ07B,EAAA,CAAI73B,EAAA,CAAU,WAAV,CAAwBs4B,CAAxB,CAAJ,CAAA,CAAsC,QAAS,CAACpD,CAAD,CAAO,CACpD,MAAOl7B,EAAA,CAAMq+B,CAAN,CAAiBnD,CAAjB,CAD6C,CAGtD2C,EAAA,CAAI73B,EAAA,CAAU,cAAV;AAA2Bs4B,CAA3B,CAAJ,CAAA,CAAyC,QAAS,CAACzjC,CAAD,CAAQ,CACxD,MAAOkyB,EAAA,CAAWsR,CAAX,CAAsBxjC,CAAtB,CADiD,CAG1DgjC,EAAA,CAAI73B,EAAA,CAAU,WAAV,CAAwBs4B,CAAxB,CAAJ,CAAA,CAAsC,QAAS,CAACzjC,CAAD,CAAQ,CACrD,MAAOyiC,EAAA,CAAQe,CAAR,CAAmBxjC,CAAnB,CAD8C,CARR,CAAjD,CAaA,OAAOgjC,EAzU0C,CADvC,CArEU,CAkaxBU,QAASA,GAAgB,EAAG,CAC1B,IAAAvxB,KAAA,CAAY,CAAC,SAAD,CAAY,WAAZ,CAAyB,QAAQ,CAAC4C,CAAD,CAAU8E,CAAV,CAAqB,CAAA,IAC5D8pB,EAAe,EAD6C,CAE5DC,EAAU5iC,CAAA,CAAI,CAAC,eAAAyG,KAAA,CAAqBnC,CAAA,CAAWu+B,CAAA9uB,CAAA+uB,UAAAD,EAAqB,EAArBA,WAAX,CAArB,CAAD,EAAyE,EAAzE,EAA6E,CAA7E,CAAJ,CAFkD,CAG5DE,EAAQ,QAAAp7B,KAAA,CAAek7B,CAAA9uB,CAAA+uB,UAAAD,EAAqB,EAArBA,WAAf,CAHoD,CAI5DtlC,EAAWsb,CAAA,CAAU,CAAV,CAAXtb,EAA2B,EAJiC,CAK5DylC,CAL4D,CAM5DC,EAAc,6BAN8C,CAO5DC,EAAY3lC,CAAA2xB,KAAZgU,EAA6B3lC,CAAA2xB,KAAAiU,MAP+B,CAQ5DC,EAAc,CAAA,CAR8C,CAS5DC,EAAa,CAAA,CAGjB,IAAIH,CAAJ,CAAe,CACb,IAAI3a,IAAIA,CAAR,GAAgB2a,EAAhB,CACE,GAAGl+B,CAAH,CAAWi+B,CAAAx8B,KAAA,CAAiB8hB,CAAjB,CAAX,CAAmC,CACjCya,CAAA,CAAeh+B,CAAA,CAAM,CAAN,CACfg+B,EAAA,CAAeA,CAAApgC,OAAA,CAAoB,CAApB,CAAuB,CAAvB,CAAA2H,YAAA,EAAf,CAAyDy4B,CAAApgC,OAAA,CAAoB,CAApB,CACzD,MAHiC,CAOjCogC,CAAJ,GACEA,CADF,CACkB,eADlB,EACqCE,EADrC,EACmD,QADnD,CAIAE,EAAA,CAAc,CAAC,EAAG,YAAH,EAAmBF,EAAnB;AAAkCF,CAAlC,CAAiD,YAAjD,EAAiEE,EAAjE,CACfG,EAAA,CAAc,CAAC,EAAG,WAAH,EAAkBH,EAAlB,EAAiCF,CAAjC,CAAgD,WAAhD,EAA+DE,EAA/D,CAEXN,EAAAA,CAAJ,EAAiBQ,CAAjB,EAA+BC,CAA/B,GACED,CACA,CADcrlC,CAAA,CAASR,CAAA2xB,KAAAiU,MAAAG,iBAAT,CACd,CAAAD,CAAA,CAAatlC,CAAA,CAASR,CAAA2xB,KAAAiU,MAAAI,gBAAT,CAFf,CAhBa,CAuBf,MAAO,SAQI,EAAGrtB,CAAAnC,CAAAmC,QAAH,EAAsBgB,CAAAnD,CAAAmC,QAAAgB,UAAtB,EAA+D,CAA/D,CAAqD0rB,CAArD,EAAsEG,CAAtE,CARJ,YASO,cATP,EASyBhvB,EATzB,GAWQ,CAACxW,CAAAwkC,aAXT,EAW0D,CAX1D,CAWkCxkC,CAAAwkC,aAXlC,WAYKyB,QAAQ,CAACz0B,CAAD,CAAQ,CAIxB,GAAa,OAAb,EAAIA,CAAJ,EAAgC,CAAhC,EAAwBa,CAAxB,CAAmC,MAAO,CAAA,CAE1C,IAAIlP,CAAA,CAAYiiC,CAAA,CAAa5zB,CAAb,CAAZ,CAAJ,CAAsC,CACpC,IAAI00B,EAASlmC,CAAAwO,cAAA,CAAuB,KAAvB,CACb42B,EAAA,CAAa5zB,CAAb,CAAA,CAAsB,IAAtB,CAA6BA,CAA7B,GAAsC00B,EAFF,CAKtC,MAAOd,EAAA,CAAa5zB,CAAb,CAXiB,CAZrB,KAyBAxR,CAAAmmC,eAAA,CAA0BnmC,CAAAmmC,eAAAC,SAA1B,CAA6D,CAAA,CAzB7D,cA0BSX,CA1BT,aA2BSI,CA3BT,YA4BQC,CA5BR,CAnCyD,CAAtD,CADc,CAqE5BO,QAASA,GAAgB,EAAG,CAC1B,IAAAzyB,KAAA;AAAY,CAAC,YAAD,CAAe,UAAf,CAA2B,IAA3B,CAAiC,mBAAjC,CACP,QAAQ,CAAC8C,CAAD,CAAe2W,CAAf,CAA2BC,CAA3B,CAAiCrP,CAAjC,CAAoD,CAqH/D0S,QAASA,EAAO,CAAC5qB,CAAD,CAAKiV,CAAL,CAAYmZ,CAAZ,CAAyB,CAAA,IACnCjE,EAAW5C,CAAAxS,MAAA,EADwB,CAEnCqU,EAAUe,CAAAf,QAFyB,CAGnCmF,EAAalxB,CAAA,CAAU+wB,CAAV,CAAbG,EAAuC,CAACH,CAG5ClZ,EAAA,CAAYoS,CAAAvS,MAAA,CAAe,QAAQ,EAAG,CACpC,GAAI,CACFoV,CAAAC,QAAA,CAAiBpqB,CAAA,EAAjB,CADE,CAEF,MAAMsB,CAAN,CAAS,CACT6oB,CAAAvC,OAAA,CAAgBtmB,CAAhB,CACA,CAAA4W,CAAA,CAAkB5W,CAAlB,CAFS,CAFX,OAMQ,CACN,OAAOi/B,CAAA,CAAUnX,CAAAoX,YAAV,CADD,CAIHjS,CAAL,EAAgB5d,CAAA1M,OAAA,EAXoB,CAA1B,CAYTgR,CAZS,CAcZmU,EAAAoX,YAAA,CAAsBtrB,CACtBqrB,EAAA,CAAUrrB,CAAV,CAAA,CAAuBiV,CAEvB,OAAOf,EAvBgC,CApHzC,IAAImX,EAAY,EA4JhB3V,EAAAzV,OAAA,CAAiBsrB,QAAQ,CAACrX,CAAD,CAAU,CACjC,MAAIA,EAAJ,EAAeA,CAAAoX,YAAf,GAAsCD,EAAtC,EACEA,CAAA,CAAUnX,CAAAoX,YAAV,CAAA5Y,OAAA,CAAsC,UAAtC,CAEO,CADP,OAAO2Y,CAAA,CAAUnX,CAAAoX,YAAV,CACA,CAAAlZ,CAAAvS,MAAAI,OAAA,CAAsBiU,CAAAoX,YAAtB,CAHT,EAKO,CAAA,CAN0B,CASnC,OAAO5V,EAtKwD,CADrD,CADc,CA0O5BzF,QAASA,GAAU,CAAC3S,CAAD,CAAM,CAEnBlG,CAAJ,GAGEo0B,CAAA91B,aAAA,CAA4B,MAA5B,CAAoC4I,CAApC,CACA,CAAAA,CAAA,CAAOktB,CAAAltB,KAJT,CAOAktB,EAAA91B,aAAA,CAA4B,MAA5B;AAAoC4I,CAApC,CAGA,OAAO,MACCktB,CAAAltB,KADD,UAEKktB,CAAApV,SAAA,CAA0BoV,CAAApV,SAAA3pB,QAAA,CAAgC,IAAhC,CAAsC,EAAtC,CAA1B,CAAsE,EAF3E,MAGC++B,CAAAC,KAHD,QAIGD,CAAAvQ,OAAA,CAAwBuQ,CAAAvQ,OAAAxuB,QAAA,CAA8B,KAA9B,CAAqC,EAArC,CAAxB,CAAmE,EAJtE,MAKC++B,CAAA3vB,KAAA,CAAsB2vB,CAAA3vB,KAAApP,QAAA,CAA4B,IAA5B,CAAkC,EAAlC,CAAtB,CAA8D,EAL/D,UAMK++B,CAAAjR,SANL,MAOCiR,CAAA/Q,KAPD,UAQK+Q,CAAAzQ,SAAA,EAAiE,GAAjE,GAA2ByQ,CAAAzQ,SAAApwB,OAAA,CAA+B,CAA/B,CAA3B,CAAuE6gC,CAAAzQ,SAAvE,CAAiG,GAAjG,CAAuGyQ,CAAAzQ,SAR5G,CAZgB,CAgCzBtH,QAASA,GAAe,CAACiY,CAAD,CAAa,CAC/Bxa,CAAAA,CAAU3rB,CAAA,CAASmmC,CAAT,CAAD,CAAyBzb,EAAA,CAAWyb,CAAX,CAAzB,CAAkDA,CAC/D,OAAQxa,EAAAkF,SAAR,GAA4BuV,EAAAvV,SAA5B,EACQlF,CAAAua,KADR,GACwBE,EAAAF,KAHW,CA4CrCG,QAASA,GAAe,EAAE,CACxB,IAAAjzB,KAAA,CAAY1Q,EAAA,CAAQnD,CAAR,CADY,CA+E1B+mC,QAASA,GAAe,CAACp9B,CAAD,CAAW,CAYjCgiB,QAASA,EAAQ,CAAC3iB,CAAD,CAAO8C,CAAP,CAAgB,CAC/B,GAAGxI,CAAA,CAAS0F,CAAT,CAAH,CAAmB,CACjB,IAAIg+B,EAAU,EACdrmC,EAAA,CAAQqI,CAAR,CAAc,QAAQ,CAACyE,CAAD,CAAS3M,CAAT,CAAc,CAClCkmC,CAAA,CAAQlmC,CAAR,CAAA,CAAe6qB,CAAA,CAAS7qB,CAAT,CAAc2M,CAAd,CADmB,CAApC,CAGA,OAAOu5B,EALU,CAOjB,MAAOr9B,EAAAmC,QAAA,CAAiB9C,CAAjB,CAAwBi+B,CAAxB,CAAgCn7B,CAAhC,CARsB,CAZA;AACjC,IAAIm7B,EAAS,QAsBb,KAAAtb,SAAA,CAAgBA,CAEhB,KAAA9X,KAAA,CAAY,CAAC,WAAD,CAAc,QAAQ,CAAC6B,CAAD,CAAY,CAC5C,MAAO,SAAQ,CAAC1M,CAAD,CAAO,CACpB,MAAO0M,EAAAvB,IAAA,CAAcnL,CAAd,CAAqBi+B,CAArB,CADa,CADsB,CAAlC,CAQZtb,EAAA,CAAS,UAAT,CAAqBub,EAArB,CACAvb,EAAA,CAAS,MAAT,CAAiBwb,EAAjB,CACAxb,EAAA,CAAS,QAAT,CAAmByb,EAAnB,CACAzb,EAAA,CAAS,MAAT,CAAiB0b,EAAjB,CACA1b,EAAA,CAAS,SAAT,CAAoB2b,EAApB,CACA3b,EAAA,CAAS,WAAT,CAAsB4b,EAAtB,CACA5b,EAAA,CAAS,QAAT,CAAmB6b,EAAnB,CACA7b,EAAA,CAAS,SAAT,CAAoB8b,EAApB,CACA9b,EAAA,CAAS,WAAT,CAAsB+b,EAAtB,CAzCiC,CAoJnCN,QAASA,GAAY,EAAG,CACtB,MAAO,SAAQ,CAAC5iC,CAAD,CAAQqnB,CAAR,CAAoB8b,CAApB,CAAgC,CAC7C,GAAI,CAACjnC,CAAA,CAAQ8D,CAAR,CAAL,CAAqB,MAAOA,EAC5B,KAAIojC,EAAa,EACjBA,EAAA3vB,MAAA,CAAmB4vB,QAAQ,CAACnmC,CAAD,CAAQ,CACjC,IAAK,IAAIogB,EAAI,CAAb,CAAgBA,CAAhB,CAAoB8lB,CAAArnC,OAApB,CAAuCuhB,CAAA,EAAvC,CACE,GAAG,CAAC8lB,CAAA,CAAW9lB,CAAX,CAAA,CAAcpgB,CAAd,CAAJ,CACE,MAAO,CAAA,CAGX,OAAO,CAAA,CAN0B,CAQnC,QAAO,MAAOimC,EAAd,EACE,KAAK,UAAL,CACE,KACF,MAAK,SAAL,CACE,GAAiB,CAAA,CAAjB,EAAGA,CAAH,CAAuB,CACrBA,CAAA,CAAaA,QAAQ,CAACtnC,CAAD,CAAMyoB,CAAN,CAAY,CAC/B,MAAOxe,GAAA/E,OAAA,CAAelF,CAAf,CAAoByoB,CAApB,CADwB,CAGjC,MAJqB,CAMzB,QACE6e,CAAA;AAAaA,QAAQ,CAACtnC,CAAD,CAAMyoB,CAAN,CAAY,CAC/BA,CAAA,CAAQ/d,CAAA,EAAAA,CAAG+d,CAAH/d,aAAA,EACR,OAA+C,EAA/C,CAAQA,CAAA,EAAAA,CAAG1K,CAAH0K,aAAA,EAAAxG,QAAA,CAA8BukB,CAA9B,CAFuB,CAXrC,CAgBA,IAAIqN,EAASA,QAAQ,CAAC91B,CAAD,CAAMyoB,CAAN,CAAW,CAC9B,GAAmB,QAAnB,EAAI,MAAOA,EAAX,EAAkD,GAAlD,GAA+BA,CAAAjjB,OAAA,CAAY,CAAZ,CAA/B,CACE,MAAO,CAACswB,CAAA,CAAO91B,CAAP,CAAYyoB,CAAAxjB,OAAA,CAAY,CAAZ,CAAZ,CAEV,QAAQ,MAAOjF,EAAf,EACE,KAAK,SAAL,CACA,KAAK,QAAL,CACA,KAAK,QAAL,CACE,MAAOsnC,EAAA,CAAWtnC,CAAX,CAAgByoB,CAAhB,CACT,MAAK,QAAL,CACE,OAAQ,MAAOA,EAAf,EACE,KAAK,QAAL,CACE,MAAO6e,EAAA,CAAWtnC,CAAX,CAAgByoB,CAAhB,CAET,SACE,IAAMgf,IAAIA,CAAV,GAAoBznC,EAApB,CACE,GAAyB,GAAzB,GAAIynC,CAAAjiC,OAAA,CAAc,CAAd,CAAJ,EAAgCswB,CAAA,CAAO91B,CAAA,CAAIynC,CAAJ,CAAP,CAAoBhf,CAApB,CAAhC,CACE,MAAO,CAAA,CAPf,CAYA,MAAO,CAAA,CACT,MAAK,OAAL,CACE,IAAUvnB,CAAV,CAAc,CAAd,CAAiBA,CAAjB,CAAqBlB,CAAAE,OAArB,CAAiCgB,CAAA,EAAjC,CACE,GAAI40B,CAAA,CAAO91B,CAAA,CAAIkB,CAAJ,CAAP,CAAeunB,CAAf,CAAJ,CACE,MAAO,CAAA,CAGX,OAAO,CAAA,CACT,SACE,MAAO,CAAA,CA3BX,CAJ8B,CAkChC,QAAQ,MAAO+C,EAAf,EACE,KAAK,SAAL,CACA,KAAK,QAAL,CACA,KAAK,QAAL,CACEA,CAAA;AAAa,GAAGA,CAAH,CACf,MAAK,QAAL,CACE,IAAK/qB,IAAIA,CAAT,GAAgB+qB,EAAhB,CACa,GAAX,EAAI/qB,CAAJ,CACG,QAAQ,EAAG,CACV,GAAK+qB,CAAA,CAAW/qB,CAAX,CAAL,CAAA,CACA,IAAI0K,EAAO1K,CACX8mC,EAAAxmC,KAAA,CAAgB,QAAQ,CAACM,CAAD,CAAQ,CAC9B,MAAOy0B,EAAA,CAAOz0B,CAAP,CAAcmqB,CAAA,CAAWrgB,CAAX,CAAd,CADuB,CAAhC,CAFA,CADU,CAAX,EADH,CASG,QAAQ,EAAG,CACV,GAA+B,WAA/B,EAAI,MAAOqgB,EAAA,CAAW/qB,CAAX,CAAX,CAAA,CACA,IAAI0K,EAAO1K,CACX8mC,EAAAxmC,KAAA,CAAgB,QAAQ,CAACM,CAAD,CAAQ,CAC9B,MAAOy0B,EAAA,CAAO5qB,EAAA,CAAO7J,CAAP,CAAa8J,CAAb,CAAP,CAA2BqgB,CAAA,CAAWrgB,CAAX,CAA3B,CADuB,CAAhC,CAFA,CADU,CAAX,EASL,MACF,MAAK,UAAL,CACEo8B,CAAAxmC,KAAA,CAAgByqB,CAAhB,CACA,MACF,SACE,MAAOrnB,EA9BX,CAiCA,IADA,IAAIujC,EAAW,EAAf,CACUjmB,EAAI,CAAd,CAAiBA,CAAjB,CAAqBtd,CAAAjE,OAArB,CAAmCuhB,CAAA,EAAnC,CAAwC,CACtC,IAAIpgB,EAAQ8C,CAAA,CAAMsd,CAAN,CACR8lB,EAAA3vB,MAAA,CAAiBvW,CAAjB,CAAJ,EACEqmC,CAAA3mC,KAAA,CAAcM,CAAd,CAHoC,CAMxC,MAAOqmC,EApGsC,CADzB,CAmJxBb,QAASA,GAAc,CAACc,CAAD,CAAU,CAC/B,IAAIC,EAAUD,CAAAE,eACd,OAAO,SAAQ,CAACC,CAAD,CAASC,CAAT,CAAwB,CACjChlC,CAAA,CAAYglC,CAAZ,CAAJ,GAAiCA,CAAjC,CAAkDH,CAAAI,aAAlD,CACA,OAAOC,GAAA,CAAaH,CAAb,CAAqBF,CAAAM,SAAA,CAAiB,CAAjB,CAArB,CAA0CN,CAAAO,UAA1C,CAA6DP,CAAAQ,YAA7D,CAAkF,CAAlF,CAAA9gC,QAAA,CACa,SADb,CACwBygC,CADxB,CAF8B,CAFR,CA2DjCZ,QAASA,GAAY,CAACQ,CAAD,CAAU,CAC7B,IAAIC;AAAUD,CAAAE,eACd,OAAO,SAAQ,CAACQ,CAAD,CAASC,CAAT,CAAuB,CACpC,MAAOL,GAAA,CAAaI,CAAb,CAAqBT,CAAAM,SAAA,CAAiB,CAAjB,CAArB,CAA0CN,CAAAO,UAA1C,CAA6DP,CAAAQ,YAA7D,CACLE,CADK,CAD6B,CAFT,CAS/BL,QAASA,GAAY,CAACI,CAAD,CAASE,CAAT,CAAkBC,CAAlB,CAA4BC,CAA5B,CAAwCH,CAAxC,CAAsD,CACzE,GAAI9G,KAAA,CAAM6G,CAAN,CAAJ,EAAqB,CAACK,QAAA,CAASL,CAAT,CAAtB,CAAwC,MAAO,EAE/C,KAAIM,EAAsB,CAAtBA,CAAaN,CACjBA,EAAA,CAAS5hB,IAAAmiB,IAAA,CAASP,CAAT,CAJgE,KAKrEQ,EAASR,CAATQ,CAAkB,EALmD,CAMrEC,EAAe,EANsD,CAOrEhhC,EAAQ,EAP6D,CASrEihC,EAAc,CAAA,CAClB,IAA6B,EAA7B,GAAIF,CAAA3kC,QAAA,CAAe,GAAf,CAAJ,CAAgC,CAC9B,IAAImD,EAAQwhC,CAAAxhC,MAAA,CAAa,qBAAb,CACRA,EAAJ,EAAyB,GAAzB,EAAaA,CAAA,CAAM,CAAN,CAAb,EAAgCA,CAAA,CAAM,CAAN,CAAhC,CAA2CihC,CAA3C,CAA0D,CAA1D,CACEO,CADF,CACW,GADX,EAGEC,CACA,CADeD,CACf,CAAAE,CAAA,CAAc,CAAA,CAJhB,CAF8B,CAUhC,GAAKA,CAAL,CA2CqB,CAAnB,CAAIT,CAAJ,GAAkC,EAAlC,CAAwBD,CAAxB,EAAgD,CAAhD,CAAuCA,CAAvC,IACES,CADF,CACiBT,CAAAW,QAAA,CAAeV,CAAf,CADjB,CA3CF,KAAkB,CACZW,CAAAA,CAAe/oC,CAAA2oC,CAAAjhC,MAAA,CAAawgC,EAAb,CAAA,CAA0B,CAA1B,CAAAloC,EAAgC,EAAhCA,QAGf6C,EAAA,CAAYulC,CAAZ,CAAJ,GACEA,CADF,CACiB7hB,IAAAyiB,IAAA,CAASziB,IAAAC,IAAA,CAAS6hB,CAAAY,QAAT,CAA0BF,CAA1B,CAAT,CAAiDV,CAAAa,QAAjD,CADjB,CAIIC,EAAAA,CAAM5iB,IAAA4iB,IAAA,CAAS,EAAT,CAAaf,CAAb,CACVD,EAAA,CAAS5hB,IAAA6iB,MAAA,CAAWjB,CAAX,CAAoBgB,CAApB,CAAT,CAAoCA,CAChCE,EAAAA,CAAY3hC,CAAA,EAAAA,CAAKygC,CAALzgC,OAAA,CAAmBwgC,EAAnB,CACZlS,EAAAA,CAAQqT,CAAA,CAAS,CAAT,CACZA,EAAA,CAAWA,CAAA,CAAS,CAAT,CAAX;AAA0B,EAEtB9+B,KAAAA,EAAM,CAANA,CACA++B,EAASjB,CAAAkB,OADTh/B,CAEAi/B,EAAQnB,CAAAoB,MAEZ,IAAIzT,CAAAh2B,OAAJ,EAAqBspC,CAArB,CAA8BE,CAA9B,CAEE,IADA,IAAAj/B,EAAMyrB,CAAAh2B,OAANuK,CAAqB++B,CAArB,CACStoC,EAAI,CAAb,CAAgBA,CAAhB,CAAoBuJ,CAApB,CAAyBvJ,CAAA,EAAzB,CAC0B,CAGxB,IAHKuJ,CAGL,CAHWvJ,CAGX,EAHcwoC,CAGd,EAHmC,CAGnC,GAH6BxoC,CAG7B,GAFE4nC,CAEF,EAFkBN,CAElB,EAAAM,CAAA,EAAgB5S,CAAA1wB,OAAA,CAAatE,CAAb,CAIpB,KAAKA,CAAL,CAASuJ,CAAT,CAAcvJ,CAAd,CAAkBg1B,CAAAh2B,OAAlB,CAAgCgB,CAAA,EAAhC,CACoC,CAGlC,IAHKg1B,CAAAh2B,OAGL,CAHoBgB,CAGpB,EAHuBsoC,CAGvB,EAH6C,CAG7C,GAHuCtoC,CAGvC,GAFE4nC,CAEF,EAFkBN,CAElB,EAAAM,CAAA,EAAgB5S,CAAA1wB,OAAA,CAAatE,CAAb,CAIlB,KAAA,CAAMqoC,CAAArpC,OAAN,CAAwBooC,CAAxB,CAAA,CACEiB,CAAA,EAAY,GAGVjB,EAAJ,EAAqC,GAArC,GAAoBA,CAApB,GAA0CQ,CAA1C,EAA0DL,CAA1D,CAAuEc,CAAAtkC,OAAA,CAAgB,CAAhB,CAAmBqjC,CAAnB,CAAvE,CAxCgB,CAgDlBxgC,CAAA/G,KAAA,CAAW4nC,CAAA,CAAaJ,CAAAqB,OAAb,CAA8BrB,CAAAsB,OAAzC,CACA/hC,EAAA/G,KAAA,CAAW+nC,CAAX,CACAhhC,EAAA/G,KAAA,CAAW4nC,CAAA,CAAaJ,CAAAuB,OAAb,CAA8BvB,CAAAwB,OAAzC,CACA,OAAOjiC,EAAAnG,KAAA,CAAW,EAAX,CAvEkE,CA0E3EqoC,QAASA,GAAS,CAACrV,CAAD,CAAMsV,CAAN,CAAcx5B,CAAd,CAAoB,CACpC,IAAIy5B,EAAM,EACA,EAAV,CAAIvV,CAAJ,GACEuV,CACA,CADO,GACP,CAAAvV,CAAA,CAAM,CAACA,CAFT,CAKA,KADAA,CACA,CADM,EACN,CADWA,CACX,CAAMA,CAAAz0B,OAAN,CAAmB+pC,CAAnB,CAAA,CAA2BtV,CAAA,CAAM,GAAN,CAAYA,CACnClkB,EAAJ,GACEkkB,CADF,CACQA,CAAA1vB,OAAA,CAAW0vB,CAAAz0B,OAAX,CAAwB+pC,CAAxB,CADR,CAEA,OAAOC,EAAP,CAAavV,CAVuB,CActCwV,QAASA,EAAU,CAACxhC,CAAD,CAAOuT,CAAP,CAAavP,CAAb,CAAqB8D,CAArB,CAA2B,CAC5C9D,CAAA,CAASA,CAAT,EAAmB,CACnB,OAAO,SAAQ,CAACy9B,CAAD,CAAO,CAChB/oC,CAAAA;AAAQ+oC,CAAA,CAAK,KAAL,CAAazhC,CAAb,CAAA,EACZ,IAAa,CAAb,CAAIgE,CAAJ,EAAkBtL,CAAlB,CAA0B,CAACsL,CAA3B,CACEtL,CAAA,EAASsL,CACG,EAAd,GAAItL,CAAJ,EAA8B,GAA9B,EAAmBsL,CAAnB,GAAmCtL,CAAnC,CAA2C,EAA3C,CACA,OAAO2oC,GAAA,CAAU3oC,CAAV,CAAiB6a,CAAjB,CAAuBzL,CAAvB,CALa,CAFsB,CAW9C45B,QAASA,GAAa,CAAC1hC,CAAD,CAAO2hC,CAAP,CAAkB,CACtC,MAAO,SAAQ,CAACF,CAAD,CAAOxC,CAAP,CAAgB,CAC7B,IAAIvmC,EAAQ+oC,CAAA,CAAK,KAAL,CAAazhC,CAAb,CAAA,EAAZ,CACImL,EAAMsa,EAAA,CAAUkc,CAAA,CAAa,OAAb,CAAuB3hC,CAAvB,CAA+BA,CAAzC,CAEV,OAAOi/B,EAAA,CAAQ9zB,CAAR,CAAA,CAAazS,CAAb,CAJsB,CADO,CAuIxCylC,QAASA,GAAU,CAACa,CAAD,CAAU,CAK3B4C,QAASA,EAAgB,CAACC,CAAD,CAAS,CAChC,IAAInjC,CACJ,IAAIA,CAAJ,CAAYmjC,CAAAnjC,MAAA,CAAaojC,CAAb,CAAZ,CAAyC,CACnCL,CAAAA,CAAO,IAAIxlC,IAAJ,CAAS,CAAT,CAD4B,KAEnC8lC,EAAS,CAF0B,CAGnCC,EAAS,CAH0B,CAInCC,EAAavjC,CAAA,CAAM,CAAN,CAAA,CAAW+iC,CAAAS,eAAX,CAAiCT,CAAAU,YAJX,CAKnCC,EAAa1jC,CAAA,CAAM,CAAN,CAAA,CAAW+iC,CAAAY,YAAX,CAA8BZ,CAAAa,SAE3C5jC,EAAA,CAAM,CAAN,CAAJ,GACEqjC,CACA,CADSroC,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,CAAeA,CAAA,CAAM,EAAN,CAAf,CACT,CAAAsjC,CAAA,CAAQtoC,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,CAAeA,CAAA,CAAM,EAAN,CAAf,CAFV,CAIAujC,EAAAhqC,KAAA,CAAgBwpC,CAAhB,CAAsB/nC,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,CAAtB,CAAqChF,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,CAArC,CAAqD,CAArD,CAAwDhF,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,CAAxD,CACIrF,EAAAA,CAAIK,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,EAAc,CAAd,CAAJrF,CAAuB0oC,CACvBQ,EAAAA,CAAI7oC,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,EAAc,CAAd,CAAJ6jC,CAAuBP,CACvBQ,EAAAA,CAAI9oC,CAAA,CAAIgF,CAAA,CAAM,CAAN,CAAJ,EAAc,CAAd,CACJ+jC,EAAAA,CAAK3kB,IAAA6iB,MAAA,CAA8C,GAA9C,CAAW+B,UAAA,CAAW,IAAX,EAAmBhkC,CAAA,CAAM,CAAN,CAAnB,EAA6B,CAA7B,EAAX,CACT0jC,EAAAnqC,KAAA,CAAgBwpC,CAAhB,CAAsBpoC,CAAtB,CAAyBkpC,CAAzB,CAA4BC,CAA5B,CAA+BC,CAA/B,CAhBuC,CAmBzC,MAAOZ,EArByB,CALP;AAG3B,IAAIC,EAAgB,sGA2BpB,OAAO,SAAQ,CAACL,CAAD,CAAOkB,CAAP,CAAe,CAAA,IACxB7iB,EAAO,EADiB,CAExB3gB,EAAQ,EAFgB,CAGxBnC,CAHwB,CAGpB0B,CAERikC,EAAA,CAASA,CAAT,EAAmB,YACnBA,EAAA,CAAS3D,CAAA4D,iBAAA,CAAyBD,CAAzB,CAAT,EAA6CA,CACzClrC,EAAA,CAASgqC,CAAT,CAAJ,GAEIA,CAFJ,CACMoB,EAAAxhC,KAAA,CAAmBogC,CAAnB,CAAJ,CACS/nC,CAAA,CAAI+nC,CAAJ,CADT,CAGSG,CAAA,CAAiBH,CAAjB,CAJX,CAQIlnC,GAAA,CAASknC,CAAT,CAAJ,GACEA,CADF,CACS,IAAIxlC,IAAJ,CAASwlC,CAAT,CADT,CAIA,IAAI,CAACjnC,EAAA,CAAOinC,CAAP,CAAL,CACE,MAAOA,EAGT,KAAA,CAAMkB,CAAN,CAAA,CAEE,CADAjkC,CACA,CADQokC,EAAA3iC,KAAA,CAAwBwiC,CAAxB,CACR,GACExjC,CACA,CADeA,CAtkYd/B,OAAA,CAAcF,EAAAjF,KAAA,CAskYOyG,CAtkYP,CAskYc9F,CAtkYd,CAAd,CAukYD,CAAA+pC,CAAA,CAASxjC,CAAAyP,IAAA,EAFX,GAIEzP,CAAA/G,KAAA,CAAWuqC,CAAX,CACA,CAAAA,CAAA,CAAS,IALX,CASFhrC,EAAA,CAAQwH,CAAR,CAAe,QAAQ,CAACzG,CAAD,CAAO,CAC5BsE,CAAA,CAAK+lC,EAAA,CAAarqC,CAAb,CACLonB,EAAA,EAAQ9iB,CAAA,CAAKA,CAAA,CAAGykC,CAAH,CAASzC,CAAA4D,iBAAT,CAAL,CACKlqC,CAAAiG,QAAA,CAAc,UAAd,CAA0B,EAA1B,CAAAA,QAAA,CAAsC,KAAtC,CAA6C,GAA7C,CAHe,CAA9B,CAMA,OAAOmhB,EAxCqB,CA9BH,CAuG7Bue,QAASA,GAAU,EAAG,CACpB,MAAO,SAAQ,CAAC2E,CAAD,CAAS,CACtB,MAAOzlC,GAAA,CAAOylC,CAAP,CAAe,CAAA,CAAf,CADe,CADJ,CA17ZiB;AAqhavC1E,QAASA,GAAa,EAAE,CACtB,MAAO,SAAQ,CAAC2E,CAAD,CAAQC,CAAR,CAAe,CAC5B,GAAI,CAACxrC,CAAA,CAAQurC,CAAR,CAAL,EAAuB,CAACxrC,CAAA,CAASwrC,CAAT,CAAxB,CAAyC,MAAOA,EAEhDC,EAAA,CAAQxpC,CAAA,CAAIwpC,CAAJ,CAER,IAAIzrC,CAAA,CAASwrC,CAAT,CAAJ,CAEE,MAAIC,EAAJ,CACkB,CAAT,EAAAA,CAAA,CAAaD,CAAA/lC,MAAA,CAAY,CAAZ,CAAegmC,CAAf,CAAb,CAAqCD,CAAA/lC,MAAA,CAAYgmC,CAAZ,CAAmBD,CAAA1rC,OAAnB,CAD9C,CAGS,EAViB,KAcxB4rC,EAAM,EAdkB,CAe1B5qC,CAf0B,CAevB0a,CAGDiwB,EAAJ,CAAYD,CAAA1rC,OAAZ,CACE2rC,CADF,CACUD,CAAA1rC,OADV,CAES2rC,CAFT,CAEiB,CAACD,CAAA1rC,OAFlB,GAGE2rC,CAHF,CAGU,CAACD,CAAA1rC,OAHX,CAKY,EAAZ,CAAI2rC,CAAJ,EACE3qC,CACA,CADI,CACJ,CAAA0a,CAAA,CAAIiwB,CAFN,GAIE3qC,CACA,CADI0qC,CAAA1rC,OACJ,CADmB2rC,CACnB,CAAAjwB,CAAA,CAAIgwB,CAAA1rC,OALN,CAQA,KAAA,CAAOgB,CAAP,CAAS0a,CAAT,CAAY1a,CAAA,EAAZ,CACE4qC,CAAA/qC,KAAA,CAAS6qC,CAAA,CAAM1qC,CAAN,CAAT,CAGF,OAAO4qC,EAnCqB,CADR,CA+HxB1E,QAASA,GAAa,CAAC3oB,CAAD,CAAQ,CAC5B,MAAO,SAAQ,CAACta,CAAD,CAAQ4nC,CAAR,CAAuBC,CAAvB,CAAqC,CA4BlDC,QAASA,EAAiB,CAACC,CAAD,CAAOC,CAAP,CAAmB,CAC3C,MAAO1lC,GAAA,CAAU0lC,CAAV,CACA,CAAD,QAAQ,CAAC/jB,CAAD,CAAGC,CAAH,CAAK,CAAC,MAAO6jB,EAAA,CAAK7jB,CAAL,CAAOD,CAAP,CAAR,CAAZ,CACD8jB,CAHqC,CA1B7C,GADI,CAAC7rC,CAAA,CAAQ8D,CAAR,CACL,EAAI,CAAC4nC,CAAL,CAAoB,MAAO5nC,EAC3B4nC,EAAA,CAAgB1rC,CAAA,CAAQ0rC,CAAR,CAAA,CAAyBA,CAAzB,CAAwC,CAACA,CAAD,CACxDA,EAAA,CAAgBhoC,EAAA,CAAIgoC,CAAJ,CAAmB,QAAQ,CAACK,CAAD,CAAW,CAAA,IAChDD,EAAa,CAAA,CADmC,CAC5Br4B,EAAMs4B,CAANt4B,EAAmBlR,EAC3C,IAAIxC,CAAA,CAASgsC,CAAT,CAAJ,CAAyB,CACvB,GAA4B,GAA5B,EAAKA,CAAA5mC,OAAA,CAAiB,CAAjB,CAAL,EAA0D,GAA1D,EAAmC4mC,CAAA5mC,OAAA,CAAiB,CAAjB,CAAnC,CACE2mC,CACA,CADoC,GACpC,EADaC,CAAA5mC,OAAA,CAAiB,CAAjB,CACb,CAAA4mC,CAAA,CAAYA,CAAA3xB,UAAA,CAAoB,CAApB,CAEd3G;CAAA,CAAM2K,CAAA,CAAO2tB,CAAP,CALiB,CAOzB,MAAOH,EAAA,CAAkB,QAAQ,CAAC7jB,CAAD,CAAGC,CAAH,CAAK,CAC7B,IAAA,CAAQ,EAAA,CAAAvU,CAAA,CAAIsU,CAAJ,CAAO,KAAA,EAAAtU,CAAA,CAAIuU,CAAJ,CAAA,CAoBpBhjB,EAAK,MAAOgnC,EApBQ,CAqBpB/mC,EAAK,MAAOgnC,EACZjnC,EAAJ,EAAUC,CAAV,EACY,QAIV,EAJID,CAIJ,GAHGgnC,CACA,CADKA,CAAA3hC,YAAA,EACL,CAAA4hC,CAAA,CAAKA,CAAA5hC,YAAA,EAER,EAAA,CAAA,CAAI2hC,CAAJ,GAAWC,CAAX,CAAsB,CAAtB,CACOD,CAAA,CAAKC,CAAL,CAAW,EAAX,CAAe,CANxB,EAQE,CARF,CAQSjnC,CAAA,CAAKC,CAAL,CAAW,EAAX,CAAe,CA9BtB,OAAO,EAD6B,CAA/B,CAEJ6mC,CAFI,CAT6C,CAAtC,CAchB,KADA,IAAII,EAAY,EAAhB,CACUrrC,EAAI,CAAd,CAAiBA,CAAjB,CAAqBiD,CAAAjE,OAArB,CAAmCgB,CAAA,EAAnC,CAA0CqrC,CAAAxrC,KAAA,CAAeoD,CAAA,CAAMjD,CAAN,CAAf,CAC1C,OAAOqrC,EAAAvrC,KAAA,CAAeirC,CAAA,CAEtBO,QAAmB,CAACrnC,CAAD,CAAKC,CAAL,CAAQ,CACzB,IAAM,IAAIlE,EAAI,CAAd,CAAiBA,CAAjB,CAAqB6qC,CAAA7rC,OAArB,CAA2CgB,CAAA,EAA3C,CAAgD,CAC9C,IAAIgrC,EAAOH,CAAA,CAAc7qC,CAAd,CAAA,CAAiBiE,CAAjB,CAAqBC,CAArB,CACX,IAAa,CAAb,GAAI8mC,CAAJ,CAAgB,MAAOA,EAFuB,CAIhD,MAAO,EALkB,CAFL,CAA8BF,CAA9B,CAAf,CAnB2C,CADxB,CAmD9BS,QAASA,GAAW,CAAChvB,CAAD,CAAY,CAC1B/c,CAAA,CAAW+c,CAAX,CAAJ,GACEA,CADF,CACc,MACJA,CADI,CADd,CAKAA,EAAAS,SAAA,CAAqBT,CAAAS,SAArB,EAA2C,IAC3C,OAAOpb,GAAA,CAAQ2a,CAAR,CAPuB,CAmbhCivB,QAASA,GAAc,CAAC7lC,CAAD,CAAU+Z,CAAV,CAAiB,CAqBtC+rB,QAASA,EAAc,CAACC,CAAD,CAAUC,CAAV,CAA8B,CACnDA,CAAA,CAAqBA,CAAA,CAAqB,GAArB,CAA2BxiC,EAAA,CAAWwiC,CAAX,CAA+B,GAA/B,CAA3B,CAAiE,EACtFhmC,EAAAojB,YAAA,EACe2iB,CAAA,CAAUE,EAAV,CAA0BC,EADzC,EACwDF,CADxD,CAAAhtB,SAAA,EAEY+sB,CAAA,CAAUG,EAAV;AAAwBD,EAFpC,EAEqDD,CAFrD,CAFmD,CArBf,IAClCG,EAAO,IAD2B,CAElCC,EAAapmC,CAAApE,OAAA,EAAAwb,WAAA,CAA4B,MAA5B,CAAbgvB,EAAoDC,EAFlB,CAGlCC,EAAe,CAHmB,CAIlCC,EAASJ,CAAAK,OAATD,CAAuB,EAJW,CAKlCE,EAAW,EAGfN,EAAAO,MAAA,CAAa3sB,CAAAjY,KAAb,EAA2BiY,CAAA4sB,OAC3BR,EAAAS,OAAA,CAAc,CAAA,CACdT,EAAAU,UAAA,CAAiB,CAAA,CACjBV,EAAAW,OAAA,CAAc,CAAA,CACdX,EAAAY,SAAA,CAAgB,CAAA,CAEhBX,EAAAY,YAAA,CAAuBb,CAAvB,CAGAnmC,EAAAgZ,SAAA,CAAiBiuB,EAAjB,CACAnB,EAAA,CAAe,CAAA,CAAf,CAoBAK,EAAAa,YAAA,CAAmBE,QAAQ,CAACC,CAAD,CAAU,CAGnC/iC,EAAA,CAAwB+iC,CAAAT,MAAxB,CAAuC,OAAvC,CACAD,EAAAvsC,KAAA,CAAcitC,CAAd,CAEIA,EAAAT,MAAJ,GACEP,CAAA,CAAKgB,CAAAT,MAAL,CADF,CACwBS,CADxB,CANmC,CAqBrChB,EAAAiB,eAAA,CAAsBC,QAAQ,CAACF,CAAD,CAAU,CAClCA,CAAAT,MAAJ,EAAqBP,CAAA,CAAKgB,CAAAT,MAAL,CAArB,GAA6CS,CAA7C,EACE,OAAOhB,CAAA,CAAKgB,CAAAT,MAAL,CAETjtC,EAAA,CAAQ8sC,CAAR,CAAgB,QAAQ,CAACe,CAAD,CAAQC,CAAR,CAAyB,CAC/CpB,CAAAqB,aAAA,CAAkBD,CAAlB,CAAmC,CAAA,CAAnC,CAAyCJ,CAAzC,CAD+C,CAAjD,CAIA5pC,GAAA,CAAYkpC,CAAZ,CAAsBU,CAAtB,CARsC,CAqBxChB,EAAAqB,aAAA,CAAoBC,QAAQ,CAACF,CAAD,CAAkBxB,CAAlB,CAA2BoB,CAA3B,CAAoC,CAC9D,IAAIG,EAAQf,CAAA,CAAOgB,CAAP,CAEZ,IAAIxB,CAAJ,CACMuB,CAAJ,GACE/pC,EAAA,CAAY+pC,CAAZ,CAAmBH,CAAnB,CACA,CAAKG,CAAAjuC,OAAL,GACEitC,CAAA,EAQA,CAPKA,CAOL,GANER,CAAA,CAAeC,CAAf,CAEA,CADAI,CAAAW,OACA,CADc,CAAA,CACd,CAAAX,CAAAY,SAAA;AAAgB,CAAA,CAIlB,EAFAR,CAAA,CAAOgB,CAAP,CAEA,CAF0B,CAAA,CAE1B,CADAzB,CAAA,CAAe,CAAA,CAAf,CAAqByB,CAArB,CACA,CAAAnB,CAAAoB,aAAA,CAAwBD,CAAxB,CAAyC,CAAA,CAAzC,CAA+CpB,CAA/C,CATF,CAFF,CADF,KAgBO,CACAG,CAAL,EACER,CAAA,CAAeC,CAAf,CAEF,IAAIuB,CAAJ,CACE,IArnayB,EAqnazB,EArnaCjqC,EAAA,CAqnaYiqC,CArnaZ,CAqnamBH,CArnanB,CAqnaD,CAA8B,MAA9B,CADF,IAGEZ,EAAA,CAAOgB,CAAP,CAGA,CAH0BD,CAG1B,CAHkC,EAGlC,CAFAhB,CAAA,EAEA,CADAR,CAAA,CAAe,CAAA,CAAf,CAAsByB,CAAtB,CACA,CAAAnB,CAAAoB,aAAA,CAAwBD,CAAxB,CAAyC,CAAA,CAAzC,CAAgDpB,CAAhD,CAEFmB,EAAAptC,KAAA,CAAWitC,CAAX,CAEAhB,EAAAW,OAAA,CAAc,CAAA,CACdX,EAAAY,SAAA,CAAgB,CAAA,CAfX,CAnBuD,CAiDhEZ,EAAAuB,UAAA,CAAiBC,QAAQ,EAAG,CAC1B3nC,CAAAojB,YAAA,CAAoB6jB,EAApB,CAAAjuB,SAAA,CAA6C4uB,EAA7C,CACAzB,EAAAS,OAAA,CAAc,CAAA,CACdT,EAAAU,UAAA,CAAiB,CAAA,CACjBT,EAAAsB,UAAA,EAJ0B,CAsB5BvB,EAAA0B,aAAA,CAAoBC,QAAS,EAAG,CAC9B9nC,CAAAojB,YAAA,CAAoBwkB,EAApB,CAAA5uB,SAAA,CAA0CiuB,EAA1C,CACAd,EAAAS,OAAA,CAAc,CAAA,CACdT,EAAAU,UAAA,CAAiB,CAAA,CACjBptC,EAAA,CAAQgtC,CAAR,CAAkB,QAAQ,CAACU,CAAD,CAAU,CAClCA,CAAAU,aAAA,EADkC,CAApC,CAJ8B,CAvJM,CA4sBxCE,QAASA,GAAa,CAACnlC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B13B,CAA7B,CAAuC8V,CAAvC,CAAiD,CAErE,IAAI5U,EAAWA,QAAQ,EAAG,CACxB,IAAIhX,EAAQwF,CAAAZ,IAAA,EAKRQ,GAAA,CAAUwC,CAAA6lC,OAAV,EAAyB,GAAzB,CAAJ,GACEztC,CADF,CACUoP,EAAA,CAAKpP,CAAL,CADV,CAIIwtC,EAAAE,WAAJ,GAAwB1tC,CAAxB,EACEoI,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtBilC,CAAAG,cAAA,CAAmB3tC,CAAnB,CADsB,CAAxB,CAXsB,CAmB1B;GAAI8V,CAAA0uB,SAAA,CAAkB,OAAlB,CAAJ,CACEh/B,CAAAhD,GAAA,CAAW,OAAX,CAAoBwU,CAApB,CADF,KAEO,CACL,IAAIkY,CAAJ,CAEI0e,EAAgBA,QAAQ,EAAG,CACxB1e,CAAL,GACEA,CADF,CACYtD,CAAAvS,MAAA,CAAe,QAAQ,EAAG,CAClCrC,CAAA,EACAkY,EAAA,CAAU,IAFwB,CAA1B,CADZ,CAD6B,CAS/B1pB,EAAAhD,GAAA,CAAW,SAAX,CAAsB,QAAQ,CAACuN,CAAD,CAAQ,CAChC3Q,CAAAA,CAAM2Q,CAAA89B,QAIE,GAAZ,GAAIzuC,CAAJ,GAAmB,EAAnB,CAAwBA,CAAxB,EAAqC,EAArC,CAA+BA,CAA/B,EAA6C,EAA7C,EAAmDA,CAAnD,EAAiE,EAAjE,EAA0DA,CAA1D,GAEAwuC,CAAA,EAPoC,CAAtC,CAWApoC,EAAAhD,GAAA,CAAW,QAAX,CAAqBwU,CAArB,CAGA,IAAIlB,CAAA0uB,SAAA,CAAkB,OAAlB,CAAJ,CACEh/B,CAAAhD,GAAA,CAAW,WAAX,CAAwBorC,CAAxB,CA3BG,CAgCPJ,CAAAM,QAAA,CAAeC,QAAQ,EAAG,CACxBvoC,CAAAZ,IAAA,CAAY4oC,CAAAQ,SAAA,CAAcR,CAAAE,WAAd,CAAA,CAAiC,EAAjC,CAAsCF,CAAAE,WAAlD,CADwB,CAvD2C,KA4DjExG,EAAUt/B,CAAAqmC,UA5DuD,CAgEjEC,EAAWA,QAAQ,CAACnxB,CAAD,CAAS/c,CAAT,CAAgB,CACrC,GAAIwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAJ,EAA4B+c,CAAApU,KAAA,CAAY3I,CAAZ,CAA5B,CAEE,MADAwtC,EAAAR,aAAA,CAAkB,SAAlB,CAA6B,CAAA,CAA7B,CACOhtC,CAAAA,CAEPwtC,EAAAR,aAAA,CAAkB,SAAlB,CAA6B,CAAA,CAA7B,CACA,OAAOxuC,EAN4B,CAUnC0oC,EAAJ,GAEE,CADAlhC,CACA,CADQkhC,CAAAlhC,MAAA,CAAc,oBAAd,CACR,GACEkhC,CACA,CADczjC,MAAJ,CAAWuC,CAAA,CAAM,CAAN,CAAX;AAAqBA,CAAA,CAAM,CAAN,CAArB,CACV,CAAAmoC,CAAA,CAAmBA,QAAQ,CAACnuC,CAAD,CAAQ,CACjC,MAAOkuC,EAAA,CAAShH,CAAT,CAAkBlnC,CAAlB,CAD0B,CAFrC,EAMEmuC,CANF,CAMqBA,QAAQ,CAACnuC,CAAD,CAAQ,CACjC,IAAIouC,EAAahmC,CAAA83B,MAAA,CAAYgH,CAAZ,CAEjB,IAAI,CAACkH,CAAL,EAAmB,CAACA,CAAAzlC,KAApB,CACE,KAAMlK,EAAA,CAAO,WAAP,CAAA,CAAoB,UAApB,CACqDyoC,CADrD,CAEJkH,CAFI,CAEQ7oC,EAAA,CAAYC,CAAZ,CAFR,CAAN,CAIF,MAAO0oC,EAAA,CAASE,CAAT,CAAqBpuC,CAArB,CAR0B,CAarC,CADAwtC,CAAAa,YAAA3uC,KAAA,CAAsByuC,CAAtB,CACA,CAAAX,CAAAc,SAAA5uC,KAAA,CAAmByuC,CAAnB,CArBF,CAyBA,IAAIvmC,CAAA2mC,YAAJ,CAAsB,CACpB,IAAIC,EAAYxtC,CAAA,CAAI4G,CAAA2mC,YAAJ,CACZE,EAAAA,CAAqBA,QAAQ,CAACzuC,CAAD,CAAQ,CACvC,GAAI,CAACwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAL,EAA6BA,CAAAnB,OAA7B,CAA4C2vC,CAA5C,CAEE,MADAhB,EAAAR,aAAA,CAAkB,WAAlB,CAA+B,CAAA,CAA/B,CACOxuC,CAAAA,CAEPgvC,EAAAR,aAAA,CAAkB,WAAlB,CAA+B,CAAA,CAA/B,CACA,OAAOhtC,EAN8B,CAUzCwtC,EAAAc,SAAA5uC,KAAA,CAAmB+uC,CAAnB,CACAjB,EAAAa,YAAA3uC,KAAA,CAAsB+uC,CAAtB,CAboB,CAiBtB,GAAI7mC,CAAA8mC,YAAJ,CAAsB,CACpB,IAAIC,EAAY3tC,CAAA,CAAI4G,CAAA8mC,YAAJ,CACZE,EAAAA,CAAqBA,QAAQ,CAAC5uC,CAAD,CAAQ,CACvC,GAAI,CAACwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAL,EAA6BA,CAAAnB,OAA7B,CAA4C8vC,CAA5C,CAEE,MADAnB,EAAAR,aAAA,CAAkB,WAAlB;AAA+B,CAAA,CAA/B,CACOxuC,CAAAA,CAEPgvC,EAAAR,aAAA,CAAkB,WAAlB,CAA+B,CAAA,CAA/B,CACA,OAAOhtC,EAN8B,CAUzCwtC,EAAAc,SAAA5uC,KAAA,CAAmBkvC,CAAnB,CACApB,EAAAa,YAAA3uC,KAAA,CAAsBkvC,CAAtB,CAboB,CApH+C,CA0sCvEC,QAASA,GAAc,CAACvnC,CAAD,CAAOwH,CAAP,CAAiB,CACtCxH,CAAA,CAAO,SAAP,CAAmBA,CACnB,OAAO,SAAQ,EAAG,CAChB,MAAO,UACK,IADL,MAECkT,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAwBnCknC,QAASA,EAAkB,CAACpQ,CAAD,CAAS,CAClC,GAAiB,CAAA,CAAjB,GAAI5vB,CAAJ,EAAyB1G,CAAA2mC,OAAzB,CAAwC,CAAxC,GAA8CjgC,CAA9C,CACM6vB,CAeN,EAfiB,CAAA96B,EAAA,CAAO66B,CAAP,CAAcC,CAAd,CAejB,EALA/2B,CAAA+gB,aAAA,CAAkBqmB,CAAA,CATFrQ,CASE,CAAlB,CAKA,CAAA/2B,CAAA6gB,UAAA,CAAeumB,CAAA,CAZJtQ,CAYI,CAAf,CAVAC,EAAA,CAAS17B,EAAA,CAAKy7B,CAAL,CAPyB,CAoBpCsQ,QAASA,EAAc,CAACtmB,CAAD,CAAW,CAChC,GAAG1pB,CAAA,CAAQ0pB,CAAR,CAAH,CACE,MAAOA,EAAApoB,KAAA,CAAc,GAAd,CACF,IAAIsB,CAAA,CAAS8mB,CAAT,CAAJ,CAAwB,CAAA,IACzBumB,EAAU,EACdhwC,EAAA,CAAQypB,CAAR,CAAkB,QAAQ,CAACrjB,CAAD,CAAIkjB,CAAJ,CAAO,CAC3BljB,CAAJ,EACE4pC,CAAAvvC,KAAA,CAAa6oB,CAAb,CAF6B,CAAjC,CAKA,OAAO0mB,EAAA3uC,KAAA,CAAa,GAAb,CAPsB,CAU/B,MAAOooB,EAbyB,CA3ClC,IAAIiW,EAASngC,CAEb4J,EAAA/E,OAAA,CAAauE,CAAA,CAAKN,CAAL,CAAb,CAAyBwnC,CAAzB,CAA6C,CAAA,CAA7C,CAEAlnC,EAAA0b,SAAA,CAAc,OAAd,CAAuB,QAAQ,CAACtjB,CAAD,CAAQ,CACrC8uC,CAAA,CAAmB1mC,CAAA83B,MAAA,CAAYt4B,CAAA,CAAKN,CAAL,CAAZ,CAAnB,CADqC,CAAvC,CAKa,UAAb,GAAIA,CAAJ,EACEc,CAAA/E,OAAA,CAAa,QAAb;AAAuB,QAAQ,CAAC0rC,CAAD,CAASG,CAAT,CAAoB,CACjD,IAAIC,EAAMJ,CAANI,CAAe,CACfA,EAAJ,GAAYD,CAAZ,CAAwB,CAAxB,GACMC,CAAJ,GAAYrgC,CAAZ,EACW,CA0Bf,CA1Be1G,CAAA83B,MAAA,CAAYt4B,CAAA,CAAKN,CAAL,CAAZ,CA0Bf,CAAAM,CAAA6gB,UAAA,CAAeumB,CAAA,CAAetmB,CAAf,CAAf,CA3BI,GAGc,CAmBlB,CAnBkBtgB,CAAA83B,MAAA,CAAYt4B,CAAA,CAAKN,CAAL,CAAZ,CAmBlB,CAAAM,CAAA+gB,aAAA,CAAkBqmB,CAAA,CAAetmB,CAAf,CAAlB,CAtBI,CADF,CAFiD,CAAnD,CAXiC,CAFhC,CADS,CAFoB,CAz7exC,IAAIpjB,EAAYA,QAAQ,CAAC6jC,CAAD,CAAQ,CAAC,MAAOpqC,EAAA,CAASoqC,CAAT,CAAA,CAAmBA,CAAA9/B,YAAA,EAAnB,CAA0C8/B,CAAlD,CAAhC,CAYIpc,GAAYA,QAAQ,CAACoc,CAAD,CAAQ,CAAC,MAAOpqC,EAAA,CAASoqC,CAAT,CAAA,CAAmBA,CAAA59B,YAAA,EAAnB,CAA0C49B,CAAlD,CAZhC,CAqCIv4B,CArCJ,CAsCInL,CAtCJ,CAuCIgH,EAvCJ,CAwCIjI,GAAoB,EAAAA,MAxCxB,CAyCI9E,GAAoB,EAAAA,KAzCxB,CA0CIqC,GAAoBuI,MAAAsJ,UAAA7R,SA1CxB,CA2CIuB,GAAoB7E,CAAA,CAAO,IAAP,CA3CxB,CAgDImK,GAAoBtK,CAAAsK,QAApBA,GAAuCtK,CAAAsK,QAAvCA,CAAwD,EAAxDA,CAhDJ,CAiDI+J,EAjDJ,CAkDIsN,EAlDJ,CAmDI9f,GAAoB,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAMxByQ,EAAA,CAAO5P,CAAA,CAAI,CAAC,YAAAyG,KAAA,CAAkBnC,CAAA,CAAUw+B,SAAAD,UAAV,CAAlB,CAAD,EAAsD,EAAtD,EAA0D,CAA1D,CAAJ,CACH1D,MAAA,CAAMvvB,CAAN,CAAJ,GACEA,CADF,CACS5P,CAAA,CAAI,CAAC,uBAAAyG,KAAA,CAA6BnC,CAAA,CAAUw+B,SAAAD,UAAV,CAA7B,CAAD,EAAiE,EAAjE,EAAqE,CAArE,CAAJ,CADT,CA0MAviC,EAAA6P,QAAA,CAAe,EAmBf5P,GAAA4P,QAAA,CAAmB,EAiKnB,KAAI/B;AAAQ,QAAQ,EAAG,CAIrB,MAAK7O,OAAAqT,UAAAxE,KAAL,CAKO,QAAQ,CAACpP,CAAD,CAAQ,CACrB,MAAOjB,EAAA,CAASiB,CAAT,CAAA,CAAkBA,CAAAoP,KAAA,EAAlB,CAAiCpP,CADnB,CALvB,CACS,QAAQ,CAACA,CAAD,CAAQ,CACrB,MAAOjB,EAAA,CAASiB,CAAT,CAAA,CAAkBA,CAAAiG,QAAA,CAAc,MAAd,CAAsB,EAAtB,CAAAA,QAAA,CAAkC,MAAlC,CAA0C,EAA1C,CAAlB,CAAkEjG,CADpD,CALJ,CAAX,EA6CVigB,GAAA,CADS,CAAX,CAAIrP,CAAJ,CACcqP,QAAQ,CAACza,CAAD,CAAU,CAC5BA,CAAA,CAAUA,CAAAjD,SAAA,CAAmBiD,CAAnB,CAA6BA,CAAA,CAAQ,CAAR,CACvC,OAAQA,EAAAud,UACD,EAD2C,MAC3C,EADsBvd,CAAAud,UACtB,CAAHgK,EAAA,CAAUvnB,CAAAud,UAAV,CAA8B,GAA9B,CAAoCvd,CAAAjD,SAApC,CAAG,CAAqDiD,CAAAjD,SAHhC,CADhC,CAOc0d,QAAQ,CAACza,CAAD,CAAU,CAC5B,MAAOA,EAAAjD,SAAA,CAAmBiD,CAAAjD,SAAnB,CAAsCiD,CAAA,CAAQ,CAAR,CAAAjD,SADjB,CAmnBhC,KAAI2G,GAAoB,QAAxB,CAwYIkmC,GAAU,MACN,YADM,OAEL,CAFK,OAGL,CAHK,KAIP,CAJO,UAKF,kBALE,CAxYd,CAolBI9gC,GAAU1B,CAAAuG,MAAV7E,CAAyB,EAplB7B,CAqlBIF,GAASxB,CAAA0b,QAATla,CAA0B,KAA1BA,CAAkC5K,CAAA,IAAID,IAAJC,SAAA,EArlBtC,CAslBIgL,GAAO,CAtlBX,CAulBI6gC,GAAsB/wC,CAAAC,SAAA+wC,iBACA;AAAlB,QAAQ,CAAC9pC,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoB,CAACkB,CAAA8pC,iBAAA,CAAyB1hC,CAAzB,CAA+BtJ,CAA/B,CAAmC,CAAA,CAAnC,CAAD,CAAV,CAClB,QAAQ,CAACkB,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoB,CAACkB,CAAA+pC,YAAA,CAAoB,IAApB,CAA2B3hC,CAA3B,CAAiCtJ,CAAjC,CAAD,CAzlBpC,CA0lBI4J,GAAyB5P,CAAAC,SAAAixC,oBACA,CAArB,QAAQ,CAAChqC,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoB,CAACkB,CAAAgqC,oBAAA,CAA4B5hC,CAA5B,CAAkCtJ,CAAlC,CAAsC,CAAA,CAAtC,CAAD,CAAP,CACrB,QAAQ,CAACkB,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoB,CAACkB,CAAAiqC,YAAA,CAAoB,IAApB,CAA2B7hC,CAA3B,CAAiCtJ,CAAjC,CAAD,CA5lBpC,CAimBI8G,GAAuB,iBAjmB3B,CAkmBII,GAAkB,aAlmBtB,CAmmBIqB,GAAepO,CAAA,CAAO,QAAP,CAnmBnB,CAy1BI2f,GAAkBxR,CAAAgH,UAAlBwK,CAAqC,OAChCsxB,QAAQ,CAACprC,CAAD,CAAK,CAGlBqrC,QAASA,EAAO,EAAG,CACbC,CAAJ,GACAA,CACA,CADQ,CAAA,CACR,CAAAtrC,CAAA,EAFA,CADiB,CAFnB,IAAIsrC,EAAQ,CAAA,CASgB,WAA5B,GAAIrxC,CAAA8xB,WAAJ,CACE/Z,UAAA,CAAWq5B,CAAX,CADF,EAGE,IAAAntC,GAAA,CAAQ,kBAAR,CAA4BmtC,CAA5B,CAEA,CAAA/iC,CAAA,CAAOtO,CAAP,CAAAkE,GAAA,CAAkB,MAAlB,CAA0BmtC,CAA1B,CALF,CAVkB,CADmB,UAmB7B5tC,QAAQ,EAAG,CACnB,IAAI/B,EAAQ,EACZf,EAAA,CAAQ,IAAR,CAAc,QAAQ,CAAC2G,CAAD,CAAG,CAAE5F,CAAAN,KAAA,CAAW,EAAX,CAAgBkG,CAAhB,CAAF,CAAzB,CACA,OAAO,GAAP,CAAa5F,CAAAM,KAAA,CAAW,IAAX,CAAb;AAAgC,GAHb,CAnBkB,IAyBnC+d,QAAQ,CAACne,CAAD,CAAQ,CAChB,MAAiB,EAAV,EAACA,CAAD,CAAeuF,CAAA,CAAO,IAAA,CAAKvF,CAAL,CAAP,CAAf,CAAqCuF,CAAA,CAAO,IAAA,CAAK,IAAA5G,OAAL,CAAmBqB,CAAnB,CAAP,CAD5B,CAzBmB,QA6B/B,CA7B+B,MA8BjCR,EA9BiC,MA+BjC,EAAAC,KA/BiC,QAgC/B,EAAAqD,OAhC+B,CAz1BzC,CAi4BI4M,GAAe,EACnB3Q,EAAA,CAAQ,2DAAA,MAAA,CAAA,GAAA,CAAR,CAAgF,QAAQ,CAACe,CAAD,CAAQ,CAC9F4P,EAAA,CAAatK,CAAA,CAAUtF,CAAV,CAAb,CAAA,CAAiCA,CAD6D,CAAhG,CAGA,KAAI6P,GAAmB,EACvB5Q,EAAA,CAAQ,kDAAA,MAAA,CAAA,GAAA,CAAR,CAAuE,QAAQ,CAACe,CAAD,CAAQ,CACrF6P,EAAA,CAAiBkd,EAAA,CAAU/sB,CAAV,CAAjB,CAAA,CAAqC,CAAA,CADgD,CAAvF,CAYAf,EAAA,CAAQ,MACAwP,EADA,eAESgB,EAFT,OAICrH,QAAQ,CAAC5C,CAAD,CAAU,CACvB,MAAOiK,GAAA,CAAoBjK,CAApB,CAA6B,QAA7B,CADgB,CAJnB,YAQMgK,EARN,UAUIzH,QAAQ,CAACvC,CAAD,CAAU,CAC1B,MAAOiK,GAAA,CAAoBjK,CAApB,CAA6B,WAA7B,CADmB,CAVtB,YAcMkkB,QAAQ,CAAClkB,CAAD,CAAS8B,CAAT,CAAe,CACjC9B,CAAAqqC,gBAAA,CAAwBvoC,CAAxB,CADiC,CAd7B,UAkBIuH,EAlBJ;IAoBDihC,QAAQ,CAACtqC,CAAD,CAAU8B,CAAV,CAAgBtH,CAAhB,CAAuB,CAClCsH,CAAA,CAAO6D,EAAA,CAAU7D,CAAV,CAEP,IAAI3F,CAAA,CAAU3B,CAAV,CAAJ,CACEwF,CAAA2+B,MAAA,CAAc78B,CAAd,CAAA,CAAsBtH,CADxB,KAEO,CACL,IAAI4E,CAEQ,EAAZ,EAAIgM,CAAJ,GAEEhM,CACA,CADMY,CAAAuqC,aACN,EAD8BvqC,CAAAuqC,aAAA,CAAqBzoC,CAArB,CAC9B,CAAY,EAAZ,GAAI1C,CAAJ,GAAgBA,CAAhB,CAAsB,MAAtB,CAHF,CAMAA,EAAA,CAAMA,CAAN,EAAaY,CAAA2+B,MAAA,CAAc78B,CAAd,CAED,EAAZ,EAAIsJ,CAAJ,GAEEhM,CAFF,CAEiB,EAAT,GAACA,CAAD,CAAepG,CAAf,CAA2BoG,CAFnC,CAKA,OAAQA,EAhBH,CAL2B,CApB9B,MA6CAgD,QAAQ,CAACpC,CAAD,CAAU8B,CAAV,CAAgBtH,CAAhB,CAAsB,CAClC,IAAIgwC,EAAiB1qC,CAAA,CAAUgC,CAAV,CACrB,IAAIsI,EAAA,CAAaogC,CAAb,CAAJ,CACE,GAAIruC,CAAA,CAAU3B,CAAV,CAAJ,CACQA,CAAN,EACEwF,CAAA,CAAQ8B,CAAR,CACA,CADgB,CAAA,CAChB,CAAA9B,CAAA0J,aAAA,CAAqB5H,CAArB,CAA2B0oC,CAA3B,CAFF,GAIExqC,CAAA,CAAQ8B,CAAR,CACA,CADgB,CAAA,CAChB,CAAA9B,CAAAqqC,gBAAA,CAAwBG,CAAxB,CALF,CADF,KASE,OAAQxqC,EAAA,CAAQ8B,CAAR,CAED,EADGkZ,CAAAhb,CAAAmC,WAAAsoC,aAAA,CAAgC3oC,CAAhC,CAAAkZ,EAAwClf,CAAxCkf,WACH,CAAEwvB,CAAF,CACExxC,CAbb,KAeO,IAAImD,CAAA,CAAU3B,CAAV,CAAJ,CACLwF,CAAA0J,aAAA,CAAqB5H,CAArB,CAA2BtH,CAA3B,CADK,KAEA,IAAIwF,CAAAuJ,aAAJ,CAKL,MAFImhC,EAEG,CAFG1qC,CAAAuJ,aAAA,CAAqBzH,CAArB,CAA2B,CAA3B,CAEH,CAAQ,IAAR,GAAA4oC,CAAA,CAAe1xC,CAAf,CAA2B0xC,CAxBF,CA7C9B,MAyEA3mB,QAAQ,CAAC/jB,CAAD,CAAU8B,CAAV,CAAgBtH,CAAhB,CAAuB,CACnC,GAAI2B,CAAA,CAAU3B,CAAV,CAAJ,CACEwF,CAAA,CAAQ8B,CAAR,CAAA,CAAgBtH,CADlB,KAGE,OAAOwF,EAAA,CAAQ8B,CAAR,CAJ0B,CAzE/B;KAiFC,QAAQ,EAAG,CAYhB6oC,QAASA,EAAO,CAAC3qC,CAAD,CAAUxF,CAAV,CAAiB,CAC/B,IAAIowC,EAAWC,CAAA,CAAwB7qC,CAAA1G,SAAxB,CACf,IAAI4C,CAAA,CAAY1B,CAAZ,CAAJ,CACE,MAAOowC,EAAA,CAAW5qC,CAAA,CAAQ4qC,CAAR,CAAX,CAA+B,EAExC5qC,EAAA,CAAQ4qC,CAAR,CAAA,CAAoBpwC,CALW,CAXjC,IAAIqwC,EAA0B,EACnB,EAAX,CAAIz/B,CAAJ,EACEy/B,CAAA,CAAwB,CAAxB,CACA,CAD6B,WAC7B,CAAAA,CAAA,CAAwB,CAAxB,CAAA,CAA6B,WAF/B,EAIEA,CAAA,CAAwB,CAAxB,CAJF,CAKEA,CAAA,CAAwB,CAAxB,CALF,CAK+B,aAE/BF,EAAAG,IAAA,CAAc,EACd,OAAOH,EAVS,CAAX,EAjFD,KAsGDvrC,QAAQ,CAACY,CAAD,CAAUxF,CAAV,CAAiB,CAC5B,GAAI0B,CAAA,CAAY1B,CAAZ,CAAJ,CAAwB,CACtB,GAA2B,QAA3B,GAAIigB,EAAA,CAAUza,CAAV,CAAJ,EAAuCA,CAAA+qC,SAAvC,CAAyD,CACvD,IAAIp7B,EAAS,EACblW,EAAA,CAAQuG,CAAA0U,QAAR,CAAyB,QAAS,CAACs2B,CAAD,CAAS,CACrCA,CAAAC,SAAJ,EACEt7B,CAAAzV,KAAA,CAAY8wC,CAAAxwC,MAAZ,EAA4BwwC,CAAAppB,KAA5B,CAFuC,CAA3C,CAKA,OAAyB,EAAlB,GAAAjS,CAAAtW,OAAA,CAAsB,IAAtB,CAA6BsW,CAPmB,CASzD,MAAO3P,EAAAxF,MAVe,CAYxBwF,CAAAxF,MAAA,CAAgBA,CAbY,CAtGxB,MAsHA2F,QAAQ,CAACH,CAAD,CAAUxF,CAAV,CAAiB,CAC7B,GAAI0B,CAAA,CAAY1B,CAAZ,CAAJ,CACE,MAAOwF,EAAAwH,UAET,KAJ6B,IAIpBnN,EAAI,CAJgB,CAIbuN,EAAa5H,CAAA4H,WAA7B,CAAiDvN,CAAjD,CAAqDuN,CAAAvO,OAArD,CAAwEgB,CAAA,EAAxE,CACE4N,EAAA,CAAaL,CAAA,CAAWvN,CAAX,CAAb,CAEF2F,EAAAwH,UAAA,CAAoBhN,CAPS,CAtHzB,CAAR,CA+HG,QAAQ,CAACsE,CAAD,CAAKgD,CAAL,CAAU,CAInBsF,CAAAgH,UAAA,CAAiBtM,CAAjB,CAAA;AAAyB,QAAQ,CAACuxB,CAAD,CAAOC,CAAP,CAAa,CAAA,IACxCj5B,CADwC,CACrCT,CAIP,KAAmB,CAAd,EAACkF,CAAAzF,OAAD,EAAoByF,CAApB,GAA2BuK,EAA3B,EAA6CvK,CAA7C,GAAoDkL,EAApD,CAAyEqpB,CAAzE,CAAgFC,CAArF,IAA+Ft6B,CAA/F,CAA0G,CACxG,GAAIoD,CAAA,CAASi3B,CAAT,CAAJ,CAAoB,CAGlB,IAAIh5B,CAAJ,CAAM,CAAN,CAASA,CAAT,CAAa,IAAAhB,OAAb,CAA0BgB,CAAA,EAA1B,CACE,GAAIyE,CAAJ,GAAWmK,EAAX,CAEEnK,CAAA,CAAG,IAAA,CAAKzE,CAAL,CAAH,CAAYg5B,CAAZ,CAFF,KAIE,KAAKz5B,CAAL,GAAYy5B,EAAZ,CACEv0B,CAAA,CAAG,IAAA,CAAKzE,CAAL,CAAH,CAAYT,CAAZ,CAAiBy5B,CAAA,CAAKz5B,CAAL,CAAjB,CAKN,OAAO,KAdW,CAiBdY,CAAAA,CAAQsE,CAAAgsC,IAERjwB,EAAAA,CAAKrgB,CAAA,EAASxB,CAAT,CAAqB4mB,IAAAyiB,IAAA,CAAS,IAAAhpC,OAAT,CAAsB,CAAtB,CAArB,CAAgD,IAAAA,OACzD,KAAK,IAAIuhB,EAAI,CAAb,CAAgBA,CAAhB,CAAoBC,CAApB,CAAwBD,CAAA,EAAxB,CAA6B,CAC3B,IAAIvC,EAAYvZ,CAAA,CAAG,IAAA,CAAK8b,CAAL,CAAH,CAAYyY,CAAZ,CAAkBC,CAAlB,CAChB94B,EAAA,CAAQA,CAAA,CAAQA,CAAR,CAAgB6d,CAAhB,CAA4BA,CAFT,CAI7B,MAAO7d,EAzB+F,CA6BxG,IAAIH,CAAJ,CAAM,CAAN,CAASA,CAAT,CAAa,IAAAhB,OAAb,CAA0BgB,CAAA,EAA1B,CACEyE,CAAA,CAAG,IAAA,CAAKzE,CAAL,CAAH,CAAYg5B,CAAZ,CAAkBC,CAAlB,CAGF,OAAO,KAtCmC,CAJ3B,CA/HrB,CAwOA75B,EAAA,CAAQ,YACMyO,EADN,QAGED,EAHF,IAKFijC,QAASA,EAAI,CAAClrC,CAAD,CAAUoI,CAAV,CAAgBtJ,CAAhB,CAAoBuJ,CAApB,CAAgC,CAC/C,GAAIlM,CAAA,CAAUkM,CAAV,CAAJ,CAA4B,KAAMhB,GAAA,CAAa,QAAb,CAAN,CADmB,IAG3CiB,EAASC,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CAHkC,CAI3CwI,EAASD,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CAERsI,EAAL,EAAaC,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CAAsCsI,CAAtC,CAA+C,EAA/C,CACRE,EAAL,EAAaD,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CAAsCwI,CAAtC,CAA+C8B,EAAA,CAAmBtK,CAAnB,CAA4BsI,CAA5B,CAA/C,CAEb7O;CAAA,CAAQ2O,CAAArH,MAAA,CAAW,GAAX,CAAR,CAAyB,QAAQ,CAACqH,CAAD,CAAM,CACrC,IAAI+iC,EAAW7iC,CAAA,CAAOF,CAAP,CAEf,IAAI,CAAC+iC,CAAL,CAAe,CACb,GAAY,YAAZ,EAAI/iC,CAAJ,EAAoC,YAApC,EAA4BA,CAA5B,CAAkD,CAChD,IAAIgjC,EAAWryC,CAAA2xB,KAAA0gB,SAAA,EAA0BryC,CAAA2xB,KAAA2gB,wBAA1B,CACf,QAAQ,CAAE9pB,CAAF,CAAKC,CAAL,CAAS,CAAA,IACX8pB,EAAuB,CAAf,GAAA/pB,CAAAjoB,SAAA,CAAmBioB,CAAAgqB,gBAAnB,CAAuChqB,CADpC,CAEfiqB,EAAMhqB,CAANgqB,EAAWhqB,CAAAkB,WACX,OAAOnB,EAAP,GAAaiqB,CAAb,EAAoB,CAAC,EAAGA,CAAH,EAA2B,CAA3B,GAAUA,CAAAlyC,SAAV,GACnBgyC,CAAAF,SAAA,CACAE,CAAAF,SAAA,CAAgBI,CAAhB,CADA,CAEAjqB,CAAA8pB,wBAFA,EAE6B9pB,CAAA8pB,wBAAA,CAA2BG,CAA3B,CAF7B,CAEgE,EAH7C,EAHN,CADF,CAUb,QAAQ,CAAEjqB,CAAF,CAAKC,CAAL,CAAS,CACf,GAAKA,CAAL,CACE,IAAA,CAASA,CAAT,CAAaA,CAAAkB,WAAb,CAAA,CACE,GAAKlB,CAAL,GAAWD,CAAX,CACE,MAAO,CAAA,CAIb,OAAO,CAAA,CARQ,CAWnBjZ,EAAA,CAAOF,CAAP,CAAA,CAAe,EAOf8iC,EAAA,CAAKlrC,CAAL,CAFeyrC,YAAe,UAAfA,YAAwC,WAAxCA,CAED,CAASrjC,CAAT,CAAd,CAA8B,QAAQ,CAACmC,CAAD,CAAQ,CAC5C,IAAmBmhC,EAAUnhC,CAAAohC,cAGvBD,EAAN,GAAkBA,CAAlB;AAHa5gC,IAGb,EAAyCsgC,CAAA,CAH5BtgC,IAG4B,CAAiB4gC,CAAjB,CAAzC,GACEljC,CAAA,CAAO+B,CAAP,CAAcnC,CAAd,CAL0C,CAA9C,CA7BgD,CAAlD,IAuCEyhC,GAAA,CAAmB7pC,CAAnB,CAA4BoI,CAA5B,CAAkCI,CAAlC,CACA,CAAAF,CAAA,CAAOF,CAAP,CAAA,CAAe,EAEjB+iC,EAAA,CAAW7iC,CAAA,CAAOF,CAAP,CA3CE,CA6Cf+iC,CAAAjxC,KAAA,CAAc4E,CAAd,CAhDqC,CAAvC,CAT+C,CAL3C,KAkEDqJ,EAlEC,aAoEOiX,QAAQ,CAACpf,CAAD,CAAU4rC,CAAV,CAAuB,CAAA,IACtClxC,CADsC,CAC/BkB,EAASoE,CAAA0iB,WACpBza,GAAA,CAAajI,CAAb,CACAvG,EAAA,CAAQ,IAAI2N,CAAJ,CAAWwkC,CAAX,CAAR,CAAiC,QAAQ,CAAC9uC,CAAD,CAAM,CACzCpC,CAAJ,CACEkB,CAAAiwC,aAAA,CAAoB/uC,CAApB,CAA0BpC,CAAAohB,YAA1B,CADF,CAGElgB,CAAAgnB,aAAA,CAAoB9lB,CAApB,CAA0BkD,CAA1B,CAEFtF,EAAA,CAAQoC,CANqC,CAA/C,CAH0C,CApEtC,UAiFI+J,QAAQ,CAAC7G,CAAD,CAAU,CAC1B,IAAI6G,EAAW,EACfpN,EAAA,CAAQuG,CAAA4H,WAAR,CAA4B,QAAQ,CAAC5H,CAAD,CAAS,CAClB,CAAzB,GAAIA,CAAA1G,SAAJ,EACEuN,CAAA3M,KAAA,CAAc8F,CAAd,CAFyC,CAA7C,CAIA,OAAO6G,EANmB,CAjFtB,UA0FIyY,QAAQ,CAACtf,CAAD,CAAU,CAC1B,MAAOA,EAAA4H,WAAP,EAA6B,EADH,CA1FtB,QA8FEtH,QAAQ,CAACN,CAAD,CAAUlD,CAAV,CAAgB,CAC9BrD,CAAA,CAAQ,IAAI2N,CAAJ,CAAWtK,CAAX,CAAR,CAA0B,QAAQ,CAAC67B,CAAD,CAAO,CACd,CAAzB,GAAI34B,CAAA1G,SAAJ,EAAmD,EAAnD,GAA8B0G,CAAA1G,SAA9B,EACE0G,CAAA6iB,YAAA,CAAoB8V,CAApB,CAFqC,CAAzC,CAD8B,CA9F1B,SAsGGmT,QAAQ,CAAC9rC,CAAD,CAAUlD,CAAV,CAAgB,CAC/B,GAAyB,CAAzB,GAAIkD,CAAA1G,SAAJ,CAA4B,CAC1B,IAAIoB,EAAQsF,CAAA0H,WACZjO;CAAA,CAAQ,IAAI2N,CAAJ,CAAWtK,CAAX,CAAR,CAA0B,QAAQ,CAAC67B,CAAD,CAAO,CACvC34B,CAAA6rC,aAAA,CAAqBlT,CAArB,CAA4Bj+B,CAA5B,CADuC,CAAzC,CAF0B,CADG,CAtG3B,MA+GA4d,QAAQ,CAACtY,CAAD,CAAU+rC,CAAV,CAAoB,CAChCA,CAAA,CAAW9rC,CAAA,CAAO8rC,CAAP,CAAA,CAAiB,CAAjB,CACX,KAAInwC,EAASoE,CAAA0iB,WACT9mB,EAAJ,EACEA,CAAAgnB,aAAA,CAAoBmpB,CAApB,CAA8B/rC,CAA9B,CAEF+rC,EAAAlpB,YAAA,CAAqB7iB,CAArB,CANgC,CA/G5B,QAwHE4V,QAAQ,CAAC5V,CAAD,CAAU,CACxBiI,EAAA,CAAajI,CAAb,CACA,KAAIpE,EAASoE,CAAA0iB,WACT9mB,EAAJ,EAAYA,CAAA6L,YAAA,CAAmBzH,CAAnB,CAHY,CAxHpB,OA8HCgsC,QAAQ,CAAChsC,CAAD,CAAUisC,CAAV,CAAsB,CAAA,IAC/BvxC,EAAQsF,CADuB,CACdpE,EAASoE,CAAA0iB,WAC9BjpB,EAAA,CAAQ,IAAI2N,CAAJ,CAAW6kC,CAAX,CAAR,CAAgC,QAAQ,CAACnvC,CAAD,CAAM,CAC5ClB,CAAAiwC,aAAA,CAAoB/uC,CAApB,CAA0BpC,CAAAohB,YAA1B,CACAphB,EAAA,CAAQoC,CAFoC,CAA9C,CAFmC,CA9H/B,UAsII+M,EAtIJ,aAuIOL,EAvIP,aAyIO0iC,QAAQ,CAAClsC,CAAD,CAAUsJ,CAAV,CAAoB6iC,CAApB,CAA+B,CAC9CjwC,CAAA,CAAYiwC,CAAZ,CAAJ,GACEA,CADF,CACc,CAAC9iC,EAAA,CAAerJ,CAAf,CAAwBsJ,CAAxB,CADf,CAGC,EAAA6iC,CAAA,CAAYtiC,EAAZ,CAA6BL,EAA7B,EAAgDxJ,CAAhD,CAAyDsJ,CAAzD,CAJiD,CAzI9C,QAgJE1N,QAAQ,CAACoE,CAAD,CAAU,CAExB,MAAO,CADHpE,CACG,CADMoE,CAAA0iB,WACN,GAA8B,EAA9B,GAAU9mB,CAAAtC,SAAV,CAAmCsC,CAAnC,CAA4C,IAF3B,CAhJpB,MAqJAg/B,QAAQ,CAAC56B,CAAD,CAAU,CACtB,GAAIA,CAAAosC,mBAAJ,CACE,MAAOpsC,EAAAosC,mBAKT;IADIt8B,CACJ,CADU9P,CAAA8b,YACV,CAAc,IAAd,EAAOhM,CAAP,EAAuC,CAAvC,GAAsBA,CAAAxW,SAAtB,CAAA,CACEwW,CAAA,CAAMA,CAAAgM,YAER,OAAOhM,EAVe,CArJlB,MAkKA7S,QAAQ,CAAC+C,CAAD,CAAUsJ,CAAV,CAAoB,CAChC,MAAOtJ,EAAAqsC,qBAAA,CAA6B/iC,CAA7B,CADyB,CAlK5B,OAsKCvB,EAtKD,gBAwKUhB,QAAQ,CAAC/G,CAAD,CAAUssC,CAAV,CAAqBC,CAArB,CAAgC,CAClDpB,CAAAA,CAAW,CAAC5iC,EAAA,CAAmBvI,CAAnB,CAA4B,QAA5B,CAAD,EAA0C,EAA1C,EAA8CssC,CAA9C,CAEfC,EAAA,CAAYA,CAAZ,EAAyB,EAEzB,KAAIhiC,EAAQ,CAAC,gBACKzO,CADL,iBAEMA,CAFN,CAAD,CAKZrC,EAAA,CAAQ0xC,CAAR,CAAkB,QAAQ,CAACrsC,CAAD,CAAK,CAC7BA,CAAAtC,MAAA,CAASwD,CAAT,CAAkBuK,CAAArL,OAAA,CAAaqtC,CAAb,CAAlB,CAD6B,CAA/B,CAVsD,CAxKlD,CAAR,CAsLG,QAAQ,CAACztC,CAAD,CAAKgD,CAAL,CAAU,CAInBsF,CAAAgH,UAAA,CAAiBtM,CAAjB,CAAA,CAAyB,QAAQ,CAACuxB,CAAD,CAAOC,CAAP,CAAakZ,CAAb,CAAmB,CAElD,IADA,IAAIhyC,CAAJ,CACQH,EAAE,CAAV,CAAaA,CAAb,CAAiB,IAAAhB,OAAjB,CAA8BgB,CAAA,EAA9B,CACMG,CAAJ,EAAaxB,CAAb,EACEwB,CACA,CADQsE,CAAA,CAAG,IAAA,CAAKzE,CAAL,CAAH,CAAYg5B,CAAZ,CAAkBC,CAAlB,CAAwBkZ,CAAxB,CACR,CAAIhyC,CAAJ,GAAcxB,CAAd,GAEEwB,CAFF,CAEUyF,CAAA,CAAOzF,CAAP,CAFV,CAFF,EAOEmN,EAAA,CAAenN,CAAf,CAAsBsE,CAAA,CAAG,IAAA,CAAKzE,CAAL,CAAH,CAAYg5B,CAAZ,CAAkBC,CAAlB,CAAwBkZ,CAAxB,CAAtB,CAGJ,OAAOhyC,EAAA,EAASxB,CAAT,CAAqB,IAArB,CAA4BwB,CAbe,CAiBpD4M,EAAAgH,UAAAxP,KAAA,CAAwBwI,CAAAgH,UAAApR,GACxBoK,EAAAgH,UAAAq+B,OAAA,CAA0BrlC,CAAAgH,UAAAs+B,IAtBP,CAtLrB,CAmPAlhC;EAAA4C,UAAA,CAAoB,KAMb3C,QAAQ,CAAC7R,CAAD,CAAMY,CAAN,CAAa,CACxB,IAAA,CAAK8Q,EAAA,CAAQ1R,CAAR,CAAL,CAAA,CAAqBY,CADG,CANR,KAcbyS,QAAQ,CAACrT,CAAD,CAAM,CACjB,MAAO,KAAA,CAAK0R,EAAA,CAAQ1R,CAAR,CAAL,CADU,CAdD,QAsBVgc,QAAQ,CAAChc,CAAD,CAAM,CACpB,IAAIY,EAAQ,IAAA,CAAKZ,CAAL,CAAW0R,EAAA,CAAQ1R,CAAR,CAAX,CACZ,QAAO,IAAA,CAAKA,CAAL,CACP,OAAOY,EAHa,CAtBJ,CAmEpB,KAAIuR,GAAU,oCAAd,CACIC,GAAe,GADnB,CAEIC,GAAS,sBAFb,CAGIJ,GAAiB,kCAHrB,CAIIhH,GAAkB5L,CAAA,CAAO,WAAP,CAJtB,CAq0BI0zC,GAAiB1zC,CAAA,CAAO,UAAP,CAr0BrB,CAm1BI2zC,GAAmB,CAAC,UAAD,CAAa,QAAQ,CAACnqC,CAAD,CAAW,CAErD,IAAAoqC,YAAA,CAAmB,EAgCnB,KAAApoB,SAAA,CAAgBC,QAAQ,CAAC5iB,CAAD,CAAO8C,CAAP,CAAgB,CACtC,IAAIhL,EAAMkI,CAANlI,CAAa,YACjB,IAAIkI,CAAJ,EAA8B,GAA9B,EAAYA,CAAAnD,OAAA,CAAY,CAAZ,CAAZ,CAAmC,KAAMguC,GAAA,CAAe,SAAf,CACoB7qC,CADpB,CAAN,CAEnC,IAAA+qC,YAAA,CAAiB/qC,CAAA1D,OAAA,CAAY,CAAZ,CAAjB,CAAA,CAAmCxE,CACnC6I,EAAAmC,QAAA,CAAiBhL,CAAjB,CAAsBgL,CAAtB,CALsC,CAQxC,KAAA+H,KAAA,CAAY,CAAC,UAAD;AAAa,QAAQ,CAACmgC,CAAD,CAAW,CAiB1C,MAAO,OAiBGC,QAAQ,CAAC/sC,CAAD,CAAUpE,CAAV,CAAkBowC,CAAlB,CAAyBnjB,CAAzB,CAA+B,CACzCmkB,CAAAA,CAAYhB,CAAZgB,EAAqBhB,CAAA,CAAMA,CAAA3yC,OAAN,CAAqB,CAArB,CACzB,KAAIqpB,EAAa9mB,CAAb8mB,EAAuB9mB,CAAA,CAAO,CAAP,CAAvB8mB,EAAoCsqB,CAApCtqB,EAAiDsqB,CAAAtqB,WAArD,CAEIuqB,EAAoBD,CAApBC,EAAiCD,CAAAlxB,YAAjCmxB,EAA2D,IAC/DxzC,EAAA,CAAQuG,CAAR,CAAiB,QAAQ,CAAClD,CAAD,CAAO,CAC9B4lB,CAAAmpB,aAAA,CAAwB/uC,CAAxB,CAA8BmwC,CAA9B,CAD8B,CAAhC,CAGApkB,EAAA,EAAQikB,CAAA,CAASjkB,CAAT,CAAe,CAAf,CAAkB,CAAA,CAAlB,CARqC,CAjB1C,OAwCGqkB,QAAQ,CAACltC,CAAD,CAAU6oB,CAAV,CAAgB,CAC9B7oB,CAAA4V,OAAA,EACAiT,EAAA,EAAQikB,CAAA,CAASjkB,CAAT,CAAe,CAAf,CAAkB,CAAA,CAAlB,CAFsB,CAxC3B,MA4DEskB,QAAQ,CAACntC,CAAD,CAAUpE,CAAV,CAAkBowC,CAAlB,CAAyBnjB,CAAzB,CAA+B,CAG5C,IAAAkkB,MAAA,CAAW/sC,CAAX,CAAoBpE,CAApB,CAA4BowC,CAA5B,CAAmCnjB,CAAnC,CAH4C,CA5DzC,UA+EM7P,QAAQ,CAAChZ,CAAD,CAAUkC,CAAV,CAAqB2mB,CAArB,CAA2B,CAC5C3mB,CAAA,CAAY3I,CAAA,CAAS2I,CAAT,CAAA,CACEA,CADF,CAEE1I,CAAA,CAAQ0I,CAAR,CAAA,CAAqBA,CAAApH,KAAA,CAAe,GAAf,CAArB,CAA2C,EACzDrB,EAAA,CAAQuG,CAAR,CAAiB,QAAS,CAACA,CAAD,CAAU,CAClC6J,EAAA,CAAe7J,CAAf,CAAwBkC,CAAxB,CADkC,CAApC,CAGA2mB,EAAA,EAAQikB,CAAA,CAASjkB,CAAT,CAAe,CAAf,CAAkB,CAAA,CAAlB,CAPoC,CA/EzC,aAsGSzF,QAAQ,CAACpjB,CAAD,CAAUkC,CAAV,CAAqB2mB,CAArB,CAA2B,CAC/C3mB,CAAA,CAAY3I,CAAA,CAAS2I,CAAT,CAAA,CACEA,CADF,CAEE1I,CAAA,CAAQ0I,CAAR,CAAA,CAAqBA,CAAApH,KAAA,CAAe,GAAf,CAArB,CAA2C,EACzDrB,EAAA,CAAQuG,CAAR,CAAiB,QAAS,CAACA,CAAD,CAAU,CAClCwJ,EAAA,CAAkBxJ,CAAlB,CAA2BkC,CAA3B,CADkC,CAApC,CAGA2mB,EAAA,EAAQikB,CAAA,CAASjkB,CAAT,CAAe,CAAf,CAAkB,CAAA,CAAlB,CAPuC,CAtG5C,SAgHK/sB,CAhHL,CAjBmC,CAAhC,CA1CyC,CAAhC,CAn1BvB,CA+vDI+f,GAAiB5iB,CAAA,CAAO,UAAP,CASrBmd,GAAAzK,QAAA,CAA2B,CAAC,UAAD,CAwwC3B;IAAI2Y,GAAgB,0BAApB,CA+sCI4F,GAAMpxB,CAAAs0C,eAANljB,EAA+B,QAAQ,EAAG,CAC5C,GAAI,CAAE,MAAO,KAAImjB,aAAJ,CAAkB,oBAAlB,CAAT,CAAoD,MAAOC,CAAP,CAAW,EACnE,GAAI,CAAE,MAAO,KAAID,aAAJ,CAAkB,oBAAlB,CAAT,CAAoD,MAAOE,CAAP,CAAW,EACnE,GAAI,CAAE,MAAO,KAAIF,aAAJ,CAAkB,gBAAlB,CAAT,CAAgD,MAAOG,CAAP,CAAW,EAC/D,KAAMv0C,EAAA,CAAO,cAAP,CAAA,CAAuB,OAAvB,CAAN,CAJ4C,CA/sC9C,CAk2CIuzB,GAAqBvzB,CAAA,CAAO,cAAP,CAl2CzB,CAgvDIw0C,GAAa,iCAhvDjB,CAivDI/e,GAAgB,MAAS,EAAT,OAAsB,GAAtB,KAAkC,EAAlC,CAjvDpB,CAkvDIuB,GAAkBh3B,CAAA,CAAO,WAAP,CA+NtB63B,GAAA1iB,UAAA,CACEsiB,EAAAtiB,UADF,CAEEqhB,EAAArhB,UAFF,CAE+B,SAMpB,CAAA,CANoB,WAYlB,CAAA,CAZkB,QA2BrB2iB,EAAA,CAAe,UAAf,CA3BqB,KA6CxBzf,QAAQ,CAACA,CAAD,CAAM7Q,CAAN,CAAe,CAC1B,GAAIvE,CAAA,CAAYoV,CAAZ,CAAJ,CACE,MAAO,KAAA8e,MAET;IAAI5vB,EAAQitC,EAAAxrC,KAAA,CAAgBqP,CAAhB,CACR9Q,EAAA,CAAM,CAAN,CAAJ,EAAc,IAAA8D,KAAA,CAAU3D,kBAAA,CAAmBH,CAAA,CAAM,CAAN,CAAnB,CAAV,CACd,EAAIA,CAAA,CAAM,CAAN,CAAJ,EAAgBA,CAAA,CAAM,CAAN,CAAhB,GAA0B,IAAAyuB,OAAA,CAAYzuB,CAAA,CAAM,CAAN,CAAZ,EAAwB,EAAxB,CAC1B,KAAAqP,KAAA,CAAUrP,CAAA,CAAM,CAAN,CAAV,EAAsB,EAAtB,CAA0BC,CAA1B,CAEA,OAAO,KATmB,CA7CC,UAqEnBswB,EAAA,CAAe,YAAf,CArEmB,MAmFvBA,EAAA,CAAe,QAAf,CAnFuB,MAiGvBA,EAAA,CAAe,QAAf,CAjGuB,MAqHvBE,EAAA,CAAqB,QAArB,CAA+B,QAAQ,CAAC3sB,CAAD,CAAO,CAClD,MAAyB,GAAlB,EAAAA,CAAA3F,OAAA,CAAY,CAAZ,CAAA,CAAwB2F,CAAxB,CAA+B,GAA/B,CAAqCA,CADM,CAA9C,CArHuB,QA4IrB2qB,QAAQ,CAACA,CAAD,CAASye,CAAT,CAAqB,CACnC,OAAQnyC,SAAAlC,OAAR,EACE,KAAK,CAAL,CACE,MAAO,KAAA21B,SACT,MAAK,CAAL,CACE,GAAIz1B,CAAA,CAAS01B,CAAT,CAAJ,CACE,IAAAD,SAAA,CAAgBpuB,EAAA,CAAcquB,CAAd,CADlB,KAEO,IAAI7yB,CAAA,CAAS6yB,CAAT,CAAJ,CACL,IAAAD,SAAA,CAAgBC,CADX,KAGL,MAAMgB,GAAA,CAAgB,UAAhB,CAAN,CAEF,KACF,SACMyd,CAAJ,EAAkB10C,CAAlB,EAA6C,IAA7C,EAA+B00C,CAA/B,CACE,OAAO,IAAA1e,SAAA,CAAcC,CAAd,CADT,CAGE,IAAAD,SAAA,CAAcC,CAAd,CAHF,CAG0Bye,CAhB9B,CAoBA,IAAAxd,UAAA,EACA;MAAO,KAtB4B,CA5IR,MAoLvBe,EAAA,CAAqB,QAArB,CAA+Bl1B,EAA/B,CApLuB,SA+LpB0E,QAAQ,EAAG,CAClB,IAAA+xB,UAAA,CAAiB,CAAA,CACjB,OAAO,KAFW,CA/LS,CAuiB/B,KAAIiB,GAAex6B,CAAA,CAAO,QAAP,CAAnB,CACIw8B,GAAsB,EAD1B,CAEIzB,EAFJ,CAyDI2Z,GAAY,CACZ,MADY,CACLC,QAAQ,EAAE,CAAC,MAAO,KAAR,CADL,CAEZ,MAFY,CAELC,QAAQ,EAAE,CAAC,MAAO,CAAA,CAAR,CAFL,CAGZ,OAHY,CAGJC,QAAQ,EAAE,CAAC,MAAO,CAAA,CAAR,CAHN,WAIFhyC,CAJE,CAKZ,GALY,CAKRiyC,QAAQ,CAAClvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAC7BD,CAAA,CAAEA,CAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAiByT,EAAA,CAAEA,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CACrB,OAAI5R,EAAA,CAAUolB,CAAV,CAAJ,CACMplB,CAAA,CAAUqlB,CAAV,CAAJ,CACSD,CADT,CACaC,CADb,CAGOD,CAJT,CAMOplB,CAAA,CAAUqlB,CAAV,CAAA,CAAaA,CAAb,CAAexoB,CARO,CALnB,CAcZ,GAdY,CAcRg1C,QAAQ,CAACnvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAACD,CAAA,CAAEA,CAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAiByT,EAAA,CAAEA,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAiB,QAAQ5R,CAAA,CAAUolB,CAAV,CAAA,CAAaA,CAAb,CAAe,CAAvB,GAA2BplB,CAAA,CAAUqlB,CAAV,CAAA,CAAaA,CAAb,CAAe,CAA1C,CAAvC,CAdnB,CAeZ,GAfY,CAeRysB,QAAQ,CAACpvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAfnB,CAgBZ,GAhBY,CAgBRmgC,QAAQ,CAACrvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAhBnB,CAiBZ,GAjBY,CAiBRogC,QAAQ,CAACtvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAjBnB,CAkBZ,GAlBY,CAkBRqgC,QAAQ,CAACvvC,CAAD;AAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAlBnB,CAmBZ,GAnBY,CAmBRjS,CAnBQ,CAoBZ,KApBY,CAoBNuyC,QAAQ,CAACxvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAkBC,CAAlB,CAAoB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,GAAyByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAA1B,CApBtB,CAqBZ,KArBY,CAqBNugC,QAAQ,CAACzvC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAkBC,CAAlB,CAAoB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,GAAyByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAA1B,CArBtB,CAsBZ,IAtBY,CAsBPwgC,QAAQ,CAAC1vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CAtBpB,CAuBZ,IAvBY,CAuBPygC,QAAQ,CAAC3vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CAvBpB,CAwBZ,GAxBY,CAwBR0gC,QAAQ,CAAC5vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAxBnB,CAyBZ,GAzBY,CAyBR2gC,QAAQ,CAAC7vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CAzBnB,CA0BZ,IA1BY,CA0BP4gC,QAAQ,CAAC9vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CA1BpB,CA2BZ,IA3BY,CA2BP6gC,QAAQ,CAAC/vC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CA3BpB,CA4BZ,IA5BY,CA4BP8gC,QAAQ,CAAChwC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CA5BpB,CA6BZ,IA7BY,CA6BP+gC,QAAQ,CAACjwC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,EAAwByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAzB,CA7BpB,CA8BZ,GA9BY,CA8BRghC,QAAQ,CAAClwC,CAAD;AAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOD,EAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAP,CAAuByT,CAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAxB,CA9BnB,CAgCZ,GAhCY,CAgCRihC,QAAQ,CAACnwC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiBC,CAAjB,CAAmB,CAAC,MAAOA,EAAA,CAAE3iB,CAAF,CAAQkP,CAAR,CAAA,CAAgBlP,CAAhB,CAAsBkP,CAAtB,CAA8BwT,CAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAA9B,CAAR,CAhCnB,CAiCZ,GAjCY,CAiCRkhC,QAAQ,CAACpwC,CAAD,CAAOkP,CAAP,CAAewT,CAAf,CAAiB,CAAC,MAAO,CAACA,CAAA,CAAE1iB,CAAF,CAAQkP,CAAR,CAAT,CAjCjB,CAzDhB,CA4FImhC,GAAS,GAAK,IAAL,GAAe,IAAf,GAAyB,IAAzB,GAAmC,IAAnC,GAA6C,IAA7C,CAAmD,GAAnD,CAAuD,GAAvD,CAA4D,GAA5D,CAAgE,GAAhE,CA5Fb,CAqGItZ,GAAQA,QAAS,CAAClhB,CAAD,CAAU,CAC7B,IAAAA,QAAA,CAAeA,CADc,CAI/BkhB,GAAAxnB,UAAA,CAAkB,aACHwnB,EADG,KAGXuZ,QAAS,CAACvtB,CAAD,CAAO,CACnB,IAAAA,KAAA,CAAYA,CAEZ,KAAAlnB,MAAA,CAAa,CACb,KAAA00C,GAAA,CAAUp2C,CACV,KAAAq2C,OAAA,CAAc,GAEd,KAAAC,OAAA,CAAc,EAEd,KAAI1rB,CAGJ,KAFIlkB,CAEJ,CAFW,EAEX,CAAO,IAAAhF,MAAP,CAAoB,IAAAknB,KAAAvoB,OAApB,CAAA,CAAsC,CACpC,IAAA+1C,GAAA,CAAU,IAAAxtB,KAAAjjB,OAAA,CAAiB,IAAAjE,MAAjB,CACV,IAAI,IAAA60C,GAAA,CAAQ,KAAR,CAAJ,CACE,IAAAC,WAAA,CAAgB,IAAAJ,GAAhB,CADF,KAEO,IAAI,IAAA/yC,SAAA,CAAc,IAAA+yC,GAAd,CAAJ,EAA8B,IAAAG,GAAA,CAAQ,GAAR,CAA9B,EAA8C,IAAAlzC,SAAA,CAAc,IAAAozC,KAAA,EAAd,CAA9C,CACL,IAAAC,WAAA,EADK;IAEA,IAAI,IAAAC,QAAA,CAAa,IAAAP,GAAb,CAAJ,CACL,IAAAQ,UAAA,EAEA,CAAI,IAAAC,IAAA,CAAS,IAAT,CAAJ,GAAkC,GAAlC,GAAsBnwC,CAAA,CAAK,CAAL,CAAtB,GACKkkB,CADL,CACa,IAAA0rB,OAAA,CAAY,IAAAA,OAAAj2C,OAAZ,CAAiC,CAAjC,CADb,KAEEuqB,CAAAlkB,KAFF,CAE4C,EAF5C,GAEekkB,CAAAhC,KAAAvkB,QAAA,CAAmB,GAAnB,CAFf,CAHK,KAOA,IAAI,IAAAkyC,GAAA,CAAQ,aAAR,CAAJ,CACL,IAAAD,OAAAp1C,KAAA,CAAiB,OACR,IAAAQ,MADQ,MAET,IAAA00C,GAFS,MAGR,IAAAS,IAAA,CAAS,KAAT,CAHQ,EAGW,IAAAN,GAAA,CAAQ,IAAR,CAHX,EAG6B,IAAAA,GAAA,CAAQ,MAAR,CAH7B,CAAjB,CAOA,CAFI,IAAAA,GAAA,CAAQ,IAAR,CAEJ,EAFmB7vC,CAAAzE,QAAA,CAAa,IAAAm0C,GAAb,CAEnB,CADI,IAAAG,GAAA,CAAQ,IAAR,CACJ,EADmB7vC,CAAAoH,MAAA,EACnB,CAAA,IAAApM,MAAA,EARK,KASA,IAAI,IAAAo1C,aAAA,CAAkB,IAAAV,GAAlB,CAAJ,CAAgC,CACrC,IAAA10C,MAAA,EACA,SAFqC,CAAhC,IAGA,CACL,IAAIq1C,EAAM,IAAAX,GAANW,CAAgB,IAAAN,KAAA,EAApB,CACIO,EAAMD,CAANC,CAAY,IAAAP,KAAA,CAAU,CAAV,CADhB,CAEI3wC,EAAK6uC,EAAA,CAAU,IAAAyB,GAAV,CAFT,CAGIa,EAAMtC,EAAA,CAAUoC,CAAV,CAHV,CAIIG,EAAMvC,EAAA,CAAUqC,CAAV,CACNE,EAAJ,EACE,IAAAZ,OAAAp1C,KAAA,CAAiB,OAAQ,IAAAQ,MAAR;KAA0Bs1C,CAA1B,IAAmCE,CAAnC,CAAjB,CACA,CAAA,IAAAx1C,MAAA,EAAc,CAFhB,EAGWu1C,CAAJ,EACL,IAAAX,OAAAp1C,KAAA,CAAiB,OAAQ,IAAAQ,MAAR,MAA0Bq1C,CAA1B,IAAmCE,CAAnC,CAAjB,CACA,CAAA,IAAAv1C,MAAA,EAAc,CAFT,EAGIoE,CAAJ,EACL,IAAAwwC,OAAAp1C,KAAA,CAAiB,OACR,IAAAQ,MADQ,MAET,IAAA00C,GAFS,IAGXtwC,CAHW,MAIR,IAAA+wC,IAAA,CAAS,KAAT,CAJQ,EAIW,IAAAN,GAAA,CAAQ,IAAR,CAJX,CAAjB,CAMA,CAAA,IAAA70C,MAAA,EAAc,CAPT,EASL,IAAAy1C,WAAA,CAAgB,4BAAhB,CAA8C,IAAAz1C,MAA9C,CAA0D,IAAAA,MAA1D,CAAuE,CAAvE,CArBG,CAwBP,IAAA20C,OAAA,CAAc,IAAAD,GAjDsB,CAmDtC,MAAO,KAAAE,OA/DY,CAHL,IAqEZC,QAAQ,CAACa,CAAD,CAAQ,CAClB,MAAmC,EAAnC,GAAOA,CAAA/yC,QAAA,CAAc,IAAA+xC,GAAd,CADW,CArEJ,KAyEXS,QAAQ,CAACO,CAAD,CAAQ,CACnB,MAAuC,EAAvC,GAAOA,CAAA/yC,QAAA,CAAc,IAAAgyC,OAAd,CADY,CAzEL,MA6EVI,QAAQ,CAACp1C,CAAD,CAAI,CACZyzB,CAAAA,CAAMzzB,CAANyzB,EAAW,CACf,OAAQ,KAAApzB,MAAD,CAAcozB,CAAd,CAAoB,IAAAlM,KAAAvoB,OAApB,CAAwC,IAAAuoB,KAAAjjB,OAAA,CAAiB,IAAAjE,MAAjB;AAA8BozB,CAA9B,CAAxC,CAA6E,CAAA,CAFpE,CA7EF,UAkFNzxB,QAAQ,CAAC+yC,CAAD,CAAK,CACrB,MAAQ,GAAR,EAAeA,CAAf,EAA2B,GAA3B,EAAqBA,CADA,CAlFP,cAsFFU,QAAQ,CAACV,CAAD,CAAK,CACzB,MAAe,GAAf,GAAQA,CAAR,EAA6B,IAA7B,GAAsBA,CAAtB,EAA4C,IAA5C,GAAqCA,CAArC,EACe,IADf,GACQA,CADR,EAC8B,IAD9B,GACuBA,CADvB,EAC6C,QAD7C,GACsCA,CAFb,CAtFX,SA2FPO,QAAQ,CAACP,CAAD,CAAK,CACpB,MAAQ,GAAR,EAAeA,CAAf,EAA2B,GAA3B,EAAqBA,CAArB,EACQ,GADR,EACeA,CADf,EAC2B,GAD3B,EACqBA,CADrB,EAEQ,GAFR,GAEgBA,CAFhB,EAE6B,GAF7B,GAEsBA,CAHF,CA3FN,eAiGDiB,QAAQ,CAACjB,CAAD,CAAK,CAC1B,MAAe,GAAf,GAAQA,CAAR,EAA6B,GAA7B,GAAsBA,CAAtB,EAAoC,IAAA/yC,SAAA,CAAc+yC,CAAd,CADV,CAjGZ,YAqGJe,QAAQ,CAACx/B,CAAD,CAAQ2/B,CAAR,CAAeC,CAAf,CAAoB,CACtCA,CAAA,CAAMA,CAAN,EAAa,IAAA71C,MACT81C,EAAAA,CAAUr0C,CAAA,CAAUm0C,CAAV,CACA,CAAJ,IAAI,CAAGA,CAAH,CAAY,GAAZ,CAAkB,IAAA51C,MAAlB,CAA+B,IAA/B,CAAsC,IAAAknB,KAAAhO,UAAA,CAAoB08B,CAApB,CAA2BC,CAA3B,CAAtC,CAAwE,GAAxE,CACJ,GADI,CACEA,CAChB,MAAM9c,GAAA,CAAa,QAAb,CACF9iB,CADE,CACK6/B,CADL,CACa,IAAA5uB,KADb,CAAN,CALsC,CArGxB,YA8GJ8tB,QAAQ,EAAG,CAGrB,IAFA,IAAIlO,EAAS,EAAb,CACI8O,EAAQ,IAAA51C,MACZ,CAAO,IAAAA,MAAP,CAAoB,IAAAknB,KAAAvoB,OAApB,CAAA,CAAsC,CACpC,IAAI+1C;AAAKtvC,CAAA,CAAU,IAAA8hB,KAAAjjB,OAAA,CAAiB,IAAAjE,MAAjB,CAAV,CACT,IAAU,GAAV,EAAI00C,CAAJ,EAAiB,IAAA/yC,SAAA,CAAc+yC,CAAd,CAAjB,CACE5N,CAAA,EAAU4N,CADZ,KAEO,CACL,IAAIqB,EAAS,IAAAhB,KAAA,EACb,IAAU,GAAV,EAAIL,CAAJ,EAAiB,IAAAiB,cAAA,CAAmBI,CAAnB,CAAjB,CACEjP,CAAA,EAAU4N,CADZ,KAEO,IAAI,IAAAiB,cAAA,CAAmBjB,CAAnB,CAAJ,EACHqB,CADG,EACO,IAAAp0C,SAAA,CAAco0C,CAAd,CADP,EAEiC,GAFjC,EAEHjP,CAAA7iC,OAAA,CAAc6iC,CAAAnoC,OAAd,CAA8B,CAA9B,CAFG,CAGLmoC,CAAA,EAAU4N,CAHL,KAIA,IAAI,CAAA,IAAAiB,cAAA,CAAmBjB,CAAnB,CAAJ,EACDqB,CADC,EACU,IAAAp0C,SAAA,CAAco0C,CAAd,CADV,EAEiC,GAFjC,EAEHjP,CAAA7iC,OAAA,CAAc6iC,CAAAnoC,OAAd,CAA8B,CAA9B,CAFG,CAKL,KALK,KAGL,KAAA82C,WAAA,CAAgB,kBAAhB,CAXG,CAgBP,IAAAz1C,MAAA,EApBoC,CAsBtC8mC,CAAA,EAAS,CACT,KAAA8N,OAAAp1C,KAAA,CAAiB,OACRo2C,CADQ,MAET9O,CAFS,MAGT,CAAA,CAHS,IAIX1iC,QAAQ,EAAG,CAAE,MAAO0iC,EAAT,CAJA,CAAjB,CA1BqB,CA9GP,WAgJLoO,QAAQ,EAAG,CAQpB,IAPA,IAAI/Z,EAAS,IAAb,CAEI6a,EAAQ,EAFZ,CAGIJ,EAAQ,IAAA51C,MAHZ,CAKIi2C,CALJ,CAKaC,CALb,CAKwBC,CALxB,CAKoCzB,CAEpC,CAAO,IAAA10C,MAAP,CAAoB,IAAAknB,KAAAvoB,OAApB,CAAA,CAAsC,CACpC+1C,CAAA;AAAK,IAAAxtB,KAAAjjB,OAAA,CAAiB,IAAAjE,MAAjB,CACL,IAAW,GAAX,GAAI00C,CAAJ,EAAkB,IAAAO,QAAA,CAAaP,CAAb,CAAlB,EAAsC,IAAA/yC,SAAA,CAAc+yC,CAAd,CAAtC,CACa,GACX,GADIA,CACJ,GADgBuB,CAChB,CAD0B,IAAAj2C,MAC1B,EAAAg2C,CAAA,EAAStB,CAFX,KAIE,MAEF,KAAA10C,MAAA,EARoC,CAYtC,GAAIi2C,CAAJ,CAEE,IADAC,CACA,CADY,IAAAl2C,MACZ,CAAOk2C,CAAP,CAAmB,IAAAhvB,KAAAvoB,OAAnB,CAAA,CAAqC,CACnC+1C,CAAA,CAAK,IAAAxtB,KAAAjjB,OAAA,CAAiBiyC,CAAjB,CACL,IAAW,GAAX,GAAIxB,CAAJ,CAAgB,CACdyB,CAAA,CAAaH,CAAAtyC,OAAA,CAAauyC,CAAb,CAAuBL,CAAvB,CAA+B,CAA/B,CACbI,EAAA,CAAQA,CAAAtyC,OAAA,CAAa,CAAb,CAAgBuyC,CAAhB,CAA0BL,CAA1B,CACR,KAAA51C,MAAA,CAAak2C,CACb,MAJc,CAMhB,GAAI,IAAAd,aAAA,CAAkBV,CAAlB,CAAJ,CACEwB,CAAA,EADF,KAGE,MAXiC,CAiBnChtB,CAAAA,CAAQ,OACH0sB,CADG,MAEJI,CAFI,CAMZ,IAAI/C,EAAA7zC,eAAA,CAAyB42C,CAAzB,CAAJ,CACE9sB,CAAA9kB,GACA,CADW6uC,EAAA,CAAU+C,CAAV,CACX,CAAA9sB,CAAAlkB,KAAA,CAAaiuC,EAAA,CAAU+C,CAAV,CAFf,KAGO,CACL,IAAIrsC,EAASswB,EAAA,CAAS+b,CAAT,CAAgB,IAAAh8B,QAAhB,CAA8B,IAAAkN,KAA9B,CACbgC,EAAA9kB,GAAA,CAAWzD,CAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CACvC,MAAQ1J,EAAA,CAAOxF,CAAP,CAAakP,CAAb,CAD+B,CAA9B,CAER,QACOkQ,QAAQ,CAACpf,CAAD,CAAOrE,CAAP,CAAc,CAC5B,MAAOm5B,GAAA,CAAO90B,CAAP,CAAa6xC,CAAb,CAAoBl2C,CAApB,CAA2Bq7B,CAAAjU,KAA3B,CAAwCiU,CAAAnhB,QAAxC,CADqB,CAD7B,CAFQ,CAFN,CAWP,IAAA46B,OAAAp1C,KAAA,CAAiB0pB,CAAjB,CAEIitB;CAAJ,GACE,IAAAvB,OAAAp1C,KAAA,CAAiB,OACTy2C,CADS,MAET,GAFS,MAGT,CAAA,CAHS,CAAjB,CAKA,CAAA,IAAArB,OAAAp1C,KAAA,CAAiB,OACRy2C,CADQ,CACE,CADF,MAETE,CAFS,MAGT,CAAA,CAHS,CAAjB,CANF,CA7DoB,CAhJN,YA2NJrB,QAAQ,CAACsB,CAAD,CAAQ,CAC1B,IAAIR,EAAQ,IAAA51C,MACZ,KAAAA,MAAA,EAIA,KAHA,IAAIipC,EAAS,EAAb,CACIoN,EAAYD,CADhB,CAEIt9B,EAAS,CAAA,CACb,CAAO,IAAA9Y,MAAP,CAAoB,IAAAknB,KAAAvoB,OAApB,CAAA,CAAsC,CACpC,IAAI+1C,EAAK,IAAAxtB,KAAAjjB,OAAA,CAAiB,IAAAjE,MAAjB,CAAT,CACAq2C,EAAAA,CAAAA,CAAa3B,CACb,IAAI57B,CAAJ,CACa,GAAX,GAAI47B,CAAJ,EACM4B,CAIJ,CAJU,IAAApvB,KAAAhO,UAAA,CAAoB,IAAAlZ,MAApB,CAAiC,CAAjC,CAAoC,IAAAA,MAApC,CAAiD,CAAjD,CAIV,CAHKs2C,CAAAxwC,MAAA,CAAU,aAAV,CAGL,EAFE,IAAA2vC,WAAA,CAAgB,6BAAhB,CAAgDa,CAAhD,CAAsD,GAAtD,CAEF,CADA,IAAAt2C,MACA,EADc,CACd,CAAAipC,CAAA,EAAU5oC,MAAAC,aAAA,CAAoBU,QAAA,CAASs1C,CAAT,CAAc,EAAd,CAApB,CALZ,EASIrN,CATJ,CAQE,CADIsN,CACJ,CADU/B,EAAA,CAAOE,CAAP,CACV,EACEzL,CADF,CACYsN,CADZ,CAGEtN,CAHF,CAGYyL,CAGd,CAAA57B,CAAA,CAAS,CAAA,CAfX,KAgBO,IAAW,IAAX,GAAI47B,CAAJ,CACL57B,CAAA,CAAS,CAAA,CADJ,KAEA,CAAA,GAAI47B,CAAJ,GAAW0B,CAAX,CAAkB,CACvB,IAAAp2C,MAAA,EACA;IAAA40C,OAAAp1C,KAAA,CAAiB,OACRo2C,CADQ,MAETS,CAFS,QAGPpN,CAHO,MAIT,CAAA,CAJS,IAKX7kC,QAAQ,EAAG,CAAE,MAAO6kC,EAAT,CALA,CAAjB,CAOA,OATuB,CAWvBA,CAAA,EAAUyL,CAXL,CAaP,IAAA10C,MAAA,EAlCoC,CAoCtC,IAAAy1C,WAAA,CAAgB,oBAAhB,CAAsCG,CAAtC,CA1C0B,CA3NZ,CA6QlB,KAAIxa,GAASA,QAAS,CAACH,CAAD,CAAQH,CAAR,CAAiB9gB,CAAjB,CAA0B,CAC9C,IAAAihB,MAAA,CAAaA,CACb,KAAAH,QAAA,CAAeA,CACf,KAAA9gB,QAAA,CAAeA,CAH+B,CAMhDohB,GAAAob,KAAA,CAAcC,QAAS,EAAG,CAAE,MAAO,EAAT,CAE1Brb,GAAA1nB,UAAA,CAAmB,aACJ0nB,EADI,OAGVn2B,QAAS,CAACiiB,CAAD,CAAOliB,CAAP,CAAa,CAC3B,IAAAkiB,KAAA,CAAYA,CAGZ,KAAAliB,KAAA,CAAYA,CAEZ,KAAA4vC,OAAA,CAAc,IAAA3Z,MAAAwZ,IAAA,CAAevtB,CAAf,CAEVliB,EAAJ,GAGE,IAAA0xC,WAEA,CAFkB,IAAAC,UAElB,CAAA,IAAAC,aAAA,CACA,IAAAC,YADA,CAEA,IAAAC,YAFA,CAGA,IAAAC,YAHA,CAGmBC,QAAQ,EAAG,CAC5B,IAAAvB,WAAA,CAAgB,mBAAhB,CAAqC,MAAOvuB,CAAP;MAAoB,CAApB,CAArC,CAD4B,CARhC,CAaA,KAAIpnB,EAAQkF,CAAA,CAAO,IAAAiyC,QAAA,EAAP,CAAwB,IAAAC,WAAA,EAET,EAA3B,GAAI,IAAAtC,OAAAj2C,OAAJ,EACE,IAAA82C,WAAA,CAAgB,wBAAhB,CAA0C,IAAAb,OAAA,CAAY,CAAZ,CAA1C,CAGF90C,EAAAsjC,QAAA,CAAgB,CAAC,CAACtjC,CAAAsjC,QAClBtjC,EAAAiU,SAAA,CAAiB,CAAC,CAACjU,CAAAiU,SAEnB,OAAOjU,EA9BoB,CAHZ,SAoCRm3C,QAAS,EAAG,CACnB,IAAIA,CACJ,IAAI,IAAAE,OAAA,CAAY,GAAZ,CAAJ,CACEF,CACA,CADU,IAAAF,YAAA,EACV,CAAA,IAAAK,QAAA,CAAa,GAAb,CAFF,KAGO,IAAI,IAAAD,OAAA,CAAY,GAAZ,CAAJ,CACLF,CAAA,CAAU,IAAAI,iBAAA,EADL,KAEA,IAAI,IAAAF,OAAA,CAAY,GAAZ,CAAJ,CACLF,CAAA,CAAU,IAAA7M,OAAA,EADL,KAEA,CACL,IAAIlhB,EAAQ,IAAAiuB,OAAA,EAEZ,EADAF,CACA,CADU/tB,CAAA9kB,GACV,GACE,IAAAqxC,WAAA,CAAgB,0BAAhB,CAA4CvsB,CAA5C,CAEEA,EAAAlkB,KAAJ,GACEiyC,CAAAljC,SACA,CADmB,CAAA,CACnB,CAAAkjC,CAAA7T,QAAA,CAAkB,CAAA,CAFpB,CANK,CAaP,IADA,IAAUnkC,CACV,CAAQihC,CAAR,CAAe,IAAAiX,OAAA,CAAY,GAAZ;AAAiB,GAAjB,CAAsB,GAAtB,CAAf,CAAA,CACoB,GAAlB,GAAIjX,CAAAhZ,KAAJ,EACE+vB,CACA,CADU,IAAAL,aAAA,CAAkBK,CAAlB,CAA2Bh4C,CAA3B,CACV,CAAAA,CAAA,CAAU,IAFZ,EAGyB,GAAlB,GAAIihC,CAAAhZ,KAAJ,EACLjoB,CACA,CADUg4C,CACV,CAAAA,CAAA,CAAU,IAAAH,YAAA,CAAiBG,CAAjB,CAFL,EAGkB,GAAlB,GAAI/W,CAAAhZ,KAAJ,EACLjoB,CACA,CADUg4C,CACV,CAAAA,CAAA,CAAU,IAAAJ,YAAA,CAAiBI,CAAjB,CAFL,EAIL,IAAAxB,WAAA,CAAgB,YAAhB,CAGJ,OAAOwB,EApCY,CApCJ,YA2ELxB,QAAQ,CAAC6B,CAAD,CAAMpuB,CAAN,CAAa,CAC/B,KAAM6P,GAAA,CAAa,QAAb,CAEA7P,CAAAhC,KAFA,CAEYowB,CAFZ,CAEkBpuB,CAAAlpB,MAFlB,CAEgC,CAFhC,CAEoC,IAAAknB,KAFpC,CAE+C,IAAAA,KAAAhO,UAAA,CAAoBgQ,CAAAlpB,MAApB,CAF/C,CAAN,CAD+B,CA3EhB,WAiFNu3C,QAAQ,EAAG,CACpB,GAA2B,CAA3B,GAAI,IAAA3C,OAAAj2C,OAAJ,CACE,KAAMo6B,GAAA,CAAa,MAAb,CAA0D,IAAA7R,KAA1D,CAAN,CACF,MAAO,KAAA0tB,OAAA,CAAY,CAAZ,CAHa,CAjFL,MAuFXG,QAAQ,CAACnC,CAAD,CAAKC,CAAL,CAASC,CAAT,CAAa0E,CAAb,CAAiB,CAC7B,GAAyB,CAAzB,CAAI,IAAA5C,OAAAj2C,OAAJ,CAA4B,CAC1B,IAAIuqB,EAAQ,IAAA0rB,OAAA,CAAY,CAAZ,CAAZ,CACI6C,EAAIvuB,CAAAhC,KACR,IAAIuwB,CAAJ,GAAU7E,CAAV,EAAgB6E,CAAhB,GAAsB5E,CAAtB,EAA4B4E,CAA5B,GAAkC3E,CAAlC,EAAwC2E,CAAxC,GAA8CD,CAA9C,EACK,EAAC5E,CAAD,EAAQC,CAAR,EAAeC,CAAf,EAAsB0E,CAAtB,CADL,CAEE,MAAOtuB,EALiB,CAQ5B,MAAO,CAAA,CATsB,CAvFd;OAmGTiuB,QAAQ,CAACvE,CAAD,CAAKC,CAAL,CAASC,CAAT,CAAa0E,CAAb,CAAgB,CAE9B,MAAA,CADItuB,CACJ,CADY,IAAA6rB,KAAA,CAAUnC,CAAV,CAAcC,CAAd,CAAkBC,CAAlB,CAAsB0E,CAAtB,CACZ,GACM,IAAAxyC,KAIGkkB,EAJWlkB,CAAAkkB,CAAAlkB,KAIXkkB,EAHL,IAAAusB,WAAA,CAAgB,mBAAhB,CAAqCvsB,CAArC,CAGKA,CADP,IAAA0rB,OAAAxoC,MAAA,EACO8c,CAAAA,CALT,EAOO,CAAA,CATuB,CAnGf,SA+GRkuB,QAAQ,CAACxE,CAAD,CAAI,CACd,IAAAuE,OAAA,CAAYvE,CAAZ,CAAL,EACE,IAAA6C,WAAA,CAAgB,4BAAhB,CAA+C7C,CAA/C,CAAoD,GAApD,CAAyD,IAAAmC,KAAA,EAAzD,CAFiB,CA/GJ,SAqHR2C,QAAQ,CAACtzC,CAAD,CAAKuzC,CAAL,CAAY,CAC3B,MAAOh3C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CACnC,MAAOjP,EAAA,CAAGD,CAAH,CAASkP,CAAT,CAAiBskC,CAAjB,CAD4B,CAA9B,CAEJ,UACQA,CAAA5jC,SADR,CAFI,CADoB,CArHZ,WA6HN6jC,QAAQ,CAACC,CAAD,CAAOC,CAAP,CAAeH,CAAf,CAAqB,CACtC,MAAOh3C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAc,CAClC,MAAOwkC,EAAA,CAAK1zC,CAAL,CAAWkP,CAAX,CAAA,CAAqBykC,CAAA,CAAO3zC,CAAP,CAAakP,CAAb,CAArB,CAA4CskC,CAAA,CAAMxzC,CAAN,CAAYkP,CAAZ,CADjB,CAA7B,CAEJ,UACSwkC,CAAA9jC,SADT,EAC0B+jC,CAAA/jC,SAD1B,EAC6C4jC,CAAA5jC,SAD7C,CAFI,CAD+B,CA7HvB,UAqIPgkC,QAAQ,CAACF,CAAD,CAAOzzC,CAAP,CAAWuzC,CAAX,CAAkB,CAClC,MAAOh3C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CACnC,MAAOjP,EAAA,CAAGD,CAAH;AAASkP,CAAT,CAAiBwkC,CAAjB,CAAuBF,CAAvB,CAD4B,CAA9B,CAEJ,UACQE,CAAA9jC,SADR,EACyB4jC,CAAA5jC,SADzB,CAFI,CAD2B,CArInB,YA6ILmjC,QAAQ,EAAG,CAErB,IADA,IAAIA,EAAa,EACjB,CAAA,CAAA,CAGE,GAFyB,CAErB,CAFA,IAAAtC,OAAAj2C,OAEA,EAF2B,CAAA,IAAAo2C,KAAA,CAAU,GAAV,CAAe,GAAf,CAAoB,GAApB,CAAyB,GAAzB,CAE3B,EADFmC,CAAA13C,KAAA,CAAgB,IAAAu3C,YAAA,EAAhB,CACE,CAAA,CAAC,IAAAI,OAAA,CAAY,GAAZ,CAAL,CAGE,MAA8B,EACvB,GADCD,CAAAv4C,OACD,CAADu4C,CAAA,CAAW,CAAX,CAAC,CACD,QAAQ,CAAC/yC,CAAD,CAAOkP,CAAP,CAAe,CAErB,IADA,IAAIvT,CAAJ,CACSH,EAAI,CAAb,CAAgBA,CAAhB,CAAoBu3C,CAAAv4C,OAApB,CAAuCgB,CAAA,EAAvC,CAA4C,CAC1C,IAAIq4C,EAAYd,CAAA,CAAWv3C,CAAX,CACZq4C,EAAJ,GACEl4C,CADF,CACUk4C,CAAA,CAAU7zC,CAAV,CAAgBkP,CAAhB,CADV,CAF0C,CAM5C,MAAOvT,EARc,CAVZ,CA7IN,aAqKJi3C,QAAQ,EAAG,CAGtB,IAFA,IAAIc,EAAO,IAAA5tB,WAAA,EAAX,CACIf,CACJ,CAAA,CAAA,CACE,GAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAyH,OAAA,EAA9B,CADT,KAGE,OAAOgsC,EAPW,CArKP,QAiLThsC,QAAQ,EAAG,CAIjB,IAHA,IAAIqd,EAAQ,IAAAiuB,OAAA,EAAZ,CACI/yC,EAAK,IAAA02B,QAAA,CAAa5R,CAAAhC,KAAb,CADT,CAEI+wB,EAAS,EACb,CAAA,CAAA,CACE,GAAK/uB,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,CACEc,CAAAz4C,KAAA,CAAY,IAAAyqB,WAAA,EAAZ,CADF;IAEO,CACL,IAAIiuB,EAAWA,QAAQ,CAAC/zC,CAAD,CAAOkP,CAAP,CAAeg3B,CAAf,CAAsB,CACvC/2B,CAAAA,CAAO,CAAC+2B,CAAD,CACX,KAAK,IAAI1qC,EAAI,CAAb,CAAgBA,CAAhB,CAAoBs4C,CAAAt5C,OAApB,CAAmCgB,CAAA,EAAnC,CACE2T,CAAA9T,KAAA,CAAUy4C,CAAA,CAAOt4C,CAAP,CAAA,CAAUwE,CAAV,CAAgBkP,CAAhB,CAAV,CAEF,OAAOjP,EAAAtC,MAAA,CAASqC,CAAT,CAAemP,CAAf,CALoC,CAO7C,OAAO,SAAQ,EAAG,CAChB,MAAO4kC,EADS,CARb,CAPQ,CAjLF,YAuMLjuB,QAAQ,EAAG,CACrB,MAAO,KAAAysB,WAAA,EADc,CAvMN,YA2MLA,QAAQ,EAAG,CACrB,IAAImB,EAAO,IAAAM,QAAA,EAAX,CACIR,CADJ,CAEIzuB,CACJ,OAAA,CAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,GACOU,CAAAt0B,OAKE,EAJL,IAAAkyB,WAAA,CAAgB,0BAAhB,CACI,IAAAvuB,KAAAhO,UAAA,CAAoB,CAApB,CAAuBgQ,CAAAlpB,MAAvB,CADJ,CAC0C,0BAD1C,CACsEkpB,CADtE,CAIK,CADPyuB,CACO,CADC,IAAAQ,QAAA,EACD,CAAA,QAAQ,CAACjwC,CAAD,CAAQmL,CAAR,CAAgB,CAC7B,MAAOwkC,EAAAt0B,OAAA,CAAYrb,CAAZ,CAAmByvC,CAAA,CAAMzvC,CAAN,CAAamL,CAAb,CAAnB,CAAyCA,CAAzC,CADsB,CANjC,EAUOwkC,CAdc,CA3MN,SA4NRM,QAAQ,EAAG,CAClB,IAAIN,EAAO,IAAAlB,UAAA,EAAX,CACImB,CADJ,CAEI5uB,CACJ,IAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,CAAgC,CAC9BW,CAAA,CAAS,IAAAK,QAAA,EACT;GAAKjvB,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,CACE,MAAO,KAAAS,UAAA,CAAeC,CAAf,CAAqBC,CAArB,CAA6B,IAAAK,QAAA,EAA7B,CAEP,KAAA1C,WAAA,CAAgB,YAAhB,CAA8BvsB,CAA9B,CAL4B,CAAhC,IAQE,OAAO2uB,EAZS,CA5NH,WA4ONlB,QAAQ,EAAG,CAGpB,IAFA,IAAIkB,EAAO,IAAAO,WAAA,EAAX,CACIlvB,CACJ,CAAA,CAAA,CACE,GAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,IAAZ,CAAb,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAg0C,WAAA,EAA9B,CADT,KAGE,OAAOP,EAPS,CA5OL,YAwPLO,QAAQ,EAAG,CACrB,IAAIP,EAAO,IAAAQ,SAAA,EAAX,CACInvB,CACJ,IAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,IAAZ,CAAb,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAg0C,WAAA,EAA9B,CAET,OAAOP,EANc,CAxPN,UAiQPQ,QAAQ,EAAG,CACnB,IAAIR,EAAO,IAAAS,WAAA,EAAX,CACIpvB,CACJ,IAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,IAAZ,CAAiB,IAAjB,CAAsB,KAAtB,CAA4B,KAA5B,CAAb,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAi0C,SAAA,EAA9B,CAET,OAAOR,EANY,CAjQJ;WA0QLS,QAAQ,EAAG,CACrB,IAAIT,EAAO,IAAAU,SAAA,EAAX,CACIrvB,CACJ,IAAKA,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAiB,GAAjB,CAAsB,IAAtB,CAA4B,IAA5B,CAAb,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAk0C,WAAA,EAA9B,CAET,OAAOT,EANc,CA1QN,UAmRPU,QAAQ,EAAG,CAGnB,IAFA,IAAIV,EAAO,IAAAW,eAAA,EAAX,CACItvB,CACJ,CAAQA,CAAR,CAAgB,IAAAiuB,OAAA,CAAY,GAAZ,CAAgB,GAAhB,CAAhB,CAAA,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAo0C,eAAA,EAA9B,CAET,OAAOX,EANY,CAnRJ,gBA4RDW,QAAQ,EAAG,CAGzB,IAFA,IAAIX,EAAO,IAAAY,MAAA,EAAX,CACIvvB,CACJ,CAAQA,CAAR,CAAgB,IAAAiuB,OAAA,CAAY,GAAZ,CAAgB,GAAhB,CAAoB,GAApB,CAAhB,CAAA,CACEU,CAAA,CAAO,IAAAE,SAAA,CAAcF,CAAd,CAAoB3uB,CAAA9kB,GAApB,CAA8B,IAAAq0C,MAAA,EAA9B,CAET,OAAOZ,EANkB,CA5RV,OAqSVY,QAAQ,EAAG,CAChB,IAAIvvB,CACJ,OAAI,KAAAiuB,OAAA,CAAY,GAAZ,CAAJ,CACS,IAAAF,QAAA,EADT,CAEO,CAAK/tB,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,EACE,IAAAY,SAAA,CAAc3c,EAAAob,KAAd,CAA2BttB,CAAA9kB,GAA3B;AAAqC,IAAAq0C,MAAA,EAArC,CADF,CAEA,CAAKvvB,CAAL,CAAa,IAAAiuB,OAAA,CAAY,GAAZ,CAAb,EACE,IAAAO,QAAA,CAAaxuB,CAAA9kB,GAAb,CAAuB,IAAAq0C,MAAA,EAAvB,CADF,CAGE,IAAAxB,QAAA,EATO,CArSD,aAkTJJ,QAAQ,CAACzM,CAAD,CAAS,CAC5B,IAAIjP,EAAS,IAAb,CACIud,EAAQ,IAAAvB,OAAA,EAAAjwB,KADZ,CAEIvd,EAASswB,EAAA,CAASye,CAAT,CAAgB,IAAA1+B,QAAhB,CAA8B,IAAAkN,KAA9B,CAEb,OAAOvmB,EAAA,CAAO,QAAQ,CAACuH,CAAD,CAAQmL,CAAR,CAAgBlP,CAAhB,CAAsB,CAC1C,MAAOwF,EAAA,CAAOxF,CAAP,EAAeimC,CAAA,CAAOliC,CAAP,CAAcmL,CAAd,CAAf,CAAsCA,CAAtC,CADmC,CAArC,CAEJ,QACOkQ,QAAQ,CAACrb,CAAD,CAAQpI,CAAR,CAAeuT,CAAf,CAAuB,CACrC,MAAO4lB,GAAA,CAAOmR,CAAA,CAAOliC,CAAP,CAAcmL,CAAd,CAAP,CAA8BqlC,CAA9B,CAAqC54C,CAArC,CAA4Cq7B,CAAAjU,KAA5C,CAAyDiU,CAAAnhB,QAAzD,CAD8B,CADtC,CAFI,CALqB,CAlTb,aAgUJ88B,QAAQ,CAACr4C,CAAD,CAAM,CACzB,IAAI08B,EAAS,IAAb,CAEIwd,EAAU,IAAA1uB,WAAA,EACd,KAAAmtB,QAAA,CAAa,GAAb,CAEA,OAAOz2C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CAAA,IAC/BulC,EAAIn6C,CAAA,CAAI0F,CAAJ,CAAUkP,CAAV,CAD2B,CAE/B1T,EAAIg5C,CAAA,CAAQx0C,CAAR,CAAckP,CAAd,CAF2B,CAG5BkH,CAEP,IAAI,CAACq+B,CAAL,CAAQ,MAAOt6C,EAEf,EADA6G,CACA,CADI6zB,EAAA,CAAiB4f,CAAA,CAAEj5C,CAAF,CAAjB,CAAuBw7B,CAAAjU,KAAvB,CACJ,IAAS/hB,CAAAooB,KAAT,EAAmB4N,CAAAnhB,QAAAqf,eAAnB,IACE9e,CAKA,CALIpV,CAKJ,CAJM,KAIN,EAJeA,EAIf,GAHEoV,CAAAgf,IACA,CADQj7B,CACR;AAAAic,CAAAgT,KAAA,CAAO,QAAQ,CAAC7oB,CAAD,CAAM,CAAE6V,CAAAgf,IAAA,CAAQ70B,CAAV,CAArB,CAEF,EAAAS,CAAA,CAAIA,CAAAo0B,IANN,CAQA,OAAOp0B,EAf4B,CAA9B,CAgBJ,QACOoe,QAAQ,CAACpf,CAAD,CAAOrE,CAAP,CAAcuT,CAAd,CAAsB,CACpC,IAAInU,EAAMy5C,CAAA,CAAQx0C,CAAR,CAAckP,CAAd,CAGV,OADW2lB,GAAA6f,CAAiBp6C,CAAA,CAAI0F,CAAJ,CAAUkP,CAAV,CAAjBwlC,CAAoC1d,CAAAjU,KAApC2xB,CACJ,CAAK35C,CAAL,CAAP,CAAmBY,CAJiB,CADrC,CAhBI,CANkB,CAhUV,cAgWH82C,QAAQ,CAACxyC,CAAD,CAAK00C,CAAL,CAAoB,CACxC,IAAIb,EAAS,EACb,IAA8B,GAA9B,GAAI,IAAAV,UAAA,EAAArwB,KAAJ,EACE,EACE+wB,EAAAz4C,KAAA,CAAY,IAAAyqB,WAAA,EAAZ,CADF,OAES,IAAAktB,OAAA,CAAY,GAAZ,CAFT,CADF,CAKA,IAAAC,QAAA,CAAa,GAAb,CAEA,KAAIjc,EAAS,IAEb,OAAO,SAAQ,CAACjzB,CAAD,CAAQmL,CAAR,CAAgB,CAI7B,IAHA,IAAIC,EAAO,EAAX,CACIrU,EAAU65C,CAAA,CAAgBA,CAAA,CAAc5wC,CAAd,CAAqBmL,CAArB,CAAhB,CAA+CnL,CAD7D,CAGSvI,EAAI,CAAb,CAAgBA,CAAhB,CAAoBs4C,CAAAt5C,OAApB,CAAmCgB,CAAA,EAAnC,CACE2T,CAAA9T,KAAA,CAAUy4C,CAAA,CAAOt4C,CAAP,CAAA,CAAUuI,CAAV,CAAiBmL,CAAjB,CAAV,CAEE0lC,EAAAA,CAAQ30C,CAAA,CAAG8D,CAAH,CAAUmL,CAAV,CAAkBpU,CAAlB,CAAR85C,EAAsC33C,CAE1C43B,GAAA,CAAiB+f,CAAjB,CAAwB5d,CAAAjU,KAAxB,CAGI/hB,EAAAA,CAAI4zC,CAAAj3C,MACA,CAAAi3C,CAAAj3C,MAAA,CAAY7C,CAAZ,CAAqBqU,CAArB,CAAA,CACAylC,CAAA,CAAMzlC,CAAA,CAAK,CAAL,CAAN,CAAeA,CAAA,CAAK,CAAL,CAAf,CAAwBA,CAAA,CAAK,CAAL,CAAxB,CAAiCA,CAAA,CAAK,CAAL,CAAjC,CAA0CA,CAAA,CAAK,CAAL,CAA1C,CAER,OAAO0lB,GAAA,CAAiB7zB,CAAjB,CAAoBg2B,CAAAjU,KAApB,CAhBsB,CAXS,CAhWzB,kBAgYCmwB,QAAS,EAAG,CAC5B,IAAI2B,EAAa,EAAjB,CACIC,EAAc,CAAA,CAClB,IAA8B,GAA9B;AAAI,IAAA1B,UAAA,EAAArwB,KAAJ,EACE,EAAG,CACD,IAAIgyB,EAAY,IAAAjvB,WAAA,EAChB+uB,EAAAx5C,KAAA,CAAgB05C,CAAhB,CACKA,EAAAnlC,SAAL,GACEklC,CADF,CACgB,CAAA,CADhB,CAHC,CAAH,MAMS,IAAA9B,OAAA,CAAY,GAAZ,CANT,CADF,CASA,IAAAC,QAAA,CAAa,GAAb,CAEA,OAAOz2C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CAEnC,IADA,IAAIzQ,EAAQ,EAAZ,CACSjD,EAAI,CAAb,CAAgBA,CAAhB,CAAoBq5C,CAAAr6C,OAApB,CAAuCgB,CAAA,EAAvC,CACEiD,CAAApD,KAAA,CAAWw5C,CAAA,CAAWr5C,CAAX,CAAA,CAAcwE,CAAd,CAAoBkP,CAApB,CAAX,CAEF,OAAOzQ,EAL4B,CAA9B,CAMJ,SACQ,CAAA,CADR,UAESq2C,CAFT,CANI,CAdqB,CAhYb,QA0ZT7O,QAAS,EAAG,CAClB,IAAI+O,EAAY,EAAhB,CACIF,EAAc,CAAA,CAClB,IAA8B,GAA9B,GAAI,IAAA1B,UAAA,EAAArwB,KAAJ,EACE,EAAG,CAAA,IACGgC,EAAQ,IAAAiuB,OAAA,EADX,CAEDj4C,EAAMgqB,CAAA+f,OAAN/pC,EAAsBgqB,CAAAhC,KACtB,KAAAkwB,QAAA,CAAa,GAAb,CACA,KAAIt3C,EAAQ,IAAAmqB,WAAA,EACZkvB,EAAA35C,KAAA,CAAe,KAAMN,CAAN,OAAkBY,CAAlB,CAAf,CACKA,EAAAiU,SAAL,GACEklC,CADF,CACgB,CAAA,CADhB,CANC,CAAH,MASS,IAAA9B,OAAA,CAAY,GAAZ,CATT,CADF,CAYA,IAAAC,QAAA,CAAa,GAAb,CAEA,OAAOz2C,EAAA,CAAO,QAAQ,CAACwD,CAAD,CAAOkP,CAAP,CAAe,CAEnC,IADA,IAAI+2B,EAAS,EAAb,CACSzqC;AAAI,CAAb,CAAgBA,CAAhB,CAAoBw5C,CAAAx6C,OAApB,CAAsCgB,CAAA,EAAtC,CAA2C,CACzC,IAAIwG,EAAWgzC,CAAA,CAAUx5C,CAAV,CACfyqC,EAAA,CAAOjkC,CAAAjH,IAAP,CAAA,CAAuBiH,CAAArG,MAAA,CAAeqE,CAAf,CAAqBkP,CAArB,CAFkB,CAI3C,MAAO+2B,EAN4B,CAA9B,CAOJ,SACQ,CAAA,CADR,UAES6O,CAFT,CAPI,CAjBW,CA1ZH,CA6dnB,KAAI/e,GAAgB,EAApB,CA2zDI4G,GAAaviC,CAAA,CAAO,MAAP,CA3zDjB,CA6zDI4iC,GAAe,MACX,MADW,KAEZ,KAFY,KAGZ,KAHY,cAMH,aANG,IAOb,IAPa,CA7zDnB,CAkmGI2D,EAAiBzmC,CAAAwO,cAAA,CAAuB,GAAvB,CAlmGrB,CAmmGIo4B,GAAY1b,EAAA,CAAWnrB,CAAA4D,SAAA4V,KAAX,CAAiC,CAAA,CAAjC,CAgNhButB,GAAAl0B,QAAA,CAA0B,CAAC,UAAD,CAuS1Bq0B,GAAAr0B,QAAA,CAAyB,CAAC,SAAD,CA2DzB20B,GAAA30B,QAAA,CAAuB,CAAC,SAAD,CASvB,KAAI41B,GAAc,GAAlB,CA2HIsD,GAAe,MACXvB,CAAA,CAAW,UAAX,CAAuB,CAAvB,CADW,IAEXA,CAAA,CAAW,UAAX,CAAuB,CAAvB,CAA0B,CAA1B,CAA6B,CAAA,CAA7B,CAFW,GAGXA,CAAA,CAAW,UAAX,CAAuB,CAAvB,CAHW,MAIXE,EAAA,CAAc,OAAd,CAJW,KAKXA,EAAA,CAAc,OAAd,CAAuB,CAAA,CAAvB,CALW,IAMXF,CAAA,CAAW,OAAX,CAAoB,CAApB,CAAuB,CAAvB,CANW,GAOXA,CAAA,CAAW,OAAX,CAAoB,CAApB,CAAuB,CAAvB,CAPW,IAQXA,CAAA,CAAW,MAAX,CAAmB,CAAnB,CARW,GASXA,CAAA,CAAW,MAAX,CAAmB,CAAnB,CATW,IAUXA,CAAA,CAAW,OAAX,CAAoB,CAApB,CAVW,GAWXA,CAAA,CAAW,OAAX;AAAoB,CAApB,CAXW,IAYXA,CAAA,CAAW,OAAX,CAAoB,CAApB,CAAwB,GAAxB,CAZW,GAaXA,CAAA,CAAW,OAAX,CAAoB,CAApB,CAAwB,GAAxB,CAbW,IAcXA,CAAA,CAAW,SAAX,CAAsB,CAAtB,CAdW,GAeXA,CAAA,CAAW,SAAX,CAAsB,CAAtB,CAfW,IAgBXA,CAAA,CAAW,SAAX,CAAsB,CAAtB,CAhBW,GAiBXA,CAAA,CAAW,SAAX,CAAsB,CAAtB,CAjBW,KAoBXA,CAAA,CAAW,cAAX,CAA2B,CAA3B,CApBW,MAqBXE,EAAA,CAAc,KAAd,CArBW,KAsBXA,EAAA,CAAc,KAAd,CAAqB,CAAA,CAArB,CAtBW,GAJnBsQ,QAAmB,CAACvQ,CAAD,CAAOxC,CAAP,CAAgB,CACjC,MAAyB,GAAlB,CAAAwC,CAAAwQ,SAAA,EAAA,CAAuBhT,CAAAiT,MAAA,CAAc,CAAd,CAAvB,CAA0CjT,CAAAiT,MAAA,CAAc,CAAd,CADhB,CAIhB,GAdnBC,QAAuB,CAAC1Q,CAAD,CAAO,CACxB2Q,CAAAA,CAAQ,EAARA,CAAY3Q,CAAA4Q,kBAAA,EAMhB,OAHAC,EAGA,EAL0B,CAATA,EAACF,CAADE,CAAc,GAAdA,CAAoB,EAKrC,GAHcjR,EAAA,CAAUvjB,IAAA,CAAY,CAAP,CAAAs0B,CAAA,CAAW,OAAX,CAAqB,MAA1B,CAAA,CAAkCA,CAAlC,CAAyC,EAAzC,CAAV,CAAwD,CAAxD,CAGd,CAFc/Q,EAAA,CAAUvjB,IAAAmiB,IAAA,CAASmS,CAAT,CAAgB,EAAhB,CAAV,CAA+B,CAA/B,CAEd,CAP4B,CAcX,CA3HnB,CAsJItP,GAAqB,8EAtJzB,CAuJID,GAAgB,UAmFpB1E,GAAAt0B,QAAA,CAAqB,CAAC,SAAD,CAuHrB,KAAI00B,GAAkBpkC,EAAA,CAAQ6D,CAAR,CAAtB,CAWI0gC,GAAkBvkC,EAAA,CAAQsrB,EAAR,CA+LtBgZ,GAAA50B,QAAA;AAAwB,CAAC,QAAD,CA2ExB,KAAI0oC,GAAsBp4C,EAAA,CAAQ,UACtB,GADsB,SAEvB4G,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB,CAEnB,CAAZ,EAAIgJ,CAAJ,GAIOhJ,CAAAkQ,KAQL,EARmBlQ,CAAAN,KAQnB,EAPEM,CAAA+d,KAAA,CAAU,MAAV,CAAkB,EAAlB,CAOF,CAAAngB,CAAAM,OAAA,CAAevH,CAAAomB,cAAA,CAAuB,QAAvB,CAAf,CAZF,CAeA,OAAO,SAAQ,CAACvc,CAAD,CAAQ5C,CAAR,CAAiB,CAC9BA,CAAAhD,GAAA,CAAW,OAAX,CAAoB,QAAQ,CAACuN,CAAD,CAAO,CAE5BvK,CAAAoC,KAAA,CAAa,MAAb,CAAL,EACEmI,CAAAC,eAAA,EAH+B,CAAnC,CAD8B,CAjBD,CAFD,CAAR,CAA1B,CA2UI8pC,GAA6B,EAIjC76C,EAAA,CAAQ2Q,EAAR,CAAsB,QAAQ,CAACmqC,CAAD,CAAW/2B,CAAX,CAAqB,CAEjD,GAAgB,UAAhB,EAAI+2B,CAAJ,CAAA,CAEA,IAAIC,EAAah6B,EAAA,CAAmB,KAAnB,CAA2BgD,CAA3B,CACjB82B,GAAA,CAA2BE,CAA3B,CAAA,CAAyC,QAAQ,EAAG,CAClD,MAAO,UACK,GADL,SAEI3xC,QAAQ,EAAG,CAClB,MAAO,SAAQ,CAACD,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACpCQ,CAAA/E,OAAA,CAAauE,CAAA,CAAKoyC,CAAL,CAAb,CAA+BC,QAAiC,CAACj6C,CAAD,CAAQ,CACtE4H,CAAA+d,KAAA,CAAU3C,CAAV,CAAoB,CAAC,CAAChjB,CAAtB,CADsE,CAAxE,CADoC,CADpB,CAFf,CAD2C,CAHpD,CAFiD,CAAnD,CAqBAf,EAAA,CAAQ,CAAC,KAAD,CAAQ,QAAR,CAAkB,MAAlB,CAAR,CAAmC,QAAQ,CAAC+jB,CAAD,CAAW,CACpD,IAAIg3B,EAAah6B,EAAA,CAAmB,KAAnB,CAA2BgD,CAA3B,CACjB82B,GAAA,CAA2BE,CAA3B,CAAA,CAAyC,QAAQ,EAAG,CAClD,MAAO,UACK,EADL;KAECx/B,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACnCA,CAAA0b,SAAA,CAAc02B,CAAd,CAA0B,QAAQ,CAACh6C,CAAD,CAAQ,CACnCA,CAAL,GAGA4H,CAAA+d,KAAA,CAAU3C,CAAV,CAAoBhjB,CAApB,CAMA,CAAI4Q,CAAJ,EAAUpL,CAAA+jB,KAAA,CAAavG,CAAb,CAAuBpb,CAAA,CAAKob,CAAL,CAAvB,CATV,CADwC,CAA1C,CADmC,CAFhC,CAD2C,CAFA,CAAtD,CAuBA,KAAI6oB,GAAe,aACJvqC,CADI,gBAEDA,CAFC,cAGHA,CAHG,WAINA,CAJM,cAKHA,CALG,CAgCnB+pC,GAAAl6B,QAAA,CAAyB,CAAC,UAAD,CAAa,QAAb,CAAuB,QAAvB,CAiRzB,KAAI+oC,GAAuBA,QAAQ,CAACC,CAAD,CAAW,CAC5C,MAAO,CAAC,UAAD,CAAa,QAAQ,CAAC7H,CAAD,CAAW,CAoDrC,MAnDoB8H,MACZ,MADYA,UAERD,CAAA,CAAW,KAAX,CAAmB,GAFXC,YAGN/O,EAHM+O,SAIT/xC,QAAQ,EAAG,CAClB,MAAO,KACA4Z,QAAQ,CAAC7Z,CAAD,CAAQiyC,CAAR,CAAqBzyC,CAArB,CAA2BgV,CAA3B,CAAuC,CAClD,GAAI,CAAChV,CAAA0yC,OAAL,CAAkB,CAOhB,IAAIC,EAAyBA,QAAQ,CAACxqC,CAAD,CAAQ,CAC3CA,CAAAC,eACA,CAAID,CAAAC,eAAA,EAAJ,CACID,CAAAG,YADJ,CACwB,CAAA,CAHmB,CAM7Cm/B,GAAA,CAAmBgL,CAAA,CAAY,CAAZ,CAAnB,CAAmC,QAAnC,CAA6CE,CAA7C,CAIAF,EAAA73C,GAAA,CAAe,UAAf,CAA2B,QAAQ,EAAG,CACpC8vC,CAAA,CAAS,QAAQ,EAAG,CAClBpkC,EAAA,CAAsBmsC,CAAA,CAAY,CAAZ,CAAtB;AAAsC,QAAtC,CAAgDE,CAAhD,CADkB,CAApB,CAEG,CAFH,CAEM,CAAA,CAFN,CADoC,CAAtC,CAjBgB,CADgC,IAyB9CC,EAAiBH,CAAAj5C,OAAA,EAAAwb,WAAA,CAAgC,MAAhC,CAzB6B,CA0B9C69B,EAAQ7yC,CAAAN,KAARmzC,EAAqB7yC,CAAAukC,OAErBsO,EAAJ,EACEthB,EAAA,CAAO/wB,CAAP,CAAcqyC,CAAd,CAAqB79B,CAArB,CAAiC69B,CAAjC,CAEF,IAAID,CAAJ,CACEH,CAAA73C,GAAA,CAAe,UAAf,CAA2B,QAAQ,EAAG,CACpCg4C,CAAA5N,eAAA,CAA8BhwB,CAA9B,CACI69B,EAAJ,EACEthB,EAAA,CAAO/wB,CAAP,CAAcqyC,CAAd,CAAqBj8C,CAArB,CAAgCi8C,CAAhC,CAEF55C,EAAA,CAAO+b,CAAP,CAAmBivB,EAAnB,CALoC,CAAtC,CAhCgD,CAD/C,CADW,CAJFuO,CADiB,CAAhC,CADqC,CAA9C,CAyDIA,GAAgBF,EAAA,EAzDpB,CA0DIQ,GAAkBR,EAAA,CAAqB,CAAA,CAArB,CA1DtB,CA4DIS,GAAa,qFA5DjB,CA6DIC,GAAe,mDA7DnB,CA8DIC,GAAgB,oCA9DpB,CAgEIC,GAAY,MA4ENvN,EA5EM,QAigBhBwN,QAAwB,CAAC3yC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B13B,CAA7B,CAAuC8V,CAAvC,CAAiD,CACvE2hB,EAAA,CAAcnlC,CAAd,CAAqB5C,CAArB,CAA8BoC,CAA9B,CAAoC4lC,CAApC,CAA0C13B,CAA1C,CAAoD8V,CAApD,CAEA4hB,EAAAc,SAAA5uC,KAAA,CAAmB,QAAQ,CAACM,CAAD,CAAQ,CACjC,IAAI0gC,EAAQ8M,CAAAQ,SAAA,CAAchuC,CAAd,CACZ,IAAI0gC,CAAJ,EAAama,EAAAlyC,KAAA,CAAmB3I,CAAnB,CAAb,CAEE,MADAwtC,EAAAR,aAAA,CAAkB,QAAlB;AAA4B,CAAA,CAA5B,CACO,CAAU,EAAV,GAAAhtC,CAAA,CAAe,IAAf,CAAuB0gC,CAAA,CAAQ1gC,CAAR,CAAgBgqC,UAAA,CAAWhqC,CAAX,CAE9CwtC,EAAAR,aAAA,CAAkB,QAAlB,CAA4B,CAAA,CAA5B,CACA,OAAOxuC,EAPwB,CAAnC,CAWAgvC,EAAAa,YAAA3uC,KAAA,CAAsB,QAAQ,CAACM,CAAD,CAAQ,CACpC,MAAOwtC,EAAAQ,SAAA,CAAchuC,CAAd,CAAA,CAAuB,EAAvB,CAA4B,EAA5B,CAAiCA,CADJ,CAAtC,CAIA,IAAI4H,CAAAigC,IAAJ,CAAc,CACZ,IAAIA,EAAMmC,UAAA,CAAWpiC,CAAAigC,IAAX,CACNmT,EAAAA,CAAeA,QAAQ,CAACh7C,CAAD,CAAQ,CACjC,GAAI,CAACwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAL,EAA6BA,CAA7B,CAAqC6nC,CAArC,CAEE,MADA2F,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACOxuC,CAAAA,CAEPgvC,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACA,OAAOhtC,EANwB,CAUnCwtC,EAAAc,SAAA5uC,KAAA,CAAmBs7C,CAAnB,CACAxN,EAAAa,YAAA3uC,KAAA,CAAsBs7C,CAAtB,CAbY,CAgBd,GAAIpzC,CAAAyd,IAAJ,CAAc,CACZ,IAAIA,EAAM2kB,UAAA,CAAWpiC,CAAAyd,IAAX,CACN41B,EAAAA,CAAeA,QAAQ,CAACj7C,CAAD,CAAQ,CACjC,GAAI,CAACwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAL,EAA6BA,CAA7B,CAAqCqlB,CAArC,CAEE,MADAmoB,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACOxuC,CAAAA,CAEPgvC,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACA,OAAOhtC,EANwB,CAUnCwtC,EAAAc,SAAA5uC,KAAA,CAAmBu7C,CAAnB,CACAzN,EAAAa,YAAA3uC,KAAA,CAAsBu7C,CAAtB,CAbY,CAgBdzN,CAAAa,YAAA3uC,KAAA,CAAsB,QAAQ,CAACM,CAAD,CAAQ,CAEpC,GAAIwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAJ;AAA4B6B,EAAA,CAAS7B,CAAT,CAA5B,CAEE,MADAwtC,EAAAR,aAAA,CAAkB,QAAlB,CAA4B,CAAA,CAA5B,CACOhtC,CAAAA,CAEPwtC,EAAAR,aAAA,CAAkB,QAAlB,CAA4B,CAAA,CAA5B,CACA,OAAOxuC,EAP2B,CAAtC,CAlDuE,CAjgBzD,KA+jBhB08C,QAAqB,CAAC9yC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B13B,CAA7B,CAAuC8V,CAAvC,CAAiD,CACpE2hB,EAAA,CAAcnlC,CAAd,CAAqB5C,CAArB,CAA8BoC,CAA9B,CAAoC4lC,CAApC,CAA0C13B,CAA1C,CAAoD8V,CAApD,CAEIuvB,EAAAA,CAAeA,QAAQ,CAACn7C,CAAD,CAAQ,CACjC,GAAIwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAJ,EAA4B26C,EAAAhyC,KAAA,CAAgB3I,CAAhB,CAA5B,CAEE,MADAwtC,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACOhtC,CAAAA,CAEPwtC,EAAAR,aAAA,CAAkB,KAAlB,CAAyB,CAAA,CAAzB,CACA,OAAOxuC,EANwB,CAUnCgvC,EAAAa,YAAA3uC,KAAA,CAAsBy7C,CAAtB,CACA3N,EAAAc,SAAA5uC,KAAA,CAAmBy7C,CAAnB,CAdoE,CA/jBtD,OAglBhBC,QAAuB,CAAChzC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B13B,CAA7B,CAAuC8V,CAAvC,CAAiD,CACtE2hB,EAAA,CAAcnlC,CAAd,CAAqB5C,CAArB,CAA8BoC,CAA9B,CAAoC4lC,CAApC,CAA0C13B,CAA1C,CAAoD8V,CAApD,CAEIyvB,EAAAA,CAAiBA,QAAQ,CAACr7C,CAAD,CAAQ,CACnC,GAAIwtC,CAAAQ,SAAA,CAAchuC,CAAd,CAAJ,EAA4B46C,EAAAjyC,KAAA,CAAkB3I,CAAlB,CAA5B,CAEE,MADAwtC,EAAAR,aAAA,CAAkB,OAAlB,CAA2B,CAAA,CAA3B,CACOhtC,CAAAA,CAEPwtC,EAAAR,aAAA,CAAkB,OAAlB,CAA2B,CAAA,CAA3B,CACA,OAAOxuC,EAN0B,CAUrCgvC,EAAAa,YAAA3uC,KAAA,CAAsB27C,CAAtB,CACA7N,EAAAc,SAAA5uC,KAAA,CAAmB27C,CAAnB,CAdsE,CAhlBxD,OAimBhBC,QAAuB,CAAClzC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB;AAAuB4lC,CAAvB,CAA6B,CAE9C9rC,CAAA,CAAYkG,CAAAN,KAAZ,CAAJ,EACE9B,CAAAoC,KAAA,CAAa,MAAb,CAAqB3H,EAAA,EAArB,CAGFuF,EAAAhD,GAAA,CAAW,OAAX,CAAoB,QAAQ,EAAG,CACzBgD,CAAA,CAAQ,CAAR,CAAA+1C,QAAJ,EACEnzC,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtBilC,CAAAG,cAAA,CAAmB/lC,CAAA5H,MAAnB,CADsB,CAAxB,CAF2B,CAA/B,CAQAwtC,EAAAM,QAAA,CAAeC,QAAQ,EAAG,CAExBvoC,CAAA,CAAQ,CAAR,CAAA+1C,QAAA,CADY3zC,CAAA5H,MACZ,EAA+BwtC,CAAAE,WAFP,CAK1B9lC,EAAA0b,SAAA,CAAc,OAAd,CAAuBkqB,CAAAM,QAAvB,CAnBkD,CAjmBpC,UAunBhB0N,QAA0B,CAACpzC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CAAA,IACjDiO,EAAY7zC,CAAA8zC,YADqC,CAEjDC,EAAa/zC,CAAAg0C,aAEZ78C,EAAA,CAAS08C,CAAT,CAAL,GAA0BA,CAA1B,CAAsC,CAAA,CAAtC,CACK18C,EAAA,CAAS48C,CAAT,CAAL,GAA2BA,CAA3B,CAAwC,CAAA,CAAxC,CAEAn2C,EAAAhD,GAAA,CAAW,OAAX,CAAoB,QAAQ,EAAG,CAC7B4F,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtBilC,CAAAG,cAAA,CAAmBnoC,CAAA,CAAQ,CAAR,CAAA+1C,QAAnB,CADsB,CAAxB,CAD6B,CAA/B,CAMA/N,EAAAM,QAAA,CAAeC,QAAQ,EAAG,CACxBvoC,CAAA,CAAQ,CAAR,CAAA+1C,QAAA,CAAqB/N,CAAAE,WADG,CAK1BF,EAAAQ,SAAA,CAAgB6N,QAAQ,CAAC77C,CAAD,CAAQ,CAC9B,MAAOA,EAAP,GAAiBy7C,CADa,CAIhCjO,EAAAa,YAAA3uC,KAAA,CAAsB,QAAQ,CAACM,CAAD,CAAQ,CACpC,MAAOA,EAAP;AAAiBy7C,CADmB,CAAtC,CAIAjO,EAAAc,SAAA5uC,KAAA,CAAmB,QAAQ,CAACM,CAAD,CAAQ,CACjC,MAAOA,EAAA,CAAQy7C,CAAR,CAAoBE,CADM,CAAnC,CA1BqD,CAvnBvC,QAqXJr6C,CArXI,QAsXJA,CAtXI,QAuXJA,CAvXI,OAwXLA,CAxXK,CAhEhB,CAk1BIw6C,GAAiB,CAAC,UAAD,CAAa,UAAb,CAAyB,QAAQ,CAAClwB,CAAD,CAAW9V,CAAX,CAAqB,CACzE,MAAO,UACK,GADL,SAEI,UAFJ,MAGC0E,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CACrCA,CAAJ,EACG,CAAAsN,EAAA,CAAUx1C,CAAA,CAAUsC,CAAAgG,KAAV,CAAV,CAAA,EAAmCktC,EAAA1zB,KAAnC,EAAmDhf,CAAnD,CAA0D5C,CAA1D,CAAmEoC,CAAnE,CAAyE4lC,CAAzE,CAA+E13B,CAA/E,CACmD8V,CADnD,CAFsC,CAHtC,CADkE,CAAtD,CAl1BrB,CA+1BI8f,GAAc,UA/1BlB,CAg2BID,GAAgB,YAh2BpB,CAi2BIgB,GAAiB,aAj2BrB,CAk2BIW,GAAc,UAl2BlB,CA4/BI2O,GAAoB,CAAC,QAAD,CAAW,mBAAX,CAAgC,QAAhC,CAA0C,UAA1C,CAAsD,QAAtD,CACpB,QAAQ,CAACh4B,CAAD,CAASvH,CAAT,CAA4BsD,CAA5B,CAAmCvB,CAAnC,CAA6CnB,CAA7C,CAAqD,CA4D/DkuB,QAASA,EAAc,CAACC,CAAD,CAAUC,CAAV,CAA8B,CACnDA,CAAA,CAAqBA,CAAA,CAAqB,GAArB,CAA2BxiC,EAAA,CAAWwiC,CAAX,CAA+B,GAA/B,CAA3B,CAAiE,EACtFjtB,EAAAqK,YAAA,EACe2iB,CAAA,CAAUE,EAAV,CAA0BC,EADzC,EACwDF,CADxD,CAAAhtB,SAAA,EAEY+sB,CAAA,CAAUG,EAAV,CAAwBD,EAFpC,EAEqDD,CAFrD,CAFmD,CA1DrD,IAAAwQ,YAAA,CADA,IAAAtO,WACA,CADkB1yB,MAAAihC,IAElB;IAAA3N,SAAA,CAAgB,EAChB,KAAAD,YAAA,CAAmB,EACnB,KAAA6N,qBAAA,CAA4B,EAC5B,KAAA7P,UAAA,CAAiB,CAAA,CACjB,KAAAD,OAAA,CAAc,CAAA,CACd,KAAAE,OAAA,CAAc,CAAA,CACd,KAAAC,SAAA,CAAgB,CAAA,CAChB,KAAAL,MAAA,CAAapsB,CAAAxY,KAVkD,KAY3D60C,EAAa/+B,CAAA,CAAO0C,CAAAs8B,QAAP,CAZ8C,CAa3DC,EAAaF,CAAA14B,OAEjB,IAAI,CAAC44B,CAAL,CACE,KAAM59C,EAAA,CAAO,SAAP,CAAA,CAAkB,WAAlB,CACFqhB,CAAAs8B,QADE,CACa72C,EAAA,CAAYgZ,CAAZ,CADb,CAAN,CAaF,IAAAuvB,QAAA,CAAexsC,CAiBf,KAAA0sC,SAAA,CAAgBsO,QAAQ,CAACt8C,CAAD,CAAQ,CAC9B,MAAO0B,EAAA,CAAY1B,CAAZ,CAAP,EAAuC,EAAvC,GAA6BA,CAA7B,EAAuD,IAAvD,GAA6CA,CAA7C,EAA+DA,CAA/D,GAAyEA,CAD3C,CA9C+B,KAkD3D4rC,EAAartB,CAAAg+B,cAAA,CAAuB,iBAAvB,CAAb3Q,EAA0DC,EAlDC,CAmD3DC,EAAe,CAnD4C,CAoD3DE,EAAS,IAAAA,OAATA,CAAuB,EAI3BztB,EAAAC,SAAA,CAAkBiuB,EAAlB,CACAnB,EAAA,CAAe,CAAA,CAAf,CA4BA,KAAA0B,aAAA,CAAoBwP,QAAQ,CAAChR,CAAD,CAAqBD,CAArB,CAA8B,CACpDS,CAAA,CAAOR,CAAP,CAAJ,GAAmC,CAACD,CAApC,GAEIA,CAAJ,EACMS,CAAA,CAAOR,CAAP,CACJ,EADgCM,CAAA,EAChC,CAAKA,CAAL,GACER,CAAA,CAAe,CAAA,CAAf,CAEA,CADA,IAAAgB,OACA,CADc,CAAA,CACd,CAAA,IAAAC,SAAA,CAAgB,CAAA,CAHlB,CAFF,GAQEjB,CAAA,CAAe,CAAA,CAAf,CAGA;AAFA,IAAAiB,SAEA,CAFgB,CAAA,CAEhB,CADA,IAAAD,OACA,CADc,CAAA,CACd,CAAAR,CAAA,EAXF,CAiBA,CAHAE,CAAA,CAAOR,CAAP,CAGA,CAH6B,CAACD,CAG9B,CAFAD,CAAA,CAAeC,CAAf,CAAwBC,CAAxB,CAEA,CAAAI,CAAAoB,aAAA,CAAwBxB,CAAxB,CAA4CD,CAA5C,CAAqD,IAArD,CAnBA,CADwD,CAkC1D,KAAA8B,aAAA,CAAoBoP,QAAS,EAAG,CAC9B,IAAArQ,OAAA,CAAc,CAAA,CACd,KAAAC,UAAA,CAAiB,CAAA,CACjB9tB,EAAAqK,YAAA,CAAqBwkB,EAArB,CAAA5uB,SAAA,CAA2CiuB,EAA3C,CAH8B,CAuBhC,KAAAkB,cAAA,CAAqB+O,QAAQ,CAAC18C,CAAD,CAAQ,CACnC,IAAA0tC,WAAA,CAAkB1tC,CAGd,KAAAqsC,UAAJ,GACE,IAAAD,OAGA,CAHc,CAAA,CAGd,CAFA,IAAAC,UAEA,CAFiB,CAAA,CAEjB,CADA9tB,CAAAqK,YAAA,CAAqB6jB,EAArB,CAAAjuB,SAAA,CAA8C4uB,EAA9C,CACA,CAAAxB,CAAAsB,UAAA,EAJF,CAOAjuC,EAAA,CAAQ,IAAAqvC,SAAR,CAAuB,QAAQ,CAAChqC,CAAD,CAAK,CAClCtE,CAAA,CAAQsE,CAAA,CAAGtE,CAAH,CAD0B,CAApC,CAII,KAAAg8C,YAAJ,GAAyBh8C,CAAzB,GACE,IAAAg8C,YAEA,CAFmBh8C,CAEnB,CADAq8C,CAAA,CAAWt4B,CAAX,CAAmB/jB,CAAnB,CACA,CAAAf,CAAA,CAAQ,IAAAi9C,qBAAR,CAAmC,QAAQ,CAACllC,CAAD,CAAW,CACpD,GAAI,CACFA,CAAA,EADE,CAEF,MAAMpR,CAAN,CAAS,CACT4W,CAAA,CAAkB5W,CAAlB,CADS,CAHyC,CAAtD,CAHF,CAfmC,CA6BrC,KAAI4nC,EAAO,IAEXzpB,EAAA1gB,OAAA,CAAcs5C,QAAqB,EAAG,CACpC,IAAI38C;AAAQm8C,CAAA,CAAWp4B,CAAX,CAGZ,IAAIypB,CAAAwO,YAAJ,GAAyBh8C,CAAzB,CAAgC,CAAA,IAE1B48C,EAAapP,CAAAa,YAFa,CAG1Bzf,EAAMguB,CAAA/9C,OAGV,KADA2uC,CAAAwO,YACA,CADmBh8C,CACnB,CAAM4uB,CAAA,EAAN,CAAA,CACE5uB,CAAA,CAAQ48C,CAAA,CAAWhuB,CAAX,CAAA,CAAgB5uB,CAAhB,CAGNwtC,EAAAE,WAAJ,GAAwB1tC,CAAxB,GACEwtC,CAAAE,WACA,CADkB1tC,CAClB,CAAAwtC,CAAAM,QAAA,EAFF,CAV8B,CAJI,CAAtC,CA7K+D,CADzC,CA5/BxB,CA0uCI+O,GAAmBA,QAAQ,EAAG,CAChC,MAAO,SACI,CAAC,SAAD,CAAY,QAAZ,CADJ,YAEOd,EAFP,MAGCvhC,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuBk1C,CAAvB,CAA8B,CAAA,IAGtCC,EAAYD,CAAA,CAAM,CAAN,CAH0B,CAItCE,EAAWF,CAAA,CAAM,CAAN,CAAXE,EAAuBnR,EAE3BmR,EAAAxQ,YAAA,CAAqBuQ,CAArB,CAEAv3C,EAAAhD,GAAA,CAAW,UAAX,CAAuB,QAAQ,EAAG,CAChCw6C,CAAApQ,eAAA,CAAwBmQ,CAAxB,CADgC,CAAlC,CAR0C,CAHvC,CADyB,CA1uClC,CA+yCIE,GAAoBx7C,EAAA,CAAQ,SACrB,SADqB,MAExB+Y,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CACzCA,CAAA0O,qBAAAx8C,KAAA,CAA+B,QAAQ,EAAG,CACxC0I,CAAA83B,MAAA,CAAYt4B,CAAAs1C,SAAZ,CADwC,CAA1C,CADyC,CAFb,CAAR,CA/yCxB,CAyzCIC,GAAoBA,QAAQ,EAAG,CACjC,MAAO,SACI,UADJ,MAEC3iC,QAAQ,CAACpS,CAAD,CAAQkN,CAAR,CAAa1N,CAAb,CAAmB4lC,CAAnB,CAAyB,CACrC,GAAKA,CAAL,CAAA,CACA5lC,CAAAw1C,SAAA;AAAgB,CAAA,CAEhB,KAAIC,EAAYA,QAAQ,CAACr9C,CAAD,CAAQ,CAC9B,GAAI4H,CAAAw1C,SAAJ,EAAqB5P,CAAAQ,SAAA,CAAchuC,CAAd,CAArB,CACEwtC,CAAAR,aAAA,CAAkB,UAAlB,CAA8B,CAAA,CAA9B,CADF,KAKE,OADAQ,EAAAR,aAAA,CAAkB,UAAlB,CAA8B,CAAA,CAA9B,CACOhtC,CAAAA,CANqB,CAUhCwtC,EAAAa,YAAA3uC,KAAA,CAAsB29C,CAAtB,CACA7P,EAAAc,SAAA7tC,QAAA,CAAsB48C,CAAtB,CAEAz1C,EAAA0b,SAAA,CAAc,UAAd,CAA0B,QAAQ,EAAG,CACnC+5B,CAAA,CAAU7P,CAAAE,WAAV,CADmC,CAArC,CAhBA,CADqC,CAFlC,CAD0B,CAzzCnC,CAq4CI4P,GAAkBA,QAAQ,EAAG,CAC/B,MAAO,SACI,SADJ,MAEC9iC,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CACzC,IACIvkC,GADAjD,CACAiD,CADQ,UAAAxB,KAAA,CAAgBG,CAAA21C,OAAhB,CACRt0C,GAAyBxF,MAAJ,CAAWuC,CAAA,CAAM,CAAN,CAAX,CAArBiD,EAA6CrB,CAAA21C,OAA7Ct0C,EAA4D,GAiBhEukC,EAAAc,SAAA5uC,KAAA,CAfYyF,QAAQ,CAACq4C,CAAD,CAAY,CAE9B,GAAI,CAAA97C,CAAA,CAAY87C,CAAZ,CAAJ,CAAA,CAEA,IAAI56C,EAAO,EAEP46C,EAAJ,EACEv+C,CAAA,CAAQu+C,CAAAj3C,MAAA,CAAgB0C,CAAhB,CAAR,CAAoC,QAAQ,CAACjJ,CAAD,CAAQ,CAC9CA,CAAJ,EAAW4C,CAAAlD,KAAA,CAAU0P,EAAA,CAAKpP,CAAL,CAAV,CADuC,CAApD,CAKF,OAAO4C,EAVP,CAF8B,CAehC,CACA4qC,EAAAa,YAAA3uC,KAAA,CAAsB,QAAQ,CAACM,CAAD,CAAQ,CACpC,MAAIhB,EAAA,CAAQgB,CAAR,CAAJ,CACSA,CAAAM,KAAA,CAAW,IAAX,CADT;AAIO9B,CAL6B,CAAtC,CASAgvC,EAAAQ,SAAA,CAAgB6N,QAAQ,CAAC77C,CAAD,CAAQ,CAC9B,MAAO,CAACA,CAAR,EAAiB,CAACA,CAAAnB,OADY,CA7BS,CAFtC,CADwB,CAr4CjC,CA66CI4+C,GAAwB,oBA76C5B,CAg+CIC,GAAmBA,QAAQ,EAAG,CAChC,MAAO,UACK,GADL,SAEIr1C,QAAQ,CAACs1C,CAAD,CAAMC,CAAN,CAAe,CAC9B,MAAIH,GAAA90C,KAAA,CAA2Bi1C,CAAAC,QAA3B,CAAJ,CACSC,QAA4B,CAAC11C,CAAD,CAAQkN,CAAR,CAAa1N,CAAb,CAAmB,CACpDA,CAAA+d,KAAA,CAAU,OAAV,CAAmBvd,CAAA83B,MAAA,CAAYt4B,CAAAi2C,QAAZ,CAAnB,CADoD,CADxD,CAKSE,QAAoB,CAAC31C,CAAD,CAAQkN,CAAR,CAAa1N,CAAb,CAAmB,CAC5CQ,CAAA/E,OAAA,CAAauE,CAAAi2C,QAAb,CAA2BG,QAAyB,CAACh+C,CAAD,CAAQ,CAC1D4H,CAAA+d,KAAA,CAAU,OAAV,CAAmB3lB,CAAnB,CAD0D,CAA5D,CAD4C,CANlB,CAF3B,CADyB,CAh+ClC,CAkiDIi+C,GAAkB7S,EAAA,CAAY,QAAQ,CAAChjC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAC/DpC,CAAAgZ,SAAA,CAAiB,YAAjB,CAAAhW,KAAA,CAAoC,UAApC,CAAgDZ,CAAAs2C,OAAhD,CACA91C,EAAA/E,OAAA,CAAauE,CAAAs2C,OAAb,CAA0BC,QAA0B,CAACn+C,CAAD,CAAQ,CAC1DwF,CAAA4hB,KAAA,CAAapnB,CAAA,EAASxB,CAAT,CAAqB,EAArB,CAA0BwB,CAAvC,CAD0D,CAA5D,CAF+D,CAA3C,CAliDtB,CA0lDIo+C,GAA0B,CAAC,cAAD,CAAiB,QAAQ,CAACnhC,CAAD,CAAe,CACpE,MAAO,SAAQ,CAAC7U,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAEhCyf,CAAAA,CAAgBpK,CAAA,CAAazX,CAAAoC,KAAA,CAAaA,CAAAkY,MAAAu+B,eAAb,CAAb,CACpB74C,EAAAgZ,SAAA,CAAiB,YAAjB,CAAAhW,KAAA,CAAoC,UAApC;AAAgD6e,CAAhD,CACAzf,EAAA0b,SAAA,CAAc,gBAAd,CAAgC,QAAQ,CAACtjB,CAAD,CAAQ,CAC9CwF,CAAA4hB,KAAA,CAAapnB,CAAb,CAD8C,CAAhD,CAJoC,CAD8B,CAAxC,CA1lD9B,CAynDIs+C,GAAsB,CAAC,MAAD,CAAS,QAAT,CAAmB,QAAQ,CAAChhC,CAAD,CAAOF,CAAP,CAAe,CAClE,MAAO,SAAQ,CAAChV,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACpCpC,CAAAgZ,SAAA,CAAiB,YAAjB,CAAAhW,KAAA,CAAoC,UAApC,CAAgDZ,CAAA22C,WAAhD,CAEA,KAAI7zB,EAAStN,CAAA,CAAOxV,CAAA22C,WAAP,CAGbn2C,EAAA/E,OAAA,CAFAm7C,QAAuB,EAAG,CAAE,MAAQz8C,CAAA2oB,CAAA,CAAOtiB,CAAP,CAAArG,EAAiB,EAAjBA,UAAA,EAAV,CAE1B,CAA6B08C,QAA8B,CAACz+C,CAAD,CAAQ,CACjEwF,CAAAG,KAAA,CAAa2X,CAAAohC,eAAA,CAAoBh0B,CAAA,CAAOtiB,CAAP,CAApB,CAAb,EAAmD,EAAnD,CADiE,CAAnE,CANoC,CAD4B,CAA1C,CAznD1B,CAo1DIu2C,GAAmB9P,EAAA,CAAe,EAAf,CAAmB,CAAA,CAAnB,CAp1DvB,CAo4DI+P,GAAsB/P,EAAA,CAAe,KAAf,CAAsB,CAAtB,CAp4D1B,CAo7DIgQ,GAAuBhQ,EAAA,CAAe,MAAf,CAAuB,CAAvB,CAp7D3B,CA6+DIiQ,GAAmB1T,EAAA,CAAY,SACxB/iC,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB,CAC/BA,CAAA+d,KAAA,CAAU,SAAV,CAAqBnnB,CAArB,CACAgH,EAAAojB,YAAA,CAAoB,UAApB,CAF+B,CADA,CAAZ,CA7+DvB,CAqpEIm2B,GAAwB,CAAC,QAAQ,EAAG,CACtC,MAAO,OACE,CAAA,CADF,YAEO,GAFP,CAD+B,CAAZ,CArpE5B,CA6rEIC,GAAiB,CAAC,UAAD,CAAa,QAAQ,CAAClpC,CAAD,CAAW,CACnD,MAAO,UACK,GADL;QAEIzN,QAAQ,EAAG,CAClByN,CAAAykB,IAAA,CAAe,CAAA,CADG,CAFf,CAD4C,CAAhC,CA7rErB,CAyuEI0kB,GAAoB,EACxBhgD,EAAA,CACE,6IAAA,MAAA,CAAA,GAAA,CADF,CAEE,QAAQ,CAACqI,CAAD,CAAO,CACb,IAAIib,EAAgBvC,EAAA,CAAmB,KAAnB,CAA2B1Y,CAA3B,CACpB23C,GAAA,CAAkB18B,CAAlB,CAAA,CAAmC,CAAC,QAAD,CAAW,QAAQ,CAACnF,CAAD,CAAS,CAC7D,MAAO,SAAQ,CAAChV,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACpC,IAAItD,EAAK8Y,CAAA,CAAOxV,CAAA,CAAK2a,CAAL,CAAP,CACT/c,EAAAhD,GAAA,CAAW8C,CAAA,CAAUgC,CAAV,CAAX,CAA4B,QAAQ,CAACyI,CAAD,CAAQ,CAC1C3H,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtBjE,CAAA,CAAG8D,CAAH,CAAU,QAAQ2H,CAAR,CAAV,CADsB,CAAxB,CAD0C,CAA5C,CAFoC,CADuB,CAA5B,CAFtB,CAFjB,CA8XA,KAAImvC,GAAgB,CAAC,UAAD,CAAa,QAAQ,CAAC3hC,CAAD,CAAW,CAClD,MAAO,YACO,SADP,UAEK,GAFL,UAGK,CAAA,CAHL,UAIK,GAJL,SAKIlV,QAAS,CAAC7C,CAAD,CAAUoC,CAAV,CAAgBuX,CAAhB,CAA4B,CAC5C,MAAO,SAAS,CAAC4E,CAAD,CAASxF,CAAT,CAAmBuB,CAAnB,CAA0B,CAAA,IACpCq/B,CADoC;AACtBtgC,CAClBkF,EAAA1gB,OAAA,CAAcyc,CAAAs/B,KAAd,CAA0BC,QAAwB,CAACr/C,CAAD,CAAQ,CACpDm/C,CAAJ,GACE5hC,CAAAm1B,MAAA,CAAeyM,CAAf,CACA,CAAAA,CAAA,CAAe3gD,CAFjB,CAIIqgB,EAAJ,GACEA,CAAAtQ,SAAA,EACA,CAAAsQ,CAAA,CAAargB,CAFf,CAII4G,GAAA,CAAUpF,CAAV,CAAJ,GACE6e,CACA,CADakF,CAAA7E,KAAA,EACb,CAAAC,CAAA,CAAWN,CAAX,CAAuB,QAAS,CAACnZ,CAAD,CAAQ,CACtCy5C,CAAA,CAAez5C,CACf6X,EAAAg1B,MAAA,CAAe7sC,CAAf,CAAsB6Y,CAAAnd,OAAA,EAAtB,CAAyCmd,CAAzC,CAFsC,CAAxC,CAFF,CATwD,CAA1D,CAFwC,CADE,CALzC,CAD2C,CAAhC,CAApB,CAoLI+gC,GAAqB,CAAC,OAAD,CAAU,gBAAV,CAA4B,eAA5B,CAA6C,UAA7C,CAAyD,UAAzD,CAAqE,MAArE,CACP,QAAQ,CAACpiC,CAAD,CAAUC,CAAV,CAA4BoiC,CAA5B,CAA6CC,CAA7C,CAAyDjiC,CAAzD,CAAqED,CAArE,CAA2E,CACnG,MAAO,UACK,KADL,UAEK,GAFL,UAGK,CAAA,CAHL,YAIO,SAJP,SAKIjV,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB63C,CAAhB,CAA8B,CAAA,IACzCC,EAAS93C,CAAA+3C,UAATD,EAA2B93C,CAAAjE,IADc,CAEzCi8C,EAAYh4C,CAAA0oB,OAAZsvB,EAA2B,EAFc,CAGzCC,EAAgBj4C,CAAAk4C,WAEpB,OAAO,SAAQ,CAAC13C,CAAD,CAAQmW,CAAR,CAAkB,CAAA,IAC3BsZ,EAAgB,CADW,CAE3BgJ,CAF2B,CAG3Bkf,CAH2B,CAK3BC,EAA4BA,QAAQ,EAAG,CACrCnf,CAAJ,GACEA,CAAAtyB,SAAA,EACA,CAAAsyB,CAAA,CAAe,IAFjB,CAIGkf,EAAH,GACExiC,CAAAm1B,MAAA,CAAeqN,CAAf,CACA,CAAAA,CAAA,CAAiB,IAFnB,CALyC,CAW3C33C,EAAA/E,OAAA,CAAaia,CAAA2iC,mBAAA,CAAwBP,CAAxB,CAAb;AAA8CQ,QAA6B,CAACv8C,CAAD,CAAM,CAC/E,IAAIw8C,EAAe,EAAEtoB,CAEjBl0B,EAAJ,EACEuZ,CAAAzK,IAAA,CAAU9O,CAAV,CAAe,OAAQwZ,CAAR,CAAf,CAAAiJ,QAAA,CAAgD,QAAQ,CAACK,CAAD,CAAW,CACjE,GAAI05B,CAAJ,GAAqBtoB,CAArB,CAAA,CACA,IAAIuoB,EAAWh4C,CAAA8W,KAAA,EAEfugC,EAAA,CAAaW,CAAb,CAAuB,QAAQ,CAAC16C,CAAD,CAAQ,CACrCs6C,CAAA,EAEAnf,EAAA,CAAeuf,CACfL,EAAA,CAAiBr6C,CAEjBq6C,EAAAp6C,KAAA,CAAoB8gB,CAApB,CACAlJ,EAAAg1B,MAAA,CAAewN,CAAf,CAA+B,IAA/B,CAAqCxhC,CAArC,CACAihC,EAAA,CAASO,CAAAj7B,SAAA,EAAT,CAAA,CAAoC+b,CAApC,CAEI,EAAAl/B,CAAA,CAAUk+C,CAAV,CAAJ,EAAkCA,CAAlC,EAAmD,CAAAz3C,CAAA83B,MAAA,CAAY2f,CAAZ,CAAnD,EACEN,CAAA,EAGF1e,EAAAJ,MAAA,CAAmB,uBAAnB,CACAr4B,EAAA83B,MAAA,CAAY0f,CAAZ,CAfqC,CAAvC,CAHA,CADiE,CAAnE,CAAAzpC,MAAA,CAqBS,QAAQ,EAAG,CACdgqC,CAAJ,GAAqBtoB,CAArB,EAAoCmoB,CAAA,EADlB,CArBpB,CAwBA,CAAA53C,CAAAq4B,MAAA,CAAY,0BAAZ,CAzBF,EA2BEuf,CAAA,EA9B6E,CAAjF,CAhB+B,CALY,CAL1C,CAD4F,CAD5E,CApLzB,CAoSIK,GAAkBjV,EAAA,CAAY,SACvB/iC,QAAQ,EAAG,CAClB,MAAO,KACA4Z,QAAQ,CAAC7Z,CAAD,CAAQ5C,CAAR,CAAiB+Z,CAAjB,CAAwB,CACnCnX,CAAA83B,MAAA,CAAY3gB,CAAA+gC,OAAZ,CADmC,CADhC,CADW,CADY,CAAZ,CApStB,CA+UIC,GAAyBnV,EAAA,CAAY,UAAY,CAAA,CAAZ,UAA4B,GAA5B,CAAZ,CA/U7B,CAyfIoV,GAAuB,CAAC,SAAD,CAAY,cAAZ,CAA4B,QAAQ,CAACla,CAAD,CAAUrpB,CAAV,CAAwB,CACrF,IAAIwjC,EAAQ,KACZ,OAAO,UACK,IADL;KAECjmC,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAAA,IAC/B84C,EAAY94C,CAAA6qB,MADmB,CAE/BkuB,EAAU/4C,CAAAkY,MAAA6N,KAAVgzB,EAA6Bn7C,CAAAoC,KAAA,CAAaA,CAAAkY,MAAA6N,KAAb,CAFE,CAG/BriB,EAAS1D,CAAA0D,OAATA,EAAwB,CAHO,CAI/Bs1C,EAAQx4C,CAAA83B,MAAA,CAAYygB,CAAZ,CAARC,EAAgC,EAJD,CAK/BC,EAAc,EALiB,CAM/Bj3B,EAAc3M,CAAA2M,YAAA,EANiB,CAO/BC,EAAY5M,CAAA4M,UAAA,EAPmB,CAQ/Bi3B,EAAS,oBAEb7hD,EAAA,CAAQ2I,CAAR,CAAc,QAAQ,CAACuiB,CAAD,CAAa42B,CAAb,CAA4B,CAC5CD,CAAAn4C,KAAA,CAAYo4C,CAAZ,CAAJ,GACEH,CAAA,CAAMt7C,CAAA,CAAUy7C,CAAA96C,QAAA,CAAsB,MAAtB,CAA8B,EAA9B,CAAAA,QAAA,CAA0C,OAA1C,CAAmD,GAAnD,CAAV,CAAN,CADF,CAEIT,CAAAoC,KAAA,CAAaA,CAAAkY,MAAA,CAAWihC,CAAX,CAAb,CAFJ,CADgD,CAAlD,CAMA9hD,EAAA,CAAQ2hD,CAAR,CAAe,QAAQ,CAACz2B,CAAD,CAAa/qB,CAAb,CAAkB,CACvCyhD,CAAA,CAAYzhD,CAAZ,CAAA,CACE6d,CAAA,CAAakN,CAAAlkB,QAAA,CAAmBw6C,CAAnB,CAA0B72B,CAA1B,CAAwC82B,CAAxC,CAAoD,GAApD,CACXp1C,CADW,CACFue,CADE,CAAb,CAFqC,CAAzC,CAMAzhB,EAAA/E,OAAA,CAAa29C,QAAyB,EAAG,CACvC,IAAIhhD,EAAQgqC,UAAA,CAAW5hC,CAAA83B,MAAA,CAAYwgB,CAAZ,CAAX,CAEZ,IAAKvgB,KAAA,CAAMngC,CAAN,CAAL,CAME,MAAO,EAHDA,EAAN,GAAe4gD,EAAf,GAAuB5gD,CAAvB,CAA+BsmC,CAAAjT,UAAA,CAAkBrzB,CAAlB,CAA0BsL,CAA1B,CAA/B,CACC,OAAOu1C,EAAA,CAAY7gD,CAAZ,CAAA,CAAmBoI,CAAnB,CAA0B5C,CAA1B,CAAmC,CAAA,CAAnC,CAP6B,CAAzC,CAWGy7C,QAA+B,CAACviB,CAAD,CAAS,CACzCl5B,CAAA4hB,KAAA,CAAasX,CAAb,CADyC,CAX3C,CAtBmC,CAFhC,CAF8E,CAA5D,CAzf3B,CAovBIwiB,GAAoB,CAAC,QAAD,CAAW,UAAX,CAAuB,QAAQ,CAAC9jC,CAAD;AAASG,CAAT,CAAmB,CA2LxE4jC,QAASA,EAAgB,CAACj2C,CAAD,CAAQ,CAC/B,GAAIA,CAAAk2C,UAAJ,GAAwBl2C,CAAAm2C,QAAxB,CACE,MAAO57C,EAAA,CAAOyF,CAAAk2C,UAAP,CAGT,KAAI57C,EAAU0F,CAAAk2C,UAAd,CACIn6C,EAAW,CAACzB,CAAD,CAEf,GAAG,CACDA,CAAA,CAAUA,CAAA8b,YACV,IAAI,CAAC9b,CAAL,CAAc,KACdyB,EAAAvH,KAAA,CAAc8F,CAAd,CAHC,CAAH,MAISA,CAJT,GAIqB0F,CAAAm2C,QAJrB,CAMA,OAAO57C,EAAA,CAAOwB,CAAP,CAdwB,CAzLjC,IAAIq6C,EAAiB7iD,CAAA,CAAO,UAAP,CACrB,OAAO,YACO,SADP,UAEK,GAFL,UAGK,CAAA,CAHL,SAII4J,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB25C,CAAhB,CAAwB,CACvC,MAAO,SAAQ,CAACx9B,CAAD,CAASxF,CAAT,CAAmBuB,CAAnB,CAAyB,CACtC,IAAIqK,EAAarK,CAAA0hC,SAAjB,CACIx7C,EAAQmkB,CAAAnkB,MAAA,CAAiB,qDAAjB,CADZ,CAEcy7C,CAFd,CAEgCC,CAFhC,CAEgDC,CAFhD,CAEkEC,CAFlE,CAGOC,CAHP,CAGYC,CAHZ,CAG6BC,CAH7B,CAIEC,EAAe,KAAMlxC,EAAN,CAEjB,IAAI,CAAC9K,CAAL,CACE,KAAMs7C,EAAA,CAAe,MAAf,CACJn3B,CADI,CAAN,CAIF83B,CAAA,CAAMj8C,CAAA,CAAM,CAAN,CACN67C,EAAA,CAAM77C,CAAA,CAAM,CAAN,CAGN,EAFAk8C,CAEA,CAFal8C,CAAA,CAAM,CAAN,CAEb,GACEy7C,CACA,CADmBrkC,CAAA,CAAO8kC,CAAP,CACnB,CAAAR,CAAA,CAAiBA,QAAQ,CAACtiD,CAAD,CAAMY,CAAN,CAAaE,CAAb,CAAoB,CAEvC6hD,CAAJ,GAAmBC,CAAA,CAAaD,CAAb,CAAnB,CAAiD3iD,CAAjD,CACA4iD,EAAA,CAAaF,CAAb,CAAA,CAAgC9hD,CAChCgiD,EAAAjT,OAAA,CAAsB7uC,CACtB,OAAOuhD,EAAA,CAAiB19B,CAAjB;AAAyBi+B,CAAzB,CALoC,CAF/C,GAUEL,CAGA,CAHmBA,QAAQ,CAACviD,CAAD,CAAMY,CAAN,CAAa,CACtC,MAAO8Q,GAAA,CAAQ9Q,CAAR,CAD+B,CAGxC,CAAA4hD,CAAA,CAAiBA,QAAQ,CAACxiD,CAAD,CAAM,CAC7B,MAAOA,EADsB,CAbjC,CAkBA4G,EAAA,CAAQi8C,CAAAj8C,MAAA,CAAU,+CAAV,CACR,IAAI,CAACA,CAAL,CACE,KAAMs7C,EAAA,CAAe,QAAf,CACoDW,CADpD,CAAN,CAGFH,CAAA,CAAkB97C,CAAA,CAAM,CAAN,CAAlB,EAA8BA,CAAA,CAAM,CAAN,CAC9B+7C,EAAA,CAAgB/7C,CAAA,CAAM,CAAN,CAOhB,KAAIm8C,EAAe,EAGnBp+B,EAAA8a,iBAAA,CAAwBgjB,CAAxB,CAA6BO,QAAuB,CAACC,CAAD,CAAY,CAAA,IAC1DniD,CAD0D,CACnDrB,CADmD,CAE1DyjD,EAAe/jC,CAAA,CAAS,CAAT,CAF2C,CAG1DgkC,CAH0D,CAM1DC,EAAe,EAN2C,CAO1DC,CAP0D,CAQ1D5jC,CAR0D,CAS1Dzf,CAT0D,CASrDY,CATqD,CAY1D0iD,CAZ0D,CAa1Dx3C,CAb0D,CAc1Dy3C,EAAiB,EAIrB,IAAIjkD,EAAA,CAAY2jD,CAAZ,CAAJ,CACEK,CACA,CADiBL,CACjB,CAAAO,CAAA,CAAclB,CAAd,EAAgCC,CAFlC,KAGO,CACLiB,CAAA,CAAclB,CAAd,EAAgCE,CAEhCc,EAAA,CAAiB,EACjB,KAAKtjD,CAAL,GAAYijD,EAAZ,CACMA,CAAA/iD,eAAA,CAA0BF,CAA1B,CAAJ,EAAuD,GAAvD,EAAsCA,CAAA+E,OAAA,CAAW,CAAX,CAAtC,EACEu+C,CAAAhjD,KAAA,CAAoBN,CAApB,CAGJsjD,EAAA/iD,KAAA,EATK,CAYP8iD,CAAA,CAAcC,CAAA7jD,OAGdA,EAAA,CAAS8jD,CAAA9jD,OAAT,CAAiC6jD,CAAA7jD,OACjC,KAAIqB,CAAJ,CAAY,CAAZ,CAAeA,CAAf,CAAuBrB,CAAvB,CAA+BqB,CAAA,EAA/B,CAKC,GAJAd,CAIG,CAJIijD,CAAD,GAAgBK,CAAhB,CAAkCxiD,CAAlC,CAA0CwiD,CAAA,CAAexiD,CAAf,CAI7C,CAHHF,CAGG,CAHKqiD,CAAA,CAAWjjD,CAAX,CAGL,CAFHyjD,CAEG,CAFSD,CAAA,CAAYxjD,CAAZ,CAAiBY,CAAjB,CAAwBE,CAAxB,CAET,CADH0J,EAAA,CAAwBi5C,CAAxB,CAAmC,eAAnC,CACG,CAAAV,CAAA7iD,eAAA,CAA4BujD,CAA5B,CAAH,CACE33C,CAGA,CAHQi3C,CAAA,CAAaU,CAAb,CAGR,CAFA,OAAOV,CAAA,CAAaU,CAAb,CAEP,CADAL,CAAA,CAAaK,CAAb,CACA;AAD0B33C,CAC1B,CAAAy3C,CAAA,CAAeziD,CAAf,CAAA,CAAwBgL,CAJ1B,KAKO,CAAA,GAAIs3C,CAAAljD,eAAA,CAA4BujD,CAA5B,CAAJ,CAML,KAJA5jD,EAAA,CAAQ0jD,CAAR,CAAwB,QAAQ,CAACz3C,CAAD,CAAQ,CAClCA,CAAJ,EAAaA,CAAAk2C,UAAb,GAA8Be,CAAA,CAAaj3C,CAAA43C,GAAb,CAA9B,CAAuD53C,CAAvD,CADsC,CAAxC,CAIM,CAAAo2C,CAAA,CAAe,OAAf,CACiIn3B,CADjI,CACmJ04B,CADnJ,CAAN,CAIAF,CAAA,CAAeziD,CAAf,CAAA,CAAwB,IAAM2iD,CAAN,CACxBL,EAAA,CAAaK,CAAb,CAAA,CAA0B,CAAA,CAXrB,CAgBR,IAAKzjD,CAAL,GAAY+iD,EAAZ,CAEMA,CAAA7iD,eAAA,CAA4BF,CAA5B,CAAJ,GACE8L,CAIA,CAJQi3C,CAAA,CAAa/iD,CAAb,CAIR,CAHA0oB,CAGA,CAHmBq5B,CAAA,CAAiBj2C,CAAjB,CAGnB,CAFAqS,CAAAm1B,MAAA,CAAe5qB,CAAf,CAEA,CADA7oB,CAAA,CAAQ6oB,CAAR,CAA0B,QAAQ,CAACtiB,CAAD,CAAU,CAAEA,CAAA,aAAA,CAAsB,CAAA,CAAxB,CAA5C,CACA,CAAA0F,CAAA9C,MAAAmG,SAAA,EALF,CAUGrO,EAAA,CAAQ,CAAb,KAAgBrB,CAAhB,CAAyB6jD,CAAA7jD,OAAzB,CAAgDqB,CAAhD,CAAwDrB,CAAxD,CAAgEqB,CAAA,EAAhE,CAAyE,CACvEd,CAAA,CAAOijD,CAAD,GAAgBK,CAAhB,CAAkCxiD,CAAlC,CAA0CwiD,CAAA,CAAexiD,CAAf,CAChDF,EAAA,CAAQqiD,CAAA,CAAWjjD,CAAX,CACR8L,EAAA,CAAQy3C,CAAA,CAAeziD,CAAf,CACJyiD,EAAA,CAAeziD,CAAf,CAAuB,CAAvB,CAAJ,GAA+BoiD,CAA/B,CAA8CK,CAAA,CAAeziD,CAAf,CAAuB,CAAvB,CAAAmhD,QAA9C,CAEA,IAAIn2C,CAAAk2C,UAAJ,CAAqB,CAGnBviC,CAAA,CAAa3T,CAAA9C,MAEbm6C,EAAA,CAAWD,CACX,GACEC,EAAA,CAAWA,CAAAjhC,YADb,OAEQihC,CAFR,EAEoBA,CAAA,aAFpB,CAIIr3C,EAAAk2C,UAAJ,EAAuBmB,CAAvB,EAIEhlC,CAAAo1B,KAAA,CAAcwO,CAAA,CAAiBj2C,CAAjB,CAAd,CAAuC,IAAvC,CAA6CzF,CAAA,CAAO68C,CAAP,CAA7C,CAEFA,EAAA,CAAep3C,CAAAm2C,QAhBI,CAArB,IAmBExiC,EAAA,CAAakF,CAAA7E,KAAA,EAGfL,EAAA,CAAWijC,CAAX,CAAA,CAA8B9hD,CAC1B+hD,EAAJ,GAAmBljC,CAAA,CAAWkjC,CAAX,CAAnB,CAA+C3iD,CAA/C,CACAyf,EAAAkwB,OAAA,CAAoB7uC,CACpB2e,EAAAkkC,OAAA;AAA+B,CAA/B,GAAqB7iD,CACrB2e,EAAAmkC,MAAA,CAAoB9iD,CAApB,GAA+BuiD,CAA/B,CAA6C,CAC7C5jC,EAAAokC,QAAA,CAAqB,EAAEpkC,CAAAkkC,OAAF,EAAuBlkC,CAAAmkC,MAAvB,CACrBnkC,EAAAqkC,KAAA,CAAkB,EAAErkC,CAAAskC,MAAF,CAA8B,CAA9B,EAAqBjjD,CAArB,CAA2B,CAA3B,CAEbgL,EAAAk2C,UAAL,EACEG,CAAA,CAAO1iC,CAAP,CAAmB,QAAQ,CAACnZ,CAAD,CAAQ,CACjCA,CAAA,CAAMA,CAAA7G,OAAA,EAAN,CAAA,CAAwBN,CAAAomB,cAAA,CAAuB,iBAAvB,CAA2CwF,CAA3C,CAAwD,GAAxD,CACxB5M,EAAAg1B,MAAA,CAAe7sC,CAAf,CAAsB,IAAtB,CAA4BD,CAAA,CAAO68C,CAAP,CAA5B,CACAA,EAAA,CAAe58C,CACfwF,EAAA9C,MAAA,CAAcyW,CACd3T,EAAAk2C,UAAA,CAAkBkB,CAAA,EAAgBA,CAAAjB,QAAhB,CAAuCiB,CAAAjB,QAAvC,CAA8D37C,CAAA,CAAM,CAAN,CAChFwF,EAAAm2C,QAAA,CAAgB37C,CAAA,CAAMA,CAAA7G,OAAN,CAAqB,CAArB,CAChB2jD,EAAA,CAAat3C,CAAA43C,GAAb,CAAA,CAAyB53C,CAPQ,CAAnC,CArCqE,CAgDzEi3C,CAAA,CAAeK,CA3H+C,CAAhE,CAlDsC,CADD,CAJpC,CAHiE,CAAlD,CApvBxB,CAglCIY,GAAkB,CAAC,UAAD,CAAa,QAAQ,CAAC7lC,CAAD,CAAW,CACpD,MAAO,SAAQ,CAACnV,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACpCQ,CAAA/E,OAAA,CAAauE,CAAAy7C,OAAb,CAA0BC,QAA0B,CAACtjD,CAAD,CAAO,CACzDud,CAAA,CAASnY,EAAA,CAAUpF,CAAV,CAAA,CAAmB,aAAnB,CAAmC,UAA5C,CAAA,CAAwDwF,CAAxD,CAAiE,SAAjE,CADyD,CAA3D,CADoC,CADc,CAAhC,CAhlCtB,CAwuCI+9C,GAAkB,CAAC,UAAD,CAAa,QAAQ,CAAChmC,CAAD,CAAW,CACpD,MAAO,SAAQ,CAACnV,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CACpCQ,CAAA/E,OAAA,CAAauE,CAAA47C,OAAb,CAA0BC,QAA0B,CAACzjD,CAAD,CAAO,CACzDud,CAAA,CAASnY,EAAA,CAAUpF,CAAV,CAAA;AAAmB,UAAnB,CAAgC,aAAzC,CAAA,CAAwDwF,CAAxD,CAAiE,SAAjE,CADyD,CAA3D,CADoC,CADc,CAAhC,CAxuCtB,CAsxCIk+C,GAAmBtY,EAAA,CAAY,QAAQ,CAAChjC,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAChEQ,CAAA/E,OAAA,CAAauE,CAAA+7C,QAAb,CAA2BC,QAA2B,CAACC,CAAD,CAAYC,CAAZ,CAAuB,CACvEA,CAAJ,EAAkBD,CAAlB,GAAgCC,CAAhC,EACE7kD,CAAA,CAAQ6kD,CAAR,CAAmB,QAAQ,CAACl/C,CAAD,CAAMu/B,CAAN,CAAa,CAAE3+B,CAAAsqC,IAAA,CAAY3L,CAAZ,CAAmB,EAAnB,CAAF,CAAxC,CAEE0f,EAAJ,EAAer+C,CAAAsqC,IAAA,CAAY+T,CAAZ,CAJ4D,CAA7E,CAKG,CAAA,CALH,CADgE,CAA3C,CAtxCvB,CAy5CIE,GAAoB,CAAC,UAAD,CAAa,QAAQ,CAACxmC,CAAD,CAAW,CACtD,MAAO,UACK,IADL,SAEI,UAFJ,YAKO,CAAC,QAAD,CAAWymC,QAA2B,EAAG,CACpD,IAAAC,MAAA,CAAa,EADuC,CAAzC,CALP,MAQCzpC,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuBo8C,CAAvB,CAA2C,CAAA,IAEnDE,CAFmD,CAGnDC,CAHmD,CAInDC,EAAiB,EAErBh8C,EAAA/E,OAAA,CALgBuE,CAAAy8C,SAKhB,EALiCz8C,CAAApF,GAKjC,CAAwB8hD,QAA4B,CAACtkD,CAAD,CAAQ,CAC1D,IAD0D,IACjDH,EAAG,CAD8C,CAC3CiT,EAAGsxC,CAAAvlD,OAAlB,CAAyCgB,CAAzC,CAA2CiT,CAA3C,CAA+CjT,CAAA,EAA/C,CACEukD,CAAA,CAAevkD,CAAf,CAAA0O,SAAA,EACA,CAAAgP,CAAAm1B,MAAA,CAAeyR,CAAA,CAAiBtkD,CAAjB,CAAf,CAGFskD,EAAA,CAAmB,EACnBC,EAAA,CAAiB,EAEjB,IAAKF,CAAL,CAA2BF,CAAAC,MAAA,CAAyB,GAAzB,CAA+BjkD,CAA/B,CAA3B,EAAoEgkD,CAAAC,MAAA,CAAyB,GAAzB,CAApE,CACE77C,CAAA83B,MAAA,CAAYt4B,CAAA28C,OAAZ,CACA,CAAAtlD,CAAA,CAAQilD,CAAR,CAA6B,QAAQ,CAACM,CAAD,CAAqB,CACxD,IAAIC,EAAgBr8C,CAAA8W,KAAA,EACpBklC;CAAA1kD,KAAA,CAAoB+kD,CAApB,CACAD,EAAArlC,WAAA,CAA8BslC,CAA9B,CAA6C,QAAQ,CAACC,CAAD,CAAc,CACjE,IAAIC,EAASH,CAAAh/C,QAEb2+C,EAAAzkD,KAAA,CAAsBglD,CAAtB,CACAnnC,EAAAg1B,MAAA,CAAemS,CAAf,CAA4BC,CAAAvjD,OAAA,EAA5B,CAA6CujD,CAA7C,CAJiE,CAAnE,CAHwD,CAA1D,CAXwD,CAA5D,CANuD,CARpD,CAD+C,CAAhC,CAz5CxB,CAm8CIC,GAAwBxZ,EAAA,CAAY,YAC1B,SAD0B,UAE5B,GAF4B,SAG7B,WAH6B,SAI7B/iC,QAAQ,CAAC7C,CAAD,CAAU+Z,CAAV,CAAiBJ,CAAjB,CAA6B,CAC5C,MAAO,SAAQ,CAAC/W,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CAC1CA,CAAAyW,MAAA,CAAW,GAAX,CAAiB1kC,CAAAslC,aAAjB,CAAA,CAAwCrX,CAAAyW,MAAA,CAAW,GAAX,CAAiB1kC,CAAAslC,aAAjB,CAAxC,EAAgF,EAChFrX,EAAAyW,MAAA,CAAW,GAAX,CAAiB1kC,CAAAslC,aAAjB,CAAAnlD,KAAA,CAA0C,YAAcyf,CAAd,SAAmC3Z,CAAnC,CAA1C,CAF0C,CADA,CAJR,CAAZ,CAn8C5B,CA+8CIs/C,GAA2B1Z,EAAA,CAAY,YAC7B,SAD6B,UAE/B,GAF+B,SAGhC,WAHgC,SAIhC/iC,QAAQ,CAAC7C,CAAD,CAAU+Z,CAAV,CAAiBJ,CAAjB,CAA6B,CAC5C,MAAO,SAAQ,CAAC/W,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB4lC,CAAvB,CAA6B,CAC1CA,CAAAyW,MAAA,CAAW,GAAX,CAAA,CAAmBzW,CAAAyW,MAAA,CAAW,GAAX,CAAnB,EAAsC,EACtCzW,EAAAyW,MAAA,CAAW,GAAX,CAAAvkD,KAAA,CAAqB,YAAcyf,CAAd;QAAmC3Z,CAAnC,CAArB,CAF0C,CADA,CAJL,CAAZ,CA/8C/B,CA8gDIu/C,GAAwB3Z,EAAA,CAAY,YAC1B,CAAC,UAAD,CAAa,aAAb,CAA4B,QAAQ,CAAC7sB,CAAD,CAAWymC,CAAX,CAAwB,CACtE,GAAI,CAACA,CAAL,CACE,KAAMvmD,EAAA,CAAO,cAAP,CAAA,CAAuB,QAAvB,CAIF8G,EAAA,CAAYgZ,CAAZ,CAJE,CAAN,CAUF,IAAAymC,YAAA,CAAmBA,CAZmD,CAA5D,CAD0B,MAgBhCxqC,QAAQ,CAACuJ,CAAD,CAASxF,CAAT,CAAmB0mC,CAAnB,CAA2BroC,CAA3B,CAAuC,CACnDA,CAAAooC,YAAA,CAAuB,QAAQ,CAACt/C,CAAD,CAAQ,CACrC6Y,CAAA5Y,KAAA,CAAc,EAAd,CACA4Y,EAAAzY,OAAA,CAAgBJ,CAAhB,CAFqC,CAAvC,CADmD,CAhBf,CAAZ,CA9gD5B,CAmkDIw/C,GAAkB,CAAC,gBAAD,CAAmB,QAAQ,CAAC/nC,CAAD,CAAiB,CAChE,MAAO,UACK,GADL,UAEK,CAAA,CAFL,SAGI9U,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB,CACd,kBAAjB,EAAIA,CAAAgG,KAAJ,EAKEuP,CAAAlM,IAAA,CAJkBrJ,CAAAk7C,GAIlB,CAFWt9C,CAAA,CAAQ,CAAR,CAAA4hB,KAEX,CAN6B,CAH5B,CADyD,CAA5C,CAnkDtB,CAmlDI+9B,GAAkB1mD,CAAA,CAAO,WAAP,CAnlDtB,CAgtDI2mD,GAAqB3jD,EAAA,CAAQ,UAAY,CAAA,CAAZ,CAAR,CAhtDzB,CAitDI4jD,GAAkB,CAAC,UAAD,CAAa,QAAb,CAAuB,QAAQ,CAAC7F,CAAD,CAAapiC,CAAb,CAAqB,CAAA,IAEpEkoC,EAAoB,8KAFgD;AAGpEC,EAAgB,eAAgBjkD,CAAhB,CAEpB,OAAO,UACK,GADL,SAEI,CAAC,QAAD,CAAW,UAAX,CAFJ,YAGO,CAAC,UAAD,CAAa,QAAb,CAAuB,QAAvB,CAAiC,QAAQ,CAACid,CAAD,CAAWwF,CAAX,CAAmBkhC,CAAnB,CAA2B,CAAA,IAC1E5gD,EAAO,IADmE,CAE1EmhD,EAAa,EAF6D,CAG1EC,EAAcF,CAH4D,CAK1EG,CAGJrhD,EAAAshD,UAAA,CAAiBV,CAAA7I,QAGjB/3C,EAAAuhD,KAAA,CAAYC,QAAQ,CAACC,CAAD,CAAeC,CAAf,CAA4BC,CAA5B,CAA4C,CAC9DP,CAAA,CAAcK,CAEdJ,EAAA,CAAgBM,CAH8C,CAOhE3hD,EAAA4hD,UAAA,CAAiBC,QAAQ,CAAClmD,CAAD,CAAQ,CAC/B4J,EAAA,CAAwB5J,CAAxB,CAA+B,gBAA/B,CACAwlD,EAAA,CAAWxlD,CAAX,CAAA,CAAoB,CAAA,CAEhBylD,EAAA/X,WAAJ,EAA8B1tC,CAA9B,GACEue,CAAA3Z,IAAA,CAAa5E,CAAb,CACA,CAAI0lD,CAAAtkD,OAAA,EAAJ,EAA4BskD,CAAAtqC,OAAA,EAF9B,CAJ+B,CAWjC/W,EAAA8hD,aAAA,CAAoBC,QAAQ,CAACpmD,CAAD,CAAQ,CAC9B,IAAAqmD,UAAA,CAAermD,CAAf,CAAJ,GACE,OAAOwlD,CAAA,CAAWxlD,CAAX,CACP,CAAIylD,CAAA/X,WAAJ,EAA8B1tC,CAA9B,EACE,IAAAsmD,oBAAA,CAAyBtmD,CAAzB,CAHJ,CADkC,CAUpCqE,EAAAiiD,oBAAA,CAA2BC,QAAQ,CAAC3hD,CAAD,CAAM,CACnC4hD,CAAAA,CAAa,IAAbA,CAAoB11C,EAAA,CAAQlM,CAAR,CAApB4hD,CAAmC,IACvCd,EAAA9gD,IAAA,CAAkB4hD,CAAlB,CACAjoC,EAAA+yB,QAAA,CAAiBoU,CAAjB,CACAnnC,EAAA3Z,IAAA,CAAa4hD,CAAb,CACAd,EAAAn8B,KAAA,CAAmB,UAAnB;AAA+B,CAAA,CAA/B,CALuC,CASzCllB,EAAAgiD,UAAA,CAAiBI,QAAQ,CAACzmD,CAAD,CAAQ,CAC/B,MAAOwlD,EAAAlmD,eAAA,CAA0BU,CAA1B,CADwB,CAIjC+jB,EAAAwc,IAAA,CAAW,UAAX,CAAuB,QAAQ,EAAG,CAEhCl8B,CAAAiiD,oBAAA,CAA2BhlD,CAFK,CAAlC,CApD8E,CAApE,CAHP,MA6DCkZ,QAAQ,CAACpS,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuBk1C,CAAvB,CAA8B,CAkD1C4J,QAASA,EAAM,CAACt+C,CAAD,CAAQu+C,CAAR,CAAuBlB,CAAvB,CAAoCmB,CAApC,CAAgD,CAC7DnB,CAAA3X,QAAA,CAAsB+Y,QAAQ,EAAG,CAC/B,IAAIrJ,EAAYiI,CAAA/X,WAEZkZ,EAAAP,UAAA,CAAqB7I,CAArB,CAAJ,EACMkI,CAAAtkD,OAAA,EAEJ,EAF4BskD,CAAAtqC,OAAA,EAE5B,CADAurC,CAAA/hD,IAAA,CAAkB44C,CAAlB,CACA,CAAkB,EAAlB,GAAIA,CAAJ,EAAsBsJ,CAAAv9B,KAAA,CAAiB,UAAjB,CAA6B,CAAA,CAA7B,CAHxB,EAKM7nB,CAAA,CAAY87C,CAAZ,CAAJ,EAA8BsJ,CAA9B,CACEH,CAAA/hD,IAAA,CAAkB,EAAlB,CADF,CAGEgiD,CAAAN,oBAAA,CAA+B9I,CAA/B,CAX2B,CAgBjCmJ,EAAAnkD,GAAA,CAAiB,QAAjB,CAA2B,QAAQ,EAAG,CACpC4F,CAAAG,OAAA,CAAa,QAAQ,EAAG,CAClBm9C,CAAAtkD,OAAA,EAAJ,EAA4BskD,CAAAtqC,OAAA,EAC5BqqC,EAAA9X,cAAA,CAA0BgZ,CAAA/hD,IAAA,EAA1B,CAFsB,CAAxB,CADoC,CAAtC,CAjB6D,CAyB/DmiD,QAASA,EAAQ,CAAC3+C,CAAD,CAAQu+C,CAAR,CAAuBnZ,CAAvB,CAA6B,CAC5C,IAAIwZ,CACJxZ,EAAAM,QAAA,CAAeC,QAAQ,EAAG,CACxB,IAAIkZ,EAAQ,IAAIj2C,EAAJ,CAAYw8B,CAAAE,WAAZ,CACZzuC,EAAA,CAAQ0nD,CAAAlkD,KAAA,CAAmB,QAAnB,CAAR;AAAsC,QAAQ,CAAC+tC,CAAD,CAAS,CACrDA,CAAAC,SAAA,CAAkB9uC,CAAA,CAAUslD,CAAAx0C,IAAA,CAAU+9B,CAAAxwC,MAAV,CAAV,CADmC,CAAvD,CAFwB,CAS1BoI,EAAA/E,OAAA,CAAa6jD,QAA4B,EAAG,CACrCrjD,EAAA,CAAOmjD,CAAP,CAAiBxZ,CAAAE,WAAjB,CAAL,GACEsZ,CACA,CADW/jD,EAAA,CAAKuqC,CAAAE,WAAL,CACX,CAAAF,CAAAM,QAAA,EAFF,CAD0C,CAA5C,CAOA6Y,EAAAnkD,GAAA,CAAiB,QAAjB,CAA2B,QAAQ,EAAG,CACpC4F,CAAAG,OAAA,CAAa,QAAQ,EAAG,CACtB,IAAIzF,EAAQ,EACZ7D,EAAA,CAAQ0nD,CAAAlkD,KAAA,CAAmB,QAAnB,CAAR,CAAsC,QAAQ,CAAC+tC,CAAD,CAAS,CACjDA,CAAAC,SAAJ,EACE3tC,CAAApD,KAAA,CAAW8wC,CAAAxwC,MAAX,CAFmD,CAAvD,CAKAwtC,EAAAG,cAAA,CAAmB7qC,CAAnB,CAPsB,CAAxB,CADoC,CAAtC,CAlB4C,CA+B9CqkD,QAASA,EAAO,CAAC/+C,CAAD,CAAQu+C,CAAR,CAAuBnZ,CAAvB,CAA6B,CAoG3C4Z,QAASA,EAAM,EAAG,CAAA,IACZC,EAAe,CAAC,EAAD,CAAI,EAAJ,CADH,CAEZC,EAAmB,CAAC,EAAD,CAFP,CAGZC,CAHY,CAIZC,CAJY,CAKZhX,CALY,CAMZiX,CANY,CAMIC,CAChBC,EAAAA,CAAana,CAAAwO,YACb/yB,EAAAA,CAAS2+B,CAAA,CAASx/C,CAAT,CAAT6gB,EAA4B,EARhB,KASZxpB,EAAOooD,CAAA,CAAUroD,EAAA,CAAWypB,CAAX,CAAV,CAA+BA,CAT1B,CAWCpqB,CAXD,CAYZipD,CAZY,CAYA5nD,CACZqT,EAAAA,CAAS,EAETw0C,EAAAA,CAAc,CAAA,CAfF,KAgBZC,CAhBY,CAiBZxiD,CAGJ,IAAI+qC,CAAJ,CACE,GAAI0X,CAAJ,EAAejpD,CAAA,CAAQ2oD,CAAR,CAAf,CAEE,IADAI,CACSG,CADK,IAAIl3C,EAAJ,CAAY,EAAZ,CACLk3C,CAAAA,CAAAA,CAAa,CAAtB,CAAyBA,CAAzB,CAAsCP,CAAA9oD,OAAtC,CAAyDqpD,CAAA,EAAzD,CACE30C,CAAA,CAAO40C,CAAP,CACA,CADoBR,CAAA,CAAWO,CAAX,CACpB,CAAAH,CAAA92C,IAAA,CAAgBg3C,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAAhB,CAAwCo0C,CAAA,CAAWO,CAAX,CAAxC,CAJJ,KAOEH,EAAA,CAAc,IAAI/2C,EAAJ,CAAY22C,CAAZ,CAKlB,KAAKznD,CAAL,CAAa,CAAb,CAAgBrB,CAAA,CAASY,CAAAZ,OAAT;AAAsBqB,CAAtB,CAA8BrB,CAA9C,CAAsDqB,CAAA,EAAtD,CAA+D,CAE7Dd,CAAA,CAAMc,CACN,IAAI2nD,CAAJ,CAAa,CACXzoD,CAAA,CAAMK,CAAA,CAAKS,CAAL,CACN,IAAuB,GAAvB,GAAKd,CAAA+E,OAAA,CAAW,CAAX,CAAL,CAA6B,QAC7BoP,EAAA,CAAOs0C,CAAP,CAAA,CAAkBzoD,CAHP,CAMbmU,CAAA,CAAO40C,CAAP,CAAA,CAAoBl/B,CAAA,CAAO7pB,CAAP,CAEpBmoD,EAAA,CAAkBa,CAAA,CAAUhgD,CAAV,CAAiBmL,CAAjB,CAAlB,EAA8C,EAC9C,EAAMi0C,CAAN,CAAoBH,CAAA,CAAaE,CAAb,CAApB,IACEC,CACA,CADcH,CAAA,CAAaE,CAAb,CACd,CAD8C,EAC9C,CAAAD,CAAA5nD,KAAA,CAAsB6nD,CAAtB,CAFF,CAIIhX,EAAJ,CACEE,CADF,CACasX,CAAA3sC,OAAA,CAAmB6sC,CAAA,CAAUA,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAAV,CAAmC9R,CAAA,CAAQ2G,CAAR,CAAemL,CAAf,CAAtD,CADb,GAC+F/U,CAD/F,EAGMypD,CAAJ,EACMI,CAEJ,CAFgB,EAEhB,CADAA,CAAA,CAAUF,CAAV,CACA,CADuBR,CACvB,CAAAlX,CAAA,CAAWwX,CAAA,CAAQ7/C,CAAR,CAAeigD,CAAf,CAAX,GAAyCJ,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAH3C,EAKEk9B,CALF,CAKakX,CALb,GAK4BlmD,CAAA,CAAQ2G,CAAR,CAAemL,CAAf,CAE5B,CAAAw0C,CAAA,CAAcA,CAAd,EAA6BtX,CAV/B,CAYA6X,EAAA,CAAQC,CAAA,CAAUngD,CAAV,CAAiBmL,CAAjB,CACR+0C,EAAA,CAAQA,CAAA,GAAU9pD,CAAV,CAAsB,EAAtB,CAA2B8pD,CACnCd,EAAA9nD,KAAA,CAAiB,IACXuoD,CAAA,CAAUA,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAAV,CAAoCs0C,CAAA,CAAUpoD,CAAA,CAAKS,CAAL,CAAV,CAAwBA,CADjD,OAERooD,CAFQ,UAGL7X,CAHK,CAAjB,CA9B6D,CAoC1DF,CAAL,GACMiY,CAAJ,EAAiC,IAAjC,GAAkBb,CAAlB,CAEEN,CAAA,CAAa,EAAb,CAAA5mD,QAAA,CAAyB,IAAI,EAAJ,OAAc,EAAd,UAA2B,CAACsnD,CAA5B,CAAzB,CAFF,CAGYA,CAHZ,EAKEV,CAAA,CAAa,EAAb,CAAA5mD,QAAA,CAAyB,IAAI,GAAJ,OAAe,EAAf,UAA4B,CAAA,CAA5B,CAAzB,CANJ,CAWKqnD,EAAA,CAAa,CAAlB,KAAqBW,CAArB,CAAmCnB,CAAAzoD,OAAnC,CACKipD,CADL,CACkBW,CADlB,CAEKX,CAAA,EAFL,CAEmB,CAEjBP,CAAA,CAAkBD,CAAA,CAAiBQ,CAAjB,CAGlBN,EAAA,CAAcH,CAAA,CAAaE,CAAb,CAEVmB,EAAA7pD,OAAJ,EAAgCipD,CAAhC,EAEEL,CAMA,CANiB,SACNkB,CAAAjjD,MAAA,EAAAkC,KAAA,CAA8B,OAA9B,CAAuC2/C,CAAvC,CADM,OAERC,CAAAc,MAFQ,CAMjB,CAFAZ,CAEA,CAFkB,CAACD,CAAD,CAElB;AADAiB,CAAAhpD,KAAA,CAAuBgoD,CAAvB,CACA,CAAAf,CAAA7gD,OAAA,CAAqB2hD,CAAAjiD,QAArB,CARF,GAUEkiD,CAIA,CAJkBgB,CAAA,CAAkBZ,CAAlB,CAIlB,CAHAL,CAGA,CAHiBC,CAAA,CAAgB,CAAhB,CAGjB,CAAID,CAAAa,MAAJ,EAA4Bf,CAA5B,EACEE,CAAAjiD,QAAAoC,KAAA,CAA4B,OAA5B,CAAqC6/C,CAAAa,MAArC,CAA4Df,CAA5D,CAfJ,CAmBAS,EAAA,CAAc,IACV9nD,EAAA,CAAQ,CAAZ,KAAerB,CAAf,CAAwB2oD,CAAA3oD,OAAxB,CAA4CqB,CAA5C,CAAoDrB,CAApD,CAA4DqB,CAAA,EAA5D,CACEswC,CACA,CADSgX,CAAA,CAAYtnD,CAAZ,CACT,CAAA,CAAK0oD,CAAL,CAAsBlB,CAAA,CAAgBxnD,CAAhB,CAAsB,CAAtB,CAAtB,GAEE8nD,CAQA,CARcY,CAAApjD,QAQd,CAPIojD,CAAAN,MAOJ,GAP6B9X,CAAA8X,MAO7B,EANEN,CAAA5gC,KAAA,CAAiBwhC,CAAAN,MAAjB,CAAwC9X,CAAA8X,MAAxC,CAMF,CAJIM,CAAA9F,GAIJ,GAJ0BtS,CAAAsS,GAI1B,EAHEkF,CAAApjD,IAAA,CAAgBgkD,CAAA9F,GAAhB,CAAoCtS,CAAAsS,GAApC,CAGF,CAAIkF,CAAA,CAAY,CAAZ,CAAAvX,SAAJ,GAAgCD,CAAAC,SAAhC,EACEuX,CAAAz+B,KAAA,CAAiB,UAAjB,CAA8Bq/B,CAAAnY,SAA9B,CAAwDD,CAAAC,SAAxD,CAXJ,GAiBoB,EAAlB,GAAID,CAAAsS,GAAJ,EAAwB0F,CAAxB,CAEEhjD,CAFF,CAEYgjD,CAFZ,CAOG5jD,CAAAY,CAAAZ,CAAUikD,CAAAnjD,MAAA,EAAVd,KAAA,CACQ4rC,CAAAsS,GADR,CAAAl7C,KAAA,CAES,UAFT,CAEqB4oC,CAAAC,SAFrB,CAAArpB,KAAA,CAGSopB,CAAA8X,MAHT,CAiBH,CAXAZ,CAAAhoD,KAAA,CAAsC,SACzB8F,CADyB,OAE3BgrC,CAAA8X,MAF2B,IAG9B9X,CAAAsS,GAH8B,UAIxBtS,CAAAC,SAJwB,CAAtC,CAWA,CALIuX,CAAJ,CACEA,CAAAxW,MAAA,CAAkBhsC,CAAlB,CADF,CAGEiiD,CAAAjiD,QAAAM,OAAA,CAA8BN,CAA9B,CAEF,CAAAwiD,CAAA,CAAcxiD,CAzChB,CA8CF,KADAtF,CAAA,EACA,CAAMwnD,CAAA7oD,OAAN;AAA+BqB,CAA/B,CAAA,CACEwnD,CAAAxxC,IAAA,EAAA1Q,QAAA4V,OAAA,EA5Ee,CAgFnB,IAAA,CAAMstC,CAAA7pD,OAAN,CAAiCipD,CAAjC,CAAA,CACEY,CAAAxyC,IAAA,EAAA,CAAwB,CAAxB,CAAA1Q,QAAA4V,OAAA,EAnKc,CAnGlB,IAAIpV,CAEJ,IAAI,EAAGA,CAAH,CAAW8iD,CAAA9iD,MAAA,CAAiBs/C,CAAjB,CAAX,CAAJ,CACE,KAAMH,GAAA,CAAgB,MAAhB,CAEJ2D,CAFI,CAEQvjD,EAAA,CAAYohD,CAAZ,CAFR,CAAN,CAJyC,IASvC4B,EAAYnrC,CAAA,CAAOpX,CAAA,CAAM,CAAN,CAAP,EAAmBA,CAAA,CAAM,CAAN,CAAnB,CAT2B,CAUvCmiD,EAAYniD,CAAA,CAAM,CAAN,CAAZmiD,EAAwBniD,CAAA,CAAM,CAAN,CAVe,CAWvC6hD,EAAU7hD,CAAA,CAAM,CAAN,CAX6B,CAYvCoiD,EAAYhrC,CAAA,CAAOpX,CAAA,CAAM,CAAN,CAAP,EAAmB,EAAnB,CAZ2B,CAavCvE,EAAU2b,CAAA,CAAOpX,CAAA,CAAM,CAAN,CAAA,CAAWA,CAAA,CAAM,CAAN,CAAX,CAAsBmiD,CAA7B,CAb6B,CAcvCP,EAAWxqC,CAAA,CAAOpX,CAAA,CAAM,CAAN,CAAP,CAd4B,CAgBvCiiD,EADQjiD,CAAA+iD,CAAM,CAANA,CACE,CAAQ3rC,CAAA,CAAOpX,CAAA,CAAM,CAAN,CAAP,CAAR,CAA2B,IAhBE,CAoBvC0iD,EAAoB,CAAC,CAAC,SAAU/B,CAAV,OAA+B,EAA/B,CAAD,CAAD,CAEpB6B,EAAJ,GAEEhJ,CAAA,CAASgJ,CAAT,CAAA,CAAqBpgD,CAArB,CAQA,CAJAogD,CAAA5/B,YAAA,CAAuB,UAAvB,CAIA,CAAA4/B,CAAAptC,OAAA,EAVF,CAcAurC,EAAAhhD,KAAA,CAAmB,EAAnB,CAEAghD,EAAAnkD,GAAA,CAAiB,QAAjB,CAA2B,QAAQ,EAAG,CACpC4F,CAAAG,OAAA,CAAa,QAAQ,EAAG,CAAA,IAClBi/C,CADkB,CAElBnF,EAAauF,CAAA,CAASx/C,CAAT,CAAbi6C,EAAgC,EAFd,CAGlB9uC,EAAS,EAHS,CAIlBnU,CAJkB,CAIbY,CAJa,CAISE,CAJT,CAIgB4nD,CAJhB,CAI4BjpD,CAJ5B,CAIoC4pD,CAJpC,CAIiDP,CAEvE,IAAI3X,CAAJ,CAEE,IADAvwC,CACqB,CADb,EACa,CAAhB8nD,CAAgB,CAAH,CAAG,CAAAW,CAAA,CAAcC,CAAA7pD,OAAnC,CACKipD,CADL,CACkBW,CADlB,CAEKX,CAAA,EAFL,CAME,IAFAN,CAEe,CAFDkB,CAAA,CAAkBZ,CAAlB,CAEC,CAAX5nD,CAAW,CAAH,CAAG,CAAArB,CAAA,CAAS2oD,CAAA3oD,OAAxB,CAA4CqB,CAA5C,CAAoDrB,CAApD,CAA4DqB,CAAA,EAA5D,CACE,IAAI,CAAC8oD,CAAD,CAAiBxB,CAAA,CAAYtnD,CAAZ,CAAAsF,QAAjB,EAA6C,CAA7C,CAAAirC,SAAJ,CAA8D,CAC5DrxC,CAAA,CAAM4pD,CAAApkD,IAAA,EACFijD;CAAJ,GAAat0C,CAAA,CAAOs0C,CAAP,CAAb,CAA+BzoD,CAA/B,CACA,IAAI6oD,CAAJ,CACE,IAAKC,CAAL,CAAkB,CAAlB,CAAqBA,CAArB,CAAkC7F,CAAAxjD,OAAlC,GACE0U,CAAA,CAAO40C,CAAP,CACI,CADgB9F,CAAA,CAAW6F,CAAX,CAChB,CAAAD,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAAA,EAA0BnU,CAFhC,EAAqD8oD,CAAA,EAArD,EADF,IAME30C,EAAA,CAAO40C,CAAP,CAAA,CAAoB9F,CAAA,CAAWjjD,CAAX,CAEtBY,EAAAN,KAAA,CAAW+B,CAAA,CAAQ2G,CAAR,CAAemL,CAAf,CAAX,CAX4D,CAA9D,CATN,IA0BE,IADAnU,CACI,CADEunD,CAAA/hD,IAAA,EACF,CAAO,GAAP,EAAAxF,CAAJ,CACEY,CAAA,CAAQxB,CADV,KAEO,IAAW,EAAX,EAAIY,CAAJ,CACLY,CAAA,CAAQ,IADH,KAGL,IAAIioD,CAAJ,CACE,IAAKC,CAAL,CAAkB,CAAlB,CAAqBA,CAArB,CAAkC7F,CAAAxjD,OAAlC,CAAqDqpD,CAAA,EAArD,CAEE,IADA30C,CAAA,CAAO40C,CAAP,CACI,CADgB9F,CAAA,CAAW6F,CAAX,CAChB,CAAAD,CAAA,CAAQ7/C,CAAR,CAAemL,CAAf,CAAA,EAA0BnU,CAA9B,CAAmC,CACjCY,CAAA,CAAQyB,CAAA,CAAQ2G,CAAR,CAAemL,CAAf,CACR,MAFiC,CAAnC,CAHJ,IASEA,EAAA,CAAO40C,CAAP,CAEA,CAFoB9F,CAAA,CAAWjjD,CAAX,CAEpB,CADIyoD,CACJ,GADat0C,CAAA,CAAOs0C,CAAP,CACb,CAD+BzoD,CAC/B,EAAAY,CAAA,CAAQyB,CAAA,CAAQ2G,CAAR,CAAemL,CAAf,CAIdi6B,EAAAG,cAAA,CAAmB3tC,CAAnB,CApDsB,CAAxB,CADoC,CAAtC,CAyDAwtC,EAAAM,QAAA,CAAesZ,CAGfh/C,EAAA/E,OAAA,CAAa+jD,CAAb,CAlG2C,CAxG7C,GAAKtK,CAAA,CAAM,CAAN,CAAL,CAAA,CAF0C,IAItC8J,EAAa9J,CAAA,CAAM,CAAN,CAJyB,CAKtC2I,EAAc3I,CAAA,CAAM,CAAN,CALwB,CAMtCvM,EAAW3oC,CAAA2oC,SAN2B,CAOtCuY,EAAalhD,CAAAqhD,UAPyB,CAQtCT,EAAa,CAAA,CARyB,CAStC1B,CATsC,CAYtC+B,EAAiBpjD,CAAA,CAAOlH,CAAAwO,cAAA,CAAuB,QAAvB,CAAP,CAZqB,CAatC47C,EAAkBljD,CAAA,CAAOlH,CAAAwO,cAAA,CAAuB,UAAvB,CAAP,CAboB,CActC24C,EAAgBmD,CAAAnjD,MAAA,EAGZ7F,EAAAA,CAAI,CAAZ,KAjB0C,IAiB3BwM,EAAW7G,CAAA6G,SAAA,EAjBgB,CAiBIyG,EAAKzG,CAAAxN,OAAnD,CAAoEgB,CAApE,CAAwEiT,CAAxE,CAA4EjT,CAAA,EAA5E,CACE,GAAyB,EAAzB,EAAIwM,CAAA,CAASxM,CAAT,CAAAG,MAAJ,CAA6B,CAC3B8mD,CAAA;AAAc0B,CAAd,CAA2Bn8C,CAAAgS,GAAA,CAAYxe,CAAZ,CAC3B,MAF2B,CAM/B+mD,CAAAhB,KAAA,CAAgBH,CAAhB,CAA6B+C,CAA7B,CAAyC9C,CAAzC,CAGA,IAAInV,CAAJ,GAAiB3oC,CAAAw1C,SAAjB,EAAkCx1C,CAAAshD,WAAlC,EAAoD,CAClD,IAAIC,EAAoBA,QAAQ,CAACnpD,CAAD,CAAQ,CACtCylD,CAAAzY,aAAA,CAAyB,UAAzB,CAAqC,CAACplC,CAAAw1C,SAAtC,EAAwDp9C,CAAxD,EAAiEA,CAAAnB,OAAjE,CACA,OAAOmB,EAF+B,CAKxCylD,EAAAnX,SAAA5uC,KAAA,CAA0BypD,CAA1B,CACA1D,EAAApX,YAAA5tC,QAAA,CAAgC0oD,CAAhC,CAEAvhD,EAAA0b,SAAA,CAAc,UAAd,CAA0B,QAAQ,EAAG,CACnC6lC,CAAA,CAAkB1D,CAAA/X,WAAlB,CADmC,CAArC,CATkD,CAchDob,CAAJ,CAAgB3B,CAAA,CAAQ/+C,CAAR,CAAe5C,CAAf,CAAwBigD,CAAxB,CAAhB,CACSlV,CAAJ,CAAcwW,CAAA,CAAS3+C,CAAT,CAAgB5C,CAAhB,CAAyBigD,CAAzB,CAAd,CACAiB,CAAA,CAAOt+C,CAAP,CAAc5C,CAAd,CAAuBigD,CAAvB,CAAoCmB,CAApC,CAzCL,CAF0C,CA7DvC,CALiE,CAApD,CAjtDtB,CA4oEIwC,GAAkB,CAAC,cAAD,CAAiB,QAAQ,CAACnsC,CAAD,CAAe,CAC5D,IAAIosC,EAAiB,WACR/nD,CADQ,cAELA,CAFK,CAKrB,OAAO,UACK,GADL,UAEK,GAFL,SAGI+G,QAAQ,CAAC7C,CAAD,CAAUoC,CAAV,CAAgB,CAC/B,GAAIlG,CAAA,CAAYkG,CAAA5H,MAAZ,CAAJ,CAA6B,CAC3B,IAAIqnB,EAAgBpK,CAAA,CAAazX,CAAA4hB,KAAA,EAAb,CAA6B,CAAA,CAA7B,CACfC,EAAL,EACEzf,CAAA+d,KAAA,CAAU,OAAV,CAAmBngB,CAAA4hB,KAAA,EAAnB,CAHyB,CAO7B,MAAO,SAAS,CAAChf,CAAD,CAAQ5C,CAAR,CAAiBoC,CAAjB,CAAuB,CAAA,IAEjCxG,EAASoE,CAAApE,OAAA,EAFwB;AAGjCwlD,EAAaxlD,CAAAoH,KAAA,CAFI8gD,mBAEJ,CAAb1C,EACExlD,CAAAA,OAAA,EAAAoH,KAAA,CAHe8gD,mBAGf,CAEF1C,EAAJ,EAAkBA,CAAAjB,UAAlB,CAGEngD,CAAA+jB,KAAA,CAAa,UAAb,CAAyB,CAAA,CAAzB,CAHF,CAKEq9B,CALF,CAKeyC,CAGXhiC,EAAJ,CACEjf,CAAA/E,OAAA,CAAagkB,CAAb,CAA4BkiC,QAA+B,CAAC7qB,CAAD,CAASC,CAAT,CAAiB,CAC1E/2B,CAAA+d,KAAA,CAAU,OAAV,CAAmB+Y,CAAnB,CACIA,EAAJ,GAAeC,CAAf,EAAuBioB,CAAAT,aAAA,CAAwBxnB,CAAxB,CACvBioB,EAAAX,UAAA,CAAqBvnB,CAArB,CAH0E,CAA5E,CADF,CAOEkoB,CAAAX,UAAA,CAAqBr+C,CAAA5H,MAArB,CAGFwF,EAAAhD,GAAA,CAAW,UAAX,CAAuB,QAAQ,EAAG,CAChCokD,CAAAT,aAAA,CAAwBv+C,CAAA5H,MAAxB,CADgC,CAAlC,CAxBqC,CARR,CAH5B,CANqD,CAAxC,CA5oEtB,CA6rEIwpD,GAAiB/nD,EAAA,CAAQ,UACjB,GADiB,UAEjB,CAAA,CAFiB,CAAR,CA9+iBnB,EAFAgL,EAEA,CAFSnO,CAAAmO,OAET,GACEhH,CAUA,CAVSgH,EAUT,CATA5L,CAAA,CAAO4L,EAAAnI,GAAP,CAAkB,OACT8Z,EAAAhW,MADS,YAEJgW,EAAAxB,WAFI,UAGNwB,EAAArW,SAHM,eAIDqW,EAAAm+B,cAJC,CAAlB,CASA,CAFA9wC,EAAA,CAAwB,QAAxB,CAAkC,CAAA,CAAlC,CAAwC,CAAA,CAAxC,CAA8C,CAAA,CAA9C,CAEA,CADAA,EAAA,CAAwB,OAAxB,CAAiC,CAAA,CAAjC,CAAwC,CAAA,CAAxC,CAA+C,CAAA,CAA/C,CACA,CAAAA,EAAA,CAAwB,MAAxB,CAAgC,CAAA,CAAhC,CAAuC,CAAA,CAAvC,CAA8C,CAAA,CAA9C,CAXF,EAaEhG,CAbF,CAaWmH,CAEXhE,GAAApD,QAAA;AAAkBC,CAsXpBgkD,UAA2B,CAAC7gD,CAAD,CAAS,CAClC/H,CAAA,CAAO+H,CAAP,CAAgB,WACD5B,EADC,MAEN/D,EAFM,QAGJpC,CAHI,QAIJgD,EAJI,SAKH4B,CALG,SAMHxG,CANG,UAOFiJ,EAPE,MAQP5G,CARO,MASP8C,EATO,QAUJS,EAVI,UAWFI,EAXE,UAYH1D,EAZG,aAaCG,CAbD,WAcDC,CAdC,UAeF5C,CAfE,YAgBAM,CAhBA,UAiBFuC,CAjBE,UAkBFC,EAlBE,WAmBDQ,EAnBC,SAoBHrD,CApBG,UAqBFP,CArBE,SAsBH2wC,EAtBG,QAuBJttC,EAvBI,WAwBDwD,CAxBC,WAyBDynB,EAzBC,WA0BD,SAAU,CAAV,CA1BC,CAAhB,CA6BApa,GAAA,CAAgBzI,EAAA,CAAkB5L,CAAlB,CAChB,IAAI,CACFqU,EAAA,CAAc,UAAd,CADE,CAEF,MAAO/M,CAAP,CAAU,CACV+M,EAAA,CAAc,UAAd,CAA0B,EAA1B,CAAAjI,SAAA,CAAuC,SAAvC,CAAkDyoB,EAAlD,CADU,CAIZxgB,EAAA,CAAc,IAAd,CAAoB,CAAC,UAAD,CAApB,CAAkC,CAAC,UAAD,CAChC+2C,QAAiB,CAACzhD,CAAD,CAAW,CAC1BA,CAAAyC,SAAA,CAAkB,UAAlB,CAA8BkR,EAA9B,CAAAQ,UAAA,CACY,GACHy9B,EADG,OAECiC,EAFD,UAGIA,EAHJ;KAIA1B,EAJA,QAKE8K,EALF,QAMEG,EANF,OAOCmE,EAPD,QAQEJ,EARF,QASEnL,EATF,YAUMK,EAVN,gBAWUF,EAXV,SAYGO,EAZH,aAaOE,EAbP,YAcMD,EAdN,OAeCI,EAfD,SAgBGF,EAhBH,cAiBQC,EAjBR,QAkBErE,EAlBF,QAmBE6I,EAnBF,MAoBArE,EApBA,WAqBKI,EArBL,QAsBEe,EAtBF,eAuBSE,EAvBT,aAwBOC,EAxBP,UAyBIU,EAzBJ,QA0BEkC,EA1BF,SA2BGM,EA3BH,UA4BIK,EA5BJ,cA6BQa,EA7BR,iBA8BWE,EA9BX,WA+BKM,EA/BL,cAgCQL,EAhCR,SAiCGlI,EAjCH,QAkCES,EAlCF,UAmCIL,EAnCJ,UAoCIE,EApCJ,YAqCMA,EArCN,SAsCGO,EAtCH,CADZ,CAAAthC,UAAA,CAyCY09B,EAzCZ,CAAA19B,UAAA,CA0CY6iC,EA1CZ,CA2CAh3C,EAAAyC,SAAA,CAAkB,eACDiK,EADC,UAENy9B,EAFM,UAGNx4B,EAHM;cAIDE,EAJC,aAKHiQ,EALG,WAMLM,EANK,mBAOGC,EAPH,SAQP+a,EARO,cASF/T,EATE,WAULkB,EAVK,OAWTxH,EAXS,cAYFwE,EAZE,WAaLmH,EAbK,MAcVsB,EAdU,QAeR0C,EAfQ,YAgBJkC,EAhBI,IAiBZtB,EAjBY,MAkBVqH,EAlBU,cAmBFxB,EAnBE,UAoBNsC,EApBM,gBAqBAhoB,EArBA,UAsBNkpB,EAtBM,SAuBPQ,EAvBO,CAAlB,CA5C0B,CADI,CAAlC,CArCkC,CAApCqkB,CAkniBE,CAAmB7gD,EAAnB,CAEAnD,EAAA,CAAOlH,CAAP,CAAAmxC,MAAA,CAAuB,QAAQ,EAAG,CAChC3oC,EAAA,CAAYxI,CAAZ,CAAsByI,EAAtB,CADgC,CAAlC,CA1rlBqC,CAAtC,CAAA,CA8rlBE1I,MA9rlBF,CA8rlBUC,QA9rlBV,CA+rlBDqK,QAAApD,QAAA,CAAgBjH,QAAhB,CAAAkE,KAAA,CAA+B,MAA/B,CAAA6uC,QAAA,CAA+C,wLAA/C;", -"sources":["angular.js","MINERR_ASSET"], -"names":["window","document","undefined","minErr","isArrayLike","obj","isWindow","length","nodeType","isString","isArray","forEach","iterator","context","key","isFunction","hasOwnProperty","call","sortedKeys","keys","push","sort","forEachSorted","i","reverseParams","iteratorFn","value","nextUid","index","uid","digit","charCodeAt","join","String","fromCharCode","unshift","setHashKey","h","$$hashKey","extend","dst","arguments","int","str","parseInt","inherit","parent","extra","noop","identity","$","valueFn","isUndefined","isDefined","isObject","isNumber","isDate","toString","apply","isRegExp","location","alert","setInterval","isElement","node","nodeName","on","find","map","results","list","indexOf","array","arrayRemove","splice","copy","source","destination","$evalAsync","$watch","ngMinErr","Date","getTime","RegExp","shallowCopy","src","substr","equals","o1","o2","t1","t2","keySet","charAt","bind","self","fn","curryArgs","slice","startIndex","concat","toJsonReplacer","val","toJson","pretty","JSON","stringify","fromJson","json","parse","toBoolean","v","lowercase","startingTag","element","jqLite","clone","html","e","elemHtml","append","TEXT_NODE","match","replace","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","key_value","split","toKeyValue","parts","arrayValue","encodeUriQuery","encodeUriSegment","pctEncodeSpaces","encodeURIComponent","angularInit","bootstrap","elements","appElement","module","names","NG_APP_CLASS_REGEXP","name","getElementById","querySelectorAll","exec","className","attributes","attr","modules","doBootstrap","injector","tag","$provide","createInjector","invoke","scope","compile","animate","$apply","data","enabled","NG_DEFER_BOOTSTRAP","test","angular","resumeBootstrap","angular.resumeBootstrap","extraModules","snake_case","separator","SNAKE_CASE_REGEXP","letter","pos","toLowerCase","assertArg","arg","reason","assertArgFn","acceptArrayAnnotation","constructor","assertNotHasOwnProperty","getter","path","bindFnToScope","lastInstance","len","setupModuleLoader","ensure","factory","$injectorMinErr","Object","requires","configFn","invokeLater","provider","method","insertMethod","invokeQueue","moduleInstance","runBlocks","config","run","block","camelCase","SPECIAL_CHARS_REGEXP","_","offset","toUpperCase","MOZ_HACK_REGEXP","JQLitePatchJQueryRemove","dispatchThis","filterElems","getterIfNoArguments","removePatch","param","filter","fireEvent","set","setIndex","setLength","childIndex","children","shift","triggerHandler","childLength","jQuery","originalJqFn","$original","JQLite","jqLiteMinErr","div","createElement","innerHTML","removeChild","firstChild","JQLiteAddNodes","childNodes","fragment","createDocumentFragment","JQLiteClone","cloneNode","JQLiteDealoc","JQLiteRemoveData","JQLiteOff","type","unsupported","events","JQLiteExpandoStore","handle","eventHandler","removeEventListenerFn","expandoId","jqName","expandoStore","jqCache","$destroy","jqId","JQLiteData","isSetter","keyDefined","isSimpleGetter","JQLiteHasClass","selector","getAttribute","JQLiteRemoveClass","cssClasses","setAttribute","cssClass","trim","JQLiteAddClass","existingClasses","root","JQLiteController","JQLiteInheritedData","getBooleanAttrName","booleanAttr","BOOLEAN_ATTR","BOOLEAN_ELEMENTS","createEventHandler","event","preventDefault","event.preventDefault","returnValue","stopPropagation","event.stopPropagation","cancelBubble","target","srcElement","defaultPrevented","prevent","isDefaultPrevented","event.isDefaultPrevented","msie","elem","hashKey","objType","HashMap","put","annotate","$inject","fnText","STRIP_COMMENTS","argDecl","FN_ARGS","FN_ARG_SPLIT","FN_ARG","all","underscore","last","modulesToLoad","supportObject","delegate","provider_","providerInjector","instantiate","$get","providerCache","providerSuffix","factoryFn","loadModules","loadedModules","get","moduleFn","angularModule","_runBlocks","_invokeQueue","ii","invokeArgs","message","stack","createInternalInjector","cache","getService","serviceName","INSTANTIATING","locals","args","Type","Constructor","returnedValue","prototype","instance","has","service","$injector","constant","instanceCache","decorator","decorFn","origProvider","orig$get","origProvider.$get","origInstance","instanceInjector","servicename","$AnchorScrollProvider","autoScrollingEnabled","disableAutoScrolling","this.disableAutoScrolling","$window","$location","$rootScope","getFirstAnchor","result","scroll","hash","elm","scrollIntoView","getElementsByName","scrollTo","autoScrollWatch","autoScrollWatchAction","Browser","$log","$sniffer","completeOutstandingRequest","outstandingRequestCount","outstandingRequestCallbacks","pop","error","startPoller","interval","setTimeout","check","pollFns","pollFn","pollTimeout","fireUrlChange","newLocation","lastBrowserUrl","url","urlChangeListeners","listener","rawDocument","history","clearTimeout","pendingDeferIds","isMock","$$completeOutstandingRequest","$$incOutstandingRequestCount","self.$$incOutstandingRequestCount","notifyWhenNoOutstandingRequests","self.notifyWhenNoOutstandingRequests","callback","addPollFn","self.addPollFn","href","baseElement","self.url","replaceState","pushState","urlChangeInit","onUrlChange","self.onUrlChange","hashchange","baseHref","self.baseHref","lastCookies","lastCookieString","cookiePath","cookies","self.cookies","cookieLength","cookie","escape","warn","cookieArray","unescape","substring","defer","self.defer","delay","timeoutId","cancel","self.defer.cancel","deferId","$BrowserProvider","$document","$CacheFactoryProvider","this.$get","cacheFactory","cacheId","options","refresh","entry","freshEnd","staleEnd","n","link","p","nextEntry","prevEntry","caches","size","stats","capacity","Number","MAX_VALUE","lruHash","lruEntry","remove","removeAll","destroy","info","cacheFactory.info","cacheFactory.get","$TemplateCacheProvider","$cacheFactory","$CompileProvider","hasDirectives","Suffix","COMMENT_DIRECTIVE_REGEXP","CLASS_DIRECTIVE_REGEXP","aHrefSanitizationWhitelist","imgSrcSanitizationWhitelist","EVENT_HANDLER_ATTR_REGEXP","directive","this.directive","registerDirective","directiveFactory","$exceptionHandler","directives","priority","require","controller","restrict","this.aHrefSanitizationWhitelist","regexp","this.imgSrcSanitizationWhitelist","$interpolate","$http","$templateCache","$parse","$controller","$sce","$animate","$compileNodes","transcludeFn","maxPriority","ignoreDirective","previousCompileContext","nodeValue","wrap","compositeLinkFn","compileNodes","publicLinkFn","cloneConnectFn","$linkNode","JQLitePrototype","eq","safeAddClass","$element","addClass","nodeList","$rootElement","boundTranscludeFn","childLinkFn","childScope","childTranscludeFn","stableNodeList","linkFns","nodeLinkFn","$new","transclude","cloneFn","transcludeScope","$$transcluded","attrs","linkFnFound","Attributes","collectDirectives","applyDirectivesToNode","terminal","attrsMap","$attr","addDirective","directiveNormalize","nodeName_","nName","nAttrs","j","jj","attrStartName","attrEndName","specified","ngAttrName","NG_ATTR_BINDING","directiveNName","addAttrInterpolateDirective","addTextInterpolateDirective","byPriority","groupScan","attrStart","attrEnd","nodes","depth","hasAttribute","$compileMinErr","nextSibling","groupElementsLinkFnWrapper","linkFn","controllers","compileNode","templateAttrs","jqCollection","originalReplaceDirective","preLinkFns","postLinkFns","addLinkFns","pre","post","getControllers","retrievalMethod","optional","$$controller","directiveName","linkNode","$$element","newIsolateScopeDirective","LOCAL_REGEXP","parentScope","$parent","definition","scopeName","attrName","mode","lastValue","parentGet","parentSet","$$isolateBindings","$observe","$$observers","$$scope","assign","parentValueWatch","parentValue","controllerDirectives","controllerInstance","controllerAs","$scope","terminalPriority","newScopeDirective","templateDirective","$compileNode","$template","transcludeDirective","$$start","$$end","directiveValue","templateUrl","assertNoDuplicate","createComment","replaceWith","replaceDirective","contents","template","denormalizeTemplate","newTemplateAttrs","mergeTemplateAttributes","compileTemplateUrl","Math","max","tDirectives","startAttrName","endAttrName","srcAttr","dstAttr","$set","tAttrs","linkQueue","afterTemplateNodeLinkFn","afterTemplateChildLinkFn","beforeTemplateCompileNode","origAsyncDirective","derivedSyncDirective","getTrustedResourceUrl","success","content","tempTemplateAttrs","beforeTemplateLinkNode","linkRootElement","response","code","headers","delayedNodeLinkFn","ignoreChildLinkFn","rootElement","a","b","diff","what","previousDirective","text","interpolateFn","textInterpolateLinkFn","bindings","interpolateFnWatchAction","getTrustedContext","attrNormalizedName","RESOURCE_URL","attrInterpolateLinkFn","$$inter","elementsToRemove","newNode","firstElementToRemove","removeCount","parentNode","j2","replaceChild","appendChild","expando","k","kk","$addClass","classVal","$removeClass","removeClass","writeAttr","tokenDifference","str1","str2","values","tokens1","tokens2","token","current","booleanKey","prop","normalizedVal","urlResolve","removeAttr","listeners","startSymbol","endSymbol","PREFIX_REGEXP","$ControllerProvider","CNTRL_REG","register","this.register","expression","identifier","$DocumentProvider","$ExceptionHandlerProvider","exception","cause","parseHeaders","parsed","line","headersGetter","headersObj","transformData","fns","$HttpProvider","JSON_START","JSON_END","PROTECTION_PREFIX","CONTENT_TYPE_APPLICATION_JSON","defaults","d","interceptorFactories","interceptors","responseInterceptorFactories","responseInterceptors","$httpBackend","$browser","$q","requestConfig","transformResponse","resp","status","reject","transformRequest","mergeHeaders","execHeaders","headerContent","headerFn","header","defHeaders","reqHeaders","defHeaderName","reqHeaderName","common","lowercaseDefHeaderName","uppercase","xsrfValue","urlIsSameOrigin","xsrfCookieName","xsrfHeaderName","chain","serverRequest","reqData","withCredentials","sendReq","then","promise","when","reversedInterceptors","interceptor","request","requestError","responseError","thenFn","rejectFn","promise.success","promise.error","done","headersString","resolvePromise","$$phase","deferred","resolve","removePendingReq","idx","pendingRequests","cachedResp","buildUrl","params","defaultCache","timeout","responseType","interceptorFactory","responseFn","createShortMethods","createShortMethodsWithData","$HttpBackendProvider","createHttpBackend","XHR","callbacks","protocol","$browserDefer","locationProtocol","jsonpReq","script","doneWrapper","body","onreadystatechange","script.onreadystatechange","readyState","onload","onerror","timeoutRequest","jsonpDone","xhr","abort","completeRequest","callbackId","counter","open","setRequestHeader","xhr.onreadystatechange","responseHeaders","getAllResponseHeaders","responseText","send","$InterpolateProvider","this.startSymbol","this.endSymbol","mustHaveExpression","trustedContext","endIndex","hasInterpolation","startSymbolLength","exp","endSymbolLength","$interpolateMinErr","part","getTrusted","valueOf","err","newErr","$interpolate.startSymbol","$interpolate.endSymbol","$IntervalProvider","count","invokeApply","clearInterval","iteration","skipApply","$$intervalId","tick","notify","intervals","interval.cancel","$LocaleProvider","short","pluralCat","num","encodePath","segments","parseAbsoluteUrl","absoluteUrl","locationObj","parsedUrl","$$protocol","$$host","hostname","$$port","port","DEFAULT_PORTS","parseAppUrl","relativeUrl","prefixed","$$path","pathname","$$search","search","$$hash","beginsWith","begin","whole","stripHash","stripFile","lastIndexOf","LocationHtml5Url","appBase","basePrefix","$$html5","appBaseNoFile","$$parse","this.$$parse","pathUrl","$locationMinErr","$$compose","this.$$compose","$$url","$$absUrl","$$rewrite","this.$$rewrite","appUrl","prevAppUrl","LocationHashbangUrl","hashPrefix","withoutBaseUrl","withoutHashUrl","LocationHashbangInHtml5Url","locationGetter","property","locationGetterSetter","preprocess","$LocationProvider","html5Mode","this.hashPrefix","prefix","this.html5Mode","afterLocationChange","oldUrl","$broadcast","absUrl","initialUrl","LocationMode","ctrlKey","metaKey","which","absHref","rewrittenUrl","newUrl","$digest","changeCounter","$locationWatch","currentReplace","$$replace","$LogProvider","debug","debugEnabled","this.debugEnabled","flag","formatError","Error","sourceURL","consoleLog","console","logFn","log","arg1","arg2","ensureSafeMemberName","fullExpression","$parseMinErr","ensureSafeObject","setter","setValue","fullExp","propertyObj","unwrapPromises","promiseWarning","$$v","cspSafeGetterFn","key0","key1","key2","key3","key4","cspSafePromiseEnabledGetter","pathVal","cspSafeGetter","getterFn","getterFnCache","pathKeys","pathKeysLength","csp","evaledFnGetter","Function","evaledFnGetter.toString","$ParseProvider","$parseOptions","this.unwrapPromises","logPromiseWarnings","this.logPromiseWarnings","$filter","promiseWarningCache","parsedExpression","lexer","Lexer","parser","Parser","$QProvider","qFactory","nextTick","exceptionHandler","defaultCallback","defaultErrback","pending","ref","progress","errback","progressback","wrappedCallback","wrappedErrback","wrappedProgressback","catch","finally","makePromise","resolved","handleCallback","isResolved","callbackOutput","promises","$RootScopeProvider","TTL","$rootScopeMinErr","digestTtl","this.digestTtl","Scope","$id","$$watchers","$$nextSibling","$$prevSibling","$$childHead","$$childTail","$root","$$destroyed","$$asyncQueue","$$postDigestQueue","$$listeners","beginPhase","phase","compileToFn","initWatchVal","isolate","child","Child","watchExp","objectEquality","watcher","listenFn","watcher.fn","newVal","oldVal","originalFn","$watchCollection","oldValue","newValue","changeDetected","objGetter","internalArray","internalObject","oldLength","$watchCollectionWatch","newLength","$watchCollectionAction","watch","watchers","asyncQueue","postDigestQueue","dirty","ttl","watchLog","logIdx","logMsg","asyncTask","$eval","isNaN","next","expr","$$postDigest","$on","namedListeners","$emit","empty","listenerArgs","array1","currentScope","adjustMatcher","matcher","$sceMinErr","adjustMatchers","matchers","adjustedMatchers","$SceDelegateProvider","SCE_CONTEXTS","resourceUrlWhitelist","resourceUrlBlacklist","this.resourceUrlWhitelist","this.resourceUrlBlacklist","generateHolderType","base","holderType","trustedValue","$$unwrapTrustedValue","this.$$unwrapTrustedValue","holderType.prototype.valueOf","holderType.prototype.toString","htmlSanitizer","trustedValueHolderBase","byType","HTML","CSS","URL","JS","trustAs","maybeTrusted","allowed","$SceProvider","this.enabled","$sceDelegate","documentMode","sce","isEnabled","sce.isEnabled","sce.getTrusted","parseAs","sce.parseAs","literal","sceParseAsTrusted","enumValue","lName","$SnifferProvider","eventSupport","android","userAgent","navigator","boxee","vendorPrefix","vendorRegex","bodyStyle","style","transitions","animations","webkitTransition","webkitAnimation","hasEvent","divElm","securityPolicy","isActive","$TimeoutProvider","deferreds","$$timeoutId","timeout.cancel","urlParsingNode","host","requestUrl","originUrl","$WindowProvider","$FilterProvider","filters","suffix","currencyFilter","dateFilter","filterFilter","jsonFilter","limitToFilter","lowercaseFilter","numberFilter","orderByFilter","uppercaseFilter","comperator","predicates","predicates.check","objKey","filtered","$locale","formats","NUMBER_FORMATS","amount","currencySymbol","CURRENCY_SYM","formatNumber","PATTERNS","GROUP_SEP","DECIMAL_SEP","number","fractionSize","pattern","groupSep","decimalSep","isFinite","isNegative","abs","numStr","formatedText","hasExponent","toFixed","fractionLen","min","minFrac","maxFrac","pow","round","fraction","lgroup","lgSize","group","gSize","negPre","posPre","negSuf","posSuf","padNumber","digits","neg","dateGetter","date","dateStrGetter","shortForm","jsonStringToDate","string","R_ISO8601_STR","tzHour","tzMin","dateSetter","setUTCFullYear","setFullYear","timeSetter","setUTCHours","setHours","m","s","ms","parseFloat","format","DATETIME_FORMATS","NUMBER_STRING","DATE_FORMATS_SPLIT","DATE_FORMATS","object","input","limit","out","sortPredicate","reverseOrder","reverseComparator","comp","descending","predicate","v1","v2","arrayCopy","comparator","ngDirective","FormController","toggleValidCss","isValid","validationErrorKey","INVALID_CLASS","VALID_CLASS","form","parentForm","nullFormCtrl","invalidCount","errors","$error","controls","$name","ngForm","$dirty","$pristine","$valid","$invalid","$addControl","PRISTINE_CLASS","form.$addControl","control","$removeControl","form.$removeControl","queue","validationToken","$setValidity","form.$setValidity","$setDirty","form.$setDirty","DIRTY_CLASS","$setPristine","form.$setPristine","textInputType","ctrl","ngTrim","$viewValue","$setViewValue","deferListener","keyCode","$render","ctrl.$render","$isEmpty","ngPattern","validate","patternValidator","patternObj","$formatters","$parsers","ngMinlength","minlength","minLengthValidator","ngMaxlength","maxlength","maxLengthValidator","classDirective","ngClassWatchAction","$index","flattenClasses","classes","old$index","mod","version","addEventListenerFn","addEventListener","attachEvent","removeEventListener","detachEvent","ready","trigger","fired","removeAttribute","css","currentStyle","lowercasedName","getNamedItem","ret","getText","textProp","NODE_TYPE_TEXT_PROPERTY","$dv","multiple","option","selected","onFn","eventFns","contains","compareDocumentPosition","adown","documentElement","bup","eventmap","related","relatedTarget","replaceNode","insertBefore","prepend","wrapNode","after","newElement","toggleClass","condition","nextElementSibling","getElementsByTagName","eventName","eventData","arg3","unbind","off","$animateMinErr","$AnimateProvider","$$selectors","$timeout","enter","afterNode","afterNextSibling","leave","move","XMLHttpRequest","ActiveXObject","e1","e2","e3","PATH_MATCH","paramValue","OPERATORS","null","true","false","+","-","*","/","%","^","===","!==","==","!=","<",">","<=",">=","&&","||","&","|","!","ESCAPE","lex","ch","lastCh","tokens","is","readString","peek","readNumber","isIdent","readIdent","was","isWhitespace","ch2","ch3","fn2","fn3","throwError","chars","isExpOperator","start","end","colStr","peekCh","ident","lastDot","peekIndex","methodName","quote","rawString","hex","rep","ZERO","Parser.ZERO","assignment","logicalOR","functionCall","fieldAccess","objectIndex","filterChain","this.filterChain","primary","statements","expect","consume","arrayDeclaration","msg","peekToken","e4","t","unaryFn","right","ternaryFn","left","middle","binaryFn","statement","argsFn","fnInvoke","ternary","logicalAND","equality","relational","additive","multiplicative","unary","field","indexFn","o","safe","contextGetter","fnPtr","elementFns","allConstant","elementFn","keyValues","ampmGetter","getHours","AMPMS","timeZoneGetter","zone","getTimezoneOffset","paddedZone","htmlAnchorDirective","ngAttributeAliasDirectives","propName","normalized","ngBooleanAttrWatchAction","formDirectiveFactory","isNgForm","formDirective","formElement","action","preventDefaultListener","parentFormCtrl","alias","ngFormDirective","URL_REGEXP","EMAIL_REGEXP","NUMBER_REGEXP","inputType","numberInputType","minValidator","maxValidator","urlInputType","urlValidator","emailInputType","emailValidator","radioInputType","checked","checkboxInputType","trueValue","ngTrueValue","falseValue","ngFalseValue","ctrl.$isEmpty","inputDirective","NgModelController","$modelValue","NaN","$viewChangeListeners","ngModelGet","ngModel","ngModelSet","this.$isEmpty","inheritedData","this.$setValidity","this.$setPristine","this.$setViewValue","ngModelWatch","formatters","ngModelDirective","ctrls","modelCtrl","formCtrl","ngChangeDirective","ngChange","requiredDirective","required","validator","ngListDirective","ngList","viewValue","CONSTANT_VALUE_REGEXP","ngValueDirective","tpl","tplAttr","ngValue","ngValueConstantLink","ngValueLink","valueWatchAction","ngBindDirective","ngBind","ngBindWatchAction","ngBindTemplateDirective","ngBindTemplate","ngBindHtmlDirective","ngBindHtml","getStringValue","ngBindHtmlWatchAction","getTrustedHtml","ngClassDirective","ngClassOddDirective","ngClassEvenDirective","ngCloakDirective","ngControllerDirective","ngCspDirective","ngEventDirectives","ngIfDirective","childElement","ngIf","ngIfWatchAction","ngIncludeDirective","$anchorScroll","$compile","transclusion","srcExp","ngInclude","onloadExp","autoScrollExp","autoscroll","currentElement","cleanupLastIncludeContent","parseAsResourceUrl","ngIncludeWatchAction","thisChangeId","newScope","ngInitDirective","ngInit","ngNonBindableDirective","ngPluralizeDirective","BRACE","numberExp","whenExp","whens","whensExpFns","isWhen","attributeName","ngPluralizeWatch","ngPluralizeWatchAction","ngRepeatDirective","getBlockElements","startNode","endNode","ngRepeatMinErr","linker","ngRepeat","trackByExpGetter","trackByIdExpFn","trackByIdArrayFn","trackByIdObjFn","rhs","valueIdentifier","keyIdentifier","hashFnLocals","lhs","trackByExp","lastBlockMap","ngRepeatAction","collection","previousNode","nextNode","nextBlockMap","arrayLength","collectionKeys","nextBlockOrder","trackByIdFn","trackById","id","$first","$last","$middle","$odd","$even","ngShowDirective","ngShow","ngShowWatchAction","ngHideDirective","ngHide","ngHideWatchAction","ngStyleDirective","ngStyle","ngStyleWatchAction","newStyles","oldStyles","ngSwitchDirective","ngSwitchController","cases","selectedTranscludes","selectedElements","selectedScopes","ngSwitch","ngSwitchWatchAction","change","selectedTransclude","selectedScope","caseElement","anchor","ngSwitchWhenDirective","ngSwitchWhen","ngSwitchDefaultDirective","ngTranscludeDirective","$transclude","$attrs","scriptDirective","ngOptionsMinErr","ngOptionsDirective","selectDirective","NG_OPTIONS_REGEXP","nullModelCtrl","optionsMap","ngModelCtrl","unknownOption","databound","init","self.init","ngModelCtrl_","nullOption_","unknownOption_","addOption","self.addOption","removeOption","self.removeOption","hasOption","renderUnknownOption","self.renderUnknownOption","unknownVal","self.hasOption","Single","selectElement","selectCtrl","ngModelCtrl.$render","emptyOption","Multiple","lastView","items","selectMultipleWatch","Options","render","optionGroups","optionGroupNames","optionGroupName","optionGroup","existingParent","existingOptions","modelValue","valuesFn","keyName","groupIndex","selectedSet","lastElement","trackFn","trackIndex","valueName","groupByFn","modelCast","label","displayFn","nullOption","groupLength","optionGroupsCache","optGroupTemplate","existingOption","optionTemplate","optionsExp","track","optionElement","ngOptions","ngRequired","requiredValidator","optionDirective","nullSelectCtrl","selectCtrlName","interpolateWatchAction","styleDirective","publishExternalAPI","ngModule"] -} diff --git a/setup/pub/bootstrap/js/bootstrap.js b/setup/pub/bootstrap/js/bootstrap.js deleted file mode 100644 index 8ae571b6da5be..0000000000000 --- a/setup/pub/bootstrap/js/bootstrap.js +++ /dev/null @@ -1,1951 +0,0 @@ -/*! - * Bootstrap v3.1.1 (http://getbootstrap.com) - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ - -if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } - -/* ======================================================================== - * Bootstrap: transition.js v3.1.1 - * http://getbootstrap.com/javascript/#transitions - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) - // ============================================================ - - function transitionEnd() { - var el = document.createElement('bootstrap') - - var transEndEventNames = { - 'WebkitTransition' : 'webkitTransitionEnd', - 'MozTransition' : 'transitionend', - 'OTransition' : 'oTransitionEnd otransitionend', - 'transition' : 'transitionend' - } - - for (var name in transEndEventNames) { - if (el.style[name] !== undefined) { - return { end: transEndEventNames[name] } - } - } - - return false // explicit for ie8 ( ._.) - } - - // http://blog.alexmaccaw.com/css-transitions - $.fn.emulateTransitionEnd = function (duration) { - var called = false, $el = this - $(this).one($.support.transition.end, function () { called = true }) - var callback = function () { if (!called) $($el).trigger($.support.transition.end) } - setTimeout(callback, duration) - return this - } - - $(function () { - $.support.transition = transitionEnd() - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: alert.js v3.1.1 - * http://getbootstrap.com/javascript/#alerts - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // ALERT CLASS DEFINITION - // ====================== - - var dismiss = '[data-dismiss="alert"]' - var Alert = function (el) { - $(el).on('click', dismiss, this.close) - } - - Alert.prototype.close = function (e) { - var $this = $(this) - var selector = $this.attr('data-target') - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 - } - - var $parent = $(selector) - - if (e) e.preventDefault() - - if (!$parent.length) { - $parent = $this.hasClass('alert') ? $this : $this.parent() - } - - $parent.trigger(e = $.Event('close.bs.alert')) - - if (e.isDefaultPrevented()) return - - $parent.removeClass('in') - - function removeElement() { - $parent.trigger('closed.bs.alert').remove() - } - - $.support.transition && $parent.hasClass('fade') ? - $parent - .one($.support.transition.end, removeElement) - .emulateTransitionEnd(150) : - removeElement() - } - - - // ALERT PLUGIN DEFINITION - // ======================= - - var old = $.fn.alert - - $.fn.alert = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.alert') - - if (!data) $this.data('bs.alert', (data = new Alert(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - $.fn.alert.Constructor = Alert - - - // ALERT NO CONFLICT - // ================= - - $.fn.alert.noConflict = function () { - $.fn.alert = old - return this - } - - - // ALERT DATA-API - // ============== - - $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: button.js v3.1.1 - * http://getbootstrap.com/javascript/#buttons - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // BUTTON PUBLIC CLASS DEFINITION - // ============================== - - var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Button.DEFAULTS, options) - this.isLoading = false - } - - Button.DEFAULTS = { - loadingText: 'loading...' - } - - Button.prototype.setState = function (state) { - var d = 'disabled' - var $el = this.$element - var val = $el.is('input') ? 'val' : 'html' - var data = $el.data() - - state = state + 'Text' - - if (!data.resetText) $el.data('resetText', $el[val]()) - - $el[val](data[state] || this.options[state]) - - // push to event loop to allow forms to submit - setTimeout($.proxy(function () { - if (state == 'loadingText') { - this.isLoading = true - $el.addClass(d).attr(d, d) - } else if (this.isLoading) { - this.isLoading = false - $el.removeClass(d).removeAttr(d) - } - }, this), 0) - } - - Button.prototype.toggle = function () { - var changed = true - var $parent = this.$element.closest('[data-toggle="buttons"]') - - if ($parent.length) { - var $input = this.$element.find('input') - if ($input.prop('type') == 'radio') { - if ($input.prop('checked') && this.$element.hasClass('active')) changed = false - else $parent.find('.active').removeClass('active') - } - if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') - } - - if (changed) this.$element.toggleClass('active') - } - - - // BUTTON PLUGIN DEFINITION - // ======================== - - var old = $.fn.button - - $.fn.button = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.button') - var options = typeof option == 'object' && option - - if (!data) $this.data('bs.button', (data = new Button(this, options))) - - if (option == 'toggle') data.toggle() - else if (option) data.setState(option) - }) - } - - $.fn.button.Constructor = Button - - - // BUTTON NO CONFLICT - // ================== - - $.fn.button.noConflict = function () { - $.fn.button = old - return this - } - - - // BUTTON DATA-API - // =============== - - $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') - e.preventDefault() - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: carousel.js v3.1.1 - * http://getbootstrap.com/javascript/#carousel - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // CAROUSEL CLASS DEFINITION - // ========================= - - var Carousel = function (element, options) { - this.$element = $(element) - this.$indicators = this.$element.find('.carousel-indicators') - this.options = options - this.paused = - this.sliding = - this.interval = - this.$active = - this.$items = null - - this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) - } - - Carousel.DEFAULTS = { - interval: 5000, - pause: 'hover', - wrap: true - } - - Carousel.prototype.cycle = function (e) { - e || (this.paused = false) - - this.interval && clearInterval(this.interval) - - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) - - return this - } - - Carousel.prototype.getActiveIndex = function () { - this.$active = this.$element.find('.item.active') - this.$items = this.$active.parent().children() - - return this.$items.index(this.$active) - } - - Carousel.prototype.to = function (pos) { - var that = this - var activeIndex = this.getActiveIndex() - - if (pos > (this.$items.length - 1) || pos < 0) return - - if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) - if (activeIndex == pos) return this.pause().cycle() - - return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) - } - - Carousel.prototype.pause = function (e) { - e || (this.paused = true) - - if (this.$element.find('.next, .prev').length && $.support.transition) { - this.$element.trigger($.support.transition.end) - this.cycle(true) - } - - this.interval = clearInterval(this.interval) - - return this - } - - Carousel.prototype.next = function () { - if (this.sliding) return - return this.slide('next') - } - - Carousel.prototype.prev = function () { - if (this.sliding) return - return this.slide('prev') - } - - Carousel.prototype.slide = function (type, next) { - var $active = this.$element.find('.item.active') - var $next = next || $active[type]() - var isCycling = this.interval - var direction = type == 'next' ? 'left' : 'right' - var fallback = type == 'next' ? 'first' : 'last' - var that = this - - if (!$next.length) { - if (!this.options.wrap) return - $next = this.$element.find('.item')[fallback]() - } - - if ($next.hasClass('active')) return this.sliding = false - - var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - - this.sliding = true - - isCycling && this.pause() - - if (this.$indicators.length) { - this.$indicators.find('.active').removeClass('active') - this.$element.one('slid.bs.carousel', function () { - var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) - $nextIndicator && $nextIndicator.addClass('active') - }) - } - - if ($.support.transition && this.$element.hasClass('slide')) { - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - $active - .one($.support.transition.end, function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) - }) - .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) - } else { - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger('slid.bs.carousel') - } - - isCycling && this.cycle() - - return this - } - - - // CAROUSEL PLUGIN DEFINITION - // ========================== - - var old = $.fn.carousel - - $.fn.carousel = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.carousel') - var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) - var action = typeof option == 'string' ? option : options.slide - - if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (action) data[action]() - else if (options.interval) data.pause().cycle() - }) - } - - $.fn.carousel.Constructor = Carousel - - - // CAROUSEL NO CONFLICT - // ==================== - - $.fn.carousel.noConflict = function () { - $.fn.carousel = old - return this - } - - - // CAROUSEL DATA-API - // ================= - - $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { - var $this = $(this), href - var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - var options = $.extend({}, $target.data(), $this.data()) - var slideIndex = $this.attr('data-slide-to') - if (slideIndex) options.interval = false - - $target.carousel(options) - - if (slideIndex = $this.attr('data-slide-to')) { - $target.data('bs.carousel').to(slideIndex) - } - - e.preventDefault() - }) - - $(window).on('load', function () { - $('[data-ride="carousel"]').each(function () { - var $carousel = $(this) - $carousel.carousel($carousel.data()) - }) - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: collapse.js v3.1.1 - * http://getbootstrap.com/javascript/#collapse - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // COLLAPSE PUBLIC CLASS DEFINITION - // ================================ - - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Collapse.DEFAULTS, options) - this.transitioning = null - - if (this.options.parent) this.$parent = $(this.options.parent) - if (this.options.toggle) this.toggle() - } - - Collapse.DEFAULTS = { - toggle: true - } - - Collapse.prototype.dimension = function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - Collapse.prototype.show = function () { - if (this.transitioning || this.$element.hasClass('in')) return - - var startEvent = $.Event('show.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - var actives = this.$parent && this.$parent.find('> .panel > .in') - - if (actives && actives.length) { - var hasData = actives.data('bs.collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('bs.collapse', null) - } - - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - .addClass('collapsing') - [dimension](0) - - this.transitioning = 1 - - var complete = function () { - this.$element - .removeClass('collapsing') - .addClass('collapse in') - [dimension]('auto') - this.transitioning = 0 - this.$element.trigger('shown.bs.collapse') - } - - if (!$.support.transition) return complete.call(this) - - var scrollSize = $.camelCase(['scroll', dimension].join('-')) - - this.$element - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - [dimension](this.$element[0][scrollSize]) - } - - Collapse.prototype.hide = function () { - if (this.transitioning || !this.$element.hasClass('in')) return - - var startEvent = $.Event('hide.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - var dimension = this.dimension() - - this.$element - [dimension](this.$element[dimension]()) - [0].offsetHeight - - this.$element - .addClass('collapsing') - .removeClass('collapse') - .removeClass('in') - - this.transitioning = 1 - - var complete = function () { - this.transitioning = 0 - this.$element - .trigger('hidden.bs.collapse') - .removeClass('collapsing') - .addClass('collapse') - } - - if (!$.support.transition) return complete.call(this) - - this.$element - [dimension](0) - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - } - - Collapse.prototype.toggle = function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } - - - // COLLAPSE PLUGIN DEFINITION - // ========================== - - var old = $.fn.collapse - - $.fn.collapse = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.collapse') - var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) - - if (!data && options.toggle && option == 'show') option = !option - if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.collapse.Constructor = Collapse - - - // COLLAPSE NO CONFLICT - // ==================== - - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this - } - - - // COLLAPSE DATA-API - // ================= - - $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { - var $this = $(this), href - var target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - var $target = $(target) - var data = $target.data('bs.collapse') - var option = data ? 'toggle' : $this.data() - var parent = $this.attr('data-parent') - var $parent = parent && $(parent) - - if (!data || !data.transitioning) { - if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') - $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') - } - - $target.collapse(option) - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: dropdown.js v3.1.1 - * http://getbootstrap.com/javascript/#dropdowns - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // DROPDOWN CLASS DEFINITION - // ========================= - - var backdrop = '.dropdown-backdrop' - var toggle = '[data-toggle=dropdown]' - var Dropdown = function (element) { - $(element).on('click.bs.dropdown', this.toggle) - } - - Dropdown.prototype.toggle = function (e) { - var $this = $(this) - - if ($this.is('.disabled, :disabled')) return - - var $parent = getParent($this) - var isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { - // if mobile we use a backdrop because click events don't delegate - $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) - } - - var relatedTarget = { relatedTarget: this } - $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) - - if (e.isDefaultPrevented()) return - - $parent - .toggleClass('open') - .trigger('shown.bs.dropdown', relatedTarget) - - $this.focus() - } - - return false - } - - Dropdown.prototype.keydown = function (e) { - if (!/(38|40|27)/.test(e.keyCode)) return - - var $this = $(this) - - e.preventDefault() - e.stopPropagation() - - if ($this.is('.disabled, :disabled')) return - - var $parent = getParent($this) - var isActive = $parent.hasClass('open') - - if (!isActive || (isActive && e.keyCode == 27)) { - if (e.which == 27) $parent.find(toggle).focus() - return $this.click() - } - - var desc = ' li:not(.divider):visible a' - var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc) - - if (!$items.length) return - - var index = $items.index($items.filter(':focus')) - - if (e.keyCode == 38 && index > 0) index-- // up - if (e.keyCode == 40 && index < $items.length - 1) index++ // down - if (!~index) index = 0 - - $items.eq(index).focus() - } - - function clearMenus(e) { - $(backdrop).remove() - $(toggle).each(function () { - var $parent = getParent($(this)) - var relatedTarget = { relatedTarget: this } - if (!$parent.hasClass('open')) return - $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) - if (e.isDefaultPrevented()) return - $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) - }) - } - - function getParent($this) { - var selector = $this.attr('data-target') - - if (!selector) { - selector = $this.attr('href') - selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - var $parent = selector && $(selector) - - return $parent && $parent.length ? $parent : $this.parent() - } - - - // DROPDOWN PLUGIN DEFINITION - // ========================== - - var old = $.fn.dropdown - - $.fn.dropdown = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.dropdown') - - if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - $.fn.dropdown.Constructor = Dropdown - - - // DROPDOWN NO CONFLICT - // ==================== - - $.fn.dropdown.noConflict = function () { - $.fn.dropdown = old - return this - } - - - // APPLY TO STANDARD DROPDOWN ELEMENTS - // =================================== - - $(document) - .on('click.bs.dropdown.data-api', clearMenus) - .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) - .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) - .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: modal.js v3.1.1 - * http://getbootstrap.com/javascript/#modals - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // MODAL CLASS DEFINITION - // ====================== - - var Modal = function (element, options) { - this.options = options - this.$element = $(element) - this.$backdrop = - this.isShown = null - - if (this.options.remote) { - this.$element - .find('.modal-content') - .load(this.options.remote, $.proxy(function () { - this.$element.trigger('loaded.bs.modal') - }, this)) - } - } - - Modal.DEFAULTS = { - backdrop: true, - keyboard: true, - show: true - } - - Modal.prototype.toggle = function (_relatedTarget) { - return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) - } - - Modal.prototype.show = function (_relatedTarget) { - var that = this - var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) - - this.$element.trigger(e) - - if (this.isShown || e.isDefaultPrevented()) return - - this.isShown = true - - this.escape() - - this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) - - this.backdrop(function () { - var transition = $.support.transition && that.$element.hasClass('fade') - - if (!that.$element.parent().length) { - that.$element.appendTo(document.body) // don't move modals dom position - } - - that.$element - .show() - .scrollTop(0) - - if (transition) { - that.$element[0].offsetWidth // force reflow - } - - that.$element - .addClass('in') - .attr('aria-hidden', false) - - that.enforceFocus() - - var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) - - transition ? - that.$element.find('.modal-dialog') // wait for modal to slide in - .one($.support.transition.end, function () { - that.$element.focus().trigger(e) - }) - .emulateTransitionEnd(300) : - that.$element.focus().trigger(e) - }) - } - - Modal.prototype.hide = function (e) { - if (e) e.preventDefault() - - e = $.Event('hide.bs.modal') - - this.$element.trigger(e) - - if (!this.isShown || e.isDefaultPrevented()) return - - this.isShown = false - - this.escape() - - $(document).off('focusin.bs.modal') - - this.$element - .removeClass('in') - .attr('aria-hidden', true) - .off('click.dismiss.bs.modal') - - $.support.transition && this.$element.hasClass('fade') ? - this.$element - .one($.support.transition.end, $.proxy(this.hideModal, this)) - .emulateTransitionEnd(300) : - this.hideModal() - } - - Modal.prototype.enforceFocus = function () { - $(document) - .off('focusin.bs.modal') // guard against infinite focus loop - .on('focusin.bs.modal', $.proxy(function (e) { - if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { - this.$element.focus() - } - }, this)) - } - - Modal.prototype.escape = function () { - if (this.isShown && this.options.keyboard) { - this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { - e.which == 27 && this.hide() - }, this)) - } else if (!this.isShown) { - this.$element.off('keyup.dismiss.bs.modal') - } - } - - Modal.prototype.hideModal = function () { - var that = this - this.$element.hide() - this.backdrop(function () { - that.removeBackdrop() - that.$element.trigger('hidden.bs.modal') - }) - } - - Modal.prototype.removeBackdrop = function () { - this.$backdrop && this.$backdrop.remove() - this.$backdrop = null - } - - Modal.prototype.backdrop = function (callback) { - var animate = this.$element.hasClass('fade') ? 'fade' : '' - - if (this.isShown && this.options.backdrop) { - var doAnimate = $.support.transition && animate - - this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') - .appendTo(document.body) - - this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { - if (e.target !== e.currentTarget) return - this.options.backdrop == 'static' - ? this.$element[0].focus.call(this.$element[0]) - : this.hide.call(this) - }, this)) - - if (doAnimate) this.$backdrop[0].offsetWidth // force reflow - - this.$backdrop.addClass('in') - - if (!callback) return - - doAnimate ? - this.$backdrop - .one($.support.transition.end, callback) - .emulateTransitionEnd(150) : - callback() - - } else if (!this.isShown && this.$backdrop) { - this.$backdrop.removeClass('in') - - $.support.transition && this.$element.hasClass('fade') ? - this.$backdrop - .one($.support.transition.end, callback) - .emulateTransitionEnd(150) : - callback() - - } else if (callback) { - callback() - } - } - - - // MODAL PLUGIN DEFINITION - // ======================= - - var old = $.fn.modal - - $.fn.modal = function (option, _relatedTarget) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.modal') - var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) - - if (!data) $this.data('bs.modal', (data = new Modal(this, options))) - if (typeof option == 'string') data[option](_relatedTarget) - else if (options.show) data.show(_relatedTarget) - }) - } - - $.fn.modal.Constructor = Modal - - - // MODAL NO CONFLICT - // ================= - - $.fn.modal.noConflict = function () { - $.fn.modal = old - return this - } - - - // MODAL DATA-API - // ============== - - $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { - var $this = $(this) - var href = $this.attr('href') - var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 - var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) - - if ($this.is('a')) e.preventDefault() - - $target - .modal(option, this) - .one('hide', function () { - $this.is(':visible') && $this.focus() - }) - }) - - $(document) - .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') }) - .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: tooltip.js v3.1.1 - * http://getbootstrap.com/javascript/#tooltip - * Inspired by the original jQuery.tipsy by Jason Frame - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // TOOLTIP PUBLIC CLASS DEFINITION - // =============================== - - var Tooltip = function (element, options) { - this.type = - this.options = - this.enabled = - this.timeout = - this.hoverState = - this.$element = null - - this.init('tooltip', element, options) - } - - Tooltip.DEFAULTS = { - animation: true, - placement: 'top', - selector: false, - template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', - trigger: 'hover focus', - title: '', - delay: 0, - html: false, - container: false - } - - Tooltip.prototype.init = function (type, element, options) { - this.enabled = true - this.type = type - this.$element = $(element) - this.options = this.getOptions(options) - - var triggers = this.options.trigger.split(' ') - - for (var i = triggers.length; i--;) { - var trigger = triggers[i] - - if (trigger == 'click') { - this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) - } else if (trigger != 'manual') { - var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' - var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' - - this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) - this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) - } - } - - this.options.selector ? - (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : - this.fixTitle() - } - - Tooltip.prototype.getDefaults = function () { - return Tooltip.DEFAULTS - } - - Tooltip.prototype.getOptions = function (options) { - options = $.extend({}, this.getDefaults(), this.$element.data(), options) - - if (options.delay && typeof options.delay == 'number') { - options.delay = { - show: options.delay, - hide: options.delay - } - } - - return options - } - - Tooltip.prototype.getDelegateOptions = function () { - var options = {} - var defaults = this.getDefaults() - - this._options && $.each(this._options, function (key, value) { - if (defaults[key] != value) options[key] = value - }) - - return options - } - - Tooltip.prototype.enter = function (obj) { - var self = obj instanceof this.constructor ? - obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) - - clearTimeout(self.timeout) - - self.hoverState = 'in' - - if (!self.options.delay || !self.options.delay.show) return self.show() - - self.timeout = setTimeout(function () { - if (self.hoverState == 'in') self.show() - }, self.options.delay.show) - } - - Tooltip.prototype.leave = function (obj) { - var self = obj instanceof this.constructor ? - obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) - - clearTimeout(self.timeout) - - self.hoverState = 'out' - - if (!self.options.delay || !self.options.delay.hide) return self.hide() - - self.timeout = setTimeout(function () { - if (self.hoverState == 'out') self.hide() - }, self.options.delay.hide) - } - - Tooltip.prototype.show = function () { - var e = $.Event('show.bs.' + this.type) - - if (this.hasContent() && this.enabled) { - this.$element.trigger(e) - - if (e.isDefaultPrevented()) return - var that = this; - - var $tip = this.tip() - - this.setContent() - - if (this.options.animation) $tip.addClass('fade') - - var placement = typeof this.options.placement == 'function' ? - this.options.placement.call(this, $tip[0], this.$element[0]) : - this.options.placement - - var autoToken = /\s?auto?\s?/i - var autoPlace = autoToken.test(placement) - if (autoPlace) placement = placement.replace(autoToken, '') || 'top' - - $tip - .detach() - .css({ top: 0, left: 0, display: 'block' }) - .addClass(placement) - - this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) - - var pos = this.getPosition() - var actualWidth = $tip[0].offsetWidth - var actualHeight = $tip[0].offsetHeight - - if (autoPlace) { - var $parent = this.$element.parent() - - var orgPlacement = placement - var docScroll = document.documentElement.scrollTop || document.body.scrollTop - var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth() - var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() - var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left - - placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' : - placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' : - placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' : - placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' : - placement - - $tip - .removeClass(orgPlacement) - .addClass(placement) - } - - var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) - - this.applyPlacement(calculatedOffset, placement) - this.hoverState = null - - var complete = function() { - that.$element.trigger('shown.bs.' + that.type) - } - - $.support.transition && this.$tip.hasClass('fade') ? - $tip - .one($.support.transition.end, complete) - .emulateTransitionEnd(150) : - complete() - } - } - - Tooltip.prototype.applyPlacement = function (offset, placement) { - var replace - var $tip = this.tip() - var width = $tip[0].offsetWidth - var height = $tip[0].offsetHeight - - // manually read margins because getBoundingClientRect includes difference - var marginTop = parseInt($tip.css('margin-top'), 10) - var marginLeft = parseInt($tip.css('margin-left'), 10) - - // we must check for NaN for ie 8/9 - if (isNaN(marginTop)) marginTop = 0 - if (isNaN(marginLeft)) marginLeft = 0 - - offset.top = offset.top + marginTop - offset.left = offset.left + marginLeft - - // $.fn.offset doesn't round pixel values - // so we use setOffset directly with our own function B-0 - $.offset.setOffset($tip[0], $.extend({ - using: function (props) { - $tip.css({ - top: Math.round(props.top), - left: Math.round(props.left) - }) - } - }, offset), 0) - - $tip.addClass('in') - - // check to see if placing tip in new offset caused the tip to resize itself - var actualWidth = $tip[0].offsetWidth - var actualHeight = $tip[0].offsetHeight - - if (placement == 'top' && actualHeight != height) { - replace = true - offset.top = offset.top + height - actualHeight - } - - if (/bottom|top/.test(placement)) { - var delta = 0 - - if (offset.left < 0) { - delta = offset.left * -2 - offset.left = 0 - - $tip.offset(offset) - - actualWidth = $tip[0].offsetWidth - actualHeight = $tip[0].offsetHeight - } - - this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') - } else { - this.replaceArrow(actualHeight - height, actualHeight, 'top') - } - - if (replace) $tip.offset(offset) - } - - Tooltip.prototype.replaceArrow = function (delta, dimension, position) { - this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '') - } - - Tooltip.prototype.setContent = function () { - var $tip = this.tip() - var title = this.getTitle() - - $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) - $tip.removeClass('fade in top bottom left right') - } - - Tooltip.prototype.hide = function () { - var that = this - var $tip = this.tip() - var e = $.Event('hide.bs.' + this.type) - - function complete() { - if (that.hoverState != 'in') $tip.detach() - that.$element.trigger('hidden.bs.' + that.type) - } - - this.$element.trigger(e) - - if (e.isDefaultPrevented()) return - - $tip.removeClass('in') - - $.support.transition && this.$tip.hasClass('fade') ? - $tip - .one($.support.transition.end, complete) - .emulateTransitionEnd(150) : - complete() - - this.hoverState = null - - return this - } - - Tooltip.prototype.fixTitle = function () { - var $e = this.$element - if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { - $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') - } - } - - Tooltip.prototype.hasContent = function () { - return this.getTitle() - } - - Tooltip.prototype.getPosition = function () { - var el = this.$element[0] - return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { - width: el.offsetWidth, - height: el.offsetHeight - }, this.$element.offset()) - } - - Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { - return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : - placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : - placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : - /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } - } - - Tooltip.prototype.getTitle = function () { - var title - var $e = this.$element - var o = this.options - - title = $e.attr('data-original-title') - || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) - - return title - } - - Tooltip.prototype.tip = function () { - return this.$tip = this.$tip || $(this.options.template) - } - - Tooltip.prototype.arrow = function () { - return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow') - } - - Tooltip.prototype.validate = function () { - if (!this.$element[0].parentNode) { - this.hide() - this.$element = null - this.options = null - } - } - - Tooltip.prototype.enable = function () { - this.enabled = true - } - - Tooltip.prototype.disable = function () { - this.enabled = false - } - - Tooltip.prototype.toggleEnabled = function () { - this.enabled = !this.enabled - } - - Tooltip.prototype.toggle = function (e) { - var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this - self.tip().hasClass('in') ? self.leave(self) : self.enter(self) - } - - Tooltip.prototype.destroy = function () { - clearTimeout(this.timeout) - this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) - } - - - // TOOLTIP PLUGIN DEFINITION - // ========================= - - var old = $.fn.tooltip - - $.fn.tooltip = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.tooltip') - var options = typeof option == 'object' && option - - if (!data && option == 'destroy') return - if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.tooltip.Constructor = Tooltip - - - // TOOLTIP NO CONFLICT - // =================== - - $.fn.tooltip.noConflict = function () { - $.fn.tooltip = old - return this - } - -}(jQuery); - -/* ======================================================================== - * Bootstrap: popover.js v3.1.1 - * http://getbootstrap.com/javascript/#popovers - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // POPOVER PUBLIC CLASS DEFINITION - // =============================== - - var Popover = function (element, options) { - this.init('popover', element, options) - } - - if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') - - Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { - placement: 'right', - trigger: 'click', - content: '', - template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' - }) - - - // NOTE: POPOVER EXTENDS tooltip.js - // ================================ - - Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) - - Popover.prototype.constructor = Popover - - Popover.prototype.getDefaults = function () { - return Popover.DEFAULTS - } - - Popover.prototype.setContent = function () { - var $tip = this.tip() - var title = this.getTitle() - var content = this.getContent() - - $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) - $tip.find('.popover-content')[ // we use append for html objects to maintain js events - this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' - ](content) - - $tip.removeClass('fade top bottom left right in') - - // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do - // this manually by checking the contents. - if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() - } - - Popover.prototype.hasContent = function () { - return this.getTitle() || this.getContent() - } - - Popover.prototype.getContent = function () { - var $e = this.$element - var o = this.options - - return $e.attr('data-content') - || (typeof o.content == 'function' ? - o.content.call($e[0]) : - o.content) - } - - Popover.prototype.arrow = function () { - return this.$arrow = this.$arrow || this.tip().find('.arrow') - } - - Popover.prototype.tip = function () { - if (!this.$tip) this.$tip = $(this.options.template) - return this.$tip - } - - - // POPOVER PLUGIN DEFINITION - // ========================= - - var old = $.fn.popover - - $.fn.popover = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.popover') - var options = typeof option == 'object' && option - - if (!data && option == 'destroy') return - if (!data) $this.data('bs.popover', (data = new Popover(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.popover.Constructor = Popover - - - // POPOVER NO CONFLICT - // =================== - - $.fn.popover.noConflict = function () { - $.fn.popover = old - return this - } - -}(jQuery); - -/* ======================================================================== - * Bootstrap: scrollspy.js v3.1.1 - * http://getbootstrap.com/javascript/#scrollspy - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // SCROLLSPY CLASS DEFINITION - // ========================== - - function ScrollSpy(element, options) { - var href - var process = $.proxy(this.process, this) - - this.$element = $(element).is('body') ? $(window) : $(element) - this.$body = $('body') - this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) - this.options = $.extend({}, ScrollSpy.DEFAULTS, options) - this.selector = (this.options.target - || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - || '') + ' .nav li > a' - this.offsets = $([]) - this.targets = $([]) - this.activeTarget = null - - this.refresh() - this.process() - } - - ScrollSpy.DEFAULTS = { - offset: 10 - } - - ScrollSpy.prototype.refresh = function () { - var offsetMethod = this.$element[0] == window ? 'offset' : 'position' - - this.offsets = $([]) - this.targets = $([]) - - var self = this - var $targets = this.$body - .find(this.selector) - .map(function () { - var $el = $(this) - var href = $el.data('target') || $el.attr('href') - var $href = /^#./.test(href) && $(href) - - return ($href - && $href.length - && $href.is(':visible') - && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null - }) - .sort(function (a, b) { return a[0] - b[0] }) - .each(function () { - self.offsets.push(this[0]) - self.targets.push(this[1]) - }) - } - - ScrollSpy.prototype.process = function () { - var scrollTop = this.$scrollElement.scrollTop() + this.options.offset - var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight - var maxScroll = scrollHeight - this.$scrollElement.height() - var offsets = this.offsets - var targets = this.targets - var activeTarget = this.activeTarget - var i - - if (scrollTop >= maxScroll) { - return activeTarget != (i = targets.last()[0]) && this.activate(i) - } - - if (activeTarget && scrollTop <= offsets[0]) { - return activeTarget != (i = targets[0]) && this.activate(i) - } - - for (i = offsets.length; i--;) { - activeTarget != targets[i] - && scrollTop >= offsets[i] - && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) - && this.activate( targets[i] ) - } - } - - ScrollSpy.prototype.activate = function (target) { - this.activeTarget = target - - $(this.selector) - .parentsUntil(this.options.target, '.active') - .removeClass('active') - - var selector = this.selector + - '[data-target="' + target + '"],' + - this.selector + '[href="' + target + '"]' - - var active = $(selector) - .parents('li') - .addClass('active') - - if (active.parent('.dropdown-menu').length) { - active = active - .closest('li.dropdown') - .addClass('active') - } - - active.trigger('activate.bs.scrollspy') - } - - - // SCROLLSPY PLUGIN DEFINITION - // =========================== - - var old = $.fn.scrollspy - - $.fn.scrollspy = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.scrollspy') - var options = typeof option == 'object' && option - - if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.scrollspy.Constructor = ScrollSpy - - - // SCROLLSPY NO CONFLICT - // ===================== - - $.fn.scrollspy.noConflict = function () { - $.fn.scrollspy = old - return this - } - - - // SCROLLSPY DATA-API - // ================== - - $(window).on('load', function () { - $('[data-spy="scroll"]').each(function () { - var $spy = $(this) - $spy.scrollspy($spy.data()) - }) - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: tab.js v3.1.1 - * http://getbootstrap.com/javascript/#tabs - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // TAB CLASS DEFINITION - // ==================== - - var Tab = function (element) { - this.element = $(element) - } - - Tab.prototype.show = function () { - var $this = this.element - var $ul = $this.closest('ul:not(.dropdown-menu)') - var selector = $this.data('target') - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - if ($this.parent('li').hasClass('active')) return - - var previous = $ul.find('.active:last a')[0] - var e = $.Event('show.bs.tab', { - relatedTarget: previous - }) - - $this.trigger(e) - - if (e.isDefaultPrevented()) return - - var $target = $(selector) - - this.activate($this.parent('li'), $ul) - this.activate($target, $target.parent(), function () { - $this.trigger({ - type: 'shown.bs.tab', - relatedTarget: previous - }) - }) - } - - Tab.prototype.activate = function (element, container, callback) { - var $active = container.find('> .active') - var transition = callback - && $.support.transition - && $active.hasClass('fade') - - function next() { - $active - .removeClass('active') - .find('> .dropdown-menu > .active') - .removeClass('active') - - element.addClass('active') - - if (transition) { - element[0].offsetWidth // reflow for transition - element.addClass('in') - } else { - element.removeClass('fade') - } - - if (element.parent('.dropdown-menu')) { - element.closest('li.dropdown').addClass('active') - } - - callback && callback() - } - - transition ? - $active - .one($.support.transition.end, next) - .emulateTransitionEnd(150) : - next() - - $active.removeClass('in') - } - - - // TAB PLUGIN DEFINITION - // ===================== - - var old = $.fn.tab - - $.fn.tab = function ( option ) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.tab') - - if (!data) $this.data('bs.tab', (data = new Tab(this))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.tab.Constructor = Tab - - - // TAB NO CONFLICT - // =============== - - $.fn.tab.noConflict = function () { - $.fn.tab = old - return this - } - - - // TAB DATA-API - // ============ - - $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { - e.preventDefault() - $(this).tab('show') - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: affix.js v3.1.1 - * http://getbootstrap.com/javascript/#affix - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // AFFIX CLASS DEFINITION - // ====================== - - var Affix = function (element, options) { - this.options = $.extend({}, Affix.DEFAULTS, options) - this.$window = $(window) - .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) - .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) - - this.$element = $(element) - this.affixed = - this.unpin = - this.pinnedOffset = null - - this.checkPosition() - } - - Affix.RESET = 'affix affix-top affix-bottom' - - Affix.DEFAULTS = { - offset: 0 - } - - Affix.prototype.getPinnedOffset = function () { - if (this.pinnedOffset) return this.pinnedOffset - this.$element.removeClass(Affix.RESET).addClass('affix') - var scrollTop = this.$window.scrollTop() - var position = this.$element.offset() - return (this.pinnedOffset = position.top - scrollTop) - } - - Affix.prototype.checkPositionWithEventLoop = function () { - setTimeout($.proxy(this.checkPosition, this), 1) - } - - Affix.prototype.checkPosition = function () { - if (!this.$element.is(':visible')) return - - var scrollHeight = $(document).height() - var scrollTop = this.$window.scrollTop() - var position = this.$element.offset() - var offset = this.options.offset - var offsetTop = offset.top - var offsetBottom = offset.bottom - - if (this.affixed == 'top') position.top += scrollTop - - if (typeof offset != 'object') offsetBottom = offsetTop = offset - if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) - if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) - - var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : - offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : - offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false - - if (this.affixed === affix) return - if (this.unpin) this.$element.css('top', '') - - var affixType = 'affix' + (affix ? '-' + affix : '') - var e = $.Event(affixType + '.bs.affix') - - this.$element.trigger(e) - - if (e.isDefaultPrevented()) return - - this.affixed = affix - this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null - - this.$element - .removeClass(Affix.RESET) - .addClass(affixType) - .trigger($.Event(affixType.replace('affix', 'affixed'))) - - if (affix == 'bottom') { - this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() }) - } - } - - - // AFFIX PLUGIN DEFINITION - // ======================= - - var old = $.fn.affix - - $.fn.affix = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.affix') - var options = typeof option == 'object' && option - - if (!data) $this.data('bs.affix', (data = new Affix(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.affix.Constructor = Affix - - - // AFFIX NO CONFLICT - // ================= - - $.fn.affix.noConflict = function () { - $.fn.affix = old - return this - } - - - // AFFIX DATA-API - // ============== - - $(window).on('load', function () { - $('[data-spy="affix"]').each(function () { - var $spy = $(this) - var data = $spy.data() - - data.offset = data.offset || {} - - if (data.offsetBottom) data.offset.bottom = data.offsetBottom - if (data.offsetTop) data.offset.top = data.offsetTop - - $spy.affix(data) - }) - }) - -}(jQuery); diff --git a/setup/pub/bootstrap/js/bootstrap.min.js b/setup/pub/bootstrap/js/bootstrap.min.js deleted file mode 100644 index b04a0e82fffee..0000000000000 --- a/setup/pub/bootstrap/js/bootstrap.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Bootstrap v3.1.1 (http://getbootstrap.com) - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});return this.$element.trigger(j),j.isDefaultPrevented()?void 0:(this.sliding=!0,f&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),f&&this.cycle(),this)};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);!e&&f.toggle&&"show"==c&&(c=!c),e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(b){a(d).remove(),a(e).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown",h),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=" li:not(.divider):visible a",i=f.find("[role=menu]"+h+", [role=listbox]"+h);if(i.length){var j=i.index(i.filter(":focus"));38==b.keyCode&&j>0&&j--,40==b.keyCode&&j<i.length-1&&j++,~j||(j=0),i.eq(j).focus()}}}};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new f(this)),"string"==typeof b&&d[b].call(c)})},a.fn.dropdown.Constructor=f,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",e,f.prototype.toggle).on("keydown.bs.dropdown.data-api",e+", [role=menu], [role=listbox]",f.prototype.keydown)}(jQuery),+function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};b.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},b.prototype.toggle=function(a){return this[this.isShown?"hide":"show"](a)},b.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d),this.isShown||d.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(document.body),c.$element.show().scrollTop(0),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});d?c.$element.find(".modal-dialog").one(a.support.transition.end,function(){c.$element.focus().trigger(e)}).emulateTransitionEnd(300):c.$element.focus().trigger(e)}))},b.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one(a.support.transition.end,a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},b.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.focus()},this))},b.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},b.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden.bs.modal")})},b.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},b.prototype.backdrop=function(b){var c=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=a.support.transition&&c;if(this.$backdrop=a('<div class="modal-backdrop '+c+'" />').appendTo(document.body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());c.is("a")&&b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this,d=this.tip();this.setContent(),this.options.animation&&d.addClass("fade");var e="function"==typeof this.options.placement?this.options.placement.call(this,d[0],this.$element[0]):this.options.placement,f=/\s?auto?\s?/i,g=f.test(e);g&&(e=e.replace(f,"")||"top"),d.detach().css({top:0,left:0,display:"block"}).addClass(e),this.options.container?d.appendTo(this.options.container):d.insertAfter(this.$element);var h=this.getPosition(),i=d[0].offsetWidth,j=d[0].offsetHeight;if(g){var k=this.$element.parent(),l=e,m=document.documentElement.scrollTop||document.body.scrollTop,n="body"==this.options.container?window.innerWidth:k.outerWidth(),o="body"==this.options.container?window.innerHeight:k.outerHeight(),p="body"==this.options.container?0:k.offset().left;e="bottom"==e&&h.top+h.height+j-m>o?"top":"top"==e&&h.top-m-j<0?"bottom":"right"==e&&h.right+i>n?"left":"left"==e&&h.left-i<p?"right":e,d.removeClass(l).addClass(e)}var q=this.getCalculatedOffset(e,h,i,j);this.applyPlacement(q,e),this.hoverState=null;var r=function(){c.$element.trigger("shown.bs."+c.type)};a.support.transition&&this.$tip.hasClass("fade")?d.one(a.support.transition.end,r).emulateTransitionEnd(150):r()}},b.prototype.applyPlacement=function(b,c){var d,e=this.tip(),f=e[0].offsetWidth,g=e[0].offsetHeight,h=parseInt(e.css("margin-top"),10),i=parseInt(e.css("margin-left"),10);isNaN(h)&&(h=0),isNaN(i)&&(i=0),b.top=b.top+h,b.left=b.left+i,a.offset.setOffset(e[0],a.extend({using:function(a){e.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),e.addClass("in");var j=e[0].offsetWidth,k=e[0].offsetHeight;if("top"==c&&k!=g&&(d=!0,b.top=b.top+g-k),/bottom|top/.test(c)){var l=0;b.left<0&&(l=-2*b.left,b.left=0,e.offset(b),j=e[0].offsetWidth,k=e[0].offsetHeight),this.replaceArrow(l-f+j,j,"left")}else this.replaceArrow(k-g,k,"top");d&&e.offset(b)},b.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},b.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach(),c.$element.trigger("hidden.bs."+c.type)}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one(a.support.transition.end,b).emulateTransitionEnd(150):b(),this.hoverState=null,this)},b.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},b.prototype.hasContent=function(){return this.getTitle()},b.prototype.getPosition=function(){var b=this.$element[0];return a.extend({},"function"==typeof b.getBoundingClientRect?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},b.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},b.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},b.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},b.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.toggleEnabled=function(){this.enabled=!this.enabled},b.prototype.toggle=function(b){var c=b?a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;c.tip().hasClass("in")?c.leave(c):c.enter(c)},b.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.tooltip",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.tooltip.Constructor=b,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(jQuery),+function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");b.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(b.RESET).addClass("affix");var a=this.$window.scrollTop(),c=this.$element.offset();return this.pinnedOffset=c.top-a},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"top"==this.affixed&&(e.top+=d),"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(b.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:c-h-this.$element.height()}))}}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); \ No newline at end of file diff --git a/setup/pub/fonts/icons/icons.eot b/setup/pub/fonts/icons/icons.eot deleted file mode 100644 index 5bc0bee548c35..0000000000000 Binary files a/setup/pub/fonts/icons/icons.eot and /dev/null differ diff --git a/setup/pub/fonts/icons/icons.svg b/setup/pub/fonts/icons/icons.svg deleted file mode 100644 index 4478010abc66d..0000000000000 --- a/setup/pub/fonts/icons/icons.svg +++ /dev/null @@ -1 +0,0 @@ -<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" ><svg xmlns="http://www.w3.org/2000/svg"><defs><font id="icomoon" horiz-adv-x="1024"><font-face units-per-em="1024" ascent="960" descent="-64" /><missing-glyph horiz-adv-x="1024" /><glyph unicode=" " horiz-adv-x="512" d="" /><glyph unicode="" glyph-name="account" horiz-adv-x="1090" d="M709.921 801.306c8.139-32.295 8.927-34.974 8.192-68.162-0.263-12.813-7.772-71.943-5.724-90.112 1.628-14.966 5.461-16.174 11.448-28.514 10.398-21.425 6.984-51.095 2.941-72.678-2.206-11.868-6.827-28.725-13.916-38.387-7.667-10.66-23.211-10.713-30.142-23.158-9.872-17.854-4.306-43.008-10.503-62.385-7.142-21.898-25.101-23.421-26.466-52.145 8.822-1.155 17.592-2.468 26.466-3.623 8.822-18.59 25.049-55.874 41.59-67.059 13.863-3.728 27.727-7.457 41.59-11.185 48.627-19.64 102.558-43.061 151.237-63.33 44.373-18.432 97.411-24.996 113.48-70.84 0-31.035 2.941-104.501 2.153-145.25h-965.553c-0.893 40.697 2.153 114.215 2.153 145.25 15.964 45.844 69.002 52.408 113.375 70.84 48.679 20.27 102.61 43.691 151.237 63.33 13.811 3.728 27.674 7.457 41.59 11.185 16.489 11.185 32.715 48.522 41.538 67.059l19.692 4.621c-4.464 24.576-19.85 26.466-26.256 43.743-2.521 26.099-5.041 52.145-7.509 78.192 0.053-1.155-18.117 3.361-20.48 4.779-25.731 15.806-26.204 80.24-28.725 107.021-1.103 12.183 16.174 22.265 11.343 44.636-28.094 131.44 12.183 192.88 75.881 213.307 44.216 17.749 126.871 50.465 203.855 3.728l19.167-17.487 30.93-5.251c15.491-8.77 25.416-38.124 25.416-38.124z" /><glyph unicode="" glyph-name="arrowdown" horiz-adv-x="1085" d="M529.203 73.86l-468.465 628.209h936.931l-468.465-628.209z" /><glyph unicode="" glyph-name="cms" horiz-adv-x="1034" d="M976.793-22.006h-910.388v910.388h910.388v-910.388zM912.622 824.211h-782.046v-782.088h782.046v782.088zM221.432 137.2h152.876v372.033h-152.876v-372.033zM466.323 139.766h350.932v366.53h-350.932v-366.53zM221.432 599.511h595.865v147.125h-595.865v-147.125z" /><glyph unicode="" glyph-name="customers" horiz-adv-x="489" d="M264.319 651.169c75.685 0 136.98 61.259 136.98 136.944 0 75.649-61.295 136.98-136.98 136.98s-137.017-61.331-137.017-136.98c0-75.649 61.331-136.944 137.017-136.944zM448.929 589.149c-28.962 28.926-63.325 46.252-187.655 46.252s-157.859-18.776-185.335-46.252c-27.44-27.44-18.196-320.43-18.196-320.43l60.824 144.411 38.241-430.334 110.23 220.278 102.907-220.278 36.393 430.334 60.824-144.411c-0.036 0 10.693 291.468-18.233 320.43z" /><glyph unicode="" glyph-name="dashboard" horiz-adv-x="1376" d="M680.975 886.272c-337.523 0-610.976-273.515-611.038-610.976 0.122-37.72 1.039-251.812 1.039-251.812h1219.997c0 0 0.978 239.219 1.039 251.812-0.183 337.523-273.637 610.976-611.038 610.976zM737.708 762.169c31.117-3.607 61.379-10.271 90.418-19.624l-19.93-61.685c-25.004 8.070-51.169 13.939-78.191 16.995l7.703 64.313zM270.091 286.85h-64.864c0 31.423 3.118 62.235 8.803 92.007l63.702-12.349c-5.135-25.799-7.642-52.392-7.642-79.658zM305.855 455.581l-59.178 26.288c12.655 28.489 28 55.449 45.79 80.636l52.942-37.475c-15.284-21.825-28.611-45.056-39.554-69.449zM407.46 594.845l-43.405 48.113c22.925 20.541 47.807 39.187 74.462 54.96l33.318-55.571c-22.987-13.755-44.567-29.65-64.374-47.501zM536.943 742.545c29.039 9.292 59.178 16.017 90.418 19.624l7.581-64.313c-26.838-3.057-53.003-8.926-78.13-16.995l-19.869 61.685zM761.673 158.468l-152.897-27.205-38.881 150.452 395.172 404.22-203.394-527.467zM1019.476 525.029l52.942 37.414c17.79-25.187 33.257-52.148 45.851-80.636l-59.178-26.288c-10.943 24.454-24.209 47.685-39.615 69.51zM1094.916 286.85c0 27.266-2.69 53.859-7.703 79.658l63.702 12.349c5.808-29.834 8.803-60.645 8.803-92.007h-64.802zM646.006 189.341c26.777-17.056 62.174-9.415 79.291 17.24 17.118 26.593 9.292 62.051-17.301 79.108-26.655 17.24-62.051 9.354-79.23-17.362-17.118-26.349-9.476-61.99 17.24-78.986z" /><glyph unicode="" glyph-name="filter" d="M24.097 846.535h972.827v-111.922l-410.504-412.792v-238.366l-171.447-87.505v325.871l-390.875 415.877v108.837z" /><glyph unicode="" glyph-name="logo" horiz-adv-x="903" d="M454.495 911.101l-402.697-240.513v-457.026l104.632-60.727v457.049l298.157 178.728 299.698-179.142-0.138-455.922 103.528 60.013v457.026l-403.18 240.513zM507.766 629.72v-534.344l-53.271-32.124-53.34 32.262v533.792l-138.090-83.853v-456.934l191.453-115.516 193.087 116.322v456.451l-139.839 83.945z" /><glyph unicode="" glyph-name="notification-02" horiz-adv-x="989" d="M870.821 228.163c-64.195 65.89-78.231 188.772-91.738 283.159-20.074 139.937-24.259 297.089-226.008 317.693v25.318c0 25.424-39.195 46.028-64.937 46.028s-62.024-20.551-62.024-46.028v-25.371c-200.054-20.816-206.993-177.914-226.855-317.693-13.453-94.439-27.331-217.268-91.049-283.264-12.818-13.348-16.473-32.998-9.11-49.947 7.362-16.843 24.153-27.913 42.797-27.913h695.343c18.75 0 35.593 11.070 42.903 28.019s3.655 36.653-9.322 50zM489.569-3.883c51.060 0 92.373 40.837 92.373 91.367h-184.694c-0.053-50.53 41.314-91.367 92.32-91.367z" /><glyph unicode="" glyph-name="product" horiz-adv-x="954" d="M252.137 806.772l-160.070-92.393 378.042-218.205 160.023 92.393-377.996 218.205zM845.638 712.937l-377.996 218.252-145.222-83.828 377.996-218.205 145.222 83.782zM502.784 433.85v-433.664l376.832 217.507v433.711l-376.832-217.553zM55.668 217.74l376.785-217.507v436.503l-376.785 217.46v-436.457z" /><glyph unicode="" glyph-name="promotions" horiz-adv-x="1170" d="M59.153 425.818l164.053-38.141v303.902l-164.053-38.141v-227.621zM1122.198 900.847l-837.712-194.959v-335.978l140.328-376.832 151.712 57.45-104.049 279.113 649.668-151.18v722.385z" /><glyph unicode="" glyph-name="reports" horiz-adv-x="991" d="M736.707-21.234h207.134v322.703h-207.134v-322.703zM399.646-21.234h207.134v946.793h-207.134v-946.793zM62.673-21.19h207.134v634.704h-207.134v-634.704z" /><glyph unicode="" glyph-name="sales" horiz-adv-x="659" d="M426.502 347.483c-15.866 13.512-42.796 25.753-80.79 36.723v-198.774c11.535 1.459 23.729 4.331 36.299 8.851 12.618 4.426 23.87 10.829 33.804 19.068 9.981 8.427 18.173 18.55 24.529 30.649 6.638 12.006 9.651 26.365 9.651 42.89 0.047 26.836-7.721 47.222-23.493 60.593zM576.736 223.144c-7.109-23.117-19.774-45.762-38.135-67.749-18.503-22.175-43.079-41.855-74.010-58.992-30.885-17.373-70.432-27.683-118.878-31.12v-88.088h-57.014v88.088c-72.080 5.603-128.483 29.237-169.113 71.374-40.536 42.090-63.935 104.095-70.432 185.544h136.251c-0.753-39.359 8.992-70.479 28.86-93.266 20.15-22.74 44.774-37.335 74.434-43.455v216.523c-3.060 1.318-7.486 2.919-12.994 4.567-5.508 1.789-11.393 3.343-17.938 4.708-23.776 6.827-47.175 15.019-70.291 24.294-23.493 9.369-44.114 21.704-62.523 37.335-18.456 15.584-33.098 34.84-43.879 57.956-11.111 23.211-16.478 51.977-16.478 86.487 0 35.31 6.168 66.336 18.785 93.313 12.665 26.836 29.143 49.529 49.858 67.702 20.621 18.314 44.303 32.58 71.468 42.419 27.071 10.122 55.037 16.149 83.992 18.314v79.66h57.014v-79.66c29.143-3.531 56.308-10.169 81.638-20.292 25.423-10.028 47.787-23.729 67.137-41.478 19.585-17.514 35.357-39.453 47.457-65.771 12.288-26.13 19.35-57.109 21.28-93.172h-137.287c-0.518 27.636-8.616 51.082-23.917 70.432-15.725 19.303-34.275 29.002-56.308 29.002v-183.331c7.862-2.072 15.631-4.143 23.729-6.12 8.098-2.072 16.525-4.567 25.565-7.297 47.645-13.983 84.415-31.12 110.168-51.318 25.8-20.292 44.726-41.666 56.92-63.653 12.335-22.175 19.633-44.256 21.704-66.336 2.448-22.081 3.531-41.713 3.531-59.039 0.047-15.207-3.531-34.416-10.593-57.579zM228.905 696.585c-8.38-7.156-15.113-16.196-19.962-26.883-4.802-10.781-7.062-23.352-7.062-37.759 0-22.834 6.733-40.536 20.103-52.824 13.653-12.618 35.734-22.552 66.713-30.131v168.831c-10.829 0-21.516-1.695-31.826-5.226-10.216-3.437-19.633-8.851-27.966-16.007z" /><glyph unicode="" glyph-name="search" horiz-adv-x="1109" d="M555.139 938.358c-218.775 71.601-457.062-40.29-532.231-250.028-75.227-209.681 41.211-437.665 259.928-509.208 218.717-71.601 457.004 40.348 532.231 250.028s-41.211 437.665-259.928 509.208zM320.076 282.955c-158.915 52.089-243.467 217.681-188.903 369.978 54.679 152.296 227.754 233.625 386.669 181.593s243.409-217.624 188.788-369.92c-54.622-152.296-227.696-233.567-386.554-181.65zM638.482 274.206l358.927-349.602 24.807 69.241 24.865 69.241-310.348 302.29z" /><glyph unicode="" glyph-name="stores" horiz-adv-x="1280" d="M1098.281 874.55c19.777 3.723 34.901 21.232 34.901 42.347-0.058 23.791-19.196 43.103-42.812 43.103h-900.508c-23.675 0-42.754-19.312-42.754-43.103 0-21.057 15.007-38.566 34.843-42.347l-181.951-354.421v-68.988c0-30.946 32.516-56.016 72.594-56.016 13.437 0 26.001 2.908 36.821 7.795v-466.919h1061.286v466.919c10.878-4.944 23.326-7.795 36.879-7.795 40.078 0 72.594 25.071 72.594 56.016v68.988l-181.893 354.421zM214.758 395.125c-38.217 0-69.221 25.071-69.221 56.016v6.457h-0.349v62.531l137.162 353.665h109.648l-107.961-353.665v-68.988c0 0 0 0 0 0 0-30.946-31.004-56.016-69.279-56.016zM498.447 395.125c-38.217 0-69.221 25.071-69.221 56.016v68.988l57.354 353.665h109.241l-28.095-353.665v-68.93c-0.058-31.004-31.004-56.075-69.279-56.075zM782.077 395.125c-38.217 0-69.162 25.071-69.162 56.016v68.988l-28.154 353.665h108.892l57.296-353.665v-68.988c0-0.931 0.175-1.92 0.233-2.792-1.803-29.666-32.051-53.224-69.104-53.224zM1134.637 451.141c0-30.946-31.004-56.016-69.221-56.016s-69.162 25.071-69.162 56.016v68.988l-108.019 353.665h109.59l137.22-353.665v-62.473h-0.349v-6.515h-0.058z" /><glyph unicode="" glyph-name="views" horiz-adv-x="1890" d="M944.97 630.958c-97.861 0-177.522-79.581-177.522-177.443 0-97.94 79.66-177.679 177.522-177.679 98.019 0 177.679 79.739 177.679 177.679 0 97.861-79.66 177.443-177.679 177.443zM944.97 960c-470.712 0-944.97-512-944.97-512s474.258-512 944.97-512c470.949 0 945.128 512 945.128 512s-474.179 512-945.128 512zM944.97 91.144c-200.057 0-362.292 162.078-362.292 362.45 0 200.057 162.236 362.292 362.292 362.292 200.214 0 362.45-162.236 362.45-362.292 0-200.451-162.236-362.45-362.45-362.45z" /><glyph unicode="" glyph-name="system-config" d="M1020.032 394.445v116.045l-16.41 5.376-124.237 40.525-33.152 80.102 63.718 134.784-82.048 82.125-15.411-7.808-116.531-59.213-80.077 33.178-50.278 140.442h-116.096l-45.875-140.698-80-33.126-134.963 63.744-82.022-82.074 7.834-15.334 59.162-116.608-33.126-80.026-140.518-50.253v-116.147l16.435-5.325 124.288-40.576 33.075-80-63.693-134.886 82.048-82.099 131.942 66.97 80.026-33.152 50.304-140.39h116.096l5.35 16.41 40.55 124.237 80.077 33.178 134.886-63.718 82.074 82.074-7.834 15.386-59.213 116.582 33.203 80.026 140.416 50.253zM510.003 287.411c-89.754 0-162.509 72.832-162.509 162.611 0 89.754 72.755 162.483 162.509 162.483 89.83 0 162.509-72.73 162.509-162.483 0.026-89.805-72.653-162.611-162.509-162.611z" /><glyph unicode="" glyph-name="home" d="M509.978 905.574l-509.978-509.926 95.949-95.949 414.106 413.978 413.875-413.978 95.949 95.898-509.901 509.978zM146.253 271.437v-335.437h259.917v304.819h207.514v-304.819h259.917v335.488l-363.622 363.597-363.725-363.648z" /><glyph unicode="" glyph-name="lego" d="M0 223.59l498.278-287.59v421.402l-498.278 287.667v-421.478zM894.464 735.514v-44.262c0-32.819-62.797-59.418-140.365-59.418-77.466 0-140.262 26.598-140.262 59.418v73.216h0.435c4.71-30.925 65.408-55.475 139.853-55.475 77.568 0 140.365 26.624 140.365 59.29 0 32.845-62.797 59.366-140.365 59.366-6.195 0-12.262-0.205-18.202-0.563l-90.317 52.147v-55.706c0-32.819-62.72-59.392-140.262-59.392-48.691 0-91.597 10.496-116.813 26.47-3.584 3.712-7.987 7.245-13.312 10.598-6.579 6.861-10.24 14.387-10.24 22.323v53.939l-87.322-50.381c-6.272 0.307-12.646 0.614-19.123 0.614-77.491 0-140.314-26.522-140.314-59.366 0-32.691 62.822-59.29 140.314-59.29 74.445 0 135.219 24.525 139.93 55.475h0.384v-73.216c0-32.819-62.746-59.418-140.314-59.418-77.491 0-140.314 26.598-140.314 59.418v43.622l-108.083-62.31 499.994-288.563 496.691 286.694-112.358 64.768zM646.784 551.987c0-32.794-62.874-59.315-140.365-59.315s-140.339 26.522-140.339 59.315v73.267h0.41c4.762-30.95 65.459-55.475 139.93-55.475s135.142 24.525 139.904 55.475h0.486v-73.267zM525.645 353.766v-417.766l498.355 287.718v417.766l-498.355-287.718zM505.318 841.344c77.542 0 140.262 26.547 140.262 59.315s-62.72 59.315-140.262 59.315c-77.491 0-140.339-26.573-140.339-59.315-0.026-32.768 62.822-59.315 140.339-59.315z" /><glyph unicode="" glyph-name="tool" d="M287.002 478.336c0.205-0.23 0.461-0.486 0.691-0.717l103.347-103.373 36.045 36.045-56.55 56.499 90.266 90.189 11.904-1.28c3.046-0.307 6.093-0.538 9.19-0.538 6.246 0 12.314 0.768 18.253 2.125l-66.381 66.381c-1.357 1.382-2.765 2.611-4.173 3.814 20.454 73.6 1.766 155.725-56.038 213.555-57.421 57.421-138.803 76.237-211.968 56.525l123.955-123.981-32.563-121.446-121.395-32.589-124.032 124.006c-19.712-73.19-0.896-154.573 56.525-212.019 60.262-60.288 147.021-77.952 222.925-53.197zM653.235 404.198c-1.997-8.909-2.509-18.202-1.459-27.546l1.306-11.93-90.189-90.189-56.55 56.55-36.070-36.122 327.219-327.194c20.198-20.173 46.618-30.259 73.062-30.259s52.915 10.086 73.037 30.259c40.346 40.32 40.346 105.728 0 146.074l-290.355 290.355zM905.907 1.638l-51.866-13.875-42.112 42.112 13.901 51.891 51.866 13.926 42.112-42.138-13.901-51.917zM506.701 365.901l56.576-56.576 64.128 64.154c-3.482 31.334 6.707 63.821 30.669 87.808 24.013 23.962 56.474 34.176 87.808 30.72l280.397 280.346-157.056 157.056-280.448-280.397c3.482-31.258-6.682-63.821-30.669-87.782-24.013-23.987-56.525-34.176-87.808-30.643l-64.102-64.205 56.499-56.422-277.043-277.12-10.138 10.138-53.248-42.829-89.421-141.312 22.835-22.835 141.312 89.421 42.803 53.222-10.138 10.138 277.043 277.12z" /><glyph unicode="" glyph-name="upgrade" d="M1023.932 454.895c-3.717 282.692-236.1 508.826-518.793 505.003-282.658-3.775-508.826-236.066-505.071-518.827 3.772-282.556 236.1-508.826 518.793-505.003 282.658 3.768 508.826 236.066 505.071 518.827zM623.991 478.696v-298.633h-223.983v298.633h-186.621l298.633 298.633 298.667-298.633h-186.679z" /><glyph unicode="" glyph-name="expand-close" d="M512.794 960c-283.187 0-512.794-229.581-512.794-512.794 0-283.187 229.606-512.794 512.794-512.794s512.794 229.632 512.794 512.794c0 283.213-229.581 512.794-512.794 512.794zM512.794-11.213c-253.158 0-458.394 205.261-458.394 458.368 0 253.158 205.261 458.394 458.394 458.394 253.184 0 458.394-205.235 458.394-458.394 0.026-253.107-205.21-458.368-458.394-458.368zM760.013 334.387l30.387 38.4-265.6 206.413-20.787 1.613-259.226-208.026 28.826-39.987 236.8 177.613z" /><glyph unicode="" glyph-name="expand-open" d="M512.794 960c-283.187 0-512.794-229.581-512.794-512.794 0-283.187 229.606-512.794 512.794-512.794s512.794 229.606 512.794 512.794c0 283.213-229.581 512.794-512.794 512.794zM512.794-11.213c-253.158 0-458.394 205.261-458.394 458.394 0 253.158 205.261 458.394 458.394 458.394 253.184 0 458.394-205.235 458.394-458.394 0.026-253.133-205.21-458.394-458.394-458.394zM265.6 505.6l-30.387-38.4 265.574-206.387 20.813-1.613 259.2 208-28.8 39.987-236.8-177.587z" /><glyph unicode="" glyph-name="gripper" d="M259.2 960h214.323v-214.323h-214.323v214.323zM259.2 690.125h214.323v-214.349h-214.323v214.349zM259.2 420.224h214.323v-214.349h-214.323v214.349zM259.2 150.349h214.323v-214.349h-214.323v214.349zM549.325 960h214.323v-214.323h-214.323v214.323zM549.325 690.125h214.323v-214.349h-214.323v214.349zM549.325 420.224h214.323v-214.349h-214.323v214.349zM549.325 150.349h214.323v-214.349h-214.323v214.349z" /><glyph unicode="" glyph-name="forward" d="M860.058 774.938v-272l-430.029 269.158-1.894-253.491-424.371 249.754-3.763-647.834 426.24 241.28-5.606-239.437 439.424 252.16v-259.635h163.942v660.045z" /><glyph unicode="" glyph-name="backward" d="M163.942 114.893v271.974l430.029-269.133 1.894 253.491 424.397-249.754 3.738 647.834-426.24-241.28 5.606 239.437-439.424-252.16v259.635h-163.942v-660.045z" /><glyph unicode="" glyph-name="info" d="M505.704 919.002c-260.096-3.489-468.158-217.202-464.706-477.336 3.489-259.982 217.202-468.12 477.298-464.631s468.158 217.202 464.706 477.336c-3.413 260.058-217.202 468.12-477.298 464.631zM557.928 762.027c47.863 0 62.009-27.762 62.009-59.544 0-39.671-31.782-76.383-86.016-76.383-45.359 0-66.901 22.831-65.65 60.53 0 31.782 26.624 75.435 89.657 75.435zM435.162 153.619c-32.73 0-56.661 19.873-33.792 107.217l37.547 154.814c6.485 24.841 7.585 34.778 0 34.778-9.785 0-52.262-17.143-77.407-34.057l-16.346 26.776c79.607 66.446 171.16 105.472 210.375 105.472 32.73 0 38.153-38.722 21.807-98.266l-43.008-162.816c-7.585-28.786-4.286-38.722 3.262-38.722 9.785 0 41.984 11.871 73.614 36.75l18.47-24.841c-77.369-77.369-161.792-107.179-194.56-107.179z" /><glyph unicode="" glyph-name="lock" d="M591.986 511.981h-16.005v192.019c0 105.851-86.13 192.019-192.019 192.019h-128c-105.851 0-192.019-86.13-192.019-192.019v-192.019h-16.005c-26.396 0-48.014-21.618-48.014-48.014v-479.991c0-26.396 21.618-48.014 48.014-48.014h544.009c26.396 0 48.014 21.618 48.014 48.014v479.991c0 26.396-21.618 48.014-48.014 48.014zM384 64h-128l27.838 139.188c-16.801 11.529-27.838 30.872-27.838 52.793 0 35.347 28.672 64.019 64.019 64.019s64.019-28.672 64.019-64.019c0-21.921-11.036-41.263-27.838-52.793l27.838-139.188zM448.019 511.981h-256v192.019c0 35.271 28.71 64.019 64.019 64.019h128c35.271 0 64.019-28.71 64.019-64.019v-192.019z" /><glyph unicode="" glyph-name="loop" d="M870.4 642.56h-194.56v-143.36h153.6v-215.040h-634.88v215.040h215.040v-112.64l204.8 184.32-204.8 184.32v-112.64h-256c-56.51 0-102.4-45.815-102.4-102.4v-296.96c0-56.51 45.89-102.4 102.4-102.4h716.8c56.585 0 102.4 45.89 102.4 102.4v296.96c0 56.585-45.815 102.4-102.4 102.4z" /><glyph unicode="" glyph-name="plus" d="M991.991 576h-351.991v351.991c0 17.673-14.336 32.009-32.009 32.009h-192.019c-17.673 0-32.009-14.336-32.009-32.009v-351.991h-351.991c-17.673 0-32.009-14.336-32.009-32.009v-192.019c0-17.673 14.336-32.009 32.009-32.009h351.991v-351.991c0-17.673 14.336-32.009 32.009-32.009h192.019c17.673 0 32.009 14.336 32.009 32.009v351.991h351.991c17.673 0 32.009 14.336 32.009 32.009v192.019c0 17.673-14.336 32.009-32.009 32.009z" /><glyph unicode="" glyph-name="recover" d="M505.704 919.002c-260.096-3.489-468.158-217.126-464.706-477.298 3.489-260.21 217.202-468.158 477.298-464.744 260.134 3.489 468.233 217.202 464.706 477.298-3.489 260.21-217.202 468.233-477.298 464.744zM506.577 857.6c70.163 0.986 136.382-15.853 194.56-46.118l-63.374-105.662c-38.002 18.47-80.631 28.937-125.762 28.937-45.056 0-87.723-10.43-125.687-28.975l-63.336 105.624c54.993 28.672 117.343 45.321 183.599 46.232zM254.255 322.313l-105.586-63.298c-28.672 54.955-45.321 117.305-46.194 183.486-0.986 70.201 15.853 136.457 46.118 194.56l105.624-63.45c-18.546-37.926-28.975-80.555-28.975-125.649 0-45.056 10.43-87.723 28.975-125.687zM517.461 38.438c-70.163-0.986-136.457 15.853-194.56 46.118l63.374 105.662c38.002-18.546 80.631-28.975 125.687-28.975 45.094 0 87.761 10.392 125.687 28.937l63.336-105.586c-54.993-28.634-117.305-45.246-183.561-46.194zM512 222.758c-124.397 0-225.242 100.883-225.242 225.242 0 124.397 100.883 225.28 225.242 225.28 124.473 0 225.28-100.883 225.28-225.28s-100.807-225.242-225.28-225.242zM769.745 322.313c18.546 38.002 28.975 80.631 28.975 125.687 0 45.094-10.43 87.723-28.975 125.687l105.586 63.374c28.672-54.993 45.359-117.305 46.232-183.561 0.91-70.201-15.929-136.457-46.194-194.56l-105.624 63.336z" /><glyph unicode="" glyph-name="refresh" horiz-adv-x="1176" d="M906.126 824.187v0c-91.174 75.89-202.487 113.171-312.548 113.057-127.014 0.038-253.611-49.683-348.16-145.636l-95.004 79.265-1.593-305.342 300.184 56.282-99.442 82.944c67.546 64.247 155.269 97.204 244.015 97.28 79.948-0.038 159.782-26.7 226.114-81.806 84.347-70.125 127.659-170.629 127.772-272.46-0.038-14.715-0.948-29.431-2.769-44.070l137.519 26.283c0.19 5.954 0.303 11.871 0.303 17.787 0.152 140.098-60.151 279.78-176.431 376.415zM839.035 193.024c-67.736-65.498-156.255-99.025-245.912-99.1-79.986 0.038-159.82 26.738-226.114 81.806-84.347 70.125-127.697 170.629-127.772 272.498 0 16.839 1.252 33.716 3.679 50.366l-138.164-25.941c-0.379-8.116-0.683-16.346-0.683-24.462-0.114-140.174 60.226-279.817 176.545-376.491 91.136-75.852 202.411-113.057 312.51-112.981h0.341c127.924 0 255.241 50.441 349.943 147.759l90.795-75.207 0.569 305.38-299.956-57.344 104.183-86.281z" /><glyph unicode="" glyph-name="remove-small" horiz-adv-x="1176" d="M593.351 938.268c-270.753 0-490.268-219.477-490.268-490.231s219.515-490.268 490.268-490.268 490.231 219.515 490.231 490.268c0 270.753-219.477 490.231-490.231 490.231zM828.947 276.347l-72.363-72.363-162.095 162.133-164.902-164.902-73.121 73.121 164.902 164.902-161.678 161.678 72.363 72.325 161.602-161.678 165.774 165.736 73.121-73.083-165.774-165.736 162.171-162.133z" /><glyph unicode="" glyph-name="retweet" d="M254.976 284.16v267.264h103.424l-179.2 203.776-179.2-203.776h103.424v-308.224c0-56.51 45.815-102.4 102.4-102.4h459.776l-131.186 143.36h-279.438zM920.538 344.576v308.224c0 56.51-45.89 102.4-102.4 102.4h-459.738l131.11-143.36h279.514v-267.264h-103.424l179.2-203.776 179.2 203.776h-103.462z" /><glyph unicode="" glyph-name="unlocked" d="M768 895.981h-128c-105.851 0-192.019-86.13-192.019-192.019v-192.019h-400.005c-26.396 0-48.014-21.618-48.014-48.014v-479.991c0-26.396 21.618-48.014 48.014-48.014h544.009c26.396 0 48.014 21.618 48.014 48.014v479.991c0 26.396-21.618 48.014-48.014 48.014h-16.005v192.019c0 35.271 28.71 64.019 64.019 64.019h128c35.271 0 64.019-28.71 64.019-64.019v-192.019h128v192.019c0 105.851-86.13 192.019-192.019 192.019zM384 64h-128l27.838 139.188c-16.801 11.529-27.838 30.872-27.838 52.793 0 35.347 28.672 64.019 64.019 64.019s64.019-28.672 64.019-64.019c0-21.921-11.036-41.263-27.838-52.793l27.838-139.188z" /><glyph unicode="" glyph-name="warning" horiz-adv-x="1176" d="M593.351 960l-593.351-1023.962h1186.74l-593.351 1023.962zM653.236 60.549h-125.421v121.211h125.421v-121.211zM622.175 231.671h-62.502l-34.816 288.313v156.748h131.3v-156.748l-33.982-288.313z" /><glyph unicode="" glyph-name="arrow-left" d="M0 448l512-512v320.019h512v384h-512v320.019z" /><glyph unicode="" glyph-name="arrow-right" d="M1024 448l-512 512v-320.019h-512v-384h512v-320.019z" /><glyph unicode="" glyph-name="back-arrow" d="M402.735 813.265l-320.019-320.019c-24.993-24.993-24.993-65.498 0-90.491l320.019-320.019c24.993-24.993 65.498-24.993 90.491 0s24.993 65.498 0 90.491l-210.754 210.754h613.49c35.347 0 64.019 28.634 64.019 64.019s-28.672 64.019-64.019 64.019h-613.49l210.754 210.754c12.478 12.478 18.735 28.862 18.735 45.246s-6.258 32.768-18.735 45.246c-24.993 24.993-65.498 24.993-90.491 0z" /><glyph unicode="" glyph-name="calendar" horiz-adv-x="1176" d="M507.259 381.478h-102.059v-101.717h102.059v101.717zM650.885 245.286h-101.945v-101.717h101.945v101.717zM507.259 245.286h-102.059v-101.717h102.059v101.717zM507.259 517.67h-102.059v-101.679h102.059v101.679zM843.131 715.909c23.4 0 42.287 18.887 42.287 42.174v145.408c0 23.324-18.887 42.174-42.287 42.174s-42.325-18.849-42.325-42.174v-145.408c0.038-23.324 18.925-42.174 42.325-42.174zM343.419 715.909c23.362 0 42.249 18.887 42.249 42.174v145.408c0 23.324-18.887 42.174-42.249 42.174-23.4 0-42.325-18.849-42.325-42.174v-145.408c0-23.324 18.925-42.174 42.325-42.174zM363.444 381.478h-102.059v-101.717h102.059v101.717zM363.444 245.286h-102.059v-101.717h102.059v101.717zM650.885 381.478h-101.945v-101.717h101.945v101.717zM938.325 381.478h-102.059v-101.717h102.059v101.717zM938.325 517.67h-102.059v-101.679h102.059v101.679zM899.337 875.615v-46.914c17.598-15.474 28.71-38.153 28.71-63.412 0-46.801-37.964-84.764-84.916-84.764s-84.954 37.964-84.954 84.764c0 25.259 11.15 47.938 28.71 63.412v46.914h-387.262v-46.914c17.56-15.474 28.71-38.153 28.71-63.412 0-46.801-38.002-84.764-84.916-84.764s-84.954 37.964-84.954 84.764c0 25.259 11.15 47.938 28.71 63.412v46.914h-192.322v-925.279h997.035v925.279h-192.512zM999.234 44.696h-809.832v589.938h809.832v-589.938zM650.885 517.67h-101.945v-101.679h101.945v101.679zM794.624 517.67h-101.983v-101.679h101.983v101.679zM794.624 245.286h-101.983v-101.717h101.983v101.717zM794.624 381.478h-101.983v-101.717h101.983v101.717z" /><glyph unicode="" glyph-name="caret-down" d="M132.21 673.242c-13.881 13.729-36.295 13.729-50.138 0-13.805-13.653-13.805-35.878 0-49.607l404.897-400.877c13.881-13.729 36.257-13.729 50.138 0l404.897 400.877c13.805 13.729 13.881 35.878 0 49.607s-36.371 13.729-50.138 0.038l-379.866-365.606-379.79 365.568z" /><glyph unicode="" glyph-name="caret-left" d="M737.242 68.21c13.729-13.881 13.729-36.257 0-50.138s-35.878-13.881-49.607 0l-400.877 404.821c-13.729 13.881-13.729 36.295 0 50.138l400.877 404.897c13.729 13.881 35.878 13.881 49.607 0s13.729-36.257 0-50.138l-365.568-379.79 365.568-379.79z" /><glyph unicode="" glyph-name="caret-right" d="M286.72 68.21c-13.729-13.881-13.729-36.257 0-50.138s35.878-13.881 49.607 0l400.877 404.821c13.729 13.881 13.729 36.295 0 50.138l-400.915 404.897c-13.729 13.881-35.878 13.881-49.607 0s-13.729-36.257 0-50.138l365.568-379.79-365.568-379.79z" /><glyph unicode="" glyph-name="caret-up" d="M891.79 222.758c13.881-13.729 36.295-13.729 50.138 0 13.881 13.729 13.881 35.878 0 49.607l-404.897 400.877c-13.805 13.729-36.257 13.729-50.062 0l-404.897-400.877c-13.805-13.729-13.881-35.878 0-49.607s36.257-13.729 50.138 0l379.79 365.606 379.79-365.606z" /><glyph unicode="" glyph-name="ccw" d="M574.767 867.84c-227.593 0-412.672-182.386-418.247-409.335h-125.8l188.378-209.92 188.302 209.92h-146.242c5.537 168.998 143.777 304.393 313.609 304.393 173.397 0 313.913-140.971 313.913-314.899s-140.478-314.861-313.913-314.861c-69.48 0-133.689 22.718-185.685 61.099l-71.983-76.99c70.997-55.751 160.465-89.050 257.707-89.050 231.159 0 418.551 187.961 418.551 419.84-0.038 231.879-187.43 419.84-418.551 419.84z" /><glyph unicode="" glyph-name="check-mage" horiz-adv-x="1176" d="M996.617 833.214l-513.555-513.555-256.796 256.834-128.379-128.417 385.214-385.252 641.896 642.010z" /><glyph unicode="" glyph-name="clock" d="M512 919.040c-260.134 0-471.040-210.944-471.040-471.040 0-260.134 210.906-471.040 471.040-471.040s471.040 210.906 471.040 471.040c0 260.134-210.906 471.040-471.040 471.040zM512 79.36c-203.624 0-368.64 165.054-368.64 368.64s165.016 368.64 368.64 368.64 368.64-165.054 368.64-368.64-165.016-368.64-368.64-368.64zM547.84 714.24h-71.68v-281.069l174.345-174.345 50.669 50.707-153.335 153.335z" /><glyph unicode="" glyph-name="close-mage" horiz-adv-x="1176" d="M1094.391 882.29l-77.71 77.71-423.329-423.347-423.33 423.347-77.71-77.672 423.35-423.368-423.312-423.329 77.672-77.71 423.338 423.338 423.283-423.3 77.671 77.71-423.263 423.281z" /><glyph unicode="" glyph-name="delete" horiz-adv-x="1176" d="M337.541-61.004h513.024l64.512 645.916h-639.128l61.592-645.916zM737.394 805.831v116.508c0 19.191-15.398 34.702-34.361 34.702h-217.847c-19.001 0-34.361-15.55-34.361-34.702v-114.574c-73.576-8.382-150.149-24.614-226.494-52.338v-106.989h738.001v109.833c0 0-90.074 31.403-224.977 47.559zM668.937 812.241c-47.749 3.224-99.252 4.096-153.297 0.986v61.44c0 9.519 7.623 17.332 17.143 17.332h118.936c9.519 0 17.218-7.813 17.218-17.332v-62.426z" /><glyph unicode="" glyph-name="edit" horiz-adv-x="1176" d="M928.503 933.111l-111.502-112.109 156.065-156.9 111.502 112.071-156.065 156.937zM215.002 215.59l156.065-156.9 535.211 538.093-156.065 156.9-535.211-538.093zM103.917-47.161l188.985 49.873-139.302 140.098-49.683-190.009z" /><glyph unicode="" glyph-name="error" d="M1014.67 137.349c0 0 0 0 0 0l-310.651 310.651 310.651 310.651c0 0 0 0 0 0 3.337 3.337 5.765 7.244 7.32 11.416 4.248 11.378 1.82 24.69-7.32 33.83l-146.735 146.735c-9.14 9.14-22.452 11.567-33.83 7.32-4.172-1.555-8.078-3.982-11.416-7.32 0 0 0 0 0 0l-310.651-310.651-310.651 310.651c0 0 0 0 0 0-3.337 3.337-7.244 5.765-11.416 7.32-11.378 4.248-24.69 1.82-33.83-7.32l-146.735-146.735c-9.14-9.14-11.567-22.452-7.32-33.83 1.555-4.172 3.982-8.078 7.32-11.416 0 0 0 0 0 0l310.651-310.651-310.651-310.651c0 0 0 0 0 0-3.337-3.337-5.765-7.244-7.32-11.416-4.248-11.378-1.82-24.69 7.32-33.83l146.735-146.735c9.14-9.14 22.452-11.567 33.83-7.32 4.172 1.555 8.078 3.982 11.416 7.32 0 0 0 0 0 0l310.651 310.651 310.651-310.651c0 0 0 0 0 0 3.337-3.337 7.244-5.765 11.416-7.32 11.378-4.248 24.69-1.82 33.83 7.32l146.735 146.735c9.14 9.14 11.567 22.452 7.32 33.83-1.555 4.172-3.982 8.078-7.32 11.416z" /><glyph unicode="" glyph-name="help" horiz-adv-x="1176" d="M593.351 937.434c-270.336 0-489.434-219.098-489.434-489.358s219.098-489.434 489.434-489.434 489.434 219.136 489.434 489.434-219.136 489.358-489.434 489.358zM635.752 133.404c-11.985-11.719-26.396-17.636-43.16-17.636-8.154 0-15.967 1.517-23.4 4.589-7.358 3.034-13.843 7.168-19.456 12.174-5.613 5.158-10.126 11.226-13.388 18.356-3.337 7.13-4.968 14.753-4.968 22.945 0 16.308 5.992 30.303 17.977 42.060 11.947 11.681 26.396 17.598 43.198 17.598 16.308 0 30.606-5.689 42.78-16.801 12.25-11.188 18.318-24.993 18.318-41.339-0.038-16.384-5.992-30.303-17.939-41.984zM778.923 577.327c-3.982-13.767-9.747-26.396-17.18-37.774-7.471-11.454-16.498-22.49-27.079-33.071s-22.49-21.618-35.65-33.033c-11.454-9.785-20.783-18.318-27.913-25.79-7.168-7.396-12.895-14.867-17.218-22.338-4.286-7.433-7.282-15.398-9.026-24.007-1.707-8.609-2.617-49.721-2.617-62.35v-22.338h-101.376v32.616c0 13.729 0.986 56.661 3.034 67.584s5.158 21.125 9.481 30.872 10.012 19.228 17.18 28.369c7.168 9.14 16.232 18.887 27.079 29.203l38.647 36.902c10.847 9.747 20.177 20.632 27.951 32.616 7.737 12.060 11.529 26.7 11.529 43.88 0 22.3-6.978 41.036-21.011 56.206-14.071 15.17-33.944 22.793-59.695 22.793-13.16 0-25.069-2.389-35.65-7.282-10.619-4.817-19.797-11.454-27.496-19.759-7.737-8.344-13.577-17.901-17.598-28.786-3.982-10.847-6.334-21.997-6.865-33.527l-105.624 9.444c3.413 27.496 10.733 51.959 21.921 73.463 11.112 21.466 25.562 39.595 43.311 54.575 17.711 14.829 38.078 26.169 61.023 33.944 22.869 7.699 47.521 11.605 73.842 11.605 24.614 0 47.976-3.603 70.049-10.771 21.959-7.168 41.491-17.711 58.406-31.782 16.839-14.033 30.227-31.365 39.936-51.959 9.709-20.632 14.564-44.411 14.564-71.263 0-18.356-2.010-34.475-5.992-48.166z" /><glyph unicode="" glyph-name="history" d="M574.805 867.84c-227.631 0-412.71-182.386-418.247-409.335h-125.838l188.378-209.958 188.302 209.958h-146.242c5.537 168.998 143.777 304.393 313.647 304.393 173.359 0 313.875-140.971 313.875-314.899s-140.478-314.861-313.875-314.861c-69.518 0-133.727 22.718-185.761 61.099l-71.983-76.99c71.073-55.751 160.503-89.050 257.745-89.050 231.121 0 418.513 187.961 418.513 419.84-0.038 231.879-187.43 419.84-418.513 419.84zM537.6 673.28v-240.109l153.865-153.865 50.669 50.669-132.855 132.855v210.413h-71.68z" /><glyph unicode="" glyph-name="export" d="M383.462 382.49h255.693v213.043h127.795l-255.642 255.667-255.642-255.667h127.795zM852.173 382.49v-170.394h-681.754v170.394h-170.419v-340.89h1022.618v340.89z" /><glyph unicode="" glyph-name="import" d="M639.155 851.2h-255.693v-213.043h-127.795l255.667-255.667 255.616 255.667h-127.795zM852.173 382.49v-170.394h-681.754v170.394h-170.419v-340.89h1022.618v340.89z" /><glyph unicode="" glyph-name="dot" d="M505.139 959.915c-282.658-3.775-508.826-236.066-505.071-518.827 3.772-282.556 236.1-508.826 518.793-505.003 282.658 3.768 508.826 236.066 505.071 518.827-3.717 282.658-236.1 508.826-518.793 505.003z" /><glyph unicode="" glyph-name="not-installed" d="M510.413 960c-281.907 0-510.413-228.582-510.413-510.413 0-281.933 228.506-510.464 510.413-510.464s510.387 228.557 510.387 510.464c0 281.83-228.48 510.413-510.387 510.413zM865.843 449.587c0-69.99-20.506-135.27-55.578-190.285l-490.163 490.163c55.091 35.021 120.32 55.475 190.31 55.475 195.942 0 355.43-159.411 355.43-355.354zM154.957 449.587c0 69.939 20.506 135.245 55.578 190.31l490.189-490.189c-55.066-35.072-120.371-55.501-190.31-55.501-195.942-0.026-355.456 159.437-355.456 355.379z" /><glyph unicode="" glyph-name="disabled" d="M511.77 960c-282.778 0-512.102-229.222-512.102-512.179 0-282.829 229.325-512.102 512.102-512.102 282.931-0.026 512.23 229.248 512.23 512.102 0 282.957-229.299 512.179-512.23 512.179zM143.718 540.032h736.205v-184.269h-736.205v184.269z" /><glyph unicode="" glyph-name="menu-item" horiz-adv-x="903" d="M857.675 670.587l-403.18 240.514-402.726-240.514v-457.026l403.18-240.515 402.726 240.514v457.027zM454.857 95.535l-298.427 178.383v335.966l298.157 178.729 298.428-178.383v-335.966l-298.158-178.729z" /><glyph unicode="" glyph-name="tag" d="M904.192 959.973l-307.234-0.116-596.89-596.958 426.906-426.906 596.958 596.958-0.113 305.596-119.603 121.426zM858.679 646.663c-39.997-40.001-104.854-40.001-144.794 0-40.001 40.001-40.001 104.796 0 144.794 39.939 40.001 104.796 40.001 144.794 0 39.997-39.997 39.997-104.793 0-144.794z" /><glyph unicode="" glyph-name="camera" d="M982.767 728.098h-250.095l-59.255 121.364c0 0-11.827 25.201-42.11 25.201-23.375 0-169.366 0-235.25 0-32.969 0-44.001-25.027-44.001-25.027l-57.484-121.539h-253.406c-22.74 0-41.131-18.459-41.131-41.267v-624.333c0-22.743 18.401-41.199 41.131-41.199h941.636c22.74 0 41.199 18.459 41.199 41.199v624.299c0 22.798-18.456 41.267-41.199 41.267zM512 136.090c-138.793 0-251.597 113.015-251.597 251.931 0 138.912 112.845 251.87 251.597 251.87 138.68 0 251.597-112.981 251.597-251.87 0-138.909-112.913-251.931-251.597-251.931zM512 539.068c-83.255 0-150.972-67.714-150.972-150.972 0-83.197 67.71-150.903 150.972-150.903 83.258 0 150.903 67.714 150.903 150.903 0 83.255-67.652 150.972-150.903 150.972z" /><glyph unicode="" glyph-name="grid" d="M0.010 959.628h279.074v-279.074h-279.074zM372.77 959.628h279.074v-279.074h-279.074zM744.892 959.628h279.074v-279.074h-279.074zM0.010 587.503h279.074v-279.074h-279.074zM372.77 587.503h279.074v-279.074h-279.074zM744.892 587.503h279.074v-279.074h-279.074zM0.010 215.415h279.074v-279.074h-279.074zM372.77 215.415h279.074v-279.074h-279.074zM744.892 215.415h279.074v-279.074h-279.074z" /><glyph unicode="" glyph-name="list-menu" d="M0.010 771.516h1023.966v-136.509h-1023.966zM0.010 517.53h1023.966v-136.506h-1023.966zM0.010 260.983h1023.966v-136.513h-1023.966z" /><glyph unicode="" glyph-name="cart" d="M771.001 183.263c-55.445 0-100.448-44.754-100.448-100.2s44.879-100.324 100.448-100.324 100.448 44.879 100.448 100.324-45.003 100.2-100.448 100.2zM771.001 41.293c-23.123 0-41.77 18.648-41.77 41.771s18.647 41.77 41.77 41.77c23.247 0 41.895-18.648 41.895-41.77s-18.648-41.771-41.895-41.771zM469.532 183.263c-55.445 0-100.449-44.754-100.449-100.2s45.003-100.324 100.449-100.324c55.445 0 100.448 44.879 100.448 100.324s-45.003 100.2-100.448 100.2zM469.532 41.293c-23.123 0-41.771 18.648-41.771 41.771s18.648 41.77 41.771 41.77 41.77-18.648 41.77-41.77-18.648-41.771-41.77-41.771zM823.587 465.588c-130.036 0-238.441 91.622-264.547 213.825h-207.237l-136.749 198.162v1.865h-207.237v-83.541h169.942l78.693-117.729 83.417-412.857h581.183l49.23 243.786c-42.268-27.474-92.616-43.511-146.694-43.511zM1023.862 710.244v45.376l-55.073 18.026-12.929 31.204 24.863 52.71-31.95 32.074-5.967-2.984-45.5-23.123-31.328 12.929-19.642 54.948h-45.376l-2.114-6.464-15.912-48.608-31.203-12.929-52.835 24.863-32.074-31.95 3.108-5.967 23.247-45.624-13.053-31.328-54.948-19.766v-45.376l6.34-2.113 48.732-15.788 12.929-31.204-24.863-52.71 32.074-32.074 6.092 3.108 45.376 22.999 31.328-12.929 19.642-54.824h45.376l2.113 6.464 15.913 48.359 31.203 12.929 52.71-24.988 32.198 32.074-3.108 6.092-23.247 45.624 12.929 31.203 54.948 19.766zM824.582 668.473c-35.057 0-63.65 28.469-63.65 63.526 0 35.182 28.469 63.526 63.65 63.526s63.526-28.469 63.526-63.526c-0.124-35.182-28.469-63.526-63.526-63.526z" /><glyph unicode="" glyph-name="screen" horiz-adv-x="1159" d="M723.661 70.399c-2.404 10.843-4.034 21.47-5.282 31.583h-277.528c-2.458-20.233-6.917-43.087-14.646-64.305-7.79-21.277-18.796-40.54-33.824-54.15-15.028-13.552-33.689-22.104-59.788-22.158v-25.369h494.020v25.369c-26.142 0.058-44.737 8.61-59.838 22.158-22.44 20.307-35.961 53.91-43.114 86.873zM1126.214 960h-1093.209c-18.22 0-33.005-15.024-33.005-33.596v-731.259c0-18.576 14.785-33.623 33.005-33.623h1093.209c18.224 0 33.067 15.051 33.067 33.623v731.259c0 18.572-14.843 33.596-33.067 33.596zM1079.193 243.078h-999.234v635.394h999.234v-635.394z" /><glyph unicode="" glyph-name="video" horiz-adv-x="2041" d="M2041.366 958.898v-1021.449h-175.926l-411.263 409.297v204.59l411.263 407.568h175.926zM1305.997-29.076c0-19.377-15.608-34.924-34.856-34.924h-1236.279c-19.255 0-34.863 15.547-34.863 34.924v954.275c0 19.248 15.608 34.801 34.863 34.801h1236.279c19.248 0 34.856-15.553 34.856-34.801v-954.275z" /><glyph unicode="" glyph-name="revert" horiz-adv-x="1404" d="M1042.226 660.151h-598.393v299.849l-443.833-384.316 443.833-384.403v299.859h598.393c106.478 0 192.801-86.318 192.801-192.801s-86.318-192.796-192.801-192.796v-0.483l-452.707-0.005c-46.695-0.005-84.53-37.845-84.53-84.535 0-46.68 37.84-84.525 84.535-84.525 0.377 0 0.744 0.053 1.121 0.058h451.581c199.964 0 362.044 162.085 362.044 362.039 0 199.964-162.080 362.059-362.044 362.059z" /><glyph unicode="" glyph-name="clip" d="M939.616 811.616c112.512-112.448 112.512-294.816 0-407.264l-350.944-350.976c-12.512-12.544-32.736-12.544-45.248 0-12.576 12.512-12.576 32.704 0 45.248l346.432 346.464c87.488 87.488 87.488 229.248-0.064 316.768-87.36 87.488-229.248 87.488-316.736 0l-462.304-456.864c-62.496-62.464-62.496-163.776 0-226.24 62.496-62.496 163.744-62.496 226.24 0l466.88 461.344c37.44 37.44 37.44 98.336 0 135.776-37.44 37.408-98.304 37.408-135.744 0l-351.008-351.008c-12.512-12.512-32.736-12.512-45.248 0-12.512 12.544-12.512 32.736 0 45.28l350.976 350.976c62.432 62.464 163.744 62.464 226.24 0 62.496-62.496 62.496-163.776 0-226.272l-466.88-461.376c-87.296-87.328-229.408-87.328-316.736 0s-87.328 229.472 0 316.8l466.88 461.344c112.448 112.512 294.816 112.512 407.264 0z" /><glyph unicode="" glyph-name="module" horiz-adv-x="883" d="M793.271 737.4l-192.695 83.055v-80.482c-2.517-31.926-83.182-57.618-182.582-57.618-99.309 0-180.126 25.692-182.398 57.618h-0.318l-0.465 80.482-197.709-83.055 381.218-167.697 374.95 167.697zM265.959 841.886l-1.104-0.428c32.596-16.331 89.086-27.124 153.551-27.124 64.726 0 121.621 10.94 153.996 27.355l-1.168 0.512c18.811 9.3 29.664 20.34 29.664 32.264 0 32.713-81.606 59.114-182.492 59.114-100.759 0-182.806-26.401-182.806-59.114-0.003-12.007 11.295-23.218 30.36-32.579zM418.418 497.564l-418.418 191.009v-563.335l418.321-189.238 418.321 189.238v563.733l-418.224-191.407z" /><glyph unicode="" glyph-name="alert-round" d="M1023.959 454.912c-3.717 282.665-236.121 508.842-518.817 505.040-282.689-3.772-508.866-236.091-505.094-518.868 3.772-282.58 236.121-508.842 518.813-505.040 282.689 3.772 508.866 236.067 505.098 518.868zM580.086 55.641h-136.149v136.163h136.149v-136.163zM597.168 666.258l-44.103-388.928h-83.113l-43.099 388.928v171.575h170.318v-171.575z" /></font></defs></svg> \ No newline at end of file diff --git a/setup/pub/fonts/icons/icons.ttf b/setup/pub/fonts/icons/icons.ttf deleted file mode 100644 index bc3eddf307438..0000000000000 Binary files a/setup/pub/fonts/icons/icons.ttf and /dev/null differ diff --git a/setup/pub/fonts/icons/icons.woff b/setup/pub/fonts/icons/icons.woff deleted file mode 100644 index bd9560bf58327..0000000000000 Binary files a/setup/pub/fonts/icons/icons.woff and /dev/null differ diff --git a/setup/pub/fonts/icons/icons.woff2 b/setup/pub/fonts/icons/icons.woff2 deleted file mode 100644 index 25c1c88c0bff8..0000000000000 Binary files a/setup/pub/fonts/icons/icons.woff2 and /dev/null differ diff --git a/setup/pub/fonts/icons/selection.json b/setup/pub/fonts/icons/selection.json deleted file mode 100644 index c1733d650bcd2..0000000000000 --- a/setup/pub/fonts/icons/selection.json +++ /dev/null @@ -1,2326 +0,0 @@ -{ - "IcoMoonType": "selection", - "icons": [ - { - "icon": { - "paths": [ - "M2041.366 1.102v1021.449h-175.926l-411.263-409.297v-204.59l411.263-407.568h175.926z", - "M1305.997 989.076c0 19.377-15.608 34.924-34.856 34.924h-1236.279c-19.255 0-34.863-15.547-34.863-34.924v-954.275c0-19.248 15.608-34.801 34.863-34.801h1236.279c19.248 0 34.856 15.553 34.856 34.801v954.275z" - ], - "width": 2041, - "attrs": [], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "video" - ], - "grid": 0 - }, - "attrs": [], - "properties": { - "order": 127, - "id": 0, - "prevSize": 32, - "code": 58945, - "name": "video" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 0 - }, - { - "icon": { - "paths": [ - "M723.661 889.601c-2.404-10.843-4.034-21.47-5.282-31.583h-277.528c-2.458 20.233-6.917 43.087-14.646 64.305-7.79 21.277-18.796 40.54-33.824 54.15-15.028 13.552-33.689 22.104-59.788 22.158v25.369h494.020v-25.369c-26.142-0.058-44.737-8.61-59.838-22.158-22.44-20.307-35.961-53.91-43.114-86.873zM1126.214 0h-1093.209c-18.22 0-33.005 15.024-33.005 33.596v731.259c0 18.576 14.785 33.623 33.005 33.623h1093.209c18.224 0 33.067-15.051 33.067-33.623v-731.259c0-18.572-14.843-33.596-33.067-33.596zM1079.193 716.922h-999.234v-635.394h999.234v635.394z" - ], - "width": 1159, - "attrs": [], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "screen" - ], - "grid": 0 - }, - "attrs": [], - "properties": { - "order": 72, - "id": 1, - "prevSize": 32, - "code": 58944, - "name": "screen" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 1 - }, - { - "icon": { - "paths": [ - "M771.001 776.737c-55.445 0-100.448 44.754-100.448 100.2s44.879 100.324 100.448 100.324 100.448-44.879 100.448-100.324-45.003-100.2-100.448-100.2zM771.001 918.707c-23.123 0-41.77-18.648-41.77-41.771s18.647-41.77 41.77-41.77c23.247 0 41.895 18.648 41.895 41.77s-18.648 41.771-41.895 41.771z", - "M469.532 776.737c-55.445 0-100.449 44.754-100.449 100.2s45.003 100.324 100.449 100.324c55.445 0 100.448-44.879 100.448-100.324s-45.003-100.2-100.448-100.2zM469.532 918.707c-23.123 0-41.771-18.648-41.771-41.771s18.648-41.77 41.771-41.77 41.77 18.648 41.77 41.77-18.648 41.771-41.77 41.771z", - "M823.587 494.412c-130.036 0-238.441-91.622-264.547-213.825h-207.237l-136.749-198.162v-1.865h-207.237v83.541h169.942l78.693 117.729 83.417 412.857h581.183l49.23-243.786c-42.268 27.474-92.616 43.511-146.694 43.511z", - "M1023.862 249.756v-45.376l-55.073-18.026-12.929-31.204 24.863-52.71-31.95-32.074-5.967 2.984-45.5 23.123-31.328-12.929-19.642-54.948h-45.376l-2.114 6.464-15.912 48.608-31.203 12.929-52.835-24.863-32.074 31.95 3.108 5.967 23.247 45.624-13.053 31.328-54.948 19.766v45.376l6.34 2.113 48.732 15.788 12.929 31.204-24.863 52.71 32.074 32.074 6.092-3.108 45.376-22.999 31.328 12.929 19.642 54.824h45.376l2.113-6.464 15.913-48.359 31.203-12.929 52.71 24.988 32.198-32.074-3.108-6.092-23.247-45.624 12.929-31.203 54.948-19.766zM824.582 291.527c-35.057 0-63.65-28.469-63.65-63.526 0-35.182 28.469-63.526 63.65-63.526s63.526 28.469 63.526 63.526c-0.124 35.182-28.469 63.526-63.526 63.526z" - ], - "attrs": [], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "cart" - ], - "grid": 0 - }, - "attrs": [], - "properties": { - "order": 71, - "id": 2, - "prevSize": 32, - "code": 58943, - "name": "cart" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 2 - }, - { - "icon": { - "paths": [ - "M0.010 188.484h1023.966v136.509h-1023.966z", - "M0.010 442.47h1023.966v136.506h-1023.966z", - "M0.010 699.017h1023.966v136.513h-1023.966z" - ], - "attrs": [ - {}, - {}, - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "list-menu" - ], - "grid": 0 - }, - "attrs": [ - {}, - {}, - {} - ], - "properties": { - "order": 61, - "id": 3, - "prevSize": 32, - "code": 58942, - "name": "list-menu" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 3 - }, - { - "icon": { - "paths": [ - "M0.010 0.372h279.074v279.074h-279.074z", - "M372.77 0.372h279.074v279.074h-279.074z", - "M744.892 0.372h279.074v279.074h-279.074z", - "M0.010 372.497h279.074v279.074h-279.074z", - "M372.77 372.497h279.074v279.074h-279.074z", - "M744.892 372.497h279.074v279.074h-279.074z", - "M0.010 744.585h279.074v279.074h-279.074z", - "M372.77 744.585h279.074v279.074h-279.074z", - "M744.892 744.585h279.074v279.074h-279.074z" - ], - "attrs": [ - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "grid" - ], - "grid": 0 - }, - "attrs": [ - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {} - ], - "properties": { - "order": 112, - "id": 4, - "prevSize": 32, - "code": 58941, - "name": "grid" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 4 - }, - { - "icon": { - "paths": [ - "M982.767 231.902h-250.095l-59.255-121.364c0 0-11.827-25.201-42.11-25.201-23.375 0-169.366 0-235.25 0-32.969 0-44.001 25.027-44.001 25.027l-57.484 121.539h-253.406c-22.74 0-41.131 18.459-41.131 41.267v624.333c0 22.743 18.401 41.199 41.131 41.199h941.636c22.74 0 41.199-18.459 41.199-41.199v-624.299c0-22.798-18.456-41.267-41.199-41.267zM512 823.91c-138.793 0-251.597-113.015-251.597-251.931 0-138.912 112.845-251.87 251.597-251.87 138.68 0 251.597 112.981 251.597 251.87 0 138.909-112.913 251.931-251.597 251.931z", - "M512 420.932c-83.255 0-150.972 67.714-150.972 150.972 0 83.197 67.71 150.903 150.972 150.903 83.258 0 150.903-67.714 150.903-150.903 0-83.255-67.652-150.972-150.903-150.972z" - ], - "attrs": [ - {}, - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "camera" - ], - "grid": 0 - }, - "attrs": [ - {}, - {} - ], - "properties": { - "order": 121, - "id": 5, - "prevSize": 32, - "code": 58940, - "name": "camera" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 5 - }, - { - "icon": { - "paths": [ - "M904.192 0.027l-307.234 0.116-596.89 596.958 426.906 426.906 596.958-596.958-0.113-305.596-119.603-121.426zM858.679 313.337c-39.997 40.001-104.854 40.001-144.794 0-40.001-40.001-40.001-104.796 0-144.794 39.939-40.001 104.796-40.001 144.794 0 39.997 39.997 39.997 104.793 0 144.794z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "tag" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 111, - "id": 6, - "prevSize": 32, - "code": 58939, - "name": "tag" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 6 - }, - { - "icon": { - "paths": [ - "M1094.391 77.71l-77.71-77.71-423.329 423.347-423.33-423.347-77.71 77.672 423.35 423.368-423.312 423.329 77.672 77.71 423.338-423.338 423.283 423.3 77.671-77.71-423.263-423.281z" - ], - "width": 1176, - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "colorPermutations": { - "6868681": [ - { - "f": 0 - } - ] - }, - "tags": [ - "close-mage" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 110, - "id": 7, - "prevSize": 32, - "code": 58927, - "name": "close-mage" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 7 - }, - { - "icon": { - "paths": [ - "M857.675 289.413l-403.18-240.514-402.726 240.514v457.026l403.18 240.515 402.726-240.514v-457.027zM454.857 864.465l-298.427-178.383v-335.966l298.157-178.729 298.428 178.383v335.966l-298.158 178.729z" - ], - "width": 903, - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "colorPermutations": { - "6868681": [ - { - "f": 0 - } - ] - }, - "tags": [ - "menu-item" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 109, - "id": 8, - "prevSize": 32, - "code": 58938, - "name": "menu-item" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 8 - }, - { - "icon": { - "paths": [ - "M505.704 40.998c-260.096 3.489-468.158 217.202-464.706 477.336 3.489 259.982 217.202 468.12 477.298 464.631s468.158-217.202 464.706-477.336c-3.413-260.058-217.202-468.12-477.298-464.631zM557.928 197.973c47.863 0 62.009 27.762 62.009 59.544 0 39.671-31.782 76.383-86.016 76.383-45.359 0-66.901-22.831-65.65-60.53 0-31.782 26.624-75.435 89.657-75.435zM435.162 806.381c-32.73 0-56.661-19.873-33.792-107.217l37.547-154.814c6.485-24.841 7.585-34.778 0-34.778-9.785 0-52.262 17.143-77.407 34.057l-16.346-26.776c79.607-66.446 171.16-105.472 210.375-105.472 32.73 0 38.153 38.722 21.807 98.266l-43.008 162.816c-7.585 28.786-4.286 38.722 3.262 38.722 9.785 0 41.984-11.871 73.614-36.75l18.47 24.841c-77.369 77.369-161.792 107.179-194.56 107.179z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "info" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 108, - "id": 9, - "prevSize": 32, - "code": 58906, - "name": "info" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 9 - }, - { - "icon": { - "paths": [ - "M591.986 448.019h-16.005v-192.019c0-105.851-86.13-192.019-192.019-192.019h-128c-105.851 0-192.019 86.13-192.019 192.019v192.019h-16.005c-26.396 0-48.014 21.618-48.014 48.014v479.991c0 26.396 21.618 48.014 48.014 48.014h544.009c26.396 0 48.014-21.618 48.014-48.014v-479.991c0-26.396-21.618-48.014-48.014-48.014zM384 896h-128l27.838-139.188c-16.801-11.529-27.838-30.872-27.838-52.793 0-35.347 28.672-64.019 64.019-64.019s64.019 28.672 64.019 64.019c0 21.921-11.036 41.263-27.838 52.793l27.838 139.188zM448.019 448.019h-256v-192.019c0-35.271 28.71-64.019 64.019-64.019h128c35.271 0 64.019 28.71 64.019 64.019v192.019z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "lock" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 107, - "id": 10, - "prevSize": 32, - "code": 58907, - "name": "lock" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 10 - }, - { - "icon": { - "paths": [ - "M870.4 317.44h-194.56v143.36h153.6v215.040h-634.88v-215.040h215.040v112.64l204.8-184.32-204.8-184.32v112.64h-256c-56.51 0-102.4 45.815-102.4 102.4v296.96c0 56.51 45.89 102.4 102.4 102.4h716.8c56.585 0 102.4-45.89 102.4-102.4v-296.96c0-56.585-45.815-102.4-102.4-102.4z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "loop" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 106, - "id": 11, - "prevSize": 32, - "code": 58908, - "name": "loop" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 11 - }, - { - "icon": { - "paths": [ - "M991.991 384h-351.991v-351.991c0-17.673-14.336-32.009-32.009-32.009h-192.019c-17.673 0-32.009 14.336-32.009 32.009v351.991h-351.991c-17.673 0-32.009 14.336-32.009 32.009v192.019c0 17.673 14.336 32.009 32.009 32.009h351.991v351.991c0 17.673 14.336 32.009 32.009 32.009h192.019c17.673 0 32.009-14.336 32.009-32.009v-351.991h351.991c17.673 0 32.009-14.336 32.009-32.009v-192.019c0-17.673-14.336-32.009-32.009-32.009z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "plus" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 105, - "id": 12, - "prevSize": 32, - "code": 58909, - "name": "plus" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 12 - }, - { - "icon": { - "paths": [ - "M505.704 40.998c-260.096 3.489-468.158 217.126-464.706 477.298 3.489 260.21 217.202 468.158 477.298 464.744 260.134-3.489 468.233-217.202 464.706-477.298-3.489-260.21-217.202-468.233-477.298-464.744zM506.577 102.4c70.163-0.986 136.382 15.853 194.56 46.118l-63.374 105.662c-38.002-18.47-80.631-28.937-125.762-28.937-45.056 0-87.723 10.43-125.687 28.975l-63.336-105.624c54.993-28.672 117.343-45.321 183.599-46.232zM254.255 637.687l-105.586 63.298c-28.672-54.955-45.321-117.305-46.194-183.486-0.986-70.201 15.853-136.457 46.118-194.56l105.624 63.45c-18.546 37.926-28.975 80.555-28.975 125.649 0 45.056 10.43 87.723 28.975 125.687zM517.461 921.562c-70.163 0.986-136.457-15.853-194.56-46.118l63.374-105.662c38.002 18.546 80.631 28.975 125.687 28.975 45.094 0 87.761-10.392 125.687-28.937l63.336 105.586c-54.993 28.634-117.305 45.246-183.561 46.194zM512 737.242c-124.397 0-225.242-100.883-225.242-225.242 0-124.397 100.883-225.28 225.242-225.28 124.473 0 225.28 100.883 225.28 225.28s-100.807 225.242-225.28 225.242zM769.745 637.687c18.546-38.002 28.975-80.631 28.975-125.687 0-45.094-10.43-87.723-28.975-125.687l105.586-63.374c28.672 54.993 45.359 117.305 46.232 183.561 0.91 70.201-15.929 136.457-46.194 194.56l-105.624-63.336z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "recover" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 104, - "id": 13, - "prevSize": 32, - "code": 58910, - "name": "recover" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 13 - }, - { - "icon": { - "paths": [ - "M906.126 135.813v0c-91.174-75.89-202.487-113.171-312.548-113.057-127.014-0.038-253.611 49.683-348.16 145.636l-95.004-79.265-1.593 305.342 300.184-56.282-99.442-82.944c67.546-64.247 155.269-97.204 244.015-97.28 79.948 0.038 159.782 26.7 226.114 81.806 84.347 70.125 127.659 170.629 127.772 272.46-0.038 14.715-0.948 29.431-2.769 44.070l137.519-26.283c0.19-5.954 0.303-11.871 0.303-17.787 0.152-140.098-60.151-279.78-176.431-376.415zM839.035 766.976c-67.736 65.498-156.255 99.025-245.912 99.1-79.986-0.038-159.82-26.738-226.114-81.806-84.347-70.125-127.697-170.629-127.772-272.498 0-16.839 1.252-33.716 3.679-50.366l-138.164 25.941c-0.379 8.116-0.683 16.346-0.683 24.462-0.114 140.174 60.226 279.817 176.545 376.491 91.136 75.852 202.411 113.057 312.51 112.981h0.341c127.924 0 255.241-50.441 349.943-147.759l90.795 75.207 0.569-305.38-299.956 57.344 104.183 86.281z" - ], - "width": 1176, - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "refresh" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 113, - "id": 14, - "prevSize": 32, - "code": 58911, - "name": "refresh" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 14 - }, - { - "icon": { - "paths": [ - "M593.351 21.732c-270.753 0-490.268 219.477-490.268 490.231s219.515 490.268 490.268 490.268 490.231-219.515 490.231-490.268c0-270.753-219.477-490.231-490.231-490.231zM828.947 683.653l-72.363 72.363-162.095-162.133-164.902 164.902-73.121-73.121 164.902-164.902-161.678-161.678 72.363-72.325 161.602 161.678 165.774-165.736 73.121 73.083-165.774 165.736 162.171 162.133z" - ], - "width": 1176, - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "remove-small" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 114, - "id": 15, - "prevSize": 32, - "code": 58912, - "name": "remove-small" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 15 - }, - { - "icon": { - "paths": [ - "M254.976 675.84v-267.264h103.424l-179.2-203.776-179.2 203.776h103.424v308.224c0 56.51 45.815 102.4 102.4 102.4h459.776l-131.186-143.36h-279.438zM920.538 615.424v-308.224c0-56.51-45.89-102.4-102.4-102.4h-459.738l131.11 143.36h279.514v267.264h-103.424l179.2 203.776 179.2-203.776h-103.462z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "retweet" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 117, - "id": 16, - "prevSize": 32, - "code": 58913, - "name": "retweet" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 16 - }, - { - "icon": { - "paths": [ - "M768 64.019h-128c-105.851 0-192.019 86.13-192.019 192.019v192.019h-400.005c-26.396 0-48.014 21.618-48.014 48.014v479.991c0 26.396 21.618 48.014 48.014 48.014h544.009c26.396 0 48.014-21.618 48.014-48.014v-479.991c0-26.396-21.618-48.014-48.014-48.014h-16.005v-192.019c0-35.271 28.71-64.019 64.019-64.019h128c35.271 0 64.019 28.71 64.019 64.019v192.019h128v-192.019c0-105.851-86.13-192.019-192.019-192.019zM384 896h-128l27.838-139.188c-16.801-11.529-27.838-30.872-27.838-52.793 0-35.347 28.672-64.019 64.019-64.019s64.019 28.672 64.019 64.019c0 21.921-11.036 41.263-27.838 52.793l27.838 139.188z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "unlocked" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 36, - "id": 17, - "prevSize": 32, - "code": 58914, - "name": "unlocked" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 17 - }, - { - "icon": { - "paths": [ - "M593.351 0l-593.351 1023.962h1186.74l-593.351-1023.962zM653.236 899.451h-125.421v-121.211h125.421v121.211zM622.175 728.329h-62.502l-34.816-288.313v-156.748h131.3v156.748l-33.982 288.313z" - ], - "width": 1176, - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "warning" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 37, - "id": 18, - "prevSize": 32, - "code": 58915, - "name": "warning" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 18 - }, - { - "icon": { - "paths": [ - "M0 512l512 512v-320.019h512v-384h-512v-320.019z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "arrow-left" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 38, - "id": 19, - "prevSize": 32, - "code": 58916, - "name": "arrow-left" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 19 - }, - { - "icon": { - "paths": [ - "M1024 512l-512-512v320.019h-512v384h512v320.019z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "arrow-right" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 39, - "id": 20, - "prevSize": 32, - "code": 58917, - "name": "arrow-right" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 20 - }, - { - "icon": { - "paths": [ - "M402.735 146.735l-320.019 320.019c-24.993 24.993-24.993 65.498 0 90.491l320.019 320.019c24.993 24.993 65.498 24.993 90.491 0s24.993-65.498 0-90.491l-210.754-210.754h613.49c35.347 0 64.019-28.634 64.019-64.019s-28.672-64.019-64.019-64.019h-613.49l210.754-210.754c12.478-12.478 18.735-28.862 18.735-45.246s-6.258-32.768-18.735-45.246c-24.993-24.993-65.498-24.993-90.491 0z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "back-arrow" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 103, - "id": 21, - "prevSize": 32, - "code": 58918, - "name": "back-arrow" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 21 - }, - { - "icon": { - "paths": [ - "M507.259 578.522h-102.059v101.717h102.059v-101.717zM650.885 714.714h-101.945v101.717h101.945v-101.717zM507.259 714.714h-102.059v101.717h102.059v-101.717zM507.259 442.33h-102.059v101.679h102.059v-101.679zM843.131 244.091c23.4 0 42.287-18.887 42.287-42.174v-145.408c0-23.324-18.887-42.174-42.287-42.174s-42.325 18.849-42.325 42.174v145.408c0.038 23.324 18.925 42.174 42.325 42.174zM343.419 244.091c23.362 0 42.249-18.887 42.249-42.174v-145.408c0-23.324-18.887-42.174-42.249-42.174-23.4 0-42.325 18.849-42.325 42.174v145.408c0 23.324 18.925 42.174 42.325 42.174zM363.444 578.522h-102.059v101.717h102.059v-101.717zM363.444 714.714h-102.059v101.717h102.059v-101.717zM650.885 578.522h-101.945v101.717h101.945v-101.717zM938.325 578.522h-102.059v101.717h102.059v-101.717zM938.325 442.33h-102.059v101.679h102.059v-101.679zM899.337 84.385v46.914c17.598 15.474 28.71 38.153 28.71 63.412 0 46.801-37.964 84.764-84.916 84.764s-84.954-37.964-84.954-84.764c0-25.259 11.15-47.938 28.71-63.412v-46.914h-387.262v46.914c17.56 15.474 28.71 38.153 28.71 63.412 0 46.801-38.002 84.764-84.916 84.764s-84.954-37.964-84.954-84.764c0-25.259 11.15-47.938 28.71-63.412v-46.914h-192.322v925.279h997.035v-925.279h-192.512zM999.234 915.304h-809.832v-589.938h809.832v589.938zM650.885 442.33h-101.945v101.679h101.945v-101.679zM794.624 442.33h-101.983v101.679h101.983v-101.679zM794.624 714.714h-101.983v101.717h101.983v-101.717zM794.624 578.522h-101.983v101.717h101.983v-101.717z" - ], - "width": 1176, - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "calendar" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 102, - "id": 22, - "prevSize": 32, - "code": 58919, - "name": "calendar" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 22 - }, - { - "icon": { - "paths": [ - "M132.21 286.758c-13.881-13.729-36.295-13.729-50.138 0-13.805 13.653-13.805 35.878 0 49.607l404.897 400.877c13.881 13.729 36.257 13.729 50.138 0l404.897-400.877c13.805-13.729 13.881-35.878 0-49.607s-36.371-13.729-50.138-0.038l-379.866 365.606-379.79-365.568z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "caret-down" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 101, - "id": 23, - "prevSize": 32, - "code": 58920, - "name": "caret-down" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 23 - }, - { - "icon": { - "paths": [ - "M737.242 891.79c13.729 13.881 13.729 36.257 0 50.138s-35.878 13.881-49.607 0l-400.877-404.821c-13.729-13.881-13.729-36.295 0-50.138l400.877-404.897c13.729-13.881 35.878-13.881 49.607 0s13.729 36.257 0 50.138l-365.568 379.79 365.568 379.79z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "caret-left" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 100, - "id": 24, - "prevSize": 32, - "code": 58921, - "name": "caret-left" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 24 - }, - { - "icon": { - "paths": [ - "M286.72 891.79c-13.729 13.881-13.729 36.257 0 50.138s35.878 13.881 49.607 0l400.877-404.821c13.729-13.881 13.729-36.295 0-50.138l-400.915-404.897c-13.729-13.881-35.878-13.881-49.607 0s-13.729 36.257 0 50.138l365.568 379.79-365.568 379.79z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "caret-right" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 99, - "id": 25, - "prevSize": 32, - "code": 58922, - "name": "caret-right" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 25 - }, - { - "icon": { - "paths": [ - "M891.79 737.242c13.881 13.729 36.295 13.729 50.138 0 13.881-13.729 13.881-35.878 0-49.607l-404.897-400.877c-13.805-13.729-36.257-13.729-50.062 0l-404.897 400.877c-13.805 13.729-13.881 35.878 0 49.607s36.257 13.729 50.138 0l379.79-365.606 379.79 365.606z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "caret-up" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 98, - "id": 26, - "prevSize": 32, - "code": 58923, - "name": "caret-up" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 26 - }, - { - "icon": { - "paths": [ - "M574.767 92.16c-227.593 0-412.672 182.386-418.247 409.335h-125.8l188.378 209.92 188.302-209.92h-146.242c5.537-168.998 143.777-304.393 313.609-304.393 173.397 0 313.913 140.971 313.913 314.899s-140.478 314.861-313.913 314.861c-69.48 0-133.689-22.718-185.685-61.099l-71.983 76.99c70.997 55.751 160.465 89.050 257.707 89.050 231.159 0 418.551-187.961 418.551-419.84-0.038-231.879-187.43-419.84-418.551-419.84z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "ccw" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 97, - "id": 27, - "prevSize": 32, - "code": 58924, - "name": "ccw" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 27 - }, - { - "icon": { - "paths": [ - "M996.617 126.786l-513.555 513.555-256.796-256.834-128.379 128.417 385.214 385.252 641.896-642.010z" - ], - "width": 1176, - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "check-mage" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 96, - "id": 28, - "prevSize": 32, - "code": 58925, - "name": "check-mage" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 28 - }, - { - "icon": { - "paths": [ - "M512 40.96c-260.134 0-471.040 210.944-471.040 471.040 0 260.134 210.906 471.040 471.040 471.040s471.040-210.906 471.040-471.040c0-260.134-210.906-471.040-471.040-471.040zM512 880.64c-203.624 0-368.64-165.054-368.64-368.64s165.016-368.64 368.64-368.64 368.64 165.054 368.64 368.64-165.016 368.64-368.64 368.64zM547.84 245.76h-71.68v281.069l174.345 174.345 50.669-50.707-153.335-153.335z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "clock" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 95, - "id": 29, - "prevSize": 32, - "code": 58926, - "name": "clock" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 29 - }, - { - "icon": { - "paths": [ - "M337.541 1021.004h513.024l64.512-645.916h-639.128l61.592 645.916zM737.394 154.169v-116.508c0-19.191-15.398-34.702-34.361-34.702h-217.847c-19.001 0-34.361 15.55-34.361 34.702v114.574c-73.576 8.382-150.149 24.614-226.494 52.338v106.989h738.001v-109.833c0 0-90.074-31.403-224.977-47.559zM668.937 147.759c-47.749-3.224-99.252-4.096-153.297-0.986v-61.44c0-9.519 7.623-17.332 17.143-17.332h118.936c9.519 0 17.218 7.813 17.218 17.332v62.426z" - ], - "width": 1176, - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "delete" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 94, - "id": 30, - "prevSize": 32, - "code": 58928, - "name": "delete" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 30 - }, - { - "icon": { - "paths": [ - "M928.503 26.889l-111.502 112.109 156.065 156.9 111.502-112.071-156.065-156.937zM215.002 744.41l156.065 156.9 535.211-538.093-156.065-156.9-535.211 538.093zM103.917 1007.161l188.985-49.873-139.302-140.098-49.683 190.009z" - ], - "width": 1176, - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "edit" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 115, - "id": 31, - "prevSize": 32, - "code": 58929, - "name": "edit" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 31 - }, - { - "icon": { - "paths": [ - "M1014.67 822.651c0 0 0 0 0 0l-310.651-310.651 310.651-310.651c0 0 0 0 0 0 3.337-3.337 5.765-7.244 7.32-11.416 4.248-11.378 1.82-24.69-7.32-33.83l-146.735-146.735c-9.14-9.14-22.452-11.567-33.83-7.32-4.172 1.555-8.078 3.982-11.416 7.32 0 0 0 0 0 0l-310.651 310.651-310.651-310.651c0 0 0 0 0 0-3.337-3.337-7.244-5.765-11.416-7.32-11.378-4.248-24.69-1.82-33.83 7.32l-146.735 146.735c-9.14 9.14-11.567 22.452-7.32 33.83 1.555 4.172 3.982 8.078 7.32 11.416 0 0 0 0 0 0l310.651 310.651-310.651 310.651c0 0 0 0 0 0-3.337 3.337-5.765 7.244-7.32 11.416-4.248 11.378-1.82 24.69 7.32 33.83l146.735 146.735c9.14 9.14 22.452 11.567 33.83 7.32 4.172-1.555 8.078-3.982 11.416-7.32 0 0 0 0 0 0l310.651-310.651 310.651 310.651c0 0 0 0 0 0 3.337 3.337 7.244 5.765 11.416 7.32 11.378 4.248 24.69 1.82 33.83-7.32l146.735-146.735c9.14-9.14 11.567-22.452 7.32-33.83-1.555-4.172-3.982-8.078-7.32-11.416z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "error" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 122, - "id": 32, - "prevSize": 32, - "code": 58930, - "name": "error" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 32 - }, - { - "icon": { - "paths": [ - "M593.351 22.566c-270.336 0-489.434 219.098-489.434 489.358s219.098 489.434 489.434 489.434 489.434-219.136 489.434-489.434-219.136-489.358-489.434-489.358zM635.752 826.596c-11.985 11.719-26.396 17.636-43.16 17.636-8.154 0-15.967-1.517-23.4-4.589-7.358-3.034-13.843-7.168-19.456-12.174-5.613-5.158-10.126-11.226-13.388-18.356-3.337-7.13-4.968-14.753-4.968-22.945 0-16.308 5.992-30.303 17.977-42.060 11.947-11.681 26.396-17.598 43.198-17.598 16.308 0 30.606 5.689 42.78 16.801 12.25 11.188 18.318 24.993 18.318 41.339-0.038 16.384-5.992 30.303-17.939 41.984zM778.923 382.673c-3.982 13.767-9.747 26.396-17.18 37.774-7.471 11.454-16.498 22.49-27.079 33.071s-22.49 21.618-35.65 33.033c-11.454 9.785-20.783 18.318-27.913 25.79-7.168 7.396-12.895 14.867-17.218 22.338-4.286 7.433-7.282 15.398-9.026 24.007-1.707 8.609-2.617 49.721-2.617 62.35v22.338h-101.376v-32.616c0-13.729 0.986-56.661 3.034-67.584s5.158-21.125 9.481-30.872 10.012-19.228 17.18-28.369c7.168-9.14 16.232-18.887 27.079-29.203l38.647-36.902c10.847-9.747 20.177-20.632 27.951-32.616 7.737-12.060 11.529-26.7 11.529-43.88 0-22.3-6.978-41.036-21.011-56.206-14.071-15.17-33.944-22.793-59.695-22.793-13.16 0-25.069 2.389-35.65 7.282-10.619 4.817-19.797 11.454-27.496 19.759-7.737 8.344-13.577 17.901-17.598 28.786-3.982 10.847-6.334 21.997-6.865 33.527l-105.624-9.444c3.413-27.496 10.733-51.959 21.921-73.463 11.112-21.466 25.562-39.595 43.311-54.575 17.711-14.829 38.078-26.169 61.023-33.944 22.869-7.699 47.521-11.605 73.842-11.605 24.614 0 47.976 3.603 70.049 10.771 21.959 7.168 41.491 17.711 58.406 31.782 16.839 14.033 30.227 31.365 39.936 51.959 9.709 20.632 14.564 44.411 14.564 71.263 0 18.356-2.010 34.475-5.992 48.166z" - ], - "width": 1176, - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "help" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 124, - "id": 33, - "prevSize": 32, - "code": 58931, - "name": "help" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 33 - }, - { - "icon": { - "paths": [ - "M574.805 92.16c-227.631 0-412.71 182.386-418.247 409.335h-125.838l188.378 209.958 188.302-209.958h-146.242c5.537-168.998 143.777-304.393 313.647-304.393 173.359 0 313.875 140.971 313.875 314.899s-140.478 314.861-313.875 314.861c-69.518 0-133.727-22.718-185.761-61.099l-71.983 76.99c71.073 55.751 160.503 89.050 257.745 89.050 231.121 0 418.513-187.961 418.513-419.84-0.038-231.879-187.43-419.84-418.513-419.84zM537.6 286.72v240.109l153.865 153.865 50.669-50.669-132.855-132.855v-210.413h-71.68z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "history" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 45, - "id": 34, - "prevSize": 32, - "code": 58932, - "name": "history" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 34 - }, - { - "icon": { - "paths": [ - "M510.413 0c-281.907 0-510.413 228.582-510.413 510.413 0 281.933 228.506 510.464 510.413 510.464s510.387-228.557 510.387-510.464c0-281.83-228.48-510.413-510.387-510.413zM865.843 510.413c0 69.99-20.506 135.27-55.578 190.285l-490.163-490.163c55.091-35.021 120.32-55.475 190.31-55.475 195.942 0 355.43 159.411 355.43 355.354zM154.957 510.413c0-69.939 20.506-135.245 55.578-190.31l490.189 490.189c-55.066 35.072-120.371 55.501-190.31 55.501-195.942 0.026-355.456-159.437-355.456-355.379z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "not-installed" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 58, - "id": 35, - "prevSize": 32, - "code": 58936, - "name": "not-installed" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 35 - }, - { - "icon": { - "paths": [ - "M511.77 0c-282.778 0-512.102 229.222-512.102 512.179 0 282.829 229.325 512.102 512.102 512.102 282.931 0.026 512.23-229.248 512.23-512.102 0-282.957-229.299-512.179-512.23-512.179zM143.718 419.968h736.205v184.269h-736.205v-184.269z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "disabled" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 57, - "id": 36, - "prevSize": 32, - "code": 58937, - "name": "disabled" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 36 - }, - { - "icon": { - "paths": [ - "M505.139 0.085c-282.658 3.775-508.826 236.066-505.071 518.827 3.772 282.556 236.1 508.826 518.793 505.003 282.658-3.768 508.826-236.066 505.071-518.827-3.717-282.658-236.1-508.826-518.793-505.003z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "dot" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 56, - "id": 37, - "prevSize": 32, - "code": 58935, - "name": "dot" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 37 - }, - { - "icon": { - "paths": [ - "M383.462 577.51h255.693v-213.043h127.795l-255.642-255.667-255.642 255.667h127.795z", - "M852.173 577.51v170.394h-681.754v-170.394h-170.419v340.89h1022.618v-340.89z" - ], - "attrs": [ - {}, - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "export" - ], - "grid": 0 - }, - "attrs": [ - {}, - {} - ], - "properties": { - "order": 93, - "id": 38, - "prevSize": 32, - "code": 58933, - "name": "export" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 38 - }, - { - "icon": { - "paths": [ - "M639.155 108.8h-255.693v213.043h-127.795l255.667 255.667 255.616-255.667h-127.795z", - "M852.173 577.51v170.394h-681.754v-170.394h-170.419v340.89h1022.618v-340.89z" - ], - "attrs": [ - {}, - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "import" - ], - "grid": 0 - }, - "attrs": [ - {}, - {} - ], - "properties": { - "order": 92, - "id": 39, - "prevSize": 32, - "code": 58934, - "name": "import" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 39 - }, - { - "icon": { - "paths": [ - "M259.2 0h214.323v214.323h-214.323v-214.323z", - "M259.2 269.875h214.323v214.349h-214.323v-214.349z", - "M259.2 539.776h214.323v214.349h-214.323v-214.349z", - "M259.2 809.651h214.323v214.349h-214.323v-214.349z", - "M549.325 0h214.323v214.323h-214.323v-214.323z", - "M549.325 269.875h214.323v214.349h-214.323v-214.349z", - "M549.325 539.776h214.323v214.349h-214.323v-214.349z", - "M549.325 809.651h214.323v214.349h-214.323v-214.349z" - ], - "attrs": [ - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "gripper" - ], - "grid": 0 - }, - "attrs": [ - {}, - {}, - {}, - {}, - {}, - {}, - {}, - {} - ], - "properties": { - "order": 91, - "id": 40, - "prevSize": 32, - "code": 58903, - "name": "gripper" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 40 - }, - { - "icon": { - "paths": [ - "M860.058 185.062v272l-430.029-269.158-1.894 253.491-424.371-249.754-3.763 647.834 426.24-241.28-5.606 239.437 439.424-252.16v259.635h163.942v-660.045z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "forward" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 90, - "id": 41, - "prevSize": 32, - "code": 58904, - "name": "forward" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 41 - }, - { - "icon": { - "paths": [ - "M163.942 845.107v-271.974l430.029 269.133 1.894-253.491 424.397 249.754 3.738-647.834-426.24 241.28 5.606-239.437-439.424 252.16v-259.635h-163.942v660.045z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "backward" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 89, - "id": 42, - "prevSize": 32, - "code": 58905, - "name": "backward", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 42 - }, - { - "icon": { - "paths": [ - "M512.794 0c-283.187 0-512.794 229.581-512.794 512.794 0 283.187 229.606 512.794 512.794 512.794s512.794-229.632 512.794-512.794c0-283.213-229.581-512.794-512.794-512.794zM512.794 971.213c-253.158 0-458.394-205.261-458.394-458.368 0-253.158 205.261-458.394 458.394-458.394 253.184 0 458.394 205.235 458.394 458.394 0.026 253.107-205.21 458.368-458.394 458.368z", - "M760.013 625.613l30.387-38.4-265.6-206.413-20.787-1.613-259.226 208.026 28.826 39.987 236.8-177.613z" - ], - "attrs": [ - {}, - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "expand-close" - ], - "grid": 0 - }, - "attrs": [ - {}, - {} - ], - "properties": { - "order": 88, - "id": 43, - "prevSize": 32, - "code": 58901, - "name": "expand-close" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 43 - }, - { - "icon": { - "paths": [ - "M512.794 0c-283.187 0-512.794 229.581-512.794 512.794 0 283.187 229.606 512.794 512.794 512.794s512.794-229.606 512.794-512.794c0-283.213-229.581-512.794-512.794-512.794zM512.794 971.213c-253.158 0-458.394-205.261-458.394-458.394 0-253.158 205.261-458.394 458.394-458.394 253.184 0 458.394 205.235 458.394 458.394 0.026 253.133-205.21 458.394-458.394 458.394z", - "M265.6 454.4l-30.387 38.4 265.574 206.387 20.813 1.613 259.2-208-28.8-39.987-236.8 177.587z" - ], - "attrs": [ - {}, - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "expand-open" - ], - "grid": 0 - }, - "attrs": [ - {}, - {} - ], - "properties": { - "order": 87, - "id": 44, - "prevSize": 32, - "code": 58902, - "name": "expand-open" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 44 - }, - { - "icon": { - "paths": [ - "M1020.032 565.555v-116.045l-16.41-5.376-124.237-40.525-33.152-80.102 63.718-134.784-82.048-82.125-15.411 7.808-116.531 59.213-80.077-33.178-50.278-140.442h-116.096l-45.875 140.698-80 33.126-134.963-63.744-82.022 82.074 7.834 15.334 59.162 116.608-33.126 80.026-140.518 50.253v116.147l16.435 5.325 124.288 40.576 33.075 80-63.693 134.886 82.048 82.099 131.942-66.97 80.026 33.152 50.304 140.39h116.096l5.35-16.41 40.55-124.237 80.077-33.178 134.886 63.718 82.074-82.074-7.834-15.386-59.213-116.582 33.203-80.026 140.416-50.253zM510.003 672.589c-89.754 0-162.509-72.832-162.509-162.611 0-89.754 72.755-162.483 162.509-162.483 89.83 0 162.509 72.73 162.509 162.483 0.026 89.805-72.653 162.611-162.509 162.611z" - ], - "attrs": [ - { - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "system-config" - ], - "grid": 0 - }, - "attrs": [ - { - "visibility": false - } - ], - "properties": { - "order": 86, - "id": 45, - "prevSize": 32, - "code": 58896, - "name": "system-config" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 45 - }, - { - "icon": { - "paths": [ - "M509.978 54.426l-509.978 509.926 95.949 95.949 414.106-413.978 413.875 413.978 95.949-95.898-509.901-509.978zM146.253 688.563v335.437h259.917v-304.819h207.514v304.819h259.917v-335.488l-363.622-363.597-363.725 363.648z" - ], - "attrs": [ - { - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "home" - ], - "grid": 0 - }, - "attrs": [ - { - "visibility": false - } - ], - "properties": { - "order": 85, - "id": 46, - "prevSize": 32, - "code": 58897, - "name": "home" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 46 - }, - { - "icon": { - "paths": [ - "M0 736.41l498.278 287.59v-421.402l-498.278-287.667v421.478zM894.464 224.486v44.262c0 32.819-62.797 59.418-140.365 59.418-77.466 0-140.262-26.598-140.262-59.418v-73.216h0.435c4.71 30.925 65.408 55.475 139.853 55.475 77.568 0 140.365-26.624 140.365-59.29 0-32.845-62.797-59.366-140.365-59.366-6.195 0-12.262 0.205-18.202 0.563l-90.317-52.147v55.706c0 32.819-62.72 59.392-140.262 59.392-48.691 0-91.597-10.496-116.813-26.47-3.584-3.712-7.987-7.245-13.312-10.598-6.579-6.861-10.24-14.387-10.24-22.323v-53.939l-87.322 50.381c-6.272-0.307-12.646-0.614-19.123-0.614-77.491 0-140.314 26.522-140.314 59.366 0 32.691 62.822 59.29 140.314 59.29 74.445 0 135.219-24.525 139.93-55.475h0.384v73.216c0 32.819-62.746 59.418-140.314 59.418-77.491 0-140.314-26.598-140.314-59.418v-43.622l-108.083 62.31 499.994 288.563 496.691-286.694-112.358-64.768zM646.784 408.013c0 32.794-62.874 59.315-140.365 59.315s-140.339-26.522-140.339-59.315v-73.267h0.41c4.762 30.95 65.459 55.475 139.93 55.475s135.142-24.525 139.904-55.475h0.486v73.267zM525.645 606.234v417.766l498.355-287.718v-417.766l-498.355 287.718zM505.318 118.656c77.542 0 140.262-26.547 140.262-59.315s-62.72-59.315-140.262-59.315c-77.491 0-140.339 26.573-140.339 59.315-0.026 32.768 62.822 59.315 140.339 59.315z" - ], - "attrs": [ - { - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "lego" - ], - "grid": 0 - }, - "attrs": [ - { - "visibility": false - } - ], - "properties": { - "order": 84, - "id": 47, - "prevSize": 32, - "code": 58898, - "name": "lego" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 47 - }, - { - "icon": { - "paths": [ - "M287.002 481.664c0.205 0.23 0.461 0.486 0.691 0.717l103.347 103.373 36.045-36.045-56.55-56.499 90.266-90.189 11.904 1.28c3.046 0.307 6.093 0.538 9.19 0.538 6.246 0 12.314-0.768 18.253-2.125l-66.381-66.381c-1.357-1.382-2.765-2.611-4.173-3.814 20.454-73.6 1.766-155.725-56.038-213.555-57.421-57.421-138.803-76.237-211.968-56.525l123.955 123.981-32.563 121.446-121.395 32.589-124.032-124.006c-19.712 73.19-0.896 154.573 56.525 212.019 60.262 60.288 147.021 77.952 222.925 53.197zM653.235 555.802c-1.997 8.909-2.509 18.202-1.459 27.546l1.306 11.93-90.189 90.189-56.55-56.55-36.070 36.122 327.219 327.194c20.198 20.173 46.618 30.259 73.062 30.259s52.915-10.086 73.037-30.259c40.346-40.32 40.346-105.728 0-146.074l-290.355-290.355zM905.907 958.362l-51.866 13.875-42.112-42.112 13.901-51.891 51.866-13.926 42.112 42.138-13.901 51.917zM506.701 594.099l56.576 56.576 64.128-64.154c-3.482-31.334 6.707-63.821 30.669-87.808 24.013-23.962 56.474-34.176 87.808-30.72l280.397-280.346-157.056-157.056-280.448 280.397c3.482 31.258-6.682 63.821-30.669 87.782-24.013 23.987-56.525 34.176-87.808 30.643l-64.102 64.205 56.499 56.422-277.043 277.12-10.138-10.138-53.248 42.829-89.421 141.312 22.835 22.835 141.312-89.421 42.803-53.222-10.138-10.138 277.043-277.12z" - ], - "attrs": [ - { - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "tool" - ], - "grid": 0 - }, - "attrs": [ - { - "visibility": false - } - ], - "properties": { - "order": 120, - "id": 48, - "prevSize": 32, - "code": 58899, - "name": "tool" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 48 - }, - { - "icon": { - "paths": [ - "M1023.932 505.105c-3.717-282.692-236.1-508.826-518.793-505.003-282.658 3.775-508.826 236.066-505.071 518.827 3.772 282.556 236.1 508.826 518.793 505.003 282.658-3.768 508.826-236.066 505.071-518.827zM623.991 481.304v298.633h-223.983v-298.633h-186.621l298.633-298.633 298.667 298.633h-186.679z" - ], - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "upgrade" - ], - "grid": 0 - }, - "attrs": [ - {} - ], - "properties": { - "order": 125, - "id": 49, - "prevSize": 32, - "code": 58900, - "name": "upgrade" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 49 - }, - { - "icon": { - "paths": [ - "M870.821 731.837c-64.195-65.89-78.231-188.772-91.738-283.159-20.074-139.937-24.259-297.089-226.008-317.693v-25.318c0-25.424-39.195-46.028-64.937-46.028s-62.024 20.551-62.024 46.028v25.371c-200.054 20.816-206.993 177.914-226.855 317.693-13.453 94.439-27.331 217.268-91.049 283.264-12.818 13.348-16.473 32.998-9.11 49.947 7.362 16.843 24.153 27.913 42.797 27.913h695.343c18.75 0 35.593-11.070 42.903-28.019s3.655-36.653-9.322-50z", - "M489.569 963.883c51.060 0 92.373-40.837 92.373-91.367h-184.694c-0.053 50.53 41.314 91.367 92.32 91.367z" - ], - "width": 989, - "attrs": [ - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "notification-02" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 123, - "id": 50, - "prevSize": 32, - "code": 58887, - "name": "notification-02" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 50 - }, - { - "icon": { - "paths": [ - "M252.137 153.228l-160.070 92.393 378.042 218.205 160.023-92.393-377.996-218.205zM845.638 247.063l-377.996-218.252-145.222 83.828 377.996 218.205 145.222-83.782zM502.784 526.15v433.664l376.832-217.507v-433.711l-376.832 217.553zM55.668 742.26l376.785 217.507v-436.503l-376.785-217.46v436.457z" - ], - "width": 954, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "product" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 7, - "id": 51, - "prevSize": 32, - "code": 58888, - "name": "product", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 51 - }, - { - "icon": { - "paths": [ - "M454.495 48.899l-402.697 240.513v457.026l104.632 60.727v-457.049l298.157-178.728 299.698 179.142-0.138 455.922 103.528-60.013v-457.026l-403.18-240.513zM507.766 330.28v534.344l-53.271 32.124-53.34-32.262v-533.792l-138.090 83.853v456.934l191.453 115.516 193.087-116.322v-456.451l-139.839-83.945z" - ], - "width": 903, - "attrs": [ - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "logo" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 17, - "id": 52, - "prevSize": 32, - "code": 58886, - "name": "logo", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 52 - }, - { - "icon": { - "paths": [ - "M709.921 158.694c8.139 32.295 8.927 34.974 8.192 68.162-0.263 12.813-7.772 71.943-5.724 90.112 1.628 14.966 5.461 16.174 11.448 28.514 10.398 21.425 6.984 51.095 2.941 72.678-2.206 11.868-6.827 28.725-13.916 38.387-7.667 10.66-23.211 10.713-30.142 23.158-9.872 17.854-4.306 43.008-10.503 62.385-7.142 21.898-25.101 23.421-26.466 52.145 8.822 1.155 17.592 2.468 26.466 3.623 8.822 18.59 25.049 55.874 41.59 67.059 13.863 3.728 27.727 7.457 41.59 11.185 48.627 19.64 102.558 43.061 151.237 63.33 44.373 18.432 97.411 24.996 113.48 70.84 0 31.035 2.941 104.501 2.153 145.25h-965.553c-0.893-40.697 2.153-114.215 2.153-145.25 15.964-45.844 69.002-52.408 113.375-70.84 48.679-20.27 102.61-43.691 151.237-63.33 13.811-3.728 27.674-7.457 41.59-11.185 16.489-11.185 32.715-48.522 41.538-67.059l19.692-4.621c-4.464-24.576-19.85-26.466-26.256-43.743-2.521-26.099-5.041-52.145-7.509-78.192 0.053 1.155-18.117-3.361-20.48-4.779-25.731-15.806-26.204-80.24-28.725-107.021-1.103-12.183 16.174-22.265 11.343-44.636-28.094-131.44 12.183-192.88 75.881-213.307 44.216-17.749 126.871-50.465 203.855-3.728l19.167 17.487 30.93 5.251c15.491 8.77 25.416 38.124 25.416 38.124z" - ], - "width": 1090, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "account" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 9, - "id": 53, - "prevSize": 32, - "code": 58880, - "name": "account", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 53 - }, - { - "icon": { - "paths": [ - "M529.203 886.14l-468.465-628.209h936.931l-468.465 628.209z" - ], - "width": 1085, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "arrowdown" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 10, - "id": 54, - "prevSize": 32, - "code": 58881, - "name": "arrowdown", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 54 - }, - { - "icon": { - "paths": [ - "M976.793 982.006h-910.388v-910.388h910.388v910.388zM912.622 135.789h-782.046v782.088h782.046v-782.088z", - "M221.432 822.8h152.876v-372.033h-152.876v372.033z", - "M466.323 820.234h350.932v-366.53h-350.932v366.53z", - "M221.432 360.489h595.865v-147.125h-595.865v147.125z" - ], - "width": 1034, - "attrs": [ - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "cms" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 83, - "id": 55, - "prevSize": 32, - "code": 58882, - "name": "cms", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 55 - }, - { - "icon": { - "paths": [ - "M264.319 308.831c75.685 0 136.98-61.259 136.98-136.944 0-75.649-61.295-136.98-136.98-136.98s-137.017 61.331-137.017 136.98c0 75.649 61.331 136.944 137.017 136.944zM448.929 370.851c-28.962-28.926-63.325-46.252-187.655-46.252s-157.859 18.776-185.335 46.252c-27.44 27.44-18.196 320.43-18.196 320.43l60.824-144.411 38.241 430.334 110.23-220.278 102.907 220.278 36.393-430.334 60.824 144.411c-0.036 0 10.693-291.468-18.233-320.43z" - ], - "width": 489, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "customers" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 82, - "id": 56, - "prevSize": 32, - "code": 58883, - "name": "customers", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 56 - }, - { - "icon": { - "paths": [ - "M680.975 73.728c-337.523 0-610.976 273.515-611.038 610.976 0.122 37.72 1.039 251.812 1.039 251.812h1219.997c0 0 0.978-239.219 1.039-251.812-0.183-337.523-273.637-610.976-611.038-610.976zM737.708 197.831c31.117 3.607 61.379 10.271 90.418 19.624l-19.93 61.685c-25.004-8.070-51.169-13.939-78.191-16.995l7.703-64.313zM270.091 673.15h-64.864c0-31.423 3.118-62.235 8.803-92.007l63.702 12.349c-5.135 25.799-7.642 52.392-7.642 79.658zM305.855 504.419l-59.178-26.288c12.655-28.489 28-55.449 45.79-80.636l52.942 37.475c-15.284 21.825-28.611 45.056-39.554 69.449zM407.46 365.155l-43.405-48.113c22.925-20.541 47.807-39.187 74.462-54.96l33.318 55.571c-22.987 13.755-44.567 29.65-64.374 47.501zM536.943 217.455c29.039-9.292 59.178-16.017 90.418-19.624l7.581 64.313c-26.838 3.057-53.003 8.926-78.13 16.995l-19.869-61.685zM761.673 801.532l-152.897 27.205-38.881-150.452 395.172-404.22-203.394 527.467zM1019.476 434.971l52.942-37.414c17.79 25.187 33.257 52.148 45.851 80.636l-59.178 26.288c-10.943-24.454-24.209-47.685-39.615-69.51zM1094.916 673.15c0-27.266-2.69-53.859-7.703-79.658l63.702-12.349c5.808 29.834 8.803 60.645 8.803 92.007h-64.802zM646.006 770.659c26.777 17.056 62.174 9.415 79.291-17.24 17.118-26.593 9.292-62.051-17.301-79.108-26.655-17.24-62.051-9.354-79.23 17.362-17.118 26.349-9.476 61.99 17.24 78.986z" - ], - "width": 1376, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "dashboard" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 81, - "id": 57, - "prevSize": 32, - "code": 58884, - "name": "dashboard", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 57 - }, - { - "icon": { - "paths": [ - "M24.097 113.465h972.827v111.922l-410.504 412.792v238.366l-171.447 87.505v-325.871l-390.875-415.877v-108.837z" - ], - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "filter" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 80, - "id": 58, - "prevSize": 32, - "code": 58885, - "name": "filter", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 58 - }, - { - "icon": { - "paths": [ - "M59.153 534.182l164.053 38.141v-303.902l-164.053 38.141v227.621zM1122.198 59.153l-837.712 194.959v335.978l140.328 376.832 151.712-57.45-104.049-279.113 649.668 151.18v-722.385z" - ], - "width": 1170, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "promotions" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 79, - "id": 59, - "prevSize": 32, - "code": 58889, - "name": "promotions", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 59 - }, - { - "icon": { - "paths": [ - "M736.707 981.234h207.134v-322.703h-207.134v322.703zM399.646 981.234h207.134v-946.793h-207.134v946.793zM62.673 981.19h207.134v-634.704h-207.134v634.704z" - ], - "width": 991, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "reports" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 78, - "id": 60, - "prevSize": 32, - "code": 58890, - "name": "reports", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 60 - }, - { - "icon": { - "paths": [ - "M426.502 612.517c-15.866-13.512-42.796-25.753-80.79-36.723v198.774c11.535-1.459 23.729-4.331 36.299-8.851 12.618-4.426 23.87-10.829 33.804-19.068 9.981-8.427 18.173-18.55 24.529-30.649 6.638-12.006 9.651-26.365 9.651-42.89 0.047-26.836-7.721-47.222-23.493-60.593zM576.736 736.856c-7.109 23.117-19.774 45.762-38.135 67.749-18.503 22.175-43.079 41.855-74.010 58.992-30.885 17.373-70.432 27.683-118.878 31.12v88.088h-57.014v-88.088c-72.080-5.603-128.483-29.237-169.113-71.374-40.536-42.090-63.935-104.095-70.432-185.544h136.251c-0.753 39.359 8.992 70.479 28.86 93.266 20.15 22.74 44.774 37.335 74.434 43.455v-216.523c-3.060-1.318-7.486-2.919-12.994-4.567-5.508-1.789-11.393-3.343-17.938-4.708-23.776-6.827-47.175-15.019-70.291-24.294-23.493-9.369-44.114-21.704-62.523-37.335-18.456-15.584-33.098-34.84-43.879-57.956-11.111-23.211-16.478-51.977-16.478-86.487 0-35.31 6.168-66.336 18.785-93.313 12.665-26.836 29.143-49.529 49.858-67.702 20.621-18.314 44.303-32.58 71.468-42.419 27.071-10.122 55.037-16.149 83.992-18.314v-79.66h57.014v79.66c29.143 3.531 56.308 10.169 81.638 20.292 25.423 10.028 47.787 23.729 67.137 41.478 19.585 17.514 35.357 39.453 47.457 65.771 12.288 26.13 19.35 57.109 21.28 93.172h-137.287c-0.518-27.636-8.616-51.082-23.917-70.432-15.725-19.303-34.275-29.002-56.308-29.002v183.331c7.862 2.072 15.631 4.143 23.729 6.12 8.098 2.072 16.525 4.567 25.565 7.297 47.645 13.983 84.415 31.12 110.168 51.318 25.8 20.292 44.726 41.666 56.92 63.653 12.335 22.175 19.633 44.256 21.704 66.336 2.448 22.081 3.531 41.713 3.531 59.039 0.047 15.207-3.531 34.416-10.593 57.579zM228.905 263.415c-8.38 7.156-15.113 16.196-19.962 26.883-4.802 10.781-7.062 23.352-7.062 37.759 0 22.834 6.733 40.536 20.103 52.824 13.653 12.618 35.734 22.552 66.713 30.131v-168.831c-10.829 0-21.516 1.695-31.826 5.226-10.216 3.437-19.633 8.851-27.966 16.007z" - ], - "width": 659, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "sales" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 77, - "id": 61, - "prevSize": 32, - "code": 58891, - "name": "sales", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 61 - }, - { - "icon": { - "paths": [ - "M555.139 21.642c-218.775-71.601-457.062 40.29-532.231 250.028-75.227 209.681 41.211 437.665 259.928 509.208 218.717 71.601 457.004-40.348 532.231-250.028s-41.211-437.665-259.928-509.208zM320.076 677.045c-158.915-52.089-243.467-217.681-188.903-369.978 54.679-152.296 227.754-233.625 386.669-181.593s243.409 217.624 188.788 369.92c-54.622 152.296-227.696 233.567-386.554 181.65z", - "M638.482 685.794l358.927 349.602 24.807-69.241 24.865-69.241-310.348-302.29z" - ], - "width": 1109, - "attrs": [ - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "search" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - }, - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 76, - "id": 62, - "prevSize": 32, - "code": 58892, - "name": "search", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 62 - }, - { - "icon": { - "paths": [ - "M1098.281 85.45c19.777-3.723 34.901-21.232 34.901-42.347-0.058-23.791-19.196-43.103-42.812-43.103h-900.508c-23.675 0-42.754 19.312-42.754 43.103 0 21.057 15.007 38.566 34.843 42.347l-181.951 354.421v68.988c0 30.946 32.516 56.016 72.594 56.016 13.437 0 26.001-2.908 36.821-7.795v466.919h1061.286v-466.919c10.878 4.944 23.326 7.795 36.879 7.795 40.078 0 72.594-25.071 72.594-56.016v-68.988l-181.893-354.421zM214.758 564.875c-38.217 0-69.221-25.071-69.221-56.016v-6.457h-0.349v-62.531l137.162-353.665h109.648l-107.961 353.665v68.988c0 0 0 0 0 0 0 30.946-31.004 56.016-69.279 56.016zM498.447 564.875c-38.217 0-69.221-25.071-69.221-56.016v-68.988l57.354-353.665h109.241l-28.095 353.665v68.93c-0.058 31.004-31.004 56.075-69.279 56.075zM782.077 564.875c-38.217 0-69.162-25.071-69.162-56.016v-68.988l-28.154-353.665h108.892l57.296 353.665v68.988c0 0.931 0.175 1.92 0.233 2.792-1.803 29.666-32.051 53.224-69.104 53.224zM1134.637 508.859c0 30.946-31.004 56.016-69.221 56.016s-69.162-25.071-69.162-56.016v-68.988l-108.019-353.665h109.59l137.22 353.665v62.473h-0.349v6.515h-0.058z" - ], - "width": 1280, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "stores" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 75, - "id": 63, - "prevSize": 32, - "code": 58893, - "name": "stores", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 63 - }, - { - "icon": { - "paths": [ - "M944.97 329.042c-97.861 0-177.522 79.581-177.522 177.443 0 97.94 79.66 177.679 177.522 177.679 98.019 0 177.679-79.739 177.679-177.679 0-97.861-79.66-177.443-177.679-177.443zM944.97-0c-470.712 0-944.97 512-944.97 512s474.258 512 944.97 512c470.949 0 945.128-512 945.128-512s-474.179-512-945.128-512zM944.97 868.856c-200.057 0-362.292-162.078-362.292-362.45 0-200.057 162.236-362.292 362.292-362.292 200.214 0 362.45 162.236 362.45 362.292 0 200.451-162.236 362.45-362.45 362.45z" - ], - "width": 1890, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "views" - ], - "grid": 0 - }, - "attrs": [ - { - "opacity": 1, - "visibility": false - } - ], - "properties": { - "order": 73, - "id": 64, - "prevSize": 32, - "code": 58895, - "name": "views", - "ligatures": "" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 64 - }, - { - "icon": { - "paths": [ - "M1042.226 299.849h-598.393v-299.849l-443.833 384.316 443.833 384.403v-299.859h598.393c106.478 0 192.801 86.318 192.801 192.801s-86.318 192.796-192.801 192.796v0.483l-452.707 0.005c-46.695 0.005-84.53 37.845-84.53 84.535 0 46.68 37.84 84.525 84.535 84.525 0.377 0 0.744-0.053 1.121-0.058h451.581c199.964 0 362.044-162.085 362.044-362.039 0-199.964-162.080-362.059-362.044-362.059z" - ], - "width": 1404, - "attrs": [], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "revert" - ], - "grid": 0 - }, - "attrs": [], - "properties": { - "order": 129, - "id": 65, - "prevSize": 32, - "code": 58946, - "name": "revert" - }, - "setIdx": 0, - "setId": 7, - "iconIdx": 65 - }, - { - "icon": { - "paths": [ - "M1023.959 505.088c-3.717-282.665-236.121-508.842-518.817-505.040-282.689 3.772-508.866 236.091-505.094 518.868 3.772 282.58 236.121 508.842 518.813 505.040 282.689-3.772 508.866-236.067 505.098-518.868zM580.086 904.359h-136.149v-136.163h136.149v136.163zM597.168 293.742l-44.103 388.928h-83.113l-43.099-388.928v-171.575h170.318v171.575z" - ], - "attrs": [ - { - "fill": "rgb(100, 97, 96)" - } - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "alert-round" - ], - "grid": 32 - }, - "attrs": [ - { - "fill": "rgb(100, 97, 96)" - } - ], - "properties": { - "order": 132, - "id": 0, - "name": "alert-round", - "prevSize": 32, - "code": 58952 - }, - "setIdx": 1, - "setId": 6, - "iconIdx": 0 - }, - { - "icon": { - "paths": [ - "M793.271 222.6l-192.695-83.055v80.482c-2.517 31.926-83.182 57.618-182.582 57.618-99.309 0-180.126-25.692-182.398-57.618h-0.318l-0.465-80.482-197.709 83.055 381.218 167.697 374.95-167.697zM265.959 118.114l-1.104 0.428c32.596 16.331 89.086 27.124 153.551 27.124 64.726 0 121.621-10.94 153.996-27.355l-1.168-0.512c18.811-9.3 29.664-20.34 29.664-32.264 0-32.713-81.606-59.114-182.492-59.114-100.759 0-182.806 26.401-182.806 59.114-0.003 12.007 11.295 23.218 30.36 32.579zM418.418 462.436l-418.418-191.009v563.335l418.321 189.238 418.321-189.238v-563.733l-418.224 191.407z" - ], - "width": 883, - "attrs": [ - {} - ], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "module" - ], - "grid": 32 - }, - "attrs": [ - {} - ], - "properties": { - "order": 131, - "id": 1, - "name": "module", - "prevSize": 32, - "code": 58951 - }, - "setIdx": 1, - "setId": 6, - "iconIdx": 1 - }, - { - "icon": { - "paths": [ - "M939.616 148.384c112.512 112.448 112.512 294.816 0 407.264l-350.944 350.976c-12.512 12.544-32.736 12.544-45.248 0-12.576-12.512-12.576-32.704 0-45.248l346.432-346.464c87.488-87.488 87.488-229.248-0.064-316.768-87.36-87.488-229.248-87.488-316.736 0l-462.304 456.864c-62.496 62.464-62.496 163.776 0 226.24 62.496 62.496 163.744 62.496 226.24 0l466.88-461.344c37.44-37.44 37.44-98.336 0-135.776-37.44-37.408-98.304-37.408-135.744 0l-351.008 351.008c-12.512 12.512-32.736 12.512-45.248 0-12.512-12.544-12.512-32.736 0-45.28l350.976-350.976c62.432-62.464 163.744-62.464 226.24 0 62.496 62.496 62.496 163.776 0 226.272l-466.88 461.376c-87.296 87.328-229.408 87.328-316.736 0-87.328-87.328-87.328-229.472 0-316.8l466.88-461.344c112.448-112.512 294.816-112.512 407.264 0z" - ], - "attrs": [], - "isMulticolor": false, - "isMulticolor2": false, - "tags": [ - "clip", - "paperclip", - "attachment" - ], - "grid": 32 - }, - "attrs": [], - "properties": { - "id": 2, - "order": 130, - "prevSize": 32, - "code": 58947, - "name": "clip" - }, - "setIdx": 1, - "setId": 6, - "iconIdx": 2 - } - ], - "height": 1024, - "metadata": { - "name": "icomoon" - }, - "preferences": { - "showGlyphs": true, - "showQuickUse": true, - "showQuickUse2": true, - "showSVGs": true, - "fontPref": { - "prefix": "icon-", - "metadata": { - "fontFamily": "icomoon", - "majorVersion": 1, - "minorVersion": 0 - }, - "metrics": { - "emSize": 1024, - "baseline": 6.25, - "whitespace": 50 - }, - "resetPoint": 58880, - "showVersion": true, - "showSelector": false, - "showMetrics": false, - "showMetadata": false, - "embed": false - }, - "imagePref": { - "prefix": "icon-", - "png": true, - "useClassSelector": true, - "classSelector": ".icon" - }, - "historySize": 100, - "showCodes": true, - "search": "", - "gridSize": 16, - "showLiga": false - } -} \ No newline at end of file diff --git a/setup/pub/fonts/opensans/bold/opensans-700.eot b/setup/pub/fonts/opensans/bold/opensans-700.eot deleted file mode 100644 index 5d20d916338a5..0000000000000 Binary files a/setup/pub/fonts/opensans/bold/opensans-700.eot and /dev/null differ diff --git a/setup/pub/fonts/opensans/bold/opensans-700.svg b/setup/pub/fonts/opensans/bold/opensans-700.svg deleted file mode 100644 index 9ece857021152..0000000000000 --- a/setup/pub/fonts/opensans/bold/opensans-700.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg"><defs><font horiz-adv-x="1169"><font-face units-per-em="2048" ascent="1638" descent="-410"/><glyph unicode="fi" horiz-adv-x="1417" d="M41 0zm737 889H514V0H209v889H41v147l168 82v82q0 191 94 279t301 88q158 0 281-47l-78-224q-92 29-170 29-65 0-94-38.5t-29-98.5v-70h264V889zm162 518q0 149 166 149t166-149q0-71-41.5-110.5T1106 1257q-166 0-166 150zM1258 0H953v1118h305V0z"/><glyph unicode="fl" horiz-adv-x="1417" d="M41 0zm737 889H514V0H209v889H41v147l168 82v82q0 191 94 279t301 88q158 0 281-47l-78-224q-92 29-170 29-65 0-94-38.5t-29-98.5v-70h264V889zM1258 0H953v1556h305V0z"/><glyph unicode="ffi" horiz-adv-x="2208" d="M41 0zm737 889H514V0H209v889H41v147l168 82v82q0 191 94 279t301 88q158 0 281-47l-78-224q-92 29-170 29-65 0-94-38.5t-29-98.5v-70h264V889zm793 0h-264V0h-305v889H834v147l168 82v82q0 191 94 279t301 88q158 0 281-47l-78-224q-92 29-170 29-65 0-94-38.5t-29-98.5v-70h264V889zm159 518q0 149 166 149t166-149q0-71-41.5-110.5T1896 1257q-166 0-166 150zM2048 0h-305v1118h305V0z"/><glyph unicode="ffl" horiz-adv-x="2208" d="M41 0zm737 889H514V0H209v889H41v147l168 82v82q0 191 94 279t301 88q158 0 281-47l-78-224q-92 29-170 29-65 0-94-38.5t-29-98.5v-70h264V889zm793 0h-264V0h-305v889H834v147l168 82v82q0 191 94 279t301 88q158 0 281-47l-78-224q-92 29-170 29-65 0-94-38.5t-29-98.5v-70h264V889zM2048 0h-305v1556h305V0z"/><glyph horiz-adv-x="2048"/><glyph horiz-adv-x="2048"/><glyph horiz-adv-x="1044"/><glyph horiz-adv-x="532"/><glyph horiz-adv-x="532"/><glyph horiz-adv-x="532"/><glyph unicode="!" horiz-adv-x="586" d="M416 485H172l-51 977h346zM117 143q0 84 45 127t131 43q83 0 128.5-44T467 143q0-79-46-124.5T293-27q-84 0-130 44.5T117 143z"/><glyph unicode="&quot;" horiz-adv-x="967" d="M412 1462l-41-528H174l-41 528h279zm422 0l-41-528H596l-41 528h279z"/><glyph unicode="#" horiz-adv-x="1323" d="M999 844l-47-232h258V406H913L836 0H616l78 406H500L424 0H209l74 406H45v206h277l47 232H117v209h289l77 407h219l-77-407h198l78 407h215l-78-407h240V844H999zM539 612h196l47 232H586z"/><glyph unicode="$" d="M1092 457q0-159-115-255.5T655 86v-205H518V82q-244 5-428 86v264q87-43 209.5-76T518 317v310l-67 26q-198 78-280.5 169.5T88 1049q0 145 113.5 238.5T518 1401v153h137v-149q229-10 414-92l-94-234q-156 64-320 78V862q195-75 277.5-130t121-121 38.5-154zm-301-15q0 42-34 71t-102 60V324q136 23 136 118zm-402 607q0-44 30.5-72.5T518 918v235q-129-19-129-104z"/><glyph unicode="%" horiz-adv-x="1845" d="M315 1024q0-127 22.5-189.5T410 772q96 0 96 252 0 250-96 250-50 0-72.5-61.5T315 1024zm443 2q0-230-89-345.5T408 565q-165 0-255 118.5T63 1026q0 457 345 457 169 0 259.5-118.5T758 1026zm688 436L635 0H395l811 1462h240zM1339 440q0-127 22.5-189.5T1434 188q96 0 96 252 0 250-96 250-50 0-72.5-61.5T1339 440zm443 2q0-229-89-344.5T1432-18q-165 0-255 118.5T1087 442q0 457 345 457 169 0 259.5-118.5T1782 442z"/><glyph unicode="&" horiz-adv-x="1536" d="M1536 0h-377l-115 113Q853-20 612-20 368-20 225 92T82 395q0 137 60.5 233.5T350 809q-75 86-109 164.5T207 1145q0 152 116.5 245t311.5 93q186 0 297.5-86.5T1044 1165q0-119-69-217.5T752 760l284-277q71 117 123 301h318q-36-135-99-263.5T1235 293zM403 424q0-86 64.5-137T633 236q126 0 227 61L528 627q-58-44-91.5-92T403 424zm359 709q0 53-36 83.5t-93 30.5q-67 0-105.5-32t-38.5-91q0-88 95-194 86 48 132 94.5t46 108.5z"/><glyph unicode="'" horiz-adv-x="545" d="M412 1462l-41-528H174l-41 528h279z"/><glyph unicode="(" horiz-adv-x="694" d="M82 561q0 265 77.5 496T383 1462h250q-141-193-213-424t-72-475q0-245 73.5-473.5T631-324H383Q236-154 159 73T82 561z"/><glyph unicode=")" horiz-adv-x="694" d="M612 561q0-263-77.5-490T311-324H63Q198-140 272 88.5T346 563q0 244-72 475T61 1462h250q147-175 224-406.5T612 561z"/><glyph unicode="*" horiz-adv-x="1116" d="M688 1556l-41-368 373 104 33-252-340-24 223-297-227-121-156 313-137-311-236 119 221 297-338 26 39 250 365-104-41 368h262z"/><glyph unicode="+" d="M475 612H88v219h387v390h219V831h387V612H694V227H475v385z"/><glyph unicode="," horiz-adv-x="594" d="M459 215Q407 13 283-264H63Q128 2 164 238h280z"/><glyph unicode="-" horiz-adv-x="659" d="M61 424v250h537V424H61z"/><glyph unicode="." horiz-adv-x="584" d="M117 143q0 84 45 127t131 43q83 0 128.5-44T467 143q0-79-46-124.5T293-27q-84 0-130 44.5T117 143z"/><glyph unicode="/" horiz-adv-x="846" d="M836 1462L291 0H14l545 1462h277z"/><glyph unicode="0" d="M1096 731q0-383-125.5-567T584-20q-253 0-381.5 190T74 731q0 387 125 570.5T584 1485q253 0 382.5-192T1096 731zm-715 0q0-269 46.5-385.5T584 229q108 0 156 118t48 384q0 269-48.5 386.5T584 1235q-109 0-156-117.5T381 731z"/><glyph unicode="1" d="M846 0H537v846l3 139 5 152q-77-77-107-101L270 901l-149 186 471 375h254V0z"/><glyph unicode="2" d="M1104 0H82v215l367 371q163 167 213 231.5T734 937t22 114q0 88-48.5 131T578 1225q-85 0-165-39t-167-111L78 1274q108 92 179 130t155 58.5 188 20.5q137 0 242-50t163-140 58-206q0-101-35.5-189.5T917.5 716 655 451L467 274v-14h637V0z"/><glyph unicode="3" d="M1047 1135q0-137-83-233T731 770v-6q177-22 268-107.5t91-230.5q0-211-153-328.5T500-20Q262-20 78 59v263q85-43 187-70t202-27q153 0 226 52t73 167q0 103-84 146t-268 43H303v237h113q170 0 248.5 44.5T743 1067q0 166-208 166-72 0-146.5-24T223 1126L80 1339q200 144 477 144 227 0 358.5-92t131.5-256z"/><glyph unicode="4" d="M1137 303H961V0H659v303H35v215l641 944h285V543h176V303zM659 543v248q0 62 5 180t8 137h-8q-37-82-89-160L307 543h352z"/><glyph unicode="5" d="M614 934q212 0 337.5-119T1077 489q0-245-151-377T494-20q-244 0-394 79v267q79-42 184-68.5T483 231q283 0 283 232 0 221-293 221-53 0-117-10.5T252 651l-123 66 55 745h793v-262H455l-27-287 35 7q61 14 151 14z"/><glyph unicode="6" d="M72 621q0 434 183.5 646T805 1479q125 0 196-15v-247q-89 20-176 20-159 0-259.5-48T415 1047t-59-267h13q99 170 317 170 196 0 307-123t111-340q0-234-132-370.5T606-20q-162 0-282.5 75t-186 219T72 621zm528-394q99 0 152 66.5T805 483q0 107-49.5 168.5T606 713q-94 0-160.5-61T379 510q0-119 62.5-201T600 227z"/><glyph unicode="7" d="M227 0l549 1200H55v260h1049v-194L551 0H227z"/><glyph unicode="8" d="M586 1481q210 0 338.5-95.5T1053 1128q0-112-62-199.5T791 772q164-88 235.5-183.5T1098 379q0-180-141-289.5T586-20Q346-20 209 82T72 371q0 125 66.5 222T352 764q-125 79-180 169t-55 197q0 157 130 254t339 97zM358 389q0-86 60-134t164-48q115 0 172 49.5T811 387q0 67-56.5 125.5T571 637q-213-98-213-248zm226 866q-79 0-127.5-40.5T408 1106q0-60 38.5-107.5T586 901q98 46 137 94t39 111q0 69-50 109t-128 40z"/><glyph unicode="9" d="M1098 838q0-432-182-645T365-20Q235-20 168-6v248q84-21 176-21 155 0 255 45.5t153 143T813 678h-12q-58-94-134-132t-190-38q-191 0-301 122.5T66 971q0 235 133.5 371.5T563 1479q162 0 283.5-76t186.5-220.5 65-344.5zm-529 393q-96 0-150-66t-54-190q0-106 49-168t149-62q94 0 161 61.5T791 948q0 119-62.5 201T569 1231z"/><glyph unicode=":" horiz-adv-x="584" d="M117 143q0 84 45 127t131 43q83 0 128.5-44T467 143q0-79-46-124.5T293-27q-84 0-130 44.5T117 143zm0 826q0 84 45 127t131 43q83 0 128.5-44T467 969q0-81-46.5-125.5T293 799q-84 0-130 44t-46 126z"/><glyph unicode=";" horiz-adv-x="594" d="M444 238l15-23Q407 13 283-264H63Q128 2 164 238h280zM117 969q0 84 45 127t131 43q83 0 128.5-44T467 969q0-81-46.5-125.5T293 799q-84 0-130 44t-46 126z"/><glyph unicode="<" d="M1081 203L88 641v143l993 496v-240L397 723l684-281V203z"/><glyph unicode="=" d="M88 805v219h993V805H88zm0-387v219h993V418H88z"/><glyph unicode=">" d="M88 442l684 281-684 317v240l993-496V641L88 203v239z"/><glyph unicode="?" horiz-adv-x="977" d="M276 485v74q0 96 41 167t150 151q105 75 138.5 122t33.5 105q0 65-48 99t-134 34q-150 0-342-98L6 1358q223 125 473 125 206 0 327.5-99T928 1120q0-110-50-190T688 750q-96-71-121.5-108T541 545v-60H276zm-32-342q0 84 45 127t131 43q83 0 128.5-44T594 143q0-79-46-124.5T420-27q-84 0-130 44.5T244 143z"/><glyph unicode="@" horiz-adv-x="1837" d="M1735 752q0-144-46-263.5T1559 301t-195-68q-74 0-131 35.5t-82 93.5h-16q-108-129-275-129-177 0-279 106.5T479 631q0 211 134 340t350 129q86 0 189.5-16.5T1323 1044l-23-489q0-139 76-139 64 0 102 93.5t38 244.5q0 161-67 284.5T1260.5 1227 983 1292q-202 0-351-83T403.5 969.5 324 608q0-276 147.5-423.5T899 37q106 0 233 23.5t250 68.5V-63q-214-91-475-91-380 0-592.5 200T102 602q0 247 108.5 448.5t309 316T981 1481q220 0 393-90t267-256 94-383zM711 627q0-211 172-211 90 0 137 63.5t57 206.5l13 221q-51 11-115 11-125 0-194.5-78T711 627z"/><glyph unicode="A" horiz-adv-x="1413" d="M1079 0L973 348H440L334 0H0l516 1468h379L1413 0h-334zM899 608q-147 473-165.5 535t-26.5 98q-33-128-189-633h381z"/><glyph unicode="B" horiz-adv-x="1376" d="M184 1462h455q311 0 451.5-88.5T1231 1092q0-131-61.5-215T1006 776v-10q139-31 200.5-116t61.5-226q0-200-144.5-312T731 0H184v1462zm310-579h180q126 0 182.5 39t56.5 129q0 84-61.5 120.5T657 1208H494V883zm0-246V256h202q128 0 189 49t61 150q0 182-260 182H494z"/><glyph unicode="C" horiz-adv-x="1305" d="M805 1225q-175 0-271-131.5T438 727q0-489 367-489 154 0 373 77V55Q998-20 776-20q-319 0-488 193.5T119 729q0 228 83 399.5t238.5 263T805 1483q213 0 428-103l-100-252q-82 39-165 68t-163 29z"/><glyph unicode="D" horiz-adv-x="1516" d="M1397 745q0-361-205.5-553T598 0H184v1462h459q358 0 556-189t198-528zm-322-8q0 471-416 471H494V256h133q448 0 448 481z"/><glyph unicode="E" horiz-adv-x="1147" d="M1026 0H184v1462h842v-254H494V887h495V633H494V256h532V0z"/><glyph unicode="F" horiz-adv-x="1124" d="M489 0H184v1462h838v-254H489V831h496V578H489V0z"/><glyph unicode="G" horiz-adv-x="1483" d="M739 821h580V63q-141-46-265.5-64.5T799-20q-331 0-505.5 194.5T119 733q0 354 202.5 552T883 1483q225 0 434-90l-103-248q-160 80-333 80-201 0-322-135T438 727q0-238 97.5-363.5T819 238q97 0 197 20v305H739v258z"/><glyph unicode="H" horiz-adv-x="1567" d="M1382 0h-309v631H494V0H184v1462h310V889h579v573h309V0z"/><glyph unicode="I" horiz-adv-x="678" d="M184 0v1462h310V0H184z"/><glyph unicode="J" horiz-adv-x="678" d="M31-430q-105 0-183 22v258q80-20 146-20 102 0 146 63.5T184 92v1370h310V94q0-256-117-390T31-430z"/><glyph unicode="K" horiz-adv-x="1360" d="M1360 0h-352L625 616l-131-94V0H184v1462h310V793l122 172 396 497h344L846 815z"/><glyph unicode="L" horiz-adv-x="1157" d="M184 0v1462h310V256h593V0H184z"/><glyph unicode="M" horiz-adv-x="1931" d="M803 0L451 1147h-9q19-350 19-467V0H184v1462h422L952 344h6l367 1118h422V0h-289v692q0 49 1.5 113t13.5 340h-9L1087 0H803z"/><glyph unicode="N" horiz-adv-x="1665" d="M1481 0h-394L451 1106h-9q19-293 19-418V0H184v1462h391l635-1095h7q-15 285-15 403v692h279V0z"/><glyph unicode="O" horiz-adv-x="1630" d="M1511 733q0-363-180-558T815-20 299 175 119 735t180.5 557.5T817 1485t515.5-194T1511 733zm-1067 0q0-245 93-369t278-124q371 0 371 493 0 494-369 494-185 0-279-124.5T444 733z"/><glyph unicode="P" horiz-adv-x="1286" d="M494 774h102q143 0 214 56.5T881 995q0 109-59.5 161T635 1208H494V774zm700 232q0-236-147.5-361T627 520H494V0H184v1462h467q266 0 404.5-114.5T1194 1006z"/><glyph unicode="Q" horiz-adv-x="1630" d="M1511 733q0-258-91.5-432.5T1151 45l352-393h-397L838-20h-23q-336 0-516 195T119 735t180.5 557.5T817 1485t515.5-194T1511 733zm-1067 0q0-245 93-369t278-124q371 0 371 493 0 494-369 494-185 0-279-124.5T444 733z"/><glyph unicode="R" horiz-adv-x="1352" d="M494 813h100q147 0 217 49t70 154q0 104-71.5 148T588 1208h-94V813zm0-252V0H184v1462h426q298 0 441-108.5t143-329.5q0-129-71-229.5T922 637q330-493 430-637h-344L659 561H494z"/><glyph unicode="S" horiz-adv-x="1128" d="M1047 406q0-198-142.5-312T508-20Q274-20 94 68v288q148-66 250.5-93T532 236q102 0 156.5 39T743 391q0 43-24 76.5T648.5 532 459 631q-134 63-201 121T151 887t-40 180q0 194 131.5 305T606 1483q114 0 217.5-27t216.5-76l-100-241q-117 48-193.5 67T596 1225q-88 0-135-41t-47-107q0-41 19-71.5t60.5-59T690 844q205-98 281-196.5t76-241.5z"/><glyph unicode="T" horiz-adv-x="1186" d="M748 0H438v1204H41v258h1104v-258H748V0z"/><glyph unicode="U" horiz-adv-x="1548" d="M1374 1462V516q0-162-72.5-284T1092 45 768-20q-282 0-438 144.5T174 520v942h309V567q0-169 68-248t225-79q152 0 220.5 79.5T1065 569v893h309z"/><glyph unicode="V" horiz-adv-x="1331" d="M1018 1462h313L834 0H496L0 1462h313l275-870q23-77 47.5-179.5T666 270q11 92 75 322z"/><glyph unicode="W" horiz-adv-x="1980" d="M1608 0h-353l-198 768q-11 41-37.5 169.5T989 1110q-6-54-30-173.5T922 766L725 0H373L0 1462h305l187-798q49-221 71-383 6 57 27.5 176.5T631 643l213 819h293l213-819q14-55 35-168t32-194q10 78 32 194.5t40 188.5l186 798h305z"/><glyph unicode="X" horiz-adv-x="1366" d="M1366 0h-354L672 553 332 0H0l485 754-454 708h342l315-526 309 526h334L872 737z"/><glyph unicode="Y" horiz-adv-x="1278" d="M639 860l305 602h334L793 569V0H485v559L0 1462h336z"/><glyph unicode="Z" horiz-adv-x="1186" d="M1137 0H49v201l701 1005H68v256h1050v-200L418 256h719V0z"/><glyph unicode="[" horiz-adv-x="678" d="M627-324H143v1786h484v-211H403V-113h224v-211z"/><glyph unicode="\" horiz-adv-x="846" d="M289 1462L834 0H557L12 1462h277z"/><glyph unicode="]" horiz-adv-x="678" d="M51-113h223v1364H51v211h484V-324H51v211z"/><glyph unicode="^" horiz-adv-x="1090" d="M8 520l438 950h144l495-950H846l-322 643-280-643H8z"/><glyph unicode="_" horiz-adv-x="842" d="M846-324H-4v140h850v-140z"/><glyph unicode="`" horiz-adv-x="1243" d="M707 1241q-63 44-185 142.5T332 1548v21h342q63-101 235-301v-27H707z"/><glyph unicode="a" horiz-adv-x="1237" d="M870 0l-59 152h-8Q726 55 644.5 17.5T432-20q-161 0-253.5 92T86 334q0 178 124.5 262.5T586 690l194 6v49q0 170-174 170-134 0-315-81l-101 206q193 101 428 101 225 0 345-98t120-298V0H870zm-90 518l-118-4q-133-4-198-48t-65-134q0-129 148-129 106 0 169.5 61T780 426v92z"/><glyph unicode="b" horiz-adv-x="1296" d="M782 1139q198 0 310-154.5T1204 561q0-277-115.5-429T774-20q-197 0-309 143h-21L393 0H160v1556h305v-362q0-69-12-221h12q107 166 317 166zm-98-244q-113 0-165-69.5T465 596v-33q0-180 53.5-258T688 227q94 0 149.5 86.5T893 565t-56 247.5T684 895z"/><glyph unicode="c" horiz-adv-x="1053" d="M614-20Q92-20 92 553q0 285 142 435.5T641 1139q194 0 348-76l-90-236q-72 29-134 47.5T641 893q-238 0-238-338 0-328 238-328 88 0 163 23.5T954 324V63Q880 16 804.5-2T614-20z"/><glyph unicode="d" horiz-adv-x="1296" d="M514-20q-197 0-309.5 153T92 557q0 275 114.5 428.5T522 1139q211 0 322-164h10q-23 125-23 223v358h306V0H903l-59 145h-13Q727-20 514-20zm107 243q117 0 171.5 68T852 522v33q0 180-55.5 258T616 891q-102 0-158.5-86.5T401 553t57-247.5T621 223z"/><glyph unicode="e" horiz-adv-x="1210" d="M623 922q-97 0-152-61.5T408 686h428q-2 113-59 174.5T623 922zm43-942q-270 0-422 149T92 551q0 281 140.5 434.5T621 1139q237 0 369-135t132-373V483H401q5-130 77-203t202-73q101 0 191 21t188 67V59Q979 19 888-.5T666-20z"/><glyph unicode="f" horiz-adv-x="793" d="M778 889H514V0H209v889H41v147l168 82v82q0 191 94 279t301 88q158 0 281-47l-78-224q-92 29-170 29-65 0-94-38.5t-29-98.5v-70h264V889z"/><glyph unicode="g" horiz-adv-x="1157" d="M1133 1118V963l-175-45q48-75 48-168 0-180-125.5-280.5T532 369l-55 3-45 5q-47-36-47-80 0-66 168-66h190q184 0 280.5-79T1120-80q0-196-163.5-304T487-492q-234 0-357.5 81.5T6-182Q6-81 69-13t185 97q-47 20-82 65.5T137 246q0 64 37 106.5T281 436q-88 38-139.5 122T90 756q0 183 119 283t340 100q47 0 111.5-8.5T743 1118h390zM270-158q0-63 60.5-99T500-293q164 0 257 45t93 123q0 63-55 87T625-14H467q-84 0-140.5-39.5T270-158zm111 910q0-91 41.5-144T549 555q86 0 126 53t40 144q0 202-166 202-168 0-168-202z"/><glyph unicode="h" horiz-adv-x="1346" d="M1192 0H887v653q0 242-180 242-128 0-185-87t-57-282V0H160v1556h305v-317q0-37-7-174l-7-90h16q102 164 324 164 197 0 299-106t102-304V0z"/><glyph unicode="i" horiz-adv-x="625" d="M147 1407q0 149 166 149t166-149q0-71-41.5-110.5T313 1257q-166 0-166 150zM465 0H160v1118h305V0z"/><glyph unicode="j" horiz-adv-x="625" d="M70-492q-117 0-201 25v240q70-19 143-19 77 0 112.5 43T160-76v1194h305V-121q0-178-103-274.5T70-492zm77 1899q0 149 166 149t166-149q0-71-41.5-110.5T313 1257q-166 0-166 150z"/><glyph unicode="k" horiz-adv-x="1270" d="M453 608l133 170 313 340h344L799 633 1270 0H918L596 453 465 348V0H160v1556h305V862l-16-254h4z"/><glyph unicode="l" horiz-adv-x="625" d="M465 0H160v1556h305V0z"/><glyph unicode="m" horiz-adv-x="2011" d="M1161 0H856v653q0 121-40.5 181.5T688 895q-117 0-170-86t-53-283V0H160v1118h233l41-143h17q45 77 130 120.5t195 43.5q251 0 340-164h27q45 78 132.5 121t197.5 43q190 0 287.5-97.5T1858 729V0h-306v653q0 121-40.5 181.5T1384 895q-112 0-167.5-80T1161 561V0z"/><glyph unicode="n" horiz-adv-x="1346" d="M1192 0H887v653q0 121-43 181.5T707 895q-128 0-185-85.5T465 526V0H160v1118h233l41-143h17q51 81 140.5 122.5T795 1139q195 0 296-105.5T1192 729V0z"/><glyph unicode="o" horiz-adv-x="1268" d="M403 561q0-166 54.5-251T635 225q122 0 175.5 84.5T864 561q0 166-54 249t-177 83q-122 0-176-82.5T403 561zm773 0q0-273-144-427T631-20q-161 0-284 70.5T158 253 92 561q0 274 143 426t402 152q161 0 284-70t189-201 66-307z"/><glyph unicode="p" horiz-adv-x="1296" d="M774-20q-197 0-309 143h-16q16-140 16-162v-453H160v1610h248l43-145h14q107 166 317 166 198 0 310-153t112-425q0-179-52.5-311T1002 49 774-20zm-90 915q-113 0-165-69.5T465 596v-33q0-180 53.5-258T688 227q205 0 205 338 0 165-50.5 247.5T684 895z"/><glyph unicode="q" horiz-adv-x="1296" d="M623 219q116 0 170 66.5T852 518v37q0 180-55.5 258T618 891q-215 0-215-338 0-168 53.5-251T623 219zM514-20q-198 0-310 152.5T92 557q0 274 114.5 428T520 1139q106 0 185-40t139-124h8l27 143h258V-492H831v469q0 61 13 168h-13Q782 64 701 22T514-20z"/><glyph unicode="r" horiz-adv-x="930" d="M784 1139q62 0 103-9l-23-286q-37 10-90 10-146 0-227.5-75T465 569V0H160v1118h231l45-188h15q52 94 140.5 151.5T784 1139z"/><glyph unicode="s" horiz-adv-x="1018" d="M940 332q0-172-119.5-262T463-20Q341-20 255-3.5T94 45v252q85-40 191.5-67T473 203q166 0 166 96 0 36-22 58.5t-76 51T397 475q-129 54-189.5 100t-88 105.5T92 827q0 149 115.5 230.5T535 1139q202 0 393-88l-92-220q-84 36-157 59t-149 23q-135 0-135-73 0-41 43.5-71T629 680q131-53 192-99t90-106 29-143z"/><glyph unicode="t" horiz-adv-x="889" d="M631 223q80 0 192 35V31Q709-20 543-20q-183 0-266.5 92.5T193 350v539H47v129l168 102 88 236h195v-238h313V889H498V350q0-65 36.5-96t96.5-31z"/><glyph unicode="u" horiz-adv-x="1346" d="M952 0l-41 143h-16Q846 65 756 22.5T551-20Q354-20 254 85.5T154 389v729h305V465q0-121 43-181.5T639 223q128 0 185 85.5T881 592v526h305V0H952z"/><glyph unicode="v" horiz-adv-x="1165" d="M426 0L0 1118h319l216-637q36-121 45-229h6q5 96 45 229l215 637h319L739 0H426z"/><glyph unicode="w" horiz-adv-x="1753" d="M1079 0l-86 391-116 494h-7L666 0H338L20 1118h304l129-495q31-133 63-367h6q4 76 35 241l16 85 138 536h336l131-536q4-22 12.5-65t16.5-91.5 14.5-95 7.5-74.5h6q9 72 32 197.5t33 169.5l134 495h299L1411 0h-332z"/><glyph unicode="x" horiz-adv-x="1184" d="M389 571L29 1118h346l217-356 219 356h346L793 571 1174 0H827L592 383 356 0H10z"/><glyph unicode="y" horiz-adv-x="1165" d="M0 1118h334l211-629q27-82 37-194h6q11 103 43 194l207 629h327L692-143q-65-175-185.5-262T225-492q-79 0-155 17v242q55-13 120-13 81 0 141.5 49.5T426-47l18 55z"/><glyph unicode="z" horiz-adv-x="999" d="M938 0H55v180l518 705H86v233h834V920L416 233h522V0z"/><glyph unicode="{" horiz-adv-x="807" d="M287 270q0 87-65.5 133T31 449v239q126 0 191 44t65 126v326q0 153 97 215.5t341 62.5v-225q-99-3-136.5-38T551 1096V797q-6-188-234-222v-12q234-35 234-212V43q0-68 37-103t137-38v-226q-244 0-341 62.5T287-45v315z"/><glyph unicode="|" horiz-adv-x="1128" d="M455 1550h219V-465H455v2015z"/><glyph unicode="}" horiz-adv-x="807" d="M520-45q0-112-41-169t-135.5-83.5T82-324v226q99 2 136.5 36T256 43v310q0 86 59 139.5T489 563v12q-227 34-233 222v299q0 70-37 104t-137 37v225q167 0 262-26.5t135.5-84T520 1184V856q0-84 61.5-126T776 688V449q-125 0-190.5-41T520 270V-45z"/><glyph unicode="~" d="M322 672q-55 0-117.5-33.5T88 551v231q103 109 256 109 73 0 137.5-16T621 827q129-55 227-55 53 0 116 32t117 89V662Q980 553 825 553q-66 0-126 13t-150 50q-131 56-227 56z"/><glyph unicode="¡" horiz-adv-x="586" d="M168 606h244l51-975H117zm299 342q0-84-45-127t-131-43q-83 0-128.5 44T117 948q0 81 46.5 125.5T291 1118q84 0 130-44t46-126z"/><glyph unicode="¢" d="M563 176q-420 59-420 565 0 261 104.5 403T563 1317v166h178v-158q166-9 299-74l-90-235q-72 29-134 47t-124 18q-121 0-179-83.5T455 743q0-327 237-327 82 0 148 15.5t166 60.5V238q-127-61-265-70V-20H563v196z"/><glyph unicode="£" d="M700 1483q195 0 390-82l-93-230q-157 64-272 64-78 0-120-44.5T563 1063V870h375V651H563V508q0-170-151-248h718V0H82v248q103 44 141.5 101T262 506v145H84v219h178v195q0 201 114.5 309.5T700 1483z"/><glyph unicode="¤" d="M188 723q0 102 54 197l-129 127 147 147 127-127q91 53 197 53 105 0 196-55l127 129 150-143-129-129q53-89 53-199 0-107-53-199l125-125-146-145-127 125q-95-51-196-51-115 0-199 51L260 256 115 401l127 125q-54 93-54 197zm207 0q0-77 54.5-132.5T584 535q81 0 136.5 55T776 723q0 80-56.5 135T584 913q-78 0-133.5-56T395 723z"/><glyph unicode="¥" d="M584 860l264 602h313L778 715h195V537H727V399h246V221H727V0H440v221H193v178h247v138H193v178h190L6 1462h316z"/><glyph unicode="¦" horiz-adv-x="1128" d="M455 1550h219V735H455v815zm0-1200h219v-815H455v815z"/><glyph unicode="§" horiz-adv-x="995" d="M121 805q0 79 36 144.5t97 105.5q-133 84-133 233 0 131 111.5 210t293.5 79q170 0 363-84l-82-190q-68 32-138.5 57.5T520 1386q-81 0-118-23t-37-71q0-49 49.5-86t163.5-82q163-64 240-148.5T895 782q0-177-125-260 62-40 93.5-92.5T895 303q0-148-119.5-235.5T455-20q-203 0-349 79v207q81-41 180-69.5T455 168q194 0 194 117 0 39-18.5 63T567 397.5 442 457q-183 74-252 152.5T121 805zm223 22q0-67 65-119t181-98q78 57 78 146 0 68-50.5 115T434 967q-37-14-63.5-53.5T344 827z"/><glyph unicode="¨" horiz-adv-x="1243" d="M279 1405q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T418 1272q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T823 1540q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T682 1405z"/><glyph unicode="©" horiz-adv-x="1704" d="M895 1010q-97 0-150-74t-53-205q0-280 203-280 57 0 123 15t123 44V319q-120-57-252-57-204 0-316 125T461 733q0 220 110.5 342.5T881 1198q149 0 305-78l-74-168q-113 58-217 58zM100 731q0 200 100 375t275 276 377 101q200 0 375-100t276-275 101-377q0-197-97-370T1235 84 852-20Q645-20 470 83.5T197.5 360 100 731zm142 0q0-164 82-305.5t224-223T852 121q164 0 305.5 82t223 224 81.5 304q0 164-82 305.5t-224 223-304 81.5q-164 0-305.5-82t-223-224T242 731z"/><glyph unicode="ª" horiz-adv-x="784" d="M561 764l-31 110q-43-58-105-90t-136-32q-117 0-179.5 58.5T47 975q0 109 82.5 163.5T397 1202l99 4q0 117-127 117-81 0-217-61l-66 135q66 32 145.5 57t178.5 25q137 0 211.5-71t74.5-202V764H561zM252 977q0-38 23-56t55-18q77 0 121.5 41.5T496 1051v36l-99-6q-145-10-145-104z"/><glyph unicode="«" horiz-adv-x="1260" d="M82 573l371 455 219-119-279-348 279-348L453 94 82 547v26zm506 0l370 455 220-119-279-348 279-348L958 94 588 547v26z"/><glyph unicode="¬" d="M1081 248H862v364H88v219h993V248z"/><glyph unicode="­" horiz-adv-x="659" d="M61 424zm0 0v250h537V424H61z"/><glyph unicode="®" horiz-adv-x="1704" d="M1157 905q0-170-143-233l237-400H997L819 610h-47V272H543v916h264q181 0 265.5-70t84.5-213zM772 778h31q66 0 94.5 28.5T926 901q0 65-28 92t-97 27h-29V778zm-672-47q0 200 100 375t275 276 377 101q200 0 375-100t276-275 101-377q0-197-97-370T1235 84 852-20Q645-20 470 83.5T197.5 360 100 731zm142 0q0-164 82-305.5t224-223T852 121q164 0 305.5 82t223 224 81.5 304q0 164-82 305.5t-224 223-304 81.5q-164 0-305.5-82t-223-224T242 731z"/><glyph unicode="¯" horiz-adv-x="1024" d="M1030 1556H-6v201h1036v-201z"/><glyph unicode="°" horiz-adv-x="877" d="M92 1137q0 92 46 172t126 127 174 47q92 0 172.5-46t127-127 46.5-173q0-93-46.5-173.5T611 838t-173-45q-145 0-245.5 99.5T92 1137zm191 0q0-64 44.5-109T438 983t111 46 45 108q0 63-45.5 110T438 1294q-64 0-109.5-46T283 1137z"/><glyph unicode="±" d="M475 674H88v219h387v389h219V893h387V674H694V289H475v385zM88 0v219h993V0H88z"/><glyph unicode="²" horiz-adv-x="776" d="M702 586H55v168l224 219q102 100 130.5 144.5T438 1212q0 38-24 58t-64 20q-81 0-180-88L47 1354q147 129 336 129 137 0 216-66.5t79-183.5q0-85-47-160T455 881l-105-95h352V586z"/><glyph unicode="³" horiz-adv-x="776" d="M666 1249q0-143-170-198v-13q94-20 146-75t52-134q0-121-88-190.5T332 569q-143 0-273 70v190q148-90 271-90 143 0 143 107 0 53-44 79.5T307 952H195v160h92q83 0 123.5 26t40.5 83q0 38-25 63t-76 25q-47 0-89-19t-99-59L61 1372q62 47 137.5 78t178.5 31q127 0 208-64t81-168z"/><glyph unicode="´" horiz-adv-x="1243" d="M332 1241v27q172 200 235 301h342v-21q-52-52-177.5-154.5T535 1241H332z"/><glyph unicode="µ" horiz-adv-x="1352" d="M465 465q0-121 44-181.5T647 223q126 0 183 86.5T887 592v526h305V0H961l-43 150h-15Q861 65 801 22.5T653-20q-62 0-114 23t-84 67l5-85 5-157v-320H160v1610h305V465z"/><glyph unicode="¶" horiz-adv-x="1341" d="M1167-260h-161v1616H840V-260H678v819q-62-18-146-18-216 0-317.5 125T113 1042q0 260 109 387t341 127h604V-260z"/><glyph unicode="·" horiz-adv-x="584" d="M117 723q0 84 45 127t131 43q83 0 128.5-44T467 723q0-81-46.5-125.5T293 553q-84 0-130 44t-46 126z"/><glyph unicode="¸" horiz-adv-x="420" d="M418-250q0-128-75.5-185T109-492q-78 0-146 21v168q27-7 72.5-14t70.5-7q72 0 72 62 0 83-166 108L90 0h193l-27-61q74-24 118-74.5T418-250z"/><glyph unicode="¹" horiz-adv-x="776" d="M584 586H346v446l3 112 5 95q-27-36-75-78l-78-61-109 127 301 235h191V586z"/><glyph unicode="º" horiz-adv-x="795" d="M737 1116q0-171-91.5-267.5T395 752q-153 0-245.5 98.5T57 1116q0 169 89.5 266t252.5 97q152 0 245-98.5t93-264.5zm-477 0q0-100 32.5-150.5T397 915t103.5 50.5T532 1116t-31.5 149.5T397 1315t-104.5-49.5T260 1116z"/><glyph unicode="»" horiz-adv-x="1260" d="M1178 547L807 94 588 213l278 348-278 348 219 119 371-455v-26zm-506 0L301 94 82 213l278 348L82 909l219 119 371-455v-26z"/><glyph unicode="¼" horiz-adv-x="1804" d="M46 0zm492 586H300v446l3 112 5 95q-27-36-75-78l-78-61-109 127 301 235h191V586zm832 876L559 0H320l811 1462h239zm312-1310h-125V1h-238v151H936v154l385 577h236V320h125V152zm-363 168v164q0 86 6 184-9-26-35.5-80t-41.5-77l-127-191h198z"/><glyph unicode="½" horiz-adv-x="1804" d="M46 0zm492 586H300v446l3 112 5 95q-27-36-75-78l-78-61-109 127 301 235h191V586zm832 876L559 0H320l811 1462h239zM1716 1h-647v168l224 219q102 100 130.5 144.5T1452 627q0 38-24 58t-64 20q-81 0-180-88l-123 152q147 129 336 129 137 0 216-66.5t79-183.5q0-85-47-160t-176-192l-105-95h352V1z"/><glyph unicode="¾" horiz-adv-x="1804" d="M90 0zm607 1249q0-143-170-198v-13q94-20 146-75t52-134q0-121-88-190.5T363 569q-143 0-273 70v190q148-90 271-90 143 0 143 107 0 53-44 79.5T338 952H226v160h92q83 0 123.5 26t40.5 83q0 38-25 63t-76 25q-47 0-89-19t-99-59L92 1372q62 47 137.5 78t178.5 31q127 0 208-64t81-168zm744 213L630 0H391l811 1462h239zm271-1310h-125V1h-238v151H966v154l385 577h236V320h125V152zm-363 168v164q0 86 6 184-9-26-35.5-80t-41.5-77l-127-191h198z"/><glyph unicode="¿" horiz-adv-x="977" d="M713 606v-74q0-98-44.5-169T516 215Q407 137 378.5 93T350-14q0-57 43.5-94T526-145q79 0 169 29t186 71l102-221q-98-56-221.5-90.5T532-391q-220 0-345.5 96.5T61-29q0 108 48.5 187T301 342q95 70 121.5 107t26.5 98v59h264zm32 342q0-84-45-127t-131-43q-83 0-128.5 44T395 948q0 81 46.5 125.5T569 1118q84 0 130-44t46-126z"/><glyph unicode="À" horiz-adv-x="1413" d="M0 0zm1079 0L973 348H440L334 0H0l516 1468h379L1413 0h-334zM899 608q-147 473-165.5 535t-26.5 98q-33-128-189-633h381zm-186 971q-63 44-185 142.5T338 1886v21h342q63-101 235-301v-27H713z"/><glyph unicode="Á" horiz-adv-x="1413" d="M0 0zm1079 0L973 348H440L334 0H0l516 1468h379L1413 0h-334zM899 608q-147 473-165.5 535t-26.5 98q-33-128-189-633h381zm-358 971v27q172 200 235 301h342v-21q-52-52-177.5-154.5T744 1579H541z"/><glyph unicode="Â" horiz-adv-x="1413" d="M0 0zm1079 0L973 348H440L334 0H0l516 1468h379L1413 0h-334zM899 608q-147 473-165.5 535t-26.5 98q-33-128-189-633h381zm39 971q-157 93-234 176-78-81-229-176H272v27q189 189 256 301h357q31-52 107.5-141.5T1141 1606v-27H938z"/><glyph unicode="Ã" horiz-adv-x="1413" d="M0 0zm1079 0L973 348H440L334 0H0l516 1468h379L1413 0h-334zM899 608q-147 473-165.5 535t-26.5 98q-33-128-189-633h381zM543 1684q-31 0-59.5-26.5T442 1577H293q11 145 82.5 227t189.5 82q41 0 80.5-16.5t78-36T799 1798t73-16q31 0 59.5 26t41.5 80h149q-11-145-83.5-227T850 1579q-41 0-80.5 16.5t-78 36-75.5 36-73 16.5z"/><glyph unicode="Ä" horiz-adv-x="1413" d="M0 0zm1079 0L973 348H440L334 0H0l516 1468h379L1413 0h-334zM899 608q-147 473-165.5 535t-26.5 98q-33-128-189-633h381zM365 1743q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T504 1610q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T909 1878q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T768 1743z"/><glyph unicode="Å" horiz-adv-x="1413" d="M0 0zm1079 0L973 348H440L334 0H0l516 1468h379L1413 0h-334zM899 608q-147 473-165.5 535t-26.5 98q-33-128-189-633h381zm60 959q0-108-71-174t-183-66-180 64-68 174q0 108 67.5 172.5T705 1802q110 0 182-66t72-169zm-158-2q0 45-27 70.5t-69 25.5-69-25.5-27-70.5 24-71 72-26q42 0 69 26t27 71z"/><glyph unicode="Æ" horiz-adv-x="1950" d="M1829 0H956v348H465L315 0H0l655 1462h1174v-254h-563V887h526V633h-526V256h563V0zM578 608h378v590H829z"/><glyph unicode="Ç" horiz-adv-x="1305" d="M119 0zm686 1225q-175 0-271-131.5T438 727q0-489 367-489 154 0 373 77V55Q998-20 776-20q-319 0-488 193.5T119 729q0 228 83 399.5t238.5 263T805 1483q213 0 428-103l-100-252q-82 39-165 68t-163 29zM959-250q0-128-75.5-185T650-492q-78 0-146 21v168q27-7 72.5-14t70.5-7q72 0 72 62 0 83-166 108L631 0h193l-27-61q74-24 118-74.5T959-250z"/><glyph unicode="È" horiz-adv-x="1147" d="M184 0zm842 0H184v1462h842v-254H494V887h495V633H494V256h532V0zM634 1579q-63 44-185 142.5T259 1886v21h342q63-101 235-301v-27H634z"/><glyph unicode="É" horiz-adv-x="1147" d="M184 0zm842 0H184v1462h842v-254H494V887h495V633H494V256h532V0zM424 1579v27q172 200 235 301h342v-21q-52-52-177.5-154.5T627 1579H424z"/><glyph unicode="Ê" horiz-adv-x="1147" d="M175 0zm851 0H184v1462h842v-254H494V887h495V633H494V256h532V0zM841 1579q-157 93-234 176-78-81-229-176H175v27q189 189 256 301h357q31-52 107.5-141.5T1044 1606v-27H841z"/><glyph unicode="Ë" horiz-adv-x="1147" d="M184 0zm842 0H184v1462h842v-254H494V887h495V633H494V256h532V0zM272 1743q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T411 1610q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T816 1878q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T675 1743z"/><glyph unicode="Ì" horiz-adv-x="678" d="M0 0zm184 0v1462h310V0H184zm133 1579q-63 44-185 142.5T-58 1886v21h342q63-101 235-301v-27H317z"/><glyph unicode="Í" horiz-adv-x="678" d="M167 0zm17 0v1462h310V0H184zm-17 1579v27q172 200 235 301h342v-21q-52-52-177.5-154.5T370 1579H167z"/><glyph unicode="Î" horiz-adv-x="678" d="M0 0zm184 0v1462h310V0H184zm386 1579q-157 93-234 176-78-81-229-176H-96v27q189 189 256 301h357q31-52 107.5-141.5T773 1606v-27H570z"/><glyph unicode="Ï" horiz-adv-x="678" d="M0 0zm184 0v1462h310V0H184zM-3 1743q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T136 1610q-64 0-101.5 35T-3 1743zm403 0q0 70 40.5 102.5T541 1878q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T400 1743z"/><glyph unicode="Ð" horiz-adv-x="1516" d="M47 850h137v612h459q358 0 556-189t198-528q0-361-205.5-553T598 0H184v596H47v254zm1028-113q0 232-104 351.5T657 1208H494V850h237V596H494V256h131q450 0 450 481z"/><glyph unicode="Ñ" horiz-adv-x="1665" d="M184 0zm1297 0h-394L451 1106h-9q19-293 19-418V0H184v1462h391l635-1095h7q-15 285-15 403v692h279V0zM668 1684q-31 0-59.5-26.5T567 1577H418q11 145 82.5 227t189.5 82q41 0 80.5-16.5t78-36T924 1798t73-16q31 0 59.5 26t41.5 80h149q-11-145-83.5-227T975 1579q-41 0-80.5 16.5t-78 36-75.5 36-73 16.5z"/><glyph unicode="Ò" horiz-adv-x="1630" d="M119 0zm1392 733q0-363-180-558T815-20 299 175 119 735t180.5 557.5T817 1485t515.5-194T1511 733zm-1067 0q0-245 93-369t278-124q371 0 371 493 0 494-369 494-185 0-279-124.5T444 733zm380 846q-63 44-185 142.5T449 1886v21h342q63-101 235-301v-27H824z"/><glyph unicode="Ó" horiz-adv-x="1630" d="M119 0zm1392 733q0-363-180-558T815-20 299 175 119 735t180.5 557.5T817 1485t515.5-194T1511 733zm-1067 0q0-245 93-369t278-124q371 0 371 493 0 494-369 494-185 0-279-124.5T444 733zm214 846v27q172 200 235 301h342v-21q-52-52-177.5-154.5T861 1579H658z"/><glyph unicode="Ô" horiz-adv-x="1630" d="M119 0zm1392 733q0-363-180-558T815-20 299 175 119 735t180.5 557.5T817 1485t515.5-194T1511 733zm-1067 0q0-245 93-369t278-124q371 0 371 493 0 494-369 494-185 0-279-124.5T444 733zm603 846q-157 93-234 176-78-81-229-176H381v27q189 189 256 301h357q31-52 107.5-141.5T1250 1606v-27h-203z"/><glyph unicode="Õ" horiz-adv-x="1630" d="M119 0zm1392 733q0-363-180-558T815-20 299 175 119 735t180.5 557.5T817 1485t515.5-194T1511 733zm-1067 0q0-245 93-369t278-124q371 0 371 493 0 494-369 494-185 0-279-124.5T444 733zm208 951q-31 0-59.5-26.5T551 1577H402q11 145 82.5 227t189.5 82q41 0 80.5-16.5t78-36T908 1798t73-16q31 0 59.5 26t41.5 80h149q-11-145-83.5-227T959 1579q-41 0-80.5 16.5t-78 36-75.5 36-73 16.5z"/><glyph unicode="Ö" horiz-adv-x="1630" d="M119 0zm1392 733q0-363-180-558T815-20 299 175 119 735t180.5 557.5T817 1485t515.5-194T1511 733zm-1067 0q0-245 93-369t278-124q371 0 371 493 0 494-369 494-185 0-279-124.5T444 733zm30 1010q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T613 1610q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T1018 1878q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T877 1743z"/><glyph unicode="×" d="M428 723l-299 301 152 154 301-299 305 299 153-150-305-305 301-303-149-152-305 301-301-299-150 152z"/><glyph unicode="Ø" horiz-adv-x="1630" d="M1511 733q0-363-180-558T815-20q-197 0-336 65L389-90 227 18l90 136Q119 348 119 735q0 365 180.5 557.5T817 1485q198 0 344-70l84 125 160-104-88-131q194-194 194-572zm-1067 0q0-191 56-307l506 756q-84 45-189 45-185 0-279-124.5T444 733zm742 0q0 180-51 297L635 279q76-39 180-39 371 0 371 493z"/><glyph unicode="Ù" horiz-adv-x="1548" d="M174 0zm1200 1462V516q0-162-72.5-284T1092 45 768-20q-282 0-438 144.5T174 520v942h309V567q0-169 68-248t225-79q152 0 220.5 79.5T1065 569v893h309zm-624 117q-63 44-185 142.5T375 1886v21h342q63-101 235-301v-27H750z"/><glyph unicode="Ú" horiz-adv-x="1548" d="M174 0zm1200 1462V516q0-162-72.5-284T1092 45 768-20q-282 0-438 144.5T174 520v942h309V567q0-169 68-248t225-79q152 0 220.5 79.5T1065 569v893h309zm-772 117v27q172 200 235 301h342v-21q-52-52-177.5-154.5T805 1579H602z"/><glyph unicode="Û" horiz-adv-x="1548" d="M174 0zm1200 1462V516q0-162-72.5-284T1092 45 768-20q-282 0-438 144.5T174 520v942h309V567q0-169 68-248t225-79q152 0 220.5 79.5T1065 569v893h309zm-368 117q-157 93-234 176-78-81-229-176H340v27q189 189 256 301h357q31-52 107.5-141.5T1209 1606v-27h-203z"/><glyph unicode="Ü" horiz-adv-x="1548" d="M174 0zm1200 1462V516q0-162-72.5-284T1092 45 768-20q-282 0-438 144.5T174 520v942h309V567q0-169 68-248t225-79q152 0 220.5 79.5T1065 569v893h309zm-941 281q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T572 1610q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T977 1878q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T836 1743z"/><glyph unicode="Ý" horiz-adv-x="1278" d="M0 0zm639 860l305 602h334L793 569V0H485v559L0 1462h336zm-178 719v27q172 200 235 301h342v-21q-52-52-177.5-154.5T664 1579H461z"/><glyph unicode="Þ" horiz-adv-x="1286" d="M1194 770q0-229-142.5-353T647 293H494V0H184v1462h310v-229h178q254 0 388-119t134-344zM494 543h100q145 0 216 52.5T881 770q0 107-63.5 159T618 981H494V543z"/><glyph unicode="ß" horiz-adv-x="1456" d="M1249 1241q0-64-21-112.5t-53-86.5-69-67-69-53-53-45-21-43q0-27 26.5-53t92.5-66q146-91 198.5-140t78-110 25.5-139q0-172-116.5-259T924-20q-99 0-171 14.5T621 43v242q53-36 135.5-61T903 199q168 0 168 123 0 41-16 66.5T998 444t-115 72q-126 72-175 131.5T659 788q0 64 35 117t105 102q77 55 108 95t31 86q0 60-63.5 100.5T711 1329q-116 0-181-52.5T465 1128V0H160v1139q0 201 146.5 314.5T711 1567q244 0 391-88.5t147-237.5z"/><glyph unicode="à" horiz-adv-x="1237" d="M86 0zm784 0l-59 152h-8Q726 55 644.5 17.5T432-20q-161 0-253.5 92T86 334q0 178 124.5 262.5T586 690l194 6v49q0 170-174 170-134 0-315-81l-101 206q193 101 428 101 225 0 345-98t120-298V0H870zm-90 518l-118-4q-133-4-198-48t-65-134q0-129 148-129 106 0 169.5 61T780 426v92zm-166 723q-63 44-185 142.5T239 1548v21h342q63-101 235-301v-27H614z"/><glyph unicode="á" horiz-adv-x="1237" d="M86 0zm784 0l-59 152h-8Q726 55 644.5 17.5T432-20q-161 0-253.5 92T86 334q0 178 124.5 262.5T586 690l194 6v49q0 170-174 170-134 0-315-81l-101 206q193 101 428 101 225 0 345-98t120-298V0H870zm-90 518l-118-4q-133-4-198-48t-65-134q0-129 148-129 106 0 169.5 61T780 426v92zm-339 723v27q172 200 235 301h342v-21q-52-52-177.5-154.5T644 1241H441z"/><glyph unicode="â" horiz-adv-x="1237" d="M86 0zm784 0l-59 152h-8Q726 55 644.5 17.5T432-20q-161 0-253.5 92T86 334q0 178 124.5 262.5T586 690l194 6v49q0 170-174 170-134 0-315-81l-101 206q193 101 428 101 225 0 345-98t120-298V0H870zm-90 518l-118-4q-133-4-198-48t-65-134q0-129 148-129 106 0 169.5 61T780 426v92zm63 722q-157 93-234 176-78-81-229-176H177v27q189 189 256 301h357q31-52 107.5-141.5T1046 1267v-27H843z"/><glyph unicode="ã" horiz-adv-x="1237" d="M86 0zm784 0l-59 152h-8Q726 55 644.5 17.5T432-20q-161 0-253.5 92T86 334q0 178 124.5 262.5T586 690l194 6v49q0 170-174 170-134 0-315-81l-101 206q193 101 428 101 225 0 345-98t120-298V0H870zm-90 518l-118-4q-133-4-198-48t-65-134q0-129 148-129 106 0 169.5 61T780 426v92zm-313 828q-31 0-59.5-26.5T366 1239H217q11 145 82.5 227t189.5 82q41 0 80.5-16.5t78-36T723 1460t73-16q31 0 59.5 26t41.5 80h149q-11-145-83.5-227T774 1241q-41 0-80.5 16.5t-78 36-75.5 36-73 16.5z"/><glyph unicode="ä" horiz-adv-x="1237" d="M86 0zm784 0l-59 152h-8Q726 55 644.5 17.5T432-20q-161 0-253.5 92T86 334q0 178 124.5 262.5T586 690l194 6v49q0 170-174 170-134 0-315-81l-101 206q193 101 428 101 225 0 345-98t120-298V0H870zm-90 518l-118-4q-133-4-198-48t-65-134q0-129 148-129 106 0 169.5 61T780 426v92zm-495 887q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T424 1272q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T829 1540q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T688 1405z"/><glyph unicode="å" horiz-adv-x="1237" d="M86 0zm784 0l-59 152h-8Q726 55 644.5 17.5T432-20q-161 0-253.5 92T86 334q0 178 124.5 262.5T586 690l194 6v49q0 170-174 170-134 0-315-81l-101 206q193 101 428 101 225 0 345-98t120-298V0H870zm-90 518l-118-4q-133-4-198-48t-65-134q0-129 148-129 106 0 169.5 61T780 426v92zm103 961q0-108-71-174t-183-66-180 64-68 174q0 108 67.5 172.5T629 1714q110 0 182-66t72-169zm-158-2q0 45-27 70.5t-69 25.5-69-25.5-27-70.5 24-71 72-26q42 0 69 26t27 71z"/><glyph unicode="æ" horiz-adv-x="1878" d="M1329-20q-137 0-249.5 50.5T895 186Q797 69 698.5 24.5T442-20q-161 0-258.5 94.5T86 334q0 178 121 262.5T569 690l191 6v84q0 69-44.5 102T594 915q-140 0-305-77l-99 202q189 101 422 101 227 0 342-131 66 64 152.5 96.5T1313 1139q221 0 349-137.5T1790 631V483h-723q5-130 77-203t202-73q196 0 380 88V59q-79-39-171-59t-226-20zM760 518l-113-4q-124-4-186-47.5T399 332q0-129 140-129 101 0 161 61t60 162v92zm547 404q-217 0-234-236h430q-2 112-55 174t-141 62z"/><glyph unicode="ç" horiz-adv-x="1053" d="M92 0zm522-20Q92-20 92 553q0 285 142 435.5T641 1139q194 0 348-76l-90-236q-72 29-134 47.5T641 893q-238 0-238-338 0-328 238-328 88 0 163 23.5T954 324V63Q880 16 804.5-2T614-20zm191-230q0-128-75.5-185T496-492q-78 0-146 21v168q27-7 72.5-14t70.5-7q72 0 72 62 0 83-166 108L477 0h193l-27-61q74-24 118-74.5T805-250z"/><glyph unicode="è" horiz-adv-x="1210" d="M92 0zm531 922q-97 0-152-61.5T408 686h428q-2 113-59 174.5T623 922zm43-942q-270 0-422 149T92 551q0 281 140.5 434.5T621 1139q237 0 369-135t132-373V483H401q5-130 77-203t202-73q101 0 191 21t188 67V59Q979 19 888-.5T666-20zm-46 1261q-63 44-185 142.5T245 1548v21h342q63-101 235-301v-27H620z"/><glyph unicode="é" horiz-adv-x="1210" d="M92 0zm531 922q-97 0-152-61.5T408 686h428q-2 113-59 174.5T623 922zm43-942q-270 0-422 149T92 551q0 281 140.5 434.5T621 1139q237 0 369-135t132-373V483H401q5-130 77-203t202-73q101 0 191 21t188 67V59Q979 19 888-.5T666-20zM447 1241v27q172 200 235 301h342v-21q-52-52-177.5-154.5T650 1241H447z"/><glyph unicode="ê" horiz-adv-x="1210" d="M92 0zm531 922q-97 0-152-61.5T408 686h428q-2 113-59 174.5T623 922zm43-942q-270 0-422 149T92 551q0 281 140.5 434.5T621 1139q237 0 369-135t132-373V483H401q5-130 77-203t202-73q101 0 191 21t188 67V59Q979 19 888-.5T666-20zm194 1261q-157 93-234 176-78-81-229-176H194v27q189 189 256 301h357q31-52 107.5-141.5T1063 1268v-27H860z"/><glyph unicode="ë" horiz-adv-x="1210" d="M92 0zm531 922q-97 0-152-61.5T408 686h428q-2 113-59 174.5T623 922zm43-942q-270 0-422 149T92 551q0 281 140.5 434.5T621 1139q237 0 369-135t132-373V483H401q5-130 77-203t202-73q101 0 191 21t188 67V59Q979 19 888-.5T666-20zM297 1405q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T436 1272q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T841 1540q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T700 1405z"/><glyph unicode="ì" horiz-adv-x="625" d="M0 0zm465 0H160v1118h305V0zM274 1241q-63 44-185 142.5T-101 1548v21h342q63-101 235-301v-27H274z"/><glyph unicode="í" horiz-adv-x="625" d="M145 0zm320 0H160v1118h305V0zM145 1241v27q172 200 235 301h342v-21q-52-52-177.5-154.5T348 1241H145z"/><glyph unicode="î" horiz-adv-x="625" d="M0 0zm465 0H160v1118h305V0zm79 1241q-157 93-234 176-78-81-229-176h-203v27q189 189 256 301h357q31-52 107.5-141.5T747 1268v-27H544z"/><glyph unicode="ï" horiz-adv-x="625" d="M0 0zm465 0H160v1118h305V0zM-29 1405q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T110 1272q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T515 1540q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T374 1405z"/><glyph unicode="ð" horiz-adv-x="1268" d="M510 1303q-80 53-152 92l101 176q144-65 258-141l225 139 100-154-170-104q156-143 230-324.5t74-413.5q0-280-145-436.5T631-20q-245 0-392 137T92 489q0 233 130 369.5T573 995q205 0 275-98l8 4q-67 162-192 281l-230-142-100 156zm354-771q0 108-61 173t-168 65q-121 0-176.5-68.5T403 487q0-140 60-211t172-71q123 0 176 82t53 245z"/><glyph unicode="ñ" horiz-adv-x="1346" d="M160 0zm1032 0H887v653q0 121-43 181.5T707 895q-128 0-185-85.5T465 526V0H160v1118h233l41-143h17q51 81 140.5 122.5T795 1139q195 0 296-105.5T1192 729V0zM508 1346q-31 0-59.5-26.5T407 1239H258q11 145 82.5 227t189.5 82q41 0 80.5-16.5t78-36T764 1460t73-16q31 0 59.5 26t41.5 80h149q-11-145-83.5-227T815 1241q-41 0-80.5 16.5t-78 36-75.5 36-73 16.5z"/><glyph unicode="ò" horiz-adv-x="1268" d="M92 0zm311 561q0-166 54.5-251T635 225q122 0 175.5 84.5T864 561q0 166-54 249t-177 83q-122 0-176-82.5T403 561zm773 0q0-273-144-427T631-20q-161 0-284 70.5T158 253 92 561q0 274 143 426t402 152q161 0 284-70t189-201 66-307zm-564 680q-63 44-185 142.5T237 1548v21h342q63-101 235-301v-27H612z"/><glyph unicode="ó" horiz-adv-x="1268" d="M92 0zm311 561q0-166 54.5-251T635 225q122 0 175.5 84.5T864 561q0 166-54 249t-177 83q-122 0-176-82.5T403 561zm773 0q0-273-144-427T631-20q-161 0-284 70.5T158 253 92 561q0 274 143 426t402 152q161 0 284-70t189-201 66-307zm-709 680v27q172 200 235 301h342v-21q-52-52-177.5-154.5T670 1241H467z"/><glyph unicode="ô" horiz-adv-x="1268" d="M92 0zm311 561q0-166 54.5-251T635 225q122 0 175.5 84.5T864 561q0 166-54 249t-177 83q-122 0-176-82.5T403 561zm773 0q0-273-144-427T631-20q-161 0-284 70.5T158 253 92 561q0 274 143 426t402 152q161 0 284-70t189-201 66-307zm-312 680q-157 93-234 176-78-81-229-176H198v27q189 189 256 301h357q31-52 107.5-141.5T1067 1268v-27H864z"/><glyph unicode="õ" horiz-adv-x="1268" d="M92 0zm311 561q0-166 54.5-251T635 225q122 0 175.5 84.5T864 561q0 166-54 249t-177 83q-122 0-176-82.5T403 561zm773 0q0-273-144-427T631-20q-161 0-284 70.5T158 253 92 561q0 274 143 426t402 152q161 0 284-70t189-201 66-307zm-707 785q-31 0-59.5-26.5T368 1239H219q11 145 82.5 227t189.5 82q41 0 80.5-16.5t78-36T725 1460t73-16q31 0 59.5 26t41.5 80h149q-11-145-83.5-227T776 1241q-41 0-80.5 16.5t-78 36-75.5 36-73 16.5z"/><glyph unicode="ö" horiz-adv-x="1268" d="M92 0zm311 561q0-166 54.5-251T635 225q122 0 175.5 84.5T864 561q0 166-54 249t-177 83q-122 0-176-82.5T403 561zm773 0q0-273-144-427T631-20q-161 0-284 70.5T158 253 92 561q0 274 143 426t402 152q161 0 284-70t189-201 66-307zm-885 844q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T430 1272q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T835 1540q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T694 1405z"/><glyph unicode="÷" d="M88 612v219h993V612H88zm356-239q0 76 37 113.5T584 524t102.5-39T723 373q0-70-37-111t-102-41-102.5 39T444 373zm0 698q0 75 37 113.5t103 38.5q67 0 103-40.5t36-111.5q0-70-37-110.5T584 920t-102.5 39-37.5 112z"/><glyph unicode="ø" horiz-adv-x="1268" d="M1176 561q0-273-144-427T631-20q-126 0-234 45L330-76 176 29l68 100Q92 285 92 561q0 274 143 426t402 152q132 0 248-52l55 82 152-108-58-84q142-155 142-416zm-773 0q0-94 19-166l317 475q-43 23-106 23-122 0-176-82.5T403 561zm461 0q0 81-12 141L543 240q38-15 92-15 122 0 175.5 84.5T864 561z"/><glyph unicode="ù" horiz-adv-x="1346" d="M154 0zm798 0l-41 143h-16Q846 65 756 22.5T551-20Q354-20 254 85.5T154 389v729h305V465q0-121 43-181.5T639 223q128 0 185 85.5T881 592v526h305V0H952zM620 1241q-63 44-185 142.5T245 1548v21h342q63-101 235-301v-27H620z"/><glyph unicode="ú" horiz-adv-x="1346" d="M154 0zm798 0l-41 143h-16Q846 65 756 22.5T551-20Q354-20 254 85.5T154 389v729h305V465q0-121 43-181.5T639 223q128 0 185 85.5T881 592v526h305V0H952zM498 1241v27q172 200 235 301h342v-21q-52-52-177.5-154.5T701 1241H498z"/><glyph unicode="û" horiz-adv-x="1346" d="M154 0zm798 0l-41 143h-16Q846 65 756 22.5T551-20Q354-20 254 85.5T154 389v729h305V465q0-121 43-181.5T639 223q128 0 185 85.5T881 592v526h305V0H952zm-51 1241q-157 93-234 176-78-81-229-176H235v27q189 189 256 301h357q31-52 107.5-141.5T1104 1268v-27H901z"/><glyph unicode="ü" horiz-adv-x="1346" d="M154 0zm798 0l-41 143h-16Q846 65 756 22.5T551-20Q354-20 254 85.5T154 389v729h305V465q0-121 43-181.5T639 223q128 0 185 85.5T881 592v526h305V0H952zM326 1405q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T465 1272q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T870 1540q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T729 1405z"/><glyph unicode="ý" horiz-adv-x="1165" d="M0 0zm0 1118h334l211-629q27-82 37-194h6q11 103 43 194l207 629h327L692-143q-65-175-185.5-262T225-492q-79 0-155 17v242q55-13 120-13 81 0 141.5 49.5T426-47l18 55zm393 123v27q172 200 235 301h342v-21q-52-52-177.5-154.5T596 1241H393z"/><glyph unicode="þ" horiz-adv-x="1296" d="M465 973q50 81 131 123.5t186 42.5q198 0 310-154.5T1204 561q0-273-111.5-427T782-20q-213 0-317 137h-14l7-62 7-94v-453H160v2048h305v-391l-7-120-7-72h14zm219-78q-113 0-165-69.5T465 596v-33q0-180 53.5-258T688 227q205 0 205 338 0 165-50.5 247.5T684 895z"/><glyph unicode="ÿ" horiz-adv-x="1165" d="M0 0zm0 1118h334l211-629q27-82 37-194h6q11 103 43 194l207 629h327L692-143q-65-175-185.5-262T225-492q-79 0-155 17v242q55-13 120-13 81 0 141.5 49.5T426-47l18 55zm243 287q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T382 1272q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T787 1540q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T646 1405z"/><glyph unicode="ı" horiz-adv-x="625" d="M465 0H160v1118h305V0z"/><glyph unicode="Œ" horiz-adv-x="1993" d="M1872 0H999q-38-9-109-14.5T774-20q-319 0-487 197T119 735q0 363 169.5 556.5T776 1485q61 0 127-7t101-16h868v-254h-563V887h526V633h-526V256h563V0zM776 1227q-166 0-252-125.5T438 733q0-244 86-368.5T774 240q65 0 126 10.5t99 28.5v907q-35 19-101.5 30T776 1227z"/><glyph unicode="œ" horiz-adv-x="2003" d="M1446-20q-271 0-420 155Q885-20 635-20q-162 0-286 70T158.5 252 92 561q0 277 141.5 427.5T633 1139q112 0 212-39.5T1016 983q144 156 383 156 244 0 380-135t136-373V483h-746v-8q7-127 81.5-197.5T1458 207q107 0 200 21t193 67V59q-81-39-175.5-59T1446-20zM403 561q0-166 54.5-251T635 225q122 0 175.5 84.5T864 561q0 166-54 249t-177 83q-122 0-176-82.5T403 561zm1002 361q-94 0-156-57.5T1178 686h450q-2 111-60.5 173.5T1405 922z"/><glyph unicode="Ÿ" horiz-adv-x="1278" d="M0 0zm639 860l305 602h334L793 569V0H485v559L0 1462h336zm-342 883q0 65 37.5 100t101.5 35q66 0 103.5-37t37.5-98q0-60-38-96.5T436 1610q-64 0-101.5 35t-37.5 98zm403 0q0 70 40.5 102.5T841 1878q65 0 103.5-36t38.5-99q0-61-39-97t-103-36q-60 0-100.5 32.5T700 1743z"/><glyph unicode="ˆ" horiz-adv-x="1243" d="M852 1241q-157 93-234 176-78-81-229-176H186v27q189 189 256 301h357q31-52 107.5-141.5T1055 1268v-27H852z"/><glyph unicode="˚" horiz-adv-x="1182" d="M842 1479q0-108-71-174t-183-66-180 64-68 174q0 108 67.5 172.5T588 1714q110 0 182-66t72-169zm-158-2q0 45-27 70.5t-69 25.5-69-25.5-27-70.5 24-71 72-26q42 0 69 26t27 71z"/><glyph unicode="˜" horiz-adv-x="1243" d="M457 1346q-31 0-59.5-26.5T356 1239H207q11 145 82.5 227t189.5 82q41 0 80.5-16.5t78-36T713 1460t73-16q31 0 59.5 26t41.5 80h149q-11-145-83.5-227T764 1241q-41 0-80.5 16.5t-78 36-75.5 36-73 16.5z"/><glyph horiz-adv-x="953"/><glyph horiz-adv-x="1907"/><glyph horiz-adv-x="953"/><glyph horiz-adv-x="1907"/><glyph horiz-adv-x="635"/><glyph horiz-adv-x="476"/><glyph horiz-adv-x="317"/><glyph horiz-adv-x="317"/><glyph horiz-adv-x="238"/><glyph horiz-adv-x="381"/><glyph horiz-adv-x="105"/><glyph unicode="‐" horiz-adv-x="659" d="M61 424v250h537V424H61z"/><glyph unicode="‑" horiz-adv-x="659" d="M61 424v250h537V424H61z"/><glyph unicode="‒" horiz-adv-x="659" d="M61 424v250h537V424H61z"/><glyph unicode="–" horiz-adv-x="1024" d="M82 436v230h860V436H82z"/><glyph unicode="—" horiz-adv-x="2048" d="M82 436v230h1884V436H82z"/><glyph unicode="‘" horiz-adv-x="444" d="M39 961l-14 22q22 91 72.5 228.5T201 1462h219q-66-267-101-501H39z"/><glyph unicode="’" horiz-adv-x="444" d="M406 1462l14-22q-50-197-176-479H25q69 296 100 501h281z"/><glyph unicode="‚" horiz-adv-x="596" d="M459 215Q407 13 283-264H63Q128 2 164 238h280z"/><glyph unicode="“" horiz-adv-x="911" d="M492 983q22 91 72.5 228.5T668 1462h219q-66-267-101-501H506zm-467 0q22 91 72.5 228.5T201 1462h219q-66-267-101-501H39z"/><glyph unicode="”" horiz-adv-x="911" d="M420 1440q-50-197-176-479H25q69 296 100 501h281zm467 0q-50-197-176-479H492q69 296 100 501h280z"/><glyph unicode="„" horiz-adv-x="1061" d="M459 215Q407 13 283-264H63Q128 2 164 238h280zm467 0Q874 13 750-264H530Q595 2 631 238h280z"/><glyph unicode="•" horiz-adv-x="770" d="M98 748q0 154 74 235.5t213 81.5q137 0 212-82t75-235q0-152-75.5-235T385 430q-138 0-212.5 83T98 748z"/><glyph unicode="…" horiz-adv-x="1751" d="M117 143q0 84 45 127t131 43q83 0 128.5-44T467 143q0-79-46-124.5T293-27q-84 0-130 44.5T117 143zm583 0q0 84 45 127t132 43q83 0 128.5-44t45.5-126q0-79-46-124.5T877-27q-85 0-131 44.5T700 143zm584 0q0 84 45 127t131 43q83 0 128.5-44t45.5-126q0-79-46-124.5T1460-27q-84 0-130 44.5T1284 143z"/><glyph horiz-adv-x="381"/><glyph unicode="‹" horiz-adv-x="754" d="M82 573l371 455 219-119-279-348 279-348L453 94 82 547v26z"/><glyph unicode="›" horiz-adv-x="754" d="M672 547L301 94 82 213l278 348L82 909l219 119 371-455v-26z"/><glyph unicode="⁄" horiz-adv-x="266" d="M657 1462L-154 0h-239l811 1462h239z"/><glyph horiz-adv-x="476"/><glyph unicode="⁴" horiz-adv-x="776" d="M758 737H633V586H395v151H12v154l385 577h236V905h125V737zM395 905v164q0 86 6 184-9-26-35.5-80t-41.5-77L197 905h198z"/><glyph unicode="€" d="M803 1225q-122 0-201-70.5T500 950h403V774H485l-2-35v-47l2-33h355V481H502q51-243 321-243 143 0 275 57V39Q982-20 805-20q-245 0-403 133T203 481H66v178h118q-4 23-4 62l2 53H66v176h133q37 242 199 382.5T803 1473q188 0 352-82l-98-232q-69 31-129 48.5T803 1225z"/><glyph unicode="™" horiz-adv-x="1534" d="M381 741H213v572H16v149h564v-149H381V741zm575 0l-165 529h-7l4-111V741H625v721h247l160-510 170 510h240V741h-168v408l4 121h-6l-174-529H956z"/><glyph unicode="" horiz-adv-x="1120" d="M0 1120h1120V0H0v1120z"/><glyph horiz-adv-x="1296" d="M0 0z"/><hkern u1="&quot;" u2="Ÿ" k="-20"/><hkern u1="&quot;" u2="œ" k="123"/><hkern u1="&quot;" u2="ü" k="61"/><hkern u1="&quot;" u2="û" k="61"/><hkern u1="&quot;" u2="ú" k="61"/><hkern u1="&quot;" u2="ù" k="61"/><hkern u1="&quot;" u2="ø" k="123"/><hkern u1="&quot;" u2="ö" k="123"/><hkern u1="&quot;" u2="õ" k="123"/><hkern u1="&quot;" u2="ô" k="123"/><hkern u1="&quot;" u2="ó" k="123"/><hkern u1="&quot;" u2="ò" k="123"/><hkern u1="&quot;" u2="ë" k="123"/><hkern u1="&quot;" u2="ê" k="123"/><hkern u1="&quot;" u2="é" k="123"/><hkern u1="&quot;" u2="è" k="123"/><hkern u1="&quot;" u2="ç" k="123"/><hkern u1="&quot;" u2="æ" k="82"/><hkern u1="&quot;" u2="å" k="82"/><hkern u1="&quot;" u2="ä" k="82"/><hkern u1="&quot;" u2="ã" k="82"/><hkern u1="&quot;" u2="â" k="82"/><hkern u1="&quot;" u2="á" k="82"/><hkern u1="&quot;" u2="à" k="123"/><hkern u1="&quot;" u2="Ý" k="-20"/><hkern u1="&quot;" u2="Å" k="143"/><hkern u1="&quot;" u2="Ä" k="143"/><hkern u1="&quot;" u2="Ã" k="143"/><hkern u1="&quot;" u2="Â" k="143"/><hkern u1="&quot;" u2="Á" k="143"/><hkern u1="&quot;" u2="À" k="143"/><hkern u1="&quot;" u2="u" k="61"/><hkern u1="&quot;" u2="s" k="61"/><hkern u1="&quot;" u2="r" k="61"/><hkern u1="&quot;" u2="q" k="123"/><hkern u1="&quot;" u2="p" k="61"/><hkern u1="&quot;" u2="o" k="123"/><hkern u1="&quot;" u2="n" k="61"/><hkern u1="&quot;" u2="m" k="61"/><hkern u1="&quot;" u2="g" k="61"/><hkern u1="&quot;" u2="e" k="123"/><hkern u1="&quot;" u2="d" k="123"/><hkern u1="&quot;" u2="c" k="123"/><hkern u1="&quot;" u2="a" k="82"/><hkern u1="&quot;" u2="Y" k="-20"/><hkern u1="&quot;" u2="W" k="-41"/><hkern u1="&quot;" u2="V" k="-41"/><hkern u1="&quot;" u2="T" k="-41"/><hkern u1="&quot;" u2="A" k="143"/><hkern u1="'" u2="Ÿ" k="-20"/><hkern u1="'" u2="œ" k="123"/><hkern u1="'" u2="ü" k="61"/><hkern u1="'" u2="û" k="61"/><hkern u1="'" u2="ú" k="61"/><hkern u1="'" u2="ù" k="61"/><hkern u1="'" u2="ø" k="123"/><hkern u1="'" u2="ö" k="123"/><hkern u1="'" u2="õ" k="123"/><hkern u1="'" u2="ô" k="123"/><hkern u1="'" u2="ó" k="123"/><hkern u1="'" u2="ò" k="123"/><hkern u1="'" u2="ë" k="123"/><hkern u1="'" u2="ê" k="123"/><hkern u1="'" u2="é" k="123"/><hkern u1="'" u2="è" k="123"/><hkern u1="'" u2="ç" k="123"/><hkern u1="'" u2="æ" k="82"/><hkern u1="'" u2="å" k="82"/><hkern u1="'" u2="ä" k="82"/><hkern u1="'" u2="ã" k="82"/><hkern u1="'" u2="â" k="82"/><hkern u1="'" u2="á" k="82"/><hkern u1="'" u2="à" k="123"/><hkern u1="'" u2="Ý" k="-20"/><hkern u1="'" u2="Å" k="143"/><hkern u1="'" u2="Ä" k="143"/><hkern u1="'" u2="Ã" k="143"/><hkern u1="'" u2="Â" k="143"/><hkern u1="'" u2="Á" k="143"/><hkern u1="'" u2="À" k="143"/><hkern u1="'" u2="u" k="61"/><hkern u1="'" u2="s" k="61"/><hkern u1="'" u2="r" k="61"/><hkern u1="'" u2="q" k="123"/><hkern u1="'" u2="p" k="61"/><hkern u1="'" u2="o" k="123"/><hkern u1="'" u2="n" k="61"/><hkern u1="'" u2="m" k="61"/><hkern u1="'" u2="g" k="61"/><hkern u1="'" u2="e" k="123"/><hkern u1="'" u2="d" k="123"/><hkern u1="'" u2="c" k="123"/><hkern u1="'" u2="a" k="82"/><hkern u1="'" u2="Y" k="-20"/><hkern u1="'" u2="W" k="-41"/><hkern u1="'" u2="V" k="-41"/><hkern u1="'" u2="T" k="-41"/><hkern u1="'" u2="A" k="143"/><hkern u1="(" u2="J" k="-184"/><hkern u1="," u2="Ÿ" k="123"/><hkern u1="," u2="Œ" k="102"/><hkern u1="," u2="Ý" k="123"/><hkern u1="," u2="Ü" k="41"/><hkern u1="," u2="Û" k="41"/><hkern u1="," u2="Ú" k="41"/><hkern u1="," u2="Ù" k="41"/><hkern u1="," u2="Ø" k="102"/><hkern u1="," u2="Ö" k="102"/><hkern u1="," u2="Õ" k="102"/><hkern u1="," u2="Ô" k="102"/><hkern u1="," u2="Ó" k="102"/><hkern u1="," u2="Ò" k="102"/><hkern u1="," u2="Ç" k="102"/><hkern u1="," u2="Y" k="123"/><hkern u1="," u2="W" k="123"/><hkern u1="," u2="V" k="123"/><hkern u1="," u2="U" k="41"/><hkern u1="," u2="T" k="143"/><hkern u1="," u2="Q" k="102"/><hkern u1="," u2="O" k="102"/><hkern u1="," u2="G" k="102"/><hkern u1="," u2="C" k="102"/><hkern u1="-" u2="T" k="82"/><hkern u1="." u2="Ÿ" k="123"/><hkern u1="." u2="Œ" k="102"/><hkern u1="." u2="Ý" k="123"/><hkern u1="." u2="Ü" k="41"/><hkern u1="." u2="Û" k="41"/><hkern u1="." u2="Ú" k="41"/><hkern u1="." u2="Ù" k="41"/><hkern u1="." u2="Ø" k="102"/><hkern u1="." u2="Ö" k="102"/><hkern u1="." u2="Õ" k="102"/><hkern u1="." u2="Ô" k="102"/><hkern u1="." u2="Ó" k="102"/><hkern u1="." u2="Ò" k="102"/><hkern u1="." u2="Ç" k="102"/><hkern u1="." u2="Y" k="123"/><hkern u1="." u2="W" k="123"/><hkern u1="." u2="V" k="123"/><hkern u1="." u2="U" k="41"/><hkern u1="." u2="T" k="143"/><hkern u1="." u2="Q" k="102"/><hkern u1="." u2="O" k="102"/><hkern u1="." u2="G" k="102"/><hkern u1="." u2="C" k="102"/><hkern u1="A" u2="”" k="143"/><hkern u1="A" u2="’" k="143"/><hkern u1="A" u2="Ÿ" k="123"/><hkern u1="A" u2="Œ" k="41"/><hkern u1="A" u2="Ý" k="123"/><hkern u1="A" u2="Ø" k="41"/><hkern u1="A" u2="Ö" k="41"/><hkern u1="A" u2="Õ" k="41"/><hkern u1="A" u2="Ô" k="41"/><hkern u1="A" u2="Ó" k="41"/><hkern u1="A" u2="Ò" k="41"/><hkern u1="A" u2="Ç" k="41"/><hkern u1="A" u2="Y" k="123"/><hkern u1="A" u2="W" k="82"/><hkern u1="A" u2="V" k="82"/><hkern u1="A" u2="T" k="143"/><hkern u1="A" u2="Q" k="41"/><hkern u1="A" u2="O" k="41"/><hkern u1="A" u2="J" k="-266"/><hkern u1="A" u2="G" k="41"/><hkern u1="A" u2="C" k="41"/><hkern u1="A" u2="'" k="143"/><hkern u1="A" u2="&quot;" k="143"/><hkern u1="B" u2="„" k="82"/><hkern u1="B" u2="‚" k="82"/><hkern u1="B" u2="Ÿ" k="20"/><hkern u1="B" u2="Ý" k="20"/><hkern u1="B" u2="Å" k="41"/><hkern u1="B" u2="Ä" k="41"/><hkern u1="B" u2="Ã" k="41"/><hkern u1="B" u2="Â" k="41"/><hkern u1="B" u2="Á" k="41"/><hkern u1="B" u2="À" k="41"/><hkern u1="B" u2="Z" k="20"/><hkern u1="B" u2="Y" k="20"/><hkern u1="B" u2="X" k="41"/><hkern u1="B" u2="W" k="20"/><hkern u1="B" u2="V" k="20"/><hkern u1="B" u2="T" k="61"/><hkern u1="B" u2="A" k="41"/><hkern u1="B" u2="." k="82"/><hkern u1="B" u2="," k="82"/><hkern u1="C" u2="Œ" k="41"/><hkern u1="C" u2="Ø" k="41"/><hkern u1="C" u2="Ö" k="41"/><hkern u1="C" u2="Õ" k="41"/><hkern u1="C" u2="Ô" k="41"/><hkern u1="C" u2="Ó" k="41"/><hkern u1="C" u2="Ò" k="41"/><hkern u1="C" u2="Ç" k="41"/><hkern u1="C" u2="Q" k="41"/><hkern u1="C" u2="O" k="41"/><hkern u1="C" u2="G" k="41"/><hkern u1="C" u2="C" k="41"/><hkern u1="D" u2="„" k="82"/><hkern u1="D" u2="‚" k="82"/><hkern u1="D" u2="Ÿ" k="20"/><hkern u1="D" u2="Ý" k="20"/><hkern u1="D" u2="Å" k="41"/><hkern u1="D" u2="Ä" k="41"/><hkern u1="D" u2="Ã" k="41"/><hkern u1="D" u2="Â" k="41"/><hkern u1="D" u2="Á" k="41"/><hkern u1="D" u2="À" k="41"/><hkern u1="D" u2="Z" k="20"/><hkern u1="D" u2="Y" k="20"/><hkern u1="D" u2="X" k="41"/><hkern u1="D" u2="W" k="20"/><hkern u1="D" u2="V" k="20"/><hkern u1="D" u2="T" k="61"/><hkern u1="D" u2="A" k="41"/><hkern u1="D" u2="." k="82"/><hkern u1="D" u2="," k="82"/><hkern u1="E" u2="J" k="-123"/><hkern u1="F" u2="„" k="123"/><hkern u1="F" u2="‚" k="123"/><hkern u1="F" u2="Å" k="41"/><hkern u1="F" u2="Ä" k="41"/><hkern u1="F" u2="Ã" k="41"/><hkern u1="F" u2="Â" k="41"/><hkern u1="F" u2="Á" k="41"/><hkern u1="F" u2="À" k="41"/><hkern u1="F" u2="A" k="41"/><hkern u1="F" u2="?" k="-41"/><hkern u1="F" u2="." k="123"/><hkern u1="F" u2="," k="123"/><hkern u1="K" u2="Œ" k="41"/><hkern u1="K" u2="Ø" k="41"/><hkern u1="K" u2="Ö" k="41"/><hkern u1="K" u2="Õ" k="41"/><hkern u1="K" u2="Ô" k="41"/><hkern u1="K" u2="Ó" k="41"/><hkern u1="K" u2="Ò" k="41"/><hkern u1="K" u2="Ç" k="41"/><hkern u1="K" u2="Q" k="41"/><hkern u1="K" u2="O" k="41"/><hkern u1="K" u2="G" k="41"/><hkern u1="K" u2="C" k="41"/><hkern u1="L" u2="”" k="164"/><hkern u1="L" u2="’" k="164"/><hkern u1="L" u2="Ÿ" k="61"/><hkern u1="L" u2="Œ" k="41"/><hkern u1="L" u2="Ý" k="61"/><hkern u1="L" u2="Ü" k="20"/><hkern u1="L" u2="Û" k="20"/><hkern u1="L" u2="Ú" k="20"/><hkern u1="L" u2="Ù" k="20"/><hkern u1="L" u2="Ø" k="41"/><hkern u1="L" u2="Ö" k="41"/><hkern u1="L" u2="Õ" k="41"/><hkern u1="L" u2="Ô" k="41"/><hkern u1="L" u2="Ó" k="41"/><hkern u1="L" u2="Ò" k="41"/><hkern u1="L" u2="Ç" k="41"/><hkern u1="L" u2="Y" k="61"/><hkern u1="L" u2="W" k="41"/><hkern u1="L" u2="V" k="41"/><hkern u1="L" u2="U" k="20"/><hkern u1="L" u2="T" k="41"/><hkern u1="L" u2="Q" k="41"/><hkern u1="L" u2="O" k="41"/><hkern u1="L" u2="G" k="41"/><hkern u1="L" u2="C" k="41"/><hkern u1="L" u2="'" k="164"/><hkern u1="L" u2="&quot;" k="164"/><hkern u1="O" u2="„" k="82"/><hkern u1="O" u2="‚" k="82"/><hkern u1="O" u2="Ÿ" k="20"/><hkern u1="O" u2="Ý" k="20"/><hkern u1="O" u2="Å" k="41"/><hkern u1="O" u2="Ä" k="41"/><hkern u1="O" u2="Ã" k="41"/><hkern u1="O" u2="Â" k="41"/><hkern u1="O" u2="Á" k="41"/><hkern u1="O" u2="À" k="41"/><hkern u1="O" u2="Z" k="20"/><hkern u1="O" u2="Y" k="20"/><hkern u1="O" u2="X" k="41"/><hkern u1="O" u2="W" k="20"/><hkern u1="O" u2="V" k="20"/><hkern u1="O" u2="T" k="61"/><hkern u1="O" u2="A" k="41"/><hkern u1="O" u2="." k="82"/><hkern u1="O" u2="," k="82"/><hkern u1="P" u2="„" k="266"/><hkern u1="P" u2="‚" k="266"/><hkern u1="P" u2="Å" k="102"/><hkern u1="P" u2="Ä" k="102"/><hkern u1="P" u2="Ã" k="102"/><hkern u1="P" u2="Â" k="102"/><hkern u1="P" u2="Á" k="102"/><hkern u1="P" u2="À" k="102"/><hkern u1="P" u2="Z" k="20"/><hkern u1="P" u2="X" k="41"/><hkern u1="P" u2="A" k="102"/><hkern u1="P" u2="." k="266"/><hkern u1="P" u2="," k="266"/><hkern u1="Q" u2="„" k="82"/><hkern u1="Q" u2="‚" k="82"/><hkern u1="Q" u2="Ÿ" k="20"/><hkern u1="Q" u2="Ý" k="20"/><hkern u1="Q" u2="Å" k="41"/><hkern u1="Q" u2="Ä" k="41"/><hkern u1="Q" u2="Ã" k="41"/><hkern u1="Q" u2="Â" k="41"/><hkern u1="Q" u2="Á" k="41"/><hkern u1="Q" u2="À" k="41"/><hkern u1="Q" u2="Z" k="20"/><hkern u1="Q" u2="Y" k="20"/><hkern u1="Q" u2="X" k="41"/><hkern u1="Q" u2="W" k="20"/><hkern u1="Q" u2="V" k="20"/><hkern u1="Q" u2="T" k="61"/><hkern u1="Q" u2="A" k="41"/><hkern u1="Q" u2="." k="82"/><hkern u1="Q" u2="," k="82"/><hkern u1="T" u2="„" k="123"/><hkern u1="T" u2="‚" k="123"/><hkern u1="T" u2="—" k="82"/><hkern u1="T" u2="–" k="82"/><hkern u1="T" u2="œ" k="143"/><hkern u1="T" u2="Œ" k="41"/><hkern u1="T" u2="ý" k="41"/><hkern u1="T" u2="ü" k="102"/><hkern u1="T" u2="û" k="102"/><hkern u1="T" u2="ú" k="102"/><hkern u1="T" u2="ù" k="102"/><hkern u1="T" u2="ø" k="143"/><hkern u1="T" u2="ö" k="143"/><hkern u1="T" u2="õ" k="143"/><hkern u1="T" u2="ô" k="143"/><hkern u1="T" u2="ó" k="143"/><hkern u1="T" u2="ò" k="143"/><hkern u1="T" u2="ë" k="143"/><hkern u1="T" u2="ê" k="143"/><hkern u1="T" u2="é" k="143"/><hkern u1="T" u2="è" k="143"/><hkern u1="T" u2="ç" k="143"/><hkern u1="T" u2="æ" k="164"/><hkern u1="T" u2="å" k="164"/><hkern u1="T" u2="ä" k="164"/><hkern u1="T" u2="ã" k="164"/><hkern u1="T" u2="â" k="164"/><hkern u1="T" u2="á" k="164"/><hkern u1="T" u2="à" k="143"/><hkern u1="T" u2="Ø" k="41"/><hkern u1="T" u2="Ö" k="41"/><hkern u1="T" u2="Õ" k="41"/><hkern u1="T" u2="Ô" k="41"/><hkern u1="T" u2="Ó" k="41"/><hkern u1="T" u2="Ò" k="41"/><hkern u1="T" u2="Ç" k="41"/><hkern u1="T" u2="Å" k="143"/><hkern u1="T" u2="Ä" k="143"/><hkern u1="T" u2="Ã" k="143"/><hkern u1="T" u2="Â" k="143"/><hkern u1="T" u2="Á" k="143"/><hkern u1="T" u2="À" k="143"/><hkern u1="T" u2="z" k="82"/><hkern u1="T" u2="y" k="41"/><hkern u1="T" u2="x" k="41"/><hkern u1="T" u2="w" k="41"/><hkern u1="T" u2="v" k="41"/><hkern u1="T" u2="u" k="102"/><hkern u1="T" u2="s" k="123"/><hkern u1="T" u2="r" k="102"/><hkern u1="T" u2="q" k="143"/><hkern u1="T" u2="p" k="102"/><hkern u1="T" u2="o" k="143"/><hkern u1="T" u2="n" k="102"/><hkern u1="T" u2="m" k="102"/><hkern u1="T" u2="g" k="143"/><hkern u1="T" u2="e" k="143"/><hkern u1="T" u2="d" k="143"/><hkern u1="T" u2="c" k="143"/><hkern u1="T" u2="a" k="164"/><hkern u1="T" u2="T" k="-41"/><hkern u1="T" u2="Q" k="41"/><hkern u1="T" u2="O" k="41"/><hkern u1="T" u2="G" k="41"/><hkern u1="T" u2="C" k="41"/><hkern u1="T" u2="A" k="143"/><hkern u1="T" u2="?" k="-41"/><hkern u1="T" u2="." k="123"/><hkern u1="T" u2="-" k="82"/><hkern u1="T" u2="," k="123"/><hkern u1="U" u2="„" k="41"/><hkern u1="U" u2="‚" k="41"/><hkern u1="U" u2="Å" k="20"/><hkern u1="U" u2="Ä" k="20"/><hkern u1="U" u2="Ã" k="20"/><hkern u1="U" u2="Â" k="20"/><hkern u1="U" u2="Á" k="20"/><hkern u1="U" u2="À" k="20"/><hkern u1="U" u2="A" k="20"/><hkern u1="U" u2="." k="41"/><hkern u1="U" u2="," k="41"/><hkern u1="V" u2="„" k="102"/><hkern u1="V" u2="‚" k="102"/><hkern u1="V" u2="œ" k="41"/><hkern u1="V" u2="Œ" k="20"/><hkern u1="V" u2="ü" k="20"/><hkern u1="V" u2="û" k="20"/><hkern u1="V" u2="ú" k="20"/><hkern u1="V" u2="ù" k="20"/><hkern u1="V" u2="ø" k="41"/><hkern u1="V" u2="ö" k="41"/><hkern u1="V" u2="õ" k="41"/><hkern u1="V" u2="ô" k="41"/><hkern u1="V" u2="ó" k="41"/><hkern u1="V" u2="ò" k="41"/><hkern u1="V" u2="ë" k="41"/><hkern u1="V" u2="ê" k="41"/><hkern u1="V" u2="é" k="41"/><hkern u1="V" u2="è" k="41"/><hkern u1="V" u2="ç" k="41"/><hkern u1="V" u2="æ" k="41"/><hkern u1="V" u2="å" k="41"/><hkern u1="V" u2="ä" k="41"/><hkern u1="V" u2="ã" k="41"/><hkern u1="V" u2="â" k="41"/><hkern u1="V" u2="á" k="41"/><hkern u1="V" u2="à" k="41"/><hkern u1="V" u2="Ø" k="20"/><hkern u1="V" u2="Ö" k="20"/><hkern u1="V" u2="Õ" k="20"/><hkern u1="V" u2="Ô" k="20"/><hkern u1="V" u2="Ó" k="20"/><hkern u1="V" u2="Ò" k="20"/><hkern u1="V" u2="Ç" k="20"/><hkern u1="V" u2="Å" k="82"/><hkern u1="V" u2="Ä" k="82"/><hkern u1="V" u2="Ã" k="82"/><hkern u1="V" u2="Â" k="82"/><hkern u1="V" u2="Á" k="82"/><hkern u1="V" u2="À" k="82"/><hkern u1="V" u2="u" k="20"/><hkern u1="V" u2="s" k="20"/><hkern u1="V" u2="r" k="20"/><hkern u1="V" u2="q" k="41"/><hkern u1="V" u2="p" k="20"/><hkern u1="V" u2="o" k="41"/><hkern u1="V" u2="n" k="20"/><hkern u1="V" u2="m" k="20"/><hkern u1="V" u2="g" k="20"/><hkern u1="V" u2="e" k="41"/><hkern u1="V" u2="d" k="41"/><hkern u1="V" u2="c" k="41"/><hkern u1="V" u2="a" k="41"/><hkern u1="V" u2="Q" k="20"/><hkern u1="V" u2="O" k="20"/><hkern u1="V" u2="G" k="20"/><hkern u1="V" u2="C" k="20"/><hkern u1="V" u2="A" k="82"/><hkern u1="V" u2="?" k="-41"/><hkern u1="V" u2="." k="102"/><hkern u1="V" u2="," k="102"/><hkern u1="W" u2="„" k="102"/><hkern u1="W" u2="‚" k="102"/><hkern u1="W" u2="œ" k="41"/><hkern u1="W" u2="Œ" k="20"/><hkern u1="W" u2="ü" k="20"/><hkern u1="W" u2="û" k="20"/><hkern u1="W" u2="ú" k="20"/><hkern u1="W" u2="ù" k="20"/><hkern u1="W" u2="ø" k="41"/><hkern u1="W" u2="ö" k="41"/><hkern u1="W" u2="õ" k="41"/><hkern u1="W" u2="ô" k="41"/><hkern u1="W" u2="ó" k="41"/><hkern u1="W" u2="ò" k="41"/><hkern u1="W" u2="ë" k="41"/><hkern u1="W" u2="ê" k="41"/><hkern u1="W" u2="é" k="41"/><hkern u1="W" u2="è" k="41"/><hkern u1="W" u2="ç" k="41"/><hkern u1="W" u2="æ" k="41"/><hkern u1="W" u2="å" k="41"/><hkern u1="W" u2="ä" k="41"/><hkern u1="W" u2="ã" k="41"/><hkern u1="W" u2="â" k="41"/><hkern u1="W" u2="á" k="41"/><hkern u1="W" u2="à" k="41"/><hkern u1="W" u2="Ø" k="20"/><hkern u1="W" u2="Ö" k="20"/><hkern u1="W" u2="Õ" k="20"/><hkern u1="W" u2="Ô" k="20"/><hkern u1="W" u2="Ó" k="20"/><hkern u1="W" u2="Ò" k="20"/><hkern u1="W" u2="Ç" k="20"/><hkern u1="W" u2="Å" k="82"/><hkern u1="W" u2="Ä" k="82"/><hkern u1="W" u2="Ã" k="82"/><hkern u1="W" u2="Â" k="82"/><hkern u1="W" u2="Á" k="82"/><hkern u1="W" u2="À" k="82"/><hkern u1="W" u2="u" k="20"/><hkern u1="W" u2="s" k="20"/><hkern u1="W" u2="r" k="20"/><hkern u1="W" u2="q" k="41"/><hkern u1="W" u2="p" k="20"/><hkern u1="W" u2="o" k="41"/><hkern u1="W" u2="n" k="20"/><hkern u1="W" u2="m" k="20"/><hkern u1="W" u2="g" k="20"/><hkern u1="W" u2="e" k="41"/><hkern u1="W" u2="d" k="41"/><hkern u1="W" u2="c" k="41"/><hkern u1="W" u2="a" k="41"/><hkern u1="W" u2="Q" k="20"/><hkern u1="W" u2="O" k="20"/><hkern u1="W" u2="G" k="20"/><hkern u1="W" u2="C" k="20"/><hkern u1="W" u2="A" k="82"/><hkern u1="W" u2="?" k="-41"/><hkern u1="W" u2="." k="102"/><hkern u1="W" u2="," k="102"/><hkern u1="X" u2="Œ" k="41"/><hkern u1="X" u2="Ø" k="41"/><hkern u1="X" u2="Ö" k="41"/><hkern u1="X" u2="Õ" k="41"/><hkern u1="X" u2="Ô" k="41"/><hkern u1="X" u2="Ó" k="41"/><hkern u1="X" u2="Ò" k="41"/><hkern u1="X" u2="Ç" k="41"/><hkern u1="X" u2="Q" k="41"/><hkern u1="X" u2="O" k="41"/><hkern u1="X" u2="G" k="41"/><hkern u1="X" u2="C" k="41"/><hkern u1="Y" u2="„" k="123"/><hkern u1="Y" u2="‚" k="123"/><hkern u1="Y" u2="œ" k="102"/><hkern u1="Y" u2="Œ" k="41"/><hkern u1="Y" u2="ü" k="61"/><hkern u1="Y" u2="û" k="61"/><hkern u1="Y" u2="ú" k="61"/><hkern u1="Y" u2="ù" k="61"/><hkern u1="Y" u2="ø" k="102"/><hkern u1="Y" u2="ö" k="102"/><hkern u1="Y" u2="õ" k="102"/><hkern u1="Y" u2="ô" k="102"/><hkern u1="Y" u2="ó" k="102"/><hkern u1="Y" u2="ò" k="102"/><hkern u1="Y" u2="ë" k="102"/><hkern u1="Y" u2="ê" k="102"/><hkern u1="Y" u2="é" k="102"/><hkern u1="Y" u2="è" k="102"/><hkern u1="Y" u2="ç" k="102"/><hkern u1="Y" u2="æ" k="102"/><hkern u1="Y" u2="å" k="102"/><hkern u1="Y" u2="ä" k="102"/><hkern u1="Y" u2="ã" k="102"/><hkern u1="Y" u2="â" k="102"/><hkern u1="Y" u2="á" k="102"/><hkern u1="Y" u2="à" k="102"/><hkern u1="Y" u2="Ø" k="41"/><hkern u1="Y" u2="Ö" k="41"/><hkern u1="Y" u2="Õ" k="41"/><hkern u1="Y" u2="Ô" k="41"/><hkern u1="Y" u2="Ó" k="41"/><hkern u1="Y" u2="Ò" k="41"/><hkern u1="Y" u2="Ç" k="41"/><hkern u1="Y" u2="Å" k="123"/><hkern u1="Y" u2="Ä" k="123"/><hkern u1="Y" u2="Ã" k="123"/><hkern u1="Y" u2="Â" k="123"/><hkern u1="Y" u2="Á" k="123"/><hkern u1="Y" u2="À" k="123"/><hkern u1="Y" u2="z" k="41"/><hkern u1="Y" u2="u" k="61"/><hkern u1="Y" u2="s" k="82"/><hkern u1="Y" u2="r" k="61"/><hkern u1="Y" u2="q" k="102"/><hkern u1="Y" u2="p" k="61"/><hkern u1="Y" u2="o" k="102"/><hkern u1="Y" u2="n" k="61"/><hkern u1="Y" u2="m" k="61"/><hkern u1="Y" u2="g" k="41"/><hkern u1="Y" u2="e" k="102"/><hkern u1="Y" u2="d" k="102"/><hkern u1="Y" u2="c" k="102"/><hkern u1="Y" u2="a" k="102"/><hkern u1="Y" u2="Q" k="41"/><hkern u1="Y" u2="O" k="41"/><hkern u1="Y" u2="G" k="41"/><hkern u1="Y" u2="C" k="41"/><hkern u1="Y" u2="A" k="123"/><hkern u1="Y" u2="?" k="-41"/><hkern u1="Y" u2="." k="123"/><hkern u1="Y" u2="," k="123"/><hkern u1="Z" u2="Œ" k="20"/><hkern u1="Z" u2="Ø" k="20"/><hkern u1="Z" u2="Ö" k="20"/><hkern u1="Z" u2="Õ" k="20"/><hkern u1="Z" u2="Ô" k="20"/><hkern u1="Z" u2="Ó" k="20"/><hkern u1="Z" u2="Ò" k="20"/><hkern u1="Z" u2="Ç" k="20"/><hkern u1="Z" u2="Q" k="20"/><hkern u1="Z" u2="O" k="20"/><hkern u1="Z" u2="G" k="20"/><hkern u1="Z" u2="C" k="20"/><hkern u1="[" u2="J" k="-184"/><hkern u1="a" u2="”" k="20"/><hkern u1="a" u2="’" k="20"/><hkern u1="a" u2="'" k="20"/><hkern u1="a" u2="&quot;" k="20"/><hkern u1="b" u2="”" k="20"/><hkern u1="b" u2="’" k="20"/><hkern u1="b" u2="ý" k="41"/><hkern u1="b" u2="z" k="20"/><hkern u1="b" u2="y" k="41"/><hkern u1="b" u2="x" k="41"/><hkern u1="b" u2="w" k="41"/><hkern u1="b" u2="v" k="41"/><hkern u1="b" u2="'" k="20"/><hkern u1="b" u2="&quot;" k="20"/><hkern u1="c" u2="”" k="-41"/><hkern u1="c" u2="’" k="-41"/><hkern u1="c" u2="'" k="-41"/><hkern u1="c" u2="&quot;" k="-41"/><hkern u1="e" u2="”" k="20"/><hkern u1="e" u2="’" k="20"/><hkern u1="e" u2="ý" k="41"/><hkern u1="e" u2="z" k="20"/><hkern u1="e" u2="y" k="41"/><hkern u1="e" u2="x" k="41"/><hkern u1="e" u2="w" k="41"/><hkern u1="e" u2="v" k="41"/><hkern u1="e" u2="'" k="20"/><hkern u1="e" u2="&quot;" k="20"/><hkern u1="f" u2="”" k="-123"/><hkern u1="f" u2="’" k="-123"/><hkern u1="f" u2="'" k="-123"/><hkern u1="f" u2="&quot;" k="-123"/><hkern u1="h" u2="”" k="20"/><hkern u1="h" u2="’" k="20"/><hkern u1="h" u2="'" k="20"/><hkern u1="h" u2="&quot;" k="20"/><hkern u1="k" u2="œ" k="41"/><hkern u1="k" u2="ø" k="41"/><hkern u1="k" u2="ö" k="41"/><hkern u1="k" u2="õ" k="41"/><hkern u1="k" u2="ô" k="41"/><hkern u1="k" u2="ó" k="41"/><hkern u1="k" u2="ò" k="41"/><hkern u1="k" u2="ë" k="41"/><hkern u1="k" u2="ê" k="41"/><hkern u1="k" u2="é" k="41"/><hkern u1="k" u2="è" k="41"/><hkern u1="k" u2="ç" k="41"/><hkern u1="k" u2="à" k="41"/><hkern u1="k" u2="q" k="41"/><hkern u1="k" u2="o" k="41"/><hkern u1="k" u2="e" k="41"/><hkern u1="k" u2="d" k="41"/><hkern u1="k" u2="c" k="41"/><hkern u1="m" u2="”" k="20"/><hkern u1="m" u2="’" k="20"/><hkern u1="m" u2="'" k="20"/><hkern u1="m" u2="&quot;" k="20"/><hkern u1="n" u2="”" k="20"/><hkern u1="n" u2="’" k="20"/><hkern u1="n" u2="'" k="20"/><hkern u1="n" u2="&quot;" k="20"/><hkern u1="o" u2="”" k="20"/><hkern u1="o" u2="’" k="20"/><hkern u1="o" u2="ý" k="41"/><hkern u1="o" u2="z" k="20"/><hkern u1="o" u2="y" k="41"/><hkern u1="o" u2="x" k="41"/><hkern u1="o" u2="w" k="41"/><hkern u1="o" u2="v" k="41"/><hkern u1="o" u2="'" k="20"/><hkern u1="o" u2="&quot;" k="20"/><hkern u1="p" u2="”" k="20"/><hkern u1="p" u2="’" k="20"/><hkern u1="p" u2="ý" k="41"/><hkern u1="p" u2="z" k="20"/><hkern u1="p" u2="y" k="41"/><hkern u1="p" u2="x" k="41"/><hkern u1="p" u2="w" k="41"/><hkern u1="p" u2="v" k="41"/><hkern u1="p" u2="'" k="20"/><hkern u1="p" u2="&quot;" k="20"/><hkern u1="r" u2="”" k="-82"/><hkern u1="r" u2="’" k="-82"/><hkern u1="r" u2="œ" k="41"/><hkern u1="r" u2="ø" k="41"/><hkern u1="r" u2="ö" k="41"/><hkern u1="r" u2="õ" k="41"/><hkern u1="r" u2="ô" k="41"/><hkern u1="r" u2="ó" k="41"/><hkern u1="r" u2="ò" k="41"/><hkern u1="r" u2="ë" k="41"/><hkern u1="r" u2="ê" k="41"/><hkern u1="r" u2="é" k="41"/><hkern u1="r" u2="è" k="41"/><hkern u1="r" u2="ç" k="41"/><hkern u1="r" u2="æ" k="41"/><hkern u1="r" u2="å" k="41"/><hkern u1="r" u2="ä" k="41"/><hkern u1="r" u2="ã" k="41"/><hkern u1="r" u2="â" k="41"/><hkern u1="r" u2="á" k="41"/><hkern u1="r" u2="à" k="41"/><hkern u1="r" u2="q" k="41"/><hkern u1="r" u2="o" k="41"/><hkern u1="r" u2="g" k="20"/><hkern u1="r" u2="e" k="41"/><hkern u1="r" u2="d" k="41"/><hkern u1="r" u2="c" k="41"/><hkern u1="r" u2="a" k="41"/><hkern u1="r" u2="'" k="-82"/><hkern u1="r" u2="&quot;" k="-82"/><hkern u1="t" u2="”" k="-41"/><hkern u1="t" u2="’" k="-41"/><hkern u1="t" u2="'" k="-41"/><hkern u1="t" u2="&quot;" k="-41"/><hkern u1="v" u2="„" k="82"/><hkern u1="v" u2="”" k="-82"/><hkern u1="v" u2="‚" k="82"/><hkern u1="v" u2="’" k="-82"/><hkern u1="v" u2="?" k="-41"/><hkern u1="v" u2="." k="82"/><hkern u1="v" u2="," k="82"/><hkern u1="v" u2="'" k="-82"/><hkern u1="v" u2="&quot;" k="-82"/><hkern u1="w" u2="„" k="82"/><hkern u1="w" u2="”" k="-82"/><hkern u1="w" u2="‚" k="82"/><hkern u1="w" u2="’" k="-82"/><hkern u1="w" u2="?" k="-41"/><hkern u1="w" u2="." k="82"/><hkern u1="w" u2="," k="82"/><hkern u1="w" u2="'" k="-82"/><hkern u1="w" u2="&quot;" k="-82"/><hkern u1="x" u2="œ" k="41"/><hkern u1="x" u2="ø" k="41"/><hkern u1="x" u2="ö" k="41"/><hkern u1="x" u2="õ" k="41"/><hkern u1="x" u2="ô" k="41"/><hkern u1="x" u2="ó" k="41"/><hkern u1="x" u2="ò" k="41"/><hkern u1="x" u2="ë" k="41"/><hkern u1="x" u2="ê" k="41"/><hkern u1="x" u2="é" k="41"/><hkern u1="x" u2="è" k="41"/><hkern u1="x" u2="ç" k="41"/><hkern u1="x" u2="à" k="41"/><hkern u1="x" u2="q" k="41"/><hkern u1="x" u2="o" k="41"/><hkern u1="x" u2="e" k="41"/><hkern u1="x" u2="d" k="41"/><hkern u1="x" u2="c" k="41"/><hkern u1="y" u2="„" k="82"/><hkern u1="y" u2="”" k="-82"/><hkern u1="y" u2="‚" k="82"/><hkern u1="y" u2="’" k="-82"/><hkern u1="y" u2="?" k="-41"/><hkern u1="y" u2="." k="82"/><hkern u1="y" u2="," k="82"/><hkern u1="y" u2="'" k="-82"/><hkern u1="y" u2="&quot;" k="-82"/><hkern u1="{" u2="J" k="-184"/><hkern u1="À" u2="”" k="143"/><hkern u1="À" u2="’" k="143"/><hkern u1="À" u2="Ÿ" k="123"/><hkern u1="À" u2="Œ" k="41"/><hkern u1="À" u2="Ý" k="123"/><hkern u1="À" u2="Ø" k="41"/><hkern u1="À" u2="Ö" k="41"/><hkern u1="À" u2="Õ" k="41"/><hkern u1="À" u2="Ô" k="41"/><hkern u1="À" u2="Ó" k="41"/><hkern u1="À" u2="Ò" k="41"/><hkern u1="À" u2="Ç" k="41"/><hkern u1="À" u2="Y" k="123"/><hkern u1="À" u2="W" k="82"/><hkern u1="À" u2="V" k="82"/><hkern u1="À" u2="T" k="143"/><hkern u1="À" u2="Q" k="41"/><hkern u1="À" u2="O" k="41"/><hkern u1="À" u2="J" k="-266"/><hkern u1="À" u2="G" k="41"/><hkern u1="À" u2="C" k="41"/><hkern u1="À" u2="'" k="143"/><hkern u1="À" u2="&quot;" k="143"/><hkern u1="Á" u2="”" k="143"/><hkern u1="Á" u2="’" k="143"/><hkern u1="Á" u2="Ÿ" k="123"/><hkern u1="Á" u2="Œ" k="41"/><hkern u1="Á" u2="Ý" k="123"/><hkern u1="Á" u2="Ø" k="41"/><hkern u1="Á" u2="Ö" k="41"/><hkern u1="Á" u2="Õ" k="41"/><hkern u1="Á" u2="Ô" k="41"/><hkern u1="Á" u2="Ó" k="41"/><hkern u1="Á" u2="Ò" k="41"/><hkern u1="Á" u2="Ç" k="41"/><hkern u1="Á" u2="Y" k="123"/><hkern u1="Á" u2="W" k="82"/><hkern u1="Á" u2="V" k="82"/><hkern u1="Á" u2="T" k="143"/><hkern u1="Á" u2="Q" k="41"/><hkern u1="Á" u2="O" k="41"/><hkern u1="Á" u2="J" k="-266"/><hkern u1="Á" u2="G" k="41"/><hkern u1="Á" u2="C" k="41"/><hkern u1="Á" u2="'" k="143"/><hkern u1="Á" u2="&quot;" k="143"/><hkern u1="Â" u2="”" k="143"/><hkern u1="Â" u2="’" k="143"/><hkern u1="Â" u2="Ÿ" k="123"/><hkern u1="Â" u2="Œ" k="41"/><hkern u1="Â" u2="Ý" k="123"/><hkern u1="Â" u2="Ø" k="41"/><hkern u1="Â" u2="Ö" k="41"/><hkern u1="Â" u2="Õ" k="41"/><hkern u1="Â" u2="Ô" k="41"/><hkern u1="Â" u2="Ó" k="41"/><hkern u1="Â" u2="Ò" k="41"/><hkern u1="Â" u2="Ç" k="41"/><hkern u1="Â" u2="Y" k="123"/><hkern u1="Â" u2="W" k="82"/><hkern u1="Â" u2="V" k="82"/><hkern u1="Â" u2="T" k="143"/><hkern u1="Â" u2="Q" k="41"/><hkern u1="Â" u2="O" k="41"/><hkern u1="Â" u2="J" k="-266"/><hkern u1="Â" u2="G" k="41"/><hkern u1="Â" u2="C" k="41"/><hkern u1="Â" u2="'" k="143"/><hkern u1="Â" u2="&quot;" k="143"/><hkern u1="Ã" u2="”" k="143"/><hkern u1="Ã" u2="’" k="143"/><hkern u1="Ã" u2="Ÿ" k="123"/><hkern u1="Ã" u2="Œ" k="41"/><hkern u1="Ã" u2="Ý" k="123"/><hkern u1="Ã" u2="Ø" k="41"/><hkern u1="Ã" u2="Ö" k="41"/><hkern u1="Ã" u2="Õ" k="41"/><hkern u1="Ã" u2="Ô" k="41"/><hkern u1="Ã" u2="Ó" k="41"/><hkern u1="Ã" u2="Ò" k="41"/><hkern u1="Ã" u2="Ç" k="41"/><hkern u1="Ã" u2="Y" k="123"/><hkern u1="Ã" u2="W" k="82"/><hkern u1="Ã" u2="V" k="82"/><hkern u1="Ã" u2="T" k="143"/><hkern u1="Ã" u2="Q" k="41"/><hkern u1="Ã" u2="O" k="41"/><hkern u1="Ã" u2="J" k="-266"/><hkern u1="Ã" u2="G" k="41"/><hkern u1="Ã" u2="C" k="41"/><hkern u1="Ã" u2="'" k="143"/><hkern u1="Ã" u2="&quot;" k="143"/><hkern u1="Ä" u2="”" k="143"/><hkern u1="Ä" u2="’" k="143"/><hkern u1="Ä" u2="Ÿ" k="123"/><hkern u1="Ä" u2="Œ" k="41"/><hkern u1="Ä" u2="Ý" k="123"/><hkern u1="Ä" u2="Ø" k="41"/><hkern u1="Ä" u2="Ö" k="41"/><hkern u1="Ä" u2="Õ" k="41"/><hkern u1="Ä" u2="Ô" k="41"/><hkern u1="Ä" u2="Ó" k="41"/><hkern u1="Ä" u2="Ò" k="41"/><hkern u1="Ä" u2="Ç" k="41"/><hkern u1="Ä" u2="Y" k="123"/><hkern u1="Ä" u2="W" k="82"/><hkern u1="Ä" u2="V" k="82"/><hkern u1="Ä" u2="T" k="143"/><hkern u1="Ä" u2="Q" k="41"/><hkern u1="Ä" u2="O" k="41"/><hkern u1="Ä" u2="J" k="-266"/><hkern u1="Ä" u2="G" k="41"/><hkern u1="Ä" u2="C" k="41"/><hkern u1="Ä" u2="'" k="143"/><hkern u1="Ä" u2="&quot;" k="143"/><hkern u1="Å" u2="”" k="143"/><hkern u1="Å" u2="’" k="143"/><hkern u1="Å" u2="Ÿ" k="123"/><hkern u1="Å" u2="Œ" k="41"/><hkern u1="Å" u2="Ý" k="123"/><hkern u1="Å" u2="Ø" k="41"/><hkern u1="Å" u2="Ö" k="41"/><hkern u1="Å" u2="Õ" k="41"/><hkern u1="Å" u2="Ô" k="41"/><hkern u1="Å" u2="Ó" k="41"/><hkern u1="Å" u2="Ò" k="41"/><hkern u1="Å" u2="Ç" k="41"/><hkern u1="Å" u2="Y" k="123"/><hkern u1="Å" u2="W" k="82"/><hkern u1="Å" u2="V" k="82"/><hkern u1="Å" u2="T" k="143"/><hkern u1="Å" u2="Q" k="41"/><hkern u1="Å" u2="O" k="41"/><hkern u1="Å" u2="J" k="-266"/><hkern u1="Å" u2="G" k="41"/><hkern u1="Å" u2="C" k="41"/><hkern u1="Å" u2="'" k="143"/><hkern u1="Å" u2="&quot;" k="143"/><hkern u1="Æ" u2="J" k="-123"/><hkern u1="Ç" u2="Œ" k="41"/><hkern u1="Ç" u2="Ø" k="41"/><hkern u1="Ç" u2="Ö" k="41"/><hkern u1="Ç" u2="Õ" k="41"/><hkern u1="Ç" u2="Ô" k="41"/><hkern u1="Ç" u2="Ó" k="41"/><hkern u1="Ç" u2="Ò" k="41"/><hkern u1="Ç" u2="Ç" k="41"/><hkern u1="Ç" u2="Q" k="41"/><hkern u1="Ç" u2="O" k="41"/><hkern u1="Ç" u2="G" k="41"/><hkern u1="Ç" u2="C" k="41"/><hkern u1="È" u2="J" k="-123"/><hkern u1="É" u2="J" k="-123"/><hkern u1="Ê" u2="J" k="-123"/><hkern u1="Ë" u2="J" k="-123"/><hkern u1="Ð" u2="„" k="82"/><hkern u1="Ð" u2="‚" k="82"/><hkern u1="Ð" u2="Ÿ" k="20"/><hkern u1="Ð" u2="Ý" k="20"/><hkern u1="Ð" u2="Å" k="41"/><hkern u1="Ð" u2="Ä" k="41"/><hkern u1="Ð" u2="Ã" k="41"/><hkern u1="Ð" u2="Â" k="41"/><hkern u1="Ð" u2="Á" k="41"/><hkern u1="Ð" u2="À" k="41"/><hkern u1="Ð" u2="Z" k="20"/><hkern u1="Ð" u2="Y" k="20"/><hkern u1="Ð" u2="X" k="41"/><hkern u1="Ð" u2="W" k="20"/><hkern u1="Ð" u2="V" k="20"/><hkern u1="Ð" u2="T" k="61"/><hkern u1="Ð" u2="A" k="41"/><hkern u1="Ð" u2="." k="82"/><hkern u1="Ð" u2="," k="82"/><hkern u1="Ò" u2="„" k="82"/><hkern u1="Ò" u2="‚" k="82"/><hkern u1="Ò" u2="Ÿ" k="20"/><hkern u1="Ò" u2="Ý" k="20"/><hkern u1="Ò" u2="Å" k="41"/><hkern u1="Ò" u2="Ä" k="41"/><hkern u1="Ò" u2="Ã" k="41"/><hkern u1="Ò" u2="Â" k="41"/><hkern u1="Ò" u2="Á" k="41"/><hkern u1="Ò" u2="À" k="41"/><hkern u1="Ò" u2="Z" k="20"/><hkern u1="Ò" u2="Y" k="20"/><hkern u1="Ò" u2="X" k="41"/><hkern u1="Ò" u2="W" k="20"/><hkern u1="Ò" u2="V" k="20"/><hkern u1="Ò" u2="T" k="61"/><hkern u1="Ò" u2="A" k="41"/><hkern u1="Ò" u2="." k="82"/><hkern u1="Ò" u2="," k="82"/><hkern u1="Ó" u2="„" k="82"/><hkern u1="Ó" u2="‚" k="82"/><hkern u1="Ó" u2="Ÿ" k="20"/><hkern u1="Ó" u2="Ý" k="20"/><hkern u1="Ó" u2="Å" k="41"/><hkern u1="Ó" u2="Ä" k="41"/><hkern u1="Ó" u2="Ã" k="41"/><hkern u1="Ó" u2="Â" k="41"/><hkern u1="Ó" u2="Á" k="41"/><hkern u1="Ó" u2="À" k="41"/><hkern u1="Ó" u2="Z" k="20"/><hkern u1="Ó" u2="Y" k="20"/><hkern u1="Ó" u2="X" k="41"/><hkern u1="Ó" u2="W" k="20"/><hkern u1="Ó" u2="V" k="20"/><hkern u1="Ó" u2="T" k="61"/><hkern u1="Ó" u2="A" k="41"/><hkern u1="Ó" u2="." k="82"/><hkern u1="Ó" u2="," k="82"/><hkern u1="Ô" u2="„" k="82"/><hkern u1="Ô" u2="‚" k="82"/><hkern u1="Ô" u2="Ÿ" k="20"/><hkern u1="Ô" u2="Ý" k="20"/><hkern u1="Ô" u2="Å" k="41"/><hkern u1="Ô" u2="Ä" k="41"/><hkern u1="Ô" u2="Ã" k="41"/><hkern u1="Ô" u2="Â" k="41"/><hkern u1="Ô" u2="Á" k="41"/><hkern u1="Ô" u2="À" k="41"/><hkern u1="Ô" u2="Z" k="20"/><hkern u1="Ô" u2="Y" k="20"/><hkern u1="Ô" u2="X" k="41"/><hkern u1="Ô" u2="W" k="20"/><hkern u1="Ô" u2="V" k="20"/><hkern u1="Ô" u2="T" k="61"/><hkern u1="Ô" u2="A" k="41"/><hkern u1="Ô" u2="." k="82"/><hkern u1="Ô" u2="," k="82"/><hkern u1="Õ" u2="„" k="82"/><hkern u1="Õ" u2="‚" k="82"/><hkern u1="Õ" u2="Ÿ" k="20"/><hkern u1="Õ" u2="Ý" k="20"/><hkern u1="Õ" u2="Å" k="41"/><hkern u1="Õ" u2="Ä" k="41"/><hkern u1="Õ" u2="Ã" k="41"/><hkern u1="Õ" u2="Â" k="41"/><hkern u1="Õ" u2="Á" k="41"/><hkern u1="Õ" u2="À" k="41"/><hkern u1="Õ" u2="Z" k="20"/><hkern u1="Õ" u2="Y" k="20"/><hkern u1="Õ" u2="X" k="41"/><hkern u1="Õ" u2="W" k="20"/><hkern u1="Õ" u2="V" k="20"/><hkern u1="Õ" u2="T" k="61"/><hkern u1="Õ" u2="A" k="41"/><hkern u1="Õ" u2="." k="82"/><hkern u1="Õ" u2="," k="82"/><hkern u1="Ö" u2="„" k="82"/><hkern u1="Ö" u2="‚" k="82"/><hkern u1="Ö" u2="Ÿ" k="20"/><hkern u1="Ö" u2="Ý" k="20"/><hkern u1="Ö" u2="Å" k="41"/><hkern u1="Ö" u2="Ä" k="41"/><hkern u1="Ö" u2="Ã" k="41"/><hkern u1="Ö" u2="Â" k="41"/><hkern u1="Ö" u2="Á" k="41"/><hkern u1="Ö" u2="À" k="41"/><hkern u1="Ö" u2="Z" k="20"/><hkern u1="Ö" u2="Y" k="20"/><hkern u1="Ö" u2="X" k="41"/><hkern u1="Ö" u2="W" k="20"/><hkern u1="Ö" u2="V" k="20"/><hkern u1="Ö" u2="T" k="61"/><hkern u1="Ö" u2="A" k="41"/><hkern u1="Ö" u2="." k="82"/><hkern u1="Ö" u2="," k="82"/><hkern u1="Ø" u2="„" k="82"/><hkern u1="Ø" u2="‚" k="82"/><hkern u1="Ø" u2="Ÿ" k="20"/><hkern u1="Ø" u2="Ý" k="20"/><hkern u1="Ø" u2="Å" k="41"/><hkern u1="Ø" u2="Ä" k="41"/><hkern u1="Ø" u2="Ã" k="41"/><hkern u1="Ø" u2="Â" k="41"/><hkern u1="Ø" u2="Á" k="41"/><hkern u1="Ø" u2="À" k="41"/><hkern u1="Ø" u2="Z" k="20"/><hkern u1="Ø" u2="Y" k="20"/><hkern u1="Ø" u2="X" k="41"/><hkern u1="Ø" u2="W" k="20"/><hkern u1="Ø" u2="V" k="20"/><hkern u1="Ø" u2="T" k="61"/><hkern u1="Ø" u2="A" k="41"/><hkern u1="Ø" u2="." k="82"/><hkern u1="Ø" u2="," k="82"/><hkern u1="Ù" u2="„" k="41"/><hkern u1="Ù" u2="‚" k="41"/><hkern u1="Ù" u2="Å" k="20"/><hkern u1="Ù" u2="Ä" k="20"/><hkern u1="Ù" u2="Ã" k="20"/><hkern u1="Ù" u2="Â" k="20"/><hkern u1="Ù" u2="Á" k="20"/><hkern u1="Ù" u2="À" k="20"/><hkern u1="Ù" u2="A" k="20"/><hkern u1="Ù" u2="." k="41"/><hkern u1="Ù" u2="," k="41"/><hkern u1="Ú" u2="„" k="41"/><hkern u1="Ú" u2="‚" k="41"/><hkern u1="Ú" u2="Å" k="20"/><hkern u1="Ú" u2="Ä" k="20"/><hkern u1="Ú" u2="Ã" k="20"/><hkern u1="Ú" u2="Â" k="20"/><hkern u1="Ú" u2="Á" k="20"/><hkern u1="Ú" u2="À" k="20"/><hkern u1="Ú" u2="A" k="20"/><hkern u1="Ú" u2="." k="41"/><hkern u1="Ú" u2="," k="41"/><hkern u1="Û" u2="„" k="41"/><hkern u1="Û" u2="‚" k="41"/><hkern u1="Û" u2="Å" k="20"/><hkern u1="Û" u2="Ä" k="20"/><hkern u1="Û" u2="Ã" k="20"/><hkern u1="Û" u2="Â" k="20"/><hkern u1="Û" u2="Á" k="20"/><hkern u1="Û" u2="À" k="20"/><hkern u1="Û" u2="A" k="20"/><hkern u1="Û" u2="." k="41"/><hkern u1="Û" u2="," k="41"/><hkern u1="Ü" u2="„" k="41"/><hkern u1="Ü" u2="‚" k="41"/><hkern u1="Ü" u2="Å" k="20"/><hkern u1="Ü" u2="Ä" k="20"/><hkern u1="Ü" u2="Ã" k="20"/><hkern u1="Ü" u2="Â" k="20"/><hkern u1="Ü" u2="Á" k="20"/><hkern u1="Ü" u2="À" k="20"/><hkern u1="Ü" u2="A" k="20"/><hkern u1="Ü" u2="." k="41"/><hkern u1="Ü" u2="," k="41"/><hkern u1="Ý" u2="„" k="123"/><hkern u1="Ý" u2="‚" k="123"/><hkern u1="Ý" u2="œ" k="102"/><hkern u1="Ý" u2="Œ" k="41"/><hkern u1="Ý" u2="ü" k="61"/><hkern u1="Ý" u2="û" k="61"/><hkern u1="Ý" u2="ú" k="61"/><hkern u1="Ý" u2="ù" k="61"/><hkern u1="Ý" u2="ø" k="102"/><hkern u1="Ý" u2="ö" k="102"/><hkern u1="Ý" u2="õ" k="102"/><hkern u1="Ý" u2="ô" k="102"/><hkern u1="Ý" u2="ó" k="102"/><hkern u1="Ý" u2="ò" k="102"/><hkern u1="Ý" u2="ë" k="102"/><hkern u1="Ý" u2="ê" k="102"/><hkern u1="Ý" u2="é" k="102"/><hkern u1="Ý" u2="è" k="102"/><hkern u1="Ý" u2="ç" k="102"/><hkern u1="Ý" u2="æ" k="102"/><hkern u1="Ý" u2="å" k="102"/><hkern u1="Ý" u2="ä" k="102"/><hkern u1="Ý" u2="ã" k="102"/><hkern u1="Ý" u2="â" k="102"/><hkern u1="Ý" u2="á" k="102"/><hkern u1="Ý" u2="à" k="102"/><hkern u1="Ý" u2="Ø" k="41"/><hkern u1="Ý" u2="Ö" k="41"/><hkern u1="Ý" u2="Õ" k="41"/><hkern u1="Ý" u2="Ô" k="41"/><hkern u1="Ý" u2="Ó" k="41"/><hkern u1="Ý" u2="Ò" k="41"/><hkern u1="Ý" u2="Ç" k="41"/><hkern u1="Ý" u2="Å" k="123"/><hkern u1="Ý" u2="Ä" k="123"/><hkern u1="Ý" u2="Ã" k="123"/><hkern u1="Ý" u2="Â" k="123"/><hkern u1="Ý" u2="Á" k="123"/><hkern u1="Ý" u2="À" k="123"/><hkern u1="Ý" u2="z" k="41"/><hkern u1="Ý" u2="u" k="61"/><hkern u1="Ý" u2="s" k="82"/><hkern u1="Ý" u2="r" k="61"/><hkern u1="Ý" u2="q" k="102"/><hkern u1="Ý" u2="p" k="61"/><hkern u1="Ý" u2="o" k="102"/><hkern u1="Ý" u2="n" k="61"/><hkern u1="Ý" u2="m" k="61"/><hkern u1="Ý" u2="g" k="41"/><hkern u1="Ý" u2="e" k="102"/><hkern u1="Ý" u2="d" k="102"/><hkern u1="Ý" u2="c" k="102"/><hkern u1="Ý" u2="a" k="102"/><hkern u1="Ý" u2="Q" k="41"/><hkern u1="Ý" u2="O" k="41"/><hkern u1="Ý" u2="G" k="41"/><hkern u1="Ý" u2="C" k="41"/><hkern u1="Ý" u2="A" k="123"/><hkern u1="Ý" u2="?" k="-41"/><hkern u1="Ý" u2="." k="123"/><hkern u1="Ý" u2="," k="123"/><hkern u1="Þ" u2="„" k="266"/><hkern u1="Þ" u2="‚" k="266"/><hkern u1="Þ" u2="Å" k="102"/><hkern u1="Þ" u2="Ä" k="102"/><hkern u1="Þ" u2="Ã" k="102"/><hkern u1="Þ" u2="Â" k="102"/><hkern u1="Þ" u2="Á" k="102"/><hkern u1="Þ" u2="À" k="102"/><hkern u1="Þ" u2="Z" k="20"/><hkern u1="Þ" u2="X" k="41"/><hkern u1="Þ" u2="A" k="102"/><hkern u1="Þ" u2="." k="266"/><hkern u1="Þ" u2="," k="266"/><hkern u1="à" u2="”" k="20"/><hkern u1="à" u2="’" k="20"/><hkern u1="à" u2="'" k="20"/><hkern u1="à" u2="&quot;" k="20"/><hkern u1="á" u2="”" k="20"/><hkern u1="á" u2="’" k="20"/><hkern u1="á" u2="'" k="20"/><hkern u1="á" u2="&quot;" k="20"/><hkern u1="â" u2="”" k="20"/><hkern u1="â" u2="’" k="20"/><hkern u1="â" u2="'" k="20"/><hkern u1="â" u2="&quot;" k="20"/><hkern u1="ã" u2="”" k="20"/><hkern u1="ã" u2="’" k="20"/><hkern u1="ã" u2="'" k="20"/><hkern u1="ã" u2="&quot;" k="20"/><hkern u1="ä" u2="”" k="20"/><hkern u1="ä" u2="’" k="20"/><hkern u1="ä" u2="'" k="20"/><hkern u1="ä" u2="&quot;" k="20"/><hkern u1="å" u2="”" k="20"/><hkern u1="å" u2="’" k="20"/><hkern u1="å" u2="'" k="20"/><hkern u1="å" u2="&quot;" k="20"/><hkern u1="è" u2="”" k="20"/><hkern u1="è" u2="’" k="20"/><hkern u1="è" u2="ý" k="41"/><hkern u1="è" u2="z" k="20"/><hkern u1="è" u2="y" k="41"/><hkern u1="è" u2="x" k="41"/><hkern u1="è" u2="w" k="41"/><hkern u1="è" u2="v" k="41"/><hkern u1="è" u2="'" k="20"/><hkern u1="è" u2="&quot;" k="20"/><hkern u1="é" u2="”" k="20"/><hkern u1="é" u2="’" k="20"/><hkern u1="é" u2="ý" k="41"/><hkern u1="é" u2="z" k="20"/><hkern u1="é" u2="y" k="41"/><hkern u1="é" u2="x" k="41"/><hkern u1="é" u2="w" k="41"/><hkern u1="é" u2="v" k="41"/><hkern u1="é" u2="'" k="20"/><hkern u1="é" u2="&quot;" k="20"/><hkern u1="ê" u2="”" k="20"/><hkern u1="ê" u2="’" k="20"/><hkern u1="ê" u2="ý" k="41"/><hkern u1="ê" u2="z" k="20"/><hkern u1="ê" u2="y" k="41"/><hkern u1="ê" u2="x" k="41"/><hkern u1="ê" u2="w" k="41"/><hkern u1="ê" u2="v" k="41"/><hkern u1="ê" u2="'" k="20"/><hkern u1="ê" u2="&quot;" k="20"/><hkern u1="ë" u2="”" k="20"/><hkern u1="ë" u2="’" k="20"/><hkern u1="ë" u2="ý" k="41"/><hkern u1="ë" u2="z" k="20"/><hkern u1="ë" u2="y" k="41"/><hkern u1="ë" u2="x" k="41"/><hkern u1="ë" u2="w" k="41"/><hkern u1="ë" u2="v" k="41"/><hkern u1="ë" u2="'" k="20"/><hkern u1="ë" u2="&quot;" k="20"/><hkern u1="ð" u2="”" k="20"/><hkern u1="ð" u2="’" k="20"/><hkern u1="ð" u2="ý" k="41"/><hkern u1="ð" u2="z" k="20"/><hkern u1="ð" u2="y" k="41"/><hkern u1="ð" u2="x" k="41"/><hkern u1="ð" u2="w" k="41"/><hkern u1="ð" u2="v" k="41"/><hkern u1="ð" u2="'" k="20"/><hkern u1="ð" u2="&quot;" k="20"/><hkern u1="ò" u2="”" k="20"/><hkern u1="ò" u2="’" k="20"/><hkern u1="ò" u2="ý" k="41"/><hkern u1="ò" u2="z" k="20"/><hkern u1="ò" u2="y" k="41"/><hkern u1="ò" u2="x" k="41"/><hkern u1="ò" u2="w" k="41"/><hkern u1="ò" u2="v" k="41"/><hkern u1="ò" u2="'" k="20"/><hkern u1="ò" u2="&quot;" k="20"/><hkern u1="ó" u2="”" k="20"/><hkern u1="ó" u2="’" k="20"/><hkern u1="ó" u2="ý" k="41"/><hkern u1="ó" u2="z" k="20"/><hkern u1="ó" u2="y" k="41"/><hkern u1="ó" u2="x" k="41"/><hkern u1="ó" u2="w" k="41"/><hkern u1="ó" u2="v" k="41"/><hkern u1="ó" u2="'" k="20"/><hkern u1="ó" u2="&quot;" k="20"/><hkern u1="ô" u2="”" k="20"/><hkern u1="ô" u2="’" k="20"/><hkern u1="ô" u2="ý" k="41"/><hkern u1="ô" u2="z" k="20"/><hkern u1="ô" u2="y" k="41"/><hkern u1="ô" u2="x" k="41"/><hkern u1="ô" u2="w" k="41"/><hkern u1="ô" u2="v" k="41"/><hkern u1="ô" u2="'" k="20"/><hkern u1="ô" u2="&quot;" k="20"/><hkern u1="ö" u2="”" k="41"/><hkern u1="ö" u2="’" k="41"/><hkern u1="ö" u2="'" k="41"/><hkern u1="ö" u2="&quot;" k="41"/><hkern u1="ø" u2="”" k="20"/><hkern u1="ø" u2="’" k="20"/><hkern u1="ø" u2="ý" k="41"/><hkern u1="ø" u2="z" k="20"/><hkern u1="ø" u2="y" k="41"/><hkern u1="ø" u2="x" k="41"/><hkern u1="ø" u2="w" k="41"/><hkern u1="ø" u2="v" k="41"/><hkern u1="ø" u2="'" k="20"/><hkern u1="ø" u2="&quot;" k="20"/><hkern u1="ý" u2="„" k="82"/><hkern u1="ý" u2="”" k="-82"/><hkern u1="ý" u2="‚" k="82"/><hkern u1="ý" u2="’" k="-82"/><hkern u1="ý" u2="?" k="-41"/><hkern u1="ý" u2="." k="82"/><hkern u1="ý" u2="," k="82"/><hkern u1="ý" u2="'" k="-82"/><hkern u1="ý" u2="&quot;" k="-82"/><hkern u1="þ" u2="”" k="20"/><hkern u1="þ" u2="’" k="20"/><hkern u1="þ" u2="ý" k="41"/><hkern u1="þ" u2="z" k="20"/><hkern u1="þ" u2="y" k="41"/><hkern u1="þ" u2="x" k="41"/><hkern u1="þ" u2="w" k="41"/><hkern u1="þ" u2="v" k="41"/><hkern u1="þ" u2="'" k="20"/><hkern u1="þ" u2="&quot;" k="20"/><hkern u1="ÿ" u2="„" k="82"/><hkern u1="ÿ" u2="”" k="-82"/><hkern u1="ÿ" u2="‚" k="82"/><hkern u1="ÿ" u2="’" k="-82"/><hkern u1="ÿ" u2="?" k="-41"/><hkern u1="ÿ" u2="." k="82"/><hkern u1="ÿ" u2="," k="82"/><hkern u1="ÿ" u2="'" k="-82"/><hkern u1="ÿ" u2="&quot;" k="-82"/><hkern u1="Œ" u2="J" k="-123"/><hkern u1="Ÿ" u2="„" k="123"/><hkern u1="Ÿ" u2="‚" k="123"/><hkern u1="Ÿ" u2="œ" k="102"/><hkern u1="Ÿ" u2="Œ" k="41"/><hkern u1="Ÿ" u2="ü" k="61"/><hkern u1="Ÿ" u2="û" k="61"/><hkern u1="Ÿ" u2="ú" k="61"/><hkern u1="Ÿ" u2="ù" k="61"/><hkern u1="Ÿ" u2="ø" k="102"/><hkern u1="Ÿ" u2="ö" k="102"/><hkern u1="Ÿ" u2="õ" k="102"/><hkern u1="Ÿ" u2="ô" k="102"/><hkern u1="Ÿ" u2="ó" k="102"/><hkern u1="Ÿ" u2="ò" k="102"/><hkern u1="Ÿ" u2="ë" k="102"/><hkern u1="Ÿ" u2="ê" k="102"/><hkern u1="Ÿ" u2="é" k="102"/><hkern u1="Ÿ" u2="è" k="102"/><hkern u1="Ÿ" u2="ç" k="102"/><hkern u1="Ÿ" u2="æ" k="102"/><hkern u1="Ÿ" u2="å" k="102"/><hkern u1="Ÿ" u2="ä" k="102"/><hkern u1="Ÿ" u2="ã" k="102"/><hkern u1="Ÿ" u2="â" k="102"/><hkern u1="Ÿ" u2="á" k="102"/><hkern u1="Ÿ" u2="à" k="102"/><hkern u1="Ÿ" u2="Ø" k="41"/><hkern u1="Ÿ" u2="Ö" k="41"/><hkern u1="Ÿ" u2="Õ" k="41"/><hkern u1="Ÿ" u2="Ô" k="41"/><hkern u1="Ÿ" u2="Ó" k="41"/><hkern u1="Ÿ" u2="Ò" k="41"/><hkern u1="Ÿ" u2="Ç" k="41"/><hkern u1="Ÿ" u2="Å" k="123"/><hkern u1="Ÿ" u2="Ä" k="123"/><hkern u1="Ÿ" u2="Ã" k="123"/><hkern u1="Ÿ" u2="Â" k="123"/><hkern u1="Ÿ" u2="Á" k="123"/><hkern u1="Ÿ" u2="À" k="123"/><hkern u1="Ÿ" u2="z" k="41"/><hkern u1="Ÿ" u2="u" k="61"/><hkern u1="Ÿ" u2="s" k="82"/><hkern u1="Ÿ" u2="r" k="61"/><hkern u1="Ÿ" u2="q" k="102"/><hkern u1="Ÿ" u2="p" k="61"/><hkern u1="Ÿ" u2="o" k="102"/><hkern u1="Ÿ" u2="n" k="61"/><hkern u1="Ÿ" u2="m" k="61"/><hkern u1="Ÿ" u2="g" k="41"/><hkern u1="Ÿ" u2="e" k="102"/><hkern u1="Ÿ" u2="d" k="102"/><hkern u1="Ÿ" u2="c" k="102"/><hkern u1="Ÿ" u2="a" k="102"/><hkern u1="Ÿ" u2="Q" k="41"/><hkern u1="Ÿ" u2="O" k="41"/><hkern u1="Ÿ" u2="G" k="41"/><hkern u1="Ÿ" u2="C" k="41"/><hkern u1="Ÿ" u2="A" k="123"/><hkern u1="Ÿ" u2="?" k="-41"/><hkern u1="Ÿ" u2="." k="123"/><hkern u1="Ÿ" u2="," k="123"/><hkern u1="–" u2="T" k="82"/><hkern u1="—" u2="T" k="82"/><hkern u1="‘" u2="Ÿ" k="-20"/><hkern u1="‘" u2="œ" k="123"/><hkern u1="‘" u2="ü" k="61"/><hkern u1="‘" u2="û" k="61"/><hkern u1="‘" u2="ú" k="61"/><hkern u1="‘" u2="ù" k="61"/><hkern u1="‘" u2="ø" k="123"/><hkern u1="‘" u2="ö" k="123"/><hkern u1="‘" u2="õ" k="123"/><hkern u1="‘" u2="ô" k="123"/><hkern u1="‘" u2="ó" k="123"/><hkern u1="‘" u2="ò" k="123"/><hkern u1="‘" u2="ë" k="123"/><hkern u1="‘" u2="ê" k="123"/><hkern u1="‘" u2="é" k="123"/><hkern u1="‘" u2="è" k="123"/><hkern u1="‘" u2="ç" k="123"/><hkern u1="‘" u2="æ" k="82"/><hkern u1="‘" u2="å" k="82"/><hkern u1="‘" u2="ä" k="82"/><hkern u1="‘" u2="ã" k="82"/><hkern u1="‘" u2="â" k="82"/><hkern u1="‘" u2="á" k="82"/><hkern u1="‘" u2="à" k="123"/><hkern u1="‘" u2="Ý" k="-20"/><hkern u1="‘" u2="Å" k="143"/><hkern u1="‘" u2="Ä" k="143"/><hkern u1="‘" u2="Ã" k="143"/><hkern u1="‘" u2="Â" k="143"/><hkern u1="‘" u2="Á" k="143"/><hkern u1="‘" u2="À" k="143"/><hkern u1="‘" u2="u" k="61"/><hkern u1="‘" u2="s" k="61"/><hkern u1="‘" u2="r" k="61"/><hkern u1="‘" u2="q" k="123"/><hkern u1="‘" u2="p" k="61"/><hkern u1="‘" u2="o" k="123"/><hkern u1="‘" u2="n" k="61"/><hkern u1="‘" u2="m" k="61"/><hkern u1="‘" u2="g" k="61"/><hkern u1="‘" u2="e" k="123"/><hkern u1="‘" u2="d" k="123"/><hkern u1="‘" u2="c" k="123"/><hkern u1="‘" u2="a" k="82"/><hkern u1="‘" u2="Y" k="-20"/><hkern u1="‘" u2="W" k="-41"/><hkern u1="‘" u2="V" k="-41"/><hkern u1="‘" u2="T" k="-41"/><hkern u1="‘" u2="A" k="143"/><hkern u1="’" u2="Ÿ" k="-20"/><hkern u1="’" u2="œ" k="123"/><hkern u1="’" u2="ü" k="61"/><hkern u1="’" u2="û" k="61"/><hkern u1="’" u2="ú" k="61"/><hkern u1="’" u2="ù" k="61"/><hkern u1="’" u2="ø" k="123"/><hkern u1="’" u2="ö" k="123"/><hkern u1="’" u2="õ" k="123"/><hkern u1="’" u2="ô" k="123"/><hkern u1="’" u2="ó" k="123"/><hkern u1="’" u2="ò" k="123"/><hkern u1="’" u2="ë" k="123"/><hkern u1="’" u2="ê" k="123"/><hkern u1="’" u2="é" k="123"/><hkern u1="’" u2="è" k="123"/><hkern u1="’" u2="ç" k="123"/><hkern u1="’" u2="æ" k="82"/><hkern u1="’" u2="å" k="82"/><hkern u1="’" u2="ä" k="82"/><hkern u1="’" u2="ã" k="82"/><hkern u1="’" u2="â" k="82"/><hkern u1="’" u2="á" k="82"/><hkern u1="’" u2="à" k="123"/><hkern u1="’" u2="Ý" k="-20"/><hkern u1="’" u2="Å" k="143"/><hkern u1="’" u2="Ä" k="143"/><hkern u1="’" u2="Ã" k="143"/><hkern u1="’" u2="Â" k="143"/><hkern u1="’" u2="Á" k="143"/><hkern u1="’" u2="À" k="143"/><hkern u1="’" u2="u" k="61"/><hkern u1="’" u2="s" k="61"/><hkern u1="’" u2="r" k="61"/><hkern u1="’" u2="q" k="123"/><hkern u1="’" u2="p" k="61"/><hkern u1="’" u2="o" k="123"/><hkern u1="’" u2="n" k="61"/><hkern u1="’" u2="m" k="61"/><hkern u1="’" u2="g" k="61"/><hkern u1="’" u2="e" k="123"/><hkern u1="’" u2="d" k="123"/><hkern u1="’" u2="c" k="123"/><hkern u1="’" u2="a" k="82"/><hkern u1="’" u2="Y" k="-20"/><hkern u1="’" u2="W" k="-41"/><hkern u1="’" u2="V" k="-41"/><hkern u1="’" u2="T" k="-41"/><hkern u1="’" u2="A" k="143"/><hkern u1="‚" u2="Ÿ" k="123"/><hkern u1="‚" u2="Œ" k="102"/><hkern u1="‚" u2="Ý" k="123"/><hkern u1="‚" u2="Ü" k="41"/><hkern u1="‚" u2="Û" k="41"/><hkern u1="‚" u2="Ú" k="41"/><hkern u1="‚" u2="Ù" k="41"/><hkern u1="‚" u2="Ø" k="102"/><hkern u1="‚" u2="Ö" k="102"/><hkern u1="‚" u2="Õ" k="102"/><hkern u1="‚" u2="Ô" k="102"/><hkern u1="‚" u2="Ó" k="102"/><hkern u1="‚" u2="Ò" k="102"/><hkern u1="‚" u2="Ç" k="102"/><hkern u1="‚" u2="Y" k="123"/><hkern u1="‚" u2="W" k="123"/><hkern u1="‚" u2="V" k="123"/><hkern u1="‚" u2="U" k="41"/><hkern u1="‚" u2="T" k="143"/><hkern u1="‚" u2="Q" k="102"/><hkern u1="‚" u2="O" k="102"/><hkern u1="‚" u2="G" k="102"/><hkern u1="‚" u2="C" k="102"/><hkern u1="“" u2="Ÿ" k="-20"/><hkern u1="“" u2="œ" k="123"/><hkern u1="“" u2="ü" k="61"/><hkern u1="“" u2="û" k="61"/><hkern u1="“" u2="ú" k="61"/><hkern u1="“" u2="ù" k="61"/><hkern u1="“" u2="ø" k="123"/><hkern u1="“" u2="ö" k="123"/><hkern u1="“" u2="õ" k="123"/><hkern u1="“" u2="ô" k="123"/><hkern u1="“" u2="ó" k="123"/><hkern u1="“" u2="ò" k="123"/><hkern u1="“" u2="ë" k="123"/><hkern u1="“" u2="ê" k="123"/><hkern u1="“" u2="é" k="123"/><hkern u1="“" u2="è" k="123"/><hkern u1="“" u2="ç" k="123"/><hkern u1="“" u2="æ" k="82"/><hkern u1="“" u2="å" k="82"/><hkern u1="“" u2="ä" k="82"/><hkern u1="“" u2="ã" k="82"/><hkern u1="“" u2="â" k="82"/><hkern u1="“" u2="á" k="82"/><hkern u1="“" u2="à" k="123"/><hkern u1="“" u2="Ý" k="-20"/><hkern u1="“" u2="Å" k="143"/><hkern u1="“" u2="Ä" k="143"/><hkern u1="“" u2="Ã" k="143"/><hkern u1="“" u2="Â" k="143"/><hkern u1="“" u2="Á" k="143"/><hkern u1="“" u2="À" k="143"/><hkern u1="“" u2="u" k="61"/><hkern u1="“" u2="s" k="61"/><hkern u1="“" u2="r" k="61"/><hkern u1="“" u2="q" k="123"/><hkern u1="“" u2="p" k="61"/><hkern u1="“" u2="o" k="123"/><hkern u1="“" u2="n" k="61"/><hkern u1="“" u2="m" k="61"/><hkern u1="“" u2="g" k="61"/><hkern u1="“" u2="e" k="123"/><hkern u1="“" u2="d" k="123"/><hkern u1="“" u2="c" k="123"/><hkern u1="“" u2="a" k="82"/><hkern u1="“" u2="Y" k="-20"/><hkern u1="“" u2="W" k="-41"/><hkern u1="“" u2="V" k="-41"/><hkern u1="“" u2="T" k="-41"/><hkern u1="“" u2="A" k="143"/><hkern u1="„" u2="Ÿ" k="123"/><hkern u1="„" u2="Œ" k="102"/><hkern u1="„" u2="Ý" k="123"/><hkern u1="„" u2="Ü" k="41"/><hkern u1="„" u2="Û" k="41"/><hkern u1="„" u2="Ú" k="41"/><hkern u1="„" u2="Ù" k="41"/><hkern u1="„" u2="Ø" k="102"/><hkern u1="„" u2="Ö" k="102"/><hkern u1="„" u2="Õ" k="102"/><hkern u1="„" u2="Ô" k="102"/><hkern u1="„" u2="Ó" k="102"/><hkern u1="„" u2="Ò" k="102"/><hkern u1="„" u2="Ç" k="102"/><hkern u1="„" u2="Y" k="123"/><hkern u1="„" u2="W" k="123"/><hkern u1="„" u2="V" k="123"/><hkern u1="„" u2="U" k="41"/><hkern u1="„" u2="T" k="143"/><hkern u1="„" u2="Q" k="102"/><hkern u1="„" u2="O" k="102"/><hkern u1="„" u2="G" k="102"/><hkern u1="„" u2="C" k="102"/></font></defs></svg> \ No newline at end of file diff --git a/setup/pub/fonts/opensans/bold/opensans-700.ttf b/setup/pub/fonts/opensans/bold/opensans-700.ttf deleted file mode 100644 index 2109c958e3c5c..0000000000000 Binary files a/setup/pub/fonts/opensans/bold/opensans-700.ttf and /dev/null differ diff --git a/setup/pub/fonts/opensans/bold/opensans-700.woff b/setup/pub/fonts/opensans/bold/opensans-700.woff deleted file mode 100644 index 1205787b0ed50..0000000000000 Binary files a/setup/pub/fonts/opensans/bold/opensans-700.woff and /dev/null differ diff --git a/setup/pub/fonts/opensans/bold/opensans-700.woff2 b/setup/pub/fonts/opensans/bold/opensans-700.woff2 deleted file mode 100644 index f3f0160bc8d06..0000000000000 Binary files a/setup/pub/fonts/opensans/bold/opensans-700.woff2 and /dev/null differ diff --git a/setup/pub/fonts/opensans/light/opensans-300.eot b/setup/pub/fonts/opensans/light/opensans-300.eot deleted file mode 100644 index 14868406aa7d7..0000000000000 Binary files a/setup/pub/fonts/opensans/light/opensans-300.eot and /dev/null differ diff --git a/setup/pub/fonts/opensans/light/opensans-300.svg b/setup/pub/fonts/opensans/light/opensans-300.svg deleted file mode 100644 index efddfe75be637..0000000000000 --- a/setup/pub/fonts/opensans/light/opensans-300.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg"><defs><font horiz-adv-x="1169"><font-face units-per-em="2048" ascent="1638" descent="-410"/><glyph unicode="fi" horiz-adv-x="1077" d="M29 0zm557 1001H330V0h-99v1001H29v58l202 37v84q0 200 73.5 293.5T545 1567q90 0 180-27l-23-86q-80 25-159 25-116 0-164.5-68.5T330 1188v-101h256v-86zM895 0h-99v1087h99V0zM782 1389q0 96 63 96 31 0 48.5-25t17.5-71q0-45-17.5-71t-48.5-26q-63 0-63 97z"/><glyph unicode="fl" horiz-adv-x="1077" d="M29 0zm557 1001H330V0h-99v1001H29v58l202 37v84q0 200 73.5 293.5T545 1567q90 0 180-27l-23-86q-80 25-159 25-116 0-164.5-68.5T330 1188v-101h256v-86zM895 0h-99v1556h99V0z"/><glyph unicode="ffi" horiz-adv-x="1692" d="M29 0zm557 1001H330V0h-99v1001H29v58l202 37v84q0 200 73.5 293.5T545 1567q90 0 180-27l-23-86q-80 25-159 25-116 0-164.5-68.5T330 1188v-101h256v-86zm614 0H944V0h-99v1001H643v58l202 37v84q0 200 73.5 293.5T1159 1567q90 0 180-27l-23-86q-80 25-159 25-116 0-164.5-68.5T944 1188v-101h256v-86zM1510 0h-99v1087h99V0zm-113 1389q0 96 63 96 31 0 48.5-25t17.5-71q0-45-17.5-71t-48.5-26q-63 0-63 97z"/><glyph unicode="ffl" horiz-adv-x="1692" d="M29 0zm557 1001H330V0h-99v1001H29v58l202 37v84q0 200 73.5 293.5T545 1567q90 0 180-27l-23-86q-80 25-159 25-116 0-164.5-68.5T330 1188v-101h256v-86zm614 0H944V0h-99v1001H643v58l202 37v84q0 200 73.5 293.5T1159 1567q90 0 180-27l-23-86q-80 25-159 25-116 0-164.5-68.5T944 1188v-101h256v-86zM1510 0h-99v1556h99V0z"/><glyph horiz-adv-x="2048"/><glyph horiz-adv-x="2048"/><glyph horiz-adv-x="1044"/><glyph horiz-adv-x="532"/><glyph horiz-adv-x="532"/><glyph horiz-adv-x="532"/><glyph unicode="!" horiz-adv-x="492" d="M276 377h-61l-29 1085h119zM164 78q0 98 80 98 82 0 82-98t-82-98q-80 0-80 98z"/><glyph unicode="&quot;" horiz-adv-x="723" d="M260 1462l-33-528h-61l-33 528h127zm330 0l-33-528h-61l-33 528h127z"/><glyph unicode="#" horiz-adv-x="1323" d="M967 928l-76-398h303v-79H874L788 0h-90l88 451H426L340 0h-88l86 451H55v79h299l76 398H133v80h311l86 454h91l-89-454h365l88 454h86l-88-454h285v-80H967zM440 530h363l78 398H518z"/><glyph unicode="$" d="M991 440q0-133-99-217T618 117v-236h-81v232q-92 2-200.5 22.5T164 186v103q75-36 179.5-61T537 203v508q-145 44-215 88T220 903t-32 146q0 124 94.5 208.5T537 1362v192h81v-190q197-9 351-72l-33-90q-141 62-318 72V788q213-66 293-144t80-204zm-110 4q0 85-63 140.5T618 680V209q122 13 192.5 75T881 444zm-584 605q0-86 57-141t183-93v453q-119-16-179.5-76T297 1049z"/><glyph unicode="%" horiz-adv-x="1653" d="M211 1026q0-186 45-279.5T397 653q193 0 193 373 0 184-49.5 276.5T397 1395q-96 0-141-92.5T211 1026zm477 0q0-226-75-343.5T397 565q-133 0-208.5 120.5T113 1026q0 223 72 340t212 117q139 0 215-120.5t76-336.5zm375-588q0-185 45-277.5T1249 68q193 0 193 370 0 369-193 369-96 0-141-91.5T1063 438zm477 0q0-226-74-343.5T1251-23q-136 0-211 121.5T965 438q0 225 73.5 341T1251 895q137 0 213-120t76-337zm-260 1024L469 0h-96l811 1462h96z"/><glyph unicode="&" horiz-adv-x="1460" d="M123 371q0 138 73.5 235T471 811l-75 82q-66 71-98 139t-32 142q0 143 95.5 227t256.5 84q155 0 245.5-81t90.5-224q0-105-70-192.5T631 793l452-457q61 72 104 157t75 201h96q-63-246-209-426L1415 0h-135l-193 197q-92-90-164-131.5T765.5 2 571-20Q362-20 242.5 83T123 371zM578 70q128 0 234.5 43.5T1022 260L539 745q-136-72-196.5-122.5t-88-109.5T227 375q0-143 93-224t258-81zM373 1176q0-79 40-146t152-174q159 85 221 159t62 169q0 94-62 152.5T618 1395q-114 0-179.5-58T373 1176z"/><glyph unicode="'" horiz-adv-x="393" d="M260 1462l-33-528h-61l-33 528h127z"/><glyph unicode="(" horiz-adv-x="557" d="M82 561q0 265 77.5 496T383 1462h113q-148-182-227-412.5T190 563q0-483 304-887H383Q236-154 159 73T82 561z"/><glyph unicode=")" horiz-adv-x="557" d="M475 561q0-263-77.5-490T174-324H63Q367 80 367 563q0 257-79 487.5T61 1462h113q147-175 224-406.5T475 561z"/><glyph unicode="*" horiz-adv-x="1128" d="M631 1556l-37-405 405 104 21-131-395-39 247-340-124-71-191 379-180-379-125 71 242 340-390 39 19 131 401-104-39 405h146z"/><glyph unicode="+" d="M625 764h434v-82H625V250h-82v432H111v82h432v434h82V764z"/><glyph unicode="," horiz-adv-x="440" d="M295 238l12-21Q232-48 133-264H68q77 275 110 502h117z"/><glyph unicode="-" horiz-adv-x="659" d="M92 512v82h475v-82H92z"/><glyph unicode="." horiz-adv-x="487" d="M162 78q0 98 80 98 82 0 82-98t-82-98q-80 0-80 98z"/><glyph unicode="/" horiz-adv-x="698" d="M674 1462L129 0H25l544 1462h105z"/><glyph unicode="0" d="M1055 735q0-385-117.5-570T582-20q-229 0-348 190.5T115 735q0 382 115.5 566T582 1485q231 0 352-190.5T1055 735zm-832 0q0-340 89-502.5T582 70q189 0 275.5 168T944 735q0 324-86.5 492T582 1395t-274-168-85-492z"/><glyph unicode="1" d="M682 0h-98v1065q0 145 12 301-15-15-31-29t-309-243l-57 71 397 297h86V0z"/><glyph unicode="2" d="M1028 0H113v88l389 406q164 170 230 260t97 172 31 172q0 131-86 213t-223 82q-183 0-350-133l-54 69q183 154 406 154 191 0 300.5-102T963 1100q0-145-73.5-280.5T621 485L246 100v-4h782V0z"/><glyph unicode="3" d="M979 1118q0-136-85.5-229T664 770v-6q176-22 268-112t92-242q0-205-139.5-317.5T483-20Q260-20 94 63v99q84-44 188.5-69T479 68q221 0 332 89.5T922 410q0 145-113.5 223T475 711H317v96h160q182 0 288.5 86.5T872 1128q0 122-86.5 195.5T559 1397q-109 0-199-30.5T158 1262l-49 67q85 71 205 112.5t243 41.5q202 0 312-95.5T979 1118z"/><glyph unicode="4" d="M1141 373H889V0h-94v373H43v67l725 1030h121V459h252v-86zm-346 86v418q0 302 14 507h-8q-20-37-123-188L162 459h633z"/><glyph unicode="5" d="M537 879q234 0 368.5-113T1040 455q0-225-140-350T514-20Q405-20 307 1.5T143 63v103q108-55 192-76.5T514 68q192 0 308 101.5T938 444q0 163-113 256t-307 93q-130 0-272-39l-60 39 58 669h704v-96H338l-45-516q156 29 244 29z"/><glyph unicode="6" d="M131 623q0 285 77.5 479.5t220 288.5 343.5 94q94 0 172-23v-88q-73 27-176 27-247 0-384.5-178T229 705h13q76 98 174 148t207 50q205 0 320.5-117T1059 463q0-224-121.5-353.5T610-20q-222 0-350.5 169.5T131 623zM610 68q164 0 255 103t91 294q0 168-90 262t-245 94q-102 0-189.5-45T292 656.5 240 504q0-111 49.5-213.5t134-162.5T610 68z"/><glyph unicode="7" d="M334 0l602 1366H109v96h946v-73L451 0H334z"/><glyph unicode="8" d="M582 1487q186 0 299.5-95T995 1135q0-112-70.5-198T696 778q192-79 270-173t78-228q0-181-126.5-289T578-20Q357-20 239 81T121 375q0 131 83 230t257 169q-161 76-227 160.5T168 1137q0 105 53 184.5T369.5 1444t212.5 43zM223 360q0-138 93.5-214T578 70q164 0 264 80.5T942 369q0 124-78.5 201.5T561 733q-184-71-261-157t-77-216zm357 1037q-141 0-226.5-69.5T268 1137q0-70 31.5-123.5t91-97T590 815q163 63 234 139t71 183q0 120-84.5 190T580 1397z"/><glyph unicode="9" d="M1036 842q0-288-75.5-482t-220-287T391-20Q287-20 199 6v86q43-14 103.5-21.5T395 63q247 0 387 178.5T938 762h-12q-73-96-174-147.5T541 563q-203 0-316.5 112T111 993q0 220 124.5 356T559 1485q144 0 252-75.5T977.5 1188t58.5-346zm-477 555q-158 0-252-106.5T213 999q0-174 87-264t249-90q101 0 188.5 45t139 119.5T928 961q0 117-46.5 219t-130 159.5T559 1397z"/><glyph unicode=":" horiz-adv-x="487" d="M162 78q0 98 80 98 82 0 82-98t-82-98q-80 0-80 98zm0 893q0 98 80 98 82 0 82-98 0-53-23.5-76T242 872q-34 0-57 23t-23 76z"/><glyph unicode=";" horiz-adv-x="487" d="M303 238l12-21Q240-48 141-264H76q29 97 62 245.5T186 238h117zM162 971q0 98 80 98 82 0 82-98 0-53-23.5-76T242 872q-34 0-57 23t-23 76z"/><glyph unicode="<" d="M1059 266L111 682v61l948 474v-95L236 717l823-355v-96z"/><glyph unicode="=" d="M111 885v82h948v-82H111zm0-408v82h948v-82H111z"/><glyph unicode=">" d="M111 362l823 355-823 405v95l948-474v-61L111 266v96z"/><glyph unicode="?" horiz-adv-x="862" d="M293 377v37q0 123 37.5 201T469 782l91 79q72 61 103 121t31 138q0 127-83.5 202T391 1397q-79 0-148-17.5T94 1323l-37 80q110 48 184.5 64t153.5 16q183 0 288-98.5T788 1114q0-68-18-119t-50.5-94.5-78.5-84T539 729q-64-54-98.5-98.5t-50-93.5T375 391v-14h-82zM260 78q0 98 80 98 82 0 82-98t-82-98q-80 0-80 98z"/><glyph unicode="@" horiz-adv-x="1815" d="M1702 725q0-228-90.5-366T1366 221q-89 0-144.5 54T1157 422h-4q-43-100-124-150.5T840 221q-148 0-229 96.5T530 588q0 202 120.5 330.5T965 1047q138 0 286-41l-22-464v-30q0-104 35-156.5t116-52.5q103 0 168.5 116.5T1614 723q0 194-79 340t-225.5 224.5T975 1366q-230 0-405.5-99.5T299.5 985 205 567q0-322 167-497.5T846-106q93 0 188.5 18T1266-18v-99q-203-80-414-80-349 0-544 200.5T113 561q0 256 108.5 460.5t307 317.5T977 1452q215 0 380.5-89t255-254.5T1702 725zM633 590q0-143 55-215t174-72q255 0 273 346l16 291q-79 27-193 27-149 0-237-102.5T633 590z"/><glyph unicode="A" horiz-adv-x="1229" d="M911 516H317L113 0H0l588 1468h65L1229 0h-115zm-557 92h523l-199 527q-25 62-60 172-27-96-59-174z"/><glyph unicode="B" horiz-adv-x="1284" d="M207 1462h401q271 0 398-92t127-278q0-127-77.5-211.5T829 772v-6q175-26 257.5-110.5T1169 420q0-202-134-311T655 0H207v1462zm102-651h322q206 0 299.5 68.5T1024 1094t-105.5 212-314.5 66H309V811zm0-90V90h344q406 0 406 330 0 301-428 301H309z"/><glyph unicode="C" horiz-adv-x="1272" d="M831 1391q-275 0-433-176T240 733q0-313 149-486T815 74q184 0 338 47V31q-145-51-362-51-308 0-485 199T129 735q0 223 84.5 393t243 262.5T825 1483q214 0 383-80l-41-92q-160 80-336 80z"/><glyph unicode="D" horiz-adv-x="1446" d="M1317 745q0-368-193-556.5T557 0H207v1462h395q350 0 532.5-183T1317 745zm-111-4q0 314-159.5 472.5T578 1372H309V90h242q655 0 655 651z"/><glyph unicode="E" horiz-adv-x="1130" d="M1006 0H207v1462h799v-94H309V815h658v-94H309V94h697V0z"/><glyph unicode="F" horiz-adv-x="1028" d="M309 0H207v1462h801v-94H309V748h660v-95H309V0z"/><glyph unicode="G" horiz-adv-x="1481" d="M782 737h539V70q-212-90-477-90-346 0-530.5 195.5T129 729q0 223 91.5 395.5t262 266.5 391.5 94q239 0 429-88l-41-92q-190 88-394 88-289 0-458.5-178.5T240 733q0-330 161-496.5T874 70q202 0 343 57v514H782v96z"/><glyph unicode="H" horiz-adv-x="1473" d="M1266 0h-103v719H309V0H207v1462h102V813h854v649h103V0z"/><glyph unicode="I" horiz-adv-x="516" d="M207 0v1462h102V0H207z"/><glyph unicode="J" horiz-adv-x="506" d="M-33-369q-92 0-151 27v88q78-20 149-20 242 0 242 264v1472h102V0q0-369-342-369z"/><glyph unicode="K" horiz-adv-x="1190" d="M1190 0h-125L504 772 309 600V0H207v1462h102V702l162 162 573 598h130L575 844z"/><glyph unicode="L" horiz-adv-x="1051" d="M207 0v1462h102V96h697V0H207z"/><glyph unicode="M" horiz-adv-x="1767" d="M850 0L305 1350h-8q8-124 8-254V0h-98v1462h158L883 176h6l518 1286h154V0h-103v1108q0 116 12 240h-8L915 0h-65z"/><glyph unicode="N" horiz-adv-x="1477" d="M1270 0h-103L301 1298h-8q12-232 12-350V0h-98v1462h102l865-1296h6q-9 180-9 342v954h99V0z"/><glyph unicode="O" horiz-adv-x="1565" d="M1436 733q0-348-174-550.5T782-20q-305 0-479 202.5T129 735q0 349 175.5 549.5T784 1485q306 0 479-201.5T1436 733zm-1196 0q0-314 140-485.5T782 76q264 0 403.5 170T1325 733q0 316-139.5 484.5T784 1386q-261 0-402.5-170T240 733z"/><glyph unicode="P" horiz-adv-x="1198" d="M1087 1042q0-212-144-325T535 604H309V0H207v1462h358q522 0 522-420zM309 692h201q247 0 357 81.5T977 1038q0 169-104 250.5T551 1370H309V692z"/><glyph unicode="Q" horiz-adv-x="1565" d="M1436 733q0-294-126-486.5T961 0l333-348h-166L846-18l-33-2h-31q-305 0-479 202.5T129 735q0 349 175.5 549.5T784 1485q306 0 479-201.5T1436 733zm-1196 0q0-314 140-485.5T782 76q264 0 403.5 170T1325 733q0 316-139.5 484.5T784 1386q-261 0-402.5-170T240 733z"/><glyph unicode="R" horiz-adv-x="1217" d="M309 637V0H207v1462h348q272 0 402-100.5t130-302.5q0-147-77.5-248T774 666L1171 0h-122L672 637H309zm0 88h279q185 0 287 82.5T977 1051q0 167-100 243t-326 76H309V725z"/><glyph unicode="S" horiz-adv-x="1116" d="M1014 377q0-183-134.5-290T522-20q-268 0-411 59v102q158-67 403-67 180 0 285.5 82.5T905 373q0 83-35 137.5T756 610t-232 97q-224 77-309.5 166.5T129 1112q0 164 128.5 267.5T588 1483q206 0 387-78l-37-88q-182 76-348 76-162 0-258-75t-96-204q0-81 29.5-133t96.5-93.5T592 788q171-59 257-114.5t125.5-126T1014 377z"/><glyph unicode="T" horiz-adv-x="1073" d="M588 0H485v1366H10v96h1053v-96H588V0z"/><glyph unicode="U" horiz-adv-x="1473" d="M1282 1462V516q0-252-146-394T729-20q-254 0-396.5 142.5T190 520v942h103V516q0-211 117-328.5T741 70q209 0 324 115.5T1180 506v956h102z"/><glyph unicode="V" horiz-adv-x="1182" d="M1071 1462h111L635 0h-90L0 1462h109l368-995q84-225 113-338 20 75 79 233z"/><glyph unicode="W" horiz-adv-x="1827" d="M1372 0h-84L967 1128q-40 139-60 228-16-87-45.5-200T539 0h-86L51 1462h107l256-942q15-57 28-105.5t23.5-91 19-82T500 162q24 136 102 413l250 887h113l293-1018q51-176 73-284 13 72 33.5 153T1673 1462h103z"/><glyph unicode="X" horiz-adv-x="1102" d="M1102 0H985L553 682 113 0H0l492 762-447 700h115l395-626 401 626h109L612 764z"/><glyph unicode="Y" horiz-adv-x="1081" d="M543 662l428 800h110L594 565V0H489v557L0 1462h117z"/><glyph unicode="Z" horiz-adv-x="1180" d="M1098 0H82v76l856 1290H121v96h954v-76L217 96h881V0z"/><glyph unicode="[" horiz-adv-x="653" d="M602-324H174v1786h428v-94H272V-229h330v-95z"/><glyph unicode="\" horiz-adv-x="698" d="M127 1462L674 0H571L25 1462h102z"/><glyph unicode="]" horiz-adv-x="653" d="M51-229h330v1597H51v94h428V-324H51v95z"/><glyph unicode="^" d="M88 561l465 912h68l460-912H981l-395 791-398-791H88z"/><glyph unicode="_" horiz-adv-x="842" d="M846-266H-4v82h850v-82z"/><glyph unicode="`" horiz-adv-x="1182" d="M776 1241h-69q-96 79-188.5 171.5T393 1552v17h142q26-48 98.5-142T776 1257v-16z"/><glyph unicode="a" horiz-adv-x="1085" d="M842 0l-25 172h-8Q727 67 640.5 23.5T436-20q-160 0-249 82T98 289q0 159 132.5 247T614 629l207 6v72q0 155-63 234t-203 79q-151 0-313-84l-37 86q179 84 354 84 179 0 267.5-93T915 723V0h-73zM442 70q174 0 274.5 99.5T817 446v107l-190-8q-229-11-326.5-71.5T203 285q0-102 62.5-158.5T442 70z"/><glyph unicode="b" horiz-adv-x="1219" d="M641 1108q228 0 343.5-143.5T1100 545q0-271-121.5-418T637-20q-116 0-209 48T281 164h-9L244 0h-62v1556h99v-391q0-88-4-162l-3-85h7q62 98 149.5 144t210.5 46zm-2-90q-192 0-275-110t-83-363v-17q0-246 86.5-353T637 68q178 0 268 124.5T995 547q0 471-356 471z"/><glyph unicode="c" horiz-adv-x="973" d="M616-20q-233 0-365 147T119 537q0 270 137 420.5T631 1108q141 0 270-49l-27-88q-141 47-245 47-200 0-303-123.5T223 539q0-220 103-344.5T614 70q148 0 275 53V31Q785-20 616-20z"/><glyph unicode="d" horiz-adv-x="1219" d="M580 1108q118 0 204-43t154-147h6q-6 126-6 247v391h98V0h-65l-25 166h-8Q814-20 582-20q-225 0-344 140T119 528q0 282 118 431t343 149zm0-90q-178 0-267.5-125T223 530q0-462 359-462 184 0 270 107t86 353v17q0 252-84.5 362.5T580 1018z"/><glyph unicode="e" horiz-adv-x="1124" d="M621-20q-237 0-369.5 146T119 535q0 260 128 416.5T592 1108q192 0 303-134t111-364v-80H223q2-224 104.5-342T621 70q93 0 163.5 13T963 139V49Q871 9 793-5.5T621-20zm-29 1040q-157 0-252-103.5T229 618h672q0 189-82 295.5T592 1020z"/><glyph unicode="f" horiz-adv-x="614" d="M586 1001H330V0h-99v1001H29v58l202 37v84q0 200 73.5 293.5T545 1567q90 0 180-27l-23-86q-80 25-159 25-116 0-164.5-68.5T330 1188v-101h256v-86z"/><glyph unicode="g" horiz-adv-x="1071" d="M1030 1087v-69l-225-14q90-112 90-246 0-157-104.5-254.5T510 406q-74 0-104 6-59-31-90-73t-31-89q0-52 39.5-76T457 150h190q177 0 271-71.5t94-211.5q0-172-139.5-265.5T475-492q-205 0-317.5 79T45-193Q45-81 114.5-7T303 94q-49 21-78.5 59.5T195 242q0 109 139 192-95 39-148 122.5T133 748q0 163 103.5 261.5T516 1108q107 0 166-21h348zM150-184q0-224 333-224 428 0 428 273 0 98-67 142T627 51H449q-299 0-299-235zm83 932q0-126 76.5-195.5T514 483q136 0 208.5 69T795 752q0 139-74.5 208.5T512 1030q-130 0-204.5-74.5T233 748z"/><glyph unicode="h" horiz-adv-x="1208" d="M940 0v705q0 164-69 238.5T657 1018q-195 0-285.5-98.5T281 600V0h-99v1556h99v-495l-5-139h7q61 98 154 142t231 44q370 0 370-397V0h-98z"/><glyph unicode="i" horiz-adv-x="463" d="M281 0h-99v1087h99V0zM168 1389q0 96 63 96 31 0 48.5-25t17.5-71q0-45-17.5-71t-48.5-26q-63 0-63 97z"/><glyph unicode="j" horiz-adv-x="463" d="M37-492q-80 0-135 25v86q69-20 129-20 151 0 151 176v1312h99V-211q0-135-63.5-208T37-492zm131 1881q0 96 63 96 31 0 48.5-25t17.5-71q0-45-17.5-71t-48.5-26q-63 0-63 97z"/><glyph unicode="k" horiz-adv-x="991" d="M279 477l555 610h120L526 623 991 0H872L459 549 281 387V0h-99v1556h99V776l-7-299h5z"/><glyph unicode="l" horiz-adv-x="463" d="M281 0h-99v1556h99V0z"/><glyph unicode="m" horiz-adv-x="1808" d="M1540 0v713q0 159-62 232t-190 73q-167 0-247-92t-80-289V0H860v743q0 275-252 275-171 0-249-99.5T281 600V0h-99v1087h82l21-149h6q45 81 128 125.5t183 44.5q257 0 330-193h4q53 93 142.5 143t203.5 50q178 0 267-95t89-302V0h-98z"/><glyph unicode="n" horiz-adv-x="1208" d="M940 0v705q0 164-69 238.5T657 1018q-195 0-285.5-98.5T281 600V0h-99v1087h84l19-149h6q106 170 377 170 370 0 370-397V0h-98z"/><glyph unicode="o" horiz-adv-x="1200" d="M1081 545q0-266-129-415.5T596-20q-143 0-252 69T177 247t-58 298q0 266 129 414.5T602 1108q224 0 351.5-150.5T1081 545zm-858 0q0-224 98.5-349.5T600 70t278.5 125.5T977 545q0 225-99.5 349T598 1018 320.5 894.5 223 545z"/><glyph unicode="p" horiz-adv-x="1219" d="M647-20q-251 0-366 188h-7l3-84q4-74 4-162v-414h-99v1579h84l19-155h6q112 176 358 176 220 0 335.5-144.5T1100 543q0-268-121.5-415.5T647-20zm-2 88q167 0 258.5 124T995 539q0 479-346 479-190 0-279-104.5T281 573v-32q0-255 85.5-364T645 68z"/><glyph unicode="q" horiz-adv-x="1219" d="M569-20q-214 0-332 142T119 532q0 275 118 425.5T575 1108q236 0 353-174h6l18 153h84V-492h-98v414q0 122 6 248h-6Q820-20 569-20zm2 88q198 0 282.5 109T938 543v12q0 245-85 354t-271 109q-176 0-267.5-124T223 530q0-229 89.5-345.5T571 68z"/><glyph unicode="r" horiz-adv-x="797" d="M610 1108q69 0 148-14l-19-95q-68 17-141 17-139 0-228-118t-89-298V0h-99v1087h84l10-196h7q67 120 143 168.5t184 48.5z"/><glyph unicode="s" horiz-adv-x="954" d="M856 283q0-146-111-224.5T430-20Q212-20 84 47v107q164-82 346-82 161 0 244.5 53.5T758 268q0 82-66.5 138T473 516q-163 59-229 101.5t-99.5 96T111 844q0 122 102.5 193t286.5 71q176 0 334-66l-37-90q-160 66-297 66-133 0-211-44t-78-122q0-85 60.5-136T508 602q147-53 214-95.5T822.5 410 856 283z"/><glyph unicode="t" horiz-adv-x="686" d="M469 68q94 0 164 16V4q-72-24-166-24-144 0-212.5 77T186 299v702H25v58l161 45 50 246h51v-263h319v-86H287V313q0-125 44-185t138-60z"/><glyph unicode="u" horiz-adv-x="1208" d="M268 1087V383q0-164 69-238.5T551 70q194 0 285.5 98T928 487v600h98V0h-84l-18 150h-6Q812-20 541-20q-371 0-371 397v710h98z"/><glyph unicode="v" horiz-adv-x="940" d="M420 0L0 1087h102l281-739q56-142 84-248h6q41 136 84 250l281 737h102L520 0H420z"/><glyph unicode="w" horiz-adv-x="1481" d="M1051 0L813 727q-23 74-59 217h-6l-21-74-45-145L440 0h-98L31 1087h106l174-630q61-234 80-344h6q59 234 86 311l224 663h90l213-661q72-235 88-311h6q8 65 80 348l166 624h100L1155 0h-104z"/><glyph unicode="x" horiz-adv-x="1020" d="M449 559L70 1087h114l324-458 321 458h109L565 559 965 0H850L508 485 164 0H55z"/><glyph unicode="y" horiz-adv-x="940" d="M0 1087h102l230-610Q437 196 465 98h6q42 129 137 385l230 604h102L453-176q-59-154-99-208t-93.5-81T131-492q-57 0-127 21v86q58-16 125-16 51 0 90 24t70.5 74.5 73 160T416 0z"/><glyph unicode="z" horiz-adv-x="944" d="M858 0H82v63l645 936H129v88h727v-63L207 88h651V0z"/><glyph unicode="{" horiz-adv-x="723" d="M389-27q0-102 59.5-152.5T651-233v-91q-195 0-277.5 75T291-18v337q0 205-230 209v80q122 2 176 51t54 148v350q0 299 360 305v-90q-138-5-200-58t-62-157V852q0-130-44-194t-142-85v-8q97-20 141.5-83.5T389 295V-27z"/><glyph unicode="|" horiz-adv-x="1108" d="M508 1561h92V-506h-92v2067z"/><glyph unicode="}" horiz-adv-x="723" d="M334 295q0 123 44.5 186.5T520 565v8q-97 20-141.5 84T334 852v305q0 103-61.5 156.5T72 1372v90q174 0 267-77.5t93-227.5V807q0-100 54.5-148.5T662 608v-80q-230-4-230-209V-18q0-155-82.5-230.5T72-324v91q141 2 201.5 52.5T334-27v322z"/><glyph unicode="~" d="M334 745q-49 0-108-30.5T111 625v94q108 110 233 110 61 0 115-13.5T614 758q126-58 220-58 56 0 109.5 30.5T1059 825v-96q-48-49-104.5-81T825 616q-116 0-270 72-124 57-221 57z"/><glyph unicode="¡" horiz-adv-x="492" d="M215 711h61l29-1086H186zm-49 299q0 98 80 98 82 0 82-98 0-53-23.5-76T246 911q-34 0-57 23t-23 76z"/><glyph unicode="¢" d="M602 190q-186 30-288.5 175T211 745q0 232 102.5 381.5T602 1309v174h82v-166h14q131 0 275-55l-31-84q-134 51-237 51-187 0-288.5-122.5T315 748q0-225 100.5-349.5T696 274q131 0 267 58v-92q-110-56-267-56h-12V-20h-82v210z"/><glyph unicode="£" d="M412 676V420q0-116-35-196T264 96h809V0H78v84q110 21 171.5 110T311 418v258H100v82h211v297q0 204 98 315t281 111q175 0 330-68l-35-86q-157 66-295 66-141 0-209.5-81T412 1059V758h411v-82H412z"/><glyph unicode="¤" d="M991 723q0-151-90-256l139-141-59-60-137 142q-110-93-260-93-153 0-260 93L186 266l-59 60 139 141q-90 106-90 256 0 147 90 258l-139 141 59 60 138-142q103 93 260 93 155 0 260-93l137 142 59-60-139-141q90-111 90-258zM584 395q134 0 228.5 95.5T907 723q0 136-95 233t-228 97q-134 0-229-97t-95-233 94.5-232T584 395z"/><glyph unicode="¥" d="M586 666l428 796h110L692 674h283v-82H637V387h338v-82H637V0H532v305H195v82h337v205H195v82h278L43 1462h117z"/><glyph unicode="¦" horiz-adv-x="1108" d="M508 1561h92V797h-92v764zm0-1303h92v-764h-92v764z"/><glyph unicode="§" horiz-adv-x="1057" d="M145 813q0 83 50.5 152.5T334 1073q-86 47-125 102t-39 136q0 117 101.5 183.5T547 1561q175 0 336-64l-35-80q-91 34-158.5 47T545 1477q-134 0-205.5-44.5T268 1313q0-54 25.5-88.5T379 1159t188-74q192-64 264-132.5T903 782q0-173-186-274 86-42 129-96t43-136q0-135-113-207.5T465-4q-92 0-171 15T129 63v95q182-78 332-78 162 0 247 49.5T793 270q0 55-25 87.5T679.5 423 489 502q-200 73-272 141.5T145 813zm101 12q0-65 31.5-104T383 646t250-99q82 41 126 98t44 121q0 62-32 102t-108.5 77-236.5 87q-81-23-130.5-79T246 825z"/><glyph unicode="¨" horiz-adv-x="1182" d="M336 1389q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="©" horiz-adv-x="1704" d="M897 1092q-142 0-222.5-94.5T594 733q0-186 74.5-275T889 369q84 0 198 43v-88q-102-45-208-45-187 0-288.5 115T489 725q0 208 111 332.5T897 1182q119 0 227-52l-37-83q-98 45-190 45zM100 731q0 200 100 375t275 276 377 101q200 0 375-100t276-275 101-377q0-197-97-370T1235 84 852-20Q645-20 470 83.5T197.5 360 100 731zm93 0q0-178 88.5-329.5T522 161t330-89 329.5 88.5T1422 401t89 330q0 174-85.5 325t-239 243-334.5 92q-176 0-328.5-88.5T282 1060t-89-329z"/><glyph unicode="ª" horiz-adv-x="686" d="M512 813l-25 72q-84-84-202-84-95 0-151 49T78 989q0 100 80 151.5t241 59.5l95 4v43q0 77-38 114.5T350 1399q-87 0-196-49l-33 73q117 56 231 56 228 0 228-215V813h-68zM168 993q0-54 35-85t96-31q90 0 142.5 50t52.5 142v64l-88-5q-116-6-177-36.5T168 993z"/><glyph unicode="«" horiz-adv-x="885" d="M82 543l309 393 62-43-254-363 254-362-62-43L82 516v27zm360 0l310 393 61-43-254-363 254-362-61-43-310 391v27z"/><glyph unicode="¬" d="M1038 764V270h-82v412H111v82h927z"/><glyph unicode="­" horiz-adv-x="659" d="M92 512zm0 0v82h475v-82H92z"/><glyph unicode="®" horiz-adv-x="1704" d="M709 731h112q91 0 143 46.5t52 135.5q0 172-197 172H709V731zm411 187q0-79-38.5-139.5T971 684l237-393h-121L877 651H709V291H608v880h211q143 0 222-62t79-191zM100 731q0 200 100 375t275 276 377 101q200 0 375-100t276-275 101-377q0-197-97-370T1235 84 852-20Q645-20 470 83.5T197.5 360 100 731zm93 0q0-178 88.5-329.5T522 161t330-89 329.5 88.5T1422 401t89 330q0 174-85.5 325t-239 243-334.5 92q-176 0-328.5-88.5T282 1060t-89-329z"/><glyph unicode="¯" horiz-adv-x="1024" d="M1030 1556H-6v82h1036v-82z"/><glyph unicode="°" horiz-adv-x="877" d="M139 1184q0 132 86.5 215.5T438 1483t212.5-83.5T737 1184t-86.5-215.5T438 885q-130 0-214.5 83T139 1184zm90 0q0-91 61-154t148-63q86 0 147.5 62t61.5 155q0 92-60 154.5T438 1401q-90 0-149.5-64T229 1184z"/><glyph unicode="±" d="M111 1zm0 0v82h948V1H111zm514 763h434v-82H625V250h-82v432H111v82h432v434h82V764z"/><glyph unicode="²" horiz-adv-x="688" d="M629 586H53v78l242 237q125 121 172 193t47 149q0 71-46.5 112.5T344 1397q-108 0-217-82l-49 65q119 103 270 103 124 0 194-63.5t70-174.5q0-47-13-89t-40-85.5-68.5-90T182 674h447v-88z"/><glyph unicode="³" horiz-adv-x="688" d="M616 1260q0-78-44-131.5T455 1053q186-45 186-211 0-130-88.5-201.5T305 569q-144 0-264 60v88q136-62 266-62 115 0 174.5 49T541 840q0 83-59.5 122T303 1001H172v84h135q105 0 158 43.5t53 120.5q0 67-47 107.5T344 1397q-128 0-246-78l-47 70q130 94 293 94 127 0 199.5-60t72.5-163z"/><glyph unicode="´" horiz-adv-x="1182" d="M393 1257q73 79 144.5 171.5T635 1569h141v-17q-36-52-122.5-138T463 1241h-70v16z"/><glyph unicode="µ" horiz-adv-x="1221" d="M281 1087V383q0-164 69-238.5T563 70q194 0 285.5 98T940 487v600h98V0h-84l-18 150h-6Q880 73 780 26.5T563-20q-99 0-167.5 27.5T276 92q5-92 5-170v-414h-99v1579h99z"/><glyph unicode="¶" horiz-adv-x="1341" d="M1106-260h-100v1722H778V-260H678v819q-64-18-146-18-216 0-317.5 125T113 1042q0 260 109 387t341 127h543V-260z"/><glyph unicode="·" horiz-adv-x="487" d="M162 623zm0 98q0 98 80 98 82 0 82-98t-82-98q-80 0-80 98z"/><glyph unicode="¸" horiz-adv-x="420" d="M393-291q0-100-67.5-150.5T137-492q-68 0-94 11v88q30-10 92-10 78 0 119 28t41 80q0 94-193 121L195 0h96l-66-117q168-37 168-174z"/><glyph unicode="¹" horiz-adv-x="688" d="M350 1462h92V586h-98v547q0 99 12 233-26-23-233-145l-47 77z"/><glyph unicode="º" horiz-adv-x="739" d="M670 1141q0-161-80-250.5T367 801t-220 86-77 254q0 162 78 250t223 88q142 0 220.5-87t78.5-251zm-510 0q0-264 209-264t209 264q0 131-50 194.5T369 1399t-159-63.5-50-194.5z"/><glyph unicode="»" horiz-adv-x="885" d="M803 518L494 125l-62 43 254 362-254 363 62 43 309-391v-27zm-361 0L133 125l-61 43 254 362L72 893l61 43 309-391v-27z"/><glyph unicode="¼" horiz-adv-x="1516" d="M59 0zm274 1462h92V586h-98v547q0 99 12 233-26-23-233-145l-47 77zm815 0L337 0h-94l811 1462h94zm244-1220h-129V1h-90v241H760v60l407 581h96V320h129v-78zm-219 78v221q0 132 8 232-6-12-21.5-35.5T864 320h309z"/><glyph unicode="½" horiz-adv-x="1516" d="M11 0zm274 1462h92V586h-98v547q0 99 12 233-26-23-233-145l-47 77zm788 0L262 0h-94l811 1462h94zM1403 1H827v78l242 237q125 121 172 193t47 149q0 71-46.5 112.5T1118 812q-108 0-217-82l-49 65q119 103 270 103 124 0 194-63.5t70-174.5q0-47-13-89t-40-85.5-68.5-90T956 89h447V1z"/><glyph unicode="¾" horiz-adv-x="1516" d="M41 0zm575 1260q0-78-44-131.5T455 1053q186-45 186-211 0-130-88.5-201.5T305 569q-144 0-264 60v88q136-62 266-62 115 0 174.5 49T541 840q0 83-59.5 122T303 1001H172v84h135q105 0 158 43.5t53 120.5q0 67-47 107.5T344 1397q-128 0-246-78l-47 70q130 94 293 94 127 0 199.5-60t72.5-163zm684 202L489 0h-94l811 1462h94zm195-1220h-129V1h-90v241H863v60l407 581h96V320h129v-78zm-219 78v221q0 132 8 232-6-12-21.5-35.5T967 320h309z"/><glyph unicode="¿" horiz-adv-x="862" d="M569 711v-37q0-125-39.5-204.5T393 305l-90-79q-73-61-104-120.5T168-33q0-124 82-200t221-76q125 0 233 46l64 27 37-79q-111-48-185.5-64T467-395q-184 0-288.5 99T74-27q0 70 20 124t58.5 102T324 358q64 53 98.5 98.5t49.5 94T487 696v15h82zm-129 299q0 98 80 98 82 0 82-98 0-53-23.5-76T520 911q-34 0-57 23t-23 76z"/><glyph unicode="À" horiz-adv-x="1229" d="M0 0zm911 516H317L113 0H0l588 1468h65L1229 0h-115zm-557 92h523l-199 527q-25 62-60 172-27-96-59-174zm366 971h-69q-96 79-188.5 171.5T337 1890v17h142q26-48 98.5-142T720 1595v-16z"/><glyph unicode="Á" horiz-adv-x="1229" d="M0 0zm911 516H317L113 0H0l588 1468h65L1229 0h-115zm-557 92h523l-199 527q-25 62-60 172-27-96-59-174zm150 987q73 79 144.5 171.5T746 1907h141v-17q-36-52-122.5-138T574 1579h-70v16z"/><glyph unicode="Â" horiz-adv-x="1229" d="M0 0zm911 516H317L113 0H0l588 1468h65L1229 0h-115zm-557 92h523l-199 527q-25 62-60 172-27-96-59-174zm-26 987q62 67 131.5 156T570 1907h98q68-120 242-312v-16h-70q-122 101-221 207-108-114-221-207h-70v16z"/><glyph unicode="Ã" horiz-adv-x="1229" d="M0 0zm911 516H317L113 0H0l588 1468h65L1229 0h-115zm-557 92h523l-199 527q-25 62-60 172-27-96-59-174zm430 973q-36 0-75 18.5T608 1671q-32 26-62.5 46t-62.5 20q-45 0-75-34.5T360 1581h-73q10 111 63 174.5t137 63.5q48 0 88-25t82-59q34-28 66-50t61-22q46 0 77 36.5t48 119.5h76q-16-116-69-177t-132-61z"/><glyph unicode="Ä" horiz-adv-x="1229" d="M0 0zm911 516H317L113 0H0l588 1468h65L1229 0h-115zm-557 92h523l-199 527q-25 62-60 172-27-96-59-174zm13 1119q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="Å" horiz-adv-x="1229" d="M0 0zm911 516H317L113 0H0l588 1468h65L1229 0h-115zm-557 92h523l-199 527q-25 62-60 172-27-96-59-174zm482 1002q0-97-60-155t-157-58-157 58-60 155q0 94 60 152.5t157 58.5 157-59 60-152zm-354 0q0-66 37.5-103.5T619 1469t99.5 37.5T756 1610q0 64-39 101.5t-98 37.5q-62 0-99.5-38T482 1610z"/><glyph unicode="Æ" horiz-adv-x="1653" d="M1528 0H811v516H336L109 0H-2l653 1462h877v-94H913V815h576v-94H913V94h615V0zM377 608h434v760H711z"/><glyph unicode="Ç" horiz-adv-x="1272" d="M129 0zm702 1391q-275 0-433-176T240 733q0-313 149-486T815 74q184 0 338 47V31q-145-51-362-51-308 0-485 199T129 735q0 223 84.5 393t243 262.5T825 1483q214 0 383-80l-41-92q-160 80-336 80zm80-1682q0-100-67.5-150.5T655-492q-68 0-94 11v88q30-10 92-10 78 0 119 28t41 80q0 94-193 121L713 0h96l-66-117q168-37 168-174z"/><glyph unicode="È" horiz-adv-x="1130" d="M207 0zm799 0H207v1462h799v-94H309V815h658v-94H309V94h697V0zM697 1579h-69q-96 79-188.5 171.5T314 1890v17h142q26-48 98.5-142T697 1595v-16z"/><glyph unicode="É" horiz-adv-x="1130" d="M207 0zm799 0H207v1462h799v-94H309V815h658v-94H309V94h697V0zM463 1595q73 79 144.5 171.5T705 1907h141v-17q-36-52-122.5-138T533 1579h-70v16z"/><glyph unicode="Ê" horiz-adv-x="1130" d="M207 0zm799 0H207v1462h799v-94H309V815h658v-94H309V94h697V0zM315 1595q62 67 131.5 156T557 1907h98q68-120 242-312v-16h-70q-122 101-221 207-108-114-221-207h-70v16z"/><glyph unicode="Ë" horiz-adv-x="1130" d="M207 0zm799 0H207v1462h799v-94H309V815h658v-94H309V94h697V0zM354 1727q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="Ì" horiz-adv-x="516" d="M0 0zm207 0v1462h102V0H207zm113 1579h-69q-96 79-188.5 171.5T-63 1890v17H79q26-48 98.5-142T320 1595v-16z"/><glyph unicode="Í" horiz-adv-x="516" d="M191 0zm16 0v1462h102V0H207zm-16 1595q73 79 144.5 171.5T433 1907h141v-17q-36-52-122.5-138T261 1579h-70v16z"/><glyph unicode="Î" horiz-adv-x="516" d="M0 0zm207 0v1462h102V0H207zM-32 1595q62 67 131.5 156T210 1907h98q68-120 242-312v-16h-70q-122 101-221 207-108-114-221-207h-70v16z"/><glyph unicode="Ï" horiz-adv-x="516" d="M5 0zm202 0v1462h102V0H207zM5 1727q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="Ð" horiz-adv-x="1466" d="M1317 745q0-368-193-556.5T557 0H207v678H47v94h160v690h395q350 0 532.5-183T1317 745zm-111-4q0 314-159.5 472.5T578 1372H309V772h406v-94H309V90h242q655 0 655 651z"/><glyph unicode="Ñ" horiz-adv-x="1477" d="M207 0zm1063 0h-103L301 1298h-8q12-232 12-350V0h-98v1462h102l865-1296h6q-9 180-9 342v954h99V0zM897 1581q-36 0-75 18.5T721 1671q-32 26-62.5 46t-62.5 20q-45 0-75-34.5T473 1581h-73q10 111 63 174.5t137 63.5q48 0 88-25t82-59q34-28 66-50t61-22q46 0 77 36.5t48 119.5h76q-16-116-69-177t-132-61z"/><glyph unicode="Ò" horiz-adv-x="1565" d="M129 0zm1307 733q0-348-174-550.5T782-20q-305 0-479 202.5T129 735q0 349 175.5 549.5T784 1485q306 0 479-201.5T1436 733zm-1196 0q0-314 140-485.5T782 76q264 0 403.5 170T1325 733q0 316-139.5 484.5T784 1386q-261 0-402.5-170T240 733zm645 846h-69q-96 79-188.5 171.5T502 1890v17h142q26-48 98.5-142T885 1595v-16z"/><glyph unicode="Ó" horiz-adv-x="1565" d="M129 0zm1307 733q0-348-174-550.5T782-20q-305 0-479 202.5T129 735q0 349 175.5 549.5T784 1485q306 0 479-201.5T1436 733zm-1196 0q0-314 140-485.5T782 76q264 0 403.5 170T1325 733q0 316-139.5 484.5T784 1386q-261 0-402.5-170T240 733zm446 862q73 79 144.5 171.5T928 1907h141v-17q-36-52-122.5-138T756 1579h-70v16z"/><glyph unicode="Ô" horiz-adv-x="1565" d="M129 0zm1307 733q0-348-174-550.5T782-20q-305 0-479 202.5T129 735q0 349 175.5 549.5T784 1485q306 0 479-201.5T1436 733zm-1196 0q0-314 140-485.5T782 76q264 0 403.5 170T1325 733q0 316-139.5 484.5T784 1386q-261 0-402.5-170T240 733zm252 862q62 67 131.5 156T734 1907h98q68-120 242-312v-16h-70q-122 101-221 207-108-114-221-207h-70v16z"/><glyph unicode="Õ" horiz-adv-x="1565" d="M129 0zm1307 733q0-348-174-550.5T782-20q-305 0-479 202.5T129 735q0 349 175.5 549.5T784 1485q306 0 479-201.5T1436 733zm-1196 0q0-314 140-485.5T782 76q264 0 403.5 170T1325 733q0 316-139.5 484.5T784 1386q-261 0-402.5-170T240 733zm700 848q-36 0-75 18.5T764 1671q-32 26-62.5 46t-62.5 20q-45 0-75-34.5T516 1581h-73q10 111 63 174.5t137 63.5q48 0 88-25t82-59q34-28 66-50t61-22q46 0 77 36.5t48 119.5h76q-16-116-69-177t-132-61z"/><glyph unicode="Ö" horiz-adv-x="1565" d="M129 0zm1307 733q0-348-174-550.5T782-20q-305 0-479 202.5T129 735q0 349 175.5 549.5T784 1485q306 0 479-201.5T1436 733zm-1196 0q0-314 140-485.5T782 76q264 0 403.5 170T1325 733q0 316-139.5 484.5T784 1386q-261 0-402.5-170T240 733zm289 994q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="×" d="M584 780l409 408 58-58-408-407 406-408-58-57-407 408-406-408-57 57 405 408-407 407 57 58z"/><glyph unicode="Ø" horiz-adv-x="1565" d="M1436 733q0-348-174-550.5T782-20q-236 0-395 120L301-20l-74 59 90 127Q129 366 129 735q0 349 175.5 549.5T784 1485q232 0 392-121l108 152 72-60-111-153q191-207 191-570zm-111 0q0 315-139 486L444 182Q577 76 782 76q264 0 403.5 170T1325 733zm-1085 0q0-312 139-483l739 1034q-133 102-334 102-261 0-402.5-170T240 733z"/><glyph unicode="Ù" horiz-adv-x="1473" d="M190 0zm1092 1462V516q0-252-146-394T729-20q-254 0-396.5 142.5T190 520v942h103V516q0-211 117-328.5T741 70q209 0 324 115.5T1180 506v956h102zm-449 117h-69q-96 79-188.5 171.5T450 1890v17h142q26-48 98.5-142T833 1595v-16z"/><glyph unicode="Ú" horiz-adv-x="1473" d="M190 0zm1092 1462V516q0-252-146-394T729-20q-254 0-396.5 142.5T190 520v942h103V516q0-211 117-328.5T741 70q209 0 324 115.5T1180 506v956h102zm-649 133q73 79 144.5 171.5T875 1907h141v-17q-36-52-122.5-138T703 1579h-70v16z"/><glyph unicode="Û" horiz-adv-x="1473" d="M190 0zm1092 1462V516q0-252-146-394T729-20q-254 0-396.5 142.5T190 520v942h103V516q0-211 117-328.5T741 70q209 0 324 115.5T1180 506v956h102zm-838 133q62 67 131.5 156T686 1907h98q68-120 242-312v-16h-70q-122 101-221 207-108-114-221-207h-70v16z"/><glyph unicode="Ü" horiz-adv-x="1473" d="M190 0zm1092 1462V516q0-252-146-394T729-20q-254 0-396.5 142.5T190 520v942h103V516q0-211 117-328.5T741 70q209 0 324 115.5T1180 506v956h102zm-801 265q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="Ý" horiz-adv-x="1081" d="M0 0zm543 662l428 800h110L594 565V0H489v557L0 1462h117zm-109 933q73 79 144.5 171.5T676 1907h141v-17q-36-52-122.5-138T504 1579h-70v16z"/><glyph unicode="Þ" horiz-adv-x="1198" d="M1087 778q0-212-144-325T535 340H309V0H207v1462h102v-264h256q522 0 522-420zM309 428h201q247 0 357 81.5T977 774q0 169-104 250.5T551 1106H309V428z"/><glyph unicode="ß" horiz-adv-x="1194" d="M961 1284q0-139-139-250-81-64-110.5-100.5T682 858q0-44 14.5-68t51.5-57 102-78q106-75 151.5-124.5t68-103T1092 307q0-156-88-241.5T758-20q-95 0-174.5 18.5T457 47v107q65-38 148.5-62T758 68q114 0 174.5 54.5T993 283q0 83-39 144T805 563q-127 87-175 147t-48 146q0 60 32.5 110T721 1074q74 57 106.5 105.5T860 1286q0 93-70 143t-202 50q-145 0-226-69t-81-196V0h-99v1206q0 173 103.5 267t292.5 94q188 0 285.5-72.5T961 1284z"/><glyph unicode="à" horiz-adv-x="1085" d="M98 0zm744 0l-25 172h-8Q727 67 640.5 23.5T436-20q-160 0-249 82T98 289q0 159 132.5 247T614 629l207 6v72q0 155-63 234t-203 79q-151 0-313-84l-37 86q179 84 354 84 179 0 267.5-93T915 723V0h-73zM442 70q174 0 274.5 99.5T817 446v107l-190-8q-229-11-326.5-71.5T203 285q0-102 62.5-158.5T442 70zm196 1171h-69q-96 79-188.5 171.5T255 1552v17h142q26-48 98.5-142T638 1257v-16z"/><glyph unicode="á" horiz-adv-x="1085" d="M98 0zm744 0l-25 172h-8Q727 67 640.5 23.5T436-20q-160 0-249 82T98 289q0 159 132.5 247T614 629l207 6v72q0 155-63 234t-203 79q-151 0-313-84l-37 86q179 84 354 84 179 0 267.5-93T915 723V0h-73zM442 70q174 0 274.5 99.5T817 446v107l-190-8q-229-11-326.5-71.5T203 285q0-102 62.5-158.5T442 70zm-20 1187q73 79 144.5 171.5T664 1569h141v-17q-36-52-122.5-138T492 1241h-70v16z"/><glyph unicode="â" horiz-adv-x="1085" d="M98 0zm744 0l-25 172h-8Q727 67 640.5 23.5T436-20q-160 0-249 82T98 289q0 159 132.5 247T614 629l207 6v72q0 155-63 234t-203 79q-151 0-313-84l-37 86q179 84 354 84 179 0 267.5-93T915 723V0h-73zM442 70q174 0 274.5 99.5T817 446v107l-190-8q-229-11-326.5-71.5T203 285q0-102 62.5-158.5T442 70zM251 1257q62 67 131.5 156T493 1569h98q68-120 242-312v-16h-70q-122 101-221 207-108-114-221-207h-70v16z"/><glyph unicode="ã" horiz-adv-x="1085" d="M98 0zm744 0l-25 172h-8Q727 67 640.5 23.5T436-20q-160 0-249 82T98 289q0 159 132.5 247T614 629l207 6v72q0 155-63 234t-203 79q-151 0-313-84l-37 86q179 84 354 84 179 0 267.5-93T915 723V0h-73zM442 70q174 0 274.5 99.5T817 446v107l-190-8q-229-11-326.5-71.5T203 285q0-102 62.5-158.5T442 70zm255 1173q-36 0-75 18.5T521 1333q-32 26-62.5 46t-62.5 20q-45 0-75-34.5T273 1243h-73q10 111 63 174.5t137 63.5q48 0 88-25t82-59q34-28 66-50t61-22q46 0 77 36.5t48 119.5h76q-16-116-69-177t-132-61z"/><glyph unicode="ä" horiz-adv-x="1085" d="M98 0zm744 0l-25 172h-8Q727 67 640.5 23.5T436-20q-160 0-249 82T98 289q0 159 132.5 247T614 629l207 6v72q0 155-63 234t-203 79q-151 0-313-84l-37 86q179 84 354 84 179 0 267.5-93T915 723V0h-73zM442 70q174 0 274.5 99.5T817 446v107l-190-8q-229-11-326.5-71.5T203 285q0-102 62.5-158.5T442 70zM282 1389q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="å" horiz-adv-x="1085" d="M98 0zm744 0l-25 172h-8Q727 67 640.5 23.5T436-20q-160 0-249 82T98 289q0 159 132.5 247T614 629l207 6v72q0 155-63 234t-203 79q-151 0-313-84l-37 86q179 84 354 84 179 0 267.5-93T915 723V0h-73zM442 70q174 0 274.5 99.5T817 446v107l-190-8q-229-11-326.5-71.5T203 285q0-102 62.5-158.5T442 70zm317 1386q0-97-60-155t-157-58-157 58-60 155q0 94 60 152.5t157 58.5 157-59 60-152zm-354 0q0-66 37.5-103.5T542 1315t99.5 37.5T679 1456q0 64-39 101.5t-98 37.5q-62 0-99.5-38T405 1456z"/><glyph unicode="æ" horiz-adv-x="1731" d="M1243-20q-295 0-397 256-68-133-168-194.5T426-20q-156 0-242 82.5T98 289q0 154 125 243t377 97l201 6v72q0 155-61.5 234T541 1020q-148 0-305-84l-37 86q173 84 346 84 261 0 325-211 111 213 347 213 184 0 289.5-134.5T1612 610v-80H897q0-460 348-460 85 0 150 12t174 57V49q-92-41-165-55t-161-14zM434 70q169 0 266 99.5T797 446v107l-187-8q-219-11-313-71.5T203 285q0-102 61-158.5T434 70zm783 950q-284 0-314-402h604q0 188-77.5 295T1217 1020z"/><glyph unicode="ç" horiz-adv-x="973" d="M119 0zm497-20q-233 0-365 147T119 537q0 270 137 420.5T631 1108q141 0 270-49l-27-88q-141 47-245 47-200 0-303-123.5T223 539q0-220 103-344.5T614 70q148 0 275 53V31Q785-20 616-20zm107-271q0-100-67.5-150.5T467-492q-68 0-94 11v88q30-10 92-10 78 0 119 28t41 80q0 94-193 121L525 0h96l-66-117q168-37 168-174z"/><glyph unicode="è" horiz-adv-x="1124" d="M119 0zm502-20q-237 0-369.5 146T119 535q0 260 128 416.5T592 1108q192 0 303-134t111-364v-80H223q2-224 104.5-342T621 70q93 0 163.5 13T963 139V49Q871 9 793-5.5T621-20zm-29 1040q-157 0-252-103.5T229 618h672q0 189-82 295.5T592 1020zm93 221h-69q-96 79-188.5 171.5T302 1552v17h142q26-48 98.5-142T685 1257v-16z"/><glyph unicode="é" horiz-adv-x="1124" d="M119 0zm502-20q-237 0-369.5 146T119 535q0 260 128 416.5T592 1108q192 0 303-134t111-364v-80H223q2-224 104.5-342T621 70q93 0 163.5 13T963 139V49Q871 9 793-5.5T621-20zm-29 1040q-157 0-252-103.5T229 618h672q0 189-82 295.5T592 1020zm-140 237q73 79 144.5 171.5T694 1569h141v-17q-36-52-122.5-138T522 1241h-70v16z"/><glyph unicode="ê" horiz-adv-x="1124" d="M119 0zm502-20q-237 0-369.5 146T119 535q0 260 128 416.5T592 1108q192 0 303-134t111-364v-80H223q2-224 104.5-342T621 70q93 0 163.5 13T963 139V49Q871 9 793-5.5T621-20zm-29 1040q-157 0-252-103.5T229 618h672q0 189-82 295.5T592 1020zm-302 237q62 67 131.5 156T532 1569h98q68-120 242-312v-16h-70q-122 101-221 207-108-114-221-207h-70v16z"/><glyph unicode="ë" horiz-adv-x="1124" d="M119 0zm502-20q-237 0-369.5 146T119 535q0 260 128 416.5T592 1108q192 0 303-134t111-364v-80H223q2-224 104.5-342T621 70q93 0 163.5 13T963 139V49Q871 9 793-5.5T621-20zm-29 1040q-157 0-252-103.5T229 618h672q0 189-82 295.5T592 1020zm-261 369q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="ì" horiz-adv-x="463" d="M0 0zm281 0h-99v1087h99V0zm68 1241h-69q-96 79-188.5 171.5T-34 1552v17h142q26-48 98.5-142T349 1257v-16z"/><glyph unicode="í" horiz-adv-x="463" d="M107 0zm174 0h-99v1087h99V0zM107 1257q73 79 144.5 171.5T349 1569h141v-17q-36-52-122.5-138T177 1241h-70v16z"/><glyph unicode="î" horiz-adv-x="463" d="M0 0zm281 0h-99v1087h99V0zM-58 1257q62 67 131.5 156T184 1569h98q68-120 242-312v-16h-70q-122 101-221 207-108-114-221-207h-70v16z"/><glyph unicode="ï" horiz-adv-x="463" d="M0 0zm281 0h-99v1087h99V0zM-21 1389q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="ð" horiz-adv-x="1174" d="M1055 559q0-276-124-427.5T582-20q-214 0-339.5 130T117 471q0 228 126.5 357.5T586 958q108 0 187.5-33T922 829l4 2q-64 270-269 459l-270-157-49 77 244 146q-86 62-199 119l45 81q147-69 248-145l225 137 49-84-202-121q154-151 230.5-353t76.5-431zm-105-2q0 146-97 228.5T586 868q-185 0-275-100.5T221 463q0-186 94.5-289.5T584 70q179 0 272.5 123T950 557z"/><glyph unicode="ñ" horiz-adv-x="1208" d="M182 0zm758 0v705q0 164-69 238.5T657 1018q-195 0-285.5-98.5T281 600V0h-99v1087h84l19-149h6q106 170 377 170 370 0 370-397V0h-98zM779 1243q-36 0-75 18.5T603 1333q-32 26-62.5 46t-62.5 20q-45 0-75-34.5T355 1243h-73q10 111 63 174.5t137 63.5q48 0 88-25t82-59q34-28 66-50t61-22q46 0 77 36.5t48 119.5h76q-16-116-69-177t-132-61z"/><glyph unicode="ò" horiz-adv-x="1200" d="M119 0zm962 545q0-266-129-415.5T596-20q-143 0-252 69T177 247t-58 298q0 266 129 414.5T602 1108q224 0 351.5-150.5T1081 545zm-858 0q0-224 98.5-349.5T600 70t278.5 125.5T977 545q0 225-99.5 349T598 1018 320.5 894.5 223 545zm495 696h-69q-96 79-188.5 171.5T335 1552v17h142q26-48 98.5-142T718 1257v-16z"/><glyph unicode="ó" horiz-adv-x="1200" d="M119 0zm962 545q0-266-129-415.5T596-20q-143 0-252 69T177 247t-58 298q0 266 129 414.5T602 1108q224 0 351.5-150.5T1081 545zm-858 0q0-224 98.5-349.5T600 70t278.5 125.5T977 545q0 225-99.5 349T598 1018 320.5 894.5 223 545zm276 712q73 79 144.5 171.5T741 1569h141v-17q-36-52-122.5-138T569 1241h-70v16z"/><glyph unicode="ô" horiz-adv-x="1200" d="M119 0zm962 545q0-266-129-415.5T596-20q-143 0-252 69T177 247t-58 298q0 266 129 414.5T602 1108q224 0 351.5-150.5T1081 545zm-858 0q0-224 98.5-349.5T600 70t278.5 125.5T977 545q0 225-99.5 349T598 1018 320.5 894.5 223 545zm86 712q62 67 131.5 156T551 1569h98q68-120 242-312v-16h-70q-122 101-221 207-108-114-221-207h-70v16z"/><glyph unicode="õ" horiz-adv-x="1200" d="M119 0zm962 545q0-266-129-415.5T596-20q-143 0-252 69T177 247t-58 298q0 266 129 414.5T602 1108q224 0 351.5-150.5T1081 545zm-858 0q0-224 98.5-349.5T600 70t278.5 125.5T977 545q0 225-99.5 349T598 1018 320.5 894.5 223 545zm538 698q-36 0-75 18.5T585 1333q-32 26-62.5 46t-62.5 20q-45 0-75-34.5T337 1243h-73q10 111 63 174.5t137 63.5q48 0 88-25t82-59q34-28 66-50t61-22q46 0 77 36.5t48 119.5h76q-16-116-69-177t-132-61z"/><glyph unicode="ö" horiz-adv-x="1200" d="M119 0zm962 545q0-266-129-415.5T596-20q-143 0-252 69T177 247t-58 298q0 266 129 414.5T602 1108q224 0 351.5-150.5T1081 545zm-858 0q0-224 98.5-349.5T600 70t278.5 125.5T977 545q0 225-99.5 349T598 1018 320.5 894.5 223 545zm123 844q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="÷" d="M111 682v82h948v-82H111zm393 393q0 99 80 99 82 0 82-99 0-52-23.5-75T584 977q-34 0-57 23t-23 75zm0-704q0 98 80 98 82 0 82-98 0-53-23.5-76T584 272q-34 0-57 23t-23 76z"/><glyph unicode="ø" horiz-adv-x="1200" d="M1081 545q0-266-129-415.5T596-20q-173 0-291 98L219-35l-72 58 93 120Q119 296 119 545q0 266 129 414.5T602 1108q179 0 301-104l96 124 74-55-104-137q112-147 112-391zm-858 0q0-200 78-322l543 705q-98 90-246 90-180 0-277.5-123.5T223 545zm754 0q0 190-72 309L362 152q94-82 238-82 180 0 278.5 125.5T977 545z"/><glyph unicode="ù" horiz-adv-x="1208" d="M170 0zm98 1087V383q0-164 69-238.5T551 70q194 0 285.5 98T928 487v600h98V0h-84l-18 150h-6Q812-20 541-20q-371 0-371 397v710h98zm419 154h-69q-96 79-188.5 171.5T304 1552v17h142q26-48 98.5-142T687 1257v-16z"/><glyph unicode="ú" horiz-adv-x="1208" d="M170 0zm98 1087V383q0-164 69-238.5T551 70q194 0 285.5 98T928 487v600h98V0h-84l-18 150h-6Q812-20 541-20q-371 0-371 397v710h98zm227 170q73 79 144.5 171.5T737 1569h141v-17q-36-52-122.5-138T565 1241h-70v16z"/><glyph unicode="û" horiz-adv-x="1208" d="M170 0zm98 1087V383q0-164 69-238.5T551 70q194 0 285.5 98T928 487v600h98V0h-84l-18 150h-6Q812-20 541-20q-371 0-371 397v710h98zm45 170q62 67 131.5 156T555 1569h98q68-120 242-312v-16h-70q-122 101-221 207-108-114-221-207h-70v16z"/><glyph unicode="ü" horiz-adv-x="1208" d="M170 0zm98 1087V383q0-164 69-238.5T551 70q194 0 285.5 98T928 487v600h98V0h-84l-18 150h-6Q812-20 541-20q-371 0-371 397v710h98zm82 302q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="ý" horiz-adv-x="940" d="M0 0zm0 1087h102l230-610Q437 196 465 98h6q42 129 137 385l230 604h102L453-176q-59-154-99-208t-93.5-81T131-492q-57 0-127 21v86q58-16 125-16 51 0 90 24t70.5 74.5 73 160T416 0zm361 170q73 79 144.5 171.5T603 1569h141v-17q-36-52-122.5-138T431 1241h-70v16z"/><glyph unicode="þ" horiz-adv-x="1219" d="M281 918q114 190 368 190 220 0 335.5-144.5T1100 543q0-268-121.5-415.5T647-20q-251 0-366 188h-7l3-84q4-74 4-162v-414h-99v2048h99v-391l-7-247h7zM645 68q167 0 258.5 124T995 539q0 479-348 479-193 0-279.5-105T281 559v-18q0-255 85.5-364T645 68z"/><glyph unicode="ÿ" horiz-adv-x="940" d="M0 0zm0 1087h102l230-610Q437 196 465 98h6q42 129 137 385l230 604h102L453-176q-59-154-99-208t-93.5-81T131-492q-57 0-127 21v86q58-16 125-16 51 0 90 24t70.5 74.5 73 160T416 0zm214 302q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="ı" horiz-adv-x="463" d="M281 0h-99v1087h99V0z"/><glyph unicode="Œ" horiz-adv-x="1839" d="M1714 0H958q-76-16-176-16-305 0-479 200T129 735q0 347 174.5 545.5T784 1479q78 0 183-17h747v-94h-655V815h616v-94h-616V94h655V0zM782 80q109 0 174 18v1266q-62 16-172 16-262 0-403-167.5T240 733q0-315 140.5-484T782 80z"/><glyph unicode="œ" horiz-adv-x="1942" d="M1438-20q-156 0-266.5 67.5T1006 246Q947 118 848 49T596-20q-143 0-252 69T177 247t-58 298q0 266 129 414.5T602 1108q151 0 251-70t157-209q110 279 399 279 192 0 303-134t111-364v-80h-762q2-230 100.5-345T1438 70q93 0 163.5 13t178.5 56V49q-92-40-170-54.5T1438-20zM223 545q0-224 98.5-349.5T600 70q174 0 265 122.5T956 545q0 224-93 348.5T598 1018q-180 0-277.5-123.5T223 545zm1186 475q-155 0-242-104t-102-298h653q0 189-82 295.5T1409 1020z"/><glyph unicode="Ÿ" horiz-adv-x="1081" d="M0 0zm543 662l428 800h110L594 565V0H489v557L0 1462h117zM288 1727q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86zm381 0q0 46 15.5 66t47.5 20q64 0 64-86t-64-86q-63 0-63 86z"/><glyph unicode="ˆ" horiz-adv-x="1182" d="M299 1257q62 67 131.5 156T541 1569h98q68-120 242-312v-16h-70q-122 101-221 207-108-114-221-207h-70v16z"/><glyph unicode="˚" horiz-adv-x="1182" d="M805 1456q0-97-60-155t-157-58-157 58-60 155q0 94 60 152.5t157 58.5 157-59 60-152zm-354 0q0-66 37.5-103.5T588 1315t99.5 37.5T725 1456q0 64-39 101.5t-98 37.5q-62 0-99.5-38T451 1456z"/><glyph unicode="˜" horiz-adv-x="1182" d="M780 1243q-36 0-75 18.5T604 1333q-32 26-62.5 46t-62.5 20q-45 0-75-34.5T356 1243h-73q10 111 63 174.5t137 63.5q48 0 88-25t82-59q34-28 66-50t61-22q46 0 77 36.5t48 119.5h76q-16-116-69-177t-132-61z"/><glyph horiz-adv-x="953"/><glyph horiz-adv-x="1907"/><glyph horiz-adv-x="953"/><glyph horiz-adv-x="1907"/><glyph horiz-adv-x="635"/><glyph horiz-adv-x="476"/><glyph horiz-adv-x="317"/><glyph horiz-adv-x="317"/><glyph horiz-adv-x="238"/><glyph horiz-adv-x="381"/><glyph horiz-adv-x="105"/><glyph unicode="‐" horiz-adv-x="659" d="M92 512v82h475v-82H92z"/><glyph unicode="‑" horiz-adv-x="659" d="M92 512v82h475v-82H92z"/><glyph unicode="‒" horiz-adv-x="659" d="M92 512v82h475v-82H92z"/><glyph unicode="–" horiz-adv-x="1024" d="M82 512v82h860v-82H82z"/><glyph unicode="—" horiz-adv-x="2048" d="M82 512v82h1884v-82H82z"/><glyph unicode="‘" horiz-adv-x="297" d="M41 961l-12 20q32 112 81.5 251t92.5 230h65q-30-101-64.5-257T158 961H41z"/><glyph unicode="’" horiz-adv-x="297" d="M256 1462l12-20q-75-265-174-481H29q29 96 61 241.5t49 259.5h117z"/><glyph unicode="‚" horiz-adv-x="451" d="M68 0zm227 238l12-20Q232-47 133-263H68q29 96 61 241.5T178 238h117z"/><glyph unicode="“" horiz-adv-x="614" d="M358 961l-12 20q34 120 83 255t91 226h66q-30-98-63-248.5T475 961H358zm-317 0l-12 20q32 112 81.5 251t92.5 230h65q-30-101-64.5-257T158 961H41z"/><glyph unicode="”" horiz-adv-x="614" d="M256 1462l12-20q-75-265-174-481H29q29 96 61 241.5t49 259.5h117zm317 0l13-20q-36-128-85-261t-89-220h-66q30 98 63 248.5t48 252.5h116z"/><glyph unicode="„" horiz-adv-x="768" d="M68 0zm227 238l12-20Q232-47 133-263H68q29 96 61 241.5T178 238h117zm317 0l13-20Q589 90 540-43t-89-220h-66q30 98 63 248.5T496 238h116z"/><glyph unicode="•" horiz-adv-x="770" d="M231 748q0 89 40.5 134.5T385 928t113.5-47T539 748q0-85-41-133t-113-48-113 47-41 134z"/><glyph unicode="…" horiz-adv-x="1466" d="M162 0zm0 78q0 98 80 98 82 0 82-98t-82-98q-80 0-80 98zm489 0q0 98 80 98 82 0 82-98t-82-98q-80 0-80 98zm490 0q0 98 80 98 82 0 82-98t-82-98q-80 0-80 98z"/><glyph horiz-adv-x="381"/><glyph unicode="‹" horiz-adv-x="524" d="M82 543l309 393 62-43-254-363 254-362-62-43L82 516v27z"/><glyph unicode="›" horiz-adv-x="524" d="M442 518L133 125l-61 43 254 362L72 893l61 43 309-391v-27z"/><glyph unicode="⁄" horiz-adv-x="246" d="M573 1462L-238 0h-94l811 1462h94z"/><glyph horiz-adv-x="476"/><glyph unicode="⁴" horiz-adv-x="688" d="M657 827H528V586h-90v241H25v60l407 581h96V905h129v-78zm-219 78v221q0 132 8 232-6-12-21.5-35.5T129 905h309z"/><glyph unicode="€" d="M803 1397q-174 0-288-125.5T360 907h502v-82H352l-4-104v-24q0-65 4-87h449v-82H358q30-217 147.5-338.5T807 68q148 0 287 65V39Q1013 5 943.5-7.5T803-20q-228 0-367.5 140T254 528H74v82h172q-4 38-4 113l4 102H74v82h184q39 272 183 425t362 153q88 0 161-17t148-57l-39-86q-132 72-270 72z"/><glyph unicode="™" horiz-adv-x="1485" d="M313 741h-86v643H10v78h522v-78H313V741zm600 0l-221 609h-6l4-201V741h-82v721h125l221-606 224 606h125V741h-86v398l4 207h-7L987 741h-74z"/><glyph unicode="−" d="M111 682v82h948v-82H111z"/><glyph unicode="" horiz-adv-x="1085" d="M0 1085h1085V0H0v1085z"/><glyph horiz-adv-x="1219" d="M0 0z"/><hkern u1="&quot;" u2="Ÿ" k="-20"/><hkern u1="&quot;" u2="œ" k="123"/><hkern u1="&quot;" u2="ü" k="61"/><hkern u1="&quot;" u2="û" k="61"/><hkern u1="&quot;" u2="ú" k="61"/><hkern u1="&quot;" u2="ù" k="61"/><hkern u1="&quot;" u2="ø" k="123"/><hkern u1="&quot;" u2="ö" k="123"/><hkern u1="&quot;" u2="õ" k="123"/><hkern u1="&quot;" u2="ô" k="123"/><hkern u1="&quot;" u2="ó" k="123"/><hkern u1="&quot;" u2="ò" k="123"/><hkern u1="&quot;" u2="ë" k="123"/><hkern u1="&quot;" u2="ê" k="123"/><hkern u1="&quot;" u2="é" k="123"/><hkern u1="&quot;" u2="è" k="123"/><hkern u1="&quot;" u2="ç" k="123"/><hkern u1="&quot;" u2="æ" k="82"/><hkern u1="&quot;" u2="å" k="82"/><hkern u1="&quot;" u2="ä" k="82"/><hkern u1="&quot;" u2="ã" k="82"/><hkern u1="&quot;" u2="â" k="82"/><hkern u1="&quot;" u2="á" k="82"/><hkern u1="&quot;" u2="à" k="123"/><hkern u1="&quot;" u2="Ý" k="-20"/><hkern u1="&quot;" u2="Å" k="143"/><hkern u1="&quot;" u2="Ä" k="143"/><hkern u1="&quot;" u2="Ã" k="143"/><hkern u1="&quot;" u2="Â" k="143"/><hkern u1="&quot;" u2="Á" k="143"/><hkern u1="&quot;" u2="À" k="143"/><hkern u1="&quot;" u2="u" k="61"/><hkern u1="&quot;" u2="s" k="61"/><hkern u1="&quot;" u2="r" k="61"/><hkern u1="&quot;" u2="q" k="123"/><hkern u1="&quot;" u2="p" k="61"/><hkern u1="&quot;" u2="o" k="123"/><hkern u1="&quot;" u2="n" k="61"/><hkern u1="&quot;" u2="m" k="61"/><hkern u1="&quot;" u2="g" k="61"/><hkern u1="&quot;" u2="e" k="123"/><hkern u1="&quot;" u2="d" k="123"/><hkern u1="&quot;" u2="c" k="123"/><hkern u1="&quot;" u2="a" k="82"/><hkern u1="&quot;" u2="Y" k="-20"/><hkern u1="&quot;" u2="W" k="-41"/><hkern u1="&quot;" u2="V" k="-41"/><hkern u1="&quot;" u2="T" k="-41"/><hkern u1="&quot;" u2="A" k="143"/><hkern u1="'" u2="Ÿ" k="-20"/><hkern u1="'" u2="œ" k="123"/><hkern u1="'" u2="ü" k="61"/><hkern u1="'" u2="û" k="61"/><hkern u1="'" u2="ú" k="61"/><hkern u1="'" u2="ù" k="61"/><hkern u1="'" u2="ø" k="123"/><hkern u1="'" u2="ö" k="123"/><hkern u1="'" u2="õ" k="123"/><hkern u1="'" u2="ô" k="123"/><hkern u1="'" u2="ó" k="123"/><hkern u1="'" u2="ò" k="123"/><hkern u1="'" u2="ë" k="123"/><hkern u1="'" u2="ê" k="123"/><hkern u1="'" u2="é" k="123"/><hkern u1="'" u2="è" k="123"/><hkern u1="'" u2="ç" k="123"/><hkern u1="'" u2="æ" k="82"/><hkern u1="'" u2="å" k="82"/><hkern u1="'" u2="ä" k="82"/><hkern u1="'" u2="ã" k="82"/><hkern u1="'" u2="â" k="82"/><hkern u1="'" u2="á" k="82"/><hkern u1="'" u2="à" k="123"/><hkern u1="'" u2="Ý" k="-20"/><hkern u1="'" u2="Å" k="143"/><hkern u1="'" u2="Ä" k="143"/><hkern u1="'" u2="Ã" k="143"/><hkern u1="'" u2="Â" k="143"/><hkern u1="'" u2="Á" k="143"/><hkern u1="'" u2="À" k="143"/><hkern u1="'" u2="u" k="61"/><hkern u1="'" u2="s" k="61"/><hkern u1="'" u2="r" k="61"/><hkern u1="'" u2="q" k="123"/><hkern u1="'" u2="p" k="61"/><hkern u1="'" u2="o" k="123"/><hkern u1="'" u2="n" k="61"/><hkern u1="'" u2="m" k="61"/><hkern u1="'" u2="g" k="61"/><hkern u1="'" u2="e" k="123"/><hkern u1="'" u2="d" k="123"/><hkern u1="'" u2="c" k="123"/><hkern u1="'" u2="a" k="82"/><hkern u1="'" u2="Y" k="-20"/><hkern u1="'" u2="W" k="-41"/><hkern u1="'" u2="V" k="-41"/><hkern u1="'" u2="T" k="-41"/><hkern u1="'" u2="A" k="143"/><hkern u1="(" u2="J" k="-184"/><hkern u1="," u2="Ÿ" k="123"/><hkern u1="," u2="Œ" k="102"/><hkern u1="," u2="Ý" k="123"/><hkern u1="," u2="Ü" k="41"/><hkern u1="," u2="Û" k="41"/><hkern u1="," u2="Ú" k="41"/><hkern u1="," u2="Ù" k="41"/><hkern u1="," u2="Ø" k="102"/><hkern u1="," u2="Ö" k="102"/><hkern u1="," u2="Õ" k="102"/><hkern u1="," u2="Ô" k="102"/><hkern u1="," u2="Ó" k="102"/><hkern u1="," u2="Ò" k="102"/><hkern u1="," u2="Ç" k="102"/><hkern u1="," u2="Y" k="123"/><hkern u1="," u2="W" k="123"/><hkern u1="," u2="V" k="123"/><hkern u1="," u2="U" k="41"/><hkern u1="," u2="T" k="143"/><hkern u1="," u2="Q" k="102"/><hkern u1="," u2="O" k="102"/><hkern u1="," u2="G" k="102"/><hkern u1="," u2="C" k="102"/><hkern u1="-" u2="T" k="82"/><hkern u1="." u2="Ÿ" k="123"/><hkern u1="." u2="Œ" k="102"/><hkern u1="." u2="Ý" k="123"/><hkern u1="." u2="Ü" k="41"/><hkern u1="." u2="Û" k="41"/><hkern u1="." u2="Ú" k="41"/><hkern u1="." u2="Ù" k="41"/><hkern u1="." u2="Ø" k="102"/><hkern u1="." u2="Ö" k="102"/><hkern u1="." u2="Õ" k="102"/><hkern u1="." u2="Ô" k="102"/><hkern u1="." u2="Ó" k="102"/><hkern u1="." u2="Ò" k="102"/><hkern u1="." u2="Ç" k="102"/><hkern u1="." u2="Y" k="123"/><hkern u1="." u2="W" k="123"/><hkern u1="." u2="V" k="123"/><hkern u1="." u2="U" k="41"/><hkern u1="." u2="T" k="143"/><hkern u1="." u2="Q" k="102"/><hkern u1="." u2="O" k="102"/><hkern u1="." u2="G" k="102"/><hkern u1="." u2="C" k="102"/><hkern u1="A" u2="”" k="143"/><hkern u1="A" u2="’" k="143"/><hkern u1="A" u2="Ÿ" k="123"/><hkern u1="A" u2="Œ" k="41"/><hkern u1="A" u2="Ý" k="123"/><hkern u1="A" u2="Ø" k="41"/><hkern u1="A" u2="Ö" k="41"/><hkern u1="A" u2="Õ" k="41"/><hkern u1="A" u2="Ô" k="41"/><hkern u1="A" u2="Ó" k="41"/><hkern u1="A" u2="Ò" k="41"/><hkern u1="A" u2="Ç" k="41"/><hkern u1="A" u2="Y" k="123"/><hkern u1="A" u2="W" k="82"/><hkern u1="A" u2="V" k="82"/><hkern u1="A" u2="T" k="143"/><hkern u1="A" u2="Q" k="41"/><hkern u1="A" u2="O" k="41"/><hkern u1="A" u2="J" k="-266"/><hkern u1="A" u2="G" k="41"/><hkern u1="A" u2="C" k="41"/><hkern u1="A" u2="'" k="143"/><hkern u1="A" u2="&quot;" k="143"/><hkern u1="B" u2="„" k="82"/><hkern u1="B" u2="‚" k="82"/><hkern u1="B" u2="Ÿ" k="20"/><hkern u1="B" u2="Ý" k="20"/><hkern u1="B" u2="Å" k="41"/><hkern u1="B" u2="Ä" k="41"/><hkern u1="B" u2="Ã" k="41"/><hkern u1="B" u2="Â" k="41"/><hkern u1="B" u2="Á" k="41"/><hkern u1="B" u2="À" k="41"/><hkern u1="B" u2="Z" k="20"/><hkern u1="B" u2="Y" k="20"/><hkern u1="B" u2="X" k="41"/><hkern u1="B" u2="W" k="20"/><hkern u1="B" u2="V" k="20"/><hkern u1="B" u2="T" k="61"/><hkern u1="B" u2="A" k="41"/><hkern u1="B" u2="." k="82"/><hkern u1="B" u2="," k="82"/><hkern u1="C" u2="Œ" k="41"/><hkern u1="C" u2="Ø" k="41"/><hkern u1="C" u2="Ö" k="41"/><hkern u1="C" u2="Õ" k="41"/><hkern u1="C" u2="Ô" k="41"/><hkern u1="C" u2="Ó" k="41"/><hkern u1="C" u2="Ò" k="41"/><hkern u1="C" u2="Ç" k="41"/><hkern u1="C" u2="Q" k="41"/><hkern u1="C" u2="O" k="41"/><hkern u1="C" u2="G" k="41"/><hkern u1="C" u2="C" k="41"/><hkern u1="D" u2="„" k="82"/><hkern u1="D" u2="‚" k="82"/><hkern u1="D" u2="Ÿ" k="20"/><hkern u1="D" u2="Ý" k="20"/><hkern u1="D" u2="Å" k="41"/><hkern u1="D" u2="Ä" k="41"/><hkern u1="D" u2="Ã" k="41"/><hkern u1="D" u2="Â" k="41"/><hkern u1="D" u2="Á" k="41"/><hkern u1="D" u2="À" k="41"/><hkern u1="D" u2="Z" k="20"/><hkern u1="D" u2="Y" k="20"/><hkern u1="D" u2="X" k="41"/><hkern u1="D" u2="W" k="20"/><hkern u1="D" u2="V" k="20"/><hkern u1="D" u2="T" k="61"/><hkern u1="D" u2="A" k="41"/><hkern u1="D" u2="." k="82"/><hkern u1="D" u2="," k="82"/><hkern u1="E" u2="J" k="-123"/><hkern u1="F" u2="„" k="123"/><hkern u1="F" u2="‚" k="123"/><hkern u1="F" u2="Å" k="41"/><hkern u1="F" u2="Ä" k="41"/><hkern u1="F" u2="Ã" k="41"/><hkern u1="F" u2="Â" k="41"/><hkern u1="F" u2="Á" k="41"/><hkern u1="F" u2="À" k="41"/><hkern u1="F" u2="A" k="41"/><hkern u1="F" u2="?" k="-41"/><hkern u1="F" u2="." k="123"/><hkern u1="F" u2="," k="123"/><hkern u1="K" u2="Œ" k="41"/><hkern u1="K" u2="Ø" k="41"/><hkern u1="K" u2="Ö" k="41"/><hkern u1="K" u2="Õ" k="41"/><hkern u1="K" u2="Ô" k="41"/><hkern u1="K" u2="Ó" k="41"/><hkern u1="K" u2="Ò" k="41"/><hkern u1="K" u2="Ç" k="41"/><hkern u1="K" u2="Q" k="41"/><hkern u1="K" u2="O" k="41"/><hkern u1="K" u2="G" k="41"/><hkern u1="K" u2="C" k="41"/><hkern u1="L" u2="”" k="164"/><hkern u1="L" u2="’" k="164"/><hkern u1="L" u2="Ÿ" k="61"/><hkern u1="L" u2="Œ" k="41"/><hkern u1="L" u2="Ý" k="61"/><hkern u1="L" u2="Ü" k="20"/><hkern u1="L" u2="Û" k="20"/><hkern u1="L" u2="Ú" k="20"/><hkern u1="L" u2="Ù" k="20"/><hkern u1="L" u2="Ø" k="41"/><hkern u1="L" u2="Ö" k="41"/><hkern u1="L" u2="Õ" k="41"/><hkern u1="L" u2="Ô" k="41"/><hkern u1="L" u2="Ó" k="41"/><hkern u1="L" u2="Ò" k="41"/><hkern u1="L" u2="Ç" k="41"/><hkern u1="L" u2="Y" k="61"/><hkern u1="L" u2="W" k="41"/><hkern u1="L" u2="V" k="41"/><hkern u1="L" u2="U" k="20"/><hkern u1="L" u2="T" k="41"/><hkern u1="L" u2="Q" k="41"/><hkern u1="L" u2="O" k="41"/><hkern u1="L" u2="G" k="41"/><hkern u1="L" u2="C" k="41"/><hkern u1="L" u2="'" k="164"/><hkern u1="L" u2="&quot;" k="164"/><hkern u1="O" u2="„" k="82"/><hkern u1="O" u2="‚" k="82"/><hkern u1="O" u2="Ÿ" k="20"/><hkern u1="O" u2="Ý" k="20"/><hkern u1="O" u2="Å" k="41"/><hkern u1="O" u2="Ä" k="41"/><hkern u1="O" u2="Ã" k="41"/><hkern u1="O" u2="Â" k="41"/><hkern u1="O" u2="Á" k="41"/><hkern u1="O" u2="À" k="41"/><hkern u1="O" u2="Z" k="20"/><hkern u1="O" u2="Y" k="20"/><hkern u1="O" u2="X" k="41"/><hkern u1="O" u2="W" k="20"/><hkern u1="O" u2="V" k="20"/><hkern u1="O" u2="T" k="61"/><hkern u1="O" u2="A" k="41"/><hkern u1="O" u2="." k="82"/><hkern u1="O" u2="," k="82"/><hkern u1="P" u2="„" k="266"/><hkern u1="P" u2="‚" k="266"/><hkern u1="P" u2="Å" k="102"/><hkern u1="P" u2="Ä" k="102"/><hkern u1="P" u2="Ã" k="102"/><hkern u1="P" u2="Â" k="102"/><hkern u1="P" u2="Á" k="102"/><hkern u1="P" u2="À" k="102"/><hkern u1="P" u2="Z" k="20"/><hkern u1="P" u2="X" k="41"/><hkern u1="P" u2="A" k="102"/><hkern u1="P" u2="." k="266"/><hkern u1="P" u2="," k="266"/><hkern u1="Q" u2="„" k="82"/><hkern u1="Q" u2="‚" k="82"/><hkern u1="Q" u2="Ÿ" k="20"/><hkern u1="Q" u2="Ý" k="20"/><hkern u1="Q" u2="Å" k="41"/><hkern u1="Q" u2="Ä" k="41"/><hkern u1="Q" u2="Ã" k="41"/><hkern u1="Q" u2="Â" k="41"/><hkern u1="Q" u2="Á" k="41"/><hkern u1="Q" u2="À" k="41"/><hkern u1="Q" u2="Z" k="20"/><hkern u1="Q" u2="Y" k="20"/><hkern u1="Q" u2="X" k="41"/><hkern u1="Q" u2="W" k="20"/><hkern u1="Q" u2="V" k="20"/><hkern u1="Q" u2="T" k="61"/><hkern u1="Q" u2="A" k="41"/><hkern u1="Q" u2="." k="82"/><hkern u1="Q" u2="," k="82"/><hkern u1="T" u2="„" k="123"/><hkern u1="T" u2="‚" k="123"/><hkern u1="T" u2="—" k="82"/><hkern u1="T" u2="–" k="82"/><hkern u1="T" u2="œ" k="143"/><hkern u1="T" u2="Œ" k="41"/><hkern u1="T" u2="ý" k="41"/><hkern u1="T" u2="ü" k="102"/><hkern u1="T" u2="û" k="102"/><hkern u1="T" u2="ú" k="102"/><hkern u1="T" u2="ù" k="102"/><hkern u1="T" u2="ø" k="143"/><hkern u1="T" u2="ö" k="143"/><hkern u1="T" u2="õ" k="143"/><hkern u1="T" u2="ô" k="143"/><hkern u1="T" u2="ó" k="143"/><hkern u1="T" u2="ò" k="143"/><hkern u1="T" u2="ë" k="143"/><hkern u1="T" u2="ê" k="143"/><hkern u1="T" u2="é" k="143"/><hkern u1="T" u2="è" k="143"/><hkern u1="T" u2="ç" k="143"/><hkern u1="T" u2="æ" k="164"/><hkern u1="T" u2="å" k="164"/><hkern u1="T" u2="ä" k="164"/><hkern u1="T" u2="ã" k="164"/><hkern u1="T" u2="â" k="164"/><hkern u1="T" u2="á" k="164"/><hkern u1="T" u2="à" k="143"/><hkern u1="T" u2="Ø" k="41"/><hkern u1="T" u2="Ö" k="41"/><hkern u1="T" u2="Õ" k="41"/><hkern u1="T" u2="Ô" k="41"/><hkern u1="T" u2="Ó" k="41"/><hkern u1="T" u2="Ò" k="41"/><hkern u1="T" u2="Ç" k="41"/><hkern u1="T" u2="Å" k="143"/><hkern u1="T" u2="Ä" k="143"/><hkern u1="T" u2="Ã" k="143"/><hkern u1="T" u2="Â" k="143"/><hkern u1="T" u2="Á" k="143"/><hkern u1="T" u2="À" k="143"/><hkern u1="T" u2="z" k="82"/><hkern u1="T" u2="y" k="41"/><hkern u1="T" u2="x" k="41"/><hkern u1="T" u2="w" k="41"/><hkern u1="T" u2="v" k="41"/><hkern u1="T" u2="u" k="102"/><hkern u1="T" u2="s" k="123"/><hkern u1="T" u2="r" k="102"/><hkern u1="T" u2="q" k="143"/><hkern u1="T" u2="p" k="102"/><hkern u1="T" u2="o" k="143"/><hkern u1="T" u2="n" k="102"/><hkern u1="T" u2="m" k="102"/><hkern u1="T" u2="g" k="143"/><hkern u1="T" u2="e" k="143"/><hkern u1="T" u2="d" k="143"/><hkern u1="T" u2="c" k="143"/><hkern u1="T" u2="a" k="164"/><hkern u1="T" u2="T" k="-41"/><hkern u1="T" u2="Q" k="41"/><hkern u1="T" u2="O" k="41"/><hkern u1="T" u2="G" k="41"/><hkern u1="T" u2="C" k="41"/><hkern u1="T" u2="A" k="143"/><hkern u1="T" u2="?" k="-41"/><hkern u1="T" u2="." k="123"/><hkern u1="T" u2="-" k="82"/><hkern u1="T" u2="," k="123"/><hkern u1="U" u2="„" k="41"/><hkern u1="U" u2="‚" k="41"/><hkern u1="U" u2="Å" k="20"/><hkern u1="U" u2="Ä" k="20"/><hkern u1="U" u2="Ã" k="20"/><hkern u1="U" u2="Â" k="20"/><hkern u1="U" u2="Á" k="20"/><hkern u1="U" u2="À" k="20"/><hkern u1="U" u2="A" k="20"/><hkern u1="U" u2="." k="41"/><hkern u1="U" u2="," k="41"/><hkern u1="V" u2="„" k="102"/><hkern u1="V" u2="‚" k="102"/><hkern u1="V" u2="œ" k="41"/><hkern u1="V" u2="Œ" k="20"/><hkern u1="V" u2="ü" k="20"/><hkern u1="V" u2="û" k="20"/><hkern u1="V" u2="ú" k="20"/><hkern u1="V" u2="ù" k="20"/><hkern u1="V" u2="ø" k="41"/><hkern u1="V" u2="ö" k="41"/><hkern u1="V" u2="õ" k="41"/><hkern u1="V" u2="ô" k="41"/><hkern u1="V" u2="ó" k="41"/><hkern u1="V" u2="ò" k="41"/><hkern u1="V" u2="ë" k="41"/><hkern u1="V" u2="ê" k="41"/><hkern u1="V" u2="é" k="41"/><hkern u1="V" u2="è" k="41"/><hkern u1="V" u2="ç" k="41"/><hkern u1="V" u2="æ" k="41"/><hkern u1="V" u2="å" k="41"/><hkern u1="V" u2="ä" k="41"/><hkern u1="V" u2="ã" k="41"/><hkern u1="V" u2="â" k="41"/><hkern u1="V" u2="á" k="41"/><hkern u1="V" u2="à" k="41"/><hkern u1="V" u2="Ø" k="20"/><hkern u1="V" u2="Ö" k="20"/><hkern u1="V" u2="Õ" k="20"/><hkern u1="V" u2="Ô" k="20"/><hkern u1="V" u2="Ó" k="20"/><hkern u1="V" u2="Ò" k="20"/><hkern u1="V" u2="Ç" k="20"/><hkern u1="V" u2="Å" k="82"/><hkern u1="V" u2="Ä" k="82"/><hkern u1="V" u2="Ã" k="82"/><hkern u1="V" u2="Â" k="82"/><hkern u1="V" u2="Á" k="82"/><hkern u1="V" u2="À" k="82"/><hkern u1="V" u2="u" k="20"/><hkern u1="V" u2="s" k="20"/><hkern u1="V" u2="r" k="20"/><hkern u1="V" u2="q" k="41"/><hkern u1="V" u2="p" k="20"/><hkern u1="V" u2="o" k="41"/><hkern u1="V" u2="n" k="20"/><hkern u1="V" u2="m" k="20"/><hkern u1="V" u2="g" k="20"/><hkern u1="V" u2="e" k="41"/><hkern u1="V" u2="d" k="41"/><hkern u1="V" u2="c" k="41"/><hkern u1="V" u2="a" k="41"/><hkern u1="V" u2="Q" k="20"/><hkern u1="V" u2="O" k="20"/><hkern u1="V" u2="G" k="20"/><hkern u1="V" u2="C" k="20"/><hkern u1="V" u2="A" k="82"/><hkern u1="V" u2="?" k="-41"/><hkern u1="V" u2="." k="102"/><hkern u1="V" u2="," k="102"/><hkern u1="W" u2="„" k="102"/><hkern u1="W" u2="‚" k="102"/><hkern u1="W" u2="œ" k="41"/><hkern u1="W" u2="Œ" k="20"/><hkern u1="W" u2="ü" k="20"/><hkern u1="W" u2="û" k="20"/><hkern u1="W" u2="ú" k="20"/><hkern u1="W" u2="ù" k="20"/><hkern u1="W" u2="ø" k="41"/><hkern u1="W" u2="ö" k="41"/><hkern u1="W" u2="õ" k="41"/><hkern u1="W" u2="ô" k="41"/><hkern u1="W" u2="ó" k="41"/><hkern u1="W" u2="ò" k="41"/><hkern u1="W" u2="ë" k="41"/><hkern u1="W" u2="ê" k="41"/><hkern u1="W" u2="é" k="41"/><hkern u1="W" u2="è" k="41"/><hkern u1="W" u2="ç" k="41"/><hkern u1="W" u2="æ" k="41"/><hkern u1="W" u2="å" k="41"/><hkern u1="W" u2="ä" k="41"/><hkern u1="W" u2="ã" k="41"/><hkern u1="W" u2="â" k="41"/><hkern u1="W" u2="á" k="41"/><hkern u1="W" u2="à" k="41"/><hkern u1="W" u2="Ø" k="20"/><hkern u1="W" u2="Ö" k="20"/><hkern u1="W" u2="Õ" k="20"/><hkern u1="W" u2="Ô" k="20"/><hkern u1="W" u2="Ó" k="20"/><hkern u1="W" u2="Ò" k="20"/><hkern u1="W" u2="Ç" k="20"/><hkern u1="W" u2="Å" k="82"/><hkern u1="W" u2="Ä" k="82"/><hkern u1="W" u2="Ã" k="82"/><hkern u1="W" u2="Â" k="82"/><hkern u1="W" u2="Á" k="82"/><hkern u1="W" u2="À" k="82"/><hkern u1="W" u2="u" k="20"/><hkern u1="W" u2="s" k="20"/><hkern u1="W" u2="r" k="20"/><hkern u1="W" u2="q" k="41"/><hkern u1="W" u2="p" k="20"/><hkern u1="W" u2="o" k="41"/><hkern u1="W" u2="n" k="20"/><hkern u1="W" u2="m" k="20"/><hkern u1="W" u2="g" k="20"/><hkern u1="W" u2="e" k="41"/><hkern u1="W" u2="d" k="41"/><hkern u1="W" u2="c" k="41"/><hkern u1="W" u2="a" k="41"/><hkern u1="W" u2="Q" k="20"/><hkern u1="W" u2="O" k="20"/><hkern u1="W" u2="G" k="20"/><hkern u1="W" u2="C" k="20"/><hkern u1="W" u2="A" k="82"/><hkern u1="W" u2="?" k="-41"/><hkern u1="W" u2="." k="102"/><hkern u1="W" u2="," k="102"/><hkern u1="X" u2="Œ" k="41"/><hkern u1="X" u2="Ø" k="41"/><hkern u1="X" u2="Ö" k="41"/><hkern u1="X" u2="Õ" k="41"/><hkern u1="X" u2="Ô" k="41"/><hkern u1="X" u2="Ó" k="41"/><hkern u1="X" u2="Ò" k="41"/><hkern u1="X" u2="Ç" k="41"/><hkern u1="X" u2="Q" k="41"/><hkern u1="X" u2="O" k="41"/><hkern u1="X" u2="G" k="41"/><hkern u1="X" u2="C" k="41"/><hkern u1="Y" u2="„" k="123"/><hkern u1="Y" u2="‚" k="123"/><hkern u1="Y" u2="œ" k="102"/><hkern u1="Y" u2="Œ" k="41"/><hkern u1="Y" u2="ü" k="61"/><hkern u1="Y" u2="û" k="61"/><hkern u1="Y" u2="ú" k="61"/><hkern u1="Y" u2="ù" k="61"/><hkern u1="Y" u2="ø" k="102"/><hkern u1="Y" u2="ö" k="102"/><hkern u1="Y" u2="õ" k="102"/><hkern u1="Y" u2="ô" k="102"/><hkern u1="Y" u2="ó" k="102"/><hkern u1="Y" u2="ò" k="102"/><hkern u1="Y" u2="ë" k="102"/><hkern u1="Y" u2="ê" k="102"/><hkern u1="Y" u2="é" k="102"/><hkern u1="Y" u2="è" k="102"/><hkern u1="Y" u2="ç" k="102"/><hkern u1="Y" u2="æ" k="102"/><hkern u1="Y" u2="å" k="102"/><hkern u1="Y" u2="ä" k="102"/><hkern u1="Y" u2="ã" k="102"/><hkern u1="Y" u2="â" k="102"/><hkern u1="Y" u2="á" k="102"/><hkern u1="Y" u2="à" k="102"/><hkern u1="Y" u2="Ø" k="41"/><hkern u1="Y" u2="Ö" k="41"/><hkern u1="Y" u2="Õ" k="41"/><hkern u1="Y" u2="Ô" k="41"/><hkern u1="Y" u2="Ó" k="41"/><hkern u1="Y" u2="Ò" k="41"/><hkern u1="Y" u2="Ç" k="41"/><hkern u1="Y" u2="Å" k="123"/><hkern u1="Y" u2="Ä" k="123"/><hkern u1="Y" u2="Ã" k="123"/><hkern u1="Y" u2="Â" k="123"/><hkern u1="Y" u2="Á" k="123"/><hkern u1="Y" u2="À" k="123"/><hkern u1="Y" u2="z" k="41"/><hkern u1="Y" u2="u" k="61"/><hkern u1="Y" u2="s" k="82"/><hkern u1="Y" u2="r" k="61"/><hkern u1="Y" u2="q" k="102"/><hkern u1="Y" u2="p" k="61"/><hkern u1="Y" u2="o" k="102"/><hkern u1="Y" u2="n" k="61"/><hkern u1="Y" u2="m" k="61"/><hkern u1="Y" u2="g" k="41"/><hkern u1="Y" u2="e" k="102"/><hkern u1="Y" u2="d" k="102"/><hkern u1="Y" u2="c" k="102"/><hkern u1="Y" u2="a" k="102"/><hkern u1="Y" u2="Q" k="41"/><hkern u1="Y" u2="O" k="41"/><hkern u1="Y" u2="G" k="41"/><hkern u1="Y" u2="C" k="41"/><hkern u1="Y" u2="A" k="123"/><hkern u1="Y" u2="?" k="-41"/><hkern u1="Y" u2="." k="123"/><hkern u1="Y" u2="," k="123"/><hkern u1="Z" u2="Œ" k="20"/><hkern u1="Z" u2="Ø" k="20"/><hkern u1="Z" u2="Ö" k="20"/><hkern u1="Z" u2="Õ" k="20"/><hkern u1="Z" u2="Ô" k="20"/><hkern u1="Z" u2="Ó" k="20"/><hkern u1="Z" u2="Ò" k="20"/><hkern u1="Z" u2="Ç" k="20"/><hkern u1="Z" u2="Q" k="20"/><hkern u1="Z" u2="O" k="20"/><hkern u1="Z" u2="G" k="20"/><hkern u1="Z" u2="C" k="20"/><hkern u1="[" u2="J" k="-184"/><hkern u1="a" u2="”" k="20"/><hkern u1="a" u2="’" k="20"/><hkern u1="a" u2="'" k="20"/><hkern u1="a" u2="&quot;" k="20"/><hkern u1="b" u2="”" k="20"/><hkern u1="b" u2="’" k="20"/><hkern u1="b" u2="ý" k="41"/><hkern u1="b" u2="z" k="20"/><hkern u1="b" u2="y" k="41"/><hkern u1="b" u2="x" k="41"/><hkern u1="b" u2="w" k="41"/><hkern u1="b" u2="v" k="41"/><hkern u1="b" u2="'" k="20"/><hkern u1="b" u2="&quot;" k="20"/><hkern u1="c" u2="”" k="-41"/><hkern u1="c" u2="’" k="-41"/><hkern u1="c" u2="'" k="-41"/><hkern u1="c" u2="&quot;" k="-41"/><hkern u1="e" u2="”" k="20"/><hkern u1="e" u2="’" k="20"/><hkern u1="e" u2="ý" k="41"/><hkern u1="e" u2="z" k="20"/><hkern u1="e" u2="y" k="41"/><hkern u1="e" u2="x" k="41"/><hkern u1="e" u2="w" k="41"/><hkern u1="e" u2="v" k="41"/><hkern u1="e" u2="'" k="20"/><hkern u1="e" u2="&quot;" k="20"/><hkern u1="f" u2="”" k="-123"/><hkern u1="f" u2="’" k="-123"/><hkern u1="f" u2="'" k="-123"/><hkern u1="f" u2="&quot;" k="-123"/><hkern u1="h" u2="”" k="20"/><hkern u1="h" u2="’" k="20"/><hkern u1="h" u2="'" k="20"/><hkern u1="h" u2="&quot;" k="20"/><hkern u1="k" u2="œ" k="41"/><hkern u1="k" u2="ø" k="41"/><hkern u1="k" u2="ö" k="41"/><hkern u1="k" u2="õ" k="41"/><hkern u1="k" u2="ô" k="41"/><hkern u1="k" u2="ó" k="41"/><hkern u1="k" u2="ò" k="41"/><hkern u1="k" u2="ë" k="41"/><hkern u1="k" u2="ê" k="41"/><hkern u1="k" u2="é" k="41"/><hkern u1="k" u2="è" k="41"/><hkern u1="k" u2="ç" k="41"/><hkern u1="k" u2="à" k="41"/><hkern u1="k" u2="q" k="41"/><hkern u1="k" u2="o" k="41"/><hkern u1="k" u2="e" k="41"/><hkern u1="k" u2="d" k="41"/><hkern u1="k" u2="c" k="41"/><hkern u1="m" u2="”" k="20"/><hkern u1="m" u2="’" k="20"/><hkern u1="m" u2="'" k="20"/><hkern u1="m" u2="&quot;" k="20"/><hkern u1="n" u2="”" k="20"/><hkern u1="n" u2="’" k="20"/><hkern u1="n" u2="'" k="20"/><hkern u1="n" u2="&quot;" k="20"/><hkern u1="o" u2="”" k="20"/><hkern u1="o" u2="’" k="20"/><hkern u1="o" u2="ý" k="41"/><hkern u1="o" u2="z" k="20"/><hkern u1="o" u2="y" k="41"/><hkern u1="o" u2="x" k="41"/><hkern u1="o" u2="w" k="41"/><hkern u1="o" u2="v" k="41"/><hkern u1="o" u2="'" k="20"/><hkern u1="o" u2="&quot;" k="20"/><hkern u1="p" u2="”" k="20"/><hkern u1="p" u2="’" k="20"/><hkern u1="p" u2="ý" k="41"/><hkern u1="p" u2="z" k="20"/><hkern u1="p" u2="y" k="41"/><hkern u1="p" u2="x" k="41"/><hkern u1="p" u2="w" k="41"/><hkern u1="p" u2="v" k="41"/><hkern u1="p" u2="'" k="20"/><hkern u1="p" u2="&quot;" k="20"/><hkern u1="r" u2="”" k="-82"/><hkern u1="r" u2="’" k="-82"/><hkern u1="r" u2="œ" k="41"/><hkern u1="r" u2="ø" k="41"/><hkern u1="r" u2="ö" k="41"/><hkern u1="r" u2="õ" k="41"/><hkern u1="r" u2="ô" k="41"/><hkern u1="r" u2="ó" k="41"/><hkern u1="r" u2="ò" k="41"/><hkern u1="r" u2="ë" k="41"/><hkern u1="r" u2="ê" k="41"/><hkern u1="r" u2="é" k="41"/><hkern u1="r" u2="è" k="41"/><hkern u1="r" u2="ç" k="41"/><hkern u1="r" u2="æ" k="41"/><hkern u1="r" u2="å" k="41"/><hkern u1="r" u2="ä" k="41"/><hkern u1="r" u2="ã" k="41"/><hkern u1="r" u2="â" k="41"/><hkern u1="r" u2="á" k="41"/><hkern u1="r" u2="à" k="41"/><hkern u1="r" u2="q" k="41"/><hkern u1="r" u2="o" k="41"/><hkern u1="r" u2="g" k="20"/><hkern u1="r" u2="e" k="41"/><hkern u1="r" u2="d" k="41"/><hkern u1="r" u2="c" k="41"/><hkern u1="r" u2="a" k="41"/><hkern u1="r" u2="'" k="-82"/><hkern u1="r" u2="&quot;" k="-82"/><hkern u1="t" u2="”" k="-41"/><hkern u1="t" u2="’" k="-41"/><hkern u1="t" u2="'" k="-41"/><hkern u1="t" u2="&quot;" k="-41"/><hkern u1="v" u2="„" k="82"/><hkern u1="v" u2="”" k="-82"/><hkern u1="v" u2="‚" k="82"/><hkern u1="v" u2="’" k="-82"/><hkern u1="v" u2="?" k="-41"/><hkern u1="v" u2="." k="82"/><hkern u1="v" u2="," k="82"/><hkern u1="v" u2="'" k="-82"/><hkern u1="v" u2="&quot;" k="-82"/><hkern u1="w" u2="„" k="82"/><hkern u1="w" u2="”" k="-82"/><hkern u1="w" u2="‚" k="82"/><hkern u1="w" u2="’" k="-82"/><hkern u1="w" u2="?" k="-41"/><hkern u1="w" u2="." k="82"/><hkern u1="w" u2="," k="82"/><hkern u1="w" u2="'" k="-82"/><hkern u1="w" u2="&quot;" k="-82"/><hkern u1="x" u2="œ" k="41"/><hkern u1="x" u2="ø" k="41"/><hkern u1="x" u2="ö" k="41"/><hkern u1="x" u2="õ" k="41"/><hkern u1="x" u2="ô" k="41"/><hkern u1="x" u2="ó" k="41"/><hkern u1="x" u2="ò" k="41"/><hkern u1="x" u2="ë" k="41"/><hkern u1="x" u2="ê" k="41"/><hkern u1="x" u2="é" k="41"/><hkern u1="x" u2="è" k="41"/><hkern u1="x" u2="ç" k="41"/><hkern u1="x" u2="à" k="41"/><hkern u1="x" u2="q" k="41"/><hkern u1="x" u2="o" k="41"/><hkern u1="x" u2="e" k="41"/><hkern u1="x" u2="d" k="41"/><hkern u1="x" u2="c" k="41"/><hkern u1="y" u2="„" k="82"/><hkern u1="y" u2="”" k="-82"/><hkern u1="y" u2="‚" k="82"/><hkern u1="y" u2="’" k="-82"/><hkern u1="y" u2="?" k="-41"/><hkern u1="y" u2="." k="82"/><hkern u1="y" u2="," k="82"/><hkern u1="y" u2="'" k="-82"/><hkern u1="y" u2="&quot;" k="-82"/><hkern u1="{" u2="J" k="-184"/><hkern u1="À" u2="”" k="143"/><hkern u1="À" u2="’" k="143"/><hkern u1="À" u2="Ÿ" k="123"/><hkern u1="À" u2="Œ" k="41"/><hkern u1="À" u2="Ý" k="123"/><hkern u1="À" u2="Ø" k="41"/><hkern u1="À" u2="Ö" k="41"/><hkern u1="À" u2="Õ" k="41"/><hkern u1="À" u2="Ô" k="41"/><hkern u1="À" u2="Ó" k="41"/><hkern u1="À" u2="Ò" k="41"/><hkern u1="À" u2="Ç" k="41"/><hkern u1="À" u2="Y" k="123"/><hkern u1="À" u2="W" k="82"/><hkern u1="À" u2="V" k="82"/><hkern u1="À" u2="T" k="143"/><hkern u1="À" u2="Q" k="41"/><hkern u1="À" u2="O" k="41"/><hkern u1="À" u2="J" k="-266"/><hkern u1="À" u2="G" k="41"/><hkern u1="À" u2="C" k="41"/><hkern u1="À" u2="'" k="143"/><hkern u1="À" u2="&quot;" k="143"/><hkern u1="Á" u2="”" k="143"/><hkern u1="Á" u2="’" k="143"/><hkern u1="Á" u2="Ÿ" k="123"/><hkern u1="Á" u2="Œ" k="41"/><hkern u1="Á" u2="Ý" k="123"/><hkern u1="Á" u2="Ø" k="41"/><hkern u1="Á" u2="Ö" k="41"/><hkern u1="Á" u2="Õ" k="41"/><hkern u1="Á" u2="Ô" k="41"/><hkern u1="Á" u2="Ó" k="41"/><hkern u1="Á" u2="Ò" k="41"/><hkern u1="Á" u2="Ç" k="41"/><hkern u1="Á" u2="Y" k="123"/><hkern u1="Á" u2="W" k="82"/><hkern u1="Á" u2="V" k="82"/><hkern u1="Á" u2="T" k="143"/><hkern u1="Á" u2="Q" k="41"/><hkern u1="Á" u2="O" k="41"/><hkern u1="Á" u2="J" k="-266"/><hkern u1="Á" u2="G" k="41"/><hkern u1="Á" u2="C" k="41"/><hkern u1="Á" u2="'" k="143"/><hkern u1="Á" u2="&quot;" k="143"/><hkern u1="Â" u2="”" k="143"/><hkern u1="Â" u2="’" k="143"/><hkern u1="Â" u2="Ÿ" k="123"/><hkern u1="Â" u2="Œ" k="41"/><hkern u1="Â" u2="Ý" k="123"/><hkern u1="Â" u2="Ø" k="41"/><hkern u1="Â" u2="Ö" k="41"/><hkern u1="Â" u2="Õ" k="41"/><hkern u1="Â" u2="Ô" k="41"/><hkern u1="Â" u2="Ó" k="41"/><hkern u1="Â" u2="Ò" k="41"/><hkern u1="Â" u2="Ç" k="41"/><hkern u1="Â" u2="Y" k="123"/><hkern u1="Â" u2="W" k="82"/><hkern u1="Â" u2="V" k="82"/><hkern u1="Â" u2="T" k="143"/><hkern u1="Â" u2="Q" k="41"/><hkern u1="Â" u2="O" k="41"/><hkern u1="Â" u2="J" k="-266"/><hkern u1="Â" u2="G" k="41"/><hkern u1="Â" u2="C" k="41"/><hkern u1="Â" u2="'" k="143"/><hkern u1="Â" u2="&quot;" k="143"/><hkern u1="Ã" u2="”" k="143"/><hkern u1="Ã" u2="’" k="143"/><hkern u1="Ã" u2="Ÿ" k="123"/><hkern u1="Ã" u2="Œ" k="41"/><hkern u1="Ã" u2="Ý" k="123"/><hkern u1="Ã" u2="Ø" k="41"/><hkern u1="Ã" u2="Ö" k="41"/><hkern u1="Ã" u2="Õ" k="41"/><hkern u1="Ã" u2="Ô" k="41"/><hkern u1="Ã" u2="Ó" k="41"/><hkern u1="Ã" u2="Ò" k="41"/><hkern u1="Ã" u2="Ç" k="41"/><hkern u1="Ã" u2="Y" k="123"/><hkern u1="Ã" u2="W" k="82"/><hkern u1="Ã" u2="V" k="82"/><hkern u1="Ã" u2="T" k="143"/><hkern u1="Ã" u2="Q" k="41"/><hkern u1="Ã" u2="O" k="41"/><hkern u1="Ã" u2="J" k="-266"/><hkern u1="Ã" u2="G" k="41"/><hkern u1="Ã" u2="C" k="41"/><hkern u1="Ã" u2="'" k="143"/><hkern u1="Ã" u2="&quot;" k="143"/><hkern u1="Ä" u2="”" k="143"/><hkern u1="Ä" u2="’" k="143"/><hkern u1="Ä" u2="Ÿ" k="123"/><hkern u1="Ä" u2="Œ" k="41"/><hkern u1="Ä" u2="Ý" k="123"/><hkern u1="Ä" u2="Ø" k="41"/><hkern u1="Ä" u2="Ö" k="41"/><hkern u1="Ä" u2="Õ" k="41"/><hkern u1="Ä" u2="Ô" k="41"/><hkern u1="Ä" u2="Ó" k="41"/><hkern u1="Ä" u2="Ò" k="41"/><hkern u1="Ä" u2="Ç" k="41"/><hkern u1="Ä" u2="Y" k="123"/><hkern u1="Ä" u2="W" k="82"/><hkern u1="Ä" u2="V" k="82"/><hkern u1="Ä" u2="T" k="143"/><hkern u1="Ä" u2="Q" k="41"/><hkern u1="Ä" u2="O" k="41"/><hkern u1="Ä" u2="J" k="-266"/><hkern u1="Ä" u2="G" k="41"/><hkern u1="Ä" u2="C" k="41"/><hkern u1="Ä" u2="'" k="143"/><hkern u1="Ä" u2="&quot;" k="143"/><hkern u1="Å" u2="”" k="143"/><hkern u1="Å" u2="’" k="143"/><hkern u1="Å" u2="Ÿ" k="123"/><hkern u1="Å" u2="Œ" k="41"/><hkern u1="Å" u2="Ý" k="123"/><hkern u1="Å" u2="Ø" k="41"/><hkern u1="Å" u2="Ö" k="41"/><hkern u1="Å" u2="Õ" k="41"/><hkern u1="Å" u2="Ô" k="41"/><hkern u1="Å" u2="Ó" k="41"/><hkern u1="Å" u2="Ò" k="41"/><hkern u1="Å" u2="Ç" k="41"/><hkern u1="Å" u2="Y" k="123"/><hkern u1="Å" u2="W" k="82"/><hkern u1="Å" u2="V" k="82"/><hkern u1="Å" u2="T" k="143"/><hkern u1="Å" u2="Q" k="41"/><hkern u1="Å" u2="O" k="41"/><hkern u1="Å" u2="J" k="-266"/><hkern u1="Å" u2="G" k="41"/><hkern u1="Å" u2="C" k="41"/><hkern u1="Å" u2="'" k="143"/><hkern u1="Å" u2="&quot;" k="143"/><hkern u1="Æ" u2="J" k="-123"/><hkern u1="Ç" u2="Œ" k="41"/><hkern u1="Ç" u2="Ø" k="41"/><hkern u1="Ç" u2="Ö" k="41"/><hkern u1="Ç" u2="Õ" k="41"/><hkern u1="Ç" u2="Ô" k="41"/><hkern u1="Ç" u2="Ó" k="41"/><hkern u1="Ç" u2="Ò" k="41"/><hkern u1="Ç" u2="Ç" k="41"/><hkern u1="Ç" u2="Q" k="41"/><hkern u1="Ç" u2="O" k="41"/><hkern u1="Ç" u2="G" k="41"/><hkern u1="Ç" u2="C" k="41"/><hkern u1="È" u2="J" k="-123"/><hkern u1="É" u2="J" k="-123"/><hkern u1="Ê" u2="J" k="-123"/><hkern u1="Ë" u2="J" k="-123"/><hkern u1="Ð" u2="„" k="82"/><hkern u1="Ð" u2="‚" k="82"/><hkern u1="Ð" u2="Ÿ" k="20"/><hkern u1="Ð" u2="Ý" k="20"/><hkern u1="Ð" u2="Å" k="41"/><hkern u1="Ð" u2="Ä" k="41"/><hkern u1="Ð" u2="Ã" k="41"/><hkern u1="Ð" u2="Â" k="41"/><hkern u1="Ð" u2="Á" k="41"/><hkern u1="Ð" u2="À" k="41"/><hkern u1="Ð" u2="Z" k="20"/><hkern u1="Ð" u2="Y" k="20"/><hkern u1="Ð" u2="X" k="41"/><hkern u1="Ð" u2="W" k="20"/><hkern u1="Ð" u2="V" k="20"/><hkern u1="Ð" u2="T" k="61"/><hkern u1="Ð" u2="A" k="41"/><hkern u1="Ð" u2="." k="82"/><hkern u1="Ð" u2="," k="82"/><hkern u1="Ò" u2="„" k="82"/><hkern u1="Ò" u2="‚" k="82"/><hkern u1="Ò" u2="Ÿ" k="20"/><hkern u1="Ò" u2="Ý" k="20"/><hkern u1="Ò" u2="Å" k="41"/><hkern u1="Ò" u2="Ä" k="41"/><hkern u1="Ò" u2="Ã" k="41"/><hkern u1="Ò" u2="Â" k="41"/><hkern u1="Ò" u2="Á" k="41"/><hkern u1="Ò" u2="À" k="41"/><hkern u1="Ò" u2="Z" k="20"/><hkern u1="Ò" u2="Y" k="20"/><hkern u1="Ò" u2="X" k="41"/><hkern u1="Ò" u2="W" k="20"/><hkern u1="Ò" u2="V" k="20"/><hkern u1="Ò" u2="T" k="61"/><hkern u1="Ò" u2="A" k="41"/><hkern u1="Ò" u2="." k="82"/><hkern u1="Ò" u2="," k="82"/><hkern u1="Ó" u2="„" k="82"/><hkern u1="Ó" u2="‚" k="82"/><hkern u1="Ó" u2="Ÿ" k="20"/><hkern u1="Ó" u2="Ý" k="20"/><hkern u1="Ó" u2="Å" k="41"/><hkern u1="Ó" u2="Ä" k="41"/><hkern u1="Ó" u2="Ã" k="41"/><hkern u1="Ó" u2="Â" k="41"/><hkern u1="Ó" u2="Á" k="41"/><hkern u1="Ó" u2="À" k="41"/><hkern u1="Ó" u2="Z" k="20"/><hkern u1="Ó" u2="Y" k="20"/><hkern u1="Ó" u2="X" k="41"/><hkern u1="Ó" u2="W" k="20"/><hkern u1="Ó" u2="V" k="20"/><hkern u1="Ó" u2="T" k="61"/><hkern u1="Ó" u2="A" k="41"/><hkern u1="Ó" u2="." k="82"/><hkern u1="Ó" u2="," k="82"/><hkern u1="Ô" u2="„" k="82"/><hkern u1="Ô" u2="‚" k="82"/><hkern u1="Ô" u2="Ÿ" k="20"/><hkern u1="Ô" u2="Ý" k="20"/><hkern u1="Ô" u2="Å" k="41"/><hkern u1="Ô" u2="Ä" k="41"/><hkern u1="Ô" u2="Ã" k="41"/><hkern u1="Ô" u2="Â" k="41"/><hkern u1="Ô" u2="Á" k="41"/><hkern u1="Ô" u2="À" k="41"/><hkern u1="Ô" u2="Z" k="20"/><hkern u1="Ô" u2="Y" k="20"/><hkern u1="Ô" u2="X" k="41"/><hkern u1="Ô" u2="W" k="20"/><hkern u1="Ô" u2="V" k="20"/><hkern u1="Ô" u2="T" k="61"/><hkern u1="Ô" u2="A" k="41"/><hkern u1="Ô" u2="." k="82"/><hkern u1="Ô" u2="," k="82"/><hkern u1="Õ" u2="„" k="82"/><hkern u1="Õ" u2="‚" k="82"/><hkern u1="Õ" u2="Ÿ" k="20"/><hkern u1="Õ" u2="Ý" k="20"/><hkern u1="Õ" u2="Å" k="41"/><hkern u1="Õ" u2="Ä" k="41"/><hkern u1="Õ" u2="Ã" k="41"/><hkern u1="Õ" u2="Â" k="41"/><hkern u1="Õ" u2="Á" k="41"/><hkern u1="Õ" u2="À" k="41"/><hkern u1="Õ" u2="Z" k="20"/><hkern u1="Õ" u2="Y" k="20"/><hkern u1="Õ" u2="X" k="41"/><hkern u1="Õ" u2="W" k="20"/><hkern u1="Õ" u2="V" k="20"/><hkern u1="Õ" u2="T" k="61"/><hkern u1="Õ" u2="A" k="41"/><hkern u1="Õ" u2="." k="82"/><hkern u1="Õ" u2="," k="82"/><hkern u1="Ö" u2="„" k="82"/><hkern u1="Ö" u2="‚" k="82"/><hkern u1="Ö" u2="Ÿ" k="20"/><hkern u1="Ö" u2="Ý" k="20"/><hkern u1="Ö" u2="Å" k="41"/><hkern u1="Ö" u2="Ä" k="41"/><hkern u1="Ö" u2="Ã" k="41"/><hkern u1="Ö" u2="Â" k="41"/><hkern u1="Ö" u2="Á" k="41"/><hkern u1="Ö" u2="À" k="41"/><hkern u1="Ö" u2="Z" k="20"/><hkern u1="Ö" u2="Y" k="20"/><hkern u1="Ö" u2="X" k="41"/><hkern u1="Ö" u2="W" k="20"/><hkern u1="Ö" u2="V" k="20"/><hkern u1="Ö" u2="T" k="61"/><hkern u1="Ö" u2="A" k="41"/><hkern u1="Ö" u2="." k="82"/><hkern u1="Ö" u2="," k="82"/><hkern u1="Ø" u2="„" k="82"/><hkern u1="Ø" u2="‚" k="82"/><hkern u1="Ø" u2="Ÿ" k="20"/><hkern u1="Ø" u2="Ý" k="20"/><hkern u1="Ø" u2="Å" k="41"/><hkern u1="Ø" u2="Ä" k="41"/><hkern u1="Ø" u2="Ã" k="41"/><hkern u1="Ø" u2="Â" k="41"/><hkern u1="Ø" u2="Á" k="41"/><hkern u1="Ø" u2="À" k="41"/><hkern u1="Ø" u2="Z" k="20"/><hkern u1="Ø" u2="Y" k="20"/><hkern u1="Ø" u2="X" k="41"/><hkern u1="Ø" u2="W" k="20"/><hkern u1="Ø" u2="V" k="20"/><hkern u1="Ø" u2="T" k="61"/><hkern u1="Ø" u2="A" k="41"/><hkern u1="Ø" u2="." k="82"/><hkern u1="Ø" u2="," k="82"/><hkern u1="Ù" u2="„" k="41"/><hkern u1="Ù" u2="‚" k="41"/><hkern u1="Ù" u2="Å" k="20"/><hkern u1="Ù" u2="Ä" k="20"/><hkern u1="Ù" u2="Ã" k="20"/><hkern u1="Ù" u2="Â" k="20"/><hkern u1="Ù" u2="Á" k="20"/><hkern u1="Ù" u2="À" k="20"/><hkern u1="Ù" u2="A" k="20"/><hkern u1="Ù" u2="." k="41"/><hkern u1="Ù" u2="," k="41"/><hkern u1="Ú" u2="„" k="41"/><hkern u1="Ú" u2="‚" k="41"/><hkern u1="Ú" u2="Å" k="20"/><hkern u1="Ú" u2="Ä" k="20"/><hkern u1="Ú" u2="Ã" k="20"/><hkern u1="Ú" u2="Â" k="20"/><hkern u1="Ú" u2="Á" k="20"/><hkern u1="Ú" u2="À" k="20"/><hkern u1="Ú" u2="A" k="20"/><hkern u1="Ú" u2="." k="41"/><hkern u1="Ú" u2="," k="41"/><hkern u1="Û" u2="„" k="41"/><hkern u1="Û" u2="‚" k="41"/><hkern u1="Û" u2="Å" k="20"/><hkern u1="Û" u2="Ä" k="20"/><hkern u1="Û" u2="Ã" k="20"/><hkern u1="Û" u2="Â" k="20"/><hkern u1="Û" u2="Á" k="20"/><hkern u1="Û" u2="À" k="20"/><hkern u1="Û" u2="A" k="20"/><hkern u1="Û" u2="." k="41"/><hkern u1="Û" u2="," k="41"/><hkern u1="Ü" u2="„" k="41"/><hkern u1="Ü" u2="‚" k="41"/><hkern u1="Ü" u2="Å" k="20"/><hkern u1="Ü" u2="Ä" k="20"/><hkern u1="Ü" u2="Ã" k="20"/><hkern u1="Ü" u2="Â" k="20"/><hkern u1="Ü" u2="Á" k="20"/><hkern u1="Ü" u2="À" k="20"/><hkern u1="Ü" u2="A" k="20"/><hkern u1="Ü" u2="." k="41"/><hkern u1="Ü" u2="," k="41"/><hkern u1="Ý" u2="„" k="123"/><hkern u1="Ý" u2="‚" k="123"/><hkern u1="Ý" u2="œ" k="102"/><hkern u1="Ý" u2="Œ" k="41"/><hkern u1="Ý" u2="ü" k="61"/><hkern u1="Ý" u2="û" k="61"/><hkern u1="Ý" u2="ú" k="61"/><hkern u1="Ý" u2="ù" k="61"/><hkern u1="Ý" u2="ø" k="102"/><hkern u1="Ý" u2="ö" k="102"/><hkern u1="Ý" u2="õ" k="102"/><hkern u1="Ý" u2="ô" k="102"/><hkern u1="Ý" u2="ó" k="102"/><hkern u1="Ý" u2="ò" k="102"/><hkern u1="Ý" u2="ë" k="102"/><hkern u1="Ý" u2="ê" k="102"/><hkern u1="Ý" u2="é" k="102"/><hkern u1="Ý" u2="è" k="102"/><hkern u1="Ý" u2="ç" k="102"/><hkern u1="Ý" u2="æ" k="102"/><hkern u1="Ý" u2="å" k="102"/><hkern u1="Ý" u2="ä" k="102"/><hkern u1="Ý" u2="ã" k="102"/><hkern u1="Ý" u2="â" k="102"/><hkern u1="Ý" u2="á" k="102"/><hkern u1="Ý" u2="à" k="102"/><hkern u1="Ý" u2="Ø" k="41"/><hkern u1="Ý" u2="Ö" k="41"/><hkern u1="Ý" u2="Õ" k="41"/><hkern u1="Ý" u2="Ô" k="41"/><hkern u1="Ý" u2="Ó" k="41"/><hkern u1="Ý" u2="Ò" k="41"/><hkern u1="Ý" u2="Ç" k="41"/><hkern u1="Ý" u2="Å" k="123"/><hkern u1="Ý" u2="Ä" k="123"/><hkern u1="Ý" u2="Ã" k="123"/><hkern u1="Ý" u2="Â" k="123"/><hkern u1="Ý" u2="Á" k="123"/><hkern u1="Ý" u2="À" k="123"/><hkern u1="Ý" u2="z" k="41"/><hkern u1="Ý" u2="u" k="61"/><hkern u1="Ý" u2="s" k="82"/><hkern u1="Ý" u2="r" k="61"/><hkern u1="Ý" u2="q" k="102"/><hkern u1="Ý" u2="p" k="61"/><hkern u1="Ý" u2="o" k="102"/><hkern u1="Ý" u2="n" k="61"/><hkern u1="Ý" u2="m" k="61"/><hkern u1="Ý" u2="g" k="41"/><hkern u1="Ý" u2="e" k="102"/><hkern u1="Ý" u2="d" k="102"/><hkern u1="Ý" u2="c" k="102"/><hkern u1="Ý" u2="a" k="102"/><hkern u1="Ý" u2="Q" k="41"/><hkern u1="Ý" u2="O" k="41"/><hkern u1="Ý" u2="G" k="41"/><hkern u1="Ý" u2="C" k="41"/><hkern u1="Ý" u2="A" k="123"/><hkern u1="Ý" u2="?" k="-41"/><hkern u1="Ý" u2="." k="123"/><hkern u1="Ý" u2="," k="123"/><hkern u1="Þ" u2="„" k="266"/><hkern u1="Þ" u2="‚" k="266"/><hkern u1="Þ" u2="Å" k="102"/><hkern u1="Þ" u2="Ä" k="102"/><hkern u1="Þ" u2="Ã" k="102"/><hkern u1="Þ" u2="Â" k="102"/><hkern u1="Þ" u2="Á" k="102"/><hkern u1="Þ" u2="À" k="102"/><hkern u1="Þ" u2="Z" k="20"/><hkern u1="Þ" u2="X" k="41"/><hkern u1="Þ" u2="A" k="102"/><hkern u1="Þ" u2="." k="266"/><hkern u1="Þ" u2="," k="266"/><hkern u1="à" u2="”" k="20"/><hkern u1="à" u2="’" k="20"/><hkern u1="à" u2="'" k="20"/><hkern u1="à" u2="&quot;" k="20"/><hkern u1="á" u2="”" k="20"/><hkern u1="á" u2="’" k="20"/><hkern u1="á" u2="'" k="20"/><hkern u1="á" u2="&quot;" k="20"/><hkern u1="â" u2="”" k="20"/><hkern u1="â" u2="’" k="20"/><hkern u1="â" u2="'" k="20"/><hkern u1="â" u2="&quot;" k="20"/><hkern u1="ã" u2="”" k="20"/><hkern u1="ã" u2="’" k="20"/><hkern u1="ã" u2="'" k="20"/><hkern u1="ã" u2="&quot;" k="20"/><hkern u1="ä" u2="”" k="20"/><hkern u1="ä" u2="’" k="20"/><hkern u1="ä" u2="'" k="20"/><hkern u1="ä" u2="&quot;" k="20"/><hkern u1="å" u2="”" k="20"/><hkern u1="å" u2="’" k="20"/><hkern u1="å" u2="'" k="20"/><hkern u1="å" u2="&quot;" k="20"/><hkern u1="è" u2="”" k="20"/><hkern u1="è" u2="’" k="20"/><hkern u1="è" u2="ý" k="41"/><hkern u1="è" u2="z" k="20"/><hkern u1="è" u2="y" k="41"/><hkern u1="è" u2="x" k="41"/><hkern u1="è" u2="w" k="41"/><hkern u1="è" u2="v" k="41"/><hkern u1="è" u2="'" k="20"/><hkern u1="è" u2="&quot;" k="20"/><hkern u1="é" u2="”" k="20"/><hkern u1="é" u2="’" k="20"/><hkern u1="é" u2="ý" k="41"/><hkern u1="é" u2="z" k="20"/><hkern u1="é" u2="y" k="41"/><hkern u1="é" u2="x" k="41"/><hkern u1="é" u2="w" k="41"/><hkern u1="é" u2="v" k="41"/><hkern u1="é" u2="'" k="20"/><hkern u1="é" u2="&quot;" k="20"/><hkern u1="ê" u2="”" k="20"/><hkern u1="ê" u2="’" k="20"/><hkern u1="ê" u2="ý" k="41"/><hkern u1="ê" u2="z" k="20"/><hkern u1="ê" u2="y" k="41"/><hkern u1="ê" u2="x" k="41"/><hkern u1="ê" u2="w" k="41"/><hkern u1="ê" u2="v" k="41"/><hkern u1="ê" u2="'" k="20"/><hkern u1="ê" u2="&quot;" k="20"/><hkern u1="ë" u2="”" k="20"/><hkern u1="ë" u2="’" k="20"/><hkern u1="ë" u2="ý" k="41"/><hkern u1="ë" u2="z" k="20"/><hkern u1="ë" u2="y" k="41"/><hkern u1="ë" u2="x" k="41"/><hkern u1="ë" u2="w" k="41"/><hkern u1="ë" u2="v" k="41"/><hkern u1="ë" u2="'" k="20"/><hkern u1="ë" u2="&quot;" k="20"/><hkern u1="ð" u2="”" k="20"/><hkern u1="ð" u2="’" k="20"/><hkern u1="ð" u2="ý" k="41"/><hkern u1="ð" u2="z" k="20"/><hkern u1="ð" u2="y" k="41"/><hkern u1="ð" u2="x" k="41"/><hkern u1="ð" u2="w" k="41"/><hkern u1="ð" u2="v" k="41"/><hkern u1="ð" u2="'" k="20"/><hkern u1="ð" u2="&quot;" k="20"/><hkern u1="ò" u2="”" k="20"/><hkern u1="ò" u2="’" k="20"/><hkern u1="ò" u2="ý" k="41"/><hkern u1="ò" u2="z" k="20"/><hkern u1="ò" u2="y" k="41"/><hkern u1="ò" u2="x" k="41"/><hkern u1="ò" u2="w" k="41"/><hkern u1="ò" u2="v" k="41"/><hkern u1="ò" u2="'" k="20"/><hkern u1="ò" u2="&quot;" k="20"/><hkern u1="ó" u2="”" k="20"/><hkern u1="ó" u2="’" k="20"/><hkern u1="ó" u2="ý" k="41"/><hkern u1="ó" u2="z" k="20"/><hkern u1="ó" u2="y" k="41"/><hkern u1="ó" u2="x" k="41"/><hkern u1="ó" u2="w" k="41"/><hkern u1="ó" u2="v" k="41"/><hkern u1="ó" u2="'" k="20"/><hkern u1="ó" u2="&quot;" k="20"/><hkern u1="ô" u2="”" k="20"/><hkern u1="ô" u2="’" k="20"/><hkern u1="ô" u2="ý" k="41"/><hkern u1="ô" u2="z" k="20"/><hkern u1="ô" u2="y" k="41"/><hkern u1="ô" u2="x" k="41"/><hkern u1="ô" u2="w" k="41"/><hkern u1="ô" u2="v" k="41"/><hkern u1="ô" u2="'" k="20"/><hkern u1="ô" u2="&quot;" k="20"/><hkern u1="ö" u2="”" k="41"/><hkern u1="ö" u2="’" k="41"/><hkern u1="ö" u2="'" k="41"/><hkern u1="ö" u2="&quot;" k="41"/><hkern u1="ø" u2="”" k="20"/><hkern u1="ø" u2="’" k="20"/><hkern u1="ø" u2="ý" k="41"/><hkern u1="ø" u2="z" k="20"/><hkern u1="ø" u2="y" k="41"/><hkern u1="ø" u2="x" k="41"/><hkern u1="ø" u2="w" k="41"/><hkern u1="ø" u2="v" k="41"/><hkern u1="ø" u2="'" k="20"/><hkern u1="ø" u2="&quot;" k="20"/><hkern u1="ý" u2="„" k="82"/><hkern u1="ý" u2="”" k="-82"/><hkern u1="ý" u2="‚" k="82"/><hkern u1="ý" u2="’" k="-82"/><hkern u1="ý" u2="?" k="-41"/><hkern u1="ý" u2="." k="82"/><hkern u1="ý" u2="," k="82"/><hkern u1="ý" u2="'" k="-82"/><hkern u1="ý" u2="&quot;" k="-82"/><hkern u1="þ" u2="”" k="20"/><hkern u1="þ" u2="’" k="20"/><hkern u1="þ" u2="ý" k="41"/><hkern u1="þ" u2="z" k="20"/><hkern u1="þ" u2="y" k="41"/><hkern u1="þ" u2="x" k="41"/><hkern u1="þ" u2="w" k="41"/><hkern u1="þ" u2="v" k="41"/><hkern u1="þ" u2="'" k="20"/><hkern u1="þ" u2="&quot;" k="20"/><hkern u1="ÿ" u2="„" k="82"/><hkern u1="ÿ" u2="”" k="-82"/><hkern u1="ÿ" u2="‚" k="82"/><hkern u1="ÿ" u2="’" k="-82"/><hkern u1="ÿ" u2="?" k="-41"/><hkern u1="ÿ" u2="." k="82"/><hkern u1="ÿ" u2="," k="82"/><hkern u1="ÿ" u2="'" k="-82"/><hkern u1="ÿ" u2="&quot;" k="-82"/><hkern u1="Œ" u2="J" k="-123"/><hkern u1="Ÿ" u2="„" k="123"/><hkern u1="Ÿ" u2="‚" k="123"/><hkern u1="Ÿ" u2="œ" k="102"/><hkern u1="Ÿ" u2="Œ" k="41"/><hkern u1="Ÿ" u2="ü" k="61"/><hkern u1="Ÿ" u2="û" k="61"/><hkern u1="Ÿ" u2="ú" k="61"/><hkern u1="Ÿ" u2="ù" k="61"/><hkern u1="Ÿ" u2="ø" k="102"/><hkern u1="Ÿ" u2="ö" k="102"/><hkern u1="Ÿ" u2="õ" k="102"/><hkern u1="Ÿ" u2="ô" k="102"/><hkern u1="Ÿ" u2="ó" k="102"/><hkern u1="Ÿ" u2="ò" k="102"/><hkern u1="Ÿ" u2="ë" k="102"/><hkern u1="Ÿ" u2="ê" k="102"/><hkern u1="Ÿ" u2="é" k="102"/><hkern u1="Ÿ" u2="è" k="102"/><hkern u1="Ÿ" u2="ç" k="102"/><hkern u1="Ÿ" u2="æ" k="102"/><hkern u1="Ÿ" u2="å" k="102"/><hkern u1="Ÿ" u2="ä" k="102"/><hkern u1="Ÿ" u2="ã" k="102"/><hkern u1="Ÿ" u2="â" k="102"/><hkern u1="Ÿ" u2="á" k="102"/><hkern u1="Ÿ" u2="à" k="102"/><hkern u1="Ÿ" u2="Ø" k="41"/><hkern u1="Ÿ" u2="Ö" k="41"/><hkern u1="Ÿ" u2="Õ" k="41"/><hkern u1="Ÿ" u2="Ô" k="41"/><hkern u1="Ÿ" u2="Ó" k="41"/><hkern u1="Ÿ" u2="Ò" k="41"/><hkern u1="Ÿ" u2="Ç" k="41"/><hkern u1="Ÿ" u2="Å" k="123"/><hkern u1="Ÿ" u2="Ä" k="123"/><hkern u1="Ÿ" u2="Ã" k="123"/><hkern u1="Ÿ" u2="Â" k="123"/><hkern u1="Ÿ" u2="Á" k="123"/><hkern u1="Ÿ" u2="À" k="123"/><hkern u1="Ÿ" u2="z" k="41"/><hkern u1="Ÿ" u2="u" k="61"/><hkern u1="Ÿ" u2="s" k="82"/><hkern u1="Ÿ" u2="r" k="61"/><hkern u1="Ÿ" u2="q" k="102"/><hkern u1="Ÿ" u2="p" k="61"/><hkern u1="Ÿ" u2="o" k="102"/><hkern u1="Ÿ" u2="n" k="61"/><hkern u1="Ÿ" u2="m" k="61"/><hkern u1="Ÿ" u2="g" k="41"/><hkern u1="Ÿ" u2="e" k="102"/><hkern u1="Ÿ" u2="d" k="102"/><hkern u1="Ÿ" u2="c" k="102"/><hkern u1="Ÿ" u2="a" k="102"/><hkern u1="Ÿ" u2="Q" k="41"/><hkern u1="Ÿ" u2="O" k="41"/><hkern u1="Ÿ" u2="G" k="41"/><hkern u1="Ÿ" u2="C" k="41"/><hkern u1="Ÿ" u2="A" k="123"/><hkern u1="Ÿ" u2="?" k="-41"/><hkern u1="Ÿ" u2="." k="123"/><hkern u1="Ÿ" u2="," k="123"/><hkern u1="–" u2="T" k="82"/><hkern u1="—" u2="T" k="82"/><hkern u1="‘" u2="Ÿ" k="-20"/><hkern u1="‘" u2="œ" k="123"/><hkern u1="‘" u2="ü" k="61"/><hkern u1="‘" u2="û" k="61"/><hkern u1="‘" u2="ú" k="61"/><hkern u1="‘" u2="ù" k="61"/><hkern u1="‘" u2="ø" k="123"/><hkern u1="‘" u2="ö" k="123"/><hkern u1="‘" u2="õ" k="123"/><hkern u1="‘" u2="ô" k="123"/><hkern u1="‘" u2="ó" k="123"/><hkern u1="‘" u2="ò" k="123"/><hkern u1="‘" u2="ë" k="123"/><hkern u1="‘" u2="ê" k="123"/><hkern u1="‘" u2="é" k="123"/><hkern u1="‘" u2="è" k="123"/><hkern u1="‘" u2="ç" k="123"/><hkern u1="‘" u2="æ" k="82"/><hkern u1="‘" u2="å" k="82"/><hkern u1="‘" u2="ä" k="82"/><hkern u1="‘" u2="ã" k="82"/><hkern u1="‘" u2="â" k="82"/><hkern u1="‘" u2="á" k="82"/><hkern u1="‘" u2="à" k="123"/><hkern u1="‘" u2="Ý" k="-20"/><hkern u1="‘" u2="Å" k="143"/><hkern u1="‘" u2="Ä" k="143"/><hkern u1="‘" u2="Ã" k="143"/><hkern u1="‘" u2="Â" k="143"/><hkern u1="‘" u2="Á" k="143"/><hkern u1="‘" u2="À" k="143"/><hkern u1="‘" u2="u" k="61"/><hkern u1="‘" u2="s" k="61"/><hkern u1="‘" u2="r" k="61"/><hkern u1="‘" u2="q" k="123"/><hkern u1="‘" u2="p" k="61"/><hkern u1="‘" u2="o" k="123"/><hkern u1="‘" u2="n" k="61"/><hkern u1="‘" u2="m" k="61"/><hkern u1="‘" u2="g" k="61"/><hkern u1="‘" u2="e" k="123"/><hkern u1="‘" u2="d" k="123"/><hkern u1="‘" u2="c" k="123"/><hkern u1="‘" u2="a" k="82"/><hkern u1="‘" u2="Y" k="-20"/><hkern u1="‘" u2="W" k="-41"/><hkern u1="‘" u2="V" k="-41"/><hkern u1="‘" u2="T" k="-41"/><hkern u1="‘" u2="A" k="143"/><hkern u1="’" u2="Ÿ" k="-20"/><hkern u1="’" u2="œ" k="123"/><hkern u1="’" u2="ü" k="61"/><hkern u1="’" u2="û" k="61"/><hkern u1="’" u2="ú" k="61"/><hkern u1="’" u2="ù" k="61"/><hkern u1="’" u2="ø" k="123"/><hkern u1="’" u2="ö" k="123"/><hkern u1="’" u2="õ" k="123"/><hkern u1="’" u2="ô" k="123"/><hkern u1="’" u2="ó" k="123"/><hkern u1="’" u2="ò" k="123"/><hkern u1="’" u2="ë" k="123"/><hkern u1="’" u2="ê" k="123"/><hkern u1="’" u2="é" k="123"/><hkern u1="’" u2="è" k="123"/><hkern u1="’" u2="ç" k="123"/><hkern u1="’" u2="æ" k="82"/><hkern u1="’" u2="å" k="82"/><hkern u1="’" u2="ä" k="82"/><hkern u1="’" u2="ã" k="82"/><hkern u1="’" u2="â" k="82"/><hkern u1="’" u2="á" k="82"/><hkern u1="’" u2="à" k="123"/><hkern u1="’" u2="Ý" k="-20"/><hkern u1="’" u2="Å" k="143"/><hkern u1="’" u2="Ä" k="143"/><hkern u1="’" u2="Ã" k="143"/><hkern u1="’" u2="Â" k="143"/><hkern u1="’" u2="Á" k="143"/><hkern u1="’" u2="À" k="143"/><hkern u1="’" u2="u" k="61"/><hkern u1="’" u2="s" k="61"/><hkern u1="’" u2="r" k="61"/><hkern u1="’" u2="q" k="123"/><hkern u1="’" u2="p" k="61"/><hkern u1="’" u2="o" k="123"/><hkern u1="’" u2="n" k="61"/><hkern u1="’" u2="m" k="61"/><hkern u1="’" u2="g" k="61"/><hkern u1="’" u2="e" k="123"/><hkern u1="’" u2="d" k="123"/><hkern u1="’" u2="c" k="123"/><hkern u1="’" u2="a" k="82"/><hkern u1="’" u2="Y" k="-20"/><hkern u1="’" u2="W" k="-41"/><hkern u1="’" u2="V" k="-41"/><hkern u1="’" u2="T" k="-41"/><hkern u1="’" u2="A" k="143"/><hkern u1="‚" u2="Ÿ" k="123"/><hkern u1="‚" u2="Œ" k="102"/><hkern u1="‚" u2="Ý" k="123"/><hkern u1="‚" u2="Ü" k="41"/><hkern u1="‚" u2="Û" k="41"/><hkern u1="‚" u2="Ú" k="41"/><hkern u1="‚" u2="Ù" k="41"/><hkern u1="‚" u2="Ø" k="102"/><hkern u1="‚" u2="Ö" k="102"/><hkern u1="‚" u2="Õ" k="102"/><hkern u1="‚" u2="Ô" k="102"/><hkern u1="‚" u2="Ó" k="102"/><hkern u1="‚" u2="Ò" k="102"/><hkern u1="‚" u2="Ç" k="102"/><hkern u1="‚" u2="Y" k="123"/><hkern u1="‚" u2="W" k="123"/><hkern u1="‚" u2="V" k="123"/><hkern u1="‚" u2="U" k="41"/><hkern u1="‚" u2="T" k="143"/><hkern u1="‚" u2="Q" k="102"/><hkern u1="‚" u2="O" k="102"/><hkern u1="‚" u2="G" k="102"/><hkern u1="‚" u2="C" k="102"/><hkern u1="“" u2="Ÿ" k="-20"/><hkern u1="“" u2="œ" k="123"/><hkern u1="“" u2="ü" k="61"/><hkern u1="“" u2="û" k="61"/><hkern u1="“" u2="ú" k="61"/><hkern u1="“" u2="ù" k="61"/><hkern u1="“" u2="ø" k="123"/><hkern u1="“" u2="ö" k="123"/><hkern u1="“" u2="õ" k="123"/><hkern u1="“" u2="ô" k="123"/><hkern u1="“" u2="ó" k="123"/><hkern u1="“" u2="ò" k="123"/><hkern u1="“" u2="ë" k="123"/><hkern u1="“" u2="ê" k="123"/><hkern u1="“" u2="é" k="123"/><hkern u1="“" u2="è" k="123"/><hkern u1="“" u2="ç" k="123"/><hkern u1="“" u2="æ" k="82"/><hkern u1="“" u2="å" k="82"/><hkern u1="“" u2="ä" k="82"/><hkern u1="“" u2="ã" k="82"/><hkern u1="“" u2="â" k="82"/><hkern u1="“" u2="á" k="82"/><hkern u1="“" u2="à" k="123"/><hkern u1="“" u2="Ý" k="-20"/><hkern u1="“" u2="Å" k="143"/><hkern u1="“" u2="Ä" k="143"/><hkern u1="“" u2="Ã" k="143"/><hkern u1="“" u2="Â" k="143"/><hkern u1="“" u2="Á" k="143"/><hkern u1="“" u2="À" k="143"/><hkern u1="“" u2="u" k="61"/><hkern u1="“" u2="s" k="61"/><hkern u1="“" u2="r" k="61"/><hkern u1="“" u2="q" k="123"/><hkern u1="“" u2="p" k="61"/><hkern u1="“" u2="o" k="123"/><hkern u1="“" u2="n" k="61"/><hkern u1="“" u2="m" k="61"/><hkern u1="“" u2="g" k="61"/><hkern u1="“" u2="e" k="123"/><hkern u1="“" u2="d" k="123"/><hkern u1="“" u2="c" k="123"/><hkern u1="“" u2="a" k="82"/><hkern u1="“" u2="Y" k="-20"/><hkern u1="“" u2="W" k="-41"/><hkern u1="“" u2="V" k="-41"/><hkern u1="“" u2="T" k="-41"/><hkern u1="“" u2="A" k="143"/><hkern u1="„" u2="Ÿ" k="123"/><hkern u1="„" u2="Œ" k="102"/><hkern u1="„" u2="Ý" k="123"/><hkern u1="„" u2="Ü" k="41"/><hkern u1="„" u2="Û" k="41"/><hkern u1="„" u2="Ú" k="41"/><hkern u1="„" u2="Ù" k="41"/><hkern u1="„" u2="Ø" k="102"/><hkern u1="„" u2="Ö" k="102"/><hkern u1="„" u2="Õ" k="102"/><hkern u1="„" u2="Ô" k="102"/><hkern u1="„" u2="Ó" k="102"/><hkern u1="„" u2="Ò" k="102"/><hkern u1="„" u2="Ç" k="102"/><hkern u1="„" u2="Y" k="123"/><hkern u1="„" u2="W" k="123"/><hkern u1="„" u2="V" k="123"/><hkern u1="„" u2="U" k="41"/><hkern u1="„" u2="T" k="143"/><hkern u1="„" u2="Q" k="102"/><hkern u1="„" u2="O" k="102"/><hkern u1="„" u2="G" k="102"/><hkern u1="„" u2="C" k="102"/></font></defs></svg> \ No newline at end of file diff --git a/setup/pub/fonts/opensans/light/opensans-300.ttf b/setup/pub/fonts/opensans/light/opensans-300.ttf deleted file mode 100644 index 63af664cde6ab..0000000000000 Binary files a/setup/pub/fonts/opensans/light/opensans-300.ttf and /dev/null differ diff --git a/setup/pub/fonts/opensans/light/opensans-300.woff b/setup/pub/fonts/opensans/light/opensans-300.woff deleted file mode 100644 index e786074813a27..0000000000000 Binary files a/setup/pub/fonts/opensans/light/opensans-300.woff and /dev/null differ diff --git a/setup/pub/fonts/opensans/light/opensans-300.woff2 b/setup/pub/fonts/opensans/light/opensans-300.woff2 deleted file mode 100644 index f7615ae2399b4..0000000000000 Binary files a/setup/pub/fonts/opensans/light/opensans-300.woff2 and /dev/null differ diff --git a/setup/pub/images/ajax-loader.gif b/setup/pub/images/ajax-loader.gif deleted file mode 100644 index d02ff9c96d108..0000000000000 Binary files a/setup/pub/images/ajax-loader.gif and /dev/null differ diff --git a/setup/pub/images/arrows-bg.svg b/setup/pub/images/arrows-bg.svg deleted file mode 100644 index 322a96ecdab58..0000000000000 --- a/setup/pub/images/arrows-bg.svg +++ /dev/null @@ -1,5 +0,0 @@ -<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" - width="8px" height="53px" viewBox="0 0 8 53" style="enable-background:new 0 0 8 53;" xml:space="preserve"> -<path style="fill:#524A43;" d="M4.028,52.994l-4.003-5.368h8.006L4.028,52.994z"/> -<path style="fill:#524A43;" d="M4.028,0l4.003,5.368H0.025L4.028,0z"/> -</svg> diff --git a/setup/pub/images/loader-1.gif b/setup/pub/images/loader-1.gif deleted file mode 100644 index 460734dfdadec..0000000000000 Binary files a/setup/pub/images/loader-1.gif and /dev/null differ diff --git a/setup/pub/images/loader-2.gif b/setup/pub/images/loader-2.gif deleted file mode 100644 index 362e2455f4be8..0000000000000 Binary files a/setup/pub/images/loader-2.gif and /dev/null differ diff --git a/setup/pub/images/logo.svg b/setup/pub/images/logo.svg deleted file mode 100644 index 2ade240eac735..0000000000000 --- a/setup/pub/images/logo.svg +++ /dev/null @@ -1 +0,0 @@ -<svg baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" width="35" height="41" viewBox="-0.154 0 54 62"><g fill="#E85D22"><path d="M26.845 8.857"/><path d="M53.692 15.5v31l-7.67 4.43v-31L26.844 8.856 7.67 19.926V50.93L0 46.5v-31L26.845 0zM26.847 62L15.34 55.355V24.357l7.67-4.43V50.93l3.835 2.327 3.837-2.327v-31l7.67 4.427v30.998z"/></g></svg> \ No newline at end of file diff --git a/setup/pub/images/magento-icon.svg b/setup/pub/images/magento-icon.svg deleted file mode 100644 index 2ade240eac735..0000000000000 --- a/setup/pub/images/magento-icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" width="35" height="41" viewBox="-0.154 0 54 62"><g fill="#E85D22"><path d="M26.845 8.857"/><path d="M53.692 15.5v31l-7.67 4.43v-31L26.844 8.856 7.67 19.926V50.93L0 46.5v-31L26.845 0zM26.847 62L15.34 55.355V24.357l7.67-4.43V50.93l3.835 2.327 3.837-2.327v-31l7.67 4.427v30.998z"/></g></svg> \ No newline at end of file diff --git a/setup/pub/magento/setup/app.js b/setup/pub/magento/setup/app.js deleted file mode 100644 index 8670c61792156..0000000000000 --- a/setup/pub/magento/setup/app.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -'use strict'; -var app = angular.module( - 'magento', - [ - 'ui.router', - 'ui.bootstrap', - 'main', - 'landing' - ]); - -app.config(['$httpProvider', '$stateProvider', function ($httpProvider, $stateProvider) { - if (!$httpProvider.defaults.headers.get) { - $httpProvider.defaults.headers.get = {}; - } - $httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache, no-store, must-revalidate'; - $httpProvider.defaults.headers.get['Pragma'] = 'no-cache'; - $httpProvider.defaults.headers.get['Expires'] = 0; - app.stateProvider = $stateProvider; -}]) - .config(function($provide) { - $provide.decorator('$state', function($delegate, $stateParams) { - $delegate.forceReload = function() { - return $delegate.go($delegate.current, $stateParams, { - reload: true, - inherit: false, - notify: true - }); - }; - return $delegate; - }); - }) - .config(['$locationProvider', function($locationProvider) { - $locationProvider.hashPrefix(''); - }]) - .run(function ($rootScope, $state) { - $rootScope.$state = $state; - }); diff --git a/setup/pub/magento/setup/landing.js b/setup/pub/magento/setup/landing.js deleted file mode 100644 index 0ed3ee806699e..0000000000000 --- a/setup/pub/magento/setup/landing.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -'use strict'; -angular.module('landing', ['ngStorage']) - .controller('landingController', [ - '$scope', - '$location', - '$localStorage', - function ($scope, $location, $localStorage) { - $scope.selectLanguage = function () { - $localStorage.lang = $scope.modelLanguage; - window.location = 'index.php/' + $scope.modelLanguage + '/index'; - }; - } - ]); diff --git a/setup/pub/magento/setup/main.js b/setup/pub/magento/setup/main.js deleted file mode 100644 index 48eed6d64be96..0000000000000 --- a/setup/pub/magento/setup/main.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -'use strict'; - -var main = angular.module('main', ['ngStorage', 'ngDialog']); -main.controller('navigationController', - ['$scope', '$state', '$rootScope', '$window', 'navigationService', '$localStorage', - function ($scope, $state, $rootScope, $window, navigationService, $localStorage) { - - function loadMenu() { - angular.element(document).ready(function () { - $scope.menu = $localStorage.menu; - }); - } - - navigationService.load().then(loadMenu); - - $rootScope.isMenuEnabled = true; - $scope.itemStatus = function (order) { - return $state.$current.order <= order || !$rootScope.isMenuEnabled; - }; -}]) -.controller('mainController', [ - '$scope', '$state', 'navigationService', '$localStorage', - function ($scope, $state, navigationService, $localStorage) { - - $scope.moduleName = $localStorage.moduleName; - - $scope.nextState = function () { - $scope.$broadcast('nextState', $state.$current); - $state.go(navigationService.getNextState().id); - }; - - $scope.state = $state; - - $scope.previousState = function () { - $state.go(navigationService.getPreviousState().id); - }; - } -]) -.service('navigationService', ['$location', '$state', '$http', '$localStorage', - function ($location, $state, $http, $localStorage) { - return { - mainState: {}, - states: [], - titlesWithModuleName: ['enable', 'disable', 'update', 'uninstall'], - isLoadedStates: false, - load: function () { - var self = this; - - return $http.get('index.php/navigation').then(function successCallback(resp) { - var data = resp.data, - currentState = $location.path().replace('/', ''), - isCurrentStateFound = false; - - self.states = data.nav; - $localStorage.menu = data.menu; - self.titlesWithModuleName.forEach(function (value) { - data.titles[value] = data.titles[value] + $localStorage.moduleName; - }); - $localStorage.titles = data.titles; - - if (self.isLoadedStates == false) { - data.nav.forEach(function (item) { - app.stateProvider.state(item.id, item); - - if (item.default) { - self.mainState = item; - } - - if (currentState == item.url) { - $state.go(item.id); - isCurrentStateFound = true; - } - }); - - if (!isCurrentStateFound) { - $state.go(self.mainState.id); - } - self.isLoadedStates = true; - } - }); - }, - getNextState: function () { - var nItem = {}; - this.states.forEach(function (item) { - if (item.order == $state.$current.order + 1 && item.type == $state.$current.type) { - nItem = item; - } - }); - - return nItem; - }, - getPreviousState: function () { - var nItem = {}; - this.states.forEach(function (item) { - if (item.order == $state.$current.order - 1 && item.type == $state.$current.type) { - nItem = item; - } - }); - - return nItem; - } - }; -}]) -.filter('startFrom', function () { - return function (input, start) { - if (input !== undefined && start !== 'NaN') { - start = parseInt(start, 10); - - return input.slice(start); - } - - return 0; - }; -}); diff --git a/setup/pub/magento/setup/view/pagination.html b/setup/pub/magento/setup/view/pagination.html deleted file mode 100644 index 261b0f3c3945d..0000000000000 --- a/setup/pub/magento/setup/view/pagination.html +++ /dev/null @@ -1,33 +0,0 @@ -<select id="perPage" class="admin__control-select" ng-model="$parent.rowLimit"> - <option value="20">20</option> - <option value="30">30</option> - <option value="50">50</option> - <option value="100">100</option> - <option value="200">200</option> -</select> -<label class="admin__control-support-text">per page</label> -<div class="admin__data-grid-pager"> - <button class="action-previous" - ng-disabled="$parent.currentPage == 1" - ng-click="$parent.currentPage = $parent.currentPage - 1;" - type="button" - > - <span>Previous page</span> - </button> - <input id="pageCurrent" - class="admin__control-text" - type="number" - ng-value="$parent.currentPage" - ng-model="$parent.currentPage" - > - <label class="admin__control-support-text" for="pageCurrent"> - of {{$parent.numberOfPages}} - </label> - <button class="action-next" - ng-disabled="$parent.currentPage >= $parent.numberOfPages" - ng-click="$parent.currentPage = $parent.currentPage + 1;" - type="button" - > - <span>Next page</span> - </button> -</div> diff --git a/setup/pub/scripts/main.js b/setup/pub/scripts/main.js new file mode 100644 index 0000000000000..559ea541abeb8 --- /dev/null +++ b/setup/pub/scripts/main.js @@ -0,0 +1,10 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +function showSection(section) { + document.querySelectorAll('section').forEach(function (element) { + element.style.display = element.getAttribute('data-section') === section ? null : 'none'; + }) +} diff --git a/setup/src/Magento/Setup/Application.php b/setup/src/Magento/Setup/Application.php index 5881bfad3b209..f24395dd9f794 100644 --- a/setup/src/Magento/Setup/Application.php +++ b/setup/src/Magento/Setup/Application.php @@ -43,7 +43,6 @@ public function bootstrap(array $configuration) $listeners = $this->getListeners($serviceManager, $configuration); $application = new LaminasApplication( - $configuration, $serviceManager, $serviceManager->get('EventManager'), $serviceManager->get('Request'), diff --git a/setup/src/Magento/Setup/Console/Command/BackupCommand.php b/setup/src/Magento/Setup/Console/Command/BackupCommand.php index ebfcab5a18417..841e766ebcb90 100644 --- a/setup/src/Magento/Setup/Console/Command/BackupCommand.php +++ b/setup/src/Magento/Setup/Console/Command/BackupCommand.php @@ -155,7 +155,7 @@ function () use ($input, $output) { $output, false ); - + return $returnValue; } diff --git a/setup/src/Magento/Setup/Controller/Index.php b/setup/src/Magento/Setup/Controller/Index.php index 36dd60dbbcf0f..9edca080b2cbd 100644 --- a/setup/src/Magento/Setup/Controller/Index.php +++ b/setup/src/Magento/Setup/Controller/Index.php @@ -4,10 +4,14 @@ * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Setup\Controller; use Laminas\Mvc\Controller\AbstractActionController; use Laminas\View\Model\ViewModel; +use Magento\Framework\App\ProductMetadata; +use Magento\Setup\Model\License; /** * Main controller of the Setup Wizard @@ -15,12 +19,39 @@ class Index extends AbstractActionController { /** - * Index action + * @var ProductMetadata + */ + private $productMetadata; + + /** + * @var License + */ + private $license; + + /** + * Index constructor. + * + * @param ProductMetadata $productMetadata + * @param License $license + */ + public function __construct( + ProductMetadata $productMetadata, + License $license + ) { + $this->productMetadata = $productMetadata; + $this->license = $license; + } + + /** + * Setup index action. * - * @return ViewModel|\Laminas\Http\Response + * @return ViewModel */ - public function indexAction() + public function indexAction(): ViewModel { - return new ViewModel(); + return new ViewModel([ + 'version' => $this->productMetadata->getVersion(), + 'license' => $this->license->getContents(), + ]); } } diff --git a/setup/src/Magento/Setup/Controller/Landing.php b/setup/src/Magento/Setup/Controller/Landing.php deleted file mode 100644 index cea1e76082521..0000000000000 --- a/setup/src/Magento/Setup/Controller/Landing.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Setup\Controller; - -use Laminas\Mvc\Controller\AbstractActionController; -use Laminas\View\Model\ViewModel; - -/** - * Controller for Setup Landing page - */ -class Landing extends AbstractActionController -{ - /** - * @var \Magento\Framework\App\ProductMetadata - */ - protected $productMetadata; - - /** - * @param \Magento\Framework\App\ProductMetadata $productMetadata - */ - public function __construct(\Magento\Framework\App\ProductMetadata $productMetadata) - { - $this->productMetadata = $productMetadata; - } - - /** - * Setup index action. - * - * @return array|ViewModel - */ - public function indexAction() - { - $view = new ViewModel; - $view->setTerminal(true); - $view->setTemplate('/magento/setup/landing.phtml'); - $view->setVariable('version', $this->productMetadata->getVersion()); - return $view; - } -} diff --git a/setup/src/Magento/Setup/Controller/License.php b/setup/src/Magento/Setup/Controller/License.php deleted file mode 100644 index 9cf32e7b31baf..0000000000000 --- a/setup/src/Magento/Setup/Controller/License.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Setup\Controller; - -use Magento\Setup\Model\License as LicenseModel; -use Laminas\Mvc\Controller\AbstractActionController; -use Laminas\View\Model\ViewModel; - -/** - * License controller - */ -class License extends AbstractActionController -{ - /** - * Licence Model - * - * @var LicenseModel - */ - protected $license; - - /** - * Constructor - * - * @param LicenseModel $license - */ - public function __construct(LicenseModel $license) - { - $this->license = $license; - } - - /** - * Displays license - * - * @return ViewModel - */ - public function indexAction() - { - $contents = $this->license->getContents(); - $view = new ViewModel(); - if ($contents === false) { - $view->setTemplate('error/404'); - $view->setVariable('message', 'Cannot find license file.'); - } else { - $view->setTerminal(true); - $view->setVariable('license', $contents); - } - return $view; - } -} diff --git a/setup/src/Magento/Setup/Controller/Navigation.php b/setup/src/Magento/Setup/Controller/Navigation.php deleted file mode 100644 index 8f07bb814387f..0000000000000 --- a/setup/src/Magento/Setup/Controller/Navigation.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Setup\Controller; - -use Laminas\Mvc\Controller\AbstractActionController; -use Laminas\View\Model\JsonModel; -use Laminas\View\Model\ViewModel; -use Magento\Framework\ObjectManagerInterface; -use Magento\Setup\Model\Navigation as NavModel; -use Magento\Setup\Model\ObjectManagerProvider; - -/** - * Navigation controller - */ -class Navigation extends AbstractActionController -{ - /** - * @var NavModel - */ - protected $navigation; - - /** - * @var ViewModel - */ - protected $view; - - /** - * @var ObjectManagerInterface - */ - private $objectManagerProvider; - - /** - * @param NavModel $navigation - * @param ObjectManagerProvider $objectManagerProvider - */ - public function __construct(NavModel $navigation, ObjectManagerProvider $objectManagerProvider) - { - $this->navigation = $navigation; - $this->objectManagerProvider = $objectManagerProvider->get(); - $this->view = new ViewModel(); - $this->view->setVariable('menu', $this->navigation->getMenuItems()); - $this->view->setVariable('main', $this->navigation->getMainItems()); - } - - /** - * Index action - * - * @return JsonModel - */ - public function indexAction() - { - $json = new JsonModel(); - $json->setVariable('nav', $this->navigation->getData()); - $json->setVariable('menu', $this->navigation->getMenuItems()); - $json->setVariable('main', $this->navigation->getMainItems()); - $json->setVariable('titles', $this->navigation->getTitles()); - return $json; - } - - /** - * Menu action - * - * @return array|ViewModel - */ - public function menuAction() - { - $this->view->setVariable('menu', $this->navigation->getMenuItems()); - $this->view->setVariable('main', $this->navigation->getMainItems()); - $this->view->setTemplate('/magento/setup/navigation/menu.phtml'); - $this->view->setTerminal(true); - return $this->view; - } -} diff --git a/setup/src/Magento/Setup/Di/MagentoDiFactory.php b/setup/src/Magento/Setup/Di/MagentoDiFactory.php new file mode 100644 index 0000000000000..c78d51fd253ea --- /dev/null +++ b/setup/src/Magento/Setup/Di/MagentoDiFactory.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Setup\Di; + +use Interop\Container\ContainerInterface; +use Laminas\ServiceManager\Factory\FactoryInterface; +use Magento\Framework\App\ObjectManager; + +/** + * Instantiates the type via Magento object manager + */ +class MagentoDiFactory implements FactoryInterface +{ + /** + * @inheritdoc + */ + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) + { + return ObjectManager::getInstance()->get($requestedName); + } +} diff --git a/setup/src/Magento/Setup/Fixtures/BundleProductsFixture.php b/setup/src/Magento/Setup/Fixtures/BundleProductsFixture.php index 3ad22e8f7bcd1..d93d1223177ff 100644 --- a/setup/src/Magento/Setup/Fixtures/BundleProductsFixture.php +++ b/setup/src/Magento/Setup/Fixtures/BundleProductsFixture.php @@ -167,6 +167,8 @@ public function execute() 'price' => function ($index) use ($priceTypeClosure) { // phpcs:ignore Magento2.Functions.DiscouragedFunction return $priceTypeClosure($index) === LinkInterface::PRICE_TYPE_PERCENT + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction ? mt_rand(10, 90) : $this->priceProvider->getPrice($index); }, diff --git a/setup/src/Magento/Setup/Fixtures/CartPriceRulesFixture.php b/setup/src/Magento/Setup/Fixtures/CartPriceRulesFixture.php index 2ccde48ebdd7e..769050c20997e 100644 --- a/setup/src/Magento/Setup/Fixtures/CartPriceRulesFixture.php +++ b/setup/src/Magento/Setup/Fixtures/CartPriceRulesFixture.php @@ -199,7 +199,7 @@ public function generateRules($ruleFactory, $categoriesArray) 'discount_step' => '', 'apply_to_shipping' => '0', 'simple_free_shipping' => '0', - 'stop_rules_processing' => '0', + 'stop_rules_processing' => '1', 'reward_points_delta' => '', 'store_labels' => [ 0 => '', diff --git a/setup/src/Magento/Setup/Fixtures/ConfigurableProductsFixture.php b/setup/src/Magento/Setup/Fixtures/ConfigurableProductsFixture.php index 8c2aed521dbe8..e54cf7ecfe4e9 100644 --- a/setup/src/Magento/Setup/Fixtures/ConfigurableProductsFixture.php +++ b/setup/src/Magento/Setup/Fixtures/ConfigurableProductsFixture.php @@ -325,6 +325,8 @@ private function getDefaultAttributeSetsConfig(array $defaultAttributeSets, $con // phpcs:ignore Magento2.Functions.DiscouragedFunction return $attributeSetAmount > ($index - 1) % (int)$this->fixtureModel->getValue('categories', 30) + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction ? array_keys($defaultAttributeSets)[mt_rand(0, $attributeSetAmount - 1)] : 'Default'; }; diff --git a/setup/src/Magento/Setup/Fixtures/FixtureModel.php b/setup/src/Magento/Setup/Fixtures/FixtureModel.php index 99237e48748fb..f935ae721ef03 100644 --- a/setup/src/Magento/Setup/Fixtures/FixtureModel.php +++ b/setup/src/Magento/Setup/Fixtures/FixtureModel.php @@ -74,8 +74,11 @@ class FixtureModel private $config; /** - * Constructor - * + * @var IndexerReindexCommand + */ + private $reindexCommand; + + /** * @param IndexerReindexCommand $reindexCommand * @param array $initArguments */ diff --git a/setup/src/Magento/Setup/Fixtures/ImagesFixture.php b/setup/src/Magento/Setup/Fixtures/ImagesFixture.php index cd403897de07a..af0cbe6a7e919 100644 --- a/setup/src/Magento/Setup/Fixtures/ImagesFixture.php +++ b/setup/src/Magento/Setup/Fixtures/ImagesFixture.php @@ -260,6 +260,8 @@ private function generateImageFilesGenerator() $productImagesDirectoryPath = $mediaDirectory->getRelativePath($this->mediaConfig->getBaseMediaPath()); for ($i = 1; $i <= $this->getImagesToGenerate(); $i++) { + // md5() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $imageName = md5($i) . '.jpg'; $imageFullName = DIRECTORY_SEPARATOR . substr($imageName, 0, 1) . DIRECTORY_SEPARATOR . substr($imageName, 1, 1) diff --git a/setup/src/Magento/Setup/Fixtures/ImagesGenerator/ImagesGenerator.php b/setup/src/Magento/Setup/Fixtures/ImagesGenerator/ImagesGenerator.php index dc730b69f8775..7c58336c940ae 100644 --- a/setup/src/Magento/Setup/Fixtures/ImagesGenerator/ImagesGenerator.php +++ b/setup/src/Magento/Setup/Fixtures/ImagesGenerator/ImagesGenerator.php @@ -52,6 +52,8 @@ public function generate($config) $image = imagecreate($config['image-width'], $config['image-height']); $bgColor = imagecolorallocate($image, 240, 240, 240); + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $fgColor = imagecolorallocate($image, mt_rand(0, 230), mt_rand(0, 230), mt_rand(0, 230)); $colors = [$fgColor, $bgColor]; imagefilledrectangle($image, 0, 0, $config['image-width'], $config['image-height'], $bgColor); diff --git a/setup/src/Magento/Setup/Fixtures/OrdersFixture.php b/setup/src/Magento/Setup/Fixtures/OrdersFixture.php index 936a82bebf246..4c08e8fa8f7a6 100644 --- a/setup/src/Magento/Setup/Fixtures/OrdersFixture.php +++ b/setup/src/Magento/Setup/Fixtures/OrdersFixture.php @@ -326,9 +326,12 @@ public function execute() $batchNumber++; // phpcs:ignore Magento2.Functions.DiscouragedFunction $productCount = [ + // mt_rand() here is not for cryptographic use. + // phpcs:disable Magento2.Security.InsecureFunction Type::TYPE_SIMPLE => mt_rand($orderSimpleCountFrom, $orderSimpleCountTo), Configurable::TYPE_CODE => mt_rand($orderConfigurableCountFrom, $orderConfigurableCountTo), self::BIG_CONFIGURABLE_TYPE => mt_rand($orderBigConfigurableCountFrom, $orderBigConfigurableCountTo) + // phpcs:enable ]; $order = [ '%itemsPerOrder%' => array_sum($productCount), diff --git a/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php b/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php index 2d450a4374c5e..f41f8409f1074 100644 --- a/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php +++ b/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php @@ -18,6 +18,8 @@ class AddressDataGenerator public function generateAddress() { return [ + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction 'postcode' => mt_rand(10000, 99999) ]; } diff --git a/setup/src/Magento/Setup/Model/CryptKeyGenerator.php b/setup/src/Magento/Setup/Model/CryptKeyGenerator.php index df72dc4c6b8bb..5bd764673a45e 100644 --- a/setup/src/Magento/Setup/Model/CryptKeyGenerator.php +++ b/setup/src/Magento/Setup/Model/CryptKeyGenerator.php @@ -37,6 +37,9 @@ public function __construct(Random $random) */ public function generate() { + // md5() here is not for cryptographic use. It used for generate encryption key itself + // and do not encrypt any passwords + // phpcs:ignore Magento2.Security.InsecureFunction return md5($this->getRandomString()); } diff --git a/setup/src/Magento/Setup/Model/DataGenerator.php b/setup/src/Magento/Setup/Model/DataGenerator.php index c7c975f2d993d..09304e7583dc1 100644 --- a/setup/src/Magento/Setup/Model/DataGenerator.php +++ b/setup/src/Magento/Setup/Model/DataGenerator.php @@ -67,11 +67,15 @@ protected function readData() */ public function generate($minAmountOfWords, $maxAmountOfWords, $key = null) { + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $numberOfWords = mt_rand($minAmountOfWords, $maxAmountOfWords); $result = ''; if ($key === null || !array_key_exists($key, $this->generatedValues)) { for ($i = 0; $i < $numberOfWords; $i++) { + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $result .= ' ' . $this->dictionaryData[mt_rand(0, count($this->dictionaryData) - 1)]; } $result = trim($result); diff --git a/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php b/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php index 807e1fde7d90d..14241679c205b 100644 --- a/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php +++ b/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php @@ -63,6 +63,8 @@ public function generate() */ private function generateRawDescription() { + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $paragraphsCount = mt_rand( $this->descriptionConfig['paragraphs']['count-min'], $this->descriptionConfig['paragraphs']['count-max'] diff --git a/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php b/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php index 50544e6ea9726..d7dab8d3ca8b4 100644 --- a/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php +++ b/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php @@ -39,6 +39,8 @@ public function __construct( */ public function generate() { + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $sentencesCount = mt_rand( $this->paragraphConfig['sentences']['count-min'], $this->paragraphConfig['sentences']['count-max'] diff --git a/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php b/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php index 299b4b50bed0f..c20a8c940d8dc 100644 --- a/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php +++ b/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php @@ -39,6 +39,8 @@ public function __construct( */ public function generate() { + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $sentenceWordsCount = mt_rand( $this->sentenceConfig['words']['count-min'], $this->sentenceConfig['words']['count-max'] diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php b/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php index db208adc67de8..f60108cb8f322 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php @@ -48,6 +48,8 @@ public function apply($text) return $this->wordWrapper->wrapWords( $text, + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)), '<b>%s</b>' ); diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php b/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php index 0598db218728f..32a189f11eea4 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php @@ -27,6 +27,8 @@ public function getRandomWords($source, $count) $randWords = []; $wordsSize = count($words); while ($count) { + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $randWords[] = $words[mt_rand(0, $wordsSize - 1)]; $count--; } diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php b/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php index 87e033be330cf..ce73ac2c4a8e3 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php @@ -48,6 +48,8 @@ public function apply($text) return $this->wordWrapper->wrapWords( $text, + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)), '<i>%s</i>' ); diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php b/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php index ed5a836129460..91cd0d0c4d3da 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php @@ -48,6 +48,8 @@ public function apply($text) return $this->wordWrapper->wrapWords( $text, + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)), '<span>%s</span>' ); diff --git a/setup/src/Magento/Setup/Model/Dictionary.php b/setup/src/Magento/Setup/Model/Dictionary.php index 630d35092d0fc..79843f77a0478 100644 --- a/setup/src/Magento/Setup/Model/Dictionary.php +++ b/setup/src/Magento/Setup/Model/Dictionary.php @@ -40,6 +40,8 @@ public function getRandWord() $this->readDictionary(); } + // mt_rand() here is not for cryptographic use. + // phpcs:ignore Magento2.Security.InsecureFunction $randIndex = mt_rand(0, count($this->dictionary) - 1); return trim($this->dictionary[$randIndex]); } diff --git a/setup/src/Magento/Setup/Model/Navigation.php b/setup/src/Magento/Setup/Model/Navigation.php deleted file mode 100644 index ecc4609ff30a7..0000000000000 --- a/setup/src/Magento/Setup/Model/Navigation.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Setup\Model; - -use Laminas\ServiceManager\ServiceLocatorInterface; -use Magento\Framework\App\DeploymentConfig; - -/** - * Navigation model - */ -class Navigation -{ - /** - * Type of navigation - */ - const NAV_LANDING = 'navLanding'; - - /** - * @var string - */ - private $navStates; - - /** - * @var string - */ - private $navType; - - /** - * @var string - */ - private $titles; - - /** - * @param \Laminas\ServiceManager\ServiceLocatorInterface $serviceLocator - */ - public function __construct(ServiceLocatorInterface $serviceLocator) - { - $this->navStates = $serviceLocator->get('config')[self::NAV_LANDING]; - $this->navType = self::NAV_LANDING; - $this->titles = $serviceLocator->get('config')[self::NAV_LANDING . 'Titles']; - } - - /** - * Get type - * - * @return string - */ - public function getType() - { - return $this->navType; - } - - /** - * Get data - * - * @return array - */ - public function getData() - { - return $this->navStates; - } - - /** - * Retrieve array of menu items - * - * Returns only items with 'nav' equal to TRUE - * - * @return array - */ - public function getMenuItems() - { - return array_values(array_filter( - $this->navStates, - function ($value) { - return isset($value['nav']) && (bool)$value['nav']; - } - )); - } - - /** - * Retrieve array of menu items - * - * Returns only items with 'main' equal to TRUE - * - * @return array - */ - public function getMainItems() - { - $result = array_values(array_filter( - $this->navStates, - function ($value) { - return isset($value['main']) && (bool)$value['main']; - } - )); - return $result; - } - - /** - * Returns titles of the navigation pages - * - * @return array - */ - public function getTitles() - { - return $this->titles; - } -} diff --git a/setup/src/Magento/Setup/Module.php b/setup/src/Magento/Setup/Module.php index f1fde437f0094..ceb17332e80ff 100644 --- a/setup/src/Magento/Setup/Module.php +++ b/setup/src/Magento/Setup/Module.php @@ -77,8 +77,6 @@ public function getConfig() include __DIR__ . '/../../../config/module.config.php', include __DIR__ . '/../../../config/router.config.php', include __DIR__ . '/../../../config/di.config.php', - include __DIR__ . '/../../../config/states.install.config.php', - include __DIR__ . '/../../../config/languages.config.php', ); // phpcs:enable return $result; diff --git a/setup/src/Magento/Setup/Module/Dependency/Report/Circular/Data/Chain.php b/setup/src/Magento/Setup/Module/Dependency/Report/Circular/Data/Chain.php index 031846aac26dc..38e200a1f379e 100644 --- a/setup/src/Magento/Setup/Module/Dependency/Report/Circular/Data/Chain.php +++ b/setup/src/Magento/Setup/Module/Dependency/Report/Circular/Data/Chain.php @@ -10,6 +10,11 @@ */ class Chain { + /** + * @var array + */ + private $modules; + /** * Chain construct * diff --git a/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Directory.php b/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Directory.php index a544a59b4dd2d..0c508b81640dc 100644 --- a/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Directory.php +++ b/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Directory.php @@ -44,6 +44,11 @@ class Directory implements \Magento\Setup\Module\Di\Code\Reader\ClassesScannerIn */ private $classesScanner; + /** + * @var string + */ + private $generationDir; + /** * @param \Magento\Setup\Module\Di\Compiler\Log\Log $log Logging object * @param \Magento\Framework\Code\Reader\ClassReader $classReader diff --git a/setup/src/Magento/Setup/Module/Di/Code/Reader/FileScanner.php b/setup/src/Magento/Setup/Module/Di/Code/Reader/FileScanner.php index 27ac2b2794bb9..5b2667132bae4 100644 --- a/setup/src/Magento/Setup/Module/Di/Code/Reader/FileScanner.php +++ b/setup/src/Magento/Setup/Module/Di/Code/Reader/FileScanner.php @@ -38,6 +38,14 @@ protected function scan() define('T_TRAIT', 42001); } + // ensure php backwards compatibility (from laminas code 3.5.x) + if (!defined('T_NAME_QUALIFIED')) { + define('T_NAME_QUALIFIED', 24001); + } + if (!defined('T_NAME_FULLY_QUALIFIED')) { + define('T_NAME_FULLY_QUALIFIED', 24002); + } + /** * Variables & Setup */ diff --git a/setup/src/Magento/Setup/Module/Di/Code/Scanner/ConfigurationScanner.php b/setup/src/Magento/Setup/Module/Di/Code/Scanner/ConfigurationScanner.php index 747865f7cfef9..76071cad9f045 100644 --- a/setup/src/Magento/Setup/Module/Di/Code/Scanner/ConfigurationScanner.php +++ b/setup/src/Magento/Setup/Module/Di/Code/Scanner/ConfigurationScanner.php @@ -9,6 +9,16 @@ class ConfigurationScanner { + /** + * @var \Magento\Framework\App\Config\FileResolver + */ + private $fileResolver; + + /** + * @var \Magento\Framework\App\AreaList + */ + private $areaList; + /** * ConfigurationScanner constructor. * diff --git a/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Html.php b/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Html.php index ec62ab8b84482..d70e5c6a81c37 100644 --- a/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Html.php +++ b/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Html.php @@ -19,19 +19,24 @@ class Html extends AbstractAdapter * Covers * <span><!-- ko i18n: 'Next'--><!-- /ko --></span> * <th class="col col-method" data-bind="i18n: 'Select Method'"></th> - * @deprecated Not used anymore because of newly introduced constant - * @see self::HTML_REGEX_LIST + * @deprecated Not used anymore because of newly introduced constants + * @see self::REGEX_I18N_BINDING and self::REGEX_TRANSLATE_TAG_OR_ATTR */ - const HTML_FILTER = "/i18n:\s?'(?<value>[^'\\\\]*(?:\\\\.[^'\\\\]*)*)'/i"; + const HTML_FILTER = "/i18n:\s?'(?<value>[^'\\\\]*(?:\\\\.[^'\\\\]*)*)'/"; - private const HTML_REGEX_LIST = [ - // <span><!-- ko i18n: 'Next'--><!-- /ko --></span> - // <th class="col col-method" data-bind="i18n: 'Select Method'"></th> - "/i18n:\s?'(?<value>[^'\\\\]*(?:\\\\.[^'\\\\]*)*)'/i", - // <translate args="'System Messages'"/> - // <span translate="'Examples'"></span> - "/translate( args|)=\"'(?<value>[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)'\"/i" - ]; + /** + * Covers + * <span><!-- ko i18n: 'Next'--><!-- /ko --></span> + * <th class="col col-method" data-bind="i18n: 'Select Method'"></th> + */ + public const REGEX_I18N_BINDING = '/i18n:\s?\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/'; + + /** + * Covers + * <translate args="'System Messages'"/> + * <span translate="'Examples'"></span> + */ + public const REGEX_TRANSLATE_TAG_OR_ATTR = '/translate( args|)=\"\'([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\'\"/'; /** * @inheritdoc @@ -59,13 +64,24 @@ protected function _parse() } } - foreach (self::HTML_REGEX_LIST as $regex) { - preg_match_all($regex, $data, $results, PREG_SET_ORDER); + $this->extractPhrases(self::REGEX_I18N_BINDING, $data, 2, 1); + $this->extractPhrases(self::REGEX_TRANSLATE_TAG_OR_ATTR, $data, 3, 2); + $this->extractPhrases(Js::REGEX_TRANSLATE_FUNCTION, $data, 3, 2); + } - for ($i = 0, $count = count($results); $i < $count; $i++) { - if (!empty($results[$i]['value'])) { - $this->_addPhrase($results[$i]['value']); - } + /** + * @param string $regex + * @param string $data + * @param int $expectedGroupsCount + * @param int $valueGroupIndex + */ + protected function extractPhrases(string $regex, string $data, int $expectedGroupsCount, int $valueGroupIndex): void + { + preg_match_all($regex, $data, $results, PREG_SET_ORDER); + + for ($i = 0, $count = count($results); $i < $count; $i++) { + if (count($results[$i]) === $expectedGroupsCount && !empty($results[$i][$valueGroupIndex])) { + $this->_addPhrase($results[$i][$valueGroupIndex]); } } } diff --git a/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Js.php b/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Js.php index 4678af60d63f0..02a09a5dd5db7 100644 --- a/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Js.php +++ b/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Js.php @@ -10,6 +10,23 @@ */ class Js extends AbstractAdapter { + /** + * Covers + * $.mage.__('Example text') + */ + public const REGEX_MAGE_TRANSLATE = '/mage\.__\(\s*([\'"])(.*?[^\\\])\1.*?[),]/'; + + /** + * Covers in JS + * $t(' Example: ') + * + * Covers in HTML + * <a data-bind="attr: { title: $t('Title'), href: '#'} "></a> + * <input type="text" data-bind="attr: { placeholder: $t('Placeholder'), title: $t('Title') }" /> + * Double quotes are not handled correctly in the `attr` binding. Move phrase to the UI component property if needed + */ + public const REGEX_TRANSLATE_FUNCTION = '/\\$t\(\s*([\'"])(.*?[^\\\])\1.*?[),]/'; + /** * @inheritdoc */ @@ -21,19 +38,18 @@ protected function _parse() $lineNumber++; $fileRow = fgets($fileHandle, 4096); $results = []; - preg_match_all('/mage\.__\(\s*([\'"])(.*?[^\\\])\1.*?[),]/', $fileRow, $results, PREG_SET_ORDER); - for ($i = 0, $count = count($results); $i < $count; $i++) { - if (isset($results[$i][2])) { - $quote = $results[$i][1]; - $this->_addPhrase($quote . $results[$i][2] . $quote, $lineNumber); - } - } + $regexes = [ + static::REGEX_MAGE_TRANSLATE, + static::REGEX_TRANSLATE_FUNCTION + ]; - preg_match_all('/\\$t\(\s*([\'"])(.*?[^\\\])\1.*?[),]/', $fileRow, $results, PREG_SET_ORDER); - for ($i = 0, $count = count($results); $i < $count; $i++) { - if (isset($results[$i][2])) { - $quote = $results[$i][1]; - $this->_addPhrase($quote . $results[$i][2] . $quote, $lineNumber); + foreach ($regexes as $regex) { + preg_match_all($regex, $fileRow, $results, PREG_SET_ORDER); + for ($i = 0, $count = count($results); $i < $count; $i++) { + if (isset($results[$i][2])) { + $quote = $results[$i][1]; + $this->_addPhrase($quote . $results[$i][2] . $quote, $lineNumber); + } } } } diff --git a/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php b/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php index 4c25753aa87ac..6bd801742f134 100644 --- a/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php +++ b/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php @@ -5,23 +5,18 @@ */ namespace Magento\Setup\Mvc\Bootstrap; +use Interop\Container\ContainerInterface; use Magento\Framework\App\Bootstrap as AppBootstrap; use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\App\ObjectManager; -use Magento\Framework\App\Request\Http; use Magento\Framework\App\State; use Magento\Framework\Filesystem; use Magento\Framework\Shell\ComplexParameter; -use Laminas\Console\Request; use Laminas\EventManager\EventManagerInterface; use Laminas\EventManager\ListenerAggregateInterface; use Laminas\Mvc\Application; use Laminas\Mvc\MvcEvent; -use Laminas\Router\Http\RouteMatch; -use Laminas\ServiceManager\FactoryInterface; +use Laminas\ServiceManager\Factory\FactoryInterface; use Laminas\ServiceManager\ServiceLocatorInterface; -use Laminas\Stdlib\RequestInterface; -use Laminas\Uri\UriInterface; /** * A listener that injects relevant Magento initialization parameters and initializes filesystem @@ -37,7 +32,7 @@ class InitParamListener implements ListenerAggregateInterface, FactoryInterface const BOOTSTRAP_PARAM = 'magento-init-params'; /** - * @var \Laminas\Stdlib\CallbackHandler[] + * @var callable[] */ private $listeners = []; @@ -97,14 +92,25 @@ public function onBootstrap(MvcEvent $e) } /** - * @inheritdoc + * Create service. Proxy to the __invoke method + * + * @deprecared use the __invoke method instead * * @param ServiceLocatorInterface $serviceLocator - * @return mixed + * @return array + * @throws \Interop\Container\Exception\ContainerException */ public function createService(ServiceLocatorInterface $serviceLocator) { - return $this->extractInitParameters($serviceLocator->get('Application')); + return $this($serviceLocator, 'Application'); + } + + /** + * @inheritdoc + */ + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) + { + return $this->extractInitParameters($container->get('Application')); } /** @@ -130,8 +136,12 @@ private function extractInitParameters(Application $application) $result[$initKey] = $_SERVER[$initKey]; } } - $result = array_replace_recursive($result, $this->extractFromCli($application->getRequest())); - return $result; + + if (!isset($result['argv']) || !is_array($result['argv'])) { + return $result; + } + + return array_replace_recursive($result, $this->extractFromCli($result['argv'])); } /** @@ -139,16 +149,13 @@ private function extractInitParameters(Application $application) * * Uses format of a URL query * - * @param RequestInterface $request + * @param array $argv * @return array */ - private function extractFromCli(RequestInterface $request) + private function extractFromCli(array $argv): array { - if (!($request instanceof Request)) { - return []; - } $bootstrapParam = new ComplexParameter(self::BOOTSTRAP_PARAM); - foreach ($request->getContent() as $paramStr) { + foreach ($argv as $paramStr) { $result = $bootstrapParam->getFromString($paramStr); if (!empty($result)) { return $result; diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Style/MagentoStyleTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Style/MagentoStyleTest.php index 143dcbc67f689..68ef161d382f6 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Style/MagentoStyleTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Style/MagentoStyleTest.php @@ -260,6 +260,7 @@ public function testAsk() { $objectManager = new ObjectManager($this); $formatter = $this->getMockBuilder(OutputFormatter::class) + ->disableOriginalClone() ->disableOriginalConstructor() ->getMock(); $input = $this->getMockBuilder(InputInterface::class) diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/IndexTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/IndexTest.php index 130bef0b52650..0c7fa041166a2 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/IndexTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/IndexTest.php @@ -8,17 +8,60 @@ namespace Magento\Setup\Test\Unit\Controller; use Laminas\View\Model\ViewModel; +use Magento\Framework\App\ProductMetadata; use Magento\Setup\Controller\Index; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class IndexTest extends TestCase { - public function testIndexAction() + /** + * Test Product Version Value + */ + private const TEST_PRODUCT_VERSION = '222.333.444'; + + /** + * Test license string + */ + private const TEST_LICENSE = 'some license string'; + + /** + * @var Index + */ + private $controller; + + protected function setUp(): void { - /** @var Index $controller */ - $controller = new Index(); - $viewModel = $controller->indexAction(); + /** @var ProductMetadata|MockObject $productMetadataMock */ + $productMetadataMock = $this->getMockBuilder(ProductMetadata::class) + ->onlyMethods(['getVersion']) + ->disableOriginalConstructor() + ->getMock(); + $productMetadataMock->expects($this->once()) + ->method('getVersion') + ->willReturn(self::TEST_PRODUCT_VERSION); + + $licenseModel = $this->createMock(\Magento\Setup\Model\License::class); + $licenseModel->expects($this->once())->method('getContents')->willReturn(self::TEST_LICENSE); + + $this->controller = new Index($productMetadataMock, $licenseModel); + } + + public function testIndexAction(): void + { + $viewModel = $this->controller->indexAction(); + + //check view model $this->assertInstanceOf(ViewModel::class, $viewModel); $this->assertFalse($viewModel->terminate()); + $variables = $viewModel->getVariables(); + + //version + $this->assertArrayHasKey('version', $variables); + $this->assertEquals(self::TEST_PRODUCT_VERSION, $variables['version']); + + //license + $this->assertArrayHasKey('license', $viewModel->getVariables()); + $this->assertEquals(self::TEST_LICENSE, $variables['license']); } } diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/LandingTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/LandingTest.php deleted file mode 100644 index 41066894e7002..0000000000000 --- a/setup/src/Magento/Setup/Test/Unit/Controller/LandingTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Setup\Test\Unit\Controller; - -use Laminas\View\Model\ViewModel; -use Magento\Framework\App\ProductMetadata; -use Magento\Setup\Controller\Landing; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; - -class LandingTest extends TestCase -{ - /** - * Test Product Version Value - */ - const TEST_PRODUCT_VERSION = '222.333.444'; - - public function testIndexAction() - { - /** @var ProductMetadata|MockObject $productMetadataMock */ - $productMetadataMock = $this->getMockBuilder(ProductMetadata::class) - ->setMethods(['getVersion']) - ->disableOriginalConstructor() - ->getMock(); - $productMetadataMock->expects($this->once()) - ->method('getVersion') - ->willReturn($this::TEST_PRODUCT_VERSION); - /** @var Landing $controller */ - $controller = new Landing($productMetadataMock); - $_SERVER['DOCUMENT_ROOT'] = 'some/doc/root/value'; - $viewModel = $controller->indexAction(); - $this->assertInstanceOf(ViewModel::class, $viewModel); - $this->assertTrue($viewModel->terminate()); - $this->assertEquals('/magento/setup/landing.phtml', $viewModel->getTemplate()); - $variables = $viewModel->getVariables(); - $this->assertArrayHasKey('version', $variables); - $this->assertEquals($this::TEST_PRODUCT_VERSION, $variables['version']); - } -} diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/LicenseTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/LicenseTest.php deleted file mode 100644 index a7721e3f853ba..0000000000000 --- a/setup/src/Magento/Setup/Test/Unit/Controller/LicenseTest.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Setup\Test\Unit\Controller; - -use Laminas\View\Model\ViewModel; -use Magento\Setup\Controller\License; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; - -class LicenseTest extends TestCase -{ - /** - * @var MockObject|\Magento\Setup\Model\License - */ - private $licenseModel; - - /** - * @var License - */ - private $controller; - - protected function setUp(): void - { - $this->licenseModel = $this->createMock(\Magento\Setup\Model\License::class); - $this->controller = new License($this->licenseModel); - } - - public function testIndexActionWithLicense() - { - $this->licenseModel->expects($this->once())->method('getContents')->willReturn('some license string'); - $viewModel = $this->controller->indexAction(); - $this->assertInstanceOf(ViewModel::class, $viewModel); - $this->assertArrayHasKey('license', $viewModel->getVariables()); - } - - public function testIndexActionNoLicense() - { - $this->licenseModel->expects($this->once())->method('getContents')->willReturn(false); - $viewModel = $this->controller->indexAction(); - $this->assertInstanceOf(ViewModel::class, $viewModel); - $this->assertArrayHasKey('message', $viewModel->getVariables()); - $this->assertEquals('error/404', $viewModel->getTemplate()); - } -} diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/NavigationTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/NavigationTest.php deleted file mode 100644 index 46f09a7e93eb3..0000000000000 --- a/setup/src/Magento/Setup/Test/Unit/Controller/NavigationTest.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Setup\Test\Unit\Controller; - -use Laminas\View\Model\JsonModel; -use Laminas\View\Model\ViewModel; -use Magento\Setup\Controller\Navigation; -use Magento\Setup\Model\ObjectManagerProvider; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; - -class NavigationTest extends TestCase -{ - /** - * @var MockObject|\Magento\Setup\Model\Navigation - */ - private $navigationModel; - - /** - * @var \Magento\Setup\Controller\Navigation - */ - private $controller; - - /** - * @var ObjectManagerProvider|MockObject - */ - private $objectManagerProvider; - - protected function setUp(): void - { - $this->navigationModel = $this->createMock(\Magento\Setup\Model\Navigation::class); - $this->objectManagerProvider = - $this->createMock(ObjectManagerProvider::class); - $this->controller = new Navigation($this->navigationModel, $this->objectManagerProvider); - } - - public function testIndexAction() - { - $this->navigationModel->expects($this->once())->method('getData')->willReturn('some data'); - $viewModel = $this->controller->indexAction(); - - $this->assertInstanceOf(JsonModel::class, $viewModel); - $this->assertArrayHasKey('nav', $viewModel->getVariables()); - } - - public function testMenuActionUpdater() - { - $viewModel = $this->controller->menuAction(); - $this->assertInstanceOf(ViewModel::class, $viewModel); - $variables = $viewModel->getVariables(); - $this->assertArrayHasKey('menu', $variables); - $this->assertArrayHasKey('main', $variables); - $this->assertTrue($viewModel->terminate()); - $this->assertSame('/magento/setup/navigation/menu.phtml', $viewModel->getTemplate()); - } - - public function testMenuActionInstaller() - { - $viewModel = $this->controller->menuAction(); - $this->assertInstanceOf(ViewModel::class, $viewModel); - $variables = $viewModel->getVariables(); - $this->assertArrayHasKey('menu', $variables); - $this->assertArrayHasKey('main', $variables); - $this->assertTrue($viewModel->terminate()); - $this->assertSame('/magento/setup/navigation/menu.phtml', $viewModel->getTemplate()); - } -} diff --git a/setup/src/Magento/Setup/Test/Unit/Model/NavigationTest.php b/setup/src/Magento/Setup/Test/Unit/Model/NavigationTest.php deleted file mode 100644 index 21e8e11764d23..0000000000000 --- a/setup/src/Magento/Setup/Test/Unit/Model/NavigationTest.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Setup\Test\Unit\Model; - -use Laminas\ServiceManager\ServiceLocatorInterface; -use Magento\Framework\App\DeploymentConfig; -use Magento\Setup\Model\Navigation; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; - -class NavigationTest extends TestCase -{ - /** - * @var MockObject|ServiceLocatorInterface - */ - private $serviceLocatorMock; - - /** - * @var MockObject|DeploymentConfig - */ - private $deploymentConfig; - - /** - * @var Navigation - */ - private $navigation; - - protected function setUp(): void - { - $this->serviceLocatorMock = - $this->getMockBuilder(ServiceLocatorInterface::class) - ->onlyMethods(['get']) - ->getMockForAbstractClass(); - $this->serviceLocatorMock - ->expects($this->exactly(2)) - ->method('get') - ->with('config') - ->willReturn( - [ - 'navLandingTitles' => [ - 'install' => 'SomeTitle' - ], - 'navLanding' => [ - ['key1' => 'value1'], - ['key2' => 'value2'], - ['nav' => 'abc', 'key3' => 'value3'], - ['nav' => ''], - ['nav' => false], - ['main' => 'abc', 'key3' => 'value3'], - ['main' => ''], - ['main' => false], - ] - ] - ); - $this->deploymentConfig = $this->createMock(DeploymentConfig::class); - $this->navigation = new Navigation($this->serviceLocatorMock, $this->deploymentConfig); - } - - public function testGetType() - { - $this->assertEquals(Navigation::NAV_LANDING, $this->navigation->getType()); - } - - public function testGetData() - { - $this->assertEquals( - [ - ['key1' => 'value1'], - ['key2' => 'value2'], - ['nav' => 'abc', 'key3' => 'value3'], - ['nav' => ''], - ['nav' => false], - ['main' => 'abc', 'key3' => 'value3'], - ['main' => ''], - ['main' => false], - ], - $this->navigation->getData() - ); - } - - public function testGetMenuItems() - { - $this->assertEquals( - [['nav' => 'abc', 'key3' => 'value3']], - $this->navigation->getMenuItems() - ); - } - - public function testGetMainItems() - { - $this->assertEquals([['main' => 'abc', 'key3' => 'value3']], array_values($this->navigation->getMainItems())); - } -} diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Scanner/PluginScannerTest.php b/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Scanner/PluginScannerTest.php index 4a010ad705f19..355ffc08ea501 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Scanner/PluginScannerTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Scanner/PluginScannerTest.php @@ -12,24 +12,37 @@ class PluginScannerTest extends TestCase { + /** + * @var PluginScanner + */ + private $model; + + /** + * @var string[] + */ + private $testFiles; + + /** + * @inheritDoc + */ protected function setUp(): void { - $this->_model = new PluginScanner(); - $this->_testDir = str_replace('\\', '/', realpath(__DIR__ . '/../../') . '/_files'); - $this->_testFiles = [ - $this->_testDir . '/app/code/Magento/SomeModule/etc/di.xml', - $this->_testDir . '/app/etc/di/config.xml', + $this->model = new PluginScanner(); + $testDir = str_replace('\\', '/', realpath(__DIR__ . '/../../') . '/_files'); + $this->testFiles = [ + $testDir . '/app/code/Magento/SomeModule/etc/di.xml', + $testDir . '/app/etc/di/config.xml', ]; } protected function tearDown(): void { - unset($this->_model); + unset($this->model); } public function testCollectEntities() { - $actual = $this->_model->collectEntities($this->_testFiles); + $actual = $this->model->collectEntities($this->testFiles); $expected = [\Magento\Framework\App\Cache\TagPlugin::class, \Magento\Store\Model\Action\Plugin::class]; $this->assertEquals($expected, $actual); } diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/HtmlTest.php b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/HtmlTest.php index d7a2f0b4a9397..0e58067bb4d38 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/HtmlTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/HtmlTest.php @@ -49,6 +49,7 @@ public function testParse() 'line' => '', 'quote' => '', ], + // `I18N` is not parsed - bindings are case-sensitive [ 'phrase' => 'This is test data at right side of attr', 'file' => $this->testFile, @@ -97,12 +98,50 @@ public function testParse() 'line' => '', 'quote' => '', ], + // `<TRANSLATE>` tag is not parsed - only lowercase tags are accepted [ 'phrase' => 'This is test content in translate attribute', 'file' => $this->testFile, 'line' => '', 'quote' => '', ], + // `TRANSLATE` attribute is not parsed - only lowercase attribute names are accepted + // `$T()` is not parsed - function names in JS are case-sensitive + [ + // en_US.csv: "This is ' test ' data for attribute translation with single quotes","This is ' test ' data for attribute translation with single quotes" + 'phrase' => 'This is \\\' test \\\' data for attribute translation with single quotes', + 'file' => $this->testFile, + 'line' => '', + 'quote' => '', + ], + [ + // en_US.csv: "This is test data for attribute translation with a quote after''","This is test data for attribute translation with a quote after''" + 'phrase' => 'This is test data for attribute translation with a quote after\\\'\\\'', + 'file' => $this->testFile, + 'line' => '', + 'quote' => '', + ], + [ + // en_US.csv: "This is test data for attribute translation with a quote after' ' ","This is test data for attribute translation with a quote after' ' " + 'phrase' => 'This is test data for attribute translation with a quote after\\\' \\\' ', + 'file' => $this->testFile, + 'line' => '', + 'quote' => '', + ], + [ + // en_US.csv: "Attribute translation - Placeholder","Attribute translation - Placeholder" + 'phrase' => 'Attribute translation - Placeholder', + 'file' => $this->testFile, + 'line' => '', + 'quote' => '', + ], + [ + // en_US.csv: "Attribute translation - Title","Attribute translation - Title" + 'phrase' => 'Attribute translation - Title', + 'file' => $this->testFile, + 'line' => '', + 'quote' => '', + ] ]; $this->model->parse($this->testFile); diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/JsTest.php b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/JsTest.php index 2bbf92de0485a..0139f2a98ccf9 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/JsTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/JsTest.php @@ -43,15 +43,33 @@ public function testParse() [ 'phrase' => 'Phrase 1', 'file' => $this->_testFile, - 'line' => $this->_stringsCount - 2, + 'line' => $this->_stringsCount - 4, 'quote' => Phrase::QUOTE_SINGLE, ], [ 'phrase' => 'Phrase 2 %1', 'file' => $this->_testFile, - 'line' => $this->_stringsCount - 1, + 'line' => $this->_stringsCount - 3, 'quote' => Phrase::QUOTE_DOUBLE ], + [ + 'phrase' => 'Field ', + 'file' => $this->_testFile, + 'line' => $this->_stringsCount - 2, + 'quote' => Phrase::QUOTE_SINGLE + ], + [ + 'phrase' => ' is required.', + 'file' => $this->_testFile, + 'line' => $this->_stringsCount - 2, + 'quote' => Phrase::QUOTE_SINGLE + ], + [ + 'phrase' => 'Welcome, %1!', + 'file' => $this->_testFile, + 'line' => $this->_stringsCount - 1, + 'quote' => Phrase::QUOTE_SINGLE + ] ]; $this->_adapter->parse($this->_testFile); diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/_files/email.html b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/_files/email.html index f5603768ef306..36d7f91dd3bae 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/_files/email.html +++ b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/_files/email.html @@ -21,6 +21,7 @@ }} </span> <label data-bind="i18n: 'This is test data', attr: {for: 'more-test-data-'}"></label> + <label data-bind="I18N: 'This is test data with uppercase binding', attr: {for: 'more-test-data-'}"></label> <label data-bind="attr: {for: 'more-test-data-' + $parent.getCode()}"><span data-bind="i18n: 'This is test data at right side of attr'"></span></label> <label data-bind="i18n: 'This is \' test \' data', attr: {for: 'more-test-data-' + $parent.getCode()}"></label> <label data-bind="i18n: 'This is \" test \" data', attr: {for: 'more-test-data-' + $parent.getCode()}"></label> @@ -30,6 +31,13 @@ <label data-bind="i18n: '\''"></label> <label data-bind="i18n: '\\\\ '"></label> <span><translate args="'This is test content in translate tag'" /></span> + <span><TRANSLATE args="'This is test content in the uppercase translate tag'" /></span> <span translate="'This is test content in translate attribute'"></span> + <span TRANSLATE="'This is test content in uppercase translate attribute'"></span> + <a data-bind="attr: { title: $T('This is test data for invalid attribute translation'), href: '#'} "></a> + <a data-bind="attr: { title: $t('This is \' test \' data for attribute translation with single quotes'), href: '#'} "></a> + <a data-bind="attr: { title: $t('This is test data for attribute translation with a quote after\'\''), href: '#'} "></a> + <a data-bind="attr: { title: $t('This is test data for attribute translation with a quote after\' \' '), href: '#'} "></a> + <input type="text" data-bind="attr: { placeholder: $t('Attribute translation - Placeholder'), title: $t('Attribute translation - Title') }" /> </body> </html> diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/_files/file.js b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/_files/file.js index 11995056d3d84..85bcd526b0a60 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/_files/file.js +++ b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Parser/Adapter/_files/file.js @@ -7,4 +7,6 @@ $.mage.__('Phrase 1'); $.mage.__('Phrase 1'); $.mage.__("Phrase 2 %1"); + let message = $t('Field ') + field + $t(' is required.'); + let html = $t('Welcome, %1!').replace('%1', 'John Doe'); }); diff --git a/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php b/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php index b18345666af5e..e8bf006c3427b 100644 --- a/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php @@ -7,31 +7,16 @@ namespace Magento\Setup\Test\Unit\Mvc\Bootstrap; -use Laminas\Console\Request; use Laminas\EventManager\EventManagerInterface; use Laminas\EventManager\SharedEventManager; -use Laminas\Http\Headers; -use Laminas\Http\Response; use Laminas\Mvc\Application; use Laminas\Mvc\MvcEvent; -use Laminas\Mvc\Router\Http\RouteMatch; use Laminas\ServiceManager\ServiceLocatorInterface; use Laminas\ServiceManager\ServiceManager; use Laminas\Stdlib\RequestInterface; -use Magento\Backend\App\BackendApp; -use Magento\Backend\App\BackendAppList; -use Magento\Backend\Model\Auth; -use Magento\Backend\Model\Auth\Session; -use Magento\Backend\Model\Session\AdminConfig; -use Magento\Backend\Model\Url; -use Magento\Framework\App\Area; use Magento\Framework\App\Bootstrap as AppBootstrap; -use Magento\Framework\App\DeploymentConfig; use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\App\State; use Magento\Framework\Filesystem; -use Magento\Framework\ObjectManagerInterface; -use Magento\Setup\Model\ObjectManagerProvider; use Magento\Setup\Mvc\Bootstrap\InitParamListener; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -118,31 +103,15 @@ public function testCreateDirectoryListException() $this->listener->createDirectoryList([]); } - public function testCreateServiceNotConsole() - { - /** - * @var ServiceLocatorInterface|MockObject $serviceLocator - */ - $serviceLocator = $this->getMockForAbstractClass(ServiceLocatorInterface::class); - $mvcApplication = $this->getMockBuilder(Application::class) - ->disableOriginalConstructor() - ->getMock(); - $request = $this->getMockForAbstractClass(RequestInterface::class); - $mvcApplication->expects($this->any())->method('getRequest')->willReturn($request); - $serviceLocator->expects($this->once())->method('get')->with('Application') - ->willReturn($mvcApplication); - $this->assertEquals([], $this->listener->createService($serviceLocator)); - } - /** * @param array $zfAppConfig Data that comes from Laminas Framework Application config * @param array $env Config that comes from SetEnv - * @param string $cliParam Parameter string + * @param array|string|null $argv Argv * @param array $expectedArray Expected result array * * @dataProvider createServiceDataProvider */ - public function testCreateService($zfAppConfig, $env, $cliParam, $expectedArray) + public function testCreateService($zfAppConfig, $env, $argv, $expectedArray) { foreach ($env as $envKey => $envValue) { $_SERVER[$envKey] = $envValue; @@ -155,19 +124,16 @@ public function testCreateService($zfAppConfig, $env, $cliParam, $expectedArray) $mvcApplication = $this->getMockBuilder(Application::class) ->disableOriginalConstructor() ->getMock(); - $request = $this->getMockBuilder(Request::class) - ->disableOriginalConstructor() - ->getMock(); - $request->expects($this->any()) - ->method('getContent') - ->willReturn( - $cliParam ? ['install', '--magento-init-params=' . $cliParam] : ['install'] - ); + + if ($argv !== null) { + $zfAppConfig['argv'] = $argv; + $expectedArray['argv'] = $argv; + } + $mvcApplication->expects($this->any())->method('getConfig')->willReturn( $zfAppConfig ? [InitParamListener::BOOTSTRAP_PARAM => $zfAppConfig] : [] ); - $mvcApplication->expects($this->any())->method('getRequest')->willReturn($request); $serviceLocator->expects($this->once())->method('get')->with('Application') ->willReturn($mvcApplication); @@ -180,36 +146,61 @@ public function testCreateService($zfAppConfig, $env, $cliParam, $expectedArray) public function createServiceDataProvider() { return [ - 'none' => [[], [], '', []], - 'mage_mode App' => [['MAGE_MODE' => 'developer'], [], '', ['MAGE_MODE' => 'developer']], - 'mage_mode Env' => [[], ['MAGE_MODE' => 'developer'], '', ['MAGE_MODE' => 'developer']], - 'mage_mode CLI' => [[], [], 'MAGE_MODE=developer', ['MAGE_MODE' => 'developer']], + 'none' => [ + [], //zfAppConfig + [], //env + null, //argv + [] //expectedArray + ], + 'mage_mode App' => [ + ['MAGE_MODE' => 'developer'], + [], + '', //test non array value + ['MAGE_MODE' => 'developer'] + ], + 'mage_mode Env' => [ + [], + ['MAGE_MODE' => 'developer'], + null, + ['MAGE_MODE' => 'developer'] + ], + 'mage_mode CLI' => [ + [], + [], + ['bin/magento', 'setup:install', '--magento-init-params=MAGE_MODE=developer'], + ['MAGE_MODE' => 'developer'] + ], 'one MAGE_DIRS CLI' => [ [], [], - 'MAGE_MODE=developer&MAGE_DIRS[base][path]=/var/www/magento2', + ['bin/magento', 'setup:install', '--magento-init-params=MAGE_MODE=developer&MAGE_DIRS[base][path]=/var/www/magento2'], ['MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2']], 'MAGE_MODE' => 'developer'], ], 'two MAGE_DIRS CLI' => [ [], [], - 'MAGE_MODE=developer&MAGE_DIRS[base][path]=/var/www/magento2&MAGE_DIRS[cache][path]=/tmp/cache', + ['bin/magento', 'setup:install', '--magento-init-params=MAGE_MODE=developer&MAGE_DIRS[base][path]=/var/www/magento2&MAGE_DIRS[cache][path]=/tmp/cache'], [ 'MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2'], 'cache' => ['path' => '/tmp/cache']], 'MAGE_MODE' => 'developer', ], ], - 'mage_mode only' => [[], [], 'MAGE_MODE=developer', ['MAGE_MODE' => 'developer']], + 'mage_mode only' => [ + [], + [], + ['bin/magento', 'setup:install', '--magento-init-params=MAGE_MODE=developer'], + ['MAGE_MODE' => 'developer'] + ], 'MAGE_DIRS Env' => [ [], ['MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2']], 'MAGE_MODE' => 'developer'], - '', + null, ['MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2']], 'MAGE_MODE' => 'developer'], ], 'two MAGE_DIRS' => [ [], [], - 'MAGE_MODE=developer&MAGE_DIRS[base][path]=/var/www/magento2&MAGE_DIRS[cache][path]=/tmp/cache', + ['bin/magento', 'setup:install', '--magento-init-params=MAGE_MODE=developer&MAGE_DIRS[base][path]=/var/www/magento2&MAGE_DIRS[cache][path]=/tmp/cache'], [ 'MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2'], 'cache' => ['path' => '/tmp/cache']], 'MAGE_MODE' => 'developer', @@ -218,19 +209,19 @@ public function createServiceDataProvider() 'Env overwrites App' => [ ['MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2/App']], 'MAGE_MODE' => 'developer'], ['MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2/Env']], 'MAGE_MODE' => 'developer'], - '', + ['bin/magento', 'setup:install'], ['MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2/Env']], 'MAGE_MODE' => 'developer'], ], 'CLI overwrites Env' => [ ['MAGE_MODE' => 'developer'], ['MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2/Env']]], - 'MAGE_DIRS[base][path]=/var/www/magento2/CLI', + ['bin/magento', 'setup:install', '--magento-init-params=MAGE_DIRS[base][path]=/var/www/magento2/CLI'], ['MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2/CLI']], 'MAGE_MODE' => 'developer'], ], 'CLI overwrites All' => [ ['MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2/App']], 'MAGE_MODE' => 'production'], ['MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2/Env']]], - 'MAGE_DIRS[base][path]=/var/www/magento2/CLI', + ['bin/magento', 'setup:install', '--magento-init-params=MAGE_DIRS[base][path]=/var/www/magento2/CLI'], ['MAGE_DIRS' => ['base' => ['path' => '/var/www/magento2/CLI']], 'MAGE_MODE' => 'developer'], ], ]; diff --git a/setup/src/Zend/Mvc/Controller/LazyControllerAbstractFactory.php b/setup/src/Zend/Mvc/Controller/LazyControllerAbstractFactory.php deleted file mode 100644 index 57697cd9cd9bf..0000000000000 --- a/setup/src/Zend/Mvc/Controller/LazyControllerAbstractFactory.php +++ /dev/null @@ -1,223 +0,0 @@ -<?php -/** - * @link http://github.com/laminas/laminas-mvc for the canonical source repository - * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (http://www.zend.com) - * @license https://github.com/laminas/laminas-mvc/blob/master/LICENSE.md New BSD License - * @SuppressWarnings(PHPMD) - */ - -declare(strict_types=1); - -namespace Zend\Mvc\Controller; - -use Interop\Container\ContainerInterface; -use Laminas\Console\Adapter\AdapterInterface as ConsoleAdapterInterface; -use Laminas\Filter\FilterPluginManager; -use Laminas\Hydrator\HydratorPluginManager; -use Laminas\InputFilter\InputFilterPluginManager; -use Laminas\Log\FilterPluginManager as LogFilterManager; -use Laminas\Log\FormatterPluginManager as LogFormatterManager; -use Laminas\Log\ProcessorPluginManager as LogProcessorManager; -use Laminas\Log\WriterPluginManager as LogWriterManager; -use Laminas\Serializer\AdapterPluginManager as SerializerAdapterManager; -use Laminas\ServiceManager\AbstractFactoryInterface; -use Laminas\ServiceManager\Exception\ServiceNotFoundException; -use Laminas\ServiceManager\ServiceLocatorInterface; -use Laminas\Stdlib\DispatchableInterface; -use Laminas\Validator\ValidatorPluginManager; -use ReflectionClass; -use ReflectionParameter; - -/** - * Reflection-based factory for controllers. - * - * To ease development, this factory may be used for controllers with - * type-hinted arguments that resolve to services in the application - * container; this allows omitting the step of writing a factory for - * each controller. - * - * You may use it as either an abstract factory: - * - * <code> - * 'controllers' => [ - * 'abstract_factories' => [ - * LazyControllerAbstractFactory::class, - * ], - * ], - * </code> - * - * Or as a factory, mapping a controller class name to it: - * - * <code> - * 'controllers' => [ - * 'factories' => [ - * MyControllerWithDependencies::class => LazyControllerAbstractFactory::class, - * ], - * ], - * </code> - * - * The latter approach is more explicit, and also more performant. - * - * The factory has the following constraints/features: - * - * - A parameter named `$config` typehinted as an array will receive the - * application "config" service (i.e., the merged configuration). - * - Parameters type-hinted against array, but not named `$config` will - * be injected with an empty array. - * - Scalar parameters will be resolved as null values. - * - If a service cannot be found for a given typehint, the factory will - * raise an exception detailing this. - * - Some services provided by Zend Framework components do not have - * entries based on their class name (for historical reasons); the - * factory contains a map of these class/interface names to the - * corresponding service name to allow them to resolve. - * - * `$options` passed to the factory are ignored in all cases, as we cannot - * make assumptions about which argument(s) they might replace. - */ -class LazyControllerAbstractFactory implements AbstractFactoryInterface -{ - /** - * Maps known classes/interfaces to the service that provides them; only - * required for those services with no entry based on the class/interface - * name. - * - * Extend the class if you wish to add to the list. - * - * @var string[] - */ - protected $aliases = [ - ConsoleAdapterInterface::class => 'ConsoleAdapter', - FilterPluginManager::class => 'FilterManager', - HydratorPluginManager::class => 'HydratorManager', - InputFilterPluginManager::class => 'InputFilterManager', - LogFilterManager::class => 'LogFilterManager', - LogFormatterManager::class => 'LogFormatterManager', - LogProcessorManager::class => 'LogProcessorManager', - LogWriterManager::class => 'LogWriterManager', - SerializerAdapterManager::class => 'SerializerAdapterManager', - ValidatorPluginManager::class => 'ValidatorManager', - ]; - - /** - * @inheritDoc - * - * @return DispatchableInterface - * @throws \ReflectionException - */ - public function __invoke(ContainerInterface $container, $requestedName, array $options = null) - { - $reflectionClass = new ReflectionClass($requestedName); - - if (null === ($constructor = $reflectionClass->getConstructor())) { - return new $requestedName(); - } - - $reflectionParameters = $constructor->getParameters(); - - if (empty($reflectionParameters)) { - return new $requestedName(); - } - - $parameters = array_map( - $this->resolveParameter($container->getServiceLocator(), $requestedName), - $reflectionParameters - ); - - return new $requestedName(...$parameters); - } - - /** - * @inheritDoc - */ - public function canCreate(ContainerInterface $container, $requestedName) - { - if (! class_exists($requestedName)) { - return false; - } - - return in_array(DispatchableInterface::class, class_implements($requestedName), true); - } - - /** - * Resolve a parameter to a value. - * - * Returns a callback for resolving a parameter to a value. - * - * @param ContainerInterface $container - * @param string $requestedName - * @return callable - */ - private function resolveParameter(ContainerInterface $container, $requestedName) - { - /** - * @param ReflectionClass $parameter - * @return mixed - * @throws ServiceNotFoundException If type-hinted parameter cannot be - * resolved to a service in the container. - */ - return function (ReflectionParameter $parameter) use ($container, $requestedName) { - if ($parameter->isArray() - && $parameter->getName() === 'config' - && $container->has('config') - ) { - return $container->get('config'); - } - - if ($parameter->isArray()) { - return []; - } - - if (! $parameter->getClass()) { - return null; - } - - $type = $parameter->getClass()->getName(); - $type = isset($this->aliases[$type]) ? $this->aliases[$type] : $type; - - if (! $container->has($type)) { - throw new ServiceNotFoundException(sprintf( - 'Unable to create controller "%s"; unable to resolve parameter "%s" using type hint "%s"', - $requestedName, - $parameter->getName(), - $type - )); - } - - return $container->get($type); - }; - } - - /** - * Determine if we can create a service with name - * - * @param ServiceLocatorInterface $serviceLocator - * phpcs:disable - * @param $name - * @param $requestedName - * phpcs:enable - * @return bool - * @SuppressWarnings("unused") - */ - public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) - { - return $this->canCreate($serviceLocator, $requestedName); - } - - /** - * Create service with name - * - * @param ServiceLocatorInterface $serviceLocator - * phpcs:disable - * @param $name - * @param $requestedName - * phpcs:enable - * @return mixed - * @SuppressWarnings("unused") - * @throws \ReflectionException - */ - public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) - { - return $this($serviceLocator, $requestedName); - } -} diff --git a/setup/view/layout/layout.phtml b/setup/view/layout/layout.phtml index 9b2d6703c16bc..beadb75ca3eb2 100644 --- a/setup/view/layout/layout.phtml +++ b/setup/view/layout/layout.phtml @@ -4,31 +4,24 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile +/** + * @var \Laminas\View\Renderer\PhpRenderer $this + */ ?> <?= $this->doctype() ?> <!--[if !IE]><!--> -<html lang="en" ng-app="magento"> +<html lang="en"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>{{$state.current.title}} + Magento headLink() ->appendStylesheet($this->basePath() . '/pub/styles/setup.css'); ?> headScript() - ->appendFile($this->basePath() . '/pub/angular/angular.min.js') - ->appendFile($this->basePath() . '/pub/angular-ng-storage/angular-ng-storage.min.js') - ->appendFile($this->basePath() . '/pub/angular-ng-dialog/angular-ng-dialog.min.js') - ->appendFile($this->basePath() . '/pub/angular-clickout/angular-clickout.min.js') - ->appendFile($this->basePath() . '/pub/angular-ui-router/angular-ui-router.min.js') - ->appendFile($this->basePath() . '/pub/angular-ui-bootstrap/angular-ui-bootstrap.min.js') - ->appendFile($this->basePath() . '/pub/angular-sanitize/angular-sanitize.min.js') - ->appendFile($this->basePath() . '/pub/magento/setup/app.js') - ->appendFile($this->basePath() . '/pub/magento/setup/main.js') - ->appendFile($this->basePath() . '/pub/magento/setup/landing.js') + ->appendFile($this->basePath() . '/pub/scripts/main.js') ?>
-
- render('navigation/menu.phtml') ?> -
-
-
+
+
+ +

Version version, ENT_COMPAT) ?>

+

+ Welcome to Magento Admin, your online store headquarters. +
+ Please review Terms & Agreement + and read Getting Started + to learn how to install Magento using the command line. +

+
+
+
diff --git a/setup/view/magento/setup/landing.phtml b/setup/view/magento/setup/landing.phtml deleted file mode 100644 index 508fd86de46fd..0000000000000 --- a/setup/view/magento/setup/landing.phtml +++ /dev/null @@ -1,20 +0,0 @@ - -
- -

- version ?> -

-

- Welcome to Magento Admin, your online store headquarters. -
- Please review Terms & Agreement and read Getting Started to learn how to install Magento using the command line. -

-
diff --git a/setup/view/magento/setup/license.phtml b/setup/view/magento/setup/license.phtml deleted file mode 100644 index 6adaa49001a5c..0000000000000 --- a/setup/view/magento/setup/license.phtml +++ /dev/null @@ -1,23 +0,0 @@ - -
-
-
- license, ENT_COMPAT, 'UTF-8')) ?> -
- -
-
diff --git a/setup/view/magento/setup/navigation/menu.phtml b/setup/view/magento/setup/navigation/menu.phtml deleted file mode 100644 index 6b7ac5d35e5e0..0000000000000 --- a/setup/view/magento/setup/navigation/menu.phtml +++ /dev/null @@ -1,22 +0,0 @@ - - - -